@xyne/workflow-sdk 3.2.53 → 3.2.55

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 (275) hide show
  1. package/dist/agents/host-agent-step.d.ts.map +1 -1
  2. package/dist/agents/host-agent-step.js +3 -0
  3. package/dist/agents/host-agent-step.js.map +1 -1
  4. package/dist/builder/index.d.ts +19 -2
  5. package/dist/builder/index.d.ts.map +1 -1
  6. package/dist/builder/index.js +17 -1
  7. package/dist/builder/index.js.map +1 -1
  8. package/dist/common/attachment.d.ts +9 -0
  9. package/dist/common/attachment.d.ts.map +1 -1
  10. package/dist/common/attachment.js +20 -0
  11. package/dist/common/attachment.js.map +1 -1
  12. package/dist/common/citation-ref.d.ts +4 -4
  13. package/dist/completion/address.d.ts +27 -0
  14. package/dist/completion/address.d.ts.map +1 -0
  15. package/dist/completion/address.js +62 -0
  16. package/dist/completion/address.js.map +1 -0
  17. package/dist/completion/attach.d.ts +32 -0
  18. package/dist/completion/attach.d.ts.map +1 -0
  19. package/dist/completion/attach.js +92 -0
  20. package/dist/completion/attach.js.map +1 -0
  21. package/dist/completion/index.d.ts +6 -0
  22. package/dist/completion/index.d.ts.map +1 -0
  23. package/dist/completion/index.js +4 -0
  24. package/dist/completion/index.js.map +1 -0
  25. package/dist/completion/types.d.ts +107 -0
  26. package/dist/completion/types.d.ts.map +1 -0
  27. package/dist/completion/types.js +35 -0
  28. package/dist/completion/types.js.map +1 -0
  29. package/dist/connectors/builtin/builtin-connector.d.ts.map +1 -1
  30. package/dist/connectors/builtin/builtin-connector.js +6 -2
  31. package/dist/connectors/builtin/builtin-connector.js.map +1 -1
  32. package/dist/connectors/builtin/steps/compute.step.d.ts +56 -0
  33. package/dist/connectors/builtin/steps/compute.step.d.ts.map +1 -0
  34. package/dist/connectors/builtin/steps/compute.step.js +48 -0
  35. package/dist/connectors/builtin/steps/compute.step.js.map +1 -0
  36. package/dist/connectors/builtin/steps/conditional.step.d.ts +2 -2
  37. package/dist/connectors/builtin/steps/conditional.step.js +1 -1
  38. package/dist/connectors/builtin/steps/conditional.step.js.map +1 -1
  39. package/dist/connectors/builtin/steps/cycle.step.d.ts +36 -7
  40. package/dist/connectors/builtin/steps/cycle.step.d.ts.map +1 -1
  41. package/dist/connectors/builtin/steps/cycle.step.js +89 -8
  42. package/dist/connectors/builtin/steps/cycle.step.js.map +1 -1
  43. package/dist/connectors/builtin/steps/dedup.step.js +2 -2
  44. package/dist/connectors/builtin/steps/dedup.step.js.map +1 -1
  45. package/dist/connectors/builtin/steps/delay.step.d.ts +49 -0
  46. package/dist/connectors/builtin/steps/delay.step.d.ts.map +1 -0
  47. package/dist/connectors/builtin/steps/delay.step.js +40 -0
  48. package/dist/connectors/builtin/steps/delay.step.js.map +1 -0
  49. package/dist/connectors/builtin/steps/loop.step.d.ts +6 -6
  50. package/dist/connectors/builtin/steps/loop.step.d.ts.map +1 -1
  51. package/dist/connectors/builtin/steps/loop.step.js +4 -2
  52. package/dist/connectors/builtin/steps/loop.step.js.map +1 -1
  53. package/dist/connectors/builtin/steps/map.step.d.ts +4 -4
  54. package/dist/connectors/builtin/steps/map.step.d.ts.map +1 -1
  55. package/dist/connectors/builtin/steps/map.step.js +13 -4
  56. package/dist/connectors/builtin/steps/map.step.js.map +1 -1
  57. package/dist/connectors/builtin/steps/parallel.step.d.ts +2 -2
  58. package/dist/connectors/builtin/steps/parallel.step.d.ts.map +1 -1
  59. package/dist/connectors/builtin/steps/parallel.step.js +9 -2
  60. package/dist/connectors/builtin/steps/parallel.step.js.map +1 -1
  61. package/dist/connectors/builtin/steps/switch.step.js +1 -1
  62. package/dist/connectors/builtin/steps/switch.step.js.map +1 -1
  63. package/dist/connectors/builtin/steps/wait-for-api-call.step.d.ts +80 -0
  64. package/dist/connectors/builtin/steps/wait-for-api-call.step.d.ts.map +1 -0
  65. package/dist/connectors/builtin/steps/wait-for-api-call.step.js +104 -0
  66. package/dist/connectors/builtin/steps/wait-for-api-call.step.js.map +1 -0
  67. package/dist/connectors/builtin/steps/wait-for-human.step.d.ts +1057 -0
  68. package/dist/connectors/builtin/steps/wait-for-human.step.d.ts.map +1 -0
  69. package/dist/connectors/builtin/steps/wait-for-human.step.js +222 -0
  70. package/dist/connectors/builtin/steps/wait-for-human.step.js.map +1 -0
  71. package/dist/connectors/builtin/steps/wait-for-webhook.step.d.ts +80 -0
  72. package/dist/connectors/builtin/steps/wait-for-webhook.step.d.ts.map +1 -0
  73. package/dist/connectors/builtin/steps/wait-for-webhook.step.js +104 -0
  74. package/dist/connectors/builtin/steps/wait-for-webhook.step.js.map +1 -0
  75. package/dist/connectors/builtin/steps/wait.step.d.ts +40 -59
  76. package/dist/connectors/builtin/steps/wait.step.d.ts.map +1 -1
  77. package/dist/connectors/builtin/steps/wait.step.js +29 -63
  78. package/dist/connectors/builtin/steps/wait.step.js.map +1 -1
  79. package/dist/conversational-flow/calls.d.ts +2 -2
  80. package/dist/conversational-flow/calls.d.ts.map +1 -1
  81. package/dist/conversational-flow/calls.js +40 -5
  82. package/dist/conversational-flow/calls.js.map +1 -1
  83. package/dist/conversational-flow/create.d.ts +2 -1
  84. package/dist/conversational-flow/create.d.ts.map +1 -1
  85. package/dist/conversational-flow/create.js +2 -2
  86. package/dist/conversational-flow/create.js.map +1 -1
  87. package/dist/conversational-flow/edit/build.js +1 -1
  88. package/dist/conversational-flow/edit/build.js.map +1 -1
  89. package/dist/conversational-flow/edit/calls.d.ts.map +1 -1
  90. package/dist/conversational-flow/edit/calls.js +8 -5
  91. package/dist/conversational-flow/edit/calls.js.map +1 -1
  92. package/dist/conversational-flow/edit/endings.d.ts +8 -3
  93. package/dist/conversational-flow/edit/endings.d.ts.map +1 -1
  94. package/dist/conversational-flow/edit/endings.js +17 -9
  95. package/dist/conversational-flow/edit/endings.js.map +1 -1
  96. package/dist/conversational-flow/edit/questions.d.ts +35 -0
  97. package/dist/conversational-flow/edit/questions.d.ts.map +1 -0
  98. package/dist/conversational-flow/edit/questions.js +188 -0
  99. package/dist/conversational-flow/edit/questions.js.map +1 -0
  100. package/dist/conversational-flow/edit/versions.d.ts.map +1 -1
  101. package/dist/conversational-flow/edit/versions.js +6 -7
  102. package/dist/conversational-flow/edit/versions.js.map +1 -1
  103. package/dist/conversational-flow/index.d.ts +2 -1
  104. package/dist/conversational-flow/index.d.ts.map +1 -1
  105. package/dist/conversational-flow/index.js +4 -0
  106. package/dist/conversational-flow/index.js.map +1 -1
  107. package/dist/conversational-flow/questions.d.ts +32 -0
  108. package/dist/conversational-flow/questions.d.ts.map +1 -0
  109. package/dist/conversational-flow/questions.js +122 -0
  110. package/dist/conversational-flow/questions.js.map +1 -0
  111. package/dist/conversational-flow/read.d.ts.map +1 -1
  112. package/dist/conversational-flow/read.js +20 -4
  113. package/dist/conversational-flow/read.js.map +1 -1
  114. package/dist/conversational-flow/settle.js +4 -7
  115. package/dist/conversational-flow/settle.js.map +1 -1
  116. package/dist/conversational-flow/types.d.ts +31 -8
  117. package/dist/conversational-flow/types.d.ts.map +1 -1
  118. package/dist/conversational-flow/types.js.map +1 -1
  119. package/dist/engine/condition-evaluator.d.ts +10 -2
  120. package/dist/engine/condition-evaluator.d.ts.map +1 -1
  121. package/dist/engine/condition-evaluator.js +36 -14
  122. package/dist/engine/condition-evaluator.js.map +1 -1
  123. package/dist/engine/config-validator.d.ts +64 -0
  124. package/dist/engine/config-validator.d.ts.map +1 -1
  125. package/dist/engine/config-validator.js +400 -30
  126. package/dist/engine/config-validator.js.map +1 -1
  127. package/dist/engine/pause-step.d.ts +21 -4
  128. package/dist/engine/pause-step.d.ts.map +1 -1
  129. package/dist/engine/pause-step.js +11 -2
  130. package/dist/engine/pause-step.js.map +1 -1
  131. package/dist/engine/read-config.d.ts +12 -0
  132. package/dist/engine/read-config.d.ts.map +1 -0
  133. package/dist/engine/read-config.js +50 -0
  134. package/dist/engine/read-config.js.map +1 -0
  135. package/dist/engine/resolve-expressions.d.ts +40 -0
  136. package/dist/engine/resolve-expressions.d.ts.map +1 -0
  137. package/dist/engine/resolve-expressions.js +186 -0
  138. package/dist/engine/resolve-expressions.js.map +1 -0
  139. package/dist/engine/variable-resolver.d.ts +27 -0
  140. package/dist/engine/variable-resolver.d.ts.map +1 -1
  141. package/dist/engine/variable-resolver.js +20 -3
  142. package/dist/engine/variable-resolver.js.map +1 -1
  143. package/dist/engine/workflow-executor.d.ts.map +1 -1
  144. package/dist/engine/workflow-executor.js +66 -56
  145. package/dist/engine/workflow-executor.js.map +1 -1
  146. package/dist/expression/catalogue.d.ts +36 -0
  147. package/dist/expression/catalogue.d.ts.map +1 -0
  148. package/dist/expression/catalogue.js +82 -0
  149. package/dist/expression/catalogue.js.map +1 -0
  150. package/dist/expression/form/model.d.ts +115 -0
  151. package/dist/expression/form/model.d.ts.map +1 -0
  152. package/dist/expression/form/model.js +61 -0
  153. package/dist/expression/form/model.js.map +1 -0
  154. package/dist/expression/form/read.d.ts +4 -0
  155. package/dist/expression/form/read.d.ts.map +1 -0
  156. package/dist/expression/form/read.js +283 -0
  157. package/dist/expression/form/read.js.map +1 -0
  158. package/dist/expression/form/write.d.ts +8 -0
  159. package/dist/expression/form/write.d.ts.map +1 -0
  160. package/dist/expression/form/write.js +124 -0
  161. package/dist/expression/form/write.js.map +1 -0
  162. package/dist/expression/format.d.ts +41 -0
  163. package/dist/expression/format.d.ts.map +1 -0
  164. package/dist/expression/format.js +84 -0
  165. package/dist/expression/format.js.map +1 -0
  166. package/dist/expression/index.d.ts +40 -0
  167. package/dist/expression/index.d.ts.map +1 -0
  168. package/dist/expression/index.js +35 -0
  169. package/dist/expression/index.js.map +1 -0
  170. package/dist/expression/infer.d.ts +40 -0
  171. package/dist/expression/infer.d.ts.map +1 -0
  172. package/dist/expression/infer.js +195 -0
  173. package/dist/expression/infer.js.map +1 -0
  174. package/dist/expression/parse.d.ts +60 -0
  175. package/dist/expression/parse.d.ts.map +1 -0
  176. package/dist/expression/parse.js +201 -0
  177. package/dist/expression/parse.js.map +1 -0
  178. package/dist/expression/signature.d.ts +41 -0
  179. package/dist/expression/signature.d.ts.map +1 -0
  180. package/dist/expression/signature.js +124 -0
  181. package/dist/expression/signature.js.map +1 -0
  182. package/dist/expression/signatures.d.ts +45 -0
  183. package/dist/expression/signatures.d.ts.map +1 -0
  184. package/dist/expression/signatures.js +113 -0
  185. package/dist/expression/signatures.js.map +1 -0
  186. package/dist/expression/types.d.ts +71 -0
  187. package/dist/expression/types.d.ts.map +1 -0
  188. package/dist/expression/types.js +139 -0
  189. package/dist/expression/types.js.map +1 -0
  190. package/dist/index.d.ts +32 -7
  191. package/dist/index.d.ts.map +1 -1
  192. package/dist/index.js +27 -3
  193. package/dist/index.js.map +1 -1
  194. package/dist/ingest/filter.d.ts +8 -2
  195. package/dist/ingest/filter.d.ts.map +1 -1
  196. package/dist/ingest/filter.js +8 -2
  197. package/dist/ingest/filter.js.map +1 -1
  198. package/dist/ingest/start-policy.d.ts +1 -1
  199. package/dist/ingest/start-policy.d.ts.map +1 -1
  200. package/dist/ingest/start-policy.js +12 -5
  201. package/dist/ingest/start-policy.js.map +1 -1
  202. package/dist/persistence/in-memory-adapter.d.ts +3 -18
  203. package/dist/persistence/in-memory-adapter.d.ts.map +1 -1
  204. package/dist/persistence/in-memory-adapter.js +9 -61
  205. package/dist/persistence/in-memory-adapter.js.map +1 -1
  206. package/dist/persistence/types.d.ts +29 -58
  207. package/dist/persistence/types.d.ts.map +1 -1
  208. package/dist/router/workflow-router.d.ts.map +1 -1
  209. package/dist/router/workflow-router.js +70 -28
  210. package/dist/router/workflow-router.js.map +1 -1
  211. package/dist/runtime/workflow-runtime.d.ts +22 -45
  212. package/dist/runtime/workflow-runtime.d.ts.map +1 -1
  213. package/dist/runtime/workflow-runtime.js +157 -125
  214. package/dist/runtime/workflow-runtime.js.map +1 -1
  215. package/dist/steps/base-step.d.ts +2 -4
  216. package/dist/steps/base-step.d.ts.map +1 -1
  217. package/dist/steps/base-step.js.map +1 -1
  218. package/dist/testing/test-connector.d.ts +1 -1
  219. package/dist/testing/test-connector.js +1 -1
  220. package/dist/types/index.d.ts +2 -2
  221. package/dist/types/index.d.ts.map +1 -1
  222. package/dist/types/index.js +1 -1
  223. package/dist/types/index.js.map +1 -1
  224. package/dist/types/known-types.d.ts +51 -1
  225. package/dist/types/known-types.d.ts.map +1 -1
  226. package/dist/types/known-types.js +54 -1
  227. package/dist/types/known-types.js.map +1 -1
  228. package/dist/types/operators.d.ts +22 -0
  229. package/dist/types/operators.d.ts.map +1 -1
  230. package/dist/types/operators.js +6 -6
  231. package/dist/types/operators.js.map +1 -1
  232. package/dist/types/pause-state.d.ts +0 -8
  233. package/dist/types/pause-state.d.ts.map +1 -1
  234. package/dist/types/pause-state.js.map +1 -1
  235. package/dist/types/validation.d.ts +10 -1
  236. package/dist/types/validation.d.ts.map +1 -1
  237. package/dist/types/validation.js +9 -0
  238. package/dist/types/validation.js.map +1 -1
  239. package/dist/types/workflow-config.d.ts +4 -3
  240. package/dist/types/workflow-config.d.ts.map +1 -1
  241. package/dist/types/workflow-config.js +23 -8
  242. package/dist/types/workflow-config.js.map +1 -1
  243. package/dist/util/computed-value.d.ts +103 -0
  244. package/dist/util/computed-value.d.ts.map +1 -0
  245. package/dist/util/computed-value.js +453 -0
  246. package/dist/util/computed-value.js.map +1 -0
  247. package/dist/util/expression-format.d.ts +41 -0
  248. package/dist/util/expression-format.d.ts.map +1 -0
  249. package/dist/util/expression-format.js +84 -0
  250. package/dist/util/expression-format.js.map +1 -0
  251. package/dist/util/expression-functions.d.ts +35 -0
  252. package/dist/util/expression-functions.d.ts.map +1 -0
  253. package/dist/util/expression-functions.js +82 -0
  254. package/dist/util/expression-functions.js.map +1 -0
  255. package/dist/util/expression.d.ts +98 -0
  256. package/dist/util/expression.d.ts.map +1 -0
  257. package/dist/util/expression.js +395 -0
  258. package/dist/util/expression.js.map +1 -0
  259. package/dist/util/jsonata-signatures.d.ts +45 -0
  260. package/dist/util/jsonata-signatures.d.ts.map +1 -0
  261. package/dist/util/jsonata-signatures.js +113 -0
  262. package/dist/util/jsonata-signatures.js.map +1 -0
  263. package/dist/util/signature.d.ts +41 -0
  264. package/dist/util/signature.d.ts.map +1 -0
  265. package/dist/util/signature.js +124 -0
  266. package/dist/util/signature.js.map +1 -0
  267. package/dist/util/type-compat.d.ts +8 -28
  268. package/dist/util/type-compat.d.ts.map +1 -1
  269. package/dist/util/type-compat.js +22 -29
  270. package/dist/util/type-compat.js.map +1 -1
  271. package/dist/util/variable-ref.d.ts +24 -0
  272. package/dist/util/variable-ref.d.ts.map +1 -1
  273. package/dist/util/variable-ref.js +34 -9
  274. package/dist/util/variable-ref.js.map +1 -1
  275. package/package.json +6 -1
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Every JSONata builtin, with the signature JSONata itself declares for it.
3
+ *
4
+ * **Generated, not written.** The names come from `staticFrame.bind('…')` in the
5
+ * installed `jsonata`, and each signature from evaluating `$name` — a builtin
6
+ * resolves to an object carrying `signature.definition`. `jsonata-signatures.test.ts`
7
+ * re-derives this table from the installed package and fails if it has drifted,
8
+ * so an upgrade cannot silently leave it stale.
9
+ *
10
+ * ## Why this is here at all
11
+ *
12
+ * The alternative was writing the types out by hand, and that was tried first:
13
+ * it put `object` on `$keys`, `array` on `$distinct` and `array` on `$append`,
14
+ * all three of which really take anything — so correct expressions were refused.
15
+ * A type checker that is wrong is worse than none, and the only defence is to
16
+ * take the types from the language rather than restate them.
17
+ *
18
+ * It also buys reach: every one of these is typed, not the twenty-odd a curated
19
+ * list would cover, and a name absent from this table is a name JSONata does not
20
+ * have — which is how a typo gets caught.
21
+ *
22
+ * ## Why generated rather than read at run time
23
+ *
24
+ * JSONata does expose these through its public API — `jsonata('$sum')
25
+ * .evaluate({})` resolves to the builtin object and carries
26
+ * `signature.definition`, no internals involved. The reason not to is that
27
+ * `evaluate` is **async**, and the catalogue it would feed is consulted
28
+ * synchronously while a menu renders. Reading them live would make building the
29
+ * catalogue async, or need a top-level await, to learn facts that are fixed for
30
+ * a given version of the dependency.
31
+ *
32
+ * So the table is a build-time snapshot of a run-time truth, and the drift test
33
+ * is what makes that safe: it takes the same public route on every run and
34
+ * fails if the two have parted. The one thing it reaches into the package for
35
+ * is the *list of names* — there is no public enumeration — and that stays in
36
+ * the test, never in what ships.
37
+ *
38
+ * Signatures are JSONata's own notation; `signature.ts` reads it.
39
+ */
40
+ export declare const BUILTIN_SIGNATURES: Readonly<Record<string, string>>;
41
+ /** True when JSONata has a builtin by this name (with or without the `$`). */
42
+ export declare function isBuiltin(name: string): boolean;
43
+ /** JSONata's declared signature for a builtin, or undefined when it has none. */
44
+ export declare function builtinSignature(name: string): string | undefined;
45
+ //# sourceMappingURL=jsonata-signatures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonata-signatures.d.ts","sourceRoot":"","sources":["../../src/util/jsonata-signatures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgE/D,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAK/C;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEjE"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Every JSONata builtin, with the signature JSONata itself declares for it.
3
+ *
4
+ * **Generated, not written.** The names come from `staticFrame.bind('…')` in the
5
+ * installed `jsonata`, and each signature from evaluating `$name` — a builtin
6
+ * resolves to an object carrying `signature.definition`. `jsonata-signatures.test.ts`
7
+ * re-derives this table from the installed package and fails if it has drifted,
8
+ * so an upgrade cannot silently leave it stale.
9
+ *
10
+ * ## Why this is here at all
11
+ *
12
+ * The alternative was writing the types out by hand, and that was tried first:
13
+ * it put `object` on `$keys`, `array` on `$distinct` and `array` on `$append`,
14
+ * all three of which really take anything — so correct expressions were refused.
15
+ * A type checker that is wrong is worse than none, and the only defence is to
16
+ * take the types from the language rather than restate them.
17
+ *
18
+ * It also buys reach: every one of these is typed, not the twenty-odd a curated
19
+ * list would cover, and a name absent from this table is a name JSONata does not
20
+ * have — which is how a typo gets caught.
21
+ *
22
+ * ## Why generated rather than read at run time
23
+ *
24
+ * JSONata does expose these through its public API — `jsonata('$sum')
25
+ * .evaluate({})` resolves to the builtin object and carries
26
+ * `signature.definition`, no internals involved. The reason not to is that
27
+ * `evaluate` is **async**, and the catalogue it would feed is consulted
28
+ * synchronously while a menu renders. Reading them live would make building the
29
+ * catalogue async, or need a top-level await, to learn facts that are fixed for
30
+ * a given version of the dependency.
31
+ *
32
+ * So the table is a build-time snapshot of a run-time truth, and the drift test
33
+ * is what makes that safe: it takes the same public route on every run and
34
+ * fails if the two have parted. The one thing it reaches into the package for
35
+ * is the *list of names* — there is no public enumeration — and that stays in
36
+ * the test, never in what ships.
37
+ *
38
+ * Signatures are JSONata's own notation; `signature.ts` reads it.
39
+ */
40
+ export const BUILTIN_SIGNATURES = {
41
+ abs: '<n-:n>',
42
+ append: '<xx:a>',
43
+ assert: '<bs?:x>',
44
+ average: '<a<n>:n>',
45
+ base64decode: '<s-:s>',
46
+ base64encode: '<s-:s>',
47
+ boolean: '<x-:b>',
48
+ ceil: '<n-:n>',
49
+ clone: '<(oa)-:o>',
50
+ contains: '<s-(sf):b>',
51
+ count: '<a:n>',
52
+ decodeUrl: '<s-:s>',
53
+ decodeUrlComponent: '<s-:s>',
54
+ distinct: '<x:x>',
55
+ each: '<o-f:a>',
56
+ encodeUrl: '<s-:s>',
57
+ encodeUrlComponent: '<s-:s>',
58
+ error: '<s?:x>',
59
+ eval: '<sx?:x>',
60
+ exists: '<x:b>',
61
+ filter: '<af>',
62
+ floor: '<n-:n>',
63
+ formatBase: '<n-n?:s>',
64
+ formatInteger: '<n-s:s>',
65
+ formatNumber: '<n-so?:s>',
66
+ fromMillis: '<n-s?s?:s>',
67
+ join: '<a<s>s?:s>',
68
+ keys: '<x-:a<s>>',
69
+ length: '<s-:n>',
70
+ lookup: '<x-s:x>',
71
+ lowercase: '<s-:s>',
72
+ map: '<af>',
73
+ match: '<s-f<s:o>n?:a<o>>',
74
+ max: '<a<n>:n>',
75
+ merge: '<a<o>:o>',
76
+ min: '<a<n>:n>',
77
+ not: '<x-:b>',
78
+ number: '<(nsb)-:n>',
79
+ pad: '<s-ns?:s>',
80
+ parseInteger: '<s-s:n>',
81
+ power: '<n-n:n>',
82
+ random: '<:n>',
83
+ reduce: '<afj?:j>',
84
+ replace: '<s-(sf)(sf)n?:s>',
85
+ reverse: '<a:a>',
86
+ round: '<n-n?:n>',
87
+ shuffle: '<a:a>',
88
+ sift: '<o-f?:o>',
89
+ single: '<af?>',
90
+ sort: '<af?:a>',
91
+ split: '<s-(sf)n?:a<s>>',
92
+ spread: '<x-:a<o>>',
93
+ sqrt: '<n-:n>',
94
+ string: '<x-b?:s>',
95
+ substring: '<s-nn?:s>',
96
+ substringAfter: '<s-s:s>',
97
+ substringBefore: '<s-s:s>',
98
+ sum: '<a<n>:n>',
99
+ toMillis: '<s-s?:n>',
100
+ trim: '<s-:s>',
101
+ type: '<x:s>',
102
+ uppercase: '<s-:s>',
103
+ zip: '<a+>',
104
+ };
105
+ /** True when JSONata has a builtin by this name (with or without the `$`). */
106
+ export function isBuiltin(name) {
107
+ return Object.prototype.hasOwnProperty.call(BUILTIN_SIGNATURES, name.startsWith('$') ? name.slice(1) : name);
108
+ }
109
+ /** JSONata's declared signature for a builtin, or undefined when it has none. */
110
+ export function builtinSignature(name) {
111
+ return BUILTIN_SIGNATURES[name.startsWith('$') ? name.slice(1) : name];
112
+ }
113
+ //# sourceMappingURL=jsonata-signatures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonata-signatures.js","sourceRoot":"","sources":["../../src/util/jsonata-signatures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO;IAC3B,KAAK,EAAe,UAAU;IAC9B,OAAO,EAAa,OAAO;IAC3B,IAAI,EAAgB,UAAU;IAC9B,MAAM,EAAc,OAAO;IAC3B,IAAI,EAAgB,SAAS;IAC7B,KAAK,EAAe,iBAAiB;IACrC,MAAM,EAAc,WAAW;IAC/B,IAAI,EAAgB,QAAQ;IAC5B,MAAM,EAAc,UAAU;IAC9B,SAAS,EAAW,WAAW;IAC/B,cAAc,EAAM,SAAS;IAC7B,eAAe,EAAK,SAAS;IAC7B,GAAG,EAAiB,UAAU;IAC9B,QAAQ,EAAY,UAAU;IAC9B,IAAI,EAAgB,QAAQ;IAC5B,IAAI,EAAgB,OAAO;IAC3B,SAAS,EAAW,QAAQ;IAC5B,GAAG,EAAiB,MAAM;CAC3B,CAAC;AAEF,8EAA8E;AAC9E,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CACzC,kBAAkB,EAClB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAC5C,CAAC;AACJ,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACzE,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Reads JSONata's signature notation — `<a<n>:n>` is "a list of numbers, giving
3
+ * a number".
4
+ *
5
+ * Written here because JSONata's own parser is bundled with no import path to
6
+ * it, and no standalone package exists; the Go port wrote its own and the Rust
7
+ * one dropped signatures entirely. What *is* reachable, `signature.validate`,
8
+ * checks values, and author-time checking has types and no values.
9
+ *
10
+ * s n b l o a f string, number, boolean, null, object, array, function
11
+ * u j x some scalar, any JSON, anything
12
+ * a<T> a list of T — the distinction the checker rests on
13
+ * (sf) either; read as `unknown`
14
+ * - ? + from context, optional, variadic
15
+ */
16
+ import type { ExprType } from './type-compat.js';
17
+ export interface SignatureParam {
18
+ type: ExprType;
19
+ /** Declared `?` — absent is fine. */
20
+ optional: boolean;
21
+ /** Declared `+` — this type, one or more times, to the end of the call. */
22
+ variadic: boolean;
23
+ /**
24
+ * Declared `-` — JSONata may supply this argument from the context when it is left out.
25
+ */
26
+ fromContext: boolean;
27
+ /** Declared `f` — this argument is a function. */
28
+ isFunction: boolean;
29
+ }
30
+ export interface Signature {
31
+ params: SignatureParam[];
32
+ /** `unknown` when the signature declares no return, as `<af>` does. */
33
+ returns: ExprType;
34
+ }
35
+ /** Read a signature, or null when it cannot be read. */
36
+ export declare function parseSignature(definition: string): Signature | null;
37
+ /**
38
+ * The parameter governing argument `index`, or undefined when the call has more arguments than the signature describes.
39
+ */
40
+ export declare function paramAt(signature: Signature, index: number): SignatureParam | undefined;
41
+ //# sourceMappingURL=signature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/util/signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,uEAAuE;IACvE,OAAO,EAAE,QAAQ,CAAC;CACnB;AAwED,wDAAwD;AACxD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAmCnE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAKvF"}
@@ -0,0 +1,124 @@
1
+ /** One type, from `at`, and where reading it finished. */
2
+ function readType(definition, at) {
3
+ const char = definition[at];
4
+ if (char === undefined)
5
+ return null;
6
+ let i = at + 1;
7
+ // Either of several things — not describable, so not checked.
8
+ if (char === '(') {
9
+ for (let depth = 1; i < definition.length && depth > 0; i++) {
10
+ if (definition[i] === '(')
11
+ depth++;
12
+ else if (definition[i] === ')')
13
+ depth--;
14
+ }
15
+ return { type: 'unknown', next: i };
16
+ }
17
+ if (char === 'a') {
18
+ if (definition[i] !== '<')
19
+ return { type: 'array', next: i };
20
+ const inner = readType(definition, i + 1);
21
+ if (inner === null || definition[inner.next] !== '>')
22
+ return null;
23
+ return { type: { array: inner.type }, next: inner.next + 1 };
24
+ }
25
+ if (char === 'f') {
26
+ // A function, possibly with a signature of its own. Nothing in this
27
+ if (definition[i] === '<') {
28
+ for (let depth = 1; i < definition.length && depth > 0;) {
29
+ i++;
30
+ if (definition[i] === '<')
31
+ depth++;
32
+ else if (definition[i] === '>')
33
+ depth--;
34
+ }
35
+ i++;
36
+ }
37
+ return { type: 'unknown', next: i, isFunction: true };
38
+ }
39
+ switch (char) {
40
+ case 's':
41
+ return { type: 'string', next: i };
42
+ case 'n':
43
+ return { type: 'number', next: i };
44
+ case 'b':
45
+ return { type: 'boolean', next: i };
46
+ case 'o':
47
+ return { type: 'object', next: i };
48
+ // `l` is null, `u`/`j`/`x` are "some scalar" / "any JSON" / "anything".
49
+ case 'l':
50
+ case 'u':
51
+ case 'j':
52
+ case 'x':
53
+ return { type: 'unknown', next: i };
54
+ default:
55
+ return null;
56
+ }
57
+ }
58
+ /** Where the parameters end and the return type begins, or -1 for neither. */
59
+ function returnSeparator(body) {
60
+ let depth = 0;
61
+ for (let i = 0; i < body.length; i++) {
62
+ const char = body[i];
63
+ if (char === '<' || char === '(')
64
+ depth++;
65
+ else if (char === '>' || char === ')')
66
+ depth--;
67
+ else if (char === ':' && depth === 0)
68
+ return i;
69
+ }
70
+ return -1;
71
+ }
72
+ /** Read a signature, or null when it cannot be read. */
73
+ export function parseSignature(definition) {
74
+ if (!definition.startsWith('<') || !definition.endsWith('>'))
75
+ return null;
76
+ const body = definition.slice(1, -1);
77
+ const separator = returnSeparator(body);
78
+ const paramText = separator === -1 ? body : body.slice(0, separator);
79
+ const returnText = separator === -1 ? '' : body.slice(separator + 1);
80
+ const params = [];
81
+ let at = 0;
82
+ while (at < paramText.length) {
83
+ const read = readType(paramText, at);
84
+ if (read === null)
85
+ return null;
86
+ at = read.next;
87
+ const param = {
88
+ type: read.type,
89
+ optional: false,
90
+ variadic: false,
91
+ fromContext: false,
92
+ isFunction: read.isFunction ?? false,
93
+ };
94
+ // Modifiers follow the type, in any order and any number.
95
+ for (; at < paramText.length; at++) {
96
+ if (paramText[at] === '?')
97
+ param.optional = true;
98
+ else if (paramText[at] === '+')
99
+ param.variadic = true;
100
+ else if (paramText[at] === '-')
101
+ param.fromContext = true;
102
+ else
103
+ break;
104
+ }
105
+ params.push(param);
106
+ }
107
+ if (returnText === '')
108
+ return { params, returns: 'unknown' };
109
+ const returned = readType(returnText, 0);
110
+ if (returned === null || returned.next !== returnText.length)
111
+ return null;
112
+ return { params, returns: returned.type };
113
+ }
114
+ /**
115
+ * The parameter governing argument `index`, or undefined when the call has more arguments than the signature describes.
116
+ */
117
+ export function paramAt(signature, index) {
118
+ const exact = signature.params[index];
119
+ if (exact)
120
+ return exact;
121
+ const last = signature.params[signature.params.length - 1];
122
+ return last?.variadic ? last : undefined;
123
+ }
124
+ //# sourceMappingURL=signature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src/util/signature.ts"],"names":[],"mappings":"AAqCA,0DAA0D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,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3D,OAAO,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3C,CAAC"}
@@ -1,35 +1,15 @@
1
1
  /**
2
- * type-compat — the single source of truth for "can a `{{ref}}` of one type be
3
- * bound into a field of another type?"
2
+ * How types are compared. `TypeKind` for a single value, `ExprType` to say "a
3
+ * list of" one level down; everything deeper is `unknown`.
4
4
  *
5
- * This rule is enforced in three layers that must never drift:
6
- * - the builder's variable picker (UI, JSON-Schema side) — which refs to offer;
7
- * - the config validator (`TYPE_MISMATCH`, JSON-Schema source vs Zod consumer);
8
- * - the runtime (coercion before `safeParse`).
9
- *
10
- * It is expressed over a **neutral** `TypeKind`, NOT Zod or JSON-Schema types,
11
- * because it straddles both worlds: the consumer side is Zod, but the source
12
- * side is JSON Schema that crosses the wire to the browser (no Zod instance
13
- * there). Each world maps *into* `TypeKind` via its own adapter
14
- * (`jsonSchemaKind` / `zodConsumerKind` in the validator); this module never
15
- * touches a schema object. This is a deliberate anti-corruption boundary, and
16
- * keeps the predicate serializable and Zod-version-agnostic.
5
+ * Two assignability rules, and the difference is the point: a *field* coerces,
6
+ * because the runtime stringifies whatever lands in it, and an *argument* does
7
+ * not, because JSONata answers a mismatched parameter with T0410.
17
8
  */
18
- /** The neutral, coarse type vocabulary both schema worlds normalize into. */
19
9
  export declare const TYPE_KINDS: readonly ["string", "number", "boolean", "array", "object", "scalar", "unknown"];
20
10
  export type TypeKind = (typeof TYPE_KINDS)[number];
21
- /**
22
- * Can a value of `source` kind be bound into a `target` (consumer) kind field?
23
- *
24
- * Loose by design (matches the validator's long-standing rule):
25
- * - `unknown`/freeform on either side is always compatible (can't be checked);
26
- * - any source coerces into a `string` target — string is the universal sink
27
- * (templates stringify, and the runtime stringifies pure refs too);
28
- * - equal kinds are compatible;
29
- * - scalar↔scalar is compatible (number↔enum, etc.).
30
- *
31
- * Notably strict: `array`/`object` only accept their own kind (or a `string`
32
- * target, or an `unknown` either side).
33
- */
11
+ /** Can a value of `source` kind be bound into a `target` (consumer) kind field? */
34
12
  export declare function kindsCompatible(source: TypeKind, target: TypeKind): boolean;
13
+ /** A JSON-Schema `type` keyword as a {@link TypeKind}. */
14
+ export declare function kindOfJsonType(type: string | undefined): TypeKind;
35
15
  //# sourceMappingURL=type-compat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-compat.d.ts","sourceRoot":"","sources":["../../src/util/type-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,UAAU,kFAWb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAInD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAK3E"}
1
+ {"version":3,"file":"type-compat.d.ts","sourceRoot":"","sources":["../../src/util/type-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,kFAUb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAInD,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAK3E;AAID,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAajE"}
@@ -1,21 +1,11 @@
1
1
  /**
2
- * type-compat — the single source of truth for "can a `{{ref}}` of one type be
3
- * bound into a field of another type?"
2
+ * How types are compared. `TypeKind` for a single value, `ExprType` to say "a
3
+ * list of" one level down; everything deeper is `unknown`.
4
4
  *
5
- * This rule is enforced in three layers that must never drift:
6
- * - the builder's variable picker (UI, JSON-Schema side) — which refs to offer;
7
- * - the config validator (`TYPE_MISMATCH`, JSON-Schema source vs Zod consumer);
8
- * - the runtime (coercion before `safeParse`).
9
- *
10
- * It is expressed over a **neutral** `TypeKind`, NOT Zod or JSON-Schema types,
11
- * because it straddles both worlds: the consumer side is Zod, but the source
12
- * side is JSON Schema that crosses the wire to the browser (no Zod instance
13
- * there). Each world maps *into* `TypeKind` via its own adapter
14
- * (`jsonSchemaKind` / `zodConsumerKind` in the validator); this module never
15
- * touches a schema object. This is a deliberate anti-corruption boundary, and
16
- * keeps the predicate serializable and Zod-version-agnostic.
5
+ * Two assignability rules, and the difference is the point: a *field* coerces,
6
+ * because the runtime stringifies whatever lands in it, and an *argument* does
7
+ * not, because JSONata answers a mismatched parameter with T0410.
17
8
  */
18
- /** The neutral, coarse type vocabulary both schema worlds normalize into. */
19
9
  export const TYPE_KINDS = [
20
10
  'string',
21
11
  'number',
@@ -23,25 +13,12 @@ export const TYPE_KINDS = [
23
13
  'array',
24
14
  'object',
25
15
  // `scalar` is an intentional coarsening bucket (enum / literal / date) so the
26
- // loose scalar↔scalar rule below has a single home.
27
16
  'scalar',
28
17
  // `unknown` = freeform / no declared type / union — unverifiable, so wildcard.
29
18
  'unknown',
30
19
  ];
31
20
  const SCALAR_KINDS = new Set(['string', 'number', 'boolean', 'scalar']);
32
- /**
33
- * Can a value of `source` kind be bound into a `target` (consumer) kind field?
34
- *
35
- * Loose by design (matches the validator's long-standing rule):
36
- * - `unknown`/freeform on either side is always compatible (can't be checked);
37
- * - any source coerces into a `string` target — string is the universal sink
38
- * (templates stringify, and the runtime stringifies pure refs too);
39
- * - equal kinds are compatible;
40
- * - scalar↔scalar is compatible (number↔enum, etc.).
41
- *
42
- * Notably strict: `array`/`object` only accept their own kind (or a `string`
43
- * target, or an `unknown` either side).
44
- */
21
+ /** Can a value of `source` kind be bound into a `target` (consumer) kind field? */
45
22
  export function kindsCompatible(source, target) {
46
23
  if (source === 'unknown' || target === 'unknown')
47
24
  return true;
@@ -51,4 +28,20 @@ export function kindsCompatible(source, target) {
51
28
  return true;
52
29
  return SCALAR_KINDS.has(source) && SCALAR_KINDS.has(target);
53
30
  }
31
+ // ─── Expression types ───
32
+ /** A JSON-Schema `type` keyword as a {@link TypeKind}. */
33
+ export function kindOfJsonType(type) {
34
+ switch (type) {
35
+ case 'integer':
36
+ case 'number':
37
+ return 'number';
38
+ case 'string':
39
+ case 'boolean':
40
+ case 'array':
41
+ case 'object':
42
+ return type;
43
+ default:
44
+ return 'unknown';
45
+ }
46
+ }
54
47
  //# sourceMappingURL=type-compat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-compat.js","sourceRoot":"","sources":["../../src/util/type-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,8EAA8E;IAC9E,oDAAoD;IACpD,QAAQ;IACR,+EAA+E;IAC/E,SAAS;CACD,CAAC;AAIX,MAAM,YAAY,GAAG,IAAI,GAAG,CAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAC,MAAgB,EAAE,MAAgB;IAChE,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC9D,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC9D,CAAC"}
1
+ {"version":3,"file":"type-compat.js","sourceRoot":"","sources":["../../src/util/type-compat.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,8EAA8E;IAC9E,QAAQ;IACR,+EAA+E;IAC/E,SAAS;CACD,CAAC;AAIX,MAAM,YAAY,GAAG,IAAI,GAAG,CAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElF,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,MAAgB,EAAE,MAAgB;IAChE,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC9D,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC9D,CAAC;AAED,2BAA2B;AAE3B,0DAA0D;AAC1D,MAAM,UAAU,cAAc,CAAC,IAAwB;IACrD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC;QACd;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -48,6 +48,19 @@ export interface FoundRef {
48
48
  * passes a control step's branch arrays, whose steps it checks in their own scope.
49
49
  */
50
50
  export declare function collectRefs(value: unknown, prefix: string, skip?: ReadonlySet<unknown>): FoundRef[];
51
+ /**
52
+ * Visit every string in a nested config object, with its JSON-pointer-style
53
+ * location.
54
+ *
55
+ * Extracted from {@link collectRefs} so the `{% expression %}` collector can
56
+ * walk a config the same way without duplicating the traversal — and, more to
57
+ * the point, without this file having to know that expressions exist. That
58
+ * matters: the UI imports this module on every screen, and the expression
59
+ * engine is a ~850 KB dependency that must not be dragged along with it.
60
+ *
61
+ * `skip` holds values not to descend into, matched by identity.
62
+ */
63
+ export declare function walkConfigStrings(value: unknown, prefix: string, skip: ReadonlySet<unknown> | undefined, visit: (text: string, location: string) => void): void;
51
64
  /**
52
65
  * Parsed view of a ref path's head. Mirrors the branching in
53
66
  * `resolvePath` (engine/variable-resolver.ts) — the single rule for how a
@@ -74,6 +87,17 @@ export declare function parseRef(refPath: string): ParsedRef;
74
87
  * Find the ids of every step whose config references `stepId`'s output
75
88
  * (e.g. `{{stepId.output.x}}`). Used to warn before deleting a referenced step.
76
89
  * Excludes the target itself; works across nested branches/loops.
90
+ *
91
+ * **Known gap: `{% expressions %}` are not searched.** A step referenced only
92
+ * from inside an expression is not reported here, so deleting it would not warn.
93
+ * Closing it needs the JSONata AST (`refsInExpression`), and this module is
94
+ * deliberately free of that dependency — the UI imports it on every screen.
95
+ *
96
+ * The fix is to move this function to a module that may import both grammars,
97
+ * keeping the name and re-exporting it, rather than to make this file heavy. It
98
+ * is not urgent: nothing can author an expression until the editor supports
99
+ * one, and the warning is advisory. It should be done in the same change that
100
+ * teaches the editor to write expressions.
77
101
  */
78
102
  export declare function findStepsReferencing(config: WorkflowConfig, stepId: string): string[];
79
103
  //# sourceMappingURL=variable-ref.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"variable-ref.d.ts","sourceRoot":"","sources":["../../src/util/variable-ref.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,6BAA6B,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAkC,CAAC;AAElE,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,C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,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAoBnD;AAkED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAWrF"}
@@ -60,29 +60,43 @@ export function extractRefPath(value) {
60
60
  */
61
61
  export function collectRefs(value, prefix, skip) {
62
62
  const out = [];
63
- walk(value, prefix, out, skip);
63
+ walkConfigStrings(value, prefix, skip, (text, location) => {
64
+ TOKEN_REGEX.lastIndex = 0;
65
+ let match;
66
+ while ((match = TOKEN_REGEX.exec(text)) !== null) {
67
+ out.push({ refPath: match[1], location });
68
+ }
69
+ });
64
70
  return out;
65
71
  }
66
- function walk(value, prefix, out, skip) {
72
+ /**
73
+ * Visit every string in a nested config object, with its JSON-pointer-style
74
+ * location.
75
+ *
76
+ * Extracted from {@link collectRefs} so the `{% expression %}` collector can
77
+ * walk a config the same way without duplicating the traversal — and, more to
78
+ * the point, without this file having to know that expressions exist. That
79
+ * matters: the UI imports this module on every screen, and the expression
80
+ * engine is a ~850 KB dependency that must not be dragged along with it.
81
+ *
82
+ * `skip` holds values not to descend into, matched by identity.
83
+ */
84
+ export function walkConfigStrings(value, prefix, skip, visit) {
67
85
  if (skip?.has(value))
68
86
  return;
69
87
  if (typeof value === 'string') {
70
- TOKEN_REGEX.lastIndex = 0;
71
- let match;
72
- while ((match = TOKEN_REGEX.exec(value)) !== null) {
73
- out.push({ refPath: match[1], location: prefix });
74
- }
88
+ visit(value, prefix);
75
89
  return;
76
90
  }
77
91
  if (Array.isArray(value)) {
78
92
  for (let i = 0; i < value.length; i++) {
79
- walk(value[i], `${prefix}[${i}]`, out, skip);
93
+ walkConfigStrings(value[i], `${prefix}[${i}]`, skip, visit);
80
94
  }
81
95
  return;
82
96
  }
83
97
  if (value !== null && typeof value === 'object') {
84
98
  for (const [k, v] of Object.entries(value)) {
85
- walk(v, prefix ? `${prefix}.${k}` : k, out, skip);
99
+ walkConfigStrings(v, prefix ? `${prefix}.${k}` : k, skip, visit);
86
100
  }
87
101
  }
88
102
  }
@@ -171,6 +185,17 @@ function walkSteps(value, visit) {
171
185
  * Find the ids of every step whose config references `stepId`'s output
172
186
  * (e.g. `{{stepId.output.x}}`). Used to warn before deleting a referenced step.
173
187
  * Excludes the target itself; works across nested branches/loops.
188
+ *
189
+ * **Known gap: `{% expressions %}` are not searched.** A step referenced only
190
+ * from inside an expression is not reported here, so deleting it would not warn.
191
+ * Closing it needs the JSONata AST (`refsInExpression`), and this module is
192
+ * deliberately free of that dependency — the UI imports it on every screen.
193
+ *
194
+ * The fix is to move this function to a module that may import both grammars,
195
+ * keeping the name and re-exporting it, rather than to make this file heavy. It
196
+ * is not urgent: nothing can author an expression until the editor supports
197
+ * one, and the warning is advisory. It should be done in the same change that
198
+ * teaches the editor to write expressions.
174
199
  */
175
200
  export function findStepsReferencing(config, stepId) {
176
201
  const result = [];
@@ -1 +1 @@
1
- {"version":3,"file":"variable-ref.js","sourceRoot":"","sources":["../../src/util/variable-ref.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;AAMlE,gEAAgE;AAChE,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,MAAM,MAAM,GAAuB,EAAE,CAAC;IACtC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,WAAW,CAAC,SAAS,GAAG,CAAC,CAAC;IAE1B,IAAI,KAA6B,CAAC;IAClC,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IA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