@xemahq/dsl 0.1.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 (288) hide show
  1. package/LICENSE +201 -0
  2. package/dist/deliverable-spec/index.d.ts +3 -0
  3. package/dist/deliverable-spec/index.d.ts.map +1 -0
  4. package/dist/deliverable-spec/index.js +19 -0
  5. package/dist/deliverable-spec/index.js.map +1 -0
  6. package/dist/deliverable-spec/lib/schema.d.ts +151 -0
  7. package/dist/deliverable-spec/lib/schema.d.ts.map +1 -0
  8. package/dist/deliverable-spec/lib/schema.js +139 -0
  9. package/dist/deliverable-spec/lib/schema.js.map +1 -0
  10. package/dist/deliverable-spec/lib/types.d.ts +8 -0
  11. package/dist/deliverable-spec/lib/types.d.ts.map +1 -0
  12. package/dist/deliverable-spec/lib/types.js +3 -0
  13. package/dist/deliverable-spec/lib/types.js.map +1 -0
  14. package/dist/payload-codec/index.d.ts +8 -0
  15. package/dist/payload-codec/index.d.ts.map +1 -0
  16. package/dist/payload-codec/index.js +27 -0
  17. package/dist/payload-codec/index.js.map +1 -0
  18. package/dist/payload-codec/lib/blob-store.d.ts +37 -0
  19. package/dist/payload-codec/lib/blob-store.d.ts.map +1 -0
  20. package/dist/payload-codec/lib/blob-store.js +0 -0
  21. package/dist/payload-codec/lib/blob-store.js.map +1 -0
  22. package/dist/payload-codec/lib/codec-context.d.ts +6 -0
  23. package/dist/payload-codec/lib/codec-context.d.ts.map +1 -0
  24. package/dist/payload-codec/lib/codec-context.js +16 -0
  25. package/dist/payload-codec/lib/codec-context.js.map +1 -0
  26. package/dist/payload-codec/lib/codec.d.ts +51 -0
  27. package/dist/payload-codec/lib/codec.d.ts.map +1 -0
  28. package/dist/payload-codec/lib/codec.js +330 -0
  29. package/dist/payload-codec/lib/codec.js.map +1 -0
  30. package/dist/payload-codec/lib/enums.d.ts +18 -0
  31. package/dist/payload-codec/lib/enums.d.ts.map +1 -0
  32. package/dist/payload-codec/lib/enums.js +23 -0
  33. package/dist/payload-codec/lib/enums.js.map +1 -0
  34. package/dist/payload-codec/lib/errors.d.ts +18 -0
  35. package/dist/payload-codec/lib/errors.d.ts.map +1 -0
  36. package/dist/payload-codec/lib/errors.js +39 -0
  37. package/dist/payload-codec/lib/errors.js.map +1 -0
  38. package/dist/payload-codec/lib/http-blob-store.d.ts +21 -0
  39. package/dist/payload-codec/lib/http-blob-store.d.ts.map +1 -0
  40. package/dist/payload-codec/lib/http-blob-store.js +139 -0
  41. package/dist/payload-codec/lib/http-blob-store.js.map +1 -0
  42. package/dist/payload-codec/lib/lru-cache.d.ts +12 -0
  43. package/dist/payload-codec/lib/lru-cache.d.ts.map +1 -0
  44. package/dist/payload-codec/lib/lru-cache.js +59 -0
  45. package/dist/payload-codec/lib/lru-cache.js.map +1 -0
  46. package/dist/schema/action.schema.json +181 -0
  47. package/dist/schema/reusable-workflow.schema.json +46 -0
  48. package/dist/schema/workflow.schema.json +373 -0
  49. package/dist/workflow/index.d.ts +14 -0
  50. package/dist/workflow/index.d.ts.map +1 -0
  51. package/dist/workflow/index.js +49 -0
  52. package/dist/workflow/index.js.map +1 -0
  53. package/dist/workflow/lib/action-input-validator.d.ts +10 -0
  54. package/dist/workflow/lib/action-input-validator.d.ts.map +1 -0
  55. package/dist/workflow/lib/action-input-validator.js +69 -0
  56. package/dist/workflow/lib/action-input-validator.js.map +1 -0
  57. package/dist/workflow/lib/compiler/action-shape.d.ts +5 -0
  58. package/dist/workflow/lib/compiler/action-shape.d.ts.map +1 -0
  59. package/dist/workflow/lib/compiler/action-shape.js +43 -0
  60. package/dist/workflow/lib/compiler/action-shape.js.map +1 -0
  61. package/dist/workflow/lib/compiler/canonical-json.d.ts +3 -0
  62. package/dist/workflow/lib/compiler/canonical-json.d.ts.map +1 -0
  63. package/dist/workflow/lib/compiler/canonical-json.js +45 -0
  64. package/dist/workflow/lib/compiler/canonical-json.js.map +1 -0
  65. package/dist/workflow/lib/compiler/compile.d.ts +4 -0
  66. package/dist/workflow/lib/compiler/compile.d.ts.map +1 -0
  67. package/dist/workflow/lib/compiler/compile.js +794 -0
  68. package/dist/workflow/lib/compiler/compile.js.map +1 -0
  69. package/dist/workflow/lib/compiler/concurrency.d.ts +5 -0
  70. package/dist/workflow/lib/compiler/concurrency.d.ts.map +1 -0
  71. package/dist/workflow/lib/compiler/concurrency.js +104 -0
  72. package/dist/workflow/lib/compiler/concurrency.js.map +1 -0
  73. package/dist/workflow/lib/compiler/dag.d.ts +10 -0
  74. package/dist/workflow/lib/compiler/dag.d.ts.map +1 -0
  75. package/dist/workflow/lib/compiler/dag.js +74 -0
  76. package/dist/workflow/lib/compiler/dag.js.map +1 -0
  77. package/dist/workflow/lib/compiler/index.d.ts +6 -0
  78. package/dist/workflow/lib/compiler/index.d.ts.map +1 -0
  79. package/dist/workflow/lib/compiler/index.js +14 -0
  80. package/dist/workflow/lib/compiler/index.js.map +1 -0
  81. package/dist/workflow/lib/compiler/inputs.d.ts +4 -0
  82. package/dist/workflow/lib/compiler/inputs.d.ts.map +1 -0
  83. package/dist/workflow/lib/compiler/inputs.js +108 -0
  84. package/dist/workflow/lib/compiler/inputs.js.map +1 -0
  85. package/dist/workflow/lib/compiler/installation-resource-validator.d.ts +9 -0
  86. package/dist/workflow/lib/compiler/installation-resource-validator.d.ts.map +1 -0
  87. package/dist/workflow/lib/compiler/installation-resource-validator.js +76 -0
  88. package/dist/workflow/lib/compiler/installation-resource-validator.js.map +1 -0
  89. package/dist/workflow/lib/compiler/manifest-source.d.ts +4 -0
  90. package/dist/workflow/lib/compiler/manifest-source.d.ts.map +1 -0
  91. package/dist/workflow/lib/compiler/manifest-source.js +100 -0
  92. package/dist/workflow/lib/compiler/manifest-source.js.map +1 -0
  93. package/dist/workflow/lib/compiler/matrix.d.ts +4 -0
  94. package/dist/workflow/lib/compiler/matrix.d.ts.map +1 -0
  95. package/dist/workflow/lib/compiler/matrix.js +76 -0
  96. package/dist/workflow/lib/compiler/matrix.js.map +1 -0
  97. package/dist/workflow/lib/compiler/mount-plan.d.ts +4 -0
  98. package/dist/workflow/lib/compiler/mount-plan.d.ts.map +1 -0
  99. package/dist/workflow/lib/compiler/mount-plan.js +96 -0
  100. package/dist/workflow/lib/compiler/mount-plan.js.map +1 -0
  101. package/dist/workflow/lib/compiler/payload-reach-in.d.ts +14 -0
  102. package/dist/workflow/lib/compiler/payload-reach-in.d.ts.map +1 -0
  103. package/dist/workflow/lib/compiler/payload-reach-in.js +273 -0
  104. package/dist/workflow/lib/compiler/payload-reach-in.js.map +1 -0
  105. package/dist/workflow/lib/compiler/permissions.d.ts +6 -0
  106. package/dist/workflow/lib/compiler/permissions.d.ts.map +1 -0
  107. package/dist/workflow/lib/compiler/permissions.js +43 -0
  108. package/dist/workflow/lib/compiler/permissions.js.map +1 -0
  109. package/dist/workflow/lib/compiler/retry-timeout.d.ts +6 -0
  110. package/dist/workflow/lib/compiler/retry-timeout.d.ts.map +1 -0
  111. package/dist/workflow/lib/compiler/retry-timeout.js +64 -0
  112. package/dist/workflow/lib/compiler/retry-timeout.js.map +1 -0
  113. package/dist/workflow/lib/compiler/review-step.d.ts +18 -0
  114. package/dist/workflow/lib/compiler/review-step.d.ts.map +1 -0
  115. package/dist/workflow/lib/compiler/review-step.js +247 -0
  116. package/dist/workflow/lib/compiler/review-step.js.map +1 -0
  117. package/dist/workflow/lib/compiler/types.d.ts +42 -0
  118. package/dist/workflow/lib/compiler/types.d.ts.map +1 -0
  119. package/dist/workflow/lib/compiler/types.js +3 -0
  120. package/dist/workflow/lib/compiler/types.js.map +1 -0
  121. package/dist/workflow/lib/compiler/variable-requirements.d.ts +5 -0
  122. package/dist/workflow/lib/compiler/variable-requirements.d.ts.map +1 -0
  123. package/dist/workflow/lib/compiler/variable-requirements.js +119 -0
  124. package/dist/workflow/lib/compiler/variable-requirements.js.map +1 -0
  125. package/dist/workflow/lib/deliverable-spec-keys.d.ts +3 -0
  126. package/dist/workflow/lib/deliverable-spec-keys.d.ts.map +1 -0
  127. package/dist/workflow/lib/deliverable-spec-keys.js +90 -0
  128. package/dist/workflow/lib/deliverable-spec-keys.js.map +1 -0
  129. package/dist/workflow/lib/dispatch-inputs/index.d.ts +23 -0
  130. package/dist/workflow/lib/dispatch-inputs/index.d.ts.map +1 -0
  131. package/dist/workflow/lib/dispatch-inputs/index.js +106 -0
  132. package/dist/workflow/lib/dispatch-inputs/index.js.map +1 -0
  133. package/dist/workflow/lib/dispatch-inputs/to-json-schema.d.ts +3 -0
  134. package/dist/workflow/lib/dispatch-inputs/to-json-schema.d.ts.map +1 -0
  135. package/dist/workflow/lib/dispatch-inputs/to-json-schema.js +43 -0
  136. package/dist/workflow/lib/dispatch-inputs/to-json-schema.js.map +1 -0
  137. package/dist/workflow/lib/duration.d.ts +2 -0
  138. package/dist/workflow/lib/duration.d.ts.map +1 -0
  139. package/dist/workflow/lib/duration.js +26 -0
  140. package/dist/workflow/lib/duration.js.map +1 -0
  141. package/dist/workflow/lib/errors.d.ts +9 -0
  142. package/dist/workflow/lib/errors.d.ts.map +1 -0
  143. package/dist/workflow/lib/errors.js +28 -0
  144. package/dist/workflow/lib/errors.js.map +1 -0
  145. package/dist/workflow/lib/expression/ast.d.ts +61 -0
  146. package/dist/workflow/lib/expression/ast.d.ts.map +1 -0
  147. package/dist/workflow/lib/expression/ast.js +34 -0
  148. package/dist/workflow/lib/expression/ast.js.map +1 -0
  149. package/dist/workflow/lib/expression/context.d.ts +63 -0
  150. package/dist/workflow/lib/expression/context.d.ts.map +1 -0
  151. package/dist/workflow/lib/expression/context.js +32 -0
  152. package/dist/workflow/lib/expression/context.js.map +1 -0
  153. package/dist/workflow/lib/expression/evaluator.d.ts +5 -0
  154. package/dist/workflow/lib/expression/evaluator.d.ts.map +1 -0
  155. package/dist/workflow/lib/expression/evaluator.js +291 -0
  156. package/dist/workflow/lib/expression/evaluator.js.map +1 -0
  157. package/dist/workflow/lib/expression/index.d.ts +9 -0
  158. package/dist/workflow/lib/expression/index.d.ts.map +1 -0
  159. package/dist/workflow/lib/expression/index.js +26 -0
  160. package/dist/workflow/lib/expression/index.js.map +1 -0
  161. package/dist/workflow/lib/expression/interpolation.d.ts +9 -0
  162. package/dist/workflow/lib/expression/interpolation.d.ts.map +1 -0
  163. package/dist/workflow/lib/expression/interpolation.js +51 -0
  164. package/dist/workflow/lib/expression/interpolation.js.map +1 -0
  165. package/dist/workflow/lib/expression/parser.d.ts +4 -0
  166. package/dist/workflow/lib/expression/parser.d.ts.map +1 -0
  167. package/dist/workflow/lib/expression/parser.js +203 -0
  168. package/dist/workflow/lib/expression/parser.js.map +1 -0
  169. package/dist/workflow/lib/expression/template.d.ts +18 -0
  170. package/dist/workflow/lib/expression/template.d.ts.map +1 -0
  171. package/dist/workflow/lib/expression/template.js +63 -0
  172. package/dist/workflow/lib/expression/template.js.map +1 -0
  173. package/dist/workflow/lib/expression/tokenizer.d.ts +3 -0
  174. package/dist/workflow/lib/expression/tokenizer.d.ts.map +1 -0
  175. package/dist/workflow/lib/expression/tokenizer.js +153 -0
  176. package/dist/workflow/lib/expression/tokenizer.js.map +1 -0
  177. package/dist/workflow/lib/expression/tokens.d.ts +25 -0
  178. package/dist/workflow/lib/expression/tokens.d.ts.map +1 -0
  179. package/dist/workflow/lib/expression/tokens.js +24 -0
  180. package/dist/workflow/lib/expression/tokens.js.map +1 -0
  181. package/dist/workflow/lib/expression/walk-artifact-refs.d.ts +5 -0
  182. package/dist/workflow/lib/expression/walk-artifact-refs.d.ts.map +1 -0
  183. package/dist/workflow/lib/expression/walk-artifact-refs.js +138 -0
  184. package/dist/workflow/lib/expression/walk-artifact-refs.js.map +1 -0
  185. package/dist/workflow/lib/installation-resource-kind.d.ts +14 -0
  186. package/dist/workflow/lib/installation-resource-kind.d.ts.map +1 -0
  187. package/dist/workflow/lib/installation-resource-kind.js +59 -0
  188. package/dist/workflow/lib/installation-resource-kind.js.map +1 -0
  189. package/dist/workflow/lib/schemas-loader.d.ts +4 -0
  190. package/dist/workflow/lib/schemas-loader.d.ts.map +1 -0
  191. package/dist/workflow/lib/schemas-loader.js +36 -0
  192. package/dist/workflow/lib/schemas-loader.js.map +1 -0
  193. package/dist/workflow/lib/serializer.d.ts +3 -0
  194. package/dist/workflow/lib/serializer.d.ts.map +1 -0
  195. package/dist/workflow/lib/serializer.js +15 -0
  196. package/dist/workflow/lib/serializer.js.map +1 -0
  197. package/dist/workflow/lib/types.d.ts +179 -0
  198. package/dist/workflow/lib/types.d.ts.map +1 -0
  199. package/dist/workflow/lib/types.js +3 -0
  200. package/dist/workflow/lib/types.js.map +1 -0
  201. package/dist/workflow/lib/validate.d.ts +8 -0
  202. package/dist/workflow/lib/validate.d.ts.map +1 -0
  203. package/dist/workflow/lib/validate.js +119 -0
  204. package/dist/workflow/lib/validate.js.map +1 -0
  205. package/dist/workspace-manifest/index.d.ts +6 -0
  206. package/dist/workspace-manifest/index.d.ts.map +1 -0
  207. package/dist/workspace-manifest/index.js +22 -0
  208. package/dist/workspace-manifest/index.js.map +1 -0
  209. package/dist/workspace-manifest/lib/compile.d.ts +8 -0
  210. package/dist/workspace-manifest/lib/compile.d.ts.map +1 -0
  211. package/dist/workspace-manifest/lib/compile.js +439 -0
  212. package/dist/workspace-manifest/lib/compile.js.map +1 -0
  213. package/dist/workspace-manifest/lib/interpolate.d.ts +12 -0
  214. package/dist/workspace-manifest/lib/interpolate.d.ts.map +1 -0
  215. package/dist/workspace-manifest/lib/interpolate.js +81 -0
  216. package/dist/workspace-manifest/lib/interpolate.js.map +1 -0
  217. package/dist/workspace-manifest/lib/resolve-extends.d.ts +10 -0
  218. package/dist/workspace-manifest/lib/resolve-extends.d.ts.map +1 -0
  219. package/dist/workspace-manifest/lib/resolve-extends.js +108 -0
  220. package/dist/workspace-manifest/lib/resolve-extends.js.map +1 -0
  221. package/dist/workspace-manifest/lib/schema.d.ts +710 -0
  222. package/dist/workspace-manifest/lib/schema.d.ts.map +1 -0
  223. package/dist/workspace-manifest/lib/schema.js +355 -0
  224. package/dist/workspace-manifest/lib/schema.js.map +1 -0
  225. package/dist/workspace-manifest/lib/types.d.ts +153 -0
  226. package/dist/workspace-manifest/lib/types.d.ts.map +1 -0
  227. package/dist/workspace-manifest/lib/types.js +10 -0
  228. package/dist/workspace-manifest/lib/types.js.map +1 -0
  229. package/package.json +79 -0
  230. package/schema/action.schema.json +181 -0
  231. package/schema/reusable-workflow.schema.json +46 -0
  232. package/schema/workflow.schema.json +373 -0
  233. package/src/deliverable-spec/index.ts +19 -0
  234. package/src/deliverable-spec/lib/schema.ts +248 -0
  235. package/src/deliverable-spec/lib/types.ts +26 -0
  236. package/src/payload-codec/index.ts +40 -0
  237. package/src/payload-codec/lib/blob-store.ts +0 -0
  238. package/src/payload-codec/lib/codec-context.ts +38 -0
  239. package/src/payload-codec/lib/codec.ts +593 -0
  240. package/src/payload-codec/lib/enums.ts +58 -0
  241. package/src/payload-codec/lib/errors.ts +54 -0
  242. package/src/payload-codec/lib/http-blob-store.ts +257 -0
  243. package/src/payload-codec/lib/lru-cache.ts +81 -0
  244. package/src/workflow/index.ts +98 -0
  245. package/src/workflow/lib/action-input-validator.ts +160 -0
  246. package/src/workflow/lib/compiler/action-shape.ts +71 -0
  247. package/src/workflow/lib/compiler/canonical-json.ts +53 -0
  248. package/src/workflow/lib/compiler/compile.ts +1518 -0
  249. package/src/workflow/lib/compiler/concurrency.ts +223 -0
  250. package/src/workflow/lib/compiler/dag.ts +108 -0
  251. package/src/workflow/lib/compiler/index.ts +10 -0
  252. package/src/workflow/lib/compiler/inputs.ts +199 -0
  253. package/src/workflow/lib/compiler/installation-resource-validator.ts +114 -0
  254. package/src/workflow/lib/compiler/manifest-source.ts +176 -0
  255. package/src/workflow/lib/compiler/matrix.ts +135 -0
  256. package/src/workflow/lib/compiler/mount-plan.ts +202 -0
  257. package/src/workflow/lib/compiler/payload-reach-in.ts +497 -0
  258. package/src/workflow/lib/compiler/permissions.ts +64 -0
  259. package/src/workflow/lib/compiler/retry-timeout.ts +105 -0
  260. package/src/workflow/lib/compiler/review-step.ts +517 -0
  261. package/src/workflow/lib/compiler/types.ts +170 -0
  262. package/src/workflow/lib/compiler/variable-requirements.ts +208 -0
  263. package/src/workflow/lib/deliverable-spec-keys.ts +109 -0
  264. package/src/workflow/lib/dispatch-inputs/index.ts +160 -0
  265. package/src/workflow/lib/dispatch-inputs/to-json-schema.ts +60 -0
  266. package/src/workflow/lib/duration.ts +48 -0
  267. package/src/workflow/lib/errors.ts +37 -0
  268. package/src/workflow/lib/expression/ast.ts +108 -0
  269. package/src/workflow/lib/expression/context.ts +148 -0
  270. package/src/workflow/lib/expression/evaluator.ts +492 -0
  271. package/src/workflow/lib/expression/index.ts +28 -0
  272. package/src/workflow/lib/expression/interpolation.ts +84 -0
  273. package/src/workflow/lib/expression/parser.ts +264 -0
  274. package/src/workflow/lib/expression/template.ts +117 -0
  275. package/src/workflow/lib/expression/tokenizer.ts +200 -0
  276. package/src/workflow/lib/expression/tokens.ts +30 -0
  277. package/src/workflow/lib/expression/walk-artifact-refs.ts +232 -0
  278. package/src/workflow/lib/installation-resource-kind.ts +107 -0
  279. package/src/workflow/lib/schemas-loader.ts +64 -0
  280. package/src/workflow/lib/serializer.ts +30 -0
  281. package/src/workflow/lib/types.ts +361 -0
  282. package/src/workflow/lib/validate.ts +199 -0
  283. package/src/workspace-manifest/index.ts +27 -0
  284. package/src/workspace-manifest/lib/compile.ts +608 -0
  285. package/src/workspace-manifest/lib/interpolate.ts +140 -0
  286. package/src/workspace-manifest/lib/resolve-extends.ts +260 -0
  287. package/src/workspace-manifest/lib/schema.ts +612 -0
  288. package/src/workspace-manifest/lib/types.ts +392 -0
@@ -0,0 +1,373 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://xema.dev/schemas/workflow/v1alpha1/Workflow.json",
4
+ "title": "Xema Workflow",
5
+ "description": "Authoring shape for a Xema workflow document (system or custom).",
6
+ "type": "object",
7
+ "required": ["apiVersion", "kind", "metadata", "on", "jobs"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "apiVersion": {
11
+ "type": "string",
12
+ "const": "xema.dev/workflow/v1alpha1"
13
+ },
14
+ "kind": {
15
+ "type": "string",
16
+ "const": "Workflow"
17
+ },
18
+ "metadata": { "$ref": "#/$defs/Metadata" },
19
+ "on": { "$ref": "#/$defs/Triggers" },
20
+ "concurrency": { "$ref": "#/$defs/Concurrency" },
21
+ "defaults": { "$ref": "#/$defs/Defaults" },
22
+ "permissions": { "$ref": "#/$defs/Permissions" },
23
+ "vars": {
24
+ "type": "object",
25
+ "description": "Static key/value pairs bound into every job's expression context as `vars.*`.",
26
+ "additionalProperties": true
27
+ },
28
+ "requires": { "$ref": "#/$defs/Requires" },
29
+ "jobs": {
30
+ "type": "object",
31
+ "minProperties": 1,
32
+ "additionalProperties": { "$ref": "#/$defs/Job" },
33
+ "propertyNames": { "$ref": "#/$defs/JobKey" }
34
+ },
35
+ "outputs": {
36
+ "type": "object",
37
+ "description": "Workflow-level named outputs. Each key references a (job, outputName) pair via fromJob/fromOutput and declares the kind of value surfaced.",
38
+ "additionalProperties": { "$ref": "#/$defs/WorkflowOutput" },
39
+ "propertyNames": { "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,62}$" }
40
+ }
41
+ },
42
+ "$defs": {
43
+ "Metadata": {
44
+ "type": "object",
45
+ "required": ["name", "version"],
46
+ "additionalProperties": false,
47
+ "properties": {
48
+ "name": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
49
+ "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[A-Za-z0-9.-]+)?$" },
50
+ "title": { "type": "string", "maxLength": 120 },
51
+ "description": { "type": "string", "maxLength": 4000 },
52
+ "category": { "type": "string", "minLength": 1, "maxLength": 120 },
53
+ "tags": {
54
+ "type": "array",
55
+ "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
56
+ "uniqueItems": true
57
+ }
58
+ }
59
+ },
60
+ "JobKey": {
61
+ "type": "string",
62
+ "pattern": "^[a-z][a-z0-9_-]{0,62}$"
63
+ },
64
+ "Requires": {
65
+ "type": "object",
66
+ "description": "Wallet (variable + secret bundle) contracts the workflow needs at dispatch time. Resolved by the engine against project-registry-api before the run is started.",
67
+ "additionalProperties": false,
68
+ "properties": {
69
+ "wallets": {
70
+ "type": "array",
71
+ "minItems": 1,
72
+ "maxItems": 32,
73
+ "uniqueItems": true,
74
+ "items": {
75
+ "type": "string",
76
+ "pattern": "^[a-z][a-z0-9-]{0,62}$",
77
+ "description": "Wallet name unique within the workflow's project/org scope."
78
+ }
79
+ },
80
+ "integrations": {
81
+ "type": "array",
82
+ "minItems": 1,
83
+ "maxItems": 16,
84
+ "description": "Integration adapter kinds the workflow consumes. Biome-shipped workflows declare these so biome-host-api can cross-validate against the biome's manifest at boot.",
85
+ "items": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": ["adapterKind", "capabilities"],
89
+ "properties": {
90
+ "adapterKind": {
91
+ "type": "string",
92
+ "pattern": "^[a-z][a-z0-9-]*$",
93
+ "description": "Adapter kind slug (e.g. 'scm', 'tracker', 'documentation')."
94
+ },
95
+ "capabilities": {
96
+ "type": "array",
97
+ "minItems": 1,
98
+ "uniqueItems": true,
99
+ "items": {
100
+ "type": "string",
101
+ "pattern": "^[a-z]+(\\.[a-z][a-z0-9-]*)+$",
102
+ "description": "Capability slug in <domain>.<verb-qualifier> form."
103
+ }
104
+ },
105
+ "optional": {
106
+ "type": "boolean",
107
+ "description": "Whether the workflow can degrade if the integration is unbound."
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ },
114
+ "Triggers": {
115
+ "type": "object",
116
+ "description": "At least one trigger must be declared.",
117
+ "minProperties": 1,
118
+ "additionalProperties": false,
119
+ "properties": {
120
+ "workflow_dispatch": { "$ref": "#/$defs/WorkflowDispatchTrigger" },
121
+ "schedule": {
122
+ "type": "array",
123
+ "minItems": 1,
124
+ "maxItems": 16,
125
+ "items": { "$ref": "#/$defs/ScheduleTrigger" }
126
+ },
127
+ "webhook": {
128
+ "type": "array",
129
+ "minItems": 1,
130
+ "maxItems": 32,
131
+ "items": { "$ref": "#/$defs/WebhookTrigger" }
132
+ },
133
+ "workflow_call": { "$ref": "#/$defs/WorkflowCallTrigger" }
134
+ }
135
+ },
136
+ "WorkflowDispatchTrigger": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "properties": {
140
+ "inputs": { "$ref": "#/$defs/InputSchemaMap" }
141
+ }
142
+ },
143
+ "ScheduleTrigger": {
144
+ "type": "object",
145
+ "required": ["cron"],
146
+ "additionalProperties": false,
147
+ "properties": {
148
+ "cron": {
149
+ "type": "string",
150
+ "description": "Standard 5-field cron expression.",
151
+ "pattern": "^[^\\s]+\\s+[^\\s]+\\s+[^\\s]+\\s+[^\\s]+\\s+[^\\s]+$"
152
+ },
153
+ "timezone": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9+_/-]+$" },
154
+ "inputs": {
155
+ "type": "object",
156
+ "description": "Pre-bound inputs for every fire.",
157
+ "additionalProperties": true
158
+ }
159
+ }
160
+ },
161
+ "WebhookTrigger": {
162
+ "type": "object",
163
+ "required": ["event"],
164
+ "additionalProperties": false,
165
+ "properties": {
166
+ "event": { "type": "string", "pattern": "^[a-z][a-z0-9._]*$" },
167
+ "secretRef": { "type": "string", "minLength": 1 },
168
+ "filters": {
169
+ "type": "object",
170
+ "additionalProperties": { "type": "string" }
171
+ }
172
+ }
173
+ },
174
+ "WorkflowCallTrigger": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "inputs": { "$ref": "#/$defs/InputSchemaMap" },
179
+ "outputs": {
180
+ "type": "object",
181
+ "additionalProperties": { "type": "string" }
182
+ }
183
+ }
184
+ },
185
+ "InputSchemaMap": {
186
+ "type": "object",
187
+ "additionalProperties": { "$ref": "#/$defs/InputSchemaEntry" }
188
+ },
189
+ "InputSchemaEntry": {
190
+ "type": "object",
191
+ "required": ["type"],
192
+ "additionalProperties": false,
193
+ "properties": {
194
+ "type": {
195
+ "type": "string",
196
+ "enum": ["string", "number", "integer", "boolean", "object", "array"]
197
+ },
198
+ "required": { "type": "boolean", "default": false },
199
+ "default": {},
200
+ "description": { "type": "string", "maxLength": 1000 },
201
+ "enum": { "type": "array", "minItems": 1 },
202
+ "items": { "type": "object" }
203
+ }
204
+ },
205
+ "Concurrency": {
206
+ "type": "object",
207
+ "required": ["group", "mode"],
208
+ "additionalProperties": false,
209
+ "properties": {
210
+ "group": { "type": "string", "minLength": 1 },
211
+ "mode": {
212
+ "type": "string",
213
+ "enum": ["allow", "queue", "cancel_in_progress", "skip"]
214
+ }
215
+ }
216
+ },
217
+ "Defaults": {
218
+ "type": "object",
219
+ "additionalProperties": false,
220
+ "properties": {
221
+ "retry": { "$ref": "#/$defs/RetryPolicy" },
222
+ "timeout": { "$ref": "#/$defs/Timeout" }
223
+ }
224
+ },
225
+ "Timeout": {
226
+ "type": "string",
227
+ "description": "Duration literal: <int><unit> where unit is one of s, m, h. Hours cap at 168 (1 week).",
228
+ "pattern": "^([1-9][0-9]*)(s|m|h)$"
229
+ },
230
+ "RetryPolicy": {
231
+ "type": "object",
232
+ "additionalProperties": false,
233
+ "properties": {
234
+ "maxAttempts": { "type": "integer", "minimum": 1, "maximum": 20 },
235
+ "initialInterval": { "$ref": "#/$defs/Timeout" },
236
+ "backoffCoefficient": { "type": "number", "minimum": 1.0, "maximum": 10.0 },
237
+ "maximumInterval": { "$ref": "#/$defs/Timeout" },
238
+ "nonRetryableErrorTypes": {
239
+ "type": "array",
240
+ "items": { "type": "string", "minLength": 1 }
241
+ }
242
+ }
243
+ },
244
+ "Permissions": {
245
+ "type": "object",
246
+ "additionalProperties": false,
247
+ "properties": {
248
+ "repos": { "$ref": "#/$defs/PermissionScope" },
249
+ "kb": { "$ref": "#/$defs/PermissionScope" },
250
+ "backlog": { "$ref": "#/$defs/PermissionScope" },
251
+ "integrations": { "$ref": "#/$defs/PermissionScope" },
252
+ "artifacts": { "$ref": "#/$defs/PermissionScope" },
253
+ "memory": { "$ref": "#/$defs/PermissionScope" }
254
+ }
255
+ },
256
+ "PermissionScope": {
257
+ "type": "string",
258
+ "enum": ["none", "read", "limited", "write"]
259
+ },
260
+ "Job": {
261
+ "type": "object",
262
+ "required": ["uses"],
263
+ "additionalProperties": false,
264
+ "properties": {
265
+ "title": { "type": "string", "maxLength": 120 },
266
+ "needs": {
267
+ "type": "array",
268
+ "items": { "$ref": "#/$defs/JobKey" },
269
+ "uniqueItems": true
270
+ },
271
+ "if": { "type": "string", "minLength": 1 },
272
+ "strategy": { "$ref": "#/$defs/Strategy" },
273
+ "matrixGather": {
274
+ "type": "array",
275
+ "description": "List of upstream jobKeys whose per-entry outputs should be flattened. For each key listed here, `needs.<key>.outputs` is reshaped from `{ kind: 'matrix', outputs: [...] }` to the flat array `[...]` before the job's `with:` expressions and `if:` are evaluated. Authors use this for synthesizer / coordinator jobs that need to aggregate across a matrix. Each key must be a declared job with a matrix strategy; the compiler auto-adds every key here to `needs` so authors do not have to duplicate.",
276
+ "items": { "$ref": "#/$defs/JobKey" },
277
+ "minItems": 1,
278
+ "uniqueItems": true
279
+ },
280
+ "uses": { "$ref": "#/$defs/UsesRef" },
281
+ "with": { "type": "object", "additionalProperties": true },
282
+ "outputs": {
283
+ "type": "object",
284
+ "additionalProperties": { "type": "string" }
285
+ },
286
+ "retry": { "$ref": "#/$defs/RetryPolicy" },
287
+ "timeout": { "$ref": "#/$defs/Timeout" },
288
+ "permissions": { "$ref": "#/$defs/Permissions" }
289
+ }
290
+ },
291
+ "UsesRef": {
292
+ "type": "string",
293
+ "description": "Either <namespace>/<actionId>[@<ver>] (e.g. xema/agent@1.0.0, or xema/agent for the latest-at-compile shorthand from plan §G) or xema://workflow/<slug>[@<ver>] for reusable workflow refs. When the version is omitted, the engine pins the resolved version into the CompiledRun at compile time — replays remain deterministic.",
294
+ "pattern": "^([a-z][a-z0-9-]*/[a-z][a-z0-9-]*(@[0-9]+(\\.[0-9]+(\\.[0-9]+(-[A-Za-z0-9.-]+)?)?)?)?|xema://workflow/[a-z][a-z0-9-]*(@[0-9]+\\.[0-9]+\\.[0-9]+(-[A-Za-z0-9.-]+)?)?)$"
295
+ },
296
+ "Strategy": {
297
+ "type": "object",
298
+ "additionalProperties": false,
299
+ "properties": {
300
+ "matrix": {
301
+ "type": "object",
302
+ "minProperties": 1,
303
+ "additionalProperties": {
304
+ "type": "array",
305
+ "minItems": 1,
306
+ "maxItems": 64
307
+ }
308
+ },
309
+ "dynamic": {
310
+ "type": "object",
311
+ "required": ["from", "as"],
312
+ "additionalProperties": false,
313
+ "properties": {
314
+ "from": { "type": "string", "minLength": 1 },
315
+ "as": { "type": "string", "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$" },
316
+ "maxEntries": { "type": "integer", "minimum": 1, "maximum": 64 },
317
+ "keyBy": {
318
+ "type": "string",
319
+ "minLength": 1,
320
+ "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*$"
321
+ }
322
+ }
323
+ },
324
+ "maxParallel": { "type": "integer", "minimum": 1, "maximum": 64 }
325
+ },
326
+ "oneOf": [
327
+ { "required": ["matrix"] },
328
+ { "required": ["dynamic"] }
329
+ ]
330
+ },
331
+ "WorkflowOutput": {
332
+ "type": "object",
333
+ "required": ["kind", "slug", "fromJob", "fromOutput"],
334
+ "oneOf": [
335
+ {
336
+ "additionalProperties": false,
337
+ "properties": {
338
+ "kind": { "const": "deliverable" },
339
+ "slug": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
340
+ "fromJob": { "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,62}$" },
341
+ "fromOutput": { "type": "string", "minLength": 1 },
342
+ "description": { "type": "string", "maxLength": 4000 },
343
+ "deliverableSpecRef": { "type": "string", "minLength": 1 }
344
+ },
345
+ "required": ["kind", "slug", "fromJob", "fromOutput", "deliverableSpecRef"]
346
+ },
347
+ {
348
+ "additionalProperties": false,
349
+ "properties": {
350
+ "kind": { "const": "structured" },
351
+ "slug": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
352
+ "fromJob": { "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,62}$" },
353
+ "fromOutput": { "type": "string", "minLength": 1 },
354
+ "description": { "type": "string", "maxLength": 4000 },
355
+ "schemaRef": { "type": "string", "minLength": 1 }
356
+ },
357
+ "required": ["kind", "slug", "fromJob", "fromOutput"]
358
+ },
359
+ {
360
+ "additionalProperties": false,
361
+ "properties": {
362
+ "kind": { "const": "text" },
363
+ "slug": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
364
+ "fromJob": { "type": "string", "pattern": "^[a-z][a-z0-9_-]{0,62}$" },
365
+ "fromOutput": { "type": "string", "minLength": 1 },
366
+ "description": { "type": "string", "maxLength": 4000 }
367
+ },
368
+ "required": ["kind", "slug", "fromJob", "fromOutput"]
369
+ }
370
+ ]
371
+ }
372
+ }
373
+ }
@@ -0,0 +1,14 @@
1
+ export { WorkflowDslError, isWorkflowDslError } from './lib/errors';
2
+ export { validateActionInputs, type ActionInputValidationFailure, type ActionInputValidationResult, } from './lib/action-input-validator';
3
+ export { InstallationResourceKind, collectInstallationResourceHints, type InstallationResourceFieldHint, } from './lib/installation-resource-kind';
4
+ export type { InstallationCompileScope } from './lib/compiler/types';
5
+ export { parseAndValidateActionYaml, parseAndValidateReusableWorkflowYaml, parseAndValidateWorkflowYaml, validateActionManifest, validateReusableWorkflowDocument, validateWorkflowDocument, } from './lib/validate';
6
+ export { EMPTY_CONTEXT_SEEDS, ExpressionFunction, ExpressionNodeKind, ExpressionRoot, compileExpression, evaluateExpression, extractInterpolations, isInterpolationWrapped, stripInterpolation, type ExpressionContext, type ExpressionNode, type NeedsEntry, } from './lib/expression';
7
+ export { parseDurationMs } from './lib/duration';
8
+ export { DispatchInputFieldType, DispatchInputStringFormat, extractDispatchInputDescriptors, type DispatchInputDescriptor, } from './lib/dispatch-inputs';
9
+ export { dispatchInputsToJsonSchema } from './lib/dispatch-inputs/to-json-schema';
10
+ export { serializeWorkflowDocument } from './lib/serializer';
11
+ export { canonicalJsonSha256, canonicalJsonStringify, compileManifestSource, compileWorkflow, getWorkspaceManifestContract, isAgentShapedAction, type CompileInput, type ResolvedAgent, type ResolvedDeliverableSpec, type ResolvedRef, } from './lib/compiler';
12
+ export { extractZodTopLevelObjectKeys, extractJsonSchemaTopLevelKeys, } from './lib/deliverable-spec-keys';
13
+ export type { ActionContract, ActionManifest, ActionManifestMetadata, ActionManifestRetryDefaults, ActionManifestSpec, ActionManifestTimeoutDefaults, WorkspaceManifestActionContract, ScheduleDeclaration, WebhookDeclaration, WorkflowCallDeclaration, WorkflowConcurrencyDeclaration, WorkflowDefaults, WorkflowDispatchDeclaration, WorkflowDocument, WorkflowDynamicStrategyDeclaration, WorkflowInputDeclaration, WorkflowJobDeclaration, WorkflowMetadata, WorkflowPermissions, WorkflowRetryDeclaration, WorkflowStrategyDeclaration, WorkflowTriggerDeclarations, } from './lib/types';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,6BAA6B,GACnC,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,EACpC,4BAA4B,EAC5B,sBAAsB,EACtB,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,4BAA4B,EAC5B,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,6BAA6B,EAC7B,+BAA+B,EAC/B,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,8BAA8B,EAC9B,gBAAgB,EAChB,2BAA2B,EAC3B,gBAAgB,EAChB,kCAAkC,EAClC,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,aAAa,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractJsonSchemaTopLevelKeys = exports.extractZodTopLevelObjectKeys = exports.isAgentShapedAction = exports.getWorkspaceManifestContract = exports.compileWorkflow = exports.compileManifestSource = exports.canonicalJsonStringify = exports.canonicalJsonSha256 = exports.serializeWorkflowDocument = exports.dispatchInputsToJsonSchema = exports.extractDispatchInputDescriptors = exports.DispatchInputStringFormat = exports.DispatchInputFieldType = exports.parseDurationMs = exports.stripInterpolation = exports.isInterpolationWrapped = exports.extractInterpolations = exports.evaluateExpression = exports.compileExpression = exports.ExpressionRoot = exports.ExpressionNodeKind = exports.ExpressionFunction = exports.EMPTY_CONTEXT_SEEDS = exports.validateWorkflowDocument = exports.validateReusableWorkflowDocument = exports.validateActionManifest = exports.parseAndValidateWorkflowYaml = exports.parseAndValidateReusableWorkflowYaml = exports.parseAndValidateActionYaml = exports.collectInstallationResourceHints = exports.InstallationResourceKind = exports.validateActionInputs = exports.isWorkflowDslError = exports.WorkflowDslError = void 0;
4
+ var errors_1 = require("./lib/errors");
5
+ Object.defineProperty(exports, "WorkflowDslError", { enumerable: true, get: function () { return errors_1.WorkflowDslError; } });
6
+ Object.defineProperty(exports, "isWorkflowDslError", { enumerable: true, get: function () { return errors_1.isWorkflowDslError; } });
7
+ var action_input_validator_1 = require("./lib/action-input-validator");
8
+ Object.defineProperty(exports, "validateActionInputs", { enumerable: true, get: function () { return action_input_validator_1.validateActionInputs; } });
9
+ var installation_resource_kind_1 = require("./lib/installation-resource-kind");
10
+ Object.defineProperty(exports, "InstallationResourceKind", { enumerable: true, get: function () { return installation_resource_kind_1.InstallationResourceKind; } });
11
+ Object.defineProperty(exports, "collectInstallationResourceHints", { enumerable: true, get: function () { return installation_resource_kind_1.collectInstallationResourceHints; } });
12
+ var validate_1 = require("./lib/validate");
13
+ Object.defineProperty(exports, "parseAndValidateActionYaml", { enumerable: true, get: function () { return validate_1.parseAndValidateActionYaml; } });
14
+ Object.defineProperty(exports, "parseAndValidateReusableWorkflowYaml", { enumerable: true, get: function () { return validate_1.parseAndValidateReusableWorkflowYaml; } });
15
+ Object.defineProperty(exports, "parseAndValidateWorkflowYaml", { enumerable: true, get: function () { return validate_1.parseAndValidateWorkflowYaml; } });
16
+ Object.defineProperty(exports, "validateActionManifest", { enumerable: true, get: function () { return validate_1.validateActionManifest; } });
17
+ Object.defineProperty(exports, "validateReusableWorkflowDocument", { enumerable: true, get: function () { return validate_1.validateReusableWorkflowDocument; } });
18
+ Object.defineProperty(exports, "validateWorkflowDocument", { enumerable: true, get: function () { return validate_1.validateWorkflowDocument; } });
19
+ var expression_1 = require("./lib/expression");
20
+ Object.defineProperty(exports, "EMPTY_CONTEXT_SEEDS", { enumerable: true, get: function () { return expression_1.EMPTY_CONTEXT_SEEDS; } });
21
+ Object.defineProperty(exports, "ExpressionFunction", { enumerable: true, get: function () { return expression_1.ExpressionFunction; } });
22
+ Object.defineProperty(exports, "ExpressionNodeKind", { enumerable: true, get: function () { return expression_1.ExpressionNodeKind; } });
23
+ Object.defineProperty(exports, "ExpressionRoot", { enumerable: true, get: function () { return expression_1.ExpressionRoot; } });
24
+ Object.defineProperty(exports, "compileExpression", { enumerable: true, get: function () { return expression_1.compileExpression; } });
25
+ Object.defineProperty(exports, "evaluateExpression", { enumerable: true, get: function () { return expression_1.evaluateExpression; } });
26
+ Object.defineProperty(exports, "extractInterpolations", { enumerable: true, get: function () { return expression_1.extractInterpolations; } });
27
+ Object.defineProperty(exports, "isInterpolationWrapped", { enumerable: true, get: function () { return expression_1.isInterpolationWrapped; } });
28
+ Object.defineProperty(exports, "stripInterpolation", { enumerable: true, get: function () { return expression_1.stripInterpolation; } });
29
+ var duration_1 = require("./lib/duration");
30
+ Object.defineProperty(exports, "parseDurationMs", { enumerable: true, get: function () { return duration_1.parseDurationMs; } });
31
+ var dispatch_inputs_1 = require("./lib/dispatch-inputs");
32
+ Object.defineProperty(exports, "DispatchInputFieldType", { enumerable: true, get: function () { return dispatch_inputs_1.DispatchInputFieldType; } });
33
+ Object.defineProperty(exports, "DispatchInputStringFormat", { enumerable: true, get: function () { return dispatch_inputs_1.DispatchInputStringFormat; } });
34
+ Object.defineProperty(exports, "extractDispatchInputDescriptors", { enumerable: true, get: function () { return dispatch_inputs_1.extractDispatchInputDescriptors; } });
35
+ var to_json_schema_1 = require("./lib/dispatch-inputs/to-json-schema");
36
+ Object.defineProperty(exports, "dispatchInputsToJsonSchema", { enumerable: true, get: function () { return to_json_schema_1.dispatchInputsToJsonSchema; } });
37
+ var serializer_1 = require("./lib/serializer");
38
+ Object.defineProperty(exports, "serializeWorkflowDocument", { enumerable: true, get: function () { return serializer_1.serializeWorkflowDocument; } });
39
+ var compiler_1 = require("./lib/compiler");
40
+ Object.defineProperty(exports, "canonicalJsonSha256", { enumerable: true, get: function () { return compiler_1.canonicalJsonSha256; } });
41
+ Object.defineProperty(exports, "canonicalJsonStringify", { enumerable: true, get: function () { return compiler_1.canonicalJsonStringify; } });
42
+ Object.defineProperty(exports, "compileManifestSource", { enumerable: true, get: function () { return compiler_1.compileManifestSource; } });
43
+ Object.defineProperty(exports, "compileWorkflow", { enumerable: true, get: function () { return compiler_1.compileWorkflow; } });
44
+ Object.defineProperty(exports, "getWorkspaceManifestContract", { enumerable: true, get: function () { return compiler_1.getWorkspaceManifestContract; } });
45
+ Object.defineProperty(exports, "isAgentShapedAction", { enumerable: true, get: function () { return compiler_1.isAgentShapedAction; } });
46
+ var deliverable_spec_keys_1 = require("./lib/deliverable-spec-keys");
47
+ Object.defineProperty(exports, "extractZodTopLevelObjectKeys", { enumerable: true, get: function () { return deliverable_spec_keys_1.extractZodTopLevelObjectKeys; } });
48
+ Object.defineProperty(exports, "extractJsonSchemaTopLevelKeys", { enumerable: true, get: function () { return deliverable_spec_keys_1.extractJsonSchemaTopLevelKeys; } });
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":";;;AAeA,uCAAoE;AAA3D,0GAAA,gBAAgB,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAC7C,uEAIsC;AAHpC,8HAAA,oBAAoB,OAAA;AAItB,+EAI0C;AAHxC,sIAAA,wBAAwB,OAAA;AACxB,8IAAA,gCAAgC,OAAA;AAIlC,2CAOwB;AANtB,sHAAA,0BAA0B,OAAA;AAC1B,gIAAA,oCAAoC,OAAA;AACpC,wHAAA,4BAA4B,OAAA;AAC5B,kHAAA,sBAAsB,OAAA;AACtB,4HAAA,gCAAgC,OAAA;AAChC,oHAAA,wBAAwB,OAAA;AAE1B,+CAa0B;AAZxB,iHAAA,mBAAmB,OAAA;AACnB,gHAAA,kBAAkB,OAAA;AAClB,gHAAA,kBAAkB,OAAA;AAClB,4GAAA,cAAc,OAAA;AACd,+GAAA,iBAAiB,OAAA;AACjB,gHAAA,kBAAkB,OAAA;AAClB,mHAAA,qBAAqB,OAAA;AACrB,oHAAA,sBAAsB,OAAA;AACtB,gHAAA,kBAAkB,OAAA;AAKpB,2CAAiD;AAAxC,2GAAA,eAAe,OAAA;AACxB,yDAK+B;AAJ7B,yHAAA,sBAAsB,OAAA;AACtB,4HAAA,yBAAyB,OAAA;AACzB,kIAAA,+BAA+B,OAAA;AAGjC,uEAAkF;AAAzE,4HAAA,0BAA0B,OAAA;AACnC,+CAA6D;AAApD,uHAAA,yBAAyB,OAAA;AAClC,2CAWwB;AAVtB,+GAAA,mBAAmB,OAAA;AACnB,kHAAA,sBAAsB,OAAA;AACtB,iHAAA,qBAAqB,OAAA;AACrB,2GAAA,eAAe,OAAA;AACf,wHAAA,4BAA4B,OAAA;AAC5B,+GAAA,mBAAmB,OAAA;AAMrB,qEAGqC;AAFnC,qIAAA,4BAA4B,OAAA;AAC5B,sIAAA,6BAA6B,OAAA"}
@@ -0,0 +1,10 @@
1
+ export interface ActionInputValidationFailure {
2
+ readonly path: string;
3
+ readonly message: string;
4
+ }
5
+ export interface ActionInputValidationResult {
6
+ readonly valid: boolean;
7
+ readonly failures: readonly ActionInputValidationFailure[];
8
+ }
9
+ export declare function validateActionInputs(schema: Readonly<Record<string, unknown>>, value: unknown): ActionInputValidationResult;
10
+ //# sourceMappingURL=action-input-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-input-validator.d.ts","sourceRoot":"","sources":["../../../src/workflow/lib/action-input-validator.ts"],"names":[],"mappings":"AA+EA,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,4BAA4B,EAAE,CAAC;CAC5D;AAaD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,KAAK,EAAE,OAAO,GACb,2BAA2B,CAU7B"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.validateActionInputs = validateActionInputs;
7
+ const _2020_1 = __importDefault(require("ajv/dist/2020"));
8
+ const ajv_formats_1 = __importDefault(require("ajv-formats"));
9
+ const ajv = new _2020_1.default({
10
+ strict: false,
11
+ allErrors: true,
12
+ useDefaults: false,
13
+ validateFormats: true,
14
+ });
15
+ (0, ajv_formats_1.default)(ajv);
16
+ ajv.addKeyword({
17
+ keyword: 'x-installation-resource',
18
+ metaSchema: {
19
+ type: 'object',
20
+ additionalProperties: false,
21
+ required: ['kind'],
22
+ properties: {
23
+ kind: { type: 'string', enum: ['wallet', 'repo', 'project', 'channel', 'space'] },
24
+ },
25
+ },
26
+ });
27
+ const validatorCache = new WeakMap();
28
+ function validateActionInputs(schema, value) {
29
+ const validate = compileOrGet(schema);
30
+ if (validate(value)) {
31
+ return { valid: true, failures: [] };
32
+ }
33
+ const errors = validate.errors ?? [];
34
+ return {
35
+ valid: false,
36
+ failures: errors.map(formatError),
37
+ };
38
+ }
39
+ function compileOrGet(schema) {
40
+ const cached = validatorCache.get(schema);
41
+ if (cached)
42
+ return cached;
43
+ const compiled = ajv.compile(schema);
44
+ validatorCache.set(schema, compiled);
45
+ return compiled;
46
+ }
47
+ function formatError(err) {
48
+ const dotted = err.instancePath
49
+ .replace(/^\//, '')
50
+ .split('/')
51
+ .filter((seg) => seg.length > 0)
52
+ .join('.');
53
+ const path = dotted.length > 0 ? `inputs.${dotted}` : 'inputs';
54
+ if (err.keyword === 'required' && typeof err.params?.['missingProperty'] === 'string') {
55
+ const missing = err.params['missingProperty'];
56
+ const subPath = path === 'inputs' ? `inputs.${missing}` : `${path}.${missing}`;
57
+ return { path: subPath, message: 'is required but missing' };
58
+ }
59
+ if (err.keyword === 'additionalProperties' && typeof err.params?.['additionalProperty'] === 'string') {
60
+ const extra = err.params['additionalProperty'];
61
+ const subPath = path === 'inputs' ? `inputs.${extra}` : `${path}.${extra}`;
62
+ return { path: subPath, message: 'is not declared on this action — remove it from the with-block' };
63
+ }
64
+ return {
65
+ path,
66
+ message: err.message ?? `failed ${err.keyword} check`,
67
+ };
68
+ }
69
+ //# sourceMappingURL=action-input-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-input-validator.js","sourceRoot":"","sources":["../../../src/workflow/lib/action-input-validator.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ import type { ActionManifest, AgentCompositionActionContract, WorkspaceManifestActionContract } from '../types';
2
+ export declare function getWorkspaceManifestContract(actionManifest: ActionManifest | null): WorkspaceManifestActionContract | null;
3
+ export declare function isAgentShapedAction(actionManifest: ActionManifest | null): actionManifest is ActionManifest;
4
+ export declare function getAgentCompositionContract(actionManifest: ActionManifest | null): AgentCompositionActionContract | null;
5
+ //# sourceMappingURL=action-shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-shape.d.ts","sourceRoot":"","sources":["../../../../src/workflow/lib/compiler/action-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,8BAA8B,EAC9B,+BAA+B,EAChC,MAAM,UAAU,CAAC;AAUlB,wBAAgB,4BAA4B,CAC1C,cAAc,EAAE,cAAc,GAAG,IAAI,GACpC,+BAA+B,GAAG,IAAI,CAUxC;AAWD,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,GAAG,IAAI,GACpC,cAAc,IAAI,cAAc,CASlC;AAUD,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,cAAc,GAAG,IAAI,GACpC,8BAA8B,GAAG,IAAI,CAUvC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWorkspaceManifestContract = getWorkspaceManifestContract;
4
+ exports.isAgentShapedAction = isAgentShapedAction;
5
+ exports.getAgentCompositionContract = getAgentCompositionContract;
6
+ function getWorkspaceManifestContract(actionManifest) {
7
+ if (!actionManifest)
8
+ return null;
9
+ const contracts = actionManifest.spec.consumes;
10
+ if (!contracts || contracts.length === 0)
11
+ return null;
12
+ for (const c of contracts) {
13
+ if (c.kind === 'workspace-manifest' && c.version === 'v1') {
14
+ return c;
15
+ }
16
+ }
17
+ return null;
18
+ }
19
+ function isAgentShapedAction(actionManifest) {
20
+ if (!actionManifest)
21
+ return false;
22
+ if (getWorkspaceManifestContract(actionManifest) !== null)
23
+ return true;
24
+ const inputs = actionManifest.spec.inputs;
25
+ const properties = inputs?.properties;
26
+ if (!properties)
27
+ return false;
28
+ return 'compositionRef' in properties && 'mounts' in properties;
29
+ }
30
+ function getAgentCompositionContract(actionManifest) {
31
+ if (!actionManifest)
32
+ return null;
33
+ const contracts = actionManifest.spec.consumes;
34
+ if (!contracts || contracts.length === 0)
35
+ return null;
36
+ for (const c of contracts) {
37
+ if (c.kind === 'agent-composition' && c.version === 'v1') {
38
+ return c;
39
+ }
40
+ }
41
+ return null;
42
+ }
43
+ //# sourceMappingURL=action-shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-shape.js","sourceRoot":"","sources":["../../../../src/workflow/lib/compiler/action-shape.ts"],"names":[],"mappings":";;AAcA,oEAYC;AAWD,kDAWC;AAUD,kEAYC;AAxDD,SAAgB,4BAA4B,CAC1C,cAAqC;IAErC,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC/C,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtD,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;QAC1B,IAAI,CAAC,CAAC,IAAI,KAAK,oBAAoB,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YAC1D,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAWD,SAAgB,mBAAmB,CACjC,cAAqC;IAErC,IAAI,CAAC,cAAc;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,4BAA4B,CAAC,cAAc,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACvE,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,MAEtB,CAAC;IACd,MAAM,UAAU,GAAG,MAAM,EAAE,UAAU,CAAC;IACtC,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC9B,OAAO,gBAAgB,IAAI,UAAU,IAAI,QAAQ,IAAI,UAAU,CAAC;AAClE,CAAC;AAUD,SAAgB,2BAA2B,CACzC,cAAqC;IAErC,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC/C,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtD,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;QAC1B,IAAI,CAAC,CAAC,IAAI,KAAK,mBAAmB,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACzD,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function canonicalJsonStringify(value: unknown): string;
2
+ export declare function canonicalJsonSha256(value: unknown): string;
3
+ //# sourceMappingURL=canonical-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-json.d.ts","sourceRoot":"","sources":["../../../../src/workflow/lib/compiler/canonical-json.ts"],"names":[],"mappings":"AAeA,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE7D;AAGD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE1D"}