agentix-cli 0.132.0 → 0.134.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 (154) hide show
  1. package/dist/{App-VPYWOTTH.js → App-4UVAI5C5.js} +2 -2
  2. package/dist/{ChatApp-SNED4KJB.js → ChatApp-COO67WIR.js} +2 -2
  3. package/dist/absorb-eval-WU7JR3BT.js +2 -0
  4. package/dist/{agent-HXQYYLWZ.js → agent-2GPJGHHG.js} +2 -2
  5. package/dist/{board-dashboard-44JPXA7J.js → board-dashboard-PUQPL4AX.js} +376 -257
  6. package/dist/board-dashboard-PUQPL4AX.js.map +1 -0
  7. package/dist/{chunk-RYGVTAP4.js → chunk-3XVST5XX.js} +2 -2
  8. package/dist/{note-reader-LPPIYYLT.js → chunk-4LWFJ4MZ.js} +3 -3
  9. package/dist/{note-reader-LPPIYYLT.js.map → chunk-4LWFJ4MZ.js.map} +1 -1
  10. package/dist/{chunk-724IBN5Y.js → chunk-4XMALK7X.js} +2 -2
  11. package/dist/{chunk-3WYLK3SX.js → chunk-AHO4CQRK.js} +2 -2
  12. package/dist/chunk-DDEDSYLF.js +105 -0
  13. package/dist/chunk-DDEDSYLF.js.map +1 -0
  14. package/dist/chunk-DYGQF3MI.js +54 -0
  15. package/dist/chunk-DYGQF3MI.js.map +1 -0
  16. package/dist/{chunk-ZG4G6BFP.js → chunk-ERULJ2ZL.js} +2 -2
  17. package/dist/chunk-FEEXOWK5.js +41 -0
  18. package/dist/chunk-FEEXOWK5.js.map +1 -0
  19. package/dist/{chunk-QNKSRROH.js → chunk-FWDRBUMS.js} +2 -2
  20. package/dist/chunk-G4HDRJVN.js +87 -0
  21. package/dist/chunk-G4HDRJVN.js.map +1 -0
  22. package/dist/{chunk-KQH4LPYC.js → chunk-K445URSN.js} +2 -2
  23. package/dist/{chunk-KDQI5S7F.js → chunk-LUYN6RAC.js} +2 -2
  24. package/dist/{chunk-JRVJXAVC.js → chunk-MM3F74K4.js} +31 -31
  25. package/dist/chunk-MM3F74K4.js.map +1 -0
  26. package/dist/{chunk-3K35L73A.js → chunk-NXRSIWQA.js} +3 -3
  27. package/dist/chunk-NXRSIWQA.js.map +1 -0
  28. package/dist/chunk-NZQBS7GN.js +2 -0
  29. package/dist/{chunk-KBJNJGBP.js.map → chunk-NZQBS7GN.js.map} +1 -1
  30. package/dist/{chunk-Z7RJ3K3J.js → chunk-P3I7AATX.js} +2 -2
  31. package/dist/{chunk-A6QJ4VFT.js → chunk-RDEFA6Y6.js} +2 -2
  32. package/dist/{chunk-VCQVF44A.js → chunk-RJOA7QBB.js} +2 -2
  33. package/dist/{chunk-JNKATLF7.js → chunk-RRGITX5B.js} +2 -2
  34. package/dist/chunk-SFVDQNTY.js +156 -0
  35. package/dist/chunk-SFVDQNTY.js.map +1 -0
  36. package/dist/{chunk-KKQPV6SO.js → chunk-SMAI7U6H.js} +2 -2
  37. package/dist/{chunk-MDGYSHO5.js → chunk-SSQMFHSM.js} +2 -2
  38. package/dist/{chunk-CM74OUXW.js → chunk-TDGDH4RA.js} +2 -2
  39. package/dist/chunk-URN74FTP.js +55 -0
  40. package/dist/chunk-URN74FTP.js.map +1 -0
  41. package/dist/{chunk-XWVBLISN.js → chunk-VQYVL72V.js} +2 -2
  42. package/dist/{chunk-UDMI4TYM.js → chunk-XOUO4XNA.js} +2 -2
  43. package/dist/{chunk-WWNZL7XB.js → chunk-XWO6ALJQ.js} +2 -2
  44. package/dist/{chunk-62NXS7PT.js → chunk-YSXE65O7.js} +246 -246
  45. package/dist/chunk-YSXE65O7.js.map +1 -0
  46. package/dist/cli.js +1 -1
  47. package/dist/{client-TXZF32NO.js → client-NFPBE6L4.js} +2 -2
  48. package/dist/config-GHMRBRDL.js +2 -0
  49. package/dist/{config-mutate-KDBXIN7R.js → config-mutate-2XV27EFV.js} +2 -2
  50. package/dist/config-mutator-6ITNU5DT.js +2 -0
  51. package/dist/{contributions-FBVULRR4.js → contributions-74M6YOCZ.js} +2 -2
  52. package/dist/{contributions-FBVULRR4.js.map → contributions-74M6YOCZ.js.map} +1 -1
  53. package/dist/{doctor-NBWYG743.js → doctor-UBXVMGJG.js} +2 -2
  54. package/dist/follow-up-tool-EARVITTS.js +7 -0
  55. package/dist/follow-up-tool-EARVITTS.js.map +1 -0
  56. package/dist/{hub-3QTJ7E3O.js → hub-VTDFUAEH.js} +2 -2
  57. package/dist/index.d.ts +1534 -3
  58. package/dist/index.js +1 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/note-reader-IDE6RI34.js +2 -0
  61. package/dist/notes-settings-VPXI5IIS.js +2 -0
  62. package/dist/{program-SA5O6IQ3.js → program-3URNCVEZ.js} +253 -253
  63. package/dist/program-3URNCVEZ.js.map +1 -0
  64. package/dist/{promote-4XHYWHLA.js → promote-B2BADAEP.js} +2 -2
  65. package/dist/push-bridge-325SXDGN.js +1 -1
  66. package/dist/query-2VIIGGDS.js +2 -0
  67. package/dist/query-settings-VJ3POZS3.js +3 -0
  68. package/dist/query-settings-VJ3POZS3.js.map +1 -0
  69. package/dist/registry-PRCISYBO.js +2 -0
  70. package/dist/{request-planner-4BAAOUBH.js → request-planner-MFAIVLUQ.js} +2 -2
  71. package/dist/{review-candidates-TM53WR7G.js → review-candidates-6WMDVVIZ.js} +2 -2
  72. package/dist/{routing-QLS6UMLM.js → routing-OPCLHIYW.js} +2 -2
  73. package/dist/schedule-tool-KPVTMYL3.js +2 -0
  74. package/dist/{scheduler-PVXLF2VJ.js → scheduler-G3WWYETY.js} +2 -2
  75. package/dist/{seat-OUUN3F45.js → seat-3HM4J7IX.js} +2 -2
  76. package/dist/{select-D7UUSODY.js → select-VEFE2ESF.js} +2 -2
  77. package/dist/{set-enabled-FDNS6KW6.js → set-enabled-US5BYKFZ.js} +2 -2
  78. package/dist/{tool-J5FM3OPM.js → tool-HUSCHORN.js} +2 -2
  79. package/dist/{tool-SCBQYDI3.js → tool-XLWLXGB5.js} +2 -2
  80. package/dist/wiki-SXWJ5NJQ.js +2 -0
  81. package/dist/wiki-SXWJ5NJQ.js.map +1 -0
  82. package/package.json +2 -1
  83. package/dist/absorb-eval-WGO4JWTO.js +0 -2
  84. package/dist/board-dashboard-44JPXA7J.js.map +0 -1
  85. package/dist/chunk-2ZDV3DCT.js +0 -52
  86. package/dist/chunk-2ZDV3DCT.js.map +0 -1
  87. package/dist/chunk-3K35L73A.js.map +0 -1
  88. package/dist/chunk-62NXS7PT.js.map +0 -1
  89. package/dist/chunk-74LPAKQY.js +0 -105
  90. package/dist/chunk-74LPAKQY.js.map +0 -1
  91. package/dist/chunk-7D3RJSN4.js +0 -156
  92. package/dist/chunk-7D3RJSN4.js.map +0 -1
  93. package/dist/chunk-EQ33PFXP.js +0 -55
  94. package/dist/chunk-EQ33PFXP.js.map +0 -1
  95. package/dist/chunk-JRVJXAVC.js.map +0 -1
  96. package/dist/chunk-KBJNJGBP.js +0 -2
  97. package/dist/chunk-RH3J4LCP.js +0 -37
  98. package/dist/chunk-RH3J4LCP.js.map +0 -1
  99. package/dist/chunk-S2RRPTS3.js +0 -54
  100. package/dist/chunk-S2RRPTS3.js.map +0 -1
  101. package/dist/config-ZIXIH23X.js +0 -2
  102. package/dist/config-mutator-HKFGPJMG.js +0 -2
  103. package/dist/follow-up-tool-E5XKSPKA.js +0 -6
  104. package/dist/follow-up-tool-E5XKSPKA.js.map +0 -1
  105. package/dist/notes-settings-WMOH2V75.js +0 -2
  106. package/dist/program-SA5O6IQ3.js.map +0 -1
  107. package/dist/query-ZGD32CE2.js +0 -2
  108. package/dist/query-settings-BSDXFS3V.js +0 -3
  109. package/dist/query-settings-BSDXFS3V.js.map +0 -1
  110. package/dist/registry-LM35AE2P.js +0 -2
  111. package/dist/schedule-tool-TTCWBAQ4.js +0 -2
  112. package/dist/wiki-IGRRQL6H.js +0 -2
  113. /package/dist/{App-VPYWOTTH.js.map → App-4UVAI5C5.js.map} +0 -0
  114. /package/dist/{ChatApp-SNED4KJB.js.map → ChatApp-COO67WIR.js.map} +0 -0
  115. /package/dist/{absorb-eval-WGO4JWTO.js.map → absorb-eval-WU7JR3BT.js.map} +0 -0
  116. /package/dist/{agent-HXQYYLWZ.js.map → agent-2GPJGHHG.js.map} +0 -0
  117. /package/dist/{chunk-RYGVTAP4.js.map → chunk-3XVST5XX.js.map} +0 -0
  118. /package/dist/{chunk-724IBN5Y.js.map → chunk-4XMALK7X.js.map} +0 -0
  119. /package/dist/{chunk-3WYLK3SX.js.map → chunk-AHO4CQRK.js.map} +0 -0
  120. /package/dist/{chunk-ZG4G6BFP.js.map → chunk-ERULJ2ZL.js.map} +0 -0
  121. /package/dist/{chunk-QNKSRROH.js.map → chunk-FWDRBUMS.js.map} +0 -0
  122. /package/dist/{chunk-KQH4LPYC.js.map → chunk-K445URSN.js.map} +0 -0
  123. /package/dist/{chunk-KDQI5S7F.js.map → chunk-LUYN6RAC.js.map} +0 -0
  124. /package/dist/{chunk-Z7RJ3K3J.js.map → chunk-P3I7AATX.js.map} +0 -0
  125. /package/dist/{chunk-A6QJ4VFT.js.map → chunk-RDEFA6Y6.js.map} +0 -0
  126. /package/dist/{chunk-VCQVF44A.js.map → chunk-RJOA7QBB.js.map} +0 -0
  127. /package/dist/{chunk-JNKATLF7.js.map → chunk-RRGITX5B.js.map} +0 -0
  128. /package/dist/{chunk-KKQPV6SO.js.map → chunk-SMAI7U6H.js.map} +0 -0
  129. /package/dist/{chunk-MDGYSHO5.js.map → chunk-SSQMFHSM.js.map} +0 -0
  130. /package/dist/{chunk-CM74OUXW.js.map → chunk-TDGDH4RA.js.map} +0 -0
  131. /package/dist/{chunk-XWVBLISN.js.map → chunk-VQYVL72V.js.map} +0 -0
  132. /package/dist/{chunk-UDMI4TYM.js.map → chunk-XOUO4XNA.js.map} +0 -0
  133. /package/dist/{chunk-WWNZL7XB.js.map → chunk-XWO6ALJQ.js.map} +0 -0
  134. /package/dist/{client-TXZF32NO.js.map → client-NFPBE6L4.js.map} +0 -0
  135. /package/dist/{config-ZIXIH23X.js.map → config-GHMRBRDL.js.map} +0 -0
  136. /package/dist/{config-mutate-KDBXIN7R.js.map → config-mutate-2XV27EFV.js.map} +0 -0
  137. /package/dist/{config-mutator-HKFGPJMG.js.map → config-mutator-6ITNU5DT.js.map} +0 -0
  138. /package/dist/{doctor-NBWYG743.js.map → doctor-UBXVMGJG.js.map} +0 -0
  139. /package/dist/{hub-3QTJ7E3O.js.map → hub-VTDFUAEH.js.map} +0 -0
  140. /package/dist/{notes-settings-WMOH2V75.js.map → note-reader-IDE6RI34.js.map} +0 -0
  141. /package/dist/{promote-4XHYWHLA.js.map → notes-settings-VPXI5IIS.js.map} +0 -0
  142. /package/dist/{query-ZGD32CE2.js.map → promote-B2BADAEP.js.map} +0 -0
  143. /package/dist/{registry-LM35AE2P.js.map → query-2VIIGGDS.js.map} +0 -0
  144. /package/dist/{routing-QLS6UMLM.js.map → registry-PRCISYBO.js.map} +0 -0
  145. /package/dist/{request-planner-4BAAOUBH.js.map → request-planner-MFAIVLUQ.js.map} +0 -0
  146. /package/dist/{review-candidates-TM53WR7G.js.map → review-candidates-6WMDVVIZ.js.map} +0 -0
  147. /package/dist/{schedule-tool-TTCWBAQ4.js.map → routing-OPCLHIYW.js.map} +0 -0
  148. /package/dist/{scheduler-PVXLF2VJ.js.map → schedule-tool-KPVTMYL3.js.map} +0 -0
  149. /package/dist/{seat-OUUN3F45.js.map → scheduler-G3WWYETY.js.map} +0 -0
  150. /package/dist/{wiki-IGRRQL6H.js.map → seat-3HM4J7IX.js.map} +0 -0
  151. /package/dist/{select-D7UUSODY.js.map → select-VEFE2ESF.js.map} +0 -0
  152. /package/dist/{set-enabled-FDNS6KW6.js.map → set-enabled-US5BYKFZ.js.map} +0 -0
  153. /package/dist/{tool-J5FM3OPM.js.map → tool-HUSCHORN.js.map} +0 -0
  154. /package/dist/{tool-SCBQYDI3.js.map → tool-XLWLXGB5.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1619,6 +1619,17 @@ declare const agentConfigSchema: z.ZodObject<{
1619
1619
  }, {
1620
1620
  enabled?: boolean | undefined;
1621
1621
  }>>;
1622
+ /** Where this agent's notes are, for `wiki query` when
1623
+ * `wiki.query.notes.enabled` (#862). Unset: the AgentX note store,
1624
+ * `.agentx/agent-memory/<agent>/`. A relative path is read from the
1625
+ * folder AgentX runs in. */
1626
+ notes: z.ZodDefault<z.ZodObject<{
1627
+ dir: z.ZodOptional<z.ZodString>;
1628
+ }, "strip", z.ZodTypeAny, {
1629
+ dir?: string | undefined;
1630
+ }, {
1631
+ dir?: string | undefined;
1632
+ }>>;
1622
1633
  }, "strip", z.ZodTypeAny, {
1623
1634
  contribute: {
1624
1635
  enabled: boolean;
@@ -1629,6 +1640,9 @@ declare const agentConfigSchema: z.ZodObject<{
1629
1640
  absorb: {
1630
1641
  enabled: boolean;
1631
1642
  };
1643
+ notes: {
1644
+ dir?: string | undefined;
1645
+ };
1632
1646
  }, {
1633
1647
  contribute?: {
1634
1648
  model?: string | undefined;
@@ -1639,6 +1653,9 @@ declare const agentConfigSchema: z.ZodObject<{
1639
1653
  absorb?: {
1640
1654
  enabled?: boolean | undefined;
1641
1655
  } | undefined;
1656
+ notes?: {
1657
+ dir?: string | undefined;
1658
+ } | undefined;
1642
1659
  }>>;
1643
1660
  permissionMode: z.ZodDefault<z.ZodString>;
1644
1661
  /** How this agent's `claude` CLI is billed (claude-code tier). Default
@@ -2001,6 +2018,9 @@ declare const agentConfigSchema: z.ZodObject<{
2001
2018
  absorb: {
2002
2019
  enabled: boolean;
2003
2020
  };
2021
+ notes: {
2022
+ dir?: string | undefined;
2023
+ };
2004
2024
  } | undefined;
2005
2025
  voice?: {
2006
2026
  system?: string | Record<string, string> | undefined;
@@ -2052,6 +2072,9 @@ declare const agentConfigSchema: z.ZodObject<{
2052
2072
  absorb?: {
2053
2073
  enabled?: boolean | undefined;
2054
2074
  } | undefined;
2075
+ notes?: {
2076
+ dir?: string | undefined;
2077
+ } | undefined;
2055
2078
  } | undefined;
2056
2079
  voice?: {
2057
2080
  system?: string | Record<string, string> | undefined;
@@ -2557,6 +2580,17 @@ declare const daemonConfigSchema: z.ZodObject<{
2557
2580
  }, {
2558
2581
  enabled?: boolean | undefined;
2559
2582
  }>>;
2583
+ /** Where this agent's notes are, for `wiki query` when
2584
+ * `wiki.query.notes.enabled` (#862). Unset: the AgentX note store,
2585
+ * `.agentx/agent-memory/<agent>/`. A relative path is read from the
2586
+ * folder AgentX runs in. */
2587
+ notes: z.ZodDefault<z.ZodObject<{
2588
+ dir: z.ZodOptional<z.ZodString>;
2589
+ }, "strip", z.ZodTypeAny, {
2590
+ dir?: string | undefined;
2591
+ }, {
2592
+ dir?: string | undefined;
2593
+ }>>;
2560
2594
  }, "strip", z.ZodTypeAny, {
2561
2595
  contribute: {
2562
2596
  enabled: boolean;
@@ -2567,6 +2601,9 @@ declare const daemonConfigSchema: z.ZodObject<{
2567
2601
  absorb: {
2568
2602
  enabled: boolean;
2569
2603
  };
2604
+ notes: {
2605
+ dir?: string | undefined;
2606
+ };
2570
2607
  }, {
2571
2608
  contribute?: {
2572
2609
  model?: string | undefined;
@@ -2577,6 +2614,9 @@ declare const daemonConfigSchema: z.ZodObject<{
2577
2614
  absorb?: {
2578
2615
  enabled?: boolean | undefined;
2579
2616
  } | undefined;
2617
+ notes?: {
2618
+ dir?: string | undefined;
2619
+ } | undefined;
2580
2620
  }>>;
2581
2621
  permissionMode: z.ZodDefault<z.ZodString>;
2582
2622
  /** How this agent's `claude` CLI is billed (claude-code tier). Default
@@ -2939,6 +2979,9 @@ declare const daemonConfigSchema: z.ZodObject<{
2939
2979
  absorb: {
2940
2980
  enabled: boolean;
2941
2981
  };
2982
+ notes: {
2983
+ dir?: string | undefined;
2984
+ };
2942
2985
  } | undefined;
2943
2986
  voice?: {
2944
2987
  system?: string | Record<string, string> | undefined;
@@ -2990,6 +3033,9 @@ declare const daemonConfigSchema: z.ZodObject<{
2990
3033
  absorb?: {
2991
3034
  enabled?: boolean | undefined;
2992
3035
  } | undefined;
3036
+ notes?: {
3037
+ dir?: string | undefined;
3038
+ } | undefined;
2993
3039
  } | undefined;
2994
3040
  voice?: {
2995
3041
  system?: string | Record<string, string> | undefined;
@@ -3114,16 +3160,43 @@ declare const daemonConfigSchema: z.ZodObject<{
3114
3160
  /** How pages are picked (#855). `summaries`: from the one-line page
3115
3161
  * summaries `agentx wiki summarize` writes, then a live read.
3116
3162
  * `catalog`: from titles, then a walk along the pages' links.
3117
- * `auto`: `summaries` once summaries exist, `catalog` until then. */
3163
+ * `auto`: `summaries` once most of the agent's own pages have a
3164
+ * summary (AUTO_SUMMARY_COVERAGE in src/wiki/query.ts), `catalog`
3165
+ * until then. */
3118
3166
  method: z.ZodDefault<z.ZodEnum<["auto", "summaries", "catalog"]>>;
3119
3167
  /** The agent's own pages shown to the model that picks. */
3120
3168
  candidates: z.ZodDefault<z.ZodNumber>;
3121
3169
  /** Other agents' pages shown beside them. */
3122
3170
  sharedCandidates: z.ZodDefault<z.ZodNumber>;
3171
+ /** The asking agent's own notes, searched beside its pages by the
3172
+ * summaries method (#862). A note's `description` is its summary
3173
+ * line. Only the agent's own notes: a note is private to the agent
3174
+ * that wrote it. Off by default. */
3175
+ notes: z.ZodDefault<z.ZodObject<{
3176
+ enabled: z.ZodDefault<z.ZodBoolean>;
3177
+ /** Note types searched. `user` and `feedback` notes describe a
3178
+ * person or the agent's own working rules and stay out. */
3179
+ types: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3180
+ /** Notes shown to the model that picks. */
3181
+ candidates: z.ZodDefault<z.ZodNumber>;
3182
+ }, "strip", z.ZodTypeAny, {
3183
+ enabled: boolean;
3184
+ types: string[];
3185
+ candidates: number;
3186
+ }, {
3187
+ enabled?: boolean | undefined;
3188
+ types?: string[] | undefined;
3189
+ candidates?: number | undefined;
3190
+ }>>;
3123
3191
  /** Most pages opened for one answer. */
3124
3192
  maxPages: z.ZodDefault<z.ZodNumber>;
3125
3193
  /** Characters of each opened page given to the answer. */
3126
3194
  pageChars: z.ZodDefault<z.ZodNumber>;
3195
+ /** Pages linked from the picked ones also opened (#863), best
3196
+ * summary line against the question first. 0: none. */
3197
+ linkedPages: z.ZodDefault<z.ZodNumber>;
3198
+ /** Characters all linked pages together give to the answer. */
3199
+ linkedChars: z.ZodDefault<z.ZodNumber>;
3127
3200
  /** Model that picks pages from the summary lines. */
3128
3201
  navigatorModel: z.ZodDefault<z.ZodString>;
3129
3202
  /** Model that writes the answer. */
@@ -3287,11 +3360,18 @@ declare const daemonConfigSchema: z.ZodObject<{
3287
3360
  }>>;
3288
3361
  }, "strip", z.ZodTypeAny, {
3289
3362
  method: "auto" | "summaries" | "catalog";
3363
+ notes: {
3364
+ enabled: boolean;
3365
+ types: string[];
3366
+ candidates: number;
3367
+ };
3290
3368
  shared: boolean;
3291
3369
  candidates: number;
3292
3370
  sharedCandidates: number;
3293
3371
  maxPages: number;
3294
3372
  pageChars: number;
3373
+ linkedPages: number;
3374
+ linkedChars: number;
3295
3375
  navigatorModel: string;
3296
3376
  answerModel: string;
3297
3377
  live: {
@@ -3325,11 +3405,18 @@ declare const daemonConfigSchema: z.ZodObject<{
3325
3405
  };
3326
3406
  }, {
3327
3407
  method?: "auto" | "summaries" | "catalog" | undefined;
3408
+ notes?: {
3409
+ enabled?: boolean | undefined;
3410
+ types?: string[] | undefined;
3411
+ candidates?: number | undefined;
3412
+ } | undefined;
3328
3413
  shared?: boolean | undefined;
3329
3414
  candidates?: number | undefined;
3330
3415
  sharedCandidates?: number | undefined;
3331
3416
  maxPages?: number | undefined;
3332
3417
  pageChars?: number | undefined;
3418
+ linkedPages?: number | undefined;
3419
+ linkedChars?: number | undefined;
3333
3420
  navigatorModel?: string | undefined;
3334
3421
  answerModel?: string | undefined;
3335
3422
  live?: {
@@ -3371,8 +3458,8 @@ declare const daemonConfigSchema: z.ZodObject<{
3371
3458
  maxWords: z.ZodDefault<z.ZodNumber>;
3372
3459
  /** When `agentx wiki summarize` runs on its own (cron, 5 fields).
3373
3460
  * Unset: no job is added. */
3374
- schedule: z.ZodOptional<z.ZodString>;
3375
- timezone: z.ZodDefault<z.ZodString>;
3461
+ schedule: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
3462
+ timezone: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
3376
3463
  /** Agent the job is filed under. Unset: `node.defaultAgent`, else
3377
3464
  * the first agent. */
3378
3465
  agent: z.ZodOptional<z.ZodString>;
@@ -3407,11 +3494,18 @@ declare const daemonConfigSchema: z.ZodObject<{
3407
3494
  }, "strip", z.ZodTypeAny, {
3408
3495
  query: {
3409
3496
  method: "auto" | "summaries" | "catalog";
3497
+ notes: {
3498
+ enabled: boolean;
3499
+ types: string[];
3500
+ candidates: number;
3501
+ };
3410
3502
  shared: boolean;
3411
3503
  candidates: number;
3412
3504
  sharedCandidates: number;
3413
3505
  maxPages: number;
3414
3506
  pageChars: number;
3507
+ linkedPages: number;
3508
+ linkedChars: number;
3415
3509
  navigatorModel: string;
3416
3510
  answerModel: string;
3417
3511
  live: {
@@ -3466,11 +3560,18 @@ declare const daemonConfigSchema: z.ZodObject<{
3466
3560
  }, {
3467
3561
  query?: {
3468
3562
  method?: "auto" | "summaries" | "catalog" | undefined;
3563
+ notes?: {
3564
+ enabled?: boolean | undefined;
3565
+ types?: string[] | undefined;
3566
+ candidates?: number | undefined;
3567
+ } | undefined;
3469
3568
  shared?: boolean | undefined;
3470
3569
  candidates?: number | undefined;
3471
3570
  sharedCandidates?: number | undefined;
3472
3571
  maxPages?: number | undefined;
3473
3572
  pageChars?: number | undefined;
3573
+ linkedPages?: number | undefined;
3574
+ linkedChars?: number | undefined;
3474
3575
  navigatorModel?: string | undefined;
3475
3576
  answerModel?: string | undefined;
3476
3577
  live?: {
@@ -7374,6 +7475,31 @@ declare const daemonConfigSchema: z.ZodObject<{
7374
7475
  stallMinutes?: number | undefined;
7375
7476
  maxNudges?: number | undefined;
7376
7477
  }>>;
7478
+ /** Run every task through a workflow (#858): a saved workflow that
7479
+ * fits, else a plan the agent writes first, else the one-step
7480
+ * `linear` template. Needs `enabled`. Off by default. */
7481
+ required: z.ZodDefault<z.ZodObject<{
7482
+ enabled: z.ZodDefault<z.ZodBoolean>;
7483
+ /** Per agent, by id: true or false wins over `enabled`. */
7484
+ agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
7485
+ /** A plain question answered in one turn, with no plan and only tools
7486
+ * that change nothing, leaves no run. On by default: such a turn has
7487
+ * nothing to follow up. */
7488
+ exemptQuestions: z.ZodDefault<z.ZodBoolean>;
7489
+ /** Task runs that ended are removed after this many days (#883),
7490
+ * at boot and every few hours. 0 keeps them all. */
7491
+ retentionDays: z.ZodDefault<z.ZodNumber>;
7492
+ }, "strip", z.ZodTypeAny, {
7493
+ enabled: boolean;
7494
+ agents: Record<string, boolean>;
7495
+ retentionDays: number;
7496
+ exemptQuestions: boolean;
7497
+ }, {
7498
+ enabled?: boolean | undefined;
7499
+ agents?: Record<string, boolean> | undefined;
7500
+ retentionDays?: number | undefined;
7501
+ exemptQuestions?: boolean | undefined;
7502
+ }>>;
7377
7503
  /** Controls whether the dashboard exposes the visual editor. "readonly"
7378
7504
  * serves the list + run timelines but strips write controls from the
7379
7505
  * page. "disabled" hides the tab entirely. */
@@ -7381,6 +7507,12 @@ declare const daemonConfigSchema: z.ZodObject<{
7381
7507
  }, "strip", z.ZodTypeAny, {
7382
7508
  dir: string;
7383
7509
  enabled: boolean;
7510
+ required: {
7511
+ enabled: boolean;
7512
+ agents: Record<string, boolean>;
7513
+ retentionDays: number;
7514
+ exemptQuestions: boolean;
7515
+ };
7384
7516
  followUp: {
7385
7517
  enabled: boolean;
7386
7518
  agents: Record<string, boolean>;
@@ -7402,6 +7534,12 @@ declare const daemonConfigSchema: z.ZodObject<{
7402
7534
  }, {
7403
7535
  dir?: string | undefined;
7404
7536
  enabled?: boolean | undefined;
7537
+ required?: {
7538
+ enabled?: boolean | undefined;
7539
+ agents?: Record<string, boolean> | undefined;
7540
+ retentionDays?: number | undefined;
7541
+ exemptQuestions?: boolean | undefined;
7542
+ } | undefined;
7405
7543
  followUp?: {
7406
7544
  enabled?: boolean | undefined;
7407
7545
  agents?: Record<string, boolean> | undefined;
@@ -7976,6 +8114,9 @@ declare const daemonConfigSchema: z.ZodObject<{
7976
8114
  absorb: {
7977
8115
  enabled: boolean;
7978
8116
  };
8117
+ notes: {
8118
+ dir?: string | undefined;
8119
+ };
7979
8120
  } | undefined;
7980
8121
  voice?: {
7981
8122
  system?: string | Record<string, string> | undefined;
@@ -8054,11 +8195,18 @@ declare const daemonConfigSchema: z.ZodObject<{
8054
8195
  wiki: {
8055
8196
  query: {
8056
8197
  method: "auto" | "summaries" | "catalog";
8198
+ notes: {
8199
+ enabled: boolean;
8200
+ types: string[];
8201
+ candidates: number;
8202
+ };
8057
8203
  shared: boolean;
8058
8204
  candidates: number;
8059
8205
  sharedCandidates: number;
8060
8206
  maxPages: number;
8061
8207
  pageChars: number;
8208
+ linkedPages: number;
8209
+ linkedChars: number;
8062
8210
  navigatorModel: string;
8063
8211
  answerModel: string;
8064
8212
  live: {
@@ -8685,6 +8833,12 @@ declare const daemonConfigSchema: z.ZodObject<{
8685
8833
  workflows: {
8686
8834
  dir: string;
8687
8835
  enabled: boolean;
8836
+ required: {
8837
+ enabled: boolean;
8838
+ agents: Record<string, boolean>;
8839
+ retentionDays: number;
8840
+ exemptQuestions: boolean;
8841
+ };
8688
8842
  followUp: {
8689
8843
  enabled: boolean;
8690
8844
  agents: Record<string, boolean>;
@@ -8874,6 +9028,9 @@ declare const daemonConfigSchema: z.ZodObject<{
8874
9028
  absorb?: {
8875
9029
  enabled?: boolean | undefined;
8876
9030
  } | undefined;
9031
+ notes?: {
9032
+ dir?: string | undefined;
9033
+ } | undefined;
8877
9034
  } | undefined;
8878
9035
  voice?: {
8879
9036
  system?: string | Record<string, string> | undefined;
@@ -9004,11 +9161,18 @@ declare const daemonConfigSchema: z.ZodObject<{
9004
9161
  wiki?: {
9005
9162
  query?: {
9006
9163
  method?: "auto" | "summaries" | "catalog" | undefined;
9164
+ notes?: {
9165
+ enabled?: boolean | undefined;
9166
+ types?: string[] | undefined;
9167
+ candidates?: number | undefined;
9168
+ } | undefined;
9007
9169
  shared?: boolean | undefined;
9008
9170
  candidates?: number | undefined;
9009
9171
  sharedCandidates?: number | undefined;
9010
9172
  maxPages?: number | undefined;
9011
9173
  pageChars?: number | undefined;
9174
+ linkedPages?: number | undefined;
9175
+ linkedChars?: number | undefined;
9012
9176
  navigatorModel?: string | undefined;
9013
9177
  answerModel?: string | undefined;
9014
9178
  live?: {
@@ -9697,6 +9861,12 @@ declare const daemonConfigSchema: z.ZodObject<{
9697
9861
  workflows?: {
9698
9862
  dir?: string | undefined;
9699
9863
  enabled?: boolean | undefined;
9864
+ required?: {
9865
+ enabled?: boolean | undefined;
9866
+ agents?: Record<string, boolean> | undefined;
9867
+ retentionDays?: number | undefined;
9868
+ exemptQuestions?: boolean | undefined;
9869
+ } | undefined;
9700
9870
  followUp?: {
9701
9871
  enabled?: boolean | undefined;
9702
9872
  agents?: Record<string, boolean> | undefined;
@@ -10485,6 +10655,7 @@ declare class AgentXDaemon {
10485
10655
  private httpServer?;
10486
10656
  private attachSweep?;
10487
10657
  private callSweep?;
10658
+ private taskRunPrune?;
10488
10659
  private webhooks;
10489
10660
  private github?;
10490
10661
  private webrtc?;
@@ -13248,6 +13419,1346 @@ declare class LandscapeBuilder {
13248
13419
  private extractCapability;
13249
13420
  }
13250
13421
 
13422
+ declare const runStatusSchema: z.ZodEnum<["running", "paused", "completed", "failed", "canceled"]>;
13423
+ type RunStatus = z.infer<typeof runStatusSchema>;
13424
+ declare const nodeExecutionEntrySchema: z.ZodObject<{
13425
+ at: z.ZodString;
13426
+ nodeId: z.ZodString;
13427
+ /** Which upstream node outputs fed this execution. Usually one id, or
13428
+ * empty for the trigger. */
13429
+ inputKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
13430
+ status: z.ZodEnum<["ok", "failed", "timeout", "skipped", "paused", "resumed"]>;
13431
+ /** The node's output bundle, if successful. Stored here so the full run
13432
+ * history can be replayed without the live context. */
13433
+ output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13434
+ /** Per-(runId, nodeId, eventId) key used to drop duplicate webhook
13435
+ * deliveries when a run is resumed from a checkpoint. */
13436
+ idempotencyKey: z.ZodString;
13437
+ note: z.ZodOptional<z.ZodString>;
13438
+ /** When the step began (#858). `at` is when it was recorded, so the
13439
+ * step took `durationMs` from here. Absent on entries written before. */
13440
+ startedAt: z.ZodOptional<z.ZodString>;
13441
+ /** How long the step ran, in milliseconds (#858). */
13442
+ durationMs: z.ZodOptional<z.ZodNumber>;
13443
+ }, "strip", z.ZodTypeAny, {
13444
+ at: string;
13445
+ status: "timeout" | "ok" | "failed" | "skipped" | "resumed" | "paused";
13446
+ idempotencyKey: string;
13447
+ nodeId: string;
13448
+ inputKeys: string[];
13449
+ output?: Record<string, unknown> | undefined;
13450
+ durationMs?: number | undefined;
13451
+ note?: string | undefined;
13452
+ startedAt?: string | undefined;
13453
+ }, {
13454
+ at: string;
13455
+ status: "timeout" | "ok" | "failed" | "skipped" | "resumed" | "paused";
13456
+ idempotencyKey: string;
13457
+ nodeId: string;
13458
+ output?: Record<string, unknown> | undefined;
13459
+ durationMs?: number | undefined;
13460
+ note?: string | undefined;
13461
+ startedAt?: string | undefined;
13462
+ inputKeys?: string[] | undefined;
13463
+ }>;
13464
+ type NodeExecutionEntry = z.infer<typeof nodeExecutionEntrySchema>;
13465
+ declare const entityRefSchema: z.ZodObject<{
13466
+ backend: z.ZodString;
13467
+ /** Stable identifier for the entity this run is scoped to. Used to key
13468
+ * the entity index so webhook re-entry can find the active run. */
13469
+ id: z.ZodString;
13470
+ }, "strip", z.ZodTypeAny, {
13471
+ id: string;
13472
+ backend: string;
13473
+ }, {
13474
+ id: string;
13475
+ backend: string;
13476
+ }>;
13477
+ type EntityRef = z.infer<typeof entityRefSchema>;
13478
+ declare const pausedAtSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
13479
+ kind: z.ZodLiteral<"checkpoint">;
13480
+ nodeId: z.ZodString;
13481
+ checkpointName: z.ZodString;
13482
+ /** Filter applied to incoming events for resume. Same shape as the
13483
+ * matching trigger.channel filter. */
13484
+ resumeMatch: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13485
+ }, "strip", z.ZodTypeAny, {
13486
+ kind: "checkpoint";
13487
+ nodeId: string;
13488
+ checkpointName: string;
13489
+ resumeMatch: Record<string, unknown>;
13490
+ }, {
13491
+ kind: "checkpoint";
13492
+ nodeId: string;
13493
+ checkpointName: string;
13494
+ resumeMatch?: Record<string, unknown> | undefined;
13495
+ }>, z.ZodObject<{
13496
+ kind: z.ZodLiteral<"subProcess">;
13497
+ nodeId: z.ZodString;
13498
+ childRunId: z.ZodString;
13499
+ childWorkflowId: z.ZodString;
13500
+ }, "strip", z.ZodTypeAny, {
13501
+ kind: "subProcess";
13502
+ nodeId: string;
13503
+ childRunId: string;
13504
+ childWorkflowId: string;
13505
+ }, {
13506
+ kind: "subProcess";
13507
+ nodeId: string;
13508
+ childRunId: string;
13509
+ childWorkflowId: string;
13510
+ }>, z.ZodObject<{
13511
+ kind: z.ZodLiteral<"signalWait">;
13512
+ nodeId: z.ZodString;
13513
+ signalName: z.ZodString;
13514
+ /** Optional field-match filter against the emitted signal payload. */
13515
+ match: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13516
+ scope: z.ZodDefault<z.ZodEnum<["workflow", "global"]>>;
13517
+ }, "strip", z.ZodTypeAny, {
13518
+ match: Record<string, unknown>;
13519
+ kind: "signalWait";
13520
+ scope: "workflow" | "global";
13521
+ nodeId: string;
13522
+ signalName: string;
13523
+ }, {
13524
+ kind: "signalWait";
13525
+ nodeId: string;
13526
+ signalName: string;
13527
+ match?: Record<string, unknown> | undefined;
13528
+ scope?: "workflow" | "global" | undefined;
13529
+ }>, z.ZodObject<{
13530
+ kind: z.ZodLiteral<"timerWait">;
13531
+ nodeId: z.ZodString;
13532
+ /** ISO-8601 instant when the timer should fire. */
13533
+ fireAt: z.ZodString;
13534
+ }, "strip", z.ZodTypeAny, {
13535
+ kind: "timerWait";
13536
+ nodeId: string;
13537
+ fireAt: string;
13538
+ }, {
13539
+ kind: "timerWait";
13540
+ nodeId: string;
13541
+ fireAt: string;
13542
+ }>, z.ZodObject<{
13543
+ kind: z.ZodLiteral<"ownerDecision">;
13544
+ nodeId: z.ZodString;
13545
+ cardId: z.ZodString;
13546
+ purpose: z.ZodEnum<["ask", "send", "start"]>;
13547
+ message: z.ZodOptional<z.ZodObject<{
13548
+ channel: z.ZodString;
13549
+ chatId: z.ZodString;
13550
+ accountId: z.ZodOptional<z.ZodString>;
13551
+ text: z.ZodString;
13552
+ to: z.ZodOptional<z.ZodString>;
13553
+ }, "strip", z.ZodTypeAny, {
13554
+ text: string;
13555
+ channel: string;
13556
+ chatId: string;
13557
+ to?: string | undefined;
13558
+ accountId?: string | undefined;
13559
+ }, {
13560
+ text: string;
13561
+ channel: string;
13562
+ chatId: string;
13563
+ to?: string | undefined;
13564
+ accountId?: string | undefined;
13565
+ }>>;
13566
+ }, "strip", z.ZodTypeAny, {
13567
+ kind: "ownerDecision";
13568
+ cardId: string;
13569
+ nodeId: string;
13570
+ purpose: "start" | "send" | "ask";
13571
+ message?: {
13572
+ text: string;
13573
+ channel: string;
13574
+ chatId: string;
13575
+ to?: string | undefined;
13576
+ accountId?: string | undefined;
13577
+ } | undefined;
13578
+ }, {
13579
+ kind: "ownerDecision";
13580
+ cardId: string;
13581
+ nodeId: string;
13582
+ purpose: "start" | "send" | "ask";
13583
+ message?: {
13584
+ text: string;
13585
+ channel: string;
13586
+ chatId: string;
13587
+ to?: string | undefined;
13588
+ accountId?: string | undefined;
13589
+ } | undefined;
13590
+ }>, z.ZodObject<{
13591
+ kind: z.ZodLiteral<"replyWait">;
13592
+ nodeId: z.ZodString;
13593
+ channel: z.ZodString;
13594
+ chatId: z.ZodString;
13595
+ accountId: z.ZodOptional<z.ZodString>;
13596
+ /** In a group: only this sender's message counts. */
13597
+ from: z.ZodOptional<z.ZodString>;
13598
+ deadline: z.ZodString;
13599
+ nextRemindAt: z.ZodOptional<z.ZodString>;
13600
+ remindEveryMs: z.ZodOptional<z.ZodNumber>;
13601
+ reminders: z.ZodDefault<z.ZodNumber>;
13602
+ maxReminders: z.ZodDefault<z.ZodNumber>;
13603
+ /** A person.message step whose sent text the reminder repeats. Unset:
13604
+ * the reminder goes to the owner instead. */
13605
+ reminds: z.ZodOptional<z.ZodString>;
13606
+ }, "strip", z.ZodTypeAny, {
13607
+ channel: string;
13608
+ chatId: string;
13609
+ kind: "replyWait";
13610
+ reminders: number;
13611
+ nodeId: string;
13612
+ deadline: string;
13613
+ maxReminders: number;
13614
+ from?: string | undefined;
13615
+ accountId?: string | undefined;
13616
+ nextRemindAt?: string | undefined;
13617
+ remindEveryMs?: number | undefined;
13618
+ reminds?: string | undefined;
13619
+ }, {
13620
+ channel: string;
13621
+ chatId: string;
13622
+ kind: "replyWait";
13623
+ nodeId: string;
13624
+ deadline: string;
13625
+ from?: string | undefined;
13626
+ accountId?: string | undefined;
13627
+ reminders?: number | undefined;
13628
+ nextRemindAt?: string | undefined;
13629
+ remindEveryMs?: number | undefined;
13630
+ maxReminders?: number | undefined;
13631
+ reminds?: string | undefined;
13632
+ }>, z.ZodObject<{
13633
+ kind: z.ZodLiteral<"agentStep">;
13634
+ nodeId: z.ZodString;
13635
+ agentId: z.ZodString;
13636
+ nudges: z.ZodDefault<z.ZodNumber>;
13637
+ maxNudges: z.ZodDefault<z.ZodNumber>;
13638
+ stallMs: z.ZodNumber;
13639
+ nextNudgeAt: z.ZodOptional<z.ZodString>;
13640
+ /** Set once the step is blocked: no more nudges, the owner is told. */
13641
+ blocked: z.ZodOptional<z.ZodString>;
13642
+ }, "strip", z.ZodTypeAny, {
13643
+ kind: "agentStep";
13644
+ agentId: string;
13645
+ nudges: number;
13646
+ maxNudges: number;
13647
+ nodeId: string;
13648
+ stallMs: number;
13649
+ blocked?: string | undefined;
13650
+ nextNudgeAt?: string | undefined;
13651
+ }, {
13652
+ kind: "agentStep";
13653
+ agentId: string;
13654
+ nodeId: string;
13655
+ stallMs: number;
13656
+ blocked?: string | undefined;
13657
+ nudges?: number | undefined;
13658
+ maxNudges?: number | undefined;
13659
+ nextNudgeAt?: string | undefined;
13660
+ }>, z.ZodObject<{
13661
+ kind: z.ZodLiteral<"agentStop">;
13662
+ nodeId: z.ZodString;
13663
+ agentId: z.ZodString;
13664
+ /** The stopped turn's running-task id: the stopped-task record. */
13665
+ taskId: z.ZodOptional<z.ZodString>;
13666
+ }, "strip", z.ZodTypeAny, {
13667
+ kind: "agentStop";
13668
+ agentId: string;
13669
+ nodeId: string;
13670
+ taskId?: string | undefined;
13671
+ }, {
13672
+ kind: "agentStop";
13673
+ agentId: string;
13674
+ nodeId: string;
13675
+ taskId?: string | undefined;
13676
+ }>]>;
13677
+ type PausedAt = z.infer<typeof pausedAtSchema>;
13678
+ /** What a follow-up run is about and who started it (#788). Runs that
13679
+ * triggers start have none. */
13680
+ declare const runMetaSchema: z.ZodObject<{
13681
+ /** One line: what this run is doing, in the owner's words. */
13682
+ title: z.ZodOptional<z.ZodString>;
13683
+ /** What the run concerns, as "kind:name" (client:acme, employee:sam,
13684
+ * project:site, idea:newsletter). The progress view groups by these. */
13685
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
13686
+ /** The agent that started it. */
13687
+ startedBy: z.ZodOptional<z.ZodString>;
13688
+ /** The open request (src/requests) this run serves. */
13689
+ requestId: z.ZodOptional<z.ZodString>;
13690
+ /** Followed: nudges, reminders, a blocked notice and one summary at
13691
+ * the end. */
13692
+ followUp: z.ZodDefault<z.ZodBoolean>;
13693
+ /** The owner approved this run's messages when it started. */
13694
+ approvedAtStart: z.ZodDefault<z.ZodBoolean>;
13695
+ /** The messages that approval covers, by step id: recipient and text as
13696
+ * the owner saw them (messageKey). Any other message is asked again. */
13697
+ approved: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
13698
+ /** Why the run cannot go on without the owner, and when they were told. */
13699
+ blocked: z.ZodOptional<z.ZodObject<{
13700
+ nodeId: z.ZodString;
13701
+ reason: z.ZodString;
13702
+ at: z.ZodString;
13703
+ }, "strip", z.ZodTypeAny, {
13704
+ at: string;
13705
+ reason: string;
13706
+ nodeId: string;
13707
+ }, {
13708
+ at: string;
13709
+ reason: string;
13710
+ nodeId: string;
13711
+ }>>;
13712
+ /** The owner got the end summary. Sent once. */
13713
+ endNotifiedAt: z.ZodOptional<z.ZodString>;
13714
+ /** A task run inside a workflow because `workflows.required` is on
13715
+ * (#858): the agent turn it wraps. `mode` is `linear` (the one-step
13716
+ * template) until the agent writes a plan. */
13717
+ wrap: z.ZodOptional<z.ZodObject<{
13718
+ agentId: z.ZodString;
13719
+ channel: z.ZodString;
13720
+ mode: z.ZodEnum<["linear", "plan"]>;
13721
+ taskId: z.ZodOptional<z.ZodString>;
13722
+ }, "strip", z.ZodTypeAny, {
13723
+ channel: string;
13724
+ mode: "plan" | "linear";
13725
+ agentId: string;
13726
+ taskId?: string | undefined;
13727
+ }, {
13728
+ channel: string;
13729
+ mode: "plan" | "linear";
13730
+ agentId: string;
13731
+ taskId?: string | undefined;
13732
+ }>>;
13733
+ /** The plan the agent wrote for a wrapped task, and each change to it. */
13734
+ plan: z.ZodOptional<z.ZodObject<{
13735
+ steps: z.ZodArray<z.ZodObject<{
13736
+ id: z.ZodString;
13737
+ title: z.ZodString;
13738
+ }, "strip", z.ZodTypeAny, {
13739
+ id: string;
13740
+ title: string;
13741
+ }, {
13742
+ id: string;
13743
+ title: string;
13744
+ }>, "many">;
13745
+ /** The step the agent said it started, and when. */
13746
+ current: z.ZodOptional<z.ZodObject<{
13747
+ id: z.ZodString;
13748
+ startedAt: z.ZodString;
13749
+ }, "strip", z.ZodTypeAny, {
13750
+ id: string;
13751
+ startedAt: string;
13752
+ }, {
13753
+ id: string;
13754
+ startedAt: string;
13755
+ }>>;
13756
+ revisions: z.ZodDefault<z.ZodArray<z.ZodObject<{
13757
+ at: z.ZodString;
13758
+ /** `plan`: the first plan. `revise`: a change to the steps left. */
13759
+ kind: z.ZodEnum<["plan", "revise"]>;
13760
+ reason: z.ZodOptional<z.ZodString>;
13761
+ /** The step ids still to do after this change. */
13762
+ steps: z.ZodArray<z.ZodString, "many">;
13763
+ /** The step ids the change dropped. */
13764
+ dropped: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
13765
+ }, "strip", z.ZodTypeAny, {
13766
+ at: string;
13767
+ steps: string[];
13768
+ kind: "plan" | "revise";
13769
+ dropped: string[];
13770
+ reason?: string | undefined;
13771
+ }, {
13772
+ at: string;
13773
+ steps: string[];
13774
+ kind: "plan" | "revise";
13775
+ reason?: string | undefined;
13776
+ dropped?: string[] | undefined;
13777
+ }>, "many">>;
13778
+ }, "strip", z.ZodTypeAny, {
13779
+ steps: {
13780
+ id: string;
13781
+ title: string;
13782
+ }[];
13783
+ revisions: {
13784
+ at: string;
13785
+ steps: string[];
13786
+ kind: "plan" | "revise";
13787
+ dropped: string[];
13788
+ reason?: string | undefined;
13789
+ }[];
13790
+ current?: {
13791
+ id: string;
13792
+ startedAt: string;
13793
+ } | undefined;
13794
+ }, {
13795
+ steps: {
13796
+ id: string;
13797
+ title: string;
13798
+ }[];
13799
+ current?: {
13800
+ id: string;
13801
+ startedAt: string;
13802
+ } | undefined;
13803
+ revisions?: {
13804
+ at: string;
13805
+ steps: string[];
13806
+ kind: "plan" | "revise";
13807
+ reason?: string | undefined;
13808
+ dropped?: string[] | undefined;
13809
+ }[] | undefined;
13810
+ }>>;
13811
+ /** The run this one continues (#870): a wrapped task that was stopped,
13812
+ * then resumed, gets a new run that names the one the stop closed. */
13813
+ continues: z.ZodOptional<z.ZodString>;
13814
+ }, "strip", z.ZodTypeAny, {
13815
+ followUp: boolean;
13816
+ tags: string[];
13817
+ approvedAtStart: boolean;
13818
+ blocked?: {
13819
+ at: string;
13820
+ reason: string;
13821
+ nodeId: string;
13822
+ } | undefined;
13823
+ plan?: {
13824
+ steps: {
13825
+ id: string;
13826
+ title: string;
13827
+ }[];
13828
+ revisions: {
13829
+ at: string;
13830
+ steps: string[];
13831
+ kind: "plan" | "revise";
13832
+ dropped: string[];
13833
+ reason?: string | undefined;
13834
+ }[];
13835
+ current?: {
13836
+ id: string;
13837
+ startedAt: string;
13838
+ } | undefined;
13839
+ } | undefined;
13840
+ title?: string | undefined;
13841
+ approved?: Record<string, string> | undefined;
13842
+ requestId?: string | undefined;
13843
+ continues?: string | undefined;
13844
+ startedBy?: string | undefined;
13845
+ endNotifiedAt?: string | undefined;
13846
+ wrap?: {
13847
+ channel: string;
13848
+ mode: "plan" | "linear";
13849
+ agentId: string;
13850
+ taskId?: string | undefined;
13851
+ } | undefined;
13852
+ }, {
13853
+ followUp?: boolean | undefined;
13854
+ tags?: string[] | undefined;
13855
+ blocked?: {
13856
+ at: string;
13857
+ reason: string;
13858
+ nodeId: string;
13859
+ } | undefined;
13860
+ plan?: {
13861
+ steps: {
13862
+ id: string;
13863
+ title: string;
13864
+ }[];
13865
+ current?: {
13866
+ id: string;
13867
+ startedAt: string;
13868
+ } | undefined;
13869
+ revisions?: {
13870
+ at: string;
13871
+ steps: string[];
13872
+ kind: "plan" | "revise";
13873
+ reason?: string | undefined;
13874
+ dropped?: string[] | undefined;
13875
+ }[] | undefined;
13876
+ } | undefined;
13877
+ title?: string | undefined;
13878
+ approved?: Record<string, string> | undefined;
13879
+ requestId?: string | undefined;
13880
+ continues?: string | undefined;
13881
+ startedBy?: string | undefined;
13882
+ approvedAtStart?: boolean | undefined;
13883
+ endNotifiedAt?: string | undefined;
13884
+ wrap?: {
13885
+ channel: string;
13886
+ mode: "plan" | "linear";
13887
+ agentId: string;
13888
+ taskId?: string | undefined;
13889
+ } | undefined;
13890
+ }>;
13891
+ type RunMeta = z.infer<typeof runMetaSchema>;
13892
+ declare const workflowRunSchema: z.ZodObject<{
13893
+ id: z.ZodString;
13894
+ workflowId: z.ZodString;
13895
+ workflowVersion: z.ZodLiteral<2>;
13896
+ homeNode: z.ZodString;
13897
+ status: z.ZodEnum<["running", "paused", "completed", "failed", "canceled"]>;
13898
+ pausedAt: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
13899
+ kind: z.ZodLiteral<"checkpoint">;
13900
+ nodeId: z.ZodString;
13901
+ checkpointName: z.ZodString;
13902
+ /** Filter applied to incoming events for resume. Same shape as the
13903
+ * matching trigger.channel filter. */
13904
+ resumeMatch: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13905
+ }, "strip", z.ZodTypeAny, {
13906
+ kind: "checkpoint";
13907
+ nodeId: string;
13908
+ checkpointName: string;
13909
+ resumeMatch: Record<string, unknown>;
13910
+ }, {
13911
+ kind: "checkpoint";
13912
+ nodeId: string;
13913
+ checkpointName: string;
13914
+ resumeMatch?: Record<string, unknown> | undefined;
13915
+ }>, z.ZodObject<{
13916
+ kind: z.ZodLiteral<"subProcess">;
13917
+ nodeId: z.ZodString;
13918
+ childRunId: z.ZodString;
13919
+ childWorkflowId: z.ZodString;
13920
+ }, "strip", z.ZodTypeAny, {
13921
+ kind: "subProcess";
13922
+ nodeId: string;
13923
+ childRunId: string;
13924
+ childWorkflowId: string;
13925
+ }, {
13926
+ kind: "subProcess";
13927
+ nodeId: string;
13928
+ childRunId: string;
13929
+ childWorkflowId: string;
13930
+ }>, z.ZodObject<{
13931
+ kind: z.ZodLiteral<"signalWait">;
13932
+ nodeId: z.ZodString;
13933
+ signalName: z.ZodString;
13934
+ /** Optional field-match filter against the emitted signal payload. */
13935
+ match: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13936
+ scope: z.ZodDefault<z.ZodEnum<["workflow", "global"]>>;
13937
+ }, "strip", z.ZodTypeAny, {
13938
+ match: Record<string, unknown>;
13939
+ kind: "signalWait";
13940
+ scope: "workflow" | "global";
13941
+ nodeId: string;
13942
+ signalName: string;
13943
+ }, {
13944
+ kind: "signalWait";
13945
+ nodeId: string;
13946
+ signalName: string;
13947
+ match?: Record<string, unknown> | undefined;
13948
+ scope?: "workflow" | "global" | undefined;
13949
+ }>, z.ZodObject<{
13950
+ kind: z.ZodLiteral<"timerWait">;
13951
+ nodeId: z.ZodString;
13952
+ /** ISO-8601 instant when the timer should fire. */
13953
+ fireAt: z.ZodString;
13954
+ }, "strip", z.ZodTypeAny, {
13955
+ kind: "timerWait";
13956
+ nodeId: string;
13957
+ fireAt: string;
13958
+ }, {
13959
+ kind: "timerWait";
13960
+ nodeId: string;
13961
+ fireAt: string;
13962
+ }>, z.ZodObject<{
13963
+ kind: z.ZodLiteral<"ownerDecision">;
13964
+ nodeId: z.ZodString;
13965
+ cardId: z.ZodString;
13966
+ purpose: z.ZodEnum<["ask", "send", "start"]>;
13967
+ message: z.ZodOptional<z.ZodObject<{
13968
+ channel: z.ZodString;
13969
+ chatId: z.ZodString;
13970
+ accountId: z.ZodOptional<z.ZodString>;
13971
+ text: z.ZodString;
13972
+ to: z.ZodOptional<z.ZodString>;
13973
+ }, "strip", z.ZodTypeAny, {
13974
+ text: string;
13975
+ channel: string;
13976
+ chatId: string;
13977
+ to?: string | undefined;
13978
+ accountId?: string | undefined;
13979
+ }, {
13980
+ text: string;
13981
+ channel: string;
13982
+ chatId: string;
13983
+ to?: string | undefined;
13984
+ accountId?: string | undefined;
13985
+ }>>;
13986
+ }, "strip", z.ZodTypeAny, {
13987
+ kind: "ownerDecision";
13988
+ cardId: string;
13989
+ nodeId: string;
13990
+ purpose: "start" | "send" | "ask";
13991
+ message?: {
13992
+ text: string;
13993
+ channel: string;
13994
+ chatId: string;
13995
+ to?: string | undefined;
13996
+ accountId?: string | undefined;
13997
+ } | undefined;
13998
+ }, {
13999
+ kind: "ownerDecision";
14000
+ cardId: string;
14001
+ nodeId: string;
14002
+ purpose: "start" | "send" | "ask";
14003
+ message?: {
14004
+ text: string;
14005
+ channel: string;
14006
+ chatId: string;
14007
+ to?: string | undefined;
14008
+ accountId?: string | undefined;
14009
+ } | undefined;
14010
+ }>, z.ZodObject<{
14011
+ kind: z.ZodLiteral<"replyWait">;
14012
+ nodeId: z.ZodString;
14013
+ channel: z.ZodString;
14014
+ chatId: z.ZodString;
14015
+ accountId: z.ZodOptional<z.ZodString>;
14016
+ /** In a group: only this sender's message counts. */
14017
+ from: z.ZodOptional<z.ZodString>;
14018
+ deadline: z.ZodString;
14019
+ nextRemindAt: z.ZodOptional<z.ZodString>;
14020
+ remindEveryMs: z.ZodOptional<z.ZodNumber>;
14021
+ reminders: z.ZodDefault<z.ZodNumber>;
14022
+ maxReminders: z.ZodDefault<z.ZodNumber>;
14023
+ /** A person.message step whose sent text the reminder repeats. Unset:
14024
+ * the reminder goes to the owner instead. */
14025
+ reminds: z.ZodOptional<z.ZodString>;
14026
+ }, "strip", z.ZodTypeAny, {
14027
+ channel: string;
14028
+ chatId: string;
14029
+ kind: "replyWait";
14030
+ reminders: number;
14031
+ nodeId: string;
14032
+ deadline: string;
14033
+ maxReminders: number;
14034
+ from?: string | undefined;
14035
+ accountId?: string | undefined;
14036
+ nextRemindAt?: string | undefined;
14037
+ remindEveryMs?: number | undefined;
14038
+ reminds?: string | undefined;
14039
+ }, {
14040
+ channel: string;
14041
+ chatId: string;
14042
+ kind: "replyWait";
14043
+ nodeId: string;
14044
+ deadline: string;
14045
+ from?: string | undefined;
14046
+ accountId?: string | undefined;
14047
+ reminders?: number | undefined;
14048
+ nextRemindAt?: string | undefined;
14049
+ remindEveryMs?: number | undefined;
14050
+ maxReminders?: number | undefined;
14051
+ reminds?: string | undefined;
14052
+ }>, z.ZodObject<{
14053
+ kind: z.ZodLiteral<"agentStep">;
14054
+ nodeId: z.ZodString;
14055
+ agentId: z.ZodString;
14056
+ nudges: z.ZodDefault<z.ZodNumber>;
14057
+ maxNudges: z.ZodDefault<z.ZodNumber>;
14058
+ stallMs: z.ZodNumber;
14059
+ nextNudgeAt: z.ZodOptional<z.ZodString>;
14060
+ /** Set once the step is blocked: no more nudges, the owner is told. */
14061
+ blocked: z.ZodOptional<z.ZodString>;
14062
+ }, "strip", z.ZodTypeAny, {
14063
+ kind: "agentStep";
14064
+ agentId: string;
14065
+ nudges: number;
14066
+ maxNudges: number;
14067
+ nodeId: string;
14068
+ stallMs: number;
14069
+ blocked?: string | undefined;
14070
+ nextNudgeAt?: string | undefined;
14071
+ }, {
14072
+ kind: "agentStep";
14073
+ agentId: string;
14074
+ nodeId: string;
14075
+ stallMs: number;
14076
+ blocked?: string | undefined;
14077
+ nudges?: number | undefined;
14078
+ maxNudges?: number | undefined;
14079
+ nextNudgeAt?: string | undefined;
14080
+ }>, z.ZodObject<{
14081
+ kind: z.ZodLiteral<"agentStop">;
14082
+ nodeId: z.ZodString;
14083
+ agentId: z.ZodString;
14084
+ /** The stopped turn's running-task id: the stopped-task record. */
14085
+ taskId: z.ZodOptional<z.ZodString>;
14086
+ }, "strip", z.ZodTypeAny, {
14087
+ kind: "agentStop";
14088
+ agentId: string;
14089
+ nodeId: string;
14090
+ taskId?: string | undefined;
14091
+ }, {
14092
+ kind: "agentStop";
14093
+ agentId: string;
14094
+ nodeId: string;
14095
+ taskId?: string | undefined;
14096
+ }>]>>;
14097
+ /** Output bundles keyed by producing node id. Downstream nodes read via
14098
+ * `{{<nodeId>.<path>}}` in templates. */
14099
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
14100
+ /** Node ids queued for execution next. The walk driver pops from this
14101
+ * until it's empty or a checkpoint pauses the run. */
14102
+ pending: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
14103
+ /** Per-`gateway.parallel(mode=join)` arrival tracker. Keys are join node
14104
+ * ids; values are the upstream node ids that have already delivered.
14105
+ * The join fires once when arrived.length === #incoming edges. Entries
14106
+ * are deleted from the map on fire so repeated passes (rare, but
14107
+ * possible via crash + retry) stay idempotent. */
14108
+ joinCounters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
14109
+ entityRef: z.ZodObject<{
14110
+ backend: z.ZodString;
14111
+ /** Stable identifier for the entity this run is scoped to. Used to key
14112
+ * the entity index so webhook re-entry can find the active run. */
14113
+ id: z.ZodString;
14114
+ }, "strip", z.ZodTypeAny, {
14115
+ id: string;
14116
+ backend: string;
14117
+ }, {
14118
+ id: string;
14119
+ backend: string;
14120
+ }>;
14121
+ history: z.ZodDefault<z.ZodArray<z.ZodObject<{
14122
+ at: z.ZodString;
14123
+ nodeId: z.ZodString;
14124
+ /** Which upstream node outputs fed this execution. Usually one id, or
14125
+ * empty for the trigger. */
14126
+ inputKeys: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
14127
+ status: z.ZodEnum<["ok", "failed", "timeout", "skipped", "paused", "resumed"]>;
14128
+ /** The node's output bundle, if successful. Stored here so the full run
14129
+ * history can be replayed without the live context. */
14130
+ output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14131
+ /** Per-(runId, nodeId, eventId) key used to drop duplicate webhook
14132
+ * deliveries when a run is resumed from a checkpoint. */
14133
+ idempotencyKey: z.ZodString;
14134
+ note: z.ZodOptional<z.ZodString>;
14135
+ /** When the step began (#858). `at` is when it was recorded, so the
14136
+ * step took `durationMs` from here. Absent on entries written before. */
14137
+ startedAt: z.ZodOptional<z.ZodString>;
14138
+ /** How long the step ran, in milliseconds (#858). */
14139
+ durationMs: z.ZodOptional<z.ZodNumber>;
14140
+ }, "strip", z.ZodTypeAny, {
14141
+ at: string;
14142
+ status: "timeout" | "ok" | "failed" | "skipped" | "resumed" | "paused";
14143
+ idempotencyKey: string;
14144
+ nodeId: string;
14145
+ inputKeys: string[];
14146
+ output?: Record<string, unknown> | undefined;
14147
+ durationMs?: number | undefined;
14148
+ note?: string | undefined;
14149
+ startedAt?: string | undefined;
14150
+ }, {
14151
+ at: string;
14152
+ status: "timeout" | "ok" | "failed" | "skipped" | "resumed" | "paused";
14153
+ idempotencyKey: string;
14154
+ nodeId: string;
14155
+ output?: Record<string, unknown> | undefined;
14156
+ durationMs?: number | undefined;
14157
+ note?: string | undefined;
14158
+ startedAt?: string | undefined;
14159
+ inputKeys?: string[] | undefined;
14160
+ }>, "many">>;
14161
+ /** Parent run id if this run is a sub-process child. Root runs have no
14162
+ * parent. */
14163
+ parentRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
14164
+ /** The parent node in the parent run that spawned this child. Null on
14165
+ * root runs. */
14166
+ parentNodeId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
14167
+ /** Root ancestor. Self-referential on root runs. Lets queries fetch the
14168
+ * entire composition tree in one shot. */
14169
+ rootRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
14170
+ /** Depth from root. 0 on root runs, N on Nth-level descendants. */
14171
+ depth: z.ZodDefault<z.ZodNumber>;
14172
+ /** Event-bus root the run was started under (src/events/envelope.ts).
14173
+ * Resumes after a pause or restart publish under it again. */
14174
+ eventRootId: z.ZodOptional<z.ZodString>;
14175
+ /** Follow-up runs only (#788). */
14176
+ meta: z.ZodOptional<z.ZodObject<{
14177
+ /** One line: what this run is doing, in the owner's words. */
14178
+ title: z.ZodOptional<z.ZodString>;
14179
+ /** What the run concerns, as "kind:name" (client:acme, employee:sam,
14180
+ * project:site, idea:newsletter). The progress view groups by these. */
14181
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
14182
+ /** The agent that started it. */
14183
+ startedBy: z.ZodOptional<z.ZodString>;
14184
+ /** The open request (src/requests) this run serves. */
14185
+ requestId: z.ZodOptional<z.ZodString>;
14186
+ /** Followed: nudges, reminders, a blocked notice and one summary at
14187
+ * the end. */
14188
+ followUp: z.ZodDefault<z.ZodBoolean>;
14189
+ /** The owner approved this run's messages when it started. */
14190
+ approvedAtStart: z.ZodDefault<z.ZodBoolean>;
14191
+ /** The messages that approval covers, by step id: recipient and text as
14192
+ * the owner saw them (messageKey). Any other message is asked again. */
14193
+ approved: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14194
+ /** Why the run cannot go on without the owner, and when they were told. */
14195
+ blocked: z.ZodOptional<z.ZodObject<{
14196
+ nodeId: z.ZodString;
14197
+ reason: z.ZodString;
14198
+ at: z.ZodString;
14199
+ }, "strip", z.ZodTypeAny, {
14200
+ at: string;
14201
+ reason: string;
14202
+ nodeId: string;
14203
+ }, {
14204
+ at: string;
14205
+ reason: string;
14206
+ nodeId: string;
14207
+ }>>;
14208
+ /** The owner got the end summary. Sent once. */
14209
+ endNotifiedAt: z.ZodOptional<z.ZodString>;
14210
+ /** A task run inside a workflow because `workflows.required` is on
14211
+ * (#858): the agent turn it wraps. `mode` is `linear` (the one-step
14212
+ * template) until the agent writes a plan. */
14213
+ wrap: z.ZodOptional<z.ZodObject<{
14214
+ agentId: z.ZodString;
14215
+ channel: z.ZodString;
14216
+ mode: z.ZodEnum<["linear", "plan"]>;
14217
+ taskId: z.ZodOptional<z.ZodString>;
14218
+ }, "strip", z.ZodTypeAny, {
14219
+ channel: string;
14220
+ mode: "plan" | "linear";
14221
+ agentId: string;
14222
+ taskId?: string | undefined;
14223
+ }, {
14224
+ channel: string;
14225
+ mode: "plan" | "linear";
14226
+ agentId: string;
14227
+ taskId?: string | undefined;
14228
+ }>>;
14229
+ /** The plan the agent wrote for a wrapped task, and each change to it. */
14230
+ plan: z.ZodOptional<z.ZodObject<{
14231
+ steps: z.ZodArray<z.ZodObject<{
14232
+ id: z.ZodString;
14233
+ title: z.ZodString;
14234
+ }, "strip", z.ZodTypeAny, {
14235
+ id: string;
14236
+ title: string;
14237
+ }, {
14238
+ id: string;
14239
+ title: string;
14240
+ }>, "many">;
14241
+ /** The step the agent said it started, and when. */
14242
+ current: z.ZodOptional<z.ZodObject<{
14243
+ id: z.ZodString;
14244
+ startedAt: z.ZodString;
14245
+ }, "strip", z.ZodTypeAny, {
14246
+ id: string;
14247
+ startedAt: string;
14248
+ }, {
14249
+ id: string;
14250
+ startedAt: string;
14251
+ }>>;
14252
+ revisions: z.ZodDefault<z.ZodArray<z.ZodObject<{
14253
+ at: z.ZodString;
14254
+ /** `plan`: the first plan. `revise`: a change to the steps left. */
14255
+ kind: z.ZodEnum<["plan", "revise"]>;
14256
+ reason: z.ZodOptional<z.ZodString>;
14257
+ /** The step ids still to do after this change. */
14258
+ steps: z.ZodArray<z.ZodString, "many">;
14259
+ /** The step ids the change dropped. */
14260
+ dropped: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
14261
+ }, "strip", z.ZodTypeAny, {
14262
+ at: string;
14263
+ steps: string[];
14264
+ kind: "plan" | "revise";
14265
+ dropped: string[];
14266
+ reason?: string | undefined;
14267
+ }, {
14268
+ at: string;
14269
+ steps: string[];
14270
+ kind: "plan" | "revise";
14271
+ reason?: string | undefined;
14272
+ dropped?: string[] | undefined;
14273
+ }>, "many">>;
14274
+ }, "strip", z.ZodTypeAny, {
14275
+ steps: {
14276
+ id: string;
14277
+ title: string;
14278
+ }[];
14279
+ revisions: {
14280
+ at: string;
14281
+ steps: string[];
14282
+ kind: "plan" | "revise";
14283
+ dropped: string[];
14284
+ reason?: string | undefined;
14285
+ }[];
14286
+ current?: {
14287
+ id: string;
14288
+ startedAt: string;
14289
+ } | undefined;
14290
+ }, {
14291
+ steps: {
14292
+ id: string;
14293
+ title: string;
14294
+ }[];
14295
+ current?: {
14296
+ id: string;
14297
+ startedAt: string;
14298
+ } | undefined;
14299
+ revisions?: {
14300
+ at: string;
14301
+ steps: string[];
14302
+ kind: "plan" | "revise";
14303
+ reason?: string | undefined;
14304
+ dropped?: string[] | undefined;
14305
+ }[] | undefined;
14306
+ }>>;
14307
+ /** The run this one continues (#870): a wrapped task that was stopped,
14308
+ * then resumed, gets a new run that names the one the stop closed. */
14309
+ continues: z.ZodOptional<z.ZodString>;
14310
+ }, "strip", z.ZodTypeAny, {
14311
+ followUp: boolean;
14312
+ tags: string[];
14313
+ approvedAtStart: boolean;
14314
+ blocked?: {
14315
+ at: string;
14316
+ reason: string;
14317
+ nodeId: string;
14318
+ } | undefined;
14319
+ plan?: {
14320
+ steps: {
14321
+ id: string;
14322
+ title: string;
14323
+ }[];
14324
+ revisions: {
14325
+ at: string;
14326
+ steps: string[];
14327
+ kind: "plan" | "revise";
14328
+ dropped: string[];
14329
+ reason?: string | undefined;
14330
+ }[];
14331
+ current?: {
14332
+ id: string;
14333
+ startedAt: string;
14334
+ } | undefined;
14335
+ } | undefined;
14336
+ title?: string | undefined;
14337
+ approved?: Record<string, string> | undefined;
14338
+ requestId?: string | undefined;
14339
+ continues?: string | undefined;
14340
+ startedBy?: string | undefined;
14341
+ endNotifiedAt?: string | undefined;
14342
+ wrap?: {
14343
+ channel: string;
14344
+ mode: "plan" | "linear";
14345
+ agentId: string;
14346
+ taskId?: string | undefined;
14347
+ } | undefined;
14348
+ }, {
14349
+ followUp?: boolean | undefined;
14350
+ tags?: string[] | undefined;
14351
+ blocked?: {
14352
+ at: string;
14353
+ reason: string;
14354
+ nodeId: string;
14355
+ } | undefined;
14356
+ plan?: {
14357
+ steps: {
14358
+ id: string;
14359
+ title: string;
14360
+ }[];
14361
+ current?: {
14362
+ id: string;
14363
+ startedAt: string;
14364
+ } | undefined;
14365
+ revisions?: {
14366
+ at: string;
14367
+ steps: string[];
14368
+ kind: "plan" | "revise";
14369
+ reason?: string | undefined;
14370
+ dropped?: string[] | undefined;
14371
+ }[] | undefined;
14372
+ } | undefined;
14373
+ title?: string | undefined;
14374
+ approved?: Record<string, string> | undefined;
14375
+ requestId?: string | undefined;
14376
+ continues?: string | undefined;
14377
+ startedBy?: string | undefined;
14378
+ approvedAtStart?: boolean | undefined;
14379
+ endNotifiedAt?: string | undefined;
14380
+ wrap?: {
14381
+ channel: string;
14382
+ mode: "plan" | "linear";
14383
+ agentId: string;
14384
+ taskId?: string | undefined;
14385
+ } | undefined;
14386
+ }>>;
14387
+ createdAt: z.ZodString;
14388
+ updatedAt: z.ZodString;
14389
+ }, "strip", z.ZodTypeAny, {
14390
+ status: "failed" | "completed" | "running" | "canceled" | "paused";
14391
+ id: string;
14392
+ context: Record<string, Record<string, unknown>>;
14393
+ pending: string[];
14394
+ updatedAt: string;
14395
+ history: {
14396
+ at: string;
14397
+ status: "timeout" | "ok" | "failed" | "skipped" | "resumed" | "paused";
14398
+ idempotencyKey: string;
14399
+ nodeId: string;
14400
+ inputKeys: string[];
14401
+ output?: Record<string, unknown> | undefined;
14402
+ durationMs?: number | undefined;
14403
+ note?: string | undefined;
14404
+ startedAt?: string | undefined;
14405
+ }[];
14406
+ createdAt: string;
14407
+ workflowVersion: 2;
14408
+ workflowId: string;
14409
+ homeNode: string;
14410
+ joinCounters: Record<string, string[]>;
14411
+ entityRef: {
14412
+ id: string;
14413
+ backend: string;
14414
+ };
14415
+ parentRunId: string | null;
14416
+ parentNodeId: string | null;
14417
+ rootRunId: string | null;
14418
+ depth: number;
14419
+ meta?: {
14420
+ followUp: boolean;
14421
+ tags: string[];
14422
+ approvedAtStart: boolean;
14423
+ blocked?: {
14424
+ at: string;
14425
+ reason: string;
14426
+ nodeId: string;
14427
+ } | undefined;
14428
+ plan?: {
14429
+ steps: {
14430
+ id: string;
14431
+ title: string;
14432
+ }[];
14433
+ revisions: {
14434
+ at: string;
14435
+ steps: string[];
14436
+ kind: "plan" | "revise";
14437
+ dropped: string[];
14438
+ reason?: string | undefined;
14439
+ }[];
14440
+ current?: {
14441
+ id: string;
14442
+ startedAt: string;
14443
+ } | undefined;
14444
+ } | undefined;
14445
+ title?: string | undefined;
14446
+ approved?: Record<string, string> | undefined;
14447
+ requestId?: string | undefined;
14448
+ continues?: string | undefined;
14449
+ startedBy?: string | undefined;
14450
+ endNotifiedAt?: string | undefined;
14451
+ wrap?: {
14452
+ channel: string;
14453
+ mode: "plan" | "linear";
14454
+ agentId: string;
14455
+ taskId?: string | undefined;
14456
+ } | undefined;
14457
+ } | undefined;
14458
+ pausedAt?: {
14459
+ kind: "checkpoint";
14460
+ nodeId: string;
14461
+ checkpointName: string;
14462
+ resumeMatch: Record<string, unknown>;
14463
+ } | {
14464
+ kind: "subProcess";
14465
+ nodeId: string;
14466
+ childRunId: string;
14467
+ childWorkflowId: string;
14468
+ } | {
14469
+ match: Record<string, unknown>;
14470
+ kind: "signalWait";
14471
+ scope: "workflow" | "global";
14472
+ nodeId: string;
14473
+ signalName: string;
14474
+ } | {
14475
+ kind: "timerWait";
14476
+ nodeId: string;
14477
+ fireAt: string;
14478
+ } | {
14479
+ kind: "ownerDecision";
14480
+ cardId: string;
14481
+ nodeId: string;
14482
+ purpose: "start" | "send" | "ask";
14483
+ message?: {
14484
+ text: string;
14485
+ channel: string;
14486
+ chatId: string;
14487
+ to?: string | undefined;
14488
+ accountId?: string | undefined;
14489
+ } | undefined;
14490
+ } | {
14491
+ channel: string;
14492
+ chatId: string;
14493
+ kind: "replyWait";
14494
+ reminders: number;
14495
+ nodeId: string;
14496
+ deadline: string;
14497
+ maxReminders: number;
14498
+ from?: string | undefined;
14499
+ accountId?: string | undefined;
14500
+ nextRemindAt?: string | undefined;
14501
+ remindEveryMs?: number | undefined;
14502
+ reminds?: string | undefined;
14503
+ } | {
14504
+ kind: "agentStep";
14505
+ agentId: string;
14506
+ nudges: number;
14507
+ maxNudges: number;
14508
+ nodeId: string;
14509
+ stallMs: number;
14510
+ blocked?: string | undefined;
14511
+ nextNudgeAt?: string | undefined;
14512
+ } | {
14513
+ kind: "agentStop";
14514
+ agentId: string;
14515
+ nodeId: string;
14516
+ taskId?: string | undefined;
14517
+ } | undefined;
14518
+ eventRootId?: string | undefined;
14519
+ }, {
14520
+ status: "failed" | "completed" | "running" | "canceled" | "paused";
14521
+ id: string;
14522
+ updatedAt: string;
14523
+ createdAt: string;
14524
+ workflowVersion: 2;
14525
+ workflowId: string;
14526
+ homeNode: string;
14527
+ entityRef: {
14528
+ id: string;
14529
+ backend: string;
14530
+ };
14531
+ context?: Record<string, Record<string, unknown>> | undefined;
14532
+ pending?: string[] | undefined;
14533
+ history?: {
14534
+ at: string;
14535
+ status: "timeout" | "ok" | "failed" | "skipped" | "resumed" | "paused";
14536
+ idempotencyKey: string;
14537
+ nodeId: string;
14538
+ output?: Record<string, unknown> | undefined;
14539
+ durationMs?: number | undefined;
14540
+ note?: string | undefined;
14541
+ startedAt?: string | undefined;
14542
+ inputKeys?: string[] | undefined;
14543
+ }[] | undefined;
14544
+ meta?: {
14545
+ followUp?: boolean | undefined;
14546
+ tags?: string[] | undefined;
14547
+ blocked?: {
14548
+ at: string;
14549
+ reason: string;
14550
+ nodeId: string;
14551
+ } | undefined;
14552
+ plan?: {
14553
+ steps: {
14554
+ id: string;
14555
+ title: string;
14556
+ }[];
14557
+ current?: {
14558
+ id: string;
14559
+ startedAt: string;
14560
+ } | undefined;
14561
+ revisions?: {
14562
+ at: string;
14563
+ steps: string[];
14564
+ kind: "plan" | "revise";
14565
+ reason?: string | undefined;
14566
+ dropped?: string[] | undefined;
14567
+ }[] | undefined;
14568
+ } | undefined;
14569
+ title?: string | undefined;
14570
+ approved?: Record<string, string> | undefined;
14571
+ requestId?: string | undefined;
14572
+ continues?: string | undefined;
14573
+ startedBy?: string | undefined;
14574
+ approvedAtStart?: boolean | undefined;
14575
+ endNotifiedAt?: string | undefined;
14576
+ wrap?: {
14577
+ channel: string;
14578
+ mode: "plan" | "linear";
14579
+ agentId: string;
14580
+ taskId?: string | undefined;
14581
+ } | undefined;
14582
+ } | undefined;
14583
+ pausedAt?: {
14584
+ kind: "checkpoint";
14585
+ nodeId: string;
14586
+ checkpointName: string;
14587
+ resumeMatch?: Record<string, unknown> | undefined;
14588
+ } | {
14589
+ kind: "subProcess";
14590
+ nodeId: string;
14591
+ childRunId: string;
14592
+ childWorkflowId: string;
14593
+ } | {
14594
+ kind: "signalWait";
14595
+ nodeId: string;
14596
+ signalName: string;
14597
+ match?: Record<string, unknown> | undefined;
14598
+ scope?: "workflow" | "global" | undefined;
14599
+ } | {
14600
+ kind: "timerWait";
14601
+ nodeId: string;
14602
+ fireAt: string;
14603
+ } | {
14604
+ kind: "ownerDecision";
14605
+ cardId: string;
14606
+ nodeId: string;
14607
+ purpose: "start" | "send" | "ask";
14608
+ message?: {
14609
+ text: string;
14610
+ channel: string;
14611
+ chatId: string;
14612
+ to?: string | undefined;
14613
+ accountId?: string | undefined;
14614
+ } | undefined;
14615
+ } | {
14616
+ channel: string;
14617
+ chatId: string;
14618
+ kind: "replyWait";
14619
+ nodeId: string;
14620
+ deadline: string;
14621
+ from?: string | undefined;
14622
+ accountId?: string | undefined;
14623
+ reminders?: number | undefined;
14624
+ nextRemindAt?: string | undefined;
14625
+ remindEveryMs?: number | undefined;
14626
+ maxReminders?: number | undefined;
14627
+ reminds?: string | undefined;
14628
+ } | {
14629
+ kind: "agentStep";
14630
+ agentId: string;
14631
+ nodeId: string;
14632
+ stallMs: number;
14633
+ blocked?: string | undefined;
14634
+ nudges?: number | undefined;
14635
+ maxNudges?: number | undefined;
14636
+ nextNudgeAt?: string | undefined;
14637
+ } | {
14638
+ kind: "agentStop";
14639
+ agentId: string;
14640
+ nodeId: string;
14641
+ taskId?: string | undefined;
14642
+ } | undefined;
14643
+ joinCounters?: Record<string, string[]> | undefined;
14644
+ parentRunId?: string | null | undefined;
14645
+ parentNodeId?: string | null | undefined;
14646
+ rootRunId?: string | null | undefined;
14647
+ depth?: number | undefined;
14648
+ eventRootId?: string | undefined;
14649
+ }>;
14650
+ type WorkflowRun = z.infer<typeof workflowRunSchema>;
14651
+
14652
+ interface RunStoreOptions {
14653
+ baseDir?: string;
14654
+ /** This daemon's mesh peer id. Stamped as `homeNode` on run creation so
14655
+ * later code can verify ownership before mutating. */
14656
+ nodeId: string;
14657
+ }
14658
+ declare class RunStore {
14659
+ readonly baseDir: string;
14660
+ readonly runsDir: string;
14661
+ readonly indexDir: string;
14662
+ /** Task runs (#883): kept out of runsDir. */
14663
+ readonly tasksDir: string;
14664
+ readonly nodeId: string;
14665
+ constructor(opts: RunStoreOptions);
14666
+ /** Where a run's file is: its folder by workflow id when known, else
14667
+ * whichever folder holds it. */
14668
+ private runPath;
14669
+ private indexPath;
14670
+ /** Create a new run. Seeds the initial pending queue (typically the
14671
+ * trigger node's immediate successors) and writes an entity-index entry
14672
+ * so future events for the same entity land on this home node. */
14673
+ create(args: {
14674
+ workflowId: string;
14675
+ initialPending: string[];
14676
+ entityRef: EntityRef;
14677
+ initialContext?: Record<string, Record<string, unknown>>;
14678
+ /** Optional parent-run linkage for sub-process children. */
14679
+ parentRunId?: string | null;
14680
+ parentNodeId?: string | null;
14681
+ rootRunId?: string | null;
14682
+ depth?: number;
14683
+ /** Defaults to the current event root, if any. */
14684
+ eventRootId?: string;
14685
+ /** Follow-up runs (#788): title, tags, who started it. */
14686
+ meta?: RunMeta;
14687
+ /** A run id chosen before the run exists (#858: the agent is told it
14688
+ * before its turn starts). Default: a fresh UUID. */
14689
+ id?: string;
14690
+ }): WorkflowRun;
14691
+ /** Read the latest snapshot of a run by replaying the jsonl log. */
14692
+ get(runId: string): WorkflowRun | null;
14693
+ private readRun;
14694
+ /** Look up the active run id for an entity, if any. */
14695
+ getActiveByEntity(entity: EntityRef): string | null;
14696
+ /** Which node owns a given entity (null if unclaimed). Used by the
14697
+ * dispatcher to decide whether to process locally or forward via mesh. */
14698
+ getHomeNodeByEntity(entity: EntityRef): string | null;
14699
+ /** Record a single node's execution. Appends an `exec` line and returns
14700
+ * the updated run snapshot. Idempotent: if an entry with the same
14701
+ * idempotencyKey already exists, the call is a no-op. */
14702
+ recordExecution(args: {
14703
+ runId: string;
14704
+ entry: NodeExecutionEntry;
14705
+ nextPending: string[];
14706
+ status?: RunStatus;
14707
+ pausedAt?: PausedAt | null;
14708
+ /** Optional updated context snapshot. When provided, replaces the run's
14709
+ * context wholesale (used when a node's output bundle lands). When
14710
+ * omitted, context is carried forward unchanged. */
14711
+ context?: Record<string, Record<string, unknown>>;
14712
+ /** Optional updated join-counter map. Undefined = carry forward. */
14713
+ joinCounters?: Record<string, string[]>;
14714
+ }): WorkflowRun | null;
14715
+ /** Mutate status without adding a history entry — used for
14716
+ * pause / resume / cancel commands from the CLI or dashboard. */
14717
+ setStatus(runId: string, status: RunStatus): WorkflowRun | null;
14718
+ /** Merge fields into a run's meta (#788). Appends a snapshot, like
14719
+ * setStatus; history and context are carried over as they are. */
14720
+ setMeta(runId: string, patch: Partial<RunMeta>): WorkflowRun | null;
14721
+ /** Merge into a run's meta and replace its pending queue (#858: a plan
14722
+ * written or changed mid-run). Appends a snapshot; history is kept. */
14723
+ patch(runId: string, patch: {
14724
+ meta?: Partial<RunMeta>;
14725
+ pending?: string[];
14726
+ }): WorkflowRun | null;
14727
+ /** Remove a run and its entity index entry, as if it never ran (#858: a
14728
+ * plain question exempted from workflows.required). */
14729
+ discard(runId: string): boolean;
14730
+ /** List runs, newest first. Task runs (#883) are left out unless
14731
+ * `tasks` says otherwise; `workflowId: "task"` lists only them. A run
14732
+ * file last written before `since` (ms) is skipped unread: a run starts
14733
+ * before its file's last write. */
14734
+ list(opts?: {
14735
+ workflowId?: string;
14736
+ limit?: number;
14737
+ tasks?: "exclude" | "include" | "only";
14738
+ since?: number;
14739
+ }): WorkflowRun[];
14740
+ /** Task runs still open (#883): their entity index entry is kept until
14741
+ * they end, so this reads the open ones only, however many have ended.
14742
+ * An entry whose run is gone is removed. */
14743
+ openTaskRunIds(): string[];
14744
+ /** Retention for task runs (#883): remove ended task runs last written
14745
+ * more than `maxDays` ago. Only old files are read; open runs stay.
14746
+ * Returns how many were removed. */
14747
+ pruneTaskRuns(maxDays: number): number;
14748
+ /** Move task runs written to _runs before they had a folder of their own
14749
+ * (0.133.0) into _tasks. Once: a marker file records it is done. */
14750
+ moveTaskRuns(): number;
14751
+ /** Retention: keep at most `maxRuns` completed/failed/canceled runs
14752
+ * younger than `maxDays`. Running/paused runs are never pruned. */
14753
+ prune(policy: {
14754
+ maxRuns: number;
14755
+ maxDays: number;
14756
+ }): number;
14757
+ private appendSnapshot;
14758
+ private writeIndex;
14759
+ private clearIndex;
14760
+ }
14761
+
13251
14762
  interface RunningTask {
13252
14763
  /** Unique id for this execution (timestamp-based). */
13253
14764
  id: string;
@@ -13272,6 +14783,15 @@ interface RunningTask {
13272
14783
  intentPath?: string[];
13273
14784
  /** Step autonomy the turn runs at (report | propose | act). Unset = act. */
13274
14785
  autonomy?: AgentTask["autonomy"];
14786
+ /** The workflow run this turn belongs to (#858): a step of a run, or
14787
+ * the run a task is wrapped in under workflows.required. `step` and
14788
+ * `title` are filled in when the agent list is read. */
14789
+ workflow?: {
14790
+ runId: string;
14791
+ workflowId?: string;
14792
+ step?: string;
14793
+ title?: string;
14794
+ };
13275
14795
  }
13276
14796
  type TaskOutputSubscriber = (chunk: string) => void;
13277
14797
  /** Persisted record of a finished task, written to .agentx/task-history. */
@@ -13340,6 +14860,9 @@ declare class AgentRegistry {
13340
14860
  * its `action.send` / `agent` nodes. Duck-typed to avoid a circular import
13341
14861
  * on WorkflowDispatcher. */
13342
14862
  private workflowAutoRunner?;
14863
+ /** Where wrapped tasks keep their run (#858). Wired by the daemon with
14864
+ * the workflow engine's run store; unset means no wrapping. */
14865
+ private workflowRuns?;
13343
14866
  private messageQueue;
13344
14867
  /**
13345
14868
  * Voice chats a waiting question has claimed between its wait ending and
@@ -13405,6 +14928,7 @@ declare class AgentRegistry {
13405
14928
  /** Wire the workflow auto-runner — see field doc above. Daemon calls this
13406
14929
  * after WorkflowDispatcher boot. Pass undefined to detach (e.g. during
13407
14930
  * reload). */
14931
+ setWorkflowRunStore(runs: RunStore | undefined): void;
13408
14932
  setWorkflowAutoRunner(runner: NonNullable<AgentRegistry["workflowAutoRunner"]> | undefined): void;
13409
14933
  /** Hot-swap the provider map. Daemon reload calls this after agentx.json
13410
14934
  * changes — the next task that executes will resolve credentials through
@@ -13418,6 +14942,9 @@ declare class AgentRegistry {
13418
14942
  * execute-time for landscape + session policies, so next-task semantics
13419
14943
  * match setProviders. */
13420
14944
  setConfig(next: DaemonConfig): void;
14945
+ /** Swap the workflows block on a config reload (#858): matching,
14946
+ * follow-up and required settings are read per turn. */
14947
+ setWorkflows(workflows: DaemonConfig["workflows"]): void;
13421
14948
  /** Swap the people list on a config reload (#384). Turns read it when
13422
14949
  * they start, so the next turn is stamped from the new list. */
13423
14950
  setPeople(people: DaemonConfig["people"]): void;
@@ -13555,6 +15082,9 @@ declare class AgentRegistry {
13555
15082
  };
13556
15083
  hourlyTasks?: number[];
13557
15084
  }>;
15085
+ /** Running tasks with the workflow run each belongs to and the step it
15086
+ * is on (#858), read from the run store; the stored list is not touched. */
15087
+ private withWorkflowSteps;
13558
15088
  /**
13559
15089
  * Write a finished task record to disk under .agentx/task-history/<agent>/<yyyy-mm-dd>/.
13560
15090
  * Side-effects only — call sites should treat failure as best-effort.
@@ -13617,6 +15147,7 @@ declare class AgentRegistry {
13617
15147
  taskId: string;
13618
15148
  context: NonNullable<AgentTask["context"]>;
13619
15149
  autonomy?: AgentTask["autonomy"];
15150
+ workflowRunId?: string;
13620
15151
  } | null;
13621
15152
  /** Whether every slot of `agentId` is taken, and by which runs. Lets a
13622
15153
  * synchronous delegation refuse at once when the only slot is held by