langflower 0.0.9 → 0.1.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/README.md +96 -70
- package/docs/public/README.md +2 -2
- package/docs/public/configuration.md +4 -0
- package/docs/public/extending.md +18 -2
- package/docs/public/getting-started.md +7 -0
- package/docs/public/how-it-works.md +18 -11
- package/docs/public/product.md +35 -25
- package/package.json +2 -2
- package/ui-dist/chunk-QI4IYILJ.js +4 -0
- package/ui-dist/{chunk-7UMVYN3A.js → chunk-UG3GFV4Y.js} +1 -1
- package/ui-dist/index.html +2 -2
- package/ui-dist/main-ODIDCCNX.js +315 -0
- package/ui-dist/styles-2JMBAQC3.css +1 -0
- package/vendor/common-nodes/dist/ai/features/llm-loop/llm-loop-reducer.js +0 -12
- package/vendor/common-nodes/dist/ai/features/llm-loop/llm-loop-types.d.ts +2 -7
- package/vendor/common-nodes/dist/ai/features/llm-loop/llm-loop-types.js +1 -1
- package/vendor/common-nodes/dist/ai/features/llm-loop/run-agent-loop.d.ts +0 -3
- package/vendor/common-nodes/dist/ai/features/llm-loop/run-agent-loop.js +22 -36
- package/vendor/common-nodes/dist/ai/features/llm-loop/run-llm-loop.d.ts +1 -7
- package/vendor/common-nodes/dist/ai/features/llm-loop/run-llm-loop.js +12 -35
- package/vendor/common-nodes/dist/ai/features/llm-session/llm-session-shell.d.ts +5 -12
- package/vendor/common-nodes/dist/ai/features/llm-session/llm-session-shell.js +48 -21
- package/vendor/common-nodes/dist/ai/features/llm-session/run-session-machine.d.ts +11 -0
- package/vendor/common-nodes/dist/ai/features/llm-session/run-session-machine.js +2 -2
- package/vendor/common-nodes/dist/ai/features/path-choice/run-reactive-path-choice-loop.d.ts +0 -3
- package/vendor/common-nodes/dist/ai/features/path-choice/run-reactive-path-choice-loop.js +2 -15
- package/vendor/common-nodes/dist/ai/features/run-host-services.d.ts +10 -0
- package/vendor/common-nodes/dist/ai/features/sub-agent-protocol.d.ts +1 -0
- package/vendor/common-nodes/dist/ai/features/sub-agent-protocol.js +1 -0
- package/vendor/common-nodes/dist/ai/features/ui-schema/llm-recovery-ui-schema.d.ts +1 -1
- package/vendor/common-nodes/dist/ai/features/ui-schema/llm-recovery-ui-schema.js +1 -1
- package/vendor/common-nodes/dist/ai/features/wait-for-subagent-result.d.ts +1 -0
- package/vendor/common-nodes/dist/ai/features/wait-for-subagent-result.js +1 -0
- package/vendor/common-nodes/dist/ai/nodes/critique/node.d.ts +3 -3
- package/vendor/common-nodes/dist/ai/nodes/critique/node.js +10 -19
- package/vendor/common-nodes/dist/ai/nodes/fake-llm/node.d.ts +3 -3
- package/vendor/common-nodes/dist/ai/nodes/fake-llm/node.js +10 -11
- package/vendor/common-nodes/dist/ai/nodes/openai-llm/node.d.ts +3 -3
- package/vendor/common-nodes/dist/ai/nodes/openai-llm/node.js +7 -10
- package/vendor/common-nodes/dist/ai/nodes/review/node.d.ts +3 -3
- package/vendor/common-nodes/dist/ai/nodes/review/node.js +12 -19
- package/vendor/common-nodes/dist/ai/nodes/sub-agent/node.d.ts +5 -5
- package/vendor/common-nodes/dist/ai/nodes/sub-agent/node.js +251 -96
- package/vendor/common-nodes/dist/catalog.js +12 -0
- package/vendor/common-nodes/dist/crawl/crawl/node.js +11 -3
- package/vendor/common-nodes/dist/crawl/crawl-tools/node.js +5 -1
- package/vendor/common-nodes/dist/crawl/extract-links/node.js +7 -1
- package/vendor/common-nodes/dist/crawl/fetch-url/node.js +13 -4
- package/vendor/common-nodes/dist/crawl/save-page/node.js +11 -3
- package/vendor/common-nodes/dist/embeddings/create-embedding.d.ts +39 -0
- package/vendor/common-nodes/dist/embeddings/create-embedding.js +154 -0
- package/vendor/common-nodes/dist/embeddings/embed-provider/node.d.ts +53 -0
- package/vendor/common-nodes/dist/embeddings/embed-provider/node.js +126 -0
- package/vendor/common-nodes/dist/embeddings/embed-similarity/node.d.ts +20 -0
- package/vendor/common-nodes/dist/embeddings/embed-similarity/node.js +81 -0
- package/vendor/common-nodes/dist/embeddings/embed-text/node.d.ts +53 -0
- package/vendor/common-nodes/dist/embeddings/embed-text/node.js +91 -0
- package/vendor/common-nodes/dist/embeddings/from-embedding.d.ts +8 -0
- package/vendor/common-nodes/dist/embeddings/from-embedding.js +24 -0
- package/vendor/common-nodes/dist/embeddings/resolve-embedding-provider-model.d.ts +11 -0
- package/vendor/common-nodes/dist/embeddings/resolve-embedding-provider-model.js +8 -0
- package/vendor/common-nodes/dist/flow/checkpoint/node.js +7 -3
- package/vendor/common-nodes/dist/flow/delay/node.d.ts +2 -6
- package/vendor/common-nodes/dist/flow/delay/node.js +13 -9
- package/vendor/common-nodes/dist/flow/loop/node.js +7 -1
- package/vendor/common-nodes/dist/flow/merge/node.js +7 -1
- package/vendor/common-nodes/dist/flow/repeat/node.js +5 -1
- package/vendor/common-nodes/dist/flow/router/node.js +7 -1
- package/vendor/common-nodes/dist/hitl/chat-input/node.d.ts +2 -2
- package/vendor/common-nodes/dist/hitl/chat-input/node.js +8 -4
- package/vendor/common-nodes/dist/hitl/review-gate/node.js +11 -5
- package/vendor/common-nodes/dist/langflower-tools/node.js +5 -1
- package/vendor/common-nodes/dist/logic/assert/node.js +7 -1
- package/vendor/common-nodes/dist/logic/compare/node.js +7 -1
- package/vendor/common-nodes/dist/logic/gate/node.js +7 -1
- package/vendor/common-nodes/dist/logic/if/node.js +7 -1
- package/vendor/common-nodes/dist/logic/switch/node.js +7 -1
- package/vendor/common-nodes/dist/mcp/mcp-http/node.d.ts +4 -4
- package/vendor/common-nodes/dist/mcp/mcp-http/node.js +61 -60
- package/vendor/common-nodes/dist/mcp/mcp-stdio/node.d.ts +4 -4
- package/vendor/common-nodes/dist/mcp/mcp-stdio/node.js +58 -57
- package/vendor/common-nodes/dist/memory/memory-tools/node.js +5 -1
- package/vendor/common-nodes/dist/output/finish/node.js +13 -1
- package/vendor/common-nodes/dist/output/preview/node.js +9 -2
- package/vendor/common-nodes/dist/primitives/boolean/node.js +7 -1
- package/vendor/common-nodes/dist/primitives/number/node.js +7 -1
- package/vendor/common-nodes/dist/primitives/string/node.js +7 -1
- package/vendor/common-nodes/dist/primitives/string-multiline/node.d.ts +17 -0
- package/vendor/common-nodes/dist/primitives/string-multiline/node.js +31 -0
- package/vendor/common-nodes/dist/text/append-file/node.js +11 -3
- package/vendor/common-nodes/dist/text/concat/node.js +5 -1
- package/vendor/common-nodes/dist/text/read-file/node.js +9 -3
- package/vendor/common-nodes/dist/text/split-paced/node.d.ts +21 -0
- package/vendor/common-nodes/dist/text/split-paced/node.js +93 -0
- package/vendor/common-nodes/dist/text/write-file/node.js +11 -3
- 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 +0 -10
- 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 +45 -0
- package/vendor/common-nodes/package.json +5 -5
- package/vendor/compiler/package.json +1 -1
- package/vendor/node-sdk/dist/node-factory/define-embed/embed-handle.d.ts +25 -0
- package/vendor/node-sdk/dist/node-factory/define-embed/embed-handle.js +25 -0
- 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 +3 -5
- package/vendor/node-sdk/dist/node-factory/define-llm-node/define-llm-node.js +3 -5
- 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-mcp/mcp-handle.d.ts +4 -4
- package/vendor/node-sdk/dist/node-factory/define-mcp/mcp-handle.js +2 -1
- package/vendor/node-sdk/dist/node-factory/define-node/define-node.d.ts +2 -0
- package/vendor/node-sdk/dist/node-factory/define-node/define-node.js +4 -1
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/define-reactive-node.d.ts +3 -1
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/define-reactive-node.js +2 -1
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/io-helpers.d.ts +15 -0
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/io-helpers.js +17 -1
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/port-meta.d.ts +17 -4
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/test/samples/delay-node.js +4 -2
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/types.d.ts +6 -7
- package/vendor/node-sdk/dist/node-factory/define-reactive-node/ui-schema-inference.d.ts +1 -1
- package/vendor/node-sdk/dist/testing/create-node-harness.d.ts +30 -0
- package/vendor/node-sdk/dist/testing/create-node-harness.js +68 -0
- package/vendor/node-sdk/package.json +5 -5
- 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-runner.d.ts +8 -3
- package/vendor/runtime/dist/runtime-runner.js +102 -81
- package/vendor/runtime/dist/runtime.d.ts +3 -2
- package/vendor/runtime/dist/runtime.js +1 -1
- package/vendor/runtime/dist/testing/workflows/workflow-events.d.ts +2 -0
- package/vendor/runtime/dist/testing/workflows/workflow-events.js +7 -5
- package/vendor/runtime/dist/types.d.ts +26 -9
- package/vendor/runtime/dist/types.js +3 -0
- package/vendor/runtime/package.json +1 -1
- package/vendor/server/dist/bootstrap/project-bootstrap.service.d.ts +1 -1
- package/vendor/server/dist/bootstrap/seed-skeleton.d.ts +2 -2
- package/vendor/server/dist/bootstrap/seed-skeleton.js +17 -2
- package/vendor/server/dist/bridge/bind-embed-context.d.ts +7 -0
- package/vendor/server/dist/bridge/bind-embed-context.js +16 -0
- package/vendor/server/dist/bridge/build-execution-context.d.ts +2 -2
- package/vendor/server/dist/bridge/build-execution-context.js +8 -4
- package/vendor/server/dist/bridge/emit-bootstrap.js +4 -1
- package/vendor/server/dist/bridge/get-live-wired-tools.d.ts +3 -2
- package/vendor/server/dist/bridge/get-live-wired-tools.js +8 -5
- package/vendor/server/dist/bridge/settings-draft-controller.js +7 -3
- package/vendor/server/dist/bridge/wire-config-handlers.js +2 -0
- package/vendor/server/dist/bridge/wire-editor-handlers.js +14 -0
- package/vendor/server/dist/bridge/wire-runner-handlers.js +2 -2
- package/vendor/server/dist/bridge/wire-workflow-handlers.js +23 -9
- package/vendor/server/dist/checkpoint/run-checkpoint-session.js +3 -3
- package/vendor/server/dist/config/langflower-config.service.d.ts +2 -0
- package/vendor/server/dist/config/langflower-config.service.js +30 -0
- package/vendor/server/dist/session/build-session-bootstrap.js +1 -0
- package/vendor/server/dist/session/langflower-session.d.ts +3 -1
- package/vendor/server/dist/session/langflower-session.js +3 -1
- 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.js +6 -0
- package/vendor/server/dist/workflow/workflow-persisted-inputs.js +8 -6
- package/vendor/server/skeleton/instructions.md +15 -3
- package/vendor/server/skeleton/nodes/hello-embed/README.md +185 -0
- package/vendor/server/skeleton/nodes/hello-embed/hello-embed.nodes.test.ts +181 -0
- package/vendor/server/skeleton/nodes/hello-embed/ingest.ts +126 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/chunk-markdown.test.ts +40 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/chunk-markdown.ts +123 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/ingest-search.test.ts +180 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/ingest.ts +128 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/paths.test.ts +20 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/paths.ts +70 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/schema.ts +21 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/search.ts +254 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/text-embedder.ts +14 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/vectors.ts +126 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/walk-markdown.test.ts +62 -0
- package/vendor/server/skeleton/nodes/hello-embed/lib/walk-markdown.ts +67 -0
- package/vendor/server/skeleton/nodes/hello-embed/package.json +11 -0
- package/vendor/server/skeleton/nodes/hello-embed/search-handle.ts +119 -0
- package/vendor/server/skeleton/nodes/hello-embed/search.ts +98 -0
- package/vendor/server/skeleton/nodes/hello-embed/tsconfig.json +14 -0
- package/vendor/server/skeleton/nodes/my-nodes/README.md +13 -3
- package/vendor/server/skeleton/nodes/my-nodes/package.json +1 -1
- package/vendor/server/skeleton/schemas/langflower-config.schema.json +4 -0
- package/vendor/server/skeleton/skills/langflower-helper/SKILL.md +125 -38
- package/vendor/server/skeleton/skills/langflower-helper/architecture.md +17 -6
- package/vendor/server/skeleton/skills/langflower-helper/layout.md +24 -17
- package/vendor/server/skeleton/skills/langflower-node-writer/SKILL.md +8 -1
- package/vendor/server/skeleton/skills/langflower-workflow-writer/SKILL.md +12 -8
- package/vendor/server/skeleton/workflows/kb-create.json +15 -43
- package/vendor/server/skeleton/workflows/kb-ingest.json +88 -0
- package/vendor/server/skeleton/workflows/kb-manual-search.json +105 -0
- package/vendor/server/skeleton/workflows/kb-navigate.json +8 -22
- package/vendor/server/skeleton/workflows/kb-rag.json +192 -0
- package/vendor/server/skeleton/workflows/kb-tool.json +111 -0
- package/vendor/server/skeleton/workflows/simple-coder.json +18 -46
- package/vendor/server/skeleton/workflows/starter.json +8 -22
- package/vendor/shared/dist/execution/derive-run-settle-outcome.js +2 -2
- package/vendor/shared/dist/execution/derive-run-settle-outcome.test.js +11 -8
- package/vendor/shared/dist/langflower-bus-config.d.ts +22 -6
- package/vendor/shared/dist/langflower-bus-config.js +23 -7
- package/vendor/shared/dist/langflower-config/merge-langflower-config-layers.test.js +8 -0
- package/vendor/shared/dist/langflower-config/settings-draft.d.ts +5 -0
- package/vendor/shared/dist/langflower-config/settings-draft.js +15 -7
- package/vendor/shared/dist/langflower-ws-waits.d.ts +3 -1
- package/vendor/shared/dist/langflower-ws-waits.js +2 -2
- package/vendor/shared/dist/langflower.d.ts +1 -1
- package/vendor/shared/dist/langflower.js +1 -1
- package/vendor/shared/dist/types/langflower-bootstrap.d.ts +6 -0
- package/vendor/shared/dist/types/langflower-config.d.ts +17 -0
- package/vendor/shared/dist/types/langflower-palette.d.ts +2 -1
- package/vendor/tools/dist/harness-types.d.ts +1 -1
- package/vendor/tools/dist/mcp/build-mcp-handle.d.ts +3 -21
- package/vendor/tools/dist/mcp/build-mcp-handle.js +2 -11
- package/vendor/tools/dist/mcp/create-system-mcp-handles.d.ts +9 -6
- package/vendor/tools/dist/mcp/create-system-mcp-handles.js +21 -17
- package/vendor/tools/package.json +1 -0
- package/ui-dist/chunk-MDGXX73Z.js +0 -4
- package/ui-dist/main-2JJGCNTD.js +0 -313
- package/ui-dist/styles-EOXODOI7.css +0 -1
|
@@ -93,6 +93,11 @@ export type LangflowerConfig = {
|
|
|
93
93
|
*/
|
|
94
94
|
readonly currentWorkflowId?: string;
|
|
95
95
|
readonly model?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Default embedding identity `"providerId/modelId"`, distinct from chat
|
|
98
|
+
* {@link LangflowerConfig.model}.
|
|
99
|
+
*/
|
|
100
|
+
readonly embedding?: string;
|
|
96
101
|
readonly provider?: Readonly<Record<string, LangflowerProviderConfig>>;
|
|
97
102
|
/** Tools available to `optionsSource: 'langflower.tools'` uiSchema fields. */
|
|
98
103
|
readonly tools?: readonly LangflowerToolConfig[];
|
|
@@ -103,6 +108,11 @@ export type LangflowerConfig = {
|
|
|
103
108
|
readonly skills?: readonly LangflowerSkillConfig[];
|
|
104
109
|
/** Editor divider positions (sidebar + composer sizes). */
|
|
105
110
|
readonly dividerPositions?: DividerPositions;
|
|
111
|
+
/**
|
|
112
|
+
* Left node palette shown. Project jsonc only (same class as
|
|
113
|
+
* {@link LangflowerConfig.dividerPositions}). Omit = visible.
|
|
114
|
+
*/
|
|
115
|
+
readonly paletteVisible?: boolean;
|
|
106
116
|
/**
|
|
107
117
|
* Runtime allow/ask/deny for harness tools (≠ author-time `enabledToolIds`).
|
|
108
118
|
*/
|
|
@@ -134,6 +144,11 @@ export type LangflowerConfigScope = 'project' | 'global';
|
|
|
134
144
|
export type LangflowerConfigSaveRequestedPayload = {
|
|
135
145
|
readonly scope: LangflowerConfigScope;
|
|
136
146
|
readonly model?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Default embedding identity `"providerId/modelId"`. Empty string clears
|
|
149
|
+
* the layer key (same as `model`). Omitted leaves the existing value.
|
|
150
|
+
*/
|
|
151
|
+
readonly embedding?: string;
|
|
137
152
|
readonly provider?: Readonly<Record<string, LangflowerProviderConfig>>;
|
|
138
153
|
readonly providerApiKeys?: Readonly<Record<string, string>>;
|
|
139
154
|
/**
|
|
@@ -211,6 +226,8 @@ export type ProviderConnectionStatus = {
|
|
|
211
226
|
export type LangflowerConfigDraft = {
|
|
212
227
|
readonly defaultProviderId: string;
|
|
213
228
|
readonly defaultModelId: string;
|
|
229
|
+
readonly defaultEmbeddingProviderId: string;
|
|
230
|
+
readonly defaultEmbeddingModelId: string;
|
|
214
231
|
readonly providers: readonly {
|
|
215
232
|
readonly id: string;
|
|
216
233
|
readonly name: string;
|
|
@@ -6,7 +6,8 @@ export type PaletteNodeSource = 'system' | 'custom';
|
|
|
6
6
|
* node factory, plus wire-only {@link PaletteNodeSource}.
|
|
7
7
|
*
|
|
8
8
|
* Port metadata lives in `inputsConfigs` / `outputsConfigs` (`config` fields).
|
|
9
|
-
* Optional `description` is markdown for the palette detail popover footer
|
|
9
|
+
* Optional `description` is markdown for the palette detail popover footer
|
|
10
|
+
* and the inspector header.
|
|
10
11
|
*/
|
|
11
12
|
export type PaletteNodeDefinition = Omit<ReactiveNodeDefinition, 'getInstance'> & {
|
|
12
13
|
readonly source: PaletteNodeSource;
|
|
@@ -23,7 +23,7 @@ export type BuiltinToolRegistration = {
|
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* Project harness surface (builtins + optional webFetch).
|
|
26
|
-
* MCP tools are not on the harness — agents consume wired `
|
|
26
|
+
* MCP tools are not on the harness — agents consume wired `ToolHandle[]`.
|
|
27
27
|
*/
|
|
28
28
|
export type Harness = {
|
|
29
29
|
readonly invoke: (call: ToolInvokeCall) => Promise<ToolInvokeResult>;
|
|
@@ -1,30 +1,12 @@
|
|
|
1
|
+
import type { ToolHandle } from '@langflower/node-sdk';
|
|
1
2
|
import type { McpClient } from './mcp-client-types.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
* `@langflower/node-sdk`). Assignable at call sites that expect the
|
|
5
|
-
* author-facing handle.
|
|
6
|
-
*/
|
|
7
|
-
export type BuiltMcpToolHandle = {
|
|
8
|
-
readonly toolId: string;
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly description: string;
|
|
11
|
-
readonly inputSchema: object;
|
|
12
|
-
readonly invoke: (args: Readonly<Record<string, unknown>>) => Promise<string>;
|
|
13
|
-
};
|
|
14
|
-
/** Structural twin of node-sdk `McpHandle`. */
|
|
15
|
-
export type BuiltMcpHandle = {
|
|
16
|
-
readonly id: string;
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly tools: readonly BuiltMcpToolHandle[];
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* After connect: list tools once and build a live MCP handle with eager tools.
|
|
4
|
+
* After connect: list tools once and bind invoke closures.
|
|
22
5
|
* Optional `toolNamesRaw` filters for system MCP jsonc; canvas nodes omit it
|
|
23
6
|
* and expose the full `tools/list` inventory. Tool ids use `client.serverName`
|
|
24
7
|
* (`<mcp_name>__<tool>`).
|
|
25
8
|
*/
|
|
26
9
|
export declare const buildMcpHandle: (options: {
|
|
27
|
-
readonly id: string;
|
|
28
10
|
readonly toolNamesRaw?: unknown;
|
|
29
11
|
readonly client: McpClient;
|
|
30
|
-
}) => Promise<
|
|
12
|
+
}) => Promise<readonly ToolHandle[]>;
|
|
@@ -9,17 +9,13 @@ const parseToolNames = (raw) => {
|
|
|
9
9
|
.filter((name) => name.length > 0);
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* After connect: list tools once and
|
|
12
|
+
* After connect: list tools once and bind invoke closures.
|
|
13
13
|
* Optional `toolNamesRaw` filters for system MCP jsonc; canvas nodes omit it
|
|
14
14
|
* and expose the full `tools/list` inventory. Tool ids use `client.serverName`
|
|
15
15
|
* (`<mcp_name>__<tool>`).
|
|
16
16
|
*/
|
|
17
17
|
export const buildMcpHandle = async (options) => {
|
|
18
|
-
const id = options.id.trim();
|
|
19
18
|
const mcpName = options.client.serverName.trim();
|
|
20
|
-
if (id.length === 0) {
|
|
21
|
-
throw new Error('MCP handle id is empty.');
|
|
22
|
-
}
|
|
23
19
|
if (mcpName.length === 0) {
|
|
24
20
|
throw new Error('MCP client.serverName is empty.');
|
|
25
21
|
}
|
|
@@ -30,7 +26,7 @@ export const buildMcpHandle = async (options) => {
|
|
|
30
26
|
: new Set(toolNames
|
|
31
27
|
.map((toolName) => encodeMcpToolId(mcpName, toolName))
|
|
32
28
|
.filter((toolId) => toolId.length > 0));
|
|
33
|
-
|
|
29
|
+
return listed.flatMap((tool) => {
|
|
34
30
|
const toolId = encodeMcpToolId(mcpName, tool.name);
|
|
35
31
|
if (toolId.length === 0) {
|
|
36
32
|
return [];
|
|
@@ -57,9 +53,4 @@ export const buildMcpHandle = async (options) => {
|
|
|
57
53
|
},
|
|
58
54
|
];
|
|
59
55
|
});
|
|
60
|
-
return {
|
|
61
|
-
id,
|
|
62
|
-
name: mcpName,
|
|
63
|
-
tools,
|
|
64
|
-
};
|
|
65
56
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ToolHandle } from '@langflower/node-sdk';
|
|
2
2
|
/**
|
|
3
3
|
* Structural twin of shared `LangflowerMcp*ServerConfig` (tools cannot import
|
|
4
4
|
* `@langflower/shared`). Keep fields in sync with CONFIG / MCP nodes.
|
|
@@ -21,8 +21,13 @@ export type SystemMcpConnectFailure = {
|
|
|
21
21
|
readonly serverId: string;
|
|
22
22
|
readonly message: string;
|
|
23
23
|
};
|
|
24
|
+
/** Jsonc server key plus bound tools — not an author SDK type. */
|
|
25
|
+
export type SystemMcpServerTools = {
|
|
26
|
+
readonly serverId: string;
|
|
27
|
+
readonly tools: readonly ToolHandle[];
|
|
28
|
+
};
|
|
24
29
|
export type SystemMcpHandles = {
|
|
25
|
-
readonly handles: readonly
|
|
30
|
+
readonly handles: readonly SystemMcpServerTools[];
|
|
26
31
|
readonly failures: readonly SystemMcpConnectFailure[];
|
|
27
32
|
readonly close: () => Promise<void>;
|
|
28
33
|
};
|
|
@@ -41,9 +46,7 @@ export declare const parseEnabledMcpIds: (value: unknown) => readonly string[];
|
|
|
41
46
|
export declare const collectEnabledMcpIdsFromNodes: (nodes: ReadonlyArray<{
|
|
42
47
|
readonly params: Readonly<Record<string, unknown>>;
|
|
43
48
|
}>) => readonly string[];
|
|
44
|
-
/** Ready
|
|
45
|
-
export declare const
|
|
46
|
-
readonly id: string;
|
|
47
|
-
}>(handles: readonly T[], enabledMcpIds: readonly string[]) => readonly T[];
|
|
49
|
+
/** Ready server bags whose jsonc ids are enabled on this agent instance. */
|
|
50
|
+
export declare const filterSystemMcpToolsByServerIds: (handles: readonly SystemMcpServerTools[], enabledMcpIds: readonly string[]) => readonly SystemMcpServerTools[];
|
|
48
51
|
/** Failures that intersect this node's Inspector `enabledMcpIds`. */
|
|
49
52
|
export declare const filterMcpFailuresForNode: (failures: readonly SystemMcpConnectFailure[], enabledMcpIds: readonly string[]) => readonly SystemMcpConnectFailure[];
|
|
@@ -37,13 +37,15 @@ export const createSystemMcpHandles = async (options) => {
|
|
|
37
37
|
cwd: options.projectRoot,
|
|
38
38
|
});
|
|
39
39
|
closers.push(() => client.close());
|
|
40
|
-
handles.push(
|
|
41
|
-
id,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
handles.push({
|
|
41
|
+
serverId: id,
|
|
42
|
+
tools: await buildMcpHandle({
|
|
43
|
+
...(entry.toolNames !== undefined
|
|
44
|
+
? { toolNamesRaw: entry.toolNames }
|
|
45
|
+
: {}),
|
|
46
|
+
client,
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
47
49
|
continue;
|
|
48
50
|
}
|
|
49
51
|
const url = entry.url.trim();
|
|
@@ -59,13 +61,15 @@ export const createSystemMcpHandles = async (options) => {
|
|
|
59
61
|
: {}),
|
|
60
62
|
});
|
|
61
63
|
closers.push(() => session.close());
|
|
62
|
-
handles.push(
|
|
63
|
-
id,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
handles.push({
|
|
65
|
+
serverId: id,
|
|
66
|
+
tools: await buildMcpHandle({
|
|
67
|
+
...(entry.toolNames !== undefined
|
|
68
|
+
? { toolNamesRaw: entry.toolNames }
|
|
69
|
+
: {}),
|
|
70
|
+
client: session.client,
|
|
71
|
+
}),
|
|
72
|
+
});
|
|
69
73
|
}
|
|
70
74
|
catch (cause) {
|
|
71
75
|
failures.push({
|
|
@@ -105,13 +109,13 @@ export const collectEnabledMcpIdsFromNodes = (nodes) => {
|
|
|
105
109
|
}
|
|
106
110
|
return [...ids];
|
|
107
111
|
};
|
|
108
|
-
/** Ready
|
|
109
|
-
export const
|
|
112
|
+
/** Ready server bags whose jsonc ids are enabled on this agent instance. */
|
|
113
|
+
export const filterSystemMcpToolsByServerIds = (handles, enabledMcpIds) => {
|
|
110
114
|
if (enabledMcpIds.length === 0) {
|
|
111
115
|
return [];
|
|
112
116
|
}
|
|
113
117
|
const allowed = new Set(enabledMcpIds);
|
|
114
|
-
return handles.filter((handle) => allowed.has(handle.
|
|
118
|
+
return handles.filter((handle) => allowed.has(handle.serverId));
|
|
115
119
|
};
|
|
116
120
|
/** Failures that intersect this node's Inspector `enabledMcpIds`. */
|
|
117
121
|
export const filterMcpFailuresForNode = (failures, enabledMcpIds) => {
|