import type { AgentResponse, Language, PermissionMode, McpServerConfig, StepProviderOptions } from '../../core/models/index.js'; import type { ProviderType as SharedProviderType } from '../../shared/types/provider.js'; import type { InternalAgentIsolation, ProviderActivityCallback, StreamCallback } from '../../shared/types/provider.js'; import type { PermissionHandler, SkillPermissionHandler, AskUserQuestionHandler, ToolPermissionDecisionHandler } from '../../core/workflow/types.js'; import type { PreparedProviderMcp } from './mcp/types.js'; export interface AgentSetup { name: string; systemPrompt?: string; } export interface ProviderImageAttachment { placeholder: string; path: string; } export interface ProviderCallOptions { cwd: string; /** The caller owns session recovery; provider retries must not replay a turn. */ callerManagedSession?: true; /** Keep supplied prepared MCP alive until the caller finishes all attempts. */ callerManagedMcp?: true; /** Exact tool exposure, with ambient tools, skills and hooks disabled. */ strictToolAllowlist?: readonly string[]; /** No direct writes/network; side effects only through these exact local MCP tools. Read is allowed. */ mcpOnlySideEffects?: readonly string[]; abortSignal?: AbortSignal; sessionId?: string; internalAgentIsolation?: InternalAgentIsolation; executionPhase?: 1 | 2 | 3; /** Expose only the built-in Read tool for a strict read-only call. */ allowReadonlyFileRead?: boolean; /** Exact files that the /verify interpretation call may read. */ readonlyFileReadPaths?: readonly string[]; model?: string; /** Internal workflow capability for resolving an OpenCode runtime default. */ allowDefaultModel?: boolean; /** Per-call interactive reasoning effort override. */ effort?: string; allowedTools?: string[]; mcpServers?: Record; /** * Provider-prepared MCP material (issue #1137). When the resolved MCP server * set is non-empty, `AgentRunner` runs `validate` → `prepare` before the * provider call and passes the result here so each provider's `toXxxOptions` * can merge the provider-specific config (SDK options, CLI args, temp files) * into its call. `dispose` is owned by the runner and invoked in a `finally`. */ preparedMcp?: PreparedProviderMcp; maxTurns?: number; permissionMode?: PermissionMode; edit?: boolean; providerOptions?: StepProviderOptions; onStream?: StreamCallback; onActivity?: ProviderActivityCallback; onPermissionRequest?: PermissionHandler; onToolPermissionDecision?: ToolPermissionDecisionHandler; onSkillPermissionRequest?: SkillPermissionHandler; onAskUserQuestion?: AskUserQuestionHandler; bypassPermissions?: boolean; anthropicApiKey?: string; openaiApiKey?: string; opencodeApiKey?: string; cursorApiKey?: string; copilotGithubToken?: string; kiroApiKey?: string; outputSchema?: Record; language?: Language; imageAttachments?: ProviderImageAttachment[]; /** Directory for full Codex failure text; when omitted, oversized failures are truncated without persistence. */ failureDir?: string; childProcessEnv?: Readonly>; } export interface ProviderCompactSessionOptions { cwd: string; sessionId: string; model?: string; /** Internal workflow capability for resolving an OpenCode runtime default. */ allowDefaultModel?: boolean; abortSignal?: AbortSignal; childProcessEnv?: Readonly>; providerOptions?: StepProviderOptions; } export interface ProviderAgent { call(prompt: string, options: ProviderCallOptions): Promise; } export interface Provider { supportsStructuredOutput: boolean; /** Exact Read + explicitly named local MCP tools, without shell/edit/web access. */ supportsStrictToolAllowlist?: boolean; /** Enforces mcpOnlySideEffects via tool restrictions or a readonly, offline sandbox. */ supportsMcpOnlySideEffects?: boolean; /** Whether this provider has a dedicated strict structured execution path. */ supportsIsolatedStructuredExecution?: boolean; supportsNativeImageInput: boolean; /** * MCP transports this provider implementation actually supports. Replaces * the fixed `MCP_SERVER_PROVIDERS` set (issue #1137). An empty/undefined set * means MCP is not supported; the engine and adapter use this to fail-fast * on unsupported transports instead of silently dropping servers. */ supportedMcpTransports?: ReadonlySet<'stdio' | 'sse' | 'http'>; /** Whether runtime MCP mode can suppress ambient MCP configuration. */ supportsStrictMcpConfig?: boolean; getRuntimeInstructions(allowedTools?: string[], permissionMode?: import('../../core/models/index.js').PermissionMode, networkAccess?: boolean, callOptions?: ProviderCallOptions): string | null; supportsPermissionControls?(): boolean; keepsAllowedToolWithoutEdit(tool: string): boolean; getDefaultAllowedToolsWithoutEdit?(): readonly string[]; /** Verify runtime requirements before opening a session; omission means no startup checks are needed. */ preflight?(options: ProviderCallOptions): Promise; setup(config: AgentSetup): ProviderAgent; setupIsolatedStructured?(config: AgentSetup): ProviderAgent; /** Resolves only when the session is safe to reuse; rejects on failure or unknown state. */ compactSession?(options: ProviderCompactSessionOptions): Promise; } export type ProviderType = SharedProviderType; export declare function assertOutputSchema(schema: Record | undefined, provider: string): Record; //# sourceMappingURL=types.d.ts.map