@wowyuarm/dsh-agent-team 0.1.7 → 0.1.9

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 (104) hide show
  1. package/package.json +2 -1
  2. package/packages/agent-team/README.md +5 -3
  3. package/packages/agent-team/README.zh.md +5 -3
  4. package/packages/agent-team/core-skills/member-skill-manager/SKILL.md +2 -0
  5. package/packages/agent-team/lib/attachments.js +14 -4
  6. package/packages/agent-team/lib/context-management.js +379 -0
  7. package/packages/agent-team/lib/context-projection.js +574 -0
  8. package/packages/agent-team/lib/context-source.js +72 -0
  9. package/packages/agent-team/lib/index.js +1258 -54
  10. package/packages/agent-team/lib/ledger.js +357 -26
  11. package/packages/agent-team/lib/member-context.js +7 -3
  12. package/packages/agent-team/lib/member-runtime.js +159 -4
  13. package/packages/agent-team/lib/pressure-policy.js +200 -0
  14. package/packages/agent-team/lib/progress-nudge.js +320 -0
  15. package/packages/agent-team/lib/spec.js +18 -0
  16. package/packages/agent-team/lib/typert.host.js +124 -42
  17. package/packages/agent-team/lib/typert.remote-client.d.ts.map +1 -1
  18. package/packages/agent-team/lib/typert.remote-client.js +39 -25
  19. package/packages/agent-team/lib/types/attachments.d.ts +1 -1
  20. package/packages/agent-team/lib/types/attachments.d.ts.map +1 -1
  21. package/packages/agent-team/lib/types/context-management.d.ts +142 -0
  22. package/packages/agent-team/lib/types/context-management.d.ts.map +1 -0
  23. package/packages/agent-team/lib/types/context-projection.d.ts +219 -0
  24. package/packages/agent-team/lib/types/context-projection.d.ts.map +1 -0
  25. package/packages/agent-team/lib/types/context-source.d.ts +83 -0
  26. package/packages/agent-team/lib/types/context-source.d.ts.map +1 -0
  27. package/packages/agent-team/lib/types/index.d.ts +283 -2
  28. package/packages/agent-team/lib/types/index.d.ts.map +1 -1
  29. package/packages/agent-team/lib/types/ledger.d.ts +120 -7
  30. package/packages/agent-team/lib/types/ledger.d.ts.map +1 -1
  31. package/packages/agent-team/lib/types/member-context.d.ts.map +1 -1
  32. package/packages/agent-team/lib/types/member-runtime.d.ts +30 -2
  33. package/packages/agent-team/lib/types/member-runtime.d.ts.map +1 -1
  34. package/packages/agent-team/lib/types/pressure-policy.d.ts +106 -0
  35. package/packages/agent-team/lib/types/pressure-policy.d.ts.map +1 -0
  36. package/packages/agent-team/lib/types/progress-nudge.d.ts +136 -0
  37. package/packages/agent-team/lib/types/progress-nudge.d.ts.map +1 -0
  38. package/packages/agent-team/lib/types/spec.d.ts.map +1 -1
  39. package/packages/agent-team/lib/types/types/entities.d.ts +32 -1
  40. package/packages/agent-team/lib/types/types/entities.d.ts.map +1 -1
  41. package/packages/agent-team/lib/types/types/operations.d.ts +38 -3
  42. package/packages/agent-team/lib/types/types/operations.d.ts.map +1 -1
  43. package/packages/agent-team/lib/types/types/requests-results.d.ts +54 -1
  44. package/packages/agent-team/lib/types/types/requests-results.d.ts.map +1 -1
  45. package/packages/agent-team/preset/team-member/agent.cordis.yml +10 -2
  46. package/packages/client-agent-team/lib/client.js +283 -398
  47. package/packages/client-agent-team/lib/client.js.map +1 -1
  48. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts +1 -2
  49. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.d.ts.map +1 -1
  50. package/packages/client-agent-team/lib/types/client/TeamAgentsPanel.js +61 -41
  51. package/packages/client-agent-team/lib/types/client/TeamChannelPage.d.ts.map +1 -1
  52. package/packages/client-agent-team/lib/types/client/TeamChannelPage.js +3 -7
  53. package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts +3 -1
  54. package/packages/client-agent-team/lib/types/client/TeamComposer.d.ts.map +1 -1
  55. package/packages/client-agent-team/lib/types/client/TeamComposer.js +37 -27
  56. package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts +1 -1
  57. package/packages/client-agent-team/lib/types/client/TeamConversation.d.ts.map +1 -1
  58. package/packages/client-agent-team/lib/types/client/TeamConversation.js +2 -2
  59. package/packages/client-agent-team/lib/types/client/TeamMemberAvatar.d.ts.map +1 -1
  60. package/packages/client-agent-team/lib/types/client/TeamMemberAvatar.js +3 -2
  61. package/packages/client-agent-team/lib/types/client/TeamMessage.js +5 -0
  62. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts +2 -2
  63. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.d.ts.map +1 -1
  64. package/packages/client-agent-team/lib/types/client/TeamPresenceDot.js +4 -6
  65. package/packages/client-agent-team/lib/types/client/TeamStateDot.d.ts +14 -0
  66. package/packages/client-agent-team/lib/types/client/TeamStateDot.d.ts.map +1 -0
  67. package/packages/client-agent-team/lib/types/client/TeamStateDot.js +15 -0
  68. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts +1 -0
  69. package/packages/client-agent-team/lib/types/client/TeamThreadPage.d.ts.map +1 -1
  70. package/packages/client-agent-team/lib/types/client/TeamThreadPage.js +41 -16
  71. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts +1 -1
  72. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.d.ts.map +1 -1
  73. package/packages/client-agent-team/lib/types/client/TeamWorkspaceBrowser.js +2 -2
  74. package/packages/client-agent-team/lib/types/client/index.d.ts.map +1 -1
  75. package/packages/client-agent-team/lib/types/client/index.js +36 -78
  76. package/packages/client-agent-team/lib/types/client/locales.d.ts +0 -16
  77. package/packages/client-agent-team/lib/types/client/locales.d.ts.map +1 -1
  78. package/packages/client-agent-team/lib/types/client/locales.js +0 -16
  79. package/packages/client-agent-team/lib/types/client/sidebar-drag.d.ts +1 -2
  80. package/packages/client-agent-team/lib/types/client/sidebar-drag.d.ts.map +1 -1
  81. package/packages/client-agent-team/lib/types/client/slots.d.ts +8 -1
  82. package/packages/client-agent-team/lib/types/client/slots.d.ts.map +1 -1
  83. package/packages/client-agent-team/lib/types/client/task-refs.d.ts +7 -1
  84. package/packages/client-agent-team/lib/types/client/task-refs.d.ts.map +1 -1
  85. package/packages/client-agent-team/lib/types/client/task-refs.js +25 -3
  86. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts +11 -10
  87. package/packages/client-agent-team/lib/types/client/team-formatters.d.ts.map +1 -1
  88. package/packages/client-agent-team/lib/types/client/team-formatters.js +14 -11
  89. package/packages/tool-agent-team/README.md +8 -5
  90. package/packages/tool-agent-team/README.zh.md +8 -5
  91. package/packages/tool-agent-team/lib/context-tools.js +179 -0
  92. package/packages/tool-agent-team/lib/index.js +144 -25
  93. package/packages/tool-agent-team/lib/types/context-tools.d.ts +16 -0
  94. package/packages/tool-agent-team/lib/types/context-tools.d.ts.map +1 -0
  95. package/packages/tool-agent-team/lib/types/index.d.ts.map +1 -1
  96. package/packages/agent-team/lib/auto-compaction.js +0 -201
  97. package/packages/agent-team/lib/types/auto-compaction.d.ts +0 -47
  98. package/packages/agent-team/lib/types/auto-compaction.d.ts.map +0 -1
  99. package/packages/client-agent-team/lib/types/client/TeamMemberDock.d.ts +0 -12
  100. package/packages/client-agent-team/lib/types/client/TeamMemberDock.d.ts.map +0 -1
  101. package/packages/client-agent-team/lib/types/client/TeamMemberDock.js +0 -13
  102. package/packages/client-agent-team/lib/types/client/member-session-input.d.ts +0 -20
  103. package/packages/client-agent-team/lib/types/client/member-session-input.d.ts.map +0 -1
  104. package/packages/client-agent-team/lib/types/client/member-session-input.js +0 -110
@@ -203,6 +203,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_changeTask_result$schema = z.union([z.o
203
203
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
204
204
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
205
205
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
206
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
206
207
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
207
208
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
208
209
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -431,6 +432,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_promoteThread_result$schema = z.union([
431
432
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
432
433
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
433
434
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
435
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
434
436
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
435
437
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
436
438
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -544,6 +546,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema = z.object({
544
546
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
545
547
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
546
548
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
549
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
547
550
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
548
551
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
549
552
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -584,6 +587,14 @@ const _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema = z.object({
584
587
  'messageRef': z.intersection(z.string(), z.unknown()).readonly(),
585
588
  'sequence': z.number().readonly(),
586
589
  })).readonly(),
590
+ 'contextAdvice': z.object({
591
+ 'usageTokens': z.union([z.undefined(), z.number()]).readonly().optional(),
592
+ 'taskBoundaryThreshold': z.union([z.undefined(), z.number()]).readonly().optional(),
593
+ 'handoffAt': z.union([z.undefined(), z.number()]).readonly().optional(),
594
+ 'hardLimit': z.union([z.undefined(), z.number()]).readonly().optional(),
595
+ 'action': z.union([z.literal("unavailable"), z.literal("keep"), z.literal("rollover"), z.literal("handoff-now")]).readonly(),
596
+ 'guidance': z.string().readonly(),
597
+ }).readonly().optional(),
587
598
  })
588
599
  const _wowyuarm_dsh_agent_team_agentTeam_recoverMember_parameter_0$schema = z.object({
589
600
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -907,6 +918,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_threadHistory_result$schema = z.object(
907
918
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
908
919
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
909
920
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
921
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
910
922
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
911
923
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
912
924
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -947,6 +959,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_threadObservations_result$schema = z.ob
947
959
  'memberId': z.intersection(z.string(), z.unknown()).readonly(),
948
960
  'action': z.union([z.literal("follow"), z.literal("unfollow")]).readonly(),
949
961
  })).readonly(),
962
+ 'followers': z.array(z.intersection(z.string(), z.unknown())).readonly(),
950
963
  })
951
964
  const _wowyuarm_dsh_agent_team_agentTeam_updateChannel_parameter_0$schema = z.object({
952
965
  'requestId': z.intersection(z.string(), z.unknown()).readonly(),
@@ -1115,6 +1128,7 @@ const _wowyuarm_dsh_agent_team_agentTeam_view_result$schema = z.object({
1115
1128
  'kind': z.union([z.literal("accept"), z.literal("close"), z.literal("reopen"), z.literal("promote")]).readonly(),
1116
1129
  'releasedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
1117
1130
  'completedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
1131
+ 'acceptedClaimRefs': z.union([z.undefined(), z.array(z.intersection(z.string(), z.unknown()))]).readonly().optional(),
1118
1132
  'activityRef': z.intersection(z.string(), z.unknown()).readonly(),
1119
1133
  'taskRef': z.intersection(z.string(), z.unknown()).readonly(),
1120
1134
  'threadRef': z.intersection(z.string(), z.unknown()).readonly(),
@@ -1167,7 +1181,7 @@ export const TYPERT_REMOTE = {
1167
1181
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamMemberResult',
1168
1182
  schema: _wowyuarm_dsh_agent_team_agentTeam_addMember_result$schema,
1169
1183
  },
1170
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":438,"column":9},
1184
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":616,"column":9},
1171
1185
  },
1172
1186
  {
1173
1187
  id: '@wowyuarm/dsh-agent-team#agentTeam/archiveChannel',
@@ -1192,7 +1206,7 @@ export const TYPERT_REMOTE = {
1192
1206
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamArchiveChannelResult',
1193
1207
  schema: _wowyuarm_dsh_agent_team_agentTeam_archiveChannel_result$schema,
1194
1208
  },
1195
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":428,"column":9},
1209
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":606,"column":9},
1196
1210
  },
1197
1211
  {
1198
1212
  id: '@wowyuarm/dsh-agent-team#agentTeam/archiveMember',
@@ -1217,7 +1231,7 @@ export const TYPERT_REMOTE = {
1217
1231
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamArchiveMemberResult',
1218
1232
  schema: _wowyuarm_dsh_agent_team_agentTeam_archiveMember_result$schema,
1219
1233
  },
1220
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":701,"column":9},
1234
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":987,"column":9},
1221
1235
  },
1222
1236
  {
1223
1237
  id: '@wowyuarm/dsh-agent-team#agentTeam/changeAttention',
@@ -1242,7 +1256,7 @@ export const TYPERT_REMOTE = {
1242
1256
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamThreadAttentionResult',
1243
1257
  schema: _wowyuarm_dsh_agent_team_agentTeam_changeAttention_result$schema,
1244
1258
  },
1245
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":823,"column":9},
1259
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1109,"column":9},
1246
1260
  },
1247
1261
  {
1248
1262
  id: '@wowyuarm/dsh-agent-team#agentTeam/changes',
@@ -1268,7 +1282,7 @@ export const TYPERT_REMOTE = {
1268
1282
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamChangesResult',
1269
1283
  schema: _wowyuarm_dsh_agent_team_agentTeam_changes_result$schema,
1270
1284
  },
1271
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":360,"column":9},
1285
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":538,"column":9},
1272
1286
  },
1273
1287
  {
1274
1288
  id: '@wowyuarm/dsh-agent-team#agentTeam/changeTask',
@@ -1293,7 +1307,7 @@ export const TYPERT_REMOTE = {
1293
1307
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamTaskResult',
1294
1308
  schema: _wowyuarm_dsh_agent_team_agentTeam_changeTask_result$schema,
1295
1309
  },
1296
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":713,"column":9},
1310
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":999,"column":9},
1297
1311
  },
1298
1312
  {
1299
1313
  id: '@wowyuarm/dsh-agent-team#agentTeam/clearMemberContext',
@@ -1318,7 +1332,7 @@ export const TYPERT_REMOTE = {
1318
1332
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamClearMemberContextResult',
1319
1333
  schema: _wowyuarm_dsh_agent_team_agentTeam_clearMemberContext_result$schema,
1320
1334
  },
1321
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":531,"column":9},
1335
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":715,"column":9},
1322
1336
  },
1323
1337
  {
1324
1338
  id: '@wowyuarm/dsh-agent-team#agentTeam/createChannel',
@@ -1343,7 +1357,7 @@ export const TYPERT_REMOTE = {
1343
1357
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamCreateChannelResult',
1344
1358
  schema: _wowyuarm_dsh_agent_team_agentTeam_createChannel_result$schema,
1345
1359
  },
1346
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":401,"column":9},
1360
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":579,"column":9},
1347
1361
  },
1348
1362
  {
1349
1363
  id: '@wowyuarm/dsh-agent-team#agentTeam/getAttachment',
@@ -1368,7 +1382,7 @@ export const TYPERT_REMOTE = {
1368
1382
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamGetAttachmentResult',
1369
1383
  schema: _wowyuarm_dsh_agent_team_agentTeam_getAttachment_result$schema,
1370
1384
  },
1371
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":809,"column":9},
1385
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1095,"column":9},
1372
1386
  },
1373
1387
  {
1374
1388
  id: '@wowyuarm/dsh-agent-team#agentTeam/inbox',
@@ -1393,7 +1407,7 @@ export const TYPERT_REMOTE = {
1393
1407
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamInbox',
1394
1408
  schema: _wowyuarm_dsh_agent_team_agentTeam_inbox_result$schema,
1395
1409
  },
1396
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":832,"column":3},
1410
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1118,"column":3},
1397
1411
  },
1398
1412
  {
1399
1413
  id: '@wowyuarm/dsh-agent-team#agentTeam/joinChannel',
@@ -1418,7 +1432,7 @@ export const TYPERT_REMOTE = {
1418
1432
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamJoinChannelResult',
1419
1433
  schema: _wowyuarm_dsh_agent_team_agentTeam_joinChannel_result$schema,
1420
1434
  },
1421
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":733,"column":9},
1435
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1019,"column":9},
1422
1436
  },
1423
1437
  {
1424
1438
  id: '@wowyuarm/dsh-agent-team#agentTeam/members',
@@ -1444,7 +1458,7 @@ export const TYPERT_REMOTE = {
1444
1458
  typeSymbol: '@wowyuarm/dsh-agent-team#agentTeam/members:result',
1445
1459
  schema: _wowyuarm_dsh_agent_team_agentTeam_members_result$schema,
1446
1460
  },
1447
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":351,"column":3},
1461
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":529,"column":3},
1448
1462
  },
1449
1463
  {
1450
1464
  id: '@wowyuarm/dsh-agent-team#agentTeam/promoteThread',
@@ -1469,7 +1483,7 @@ export const TYPERT_REMOTE = {
1469
1483
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamPromoteThreadResult',
1470
1484
  schema: _wowyuarm_dsh_agent_team_agentTeam_promoteThread_result$schema,
1471
1485
  },
1472
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":723,"column":9},
1486
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1009,"column":9},
1473
1487
  },
1474
1488
  {
1475
1489
  id: '@wowyuarm/dsh-agent-team#agentTeam/putAttachment',
@@ -1494,7 +1508,7 @@ export const TYPERT_REMOTE = {
1494
1508
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamPutAttachmentResult',
1495
1509
  schema: _wowyuarm_dsh_agent_team_agentTeam_putAttachment_result$schema,
1496
1510
  },
1497
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":796,"column":9},
1511
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1082,"column":9},
1498
1512
  },
1499
1513
  {
1500
1514
  id: '@wowyuarm/dsh-agent-team#agentTeam/readThread',
@@ -1519,7 +1533,7 @@ export const TYPERT_REMOTE = {
1519
1533
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamThreadReadResult',
1520
1534
  schema: _wowyuarm_dsh_agent_team_agentTeam_readThread_result$schema,
1521
1535
  },
1522
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":839,"column":9},
1536
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1125,"column":9},
1523
1537
  },
1524
1538
  {
1525
1539
  id: '@wowyuarm/dsh-agent-team#agentTeam/recoverMember',
@@ -1544,7 +1558,7 @@ export const TYPERT_REMOTE = {
1544
1558
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamRecoverMemberResult',
1545
1559
  schema: _wowyuarm_dsh_agent_team_agentTeam_recoverMember_result$schema,
1546
1560
  },
1547
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":492,"column":9},
1561
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":676,"column":9},
1548
1562
  },
1549
1563
  {
1550
1564
  id: '@wowyuarm/dsh-agent-team#agentTeam/removeChannelMember',
@@ -1569,7 +1583,7 @@ export const TYPERT_REMOTE = {
1569
1583
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamRemoveChannelMemberResult',
1570
1584
  schema: _wowyuarm_dsh_agent_team_agentTeam_removeChannelMember_result$schema,
1571
1585
  },
1572
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":744,"column":9},
1586
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1030,"column":9},
1573
1587
  },
1574
1588
  {
1575
1589
  id: '@wowyuarm/dsh-agent-team#agentTeam/reply',
@@ -1594,7 +1608,7 @@ export const TYPERT_REMOTE = {
1594
1608
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamReplyResult',
1595
1609
  schema: _wowyuarm_dsh_agent_team_agentTeam_reply_result$schema,
1596
1610
  },
1597
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":817,"column":9},
1611
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1103,"column":9},
1598
1612
  },
1599
1613
  {
1600
1614
  id: '@wowyuarm/dsh-agent-team#agentTeam/resolveTaskRefs',
@@ -1619,7 +1633,7 @@ export const TYPERT_REMOTE = {
1619
1633
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamResolveTaskRefsResult',
1620
1634
  schema: _wowyuarm_dsh_agent_team_agentTeam_resolveTaskRefs_result$schema,
1621
1635
  },
1622
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":338,"column":3},
1636
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":516,"column":3},
1623
1637
  },
1624
1638
  {
1625
1639
  id: '@wowyuarm/dsh-agent-team#agentTeam/sendMessage',
@@ -1644,7 +1658,7 @@ export const TYPERT_REMOTE = {
1644
1658
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamSendMessageResult',
1645
1659
  schema: _wowyuarm_dsh_agent_team_agentTeam_sendMessage_result$schema,
1646
1660
  },
1647
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":753,"column":9},
1661
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1039,"column":9},
1648
1662
  },
1649
1663
  {
1650
1664
  id: '@wowyuarm/dsh-agent-team#agentTeam/threadHistory',
@@ -1669,7 +1683,7 @@ export const TYPERT_REMOTE = {
1669
1683
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamThreadHistory',
1670
1684
  schema: _wowyuarm_dsh_agent_team_agentTeam_threadHistory_result$schema,
1671
1685
  },
1672
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":855,"column":3},
1686
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1141,"column":3},
1673
1687
  },
1674
1688
  {
1675
1689
  id: '@wowyuarm/dsh-agent-team#agentTeam/threadObservations',
@@ -1694,7 +1708,7 @@ export const TYPERT_REMOTE = {
1694
1708
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamThreadObservations',
1695
1709
  schema: _wowyuarm_dsh_agent_team_agentTeam_threadObservations_result$schema,
1696
1710
  },
1697
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":848,"column":3},
1711
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1134,"column":3},
1698
1712
  },
1699
1713
  {
1700
1714
  id: '@wowyuarm/dsh-agent-team#agentTeam/updateChannel',
@@ -1719,7 +1733,7 @@ export const TYPERT_REMOTE = {
1719
1733
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamUpdateChannelResult',
1720
1734
  schema: _wowyuarm_dsh_agent_team_agentTeam_updateChannel_result$schema,
1721
1735
  },
1722
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":413,"column":9},
1736
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":591,"column":9},
1723
1737
  },
1724
1738
  {
1725
1739
  id: '@wowyuarm/dsh-agent-team#agentTeam/updateMember',
@@ -1744,7 +1758,7 @@ export const TYPERT_REMOTE = {
1744
1758
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamMemberResult',
1745
1759
  schema: _wowyuarm_dsh_agent_team_agentTeam_updateMember_result$schema,
1746
1760
  },
1747
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":641,"column":9},
1761
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":927,"column":9},
1748
1762
  },
1749
1763
  {
1750
1764
  id: '@wowyuarm/dsh-agent-team#agentTeam/view',
@@ -1769,7 +1783,7 @@ export const TYPERT_REMOTE = {
1769
1783
  typeSymbol: '@wowyuarm/dsh-agent-team/types#AgentTeamView',
1770
1784
  schema: _wowyuarm_dsh_agent_team_agentTeam_view_result$schema,
1771
1785
  },
1772
- sourceLocation: {"file":"packages/agent-team/src/index.ts","line":862,"column":3},
1786
+ sourceLocation: {"file":"packages/agent-team/src/index.ts","line":1148,"column":3},
1773
1787
  },
1774
1788
  ],
1775
1789
  }
@@ -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;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAmB,CAAA;AACpD,gFAAgF;AAChF,eAAO,MAAM,4BAA4B,QAAsB,CAAA;AAC/D,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,QAAsB,CAAA;AAE3D,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/F;AAED,wBAAgB,eAAe,IAAI,qBAAqB,CAEvD;AAED,iGAAiG;AACjG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOpD;AAiBD,wFAAwF;AACxF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI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B,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,142 @@
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
+ /** Whether one queued message is a Team-owned notice the rederived Inbox replaces. */
105
+ private isTeamNotice;
106
+ /** Drop one Member's bookkeeping; the Host calls this on dispose/removal. */
107
+ stopTracking(memberId: AgentTeamMemberId): void;
108
+ dispose(): void;
109
+ private onToolResult;
110
+ private onUserMessage;
111
+ private onTurnEnd;
112
+ /**
113
+ * Quiet follow-ups for checkpoints resolved by the turn that just ended.
114
+ * A successful `context_checkpoint` result concludes its turn; the Host
115
+ * continues work in the next turn with one host-generated notice. The
116
+ * projection folds delivery (the continuation user/message event), so a
117
+ * restart repairs a missing follow-up through repairContinuations without
118
+ * duplicating a delivered one; this live path latches per checkpoint in
119
+ * memory for the scheduling window.
120
+ */
121
+ private scheduleCheckpointContinuations;
122
+ private performTransition;
123
+ /**
124
+ * Crash-recovery hook the Host runs during Member activation: re-derive
125
+ * pending intent from the projection and finish a transition that a restart
126
+ * interrupted after the successful result was durable.
127
+ */
128
+ recoverPendingTransition(memberId: AgentTeamMemberId, agent: Agent, sessionId: SessionId): void;
129
+ /**
130
+ * Crash-recovery for quiet continuations: schedule the follow-up for one
131
+ * resolved checkpoint exactly once when the result was durable but the
132
+ * delivery never landed. The projection's continuations state is the
133
+ * durable delivery record — a checkpoint whose delivery event exists in the
134
+ * log is never re-scheduled.
135
+ */
136
+ repairContinuations(agent: Agent, state: AgentTeamContextProjectionState): void;
137
+ }
138
+ /** Tool names this module owns; the preset validation requires all of them. */
139
+ export declare const CONTEXT_TOOL_NAMES: readonly ["context_checkpoint", "context_rollover", "context_timeline"];
140
+ /** Re-exported for Host wiring: cold-fold helper for archived ancestors. */
141
+ export { foldContextProjection };
142
+ //# 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;AAK1G,0F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