@particle-academy/fancy-flow 0.76.0 → 0.77.0

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 (46) hide show
  1. package/dist/{chunk-4KYW5BT4.js → chunk-44VXYZ4M.js} +4 -4
  2. package/dist/{chunk-4KYW5BT4.js.map → chunk-44VXYZ4M.js.map} +1 -1
  3. package/dist/{chunk-M34S7XUM.js → chunk-66JAEWPP.js} +3 -3
  4. package/dist/{chunk-M34S7XUM.js.map → chunk-66JAEWPP.js.map} +1 -1
  5. package/dist/{chunk-G4GKDJG5.js → chunk-KFC3BURT.js} +3 -3
  6. package/dist/{chunk-G4GKDJG5.js.map → chunk-KFC3BURT.js.map} +1 -1
  7. package/dist/{chunk-CYVVUKHH.js → chunk-MMCHYY6B.js} +3 -3
  8. package/dist/{chunk-CYVVUKHH.js.map → chunk-MMCHYY6B.js.map} +1 -1
  9. package/dist/{chunk-PXVISCSC.js → chunk-OOQ2MMBE.js} +4 -4
  10. package/dist/{chunk-PXVISCSC.js.map → chunk-OOQ2MMBE.js.map} +1 -1
  11. package/dist/{chunk-ZKAPSUTL.js → chunk-X2UHP2S5.js} +3 -3
  12. package/dist/{chunk-ZKAPSUTL.js.map → chunk-X2UHP2S5.js.map} +1 -1
  13. package/dist/{chunk-V2657EQG.js → chunk-YNKOEQLI.js} +44 -4
  14. package/dist/chunk-YNKOEQLI.js.map +1 -0
  15. package/dist/durable.cjs +38 -34
  16. package/dist/durable.cjs.map +1 -1
  17. package/dist/durable.js +1 -2
  18. package/dist/durable.js.map +1 -1
  19. package/dist/engine.cjs +41 -37
  20. package/dist/engine.cjs.map +1 -1
  21. package/dist/engine.js +4 -6
  22. package/dist/engine.js.map +1 -1
  23. package/dist/index.cjs +41 -37
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.js +12 -13
  26. package/dist/index.js.map +1 -1
  27. package/dist/registry.cjs +41 -37
  28. package/dist/registry.cjs.map +1 -1
  29. package/dist/registry.js +2 -3
  30. package/dist/runtime.cjs +31 -1
  31. package/dist/runtime.cjs.map +1 -1
  32. package/dist/runtime.js +3 -3
  33. package/dist/schema.cjs +31 -1
  34. package/dist/schema.cjs.map +1 -1
  35. package/dist/schema.js +3 -3
  36. package/dist/screens.cjs +31 -1
  37. package/dist/screens.cjs.map +1 -1
  38. package/dist/screens.js +4 -5
  39. package/dist/screens.js.map +1 -1
  40. package/dist/ux.cjs +31 -1
  41. package/dist/ux.cjs.map +1 -1
  42. package/dist/ux.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/chunk-UEOE6B52.js +0 -39
  45. package/dist/chunk-UEOE6B52.js.map +0 -1
  46. package/dist/chunk-V2657EQG.js.map +0 -1
package/dist/schema.js CHANGED
@@ -1,6 +1,6 @@
1
- export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-PXVISCSC.js';
2
- import './chunk-CYVVUKHH.js';
3
- import './chunk-V2657EQG.js';
1
+ export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-OOQ2MMBE.js';
2
+ import './chunk-MMCHYY6B.js';
3
+ import './chunk-YNKOEQLI.js';
4
4
  import './chunk-2QXKDLGT.js';
5
5
  //# sourceMappingURL=schema.js.map
6
6
  //# sourceMappingURL=schema.js.map
package/dist/screens.cjs CHANGED
@@ -10062,6 +10062,32 @@ function announce(onEvent, node, phase) {
10062
10062
  onEvent({ type: "node-message", nodeId: node.id, phase, message });
10063
10063
  }
10064
10064
 
10065
+ // src/registry/pause.ts
10066
+ var PAUSE_PREFIX = "fancy-flow:pause:";
10067
+ var LEGACY_PAUSE_PREFIXES = [
10068
+ ["awaiting-approval:", "approval"],
10069
+ ["awaiting-input:", "input"]
10070
+ ];
10071
+ function decodePause(reason) {
10072
+ if (typeof reason !== "string") return null;
10073
+ if (reason.startsWith(PAUSE_PREFIX)) {
10074
+ const body = reason.slice(PAUSE_PREFIX.length);
10075
+ try {
10076
+ const parsed = JSON.parse(body);
10077
+ if (typeof parsed?.nodeId !== "string" || typeof parsed?.awaiting !== "string") return null;
10078
+ return "detail" in parsed ? { nodeId: parsed.nodeId, awaiting: parsed.awaiting, detail: parsed.detail } : { nodeId: parsed.nodeId, awaiting: parsed.awaiting };
10079
+ } catch {
10080
+ return null;
10081
+ }
10082
+ }
10083
+ for (const [prefix, awaiting] of LEGACY_PAUSE_PREFIXES) {
10084
+ if (reason.startsWith(prefix)) {
10085
+ return { nodeId: reason.slice(prefix.length), awaiting };
10086
+ }
10087
+ }
10088
+ return null;
10089
+ }
10090
+
10065
10091
  // src/registry/subflow.ts
10066
10092
  var DEFAULT_MAX_DEPTH = 8;
10067
10093
  function subflowMode(config) {
@@ -10143,7 +10169,11 @@ var subflowExecutor = async (ctx) => {
10143
10169
  }
10144
10170
  );
10145
10171
  if (!result.ok) {
10146
- ctx.abort(`subflow "${ref}" failed: ${result.error ?? "unknown error"}`);
10172
+ const reason = result.error ?? "unknown error";
10173
+ if (decodePause(reason)) {
10174
+ ctx.abort(reason);
10175
+ }
10176
+ ctx.abort(`subflow "${ref}" failed: ${reason}`);
10147
10177
  }
10148
10178
  if (mode === "stream") {
10149
10179
  return { __port: "stream", value: result.outputs };