@unieai/rabi-session-reference 0.0.0-stage → 0.2.2-rc.5

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,817 @@
1
+ /* Generated by @unieai/rabi-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ import { createTypertRemoteInfo } from '@unieai/rabi-typert-protocol/remote-info'
5
+
6
+ let _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_0$schema$value
7
+ const _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_0$schema = () => (_unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_0$schema$value ??= z.string())
8
+ let _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_1$schema$value
9
+ const _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_1$schema = () => (_unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_1$schema$value ??= z.string())
10
+ let _unieai_rabi_session_reference_sessionReferenceResolver_candidates_result$schema$value
11
+ const _unieai_rabi_session_reference_sessionReferenceResolver_candidates_result$schema = () => (_unieai_rabi_session_reference_sessionReferenceResolver_candidates_result$schema$value ??= z.array(z.object({
12
+ 'mention': z.string().describe('Canonical `@[label](rabi-session:…)` mention serialized into the prompt draft.'),
13
+ 'sessionId': z.string().describe('Opaque source session identity.'),
14
+ 'label': z.string().describe('Latest log-backed title, falling back to the opaque session id.'),
15
+ 'displayTitle': z.string().optional().describe('Display and canonical-mention text, preferring a subagent\'s durable creation label over {@link label}.'),
16
+ 'cwd': z.string().optional().describe('Source session working directory, when recorded.'),
17
+ 'sameWorkspace': z.boolean().describe('True when {@link SessionReferenceCandidate.cwd} is recorded and equals the requesting agent\'s. Hosts that only surface a distinguishing location read this instead of comparing paths they never received.'),
18
+ 'createdAt': z.number().describe('Source session creation time in Unix epoch milliseconds.'),
19
+ })))
20
+ let _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_0_strict$schema$value
21
+ const _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_0_strict$schema = () => (_unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_0_strict$schema$value ??= z.string())
22
+ let _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_1_strict$schema$value
23
+ const _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_1_strict$schema = () => (_unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_1_strict$schema$value ??= z.string())
24
+
25
+ const $remote = createTypertRemoteInfo({
26
+ package: '@unieai/rabi-session-reference',
27
+ methods: {
28
+ 'sessionReferenceResolver/candidates': {
29
+ service: 'sessionReferenceResolver',
30
+ description: 'Remote face of {@link listCandidates}: the configured candidate limit applies, and every candidate carries the canonical mention a host inserts into the prompt draft.',
31
+ implementation: 'remoteExportCandidates',
32
+ invocation: { kind: 'direct' },
33
+ scope: {
34
+ context: 'agent',
35
+ wire: 'agentId',
36
+ },
37
+ parameters: [
38
+ {
39
+ name: 'agent',
40
+ wire: 'agentId',
41
+ description: 'target agent; self is excluded and its cwd drives ranking.',
42
+ source: 'lookup',
43
+ lookup: 'agent',
44
+ codec: {
45
+ mode: 'strict',
46
+ typeSymbol: '@unieai/rabi-session/types#SessionId',
47
+ create: _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_0$schema,
48
+ jsonSchema: {"type":"string"},
49
+ },
50
+ strictCodec: {
51
+ mode: 'strict',
52
+ typeSymbol: '@unieai/rabi-session/types#SessionId',
53
+ create: _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_0_strict$schema,
54
+ jsonSchema: {"type":"string"},
55
+ },
56
+ },
57
+ {
58
+ name: 'query',
59
+ description: 'optional case-insensitive session-id/cwd/title substring.',
60
+ source: 'json',
61
+ codec: {
62
+ mode: 'strict',
63
+ typeSymbol: '@unieai/rabi-session-reference#sessionReferenceResolver/candidates:query',
64
+ create: _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_1$schema,
65
+ jsonSchema: {"type":"string"},
66
+ },
67
+ strictCodec: {
68
+ mode: 'strict',
69
+ typeSymbol: '@unieai/rabi-session-reference#sessionReferenceResolver/candidates:query',
70
+ create: _unieai_rabi_session_reference_sessionReferenceResolver_candidates_parameter_1_strict$schema,
71
+ jsonSchema: {"type":"string"},
72
+ },
73
+ },
74
+ ],
75
+ cancellation: { parameter: 'signal' },
76
+ result: {
77
+ mode: 'strict',
78
+ typeSymbol: '@unieai/rabi-session-reference#sessionReferenceResolver/candidates:result',
79
+ create: _unieai_rabi_session_reference_sessionReferenceResolver_candidates_result$schema,
80
+ description: 'mention-carrying candidates in rank order.',
81
+ jsonSchema: {"type":"array","items":{"type":"object","properties":{"mention":{"type":"string","description":"Canonical `@[label](rabi-session:…)` mention serialized into the prompt draft."},"sessionId":{"type":"string","description":"Opaque source session identity."},"label":{"type":"string","description":"Latest log-backed title, falling back to the opaque session id."},"displayTitle":{"type":"string","description":"Display and canonical-mention text, preferring a subagent's durable creation label over {@link label}."},"cwd":{"type":"string","description":"Source session working directory, when recorded."},"sameWorkspace":{"type":"boolean","description":"True when {@link SessionReferenceCandidate.cwd} is recorded and equals the requesting agent's. Hosts that only surface a distinguishing location read this instead of comparing paths they never received."},"createdAt":{"type":"number","description":"Source session creation time in Unix epoch milliseconds."}},"required":["mention","sessionId","label","sameWorkspace","createdAt"],"additionalProperties":true}},
82
+ },
83
+ sourceLocation: {"file":"packages/context/session-reference/src/index.ts","line":282,"column":9},
84
+ },
85
+ },
86
+ }, z)
87
+
88
+ export const TYPERT = {
89
+ package: '@unieai/rabi-session-reference',
90
+ face: 'host',
91
+ schemas: [
92
+ ],
93
+ get invocations() { return $remote.descriptors },
94
+ model: {
95
+ "services": [
96
+ {
97
+ "description": "Exact-read consumer that prepares immutable cross-session message context.",
98
+ "summary": "Exact-read consumer that prepares immutable cross-session message context.",
99
+ "tags": [],
100
+ "jsDoc": "/** Exact-read consumer that prepares immutable cross-session message context. */",
101
+ "key": "sessionReferenceResolver",
102
+ "exportName": "SessionReferenceResolver",
103
+ "members": [
104
+ {
105
+ "kind": "method",
106
+ "name": "listCandidates",
107
+ "signature": "async listCandidates( agent: Agent, query: string = '', limit: number = this.config.candidateLimit, signal?: AbortSignal, ): Promise<SessionReferenceCandidate[]>",
108
+ "summary": "List reference candidates, ranked by working-directory affinity.",
109
+ "jsDoc": "/**\n * List reference candidates, ranked by working-directory affinity.\n *\n * Discovery runs at keystroke rate, so titles and subagent labels only ever\n * come from projection reads; sessions without either fall back to their id.\n * @param agent - target agent; self is excluded and its cwd drives ranking.\n * @param query - optional case-insensitive session-id/cwd/title/display-title substring.\n * @param limit - optional positive result cap.\n * @param signal - optional cancellation boundary for host autocomplete teardown.\n * @returns candidates with canonical mention labels and presentation titles.\n */"
110
+ },
111
+ {
112
+ "kind": "method",
113
+ "name": "remoteExportCandidates",
114
+ "signature": "@Remote('candidates') async remoteExportCandidates( agent: Agent, query: string, signal: AbortSignal, ): Promise<SessionReferenceMentionCandidate[]>",
115
+ "summary": "Remote face of {@link listCandidates}: the configured candidate limit applies, and every candidate carries the canonical mention a host inserts into the prompt draft.",
116
+ "jsDoc": "/**\n * Remote face of {@link listCandidates}: the configured candidate limit\n * applies, and every candidate carries the canonical mention a host inserts\n * into the prompt draft.\n * @param agent - target agent; self is excluded and its cwd drives ranking.\n * @param query - optional case-insensitive session-id/cwd/title substring.\n * @param signal - caller cancellation.\n * @returns mention-carrying candidates in rank order.\n */"
117
+ },
118
+ {
119
+ "kind": "method",
120
+ "name": "prepare",
121
+ "signature": "async prepare( agent: Agent, content: ContentBlock[], references: SessionReferenceInput[], route: Readonly<Pick<LlmCallConfig, 'provider' | 'model'>>, signal?: AbortSignal, ): Promise<PreparedReferencedMessage>",
122
+ "summary": "Snapshot all references for one accepted direct message and return one aggregated durable context.",
123
+ "jsDoc": "/**\n * Snapshot all references for one accepted direct message and return one aggregated durable context.\n * Automatic budgets use the context capacity of `route`.\n * Missing model capacity or adapter uses 64 KiB; other metadata lookup failures and cancellation reject preparation.\n * Truncated previews include omission facts and a full-snapshot spill locator, or an explicit unavailable notice.\n * Cancellation prevents context publication, including when storage completes after cancellation.\n * @param agent - target agent; references to it are rejected.\n * @param content - already host-normalized readable message content.\n * @param references - structured source sessions in mention order.\n * @param route - provider and model whose context capacity sizes the previews.\n * @param signal - optional cancellation boundary for the active turn.\n * @returns detached content and optional referenced-session context.\n */"
124
+ }
125
+ ],
126
+ "types": [
127
+ {
128
+ "name": "AfterScheduleRecord",
129
+ "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}"
130
+ },
131
+ {
132
+ "name": "Agent",
133
+ "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}"
134
+ },
135
+ {
136
+ "name": "AgentCancelCause",
137
+ "declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
138
+ },
139
+ {
140
+ "name": "AgentMessageSource",
141
+ "declaration": "export interface AgentMessageSource {\n readonly kind: 'agent-message';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
142
+ },
143
+ {
144
+ "name": "AgentOptions",
145
+ "declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId | undefined;\n maxTokens?: number;\n subagentDepth?: number;\n}"
146
+ },
147
+ {
148
+ "name": "AgentStatus",
149
+ "declaration": "export type AgentStatus = 'idle' | 'running';"
150
+ },
151
+ {
152
+ "name": "AllowedModelRoute",
153
+ "declaration": "export interface AllowedModelRoute {\n readonly provider: string;\n readonly model: string;\n}"
154
+ },
155
+ {
156
+ "name": "ApprovalOutcome",
157
+ "declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
158
+ },
159
+ {
160
+ "name": "ApprovalPolicy",
161
+ "declaration": "export type ApprovalPolicy = 'ask' | 'never';"
162
+ },
163
+ {
164
+ "name": "ApprovalRequestId",
165
+ "declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
166
+ },
167
+ {
168
+ "name": "AssistantMessage",
169
+ "declaration": "export interface AssistantMessage extends MessageBase {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
170
+ },
171
+ {
172
+ "name": "AssistantProviderMetadata",
173
+ "declaration": "export interface AssistantProviderMetadata {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
174
+ },
175
+ {
176
+ "name": "AssistantStreamRecord",
177
+ "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; };"
178
+ },
179
+ {
180
+ "name": "AtScheduleRecord",
181
+ "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}"
182
+ },
183
+ {
184
+ "name": "AttachmentId",
185
+ "declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
186
+ },
187
+ {
188
+ "name": "Branded",
189
+ "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
190
+ },
191
+ {
192
+ "name": "BrandedNumber",
193
+ "declaration": "export type BrandedNumber<B extends string> = number & { readonly [BRAND]: B; };"
194
+ },
195
+ {
196
+ "name": "CancelOptions",
197
+ "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
198
+ },
199
+ {
200
+ "name": "CommandId",
201
+ "declaration": "export type CommandId = Branded<'CommandId'>;"
202
+ },
203
+ {
204
+ "name": "CommandSource",
205
+ "declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
206
+ },
207
+ {
208
+ "name": "CommandSourceMap",
209
+ "declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
210
+ },
211
+ {
212
+ "name": "CompactionCheckpointSource",
213
+ "declaration": "export type CompactionCheckpointSource = typeof COMPACT_CHECKPOINT_MARKER & { readonly compactionId: CompactionId; readonly sourceCommandId?: CommandId; };"
214
+ },
215
+ {
216
+ "name": "CompactionId",
217
+ "declaration": "export type CompactionId = Branded<'CompactionId'>;"
218
+ },
219
+ {
220
+ "name": "ContentBlock",
221
+ "declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
222
+ },
223
+ {
224
+ "name": "ContentBlockMap",
225
+ "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}"
226
+ },
227
+ {
228
+ "name": "ContentBlockType",
229
+ "declaration": "export type ContentBlockType = keyof ContentBlockMap;"
230
+ },
231
+ {
232
+ "name": "ContextFormed",
233
+ "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'; };"
234
+ },
235
+ {
236
+ "name": "ContextSnapshotSection",
237
+ "declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
238
+ },
239
+ {
240
+ "name": "ContinuableSubagentDescriptorData",
241
+ "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}"
242
+ },
243
+ {
244
+ "name": "DeveloperMessage",
245
+ "declaration": "export interface DeveloperMessage extends MessageBase {\n readonly role: 'developer';\n}"
246
+ },
247
+ {
248
+ "name": "EpochHeader",
249
+ "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n system?: never;\n}"
250
+ },
251
+ {
252
+ "name": "EveryScheduleDispatchChange",
253
+ "declaration": "export interface EveryScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n readonly acceptedAt: string;\n}"
254
+ },
255
+ {
256
+ "name": "EveryScheduleRecord",
257
+ "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}"
258
+ },
259
+ {
260
+ "name": "FeedbackCategory",
261
+ "declaration": "export type FeedbackCategory = 'task-result' | 'instruction-following' | 'product-interaction' | 'service-stability' | 'resource-cost' | 'security-privacy-permission' | 'other';"
262
+ },
263
+ {
264
+ "name": "FeedbackRecord",
265
+ "declaration": "export interface FeedbackRecord {\n readonly text?: string;\n readonly category?: FeedbackCategory;\n}"
266
+ },
267
+ {
268
+ "name": "FileAttachmentRef",
269
+ "declaration": "export interface FileAttachmentRef {\n attachmentId: AttachmentId;\n name: string;\n bytes: number;\n}"
270
+ },
271
+ {
272
+ "name": "FileBlock",
273
+ "declaration": "export interface FileBlock {\n type: 'file';\n attachment: FileAttachmentRef;\n}"
274
+ },
275
+ {
276
+ "name": "FinishReason",
277
+ "declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
278
+ },
279
+ {
280
+ "name": "FinishReasonMap",
281
+ "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}"
282
+ },
283
+ {
284
+ "name": "GoalBlockReason",
285
+ "declaration": "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
286
+ },
287
+ {
288
+ "name": "GoalChangeMeta",
289
+ "declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
290
+ },
291
+ {
292
+ "name": "GoalClearChangeMeta",
293
+ "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}"
294
+ },
295
+ {
296
+ "name": "GoalId",
297
+ "declaration": "export type GoalId = Branded<'GoalId'>;"
298
+ },
299
+ {
300
+ "name": "GoalMessageSource",
301
+ "declaration": "export interface GoalMessageSource {\n readonly kind: 'goal';\n readonly goalId: GoalId;\n readonly revision: number;\n readonly round: number;\n}"
302
+ },
303
+ {
304
+ "name": "GoalOperation",
305
+ "declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
306
+ },
307
+ {
308
+ "name": "GoalPhase",
309
+ "declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
310
+ },
311
+ {
312
+ "name": "GoalRef",
313
+ "declaration": "export interface GoalRef {\n readonly id: GoalId;\n readonly revision: number;\n}"
314
+ },
315
+ {
316
+ "name": "GoalSnapshot",
317
+ "declaration": "export interface GoalSnapshot extends GoalRef {\n readonly objective: string;\n readonly phase: GoalPhase;\n readonly blockedReason?: GoalBlockReason;\n readonly maxGoalRounds: number;\n}"
318
+ },
319
+ {
320
+ "name": "GoalSnapshotChangeMeta",
321
+ "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}"
322
+ },
323
+ {
324
+ "name": "ImageAttachmentRef",
325
+ "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}"
326
+ },
327
+ {
328
+ "name": "ImageBlock",
329
+ "declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n offloaded?: true;\n}"
330
+ },
331
+ {
332
+ "name": "ImageMediaType",
333
+ "declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
334
+ },
335
+ {
336
+ "name": "ImageOffloadTarget",
337
+ "declaration": "export interface ImageOffloadTarget {\n seq: SessionSeq;\n imageIndexes: number[];\n}"
338
+ },
339
+ {
340
+ "name": "Inbox",
341
+ "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}"
342
+ },
343
+ {
344
+ "name": "InboxTarget",
345
+ "declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
346
+ },
347
+ {
348
+ "name": "JobId",
349
+ "declaration": "export type JobId = Branded<'JobId'>;"
350
+ },
351
+ {
352
+ "name": "JobOutcome",
353
+ "declaration": "export interface JobOutcome {\n status: 'completed' | 'killed' | 'failed';\n detail?: string;\n result?: string;\n}"
354
+ },
355
+ {
356
+ "name": "JobRegisteredData",
357
+ "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}"
358
+ },
359
+ {
360
+ "name": "JobSettleCause",
361
+ "declaration": "export type JobSettleCause = 'producer' | 'kill' | 'teardown';"
362
+ },
363
+ {
364
+ "name": "JobSettledData",
365
+ "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}"
366
+ },
367
+ {
368
+ "name": "JobToolCall",
369
+ "declaration": "export interface JobToolCall {\n readonly callId: SessionEventMap['tool/call']['callId'];\n readonly rootCallId: SessionEventMap['tool/call']['callId'];\n}"
370
+ },
371
+ {
372
+ "name": "JsonValue",
373
+ "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
374
+ },
375
+ {
376
+ "name": "KnownCatalogMode",
377
+ "declaration": "export type KnownCatalogMode = { readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; };"
378
+ },
379
+ {
380
+ "name": "LegacyAfterScheduleRecord",
381
+ "declaration": "export interface LegacyAfterScheduleRecord extends Omit<AfterScheduleRecord, 'title'> {\n readonly title?: string;\n}"
382
+ },
383
+ {
384
+ "name": "LegacyAtScheduleRecord",
385
+ "declaration": "export interface LegacyAtScheduleRecord extends Omit<AtScheduleRecord, 'title'> {\n readonly title?: string;\n}"
386
+ },
387
+ {
388
+ "name": "LegacyEveryScheduleRecord",
389
+ "declaration": "export interface LegacyEveryScheduleRecord extends Omit<EveryScheduleRecord, 'title'> {\n readonly title?: string;\n}"
390
+ },
391
+ {
392
+ "name": "LegacyScheduleRecord",
393
+ "declaration": "export type LegacyScheduleRecord = LegacyAfterScheduleRecord | LegacyAtScheduleRecord | LegacyEveryScheduleRecord;"
394
+ },
395
+ {
396
+ "name": "LlmCallConfig",
397
+ "declaration": "export interface LlmCallConfig extends LlmCallControls {\n provider: string;\n model: string;\n}"
398
+ },
399
+ {
400
+ "name": "LlmCallConfigAdapterDefaults",
401
+ "declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
402
+ },
403
+ {
404
+ "name": "LlmCallControls",
405
+ "declaration": "export interface LlmCallControls {\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
406
+ },
407
+ {
408
+ "name": "LlmFailure",
409
+ "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}"
410
+ },
411
+ {
412
+ "name": "LlmRetryEventData",
413
+ "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; };"
414
+ },
415
+ {
416
+ "name": "LlmRetryStartedEventData",
417
+ "declaration": "export interface LlmRetryStartedEventData {\n retryId: RetryId;\n turn: number;\n step: number;\n retry: number;\n}"
418
+ },
419
+ {
420
+ "name": "Message",
421
+ "declaration": "export type Message = MessageRoleMap[keyof MessageRoleMap];"
422
+ },
423
+ {
424
+ "name": "MessageBase",
425
+ "declaration": "export interface MessageBase {\n readonly id: MessageId;\n readonly content: readonly ContentBlock[];\n readonly source: MessageSource;\n}"
426
+ },
427
+ {
428
+ "name": "MessageFeedbackDelete",
429
+ "declaration": "export interface MessageFeedbackDelete {\n readonly sessionId: SessionId;\n readonly messageId: MessageId;\n}"
430
+ },
431
+ {
432
+ "name": "MessageFeedbackItem",
433
+ "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}"
434
+ },
435
+ {
436
+ "name": "MessageFeedbackPut",
437
+ "declaration": "export interface MessageFeedbackPut {\n readonly sessionId: SessionId;\n readonly item: MessageFeedbackItem;\n}"
438
+ },
439
+ {
440
+ "name": "MessageFeedbackRating",
441
+ "declaration": "export type MessageFeedbackRating = 'positive' | 'negative';"
442
+ },
443
+ {
444
+ "name": "MessageFeedbackVersion",
445
+ "declaration": "export type MessageFeedbackVersion = Branded<'MessageFeedbackVersion'>;"
446
+ },
447
+ {
448
+ "name": "MessageId",
449
+ "declaration": "export type MessageId = Branded<'MessageId'>;"
450
+ },
451
+ {
452
+ "name": "MessageRoleMap",
453
+ "declaration": "export interface MessageRoleMap {\n system: SystemMessage;\n developer: DeveloperMessage;\n user: UserMessage;\n assistant: AssistantMessage;\n tool: ToolResultMessage;\n}"
454
+ },
455
+ {
456
+ "name": "MessageSource",
457
+ "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
458
+ },
459
+ {
460
+ "name": "MessageSourceMap",
461
+ "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'system-prompt': SystemPromptMessageSource;\n 'model-selection': { kind: 'model-selection'; } & ContextFormed;\n 'tool-registry': { kind: 'tool-registry'; };\n 'action-cards': { kind: 'action-cards'; through: SessionSeq; } & ContextFormed;\n 'runtime-context': { kind: 'runtime-context'; } & ContextFormed;\n 'team-message': TeamMessageSource;\n 'working-directory': { kind: 'working-directory'; };\n 'user-approval': { kind: 'user-approval'; } & ContextFormed;\n 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal; };\n 'retry-rpc': { kind: 'retry'; rpcId: SessionRequestId; clientTimeZone?: string; principal?: Principal; };\n 'skill-invocation': SkillInvocationSource;\n 'ptc-mode': { kind: 'ptc-mode'; };\n 'compact-checkpoint': CompactionCheckpointSource;\n 'cordis-host-runner': { kind: 'cordis-host-runner'; };\n 'user-question-reply': { kind: 'user-question-reply'; callId: ToolCallId; outcome: 'answered'; };\n goal: GoalMessageSource;\n 'plan-mode': { kind: 'plan-mode'; } & ContextFormed;\n schedule: { kind: 'schedule'; } & ContextFormed;\n 'session-reference': SessionReferenceSource;\n webhook: { readonly kind: 'webhook'; readonly provider: string; readonly source: WebhookSourceId; readonly deliveryId: WebhookDeliveryId; readonly ruleId: WebhookRuleId; readonly form: 'notice'; readonly summary: string; };\n}"
462
+ },
463
+ {
464
+ "name": "Model",
465
+ "declaration": "export interface Model {\n current(): Readonly<ModelSelection> | undefined;\n select(selection: Readonly<ModelSelection>): void;\n}"
466
+ },
467
+ {
468
+ "name": "ModelMessageSource",
469
+ "declaration": "export interface ModelMessageSource extends AssistantProviderMetadata {\n kind: 'model';\n}"
470
+ },
471
+ {
472
+ "name": "ModelSelection",
473
+ "declaration": "export interface ModelSelection {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n}"
474
+ },
475
+ {
476
+ "name": "OneShotScheduleDispatchChange",
477
+ "declaration": "export interface OneShotScheduleDispatchChange {\n readonly version: 1;\n readonly operation: 'dispatch';\n readonly id: ScheduleId;\n}"
478
+ },
479
+ {
480
+ "name": "OneShotSubagentDescriptorData",
481
+ "declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'one-shot';\n readonly label?: string;\n}"
482
+ },
483
+ {
484
+ "name": "OptionalSessionSeq",
485
+ "declaration": "export type OptionalSessionSeq = SessionSeq | null;"
486
+ },
487
+ {
488
+ "name": "PreparedReferencedMessage",
489
+ "declaration": "export interface PreparedReferencedMessage {\n content: ContentBlock[];\n additionalContext?: UserMessage;\n}"
490
+ },
491
+ {
492
+ "name": "Principal",
493
+ "declaration": "export type Principal = PrincipalMap[keyof PrincipalMap];"
494
+ },
495
+ {
496
+ "name": "PrincipalMap",
497
+ "declaration": "export interface PrincipalMap {\n owner: { readonly kind: 'owner'; };\n 'share-viewer': ShareViewerPrincipal;\n}"
498
+ },
499
+ {
500
+ "name": "ProviderRequestId",
501
+ "declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
502
+ },
503
+ {
504
+ "name": "PtcDispatchEventData",
505
+ "declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n meta?: JsonValue;\n error?: { name: string; code: string; reason?: string; };\n}"
506
+ },
507
+ {
508
+ "name": "PtcDispatchStartEventData",
509
+ "declaration": "export interface PtcDispatchStartEventData {\n rootCallId: ToolCallId;\n parentCallId: ToolCallId;\n subCallId: ToolCallId;\n name: string;\n arguments: unknown;\n}"
510
+ },
511
+ {
512
+ "name": "ReasoningBlock",
513
+ "declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
514
+ },
515
+ {
516
+ "name": "ReasoningEffortId",
517
+ "declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
518
+ },
519
+ {
520
+ "name": "ReplayEnvelope",
521
+ "declaration": "export interface ReplayEnvelope {\n response: unknown;\n blocks?: readonly unknown[];\n}"
522
+ },
523
+ {
524
+ "name": "RequestContext",
525
+ "declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n systemPromptUpdate?: SystemPromptUpdate;\n}"
526
+ },
527
+ {
528
+ "name": "RequestHeaderReason",
529
+ "declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change' | 'series';"
530
+ },
531
+ {
532
+ "name": "RetryId",
533
+ "declaration": "export type RetryId = Branded<'RetryId'>;"
534
+ },
535
+ {
536
+ "name": "SandboxMode",
537
+ "declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
538
+ },
539
+ {
540
+ "name": "ScheduleChange",
541
+ "declaration": "export type ScheduleChange = ScheduleCreateChange | ScheduleDeleteChange | ScheduleDispatchChange;"
542
+ },
543
+ {
544
+ "name": "ScheduleCreateChange",
545
+ "declaration": "export interface ScheduleCreateChange {\n readonly version: 1;\n readonly operation: 'create';\n readonly schedule: LegacyScheduleRecord;\n}"
546
+ },
547
+ {
548
+ "name": "ScheduleDeleteChange",
549
+ "declaration": "export interface ScheduleDeleteChange {\n readonly version: 1;\n readonly operation: 'delete';\n readonly id: ScheduleId;\n}"
550
+ },
551
+ {
552
+ "name": "ScheduleDispatchChange",
553
+ "declaration": "export type ScheduleDispatchChange = OneShotScheduleDispatchChange | EveryScheduleDispatchChange;"
554
+ },
555
+ {
556
+ "name": "ScheduleId",
557
+ "declaration": "export type ScheduleId = Branded<'ScheduleId'>;"
558
+ },
559
+ {
560
+ "name": "Session",
561
+ "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 get currentBatchPublication(): SessionEvent | undefined;\n append(inputs: readonly SessionEventInput[]): readonly SessionEvent[];\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}"
562
+ },
563
+ {
564
+ "name": "SessionEvent",
565
+ "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];"
566
+ },
567
+ {
568
+ "name": "SessionEventInput",
569
+ "declaration": "export type SessionEventInput = { [K in SessionEventType]: readonly [type: K, data: SessionEventMap[K], ...opts: K extends SurfaceEventType ? [opts: SurfaceIntent<K>] : []] }[SessionEventType];"
570
+ },
571
+ {
572
+ "name": "SessionEventMap",
573
+ "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'developer/message': { turn: number; step: number; message: DeveloperMessage; headerSeq?: SessionSeq; };\n 'system/message': { turn: number; step: number; message: SystemMessage; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; stream: AssistantStreamRecord[]; usage?: TokenUsage; interrupted?: true; };\n 'assistant/attempt': { turn: number; step: number; stream: AssistantStreamRecord[]; };\n 'tool/call': { turn: number; step: number; callId: ToolCallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; reason?: string; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': { inherited?: true; };\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'model/selection': ModelSelection;\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'agent-preset/selected': { agentPreset: string; };\n 'team/mode': { enabled: boolean; };\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'working-directory/change': { cwd: string; };\n 'image/offload': { targets: ImageOffloadTarget[]; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: ToolCallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@unieai/rabi-session/types').SessionSeq; };\n 'permission/preset': { preset: string; };\n 'subagent/descriptor': SubagentDescriptorData;\n 'subagent/catalog': SubagentCatalogEvent;\n 'job/registered': JobRegisteredData;\n 'job/settled': JobSettledData;\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; provider: string; model: string; maxTokens?: number; usage?: TokenUsage; } & ({ rawOutput: ContentBlock[]; llmStreamCall: true; } | { rawOutput?: ContentBlock[]; llmStreamCall?: never; });\n 'compaction/end': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; error?: string; };\n 'compaction/prune': { shadowedRange: { start: SessionSeq; end: SessionSeq; }; shadowedSeqs: SessionSeq[]; shadowedTokenCount: number; };\n 'tool/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'feedback/record': FeedbackRecord;\n 'llm/retry': LlmRetryEventData;\n 'llm/retry-started': LlmRetryStartedEventData;\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n 'plan/mode': { active: boolean; };\n 'schedule/change': ScheduleChange;\n 'session-log-deepseek/delivery-accepted': { sessionId: import('@unieai/rabi-session/types').SessionId; sessionFormatVersion?: number; throughSeq: import('@unieai/rabi-session/types').SessionSeq; };\n 'subagent/model-selection-policy': { allowedModels: AllowedModelRoute[]; };\n 'workspace/changes': { turn: number; };\n}"
574
+ },
575
+ {
576
+ "name": "SessionEventType",
577
+ "declaration": "export type SessionEventType = keyof SessionEventMap;"
578
+ },
579
+ {
580
+ "name": "SessionHeader",
581
+ "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}"
582
+ },
583
+ {
584
+ "name": "SessionId",
585
+ "declaration": "export type SessionId = Branded<'SessionId'>;"
586
+ },
587
+ {
588
+ "name": "SessionLogOffset",
589
+ "declaration": "export type SessionLogOffset = BrandedNumber<'SessionLogOffset'>;"
590
+ },
591
+ {
592
+ "name": "SessionReferenceCandidate",
593
+ "declaration": "export interface SessionReferenceCandidate {\n sessionId: SessionId;\n label: string;\n displayTitle?: string;\n cwd?: string;\n sameWorkspace: boolean;\n createdAt: number;\n}"
594
+ },
595
+ {
596
+ "name": "SessionReferenceInput",
597
+ "declaration": "export interface SessionReferenceInput {\n sessionId: SessionId;\n label?: string;\n}"
598
+ },
599
+ {
600
+ "name": "SessionReferenceMentionCandidate",
601
+ "declaration": "export interface SessionReferenceMentionCandidate extends SessionReferenceCandidate {\n mention: string;\n}"
602
+ },
603
+ {
604
+ "name": "SessionReferenceSource",
605
+ "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}"
606
+ },
607
+ {
608
+ "name": "SessionRequestId",
609
+ "declaration": "export type SessionRequestId = Branded<'session-request-id'>;"
610
+ },
611
+ {
612
+ "name": "SessionSeq",
613
+ "declaration": "export type SessionSeq = BrandedNumber<'SessionSeq'>;"
614
+ },
615
+ {
616
+ "name": "SessionSurface",
617
+ "declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n readonly contentGeneration: number;\n}"
618
+ },
619
+ {
620
+ "name": "SessionTitleEventData",
621
+ "declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: SessionSeq[];\n readonly source: SessionTitleSource;\n}"
622
+ },
623
+ {
624
+ "name": "SessionTitleModelIdentity",
625
+ "declaration": "export interface SessionTitleModelIdentity {\n readonly provider: string;\n readonly model: string;\n}"
626
+ },
627
+ {
628
+ "name": "SessionTitleProviderId",
629
+ "declaration": "export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;"
630
+ },
631
+ {
632
+ "name": "SessionTitleSource",
633
+ "declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelIdentity; } | { readonly kind: 'user'; };"
634
+ },
635
+ {
636
+ "name": "ShareViewerPrincipal",
637
+ "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}"
638
+ },
639
+ {
640
+ "name": "SkillInvocationSource",
641
+ "declaration": "export interface SkillInvocationSource {\n readonly kind: 'skill-invocation';\n readonly name: string;\n readonly form: 'instructions';\n}"
642
+ },
643
+ {
644
+ "name": "StreamChunk",
645
+ "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; };"
646
+ },
647
+ {
648
+ "name": "SubagentCatalogEvent",
649
+ "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; } | ({ readonly version: 3; readonly name: string; } & ({ readonly mode: 'continuable'; readonly label: string; } | { readonly mode: 'external'; readonly label?: string; })));"
650
+ },
651
+ {
652
+ "name": "SubagentDescriptorBase",
653
+ "declaration": "export interface SubagentDescriptorBase {\n readonly version: number;\n readonly mode: 'one-shot' | 'continuable';\n readonly provider: string;\n}"
654
+ },
655
+ {
656
+ "name": "SubagentDescriptorData",
657
+ "declaration": "export type SubagentDescriptorData = OneShotSubagentDescriptorData | ContinuableSubagentDescriptorData;"
658
+ },
659
+ {
660
+ "name": "SubagentResult",
661
+ "declaration": "export interface SubagentResult {\n readonly output: readonly ContentBlock[];\n readonly structured?: unknown;\n readonly diagnostic?: string;\n readonly stopReason: SubagentStopReason;\n}"
662
+ },
663
+ {
664
+ "name": "SubagentSettledMessageSource",
665
+ "declaration": "export interface SubagentSettledMessageSource {\n readonly kind: 'subagent-settled';\n readonly form: 'notice';\n readonly summary: string;\n readonly stopReason?: SubagentResult['stopReason'];\n readonly senderSessionId: SessionId;\n}"
666
+ },
667
+ {
668
+ "name": "SubagentStopReason",
669
+ "declaration": "export type SubagentStopReason = SubagentStopReasonMap[keyof SubagentStopReasonMap];"
670
+ },
671
+ {
672
+ "name": "SubagentStopReasonMap",
673
+ "declaration": "export interface SubagentStopReasonMap {\n completed: 'completed';\n aborted: 'aborted';\n error: 'error';\n 'max-tokens': 'max-tokens';\n refusal: 'refusal';\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 ownerName?: string;\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
+ "name": "WebhookDeliveryId",
801
+ "declaration": "export type WebhookDeliveryId = Branded<'WebhookDeliveryId'>;"
802
+ },
803
+ {
804
+ "name": "WebhookRuleId",
805
+ "declaration": "export type WebhookRuleId = Branded<'WebhookRuleId'>;"
806
+ },
807
+ {
808
+ "name": "WebhookSourceId",
809
+ "declaration": "export type WebhookSourceId = Branded<'WebhookSourceId'>;"
810
+ }
811
+ ]
812
+ }
813
+ ],
814
+ "events": [],
815
+ "objects": []
816
+ },
817
+ }