@fluidgrids/workflows 2026.1027.0 → 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 (52) hide show
  1. package/README.md +26 -5
  2. package/dist/{assemble-DMOuaxRI.d.ts → assemble-CrpUyd_3.d.ts} +20 -2
  3. package/dist/{assemble-BJo9TECS.d.cts → assemble-DEf3znGD.d.cts} +20 -2
  4. package/dist/chunk-3M34AUIY.cjs +27 -0
  5. package/dist/chunk-5AW745OG.js +25 -0
  6. package/dist/{chunk-RRQ5HOBF.cjs → chunk-6AIAC2FP.cjs} +4 -4
  7. package/dist/{chunk-GO34UHSY.js → chunk-6BEW4QD6.js} +3 -3
  8. package/dist/{chunk-SS4LT2IP.js → chunk-6U446SKY.js} +5 -10
  9. package/dist/{chunk-AU3YW7FZ.cjs → chunk-7YR7DI7B.cjs} +46 -51
  10. package/dist/{chunk-27HASETB.cjs → chunk-CSYBNN3V.cjs} +3 -1
  11. package/dist/{chunk-LRM6JXJA.cjs → chunk-E3APHA6O.cjs} +19 -1
  12. package/dist/{chunk-BWSLWF2E.js → chunk-EEAIM35V.js} +38 -12
  13. package/dist/{chunk-X4HKU3MX.js → chunk-IHKXLG6I.js} +3 -1
  14. package/dist/chunk-MBBKGD7K.js +440 -0
  15. package/dist/{chunk-LSKSBVL4.cjs → chunk-OSPTJCDI.cjs} +6 -6
  16. package/dist/{chunk-KUTMY2IO.cjs → chunk-TQF7MYEN.cjs} +101 -75
  17. package/dist/{chunk-BYJ7QTLY.cjs → chunk-TWOYB4Y7.cjs} +13 -13
  18. package/dist/{chunk-PL73GJR4.js → chunk-UB2BHU2M.js} +1 -1
  19. package/dist/{chunk-REV7ZOA4.js → chunk-UJNHTS6D.js} +13 -2
  20. package/dist/{chunk-IZQNUNSU.cjs → chunk-UWQWD7BP.cjs} +17 -17
  21. package/dist/{chunk-4DPEGDPW.js → chunk-W32BSO3M.js} +4 -4
  22. package/dist/{chunk-LMX35GNQ.js → chunk-XBIID5DY.js} +4 -4
  23. package/dist/chunk-Y7NWR3WH.cjs +450 -0
  24. package/dist/codegen/index.cjs +7 -7
  25. package/dist/codegen/index.js +5 -5
  26. package/dist/index.cjs +30 -30
  27. package/dist/index.d.cts +3 -3
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.js +3 -3
  30. package/dist/ir/index.cjs +118 -116
  31. package/dist/ir/index.d.cts +18 -8
  32. package/dist/ir/index.d.ts +18 -8
  33. package/dist/ir/index.js +21 -19
  34. package/dist/{lower-Dw5grNrI.d.ts → lower-CXggJTIo.d.ts} +20 -2
  35. package/dist/{lower-DcOY8ux0.d.cts → lower-DAzvsJCo.d.cts} +20 -2
  36. package/dist/node-evaluator-CH3XCJND.cjs +17 -0
  37. package/dist/node-evaluator-TULXA3WE.js +8 -0
  38. package/dist/quickjs/index.cjs +32 -78
  39. package/dist/quickjs/index.d.cts +4 -4
  40. package/dist/quickjs/index.d.ts +4 -4
  41. package/dist/quickjs/index.js +32 -78
  42. package/dist/roundtrip/index.cjs +201 -128
  43. package/dist/roundtrip/index.d.cts +7 -4
  44. package/dist/roundtrip/index.d.ts +7 -4
  45. package/dist/roundtrip/index.js +87 -18
  46. package/package.json +44 -18
  47. package/dist/chunk-265J2FCH.cjs +0 -33
  48. package/dist/chunk-LUXCXFOE.cjs +0 -269
  49. package/dist/chunk-S34NJE3A.js +0 -262
  50. package/dist/chunk-SRQRLWOS.js +0 -31
  51. package/dist/node-evaluator-2GTUZVPK.cjs +0 -17
  52. package/dist/node-evaluator-RMYEWCXZ.js +0 -8
@@ -1,5 +1,9 @@
1
1
  'use strict';
2
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
+
3
7
  // src/ir/json-utils.ts
4
8
  function isRecord(value) {
5
9
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -19,6 +23,17 @@ function deepEqual(left, right) {
19
23
  }
20
24
  return false;
21
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
+ }
22
37
  function cloneJson(value) {
23
38
  return structuredCloneJson(value);
24
39
  }
@@ -27,7 +42,7 @@ function structuredCloneJson(value) {
27
42
  if (isRecord(value)) {
28
43
  const out = {};
29
44
  for (const [key, child] of Object.entries(value)) {
30
- if (child !== void 0) out[key] = structuredCloneJson(child);
45
+ if (child !== void 0) setOwn(out, key, structuredCloneJson(child));
31
46
  }
32
47
  return out;
33
48
  }
@@ -174,8 +189,11 @@ exports.deepEqual = deepEqual;
174
189
  exports.formatRefExpression = formatRefExpression;
175
190
  exports.formatRefTemplate = formatRefTemplate;
176
191
  exports.hasLegacyTemplate = hasLegacyTemplate;
192
+ exports.importMetaUrl = importMetaUrl;
177
193
  exports.isJsIdentifier = isJsIdentifier;
178
194
  exports.isRecord = isRecord;
195
+ exports.ownValue = ownValue;
179
196
  exports.parseRefExpression = parseRefExpression;
180
197
  exports.parseTemplate = parseTemplate;
181
198
  exports.segmentFromKey = segmentFromKey;
199
+ exports.setOwn = setOwn;
@@ -1,6 +1,6 @@
1
1
  import { autoLayout } from './chunk-5LUIDMF4.js';
2
- import { makeRef, isPredicate, conditionTreeOf, BuilderError, refModelOf } from './chunk-PL73GJR4.js';
3
- import { isRecord, cloneJson, formatRefTemplate } from './chunk-REV7ZOA4.js';
2
+ import { makeRef, isPredicate, conditionTreeOf, BuilderError, refModelOf } from './chunk-UB2BHU2M.js';
3
+ import { isRecord, setOwn, cloneJson, ownValue, formatRefTemplate } from './chunk-UJNHTS6D.js';
4
4
 
5
5
  // src/builder/descriptors.ts
6
6
  function op(nodeType, version, operation) {
@@ -84,7 +84,7 @@ function isTier1Workflow(value) {
84
84
  }
85
85
  function deepMerge(base, extra, path) {
86
86
  for (const [key, value] of Object.entries(extra)) {
87
- const existing = base[key];
87
+ const existing = ownValue(base, key);
88
88
  if (isRecord(existing) && isRecord(value)) {
89
89
  deepMerge(existing, value, `${path}.${key}`);
90
90
  } else if (existing !== void 0) {
@@ -92,7 +92,7 @@ function deepMerge(base, extra, path) {
92
92
  `extra sets ${path}.${key}, which the builder already wrote; use the typed option`
93
93
  );
94
94
  } else {
95
- base[key] = lowerValue(value, `${path}.${key}`);
95
+ setOwn(base, key, lowerValue(value, `${path}.${key}`));
96
96
  }
97
97
  }
98
98
  }
@@ -117,7 +117,7 @@ function lowerValue(value, path) {
117
117
  const out = {};
118
118
  for (const [key, child] of Object.entries(value)) {
119
119
  if (child === void 0) continue;
120
- out[key] = lowerValue(child, `${path}.${key}`);
120
+ setOwn(out, key, lowerValue(child, `${path}.${key}`));
121
121
  }
122
122
  return out;
123
123
  }
@@ -196,7 +196,10 @@ var WorkflowBuilder = class {
196
196
  edges = [];
197
197
  notes = [];
198
198
  ids = /* @__PURE__ */ new Set();
199
+ /** Ids given explicitly; a second edge with the same explicit id is an error. */
199
200
  edgeIds = /* @__PURE__ */ new Set();
201
+ /** Edges whose id is the default, as indices into `edges`, with the unsuffixed default id. */
202
+ defaultIds = [];
200
203
  edgeOrder;
201
204
  /** A reference to a node by id, for nodes declared later in the source. */
202
205
  ref(id) {
@@ -407,6 +410,7 @@ var WorkflowBuilder = class {
407
410
  }
408
411
  /** The recording, once the callback has returned. */
409
412
  finish(key, document) {
413
+ this.assignDefaultEdgeIds();
410
414
  return {
411
415
  format: RECORDING_FORMAT,
412
416
  formatVersion: RECORDING_FORMAT_VERSION,
@@ -433,13 +437,35 @@ var WorkflowBuilder = class {
433
437
  for (let suffix = 2; this.ids.has(candidate); suffix++) candidate = `${base}-${suffix}`;
434
438
  return candidate;
435
439
  }
440
+ /**
441
+ * Give every edge declared without an id its default id. Explicit ids are
442
+ * claimed first, so a default never takes an id the code names; a default that
443
+ * is taken gets `-2`, `-3`, … in declaration order. The result depends only on
444
+ * the builder calls.
445
+ */
446
+ assignDefaultEdgeIds() {
447
+ const taken = new Set(this.edgeIds);
448
+ for (const { index, base } of this.defaultIds) {
449
+ let id = base;
450
+ for (let suffix = 2; taken.has(id); suffix++) id = `${base}-${suffix}`;
451
+ taken.add(id);
452
+ const built = this.edges[index];
453
+ if (built) built.id = id;
454
+ }
455
+ this.defaultIds.length = 0;
456
+ }
436
457
  addEdge(spec, target) {
437
458
  const { source, sourceHandle } = sourceOf(spec.from);
438
- const id = spec.id === false ? void 0 : spec.id ?? defaultEdgeId(source, target, sourceHandle, spec.targetHandle);
439
- if (id !== void 0) {
440
- if (this.edgeIds.has(id)) throw new BuilderError(`Duplicate edge id "${id}"`);
441
- this.edgeIds.add(id);
459
+ const explicit = typeof spec.id === "string" ? spec.id : void 0;
460
+ if (spec.id !== void 0 && spec.id !== false && explicit === void 0)
461
+ throw new BuilderError("An edge id must be a string or false");
462
+ if (explicit !== void 0) {
463
+ if (this.edgeIds.has(explicit)) throw new BuilderError(`Duplicate edge id "${explicit}"`);
464
+ this.edgeIds.add(explicit);
442
465
  }
466
+ const base = spec.id === void 0 ? defaultEdgeId(source, target, sourceHandle, spec.targetHandle) : void 0;
467
+ const id = explicit ?? base;
468
+ if (base !== void 0) this.defaultIds.push({ index: this.edges.length, base });
443
469
  const built = id !== void 0 ? { id, source, target } : { source, target };
444
470
  if (sourceHandle !== void 0) built["sourceHandle"] = sourceHandle;
445
471
  if (spec.targetHandle !== void 0) built["targetHandle"] = spec.targetHandle;
@@ -558,7 +584,7 @@ function defineWorkflow(options, build) {
558
584
  }
559
585
 
560
586
  // src/generated/version.ts
561
- var SDK_VERSION = "2026.1027.0";
587
+ var SDK_VERSION = "2026.1027.1";
562
588
 
563
589
  // src/builder/assemble.ts
564
590
  var LAYOUT_FORMAT = "fluidgrids.layout";
@@ -589,7 +615,7 @@ function parseLayoutSidecar(value) {
589
615
  if (!isRecord(position) || typeof position["x"] !== "number" || typeof position["y"] !== "number") {
590
616
  throw new BuilderError(`The layout position of "${id}" must be { x, y }`);
591
617
  }
592
- parsed[id] = { x: position["x"], y: position["y"] };
618
+ setOwn(parsed, id, { x: position["x"], y: position["y"] });
593
619
  }
594
620
  const sidecar = {
595
621
  format: LAYOUT_FORMAT,
@@ -694,7 +720,7 @@ function assembleRecording(recording, options = {}) {
694
720
  document["meta"] = meta;
695
721
  }
696
722
  for (const [key, value] of Object.entries(document)) {
697
- if (!Object.hasOwn(out, key) && value !== void 0) out[key] = value;
723
+ if (!Object.hasOwn(out, key) && value !== void 0) setOwn(out, key, value);
698
724
  }
699
725
  return out;
700
726
  }
@@ -1,3 +1,5 @@
1
+ import { setOwn } from './chunk-UJNHTS6D.js';
2
+
1
3
  // src/ir/canonical-json.ts
2
4
  var CanonicalJsonError = class extends Error {
3
5
  constructor(message) {
@@ -68,7 +70,7 @@ function sortKeysDeep(value) {
68
70
  const record = value;
69
71
  const sorted = {};
70
72
  for (const key of Object.keys(record).sort()) {
71
- if (record[key] !== void 0) sorted[key] = sortKeysDeep(record[key]);
73
+ if (record[key] !== void 0) setOwn(sorted, key, sortKeysDeep(record[key]));
72
74
  }
73
75
  return sorted;
74
76
  }