@deepseek-ai/dsh-experimental-agent-team 0.1.5-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +220 -0
- package/README.zh.md +220 -0
- package/lib/index.js +1894 -0
- package/lib/invariant.js +361 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +867 -0
- package/lib/typert.remote-client.d.ts +32 -0
- package/lib/typert.remote-client.js +210 -0
- package/lib/types/activity.d.ts +23 -0
- package/lib/types/activity.js +85 -0
- package/lib/types/client.d.ts +3 -0
- package/lib/types/client.js +3 -0
- package/lib/types/error.d.ts +13 -0
- package/lib/types/error.js +23 -0
- package/lib/types/index.d.ts +137 -0
- package/lib/types/index.js +313 -0
- package/lib/types/invariant.d.ts +9 -0
- package/lib/types/invariant.js +26 -0
- package/lib/types/journal.d.ts +39 -0
- package/lib/types/journal.js +63 -0
- package/lib/types/lifecycle.d.ts +33 -0
- package/lib/types/lifecycle.js +85 -0
- package/lib/types/mailbox.d.ts +78 -0
- package/lib/types/mailbox.js +292 -0
- package/lib/types/persisted.d.ts +20 -0
- package/lib/types/persisted.js +20 -0
- package/lib/types/projection.d.ts +48 -0
- package/lib/types/projection.js +260 -0
- package/lib/types/roster.d.ts +113 -0
- package/lib/types/roster.js +446 -0
- package/lib/types/session-message.d.ts +11 -0
- package/lib/types/session-message.js +23 -0
- package/lib/types/task-board.d.ts +62 -0
- package/lib/types/task-board.js +275 -0
- package/lib/types/task-graph.d.ts +21 -0
- package/lib/types/task-graph.js +62 -0
- package/lib/types/types.d.ts +206 -0
- package/lib/types/types.js +26 -0
- package/lib/types/validation.d.ts +16 -0
- package/lib/types/validation.js +33 -0
- package/package.json +88 -0
|
@@ -0,0 +1,867 @@
|
|
|
1
|
+
/* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
5
|
+
const _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_parameter_1$schema = z.object({
|
|
6
|
+
'subject': z.string().readonly(),
|
|
7
|
+
'description': z.string().readonly(),
|
|
8
|
+
'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly().optional(),
|
|
9
|
+
'writeScopes': z.array(z.string()).readonly().optional(),
|
|
10
|
+
})
|
|
11
|
+
const _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_result$schema = z.union([z.object({
|
|
12
|
+
'ok': z.literal(true).readonly(),
|
|
13
|
+
'value': z.object({
|
|
14
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
15
|
+
'revision': z.number().readonly(),
|
|
16
|
+
'subject': z.string().readonly(),
|
|
17
|
+
'description': z.string().readonly(),
|
|
18
|
+
'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed"), z.literal("deleted")]).readonly(),
|
|
19
|
+
'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
20
|
+
'writeScopes': z.array(z.string()).readonly(),
|
|
21
|
+
'ownerName': z.string().readonly().optional(),
|
|
22
|
+
'ready': z.boolean().readonly(),
|
|
23
|
+
'writeScopeWarnings': z.array(z.string()).readonly(),
|
|
24
|
+
}).readonly(),
|
|
25
|
+
}), z.object({
|
|
26
|
+
'ok': z.literal(false).readonly(),
|
|
27
|
+
'error': z.object({
|
|
28
|
+
'code': z.union([z.literal("team-task-conflict"), z.literal("team-rejected")]).readonly(),
|
|
29
|
+
'message': z.string().readonly(),
|
|
30
|
+
}).readonly(),
|
|
31
|
+
})])
|
|
32
|
+
const _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
33
|
+
const _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_parameter_1$schema = z.object({
|
|
34
|
+
'taskId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
35
|
+
'expectedRevision': z.number().readonly(),
|
|
36
|
+
'action': z.union([z.literal("complete"), z.literal("edit"), z.literal("claim"), z.literal("release"), z.literal("set_dependencies"), z.literal("reopen"), z.literal("reassign"), z.literal("delete")]).readonly(),
|
|
37
|
+
'subject': z.string().readonly().optional(),
|
|
38
|
+
'description': z.string().readonly().optional(),
|
|
39
|
+
'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly().optional(),
|
|
40
|
+
'writeScopes': z.array(z.string()).readonly().optional(),
|
|
41
|
+
'owner': z.string().readonly().optional(),
|
|
42
|
+
})
|
|
43
|
+
const _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_result$schema = z.union([z.object({
|
|
44
|
+
'ok': z.literal(true).readonly(),
|
|
45
|
+
'value': z.object({
|
|
46
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
47
|
+
'revision': z.number().readonly(),
|
|
48
|
+
'subject': z.string().readonly(),
|
|
49
|
+
'description': z.string().readonly(),
|
|
50
|
+
'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed"), z.literal("deleted")]).readonly(),
|
|
51
|
+
'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
52
|
+
'writeScopes': z.array(z.string()).readonly(),
|
|
53
|
+
'ownerName': z.string().readonly().optional(),
|
|
54
|
+
'ready': z.boolean().readonly(),
|
|
55
|
+
'writeScopeWarnings': z.array(z.string()).readonly(),
|
|
56
|
+
}).readonly(),
|
|
57
|
+
}), z.object({
|
|
58
|
+
'ok': z.literal(false).readonly(),
|
|
59
|
+
'error': z.object({
|
|
60
|
+
'code': z.union([z.literal("team-task-conflict"), z.literal("team-rejected")]).readonly(),
|
|
61
|
+
'message': z.string().readonly(),
|
|
62
|
+
}).readonly(),
|
|
63
|
+
})])
|
|
64
|
+
const _deepseek_ai_dsh_experimental_agent_team_agentTeams_view_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
65
|
+
const _deepseek_ai_dsh_experimental_agent_team_agentTeams_view_result$schema = z.object({
|
|
66
|
+
'members': z.array(z.object({
|
|
67
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
68
|
+
'name': z.string().readonly(),
|
|
69
|
+
'role': z.union([z.literal("lead"), z.literal("teammate")]).readonly(),
|
|
70
|
+
'status': z.union([z.literal("running"), z.literal("failed"), z.literal("idle"), z.literal("inactive"), z.literal("provisioning")]).readonly(),
|
|
71
|
+
'description': z.string().readonly().optional(),
|
|
72
|
+
'provider': z.string().readonly().optional(),
|
|
73
|
+
'context': z.union([z.literal("fresh"), z.literal("fork")]).readonly().optional(),
|
|
74
|
+
'model': z.string().readonly().optional(),
|
|
75
|
+
'diagnostics': z.array(z.string()).readonly(),
|
|
76
|
+
})).readonly(),
|
|
77
|
+
'tasks': z.array(z.object({
|
|
78
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
79
|
+
'revision': z.number().readonly(),
|
|
80
|
+
'subject': z.string().readonly(),
|
|
81
|
+
'description': z.string().readonly(),
|
|
82
|
+
'status': z.union([z.literal("pending"), z.literal("in_progress"), z.literal("completed"), z.literal("deleted")]).readonly(),
|
|
83
|
+
'blockedBy': z.array(z.intersection(z.string(), z.unknown())).readonly(),
|
|
84
|
+
'writeScopes': z.array(z.string()).readonly(),
|
|
85
|
+
'ownerName': z.string().readonly().optional(),
|
|
86
|
+
'ready': z.boolean().readonly(),
|
|
87
|
+
'writeScopeWarnings': z.array(z.string()).readonly(),
|
|
88
|
+
})).readonly(),
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
export const TYPERT = {
|
|
92
|
+
package: '@deepseek-ai/dsh-experimental-agent-team',
|
|
93
|
+
face: 'host',
|
|
94
|
+
schemas: [
|
|
95
|
+
],
|
|
96
|
+
invocations: [
|
|
97
|
+
{
|
|
98
|
+
id: '@deepseek-ai/dsh-experimental-agent-team#agentTeams/createTask',
|
|
99
|
+
service: 'agentTeams',
|
|
100
|
+
namespace: 'agentTeams',
|
|
101
|
+
method: 'createTask',
|
|
102
|
+
implementation: 'remoteCreateTask',
|
|
103
|
+
invocation: { kind: 'direct' },
|
|
104
|
+
scope: {
|
|
105
|
+
context: 'agent',
|
|
106
|
+
wire: 'agentId',
|
|
107
|
+
},
|
|
108
|
+
parameters: [
|
|
109
|
+
{
|
|
110
|
+
name: 'agent',
|
|
111
|
+
wire: 'agentId',
|
|
112
|
+
source: 'lookup',
|
|
113
|
+
lookup: 'agent',
|
|
114
|
+
codec: {
|
|
115
|
+
mode: 'strict',
|
|
116
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
117
|
+
schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_parameter_0$schema,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'request',
|
|
122
|
+
wire: 'request',
|
|
123
|
+
source: 'json',
|
|
124
|
+
codec: {
|
|
125
|
+
mode: 'strict',
|
|
126
|
+
typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#CreateTeamTaskRequest',
|
|
127
|
+
schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_parameter_1$schema,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
result: {
|
|
132
|
+
mode: 'strict',
|
|
133
|
+
typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#TeamTaskMutationResult',
|
|
134
|
+
schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_createTask_result$schema,
|
|
135
|
+
},
|
|
136
|
+
sourceLocation: {"file":"packages/experimental/agent-team/src/index.ts","line":257,"column":3},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: '@deepseek-ai/dsh-experimental-agent-team#agentTeams/updateTask',
|
|
140
|
+
service: 'agentTeams',
|
|
141
|
+
namespace: 'agentTeams',
|
|
142
|
+
method: 'updateTask',
|
|
143
|
+
implementation: 'remoteUpdateTask',
|
|
144
|
+
invocation: { kind: 'direct' },
|
|
145
|
+
scope: {
|
|
146
|
+
context: 'agent',
|
|
147
|
+
wire: 'agentId',
|
|
148
|
+
},
|
|
149
|
+
parameters: [
|
|
150
|
+
{
|
|
151
|
+
name: 'agent',
|
|
152
|
+
wire: 'agentId',
|
|
153
|
+
source: 'lookup',
|
|
154
|
+
lookup: 'agent',
|
|
155
|
+
codec: {
|
|
156
|
+
mode: 'strict',
|
|
157
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
158
|
+
schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_parameter_0$schema,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'request',
|
|
163
|
+
wire: 'request',
|
|
164
|
+
source: 'json',
|
|
165
|
+
codec: {
|
|
166
|
+
mode: 'strict',
|
|
167
|
+
typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#UpdateTeamTaskRequest',
|
|
168
|
+
schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_parameter_1$schema,
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
result: {
|
|
173
|
+
mode: 'strict',
|
|
174
|
+
typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#TeamTaskMutationResult',
|
|
175
|
+
schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_updateTask_result$schema,
|
|
176
|
+
},
|
|
177
|
+
sourceLocation: {"file":"packages/experimental/agent-team/src/index.ts","line":268,"column":3},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: '@deepseek-ai/dsh-experimental-agent-team#agentTeams/view',
|
|
181
|
+
service: 'agentTeams',
|
|
182
|
+
namespace: 'agentTeams',
|
|
183
|
+
method: 'view',
|
|
184
|
+
implementation: 'remoteView',
|
|
185
|
+
invocation: { kind: 'direct' },
|
|
186
|
+
scope: {
|
|
187
|
+
context: 'agent',
|
|
188
|
+
wire: 'agentId',
|
|
189
|
+
},
|
|
190
|
+
parameters: [
|
|
191
|
+
{
|
|
192
|
+
name: 'agent',
|
|
193
|
+
wire: 'agentId',
|
|
194
|
+
source: 'lookup',
|
|
195
|
+
lookup: 'agent',
|
|
196
|
+
codec: {
|
|
197
|
+
mode: 'strict',
|
|
198
|
+
typeSymbol: '@deepseek-ai/dsh-session/types#SessionId',
|
|
199
|
+
schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_view_parameter_0$schema,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
result: {
|
|
204
|
+
mode: 'strict',
|
|
205
|
+
typeSymbol: '@deepseek-ai/dsh-experimental-agent-team/client#TeamView',
|
|
206
|
+
schema: _deepseek_ai_dsh_experimental_agent_team_agentTeams_view_result$schema,
|
|
207
|
+
},
|
|
208
|
+
sourceLocation: {"file":"packages/experimental/agent-team/src/index.ts","line":243,"column":3},
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
model: {
|
|
212
|
+
"services": [
|
|
213
|
+
{
|
|
214
|
+
"description": "Agent Teams service backed by the exact live Lead Session log.",
|
|
215
|
+
"summary": "Agent Teams service backed by the exact live Lead Session log.",
|
|
216
|
+
"tags": [],
|
|
217
|
+
"jsDoc": "/** Agent Teams service backed by the exact live Lead Session log. */",
|
|
218
|
+
"key": "agentTeams",
|
|
219
|
+
"exportName": "TeamService",
|
|
220
|
+
"members": [
|
|
221
|
+
{
|
|
222
|
+
"kind": "method",
|
|
223
|
+
"name": "membership",
|
|
224
|
+
"signature": "membership(agent: Agent): TeamMembership",
|
|
225
|
+
"summary": "Resolve one exact live Agent's Team role.",
|
|
226
|
+
"jsDoc": "/**\n * Resolve one exact live Agent's Team role.\n * @param agent - exact live Agent used as the authority credential.\n * @returns its root, Team identity, role, and model-facing name.\n */"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"kind": "method",
|
|
230
|
+
"name": "listMembers",
|
|
231
|
+
"signature": "listMembers(agent: Agent): TeamMemberView[]",
|
|
232
|
+
"summary": "List the runtime-enriched roster visible to one Team member.",
|
|
233
|
+
"jsDoc": "/**\n * List the runtime-enriched roster visible to one Team member.\n * @param agent - exact live Team member.\n * @returns Lead and teammate rows in creation order.\n */"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"kind": "method",
|
|
237
|
+
"name": "spawnTeammate",
|
|
238
|
+
"signature": "async spawnTeammate(caller: Agent, request: SpawnTeammateRequest): Promise<SpawnTeammateResult>",
|
|
239
|
+
"summary": "Create one named, continuable direct child of the Team Lead.",
|
|
240
|
+
"jsDoc": "/**\n * Create one named, continuable direct child of the Team Lead.\n * @param caller - exact live Lead Agent.\n * @param request - immutable name, description, prompt, context mode, provider, and cancellation.\n * @returns the active roster row.\n */"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"kind": "method",
|
|
244
|
+
"name": "sendMessage",
|
|
245
|
+
"signature": "async sendMessage(caller: Agent, request: SendTeamMessageRequest): Promise<SendTeamMessageResult>",
|
|
246
|
+
"summary": "Queue one durable peer message, then attempt immediate delivery.",
|
|
247
|
+
"jsDoc": "/**\n * Queue one durable peer message, then attempt immediate delivery.\n * @param caller - exact live sending Team member.\n * @param request - target name, content, and pre-queue cancellation.\n * @returns durable message identity and immediate-delivery observation.\n */"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"kind": "method",
|
|
251
|
+
"name": "createTask",
|
|
252
|
+
"signature": "async createTask(caller: Agent, request: CreateTeamTaskRequest): Promise<TeamTaskView>",
|
|
253
|
+
"summary": "Create one unowned pending task in the Team Lead log.",
|
|
254
|
+
"jsDoc": "/**\n * Create one unowned pending task in the Team Lead log.\n * @param caller - exact live Team member creating the task.\n * @param request - task text, blockers, and advisory write scopes.\n * @returns the revision-one task view.\n */"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"kind": "method",
|
|
258
|
+
"name": "getTask",
|
|
259
|
+
"signature": "getTask(caller: Agent, id: TeamTaskId): TeamTaskView",
|
|
260
|
+
"summary": "Return one task, including a deleted tombstone.",
|
|
261
|
+
"jsDoc": "/**\n * Return one task, including a deleted tombstone.\n * @param caller - exact live Team member reading the task.\n * @param id - Team-local task identity.\n * @returns the latest task value and derived readiness diagnostics.\n */"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"kind": "method",
|
|
265
|
+
"name": "listTasks",
|
|
266
|
+
"signature": "listTasks(caller: Agent): TeamTaskView[]",
|
|
267
|
+
"summary": "List current non-deleted tasks in numeric creation order.",
|
|
268
|
+
"jsDoc": "/**\n * List current non-deleted tasks in numeric creation order.\n * @param caller - exact live Team member reading the board.\n * @returns detached current task views.\n */"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"kind": "method",
|
|
272
|
+
"name": "updateTask",
|
|
273
|
+
"signature": "async updateTask(caller: Agent, request: UpdateTeamTaskRequest): Promise<TeamTaskView>",
|
|
274
|
+
"summary": "Compare-and-set one authorized task transition.",
|
|
275
|
+
"jsDoc": "/**\n * Compare-and-set one authorized task transition.\n * @param caller - exact live Team member authorizing the mutation.\n * @param request - task identity, expected revision, action, and action fields.\n * @returns the committed next task revision.\n */"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"kind": "method",
|
|
279
|
+
"name": "waitForChange",
|
|
280
|
+
"signature": "async waitForChange(caller: Agent, timeoutMs: number, signal: AbortSignal): Promise<TeamWaitResult>",
|
|
281
|
+
"summary": "Wait for the next Team-domain or member-status change.",
|
|
282
|
+
"jsDoc": "/**\n * Wait for the next Team-domain or member-status change.\n * @param caller - exact live Team member waiting for activity.\n * @param timeoutMs - bounded wait duration from ten seconds through one hour.\n * @param signal - caller cancellation for the wait only.\n * @returns one observed change or a timeout result.\n */"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"kind": "method",
|
|
286
|
+
"name": "interrupt",
|
|
287
|
+
"signature": "interrupt(caller: Agent, targetName: string): { previousStatus: 'running' | 'idle' | 'inactive' }",
|
|
288
|
+
"summary": "Interrupt one live teammate turn without clearing its pending inbox.",
|
|
289
|
+
"jsDoc": "/**\n * Interrupt one live teammate turn without clearing its pending inbox.\n * @param caller - exact live Lead Agent.\n * @param targetName - durable teammate name.\n * @returns the target status sampled before cancellation.\n */"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"kind": "method",
|
|
293
|
+
"name": "tryMembership",
|
|
294
|
+
"signature": "tryMembership(agent: Agent): TeamMembership | undefined",
|
|
295
|
+
"summary": "Resolve a caller without throwing, used by scoped-tool installation and observers.",
|
|
296
|
+
"jsDoc": "/**\n * Resolve a caller without throwing, used by scoped-tool installation and observers.\n * @param agent - candidate exact live Agent.\n * @returns Team membership, or undefined for non-Team subagents and stale identities.\n */"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"kind": "method",
|
|
300
|
+
"name": "remoteView",
|
|
301
|
+
"signature": "@Remote('view') remoteView(agent: Agent): TeamView",
|
|
302
|
+
"summary": "Read the current roster and non-deleted task board through the generated Remote API.",
|
|
303
|
+
"jsDoc": "/**\n * Read the current roster and non-deleted task board through the generated Remote API.\n * @param agent - exact live Team member used as the authority credential.\n * @returns detached current roster and task views.\n */"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"kind": "method",
|
|
307
|
+
"name": "remoteCreateTask",
|
|
308
|
+
"signature": "@Remote('createTask') remoteCreateTask(agent: Agent, request: CreateTeamTaskRequest): Promise<TeamTaskMutationResult>",
|
|
309
|
+
"summary": "Create one shared task through the generated Remote API.",
|
|
310
|
+
"jsDoc": "/**\n * Create one shared task through the generated Remote API.\n * @param agent - exact live Team member creating the task.\n * @param request - task text, blockers, and advisory write scopes.\n * @returns the revision-one task or a typed Team rejection.\n */"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"kind": "method",
|
|
314
|
+
"name": "remoteUpdateTask",
|
|
315
|
+
"signature": "@Remote('updateTask') remoteUpdateTask(agent: Agent, request: UpdateTeamTaskRequest): Promise<TeamTaskMutationResult>",
|
|
316
|
+
"summary": "Apply one task mutation and preserve Team rejections as business results.",
|
|
317
|
+
"jsDoc": "/**\n * Apply one task mutation and preserve Team rejections as business results.\n * @param agent - exact live Team member authorizing the mutation.\n * @param request - task identity, expected revision, action, and action fields.\n * @returns the committed task or a typed Team rejection.\n */"
|
|
318
|
+
}
|
|
319
|
+
],
|
|
320
|
+
"types": [
|
|
321
|
+
{
|
|
322
|
+
"name": "Agent",
|
|
323
|
+
"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}"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"name": "AgentCancelCause",
|
|
327
|
+
"declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "AgentMessageSource",
|
|
331
|
+
"declaration": "export interface AgentMessageSource {\n readonly kind: 'agent-message';\n readonly form: 'relay';\n readonly senderSessionId: SessionId;\n}"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"name": "AgentOptions",
|
|
335
|
+
"declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n reasoningEffort?: ReasoningEffortId;\n maxTokens?: number;\n subagentDepth?: number;\n}"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "AgentStatus",
|
|
339
|
+
"declaration": "export type AgentStatus = 'idle' | 'running';"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"name": "ApprovalOutcome",
|
|
343
|
+
"declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"name": "ApprovalPolicy",
|
|
347
|
+
"declaration": "export type ApprovalPolicy = 'ask' | 'never';"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "ApprovalRequestId",
|
|
351
|
+
"declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"name": "AssistantMessage",
|
|
355
|
+
"declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "AssistantProvenance",
|
|
359
|
+
"declaration": "export interface AssistantProvenance {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"name": "AssistantStreamRecord",
|
|
363
|
+
"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; };"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "AttachmentId",
|
|
367
|
+
"declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "Branded",
|
|
371
|
+
"declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"name": "BrandedNumber",
|
|
375
|
+
"declaration": "export type BrandedNumber<B extends string> = number & { readonly [BRAND]: B; };"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "CancelOptions",
|
|
379
|
+
"declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "CommandId",
|
|
383
|
+
"declaration": "export type CommandId = Branded<'CommandId'>;"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "CommandSource",
|
|
387
|
+
"declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "CommandSourceMap",
|
|
391
|
+
"declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "CompactionId",
|
|
395
|
+
"declaration": "export type CompactionId = Branded<'CompactionId'>;"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"name": "ContentBlock",
|
|
399
|
+
"declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "ContentBlockMap",
|
|
403
|
+
"declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n file: FileBlock;\n 'tool-call': ToolCallBlock;\n 'tool-result': ToolResultBlock;\n}"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "ContentBlockType",
|
|
407
|
+
"declaration": "export type ContentBlockType = keyof ContentBlockMap;"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"name": "ContextFormed",
|
|
411
|
+
"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'; };"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"name": "ContextSnapshotSection",
|
|
415
|
+
"declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"name": "ContinuableSubagentDescriptorData",
|
|
419
|
+
"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}"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"name": "CreateTeamTaskRequest",
|
|
423
|
+
"declaration": "export interface CreateTeamTaskRequest {\n readonly subject: string;\n readonly description: string;\n readonly blockedBy?: readonly TeamTaskId[];\n readonly writeScopes?: readonly string[];\n}"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "EpochHeader",
|
|
427
|
+
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n}"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"name": "FeedbackCategory",
|
|
431
|
+
"declaration": "export type FeedbackCategory = 'task-result' | 'instruction-following' | 'product-interaction' | 'service-stability' | 'resource-cost' | 'security-privacy-permission' | 'other';"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"name": "FeedbackRecord",
|
|
435
|
+
"declaration": "export interface FeedbackRecord {\n readonly text?: string;\n readonly category?: FeedbackCategory;\n}"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"name": "FileAttachmentRef",
|
|
439
|
+
"declaration": "export interface FileAttachmentRef {\n attachmentId: AttachmentId;\n name: string;\n bytes: number;\n}"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"name": "FileBlock",
|
|
443
|
+
"declaration": "export interface FileBlock {\n type: 'file';\n attachment: FileAttachmentRef;\n}"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"name": "FinishReason",
|
|
447
|
+
"declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "FinishReasonMap",
|
|
451
|
+
"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}"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "GoalBlockReason",
|
|
455
|
+
"declaration": "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "GoalChangeMeta",
|
|
459
|
+
"declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"name": "GoalClearChangeMeta",
|
|
463
|
+
"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}"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"name": "GoalId",
|
|
467
|
+
"declaration": "export type GoalId = Branded<'GoalId'>;"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "GoalMessageSource",
|
|
471
|
+
"declaration": "export interface GoalMessageSource {\n readonly kind: 'goal';\n readonly goalId: GoalId;\n readonly revision: number;\n readonly round: number;\n}"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"name": "GoalOperation",
|
|
475
|
+
"declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"name": "GoalPhase",
|
|
479
|
+
"declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "GoalRef",
|
|
483
|
+
"declaration": "export interface GoalRef {\n readonly id: GoalId;\n readonly revision: number;\n}"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "GoalSnapshot",
|
|
487
|
+
"declaration": "export interface GoalSnapshot extends GoalRef {\n readonly objective: string;\n readonly phase: GoalPhase;\n readonly blockedReason?: GoalBlockReason;\n readonly maxGoalRounds: number;\n}"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "GoalSnapshotChangeMeta",
|
|
491
|
+
"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}"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "ImageAttachmentRef",
|
|
495
|
+
"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}"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"name": "ImageBlock",
|
|
499
|
+
"declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n}"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"name": "ImageMediaType",
|
|
503
|
+
"declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"name": "Inbox",
|
|
507
|
+
"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}"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"name": "InboxTarget",
|
|
511
|
+
"declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "JsonValue",
|
|
515
|
+
"declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"name": "LlmCallConfig",
|
|
519
|
+
"declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"name": "LlmCallConfigAdapterDefaults",
|
|
523
|
+
"declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"name": "LlmFailure",
|
|
527
|
+
"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}"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"name": "Message",
|
|
531
|
+
"declaration": "export interface Message {\n readonly id: MessageId;\n readonly role: 'system' | 'user' | 'assistant';\n readonly content: ContentBlock[];\n readonly source: MessageSource;\n}"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "MessageFeedbackDelete",
|
|
535
|
+
"declaration": "export interface MessageFeedbackDelete {\n readonly sessionId: SessionId;\n readonly messageId: MessageId;\n}"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"name": "MessageFeedbackItem",
|
|
539
|
+
"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}"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"name": "MessageFeedbackPut",
|
|
543
|
+
"declaration": "export interface MessageFeedbackPut {\n readonly sessionId: SessionId;\n readonly item: MessageFeedbackItem;\n}"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"name": "MessageFeedbackRating",
|
|
547
|
+
"declaration": "export type MessageFeedbackRating = 'positive' | 'negative';"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"name": "MessageFeedbackVersion",
|
|
551
|
+
"declaration": "export type MessageFeedbackVersion = Branded<'MessageFeedbackVersion'>;"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"name": "MessageId",
|
|
555
|
+
"declaration": "export type MessageId = Branded<'MessageId'>;"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"name": "MessageSource",
|
|
559
|
+
"declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
"name": "MessageSourceMap",
|
|
563
|
+
"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 'agent-message': AgentMessageSource;\n 'subagent-settled': SubagentSettledMessageSource;\n 'skill-invocation': SkillInvocationSource;\n 'team-message': TeamMessageSource;\n goal: GoalMessageSource;\n 'session-reference': SessionReferenceSource;\n}"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"name": "ModelMessageSource",
|
|
567
|
+
"declaration": "export interface ModelMessageSource extends AssistantProvenance {\n kind: 'model';\n}"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"name": "ModelSelection",
|
|
571
|
+
"declaration": "export interface ModelSelection {\n readonly provider: string;\n readonly model: string;\n readonly reasoningEffort?: string;\n}"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"name": "OneShotSubagentDescriptorData",
|
|
575
|
+
"declaration": "export interface OneShotSubagentDescriptorData extends SubagentDescriptorBase {\n readonly mode: 'one-shot';\n readonly label?: string;\n}"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "OptionalSessionSeq",
|
|
579
|
+
"declaration": "export type OptionalSessionSeq = SessionSeq | null;"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "ProviderRequestId",
|
|
583
|
+
"declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"name": "PtcDispatchEventData",
|
|
587
|
+
"declaration": "export interface PtcDispatchEventData extends PtcDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n}"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"name": "PtcDispatchStartEventData",
|
|
591
|
+
"declaration": "export interface PtcDispatchStartEventData {\n rootCallId: ToolCallId;\n parentCallId: ToolCallId;\n subCallId: ToolCallId;\n name: string;\n arguments: unknown;\n}"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"name": "ReasoningBlock",
|
|
595
|
+
"declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"name": "ReasoningEffortId",
|
|
599
|
+
"declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"name": "ReplayEnvelope",
|
|
603
|
+
"declaration": "export interface ReplayEnvelope {\n response: unknown;\n blocks?: readonly unknown[];\n}"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"name": "RequestContext",
|
|
607
|
+
"declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n systemPromptUpdate?: SystemPromptUpdate;\n}"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"name": "RequestHeaderReason",
|
|
611
|
+
"declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change' | 'series';"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"name": "SandboxMode",
|
|
615
|
+
"declaration": "export type SandboxMode = 'read-only' | 'workspace-write' | 'danger-full-access';"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "SendTeamMessageRequest",
|
|
619
|
+
"declaration": "export interface SendTeamMessageRequest {\n readonly target: string;\n readonly content: ContentBlock[];\n readonly signal: AbortSignal;\n}"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"name": "SendTeamMessageResult",
|
|
623
|
+
"declaration": "export interface SendTeamMessageResult {\n readonly messageId: TeamMessageId;\n readonly status: 'accepted' | 'queued';\n}"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"name": "Session",
|
|
627
|
+
"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 eventAt(seq: SessionSeq): SessionEvent | undefined;\n snapshotEvents(fromSeq: SessionLogOffset = SessionLogOffset(0), toSeqExclusive: SessionLogOffset = this.seq): readonly SessionEvent[];\n ownEvents(): readonly SessionEvent[];\n isOwnSeq(seq: SessionSeq): boolean;\n get seq(): SessionLogOffset;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent<T>] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "SessionEvent",
|
|
631
|
+
"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];"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"name": "SessionEventMap",
|
|
635
|
+
"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 '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; }; 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 '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/ptc-dispatch-start': PtcDispatchStartEventData;\n 'tool/ptc-dispatch': PtcDispatchEventData;\n 'agent-preset/selected': { agentPreset: string; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: import('@deepseek-ai/dsh-session/types').SessionSeq; };\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 'subagent/catalog': SubagentCatalogEvent;\n 'feedback/record': FeedbackRecord;\n 'team/member': { version: 2; teamId: TeamId; member: TeamMemberSnapshot; };\n 'team/task': { version: 2; teamId: TeamId; task: TeamTaskSnapshot; };\n 'team/message/queued': { version: 2; teamId: TeamId; message: TeamMessageSnapshot; };\n 'team/message/delivered': { version: 2; teamId: TeamId; messageId: TeamMessageId; targetId: SessionId; };\n 'goal/change': GoalChangeMeta;\n 'feedback/message-put': MessageFeedbackPut;\n 'feedback/message-delete': MessageFeedbackDelete;\n '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}"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"name": "SessionEventType",
|
|
639
|
+
"declaration": "export type SessionEventType = keyof SessionEventMap;"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "SessionHeader",
|
|
643
|
+
"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}"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"name": "SessionId",
|
|
647
|
+
"declaration": "export type SessionId = Branded<'SessionId'>;"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"name": "SessionLogOffset",
|
|
651
|
+
"declaration": "export type SessionLogOffset = BrandedNumber<'SessionLogOffset'>;"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"name": "SessionReferenceSource",
|
|
655
|
+
"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}"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"name": "SessionRequestId",
|
|
659
|
+
"declaration": "export type SessionRequestId = Branded<'session-request-id'>;"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"name": "SessionSeq",
|
|
663
|
+
"declaration": "export type SessionSeq = BrandedNumber<'SessionSeq'>;"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"name": "SessionSurface",
|
|
667
|
+
"declaration": "export interface SessionSurface {\n readonly nodes: readonly SessionSeq[];\n readonly replaceGeneration: number;\n}"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"name": "SessionTitleEventData",
|
|
671
|
+
"declaration": "export interface SessionTitleEventData {\n readonly title: string;\n readonly messageSeqs: SessionSeq[];\n readonly source: SessionTitleSource;\n}"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"name": "SessionTitleModelProvenance",
|
|
675
|
+
"declaration": "export interface SessionTitleModelProvenance {\n readonly provider: string;\n readonly model: string;\n}"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "SessionTitleProviderId",
|
|
679
|
+
"declaration": "export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
"name": "SessionTitleSource",
|
|
683
|
+
"declaration": "export type SessionTitleSource = { readonly kind: 'fallback'; } | { readonly kind: 'provider'; readonly provider: SessionTitleProviderId; readonly model?: SessionTitleModelProvenance; } | { readonly kind: 'user'; };"
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"name": "SkillInvocationSource",
|
|
687
|
+
"declaration": "export interface SkillInvocationSource {\n readonly kind: 'skill-invocation';\n readonly name: string;\n readonly form: 'instructions';\n}"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"name": "SpawnTeammateRequest",
|
|
691
|
+
"declaration": "export interface SpawnTeammateRequest {\n readonly name: string;\n readonly description: string;\n readonly prompt: ContentBlock[];\n readonly context: 'fresh' | 'fork';\n readonly provider: string;\n readonly signal: AbortSignal;\n}"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"name": "SpawnTeammateResult",
|
|
695
|
+
"declaration": "export interface SpawnTeammateResult {\n readonly member: TeamMemberView;\n}"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"name": "StreamChunk",
|
|
699
|
+
"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; };"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"name": "SubagentCatalogEvent",
|
|
703
|
+
"declaration": "export type SubagentCatalogEvent = { readonly version: 0; readonly childId: SessionId; readonly childCreatedAt: number; } & ({ readonly mode: 'one-shot'; readonly label?: string; } | { readonly mode: 'continuable'; readonly label: string; });"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
"name": "SubagentDescriptorBase",
|
|
707
|
+
"declaration": "export interface SubagentDescriptorBase {\n readonly version: number;\n readonly mode: 'one-shot' | 'continuable';\n readonly provider: string;\n}"
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"name": "SubagentDescriptorData",
|
|
711
|
+
"declaration": "export type SubagentDescriptorData = OneShotSubagentDescriptorData | ContinuableSubagentDescriptorData;"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"name": "SubagentSettledMessageSource",
|
|
715
|
+
"declaration": "export interface SubagentSettledMessageSource {\n readonly kind: 'subagent-settled';\n readonly form: 'notice';\n readonly summary: string;\n readonly senderSessionId: SessionId;\n}"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"name": "SurfaceEventType",
|
|
719
|
+
"declaration": "export type SurfaceEventType = 'system/message' | 'user/message' | 'assistant/message' | 'tool/result';"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"name": "SurfaceIntent",
|
|
723
|
+
"declaration": "export type SurfaceIntent<T extends SurfaceEventType = SurfaceEventType> = { surfaceOp: SurfaceOp; } & (T extends 'assistant/message' ? { sourceEventSeqs?: never; } : { sourceEventSeqs?: SessionSeq[]; });"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "SurfaceOp",
|
|
727
|
+
"declaration": "export type SurfaceOp = 'append' | { op: 'replace'; startSeq: SessionSeq; endSeq: SessionSeq; };"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"name": "SystemMessage",
|
|
731
|
+
"declaration": "export interface SystemMessage extends Message {\n readonly role: 'system';\n readonly source: MessageSourceMap['plugin'];\n}"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"name": "SystemPromptUpdate",
|
|
735
|
+
"declaration": "export type SystemPromptUpdate = 'in-history';"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"name": "TeamId",
|
|
739
|
+
"declaration": "export type TeamId = Branded<'TeamId'>;"
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"name": "TeamMemberPhase",
|
|
743
|
+
"declaration": "export type TeamMemberPhase = 'provisioning' | 'active' | 'failed';"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"name": "TeamMembership",
|
|
747
|
+
"declaration": "export interface TeamMembership {\n readonly root: Agent;\n readonly id: TeamId;\n readonly role: 'lead' | 'teammate';\n readonly name: string;\n}"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"name": "TeamMemberSnapshot",
|
|
751
|
+
"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}"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"name": "TeamMemberView",
|
|
755
|
+
"declaration": "export interface TeamMemberView {\n readonly id: SessionId;\n readonly name: string;\n readonly role: 'lead' | 'teammate';\n readonly status: 'running' | 'idle' | 'inactive' | 'provisioning' | 'failed';\n readonly description?: string;\n readonly provider?: string;\n readonly context?: 'fresh' | 'fork';\n readonly model?: string;\n readonly diagnostics: string[];\n}"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "TeamMessageId",
|
|
759
|
+
"declaration": "export type TeamMessageId = Branded<'TeamMessageId'>;"
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "TeamMessageSnapshot",
|
|
763
|
+
"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}"
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "TeamMessageSource",
|
|
767
|
+
"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}"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"name": "TeamTaskAction",
|
|
771
|
+
"declaration": "export type TeamTaskAction = 'claim' | 'release' | 'edit' | 'set_dependencies' | 'complete' | 'reopen' | 'reassign' | 'delete';"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"name": "TeamTaskId",
|
|
775
|
+
"declaration": "export type TeamTaskId = Branded<'TeamTaskId'>;"
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "TeamTaskMutationResult",
|
|
779
|
+
"declaration": "export type TeamTaskMutationResult = { readonly ok: true; readonly value: TeamTaskView; } | { readonly ok: false; readonly error: { readonly code: 'team-task-conflict' | 'team-rejected'; readonly message: string; }; };"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"name": "TeamTaskSnapshot",
|
|
783
|
+
"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}"
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
"name": "TeamTaskStatus",
|
|
787
|
+
"declaration": "export type TeamTaskStatus = 'pending' | 'in_progress' | 'completed' | 'deleted';"
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"name": "TeamTaskView",
|
|
791
|
+
"declaration": "export interface TeamTaskView {\n readonly id: TeamTaskId;\n readonly revision: number;\n readonly subject: string;\n readonly description: string;\n readonly status: TeamTaskStatus;\n readonly blockedBy: TeamTaskId[];\n readonly writeScopes: string[];\n readonly ownerName?: string;\n readonly ready: boolean;\n readonly writeScopeWarnings: string[];\n}"
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
"name": "TeamView",
|
|
795
|
+
"declaration": "export interface TeamView {\n readonly members: TeamMemberView[];\n readonly tasks: TeamTaskView[];\n}"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"name": "TeamWaitResult",
|
|
799
|
+
"declaration": "export interface TeamWaitResult {\n readonly timedOut: boolean;\n}"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"name": "TextBlock",
|
|
803
|
+
"declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"name": "TodoItem",
|
|
807
|
+
"declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"name": "TokenUsage",
|
|
811
|
+
"declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n totalTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"name": "ToolCallBlock",
|
|
815
|
+
"declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: ToolCallId;\n name: string;\n arguments: string;\n}"
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
"name": "ToolCallId",
|
|
819
|
+
"declaration": "export type ToolCallId = Branded<'ToolCallId'>;"
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
"name": "ToolMessageSource",
|
|
823
|
+
"declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: ToolCallId;\n}"
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"name": "ToolRestriction",
|
|
827
|
+
"declaration": "export interface ToolRestriction {\n readonly allow?: readonly string[];\n readonly deny?: readonly string[];\n}"
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"name": "ToolResultBlock",
|
|
831
|
+
"declaration": "export interface ToolResultBlock {\n type: 'tool-result';\n toolCallId: ToolCallId;\n content: ContentBlock[];\n isError?: boolean;\n}"
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
"name": "ToolResultMessage",
|
|
835
|
+
"declaration": "export interface ToolResultMessage extends Message {\n readonly role: 'user';\n readonly content: [ToolResultBlock];\n readonly source: ToolMessageSource;\n}"
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
"name": "ToolSchema",
|
|
839
|
+
"declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"name": "TurnEndCancelCause",
|
|
843
|
+
"declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"name": "TurnEndReason",
|
|
847
|
+
"declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
"name": "TurnEndReasonMap",
|
|
851
|
+
"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}"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
"name": "UpdateTeamTaskRequest",
|
|
855
|
+
"declaration": "export interface UpdateTeamTaskRequest {\n readonly taskId: TeamTaskId;\n readonly expectedRevision: number;\n readonly action: TeamTaskAction;\n readonly subject?: string;\n readonly description?: string;\n readonly blockedBy?: readonly TeamTaskId[];\n readonly writeScopes?: readonly string[];\n readonly owner?: string;\n}"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"name": "UserMessage",
|
|
859
|
+
"declaration": "export interface UserMessage extends Message {\n readonly role: 'user';\n}"
|
|
860
|
+
}
|
|
861
|
+
]
|
|
862
|
+
}
|
|
863
|
+
],
|
|
864
|
+
"events": [],
|
|
865
|
+
"objects": []
|
|
866
|
+
},
|
|
867
|
+
}
|