@deepseek-ai/dsh-api-session-controller 0.1.2-rc.1 → 0.1.5-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +16 -6
- package/README.zh.md +16 -6
- package/lib/client.js +838 -58
- package/lib/index.js +376 -243
- package/lib/typert.host.js +236 -178
- package/lib/typert.remote-client.js +97 -115
- package/lib/types/agent.js +6 -8
- package/lib/types/assistant-stream.d.ts +26 -0
- package/lib/types/assistant-stream.js +83 -0
- package/lib/types/client/contract/events.d.ts +38 -7
- package/lib/types/client/contract/events.js +21 -0
- package/lib/types/client/contract/session.d.ts +7 -7
- package/lib/types/client/contract/snapshot.d.ts +15 -2
- package/lib/types/client/index.d.ts +2 -2
- package/lib/types/client/index.js +2 -0
- package/lib/types/client/session-wire-event.d.ts +11 -0
- package/lib/types/client/session-wire-event.js +43 -0
- package/lib/types/client/sessions/assistant-stream.d.ts +51 -0
- package/lib/types/client/sessions/assistant-stream.js +168 -0
- package/lib/types/client/sessions/history-records.d.ts +2 -2
- package/lib/types/client/sessions/history-records.js +3 -8
- package/lib/types/client/sessions/queue-mirror.js +3 -3
- package/lib/types/client/sessions/remotes.d.ts +2 -2
- package/lib/types/client/sessions/session.d.ts +3 -1
- package/lib/types/client/sessions/session.js +63 -15
- package/lib/types/client/transport.d.ts +7 -3
- package/lib/types/client/transport.js +24 -3
- package/lib/types/commands.d.ts +1 -1
- package/lib/types/commands.js +112 -32
- package/lib/types/control.d.ts +0 -1
- package/lib/types/control.js +19 -22
- package/lib/types/history.d.ts +2 -1
- package/lib/types/history.js +66 -37
- package/lib/types/index.d.ts +4 -4
- package/lib/types/index.js +15 -5
- package/lib/types/list.d.ts +2 -9
- package/lib/types/list.js +10 -124
- package/lib/types/media-references.d.ts +16 -0
- package/lib/types/media-references.js +77 -0
- package/lib/types/types.d.ts +85 -35
- package/package.json +71 -58
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
import { z } from 'zod'
|
|
3
3
|
|
|
4
4
|
const ContentBlockRemoteCodec$schema = z.union([z.object({
|
|
5
|
+
'type': z.literal("file"),
|
|
6
|
+
'attachment': z.object({
|
|
7
|
+
'attachmentId': z.intersection(z.string(), z.unknown()),
|
|
8
|
+
'name': z.string(),
|
|
9
|
+
'bytes': z.number(),
|
|
10
|
+
}),
|
|
11
|
+
}), z.object({
|
|
5
12
|
'type': z.literal("text"),
|
|
6
13
|
'text': z.string(),
|
|
7
14
|
}), z.object({
|
|
@@ -92,6 +99,10 @@ const _deepseek_ai_dsh_api_session_controller_session_control_result$schema = z.
|
|
|
92
99
|
'projections': z.record(z.intersection(z.string(), z.unknown()), z.object({
|
|
93
100
|
'asOfSeq': z.number().readonly(),
|
|
94
101
|
'values': z.intersection(z.object({
|
|
102
|
+
'inbox': z.object({
|
|
103
|
+
'next-turn': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4))])).readonly(),
|
|
104
|
+
'next-step': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema4)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema4))])).readonly(),
|
|
105
|
+
}).optional(),
|
|
95
106
|
'agentPreset': z.union([z.literal(null), z.string()]).optional(),
|
|
96
107
|
'title': z.union([z.literal(null), z.string()]).optional(),
|
|
97
108
|
'todos': z.union([z.literal(null), z.array(z.object({
|
|
@@ -210,6 +221,7 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_parameter_0$schema
|
|
|
210
221
|
'mode': z.union([z.literal("one-shot"), z.literal("continuable")]).readonly(),
|
|
211
222
|
})]).readonly(),
|
|
212
223
|
'maxMessages': z.number().readonly().optional(),
|
|
224
|
+
'assistantStream': z.literal(true).readonly().optional(),
|
|
213
225
|
})
|
|
214
226
|
const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = z.union([z.object({
|
|
215
227
|
'type': z.literal("event").readonly(),
|
|
@@ -219,12 +231,8 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = z.u
|
|
|
219
231
|
'time': z.number().readonly(),
|
|
220
232
|
'data': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).readonly(),
|
|
221
233
|
'ignorable': z.literal(true).readonly().optional(),
|
|
222
|
-
'sourceEventSeqs': z.
|
|
223
|
-
'surfaceOp': z.union([z.literal(
|
|
224
|
-
'op': z.literal("replace").readonly(),
|
|
225
|
-
'start': z.number().readonly(),
|
|
226
|
-
'end': z.number().readonly(),
|
|
227
|
-
})]).readonly().optional(),
|
|
234
|
+
'sourceEventSeqs': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).readonly().optional(),
|
|
235
|
+
'surfaceOp': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).readonly().optional(),
|
|
228
236
|
}).readonly(),
|
|
229
237
|
}), z.object({
|
|
230
238
|
'type': z.literal("snapshot").readonly(),
|
|
@@ -234,13 +242,13 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = z.u
|
|
|
234
242
|
'createdAt': z.number().readonly(),
|
|
235
243
|
'cwd': z.string().readonly().optional(),
|
|
236
244
|
'parentSession': z.intersection(z.string(), z.unknown()).readonly().optional(),
|
|
237
|
-
'
|
|
245
|
+
'isSeeded': z.boolean().readonly(),
|
|
238
246
|
'origin': z.literal("subagent").readonly().optional(),
|
|
239
247
|
'delegationDepth': z.number().readonly().optional(),
|
|
240
248
|
'agentPreset': z.string().readonly().optional(),
|
|
241
249
|
}).readonly(),
|
|
242
250
|
'cursor': z.number().readonly(),
|
|
243
|
-
'records': z.array(z.
|
|
251
|
+
'records': z.array(z.object({
|
|
244
252
|
'type': z.literal("event").readonly(),
|
|
245
253
|
'event': z.object({
|
|
246
254
|
'type': z.string().readonly(),
|
|
@@ -248,56 +256,18 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = z.u
|
|
|
248
256
|
'time': z.number().readonly(),
|
|
249
257
|
'data': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).readonly(),
|
|
250
258
|
'ignorable': z.literal(true).readonly().optional(),
|
|
251
|
-
'sourceEventSeqs': z.
|
|
252
|
-
'surfaceOp': z.union([z.literal(
|
|
253
|
-
'op': z.literal("replace").readonly(),
|
|
254
|
-
'start': z.number().readonly(),
|
|
255
|
-
'end': z.number().readonly(),
|
|
256
|
-
})]).readonly().optional(),
|
|
257
|
-
}).readonly(),
|
|
258
|
-
}), z.object({
|
|
259
|
-
'type': z.literal("chunks").readonly(),
|
|
260
|
-
'event': z.union([z.object({
|
|
261
|
-
'type': z.literal("chunkrow/text-chunks").readonly(),
|
|
262
|
-
'seq': z.number().readonly(),
|
|
263
|
-
'time': z.number().readonly(),
|
|
264
|
-
'data': z.object({
|
|
265
|
-
'texts': z.array(z.string()),
|
|
266
|
-
'turn': z.number(),
|
|
267
|
-
'step': z.number(),
|
|
268
|
-
'index': z.number(),
|
|
269
|
-
'dt': z.array(z.number()),
|
|
270
|
-
}).readonly(),
|
|
271
|
-
}), z.object({
|
|
272
|
-
'type': z.literal("chunkrow/reasoning-chunks").readonly(),
|
|
273
|
-
'seq': z.number().readonly(),
|
|
274
|
-
'time': z.number().readonly(),
|
|
275
|
-
'data': z.object({
|
|
276
|
-
'texts': z.array(z.string()),
|
|
277
|
-
'turn': z.number(),
|
|
278
|
-
'step': z.number(),
|
|
279
|
-
'index': z.number(),
|
|
280
|
-
'dt': z.array(z.number()),
|
|
281
|
-
}).readonly(),
|
|
282
|
-
}), z.object({
|
|
283
|
-
'type': z.literal("chunkrow/tool-call-chunks").readonly(),
|
|
284
|
-
'seq': z.number().readonly(),
|
|
285
|
-
'time': z.number().readonly(),
|
|
286
|
-
'data': z.object({
|
|
287
|
-
'id': z.intersection(z.string(), z.unknown()),
|
|
288
|
-
'name': z.string().optional(),
|
|
289
|
-
'args': z.array(z.string()),
|
|
290
|
-
'turn': z.number(),
|
|
291
|
-
'step': z.number(),
|
|
292
|
-
'index': z.number(),
|
|
293
|
-
'dt': z.array(z.number()),
|
|
259
|
+
'sourceEventSeqs': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).readonly().optional(),
|
|
260
|
+
'surfaceOp': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).readonly().optional(),
|
|
294
261
|
}).readonly(),
|
|
295
|
-
})
|
|
296
|
-
})])).readonly(),
|
|
262
|
+
})).readonly(),
|
|
297
263
|
'hasMore': z.boolean().readonly(),
|
|
298
264
|
'projections': z.object({
|
|
299
265
|
'asOfSeq': z.number().readonly(),
|
|
300
266
|
'values': z.intersection(z.object({
|
|
267
|
+
'inbox': z.object({
|
|
268
|
+
'next-turn': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))])).readonly(),
|
|
269
|
+
'next-step': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))])).readonly(),
|
|
270
|
+
}).optional(),
|
|
301
271
|
'agentPreset': z.union([z.literal(null), z.string()]).optional(),
|
|
302
272
|
'title': z.union([z.literal(null), z.string()]).optional(),
|
|
303
273
|
'todos': z.union([z.literal(null), z.array(z.object({
|
|
@@ -362,6 +332,46 @@ const _deepseek_ai_dsh_api_session_controller_session_follow_result$schema = z.u
|
|
|
362
332
|
})]).optional(),
|
|
363
333
|
}), z.record(z.string(), z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))])).readonly()).readonly(),
|
|
364
334
|
}).readonly(),
|
|
335
|
+
'assistantStream': z.object({
|
|
336
|
+
'revision': z.number().readonly(),
|
|
337
|
+
'activeAttempt': z.object({
|
|
338
|
+
'attemptId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
339
|
+
'startedAfterSeq': z.union([z.intersection(z.number(), z.unknown()), z.literal(-1)]).readonly(),
|
|
340
|
+
'turn': z.number().readonly(),
|
|
341
|
+
'step': z.number().readonly(),
|
|
342
|
+
'nextIndex': z.number().readonly(),
|
|
343
|
+
'stream': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))])).readonly(),
|
|
344
|
+
}).readonly().optional(),
|
|
345
|
+
}).readonly().optional(),
|
|
346
|
+
}), z.object({
|
|
347
|
+
'type': z.literal("assistant-stream").readonly(),
|
|
348
|
+
'frame': z.union([z.object({
|
|
349
|
+
'type': z.literal("start").readonly(),
|
|
350
|
+
'attemptId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
351
|
+
'revision': z.number().readonly(),
|
|
352
|
+
'startedAfterSeq': z.union([z.intersection(z.number(), z.unknown()), z.literal(-1)]).readonly(),
|
|
353
|
+
'turn': z.number().readonly(),
|
|
354
|
+
'step': z.number().readonly(),
|
|
355
|
+
}), z.object({
|
|
356
|
+
'type': z.literal("chunk").readonly(),
|
|
357
|
+
'attemptId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
358
|
+
'revision': z.number().readonly(),
|
|
359
|
+
'index': z.number().readonly(),
|
|
360
|
+
'time': z.number().readonly(),
|
|
361
|
+
'chunk': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema3)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema3))]).readonly(),
|
|
362
|
+
}), z.object({
|
|
363
|
+
'type': z.literal("end").readonly(),
|
|
364
|
+
'attemptId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
365
|
+
'revision': z.number().readonly(),
|
|
366
|
+
'index': z.number().readonly(),
|
|
367
|
+
'outcome': z.union([z.object({
|
|
368
|
+
'kind': z.literal("committed").readonly(),
|
|
369
|
+
'eventType': z.union([z.literal("assistant/message"), z.literal("assistant/attempt")]).readonly(),
|
|
370
|
+
'seq': z.number().readonly(),
|
|
371
|
+
}), z.object({
|
|
372
|
+
'kind': z.literal("abandoned").readonly(),
|
|
373
|
+
})]).readonly(),
|
|
374
|
+
})]).readonly(),
|
|
365
375
|
})])
|
|
366
376
|
const _deepseek_ai_dsh_api_session_controller_session_fork_parameter_0$schema = z.object({
|
|
367
377
|
'sessionId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
@@ -385,6 +395,10 @@ const _deepseek_ai_dsh_api_session_controller_session_list_result$schema = z.obj
|
|
|
385
395
|
'projections': z.object({
|
|
386
396
|
'asOfSeq': z.number().readonly(),
|
|
387
397
|
'values': z.intersection(z.object({
|
|
398
|
+
'inbox': z.object({
|
|
399
|
+
'next-turn': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))])).readonly(),
|
|
400
|
+
'next-step': z.array(z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema))])).readonly(),
|
|
401
|
+
}).optional(),
|
|
388
402
|
'agentPreset': z.union([z.literal(null), z.string()]).optional(),
|
|
389
403
|
'title': z.union([z.literal(null), z.string()]).optional(),
|
|
390
404
|
'todos': z.union([z.literal(null), z.array(z.object({
|
|
@@ -502,7 +516,7 @@ const _deepseek_ai_dsh_api_session_controller_session_page_parameter_0$schema =
|
|
|
502
516
|
'maxMessages': z.number().readonly().optional(),
|
|
503
517
|
})
|
|
504
518
|
const _deepseek_ai_dsh_api_session_controller_session_page_result$schema = z.object({
|
|
505
|
-
'records': z.array(z.
|
|
519
|
+
'records': z.array(z.object({
|
|
506
520
|
'type': z.literal("event").readonly(),
|
|
507
521
|
'event': z.object({
|
|
508
522
|
'type': z.string().readonly(),
|
|
@@ -510,52 +524,10 @@ const _deepseek_ai_dsh_api_session_controller_session_page_result$schema = z.obj
|
|
|
510
524
|
'time': z.number().readonly(),
|
|
511
525
|
'data': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2))]).readonly(),
|
|
512
526
|
'ignorable': z.literal(true).readonly().optional(),
|
|
513
|
-
'sourceEventSeqs': z.
|
|
514
|
-
'surfaceOp': z.union([z.literal(
|
|
515
|
-
'op': z.literal("replace").readonly(),
|
|
516
|
-
'start': z.number().readonly(),
|
|
517
|
-
'end': z.number().readonly(),
|
|
518
|
-
})]).readonly().optional(),
|
|
519
|
-
}).readonly(),
|
|
520
|
-
}), z.object({
|
|
521
|
-
'type': z.literal("chunks").readonly(),
|
|
522
|
-
'event': z.union([z.object({
|
|
523
|
-
'type': z.literal("chunkrow/text-chunks").readonly(),
|
|
524
|
-
'seq': z.number().readonly(),
|
|
525
|
-
'time': z.number().readonly(),
|
|
526
|
-
'data': z.object({
|
|
527
|
-
'texts': z.array(z.string()),
|
|
528
|
-
'turn': z.number(),
|
|
529
|
-
'step': z.number(),
|
|
530
|
-
'index': z.number(),
|
|
531
|
-
'dt': z.array(z.number()),
|
|
532
|
-
}).readonly(),
|
|
533
|
-
}), z.object({
|
|
534
|
-
'type': z.literal("chunkrow/reasoning-chunks").readonly(),
|
|
535
|
-
'seq': z.number().readonly(),
|
|
536
|
-
'time': z.number().readonly(),
|
|
537
|
-
'data': z.object({
|
|
538
|
-
'texts': z.array(z.string()),
|
|
539
|
-
'turn': z.number(),
|
|
540
|
-
'step': z.number(),
|
|
541
|
-
'index': z.number(),
|
|
542
|
-
'dt': z.array(z.number()),
|
|
527
|
+
'sourceEventSeqs': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2))]).readonly().optional(),
|
|
528
|
+
'surfaceOp': z.union([z.literal(null), z.string(), z.number(), z.literal(false), z.literal(true), z.array(z.lazy(() => JsonValueRemoteCodec$schema2)), z.record(z.string(), z.lazy(() => JsonValueRemoteCodec$schema2))]).readonly().optional(),
|
|
543
529
|
}).readonly(),
|
|
544
|
-
})
|
|
545
|
-
'type': z.literal("chunkrow/tool-call-chunks").readonly(),
|
|
546
|
-
'seq': z.number().readonly(),
|
|
547
|
-
'time': z.number().readonly(),
|
|
548
|
-
'data': z.object({
|
|
549
|
-
'id': z.intersection(z.string(), z.unknown()),
|
|
550
|
-
'name': z.string().optional(),
|
|
551
|
-
'args': z.array(z.string()),
|
|
552
|
-
'turn': z.number(),
|
|
553
|
-
'step': z.number(),
|
|
554
|
-
'index': z.number(),
|
|
555
|
-
'dt': z.array(z.number()),
|
|
556
|
-
}).readonly(),
|
|
557
|
-
})]).readonly(),
|
|
558
|
-
})])).readonly(),
|
|
530
|
+
})).readonly(),
|
|
559
531
|
'hasMore': z.boolean().readonly(),
|
|
560
532
|
})
|
|
561
533
|
const _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema = z.object({
|
|
@@ -570,6 +542,9 @@ const _deepseek_ai_dsh_api_session_controller_session_prompt_parameter_0$schema
|
|
|
570
542
|
'mediaType': z.union([z.literal("image/png"), z.literal("image/jpeg"), z.literal("image/webp"), z.literal("image/gif")]).readonly(),
|
|
571
543
|
'data': z.string().readonly(),
|
|
572
544
|
'name': z.string().readonly().optional(),
|
|
545
|
+
}), z.object({
|
|
546
|
+
'type': z.literal("file").readonly(),
|
|
547
|
+
'receiptId': z.intersection(z.string(), z.unknown()).readonly(),
|
|
573
548
|
})])).readonly(),
|
|
574
549
|
'clientTimeZone': z.string().readonly().optional(),
|
|
575
550
|
})
|
|
@@ -613,6 +588,13 @@ const _deepseek_ai_dsh_api_session_controller_session_updateQueue_parameter_0$sc
|
|
|
613
588
|
'action': z.union([z.object({
|
|
614
589
|
'kind': z.literal("edit").readonly(),
|
|
615
590
|
'content': z.array(z.union([z.object({
|
|
591
|
+
'type': z.literal("file"),
|
|
592
|
+
'attachment': z.object({
|
|
593
|
+
'attachmentId': z.intersection(z.string(), z.unknown()),
|
|
594
|
+
'name': z.string(),
|
|
595
|
+
'bytes': z.number(),
|
|
596
|
+
}),
|
|
597
|
+
}), z.object({
|
|
616
598
|
'type': z.literal("text"),
|
|
617
599
|
'text': z.string(),
|
|
618
600
|
}), z.object({
|
|
@@ -731,7 +713,7 @@ export const TYPERT_REMOTE = {
|
|
|
731
713
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionAttachmentValue',
|
|
732
714
|
schema: _deepseek_ai_dsh_api_session_controller_session_attachment_result$schema,
|
|
733
715
|
},
|
|
734
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
716
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":342,"column":3},
|
|
735
717
|
},
|
|
736
718
|
{
|
|
737
719
|
id: '@deepseek-ai/dsh-api-session-controller#session/cancel',
|
|
@@ -756,7 +738,7 @@ export const TYPERT_REMOTE = {
|
|
|
756
738
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionCancelValue',
|
|
757
739
|
schema: _deepseek_ai_dsh_api_session_controller_session_cancel_result$schema,
|
|
758
740
|
},
|
|
759
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
741
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":362,"column":3},
|
|
760
742
|
},
|
|
761
743
|
{
|
|
762
744
|
id: '@deepseek-ai/dsh-api-session-controller#session/canOpenWorkspacePath',
|
|
@@ -771,7 +753,7 @@ export const TYPERT_REMOTE = {
|
|
|
771
753
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller#session/canOpenWorkspacePath:result',
|
|
772
754
|
schema: _deepseek_ai_dsh_api_session_controller_session_canOpenWorkspacePath_result$schema,
|
|
773
755
|
},
|
|
774
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
756
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":267,"column":3},
|
|
775
757
|
},
|
|
776
758
|
{
|
|
777
759
|
id: '@deepseek-ai/dsh-api-session-controller#session/control',
|
|
@@ -788,7 +770,7 @@ export const TYPERT_REMOTE = {
|
|
|
788
770
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionControlFrame',
|
|
789
771
|
schema: _deepseek_ai_dsh_api_session_controller_session_control_result$schema,
|
|
790
772
|
},
|
|
791
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
773
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":395,"column":3},
|
|
792
774
|
},
|
|
793
775
|
{
|
|
794
776
|
id: '@deepseek-ai/dsh-api-session-controller#session/create',
|
|
@@ -813,7 +795,7 @@ export const TYPERT_REMOTE = {
|
|
|
813
795
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionCreateValue',
|
|
814
796
|
schema: _deepseek_ai_dsh_api_session_controller_session_create_result$schema,
|
|
815
797
|
},
|
|
816
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
798
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":239,"column":3},
|
|
817
799
|
},
|
|
818
800
|
{
|
|
819
801
|
id: '@deepseek-ai/dsh-api-session-controller#session/follow',
|
|
@@ -840,7 +822,7 @@ export const TYPERT_REMOTE = {
|
|
|
840
822
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionFollowFrame',
|
|
841
823
|
schema: _deepseek_ai_dsh_api_session_controller_session_follow_result$schema,
|
|
842
824
|
},
|
|
843
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
825
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":385,"column":3},
|
|
844
826
|
},
|
|
845
827
|
{
|
|
846
828
|
id: '@deepseek-ai/dsh-api-session-controller#session/fork',
|
|
@@ -865,7 +847,7 @@ export const TYPERT_REMOTE = {
|
|
|
865
847
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionForkValue',
|
|
866
848
|
schema: _deepseek_ai_dsh_api_session_controller_session_fork_result$schema,
|
|
867
849
|
},
|
|
868
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
850
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":320,"column":3},
|
|
869
851
|
},
|
|
870
852
|
{
|
|
871
853
|
id: '@deepseek-ai/dsh-api-session-controller#session/list',
|
|
@@ -891,7 +873,7 @@ export const TYPERT_REMOTE = {
|
|
|
891
873
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionListValue',
|
|
892
874
|
schema: _deepseek_ai_dsh_api_session_controller_session_list_result$schema,
|
|
893
875
|
},
|
|
894
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
876
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":218,"column":9},
|
|
895
877
|
},
|
|
896
878
|
{
|
|
897
879
|
id: '@deepseek-ai/dsh-api-session-controller#session/modelCatalog',
|
|
@@ -906,7 +888,7 @@ export const TYPERT_REMOTE = {
|
|
|
906
888
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#ModelCatalog',
|
|
907
889
|
schema: _deepseek_ai_dsh_api_session_controller_session_modelCatalog_result$schema,
|
|
908
890
|
},
|
|
909
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
891
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":258,"column":3},
|
|
910
892
|
},
|
|
911
893
|
{
|
|
912
894
|
id: '@deepseek-ai/dsh-api-session-controller#session/openWorkspacePath',
|
|
@@ -932,7 +914,7 @@ export const TYPERT_REMOTE = {
|
|
|
932
914
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionOpenWorkspacePathValue',
|
|
933
915
|
schema: _deepseek_ai_dsh_api_session_controller_session_openWorkspacePath_result$schema,
|
|
934
916
|
},
|
|
935
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
917
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":279,"column":9},
|
|
936
918
|
},
|
|
937
919
|
{
|
|
938
920
|
id: '@deepseek-ai/dsh-api-session-controller#session/page',
|
|
@@ -958,7 +940,7 @@ export const TYPERT_REMOTE = {
|
|
|
958
940
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionPage',
|
|
959
941
|
schema: _deepseek_ai_dsh_api_session_controller_session_page_result$schema,
|
|
960
942
|
},
|
|
961
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
943
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":373,"column":3},
|
|
962
944
|
},
|
|
963
945
|
{
|
|
964
946
|
id: '@deepseek-ai/dsh-api-session-controller#session/prompt',
|
|
@@ -984,7 +966,7 @@ export const TYPERT_REMOTE = {
|
|
|
984
966
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionPromptValue',
|
|
985
967
|
schema: _deepseek_ai_dsh_api_session_controller_session_prompt_result$schema,
|
|
986
968
|
},
|
|
987
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
969
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":331,"column":3},
|
|
988
970
|
},
|
|
989
971
|
{
|
|
990
972
|
id: '@deepseek-ai/dsh-api-session-controller#session/rename',
|
|
@@ -1009,7 +991,7 @@ export const TYPERT_REMOTE = {
|
|
|
1009
991
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionRenameValue',
|
|
1010
992
|
schema: _deepseek_ai_dsh_api_session_controller_session_rename_result$schema,
|
|
1011
993
|
},
|
|
1012
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
994
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":310,"column":3},
|
|
1013
995
|
},
|
|
1014
996
|
{
|
|
1015
997
|
id: '@deepseek-ai/dsh-api-session-controller#session/search',
|
|
@@ -1035,7 +1017,7 @@ export const TYPERT_REMOTE = {
|
|
|
1035
1017
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionSearchValue',
|
|
1036
1018
|
schema: _deepseek_ai_dsh_api_session_controller_session_search_result$schema,
|
|
1037
1019
|
},
|
|
1038
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
1020
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":229,"column":3},
|
|
1039
1021
|
},
|
|
1040
1022
|
{
|
|
1041
1023
|
id: '@deepseek-ai/dsh-api-session-controller#session/selectModel',
|
|
@@ -1060,7 +1042,7 @@ export const TYPERT_REMOTE = {
|
|
|
1060
1042
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionSelectModelValue',
|
|
1061
1043
|
schema: _deepseek_ai_dsh_api_session_controller_session_selectModel_result$schema,
|
|
1062
1044
|
},
|
|
1063
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
1045
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":249,"column":3},
|
|
1064
1046
|
},
|
|
1065
1047
|
{
|
|
1066
1048
|
id: '@deepseek-ai/dsh-api-session-controller#session/updateQueue',
|
|
@@ -1085,7 +1067,7 @@ export const TYPERT_REMOTE = {
|
|
|
1085
1067
|
typeSymbol: '@deepseek-ai/dsh-api-session-controller/types#SessionUpdateQueueValue',
|
|
1086
1068
|
schema: _deepseek_ai_dsh_api_session_controller_session_updateQueue_result$schema,
|
|
1087
1069
|
},
|
|
1088
|
-
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":
|
|
1070
|
+
sourceLocation: {"file":"packages/api/session-controller/src/index.ts","line":352,"column":3},
|
|
1089
1071
|
},
|
|
1090
1072
|
{
|
|
1091
1073
|
id: '@deepseek-ai/dsh-api-session-controller#skills/list',
|
package/lib/types/agent.js
CHANGED
|
@@ -380,13 +380,14 @@ export class ApiSessionAgentController {
|
|
|
380
380
|
*/
|
|
381
381
|
async composeAgent(presetId) {
|
|
382
382
|
const presets = this.ctx.get('agentPresets');
|
|
383
|
-
if (presets === undefined)
|
|
384
|
-
return { setup: (
|
|
383
|
+
if (presets === undefined) {
|
|
384
|
+
return { setup: (_agentCtx, agent) => { this.installSelection(agent); } };
|
|
385
|
+
}
|
|
385
386
|
const resolvedId = (await presets.resolve(presetId)).id;
|
|
386
387
|
return {
|
|
387
388
|
agentPreset: resolvedId,
|
|
388
|
-
setup: async (agentCtx) => {
|
|
389
|
-
this.installSelection(
|
|
389
|
+
setup: async (agentCtx, agent) => {
|
|
390
|
+
this.installSelection(agent);
|
|
390
391
|
await presets.mount(agentCtx, resolvedId);
|
|
391
392
|
},
|
|
392
393
|
};
|
|
@@ -506,10 +507,7 @@ export class ApiSessionAgentController {
|
|
|
506
507
|
const { provider, model } = this.ctx.agentDefaultModel.currentSelection();
|
|
507
508
|
return { provider, model };
|
|
508
509
|
}
|
|
509
|
-
installSelection(
|
|
510
|
-
const agent = agentCtx.agent;
|
|
511
|
-
if (agent === undefined)
|
|
512
|
-
throw new Error('api-session: Agent setup has no scoped Agent');
|
|
510
|
+
installSelection(agent) {
|
|
513
511
|
this.selectionFor(agent);
|
|
514
512
|
}
|
|
515
513
|
/**
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Process-local assistant state retained for reconnecting Web followers. */
|
|
2
|
+
import type { AssistantStreamFrame } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import type { SessionSeqCursor } from '@deepseek-ai/dsh-session';
|
|
4
|
+
import type { SessionAssistantStreamBaseline } from './types.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Folds dense Agent frames and materializes one shared immutable reconnect
|
|
7
|
+
* baseline per accepted revision.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SessionAssistantStreamAccumulator {
|
|
10
|
+
private activeAttempt;
|
|
11
|
+
private revision;
|
|
12
|
+
private snapshotValue;
|
|
13
|
+
private dirty;
|
|
14
|
+
/**
|
|
15
|
+
* Fold one trusted frame from the current attached Agent lifecycle.
|
|
16
|
+
* @param frame - next dense process-local Assistant frame.
|
|
17
|
+
* @param durableCursor - last committed Session seq when this frame was observed.
|
|
18
|
+
*/
|
|
19
|
+
accept(frame: AssistantStreamFrame, durableCursor: SessionSeqCursor): void;
|
|
20
|
+
/**
|
|
21
|
+
* Read the cached reconnect baseline, materializing it after a state change.
|
|
22
|
+
* @returns the identity-stable baseline for the latest accepted revision.
|
|
23
|
+
*/
|
|
24
|
+
snapshot(): SessionAssistantStreamBaseline;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=assistant-stream.d.ts.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** Process-local assistant state retained for reconnecting Web followers. */
|
|
2
|
+
import { AssistantStreamAccumulator } from '@deepseek-ai/dsh-llm';
|
|
3
|
+
const EMPTY_BASELINE = { revision: 0 };
|
|
4
|
+
/**
|
|
5
|
+
* Folds dense Agent frames and materializes one shared immutable reconnect
|
|
6
|
+
* baseline per accepted revision.
|
|
7
|
+
*/
|
|
8
|
+
export class SessionAssistantStreamAccumulator {
|
|
9
|
+
activeAttempt;
|
|
10
|
+
revision = 0;
|
|
11
|
+
snapshotValue = EMPTY_BASELINE;
|
|
12
|
+
dirty = false;
|
|
13
|
+
/**
|
|
14
|
+
* Fold one trusted frame from the current attached Agent lifecycle.
|
|
15
|
+
* @param frame - next dense process-local Assistant frame.
|
|
16
|
+
* @param durableCursor - last committed Session seq when this frame was observed.
|
|
17
|
+
*/
|
|
18
|
+
accept(frame, durableCursor) {
|
|
19
|
+
if (frame.type === 'start' && frame.revision === 1 && this.revision !== 0) {
|
|
20
|
+
this.activeAttempt = undefined;
|
|
21
|
+
this.revision = 0;
|
|
22
|
+
}
|
|
23
|
+
if (frame.revision !== this.revision + 1) {
|
|
24
|
+
this.activeAttempt = undefined;
|
|
25
|
+
this.revision = frame.revision;
|
|
26
|
+
this.dirty = true;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.revision = frame.revision;
|
|
30
|
+
switch (frame.type) {
|
|
31
|
+
case 'start':
|
|
32
|
+
this.activeAttempt = {
|
|
33
|
+
attemptId: frame.attemptId,
|
|
34
|
+
startedAfterSeq: durableCursor,
|
|
35
|
+
turn: frame.turn,
|
|
36
|
+
step: frame.step,
|
|
37
|
+
stream: new AssistantStreamAccumulator(),
|
|
38
|
+
nextIndex: 0,
|
|
39
|
+
};
|
|
40
|
+
break;
|
|
41
|
+
case 'chunk': {
|
|
42
|
+
const attempt = this.activeAttempt;
|
|
43
|
+
if (attempt === undefined
|
|
44
|
+
|| attempt.attemptId !== frame.attemptId
|
|
45
|
+
|| frame.index !== attempt.nextIndex) {
|
|
46
|
+
this.activeAttempt = undefined;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
attempt.stream.push({ time: frame.time, chunk: frame.chunk });
|
|
50
|
+
attempt.nextIndex += 1;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case 'end':
|
|
54
|
+
this.activeAttempt = undefined;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
this.dirty = true;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Read the cached reconnect baseline, materializing it after a state change.
|
|
61
|
+
* @returns the identity-stable baseline for the latest accepted revision.
|
|
62
|
+
*/
|
|
63
|
+
snapshot() {
|
|
64
|
+
if (!this.dirty)
|
|
65
|
+
return this.snapshotValue;
|
|
66
|
+
this.snapshotValue = {
|
|
67
|
+
revision: this.revision,
|
|
68
|
+
...this.activeAttempt === undefined ? {} : {
|
|
69
|
+
activeAttempt: {
|
|
70
|
+
attemptId: this.activeAttempt.attemptId,
|
|
71
|
+
startedAfterSeq: this.activeAttempt.startedAfterSeq,
|
|
72
|
+
turn: this.activeAttempt.turn,
|
|
73
|
+
step: this.activeAttempt.step,
|
|
74
|
+
nextIndex: this.activeAttempt.nextIndex,
|
|
75
|
+
stream: this.activeAttempt.stream.snapshot(),
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
this.dirty = false;
|
|
80
|
+
return this.snapshotValue;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=assistant-stream.js.map
|
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
/** Observable contiguous Session event window consumed by domain assemblers. */
|
|
2
2
|
import { type ObservableSnapshot } from '@deepseek-ai/dsh-client-store';
|
|
3
|
+
import type { LlmAttemptId, StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
3
4
|
import type { SessionEvent } from '@deepseek-ai/dsh-session/types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/** Client-only live chunk presentation; `seq` orders the transient row between durable Session seqs. */
|
|
6
|
+
export interface AssistantLiveChunkEvent {
|
|
7
|
+
readonly type: 'assistant/live-chunk';
|
|
8
|
+
readonly seq: number;
|
|
9
|
+
readonly time: number;
|
|
10
|
+
readonly data: {
|
|
11
|
+
readonly attemptId: LlmAttemptId;
|
|
12
|
+
readonly turn: number;
|
|
13
|
+
readonly step: number;
|
|
14
|
+
readonly chunk: StreamChunk;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Current durable Session event or one client-only live chunk presentation. */
|
|
18
|
+
export type SessionEventLike = SessionEvent | AssistantLiveChunkEvent;
|
|
7
19
|
/** Client history entry retaining its coarse transport discriminator. */
|
|
8
20
|
export type SessionEventLikeEntry = {
|
|
9
21
|
readonly type: 'event';
|
|
10
22
|
readonly event: SessionEvent;
|
|
11
23
|
} | {
|
|
12
|
-
readonly type: '
|
|
13
|
-
readonly event:
|
|
24
|
+
readonly type: 'transient';
|
|
25
|
+
readonly event: AssistantLiveChunkEvent;
|
|
14
26
|
};
|
|
15
27
|
/** Scalar live entry accepted by append-only Client paths. */
|
|
16
28
|
export type SessionLiveEventEntry = Extract<SessionEventLikeEntry, {
|
|
17
29
|
readonly type: 'event';
|
|
18
30
|
}>;
|
|
31
|
+
/** Durable Assistant event that atomically supersedes one attempt's transient rows. */
|
|
32
|
+
export interface SessionAssistantSettlementEntry {
|
|
33
|
+
readonly type: 'event';
|
|
34
|
+
readonly event: SessionEvent<'assistant/message'> | SessionEvent<'assistant/attempt'>;
|
|
35
|
+
}
|
|
36
|
+
/** Client-only Assistant frame admitted outside durable cursor algebra. */
|
|
37
|
+
export type SessionTransientEventEntry = Extract<SessionEventLikeEntry, {
|
|
38
|
+
readonly type: 'transient';
|
|
39
|
+
}>;
|
|
19
40
|
/** Exact delta that produced the latest event-window revision. */
|
|
20
41
|
export type SessionEventChange = {
|
|
21
42
|
readonly kind: 'replace';
|
|
@@ -25,7 +46,11 @@ export type SessionEventChange = {
|
|
|
25
46
|
readonly entries: readonly SessionEventLikeEntry[];
|
|
26
47
|
} | {
|
|
27
48
|
readonly kind: 'append';
|
|
28
|
-
readonly entries: readonly
|
|
49
|
+
readonly entries: readonly SessionEventLikeEntry[];
|
|
50
|
+
} | {
|
|
51
|
+
readonly kind: 'settle-assistant';
|
|
52
|
+
readonly attemptId: LlmAttemptId;
|
|
53
|
+
readonly entry?: SessionAssistantSettlementEntry;
|
|
29
54
|
};
|
|
30
55
|
/** Current contiguous event window and its latest synchronous delta. */
|
|
31
56
|
export interface SessionEventWindow {
|
|
@@ -65,7 +90,13 @@ export declare class MutableSessionEventSource implements SessionEventSource {
|
|
|
65
90
|
* Append one contiguous live entry.
|
|
66
91
|
* @param entry - live tail entry.
|
|
67
92
|
*/
|
|
68
|
-
append(entry:
|
|
93
|
+
append(entry: SessionEventLikeEntry): void;
|
|
94
|
+
/**
|
|
95
|
+
* Replace one attempt's transient rows with its committed durable settlement.
|
|
96
|
+
* @param attemptId - process-local attempt whose live rows are now redundant.
|
|
97
|
+
* @param entry - durable settlement committed for that attempt.
|
|
98
|
+
*/
|
|
99
|
+
settleAssistant(attemptId: LlmAttemptId, entry?: SessionAssistantSettlementEntry): void;
|
|
69
100
|
private publish;
|
|
70
101
|
}
|
|
71
102
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -83,6 +83,27 @@ export class MutableSessionEventSource {
|
|
|
83
83
|
entries,
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Replace one attempt's transient rows with its committed durable settlement.
|
|
88
|
+
* @param attemptId - process-local attempt whose live rows are now redundant.
|
|
89
|
+
* @param entry - durable settlement committed for that attempt.
|
|
90
|
+
*/
|
|
91
|
+
settleAssistant(attemptId, entry) {
|
|
92
|
+
const entries = materialize(this.window).filter(candidate => (candidate.type !== 'transient' || candidate.event.data.attemptId !== attemptId));
|
|
93
|
+
if (entry !== undefined) {
|
|
94
|
+
const index = entries.findIndex(candidate => candidate.event.seq > entry.event.seq);
|
|
95
|
+
if (index < 0)
|
|
96
|
+
entries.push(entry);
|
|
97
|
+
else
|
|
98
|
+
entries.splice(index, 0, entry);
|
|
99
|
+
}
|
|
100
|
+
this.window = leaf(entries);
|
|
101
|
+
this.publish(this.snapshot.hasMore, {
|
|
102
|
+
kind: 'settle-assistant',
|
|
103
|
+
attemptId,
|
|
104
|
+
...(entry === undefined ? {} : { entry }),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
86
107
|
publish(hasMore, change) {
|
|
87
108
|
this.snapshot = windowSnapshot(this.window, hasMore, this.snapshot.revision + 1, change);
|
|
88
109
|
notifySubscribers(this.listeners, '[session-controller] event feed');
|