agentix-cli 0.17.0 → 0.18.0

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 (149) hide show
  1. package/dist/agent-RDVGL2TW.js +2 -0
  2. package/dist/audit-Z47AQFFD.js +3 -0
  3. package/dist/audit-Z47AQFFD.js.map +1 -0
  4. package/dist/{board-dashboard-CXIVJKDP.js → board-dashboard-KX2CNOSY.js} +44 -44
  5. package/dist/board-dashboard-KX2CNOSY.js.map +1 -0
  6. package/dist/{chunk-EKTPCSN4.js → chunk-4ITQP3XL.js} +2 -2
  7. package/dist/chunk-53NRX2NA.js +2 -0
  8. package/dist/chunk-53NRX2NA.js.map +1 -0
  9. package/dist/{chunk-5WNGHDFC.js → chunk-ASSJ4Z6Z.js} +11 -11
  10. package/dist/{chunk-5WNGHDFC.js.map → chunk-ASSJ4Z6Z.js.map} +1 -1
  11. package/dist/chunk-BLUXL6HR.js +854 -0
  12. package/dist/chunk-BLUXL6HR.js.map +1 -0
  13. package/dist/chunk-BTAEYL3P.js +72 -0
  14. package/dist/chunk-BTAEYL3P.js.map +1 -0
  15. package/dist/chunk-DJEZ2HVU.js +5 -0
  16. package/dist/chunk-DJEZ2HVU.js.map +1 -0
  17. package/dist/{chunk-SRHLXZRF.js → chunk-DSCMCVTV.js} +3 -3
  18. package/dist/chunk-DSCMCVTV.js.map +1 -0
  19. package/dist/chunk-HPDHNIA3.js +2 -0
  20. package/dist/chunk-IM376SD6.js +13 -0
  21. package/dist/chunk-IM376SD6.js.map +1 -0
  22. package/dist/chunk-J4WKMKTP.js +5 -0
  23. package/dist/{chunk-MBEQASP3.js.map → chunk-J4WKMKTP.js.map} +1 -1
  24. package/dist/chunk-JGXE2YNV.js +46 -0
  25. package/dist/chunk-JGXE2YNV.js.map +1 -0
  26. package/dist/{chunk-TT2Q7YMZ.js → chunk-JXEPJ3YD.js} +6 -6
  27. package/dist/{chunk-TT2Q7YMZ.js.map → chunk-JXEPJ3YD.js.map} +1 -1
  28. package/dist/chunk-LY7JGDV7.js +6 -0
  29. package/dist/chunk-LY7JGDV7.js.map +1 -0
  30. package/dist/chunk-SR3X25TN.js +3 -0
  31. package/dist/chunk-SR3X25TN.js.map +1 -0
  32. package/dist/{chunk-63UYRJIC.js → chunk-TRQSP67X.js} +2 -2
  33. package/dist/chunk-U364GNQX.js +719 -0
  34. package/dist/chunk-U364GNQX.js.map +1 -0
  35. package/dist/chunk-VJUTQAPJ.js +2 -0
  36. package/dist/chunk-VJUTQAPJ.js.map +1 -0
  37. package/dist/cli.js +1 -1
  38. package/dist/cli.js.map +1 -1
  39. package/dist/{compaction-X46EQEPS.js → compaction-S5H6DTOR.js} +4 -4
  40. package/dist/config-UOHEG4BW.js +2 -0
  41. package/dist/config-mutator-KSEBWKJH.js +2 -0
  42. package/dist/{context-planner-G2J7FNNU.js → context-planner-2RGHJHSO.js} +3 -3
  43. package/dist/debug-TGAP7E7W.js +2 -0
  44. package/dist/discover-OATU7SHI.js +4 -0
  45. package/dist/discover-OATU7SHI.js.map +1 -0
  46. package/dist/{editor-chat-R54E65W5.js → editor-chat-FUBQLMAQ.js} +2 -2
  47. package/dist/heal-YP7QI7D3.js +2 -0
  48. package/dist/{inbox-L5ZZ623Y.js → inbox-O5UB3YQN.js} +2 -2
  49. package/dist/index.d.ts +462 -22
  50. package/dist/index.js +8 -8
  51. package/dist/index.js.map +1 -1
  52. package/dist/{ingest-whatsapp-NS4OWDOU.js → ingest-whatsapp-C3O5UPBX.js} +2 -2
  53. package/dist/loader-BGWA7IRY.js +2 -0
  54. package/dist/loader-LBHKSXBK.js +2 -0
  55. package/dist/memory-extract-KKPKAOPH.js +2 -0
  56. package/dist/{processes-XF5CV4LK.js → processes-7W27G3J3.js} +2 -2
  57. package/dist/program-2MDELQLX.js +2 -0
  58. package/dist/providers-WCQSKTNP.js +2 -0
  59. package/dist/query-FZAL7AQD.js +2 -0
  60. package/dist/recipes-LZ56TA3X.js +2 -0
  61. package/dist/registry-ONJSILH4.js +2 -0
  62. package/dist/scheduler-XRM2RJIV.js +2 -0
  63. package/dist/{slack-PSQLVTGB.js → slack-D27BE37Q.js} +2 -2
  64. package/dist/store-4UCO56K2.js +2 -0
  65. package/dist/{subagent-2SJHSSJS.js → subagent-EPOT3QDM.js} +2 -2
  66. package/dist/{task-store-NM7VKNLE.js → task-store-3NUWLYRY.js} +2 -2
  67. package/dist/{telegram-W4SLFMNY.js → telegram-UWV67KWG.js} +2 -2
  68. package/dist/timers-QB4KYNAE.js +2 -0
  69. package/dist/types-ECMEC5BZ.js +2 -0
  70. package/dist/types-TTB6DJUE.js +2 -0
  71. package/dist/{usage-dashboard-AXPXB2KP.js → usage-dashboard-FQGPPABD.js} +2 -2
  72. package/dist/web/workflow-editor.global.js +35 -12
  73. package/dist/web/workflow-editor.global.js.map +1 -1
  74. package/dist/{whatsapp-DCHRBRVV.js → whatsapp-KJ2NRKKQ.js} +2 -2
  75. package/dist/{whatsapp-state-6D6FHHD2.js → whatsapp-state-3ZVQ6MQD.js} +2 -2
  76. package/dist/{wiki-UDPYFJBL.js → wiki-OUYKM7MB.js} +2 -2
  77. package/dist/wiki-OUYKM7MB.js.map +1 -0
  78. package/dist/workspace-setup-6GDBEORT.js +2 -0
  79. package/dist/workspace-setup-6GDBEORT.js.map +1 -0
  80. package/package.json +11 -1
  81. package/dist/agent-4AOMVXRJ.js +0 -2
  82. package/dist/board-dashboard-CXIVJKDP.js.map +0 -1
  83. package/dist/chunk-4HP6UC2X.js +0 -13
  84. package/dist/chunk-4HP6UC2X.js.map +0 -1
  85. package/dist/chunk-ABCHHNG6.js +0 -625
  86. package/dist/chunk-ABCHHNG6.js.map +0 -1
  87. package/dist/chunk-FIOB3MEX.js +0 -2
  88. package/dist/chunk-HCFSHGK4.js +0 -46
  89. package/dist/chunk-HCFSHGK4.js.map +0 -1
  90. package/dist/chunk-HHJGKD5B.js +0 -71
  91. package/dist/chunk-HHJGKD5B.js.map +0 -1
  92. package/dist/chunk-MBEQASP3.js +0 -5
  93. package/dist/chunk-MCJUAE6V.js +0 -6
  94. package/dist/chunk-MCJUAE6V.js.map +0 -1
  95. package/dist/chunk-SRHLXZRF.js.map +0 -1
  96. package/dist/chunk-XDJSYQST.js +0 -6
  97. package/dist/chunk-XDJSYQST.js.map +0 -1
  98. package/dist/chunk-YPOELN6Z.js +0 -798
  99. package/dist/chunk-YPOELN6Z.js.map +0 -1
  100. package/dist/config-KCYHMKCT.js +0 -2
  101. package/dist/config-mutator-QP4GLBOE.js +0 -2
  102. package/dist/debug-3MEUO2P2.js +0 -2
  103. package/dist/heal-JDXUPRET.js +0 -2
  104. package/dist/loader-PTCXLJEX.js +0 -2
  105. package/dist/memory-extract-WH4FZ456.js +0 -2
  106. package/dist/program-FFWEILAS.js +0 -2
  107. package/dist/providers-AKQ4HTB4.js +0 -2
  108. package/dist/query-PKGYE5HR.js +0 -2
  109. package/dist/registry-IFMDJWQ7.js +0 -2
  110. package/dist/scheduler-63D5KFO7.js +0 -2
  111. package/dist/store-5MJOO74U.js +0 -2
  112. package/dist/timers-PCB4ZIBD.js +0 -2
  113. package/dist/types-C7IFH42Z.js +0 -2
  114. package/dist/types-OIFU3KSQ.js +0 -2
  115. package/dist/workspace-setup-C4VB3QZV.js +0 -2
  116. /package/dist/{agent-4AOMVXRJ.js.map → agent-RDVGL2TW.js.map} +0 -0
  117. /package/dist/{chunk-EKTPCSN4.js.map → chunk-4ITQP3XL.js.map} +0 -0
  118. /package/dist/{chunk-FIOB3MEX.js.map → chunk-HPDHNIA3.js.map} +0 -0
  119. /package/dist/{chunk-63UYRJIC.js.map → chunk-TRQSP67X.js.map} +0 -0
  120. /package/dist/{compaction-X46EQEPS.js.map → compaction-S5H6DTOR.js.map} +0 -0
  121. /package/dist/{config-KCYHMKCT.js.map → config-UOHEG4BW.js.map} +0 -0
  122. /package/dist/{config-mutator-QP4GLBOE.js.map → config-mutator-KSEBWKJH.js.map} +0 -0
  123. /package/dist/{context-planner-G2J7FNNU.js.map → context-planner-2RGHJHSO.js.map} +0 -0
  124. /package/dist/{debug-3MEUO2P2.js.map → debug-TGAP7E7W.js.map} +0 -0
  125. /package/dist/{editor-chat-R54E65W5.js.map → editor-chat-FUBQLMAQ.js.map} +0 -0
  126. /package/dist/{heal-JDXUPRET.js.map → heal-YP7QI7D3.js.map} +0 -0
  127. /package/dist/{inbox-L5ZZ623Y.js.map → inbox-O5UB3YQN.js.map} +0 -0
  128. /package/dist/{ingest-whatsapp-NS4OWDOU.js.map → ingest-whatsapp-C3O5UPBX.js.map} +0 -0
  129. /package/dist/{loader-PTCXLJEX.js.map → loader-BGWA7IRY.js.map} +0 -0
  130. /package/dist/{memory-extract-WH4FZ456.js.map → loader-LBHKSXBK.js.map} +0 -0
  131. /package/dist/{program-FFWEILAS.js.map → memory-extract-KKPKAOPH.js.map} +0 -0
  132. /package/dist/{processes-XF5CV4LK.js.map → processes-7W27G3J3.js.map} +0 -0
  133. /package/dist/{providers-AKQ4HTB4.js.map → program-2MDELQLX.js.map} +0 -0
  134. /package/dist/{query-PKGYE5HR.js.map → providers-WCQSKTNP.js.map} +0 -0
  135. /package/dist/{registry-IFMDJWQ7.js.map → query-FZAL7AQD.js.map} +0 -0
  136. /package/dist/{scheduler-63D5KFO7.js.map → recipes-LZ56TA3X.js.map} +0 -0
  137. /package/dist/{store-5MJOO74U.js.map → registry-ONJSILH4.js.map} +0 -0
  138. /package/dist/{task-store-NM7VKNLE.js.map → scheduler-XRM2RJIV.js.map} +0 -0
  139. /package/dist/{slack-PSQLVTGB.js.map → slack-D27BE37Q.js.map} +0 -0
  140. /package/dist/{timers-PCB4ZIBD.js.map → store-4UCO56K2.js.map} +0 -0
  141. /package/dist/{subagent-2SJHSSJS.js.map → subagent-EPOT3QDM.js.map} +0 -0
  142. /package/dist/{types-C7IFH42Z.js.map → task-store-3NUWLYRY.js.map} +0 -0
  143. /package/dist/{telegram-W4SLFMNY.js.map → telegram-UWV67KWG.js.map} +0 -0
  144. /package/dist/{types-OIFU3KSQ.js.map → timers-QB4KYNAE.js.map} +0 -0
  145. /package/dist/{wiki-UDPYFJBL.js.map → types-ECMEC5BZ.js.map} +0 -0
  146. /package/dist/{workspace-setup-C4VB3QZV.js.map → types-TTB6DJUE.js.map} +0 -0
  147. /package/dist/{usage-dashboard-AXPXB2KP.js.map → usage-dashboard-FQGPPABD.js.map} +0 -0
  148. /package/dist/{whatsapp-DCHRBRVV.js.map → whatsapp-KJ2NRKKQ.js.map} +0 -0
  149. /package/dist/{whatsapp-state-6D6FHHD2.js.map → whatsapp-state-3ZVQ6MQD.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -262,7 +262,7 @@ interface UserPreference {
262
262
  confidence: number;
263
263
  source: string;
264
264
  }
265
- interface MemoryStore {
265
+ interface MemoryStore$1 {
266
266
  version: number;
267
267
  entries: MemoryEntry[];
268
268
  patterns: LearnedPattern[];
@@ -293,7 +293,7 @@ declare class Memory {
293
293
  getSimilarTasks(task: string, limit?: number): MemoryEntry[];
294
294
  getPatterns(): LearnedPattern[];
295
295
  getPreferences(): UserPreference[];
296
- getStats(): MemoryStore["stats"];
296
+ getStats(): MemoryStore$1["stats"];
297
297
  buildMemoryContext(task: string): string;
298
298
  private extractPattern;
299
299
  private updateSuccessRate;
@@ -413,6 +413,15 @@ declare const skillFrontmatterSchema: z.ZodObject<{
413
413
  }>, "many">>;
414
414
  /** If true, skill is auto-injected into context when triggers match (per-turn) */
415
415
  autoInject: z.ZodOptional<z.ZodBoolean>;
416
+ /** Reference card ids cited by this skill (e.g. "ksi.gitlab.project.ksi-v2").
417
+ * Audit lint flags FAILING when any id does not resolve. */
418
+ references: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
419
+ /** Skills this one delegates to (e.g. ksi-cx-email → [hotmail]). Audit lint
420
+ * flags FAILING when a delegate has no SKILL.md. */
421
+ delegatesTo: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
422
+ /** Free-form category — used by recipes and audit rules. Common values:
423
+ * deploy, ssh, email, gitlab, ops, content, marketing. */
424
+ category: z.ZodOptional<z.ZodString>;
416
425
  }, "strip", z.ZodTypeAny, {
417
426
  name: string;
418
427
  description: string;
@@ -425,6 +434,9 @@ declare const skillFrontmatterSchema: z.ZodObject<{
425
434
  description?: string | undefined;
426
435
  }[] | undefined;
427
436
  autoInject?: boolean | undefined;
437
+ references?: string[] | undefined;
438
+ delegatesTo?: string[] | undefined;
439
+ category?: string | undefined;
428
440
  }, {
429
441
  name: string;
430
442
  description: string;
@@ -437,6 +449,9 @@ declare const skillFrontmatterSchema: z.ZodObject<{
437
449
  description?: string | undefined;
438
450
  }[] | undefined;
439
451
  autoInject?: boolean | undefined;
452
+ references?: string[] | undefined;
453
+ delegatesTo?: string[] | undefined;
454
+ category?: string | undefined;
440
455
  }>;
441
456
  type SkillFrontmatter = z.infer<typeof skillFrontmatterSchema>;
442
457
  interface Skill {
@@ -758,8 +773,8 @@ declare class MemoryHierarchy {
758
773
  * Get stats from both levels.
759
774
  */
760
775
  getStats(): {
761
- user: MemoryStore["stats"];
762
- project: MemoryStore["stats"];
776
+ user: MemoryStore$1["stats"];
777
+ project: MemoryStore$1["stats"];
763
778
  };
764
779
  /**
765
780
  * Get recent generations from project level.
@@ -833,7 +848,7 @@ declare const debug: {
833
848
  channel(name: string, event: string, detail?: string): void;
834
849
  };
835
850
 
836
- interface Session {
851
+ interface Session$1 {
837
852
  id: string;
838
853
  createdAt: string;
839
854
  updatedAt: string;
@@ -845,25 +860,25 @@ interface Session {
845
860
  /**
846
861
  * Create a new session.
847
862
  */
848
- declare function createSession(cwd: string): Session;
863
+ declare function createSession(cwd: string): Session$1;
849
864
  /**
850
865
  * Save a session to disk.
851
866
  */
852
- declare function saveSession(session: Session): void;
867
+ declare function saveSession(session: Session$1): void;
853
868
  /**
854
869
  * Load a session from disk.
855
870
  */
856
- declare function loadSession(id: string): Session | null;
871
+ declare function loadSession(id: string): Session$1 | null;
857
872
  /**
858
873
  * Load the most recent session.
859
874
  */
860
- declare function loadLatestSession(): Session | null;
875
+ declare function loadLatestSession(): Session$1 | null;
861
876
  /**
862
877
  * List all saved sessions.
863
878
  */
864
- declare function listSessions(): Session[];
879
+ declare function listSessions(): Session$1[];
865
880
 
866
- declare function exportSession(session: Session, usage?: UsageSummary): string;
881
+ declare function exportSession(session: Session$1, usage?: UsageSummary): string;
867
882
 
868
883
  declare const PERMISSION_MODES: readonly ["default", "acceptEdits", "plan", "yolo"];
869
884
  type PermissionMode = (typeof PERMISSION_MODES)[number];
@@ -1151,9 +1166,9 @@ declare class ReplEngine {
1151
1166
  }
1152
1167
 
1153
1168
  interface CommandContext {
1154
- session: Session;
1169
+ session: Session$1;
1155
1170
  cwd: string;
1156
- onSessionChange: (session: Session) => void;
1171
+ onSessionChange: (session: Session$1) => void;
1157
1172
  }
1158
1173
  type SlashCommandHandler = (args: string, ctx: CommandContext) => Promise<boolean>;
1159
1174
  declare function registerCommand(name: string, handler: SlashCommandHandler): void;
@@ -1299,6 +1314,33 @@ declare const agentConfigSchema: z.ZodObject<{
1299
1314
  model: z.ZodOptional<z.ZodString>;
1300
1315
  systemPrompt: z.ZodOptional<z.ZodString>;
1301
1316
  mentions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1317
+ /** MCP servers this agent's Claude Code session should load. Synced
1318
+ * to <workspace>/.mcp.json at daemon boot via agent-mcp.ts. Operator
1319
+ * edits to .mcp.json are respected (see SyncResult.skipped-operator-owned). */
1320
+ mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1321
+ command: z.ZodString;
1322
+ args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1323
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1324
+ }, "strip", z.ZodTypeAny, {
1325
+ command: string;
1326
+ args: string[];
1327
+ env?: Record<string, string> | undefined;
1328
+ }, {
1329
+ command: string;
1330
+ env?: Record<string, string> | undefined;
1331
+ args?: string[] | undefined;
1332
+ }>>>;
1333
+ /** Per-agent override for the global `session.contextStrategy`. Lets
1334
+ * one agent run `planner` (smaller upfront context, more tool-driven
1335
+ * exploration) while siblings stay on `layered`. Used for agents that
1336
+ * consistently bloat their cache via large workspace reads. */
1337
+ contextStrategy: z.ZodOptional<z.ZodEnum<["layered", "planner"]>>;
1338
+ /** When true, the registry resolves references-recipes for this agent's
1339
+ * workspace and renders a deterministic [Verified References] block at
1340
+ * priority 4.7. Off by default — flip on per agent (pm-ksi, devops-agent,
1341
+ * etc.) once a `references/` registry exists in the agent's workspace
1342
+ * or repo root. See src/agents/references/. */
1343
+ contextReferences: z.ZodDefault<z.ZodBoolean>;
1302
1344
  maxConcurrent: z.ZodDefault<z.ZodNumber>;
1303
1345
  /** Hard wall-clock cap on a single Claude Code invocation. Exceeding the
1304
1346
  * cap sends SIGTERM (exit 143). Default 20 min — bump for devops/coder
@@ -1332,6 +1374,7 @@ declare const agentConfigSchema: z.ZodObject<{
1332
1374
  workspace: string;
1333
1375
  tier: "claude-code" | "sdk" | "orchestrator";
1334
1376
  mentions: string[];
1377
+ contextReferences: boolean;
1335
1378
  maxConcurrent: number;
1336
1379
  maxExecutionMinutes: number;
1337
1380
  permissionMode: string;
@@ -1346,6 +1389,12 @@ declare const agentConfigSchema: z.ZodObject<{
1346
1389
  provider?: string | undefined;
1347
1390
  model?: string | undefined;
1348
1391
  systemPrompt?: string | undefined;
1392
+ mcp?: Record<string, {
1393
+ command: string;
1394
+ args: string[];
1395
+ env?: Record<string, string> | undefined;
1396
+ }> | undefined;
1397
+ contextStrategy?: "layered" | "planner" | undefined;
1349
1398
  }, {
1350
1399
  name: string;
1351
1400
  workspace: string;
@@ -1354,6 +1403,13 @@ declare const agentConfigSchema: z.ZodObject<{
1354
1403
  tier?: "claude-code" | "sdk" | "orchestrator" | undefined;
1355
1404
  systemPrompt?: string | undefined;
1356
1405
  mentions?: string[] | undefined;
1406
+ mcp?: Record<string, {
1407
+ command: string;
1408
+ env?: Record<string, string> | undefined;
1409
+ args?: string[] | undefined;
1410
+ }> | undefined;
1411
+ contextStrategy?: "layered" | "planner" | undefined;
1412
+ contextReferences?: boolean | undefined;
1357
1413
  maxConcurrent?: number | undefined;
1358
1414
  maxExecutionMinutes?: number | undefined;
1359
1415
  permissionMode?: string | undefined;
@@ -1475,6 +1531,33 @@ declare const daemonConfigSchema: z.ZodObject<{
1475
1531
  model: z.ZodOptional<z.ZodString>;
1476
1532
  systemPrompt: z.ZodOptional<z.ZodString>;
1477
1533
  mentions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1534
+ /** MCP servers this agent's Claude Code session should load. Synced
1535
+ * to <workspace>/.mcp.json at daemon boot via agent-mcp.ts. Operator
1536
+ * edits to .mcp.json are respected (see SyncResult.skipped-operator-owned). */
1537
+ mcp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1538
+ command: z.ZodString;
1539
+ args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1540
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1541
+ }, "strip", z.ZodTypeAny, {
1542
+ command: string;
1543
+ args: string[];
1544
+ env?: Record<string, string> | undefined;
1545
+ }, {
1546
+ command: string;
1547
+ env?: Record<string, string> | undefined;
1548
+ args?: string[] | undefined;
1549
+ }>>>;
1550
+ /** Per-agent override for the global `session.contextStrategy`. Lets
1551
+ * one agent run `planner` (smaller upfront context, more tool-driven
1552
+ * exploration) while siblings stay on `layered`. Used for agents that
1553
+ * consistently bloat their cache via large workspace reads. */
1554
+ contextStrategy: z.ZodOptional<z.ZodEnum<["layered", "planner"]>>;
1555
+ /** When true, the registry resolves references-recipes for this agent's
1556
+ * workspace and renders a deterministic [Verified References] block at
1557
+ * priority 4.7. Off by default — flip on per agent (pm-ksi, devops-agent,
1558
+ * etc.) once a `references/` registry exists in the agent's workspace
1559
+ * or repo root. See src/agents/references/. */
1560
+ contextReferences: z.ZodDefault<z.ZodBoolean>;
1478
1561
  maxConcurrent: z.ZodDefault<z.ZodNumber>;
1479
1562
  /** Hard wall-clock cap on a single Claude Code invocation. Exceeding the
1480
1563
  * cap sends SIGTERM (exit 143). Default 20 min — bump for devops/coder
@@ -1508,6 +1591,7 @@ declare const daemonConfigSchema: z.ZodObject<{
1508
1591
  workspace: string;
1509
1592
  tier: "claude-code" | "sdk" | "orchestrator";
1510
1593
  mentions: string[];
1594
+ contextReferences: boolean;
1511
1595
  maxConcurrent: number;
1512
1596
  maxExecutionMinutes: number;
1513
1597
  permissionMode: string;
@@ -1522,6 +1606,12 @@ declare const daemonConfigSchema: z.ZodObject<{
1522
1606
  provider?: string | undefined;
1523
1607
  model?: string | undefined;
1524
1608
  systemPrompt?: string | undefined;
1609
+ mcp?: Record<string, {
1610
+ command: string;
1611
+ args: string[];
1612
+ env?: Record<string, string> | undefined;
1613
+ }> | undefined;
1614
+ contextStrategy?: "layered" | "planner" | undefined;
1525
1615
  }, {
1526
1616
  name: string;
1527
1617
  workspace: string;
@@ -1530,6 +1620,13 @@ declare const daemonConfigSchema: z.ZodObject<{
1530
1620
  tier?: "claude-code" | "sdk" | "orchestrator" | undefined;
1531
1621
  systemPrompt?: string | undefined;
1532
1622
  mentions?: string[] | undefined;
1623
+ mcp?: Record<string, {
1624
+ command: string;
1625
+ env?: Record<string, string> | undefined;
1626
+ args?: string[] | undefined;
1627
+ }> | undefined;
1628
+ contextStrategy?: "layered" | "planner" | undefined;
1629
+ contextReferences?: boolean | undefined;
1533
1630
  maxConcurrent?: number | undefined;
1534
1631
  maxExecutionMinutes?: number | undefined;
1535
1632
  permissionMode?: string | undefined;
@@ -2937,7 +3034,6 @@ declare const daemonConfigSchema: z.ZodObject<{
2937
3034
  url: z.ZodString;
2938
3035
  dashboardUrl: z.ZodOptional<z.ZodString>;
2939
3036
  token: z.ZodOptional<z.ZodString>;
2940
- /** Phone numbers or JIDs. Substring match, same semantics as allowFrom. */
2941
3037
  dashboardToken: z.ZodOptional<z.ZodString>;
2942
3038
  }, "strip", z.ZodTypeAny, {
2943
3039
  name: string;
@@ -2952,8 +3048,7 @@ declare const daemonConfigSchema: z.ZodObject<{
2952
3048
  dashboardUrl?: string | undefined;
2953
3049
  dashboardToken?: string | undefined;
2954
3050
  }>, "many">>;
2955
- draftAgent: z.ZodOptional<z.ZodString>; /** Safety rails on live Baileys reads — personal-account accounts
2956
- * can get throttled/banned under burst reads. */
3051
+ draftAgent: z.ZodOptional<z.ZodString>;
2957
3052
  }, "strip", z.ZodTypeAny, {
2958
3053
  enabled: boolean;
2959
3054
  port: number;
@@ -3078,22 +3173,43 @@ declare const daemonConfigSchema: z.ZodObject<{
3078
3173
  enabled: z.ZodDefault<z.ZodBoolean>;
3079
3174
  /** Route to a mesh peer instead of local execution. */
3080
3175
  node: z.ZodOptional<z.ZodString>;
3176
+ /** Per-event-type workflow routing. Keys are platform event-type
3177
+ * strings — the format the platform's HTTP header uses, optionally
3178
+ * joined with the action. Examples:
3179
+ * GitHub: "issues.opened", "pull_request.synchronize",
3180
+ * "push" (action-less events use the bare type)
3181
+ * GitLab: "Note Hook", "Merge Request Hook"
3182
+ * Values are workflow ids registered via `agentx workflow create`.
3183
+ * When the inbound event-type matches a key, the named workflow is
3184
+ * dispatched; if no key matches, the webhook falls through to
3185
+ * `defaultWorkflow` (or the agent itself). Closes the recurring
3186
+ * GitHub problem of multiple event types collapsing to a single
3187
+ * workflow. */
3188
+ triggers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
3189
+ /** Workflow id used when no `triggers` entry matches the event-type.
3190
+ * Backward-compatible: pre-existing webhooks without `triggers`
3191
+ * always hit this path. */
3192
+ defaultWorkflow: z.ZodOptional<z.ZodString>;
3081
3193
  }, "strip", z.ZodTypeAny, {
3082
3194
  enabled: boolean;
3083
3195
  id: string;
3084
3196
  source: "custom" | "gitlab" | "discord" | "slack" | "github" | "sentry" | "stripe";
3085
3197
  agentId: string;
3086
3198
  description?: string | undefined;
3199
+ triggers?: Record<string, string> | undefined;
3087
3200
  node?: string | undefined;
3088
3201
  secretEnv?: string | undefined;
3202
+ defaultWorkflow?: string | undefined;
3089
3203
  }, {
3090
3204
  id: string;
3091
3205
  source: "custom" | "gitlab" | "discord" | "slack" | "github" | "sentry" | "stripe";
3092
3206
  agentId: string;
3093
3207
  enabled?: boolean | undefined;
3094
3208
  description?: string | undefined;
3209
+ triggers?: Record<string, string> | undefined;
3095
3210
  node?: string | undefined;
3096
3211
  secretEnv?: string | undefined;
3212
+ defaultWorkflow?: string | undefined;
3097
3213
  }>, "many">>;
3098
3214
  /** Session cache-reuse policy. Controls when we drop a Claude `--resume`
3099
3215
  * session and rebuild the prompt from scratch.
@@ -3130,17 +3246,17 @@ declare const daemonConfigSchema: z.ZodObject<{
3130
3246
  maxClaudeCodeDispatchesPerHour: z.ZodDefault<z.ZodNumber>;
3131
3247
  maxClaudeCodeDispatchesPer5h: z.ZodDefault<z.ZodNumber>;
3132
3248
  }, "strip", z.ZodTypeAny, {
3249
+ contextStrategy: "layered" | "planner";
3133
3250
  staleMinutes: number;
3134
3251
  maxTurnsPerSession: number;
3135
3252
  tierTwoThresholdTokens: number;
3136
- contextStrategy: "layered" | "planner";
3137
3253
  maxClaudeCodeDispatchesPerHour: number;
3138
3254
  maxClaudeCodeDispatchesPer5h: number;
3139
3255
  }, {
3256
+ contextStrategy?: "layered" | "planner" | undefined;
3140
3257
  staleMinutes?: number | undefined;
3141
3258
  maxTurnsPerSession?: number | undefined;
3142
3259
  tierTwoThresholdTokens?: number | undefined;
3143
- contextStrategy?: "layered" | "planner" | undefined;
3144
3260
  maxClaudeCodeDispatchesPerHour?: number | undefined;
3145
3261
  maxClaudeCodeDispatchesPer5h?: number | undefined;
3146
3262
  }>>;
@@ -3150,6 +3266,7 @@ declare const daemonConfigSchema: z.ZodObject<{
3150
3266
  workspace: string;
3151
3267
  tier: "claude-code" | "sdk" | "orchestrator";
3152
3268
  mentions: string[];
3269
+ contextReferences: boolean;
3153
3270
  maxConcurrent: number;
3154
3271
  maxExecutionMinutes: number;
3155
3272
  permissionMode: string;
@@ -3164,6 +3281,12 @@ declare const daemonConfigSchema: z.ZodObject<{
3164
3281
  provider?: string | undefined;
3165
3282
  model?: string | undefined;
3166
3283
  systemPrompt?: string | undefined;
3284
+ mcp?: Record<string, {
3285
+ command: string;
3286
+ args: string[];
3287
+ env?: Record<string, string> | undefined;
3288
+ }> | undefined;
3289
+ contextStrategy?: "layered" | "planner" | undefined;
3167
3290
  }>;
3168
3291
  mesh: {
3169
3292
  enabled: boolean;
@@ -3428,14 +3551,16 @@ declare const daemonConfigSchema: z.ZodObject<{
3428
3551
  source: "custom" | "gitlab" | "discord" | "slack" | "github" | "sentry" | "stripe";
3429
3552
  agentId: string;
3430
3553
  description?: string | undefined;
3554
+ triggers?: Record<string, string> | undefined;
3431
3555
  node?: string | undefined;
3432
3556
  secretEnv?: string | undefined;
3557
+ defaultWorkflow?: string | undefined;
3433
3558
  }[];
3434
3559
  session: {
3560
+ contextStrategy: "layered" | "planner";
3435
3561
  staleMinutes: number;
3436
3562
  maxTurnsPerSession: number;
3437
3563
  tierTwoThresholdTokens: number;
3438
- contextStrategy: "layered" | "planner";
3439
3564
  maxClaudeCodeDispatchesPerHour: number;
3440
3565
  maxClaudeCodeDispatchesPer5h: number;
3441
3566
  };
@@ -3496,6 +3621,13 @@ declare const daemonConfigSchema: z.ZodObject<{
3496
3621
  tier?: "claude-code" | "sdk" | "orchestrator" | undefined;
3497
3622
  systemPrompt?: string | undefined;
3498
3623
  mentions?: string[] | undefined;
3624
+ mcp?: Record<string, {
3625
+ command: string;
3626
+ env?: Record<string, string> | undefined;
3627
+ args?: string[] | undefined;
3628
+ }> | undefined;
3629
+ contextStrategy?: "layered" | "planner" | undefined;
3630
+ contextReferences?: boolean | undefined;
3499
3631
  maxConcurrent?: number | undefined;
3500
3632
  maxExecutionMinutes?: number | undefined;
3501
3633
  permissionMode?: string | undefined;
@@ -3807,14 +3939,16 @@ declare const daemonConfigSchema: z.ZodObject<{
3807
3939
  agentId: string;
3808
3940
  enabled?: boolean | undefined;
3809
3941
  description?: string | undefined;
3942
+ triggers?: Record<string, string> | undefined;
3810
3943
  node?: string | undefined;
3811
3944
  secretEnv?: string | undefined;
3945
+ defaultWorkflow?: string | undefined;
3812
3946
  }[] | undefined;
3813
3947
  session?: {
3948
+ contextStrategy?: "layered" | "planner" | undefined;
3814
3949
  staleMinutes?: number | undefined;
3815
3950
  maxTurnsPerSession?: number | undefined;
3816
3951
  tierTwoThresholdTokens?: number | undefined;
3817
- contextStrategy?: "layered" | "planner" | undefined;
3818
3952
  maxClaudeCodeDispatchesPerHour?: number | undefined;
3819
3953
  maxClaudeCodeDispatchesPer5h?: number | undefined;
3820
3954
  } | undefined;
@@ -3867,6 +4001,28 @@ declare class A2AMesh {
3867
4001
  removed: string[];
3868
4002
  updated: string[];
3869
4003
  }>;
4004
+ /** Number of peers currently registered (regardless of health). */
4005
+ peerCount(): number;
4006
+ /**
4007
+ * Re-probe a single peer immediately. Use case: an operator just added
4008
+ * an agent on the remote daemon and doesn't want to wait up to a full
4009
+ * health-check interval (default 60s) before mentioning the new agent
4010
+ * resolves. The probe pulls a fresh agent card and updates `state.agents`
4011
+ * so `directory()` reflects the new roster on the very next route lookup.
4012
+ *
4013
+ * Returns true on success, false when the peer is unknown or the probe
4014
+ * failed. Does NOT throw — callers can blindly fan-out across peers.
4015
+ */
4016
+ refreshPeer(name: string): Promise<boolean>;
4017
+ /**
4018
+ * Re-probe every peer in parallel. Cheap when peers are healthy
4019
+ * (single GET /a2a/agent-card per peer). Used by `agentx mesh refresh`
4020
+ * and after agent-roster changes to invalidate the cached directory.
4021
+ */
4022
+ refreshAll(): Promise<{
4023
+ name: string;
4024
+ healthy: boolean;
4025
+ }[]>;
3870
4026
  /**
3871
4027
  * Discover agent cards from all peers.
3872
4028
  */
@@ -4024,6 +4180,10 @@ declare class AgentXDaemon {
4024
4180
  * run on every daemon start. Write-if-absent for the skill, sentinel-
4025
4181
  * replace for CLAUDE.md, so operator edits survive. */
4026
4182
  private installAgentMemorySurface;
4183
+ /** Boot-time: sync each agent's `mcp` config block to
4184
+ * <workspace>/.mcp.json. Mirrors installAgentMemorySurface — same
4185
+ * ownership semantics, marker-based to preserve operator edits. */
4186
+ private installAgentMcpConfig;
4027
4187
  /** Look up an agent's workspace from the live registry. Returns null
4028
4188
  * for agents the daemon doesn't know about (e.g., a stale memory
4029
4189
  * entry for a since-removed agent). */
@@ -4359,6 +4519,262 @@ declare function executeTask(agent: AgentDef, task: AgentTask, providers: Record
4359
4519
  apiKey?: string;
4360
4520
  }>, onDelta?: StreamCallback, historyContext?: string, resumeSessionId?: string, onEvent?: (event: any) => void): Promise<AgentResponse>;
4361
4521
 
4522
+ interface DriftReport {
4523
+ /** 0-1 score: 0 = no drift, 1 = complete drift */
4524
+ overallScore: number;
4525
+ /** Ghost lexicon decay: percentage of domain words that disappeared */
4526
+ lexiconDecay: number;
4527
+ /** Tool-call Jaccard distance: 0 = identical patterns, 1 = completely different */
4528
+ toolShift: number;
4529
+ /** Keyword overlap decline: percentage of shared keywords lost */
4530
+ semanticDrift: number;
4531
+ /** Domain words that disappeared */
4532
+ lostWords: string[];
4533
+ /** New tool calls that weren't in the baseline */
4534
+ newTools: string[];
4535
+ /** Missing tool calls that were in the baseline */
4536
+ missingTools: string[];
4537
+ }
4538
+
4539
+ interface MemoryFact {
4540
+ id: string;
4541
+ agentId: string;
4542
+ category: "fact" | "secret" | "preference" | "commitment" | "task-state";
4543
+ content: string;
4544
+ keywords: string[];
4545
+ source: {
4546
+ channel: string;
4547
+ chatId: string;
4548
+ sender: string;
4549
+ date: string;
4550
+ };
4551
+ createdAt: string;
4552
+ expiresAt?: string;
4553
+ accessCount?: number;
4554
+ lastAccessed?: string;
4555
+ nextReview?: string;
4556
+ /** Review interval in days — doubles on each successful recall */
4557
+ intervalDays?: number;
4558
+ }
4559
+ declare class MemoryStore {
4560
+ private memoryDir;
4561
+ constructor(baseDir?: string);
4562
+ private filePath;
4563
+ addMemory(agentId: string, fact: Omit<MemoryFact, "id" | "createdAt">): void;
4564
+ getAll(agentId: string): MemoryFact[];
4565
+ findRelevant(message: string, agentId: string, limit?: number): MemoryFact[];
4566
+ buildContext(memories: MemoryFact[]): string;
4567
+ /**
4568
+ * Record that memories were accessed (for spaced repetition tracking).
4569
+ */
4570
+ recordAccess(agentId: string, memoryIds: string[]): void;
4571
+ /**
4572
+ * Get memories due for review (spaced repetition).
4573
+ * Returns facts whose nextReview date has passed or that have never been reviewed.
4574
+ */
4575
+ getDueForReview(agentId: string, limit?: number): MemoryFact[];
4576
+ /**
4577
+ * Build a recall prompt for memories due for review.
4578
+ * Injected into heartbeat context so the agent proactively recalls facts.
4579
+ */
4580
+ buildRecallContext(agentId: string): string;
4581
+ /**
4582
+ * Check if a substantially similar memory already exists.
4583
+ */
4584
+ hasSimilar(agentId: string, content: string): boolean;
4585
+ /**
4586
+ * Prune old/expired memories. Cap at MAX_MEMORIES per agent.
4587
+ */
4588
+ prune(agentId: string): void;
4589
+ }
4590
+
4591
+ interface SessionMessage {
4592
+ role: "user" | "agent";
4593
+ name?: string;
4594
+ content: string;
4595
+ timestamp: string;
4596
+ }
4597
+ interface Session {
4598
+ id: string;
4599
+ agentId: string;
4600
+ channel: string;
4601
+ chatId: string;
4602
+ day: string;
4603
+ claudeSessionId?: string;
4604
+ messages: SessionMessage[];
4605
+ createdAt: string;
4606
+ updatedAt: string;
4607
+ /** Number of completed turns on the current claudeSessionId. Resets to 0
4608
+ * when the session is rotated (cleared). Used to bound --resume growth:
4609
+ * Claude CLI replays the entire prior session on every turn, so long
4610
+ * sessions pay a linearly growing cache-read tax. */
4611
+ turnCount?: number;
4612
+ /** Total billable input of the LAST turn on this claudeSessionId
4613
+ * (inputTokens + cacheReadTokens + cacheCreateTokens). Used to detect
4614
+ * tier-2 hits (>200K) from the prior turn so we can rotate before the
4615
+ * next turn pays the 1.5× multiplier again. */
4616
+ lastTurnInputTokens?: number;
4617
+ }
4618
+ declare class SessionStore {
4619
+ private sessionsDir;
4620
+ private cache;
4621
+ private staleMinutes;
4622
+ private maxTurnsPerSession;
4623
+ private tierTwoThresholdTokens;
4624
+ constructor(baseDir?: string, opts?: {
4625
+ staleMinutes?: number;
4626
+ maxTurnsPerSession?: number;
4627
+ tierTwoThresholdTokens?: number;
4628
+ });
4629
+ /**
4630
+ * Build a deterministic session key.
4631
+ */
4632
+ private sessionKey;
4633
+ private sessionFile;
4634
+ /**
4635
+ * Get or create a session for this agent+channel+chat+day.
4636
+ */
4637
+ getSession(agentId: string, channel: string, chatId: string): Session;
4638
+ /**
4639
+ * Add a user message to the session. Consecutive duplicates from the same
4640
+ * sender are collapsed — when a user re-sends the exact same text (retry,
4641
+ * accidental double-tap, telegram glitches), storing every copy bloats the
4642
+ * replayed history and re-burns tokens on every subsequent turn.
4643
+ */
4644
+ addUserMessage(agentId: string, channel: string, chatId: string, senderName: string, content: string): void;
4645
+ /**
4646
+ * Add an agent response to the session. Same dedup rule as user messages —
4647
+ * retries and duplicate responses shouldn't be replayed on every turn.
4648
+ */
4649
+ addAgentMessage(agentId: string, channel: string, chatId: string, content: string): void;
4650
+ /**
4651
+ * Get the Claude Code session ID for this conversation (for --resume).
4652
+ * Returns undefined if no session yet (first message of the day).
4653
+ */
4654
+ getClaudeSessionId(agentId: string, channel: string, chatId: string): string | undefined;
4655
+ /**
4656
+ * Store the Claude Code session ID after first invocation.
4657
+ */
4658
+ setClaudeSessionId(agentId: string, channel: string, chatId: string, claudeSessionId: string): void;
4659
+ /**
4660
+ * Build conversation history string to prepend to the prompt.
4661
+ * Returns empty string if no history.
4662
+ * Used for non-claude-code tiers that don't have native sessions.
4663
+ */
4664
+ buildHistoryContext(agentId: string, channel: string, chatId: string): string;
4665
+ /**
4666
+ * Recall conversation turns across multiple stored sessions for an agent.
4667
+ *
4668
+ * Used by the `/recall` HTTP endpoint and the [Conversation Recall] skill —
4669
+ * when an agent receives a message that references prior context (anaphora,
4670
+ * "as discussed", "correct me if I'm wrong"), it can call this to fetch
4671
+ * the actual prior turns rather than guessing or running cold-start tool
4672
+ * calls. Read-only; no side effects.
4673
+ *
4674
+ * Pagination: cursor by timestamp, descending (newest first). Pass the
4675
+ * previous response's `oldestTs` as `before` to walk further back.
4676
+ *
4677
+ * Scoping: required `agentId`. `channel`/`chatId` narrow to a specific
4678
+ * thread; omit them to recall across all of this agent's conversations.
4679
+ * The store is per-agent on disk so we never leak another agent's chats.
4680
+ */
4681
+ recallTurns(opts: {
4682
+ agentId: string;
4683
+ channel?: string;
4684
+ chatId?: string;
4685
+ before?: string;
4686
+ after?: string;
4687
+ /** Convenience override for `after`: number of days back from now. */
4688
+ lookbackDays?: number;
4689
+ limit?: number;
4690
+ query?: string;
4691
+ participants?: string[];
4692
+ }): {
4693
+ turns: Array<{
4694
+ ts: string;
4695
+ role: "user" | "agent";
4696
+ senderName: string;
4697
+ content: string;
4698
+ channel: string;
4699
+ chatId: string;
4700
+ day: string;
4701
+ sessionFile: string;
4702
+ }>;
4703
+ oldestTs: string | null;
4704
+ hasMore: boolean;
4705
+ totalScanned: number;
4706
+ };
4707
+ /**
4708
+ * Check if a Claude session is stale (idle too long for --resume to be useful).
4709
+ * When stale, the resumed context will be too far behind — better to start fresh.
4710
+ */
4711
+ isSessionStale(agentId: string, channel: string, chatId: string): boolean;
4712
+ /**
4713
+ * Build a summary of recent messages from OTHER sessions for the same agent today.
4714
+ * This bridges the cross-chat amnesia gap — if someone shared info in a DM,
4715
+ * the group session gets a hint about it.
4716
+ *
4717
+ * Gated by `message`: cross-chat hints are expensive (up to ~1.5K tokens of
4718
+ * unrelated conversation) AND cache-breaking (the content changes as other
4719
+ * chats get traffic, invalidating the prompt cache every turn). We only
4720
+ * return hints when the current message actually references another
4721
+ * conversation or a peer agent. Pass `message = ""` to force-include
4722
+ * (legacy behavior) — useful for testing.
4723
+ */
4724
+ getCrossSessionSummary(agentId: string, channel: string, chatId: string, message?: string): string;
4725
+ /**
4726
+ * Check if session history needs compaction and compact if so.
4727
+ * Call this after adding messages. Returns true if compaction was performed.
4728
+ */
4729
+ compactIfNeeded(agentId: string, channel: string, chatId: string, memoryStore?: MemoryStore): Promise<{
4730
+ compacted: boolean;
4731
+ qualityScore?: number;
4732
+ lostEntities?: string[];
4733
+ drift?: DriftReport;
4734
+ }>;
4735
+ /**
4736
+ * Check if current session already has a compacted summary.
4737
+ */
4738
+ hasCompaction(agentId: string, channel: string, chatId: string): boolean;
4739
+ /**
4740
+ * Clear the stored Claude session ID so next invocation starts fresh.
4741
+ * Also resets the per-session turn counter and last-turn input size —
4742
+ * those are only meaningful relative to the current claudeSessionId.
4743
+ */
4744
+ clearClaudeSessionId(agentId: string, channel: string, chatId: string): void;
4745
+ /**
4746
+ * Check whether this session has hit the max-turns cap. Rotate when true
4747
+ * to stop --resume replay from growing unbounded across a long chat.
4748
+ */
4749
+ shouldRotateByTurns(agentId: string, channel: string, chatId: string): boolean;
4750
+ /**
4751
+ * Check whether the LAST turn on this session pushed total input past
4752
+ * the tier-2 threshold. If yes, rotate so we don't pay the 1.5×
4753
+ * multiplier again on the next turn.
4754
+ */
4755
+ shouldRotateByTierTwo(agentId: string, channel: string, chatId: string): boolean;
4756
+ /**
4757
+ * Record a completed turn's token usage and bump the turn counter.
4758
+ * Called after a successful Claude response returns with usage info.
4759
+ */
4760
+ recordTurnUsage(agentId: string, channel: string, chatId: string, usage: {
4761
+ inputTokens: number;
4762
+ outputTokens: number;
4763
+ cacheReadTokens: number;
4764
+ cacheCreateTokens: number;
4765
+ }): void;
4766
+ /** Diagnostic getters — used by registry logging. */
4767
+ getTurnCount(agentId: string, channel: string, chatId: string): number;
4768
+ getLastTurnInputTokens(agentId: string, channel: string, chatId: string): number;
4769
+ getMaxTurnsPerSession(): number;
4770
+ getTierTwoThresholdTokens(): number;
4771
+ /**
4772
+ * Trim session to stay within limits.
4773
+ */
4774
+ private trim;
4775
+ private save;
4776
+ }
4777
+
4362
4778
  type WikiAccess = "private" | "shared" | "public";
4363
4779
  /**
4364
4780
  * Article type — the organizational spine. Matches Farzapedia's
@@ -5353,6 +5769,11 @@ declare class AgentRegistry {
5353
5769
  private lastSummaries;
5354
5770
  /** 24-hour sparkline cache per agent — recomputed from disk at most once a minute. */
5355
5771
  private sparklineCache;
5772
+ /** Per-workspace references registry cache. Loaded lazily on first turn for
5773
+ * agents with `contextReferences: true`; reused for the daemon's lifetime
5774
+ * (operator-edited registries take effect on next daemon restart — same
5775
+ * policy as agentx.json). */
5776
+ private referencesCache;
5356
5777
  private log;
5357
5778
  constructor(config: DaemonConfig, log?: (...args: unknown[]) => void);
5358
5779
  /**
@@ -5406,6 +5827,9 @@ declare class AgentRegistry {
5406
5827
  /** Wiki hub accessor. */
5407
5828
  getWikiHub(): WikiHub;
5408
5829
  getGraphStore(): GraphStore | undefined;
5830
+ /** Session-store accessor — used by the /recall HTTP endpoint to expose
5831
+ * conversation history to agents that need to rebuild context. */
5832
+ getSessionStore(): SessionStore;
5409
5833
  /**
5410
5834
  * Build peer list for context engine.
5411
5835
  */
@@ -5421,6 +5845,9 @@ declare class AgentRegistry {
5421
5845
  /**
5422
5846
  * List all agents and their status.
5423
5847
  */
5848
+ /** Total active task count across all agents — used by the daemon's
5849
+ * graceful shutdown to drain in-flight runs before exit. */
5850
+ getActiveTaskCount(): number;
5424
5851
  list(): Array<{
5425
5852
  id: string;
5426
5853
  name: string;
@@ -6289,6 +6716,13 @@ declare class MessageRouter {
6289
6716
  private dedupSaveTimer?;
6290
6717
  /** Crash-safe inflight log (see InflightLog class above). */
6291
6718
  private inflight;
6719
+ /** In-flight mesh forwards (this node is awaiting a peer's response).
6720
+ * Counted so the daemon's shutdown drain can wait for these in addition
6721
+ * to local agent tasks — otherwise a clawd restart mid-forward kills the
6722
+ * awaiter, the peer's response lands on a dead connection, and the
6723
+ * inflight-replay re-runs the task on the peer. */
6724
+ private activeMeshForwards;
6725
+ getActiveMeshForwardCount(): number;
6292
6726
  constructor(registry: AgentRegistry, config: DaemonConfig, hooks?: HookRegistry, log?: (...args: unknown[]) => void);
6293
6727
  private loadDedupFromDisk;
6294
6728
  private scheduleDedupSave;
@@ -6352,6 +6786,8 @@ declare class MessageRouter {
6352
6786
  private adapterEdit;
6353
6787
  private adapterReact;
6354
6788
  private startTypingLoop;
6789
+ private traceRoute;
6790
+ private runRoutingPipeline;
6355
6791
  /**
6356
6792
  * Handle a message by routing to a mesh peer's agent.
6357
6793
  * Searches peer agent cards for mention matches.
@@ -6368,6 +6804,10 @@ declare class MessageRouter {
6368
6804
  */
6369
6805
  private handleViaMeshByPeer;
6370
6806
  private getAccountForAgent;
6807
+ /** @deprecated Phase 2 — resolveAgent now delegates to the pipeline.
6808
+ * Kept as a thin wrapper for callers that only need the agentId; new
6809
+ * code should call runRoutingPipeline() to get the full PipelineResult
6810
+ * (deciding stage, drop reason, per-stage trace). */
6371
6811
  private resolveAgent;
6372
6812
  }
6373
6813
 
@@ -6381,7 +6821,7 @@ interface TelegramAccountConfig {
6381
6821
  declare class TelegramAdapter implements ChannelAdapter {
6382
6822
  readonly name = "telegram";
6383
6823
  private accounts;
6384
- private offsetStore;
6824
+ private cursors;
6385
6825
  private handler?;
6386
6826
  private polling;
6387
6827
  /** Per-account polling gate — flipped to false when an account is removed
@@ -6869,4 +7309,4 @@ declare function handleError(error: unknown): void;
6869
7309
  */
6870
7310
  declare function getPackageInfo(): PackageJson;
6871
7311
 
6872
- export { A2AClient, A2AMesh, A2AServer, A2AServerConfig, ALL_TOOL_NAMES, AgentCard, AgentConfig, AgentContext, AgentDef, AgentProvider, AgentRegistry, AgentResponse, AgentTask, AgentXDaemon, AgentXRuntime, AnthropicMessage, AuthConfig, AxisDef, AxisType, BLOCKING_EVENTS, ChannelAdapter, Classification, ClassificationSource, ClassificationStatus, ClaudeCodeProvider, ClaudeProvider, ContentBlock, ContextBuilder, CronJobDef, CronJobState, CronRunResult, CronScheduler, DaemonConfig, EnhanceConfig, EnhanceEngine, EnhanceResult, FingerprintEntry, GenerateOptions, GenerateResult, GenerateStreamEvent, GeneratedFile, GenerationMessage, GenerationResult, GitCommitResult, GitDiffFile, GitLogEntry, GitManager, GitStatus, GraphNode, GraphSchema, GraphStore, GraphStoreOptions, HOOK_EVENTS, HealConfig, HealEngine, HealResult, HookContext, HookDefinition, HookEvent, HookHandler, HookRegistry, HookResult, IncomingMessage, IndexFile, LevelDef, Memory, MemoryEntry, MemoryHierarchy, MemoryStore, MeshPeer, MessageRouter, MiddlewareFn, ModelUsage, NodesFile, OUTPUT_CONFIGS, OUTPUT_TYPES, OutgoingMessage, OutputConfig, OutputType, PERMISSION_MODES, PROVIDER_CAPABILITIES, PermissionAction, PermissionConfig, PermissionManager, PermissionMode, PermissionRule, Pipeline, PipelineRequest, PipelineResponse, ProjectSchemas, ProviderCapabilities, ProviderName, ProviderOptions, RawGenerationResult, ReplEngine, ReplOptions, RuntimeConfig, STARTER_SCHEMA, Session, StepUsage, StreamEvent, Task, TaskArtifact, TaskMessage, TaskState, TaskStatusUpdate, TechStack, TelegramAdapter, ToolCallInput, ToolExecutor, ToolExecutorOptions, ToolResult, UsageSummary, UsageTracker, WhatsAppAdapter, WikiAccess, WikiArticle, WikiArticleMeta, WikiEntry, WikiIndex, WikiStore, agentConfigSchema$1 as agentConfigSchema, checkCapabilities, createAgentContext, createProvider, createSession, daemonConfigSchema, debug, detectSchemas, detectTechStack, ensureCredentials, executeClaudeCode, executeOrchestrator, executeSdk, executeTask, exportSession, formatSchemas, formatTechStack, formatToolsForSystemPrompt, gatherContext7Docs, generate, generateSkill, generateSkillMd, generateStream, getAnthropicTools, getCommand, getLegacyTools, getPackageInfo, globalHooks, globalPermissions, globalTracker, handleError, installSkillPackage, isCommand, isDebug, listInstalledSkills, listSessions, loadAuthConfig, loadDaemonConfig, loadHooks, loadLatestSession, loadLocalSkills, loadProjectInstructions, loadSession, logger, matchSkillsToTask, outputTypeDescriptions, parseCommand, parseSkillContent, parseSkillFile, permissionConfigSchema, permissionModeSchema, registerCommand, resolveAtImports, resolveOutputType, resolveToken, runModelSetup, saveAuthConfig, saveSession, setDebug, startMcpServer, validateWorkspaces };
7312
+ export { A2AClient, A2AMesh, A2AServer, A2AServerConfig, ALL_TOOL_NAMES, AgentCard, AgentConfig, AgentContext, AgentDef, AgentProvider, AgentRegistry, AgentResponse, AgentTask, AgentXDaemon, AgentXRuntime, AnthropicMessage, AuthConfig, AxisDef, AxisType, BLOCKING_EVENTS, ChannelAdapter, Classification, ClassificationSource, ClassificationStatus, ClaudeCodeProvider, ClaudeProvider, ContentBlock, ContextBuilder, CronJobDef, CronJobState, CronRunResult, CronScheduler, DaemonConfig, EnhanceConfig, EnhanceEngine, EnhanceResult, FingerprintEntry, GenerateOptions, GenerateResult, GenerateStreamEvent, GeneratedFile, GenerationMessage, GenerationResult, GitCommitResult, GitDiffFile, GitLogEntry, GitManager, GitStatus, GraphNode, GraphSchema, GraphStore, GraphStoreOptions, HOOK_EVENTS, HealConfig, HealEngine, HealResult, HookContext, HookDefinition, HookEvent, HookHandler, HookRegistry, HookResult, IncomingMessage, IndexFile, LevelDef, Memory, MemoryEntry, MemoryHierarchy, MemoryStore$1 as MemoryStore, MeshPeer, MessageRouter, MiddlewareFn, ModelUsage, NodesFile, OUTPUT_CONFIGS, OUTPUT_TYPES, OutgoingMessage, OutputConfig, OutputType, PERMISSION_MODES, PROVIDER_CAPABILITIES, PermissionAction, PermissionConfig, PermissionManager, PermissionMode, PermissionRule, Pipeline, PipelineRequest, PipelineResponse, ProjectSchemas, ProviderCapabilities, ProviderName, ProviderOptions, RawGenerationResult, ReplEngine, ReplOptions, RuntimeConfig, STARTER_SCHEMA, Session$1 as Session, StepUsage, StreamEvent, Task, TaskArtifact, TaskMessage, TaskState, TaskStatusUpdate, TechStack, TelegramAdapter, ToolCallInput, ToolExecutor, ToolExecutorOptions, ToolResult, UsageSummary, UsageTracker, WhatsAppAdapter, WikiAccess, WikiArticle, WikiArticleMeta, WikiEntry, WikiIndex, WikiStore, agentConfigSchema$1 as agentConfigSchema, checkCapabilities, createAgentContext, createProvider, createSession, daemonConfigSchema, debug, detectSchemas, detectTechStack, ensureCredentials, executeClaudeCode, executeOrchestrator, executeSdk, executeTask, exportSession, formatSchemas, formatTechStack, formatToolsForSystemPrompt, gatherContext7Docs, generate, generateSkill, generateSkillMd, generateStream, getAnthropicTools, getCommand, getLegacyTools, getPackageInfo, globalHooks, globalPermissions, globalTracker, handleError, installSkillPackage, isCommand, isDebug, listInstalledSkills, listSessions, loadAuthConfig, loadDaemonConfig, loadHooks, loadLatestSession, loadLocalSkills, loadProjectInstructions, loadSession, logger, matchSkillsToTask, outputTypeDescriptions, parseCommand, parseSkillContent, parseSkillFile, permissionConfigSchema, permissionModeSchema, registerCommand, resolveAtImports, resolveOutputType, resolveToken, runModelSetup, saveAuthConfig, saveSession, setDebug, startMcpServer, validateWorkspaces };