@particle-academy/fancy-flow 0.50.0 → 0.51.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/{ConfigFieldRenderer-CrXFq6Eb.d.cts → ConfigFieldRenderer-Bc9Txnql.d.cts} +2 -2
- package/dist/{ConfigFieldRenderer-u3nYHovX.d.ts → ConfigFieldRenderer-Bt3RGT7Z.d.ts} +2 -2
- package/dist/{FlowViewer-DRgjeWJ7.d.ts → FlowViewer-BI_AyyvU.d.ts} +1 -1
- package/dist/{FlowViewer-CFSMlCqi.d.cts → FlowViewer-DABx-6A-.d.cts} +1 -1
- package/dist/{capabilities-VzgDApur.d.cts → capabilities-BYa5p5jw.d.cts} +1 -1
- package/dist/{capabilities-B00VXLUp.d.ts → capabilities-COOXRiNL.d.ts} +1 -1
- package/dist/{chunk-I4F6GI3A.js → chunk-6AI6CBNL.js} +3 -3
- package/dist/{chunk-I4F6GI3A.js.map → chunk-6AI6CBNL.js.map} +1 -1
- package/dist/{chunk-OWDSPRAF.js → chunk-7XTTXMGB.js} +4 -4
- package/dist/{chunk-OWDSPRAF.js.map → chunk-7XTTXMGB.js.map} +1 -1
- package/dist/{chunk-BAHJVX3S.js → chunk-HXGGCMR7.js} +3 -3
- package/dist/{chunk-BAHJVX3S.js.map → chunk-HXGGCMR7.js.map} +1 -1
- package/dist/{chunk-3W26FA7Q.js → chunk-LH76EIFL.js} +18 -4
- package/dist/chunk-LH76EIFL.js.map +1 -0
- package/dist/{chunk-DQJIU55F.js → chunk-SKEZ5AGI.js} +3 -3
- package/dist/{chunk-DQJIU55F.js.map → chunk-SKEZ5AGI.js.map} +1 -1
- package/dist/{chunk-XJMWMU4J.js → chunk-XCT2CJ5O.js} +72 -4
- package/dist/chunk-XCT2CJ5O.js.map +1 -0
- package/dist/connectors.d.cts +2 -2
- package/dist/connectors.d.ts +2 -2
- package/dist/durable/index.d.cts +2 -2
- package/dist/durable/index.d.ts +2 -2
- package/dist/durable.cjs +70 -2
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +1 -1
- package/dist/engine.cjs +70 -2
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +7 -7
- package/dist/engine.d.ts +7 -7
- package/dist/engine.js +3 -3
- package/dist/fields/react-fancy.d.cts +3 -3
- package/dist/fields/react-fancy.d.ts +3 -3
- package/dist/index.cjs +85 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -11
- package/dist/layout/index.d.cts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/llm/prism.d.cts +2 -2
- package/dist/llm/prism.d.ts +2 -2
- package/dist/llm/vercel-ai.d.cts +2 -2
- package/dist/llm/vercel-ai.d.ts +2 -2
- package/dist/registry/index.d.cts +6 -6
- package/dist/registry/index.d.ts +6 -6
- package/dist/{registry-6cB5wCv6.d.ts → registry-3RkSYrMi.d.ts} +1 -1
- package/dist/{registry-DQh7ZmnM.d.cts → registry-C6TMfiD_.d.cts} +1 -1
- package/dist/registry.cjs +70 -2
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/{run-cohort-VX4JG21l.d.ts → run-cohort-BPIOpE8A.d.ts} +2 -2
- package/dist/{run-cohort-DYCL8Qv6.d.cts → run-cohort-r-L8dMED.d.cts} +2 -2
- package/dist/{run-flow-B24QUO1H.d.cts → run-flow-COdAOFg2.d.cts} +10 -1
- package/dist/{run-flow-DPUPAWk6.d.ts → run-flow-DJ7KYT6E.d.ts} +10 -1
- package/dist/runtime/index.d.cts +5 -5
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime.cjs +70 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema/index.d.cts +12 -1
- package/dist/schema/index.d.ts +12 -1
- package/dist/schema.cjs +85 -3
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/screens.cjs +70 -2
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.d.cts +2 -2
- package/dist/screens.d.ts +2 -2
- package/dist/screens.js +4 -4
- package/dist/{types-BtMOnb9I.d.cts → types-3sPauVRT.d.cts} +1 -1
- package/dist/{types-7cXcSQlx.d.cts → types-JFYjPJAG.d.cts} +37 -1
- package/dist/{types-7cXcSQlx.d.ts → types-JFYjPJAG.d.ts} +37 -1
- package/dist/{types-CDgIIj4c.d.ts → types-s643U1Hi.d.ts} +1 -1
- package/dist/ux.cjs +70 -2
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.d.cts +2 -2
- package/dist/ux.d.ts +2 -2
- package/dist/ux.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3W26FA7Q.js.map +0 -1
- package/dist/chunk-XJMWMU4J.js.map +0 -1
package/dist/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-LH76EIFL.js';
|
|
2
|
+
import './chunk-XCT2CJ5O.js';
|
|
3
3
|
import './chunk-F5RPRB7A.js';
|
|
4
4
|
import './chunk-USL4FMFU.js';
|
|
5
5
|
//# sourceMappingURL=schema.js.map
|
package/dist/screens.cjs
CHANGED
|
@@ -9411,6 +9411,61 @@ var RunIdentity = class _RunIdentity {
|
|
|
9411
9411
|
}
|
|
9412
9412
|
};
|
|
9413
9413
|
|
|
9414
|
+
// src/runtime/workflow-props.ts
|
|
9415
|
+
function typeOf(value) {
|
|
9416
|
+
if (value === null) return "null";
|
|
9417
|
+
if (Array.isArray(value)) return "array";
|
|
9418
|
+
return typeof value;
|
|
9419
|
+
}
|
|
9420
|
+
function resolveWorkflowProps(declared, passed) {
|
|
9421
|
+
const inputs = declared ?? [];
|
|
9422
|
+
const given = passed ?? {};
|
|
9423
|
+
const byName = new Map(inputs.map((input) => [input.name, input]));
|
|
9424
|
+
for (const name of Object.keys(given)) {
|
|
9425
|
+
if (!byName.has(name)) {
|
|
9426
|
+
const known = inputs.map((input) => input.name);
|
|
9427
|
+
const suffix = known.length === 0 ? "this workflow declares no inputs" : `known inputs: ${known.join(", ")}`;
|
|
9428
|
+
return {
|
|
9429
|
+
ok: false,
|
|
9430
|
+
code: "unknown_input",
|
|
9431
|
+
error: `Unknown workflow input "${name}" \u2014 ${suffix}.`
|
|
9432
|
+
};
|
|
9433
|
+
}
|
|
9434
|
+
}
|
|
9435
|
+
const resolved = {};
|
|
9436
|
+
for (const input of inputs) {
|
|
9437
|
+
const supplied = Object.prototype.hasOwnProperty.call(given, input.name);
|
|
9438
|
+
const hasDefault = Object.prototype.hasOwnProperty.call(input, "default");
|
|
9439
|
+
if (!supplied) {
|
|
9440
|
+
if (hasDefault) {
|
|
9441
|
+
resolved[input.name] = input.default;
|
|
9442
|
+
continue;
|
|
9443
|
+
}
|
|
9444
|
+
if (input.required) {
|
|
9445
|
+
return {
|
|
9446
|
+
ok: false,
|
|
9447
|
+
code: "missing_required",
|
|
9448
|
+
error: `Missing required workflow input "${input.name}"${input.type ? ` (${input.type})` : ""}.`
|
|
9449
|
+
};
|
|
9450
|
+
}
|
|
9451
|
+
continue;
|
|
9452
|
+
}
|
|
9453
|
+
const value = given[input.name];
|
|
9454
|
+
if (input.type !== void 0) {
|
|
9455
|
+
const actual = typeOf(value);
|
|
9456
|
+
if (actual !== input.type) {
|
|
9457
|
+
return {
|
|
9458
|
+
ok: false,
|
|
9459
|
+
code: "type_mismatch",
|
|
9460
|
+
error: `Workflow input "${input.name}" expects ${input.type}, got ${actual}.`
|
|
9461
|
+
};
|
|
9462
|
+
}
|
|
9463
|
+
}
|
|
9464
|
+
resolved[input.name] = value;
|
|
9465
|
+
}
|
|
9466
|
+
return { ok: true, props: resolved };
|
|
9467
|
+
}
|
|
9468
|
+
|
|
9414
9469
|
// src/runtime/run-flow.ts
|
|
9415
9470
|
async function runFlow(graph, executors, onEvent = () => {
|
|
9416
9471
|
}, options = {}) {
|
|
@@ -9426,6 +9481,13 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
9426
9481
|
onEvent({ type: "run-error", error: msg });
|
|
9427
9482
|
return { ok: false, outputs, error: msg };
|
|
9428
9483
|
}
|
|
9484
|
+
const propsCheck = resolveWorkflowProps(graph.inputs, options.props);
|
|
9485
|
+
if (!propsCheck.ok) {
|
|
9486
|
+
onEvent({ type: "run-error", error: propsCheck.error });
|
|
9487
|
+
return { ok: false, outputs, error: propsCheck.error };
|
|
9488
|
+
}
|
|
9489
|
+
const props = propsCheck.props;
|
|
9490
|
+
const declaresProps = (graph.inputs?.length ?? 0) > 0;
|
|
9429
9491
|
const incomingByNode = indexIncoming(graph.edges);
|
|
9430
9492
|
const timer2 = timeoutMs ? setTimeout(() => errors.push(`Run timed out after ${timeoutMs}ms`), timeoutMs) : null;
|
|
9431
9493
|
onEvent({ type: "run-start" });
|
|
@@ -9467,7 +9529,7 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
9467
9529
|
}
|
|
9468
9530
|
onEvent({ type: "node-status", nodeId: node.id, status: "running" });
|
|
9469
9531
|
announce(onEvent, node, "start");
|
|
9470
|
-
const inputs = collectInputs(node, incoming, portValues, initialInputs);
|
|
9532
|
+
const inputs = collectInputs(node, incoming, portValues, initialInputs, props, declaresProps);
|
|
9471
9533
|
const exec = pickExecutor(executors, node);
|
|
9472
9534
|
if (!exec) {
|
|
9473
9535
|
const msg = `No executor registered for kind=${node.type}`;
|
|
@@ -9544,8 +9606,13 @@ function topoSort(graph) {
|
|
|
9544
9606
|
const byId = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
9545
9607
|
return ordered.map((id2) => byId.get(id2)).filter(Boolean);
|
|
9546
9608
|
}
|
|
9547
|
-
function collectInputs(node, incoming, portValues, initial) {
|
|
9609
|
+
function collectInputs(node, incoming, portValues, initial, props, declaresProps) {
|
|
9548
9610
|
const inputs = { ...initial[node.id] ?? {} };
|
|
9611
|
+
if (incoming.length === 0) {
|
|
9612
|
+
for (const [name, value] of Object.entries(props)) {
|
|
9613
|
+
if (!(name in inputs)) inputs[name] = value;
|
|
9614
|
+
}
|
|
9615
|
+
}
|
|
9549
9616
|
for (const e of incoming) {
|
|
9550
9617
|
const portId = e.targetHandle ?? "in";
|
|
9551
9618
|
const key = `${e.source}:${e.sourceHandle ?? "out"}`;
|
|
@@ -9555,6 +9622,7 @@ function collectInputs(node, incoming, portValues, initial) {
|
|
|
9555
9622
|
inputs[e.source] = portValues.get(key);
|
|
9556
9623
|
}
|
|
9557
9624
|
}
|
|
9625
|
+
if (declaresProps) inputs.$props = props;
|
|
9558
9626
|
return inputs;
|
|
9559
9627
|
}
|
|
9560
9628
|
function pickExecutor(executors, node) {
|