/** * VercelAgentRunner โ€” AgentRunner impl backed by the Vercel AI SDK. * * Architecture: unlike Claude/Kimi/Codex which spawn subprocess binaries or * run the whole agent loop in-process via vendor SDKs, Vercel SDK is a thin * HTTP client over each vendor's native API. We compose the agent loop * manually via streamText + stopWhen: isStepCount(N), per Vercel v7 docs. * * Critical design decisions (see plan review ยง1-4): * 1. Session resume: Vercel is stateless; we persist messages to disk via * VercelSessionStore and reload on resume. * 2. Tool policy: every tool's execute() wraps args.canUseTool โ€” bypassing * it would defeat the per-role policy engine (denyTools, file scope, etc.) * 3. Cost: Vercel returns token usage but no USD; the result carries no * cost_usd (unknown, reported as null โ€” never 0). Token budgets still * enforce via policy.ts. * 4. Mailbox consumption: Vercel's streamText takes a single prompt, not an * async iterable. We loop over args.prompt, running one streamText per * mailbox message and accumulating into messages[]. * * Streaming: Vercel streams per-token text-delta events. The runner joins * them into one `assistant` message per model step (one org chat event, * #563) and yields the raw deltas only when extras.includePartialMessages * is set, like the other runners. */ import type { AgentMessage, AgentRunArgs, AgentRunner } from './agent-runner.js'; export interface VercelRunnerArgs extends AgentRunArgs { /** Vendor slug from the provider config (e.g. 'glm', 'openai', 'deepseek'). */ vendor?: string; /** Full provider config from the role definition. */ providerConfig?: { kind?: string; vendor?: string; apiKeyEnv?: string; baseUrl?: string; }; } export declare class VercelAgentRunner implements AgentRunner { run(args: VercelRunnerArgs): AsyncIterable; } //# sourceMappingURL=vercel-runner.d.ts.map