@codemation/core 0.11.0 → 0.12.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 +16 -0
- package/dist/CostCatalogContract-DD7fQ4FF.d.cts +19 -0
- package/dist/{EngineRuntimeRegistration.types-MPYWsEM0.d.cts → EngineRuntimeRegistration.types-DTV5_7Jw.d.cts} +3 -2
- package/dist/{EngineRuntimeRegistration.types-BZ_1XWAJ.d.ts → EngineRuntimeRegistration.types-Dl92Hdoi.d.ts} +2 -2
- package/dist/InMemoryRunDataFactory-qMiYjhCK.d.cts +202 -0
- package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js → InMemoryRunEventBusRegistry-Bwunvt1T.js} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js.map → InMemoryRunEventBusRegistry-Bwunvt1T.js.map} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs → InMemoryRunEventBusRegistry-Sa86VxuV.cjs} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map → InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map} +1 -1
- package/dist/ItemsInputNormalizer-BhuxvZh5.js +36 -0
- package/dist/ItemsInputNormalizer-BhuxvZh5.js.map +1 -0
- package/dist/ItemsInputNormalizer-C09a7iFP.d.ts +321 -0
- package/dist/ItemsInputNormalizer-DLaD6rTl.d.cts +407 -0
- package/dist/ItemsInputNormalizer-Div-fb6a.cjs +43 -0
- package/dist/ItemsInputNormalizer-Div-fb6a.cjs.map +1 -0
- package/dist/RunIntentService-BOSGwmqn.d.ts +299 -0
- package/dist/RunIntentService-CWMMrAP4.d.cts +220 -0
- package/dist/{RunIntentService-MUHJ1bhO.d.cts → agentMcpTypes-DUmniLOY.d.cts} +183 -206
- package/dist/bootstrap/index.cjs +4 -2
- package/dist/bootstrap/index.d.cts +63 -5
- package/dist/bootstrap/index.d.ts +5 -4
- package/dist/bootstrap/index.js +4 -2
- package/dist/{bootstrap-Dgzsjoj7.js → bootstrap-CKTMMNmL.js} +174 -3
- package/dist/bootstrap-CKTMMNmL.js.map +1 -0
- package/dist/{bootstrap-dVmpU1ju.cjs → bootstrap-D460dCgS.cjs} +209 -36
- package/dist/bootstrap-D460dCgS.cjs.map +1 -0
- package/dist/browser.cjs +17 -0
- package/dist/browser.d.cts +4 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +4 -0
- package/dist/contracts-CK0x6w_G.cjs +74 -0
- package/dist/contracts-CK0x6w_G.cjs.map +1 -0
- package/dist/contracts-DXdfTdpW.js +50 -0
- package/dist/contracts-DXdfTdpW.js.map +1 -0
- package/dist/contracts.cjs +6 -0
- package/dist/contracts.d.cts +5 -0
- package/dist/contracts.d.ts +2 -0
- package/dist/contracts.js +3 -0
- package/dist/di-DdsgWfVy.js +405 -0
- package/dist/di-DdsgWfVy.js.map +1 -0
- package/dist/di-tO6R7VJV.cjs +524 -0
- package/dist/di-tO6R7VJV.cjs.map +1 -0
- package/dist/executionPersistenceContracts-DenJJK2T.d.cts +275 -0
- package/dist/{index-Bes88mxT.d.ts → index-BZDhEQ6W.d.ts} +278 -415
- package/dist/{RunIntentService-BrEq6Jm6.d.ts → index-CSKKuK60.d.ts} +441 -286
- package/dist/index.cjs +97 -250
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +395 -803
- package/dist/index.d.ts +5 -3
- package/dist/index.js +58 -224
- package/dist/index.js.map +1 -1
- package/dist/params-DqRvku2h.d.cts +44 -0
- package/dist/{runtime-Duf3ClPw.js → runtime-BPZgnZ9G.js} +591 -382
- package/dist/runtime-BPZgnZ9G.js.map +1 -0
- package/dist/{runtime-vH0EeZzH.cjs → runtime-CyW9c9XM.cjs} +651 -500
- package/dist/runtime-CyW9c9XM.cjs.map +1 -0
- package/dist/testing.cjs +23 -21
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +3 -2
- package/dist/testing.d.ts +3 -2
- package/dist/testing.js +5 -3
- package/dist/testing.js.map +1 -1
- package/package.json +9 -5
- package/src/ai/AgentConnectionNodeCollector.ts +1 -1
- package/src/authoring/defineHumanApprovalNode.types.ts +379 -0
- package/src/authoring/index.ts +6 -0
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +29 -0
- package/src/contracts/CodemationTelemetryAttributeNames.ts +10 -0
- package/src/contracts/credentialTypes.ts +10 -0
- package/src/contracts/hitlSeamTypes.ts +34 -0
- package/src/contracts/humanTaskStoreTypes.ts +48 -0
- package/src/contracts/inboxChannelTypes.ts +58 -0
- package/src/contracts/index.ts +3 -0
- package/src/contracts/runTypes.ts +61 -3
- package/src/contracts/runtimeTypes.ts +112 -0
- package/src/credentials/CredentialMaterialProvider.types.ts +61 -0
- package/src/credentials/ManagedCredentialMaterialWriteError.ts +14 -0
- package/src/credentials/ManagedMaterialFetchError.ts +16 -0
- package/src/execution/ActivationEnqueueService.ts +16 -0
- package/src/execution/DefaultExecutionContextFactory.ts +11 -0
- package/src/execution/NodeExecutionSnapshotFactory.ts +7 -1
- package/src/execution/NodeExecutor.ts +60 -1
- package/src/execution/NodeExecutorFactory.ts +12 -2
- package/src/execution/NodeSuspensionHandler.ts +220 -0
- package/src/execution/PersistedRunStateTerminalBuilder.ts +5 -2
- package/src/execution/RunStateSemantics.ts +5 -0
- package/src/execution/RunSuspendedError.ts +21 -0
- package/src/index.ts +40 -0
- package/src/orchestration/Engine.ts +12 -2
- package/src/orchestration/EngineWaiters.ts +1 -1
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +25 -2
- package/src/orchestration/RunContinuationService.ts +226 -2
- package/src/orchestration/TestSuiteOrchestrator.ts +5 -4
- package/src/runtime/RunIntentService.ts +3 -0
- package/src/workflow/dsl/ChainCursorResolver.ts +36 -0
- package/tsdown.config.ts +1 -1
- package/dist/InMemoryRunDataFactory-hmkh0lzR.d.cts +0 -138
- package/dist/bootstrap-Dgzsjoj7.js.map +0 -1
- package/dist/bootstrap-dVmpU1ju.cjs.map +0 -1
- package/dist/runtime-Duf3ClPw.js.map +0 -1
- package/dist/runtime-vH0EeZzH.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,346 +1,12 @@
|
|
|
1
|
-
import { $ as injectAll, $n as
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
1
|
+
import { $ as injectAll, $n as NodeActivationRequestBase, $r as GenAiTelemetryAttributeNames, $t as RunnableNodeConfig, A as RunHaltReason, Ai as CredentialRequirement, An as BinaryBody, Ar as HttpMethod, At as JsonValue, B as WorkflowExecutionListingRepository, Bi as OAuth2ProviderFromPublicConfig, Bn as ExecutionBinaryService, Br as ExecutionTelemetryFactory, Bt as NodeIterationId, C as PersistedWorkflowSnapshotNode, Ci as CredentialHealthTester, Cn as triggerNodeOutputType, Cr as TriggerTestItemsContext, Ct as Item, D as RunCurrentState, Di as CredentialMaterialSourceKind, Dn as NoneRetryPolicySpec, Dr as WorkflowRunnerService, Dt as JsonNonArray, E as RunCompletionNotifier, Ei as CredentialJsonRecord, En as FixedRetryPolicySpec, Er as WorkflowRunnerResolver, Et as JsonArray, F as RunStatus, Fi as CredentialType, Fn as BinaryStorageWriteResult, Fr as WebhookTriggerResolution, Ft as NodeErrorHandler, G as Disposable, Gi as NodeConnectionName, Gn as HumanTaskId, Gr as TelemetryAttributes, Gt as NodeSchedulerDecision, H as WorkflowExecutionRepository, Hi as PollingTriggerLogger, Hn as ExecutionContextFactory, Hr as TelemetryArtifactAttachment, Ht as NodeOffloadPolicy, I as RunStopCondition, Ii as CredentialTypeDefinition, In as Duration, Ir as WebhookTriggerRoutingDiagnostics, It as NodeErrorHandlerArgs, J as RegistrationOptions, Ji as PersistedTokenId, Jn as LiveWorkflowRepository, Jr as TelemetryScope, Jt as PersistedRunPolicySnapshot, K as InjectionToken, Ki as NodeId, Kn as HumanTaskSubject, Kr as TelemetryChildSpanStart, Kt as PairedItemRef, L as RunSummary, Li as CredentialTypeId, Ln as EngineDeps, Lr as AllWorkflowsActiveWorkflowActivationPolicy, Lt as NodeErrorHandlerSpec, M as RunQueueEntry, Mi as CredentialSessionFactoryArgs, Mn as BinaryStorageReadResult, Mr as WebhookControlSignal, Mt as NodeActivationId, N as RunResult, Ni as CredentialSessionService, Nn as BinaryStorageStatResult, Nr as WebhookInvocationMatch, Nt as NodeConfigBase, O as RunEventPublisherDeps, Oi as CredentialOAuth2AuthDefinition, On as RetryPolicySpec, Or as WorkflowSnapshotFactory, Ot as JsonObject, P as RunStateResetRequest, Pi as CredentialSetupStatus, Pn as BinaryStorageWriteRequest, Pr as WebhookTriggerMatcher, Pt as NodeDefinition, Q as inject, Qn as NodeActivationRequest, Qr as CodemationTelemetryMetricNames, Qt as RunIdFactory, R as RunTestContext, Ri as CredentialTypeRegistry, Rn as EngineHost, Rr as WorkflowActivationPolicy, Rt as NodeIdRef, S as PersistedWorkflowSnapshot, Si as CredentialHealthStatus, Sn as runnableNodeOutputType, Sr as TriggerSetupStateRepository, St as ExecutionMode, T as PinnedNodeOutputsByPort, Ti as CredentialInstanceRecord, Tn as ExponentialRetryPolicySpec, Tr as WorkflowRepository, Tt as Items, U as Container, Ui as PollingTriggerDedupWindow, Un as HumanTaskActor, Ur as TelemetryArtifactReference, Ut as NodeOutputs, V as WorkflowExecutionPruneRepository, Vi as NoOpPollingTriggerLogger, Vn as ExecutionContext, Vr as NodeExecutionTelemetry, Vt as NodeKind, W as DependencyContainer, Wi as InputPortKey, Wn as HumanTaskHandle, Wr as TelemetryAttributePrimitive, Wt as NodeRef, X as container, Xn as NodeActivationContinuation, Xr as TelemetrySpanEventRecord, Xt as RunDataSnapshot, Y as TypeToken, Yi as WorkflowId, Yn as MultiInputNode, Yr as TelemetrySpanEnd, Yt as RunDataFactory, Z as delay, Zn as NodeActivationReceipt, Zr as TelemetrySpanScope, Zt as RunId, _ as PersistedMutableRunState, _i as CredentialAuthDefinition, _n as WorkflowStoragePolicyResolver, _r as TriggerCleanupHandle, _t as TestTriggerSetupContext, a as ConnectionInvocationId, ai as NoOpTelemetryArtifactReference, an as UpstreamRefPlaceholder, ar as NodeExecutionScheduler, at as singleton, b as PersistedRunState, bi as CredentialFieldSchema, bn as nodeRef, br as TriggerSetupContext, bt as BinaryPreviewKind, c as EngineRunCounters, ci as CostTrackingTelemetry, cn as WorkflowErrorHandler, cr as NodeResolver, ct as EngineExecutionLimitsPolicy, d as NodeExecutionSnapshot, di as CostTrackingTelemetryMetricNames, dn as WorkflowGraphFactory, dr as PreparedNodeActivationDispatch, dt as RunEventBus, ei as CodemationTelemetryAttributeNames, en as RunnableNodeInputJson, er as NodeActivationScheduler, et as injectable, f as NodeExecutionStatus, fi as CostTrackingUsageRecord, fn as WorkflowNodeConnection, fr as ResumeContext, ft as RunEventSubscription, g as PersistedMutableNodeState, gi as CredentialAdvancedSectionPresentation, gn as WorkflowStoragePolicyMode, gr as TestableTriggerNode, gt as TestTriggerNodeConfig, h as PendingResumeEntry, hi as AnyCredentialType, hn as WorkflowStoragePolicyDecisionArgs, hr as SuspensionRequest, ht as TestSuiteRunId, i as ConnectionInvocationAppendArgs, ii as NoOpTelemetrySpanScope, in as TriggerNodeSetupState, ir as NodeExecutionRequestHandler, it as registry, j as RunPruneCandidate, ji as CredentialSessionFactory, jn as BinaryStorage, jr as TriggerInstanceId, jt as MutableRunData, k as RunExecutionOptions, ki as CredentialOAuth2ScopesFromPublicConfig, kn as BinaryAttachmentCreateRequest, kr as WorkflowSnapshotResolver, kt as JsonPrimitive, l as ExecutionFrontierPlan, li as CostTrackingTelemetryAttributeNames, ln as WorkflowErrorHandlerSpec, lr as PersistedTriggerSetupState, lt as EngineExecutionLimitsPolicyConfig, m as PendingNodeExecution, mi as CollectionsContext, mn as WorkflowPrunePolicySpec, mr as RunnableNodeExecuteArgs, mt as TestSuiteRunStatus, n as AgentMcpToolMap, ni as NoOpExecutionTelemetry, nn as TriggerNodeConfig, nr as NodeExecutionContext, nt as instancePerContainerCachingFactory, o as ConnectionInvocationRecord, oi as CostTrackingComponent, on as WorkflowDefinition, or as NodeExecutionStatePublisher, ot as CoreTokens, p as NodeInputsByPort, pi as CollectionStore, pn as WorkflowPolicyRuntimeDefaults, pr as RunnableNode, pt as TestCaseRunStatus, q as Lifecycle, qi as OutputPortKey, qn as ItemNode, qr as TelemetryMetricRecord, qt as ParentExecutionRef, r as NeedsReconsentEvent, ri as NoOpNodeExecutionTelemetry, rn as TriggerNodeOutputJson, rr as NodeExecutionRequest, rt as predicateAwareClassFactory, s as CurrentStateExecutionRequest, si as CostTrackingPriceQuote, sn as WorkflowErrorContext, sr as NodeExecutor, t as AgentMcpIntegration, ti as NoOpExecutionTelemetryFactory, tn as RunnableNodeOutputJson, tr as NodeBinaryAttachmentService, tt as instanceCachingFactory, u as NodeExecutionError, ui as CostTrackingTelemetryFactory, un as WorkflowGraph, ur as PollingTriggerHandle, ut as RunEvent, v as PersistedRunControlState, vi as CredentialBinding, vn as WorkflowStoragePolicySpec, vr as TriggerNode, vt as ActivationIdFactory, w as PersistedWorkflowTokenRegistryLike, wi as CredentialInstanceId, wn as triggerNodeSetupStateType, wr as WorkflowNodeInstanceFactory, wt as ItemBinary, x as PersistedSuspensionEntry, xi as CredentialHealth, xn as runnableNodeInputType, xr as TriggerSetupStateFor, xt as Edge, y as PersistedRunSchedulingState, yi as CredentialBindingKey, yn as branchRef, yr as TriggerRuntimeDiagnostics, yt as BinaryAttachment, z as WebhookRunResult, zi as CredentialUnboundError, zn as ExecutableTriggerNode, zr as ExecutionTelemetry, zt as NodeInspectorSummaryRow } from "./agentMcpTypes-DUmniLOY.cjs";
|
|
2
|
+
import { C as deriveAssertionPassed, S as DEFAULT_ASSERTION_PASS_THRESHOLD, T as AgentBindError, _ as WorkItemStatus, a as ExecutionPayloadPolicyFields, b as AssertionResult, c as PersistedExecutionInstanceRecord, d as PersistedRunWorkItemRecord, f as RunIterationDto, g as WorkItemId, h as SlotExecutionStateDto, i as ExecutionInstanceId, l as PersistedRunSlotProjectionRecord, m as RunSlotProjectionState, n as ConnectionInvocationKind, o as PayloadStorageKind, p as RunRevision, r as ExecutionInstanceDto, s as PersistedExecutionInstanceKind, t as BatchId, u as PersistedRunWorkItemKind, v as WorkflowDetailSelectionState, w as NoOpAgentMcpIntegration, x as AssertionResultProvenance, y as WorkflowRunDetailDto } from "./executionPersistenceContracts-DenJJK2T.cjs";
|
|
3
|
+
import { a as ItemExprArgs, c as ItemExprResolvedContext, d as resolveItemExprsForExecution, f as resolveItemExprsInUnknown, i as ItemExpr, l as isItemExpr, n as Param, o as ItemExprCallback, r as ParamDeep, s as ItemExprContext, t as Expr, u as itemExpr } from "./params-DqRvku2h.cjs";
|
|
4
|
+
import { n as CostCatalogEntry, t as CostCatalog } from "./CostCatalogContract-DD7fQ4FF.cjs";
|
|
5
|
+
import { $ as McpServerDeclaration, A as ChatModelFactory, B as ZodSchemaAny, C as AgentToolDefinition, D as ChatLanguageModel, E as AgentTurnLimitBehavior, F as NodeBackedToolOutputMapperArgs, G as CallableToolFactory, H as AgentMessageConfigNormalizer, I as StructuredOutputOptions, J as CallableToolExecuteHandler, K as CallableToolConfig, L as Tool, M as NodeBackedToolInputMapper, N as NodeBackedToolInputMapperArgs, O as ChatLanguageModelCallOptions, P as NodeBackedToolOutputMapper, Q as RunFinishedAtFactory, R as ToolConfig, S as AgentToolCallPlanner, T as AgentToolToken, U as AgentToolFactory, V as AgentConfigInspector, W as CallableToolKindToken, X as NodeIterationIdFactory, Y as NodeBackedToolConfig, Z as ConnectionNodeIdFactory, _ as AgentMessageTemplateContent, a as AgentConnectionNodeRole, b as AgentTool, c as AgentCanvasPresentation, d as AgentMessageBuildArgs, et as McpServerTransport, f as AgentMessageConfig, g as AgentMessageTemplate, h as AgentMessageRole, i as AgentConnectionNodeDescriptor, j as NodeBackedToolConfigOptions, k as ChatModelConfig, l as AgentGuardrailConfig, m as AgentMessageLine, n as AgentConnectionCredentialSource, o as McpServerResolver, p as AgentMessageDto, q as CallableToolConfigOptions, r as AgentConnectionNodeCollector, s as AgentAttachmentRole, t as ItemsInputNormalizer, u as AgentGuardrailDefaults, v as AgentModelInvocationOptions, w as AgentToolExecuteArgs, x as AgentToolCall, y as AgentNodeConfig, z as ToolExecuteArgs } from "./ItemsInputNormalizer-DLaD6rTl.cjs";
|
|
6
|
+
import { n as InMemoryLiveWorkflowRepository, t as RunIntentService } from "./RunIntentService-CWMMrAP4.cjs";
|
|
7
|
+
import { _ as HumanTaskRecord, a as ItemExprResolver, b as HumanTaskStoreToken, c as DefaultAsyncSleeper, d as UnavailableBinaryStorage, f as HitlResumeTokenSignerSeam, g as HitlWorkspaceIdToken, h as HitlTimeoutJobSchedulerToken, i as RunnableOutputBehaviorResolver, m as HitlTimeoutJobSchedulerSeam, n as InMemoryBinaryStorage, o as InProcessRetryRunner, p as HitlResumeTokenSignerToken, r as RunnableOutputBehavior, s as DefaultExecutionContextFactory, t as InMemoryRunDataFactory, u as DefaultExecutionBinaryService, v as HumanTaskStatus, x as CredentialResolverFactory, y as HumanTaskStore } from "./InMemoryRunDataFactory-qMiYjhCK.cjs";
|
|
8
|
+
import { ZodType, z } from "zod";
|
|
4
9
|
|
|
5
|
-
//#region src/contracts/AgentBindError.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Thrown at agent bind time when mcpServers declarations cannot be resolved.
|
|
8
|
-
* Causes include: unknown server id, missing credential instance, insufficient scopes,
|
|
9
|
-
* and ambiguous shorthand binding (multiple credential instances match).
|
|
10
|
-
*/
|
|
11
|
-
declare class AgentBindError extends Error {
|
|
12
|
-
constructor(message: string);
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/contracts/NoOpAgentMcpIntegration.d.ts
|
|
16
|
-
/**
|
|
17
|
-
* No-op implementation of AgentMcpIntegration.
|
|
18
|
-
* Registered by the core engine runtime as a fallback when the host does not
|
|
19
|
-
* supply a real implementation (e.g. in unit tests or headless engine setups).
|
|
20
|
-
* Always returns an empty tool map so the agent runs with node-backed tools only.
|
|
21
|
-
*/
|
|
22
|
-
declare class NoOpAgentMcpIntegration implements AgentMcpIntegration {
|
|
23
|
-
prepareMcpTools(): Promise<AgentMcpToolMap>;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/contracts/assertionTypes.d.ts
|
|
27
|
-
/**
|
|
28
|
-
* One assertion emitted by an assertion-emitting node (a node whose config sets
|
|
29
|
-
* `emitsAssertions: true`). Each emitted item on `main` carries one of these as `item.json`.
|
|
30
|
-
*
|
|
31
|
-
* Pass/fail is derived from `score >= (passThreshold ?? 0.5)` — see {@link deriveAssertionPassed}.
|
|
32
|
-
* The `errored` marker is for cases where the assertion code itself threw (distinct from
|
|
33
|
-
* "the assertion was evaluated and the score was low") and is treated as a hard fail in rollups
|
|
34
|
-
* regardless of `score`.
|
|
35
|
-
*/
|
|
36
|
-
interface AssertionResult {
|
|
37
|
-
readonly name: string;
|
|
38
|
-
/** 0..1 score. Source of truth for pass/fail (compared against `passThreshold`). */
|
|
39
|
-
readonly score: number;
|
|
40
|
-
/** 0..1 threshold for "passed". When omitted, consumers default to 0.5. */
|
|
41
|
-
readonly passThreshold?: number;
|
|
42
|
-
/** True when evaluating the assertion threw — treated as fail regardless of `score`. */
|
|
43
|
-
readonly errored?: true;
|
|
44
|
-
/** What the assertion expected. Free-form JSON; UIs render with a JSON viewer. */
|
|
45
|
-
readonly expected?: JsonValue;
|
|
46
|
-
/** What the workflow actually produced. */
|
|
47
|
-
readonly actual?: JsonValue;
|
|
48
|
-
/** Short human-readable explanation, especially for fails / errors. */
|
|
49
|
-
readonly message?: string;
|
|
50
|
-
/** Bag of supplemental fields (e.g. judge prompt, judge raw response, comparison method). */
|
|
51
|
-
readonly details?: Readonly<Record<string, JsonValue>>;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Default {@link AssertionResult.passThreshold} when authors omit it. Boolean-style assertions
|
|
55
|
-
* (assertEqual / contains / etc.) emit `score: 1` or `score: 0` so this default works for them;
|
|
56
|
-
* AI-judge assertions are expected to set their own threshold.
|
|
57
|
-
*/
|
|
58
|
-
declare const DEFAULT_ASSERTION_PASS_THRESHOLD = 0.5;
|
|
59
|
-
/**
|
|
60
|
-
* Derive whether an assertion result is considered "passing" using the score-based contract:
|
|
61
|
-
* `errored` always fails, otherwise `score >= (passThreshold ?? 0.5)`. This is the canonical
|
|
62
|
-
* derivation — UI and rollup code should call it rather than inlining the comparison so future
|
|
63
|
-
* tweaks (e.g. NaN handling) land in one place.
|
|
64
|
-
*/
|
|
65
|
-
declare function deriveAssertionPassed(result: {
|
|
66
|
-
readonly score: number;
|
|
67
|
-
readonly passThreshold?: number;
|
|
68
|
-
readonly errored?: true;
|
|
69
|
-
}): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Provenance for a persisted {@link AssertionResult}: which node produced it and where in the
|
|
72
|
-
* per-item iteration tree it landed. Filled in by the host-side persister, not the node itself.
|
|
73
|
-
*/
|
|
74
|
-
interface AssertionResultProvenance {
|
|
75
|
-
readonly nodeId: NodeId;
|
|
76
|
-
/** Per-item iteration id when the emitting node ran inside a per-item loop. */
|
|
77
|
-
readonly iterationId?: string;
|
|
78
|
-
/** Item index (0-based) within the activation that produced this assertion. */
|
|
79
|
-
readonly itemIndex?: number;
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/contracts/itemExpr.d.ts
|
|
83
|
-
declare const ITEM_EXPR_BRAND: unique symbol;
|
|
84
|
-
type ItemExprResolvedContext = Readonly<{
|
|
85
|
-
runId: RunId;
|
|
86
|
-
workflowId: WorkflowId;
|
|
87
|
-
nodeId: NodeId;
|
|
88
|
-
activationId: NodeActivationId;
|
|
89
|
-
data: RunDataSnapshot;
|
|
90
|
-
}>;
|
|
91
|
-
/**
|
|
92
|
-
* Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
|
|
93
|
-
*/
|
|
94
|
-
type ItemExprContext = ItemExprResolvedContext;
|
|
95
|
-
type ItemExprArgs<TItemJson = unknown> = Readonly<{
|
|
96
|
-
item: Item<TItemJson>;
|
|
97
|
-
itemIndex: number;
|
|
98
|
-
items: Items<TItemJson>;
|
|
99
|
-
ctx: ItemExprContext;
|
|
100
|
-
}>;
|
|
101
|
-
type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;
|
|
102
|
-
type ItemExpr<T, TItemJson = unknown> = Readonly<{
|
|
103
|
-
readonly [ITEM_EXPR_BRAND]: true;
|
|
104
|
-
readonly fn: ItemExprCallback<T, TItemJson>;
|
|
105
|
-
}>;
|
|
106
|
-
declare function itemExpr<T, TItemJson = unknown>(fn: ItemExprCallback<T, TItemJson>): ItemExpr<T, TItemJson>;
|
|
107
|
-
declare function isItemExpr<T, TItemJson = unknown>(value: unknown): value is ItemExpr<T, TItemJson>;
|
|
108
|
-
/**
|
|
109
|
-
* Deep-resolves {@link itemExpr} leaves. Returns a new graph (does not mutate the original config object).
|
|
110
|
-
*/
|
|
111
|
-
declare function resolveItemExprsInUnknown(value: unknown, args: ItemExprArgs, seen?: WeakSet<object>): Promise<unknown>;
|
|
112
|
-
/**
|
|
113
|
-
* Clones runnable config (best-effort) so per-item {@link itemExpr} resolution never mutates shared instances.
|
|
114
|
-
*/
|
|
115
|
-
declare function resolveItemExprsForExecution(config: unknown, nodeCtx: NodeExecutionContext, item: Item, itemIndex: number, items: Items): Promise<unknown | undefined>;
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region src/contracts/params.d.ts
|
|
118
|
-
type Expr<T, TItemJson = unknown> = ItemExpr<T, TItemJson>;
|
|
119
|
-
type Param<T, TItemJson = unknown> = T | Expr<T, TItemJson>;
|
|
120
|
-
type ParamDeep<T, TItemJson = unknown> = Expr<T, TItemJson> | (T extends readonly (infer U)[] ? ReadonlyArray<ParamDeep<U, TItemJson>> : never) | (T extends object ? { [K in keyof T]: ParamDeep<T[K], TItemJson> } : T);
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/contracts/executionPersistenceContracts.d.ts
|
|
123
|
-
/** Canonical id for persisted execution rows (activation or connection invocation). */
|
|
124
|
-
type ExecutionInstanceId = string;
|
|
125
|
-
/** Stable id for persisted work-queue rows. */
|
|
126
|
-
type WorkItemId = string;
|
|
127
|
-
/** Batch grouping for planner activations. */
|
|
128
|
-
type BatchId = string;
|
|
129
|
-
/** Optimistic concurrency on the run root. */
|
|
130
|
-
type RunRevision = number;
|
|
131
|
-
type PersistedRunWorkItemKind = "queue" | "pending";
|
|
132
|
-
type WorkItemStatus = "queued" | "claimed" | "completed" | "failed" | "cancelled";
|
|
133
|
-
type PersistedExecutionInstanceKind = "workflowNodeActivation" | "connectionInvocation";
|
|
134
|
-
type ConnectionInvocationKind = "languageModel" | "tool" | "nestedAgent";
|
|
135
|
-
type PayloadStorageKind = "inline" | "external" | "omitted";
|
|
136
|
-
/**
|
|
137
|
-
* Persisted run-work-queue row (queue entry or pending activation).
|
|
138
|
-
* Serialized to {@link RunWorkItem} in Prisma; engine still uses {@link PersistedRunState} queue + pending.
|
|
139
|
-
*/
|
|
140
|
-
interface PersistedRunWorkItemRecord {
|
|
141
|
-
readonly workItemId: WorkItemId;
|
|
142
|
-
readonly runId: RunId;
|
|
143
|
-
readonly workflowId: WorkflowId;
|
|
144
|
-
readonly kind: PersistedRunWorkItemKind;
|
|
145
|
-
readonly orderIndex: number;
|
|
146
|
-
readonly status: WorkItemStatus;
|
|
147
|
-
readonly queueName?: string;
|
|
148
|
-
readonly claimToken?: string;
|
|
149
|
-
readonly claimedBy?: string;
|
|
150
|
-
readonly claimedAt?: string;
|
|
151
|
-
readonly availableAt: string;
|
|
152
|
-
readonly enqueuedAt: string;
|
|
153
|
-
readonly completedAt?: string;
|
|
154
|
-
readonly failedAt?: string;
|
|
155
|
-
readonly sourceInstanceId?: ExecutionInstanceId;
|
|
156
|
-
readonly parentInstanceId?: ExecutionInstanceId;
|
|
157
|
-
readonly itemsIn: number;
|
|
158
|
-
/** Queue entry when kind is queue; pending activation when kind is pending. */
|
|
159
|
-
readonly payloadJson: string;
|
|
160
|
-
readonly error?: Readonly<NodeExecutionError>;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Payload policy fields for large-batch externalization (optional on first rollout).
|
|
164
|
-
*/
|
|
165
|
-
interface ExecutionPayloadPolicyFields {
|
|
166
|
-
readonly inputStorageKind: PayloadStorageKind;
|
|
167
|
-
readonly outputStorageKind: PayloadStorageKind;
|
|
168
|
-
readonly inputBytes?: number;
|
|
169
|
-
readonly outputBytes?: number;
|
|
170
|
-
readonly inputPreviewJson?: unknown;
|
|
171
|
-
readonly outputPreviewJson?: unknown;
|
|
172
|
-
readonly inputPayloadRef?: string;
|
|
173
|
-
readonly outputPayloadRef?: string;
|
|
174
|
-
readonly inputTruncated?: boolean;
|
|
175
|
-
readonly outputTruncated?: boolean;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* One persisted execution row (workflow node activation or connection invocation).
|
|
179
|
-
*/
|
|
180
|
-
interface PersistedExecutionInstanceRecord {
|
|
181
|
-
readonly instanceId: ExecutionInstanceId;
|
|
182
|
-
readonly runId: RunId;
|
|
183
|
-
readonly workflowId: WorkflowId;
|
|
184
|
-
readonly slotNodeId: NodeId;
|
|
185
|
-
readonly workflowNodeId: NodeId;
|
|
186
|
-
readonly kind: PersistedExecutionInstanceKind;
|
|
187
|
-
readonly connectionKind?: ConnectionInvocationKind;
|
|
188
|
-
readonly activationId?: NodeActivationId;
|
|
189
|
-
readonly batchId: BatchId;
|
|
190
|
-
readonly runIndex: number;
|
|
191
|
-
readonly parentInstanceId?: ExecutionInstanceId;
|
|
192
|
-
readonly parentRunId?: RunId;
|
|
193
|
-
readonly workerClaimToken?: string;
|
|
194
|
-
readonly status: NodeExecutionStatus;
|
|
195
|
-
readonly queuedAt?: string;
|
|
196
|
-
readonly startedAt?: string;
|
|
197
|
-
readonly finishedAt?: string;
|
|
198
|
-
readonly updatedAt: string;
|
|
199
|
-
readonly itemCount: number;
|
|
200
|
-
readonly inputJson?: string;
|
|
201
|
-
readonly outputJson?: string;
|
|
202
|
-
readonly errorJson?: string;
|
|
203
|
-
readonly inputItemIndicesJson?: string;
|
|
204
|
-
readonly outputItemCount?: number;
|
|
205
|
-
readonly successfulItemCount?: number;
|
|
206
|
-
readonly failedItemCount?: number;
|
|
207
|
-
readonly truncatedInputPreviewJson?: string;
|
|
208
|
-
readonly truncatedOutputPreviewJson?: string;
|
|
209
|
-
readonly inputTruncated?: boolean;
|
|
210
|
-
readonly outputTruncated?: boolean;
|
|
211
|
-
readonly usedPinnedOutput?: boolean;
|
|
212
|
-
readonly payloadPolicy?: ExecutionPayloadPolicyFields;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Cached slot projection for planner/debugger/UI (not canonical history).
|
|
216
|
-
*/
|
|
217
|
-
interface RunSlotProjectionState {
|
|
218
|
-
readonly runId: RunId;
|
|
219
|
-
readonly workflowId: WorkflowId;
|
|
220
|
-
readonly revision: RunRevision;
|
|
221
|
-
readonly slotStatesByNodeId: Record<NodeId, Readonly<{
|
|
222
|
-
latestInstanceId?: ExecutionInstanceId;
|
|
223
|
-
latestTerminalInstanceId?: ExecutionInstanceId;
|
|
224
|
-
latestRunningInstanceId?: ExecutionInstanceId;
|
|
225
|
-
latestStatus?: NodeExecutionStatus;
|
|
226
|
-
invocationCount: number;
|
|
227
|
-
runCount: number;
|
|
228
|
-
}>>;
|
|
229
|
-
}
|
|
230
|
-
interface PersistedRunSlotProjectionRecord {
|
|
231
|
-
readonly runId: RunId;
|
|
232
|
-
readonly workflowId: WorkflowId;
|
|
233
|
-
readonly revision: RunRevision;
|
|
234
|
-
readonly updatedAt: string;
|
|
235
|
-
readonly slotStatesJson: string;
|
|
236
|
-
}
|
|
237
|
-
interface WorkflowRunDetailDto {
|
|
238
|
-
readonly runId: RunId;
|
|
239
|
-
readonly workflowId: WorkflowId;
|
|
240
|
-
readonly startedAt: string;
|
|
241
|
-
readonly finishedAt?: string;
|
|
242
|
-
readonly status: RunStatus;
|
|
243
|
-
readonly workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
244
|
-
readonly mutableState?: PersistedMutableRunState;
|
|
245
|
-
readonly slotStates: ReadonlyArray<SlotExecutionStateDto>;
|
|
246
|
-
readonly executionInstances: ReadonlyArray<ExecutionInstanceDto>;
|
|
247
|
-
readonly iterations?: ReadonlyArray<RunIterationDto>;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Per-item iteration projected from connection invocations and node activations.
|
|
251
|
-
*
|
|
252
|
-
* One iteration = one item processed by an agent within an activation. Multiple invocations
|
|
253
|
-
* (LLM rounds, tool calls) belonging to the same iteration share the iterationId.
|
|
254
|
-
*/
|
|
255
|
-
interface RunIterationDto {
|
|
256
|
-
readonly iterationId: string;
|
|
257
|
-
readonly agentNodeId: NodeId;
|
|
258
|
-
readonly activationId: NodeActivationId;
|
|
259
|
-
readonly itemIndex: number;
|
|
260
|
-
readonly itemSummary?: string;
|
|
261
|
-
readonly status: NodeExecutionStatus;
|
|
262
|
-
readonly startedAt?: string;
|
|
263
|
-
readonly finishedAt?: string;
|
|
264
|
-
readonly invocationIds: ReadonlyArray<string>;
|
|
265
|
-
readonly parentInvocationId?: string;
|
|
266
|
-
/** Estimated cost rolled up from telemetry cost metric points, keyed by ISO currency code (e.g. "USD"). Values are minor units (cents-of-cents per the metric's `cost.currency_scale`). */
|
|
267
|
-
readonly estimatedCostMinorByCurrency?: Readonly<Record<string, number>>;
|
|
268
|
-
/** Currency scale (denominator) per currency, when present on the metric points. Joined with `estimatedCostMinorByCurrency` to format human-readable amounts. */
|
|
269
|
-
readonly estimatedCostCurrencyScaleByCurrency?: Readonly<Record<string, number>>;
|
|
270
|
-
}
|
|
271
|
-
interface SlotExecutionStateDto {
|
|
272
|
-
readonly slotNodeId: NodeId;
|
|
273
|
-
readonly latestInstanceId?: ExecutionInstanceId;
|
|
274
|
-
readonly latestTerminalInstanceId?: ExecutionInstanceId;
|
|
275
|
-
readonly latestRunningInstanceId?: ExecutionInstanceId;
|
|
276
|
-
readonly status?: NodeExecutionStatus;
|
|
277
|
-
readonly invocationCount: number;
|
|
278
|
-
readonly runCount: number;
|
|
279
|
-
}
|
|
280
|
-
interface ExecutionInstanceDto {
|
|
281
|
-
readonly instanceId: ExecutionInstanceId;
|
|
282
|
-
readonly slotNodeId: NodeId;
|
|
283
|
-
readonly workflowNodeId: NodeId;
|
|
284
|
-
readonly parentInstanceId?: ExecutionInstanceId;
|
|
285
|
-
readonly kind: PersistedExecutionInstanceKind;
|
|
286
|
-
readonly connectionKind?: ConnectionInvocationKind;
|
|
287
|
-
readonly runIndex: number;
|
|
288
|
-
readonly batchId: BatchId;
|
|
289
|
-
readonly activationId?: NodeActivationId;
|
|
290
|
-
readonly status: NodeExecutionStatus;
|
|
291
|
-
readonly queuedAt?: string;
|
|
292
|
-
readonly startedAt?: string;
|
|
293
|
-
readonly finishedAt?: string;
|
|
294
|
-
readonly itemCount: number;
|
|
295
|
-
readonly inputJson?: JsonValue;
|
|
296
|
-
readonly outputJson?: JsonValue;
|
|
297
|
-
readonly error?: Readonly<NodeExecutionError>;
|
|
298
|
-
/** Per-item iteration that produced this instance. Set on connectionInvocation rows produced inside per-item runnable loops. */
|
|
299
|
-
readonly iterationId?: string;
|
|
300
|
-
/** Item index (0-based) of the iteration. */
|
|
301
|
-
readonly itemIndex?: number;
|
|
302
|
-
/** Parent invocation id when this instance was emitted by a sub-agent triggered by an outer LLM/tool call. */
|
|
303
|
-
readonly parentInvocationId?: string;
|
|
304
|
-
/**
|
|
305
|
-
* When this instance is a SubWorkflow node activation, the run id of the child run it spawned.
|
|
306
|
-
* Used by the UI to deep-link directly to the child execution.
|
|
307
|
-
*/
|
|
308
|
-
readonly childRunId?: string;
|
|
309
|
-
}
|
|
310
|
-
interface WorkflowDetailSelectionState {
|
|
311
|
-
readonly selectedSlotNodeId: NodeId | null;
|
|
312
|
-
readonly selectedInstanceId: ExecutionInstanceId | null;
|
|
313
|
-
}
|
|
314
|
-
//#endregion
|
|
315
|
-
//#region src/contracts/mcpTypes.d.ts
|
|
316
|
-
type McpServerTransport = "http";
|
|
317
|
-
interface McpServerDeclaration {
|
|
318
|
-
/** Globally unique slug, e.g. "gmail". Workflow authors reference this. */
|
|
319
|
-
id: string;
|
|
320
|
-
displayName: string;
|
|
321
|
-
description: string;
|
|
322
|
-
transport: McpServerTransport;
|
|
323
|
-
url: string;
|
|
324
|
-
/**
|
|
325
|
-
* Credential types accepted by this MCP server, matching CredentialRequirement.acceptedTypes.
|
|
326
|
-
* Absent or empty means no credential is required.
|
|
327
|
-
*/
|
|
328
|
-
acceptedCredentialTypes?: ReadonlyArray<string>;
|
|
329
|
-
/**
|
|
330
|
-
* Documentation only in MVP. The bind-time validator checks
|
|
331
|
-
* requiredScopes ⊆ CredentialInstance.scopesGranted.
|
|
332
|
-
*/
|
|
333
|
-
requiredScopes?: string[];
|
|
334
|
-
/** Non-secret static headers merged onto every MCP request. */
|
|
335
|
-
staticHeaders?: Record<string, string>;
|
|
336
|
-
/**
|
|
337
|
-
* Overrides for tool descriptions advertised by the MCP server.
|
|
338
|
-
* Applied by the connection pool after tools/list.
|
|
339
|
-
* Key: exact tool name as returned by the server.
|
|
340
|
-
*/
|
|
341
|
-
toolDescriptionOverrides?: Record<string, string>;
|
|
342
|
-
}
|
|
343
|
-
//#endregion
|
|
344
10
|
//#region src/contracts/emitPorts.d.ts
|
|
345
11
|
declare const EMIT_PORTS_BRAND: unique symbol;
|
|
346
12
|
type PortsEmission = Readonly<{
|
|
@@ -400,12 +66,243 @@ declare class NoOpCostTrackingTelemetryFactory implements CostTrackingTelemetryF
|
|
|
400
66
|
}>): CostTrackingTelemetry;
|
|
401
67
|
}
|
|
402
68
|
//#endregion
|
|
403
|
-
//#region src/
|
|
404
|
-
type
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
69
|
+
//#region src/authoring/defineNode.types.d.ts
|
|
70
|
+
type MaybePromise$2<TValue> = TValue | Promise<TValue>;
|
|
71
|
+
type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
|
|
72
|
+
type SessionForCredentialType<TCredential extends ResolvableCredentialType> = TCredential extends AnyCredentialType ? Awaited<ReturnType<TCredential["createSession"]>> : unknown;
|
|
73
|
+
type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
|
|
74
|
+
readonly type: ResolvableCredentialType | ReadonlyArray<ResolvableCredentialType>;
|
|
75
|
+
readonly label?: string;
|
|
76
|
+
readonly optional?: true;
|
|
77
|
+
readonly helpText?: string;
|
|
78
|
+
readonly helpUrl?: string;
|
|
79
|
+
}>;
|
|
80
|
+
type DefinedNodeCredentialBindings = Readonly<Record<string, DefinedNodeCredentialBinding>>;
|
|
81
|
+
type SessionForBinding<TBinding extends DefinedNodeCredentialBinding> = TBinding extends Readonly<{
|
|
82
|
+
type: infer TType;
|
|
83
|
+
}> ? TType extends ReadonlyArray<infer TEntry> ? SessionForCredentialType<TEntry & ResolvableCredentialType> : SessionForCredentialType<TType & ResolvableCredentialType> : SessionForCredentialType<TBinding & ResolvableCredentialType>;
|
|
84
|
+
type DefinedNodeCredentialAccessors<TBindings extends DefinedNodeCredentialBindings | undefined> = TBindings extends DefinedNodeCredentialBindings ? Readonly<{ [TKey in keyof TBindings]: () => Promise<SessionForBinding<TBindings[TKey]>> }> : Readonly<Record<string, never>>;
|
|
85
|
+
interface DefinedNodeRunContext<TConfig$1 extends CredentialJsonRecord, TBindings extends DefinedNodeCredentialBindings | undefined> {
|
|
86
|
+
readonly config: TConfig$1;
|
|
87
|
+
readonly credentials: DefinedNodeCredentialAccessors<TBindings>;
|
|
88
|
+
readonly execution: NodeExecutionContext<RunnableNodeConfig<TConfig$1, unknown>>;
|
|
408
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Arguments for {@link defineNode} `execute` (engine `ctx` matches {@link RunnableNode.execute};
|
|
92
|
+
* the second callback parameter adds {@link DefinedNodeRunContext} for credential accessors).
|
|
93
|
+
*/
|
|
94
|
+
type DefineNodeExecuteArgs<TConfig$1 extends CredentialJsonRecord, TInputJson> = Readonly<{
|
|
95
|
+
input: TInputJson;
|
|
96
|
+
item: Item;
|
|
97
|
+
itemIndex: number;
|
|
98
|
+
items: Items;
|
|
99
|
+
ctx: NodeExecutionContext<RunnableNodeConfig<TInputJson, unknown> & Readonly<{
|
|
100
|
+
config: TConfig$1;
|
|
101
|
+
}>>;
|
|
102
|
+
}>;
|
|
103
|
+
type DefinedNodeConfigInput<TConfigResolved extends CredentialJsonRecord, TItemJson> = ParamDeep<TConfigResolved, TItemJson>;
|
|
104
|
+
interface DefinedNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
105
|
+
readonly kind: "defined-node";
|
|
106
|
+
readonly key: TKey$1;
|
|
107
|
+
readonly title: string;
|
|
108
|
+
readonly description?: string;
|
|
109
|
+
create<TConfigItemJson = TInputJson>(config: DefinedNodeConfigInput<TConfig$1, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson, TOutputJson>;
|
|
110
|
+
register(context: {
|
|
111
|
+
registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
|
|
112
|
+
}): void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Plugin / DSL-friendly node: per-item `execute` with optional {@link RunnableNodeConfig.inputSchema}.
|
|
116
|
+
*/
|
|
117
|
+
interface DefineNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
118
|
+
readonly key: TKey$1;
|
|
119
|
+
readonly title: string;
|
|
120
|
+
readonly description?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Canvas icon for this node (same contract as `NodeConfigBase.icon` on runnable configs).
|
|
123
|
+
* The Next host resolves Lucide (`lucide:…`), built-in SVGs (`builtin:…`), Simple Icons (`si:…`), and image URLs (`https:`, `data:`, `/…`).
|
|
124
|
+
*/
|
|
125
|
+
readonly icon?: string;
|
|
126
|
+
/** Default values / form hints for **static** node configuration (credentials, retry, IDs), not per-item payload. */
|
|
127
|
+
readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
|
|
128
|
+
readonly configSchema?: z.ZodType<TConfig$1>;
|
|
129
|
+
readonly credentials?: TBindings;
|
|
130
|
+
/**
|
|
131
|
+
* Validates **`input`** (engine also accepts `inputSchema` on the node class).
|
|
132
|
+
*/
|
|
133
|
+
readonly inputSchema?: ZodType<TInputJson>;
|
|
134
|
+
/** Preserve inbound `item.binary` when `execute` returns plain JSON or item-shaped results without `binary`. */
|
|
135
|
+
readonly keepBinaries?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Static configuration summary surfaced in the workflow inspector — see
|
|
138
|
+
* {@link import("../contracts/workflowTypes").NodeConfigBase.inspectorSummary}.
|
|
139
|
+
*
|
|
140
|
+
* Receives the static config; returns 2–6 short label/value pairs (or `undefined` to skip).
|
|
141
|
+
*/
|
|
142
|
+
readonly inspectorSummary?: (args: Readonly<{
|
|
143
|
+
config: TConfig$1;
|
|
144
|
+
}>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
145
|
+
execute(args: DefineNodeExecuteArgs<TConfig$1, TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<TOutputJson>;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Batch-oriented defined node: `run` receives all item JSON once (last item in activation); emits one output per input row.
|
|
149
|
+
*/
|
|
150
|
+
interface DefineBatchNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
151
|
+
readonly key: TKey$1;
|
|
152
|
+
readonly title: string;
|
|
153
|
+
readonly description?: string;
|
|
154
|
+
readonly icon?: string;
|
|
155
|
+
readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
|
|
156
|
+
readonly configSchema?: z.ZodType<TConfig$1>;
|
|
157
|
+
readonly credentials?: TBindings;
|
|
158
|
+
readonly inspectorSummary?: (args: Readonly<{
|
|
159
|
+
config: TConfig$1;
|
|
160
|
+
}>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
161
|
+
run(items: ReadonlyArray<TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<ReadonlyArray<TOutputJson>>;
|
|
162
|
+
}
|
|
163
|
+
declare function defineNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
|
|
164
|
+
declare function defineBatchNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineBatchNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/authoring/defineHumanApprovalNode.types.d.ts
|
|
167
|
+
/**
|
|
168
|
+
* Decision shape merged into `item.json` after a HITL approval task resolves.
|
|
169
|
+
*
|
|
170
|
+
* - `"approved"` / `"rejected"` — from a human decision (uses `approvedPredicate`).
|
|
171
|
+
* - `"timed-out"` — timeout fired with `onTimeout: "halt"`.
|
|
172
|
+
* - `"auto-accepted"` — timeout fired with `onTimeout: "auto-accept"`.
|
|
173
|
+
*/
|
|
174
|
+
interface HumanApprovalDecisionResult {
|
|
175
|
+
readonly status: "approved" | "rejected" | "timed-out" | "auto-accepted";
|
|
176
|
+
/** Identity of the person who decided; absent for automated outcomes. */
|
|
177
|
+
readonly actor?: HumanTaskActor;
|
|
178
|
+
/** ISO 8601 timestamp of the decision. */
|
|
179
|
+
readonly decidedAt?: Date;
|
|
180
|
+
/** Optional free-text note from the reviewer. */
|
|
181
|
+
readonly note?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Full raw decision payload (only present for `"approved"` / `"rejected"`).
|
|
184
|
+
* Shape is determined by the channel's `decisionSchema`.
|
|
185
|
+
*/
|
|
186
|
+
readonly payload?: Record<string, unknown>;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Output item shape emitted by a `defineHumanApprovalNode`-based node.
|
|
190
|
+
* Original `item.json` fields are preserved and `decision` is merged in.
|
|
191
|
+
* If the input `item.json` already contained a `decision` key it is **overwritten**.
|
|
192
|
+
*/
|
|
193
|
+
type HumanApprovalOutputJson<TInputJson extends Record<string, unknown>> = TInputJson & {
|
|
194
|
+
readonly decision: HumanApprovalDecisionResult;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Extends {@link DefinedNode} with the `humanApprovalToolBehavior` metadata marker.
|
|
198
|
+
* Story 10 reads this field when attaching the node as an agent tool.
|
|
199
|
+
*/
|
|
200
|
+
interface DefinedHumanApprovalNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson extends Record<string, unknown>, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> extends DefinedNode<TKey$1, TConfig$1, TInputJson, HumanApprovalOutputJson<TInputJson>, TBindings> {
|
|
201
|
+
/**
|
|
202
|
+
* Behavior hint consumed by the agent runtime (story 10) when this node is attached as a tool.
|
|
203
|
+
* `"return"` (default) — return the rejection to the agent as a tool result.
|
|
204
|
+
* `"halt"` — halt the agent run on rejection.
|
|
205
|
+
*
|
|
206
|
+
* Standalone DSL usage ignores this field.
|
|
207
|
+
*/
|
|
208
|
+
readonly humanApprovalToolBehavior: {
|
|
209
|
+
onRejected: "return" | "halt";
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Returns `true` when `node` was created by {@link defineHumanApprovalNode}.
|
|
214
|
+
* Uses the `humanApprovalToolBehavior` typed field as the discriminant.
|
|
215
|
+
*/
|
|
216
|
+
declare function isHumanApprovalNode(node: unknown): node is DefinedHumanApprovalNode<string, Record<string, unknown>, Record<string, unknown>, undefined>;
|
|
217
|
+
/**
|
|
218
|
+
* Authoring helper that compiles a HITL approval channel down to a regular
|
|
219
|
+
* {@link defineNode}-backed node with `SuspensionRequest` semantics.
|
|
220
|
+
*
|
|
221
|
+
* **Fast-forward decision semantics:**
|
|
222
|
+
* - On the first `execute` call (no `ctx.resumeContext`): throws a `SuspensionRequest`
|
|
223
|
+
* that calls the author's `deliver`. The engine persists the suspension and continues.
|
|
224
|
+
* - On resume (`ctx.resumeContext` set): calls `onDecision`/`onTimeout` as appropriate,
|
|
225
|
+
* merges a `decision` key into `item.json`, and returns an item with the original
|
|
226
|
+
* `binary` map passed by reference (no copy).
|
|
227
|
+
*
|
|
228
|
+
* **Output shape per item:**
|
|
229
|
+
* ```ts
|
|
230
|
+
* // Input: { json: { invoiceId: 42 }, binary?: {...} }
|
|
231
|
+
* // Output: { json: { invoiceId: 42, decision: { status: "approved", actor, decidedAt } }, binary: <unchanged> }
|
|
232
|
+
* ```
|
|
233
|
+
* If `item.json` already has a `decision` key it is **overwritten**. Namespace as
|
|
234
|
+
* needed if your schema reserves that key for another purpose.
|
|
235
|
+
*
|
|
236
|
+
* **Predicate persistence:**
|
|
237
|
+
* The `approvedPredicate` function is NOT serialized to the suspension record (except
|
|
238
|
+
* as an audit-only string via `toString()`). On resume, the workflow definition is
|
|
239
|
+
* reloaded from code at process start and the predicate closure is rebuilt naturally.
|
|
240
|
+
* If a deploy ships a changed predicate between suspend and resume, the *new* predicate
|
|
241
|
+
* runs — document this in your runbook when the predicate carries business logic that
|
|
242
|
+
* may change across deploys.
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```ts
|
|
246
|
+
* export const slackApprovalNode = defineHumanApprovalNode({
|
|
247
|
+
* key: "my-plugin.slackApproval",
|
|
248
|
+
* title: "Slack Approval",
|
|
249
|
+
* channel: "slack",
|
|
250
|
+
* configSchema: z.object({ channel: z.string(), message: z.string() }),
|
|
251
|
+
* decisionSchema: z.object({ approved: z.boolean(), note: z.string().optional() }),
|
|
252
|
+
*
|
|
253
|
+
* async deliver({ task, config, item }, ctx) {
|
|
254
|
+
* const ts = await postSlackMessage(config.channel, `Approve? <${task.resumeUrl}>`);
|
|
255
|
+
* return { channel: config.channel, ts };
|
|
256
|
+
* },
|
|
257
|
+
*
|
|
258
|
+
* async onDecision({ decision, actor, delivery }, ctx) {
|
|
259
|
+
* await updateSlackMessage(delivery.channel, delivery.ts, decision.approved ? "✅" : "❌");
|
|
260
|
+
* },
|
|
261
|
+
* });
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
declare function defineHumanApprovalNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson extends Record<string, unknown>, TDecision extends Record<string, unknown>, TDelivery extends JsonValue, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(opts: {
|
|
265
|
+
key: TKey$1;
|
|
266
|
+
title: string;
|
|
267
|
+
description?: string;
|
|
268
|
+
icon?: string;
|
|
269
|
+
channel: string;
|
|
270
|
+
configSchema: ZodType<TConfig$1>;
|
|
271
|
+
inputSchema?: ZodType<TInputJson>;
|
|
272
|
+
decisionSchema: ZodType<TDecision>;
|
|
273
|
+
credentials?: TBindings;
|
|
274
|
+
/**
|
|
275
|
+
* Custom predicate that decides whether a decision counts as "approved".
|
|
276
|
+
* When omitted, the helper checks if `decisionSchema` is a Zod object with an
|
|
277
|
+
* `approved: boolean` field; if so it uses `decision.approved === true`.
|
|
278
|
+
* If neither holds, `defineHumanApprovalNode` throws at **definition time** (not runtime).
|
|
279
|
+
*/
|
|
280
|
+
approvedPredicate?: (decision: TDecision) => boolean;
|
|
281
|
+
/** Default suspension timeout. Defaults to `"24h"`. */
|
|
282
|
+
defaultTimeout?: Duration;
|
|
283
|
+
/** What to do when the task times out. Defaults to `"halt"`. */
|
|
284
|
+
defaultOnTimeout?: "halt" | "auto-accept";
|
|
285
|
+
inspectorSummary?: (config: TConfig$1) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
286
|
+
deliver: (args: {
|
|
287
|
+
task: HumanTaskHandle;
|
|
288
|
+
config: TConfig$1;
|
|
289
|
+
input: TInputJson;
|
|
290
|
+
item: Item;
|
|
291
|
+
}, ctx: ExecutionContext) => Promise<TDelivery>;
|
|
292
|
+
onDecision?: (args: {
|
|
293
|
+
decision: TDecision;
|
|
294
|
+
actor: HumanTaskActor;
|
|
295
|
+
task: HumanTaskHandle;
|
|
296
|
+
delivery: TDelivery;
|
|
297
|
+
item: Item;
|
|
298
|
+
}, ctx: ExecutionContext) => Promise<void>;
|
|
299
|
+
onTimeout?: (args: {
|
|
300
|
+
task: HumanTaskHandle;
|
|
301
|
+
delivery: TDelivery;
|
|
302
|
+
item: Item;
|
|
303
|
+
policy: "halt" | "auto-accept";
|
|
304
|
+
}, ctx: ExecutionContext) => Promise<void>;
|
|
305
|
+
}): DefinedHumanApprovalNode<TKey$1, TConfig$1, TInputJson, TBindings>;
|
|
409
306
|
//#endregion
|
|
410
307
|
//#region src/workflow/dsl/workflowBuilderTypes.d.ts
|
|
411
308
|
type AnyRunnableNodeConfig = RunnableNodeConfig<any, any>;
|
|
@@ -452,6 +349,25 @@ declare class ChainCursor<TCurrentJson> {
|
|
|
452
349
|
thenIntoInputHints<TOutputJson, TConfig$1 extends RunnableNodeConfig<any, TOutputJson>>(config: TConfig$1): ChainCursor<RunnableNodeOutputJson<TConfig$1>>;
|
|
453
350
|
readonly when: ChainCursorWhenOverloads<TCurrentJson>;
|
|
454
351
|
route<TNextJson$1>(branches: Readonly<Record<OutputPortKey, (branch: ChainCursor<TCurrentJson>) => ChainCursor<TNextJson$1> | undefined>>): ChainCursor<TNextJson$1>;
|
|
352
|
+
/**
|
|
353
|
+
* Chainable shorthand for `.then(node.create(config, metadata?.name, metadata?.nodeId))`.
|
|
354
|
+
*
|
|
355
|
+
* Signals to readers that this step suspends the run and waits for a human decision.
|
|
356
|
+
* Throws at workflow-build time if `node` was not created via `defineHumanApprovalNode`.
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* workflow
|
|
361
|
+
* .trigger(...)
|
|
362
|
+
* .humanApproval(inboxApproval, { title: "Approve?", body: "...", priority: "normal" })
|
|
363
|
+
* .then(nextStep.create(...))
|
|
364
|
+
* .build();
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
367
|
+
humanApproval<TKey$1 extends string, TConfig$1 extends Record<string, unknown>, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(node: DefinedHumanApprovalNode<TKey$1, TConfig$1, TCurrentJson & Record<string, unknown>, TBindings>, config: TConfig$1, metadata?: {
|
|
368
|
+
name?: string;
|
|
369
|
+
nodeId?: string;
|
|
370
|
+
}): ChainCursor<HumanApprovalOutputJson<TCurrentJson & Record<string, unknown>>>;
|
|
455
371
|
build(): WorkflowDefinition;
|
|
456
372
|
private resolveSharedInputPortHint;
|
|
457
373
|
}
|
|
@@ -515,56 +431,6 @@ declare class ConnectionInvocationIdFactory {
|
|
|
515
431
|
static createForTest(runId: string, connectionNodeId: NodeId, sequence: number): string;
|
|
516
432
|
}
|
|
517
433
|
//#endregion
|
|
518
|
-
//#region src/workflow/definition/ConnectionNodeIdFactory.d.ts
|
|
519
|
-
/**
|
|
520
|
-
* Deterministic ids for workflow connection-owned child nodes (LLM slot, tools, etc.).
|
|
521
|
-
* These are stable across loads.
|
|
522
|
-
*/
|
|
523
|
-
declare class ConnectionNodeIdFactory {
|
|
524
|
-
static readonly connectionSegment: "__conn__";
|
|
525
|
-
static languageModelConnectionNodeId(parentNodeId: NodeId): NodeId;
|
|
526
|
-
static toolConnectionNodeId(parentNodeId: NodeId, toolName: string): NodeId;
|
|
527
|
-
static mcpConnectionNodeId(parentNodeId: NodeId, serverId: string): NodeId;
|
|
528
|
-
static isMcpConnectionNodeId(nodeId: NodeId): boolean;
|
|
529
|
-
static parseMcpConnectionNodeId(nodeId: NodeId): Readonly<{
|
|
530
|
-
parentNodeId: NodeId;
|
|
531
|
-
serverId: string;
|
|
532
|
-
}> | undefined;
|
|
533
|
-
static isLanguageModelConnectionNodeId(nodeId: NodeId): boolean;
|
|
534
|
-
static isToolConnectionNodeId(nodeId: NodeId): boolean;
|
|
535
|
-
static parseLanguageModelConnectionNodeId(nodeId: NodeId): Readonly<{
|
|
536
|
-
parentNodeId: NodeId;
|
|
537
|
-
}> | undefined;
|
|
538
|
-
static parseToolConnectionNodeId(nodeId: NodeId): Readonly<{
|
|
539
|
-
parentNodeId: NodeId;
|
|
540
|
-
normalizedToolName: string;
|
|
541
|
-
}> | undefined;
|
|
542
|
-
/** True when `nodeId` is a connection-owned child of `parentNodeId` (LLM or tool slot). */
|
|
543
|
-
static isConnectionOwnedDescendantOf(parentNodeId: NodeId, nodeId: NodeId): boolean;
|
|
544
|
-
/** Normalizes a tool display name to a stable id segment. */
|
|
545
|
-
static normalizeToolName(toolName: string): string;
|
|
546
|
-
}
|
|
547
|
-
//#endregion
|
|
548
|
-
//#region src/workflow/definition/NodeIterationIdFactory.d.ts
|
|
549
|
-
/**
|
|
550
|
-
* Unique ids for one per-item iteration of a runnable node's execute loop.
|
|
551
|
-
*
|
|
552
|
-
* Activations are per-batch (one scheduled execution of a node, possibly with N items).
|
|
553
|
-
* Iterations refine that to one identifier per item-index inside the batch loop, so per-item
|
|
554
|
-
* connection invocations and telemetry can be grouped without time-window heuristics.
|
|
555
|
-
*
|
|
556
|
-
* Uses Web Crypto's `randomUUID` (Node 19+ and all modern browsers) so this module is safe
|
|
557
|
-
* to include in the browser entry. Importing `node:crypto` here previously leaked into the
|
|
558
|
-
* canvas client bundle through `browser.ts` and OOM'd consumers' Turbopack builds.
|
|
559
|
-
*/
|
|
560
|
-
declare class NodeIterationIdFactory {
|
|
561
|
-
static create(): string;
|
|
562
|
-
/** Deterministic id for tests when a stable sequence is needed. */
|
|
563
|
-
static createForTest(seed: string, sequence: number): string;
|
|
564
|
-
/** Deterministic id derived from a connection node id (for sub-agent / tool-call scopes). */
|
|
565
|
-
static createForConnection(connectionNodeId: NodeId, sequence: number): string;
|
|
566
|
-
}
|
|
567
|
-
//#endregion
|
|
568
434
|
//#region src/workflow/definition/WorkflowExecutableNodeClassifier.d.ts
|
|
569
435
|
/**
|
|
570
436
|
* Derives which workflow nodes participate in the main execution graph vs connection-only children.
|
|
@@ -611,102 +477,58 @@ declare class SystemClock implements Clock {
|
|
|
611
477
|
now(): Date;
|
|
612
478
|
}
|
|
613
479
|
//#endregion
|
|
614
|
-
//#region src/
|
|
615
|
-
type MaybePromise$2<TValue> = TValue | Promise<TValue>;
|
|
616
|
-
type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
|
|
617
|
-
type SessionForCredentialType<TCredential extends ResolvableCredentialType> = TCredential extends AnyCredentialType ? Awaited<ReturnType<TCredential["createSession"]>> : unknown;
|
|
618
|
-
type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
|
|
619
|
-
readonly type: ResolvableCredentialType | ReadonlyArray<ResolvableCredentialType>;
|
|
620
|
-
readonly label?: string;
|
|
621
|
-
readonly optional?: true;
|
|
622
|
-
readonly helpText?: string;
|
|
623
|
-
readonly helpUrl?: string;
|
|
624
|
-
}>;
|
|
625
|
-
type DefinedNodeCredentialBindings = Readonly<Record<string, DefinedNodeCredentialBinding>>;
|
|
626
|
-
type SessionForBinding<TBinding extends DefinedNodeCredentialBinding> = TBinding extends Readonly<{
|
|
627
|
-
type: infer TType;
|
|
628
|
-
}> ? TType extends ReadonlyArray<infer TEntry> ? SessionForCredentialType<TEntry & ResolvableCredentialType> : SessionForCredentialType<TType & ResolvableCredentialType> : SessionForCredentialType<TBinding & ResolvableCredentialType>;
|
|
629
|
-
type DefinedNodeCredentialAccessors<TBindings extends DefinedNodeCredentialBindings | undefined> = TBindings extends DefinedNodeCredentialBindings ? Readonly<{ [TKey in keyof TBindings]: () => Promise<SessionForBinding<TBindings[TKey]>> }> : Readonly<Record<string, never>>;
|
|
630
|
-
interface DefinedNodeRunContext<TConfig$1 extends CredentialJsonRecord, TBindings extends DefinedNodeCredentialBindings | undefined> {
|
|
631
|
-
readonly config: TConfig$1;
|
|
632
|
-
readonly credentials: DefinedNodeCredentialAccessors<TBindings>;
|
|
633
|
-
readonly execution: NodeExecutionContext<RunnableNodeConfig<TConfig$1, unknown>>;
|
|
634
|
-
}
|
|
480
|
+
//#region src/contracts/inboxChannelTypes.d.ts
|
|
635
481
|
/**
|
|
636
|
-
*
|
|
637
|
-
*
|
|
482
|
+
* A single inbox delivery channel.
|
|
483
|
+
* Implementations: `LocalInboxChannel`, `ControlPlaneInboxChannel`.
|
|
638
484
|
*/
|
|
639
|
-
|
|
640
|
-
|
|
485
|
+
interface InboxChannel {
|
|
486
|
+
readonly kind: "local" | "control-plane-inbox";
|
|
487
|
+
deliver(args: InboxDeliverArgs): Promise<InboxDelivery>;
|
|
488
|
+
updateOnDecision?(args: InboxOnDecisionArgs): Promise<void>;
|
|
489
|
+
updateOnTimeout?(args: InboxOnTimeoutArgs): Promise<void>;
|
|
490
|
+
}
|
|
491
|
+
type InboxDeliverArgs = Readonly<{
|
|
492
|
+
task: HumanTaskHandle;
|
|
493
|
+
subject: HumanTaskSubject;
|
|
494
|
+
priority: "low" | "normal" | "high";
|
|
641
495
|
item: Item;
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
496
|
+
/** Present in managed mode (from `PairingConfig.workspaceId`). */
|
|
497
|
+
workspaceId?: string;
|
|
498
|
+
}>;
|
|
499
|
+
type InboxDelivery = {
|
|
500
|
+
kind: "local";
|
|
501
|
+
inboxItemId: string;
|
|
502
|
+
} | {
|
|
503
|
+
kind: "cp";
|
|
504
|
+
inboxItemId: string;
|
|
505
|
+
workspaceId: string;
|
|
506
|
+
};
|
|
507
|
+
type InboxOnDecisionArgs = Readonly<{
|
|
508
|
+
delivery: InboxDelivery;
|
|
509
|
+
decision: {
|
|
510
|
+
approved: boolean;
|
|
511
|
+
note?: string;
|
|
512
|
+
};
|
|
513
|
+
actor: HumanTaskActor;
|
|
514
|
+
}>;
|
|
515
|
+
type InboxOnTimeoutArgs = Readonly<{
|
|
516
|
+
delivery: InboxDelivery;
|
|
517
|
+
policy: "halt" | "auto-accept";
|
|
647
518
|
}>;
|
|
648
|
-
type DefinedNodeConfigInput<TConfigResolved extends CredentialJsonRecord, TItemJson> = ParamDeep<TConfigResolved, TItemJson>;
|
|
649
|
-
interface DefinedNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
650
|
-
readonly kind: "defined-node";
|
|
651
|
-
readonly key: TKey$1;
|
|
652
|
-
readonly title: string;
|
|
653
|
-
readonly description?: string;
|
|
654
|
-
create<TConfigItemJson = TInputJson>(config: DefinedNodeConfigInput<TConfig$1, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson, TOutputJson>;
|
|
655
|
-
register(context: {
|
|
656
|
-
registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
|
|
657
|
-
}): void;
|
|
658
|
-
}
|
|
659
|
-
/**
|
|
660
|
-
* Plugin / DSL-friendly node: per-item `execute` with optional {@link RunnableNodeConfig.inputSchema}.
|
|
661
|
-
*/
|
|
662
|
-
interface DefineNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
663
|
-
readonly key: TKey$1;
|
|
664
|
-
readonly title: string;
|
|
665
|
-
readonly description?: string;
|
|
666
|
-
/**
|
|
667
|
-
* Canvas icon for this node (same contract as `NodeConfigBase.icon` on runnable configs).
|
|
668
|
-
* The Next host resolves Lucide (`lucide:…`), built-in SVGs (`builtin:…`), Simple Icons (`si:…`), and image URLs (`https:`, `data:`, `/…`).
|
|
669
|
-
*/
|
|
670
|
-
readonly icon?: string;
|
|
671
|
-
/** Default values / form hints for **static** node configuration (credentials, retry, IDs), not per-item payload. */
|
|
672
|
-
readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
|
|
673
|
-
readonly configSchema?: z.ZodType<TConfig$1>;
|
|
674
|
-
readonly credentials?: TBindings;
|
|
675
|
-
/**
|
|
676
|
-
* Validates **`input`** (engine also accepts `inputSchema` on the node class).
|
|
677
|
-
*/
|
|
678
|
-
readonly inputSchema?: ZodType<TInputJson>;
|
|
679
|
-
/** Preserve inbound `item.binary` when `execute` returns plain JSON or item-shaped results without `binary`. */
|
|
680
|
-
readonly keepBinaries?: boolean;
|
|
681
|
-
/**
|
|
682
|
-
* Static configuration summary surfaced in the workflow inspector — see
|
|
683
|
-
* {@link import("../contracts/workflowTypes").NodeConfigBase.inspectorSummary}.
|
|
684
|
-
*
|
|
685
|
-
* Receives the static config; returns 2–6 short label/value pairs (or `undefined` to skip).
|
|
686
|
-
*/
|
|
687
|
-
readonly inspectorSummary?: (args: Readonly<{
|
|
688
|
-
config: TConfig$1;
|
|
689
|
-
}>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
690
|
-
execute(args: DefineNodeExecuteArgs<TConfig$1, TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<TOutputJson>;
|
|
691
|
-
}
|
|
692
519
|
/**
|
|
693
|
-
*
|
|
520
|
+
* Resolves the correct `InboxChannel` for the current deployment mode
|
|
521
|
+
* (local dev vs. managed/CP). Implemented in `@codemation/host`.
|
|
694
522
|
*/
|
|
695
|
-
interface
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
config: TConfig$1;
|
|
705
|
-
}>) => ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
706
|
-
run(items: ReadonlyArray<TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<ReadonlyArray<TOutputJson>>;
|
|
707
|
-
}
|
|
708
|
-
declare function defineNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
|
|
709
|
-
declare function defineBatchNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineBatchNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
|
|
523
|
+
interface InboxChannelResolverSeam {
|
|
524
|
+
resolve(): {
|
|
525
|
+
channel: InboxChannel;
|
|
526
|
+
workspaceId?: string;
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
declare const InboxChannelResolverToken: TypeToken<InboxChannelResolverSeam | undefined>;
|
|
530
|
+
declare const LocalInboxChannelToken: TypeToken<InboxChannel | undefined>;
|
|
531
|
+
declare const ControlPlaneInboxChannelToken: TypeToken<InboxChannel | undefined>;
|
|
710
532
|
//#endregion
|
|
711
533
|
//#region src/authoring/DefinedNodeRegistry.d.ts
|
|
712
534
|
declare class DefinedNodeRegistry {
|
|
@@ -736,288 +558,6 @@ declare function defineCredential<TPublicSource extends CredentialFieldMap<any>
|
|
|
736
558
|
readonly key: string;
|
|
737
559
|
};
|
|
738
560
|
//#endregion
|
|
739
|
-
//#region src/ai/NodeBackedToolConfig.d.ts
|
|
740
|
-
declare class NodeBackedToolConfig<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> implements ToolConfig {
|
|
741
|
-
readonly name: string;
|
|
742
|
-
readonly node: TNodeConfig;
|
|
743
|
-
readonly type: TypeToken<unknown>;
|
|
744
|
-
readonly toolKind: "nodeBacked";
|
|
745
|
-
readonly description?: string;
|
|
746
|
-
readonly presentation?: AgentCanvasPresentation;
|
|
747
|
-
private readonly inputSchemaValue;
|
|
748
|
-
private readonly outputSchemaValue;
|
|
749
|
-
private readonly mapInputValue?;
|
|
750
|
-
private readonly mapOutputValue?;
|
|
751
|
-
constructor(name: string, node: TNodeConfig, options: NodeBackedToolConfigOptions<TNodeConfig, TInputSchema, TOutputSchema>);
|
|
752
|
-
getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
|
|
753
|
-
getInputSchema(): TInputSchema;
|
|
754
|
-
getOutputSchema(): TOutputSchema;
|
|
755
|
-
toNodeItem(args: NodeBackedToolInputMapperArgs<TNodeConfig, input<TInputSchema>>): Item<RunnableNodeInputJson<TNodeConfig>>;
|
|
756
|
-
toToolOutput(args: NodeBackedToolOutputMapperArgs<TNodeConfig, input<TInputSchema>>): output<TOutputSchema>;
|
|
757
|
-
private readDefaultToolOutput;
|
|
758
|
-
private isItem;
|
|
759
|
-
}
|
|
760
|
-
//#endregion
|
|
761
|
-
//#region src/ai/CallableToolConfig.d.ts
|
|
762
|
-
type CallableToolExecuteHandler<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> = (args: ToolExecuteArgs<CallableToolConfig<TInputSchema, TOutputSchema>, input<TInputSchema>>) => Promise<output<TOutputSchema>> | output<TOutputSchema>;
|
|
763
|
-
type CallableToolConfigOptions<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> = Readonly<{
|
|
764
|
-
name: string;
|
|
765
|
-
description?: string;
|
|
766
|
-
presentation?: AgentCanvasPresentation;
|
|
767
|
-
inputSchema: TInputSchema;
|
|
768
|
-
outputSchema: TOutputSchema;
|
|
769
|
-
/**
|
|
770
|
-
* Optional credential slots for this tool (same contract as other {@link ToolConfig} shapes).
|
|
771
|
-
*/
|
|
772
|
-
credentialRequirements?: ReadonlyArray<CredentialRequirement>;
|
|
773
|
-
execute: CallableToolExecuteHandler<TInputSchema, TOutputSchema>;
|
|
774
|
-
}>;
|
|
775
|
-
/**
|
|
776
|
-
* Inline callable agent tool: DSL sugar over {@link ToolConfig} without a separate {@link NodeResolver}-registered {@link Tool} class.
|
|
777
|
-
*/
|
|
778
|
-
declare class CallableToolConfig<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> implements ToolConfig {
|
|
779
|
-
readonly name: string;
|
|
780
|
-
readonly type: TypeToken<unknown>;
|
|
781
|
-
readonly toolKind: "callable";
|
|
782
|
-
readonly description?: string;
|
|
783
|
-
readonly presentation?: AgentCanvasPresentation;
|
|
784
|
-
private readonly inputSchemaValue;
|
|
785
|
-
private readonly outputSchemaValue;
|
|
786
|
-
private readonly credentialRequirementsValue?;
|
|
787
|
-
private readonly executeHandler;
|
|
788
|
-
constructor(name: string, options: CallableToolConfigOptions<TInputSchema, TOutputSchema>);
|
|
789
|
-
getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
|
|
790
|
-
getInputSchema(): TInputSchema;
|
|
791
|
-
getOutputSchema(): TOutputSchema;
|
|
792
|
-
/**
|
|
793
|
-
* Parses tool input and output with the configured Zod schemas.
|
|
794
|
-
*/
|
|
795
|
-
executeTool(args: ToolExecuteArgs<CallableToolConfig<TInputSchema, TOutputSchema>, input<TInputSchema>>): Promise<output<TOutputSchema>>;
|
|
796
|
-
private parseInput;
|
|
797
|
-
private parseOutput;
|
|
798
|
-
private decorateValidationError;
|
|
799
|
-
}
|
|
800
|
-
//#endregion
|
|
801
|
-
//#region src/ai/CallableToolFactory.d.ts
|
|
802
|
-
declare class CallableToolFactoryImpl {
|
|
803
|
-
callableTool<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny>(options: CallableToolConfigOptions<TInputSchema, TOutputSchema>): CallableToolConfig<TInputSchema, TOutputSchema>;
|
|
804
|
-
}
|
|
805
|
-
declare const CallableToolFactory: CallableToolFactoryImpl;
|
|
806
|
-
//#endregion
|
|
807
|
-
//#region src/ai/CallableToolKindToken.d.ts
|
|
808
|
-
/**
|
|
809
|
-
* Shared {@link import("../di").TypeToken} marker for {@link CallableToolConfig}.
|
|
810
|
-
* Callable tools are not registered in {@link NodeResolver}; this class only satisfies {@link ToolConfig#type}.
|
|
811
|
-
*/
|
|
812
|
-
declare class CallableToolKindToken {}
|
|
813
|
-
//#endregion
|
|
814
|
-
//#region src/ai/AgentToolFactory.d.ts
|
|
815
|
-
declare class AgentToolFactoryImpl {
|
|
816
|
-
asTool<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny>(node: TNodeConfig, options: Readonly<{
|
|
817
|
-
name?: string;
|
|
818
|
-
} & NodeBackedToolConfigOptions<TNodeConfig, TInputSchema, TOutputSchema>>): NodeBackedToolConfig<TNodeConfig, TInputSchema, TOutputSchema>;
|
|
819
|
-
private withDefaultAgentInputMapper;
|
|
820
|
-
private mergeAgentToolInputWithCurrentItem;
|
|
821
|
-
private isMergeableRecord;
|
|
822
|
-
}
|
|
823
|
-
declare const AgentToolFactory: AgentToolFactoryImpl;
|
|
824
|
-
//#endregion
|
|
825
|
-
//#region src/ai/AgentMessageConfigNormalizerFactory.d.ts
|
|
826
|
-
declare class AgentMessageConfigNormalizer {
|
|
827
|
-
/**
|
|
828
|
-
* Prefer {@code input.messages} when present (ItemNode / engine-mapped payloads); otherwise resolve from
|
|
829
|
-
* {@link AgentNodeConfig.messages} templates.
|
|
830
|
-
*/
|
|
831
|
-
static resolveFromInputOrConfig<TInputJson, TOutputJson>(input: unknown, config: AgentNodeConfig<TInputJson, TOutputJson>, args: AgentMessageBuildArgs<TInputJson>): ReadonlyArray<AgentMessageDto>;
|
|
832
|
-
static normalize<TInputJson, TOutputJson>(config: AgentNodeConfig<TInputJson, TOutputJson>, args: AgentMessageBuildArgs<TInputJson>): ReadonlyArray<AgentMessageDto>;
|
|
833
|
-
private static tryMessagesFromStructuredInput;
|
|
834
|
-
private static normalizeRichMessages;
|
|
835
|
-
private static lineToDto;
|
|
836
|
-
}
|
|
837
|
-
//#endregion
|
|
838
|
-
//#region src/ai/AgentConfigInspectorFactory.d.ts
|
|
839
|
-
declare class AgentConfigInspector {
|
|
840
|
-
static isAgentNodeConfig(config: NodeConfigBase | undefined): config is AgentNodeConfig<any, any>;
|
|
841
|
-
private static hasCompatibleMessageConfiguration;
|
|
842
|
-
}
|
|
843
|
-
//#endregion
|
|
844
|
-
//#region src/ai/AiHost.d.ts
|
|
845
|
-
interface AgentCanvasPresentation<TIcon extends string = string> {
|
|
846
|
-
readonly label?: string;
|
|
847
|
-
readonly icon?: TIcon;
|
|
848
|
-
}
|
|
849
|
-
type ZodSchemaAny = ZodType<any, any, any>;
|
|
850
|
-
interface ToolConfig {
|
|
851
|
-
readonly type: TypeToken<unknown>;
|
|
852
|
-
readonly name: string;
|
|
853
|
-
readonly description?: string;
|
|
854
|
-
readonly presentation?: AgentCanvasPresentation;
|
|
855
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
856
|
-
}
|
|
857
|
-
type ToolExecuteArgs<TConfig$1 extends ToolConfig = ToolConfig, TInput = unknown> = Readonly<{
|
|
858
|
-
config: TConfig$1;
|
|
859
|
-
input: TInput;
|
|
860
|
-
ctx: NodeExecutionContext<any>;
|
|
861
|
-
item: Item;
|
|
862
|
-
itemIndex: number;
|
|
863
|
-
items: Items;
|
|
864
|
-
/**
|
|
865
|
-
* Optional sub-agent boundary hooks: when present, the live `agent.tool.call` span and the
|
|
866
|
-
* planned tool-call invocationId are forwarded so node-backed runtimes can re-root their child
|
|
867
|
-
* execution scope. Plain function tools may safely ignore these hooks.
|
|
868
|
-
*/
|
|
869
|
-
hooks?: Readonly<{
|
|
870
|
-
parentSpan?: TelemetrySpanScope;
|
|
871
|
-
parentInvocationId?: ConnectionInvocationId;
|
|
872
|
-
}>;
|
|
873
|
-
}>;
|
|
874
|
-
interface Tool<TConfig$1 extends ToolConfig = ToolConfig, TInputSchema extends ZodSchemaAny = ZodSchemaAny, TOutputSchema extends ZodSchemaAny = ZodSchemaAny> {
|
|
875
|
-
readonly defaultDescription: string;
|
|
876
|
-
readonly inputSchema: TInputSchema;
|
|
877
|
-
readonly outputSchema: TOutputSchema;
|
|
878
|
-
execute(args: ToolExecuteArgs<TConfig$1, input<TInputSchema>>): Promise<output<TOutputSchema>> | output<TOutputSchema>;
|
|
879
|
-
}
|
|
880
|
-
type AgentTool<TInputSchema extends ZodSchemaAny = ZodSchemaAny, TOutputSchema extends ZodSchemaAny = ZodSchemaAny> = Tool<ToolConfig, TInputSchema, TOutputSchema>;
|
|
881
|
-
type AgentToolExecuteArgs<TInput = unknown> = ToolExecuteArgs<ToolConfig, TInput>;
|
|
882
|
-
type AgentToolToken = TypeToken<Tool<ToolConfig, ZodSchemaAny, ZodSchemaAny>>;
|
|
883
|
-
type AgentMessageRole = "system" | "user" | "assistant";
|
|
884
|
-
type AgentMessageBuildArgs<TInputJson = unknown> = Readonly<{
|
|
885
|
-
item: Item<TInputJson>;
|
|
886
|
-
itemIndex: number;
|
|
887
|
-
items: Items<TInputJson>;
|
|
888
|
-
ctx: NodeExecutionContext<any>;
|
|
889
|
-
}>;
|
|
890
|
-
interface AgentMessageDto {
|
|
891
|
-
readonly role: AgentMessageRole;
|
|
892
|
-
readonly content: string;
|
|
893
|
-
}
|
|
894
|
-
type AgentMessageTemplateContent<TInputJson = unknown> = string | ((args: AgentMessageBuildArgs<TInputJson>) => string);
|
|
895
|
-
interface AgentMessageTemplate<TInputJson = unknown> {
|
|
896
|
-
readonly role: AgentMessageRole;
|
|
897
|
-
readonly content: AgentMessageTemplateContent<TInputJson>;
|
|
898
|
-
}
|
|
899
|
-
/** A single prompt line: fixed DTO or template with optional function `content`. */
|
|
900
|
-
type AgentMessageLine<TInputJson = unknown> = AgentMessageDto | AgentMessageTemplate<TInputJson>;
|
|
901
|
-
/**
|
|
902
|
-
* Message list for an agent. Prefer a **plain array** of `{ role, content }` (optionally with function `content` for templates).
|
|
903
|
-
* Use the object form only when you need `buildMessages` to append messages after optional `prompt` lines.
|
|
904
|
-
*/
|
|
905
|
-
type AgentMessageConfig<TInputJson = unknown> = Expr<ReadonlyArray<AgentMessageLine<TInputJson>>, TInputJson> | ReadonlyArray<AgentMessageLine<TInputJson>> | {
|
|
906
|
-
readonly prompt?: ReadonlyArray<AgentMessageLine<TInputJson>>;
|
|
907
|
-
readonly buildMessages?: (args: AgentMessageBuildArgs<TInputJson>) => ReadonlyArray<AgentMessageDto>;
|
|
908
|
-
};
|
|
909
|
-
type AgentTurnLimitBehavior = "error" | "respondWithLastMessage";
|
|
910
|
-
interface AgentModelInvocationOptions {
|
|
911
|
-
readonly maxTokens?: number;
|
|
912
|
-
readonly providerOptions?: Readonly<Record<string, JsonValue>>;
|
|
913
|
-
}
|
|
914
|
-
interface AgentGuardrailConfig {
|
|
915
|
-
readonly maxTurns?: number;
|
|
916
|
-
readonly onTurnLimitReached?: AgentTurnLimitBehavior;
|
|
917
|
-
readonly modelInvocationOptions?: AgentModelInvocationOptions;
|
|
918
|
-
}
|
|
919
|
-
/** Defaults aligned with common tool-agent iteration limits (many products use ~10 max rounds). */
|
|
920
|
-
declare const AgentGuardrailDefaults: {
|
|
921
|
-
readonly maxTurns: 10;
|
|
922
|
-
readonly onTurnLimitReached: AgentTurnLimitBehavior;
|
|
923
|
-
};
|
|
924
|
-
interface AgentToolDefinition {
|
|
925
|
-
readonly name: string;
|
|
926
|
-
readonly description: string;
|
|
927
|
-
readonly inputSchema: ZodSchemaAny;
|
|
928
|
-
}
|
|
929
|
-
type AgentToolCall = Readonly<{
|
|
930
|
-
id?: string;
|
|
931
|
-
name: string;
|
|
932
|
-
input: unknown;
|
|
933
|
-
}>;
|
|
934
|
-
type AgentToolCallPlanner<_TNodeConfig = unknown> = (item: Item, index: number, items: Items, ctx: NodeExecutionContext<any>) => ReadonlyArray<AgentToolCall>;
|
|
935
|
-
interface ChatModelConfig {
|
|
936
|
-
readonly type: TypeToken<ChatModelFactory<ChatModelConfig>>;
|
|
937
|
-
readonly name: string;
|
|
938
|
-
readonly provider?: string;
|
|
939
|
-
readonly modelName?: string;
|
|
940
|
-
readonly presentation?: AgentCanvasPresentation;
|
|
941
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
942
|
-
}
|
|
943
|
-
/**
|
|
944
|
-
* Provider-neutral chat language model wrapper returned by a {@link ChatModelFactory}.
|
|
945
|
-
*
|
|
946
|
-
* Thin adapter around an AI SDK `LanguageModelV2` (from `@ai-sdk/provider`) plus the call-site
|
|
947
|
-
* defaults Codemation needs at every generate/stream: the provider label, the model name used for
|
|
948
|
-
* pricing / telemetry, and the default invocation options (max output tokens, temperature,
|
|
949
|
-
* provider-specific overrides).
|
|
950
|
-
*
|
|
951
|
-
* The consumer (AIAgentNode / AgentStructuredOutputRunner) passes `languageModel` directly into
|
|
952
|
-
* `generateText({ model, ... })` from the `ai` package.
|
|
953
|
-
*/
|
|
954
|
-
interface ChatLanguageModel {
|
|
955
|
-
/** AI SDK `LanguageModelV2` instance (kept `unknown` to avoid leaking the SDK type into `@codemation/core`). */
|
|
956
|
-
readonly languageModel: unknown;
|
|
957
|
-
/** Stable pricing/telemetry key — e.g. `"gpt-4.1-nano"`. */
|
|
958
|
-
readonly modelName: string;
|
|
959
|
-
/** Provider label — e.g. `"openai"`. Used for cost tracking. */
|
|
960
|
-
readonly provider?: string;
|
|
961
|
-
/** Defaults merged into every call. Consumers may override per-invocation. */
|
|
962
|
-
readonly defaultCallOptions?: ChatLanguageModelCallOptions;
|
|
963
|
-
}
|
|
964
|
-
interface ChatLanguageModelCallOptions {
|
|
965
|
-
readonly maxOutputTokens?: number;
|
|
966
|
-
readonly temperature?: number;
|
|
967
|
-
readonly providerOptions?: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
|
|
968
|
-
}
|
|
969
|
-
/**
|
|
970
|
-
* Options for a structured-output generate call. Mirrors
|
|
971
|
-
* `generateText({ output: Output.object(...) })` from the `ai` package.
|
|
972
|
-
*/
|
|
973
|
-
interface StructuredOutputOptions {
|
|
974
|
-
/** Optional schema name — used by some providers as the JSON schema name attribute. */
|
|
975
|
-
readonly schemaName?: string;
|
|
976
|
-
/** When `true`, the consumer should pass a strict-mode-compatible JSON Schema record. */
|
|
977
|
-
readonly strict?: boolean;
|
|
978
|
-
}
|
|
979
|
-
interface ChatModelFactory<TConfig$1 extends ChatModelConfig = ChatModelConfig> {
|
|
980
|
-
create(args: Readonly<{
|
|
981
|
-
config: TConfig$1;
|
|
982
|
-
ctx: NodeExecutionContext<any>;
|
|
983
|
-
}>): Promise<ChatLanguageModel> | ChatLanguageModel;
|
|
984
|
-
}
|
|
985
|
-
type NodeBackedToolInputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = Readonly<{
|
|
986
|
-
input: TToolInput;
|
|
987
|
-
item: Item;
|
|
988
|
-
itemIndex: number;
|
|
989
|
-
items: Items;
|
|
990
|
-
ctx: NodeExecutionContext<any>;
|
|
991
|
-
node: TNodeConfig;
|
|
992
|
-
}>;
|
|
993
|
-
type NodeBackedToolOutputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = Readonly<{
|
|
994
|
-
input: TToolInput;
|
|
995
|
-
item: Item;
|
|
996
|
-
itemIndex: number;
|
|
997
|
-
items: Items;
|
|
998
|
-
ctx: NodeExecutionContext<any>;
|
|
999
|
-
node: TNodeConfig;
|
|
1000
|
-
outputs: NodeOutputs;
|
|
1001
|
-
}>;
|
|
1002
|
-
type NodeBackedToolInputMapper<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = (args: NodeBackedToolInputMapperArgs<TNodeConfig, TToolInput>) => Item<RunnableNodeInputJson<TNodeConfig>> | RunnableNodeInputJson<TNodeConfig>;
|
|
1003
|
-
type NodeBackedToolOutputMapper<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown, TToolOutput = unknown> = (args: NodeBackedToolOutputMapperArgs<TNodeConfig, TToolInput>) => TToolOutput;
|
|
1004
|
-
type NodeBackedToolConfigOptions<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> = Readonly<{
|
|
1005
|
-
description?: string;
|
|
1006
|
-
presentation?: AgentCanvasPresentation;
|
|
1007
|
-
inputSchema: TInputSchema;
|
|
1008
|
-
outputSchema: TOutputSchema;
|
|
1009
|
-
mapInput?: NodeBackedToolInputMapper<TNodeConfig, input<TInputSchema>>;
|
|
1010
|
-
mapOutput?: NodeBackedToolOutputMapper<TNodeConfig, input<TInputSchema>, output<TOutputSchema>>;
|
|
1011
|
-
}>;
|
|
1012
|
-
interface AgentNodeConfig<TInputJson = unknown, TOutputJson = unknown> extends RunnableNodeConfig<TInputJson, TOutputJson> {
|
|
1013
|
-
readonly messages: AgentMessageConfig<TInputJson>;
|
|
1014
|
-
readonly chatModel: ChatModelConfig;
|
|
1015
|
-
readonly tools?: ReadonlyArray<ToolConfig>;
|
|
1016
|
-
readonly guardrails?: AgentGuardrailConfig;
|
|
1017
|
-
readonly outputSchema?: ZodType<TOutputJson>;
|
|
1018
|
-
}
|
|
1019
|
-
type AgentAttachmentRole = "languageModel" | "tool" | "nestedAgent";
|
|
1020
|
-
//#endregion
|
|
1021
561
|
//#region src/authoring/callableTool.types.d.ts
|
|
1022
562
|
/**
|
|
1023
563
|
* Workflow-facing helper for inline Zod-typed agent tools (same as {@link CallableToolFactory.callableTool}).
|
|
@@ -1250,27 +790,6 @@ declare class DefinedPollingTriggerConfig<TConfig$1 extends CredentialJsonRecord
|
|
|
1250
790
|
*/
|
|
1251
791
|
declare function definePollingTrigger<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TItemJson, TState extends JsonValue | undefined, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefinePollingTriggerOptions<TKey$1, TConfig$1, TItemJson, TState, TBindings>): DefinedPollingTrigger<TKey$1, TConfig$1, TItemJson, TState, TBindings>;
|
|
1252
792
|
//#endregion
|
|
1253
|
-
//#region src/ai/AgentConnectionNodeCollector.d.ts
|
|
1254
|
-
type AgentConnectionNodeRole = "languageModel" | "tool" | "nestedAgent";
|
|
1255
|
-
type AgentConnectionCredentialSource = Readonly<{
|
|
1256
|
-
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
1257
|
-
}>;
|
|
1258
|
-
type AgentConnectionNodeDescriptor = Readonly<{
|
|
1259
|
-
nodeId: NodeId;
|
|
1260
|
-
parentNodeId: NodeId;
|
|
1261
|
-
connectionName: NodeConnectionName;
|
|
1262
|
-
role: AgentConnectionNodeRole;
|
|
1263
|
-
name: string;
|
|
1264
|
-
typeName: string;
|
|
1265
|
-
icon?: string;
|
|
1266
|
-
credentialSource: AgentConnectionCredentialSource;
|
|
1267
|
-
}>;
|
|
1268
|
-
type McpServerResolver = (id: string) => McpServerDeclaration | undefined;
|
|
1269
|
-
type AgentConnectionNodeCollectorApi = Readonly<{
|
|
1270
|
-
collect(parentNodeId: NodeId, agentConfig: AgentNodeConfig<any, any>, mcpServerResolver?: McpServerResolver): ReadonlyArray<AgentConnectionNodeDescriptor>;
|
|
1271
|
-
}>;
|
|
1272
|
-
declare const AgentConnectionNodeCollector: AgentConnectionNodeCollectorApi;
|
|
1273
|
-
//#endregion
|
|
1274
793
|
//#region src/events/ConnectionInvocationEventPublisher.d.ts
|
|
1275
794
|
/**
|
|
1276
795
|
* Publishes per-invocation lifecycle records onto the run {@link RunEventBus}.
|
|
@@ -1378,18 +897,6 @@ declare function tool(options?: PersistedRuntimeTypeDecoratorOptions): ClassDeco
|
|
|
1378
897
|
/** Marks a class as a persisted chat-model runtime type and an injectable tsyringe service. */
|
|
1379
898
|
declare function chatModel(options?: PersistedRuntimeTypeDecoratorOptions): ClassDecorator;
|
|
1380
899
|
//#endregion
|
|
1381
|
-
//#region src/serialization/ItemsInputNormalizer.d.ts
|
|
1382
|
-
/**
|
|
1383
|
-
* Normalizes external inputs into the engine's canonical `Items` shape.
|
|
1384
|
-
* Used at host and builder boundaries where callers may provide either a raw value,
|
|
1385
|
-
* a single item-like object, or an array of item-like values.
|
|
1386
|
-
*/
|
|
1387
|
-
declare class ItemsInputNormalizer {
|
|
1388
|
-
normalize(raw: unknown): Items;
|
|
1389
|
-
private normalizeItem;
|
|
1390
|
-
private isItem;
|
|
1391
|
-
}
|
|
1392
|
-
//#endregion
|
|
1393
900
|
//#region src/execution/ChildExecutionScopeFactory.d.ts
|
|
1394
901
|
/**
|
|
1395
902
|
* Builds a re-rooted child execution context for sub-agent (and other deeply-nested) invocations.
|
|
@@ -1541,5 +1048,90 @@ interface OAuthFlowExecutor {
|
|
|
1541
1048
|
}): Promise<OAuthMaterial>;
|
|
1542
1049
|
}
|
|
1543
1050
|
//#endregion
|
|
1544
|
-
export { ActivationIdFactory, AgentAttachmentRole, AgentBindError, AgentCanvasPresentation, AgentConfigInspector, type AgentConnectionCredentialSource, AgentConnectionNodeCollector, type AgentConnectionNodeDescriptor, type AgentConnectionNodeRole, AgentGuardrailConfig, AgentGuardrailDefaults, AgentMcpIntegration, AgentMcpToolMap, AgentMessageBuildArgs, AgentMessageConfig, AgentMessageConfigNormalizer, AgentMessageDto, AgentMessageLine, AgentMessageRole, AgentMessageTemplate, AgentMessageTemplateContent, AgentModelInvocationOptions, AgentNodeConfig, AgentTool, AgentToolCall, AgentToolCallPlanner, AgentToolDefinition, AgentToolExecuteArgs, AgentToolFactory, AgentToolToken, AgentTurnLimitBehavior, AllWorkflowsActiveWorkflowActivationPolicy, AnyCredentialType, AnyRunnableNodeConfig, AnyTriggerNodeConfig, AssertionResult, AssertionResultProvenance, BatchId, BinaryAttachment, BinaryAttachmentCreateRequest, BinaryBody, BinaryPreviewKind, BinaryStorage, BinaryStorageReadResult, BinaryStorageStatResult, BinaryStorageWriteRequest, BinaryStorageWriteResult, BooleanWhenOverloads, BranchMoreArgs, BranchOutputGuard, BranchStepsArg, CallableToolConfig, type CallableToolConfigOptions, type CallableToolExecuteHandler, CallableToolFactory, CallableToolKindToken, ChainCursor, ChatLanguageModel, ChatLanguageModelCallOptions, ChatModelConfig, ChatModelFactory, ChildExecutionScopeFactory, type Clock, CodemationTelemetryAttributeNames, CodemationTelemetryMetricNames, CollectionColumnBuilder, CollectionDefinition, CollectionFieldDefinition, CollectionIndexDefinition, CollectionStore, CollectionsContext, ConnectionInvocationAppendArgs, ConnectionInvocationEventPublisher, ConnectionInvocationId, ConnectionInvocationIdFactory, ConnectionInvocationKind, ConnectionInvocationRecord, ConnectionNodeIdFactory, Container, CoreTokens, CostCatalog, CostCatalogEntry, CostTrackingComponent, CostTrackingPriceQuote, CostTrackingTelemetry, CostTrackingTelemetryAttributeNames, CostTrackingTelemetryFactory, CostTrackingTelemetryMetricNames, CostTrackingUsageRecord, CredentialAdvancedSectionPresentation, CredentialAuthDefinition, CredentialBinding, CredentialBindingKey, CredentialFieldSchema, CredentialHealth, CredentialHealthStatus, CredentialHealthTester, CredentialInstanceId, CredentialInstanceRecord, CredentialJsonRecord, CredentialMaterialSourceKind, CredentialOAuth2AuthDefinition, CredentialOAuth2ScopesFromPublicConfig, CredentialRequirement, CredentialResolverFactory, CredentialSessionFactory, CredentialSessionFactoryArgs, CredentialSessionService, CredentialSetupStatus, CredentialType, CredentialTypeDefinition, CredentialTypeId, CredentialTypeRegistry, CredentialUnboundError, CurrentStateExecutionRequest, DEFAULT_ASSERTION_PASS_THRESHOLD, DefaultAsyncSleeper, DefaultExecutionBinaryService, DefaultExecutionContextFactory, DefaultWorkflowGraphFactory, DefineBatchNodeOptions, DefineCollectionOptions, DefineCredentialOptions, DefineNodeExecuteArgs, DefineNodeOptions, DefinePollingTriggerExecuteContext, DefinePollingTriggerOptions, DefinePollingTriggerPollContext, DefinePollingTriggerPollResult, DefinePollingTriggerTestItemsContext, DefinedCollection, DefinedCollectionRegistry, DefinedNode, DefinedNodeConfigInput, DefinedNodeCredentialAccessors, DefinedNodeCredentialBinding, DefinedNodeCredentialBindings, DefinedNodeRegistry, DefinedNodeRunContext, DefinedPollingTrigger, DefinedPollingTriggerConfig, DependencyContainer, Disposable, Edge, EngineDeps, EngineExecutionLimitsPolicy, type EngineExecutionLimitsPolicyConfig, EngineHost, EngineRunCounters, EventPublishingWorkflowExecutionRepository, ExecutableTriggerNode, ExecutionBinaryService, ExecutionContext, ExecutionContextFactory, ExecutionFrontierPlan, ExecutionInstanceDto, ExecutionInstanceId, ExecutionMode, ExecutionPayloadPolicyFields, ExecutionTelemetry, ExecutionTelemetryFactory, ExpRetryPolicy, ExponentialRetryPolicySpec, Expr, FixedRetryPolicySpec, GenAiTelemetryAttributeNames, HttpMethod, InMemoryBinaryStorage, InMemoryLiveWorkflowRepository, InMemoryRunDataFactory, InMemoryRunEventBus, InProcessRetryRunner, InjectableRuntimeDecoratorComposer, InjectionToken, InputPortKey, Item, ItemBinary, ItemExpr, ItemExprArgs, ItemExprCallback, ItemExprContext, ItemExprResolvedContext, ItemExprResolver, ItemNode, Items, ItemsInputNormalizer, JsonArray, JsonNonArray, JsonObject, JsonPrimitive, JsonValue, Lifecycle, LiveWorkflowRepository, McpServerDeclaration, type McpServerResolver, McpServerTransport, MultiInputNode, MutableRunData, NeedsReconsentEvent, NoOpAgentMcpIntegration, NoOpCostTrackingTelemetry, NoOpCostTrackingTelemetryFactory, NoOpExecutionTelemetry, NoOpExecutionTelemetryFactory, NoOpNodeExecutionTelemetry, NoOpPollingTriggerLogger, NoOpTelemetryArtifactReference, NoOpTelemetrySpanScope, NoRetryPolicy, NodeActivationContinuation, NodeActivationId, NodeActivationReceipt, NodeActivationRequest, NodeActivationRequestBase, NodeActivationScheduler, NodeBackedToolConfig, NodeBackedToolConfigOptions, NodeBackedToolInputMapper, NodeBackedToolInputMapperArgs, NodeBackedToolOutputMapper, NodeBackedToolOutputMapperArgs, NodeBinaryAttachmentService, NodeConfigBase, NodeConnectionName, NodeDefinition, NodeErrorHandler, NodeErrorHandlerArgs, NodeErrorHandlerSpec, NodeEventPublisher, NodeExecutionContext, NodeExecutionError, NodeExecutionRequest, NodeExecutionRequestHandler, NodeExecutionScheduler, NodeExecutionSnapshot, NodeExecutionStatePublisher, NodeExecutionStatus, NodeExecutionTelemetry, NodeExecutor, NodeId, NodeIdRef, NodeIdSlugifier, NodeInputsByPort, NodeInspectorSummaryRow, NodeIterationId, NodeIterationIdFactory, NodeKind, NodeOffloadPolicy, NodeOutputNormalizer, NodeOutputs, NodeRef, NodeResolver, NodeSchedulerDecision, NoneRetryPolicySpec, OAuth2ProviderFromPublicConfig, type OAuthFlowCallbackArgs, type OAuthFlowExecutor, type OAuthFlowStartArgs, type OAuthFlowStartResult, type OAuthMaterial, OutputPortKey, PairedItemRef, Param, ParamDeep, ParentExecutionRef, PayloadStorageKind, PendingNodeExecution, PersistedExecutionInstanceKind, PersistedExecutionInstanceRecord, PersistedMutableNodeState, PersistedMutableRunState, PersistedRunControlState, PersistedRunPolicySnapshot, PersistedRunSchedulingState, PersistedRunSlotProjectionRecord, PersistedRunState, PersistedRunWorkItemKind, PersistedRunWorkItemRecord, type PersistedRuntimeTypeDecoratorOptions, type PersistedRuntimeTypeKind, type PersistedRuntimeTypeMetadata, PersistedRuntimeTypeMetadataStore, PersistedRuntimeTypeNameResolver, PersistedTokenId, PersistedTriggerSetupState, PersistedWorkflowSnapshot, PersistedWorkflowSnapshotNode, PersistedWorkflowTokenRegistryLike, PinnedNodeOutputsByPort, type PollingRunCycleArgs, type PollingRunCycleResult, PollingTriggerDedupWindow, PollingTriggerHandle, type PollingTriggerLogger, PollingTriggerRuntime, type PollingTriggerStartArgs, PortsEmission, PreparedNodeActivationDispatch, RegistrationOptions, RetryPolicy, RetryPolicySpec, RunCompletionNotifier, RunCurrentState, RunDataFactory, RunDataSnapshot, RunEvent, RunEventBus, RunEventPublisherDeps, RunEventSubscription, RunExecutionOptions, RunFinishedAtFactory, RunId, RunIdFactory, RunIntentService, RunIterationDto, RunPruneCandidate, RunQueueEntry, RunResult, RunRevision, RunSlotProjectionState, RunStateResetRequest, RunStatus, RunStopCondition, RunSummary, RunTestContext, RunnableNode, RunnableNodeConfig, RunnableNodeExecuteArgs, RunnableNodeInputJson, RunnableNodeOutputJson, RunnableOutputBehaviorResolver, SlotExecutionStateDto, StackTraceCallSitePathResolver, StepSequenceOutput, StructuredOutputOptions, SystemClock, TelemetryArtifactAttachment, TelemetryArtifactReference, TelemetryAttributePrimitive, TelemetryAttributes, TelemetryChildSpanStart, TelemetryMetricRecord, TelemetryScope, TelemetrySpanEnd, TelemetrySpanEventRecord, TelemetrySpanScope, TestCaseRunStatus, TestSuiteRunId, TestSuiteRunStatus, TestTriggerNodeConfig, TestTriggerSetupContext, TestableTriggerNode, Tool, ToolConfig, ToolExecuteArgs, TriggerCleanupHandle, TriggerInstanceId, TriggerNode, TriggerNodeConfig, TriggerNodeOutputJson, TriggerNodeSetupState, TriggerRuntimeDiagnostics, TriggerSetupContext, TriggerSetupStateFor, TriggerSetupStateRepository, TriggerTestItemsContext, TypeToken, UnavailableBinaryStorage, UpstreamRefPlaceholder, ValidStepSequence, WebhookControlSignal, WebhookInvocationMatch, WebhookRunResult, WebhookTriggerMatcher, WebhookTriggerResolution, WebhookTriggerRoutingDiagnostics, WhenBuilder, WorkItemId, WorkItemStatus, WorkflowActivationPolicy, WorkflowBuilder, WorkflowDefinition, WorkflowDefinitionError, WorkflowDetailSelectionState, type WorkflowEdgePortError, type WorkflowEdgePortValidationResult, WorkflowEdgePortValidator, WorkflowErrorContext, WorkflowErrorHandler, WorkflowErrorHandlerSpec, WorkflowExecutableNodeClassifier, WorkflowExecutableNodeClassifierFactory, WorkflowExecutionListingRepository, WorkflowExecutionPruneRepository, WorkflowExecutionRepository, WorkflowGraph, WorkflowGraphFactory, WorkflowId, WorkflowNodeConnection, WorkflowNodeInstanceFactory, WorkflowPolicyRuntimeDefaults, WorkflowPrunePolicySpec, WorkflowRepository, WorkflowRunDetailDto, WorkflowRunnerResolver, WorkflowRunnerService, WorkflowSnapshotFactory, WorkflowSnapshotResolver, WorkflowStoragePolicyDecisionArgs, WorkflowStoragePolicyMode, WorkflowStoragePolicyResolver, WorkflowStoragePolicySpec, ZodSchemaAny, branchRef, c, callableTool, chatModel, container, defineBatchNode, defineCollection, defineCredential, defineNode, definePollingTrigger, delay, deriveAssertionPassed, emitPorts, getOriginIndexFromItem, getPersistedRuntimeTypeMetadata, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, isItemExpr, isPortsEmission, isUnbrandedPortsEmissionShape, itemExpr, node, nodeRef, predicateAwareClassFactory, registry, resolveItemExprsForExecution, resolveItemExprsInUnknown, runnableNodeInputType, runnableNodeOutputType, singleton, tool, triggerNodeOutputType, triggerNodeSetupStateType };
|
|
1051
|
+
//#region src/credentials/CredentialMaterialProvider.types.d.ts
|
|
1052
|
+
/**
|
|
1053
|
+
* Material provider seam — see `docs/design/credentials-oauth-unification.md`,
|
|
1054
|
+
* "Material provider seam" section. Sits beside the workspace's
|
|
1055
|
+
* `CredentialStore`; persistence of the row stays at the store, persistence of
|
|
1056
|
+
* the bytes goes through this provider so they can live at the control plane
|
|
1057
|
+
* in managed mode.
|
|
1058
|
+
*/
|
|
1059
|
+
/**
|
|
1060
|
+
* Pointer to material bytes. For local rows `ref` is the workspace instance id
|
|
1061
|
+
* and the bytes co-locate with the row (existing `CredentialOAuth2Material` /
|
|
1062
|
+
* `CredentialSecretMaterial` tables). For control-plane rows `ref` is the
|
|
1063
|
+
* CP-side credential id; the workspace stores only the pointer.
|
|
1064
|
+
*/
|
|
1065
|
+
type CredentialMaterialRef = Readonly<{
|
|
1066
|
+
source: "local" | "control-plane";
|
|
1067
|
+
id: string;
|
|
1068
|
+
}>;
|
|
1069
|
+
/**
|
|
1070
|
+
* Decrypted material bytes returned by a provider. Shape matches
|
|
1071
|
+
* `OAuthMaterial` — every supported credential type today is OAuth-shaped.
|
|
1072
|
+
*/
|
|
1073
|
+
type MaterialBundle = OAuthMaterial;
|
|
1074
|
+
/**
|
|
1075
|
+
* Caller context recorded by the CP material endpoint per fetch (D5 in the
|
|
1076
|
+
* `credentials-vault` sprint README). The local provider accepts but ignores
|
|
1077
|
+
* it; standalone mode has no audit log.
|
|
1078
|
+
*/
|
|
1079
|
+
type CallerContext = Readonly<{
|
|
1080
|
+
workspaceId: string;
|
|
1081
|
+
caller: Readonly<{
|
|
1082
|
+
kind: "workflow-node";
|
|
1083
|
+
workflowId: string;
|
|
1084
|
+
nodeId: string;
|
|
1085
|
+
}> | Readonly<{
|
|
1086
|
+
kind: "concierge";
|
|
1087
|
+
chatId: string;
|
|
1088
|
+
}> | Readonly<{
|
|
1089
|
+
kind: "research-agent";
|
|
1090
|
+
chatId: string;
|
|
1091
|
+
}> | Readonly<{
|
|
1092
|
+
kind: "manual";
|
|
1093
|
+
userId: string;
|
|
1094
|
+
}>;
|
|
1095
|
+
reason?: string;
|
|
1096
|
+
}>;
|
|
1097
|
+
interface CredentialMaterialProvider {
|
|
1098
|
+
getMaterial(ref: CredentialMaterialRef, context: CallerContext): Promise<MaterialBundle>;
|
|
1099
|
+
setMaterial(ref: CredentialMaterialRef, material: MaterialBundle): Promise<void>;
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Thrown by a provider when asked to operate on a `ref.source` it does not
|
|
1103
|
+
* handle (e.g. the local provider being asked to read `control-plane` bytes).
|
|
1104
|
+
* Exported so `instanceof`-checks work across the workspace boundary.
|
|
1105
|
+
*/
|
|
1106
|
+
declare class IllegalMaterialSourceError extends Error {
|
|
1107
|
+
readonly source: CredentialMaterialRef["source"];
|
|
1108
|
+
readonly providerName: string;
|
|
1109
|
+
constructor(source: CredentialMaterialRef["source"], providerName: string);
|
|
1110
|
+
}
|
|
1111
|
+
//#endregion
|
|
1112
|
+
//#region src/credentials/ManagedCredentialMaterialWriteError.d.ts
|
|
1113
|
+
/**
|
|
1114
|
+
* Thrown by managed-mode providers when `setMaterial` is called. Managed
|
|
1115
|
+
* credential bytes are owned by the control plane; the workspace must not
|
|
1116
|
+
* mutate them. See `docs/design/credentials-oauth-unification.md` and
|
|
1117
|
+
* `planning/sprints/credentials-vault/02-controlplane-material-provider.md`.
|
|
1118
|
+
*/
|
|
1119
|
+
declare class ManagedCredentialMaterialWriteError extends Error {
|
|
1120
|
+
constructor(message?: string);
|
|
1121
|
+
}
|
|
1122
|
+
//#endregion
|
|
1123
|
+
//#region src/credentials/ManagedMaterialFetchError.d.ts
|
|
1124
|
+
/**
|
|
1125
|
+
* Thrown by `ControlPlaneCredentialMaterialProvider` when the control-plane
|
|
1126
|
+
* material endpoint returns a non-2xx response or a malformed body. Exposes
|
|
1127
|
+
* the HTTP status and the raw error body so call sites can surface actionable
|
|
1128
|
+
* detail without parsing strings.
|
|
1129
|
+
*/
|
|
1130
|
+
declare class ManagedMaterialFetchError extends Error {
|
|
1131
|
+
readonly status: number;
|
|
1132
|
+
readonly providerErrorBody: string;
|
|
1133
|
+
constructor(status: number, providerErrorBody: string, message?: string);
|
|
1134
|
+
}
|
|
1135
|
+
//#endregion
|
|
1136
|
+
export { ActivationIdFactory, AgentAttachmentRole, AgentBindError, AgentCanvasPresentation, AgentConfigInspector, type AgentConnectionCredentialSource, AgentConnectionNodeCollector, type AgentConnectionNodeDescriptor, type AgentConnectionNodeRole, AgentGuardrailConfig, AgentGuardrailDefaults, AgentMcpIntegration, AgentMcpToolMap, AgentMessageBuildArgs, AgentMessageConfig, AgentMessageConfigNormalizer, AgentMessageDto, AgentMessageLine, AgentMessageRole, AgentMessageTemplate, AgentMessageTemplateContent, AgentModelInvocationOptions, AgentNodeConfig, AgentTool, AgentToolCall, AgentToolCallPlanner, AgentToolDefinition, AgentToolExecuteArgs, AgentToolFactory, AgentToolToken, AgentTurnLimitBehavior, AllWorkflowsActiveWorkflowActivationPolicy, AnyCredentialType, AnyRunnableNodeConfig, AnyTriggerNodeConfig, AssertionResult, AssertionResultProvenance, BatchId, BinaryAttachment, BinaryAttachmentCreateRequest, BinaryBody, BinaryPreviewKind, BinaryStorage, BinaryStorageReadResult, BinaryStorageStatResult, BinaryStorageWriteRequest, BinaryStorageWriteResult, BooleanWhenOverloads, BranchMoreArgs, BranchOutputGuard, BranchStepsArg, CallableToolConfig, CallableToolConfigOptions, CallableToolExecuteHandler, CallableToolFactory, CallableToolKindToken, type CallerContext, ChainCursor, ChatLanguageModel, ChatLanguageModelCallOptions, ChatModelConfig, ChatModelFactory, ChildExecutionScopeFactory, type Clock, CodemationTelemetryAttributeNames, CodemationTelemetryMetricNames, CollectionColumnBuilder, CollectionDefinition, CollectionFieldDefinition, CollectionIndexDefinition, CollectionStore, CollectionsContext, ConnectionInvocationAppendArgs, ConnectionInvocationEventPublisher, ConnectionInvocationId, ConnectionInvocationIdFactory, ConnectionInvocationKind, ConnectionInvocationRecord, ConnectionNodeIdFactory, Container, ControlPlaneInboxChannelToken, CoreTokens, CostCatalog, CostCatalogEntry, CostTrackingComponent, CostTrackingPriceQuote, CostTrackingTelemetry, CostTrackingTelemetryAttributeNames, CostTrackingTelemetryFactory, CostTrackingTelemetryMetricNames, CostTrackingUsageRecord, CredentialAdvancedSectionPresentation, CredentialAuthDefinition, CredentialBinding, CredentialBindingKey, CredentialFieldSchema, CredentialHealth, CredentialHealthStatus, CredentialHealthTester, CredentialInstanceId, CredentialInstanceRecord, CredentialJsonRecord, type CredentialMaterialProvider, type CredentialMaterialRef, CredentialMaterialSourceKind, CredentialOAuth2AuthDefinition, CredentialOAuth2ScopesFromPublicConfig, CredentialRequirement, CredentialResolverFactory, CredentialSessionFactory, CredentialSessionFactoryArgs, CredentialSessionService, CredentialSetupStatus, CredentialType, CredentialTypeDefinition, CredentialTypeId, CredentialTypeRegistry, CredentialUnboundError, CurrentStateExecutionRequest, DEFAULT_ASSERTION_PASS_THRESHOLD, DefaultAsyncSleeper, DefaultExecutionBinaryService, DefaultExecutionContextFactory, DefaultWorkflowGraphFactory, DefineBatchNodeOptions, DefineCollectionOptions, DefineCredentialOptions, DefineNodeExecuteArgs, DefineNodeOptions, DefinePollingTriggerExecuteContext, DefinePollingTriggerOptions, DefinePollingTriggerPollContext, DefinePollingTriggerPollResult, DefinePollingTriggerTestItemsContext, DefinedCollection, DefinedCollectionRegistry, DefinedHumanApprovalNode, DefinedNode, DefinedNodeConfigInput, DefinedNodeCredentialAccessors, DefinedNodeCredentialBinding, DefinedNodeCredentialBindings, DefinedNodeRegistry, DefinedNodeRunContext, DefinedPollingTrigger, DefinedPollingTriggerConfig, DependencyContainer, Disposable, type Duration, Edge, EngineDeps, EngineExecutionLimitsPolicy, type EngineExecutionLimitsPolicyConfig, EngineHost, EngineRunCounters, EventPublishingWorkflowExecutionRepository, ExecutableTriggerNode, ExecutionBinaryService, ExecutionContext, ExecutionContextFactory, ExecutionFrontierPlan, ExecutionInstanceDto, ExecutionInstanceId, ExecutionMode, ExecutionPayloadPolicyFields, ExecutionTelemetry, ExecutionTelemetryFactory, ExpRetryPolicy, ExponentialRetryPolicySpec, Expr, FixedRetryPolicySpec, GenAiTelemetryAttributeNames, type HitlResumeTokenSignerSeam, HitlResumeTokenSignerToken, type HitlTimeoutJobSchedulerSeam, HitlTimeoutJobSchedulerToken, HitlWorkspaceIdToken, HttpMethod, HumanApprovalDecisionResult, HumanApprovalOutputJson, type HumanTaskActor, type HumanTaskHandle, type HumanTaskId, type HumanTaskRecord, type HumanTaskStatus, type HumanTaskStore, HumanTaskStoreToken, type HumanTaskSubject, IllegalMaterialSourceError, InMemoryBinaryStorage, InMemoryLiveWorkflowRepository, InMemoryRunDataFactory, InMemoryRunEventBus, InProcessRetryRunner, type InboxChannel, type InboxChannelResolverSeam, InboxChannelResolverToken, type InboxDeliverArgs, type InboxDelivery, type InboxOnDecisionArgs, type InboxOnTimeoutArgs, InjectableRuntimeDecoratorComposer, InjectionToken, InputPortKey, Item, ItemBinary, ItemExpr, ItemExprArgs, ItemExprCallback, ItemExprContext, ItemExprResolvedContext, ItemExprResolver, ItemNode, Items, ItemsInputNormalizer, JsonArray, JsonNonArray, JsonObject, JsonPrimitive, JsonValue, Lifecycle, LiveWorkflowRepository, LocalInboxChannelToken, ManagedCredentialMaterialWriteError, ManagedMaterialFetchError, type MaterialBundle, McpServerDeclaration, type McpServerResolver, McpServerTransport, MultiInputNode, MutableRunData, NeedsReconsentEvent, NoOpAgentMcpIntegration, NoOpCostTrackingTelemetry, NoOpCostTrackingTelemetryFactory, NoOpExecutionTelemetry, NoOpExecutionTelemetryFactory, NoOpNodeExecutionTelemetry, NoOpPollingTriggerLogger, NoOpTelemetryArtifactReference, NoOpTelemetrySpanScope, NoRetryPolicy, NodeActivationContinuation, NodeActivationId, NodeActivationReceipt, NodeActivationRequest, NodeActivationRequestBase, NodeActivationScheduler, NodeBackedToolConfig, NodeBackedToolConfigOptions, NodeBackedToolInputMapper, NodeBackedToolInputMapperArgs, NodeBackedToolOutputMapper, NodeBackedToolOutputMapperArgs, NodeBinaryAttachmentService, NodeConfigBase, NodeConnectionName, NodeDefinition, NodeErrorHandler, NodeErrorHandlerArgs, NodeErrorHandlerSpec, NodeEventPublisher, NodeExecutionContext, NodeExecutionError, NodeExecutionRequest, NodeExecutionRequestHandler, NodeExecutionScheduler, NodeExecutionSnapshot, NodeExecutionStatePublisher, NodeExecutionStatus, NodeExecutionTelemetry, NodeExecutor, NodeId, NodeIdRef, NodeIdSlugifier, NodeInputsByPort, NodeInspectorSummaryRow, NodeIterationId, NodeIterationIdFactory, NodeKind, NodeOffloadPolicy, NodeOutputNormalizer, NodeOutputs, NodeRef, NodeResolver, NodeSchedulerDecision, NoneRetryPolicySpec, OAuth2ProviderFromPublicConfig, type OAuthFlowCallbackArgs, type OAuthFlowExecutor, type OAuthFlowStartArgs, type OAuthFlowStartResult, type OAuthMaterial, OutputPortKey, PairedItemRef, Param, ParamDeep, ParentExecutionRef, PayloadStorageKind, PendingNodeExecution, type PendingResumeEntry, PersistedExecutionInstanceKind, PersistedExecutionInstanceRecord, PersistedMutableNodeState, PersistedMutableRunState, PersistedRunControlState, PersistedRunPolicySnapshot, PersistedRunSchedulingState, PersistedRunSlotProjectionRecord, PersistedRunState, PersistedRunWorkItemKind, PersistedRunWorkItemRecord, type PersistedRuntimeTypeDecoratorOptions, type PersistedRuntimeTypeKind, type PersistedRuntimeTypeMetadata, PersistedRuntimeTypeMetadataStore, PersistedRuntimeTypeNameResolver, type PersistedSuspensionEntry, PersistedTokenId, PersistedTriggerSetupState, PersistedWorkflowSnapshot, PersistedWorkflowSnapshotNode, PersistedWorkflowTokenRegistryLike, PinnedNodeOutputsByPort, type PollingRunCycleArgs, type PollingRunCycleResult, PollingTriggerDedupWindow, PollingTriggerHandle, type PollingTriggerLogger, PollingTriggerRuntime, type PollingTriggerStartArgs, PortsEmission, PreparedNodeActivationDispatch, RegistrationOptions, type ResumeContext, RetryPolicy, RetryPolicySpec, RunCompletionNotifier, RunCurrentState, RunDataFactory, RunDataSnapshot, RunEvent, RunEventBus, RunEventPublisherDeps, RunEventSubscription, RunExecutionOptions, RunFinishedAtFactory, type RunHaltReason, RunId, RunIdFactory, RunIntentService, RunIterationDto, RunPruneCandidate, RunQueueEntry, RunResult, RunRevision, RunSlotProjectionState, RunStateResetRequest, RunStatus, RunStopCondition, RunSummary, RunTestContext, RunnableNode, RunnableNodeConfig, RunnableNodeExecuteArgs, RunnableNodeInputJson, RunnableNodeOutputJson, RunnableOutputBehaviorResolver, SlotExecutionStateDto, StackTraceCallSitePathResolver, StepSequenceOutput, StructuredOutputOptions, SuspensionRequest, SystemClock, TelemetryArtifactAttachment, TelemetryArtifactReference, TelemetryAttributePrimitive, TelemetryAttributes, TelemetryChildSpanStart, TelemetryMetricRecord, TelemetryScope, TelemetrySpanEnd, TelemetrySpanEventRecord, TelemetrySpanScope, TestCaseRunStatus, TestSuiteRunId, TestSuiteRunStatus, TestTriggerNodeConfig, TestTriggerSetupContext, TestableTriggerNode, Tool, ToolConfig, ToolExecuteArgs, TriggerCleanupHandle, TriggerInstanceId, TriggerNode, TriggerNodeConfig, TriggerNodeOutputJson, TriggerNodeSetupState, TriggerRuntimeDiagnostics, TriggerSetupContext, TriggerSetupStateFor, TriggerSetupStateRepository, TriggerTestItemsContext, TypeToken, UnavailableBinaryStorage, UpstreamRefPlaceholder, ValidStepSequence, WebhookControlSignal, WebhookInvocationMatch, WebhookRunResult, WebhookTriggerMatcher, WebhookTriggerResolution, WebhookTriggerRoutingDiagnostics, WhenBuilder, WorkItemId, WorkItemStatus, WorkflowActivationPolicy, WorkflowBuilder, WorkflowDefinition, WorkflowDefinitionError, WorkflowDetailSelectionState, type WorkflowEdgePortError, type WorkflowEdgePortValidationResult, WorkflowEdgePortValidator, WorkflowErrorContext, WorkflowErrorHandler, WorkflowErrorHandlerSpec, WorkflowExecutableNodeClassifier, WorkflowExecutableNodeClassifierFactory, WorkflowExecutionListingRepository, WorkflowExecutionPruneRepository, WorkflowExecutionRepository, WorkflowGraph, WorkflowGraphFactory, WorkflowId, WorkflowNodeConnection, WorkflowNodeInstanceFactory, WorkflowPolicyRuntimeDefaults, WorkflowPrunePolicySpec, WorkflowRepository, WorkflowRunDetailDto, WorkflowRunnerResolver, WorkflowRunnerService, WorkflowSnapshotFactory, WorkflowSnapshotResolver, WorkflowStoragePolicyDecisionArgs, WorkflowStoragePolicyMode, WorkflowStoragePolicyResolver, WorkflowStoragePolicySpec, ZodSchemaAny, branchRef, c, callableTool, chatModel, container, defineBatchNode, defineCollection, defineCredential, defineHumanApprovalNode, defineNode, definePollingTrigger, delay, deriveAssertionPassed, emitPorts, getOriginIndexFromItem, getPersistedRuntimeTypeMetadata, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, isHumanApprovalNode, isItemExpr, isPortsEmission, isUnbrandedPortsEmissionShape, itemExpr, node, nodeRef, predicateAwareClassFactory, registry, resolveItemExprsForExecution, resolveItemExprsInUnknown, runnableNodeInputType, runnableNodeOutputType, singleton, tool, triggerNodeOutputType, triggerNodeSetupStateType };
|
|
1545
1137
|
//# sourceMappingURL=index.d.cts.map
|