@deepseek-ai/dsh-action-cards 0.0.0-stage → 0.2.2-alpha.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.
@@ -0,0 +1,873 @@
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_action_cards_actionCards_act_parameter_0$schema$value
7
+ const _deepseek_ai_dsh_action_cards_actionCards_act_parameter_0$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_parameter_0$schema$value ??= z.string())
8
+ let _deepseek_ai_dsh_action_cards_actionCards_act_parameter_1$schema$value
9
+ const _deepseek_ai_dsh_action_cards_actionCards_act_parameter_1$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_parameter_1$schema$value ??= z.string())
10
+ let _deepseek_ai_dsh_action_cards_actionCards_act_parameter_2$schema$value
11
+ const _deepseek_ai_dsh_action_cards_actionCards_act_parameter_2$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_parameter_2$schema$value ??= z.string())
12
+ let _deepseek_ai_dsh_action_cards_actionCards_act_parameter_3$schema$value
13
+ const _deepseek_ai_dsh_action_cards_actionCards_act_parameter_3$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_parameter_3$schema$value ??= z.union([z.undefined(), z.record(z.string(), z.json())]))
14
+ let _deepseek_ai_dsh_action_cards_actionCards_act_result$schema$value
15
+ const _deepseek_ai_dsh_action_cards_actionCards_act_result$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_result$schema$value ??= z.union([z.object({
16
+ 'status': z.literal("accepted").readonly(),
17
+ }), z.object({
18
+ 'status': z.literal("settled").readonly(),
19
+ 'decision': z.object({
20
+ 'callId': z.string().readonly(),
21
+ 'action': z.string().readonly(),
22
+ 'phase': z.string().readonly(),
23
+ 'data': z.union([z.undefined(), z.record(z.string(), z.json()).readonly()]).readonly().optional().describe('Kind-defined fields such as a chosen location or a created package.'),
24
+ }).readonly(),
25
+ }), z.object({
26
+ 'status': z.literal("refused").readonly(),
27
+ 'reason': z.string().readonly(),
28
+ }), z.object({
29
+ 'status': z.literal("unconfirmed").readonly(),
30
+ 'reason': z.string().readonly(),
31
+ })]))
32
+ let _deepseek_ai_dsh_action_cards_actionCards_act_parameter_0_strict$schema$value
33
+ const _deepseek_ai_dsh_action_cards_actionCards_act_parameter_0_strict$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_parameter_0_strict$schema$value ??= z.string())
34
+ let _deepseek_ai_dsh_action_cards_actionCards_act_parameter_1_strict$schema$value
35
+ const _deepseek_ai_dsh_action_cards_actionCards_act_parameter_1_strict$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_parameter_1_strict$schema$value ??= z.string())
36
+ let _deepseek_ai_dsh_action_cards_actionCards_act_parameter_2_strict$schema$value
37
+ const _deepseek_ai_dsh_action_cards_actionCards_act_parameter_2_strict$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_parameter_2_strict$schema$value ??= z.string())
38
+ let _deepseek_ai_dsh_action_cards_actionCards_act_parameter_3_strict$schema$value
39
+ const _deepseek_ai_dsh_action_cards_actionCards_act_parameter_3_strict$schema = () => (_deepseek_ai_dsh_action_cards_actionCards_act_parameter_3_strict$schema$value ??= z.union([z.undefined(), z.record(z.string(), z.json())]))
40
+
41
+ const $remote = createTypertRemoteInfo({
42
+ package: '@deepseek-ai/dsh-action-cards',
43
+ methods: {
44
+ 'actionCards/act': {
45
+ service: 'actionCards',
46
+ description: 'Apply a user action to a logged card. Shared checks run first, then the kind reconciles the card; `dismiss` is recorded here and every other verb goes to the card\'s kind. `dismiss` also works on an unstarted card whose kind is no longer registered. Concurrent actions on one card share one operation.',
47
+ invocation: { kind: 'direct' },
48
+ scope: {
49
+ context: 'agent',
50
+ wire: 'agentId',
51
+ },
52
+ parameters: [
53
+ {
54
+ name: 'agent',
55
+ wire: 'agentId',
56
+ description: 'live root resolved from the displayed Session.',
57
+ source: 'lookup',
58
+ lookup: 'agent',
59
+ codec: {
60
+ mode: 'strict',
61
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
62
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_parameter_0$schema,
63
+ jsonSchema: {"type":"string"},
64
+ },
65
+ strictCodec: {
66
+ mode: 'strict',
67
+ typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
68
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_parameter_0_strict$schema,
69
+ jsonSchema: {"type":"string"},
70
+ },
71
+ },
72
+ {
73
+ name: 'callId',
74
+ description: 'the card\'s `propose_action` call id.',
75
+ source: 'json',
76
+ codec: {
77
+ mode: 'strict',
78
+ typeSymbol: '@deepseek-ai/dsh-llm/brand#ToolCallId',
79
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_parameter_1$schema,
80
+ jsonSchema: {"type":"string"},
81
+ },
82
+ strictCodec: {
83
+ mode: 'strict',
84
+ typeSymbol: '@deepseek-ai/dsh-llm/brand#ToolCallId',
85
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_parameter_1_strict$schema,
86
+ jsonSchema: {"type":"string"},
87
+ },
88
+ },
89
+ {
90
+ name: 'verb',
91
+ description: '`dismiss` or one of the kind\'s verbs.',
92
+ source: 'json',
93
+ codec: {
94
+ mode: 'strict',
95
+ typeSymbol: '@deepseek-ai/dsh-action-cards#actionCards/act:verb',
96
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_parameter_2$schema,
97
+ jsonSchema: {"type":"string"},
98
+ },
99
+ strictCodec: {
100
+ mode: 'strict',
101
+ typeSymbol: '@deepseek-ai/dsh-action-cards#actionCards/act:verb',
102
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_parameter_2_strict$schema,
103
+ jsonSchema: {"type":"string"},
104
+ },
105
+ },
106
+ {
107
+ name: 'payload',
108
+ description: 'kind-defined fields such as a chosen location.',
109
+ source: 'json',
110
+ acceptsUndefined: true,
111
+ codec: {
112
+ mode: 'strict',
113
+ typeSymbol: '@deepseek-ai/dsh-action-cards#actionCards/act:payload',
114
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_parameter_3$schema,
115
+ jsonSchema: {"type":"object","properties":{},"required":[],"additionalProperties":true},
116
+ },
117
+ strictCodec: {
118
+ mode: 'strict',
119
+ typeSymbol: '@deepseek-ai/dsh-action-cards#actionCards/act:payload',
120
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_parameter_3_strict$schema,
121
+ jsonSchema: {"type":"object","properties":{},"required":[],"additionalProperties":true},
122
+ },
123
+ },
124
+ ],
125
+ result: {
126
+ mode: 'strict',
127
+ typeSymbol: '@deepseek-ai/dsh-action-cards/types#ActionCardResult',
128
+ create: _deepseek_ai_dsh_action_cards_actionCards_act_result$schema,
129
+ description: 'acceptance of background work, the decision in effect, or a refusal.',
130
+ jsonSchema: {"oneOf":[{"type":"object","properties":{"status":{"type":"string","const":"accepted"}},"required":["status"],"additionalProperties":true},{"type":"object","properties":{"status":{"type":"string","const":"settled"},"decision":{"type":"object","properties":{"callId":{"type":"string"},"action":{"type":"string"},"phase":{"type":"string"},"data":{"type":"object","properties":{},"required":[],"additionalProperties":true,"description":"Kind-defined fields such as a chosen location or a created package."}},"required":["callId","action","phase"],"additionalProperties":true}},"required":["status","decision"],"additionalProperties":true},{"type":"object","properties":{"status":{"type":"string","const":"refused"},"reason":{"type":"string"}},"required":["status","reason"],"additionalProperties":true},{"type":"object","properties":{"status":{"type":"string","const":"unconfirmed"},"reason":{"type":"string"}},"required":["status","reason"],"additionalProperties":true}]},
131
+ },
132
+ sourceLocation: {"file":"packages/experimental/action-cards/src/index.ts","line":338,"column":3},
133
+ },
134
+ },
135
+ }, z)
136
+
137
+ export const TYPERT = {
138
+ package: '@deepseek-ai/dsh-action-cards',
139
+ face: 'host',
140
+ schemas: [
141
+ ],
142
+ get invocations() { return $remote.descriptors },
143
+ model: {
144
+ "services": [
145
+ {
146
+ "description": "Card tool, kind registry, Session projection, user actions and status notices.",
147
+ "summary": "Card tool, kind registry, Session projection, user actions and status notices.",
148
+ "tags": [],
149
+ "jsDoc": "/** Card tool, kind registry, Session projection, user actions and status notices. */",
150
+ "key": "actionCards",
151
+ "exportName": "ActionCards",
152
+ "members": [
153
+ {
154
+ "kind": "method",
155
+ "name": "register",
156
+ "signature": "register<Details>(kind: ActionCardKind<Details>): () => void",
157
+ "summary": "Register one action kind for the caller's lifetime.",
158
+ "jsDoc": "/**\n * Register one action kind for the caller's lifetime.\n * @param kind - the kind's skill, details schema, verbs and handler.\n * @returns disposer removing the kind; actions on its cards are then unavailable.\n * @throws when another kind already registered the same action.\n */"
159
+ },
160
+ {
161
+ "kind": "method",
162
+ "name": "record",
163
+ "signature": "record(agent: Agent, decision: ActionCardDecision): void",
164
+ "summary": "Record a card decision in the Session log; the next model request reports it.",
165
+ "jsDoc": "/**\n * Record a card decision in the Session log; the next model request reports it.\n * @param agent - agent whose Session owns the card.\n * @param decision - the card's new state.\n * @throws when no kind ever registered the decision's action with this service, or its phase is one the projection derives.\n */"
166
+ },
167
+ {
168
+ "kind": "method",
169
+ "name": "view",
170
+ "signature": "view(session: Session): ActionCardView",
171
+ "summary": "Read the cards of one Session.",
172
+ "jsDoc": "/**\n * Read the cards of one Session.\n * @param session - a Session whose projections are prepared.\n * @returns proposals and decisions by call id.\n */"
173
+ },
174
+ {
175
+ "kind": "method",
176
+ "name": "act",
177
+ "signature": "@Remote act(agent: Agent, callId: ToolCallId, verb: string, payload?: Record<string, JsonValue>): Promise<ActionCardResult>",
178
+ "summary": "Apply a user action to a logged card.",
179
+ "jsDoc": "/**\n * Apply a user action to a logged card. Shared checks run first, then the kind reconciles the card; `dismiss` is\n * recorded here and every other verb goes to the card's kind. `dismiss` also works on an unstarted card whose kind\n * is no longer registered. Concurrent actions on one card share one operation.\n * @param agent - live root resolved from the displayed Session.\n * @param callId - the card's `propose_action` call id.\n * @param verb - `dismiss` or one of the kind's verbs.\n * @param payload - kind-defined fields such as a chosen location.\n * @returns acceptance of background work, the decision in effect, or a refusal.\n */"
180
+ }
181
+ ],
182
+ "types": [
183
+ {
184
+ "name": "ActionCardDecision",
185
+ "declaration": "export interface ActionCardDecision {\n readonly callId: ToolCallId;\n readonly action: string;\n readonly phase: string;\n readonly data?: ActionCardFields | undefined;\n}"
186
+ },
187
+ {
188
+ "name": "ActionCardFields",
189
+ "declaration": "export type ActionCardFields = Readonly<Record<string, JsonValue>>;"
190
+ },
191
+ {
192
+ "name": "ActionCardKind",
193
+ "declaration": "export interface ActionCardKind<Details> {\n readonly action: string;\n readonly skill: string;\n readonly invitation: string;\n readonly details: ZodType<Details>;\n readonly verbs: Readonly<Record<string, ActionCardVerb>>;\n readonly openPhases?: readonly string[];\n readonly statusGuidance?: string;\n readonly statusFields?: readonly string[];\n dismissal?(proposal: ActionCardProposalOf<Details>, payload: ActionCardFields | undefined): ActionCardFields | undefined;\n reconcile?(agent: Agent, proposal: ActionCardProposalOf<Details>): Promise<void>;\n act(agent: Agent, proposal: ActionCardProposalOf<Details>, verb: string, payload: ActionCardFields | undefined): Promise<ActionCardResult>;\n}"
194
+ },
195
+ {
196
+ "name": "ActionCardProposal",
197
+ "declaration": "export interface ActionCardProposal {\n readonly callId: ToolCallId;\n readonly turn: number;\n readonly action: string;\n readonly title: string;\n readonly brief: string;\n readonly details: ActionCardFields;\n}"
198
+ },
199
+ {
200
+ "name": "ActionCardProposalOf",
201
+ "declaration": "export type ActionCardProposalOf<Details> = Omit<ActionCardProposal, 'details'> & { readonly details: Details; };"
202
+ },
203
+ {
204
+ "name": "ActionCardResult",
205
+ "declaration": "export type ActionCardResult = { readonly status: 'accepted'; } | { readonly status: 'settled'; readonly decision: ActionCardDecision; } | { readonly status: 'refused'; readonly reason: string; } | { readonly status: 'unconfirmed'; readonly reason: string; };"
206
+ },
207
+ {
208
+ "name": "ActionCardVerb",
209
+ "declaration": "export interface ActionCardVerb {\n readonly global?: true;\n readonly writes?: true;\n}"
210
+ },
211
+ {
212
+ "name": "ActionCardView",
213
+ "declaration": "export interface ActionCardView {\n readonly proposals: Readonly<Record<string, ActionCardProposal>>;\n readonly decisions: Readonly<Record<string, ActionCardDecision>>;\n}"
214
+ },
215
+ {
216
+ "name": "AfterScheduleRecord",
217
+ "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}"
218
+ },
219
+ {
220
+ "name": "Agent",
221
+ "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}"
222
+ },
223
+ {
224
+ "name": "AgentCancelCause",
225
+ "declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
226
+ },
227
+ {
228
+ "name": "AgentMessageSource",
229
+ "declaration": "export interface AgentMessageSource {\n readonly kind: 'agent-message';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
230
+ },
231
+ {
232
+ "name": "AgentOptions",
233
+ "declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId | undefined;\n maxTokens?: number;\n subagentDepth?: number;\n}"
234
+ },
235
+ {
236
+ "name": "AgentStatus",
237
+ "declaration": "export type AgentStatus = 'idle' | 'running';"
238
+ },
239
+ {
240
+ "name": "AllowedModelRoute",
241
+ "declaration": "export interface AllowedModelRoute {\n readonly provider: string;\n readonly model: string;\n}"
242
+ },
243
+ {
244
+ "name": "ApprovalOutcome",
245
+ "declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
246
+ },
247
+ {
248
+ "name": "ApprovalPolicy",
249
+ "declaration": "export type ApprovalPolicy = 'ask' | 'never';"
250
+ },
251
+ {
252
+ "name": "ApprovalRequestId",
253
+ "declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
254
+ },
255
+ {
256
+ "name": "AssistantMessage",
257
+ "declaration": "export interface AssistantMessage extends MessageBase {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
258
+ },
259
+ {
260
+ "name": "AssistantProviderMetadata",
261
+ "declaration": "export interface AssistantProviderMetadata {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
262
+ },
263
+ {
264
+ "name": "AssistantStreamRecord",
265
+ "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; };"
266
+ },
267
+ {
268
+ "name": "AtScheduleRecord",
269
+ "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}"
270
+ },
271
+ {
272
+ "name": "AttachmentId",
273
+ "declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
274
+ },
275
+ {
276
+ "name": "Branded",
277
+ "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
278
+ },
279
+ {
280
+ "name": "BrandedNumber",
281
+ "declaration": "export type BrandedNumber<B extends string> = number & { readonly [BRAND]: B; };"
282
+ },
283
+ {
284
+ "name": "CancelOptions",
285
+ "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
286
+ },
287
+ {
288
+ "name": "CommandId",
289
+ "declaration": "export type CommandId = Branded<'CommandId'>;"
290
+ },
291
+ {
292
+ "name": "CommandSource",
293
+ "declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
294
+ },
295
+ {
296
+ "name": "CommandSourceMap",
297
+ "declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
298
+ },
299
+ {
300
+ "name": "CompactionCheckpointSource",
301
+ "declaration": "export type CompactionCheckpointSource = typeof COMPACT_CHECKPOINT_MARKER & { readonly compactionId: CompactionId; readonly sourceCommandId?: CommandId; };"
302
+ },
303
+ {
304
+ "name": "CompactionId",
305
+ "declaration": "export type CompactionId = Branded<'CompactionId'>;"
306
+ },
307
+ {
308
+ "name": "ContentBlock",
309
+ "declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
310
+ },
311
+ {
312
+ "name": "ContentBlockMap",
313
+ "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}"
314
+ },
315
+ {
316
+ "name": "ContentBlockType",
317
+ "declaration": "export type ContentBlockType = keyof ContentBlockMap;"
318
+ },
319
+ {
320
+ "name": "ContextFormed",
321
+ "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'; };"
322
+ },
323
+ {
324
+ "name": "ContextSnapshotSection",
325
+ "declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
326
+ },
327
+ {
328
+ "name": "ContinuableSubagentDescriptorData",
329
+ "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}"
330
+ },
331
+ {
332
+ "name": "DeveloperMessage",
333
+ "declaration": "export interface DeveloperMessage extends MessageBase {\n readonly role: 'developer';\n}"
334
+ },
335
+ {
336
+ "name": "EpochHeader",
337
+ "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
338
+ },
339
+ {
340
+ "name": "EveryScheduleDispatchChange",
341
+ "declaration": "export interface EveryScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n readonly acceptedAt: string;\n}"
342
+ },
343
+ {
344
+ "name": "EveryScheduleRecord",
345
+ "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}"
346
+ },
347
+ {
348
+ "name": "FeedbackCategory",
349
+ "declaration": "export type FeedbackCategory = 'task-result' | 'instruction-following' | 'product-interaction' | 'service-stability' | 'resource-cost' | 'security-privacy-permission' | 'other';"
350
+ },
351
+ {
352
+ "name": "FeedbackRecord",
353
+ "declaration": "export interface FeedbackRecord {\n readonly text?: string;\n readonly category?: FeedbackCategory;\n}"
354
+ },
355
+ {
356
+ "name": "FileAttachmentRef",
357
+ "declaration": "export interface FileAttachmentRef {\n attachmentId: AttachmentId;\n name: string;\n bytes: number;\n}"
358
+ },
359
+ {
360
+ "name": "FileBlock",
361
+ "declaration": "export interface FileBlock {\n type: 'file';\n attachment: FileAttachmentRef;\n}"
362
+ },
363
+ {
364
+ "name": "FinishReason",
365
+ "declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
366
+ },
367
+ {
368
+ "name": "FinishReasonMap",
369
+ "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}"
370
+ },
371
+ {
372
+ "name": "GoalBlockReason",
373
+ "declaration": "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
374
+ },
375
+ {
376
+ "name": "GoalChangeMeta",
377
+ "declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
378
+ },
379
+ {
380
+ "name": "GoalClearChangeMeta",
381
+ "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}"
382
+ },
383
+ {
384
+ "name": "GoalId",
385
+ "declaration": "export type GoalId = Branded<'GoalId'>;"
386
+ },
387
+ {
388
+ "name": "GoalMessageSource",
389
+ "declaration": "export interface GoalMessageSource {\n readonly kind: 'goal';\n readonly goalId: GoalId;\n readonly revision: number;\n readonly round: number;\n}"
390
+ },
391
+ {
392
+ "name": "GoalOperation",
393
+ "declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
394
+ },
395
+ {
396
+ "name": "GoalPhase",
397
+ "declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
398
+ },
399
+ {
400
+ "name": "GoalRef",
401
+ "declaration": "export interface GoalRef {\n readonly id: GoalId;\n readonly revision: number;\n}"
402
+ },
403
+ {
404
+ "name": "GoalSnapshot",
405
+ "declaration": "export interface GoalSnapshot extends GoalRef {\n readonly objective: string;\n readonly phase: GoalPhase;\n readonly blockedReason?: GoalBlockReason;\n readonly maxGoalRounds: number;\n}"
406
+ },
407
+ {
408
+ "name": "GoalSnapshotChangeMeta",
409
+ "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}"
410
+ },
411
+ {
412
+ "name": "ImageAttachmentRef",
413
+ "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}"
414
+ },
415
+ {
416
+ "name": "ImageBlock",
417
+ "declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n offloaded?: true;\n}"
418
+ },
419
+ {
420
+ "name": "ImageMediaType",
421
+ "declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
422
+ },
423
+ {
424
+ "name": "ImageOffloadTarget",
425
+ "declaration": "export interface ImageOffloadTarget {\n seq: SessionSeq;\n imageIndexes: number[];\n}"
426
+ },
427
+ {
428
+ "name": "Inbox",
429
+ "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}"
430
+ },
431
+ {
432
+ "name": "InboxTarget",
433
+ "declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
434
+ },
435
+ {
436
+ "name": "JobId",
437
+ "declaration": "export type JobId = Branded<'JobId'>;"
438
+ },
439
+ {
440
+ "name": "JobOutcome",
441
+ "declaration": "export interface JobOutcome {\n status: 'completed' | 'killed' | 'failed';\n detail?: string;\n result?: string;\n}"
442
+ },
443
+ {
444
+ "name": "JobRegisteredData",
445
+ "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}"
446
+ },
447
+ {
448
+ "name": "JobSettleCause",
449
+ "declaration": "export type JobSettleCause = 'producer' | 'kill' | 'teardown';"
450
+ },
451
+ {
452
+ "name": "JobSettledData",
453
+ "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}"
454
+ },
455
+ {
456
+ "name": "JobToolCall",
457
+ "declaration": "export interface JobToolCall {\n readonly callId: SessionEventMap['tool/call']['callId'];\n readonly rootCallId: SessionEventMap['tool/call']['callId'];\n}"
458
+ },
459
+ {
460
+ "name": "JsonValue",
461
+ "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
462
+ },
463
+ {
464
+ "name": "KnownCatalogMode",
465
+ "declaration": "export type KnownCatalogMode = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
466
+ },
467
+ {
468
+ "name": "LegacyAfterScheduleRecord",
469
+ "declaration": "export interface LegacyAfterScheduleRecord extends Omit<AfterScheduleRecord, 'title'> {\n readonly title?: string;\n}"
470
+ },
471
+ {
472
+ "name": "LegacyAtScheduleRecord",
473
+ "declaration": "export interface LegacyAtScheduleRecord extends Omit<AtScheduleRecord, 'title'> {\n readonly title?: string;\n}"
474
+ },
475
+ {
476
+ "name": "LegacyEveryScheduleRecord",
477
+ "declaration": "export interface LegacyEveryScheduleRecord extends Omit<EveryScheduleRecord, 'title'> {\n readonly title?: string;\n}"
478
+ },
479
+ {
480
+ "name": "LegacyScheduleRecord",
481
+ "declaration": "export type LegacyScheduleRecord = LegacyAfterScheduleRecord | LegacyAtScheduleRecord | LegacyEveryScheduleRecord;"
482
+ },
483
+ {
484
+ "name": "LlmCallConfig",
485
+ "declaration": "export interface LlmCallConfig extends LlmCallControls {\n provider: string;\n model: string;\n}"
486
+ },
487
+ {
488
+ "name": "LlmCallConfigAdapterDefaults",
489
+ "declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
490
+ },
491
+ {
492
+ "name": "LlmCallControls",
493
+ "declaration": "export interface LlmCallControls {\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
494
+ },
495
+ {
496
+ "name": "LlmFailure",
497
+ "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}"
498
+ },
499
+ {
500
+ "name": "LlmRetryEventData",
501
+ "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; };"
502
+ },
503
+ {
504
+ "name": "LlmRetryStartedEventData",
505
+ "declaration": "export interface LlmRetryStartedEventData {\n retryId: RetryId;\n turn: number;\n step: number;\n retry: number;\n}"
506
+ },
507
+ {
508
+ "name": "Message",
509
+ "declaration": "export type Message = MessageRoleMap[keyof MessageRoleMap];"
510
+ },
511
+ {
512
+ "name": "MessageBase",
513
+ "declaration": "export interface MessageBase {\n readonly id: MessageId;\n readonly content: readonly ContentBlock[];\n readonly source: MessageSource;\n}"
514
+ },
515
+ {
516
+ "name": "MessageFeedbackDelete",
517
+ "declaration": "export interface MessageFeedbackDelete {\n readonly sessionId: SessionId;\n readonly messageId: MessageId;\n}"
518
+ },
519
+ {
520
+ "name": "MessageFeedbackItem",
521
+ "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}"
522
+ },
523
+ {
524
+ "name": "MessageFeedbackPut",
525
+ "declaration": "export interface MessageFeedbackPut {\n readonly sessionId: SessionId;\n readonly item: MessageFeedbackItem;\n}"
526
+ },
527
+ {
528
+ "name": "MessageFeedbackRating",
529
+ "declaration": "export type MessageFeedbackRating = 'positive' | 'negative';"
530
+ },
531
+ {
532
+ "name": "MessageFeedbackVersion",
533
+ "declaration": "export type MessageFeedbackVersion = Branded<'MessageFeedbackVersion'>;"
534
+ },
535
+ {
536
+ "name": "MessageId",
537
+ "declaration": "export type MessageId = Branded<'MessageId'>;"
538
+ },
539
+ {
540
+ "name": "MessageRoleMap",
541
+ "declaration": "export interface MessageRoleMap {\n system: SystemMessage;\n developer: DeveloperMessage;\n user: UserMessage;\n assistant: AssistantMessage;\n tool: ToolResultMessage;\n}"
542
+ },
543
+ {
544
+ "name": "MessageSource",
545
+ "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
546
+ },
547
+ {
548
+ "name": "MessageSourceMap",
549
+ "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 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal; };\n 'working-directory': { kind: 'working-directory'; };\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\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 'team-message': TeamMessageSource;\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}"
550
+ },
551
+ {
552
+ "name": "Model",
553
+ "declaration": "export interface Model {\n current(): Readonly<ModelSelection> | undefined;\n select(selection: Readonly<ModelSelection>): void;\n}"
554
+ },
555
+ {
556
+ "name": "ModelMessageSource",
557
+ "declaration": "export interface ModelMessageSource extends AssistantProviderMetadata {\n kind: 'model';\n}"
558
+ },
559
+ {
560
+ "name": "ModelSelection",
561
+ "declaration": "export interface ModelSelection {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n}"
562
+ },
563
+ {
564
+ "name": "OneShotScheduleDispatchChange",
565
+ "declaration": "export interface OneShotScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n}"
566
+ },
567
+ {
568
+ "name": "OneShotSubagentDescriptorData",
569
+ "declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'one-shot';\n readonly label?: string;\n}"
570
+ },
571
+ {
572
+ "name": "OptionalSessionSeq",
573
+ "declaration": "export type OptionalSessionSeq = SessionSeq | null;"
574
+ },
575
+ {
576
+ "name": "Principal",
577
+ "declaration": "export type Principal = PrincipalMap[keyof PrincipalMap];"
578
+ },
579
+ {
580
+ "name": "PrincipalMap",
581
+ "declaration": "export interface PrincipalMap {\n owner: { readonly kind: 'owner'; };\n 'share-viewer': ShareViewerPrincipal;\n}"
582
+ },
583
+ {
584
+ "name": "ProviderRequestId",
585
+ "declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
586
+ },
587
+ {
588
+ "name": "PtcDispatchEventData",
589
+ "declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n meta?: JsonValue;\n error?: { name: string; code: string; reason?: string; };\n}"
590
+ },
591
+ {
592
+ "name": "PtcDispatchStartEventData",
593
+ "declaration": "export interface PtcDispatchStartEventData {\n rootCallId: ToolCallId;\n parentCallId: ToolCallId;\n subCallId: ToolCallId;\n name: string;\n arguments: unknown;\n}"
594
+ },
595
+ {
596
+ "name": "ReasoningBlock",
597
+ "declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
598
+ },
599
+ {
600
+ "name": "ReasoningEffortId",
601
+ "declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
602
+ },
603
+ {
604
+ "name": "ReplayEnvelope",
605
+ "declaration": "export interface ReplayEnvelope {\n response: unknown;\n blocks?: readonly unknown[];\n}"
606
+ },
607
+ {
608
+ "name": "RequestContext",
609
+ "declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n systemPromptUpdate?: SystemPromptUpdate;\n}"
610
+ },
611
+ {
612
+ "name": "RequestHeaderReason",
613
+ "declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change' | 'series';"
614
+ },
615
+ {
616
+ "name": "RetryId",
617
+ "declaration": "export type RetryId = Branded<'RetryId'>;"
618
+ },
619
+ {
620
+ "name": "SandboxMode",
621
+ "declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
622
+ },
623
+ {
624
+ "name": "ScheduleChange",
625
+ "declaration": "export type ScheduleChange = ScheduleCreateChange | ScheduleDeleteChange | ScheduleDispatchChange;"
626
+ },
627
+ {
628
+ "name": "ScheduleCreateChange",
629
+ "declaration": "export interface ScheduleCreateChange {\n readonly version: 1;\n readonly operation: 'create';\n readonly schedule: LegacyScheduleRecord;\n}"
630
+ },
631
+ {
632
+ "name": "ScheduleDeleteChange",
633
+ "declaration": "export interface ScheduleDeleteChange {\n readonly version: 1;\n readonly operation: 'delete';\n readonly id: ScheduleId;\n}"
634
+ },
635
+ {
636
+ "name": "ScheduleDispatchChange",
637
+ "declaration": "export type ScheduleDispatchChange = OneShotScheduleDispatchChange | EveryScheduleDispatchChange;"
638
+ },
639
+ {
640
+ "name": "ScheduleId",
641
+ "declaration": "export type ScheduleId = Branded<'ScheduleId'>;"
642
+ },
643
+ {
644
+ "name": "Session",
645
+ "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}"
646
+ },
647
+ {
648
+ "name": "SessionEvent",
649
+ "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];"
650
+ },
651
+ {
652
+ "name": "SessionEventMap",
653
+ "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 'job/registered': JobRegisteredData;\n 'job/settled': JobSettledData;\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 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'working-directory/change': { cwd: string; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'permission/preset': { preset: string; };\n 'subagent/descriptor': SubagentDescriptorData;\n 'subagent/catalog': SubagentCatalogEvent;\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 '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 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'plan/mode': { active: boolean; };\n 'schedule/change': ScheduleChange;\n 'subagent/model-selection-policy': { allowedModels: AllowedModelRoute[]; };\n 'workspace/changes': { turn: number; };\n}"
654
+ },
655
+ {
656
+ "name": "SessionEventType",
657
+ "declaration": "export type SessionEventType = keyof SessionEventMap;"
658
+ },
659
+ {
660
+ "name": "SessionHeader",
661
+ "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}"
662
+ },
663
+ {
664
+ "name": "SessionId",
665
+ "declaration": "export type SessionId = Branded<'SessionId'>;"
666
+ },
667
+ {
668
+ "name": "SessionLogOffset",
669
+ "declaration": "export type SessionLogOffset = BrandedNumber<'SessionLogOffset'>;"
670
+ },
671
+ {
672
+ "name": "SessionReferenceSource",
673
+ "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}"
674
+ },
675
+ {
676
+ "name": "SessionRequestId",
677
+ "declaration": "export type SessionRequestId = Branded<'session-request-id'>;"
678
+ },
679
+ {
680
+ "name": "SessionSeq",
681
+ "declaration": "export type SessionSeq = BrandedNumber<'SessionSeq'>;"
682
+ },
683
+ {
684
+ "name": "SessionSurface",
685
+ "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n readonly contentGeneration: number;\n}"
686
+ },
687
+ {
688
+ "name": "SessionTitleEventData",
689
+ "declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: SessionSeq[];\n readonly source: SessionTitleSource;\n}"
690
+ },
691
+ {
692
+ "name": "SessionTitleModelIdentity",
693
+ "declaration": "export interface SessionTitleModelIdentity {\n readonly provider: string;\n readonly model: string;\n}"
694
+ },
695
+ {
696
+ "name": "SessionTitleProviderId",
697
+ "declaration": "export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;"
698
+ },
699
+ {
700
+ "name": "SessionTitleSource",
701
+ "declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelIdentity; } | { readonly kind: 'user'; };"
702
+ },
703
+ {
704
+ "name": "ShareViewerPrincipal",
705
+ "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}"
706
+ },
707
+ {
708
+ "name": "SkillInvocationSource",
709
+ "declaration": "export interface SkillInvocationSource {\n readonly kind: 'skill-invocation';\n readonly name: string;\n readonly form: 'instructions';\n}"
710
+ },
711
+ {
712
+ "name": "StreamChunk",
713
+ "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; };"
714
+ },
715
+ {
716
+ "name": "SubagentCatalogEvent",
717
+ "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; });"
718
+ },
719
+ {
720
+ "name": "SubagentDescriptorBase",
721
+ "declaration": "export interface SubagentDescriptorBase {\n readonly version: number;\n readonly mode: 'one-shot' | 'continuable';\n readonly provider: string;\n}"
722
+ },
723
+ {
724
+ "name": "SubagentDescriptorData",
725
+ "declaration": "export type SubagentDescriptorData = OneShotSubagentDescriptorData | ContinuableSubagentDescriptorData;"
726
+ },
727
+ {
728
+ "name": "SubagentSettledMessageSource",
729
+ "declaration": "export interface SubagentSettledMessageSource {\n readonly kind: 'subagent-settled';\n readonly form: 'notice';\n readonly summary: string;\n readonly senderSessionId: SessionId;\n}"
730
+ },
731
+ {
732
+ "name": "SurfaceEventType",
733
+ "declaration": "export type SurfaceEventType = 'system/message' | 'developer/message' | 'user/message' | 'assistant/message' | 'tool/result';"
734
+ },
735
+ {
736
+ "name": "SurfaceIntent",
737
+ "declaration": "export type SurfaceIntent<T extends SurfaceEventType = SurfaceEventType> = { surfaceOp: SurfaceOp; } & (T extends 'assistant/message' ? { sourceEventSeqs?: never; } : { sourceEventSeqs?: SessionSeq[]; });"
738
+ },
739
+ {
740
+ "name": "SurfaceOp",
741
+ "declaration": "export type SurfaceOp = 'append' | { op: 'replace'; startSeq: SessionSeq; endSeq: SessionSeq; };"
742
+ },
743
+ {
744
+ "name": "SystemMessage",
745
+ "declaration": "export interface SystemMessage extends MessageBase {\n readonly role: 'system';\n readonly source: MessageSourceMap['system-prompt'];\n}"
746
+ },
747
+ {
748
+ "name": "SystemPromptMessageSource",
749
+ "declaration": "export interface SystemPromptMessageSource {\n kind: 'system-prompt';\n}"
750
+ },
751
+ {
752
+ "name": "SystemPromptUpdate",
753
+ "declaration": "export type SystemPromptUpdate = 'in-history';"
754
+ },
755
+ {
756
+ "name": "TeamId",
757
+ "declaration": "export type TeamId = Branded<'TeamId'>;"
758
+ },
759
+ {
760
+ "name": "TeamMemberPhase",
761
+ "declaration": "export type TeamMemberPhase = 'provisioning' | 'active' | 'failed';"
762
+ },
763
+ {
764
+ "name": "TeamMemberSnapshot",
765
+ "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}"
766
+ },
767
+ {
768
+ "name": "TeamMessageId",
769
+ "declaration": "export type TeamMessageId = Branded<'TeamMessageId'>;"
770
+ },
771
+ {
772
+ "name": "TeamMessageSnapshot",
773
+ "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}"
774
+ },
775
+ {
776
+ "name": "TeamMessageSource",
777
+ "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}"
778
+ },
779
+ {
780
+ "name": "TeamTaskId",
781
+ "declaration": "export type TeamTaskId = Branded<'TeamTaskId'>;"
782
+ },
783
+ {
784
+ "name": "TeamTaskSnapshot",
785
+ "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}"
786
+ },
787
+ {
788
+ "name": "TeamTaskStatus",
789
+ "declaration": "export type TeamTaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';"
790
+ },
791
+ {
792
+ "name": "TextBlock",
793
+ "declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
794
+ },
795
+ {
796
+ "name": "TodoItem",
797
+ "declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
798
+ },
799
+ {
800
+ "name": "TokenUsage",
801
+ "declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
802
+ },
803
+ {
804
+ "name": "ToolAdditionBlock",
805
+ "declaration": "export interface ToolAdditionBlock {\n type: 'tool-addition';\n toolName: string;\n tool?: never;\n}"
806
+ },
807
+ {
808
+ "name": "ToolCallBlock",
809
+ "declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: ToolCallId;\n name: string;\n arguments: string;\n}"
810
+ },
811
+ {
812
+ "name": "ToolCallId",
813
+ "declaration": "export type ToolCallId = Branded<'ToolCallId'>;"
814
+ },
815
+ {
816
+ "name": "ToolHistory",
817
+ "declaration": "export interface ToolHistory {\n readonly tools: readonly ToolSchema[];\n readonly updates: readonly { readonly messageId: MessageId; readonly additions: readonly ToolSchema[]; }[];\n}"
818
+ },
819
+ {
820
+ "name": "ToolMessageSource",
821
+ "declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
822
+ },
823
+ {
824
+ "name": "ToolRemovalBlock",
825
+ "declaration": "export interface ToolRemovalBlock {\n type: 'tool-removal';\n toolName: string;\n}"
826
+ },
827
+ {
828
+ "name": "ToolRestriction",
829
+ "declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
830
+ },
831
+ {
832
+ "name": "ToolResultMessage",
833
+ "declaration": "export interface ToolResultMessage extends MessageBase {\n readonly role: 'tool';\n readonly source: ToolMessageSource;\n readonly toolCallId: ToolCallId;\n readonly isError?: boolean;\n}"
834
+ },
835
+ {
836
+ "name": "ToolSchema",
837
+ "declaration": "export interface ToolSchema {\n deferLoading?: true;\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
838
+ },
839
+ {
840
+ "name": "TurnEndCancelCause",
841
+ "declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
842
+ },
843
+ {
844
+ "name": "TurnEndReason",
845
+ "declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
846
+ },
847
+ {
848
+ "name": "TurnEndReasonMap",
849
+ "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}"
850
+ },
851
+ {
852
+ "name": "UserMessage",
853
+ "declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n}"
854
+ },
855
+ {
856
+ "name": "WebhookDeliveryId",
857
+ "declaration": "export type WebhookDeliveryId = Branded<'WebhookDeliveryId'>;"
858
+ },
859
+ {
860
+ "name": "WebhookRuleId",
861
+ "declaration": "export type WebhookRuleId = Branded<'WebhookRuleId'>;"
862
+ },
863
+ {
864
+ "name": "WebhookSourceId",
865
+ "declaration": "export type WebhookSourceId = Branded<'WebhookSourceId'>;"
866
+ }
867
+ ]
868
+ }
869
+ ],
870
+ "events": [],
871
+ "objects": []
872
+ },
873
+ }