Skip to main content

Type Alias: ClientContext

ClientContext = object

Browser capabilities bound to the installed plugin identity.

Properties

events

events: object

Subscribe to platform events and retain the returned cleanup function. Same allowlist as the host ctx.events.on (PluginEventKind). Any other kind, mission transcripts included, throws at runtime.

subscribe()

subscribe(kind, handler): () => void

Parameters
kind

"mission_complete" | "task_blocked" | "task_done" | "workflow_run" | "workflow_proposal" | "notifications_changed"

handler

(event) => void

Returns

() => void


id

readonly id: string

Manifest identity of this plugin.


realtime

realtime: object

API 4: subscribe to this plugin's own topics. Only the owner account receives a signal, never another account (including superadmins). Topics must match ^[a-z0-9][a-z0-9._-]63$ or subscribe throws. The handler receives the payload, not the transport envelope. Cleanup is automatic on plugin disposal; the returned function can unsubscribe earlier. Host publishing requires realtime:publish.

subscribe()

subscribe(topic, handler): () => void

Parameters
topic

string

handler

(payload) => void

Returns

() => void


settings

settings: object

get()

get(): Promise<Record<string, unknown>>

Read browser-safe settings; secret plaintext is never returned.

Returns

Promise<Record<string, unknown>>

set()

set(key, value): Promise<Response>

Persist a declared setting through the authenticated platform endpoint.

Parameters
key

string

value

unknown

Returns

Promise<Response>


slots

slots: object

register()

register(options, Component): () => void

Registers a component in options.slot. Admission compares slot NATURES, not just names: a manifest declaring any *.widget slot may fill every widget host (cockpit.widget, sidebar.left.widget, a third-party layout's own widget zone). Any other slot stays an exact match — a widget never gets root, page, settings.section or settings.missions. Settings graft slots (settings.missions, …) are exact too: declaring one native group does not open the others. Throws when the slot is refused or undeclared.

Parameters
options
children?

SlotChildren

key?

string

slot

string

widget?

WidgetOptions

Component

ClientComponent

Returns

() => void


theme

theme: object

current()

current(): "light" | "dark"

Returns

"light" | "dark"


usage

usage: object

Quotas of the LLM accounts. Needs usage:read in the manifest — the daemon answers 403 otherwise, so a plugin never reads a fabricated zero.

list()

list(): Promise<UsageEntry[]>

Returns

Promise<UsageEntry[]>

Methods

api()

api(path, init?): Promise<Response>

Fetch a path beneath this plugin's own API namespace.

Parameters

path

string

init?

RequestInit

Returns

Promise<Response>


effect()

effect(setup): void

Own a synchronous setup and its cleanup for the plugin lifetime.

Parameters

setup

() => void | (() => void)

Returns

void


navigate(href): void

Navigate through the host application.

Parameters

href

string

Returns

void