@particle-academy/fancy-flow 0.54.0 → 0.56.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.
- package/dist/{chunk-CIBW5ATA.js → chunk-22OJOD4X.js} +7 -3
- package/dist/chunk-22OJOD4X.js.map +1 -0
- package/dist/{chunk-VWANLNL5.js → chunk-E3AGYTHP.js} +3 -3
- package/dist/{chunk-VWANLNL5.js.map → chunk-E3AGYTHP.js.map} +1 -1
- package/dist/{chunk-FH6MWLKD.js → chunk-GB4A7DFM.js} +20 -5
- package/dist/chunk-GB4A7DFM.js.map +1 -0
- package/dist/{chunk-FTGVVKWX.js → chunk-HMEI2LFU.js} +4 -4
- package/dist/{chunk-FTGVVKWX.js.map → chunk-HMEI2LFU.js.map} +1 -1
- package/dist/{chunk-WCFRKXH5.js → chunk-KP4TBF3A.js} +3 -3
- package/dist/{chunk-WCFRKXH5.js.map → chunk-KP4TBF3A.js.map} +1 -1
- package/dist/{chunk-FG3C7LIG.js → chunk-L4QAAGLV.js} +3 -3
- package/dist/{chunk-FG3C7LIG.js.map → chunk-L4QAAGLV.js.map} +1 -1
- package/dist/durable/index.d.cts +1 -1
- package/dist/durable/index.d.ts +1 -1
- package/dist/durable.cjs +5 -1
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +1 -1
- package/dist/engine.cjs +5 -1
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +2 -2
- package/dist/engine.d.ts +2 -2
- package/dist/engine.js +3 -3
- package/dist/index.cjs +22 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -11
- package/dist/registry.cjs +5 -1
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/{run-cohort-BPIOpE8A.d.ts → run-cohort-C1nRh_mi.d.ts} +1 -1
- package/dist/{run-cohort-r-L8dMED.d.cts → run-cohort-CBRAUj-z.d.cts} +1 -1
- package/dist/{run-flow-COdAOFg2.d.cts → run-flow-2XsHBwpd.d.cts} +31 -0
- package/dist/{run-flow-DJ7KYT6E.d.ts → run-flow-D7AOCcfE.d.ts} +31 -0
- package/dist/runtime/index.d.cts +3 -3
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime.cjs +5 -1
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema/index.d.cts +29 -5
- package/dist/schema/index.d.ts +29 -5
- package/dist/schema.cjs +22 -3
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/screens.cjs +5 -1
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +4 -4
- package/dist/ux.cjs +5 -1
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-CIBW5ATA.js.map +0 -1
- package/dist/chunk-FH6MWLKD.js.map +0 -1
package/dist/runtime.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-
|
|
2
|
-
export { runCohort } from './chunk-
|
|
3
|
-
export { RunIdentity, escapeSegment, runFlow } from './chunk-
|
|
1
|
+
export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-L4QAAGLV.js';
|
|
2
|
+
export { runCohort } from './chunk-KP4TBF3A.js';
|
|
3
|
+
export { RunIdentity, escapeSegment, runFlow } from './chunk-22OJOD4X.js';
|
|
4
4
|
import './chunk-F5RPRB7A.js';
|
|
5
5
|
import './chunk-USL4FMFU.js';
|
|
6
6
|
//# sourceMappingURL=runtime.js.map
|
package/dist/schema/index.d.cts
CHANGED
|
@@ -116,13 +116,37 @@ type ImportOptions = {
|
|
|
116
116
|
* instead of errors. Default false. */
|
|
117
117
|
lenient?: boolean;
|
|
118
118
|
};
|
|
119
|
+
/** A migration step: takes a version-N document to version N+1. */
|
|
120
|
+
type MigrationStep = (schema: Record<string, unknown>) => Record<string, unknown>;
|
|
119
121
|
/**
|
|
120
|
-
* Migrate a raw schema object up to the current version
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
122
|
+
* Migrate a raw schema object up to the current version, as far as it can go.
|
|
123
|
+
*
|
|
124
|
+
* Additive changes need no migration — an older document simply lacks the newer
|
|
125
|
+
* optional fields. This is the seam for a future BREAKING bump, and
|
|
126
|
+
* `importWorkflow` runs it before validating the version.
|
|
127
|
+
*
|
|
128
|
+
* ## The three rules, each with a reason
|
|
129
|
+
*
|
|
130
|
+
* - **A PAST version migrates forward**, step by step, to the current one.
|
|
131
|
+
* - **A FUTURE version is left ALONE.** We cannot know what a later schema
|
|
132
|
+
* means, and migrating downward would be guessing. Untouched hands it to the
|
|
133
|
+
* version check, which reports it honestly.
|
|
134
|
+
* - **A GAP in the table is left alone too.** A missing step is not a licence
|
|
135
|
+
* to guess.
|
|
136
|
+
*
|
|
137
|
+
* ## Why `steps` is a parameter
|
|
138
|
+
*
|
|
139
|
+
* With only v1 in existence there is no old document to migrate, so a seam
|
|
140
|
+
* tested against the built-in (empty) table is a check that CANNOT fail — it
|
|
141
|
+
* would pass identically against a function that returned its input untouched,
|
|
142
|
+
* which is what this was until the twins needed the same seam.
|
|
143
|
+
*
|
|
144
|
+
* The PHP and Python runtimes carry the identical shape. That mattered more
|
|
145
|
+
* than it sounds: they had no migration at all and errored on any version
|
|
146
|
+
* mismatch, so a v2 bump would have made every stored Op unreadable on exactly
|
|
147
|
+
* the runtimes where durable runs resume.
|
|
124
148
|
*/
|
|
125
|
-
declare function migrateSchema(schema: unknown): unknown;
|
|
149
|
+
declare function migrateSchema(schema: unknown, steps?: Record<number, MigrationStep>): unknown;
|
|
126
150
|
/**
|
|
127
151
|
* Hydrate a schema into runtime FlowGraph + validate kinds/configs against
|
|
128
152
|
* the registry. Reports issues for unknown kinds, missing required config,
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -116,13 +116,37 @@ type ImportOptions = {
|
|
|
116
116
|
* instead of errors. Default false. */
|
|
117
117
|
lenient?: boolean;
|
|
118
118
|
};
|
|
119
|
+
/** A migration step: takes a version-N document to version N+1. */
|
|
120
|
+
type MigrationStep = (schema: Record<string, unknown>) => Record<string, unknown>;
|
|
119
121
|
/**
|
|
120
|
-
* Migrate a raw schema object up to the current version
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
122
|
+
* Migrate a raw schema object up to the current version, as far as it can go.
|
|
123
|
+
*
|
|
124
|
+
* Additive changes need no migration — an older document simply lacks the newer
|
|
125
|
+
* optional fields. This is the seam for a future BREAKING bump, and
|
|
126
|
+
* `importWorkflow` runs it before validating the version.
|
|
127
|
+
*
|
|
128
|
+
* ## The three rules, each with a reason
|
|
129
|
+
*
|
|
130
|
+
* - **A PAST version migrates forward**, step by step, to the current one.
|
|
131
|
+
* - **A FUTURE version is left ALONE.** We cannot know what a later schema
|
|
132
|
+
* means, and migrating downward would be guessing. Untouched hands it to the
|
|
133
|
+
* version check, which reports it honestly.
|
|
134
|
+
* - **A GAP in the table is left alone too.** A missing step is not a licence
|
|
135
|
+
* to guess.
|
|
136
|
+
*
|
|
137
|
+
* ## Why `steps` is a parameter
|
|
138
|
+
*
|
|
139
|
+
* With only v1 in existence there is no old document to migrate, so a seam
|
|
140
|
+
* tested against the built-in (empty) table is a check that CANNOT fail — it
|
|
141
|
+
* would pass identically against a function that returned its input untouched,
|
|
142
|
+
* which is what this was until the twins needed the same seam.
|
|
143
|
+
*
|
|
144
|
+
* The PHP and Python runtimes carry the identical shape. That mattered more
|
|
145
|
+
* than it sounds: they had no migration at all and errored on any version
|
|
146
|
+
* mismatch, so a v2 bump would have made every stored Op unreadable on exactly
|
|
147
|
+
* the runtimes where durable runs resume.
|
|
124
148
|
*/
|
|
125
|
-
declare function migrateSchema(schema: unknown): unknown;
|
|
149
|
+
declare function migrateSchema(schema: unknown, steps?: Record<number, MigrationStep>): unknown;
|
|
126
150
|
/**
|
|
127
151
|
* Hydrate a schema into runtime FlowGraph + validate kinds/configs against
|
|
128
152
|
* the registry. Reports issues for unknown kinds, missing required config,
|
package/dist/schema.cjs
CHANGED
|
@@ -9337,7 +9337,7 @@ function resolveWorkflowProps(declared, passed) {
|
|
|
9337
9337
|
// src/runtime/run-flow.ts
|
|
9338
9338
|
async function runFlow(graph, executors, onEvent = () => {
|
|
9339
9339
|
}, options = {}) {
|
|
9340
|
-
const { signal, initialInputs = {}, timeoutMs, depth = 0, resumeOutputs = {} } = options;
|
|
9340
|
+
const { signal, initialInputs = {}, timeoutMs, depth = 0, resumeOutputs = {}, entryNodes } = options;
|
|
9341
9341
|
const run = options.run === void 0 ? void 0 : RunIdentity.from(options.run);
|
|
9342
9342
|
const outputs = {};
|
|
9343
9343
|
const portValues = /* @__PURE__ */ new Map();
|
|
@@ -9376,6 +9376,10 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
9376
9376
|
continue;
|
|
9377
9377
|
}
|
|
9378
9378
|
const incoming = incomingByNode.get(node.id) ?? [];
|
|
9379
|
+
if (incoming.length === 0 && entryNodes !== void 0 && !entryNodes.includes(node.id)) {
|
|
9380
|
+
onEvent({ type: "node-status", nodeId: node.id, status: "idle", text: "skipped" });
|
|
9381
|
+
continue;
|
|
9382
|
+
}
|
|
9379
9383
|
if (incoming.length > 0) {
|
|
9380
9384
|
const anyActive = incoming.some((e) => portValues.has(`${e.source}:${e.sourceHandle ?? "out"}`));
|
|
9381
9385
|
if (!anyActive) {
|
|
@@ -10733,8 +10737,23 @@ function toSchemaEdge(e) {
|
|
|
10733
10737
|
label: typeof e.label === "string" ? e.label : void 0
|
|
10734
10738
|
};
|
|
10735
10739
|
}
|
|
10736
|
-
|
|
10737
|
-
|
|
10740
|
+
var MIGRATIONS = {};
|
|
10741
|
+
function migrateSchema(schema, steps = MIGRATIONS) {
|
|
10742
|
+
if (!schema || typeof schema !== "object") return schema;
|
|
10743
|
+
const doc = schema;
|
|
10744
|
+
let version = doc.version;
|
|
10745
|
+
if (typeof version !== "number" || !Number.isInteger(version) || version >= WORKFLOW_SCHEMA_VERSION) {
|
|
10746
|
+
return schema;
|
|
10747
|
+
}
|
|
10748
|
+
let out = doc;
|
|
10749
|
+
while (version < WORKFLOW_SCHEMA_VERSION) {
|
|
10750
|
+
const step = steps[version];
|
|
10751
|
+
if (!step) return out;
|
|
10752
|
+
out = step(out);
|
|
10753
|
+
version += 1;
|
|
10754
|
+
out.version = version;
|
|
10755
|
+
}
|
|
10756
|
+
return out;
|
|
10738
10757
|
}
|
|
10739
10758
|
function importWorkflow(schema, options = {}) {
|
|
10740
10759
|
const issues = [];
|