botmux 2.33.0 → 2.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/README.en.md +12 -1
  2. package/README.md +45 -1
  3. package/dist/adapters/cli/claude-code.d.ts.map +1 -1
  4. package/dist/adapters/cli/claude-code.js +11 -0
  5. package/dist/adapters/cli/claude-code.js.map +1 -1
  6. package/dist/cli/bots-list-output.d.ts +21 -0
  7. package/dist/cli/bots-list-output.d.ts.map +1 -0
  8. package/dist/cli/bots-list-output.js +23 -0
  9. package/dist/cli/bots-list-output.js.map +1 -0
  10. package/dist/cli/workflow.d.ts +13 -0
  11. package/dist/cli/workflow.d.ts.map +1 -0
  12. package/dist/cli/workflow.js +781 -0
  13. package/dist/cli/workflow.js.map +1 -0
  14. package/dist/cli.js +69 -14
  15. package/dist/cli.js.map +1 -1
  16. package/dist/core/command-handler.d.ts.map +1 -1
  17. package/dist/core/command-handler.js +211 -4
  18. package/dist/core/command-handler.js.map +1 -1
  19. package/dist/core/session-manager.d.ts +6 -1
  20. package/dist/core/session-manager.d.ts.map +1 -1
  21. package/dist/core/session-manager.js +22 -12
  22. package/dist/core/session-manager.js.map +1 -1
  23. package/dist/core/worker-pool.d.ts +13 -0
  24. package/dist/core/worker-pool.d.ts.map +1 -1
  25. package/dist/core/worker-pool.js +100 -6
  26. package/dist/core/worker-pool.js.map +1 -1
  27. package/dist/daemon.d.ts +3 -0
  28. package/dist/daemon.d.ts.map +1 -1
  29. package/dist/daemon.js +884 -3
  30. package/dist/daemon.js.map +1 -1
  31. package/dist/dashboard/auth.d.ts +36 -0
  32. package/dist/dashboard/auth.d.ts.map +1 -1
  33. package/dist/dashboard/auth.js +22 -0
  34. package/dist/dashboard/auth.js.map +1 -1
  35. package/dist/dashboard/web/app.js +20 -1
  36. package/dist/dashboard/web/app.js.map +1 -1
  37. package/dist/dashboard/web/i18n.d.ts.map +1 -1
  38. package/dist/dashboard/web/i18n.js +356 -0
  39. package/dist/dashboard/web/i18n.js.map +1 -1
  40. package/dist/dashboard/web/workflow-catalog.d.ts +2 -0
  41. package/dist/dashboard/web/workflow-catalog.d.ts.map +1 -0
  42. package/dist/dashboard/web/workflow-catalog.js +323 -0
  43. package/dist/dashboard/web/workflow-catalog.js.map +1 -0
  44. package/dist/dashboard/web/workflows.d.ts +2 -0
  45. package/dist/dashboard/web/workflows.d.ts.map +1 -0
  46. package/dist/dashboard/web/workflows.js +1618 -0
  47. package/dist/dashboard/web/workflows.js.map +1 -0
  48. package/dist/dashboard/workflow-api.d.ts +23 -0
  49. package/dist/dashboard/workflow-api.d.ts.map +1 -0
  50. package/dist/dashboard/workflow-api.js +463 -0
  51. package/dist/dashboard/workflow-api.js.map +1 -0
  52. package/dist/dashboard-web/app.js +494 -199
  53. package/dist/dashboard-web/index.html +1 -0
  54. package/dist/dashboard-web/style.css +160 -6
  55. package/dist/dashboard-web/terminal-replay.html +227 -0
  56. package/dist/dashboard.js +29 -12
  57. package/dist/dashboard.js.map +1 -1
  58. package/dist/i18n/en.d.ts.map +1 -1
  59. package/dist/i18n/en.js +12 -0
  60. package/dist/i18n/en.js.map +1 -1
  61. package/dist/i18n/zh.d.ts.map +1 -1
  62. package/dist/i18n/zh.js +12 -0
  63. package/dist/i18n/zh.js.map +1 -1
  64. package/dist/im/lark/card-handler.d.ts +3 -0
  65. package/dist/im/lark/card-handler.d.ts.map +1 -1
  66. package/dist/im/lark/card-handler.js +27 -1
  67. package/dist/im/lark/card-handler.js.map +1 -1
  68. package/dist/im/lark/client.d.ts +19 -2
  69. package/dist/im/lark/client.d.ts.map +1 -1
  70. package/dist/im/lark/client.js +21 -2
  71. package/dist/im/lark/client.js.map +1 -1
  72. package/dist/im/lark/workflow-card-handler.d.ts +50 -0
  73. package/dist/im/lark/workflow-card-handler.d.ts.map +1 -0
  74. package/dist/im/lark/workflow-card-handler.js +152 -0
  75. package/dist/im/lark/workflow-card-handler.js.map +1 -0
  76. package/dist/im/lark/workflow-cards.d.ts +46 -0
  77. package/dist/im/lark/workflow-cards.d.ts.map +1 -0
  78. package/dist/im/lark/workflow-cards.js +226 -0
  79. package/dist/im/lark/workflow-cards.js.map +1 -0
  80. package/dist/im/lark/workflow-progress-card.d.ts +76 -0
  81. package/dist/im/lark/workflow-progress-card.d.ts.map +1 -0
  82. package/dist/im/lark/workflow-progress-card.js +279 -0
  83. package/dist/im/lark/workflow-progress-card.js.map +1 -0
  84. package/dist/im/lark/workflow-slash-command.d.ts +92 -0
  85. package/dist/im/lark/workflow-slash-command.d.ts.map +1 -0
  86. package/dist/im/lark/workflow-slash-command.js +185 -0
  87. package/dist/im/lark/workflow-slash-command.js.map +1 -0
  88. package/dist/services/group-creator.d.ts.map +1 -1
  89. package/dist/services/group-creator.js +17 -4
  90. package/dist/services/group-creator.js.map +1 -1
  91. package/dist/services/groups-store.d.ts +11 -0
  92. package/dist/services/groups-store.d.ts.map +1 -1
  93. package/dist/services/groups-store.js +26 -0
  94. package/dist/services/groups-store.js.map +1 -1
  95. package/dist/services/jsonl-cursor.d.ts +12 -0
  96. package/dist/services/jsonl-cursor.d.ts.map +1 -0
  97. package/dist/services/jsonl-cursor.js +45 -0
  98. package/dist/services/jsonl-cursor.js.map +1 -0
  99. package/dist/services/schedule-store.d.ts +35 -0
  100. package/dist/services/schedule-store.d.ts.map +1 -1
  101. package/dist/services/schedule-store.js +108 -1
  102. package/dist/services/schedule-store.js.map +1 -1
  103. package/dist/skills/definitions.d.ts.map +1 -1
  104. package/dist/skills/definitions.js +399 -0
  105. package/dist/skills/definitions.js.map +1 -1
  106. package/dist/types.d.ts +4 -0
  107. package/dist/types.d.ts.map +1 -1
  108. package/dist/utils/cli-usage-limit.d.ts.map +1 -1
  109. package/dist/utils/cli-usage-limit.js +4 -0
  110. package/dist/utils/cli-usage-limit.js.map +1 -1
  111. package/dist/worker.js +118 -14
  112. package/dist/worker.js.map +1 -1
  113. package/dist/workflows/attempt-resume.d.ts +114 -0
  114. package/dist/workflows/attempt-resume.d.ts.map +1 -0
  115. package/dist/workflows/attempt-resume.js +385 -0
  116. package/dist/workflows/attempt-resume.js.map +1 -0
  117. package/dist/workflows/attempt-terminal.d.ts +21 -0
  118. package/dist/workflows/attempt-terminal.d.ts.map +1 -0
  119. package/dist/workflows/attempt-terminal.js +7 -0
  120. package/dist/workflows/attempt-terminal.js.map +1 -0
  121. package/dist/workflows/blob.d.ts +27 -0
  122. package/dist/workflows/blob.d.ts.map +1 -0
  123. package/dist/workflows/blob.js +39 -0
  124. package/dist/workflows/blob.js.map +1 -0
  125. package/dist/workflows/cancel-run.d.ts +45 -0
  126. package/dist/workflows/cancel-run.d.ts.map +1 -0
  127. package/dist/workflows/cancel-run.js +99 -0
  128. package/dist/workflows/cancel-run.js.map +1 -0
  129. package/dist/workflows/cancel.d.ts +111 -0
  130. package/dist/workflows/cancel.d.ts.map +1 -0
  131. package/dist/workflows/cancel.js +120 -0
  132. package/dist/workflows/cancel.js.map +1 -0
  133. package/dist/workflows/catalog.d.ts +60 -0
  134. package/dist/workflows/catalog.d.ts.map +1 -0
  135. package/dist/workflows/catalog.js +119 -0
  136. package/dist/workflows/catalog.js.map +1 -0
  137. package/dist/workflows/cold-attach.d.ts +30 -0
  138. package/dist/workflows/cold-attach.d.ts.map +1 -0
  139. package/dist/workflows/cold-attach.js +40 -0
  140. package/dist/workflows/cold-attach.js.map +1 -0
  141. package/dist/workflows/cold-scan.d.ts +21 -0
  142. package/dist/workflows/cold-scan.d.ts.map +1 -0
  143. package/dist/workflows/cold-scan.js +70 -0
  144. package/dist/workflows/cold-scan.js.map +1 -0
  145. package/dist/workflows/daemon-spawn.d.ts +117 -0
  146. package/dist/workflows/daemon-spawn.d.ts.map +1 -0
  147. package/dist/workflows/daemon-spawn.js +551 -0
  148. package/dist/workflows/daemon-spawn.js.map +1 -0
  149. package/dist/workflows/definition.d.ts +1309 -0
  150. package/dist/workflows/definition.d.ts.map +1 -0
  151. package/dist/workflows/definition.js +334 -0
  152. package/dist/workflows/definition.js.map +1 -0
  153. package/dist/workflows/effect-input.d.ts +4 -0
  154. package/dist/workflows/effect-input.d.ts.map +1 -0
  155. package/dist/workflows/effect-input.js +18 -0
  156. package/dist/workflows/effect-input.js.map +1 -0
  157. package/dist/workflows/events/append.d.ts +77 -0
  158. package/dist/workflows/events/append.d.ts.map +1 -0
  159. package/dist/workflows/events/append.js +214 -0
  160. package/dist/workflows/events/append.js.map +1 -0
  161. package/dist/workflows/events/idempotency.d.ts +77 -0
  162. package/dist/workflows/events/idempotency.d.ts.map +1 -0
  163. package/dist/workflows/events/idempotency.js +116 -0
  164. package/dist/workflows/events/idempotency.js.map +1 -0
  165. package/dist/workflows/events/index.d.ts +7 -0
  166. package/dist/workflows/events/index.d.ts.map +1 -0
  167. package/dist/workflows/events/index.js +7 -0
  168. package/dist/workflows/events/index.js.map +1 -0
  169. package/dist/workflows/events/payloads.d.ts +917 -0
  170. package/dist/workflows/events/payloads.d.ts.map +1 -0
  171. package/dist/workflows/events/payloads.js +337 -0
  172. package/dist/workflows/events/payloads.js.map +1 -0
  173. package/dist/workflows/events/replay.d.ts +238 -0
  174. package/dist/workflows/events/replay.d.ts.map +1 -0
  175. package/dist/workflows/events/replay.js +608 -0
  176. package/dist/workflows/events/replay.js.map +1 -0
  177. package/dist/workflows/events/schema.d.ts +5242 -0
  178. package/dist/workflows/events/schema.d.ts.map +1 -0
  179. package/dist/workflows/events/schema.js +295 -0
  180. package/dist/workflows/events/schema.js.map +1 -0
  181. package/dist/workflows/events/types.d.ts +34 -0
  182. package/dist/workflows/events/types.d.ts.map +1 -0
  183. package/dist/workflows/events/types.js +2 -0
  184. package/dist/workflows/events/types.js.map +1 -0
  185. package/dist/workflows/fanout.d.ts +36 -0
  186. package/dist/workflows/fanout.d.ts.map +1 -0
  187. package/dist/workflows/fanout.js +114 -0
  188. package/dist/workflows/fanout.js.map +1 -0
  189. package/dist/workflows/hostExecutors/botmux-schedule.d.ts +41 -0
  190. package/dist/workflows/hostExecutors/botmux-schedule.d.ts.map +1 -0
  191. package/dist/workflows/hostExecutors/botmux-schedule.js +121 -0
  192. package/dist/workflows/hostExecutors/botmux-schedule.js.map +1 -0
  193. package/dist/workflows/hostExecutors/feishu-im.d.ts +12 -0
  194. package/dist/workflows/hostExecutors/feishu-im.d.ts.map +1 -0
  195. package/dist/workflows/hostExecutors/feishu-im.js +49 -0
  196. package/dist/workflows/hostExecutors/feishu-im.js.map +1 -0
  197. package/dist/workflows/hostExecutors/feishu-reply.d.ts +24 -0
  198. package/dist/workflows/hostExecutors/feishu-reply.d.ts.map +1 -0
  199. package/dist/workflows/hostExecutors/feishu-reply.js +88 -0
  200. package/dist/workflows/hostExecutors/feishu-reply.js.map +1 -0
  201. package/dist/workflows/hostExecutors/feishu-send.d.ts +23 -0
  202. package/dist/workflows/hostExecutors/feishu-send.d.ts.map +1 -0
  203. package/dist/workflows/hostExecutors/feishu-send.js +124 -0
  204. package/dist/workflows/hostExecutors/feishu-send.js.map +1 -0
  205. package/dist/workflows/hostExecutors/index.d.ts +8 -0
  206. package/dist/workflows/hostExecutors/index.d.ts.map +1 -0
  207. package/dist/workflows/hostExecutors/index.js +8 -0
  208. package/dist/workflows/hostExecutors/index.js.map +1 -0
  209. package/dist/workflows/hostExecutors/protocol.d.ts +42 -0
  210. package/dist/workflows/hostExecutors/protocol.d.ts.map +1 -0
  211. package/dist/workflows/hostExecutors/protocol.js +181 -0
  212. package/dist/workflows/hostExecutors/protocol.js.map +1 -0
  213. package/dist/workflows/hostExecutors/registry.d.ts +10 -0
  214. package/dist/workflows/hostExecutors/registry.d.ts.map +1 -0
  215. package/dist/workflows/hostExecutors/registry.js +36 -0
  216. package/dist/workflows/hostExecutors/registry.js.map +1 -0
  217. package/dist/workflows/hostExecutors/types.d.ts +78 -0
  218. package/dist/workflows/hostExecutors/types.d.ts.map +1 -0
  219. package/dist/workflows/hostExecutors/types.js +2 -0
  220. package/dist/workflows/hostExecutors/types.js.map +1 -0
  221. package/dist/workflows/loader.d.ts +16 -0
  222. package/dist/workflows/loader.d.ts.map +1 -0
  223. package/dist/workflows/loader.js +56 -0
  224. package/dist/workflows/loader.js.map +1 -0
  225. package/dist/workflows/loop.d.ts +50 -0
  226. package/dist/workflows/loop.d.ts.map +1 -0
  227. package/dist/workflows/loop.js +350 -0
  228. package/dist/workflows/loop.js.map +1 -0
  229. package/dist/workflows/ops-projection.d.ts +168 -0
  230. package/dist/workflows/ops-projection.d.ts.map +1 -0
  231. package/dist/workflows/ops-projection.js +707 -0
  232. package/dist/workflows/ops-projection.js.map +1 -0
  233. package/dist/workflows/orchestrator.d.ts +107 -0
  234. package/dist/workflows/orchestrator.d.ts.map +1 -0
  235. package/dist/workflows/orchestrator.js +197 -0
  236. package/dist/workflows/orchestrator.js.map +1 -0
  237. package/dist/workflows/output-binding.d.ts +70 -0
  238. package/dist/workflows/output-binding.d.ts.map +1 -0
  239. package/dist/workflows/output-binding.js +265 -0
  240. package/dist/workflows/output-binding.js.map +1 -0
  241. package/dist/workflows/params.d.ts +61 -0
  242. package/dist/workflows/params.d.ts.map +1 -0
  243. package/dist/workflows/params.js +195 -0
  244. package/dist/workflows/params.js.map +1 -0
  245. package/dist/workflows/resume.d.ts +263 -0
  246. package/dist/workflows/resume.d.ts.map +1 -0
  247. package/dist/workflows/resume.js +808 -0
  248. package/dist/workflows/resume.js.map +1 -0
  249. package/dist/workflows/run-id.d.ts +2 -0
  250. package/dist/workflows/run-id.d.ts.map +1 -0
  251. package/dist/workflows/run-id.js +7 -0
  252. package/dist/workflows/run-id.js.map +1 -0
  253. package/dist/workflows/run-init.d.ts +48 -0
  254. package/dist/workflows/run-init.d.ts.map +1 -0
  255. package/dist/workflows/run-init.js +99 -0
  256. package/dist/workflows/run-init.js.map +1 -0
  257. package/dist/workflows/runs-dir.d.ts +4 -0
  258. package/dist/workflows/runs-dir.d.ts.map +1 -0
  259. package/dist/workflows/runs-dir.js +15 -0
  260. package/dist/workflows/runs-dir.js.map +1 -0
  261. package/dist/workflows/runtime.d.ts +211 -0
  262. package/dist/workflows/runtime.d.ts.map +1 -0
  263. package/dist/workflows/runtime.js +594 -0
  264. package/dist/workflows/runtime.js.map +1 -0
  265. package/dist/workflows/spawn-bot.d.ts +165 -0
  266. package/dist/workflows/spawn-bot.d.ts.map +1 -0
  267. package/dist/workflows/spawn-bot.js +215 -0
  268. package/dist/workflows/spawn-bot.js.map +1 -0
  269. package/dist/workflows/system.d.ts +49 -0
  270. package/dist/workflows/system.d.ts.map +1 -0
  271. package/dist/workflows/system.js +48 -0
  272. package/dist/workflows/system.js.map +1 -0
  273. package/dist/workflows/trigger-run.d.ts +70 -0
  274. package/dist/workflows/trigger-run.d.ts.map +1 -0
  275. package/dist/workflows/trigger-run.js +88 -0
  276. package/dist/workflows/trigger-run.js.map +1 -0
  277. package/dist/workflows/wait.d.ts +120 -0
  278. package/dist/workflows/wait.d.ts.map +1 -0
  279. package/dist/workflows/wait.js +181 -0
  280. package/dist/workflows/wait.js.map +1 -0
  281. package/package.json +3 -3
@@ -0,0 +1,1309 @@
1
+ /**
2
+ * WorkflowDefinition — canonical JSON shape for v0 workflows
3
+ * (see /tmp/wf-ui-v0.md §3 for the spec).
4
+ *
5
+ * Two node types:
6
+ * - subagent — runtime spawns the bot's worker, feeds `prompt`,
7
+ * collects `output` JSON.
8
+ * - hostExecutor — runtime calls the executor registered by `executor`.
9
+ *
10
+ * The schema enforces shape; cross-field invariants (deps reachability,
11
+ * no cycles) are checked by `parseWorkflowDefinition`. The `revisionId`
12
+ * helper computes a content hash over canonical JSON so semantically
13
+ * equal definitions get identical ids regardless of key ordering.
14
+ */
15
+ import { z } from 'zod';
16
+ export declare const ParamDefSchema: z.ZodObject<{
17
+ type: z.ZodEnum<["string", "number", "boolean", "object", "array"]>;
18
+ format: z.ZodOptional<z.ZodString>;
19
+ required: z.ZodOptional<z.ZodBoolean>;
20
+ default: z.ZodOptional<z.ZodUnknown>;
21
+ description: z.ZodOptional<z.ZodString>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ type: "string" | "number" | "boolean" | "object" | "array";
24
+ default?: unknown;
25
+ format?: string | undefined;
26
+ required?: boolean | undefined;
27
+ description?: string | undefined;
28
+ }, {
29
+ type: "string" | "number" | "boolean" | "object" | "array";
30
+ default?: unknown;
31
+ format?: string | undefined;
32
+ required?: boolean | undefined;
33
+ description?: string | undefined;
34
+ }>;
35
+ export type ParamDef = z.infer<typeof ParamDefSchema>;
36
+ export declare const RetryPolicySchema: z.ZodObject<{
37
+ maxAttempts: z.ZodNumber;
38
+ backoff: z.ZodEnum<["fixed", "exponential"]>;
39
+ baseMs: z.ZodNumber;
40
+ factor: z.ZodOptional<z.ZodNumber>;
41
+ jitter: z.ZodOptional<z.ZodBoolean>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ baseMs: number;
44
+ maxAttempts: number;
45
+ backoff: "fixed" | "exponential";
46
+ factor?: number | undefined;
47
+ jitter?: boolean | undefined;
48
+ }, {
49
+ baseMs: number;
50
+ maxAttempts: number;
51
+ backoff: "fixed" | "exponential";
52
+ factor?: number | undefined;
53
+ jitter?: boolean | undefined;
54
+ }>;
55
+ export type RetryPolicy = z.infer<typeof RetryPolicySchema>;
56
+ /**
57
+ * Output binding — `{ "$ref": "<nodeId>.output.<path>" }` references the
58
+ * `output` of another node's most recent successful work activity.
59
+ *
60
+ * Hard constraints (all enforced at parse time):
61
+ * - Object MUST be exactly one key (`$ref`), strict — no extra fields.
62
+ * Half-parsed mixed objects are a footgun: callers might forget the
63
+ * `$ref` key and silently get a literal object instead of resolved data.
64
+ * - `$ref` must be a non-empty string; runtime `resolveRef` then enforces
65
+ * the `.output.` separator + path-segment safety (no `__proto__` etc).
66
+ */
67
+ export declare const OutputRefSpecSchema: z.ZodObject<{
68
+ $ref: z.ZodString;
69
+ }, "strict", z.ZodTypeAny, {
70
+ $ref: string;
71
+ }, {
72
+ $ref: string;
73
+ }>;
74
+ export type OutputRefSpec = z.infer<typeof OutputRefSpecSchema>;
75
+ /** A string field that may either be a literal or a single `$ref`. */
76
+ export declare const BoundStringSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
77
+ $ref: z.ZodString;
78
+ }, "strict", z.ZodTypeAny, {
79
+ $ref: string;
80
+ }, {
81
+ $ref: string;
82
+ }>]>;
83
+ export type BoundString = z.infer<typeof BoundStringSchema>;
84
+ /**
85
+ * Recursive JSON allowing `OutputRefSpec` to appear at any leaf or sub-tree.
86
+ *
87
+ * Refusal rule for non-strict `$ref`-bearing objects: an object that has a
88
+ * `$ref` key MUST be an exact strict `OutputRefSpec`. Mixing `$ref` with
89
+ * other keys is rejected at parse time to keep `$ref` a reserved form.
90
+ */
91
+ export declare const BoundJsonValueSchema: z.ZodType<unknown>;
92
+ export declare const HumanGateSchema: z.ZodObject<{
93
+ stage: z.ZodLiteral<"before">;
94
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
95
+ $ref: z.ZodString;
96
+ }, "strict", z.ZodTypeAny, {
97
+ $ref: string;
98
+ }, {
99
+ $ref: string;
100
+ }>]>;
101
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
102
+ deadlineMs: z.ZodOptional<z.ZodNumber>;
103
+ onTimeout: z.ZodOptional<z.ZodEnum<["fail", "success"]>>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ prompt: string | {
106
+ $ref: string;
107
+ };
108
+ stage: "before";
109
+ approvers?: string[] | undefined;
110
+ onTimeout?: "fail" | "success" | undefined;
111
+ deadlineMs?: number | undefined;
112
+ }, {
113
+ prompt: string | {
114
+ $ref: string;
115
+ };
116
+ stage: "before";
117
+ approvers?: string[] | undefined;
118
+ onTimeout?: "fail" | "success" | undefined;
119
+ deadlineMs?: number | undefined;
120
+ }>;
121
+ export type HumanGate = z.infer<typeof HumanGateSchema>;
122
+ export declare const OutputSchemaSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
123
+ export declare const SubagentNodeSchema: z.ZodObject<{
124
+ type: z.ZodLiteral<"subagent">;
125
+ bot: z.ZodString;
126
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
127
+ $ref: z.ZodString;
128
+ }, "strict", z.ZodTypeAny, {
129
+ $ref: string;
130
+ }, {
131
+ $ref: string;
132
+ }>]>;
133
+ workingDir: z.ZodOptional<z.ZodString>;
134
+ modelOverrides: z.ZodOptional<z.ZodObject<{
135
+ model: z.ZodOptional<z.ZodString>;
136
+ reasoningEffort: z.ZodOptional<z.ZodString>;
137
+ }, "strip", z.ZodTypeAny, {
138
+ model?: string | undefined;
139
+ reasoningEffort?: string | undefined;
140
+ }, {
141
+ model?: string | undefined;
142
+ reasoningEffort?: string | undefined;
143
+ }>>;
144
+ toolPolicy: z.ZodOptional<z.ZodObject<{
145
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
146
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ allow?: string[] | undefined;
149
+ deny?: string[] | undefined;
150
+ }, {
151
+ allow?: string[] | undefined;
152
+ deny?: string[] | undefined;
153
+ }>>;
154
+ description: z.ZodOptional<z.ZodString>;
155
+ depends: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
156
+ humanGate: z.ZodOptional<z.ZodObject<{
157
+ stage: z.ZodLiteral<"before">;
158
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
159
+ $ref: z.ZodString;
160
+ }, "strict", z.ZodTypeAny, {
161
+ $ref: string;
162
+ }, {
163
+ $ref: string;
164
+ }>]>;
165
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
166
+ deadlineMs: z.ZodOptional<z.ZodNumber>;
167
+ onTimeout: z.ZodOptional<z.ZodEnum<["fail", "success"]>>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ prompt: string | {
170
+ $ref: string;
171
+ };
172
+ stage: "before";
173
+ approvers?: string[] | undefined;
174
+ onTimeout?: "fail" | "success" | undefined;
175
+ deadlineMs?: number | undefined;
176
+ }, {
177
+ prompt: string | {
178
+ $ref: string;
179
+ };
180
+ stage: "before";
181
+ approvers?: string[] | undefined;
182
+ onTimeout?: "fail" | "success" | undefined;
183
+ deadlineMs?: number | undefined;
184
+ }>>;
185
+ retryPolicy: z.ZodOptional<z.ZodObject<{
186
+ maxAttempts: z.ZodNumber;
187
+ backoff: z.ZodEnum<["fixed", "exponential"]>;
188
+ baseMs: z.ZodNumber;
189
+ factor: z.ZodOptional<z.ZodNumber>;
190
+ jitter: z.ZodOptional<z.ZodBoolean>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ baseMs: number;
193
+ maxAttempts: number;
194
+ backoff: "fixed" | "exponential";
195
+ factor?: number | undefined;
196
+ jitter?: boolean | undefined;
197
+ }, {
198
+ baseMs: number;
199
+ maxAttempts: number;
200
+ backoff: "fixed" | "exponential";
201
+ factor?: number | undefined;
202
+ jitter?: boolean | undefined;
203
+ }>>;
204
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
205
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
206
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
207
+ /**
208
+ * Opt-in escape hatch for a side-effect hostExecutor node that *must* run
209
+ * without a humanGate (e.g. a system-internal cron tick, an explicitly
210
+ * batched send-all script). Default is unset / false → validator rejects
211
+ * ungated side-effect executors at parse time (`SIDE_EFFECT_EXECUTORS`).
212
+ *
213
+ * Setting this to `true` is the workflow author's audit-trail: "I know
214
+ * this node sends a message / writes to repo / schedules a cron with no
215
+ * human approval — accept the risk." Prefer `humanGate` whenever the
216
+ * intent is "let an operator confirm before this fires."
217
+ */
218
+ unsafeAllowUngated: z.ZodOptional<z.ZodBoolean>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ prompt: string | {
221
+ $ref: string;
222
+ };
223
+ type: "subagent";
224
+ bot: string;
225
+ workingDir?: string | undefined;
226
+ timeoutMs?: number | undefined;
227
+ maxOutputBytes?: number | undefined;
228
+ description?: string | undefined;
229
+ modelOverrides?: {
230
+ model?: string | undefined;
231
+ reasoningEffort?: string | undefined;
232
+ } | undefined;
233
+ toolPolicy?: {
234
+ allow?: string[] | undefined;
235
+ deny?: string[] | undefined;
236
+ } | undefined;
237
+ depends?: string[] | undefined;
238
+ humanGate?: {
239
+ prompt: string | {
240
+ $ref: string;
241
+ };
242
+ stage: "before";
243
+ approvers?: string[] | undefined;
244
+ onTimeout?: "fail" | "success" | undefined;
245
+ deadlineMs?: number | undefined;
246
+ } | undefined;
247
+ retryPolicy?: {
248
+ baseMs: number;
249
+ maxAttempts: number;
250
+ backoff: "fixed" | "exponential";
251
+ factor?: number | undefined;
252
+ jitter?: boolean | undefined;
253
+ } | undefined;
254
+ outputSchema?: Record<string, unknown> | undefined;
255
+ unsafeAllowUngated?: boolean | undefined;
256
+ }, {
257
+ prompt: string | {
258
+ $ref: string;
259
+ };
260
+ type: "subagent";
261
+ bot: string;
262
+ workingDir?: string | undefined;
263
+ timeoutMs?: number | undefined;
264
+ maxOutputBytes?: number | undefined;
265
+ description?: string | undefined;
266
+ modelOverrides?: {
267
+ model?: string | undefined;
268
+ reasoningEffort?: string | undefined;
269
+ } | undefined;
270
+ toolPolicy?: {
271
+ allow?: string[] | undefined;
272
+ deny?: string[] | undefined;
273
+ } | undefined;
274
+ depends?: string[] | undefined;
275
+ humanGate?: {
276
+ prompt: string | {
277
+ $ref: string;
278
+ };
279
+ stage: "before";
280
+ approvers?: string[] | undefined;
281
+ onTimeout?: "fail" | "success" | undefined;
282
+ deadlineMs?: number | undefined;
283
+ } | undefined;
284
+ retryPolicy?: {
285
+ baseMs: number;
286
+ maxAttempts: number;
287
+ backoff: "fixed" | "exponential";
288
+ factor?: number | undefined;
289
+ jitter?: boolean | undefined;
290
+ } | undefined;
291
+ outputSchema?: Record<string, unknown> | undefined;
292
+ unsafeAllowUngated?: boolean | undefined;
293
+ }>;
294
+ export type SubagentNode = z.infer<typeof SubagentNodeSchema>;
295
+ export declare const HostExecutorNodeSchema: z.ZodObject<{
296
+ type: z.ZodLiteral<"hostExecutor">;
297
+ executor: z.ZodString;
298
+ input: z.ZodType<unknown, z.ZodTypeDef, unknown>;
299
+ description: z.ZodOptional<z.ZodString>;
300
+ depends: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
301
+ humanGate: z.ZodOptional<z.ZodObject<{
302
+ stage: z.ZodLiteral<"before">;
303
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
304
+ $ref: z.ZodString;
305
+ }, "strict", z.ZodTypeAny, {
306
+ $ref: string;
307
+ }, {
308
+ $ref: string;
309
+ }>]>;
310
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
311
+ deadlineMs: z.ZodOptional<z.ZodNumber>;
312
+ onTimeout: z.ZodOptional<z.ZodEnum<["fail", "success"]>>;
313
+ }, "strip", z.ZodTypeAny, {
314
+ prompt: string | {
315
+ $ref: string;
316
+ };
317
+ stage: "before";
318
+ approvers?: string[] | undefined;
319
+ onTimeout?: "fail" | "success" | undefined;
320
+ deadlineMs?: number | undefined;
321
+ }, {
322
+ prompt: string | {
323
+ $ref: string;
324
+ };
325
+ stage: "before";
326
+ approvers?: string[] | undefined;
327
+ onTimeout?: "fail" | "success" | undefined;
328
+ deadlineMs?: number | undefined;
329
+ }>>;
330
+ retryPolicy: z.ZodOptional<z.ZodObject<{
331
+ maxAttempts: z.ZodNumber;
332
+ backoff: z.ZodEnum<["fixed", "exponential"]>;
333
+ baseMs: z.ZodNumber;
334
+ factor: z.ZodOptional<z.ZodNumber>;
335
+ jitter: z.ZodOptional<z.ZodBoolean>;
336
+ }, "strip", z.ZodTypeAny, {
337
+ baseMs: number;
338
+ maxAttempts: number;
339
+ backoff: "fixed" | "exponential";
340
+ factor?: number | undefined;
341
+ jitter?: boolean | undefined;
342
+ }, {
343
+ baseMs: number;
344
+ maxAttempts: number;
345
+ backoff: "fixed" | "exponential";
346
+ factor?: number | undefined;
347
+ jitter?: boolean | undefined;
348
+ }>>;
349
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
350
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
351
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
352
+ /**
353
+ * Opt-in escape hatch for a side-effect hostExecutor node that *must* run
354
+ * without a humanGate (e.g. a system-internal cron tick, an explicitly
355
+ * batched send-all script). Default is unset / false → validator rejects
356
+ * ungated side-effect executors at parse time (`SIDE_EFFECT_EXECUTORS`).
357
+ *
358
+ * Setting this to `true` is the workflow author's audit-trail: "I know
359
+ * this node sends a message / writes to repo / schedules a cron with no
360
+ * human approval — accept the risk." Prefer `humanGate` whenever the
361
+ * intent is "let an operator confirm before this fires."
362
+ */
363
+ unsafeAllowUngated: z.ZodOptional<z.ZodBoolean>;
364
+ }, "strip", z.ZodTypeAny, {
365
+ type: "hostExecutor";
366
+ executor: string;
367
+ input?: unknown;
368
+ timeoutMs?: number | undefined;
369
+ maxOutputBytes?: number | undefined;
370
+ description?: string | undefined;
371
+ depends?: string[] | undefined;
372
+ humanGate?: {
373
+ prompt: string | {
374
+ $ref: string;
375
+ };
376
+ stage: "before";
377
+ approvers?: string[] | undefined;
378
+ onTimeout?: "fail" | "success" | undefined;
379
+ deadlineMs?: number | undefined;
380
+ } | undefined;
381
+ retryPolicy?: {
382
+ baseMs: number;
383
+ maxAttempts: number;
384
+ backoff: "fixed" | "exponential";
385
+ factor?: number | undefined;
386
+ jitter?: boolean | undefined;
387
+ } | undefined;
388
+ outputSchema?: Record<string, unknown> | undefined;
389
+ unsafeAllowUngated?: boolean | undefined;
390
+ }, {
391
+ type: "hostExecutor";
392
+ executor: string;
393
+ input?: unknown;
394
+ timeoutMs?: number | undefined;
395
+ maxOutputBytes?: number | undefined;
396
+ description?: string | undefined;
397
+ depends?: string[] | undefined;
398
+ humanGate?: {
399
+ prompt: string | {
400
+ $ref: string;
401
+ };
402
+ stage: "before";
403
+ approvers?: string[] | undefined;
404
+ onTimeout?: "fail" | "success" | undefined;
405
+ deadlineMs?: number | undefined;
406
+ } | undefined;
407
+ retryPolicy?: {
408
+ baseMs: number;
409
+ maxAttempts: number;
410
+ backoff: "fixed" | "exponential";
411
+ factor?: number | undefined;
412
+ jitter?: boolean | undefined;
413
+ } | undefined;
414
+ outputSchema?: Record<string, unknown> | undefined;
415
+ unsafeAllowUngated?: boolean | undefined;
416
+ }>;
417
+ export type HostExecutorNode = z.infer<typeof HostExecutorNodeSchema>;
418
+ /**
419
+ * Executors that produce externally-visible side effects: sending a Feishu
420
+ * message, scheduling a botmux cron task, etc. Validator requires a
421
+ * `humanGate.stage='before'` on any node using one of these executors, or
422
+ * an explicit `unsafeAllowUngated: true` opt-in (see NodeBaseShape).
423
+ *
424
+ * Add new executors here as they're registered with the dispatch table —
425
+ * keep this list in lockstep with `runtime.ts`'s side-effect executor
426
+ * registrations. Read-only / pure-computation executors do NOT belong
427
+ * here; only ones whose execution is observable outside the workflow.
428
+ */
429
+ export declare const SIDE_EFFECT_EXECUTORS: ReadonlySet<string>;
430
+ export declare function isSideEffectExecutor(executor: string): boolean;
431
+ export declare const WorkflowNodeSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
432
+ type: z.ZodLiteral<"subagent">;
433
+ bot: z.ZodString;
434
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
435
+ $ref: z.ZodString;
436
+ }, "strict", z.ZodTypeAny, {
437
+ $ref: string;
438
+ }, {
439
+ $ref: string;
440
+ }>]>;
441
+ workingDir: z.ZodOptional<z.ZodString>;
442
+ modelOverrides: z.ZodOptional<z.ZodObject<{
443
+ model: z.ZodOptional<z.ZodString>;
444
+ reasoningEffort: z.ZodOptional<z.ZodString>;
445
+ }, "strip", z.ZodTypeAny, {
446
+ model?: string | undefined;
447
+ reasoningEffort?: string | undefined;
448
+ }, {
449
+ model?: string | undefined;
450
+ reasoningEffort?: string | undefined;
451
+ }>>;
452
+ toolPolicy: z.ZodOptional<z.ZodObject<{
453
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
454
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
455
+ }, "strip", z.ZodTypeAny, {
456
+ allow?: string[] | undefined;
457
+ deny?: string[] | undefined;
458
+ }, {
459
+ allow?: string[] | undefined;
460
+ deny?: string[] | undefined;
461
+ }>>;
462
+ description: z.ZodOptional<z.ZodString>;
463
+ depends: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
464
+ humanGate: z.ZodOptional<z.ZodObject<{
465
+ stage: z.ZodLiteral<"before">;
466
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
467
+ $ref: z.ZodString;
468
+ }, "strict", z.ZodTypeAny, {
469
+ $ref: string;
470
+ }, {
471
+ $ref: string;
472
+ }>]>;
473
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
474
+ deadlineMs: z.ZodOptional<z.ZodNumber>;
475
+ onTimeout: z.ZodOptional<z.ZodEnum<["fail", "success"]>>;
476
+ }, "strip", z.ZodTypeAny, {
477
+ prompt: string | {
478
+ $ref: string;
479
+ };
480
+ stage: "before";
481
+ approvers?: string[] | undefined;
482
+ onTimeout?: "fail" | "success" | undefined;
483
+ deadlineMs?: number | undefined;
484
+ }, {
485
+ prompt: string | {
486
+ $ref: string;
487
+ };
488
+ stage: "before";
489
+ approvers?: string[] | undefined;
490
+ onTimeout?: "fail" | "success" | undefined;
491
+ deadlineMs?: number | undefined;
492
+ }>>;
493
+ retryPolicy: z.ZodOptional<z.ZodObject<{
494
+ maxAttempts: z.ZodNumber;
495
+ backoff: z.ZodEnum<["fixed", "exponential"]>;
496
+ baseMs: z.ZodNumber;
497
+ factor: z.ZodOptional<z.ZodNumber>;
498
+ jitter: z.ZodOptional<z.ZodBoolean>;
499
+ }, "strip", z.ZodTypeAny, {
500
+ baseMs: number;
501
+ maxAttempts: number;
502
+ backoff: "fixed" | "exponential";
503
+ factor?: number | undefined;
504
+ jitter?: boolean | undefined;
505
+ }, {
506
+ baseMs: number;
507
+ maxAttempts: number;
508
+ backoff: "fixed" | "exponential";
509
+ factor?: number | undefined;
510
+ jitter?: boolean | undefined;
511
+ }>>;
512
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
513
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
514
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
515
+ /**
516
+ * Opt-in escape hatch for a side-effect hostExecutor node that *must* run
517
+ * without a humanGate (e.g. a system-internal cron tick, an explicitly
518
+ * batched send-all script). Default is unset / false → validator rejects
519
+ * ungated side-effect executors at parse time (`SIDE_EFFECT_EXECUTORS`).
520
+ *
521
+ * Setting this to `true` is the workflow author's audit-trail: "I know
522
+ * this node sends a message / writes to repo / schedules a cron with no
523
+ * human approval — accept the risk." Prefer `humanGate` whenever the
524
+ * intent is "let an operator confirm before this fires."
525
+ */
526
+ unsafeAllowUngated: z.ZodOptional<z.ZodBoolean>;
527
+ }, "strip", z.ZodTypeAny, {
528
+ prompt: string | {
529
+ $ref: string;
530
+ };
531
+ type: "subagent";
532
+ bot: string;
533
+ workingDir?: string | undefined;
534
+ timeoutMs?: number | undefined;
535
+ maxOutputBytes?: number | undefined;
536
+ description?: string | undefined;
537
+ modelOverrides?: {
538
+ model?: string | undefined;
539
+ reasoningEffort?: string | undefined;
540
+ } | undefined;
541
+ toolPolicy?: {
542
+ allow?: string[] | undefined;
543
+ deny?: string[] | undefined;
544
+ } | undefined;
545
+ depends?: string[] | undefined;
546
+ humanGate?: {
547
+ prompt: string | {
548
+ $ref: string;
549
+ };
550
+ stage: "before";
551
+ approvers?: string[] | undefined;
552
+ onTimeout?: "fail" | "success" | undefined;
553
+ deadlineMs?: number | undefined;
554
+ } | undefined;
555
+ retryPolicy?: {
556
+ baseMs: number;
557
+ maxAttempts: number;
558
+ backoff: "fixed" | "exponential";
559
+ factor?: number | undefined;
560
+ jitter?: boolean | undefined;
561
+ } | undefined;
562
+ outputSchema?: Record<string, unknown> | undefined;
563
+ unsafeAllowUngated?: boolean | undefined;
564
+ }, {
565
+ prompt: string | {
566
+ $ref: string;
567
+ };
568
+ type: "subagent";
569
+ bot: string;
570
+ workingDir?: string | undefined;
571
+ timeoutMs?: number | undefined;
572
+ maxOutputBytes?: number | undefined;
573
+ description?: string | undefined;
574
+ modelOverrides?: {
575
+ model?: string | undefined;
576
+ reasoningEffort?: string | undefined;
577
+ } | undefined;
578
+ toolPolicy?: {
579
+ allow?: string[] | undefined;
580
+ deny?: string[] | undefined;
581
+ } | undefined;
582
+ depends?: string[] | undefined;
583
+ humanGate?: {
584
+ prompt: string | {
585
+ $ref: string;
586
+ };
587
+ stage: "before";
588
+ approvers?: string[] | undefined;
589
+ onTimeout?: "fail" | "success" | undefined;
590
+ deadlineMs?: number | undefined;
591
+ } | undefined;
592
+ retryPolicy?: {
593
+ baseMs: number;
594
+ maxAttempts: number;
595
+ backoff: "fixed" | "exponential";
596
+ factor?: number | undefined;
597
+ jitter?: boolean | undefined;
598
+ } | undefined;
599
+ outputSchema?: Record<string, unknown> | undefined;
600
+ unsafeAllowUngated?: boolean | undefined;
601
+ }>, z.ZodObject<{
602
+ type: z.ZodLiteral<"hostExecutor">;
603
+ executor: z.ZodString;
604
+ input: z.ZodType<unknown, z.ZodTypeDef, unknown>;
605
+ description: z.ZodOptional<z.ZodString>;
606
+ depends: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
607
+ humanGate: z.ZodOptional<z.ZodObject<{
608
+ stage: z.ZodLiteral<"before">;
609
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
610
+ $ref: z.ZodString;
611
+ }, "strict", z.ZodTypeAny, {
612
+ $ref: string;
613
+ }, {
614
+ $ref: string;
615
+ }>]>;
616
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
617
+ deadlineMs: z.ZodOptional<z.ZodNumber>;
618
+ onTimeout: z.ZodOptional<z.ZodEnum<["fail", "success"]>>;
619
+ }, "strip", z.ZodTypeAny, {
620
+ prompt: string | {
621
+ $ref: string;
622
+ };
623
+ stage: "before";
624
+ approvers?: string[] | undefined;
625
+ onTimeout?: "fail" | "success" | undefined;
626
+ deadlineMs?: number | undefined;
627
+ }, {
628
+ prompt: string | {
629
+ $ref: string;
630
+ };
631
+ stage: "before";
632
+ approvers?: string[] | undefined;
633
+ onTimeout?: "fail" | "success" | undefined;
634
+ deadlineMs?: number | undefined;
635
+ }>>;
636
+ retryPolicy: z.ZodOptional<z.ZodObject<{
637
+ maxAttempts: z.ZodNumber;
638
+ backoff: z.ZodEnum<["fixed", "exponential"]>;
639
+ baseMs: z.ZodNumber;
640
+ factor: z.ZodOptional<z.ZodNumber>;
641
+ jitter: z.ZodOptional<z.ZodBoolean>;
642
+ }, "strip", z.ZodTypeAny, {
643
+ baseMs: number;
644
+ maxAttempts: number;
645
+ backoff: "fixed" | "exponential";
646
+ factor?: number | undefined;
647
+ jitter?: boolean | undefined;
648
+ }, {
649
+ baseMs: number;
650
+ maxAttempts: number;
651
+ backoff: "fixed" | "exponential";
652
+ factor?: number | undefined;
653
+ jitter?: boolean | undefined;
654
+ }>>;
655
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
656
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
657
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
658
+ /**
659
+ * Opt-in escape hatch for a side-effect hostExecutor node that *must* run
660
+ * without a humanGate (e.g. a system-internal cron tick, an explicitly
661
+ * batched send-all script). Default is unset / false → validator rejects
662
+ * ungated side-effect executors at parse time (`SIDE_EFFECT_EXECUTORS`).
663
+ *
664
+ * Setting this to `true` is the workflow author's audit-trail: "I know
665
+ * this node sends a message / writes to repo / schedules a cron with no
666
+ * human approval — accept the risk." Prefer `humanGate` whenever the
667
+ * intent is "let an operator confirm before this fires."
668
+ */
669
+ unsafeAllowUngated: z.ZodOptional<z.ZodBoolean>;
670
+ }, "strip", z.ZodTypeAny, {
671
+ type: "hostExecutor";
672
+ executor: string;
673
+ input?: unknown;
674
+ timeoutMs?: number | undefined;
675
+ maxOutputBytes?: number | undefined;
676
+ description?: string | undefined;
677
+ depends?: string[] | undefined;
678
+ humanGate?: {
679
+ prompt: string | {
680
+ $ref: string;
681
+ };
682
+ stage: "before";
683
+ approvers?: string[] | undefined;
684
+ onTimeout?: "fail" | "success" | undefined;
685
+ deadlineMs?: number | undefined;
686
+ } | undefined;
687
+ retryPolicy?: {
688
+ baseMs: number;
689
+ maxAttempts: number;
690
+ backoff: "fixed" | "exponential";
691
+ factor?: number | undefined;
692
+ jitter?: boolean | undefined;
693
+ } | undefined;
694
+ outputSchema?: Record<string, unknown> | undefined;
695
+ unsafeAllowUngated?: boolean | undefined;
696
+ }, {
697
+ type: "hostExecutor";
698
+ executor: string;
699
+ input?: unknown;
700
+ timeoutMs?: number | undefined;
701
+ maxOutputBytes?: number | undefined;
702
+ description?: string | undefined;
703
+ depends?: string[] | undefined;
704
+ humanGate?: {
705
+ prompt: string | {
706
+ $ref: string;
707
+ };
708
+ stage: "before";
709
+ approvers?: string[] | undefined;
710
+ onTimeout?: "fail" | "success" | undefined;
711
+ deadlineMs?: number | undefined;
712
+ } | undefined;
713
+ retryPolicy?: {
714
+ baseMs: number;
715
+ maxAttempts: number;
716
+ backoff: "fixed" | "exponential";
717
+ factor?: number | undefined;
718
+ jitter?: boolean | undefined;
719
+ } | undefined;
720
+ outputSchema?: Record<string, unknown> | undefined;
721
+ unsafeAllowUngated?: boolean | undefined;
722
+ }>]>;
723
+ export type WorkflowNode = z.infer<typeof WorkflowNodeSchema>;
724
+ /**
725
+ * Node id constraint: safe path segment for use in activityId and the
726
+ * artifact sidecar path (UI doc §A: `runs/<runId>/attempts/<activityId>/...`).
727
+ * Disallow `/`, `..`, whitespace, etc. so a maliciously authored or
728
+ * imported workflow cannot escape the run directory.
729
+ */
730
+ export declare const NODE_ID_PATTERN: RegExp;
731
+ export declare const WorkflowDefinitionSchema: z.ZodObject<{
732
+ workflowId: z.ZodString;
733
+ version: z.ZodNumber;
734
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
735
+ type: z.ZodEnum<["string", "number", "boolean", "object", "array"]>;
736
+ format: z.ZodOptional<z.ZodString>;
737
+ required: z.ZodOptional<z.ZodBoolean>;
738
+ default: z.ZodOptional<z.ZodUnknown>;
739
+ description: z.ZodOptional<z.ZodString>;
740
+ }, "strip", z.ZodTypeAny, {
741
+ type: "string" | "number" | "boolean" | "object" | "array";
742
+ default?: unknown;
743
+ format?: string | undefined;
744
+ required?: boolean | undefined;
745
+ description?: string | undefined;
746
+ }, {
747
+ type: "string" | "number" | "boolean" | "object" | "array";
748
+ default?: unknown;
749
+ format?: string | undefined;
750
+ required?: boolean | undefined;
751
+ description?: string | undefined;
752
+ }>>>;
753
+ defaults: z.ZodOptional<z.ZodObject<{
754
+ retryPolicy: z.ZodOptional<z.ZodObject<{
755
+ maxAttempts: z.ZodNumber;
756
+ backoff: z.ZodEnum<["fixed", "exponential"]>;
757
+ baseMs: z.ZodNumber;
758
+ factor: z.ZodOptional<z.ZodNumber>;
759
+ jitter: z.ZodOptional<z.ZodBoolean>;
760
+ }, "strip", z.ZodTypeAny, {
761
+ baseMs: number;
762
+ maxAttempts: number;
763
+ backoff: "fixed" | "exponential";
764
+ factor?: number | undefined;
765
+ jitter?: boolean | undefined;
766
+ }, {
767
+ baseMs: number;
768
+ maxAttempts: number;
769
+ backoff: "fixed" | "exponential";
770
+ factor?: number | undefined;
771
+ jitter?: boolean | undefined;
772
+ }>>;
773
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
774
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
775
+ /**
776
+ * Cap on concurrent dispatch actions (dispatchGate + dispatchWork)
777
+ * within a single runLoop tick. v0.1.3 first-cut parallelism defaults
778
+ * to 4 — small enough that a wide fan-out won't immediately exhaust
779
+ * worker / OOM headroom, large enough that ~typical 2-3 branch DAGs
780
+ * fully parallelize. Set higher on workflows that want more throughput.
781
+ *
782
+ * Per-bot serialization is independent of this cap; same-bot siblings
783
+ * still get dispatched one-per-tick regardless of the limit.
784
+ */
785
+ maxConcurrency: z.ZodOptional<z.ZodNumber>;
786
+ }, "strip", z.ZodTypeAny, {
787
+ timeoutMs?: number | undefined;
788
+ maxOutputBytes?: number | undefined;
789
+ retryPolicy?: {
790
+ baseMs: number;
791
+ maxAttempts: number;
792
+ backoff: "fixed" | "exponential";
793
+ factor?: number | undefined;
794
+ jitter?: boolean | undefined;
795
+ } | undefined;
796
+ maxConcurrency?: number | undefined;
797
+ }, {
798
+ timeoutMs?: number | undefined;
799
+ maxOutputBytes?: number | undefined;
800
+ retryPolicy?: {
801
+ baseMs: number;
802
+ maxAttempts: number;
803
+ backoff: "fixed" | "exponential";
804
+ factor?: number | undefined;
805
+ jitter?: boolean | undefined;
806
+ } | undefined;
807
+ maxConcurrency?: number | undefined;
808
+ }>>;
809
+ nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
810
+ type: z.ZodLiteral<"subagent">;
811
+ bot: z.ZodString;
812
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
813
+ $ref: z.ZodString;
814
+ }, "strict", z.ZodTypeAny, {
815
+ $ref: string;
816
+ }, {
817
+ $ref: string;
818
+ }>]>;
819
+ workingDir: z.ZodOptional<z.ZodString>;
820
+ modelOverrides: z.ZodOptional<z.ZodObject<{
821
+ model: z.ZodOptional<z.ZodString>;
822
+ reasoningEffort: z.ZodOptional<z.ZodString>;
823
+ }, "strip", z.ZodTypeAny, {
824
+ model?: string | undefined;
825
+ reasoningEffort?: string | undefined;
826
+ }, {
827
+ model?: string | undefined;
828
+ reasoningEffort?: string | undefined;
829
+ }>>;
830
+ toolPolicy: z.ZodOptional<z.ZodObject<{
831
+ allow: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
832
+ deny: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
833
+ }, "strip", z.ZodTypeAny, {
834
+ allow?: string[] | undefined;
835
+ deny?: string[] | undefined;
836
+ }, {
837
+ allow?: string[] | undefined;
838
+ deny?: string[] | undefined;
839
+ }>>;
840
+ description: z.ZodOptional<z.ZodString>;
841
+ depends: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
842
+ humanGate: z.ZodOptional<z.ZodObject<{
843
+ stage: z.ZodLiteral<"before">;
844
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
845
+ $ref: z.ZodString;
846
+ }, "strict", z.ZodTypeAny, {
847
+ $ref: string;
848
+ }, {
849
+ $ref: string;
850
+ }>]>;
851
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
852
+ deadlineMs: z.ZodOptional<z.ZodNumber>;
853
+ onTimeout: z.ZodOptional<z.ZodEnum<["fail", "success"]>>;
854
+ }, "strip", z.ZodTypeAny, {
855
+ prompt: string | {
856
+ $ref: string;
857
+ };
858
+ stage: "before";
859
+ approvers?: string[] | undefined;
860
+ onTimeout?: "fail" | "success" | undefined;
861
+ deadlineMs?: number | undefined;
862
+ }, {
863
+ prompt: string | {
864
+ $ref: string;
865
+ };
866
+ stage: "before";
867
+ approvers?: string[] | undefined;
868
+ onTimeout?: "fail" | "success" | undefined;
869
+ deadlineMs?: number | undefined;
870
+ }>>;
871
+ retryPolicy: z.ZodOptional<z.ZodObject<{
872
+ maxAttempts: z.ZodNumber;
873
+ backoff: z.ZodEnum<["fixed", "exponential"]>;
874
+ baseMs: z.ZodNumber;
875
+ factor: z.ZodOptional<z.ZodNumber>;
876
+ jitter: z.ZodOptional<z.ZodBoolean>;
877
+ }, "strip", z.ZodTypeAny, {
878
+ baseMs: number;
879
+ maxAttempts: number;
880
+ backoff: "fixed" | "exponential";
881
+ factor?: number | undefined;
882
+ jitter?: boolean | undefined;
883
+ }, {
884
+ baseMs: number;
885
+ maxAttempts: number;
886
+ backoff: "fixed" | "exponential";
887
+ factor?: number | undefined;
888
+ jitter?: boolean | undefined;
889
+ }>>;
890
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
891
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
892
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
893
+ /**
894
+ * Opt-in escape hatch for a side-effect hostExecutor node that *must* run
895
+ * without a humanGate (e.g. a system-internal cron tick, an explicitly
896
+ * batched send-all script). Default is unset / false → validator rejects
897
+ * ungated side-effect executors at parse time (`SIDE_EFFECT_EXECUTORS`).
898
+ *
899
+ * Setting this to `true` is the workflow author's audit-trail: "I know
900
+ * this node sends a message / writes to repo / schedules a cron with no
901
+ * human approval — accept the risk." Prefer `humanGate` whenever the
902
+ * intent is "let an operator confirm before this fires."
903
+ */
904
+ unsafeAllowUngated: z.ZodOptional<z.ZodBoolean>;
905
+ }, "strip", z.ZodTypeAny, {
906
+ prompt: string | {
907
+ $ref: string;
908
+ };
909
+ type: "subagent";
910
+ bot: string;
911
+ workingDir?: string | undefined;
912
+ timeoutMs?: number | undefined;
913
+ maxOutputBytes?: number | undefined;
914
+ description?: string | undefined;
915
+ modelOverrides?: {
916
+ model?: string | undefined;
917
+ reasoningEffort?: string | undefined;
918
+ } | undefined;
919
+ toolPolicy?: {
920
+ allow?: string[] | undefined;
921
+ deny?: string[] | undefined;
922
+ } | undefined;
923
+ depends?: string[] | undefined;
924
+ humanGate?: {
925
+ prompt: string | {
926
+ $ref: string;
927
+ };
928
+ stage: "before";
929
+ approvers?: string[] | undefined;
930
+ onTimeout?: "fail" | "success" | undefined;
931
+ deadlineMs?: number | undefined;
932
+ } | undefined;
933
+ retryPolicy?: {
934
+ baseMs: number;
935
+ maxAttempts: number;
936
+ backoff: "fixed" | "exponential";
937
+ factor?: number | undefined;
938
+ jitter?: boolean | undefined;
939
+ } | undefined;
940
+ outputSchema?: Record<string, unknown> | undefined;
941
+ unsafeAllowUngated?: boolean | undefined;
942
+ }, {
943
+ prompt: string | {
944
+ $ref: string;
945
+ };
946
+ type: "subagent";
947
+ bot: string;
948
+ workingDir?: string | undefined;
949
+ timeoutMs?: number | undefined;
950
+ maxOutputBytes?: number | undefined;
951
+ description?: string | undefined;
952
+ modelOverrides?: {
953
+ model?: string | undefined;
954
+ reasoningEffort?: string | undefined;
955
+ } | undefined;
956
+ toolPolicy?: {
957
+ allow?: string[] | undefined;
958
+ deny?: string[] | undefined;
959
+ } | undefined;
960
+ depends?: string[] | undefined;
961
+ humanGate?: {
962
+ prompt: string | {
963
+ $ref: string;
964
+ };
965
+ stage: "before";
966
+ approvers?: string[] | undefined;
967
+ onTimeout?: "fail" | "success" | undefined;
968
+ deadlineMs?: number | undefined;
969
+ } | undefined;
970
+ retryPolicy?: {
971
+ baseMs: number;
972
+ maxAttempts: number;
973
+ backoff: "fixed" | "exponential";
974
+ factor?: number | undefined;
975
+ jitter?: boolean | undefined;
976
+ } | undefined;
977
+ outputSchema?: Record<string, unknown> | undefined;
978
+ unsafeAllowUngated?: boolean | undefined;
979
+ }>, z.ZodObject<{
980
+ type: z.ZodLiteral<"hostExecutor">;
981
+ executor: z.ZodString;
982
+ input: z.ZodType<unknown, z.ZodTypeDef, unknown>;
983
+ description: z.ZodOptional<z.ZodString>;
984
+ depends: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
985
+ humanGate: z.ZodOptional<z.ZodObject<{
986
+ stage: z.ZodLiteral<"before">;
987
+ prompt: z.ZodUnion<[z.ZodString, z.ZodObject<{
988
+ $ref: z.ZodString;
989
+ }, "strict", z.ZodTypeAny, {
990
+ $ref: string;
991
+ }, {
992
+ $ref: string;
993
+ }>]>;
994
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
995
+ deadlineMs: z.ZodOptional<z.ZodNumber>;
996
+ onTimeout: z.ZodOptional<z.ZodEnum<["fail", "success"]>>;
997
+ }, "strip", z.ZodTypeAny, {
998
+ prompt: string | {
999
+ $ref: string;
1000
+ };
1001
+ stage: "before";
1002
+ approvers?: string[] | undefined;
1003
+ onTimeout?: "fail" | "success" | undefined;
1004
+ deadlineMs?: number | undefined;
1005
+ }, {
1006
+ prompt: string | {
1007
+ $ref: string;
1008
+ };
1009
+ stage: "before";
1010
+ approvers?: string[] | undefined;
1011
+ onTimeout?: "fail" | "success" | undefined;
1012
+ deadlineMs?: number | undefined;
1013
+ }>>;
1014
+ retryPolicy: z.ZodOptional<z.ZodObject<{
1015
+ maxAttempts: z.ZodNumber;
1016
+ backoff: z.ZodEnum<["fixed", "exponential"]>;
1017
+ baseMs: z.ZodNumber;
1018
+ factor: z.ZodOptional<z.ZodNumber>;
1019
+ jitter: z.ZodOptional<z.ZodBoolean>;
1020
+ }, "strip", z.ZodTypeAny, {
1021
+ baseMs: number;
1022
+ maxAttempts: number;
1023
+ backoff: "fixed" | "exponential";
1024
+ factor?: number | undefined;
1025
+ jitter?: boolean | undefined;
1026
+ }, {
1027
+ baseMs: number;
1028
+ maxAttempts: number;
1029
+ backoff: "fixed" | "exponential";
1030
+ factor?: number | undefined;
1031
+ jitter?: boolean | undefined;
1032
+ }>>;
1033
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1034
+ maxOutputBytes: z.ZodOptional<z.ZodNumber>;
1035
+ outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1036
+ /**
1037
+ * Opt-in escape hatch for a side-effect hostExecutor node that *must* run
1038
+ * without a humanGate (e.g. a system-internal cron tick, an explicitly
1039
+ * batched send-all script). Default is unset / false → validator rejects
1040
+ * ungated side-effect executors at parse time (`SIDE_EFFECT_EXECUTORS`).
1041
+ *
1042
+ * Setting this to `true` is the workflow author's audit-trail: "I know
1043
+ * this node sends a message / writes to repo / schedules a cron with no
1044
+ * human approval — accept the risk." Prefer `humanGate` whenever the
1045
+ * intent is "let an operator confirm before this fires."
1046
+ */
1047
+ unsafeAllowUngated: z.ZodOptional<z.ZodBoolean>;
1048
+ }, "strip", z.ZodTypeAny, {
1049
+ type: "hostExecutor";
1050
+ executor: string;
1051
+ input?: unknown;
1052
+ timeoutMs?: number | undefined;
1053
+ maxOutputBytes?: number | undefined;
1054
+ description?: string | undefined;
1055
+ depends?: string[] | undefined;
1056
+ humanGate?: {
1057
+ prompt: string | {
1058
+ $ref: string;
1059
+ };
1060
+ stage: "before";
1061
+ approvers?: string[] | undefined;
1062
+ onTimeout?: "fail" | "success" | undefined;
1063
+ deadlineMs?: number | undefined;
1064
+ } | undefined;
1065
+ retryPolicy?: {
1066
+ baseMs: number;
1067
+ maxAttempts: number;
1068
+ backoff: "fixed" | "exponential";
1069
+ factor?: number | undefined;
1070
+ jitter?: boolean | undefined;
1071
+ } | undefined;
1072
+ outputSchema?: Record<string, unknown> | undefined;
1073
+ unsafeAllowUngated?: boolean | undefined;
1074
+ }, {
1075
+ type: "hostExecutor";
1076
+ executor: string;
1077
+ input?: unknown;
1078
+ timeoutMs?: number | undefined;
1079
+ maxOutputBytes?: number | undefined;
1080
+ description?: string | undefined;
1081
+ depends?: string[] | undefined;
1082
+ humanGate?: {
1083
+ prompt: string | {
1084
+ $ref: string;
1085
+ };
1086
+ stage: "before";
1087
+ approvers?: string[] | undefined;
1088
+ onTimeout?: "fail" | "success" | undefined;
1089
+ deadlineMs?: number | undefined;
1090
+ } | undefined;
1091
+ retryPolicy?: {
1092
+ baseMs: number;
1093
+ maxAttempts: number;
1094
+ backoff: "fixed" | "exponential";
1095
+ factor?: number | undefined;
1096
+ jitter?: boolean | undefined;
1097
+ } | undefined;
1098
+ outputSchema?: Record<string, unknown> | undefined;
1099
+ unsafeAllowUngated?: boolean | undefined;
1100
+ }>]>>;
1101
+ }, "strip", z.ZodTypeAny, {
1102
+ version: number;
1103
+ workflowId: string;
1104
+ nodes: Record<string, {
1105
+ prompt: string | {
1106
+ $ref: string;
1107
+ };
1108
+ type: "subagent";
1109
+ bot: string;
1110
+ workingDir?: string | undefined;
1111
+ timeoutMs?: number | undefined;
1112
+ maxOutputBytes?: number | undefined;
1113
+ description?: string | undefined;
1114
+ modelOverrides?: {
1115
+ model?: string | undefined;
1116
+ reasoningEffort?: string | undefined;
1117
+ } | undefined;
1118
+ toolPolicy?: {
1119
+ allow?: string[] | undefined;
1120
+ deny?: string[] | undefined;
1121
+ } | undefined;
1122
+ depends?: string[] | undefined;
1123
+ humanGate?: {
1124
+ prompt: string | {
1125
+ $ref: string;
1126
+ };
1127
+ stage: "before";
1128
+ approvers?: string[] | undefined;
1129
+ onTimeout?: "fail" | "success" | undefined;
1130
+ deadlineMs?: number | undefined;
1131
+ } | undefined;
1132
+ retryPolicy?: {
1133
+ baseMs: number;
1134
+ maxAttempts: number;
1135
+ backoff: "fixed" | "exponential";
1136
+ factor?: number | undefined;
1137
+ jitter?: boolean | undefined;
1138
+ } | undefined;
1139
+ outputSchema?: Record<string, unknown> | undefined;
1140
+ unsafeAllowUngated?: boolean | undefined;
1141
+ } | {
1142
+ type: "hostExecutor";
1143
+ executor: string;
1144
+ input?: unknown;
1145
+ timeoutMs?: number | undefined;
1146
+ maxOutputBytes?: number | undefined;
1147
+ description?: string | undefined;
1148
+ depends?: string[] | undefined;
1149
+ humanGate?: {
1150
+ prompt: string | {
1151
+ $ref: string;
1152
+ };
1153
+ stage: "before";
1154
+ approvers?: string[] | undefined;
1155
+ onTimeout?: "fail" | "success" | undefined;
1156
+ deadlineMs?: number | undefined;
1157
+ } | undefined;
1158
+ retryPolicy?: {
1159
+ baseMs: number;
1160
+ maxAttempts: number;
1161
+ backoff: "fixed" | "exponential";
1162
+ factor?: number | undefined;
1163
+ jitter?: boolean | undefined;
1164
+ } | undefined;
1165
+ outputSchema?: Record<string, unknown> | undefined;
1166
+ unsafeAllowUngated?: boolean | undefined;
1167
+ }>;
1168
+ params?: Record<string, {
1169
+ type: "string" | "number" | "boolean" | "object" | "array";
1170
+ default?: unknown;
1171
+ format?: string | undefined;
1172
+ required?: boolean | undefined;
1173
+ description?: string | undefined;
1174
+ }> | undefined;
1175
+ defaults?: {
1176
+ timeoutMs?: number | undefined;
1177
+ maxOutputBytes?: number | undefined;
1178
+ retryPolicy?: {
1179
+ baseMs: number;
1180
+ maxAttempts: number;
1181
+ backoff: "fixed" | "exponential";
1182
+ factor?: number | undefined;
1183
+ jitter?: boolean | undefined;
1184
+ } | undefined;
1185
+ maxConcurrency?: number | undefined;
1186
+ } | undefined;
1187
+ }, {
1188
+ version: number;
1189
+ workflowId: string;
1190
+ nodes: Record<string, {
1191
+ prompt: string | {
1192
+ $ref: string;
1193
+ };
1194
+ type: "subagent";
1195
+ bot: string;
1196
+ workingDir?: string | undefined;
1197
+ timeoutMs?: number | undefined;
1198
+ maxOutputBytes?: number | undefined;
1199
+ description?: string | undefined;
1200
+ modelOverrides?: {
1201
+ model?: string | undefined;
1202
+ reasoningEffort?: string | undefined;
1203
+ } | undefined;
1204
+ toolPolicy?: {
1205
+ allow?: string[] | undefined;
1206
+ deny?: string[] | undefined;
1207
+ } | undefined;
1208
+ depends?: string[] | undefined;
1209
+ humanGate?: {
1210
+ prompt: string | {
1211
+ $ref: string;
1212
+ };
1213
+ stage: "before";
1214
+ approvers?: string[] | undefined;
1215
+ onTimeout?: "fail" | "success" | undefined;
1216
+ deadlineMs?: number | undefined;
1217
+ } | undefined;
1218
+ retryPolicy?: {
1219
+ baseMs: number;
1220
+ maxAttempts: number;
1221
+ backoff: "fixed" | "exponential";
1222
+ factor?: number | undefined;
1223
+ jitter?: boolean | undefined;
1224
+ } | undefined;
1225
+ outputSchema?: Record<string, unknown> | undefined;
1226
+ unsafeAllowUngated?: boolean | undefined;
1227
+ } | {
1228
+ type: "hostExecutor";
1229
+ executor: string;
1230
+ input?: unknown;
1231
+ timeoutMs?: number | undefined;
1232
+ maxOutputBytes?: number | undefined;
1233
+ description?: string | undefined;
1234
+ depends?: string[] | undefined;
1235
+ humanGate?: {
1236
+ prompt: string | {
1237
+ $ref: string;
1238
+ };
1239
+ stage: "before";
1240
+ approvers?: string[] | undefined;
1241
+ onTimeout?: "fail" | "success" | undefined;
1242
+ deadlineMs?: number | undefined;
1243
+ } | undefined;
1244
+ retryPolicy?: {
1245
+ baseMs: number;
1246
+ maxAttempts: number;
1247
+ backoff: "fixed" | "exponential";
1248
+ factor?: number | undefined;
1249
+ jitter?: boolean | undefined;
1250
+ } | undefined;
1251
+ outputSchema?: Record<string, unknown> | undefined;
1252
+ unsafeAllowUngated?: boolean | undefined;
1253
+ }>;
1254
+ params?: Record<string, {
1255
+ type: "string" | "number" | "boolean" | "object" | "array";
1256
+ default?: unknown;
1257
+ format?: string | undefined;
1258
+ required?: boolean | undefined;
1259
+ description?: string | undefined;
1260
+ }> | undefined;
1261
+ defaults?: {
1262
+ timeoutMs?: number | undefined;
1263
+ maxOutputBytes?: number | undefined;
1264
+ retryPolicy?: {
1265
+ baseMs: number;
1266
+ maxAttempts: number;
1267
+ backoff: "fixed" | "exponential";
1268
+ factor?: number | undefined;
1269
+ jitter?: boolean | undefined;
1270
+ } | undefined;
1271
+ maxConcurrency?: number | undefined;
1272
+ } | undefined;
1273
+ }>;
1274
+ export type WorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
1275
+ /**
1276
+ * Canonical JSON: object keys sorted recursively, arrays preserved in
1277
+ * order, compact (no extra whitespace). Defined this way so that any
1278
+ * authoring-tool round-trip (YAML→JSON, TS builder→JSON) produces an
1279
+ * identical string when the underlying data is the same.
1280
+ *
1281
+ * Numbers are emitted via JSON.stringify so NaN/Infinity (illegal in
1282
+ * JSON) round-trip to errors — caller should reject those in schema.
1283
+ */
1284
+ export declare function canonicalJsonStringify(value: unknown): string;
1285
+ /**
1286
+ * revisionId = sha256(canonicalJsonStringify(def)).
1287
+ * Use the `version` field for human-readable semantic versions.
1288
+ */
1289
+ export declare function computeRevisionId(def: WorkflowDefinition): string;
1290
+ /**
1291
+ * Schema parse + cross-field invariants:
1292
+ * 1. every `depends` entry references an existing node
1293
+ * 2. graph is acyclic
1294
+ * 3. at least one root node (no deps)
1295
+ *
1296
+ * Throws on any failure. Use `WorkflowDefinitionSchema.safeParse(...)`
1297
+ * directly if you only need shape checks (no graph validation).
1298
+ */
1299
+ export declare function parseWorkflowDefinition(raw: unknown): WorkflowDefinition;
1300
+ /**
1301
+ * Kahn's algorithm. Returns nodeIds in dispatch-safe order (deps before
1302
+ * dependents). Ties broken by `Object.keys(nodes)` insertion order so
1303
+ * the result is deterministic for a given workflow JSON.
1304
+ *
1305
+ * Assumes the graph is valid (no cycles); call `parseWorkflowDefinition`
1306
+ * first or pass a definition that already came from there.
1307
+ */
1308
+ export declare function topologicalOrder(def: WorkflowDefinition): string[];
1309
+ //# sourceMappingURL=definition.d.ts.map