@particle-academy/fancy-flow 0.53.0 → 0.55.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-Bc9Txnql.d.cts → HumanPrompt-CPl-Spmp.d.cts} +75 -1
- package/dist/{ConfigFieldRenderer-Bt3RGT7Z.d.ts → HumanPrompt-DlJSFi3F.d.ts} +75 -1
- 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-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/{chunk-FH6MWLKD.js → chunk-YVLOLS25.js} +3 -3
- package/dist/{chunk-FH6MWLKD.js.map → chunk-YVLOLS25.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/fields/react-fancy.cjs +66 -0
- package/dist/fields/react-fancy.cjs.map +1 -1
- package/dist/fields/react-fancy.d.cts +35 -2
- package/dist/fields/react-fancy.d.ts +35 -2
- package/dist/fields/react-fancy.js +67 -2
- package/dist/fields/react-fancy.js.map +1 -1
- package/dist/index.cjs +34 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +40 -20
- package/dist/index.js.map +1 -1
- 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.cjs +5 -1
- 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
|
@@ -89,4 +89,78 @@ type ConfigFieldRendererProps = {
|
|
|
89
89
|
*/
|
|
90
90
|
declare function ConfigFieldRenderer({ field, value, onChange, id, renderCredentialField, renderDocumentField, fieldRenderers, graph, nodeId, }: ConfigFieldRendererProps): react.JSX.Element | null;
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The field vocabulary a `user_input` node declares, and the normalizer that
|
|
94
|
+
* turns whatever was actually written into something renderable.
|
|
95
|
+
*
|
|
96
|
+
* ## Why this is a separate module from `HumanPrompt.tsx`
|
|
97
|
+
*
|
|
98
|
+
* `src/registry/builtin.ts` needs `humanFieldType` for the `user_input` kind's
|
|
99
|
+
* `outputShape`, and `builtin.ts` is in the import graph of the `/engine`
|
|
100
|
+
* entry — the one `tests/core-nodes.test.ts` guards as React-free so a queue
|
|
101
|
+
* worker or a CLI can register kinds without dragging React in. Importing the
|
|
102
|
+
* modal's `.tsx` from there put a React module on that path and left the guard
|
|
103
|
+
* standing only because treeshaking happened to drop it.
|
|
104
|
+
*
|
|
105
|
+
* Pure functions over plain data, in a `.ts` file, so the headless path cannot
|
|
106
|
+
* regress on a future edit to the component.
|
|
107
|
+
*/
|
|
108
|
+
/**
|
|
109
|
+
* The control a field renders as, after {@link humanInputFields} has resolved
|
|
110
|
+
* whatever the author, a peer runtime or an agent actually wrote.
|
|
111
|
+
*
|
|
112
|
+
* These are the CANONICAL names. The vocabulary an author may write is wider —
|
|
113
|
+
* see {@link HUMAN_FIELD_TYPE_ALIASES} — because a `fields` array arrives from
|
|
114
|
+
* three places (the config panel, a hand-written workflow JSON, and the PHP /
|
|
115
|
+
* Python runtimes) and each has its own habits for spelling "boolean".
|
|
116
|
+
*/
|
|
117
|
+
type HumanFieldType = "text" | "textarea" | "number" | "select" | "switch" | "date" | "datetime" | "time" | "email" | "url" | "tel" | "password";
|
|
118
|
+
/** One choice in a `select` field, after normalization. */
|
|
119
|
+
type HumanFieldOption = {
|
|
120
|
+
value: string;
|
|
121
|
+
label: string;
|
|
122
|
+
};
|
|
123
|
+
/** A field the input modal renders. Mirrors a `user_input` `fields` row. */
|
|
124
|
+
type HumanField = {
|
|
125
|
+
key: string;
|
|
126
|
+
label?: string;
|
|
127
|
+
type?: HumanFieldType;
|
|
128
|
+
required?: boolean;
|
|
129
|
+
placeholder?: string;
|
|
130
|
+
options?: HumanFieldOption[];
|
|
131
|
+
default?: unknown;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** What a host renderer is handed for one field. */
|
|
135
|
+
type HumanFieldRenderContext = {
|
|
136
|
+
field: HumanField;
|
|
137
|
+
/** The id the field's `<label>` points at — put it on your control. */
|
|
138
|
+
id: string;
|
|
139
|
+
value: unknown;
|
|
140
|
+
onChange: (v: unknown) => void;
|
|
141
|
+
/** Present only on the first field; attach it so the modal autofocuses. */
|
|
142
|
+
autoFocusRef?: React.RefObject<HTMLElement | null>;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Render one field, or return `null` to decline it.
|
|
146
|
+
*
|
|
147
|
+
* `null` means "not mine" and falls through to the built-in control. That is
|
|
148
|
+
* what makes a PARTIAL map safe to spread: a host handing over someone else's
|
|
149
|
+
* renderers does not silently lose every type that map does not cover.
|
|
150
|
+
*/
|
|
151
|
+
type HumanFieldRenderFn = (ctx: HumanFieldRenderContext) => ReactNode | null;
|
|
152
|
+
/**
|
|
153
|
+
* Host overrides for pause-form controls, keyed by CANONICAL field type
|
|
154
|
+
* (`"switch"`, not `"boolean"` — aliases are normalised before the lookup, so
|
|
155
|
+
* one entry covers every spelling of that type).
|
|
156
|
+
*
|
|
157
|
+
* The built-ins are deliberately native `--ff-*`-themed elements rather than
|
|
158
|
+
* react-fancy primitives: react-fancy is an OPTIONAL peer and this modal ships
|
|
159
|
+
* in the main entry, so importing it here would break a standalone install and
|
|
160
|
+
* bypass the token layer a host themes `.ff-editor` with. This seam is how a
|
|
161
|
+
* host that HAS react-fancy gets Fancy controls anyway —
|
|
162
|
+
* `@particle-academy/fancy-flow/fields/react-fancy` exports a ready map.
|
|
163
|
+
*/
|
|
164
|
+
type HumanFieldRenderers = Partial<Record<HumanFieldType, HumanFieldRenderFn>>;
|
|
165
|
+
|
|
166
|
+
export { type ConfigFieldRenderFn as C, type HumanFieldRenderers as H, type ConfigFieldRenderContext as a, ConfigFieldRenderer as b, type ConfigFieldRendererProps as c };
|
|
@@ -89,4 +89,78 @@ type ConfigFieldRendererProps = {
|
|
|
89
89
|
*/
|
|
90
90
|
declare function ConfigFieldRenderer({ field, value, onChange, id, renderCredentialField, renderDocumentField, fieldRenderers, graph, nodeId, }: ConfigFieldRendererProps): react.JSX.Element | null;
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The field vocabulary a `user_input` node declares, and the normalizer that
|
|
94
|
+
* turns whatever was actually written into something renderable.
|
|
95
|
+
*
|
|
96
|
+
* ## Why this is a separate module from `HumanPrompt.tsx`
|
|
97
|
+
*
|
|
98
|
+
* `src/registry/builtin.ts` needs `humanFieldType` for the `user_input` kind's
|
|
99
|
+
* `outputShape`, and `builtin.ts` is in the import graph of the `/engine`
|
|
100
|
+
* entry — the one `tests/core-nodes.test.ts` guards as React-free so a queue
|
|
101
|
+
* worker or a CLI can register kinds without dragging React in. Importing the
|
|
102
|
+
* modal's `.tsx` from there put a React module on that path and left the guard
|
|
103
|
+
* standing only because treeshaking happened to drop it.
|
|
104
|
+
*
|
|
105
|
+
* Pure functions over plain data, in a `.ts` file, so the headless path cannot
|
|
106
|
+
* regress on a future edit to the component.
|
|
107
|
+
*/
|
|
108
|
+
/**
|
|
109
|
+
* The control a field renders as, after {@link humanInputFields} has resolved
|
|
110
|
+
* whatever the author, a peer runtime or an agent actually wrote.
|
|
111
|
+
*
|
|
112
|
+
* These are the CANONICAL names. The vocabulary an author may write is wider —
|
|
113
|
+
* see {@link HUMAN_FIELD_TYPE_ALIASES} — because a `fields` array arrives from
|
|
114
|
+
* three places (the config panel, a hand-written workflow JSON, and the PHP /
|
|
115
|
+
* Python runtimes) and each has its own habits for spelling "boolean".
|
|
116
|
+
*/
|
|
117
|
+
type HumanFieldType = "text" | "textarea" | "number" | "select" | "switch" | "date" | "datetime" | "time" | "email" | "url" | "tel" | "password";
|
|
118
|
+
/** One choice in a `select` field, after normalization. */
|
|
119
|
+
type HumanFieldOption = {
|
|
120
|
+
value: string;
|
|
121
|
+
label: string;
|
|
122
|
+
};
|
|
123
|
+
/** A field the input modal renders. Mirrors a `user_input` `fields` row. */
|
|
124
|
+
type HumanField = {
|
|
125
|
+
key: string;
|
|
126
|
+
label?: string;
|
|
127
|
+
type?: HumanFieldType;
|
|
128
|
+
required?: boolean;
|
|
129
|
+
placeholder?: string;
|
|
130
|
+
options?: HumanFieldOption[];
|
|
131
|
+
default?: unknown;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** What a host renderer is handed for one field. */
|
|
135
|
+
type HumanFieldRenderContext = {
|
|
136
|
+
field: HumanField;
|
|
137
|
+
/** The id the field's `<label>` points at — put it on your control. */
|
|
138
|
+
id: string;
|
|
139
|
+
value: unknown;
|
|
140
|
+
onChange: (v: unknown) => void;
|
|
141
|
+
/** Present only on the first field; attach it so the modal autofocuses. */
|
|
142
|
+
autoFocusRef?: React.RefObject<HTMLElement | null>;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Render one field, or return `null` to decline it.
|
|
146
|
+
*
|
|
147
|
+
* `null` means "not mine" and falls through to the built-in control. That is
|
|
148
|
+
* what makes a PARTIAL map safe to spread: a host handing over someone else's
|
|
149
|
+
* renderers does not silently lose every type that map does not cover.
|
|
150
|
+
*/
|
|
151
|
+
type HumanFieldRenderFn = (ctx: HumanFieldRenderContext) => ReactNode | null;
|
|
152
|
+
/**
|
|
153
|
+
* Host overrides for pause-form controls, keyed by CANONICAL field type
|
|
154
|
+
* (`"switch"`, not `"boolean"` — aliases are normalised before the lookup, so
|
|
155
|
+
* one entry covers every spelling of that type).
|
|
156
|
+
*
|
|
157
|
+
* The built-ins are deliberately native `--ff-*`-themed elements rather than
|
|
158
|
+
* react-fancy primitives: react-fancy is an OPTIONAL peer and this modal ships
|
|
159
|
+
* in the main entry, so importing it here would break a standalone install and
|
|
160
|
+
* bypass the token layer a host themes `.ff-editor` with. This seam is how a
|
|
161
|
+
* host that HAS react-fancy gets Fancy controls anyway —
|
|
162
|
+
* `@particle-academy/fancy-flow/fields/react-fancy` exports a ready map.
|
|
163
|
+
*/
|
|
164
|
+
type HumanFieldRenderers = Partial<Record<HumanFieldType, HumanFieldRenderFn>>;
|
|
165
|
+
|
|
166
|
+
export { type ConfigFieldRenderFn as C, type HumanFieldRenderers as H, type ConfigFieldRenderContext as a, ConfigFieldRenderer as b, type ConfigFieldRendererProps as c };
|
|
@@ -9454,7 +9454,7 @@ function resolveWorkflowProps(declared, passed) {
|
|
|
9454
9454
|
// src/runtime/run-flow.ts
|
|
9455
9455
|
async function runFlow(graph, executors, onEvent = () => {
|
|
9456
9456
|
}, options = {}) {
|
|
9457
|
-
const { signal, initialInputs = {}, timeoutMs, depth = 0, resumeOutputs = {} } = options;
|
|
9457
|
+
const { signal, initialInputs = {}, timeoutMs, depth = 0, resumeOutputs = {}, entryNodes } = options;
|
|
9458
9458
|
const run = options.run === void 0 ? void 0 : RunIdentity.from(options.run);
|
|
9459
9459
|
const outputs = {};
|
|
9460
9460
|
const portValues = /* @__PURE__ */ new Map();
|
|
@@ -9493,6 +9493,10 @@ async function runFlow(graph, executors, onEvent = () => {
|
|
|
9493
9493
|
continue;
|
|
9494
9494
|
}
|
|
9495
9495
|
const incoming = incomingByNode.get(node.id) ?? [];
|
|
9496
|
+
if (incoming.length === 0 && entryNodes !== void 0 && !entryNodes.includes(node.id)) {
|
|
9497
|
+
onEvent({ type: "node-status", nodeId: node.id, status: "idle", text: "skipped" });
|
|
9498
|
+
continue;
|
|
9499
|
+
}
|
|
9496
9500
|
if (incoming.length > 0) {
|
|
9497
9501
|
const anyActive = incoming.some((e) => portValues.has(`${e.source}:${e.sourceHandle ?? "out"}`));
|
|
9498
9502
|
if (!anyActive) {
|
|
@@ -10848,5 +10852,5 @@ function LaneNodeInner(props) {
|
|
|
10848
10852
|
var LaneNode = memo(LaneNodeInner);
|
|
10849
10853
|
|
|
10850
10854
|
export { BUILTIN_KINDS, Background, BackgroundVariant, Controls, DEFAULT_MAX_DEPTH, FlowEditorProvider, Handle, LaneNode, MiniMap, NodeResizer, NodeToolbar, NoteNode, Position, ReactFlowProvider, RunIdentity, ViewportPortal, addEdge2 as addEdge, applyEdgeChanges, applyNodeChanges, categoryAccent, clearNodeKindOverrides, declaredRoutes, defaultConfigFor, ensureBuiltinKinds, escapeSegment, getNodeKind, humanInputFields, index, kindIds, listNodeKinds, llmRouterExecutor, nodeConfig, onNodeKindsChanged, overrideNodeKind, reconnectEdge2 as reconnectEdge, registerBuiltinKinds, registerNodeKind, resolveFallbackPort, resolveKindId, resolveNodePorts, resolvePortSpec, runFlow, subflowExecutor, subflowMode, subflowPorts, useFlowEditor, useFlowEditorOptional, useReactFlow, validateConfig };
|
|
10851
|
-
//# sourceMappingURL=chunk-
|
|
10852
|
-
//# sourceMappingURL=chunk-
|
|
10855
|
+
//# sourceMappingURL=chunk-22OJOD4X.js.map
|
|
10856
|
+
//# sourceMappingURL=chunk-22OJOD4X.js.map
|