@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,74 @@
1
+ import { hashedProjection } from './chunk-6U446SKY.js';
2
+ import { isRecord, deepEqual, ownValue } from './chunk-UJNHTS6D.js';
3
+
4
+ // src/ir/diff.ts
5
+ function keyPath(base, key) {
6
+ return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? base ? `${base}.${key}` : key : `${base}[${JSON.stringify(key)}]`;
7
+ }
8
+ function diffValues(before, after, path, out) {
9
+ if (deepEqual(before, after)) return;
10
+ if (isRecord(before) && isRecord(after)) {
11
+ const keys = [.../* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])].sort();
12
+ for (const key of keys) {
13
+ const left = ownValue(before, key);
14
+ const right = ownValue(after, key);
15
+ if (left === void 0 && right !== void 0)
16
+ out.push({ kind: "added", path: keyPath(path, key), after: right });
17
+ else if (left !== void 0 && right === void 0)
18
+ out.push({ kind: "removed", path: keyPath(path, key), before: left });
19
+ else diffValues(left, right, keyPath(path, key), out);
20
+ }
21
+ return;
22
+ }
23
+ out.push({ kind: "changed", path, before, after });
24
+ }
25
+ function byId(items) {
26
+ const map = /* @__PURE__ */ new Map();
27
+ if (!Array.isArray(items)) return map;
28
+ items.forEach((item, index) => {
29
+ if (!isRecord(item)) return;
30
+ const id = typeof item["id"] === "string" ? item["id"] : `#${index}`;
31
+ if (!map.has(id)) map.set(id, item);
32
+ });
33
+ return map;
34
+ }
35
+ function diffCollection(before, after, path, out) {
36
+ const left = byId(before);
37
+ const right = byId(after);
38
+ for (const [id, item] of left) {
39
+ if (!right.has(id)) out.push({ kind: "removed", path: `${path}[${id}]`, before: item });
40
+ }
41
+ for (const [id, item] of right) {
42
+ const previous = left.get(id);
43
+ if (!previous) out.push({ kind: "added", path: `${path}[${id}]`, after: item });
44
+ else diffValues(previous, item, `${path}[${id}]`, out);
45
+ }
46
+ const common = (ids, other) => ids.filter((id) => other.has(id));
47
+ const leftOrder = common([...left.keys()], right);
48
+ const rightOrder = common([...right.keys()], left);
49
+ if (!deepEqual(leftOrder, rightOrder)) {
50
+ out.push({ kind: "reordered", path, before: leftOrder, after: rightOrder });
51
+ }
52
+ }
53
+ function diffDefinitions(before, after) {
54
+ const left = hashedProjection(before);
55
+ const right = hashedProjection(after);
56
+ const out = [];
57
+ if (!isRecord(left) || !isRecord(right)) {
58
+ diffValues(left, right, "", out);
59
+ return out;
60
+ }
61
+ const { data: leftData, ...leftRest } = left;
62
+ const { data: rightData, ...rightRest } = right;
63
+ diffValues(leftRest, rightRest, "", out);
64
+ const leftDataRecord = isRecord(leftData) ? leftData : {};
65
+ const rightDataRecord = isRecord(rightData) ? rightData : {};
66
+ const { nodes: leftNodes, edges: leftEdges, ...leftDataRest } = leftDataRecord;
67
+ const { nodes: rightNodes, edges: rightEdges, ...rightDataRest } = rightDataRecord;
68
+ diffCollection(leftNodes, rightNodes, "data.nodes", out);
69
+ diffCollection(leftEdges, rightEdges, "data.edges", out);
70
+ diffValues(leftDataRest, rightDataRest, "data", out);
71
+ return out;
72
+ }
73
+
74
+ export { diffDefinitions };