langflower 0.0.8 → 0.0.10
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/package.json +2 -2
- package/ui-dist/{chunk-Y6VMBLSJ.js → chunk-7UMVYN3A.js} +1 -1
- package/ui-dist/{chunk-6DQ2XSRW.js → chunk-MDGXX73Z.js} +3 -3
- package/ui-dist/index.html +2 -2
- package/ui-dist/main-Z7CPFXFA.js +313 -0
- package/ui-dist/styles-2TMDAUD7.css +1 -0
- package/vendor/common-nodes/dist/ai/chat-completion-stream.d.ts +2 -0
- package/vendor/common-nodes/dist/ai/critique/node.d.ts +246 -0
- package/vendor/common-nodes/dist/ai/critique/node.js +2 -2
- package/vendor/common-nodes/dist/ai/fake-llm/node.d.ts +246 -0
- package/vendor/common-nodes/dist/ai/features/chat-completion-stream.d.ts +53 -0
- package/vendor/common-nodes/dist/ai/features/chat-completion-stream.js +1 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/autokick-recovery.d.ts +13 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/autokick-recovery.js +17 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/classify-llm-failure.d.ts +2 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/classify-llm-failure.js +113 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/dead-loop-detector.d.ts +28 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/dead-loop-detector.js +194 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/live-get-tools.d.ts +9 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/live-get-tools.js +21 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/llm-loop-reducer.d.ts +2 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/llm-loop-reducer.js +204 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/llm-loop-types.d.ts +120 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/llm-loop-types.js +39 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/normalize-llm-recovery-policy.d.ts +2 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/normalize-llm-recovery-policy.js +59 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/operators/normalize-tool-result.d.ts +1 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/operators/normalize-tool-result.js +7 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/operators/observe-provider-stream.d.ts +43 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/operators/observe-provider-stream.js +96 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/run-agent-loop.d.ts +29 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/run-agent-loop.js +44 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/run-llm-loop.d.ts +74 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/run-llm-loop.js +658 -0
- package/vendor/common-nodes/dist/ai/features/llm-role-preset.d.ts +69 -0
- package/vendor/common-nodes/dist/ai/features/llm-role-preset.js +265 -0
- package/vendor/common-nodes/dist/ai/features/llm-session/llm-session-shell.d.ts +141 -0
- package/vendor/common-nodes/dist/ai/features/llm-session/llm-session-shell.js +193 -0
- package/vendor/common-nodes/dist/ai/features/llm-session/run-session-machine.d.ts +21 -0
- package/vendor/common-nodes/dist/ai/features/llm-session/run-session-machine.js +118 -0
- package/vendor/common-nodes/dist/ai/features/openai/context-length-error.d.ts +14 -0
- package/vendor/common-nodes/dist/ai/features/openai/context-length-error.js +63 -0
- package/vendor/common-nodes/dist/ai/features/openai/create-chat-completion-stream.d.ts +19 -0
- package/vendor/common-nodes/dist/ai/features/openai/create-chat-completion-stream.js +182 -0
- package/vendor/common-nodes/dist/ai/features/openai/list-provider-models.d.ts +28 -0
- package/vendor/common-nodes/dist/ai/features/openai/list-provider-models.js +52 -0
- package/vendor/common-nodes/dist/ai/features/openai/llm-context-compaction.d.ts +31 -0
- package/vendor/common-nodes/dist/ai/features/openai/llm-context-compaction.js +326 -0
- package/vendor/common-nodes/dist/ai/features/openai/normalize-compaction-params.d.ts +14 -0
- package/vendor/common-nodes/dist/ai/features/openai/normalize-compaction-params.js +21 -0
- package/vendor/common-nodes/dist/ai/features/openai/prepare-chat-completion.d.ts +30 -0
- package/vendor/common-nodes/dist/ai/features/openai/prepare-chat-completion.js +132 -0
- package/vendor/common-nodes/dist/ai/features/path-choice/control-tools.d.ts +20 -0
- package/vendor/common-nodes/dist/ai/features/path-choice/control-tools.js +70 -0
- package/vendor/common-nodes/dist/ai/features/path-choice/run-reactive-path-choice-loop.d.ts +32 -0
- package/vendor/common-nodes/dist/ai/features/path-choice/run-reactive-path-choice-loop.js +93 -0
- package/vendor/common-nodes/dist/ai/features/prompt/build-effective-system-prompt.d.ts +9 -0
- package/vendor/common-nodes/dist/ai/features/prompt/build-effective-system-prompt.js +21 -0
- package/vendor/common-nodes/dist/ai/features/prompt/normalize-max-iterations.d.ts +13 -0
- package/vendor/common-nodes/dist/ai/features/prompt/normalize-max-iterations.js +23 -0
- package/vendor/common-nodes/dist/ai/features/prompt/resolve-chat-provider-model.d.ts +10 -0
- package/vendor/common-nodes/dist/ai/features/prompt/resolve-chat-provider-model.js +8 -0
- package/vendor/common-nodes/dist/ai/features/run-host-services.d.ts +54 -0
- package/vendor/common-nodes/dist/ai/features/run-host-services.js +29 -0
- package/vendor/common-nodes/dist/ai/features/scripted-chat-completion-stream.d.ts +17 -0
- package/vendor/common-nodes/dist/ai/features/scripted-chat-completion-stream.js +61 -0
- package/vendor/common-nodes/dist/ai/features/sub-agent-protocol.d.ts +40 -0
- package/vendor/common-nodes/dist/ai/features/sub-agent-protocol.js +44 -0
- package/vendor/common-nodes/dist/ai/features/ui-schema/llm-compaction-ui-schema.d.ts +14 -0
- package/vendor/common-nodes/dist/ai/features/ui-schema/llm-compaction-ui-schema.js +18 -0
- package/vendor/common-nodes/dist/ai/features/ui-schema/llm-panel-ui-schema.d.ts +80 -0
- package/vendor/common-nodes/dist/ai/features/ui-schema/llm-panel-ui-schema.js +76 -0
- package/vendor/common-nodes/dist/ai/features/ui-schema/llm-recovery-ui-schema.d.ts +113 -0
- package/vendor/common-nodes/dist/ai/features/ui-schema/llm-recovery-ui-schema.js +131 -0
- package/vendor/common-nodes/dist/ai/features/wait-for-subagent-result.d.ts +7 -0
- package/vendor/common-nodes/dist/ai/features/wait-for-subagent-result.js +31 -0
- package/vendor/common-nodes/dist/ai/llm-loop/autokick-recovery.d.ts +13 -0
- package/vendor/common-nodes/dist/ai/llm-loop/autokick-recovery.js +17 -0
- package/vendor/common-nodes/dist/ai/llm-loop/dead-loop-detector.d.ts +28 -0
- package/vendor/common-nodes/dist/ai/llm-loop/dead-loop-detector.js +194 -0
- package/vendor/common-nodes/dist/ai/llm-loop/llm-loop-reducer.js +36 -0
- package/vendor/common-nodes/dist/ai/llm-loop/llm-loop-types.d.ts +35 -0
- package/vendor/common-nodes/dist/ai/llm-loop/llm-loop-types.js +19 -0
- package/vendor/common-nodes/dist/ai/llm-loop/normalize-llm-recovery-policy.js +52 -9
- package/vendor/common-nodes/dist/ai/llm-loop/operators/observe-provider-stream.d.ts +8 -2
- package/vendor/common-nodes/dist/ai/llm-loop/operators/observe-provider-stream.js +43 -13
- package/vendor/common-nodes/dist/ai/llm-loop/run-llm-loop.d.ts +3 -5
- package/vendor/common-nodes/dist/ai/llm-loop/run-llm-loop.js +116 -1
- package/vendor/common-nodes/dist/ai/llm-recovery-ui-schema.d.ts +82 -0
- package/vendor/common-nodes/dist/ai/llm-recovery-ui-schema.js +95 -0
- package/vendor/common-nodes/dist/ai/llm-session-shell.d.ts +4 -9
- package/vendor/common-nodes/dist/ai/llm-session-shell.js +2 -4
- package/vendor/common-nodes/dist/ai/nodes/critique/node.d.ts +588 -0
- package/vendor/common-nodes/dist/ai/nodes/critique/node.js +227 -0
- package/vendor/common-nodes/dist/ai/nodes/fake-llm/node.d.ts +571 -0
- package/vendor/common-nodes/dist/ai/nodes/fake-llm/node.js +201 -0
- package/vendor/common-nodes/dist/ai/nodes/openai-llm/node.d.ts +587 -0
- package/vendor/common-nodes/dist/ai/nodes/openai-llm/node.js +84 -0
- package/vendor/common-nodes/dist/ai/nodes/review/node.d.ts +593 -0
- package/vendor/common-nodes/dist/ai/nodes/review/node.js +227 -0
- package/vendor/common-nodes/dist/ai/nodes/sub-agent/node.d.ts +630 -0
- package/vendor/common-nodes/dist/ai/nodes/sub-agent/node.js +417 -0
- package/vendor/common-nodes/dist/ai/openai/create-chat-completion-stream.js +6 -0
- package/vendor/common-nodes/dist/ai/openai/prepare-chat-completion.d.ts +2 -0
- package/vendor/common-nodes/dist/ai/openai/prepare-chat-completion.js +18 -0
- package/vendor/common-nodes/dist/ai/openai-llm/node.d.ts +246 -0
- package/vendor/common-nodes/dist/ai/review/node.d.ts +246 -0
- package/vendor/common-nodes/dist/ai/review/node.js +2 -2
- package/vendor/common-nodes/dist/ai/sub-agent/node.d.ts +246 -0
- package/vendor/common-nodes/dist/ai/sub-agent/node.js +2 -2
- package/vendor/common-nodes/dist/catalog.js +9 -5
- package/vendor/common-nodes/dist/compile-custom-nodes/node.d.ts +21 -0
- package/vendor/common-nodes/dist/compile-custom-nodes/node.js +45 -0
- package/vendor/common-nodes/dist/crawl/crawl/node.js +1 -1
- package/vendor/common-nodes/dist/crawl/fetch-url/node.js +1 -1
- package/vendor/common-nodes/dist/flow/repeat/node.js +6 -1
- package/vendor/common-nodes/dist/langflower-tools/emit-registration-tools.d.ts +18 -0
- package/vendor/common-nodes/dist/langflower-tools/emit-registration-tools.js +29 -0
- package/vendor/common-nodes/dist/langflower-tools/node.d.ts +20 -0
- package/vendor/common-nodes/dist/langflower-tools/node.js +77 -0
- package/vendor/common-nodes/dist/mcp/mcp-http/node.d.ts +4 -4
- package/vendor/common-nodes/dist/mcp/mcp-http/node.js +9 -10
- package/vendor/common-nodes/dist/mcp/mcp-stdio/node.d.ts +4 -4
- package/vendor/common-nodes/dist/mcp/mcp-stdio/node.js +9 -10
- package/vendor/common-nodes/dist/text/append-file/node.js +1 -1
- package/vendor/common-nodes/dist/text/read-file/node.js +1 -1
- package/vendor/common-nodes/dist/text/write-file/node.js +1 -1
- package/vendor/common-nodes/dist/tools/collect-agent-tool-handles.d.ts +4 -4
- package/vendor/common-nodes/dist/tools/collect-agent-tool-handles.js +3 -11
- package/vendor/common-nodes/dist/tools/inventory-tool-round.d.ts +1 -11
- package/vendor/common-nodes/dist/tools/inventory-tool-round.js +0 -84
- package/vendor/common-nodes/dist/tools/tool-collection/node.d.ts +20 -0
- package/vendor/common-nodes/dist/tools/tool-collection/node.js +42 -0
- package/vendor/common-nodes/package.json +9 -13
- package/vendor/compiler/dist/compile-project-nodes.d.ts +2 -1
- package/vendor/compiler/dist/compile-project-nodes.js +35 -6
- package/vendor/compiler/dist/resolve-host-types.d.ts +0 -5
- package/vendor/compiler/dist/resolve-host-types.js +0 -8
- package/vendor/compiler/package.json +1 -1
- package/vendor/node-sdk/dist/node-factory/define-llm-node/default-llm-ports.d.ts +3 -7
- package/vendor/node-sdk/dist/node-factory/define-llm-node/default-llm-ports.js +4 -44
- package/vendor/node-sdk/dist/node-factory/define-llm-node/define-llm-node.d.ts +4 -6
- package/vendor/node-sdk/dist/node-factory/define-llm-node/define-llm-node.js +4 -6
- package/vendor/node-sdk/dist/node-factory/define-llm-node/llm-inventory-wire.d.ts +1 -0
- package/vendor/node-sdk/dist/node-factory/define-llm-node/llm-inventory-wire.js +1 -0
- package/vendor/node-sdk/dist/node-factory/define-llm-node/recovery-notice.d.ts +8 -0
- package/vendor/node-sdk/dist/node-factory/define-llm-node/recovery-notice.js +14 -0
- package/vendor/node-sdk/dist/node-factory/define-mcp/mcp-handle.d.ts +3 -4
- package/vendor/node-sdk/dist/node-factory/define-mcp/mcp-handle.js +1 -1
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/types.d.ts +2 -4
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/ui-schema-inference.d.ts +1 -1
- package/vendor/node-sdk/package.json +1 -1
- package/vendor/runtime/dist/port-feed-override.d.ts +13 -0
- package/vendor/runtime/dist/port-feed-override.js +21 -0
- package/vendor/runtime/dist/port-signal-from-response.d.ts +15 -0
- package/vendor/runtime/dist/port-signal-from-response.js +48 -0
- package/vendor/runtime/dist/runtime-editor.d.ts +5 -1
- package/vendor/runtime/dist/runtime-editor.js +19 -0
- package/vendor/runtime/dist/runtime-runner.d.ts +8 -3
- package/vendor/runtime/dist/runtime-runner.js +108 -87
- package/vendor/runtime/dist/runtime.d.ts +3 -1
- package/vendor/runtime/dist/runtime.js +1 -0
- package/vendor/runtime/dist/testing/workflows/workflow-events.d.ts +10 -6
- package/vendor/runtime/dist/testing/workflows/workflow-events.js +21 -31
- package/vendor/runtime/dist/types.d.ts +52 -40
- package/vendor/runtime/dist/types.js +5 -1
- package/vendor/runtime/package.json +1 -1
- package/vendor/server/dist/bridge/attach-langflower-bridge.js +3 -2
- package/vendor/server/dist/bridge/bridge-event-log.js +17 -102
- package/vendor/server/dist/bridge/build-execution-context.d.ts +5 -2
- package/vendor/server/dist/bridge/build-execution-context.js +48 -8
- package/vendor/server/dist/bridge/forward-runner-event.d.ts +1 -1
- package/vendor/server/dist/bridge/forward-runner-event.js +7 -12
- package/vendor/server/dist/bridge/get-live-wired-tools.d.ts +13 -0
- package/vendor/server/dist/bridge/get-live-wired-tools.js +83 -0
- package/vendor/server/dist/bridge/langflower-tools-rpc.d.ts +7 -0
- package/vendor/server/dist/bridge/langflower-tools-rpc.js +29 -0
- package/vendor/server/dist/bridge/wire-custom-palette-handlers.d.ts +2 -1
- package/vendor/server/dist/bridge/wire-custom-palette-handlers.js +3 -5
- package/vendor/server/dist/bridge/wire-runner-handlers.js +17 -10
- package/vendor/server/dist/bridge/wire-workflow-handlers.js +23 -9
- package/vendor/server/dist/checkpoint/run-checkpoint-session.d.ts +1 -1
- package/vendor/server/dist/checkpoint/run-checkpoint-session.js +10 -9
- package/vendor/server/dist/palette/compile-and-hot-swap-custom-nodes.d.ts +10 -0
- package/vendor/server/dist/palette/compile-and-hot-swap-custom-nodes.js +23 -0
- package/vendor/server/dist/session/reset-session-execution-feed.d.ts +6 -0
- package/vendor/server/dist/session/reset-session-execution-feed.js +8 -0
- package/vendor/server/dist/workflow/apply-editor-mutation.d.ts +5 -0
- package/vendor/server/dist/workflow/apply-editor-mutation.js +32 -0
- package/vendor/server/skeleton/instructions.md +9 -5
- package/vendor/server/skeleton/nodes/my-nodes/README.md +4 -3
- package/vendor/server/skeleton/nodes/my-nodes/package.json +1 -1
- package/vendor/server/skeleton/skills/langflower-helper/SKILL.md +82 -38
- package/vendor/server/skeleton/skills/langflower-helper/architecture.md +29 -10
- package/vendor/server/skeleton/skills/langflower-helper/layout.md +16 -15
- package/vendor/server/skeleton/skills/langflower-node-writer/SKILL.md +19 -9
- package/vendor/server/skeleton/skills/langflower-workflow-writer/SKILL.md +23 -15
- package/vendor/server/skeleton/workflows/kb-create.json +15 -43
- package/vendor/server/skeleton/workflows/kb-navigate.json +8 -22
- package/vendor/server/skeleton/workflows/simple-coder.json +18 -46
- package/vendor/server/skeleton/workflows/starter.json +35 -22
- package/vendor/shared/dist/execution/derive-run-settle-outcome.d.ts +1 -1
- package/vendor/shared/dist/execution/derive-run-settle-outcome.js +4 -3
- package/vendor/shared/dist/execution/derive-run-settle-outcome.test.js +18 -15
- package/vendor/shared/dist/langflower-bus-config.d.ts +6 -14
- package/vendor/shared/dist/langflower-bus-config.js +4 -12
- package/vendor/shared/dist/langflower-config/resolve-wired-tool-options.js +6 -0
- package/vendor/shared/dist/langflower-config/resolve-wired-tool-options.test.js +30 -0
- package/vendor/shared/dist/langflower-ws-waits.d.ts +9 -14
- package/vendor/shared/dist/langflower-ws-waits.js +14 -14
- package/vendor/websocket-bridge/dist/bridge-codec.d.ts +1 -0
- package/vendor/websocket-bridge/dist/bridge-codec.js +11 -11
- package/vendor/websocket-bridge/dist/bridge-frame.js +1 -1
- package/vendor/websocket-bridge/dist/bridge-subjects.d.ts +1 -1
- package/vendor/websocket-bridge/dist/bridge-subjects.js +2 -2
- package/vendor/websocket-bridge/dist/bridge-types.d.ts +13 -1
- package/vendor/websocket-bridge/dist/create-client.js +3 -3
- package/vendor/websocket-bridge/dist/create-server.js +12 -6
- package/vendor/websocket-bridge/package.json +8 -0
- package/ui-dist/main-ECEWAM6V.js +0 -311
- package/ui-dist/styles-EOXODOI7.css +0 -1
|
@@ -128,6 +128,88 @@ export declare const subAgentNode: {
|
|
|
128
128
|
readonly min: 0;
|
|
129
129
|
readonly max: 32;
|
|
130
130
|
readonly step: 1;
|
|
131
|
+
}, {
|
|
132
|
+
readonly field: "autokickOnIdle";
|
|
133
|
+
readonly type: "boolean";
|
|
134
|
+
readonly label: "Autokick on idle and dead-loop";
|
|
135
|
+
readonly default: boolean;
|
|
136
|
+
}, {
|
|
137
|
+
readonly field: "deadLoopEnabled";
|
|
138
|
+
readonly type: "boolean";
|
|
139
|
+
readonly label: "Detect repetition dead loops";
|
|
140
|
+
readonly default: boolean;
|
|
141
|
+
}, {
|
|
142
|
+
readonly field: "maxAutokickAttempts";
|
|
143
|
+
readonly type: "number";
|
|
144
|
+
readonly label: "Max autokick reconnects (0 = unlimited)";
|
|
145
|
+
readonly default: number;
|
|
146
|
+
readonly min: 0;
|
|
147
|
+
readonly max: 1000;
|
|
148
|
+
readonly step: 1;
|
|
149
|
+
}, {
|
|
150
|
+
readonly field: "autokickBackoffMs";
|
|
151
|
+
readonly type: "number";
|
|
152
|
+
readonly label: "Autokick backoff base (ms)";
|
|
153
|
+
readonly default: number;
|
|
154
|
+
readonly min: 1000;
|
|
155
|
+
readonly step: 1000;
|
|
156
|
+
}, {
|
|
157
|
+
readonly field: "autokickMaxBackoffMs";
|
|
158
|
+
readonly type: "number";
|
|
159
|
+
readonly label: "Autokick backoff clamp (ms)";
|
|
160
|
+
readonly default: number;
|
|
161
|
+
readonly min: 1000;
|
|
162
|
+
readonly step: 1000;
|
|
163
|
+
}, {
|
|
164
|
+
readonly field: "autokickUserMessage";
|
|
165
|
+
readonly type: "string";
|
|
166
|
+
readonly label: "Autokick kick message";
|
|
167
|
+
readonly default: string;
|
|
168
|
+
}, {
|
|
169
|
+
readonly field: "autokickPenaltyFrequency";
|
|
170
|
+
readonly type: "number";
|
|
171
|
+
readonly label: "Autokick frequency_penalty delta";
|
|
172
|
+
readonly default: number;
|
|
173
|
+
readonly min: -2;
|
|
174
|
+
readonly max: 2;
|
|
175
|
+
readonly step: 0.1;
|
|
176
|
+
}, {
|
|
177
|
+
readonly field: "autokickPenaltyPresence";
|
|
178
|
+
readonly type: "number";
|
|
179
|
+
readonly label: "Autokick presence_penalty delta";
|
|
180
|
+
readonly default: number;
|
|
181
|
+
readonly min: -2;
|
|
182
|
+
readonly max: 2;
|
|
183
|
+
readonly step: 0.1;
|
|
184
|
+
}, {
|
|
185
|
+
readonly field: "deadLoopMaxWindowTokens";
|
|
186
|
+
readonly type: "number";
|
|
187
|
+
readonly label: "Dead-loop window (tokens)";
|
|
188
|
+
readonly default: number;
|
|
189
|
+
readonly min: 10;
|
|
190
|
+
readonly max: 8000;
|
|
191
|
+
readonly step: 1;
|
|
192
|
+
}, {
|
|
193
|
+
readonly field: "deadLoopConsecutiveThreshold";
|
|
194
|
+
readonly type: "number";
|
|
195
|
+
readonly label: "Dead-loop consecutive identical deltas";
|
|
196
|
+
readonly default: number;
|
|
197
|
+
readonly min: 1;
|
|
198
|
+
readonly step: 1;
|
|
199
|
+
}, {
|
|
200
|
+
readonly field: "deadLoopMinRepetitions";
|
|
201
|
+
readonly type: "number";
|
|
202
|
+
readonly label: "Dead-loop cyclic repetitions";
|
|
203
|
+
readonly default: number;
|
|
204
|
+
readonly min: 1;
|
|
205
|
+
readonly step: 1;
|
|
206
|
+
}, {
|
|
207
|
+
readonly field: "deadLoopMinPatternTokens";
|
|
208
|
+
readonly type: "number";
|
|
209
|
+
readonly label: "Dead-loop min pattern tokens";
|
|
210
|
+
readonly default: number;
|
|
211
|
+
readonly min: 1;
|
|
212
|
+
readonly step: 1;
|
|
131
213
|
}];
|
|
132
214
|
readonly bypassPorts: Record<string, import("@langflower/node-sdk").WireType>;
|
|
133
215
|
readonly inputsConfigs: readonly [import("@langflower/node-sdk").InputPortMeta<import("@langflower/node-sdk").ExecutionContext<readonly [{
|
|
@@ -251,6 +333,88 @@ export declare const subAgentNode: {
|
|
|
251
333
|
readonly min: 0;
|
|
252
334
|
readonly max: 32;
|
|
253
335
|
readonly step: 1;
|
|
336
|
+
}, {
|
|
337
|
+
readonly field: "autokickOnIdle";
|
|
338
|
+
readonly type: "boolean";
|
|
339
|
+
readonly label: "Autokick on idle and dead-loop";
|
|
340
|
+
readonly default: boolean;
|
|
341
|
+
}, {
|
|
342
|
+
readonly field: "deadLoopEnabled";
|
|
343
|
+
readonly type: "boolean";
|
|
344
|
+
readonly label: "Detect repetition dead loops";
|
|
345
|
+
readonly default: boolean;
|
|
346
|
+
}, {
|
|
347
|
+
readonly field: "maxAutokickAttempts";
|
|
348
|
+
readonly type: "number";
|
|
349
|
+
readonly label: "Max autokick reconnects (0 = unlimited)";
|
|
350
|
+
readonly default: number;
|
|
351
|
+
readonly min: 0;
|
|
352
|
+
readonly max: 1000;
|
|
353
|
+
readonly step: 1;
|
|
354
|
+
}, {
|
|
355
|
+
readonly field: "autokickBackoffMs";
|
|
356
|
+
readonly type: "number";
|
|
357
|
+
readonly label: "Autokick backoff base (ms)";
|
|
358
|
+
readonly default: number;
|
|
359
|
+
readonly min: 1000;
|
|
360
|
+
readonly step: 1000;
|
|
361
|
+
}, {
|
|
362
|
+
readonly field: "autokickMaxBackoffMs";
|
|
363
|
+
readonly type: "number";
|
|
364
|
+
readonly label: "Autokick backoff clamp (ms)";
|
|
365
|
+
readonly default: number;
|
|
366
|
+
readonly min: 1000;
|
|
367
|
+
readonly step: 1000;
|
|
368
|
+
}, {
|
|
369
|
+
readonly field: "autokickUserMessage";
|
|
370
|
+
readonly type: "string";
|
|
371
|
+
readonly label: "Autokick kick message";
|
|
372
|
+
readonly default: string;
|
|
373
|
+
}, {
|
|
374
|
+
readonly field: "autokickPenaltyFrequency";
|
|
375
|
+
readonly type: "number";
|
|
376
|
+
readonly label: "Autokick frequency_penalty delta";
|
|
377
|
+
readonly default: number;
|
|
378
|
+
readonly min: -2;
|
|
379
|
+
readonly max: 2;
|
|
380
|
+
readonly step: 0.1;
|
|
381
|
+
}, {
|
|
382
|
+
readonly field: "autokickPenaltyPresence";
|
|
383
|
+
readonly type: "number";
|
|
384
|
+
readonly label: "Autokick presence_penalty delta";
|
|
385
|
+
readonly default: number;
|
|
386
|
+
readonly min: -2;
|
|
387
|
+
readonly max: 2;
|
|
388
|
+
readonly step: 0.1;
|
|
389
|
+
}, {
|
|
390
|
+
readonly field: "deadLoopMaxWindowTokens";
|
|
391
|
+
readonly type: "number";
|
|
392
|
+
readonly label: "Dead-loop window (tokens)";
|
|
393
|
+
readonly default: number;
|
|
394
|
+
readonly min: 10;
|
|
395
|
+
readonly max: 8000;
|
|
396
|
+
readonly step: 1;
|
|
397
|
+
}, {
|
|
398
|
+
readonly field: "deadLoopConsecutiveThreshold";
|
|
399
|
+
readonly type: "number";
|
|
400
|
+
readonly label: "Dead-loop consecutive identical deltas";
|
|
401
|
+
readonly default: number;
|
|
402
|
+
readonly min: 1;
|
|
403
|
+
readonly step: 1;
|
|
404
|
+
}, {
|
|
405
|
+
readonly field: "deadLoopMinRepetitions";
|
|
406
|
+
readonly type: "number";
|
|
407
|
+
readonly label: "Dead-loop cyclic repetitions";
|
|
408
|
+
readonly default: number;
|
|
409
|
+
readonly min: 1;
|
|
410
|
+
readonly step: 1;
|
|
411
|
+
}, {
|
|
412
|
+
readonly field: "deadLoopMinPatternTokens";
|
|
413
|
+
readonly type: "number";
|
|
414
|
+
readonly label: "Dead-loop min pattern tokens";
|
|
415
|
+
readonly default: number;
|
|
416
|
+
readonly min: 1;
|
|
417
|
+
readonly step: 1;
|
|
254
418
|
}], import("@langflower/node-sdk/llm").LlmExecutionCaps>>, ...import("@langflower/node-sdk").InputPortMeta<unknown>[]];
|
|
255
419
|
readonly outputsConfigs: (import("@langflower/node-sdk").OutputParams & import("@langflower/node-sdk").PortMeta)[];
|
|
256
420
|
readonly getInstance: () => import("@langflower/node-sdk").ReactiveNodeInstance<readonly [{
|
|
@@ -374,6 +538,88 @@ export declare const subAgentNode: {
|
|
|
374
538
|
readonly min: 0;
|
|
375
539
|
readonly max: 32;
|
|
376
540
|
readonly step: 1;
|
|
541
|
+
}, {
|
|
542
|
+
readonly field: "autokickOnIdle";
|
|
543
|
+
readonly type: "boolean";
|
|
544
|
+
readonly label: "Autokick on idle and dead-loop";
|
|
545
|
+
readonly default: boolean;
|
|
546
|
+
}, {
|
|
547
|
+
readonly field: "deadLoopEnabled";
|
|
548
|
+
readonly type: "boolean";
|
|
549
|
+
readonly label: "Detect repetition dead loops";
|
|
550
|
+
readonly default: boolean;
|
|
551
|
+
}, {
|
|
552
|
+
readonly field: "maxAutokickAttempts";
|
|
553
|
+
readonly type: "number";
|
|
554
|
+
readonly label: "Max autokick reconnects (0 = unlimited)";
|
|
555
|
+
readonly default: number;
|
|
556
|
+
readonly min: 0;
|
|
557
|
+
readonly max: 1000;
|
|
558
|
+
readonly step: 1;
|
|
559
|
+
}, {
|
|
560
|
+
readonly field: "autokickBackoffMs";
|
|
561
|
+
readonly type: "number";
|
|
562
|
+
readonly label: "Autokick backoff base (ms)";
|
|
563
|
+
readonly default: number;
|
|
564
|
+
readonly min: 1000;
|
|
565
|
+
readonly step: 1000;
|
|
566
|
+
}, {
|
|
567
|
+
readonly field: "autokickMaxBackoffMs";
|
|
568
|
+
readonly type: "number";
|
|
569
|
+
readonly label: "Autokick backoff clamp (ms)";
|
|
570
|
+
readonly default: number;
|
|
571
|
+
readonly min: 1000;
|
|
572
|
+
readonly step: 1000;
|
|
573
|
+
}, {
|
|
574
|
+
readonly field: "autokickUserMessage";
|
|
575
|
+
readonly type: "string";
|
|
576
|
+
readonly label: "Autokick kick message";
|
|
577
|
+
readonly default: string;
|
|
578
|
+
}, {
|
|
579
|
+
readonly field: "autokickPenaltyFrequency";
|
|
580
|
+
readonly type: "number";
|
|
581
|
+
readonly label: "Autokick frequency_penalty delta";
|
|
582
|
+
readonly default: number;
|
|
583
|
+
readonly min: -2;
|
|
584
|
+
readonly max: 2;
|
|
585
|
+
readonly step: 0.1;
|
|
586
|
+
}, {
|
|
587
|
+
readonly field: "autokickPenaltyPresence";
|
|
588
|
+
readonly type: "number";
|
|
589
|
+
readonly label: "Autokick presence_penalty delta";
|
|
590
|
+
readonly default: number;
|
|
591
|
+
readonly min: -2;
|
|
592
|
+
readonly max: 2;
|
|
593
|
+
readonly step: 0.1;
|
|
594
|
+
}, {
|
|
595
|
+
readonly field: "deadLoopMaxWindowTokens";
|
|
596
|
+
readonly type: "number";
|
|
597
|
+
readonly label: "Dead-loop window (tokens)";
|
|
598
|
+
readonly default: number;
|
|
599
|
+
readonly min: 10;
|
|
600
|
+
readonly max: 8000;
|
|
601
|
+
readonly step: 1;
|
|
602
|
+
}, {
|
|
603
|
+
readonly field: "deadLoopConsecutiveThreshold";
|
|
604
|
+
readonly type: "number";
|
|
605
|
+
readonly label: "Dead-loop consecutive identical deltas";
|
|
606
|
+
readonly default: number;
|
|
607
|
+
readonly min: 1;
|
|
608
|
+
readonly step: 1;
|
|
609
|
+
}, {
|
|
610
|
+
readonly field: "deadLoopMinRepetitions";
|
|
611
|
+
readonly type: "number";
|
|
612
|
+
readonly label: "Dead-loop cyclic repetitions";
|
|
613
|
+
readonly default: number;
|
|
614
|
+
readonly min: 1;
|
|
615
|
+
readonly step: 1;
|
|
616
|
+
}, {
|
|
617
|
+
readonly field: "deadLoopMinPatternTokens";
|
|
618
|
+
readonly type: "number";
|
|
619
|
+
readonly label: "Dead-loop min pattern tokens";
|
|
620
|
+
readonly default: number;
|
|
621
|
+
readonly min: 1;
|
|
622
|
+
readonly step: 1;
|
|
377
623
|
}], import("@langflower/node-sdk/llm").LlmExecutionCaps>;
|
|
378
624
|
readonly paletteSecondary?: true;
|
|
379
625
|
readonly description?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineLlmNode, isSteerControlPayload } from '@langflower/node-sdk/llm';
|
|
1
|
+
import { defineLlmNode, isSteerControlPayload, toLlmRecoveryPortValue, } from '@langflower/node-sdk/llm';
|
|
2
2
|
import { concat, EMPTY, filter, mergeMap, Observable, of, } from 'rxjs';
|
|
3
3
|
import { llmPanelUiSchema } from '../llm-panel-ui-schema.js';
|
|
4
4
|
import { llmCompactionUiSchema } from '../llm-compaction-ui-schema.js';
|
|
@@ -261,7 +261,7 @@ export const subAgentNode = defineLlmNode({
|
|
|
261
261
|
const toolLog$ = cycle$.pipeValue(demuxByKind('toolLog', (chunk) => chunk.text));
|
|
262
262
|
const recovery$ = cycle$.pipeValue(demuxByKind('recoveryNotice', (chunk) => {
|
|
263
263
|
const notice = chunk;
|
|
264
|
-
return
|
|
264
|
+
return toLlmRecoveryPortValue(notice);
|
|
265
265
|
}));
|
|
266
266
|
const response$ = cycle$.pipeValue(demuxByKind('response', (chunk) => chunk
|
|
267
267
|
.text));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { fakeLlmNode } from './ai/fake-llm/node.js';
|
|
2
|
-
import { openAiLlmNode } from './ai/openai-llm/node.js';
|
|
1
|
+
import { fakeLlmNode } from './ai/nodes/fake-llm/node.js';
|
|
2
|
+
import { openAiLlmNode } from './ai/nodes/openai-llm/node.js';
|
|
3
3
|
import { mcpHttpNode } from './mcp/mcp-http/node.js';
|
|
4
4
|
import { mcpStdioNode } from './mcp/mcp-stdio/node.js';
|
|
5
5
|
import { chatInputNode } from './hitl/chat-input/node.js';
|
|
6
|
-
import { reviewNode } from './ai/review/node.js';
|
|
7
|
-
import { critiqueNode } from './ai/critique/node.js';
|
|
8
|
-
import { subAgentNode } from './ai/sub-agent/node.js';
|
|
6
|
+
import { reviewNode } from './ai/nodes/review/node.js';
|
|
7
|
+
import { critiqueNode } from './ai/nodes/critique/node.js';
|
|
8
|
+
import { subAgentNode } from './ai/nodes/sub-agent/node.js';
|
|
9
9
|
import { checkpointNode } from './flow/checkpoint/node.js';
|
|
10
10
|
import { delayNode } from './flow/delay/node.js';
|
|
11
11
|
import { loopNode } from './flow/loop/node.js';
|
|
@@ -33,6 +33,8 @@ import { extractLinksNode } from './crawl/extract-links/node.js';
|
|
|
33
33
|
import { fetchUrlNode } from './crawl/fetch-url/node.js';
|
|
34
34
|
import { savePageNode } from './crawl/save-page/node.js';
|
|
35
35
|
import { memoryToolsNode } from './memory/memory-tools/node.js';
|
|
36
|
+
import { langflowerToolsNode } from './langflower-tools/node.js';
|
|
37
|
+
import { toolCollectionNode } from './tools/tool-collection/node.js';
|
|
36
38
|
const COMMON_REACTIVE_NODES = [
|
|
37
39
|
booleanNode,
|
|
38
40
|
numberNode,
|
|
@@ -64,6 +66,8 @@ const COMMON_REACTIVE_NODES = [
|
|
|
64
66
|
compareNode,
|
|
65
67
|
switchNode,
|
|
66
68
|
memoryToolsNode,
|
|
69
|
+
langflowerToolsNode,
|
|
70
|
+
toolCollectionNode,
|
|
67
71
|
fetchUrlNode,
|
|
68
72
|
extractLinksNode,
|
|
69
73
|
savePageNode,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emits `compile_custom_nodes` for agent inventory. The handler calls the
|
|
3
|
+
* server-injected compile hook (same composer as Custom → Update).
|
|
4
|
+
*/
|
|
5
|
+
export declare const compileCustomNodesNode: {
|
|
6
|
+
readonly emitOncePerActivation: boolean;
|
|
7
|
+
readonly stopsRun: boolean;
|
|
8
|
+
readonly chatEntry: boolean;
|
|
9
|
+
readonly uiSchema: readonly [];
|
|
10
|
+
readonly bypassPorts: Record<string, import("@langflower/node-sdk").WireType>;
|
|
11
|
+
readonly inputsConfigs: readonly [import("@langflower/node-sdk").InputPortMeta<import("@langflower/node-sdk").ExecutionContext<readonly [], Record<string, never>>>, ...import("@langflower/node-sdk").InputPortMeta<unknown>[]];
|
|
12
|
+
readonly outputsConfigs: (import("@langflower/node-sdk").OutputParams & import("@langflower/node-sdk").PortMeta)[];
|
|
13
|
+
readonly getInstance: () => import("@langflower/node-sdk").ReactiveNodeInstance<readonly [], Record<string, never>>;
|
|
14
|
+
readonly paletteSecondary?: true;
|
|
15
|
+
readonly description?: string;
|
|
16
|
+
readonly type: string;
|
|
17
|
+
readonly displayName: string;
|
|
18
|
+
readonly category: string | undefined;
|
|
19
|
+
readonly icon: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineToolRegistrations } from '@langflower/node-sdk';
|
|
2
|
+
import { getRunHostServices, } from '../ai/features/run-host-services.js';
|
|
3
|
+
const MISSING_HOOK_TEXT = '{ ok: false }\ncompile_custom_nodes unavailable (no server hook)';
|
|
4
|
+
const formatCompileCustomNodesResult = (result) => {
|
|
5
|
+
const lines = [`status: ${result.status}`];
|
|
6
|
+
if (result.nodeTypes.length > 0) {
|
|
7
|
+
lines.push(`nodeTypes: ${result.nodeTypes.join(', ')}`);
|
|
8
|
+
}
|
|
9
|
+
if (result.errors.length > 0) {
|
|
10
|
+
lines.push('errors:');
|
|
11
|
+
for (const error of result.errors) {
|
|
12
|
+
lines.push(`- ${error.packageName}: ${error.message}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return lines.join('\n');
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Emits `compile_custom_nodes` for agent inventory. The handler calls the
|
|
19
|
+
* server-injected compile hook (same composer as Custom → Update).
|
|
20
|
+
*/
|
|
21
|
+
export const compileCustomNodesNode = defineToolRegistrations({
|
|
22
|
+
type: 'common-compile-custom-nodes',
|
|
23
|
+
displayName: 'Compile Custom Nodes',
|
|
24
|
+
category: 'Tools',
|
|
25
|
+
description: 'Emits compile_custom_nodes so an agent can recompile project custom packs (same path as Custom → Update).',
|
|
26
|
+
tools: [
|
|
27
|
+
{
|
|
28
|
+
toolId: 'compile_custom_nodes',
|
|
29
|
+
description: 'Recompile `.langflower/nodes/` packs, hot-swap live custom instances, and refresh the Custom palette. No arguments. Pack failures also write COMPILATION_ERRORS.md.',
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {},
|
|
33
|
+
additionalProperties: false,
|
|
34
|
+
},
|
|
35
|
+
handler: async (_args, ctx) => {
|
|
36
|
+
const compile = getRunHostServices(ctx)?.compileCustomNodes;
|
|
37
|
+
if (compile === undefined) {
|
|
38
|
+
return MISSING_HOOK_TEXT;
|
|
39
|
+
}
|
|
40
|
+
return formatCompileCustomNodesResult(await compile());
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -3,7 +3,7 @@ import { createCrawlContext } from '@langflower/tools/create-crawl-context';
|
|
|
3
3
|
import { createWebFetch } from '@langflower/tools/create-web-fetch';
|
|
4
4
|
import { runBfsCrawl } from '@langflower/tools/run-bfs-crawl';
|
|
5
5
|
import { from, mergeMap, throwError } from 'rxjs';
|
|
6
|
-
import { getRunHostServices } from '../../ai/run-host-services.js';
|
|
6
|
+
import { getRunHostServices } from '../../ai/features/run-host-services.js';
|
|
7
7
|
const normalizeLimit = (value, fallback, max) => {
|
|
8
8
|
const n = Number(value);
|
|
9
9
|
if (!Number.isFinite(n) || n < 0) {
|
|
@@ -2,7 +2,7 @@ import { defineReactiveNode } from '@langflower/node-sdk';
|
|
|
2
2
|
import { createWebFetch } from '@langflower/tools/create-web-fetch';
|
|
3
3
|
import { from, map, mergeMap, throwError } from 'rxjs';
|
|
4
4
|
import { htmlToText } from '@langflower/tools/html';
|
|
5
|
-
import { getRunHostServices } from '../../ai/run-host-services.js';
|
|
5
|
+
import { getRunHostServices } from '../../ai/features/run-host-services.js';
|
|
6
6
|
/**
|
|
7
7
|
* HTTP GET a URL via server `ctx.harness.webFetch` (SSRF guards), then extract
|
|
8
8
|
* plain text from HTML.
|
|
@@ -36,10 +36,11 @@ export const repeatNode = defineReactiveNode({
|
|
|
36
36
|
return of({ kind: 'done' });
|
|
37
37
|
}
|
|
38
38
|
return trigger.value$.pipe(startWith(undefined), take(n + 1), observeOn(asapScheduler), map((_, index) => index < n
|
|
39
|
-
? { kind: 'value', value: v }
|
|
39
|
+
? { kind: 'value', value: v, index }
|
|
40
40
|
: { kind: 'done' }));
|
|
41
41
|
}));
|
|
42
42
|
const valueOut$ = session$.pipeValue(filter((e) => e.kind === 'value'), map((e) => e.value));
|
|
43
|
+
const indexOut$ = session$.pipeValue(filter((e) => e.kind === 'value'), map((e) => e.index));
|
|
43
44
|
const doneOut$ = session$.pipeValue(filter((e) => e.kind === 'done'), map(() => true));
|
|
44
45
|
return {
|
|
45
46
|
inputs: [value, count, trigger],
|
|
@@ -47,8 +48,12 @@ export const repeatNode = defineReactiveNode({
|
|
|
47
48
|
configureOutput('value', valueOut$, {
|
|
48
49
|
inferTypeFrom: value,
|
|
49
50
|
}),
|
|
51
|
+
configureOutput('index', indexOut$, {
|
|
52
|
+
wireType: 'number',
|
|
53
|
+
}),
|
|
50
54
|
configureOutput('done', doneOut$, {
|
|
51
55
|
wireType: 'boolean',
|
|
56
|
+
feed: { role: 'none' },
|
|
52
57
|
}),
|
|
53
58
|
],
|
|
54
59
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ToolHandle, type ToolHandler } from '@langflower/node-sdk';
|
|
2
|
+
import { type Observable } from 'rxjs';
|
|
3
|
+
type RegistrationTool = {
|
|
4
|
+
readonly toolId: string;
|
|
5
|
+
readonly name?: string;
|
|
6
|
+
readonly description: string;
|
|
7
|
+
readonly inputSchema: object;
|
|
8
|
+
readonly handler: ToolHandler;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Emit a `tools` pack, peeking **this** node's EC at invoke so bus RPC
|
|
12
|
+
* stays on the pack instance (not agent `toolCtx`). Local to this folder —
|
|
13
|
+
* not the author SDK factory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const emitRegistrationTools: (ctx: {
|
|
16
|
+
readonly value$: Observable<unknown>;
|
|
17
|
+
}, tools: readonly RegistrationTool[]) => import("@rx-evo/stateful-observable").StatefulObservable<ToolHandle[], unknown, undefined>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { statefulObservable } from '@rx-evo/stateful-observable';
|
|
2
|
+
import { of } from 'rxjs';
|
|
3
|
+
const peekNodeContext = (source) => {
|
|
4
|
+
let peeked;
|
|
5
|
+
const sub = source.value$.subscribe((value) => {
|
|
6
|
+
peeked = value;
|
|
7
|
+
});
|
|
8
|
+
sub.unsubscribe();
|
|
9
|
+
return typeof peeked === 'object' && peeked !== null
|
|
10
|
+
? peeked
|
|
11
|
+
: undefined;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Emit a `tools` pack, peeking **this** node's EC at invoke so bus RPC
|
|
15
|
+
* stays on the pack instance (not agent `toolCtx`). Local to this folder —
|
|
16
|
+
* not the author SDK factory.
|
|
17
|
+
*/
|
|
18
|
+
export const emitRegistrationTools = (ctx, tools) => statefulObservable({
|
|
19
|
+
loader: () => of(tools.map((tool) => ({
|
|
20
|
+
toolId: tool.toolId,
|
|
21
|
+
name: tool.name ?? tool.toolId,
|
|
22
|
+
description: tool.description,
|
|
23
|
+
inputSchema: tool.inputSchema,
|
|
24
|
+
invoke: (args, agentCtx) => {
|
|
25
|
+
const nodeCtx = peekNodeContext(ctx);
|
|
26
|
+
return tool.handler(args, nodeCtx ?? agentCtx);
|
|
27
|
+
},
|
|
28
|
+
}))),
|
|
29
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emits Langflower bus tools for agent inventory. Recompile is unsafe:
|
|
3
|
+
* wire this node’s `tools` into the agent (starter Helper / Writer).
|
|
4
|
+
*/
|
|
5
|
+
export declare const langflowerToolsNode: {
|
|
6
|
+
readonly emitOncePerActivation: boolean;
|
|
7
|
+
readonly stopsRun: boolean;
|
|
8
|
+
readonly chatEntry: boolean;
|
|
9
|
+
readonly uiSchema: readonly [];
|
|
10
|
+
readonly bypassPorts: Record<string, import("@langflower/node-sdk").WireType>;
|
|
11
|
+
readonly inputsConfigs: readonly [import("@langflower/node-sdk").InputPortMeta<import("@langflower/node-sdk").ExecutionContext<readonly [], Record<string, never>>>, ...import("@langflower/node-sdk").InputPortMeta<unknown>[]];
|
|
12
|
+
readonly outputsConfigs: (import("@langflower/node-sdk").OutputParams & import("@langflower/node-sdk").PortMeta)[];
|
|
13
|
+
readonly getInstance: () => import("@langflower/node-sdk").ReactiveNodeInstance<readonly [], Record<string, never>>;
|
|
14
|
+
readonly paletteSecondary?: true;
|
|
15
|
+
readonly description?: string;
|
|
16
|
+
readonly type: string;
|
|
17
|
+
readonly displayName: string;
|
|
18
|
+
readonly category: string | undefined;
|
|
19
|
+
readonly icon: string | undefined;
|
|
20
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineReactiveNode, TOOL_HANDLE_WIRE_TYPE, } from '@langflower/node-sdk';
|
|
2
|
+
import { getRunHostServices } from '../ai/features/run-host-services.js';
|
|
3
|
+
import { emitRegistrationTools } from './emit-registration-tools.js';
|
|
4
|
+
const MISSING_RPC_TEXT = '{ ok: false }\ncompile_custom_nodes unavailable (no bus RPC)';
|
|
5
|
+
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
6
|
+
/** Format `customPalette.snapshot` (RPC wait skips `compiling`). */
|
|
7
|
+
const formatPaletteSnapshot = (value) => {
|
|
8
|
+
if (!isRecord(value)) {
|
|
9
|
+
return `{ ok: false }\nUnexpected compile result`;
|
|
10
|
+
}
|
|
11
|
+
const status = typeof value.status === 'string' ? value.status : 'error';
|
|
12
|
+
const lines = [`status: ${status}`];
|
|
13
|
+
const nodes = Array.isArray(value.nodes) ? value.nodes : [];
|
|
14
|
+
const nodeTypes = nodes.flatMap((node) => isRecord(node) && typeof node.type === 'string' ? [node.type] : []);
|
|
15
|
+
if (nodeTypes.length > 0) {
|
|
16
|
+
lines.push(`nodeTypes: ${nodeTypes.join(', ')}`);
|
|
17
|
+
}
|
|
18
|
+
const errors = Array.isArray(value.errors) ? value.errors : [];
|
|
19
|
+
if (errors.length > 0) {
|
|
20
|
+
lines.push('errors:');
|
|
21
|
+
for (const error of errors) {
|
|
22
|
+
if (!isRecord(error)) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const pack = typeof error.packageName === 'string'
|
|
26
|
+
? error.packageName
|
|
27
|
+
: 'unknown';
|
|
28
|
+
const message = typeof error.message === 'string' ? error.message : '';
|
|
29
|
+
lines.push(`- ${pack}: ${message}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return lines.join('\n');
|
|
33
|
+
};
|
|
34
|
+
const LANGFLOWER_BUS_TOOL_CONFIGS = [
|
|
35
|
+
{
|
|
36
|
+
toolId: 'compile_custom_nodes',
|
|
37
|
+
description: 'Recompile `.langflower/nodes/` packs, hot-swap live custom instances, and refresh the Custom palette (same intent as Custom → Update). No arguments. Pack failures also write COMPILATION_ERRORS.md.',
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {},
|
|
41
|
+
additionalProperties: false,
|
|
42
|
+
},
|
|
43
|
+
handler: (async (_args, ctx) => {
|
|
44
|
+
const request = getRunHostServices(ctx)?.requestLangflowerBus;
|
|
45
|
+
if (request === undefined) {
|
|
46
|
+
return MISSING_RPC_TEXT;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const snapshot = await request('customPalette.update.requested', {});
|
|
50
|
+
return formatPaletteSnapshot(snapshot);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
54
|
+
return `{ ok: false }\n${message}`;
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
/**
|
|
60
|
+
* Emits Langflower bus tools for agent inventory. Recompile is unsafe:
|
|
61
|
+
* wire this node’s `tools` into the agent (starter Helper / Writer).
|
|
62
|
+
*/
|
|
63
|
+
export const langflowerToolsNode = defineReactiveNode({
|
|
64
|
+
type: 'common-langflower-tools',
|
|
65
|
+
displayName: 'Langflower Tools',
|
|
66
|
+
category: 'Tools',
|
|
67
|
+
description: 'Emits compile_custom_nodes (Custom → Update over the bus). Wire tools to opt in; later bus actions may be added to this pack.',
|
|
68
|
+
uiSchema: [],
|
|
69
|
+
bind(ctx, { configureOutput }) {
|
|
70
|
+
return {
|
|
71
|
+
inputs: [],
|
|
72
|
+
outputs: [
|
|
73
|
+
configureOutput('tools', emitRegistrationTools(ctx, LANGFLOWER_BUS_TOOL_CONFIGS), { wireType: TOOL_HANDLE_WIRE_TYPE }),
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Owns HTTP MCP connect/close (optional local launch); emits live
|
|
3
|
-
*
|
|
4
|
-
* tools/list.
|
|
5
|
-
* silent EMPTY).
|
|
2
|
+
* Owns HTTP MCP connect/close (optional local launch); emits live
|
|
3
|
+
* {@link ToolHandle}[] for LLM `tools`. Server name and tools come from MCP
|
|
4
|
+
* initialize / tools/list. Session stays in invoke closures.
|
|
5
|
+
* Connect/initialize/build failure → output port **error** (not silent EMPTY).
|
|
6
6
|
*/
|
|
7
7
|
export declare const mcpHttpNode: {
|
|
8
8
|
readonly emitOncePerActivation: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { defineReactiveNode } from '@langflower/node-sdk';
|
|
2
|
-
import { MCP_HANDLE_WIRE_TYPE } from '@langflower/node-sdk/mcp';
|
|
1
|
+
import { defineReactiveNode, TOOL_HANDLE_WIRE_TYPE, } from '@langflower/node-sdk';
|
|
3
2
|
import { buildMcpHandle } from '@langflower/tools/build-mcp-handle';
|
|
4
3
|
import { formatMcpConnectError } from '@langflower/tools/format-mcp-connect-error';
|
|
5
4
|
import { connectMcpHttpWithOptionalLaunch } from '@langflower/tools/mcp-http-client';
|
|
@@ -11,16 +10,16 @@ const paramsKey = (params) => JSON.stringify({
|
|
|
11
10
|
command: params.command,
|
|
12
11
|
});
|
|
13
12
|
/**
|
|
14
|
-
* Owns HTTP MCP connect/close (optional local launch); emits live
|
|
15
|
-
*
|
|
16
|
-
* tools/list.
|
|
17
|
-
* silent EMPTY).
|
|
13
|
+
* Owns HTTP MCP connect/close (optional local launch); emits live
|
|
14
|
+
* {@link ToolHandle}[] for LLM `tools`. Server name and tools come from MCP
|
|
15
|
+
* initialize / tools/list. Session stays in invoke closures.
|
|
16
|
+
* Connect/initialize/build failure → output port **error** (not silent EMPTY).
|
|
18
17
|
*/
|
|
19
18
|
export const mcpHttpNode = defineReactiveNode({
|
|
20
19
|
type: 'common-mcp-http',
|
|
21
20
|
displayName: 'MCP http',
|
|
22
21
|
category: 'Tools',
|
|
23
|
-
description: 'Connects to an MCP server over Streamable HTTP. Optional shell command launches a local process first; URL alone targets an already-running server.',
|
|
22
|
+
description: 'Connects to an MCP server over Streamable HTTP and emits its tools for LLM `tools` ports. Optional shell command launches a local process first; URL alone targets an already-running server.',
|
|
24
23
|
uiSchema: [],
|
|
25
24
|
bind(ctx, { makeInput, configureOutput, combineInputs }) {
|
|
26
25
|
const url = makeInput('url', {
|
|
@@ -82,7 +81,7 @@ export const mcpHttpNode = defineReactiveNode({
|
|
|
82
81
|
await session.close();
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
|
-
subscriber.next(handle);
|
|
84
|
+
subscriber.next(handle.tools);
|
|
86
85
|
};
|
|
87
86
|
void run().catch(fail);
|
|
88
87
|
return () => {
|
|
@@ -94,8 +93,8 @@ export const mcpHttpNode = defineReactiveNode({
|
|
|
94
93
|
return {
|
|
95
94
|
inputs: [url, command],
|
|
96
95
|
outputs: [
|
|
97
|
-
configureOutput('
|
|
98
|
-
wireType:
|
|
96
|
+
configureOutput('tools', handle$, {
|
|
97
|
+
wireType: TOOL_HANDLE_WIRE_TYPE,
|
|
99
98
|
}),
|
|
100
99
|
],
|
|
101
100
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Owns stdio MCP connect/close; emits live {@link
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* silent EMPTY).
|
|
2
|
+
* Owns stdio MCP connect/close; emits live {@link ToolHandle}[] for LLM `tools`.
|
|
3
|
+
* Server name and tools come from MCP initialize / tools/list. Session stays
|
|
4
|
+
* in invoke closures. Connect/initialize/build failure → output port **error**
|
|
5
|
+
* (not silent EMPTY).
|
|
6
6
|
*/
|
|
7
7
|
export declare const mcpStdioNode: {
|
|
8
8
|
readonly emitOncePerActivation: boolean;
|