Add a slot or composer pill
Put a small piece of your plugin at a fixed place in the widget, or a pill above the composer.
A slot puts your content at a fixed place in the widget, such as a session's status area. A pill sits above the composer. It runs an action when the user clicks it. You write the browser part in Solid, React, Preact or plain DOM.
In React and Preact the code lives in your app. Give it to <ConcivWidget> as in
Build your first plugin.
Copy this prompt into your agent. It builds this in your project from this page.
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/slot-pill.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. Add a slot in the conciv panel, or a pill above the composer, from my plugin. 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 to look for it in the conciv panel. 8. When you are done, tell me what you changed and how to see it.
Add a slot
Add a slot in your plugin's browser part:
import {Plugin, } from '@conciv/frontend-plugin-api'
export default Plugin.({
() {
.(, {
: 'session.status', // <- the place in the widget
: () => <>{...() === 'running' ? 'Agent working' : 'Agent idle'}</>,
})
},
})run.status() is a Solid signal, so a React component does not draw again when it changes. Pass a function to
ctx.add instead. The widget runs it again when the status changes:
import {, type Plugin} from '@conciv/frontend-plugin-api'
import {} from '@conciv/react'
function () {
return <>Agent working</>
}
function () {
return <>Agent idle</>
}
const : = {
const : = {
export const : Plugin.
.
}run.status() is a Solid signal, so a Preact component does not draw again when it changes. Pass a function to
ctx.add instead. The widget runs it again when the status changes:
import {, type Plugin} from '@conciv/frontend-plugin-api'
import {} from '@conciv/preact'
function () {
return <>Agent working</>
}
function () {
return <>Agent idle</>
}
const : = {
const : = {
export const : Plugin.
.
}run.status() is a Solid signal, so subscribe does not call you when it changes. Pass a function to ctx.add
instead. The widget runs it again when the status changes:
import {, Plugin, } from '@conciv/frontend-plugin-api'
function (: string): {
return {
: 'session.status', // <- the place in the widget
const = .(.
. =
return () => .()
}),
}
}
const = ('Agent working')
const = ('Agent idle')
export default Plugin.
() {
.
},
})render draws the content once. Read input.session where you use it, so it follows the session on screen. The
places a slot can go:
session.header: a session's header.session.status: a session's status area.window.bottom: the bottom of the widget window.page.overlay: over your app's page, outside the widget. It keeps keyboard focus inside, unless you sethides: false.
Build or wire it as in Build or wire the browser part, then reload.
Add a pill above the composer
A pill can put text in the composer for the user to send. It draws no UI of its own, so the code is the same in every tab. Only where it lives changes:
import {
import {
import {
import {
A few things to notice:
showreturns what the pill looks like, orundefinedto hide it. It runs once per composer on screen.iconis a name from the widget's icon set. The names are lucide names.runis what a click does. Here it puts a prompt in the composer. The user sends it.
Build or wire it as in Build or wire the browser part, then reload.
Show something only some of the time
Pass a function to ctx.add. The widget runs it again when what it reads changes. Returning undefined adds nothing:
import {Plugin, } from '@conciv/frontend-plugin-api'
export default
import
import
import {
ctx.app.channel is the widget's release channel. Build or wire it as in
Build or wire the browser part, then reload.
Next steps
- Add a panel: a whole tab next to the chat.
- Add settings: let the user switch your slot on and off.