@di-code/coding-agent 0.1.9 → 0.2.2

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.
Files changed (106) hide show
  1. package/README.md +7 -0
  2. package/compositions/base.yml +3 -0
  3. package/dist/compositions.d.ts.map +1 -1
  4. package/dist/compositions.js +2 -0
  5. package/dist/compositions.js.map +1 -1
  6. package/dist/core/image-input.d.ts +1 -1
  7. package/dist/core/image-input.d.ts.map +1 -1
  8. package/dist/core/image-input.js +15 -4
  9. package/dist/core/image-input.js.map +1 -1
  10. package/dist/core/session/session-manager.d.ts +18 -1
  11. package/dist/core/session/session-manager.d.ts.map +1 -1
  12. package/dist/core/session/session-manager.js +90 -1
  13. package/dist/core/session/session-manager.js.map +1 -1
  14. package/dist/core/session/session-storage.d.ts +2 -0
  15. package/dist/core/session/session-storage.d.ts.map +1 -1
  16. package/dist/core/session/session-storage.js +34 -2
  17. package/dist/core/session/session-storage.js.map +1 -1
  18. package/dist/core/session/types.d.ts +16 -1
  19. package/dist/core/session/types.d.ts.map +1 -1
  20. package/dist/core/session/types.js.map +1 -1
  21. package/dist/core/session.d.ts +27 -2
  22. package/dist/core/session.d.ts.map +1 -1
  23. package/dist/core/session.js +59 -0
  24. package/dist/core/session.js.map +1 -1
  25. package/dist/entry.js +1 -1
  26. package/dist/entry.js.map +1 -1
  27. package/dist/i18n.js +4 -4
  28. package/dist/i18n.js.map +1 -1
  29. package/dist/interactive-host-entry.d.ts.map +1 -1
  30. package/dist/interactive-host-entry.js +107 -12
  31. package/dist/interactive-host-entry.js.map +1 -1
  32. package/dist/main.d.ts.map +1 -1
  33. package/dist/main.js +8 -1
  34. package/dist/main.js.map +1 -1
  35. package/dist/mcp/config.d.ts.map +1 -1
  36. package/dist/mcp/config.js +19 -0
  37. package/dist/mcp/config.js.map +1 -1
  38. package/dist/mcp-command-entry.d.ts +8 -0
  39. package/dist/mcp-command-entry.d.ts.map +1 -0
  40. package/dist/mcp-command-entry.js +56 -0
  41. package/dist/mcp-command-entry.js.map +1 -0
  42. package/dist/modes/interactive-components.d.ts +8 -0
  43. package/dist/modes/interactive-components.d.ts.map +1 -1
  44. package/dist/modes/interactive-components.js +7 -2
  45. package/dist/modes/interactive-components.js.map +1 -1
  46. package/dist/modes/interactive-state.d.ts.map +1 -1
  47. package/dist/modes/interactive-state.js +1 -4
  48. package/dist/modes/interactive-state.js.map +1 -1
  49. package/dist/modes/interactive.d.ts +4 -0
  50. package/dist/modes/interactive.d.ts.map +1 -1
  51. package/dist/modes/interactive.js +69 -0
  52. package/dist/modes/interactive.js.map +1 -1
  53. package/dist/modes/tree-selector.d.ts.map +1 -1
  54. package/dist/modes/tree-selector.js +5 -4
  55. package/dist/modes/tree-selector.js.map +1 -1
  56. package/dist/rpc/client.d.ts +2 -0
  57. package/dist/rpc/client.d.ts.map +1 -1
  58. package/dist/rpc/client.js +3 -0
  59. package/dist/rpc/client.js.map +1 -1
  60. package/dist/rpc/dispatcher.d.ts +14 -0
  61. package/dist/rpc/dispatcher.d.ts.map +1 -1
  62. package/dist/rpc/dispatcher.js +222 -7
  63. package/dist/rpc/dispatcher.js.map +1 -1
  64. package/dist/rpc/protocol.d.ts +12 -5
  65. package/dist/rpc/protocol.d.ts.map +1 -1
  66. package/dist/rpc/protocol.js +56 -0
  67. package/dist/rpc/protocol.js.map +1 -1
  68. package/dist/rpc/server.d.ts +5 -0
  69. package/dist/rpc/server.d.ts.map +1 -1
  70. package/dist/rpc/server.js +4 -0
  71. package/dist/rpc/server.js.map +1 -1
  72. package/dist/rpc-server-entry.d.ts.map +1 -1
  73. package/dist/rpc-server-entry.js +15 -1
  74. package/dist/rpc-server-entry.js.map +1 -1
  75. package/dist/runtime/product-host.d.ts +7 -0
  76. package/dist/runtime/product-host.d.ts.map +1 -1
  77. package/dist/runtime/product-host.js +29 -9
  78. package/dist/runtime/product-host.js.map +1 -1
  79. package/dist/runtime/session-factory.d.ts +18 -2
  80. package/dist/runtime/session-factory.d.ts.map +1 -1
  81. package/dist/runtime/session-factory.js +286 -23
  82. package/dist/runtime/session-factory.js.map +1 -1
  83. package/dist/runtime/session-host.d.ts +46 -1
  84. package/dist/runtime/session-host.d.ts.map +1 -1
  85. package/dist/runtime/session-host.js +38 -6
  86. package/dist/runtime/session-host.js.map +1 -1
  87. package/dist/ui-host.d.ts.map +1 -1
  88. package/dist/ui-host.js +3 -0
  89. package/dist/ui-host.js.map +1 -1
  90. package/dist/web/assets/index-C2SOU925.css +1 -0
  91. package/dist/web/assets/index-knXkInvO.js +41 -0
  92. package/dist/web/assets/index-knXkInvO.js.map +1 -0
  93. package/dist/web/index.html +2 -2
  94. package/dist/web-command.d.ts.map +1 -1
  95. package/dist/web-command.js +8 -1
  96. package/dist/web-command.js.map +1 -1
  97. package/dist/webui-entry.js +9 -1
  98. package/dist/webui-entry.js.map +1 -1
  99. package/dist/webui.d.ts +10 -0
  100. package/dist/webui.d.ts.map +1 -1
  101. package/dist/webui.js +21 -0
  102. package/dist/webui.js.map +1 -1
  103. package/package.json +11 -9
  104. package/dist/web/assets/index-BwfuGMvv.css +0 -1
  105. package/dist/web/assets/index-DPUaJqFJ.js +0 -41
  106. package/dist/web/assets/index-DPUaJqFJ.js.map +0 -1
@@ -1 +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;QAAE,OAAO,EAAE,CAAC;IACvB,MAAM,KAAK,GAAG,CACb,KAAiC,EACjC,OAAmC,EACM,EAAE;QAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAA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B,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"]}
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;AAM9D,OAAO,EAGN,oBAAoB,EAQpB,gBAAgB,GAMhB,MAAM,eAAe,CAAC;AAEvB,MAAM,oBAAoB,GAAG,GAAG,GAAG,IAAI,CAAC;AACxC,MAAM,yBAAyB,GAAG,8EAA8E,CAAC;AAgEjH,SAAS,kBAAkB,CAAC,IAAgC,EAAE,MAA0B;IACvF,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,MAAM,KAAK,GAAG,CACb,KAAiC,EACjC,OAAmC,EACM,EAAE;QAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC;YAClC,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,MAAM;gBAAE,OAAO,MAAM,CAAC;YAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC3C,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;QACzB,CAAC;QACD,OAAO,SAAS,CAAC;IAClB,CAAC,CAAC;IACF,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC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ChB,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 { UserInteractionInput, UserInteractionResult } from \"@di-code/plugin-sdk\";\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\nconst MAX_PROJECTION_BYTES = 256 * 1024;\nconst FORBIDDEN_PROJECTION_KEYS = /(?:^|[_-])(path|cwd|root|token|secret|authorization|api[_-]?key)(?:$|[_-])/iu;\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 interactions = new Map<\n\t\tstring,\n\t\t{ resolve: (result: UserInteractionResult) => void; readonly request: UserInteractionInput }\n\t>();\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\t/** Publishes a versioned projection only to clients that negotiated projection events. */\n\temitProjection(input: {\n\t\treadonly namespace: string;\n\t\treadonly projectionName: string;\n\t\treadonly version: number;\n\t\treadonly state: unknown;\n\t\treadonly requestId?: string;\n\t}): void {\n\t\tif (!this.negotiatedEvents.has(\"projection\")) return;\n\t\tif (!isBrowserSafeProjection(input.state)) {\n\t\t\tthis.onError(new Error(\"Skipped an unsafe extension projection.\"));\n\t\t\treturn;\n\t\t}\n\t\tconst record: RpcEventRecord = {\n\t\t\tversion: RPC_PROTOCOL_VERSION,\n\t\t\tkind: \"event\",\n\t\t\trequestId: input.requestId ?? \"projection\",\n\t\t\tsessionId: this.activeSessionId(),\n\t\t\tsequence: ++this.sequence,\n\t\t\tevent: {\n\t\t\t\ttype: \"projection\",\n\t\t\t\tnamespace: input.namespace,\n\t\t\t\tprojectionName: input.projectionName,\n\t\t\t\tversion: input.version,\n\t\t\t\tstate: structuredClone(input.state),\n\t\t\t},\n\t\t};\n\t\tthis.events.push(record);\n\t\tif (this.events.length > this.maxEvents) this.events.shift();\n\t\tthis.emit(record);\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\tfor (const pending of this.approvals.values()) pending.resolve(false);\n\t\tthis.approvals.clear();\n\t\tfor (const pending of this.interactions.values())\n\t\t\tpending.resolve({\n\t\t\t\trequestId: pending.request.requestId,\n\t\t\t\ttoolCallId: pending.request.toolCallId,\n\t\t\t\tstatus: \"disposed\",\n\t\t\t});\n\t\tthis.interactions.clear();\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\tconst host = this.host();\n\t\t\t\t\tconst ui = host.ui();\n\t\t\t\t\tconst skills = ui.availableSkills.map(({ name, description, scope }) => ({ name, description, scope }));\n\t\t\t\t\tconst projectResourcesDetected = host\n\t\t\t\t\t\t.startupStatus()\n\t\t\t\t\t\t.resourceDiagnostics.some((diagnostic) => diagnostic.kind === \"skill\" && diagnostic.stage === \"trust\");\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,\n\t\t\t\t\t\tprojectResourcesDetected,\n\t\t\t\t\t});\n\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 \"respond_interaction\": {\n\t\t\t\t\tconst interactionId = request.params.requestId as string;\n\t\t\t\t\tconst pending = this.interactions.get(interactionId);\n\t\t\t\t\tif (pending) {\n\t\t\t\t\t\tthis.interactions.delete(interactionId);\n\t\t\t\t\t\tpending.resolve({\n\t\t\t\t\t\t\trequestId: interactionId,\n\t\t\t\t\t\t\ttoolCallId: pending.request.toolCallId,\n\t\t\t\t\t\t\tstatus: request.params.status as UserInteractionResult[\"status\"],\n\t\t\t\t\t\t\t...(typeof request.params.approved === \"boolean\" ? { approved: request.params.approved } : {}),\n\t\t\t\t\t\t\t...(typeof request.params.value === \"string\" ? { value: request.params.value } : {}),\n\t\t\t\t\t\t\t...(typeof request.params.feedback === \"string\" ? { feedback: request.params.feedback } : {}),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn this.success(request.id, { method: \"respond_interaction\", requestId: interactionId });\n\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\") && !this.negotiatedEvents.has(\"interaction_request\")) return false;\n\t\tif (this.negotiatedEvents.has(\"interaction_request\")) {\n\t\t\tconst result = await this.requestInteraction(\n\t\t\t\t{ kind: \"approval\", prompt: `Allow tool ${toolName}?`, toolCallId: randomUUID(), intent: \"tool-approval\" },\n\t\t\t\tsignal,\n\t\t\t);\n\t\t\treturn result.status === \"answered\" && result.approved === true;\n\t\t}\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\tconst record: RpcEventRecord = {\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\tthis.events.push(record);\n\t\t\tif (this.events.length > this.maxEvents) this.events.shift();\n\t\t\tthis.emit(record);\n\t\t});\n\t}\n\n\t/** Requests a structured user response through the negotiated interaction channel. */\n\tasync requestInteraction(\n\t\tinput: Omit<UserInteractionInput, \"requestId\"> & { readonly requestId?: string },\n\t\tsignal?: AbortSignal,\n\t): Promise<UserInteractionResult> {\n\t\tif (!this.negotiatedEvents.has(\"interaction_request\")) {\n\t\t\tthrow Object.assign(new Error(\"No user interaction channel is available.\"), { code: \"INTERACTION_UNAVAILABLE\" });\n\t\t}\n\t\tconst requestId = input.requestId ?? randomUUID();\n\t\tconst request: UserInteractionInput = { ...input, requestId };\n\t\tconst existing = this.interactions.get(requestId);\n\t\tif (existing)\n\t\t\treturn await new Promise((resolve) => {\n\t\t\t\tconst original = existing.resolve;\n\t\t\t\texisting.resolve = (result) => {\n\t\t\t\t\toriginal(result);\n\t\t\t\t\tresolve(result);\n\t\t\t\t};\n\t\t\t});\n\t\treturn await new Promise<UserInteractionResult>((resolve, reject) => {\n\t\t\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\t\t\tconst abort = () => {\n\t\t\t\tthis.interactions.delete(requestId);\n\t\t\t\tif (timer !== undefined) clearTimeout(timer);\n\t\t\t\treject(Object.assign(new Error(\"User interaction was cancelled.\"), { code: \"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.interactions.set(requestId, {\n\t\t\t\trequest,\n\t\t\t\tresolve: (result) => {\n\t\t\t\t\tsignal?.removeEventListener(\"abort\", abort);\n\t\t\t\t\tif (timer !== undefined) clearTimeout(timer);\n\t\t\t\t\tresolve(result);\n\t\t\t\t},\n\t\t\t});\n\t\t\tif (input.timeoutMs !== undefined) {\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\tconst current = this.interactions.get(requestId);\n\t\t\t\t\tif (!current) return;\n\t\t\t\t\tthis.interactions.delete(requestId);\n\t\t\t\t\tsignal?.removeEventListener(\"abort\", abort);\n\t\t\t\t\tresolve({ requestId, toolCallId: input.toolCallId, status: \"timeout\" });\n\t\t\t\t}, input.timeoutMs);\n\t\t\t}\n\t\t\tconst record: RpcEventRecord = {\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: { type: \"interaction_request\", interactionRequestId: requestId, ...request },\n\t\t\t};\n\t\t\tthis.events.push(record);\n\t\t\tif (this.events.length > this.maxEvents) this.events.shift();\n\t\t\tthis.emit(record);\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\tif (sessionHost(this.session) && !commands.some((command) => command.name === \"plan\")) {\n\t\t\tcommands.push({ name: \"plan\", description: \"Enter or leave plan mode.\", kind: \"command\" });\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 (name === \"plan\" && sessionHost(this.session)) {\n\t\t\tawait this.session.planCommand(args);\n\t\t\tconst projection = this.session.planMode();\n\t\t\tif (projection)\n\t\t\t\tthis.emitProjection({\n\t\t\t\t\tnamespace: \"plan\",\n\t\t\t\t\tprojectionName: \"mode\",\n\t\t\t\t\tversion: 1,\n\t\t\t\t\tstate: projection,\n\t\t\t\t\trequestId: request.id,\n\t\t\t\t});\n\t\t\treturn { method: \"run_command\", command: name, action: { command: name, args } };\n\t\t}\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\"interaction_request\",\n\t\t\t\t\t\t\"product_audit\",\n\t\t\t\t\t\t\"projection\",\n\t\t\t\t\t].includes(event)\n\t\t\t\t)\n\t\t\t\t\tthis.negotiatedEvents.add(event);\n\t\tif (this.negotiatedEvents.has(\"projection\") && sessionHost(this.session)) {\n\t\t\tconst host = this.session;\n\t\t\tconst plan = host.planMode?.();\n\t\t\tif (plan) this.emitProjection({ namespace: \"plan\", projectionName: \"mode\", version: 1, state: plan });\n\t\t\tfor (const projection of host.projections?.() ?? [])\n\t\t\t\tthis.emitProjection({\n\t\t\t\t\tnamespace: projection.namespace,\n\t\t\t\t\tprojectionName: projection.projectionName,\n\t\t\t\t\tversion: projection.version,\n\t\t\t\t\tstate: projection.state,\n\t\t\t\t});\n\t\t\tconst extensions = host.extensions?.();\n\t\t\tif (extensions)\n\t\t\t\tthis.emitProjection({\n\t\t\t\t\tnamespace: \"extension\",\n\t\t\t\t\tprojectionName: \"ui\",\n\t\t\t\t\tversion: extensions.apiVersion,\n\t\t\t\t\tstate: { badges: extensions.badges, ui: extensions.ui },\n\t\t\t\t});\n\t\t}\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\t...(snapshot.events ? { events: snapshot.events } : {}),\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\tif (sessionHost(this.session) && this.negotiatedEvents.has(\"projection\")) {\n\t\t\tconst host = this.session;\n\t\t\tconst plan = host.planMode?.();\n\t\t\tif (plan) this.emitProjection({ namespace: \"plan\", projectionName: \"mode\", version: 1, state: plan });\n\t\t\tfor (const projection of host.projections?.() ?? [])\n\t\t\t\tthis.emitProjection({\n\t\t\t\t\tnamespace: projection.namespace,\n\t\t\t\t\tprojectionName: projection.projectionName,\n\t\t\t\t\tversion: projection.version,\n\t\t\t\t\tstate: projection.state,\n\t\t\t\t});\n\t\t\tconst extensions = host.extensions?.();\n\t\t\tif (extensions)\n\t\t\t\tthis.emitProjection({\n\t\t\t\t\tnamespace: \"extension\",\n\t\t\t\t\tprojectionName: \"ui\",\n\t\t\t\t\tversion: extensions.apiVersion,\n\t\t\t\t\tstate: { badges: extensions.badges, ui: extensions.ui },\n\t\t\t\t});\n\t\t}\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\nfunction isBrowserSafeProjection(value: unknown): boolean {\n\tconst visit = (candidate: unknown): boolean => {\n\t\tif (candidate === null || typeof candidate === \"string\" || typeof candidate === \"boolean\") return true;\n\t\tif (typeof candidate === \"number\") return Number.isFinite(candidate);\n\t\tif (Array.isArray(candidate)) return candidate.every(visit);\n\t\tif (typeof candidate !== \"object\") return false;\n\t\tfor (const [key, item] of Object.entries(candidate as Record<string, unknown>))\n\t\t\tif (FORBIDDEN_PROJECTION_KEYS.test(key) || !visit(item)) return false;\n\t\treturn true;\n\t};\n\tif (!visit(value)) return false;\n\ttry {\n\t\treturn Buffer.byteLength(JSON.stringify(value), \"utf8\") <= MAX_PROJECTION_BYTES;\n\t} catch {\n\t\treturn false;\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"]}
@@ -8,7 +8,7 @@ export declare const RPC_MAX_ATTACHMENT_BYTES: number;
8
8
  /** Allows one JSONL user entry containing a maximum-sized base64 image to be read in a single transcript page. */
9
9
  export declare const RPC_MAX_TRANSCRIPT_BYTES: number;
10
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"];
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", "respond_interaction"];
12
12
  export type RpcMethod = (typeof RPC_METHODS)[number];
13
13
  export interface RpcRequest {
14
14
  readonly version: typeof RPC_PROTOCOL_VERSION;
@@ -36,7 +36,14 @@ export interface RpcCapabilities {
36
36
  readonly events: readonly RpcExtendedEventName[];
37
37
  readonly eventBufferSize: number;
38
38
  }
39
- export type RpcExtendedEventName = "sequence" | "operation_update" | "snapshot_required" | "session_changed" | "tool_approval" | "product_audit";
39
+ export type RpcExtendedEventName = "sequence" | "operation_update" | "snapshot_required" | "session_changed" | "tool_approval" | "interaction_request" | "product_audit" | "projection";
40
+ export interface RpcProjectionEvent {
41
+ readonly type: "projection";
42
+ readonly namespace: string;
43
+ readonly projectionName: string;
44
+ readonly version: number;
45
+ readonly state: unknown;
46
+ }
40
47
  export interface RpcProductState {
41
48
  readonly projectTrusted: boolean;
42
49
  }
@@ -113,7 +120,7 @@ export type RpcSuccessResult = {
113
120
  readonly method: RpcMethod;
114
121
  readonly [key: string]: unknown;
115
122
  };
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";
123
+ 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" | "INTERACTION_UNAVAILABLE";
117
124
  export interface RpcSuccessResponse {
118
125
  readonly version: typeof RPC_PROTOCOL_VERSION;
119
126
  readonly kind: "response";
@@ -141,9 +148,9 @@ export interface RpcEventRecord {
141
148
  readonly target?: string;
142
149
  readonly projectTrusted?: boolean;
143
150
  } | {
144
- readonly type: "snapshot_required" | "operation_update" | "session_changed" | "tool_approval";
151
+ readonly type: "snapshot_required" | "operation_update" | "session_changed" | "tool_approval" | "interaction_request";
145
152
  readonly [key: string]: unknown;
146
- };
153
+ } | RpcProjectionEvent;
147
154
  readonly sessionId?: string;
148
155
  readonly sequence?: number;
149
156
  }
@@ -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;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,CAAC;IAC9B,QAAQ,CAAC,QA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