Adding an AI
Every agent comes from one list, PROVIDERS in packages/core/src/providers/providers.ts. The CLI flags, --help,
doctor, the prompts and Jev’s choices are all built from it, so wiring up a new AI is one entry there.
Add the agent to config.schema.json too, and to its copy in apps/docs/public/: a test fails
until both list it, with effort and reviewEffort only for an agent that takes an effort.
A chat API
Section titled “A chat API”An OpenAI-compatible chat API is one openAICompatibleProvider call:
openAICompatibleProvider({ id: 'qwen', label: 'Qwen', baseUrl: 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1', apiKeyEnv: 'DASHSCOPE_API_KEY', model: 'qwen-max',}),An agent CLI
Section titled “An agent CLI”An agent CLI that can run non-interactively and read-only, taking the prompt on stdin and printing
the plan on stdout, is one cliProvider call:
cliProvider({ id: 'acme', label: 'Acme', command: 'acme', // Whatever makes this CLI answer once, read-only, without prompting. args: ({ model, effort }) => [ 'ask', '--read-only', ...(model ? ['--model', model] : []), ...(effort ? ['--effort', effort] : []), ], effort: true, auth: ['whoami'],}),effort: true says args passes an effort on, so --effort is accepted for it. auth is
optional: arguments that exit 0 when the CLI is logged in, or a check function. So is sessions,
for a CLI that can continue a conversation: start(overrides, id) and resume(overrides, id)
return the arguments that keep one and continue it; without it every call starts afresh. A CLI
that names its own sessions reports the name as session from events.
From your own program
Section titled “From your own program”The same two builders are exported, so a program using the library can build its own agents from
them and pass them to Planner. The existing agents are listed in the
agents reference.