@qilin-agent/commands 0.0.0-stage → 3.1.4

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,821 @@
1
+ /* Generated by @qilin-agent/typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ let _qilin_agent_commands_commands_execute_parameter_0$schema$value
5
+ const _qilin_agent_commands_commands_execute_parameter_0$schema = () => (_qilin_agent_commands_commands_execute_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
6
+ let _qilin_agent_commands_commands_execute_parameter_1$schema$value
7
+ const _qilin_agent_commands_commands_execute_parameter_1$schema = () => (_qilin_agent_commands_commands_execute_parameter_1$schema$value ??= z.string())
8
+ let _qilin_agent_commands_commands_execute_parameter_2$schema$value
9
+ const _qilin_agent_commands_commands_execute_parameter_2$schema = () => (_qilin_agent_commands_commands_execute_parameter_2$schema$value ??= z.array(z.union([z.intersection(z.object({
10
+ 'type': z.literal("image").readonly(),
11
+ }), z.object({
12
+ 'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]),
13
+ 'data': z.string(),
14
+ 'name': z.string().optional(),
15
+ })), z.object({
16
+ 'type': z.literal("file").readonly(),
17
+ 'receiptId': z.string().readonly(),
18
+ })])))
19
+ let _qilin_agent_commands_commands_execute_result$schema$value
20
+ const _qilin_agent_commands_commands_execute_result$schema = () => (_qilin_agent_commands_commands_execute_result$schema$value ??= z.union([z.undefined(), z.object({
21
+ 'commandId': z.intersection(z.string(), z.unknown()).readonly(),
22
+ 'result': z.union([z.object({
23
+ 'kind': z.literal("success").readonly(),
24
+ 'text': z.string().readonly().optional(),
25
+ 'sourceEventSeq': z.intersection(z.number(), z.unknown()).readonly().optional(),
26
+ }), z.object({
27
+ 'kind': z.literal("error").readonly(),
28
+ 'text': z.string().readonly(),
29
+ })]).readonly(),
30
+ })]))
31
+ let _qilin_agent_commands_commands_list_parameter_0$schema$value
32
+ const _qilin_agent_commands_commands_list_parameter_0$schema = () => (_qilin_agent_commands_commands_list_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
33
+ let _qilin_agent_commands_commands_list_result$schema$value
34
+ const _qilin_agent_commands_commands_list_result$schema = () => (_qilin_agent_commands_commands_list_result$schema$value ??= z.array(z.object({
35
+ 'definitionId': z.intersection(z.string(), z.unknown()).readonly().optional(),
36
+ 'name': z.string().readonly(),
37
+ 'description': z.string().readonly(),
38
+ 'input': z.object({
39
+ 'hint': z.string().readonly(),
40
+ 'attachments': z.boolean().readonly().optional(),
41
+ }).readonly().optional(),
42
+ })))
43
+
44
+ export const TYPERT = {
45
+ package: '@qilin-agent/commands',
46
+ face: 'host',
47
+ schemas: [
48
+ ],
49
+ invocations: [
50
+ {
51
+ id: '@qilin-agent/commands#commands/execute',
52
+ service: 'commands',
53
+ namespace: 'commands',
54
+ method: 'execute',
55
+ invocation: { kind: 'direct' },
56
+ scope: {
57
+ context: 'agent',
58
+ wire: 'agentId',
59
+ },
60
+ parameters: [
61
+ {
62
+ name: 'agent',
63
+ wire: 'agentId',
64
+ source: 'lookup',
65
+ lookup: 'agent',
66
+ codec: {
67
+ mode: 'strict',
68
+ typeSymbol: '@qilin-agent/session/types#SessionId',
69
+ create: _qilin_agent_commands_commands_execute_parameter_0$schema,
70
+ },
71
+ },
72
+ {
73
+ name: 'line',
74
+ wire: 'line',
75
+ source: 'json',
76
+ codec: {
77
+ mode: 'strict',
78
+ typeSymbol: '@qilin-agent/commands#commands/execute:line',
79
+ create: _qilin_agent_commands_commands_execute_parameter_1$schema,
80
+ },
81
+ },
82
+ {
83
+ name: 'submittedAttachments',
84
+ wire: 'submittedAttachments',
85
+ source: 'json',
86
+ codec: {
87
+ mode: 'strict',
88
+ typeSymbol: '@qilin-agent/commands#commands/execute:submittedAttachments',
89
+ create: _qilin_agent_commands_commands_execute_parameter_2$schema,
90
+ },
91
+ },
92
+ ],
93
+ cancellation: { parameter: 'signal' },
94
+ result: {
95
+ mode: 'strict',
96
+ typeSymbol: '@qilin-agent/commands#commands/execute:result',
97
+ create: _qilin_agent_commands_commands_execute_result$schema,
98
+ },
99
+ sourceLocation: {"file":"packages/interaction/commands/src/index.ts","line":361,"column":9},
100
+ },
101
+ {
102
+ id: '@qilin-agent/commands#commands/list',
103
+ service: 'commands',
104
+ namespace: 'commands',
105
+ method: 'list',
106
+ invocation: { kind: 'direct' },
107
+ scope: {
108
+ context: 'agent',
109
+ wire: 'agentId',
110
+ },
111
+ parameters: [
112
+ {
113
+ name: 'agent',
114
+ wire: 'agentId',
115
+ source: 'lookup',
116
+ lookup: 'agent',
117
+ codec: {
118
+ mode: 'strict',
119
+ typeSymbol: '@qilin-agent/session/types#SessionId',
120
+ create: _qilin_agent_commands_commands_list_parameter_0$schema,
121
+ },
122
+ },
123
+ ],
124
+ result: {
125
+ mode: 'strict',
126
+ typeSymbol: '@qilin-agent/commands#commands/list:result',
127
+ create: _qilin_agent_commands_commands_list_result$schema,
128
+ },
129
+ sourceLocation: {"file":"packages/interaction/commands/src/index.ts","line":315,"column":3},
130
+ },
131
+ ],
132
+ model: {
133
+ "services": [
134
+ {
135
+ "description": "Human-command registry. Plain-context definitions are global; definitions registered through a command-injected child of an agent context shadow globals for that agent.",
136
+ "summary": "Human-command registry.",
137
+ "tags": [],
138
+ "jsDoc": "/**\n * Human-command registry. Plain-context definitions are global; definitions\n * registered through a command-injected child of an agent context shadow\n * globals for that agent.\n */",
139
+ "key": "commands",
140
+ "exportName": "CommandRuntime",
141
+ "members": [
142
+ {
143
+ "kind": "method",
144
+ "name": "register",
145
+ "signature": "register(definition: CommandDefinition): () => void",
146
+ "summary": "Register a global or calling-agent-scoped command.",
147
+ "jsDoc": "/**\n * Register a global or calling-agent-scoped command.\n * @param definition - discovery metadata and direct UI handler.\n * @returns the exact effect disposer that unregisters this definition.\n */"
148
+ },
149
+ {
150
+ "kind": "method",
151
+ "name": "registerFileReceiptResolver",
152
+ "signature": "registerFileReceiptResolver(resolver: CommandFileReceiptResolver): () => void",
153
+ "summary": "Register the sole authority that resolves staged file receipts for command submissions.",
154
+ "jsDoc": "/**\n * Register the sole authority that resolves staged file receipts for command submissions.\n * @param resolver - Session-aware receipt resolver.\n * @returns disposer that removes this exact resolver.\n */"
155
+ },
156
+ {
157
+ "kind": "method",
158
+ "name": "list",
159
+ "signature": "@Remote list(agent: Agent): readonly CommandDescriptor[]",
160
+ "summary": "List the effective immutable command descriptors for one agent.",
161
+ "jsDoc": "/**\n * List the effective immutable command descriptors for one agent.\n * @param agent - exact receiving agent and scoped-layer key.\n * @returns name-sorted descriptors after scoped shadowing.\n */"
162
+ },
163
+ {
164
+ "kind": "method",
165
+ "name": "find",
166
+ "signature": "find(agent: Agent, name: string): CommandDefinition | undefined",
167
+ "summary": "Resolve one effective command definition.",
168
+ "jsDoc": "/**\n * Resolve one effective command definition.\n * @param agent - exact receiving agent and scoped-layer key.\n * @param name - command name without a slash.\n * @returns the scoped shadow or global definition.\n */"
169
+ },
170
+ {
171
+ "kind": "method",
172
+ "name": "execute",
173
+ "signature": "@Remote async execute( agent: Agent, line: string, submittedAttachments: readonly CommandSubmitAttachment[], signal: AbortSignal, ): Promise<CommandExecution | undefined>",
174
+ "summary": "Parse and execute a known command without sending it to the model.",
175
+ "jsDoc": "/**\n * Parse and execute a known command without sending it to the model.\n *\n * A resolved command's lifecycle is logged: `command/run` is appended\n * before the handler is invoked and `command/done` after settlement (a\n * thrown or aborted handler settles as `kind: 'error'`). Both are direct\n * log-only appends — no turn wraps them, and persistence drains them at\n * ordinary checkpoints. Admission misses (syntax or unknown name) log\n * nothing — they never entered a handler. A `command/run` append failure\n * fails the execution loud; a `command/done` append failure on the\n * handler-failure path is contained so the handler's own error stays the\n * reported failure.\n *\n * Attachment admission is enforced here, not in the composer: attachments sent to a\n * command that does not declare `input.attachments`, an absent attachment store,\n * and an exceeded image limit each settle as an error result before\n * the handler runs. Validation rejection starts no attachment writes;\n * a storage failure can leave only unreachable content-addressed objects\n * for deferred collection.\n *\n * @param agent - exact receiving agent.\n * @param line - complete slash-command line.\n * @param submittedAttachments - encoded images and staged file receipts accompanying the line,\n * in submission order; empty for a plain invocation.\n * @param signal - cancellation signal owned by the UI request.\n * @returns the settled execution (result + lifecycle pairing id), or\n * `undefined` when syntax or name does not resolve.\n */"
176
+ }
177
+ ],
178
+ "types": [
179
+ {
180
+ "name": "AfterScheduleRecord",
181
+ "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}"
182
+ },
183
+ {
184
+ "name": "Agent",
185
+ "declaration": "export interface Agent {\n readonly id: SessionId;\n readonly options: AgentOptions;\n readonly session: Session;\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}"
186
+ },
187
+ {
188
+ "name": "AgentCancelCause",
189
+ "declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
190
+ },
191
+ {
192
+ "name": "AgentMessageSource",
193
+ "declaration": "export interface AgentMessageSource {\n readonly kind: 'agent-message';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
194
+ },
195
+ {
196
+ "name": "AgentOptions",
197
+ "declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId;\n maxTokens?: number;\n subagentDepth?: number;\n}"
198
+ },
199
+ {
200
+ "name": "AgentStatus",
201
+ "declaration": "export type AgentStatus = 'idle' | 'running';"
202
+ },
203
+ {
204
+ "name": "ApprovalOutcome",
205
+ "declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
206
+ },
207
+ {
208
+ "name": "ApprovalPolicy",
209
+ "declaration": "export type ApprovalPolicy = 'ask' | 'never';"
210
+ },
211
+ {
212
+ "name": "ApprovalRequestId",
213
+ "declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
214
+ },
215
+ {
216
+ "name": "AssistantMessage",
217
+ "declaration": "export interface AssistantMessage extends MessageBase {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
218
+ },
219
+ {
220
+ "name": "AssistantProviderMetadata",
221
+ "declaration": "export interface AssistantProviderMetadata {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
222
+ },
223
+ {
224
+ "name": "AssistantStreamRecord",
225
+ "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; };"
226
+ },
227
+ {
228
+ "name": "AtScheduleRecord",
229
+ "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}"
230
+ },
231
+ {
232
+ "name": "AttachmentId",
233
+ "declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
234
+ },
235
+ {
236
+ "name": "Branded",
237
+ "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
238
+ },
239
+ {
240
+ "name": "BrandedNumber",
241
+ "declaration": "export type BrandedNumber<B extends string> = number & { readonly [BRAND]: B; };"
242
+ },
243
+ {
244
+ "name": "CancelOptions",
245
+ "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
246
+ },
247
+ {
248
+ "name": "CommandDefinition",
249
+ "declaration": "export interface CommandDefinition {\n readonly definitionId?: CommandDefinitionId;\n readonly name: string;\n readonly description: string;\n readonly input?: CommandInputDescriptor;\n readonly recordInput?: boolean;\n readonly handler: (invocation: CommandInvocation) => CommandResult | Promise<CommandResult>;\n}"
250
+ },
251
+ {
252
+ "name": "CommandDefinitionId",
253
+ "declaration": "export type CommandDefinitionId = Branded<'CommandDefinitionId'>;"
254
+ },
255
+ {
256
+ "name": "CommandDescriptor",
257
+ "declaration": "export interface CommandDescriptor {\n readonly definitionId?: CommandDefinitionId;\n readonly name: string;\n readonly description: string;\n readonly input?: CommandInputDescriptor;\n}"
258
+ },
259
+ {
260
+ "name": "CommandExecution",
261
+ "declaration": "export interface CommandExecution {\n readonly commandId: CommandId;\n readonly result: CommandResult;\n}"
262
+ },
263
+ {
264
+ "name": "CommandFileReceiptResolver",
265
+ "declaration": "export type CommandFileReceiptResolver = (agent: Agent, receiptId: string) => FileAttachmentRef | undefined;"
266
+ },
267
+ {
268
+ "name": "CommandId",
269
+ "declaration": "export type CommandId = Branded<'CommandId'>;"
270
+ },
271
+ {
272
+ "name": "CommandInputDescriptor",
273
+ "declaration": "export interface CommandInputDescriptor {\n readonly hint: string;\n readonly attachments?: boolean;\n}"
274
+ },
275
+ {
276
+ "name": "CommandInvocation",
277
+ "declaration": "export interface CommandInvocation {\n readonly commandId: CommandId;\n readonly agent: Agent;\n readonly rawInput: string;\n readonly attachments: readonly (ImageBlock | FileBlock)[];\n readonly signal: AbortSignal;\n}"
278
+ },
279
+ {
280
+ "name": "CommandResult",
281
+ "declaration": "export type CommandResult = { readonly kind: 'success'; readonly text?: string; readonly sourceEventSeq?: SessionSeq; } | { readonly kind: 'error'; readonly text: string; };"
282
+ },
283
+ {
284
+ "name": "CommandSource",
285
+ "declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
286
+ },
287
+ {
288
+ "name": "CommandSourceMap",
289
+ "declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
290
+ },
291
+ {
292
+ "name": "CommandSubmitAttachment",
293
+ "declaration": "export type CommandSubmitAttachment = ({ readonly type: 'image'; } & EncodedImageAttachment) | { readonly type: 'file'; readonly receiptId: string; };"
294
+ },
295
+ {
296
+ "name": "CompactionCheckpointSource",
297
+ "declaration": "export type CompactionCheckpointSource = typeof COMPACT_CHECKPOINT_MARKER & { readonly compactionId: CompactionId; readonly sourceCommandId?: CommandId; };"
298
+ },
299
+ {
300
+ "name": "CompactionId",
301
+ "declaration": "export type CompactionId = Branded<'CompactionId'>;"
302
+ },
303
+ {
304
+ "name": "ContentBlock",
305
+ "declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
306
+ },
307
+ {
308
+ "name": "ContentBlockMap",
309
+ "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}"
310
+ },
311
+ {
312
+ "name": "ContentBlockType",
313
+ "declaration": "export type ContentBlockType = keyof ContentBlockMap;"
314
+ },
315
+ {
316
+ "name": "ContextFormed",
317
+ "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'; };"
318
+ },
319
+ {
320
+ "name": "ContextSnapshotSection",
321
+ "declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
322
+ },
323
+ {
324
+ "name": "ContinuableSubagentDescriptorData",
325
+ "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}"
326
+ },
327
+ {
328
+ "name": "DeveloperMessage",
329
+ "declaration": "export interface DeveloperMessage extends MessageBase {\n readonly role: 'developer';\n}"
330
+ },
331
+ {
332
+ "name": "EncodedImageAttachment",
333
+ "declaration": "export interface EncodedImageAttachment {\n mediaType: ImageMediaType;\n data: string;\n name?: string;\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": "JsonValue",
437
+ "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
438
+ },
439
+ {
440
+ "name": "KnownCatalogMode",
441
+ "declaration": "export type KnownCatalogMode = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
442
+ },
443
+ {
444
+ "name": "LegacyAfterScheduleRecord",
445
+ "declaration": "export interface LegacyAfterScheduleRecord extends Omit<AfterScheduleRecord, 'title'> {\n readonly title?: string;\n}"
446
+ },
447
+ {
448
+ "name": "LegacyAtScheduleRecord",
449
+ "declaration": "export interface LegacyAtScheduleRecord extends Omit<AtScheduleRecord, 'title'> {\n readonly title?: string;\n}"
450
+ },
451
+ {
452
+ "name": "LegacyEveryScheduleRecord",
453
+ "declaration": "export interface LegacyEveryScheduleRecord extends Omit<EveryScheduleRecord, 'title'> {\n readonly title?: string;\n}"
454
+ },
455
+ {
456
+ "name": "LegacyScheduleRecord",
457
+ "declaration": "export type LegacyScheduleRecord = LegacyAfterScheduleRecord | LegacyAtScheduleRecord | LegacyEveryScheduleRecord;"
458
+ },
459
+ {
460
+ "name": "LlmCallConfig",
461
+ "declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
462
+ },
463
+ {
464
+ "name": "LlmCallConfigAdapterDefaults",
465
+ "declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
466
+ },
467
+ {
468
+ "name": "LlmFailure",
469
+ "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}"
470
+ },
471
+ {
472
+ "name": "Message",
473
+ "declaration": "export type Message = MessageRoleMap[keyof MessageRoleMap];"
474
+ },
475
+ {
476
+ "name": "MessageBase",
477
+ "declaration": "export interface MessageBase {\n readonly id: MessageId;\n readonly content: readonly ContentBlock[];\n readonly source: MessageSource;\n}"
478
+ },
479
+ {
480
+ "name": "MessageFeedbackDelete",
481
+ "declaration": "export interface MessageFeedbackDelete {\n readonly sessionId: SessionId;\n readonly messageId: MessageId;\n}"
482
+ },
483
+ {
484
+ "name": "MessageFeedbackItem",
485
+ "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}"
486
+ },
487
+ {
488
+ "name": "MessageFeedbackPut",
489
+ "declaration": "export interface MessageFeedbackPut {\n readonly sessionId: SessionId;\n readonly item: MessageFeedbackItem;\n}"
490
+ },
491
+ {
492
+ "name": "MessageFeedbackRating",
493
+ "declaration": "export type MessageFeedbackRating = 'positive' | 'negative';"
494
+ },
495
+ {
496
+ "name": "MessageFeedbackVersion",
497
+ "declaration": "export type MessageFeedbackVersion = Branded<'MessageFeedbackVersion'>;"
498
+ },
499
+ {
500
+ "name": "MessageId",
501
+ "declaration": "export type MessageId = Branded<'MessageId'>;"
502
+ },
503
+ {
504
+ "name": "MessageRoleMap",
505
+ "declaration": "export interface MessageRoleMap {\n system: SystemMessage;\n developer: DeveloperMessage;\n user: UserMessage;\n assistant: AssistantMessage;\n tool: ToolResultMessage;\n}"
506
+ },
507
+ {
508
+ "name": "MessageSource",
509
+ "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
510
+ },
511
+ {
512
+ "name": "MessageSourceMap",
513
+ "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 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'working-directory': { kind: 'working-directory'; };\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'tool-registry': { kind: 'tool-registry'; };\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n 'sidechat-boundary': { kind: 'sidechat-boundary'; };\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'kylin-host-runner': { kind: 'kylin-host-runner'; };\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'compact-checkpoint': CompactionCheckpointSource;\n 'session-reference': SessionReferenceSource;\n 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n}"
514
+ },
515
+ {
516
+ "name": "ModelMessageSource",
517
+ "declaration": "export interface ModelMessageSource extends AssistantProviderMetadata {\n kind: 'model';\n}"
518
+ },
519
+ {
520
+ "name": "ModelSelection",
521
+ "declaration": "export interface ModelSelection {\n readonly provider: string;\n readonly model: string;\n readonly reasoningEffort?: string;\n}"
522
+ },
523
+ {
524
+ "name": "OneShotScheduleDispatchChange",
525
+ "declaration": "export interface OneShotScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n}"
526
+ },
527
+ {
528
+ "name": "OneShotSubagentDescriptorData",
529
+ "declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'one-shot';\n readonly label?: string;\n}"
530
+ },
531
+ {
532
+ "name": "OptionalSessionSeq",
533
+ "declaration": "export type OptionalSessionSeq = SessionSeq | null;"
534
+ },
535
+ {
536
+ "name": "ProviderRequestId",
537
+ "declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
538
+ },
539
+ {
540
+ "name": "PtcDispatchEventData",
541
+ "declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n meta?: JsonValue;\n error?: { name: string; code: string; reason?: string; };\n}"
542
+ },
543
+ {
544
+ "name": "PtcDispatchStartEventData",
545
+ "declaration": "export interface PtcDispatchStartEventData {\n rootCallId: ToolCallId;\n parentCallId: ToolCallId;\n subCallId: ToolCallId;\n name: string;\n arguments: unknown;\n}"
546
+ },
547
+ {
548
+ "name": "ReasoningBlock",
549
+ "declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
550
+ },
551
+ {
552
+ "name": "ReasoningEffortId",
553
+ "declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
554
+ },
555
+ {
556
+ "name": "ReplayEnvelope",
557
+ "declaration": "export interface ReplayEnvelope {\n response: unknown;\n blocks?: readonly unknown[];\n}"
558
+ },
559
+ {
560
+ "name": "RequestContext",
561
+ "declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n systemPromptUpdate?: SystemPromptUpdate;\n}"
562
+ },
563
+ {
564
+ "name": "RequestHeaderReason",
565
+ "declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change' | 'series';"
566
+ },
567
+ {
568
+ "name": "SandboxMode",
569
+ "declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
570
+ },
571
+ {
572
+ "name": "ScheduleChange",
573
+ "declaration": "export type ScheduleChange = ScheduleCreateChange | ScheduleDeleteChange | ScheduleDispatchChange;"
574
+ },
575
+ {
576
+ "name": "ScheduleCreateChange",
577
+ "declaration": "export interface ScheduleCreateChange {\n readonly version: 1;\n readonly operation: 'create';\n readonly schedule: LegacyScheduleRecord;\n}"
578
+ },
579
+ {
580
+ "name": "ScheduleDeleteChange",
581
+ "declaration": "export interface ScheduleDeleteChange {\n readonly version: 1;\n readonly operation: 'delete';\n readonly id: ScheduleId;\n}"
582
+ },
583
+ {
584
+ "name": "ScheduleDispatchChange",
585
+ "declaration": "export type ScheduleDispatchChange = OneShotScheduleDispatchChange | EveryScheduleDispatchChange;"
586
+ },
587
+ {
588
+ "name": "ScheduleId",
589
+ "declaration": "export type ScheduleId = Branded<'ScheduleId'>;"
590
+ },
591
+ {
592
+ "name": "Session",
593
+ "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}"
594
+ },
595
+ {
596
+ "name": "SessionEvent",
597
+ "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];"
598
+ },
599
+ {
600
+ "name": "SessionEventMap",
601
+ "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 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\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 'working-directory/change': { cwd: string; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@qilin-agent/session/types').SessionSeq; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'permission/preset': { preset: string; };\n 'subagent/descriptor': SubagentDescriptorData;\n 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\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 'schedule/change': ScheduleChange;\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}"
602
+ },
603
+ {
604
+ "name": "SessionEventType",
605
+ "declaration": "export type SessionEventType = keyof SessionEventMap;"
606
+ },
607
+ {
608
+ "name": "SessionHeader",
609
+ "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}"
610
+ },
611
+ {
612
+ "name": "SessionId",
613
+ "declaration": "export type SessionId = Branded<'SessionId'>;"
614
+ },
615
+ {
616
+ "name": "SessionLogOffset",
617
+ "declaration": "export type SessionLogOffset = BrandedNumber<'SessionLogOffset'>;"
618
+ },
619
+ {
620
+ "name": "SessionReferenceSource",
621
+ "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}"
622
+ },
623
+ {
624
+ "name": "SessionRequestId",
625
+ "declaration": "export type SessionRequestId = Branded<'session-request-id'>;"
626
+ },
627
+ {
628
+ "name": "SessionSeq",
629
+ "declaration": "export type SessionSeq = BrandedNumber<'SessionSeq'>;"
630
+ },
631
+ {
632
+ "name": "SessionSurface",
633
+ "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n readonly contentGeneration: number;\n}"
634
+ },
635
+ {
636
+ "name": "SessionTitleEventData",
637
+ "declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: SessionSeq[];\n readonly source: SessionTitleSource;\n}"
638
+ },
639
+ {
640
+ "name": "SessionTitleModelIdentity",
641
+ "declaration": "export interface SessionTitleModelIdentity {\n readonly provider: string;\n readonly model: string;\n}"
642
+ },
643
+ {
644
+ "name": "SessionTitleProviderId",
645
+ "declaration": "export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;"
646
+ },
647
+ {
648
+ "name": "SessionTitleSource",
649
+ "declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelIdentity; } | { readonly kind: 'user'; };"
650
+ },
651
+ {
652
+ "name": "SkillInvocationSource",
653
+ "declaration": "export interface SkillInvocationSource {\n readonly kind: 'skill-invocation';\n readonly name: string;\n readonly form: 'instructions';\n}"
654
+ },
655
+ {
656
+ "name": "StreamChunk",
657
+ "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; };"
658
+ },
659
+ {
660
+ "name": "SubagentCatalogEvent",
661
+ "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; });"
662
+ },
663
+ {
664
+ "name": "SubagentDescriptorBase",
665
+ "declaration": "export interface SubagentDescriptorBase {\n readonly version: number;\n readonly mode: 'one-shot' | 'continuable';\n readonly provider: string;\n}"
666
+ },
667
+ {
668
+ "name": "SubagentDescriptorData",
669
+ "declaration": "export type SubagentDescriptorData = OneShotSubagentDescriptorData | ContinuableSubagentDescriptorData;"
670
+ },
671
+ {
672
+ "name": "SubagentSettledMessageSource",
673
+ "declaration": "export interface SubagentSettledMessageSource {\n readonly kind: 'subagent-settled';\n readonly form: 'notice';\n readonly summary: string;\n readonly senderSessionId: SessionId;\n}"
674
+ },
675
+ {
676
+ "name": "SurfaceEventType",
677
+ "declaration": "export type SurfaceEventType = 'system/message' | 'developer/message' | 'user/message' | 'assistant/message' | 'tool/result';"
678
+ },
679
+ {
680
+ "name": "SurfaceIntent",
681
+ "declaration": "export type SurfaceIntent<T extends SurfaceEventType = SurfaceEventType> = { surfaceOp: SurfaceOp; } & (T extends 'assistant/message' ? { sourceEventSeqs?: never; } : { sourceEventSeqs?: SessionSeq[]; });"
682
+ },
683
+ {
684
+ "name": "SurfaceOp",
685
+ "declaration": "export type SurfaceOp = 'append' | { op: 'replace'; startSeq: SessionSeq; endSeq: SessionSeq; };"
686
+ },
687
+ {
688
+ "name": "SystemMessage",
689
+ "declaration": "export interface SystemMessage extends MessageBase {\n readonly role: 'system';\n readonly source: MessageSourceMap['system-prompt'];\n}"
690
+ },
691
+ {
692
+ "name": "SystemPromptMessageSource",
693
+ "declaration": "export interface SystemPromptMessageSource {\n kind: 'system-prompt';\n}"
694
+ },
695
+ {
696
+ "name": "SystemPromptUpdate",
697
+ "declaration": "export type SystemPromptUpdate = 'in-history';"
698
+ },
699
+ {
700
+ "name": "TeamId",
701
+ "declaration": "export type TeamId = Branded<'TeamId'>;"
702
+ },
703
+ {
704
+ "name": "TeamMemberPhase",
705
+ "declaration": "export type TeamMemberPhase = 'provisioning' | 'active' | 'failed';"
706
+ },
707
+ {
708
+ "name": "TeamMemberSnapshot",
709
+ "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}"
710
+ },
711
+ {
712
+ "name": "TeamMessageId",
713
+ "declaration": "export type TeamMessageId = Branded<'TeamMessageId'>;"
714
+ },
715
+ {
716
+ "name": "TeamMessageSnapshot",
717
+ "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}"
718
+ },
719
+ {
720
+ "name": "TeamMessageSource",
721
+ "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}"
722
+ },
723
+ {
724
+ "name": "TeamTaskId",
725
+ "declaration": "export type TeamTaskId = Branded<'TeamTaskId'>;"
726
+ },
727
+ {
728
+ "name": "TeamTaskSnapshot",
729
+ "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}"
730
+ },
731
+ {
732
+ "name": "TeamTaskStatus",
733
+ "declaration": "export type TeamTaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';"
734
+ },
735
+ {
736
+ "name": "TextBlock",
737
+ "declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
738
+ },
739
+ {
740
+ "name": "TodoItem",
741
+ "declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
742
+ },
743
+ {
744
+ "name": "TokenUsage",
745
+ "declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
746
+ },
747
+ {
748
+ "name": "ToolAdditionBlock",
749
+ "declaration": "export interface ToolAdditionBlock {\n type: 'tool-addition';\n toolName: string;\n tool?: never;\n}"
750
+ },
751
+ {
752
+ "name": "ToolCallBlock",
753
+ "declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: ToolCallId;\n name: string;\n arguments: string;\n}"
754
+ },
755
+ {
756
+ "name": "ToolCallId",
757
+ "declaration": "export type ToolCallId = Branded<'ToolCallId'>;"
758
+ },
759
+ {
760
+ "name": "ToolHistory",
761
+ "declaration": "export interface ToolHistory {\n readonly tools: readonly ToolSchema[];\n readonly updates: readonly { readonly messageId: MessageId; readonly additions: readonly ToolSchema[]; }[];\n}"
762
+ },
763
+ {
764
+ "name": "ToolMessageSource",
765
+ "declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
766
+ },
767
+ {
768
+ "name": "ToolRemovalBlock",
769
+ "declaration": "export interface ToolRemovalBlock {\n type: 'tool-removal';\n toolName: string;\n}"
770
+ },
771
+ {
772
+ "name": "ToolRestriction",
773
+ "declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
774
+ },
775
+ {
776
+ "name": "ToolResultMessage",
777
+ "declaration": "export interface ToolResultMessage extends MessageBase {\n readonly role: 'tool';\n readonly source: ToolMessageSource;\n readonly toolCallId: ToolCallId;\n readonly isError?: boolean;\n}"
778
+ },
779
+ {
780
+ "name": "ToolSchema",
781
+ "declaration": "export interface ToolSchema {\n deferLoading?: true;\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
782
+ },
783
+ {
784
+ "name": "TurnEndCancelCause",
785
+ "declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
786
+ },
787
+ {
788
+ "name": "TurnEndReason",
789
+ "declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
790
+ },
791
+ {
792
+ "name": "TurnEndReasonMap",
793
+ "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}"
794
+ },
795
+ {
796
+ "name": "UserMessage",
797
+ "declaration": "export interface UserMessage extends MessageBase {\n readonly role: 'user';\n}"
798
+ }
799
+ ]
800
+ }
801
+ ],
802
+ "events": [
803
+ {
804
+ "description": "A command was registered or unregistered. This is an unfiltered registry notification because a global or scoped change may affect any UI view. Observer failures are contained and cannot veto the registry mutation.",
805
+ "summary": "A command was registered or unregistered.",
806
+ "tags": [
807
+ {
808
+ "name": "mode",
809
+ "comment": "emit",
810
+ "text": "@mode emit"
811
+ }
812
+ ],
813
+ "jsDoc": "/**\n * A command was registered or unregistered. This is an unfiltered registry\n * notification because a global or scoped change may affect any UI view.\n * Observer failures are contained and cannot veto the registry mutation.\n * @mode emit\n */",
814
+ "name": "commands/change",
815
+ "mode": "emit",
816
+ "signature": "'commands/change'(): void"
817
+ }
818
+ ],
819
+ "objects": []
820
+ },
821
+ }