import * as _ai_sdk_harness from '@ai-sdk/harness'; import { HarnessV1, HarnessV1BuiltinTool } from '@ai-sdk/harness'; import { ExtensionFactory } from '@earendil-works/pi-coding-agent'; /** * Pi auth options. Choose an explicit mode or rely on 'auto' (precedence: * explicit gateway, then OpenAI / Anthropic / custom environment variables). */ type PiAuthenticationMode = 'auto' | 'openai' | 'anthropic' | 'custom' | 'ai-gateway'; /** * @deprecated Passing an object to auth options is deprecated. Use a `PiAuthenticationMode` string value ("auto" | "openai" | "anthropic" | "custom" | "ai-gateway") instead, and pass credentials via environment variables. */ type LegacyPiAuthOptions = { readonly gateway?: { readonly apiKey?: string; readonly baseUrl?: string; }; /** * Resolved environment-variable pairs of the form `_API_KEY` and * (optionally) `_BASE_URL`. Special-cased prefixes: * - `AI_GATEWAY` → registers `vercel-ai-gateway` * - `OPENAI` → registers `openai` * - `ANTHROPIC` → registers `anthropic` (`ANTHROPIC_AUTH_TOKEN` adds a * bearer auth header) * Any other `_API_KEY` with a matching `_BASE_URL` is * registered as the lowercased, dash-separated prefix. */ readonly customEnv?: Record; }; type PiAuthOptions = PiAuthenticationMode | LegacyPiAuthOptions; type PiThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh'; /** * Configuration knobs for `createPi`. Pi runs as an in-process Node library * (no bridge), so there's no `port` or `startupTimeoutMs` to set. */ type PiHarnessSettings = { /** Where Pi sources API keys / gateway credentials from. */ readonly auth?: PiAuthOptions; /** * Pi model id (or name). Leaving this unset falls back to the AI Gateway * default when `AI_GATEWAY_API_KEY` / `VERCEL_OIDC_TOKEN` is set, and to * Pi's own resolution otherwise. */ readonly model?: string; /** * Pi's extended-thinking budget level. Maps directly to the SDK's * `thinkingLevel` option on `createAgentSession`. */ readonly thinkingLevel?: PiThinkingLevel; /** * Directory holding Pi's global agent config (auth.json, models.json, * settings.json). When omitted, a per-session temp dir is used. Pass the * user's agent dir (e.g. `~/.pi/agent/`) to reuse their CLI auth and * model settings. */ readonly agentDir?: string; /** * MCP server definitions keyed by server name. Each definition uses the * underlying runtime's native MCP server configuration format. */ readonly mcpServers?: Record; /** * Trusted inline Pi extensions loaded for each harness session. * * Filesystem-discovered user and project extensions remain disabled. */ readonly extensionFactories?: ReadonlyArray; }; declare const PI_BUILTIN_TOOLS: { readonly read: HarnessV1BuiltinTool<{ file_path: string; }, unknown>; readonly write: HarnessV1BuiltinTool<{ file_path: string; content: string; }, unknown>; readonly edit: HarnessV1BuiltinTool<{ file_path: string; old_string: string; new_string: string; }, unknown>; readonly bash: HarnessV1BuiltinTool<{ command: string; timeout?: number | undefined; }, unknown>; readonly grep: HarnessV1BuiltinTool<{ pattern: string; path?: string | undefined; glob?: string | undefined; ignoreCase?: boolean | undefined; literal?: boolean | undefined; context?: number | undefined; limit?: number | undefined; }, unknown>; readonly glob: HarnessV1BuiltinTool<{ pattern: string; path?: string | undefined; limit?: number | undefined; }, unknown>; readonly ls: HarnessV1BuiltinTool; }; declare function createPi(settings?: PiHarnessSettings): HarnessV1; declare const VERSION: string; /** * Default `pi` harness instance with no overrides — suitable for the common * case where Pi's defaults are fine. Equivalent to `createPi()`. */ declare const pi: _ai_sdk_harness.HarnessV1<{ readonly read: _ai_sdk_harness.HarnessV1BuiltinTool<{ file_path: string; }, unknown>; readonly write: _ai_sdk_harness.HarnessV1BuiltinTool<{ file_path: string; content: string; }, unknown>; readonly edit: _ai_sdk_harness.HarnessV1BuiltinTool<{ file_path: string; old_string: string; new_string: string; }, unknown>; readonly bash: _ai_sdk_harness.HarnessV1BuiltinTool<{ command: string; timeout?: number | undefined; }, unknown>; readonly grep: _ai_sdk_harness.HarnessV1BuiltinTool<{ pattern: string; path?: string | undefined; glob?: string | undefined; ignoreCase?: boolean | undefined; literal?: boolean | undefined; context?: number | undefined; limit?: number | undefined; }, unknown>; readonly glob: _ai_sdk_harness.HarnessV1BuiltinTool<{ pattern: string; path?: string | undefined; limit?: number | undefined; }, unknown>; readonly ls: _ai_sdk_harness.HarnessV1BuiltinTool; }>; export { type PiAuthOptions, type PiAuthenticationMode, type PiHarnessSettings, VERSION, createPi, pi };