@particle-academy/fancy-flow 0.43.2 → 0.44.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/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-T3VQX3XB.js';
2
- export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-T3VQX3XB.js';
1
+ import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-DHUFUDEX.js';
2
+ export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-DHUFUDEX.js';
3
3
  import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-A6RFLGWV.js';
4
4
  export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-A6RFLGWV.js';
5
5
  export { runCohort } from './chunk-QZTGV3ZL.js';
6
- import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-55KQS3LK.js';
7
- export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-55KQS3LK.js';
6
+ import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-WBXGZVLB.js';
7
+ export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-WBXGZVLB.js';
8
8
  import { ReactFlowProvider, useReactFlow, addEdge, applyEdgeChanges, applyNodeChanges, Position, Handle } from './chunk-OWENS2H5.js';
9
9
  export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
10
10
  import './chunk-USL4FMFU.js';
package/dist/registry.cjs CHANGED
@@ -10371,12 +10371,22 @@ var KINDS = [
10371
10371
  // ───────────── AI ─────────────
10372
10372
  {
10373
10373
  name: "@particle-academy/llm_call",
10374
- // LlmClient::complete() -> array{text:string,usage?:array,raw?:mixed}
10375
- outputShape: [
10376
- { path: "text", type: "string", description: "The model's completion." },
10377
- { path: "usage", type: "object", description: "Token counts, when the provider reports them." },
10378
- { path: "raw", type: "unknown", description: "The provider's untouched response." }
10379
- ],
10374
+ // LlmClient::complete() -> array{text:string,data?:mixed,usage?:array,raw?:mixed}
10375
+ //
10376
+ // A FUNCTION of config, because `data` exists only when this node was asked
10377
+ // for a schema. Declaring it statically would offer `{{ $json.data }}` on
10378
+ // every llm_call in the kit, including the ones that emit nothing of the
10379
+ // sort — and a suggestion that resolves to null at runtime is worse than no
10380
+ // suggestion, since the picker is exactly what gave the author confidence.
10381
+ outputShape: (config) => {
10382
+ const asked = config?.response_schema != null && config.response_schema !== "" && !(Array.isArray(config.response_schema) && config.response_schema.length === 0);
10383
+ return [
10384
+ { path: "text", type: "string", description: "The model's completion." },
10385
+ ...asked ? [{ path: "data", type: "unknown", description: "The parsed, schema-checked result." }] : [],
10386
+ { path: "usage", type: "object", description: "Token counts, when the provider reports them." },
10387
+ { path: "raw", type: "unknown", description: "The provider's untouched response." }
10388
+ ];
10389
+ },
10380
10390
  aliases: ["llm_call", "@fancy/llm_call"],
10381
10391
  category: "ai",
10382
10392
  label: "LLM Call",
@@ -10417,6 +10427,12 @@ var KINDS = [
10417
10427
  }
10418
10428
  ]
10419
10429
  },
10430
+ {
10431
+ type: "json",
10432
+ key: "response_schema",
10433
+ label: "Response schema",
10434
+ description: "Optional JSON Schema. When set, the runtime asks the provider for schema-valid JSON and the node emits the parsed value as `data` \u2014 reference it as {{ $json.data }}. A response that cannot be parsed or does not match FAILS the node rather than passing an empty value downstream."
10435
+ },
10420
10436
  { type: "credential", key: "credential", label: "API credential", credentialType: "llm_credential" }
10421
10437
  ]
10422
10438
  },