@wowyuarm/dsh-agent-team 0.1.8 → 0.1.10

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.
Files changed (81) hide show
  1. package/README.md +4 -11
  2. package/README.zh.md +4 -11
  3. package/package.json +54 -44
  4. package/packages/agent-team/README.md +7 -5
  5. package/packages/agent-team/README.zh.md +7 -4
  6. package/packages/agent-team/lib/attachments.js +14 -4
  7. package/packages/agent-team/lib/context-management.js +382 -0
  8. package/packages/agent-team/lib/context-projection.js +578 -0
  9. package/packages/agent-team/lib/context-source.js +212 -0
  10. package/packages/agent-team/lib/index.js +1272 -76
  11. package/packages/agent-team/lib/ledger.js +333 -44
  12. package/packages/agent-team/lib/member-context.js +6 -2
  13. package/packages/agent-team/lib/member-runtime.js +159 -4
  14. package/packages/agent-team/lib/member-time-context.js +126 -0
  15. package/packages/agent-team/lib/pressure-policy.js +199 -0
  16. package/packages/agent-team/lib/progress-nudge.js +12 -4
  17. package/packages/agent-team/lib/session-remediation.js +481 -0
  18. package/packages/agent-team/lib/spec.js +21 -2
  19. package/packages/agent-team/lib/time-format.js +56 -0
  20. package/packages/agent-team/lib/typert.host.js +168 -54
  21. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  22. package/packages/agent-team/lib/typert.remote-client.js +59 -25
  23. package/packages/agent-team/lib/types/attachments.d.ts +1 -1
  24. package/packages/agent-team/lib/types/attachments.d.ts.map +1 -1
  25. package/packages/agent-team/lib/types/context-management.d.ts +147 -0
  26. package/packages/agent-team/lib/types/context-management.d.ts.map +1 -0
  27. package/packages/agent-team/lib/types/context-projection.d.ts +219 -0
  28. package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -0
  29. package/packages/agent-team/lib/types/context-source.d.ts +117 -0
  30. package/packages/agent-team/lib/types/context-source.d.ts.map +1 -0
  31. package/packages/agent-team/lib/types/index.d.ts +300 -2
  32. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  33. package/packages/agent-team/lib/types/ledger.d.ts +119 -6
  34. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  35. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  36. package/packages/agent-team/lib/types/member-runtime.d.ts +30 -2
  37. package/packages/agent-team/lib/types/member-runtime.d.ts.map +1 -1
  38. package/packages/agent-team/lib/types/member-time-context.d.ts +83 -0
  39. package/packages/agent-team/lib/types/member-time-context.d.ts.map +1 -0
  40. package/packages/agent-team/lib/types/pressure-policy.d.ts +106 -0
  41. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -0
  42. package/packages/agent-team/lib/types/progress-nudge.d.ts.map +1 -1
  43. package/packages/agent-team/lib/types/session-remediation.d.ts +149 -0
  44. package/packages/agent-team/lib/types/session-remediation.d.ts.map +1 -0
  45. package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
  46. package/packages/agent-team/lib/types/time-format.d.ts +28 -0
  47. package/packages/agent-team/lib/types/time-format.d.ts.map +1 -0
  48. package/packages/agent-team/lib/types/types/entities.d.ts +22 -1
  49. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  50. package/packages/agent-team/lib/types/types/operations.d.ts +38 -3
  51. package/packages/agent-team/lib/types/types/operations.d.ts.map +1 -1
  52. package/packages/agent-team/lib/types/types/requests-results.d.ts +58 -1
  53. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  54. package/packages/agent-team/preset/team-member/agent.cordis.yml +27 -4
  55. package/packages/client-agent-team/lib/client.js +369 -352
  56. package/packages/client-agent-team/lib/client.js.map +1 -1
  57. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +1 -2
  58. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  59. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +61 -41
  60. package/packages/client-agent-team/lib/types/client/TeamMessage.js +2 -2
  61. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +4 -4
  62. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
  63. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
  64. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +2 -2
  65. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  66. package/packages/client-agent-team/lib/types/client/index.js +44 -16
  67. package/packages/client-agent-team/lib/types/client/locales.d.ts +0 -14
  68. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  69. package/packages/client-agent-team/lib/types/client/locales.js +0 -14
  70. package/packages/client-agent-team/lib/types/client/slots.d.ts +6 -1
  71. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  72. package/packages/tool-agent-team/README.md +11 -6
  73. package/packages/tool-agent-team/README.zh.md +11 -6
  74. package/packages/tool-agent-team/lib/context-tools.js +179 -0
  75. package/packages/tool-agent-team/lib/index.js +369 -58
  76. package/packages/tool-agent-team/lib/types/context-tools.d.ts +16 -0
  77. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -0
  78. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
  79. package/packages/agent-team/lib/auto-compaction.js +0 -201
  80. package/packages/agent-team/lib/types/auto-compaction.d.ts +0 -47
  81. package/packages/agent-team/lib/types/auto-compaction.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"typert.remote-client.d.ts","names":["addMember","archiveChannel","archiveMember","changeAttention","changes","changeTask","clearMemberContext","createChannel","getAttachment","inbox","joinChannel","members","promoteThread","putAttachment","readThread","recoverMember","removeChannelMember","reply","resolveTaskRefs","sendMessage","threadHistory","threadObservations","updateChannel","updateMember","view"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;IA0dQA,S;IAVAC,c;IAwRAC,a;IA0HAC,e;IAtdAC,O;IAwWAC,U;IA7LAC,kB;IAlIAC,a;IA+ZAC,a;IAuBNC,K;IAnGMC,W;IArYNC,O;IA2XMC,a;IAyEAC,a;IA2CAC,U;IAlWAC,a;IAmQAC,mB;IAyEAC,K;IAteNC,e;IAsaMC,W;IAsGNC,a;IAPAC,kB;IA1bMC,a;IA2OAC,Y;IA6NNC,I;;;IA/aMxB,qB;IAVAC,0B;IAwRAC,yB;IA0HAC,2B;IAtdAC,mB;IAwWAC,sB;IA7LAC,8B;IAlIAC,yB;IA+ZAC,yB;IAuBNC,iB;IAnGMC,uB;IArYNC,mB;IA2XMC,yB;IAyEAC,yB;IA2CAC,sB;IAlWAC,yB;IAmQAC,+B;IAyEAC,iB;IAteNC,2B;IAsaMC,uB;IAsGNC,yB;IAPAC,8B;IA1bMC,yB;IA2OAC,wB;IA6NNC,gB","ignoreList":[]}
1
+ {"version":3,"file":"typert.remote-client.d.ts","names":["addMember","archiveChannel","archiveMember","changeAttention","changes","changeTask","clearMemberContext","createChannel","getAttachment","inbox","joinChannel","members","promoteThread","putAttachment","readThread","recoverMember","removeChannelMember","reply","resolveTaskRefs","sendMessage","threadHistory","threadObservations","updateChannel","updateMember","view"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;IA4oBQA,S;IAVAC,c;IA6XAC,a;IA0HAC,e;IA3jBAC,O;IA6cAC,U;IA5RAC,kB;IAxIAC,a;IAogBAC,a;IAuBNC,K;IAnGMC,W;IA1eNC,O;IAgeMC,a;IAyEAC,a;IA2CAC,U;IAjcAC,a;IAkWAC,mB;IAyEAC,K;IA3kBNC,e;IA2gBMC,W;IAsGNC,a;IAPAC,kB;IA/hBMC,a;IAgVAC,Y;IA6NNC,I;;;IAphBMxB,qB;IAVAC,0B;IA6XAC,yB;IA0HAC,2B;IA3jBAC,mB;IA6cAC,sB;IA5RAC,8B;IAxIAC,yB;IAogBAC,yB;IAuBNC,iB;IAnGMC,uB;IA1eNC,mB;IAgeMC,yB;IAyEAC,yB;IA2CAC,sB;IAjcAC,yB;IAkWAC,+B;IAyEAC,iB;IA3kBNC,2B;IA2gBMC,uB;IAsGNC,yB;IAPAC,8B;IA/hBMC,yB;IAgVAC,wB;IA6NNC,gB","ignoreList":[]}
@@ -27,6 +27,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_addMember_result$schema = z.object({
27
27
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
28
28
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
29
29
  'sequence': z.number().readonly(),
30
+ 'occurredAt': z.string().readonly(),
30
31
  }).readonly(),
31
32
  'status': z.object({
32
33
  'member': z.object({
@@ -71,6 +72,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_archiveChannel_result$schema = z.object
71
72
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
72
73
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
73
74
  'sequence': z.number().readonly(),
75
+ 'occurredAt': z.string().readonly(),
74
76
  }).readonly(),
75
77
  'channel': z.object({
76
78
  'channelRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -99,6 +101,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_archiveMember_result$schema = z.object(
99
101
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
100
102
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
101
103
  'sequence': z.number().readonly(),
104
+ 'occurredAt': z.string().readonly(),
102
105
  }).readonly(),
103
106
  'member': z.object({
104
107
  'memberId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -149,6 +152,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_changeAttention_result$schema = z.objec
149
152
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
150
153
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
151
154
  'sequence': z.number().readonly(),
155
+ 'occurredAt': z.string().readonly(),
152
156
  }).readonly(),
153
157
  'task': z.object({
154
158
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -198,11 +202,13 @@ const _wowyuarm_dsh_agent_team_agentTeam_changeTask_result$schema = z.union([z.o
198
202
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
199
203
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
200
204
  'sequence': z.number().readonly(),
205
+ 'occurredAt': z.string().readonly(),
201
206
  }).readonly(),
202
207
  'activity': z.object({
203
208
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
204
209
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
205
210
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
211
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
206
212
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
207
213
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
208
214
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -254,6 +260,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_result$schema = z.ob
254
260
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
255
261
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
256
262
  'sequence': z.number().readonly(),
263
+ 'occurredAt': z.string().readonly(),
257
264
  }).readonly(),
258
265
  'status': z.object({
259
266
  'member': z.object({
@@ -300,6 +307,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_createChannel_result$schema = z.object(
300
307
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
301
308
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
302
309
  'sequence': z.number().readonly(),
310
+ 'occurredAt': z.string().readonly(),
303
311
  }).readonly(),
304
312
  'channel': z.object({
305
313
  'channelRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -342,6 +350,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_inbox_result$schema = z.object({
342
350
  'unreadCount': z.number().readonly(),
343
351
  'directCount': z.number().readonly(),
344
352
  'newestSequence': z.number().readonly(),
353
+ 'newestOccurredAt': z.string().readonly(),
345
354
  'attention': z.object({
346
355
  'memberId': z.intersection(z.string(), z.unknown()).readonly(),
347
356
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -363,6 +372,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_joinChannel_result$schema = z.object({
363
372
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
364
373
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
365
374
  'sequence': z.number().readonly(),
375
+ 'occurredAt': z.string().readonly(),
366
376
  }).readonly(),
367
377
  'channelRef': z.intersection(z.string(), z.unknown()).readonly(),
368
378
  'memberId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -426,11 +436,13 @@ const _wowyuarm_dsh_agent_team_agentTeam_promoteThread_result$schema = z.union([
426
436
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
427
437
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
428
438
  'sequence': z.number().readonly(),
439
+ 'occurredAt': z.string().readonly(),
429
440
  }).readonly(),
430
441
  'activity': z.object({
431
442
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
432
443
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
433
444
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
445
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
434
446
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
435
447
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
436
448
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -475,6 +487,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema = z.object({
475
487
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
476
488
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
477
489
  'sequence': z.number().readonly(),
490
+ 'occurredAt': z.string().readonly(),
478
491
  }).readonly(),
479
492
  'task': z.object({
480
493
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -537,6 +550,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema = z.object({
537
550
  'occurredAt': z.string().readonly(),
538
551
  }).readonly(),
539
552
  'mentions': z.array(z.intersection(z.string(), z.unknown())).readonly(),
553
+ 'occurredAt': z.string().readonly(),
540
554
  }), z.object({
541
555
  'kind': z.literal("activity").readonly(),
542
556
  'sequence': z.number().readonly(),
@@ -544,6 +558,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema = z.object({
544
558
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
545
559
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
546
560
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
561
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
547
562
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
548
563
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
549
564
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -566,6 +581,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema = z.object({
566
581
  'actor': z.intersection(z.string(), z.unknown()).readonly(),
567
582
  'sequence': z.number().readonly(),
568
583
  })]).readonly(),
584
+ 'occurredAt': z.string().readonly(),
569
585
  })]).readonly(),
570
586
  'unread': z.boolean().readonly(),
571
587
  'direct': z.boolean().readonly(),
@@ -584,6 +600,14 @@ const _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema = z.object({
584
600
  'messageRef': z.intersection(z.string(), z.unknown()).readonly(),
585
601
  'sequence': z.number().readonly(),
586
602
  })).readonly(),
603
+ 'contextAdvice': z.object({
604
+ 'usageTokens': z.union([z.undefined(), z.number()]).readonly().optional(),
605
+ 'taskBoundaryThreshold': z.union([z.undefined(), z.number()]).readonly().optional(),
606
+ 'handoffAt': z.union([z.undefined(), z.number()]).readonly().optional(),
607
+ 'hardLimit': z.union([z.undefined(), z.number()]).readonly().optional(),
608
+ 'action': z.union([z.literal("unavailable"), z.literal("keep"), z.literal("rollover"), z.literal("handoff-now")]).readonly(),
609
+ 'guidance': z.string().readonly(),
610
+ }).readonly().optional(),
587
611
  })
588
612
  const _wowyuarm_dsh_agent_team_agentTeam_recoverMember_parameter_0$schema = z.object({
589
613
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -635,6 +659,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_removeChannelMember_result$schema = z.o
635
659
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
636
660
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
637
661
  'sequence': z.number().readonly(),
662
+ 'occurredAt': z.string().readonly(),
638
663
  }).readonly(),
639
664
  'channelRef': z.intersection(z.string(), z.unknown()).readonly(),
640
665
  'memberId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -700,6 +725,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_reply_result$schema = z.union([z.object
700
725
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
701
726
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
702
727
  'sequence': z.number().readonly(),
728
+ 'occurredAt': z.string().readonly(),
703
729
  }).readonly(),
704
730
  'message': z.object({
705
731
  'messageRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -772,6 +798,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_sendMessage_result$schema = z.union([z.
772
798
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
773
799
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
774
800
  'sequence': z.number().readonly(),
801
+ 'occurredAt': z.string().readonly(),
775
802
  }).readonly(),
776
803
  'message': z.object({
777
804
  'messageRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -900,6 +927,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_threadHistory_result$schema = z.object(
900
927
  'occurredAt': z.string().readonly(),
901
928
  }).readonly(),
902
929
  'mentions': z.array(z.intersection(z.string(), z.unknown())).readonly(),
930
+ 'occurredAt': z.string().readonly(),
903
931
  }), z.object({
904
932
  'kind': z.literal("activity").readonly(),
905
933
  'sequence': z.number().readonly(),
@@ -907,6 +935,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_threadHistory_result$schema = z.object(
907
935
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
908
936
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
909
937
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
938
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
910
939
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
911
940
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
912
941
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -929,6 +958,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_threadHistory_result$schema = z.object(
929
958
  'actor': z.intersection(z.string(), z.unknown()).readonly(),
930
959
  'sequence': z.number().readonly(),
931
960
  })]).readonly(),
961
+ 'occurredAt': z.string().readonly(),
932
962
  })])).readonly(),
933
963
  'cursor': z.number().readonly(),
934
964
  'hasMore': z.boolean().readonly(),
@@ -961,6 +991,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_updateChannel_result$schema = z.object(
961
991
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
962
992
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
963
993
  'sequence': z.number().readonly(),
994
+ 'occurredAt': z.string().readonly(),
964
995
  }).readonly(),
965
996
  'channel': z.object({
966
997
  'channelRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -995,6 +1026,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_updateMember_result$schema = z.object({
995
1026
  'operationId': z.intersection(z.string(), z.unknown()).readonly(),
996
1027
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
997
1028
  'sequence': z.number().readonly(),
1029
+ 'occurredAt': z.string().readonly(),
998
1030
  }).readonly(),
999
1031
  'status': z.object({
1000
1032
  'member': z.object({
@@ -1102,6 +1134,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_view_result$schema = z.object({
1102
1134
  }).readonly(),
1103
1135
  'taskNumber': z.number().readonly().optional(),
1104
1136
  'messageCount': z.number().readonly(),
1137
+ 'lastActivityAt': z.string().readonly(),
1105
1138
  })).readonly(),
1106
1139
  'claims': z.array(z.object({
1107
1140
  'claimRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -1116,6 +1149,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_view_result$schema = z.object({
1116
1149
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
1117
1150
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
1118
1151
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
1152
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
1119
1153
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
1120
1154
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
1121
1155
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -1168,7 +1202,7 @@ export const TYPERT_REMOTE = {
1168
1202
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamMemberResult',
1169
1203
  schema: _wowyuarm_dsh_agent_team_agentTeam_addMember_result$schema,
1170
1204
  },
1171
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":475,"column":9},
1205
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":653,"column":9},
1172
1206
  },
1173
1207
  {
1174
1208
  id: '@wowyuarm/dsh-agent-team#agentTeam/archiveChannel',
@@ -1193,7 +1227,7 @@ export const TYPERT_REMOTE = {
1193
1227
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamArchiveChannelResult',
1194
1228
  schema: _wowyuarm_dsh_agent_team_agentTeam_archiveChannel_result$schema,
1195
1229
  },
1196
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":465,"column":9},
1230
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":643,"column":9},
1197
1231
  },
1198
1232
  {
1199
1233
  id: '@wowyuarm/dsh-agent-team#agentTeam/archiveMember',
@@ -1218,7 +1252,7 @@ export const TYPERT_REMOTE = {
1218
1252
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamArchiveMemberResult',
1219
1253
  schema: _wowyuarm_dsh_agent_team_agentTeam_archiveMember_result$schema,
1220
1254
  },
1221
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":745,"column":9},
1255
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1024,"column":9},
1222
1256
  },
1223
1257
  {
1224
1258
  id: '@wowyuarm/dsh-agent-team#agentTeam/changeAttention',
@@ -1243,7 +1277,7 @@ export const TYPERT_REMOTE = {
1243
1277
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamThreadAttentionResult',
1244
1278
  schema: _wowyuarm_dsh_agent_team_agentTeam_changeAttention_result$schema,
1245
1279
  },
1246
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":867,"column":9},
1280
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1146,"column":9},
1247
1281
  },
1248
1282
  {
1249
1283
  id: '@wowyuarm/dsh-agent-team#agentTeam/changes',
@@ -1269,7 +1303,7 @@ export const TYPERT_REMOTE = {
1269
1303
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamChangesResult',
1270
1304
  schema: _wowyuarm_dsh_agent_team_agentTeam_changes_result$schema,
1271
1305
  },
1272
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":397,"column":9},
1306
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":575,"column":9},
1273
1307
  },
1274
1308
  {
1275
1309
  id: '@wowyuarm/dsh-agent-team#agentTeam/changeTask',
@@ -1294,7 +1328,7 @@ export const TYPERT_REMOTE = {
1294
1328
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamTaskResult',
1295
1329
  schema: _wowyuarm_dsh_agent_team_agentTeam_changeTask_result$schema,
1296
1330
  },
1297
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":757,"column":9},
1331
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1036,"column":9},
1298
1332
  },
1299
1333
  {
1300
1334
  id: '@wowyuarm/dsh-agent-team#agentTeam/clearMemberContext',
@@ -1319,7 +1353,7 @@ export const TYPERT_REMOTE = {
1319
1353
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamClearMemberContextResult',
1320
1354
  schema: _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_result$schema,
1321
1355
  },
1322
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":568,"column":9},
1356
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":752,"column":9},
1323
1357
  },
1324
1358
  {
1325
1359
  id: '@wowyuarm/dsh-agent-team#agentTeam/createChannel',
@@ -1344,7 +1378,7 @@ export const TYPERT_REMOTE = {
1344
1378
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamCreateChannelResult',
1345
1379
  schema: _wowyuarm_dsh_agent_team_agentTeam_createChannel_result$schema,
1346
1380
  },
1347
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":438,"column":9},
1381
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":616,"column":9},
1348
1382
  },
1349
1383
  {
1350
1384
  id: '@wowyuarm/dsh-agent-team#agentTeam/getAttachment',
@@ -1369,7 +1403,7 @@ export const TYPERT_REMOTE = {
1369
1403
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamGetAttachmentResult',
1370
1404
  schema: _wowyuarm_dsh_agent_team_agentTeam_getAttachment_result$schema,
1371
1405
  },
1372
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":853,"column":9},
1406
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1132,"column":9},
1373
1407
  },
1374
1408
  {
1375
1409
  id: '@wowyuarm/dsh-agent-team#agentTeam/inbox',
@@ -1394,7 +1428,7 @@ export const TYPERT_REMOTE = {
1394
1428
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamInbox',
1395
1429
  schema: _wowyuarm_dsh_agent_team_agentTeam_inbox_result$schema,
1396
1430
  },
1397
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":876,"column":3},
1431
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1155,"column":3},
1398
1432
  },
1399
1433
  {
1400
1434
  id: '@wowyuarm/dsh-agent-team#agentTeam/joinChannel',
@@ -1419,7 +1453,7 @@ export const TYPERT_REMOTE = {
1419
1453
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamJoinChannelResult',
1420
1454
  schema: _wowyuarm_dsh_agent_team_agentTeam_joinChannel_result$schema,
1421
1455
  },
1422
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":777,"column":9},
1456
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1056,"column":9},
1423
1457
  },
1424
1458
  {
1425
1459
  id: '@wowyuarm/dsh-agent-team#agentTeam/members',
@@ -1445,7 +1479,7 @@ export const TYPERT_REMOTE = {
1445
1479
  typeSymbol: '@wowyuarm/dsh-agent-team#agentTeam/members:result',
1446
1480
  schema: _wowyuarm_dsh_agent_team_agentTeam_members_result$schema,
1447
1481
  },
1448
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":388,"column":3},
1482
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":566,"column":3},
1449
1483
  },
1450
1484
  {
1451
1485
  id: '@wowyuarm/dsh-agent-team#agentTeam/promoteThread',
@@ -1470,7 +1504,7 @@ export const TYPERT_REMOTE = {
1470
1504
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamPromoteThreadResult',
1471
1505
  schema: _wowyuarm_dsh_agent_team_agentTeam_promoteThread_result$schema,
1472
1506
  },
1473
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":767,"column":9},
1507
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1046,"column":9},
1474
1508
  },
1475
1509
  {
1476
1510
  id: '@wowyuarm/dsh-agent-team#agentTeam/putAttachment',
@@ -1495,7 +1529,7 @@ export const TYPERT_REMOTE = {
1495
1529
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamPutAttachmentResult',
1496
1530
  schema: _wowyuarm_dsh_agent_team_agentTeam_putAttachment_result$schema,
1497
1531
  },
1498
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":840,"column":9},
1532
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1119,"column":9},
1499
1533
  },
1500
1534
  {
1501
1535
  id: '@wowyuarm/dsh-agent-team#agentTeam/readThread',
@@ -1520,7 +1554,7 @@ export const TYPERT_REMOTE = {
1520
1554
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamThreadReadResult',
1521
1555
  schema: _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema,
1522
1556
  },
1523
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":883,"column":9},
1557
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1162,"column":9},
1524
1558
  },
1525
1559
  {
1526
1560
  id: '@wowyuarm/dsh-agent-team#agentTeam/recoverMember',
@@ -1545,7 +1579,7 @@ export const TYPERT_REMOTE = {
1545
1579
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamRecoverMemberResult',
1546
1580
  schema: _wowyuarm_dsh_agent_team_agentTeam_recoverMember_result$schema,
1547
1581
  },
1548
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":529,"column":9},
1582
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":713,"column":9},
1549
1583
  },
1550
1584
  {
1551
1585
  id: '@wowyuarm/dsh-agent-team#agentTeam/removeChannelMember',
@@ -1570,7 +1604,7 @@ export const TYPERT_REMOTE = {
1570
1604
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamRemoveChannelMemberResult',
1571
1605
  schema: _wowyuarm_dsh_agent_team_agentTeam_removeChannelMember_result$schema,
1572
1606
  },
1573
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":788,"column":9},
1607
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1067,"column":9},
1574
1608
  },
1575
1609
  {
1576
1610
  id: '@wowyuarm/dsh-agent-team#agentTeam/reply',
@@ -1595,7 +1629,7 @@ export const TYPERT_REMOTE = {
1595
1629
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamReplyResult',
1596
1630
  schema: _wowyuarm_dsh_agent_team_agentTeam_reply_result$schema,
1597
1631
  },
1598
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":861,"column":9},
1632
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1140,"column":9},
1599
1633
  },
1600
1634
  {
1601
1635
  id: '@wowyuarm/dsh-agent-team#agentTeam/resolveTaskRefs',
@@ -1620,7 +1654,7 @@ export const TYPERT_REMOTE = {
1620
1654
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamResolveTaskRefsResult',
1621
1655
  schema: _wowyuarm_dsh_agent_team_agentTeam_resolveTaskRefs_result$schema,
1622
1656
  },
1623
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":375,"column":3},
1657
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":553,"column":3},
1624
1658
  },
1625
1659
  {
1626
1660
  id: '@wowyuarm/dsh-agent-team#agentTeam/sendMessage',
@@ -1645,7 +1679,7 @@ export const TYPERT_REMOTE = {
1645
1679
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamSendMessageResult',
1646
1680
  schema: _wowyuarm_dsh_agent_team_agentTeam_sendMessage_result$schema,
1647
1681
  },
1648
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":797,"column":9},
1682
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1076,"column":9},
1649
1683
  },
1650
1684
  {
1651
1685
  id: '@wowyuarm/dsh-agent-team#agentTeam/threadHistory',
@@ -1670,7 +1704,7 @@ export const TYPERT_REMOTE = {
1670
1704
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamThreadHistory',
1671
1705
  schema: _wowyuarm_dsh_agent_team_agentTeam_threadHistory_result$schema,
1672
1706
  },
1673
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":899,"column":3},
1707
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1178,"column":3},
1674
1708
  },
1675
1709
  {
1676
1710
  id: '@wowyuarm/dsh-agent-team#agentTeam/threadObservations',
@@ -1695,7 +1729,7 @@ export const TYPERT_REMOTE = {
1695
1729
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamThreadObservations',
1696
1730
  schema: _wowyuarm_dsh_agent_team_agentTeam_threadObservations_result$schema,
1697
1731
  },
1698
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":892,"column":3},
1732
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1171,"column":3},
1699
1733
  },
1700
1734
  {
1701
1735
  id: '@wowyuarm/dsh-agent-team#agentTeam/updateChannel',
@@ -1720,7 +1754,7 @@ export const TYPERT_REMOTE = {
1720
1754
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamUpdateChannelResult',
1721
1755
  schema: _wowyuarm_dsh_agent_team_agentTeam_updateChannel_result$schema,
1722
1756
  },
1723
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":450,"column":9},
1757
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":628,"column":9},
1724
1758
  },
1725
1759
  {
1726
1760
  id: '@wowyuarm/dsh-agent-team#agentTeam/updateMember',
@@ -1745,7 +1779,7 @@ export const TYPERT_REMOTE = {
1745
1779
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamMemberResult',
1746
1780
  schema: _wowyuarm_dsh_agent_team_agentTeam_updateMember_result$schema,
1747
1781
  },
1748
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":685,"column":9},
1782
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":964,"column":9},
1749
1783
  },
1750
1784
  {
1751
1785
  id: '@wowyuarm/dsh-agent-team#agentTeam/view',
@@ -1770,7 +1804,7 @@ export const TYPERT_REMOTE = {
1770
1804
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamView',
1771
1805
  schema: _wowyuarm_dsh_agent_team_agentTeam_view_result$schema,
1772
1806
  },
1773
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":906,"column":3},
1807
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1185,"column":3},
1774
1808
  },
1775
1809
  ],
1776
1810
  }
@@ -15,7 +15,7 @@ export declare function attachmentsRoot(): string;
15
15
  /** Absolute payload path of one stored attachment, as offered to Member agents. */
16
16
  export declare function attachmentPayloadPath(attachmentId: AgentTeamAttachmentId, name: string): string;
17
17
  export declare function newAttachmentId(): AgentTeamAttachmentId;
18
- /** Strip path separators, control characters, and leading dots from one client-supplied name. */
18
+ /** Strip path separators, control characters, Windows-illegal characters, reserved device names, and leading dots from one client-supplied name. */
19
19
  export declare function sanitizeFileName(raw: string): string;
20
20
  /** Best-effort media type from one path's extension, so images render as thumbnails. */
21
21
  export declare function mediaTypeForPath(raw: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/attachments.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD;;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AAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,iFAAiF;AACjF,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAc7H;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAA;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED,uEAAuE;AACvE,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAkB1F;AAED,iFAAiF;AACjF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvG;AAED,gFAAgF;AAChF,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAA;AAEtE;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,qBAAqB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAWlJ;AAED,+GAA+G;AAC/G,wBAAgB,iBAAiB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGlE"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Context-management coordinator: the one deep module that turns a Member's
3
+ * successful `context_rollover` tool result into its next private context
4
+ * generation.
5
+ *
6
+ * Authority split (see docs/architecture.md):
7
+ * - the Team ledger owns the Member→Session binding and rollover audit;
8
+ * - the Session log projection owns intent, checkpoints, and delivery state;
9
+ * - this coordinator owns only process locks and is always reconstructible.
10
+ *
11
+ * The coordinator reacts exclusively after the successful `tool/result` is
12
+ * durably appended — never inside a tool body — so a render/finalize failure
13
+ * can never outrun result durability. The actual swap waits for the
14
+ * containing turn to end and the Agent to be idle, captures later input so no
15
+ * old-generation model request opens, and then reuses the Member lifecycle:
16
+ * commit rollover operation → dispose old Agent → archive old Session →
17
+ * create/activate the new generation → deliver the handoff first.
18
+ * @module @wowyuarm/dsh-agent-team/context-management
19
+ */
20
+ import type { Agent } from '@deepseek-ai/dsh-agent';
21
+ import type { SessionEvent, SessionId } from '@deepseek-ai/dsh-session';
22
+ import type { UserMessage } from '@deepseek-ai/dsh-llm';
23
+ import { foldContextProjection, type AgentTeamContextProjectionState } from './context-projection.ts';
24
+ import type { AgentTeamAgentMember, AgentTeamMemberId, AgentTeamRolloverSessionRequest } from './types.ts';
25
+ /** Stable summary of the one-shot rollover pressure notice (ticket 03 wires delivery). */
26
+ export declare const CONTEXT_PRESSURE_NOTICE_SUMMARY = "Context pressure: prepare a handoff";
27
+ export interface ContextManagementCoordinatorOptions {
28
+ /** Resolve the live Agent of one Member; undefined leaves intent parked. */
29
+ readonly agentForMember: (memberId: AgentTeamMemberId) => Agent | undefined;
30
+ /** Resolve the durable Member of one live Agent. */
31
+ readonly memberForAgent: (agent: Agent) => AgentTeamAgentMember | undefined;
32
+ /** Fold one Member Session's projection state from its durable events. */
33
+ readonly projectionForMember: (memberId: AgentTeamMemberId, sessionId: SessionId) => AgentTeamContextProjectionState | undefined;
34
+ /**
35
+ * Execute one prepared Member generation swap at a true idle boundary:
36
+ * commit, dispose, archive, create/activate, deliver the handoff first,
37
+ * then carried input and the rederived Inbox. Returns once the Member runs
38
+ * its new generation.
39
+ */
40
+ readonly executeTransition: (memberId: AgentTeamMemberId, plan: TransitionPlan) => Promise<void>;
41
+ /** Log one coordinator diagnostic. */
42
+ readonly log: (message: string) => void;
43
+ }
44
+ /** Everything the lifecycle needs to perform one rollover. */
45
+ export interface TransitionPlan {
46
+ readonly previousSessionId: SessionId;
47
+ readonly newSessionId: SessionId;
48
+ readonly handoff: string;
49
+ readonly handoffEventSeq: number;
50
+ readonly trigger: 'model' | 'pressure';
51
+ readonly relatedFiles: readonly {
52
+ readonly path: string;
53
+ readonly reason: string;
54
+ }[];
55
+ readonly checkpointRef?: string | undefined;
56
+ readonly requestId: AgentTeamRolloverSessionRequest['requestId'];
57
+ /** Non-Team input that arrived during the transition, delivered after the handoff. */
58
+ readonly carriedInput: readonly UserMessage[];
59
+ }
60
+ export declare class ContextManagementCoordinator {
61
+ private readonly options;
62
+ private readonly members;
63
+ private readonly capturedInput;
64
+ /** Per-member latch for the in-process scheduling→delivery window. */
65
+ private readonly scheduledContinuations;
66
+ private disposed;
67
+ constructor(options: ContextManagementCoordinatorOptions);
68
+ /** Whether one Member has a pending or in-flight rollover; tools use this to reject. */
69
+ isTransitioning(memberId: AgentTeamMemberId): boolean;
70
+ /**
71
+ * Root `session/event` observer for Member Sessions. The store's dispatch
72
+ * carrier is untagged, so the Host maps session ids to Members and calls
73
+ * this for every Member event. All reactions are gated on the projection
74
+ * state, which itself only records successful durable pairs.
75
+ */
76
+ onSessionEvent(memberId: AgentTeamMemberId, agent: Agent, event: SessionEvent): void;
77
+ /** Build the first handoff message of one generation; the lifecycle delivers it. */
78
+ handoffMessageFor(plan: TransitionPlan): UserMessage;
79
+ /**
80
+ * Whether one Agent's pending transition requires the admission gate: a
81
+ * pending rollover must stop old-generation turns from admitting queued
82
+ * input. The gate arms only for the old-generation Agent instance — the
83
+ * new generation activates mid-swap and must be free to consume the
84
+ * handoff and carried input immediately.
85
+ */
86
+ needsAdmissionGate(agent: Agent): boolean;
87
+ /**
88
+ * Capture the inbox messages queued for an old generation at its turn-stop
89
+ * boundary: non-Team input is preserved verbatim for delivery after the
90
+ * handoff; stale Team notices are dropped because the new generation
91
+ * rederives the Inbox from ledger facts. Removing them from the inbox lets
92
+ * the turn close cleanly instead of admitting another old-generation step.
93
+ */
94
+ captureQueuedInput(agent: Agent): readonly UserMessage[];
95
+ /**
96
+ * Capture messages a racing pre-step already claimed from the inbox before
97
+ * rejecting that old-generation step. A rejected step's claimed message is
98
+ * otherwise neither discarded nor re-emitted, so the gate preserves it here.
99
+ */
100
+ captureClaimedInput(agent: Agent, messages: readonly UserMessage[]): readonly UserMessage[];
101
+ private captureInput;
102
+ /** Drain the captured input of one Member for delivery after the handoff. */
103
+ drainCapturedInput(memberId: AgentTeamMemberId): readonly UserMessage[];
104
+ /**
105
+ * Whether one queued message is a Team-owned notice the rederived Inbox
106
+ * replaces. Handoff and continuation envelopes carry the same plugin
107
+ * attribution but are ordinary delivered context the new generation keeps, so
108
+ * they are excluded rather than dropped.
109
+ */
110
+ private isTeamNotice;
111
+ /** Drop one Member's bookkeeping; the Host calls this on dispose/removal. */
112
+ stopTracking(memberId: AgentTeamMemberId): void;
113
+ dispose(): void;
114
+ private onToolResult;
115
+ private onUserMessage;
116
+ private onTurnEnd;
117
+ /**
118
+ * Quiet follow-ups for checkpoints resolved by the turn that just ended.
119
+ * A successful `context_checkpoint` result concludes its turn; the Host
120
+ * continues work in the next turn with one host-generated notice. The
121
+ * projection folds delivery (the continuation user/message event), so a
122
+ * restart repairs a missing follow-up through repairContinuations without
123
+ * duplicating a delivered one; this live path latches per checkpoint in
124
+ * memory for the scheduling window.
125
+ */
126
+ private scheduleCheckpointContinuations;
127
+ private performTransition;
128
+ /**
129
+ * Crash-recovery hook the Host runs during Member activation: re-derive
130
+ * pending intent from the projection and finish a transition that a restart
131
+ * interrupted after the successful result was durable.
132
+ */
133
+ recoverPendingTransition(memberId: AgentTeamMemberId, agent: Agent, sessionId: SessionId): void;
134
+ /**
135
+ * Crash-recovery for quiet continuations: schedule the follow-up for one
136
+ * resolved checkpoint exactly once when the result was durable but the
137
+ * delivery never landed. The projection's continuations state is the
138
+ * durable delivery record — a checkpoint whose delivery event exists in the
139
+ * log is never re-scheduled.
140
+ */
141
+ repairContinuations(agent: Agent, state: AgentTeamContextProjectionState): void;
142
+ }
143
+ /** Tool names this module owns; the preset validation requires all of them. */
144
+ export declare const CONTEXT_TOOL_NAMES: readonly ["context_checkpoint", "context_rollover", "context_timeline"];
145
+ /** Re-exported for Host wiring: cold-fold helper for archived ancestors. */
146
+ export { foldContextProjection };
147
+ //# sourceMappingURL=context-management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-management.d.ts","sourceRoot":"","sources":["../../src/context-management.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGvD,OAAO,EAIL,qBAAqB,EACrB,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAE1G,0FAA0F;AAC1F,eAAO,MAAM,+BAA+B,wCAAwC,CAAA;AAqBpF,MAAM,WAAW,mCAAmC;IAClD,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,KAAK,GAAG,SAAS,CAAA;IAC3E,oDAAoD;IACpD,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,oBAAoB,GAAG,SAAS,CAAA;IAC3E,0EAA0E;IAC1E,QAAQ,CAAC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,KAAK,+BAA+B,GAAG,SAAS,CAAA;IAChI;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI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