@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/connectors.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ConfigField, N as NodeKindDefinition, O as OutputField } from './types-
|
|
1
|
+
import { C as ConfigField, N as NodeKindDefinition, O as OutputField } from './types-3sPauVRT.cjs';
|
|
2
2
|
import 'react';
|
|
3
|
-
import './types-
|
|
3
|
+
import './types-JFYjPJAG.cjs';
|
|
4
4
|
import '@xyflow/react';
|
|
5
5
|
import './pause-9iT4tCEV.cjs';
|
|
6
6
|
|
package/dist/connectors.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ConfigField, N as NodeKindDefinition, O as OutputField } from './types-
|
|
1
|
+
import { C as ConfigField, N as NodeKindDefinition, O as OutputField } from './types-s643U1Hi.js';
|
|
2
2
|
import 'react';
|
|
3
|
-
import './types-
|
|
3
|
+
import './types-JFYjPJAG.js';
|
|
4
4
|
import '@xyflow/react';
|
|
5
5
|
import './pause-9iT4tCEV.js';
|
|
6
6
|
|
package/dist/durable/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FlowGraph, R as RunEvent, b as RunIdentity, E as ExecutorRegistry, a as FlowNode, N as NodeExecutor, c as RunIdentityJson } from '../types-
|
|
2
|
-
import { a as RunResult } from '../run-flow-
|
|
1
|
+
import { F as FlowGraph, R as RunEvent, b as RunIdentity, E as ExecutorRegistry, a as FlowNode, N as NodeExecutor, c as RunIdentityJson } from '../types-JFYjPJAG.cjs';
|
|
2
|
+
import { a as RunResult } from '../run-flow-COdAOFg2.cjs';
|
|
3
3
|
import { b as PauseSignal } from '../pause-9iT4tCEV.cjs';
|
|
4
4
|
import '@xyflow/react';
|
|
5
5
|
|
package/dist/durable/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FlowGraph, R as RunEvent, b as RunIdentity, E as ExecutorRegistry, a as FlowNode, N as NodeExecutor, c as RunIdentityJson } from '../types-
|
|
2
|
-
import { a as RunResult } from '../run-flow-
|
|
1
|
+
import { F as FlowGraph, R as RunEvent, b as RunIdentity, E as ExecutorRegistry, a as FlowNode, N as NodeExecutor, c as RunIdentityJson } from '../types-JFYjPJAG.js';
|
|
2
|
+
import { a as RunResult } from '../run-flow-DJ7KYT6E.js';
|
|
3
3
|
import { b as PauseSignal } from '../pause-9iT4tCEV.js';
|
|
4
4
|
import '@xyflow/react';
|
|
5
5
|
|
package/dist/durable.cjs
CHANGED
|
@@ -9329,6 +9329,61 @@ var RunIdentity = class _RunIdentity {
|
|
|
9329
9329
|
}
|
|
9330
9330
|
};
|
|
9331
9331
|
|
|
9332
|
+
// src/runtime/workflow-props.ts
|
|
9333
|
+
function typeOf(value) {
|
|
9334
|
+
if (value === null) return "null";
|
|
9335
|
+
if (Array.isArray(value)) return "array";
|
|
9336
|
+
return typeof value;
|
|
9337
|
+
}
|
|
9338
|
+
function resolveWorkflowProps(declared, passed) {
|
|
9339
|
+
const inputs = declared ?? [];
|
|
9340
|
+
const given = passed ?? {};
|
|
9341
|
+
const byName = new Map(inputs.map((input) => [input.name, input]));
|
|
9342
|
+
for (const name of Object.keys(given)) {
|
|
9343
|
+
if (!byName.has(name)) {
|
|
9344
|
+
const known = inputs.map((input) => input.name);
|
|
9345
|
+
const suffix = known.length === 0 ? "this workflow declares no inputs" : `known inputs: ${known.join(", ")}`;
|
|
9346
|
+
return {
|
|
9347
|
+
ok: false,
|
|
9348
|
+
code: "unknown_input",
|
|
9349
|
+
error: `Unknown workflow input "${name}" \u2014 ${suffix}.`
|
|
9350
|
+
};
|
|
9351
|
+
}
|
|
9352
|
+
}
|
|
9353
|
+
const resolved = {};
|
|
9354
|
+
for (const input of inputs) {
|
|
9355
|
+
const supplied = Object.prototype.hasOwnProperty.call(given, input.name);
|
|
9356
|
+
const hasDefault = Object.prototype.hasOwnProperty.call(input, "default");
|
|
9357
|
+
if (!supplied) {
|
|
9358
|
+
if (hasDefault) {
|
|
9359
|
+
resolved[input.name] = input.default;
|
|
9360
|
+
continue;
|
|
9361
|
+
}
|
|
9362
|
+
if (input.required) {
|
|
9363
|
+
return {
|
|
9364
|
+
ok: false,
|
|
9365
|
+
code: "missing_required",
|
|
9366
|
+
error: `Missing required workflow input "${input.name}"${input.type ? ` (${input.type})` : ""}.`
|
|
9367
|
+
};
|
|
9368
|
+
}
|
|
9369
|
+
continue;
|
|
9370
|
+
}
|
|
9371
|
+
const value = given[input.name];
|
|
9372
|
+
if (input.type !== void 0) {
|
|
9373
|
+
const actual = typeOf(value);
|
|
9374
|
+
if (actual !== input.type) {
|
|
9375
|
+
return {
|
|
9376
|
+
ok: false,
|
|
9377
|
+
code: "type_mismatch",
|
|
9378
|
+
error: `Workflow input "${input.name}" expects ${input.type}, got ${actual}.`
|
|
9379
|
+
};
|
|
9380
|
+
}
|
|
9381
|
+
}
|
|
9382
|
+
resolved[input.name] = value;
|
|
9383
|
+
}
|
|
9384
|
+
return { ok: true, props: resolved };
|
|
9385
|
+
}
|
|
9386
|
+
|
|
9332
9387
|
// src/runtime/run-flow.ts
|
|
9333
9388
|
async function runFlow(graph, executors, onEvent = () => {
|
|
9334
9389
|
}, options = {}) {
|
|
@@ -9344,6 +9399,13 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
9344
9399
|
onEvent({ type: "run-error", error: msg });
|
|
9345
9400
|
return { ok: false, outputs, error: msg };
|
|
9346
9401
|
}
|
|
9402
|
+
const propsCheck = resolveWorkflowProps(graph.inputs, options.props);
|
|
9403
|
+
if (!propsCheck.ok) {
|
|
9404
|
+
onEvent({ type: "run-error", error: propsCheck.error });
|
|
9405
|
+
return { ok: false, outputs, error: propsCheck.error };
|
|
9406
|
+
}
|
|
9407
|
+
const props = propsCheck.props;
|
|
9408
|
+
const declaresProps = (graph.inputs?.length ?? 0) > 0;
|
|
9347
9409
|
const incomingByNode = indexIncoming(graph.edges);
|
|
9348
9410
|
const timer2 = timeoutMs ? setTimeout(() => errors.push(`Run timed out after ${timeoutMs}ms`), timeoutMs) : null;
|
|
9349
9411
|
onEvent({ type: "run-start" });
|
|
@@ -9385,7 +9447,7 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
9385
9447
|
}
|
|
9386
9448
|
onEvent({ type: "node-status", nodeId: node.id, status: "running" });
|
|
9387
9449
|
announce(onEvent, node, "start");
|
|
9388
|
-
const inputs = collectInputs(node, incoming, portValues, initialInputs);
|
|
9450
|
+
const inputs = collectInputs(node, incoming, portValues, initialInputs, props, declaresProps);
|
|
9389
9451
|
const exec = pickExecutor(executors, node);
|
|
9390
9452
|
if (!exec) {
|
|
9391
9453
|
const msg = `No executor registered for kind=${node.type}`;
|
|
@@ -9462,8 +9524,13 @@ function topoSort(graph) {
|
|
|
9462
9524
|
const byId = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
9463
9525
|
return ordered.map((id2) => byId.get(id2)).filter(Boolean);
|
|
9464
9526
|
}
|
|
9465
|
-
function collectInputs(node, incoming, portValues, initial) {
|
|
9527
|
+
function collectInputs(node, incoming, portValues, initial, props, declaresProps) {
|
|
9466
9528
|
const inputs = { ...initial[node.id] ?? {} };
|
|
9529
|
+
if (incoming.length === 0) {
|
|
9530
|
+
for (const [name, value] of Object.entries(props)) {
|
|
9531
|
+
if (!(name in inputs)) inputs[name] = value;
|
|
9532
|
+
}
|
|
9533
|
+
}
|
|
9467
9534
|
for (const e of incoming) {
|
|
9468
9535
|
const portId = e.targetHandle ?? "in";
|
|
9469
9536
|
const key = `${e.source}:${e.sourceHandle ?? "out"}`;
|
|
@@ -9473,6 +9540,7 @@ function collectInputs(node, incoming, portValues, initial) {
|
|
|
9473
9540
|
inputs[e.source] = portValues.get(key);
|
|
9474
9541
|
}
|
|
9475
9542
|
}
|
|
9543
|
+
if (declaresProps) inputs.$props = props;
|
|
9476
9544
|
return inputs;
|
|
9477
9545
|
}
|
|
9478
9546
|
function pickExecutor(executors, node) {
|