Skip to main content

Module builtin_agents

Module builtin_agents 

Source
Expand description

Built-in agent vocabulary — single source of truth across FFI surfaces.

Holds:

  • The list of v1 built-in agents (Researcher, Summarizer, Verifier, Transcriber, NoteTaker)
  • Each agent’s identity (system prompt / display name / description)
  • The capability ids each agent advertises
  • Per-capability payload-format adapters (caller-supplied JSON → prompt text)

Why this lives in car-engine and not in any single FFI crate: NAPI (car-ffi-napi), PyO3 (car-ffi-pyo3), and UniFFI (car-ffi-uniffi) are sibling consumers of the same runtime — they MUST agree on the agent vocabulary or the surfaces drift. Per CLAUDE.md §2 (bindings parity), capability-shape changes land in all binding sites in the same change. Owning the data here makes that mechanically enforceable.

When agent bundles ship via car install, the bundle loader registers additional agents on top of these. The built-ins are the floor — the runtime always offers them even before any bundle is installed.

Structs§

BuiltinAgent
One built-in agent’s static metadata.

Enums§

CapabilityPayloadError
Errors from format_capability_payload. Surfaced to the FFI crate as CarError::InvalidArgument so Swift / Kotlin / JS callers see a structured failure when their JSON contract drifts.

Constants§

BUILTIN_AGENTS
V1 built-in roster. New entries are additive; ids are stable wire format (host UI persists them as user pinning).

Functions§

agent_metadata
Look up a built-in agent by id. None for unknown ids.
format_capability_payload
Format the per-capability JSON payload into a natural-language task for the selected agent. The contract is per-capability and documented in docs/agent-bundle-spec.md.
register_builtins
Register every built-in agent’s capabilities with the registry. Called by FFI surfaces during runtime construction; idempotent.