UNPKG

framework

Version:

The (AI) Framework: turnkey, zero-config AI orchestration that wraps a coding-agent CLI (Claude Code) as a black box and takes you from an idea to a running app. Vite for AI.

61 lines 2.96 kB
import { type ClaudeCodeDriverOptions, type Driver } from './driver/index.js'; import { type DriverName } from './driver-names.js'; /** * Which agent drives an agent (#542). Each is a whole coding-agent CLI the user * already pays for, driven on their own subscription with no API key (#495). * * The names live in the node-free `agent-names.ts` so the dashboard and the registry read * the same list without touching the driver layer; this module adds what only the node side * needs (binaries, drivers). Historical import sites keep working via these re-exports. */ export { DRIVERS, isDriverName, driverFromImpl, DRIVER_LABELS, type DriverName } from './driver-names.js'; /** * How an agent CLI answers "am I logged in?", and what fixes it when the answer is no (#1326). * * The exit code cannot decide this on its own: `claude auth status` prints its answer as JSON * and exits 0 either way. So each agent reads its own answer, and anything unrecognised comes * back `undefined` (could not say) rather than `false`. That asymmetry is deliberate. A wrong * "you are logged out" blocks a setup that works, which is worse than the silent dead agent this * exists to prevent, so only a CLI that says no out loud fails preflight. */ export interface AgentAuthSpec { /** The args that make the CLI report its login state, e.g. `auth status`. */ args: readonly string[]; /** Reads the CLI's answer out of its output. `undefined` when it could not say. */ loggedIn: (result: { ok: boolean; output: string; }) => boolean | undefined; /** The one command that fixes a logged-out CLI. */ fix: string; } /** What we know about an agent before we run it. */ export interface DriverSpec { /** How to say it in a sentence, e.g. "Claude Code". */ label: string; /** The CLI binary, resolved on PATH. */ bin: string; /** Shown when preflight cannot find {@link bin}. */ installHint: string; /** How preflight asks the CLI whether it is logged in (#1326). */ auth: AgentAuthSpec; } /** The agents we can drive, and what each can tell us about itself. */ export declare const DRIVER_SPECS: Record<DriverName, DriverSpec>; /** Options for {@link createDriver}. */ export interface CreateDriverOptions { driver: DriverName; /** Claude Code driver options. Ignored by any other agent, which has its own. */ claudeOpts?: ClaudeCodeDriverOptions; } /** * Build the {@link Driver} for the picked driver name — the one place a session turns * the choice into a live implementation. * * Codex takes none of the Claude options: its sandbox is its own flag rather * than a permission mode, and it has no MCP config for `--browser`. Those are * dropped here and reported at the call site, so a flag that cannot apply says * so rather than looking honored. */ export declare function createDriver(opts: CreateDriverOptions): Driver; //# sourceMappingURL=driver-cli.d.ts.map