@codemation/core-nodes 0.7.1 → 0.8.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/CHANGELOG.md +203 -0
- package/LICENSE +1 -37
- package/dist/index.cjs +957 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +527 -61
- package/dist/index.d.ts +527 -61
- package/dist/index.js +936 -69
- package/dist/index.js.map +1 -1
- package/dist/metadata.json +162 -0
- package/package.json +4 -3
- package/src/authoring/defineRestNode.types.ts +17 -2
- package/src/chatModels/CodemationChatModelConfig.ts +47 -0
- package/src/chatModels/CodemationChatModelFactory.ts +103 -0
- package/src/chatModels/ManagedModelFetcher.ts +23 -0
- package/src/http/HttpRequestExecutor.ts +10 -2
- package/src/http/SSRFBlockedError.ts +16 -0
- package/src/http/SsrfGuard.ts +141 -0
- package/src/http/httpRequest.types.ts +6 -0
- package/src/index.ts +4 -0
- package/src/nodes/AIAgentConfig.ts +66 -0
- package/src/nodes/AIAgentNode.ts +205 -27
- package/src/nodes/BM25Index.ts +90 -0
- package/src/nodes/CallbackNodeFactory.ts +7 -0
- package/src/nodes/CronTriggerFactory.ts +9 -1
- package/src/nodes/DeferredMetaToolStrategy.ts +200 -0
- package/src/nodes/DeferredMetaToolStrategyFactory.ts +18 -0
- package/src/nodes/HttpRequestNodeFactory.ts +10 -3
- package/src/nodes/ManualTriggerFactory.ts +16 -1
- package/src/nodes/ToolLoadingStrategy.ts +28 -0
- package/src/nodes/WebhookTriggerFactory.ts +16 -2
- package/src/nodes/aggregate.ts +13 -2
- package/src/nodes/aiAgent.ts +9 -0
- package/src/nodes/assertion.ts +14 -1
- package/src/nodes/collections/collectionDeleteNode.types.ts +6 -0
- package/src/nodes/collections/collectionFindOneNode.types.ts +6 -0
- package/src/nodes/collections/collectionGetNode.types.ts +6 -0
- package/src/nodes/collections/collectionInsertNode.types.ts +6 -0
- package/src/nodes/collections/collectionListNode.types.ts +6 -0
- package/src/nodes/collections/collectionUpdateNode.types.ts +6 -0
- package/src/nodes/filter.ts +14 -2
- package/src/nodes/httpRequest.ts +72 -8
- package/src/nodes/if.ts +14 -2
- package/src/nodes/mapData.ts +13 -2
- package/src/nodes/merge.ts +9 -2
- package/src/nodes/noOp.ts +0 -1
- package/src/nodes/split.ts +13 -2
- package/src/nodes/subWorkflow.ts +15 -2
- package/src/nodes/switch.ts +18 -2
- package/src/nodes/testTrigger.ts +13 -0
- package/src/nodes/wait.ts +7 -1
- package/src/workflowAuthoring/WorkflowChatModelFactory.types.ts +4 -0
- package/src/workflows/AIAgentConnectionWorkflowExpander.ts +6 -3
- package/tsconfig.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssistantModelMessage, ModelMessage, ToolModelMessage } from "ai";
|
|
1
|
+
import { AssistantModelMessage, ModelMessage, ToolModelMessage, ToolSet } from "ai";
|
|
2
2
|
import { Cron, CronCallback } from "croner";
|
|
3
3
|
import { ReadableStream } from "node:stream/web";
|
|
4
4
|
import { ZodType, input, output, z } from "zod";
|
|
@@ -243,6 +243,8 @@ type ConnectionInvocationAppendArgs = Readonly<{
|
|
|
243
243
|
status: NodeExecutionStatus;
|
|
244
244
|
managedInput?: JsonValue;
|
|
245
245
|
managedOutput?: JsonValue;
|
|
246
|
+
statusLabel?: string;
|
|
247
|
+
subjectName?: string;
|
|
246
248
|
error?: NodeExecutionError;
|
|
247
249
|
queuedAt?: string;
|
|
248
250
|
startedAt?: string;
|
|
@@ -400,6 +402,26 @@ interface NodeConfigBase {
|
|
|
400
402
|
* configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
|
|
401
403
|
*/
|
|
402
404
|
readonly emitsAssertions?: true;
|
|
405
|
+
/**
|
|
406
|
+
* Static configuration summary surfaced in the workflow inspector — the design-time
|
|
407
|
+
* "what does this node do" panel that renders before any run telemetry exists.
|
|
408
|
+
*
|
|
409
|
+
* Return 2–6 short label/value pairs derived from this config (method + url for an HTTP
|
|
410
|
+
* call, model + tool list for an agent, schedule + timezone for a cron trigger, etc.).
|
|
411
|
+
* Values are truncated by the UI; aim for one line each. Return `undefined` to opt out
|
|
412
|
+
* — the inspector hides the section when no rows are produced.
|
|
413
|
+
*
|
|
414
|
+
* Implement on the config class instance so the function can read sibling config fields.
|
|
415
|
+
* `defineNode({ inspectorSummary })` plumbs through to this.
|
|
416
|
+
*/
|
|
417
|
+
inspectorSummary?(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* One row of a node's static configuration summary. See {@link NodeConfigBase.inspectorSummary}.
|
|
421
|
+
*/
|
|
422
|
+
interface NodeInspectorSummaryRow {
|
|
423
|
+
readonly label: string;
|
|
424
|
+
readonly value: string;
|
|
403
425
|
}
|
|
404
426
|
declare const runnableNodeInputType: unique symbol;
|
|
405
427
|
declare const runnableNodeOutputType: unique symbol;
|
|
@@ -623,32 +645,27 @@ interface TestTriggerNodeConfig<TOutputJson$1 = unknown> extends TriggerNodeConf
|
|
|
623
645
|
caseLabel?(item: Item<TOutputJson$1>): string | undefined;
|
|
624
646
|
}
|
|
625
647
|
//#endregion
|
|
626
|
-
//#region ../core/src/contracts/
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
readonly
|
|
640
|
-
|
|
641
|
-
readonly
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
readonly actual?: JsonValue;
|
|
648
|
-
/** Short human-readable explanation, especially for fails / errors. */
|
|
649
|
-
readonly message?: string;
|
|
650
|
-
/** Bag of supplemental fields (e.g. judge prompt, judge raw response, comparison method). */
|
|
651
|
-
readonly details?: Readonly<Record<string, JsonValue>>;
|
|
648
|
+
//#region ../core/src/contracts/CostTrackingTelemetryContract.d.ts
|
|
649
|
+
type CostTrackingComponent = "chat" | "ocr" | "rag";
|
|
650
|
+
interface CostTrackingUsageRecord {
|
|
651
|
+
readonly component: CostTrackingComponent;
|
|
652
|
+
readonly provider: string;
|
|
653
|
+
readonly operation: string;
|
|
654
|
+
readonly pricingKey: string;
|
|
655
|
+
readonly usageUnit: string;
|
|
656
|
+
readonly quantity: number;
|
|
657
|
+
readonly modelName?: string;
|
|
658
|
+
readonly attributes?: TelemetryAttributes;
|
|
659
|
+
}
|
|
660
|
+
interface CostTrackingPriceQuote {
|
|
661
|
+
readonly currency: string;
|
|
662
|
+
readonly currencyScale: number;
|
|
663
|
+
readonly estimatedAmountMinor: number;
|
|
664
|
+
readonly estimateKind: "catalog";
|
|
665
|
+
}
|
|
666
|
+
interface CostTrackingTelemetry {
|
|
667
|
+
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
668
|
+
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
652
669
|
}
|
|
653
670
|
//#endregion
|
|
654
671
|
//#region ../core/src/contracts/telemetryTypes.d.ts
|
|
@@ -731,27 +748,87 @@ interface ExecutionTelemetry extends TelemetryScope {
|
|
|
731
748
|
}>): NodeExecutionTelemetry;
|
|
732
749
|
}
|
|
733
750
|
//#endregion
|
|
734
|
-
//#region ../core/src/contracts/
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
+
//#region ../core/src/contracts/agentMcpTypes.d.ts
|
|
752
|
+
/**
|
|
753
|
+
* An opaque MCP tool map: keyed by serverId → (toolName → tool definition).
|
|
754
|
+
* Typed as unknown so core does not depend on the AI SDK's ToolSet type.
|
|
755
|
+
* AIAgentNode (in core-nodes, which does depend on ai) casts this to
|
|
756
|
+
* ReadonlyMap<string, ToolSet> before passing to DeferredMetaToolStrategyFactory.
|
|
757
|
+
*/
|
|
758
|
+
type AgentMcpToolMap = ReadonlyMap<string, Readonly<Record<string, unknown>>>;
|
|
759
|
+
/**
|
|
760
|
+
* Contract implemented by the host. Resolves MCP server bindings for an agent run
|
|
761
|
+
* via the standard credential-binding table (one slot per declared server, keyed
|
|
762
|
+
* by `(workflowId, mcpConnectionNodeId, "credential")`), and returns a ready-to-use
|
|
763
|
+
* tool map with wrapped execute callbacks for telemetry and 403 detection.
|
|
764
|
+
* Core-nodes imports this interface so AIAgentNode can inject it without
|
|
765
|
+
* depending on the host.
|
|
766
|
+
*/
|
|
767
|
+
interface AgentMcpIntegration {
|
|
768
|
+
/**
|
|
769
|
+
* Look up the credential binding per server, validate scopes, open pool
|
|
770
|
+
* connections, and return a tool map keyed by serverId. Each tool's
|
|
771
|
+
* execute callback includes:
|
|
772
|
+
* - Telemetry child span (mcp.server_id, mcp.tool_name attributes)
|
|
773
|
+
* - 403/permission error detection → emits a NeedsReconsentEvent span event
|
|
774
|
+
*
|
|
775
|
+
* Throws `AgentBindError` on validation failures (missing server, unbound
|
|
776
|
+
* credential slot, missing credential instance, insufficient scopes).
|
|
777
|
+
*/
|
|
778
|
+
prepareMcpTools(args: {
|
|
779
|
+
readonly workflowId: WorkflowId;
|
|
780
|
+
readonly agentNodeId: NodeId;
|
|
781
|
+
readonly serverIds: ReadonlyArray<string>;
|
|
782
|
+
readonly pinnedMcpTools: readonly string[];
|
|
783
|
+
readonly emitSpanEvent: (event: TelemetrySpanEventRecord) => void;
|
|
784
|
+
readonly startChildSpan: (args: {
|
|
785
|
+
readonly name: string;
|
|
786
|
+
readonly attributes?: Record<string, string>;
|
|
787
|
+
}) => {
|
|
788
|
+
readonly end: (args?: {
|
|
789
|
+
status?: "ok" | "error";
|
|
790
|
+
statusMessage?: string;
|
|
791
|
+
}) => void;
|
|
792
|
+
};
|
|
793
|
+
/** Per-MCP-tool-call invocation appender. Optional; when omitted the wrapper emits only telemetry spans. */
|
|
794
|
+
readonly appendMcpInvocation?: (args: ConnectionInvocationAppendArgs) => Promise<void>;
|
|
795
|
+
/** Agent activation id to attach to each invocation record (used by canvas + inspector grouping). */
|
|
796
|
+
readonly parentAgentActivationId?: NodeActivationId;
|
|
797
|
+
/** Per-item iteration id when the agent runs inside a per-item loop. */
|
|
798
|
+
readonly iterationId?: NodeIterationId;
|
|
799
|
+
/** Item index (0-based) of the iteration that owns these tool calls. */
|
|
800
|
+
readonly itemIndex?: number;
|
|
801
|
+
/** Parent invocation id when this agent is itself executing as a sub-agent. */
|
|
802
|
+
readonly parentInvocationId?: ConnectionInvocationId;
|
|
803
|
+
}): Promise<AgentMcpToolMap>;
|
|
751
804
|
}
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
805
|
+
//#endregion
|
|
806
|
+
//#region ../core/src/contracts/assertionTypes.d.ts
|
|
807
|
+
/**
|
|
808
|
+
* One assertion emitted by an assertion-emitting node (a node whose config sets
|
|
809
|
+
* `emitsAssertions: true`). Each emitted item on `main` carries one of these as `item.json`.
|
|
810
|
+
*
|
|
811
|
+
* Pass/fail is derived from `score >= (passThreshold ?? 0.5)` — see {@link deriveAssertionPassed}.
|
|
812
|
+
* The `errored` marker is for cases where the assertion code itself threw (distinct from
|
|
813
|
+
* "the assertion was evaluated and the score was low") and is treated as a hard fail in rollups
|
|
814
|
+
* regardless of `score`.
|
|
815
|
+
*/
|
|
816
|
+
interface AssertionResult {
|
|
817
|
+
readonly name: string;
|
|
818
|
+
/** 0..1 score. Source of truth for pass/fail (compared against `passThreshold`). */
|
|
819
|
+
readonly score: number;
|
|
820
|
+
/** 0..1 threshold for "passed". When omitted, consumers default to 0.5. */
|
|
821
|
+
readonly passThreshold?: number;
|
|
822
|
+
/** True when evaluating the assertion threw — treated as fail regardless of `score`. */
|
|
823
|
+
readonly errored?: true;
|
|
824
|
+
/** What the assertion expected. Free-form JSON; UIs render with a JSON viewer. */
|
|
825
|
+
readonly expected?: JsonValue;
|
|
826
|
+
/** What the workflow actually produced. */
|
|
827
|
+
readonly actual?: JsonValue;
|
|
828
|
+
/** Short human-readable explanation, especially for fails / errors. */
|
|
829
|
+
readonly message?: string;
|
|
830
|
+
/** Bag of supplemental fields (e.g. judge prompt, judge raw response, comparison method). */
|
|
831
|
+
readonly details?: Readonly<Record<string, JsonValue>>;
|
|
755
832
|
}
|
|
756
833
|
//#endregion
|
|
757
834
|
//#region ../core/src/contracts/webhookTypes.d.ts
|
|
@@ -767,6 +844,35 @@ interface TriggerInstanceId {
|
|
|
767
844
|
nodeId: NodeId;
|
|
768
845
|
}
|
|
769
846
|
//#endregion
|
|
847
|
+
//#region ../core/src/contracts/mcpTypes.d.ts
|
|
848
|
+
type McpServerTransport = "http";
|
|
849
|
+
interface McpServerDeclaration {
|
|
850
|
+
/** Globally unique slug, e.g. "gmail". Workflow authors reference this. */
|
|
851
|
+
id: string;
|
|
852
|
+
displayName: string;
|
|
853
|
+
description: string;
|
|
854
|
+
transport: McpServerTransport;
|
|
855
|
+
url: string;
|
|
856
|
+
/**
|
|
857
|
+
* Credential types accepted by this MCP server, matching CredentialRequirement.acceptedTypes.
|
|
858
|
+
* Absent or empty means no credential is required.
|
|
859
|
+
*/
|
|
860
|
+
acceptedCredentialTypes?: ReadonlyArray<string>;
|
|
861
|
+
/**
|
|
862
|
+
* Documentation only in MVP. The bind-time validator checks
|
|
863
|
+
* requiredScopes ⊆ CredentialInstance.scopesGranted.
|
|
864
|
+
*/
|
|
865
|
+
requiredScopes?: string[];
|
|
866
|
+
/** Non-secret static headers merged onto every MCP request. */
|
|
867
|
+
staticHeaders?: Record<string, string>;
|
|
868
|
+
/**
|
|
869
|
+
* Overrides for tool descriptions advertised by the MCP server.
|
|
870
|
+
* Applied by the connection pool after tools/list.
|
|
871
|
+
* Key: exact tool name as returned by the server.
|
|
872
|
+
*/
|
|
873
|
+
toolDescriptionOverrides?: Record<string, string>;
|
|
874
|
+
}
|
|
875
|
+
//#endregion
|
|
770
876
|
//#region ../core/src/contracts/collectionTypes.d.ts
|
|
771
877
|
/**
|
|
772
878
|
* Represents a typed store for a single collection.
|
|
@@ -1330,6 +1436,9 @@ interface AgentNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> exten
|
|
|
1330
1436
|
readonly outputSchema?: ZodType<TOutputJson$1>;
|
|
1331
1437
|
}
|
|
1332
1438
|
//#endregion
|
|
1439
|
+
//#region ../core/src/ai/AgentConnectionNodeCollector.d.ts
|
|
1440
|
+
type McpServerResolver = (id: string) => McpServerDeclaration | undefined;
|
|
1441
|
+
//#endregion
|
|
1333
1442
|
//#region ../core/src/execution/ChildExecutionScopeFactory.d.ts
|
|
1334
1443
|
/**
|
|
1335
1444
|
* Builds a re-rooted child execution context for sub-agent (and other deeply-nested) invocations.
|
|
@@ -1456,6 +1565,12 @@ type HttpRequestSpec = Readonly<{
|
|
|
1456
1565
|
responseBinarySlot?: string;
|
|
1457
1566
|
/** Maximum allowed response size in bytes (checked against Content-Length before allocating). Defaults to 100 MiB. */
|
|
1458
1567
|
responseSizeCapBytes?: number;
|
|
1568
|
+
/**
|
|
1569
|
+
* When `false` (default), requests whose target host resolves to an RFC-1918,
|
|
1570
|
+
* link-local (169.254/16), or loopback address are blocked to prevent SSRF attacks.
|
|
1571
|
+
* Set to `true` only for workflows that intentionally reach private infrastructure.
|
|
1572
|
+
*/
|
|
1573
|
+
allowPrivateNetworkTargets?: boolean;
|
|
1459
1574
|
/** Execution context — needed for binary attach. */
|
|
1460
1575
|
ctx: NodeExecutionContext<RunnableNodeConfig<unknown, unknown>>;
|
|
1461
1576
|
}>;
|
|
@@ -1620,6 +1735,58 @@ declare const oauth2ClientCredentialsType: Readonly<{
|
|
|
1620
1735
|
readonly key: string;
|
|
1621
1736
|
};
|
|
1622
1737
|
//#endregion
|
|
1738
|
+
//#region src/http/SSRFBlockedError.d.ts
|
|
1739
|
+
/**
|
|
1740
|
+
* Thrown when an HTTP request target resolves to a private, link-local, or
|
|
1741
|
+
* loopback address and `allowPrivateNetworkTargets` is not set.
|
|
1742
|
+
*/
|
|
1743
|
+
declare class SSRFBlockedError extends Error {
|
|
1744
|
+
readonly resolvedIp: string;
|
|
1745
|
+
constructor(host: string, resolvedIp: string);
|
|
1746
|
+
}
|
|
1747
|
+
//#endregion
|
|
1748
|
+
//#region src/http/SsrfGuard.d.ts
|
|
1749
|
+
/**
|
|
1750
|
+
* Guards HTTP requests against Server-Side Request Forgery (SSRF) by
|
|
1751
|
+
* DNS-resolving the target host and rejecting private/link-local/loopback
|
|
1752
|
+
* addresses.
|
|
1753
|
+
*
|
|
1754
|
+
* Blocked ranges:
|
|
1755
|
+
* - RFC-1918: 10/8, 172.16/12, 192.168/16
|
|
1756
|
+
* - Link-local: 169.254/16
|
|
1757
|
+
* - Loopback: 127/8, ::1
|
|
1758
|
+
*
|
|
1759
|
+
* When `allowedOutboundHosts` is set, every resolved DNS target must match
|
|
1760
|
+
* at least one entry in the list (exact hostname or `*.example.com` wildcard).
|
|
1761
|
+
* When unset, existing behaviour applies: private ranges blocked, public allowed.
|
|
1762
|
+
*
|
|
1763
|
+
* Call {@link check} before making any outbound HTTP request.
|
|
1764
|
+
* Pass `allowPrivate: true` to bypass the private-network guard for trusted workflows
|
|
1765
|
+
* (allowedOutboundHosts allowlist is still applied when set).
|
|
1766
|
+
*/
|
|
1767
|
+
declare class SsrfGuard {
|
|
1768
|
+
private readonly allowedOutboundHosts?;
|
|
1769
|
+
constructor(allowedOutboundHosts?: ReadonlyArray<string> | undefined);
|
|
1770
|
+
/**
|
|
1771
|
+
* Resolves the host of `url` via DNS and throws {@link SSRFBlockedError}
|
|
1772
|
+
* if any resolved address falls in a blocked range, or if the host does not
|
|
1773
|
+
* match the operator-configured allowlist (when set).
|
|
1774
|
+
*
|
|
1775
|
+
* @param url - Fully-qualified URL of the intended request target.
|
|
1776
|
+
* @param allowPrivate - When `true`, the private-network check is skipped.
|
|
1777
|
+
* The allowedOutboundHosts check is still applied when set.
|
|
1778
|
+
*/
|
|
1779
|
+
check(url: string, allowPrivate: boolean): Promise<void>;
|
|
1780
|
+
/**
|
|
1781
|
+
* Returns true when `host` matches at least one entry in `allowedOutboundHosts`.
|
|
1782
|
+
* Supports exact hostnames (`api.example.com`) and wildcard prefixes (`*.example.com`).
|
|
1783
|
+
*/
|
|
1784
|
+
private isHostAllowed;
|
|
1785
|
+
private isPrivateAddress;
|
|
1786
|
+
private isPrivateIPv4;
|
|
1787
|
+
private isPrivateIPv6;
|
|
1788
|
+
}
|
|
1789
|
+
//#endregion
|
|
1623
1790
|
//#region src/authoring/defineRestNode.types.d.ts
|
|
1624
1791
|
type MaybePromise<T> = T | Promise<T>;
|
|
1625
1792
|
/**
|
|
@@ -1705,6 +1872,14 @@ interface DefineRestNodeOptions<TKey$1 extends string, TCredentials extends Defi
|
|
|
1705
1872
|
* @default "throw"
|
|
1706
1873
|
*/
|
|
1707
1874
|
readonly errorPolicy?: RestNodeErrorPolicy;
|
|
1875
|
+
/**
|
|
1876
|
+
* Static configuration summary surfaced in the workflow inspector.
|
|
1877
|
+
* Receives the static config (empty record for defineRestNode — config lives on item input).
|
|
1878
|
+
* Most callers return rows based on the static `api` descriptor instead.
|
|
1879
|
+
*/
|
|
1880
|
+
readonly inspectorSummary?: (args: Readonly<{
|
|
1881
|
+
config: Record<string, never>;
|
|
1882
|
+
}>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
1708
1883
|
}
|
|
1709
1884
|
/**
|
|
1710
1885
|
* Declarative helper for creating thin API-wrapper nodes.
|
|
@@ -1868,6 +2043,77 @@ declare class OpenAiChatModelPresets {
|
|
|
1868
2043
|
}
|
|
1869
2044
|
declare const openAiChatModelPresets: OpenAiChatModelPresets;
|
|
1870
2045
|
//#endregion
|
|
2046
|
+
//#region src/chatModels/CodemationChatModelConfig.d.ts
|
|
2047
|
+
/**
|
|
2048
|
+
* A platform-managed model entry as returned by GET /api/llm/managed-models.
|
|
2049
|
+
*/
|
|
2050
|
+
interface ManagedModelDto {
|
|
2051
|
+
id: string;
|
|
2052
|
+
modelId: string;
|
|
2053
|
+
displayName: string;
|
|
2054
|
+
providerKey: string;
|
|
2055
|
+
inputCostPerMTok: number;
|
|
2056
|
+
outputCostPerMTok: number;
|
|
2057
|
+
contextWindow: number;
|
|
2058
|
+
tier: string;
|
|
2059
|
+
}
|
|
2060
|
+
/**
|
|
2061
|
+
* Bifrost-namespaced model ID. Kept as `string` so runtime-fetched model IDs
|
|
2062
|
+
* (from the CP allowlist) work without compile-time enumeration.
|
|
2063
|
+
* Story C replaced the prior hardcoded union with this open type.
|
|
2064
|
+
*/
|
|
2065
|
+
type CodemationManagedModel = string;
|
|
2066
|
+
declare class CodemationChatModelConfig implements ChatModelConfig {
|
|
2067
|
+
readonly name: string;
|
|
2068
|
+
readonly model: CodemationManagedModel;
|
|
2069
|
+
readonly options?: Readonly<{
|
|
2070
|
+
temperature?: number;
|
|
2071
|
+
maxTokens?: number;
|
|
2072
|
+
}> | undefined;
|
|
2073
|
+
readonly type: typeof CodemationChatModelFactory;
|
|
2074
|
+
readonly presentation: AgentCanvasPresentation<CanvasIconName>;
|
|
2075
|
+
readonly provider = "codemation-managed";
|
|
2076
|
+
readonly modelName: string;
|
|
2077
|
+
constructor(name: string, model: CodemationManagedModel, presentationIn?: AgentCanvasPresentation<CanvasIconName>, options?: Readonly<{
|
|
2078
|
+
temperature?: number;
|
|
2079
|
+
maxTokens?: number;
|
|
2080
|
+
}> | undefined);
|
|
2081
|
+
}
|
|
2082
|
+
//#endregion
|
|
2083
|
+
//#region src/chatModels/CodemationChatModelFactory.d.ts
|
|
2084
|
+
declare class CodemationChatModelFactory implements ChatModelFactory<CodemationChatModelConfig> {
|
|
2085
|
+
create(args: Readonly<{
|
|
2086
|
+
config: CodemationChatModelConfig;
|
|
2087
|
+
ctx: NodeExecutionContext<any>;
|
|
2088
|
+
}>): Promise<ChatLanguageModel>;
|
|
2089
|
+
/**
|
|
2090
|
+
* Creates an HMAC-signed fetch wrapper for use with AI SDK's createOpenAI.
|
|
2091
|
+
* Each call signs the request body with the workspace pairing secret so the
|
|
2092
|
+
* LLM broker can authenticate the workspace without a user-managed API key.
|
|
2093
|
+
*
|
|
2094
|
+
* Mirrors HmacRequestSigner from @codemation/host/pairing without importing
|
|
2095
|
+
* that package (which would create a circular dependency since @codemation/host
|
|
2096
|
+
* depends on @codemation/core-nodes).
|
|
2097
|
+
*/
|
|
2098
|
+
private buildHmacSignedFetch;
|
|
2099
|
+
/**
|
|
2100
|
+
* Produces a Codemation-Hmac v1 Authorization header value.
|
|
2101
|
+
* The algorithm must match HmacVerifier.computeSignature() in the control-plane.
|
|
2102
|
+
*/
|
|
2103
|
+
private buildHmacAuthHeader;
|
|
2104
|
+
}
|
|
2105
|
+
//#endregion
|
|
2106
|
+
//#region src/chatModels/ManagedModelFetcher.d.ts
|
|
2107
|
+
/**
|
|
2108
|
+
* Fetches the active platform-managed model allowlist from the CP.
|
|
2109
|
+
* Reads CONTROL_PLANE_URL from the workspace process env.
|
|
2110
|
+
* Returns an empty array if the env var is absent or the fetch fails.
|
|
2111
|
+
* Cache the result per session — the allowlist changes infrequently.
|
|
2112
|
+
*/
|
|
2113
|
+
declare class ManagedModelFetcher {
|
|
2114
|
+
fetch(): Promise<ManagedModelDto[]>;
|
|
2115
|
+
}
|
|
2116
|
+
//#endregion
|
|
1871
2117
|
//#region src/nodes/aiAgentSupport.types.d.ts
|
|
1872
2118
|
declare class AgentItemPortMap {
|
|
1873
2119
|
static fromItem(item: Item): NodeInputsByPort;
|
|
@@ -2060,6 +2306,30 @@ interface AIAgentOptions<TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
|
2060
2306
|
/** Engine applies with {@link RunnableNodeConfig.inputSchema} before {@link AIAgentNode.execute}. */
|
|
2061
2307
|
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
2062
2308
|
readonly outputSchema?: ZodType<_TOutputJson>;
|
|
2309
|
+
/**
|
|
2310
|
+
* MCP servers to connect for this agent run. Each entry is the server id from
|
|
2311
|
+
* the MCP catalog (e.g. `"gmail"`). Credential instances are bound via the
|
|
2312
|
+
* standard credential-binding flow — each server materializes an MCP connection
|
|
2313
|
+
* node and the slot lives on that node, keyed by
|
|
2314
|
+
* `(workflowId, mcpConnectionNodeId, "credential")` (same shape as ChatModel and
|
|
2315
|
+
* Tool connection nodes). There is no inline credential field; bind through the
|
|
2316
|
+
* canvas credential dropdown before activation.
|
|
2317
|
+
*/
|
|
2318
|
+
readonly mcpServers?: ReadonlyArray<string>;
|
|
2319
|
+
/**
|
|
2320
|
+
* Tool ids to always include without going through `find_tools`.
|
|
2321
|
+
* Format: `"serverId:toolName"` (e.g. `"gmail:send_message"`). Max 16.
|
|
2322
|
+
*/
|
|
2323
|
+
readonly pinnedMcpTools?: readonly string[];
|
|
2324
|
+
/**
|
|
2325
|
+
* Source identifiers that should be treated as untrusted external content.
|
|
2326
|
+
* When an incoming `Item.json.__source` matches one of these values, every
|
|
2327
|
+
* user-role message is wrapped with an untrusted-source preamble so the LLM
|
|
2328
|
+
* treats the content as data rather than instructions (prompt-injection defense).
|
|
2329
|
+
*
|
|
2330
|
+
* Defaults to `["gmail", "ocr", "webhook"]` when unset.
|
|
2331
|
+
*/
|
|
2332
|
+
readonly untrustedSources?: ReadonlyArray<string>;
|
|
2063
2333
|
}
|
|
2064
2334
|
/**
|
|
2065
2335
|
* AI agent: credential bindings are keyed to connection-owned LLM/tool node ids (ConnectionNodeIdFactory),
|
|
@@ -2081,7 +2351,11 @@ declare class AIAgent<TInputJson$1 = unknown, TOutputJson$1 = unknown> implement
|
|
|
2081
2351
|
readonly guardrails?: AgentGuardrailConfig;
|
|
2082
2352
|
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
2083
2353
|
readonly outputSchema?: ZodType<TOutputJson$1>;
|
|
2354
|
+
readonly mcpServers?: ReadonlyArray<string>;
|
|
2355
|
+
readonly pinnedMcpTools?: readonly string[];
|
|
2356
|
+
readonly untrustedSources?: ReadonlyArray<string>;
|
|
2084
2357
|
constructor(options: AIAgentOptions<TInputJson$1, TOutputJson$1>);
|
|
2358
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2085
2359
|
}
|
|
2086
2360
|
//#endregion
|
|
2087
2361
|
//#region src/nodes/AgentToolRepairPolicy.d.ts
|
|
@@ -2154,6 +2428,41 @@ declare class NodeBackedToolRuntime {
|
|
|
2154
2428
|
private isMultiInputNode;
|
|
2155
2429
|
}
|
|
2156
2430
|
//#endregion
|
|
2431
|
+
//#region src/nodes/ToolLoadingStrategy.d.ts
|
|
2432
|
+
interface FindToolsResult {
|
|
2433
|
+
readonly serverId: string;
|
|
2434
|
+
readonly toolName: string;
|
|
2435
|
+
readonly description: string;
|
|
2436
|
+
readonly inputSchema: unknown;
|
|
2437
|
+
}
|
|
2438
|
+
interface ToolLoadingStrategyTurnContext {
|
|
2439
|
+
readonly turnIndex: number;
|
|
2440
|
+
readonly previousFoundToolIds?: ReadonlyArray<string>;
|
|
2441
|
+
}
|
|
2442
|
+
interface ToolLoadingStrategyInitInput {
|
|
2443
|
+
readonly nodeBackedTools: ToolSet;
|
|
2444
|
+
readonly mcpToolsByServer: ReadonlyMap<string, ToolSet>;
|
|
2445
|
+
readonly pinnedMcpTools?: ReadonlyArray<string>;
|
|
2446
|
+
}
|
|
2447
|
+
interface ToolLoadingStrategy {
|
|
2448
|
+
initialize(input: ToolLoadingStrategyInitInput): Promise<void>;
|
|
2449
|
+
getToolsForTurn(context: ToolLoadingStrategyTurnContext): ToolSet;
|
|
2450
|
+
ownsToolName(toolName: string): boolean;
|
|
2451
|
+
executeMetaTool(toolName: string, input: unknown): Promise<unknown>;
|
|
2452
|
+
recordFoundTools(results: ReadonlyArray<FindToolsResult>): void;
|
|
2453
|
+
getFoundToolIds(): ReadonlyArray<string>;
|
|
2454
|
+
}
|
|
2455
|
+
//#endregion
|
|
2456
|
+
//#region src/nodes/DeferredMetaToolStrategyFactory.d.ts
|
|
2457
|
+
/**
|
|
2458
|
+
* Factory for creating and initializing a DeferredMetaToolStrategy per agent execution.
|
|
2459
|
+
* Injected into AIAgentNode; each agent call creates its own initialized strategy instance.
|
|
2460
|
+
* BM25Index is constructed here (this file is a composition root via the Factory suffix).
|
|
2461
|
+
*/
|
|
2462
|
+
declare class DeferredMetaToolStrategyFactory {
|
|
2463
|
+
create(input: ToolLoadingStrategyInitInput): Promise<ToolLoadingStrategy>;
|
|
2464
|
+
}
|
|
2465
|
+
//#endregion
|
|
2157
2466
|
//#region src/nodes/AIAgentNode.d.ts
|
|
2158
2467
|
declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
2159
2468
|
private readonly nodeResolver;
|
|
@@ -2161,15 +2470,18 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
2161
2470
|
private readonly executionHelpers;
|
|
2162
2471
|
private readonly structuredOutputRunner;
|
|
2163
2472
|
private readonly toolExecutionCoordinator;
|
|
2473
|
+
private readonly toolLoadingStrategyFactory;
|
|
2474
|
+
private readonly agentMcpIntegration;
|
|
2164
2475
|
kind: "node";
|
|
2165
2476
|
outputPorts: readonly ["main"];
|
|
2166
2477
|
readonly inputSchema: z.ZodUnknown;
|
|
2167
2478
|
private readonly connectionCredentialExecutionContextFactory;
|
|
2168
2479
|
private readonly preparedByExecutionContext;
|
|
2169
|
-
constructor(nodeResolver: NodeResolver, credentialSessions: CredentialSessionService, nodeBackedToolRuntime: NodeBackedToolRuntime, executionHelpers: AIAgentExecutionHelpersFactory, structuredOutputRunner: AgentStructuredOutputRunner, toolExecutionCoordinator: AgentToolExecutionCoordinator);
|
|
2480
|
+
constructor(nodeResolver: NodeResolver, credentialSessions: CredentialSessionService, nodeBackedToolRuntime: NodeBackedToolRuntime, executionHelpers: AIAgentExecutionHelpersFactory, structuredOutputRunner: AgentStructuredOutputRunner, toolExecutionCoordinator: AgentToolExecutionCoordinator, toolLoadingStrategyFactory: DeferredMetaToolStrategyFactory, agentMcpIntegration: AgentMcpIntegration);
|
|
2170
2481
|
execute(args: RunnableNodeExecuteArgs<AIAgent<any, any>>): Promise<unknown>;
|
|
2171
2482
|
private getOrPrepareExecution;
|
|
2172
2483
|
private prepareExecution;
|
|
2484
|
+
private prepareMcpToolsByServer;
|
|
2173
2485
|
private runAgentForItem;
|
|
2174
2486
|
/**
|
|
2175
2487
|
* Multi-turn loop:
|
|
@@ -2178,6 +2490,8 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
2178
2490
|
* connection-invocation recording / transient-error handling exactly like before).
|
|
2179
2491
|
* - When the model returns no tool calls the loop ends with the model's text as the final answer.
|
|
2180
2492
|
* - Respects `guardrails.maxTurns` and `guardrails.onTurnLimitReached`.
|
|
2493
|
+
* - Strategy-owned tool calls (e.g. `find_tools`) are dispatched via the strategy, not the
|
|
2494
|
+
* coordinator; their results are tracked so subsequent turns receive the discovered tools.
|
|
2181
2495
|
*/
|
|
2182
2496
|
private runTurnLoopUntilFinalAnswer;
|
|
2183
2497
|
private cannotExecuteAnotherToolRound;
|
|
@@ -2187,6 +2501,22 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
2187
2501
|
private buildOutputItem;
|
|
2188
2502
|
private resolveTools;
|
|
2189
2503
|
private createItemScopedTools;
|
|
2504
|
+
/**
|
|
2505
|
+
* Invoke a text turn using the merged tool set from item-scoped tools (coordinator-managed)
|
|
2506
|
+
* and strategy tools (find_tools + discovered MCP tools).
|
|
2507
|
+
* Strategy tools take precedence for names that overlap.
|
|
2508
|
+
*/
|
|
2509
|
+
private invokeTextTurnWithStrategyTools;
|
|
2510
|
+
/**
|
|
2511
|
+
* Removes `execute` properties from ToolSet entries so the AI SDK does not
|
|
2512
|
+
* auto-execute them within `generateText`. Codemation owns all tool dispatch.
|
|
2513
|
+
*/
|
|
2514
|
+
private stripExecuteCallbacks;
|
|
2515
|
+
/**
|
|
2516
|
+
* Builds a ToolSet from resolved tools for strategy initialization.
|
|
2517
|
+
* The strategy uses this for its "always-included" node-backed tool descriptions.
|
|
2518
|
+
*/
|
|
2519
|
+
private buildToolSetFromResolved;
|
|
2190
2520
|
/**
|
|
2191
2521
|
* Builds an AI SDK {@link ToolSet} where every tool ships a pre-converted JSON Schema (via
|
|
2192
2522
|
* {@link jsonSchema}) — not the raw Zod schema — and carries **no** `execute`. Two reasons:
|
|
@@ -2204,9 +2534,9 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
2204
2534
|
private buildToolSet;
|
|
2205
2535
|
/**
|
|
2206
2536
|
* One `generateText` turn (no auto tool execution) with Codemation-owned child-span telemetry
|
|
2207
|
-
* and connection-invocation state recording.
|
|
2537
|
+
* and connection-invocation state recording. Accepts a pre-built ToolSet.
|
|
2208
2538
|
*/
|
|
2209
|
-
private
|
|
2539
|
+
private invokeTextTurnWithToolSet;
|
|
2210
2540
|
/**
|
|
2211
2541
|
* Structured-output turn: runs `generateText({ output: Output.object({ schema }) })` via the
|
|
2212
2542
|
* structured-output runner. We keep this as a separate helper because the runner needs the raw
|
|
@@ -2237,6 +2567,13 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
2237
2567
|
private summarizeLlmMessages;
|
|
2238
2568
|
private resultToJsonValue;
|
|
2239
2569
|
private createPromptMessages;
|
|
2570
|
+
/**
|
|
2571
|
+
* When `item.json.__source` matches an entry in `config.untrustedSources`
|
|
2572
|
+
* (default: `["gmail", "ocr", "webhook"]`), wraps every user-role message
|
|
2573
|
+
* content with an untrusted-external-source preamble so the LLM treats the
|
|
2574
|
+
* content as data, not instructions.
|
|
2575
|
+
*/
|
|
2576
|
+
private wrapUntrustedSourceMessages;
|
|
2240
2577
|
private resolveToolRuntime;
|
|
2241
2578
|
private isNodeBackedToolConfig;
|
|
2242
2579
|
private isCallableToolConfig;
|
|
@@ -2245,6 +2582,61 @@ declare class AIAgentNode implements RunnableNode<AIAgent<any, any>> {
|
|
|
2245
2582
|
private extractErrorDetails;
|
|
2246
2583
|
}
|
|
2247
2584
|
//#endregion
|
|
2585
|
+
//#region src/nodes/BM25Index.d.ts
|
|
2586
|
+
/**
|
|
2587
|
+
* Minimal BM25 (Okapi BM25) implementation for indexing MCP tool descriptions.
|
|
2588
|
+
*
|
|
2589
|
+
* Parameters: k1=1.5, b=0.75 (standard defaults).
|
|
2590
|
+
* Tokenisation: lowercase, split on non-alphanumerics, filter empties.
|
|
2591
|
+
*/
|
|
2592
|
+
declare class BM25Index {
|
|
2593
|
+
private readonly k1;
|
|
2594
|
+
private readonly b;
|
|
2595
|
+
private readonly tf;
|
|
2596
|
+
private readonly df;
|
|
2597
|
+
private avgDocLen;
|
|
2598
|
+
/**
|
|
2599
|
+
* Add all documents at once. After calling this, search is available.
|
|
2600
|
+
* Documents are indexed in insertion order; search returns their indices.
|
|
2601
|
+
*/
|
|
2602
|
+
add(docs: ReadonlyArray<string>): void;
|
|
2603
|
+
/**
|
|
2604
|
+
* Returns up to `limit` document indices ranked by BM25 score (highest first).
|
|
2605
|
+
* Returns an empty array if the index is empty or the query matches nothing.
|
|
2606
|
+
*/
|
|
2607
|
+
search(query: string, limit: number): ReadonlyArray<number>;
|
|
2608
|
+
tokenize(text: string): string[];
|
|
2609
|
+
private docLen;
|
|
2610
|
+
}
|
|
2611
|
+
//#endregion
|
|
2612
|
+
//#region src/nodes/DeferredMetaToolStrategy.d.ts
|
|
2613
|
+
/**
|
|
2614
|
+
* Default tool-loading strategy: BM25-indexed MCP tool deferral via a `find_tools` meta-tool.
|
|
2615
|
+
*
|
|
2616
|
+
* - Node-backed tools and pinned MCP tools are always included in every turn.
|
|
2617
|
+
* - `find_tools(query, limit?)` is added to the tool set when MCP tools are indexed.
|
|
2618
|
+
* - Tools surfaced by `find_tools` are included in subsequent turns.
|
|
2619
|
+
*
|
|
2620
|
+
* Not DI-managed; instantiated per agent execution by DeferredMetaToolStrategyFactory.
|
|
2621
|
+
*/
|
|
2622
|
+
declare class DeferredMetaToolStrategy implements ToolLoadingStrategy {
|
|
2623
|
+
private readonly bm25;
|
|
2624
|
+
private readonly warnFn;
|
|
2625
|
+
private nodeBackedTools;
|
|
2626
|
+
private pinnedTools;
|
|
2627
|
+
private mcpEntries;
|
|
2628
|
+
private toolsByServerId;
|
|
2629
|
+
private foundToolIds;
|
|
2630
|
+
constructor(bm25: BM25Index, warnFn: (message: string) => void);
|
|
2631
|
+
initialize(input: ToolLoadingStrategyInitInput): Promise<void>;
|
|
2632
|
+
getToolsForTurn(context: ToolLoadingStrategyTurnContext): ToolSet;
|
|
2633
|
+
ownsToolName(toolName: string): boolean;
|
|
2634
|
+
executeMetaTool(toolName: string, input: unknown): Promise<unknown>;
|
|
2635
|
+
recordFoundTools(results: ReadonlyArray<FindToolsResult>): void;
|
|
2636
|
+
getFoundToolIds(): ReadonlyArray<string>;
|
|
2637
|
+
private buildFindToolsDefinition;
|
|
2638
|
+
}
|
|
2639
|
+
//#endregion
|
|
2248
2640
|
//#region src/nodes/AssertionNode.d.ts
|
|
2249
2641
|
/**
|
|
2250
2642
|
* Runs the author's `assertions` callback for each input item and emits one workflow `Item` per
|
|
@@ -2289,6 +2681,7 @@ declare class Assertion<TInputJson$1 = unknown> implements RunnableNodeConfig<TI
|
|
|
2289
2681
|
readonly emitsAssertions: true;
|
|
2290
2682
|
readonly assertions: AssertionOptions<TInputJson$1>["assertions"];
|
|
2291
2683
|
constructor(options: AssertionOptions<TInputJson$1>);
|
|
2684
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
2292
2685
|
}
|
|
2293
2686
|
//#endregion
|
|
2294
2687
|
//#region src/nodes/CallbackNode.d.ts
|
|
@@ -2327,6 +2720,7 @@ declare class Callback<TInputJson$1 = unknown, TOutputJson$1 = TInputJson$1> imp
|
|
|
2327
2720
|
readonly declaredOutputPorts?: ReadonlyArray<string>;
|
|
2328
2721
|
constructor(name?: string, callback?: CallbackHandler<TInputJson$1, TOutputJson$1>, idOrOptions?: string | CallbackOptions, options?: CallbackOptions);
|
|
2329
2722
|
private static defaultCallback;
|
|
2723
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
2330
2724
|
}
|
|
2331
2725
|
//#endregion
|
|
2332
2726
|
//#region src/nodes/HttpRequestNodeFactory.d.ts
|
|
@@ -2396,11 +2790,22 @@ declare class HttpRequest<TInputJson$1 = Readonly<{
|
|
|
2396
2790
|
/** Request body specification. For canvas use, pass a JSON string in `body.data`. */
|
|
2397
2791
|
body?: HttpBodySpec;
|
|
2398
2792
|
/**
|
|
2399
|
-
* Credential slot
|
|
2400
|
-
*
|
|
2401
|
-
*
|
|
2793
|
+
* Credential slot.
|
|
2794
|
+
*
|
|
2795
|
+
* **String shorthand** (existing): `credentialSlot: "auth"` — the slot accepts all four
|
|
2796
|
+
* default HTTP credential types (bearer, API-key, basic, OAuth2).
|
|
2797
|
+
*
|
|
2798
|
+
* **Object form** (new): narrows the accepted types to the caller-supplied list, useful
|
|
2799
|
+
* when only a subset of credential types makes sense for a specific endpoint.
|
|
2800
|
+
* ```ts
|
|
2801
|
+
* credentialSlot: { name: "auth", acceptedTypes: [bearerTokenCredentialType] }
|
|
2802
|
+
* ```
|
|
2803
|
+
* The slot must be declared in `getCredentialRequirements()`, which is wired automatically.
|
|
2402
2804
|
*/
|
|
2403
|
-
credentialSlot?: string
|
|
2805
|
+
credentialSlot?: string | Readonly<{
|
|
2806
|
+
name: string;
|
|
2807
|
+
acceptedTypes?: ReadonlyArray<AnyCredentialType>;
|
|
2808
|
+
}>;
|
|
2404
2809
|
binaryName?: string;
|
|
2405
2810
|
downloadMode?: HttpRequestDownloadMode;
|
|
2406
2811
|
/**
|
|
@@ -2424,6 +2829,23 @@ declare class HttpRequest<TInputJson$1 = Readonly<{
|
|
|
2424
2829
|
* Requests whose `Content-Length` exceeds this cap are rejected before the body is read.
|
|
2425
2830
|
*/
|
|
2426
2831
|
responseSizeCapBytes?: number;
|
|
2832
|
+
/**
|
|
2833
|
+
* Operator-configurable outbound host allowlist.
|
|
2834
|
+
*
|
|
2835
|
+
* When set, every HTTP request target must match an entry in this list before the
|
|
2836
|
+
* request is made — requests to any other host are rejected with {@link SSRFBlockedError}.
|
|
2837
|
+
* Supports exact hostnames (`api.example.com`) and wildcard subdomain patterns
|
|
2838
|
+
* (`*.example.com` matches `sub.example.com` but not `example.com` itself).
|
|
2839
|
+
*
|
|
2840
|
+
* When unset (default), the existing SSRF private-network guard applies:
|
|
2841
|
+
* public hosts are allowed and private/loopback ranges are blocked.
|
|
2842
|
+
*
|
|
2843
|
+
* **Production warning**: when `NODE_ENV === "production"` and this is unset, a one-time
|
|
2844
|
+
* warning is logged at workflow startup.
|
|
2845
|
+
*
|
|
2846
|
+
* Setting this to an empty array `[]` is equivalent to "block everything".
|
|
2847
|
+
*/
|
|
2848
|
+
allowedOutboundHosts?: ReadonlyArray<string>;
|
|
2427
2849
|
id?: string;
|
|
2428
2850
|
}>;
|
|
2429
2851
|
readonly retryPolicy: RetryPolicySpec;
|
|
@@ -2450,11 +2872,22 @@ declare class HttpRequest<TInputJson$1 = Readonly<{
|
|
|
2450
2872
|
/** Request body specification. For canvas use, pass a JSON string in `body.data`. */
|
|
2451
2873
|
body?: HttpBodySpec;
|
|
2452
2874
|
/**
|
|
2453
|
-
* Credential slot
|
|
2454
|
-
*
|
|
2455
|
-
*
|
|
2875
|
+
* Credential slot.
|
|
2876
|
+
*
|
|
2877
|
+
* **String shorthand** (existing): `credentialSlot: "auth"` — the slot accepts all four
|
|
2878
|
+
* default HTTP credential types (bearer, API-key, basic, OAuth2).
|
|
2879
|
+
*
|
|
2880
|
+
* **Object form** (new): narrows the accepted types to the caller-supplied list, useful
|
|
2881
|
+
* when only a subset of credential types makes sense for a specific endpoint.
|
|
2882
|
+
* ```ts
|
|
2883
|
+
* credentialSlot: { name: "auth", acceptedTypes: [bearerTokenCredentialType] }
|
|
2884
|
+
* ```
|
|
2885
|
+
* The slot must be declared in `getCredentialRequirements()`, which is wired automatically.
|
|
2456
2886
|
*/
|
|
2457
|
-
credentialSlot?: string
|
|
2887
|
+
credentialSlot?: string | Readonly<{
|
|
2888
|
+
name: string;
|
|
2889
|
+
acceptedTypes?: ReadonlyArray<AnyCredentialType>;
|
|
2890
|
+
}>;
|
|
2458
2891
|
binaryName?: string;
|
|
2459
2892
|
downloadMode?: HttpRequestDownloadMode;
|
|
2460
2893
|
/**
|
|
@@ -2478,6 +2911,23 @@ declare class HttpRequest<TInputJson$1 = Readonly<{
|
|
|
2478
2911
|
* Requests whose `Content-Length` exceeds this cap are rejected before the body is read.
|
|
2479
2912
|
*/
|
|
2480
2913
|
responseSizeCapBytes?: number;
|
|
2914
|
+
/**
|
|
2915
|
+
* Operator-configurable outbound host allowlist.
|
|
2916
|
+
*
|
|
2917
|
+
* When set, every HTTP request target must match an entry in this list before the
|
|
2918
|
+
* request is made — requests to any other host are rejected with {@link SSRFBlockedError}.
|
|
2919
|
+
* Supports exact hostnames (`api.example.com`) and wildcard subdomain patterns
|
|
2920
|
+
* (`*.example.com` matches `sub.example.com` but not `example.com` itself).
|
|
2921
|
+
*
|
|
2922
|
+
* When unset (default), the existing SSRF private-network guard applies:
|
|
2923
|
+
* public hosts are allowed and private/loopback ranges are blocked.
|
|
2924
|
+
*
|
|
2925
|
+
* **Production warning**: when `NODE_ENV === "production"` and this is unset, a one-time
|
|
2926
|
+
* warning is logged at workflow startup.
|
|
2927
|
+
*
|
|
2928
|
+
* Setting this to an empty array `[]` is equivalent to "block everything".
|
|
2929
|
+
*/
|
|
2930
|
+
allowedOutboundHosts?: ReadonlyArray<string>;
|
|
2481
2931
|
id?: string;
|
|
2482
2932
|
}>, retryPolicy?: RetryPolicySpec);
|
|
2483
2933
|
get id(): string | undefined;
|
|
@@ -2488,7 +2938,9 @@ declare class HttpRequest<TInputJson$1 = Readonly<{
|
|
|
2488
2938
|
get responseFormat(): "json" | "text" | "binary" | undefined;
|
|
2489
2939
|
get responseBinarySlot(): string;
|
|
2490
2940
|
get responseSizeCapBytes(): number;
|
|
2941
|
+
get allowedOutboundHosts(): ReadonlyArray<string> | undefined;
|
|
2491
2942
|
getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
|
|
2943
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2492
2944
|
}
|
|
2493
2945
|
//#endregion
|
|
2494
2946
|
//#region src/nodes/AggregateNode.d.ts
|
|
@@ -2511,6 +2963,7 @@ declare class Aggregate<TIn = unknown, TOut = unknown> implements RunnableNodeCo
|
|
|
2511
2963
|
readonly keepBinaries: true;
|
|
2512
2964
|
readonly icon: "builtin:aggregate-rows";
|
|
2513
2965
|
constructor(name: string, aggregate: (items: Items<TIn>, ctx: NodeExecutionContext<Aggregate<TIn, TOut>>) => TOut | Promise<TOut>, id?: string | undefined);
|
|
2966
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
2514
2967
|
}
|
|
2515
2968
|
//#endregion
|
|
2516
2969
|
//#region src/nodes/FilterNode.d.ts
|
|
@@ -2532,6 +2985,7 @@ declare class Filter<TIn = unknown> implements RunnableNodeConfig<TIn, TIn> {
|
|
|
2532
2985
|
};
|
|
2533
2986
|
readonly icon: "lucide:filter";
|
|
2534
2987
|
constructor(name: string, predicate: (item: Item<TIn>, index: number, items: Items<TIn>, ctx: NodeExecutionContext<Filter<TIn>>) => boolean, id?: string | undefined);
|
|
2988
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
2535
2989
|
}
|
|
2536
2990
|
//#endregion
|
|
2537
2991
|
//#region src/nodes/IfNode.d.ts
|
|
@@ -2553,6 +3007,7 @@ declare class If<TInputJson$1 = unknown> implements RunnableNodeConfig<TInputJso
|
|
|
2553
3007
|
readonly icon: "lucide:split@rot=90";
|
|
2554
3008
|
readonly declaredOutputPorts: readonly ["true", "false"];
|
|
2555
3009
|
constructor(name: string, predicate: (item: Item<TInputJson$1>, index: number, items: Items<TInputJson$1>, ctx: NodeExecutionContext<If<TInputJson$1>>) => boolean, id?: string | undefined);
|
|
3010
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
2556
3011
|
}
|
|
2557
3012
|
//#endregion
|
|
2558
3013
|
//#region src/nodes/IsTestRunNode.d.ts
|
|
@@ -2618,6 +3073,7 @@ declare class Switch<TInputJson$1 = unknown> implements RunnableNodeConfig<TInpu
|
|
|
2618
3073
|
defaultCase: string;
|
|
2619
3074
|
resolveCaseKey: SwitchCaseKeyResolver<TInputJson$1>;
|
|
2620
3075
|
}>, id?: string | undefined);
|
|
3076
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2621
3077
|
}
|
|
2622
3078
|
//#endregion
|
|
2623
3079
|
//#region src/nodes/SplitNode.d.ts
|
|
@@ -2645,6 +3101,7 @@ declare class Split<TIn = unknown, TElem = unknown> implements RunnableNodeConfi
|
|
|
2645
3101
|
readonly continueWhenEmptyOutput: true;
|
|
2646
3102
|
readonly icon: "builtin:split-rows";
|
|
2647
3103
|
constructor(name: string, getElements: (item: Item<TIn>, ctx: NodeExecutionContext<Split<TIn, TElem>>) => readonly TElem[], id?: string | undefined);
|
|
3104
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
2648
3105
|
}
|
|
2649
3106
|
//#endregion
|
|
2650
3107
|
//#region src/nodes/CronTriggerFactory.d.ts
|
|
@@ -2675,6 +3132,7 @@ declare class CronTrigger implements TriggerNodeConfig<CronTickJson> {
|
|
|
2675
3132
|
get schedule(): string;
|
|
2676
3133
|
get timezone(): string | undefined;
|
|
2677
3134
|
createJob(callback: CronCallback): Cron;
|
|
3135
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2678
3136
|
}
|
|
2679
3137
|
//#endregion
|
|
2680
3138
|
//#region src/nodes/CronTriggerNode.d.ts
|
|
@@ -2716,6 +3174,7 @@ declare class ManualTrigger<TOutputJson$1 = unknown> implements TriggerNodeConfi
|
|
|
2716
3174
|
constructor(name: string, defaultItems: ManualTriggerDefaultValue<TOutputJson$1>, id?: string);
|
|
2717
3175
|
private static resolveDefaultItems;
|
|
2718
3176
|
private static resolveId;
|
|
3177
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2719
3178
|
}
|
|
2720
3179
|
//#endregion
|
|
2721
3180
|
//#region src/nodes/MapDataNode.d.ts
|
|
@@ -2746,6 +3205,7 @@ declare class MapData<TInputJson$1 = unknown, TOutputJson$1 = unknown> implement
|
|
|
2746
3205
|
readonly keepBinaries: boolean;
|
|
2747
3206
|
constructor(name: string, map: (item: Item<TInputJson$1>, ctx: NodeExecutionContext<MapData<TInputJson$1, TOutputJson$1>>) => TOutputJson$1, options?: MapDataOptions);
|
|
2748
3207
|
get id(): string | undefined;
|
|
3208
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
2749
3209
|
}
|
|
2750
3210
|
//#endregion
|
|
2751
3211
|
//#region src/nodes/MergeNode.d.ts
|
|
@@ -2779,6 +3239,7 @@ declare class Merge<TInputJson$1 = unknown, TOutputJson$1 = TInputJson$1> implem
|
|
|
2779
3239
|
*/
|
|
2780
3240
|
prefer?: ReadonlyArray<InputPortKey>;
|
|
2781
3241
|
}>, id?: string | undefined);
|
|
3242
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2782
3243
|
}
|
|
2783
3244
|
//#endregion
|
|
2784
3245
|
//#region src/nodes/NoOpNode.d.ts
|
|
@@ -2825,6 +3286,7 @@ declare class SubWorkflow<TInputJson$1 = unknown, TOutputJson$1 = unknown> imple
|
|
|
2825
3286
|
constructor(name: string, workflowId: string, upstreamRefs?: Array<{
|
|
2826
3287
|
nodeId: NodeId;
|
|
2827
3288
|
} | UpstreamRefPlaceholder> | undefined, startAt?: NodeId | undefined, id?: string | undefined);
|
|
3289
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2828
3290
|
}
|
|
2829
3291
|
//#endregion
|
|
2830
3292
|
//#region src/nodes/TestTriggerNode.d.ts
|
|
@@ -2890,6 +3352,7 @@ declare class TestTrigger<TOutputJson$1 = unknown> implements TestTriggerNodeCon
|
|
|
2890
3352
|
private readonly credentialRequirements;
|
|
2891
3353
|
constructor(options: TestTriggerOptions<TOutputJson$1>);
|
|
2892
3354
|
getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
|
|
3355
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
2893
3356
|
}
|
|
2894
3357
|
//#endregion
|
|
2895
3358
|
//#region src/nodes/WaitDurationFactory.d.ts
|
|
@@ -2918,6 +3381,7 @@ declare class Wait<TItemJson = unknown> implements RunnableNodeConfig<TItemJson,
|
|
|
2918
3381
|
readonly continueWhenEmptyOutput: true;
|
|
2919
3382
|
readonly icon: "lucide:hourglass";
|
|
2920
3383
|
constructor(name: string, milliseconds: number, id?: string | undefined);
|
|
3384
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2921
3385
|
}
|
|
2922
3386
|
//#endregion
|
|
2923
3387
|
//#region src/nodes/webhookRespondNowAndContinueError.d.ts
|
|
@@ -2947,7 +3411,7 @@ declare class WebhookTrigger<TSchema extends WebhookInputSchema | undefined = un
|
|
|
2947
3411
|
readonly id?: string | undefined;
|
|
2948
3412
|
readonly kind: "trigger";
|
|
2949
3413
|
readonly type: TypeToken<unknown>;
|
|
2950
|
-
readonly icon = "lucide:
|
|
3414
|
+
readonly icon = "lucide:globe";
|
|
2951
3415
|
constructor(name: string, args: Readonly<{
|
|
2952
3416
|
endpointKey: string;
|
|
2953
3417
|
methods: ReadonlyArray<HttpMethod>;
|
|
@@ -2958,6 +3422,7 @@ declare class WebhookTrigger<TSchema extends WebhookInputSchema | undefined = un
|
|
|
2958
3422
|
get inputSchema(): TSchema | undefined;
|
|
2959
3423
|
parseJsonBody(body: unknown): unknown;
|
|
2960
3424
|
private static defaultHandler;
|
|
3425
|
+
inspectorSummary(): ReadonlyArray<NodeInspectorSummaryRow>;
|
|
2961
3426
|
}
|
|
2962
3427
|
//#endregion
|
|
2963
3428
|
//#region src/nodes/webhookTriggerNode.d.ts
|
|
@@ -3128,7 +3593,8 @@ declare class ConnectionCredentialNodeConfigFactory {
|
|
|
3128
3593
|
*/
|
|
3129
3594
|
declare class AIAgentConnectionWorkflowExpander {
|
|
3130
3595
|
private readonly connectionCredentialNodeConfigFactory;
|
|
3131
|
-
|
|
3596
|
+
private readonly mcpServerResolver?;
|
|
3597
|
+
constructor(connectionCredentialNodeConfigFactory: ConnectionCredentialNodeConfigFactory, mcpServerResolver?: McpServerResolver | undefined);
|
|
3132
3598
|
expand(workflow: WorkflowDefinition): WorkflowDefinition;
|
|
3133
3599
|
private createConnectionsByParentAndName;
|
|
3134
3600
|
private collectExistingChildIds;
|
|
@@ -3198,5 +3664,5 @@ declare const collectionDeleteNode: DefinedNode<"collection-delete", {
|
|
|
3198
3664
|
id: string;
|
|
3199
3665
|
}, undefined>;
|
|
3200
3666
|
//#endregion
|
|
3201
|
-
export { AIAgent, AIAgentConnectionWorkflowExpander, AIAgentExecutionHelpersFactory, AIAgentNode, AgentItemPortMap, AgentMessageFactory, AgentOutputFactory, AgentStructuredOutputRepairPromptFactory, AgentStructuredOutputRunner, AgentToolCallPortMap, AgentToolErrorClassifier, AgentToolExecutionCoordinator, AgentToolRepairExhaustedError, AgentToolRepairPolicy, Aggregate, AggregateNode, Assertion, AssertionNode, AssertionOptions, BinaryRef, Callback, CallbackHandler, CallbackNode, CallbackOptions, CallbackResultNormalizer, CanvasIconName, ConnectionCredentialExecutionContextFactory, ConnectionCredentialNode, ConnectionCredentialNodeConfig, ConnectionCredentialNodeConfigFactory, CredentialSession, CronTickJson, CronTrigger, CronTriggerNode, DefineRestNodeOptions, type ExecutedToolCall, Filter, FilterNode, HTTP_REQUEST_ACCEPTED_CREDENTIAL_TYPES, HttpBodySpec, HttpCredentialDelta, HttpRequest, HttpRequestDownloadMode, HttpRequestNode, HttpRequestOutputJson, HttpRequestResult, HttpRequestSpec, If, IfNode, IsTestRun, IsTestRunNode, type ItemScopedToolBinding, ManualTrigger, ManualTriggerNode, MapData, MapDataNode, MapDataOptions, Merge, MergeMode, MergeNode, NoOp, NoOpNode, OpenAIChatModelConfig, OpenAIChatModelFactory, OpenAiChatModelPresets, OpenAiCredentialSession, OpenAiStrictJsonSchemaFactory, type PlannedToolCall, type ResolvedTool, RestNodeApi, RestNodeErrorPolicy, RestNodeRequestShape, RestNodeResponseContext, Split, SplitNode, SubWorkflow, SubWorkflowNode, Switch, SwitchCaseKeyResolver, SwitchNode, TestTrigger, TestTriggerNode, TestTriggerOptions, Wait, WaitDuration, WaitNode, WebhookRespondNowAndContinueError, WebhookRespondNowError, WebhookTrigger, WebhookTriggerNode, type WorkflowAgentMessages, type WorkflowAgentOptions, WorkflowAuthoringBuilder, WorkflowBranchBuilder, WorkflowChain, apiKeyCredentialType, basicAuthCredentialType, bearerTokenCredentialType, collectionDeleteNode, collectionFindOneNode, collectionGetNode, collectionInsertNode, collectionListNode, collectionUpdateNode, createWorkflowBuilder, defineRestNode, oauth2ClientCredentialsType, openAiChatModelPresets, registerCoreNodes, workflow };
|
|
3667
|
+
export { AIAgent, AIAgentConnectionWorkflowExpander, AIAgentExecutionHelpersFactory, AIAgentNode, AgentItemPortMap, AgentMessageFactory, AgentOutputFactory, AgentStructuredOutputRepairPromptFactory, AgentStructuredOutputRunner, AgentToolCallPortMap, AgentToolErrorClassifier, AgentToolExecutionCoordinator, AgentToolRepairExhaustedError, AgentToolRepairPolicy, Aggregate, AggregateNode, Assertion, AssertionNode, AssertionOptions, BM25Index, BinaryRef, Callback, CallbackHandler, CallbackNode, CallbackOptions, CallbackResultNormalizer, CanvasIconName, CodemationChatModelConfig, CodemationChatModelFactory, CodemationManagedModel, ConnectionCredentialExecutionContextFactory, ConnectionCredentialNode, ConnectionCredentialNodeConfig, ConnectionCredentialNodeConfigFactory, CredentialSession, CronTickJson, CronTrigger, CronTriggerNode, DeferredMetaToolStrategy, DeferredMetaToolStrategyFactory, DefineRestNodeOptions, type ExecutedToolCall, Filter, FilterNode, type FindToolsResult, HTTP_REQUEST_ACCEPTED_CREDENTIAL_TYPES, HttpBodySpec, HttpCredentialDelta, HttpRequest, HttpRequestDownloadMode, HttpRequestNode, HttpRequestOutputJson, HttpRequestResult, HttpRequestSpec, If, IfNode, IsTestRun, IsTestRunNode, type ItemScopedToolBinding, ManagedModelDto, ManagedModelFetcher, ManualTrigger, ManualTriggerNode, MapData, MapDataNode, MapDataOptions, Merge, MergeMode, MergeNode, NoOp, NoOpNode, OpenAIChatModelConfig, OpenAIChatModelFactory, OpenAiChatModelPresets, OpenAiCredentialSession, OpenAiStrictJsonSchemaFactory, type PlannedToolCall, type ResolvedTool, RestNodeApi, RestNodeErrorPolicy, RestNodeRequestShape, RestNodeResponseContext, SSRFBlockedError, Split, SplitNode, SsrfGuard, SubWorkflow, SubWorkflowNode, Switch, SwitchCaseKeyResolver, SwitchNode, TestTrigger, TestTriggerNode, TestTriggerOptions, type ToolLoadingStrategy, type ToolLoadingStrategyInitInput, type ToolLoadingStrategyTurnContext, Wait, WaitDuration, WaitNode, WebhookRespondNowAndContinueError, WebhookRespondNowError, WebhookTrigger, WebhookTriggerNode, type WorkflowAgentMessages, type WorkflowAgentOptions, WorkflowAuthoringBuilder, WorkflowBranchBuilder, WorkflowChain, apiKeyCredentialType, basicAuthCredentialType, bearerTokenCredentialType, collectionDeleteNode, collectionFindOneNode, collectionGetNode, collectionInsertNode, collectionListNode, collectionUpdateNode, createWorkflowBuilder, defineRestNode, oauth2ClientCredentialsType, openAiChatModelPresets, registerCoreNodes, workflow };
|
|
3202
3668
|
//# sourceMappingURL=index.d.ts.map
|