@stackstackstack/dsh-goal 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +58 -0
- package/README.zh.md +58 -0
- package/lib/index.js +827 -0
- package/lib/invariant.js +332 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +815 -0
- package/lib/typert.remote-client.d.ts +41 -0
- package/lib/typert.remote-client.js +366 -0
- package/lib/types/client.d.ts +10 -0
- package/lib/types/client.js +10 -0
- package/lib/types/domain.d.ts +92 -0
- package/lib/types/domain.js +10 -0
- package/lib/types/fold.d.ts +50 -0
- package/lib/types/fold.js +322 -0
- package/lib/types/index.d.ts +155 -0
- package/lib/types/index.js +495 -0
- package/lib/types/invariant.d.ts +13 -0
- package/lib/types/invariant.js +70 -0
- package/lib/types/runtime.d.ts +21 -0
- package/lib/types/runtime.js +25 -0
- package/lib/types/types.d.ts +96 -0
- package/lib/types/types.js +13 -0
- package/package.json +82 -0
|
@@ -0,0 +1,815 @@
|
|
|
1
|
+
/* Generated by @stackstackstack/dsh-typert-generator from FaceModel — do not edit. */
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const _stackstackstack_dsh_goal_goals_clear_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
5
|
+
const _stackstackstack_dsh_goal_goals_clear_parameter_1$schema = z.object({
|
|
6
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
7
|
+
'revision': z.number().readonly(),
|
|
8
|
+
})
|
|
9
|
+
const _stackstackstack_dsh_goal_goals_clear_result$schema = z.object({
|
|
10
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
11
|
+
'revision': z.number().readonly(),
|
|
12
|
+
})
|
|
13
|
+
const _stackstackstack_dsh_goal_goals_complete_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
14
|
+
const _stackstackstack_dsh_goal_goals_complete_parameter_1$schema = z.object({
|
|
15
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
16
|
+
'revision': z.number().readonly(),
|
|
17
|
+
})
|
|
18
|
+
const _stackstackstack_dsh_goal_goals_complete_result$schema = z.object({
|
|
19
|
+
'roundsStarted': z.number().readonly(),
|
|
20
|
+
'createdAt': z.number().readonly(),
|
|
21
|
+
'updatedAt': z.number().readonly(),
|
|
22
|
+
'activation': z.union([z.literal("armed"), z.literal("disarmed")]).readonly(),
|
|
23
|
+
'objective': z.string().readonly(),
|
|
24
|
+
'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
|
|
25
|
+
'blockedReason': z.object({
|
|
26
|
+
'code': z.string().readonly(),
|
|
27
|
+
'message': z.string().readonly(),
|
|
28
|
+
}).readonly().optional(),
|
|
29
|
+
'maxGoalRounds': z.number().readonly(),
|
|
30
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
31
|
+
'revision': z.number().readonly(),
|
|
32
|
+
})
|
|
33
|
+
const _stackstackstack_dsh_goal_goals_create_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
34
|
+
const _stackstackstack_dsh_goal_goals_create_parameter_1$schema = z.object({
|
|
35
|
+
'objective': z.string().readonly(),
|
|
36
|
+
'maxGoalRounds': z.number().readonly().optional(),
|
|
37
|
+
})
|
|
38
|
+
const _stackstackstack_dsh_goal_goals_create_result$schema = z.object({
|
|
39
|
+
'ref': z.object({
|
|
40
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
41
|
+
'revision': z.number().readonly(),
|
|
42
|
+
}).readonly(),
|
|
43
|
+
})
|
|
44
|
+
const _stackstackstack_dsh_goal_goals_edit_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
45
|
+
const _stackstackstack_dsh_goal_goals_edit_parameter_1$schema = z.object({
|
|
46
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
47
|
+
'revision': z.number().readonly(),
|
|
48
|
+
})
|
|
49
|
+
const _stackstackstack_dsh_goal_goals_edit_parameter_2$schema = z.object({
|
|
50
|
+
'objective': z.string().readonly().optional(),
|
|
51
|
+
'maxGoalRounds': z.number().readonly().optional(),
|
|
52
|
+
})
|
|
53
|
+
const _stackstackstack_dsh_goal_goals_edit_result$schema = z.object({
|
|
54
|
+
'roundsStarted': z.number().readonly(),
|
|
55
|
+
'createdAt': z.number().readonly(),
|
|
56
|
+
'updatedAt': z.number().readonly(),
|
|
57
|
+
'activation': z.union([z.literal("armed"), z.literal("disarmed")]).readonly(),
|
|
58
|
+
'objective': z.string().readonly(),
|
|
59
|
+
'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
|
|
60
|
+
'blockedReason': z.object({
|
|
61
|
+
'code': z.string().readonly(),
|
|
62
|
+
'message': z.string().readonly(),
|
|
63
|
+
}).readonly().optional(),
|
|
64
|
+
'maxGoalRounds': z.number().readonly(),
|
|
65
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
66
|
+
'revision': z.number().readonly(),
|
|
67
|
+
})
|
|
68
|
+
const _stackstackstack_dsh_goal_goals_pause_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
69
|
+
const _stackstackstack_dsh_goal_goals_pause_parameter_1$schema = z.object({
|
|
70
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
71
|
+
'revision': z.number().readonly(),
|
|
72
|
+
})
|
|
73
|
+
const _stackstackstack_dsh_goal_goals_pause_result$schema = z.object({
|
|
74
|
+
'roundsStarted': z.number().readonly(),
|
|
75
|
+
'createdAt': z.number().readonly(),
|
|
76
|
+
'updatedAt': z.number().readonly(),
|
|
77
|
+
'activation': z.union([z.literal("armed"), z.literal("disarmed")]).readonly(),
|
|
78
|
+
'objective': z.string().readonly(),
|
|
79
|
+
'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
|
|
80
|
+
'blockedReason': z.object({
|
|
81
|
+
'code': z.string().readonly(),
|
|
82
|
+
'message': z.string().readonly(),
|
|
83
|
+
}).readonly().optional(),
|
|
84
|
+
'maxGoalRounds': z.number().readonly(),
|
|
85
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
86
|
+
'revision': z.number().readonly(),
|
|
87
|
+
})
|
|
88
|
+
const _stackstackstack_dsh_goal_goals_resume_parameter_0$schema = z.intersection(z.string(), z.unknown())
|
|
89
|
+
const _stackstackstack_dsh_goal_goals_resume_parameter_1$schema = z.object({
|
|
90
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
91
|
+
'revision': z.number().readonly(),
|
|
92
|
+
})
|
|
93
|
+
const _stackstackstack_dsh_goal_goals_resume_result$schema = z.object({
|
|
94
|
+
'roundsStarted': z.number().readonly(),
|
|
95
|
+
'createdAt': z.number().readonly(),
|
|
96
|
+
'updatedAt': z.number().readonly(),
|
|
97
|
+
'activation': z.union([z.literal("armed"), z.literal("disarmed")]).readonly(),
|
|
98
|
+
'objective': z.string().readonly(),
|
|
99
|
+
'phase': z.union([z.literal("active"), z.literal("paused"), z.literal("blocked"), z.literal("complete")]).readonly(),
|
|
100
|
+
'blockedReason': z.object({
|
|
101
|
+
'code': z.string().readonly(),
|
|
102
|
+
'message': z.string().readonly(),
|
|
103
|
+
}).readonly().optional(),
|
|
104
|
+
'maxGoalRounds': z.number().readonly(),
|
|
105
|
+
'id': z.intersection(z.string(), z.unknown()).readonly(),
|
|
106
|
+
'revision': z.number().readonly(),
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
export const TYPERT = {
|
|
110
|
+
package: '@stackstackstack/dsh-goal',
|
|
111
|
+
face: 'host',
|
|
112
|
+
schemas: [
|
|
113
|
+
],
|
|
114
|
+
invocations: [
|
|
115
|
+
{
|
|
116
|
+
id: '@stackstackstack/dsh-goal#goals/clear',
|
|
117
|
+
service: 'goals',
|
|
118
|
+
namespace: 'goals',
|
|
119
|
+
method: 'clear',
|
|
120
|
+
invocation: { kind: 'direct' },
|
|
121
|
+
scope: {
|
|
122
|
+
context: 'agent',
|
|
123
|
+
wire: 'agentId',
|
|
124
|
+
},
|
|
125
|
+
parameters: [
|
|
126
|
+
{
|
|
127
|
+
name: 'agent',
|
|
128
|
+
wire: 'agentId',
|
|
129
|
+
source: 'lookup',
|
|
130
|
+
lookup: 'agent',
|
|
131
|
+
codec: {
|
|
132
|
+
mode: 'strict',
|
|
133
|
+
typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
|
|
134
|
+
schema: _stackstackstack_dsh_goal_goals_clear_parameter_0$schema,
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'ref',
|
|
139
|
+
wire: 'ref',
|
|
140
|
+
source: 'json',
|
|
141
|
+
codec: {
|
|
142
|
+
mode: 'strict',
|
|
143
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalRef',
|
|
144
|
+
schema: _stackstackstack_dsh_goal_goals_clear_parameter_1$schema,
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
result: {
|
|
149
|
+
mode: 'strict',
|
|
150
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalRef',
|
|
151
|
+
schema: _stackstackstack_dsh_goal_goals_clear_result$schema,
|
|
152
|
+
},
|
|
153
|
+
sourceLocation: {"file":"packages/goal/goal/src/index.ts","line":377,"column":3},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: '@stackstackstack/dsh-goal#goals/complete',
|
|
157
|
+
service: 'goals',
|
|
158
|
+
namespace: 'goals',
|
|
159
|
+
method: 'complete',
|
|
160
|
+
invocation: { kind: 'direct' },
|
|
161
|
+
scope: {
|
|
162
|
+
context: 'agent',
|
|
163
|
+
wire: 'agentId',
|
|
164
|
+
},
|
|
165
|
+
parameters: [
|
|
166
|
+
{
|
|
167
|
+
name: 'agent',
|
|
168
|
+
wire: 'agentId',
|
|
169
|
+
source: 'lookup',
|
|
170
|
+
lookup: 'agent',
|
|
171
|
+
codec: {
|
|
172
|
+
mode: 'strict',
|
|
173
|
+
typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
|
|
174
|
+
schema: _stackstackstack_dsh_goal_goals_complete_parameter_0$schema,
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'ref',
|
|
179
|
+
wire: 'ref',
|
|
180
|
+
source: 'json',
|
|
181
|
+
codec: {
|
|
182
|
+
mode: 'strict',
|
|
183
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalRef',
|
|
184
|
+
schema: _stackstackstack_dsh_goal_goals_complete_parameter_1$schema,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
result: {
|
|
189
|
+
mode: 'strict',
|
|
190
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalView',
|
|
191
|
+
schema: _stackstackstack_dsh_goal_goals_complete_result$schema,
|
|
192
|
+
},
|
|
193
|
+
sourceLocation: {"file":"packages/goal/goal/src/index.ts","line":337,"column":3},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: '@stackstackstack/dsh-goal#goals/create',
|
|
197
|
+
service: 'goals',
|
|
198
|
+
namespace: 'goals',
|
|
199
|
+
method: 'create',
|
|
200
|
+
implementation: 'remoteExportCreate',
|
|
201
|
+
invocation: { kind: 'direct' },
|
|
202
|
+
scope: {
|
|
203
|
+
context: 'agent',
|
|
204
|
+
wire: 'agentId',
|
|
205
|
+
},
|
|
206
|
+
parameters: [
|
|
207
|
+
{
|
|
208
|
+
name: 'agent',
|
|
209
|
+
wire: 'agentId',
|
|
210
|
+
source: 'lookup',
|
|
211
|
+
lookup: 'agent',
|
|
212
|
+
codec: {
|
|
213
|
+
mode: 'strict',
|
|
214
|
+
typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
|
|
215
|
+
schema: _stackstackstack_dsh_goal_goals_create_parameter_0$schema,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'request',
|
|
220
|
+
wire: 'request',
|
|
221
|
+
source: 'json',
|
|
222
|
+
codec: {
|
|
223
|
+
mode: 'strict',
|
|
224
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#CreateGoalRequest',
|
|
225
|
+
schema: _stackstackstack_dsh_goal_goals_create_parameter_1$schema,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
result: {
|
|
230
|
+
mode: 'strict',
|
|
231
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#CreateGoalResult',
|
|
232
|
+
schema: _stackstackstack_dsh_goal_goals_create_result$schema,
|
|
233
|
+
},
|
|
234
|
+
sourceLocation: {"file":"packages/goal/goal/src/index.ts","line":586,"column":3},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: '@stackstackstack/dsh-goal#goals/edit',
|
|
238
|
+
service: 'goals',
|
|
239
|
+
namespace: 'goals',
|
|
240
|
+
method: 'edit',
|
|
241
|
+
invocation: { kind: 'direct' },
|
|
242
|
+
scope: {
|
|
243
|
+
context: 'agent',
|
|
244
|
+
wire: 'agentId',
|
|
245
|
+
},
|
|
246
|
+
parameters: [
|
|
247
|
+
{
|
|
248
|
+
name: 'agent',
|
|
249
|
+
wire: 'agentId',
|
|
250
|
+
source: 'lookup',
|
|
251
|
+
lookup: 'agent',
|
|
252
|
+
codec: {
|
|
253
|
+
mode: 'strict',
|
|
254
|
+
typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
|
|
255
|
+
schema: _stackstackstack_dsh_goal_goals_edit_parameter_0$schema,
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: 'ref',
|
|
260
|
+
wire: 'ref',
|
|
261
|
+
source: 'json',
|
|
262
|
+
codec: {
|
|
263
|
+
mode: 'strict',
|
|
264
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalRef',
|
|
265
|
+
schema: _stackstackstack_dsh_goal_goals_edit_parameter_1$schema,
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'request',
|
|
270
|
+
wire: 'request',
|
|
271
|
+
source: 'json',
|
|
272
|
+
codec: {
|
|
273
|
+
mode: 'strict',
|
|
274
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#EditGoalRequest',
|
|
275
|
+
schema: _stackstackstack_dsh_goal_goals_edit_parameter_2$schema,
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
result: {
|
|
280
|
+
mode: 'strict',
|
|
281
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalView',
|
|
282
|
+
schema: _stackstackstack_dsh_goal_goals_edit_result$schema,
|
|
283
|
+
},
|
|
284
|
+
sourceLocation: {"file":"packages/goal/goal/src/index.ts","line":277,"column":3},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: '@stackstackstack/dsh-goal#goals/pause',
|
|
288
|
+
service: 'goals',
|
|
289
|
+
namespace: 'goals',
|
|
290
|
+
method: 'pause',
|
|
291
|
+
invocation: { kind: 'direct' },
|
|
292
|
+
scope: {
|
|
293
|
+
context: 'agent',
|
|
294
|
+
wire: 'agentId',
|
|
295
|
+
},
|
|
296
|
+
parameters: [
|
|
297
|
+
{
|
|
298
|
+
name: 'agent',
|
|
299
|
+
wire: 'agentId',
|
|
300
|
+
source: 'lookup',
|
|
301
|
+
lookup: 'agent',
|
|
302
|
+
codec: {
|
|
303
|
+
mode: 'strict',
|
|
304
|
+
typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
|
|
305
|
+
schema: _stackstackstack_dsh_goal_goals_pause_parameter_0$schema,
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'ref',
|
|
310
|
+
wire: 'ref',
|
|
311
|
+
source: 'json',
|
|
312
|
+
codec: {
|
|
313
|
+
mode: 'strict',
|
|
314
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalRef',
|
|
315
|
+
schema: _stackstackstack_dsh_goal_goals_pause_parameter_1$schema,
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
result: {
|
|
320
|
+
mode: 'strict',
|
|
321
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalView',
|
|
322
|
+
schema: _stackstackstack_dsh_goal_goals_pause_result$schema,
|
|
323
|
+
},
|
|
324
|
+
sourceLocation: {"file":"packages/goal/goal/src/index.ts","line":299,"column":3},
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: '@stackstackstack/dsh-goal#goals/resume',
|
|
328
|
+
service: 'goals',
|
|
329
|
+
namespace: 'goals',
|
|
330
|
+
method: 'resume',
|
|
331
|
+
invocation: { kind: 'direct' },
|
|
332
|
+
scope: {
|
|
333
|
+
context: 'agent',
|
|
334
|
+
wire: 'agentId',
|
|
335
|
+
},
|
|
336
|
+
parameters: [
|
|
337
|
+
{
|
|
338
|
+
name: 'agent',
|
|
339
|
+
wire: 'agentId',
|
|
340
|
+
source: 'lookup',
|
|
341
|
+
lookup: 'agent',
|
|
342
|
+
codec: {
|
|
343
|
+
mode: 'strict',
|
|
344
|
+
typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
|
|
345
|
+
schema: _stackstackstack_dsh_goal_goals_resume_parameter_0$schema,
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: 'ref',
|
|
350
|
+
wire: 'ref',
|
|
351
|
+
source: 'json',
|
|
352
|
+
codec: {
|
|
353
|
+
mode: 'strict',
|
|
354
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalRef',
|
|
355
|
+
schema: _stackstackstack_dsh_goal_goals_resume_parameter_1$schema,
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
],
|
|
359
|
+
result: {
|
|
360
|
+
mode: 'strict',
|
|
361
|
+
typeSymbol: '@stackstackstack/dsh-goal/client#GoalView',
|
|
362
|
+
schema: _stackstackstack_dsh_goal_goals_resume_result$schema,
|
|
363
|
+
},
|
|
364
|
+
sourceLocation: {"file":"packages/goal/goal/src/index.ts","line":311,"column":3},
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
model: {
|
|
368
|
+
"services": [
|
|
369
|
+
{
|
|
370
|
+
"description": "Goal service (`ctx.goals`) backed exclusively by the owning session log.",
|
|
371
|
+
"summary": "Goal service (`ctx.goals`) backed exclusively by the owning session log.",
|
|
372
|
+
"tags": [],
|
|
373
|
+
"jsDoc": "/** Goal service (`ctx.goals`) backed exclusively by the owning session log. */",
|
|
374
|
+
"key": "goals",
|
|
375
|
+
"exportName": "GoalService",
|
|
376
|
+
"members": [
|
|
377
|
+
{
|
|
378
|
+
"kind": "method",
|
|
379
|
+
"name": "get",
|
|
380
|
+
"signature": "get(agent: Agent): GoalView | undefined",
|
|
381
|
+
"summary": "Read the current goal for one exact live agent.",
|
|
382
|
+
"jsDoc": "/**\n * Read the current goal for one exact live agent.\n * @param agent - owning live agent.\n * @returns a fresh view or `undefined` when no goal is current.\n * @throws {@link GoalError} when the agent is not the registry's live instance.\n */"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"kind": "method",
|
|
386
|
+
"name": "disarm",
|
|
387
|
+
"signature": "disarm(agent: Agent): GoalView | undefined",
|
|
388
|
+
"summary": "Remove process-local continuation authority without changing durable goal phase or revision.",
|
|
389
|
+
"jsDoc": "/**\n * Remove process-local continuation authority without changing durable goal\n * phase or revision. Lifecycle owners use this before unloading a driver;\n * a later human-authorized {@link resume} records the new activation edge.\n * @param agent - owning live agent.\n * @returns a fresh disarmed view, or `undefined` when no goal is current.\n */"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"kind": "method",
|
|
393
|
+
"name": "create",
|
|
394
|
+
"signature": "create(agent: Agent, request: CreateGoalRequest): GoalView",
|
|
395
|
+
"summary": "Create and arm a goal.",
|
|
396
|
+
"jsDoc": "/**\n * Create and arm a goal. A completed goal may be replaced; every other\n * current phase must be cleared or resumed instead.\n * @param agent - owning live agent.\n * @param request - objective and optional round cap.\n * @returns the created live view.\n */"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"kind": "method",
|
|
400
|
+
"name": "edit",
|
|
401
|
+
"signature": "@Remote('edit') edit(agent: Agent, ref: GoalRef, request: EditGoalRequest): GoalView",
|
|
402
|
+
"summary": "Edit objective and/or round cap without changing phase.",
|
|
403
|
+
"jsDoc": "/**\n * Edit objective and/or round cap without changing phase.\n * @param agent - owning live agent.\n * @param ref - expected current revision.\n * @param request - at least one replacement field.\n * @returns the edited view.\n */"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"kind": "method",
|
|
407
|
+
"name": "pause",
|
|
408
|
+
"signature": "@Remote('pause') pause(agent: Agent, ref: GoalRef): GoalView",
|
|
409
|
+
"summary": "Pause an active goal and disarm automatic continuation.",
|
|
410
|
+
"jsDoc": "/**\n * Pause an active goal and disarm automatic continuation.\n * @param agent - owning live agent.\n * @param ref - expected current revision.\n * @returns the paused view.\n */"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"kind": "method",
|
|
414
|
+
"name": "resume",
|
|
415
|
+
"signature": "@Remote('resume') resume(agent: Agent, ref: GoalRef): GoalView",
|
|
416
|
+
"summary": "Resume and arm a stopped goal, or rearm an active goal after a session-start edge, while its round budget still has capacity.",
|
|
417
|
+
"jsDoc": "/**\n * Resume and arm a stopped goal, or rearm an active goal after a\n * session-start edge, while its round budget still has capacity.\n * @param agent - owning live agent.\n * @param ref - expected current revision.\n * @returns the active view.\n */"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"kind": "method",
|
|
421
|
+
"name": "complete",
|
|
422
|
+
"signature": "@Remote('complete') complete(agent: Agent, ref: GoalRef): GoalView",
|
|
423
|
+
"summary": "Mark a current non-complete goal complete and disarm it.",
|
|
424
|
+
"jsDoc": "/**\n * Mark a current non-complete goal complete and disarm it.\n * @param agent - owning live agent.\n * @param ref - expected current revision.\n * @returns the completed view.\n */"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"kind": "method",
|
|
428
|
+
"name": "block",
|
|
429
|
+
"signature": "block(agent: Agent, ref: GoalRef, reason: GoalBlockReason): GoalView",
|
|
430
|
+
"summary": "Mark an active goal blocked and disarm it.",
|
|
431
|
+
"jsDoc": "/**\n * Mark an active goal blocked and disarm it.\n * @param agent - owning live agent.\n * @param ref - expected current revision.\n * @param reason - policy-owned stable code and human-readable explanation.\n * @returns the blocked view with its durable reason.\n */"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"kind": "method",
|
|
435
|
+
"name": "clear",
|
|
436
|
+
"signature": "@Remote('clear') clear(agent: Agent, ref: GoalRef): GoalRef",
|
|
437
|
+
"summary": "Clear the current goal while retaining a durable tombstone and history.",
|
|
438
|
+
"jsDoc": "/**\n * Clear the current goal while retaining a durable tombstone and history.\n * @param agent - owning live agent.\n * @param ref - expected current revision.\n * @returns the tombstone ref whose revision is one past the cleared snapshot.\n */"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"kind": "method",
|
|
442
|
+
"name": "remoteExportCreate",
|
|
443
|
+
"signature": "@Remote('create') remoteExportCreate(agent: Agent, request: CreateGoalRequest): CreateGoalResult",
|
|
444
|
+
"summary": "Create one Goal through the remote boundary.",
|
|
445
|
+
"jsDoc": "/**\n * Create one Goal through the remote boundary.\n * @param agent - exact live Agent resolved from the wire identity.\n * @param request - objective and optional round cap.\n * @returns the created Goal identity.\n */"
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"types": [
|
|
449
|
+
{
|
|
450
|
+
"name": "Agent",
|
|
451
|
+
"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}"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"name": "AgentCancelCause",
|
|
455
|
+
"declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"name": "AgentOptions",
|
|
459
|
+
"declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n maxTokens?: number;\n}"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"name": "AgentStatus",
|
|
463
|
+
"declaration": "export type AgentStatus = 'idle' | 'running';"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"name": "ApprovalOutcome",
|
|
467
|
+
"declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "ApprovalPolicy",
|
|
471
|
+
"declaration": "export type ApprovalPolicy = 'ask' | 'never';"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"name": "ApprovalRequestId",
|
|
475
|
+
"declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"name": "AssistantMessage",
|
|
479
|
+
"declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "AssistantProvenance",
|
|
483
|
+
"declaration": "export interface AssistantProvenance {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"name": "AttachmentId",
|
|
487
|
+
"declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"name": "Branded",
|
|
491
|
+
"declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"name": "CallId",
|
|
495
|
+
"declaration": "export type CallId = Branded<'CallId'>;"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"name": "CancelOptions",
|
|
499
|
+
"declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"name": "CodeDispatchEventData",
|
|
503
|
+
"declaration": "export interface CodeDispatchEventData extends CodeDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n}"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"name": "CodeDispatchStartEventData",
|
|
507
|
+
"declaration": "export interface CodeDispatchStartEventData {\n rootCallId: CallId;\n parentCallId: CallId;\n subCallId: CallId;\n name: string;\n arguments: unknown;\n}"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"name": "CommandId",
|
|
511
|
+
"declaration": "export type CommandId = Branded<'CommandId'>;"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "CommandSource",
|
|
515
|
+
"declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"name": "CommandSourceMap",
|
|
519
|
+
"declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"name": "ContentBlock",
|
|
523
|
+
"declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"name": "ContentBlockMap",
|
|
527
|
+
"declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n 'tool-call': ToolCallBlock;\n 'tool-result': ToolResultBlock;\n}"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"name": "ContentBlockType",
|
|
531
|
+
"declaration": "export type ContentBlockType = keyof ContentBlockMap;"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "ContextFormed",
|
|
535
|
+
"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'; };"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"name": "ContextSnapshotSection",
|
|
539
|
+
"declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"name": "CreateGoalRequest",
|
|
543
|
+
"declaration": "export interface CreateGoalRequest {\n readonly objective: string;\n readonly maxGoalRounds?: number;\n}"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"name": "CreateGoalResult",
|
|
547
|
+
"declaration": "export interface CreateGoalResult {\n readonly ref: GoalRef;\n}"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"name": "EditGoalRequest",
|
|
551
|
+
"declaration": "export interface EditGoalRequest {\n readonly objective?: string;\n readonly maxGoalRounds?: number;\n}"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"name": "EpochHeader",
|
|
555
|
+
"declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n system?: string;\n tools?: ToolSchema[];\n}"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"name": "FinishReason",
|
|
559
|
+
"declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
"name": "FinishReasonMap",
|
|
563
|
+
"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}"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"name": "GoalActivation",
|
|
567
|
+
"declaration": "export type GoalActivation = 'armed' | 'disarmed';"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"name": "GoalBlockReason",
|
|
571
|
+
"declaration": "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"name": "GoalChangeMeta",
|
|
575
|
+
"declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "GoalClearChangeMeta",
|
|
579
|
+
"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}"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "GoalId",
|
|
583
|
+
"declaration": "export type GoalId = Branded<'GoalId'>;"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"name": "GoalMessageSource",
|
|
587
|
+
"declaration": "export interface GoalMessageSource {\n readonly kind: 'goal';\n readonly goalId: GoalId;\n readonly revision: number;\n readonly round: number;\n}"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"name": "GoalOperation",
|
|
591
|
+
"declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"name": "GoalPhase",
|
|
595
|
+
"declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"name": "GoalRef",
|
|
599
|
+
"declaration": "export interface GoalRef {\n readonly id: GoalId;\n readonly revision: number;\n}"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"name": "GoalSnapshot",
|
|
603
|
+
"declaration": "export interface GoalSnapshot extends GoalRef {\n readonly objective: string;\n readonly phase: GoalPhase;\n readonly blockedReason?: GoalBlockReason;\n readonly maxGoalRounds: number;\n}"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"name": "GoalSnapshotChangeMeta",
|
|
607
|
+
"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}"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"name": "GoalView",
|
|
611
|
+
"declaration": "export interface GoalView extends GoalSnapshot {\n readonly roundsStarted: number;\n readonly createdAt: number;\n readonly updatedAt: number;\n readonly activation: GoalActivation;\n}"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"name": "ImageAttachmentRef",
|
|
615
|
+
"declaration": "export interface ImageAttachmentRef {\n attachmentId: AttachmentId;\n mediaType: ImageMediaType;\n bytes: number;\n width: number;\n height: number;\n name?: string;\n}"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "ImageBlock",
|
|
619
|
+
"declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n}"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"name": "ImageMediaType",
|
|
623
|
+
"declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"name": "Inbox",
|
|
627
|
+
"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}"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"name": "InboxTarget",
|
|
631
|
+
"declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"name": "JsonValue",
|
|
635
|
+
"declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"name": "LlmCallConfig",
|
|
639
|
+
"declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"name": "LlmCallConfigAdapterDefaults",
|
|
643
|
+
"declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"name": "LlmFailure",
|
|
647
|
+
"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}"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
"name": "Message",
|
|
651
|
+
"declaration": "export interface Message {\n readonly id: MessageId;\n readonly role: 'system' | 'user' | 'assistant';\n readonly content: ContentBlock[];\n readonly source: MessageSource;\n}"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"name": "MessageId",
|
|
655
|
+
"declaration": "export type MessageId = Branded<'MessageId'>;"
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
"name": "MessageSource",
|
|
659
|
+
"declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"name": "MessageSourceMap",
|
|
663
|
+
"declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n goal: GoalMessageSource;\n}"
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"name": "ModelMessageSource",
|
|
667
|
+
"declaration": "export interface ModelMessageSource extends AssistantProvenance {\n kind: 'model';\n}"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"name": "ProviderRequestId",
|
|
671
|
+
"declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"name": "ReasoningBlock",
|
|
675
|
+
"declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"name": "ReasoningEffortId",
|
|
679
|
+
"declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
"name": "RequestContext",
|
|
683
|
+
"declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n}"
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"name": "RequestHeaderReason",
|
|
687
|
+
"declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change';"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"name": "Session",
|
|
691
|
+
"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 requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"name": "SessionEvent",
|
|
695
|
+
"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];"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"name": "SessionEventMap",
|
|
699
|
+
"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; };\n 'tool/call': { turn: number; step: number; callId: CallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; }; meta?: JsonValue; };\n 'todo/write': { todos: TodoItem[]; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; };\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 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: number; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: CallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/code-dispatch-start': CodeDispatchStartEventData;\n 'tool/code-dispatch': CodeDispatchEventData;\n 'goal/change': GoalChangeMeta;\n}"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"name": "SessionEventType",
|
|
703
|
+
"declaration": "export type SessionEventType = keyof SessionEventMap;"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
"name": "SessionHeader",
|
|
707
|
+
"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}"
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"name": "SessionId",
|
|
711
|
+
"declaration": "export type SessionId = Branded<'SessionId'>;"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"name": "SessionSurface",
|
|
715
|
+
"declaration": "export interface SessionSurface {\n readonly nodes: readonly number[];\n readonly replaceGeneration: number;\n}"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"name": "StreamChunk",
|
|
719
|
+
"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: CallId; name?: string; argumentsDelta: string; } | { type: 'block-end'; index: number; block: ContentBlock; } | { type: 'usage'; usage: TokenUsage; } | { type: 'finish'; reason: FinishReason; replayState?: unknown; };"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"name": "SurfaceEventType",
|
|
723
|
+
"declaration": "export type SurfaceEventType = 'user/message' | 'assistant/message' | 'tool/result';"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "SurfaceIntent",
|
|
727
|
+
"declaration": "export interface SurfaceIntent {\n surfaceOp: SurfaceOp;\n sourceEventSeqs?: number[];\n}"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"name": "SurfaceOp",
|
|
731
|
+
"declaration": "export type SurfaceOp = 'append' | { op: 'replace'; start: number; end: number; };"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"name": "TextBlock",
|
|
735
|
+
"declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"name": "TodoItem",
|
|
739
|
+
"declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"name": "TokenUsage",
|
|
743
|
+
"declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"name": "ToolCallBlock",
|
|
747
|
+
"declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: CallId;\n name: string;\n arguments: string;\n}"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"name": "ToolMessageSource",
|
|
751
|
+
"declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: CallId;\n}"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"name": "ToolResultBlock",
|
|
755
|
+
"declaration": "export interface ToolResultBlock {\n type: 'tool-result';\n toolCallId: CallId;\n content: ContentBlock[];\n isError?: boolean;\n}"
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"name": "ToolResultMessage",
|
|
759
|
+
"declaration": "export interface ToolResultMessage extends Message {\n readonly role: 'user';\n readonly content: [ToolResultBlock];\n readonly source: ToolMessageSource;\n}"
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "ToolSchema",
|
|
763
|
+
"declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"name": "TurnEndCancelCause",
|
|
767
|
+
"declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"name": "TurnEndReason",
|
|
771
|
+
"declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"name": "TurnEndReasonMap",
|
|
775
|
+
"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}"
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "UserMessage",
|
|
779
|
+
"declaration": "export interface UserMessage extends Message {\n readonly role: 'user';\n}"
|
|
780
|
+
}
|
|
781
|
+
]
|
|
782
|
+
}
|
|
783
|
+
],
|
|
784
|
+
"events": [
|
|
785
|
+
{
|
|
786
|
+
"description": "Goal mutation accepted by one live agent. The matching `goal/change` session event has already committed. Listener failures are contained. Scope-filtered dispatch (`@stackstackstack/dsh-scope`): agent-scoped listeners receive only that agent.",
|
|
787
|
+
"summary": "Goal mutation accepted by one live agent.",
|
|
788
|
+
"tags": [
|
|
789
|
+
{
|
|
790
|
+
"name": "param",
|
|
791
|
+
"argument": "payload.agent",
|
|
792
|
+
"comment": "- agent whose session owns the goal.",
|
|
793
|
+
"text": "@param payload.agent - agent whose session owns the goal.\n *"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"name": "param",
|
|
797
|
+
"argument": "payload.change",
|
|
798
|
+
"comment": "- fresh current projection or clear tombstone.",
|
|
799
|
+
"text": "@param payload.change - fresh current projection or clear tombstone.\n *"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"name": "mode",
|
|
803
|
+
"comment": "emit",
|
|
804
|
+
"text": "@mode emit"
|
|
805
|
+
}
|
|
806
|
+
],
|
|
807
|
+
"jsDoc": "/**\n * Goal mutation accepted by one live agent. The matching `goal/change`\n * session event has already committed. Listener failures are contained.\n * Scope-filtered dispatch (`@stackstackstack/dsh-scope`): agent-scoped listeners receive only that agent.\n * @param payload.agent - agent whose session owns the goal.\n * @param payload.change - fresh current projection or clear tombstone.\n * @mode emit\n */",
|
|
808
|
+
"name": "goal/changed",
|
|
809
|
+
"mode": "emit",
|
|
810
|
+
"signature": "'goal/changed'(this: import('@stackstackstack/dsh-scope').Scoped<Agent>, payload: { agent: Agent; change: GoalChanged; }): void"
|
|
811
|
+
}
|
|
812
|
+
],
|
|
813
|
+
"objects": []
|
|
814
|
+
},
|
|
815
|
+
}
|