Skip to Content
DocsPluginsComparisonChangelog
0
DocsChangelog

More

Discussionsllms.txtllms-full.txt
Getting startedWhat is concivComparisonRequirementsPlaygroundExamplesAPI reference

Engine and widgetSessionsHarnessesTools and code modeAgents and permissionsSkills

Use conciv
Bundlers
Agents
PluginsBuild your first plugin
Add a toolAsk for permissionAdd a skillShare an RPC methodCall from a terminalAdd a panelSlot or pillAdd settingsTest your plugin
Plugin API reference
PluginsGuides

Add settings

Read options from the project's conciv config, and add a setting the user changes in the widget.

A plugin has two kinds of settings. Options live in the project's conciv config. The team shares them through the repo. A setting in the widget is one the user changes. It stays on their machine.

Copy this prompt into your agent. It builds this in your project from this page.

Prompt
Build this in my project with conciv. conciv is a dev-only AI agent widget, and it already runs in my app.

1. Read https://conciv.dev/docs/plugins/guides/settings.md and follow it. It is the source of truth for the API.
2. If the project has the conciv-develop skill (conciv init installs it with the @conciv/skills docs pack), load it too.
3. Give my plugin options from the conciv config, or a setting in the widget settings, as the page shows.
4. If I did not say what it should do, ask me before you write code.
5. Write the browser part in the UI framework my app uses. For React or Preact, put it in my app with @conciv/react or @conciv/preact and give it to <ConcivWidget>, as the page shows. For anything else, use Solid in the plugin folder and build it as the page shows.
6. Install only the packages the page lists, with the package manager this project uses.
7. Tell me where the option goes in my config, or where the setting shows in the widget settings.
8. When you are done, tell me what you changed and how to see it.

Pass options from the config

A plugin in conciv/plugins loads with no options. To pass some, list its folder in the plugins option as [path, options]:

vite.config.ts
import {} from 'vite'
import  from '@conciv/it/plugin/vite'

export default ({
  : [({: [['./conciv/plugins/tickets', {: 'OPS', : 30}]]})],
})
next.config.ts
import type {NextConfig} from 'next'
import {} from '@conciv/it/plugin/nextjs'

const : NextConfig = {}

export default (, {
webpack.config.js
const conciv = require('@conciv/it/plugin/webpack')

module.exports = {
  mode: 'development',
  plugins: [conciv.default({plugins: [['./conciv/plugins/tickets', {project: 'OPS', closeAfterDays: 30}]]})],
}
rspack.config.js
const conciv = require('@conciv/it/plugin/rspack')

module.exports = {
  mode: 'development',
  plugins: [conciv.default({plugins: [['./conciv/plugins/tickets', {project: 'OPS', closeAfterDays: 30}]]})],
}

Your engine part reads them as ctx.options. Check them with a schema first, since the user can write anything:

conciv/plugins/tickets/server.ts
import {} from 'zod'
import {Plugin} from '@conciv/backend-plugin-api'

const  = .({
  : .(),
  : .().
})

export default Plugin.({
  : 'tickets',
  async () {
    const  = 
    await ..(() => {
      .({
        : 'ticket_policy',
        : 'Name the tracker project this repo files tickets in, and when stale tickets close.',
        : .
        : async () => ({
          : `Tickets go in ${.}. Stale tickets close after ${
        }),
      })
    })
  },
})
conciv/plugins/tickets/server.ts
import {} from 'effect'
import {} from 'zod'
import {Plugin























A few things to notice:

  • ctx.options is the object from the config entry. Every value in it is JSON.
  • Options.parse checks it and fills in the defaults.
  • In both tabs a parse that fails stops the plugin from loading, with zod's message in the log. That tells the user what to fix.
  • The browser part gets the same object as ctx.options.

Add a setting to the widget

Declare a store for the value, then add a row to the widget's settings. You write the browser part in Solid, React, Preact or plain DOM:

conciv/plugins/tickets/plugin-experimental.tsx
import {Plugin, , 

































The row lives in your app. Give it to <ConcivWidget> as in Build your first plugin.

src/conciv/tickets.tsx

A few things to notice:

  • prefs.value is the stored value. prefs.set replaces it. The widget saves it for you.
  • In Solid, usePlugin gives a component your plugin's context. ctx.stores.prefs is typed from the declaration.
  • In Solid, ctx.ui holds the widget's own components, so the row looks like the widget's own settings. They are Solid components, so the other tabs draw a plain checkbox.
  • prefs.value is a Solid store. Outside Solid, read it once as the row draws, and keep your own state after.
  • entries is what the settings search finds.
  • With no page, the entry is a page of its own. With only page: 'general', it is a section on the General page.

Build or wire it as in Build or wire the browser part, then reload.

Next steps

  • Add a slot or composer pill: show something that the setting switches.
  • Plugin API reference: every field of ctx.

Slot or pill

Put a small piece of your plugin at a fixed place in the widget, or a pill above the composer.

Test your plugin

Start a real conciv engine with your plugin in a test, script the agent's replies, and drive the widget in a browser test.

On this page

Pass options from the configAdd a setting to the widgetNext steps
Edit on GitHubView .mdOpen in ClaudeOpen in ChatGPT

The row lives in your app. Give it to <ConcivWidget> as in Build your first plugin.

src/conciv/tickets.tsx
conciv/plugins/tickets/plugin-experimental.ts
import {



























: [[
'./conciv/plugins/tickets'
, {
:
'OPS'
,
:
30
}]]})
().
().
(
14
),
// <- 14 unless the user sets it
.
(
.
)
({}),
.
} days.`
,
}
from
'@conciv/backend-plugin-api/effect'
const = .
: .(),
: .().
})
export default Plugin.({
: 'tickets',
: () =>
.
const = yield* .
yield* ..(() => {
.({
: 'ticket_policy',
: 'Name the tracker project this repo files tickets in, and when stale tickets close.',
: .
: () =>
.({
: `Tickets go in ${.}. Stale tickets close after ${
}),
})
})
}),
})
,
}
from
'@conciv/frontend-plugin-api'
import {} from 'zod'
const = {
:
}
function () {
const =
const =
return (
<.
<.
="Show closed tickets"
={.
={() =>
/>
</.
)
}
export default Plugin.
, // <- the widget loads these before setup runs
(
.
: 'tickets',
: 'general',
: 'general', // <- one row in the General section
: 'Tickets',
: [{: 'show-closed', : 'Show closed tickets', : 'tickets closed'}],
: () => < />,
})
},
})
import {

Spread the declarations into the entry, so the widget loads the store before setup runs:

src/app.tsx
import {

import {} from 'preact/hooks' import

Spread the declarations into the entry, so the widget loads the store before setup runs:

src/app.tsx
import {

,
Plugin
,
,
}
from
'@conciv/frontend-plugin-api'
import {} from 'zod'
const = {
:
}
export default Plugin.
, // <- the widget loads these before setup runs
(
const =
.
: 'tickets',
: 'general',
: 'general', // <- one row in the General section
: 'Tickets',
: [{: 'show-closed', : 'Show closed tickets', : 'tickets closed'}],
:
const = .(.
const = .(.
. = 'checkbox'
. =
.('change', () =>
.('Show closed tickets')
return () => .()
}),
})
},
})
({
().
().
(
14
),
// <- 14 unless the user sets it
(
function*
() {
(()
=>
.
(
.
))
({}),
.
} days.`
,
.
(
.
({
:
.
()}), {
:
false
}),
// <- one value for every project
<{
:
typeof
}>()
.
.
.
=
"Show closed tickets"
>
.
.
}
.
({
:
})}
.
>
({
) {
(
, {
}
from
'react'
import {Plugin, ,
import {} from '@conciv/react'
import {} from 'zod'
export const = Plugin.
: {
:
},
})
export const : Plugin.
const =
function () {
const [, ] =
return (
<>
<
="checkbox"
={}
={() => {
(..)
.
}}
/>
Show closed tickets
</>
)
}
.
: 'tickets',
: 'general',
: 'general', // <- one row in the General section
: 'Tickets',
: [{: 'show-closed', : 'Show closed tickets', : 'tickets closed'}],
:
})
}
,
}
from
'./conciv/tickets'
const
{
Plugin
,
,
}
from
'@conciv/frontend-plugin-api'
import {} from '@conciv/preact'
import {} from 'zod'
export const = Plugin.
: {
:
},
})
export const : Plugin.
const =
function () {
const [, ] =
return (
<>
<
="checkbox"
={}
={() => {
(..)
.
}}
/>
Show closed tickets
</>
)
}
.
: 'tickets',
: 'general',
: 'general', // <- one row in the General section
: 'Tickets',
: [{: 'show-closed', : 'Show closed tickets', : 'tickets closed'}],
:
})
}
,
}
from
'./conciv/tickets'
const
.
(
.
({
:
.
()}), {
:
false
}),
// <- one value for every project
({
) {
.
.
(
, {
((
)
=>
{
(
'label'
))
(
'input'
))
.
.
// <- read once, as the row draws
.
({
:
.
}))
}
from
'@conciv/frontend-plugin-api'
({
.
(
.
({
:
.
()}), {
:
false
}),
// <- one value for every project
<
typeof
>
=
(
)
=>
{
.
.
(
.
.
)
// <- read once, as the row draws
({
:
.
.
})
(
, {
(
),
=
[[{
:
'tickets'
,
...
,
:
async
()
=>
({
:
})}, {}]]
as
({
.
(
.
({
:
.
()}), {
:
false
}),
// <- one value for every project
<
typeof
>
=
(
)
=>
{
.
.
(
.
.
)
// <- read once, as the row draws
({
:
.
.
})
(
, {
(
),
=
[[{
:
'tickets'
,
...
,
:
async
()
=>
({
:
})}, {}]]
as