@robiteame/dsh-pi-agent-session-tree 0.1.0
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.
- package/README.i18n.yaml +6 -0
- package/README.md +98 -0
- package/README.zh.md +72 -0
- package/lib/index.js +1190 -0
- package/lib/invariant.js +12 -0
- package/lib/typert.host.d.ts +1 -0
- package/lib/typert.host.js +762 -0
- package/lib/typert.remote-client.d.ts +2 -0
- package/lib/typert.remote-client.js +247 -0
- package/lib/types/client.d.ts +8 -0
- package/lib/types/index.d.ts +130 -0
- package/lib/types/invariant.d.ts +15 -0
- package/lib/types/session-event-adapter.d.ts +28 -0
- package/lib/types/session-tree-marker.d.ts +13 -0
- package/lib/types/session-tree-sidecar.d.ts +29 -0
- package/lib/types/session-tree.d.ts +182 -0
- package/lib/types/types.d.ts +185 -0
- package/package.json +77 -0
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const JsonValueRemoteCodec$schema = z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))])
|
|
5
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_fork_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
6
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_fork_parameter_1$schema = z.string()
|
|
7
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_fork_parameter_2$schema = z.string()
|
|
8
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_fork_result$schema = z.object({
|
|
9
|
+
'cursor': z.string(),
|
|
10
|
+
'branch': z.string(),
|
|
11
|
+
'forkCount': z.number(),
|
|
12
|
+
})
|
|
13
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_jump_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
14
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_jump_parameter_1$schema = z.union([z.literal(null), z.string()])
|
|
15
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_jump_result$schema = z.object({
|
|
16
|
+
'cursor': z.union([z.literal(null), z.string()]).readonly(),
|
|
17
|
+
'messages': z.array(z.object({
|
|
18
|
+
'role': z.union([z.literal("system"), z.literal("user"), z.literal("assistant"), z.literal("tool")]).readonly(),
|
|
19
|
+
'content': z.string().readonly(),
|
|
20
|
+
'name': z.string().readonly().optional(),
|
|
21
|
+
'toolCallId': z.string().readonly().optional(),
|
|
22
|
+
})).readonly(),
|
|
23
|
+
})
|
|
24
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_list_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
25
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_list_result$schema = z.object({
|
|
26
|
+
'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
27
|
+
'cursor': z.union([z.literal(null), z.string()]).readonly(),
|
|
28
|
+
'activeBranch': z.string().readonly(),
|
|
29
|
+
'selectedNodeId': z.union([z.literal(null), z.string()]).readonly().optional(),
|
|
30
|
+
'branchHeads': z.record(z.string(), z.string()).readonly().optional(),
|
|
31
|
+
'nodes': z.array(z.object({
|
|
32
|
+
'nodeId': z.string().readonly(),
|
|
33
|
+
'parentId': z.union([z.literal(null), z.string()]).readonly(),
|
|
34
|
+
'forkCount': z.number().readonly().optional(),
|
|
35
|
+
'type': z.union([z.literal("message"), z.literal("tool_call"), z.literal("tool_result"), z.literal("model_change"), z.literal("compaction"), z.literal("branch_summary"), z.literal("custom")]).readonly().optional(),
|
|
36
|
+
'branch': z.string().readonly(),
|
|
37
|
+
'summary': z.string().readonly(),
|
|
38
|
+
'createdAt': z.string().readonly(),
|
|
39
|
+
'message': z.object({
|
|
40
|
+
'role': z.union([z.literal("system"), z.literal("user"), z.literal("assistant"), z.literal("tool")]).readonly(),
|
|
41
|
+
'content': z.string().readonly(),
|
|
42
|
+
'name': z.string().readonly().optional(),
|
|
43
|
+
'toolCallId': z.string().readonly().optional(),
|
|
44
|
+
}).readonly().optional(),
|
|
45
|
+
'content': z.array(z.union([z.object({
|
|
46
|
+
'type': z.literal("text").readonly(),
|
|
47
|
+
'text': z.string().readonly(),
|
|
48
|
+
}), z.object({
|
|
49
|
+
'type': z.literal("tool_call").readonly(),
|
|
50
|
+
'id': z.string().readonly(),
|
|
51
|
+
'name': z.string().readonly(),
|
|
52
|
+
'arguments': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))]).readonly(),
|
|
53
|
+
}), z.object({
|
|
54
|
+
'type': z.literal("tool_result").readonly(),
|
|
55
|
+
'toolCallId': z.string().readonly(),
|
|
56
|
+
'content': z.string().readonly(),
|
|
57
|
+
'isError': z.boolean().readonly().optional(),
|
|
58
|
+
}), z.object({
|
|
59
|
+
'type': z.literal("reasoning").readonly(),
|
|
60
|
+
'text': z.string().readonly(),
|
|
61
|
+
})])).readonly().optional(),
|
|
62
|
+
'model': z.string().readonly().optional(),
|
|
63
|
+
'usage': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))])).readonly().optional(),
|
|
64
|
+
'cost': z.number().readonly().optional(),
|
|
65
|
+
'error': z.string().readonly().optional(),
|
|
66
|
+
'metadata': z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))])).readonly().optional(),
|
|
67
|
+
})).readonly(),
|
|
68
|
+
'branches': z.array(z.object({
|
|
69
|
+
'name': z.string().readonly(),
|
|
70
|
+
'headId': z.string().readonly(),
|
|
71
|
+
'nodeIds': z.array(z.string()).readonly(),
|
|
72
|
+
})).readonly(),
|
|
73
|
+
})
|
|
74
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_session_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
75
|
+
const _robiteame_dsh_pi_agent_session_tree_sessionTree_session_result$schema = z.object({
|
|
76
|
+
'branchHeads': z.record(z.string(), z.string()).readonly().optional(),
|
|
77
|
+
'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
78
|
+
'nodeCount': z.number().readonly(),
|
|
79
|
+
'messageCount': z.number().readonly(),
|
|
80
|
+
'branchCount': z.number().readonly(),
|
|
81
|
+
'cursor': z.union([z.literal(null), z.string()]).readonly(),
|
|
82
|
+
'activeBranch': z.string().readonly(),
|
|
83
|
+
'selectedNodeId': z.union([z.literal(null), z.string()]).readonly().optional(),
|
|
84
|
+
'currentPathLength': z.number().readonly(),
|
|
85
|
+
'usage': z.record(z.string(), z.number()).readonly().optional(),
|
|
86
|
+
'tokenCount': z.number().readonly().optional(),
|
|
87
|
+
'cost': z.number().readonly().optional(),
|
|
88
|
+
'snapshotVersion': z.literal(1).readonly(),
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
export const TYPERT = {
|
|
92
|
+
package: '@robiteame/dsh-pi-agent-session-tree',
|
|
93
|
+
face: 'host',
|
|
94
|
+
schemas: [
|
|
95
|
+
],
|
|
96
|
+
invocations: [
|
|
97
|
+
{
|
|
98
|
+
id: '@robiteame/dsh-pi-agent-session-tree#sessionTree/fork',
|
|
99
|
+
service: 'sessionTree',
|
|
100
|
+
namespace: 'sessionTree',
|
|
101
|
+
method: 'fork',
|
|
102
|
+
invocation: { kind: 'direct' },
|
|
103
|
+
scope: {
|
|
104
|
+
context: 'agent',
|
|
105
|
+
wire: 'agentId',
|
|
106
|
+
},
|
|
107
|
+
parameters: [
|
|
108
|
+
{
|
|
109
|
+
name: 'agent',
|
|
110
|
+
wire: 'agentId',
|
|
111
|
+
source: 'lookup',
|
|
112
|
+
lookup: 'agent',
|
|
113
|
+
codec: {
|
|
114
|
+
mode: 'strict',
|
|
115
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
116
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_fork_parameter_0$schema,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'nodeId',
|
|
121
|
+
wire: 'nodeId',
|
|
122
|
+
source: 'json',
|
|
123
|
+
codec: {
|
|
124
|
+
mode: 'strict',
|
|
125
|
+
typeSymbol: '@robiteame/dsh-pi-agent-session-tree#sessionTree/fork:nodeId',
|
|
126
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_fork_parameter_1$schema,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'branch',
|
|
131
|
+
wire: 'branch',
|
|
132
|
+
source: 'json',
|
|
133
|
+
codec: {
|
|
134
|
+
mode: 'strict',
|
|
135
|
+
typeSymbol: '@robiteame/dsh-pi-agent-session-tree#sessionTree/fork:branch',
|
|
136
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_fork_parameter_2$schema,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
result: {
|
|
141
|
+
mode: 'strict',
|
|
142
|
+
typeSymbol: '@robiteame/dsh-pi-agent-session-tree#sessionTree/fork:result',
|
|
143
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_fork_result$schema,
|
|
144
|
+
},
|
|
145
|
+
sourceLocation: {"file":"packages/extensions/pi-agent-session-tree/src/index.ts","line":188,"column":3},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: '@robiteame/dsh-pi-agent-session-tree#sessionTree/jump',
|
|
149
|
+
service: 'sessionTree',
|
|
150
|
+
namespace: 'sessionTree',
|
|
151
|
+
method: 'jump',
|
|
152
|
+
invocation: { kind: 'direct' },
|
|
153
|
+
scope: {
|
|
154
|
+
context: 'agent',
|
|
155
|
+
wire: 'agentId',
|
|
156
|
+
},
|
|
157
|
+
parameters: [
|
|
158
|
+
{
|
|
159
|
+
name: 'agent',
|
|
160
|
+
wire: 'agentId',
|
|
161
|
+
source: 'lookup',
|
|
162
|
+
lookup: 'agent',
|
|
163
|
+
codec: {
|
|
164
|
+
mode: 'strict',
|
|
165
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
166
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_jump_parameter_0$schema,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'nodeId',
|
|
171
|
+
wire: 'nodeId',
|
|
172
|
+
source: 'json',
|
|
173
|
+
codec: {
|
|
174
|
+
mode: 'strict',
|
|
175
|
+
typeSymbol: '@robiteame/dsh-pi-agent-session-tree#sessionTree/jump:nodeId',
|
|
176
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_jump_parameter_1$schema,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
result: {
|
|
181
|
+
mode: 'strict',
|
|
182
|
+
typeSymbol: '@robiteame/dsh-pi-agent-session-tree/client#JumpView',
|
|
183
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_jump_result$schema,
|
|
184
|
+
},
|
|
185
|
+
sourceLocation: {"file":"packages/extensions/pi-agent-session-tree/src/index.ts","line":158,"column":3},
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
id: '@robiteame/dsh-pi-agent-session-tree#sessionTree/list',
|
|
189
|
+
service: 'sessionTree',
|
|
190
|
+
namespace: 'sessionTree',
|
|
191
|
+
method: 'list',
|
|
192
|
+
invocation: { kind: 'direct' },
|
|
193
|
+
scope: {
|
|
194
|
+
context: 'agent',
|
|
195
|
+
wire: 'agentId',
|
|
196
|
+
},
|
|
197
|
+
parameters: [
|
|
198
|
+
{
|
|
199
|
+
name: 'agent',
|
|
200
|
+
wire: 'agentId',
|
|
201
|
+
source: 'lookup',
|
|
202
|
+
lookup: 'agent',
|
|
203
|
+
codec: {
|
|
204
|
+
mode: 'strict',
|
|
205
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
206
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_list_parameter_0$schema,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
result: {
|
|
211
|
+
mode: 'strict',
|
|
212
|
+
typeSymbol: '@robiteame/dsh-pi-agent-session-tree/client#SessionTreeView',
|
|
213
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_list_result$schema,
|
|
214
|
+
},
|
|
215
|
+
sourceLocation: {"file":"packages/extensions/pi-agent-session-tree/src/index.ts","line":132,"column":3},
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: '@robiteame/dsh-pi-agent-session-tree#sessionTree/session',
|
|
219
|
+
service: 'sessionTree',
|
|
220
|
+
namespace: 'sessionTree',
|
|
221
|
+
method: 'session',
|
|
222
|
+
invocation: { kind: 'direct' },
|
|
223
|
+
scope: {
|
|
224
|
+
context: 'agent',
|
|
225
|
+
wire: 'agentId',
|
|
226
|
+
},
|
|
227
|
+
parameters: [
|
|
228
|
+
{
|
|
229
|
+
name: 'agent',
|
|
230
|
+
wire: 'agentId',
|
|
231
|
+
source: 'lookup',
|
|
232
|
+
lookup: 'agent',
|
|
233
|
+
codec: {
|
|
234
|
+
mode: 'strict',
|
|
235
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
236
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_session_parameter_0$schema,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
result: {
|
|
241
|
+
mode: 'strict',
|
|
242
|
+
typeSymbol: '@robiteame/dsh-pi-agent-session-tree/client#SessionTreeSessionInfo',
|
|
243
|
+
schema: _robiteame_dsh_pi_agent_session_tree_sessionTree_session_result$schema,
|
|
244
|
+
},
|
|
245
|
+
sourceLocation: {"file":"packages/extensions/pi-agent-session-tree/src/index.ts","line":211,"column":3},
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
model: {
|
|
249
|
+
"services": [
|
|
250
|
+
{
|
|
251
|
+
"description": "Remote-only service backing the browser tree panel.",
|
|
252
|
+
"summary": "Remote-only service backing the browser tree panel.",
|
|
253
|
+
"tags": [],
|
|
254
|
+
"jsDoc": "/** Remote-only service backing the browser tree panel. */",
|
|
255
|
+
"key": "sessionTree",
|
|
256
|
+
"exportName": "SessionTreeService",
|
|
257
|
+
"members": [
|
|
258
|
+
{
|
|
259
|
+
"kind": "method",
|
|
260
|
+
"name": "list",
|
|
261
|
+
"signature": "@Remote('list') list(agent: Agent): SessionTreeView",
|
|
262
|
+
"summary": "Read the current tree view (nodes, branches, cursor) for one agent.",
|
|
263
|
+
"jsDoc": "/**\n * Read the current tree view (nodes, branches, cursor) for one agent.\n * The tree is created on first read, so an empty panel is valid.\n * @param agent - owning live agent.\n * @returns the complete view for the panel.\n */"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"kind": "method",
|
|
267
|
+
"name": "jump",
|
|
268
|
+
"signature": "@Remote('jump') jump(agent: Agent, nodeId: string | null): JumpView",
|
|
269
|
+
"summary": "Move the SessionTree cursor to an existing node and return its root-to-node path through the context operation.",
|
|
270
|
+
"jsDoc": "/**\n * Move the SessionTree cursor to an existing node and return its root-to-node\n * path through the context operation. This also selects the same path on\n * Harness' model-visible Session surface, so the next turn genuinely branches\n * from this leaf instead of merely changing the browser projection.\n * @param agent - owning live agent.\n * @param nodeId - target node, or null to reset before the first node.\n * @returns the new cursor and reconstructed messages.\n * @throws Error when the node does not exist (settles as the standard error envelope).\n */"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"kind": "method",
|
|
274
|
+
"name": "fork",
|
|
275
|
+
"signature": "@Remote('fork') fork(agent: Agent, nodeId: string, branch: string): { cursor: string; branch: string; forkCount: number }",
|
|
276
|
+
"summary": "Position a named branch at a historical node for the next append.",
|
|
277
|
+
"jsDoc": "/**\n * Position a named branch at a historical node for the next append.\n * @param agent - owning live agent.\n * @param nodeId - historical node to branch from.\n * @param branch - non-empty branch label.\n * @returns the parked cursor, branch label, and direct-child fork count.\n */"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"kind": "method",
|
|
281
|
+
"name": "session",
|
|
282
|
+
"signature": "@Remote('session') session(agent: Agent): SessionTreeSessionInfo",
|
|
283
|
+
"summary": "Read compact status metadata for the current session tree.",
|
|
284
|
+
"jsDoc": "/**\n * Read compact status metadata for the current session tree.\n * @param agent - owning live agent.\n * @returns current tree counts, cursor, branches, and usage metadata.\n */"
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"types": [
|
|
288
|
+
{
|
|
289
|
+
"name": "Agent",
|
|
290
|
+
"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}"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "AgentCancelCause",
|
|
294
|
+
"declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"name": "AgentOptions",
|
|
298
|
+
"declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId;\n maxTokens?: number;\n subagentDepth?: number;\n}"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"name": "AgentStatus",
|
|
302
|
+
"declaration": "export type AgentStatus = 'idle' | 'running';"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"name": "ApprovalOutcome",
|
|
306
|
+
"declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"name": "ApprovalPolicy",
|
|
310
|
+
"declaration": "export type ApprovalPolicy = 'ask' | 'never';"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "ApprovalRequestId",
|
|
314
|
+
"declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "AssistantMessage",
|
|
318
|
+
"declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "AssistantProvenance",
|
|
322
|
+
"declaration": "export interface AssistantProvenance {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"name": "AttachmentId",
|
|
326
|
+
"declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"name": "BranchView",
|
|
330
|
+
"declaration": "export interface BranchView {\n readonly name: string;\n readonly headId: string;\n readonly nodeIds: readonly string[];\n}"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"name": "Branded",
|
|
334
|
+
"declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"name": "CancelOptions",
|
|
338
|
+
"declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "CommandId",
|
|
342
|
+
"declaration": "export type CommandId = Branded<'CommandId'>;"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "CommandSource",
|
|
346
|
+
"declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"name": "CommandSourceMap",
|
|
350
|
+
"declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"name": "CompactionId",
|
|
354
|
+
"declaration": "export type CompactionId = Branded<'CompactionId'>;"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"name": "ContentBlock",
|
|
358
|
+
"declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"name": "ContentBlockMap",
|
|
362
|
+
"declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n 'tool-call': ToolCallBlock;\n 'tool-result': ToolResultBlock;\n}"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "ContentBlockType",
|
|
366
|
+
"declaration": "export type ContentBlockType = keyof ContentBlockMap;"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"name": "ContentPart",
|
|
370
|
+
"declaration": "export type ContentPart = { readonly type: 'text'; readonly text: string; } | { readonly type: 'tool_call'; readonly id: string; readonly name: string; readonly arguments: JsonValue; } | { readonly type: 'tool_result'; readonly toolCallId: string; readonly content: string; readonly isError?: boolean; } | { readonly type: 'reasoning'; readonly text: string; };"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"name": "ContextFormed",
|
|
374
|
+
"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'; };"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"name": "ContextSnapshotSection",
|
|
378
|
+
"declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"name": "ContinuableSubagentDescriptorData",
|
|
382
|
+
"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}"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"name": "CoordinatorMessageSource",
|
|
386
|
+
"declaration": "export interface CoordinatorMessageSource {\n readonly kind: 'coordinator';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"name": "EpochHeader",
|
|
390
|
+
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n system?: string;\n tools?: ToolSchema[];\n}"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"name": "FinishReason",
|
|
394
|
+
"declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"name": "FinishReasonMap",
|
|
398
|
+
"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}"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"name": "GoalBlockReason",
|
|
402
|
+
"declaration": "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"name": "GoalChangeMeta",
|
|
406
|
+
"declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"name": "GoalClearChangeMeta",
|
|
410
|
+
"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}"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"name": "GoalId",
|
|
414
|
+
"declaration": "export type GoalId = Branded<'GoalId'>;"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"name": "GoalMessageSource",
|
|
418
|
+
"declaration": "export interface GoalMessageSource {\n readonly kind: 'goal';\n readonly goalId: GoalId;\n readonly revision: number;\n readonly round: number;\n}"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"name": "GoalOperation",
|
|
422
|
+
"declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"name": "GoalPhase",
|
|
426
|
+
"declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"name": "GoalRef",
|
|
430
|
+
"declaration": "export interface GoalRef {\n readonly id: GoalId;\n readonly revision: number;\n}"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"name": "GoalSnapshot",
|
|
434
|
+
"declaration": "export interface GoalSnapshot extends GoalRef {\n readonly objective: string;\n readonly phase: GoalPhase;\n readonly blockedReason?: GoalBlockReason;\n readonly maxGoalRounds: number;\n}"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"name": "GoalSnapshotChangeMeta",
|
|
438
|
+
"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}"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"name": "ImageAttachmentRef",
|
|
442
|
+
"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}"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "ImageBlock",
|
|
446
|
+
"declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n}"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"name": "ImageMediaType",
|
|
450
|
+
"declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
"name": "Inbox",
|
|
454
|
+
"declaration": "export class Inbox {\n get nextTurn(): readonly UserMessage[];\n get nextStep(): readonly UserMessage[];\n get hasPending(): boolean;\n clear(): void;\n claim(target: InboxTarget, turn: number): UserMessage[];\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}"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"name": "InboxTarget",
|
|
458
|
+
"declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"name": "JsonValue",
|
|
462
|
+
"declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"name": "JsonValue",
|
|
466
|
+
"declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"name": "JumpView",
|
|
470
|
+
"declaration": "export interface JumpView {\n readonly cursor: string | null;\n readonly messages: readonly LlmMessage[];\n}"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "LlmCallConfig",
|
|
474
|
+
"declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"name": "LlmCallConfigAdapterDefaults",
|
|
478
|
+
"declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"name": "LlmFailure",
|
|
482
|
+
"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}"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"name": "LlmMessage",
|
|
486
|
+
"declaration": "export interface LlmMessage {\n readonly role: LlmRole;\n readonly content: string;\n readonly name?: string;\n readonly toolCallId?: string;\n}"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"name": "LlmRole",
|
|
490
|
+
"declaration": "export type LlmRole = 'system' | 'user' | 'assistant' | 'tool';"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"name": "Message",
|
|
494
|
+
"declaration": "export interface Message {\n readonly id: MessageId;\n readonly role: 'system' | 'user' | 'assistant';\n readonly content: ContentBlock[];\n readonly source: MessageSource;\n}"
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"name": "MessageId",
|
|
498
|
+
"declaration": "export type MessageId = Branded<'MessageId'>;"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "MessageSource",
|
|
502
|
+
"declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"name": "MessageSourceMap",
|
|
506
|
+
"declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n 'user-rpc': { kind: 'user'; rpcId: SessionRequestId; clientTimeZone?: string; };\n coordinator: CoordinatorMessageSource;\n 'subagent-report': SubagentReportMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'session-reference': SessionReferenceSource;\n}"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"name": "ModelMessageSource",
|
|
510
|
+
"declaration": "export interface ModelMessageSource extends AssistantProvenance {\n kind: 'model';\n}"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"name": "ModelSelection",
|
|
514
|
+
"declaration": "export interface ModelSelection {\n readonly provider: string;\n readonly model: string;\n readonly reasoningEffort?: string;\n}"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"name": "OneShotSubagentDescriptorData",
|
|
518
|
+
"declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'one-shot';\n readonly label?: string;\n}"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"name": "ProviderRequestId",
|
|
522
|
+
"declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"name": "PtcDispatchEventData",
|
|
526
|
+
"declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n}"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
"name": "PtcDispatchStartEventData",
|
|
530
|
+
"declaration": "export interface PtcDispatchStartEventData {\n rootCallId: ToolCallId;\n parentCallId: ToolCallId;\n subCallId: ToolCallId;\n name: string;\n arguments: unknown;\n}"
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"name": "ReasoningBlock",
|
|
534
|
+
"declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"name": "ReasoningEffortId",
|
|
538
|
+
"declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"name": "ReplayEnvelope",
|
|
542
|
+
"declaration": "export interface ReplayEnvelope {\n response: unknown;\n blocks?: readonly unknown[];\n}"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "RequestContext",
|
|
546
|
+
"declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n}"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"name": "RequestHeaderReason",
|
|
550
|
+
"declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change' | 'series';"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"name": "SandboxMode",
|
|
554
|
+
"declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
"name": "Session",
|
|
558
|
+
"declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n get id(): SessionId;\n readonly firstLiveSeq: number;\n get events(): readonly SessionEvent[];\n get seq(): number;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []): SessionEvent<T>;\n selectMessageSurface(nodes: readonly number[] | null): void;\n messageSurfaceNodes(): readonly number[];\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"name": "SessionEvent",
|
|
562
|
+
"declaration": "export type SessionEvent<T extends SessionEventType = SessionEventType> = { [K in SessionEventType]: { type: K; seq: number; time: number; data: SessionEventMap[K]; ignorable?: true; } & (K extends SurfaceEventType ? { sourceEventSeqs?: number[]; surfaceOp?: SurfaceOp; } : object) }[T];"
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"name": "SessionEventMap",
|
|
566
|
+
"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 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; interrupted?: true; };\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; }; meta?: JsonValue; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; startsSeries?: true; };\n 'request/context': RequestContext;\n 'session/end-seed': Record<string, never>;\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\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 'tool/code-dispatch-start': PtcDispatchStartEventData;\n 'tool/code-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'session/title': SessionTitleEventData;\n 'todo/write': { todos: TodoItem[]; };\n 'model/selection': ModelSelection;\n 'subagent/descriptor': SubagentDescriptorData;\n 'sandbox/mode': { mode: SandboxMode; source?: 'delegation'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: number; };\n 'team/member': { version: 1; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 1; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 1; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 1; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'session-tree/node': { node: TreeNode; };\n 'session-tree/cursor': { nodeId: string | null; };\n 'session-tree/branch': { nodeId: string; branch: string; };\n 'session-tree/selection': { nodeId: string; };\n 'session-tree/snapshot': { snapshot: SessionTreeSnapshot; };\n 'compaction/start': { compactionId: CompactionId; sourceCommandId?: CommandId; turn: number | null; };\n 'compaction/summary': { compactionId: CompactionId; sourceCommandId?: CommandId; summary: ContentBlock[]; shadowedRange: { start: number; end: number; }; shadowedSeqs: number[]; 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: number; end: number; }; shadowedSeqs: number[]; shadowedTokenCount: number; };\n}"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"name": "SessionEventType",
|
|
570
|
+
"declaration": "export type SessionEventType = keyof SessionEventMap;"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"name": "SessionHeader",
|
|
574
|
+
"declaration": "export interface SessionHeader {\n readonly version: number;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly seedLength?: number;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"name": "SessionId",
|
|
578
|
+
"declaration": "export type SessionId = Branded<'SessionId'>;"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"name": "SessionReferenceSource",
|
|
582
|
+
"declaration": "export interface SessionReferenceSource {\n kind: 'session-reference';\n form: 'recall';\n version: 1;\n references: { sessionId: string; label: string; capturedThroughSeq: number | null; compacted: boolean; originalMessages: number; retainedMessages: number; omittedMessages: number; omittedBytes: number; truncated: boolean; inputIndex: number; }[];\n}"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"name": "SessionRequestId",
|
|
586
|
+
"declaration": "export type SessionRequestId = Branded<'session-request-id'>;"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"name": "SessionSurface",
|
|
590
|
+
"declaration": "export interface SessionSurface {\n readonly nodes: readonly number[];\n readonly replaceGeneration: number;\n}"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
"name": "SessionTitleEventData",
|
|
594
|
+
"declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: number[];\n readonly source: SessionTitleSource;\n}"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"name": "SessionTitleModelProvenance",
|
|
598
|
+
"declaration": "export interface SessionTitleModelProvenance {\n readonly provider: string;\n readonly model: string;\n}"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"name": "SessionTitleProviderId",
|
|
602
|
+
"declaration": "export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"name": "SessionTitleSource",
|
|
606
|
+
"declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelProvenance; } | { readonly kind: 'user'; };"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"name": "SessionTreeSessionInfo",
|
|
610
|
+
"declaration": "export interface SessionTreeSessionInfo {\n readonly branchHeads?: Record<string, string>;\n readonly sessionId: SessionId;\n readonly nodeCount: number;\n readonly messageCount: number;\n readonly branchCount: number;\n readonly cursor: string | null;\n readonly activeBranch: string;\n readonly selectedNodeId?: string | null;\n readonly currentPathLength: number;\n readonly usage?: Record<string, number>;\n readonly tokenCount?: number;\n readonly cost?: number;\n readonly snapshotVersion: 1;\n}"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
"name": "SessionTreeSnapshot",
|
|
614
|
+
"declaration": "export interface SessionTreeSnapshot {\n readonly version: 1;\n readonly sessionId: string;\n readonly cursor: string | null;\n readonly activeBranch: string;\n readonly nativeEventSeq?: number;\n readonly branchHeads?: Record<string, string>;\n readonly selectedNodeId?: string | null;\n readonly nodes: readonly TreeNode[];\n}"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"name": "SessionTreeView",
|
|
618
|
+
"declaration": "export interface SessionTreeView {\n readonly sessionId: SessionId;\n readonly cursor: string | null;\n readonly activeBranch: string;\n readonly selectedNodeId?: string | null;\n readonly branchHeads?: Record<string, string>;\n readonly nodes: readonly TreeNode[];\n readonly branches: readonly BranchView[];\n}"
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"name": "SkillInvocationSource",
|
|
622
|
+
"declaration": "export interface SkillInvocationSource {\n readonly kind: 'skill-invocation';\n readonly name: string;\n readonly form: 'instructions';\n}"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"name": "StreamChunk",
|
|
626
|
+
"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; };"
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"name": "SubagentDescriptorBase",
|
|
630
|
+
"declaration": "export interface SubagentDescriptorBase {\n readonly version: number;\n readonly mode: 'one-shot' | 'continuable';\n readonly provider: string;\n}"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "SubagentDescriptorData",
|
|
634
|
+
"declaration": "export type SubagentDescriptorData = OneShotSubagentDescriptorData | ContinuableSubagentDescriptorData;"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"name": "SubagentReportMessageSource",
|
|
638
|
+
"declaration": "export interface SubagentReportMessageSource {\n readonly kind: 'subagent-report';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"name": "SubagentSettledMessageSource",
|
|
642
|
+
"declaration": "export interface SubagentSettledMessageSource {\n readonly kind: 'subagent-settled';\n readonly form: 'notice';\n readonly summary: string;\n readonly senderSessionId: SessionId;\n}"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
"name": "SurfaceEventType",
|
|
646
|
+
"declaration": "export type SurfaceEventType = 'user/message' | 'assistant/message' | 'tool/result';"
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"name": "SurfaceIntent",
|
|
650
|
+
"declaration": "export interface SurfaceIntent {\n surfaceOp: SurfaceOp;\n sourceEventSeqs?: number[];\n}"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"name": "SurfaceOp",
|
|
654
|
+
"declaration": "export type SurfaceOp = 'append' | { op: 'replace'; start: number; end: number; };"
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
"name": "TeamId",
|
|
658
|
+
"declaration": "export type TeamId = Branded<'TeamId'>;"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"name": "TeamMemberPhase",
|
|
662
|
+
"declaration": "export type TeamMemberPhase = 'provisioning' | 'active' | 'failed';"
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
"name": "TeamMemberSnapshot",
|
|
666
|
+
"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}"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"name": "TeamMessageId",
|
|
670
|
+
"declaration": "export type TeamMessageId = Branded<'TeamMessageId'>;"
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"name": "TeamMessageSnapshot",
|
|
674
|
+
"declaration": "export interface TeamMessageSnapshot {\n readonly id: TeamMessageId;\n readonly senderId: SessionId;\n readonly senderName: string;\n readonly targetId: SessionId;\n readonly delivery: 'quiet' | 'wakeup';\n readonly content: ContentBlock[];\n}"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"name": "TeamMessageSource",
|
|
678
|
+
"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}"
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
"name": "TeamTaskId",
|
|
682
|
+
"declaration": "export type TeamTaskId = Branded<'TeamTaskId'>;"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
"name": "TeamTaskSnapshot",
|
|
686
|
+
"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}"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
"name": "TeamTaskStatus",
|
|
690
|
+
"declaration": "export type TeamTaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
"name": "TextBlock",
|
|
694
|
+
"declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"name": "TodoItem",
|
|
698
|
+
"declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
"name": "TokenUsage",
|
|
702
|
+
"declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"name": "ToolCallBlock",
|
|
706
|
+
"declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: ToolCallId;\n name: string;\n arguments: string;\n}"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"name": "ToolCallId",
|
|
710
|
+
"declaration": "export type ToolCallId = Branded<'ToolCallId'>;"
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
"name": "ToolMessageSource",
|
|
714
|
+
"declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
"name": "ToolRestriction",
|
|
718
|
+
"declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
"name": "ToolResultBlock",
|
|
722
|
+
"declaration": "export interface ToolResultBlock {\n type: 'tool-result';\n toolCallId: ToolCallId;\n content: ContentBlock[];\n isError?: boolean;\n}"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"name": "ToolResultMessage",
|
|
726
|
+
"declaration": "export interface ToolResultMessage extends Message {\n readonly role: 'user';\n readonly content: [ToolResultBlock];\n readonly source: ToolMessageSource;\n}"
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
"name": "ToolSchema",
|
|
730
|
+
"declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"name": "TreeEntryType",
|
|
734
|
+
"declaration": "export type TreeEntryType = 'message' | 'tool_call' | 'tool_result' | 'model_change' | 'compaction' | 'branch_summary' | 'custom';"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"name": "TreeNode",
|
|
738
|
+
"declaration": "export interface TreeNode {\n readonly nodeId: string;\n readonly parentId: string | null;\n readonly forkCount?: number;\n readonly type?: TreeEntryType;\n readonly branch: string;\n readonly summary: string;\n readonly createdAt: string;\n readonly message?: LlmMessage;\n readonly content?: readonly ContentPart[];\n readonly model?: string;\n readonly usage?: Record<string, JsonValue>;\n readonly cost?: number;\n readonly error?: string;\n readonly metadata?: Record<string, JsonValue>;\n}"
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
"name": "TurnEndCancelCause",
|
|
742
|
+
"declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
"name": "TurnEndReason",
|
|
746
|
+
"declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
"name": "TurnEndReasonMap",
|
|
750
|
+
"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}"
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
"name": "UserMessage",
|
|
754
|
+
"declaration": "export interface UserMessage extends Message {\n readonly role: 'user';\n}"
|
|
755
|
+
}
|
|
756
|
+
]
|
|
757
|
+
}
|
|
758
|
+
],
|
|
759
|
+
"events": [],
|
|
760
|
+
"objects": []
|
|
761
|
+
},
|
|
762
|
+
}
|