@di-code/coding-agent 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -567
- package/compositions/base.yml +54 -0
- package/compositions/interactive.yml +14 -0
- package/compositions/json.yml +6 -0
- package/compositions/print.yml +5 -0
- package/compositions/rpc.yml +12 -0
- package/compositions/webui.yml +9 -0
- package/dist/cli.d.ts +22 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +97 -3
- package/dist/cli.js.map +1 -1
- package/dist/composition-loader-entry.d.ts +11 -0
- package/dist/composition-loader-entry.d.ts.map +1 -0
- package/dist/composition-loader-entry.js +12 -0
- package/dist/composition-loader-entry.js.map +1 -0
- package/dist/compositions.d.ts +32 -0
- package/dist/compositions.d.ts.map +1 -0
- package/dist/compositions.js +173 -0
- package/dist/compositions.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +9 -2
- package/dist/core/session/session-manager.d.ts.map +1 -1
- package/dist/core/session/session-manager.js +28 -0
- package/dist/core/session/session-manager.js.map +1 -1
- package/dist/core/session/session-storage.d.ts.map +1 -1
- package/dist/core/session/session-storage.js +20 -3
- package/dist/core/session/session-storage.js.map +1 -1
- package/dist/core/session/types.d.ts +11 -2
- package/dist/core/session/types.d.ts.map +1 -1
- package/dist/core/session/types.js.map +1 -1
- package/dist/core/session-tools.d.ts +5 -0
- package/dist/core/session-tools.d.ts.map +1 -0
- package/dist/core/session-tools.js +17 -0
- package/dist/core/session-tools.js.map +1 -0
- package/dist/core/session.d.ts +19 -7
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +71 -39
- package/dist/core/session.js.map +1 -1
- package/dist/core/tools/bash.d.ts +1 -38
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +1 -207
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +1 -24
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +1 -135
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +1 -26
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +1 -140
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +1 -23
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/file-search.d.ts +1 -13
- package/dist/core/tools/file-search.d.ts.map +1 -1
- package/dist/core/tools/file-search.js +1 -98
- package/dist/core/tools/file-search.js.map +1 -1
- package/dist/core/tools/glob.d.ts +1 -10
- package/dist/core/tools/glob.d.ts.map +1 -1
- package/dist/core/tools/glob.js +1 -43
- package/dist/core/tools/glob.js.map +1 -1
- package/dist/core/tools/grep.d.ts +1 -12
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +1 -66
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/load-skill.d.ts +1 -9
- package/dist/core/tools/load-skill.d.ts.map +1 -1
- package/dist/core/tools/load-skill.js +1 -21
- package/dist/core/tools/load-skill.js.map +1 -1
- package/dist/core/tools/path-boundary.d.ts +1 -4
- package/dist/core/tools/path-boundary.d.ts.map +1 -1
- package/dist/core/tools/path-boundary.js +1 -65
- package/dist/core/tools/path-boundary.js.map +1 -1
- package/dist/core/tools/read.d.ts +1 -16
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +1 -131
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts +1 -16
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +1 -44
- package/dist/core/tools/write.js.map +1 -1
- package/dist/entry.js +30 -28
- package/dist/entry.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/interactive/builtin.d.ts +17 -0
- package/dist/interactive/builtin.d.ts.map +1 -0
- package/dist/interactive/builtin.js +47 -0
- package/dist/interactive/builtin.js.map +1 -0
- package/dist/interactive/controller.d.ts +85 -0
- package/dist/interactive/controller.d.ts.map +1 -0
- package/dist/interactive/controller.js +211 -0
- package/dist/interactive/controller.js.map +1 -0
- package/dist/interactive/index.d.ts +3 -0
- package/dist/interactive/index.d.ts.map +1 -0
- package/dist/interactive/index.js +3 -0
- package/dist/interactive/index.js.map +1 -0
- package/dist/interactive-host-entry.d.ts +7 -0
- package/dist/interactive-host-entry.d.ts.map +1 -0
- package/dist/interactive-host-entry.js +123 -0
- package/dist/interactive-host-entry.js.map +1 -0
- package/dist/interactive-profile.d.ts +18 -0
- package/dist/interactive-profile.d.ts.map +1 -0
- package/dist/interactive-profile.js +290 -0
- package/dist/interactive-profile.js.map +1 -0
- package/dist/interactive-resources-entry.d.ts +7 -0
- package/dist/interactive-resources-entry.d.ts.map +1 -0
- package/dist/interactive-resources-entry.js +42 -0
- package/dist/interactive-resources-entry.js.map +1 -0
- package/dist/legacy-main.d.ts +39 -0
- package/dist/legacy-main.d.ts.map +1 -0
- package/dist/legacy-main.js +611 -0
- package/dist/legacy-main.js.map +1 -0
- package/dist/main.d.ts +15 -34
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +130 -518
- package/dist/main.js.map +1 -1
- package/dist/mcp/entries.d.ts +42 -0
- package/dist/mcp/entries.d.ts.map +1 -0
- package/dist/mcp/entries.js +98 -0
- package/dist/mcp/entries.js.map +1 -0
- package/dist/mcp-client-entry.d.ts +5 -0
- package/dist/mcp-client-entry.d.ts.map +1 -0
- package/dist/mcp-client-entry.js +6 -0
- package/dist/mcp-client-entry.js.map +1 -0
- package/dist/mcp-config-entry.d.ts +5 -0
- package/dist/mcp-config-entry.d.ts.map +1 -0
- package/dist/mcp-config-entry.js +6 -0
- package/dist/mcp-config-entry.js.map +1 -0
- package/dist/mcp-tools-entry.d.ts +5 -0
- package/dist/mcp-tools-entry.d.ts.map +1 -0
- package/dist/mcp-tools-entry.js +6 -0
- package/dist/mcp-tools-entry.js.map +1 -0
- package/dist/mcp-transport-entry.d.ts +5 -0
- package/dist/mcp-transport-entry.d.ts.map +1 -0
- package/dist/mcp-transport-entry.js +6 -0
- package/dist/mcp-transport-entry.js.map +1 -0
- package/dist/modes/interactive-entry.d.ts +18 -0
- package/dist/modes/interactive-entry.d.ts.map +1 -0
- package/dist/modes/interactive-entry.js +21 -0
- package/dist/modes/interactive-entry.js.map +1 -0
- package/dist/modes/interactive.d.ts +16 -6
- package/dist/modes/interactive.d.ts.map +1 -1
- package/dist/modes/interactive.js +81 -32
- package/dist/modes/interactive.js.map +1 -1
- package/dist/modes/json-entry.d.ts +13 -0
- package/dist/modes/json-entry.d.ts.map +1 -0
- package/dist/modes/json-entry.js +14 -0
- package/dist/modes/json-entry.js.map +1 -0
- package/dist/modes/json.d.ts +4 -1
- package/dist/modes/json.d.ts.map +1 -1
- package/dist/modes/json.js +3 -3
- package/dist/modes/json.js.map +1 -1
- package/dist/modes/print-entry.d.ts +10 -0
- package/dist/modes/print-entry.d.ts.map +1 -0
- package/dist/modes/print-entry.js +11 -0
- package/dist/modes/print-entry.js.map +1 -0
- package/dist/modes/tree-selector.d.ts.map +1 -1
- package/dist/modes/tree-selector.js +4 -0
- package/dist/modes/tree-selector.js.map +1 -1
- package/dist/plugin-dump-composition.d.ts +6 -0
- package/dist/plugin-dump-composition.d.ts.map +1 -0
- package/dist/plugin-dump-composition.js +7 -0
- package/dist/plugin-dump-composition.js.map +1 -0
- package/dist/plugin-inventory.d.ts +7 -0
- package/dist/plugin-inventory.d.ts.map +1 -0
- package/dist/plugin-inventory.js +8 -0
- package/dist/plugin-inventory.js.map +1 -0
- package/dist/plugin-manager.d.ts +6 -0
- package/dist/plugin-manager.d.ts.map +1 -0
- package/dist/plugin-manager.js +7 -0
- package/dist/plugin-manager.js.map +1 -0
- package/dist/plugin-trace.d.ts +6 -0
- package/dist/plugin-trace.d.ts.map +1 -0
- package/dist/plugin-trace.js +7 -0
- package/dist/plugin-trace.js.map +1 -0
- package/dist/plugins/dynamic-broker.d.ts +76 -0
- package/dist/plugins/dynamic-broker.d.ts.map +1 -0
- package/dist/plugins/dynamic-broker.js +852 -0
- package/dist/plugins/dynamic-broker.js.map +1 -0
- package/dist/plugins/profile.d.ts +15 -0
- package/dist/plugins/profile.d.ts.map +1 -0
- package/dist/plugins/profile.js +34 -0
- package/dist/plugins/profile.js.map +1 -0
- package/dist/plugins/runtime-host.d.ts +37 -0
- package/dist/plugins/runtime-host.d.ts.map +1 -0
- package/dist/plugins/runtime-host.js +95 -0
- package/dist/plugins/runtime-host.js.map +1 -0
- package/dist/plugins/trust.d.ts +8 -0
- package/dist/plugins/trust.d.ts.map +1 -0
- package/dist/plugins/trust.js +59 -0
- package/dist/plugins/trust.js.map +1 -0
- package/dist/project-trust-entry.d.ts +15 -0
- package/dist/project-trust-entry.d.ts.map +1 -0
- package/dist/project-trust-entry.js +15 -0
- package/dist/project-trust-entry.js.map +1 -0
- package/dist/rpc/client.d.ts +78 -6
- package/dist/rpc/client.d.ts.map +1 -1
- package/dist/rpc/client.js +172 -4
- package/dist/rpc/client.js.map +1 -1
- package/dist/rpc/dispatcher.d.ts +121 -0
- package/dist/rpc/dispatcher.d.ts.map +1 -0
- package/dist/rpc/dispatcher.js +994 -0
- package/dist/rpc/dispatcher.js.map +1 -0
- package/dist/rpc/index.d.ts +2 -0
- package/dist/rpc/index.d.ts.map +1 -1
- package/dist/rpc/index.js +2 -0
- package/dist/rpc/index.js.map +1 -1
- package/dist/rpc/lifecycle.d.ts +6 -0
- package/dist/rpc/lifecycle.d.ts.map +1 -0
- package/dist/rpc/lifecycle.js +24 -0
- package/dist/rpc/lifecycle.js.map +1 -0
- package/dist/rpc/protocol.d.ts +112 -31
- package/dist/rpc/protocol.d.ts.map +1 -1
- package/dist/rpc/protocol.js +569 -117
- package/dist/rpc/protocol.js.map +1 -1
- package/dist/rpc/server-service.d.ts +7 -0
- package/dist/rpc/server-service.d.ts.map +1 -0
- package/dist/rpc/server-service.js +3 -0
- package/dist/rpc/server-service.js.map +1 -0
- package/dist/rpc/server.d.ts +16 -19
- package/dist/rpc/server.d.ts.map +1 -1
- package/dist/rpc/server.js +59 -115
- package/dist/rpc/server.js.map +1 -1
- package/dist/rpc-client-sdk-entry.d.ts +12 -0
- package/dist/rpc-client-sdk-entry.d.ts.map +1 -0
- package/dist/rpc-client-sdk-entry.js +11 -0
- package/dist/rpc-client-sdk-entry.js.map +1 -0
- package/dist/rpc-entry.js +50 -18
- package/dist/rpc-entry.js.map +1 -1
- package/dist/rpc-server-entry.d.ts +8 -0
- package/dist/rpc-server-entry.d.ts.map +1 -0
- package/dist/rpc-server-entry.js +67 -0
- package/dist/rpc-server-entry.js.map +1 -0
- package/dist/runtime/attachment-store.d.ts +13 -0
- package/dist/runtime/attachment-store.d.ts.map +1 -0
- package/dist/runtime/attachment-store.js +93 -0
- package/dist/runtime/attachment-store.js.map +1 -0
- package/dist/runtime/bootstrap.d.ts +14 -0
- package/dist/runtime/bootstrap.d.ts.map +1 -0
- package/dist/runtime/bootstrap.js +29 -0
- package/dist/runtime/bootstrap.js.map +1 -0
- package/dist/runtime/interactive-host-service.d.ts +22 -0
- package/dist/runtime/interactive-host-service.d.ts.map +1 -0
- package/dist/runtime/interactive-host-service.js +2 -0
- package/dist/runtime/interactive-host-service.js.map +1 -0
- package/dist/runtime/interactive-resource-service.d.ts +11 -0
- package/dist/runtime/interactive-resource-service.d.ts.map +1 -0
- package/dist/runtime/interactive-resource-service.js +3 -0
- package/dist/runtime/interactive-resource-service.js.map +1 -0
- package/dist/runtime/plugin-inventory-entry.d.ts +5 -0
- package/dist/runtime/plugin-inventory-entry.d.ts.map +1 -0
- package/dist/runtime/plugin-inventory-entry.js +18 -0
- package/dist/runtime/plugin-inventory-entry.js.map +1 -0
- package/dist/runtime/plugin-inventory-service.d.ts +8 -0
- package/dist/runtime/plugin-inventory-service.d.ts.map +1 -0
- package/dist/runtime/plugin-inventory-service.js +3 -0
- package/dist/runtime/plugin-inventory-service.js.map +1 -0
- package/dist/runtime/plugin-manager-entry.d.ts +20 -0
- package/dist/runtime/plugin-manager-entry.d.ts.map +1 -0
- package/dist/runtime/plugin-manager-entry.js +96 -0
- package/dist/runtime/plugin-manager-entry.js.map +1 -0
- package/dist/runtime/plugin-observability-entry.d.ts +12 -0
- package/dist/runtime/plugin-observability-entry.d.ts.map +1 -0
- package/dist/runtime/plugin-observability-entry.js +73 -0
- package/dist/runtime/plugin-observability-entry.js.map +1 -0
- package/dist/runtime/product-host.d.ts +91 -0
- package/dist/runtime/product-host.d.ts.map +1 -0
- package/dist/runtime/product-host.js +529 -0
- package/dist/runtime/product-host.js.map +1 -0
- package/dist/runtime/session-factory.d.ts +17 -0
- package/dist/runtime/session-factory.d.ts.map +1 -0
- package/dist/runtime/session-factory.js +75 -0
- package/dist/runtime/session-factory.js.map +1 -0
- package/dist/runtime/session-host.d.ts +152 -0
- package/dist/runtime/session-host.d.ts.map +1 -0
- package/dist/runtime/session-host.js +895 -0
- package/dist/runtime/session-host.js.map +1 -0
- package/dist/runtime-core-entry.d.ts +11 -0
- package/dist/runtime-core-entry.d.ts.map +1 -0
- package/dist/runtime-core-entry.js +9 -0
- package/dist/runtime-core-entry.js.map +1 -0
- package/dist/session-factory-entry.d.ts +7 -0
- package/dist/session-factory-entry.d.ts.map +1 -0
- package/dist/session-factory-entry.js +9 -0
- package/dist/session-factory-entry.js.map +1 -0
- package/dist/session-store-jsonl-entry.d.ts +7 -0
- package/dist/session-store-jsonl-entry.d.ts.map +1 -0
- package/dist/session-store-jsonl-entry.js +33 -0
- package/dist/session-store-jsonl-entry.js.map +1 -0
- package/dist/startup.d.ts +12 -1
- package/dist/startup.d.ts.map +1 -1
- package/dist/startup.js +106 -15
- package/dist/startup.js.map +1 -1
- package/dist/subagents/index.d.ts +2 -0
- package/dist/subagents/index.d.ts.map +1 -0
- package/dist/subagents/index.js +2 -0
- package/dist/subagents/index.js.map +1 -0
- package/dist/subagents/service.d.ts +50 -0
- package/dist/subagents/service.d.ts.map +1 -0
- package/dist/subagents/service.js +521 -0
- package/dist/subagents/service.js.map +1 -0
- package/dist/ui-host.d.ts +125 -0
- package/dist/ui-host.d.ts.map +1 -0
- package/dist/ui-host.js +275 -0
- package/dist/ui-host.js.map +1 -0
- package/dist/web/assets/index-BwfuGMvv.css +1 -0
- package/dist/web/assets/index-DPUaJqFJ.js +41 -0
- package/dist/web/assets/index-DPUaJqFJ.js.map +1 -0
- package/dist/web/index.html +14 -0
- package/dist/web-command.d.ts +11 -0
- package/dist/web-command.d.ts.map +1 -0
- package/dist/web-command.js +114 -0
- package/dist/web-command.js.map +1 -0
- package/dist/web-frontend.d.ts +73 -0
- package/dist/web-frontend.d.ts.map +1 -0
- package/dist/web-frontend.js +249 -0
- package/dist/web-frontend.js.map +1 -0
- package/dist/web.d.ts +254 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +740 -0
- package/dist/web.js.map +1 -0
- package/dist/webui-entry.d.ts +3 -0
- package/dist/webui-entry.d.ts.map +1 -0
- package/dist/webui-entry.js +73 -0
- package/dist/webui-entry.js.map +1 -0
- package/dist/webui.d.ts +91 -0
- package/dist/webui.d.ts.map +1 -0
- package/dist/webui.js +882 -0
- package/dist/webui.js.map +1 -0
- package/package.json +89 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/rpc/dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAK9D,OAAO,EAGN,oBAAoB,EAQpB,gBAAgB,GAMhB,MAAM,eAAe,CAAC;AAgEvB,SAAS,kBAAkB,CAAC,IAAgC,EAAE,MAA0B;IACvF,IAAI,CAAC,MAAM;Q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,GAAG;IACpC,WAAW;IACX,kBAAkB;IAClB,eAAe;IACf,eAAe;IACf,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,UAAU;IACV,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,WAAW;IACX,aAAa;IACb,aAAa;IACb,oBAAoB;IACpB,SAAS;IACT,wBAAwB;IACxB,WAAW;IACX,aAAa;IACb,eAAe;IACf,mBAAmB;IACnB,gBAAgB;IAChB,cAAc;IACd,sBAAsB;IACtB,mBAAmB;IACnB,YAAY;IACZ,qBAAqB;IACrB,OAAO;IACP,QAAQ;IACR,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,kBAAkB;IAClB,sBAAsB;IACtB,mBAAmB;IACnB,sBAAsB;IACtB,mBAAmB;IACnB,cAAc;CACL,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type { AssistantMessage, ImageContent, Message } from \"@di-code/ai\";\nimport type { CommandRegistry } from \"@di-code/builtins\";\nimport { redactSensitiveText } from \"@di-code/plugin-runtime\";\nimport type { SessionTreeNode } from \"../core/session/types.ts\";\nimport type { AgentSessionEvent, AgentSessionListener } from \"../core/session.ts\";\nimport type { ProductHost } from \"../runtime/product-host.ts\";\nimport type { SessionHost, SessionHostEvent } from \"../runtime/session-host.ts\";\nimport {\n\ttype OperationState,\n\ttype OperationStatus,\n\tRPC_PROTOCOL_VERSION,\n\ttype RpcAttachmentInfo,\n\ttype RpcCommandAction,\n\ttype RpcCommandInfo,\n\ttype RpcErrorCode,\n\ttype RpcEventRecord,\n\ttype RpcMethod,\n\ttype RpcProductState,\n\tRpcProtocolError,\n\ttype RpcRequest,\n\ttype RpcResponse,\n\ttype RpcServerMessage,\n\ttype RpcSessionState,\n\ttype RpcSuccessResult,\n} from \"./protocol.ts\";\n\n/** Minimum legacy session shape retained for direct RpcServer embedding. */\nexport interface RpcSession {\n\treadonly sessionId: string;\n\treadonly modelId: string;\n\treadonly isStreaming: boolean;\n\treadonly transcript: readonly Message[];\n\tprompt(text: string, signal?: AbortSignal): Promise<AssistantMessage>;\n\tsubscribeSession(listener: AgentSessionListener): () => void;\n}\n\nexport interface RpcMethodCatalog {\n\treadonly has: (name: string) => boolean;\n}\nexport interface RpcDispatcherOptions {\n\treadonly session: RpcSession | SessionHost;\n\treadonly methods?: RpcMethodCatalog;\n\treadonly eventBufferSize?: number;\n\t/** Immutable composition snapshot; changing trust requires a new product host. */\n\treadonly productState?: RpcProductState;\n\treadonly productHost?: ProductHost;\n\treadonly onError?: (error: Error) => void;\n\treadonly attachmentTtlMs?: number;\n\treadonly attachmentMaxCount?: number;\n\treadonly attachmentMaxBytes?: number;\n\treadonly attachmentStore?: RpcAttachmentStore;\n\t/** Composition-owned commands that may be listed and invoked by a Web client. */\n\treadonly commandRegistry?: CommandRegistry;\n\t/** Completed operations remain queryable for this bounded retention window. */\n\treadonly operationTtlMs?: number;\n\t/** Active operations are never evicted; this only limits retained terminal records. */\n\treadonly operationMaxCount?: number;\n}\n\n/**\n * Actor-scoped attachment storage. The dispatcher owns validation and opaque IDs; implementations own bytes and\n * must remove consumed, expired, and disposed attachments without exposing their backing paths.\n */\nexport interface RpcAttachmentStore {\n\tcreate(input: {\n\t\treadonly id: string;\n\t\treadonly name: string;\n\t\treadonly contentType: RpcAttachmentInfo[\"contentType\"];\n\t\treadonly data: string;\n\t\treadonly bytes: number;\n\t}): Promise<RpcAttachmentInfo>;\n\ttake(ids: readonly string[]): Promise<readonly ImageContent[]>;\n\tdiscard(ids: readonly string[]): Promise<void>;\n\tdispose(): Promise<void>;\n}\n\ninterface StoredOperation {\n\treadonly requestId: string;\n\treadonly kind: RpcMethod;\n\treadonly controller: AbortController;\n\treadonly sessionId?: string;\n\tstatus: OperationStatus;\n\tpromise?: Promise<RpcResponse>;\n\tmessage?: AssistantMessage;\n\terror?: { readonly code: RpcErrorCode; readonly message: string };\n\tcompletedAt?: number;\n}\n\nfunction transcriptEntryIds(tree: readonly SessionTreeNode[], leafId: string | undefined): readonly string[] {\n\tif (!leafId) return [];\n\tconst visit = (\n\t\tnodes: readonly SessionTreeNode[],\n\t\tparents: readonly SessionTreeNode[],\n\t): readonly SessionTreeNode[] | undefined => {\n\t\tfor (const node of nodes) {\n\t\t\tconst branch = [...parents, node];\n\t\t\tif (node.entry.id === leafId) return branch;\n\t\t\tconst found = visit(node.children, branch);\n\t\t\tif (found) return found;\n\t\t}\n\t\treturn undefined;\n\t};\n\treturn (visit(tree, []) ?? []).filter((node) => node.entry.type === \"message\").map((node) => node.entry.id);\n}\n\nclass MemoryAttachmentStore implements RpcAttachmentStore {\n\tprivate readonly attachments = new Map<\n\t\tstring,\n\t\t{ readonly info: RpcAttachmentInfo; readonly image: ImageContent; readonly createdAt: number }\n\t>();\n\tprivate readonly ttlMs: number;\n\tprivate readonly maxCount: number;\n\tprivate readonly maxBytes: number;\n\n\tconstructor(options: { readonly ttlMs: number; readonly maxCount: number; readonly maxBytes: number }) {\n\t\tthis.ttlMs = options.ttlMs;\n\t\tthis.maxCount = options.maxCount;\n\t\tthis.maxBytes = options.maxBytes;\n\t}\n\n\tasync create(input: {\n\t\treadonly id: string;\n\t\treadonly name: string;\n\t\treadonly contentType: RpcAttachmentInfo[\"contentType\"];\n\t\treadonly data: string;\n\t\treadonly bytes: number;\n\t}): Promise<RpcAttachmentInfo> {\n\t\tthis.prune();\n\t\tconst currentBytes = [...this.attachments.values()].reduce((total, item) => total + item.info.bytes, 0);\n\t\tif (this.attachments.size >= this.maxCount || currentBytes + input.bytes > this.maxBytes)\n\t\t\tthrow new RpcProtocolError(\"BUSY\", \"Attachment storage is full; consume or retry later.\");\n\t\tconst info: RpcAttachmentInfo = {\n\t\t\tid: input.id,\n\t\t\tname: input.name,\n\t\t\tcontentType: input.contentType,\n\t\t\tbytes: input.bytes,\n\t\t};\n\t\tthis.attachments.set(input.id, {\n\t\t\tinfo,\n\t\t\timage: { type: \"image\", data: input.data, mimeType: input.contentType },\n\t\t\tcreatedAt: Date.now(),\n\t\t});\n\t\treturn info;\n\t}\n\n\tasync take(ids: readonly string[]): Promise<readonly ImageContent[]> {\n\t\tthis.prune();\n\t\tconst result: ImageContent[] = [];\n\t\tfor (const id of ids) {\n\t\t\tconst attachment = this.attachments.get(id);\n\t\t\tif (!attachment) throw new RpcProtocolError(\"NOT_FOUND\", \"RPC attachment was not found.\");\n\t\t\tthis.attachments.delete(id);\n\t\t\tresult.push(structuredClone(attachment.image));\n\t\t}\n\t\treturn result;\n\t}\n\n\tasync discard(ids: readonly string[]): Promise<void> {\n\t\tfor (const id of ids) this.attachments.delete(id);\n\t}\n\n\tasync dispose(): Promise<void> {\n\t\tthis.attachments.clear();\n\t}\n\n\tprivate prune(): void {\n\t\tconst cutoff = Date.now() - this.ttlMs;\n\t\tfor (const [id, attachment] of this.attachments) if (attachment.createdAt <= cutoff) this.attachments.delete(id);\n\t}\n}\n\nfunction errorFrom(cause: unknown): Error {\n\treturn cause instanceof Error ? cause : new Error(String(cause));\n}\nfunction sessionHost(value: RpcSession | SessionHost): value is SessionHost {\n\treturn \"state\" in value && typeof value.state === \"function\";\n}\nfunction errorCode(cause: unknown): RpcErrorCode {\n\tif (cause instanceof RpcProtocolError) return cause.code;\n\tif (cause instanceof Error && \"code\" in cause) {\n\t\tconst code = (cause as { code?: string }).code;\n\t\tif (\n\t\t\tcode === \"BUSY\" ||\n\t\t\tcode === \"NOT_FOUND\" ||\n\t\t\tcode === \"CANCELLED\" ||\n\t\t\tcode === \"DISPOSED\" ||\n\t\t\tcode === \"INVALID_INPUT\" ||\n\t\t\tcode === \"SESSION_IN_USE\" ||\n\t\t\tcode === \"INVALID_WORKSPACE\"\n\t\t)\n\t\t\treturn code === \"INVALID_INPUT\" ? \"INVALID_PARAMS\" : (code as RpcErrorCode);\n\t}\n\treturn \"INTERNAL_ERROR\";\n}\nfunction operationErrorMessage(cause: unknown, code: RpcErrorCode): string {\n\tif (code === \"CANCELLED\") return \"The RPC operation was cancelled.\";\n\tconst message = redactSensitiveText(errorFrom(cause).message).trim();\n\treturn message ? message.slice(0, 1_000) : \"The RPC operation failed.\";\n}\n\n/**\n * Transport-free protocol dispatcher. It owns request idempotency, operation state, event ordering,\n * and the bounded replay buffer; callers decide whether events go to JSONL, SSE, or another adapter.\n */\nexport class RpcDispatcher {\n\tprivate readonly session: RpcSession | SessionHost;\n\tprivate readonly methods?: RpcMethodCatalog;\n\tprivate readonly onError: (error: Error) => void;\n\tprivate readonly approvals = new Map<string, { readonly resolve: (approved: boolean) => void }>();\n\tprivate readonly maxEvents: number;\n\tprivate productState: RpcProductState;\n\tprivate readonly productHost?: ProductHost;\n\tprivate readonly attachmentTtlMs: number;\n\tprivate readonly commandRegistry?: CommandRegistry;\n\tprivate readonly attachmentMaxCount: number;\n\tprivate readonly attachmentMaxBytes: number;\n\tprivate readonly operationTtlMs: number;\n\tprivate readonly operationMaxCount: number;\n\tprivate readonly listeners = new Set<(message: RpcServerMessage) => void>();\n\tprivate readonly operations = new Map<string, StoredOperation>();\n\tprivate readonly events: RpcEventRecord[] = [];\n\tprivate readonly attachments: RpcAttachmentStore;\n\tprivate readonly negotiatedEvents = new Set<string>();\n\tprivate readonly unsubscribe: () => void;\n\tprivate readonly unsubscribeProduct?: () => void;\n\tprivate disposed = false;\n\tprivate sequence = 0;\n\n\tconstructor(options: RpcDispatcherOptions) {\n\t\tthis.session = options.session;\n\t\tthis.methods = options.methods;\n\t\tthis.onError = options.onError ?? (() => undefined);\n\t\tthis.maxEvents = options.eventBufferSize ?? 256;\n\t\tthis.productState = options.productState ?? { projectTrusted: false };\n\t\tthis.productHost = options.productHost;\n\t\tthis.commandRegistry = options.commandRegistry;\n\t\tthis.attachmentTtlMs = options.attachmentTtlMs ?? 10 * 60 * 1000;\n\t\tthis.attachmentMaxCount = options.attachmentMaxCount ?? 32;\n\t\tthis.attachmentMaxBytes = options.attachmentMaxBytes ?? 64 * 1024 * 1024;\n\t\tthis.operationTtlMs = options.operationTtlMs ?? 10 * 60 * 1000;\n\t\tthis.operationMaxCount = options.operationMaxCount ?? 256;\n\t\tthis.attachments =\n\t\t\toptions.attachmentStore ??\n\t\t\tnew MemoryAttachmentStore({\n\t\t\t\tttlMs: this.attachmentTtlMs,\n\t\t\t\tmaxCount: this.attachmentMaxCount,\n\t\t\t\tmaxBytes: this.attachmentMaxBytes,\n\t\t\t});\n\t\tthis.unsubscribe = sessionHost(options.session)\n\t\t\t? options.session.subscribe((event) => this.onSessionEvent(event))\n\t\t\t: options.session.subscribeSession((event) => this.onSessionEvent(event));\n\t\tif (this.productHost) {\n\t\t\tthis.unsubscribeProduct = this.productHost.subscribe((event) => {\n\t\t\t\tif (!this.negotiatedEvents.has(\"product_audit\")) return;\n\t\t\t\tthis.emit({\n\t\t\t\t\tversion: RPC_PROTOCOL_VERSION,\n\t\t\t\t\tkind: \"event\",\n\t\t\t\t\trequestId: \"product\",\n\t\t\t\t\tsessionId: this.activeSessionId(),\n\t\t\t\t\tsequence: ++this.sequence,\n\t\t\t\t\tevent,\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\tsubscribe(listener: (message: RpcServerMessage) => void): () => void {\n\t\tthis.listeners.add(listener);\n\t\treturn () => this.listeners.delete(listener);\n\t}\n\n\tasync dispatch(request: RpcRequest): Promise<RpcResponse> {\n\t\tthis.pruneOperations();\n\t\tif (this.disposed) return this.failure(request.id, \"DISPOSED\", \"RPC dispatcher has been disposed.\");\n\t\tif (this.methods && !this.methods.has(request.method))\n\t\t\treturn this.failure(request.id, \"METHOD_NOT_FOUND\", \"RPC method is not registered for this server.\");\n\t\tconst existing = this.operations.get(request.id);\n\t\tif (existing?.promise) return await existing.promise;\n\t\tif (\n\t\t\trequest.method === \"prompt\" &&\n\t\t\t[...this.operations.values()].some((operation) => operation.kind === \"prompt\" && operation.status === \"running\")\n\t\t)\n\t\t\treturn this.failure(request.id, \"BUSY\", \"The RPC session is already processing a prompt.\");\n\t\tif (this.isOperation(request.method)) {\n\t\t\tconst operation: StoredOperation = {\n\t\t\t\trequestId: request.id,\n\t\t\t\tkind: request.method,\n\t\t\t\tcontroller: new AbortController(),\n\t\t\t\tsessionId: this.activeSessionId(),\n\t\t\t\tstatus: \"queued\",\n\t\t\t};\n\t\t\tthis.operations.set(request.id, operation);\n\t\t\toperation.promise = this.runOperation(operation, request);\n\t\t\treturn await operation.promise;\n\t\t}\n\t\treturn await this.execute(request);\n\t}\n\n\tasync dispose(): Promise<void> {\n\t\tif (this.disposed) return;\n\t\tthis.disposed = true;\n\t\tthis.unsubscribe();\n\t\tthis.unsubscribeProduct?.();\n\t\tfor (const operation of this.operations.values())\n\t\t\tif (operation.status === \"queued\" || operation.status === \"running\") operation.controller.abort();\n\t\tawait Promise.allSettled([...this.operations.values()].map((operation) => operation.promise));\n\t\tawait this.attachments.dispose();\n\t\tthis.listeners.clear();\n\t}\n\n\tprivate async execute(request: RpcRequest): Promise<RpcResponse> {\n\t\ttry {\n\t\t\tswitch (request.method) {\n\t\t\t\tcase \"get_state\":\n\t\t\t\t\treturn this.success(request.id, { method: \"get_state\", state: this.state() });\n\t\t\t\tcase \"get_capabilities\":\n\t\t\t\t\treturn this.capabilities(request);\n\t\t\t\tcase \"resume_events\":\n\t\t\t\t\treturn this.resumeEvents(request);\n\t\t\t\tcase \"cancel\":\n\t\t\t\t\treturn this.cancel(request);\n\t\t\t\tcase \"get_operation\":\n\t\t\t\t\treturn this.getOperation(request);\n\t\t\t\tcase \"list_sessions\":\n\t\t\t\t\treturn this.listSessions(request);\n\t\t\t\tcase \"new_session\":\n\t\t\t\t\treturn this.newSession(request);\n\t\t\t\tcase \"open_session\":\n\t\t\t\t\treturn this.openSession(request);\n\t\t\t\tcase \"inspect_session\":\n\t\t\t\t\treturn this.inspectSession(request);\n\t\t\t\tcase \"rename_session\":\n\t\t\t\t\treturn this.renameSession(request);\n\t\t\t\tcase \"delete_session\":\n\t\t\t\t\treturn this.deleteSession(request);\n\t\t\t\tcase \"branch_session\":\n\t\t\t\t\treturn this.branchSession(request);\n\t\t\t\tcase \"get_transcript\":\n\t\t\t\t\treturn this.transcript(request);\n\t\t\t\tcase \"get_tree\":\n\t\t\t\t\treturn this.success(request.id, { method: \"get_tree\", tree: this.host().tree() });\n\t\t\t\tcase \"get_models\":\n\t\t\t\t\treturn this.success(request.id, { method: \"get_models\", models: this.host().ui().availableModels });\n\t\t\t\tcase \"get_runtime\": {\n\t\t\t\t\tconst ui = this.host().ui();\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"get_runtime\",\n\t\t\t\t\t\tproviderId: ui.providerId,\n\t\t\t\t\t\tmodelId: ui.modelId,\n\t\t\t\t\t\tthinkingLevel: ui.thinkingLevel,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tcase \"set_compaction_enabled\":\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"set_compaction_enabled\",\n\t\t\t\t\t\tenabled: this.host().setCompactionEnabled(request.params.enabled as boolean),\n\t\t\t\t\t});\n\t\t\t\tcase \"get_usage\":\n\t\t\t\t\treturn this.success(request.id, { method: \"get_usage\", usage: this.host().usage() });\n\t\t\t\tcase \"list_skills\":\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"list_skills\",\n\t\t\t\t\t\tskills: this.host()\n\t\t\t\t\t\t\t.ui()\n\t\t\t\t\t\t\t.availableSkills.map(({ name, description, scope }) => ({ name, description, scope })),\n\t\t\t\t\t});\n\t\t\t\tcase \"get_resources\":\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"get_resources\",\n\t\t\t\t\t\tmodels: this.host().ui().availableModels,\n\t\t\t\t\t\tskills: this.host()\n\t\t\t\t\t\t\t.ui()\n\t\t\t\t\t\t\t.availableSkills.map(({ name, description, scope }) => ({ name, description, scope })),\n\t\t\t\t\t});\n\t\t\t\tcase \"get_product_state\":\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"get_product_state\",\n\t\t\t\t\t\tstate: this.productHost ? this.productHost.state() : this.productState,\n\t\t\t\t\t});\n\t\t\t\tcase \"get_project_trust\":\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"get_project_trust\",\n\t\t\t\t\t\ttrusted: this.productHost?.getProjectTrust() ?? this.productState.projectTrusted,\n\t\t\t\t\t});\n\t\t\t\tcase \"create_attachment\":\n\t\t\t\t\treturn await this.createAttachment(request);\n\t\t\t\tcase \"list_providers\":\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"list_providers\",\n\t\t\t\t\t\tproviders: this.productHost?.listProviders() ?? [],\n\t\t\t\t\t});\n\t\t\t\tcase \"get_settings\":\n\t\t\t\t\treturn this.success(request.id, { method: \"get_settings\", settings: this.requireProduct().getSettings() });\n\t\t\t\tcase \"list_plugins\":\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"list_plugins\",\n\t\t\t\t\t\tplugins: await this.requireProduct().listPlugins(),\n\t\t\t\t\t});\n\t\t\t\tcase \"list_web_contributions\":\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"list_web_contributions\",\n\t\t\t\t\t\tmanifest: await this.requireProduct().getWebContributions(),\n\t\t\t\t\t});\n\t\t\t\tcase \"list_commands\":\n\t\t\t\t\treturn this.success(request.id, { method: \"list_commands\", commands: this.listCommands() });\n\t\t\t\tcase \"list_context_files\":\n\t\t\t\tcase \"list_mcp_servers\":\n\t\t\t\tcase \"login\":\n\t\t\t\tcase \"logout\":\n\t\t\t\tcase \"set_default_provider\":\n\t\t\t\tcase \"set_default_model\":\n\t\t\t\tcase \"set_locale\":\n\t\t\t\tcase \"set_permission_mode\":\n\t\t\t\tcase \"configure_custom_provider\":\n\t\t\t\tcase \"set_project_trust\":\n\t\t\t\tcase \"configure_mcp_server\":\n\t\t\t\tcase \"remove_mcp_server\":\n\t\t\t\tcase \"reconnect_mcp_server\":\n\t\t\t\tcase \"set_plugin_enabled\":\n\t\t\t\t\treturn this.failure(\n\t\t\t\t\t\trequest.id,\n\t\t\t\t\t\t\"METHOD_NOT_FOUND\",\n\t\t\t\t\t\t\"Product configuration requests require operation dispatch.\",\n\t\t\t\t\t);\n\t\t\t\tcase \"approve_tool\":\n\t\t\t\t\t{\n\t\t\t\t\t\tconst approvalId = request.params.approvalId as string;\n\t\t\t\t\t\tconst pending = this.approvals.get(approvalId);\n\t\t\t\t\t\tif (pending) {\n\t\t\t\t\t\t\tthis.approvals.delete(approvalId);\n\t\t\t\t\t\t\tpending.resolve(request.params.approved === true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this.success(request.id, {\n\t\t\t\t\t\tmethod: \"approve_tool\",\n\t\t\t\t\t\tapprovalId: request.params.approvalId,\n\t\t\t\t\t\tapproved: request.params.approved,\n\t\t\t\t\t});\n\t\t\t\tcase \"run_command\":\n\t\t\t\t\treturn this.failure(request.id, \"METHOD_NOT_FOUND\", \"Command execution requires operation dispatch.\");\n\t\t\t\tdefault:\n\t\t\t\t\treturn this.failure(request.id, \"METHOD_NOT_FOUND\", \"RPC method is unavailable for this Host.\");\n\t\t\t}\n\t\t} catch (cause) {\n\t\t\treturn this.failure(request.id, errorCode(cause), \"RPC request failed.\");\n\t\t}\n\t}\n\n\t/** Waits for the browser to approve a specific tool invocation. */\n\tasync requestToolApproval(toolName: string, parameters: unknown, signal?: AbortSignal): Promise<boolean> {\n\t\tif (!this.negotiatedEvents.has(\"tool_approval\")) return true;\n\t\tconst approvalId = randomUUID();\n\t\tconst requestId =\n\t\t\t[...this.operations.values()].find((operation) => operation.status === \"running\")?.requestId ?? approvalId;\n\t\treturn await new Promise<boolean>((resolve, reject) => {\n\t\t\tconst abort = () => {\n\t\t\t\tthis.approvals.delete(approvalId);\n\t\t\t\treject(new Error(\"Tool approval cancelled.\"));\n\t\t\t};\n\t\t\tif (signal?.aborted) return abort();\n\t\t\tsignal?.addEventListener(\"abort\", abort, { once: true });\n\t\t\tthis.approvals.set(approvalId, {\n\t\t\t\tresolve: (approved) => {\n\t\t\t\t\tsignal?.removeEventListener(\"abort\", abort);\n\t\t\t\t\tresolve(approved);\n\t\t\t\t},\n\t\t\t});\n\t\t\tthis.emit({\n\t\t\t\tversion: RPC_PROTOCOL_VERSION,\n\t\t\t\tkind: \"event\",\n\t\t\t\trequestId,\n\t\t\t\tsessionId: this.activeSessionId(),\n\t\t\t\tsequence: ++this.sequence,\n\t\t\t\tevent: {\n\t\t\t\t\ttype: \"tool_approval\",\n\t\t\t\t\tapprovalId,\n\t\t\t\t\ttoolName,\n\t\t\t\t\targuments: typeof parameters === \"object\" && parameters !== null ? parameters : {},\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate async runOperation(operation: StoredOperation, request: RpcRequest): Promise<RpcResponse> {\n\t\toperation.status = \"running\";\n\t\tthis.emitOperation(operation);\n\t\ttry {\n\t\t\tlet result: RpcSuccessResult;\n\t\t\tswitch (request.method) {\n\t\t\t\tcase \"prompt\": {\n\t\t\t\t\tconst message = await this.prompt(request.params.message as string, request.params, operation);\n\t\t\t\t\toperation.message = message;\n\t\t\t\t\tresult = { method: \"prompt\", message };\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"steer\": {\n\t\t\t\t\tconst images = await this.takeAttachments(request.params);\n\t\t\t\t\tif (images.length === 0) {\n\t\t\t\t\t\tawait this.host().steer(\n\t\t\t\t\t\t\t{ text: request.params.message as string, requestId: request.id },\n\t\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tawait this.host().steerWithImages(request.params.message as string, images, operation.controller.signal);\n\t\t\t\t\t}\n\t\t\t\t\tresult = { method: \"steer\" };\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"retry\": {\n\t\t\t\t\tconst message = await this.host().retry(\n\t\t\t\t\t\t{ targetRequestId: request.params.targetRequestId as string },\n\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t);\n\t\t\t\t\toperation.message = message;\n\t\t\t\t\tresult = { method: \"retry\", message };\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"compact\":\n\t\t\t\t\tawait this.host().compact(operation.controller.signal);\n\t\t\t\t\tresult = { method: \"compact\" };\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"run_command\":\n\t\t\t\t\tresult = await this.runCommand(request, operation.controller.signal);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"navigate_tree\":\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"navigate_tree\",\n\t\t\t\t\t\tnavigation: await this.host().navigateTree(request.params.entryId as string),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set_model\":\n\t\t\t\t\tresult = { method: \"set_model\", model: this.host().setModel(request.params.modelId as string) };\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set_runtime\": {\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tconst providerId = request.params.providerId as string;\n\t\t\t\t\tconst modelId = request.params.modelId as string;\n\t\t\t\t\tawait this.requireProduct().setRuntimePreference(providerId, modelId);\n\t\t\t\t\tconst runtime = this.host().ui();\n\t\t\t\t\tconst model = runtime.availableModels.find((candidate) => candidate.id === runtime.modelId);\n\t\t\t\t\tif (!model) throw new Error(\"The selected runtime was not applied to the active Session.\");\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"set_runtime\",\n\t\t\t\t\t\tmodel,\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"set_thinking_level\": {\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tconst ui = this.host().ui();\n\t\t\t\t\tconst model = ui.availableModels.find((candidate) => candidate.id === ui.modelId);\n\t\t\t\t\tconst efforts = model?.reasoningEfforts ?? [];\n\t\t\t\t\tconst requested = request.params.level as import(\"@di-code/ai\").ThinkingLevel | undefined;\n\t\t\t\t\tconst next =\n\t\t\t\t\t\trequested ??\n\t\t\t\t\t\t(efforts.length === 0\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: efforts[\n\t\t\t\t\t\t\t\t\t((ui.thinkingLevel === undefined ? -1 : efforts.indexOf(ui.thinkingLevel)) + 1) % efforts.length\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\tif (next !== undefined)\n\t\t\t\t\t\tawait this.requireProduct().setThinkingLevelPreference(ui.providerId, ui.modelId, next);\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"set_thinking_level\",\n\t\t\t\t\t\tlevel: next === undefined ? this.host().cycleThinkingLevel() : this.host().setThinkingLevel(next),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"list_context_files\":\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"list_context_files\",\n\t\t\t\t\t\tfiles: await this.requireProduct().listContextFiles(operation.controller.signal),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"list_mcp_servers\":\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"list_mcp_servers\",\n\t\t\t\t\t\tservers: await this.requireProduct().listMcpServers(operation.controller.signal),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"login\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"login\",\n\t\t\t\t\t\tprovider: await this.requireProduct().login(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tproviderId: request.params.providerId as string,\n\t\t\t\t\t\t\t\tapiKey: request.params.apiKey as string,\n\t\t\t\t\t\t\t\tmodelId: request.params.modelId as string | undefined,\n\t\t\t\t\t\t\t\tapi: request.params.api as string | undefined,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"logout\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tawait this.requireProduct().logout(request.params.providerId as string, operation.controller.signal);\n\t\t\t\t\tresult = { method: \"logout\" };\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set_default_provider\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tawait this.requireProduct().setDefaultProvider(request.params.providerId as string);\n\t\t\t\t\tresult = { method: \"set_default_provider\" };\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set_default_model\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tawait this.requireProduct().setDefaultModel(request.params.modelId as string);\n\t\t\t\t\tresult = { method: \"set_default_model\" };\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set_locale\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tawait this.requireProduct().setLocale(request.params.locale as \"en\" | \"zh-CN\");\n\t\t\t\t\tresult = { method: \"set_locale\" };\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set_permission_mode\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tawait this.requireProduct().setPermissionMode(request.params.permissionMode as \"ask\" | \"allow\" | \"deny\");\n\t\t\t\t\tresult = { method: \"set_permission_mode\" };\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"configure_custom_provider\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"configure_custom_provider\",\n\t\t\t\t\t\tprovider: await this.requireProduct().configureCustomProvider(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tapi: request.params.api as Exclude<import(\"@di-code/ai\").ModelApi, \"faux\">,\n\t\t\t\t\t\t\t\tbaseUrl: request.params.baseUrl as string,\n\t\t\t\t\t\t\t\tapiKey: request.params.apiKey as string,\n\t\t\t\t\t\t\t\tmodelId: request.params.modelId as string,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set_project_trust\": {\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tconst trusted = await this.requireProduct().setProjectTrust(\n\t\t\t\t\t\trequest.params.trusted as boolean,\n\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t);\n\t\t\t\t\tthis.productState = { projectTrusted: trusted };\n\t\t\t\t\tresult = { method: \"set_project_trust\", trusted };\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"configure_mcp_server\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"configure_mcp_server\",\n\t\t\t\t\t\tserver: await this.requireProduct().configureMcpServer(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tserverId: request.params.serverId as string,\n\t\t\t\t\t\t\t\tscope: request.params.scope as \"user\" | \"project\" | \"local\",\n\t\t\t\t\t\t\t\tconfig: request.params.config as Record<string, unknown>,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"remove_mcp_server\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tawait this.requireProduct().removeMcpServer(\n\t\t\t\t\t\trequest.params.serverId as string,\n\t\t\t\t\t\t(request.params.scope as \"user\" | \"project\" | \"local\" | undefined) ?? \"project\",\n\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t);\n\t\t\t\t\tresult = { method: \"remove_mcp_server\" };\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"reconnect_mcp_server\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"reconnect_mcp_server\",\n\t\t\t\t\t\tserver: await this.requireProduct().reconnectMcpServer(\n\t\t\t\t\t\t\trequest.params.serverId as string,\n\t\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"set_plugin_enabled\":\n\t\t\t\t\tthis.assertProductIdle();\n\t\t\t\t\tresult = {\n\t\t\t\t\t\tmethod: \"set_plugin_enabled\",\n\t\t\t\t\t\tplugin: await this.requireProduct().setPluginEnabled(\n\t\t\t\t\t\t\trequest.params.pluginId as string,\n\t\t\t\t\t\t\trequest.params.enabled as boolean,\n\t\t\t\t\t\t\toperation.controller.signal,\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn this.failure(request.id, \"METHOD_NOT_FOUND\", \"RPC method is unavailable for this Host.\");\n\t\t\t}\n\t\t\toperation.status = \"completed\";\n\t\t\toperation.completedAt = Date.now();\n\t\t\tthis.emitOperation(operation);\n\t\t\tthis.pruneOperations();\n\t\t\treturn this.success(request.id, result);\n\t\t} catch (cause) {\n\t\t\tconst code = operation.controller.signal.aborted ? \"CANCELLED\" : errorCode(cause);\n\t\t\toperation.status = code === \"CANCELLED\" ? \"cancelled\" : \"failed\";\n\t\t\toperation.completedAt = Date.now();\n\t\t\toperation.error = {\n\t\t\t\tcode,\n\t\t\t\tmessage: operationErrorMessage(cause, code),\n\t\t\t};\n\t\t\tthis.emitOperation(operation);\n\t\t\tthis.pruneOperations();\n\t\t\tif (code === \"INTERNAL_ERROR\") this.onError(errorFrom(cause));\n\t\t\treturn this.failure(request.id, operation.error.code, operation.error.message);\n\t\t} finally {\n\t\t\tawait this.discardAttachments(request.params);\n\t\t}\n\t}\n\tprivate transcript(request: RpcRequest): RpcResponse {\n\t\tconst all = this.host().transcript();\n\t\tconst entryIds = transcriptEntryIds(this.host().tree(), this.host().ui().sessionLeafId);\n\t\tif (entryIds.length !== all.length)\n\t\t\tthrow new RpcProtocolError(\"INTERNAL_ERROR\", \"Session transcript entries are inconsistent.\");\n\t\tconst start = request.params.pageToken === undefined ? 0 : Number.parseInt(request.params.pageToken as string, 10);\n\t\tif (!Number.isSafeInteger(start) || start < 0 || start > all.length)\n\t\t\treturn this.failure(request.id, \"INVALID_PARAMS\", \"Invalid transcript page token.\");\n\t\tconst pageSize = (request.params.pageSize as number | undefined) ?? 100;\n\t\tconst maxBytes = (request.params.maxBytes as number | undefined) ?? 1_000_000;\n\t\tconst transcript = [] as (typeof all)[number][];\n\t\tconst pageEntryIds: string[] = [];\n\t\tlet bytes = 2;\n\t\tfor (let index = start; index < all.length && transcript.length < pageSize; index++) {\n\t\t\tconst value = all[index];\n\t\t\tif (value === undefined) break;\n\t\t\tconst size = Buffer.byteLength(JSON.stringify(value), \"utf8\");\n\t\t\tif (size > maxBytes && transcript.length === 0)\n\t\t\t\treturn this.failure(request.id, \"INVALID_PARAMS\", \"Transcript entry exceeds maxBytes.\");\n\t\t\tif (bytes + size > maxBytes) break;\n\t\t\ttranscript.push(value);\n\t\t\tpageEntryIds.push(entryIds[index] ?? \"\");\n\t\t\tbytes += size;\n\t\t}\n\t\tconst next = start + transcript.length < all.length ? String(start + transcript.length) : undefined;\n\t\treturn this.success(request.id, {\n\t\t\tmethod: \"get_transcript\",\n\t\t\ttranscript,\n\t\t\tentryIds: pageEntryIds,\n\t\t\t...(next ? { nextPageToken: next } : {}),\n\t\t});\n\t}\n\tprivate requireProduct(): ProductHost {\n\t\tif (!this.productHost) throw new RpcProtocolError(\"METHOD_NOT_FOUND\", \"ProductHost is unavailable.\");\n\t\treturn this.productHost;\n\t}\n\tprivate assertProductIdle(): void {\n\t\tif (sessionHost(this.session) && this.session.state().busy)\n\t\t\tthrow new RpcProtocolError(\"BUSY\", \"Product configuration cannot change while the Session is busy.\");\n\t}\n\tprivate async discardAttachments(params: Record<string, unknown>): Promise<void> {\n\t\tconst ids = params.attachmentIds;\n\t\tif (!Array.isArray(ids)) return;\n\t\tawait this.attachments.discard(ids.filter((id): id is string => typeof id === \"string\"));\n\t}\n\n\tprivate async prompt(\n\t\tmessage: string,\n\t\tparams: Record<string, unknown>,\n\t\toperation: StoredOperation,\n\t): Promise<AssistantMessage> {\n\t\tconst images = await this.takeAttachments(params);\n\t\tif (sessionHost(this.session)) {\n\t\t\tif (images.length > 0) return await this.session.promptWithImages(message, images, operation.controller.signal);\n\t\t\treturn await this.session.prompt({ text: message, requestId: operation.requestId }, operation.controller.signal);\n\t\t}\n\t\tif (images.length > 0) throw new RpcProtocolError(\"METHOD_NOT_FOUND\", \"RPC attachments require a SessionHost.\");\n\t\treturn await this.session.prompt(message, operation.controller.signal);\n\t}\n\tprivate async createAttachment(request: RpcRequest): Promise<RpcResponse> {\n\t\tconst data = request.params.data as string;\n\t\tif (Buffer.from(data, \"base64\").toString(\"base64\") !== data)\n\t\t\treturn this.failure(request.id, \"INVALID_PARAMS\", \"Attachment data must be canonical base64.\");\n\t\tconst bytes = Buffer.byteLength(data, \"base64\");\n\t\tif (bytes === 0 || bytes > 5 * 1024 * 1024)\n\t\t\treturn this.failure(request.id, \"INVALID_PARAMS\", \"Attachment data exceeds the permitted size.\");\n\t\tconst contentType = request.params.contentType as RpcAttachmentInfo[\"contentType\"];\n\t\tconst info = await this.attachments.create({\n\t\t\tid: randomUUID(),\n\t\t\tname: request.params.name as string,\n\t\t\tcontentType,\n\t\t\tdata,\n\t\t\tbytes,\n\t\t});\n\t\treturn this.success(request.id, { method: \"create_attachment\", attachment: info });\n\t}\n\tprivate async takeAttachments(params: Record<string, unknown>): Promise<readonly ImageContent[]> {\n\t\tconst ids = params.attachmentIds as readonly string[] | undefined;\n\t\tif (!ids || ids.length === 0) return [];\n\t\treturn await this.attachments.take(ids);\n\t}\n\tprivate host(): SessionHost {\n\t\tif (!sessionHost(this.session))\n\t\t\tthrow new RpcProtocolError(\"METHOD_NOT_FOUND\", \"RPC method requires a SessionHost.\");\n\t\treturn this.session;\n\t}\n\tprivate state(): RpcSessionState {\n\t\tif (sessionHost(this.session)) {\n\t\t\tconst state = this.session.state();\n\t\t\tconst ui = state.activeSession ? this.session.ui() : undefined;\n\t\t\treturn {\n\t\t\t\tsessionId: state.activeSession?.id ?? \"uninitialized\",\n\t\t\t\tmodelId: ui?.modelId ?? \"uninitialized\",\n\t\t\t\tisStreaming: state.busy,\n\t\t\t\tmessageCount: state.activeSession ? this.session.transcript().length : 0,\n\t\t\t\tsequence: this.sequence,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tsessionId: this.session.sessionId,\n\t\t\tmodelId: this.session.modelId,\n\t\t\tisStreaming: this.session.isStreaming,\n\t\t\tmessageCount: this.session.transcript.length,\n\t\t\tsequence: this.sequence,\n\t\t};\n\t}\n\tprivate activeSessionId(): string | undefined {\n\t\treturn sessionHost(this.session) ? this.session.state().activeSession?.id : this.session.sessionId;\n\t}\n\tprivate isOperation(method: RpcMethod): boolean {\n\t\treturn [\n\t\t\t\"prompt\",\n\t\t\t\"steer\",\n\t\t\t\"retry\",\n\t\t\t\"compact\",\n\t\t\t\"run_command\",\n\t\t\t\"navigate_tree\",\n\t\t\t\"set_model\",\n\t\t\t\"set_runtime\",\n\t\t\t\"set_thinking_level\",\n\t\t\t\"list_context_files\",\n\t\t\t\"list_mcp_servers\",\n\t\t\t\"login\",\n\t\t\t\"logout\",\n\t\t\t\"set_default_provider\",\n\t\t\t\"set_default_model\",\n\t\t\t\"set_locale\",\n\t\t\t\"set_permission_mode\",\n\t\t\t\"configure_custom_provider\",\n\t\t\t\"set_project_trust\",\n\t\t\t\"configure_mcp_server\",\n\t\t\t\"remove_mcp_server\",\n\t\t\t\"reconnect_mcp_server\",\n\t\t\t\"set_plugin_enabled\",\n\t\t].includes(method);\n\t}\n\tprivate listCommands(): readonly RpcCommandInfo[] {\n\t\tconst locale = this.productHost?.getSettings().locale ?? \"en\";\n\t\tconst commands = (this.commandRegistry?.list() ?? []).map((command) => ({\n\t\t\tname: command.name,\n\t\t\tdescription: typeof command.description === \"function\" ? command.description(locale) : command.description,\n\t\t\tkind: \"command\" as const,\n\t\t}));\n\t\tconst skills = (sessionHost(this.session) ? this.session.ui().availableSkills : []).map((skill) => ({\n\t\t\tname: `skill:${skill.name}`,\n\t\t\tdescription: skill.description,\n\t\t\tkind: \"skill\" as const,\n\t\t}));\n\t\treturn [...commands, ...skills].sort((left, right) => left.name.localeCompare(right.name));\n\t}\n\tprivate async runCommand(request: RpcRequest, signal: AbortSignal): Promise<RpcSuccessResult> {\n\t\tconst name = request.params.name as string;\n\t\tconst args = (request.params.args as string | undefined) ?? \"\";\n\t\tif (!this.commandRegistry?.list().some((command) => command.name === name))\n\t\t\tthrow new RpcProtocolError(\"NOT_FOUND\", `Unknown command: /${name}`, request.id);\n\t\tlet action: RpcCommandAction | undefined;\n\t\tawait this.commandRegistry.execute(\n\t\t\tname,\n\t\t\t{\n\t\t\t\targs,\n\t\t\t\thost: {\n\t\t\t\t\trunCommand: (command: string, commandArgs: string): number => {\n\t\t\t\t\t\taction = { command, args: commandArgs };\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tsignal,\n\t\t);\n\t\treturn { method: \"run_command\", command: name, ...(action ? { action } : {}) };\n\t}\n\tprivate success(id: string, result: RpcSuccessResult): RpcResponse {\n\t\treturn { version: RPC_PROTOCOL_VERSION, kind: \"response\", id, ok: true, result };\n\t}\n\tprivate failure(id: string, code: RpcErrorCode, message: string): RpcResponse {\n\t\treturn { version: RPC_PROTOCOL_VERSION, kind: \"response\", id, ok: false, error: { code, message } };\n\t}\n\tprivate capabilities(request: RpcRequest): RpcResponse {\n\t\tconst events = request.params.events;\n\t\tif (Array.isArray(events))\n\t\t\tfor (const event of events)\n\t\t\t\tif (\n\t\t\t\t\ttypeof event === \"string\" &&\n\t\t\t\t\t[\n\t\t\t\t\t\t\"sequence\",\n\t\t\t\t\t\t\"operation_update\",\n\t\t\t\t\t\t\"snapshot_required\",\n\t\t\t\t\t\t\"session_changed\",\n\t\t\t\t\t\t\"tool_approval\",\n\t\t\t\t\t\t\"product_audit\",\n\t\t\t\t\t].includes(event)\n\t\t\t\t)\n\t\t\t\t\tthis.negotiatedEvents.add(event);\n\t\treturn this.success(request.id, {\n\t\t\tmethod: \"get_capabilities\",\n\t\t\tmethods: RPC_METHODS_FOR_CAPABILITIES,\n\t\t\tevents: [...this.negotiatedEvents],\n\t\t\teventBufferSize: this.maxEvents,\n\t\t});\n\t}\n\tprivate resumeEvents(request: RpcRequest): RpcResponse {\n\t\tconst last = request.params.lastSequence as number | undefined;\n\t\tif (!this.negotiatedEvents.has(\"sequence\"))\n\t\t\treturn this.failure(request.id, \"INVALID_PARAMS\", \"Extended events require capability negotiation.\");\n\t\tif (last !== undefined && this.events.length > 0 && last < (this.events[0]?.sequence ?? 0) - 1) {\n\t\t\tthis.emit({\n\t\t\t\tversion: RPC_PROTOCOL_VERSION,\n\t\t\t\tkind: \"event\",\n\t\t\t\trequestId: request.id,\n\t\t\t\tsessionId: this.activeSessionId(),\n\t\t\t\tsequence: ++this.sequence,\n\t\t\t\tevent: { type: \"snapshot_required\" },\n\t\t\t});\n\t\t\treturn this.success(request.id, { method: \"resume_events\", snapshotRequired: true });\n\t\t}\n\t\tfor (const event of this.events) if ((event.sequence ?? 0) > (last ?? 0)) this.emit(event);\n\t\treturn this.success(request.id, { method: \"resume_events\", snapshotRequired: false });\n\t}\n\tprivate cancel(request: RpcRequest): RpcResponse {\n\t\tconst target = request.params.requestId as string;\n\t\tconst operation = this.operations.get(target);\n\t\tconst cancelled = operation !== undefined && (operation.status === \"queued\" || operation.status === \"running\");\n\t\tif (cancelled) {\n\t\t\toperation.controller.abort();\n\t\t\tif (sessionHost(this.session)) this.session.cancel(target);\n\t\t}\n\t\treturn this.success(request.id, { method: \"cancel\", cancelled });\n\t}\n\tprivate getOperation(request: RpcRequest): RpcResponse {\n\t\tthis.pruneOperations();\n\t\tconst operation = this.operations.get(request.params.requestId as string);\n\t\treturn operation\n\t\t\t? this.success(request.id, { method: \"get_operation\", operation: this.operationState(operation) })\n\t\t\t: this.failure(request.id, \"NOT_FOUND\", \"RPC operation was not found.\");\n\t}\n\tprivate async listSessions(request: RpcRequest): Promise<RpcResponse> {\n\t\treturn this.success(request.id, {\n\t\t\tmethod: \"list_sessions\",\n\t\t\tsessions: await this.host()\n\t\t\t\t.listSessions()\n\t\t\t\t.then((items) =>\n\t\t\t\t\titems.map(({ id, label, modifiedAt, stats }) => ({ id, label, modifiedAt, ...(stats ? { stats } : {}) })),\n\t\t\t\t),\n\t\t});\n\t}\n\tprivate async newSession(request: RpcRequest): Promise<RpcResponse> {\n\t\tconst session = await this.host().createSession();\n\t\treturn this.success(request.id, {\n\t\t\tmethod: \"new_session\",\n\t\t\tsession: {\n\t\t\t\tid: session.id,\n\t\t\t\tlabel: session.label,\n\t\t\t\tmodifiedAt: session.modifiedAt,\n\t\t\t\t...(session.stats ? { stats: session.stats } : {}),\n\t\t\t},\n\t\t});\n\t}\n\tprivate async openSession(request: RpcRequest): Promise<RpcResponse> {\n\t\tconst session = await this.host().openSession(request.params.sessionId as string);\n\t\treturn this.success(request.id, {\n\t\t\tmethod: \"open_session\",\n\t\t\tsession: {\n\t\t\t\tid: session.id,\n\t\t\t\tlabel: session.label,\n\t\t\t\tmodifiedAt: session.modifiedAt,\n\t\t\t\t...(session.stats ? { stats: session.stats } : {}),\n\t\t\t},\n\t\t});\n\t}\n\tprivate async inspectSession(request: RpcRequest): Promise<RpcResponse> {\n\t\tconst snapshot = await this.host().inspectSession(request.params.sessionId as string);\n\t\treturn this.success(request.id, {\n\t\t\tmethod: \"inspect_session\",\n\t\t\tsnapshot: {\n\t\t\t\tsession: {\n\t\t\t\t\tid: snapshot.session.id,\n\t\t\t\t\tlabel: snapshot.session.label,\n\t\t\t\t\tmodifiedAt: snapshot.session.modifiedAt,\n\t\t\t\t\t...(snapshot.session.stats ? { stats: snapshot.session.stats } : {}),\n\t\t\t\t},\n\t\t\t\ttranscript: snapshot.transcript,\n\t\t\t\ttree: snapshot.tree,\n\t\t\t\tstats: snapshot.stats,\n\t\t\t\treadOnly: true,\n\t\t\t},\n\t\t});\n\t}\n\tprivate async renameSession(request: RpcRequest): Promise<RpcResponse> {\n\t\tconst session = await this.host().renameSession(request.params.sessionId as string, request.params.label as string);\n\t\treturn this.success(request.id, { method: \"rename_session\", session });\n\t}\n\tprivate async deleteSession(request: RpcRequest): Promise<RpcResponse> {\n\t\tawait this.host().deleteSession(request.params.sessionId as string, request.params.confirmation as string);\n\t\treturn this.success(request.id, { method: \"delete_session\" });\n\t}\n\tprivate async branchSession(request: RpcRequest): Promise<RpcResponse> {\n\t\tconst session = await this.host().branchSession(\n\t\t\trequest.params.sessionId as string | undefined,\n\t\t\trequest.params.entryId as string | undefined,\n\t\t);\n\t\treturn this.success(request.id, { method: \"branch_session\", session });\n\t}\n\tprivate operationState(operation: StoredOperation): OperationState {\n\t\treturn {\n\t\t\trequestId: operation.requestId,\n\t\t\tkind: operation.kind,\n\t\t\tstatus: operation.status,\n\t\t\t...(operation.sessionId ? { sessionId: operation.sessionId } : {}),\n\t\t\t...(operation.message ? { message: operation.message } : {}),\n\t\t\t...(operation.error ? { error: operation.error } : {}),\n\t\t};\n\t}\n\tprivate pruneOperations(): void {\n\t\tconst cutoff = Date.now() - this.operationTtlMs;\n\t\tfor (const [id, operation] of this.operations)\n\t\t\tif (operation.completedAt !== undefined && operation.completedAt <= cutoff) this.operations.delete(id);\n\t\tconst retained = [...this.operations.values()]\n\t\t\t.filter((operation) => operation.completedAt !== undefined)\n\t\t\t.sort((left, right) => (left.completedAt ?? 0) - (right.completedAt ?? 0));\n\t\twhile (retained.length > this.operationMaxCount) {\n\t\t\tconst operation = retained.shift();\n\t\t\tif (operation) this.operations.delete(operation.requestId);\n\t\t}\n\t}\n\tprivate emitOperation(operation: StoredOperation): void {\n\t\tif (!this.negotiatedEvents.has(\"operation_update\")) return;\n\t\tthis.emit({\n\t\t\tversion: RPC_PROTOCOL_VERSION,\n\t\t\tkind: \"event\",\n\t\t\trequestId: operation.requestId,\n\t\t\tsessionId: operation.sessionId,\n\t\t\tsequence: ++this.sequence,\n\t\t\tevent: { type: \"operation_update\", operation: this.operationState(operation) },\n\t\t});\n\t}\n\tprivate onSessionEvent(event: SessionHostEvent | AgentSessionEvent): void {\n\t\tconst operation = [...this.operations.values()].find((item) => item.status === \"running\");\n\t\tconst extended = event.type === \"session_changed\";\n\t\tif (extended && !this.negotiatedEvents.has(\"session_changed\")) return;\n\t\tconst record: RpcEventRecord = {\n\t\t\tversion: RPC_PROTOCOL_VERSION,\n\t\t\tkind: \"event\",\n\t\t\trequestId: operation?.requestId ?? \"session\",\n\t\t\tevent,\n\t\t\t...(this.negotiatedEvents.has(\"sequence\")\n\t\t\t\t? { sessionId: this.activeSessionId(), sequence: ++this.sequence }\n\t\t\t\t: {}),\n\t\t};\n\t\tif (this.negotiatedEvents.has(\"sequence\")) {\n\t\t\tthis.events.push(record);\n\t\t\tif (this.events.length > this.maxEvents) this.events.shift();\n\t\t}\n\t\tthis.emit(record);\n\t}\n\tprivate emit(message: RpcServerMessage): void {\n\t\tfor (const listener of this.listeners) {\n\t\t\ttry {\n\t\t\t\tlistener(structuredClone(message));\n\t\t\t} catch (cause) {\n\t\t\t\tthis.onError(errorFrom(cause));\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst RPC_METHODS_FOR_CAPABILITIES = [\n\t\"get_state\",\n\t\"get_capabilities\",\n\t\"resume_events\",\n\t\"list_sessions\",\n\t\"new_session\",\n\t\"open_session\",\n\t\"get_transcript\",\n\t\"get_tree\",\n\t\"navigate_tree\",\n\t\"inspect_session\",\n\t\"rename_session\",\n\t\"delete_session\",\n\t\"branch_session\",\n\t\"prompt\",\n\t\"steer\",\n\t\"retry\",\n\t\"cancel\",\n\t\"get_operation\",\n\t\"get_models\",\n\t\"set_model\",\n\t\"get_runtime\",\n\t\"set_runtime\",\n\t\"set_thinking_level\",\n\t\"compact\",\n\t\"set_compaction_enabled\",\n\t\"get_usage\",\n\t\"list_skills\",\n\t\"get_resources\",\n\t\"get_product_state\",\n\t\"list_providers\",\n\t\"get_settings\",\n\t\"set_default_provider\",\n\t\"set_default_model\",\n\t\"set_locale\",\n\t\"set_permission_mode\",\n\t\"login\",\n\t\"logout\",\n\t\"get_project_trust\",\n\t\"set_project_trust\",\n\t\"list_context_files\",\n\t\"list_mcp_servers\",\n\t\"configure_mcp_server\",\n\t\"remove_mcp_server\",\n\t\"reconnect_mcp_server\",\n\t\"create_attachment\",\n\t\"approve_tool\",\n] as const;\n"]}
|
package/dist/rpc/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { apiVersion as rpcClientSdkApiVersion, apply as rpcClientSdkApply, name as rpcClientSdkName, type RpcClientSdk, rpcClientSdkKey, version as rpcClientSdkVersion, } from "../rpc-client-sdk-entry.ts";
|
|
1
2
|
export * from "./client.ts";
|
|
3
|
+
export * from "./dispatcher.ts";
|
|
2
4
|
export * from "./jsonl.ts";
|
|
3
5
|
export * from "./protocol.ts";
|
|
4
6
|
export * from "./server.ts";
|
package/dist/rpc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,IAAI,sBAAsB,EACpC,KAAK,IAAI,iBAAiB,EAC1B,IAAI,IAAI,gBAAgB,EACxB,KAAK,YAAY,EACjB,eAAe,EACf,OAAO,IAAI,mBAAmB,GAC9B,MAAM,4BAA4B,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
package/dist/rpc/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { apiVersion as rpcClientSdkApiVersion, apply as rpcClientSdkApply, name as rpcClientSdkName, rpcClientSdkKey, version as rpcClientSdkVersion, } from "../rpc-client-sdk-entry.js";
|
|
1
2
|
export * from "./client.js";
|
|
3
|
+
export * from "./dispatcher.js";
|
|
2
4
|
export * from "./jsonl.js";
|
|
3
5
|
export * from "./protocol.js";
|
|
4
6
|
export * from "./server.js";
|
package/dist/rpc/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC","sourcesContent":["export * from \"./client.ts\";\nexport * from \"./jsonl.ts\";\nexport * from \"./protocol.ts\";\nexport * from \"./server.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,IAAI,sBAAsB,EACpC,KAAK,IAAI,iBAAiB,EAC1B,IAAI,IAAI,gBAAgB,EAExB,eAAe,EACf,OAAO,IAAI,mBAAmB,GAC9B,MAAM,4BAA4B,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC","sourcesContent":["export {\n\tapiVersion as rpcClientSdkApiVersion,\n\tapply as rpcClientSdkApply,\n\tname as rpcClientSdkName,\n\ttype RpcClientSdk,\n\trpcClientSdkKey,\n\tversion as rpcClientSdkVersion,\n} from \"../rpc-client-sdk-entry.ts\";\nexport * from \"./client.ts\";\nexport * from \"./dispatcher.ts\";\nexport * from \"./jsonl.ts\";\nexport * from \"./protocol.ts\";\nexport * from \"./server.ts\";\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disposes the composition after RPC stdout has flushed. Both owners are always released so a
|
|
3
|
+
* failure in one Fiber cannot retain process, stream, or session resources from the other.
|
|
4
|
+
*/
|
|
5
|
+
export declare function disposeRpcComposition(disposeLoader: () => void | Promise<void>, disposeContext: () => void | Promise<void>): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/rpc/lifecycle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,qBAAqB,CAC1C,aAAa,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACzC,cAAc,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disposes the composition after RPC stdout has flushed. Both owners are always released so a
|
|
3
|
+
* failure in one Fiber cannot retain process, stream, or session resources from the other.
|
|
4
|
+
*/
|
|
5
|
+
export async function disposeRpcComposition(disposeLoader, disposeContext) {
|
|
6
|
+
const failures = [];
|
|
7
|
+
try {
|
|
8
|
+
await disposeLoader();
|
|
9
|
+
}
|
|
10
|
+
catch (cause) {
|
|
11
|
+
failures.push(cause instanceof Error ? cause : new Error(String(cause)));
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
await disposeContext();
|
|
15
|
+
}
|
|
16
|
+
catch (cause) {
|
|
17
|
+
failures.push(cause instanceof Error ? cause : new Error(String(cause)));
|
|
18
|
+
}
|
|
19
|
+
if (failures.length === 1)
|
|
20
|
+
throw failures[0];
|
|
21
|
+
if (failures.length > 1)
|
|
22
|
+
throw new AggregateError(failures, "RPC composition disposal failed");
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../src/rpc/lifecycle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAC1C,aAAyC,EACzC,cAA0C;IAE1C,MAAM,QAAQ,GAAY,EAAE,CAAC;IAC7B,IAAI,CAAC;QACJ,MAAM,aAAa,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,CAAC;QACJ,MAAM,cAAc,EAAE,CAAC;IACxB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,QAAQ,CAAC,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,cAAc,CAAC,QAAQ,EAAE,iCAAiC,CAAC,CAAC;AAChG,CAAC","sourcesContent":["/**\n * Disposes the composition after RPC stdout has flushed. Both owners are always released so a\n * failure in one Fiber cannot retain process, stream, or session resources from the other.\n */\nexport async function disposeRpcComposition(\n\tdisposeLoader: () => void | Promise<void>,\n\tdisposeContext: () => void | Promise<void>,\n): Promise<void> {\n\tconst failures: Error[] = [];\n\ttry {\n\t\tawait disposeLoader();\n\t} catch (cause) {\n\t\tfailures.push(cause instanceof Error ? cause : new Error(String(cause)));\n\t}\n\ttry {\n\t\tawait disposeContext();\n\t} catch (cause) {\n\t\tfailures.push(cause instanceof Error ? cause : new Error(String(cause)));\n\t}\n\tif (failures.length === 1) throw failures[0];\n\tif (failures.length > 1) throw new AggregateError(failures, \"RPC composition disposal failed\");\n}\n"]}
|
package/dist/rpc/protocol.d.ts
CHANGED
|
@@ -3,47 +3,117 @@ import type { AgentSessionEvent } from "../core/session.ts";
|
|
|
3
3
|
export declare const RPC_PROTOCOL_VERSION: 1;
|
|
4
4
|
export declare const RPC_MAX_ID_LENGTH = 128;
|
|
5
5
|
export declare const RPC_MAX_PROMPT_LENGTH = 1000000;
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export declare const RPC_MAX_ATTACHMENTS_PER_REQUEST = 4;
|
|
7
|
+
export declare const RPC_MAX_ATTACHMENT_BYTES: number;
|
|
8
|
+
/** Allows one JSONL user entry containing a maximum-sized base64 image to be read in a single transcript page. */
|
|
9
|
+
export declare const RPC_MAX_TRANSCRIPT_BYTES: number;
|
|
10
|
+
/** v1 grows only by methods and optional fields. Clients must negotiate extended events first. */
|
|
11
|
+
export declare const RPC_METHODS: readonly ["prompt", "cancel", "get_state", "get_capabilities", "resume_events", "list_sessions", "new_session", "open_session", "inspect_session", "rename_session", "delete_session", "branch_session", "get_transcript", "get_tree", "navigate_tree", "steer", "retry", "get_operation", "get_models", "set_model", "get_runtime", "set_runtime", "set_thinking_level", "compact", "set_compaction_enabled", "get_usage", "list_skills", "get_resources", "get_product_state", "list_providers", "get_settings", "set_default_provider", "set_default_model", "set_locale", "set_permission_mode", "configure_custom_provider", "login", "logout", "get_project_trust", "set_project_trust", "list_context_files", "list_mcp_servers", "configure_mcp_server", "remove_mcp_server", "reconnect_mcp_server", "list_plugins", "list_web_contributions", "list_commands", "run_command", "set_plugin_enabled", "create_attachment", "approve_tool"];
|
|
12
|
+
export type RpcMethod = (typeof RPC_METHODS)[number];
|
|
13
|
+
export interface RpcRequest {
|
|
8
14
|
readonly version: typeof RPC_PROTOCOL_VERSION;
|
|
9
15
|
readonly kind: "request";
|
|
10
16
|
readonly id: string;
|
|
11
|
-
readonly method:
|
|
12
|
-
readonly params:
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
} | {
|
|
16
|
-
readonly version: typeof RPC_PROTOCOL_VERSION;
|
|
17
|
-
readonly kind: "request";
|
|
18
|
-
readonly id: string;
|
|
19
|
-
readonly method: "cancel";
|
|
20
|
-
readonly params: {
|
|
21
|
-
readonly requestId: string;
|
|
22
|
-
};
|
|
23
|
-
} | {
|
|
24
|
-
readonly version: typeof RPC_PROTOCOL_VERSION;
|
|
25
|
-
readonly kind: "request";
|
|
26
|
-
readonly id: string;
|
|
27
|
-
readonly method: "get_state";
|
|
28
|
-
readonly params: Record<string, never>;
|
|
29
|
-
};
|
|
17
|
+
readonly method: RpcMethod;
|
|
18
|
+
readonly params: Record<string, unknown>;
|
|
19
|
+
}
|
|
30
20
|
export interface RpcSessionState {
|
|
31
21
|
readonly sessionId: string;
|
|
32
22
|
readonly modelId: string;
|
|
33
23
|
readonly isStreaming: boolean;
|
|
34
24
|
readonly messageCount: number;
|
|
25
|
+
readonly sequence?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Metadata for an opaque attachment handle kept only by its live RPC actor. */
|
|
28
|
+
export interface RpcAttachmentInfo {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly contentType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
32
|
+
readonly bytes: number;
|
|
33
|
+
}
|
|
34
|
+
export interface RpcCapabilities {
|
|
35
|
+
readonly methods: readonly RpcMethod[];
|
|
36
|
+
readonly events: readonly RpcExtendedEventName[];
|
|
37
|
+
readonly eventBufferSize: number;
|
|
35
38
|
}
|
|
39
|
+
export type RpcExtendedEventName = "sequence" | "operation_update" | "snapshot_required" | "session_changed" | "tool_approval" | "product_audit";
|
|
40
|
+
export interface RpcProductState {
|
|
41
|
+
readonly projectTrusted: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface RpcProviderSummary {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly models: readonly {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly input: readonly string[];
|
|
50
|
+
/** Omitted when the model does not expose selectable reasoning levels. */
|
|
51
|
+
readonly reasoningEfforts?: readonly ("low" | "medium" | "high" | "max")[];
|
|
52
|
+
}[];
|
|
53
|
+
readonly configured: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface RpcSettingsSnapshot {
|
|
56
|
+
readonly providers: readonly (RpcProviderSummary & {
|
|
57
|
+
readonly api: string;
|
|
58
|
+
readonly baseUrl?: string;
|
|
59
|
+
readonly apiKeySource: "environment" | "settings" | "missing";
|
|
60
|
+
})[];
|
|
61
|
+
readonly defaults: {
|
|
62
|
+
readonly providerId?: string;
|
|
63
|
+
readonly modelId?: string;
|
|
64
|
+
};
|
|
65
|
+
readonly runtime: {
|
|
66
|
+
readonly providerId: string;
|
|
67
|
+
readonly modelId: string;
|
|
68
|
+
readonly thinkingLevel?: string;
|
|
69
|
+
};
|
|
70
|
+
readonly locale?: "en" | "zh-CN";
|
|
71
|
+
readonly permissionMode: "ask" | "allow" | "deny";
|
|
72
|
+
readonly sources: Readonly<Record<string, "environment" | "settings" | "default" | "runtime">>;
|
|
73
|
+
}
|
|
74
|
+
export interface RpcContextFileInfo {
|
|
75
|
+
readonly path: string;
|
|
76
|
+
readonly scope: string;
|
|
77
|
+
readonly bytes: number;
|
|
78
|
+
}
|
|
79
|
+
/** A user-invocable command projected from the active composition or Skill catalog. */
|
|
80
|
+
export interface RpcCommandInfo {
|
|
81
|
+
readonly name: string;
|
|
82
|
+
readonly description: string;
|
|
83
|
+
readonly kind: "command" | "skill";
|
|
84
|
+
}
|
|
85
|
+
/** A WebUI operation requested by a registered command. */
|
|
86
|
+
export interface RpcCommandAction {
|
|
87
|
+
readonly command: string;
|
|
88
|
+
readonly args: string;
|
|
89
|
+
}
|
|
90
|
+
export interface RpcMcpServerInfo {
|
|
91
|
+
readonly id: string;
|
|
92
|
+
readonly scope?: string;
|
|
93
|
+
readonly state: "configured" | "connected" | "failed" | "disconnected";
|
|
94
|
+
readonly tools: number;
|
|
95
|
+
readonly resources: number;
|
|
96
|
+
readonly prompts: number;
|
|
97
|
+
readonly diagnostic?: string;
|
|
98
|
+
}
|
|
99
|
+
export type OperationStatus = "queued" | "running" | "completed" | "failed" | "cancelled" | "crashed";
|
|
100
|
+
export interface OperationState {
|
|
101
|
+
readonly requestId: string;
|
|
102
|
+
readonly kind: RpcMethod;
|
|
103
|
+
readonly status: OperationStatus;
|
|
104
|
+
readonly sessionId?: string;
|
|
105
|
+
readonly message?: AssistantMessage;
|
|
106
|
+
readonly error?: {
|
|
107
|
+
readonly code: RpcErrorCode;
|
|
108
|
+
readonly message: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** Method-specific result fields are validated at the wire boundary. */
|
|
36
112
|
export type RpcSuccessResult = {
|
|
37
|
-
readonly method:
|
|
38
|
-
readonly
|
|
39
|
-
} | {
|
|
40
|
-
readonly method: "cancel";
|
|
41
|
-
readonly cancelled: boolean;
|
|
42
|
-
} | {
|
|
43
|
-
readonly method: "get_state";
|
|
44
|
-
readonly state: RpcSessionState;
|
|
113
|
+
readonly method: RpcMethod;
|
|
114
|
+
readonly [key: string]: unknown;
|
|
45
115
|
};
|
|
46
|
-
export type RpcErrorCode = "PARSE_ERROR" | "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "METHOD_NOT_FOUND" | "INVALID_PARAMS" | "BUSY" | "NOT_FOUND" | "CANCELLED" | "INTERNAL_ERROR" | "PROCESS_EXIT";
|
|
116
|
+
export type RpcErrorCode = "PARSE_ERROR" | "INVALID_REQUEST" | "UNSUPPORTED_VERSION" | "METHOD_NOT_FOUND" | "INVALID_PARAMS" | "BUSY" | "NOT_FOUND" | "CANCELLED" | "DISPOSED" | "SESSION_IN_USE" | "INVALID_WORKSPACE" | "UNAUTHORIZED" | "INTERNAL_ERROR" | "PROCESS_EXIT";
|
|
47
117
|
export interface RpcSuccessResponse {
|
|
48
118
|
readonly version: typeof RPC_PROTOCOL_VERSION;
|
|
49
119
|
readonly kind: "response";
|
|
@@ -65,7 +135,17 @@ export interface RpcEventRecord {
|
|
|
65
135
|
readonly version: typeof RPC_PROTOCOL_VERSION;
|
|
66
136
|
readonly kind: "event";
|
|
67
137
|
readonly requestId: string;
|
|
68
|
-
readonly event: AgentSessionEvent
|
|
138
|
+
readonly event: AgentSessionEvent | {
|
|
139
|
+
readonly type: "product_audit";
|
|
140
|
+
readonly action: "login" | "logout" | "set_project_trust" | "configure_mcp_server" | "remove_mcp_server" | "reconnect_mcp_server";
|
|
141
|
+
readonly target?: string;
|
|
142
|
+
readonly projectTrusted?: boolean;
|
|
143
|
+
} | {
|
|
144
|
+
readonly type: "snapshot_required" | "operation_update" | "session_changed" | "tool_approval";
|
|
145
|
+
readonly [key: string]: unknown;
|
|
146
|
+
};
|
|
147
|
+
readonly sessionId?: string;
|
|
148
|
+
readonly sequence?: number;
|
|
69
149
|
}
|
|
70
150
|
export type RpcResponse = RpcSuccessResponse | RpcErrorResponse;
|
|
71
151
|
export type RpcServerMessage = RpcResponse | RpcEventRecord;
|
|
@@ -74,6 +154,7 @@ export declare class RpcProtocolError extends Error {
|
|
|
74
154
|
readonly requestId?: string;
|
|
75
155
|
constructor(code: RpcErrorCode, message: string, requestId?: string);
|
|
76
156
|
}
|
|
157
|
+
/** Parses every public v1 method before any dispatcher or transport observes it. */
|
|
77
158
|
export declare function parseRpcRequest(line: string): RpcRequest;
|
|
78
159
|
export declare function parseRpcServerMessage(line: string): RpcServerMessage;
|
|
79
160
|
export declare function rpcErrorResponse(error: RpcProtocolError): RpcErrorResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/rpc/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/rpc/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,eAAO,MAAM,oBAAoB,EAAG,CAAU,CAAC;AAC/C,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,qBAAqB,UAAY,CAAC;AAC/C,eAAO,MAAM,+BAA+B,IAAI,CAAC;AACjD,eAAO,MAAM,wBAAwB,QAAkB,CAAC;AACxD,kHAAkH;AAClH,eAAO,MAAM,wBAAwB,QAAkB,CAAC;AAGxD,kGAAkG;AAClG,eAAO,MAAM,WAAW,o5BAqDd,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,oBAAoB,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAA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