@fishwithcat/dsh-subagent 0.0.0-stage → 0.2.2-alpha.3

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 (59) hide show
  1. package/README.i18n.yaml +121 -0
  2. package/README.md +258 -2
  3. package/README.zh.md +259 -0
  4. package/lib/index.js +3065 -0
  5. package/lib/typert.host.d.ts +3 -0
  6. package/lib/typert.host.js +1086 -0
  7. package/lib/typert.remote-client.d.ts +29 -0
  8. package/lib/typert.remote-client.js +122 -0
  9. package/lib/types/activation.d.ts +110 -0
  10. package/lib/types/activation.js +112 -0
  11. package/lib/types/archive-admission.d.ts +23 -0
  12. package/lib/types/archive-admission.js +75 -0
  13. package/lib/types/assistant-output.d.ts +48 -0
  14. package/lib/types/assistant-output.js +73 -0
  15. package/lib/types/catalog.d.ts +87 -0
  16. package/lib/types/catalog.js +113 -0
  17. package/lib/types/child-agent.d.ts +145 -0
  18. package/lib/types/child-agent.js +229 -0
  19. package/lib/types/client.d.ts +8 -0
  20. package/lib/types/client.js +7 -0
  21. package/lib/types/continuation-messages.d.ts +66 -0
  22. package/lib/types/continuation-messages.js +116 -0
  23. package/lib/types/control-types.d.ts +121 -0
  24. package/lib/types/control-types.js +8 -0
  25. package/lib/types/control.d.ts +41 -0
  26. package/lib/types/control.js +75 -0
  27. package/lib/types/depth.d.ts +31 -0
  28. package/lib/types/depth.js +39 -0
  29. package/lib/types/descriptor.d.ts +105 -0
  30. package/lib/types/descriptor.js +192 -0
  31. package/lib/types/error.d.ts +11 -0
  32. package/lib/types/error.js +14 -0
  33. package/lib/types/index.d.ts +282 -0
  34. package/lib/types/index.js +398 -0
  35. package/lib/types/lifecycle.d.ts +54 -0
  36. package/lib/types/lifecycle.js +89 -0
  37. package/lib/types/list-children.d.ts +36 -0
  38. package/lib/types/list-children.js +166 -0
  39. package/lib/types/manager.d.ts +215 -0
  40. package/lib/types/manager.js +1171 -0
  41. package/lib/types/out-of-process.d.ts +92 -0
  42. package/lib/types/out-of-process.js +177 -0
  43. package/lib/types/projection-types.d.ts +93 -0
  44. package/lib/types/projection-types.js +7 -0
  45. package/lib/types/projection.d.ts +94 -0
  46. package/lib/types/projection.js +157 -0
  47. package/lib/types/structured.d.ts +49 -0
  48. package/lib/types/structured.js +130 -0
  49. package/lib/types/types.d.ts +331 -0
  50. package/lib/types/types.js +17 -0
  51. package/locale/de.json +6 -0
  52. package/locale/en.json +5 -0
  53. package/locale/es.json +6 -0
  54. package/locale/fr.json +6 -0
  55. package/locale/ja.json +6 -0
  56. package/locale/pt.json +6 -0
  57. package/locale/ru.json +6 -0
  58. package/locale/zh.json +6 -0
  59. package/package.json +131 -4
@@ -0,0 +1,1086 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ import { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-info'
5
+
6
+ let _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0$schema$value
7
+ const _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0$schema$value ??= z.string())
8
+ let _deepseek_ai_dsh_subagent_subagents_interruptByUser_result$schema$value
9
+ const _deepseek_ai_dsh_subagent_subagents_interruptByUser_result$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByUser_result$schema$value ??= z.object({
10
+ 'accepted': z.literal(true).readonly(),
11
+ }))
12
+ let _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema$value
13
+ const _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema = () => (_deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema$value ??= z.object({
14
+ 'requestId': z.string().readonly().describe('Identity persisted on the accepted message, minted before the call.'),
15
+ 'childSessionId': z.string().readonly(),
16
+ 'delivery': z.union([z.literal("queue"), z.literal("steer")]).readonly().describe('Whether this message queues a later turn or targets the nearest step.'),
17
+ 'content': z.array(z.union([z.object({
18
+ 'type': z.literal("text").readonly(),
19
+ 'text': z.string().readonly(),
20
+ }), z.object({
21
+ 'type': z.literal("image").readonly(),
22
+ 'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]).readonly(),
23
+ 'data': z.string().readonly(),
24
+ 'name': z.string().readonly().optional(),
25
+ })])).readonly().describe('Browser prompt parts delivered as the child\'s user message. The Host admits and persists image parts before delivery, so the wire never carries a durable attachment reference the caller could fabricate.'),
26
+ 'clientTimeZone': z.string().readonly().optional().describe('Optional browser zone sampled for this exact human prompt.'),
27
+ }))
28
+ let _deepseek_ai_dsh_subagent_subagents_prompt_result$schema$value
29
+ const _deepseek_ai_dsh_subagent_subagents_prompt_result$schema = () => (_deepseek_ai_dsh_subagent_subagents_prompt_result$schema$value ??= z.object({
30
+ 'messageId': z.string().readonly(),
31
+ }))
32
+ let _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema$value
33
+ const _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema = () => (_deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema$value ??= z.string())
34
+ let _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0_strict$schema$value
35
+ const _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0_strict$schema = () => (_deepseek_ai_dsh_subagent_subagents_prompt_parameter_0_strict$schema$value ??= z.strictObject({
36
+ 'requestId': z.string().readonly().describe('Identity persisted on the accepted message, minted before the call.'),
37
+ 'childSessionId': z.string().readonly(),
38
+ 'delivery': z.union([z.literal("queue"), z.literal("steer")]).readonly().describe('Whether this message queues a later turn or targets the nearest step.'),
39
+ 'content': z.array(z.union([z.strictObject({
40
+ 'type': z.literal("text").readonly(),
41
+ 'text': z.string().readonly(),
42
+ }), z.strictObject({
43
+ 'type': z.literal("image").readonly(),
44
+ 'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]).readonly(),
45
+ 'data': z.string().readonly(),
46
+ 'name': z.string().readonly().optional(),
47
+ })])).readonly().describe('Browser prompt parts delivered as the child\'s user message. The Host admits and persists image parts before delivery, so the wire never carries a durable attachment reference the caller could fabricate.'),
48
+ 'clientTimeZone': z.string().readonly().optional().describe('Optional browser zone sampled for this exact human prompt.'),
49
+ }))
50
+
51
+ const $remote = createTypertRemoteInfo({
52
+ package: '@fishwithcat/dsh-subagent',
53
+ methods: {
54
+ 'subagents/interruptByUser': {
55
+ service: 'subagents',
56
+ description: 'Remote face of {@link interrupt}, authorized on the target Session by the Gateway. No catalog, history, persistence, or parent Agent lookup runs. Absent, idle, and already-completed targets are accepted no-ops there.',
57
+ invocation: { kind: 'direct' },
58
+ parameters: [
59
+ {
60
+ name: 'childSessionId',
61
+ description: 'durable child session id to interrupt.',
62
+ source: 'json',
63
+ codec: {
64
+ mode: 'strict',
65
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
66
+ create: _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0$schema,
67
+ jsonSchema: {"type":"string"},
68
+ },
69
+ strictCodec: {
70
+ mode: 'strict',
71
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
72
+ create: _deepseek_ai_dsh_subagent_subagents_interruptByUser_parameter_0_strict$schema,
73
+ jsonSchema: {"type":"string"},
74
+ },
75
+ },
76
+ ],
77
+ result: {
78
+ mode: 'strict',
79
+ typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentInterruptReceipt',
80
+ create: _deepseek_ai_dsh_subagent_subagents_interruptByUser_result$schema,
81
+ description: 'acknowledgement that the cancel signal was admitted, not that the target is quiescent.',
82
+ jsonSchema: {"type":"object","properties":{"accepted":{"type":"boolean","const":true}},"required":["accepted"],"additionalProperties":true},
83
+ },
84
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":467,"column":3},
85
+ },
86
+ 'subagents/prompt': {
87
+ service: 'subagents',
88
+ description: 'Deliver one browser-authored message to a continuable child through its live subagent tree root, retaining the caller-minted request identity and validated browser zone on the accepted message. Success identifies the message the child\'s inbox accepted; later execution is independent of this call. Queue delivery targets a later turn; steer delivery targets the nearest step and retains the Agent loop\'s best-effort fallback semantics. Image parts are admitted and persisted through the attachment store before delivery, and the child\'s model must accept image input. Cold resume at capacity rejects with `subagent/delivery-unavailable`. Access is checked on the target Session before attachment admission or restoration.',
89
+ invocation: { kind: 'direct' },
90
+ parameters: [
91
+ {
92
+ name: 'request',
93
+ description: 'target id, delivery, minted identity, content, and optional browser zone.',
94
+ source: 'json',
95
+ codec: {
96
+ mode: 'strict',
97
+ typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptRequest',
98
+ create: _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0$schema,
99
+ jsonSchema: {"type":"object","properties":{"requestId":{"type":"string","description":"Identity persisted on the accepted message, minted before the call."},"childSessionId":{"type":"string"},"delivery":{"type":"string","enum":["queue","steer"],"description":"Whether this message queues a later turn or targets the nearest step."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":true},{"type":"object","properties":{"type":{"type":"string","const":"image"},"mediaType":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/gif"]},"data":{"type":"string"},"name":{"type":"string"}},"required":["type","mediaType","data"],"additionalProperties":true}]},"description":"Browser prompt parts delivered as the child's user message. The Host admits and persists image parts before delivery, so the wire never carries a durable attachment reference the caller could fabricate."},"clientTimeZone":{"type":"string","description":"Optional browser zone sampled for this exact human prompt."}},"required":["requestId","childSessionId","delivery","content"],"additionalProperties":true},
100
+ },
101
+ strictCodec: {
102
+ mode: 'strict',
103
+ typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptRequest',
104
+ create: _deepseek_ai_dsh_subagent_subagents_prompt_parameter_0_strict$schema,
105
+ jsonSchema: {"type":"object","properties":{"requestId":{"type":"string","description":"Identity persisted on the accepted message, minted before the call."},"childSessionId":{"type":"string"},"delivery":{"type":"string","enum":["queue","steer"],"description":"Whether this message queues a later turn or targets the nearest step."},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"image"},"mediaType":{"type":"string","enum":["image/png","image/jpeg","image/webp","image/gif"]},"data":{"type":"string"},"name":{"type":"string"}},"required":["type","mediaType","data"],"additionalProperties":false}]},"description":"Browser prompt parts delivered as the child's user message. The Host admits and persists image parts before delivery, so the wire never carries a durable attachment reference the caller could fabricate."},"clientTimeZone":{"type":"string","description":"Optional browser zone sampled for this exact human prompt."}},"required":["requestId","childSessionId","delivery","content"],"additionalProperties":false},
106
+ },
107
+ },
108
+ ],
109
+ cancellation: { parameter: 'signal' },
110
+ result: {
111
+ mode: 'strict',
112
+ typeSymbol: '@deepseek-ai/dsh-subagent/client#SubagentPromptReceipt',
113
+ create: _deepseek_ai_dsh_subagent_subagents_prompt_result$schema,
114
+ description: 'the accepted message\'s inbox identity.',
115
+ jsonSchema: {"type":"object","properties":{"messageId":{"type":"string"}},"required":["messageId"],"additionalProperties":true},
116
+ },
117
+ sourceLocation: {"file":"packages/subagent/subagent/src/index.ts","line":414,"column":9},
118
+ },
119
+ },
120
+ }, z)
121
+
122
+ export const TYPERT = {
123
+ package: '@fishwithcat/dsh-subagent',
124
+ face: 'host',
125
+ schemas: [
126
+ ],
127
+ get invocations() { return $remote.descriptors },
128
+ model: {
129
+ "services": [
130
+ {
131
+ "description": "Named provider registry with managed activations, durable discovery, and local child messaging.",
132
+ "summary": "Named provider registry with managed activations, durable discovery, and local child messaging.",
133
+ "tags": [],
134
+ "jsDoc": "/** Named provider registry with managed activations, durable discovery, and local child messaging. */",
135
+ "key": "subagents",
136
+ "exportName": "SubagentRuntime",
137
+ "members": [
138
+ {
139
+ "kind": "method",
140
+ "name": "resolveMaxDepth",
141
+ "signature": "resolveMaxDepth(configured?: number | 'provider-managed'): number | undefined",
142
+ "summary": "Resolve a delegation tool's depth policy against the current user setting.",
143
+ "jsDoc": "/**\n * Resolve a delegation tool's depth policy against the current user setting.\n * @param configured - Explicit tool limit, or provider-managed for external delegation.\n * @returns The numeric limit, or undefined when the provider owns depth enforcement.\n */"
144
+ },
145
+ {
146
+ "kind": "method",
147
+ "name": "startActivation",
148
+ "signature": "startActivation(spec: SubagentActivationSpec & { readonly childId: SessionId }): Promise<SubagentActivation & { readonly messageId: MessageId }>",
149
+ "summary": "Start a local child under its reserved identity.",
150
+ "jsDoc": "/**\n * Start a local child under its reserved identity.\n * @param spec - local task, reserved child id, and result recipient.\n * @returns activation with its accepted initial message id.\n */"
151
+ },
152
+ {
153
+ "kind": "method",
154
+ "name": "startActivation",
155
+ "signature": "startActivation(spec: SubagentActivationSpec): Promise<SubagentActivation>",
156
+ "summary": "Start a local or external child.",
157
+ "jsDoc": "/**\n * Start a local or external child.\n * @param spec - task, backend, and result recipient.\n * @returns activation with a message id only for local children.\n */"
158
+ },
159
+ {
160
+ "kind": "method",
161
+ "name": "rootOf",
162
+ "signature": "rootOf(caller: Agent): Agent",
163
+ "summary": "Resolve the root shared by an Agent and its other agents in its subagent tree.",
164
+ "jsDoc": "/**\n * Resolve the root shared by an Agent and its other agents in its subagent tree.\n * @param caller - exact live Agent whose subagent ancestry selects the tree.\n * @returns the live root; ordinary Session forks lead independent trees.\n * @throws when the caller or its runtime owner is unavailable.\n */"
165
+ },
166
+ {
167
+ "kind": "method",
168
+ "name": "waitForTreeWork",
169
+ "signature": "async waitForTreeWork(root: Agent): Promise<boolean>",
170
+ "summary": "Join progressing subagent tree work for its root.",
171
+ "jsDoc": "/**\n * Join progressing subagent tree work for its root. Idle members with parked input\n * stay resident without delaying host completion. Ordinary members return false.\n * @param root - exact live subagent tree root whose member work is awaited.\n * @returns whether work was joined; hosts recheck root idle after true.\n */"
172
+ },
173
+ {
174
+ "kind": "method",
175
+ "name": "sendMessage",
176
+ "signature": "async sendMessage( sender: Agent, targetId: SessionId, content: ContentBlock[], options: SubagentSendMessageOptions, ): Promise<MessageId>",
177
+ "summary": "Steer one model-authored message to another member of the same subagent tree.",
178
+ "jsDoc": "/**\n * Steer one model-authored message to another member of the same subagent tree.\n * A running target receives it at its next step; an idle target starts a turn.\n * A cold target resumes under its runtime subagent tree root without restoring\n * its creation ancestors. Sender identity is rechecked before inbox acceptance; cancellation\n * stops only pre-acceptance work and never retracts an accepted message.\n * @param sender - exact live root or resident continuable Agent originating the message.\n * @param targetId - another root or continuable member's durable Session id.\n * @param content - model-authored content to deliver.\n * @param options - caller cancellation before inbox acceptance.\n * @returns the accepted message's inbox id.\n * @throws when the target is outside the tree, cannot resume, or rejects input.\n */"
179
+ },
180
+ {
181
+ "kind": "method",
182
+ "name": "interrupt",
183
+ "signature": "interrupt(targetSessionId: SessionId, authority: SubagentInterruptAuthority): void",
184
+ "summary": "Interrupt one live child's current execution under a trusted user operation or an exact live ancestor Agent.",
185
+ "jsDoc": "/**\n * Interrupt one live child's current execution under a trusted user\n * operation or an exact live ancestor Agent. Fire-and-return: the cancel\n * signal is issued before this returns, but the target may keep running\n * until it observes the signal. Unclaimed pending inbox work, the Activation,\n * and published descendants are preserved; claimed work is not requeued.\n * Once the interrupted Agent is idle, a waking send resumes the parked FIFO\n * queue. External backends stop their single execution. An absent target\n * is an accepted no-op, as is a manager-less composition, which cannot own a\n * live Activation.\n * @param targetSessionId - the durable child session id to interrupt.\n * @param authority - a trusted user operation or exact live ancestor Agent.\n * @throws {SubagentError} `UNAUTHORIZED` when the authority does not own the\n * live target.\n */"
186
+ },
187
+ {
188
+ "kind": "method",
189
+ "name": "drainDescendants",
190
+ "signature": "async drainDescendants(parents: readonly Agent[]): Promise<void>",
191
+ "summary": "Close admission and stop all instances in the selected subagent trees, then await pending startup and cleanup.",
192
+ "jsDoc": "/**\n * Close admission and stop all instances in the selected subagent trees, then await\n * pending startup and cleanup. Ordinary members are ignored. The cutoff lasts\n * until each exact root leaves the registry; unrelated subagent trees remain live.\n * @param parents - exact live subagent tree roots entering teardown.\n * @returns once all admitted startup and member cleanup have settled.\n * @throws an aggregate error after all branches settle when any failed.\n */"
193
+ },
194
+ {
195
+ "kind": "method",
196
+ "name": "listDescendants",
197
+ "signature": "listDescendants(rootSessionId: SessionId, signal?: AbortSignal): Promise<SubagentDescendantListEntry[]>",
198
+ "summary": "Recursively list reachable parent catalogs in stable pre-order, preserving each catalog's event order.",
199
+ "jsDoc": "/**\n * Recursively list reachable parent catalogs in stable pre-order, preserving\n * each catalog's event order. Each row carries its catalog parent and depth;\n * external children are leaves; one-shot and unknown-mode children remain\n * traversal nodes. Unknown modes\n * produce unsupported diagnostics. Unreadable child catalogs produce corrupt\n * or unavailable diagnostics and stop only that branch. Root read failures,\n * missing services or projections, and cancellation reject the whole listing.\n * Each catalog is observed once and released before the next read. No Agent\n * is loaded or resumed; Sessions absent from reachable catalogs are omitted.\n * @param rootSessionId - session whose catalog starts descendant discovery.\n * @param signal - cancellation forwarded to and checked around each catalog read.\n * @returns children and branch diagnostics in parent-catalog pre-order.\n * @throws {@link SubagentError} when listing dependencies are unavailable or the caller cancels.\n * @throws SessionQueryError when the root catalog cannot be read.\n */"
200
+ },
201
+ {
202
+ "kind": "method",
203
+ "name": "prompt",
204
+ "signature": "@Remote({ name: 'prompt', resources: { session: request => request.childSessionId } }) async prompt(request: SubagentPromptRequest, signal: AbortSignal): Promise<SubagentPromptReceipt>",
205
+ "summary": "Deliver one browser-authored message to a continuable child through its live subagent tree root, retaining the caller-minted request identity and validated browser zone on the accepted message.",
206
+ "jsDoc": "/**\n * Deliver one browser-authored message to a continuable child through its\n * live subagent tree root, retaining the caller-minted request identity and\n * validated browser zone on the accepted message. Success identifies the\n * message the child's inbox accepted; later execution is independent of this\n * call. Queue delivery targets a later turn; steer delivery targets the\n * nearest step and retains the Agent loop's best-effort fallback semantics.\n * Image parts are admitted and persisted through the attachment store\n * before delivery, and the child's model must accept image input.\n * Cold resume at capacity rejects with `subagent/delivery-unavailable`.\n * Access is checked on the target Session before attachment admission or restoration.\n * @param request - target id, delivery, minted identity, content, and optional browser zone.\n * @param signal - carrier cancellation, owning the call until inbox acceptance.\n * @returns the accepted message's inbox identity.\n * @throws {RemoteError} `gateway/bad-request`, `subagent/attachment-invalid`,\n * `subagent/invalid-time-zone`,\n * `subagent/not-resumable`, `subagent/unauthorized`,\n * `subagent/delivery-unavailable`, `gateway/cancelled`, or `gateway/internal`.\n */"
207
+ },
208
+ {
209
+ "kind": "method",
210
+ "name": "interruptByUser",
211
+ "signature": "@Remote({ name: 'interruptByUser', resources: { session: childSessionId => childSessionId } }) interruptByUser(childSessionId: SessionId): SubagentInterruptReceipt",
212
+ "summary": "Remote face of {@link interrupt}, authorized on the target Session by the Gateway.",
213
+ "jsDoc": "/**\n * Remote face of {@link interrupt}, authorized on the target Session by the Gateway.\n * No catalog, history, persistence, or parent Agent lookup runs.\n * Absent, idle, and already-completed targets are accepted no-ops there.\n * @param childSessionId - durable child session id to interrupt.\n * @returns acknowledgement that the cancel signal was admitted, not that the target is quiescent.\n * @throws {RemoteError} `gateway/bad-request` for an empty id,\n * otherwise `gateway/internal`.\n */"
214
+ },
215
+ {
216
+ "kind": "method",
217
+ "name": "registerProvider",
218
+ "signature": "registerProvider(provider: SubagentProvider): () => void",
219
+ "summary": "Register a provider under its name.",
220
+ "jsDoc": "/**\n * Register a provider under its name. Registration is effect-scoped and HMR\n * safe; removing a provider blocks new starts but does not revoke runs that\n * were already returned to their holders. Providers without either execution\n * method are rejected with UNSUPPORTED_CAPABILITY before registration.\n * @param provider - the trusted provider implementation.\n * @returns the exact Cordis effect disposer.\n */"
221
+ },
222
+ {
223
+ "kind": "method",
224
+ "name": "getProvider",
225
+ "signature": "getProvider(name: string): SubagentProvider | undefined",
226
+ "summary": "Look up a provider by name.",
227
+ "jsDoc": "/**\n * Look up a provider by name.\n * @param name - the provider name.\n * @returns the provider, or undefined when absent.\n */"
228
+ }
229
+ ],
230
+ "types": [
231
+ {
232
+ "name": "AfterScheduleRecord",
233
+ "declaration": "export interface AfterScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: 'after';\n readonly title: string;\n readonly prompt: string;\n readonly afterSeconds: number;\n readonly scheduledAt: string;\n}"
234
+ },
235
+ {
236
+ "name": "Agent",
237
+ "declaration": "export interface Agent {\n readonly id: SessionId;\n readonly options: AgentOptions;\n readonly session: Session;\n readonly model: Model;\n readonly inbox: Inbox;\n readonly status: AgentStatus;\n readonly ctx: Context;\n cancel(cause: AgentCancelCause, options?: CancelOptions): void;\n whenIdle(): Promise<void>;\n runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;\n send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;\n followup(message: UserMessage): void;\n steer(message: UserMessage): void;\n inject(message: UserMessage): void;\n}"
238
+ },
239
+ {
240
+ "name": "AgentCancelCause",
241
+ "declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
242
+ },
243
+ {
244
+ "name": "AgentMessageSource",
245
+ "declaration": "export interface AgentMessageSource {\n readonly kind: 'agent-message';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
246
+ },
247
+ {
248
+ "name": "AgentOptions",
249
+ "declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId | undefined;\n maxTokens?: number;\n subagentDepth?: number;\n}"
250
+ },
251
+ {
252
+ "name": "AgentStatus",
253
+ "declaration": "export type AgentStatus = 'idle' | 'running';"
254
+ },
255
+ {
256
+ "name": "AllowedModelRoute",
257
+ "declaration": "export interface AllowedModelRoute {\n readonly provider: string;\n readonly model: string;\n}"
258
+ },
259
+ {
260
+ "name": "ApprovalOutcome",
261
+ "declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
262
+ },
263
+ {
264
+ "name": "ApprovalPolicy",
265
+ "declaration": "export type ApprovalPolicy = 'ask' | 'never';"
266
+ },
267
+ {
268
+ "name": "ApprovalRequestId",
269
+ "declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
270
+ },
271
+ {
272
+ "name": "AssistantMessage",
273
+ "declaration": "export interface AssistantMessage extends MessageBase {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
274
+ },
275
+ {
276
+ "name": "AssistantProviderMetadata",
277
+ "declaration": "export interface AssistantProviderMetadata {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
278
+ },
279
+ {
280
+ "name": "AssistantStreamRecord",
281
+ "declaration": "export type AssistantStreamRecord = { readonly type: 'text-chunks'; readonly time0: number; readonly index: number; readonly dt: readonly number[]; readonly texts: readonly string[]; } | { readonly type: 'reasoning-chunks'; readonly time0: number; readonly index: number; readonly dt: readonly number[]; readonly texts: readonly string[]; } | { readonly type: 'tool-call-chunks'; readonly time0: number; readonly index: number; readonly dt: readonly number[]; readonly id: ToolCallId; readonly name?: string; readonly args: readonly string[]; } | { readonly type: 'chunk'; readonly time: number; readonly chunk: StreamChunk; };"
282
+ },
283
+ {
284
+ "name": "AtScheduleRecord",
285
+ "declaration": "export interface AtScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: 'at';\n readonly title: string;\n readonly prompt: string;\n readonly scheduledAt: string;\n}"
286
+ },
287
+ {
288
+ "name": "AttachmentId",
289
+ "declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
290
+ },
291
+ {
292
+ "name": "Branded",
293
+ "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
294
+ },
295
+ {
296
+ "name": "BrandedNumber",
297
+ "declaration": "export type BrandedNumber<B extends string> = number & { readonly [BRAND]: B; };"
298
+ },
299
+ {
300
+ "name": "CancelOptions",
301
+ "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
302
+ },
303
+ {
304
+ "name": "CommandId",
305
+ "declaration": "export type CommandId = Branded<'CommandId'>;"
306
+ },
307
+ {
308
+ "name": "CommandSource",
309
+ "declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
310
+ },
311
+ {
312
+ "name": "CommandSourceMap",
313
+ "declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
314
+ },
315
+ {
316
+ "name": "CompactionCheckpointSource",
317
+ "declaration": "export type CompactionCheckpointSource = typeof COMPACT_CHECKPOINT_MARKER & { readonly compactionId: CompactionId; readonly sourceCommandId?: CommandId; };"
318
+ },
319
+ {
320
+ "name": "CompactionId",
321
+ "declaration": "export type CompactionId = Branded<'CompactionId'>;"
322
+ },
323
+ {
324
+ "name": "ContentBlock",
325
+ "declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
326
+ },
327
+ {
328
+ "name": "ContentBlockMap",
329
+ "declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n file: FileBlock;\n 'tool-call': ToolCallBlock;\n 'tool-addition': ToolAdditionBlock;\n 'tool-removal': ToolRemovalBlock;\n}"
330
+ },
331
+ {
332
+ "name": "ContentBlockType",
333
+ "declaration": "export type ContentBlockType = keyof ContentBlockMap;"
334
+ },
335
+ {
336
+ "name": "ContextFormed",
337
+ "declaration": "export type ContextFormed = { readonly form?: never; } | { readonly form: 'instructions'; } | { readonly form: 'catalog'; } | { readonly form: 'snapshot'; readonly sections: readonly ContextSnapshotSection[]; } | { readonly form: 'notice'; readonly summary: string; } | { readonly form: 'relay'; } | { readonly form: 'recall'; };"
338
+ },
339
+ {
340
+ "name": "ContextSnapshotSection",
341
+ "declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
342
+ },
343
+ {
344
+ "name": "ContinuableCreateRequest",
345
+ "declaration": "export interface ContinuableCreateRequest {\n readonly cwd: string;\n readonly sessionId: SessionId;\n readonly parent: Agent;\n readonly signal: AbortSignal;\n}"
346
+ },
347
+ {
348
+ "name": "ContinuableCreateSpec",
349
+ "declaration": "export interface ContinuableCreateSpec {\n readonly seed?: readonly SessionEvent[];\n}"
350
+ },
351
+ {
352
+ "name": "ContinuableSubagentDescriptorData",
353
+ "declaration": "export interface ContinuableSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'continuable';\n readonly label: string;\n readonly agentProvider?: string;\n readonly agentModel?: string;\n readonly agentReasoningEffort?: ReasoningEffortId;\n readonly persona?: string;\n readonly toolFilter?: ToolRestriction;\n}"
354
+ },
355
+ {
356
+ "name": "DeveloperMessage",
357
+ "declaration": "export interface DeveloperMessage extends MessageBase {\n readonly role: 'developer';\n}"
358
+ },
359
+ {
360
+ "name": "EpochHeader",
361
+ "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
362
+ },
363
+ {
364
+ "name": "EveryScheduleDispatchChange",
365
+ "declaration": "export interface EveryScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n readonly acceptedAt: string;\n}"
366
+ },
367
+ {
368
+ "name": "EveryScheduleRecord",
369
+ "declaration": "export interface EveryScheduleRecord {\n readonly id: ScheduleId;\n readonly kind: 'every';\n readonly title: string;\n readonly prompt: string;\n readonly everySeconds: number;\n readonly scheduledAt: string;\n}"
370
+ },
371
+ {
372
+ "name": "FeedbackCategory",
373
+ "declaration": "export type FeedbackCategory = 'task-result' | 'instruction-following' | 'product-interaction' | 'service-stability' | 'resource-cost' | 'security-privacy-permission' | 'other';"
374
+ },
375
+ {
376
+ "name": "FeedbackRecord",
377
+ "declaration": "export interface FeedbackRecord {\n readonly text?: string;\n readonly category?: FeedbackCategory;\n}"
378
+ },
379
+ {
380
+ "name": "FileAttachmentRef",
381
+ "declaration": "export interface FileAttachmentRef {\n attachmentId: AttachmentId;\n name: string;\n bytes: number;\n}"
382
+ },
383
+ {
384
+ "name": "FileBlock",
385
+ "declaration": "export interface FileBlock {\n type: 'file';\n attachment: FileAttachmentRef;\n}"
386
+ },
387
+ {
388
+ "name": "FinishReason",
389
+ "declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
390
+ },
391
+ {
392
+ "name": "FinishReasonMap",
393
+ "declaration": "export interface FinishReasonMap {\n stop: { kind: 'stop'; };\n 'tool-calls': { kind: 'tool-calls'; };\n 'max-tokens': { kind: 'max-tokens'; };\n aborted: { kind: 'aborted'; failure: LlmFailure; };\n error: { kind: 'error'; failure: LlmFailure; };\n}"
394
+ },
395
+ {
396
+ "name": "GoalBlockReason",
397
+ "declaration": "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
398
+ },
399
+ {
400
+ "name": "GoalChangeMeta",
401
+ "declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
402
+ },
403
+ {
404
+ "name": "GoalClearChangeMeta",
405
+ "declaration": "export interface GoalClearChangeMeta {\n readonly kind: 'goal/change';\n readonly version: 1;\n readonly operation: 'clear';\n readonly cleared: GoalRef;\n readonly clearedAt: number;\n}"
406
+ },
407
+ {
408
+ "name": "GoalId",
409
+ "declaration": "export type GoalId = Branded<'GoalId'>;"
410
+ },
411
+ {
412
+ "name": "GoalMessageSource",
413
+ "declaration": "export interface GoalMessageSource {\n readonly kind: 'goal';\n readonly goalId: GoalId;\n readonly revision: number;\n readonly round: number;\n}"
414
+ },
415
+ {
416
+ "name": "GoalOperation",
417
+ "declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
418
+ },
419
+ {
420
+ "name": "GoalPhase",
421
+ "declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
422
+ },
423
+ {
424
+ "name": "GoalRef",
425
+ "declaration": "export interface GoalRef {\n readonly id: GoalId;\n readonly revision: number;\n}"
426
+ },
427
+ {
428
+ "name": "GoalSnapshot",
429
+ "declaration": "export interface GoalSnapshot extends GoalRef {\n readonly objective: string;\n readonly phase: GoalPhase;\n readonly blockedReason?: GoalBlockReason;\n readonly maxGoalRounds: number;\n}"
430
+ },
431
+ {
432
+ "name": "GoalSnapshotChangeMeta",
433
+ "declaration": "export interface GoalSnapshotChangeMeta {\n readonly kind: 'goal/change';\n readonly version: 1;\n readonly operation: Exclude<GoalOperation, 'clear'>;\n readonly goal: GoalSnapshot;\n readonly roundsStarted: number;\n readonly createdAt: number;\n readonly updatedAt: number;\n}"
434
+ },
435
+ {
436
+ "name": "ImageAttachmentRef",
437
+ "declaration": "export interface ImageAttachmentRef {\n attachmentId: AttachmentId;\n mediaType: ImageMediaType;\n bytes: number;\n width: number;\n height: number;\n name?: string;\n originalDimensions?: { width: number; height: number; };\n}"
438
+ },
439
+ {
440
+ "name": "ImageBlock",
441
+ "declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n offloaded?: true;\n}"
442
+ },
443
+ {
444
+ "name": "ImageMediaType",
445
+ "declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
446
+ },
447
+ {
448
+ "name": "ImageOffloadTarget",
449
+ "declaration": "export interface ImageOffloadTarget {\n seq: SessionSeq;\n imageIndexes: number[];\n}"
450
+ },
451
+ {
452
+ "name": "Inbox",
453
+ "declaration": "export interface Inbox {\n readonly nextTurn: readonly UserMessage[];\n readonly nextStep: readonly UserMessage[];\n clear(): void;\n append(target: InboxTarget, message: UserMessage): void;\n prepend(target: InboxTarget, message: UserMessage): void;\n replace(messageId: MessageId, newMessage: UserMessage): boolean;\n remove(messageId: MessageId): boolean;\n splice(target: InboxTarget, start: number, deleteCount: number, inserted: UserMessage[]): UserMessage[];\n}"
454
+ },
455
+ {
456
+ "name": "InboxTarget",
457
+ "declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
458
+ },
459
+ {
460
+ "name": "JobId",
461
+ "declaration": "export type JobId = Branded<'JobId'>;"
462
+ },
463
+ {
464
+ "name": "JobOutcome",
465
+ "declaration": "export interface JobOutcome {\n status: 'completed' | 'killed' | 'failed';\n detail?: string;\n result?: string;\n}"
466
+ },
467
+ {
468
+ "name": "JobRegisteredData",
469
+ "declaration": "export interface JobRegisteredData {\n readonly jobId: JobId;\n readonly owner: SessionId;\n readonly kind: string;\n readonly label: string;\n readonly startedAt: number;\n readonly toolCall?: JobToolCall;\n}"
470
+ },
471
+ {
472
+ "name": "JobSettleCause",
473
+ "declaration": "export type JobSettleCause = 'producer' | 'kill' | 'teardown';"
474
+ },
475
+ {
476
+ "name": "JobSettledData",
477
+ "declaration": "export interface JobSettledData extends JobRegisteredData {\n readonly finishedAt: number;\n readonly status: JobOutcome['status'];\n readonly cause: JobSettleCause;\n readonly producerReported: boolean;\n readonly detail?: string;\n}"
478
+ },
479
+ {
480
+ "name": "JobToolCall",
481
+ "declaration": "export interface JobToolCall {\n readonly callId: SessionEventMap['tool/call']['callId'];\n readonly rootCallId: SessionEventMap['tool/call']['callId'];\n}"
482
+ },
483
+ {
484
+ "name": "JsonSchemaNode",
485
+ "declaration": "export interface JsonSchemaNode {\n type?: JsonSchemaType;\n oneOf?: JsonSchemaNode[];\n properties?: Record<string, JsonSchemaNode>;\n required?: string[];\n additionalProperties?: boolean;\n items?: JsonSchemaNode;\n enum?: JsonSchemaScalar[];\n const?: JsonSchemaScalar;\n description?: string;\n title?: string;\n default?: JsonValue;\n examples?: JsonValue;\n}"
486
+ },
487
+ {
488
+ "name": "JsonSchemaScalar",
489
+ "declaration": "export type JsonSchemaScalar = string | number | boolean | null;"
490
+ },
491
+ {
492
+ "name": "JsonSchemaType",
493
+ "declaration": "export type JsonSchemaType = 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';"
494
+ },
495
+ {
496
+ "name": "JsonValue",
497
+ "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
498
+ },
499
+ {
500
+ "name": "KnownCatalogMode",
501
+ "declaration": "export type KnownCatalogMode = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
502
+ },
503
+ {
504
+ "name": "KnownSubagentCatalogFields",
505
+ "declaration": "export type KnownSubagentCatalogFields = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'external'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
506
+ },
507
+ {
508
+ "name": "LegacyAfterScheduleRecord",
509
+ "declaration": "export interface LegacyAfterScheduleRecord extends Omit<AfterScheduleRecord, 'title'> {\n readonly title?: string;\n}"
510
+ },
511
+ {
512
+ "name": "LegacyAtScheduleRecord",
513
+ "declaration": "export interface LegacyAtScheduleRecord extends Omit<AtScheduleRecord, 'title'> {\n readonly title?: string;\n}"
514
+ },
515
+ {
516
+ "name": "LegacyEveryScheduleRecord",
517
+ "declaration": "export interface LegacyEveryScheduleRecord extends Omit<EveryScheduleRecord, 'title'> {\n readonly title?: string;\n}"
518
+ },
519
+ {
520
+ "name": "LegacyScheduleRecord",
521
+ "declaration": "export type LegacyScheduleRecord = LegacyAfterScheduleRecord | LegacyAtScheduleRecord | LegacyEveryScheduleRecord;"
522
+ },
523
+ {
524
+ "name": "LlmCallConfig",
525
+ "declaration": "export interface LlmCallConfig extends LlmCallControls {\n provider: string;\n model: string;\n}"
526
+ },
527
+ {
528
+ "name": "LlmCallConfigAdapterDefaults",
529
+ "declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
530
+ },
531
+ {
532
+ "name": "LlmCallControls",
533
+ "declaration": "export interface LlmCallControls {\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
534
+ },
535
+ {
536
+ "name": "LlmFailure",
537
+ "declaration": "export interface LlmFailure {\n readonly message: string;\n readonly code: string;\n readonly status?: number;\n readonly providerRetryAfterMs?: number;\n readonly requestId?: ProviderRequestId;\n readonly offloadImages?: number;\n}"
538
+ },
539
+ {
540
+ "name": "LlmRetryEventData",
541
+ "declaration": "export type LlmRetryEventData = { retryId: RetryId; turn: number; step: number; provider: string; mode: 'normal'; policyKey: string; retry: number; maxRetries: number; delayMs: number; failure: LlmFailure; } | { retryId: RetryId; turn: number; step: number; provider: string; mode: 'always'; policyKey: string; retry: number; delayMs: number; failure: LlmFailure; };"
542
+ },
543
+ {
544
+ "name": "LlmRetryStartedEventData",
545
+ "declaration": "export interface LlmRetryStartedEventData {\n retryId: RetryId;\n turn: number;\n step: number;\n retry: number;\n}"
546
+ },
547
+ {
548
+ "name": "Message",
549
+ "declaration": "export type Message = MessageRoleMap[keyof MessageRoleMap];"
550
+ },
551
+ {
552
+ "name": "MessageBase",
553
+ "declaration": "export interface MessageBase {\n readonly id: MessageId;\n readonly content: readonly ContentBlock[];\n readonly source: MessageSource;\n}"
554
+ },
555
+ {
556
+ "name": "MessageFeedbackDelete",
557
+ "declaration": "export interface MessageFeedbackDelete {\n readonly sessionId: SessionId;\n readonly messageId: MessageId;\n}"
558
+ },
559
+ {
560
+ "name": "MessageFeedbackItem",
561
+ "declaration": "export interface MessageFeedbackItem {\n readonly messageId: MessageId;\n readonly rating: MessageFeedbackRating;\n readonly note?: string;\n readonly category?: FeedbackCategory;\n readonly version: MessageFeedbackVersion;\n readonly createdAt: number;\n readonly updatedAt: number;\n}"
562
+ },
563
+ {
564
+ "name": "MessageFeedbackPut",
565
+ "declaration": "export interface MessageFeedbackPut {\n readonly sessionId: SessionId;\n readonly item: MessageFeedbackItem;\n}"
566
+ },
567
+ {
568
+ "name": "MessageFeedbackRating",
569
+ "declaration": "export type MessageFeedbackRating = 'positive' | 'negative';"
570
+ },
571
+ {
572
+ "name": "MessageFeedbackVersion",
573
+ "declaration": "export type MessageFeedbackVersion = Branded<'MessageFeedbackVersion'>;"
574
+ },
575
+ {
576
+ "name": "MessageId",
577
+ "declaration": "export type MessageId = Branded<'MessageId'>;"
578
+ },
579
+ {
580
+ "name": "MessageRoleMap",
581
+ "declaration": "export interface MessageRoleMap {\n system: SystemMessage;\n developer: DeveloperMessage;\n user: UserMessage;\n assistant: AssistantMessage;\n tool: ToolResultMessage;\n}"
582
+ },
583
+ {
584
+ "name": "MessageSource",
585
+ "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
586
+ },
587
+ {
588
+ "name": "MessageSourceMap",
589
+ "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'tool-registry': { kind: 'tool-registry'; };\n 'action-cards': { kind: 'action-cards'; through: SessionSeq; } & ContextFormed;\n 'runtime-context': { kind: 'runtime-context'; } & ContextFormed;\n 'team-message': TeamMessageSource;\n 'working-directory': { kind: 'working-directory'; };\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal; };\n 'skill-invocation': SkillInvocationSource;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'compact-checkpoint': CompactionCheckpointSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n goal: GoalMessageSource;\n 'plan-mode': { kind: 'plan-mode'; } & ContextFormed;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'session-reference': SessionReferenceSource;\n webhook: { readonly kind: 'webhook'; readonly provider: string; readonly source: WebhookSourceId; readonly deliveryId: WebhookDeliveryId; readonly ruleId: WebhookRuleId; readonly form: 'notice'; readonly summary: string; };\n}"
590
+ },
591
+ {
592
+ "name": "Model",
593
+ "declaration": "export interface Model {\n current(): Readonly<ModelSelection> | undefined;\n select(selection: Readonly<ModelSelection>): void;\n}"
594
+ },
595
+ {
596
+ "name": "ModelMessageSource",
597
+ "declaration": "export interface ModelMessageSource extends AssistantProviderMetadata {\n kind: 'model';\n}"
598
+ },
599
+ {
600
+ "name": "ModelSelection",
601
+ "declaration": "export interface ModelSelection {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n}"
602
+ },
603
+ {
604
+ "name": "ObjectJsonSchema",
605
+ "declaration": "export type ObjectJsonSchema = JsonSchemaNode & { type: 'object'; };"
606
+ },
607
+ {
608
+ "name": "OneShotScheduleDispatchChange",
609
+ "declaration": "export interface OneShotScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n}"
610
+ },
611
+ {
612
+ "name": "OneShotSubagentDescriptorData",
613
+ "declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'one-shot';\n readonly label?: string;\n}"
614
+ },
615
+ {
616
+ "name": "OptionalSessionSeq",
617
+ "declaration": "export type OptionalSessionSeq = SessionSeq | null;"
618
+ },
619
+ {
620
+ "name": "Principal",
621
+ "declaration": "export type Principal = PrincipalMap[keyof PrincipalMap];"
622
+ },
623
+ {
624
+ "name": "PrincipalMap",
625
+ "declaration": "export interface PrincipalMap {\n owner: { readonly kind: 'owner'; };\n 'share-viewer': ShareViewerPrincipal;\n}"
626
+ },
627
+ {
628
+ "name": "PromptContentPart",
629
+ "declaration": "export type PromptContentPart = { readonly type: 'text'; readonly text: string; } | { readonly type: 'image'; readonly mediaType: ImageMediaType; readonly data: string; readonly name?: string; };"
630
+ },
631
+ {
632
+ "name": "ProviderRequestId",
633
+ "declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
634
+ },
635
+ {
636
+ "name": "PtcDispatchEventData",
637
+ "declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n meta?: JsonValue;\n error?: { name: string; code: string; reason?: string; };\n}"
638
+ },
639
+ {
640
+ "name": "PtcDispatchStartEventData",
641
+ "declaration": "export interface PtcDispatchStartEventData {\n rootCallId: ToolCallId;\n parentCallId: ToolCallId;\n subCallId: ToolCallId;\n name: string;\n arguments: unknown;\n}"
642
+ },
643
+ {
644
+ "name": "ReasoningBlock",
645
+ "declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
646
+ },
647
+ {
648
+ "name": "ReasoningEffortId",
649
+ "declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
650
+ },
651
+ {
652
+ "name": "ReplayEnvelope",
653
+ "declaration": "export interface ReplayEnvelope {\n response: unknown;\n blocks?: readonly unknown[];\n}"
654
+ },
655
+ {
656
+ "name": "RequestContext",
657
+ "declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n systemPromptUpdate?: SystemPromptUpdate;\n}"
658
+ },
659
+ {
660
+ "name": "RequestHeaderReason",
661
+ "declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change' | 'series';"
662
+ },
663
+ {
664
+ "name": "ResolvedSubagentStartRequest",
665
+ "declaration": "export interface ResolvedSubagentStartRequest extends SubagentStartRequest {\n readonly cwd: string;\n}"
666
+ },
667
+ {
668
+ "name": "RetryId",
669
+ "declaration": "export type RetryId = Branded<'RetryId'>;"
670
+ },
671
+ {
672
+ "name": "SandboxMode",
673
+ "declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
674
+ },
675
+ {
676
+ "name": "ScheduleChange",
677
+ "declaration": "export type ScheduleChange = ScheduleCreateChange | ScheduleDeleteChange | ScheduleDispatchChange;"
678
+ },
679
+ {
680
+ "name": "ScheduleCreateChange",
681
+ "declaration": "export interface ScheduleCreateChange {\n readonly version: 1;\n readonly operation: 'create';\n readonly schedule: LegacyScheduleRecord;\n}"
682
+ },
683
+ {
684
+ "name": "ScheduleDeleteChange",
685
+ "declaration": "export interface ScheduleDeleteChange {\n readonly version: 1;\n readonly operation: 'delete';\n readonly id: ScheduleId;\n}"
686
+ },
687
+ {
688
+ "name": "ScheduleDispatchChange",
689
+ "declaration": "export type ScheduleDispatchChange = OneShotScheduleDispatchChange | EveryScheduleDispatchChange;"
690
+ },
691
+ {
692
+ "name": "ScheduleId",
693
+ "declaration": "export type ScheduleId = Branded<'ScheduleId'>;"
694
+ },
695
+ {
696
+ "name": "Session",
697
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n readonly inheritedEventCount: SessionLogOffset;\n get id(): SessionId;\n readonly firstLiveSeq: SessionLogOffset;\n readonly firstLifecycleSeq: SessionLogOffset;\n eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n toolHistory(): ToolHistory;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
698
+ },
699
+ {
700
+ "name": "SessionEvent",
701
+ "declaration": "export type SessionEvent<T extends SessionEventType = SessionEventType> = { [K in SessionEventType]: { type: K; seq: SessionSeq; time: number; data: SessionEventMap[K]; ignorable?: true; } & (K extends SurfaceEventType ? SurfaceIntent<K> : { surfaceOp?: never; sourceEventSeqs?: never; }) }[T];"
702
+ },
703
+ {
704
+ "name": "SessionEventMap",
705
+ "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'model/selection': ModelSelection;\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'agent-preset/selected': { agentPreset: string; };\n 'team/mode': { enabled: boolean; };\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'working-directory/change': { cwd: string; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'approval/grant': { toolName: string; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; remembered?: true; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'permission/preset': { preset: string; };\n 'subagent/descriptor': SubagentDescriptorData;\n 'subagent/catalog': SubagentCatalogEvent;\n 'job/registered': JobRegisteredData;\n 'job/settled': JobSettledData;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'feedback/record': FeedbackRecord;\n 'llm/retry': LlmRetryEventData;\n 'llm/retry-started': LlmRetryStartedEventData;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'plan/mode': { active: boolean; };\n 'schedule/change': ScheduleChange;\n 'session-log-deepseek/delivery-accepted': { sessionId: import('@deepseek-ai/dsh-session/types').SessionId; sessionFormatVersion?: number; throughSeq: import('@deepseek-ai/dsh-session/types').SessionSeq; };\n 'subagent/model-selection-policy': { allowedModels: AllowedModelRoute[]; };\n 'workspace/changes': { turn: number; };\n}"
706
+ },
707
+ {
708
+ "name": "SessionEventType",
709
+ "declaration": "export type SessionEventType = keyof SessionEventMap;"
710
+ },
711
+ {
712
+ "name": "SessionHeader",
713
+ "declaration": "export interface SessionHeader {\n readonly version: typeof SESSION_FORMAT_VERSION;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded: boolean;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
714
+ },
715
+ {
716
+ "name": "SessionId",
717
+ "declaration": "export type SessionId = Branded<'SessionId'>;"
718
+ },
719
+ {
720
+ "name": "SessionLogOffset",
721
+ "declaration": "export type SessionLogOffset = BrandedNumber<'SessionLogOffset'>;"
722
+ },
723
+ {
724
+ "name": "SessionReferenceSource",
725
+ "declaration": "export interface SessionReferenceSource {\n kind: 'session-reference';\n form: 'recall';\n version: 1;\n references: { sessionId: string; label: string; capturedFormatVersion?: number; capturedThroughSeq: OptionalSessionSeq; compacted: boolean; originalMessages: number; retainedMessages: number; omittedMessages: number; omittedBytes: number; truncated: boolean; inputIndex: number; }[];\n}"
726
+ },
727
+ {
728
+ "name": "SessionRequestId",
729
+ "declaration": "export type SessionRequestId = Branded<'session-request-id'>;"
730
+ },
731
+ {
732
+ "name": "SessionSeq",
733
+ "declaration": "export type SessionSeq = BrandedNumber<'SessionSeq'>;"
734
+ },
735
+ {
736
+ "name": "SessionSurface",
737
+ "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n readonly contentGeneration: number;\n}"
738
+ },
739
+ {
740
+ "name": "SessionTitleEventData",
741
+ "declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: SessionSeq[];\n readonly source: SessionTitleSource;\n}"
742
+ },
743
+ {
744
+ "name": "SessionTitleModelIdentity",
745
+ "declaration": "export interface SessionTitleModelIdentity {\n readonly provider: string;\n readonly model: string;\n}"
746
+ },
747
+ {
748
+ "name": "SessionTitleProviderId",
749
+ "declaration": "export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;"
750
+ },
751
+ {
752
+ "name": "SessionTitleSource",
753
+ "declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelIdentity; } | { readonly kind: 'user'; };"
754
+ },
755
+ {
756
+ "name": "ShareViewerPrincipal",
757
+ "declaration": "export interface ShareViewerPrincipal {\n readonly kind: 'share-viewer';\n readonly shareId: string;\n readonly actor: { readonly providerId: string; readonly tenantId: string; readonly subjectId: string; readonly displayName?: string; };\n}"
758
+ },
759
+ {
760
+ "name": "SkillInvocationSource",
761
+ "declaration": "export interface SkillInvocationSource {\n readonly kind: 'skill-invocation';\n readonly name: string;\n readonly form: 'instructions';\n}"
762
+ },
763
+ {
764
+ "name": "StreamChunk",
765
+ "declaration": "export type StreamChunk = { type: 'block-start'; index: number; blockType: ContentBlockType; } | { type: 'text-delta'; index: number; text: string; } | { type: 'reasoning-delta'; index: number; text: string; } | { type: 'tool-call-delta'; index: number; id: ToolCallId; name?: string; argumentsDelta: string; } | { type: 'block-end'; index: number; block: ContentBlock; } | { type: 'usage'; usage: TokenUsage; } | { type: 'finish'; reason: FinishReason; replayState?: ReplayEnvelope; };"
766
+ },
767
+ {
768
+ "name": "SubagentActivation",
769
+ "declaration": "export interface SubagentActivation {\n readonly childId: SessionId;\n readonly messageId?: MessageId;\n readonly result: Promise<SubagentResult>;\n dispose(): Promise<void>;\n}"
770
+ },
771
+ {
772
+ "name": "SubagentActivationSpec",
773
+ "declaration": "export interface SubagentActivationSpec extends Omit<SubagentStartRequest, 'label' | 'signal'> {\n readonly provider: string;\n readonly label: string;\n readonly childId?: SessionId;\n readonly signal: AbortSignal;\n readonly delivery: 'parent' | 'caller';\n}"
774
+ },
775
+ {
776
+ "name": "SubagentCapabilities",
777
+ "declaration": "export interface SubagentCapabilities {\n readonly agentOptions: boolean;\n readonly agentPreset: boolean;\n readonly outputSchema: boolean;\n readonly depthLimit: boolean;\n}"
778
+ },
779
+ {
780
+ "name": "SubagentCatalogEvent",
781
+ "declaration": "export type SubagentCatalogEvent = { readonly childId: SessionId; readonly childCreatedAt: number; } & (({ readonly version: 0; } & KnownCatalogMode) | ({ readonly version: 1; } & (KnownCatalogMode | { readonly mode: 'unknown'; readonly label?: string; })) | { readonly version: 2; readonly mode: 'external'; readonly label?: string; });"
782
+ },
783
+ {
784
+ "name": "SubagentCatalogRow",
785
+ "declaration": "export type SubagentCatalogRow = { readonly id: SessionId; readonly activity: 'running' | 'inactive'; } & KnownSubagentCatalogFields;"
786
+ },
787
+ {
788
+ "name": "SubagentDelivery",
789
+ "declaration": "export type SubagentDelivery = 'queue' | 'steer';"
790
+ },
791
+ {
792
+ "name": "SubagentDescendantListEntry",
793
+ "declaration": "export type SubagentDescendantListEntry = SubagentListEntry & { readonly parentId: SessionId; readonly depth: number; };"
794
+ },
795
+ {
796
+ "name": "SubagentDescriptorBase",
797
+ "declaration": "export interface SubagentDescriptorBase {\n readonly version: number;\n readonly mode: 'one-shot' | 'continuable';\n readonly provider: string;\n}"
798
+ },
799
+ {
800
+ "name": "SubagentDescriptorData",
801
+ "declaration": "export type SubagentDescriptorData = OneShotSubagentDescriptorData | ContinuableSubagentDescriptorData;"
802
+ },
803
+ {
804
+ "name": "SubagentInterruptAuthority",
805
+ "declaration": "export type SubagentInterruptAuthority = { readonly kind: 'user'; } | { readonly kind: 'ancestor'; readonly agent: Agent; };"
806
+ },
807
+ {
808
+ "name": "SubagentInterruptReceipt",
809
+ "declaration": "export interface SubagentInterruptReceipt {\n readonly accepted: true;\n}"
810
+ },
811
+ {
812
+ "name": "SubagentListEntry",
813
+ "declaration": "export type SubagentListEntry = SubagentCatalogRow & { readonly kind: 'child'; readonly hasChildren: boolean; } | { readonly kind: 'diagnostic'; readonly id: SessionId; readonly reason: 'corrupt' | 'unsupported' | 'unavailable'; };"
814
+ },
815
+ {
816
+ "name": "SubagentPromptReceipt",
817
+ "declaration": "export interface SubagentPromptReceipt {\n readonly messageId: MessageId;\n}"
818
+ },
819
+ {
820
+ "name": "SubagentPromptRequest",
821
+ "declaration": "export interface SubagentPromptRequest {\n readonly requestId: SubagentPromptRequestId;\n readonly childSessionId: SessionId;\n readonly delivery: SubagentDelivery;\n readonly content: readonly PromptContentPart[];\n readonly clientTimeZone?: string;\n}"
822
+ },
823
+ {
824
+ "name": "SubagentPromptRequestId",
825
+ "declaration": "export type SubagentPromptRequestId = Branded<'session-request-id'>;"
826
+ },
827
+ {
828
+ "name": "SubagentProvider",
829
+ "declaration": "export interface SubagentProvider {\n readonly name: string;\n readonly capabilities: SubagentCapabilities;\n readonly inheritsParentContext: boolean;\n readonly agentRouteDefaults?: Readonly<{ provider: string; model: string; }>;\n start?(request: ResolvedSubagentStartRequest): Promise<SubagentRun>;\n prepareContinuable?(request: ContinuableCreateRequest): Promise<ContinuableCreateSpec>;\n}"
830
+ },
831
+ {
832
+ "name": "SubagentResult",
833
+ "declaration": "export interface SubagentResult {\n readonly output: readonly ContentBlock[];\n readonly structured?: unknown;\n readonly diagnostic?: string;\n readonly stopReason: SubagentStopReason;\n}"
834
+ },
835
+ {
836
+ "name": "SubagentRun",
837
+ "declaration": "export interface SubagentRun {\n readonly id: SessionId;\n readonly result: Promise<SubagentResult>;\n dispose(): Promise<void>;\n}"
838
+ },
839
+ {
840
+ "name": "SubagentSendMessageOptions",
841
+ "declaration": "export interface SubagentSendMessageOptions {\n readonly signal: AbortSignal;\n}"
842
+ },
843
+ {
844
+ "name": "SubagentSettledMessageSource",
845
+ "declaration": "export interface SubagentSettledMessageSource {\n readonly kind: 'subagent-settled';\n readonly form: 'notice';\n readonly summary: string;\n readonly stopReason?: SubagentResult['stopReason'];\n readonly senderSessionId: SessionId;\n}"
846
+ },
847
+ {
848
+ "name": "SubagentStartRequest",
849
+ "declaration": "export interface SubagentStartRequest {\n readonly cwd?: string;\n readonly agentPreset?: string;\n readonly label?: string;\n readonly prompt: ContentBlock[];\n readonly parent: Agent;\n readonly signal: AbortSignal;\n readonly agentOptions?: AgentOptions;\n readonly outputSchema?: ObjectJsonSchema;\n readonly maxDepth?: number;\n}"
850
+ },
851
+ {
852
+ "name": "SubagentStopReason",
853
+ "declaration": "export type SubagentStopReason = SubagentStopReasonMap[keyof SubagentStopReasonMap];"
854
+ },
855
+ {
856
+ "name": "SubagentStopReasonMap",
857
+ "declaration": "export interface SubagentStopReasonMap {\n completed: 'completed';\n aborted: 'aborted';\n error: 'error';\n 'max-tokens': 'max-tokens';\n refusal: 'refusal';\n}"
858
+ },
859
+ {
860
+ "name": "SurfaceEventType",
861
+ "declaration": "export type SurfaceEventType = 'system/message' | 'developer/message' | 'user/message' | 'assistant/message' | 'tool/result';"
862
+ },
863
+ {
864
+ "name": "SurfaceIntent",
865
+ "declaration": "export type SurfaceIntent<T extends SurfaceEventType = SurfaceEventType> = { surfaceOp: SurfaceOp; } & (T extends 'assistant/message' ? { sourceEventSeqs?: never; } : { sourceEventSeqs?: SessionSeq[]; });"
866
+ },
867
+ {
868
+ "name": "SurfaceOp",
869
+ "declaration": "export type SurfaceOp = 'append' | { op: 'replace'; startSeq: SessionSeq; endSeq: SessionSeq; };"
870
+ },
871
+ {
872
+ "name": "SystemMessage",
873
+ "declaration": "export interface SystemMessage extends MessageBase {\n readonly role: 'system';\n readonly source: MessageSourceMap['system-prompt'];\n}"
874
+ },
875
+ {
876
+ "name": "SystemPromptMessageSource",
877
+ "declaration": "export interface SystemPromptMessageSource {\n kind: 'system-prompt';\n}"
878
+ },
879
+ {
880
+ "name": "SystemPromptUpdate",
881
+ "declaration": "export type SystemPromptUpdate = 'in-history';"
882
+ },
883
+ {
884
+ "name": "TeamId",
885
+ "declaration": "export type TeamId = Branded<'TeamId'>;"
886
+ },
887
+ {
888
+ "name": "TeamMemberPhase",
889
+ "declaration": "export type TeamMemberPhase = 'provisioning' | 'active' | 'failed';"
890
+ },
891
+ {
892
+ "name": "TeamMemberSnapshot",
893
+ "declaration": "export interface TeamMemberSnapshot {\n readonly id: SessionId;\n readonly name: string;\n readonly description: string;\n readonly provider: string;\n readonly context: 'fresh' | 'fork';\n readonly phase: TeamMemberPhase;\n readonly error?: string;\n}"
894
+ },
895
+ {
896
+ "name": "TeamMessageId",
897
+ "declaration": "export type TeamMessageId = Branded<'TeamMessageId'>;"
898
+ },
899
+ {
900
+ "name": "TeamMessageSnapshot",
901
+ "declaration": "export interface TeamMessageSnapshot {\n readonly id: TeamMessageId;\n readonly senderId: SessionId;\n readonly senderName: string;\n readonly targetId: SessionId;\n readonly content: ContentBlock[];\n}"
902
+ },
903
+ {
904
+ "name": "TeamMessageSource",
905
+ "declaration": "export interface TeamMessageSource {\n readonly kind: 'team-message';\n readonly teamId: TeamId;\n readonly messageId: TeamMessageId;\n readonly senderId: SessionId;\n readonly senderName: string;\n}"
906
+ },
907
+ {
908
+ "name": "TeamTaskId",
909
+ "declaration": "export type TeamTaskId = Branded<'TeamTaskId'>;"
910
+ },
911
+ {
912
+ "name": "TeamTaskSnapshot",
913
+ "declaration": "export interface TeamTaskSnapshot {\n readonly id: TeamTaskId;\n readonly revision: number;\n readonly subject: string;\n readonly description: string;\n readonly status: TeamTaskStatus;\n readonly ownerId?: SessionId;\n readonly blockedBy: TeamTaskId[];\n readonly writeScopes: string[];\n}"
914
+ },
915
+ {
916
+ "name": "TeamTaskStatus",
917
+ "declaration": "export type TeamTaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';"
918
+ },
919
+ {
920
+ "name": "TextBlock",
921
+ "declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
922
+ },
923
+ {
924
+ "name": "TodoItem",
925
+ "declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
926
+ },
927
+ {
928
+ "name": "TokenUsage",
929
+ "declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
930
+ },
931
+ {
932
+ "name": "ToolAdditionBlock",
933
+ "declaration": "export interface ToolAdditionBlock {\n type: 'tool-addition';\n toolName: string;\n tool?: never;\n}"
934
+ },
935
+ {
936
+ "name": "ToolCallBlock",
937
+ "declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: ToolCallId;\n name: string;\n arguments: string;\n}"
938
+ },
939
+ {
940
+ "name": "ToolCallId",
941
+ "declaration": "export type ToolCallId = Branded<'ToolCallId'>;"
942
+ },
943
+ {
944
+ "name": "ToolHistory",
945
+ "declaration": "export interface ToolHistory {\n readonly tools: readonly ToolSchema[];\n readonly updates: readonly { readonly messageId: MessageId; readonly additions: readonly ToolSchema[]; }[];\n}"
946
+ },
947
+ {
948
+ "name": "ToolMessageSource",
949
+ "declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
950
+ },
951
+ {
952
+ "name": "ToolRemovalBlock",
953
+ "declaration": "export interface ToolRemovalBlock {\n type: 'tool-removal';\n toolName: string;\n}"
954
+ },
955
+ {
956
+ "name": "ToolRestriction",
957
+ "declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
958
+ },
959
+ {
960
+ "name": "ToolResultMessage",
961
+ "declaration": "export interface ToolResultMessage extends MessageBase {\n readonly role: 'tool';\n readonly source: ToolMessageSource;\n readonly toolCallId: ToolCallId;\n readonly isError?: boolean;\n}"
962
+ },
963
+ {
964
+ "name": "ToolSchema",
965
+ "declaration": "export interface ToolSchema {\n deferLoading?: true;\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
966
+ },
967
+ {
968
+ "name": "TurnEndCancelCause",
969
+ "declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
970
+ },
971
+ {
972
+ "name": "TurnEndReason",
973
+ "declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
974
+ },
975
+ {
976
+ "name": "TurnEndReasonMap",
977
+ "declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n forked: { kind: 'forked'; };\n}"
978
+ },
979
+ {
980
+ "name": "UserMessage",
981
+ "declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n}"
982
+ },
983
+ {
984
+ "name": "WebhookDeliveryId",
985
+ "declaration": "export type WebhookDeliveryId = Branded<'WebhookDeliveryId'>;"
986
+ },
987
+ {
988
+ "name": "WebhookRuleId",
989
+ "declaration": "export type WebhookRuleId = Branded<'WebhookRuleId'>;"
990
+ },
991
+ {
992
+ "name": "WebhookSourceId",
993
+ "declaration": "export type WebhookSourceId = Branded<'WebhookSourceId'>;"
994
+ }
995
+ ]
996
+ }
997
+ ],
998
+ "events": [
999
+ {
1000
+ "description": "A published child settled. Scope-filtered dispatch uses the same subagent tree-root carrier as `subagent/start`, so the lifecycle pair reaches the same scoped audience.",
1001
+ "summary": "A published child settled.",
1002
+ "tags": [
1003
+ {
1004
+ "name": "param",
1005
+ "argument": "info",
1006
+ "comment": "- run identity, durable direct creator `parentSessionId`, and terminal outcome.",
1007
+ "text": "@param info - run identity, durable direct creator `parentSessionId`, and terminal outcome.\n *"
1008
+ },
1009
+ {
1010
+ "name": "mode",
1011
+ "comment": "emit",
1012
+ "text": "@mode emit"
1013
+ }
1014
+ ],
1015
+ "jsDoc": "/**\n * A published child settled. Scope-filtered dispatch uses the same subagent tree-root\n * carrier as `subagent/start`, so the lifecycle pair reaches the\n * same scoped audience.\n * @param info - run identity, durable direct creator `parentSessionId`, and terminal outcome.\n * @mode emit\n */",
1016
+ "name": "subagent/end",
1017
+ "mode": "emit",
1018
+ "signature": "'subagent/end'(this: Scoped<SubagentRuntime>, info: SubagentRunEndInfo): void"
1019
+ },
1020
+ {
1021
+ "description": "A provider became resolvable in the registry.",
1022
+ "summary": "A provider became resolvable in the registry.",
1023
+ "tags": [
1024
+ {
1025
+ "name": "param",
1026
+ "argument": "provider",
1027
+ "comment": "- the registered provider.",
1028
+ "text": "@param provider - the registered provider.\n *"
1029
+ },
1030
+ {
1031
+ "name": "mode",
1032
+ "comment": "emit",
1033
+ "text": "@mode emit"
1034
+ }
1035
+ ],
1036
+ "jsDoc": "/**\n * A provider became resolvable in the registry.\n * @param provider - the registered provider.\n * @mode emit\n */",
1037
+ "name": "subagent/provider-added",
1038
+ "mode": "emit",
1039
+ "signature": "'subagent/provider-added'(provider: SubagentProvider): void"
1040
+ },
1041
+ {
1042
+ "description": "A provider left the registry. Accepted runs remain holder-owned.",
1043
+ "summary": "A provider left the registry.",
1044
+ "tags": [
1045
+ {
1046
+ "name": "param",
1047
+ "argument": "name",
1048
+ "comment": "- the provider name that no longer resolves.",
1049
+ "text": "@param name - the provider name that no longer resolves.\n *"
1050
+ },
1051
+ {
1052
+ "name": "mode",
1053
+ "comment": "emit",
1054
+ "text": "@mode emit"
1055
+ }
1056
+ ],
1057
+ "jsDoc": "/**\n * A provider left the registry. Accepted runs remain holder-owned.\n * @param name - the provider name that no longer resolves.\n * @mode emit\n */",
1058
+ "name": "subagent/provider-removed",
1059
+ "mode": "emit",
1060
+ "signature": "'subagent/provider-removed'(name: string): void"
1061
+ },
1062
+ {
1063
+ "description": "A provider established a published child. For in-process providers, `ctx.agents.get(info.id)` resolves during this notification. Scope-filtered dispatch keys the carrier by the subagent tree root, so a root-scoped listener observes all subagent tree activations. Paired with `subagent/end`.",
1064
+ "summary": "A provider established a published child.",
1065
+ "tags": [
1066
+ {
1067
+ "name": "param",
1068
+ "argument": "info",
1069
+ "comment": "- provider, child identity, and durable direct creator `parentSessionId`.",
1070
+ "text": "@param info - provider, child identity, and durable direct creator `parentSessionId`.\n *"
1071
+ },
1072
+ {
1073
+ "name": "mode",
1074
+ "comment": "emit",
1075
+ "text": "@mode emit"
1076
+ }
1077
+ ],
1078
+ "jsDoc": "/**\n * A provider established a published child. For in-process providers,\n * `ctx.agents.get(info.id)` resolves during this notification.\n * Scope-filtered dispatch keys the carrier by the subagent tree root, so a\n * root-scoped listener observes all subagent tree activations. Paired with\n * `subagent/end`.\n * @param info - provider, child identity, and durable direct creator `parentSessionId`.\n * @mode emit\n */",
1079
+ "name": "subagent/start",
1080
+ "mode": "emit",
1081
+ "signature": "'subagent/start'(this: Scoped<SubagentRuntime>, info: SubagentRunInfo): void"
1082
+ }
1083
+ ],
1084
+ "objects": []
1085
+ },
1086
+ }