import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils'; import * as _ai_sdk_harness from '@ai-sdk/harness'; import { HarnessV1CredentialForwarding, HarnessV1PortEndpoint, HarnessV1, HarnessV1BuiltinTool } from '@ai-sdk/harness'; type OpenCodeResolvedAuthenticationMode = 'anthropic' | 'openai' | 'ai-gateway'; type OpenCodeAuthenticationMode = OpenCodeResolvedAuthenticationMode | 'auto'; /** * @deprecated Passing an object to auth options is deprecated. Use an `OpenCodeAuthenticationMode` string value ("auto" | "anthropic" | "openai" | "ai-gateway") instead, and pass credentials via environment variables. */ type LegacyOpenCodeAuthOptions = { readonly gateway?: { readonly apiKey?: string; readonly baseUrl?: string; }; readonly anthropic?: { readonly apiKey?: string; readonly authToken?: string; readonly baseUrl?: string; }; readonly openai?: { readonly apiKey?: string; readonly baseUrl?: string; readonly organization?: string; readonly project?: string; }; readonly openaiCompatible?: { readonly apiKey?: string; readonly baseUrl?: string; readonly name?: string; readonly queryParams?: Record; }; }; type OpenCodeAuthOptions = OpenCodeAuthenticationMode | LegacyOpenCodeAuthOptions; type OpenCodeHarnessSettings = { readonly auth?: OpenCodeAuthOptions; /** * Customizes each credential value before it is forwarded into a sandbox * process. This does not restrict which credentials the harness adapter can * discover, read, or otherwise access in the host process. */ readonly credentialForwarding?: HarnessV1CredentialForwarding; /** * MCP server definitions keyed by server name. Each definition uses the * underlying runtime's native MCP server configuration format. */ readonly mcpServers?: Record; readonly model?: string; readonly provider?: string; /** * OpenCode reasoning/thinking variant for reasoning-capable models, e.g. * `'low'`, `'medium'`, `'high'`, or another model-supported OpenCode * variant. */ readonly reasoningVariant?: string; readonly port?: number; /** * Override the host endpoint used to connect to the sandbox bridge. Required * together with `port` when using a basic sandbox session. */ readonly portEndpoint?: HarnessV1PortEndpoint; readonly startupTimeoutMs?: number; /** * Creates the authentication token used by the sandbox bridge. Defaults to * a random 32-byte hexadecimal token. */ readonly mintBridgeToken?: (sandboxId: string) => string; }; declare const OPENCODE_BUILTIN_TOOLS: { readonly read: HarnessV1BuiltinTool<{ [x: string]: unknown; file_path?: string | undefined; path?: string | undefined; }, unknown>; readonly write: HarnessV1BuiltinTool<{ [x: string]: unknown; file_path?: string | undefined; path?: string | undefined; content?: string | undefined; }, unknown>; readonly edit: HarnessV1BuiltinTool<{ [x: string]: unknown; file_path?: string | undefined; path?: string | undefined; old_string?: string | undefined; new_string?: string | undefined; }, unknown>; readonly bash: HarnessV1BuiltinTool<{ [x: string]: unknown; command?: string | undefined; }, unknown>; readonly glob: HarnessV1BuiltinTool<{ [x: string]: unknown; pattern?: string | undefined; path?: string | undefined; }, unknown>; readonly grep: HarnessV1BuiltinTool<{ [x: string]: unknown; pattern?: string | undefined; path?: string | undefined; }, unknown>; readonly ls: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; path?: string | undefined; }, any, any>; readonly webfetch: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; url?: string | undefined; prompt?: string | undefined; }, any, any>; readonly skill: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; name?: string | undefined; }, any, any>; readonly todowrite: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; todos?: { [x: string]: unknown; content?: string | undefined; status?: string | undefined; priority?: string | undefined; }[] | undefined; }, any, any>; readonly agent: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; agent?: string | undefined; prompt?: string | undefined; description?: string | undefined; metadata?: Record | undefined; }, any, any>; }; declare function createOpenCode(settings?: OpenCodeHarnessSettings): HarnessV1; declare const VERSION: string; /** * Default `openCode` harness instance with no overrides. Equivalent to * `createOpenCode()`. */ declare const openCode: _ai_sdk_harness.HarnessV1<{ readonly read: _ai_sdk_harness.HarnessV1BuiltinTool<{ [x: string]: unknown; file_path?: string | undefined; path?: string | undefined; }, unknown>; readonly write: _ai_sdk_harness.HarnessV1BuiltinTool<{ [x: string]: unknown; file_path?: string | undefined; path?: string | undefined; content?: string | undefined; }, unknown>; readonly edit: _ai_sdk_harness.HarnessV1BuiltinTool<{ [x: string]: unknown; file_path?: string | undefined; path?: string | undefined; old_string?: string | undefined; new_string?: string | undefined; }, unknown>; readonly bash: _ai_sdk_harness.HarnessV1BuiltinTool<{ [x: string]: unknown; command?: string | undefined; }, unknown>; readonly glob: _ai_sdk_harness.HarnessV1BuiltinTool<{ [x: string]: unknown; pattern?: string | undefined; path?: string | undefined; }, unknown>; readonly grep: _ai_sdk_harness.HarnessV1BuiltinTool<{ [x: string]: unknown; pattern?: string | undefined; path?: string | undefined; }, unknown>; readonly ls: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; path?: string | undefined; }, any, any>; readonly webfetch: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; url?: string | undefined; prompt?: string | undefined; }, any, any>; readonly skill: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; name?: string | undefined; }, any, any>; readonly todowrite: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; todos?: { [x: string]: unknown; content?: string | undefined; status?: string | undefined; priority?: string | undefined; }[] | undefined; }, any, any>; readonly agent: _ai_sdk_provider_utils.Tool<{ [x: string]: unknown; agent?: string | undefined; prompt?: string | undefined; description?: string | undefined; metadata?: Record | undefined; }, any, any>; }>; export { type OpenCodeAuthOptions, type OpenCodeAuthenticationMode, type OpenCodeHarnessSettings, VERSION, createOpenCode, openCode };