@xyne/workflow-sdk 1.0.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 (310) hide show
  1. package/README.md +36 -0
  2. package/dist/agents/agent-step.d.ts +152 -0
  3. package/dist/agents/agent-step.d.ts.map +1 -0
  4. package/dist/agents/agent-step.js +403 -0
  5. package/dist/agents/agent-step.js.map +1 -0
  6. package/dist/agents/base-runtime.d.ts +38 -0
  7. package/dist/agents/base-runtime.d.ts.map +1 -0
  8. package/dist/agents/base-runtime.js +21 -0
  9. package/dist/agents/base-runtime.js.map +1 -0
  10. package/dist/agents/index.d.ts +12 -0
  11. package/dist/agents/index.d.ts.map +1 -0
  12. package/dist/agents/index.js +17 -0
  13. package/dist/agents/index.js.map +1 -0
  14. package/dist/agents/interceptor.d.ts +19 -0
  15. package/dist/agents/interceptor.d.ts.map +1 -0
  16. package/dist/agents/interceptor.js +21 -0
  17. package/dist/agents/interceptor.js.map +1 -0
  18. package/dist/agents/interceptors/approval-gate.d.ts +14 -0
  19. package/dist/agents/interceptors/approval-gate.d.ts.map +1 -0
  20. package/dist/agents/interceptors/approval-gate.js +19 -0
  21. package/dist/agents/interceptors/approval-gate.js.map +1 -0
  22. package/dist/agents/interceptors/tool-logger.d.ts +15 -0
  23. package/dist/agents/interceptors/tool-logger.d.ts.map +1 -0
  24. package/dist/agents/interceptors/tool-logger.js +23 -0
  25. package/dist/agents/interceptors/tool-logger.js.map +1 -0
  26. package/dist/agents/pi-mono-runtime.d.ts +88 -0
  27. package/dist/agents/pi-mono-runtime.d.ts.map +1 -0
  28. package/dist/agents/pi-mono-runtime.js +129 -0
  29. package/dist/agents/pi-mono-runtime.js.map +1 -0
  30. package/dist/agents/tool-registry.d.ts +25 -0
  31. package/dist/agents/tool-registry.d.ts.map +1 -0
  32. package/dist/agents/tool-registry.js +47 -0
  33. package/dist/agents/tool-registry.js.map +1 -0
  34. package/dist/agents/tool-types.d.ts +25 -0
  35. package/dist/agents/tool-types.d.ts.map +1 -0
  36. package/dist/agents/tool-types.js +9 -0
  37. package/dist/agents/tool-types.js.map +1 -0
  38. package/dist/agents/types.d.ts +91 -0
  39. package/dist/agents/types.d.ts.map +1 -0
  40. package/dist/agents/types.js +12 -0
  41. package/dist/agents/types.js.map +1 -0
  42. package/dist/builder/index.d.ts +30 -0
  43. package/dist/builder/index.d.ts.map +1 -0
  44. package/dist/builder/index.js +32 -0
  45. package/dist/builder/index.js.map +1 -0
  46. package/dist/client/index.d.ts +19 -0
  47. package/dist/client/index.d.ts.map +1 -0
  48. package/dist/client/index.js +18 -0
  49. package/dist/client/index.js.map +1 -0
  50. package/dist/client/types.d.ts +128 -0
  51. package/dist/client/types.d.ts.map +1 -0
  52. package/dist/client/types.js +10 -0
  53. package/dist/client/types.js.map +1 -0
  54. package/dist/client/workflow-client.d.ts +15 -0
  55. package/dist/client/workflow-client.d.ts.map +1 -0
  56. package/dist/client/workflow-client.js +293 -0
  57. package/dist/client/workflow-client.js.map +1 -0
  58. package/dist/common/attachment.d.ts +31 -0
  59. package/dist/common/attachment.d.ts.map +1 -0
  60. package/dist/common/attachment.js +21 -0
  61. package/dist/common/attachment.js.map +1 -0
  62. package/dist/common/executable-check.d.ts +42 -0
  63. package/dist/common/executable-check.d.ts.map +1 -0
  64. package/dist/common/executable-check.js +115 -0
  65. package/dist/common/executable-check.js.map +1 -0
  66. package/dist/common/index.d.ts +21 -0
  67. package/dist/common/index.d.ts.map +1 -0
  68. package/dist/common/index.js +19 -0
  69. package/dist/common/index.js.map +1 -0
  70. package/dist/common/resume-payload.d.ts +34 -0
  71. package/dist/common/resume-payload.d.ts.map +1 -0
  72. package/dist/common/resume-payload.js +12 -0
  73. package/dist/common/resume-payload.js.map +1 -0
  74. package/dist/engine/available-context.d.ts +29 -0
  75. package/dist/engine/available-context.d.ts.map +1 -0
  76. package/dist/engine/available-context.js +66 -0
  77. package/dist/engine/available-context.js.map +1 -0
  78. package/dist/engine/condition-evaluator.d.ts +13 -0
  79. package/dist/engine/condition-evaluator.d.ts.map +1 -0
  80. package/dist/engine/condition-evaluator.js +92 -0
  81. package/dist/engine/condition-evaluator.js.map +1 -0
  82. package/dist/engine/config-validator.d.ts +25 -0
  83. package/dist/engine/config-validator.d.ts.map +1 -0
  84. package/dist/engine/config-validator.js +316 -0
  85. package/dist/engine/config-validator.js.map +1 -0
  86. package/dist/engine/pause-step.d.ts +20 -0
  87. package/dist/engine/pause-step.d.ts.map +1 -0
  88. package/dist/engine/pause-step.js +24 -0
  89. package/dist/engine/pause-step.js.map +1 -0
  90. package/dist/engine/service-registry.d.ts +49 -0
  91. package/dist/engine/service-registry.d.ts.map +1 -0
  92. package/dist/engine/service-registry.js +76 -0
  93. package/dist/engine/service-registry.js.map +1 -0
  94. package/dist/engine/variable-resolver.d.ts +29 -0
  95. package/dist/engine/variable-resolver.d.ts.map +1 -0
  96. package/dist/engine/variable-resolver.js +130 -0
  97. package/dist/engine/variable-resolver.js.map +1 -0
  98. package/dist/engine/workflow-executor.d.ts +96 -0
  99. package/dist/engine/workflow-executor.d.ts.map +1 -0
  100. package/dist/engine/workflow-executor.js +837 -0
  101. package/dist/engine/workflow-executor.js.map +1 -0
  102. package/dist/index.d.ts +57 -0
  103. package/dist/index.d.ts.map +1 -0
  104. package/dist/index.js +56 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/persistence/in-memory-adapter.d.ts +138 -0
  107. package/dist/persistence/in-memory-adapter.d.ts.map +1 -0
  108. package/dist/persistence/in-memory-adapter.js +315 -0
  109. package/dist/persistence/in-memory-adapter.js.map +1 -0
  110. package/dist/persistence/types.d.ts +214 -0
  111. package/dist/persistence/types.d.ts.map +1 -0
  112. package/dist/persistence/types.js +8 -0
  113. package/dist/persistence/types.js.map +1 -0
  114. package/dist/router/types.d.ts +57 -0
  115. package/dist/router/types.d.ts.map +1 -0
  116. package/dist/router/types.js +8 -0
  117. package/dist/router/types.js.map +1 -0
  118. package/dist/router/workflow-router.d.ts +26 -0
  119. package/dist/router/workflow-router.d.ts.map +1 -0
  120. package/dist/router/workflow-router.js +611 -0
  121. package/dist/router/workflow-router.js.map +1 -0
  122. package/dist/runtime/execution-event-bus.d.ts +38 -0
  123. package/dist/runtime/execution-event-bus.d.ts.map +1 -0
  124. package/dist/runtime/execution-event-bus.js +87 -0
  125. package/dist/runtime/execution-event-bus.js.map +1 -0
  126. package/dist/runtime/types.d.ts +129 -0
  127. package/dist/runtime/types.d.ts.map +1 -0
  128. package/dist/runtime/types.js +5 -0
  129. package/dist/runtime/types.js.map +1 -0
  130. package/dist/runtime/workflow-runtime.d.ts +256 -0
  131. package/dist/runtime/workflow-runtime.d.ts.map +1 -0
  132. package/dist/runtime/workflow-runtime.js +699 -0
  133. package/dist/runtime/workflow-runtime.js.map +1 -0
  134. package/dist/steps/base-step.d.ts +204 -0
  135. package/dist/steps/base-step.d.ts.map +1 -0
  136. package/dist/steps/base-step.js +69 -0
  137. package/dist/steps/base-step.js.map +1 -0
  138. package/dist/steps/builtin/code.step.d.ts +95 -0
  139. package/dist/steps/builtin/code.step.d.ts.map +1 -0
  140. package/dist/steps/builtin/code.step.js +122 -0
  141. package/dist/steps/builtin/code.step.js.map +1 -0
  142. package/dist/steps/builtin/conditional.step.d.ts +146 -0
  143. package/dist/steps/builtin/conditional.step.d.ts.map +1 -0
  144. package/dist/steps/builtin/conditional.step.js +71 -0
  145. package/dist/steps/builtin/conditional.step.js.map +1 -0
  146. package/dist/steps/builtin/dedup.step.d.ts +65 -0
  147. package/dist/steps/builtin/dedup.step.d.ts.map +1 -0
  148. package/dist/steps/builtin/dedup.step.js +61 -0
  149. package/dist/steps/builtin/dedup.step.js.map +1 -0
  150. package/dist/steps/builtin/http-request.step.d.ts +928 -0
  151. package/dist/steps/builtin/http-request.step.d.ts.map +1 -0
  152. package/dist/steps/builtin/http-request.step.js +570 -0
  153. package/dist/steps/builtin/http-request.step.js.map +1 -0
  154. package/dist/steps/builtin/loop.step.d.ts +100 -0
  155. package/dist/steps/builtin/loop.step.d.ts.map +1 -0
  156. package/dist/steps/builtin/loop.step.js +79 -0
  157. package/dist/steps/builtin/loop.step.js.map +1 -0
  158. package/dist/steps/builtin/parallel.step.d.ts +208 -0
  159. package/dist/steps/builtin/parallel.step.d.ts.map +1 -0
  160. package/dist/steps/builtin/parallel.step.js +249 -0
  161. package/dist/steps/builtin/parallel.step.js.map +1 -0
  162. package/dist/steps/builtin/switch.step.d.ts +200 -0
  163. package/dist/steps/builtin/switch.step.d.ts.map +1 -0
  164. package/dist/steps/builtin/switch.step.js +92 -0
  165. package/dist/steps/builtin/switch.step.js.map +1 -0
  166. package/dist/steps/builtin/transform.step.d.ts +247 -0
  167. package/dist/steps/builtin/transform.step.d.ts.map +1 -0
  168. package/dist/steps/builtin/transform.step.js +135 -0
  169. package/dist/steps/builtin/transform.step.js.map +1 -0
  170. package/dist/steps/builtin/wait.step.d.ts +921 -0
  171. package/dist/steps/builtin/wait.step.d.ts.map +1 -0
  172. package/dist/steps/builtin/wait.step.js +211 -0
  173. package/dist/steps/builtin/wait.step.js.map +1 -0
  174. package/dist/steps/step-registry.d.ts +64 -0
  175. package/dist/steps/step-registry.d.ts.map +1 -0
  176. package/dist/steps/step-registry.js +102 -0
  177. package/dist/steps/step-registry.js.map +1 -0
  178. package/dist/storage/in-memory-adapter.d.ts +25 -0
  179. package/dist/storage/in-memory-adapter.d.ts.map +1 -0
  180. package/dist/storage/in-memory-adapter.js +41 -0
  181. package/dist/storage/in-memory-adapter.js.map +1 -0
  182. package/dist/storage/types.d.ts +53 -0
  183. package/dist/storage/types.d.ts.map +1 -0
  184. package/dist/storage/types.js +13 -0
  185. package/dist/storage/types.js.map +1 -0
  186. package/dist/testing/index.d.ts +10 -0
  187. package/dist/testing/index.d.ts.map +1 -0
  188. package/dist/testing/index.js +10 -0
  189. package/dist/testing/index.js.map +1 -0
  190. package/dist/testing/mock-context.d.ts +13 -0
  191. package/dist/testing/mock-context.d.ts.map +1 -0
  192. package/dist/testing/mock-context.js +21 -0
  193. package/dist/testing/mock-context.js.map +1 -0
  194. package/dist/testing/mock-step-context.d.ts +47 -0
  195. package/dist/testing/mock-step-context.d.ts.map +1 -0
  196. package/dist/testing/mock-step-context.js +59 -0
  197. package/dist/testing/mock-step-context.js.map +1 -0
  198. package/dist/triggers/base-trigger.d.ts +58 -0
  199. package/dist/triggers/base-trigger.d.ts.map +1 -0
  200. package/dist/triggers/base-trigger.js +37 -0
  201. package/dist/triggers/base-trigger.js.map +1 -0
  202. package/dist/triggers/builtin/default-cron-trigger.d.ts +44 -0
  203. package/dist/triggers/builtin/default-cron-trigger.d.ts.map +1 -0
  204. package/dist/triggers/builtin/default-cron-trigger.js +31 -0
  205. package/dist/triggers/builtin/default-cron-trigger.js.map +1 -0
  206. package/dist/triggers/builtin/default-event-trigger.d.ts +32 -0
  207. package/dist/triggers/builtin/default-event-trigger.d.ts.map +1 -0
  208. package/dist/triggers/builtin/default-event-trigger.js +21 -0
  209. package/dist/triggers/builtin/default-event-trigger.js.map +1 -0
  210. package/dist/triggers/builtin/default-manual-trigger.d.ts +119 -0
  211. package/dist/triggers/builtin/default-manual-trigger.d.ts.map +1 -0
  212. package/dist/triggers/builtin/default-manual-trigger.js +64 -0
  213. package/dist/triggers/builtin/default-manual-trigger.js.map +1 -0
  214. package/dist/triggers/builtin/default-webhook-trigger.d.ts +72 -0
  215. package/dist/triggers/builtin/default-webhook-trigger.d.ts.map +1 -0
  216. package/dist/triggers/builtin/default-webhook-trigger.js +91 -0
  217. package/dist/triggers/builtin/default-webhook-trigger.js.map +1 -0
  218. package/dist/triggers/cron-trigger.d.ts +52 -0
  219. package/dist/triggers/cron-trigger.d.ts.map +1 -0
  220. package/dist/triggers/cron-trigger.js +15 -0
  221. package/dist/triggers/cron-trigger.js.map +1 -0
  222. package/dist/triggers/event-trigger.d.ts +14 -0
  223. package/dist/triggers/event-trigger.d.ts.map +1 -0
  224. package/dist/triggers/event-trigger.js +13 -0
  225. package/dist/triggers/event-trigger.js.map +1 -0
  226. package/dist/triggers/manual-trigger.d.ts +11 -0
  227. package/dist/triggers/manual-trigger.d.ts.map +1 -0
  228. package/dist/triggers/manual-trigger.js +10 -0
  229. package/dist/triggers/manual-trigger.js.map +1 -0
  230. package/dist/triggers/trigger-registry.d.ts +48 -0
  231. package/dist/triggers/trigger-registry.d.ts.map +1 -0
  232. package/dist/triggers/trigger-registry.js +81 -0
  233. package/dist/triggers/trigger-registry.js.map +1 -0
  234. package/dist/triggers/webhook-trigger.d.ts +54 -0
  235. package/dist/triggers/webhook-trigger.d.ts.map +1 -0
  236. package/dist/triggers/webhook-trigger.js +13 -0
  237. package/dist/triggers/webhook-trigger.js.map +1 -0
  238. package/dist/types/attachment.d.ts +23 -0
  239. package/dist/types/attachment.d.ts.map +1 -0
  240. package/dist/types/attachment.js +2 -0
  241. package/dist/types/attachment.js.map +1 -0
  242. package/dist/types/categories.d.ts +14 -0
  243. package/dist/types/categories.d.ts.map +1 -0
  244. package/dist/types/categories.js +10 -0
  245. package/dist/types/categories.js.map +1 -0
  246. package/dist/types/context.d.ts +61 -0
  247. package/dist/types/context.d.ts.map +1 -0
  248. package/dist/types/context.js +2 -0
  249. package/dist/types/context.js.map +1 -0
  250. package/dist/types/index.d.ts +18 -0
  251. package/dist/types/index.d.ts.map +1 -0
  252. package/dist/types/index.js +12 -0
  253. package/dist/types/index.js.map +1 -0
  254. package/dist/types/known-types.d.ts +34 -0
  255. package/dist/types/known-types.d.ts.map +1 -0
  256. package/dist/types/known-types.js +49 -0
  257. package/dist/types/known-types.js.map +1 -0
  258. package/dist/types/operators.d.ts +20 -0
  259. package/dist/types/operators.d.ts.map +1 -0
  260. package/dist/types/operators.js +27 -0
  261. package/dist/types/operators.js.map +1 -0
  262. package/dist/types/pause-path.d.ts +23 -0
  263. package/dist/types/pause-path.d.ts.map +1 -0
  264. package/dist/types/pause-path.js +2 -0
  265. package/dist/types/pause-path.js.map +1 -0
  266. package/dist/types/pause-state.d.ts +100 -0
  267. package/dist/types/pause-state.d.ts.map +1 -0
  268. package/dist/types/pause-state.js +15 -0
  269. package/dist/types/pause-state.js.map +1 -0
  270. package/dist/types/resume-payload.d.ts +34 -0
  271. package/dist/types/resume-payload.d.ts.map +1 -0
  272. package/dist/types/resume-payload.js +12 -0
  273. package/dist/types/resume-payload.js.map +1 -0
  274. package/dist/types/status.d.ts +27 -0
  275. package/dist/types/status.d.ts.map +1 -0
  276. package/dist/types/status.js +41 -0
  277. package/dist/types/status.js.map +1 -0
  278. package/dist/types/step-events.d.ts +22 -0
  279. package/dist/types/step-events.d.ts.map +1 -0
  280. package/dist/types/step-events.js +8 -0
  281. package/dist/types/step-events.js.map +1 -0
  282. package/dist/types/step-types.d.ts +12 -0
  283. package/dist/types/step-types.d.ts.map +1 -0
  284. package/dist/types/step-types.js +2 -0
  285. package/dist/types/step-types.js.map +1 -0
  286. package/dist/types/trigger-types.d.ts +12 -0
  287. package/dist/types/trigger-types.d.ts.map +1 -0
  288. package/dist/types/trigger-types.js +2 -0
  289. package/dist/types/trigger-types.js.map +1 -0
  290. package/dist/types/validation.d.ts +19 -0
  291. package/dist/types/validation.d.ts.map +1 -0
  292. package/dist/types/validation.js +11 -0
  293. package/dist/types/validation.js.map +1 -0
  294. package/dist/types/workflow-config.d.ts +122 -0
  295. package/dist/types/workflow-config.d.ts.map +1 -0
  296. package/dist/types/workflow-config.js +71 -0
  297. package/dist/types/workflow-config.js.map +1 -0
  298. package/dist/util/executable-check.d.ts +42 -0
  299. package/dist/util/executable-check.d.ts.map +1 -0
  300. package/dist/util/executable-check.js +115 -0
  301. package/dist/util/executable-check.js.map +1 -0
  302. package/dist/util/schema-convert.d.ts +14 -0
  303. package/dist/util/schema-convert.d.ts.map +1 -0
  304. package/dist/util/schema-convert.js +16 -0
  305. package/dist/util/schema-convert.js.map +1 -0
  306. package/dist/util/variable-ref.d.ts +52 -0
  307. package/dist/util/variable-ref.d.ts.map +1 -0
  308. package/dist/util/variable-ref.js +89 -0
  309. package/dist/util/variable-ref.js.map +1 -0
  310. package/package.json +97 -0
@@ -0,0 +1,12 @@
1
+ // Types barrel — re-exports every public type from the SDK.
2
+ export {
3
+ // Step type enums
4
+ BuiltinStepType, BuiltinStepTypeSchema, ControlFlowStepTypeSchema, CONTROL_FLOW_STEP_TYPES,
5
+ // Trigger type enums
6
+ BuiltinTriggerType, BuiltinTriggerTypeSchema, } from './known-types.js';
7
+ export { TriggerCategory, TriggerCategorySchema, } from './categories.js';
8
+ export { ConditionOperator, ConditionOperatorSchema, VALUE_LESS_OPERATORS, OPERATOR_DESCRIPTORS, } from './operators.js';
9
+ export { WorkflowStatus, WorkflowStatusSchema, isLiveStatus, isProposalStatus, isTerminalProposalStatus, ExecutionStatus, ExecutionStatusSchema, } from './status.js';
10
+ export { ValidationIssueCode, ValidationIssueCodeSchema, } from './validation.js';
11
+ export { variableRef, getVariableRefInnerSchema, LeafConditionSchema, ConditionSchema, WorkflowSettingsSchema, readDottedPath, } from './workflow-config.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAE5D,OAAO;AACL,kBAAkB;AAClB,eAAe,EACf,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB;AACvB,qBAAqB;AACrB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EACL,eAAe,EACf,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AA+BzB,OAAO,EACL,WAAW,EACX,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,cAAc,GACf,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * All step types shipped by the SDK.
4
+ * Host adds domain-specific types as plain strings (e.g. 'SEND_MESSAGE').
5
+ */
6
+ export declare enum BuiltinStepType {
7
+ CONDITIONAL = "CONDITIONAL",
8
+ SWITCH = "SWITCH",
9
+ LOOP = "LOOP",
10
+ PARALLEL = "PARALLEL",
11
+ CODE = "CODE",
12
+ WAIT = "WAIT",
13
+ HTTP_REQUEST = "HTTP_REQUEST",
14
+ DEDUP = "DEDUP"
15
+ }
16
+ export declare const BuiltinStepTypeSchema: z.ZodNativeEnum<typeof BuiltinStepType>;
17
+ declare const _CONTROL_FLOW_STEP_TYPES: readonly [BuiltinStepType.CONDITIONAL, BuiltinStepType.SWITCH, BuiltinStepType.LOOP, BuiltinStepType.PARALLEL];
18
+ export type ControlFlowStepType = (typeof _CONTROL_FLOW_STEP_TYPES)[number];
19
+ /** Set of control-flow step types — for runtime checks like `CONTROL_FLOW_STEP_TYPES.has(step.type)`. */
20
+ export declare const CONTROL_FLOW_STEP_TYPES: ReadonlySet<string>;
21
+ export declare const ControlFlowStepTypeSchema: z.ZodEnum<[BuiltinStepType.CONDITIONAL, BuiltinStepType.SWITCH, BuiltinStepType.LOOP, BuiltinStepType.PARALLEL]>;
22
+ /**
23
+ * Trigger types shipped by the SDK.
24
+ * Host adds domain-specific triggers as plain strings (e.g. 'TICKET_CREATED').
25
+ */
26
+ export declare enum BuiltinTriggerType {
27
+ EVENT = "EVENT",
28
+ WEBHOOK = "WEBHOOK",
29
+ CRON = "CRON",
30
+ MANUAL = "MANUAL"
31
+ }
32
+ export declare const BuiltinTriggerTypeSchema: z.ZodNativeEnum<typeof BuiltinTriggerType>;
33
+ export {};
34
+ //# sourceMappingURL=known-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"known-types.d.ts","sourceRoot":"","sources":["../../src/types/known-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,oBAAY,eAAe;IAEzB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,QAAQ,aAAa;IAErB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,YAAY,iBAAiB;IAC7B,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,qBAAqB,yCAAgC,CAAC;AAInE,QAAA,MAAM,wBAAwB,gHAKpB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,yGAAyG;AACzG,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAEvD,CAAC;AAEF,eAAO,MAAM,yBAAyB,kHAKpC,CAAC;AAIH;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,wBAAwB,4CAAmC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { z } from 'zod';
2
+ // ─── Built-in Step Types ───
3
+ /**
4
+ * All step types shipped by the SDK.
5
+ * Host adds domain-specific types as plain strings (e.g. 'SEND_MESSAGE').
6
+ */
7
+ export var BuiltinStepType;
8
+ (function (BuiltinStepType) {
9
+ // Control flow
10
+ BuiltinStepType["CONDITIONAL"] = "CONDITIONAL";
11
+ BuiltinStepType["SWITCH"] = "SWITCH";
12
+ BuiltinStepType["LOOP"] = "LOOP";
13
+ BuiltinStepType["PARALLEL"] = "PARALLEL";
14
+ // Action
15
+ BuiltinStepType["CODE"] = "CODE";
16
+ BuiltinStepType["WAIT"] = "WAIT";
17
+ BuiltinStepType["HTTP_REQUEST"] = "HTTP_REQUEST";
18
+ BuiltinStepType["DEDUP"] = "DEDUP";
19
+ })(BuiltinStepType || (BuiltinStepType = {}));
20
+ export const BuiltinStepTypeSchema = z.nativeEnum(BuiltinStepType);
21
+ // ─── Control Flow subset ───
22
+ const _CONTROL_FLOW_STEP_TYPES = [
23
+ BuiltinStepType.CONDITIONAL,
24
+ BuiltinStepType.SWITCH,
25
+ BuiltinStepType.LOOP,
26
+ BuiltinStepType.PARALLEL,
27
+ ];
28
+ /** Set of control-flow step types — for runtime checks like `CONTROL_FLOW_STEP_TYPES.has(step.type)`. */
29
+ export const CONTROL_FLOW_STEP_TYPES = new Set(_CONTROL_FLOW_STEP_TYPES);
30
+ export const ControlFlowStepTypeSchema = z.enum([
31
+ BuiltinStepType.CONDITIONAL,
32
+ BuiltinStepType.SWITCH,
33
+ BuiltinStepType.LOOP,
34
+ BuiltinStepType.PARALLEL,
35
+ ]);
36
+ // ─── Built-in Trigger Types ───
37
+ /**
38
+ * Trigger types shipped by the SDK.
39
+ * Host adds domain-specific triggers as plain strings (e.g. 'TICKET_CREATED').
40
+ */
41
+ export var BuiltinTriggerType;
42
+ (function (BuiltinTriggerType) {
43
+ BuiltinTriggerType["EVENT"] = "EVENT";
44
+ BuiltinTriggerType["WEBHOOK"] = "WEBHOOK";
45
+ BuiltinTriggerType["CRON"] = "CRON";
46
+ BuiltinTriggerType["MANUAL"] = "MANUAL";
47
+ })(BuiltinTriggerType || (BuiltinTriggerType = {}));
48
+ export const BuiltinTriggerTypeSchema = z.nativeEnum(BuiltinTriggerType);
49
+ //# sourceMappingURL=known-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"known-types.js","sourceRoot":"","sources":["../../src/types/known-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8BAA8B;AAE9B;;;GAGG;AACH,MAAM,CAAN,IAAY,eAWX;AAXD,WAAY,eAAe;IACzB,eAAe;IACf,8CAA2B,CAAA;IAC3B,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,wCAAqB,CAAA;IACrB,SAAS;IACT,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,gDAA6B,CAAA;IAC7B,kCAAe,CAAA;AACjB,CAAC,EAXW,eAAe,KAAf,eAAe,QAW1B;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEnE,8BAA8B;AAE9B,MAAM,wBAAwB,GAAG;IAC/B,eAAe,CAAC,WAAW;IAC3B,eAAe,CAAC,MAAM;IACtB,eAAe,CAAC,IAAI;IACpB,eAAe,CAAC,QAAQ;CAChB,CAAC;AAIX,yGAAyG;AACzG,MAAM,CAAC,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CACjE,wBAAwB,CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9C,eAAe,CAAC,WAAW;IAC3B,eAAe,CAAC,MAAM;IACtB,eAAe,CAAC,IAAI;IACpB,eAAe,CAAC,QAAQ;CACzB,CAAC,CAAC;AAEH,iCAAiC;AAEjC;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,uCAAiB,CAAA;AACnB,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare enum ConditionOperator {
3
+ EQ = "eq",
4
+ NEQ = "neq",
5
+ CONTAINS = "contains",
6
+ GT = "gt",
7
+ GTE = "gte",
8
+ LT = "lt",
9
+ LTE = "lte",
10
+ EXISTS = "exists"
11
+ }
12
+ export declare const ConditionOperatorSchema: z.ZodNativeEnum<typeof ConditionOperator>;
13
+ export declare const VALUE_LESS_OPERATORS: ReadonlySet<ConditionOperator>;
14
+ export interface OperatorDescriptor {
15
+ readonly value: ConditionOperator;
16
+ readonly label: string;
17
+ readonly valueType: 'string' | 'number' | 'boolean' | 'none';
18
+ }
19
+ export declare const OPERATOR_DESCRIPTORS: readonly OperatorDescriptor[];
20
+ //# sourceMappingURL=operators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../src/types/operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oBAAY,iBAAiB;IAC3B,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,uBAAuB,2CAAkC,CAAC;AAEvE,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,iBAAiB,CAE9D,CAAC;AAIH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;CAC9D;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,kBAAkB,EAS7D,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export var ConditionOperator;
3
+ (function (ConditionOperator) {
4
+ ConditionOperator["EQ"] = "eq";
5
+ ConditionOperator["NEQ"] = "neq";
6
+ ConditionOperator["CONTAINS"] = "contains";
7
+ ConditionOperator["GT"] = "gt";
8
+ ConditionOperator["GTE"] = "gte";
9
+ ConditionOperator["LT"] = "lt";
10
+ ConditionOperator["LTE"] = "lte";
11
+ ConditionOperator["EXISTS"] = "exists";
12
+ })(ConditionOperator || (ConditionOperator = {}));
13
+ export const ConditionOperatorSchema = z.nativeEnum(ConditionOperator);
14
+ export const VALUE_LESS_OPERATORS = new Set([
15
+ ConditionOperator.EXISTS,
16
+ ]);
17
+ export const OPERATOR_DESCRIPTORS = [
18
+ { value: ConditionOperator.EQ, label: 'equals', valueType: 'string' },
19
+ { value: ConditionOperator.NEQ, label: 'does not equal', valueType: 'string' },
20
+ { value: ConditionOperator.CONTAINS, label: 'contains', valueType: 'string' },
21
+ { value: ConditionOperator.GT, label: 'is greater than', valueType: 'number' },
22
+ { value: ConditionOperator.GTE, label: 'is greater than or equal to', valueType: 'number' },
23
+ { value: ConditionOperator.LT, label: 'is less than', valueType: 'number' },
24
+ { value: ConditionOperator.LTE, label: 'is less than or equal to', valueType: 'number' },
25
+ { value: ConditionOperator.EXISTS, label: 'exists', valueType: 'none' },
26
+ ];
27
+ //# sourceMappingURL=operators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operators.js","sourceRoot":"","sources":["../../src/types/operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAN,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,8BAAS,CAAA;IACT,gCAAW,CAAA;IACX,0CAAqB,CAAA;IACrB,8BAAS,CAAA;IACT,gCAAW,CAAA;IACX,8BAAS,CAAA;IACT,gCAAW,CAAA;IACX,sCAAiB,CAAA;AACnB,CAAC,EATW,iBAAiB,KAAjB,iBAAiB,QAS5B;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAmC,IAAI,GAAG,CAAC;IAC1E,iBAAiB,CAAC,MAAM;CACzB,CAAC,CAAC;AAUH,MAAM,CAAC,MAAM,oBAAoB,GAAkC;IACjE,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;IACrE,EAAE,KAAK,EAAE,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE;IAC9E,EAAE,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE;IAC7E,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,QAAQ,EAAE;IAC9E,EAAE,KAAK,EAAE,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,6BAA6B,EAAE,SAAS,EAAE,QAAQ,EAAE;IAC3F,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE;IAC3E,EAAE,KAAK,EAAE,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,0BAA0B,EAAE,SAAS,EAAE,QAAQ,EAAE;IACxF,EAAE,KAAK,EAAE,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE;CACxE,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * PausePath — a tree-structured position for pause/resume.
3
+ *
4
+ * Replaces the flat `currentStepIndex: number` with a full tree address
5
+ * that supports pausing inside nested branches (CONDITIONAL, SWITCH, LOOP).
6
+ *
7
+ * Example: step 2 is CONDITIONAL, paused inside `if_true` branch at sub-step 1:
8
+ * ```
9
+ * [
10
+ * { stepIndex: 2 },
11
+ * { stepIndex: 1, branch: { stepId: 'cond_1', branchKey: 'if_true' } }
12
+ * ]
13
+ * ```
14
+ */
15
+ export interface PausePathSegment {
16
+ stepIndex: number;
17
+ branch?: {
18
+ stepId: string;
19
+ branchKey: string;
20
+ };
21
+ }
22
+ export type PausePath = PausePathSegment[];
23
+ //# sourceMappingURL=pause-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause-path.d.ts","sourceRoot":"","sources":["../../src/types/pause-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,MAAM,SAAS,GAAG,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pause-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause-path.js","sourceRoot":"","sources":["../../src/types/pause-path.ts"],"names":[],"mappings":""}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * PauseState — describes what the UI should render when an execution is paused.
3
+ *
4
+ * Compositional model: three orthogonal sections — display, form, actions.
5
+ * The UI renders whatever sections are present:
6
+ *
7
+ * - `display` — read-only data sections (key-value pairs)
8
+ * - `form` — editable form with typed fields and optional defaults
9
+ * - `actions` — buttons (defaults to Approve + Reject if omitted)
10
+ *
11
+ * Steps that pause execution (via `ctx.pause()`) attach a `PauseState`
12
+ * in the `statePatch` to tell the frontend what interaction is needed.
13
+ */
14
+ export interface PauseDisplaySection {
15
+ label: string;
16
+ value: unknown;
17
+ }
18
+ export interface PauseFormFieldOption {
19
+ label: string;
20
+ value: string;
21
+ }
22
+ export type PauseFormField = {
23
+ type: 'text';
24
+ name: string;
25
+ label: string;
26
+ required?: boolean;
27
+ description?: string;
28
+ placeholder?: string;
29
+ defaultValue?: string;
30
+ } | {
31
+ type: 'textarea';
32
+ name: string;
33
+ label: string;
34
+ required?: boolean;
35
+ description?: string;
36
+ placeholder?: string;
37
+ defaultValue?: string;
38
+ rows?: number;
39
+ } | {
40
+ type: 'number';
41
+ name: string;
42
+ label: string;
43
+ required?: boolean;
44
+ description?: string;
45
+ placeholder?: string;
46
+ defaultValue?: number;
47
+ min?: number;
48
+ max?: number;
49
+ } | {
50
+ type: 'select';
51
+ name: string;
52
+ label: string;
53
+ required?: boolean;
54
+ description?: string;
55
+ placeholder?: string;
56
+ defaultValue?: string;
57
+ options: PauseFormFieldOption[];
58
+ allowCustomValue?: boolean;
59
+ } | {
60
+ type: 'checkbox';
61
+ name: string;
62
+ label: string;
63
+ required?: boolean;
64
+ description?: string;
65
+ defaultValue?: boolean;
66
+ };
67
+ export interface PauseForm {
68
+ fields: PauseFormField[];
69
+ description?: string;
70
+ }
71
+ export interface PauseAction {
72
+ key: string;
73
+ label: string;
74
+ style?: 'primary' | 'danger' | 'default' | undefined;
75
+ /** If true, cancels the execution instead of resuming. */
76
+ abort?: boolean | undefined;
77
+ /** If true, form values are included in the resume payload. Default true for non-abort actions. */
78
+ submitsForm?: boolean | undefined;
79
+ }
80
+ /**
81
+ * Structured category for UI routing/filtering. Lets the UI distinguish
82
+ * "tool needs approval" from "review the output before continuing" without
83
+ * parsing the human-readable reason string.
84
+ */
85
+ export type PauseCategory = 'approval' | 'input_required' | 'review';
86
+ export interface PauseState {
87
+ /** Human-readable reason the workflow is paused. */
88
+ reason: string;
89
+ /** Structured category — lets UI filter executions by pause type. */
90
+ category?: PauseCategory | undefined;
91
+ /** Prompt text shown above the interaction panel. */
92
+ prompt?: string | undefined;
93
+ /** Read-only data sections to display. */
94
+ display?: PauseDisplaySection[] | undefined;
95
+ /** Editable form with typed fields. */
96
+ form?: PauseForm | undefined;
97
+ /** Action buttons. Defaults to Approve (primary) + Reject (danger, abort) when omitted. */
98
+ actions?: PauseAction[] | undefined;
99
+ }
100
+ //# sourceMappingURL=pause-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause-state.d.ts","sourceRoot":"","sources":["../../src/types/pause-state.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * PauseState — describes what the UI should render when an execution is paused.
3
+ *
4
+ * Compositional model: three orthogonal sections — display, form, actions.
5
+ * The UI renders whatever sections are present:
6
+ *
7
+ * - `display` — read-only data sections (key-value pairs)
8
+ * - `form` — editable form with typed fields and optional defaults
9
+ * - `actions` — buttons (defaults to Approve + Reject if omitted)
10
+ *
11
+ * Steps that pause execution (via `ctx.pause()`) attach a `PauseState`
12
+ * in the `statePatch` to tell the frontend what interaction is needed.
13
+ */
14
+ export {};
15
+ //# sourceMappingURL=pause-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pause-state.js","sourceRoot":"","sources":["../../src/types/pause-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * ResumePayload — the unified shape for resuming a paused execution.
3
+ *
4
+ * One contract for every pause type:
5
+ * - Mid-execution agent pauses (tool approval, input required, user interrupted)
6
+ * - Review gates (`onComplete: 'review'`)
7
+ *
8
+ * The router validates incoming bodies into this shape; persistence stores it
9
+ * verbatim; the executor and step `onResume` handlers consume it.
10
+ */
11
+ import type { Attachment } from './attachment.js';
12
+ /**
13
+ * Alias for {@link Attachment} kept for clarity at call sites that historically
14
+ * said "resume attachment". The shape is shared across the framework.
15
+ */
16
+ export type ResumeAttachment = Attachment;
17
+ /**
18
+ * What the user decided.
19
+ * - `approve`: continue from a mid-pause OR advance past a review gate
20
+ * - `retry`: re-execute the current step with `priorState` + `feedback` (review gate)
21
+ * - `abort`: cancel the execution
22
+ */
23
+ export type ResumeAction = 'approve' | 'retry' | 'abort';
24
+ /** Payload from the host when resuming a paused execution. */
25
+ export interface ResumePayload {
26
+ action: ResumeAction;
27
+ /** User-provided text input (form feedback, instruction, additional context). */
28
+ feedback?: string;
29
+ /** Files uploaded alongside the feedback. Opaque references — host resolves. */
30
+ attachments?: ResumeAttachment[];
31
+ /** Step-specific extras from custom form fields. Opaque to the framework. */
32
+ data?: Record<string, unknown>;
33
+ }
34
+ //# sourceMappingURL=resume-payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume-payload.d.ts","sourceRoot":"","sources":["../../src/types/resume-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEzD,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * ResumePayload — the unified shape for resuming a paused execution.
3
+ *
4
+ * One contract for every pause type:
5
+ * - Mid-execution agent pauses (tool approval, input required, user interrupted)
6
+ * - Review gates (`onComplete: 'review'`)
7
+ *
8
+ * The router validates incoming bodies into this shape; persistence stores it
9
+ * verbatim; the executor and step `onResume` handlers consume it.
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=resume-payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume-payload.js","sourceRoot":"","sources":["../../src/types/resume-payload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare enum WorkflowStatus {
3
+ DRAFT = "DRAFT",
4
+ ACTIVE = "ACTIVE",
5
+ DISABLED = "DISABLED",
6
+ PENDING_APPROVAL = "PENDING_APPROVAL",
7
+ REJECTED = "REJECTED",
8
+ REVOKED = "REVOKED",
9
+ AUTO_REVOKED = "AUTO_REVOKED",
10
+ ARCHIVED = "ARCHIVED"
11
+ }
12
+ export declare const WorkflowStatusSchema: z.ZodNativeEnum<typeof WorkflowStatus>;
13
+ export declare function isLiveStatus(status: string): boolean;
14
+ export declare function isProposalStatus(status: string): boolean;
15
+ export declare function isTerminalProposalStatus(status: string): boolean;
16
+ export declare enum ExecutionStatus {
17
+ PENDING = "PENDING",
18
+ SCHEDULED = "SCHEDULED",
19
+ RUNNING = "RUNNING",
20
+ COMPLETED = "COMPLETED",
21
+ FAILED = "FAILED",
22
+ CANCELLED = "CANCELLED",
23
+ SKIPPED = "SKIPPED",
24
+ EXTERNAL_WAIT = "EXTERNAL_WAIT"
25
+ }
26
+ export declare const ExecutionStatusSchema: z.ZodNativeEnum<typeof ExecutionStatus>;
27
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/types/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,gBAAgB,qBAAqB;IACrC,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,oBAAoB,wCAA+B,CAAC;AAEjE,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAIpD;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAQxD;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAMhE;AAED,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,aAAa,kBAAkB;CAChC;AAED,eAAO,MAAM,qBAAqB,yCAAgC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ export var WorkflowStatus;
3
+ (function (WorkflowStatus) {
4
+ WorkflowStatus["DRAFT"] = "DRAFT";
5
+ WorkflowStatus["ACTIVE"] = "ACTIVE";
6
+ WorkflowStatus["DISABLED"] = "DISABLED";
7
+ WorkflowStatus["PENDING_APPROVAL"] = "PENDING_APPROVAL";
8
+ WorkflowStatus["REJECTED"] = "REJECTED";
9
+ WorkflowStatus["REVOKED"] = "REVOKED";
10
+ WorkflowStatus["AUTO_REVOKED"] = "AUTO_REVOKED";
11
+ WorkflowStatus["ARCHIVED"] = "ARCHIVED";
12
+ })(WorkflowStatus || (WorkflowStatus = {}));
13
+ export const WorkflowStatusSchema = z.nativeEnum(WorkflowStatus);
14
+ export function isLiveStatus(status) {
15
+ return (status === WorkflowStatus.ACTIVE || status === WorkflowStatus.DISABLED);
16
+ }
17
+ export function isProposalStatus(status) {
18
+ return (status === WorkflowStatus.DRAFT ||
19
+ status === WorkflowStatus.PENDING_APPROVAL ||
20
+ status === WorkflowStatus.REJECTED ||
21
+ status === WorkflowStatus.REVOKED ||
22
+ status === WorkflowStatus.AUTO_REVOKED);
23
+ }
24
+ export function isTerminalProposalStatus(status) {
25
+ return (status === WorkflowStatus.REJECTED ||
26
+ status === WorkflowStatus.REVOKED ||
27
+ status === WorkflowStatus.AUTO_REVOKED);
28
+ }
29
+ export var ExecutionStatus;
30
+ (function (ExecutionStatus) {
31
+ ExecutionStatus["PENDING"] = "PENDING";
32
+ ExecutionStatus["SCHEDULED"] = "SCHEDULED";
33
+ ExecutionStatus["RUNNING"] = "RUNNING";
34
+ ExecutionStatus["COMPLETED"] = "COMPLETED";
35
+ ExecutionStatus["FAILED"] = "FAILED";
36
+ ExecutionStatus["CANCELLED"] = "CANCELLED";
37
+ ExecutionStatus["SKIPPED"] = "SKIPPED";
38
+ ExecutionStatus["EXTERNAL_WAIT"] = "EXTERNAL_WAIT";
39
+ })(ExecutionStatus || (ExecutionStatus = {}));
40
+ export const ExecutionStatusSchema = z.nativeEnum(ExecutionStatus);
41
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/types/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,uCAAqB,CAAA;IACrB,uDAAqC,CAAA;IACrC,uCAAqB,CAAA;IACrB,qCAAmB,CAAA;IACnB,+CAA6B,CAAA;IAC7B,uCAAqB,CAAA;AACvB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEjE,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,CACL,MAAM,KAAK,cAAc,CAAC,MAAM,IAAI,MAAM,KAAK,cAAc,CAAC,QAAQ,CACvE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,CACL,MAAM,KAAK,cAAc,CAAC,KAAK;QAC/B,MAAM,KAAK,cAAc,CAAC,gBAAgB;QAC1C,MAAM,KAAK,cAAc,CAAC,QAAQ;QAClC,MAAM,KAAK,cAAc,CAAC,OAAO;QACjC,MAAM,KAAK,cAAc,CAAC,YAAY,CACvC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,MAAc;IACrD,OAAO,CACL,MAAM,KAAK,cAAc,CAAC,QAAQ;QAClC,MAAM,KAAK,cAAc,CAAC,OAAO;QACjC,MAAM,KAAK,cAAc,CAAC,YAAY,CACvC,CAAC;AACJ,CAAC;AAED,MAAM,CAAN,IAAY,eASX;AATD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;IACjB,0CAAuB,CAAA;IACvB,sCAAmB,CAAA;IACnB,kDAA+B,CAAA;AACjC,CAAC,EATW,eAAe,KAAf,eAAe,QAS1B;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Step progress events — emitted via `ctx.emit()` for real-time observability.
3
+ *
4
+ * Events are fire-and-forget: they never block step execution.
5
+ * If persistence fails, the event is lost but the step continues.
6
+ */
7
+ export type StepProgressEventType = 'log' | 'tool_call' | 'thinking' | 'progress' | 'substep' | 'error';
8
+ export interface StepProgressEvent {
9
+ type: StepProgressEventType;
10
+ data: Record<string, unknown>;
11
+ /** Defaults to Date.now() if not provided. */
12
+ timestamp?: number;
13
+ }
14
+ /** Persisted step event record — returned by getStepEvents(). */
15
+ export interface StepEventRecord {
16
+ id: string;
17
+ type: string;
18
+ /** JSON string of event data. */
19
+ data: string;
20
+ createdAt: Date;
21
+ }
22
+ //# sourceMappingURL=step-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-events.d.ts","sourceRoot":"","sources":["../../src/types/step-events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,qBAAqB,GAC7B,KAAK,GACL,WAAW,GACX,UAAU,GACV,UAAU,GACV,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Step progress events — emitted via `ctx.emit()` for real-time observability.
3
+ *
4
+ * Events are fire-and-forget: they never block step execution.
5
+ * If persistence fails, the event is lost but the step continues.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=step-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-events.js","sourceRoot":"","sources":["../../src/types/step-events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,12 @@
1
+ import type { BuiltinStepType } from './known-types.js';
2
+ /**
3
+ * Step type identifier.
4
+ *
5
+ * SDK ships `BuiltinStepType` (CONDITIONAL, SWITCH, CODE, ...).
6
+ * Host adds domain-specific step types as plain strings (e.g. 'SEND_MESSAGE').
7
+ *
8
+ * The `(string & {})` trick preserves IDE autocomplete for known types
9
+ * while still accepting arbitrary host strings.
10
+ */
11
+ export type StepType = BuiltinStepType | (string & {});
12
+ //# sourceMappingURL=step-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-types.d.ts","sourceRoot":"","sources":["../../src/types/step-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,eAAe,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=step-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-types.js","sourceRoot":"","sources":["../../src/types/step-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import type { BuiltinTriggerType } from './known-types.js';
2
+ /**
3
+ * Trigger type identifier.
4
+ *
5
+ * SDK ships `BuiltinTriggerType` (EVENT, WEBHOOK, CRON, MANUAL).
6
+ * Host adds domain-specific triggers as plain strings (e.g. 'TICKET_CREATED').
7
+ *
8
+ * The `(string & {})` trick preserves IDE autocomplete for known types
9
+ * while still accepting arbitrary host strings.
10
+ */
11
+ export type TriggerType = BuiltinTriggerType | (string & {});
12
+ //# sourceMappingURL=trigger-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger-types.d.ts","sourceRoot":"","sources":["../../src/types/trigger-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=trigger-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger-types.js","sourceRoot":"","sources":["../../src/types/trigger-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ export declare enum ValidationIssueCode {
3
+ SHAPE = "shape",
4
+ UNKNOWN_REFERENCE = "unknownReference",
5
+ FORWARD_REFERENCE = "forwardReference",
6
+ TYPE_MISMATCH = "typeMismatch",
7
+ DUPLICATE_STEP_ID = "duplicateStepId"
8
+ }
9
+ export declare const ValidationIssueCodeSchema: z.ZodNativeEnum<typeof ValidationIssueCode>;
10
+ export interface ValidationIssue {
11
+ path: string;
12
+ code: ValidationIssueCode;
13
+ message: string;
14
+ }
15
+ export interface ValidationResult {
16
+ valid: boolean;
17
+ issues: ValidationIssue[];
18
+ }
19
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/types/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,iBAAiB,qBAAqB;IACtC,iBAAiB,qBAAqB;IACtC,aAAa,iBAAiB;IAC9B,iBAAiB,oBAAoB;CACtC;AAED,eAAO,MAAM,yBAAyB,6CAAoC,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export var ValidationIssueCode;
3
+ (function (ValidationIssueCode) {
4
+ ValidationIssueCode["SHAPE"] = "shape";
5
+ ValidationIssueCode["UNKNOWN_REFERENCE"] = "unknownReference";
6
+ ValidationIssueCode["FORWARD_REFERENCE"] = "forwardReference";
7
+ ValidationIssueCode["TYPE_MISMATCH"] = "typeMismatch";
8
+ ValidationIssueCode["DUPLICATE_STEP_ID"] = "duplicateStepId";
9
+ })(ValidationIssueCode || (ValidationIssueCode = {}));
10
+ export const ValidationIssueCodeSchema = z.nativeEnum(ValidationIssueCode);
11
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/types/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,6DAAsC,CAAA;IACtC,6DAAsC,CAAA;IACtC,qDAA8B,CAAA;IAC9B,4DAAqC,CAAA;AACvC,CAAC,EANW,mBAAmB,KAAnB,mBAAmB,QAM9B;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC"}