@particle-academy/fancy-flow 0.15.1 → 0.16.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/{capabilities-BEbLqnJU.d.cts → capabilities-ChE3Xi8R.d.cts} +40 -5
- package/dist/{capabilities-CI3gw0C7.d.ts → capabilities-DUhAc-EJ.d.ts} +40 -5
- package/dist/{chunk-ZQBWPYTI.js → chunk-M2QTDA3B.js} +17 -4
- package/dist/chunk-M2QTDA3B.js.map +1 -0
- package/dist/{chunk-BB45F6S3.js → chunk-USL4FMFU.js} +6 -3
- package/dist/chunk-USL4FMFU.js.map +1 -0
- package/dist/engine.cjs +272 -48
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +167 -32
- package/dist/engine.d.ts +167 -32
- package/dist/engine.js +265 -49
- package/dist/engine.js.map +1 -1
- package/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/llm/vercel-ai.cjs.map +1 -1
- package/dist/llm/vercel-ai.d.cts +1 -1
- package/dist/llm/vercel-ai.d.ts +1 -1
- package/dist/llm/vercel-ai.js +1 -1
- package/dist/registry/index.d.cts +2 -2
- package/dist/registry/index.d.ts +2 -2
- package/dist/registry.cjs +18 -1
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-BB45F6S3.js.map +0 -1
- package/dist/chunk-ZQBWPYTI.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -217,6 +217,9 @@ var llmClient = null;
|
|
|
217
217
|
function getLlmClient() {
|
|
218
218
|
return llmClient;
|
|
219
219
|
}
|
|
220
|
+
function isResolutionFailure(value) {
|
|
221
|
+
return typeof value === "object" && value !== null && "reason" in value && value.reason !== void 0;
|
|
222
|
+
}
|
|
220
223
|
var workflowResolver = null;
|
|
221
224
|
function getWorkflowResolver() {
|
|
222
225
|
return workflowResolver;
|
|
@@ -465,7 +468,14 @@ var subflowExecutor = async (ctx) => {
|
|
|
465
468
|
`subflow depth limit reached (${maxDepth}) at "${ref}" \u2014 a workflow is referencing itself, directly or through a chain.`
|
|
466
469
|
);
|
|
467
470
|
}
|
|
468
|
-
const
|
|
471
|
+
const pinned = config.version === void 0 || config.version === "" ? void 0 : Number(config.version);
|
|
472
|
+
if (pinned !== void 0 && !Number.isInteger(pinned)) {
|
|
473
|
+
ctx.abort(`subflow "${ref}" has a non-integer version pin (${String(config.version)}).`);
|
|
474
|
+
}
|
|
475
|
+
const resolved = await resolver(ref, pinned);
|
|
476
|
+
const child = isResolutionFailure(resolved) ? ctx.abort(
|
|
477
|
+
resolved.reason === "version-mismatch" ? resolved.message ?? `subflow "${ref}" is pinned to version ${pinned}, but the host has ${resolved.available ?? "a different version"}.` : resolved.message ?? `subflow could not resolve workflow "${ref}"`
|
|
478
|
+
) : resolved;
|
|
469
479
|
if (!child) ctx.abort(`subflow could not resolve workflow "${ref}"`);
|
|
470
480
|
const mode = subflowMode(config);
|
|
471
481
|
const streaming = mode === "stream" || mode === "both";
|
|
@@ -689,6 +699,12 @@ var KINDS = [
|
|
|
689
699
|
placeholder: "onboarding-v2",
|
|
690
700
|
description: "Reference resolved by the host's registerWorkflowResolver()."
|
|
691
701
|
},
|
|
702
|
+
{
|
|
703
|
+
type: "number",
|
|
704
|
+
key: "version",
|
|
705
|
+
label: "Pin to version",
|
|
706
|
+
description: "Optional. Leave blank to always run the child's current version. Pinning fails the run loudly if the child has moved on \u2014 without it, someone edits the child and this flow silently runs different logic."
|
|
707
|
+
},
|
|
692
708
|
{
|
|
693
709
|
type: "select",
|
|
694
710
|
key: "mode",
|