@particle-academy/fancy-flow 0.75.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.
- package/dist/{chunk-2H5H2DDP.js → chunk-44VXYZ4M.js} +4 -4
- package/dist/{chunk-2H5H2DDP.js.map → chunk-44VXYZ4M.js.map} +1 -1
- package/dist/{chunk-4BPCA3ZO.js → chunk-66JAEWPP.js} +3 -3
- package/dist/{chunk-4BPCA3ZO.js.map → chunk-66JAEWPP.js.map} +1 -1
- package/dist/{chunk-LKEDPVR3.js → chunk-KFC3BURT.js} +3 -3
- package/dist/{chunk-LKEDPVR3.js.map → chunk-KFC3BURT.js.map} +1 -1
- package/dist/{chunk-XZFLPKO2.js → chunk-MMCHYY6B.js} +3 -3
- package/dist/{chunk-XZFLPKO2.js.map → chunk-MMCHYY6B.js.map} +1 -1
- package/dist/{chunk-T7E7QPHI.js → chunk-OOQ2MMBE.js} +4 -4
- package/dist/{chunk-T7E7QPHI.js.map → chunk-OOQ2MMBE.js.map} +1 -1
- package/dist/{chunk-ZBHIEKCN.js → chunk-X2UHP2S5.js} +3 -3
- package/dist/{chunk-ZBHIEKCN.js.map → chunk-X2UHP2S5.js.map} +1 -1
- package/dist/{chunk-W7DMO3H7.js → chunk-YNKOEQLI.js} +48 -7
- package/dist/chunk-YNKOEQLI.js.map +1 -0
- package/dist/durable.cjs +42 -37
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +1 -2
- package/dist/durable.js.map +1 -1
- package/dist/engine.cjs +45 -40
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.js +4 -6
- package/dist/engine.js.map +1 -1
- package/dist/index.cjs +45 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -13
- package/dist/index.js.map +1 -1
- package/dist/registry.cjs +45 -40
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -3
- package/dist/runtime.cjs +35 -4
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema.cjs +35 -4
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +3 -3
- package/dist/screens.cjs +35 -4
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +4 -5
- package/dist/screens.js.map +1 -1
- package/dist/ux.cjs +35 -4
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-UEOE6B52.js +0 -39
- package/dist/chunk-UEOE6B52.js.map +0 -1
- package/dist/chunk-W7DMO3H7.js.map +0 -1
package/dist/registry.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { ANY_PORT_TYPE, BUILTIN_KINDS, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds } from './chunk-
|
|
1
|
+
export { ANY_PORT_TYPE, BUILTIN_KINDS, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds } from './chunk-66JAEWPP.js';
|
|
2
2
|
export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
|
|
3
3
|
import './chunk-OWENS2H5.js';
|
|
4
|
-
export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-
|
|
5
|
-
export { DEFAULT_MAX_DEPTH, applyKindSchemaOverlay, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, declaredRoutes, defaultConfigFor, ensureBuiltinKinds, getNodeKind, kindIds, listNodeKinds, llmRouterExecutor as llmBranchExecutor, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, subflowExecutor, subflowMode, subflowPorts, unregisterNodeKind, validateConfig } from './chunk-W7DMO3H7.js';
|
|
4
|
+
export { DEFAULT_MAX_DEPTH, LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, applyKindSchemaOverlay, categoryAccent, clearKindSchemaOverlays, clearNodeKindOverrides, declaredRoutes, decodePause, defaultConfigFor, encodePause, ensureBuiltinKinds, getNodeKind, isPause, kindIds, listNodeKinds, llmRouterExecutor as llmBranchExecutor, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, pauseForHuman, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, subflowExecutor, subflowMode, subflowPorts, unregisterNodeKind, validateConfig } from './chunk-YNKOEQLI.js';
|
|
6
5
|
export { capabilityStatus, getLlmClient, getTerminalHost, getWorkflowResolver, isResolutionFailure, registerLlmClient, registerTerminalHost, registerWorkflowResolver } from './chunk-2QXKDLGT.js';
|
|
7
6
|
//# sourceMappingURL=registry.js.map
|
|
8
7
|
//# sourceMappingURL=registry.js.map
|
package/dist/runtime.cjs
CHANGED
|
@@ -122,6 +122,32 @@ var llmRouterExecutor = async (ctx) => {
|
|
|
122
122
|
return { __port: port, value: { route: port, reason, input: ctx.inputs } };
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
+
// src/registry/pause.ts
|
|
126
|
+
var PAUSE_PREFIX = "fancy-flow:pause:";
|
|
127
|
+
var LEGACY_PAUSE_PREFIXES = [
|
|
128
|
+
["awaiting-approval:", "approval"],
|
|
129
|
+
["awaiting-input:", "input"]
|
|
130
|
+
];
|
|
131
|
+
function decodePause(reason) {
|
|
132
|
+
if (typeof reason !== "string") return null;
|
|
133
|
+
if (reason.startsWith(PAUSE_PREFIX)) {
|
|
134
|
+
const body = reason.slice(PAUSE_PREFIX.length);
|
|
135
|
+
try {
|
|
136
|
+
const parsed = JSON.parse(body);
|
|
137
|
+
if (typeof parsed?.nodeId !== "string" || typeof parsed?.awaiting !== "string") return null;
|
|
138
|
+
return "detail" in parsed ? { nodeId: parsed.nodeId, awaiting: parsed.awaiting, detail: parsed.detail } : { nodeId: parsed.nodeId, awaiting: parsed.awaiting };
|
|
139
|
+
} catch {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
for (const [prefix, awaiting] of LEGACY_PAUSE_PREFIXES) {
|
|
144
|
+
if (reason.startsWith(prefix)) {
|
|
145
|
+
return { nodeId: reason.slice(prefix.length), awaiting };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
|
|
125
151
|
// src/registry/subflow.ts
|
|
126
152
|
var DEFAULT_MAX_DEPTH = 8;
|
|
127
153
|
function subflowMode(config) {
|
|
@@ -203,7 +229,11 @@ var subflowExecutor = async (ctx) => {
|
|
|
203
229
|
}
|
|
204
230
|
);
|
|
205
231
|
if (!result.ok) {
|
|
206
|
-
|
|
232
|
+
const reason = result.error ?? "unknown error";
|
|
233
|
+
if (decodePause(reason)) {
|
|
234
|
+
ctx.abort(reason);
|
|
235
|
+
}
|
|
236
|
+
ctx.abort(`subflow "${ref}" failed: ${reason}`);
|
|
207
237
|
}
|
|
208
238
|
if (mode === "stream") {
|
|
209
239
|
return { __port: "stream", value: result.outputs };
|
|
@@ -2213,8 +2243,9 @@ function possiblePortIds(node) {
|
|
|
2213
2243
|
if (!kind) return ["out"];
|
|
2214
2244
|
const config = nodeConfig(node);
|
|
2215
2245
|
const representative = typeof kind.outputs === "function" && !configDeclaresPorts(kind.name, config);
|
|
2216
|
-
const
|
|
2217
|
-
|
|
2246
|
+
const resolved = resolvePortSpec(kind.outputs, representative ? defaultConfigFor(kind) : config);
|
|
2247
|
+
if (resolved === void 0) return ["out"];
|
|
2248
|
+
return resolved.map((p) => p.id);
|
|
2218
2249
|
}
|
|
2219
2250
|
function configDeclaresPorts(kindName, config) {
|
|
2220
2251
|
const bare = kindName.startsWith("@") ? kindName.slice(kindName.lastIndexOf("/") + 1) : kindName;
|
|
@@ -2540,7 +2571,7 @@ function activatedPorts(node, result) {
|
|
|
2540
2571
|
}
|
|
2541
2572
|
const kind = getNodeKind(node.data?.kind ?? node.type ?? "") ?? void 0;
|
|
2542
2573
|
const declared = resolveNodePorts(node, kind).outputs?.map((p) => p.id);
|
|
2543
|
-
return { ports: declared
|
|
2574
|
+
return { ports: declared ?? ["out"], value: result };
|
|
2544
2575
|
}
|
|
2545
2576
|
function portValueOf(activated, portId) {
|
|
2546
2577
|
return activated.values && Object.prototype.hasOwnProperty.call(activated.values, portId) ? activated.values[portId] : activated.value;
|