| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
- export interface ComputerUseRuntimeContext {
- sessionId: string;
- runtimeScope: "main" | "subagent";
- workspaceKey: string;
- workspacePath?: string;
- workspaceIdentity?: string;
- remoteSessionId?: string;
- turnId?: string;
- clientMode?: "web-remote-replayable" | "desktop-continuous";
- deliveryKind?: "web-remote-replayable" | "desktop-continuous";
- trace?: Record<string, unknown>;
- }
- export interface ComputerUseRuntimeExecuteInput {
- toolName: string;
- arguments?: unknown;
- context: ComputerUseRuntimeContext;
- signal?: AbortSignal;
- }
- export interface ComputerUseRuntime {
- // 公共 broker 读取 MCP 元数据;占位返回同一结果类型,避免导出后丢失契约。
- execute(input: ComputerUseRuntimeExecuteInput): Promise<CallToolResult>;
- closeSession(context: ComputerUseRuntimeContext): Promise<void>;
- dispose(): Promise<void>;
- }
- export interface ComputerUseRuntimeOptions {
- brokerSocketPath?: string;
- refreshMarkerPath?: string;
- ensureBrokerAvailable?: () => Promise<void>;
- env?: Record<string, string | undefined>;
- }
- export declare function createComputerUseRuntime(
- options?: ComputerUseRuntimeOptions,
- ): ComputerUseRuntime;
|