@fluidgrids/workflows 0.0.0-stage → 2026.1027.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 (60) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +208 -2
  3. package/dist/assemble-CrpUyd_3.d.ts +587 -0
  4. package/dist/assemble-DEf3znGD.d.cts +587 -0
  5. package/dist/chunk-3M34AUIY.cjs +27 -0
  6. package/dist/chunk-5AW745OG.js +25 -0
  7. package/dist/chunk-5LUIDMF4.js +42 -0
  8. package/dist/chunk-6AIAC2FP.cjs +185 -0
  9. package/dist/chunk-6BEW4QD6.js +95 -0
  10. package/dist/chunk-6U446SKY.js +263 -0
  11. package/dist/chunk-7YR7DI7B.cjs +274 -0
  12. package/dist/chunk-CSYBNN3V.cjs +252 -0
  13. package/dist/chunk-E3APHA6O.cjs +199 -0
  14. package/dist/chunk-EEAIM35V.js +748 -0
  15. package/dist/chunk-G4UEPUGO.cjs +46 -0
  16. package/dist/chunk-IHKXLG6I.js +246 -0
  17. package/dist/chunk-MBBKGD7K.js +440 -0
  18. package/dist/chunk-OSPTJCDI.cjs +102 -0
  19. package/dist/chunk-TQF7MYEN.cjs +771 -0
  20. package/dist/chunk-TWOYB4Y7.cjs +76 -0
  21. package/dist/chunk-UB2BHU2M.js +174 -0
  22. package/dist/chunk-UJNHTS6D.js +181 -0
  23. package/dist/chunk-UWQWD7BP.cjs +931 -0
  24. package/dist/chunk-W32BSO3M.js +74 -0
  25. package/dist/chunk-XBIID5DY.js +893 -0
  26. package/dist/chunk-Y7NWR3WH.cjs +450 -0
  27. package/dist/codegen/index.cjs +18 -0
  28. package/dist/codegen/index.d.cts +15 -0
  29. package/dist/codegen/index.d.ts +15 -0
  30. package/dist/codegen/index.js +5 -0
  31. package/dist/expressions-DhHaqyar.d.cts +62 -0
  32. package/dist/expressions-DhHaqyar.d.ts +62 -0
  33. package/dist/hash-CZkTXPCX.d.cts +15 -0
  34. package/dist/hash-CZkTXPCX.d.ts +15 -0
  35. package/dist/index.cjs +117 -0
  36. package/dist/index.d.cts +27 -0
  37. package/dist/index.d.ts +27 -0
  38. package/dist/index.js +4 -0
  39. package/dist/ir/index.cjs +1246 -0
  40. package/dist/ir/index.d.cts +838 -0
  41. package/dist/ir/index.d.ts +838 -0
  42. package/dist/ir/index.js +1122 -0
  43. package/dist/lower-CXggJTIo.d.ts +67 -0
  44. package/dist/lower-DAzvsJCo.d.cts +67 -0
  45. package/dist/manifest-Bp9ZJlav.d.ts +60 -0
  46. package/dist/manifest-Duf-gHdO.d.cts +60 -0
  47. package/dist/node-evaluator-CH3XCJND.cjs +17 -0
  48. package/dist/node-evaluator-TULXA3WE.js +8 -0
  49. package/dist/quickjs/index.cjs +46 -0
  50. package/dist/quickjs/index.d.cts +18 -0
  51. package/dist/quickjs/index.d.ts +18 -0
  52. package/dist/quickjs/index.js +44 -0
  53. package/dist/roundtrip/index.cjs +1448 -0
  54. package/dist/roundtrip/index.d.cts +290 -0
  55. package/dist/roundtrip/index.d.ts +290 -0
  56. package/dist/roundtrip/index.js +1397 -0
  57. package/dist/types-Dr2Fn1Ax.d.cts +225 -0
  58. package/dist/types-Dr2Fn1Ax.d.ts +225 -0
  59. package/package.json +143 -4
  60. package/schema/ir-v2.schema.json +655 -0
@@ -0,0 +1,199 @@
1
+ 'use strict';
2
+
3
+ // node_modules/tsup/assets/cjs_shims.js
4
+ var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
5
+ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
6
+
7
+ // src/ir/json-utils.ts
8
+ function isRecord(value) {
9
+ return typeof value === "object" && value !== null && !Array.isArray(value);
10
+ }
11
+ function deepEqual(left, right) {
12
+ if (left === right) return true;
13
+ if (Array.isArray(left)) {
14
+ if (!Array.isArray(right) || left.length !== right.length) return false;
15
+ return left.every((item, index) => deepEqual(item, right[index]));
16
+ }
17
+ if (isRecord(left)) {
18
+ if (!isRecord(right)) return false;
19
+ const leftKeys = Object.keys(left).filter((key) => left[key] !== void 0);
20
+ const rightKeys = Object.keys(right).filter((key) => right[key] !== void 0);
21
+ if (leftKeys.length !== rightKeys.length) return false;
22
+ return leftKeys.every((key) => Object.hasOwn(right, key) && deepEqual(left[key], right[key]));
23
+ }
24
+ return false;
25
+ }
26
+ function setOwn(target, key, value) {
27
+ Object.defineProperty(target, key, {
28
+ value,
29
+ enumerable: true,
30
+ writable: true,
31
+ configurable: true
32
+ });
33
+ }
34
+ function ownValue(record, key) {
35
+ return Object.hasOwn(record, key) ? record[key] : void 0;
36
+ }
37
+ function cloneJson(value) {
38
+ return structuredCloneJson(value);
39
+ }
40
+ function structuredCloneJson(value) {
41
+ if (Array.isArray(value)) return value.map(structuredCloneJson);
42
+ if (isRecord(value)) {
43
+ const out = {};
44
+ for (const [key, child] of Object.entries(value)) {
45
+ if (child !== void 0) setOwn(out, key, structuredCloneJson(child));
46
+ }
47
+ return out;
48
+ }
49
+ return value;
50
+ }
51
+
52
+ // src/ir/expressions.ts
53
+ var IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
54
+ function segmentFromKey(key) {
55
+ return /^(0|[1-9][0-9]{0,8})$/.test(key) ? { kind: "index", index: Number(key) } : { kind: "key", key };
56
+ }
57
+ function formatPath(path) {
58
+ return path.map((segment) => {
59
+ if (segment.kind === "index") return `[${segment.index}]`;
60
+ return IDENTIFIER.test(segment.key) ? `.${segment.key}` : `[${JSON.stringify(segment.key)}]`;
61
+ }).join("");
62
+ }
63
+ function formatRefExpression(ref) {
64
+ const path = formatPath(ref.path);
65
+ switch (ref.root.kind) {
66
+ case "node":
67
+ return `$node[${JSON.stringify(ref.root.nodeId)}].item${path}`;
68
+ case "json":
69
+ return `$json${path}`;
70
+ case "vars":
71
+ return `$vars${path}`;
72
+ case "now":
73
+ return `$now${path}`;
74
+ case "execution":
75
+ return `$execution${path}`;
76
+ }
77
+ }
78
+ function formatRefTemplate(ref) {
79
+ return `{{ ${formatRefExpression(ref)} }}`;
80
+ }
81
+ function readJsonString(text, start) {
82
+ if (text[start] !== '"') return void 0;
83
+ let index = start + 1;
84
+ while (index < text.length) {
85
+ const char = text[index];
86
+ if (char === "\\") {
87
+ index += 2;
88
+ continue;
89
+ }
90
+ if (char === '"') {
91
+ try {
92
+ const value = JSON.parse(text.slice(start, index + 1));
93
+ return typeof value === "string" ? { value, end: index + 1 } : void 0;
94
+ } catch {
95
+ return void 0;
96
+ }
97
+ }
98
+ index++;
99
+ }
100
+ return void 0;
101
+ }
102
+ function parsePath(text, start) {
103
+ const path = [];
104
+ let index = start;
105
+ while (index < text.length) {
106
+ if (text[index] === ".") {
107
+ const match = /^[A-Za-z_$][A-Za-z0-9_$]*/.exec(text.slice(index + 1));
108
+ if (!match) return void 0;
109
+ path.push({ kind: "key", key: match[0] });
110
+ index += 1 + match[0].length;
111
+ continue;
112
+ }
113
+ if (text[index] === "[") {
114
+ const digits = /^\[(0|[1-9][0-9]{0,8})\]/.exec(text.slice(index));
115
+ if (digits?.[1] !== void 0) {
116
+ path.push({ kind: "index", index: Number(digits[1]) });
117
+ index += digits[0].length;
118
+ continue;
119
+ }
120
+ const literal = readJsonString(text, index + 1);
121
+ if (!literal || text[literal.end] !== "]") return void 0;
122
+ path.push({ kind: "key", key: literal.value });
123
+ index = literal.end + 1;
124
+ continue;
125
+ }
126
+ return void 0;
127
+ }
128
+ return path;
129
+ }
130
+ function parseRefExpressionLoose(expression) {
131
+ if (expression.startsWith("$node[")) {
132
+ const literal = readJsonString(expression, "$node[".length);
133
+ if (!literal) return void 0;
134
+ const rest = expression.slice(literal.end);
135
+ if (!rest.startsWith("].item")) return void 0;
136
+ const path = parsePath(expression, literal.end + "].item".length);
137
+ return path ? { root: { kind: "node", nodeId: literal.value }, path } : void 0;
138
+ }
139
+ for (const [prefix, kind] of [
140
+ ["$json", "json"],
141
+ ["$vars", "vars"],
142
+ ["$now", "now"],
143
+ ["$execution", "execution"]
144
+ ]) {
145
+ if (expression === prefix || expression.startsWith(`${prefix}.`) || expression.startsWith(`${prefix}[`)) {
146
+ const path = parsePath(expression, prefix.length);
147
+ return path ? { root: { kind }, path } : void 0;
148
+ }
149
+ }
150
+ return void 0;
151
+ }
152
+ function parseRefExpression(expression) {
153
+ const ref = parseRefExpressionLoose(expression);
154
+ return ref && formatRefExpression(ref) === expression ? ref : void 0;
155
+ }
156
+ function parseTemplate(text) {
157
+ if (!text.includes("{{")) return void 0;
158
+ const parts = [];
159
+ let index = 0;
160
+ let sawRef = false;
161
+ while (index < text.length) {
162
+ const open = text.indexOf("{{", index);
163
+ if (open === -1) {
164
+ parts.push({ kind: "text", text: text.slice(index) });
165
+ break;
166
+ }
167
+ if (open > index) parts.push({ kind: "text", text: text.slice(index, open) });
168
+ const close = text.indexOf(" }}", open);
169
+ if (close === -1 || text[open + 2] !== " ") return void 0;
170
+ const ref = parseRefExpression(text.slice(open + 3, close));
171
+ if (!ref) return void 0;
172
+ parts.push({ kind: "ref", ref });
173
+ sawRef = true;
174
+ index = close + 3;
175
+ }
176
+ if (!sawRef) return void 0;
177
+ const rebuilt = parts.map((part) => part.kind === "text" ? part.text : formatRefTemplate(part.ref)).join("");
178
+ return rebuilt === text ? parts : void 0;
179
+ }
180
+ function hasLegacyTemplate(text) {
181
+ return /\$\{[\s\S]*?\}/.test(text);
182
+ }
183
+ function isJsIdentifier(name) {
184
+ return IDENTIFIER.test(name);
185
+ }
186
+
187
+ exports.cloneJson = cloneJson;
188
+ exports.deepEqual = deepEqual;
189
+ exports.formatRefExpression = formatRefExpression;
190
+ exports.formatRefTemplate = formatRefTemplate;
191
+ exports.hasLegacyTemplate = hasLegacyTemplate;
192
+ exports.importMetaUrl = importMetaUrl;
193
+ exports.isJsIdentifier = isJsIdentifier;
194
+ exports.isRecord = isRecord;
195
+ exports.ownValue = ownValue;
196
+ exports.parseRefExpression = parseRefExpression;
197
+ exports.parseTemplate = parseTemplate;
198
+ exports.segmentFromKey = segmentFromKey;
199
+ exports.setOwn = setOwn;