register-kinds
Extension API register kinds.
auth-backend #
Auth credential backend. Resolves an api-key or rotates an OAuth token for one or more providers.
| Field | Type | Required | Summary |
|---|---|---|---|
:api-key # | () -> string|nil | yes | Return the current bearer/API key, refreshing or loading secrets as needed. |
:login! # | (opts) -> any | Optional. Drives fen --login <name>. | |
:logout! # | () -> any | Optional. Drives fen --logout <name>. | |
:name # | keyword|string | yes | Auth backend name selected by provider configuration or CLI login/logout flags. |
command #
Slash command contribution. Looked up by name when the user submits /<name> <args> from a presenter.
| Field | Type | Required | Summary |
|---|---|---|---|
:description # | string | Human-readable command help shown in command listings and docs. | |
:handler # | (args caller-state) -> any | yes | Callback invoked with raw command arguments and the caller's runtime state. |
:idle-only? # | boolean | Refuse the command while the agent is busy. | |
:name # | keyword|string | yes | Command name without the leading slash. |
:order # | number | Sort hint for /help. |
control #
Keyboard/UI control surface for presenters that support typed input bindings.
| Field | Type | Required | Summary |
|---|---|---|---|
:description # | string | Human-readable explanation of the control's UI effect. | |
:handler # | (ctx) -> any | yes | Callback invoked by the presenter when the control is activated. |
:name # | keyword|string | yes | Stable control name exposed to presenter help and docs. |
hook #
Lifecycle hook (currently before-tool). Inspects a tool call before it executes.
| Field | Type | Required | Summary |
|---|---|---|---|
:before-tool # | (tool-name args ctx) -> any | yes | Return {:block true :reason string} to veto. |
introspect #
Read-only extension state snapshot provider. Collected on demand for agent_state, /extensions, and runtime diagnostics.
| Field | Type | Required | Summary |
|---|---|---|---|
:description # | string | Human-readable description shown by diagnostics and docs. | |
:name # | keyword|string | yes | Owner-scoped snapshot name. Multiple extensions may reuse the same name. |
:snapshot # | (ctx) -> table | yes | Cheap, side-effect-free thunk returning JSON-friendly data. It is pcall-isolated and should not expose secrets. |
panel #
Non-modal side panel contribution rendered by presenters that support panels.
| Field | Type | Required | Summary |
|---|---|---|---|
:enabled? # | (ctx) -> boolean | Optional predicate that hides the panel without unregistering it. | |
:name # | keyword|string | yes | Stable panel name used for toggles, docs, and diagnostics. |
:render # | (ctx) -> any | yes | Callback returning rows or presenter-specific content for the panel body. |
:title # | string | Optional display title when the presenter renders panel chrome. |
presenter #
UI driver. Owns the input/output loop. Exactly one is active per run; the loader picks based on flags and manifest hints.
| Field | Type | Required | Summary |
|---|---|---|---|
:init # | (ctx) -> nil | Optional lifecycle callback run before the presenter loop starts. | |
:name # | keyword|string | yes | Presenter name selected by CLI flags or extension activation rules. |
:run # | (ctx) -> nil | yes | Main input/output loop for the selected presenter. |
:shutdown # | (ctx) -> nil | Optional lifecycle callback used to release terminal, socket, or other UI resources. |
provider #
LLM provider contribution. See the :provider-interface contract for the required record.
| Field | Type | Required | Summary |
|---|---|---|---|
:api # | keyword | yes | Protocol family (:openai-completions, :anthropic-messages, ...). Many providers may share an :api. |
:build-body # | (model ctx options) -> table | yes | Build the provider request body from a model id, AgentContext, and call options. |
:complete # | (model ctx options ?on-event ?yield-fn) -> AssistantMessage | yes | High-level provider entry point that runs one model turn and returns a canonical assistant message. |
:convert-messages # | ([Message]) -> [WireMessage] | yes | Translate canonical conversation messages into this provider's wire message format. |
:convert-tools # | ([Tool]) -> [WireTool] | yes | Translate canonical tool specs into this provider's wire tool schema. |
:map-stop-reason # | (string) -> StopReason | yes | Normalize provider stop reasons into fen's canonical StopReason enum. |
:name # | keyword|string | yes | Provider name selected by settings or CLI options. |
:parse-response # | (WireResponse) -> AssistantMessage | yes | Convert a non-streaming provider response payload into an AssistantMessage. |
session-backend #
Persistence backend for canonical JSONL-style sessions. The --session flag selects one and fen.core.extensions.register.session_backend.set-active! activates it.
| Field | Type | Required | Summary |
|---|---|---|---|
:append # | (session message) -> nil | yes | Persist one canonical Message to the active session. |
:close # | (session) -> nil | yes | Flush and release backend resources for an open session. |
:find # | (opts) -> [SessionInfo] | yes | Search sessions using backend-specific filters. |
:latest # | (opts) -> SessionInfo|nil | yes | Return the newest matching session, if any. |
:list # | (opts) -> [SessionInfo] | yes | List sessions visible to this backend in a stable display order. |
:load # | (path opts) -> [Message] | yes | Read canonical messages from a stored session path. |
:name # | keyword|string | yes | Session backend name selected by CLI flags or extension configuration. |
:open # | (opts) -> session | yes | Create or open the active session for a new run. |
:open-existing # | (path opts) -> session | yes | Open an existing session file or directory for appending. |
status #
Status-line contributor — produces a short string for the presenter's status row.
| Field | Type | Required | Summary |
|---|---|---|---|
:name # | keyword|string | yes | Stable status item name used for sorting, diagnostics, and docs. |
:order # | number | Sort hint within the status side; lower values render earlier. | |
:render # | (ctx) -> string|nil | yes | Callback returning the current status text, or nil/empty text to hide it. |
tool #
Agent tool contribution. Merged into the per-step AgentContext.tools and dispatched by name when the assistant emits a ToolCall.
| Field | Type | Required | Summary |
|---|---|---|---|
:description # | string | yes | Provider-facing guidance explaining when the model should call this tool. |
:execute # | (args ?yield-fn) -> AgentToolResult | yes | Runtime callback that executes decoded arguments and returns canonical tool content. |
:label # | string | Optional short UI label shown by presenters while the tool runs. | |
:name # | string | yes | Unique tool name exposed to providers and matched against ToolCall.name. |
:parameters # | JSONSchema | yes | JSON object schema describing the tool arguments providers may emit. |