@codemation/core 0.14.0 → 0.15.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 +68 -0
- package/dist/{CostCatalogContract-B9aYIqJu.d.cts → CostCatalogContract-Dwo-ZamG.d.cts} +2 -2
- package/dist/EngineRuntimeRegistration.types-BiNasx3G.d.cts +54 -0
- package/dist/EngineRuntimeRegistration.types-Dq4ucrdo.d.ts +21 -0
- package/dist/{InMemoryRunDataFactory-C3rIszrW.d.cts → InMemoryRunDataFactory-D2U9azmZ.d.cts} +2 -20
- package/dist/{InMemoryRunEventBusRegistry-Sa86VxuV.cjs → InMemoryRunEventBusRegistry-DO0WM9Lw.cjs} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map → InMemoryRunEventBusRegistry-DO0WM9Lw.cjs.map} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-Bwunvt1T.js → InMemoryRunEventBusRegistry-Layt2xgm.js} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-Bwunvt1T.js.map → InMemoryRunEventBusRegistry-Layt2xgm.js.map} +1 -1
- package/dist/{ItemsInputNormalizer-UCpn7luX.d.cts → ItemsInputNormalizer-A5txcOWX.d.cts} +3 -98
- package/dist/{ItemsInputNormalizer-B9SdLG24.cjs → ItemsInputNormalizer-C1fv3sMW.cjs} +2 -2
- package/dist/ItemsInputNormalizer-C1fv3sMW.cjs.map +1 -0
- package/dist/{ItemsInputNormalizer-DoOawd9R.d.ts → ItemsInputNormalizer-D2vrMrX1.d.ts} +2 -62
- package/dist/{ItemsInputNormalizer-CZEODg94.js → ItemsInputNormalizer-fUYo4GLV.js} +2 -2
- package/dist/ItemsInputNormalizer-fUYo4GLV.js.map +1 -0
- package/dist/{RunIntentService-0f3ICjAz.d.cts → RunIntentService-DKxuHTUz.d.cts} +2 -15
- package/dist/{RunIntentService-Dx_HHxDX.d.ts → RunIntentService-DrpKli2k.d.ts} +2 -22
- package/dist/{agentMcpTypes-B11B3Hd-.d.cts → agentMcpTypes-BHX4RQCC.d.cts} +24 -524
- package/dist/bootstrap/index.cjs +9 -5
- package/dist/bootstrap/index.d.cts +32 -106
- package/dist/bootstrap/index.d.ts +18 -17
- package/dist/bootstrap/index.js +6 -5
- package/dist/{bootstrap-Be0LB0nh.cjs → bootstrap-CTB53rEF.cjs} +9 -60
- package/dist/bootstrap-CTB53rEF.cjs.map +1 -0
- package/dist/{bootstrap-pSQdsMfa.js → bootstrap-DmqKheCI.js} +6 -57
- package/dist/bootstrap-DmqKheCI.js.map +1 -0
- package/dist/browser.cjs +12 -11
- package/dist/browser.d.cts +4 -4
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +3 -2
- package/dist/contracts-7L1wJHdk.cjs +569 -0
- package/dist/contracts-7L1wJHdk.cjs.map +1 -0
- package/dist/contracts-CjJ5CZ7N.js +447 -0
- package/dist/contracts-CjJ5CZ7N.js.map +1 -0
- package/dist/contracts.cjs +9 -2
- package/dist/contracts.d.cts +5 -5
- package/dist/contracts.d.ts +2 -2
- package/dist/contracts.js +3 -2
- package/dist/{executionPersistenceContracts-CX9Ql8N1.d.cts → deploymentManifestTypes-B8CDmZZK.d.cts} +65 -81
- package/dist/di-C6Ubf9o5.cjs +179 -0
- package/dist/di-C6Ubf9o5.cjs.map +1 -0
- package/dist/di-Cjiil7U-.js +114 -0
- package/dist/di-Cjiil7U-.js.map +1 -0
- package/dist/{index-CbJdbIHe.d.ts → index-CRv3_pY3.d.ts} +87 -870
- package/dist/{index-uPnD9EE6.d.ts → index-mnLS0iQl.d.ts} +27 -400
- package/dist/index.cjs +44 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -524
- package/dist/index.d.ts +5 -5
- package/dist/index.js +21 -98
- package/dist/index.js.map +1 -1
- package/dist/{params-Dwl10Ws9.d.cts → params-CrK4iuG1.d.cts} +2 -11
- package/dist/{runtime-CSunvf7A.js → runtime-CBFDpmiz.js} +46 -679
- package/dist/runtime-CBFDpmiz.js.map +1 -0
- package/dist/{runtime-n2tqRwaf.cjs → runtime-Due-FOZ2.cjs} +69 -752
- package/dist/runtime-Due-FOZ2.cjs.map +1 -0
- package/dist/testing.cjs +8 -40
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +3 -32
- package/dist/testing.d.ts +3 -32
- package/dist/testing.js +6 -38
- package/dist/testing.js.map +1 -1
- package/dist/{di-DhwtDRgs.cjs → workflowTypes-BW6Hhee7.cjs} +4 -229
- package/dist/workflowTypes-BW6Hhee7.cjs.map +1 -0
- package/dist/{di-CEV6wTc4.js → workflowTypes-DZtBTmKf.js} +3 -162
- package/dist/workflowTypes-DZtBTmKf.js.map +1 -0
- package/package.json +1 -1
- package/src/ai/AgentConnectionNodeCollector.ts +0 -4
- package/src/ai/AgentMessageConfigNormalizerFactory.ts +0 -4
- package/src/ai/AiHost.ts +0 -38
- package/src/ai/CallableToolConfig.ts +0 -9
- package/src/ai/CallableToolKindToken.ts +0 -4
- package/src/authoring/callableTool.types.ts +0 -3
- package/src/authoring/defineCollection.types.ts +0 -11
- package/src/authoring/defineHumanApprovalNode.types.ts +0 -116
- package/src/authoring/defineNode.types.ts +0 -25
- package/src/authoring/definePollingTrigger.types.ts +18 -152
- package/src/authoring/definePollingTriggerInternals.ts +0 -4
- package/src/authoring/nodeBaseOptions.types.ts +0 -14
- package/src/binaries/boundedReadBinary.types.ts +0 -16
- package/src/bootstrap/index.ts +8 -2
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +0 -5
- package/src/bootstrap/runtime/EngineRuntimeRegistration.types.ts +0 -23
- package/src/browser.ts +0 -3
- package/src/contracts/AgentBindError.ts +0 -5
- package/src/contracts/Clock.ts +0 -1
- package/src/contracts/CodemationTelemetryAttributeNames.ts +0 -10
- package/src/contracts/NoOpAgentMcpIntegration.ts +0 -6
- package/src/contracts/NoOpTelemetrySpanScope.ts +0 -7
- package/src/contracts/RetryPolicy.ts +0 -2
- package/src/contracts/agentMcpTypes.ts +0 -34
- package/src/contracts/assertionTypes.ts +0 -33
- package/src/contracts/baseTypes.ts +0 -6
- package/src/contracts/collectionTypes.ts +0 -25
- package/src/contracts/credentialTypes.ts +13 -60
- package/src/contracts/deploymentManifestTypes.ts +158 -0
- package/src/contracts/dispatchTypes.ts +29 -0
- package/src/contracts/executionPersistenceContracts.ts +0 -33
- package/src/contracts/hitlSeamTypes.ts +0 -14
- package/src/contracts/humanTaskStoreTypes.ts +0 -2
- package/src/contracts/inboxChannelTypes.ts +0 -9
- package/src/contracts/index.ts +3 -0
- package/src/contracts/itemExpr.ts +0 -18
- package/src/contracts/itemMeta.ts +0 -3
- package/src/contracts/mcpTypes.ts +0 -16
- package/src/contracts/retryPolicySpec.types.ts +0 -10
- package/src/contracts/runFinishedAtFactory.ts +0 -1
- package/src/contracts/runTypes.ts +0 -74
- package/src/contracts/runtimeTypes.ts +4 -131
- package/src/contracts/telemetryTypes.ts +0 -7
- package/src/contracts/testTriggerTypes.ts +0 -43
- package/src/contracts/triggerInvokerTypes.ts +6 -0
- package/src/contracts/webhookTypes.ts +0 -8
- package/src/contracts/workflowActivationPolicy.ts +0 -5
- package/src/contracts/workflowTypes.ts +4 -86
- package/src/contracts/workspaceFileTypes.ts +0 -72
- package/src/contracts.ts +18 -10
- package/src/credentials/CredentialMaterialProvider.types.ts +0 -28
- package/src/credentials/ManagedCredentialMaterialWriteError.ts +0 -6
- package/src/credentials/ManagedMaterialFetchError.ts +0 -6
- package/src/credentials/OAuthFlowExecutor.types.ts +0 -15
- package/src/di/CoreTokens.ts +2 -6
- package/src/events/ConnectionInvocationEventPublisher.ts +0 -7
- package/src/events/NodeEventPublisher.ts +0 -1
- package/src/events/runEvents.ts +0 -8
- package/src/execution/ActivationEnqueueService.ts +0 -10
- package/src/execution/ChildExecutionScopeFactory.ts +0 -13
- package/src/execution/FanInMergeByOriginMerger.ts +0 -11
- package/src/execution/InProcessRetryRunner.ts +0 -1
- package/src/execution/ItemExprResolver.ts +0 -3
- package/src/execution/NodeActivationRequestComposer.ts +0 -3
- package/src/execution/NodeActivationRequestInputPreparer.ts +0 -5
- package/src/execution/NodeExecutionSnapshotFactory.ts +0 -1
- package/src/execution/NodeExecutor.ts +1 -17
- package/src/execution/NodeSuspensionHandler.ts +1 -39
- package/src/execution/PersistedRunStateTerminalBuilder.ts +0 -5
- package/src/execution/RunSuspendedError.ts +0 -10
- package/src/execution/WorkflowRunExecutionContextFactory.ts +0 -3
- package/src/orchestration/AbortControllerFactory.ts +0 -4
- package/src/orchestration/Engine.ts +0 -9
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +3 -4
- package/src/orchestration/RunContinuationService.ts +7 -39
- package/src/orchestration/RunStartService.ts +0 -7
- package/src/orchestration/TestSuiteOrchestrator.ts +0 -18
- package/src/orchestration/TestSuiteRunIdFactory.ts +0 -4
- package/src/orchestration/TriggerRuntimeService.ts +3 -2
- package/src/planning/CurrentStateFrontierPlanner.ts +0 -1
- package/src/planning/RunQueuePlanner.ts +0 -6
- package/src/policies/executionLimits/EngineExecutionLimitsPolicy.ts +0 -8
- package/src/policies/executionLimits/EngineExecutionLimitsPolicyFactory.ts +0 -3
- package/src/runStorage/RunSummaryMapper.ts +0 -1
- package/src/runtime/EngineFactory.ts +6 -11
- package/src/runtime/RunIntentService.ts +0 -4
- package/src/runtime/WorkflowRepositoryWebhookTriggerMatcher.ts +0 -4
- package/src/runtime-types/InjectableRuntimeDecoratorComposerRegistry.ts +0 -4
- package/src/runtime-types/PersistedRuntimeTypeMetadataStoreRegistry.ts +0 -4
- package/src/runtime-types/PersistedRuntimeTypeNameResolver.ts +0 -1
- package/src/runtime-types/persistedRuntimeTypeModelRegistry.ts +0 -4
- package/src/runtime-types/runtimeTypeDecorators.types.ts +0 -12
- package/src/scheduler/ConfigDrivenOffloadPolicy.ts +0 -1
- package/src/scheduler/DefaultDrivingScheduler.ts +0 -6
- package/src/scheduler/InlineDrivingScheduler.ts +0 -13
- package/src/serialization/ItemsInputNormalizer.ts +0 -5
- package/src/testing/CapturingScheduler.ts +0 -3
- package/src/testing/EngineTestKitRunIdFactory.ts +0 -3
- package/src/testing/ItemHarnessNode.ts +0 -3
- package/src/testing/ItemHarnessNodeConfig.ts +0 -4
- package/src/testing/PrefixedSequentialIdGenerator.ts +0 -3
- package/src/testing/RegistrarEngineTestKit.types.ts +0 -2
- package/src/testing/RejectingCredentialSessionService.ts +0 -4
- package/src/testing/SubWorkflowRunnerTestNode.ts +0 -3
- package/src/testing/WorkflowTestHarnessManualTrigger.ts +0 -3
- package/src/testing/WorkflowTestKitBuilder.ts +0 -4
- package/src/testing/WorkflowTestKitRunNodeWorkflowFactory.ts +0 -3
- package/src/testing.ts +0 -3
- package/src/triggers/polling/PollingTriggerDedupWindow.ts +0 -4
- package/src/triggers/polling/PollingTriggerLogger.ts +0 -5
- package/src/triggers/polling/PollingTriggerRuntime.ts +0 -5
- package/src/types/index.ts +0 -6
- package/src/validation/WorkflowEdgePortValidator.ts +0 -5
- package/src/workflow/definition/ConnectionInvocationIdFactory.ts +0 -7
- package/src/workflow/definition/ConnectionNodeIdFactory.ts +0 -6
- package/src/workflow/definition/NodeIterationIdFactory.ts +0 -13
- package/src/workflow/definition/WorkflowExecutableNodeClassifier.ts +0 -6
- package/src/workflow/dsl/ChainCursorResolver.ts +0 -20
- package/src/workflow/dsl/NodeIdSlugifier.ts +0 -9
- package/src/workflow/dsl/WhenBuilder.ts +0 -17
- package/src/workflow/dsl/WorkflowDefinitionError.ts +0 -9
- package/src/workflow/dsl/workflowBuilderTypes.ts +0 -24
- package/src/workflowSnapshots/MissingRuntimeParityGuard.ts +24 -0
- package/src/workflowSnapshots/PersistedWorkflowTokenRegistry.ts +0 -6
- package/src/workflowSnapshots/WorkflowParityMismatchError.ts +18 -0
- package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +0 -5
- package/src/workflowSnapshots/index.ts +3 -0
- package/dist/EngineRuntimeRegistration.types-BYAmGMdS.d.cts +0 -81
- package/dist/EngineRuntimeRegistration.types-CVLI8DsJ.d.ts +0 -44
- package/dist/ItemsInputNormalizer-B9SdLG24.cjs.map +0 -1
- package/dist/ItemsInputNormalizer-CZEODg94.js.map +0 -1
- package/dist/bootstrap-Be0LB0nh.cjs.map +0 -1
- package/dist/bootstrap-pSQdsMfa.js.map +0 -1
- package/dist/contracts-CK0x6w_G.cjs +0 -74
- package/dist/contracts-CK0x6w_G.cjs.map +0 -1
- package/dist/contracts-DXdfTdpW.js +0 -50
- package/dist/contracts-DXdfTdpW.js.map +0 -1
- package/dist/di-CEV6wTc4.js.map +0 -1
- package/dist/di-DhwtDRgs.cjs.map +0 -1
- package/dist/runtime-CSunvf7A.js.map +0 -1
- package/dist/runtime-n2tqRwaf.cjs.map +0 -1
|
@@ -3,11 +3,6 @@ import { ZodType } from "zod";
|
|
|
3
3
|
import { DependencyContainer as Container, DependencyContainer as DependencyContainer$1, Disposable, InjectionToken as InjectionToken$1, InjectionToken as TypeToken, Lifecycle, RegistrationOptions, container, delay, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, predicateAwareClassFactory, registry, singleton } from "tsyringe";
|
|
4
4
|
|
|
5
5
|
//#region src/contracts/baseTypes.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Minimal base types that have no dependencies on other contracts.
|
|
8
|
-
* Used by credentialTypes, workflowTypes, and other contract layers
|
|
9
|
-
* to avoid circular dependencies.
|
|
10
|
-
*/
|
|
11
6
|
type WorkflowId = string;
|
|
12
7
|
type NodeId = string;
|
|
13
8
|
type OutputPortKey = string;
|
|
@@ -16,21 +11,12 @@ type PersistedTokenId = string;
|
|
|
16
11
|
type NodeConnectionName = string;
|
|
17
12
|
//#endregion
|
|
18
13
|
//#region src/triggers/polling/PollingTriggerDedupWindow.d.ts
|
|
19
|
-
/**
|
|
20
|
-
* Merges processed-ID windows for polling triggers, capping the total to avoid unbounded growth.
|
|
21
|
-
* Plugin code receives an instance of this class via {@link PollingTriggerHandle.dedup}.
|
|
22
|
-
*/
|
|
23
14
|
declare class PollingTriggerDedupWindow {
|
|
24
15
|
static readonly defaultCapN = 2000;
|
|
25
16
|
merge(previous: ReadonlyArray<string>, incoming: ReadonlyArray<string>, capN?: number): ReadonlyArray<string>;
|
|
26
17
|
}
|
|
27
18
|
//#endregion
|
|
28
19
|
//#region src/triggers/polling/PollingTriggerLogger.d.ts
|
|
29
|
-
/**
|
|
30
|
-
* Minimal logger surface for the polling-trigger runtime.
|
|
31
|
-
* Hosts supply this via {@link EngineDeps.pollingTriggerLogger};
|
|
32
|
-
* when absent the runtime is silent.
|
|
33
|
-
*/
|
|
34
20
|
interface PollingTriggerLogger {
|
|
35
21
|
info(message: string): void;
|
|
36
22
|
warn(message: string): void;
|
|
@@ -56,22 +42,11 @@ type CredentialFieldSchema = Readonly<{
|
|
|
56
42
|
type: "string" | "password" | "textarea" | "json" | "boolean";
|
|
57
43
|
required?: true;
|
|
58
44
|
order?: number;
|
|
59
|
-
/**
|
|
60
|
-
* Where this field appears in the credential dialog. Use `"advanced"` for optional or
|
|
61
|
-
* power-user fields; they render inside a collapsible section (see `CredentialTypeDefinition.advancedSection`).
|
|
62
|
-
* Defaults to `"default"` when omitted.
|
|
63
|
-
*/
|
|
64
45
|
visibility?: "default" | "advanced";
|
|
65
46
|
placeholder?: string;
|
|
66
47
|
helpText?: string;
|
|
67
|
-
/** When set, host resolves this field from process.env at runtime; env wins over stored values. */
|
|
68
48
|
envVarName?: string;
|
|
69
|
-
/**
|
|
70
|
-
* When set, the dialog shows a copy action for this exact string (e.g. a static OAuth redirect URI
|
|
71
|
-
* pattern or documentation URL). Do not use for secret values.
|
|
72
|
-
*/
|
|
73
49
|
copyValue?: string;
|
|
74
|
-
/** Accessible label for the copy control (default: Copy). */
|
|
75
50
|
copyButtonLabel?: string;
|
|
76
51
|
}>;
|
|
77
52
|
type CredentialRequirement = Readonly<{
|
|
@@ -126,20 +101,9 @@ type CredentialOAuth2AuthDefinition = Readonly<{
|
|
|
126
101
|
clientSecretFieldKey?: string;
|
|
127
102
|
} | {
|
|
128
103
|
kind: "oauth2";
|
|
129
|
-
/**
|
|
130
|
-
* Free-form provider identifier for telemetry, DB rows, and Better Auth provider naming.
|
|
131
|
-
* Not used for any registry lookup — URLs come from {@link authorizeUrl} / {@link tokenUrl}.
|
|
132
|
-
*/
|
|
133
104
|
providerId: string;
|
|
134
|
-
/**
|
|
135
|
-
* Authorization endpoint. May contain `{publicFieldKey}` placeholders that the runtime
|
|
136
|
-
* substitutes from the credential's resolved public config (URL-encoded).
|
|
137
|
-
* Example: `https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize`
|
|
138
|
-
*/
|
|
139
105
|
authorizeUrl: string;
|
|
140
|
-
/** Token endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
141
106
|
tokenUrl: string;
|
|
142
|
-
/** Optional userinfo endpoint. Same templating rules as {@link authorizeUrl}. */
|
|
143
107
|
userInfoUrl?: string;
|
|
144
108
|
scopes: ReadonlyArray<string>;
|
|
145
109
|
scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig;
|
|
@@ -148,11 +112,8 @@ type CredentialOAuth2AuthDefinition = Readonly<{
|
|
|
148
112
|
}>;
|
|
149
113
|
type CredentialAuthDefinition = CredentialOAuth2AuthDefinition;
|
|
150
114
|
type CredentialAdvancedSectionPresentation = Readonly<{
|
|
151
|
-
/** Collapsible section title (default: "Advanced"). */
|
|
152
115
|
title?: string;
|
|
153
|
-
/** Optional short helper text shown inside the section (above the fields). */
|
|
154
116
|
description?: string;
|
|
155
|
-
/** When true, the advanced section starts expanded. Default: false (collapsed). */
|
|
156
117
|
defaultOpen?: boolean;
|
|
157
118
|
}>;
|
|
158
119
|
type CredentialTypeDefinition = Readonly<{
|
|
@@ -161,23 +122,11 @@ type CredentialTypeDefinition = Readonly<{
|
|
|
161
122
|
description?: string;
|
|
162
123
|
publicFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
163
124
|
secretFields?: ReadonlyArray<CredentialFieldSchema>;
|
|
164
|
-
/**
|
|
165
|
-
* Optional labels for the collapsible block that contains every field with `visibility: "advanced"`.
|
|
166
|
-
* If omitted, the UI still shows that block with defaults (title "Advanced", collapsed).
|
|
167
|
-
*/
|
|
168
125
|
advancedSection?: CredentialAdvancedSectionPresentation;
|
|
169
126
|
supportedSourceKinds?: ReadonlyArray<CredentialMaterialSourceKind>;
|
|
170
127
|
auth?: CredentialAuthDefinition;
|
|
171
128
|
}>;
|
|
172
|
-
/**
|
|
173
|
-
* JSON-shaped credential field bag (public config, resolved secret material, etc.).
|
|
174
|
-
*/
|
|
175
129
|
type CredentialJsonRecord = Readonly<Record<string, unknown>>;
|
|
176
|
-
/**
|
|
177
|
-
* Persisted credential instance with typed `publicConfig`.
|
|
178
|
-
* Hosts may specialize `secretRef` with a stricter union while remaining
|
|
179
|
-
* assignable here for session/test callbacks.
|
|
180
|
-
*/
|
|
181
130
|
type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
182
131
|
instanceId: CredentialInstanceId;
|
|
183
132
|
typeId: CredentialTypeId;
|
|
@@ -189,46 +138,30 @@ type CredentialInstanceRecord<TPublicConfig extends CredentialJsonRecord = Crede
|
|
|
189
138
|
setupStatus: CredentialSetupStatus;
|
|
190
139
|
createdAt: string;
|
|
191
140
|
updatedAt: string;
|
|
192
|
-
/**
|
|
193
|
-
* Pointer to where the credential material bytes live. For OSS / standalone
|
|
194
|
-
* rows this is `{source: "local", ref: instanceId}` and the bytes co-locate
|
|
195
|
-
* with the row in the workspace DB. For managed-mode rows this is
|
|
196
|
-
* `{source: "control-plane", ref: <cp_id>}` and the bytes live at CP.
|
|
197
|
-
*
|
|
198
|
-
* The seam is read through `CredentialMaterialProvider`. See
|
|
199
|
-
* `docs/design/credentials-oauth-unification.md` ("Material provider seam").
|
|
200
|
-
*/
|
|
201
141
|
material: Readonly<{
|
|
202
142
|
source: "local" | "control-plane";
|
|
203
143
|
ref: string;
|
|
204
144
|
}>;
|
|
205
145
|
}>;
|
|
206
|
-
/**
|
|
207
|
-
* Arguments passed to `CredentialType.createSession` and `CredentialType.test`.
|
|
208
|
-
* Declare `TPublicConfig` / `TMaterial` on `CredentialType` so implementations are checked
|
|
209
|
-
* against your credential shapes (similar to `NodeExecutionContext.config` for nodes).
|
|
210
|
-
*/
|
|
211
146
|
type CredentialSessionFactoryArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
212
147
|
instance: CredentialInstanceRecord<TPublicConfig>;
|
|
213
148
|
material: TMaterial;
|
|
214
149
|
publicConfig: TPublicConfig;
|
|
215
150
|
}>;
|
|
216
151
|
type CredentialSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<TSession>;
|
|
152
|
+
type CredentialAccessTokenSessionArgs<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord> = Readonly<{
|
|
153
|
+
accessToken: string;
|
|
154
|
+
grantedScopes: ReadonlyArray<string>;
|
|
155
|
+
publicConfig: TPublicConfig;
|
|
156
|
+
}>;
|
|
157
|
+
type CredentialAccessTokenSessionFactory<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = (args: CredentialAccessTokenSessionArgs<TPublicConfig>) => Promise<TSession>;
|
|
217
158
|
type CredentialHealthTester<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord> = (args: CredentialSessionFactoryArgs<TPublicConfig, TMaterial>) => Promise<CredentialHealth>;
|
|
218
|
-
/**
|
|
219
|
-
* Full credential type implementation: `definition` (UI/schema), `createSession`, and `test`.
|
|
220
|
-
* Use this at registration and config boundaries; `CredentialTypeDefinition` is only the schema slice.
|
|
221
|
-
*/
|
|
222
159
|
type CredentialType<TPublicConfig extends CredentialJsonRecord = CredentialJsonRecord, TMaterial extends CredentialJsonRecord = CredentialJsonRecord, TSession = unknown> = Readonly<{
|
|
223
160
|
definition: CredentialTypeDefinition;
|
|
224
161
|
createSession: CredentialSessionFactory<TPublicConfig, TMaterial, TSession>;
|
|
162
|
+
createSessionFromAccessToken?: CredentialAccessTokenSessionFactory<TPublicConfig, TSession>;
|
|
225
163
|
test: CredentialHealthTester<TPublicConfig, TMaterial>;
|
|
226
164
|
}>;
|
|
227
|
-
/**
|
|
228
|
-
* Credential type with unspecified generics — used for `CodemationConfig.credentialTypes`, the host registry,
|
|
229
|
-
* and anywhere a concrete `CredentialType<YourPublic, YourMaterial, YourSession>` is placed in a heterogeneous list.
|
|
230
|
-
* Using `any` here avoids unsafe `as` casts while keeping typed `satisfies CredentialType<…>` definitions.
|
|
231
|
-
*/
|
|
232
165
|
type AnyCredentialType = CredentialType<any, any, unknown>;
|
|
233
166
|
interface CredentialSessionService {
|
|
234
167
|
getSession<TSession = unknown>(args: Readonly<{
|
|
@@ -249,38 +182,22 @@ declare class CredentialUnboundError extends Error {
|
|
|
249
182
|
}
|
|
250
183
|
//#endregion
|
|
251
184
|
//#region src/contracts/collectionTypes.d.ts
|
|
252
|
-
/**
|
|
253
|
-
* Represents a typed store for a single collection.
|
|
254
|
-
* All rows include auto-managed id, created_at, and updated_at fields.
|
|
255
|
-
*/
|
|
256
185
|
interface CollectionStore<TRow extends Record<string, unknown> = Record<string, unknown>> {
|
|
257
|
-
/**
|
|
258
|
-
* Insert a new row. id, created_at, and updated_at are auto-populated.
|
|
259
|
-
*/
|
|
260
186
|
insert(row: TRow): Promise<TRow & {
|
|
261
187
|
id: string;
|
|
262
188
|
created_at: Date;
|
|
263
189
|
updated_at: Date;
|
|
264
190
|
}>;
|
|
265
|
-
/**
|
|
266
|
-
* Get a single row by id.
|
|
267
|
-
*/
|
|
268
191
|
get(id: string): Promise<(TRow & {
|
|
269
192
|
id: string;
|
|
270
193
|
created_at: Date;
|
|
271
194
|
updated_at: Date;
|
|
272
195
|
}) | null>;
|
|
273
|
-
/**
|
|
274
|
-
* Find a single row matching the provided filter.
|
|
275
|
-
*/
|
|
276
196
|
findOne(filter: Partial<TRow>): Promise<(TRow & {
|
|
277
197
|
id: string;
|
|
278
198
|
created_at: Date;
|
|
279
199
|
updated_at: Date;
|
|
280
200
|
}) | null>;
|
|
281
|
-
/**
|
|
282
|
-
* List rows with optional pagination and filtering.
|
|
283
|
-
*/
|
|
284
201
|
list(opts?: {
|
|
285
202
|
limit?: number;
|
|
286
203
|
offset?: number;
|
|
@@ -293,24 +210,15 @@ interface CollectionStore<TRow extends Record<string, unknown> = Record<string,
|
|
|
293
210
|
}>;
|
|
294
211
|
total: number;
|
|
295
212
|
}>;
|
|
296
|
-
/**
|
|
297
|
-
* Update a row by id with partial data.
|
|
298
|
-
*/
|
|
299
213
|
update(id: string, patch: Partial<TRow>): Promise<TRow & {
|
|
300
214
|
id: string;
|
|
301
215
|
created_at: Date;
|
|
302
216
|
updated_at: Date;
|
|
303
217
|
}>;
|
|
304
|
-
/**
|
|
305
|
-
* Delete a row by id. Hard delete only (no soft delete).
|
|
306
|
-
*/
|
|
307
218
|
delete(id: string): Promise<{
|
|
308
219
|
deleted: boolean;
|
|
309
220
|
}>;
|
|
310
221
|
}
|
|
311
|
-
/**
|
|
312
|
-
* Runtime collections context: keyed by collection name.
|
|
313
|
-
*/
|
|
314
222
|
type CollectionsContext = Readonly<Record<string, CollectionStore>>;
|
|
315
223
|
//#endregion
|
|
316
224
|
//#region src/contracts/CostTrackingTelemetryContract.d.ts
|
|
@@ -363,7 +271,6 @@ declare class NoOpTelemetryArtifactReference {
|
|
|
363
271
|
//#region src/contracts/NoOpTelemetrySpanScope.d.ts
|
|
364
272
|
declare class NoOpTelemetrySpanScope {
|
|
365
273
|
static readonly value: TelemetrySpanScope;
|
|
366
|
-
/** Internal: the shared no-op {@link NodeExecutionTelemetry} that {@link NoOpNodeExecutionTelemetry} re-exposes. */
|
|
367
274
|
static readonly nodeExecutionTelemetryValue: NodeExecutionTelemetry;
|
|
368
275
|
}
|
|
369
276
|
//#endregion
|
|
@@ -399,25 +306,15 @@ declare class CodemationTelemetryAttributeNames {
|
|
|
399
306
|
static readonly connectionInvocationId = "codemation.connection.invocation_id";
|
|
400
307
|
static readonly toolName = "codemation.tool.name";
|
|
401
308
|
static readonly traceParentRunId = "codemation.parent.run.id";
|
|
402
|
-
/** Per-item iteration that emitted this span/metric. Set on spans recorded inside a runnable per-item loop. */
|
|
403
309
|
static readonly iterationId = "codemation.iteration.id";
|
|
404
|
-
/** Item index (0-based) of the iteration. */
|
|
405
310
|
static readonly iterationIndex = "codemation.iteration.index";
|
|
406
|
-
/** Set when this span/metric was recorded under a sub-agent triggered by an outer LLM/tool call. */
|
|
407
311
|
static readonly parentInvocationId = "codemation.parent.invocation_id";
|
|
408
|
-
/** MCP server id on spans created for callTool invocations. */
|
|
409
312
|
static readonly mcpServerId = "mcp.server_id";
|
|
410
|
-
/** MCP tool name on spans created for callTool invocations. */
|
|
411
313
|
static readonly mcpToolName = "mcp.tool_name";
|
|
412
|
-
/** Terminal node-execution status (e.g. `"hitl-approved"`, `"hitl-rejected"`) on HITL outcome spans. */
|
|
413
314
|
static readonly nodeExecutionStatus = "codemation.node.execution_status";
|
|
414
|
-
/** Populated on run-halted spans; discriminates the halt reason (e.g. `"hitl-rejected"`). */
|
|
415
315
|
static readonly runHaltReason = "codemation.run.halt_reason";
|
|
416
|
-
/** Human task ID on `hitl.task.*` span events. */
|
|
417
316
|
static readonly hitlTaskId = "codemation.hitl.task_id";
|
|
418
|
-
/** HITL channel name (e.g. `"inbox"`, `"control-plane-inbox"`) on `hitl.task.*` span events. */
|
|
419
317
|
static readonly hitlChannel = "codemation.hitl.channel";
|
|
420
|
-
/** Decision outcome (e.g. `"approved"`, `"rejected"`) on `hitl.task.decided` span events. */
|
|
421
318
|
static readonly hitlDecisionStatus = "codemation.hitl.decision_status";
|
|
422
319
|
}
|
|
423
320
|
//#endregion
|
|
@@ -498,13 +395,6 @@ interface TelemetrySpanScope extends TelemetryScope {
|
|
|
498
395
|
readonly traceId: string;
|
|
499
396
|
readonly spanId: string;
|
|
500
397
|
end(args?: TelemetrySpanEnd): Promise<void> | void;
|
|
501
|
-
/**
|
|
502
|
-
* Lift this span into a {@link NodeExecutionTelemetry} scoped to a different (nodeId, activationId).
|
|
503
|
-
* Children created via the returned telemetry's `startChildSpan` get this span as their parent.
|
|
504
|
-
*
|
|
505
|
-
* Used at the sub-agent boundary so that nested runtime telemetry parents under the agent.tool.call
|
|
506
|
-
* span instead of the orchestrator's node-level span.
|
|
507
|
-
*/
|
|
508
398
|
asNodeTelemetry(args: Readonly<{
|
|
509
399
|
nodeId: NodeId;
|
|
510
400
|
activationId: NodeActivationId;
|
|
@@ -531,14 +421,9 @@ interface ExecutionTelemetryFactory {
|
|
|
531
421
|
}
|
|
532
422
|
//#endregion
|
|
533
423
|
//#region src/contracts/workflowActivationPolicy.d.ts
|
|
534
|
-
/**
|
|
535
|
-
* Host-controlled policy: when false, trigger {@link TriggerNode} setup is skipped and webhook routes
|
|
536
|
-
* for that workflow are not registered (see engine trigger runtime + webhook matcher).
|
|
537
|
-
*/
|
|
538
424
|
interface WorkflowActivationPolicy {
|
|
539
425
|
isActive(workflowId: WorkflowId): boolean;
|
|
540
426
|
}
|
|
541
|
-
/** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
|
|
542
427
|
declare class AllWorkflowsActiveWorkflowActivationPolicy implements WorkflowActivationPolicy {
|
|
543
428
|
isActive(_workflowId: WorkflowId): boolean;
|
|
544
429
|
}
|
|
@@ -553,23 +438,19 @@ interface WebhookControlSignal {
|
|
|
553
438
|
}
|
|
554
439
|
interface WebhookTriggerRoutingDiagnostics {
|
|
555
440
|
warn(message: string): void;
|
|
556
|
-
/** Inactive workflows omitted from the webhook route index (optional; host should wire for clarity at boot/reload). */
|
|
557
441
|
info?(message: string): void;
|
|
558
442
|
}
|
|
559
443
|
interface TriggerInstanceId {
|
|
560
444
|
workflowId: WorkflowId;
|
|
561
445
|
nodeId: NodeId;
|
|
562
446
|
}
|
|
563
|
-
/** Match for an incoming HTTP request: user-defined URL segment + workflow trigger node. */
|
|
564
447
|
interface WebhookInvocationMatch {
|
|
565
|
-
/** Same value as the webhook trigger's configured endpoint key (URL segment under the webhook base path). */
|
|
566
448
|
endpointPath: string;
|
|
567
449
|
workflowId: WorkflowId;
|
|
568
450
|
nodeId: NodeId;
|
|
569
451
|
methods: ReadonlyArray<HttpMethod>;
|
|
570
452
|
parseJsonBody?: (body: unknown) => unknown;
|
|
571
453
|
}
|
|
572
|
-
/** Result of resolving an HTTP method + endpoint path against the catalog webhook index (404 vs 405 vs match). */
|
|
573
454
|
type WebhookTriggerResolution = {
|
|
574
455
|
status: "notFound";
|
|
575
456
|
} | {
|
|
@@ -579,9 +460,6 @@ type WebhookTriggerResolution = {
|
|
|
579
460
|
status: "ok";
|
|
580
461
|
match: WebhookInvocationMatch;
|
|
581
462
|
};
|
|
582
|
-
/**
|
|
583
|
-
* Resolves webhook routes from workflow definitions (catalog-backed index, no registration at trigger setup).
|
|
584
|
-
*/
|
|
585
463
|
interface WebhookTriggerMatcher {
|
|
586
464
|
match(args: {
|
|
587
465
|
endpointPath: string;
|
|
@@ -590,52 +468,29 @@ interface WebhookTriggerMatcher {
|
|
|
590
468
|
lookup(endpointPath: string): WebhookInvocationMatch | undefined;
|
|
591
469
|
onEngineWorkflowsLoaded?(): void;
|
|
592
470
|
onEngineStopped?(): void;
|
|
593
|
-
/** Rebuild route index after activation changes without stopping the engine. */
|
|
594
471
|
reloadWebhookRoutes?(): void;
|
|
595
472
|
}
|
|
596
473
|
//#endregion
|
|
597
474
|
//#region src/contracts/runtimeTypes.d.ts
|
|
598
|
-
/** Opaque unique identifier for a single HumanTask instance. */
|
|
599
475
|
type HumanTaskId = string;
|
|
600
|
-
/**
|
|
601
|
-
* Duration string — ISO 8601 duration ("PT24H") or shorthand ("24h").
|
|
602
|
-
* Parsed by the timeout job; stored as-is in the suspension record.
|
|
603
|
-
*/
|
|
604
476
|
type Duration = string;
|
|
605
|
-
/**
|
|
606
|
-
* Minimal handle handed to the `deliver` callback so it can route to the correct
|
|
607
|
-
* inbox channel.
|
|
608
|
-
*/
|
|
609
477
|
interface HumanTaskHandle {
|
|
610
478
|
readonly taskId: HumanTaskId;
|
|
611
479
|
readonly runId: string;
|
|
612
480
|
readonly nodeId: string;
|
|
613
481
|
readonly expiresAt: Date;
|
|
614
|
-
/** TODO: real signed URL; placeholder empty string for now. */
|
|
615
482
|
readonly resumeUrl: string;
|
|
616
|
-
/**
|
|
617
|
-
* Arbitrary JSON metadata copied from `SuspensionRequest.request.metadata` at suspension time.
|
|
618
|
-
* Used by the agent runtime to round-trip the `agentCheckpoint` back to the
|
|
619
|
-
* resumed node via `ctx.resumeContext.task.metadata`.
|
|
620
|
-
*/
|
|
621
483
|
readonly metadata?: Readonly<Record<string, JsonValue>>;
|
|
622
484
|
}
|
|
623
|
-
/** Human-readable description surface shown to the reviewer. */
|
|
624
485
|
interface HumanTaskSubject {
|
|
625
486
|
readonly title: string;
|
|
626
487
|
readonly summary: string;
|
|
627
488
|
readonly attributes?: JsonValue;
|
|
628
489
|
}
|
|
629
|
-
/** Identity of the person who made a decision on the task. */
|
|
630
490
|
interface HumanTaskActor {
|
|
631
491
|
readonly actorId: string;
|
|
632
492
|
readonly displayName?: string;
|
|
633
493
|
}
|
|
634
|
-
/**
|
|
635
|
-
* Resume context injected into `NodeExecutionContext` when the engine re-activates
|
|
636
|
-
* a previously suspended node. `defineHumanApprovalNode` wraps this with parsed
|
|
637
|
-
* `TDecision`; at the engine layer `decision.value` is `unknown`.
|
|
638
|
-
*/
|
|
639
494
|
interface ResumeContext {
|
|
640
495
|
readonly decision: Readonly<{
|
|
641
496
|
kind: "decided";
|
|
@@ -652,25 +507,6 @@ interface ResumeContext {
|
|
|
652
507
|
readonly delivery: JsonValue;
|
|
653
508
|
readonly task: HumanTaskHandle;
|
|
654
509
|
}
|
|
655
|
-
/**
|
|
656
|
-
* Thrown by a node's `execute()` to request durable suspension of the current item.
|
|
657
|
-
* The engine catches this, persists the suspension entry, calls `deliver`, and
|
|
658
|
-
* continues to the next item (per-item semantics).
|
|
659
|
-
*
|
|
660
|
-
* @example
|
|
661
|
-
* ```ts
|
|
662
|
-
* throw new SuspensionRequest({
|
|
663
|
-
* decisionSchema: z.object({ approved: z.boolean() }),
|
|
664
|
-
* timeout: "PT24H",
|
|
665
|
-
* onTimeout: "halt",
|
|
666
|
-
* subject: { title: "Approve invoice", summary: "Invoice #1234 needs approval" },
|
|
667
|
-
* deliver: async (handle) => {
|
|
668
|
-
* await notifySlack(handle);
|
|
669
|
-
* return { channel: "slack", ts: "..." };
|
|
670
|
-
* },
|
|
671
|
-
* });
|
|
672
|
-
* ```
|
|
673
|
-
*/
|
|
674
510
|
declare class SuspensionRequest<TDecision = unknown, TDelivery extends JsonValue = JsonValue> extends Error {
|
|
675
511
|
readonly request: Readonly<{
|
|
676
512
|
decisionSchema: ZodType<TDecision>;
|
|
@@ -734,11 +570,6 @@ interface NodeExecutionStatePublisher {
|
|
|
734
570
|
error: Error;
|
|
735
571
|
}): Promise<void>;
|
|
736
572
|
appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
|
|
737
|
-
/**
|
|
738
|
-
* Annotates the current snapshot for `nodeId` with the id of the child run spawned by a
|
|
739
|
-
* SubWorkflow invocation. Called from `SubWorkflowNode.execute` after `runById` resolves.
|
|
740
|
-
* The engine's subsequent `markCompleted` call preserves the value via `previous.childRunId`.
|
|
741
|
-
*/
|
|
742
573
|
setChildRunId?(args: {
|
|
743
574
|
nodeId: NodeId;
|
|
744
575
|
childRunId: RunId;
|
|
@@ -768,9 +599,7 @@ interface BinaryStorage {
|
|
|
768
599
|
openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
|
|
769
600
|
stat(storageKey: string): Promise<BinaryStorageStatResult>;
|
|
770
601
|
delete(storageKey: string): Promise<void>;
|
|
771
|
-
/** Deletes multiple objects in bulk. Keys are batched internally. */
|
|
772
602
|
deleteMany(storageKeys: ReadonlyArray<string>): Promise<void>;
|
|
773
|
-
/** Lists all keys sharing a common prefix. Returns keys in arbitrary order. */
|
|
774
603
|
listByPrefix(prefix: string): Promise<ReadonlyArray<string>>;
|
|
775
604
|
}
|
|
776
605
|
interface BinaryAttachmentCreateRequest {
|
|
@@ -784,7 +613,6 @@ interface NodeBinaryAttachmentService extends ExecutionBinaryService {
|
|
|
784
613
|
attach(args: BinaryAttachmentCreateRequest): Promise<BinaryAttachment>;
|
|
785
614
|
withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
|
|
786
615
|
}
|
|
787
|
-
/** Default maximum bytes read into memory by the bounded helpers (50 MiB). */
|
|
788
616
|
declare const BINARY_DEFAULT_MAX_BYTES: number;
|
|
789
617
|
interface ExecutionBinaryService {
|
|
790
618
|
forNode(args: {
|
|
@@ -792,32 +620,16 @@ interface ExecutionBinaryService {
|
|
|
792
620
|
activationId: NodeActivationId;
|
|
793
621
|
}): NodeBinaryAttachmentService;
|
|
794
622
|
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
795
|
-
/**
|
|
796
|
-
* Reads all bytes from the attachment into a contiguous `Uint8Array`.
|
|
797
|
-
* Checks `attachment.size` against `maxBytes` *before* any allocation; throws a bounded-read
|
|
798
|
-
* error when exceeded (no OOM). Throws if the stream is unavailable or the byte count mismatches.
|
|
799
|
-
*/
|
|
800
623
|
getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;
|
|
801
|
-
/**
|
|
802
|
-
* Reads the attachment and decodes the bytes as UTF-8 text.
|
|
803
|
-
* Subject to the same bounded-read safety as `getBytes`.
|
|
804
|
-
*/
|
|
805
624
|
getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;
|
|
806
|
-
/**
|
|
807
|
-
* Reads the attachment, decodes as UTF-8 text, and parses as JSON.
|
|
808
|
-
* Throws a clear error on invalid JSON. Subject to the same bounded-read safety.
|
|
809
|
-
*/
|
|
810
625
|
getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;
|
|
811
626
|
}
|
|
812
627
|
interface ExecutionContext {
|
|
813
628
|
runId: RunId;
|
|
814
629
|
workflowId: WorkflowId;
|
|
815
630
|
parent?: ParentExecutionRef;
|
|
816
|
-
/** This run's subworkflow depth (0 = root). */
|
|
817
631
|
subworkflowDepth: number;
|
|
818
|
-
/** Effective activation budget cap for this run (after policy merge). */
|
|
819
632
|
engineMaxNodeActivations: number;
|
|
820
|
-
/** Effective subworkflow nesting cap for this run (after policy merge). */
|
|
821
633
|
engineMaxSubworkflowDepth: number;
|
|
822
634
|
now: () => Date;
|
|
823
635
|
data: RunDataSnapshot;
|
|
@@ -825,28 +637,11 @@ interface ExecutionContext {
|
|
|
825
637
|
telemetry: ExecutionTelemetry;
|
|
826
638
|
binary: ExecutionBinaryService;
|
|
827
639
|
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
828
|
-
/** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */
|
|
829
640
|
iterationId?: NodeIterationId;
|
|
830
|
-
/** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */
|
|
831
641
|
itemIndex?: number;
|
|
832
|
-
/** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */
|
|
833
642
|
parentInvocationId?: ConnectionInvocationId;
|
|
834
|
-
/**
|
|
835
|
-
* Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}
|
|
836
|
-
* branches on this; assertion-emitting nodes use it to decide whether to record results.
|
|
837
|
-
*/
|
|
838
643
|
testContext?: RunTestContext;
|
|
839
|
-
/**
|
|
840
|
-
* Collections registered in the codemation config, keyed by collection name.
|
|
841
|
-
*/
|
|
842
644
|
readonly collections?: CollectionsContext;
|
|
843
|
-
/**
|
|
844
|
-
* Resolve a DI token from the host container.
|
|
845
|
-
* Allows nodes to reach host-side services (e.g. `InboxChannelResolverToken`)
|
|
846
|
-
* without importing host code. Wired by `DefaultExecutionContextFactory`; throws
|
|
847
|
-
* a clear error when no resolver is configured (e.g. in unit tests that don't
|
|
848
|
-
* set up the full container).
|
|
849
|
-
*/
|
|
850
645
|
resolve<T>(token: TypeToken<T>): T;
|
|
851
646
|
}
|
|
852
647
|
interface ExecutionContextFactory {
|
|
@@ -871,18 +666,9 @@ interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase>
|
|
|
871
666
|
config: TConfig;
|
|
872
667
|
telemetry: NodeExecutionTelemetry;
|
|
873
668
|
binary: NodeBinaryAttachmentService;
|
|
874
|
-
/**
|
|
875
|
-
* Present when this node activation is a HITL resume.
|
|
876
|
-
* The node checks `ctx.resumeContext !== undefined` and takes the resume branch.
|
|
877
|
-
*/
|
|
878
669
|
resumeContext?: ResumeContext;
|
|
879
670
|
}
|
|
880
|
-
interface
|
|
881
|
-
/**
|
|
882
|
-
* Start the polling loop. The runtime registers its own cleanup handle so callers do not need to
|
|
883
|
-
* call {@link TriggerSetupContext.registerCleanup} for the loop.
|
|
884
|
-
* @returns The state returned by the first cycle (or `undefined` when the overlap guard fired).
|
|
885
|
-
*/
|
|
671
|
+
interface TriggerPollingPort {
|
|
886
672
|
start<TState, TItem>(args: {
|
|
887
673
|
intervalMs: number;
|
|
888
674
|
seedState?: TState;
|
|
@@ -894,7 +680,8 @@ interface PollingTriggerHandle {
|
|
|
894
680
|
nextState: TState;
|
|
895
681
|
}>;
|
|
896
682
|
}): Promise<TState | undefined>;
|
|
897
|
-
|
|
683
|
+
}
|
|
684
|
+
interface PollingTriggerHandle extends TriggerPollingPort {
|
|
898
685
|
readonly dedup: PollingTriggerDedupWindow;
|
|
899
686
|
}
|
|
900
687
|
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
@@ -903,7 +690,6 @@ interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = Trig
|
|
|
903
690
|
previousState: TSetupState$1;
|
|
904
691
|
registerCleanup(cleanup: TriggerCleanupHandle): void;
|
|
905
692
|
emit(items: Items): Promise<void>;
|
|
906
|
-
/** Generic polling-trigger surface. Pre-binds trigger id, emit, and registerCleanup. */
|
|
907
693
|
readonly polling: PollingTriggerHandle;
|
|
908
694
|
}
|
|
909
695
|
interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
@@ -912,11 +698,6 @@ interface TriggerTestItemsContext<TConfig extends TriggerNodeConfig<any, any> =
|
|
|
912
698
|
config: TConfig;
|
|
913
699
|
previousState: TSetupState$1;
|
|
914
700
|
}
|
|
915
|
-
/**
|
|
916
|
-
* Trigger setup state is intentionally engine-owned so future ownership and
|
|
917
|
-
* leader-election metadata can be coordinated centrally rather than pushed into
|
|
918
|
-
* package-level setup code.
|
|
919
|
-
*/
|
|
920
701
|
interface PersistedTriggerSetupState<TState extends JsonValue | undefined = JsonValue | undefined> {
|
|
921
702
|
trigger: TriggerInstanceId;
|
|
922
703
|
updatedAt: string;
|
|
@@ -934,12 +715,6 @@ interface EngineHost {
|
|
|
934
715
|
credentialSessions: CredentialSessionService;
|
|
935
716
|
workflows?: WorkflowRunnerService;
|
|
936
717
|
}
|
|
937
|
-
/**
|
|
938
|
-
* Per-item runnable node: return JSON, an array to fan-out on `main`, an explicit `Item`, or {@link emitPorts}
|
|
939
|
-
* for multi-port emission. Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input`
|
|
940
|
-
* (wire `item.json` is unchanged). Transform helpers may opt into binary preservation, while routers and
|
|
941
|
-
* pass-through nodes should return explicit items when they need to preserve full item state.
|
|
942
|
-
*/
|
|
943
718
|
interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown> {
|
|
944
719
|
readonly input: TInputJson$1;
|
|
945
720
|
readonly item: Item;
|
|
@@ -949,27 +724,13 @@ interface RunnableNodeExecuteArgs<TConfig extends RunnableNodeConfig<any, any> =
|
|
|
949
724
|
}
|
|
950
725
|
interface RunnableNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, _TOutputJson = unknown> {
|
|
951
726
|
readonly kind: "node";
|
|
952
|
-
/**
|
|
953
|
-
* Declared output ports (e.g. `["main"]`).
|
|
954
|
-
*
|
|
955
|
-
* Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
|
|
956
|
-
* via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
|
|
957
|
-
*/
|
|
958
727
|
readonly outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
959
|
-
/** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
|
|
960
728
|
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
961
729
|
execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson$1>): Promise<unknown> | unknown;
|
|
962
730
|
}
|
|
963
|
-
/** @deprecated Use {@link RunnableNode} */
|
|
964
731
|
type ItemNode<TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>, TInputJson$1 = unknown, TOutputJson$1 = unknown> = RunnableNode<TConfig, TInputJson$1, TOutputJson$1>;
|
|
965
732
|
interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
|
|
966
733
|
kind: "node";
|
|
967
|
-
/**
|
|
968
|
-
* Declared output ports (typically `["main"]`).
|
|
969
|
-
*
|
|
970
|
-
* Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.
|
|
971
|
-
* Engine defaults to `["main"]` when omitted.
|
|
972
|
-
*/
|
|
973
734
|
outputPorts?: ReadonlyArray<OutputPortKey>;
|
|
974
735
|
executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
|
|
975
736
|
}
|
|
@@ -1070,7 +831,6 @@ interface WorkflowSnapshotResolver {
|
|
|
1070
831
|
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
1071
832
|
}): WorkflowDefinition | undefined;
|
|
1072
833
|
}
|
|
1073
|
-
/** Optional host wiring for trigger lifecycle logs (boot skip + activation sync). */
|
|
1074
834
|
interface TriggerRuntimeDiagnostics {
|
|
1075
835
|
info(message: string): void;
|
|
1076
836
|
warn(message: string): void;
|
|
@@ -1079,7 +839,6 @@ interface EngineDeps {
|
|
|
1079
839
|
credentialSessions: CredentialSessionService;
|
|
1080
840
|
liveWorkflowRepository: LiveWorkflowRepository;
|
|
1081
841
|
workflowRepository: WorkflowRepository;
|
|
1082
|
-
/** When {@link AllWorkflowsActiveWorkflowActivationPolicy}, all workflows behave as active (tests). */
|
|
1083
842
|
workflowActivationPolicy: WorkflowActivationPolicy;
|
|
1084
843
|
nodeResolver: NodeResolver;
|
|
1085
844
|
triggerSetupStateRepository: TriggerSetupStateRepository;
|
|
@@ -1095,39 +854,27 @@ interface EngineDeps {
|
|
|
1095
854
|
eventBus?: RunEventBus;
|
|
1096
855
|
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
1097
856
|
workflowNodeInstanceFactory: WorkflowNodeInstanceFactory;
|
|
1098
|
-
/** Defaults for prune/storage snapshot when workflow omits explicit policy fields. */
|
|
1099
857
|
workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
|
|
1100
|
-
/** When set, logs inactive-workflow skips at boot and trigger start/stop on activation changes. */
|
|
1101
858
|
triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
|
|
1102
|
-
/** When set, the polling-trigger runtime uses this logger for cycle info/debug/error. */
|
|
1103
859
|
pollingTriggerLogger?: PollingTriggerLogger;
|
|
1104
860
|
}
|
|
1105
861
|
//#endregion
|
|
1106
862
|
//#region src/contracts/retryPolicySpec.types.d.ts
|
|
1107
|
-
/**
|
|
1108
|
-
* In-process retry policy for runnable nodes. Serialized configs use the same
|
|
1109
|
-
* `kind` discriminator (`JSON.stringify` / persisted workflows).
|
|
1110
|
-
*
|
|
1111
|
-
* `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
|
|
1112
|
-
*/
|
|
1113
863
|
type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
|
|
1114
864
|
interface NoneRetryPolicySpec {
|
|
1115
865
|
readonly kind: "none";
|
|
1116
866
|
}
|
|
1117
867
|
interface FixedRetryPolicySpec {
|
|
1118
868
|
readonly kind: "fixed";
|
|
1119
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
1120
869
|
readonly maxAttempts: number;
|
|
1121
870
|
readonly delayMs: number;
|
|
1122
871
|
}
|
|
1123
872
|
interface ExponentialRetryPolicySpec {
|
|
1124
873
|
readonly kind: "exponential";
|
|
1125
|
-
/** Total attempts including the first execution. Must be >= 1. */
|
|
1126
874
|
readonly maxAttempts: number;
|
|
1127
875
|
readonly initialDelayMs: number;
|
|
1128
876
|
readonly multiplier: number;
|
|
1129
877
|
readonly maxDelayMs?: number;
|
|
1130
|
-
/** When true, each delay is multiplied by a random factor in [1, 1.2). */
|
|
1131
878
|
readonly jitter?: boolean;
|
|
1132
879
|
}
|
|
1133
880
|
//#endregion
|
|
@@ -1142,7 +889,6 @@ interface JsonObject {
|
|
|
1142
889
|
}
|
|
1143
890
|
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
1144
891
|
type JsonArray = ReadonlyArray<JsonValue>;
|
|
1145
|
-
/** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
|
|
1146
892
|
type JsonNonArray = JsonPrimitive | JsonObject;
|
|
1147
893
|
interface Edge {
|
|
1148
894
|
from: {
|
|
@@ -1154,11 +900,6 @@ interface Edge {
|
|
|
1154
900
|
input: InputPortKey;
|
|
1155
901
|
};
|
|
1156
902
|
}
|
|
1157
|
-
/**
|
|
1158
|
-
* Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
|
|
1159
|
-
* but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
|
|
1160
|
-
* also be connection-owned nodes for recursive agent attachments.
|
|
1161
|
-
*/
|
|
1162
903
|
interface WorkflowNodeConnection {
|
|
1163
904
|
readonly parentNodeId: NodeId;
|
|
1164
905
|
readonly connectionName: NodeConnectionName;
|
|
@@ -1169,18 +910,10 @@ interface WorkflowDefinition {
|
|
|
1169
910
|
name: string;
|
|
1170
911
|
nodes: NodeDefinition[];
|
|
1171
912
|
edges: Edge[];
|
|
1172
|
-
/**
|
|
1173
|
-
* Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
|
|
1174
|
-
* When omitted, all nodes in {@link nodes} are treated as executable for topology.
|
|
1175
|
-
*/
|
|
1176
913
|
readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
1177
|
-
/** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
|
|
1178
914
|
discoveryPathSegments?: readonly string[];
|
|
1179
|
-
/** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
|
|
1180
915
|
readonly prunePolicy?: WorkflowPrunePolicySpec;
|
|
1181
|
-
/** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
|
|
1182
916
|
readonly storagePolicy?: WorkflowStoragePolicySpec;
|
|
1183
|
-
/** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
|
|
1184
917
|
readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
|
|
1185
918
|
}
|
|
1186
919
|
interface WorkflowGraph {
|
|
@@ -1198,59 +931,26 @@ interface NodeConfigBase {
|
|
|
1198
931
|
readonly name?: string;
|
|
1199
932
|
readonly id?: NodeId;
|
|
1200
933
|
readonly icon?: string;
|
|
1201
|
-
/**
|
|
1202
|
-
* Plain-language, non-technical explanation of what this node does, surfaced in the workflow
|
|
1203
|
-
* inspector / node properties sidebar. A first-class config option every authorable node accepts
|
|
1204
|
-
* directly (alongside `id`), so it flows into the persisted config the mappers read. Distinct from
|
|
1205
|
-
* {@link inspectorSummary} (config-derived label/value rows).
|
|
1206
|
-
*/
|
|
1207
934
|
readonly description?: string;
|
|
1208
935
|
readonly execution?: Readonly<{
|
|
1209
936
|
hint?: "local" | "worker";
|
|
1210
937
|
queue?: string;
|
|
1211
938
|
}>;
|
|
1212
|
-
/** In-process execute retries (runnable nodes). Triggers typically omit this. */
|
|
1213
939
|
readonly retryPolicy?: RetryPolicySpec;
|
|
1214
|
-
/** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
|
|
1215
940
|
readonly nodeErrorHandler?: NodeErrorHandlerSpec;
|
|
1216
|
-
/**
|
|
1217
|
-
* When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
|
|
1218
|
-
* Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
|
|
1219
|
-
* main batches skip downstream execution and propagate the empty path.
|
|
1220
|
-
*/
|
|
1221
941
|
readonly continueWhenEmptyOutput?: boolean;
|
|
1222
|
-
/**
|
|
1223
|
-
* Declared I/O port names for canvas authoring (unioned with ports inferred from edges).
|
|
1224
|
-
* Use for dynamic routers (Switch) and future error ports.
|
|
1225
|
-
*/
|
|
1226
942
|
readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
|
|
1227
943
|
readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
|
|
1228
944
|
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
1229
|
-
/**
|
|
1230
|
-
* Marker: this node emits {@link import("./assertionTypes").AssertionResult}-shaped items on its
|
|
1231
|
-
* `main` port. The TestSuiteOrchestrator (and host-side TestAssertionPersister) listen for
|
|
1232
|
-
* `nodeCompleted` events from nodes with this flag set, and persist their output items as
|
|
1233
|
-
* TestAssertion records (only when the run carries a `testContext`). Set on assertion node
|
|
1234
|
-
* configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
|
|
1235
|
-
*/
|
|
1236
945
|
readonly emitsAssertions?: true;
|
|
1237
|
-
/**
|
|
1238
|
-
* Static configuration summary surfaced in the workflow inspector — the design-time
|
|
1239
|
-
* "what does this node do" panel that renders before any run telemetry exists.
|
|
1240
|
-
*
|
|
1241
|
-
* Return 2–6 short label/value pairs derived from this config (method + url for an HTTP
|
|
1242
|
-
* call, model + tool list for an agent, schedule + timezone for a cron trigger, etc.).
|
|
1243
|
-
* Values are truncated by the UI; aim for one line each. Return `undefined` to opt out
|
|
1244
|
-
* — the inspector hides the section when no rows are produced.
|
|
1245
|
-
*
|
|
1246
|
-
* Implement on the config class instance so the function can read sibling config fields.
|
|
1247
|
-
* `defineNode({ inspectorSummary })` plumbs through to this.
|
|
1248
|
-
*/
|
|
1249
946
|
inspectorSummary?(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
|
|
1250
947
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
948
|
+
interface PollingTriggerConfig {
|
|
949
|
+
getTriggerPollConfig(): Readonly<{
|
|
950
|
+
config: JsonObject;
|
|
951
|
+
pollIntervalMs?: number;
|
|
952
|
+
}>;
|
|
953
|
+
}
|
|
1254
954
|
interface NodeInspectorSummaryRow {
|
|
1255
955
|
readonly label: string;
|
|
1256
956
|
readonly value: string;
|
|
@@ -1258,24 +958,11 @@ interface NodeInspectorSummaryRow {
|
|
|
1258
958
|
declare const runnableNodeInputType: unique symbol;
|
|
1259
959
|
declare const runnableNodeOutputType: unique symbol;
|
|
1260
960
|
declare const triggerNodeOutputType: unique symbol;
|
|
1261
|
-
/**
|
|
1262
|
-
* Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
|
|
1263
|
-
* **`TOutputJson`** is emitted `item.json` on outputs.
|
|
1264
|
-
*/
|
|
1265
961
|
interface RunnableNodeConfig<TInputJson$1 = unknown, TOutputJson$1 = unknown> extends NodeConfigBase {
|
|
1266
962
|
readonly kind: "node";
|
|
1267
963
|
readonly [runnableNodeInputType]?: TInputJson$1;
|
|
1268
964
|
readonly [runnableNodeOutputType]?: TOutputJson$1;
|
|
1269
|
-
/**
|
|
1270
|
-
* Optional Zod input contract for {@link RunnableNode} when not set on the node class.
|
|
1271
|
-
* Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
|
|
1272
|
-
*/
|
|
1273
965
|
readonly inputSchema?: ZodType<TInputJson$1>;
|
|
1274
|
-
/**
|
|
1275
|
-
* When an activation receives **zero** input items, the engine normally runs `execute` zero times.
|
|
1276
|
-
* Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
|
|
1277
|
-
* Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.
|
|
1278
|
-
*/
|
|
1279
966
|
readonly emptyBatchExecution?: "skip" | "runOnce";
|
|
1280
967
|
}
|
|
1281
968
|
declare const triggerNodeSetupStateType: unique symbol;
|
|
@@ -1283,11 +970,6 @@ interface TriggerNodeConfig<TOutputJson$1 = unknown, TSetupState$1 extends JsonV
|
|
|
1283
970
|
readonly kind: "trigger";
|
|
1284
971
|
readonly [triggerNodeOutputType]?: TOutputJson$1;
|
|
1285
972
|
readonly [triggerNodeSetupStateType]?: TSetupState$1;
|
|
1286
|
-
/**
|
|
1287
|
-
* Distinguishes triggers driven by the live activation policy (webhooks, cron, polling) from
|
|
1288
|
-
* triggers driven only by the {@link TestSuiteOrchestrator}. `WorkflowActivation` skips
|
|
1289
|
-
* `"test"` triggers; the orchestrator skips `"live"` triggers. Defaults to `"live"` when omitted.
|
|
1290
|
-
*/
|
|
1291
973
|
readonly triggerKind?: "live" | "test";
|
|
1292
974
|
}
|
|
1293
975
|
type RunnableNodeInputJson<TConfig extends RunnableNodeConfig<any, any>> = TConfig extends RunnableNodeConfig<infer TInputJson, any> ? TInputJson : never;
|
|
@@ -1339,27 +1021,14 @@ type Items<TJson = unknown> = ReadonlyArray<Item<TJson>>;
|
|
|
1339
1021
|
type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
|
|
1340
1022
|
type RunId = string;
|
|
1341
1023
|
type NodeActivationId = string;
|
|
1342
|
-
/**
|
|
1343
|
-
* One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for
|
|
1344
|
-
* per-item connection invocations and telemetry. Undefined when the executing node is a batch
|
|
1345
|
-
* node or trigger that does not iterate items.
|
|
1346
|
-
*/
|
|
1347
1024
|
type NodeIterationId = string;
|
|
1348
1025
|
interface ParentExecutionRef {
|
|
1349
1026
|
runId: RunId;
|
|
1350
1027
|
workflowId: WorkflowId;
|
|
1351
1028
|
nodeId: NodeId;
|
|
1352
|
-
/** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
|
|
1353
1029
|
subworkflowDepth?: number;
|
|
1354
|
-
/** Effective max node activations from the parent run (propagated to child policy merge). */
|
|
1355
1030
|
engineMaxNodeActivations?: number;
|
|
1356
|
-
/** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
|
|
1357
1031
|
engineMaxSubworkflowDepth?: number;
|
|
1358
|
-
/**
|
|
1359
|
-
* Test-suite linkage inherited by the child subworkflow run. Set by whichever node
|
|
1360
|
-
* spawns the subworkflow when its own `ctx.testContext` is present, so assertions
|
|
1361
|
-
* emitted inside a subworkflow land under the correct parent test case.
|
|
1362
|
-
*/
|
|
1363
1032
|
testContext?: RunTestContext;
|
|
1364
1033
|
}
|
|
1365
1034
|
interface RunDataSnapshot {
|
|
@@ -1394,7 +1063,6 @@ interface NodeOffloadPolicy {
|
|
|
1394
1063
|
config: NodeConfigBase;
|
|
1395
1064
|
}): NodeSchedulerDecision;
|
|
1396
1065
|
}
|
|
1397
|
-
/** Whether to persist run execution data after the workflow finishes. */
|
|
1398
1066
|
type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
|
|
1399
1067
|
type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
|
|
1400
1068
|
interface WorkflowStoragePolicyResolver {
|
|
@@ -1447,7 +1115,6 @@ interface NodeErrorHandler {
|
|
|
1447
1115
|
handle<TConfig extends NodeConfigBase>(args: NodeErrorHandlerArgs<TConfig>): Promise<NodeOutputs>;
|
|
1448
1116
|
}
|
|
1449
1117
|
type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
1450
|
-
/** Runtime defaults when workflow omits prune/storage fields (typically from host env). */
|
|
1451
1118
|
interface WorkflowPolicyRuntimeDefaults {
|
|
1452
1119
|
readonly retentionSeconds?: number;
|
|
1453
1120
|
readonly binaryRetentionSeconds?: number;
|
|
@@ -1458,76 +1125,25 @@ interface WorkflowPolicyRuntimeDefaults {
|
|
|
1458
1125
|
}
|
|
1459
1126
|
//#endregion
|
|
1460
1127
|
//#region src/contracts/testTriggerTypes.d.ts
|
|
1461
|
-
/**
|
|
1462
|
-
* Identifier minted by the host (or in-memory test runner) for one execution of a test suite.
|
|
1463
|
-
* One TestSuiteRun produces N child workflow runs, one per item yielded by `generateItems`.
|
|
1464
|
-
*/
|
|
1465
1128
|
type TestSuiteRunId = string;
|
|
1466
|
-
/**
|
|
1467
|
-
* Setup context passed to a {@link TestTriggerNodeConfig.generateItems} callback. Distinct from
|
|
1468
|
-
* {@link import("./runtimeTypes").TriggerSetupContext} on purpose: test triggers are not
|
|
1469
|
-
* activated by the live trigger lifecycle (webhooks, cron, polling) and never call `emit` —
|
|
1470
|
-
* the orchestrator pulls from the iterable they return and dispatches one run per item.
|
|
1471
|
-
*/
|
|
1472
1129
|
interface TestTriggerSetupContext<TConfig extends TestTriggerNodeConfig<unknown> = TestTriggerNodeConfig<unknown>> {
|
|
1473
1130
|
readonly workflowId: WorkflowId;
|
|
1474
1131
|
readonly nodeId: NodeId;
|
|
1475
1132
|
readonly config: TConfig;
|
|
1476
1133
|
readonly testSuiteRunId: TestSuiteRunId;
|
|
1477
|
-
/**
|
|
1478
|
-
* Resolves a credential session for a slot declared on this trigger's
|
|
1479
|
-
* {@link import("./workflowTypes").NodeConfigBase.getCredentialRequirements}. Same contract as
|
|
1480
|
-
* {@link import("./runtimeTypes").ExecutionContext.getCredential}.
|
|
1481
|
-
*/
|
|
1482
1134
|
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
1483
|
-
/** AbortSignal raised when the suite is cancelled — long-running pulls should bail out. */
|
|
1484
1135
|
readonly signal: AbortSignal;
|
|
1485
1136
|
}
|
|
1486
|
-
/**
|
|
1487
|
-
* A trigger config that emits **test cases**. Each item yielded by {@link generateItems}
|
|
1488
|
-
* becomes one workflow run (with `executionOptions.testContext` set), so 10 yielded items
|
|
1489
|
-
* → 10 runs marked under the same TestSuiteRun.
|
|
1490
|
-
*
|
|
1491
|
-
* The trigger is otherwise a normal {@link TriggerNodeConfig} (so the canvas treats it like
|
|
1492
|
-
* any other trigger), but its `triggerKind` is `"test"` so the live activation policy skips it.
|
|
1493
|
-
*/
|
|
1494
1137
|
interface TestTriggerNodeConfig<TOutputJson$1 = unknown> extends TriggerNodeConfig<TOutputJson$1, undefined> {
|
|
1495
1138
|
readonly triggerKind: "test";
|
|
1496
|
-
/**
|
|
1497
|
-
* Author-supplied async iterable of items, evaluated lazily. Implementations may fetch from
|
|
1498
|
-
* credentialed APIs, read fixture files, or yield hard-coded items. The orchestrator iterates
|
|
1499
|
-
* and dispatches one run per item, with concurrency capped by {@link concurrency} (default 4).
|
|
1500
|
-
*/
|
|
1501
1139
|
generateItems(ctx: TestTriggerSetupContext<TestTriggerNodeConfig<TOutputJson$1>>): AsyncIterable<Item<TOutputJson$1>>;
|
|
1502
|
-
/** Per-suite-run cap on simultaneously-executing test cases. Default: 4. */
|
|
1503
1140
|
readonly concurrency?: number;
|
|
1504
|
-
/**
|
|
1505
|
-
* Free-form description of where the test cases come from — surfaced in the node properties
|
|
1506
|
-
* panel and the suite-detail header so authors revisiting the workflow six months later
|
|
1507
|
-
* remember which mailbox / folder / fixture file the cases originate from.
|
|
1508
|
-
*
|
|
1509
|
-
* Example: `"All emails in the Gmail label \"test/triage-fixtures\" — 14 messages as of 2026-05-03."`
|
|
1510
|
-
*/
|
|
1511
1141
|
readonly description?: string;
|
|
1512
|
-
/**
|
|
1513
|
-
* Resolves a human-readable label for one yielded test case (e.g. email subject). The
|
|
1514
|
-
* orchestrator calls this once per yielded item, persists the result on the run, and the
|
|
1515
|
-
* Tests-tab UI uses it to render the case row instead of the opaque runId. Return
|
|
1516
|
-
* `undefined` to fall back to "Case #N".
|
|
1517
|
-
*/
|
|
1518
1142
|
caseLabel?(item: Item<TOutputJson$1>): string | undefined;
|
|
1519
1143
|
}
|
|
1520
1144
|
//#endregion
|
|
1521
1145
|
//#region src/events/runEvents.d.ts
|
|
1522
|
-
/**
|
|
1523
|
-
* Outcome of a single test case (one workflow run dispatched by the test-suite orchestrator).
|
|
1524
|
-
* - `running`: workflow still in flight
|
|
1525
|
-
* - `succeeded`: workflow completed AND all assertions passed (or no assertions)
|
|
1526
|
-
* - `failed`: workflow failed OR (workflow completed but ≥1 assertion failed)
|
|
1527
|
-
* - `errored` / `cancelled`: workflow itself errored or was cancelled
|
|
1528
|
-
*/
|
|
1529
1146
|
type TestCaseRunStatus = "running" | "succeeded" | "failed" | "errored" | "cancelled";
|
|
1530
|
-
/** Aggregate outcome of a TestSuiteRun. */
|
|
1531
1147
|
type TestSuiteRunStatus = "succeeded" | "failed" | "partial" | "errored" | "cancelled";
|
|
1532
1148
|
type RunEvent = Readonly<{
|
|
1533
1149
|
kind: "runCreated";
|
|
@@ -1641,23 +1257,20 @@ interface EngineExecutionLimitsPolicyConfig {
|
|
|
1641
1257
|
readonly defaultMaxSubworkflowDepth: number;
|
|
1642
1258
|
readonly hardMaxSubworkflowDepth: number;
|
|
1643
1259
|
}
|
|
1644
|
-
/** Framework defaults for {@link EngineExecutionLimitsPolicy} (merged with host `runtime.engineExecutionLimits`). */
|
|
1645
1260
|
declare const ENGINE_EXECUTION_LIMITS_DEFAULTS: EngineExecutionLimitsPolicyConfig;
|
|
1646
|
-
/**
|
|
1647
|
-
* Resolves per-run execution limits: defaults, hard ceilings, and subworkflow depth for new runs.
|
|
1648
|
-
*/
|
|
1649
1261
|
declare class EngineExecutionLimitsPolicy {
|
|
1650
1262
|
private readonly config;
|
|
1651
1263
|
constructor(config?: EngineExecutionLimitsPolicyConfig);
|
|
1652
|
-
/**
|
|
1653
|
-
* Effective options for a new root run (depth 0): defaults merged with engine ceilings.
|
|
1654
|
-
* Replaces a separate one-method factory for root-run bootstrap.
|
|
1655
|
-
*/
|
|
1656
1264
|
createRootExecutionOptions(): RunExecutionOptions;
|
|
1657
1265
|
mergeExecutionOptionsForNewRun(parent: ParentExecutionRef | undefined, user: RunExecutionOptions | undefined): RunExecutionOptions;
|
|
1658
1266
|
private capNumber;
|
|
1659
1267
|
}
|
|
1660
1268
|
//#endregion
|
|
1269
|
+
//#region src/contracts/triggerInvokerTypes.d.ts
|
|
1270
|
+
interface TriggerInvoker {
|
|
1271
|
+
invoke(trigger: TriggerInstanceId, config: TriggerNodeConfig, lastRanAt: string | undefined): Promise<Items>;
|
|
1272
|
+
}
|
|
1273
|
+
//#endregion
|
|
1661
1274
|
//#region src/di/CoreTokens.d.ts
|
|
1662
1275
|
declare const CoreTokens: {
|
|
1663
1276
|
readonly PersistedWorkflowTokenRegistry: TypeToken<PersistedWorkflowTokenRegistryLike>;
|
|
@@ -1678,54 +1291,31 @@ declare const CoreTokens: {
|
|
|
1678
1291
|
readonly RunEventBus: TypeToken<RunEventBus>;
|
|
1679
1292
|
readonly BinaryStorage: TypeToken<BinaryStorage>;
|
|
1680
1293
|
readonly WebhookBasePath: TypeToken<string>;
|
|
1681
|
-
/** Engine execution limits (defaults + optional host overrides). Consumers may bind a custom instance to override. */
|
|
1682
1294
|
readonly EngineExecutionLimitsPolicy: TypeToken<EngineExecutionLimitsPolicy>;
|
|
1683
1295
|
readonly WorkflowActivationPolicy: TypeToken<WorkflowActivationPolicy>;
|
|
1684
|
-
/**
|
|
1685
|
-
* Optional. When registered, AIAgentNode uses it to resolve mcpServers bindings,
|
|
1686
|
-
* validate scopes, open pool connections, and prepare the MCP ToolSet map.
|
|
1687
|
-
* Not registered in the default core bootstrap — the host provides the implementation.
|
|
1688
|
-
*/
|
|
1689
1296
|
readonly AgentMcpIntegration: TypeToken<AgentMcpIntegration>;
|
|
1297
|
+
readonly TriggerInvoker: TypeToken<TriggerInvoker>;
|
|
1690
1298
|
};
|
|
1691
1299
|
//#endregion
|
|
1692
1300
|
//#region src/contracts/runTypes.d.ts
|
|
1693
|
-
/**
|
|
1694
|
-
* Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
|
|
1695
|
-
* as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
|
|
1696
|
-
* off the presence of this field. Subworkflow runs inherit it from their parent run.
|
|
1697
|
-
*/
|
|
1698
1301
|
interface RunTestContext {
|
|
1699
1302
|
readonly testSuiteRunId: string;
|
|
1700
1303
|
readonly testCaseIndex: number;
|
|
1701
|
-
/**
|
|
1702
|
-
* Optional human-friendly label for this test case (e.g. an email subject when fixtures
|
|
1703
|
-
* are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
|
|
1704
|
-
* persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
|
|
1705
|
-
* instead of "run_1777755971399_bbb86beac1396".
|
|
1706
|
-
*/
|
|
1707
1304
|
readonly testCaseLabel?: string;
|
|
1708
1305
|
}
|
|
1709
1306
|
interface RunExecutionOptions {
|
|
1710
|
-
/** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
|
|
1711
1307
|
localOnly?: boolean;
|
|
1712
|
-
/** Marks runs started from webhook handling so orchestration can apply webhook-specific continuation rules. */
|
|
1713
1308
|
webhook?: boolean;
|
|
1714
1309
|
mode?: "manual" | "debug";
|
|
1715
1310
|
sourceWorkflowId?: WorkflowId;
|
|
1716
1311
|
sourceRunId?: RunId;
|
|
1717
1312
|
derivedFromRunId?: RunId;
|
|
1718
1313
|
isMutable?: boolean;
|
|
1719
|
-
/** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
|
|
1720
1314
|
subworkflowDepth?: number;
|
|
1721
|
-
/** Effective cap after engine policy merge (successful node completions per run). */
|
|
1722
1315
|
maxNodeActivations?: number;
|
|
1723
|
-
/** Effective cap after engine policy merge (subworkflow nesting). */
|
|
1724
1316
|
maxSubworkflowDepth?: number;
|
|
1725
|
-
/** Present iff started by a TestSuiteOrchestrator; propagates to subworkflow runs via {@link ParentExecutionRef.testContext}. */
|
|
1726
1317
|
testContext?: RunTestContext;
|
|
1727
1318
|
}
|
|
1728
|
-
/** Engine-owned counters persisted with the run (worker-safe). */
|
|
1729
1319
|
interface EngineRunCounters {
|
|
1730
1320
|
completedNodeActivations: number;
|
|
1731
1321
|
}
|
|
@@ -1750,7 +1340,6 @@ interface PersistedWorkflowSnapshotNode {
|
|
|
1750
1340
|
tokenName?: string;
|
|
1751
1341
|
configTokenName?: string;
|
|
1752
1342
|
config: unknown;
|
|
1753
|
-
/** Pre-computed static configuration summary; populated by WorkflowSnapshotCodec. */
|
|
1754
1343
|
inspectorSummary?: ReadonlyArray<Readonly<{
|
|
1755
1344
|
label: string;
|
|
1756
1345
|
value: string;
|
|
@@ -1761,9 +1350,7 @@ interface PersistedWorkflowSnapshot {
|
|
|
1761
1350
|
name: string;
|
|
1762
1351
|
nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
|
|
1763
1352
|
edges: ReadonlyArray<Edge>;
|
|
1764
|
-
/** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
|
|
1765
1353
|
workflowErrorHandlerConfigured?: boolean;
|
|
1766
|
-
/** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
|
|
1767
1354
|
connections?: ReadonlyArray<WorkflowNodeConnection>;
|
|
1768
1355
|
}
|
|
1769
1356
|
type PinnedNodeOutputsByPort = Readonly<Record<OutputPortKey, Items>>;
|
|
@@ -1811,18 +1398,9 @@ interface NodeExecutionSnapshot {
|
|
|
1811
1398
|
inputsByPort?: NodeInputsByPort;
|
|
1812
1399
|
outputs?: NodeOutputs;
|
|
1813
1400
|
error?: NodeExecutionError;
|
|
1814
|
-
/**
|
|
1815
|
-
* When the node is a SubWorkflow invocation, the run id of the child run it spawned.
|
|
1816
|
-
* Populated after the child run completes so the UI can deep-link to that specific execution.
|
|
1817
|
-
*/
|
|
1818
1401
|
childRunId?: RunId;
|
|
1819
1402
|
}
|
|
1820
|
-
/** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
|
|
1821
1403
|
type ConnectionInvocationId = string;
|
|
1822
|
-
/**
|
|
1823
|
-
* One logical LLM or tool call under an owning workflow node (e.g. AI agent).
|
|
1824
|
-
* The owning node defines what {@link managedInput} and {@link managedOutput} contain.
|
|
1825
|
-
*/
|
|
1826
1404
|
interface ConnectionInvocationRecord {
|
|
1827
1405
|
readonly invocationId: ConnectionInvocationId;
|
|
1828
1406
|
readonly runId: RunId;
|
|
@@ -1833,23 +1411,17 @@ interface ConnectionInvocationRecord {
|
|
|
1833
1411
|
readonly status: NodeExecutionStatus;
|
|
1834
1412
|
readonly managedInput?: JsonValue;
|
|
1835
1413
|
readonly managedOutput?: JsonValue;
|
|
1836
|
-
/** Short human-readable description of what this invocation is doing right now (e.g. `"calling search_messages"`). Rendered as a sub-line on the canvas node card. */
|
|
1837
1414
|
readonly statusLabel?: string;
|
|
1838
|
-
/** Stable identifier for the thing this invocation acts on (e.g. an MCP tool name like `"search_messages"`). Persists across status transitions so the inspector can show it on completed/failed entries too. Connection nodes that ARE the tool (e.g. node-backed agent tools) leave this unset — the parent node id already identifies the subject. */
|
|
1839
1415
|
readonly subjectName?: string;
|
|
1840
1416
|
readonly error?: NodeExecutionError;
|
|
1841
1417
|
readonly queuedAt?: string;
|
|
1842
1418
|
readonly startedAt?: string;
|
|
1843
1419
|
readonly finishedAt?: string;
|
|
1844
1420
|
readonly updatedAt: string;
|
|
1845
|
-
/** Per-item iteration id minted by the engine when this invocation occurred inside a runnable node's per-item loop. */
|
|
1846
1421
|
readonly iterationId?: NodeIterationId;
|
|
1847
|
-
/** Item index (0-based) of the iteration that produced this invocation. */
|
|
1848
1422
|
readonly itemIndex?: number;
|
|
1849
|
-
/** When set, this invocation was produced inside a sub-agent triggered by the named parent invocation. */
|
|
1850
1423
|
readonly parentInvocationId?: ConnectionInvocationId;
|
|
1851
1424
|
}
|
|
1852
|
-
/** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
|
|
1853
1425
|
type ConnectionInvocationAppendArgs = Readonly<{
|
|
1854
1426
|
invocationId: ConnectionInvocationId;
|
|
1855
1427
|
connectionNodeId: NodeId;
|
|
@@ -1871,7 +1443,6 @@ type ConnectionInvocationAppendArgs = Readonly<{
|
|
|
1871
1443
|
interface RunCurrentState {
|
|
1872
1444
|
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
1873
1445
|
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
1874
|
-
/** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
|
|
1875
1446
|
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
1876
1447
|
mutableState?: PersistedMutableRunState;
|
|
1877
1448
|
}
|
|
@@ -1898,21 +1469,13 @@ interface ExecutionFrontierPlan {
|
|
|
1898
1469
|
preservedPinnedNodeIds: ReadonlyArray<NodeId>;
|
|
1899
1470
|
}
|
|
1900
1471
|
type RunStatus = "running" | "pending" | "completed" | "failed" | "suspended" | "halted";
|
|
1901
|
-
/** Reason a run transitioned to {@link RunStatus} `"halted"`. */
|
|
1902
1472
|
type RunHaltReason = "hitl-rejected" | "hitl-timeout" | "hitl-cancelled";
|
|
1903
1473
|
interface RunSummary {
|
|
1904
1474
|
runId: RunId;
|
|
1905
1475
|
workflowId: WorkflowId;
|
|
1906
1476
|
startedAt: string;
|
|
1907
1477
|
status: RunStatus;
|
|
1908
|
-
/**
|
|
1909
|
-
* Test-case status for runs dispatched as part of a TestSuiteRun. Carries the
|
|
1910
|
-
* assertion-rollup-corrected outcome the test orchestrator persists onto the row, so the
|
|
1911
|
-
* executions list can show "failed" for a run whose workflow completed cleanly but whose
|
|
1912
|
-
* assertions caught regressions. Absent for non-test runs and legacy rows.
|
|
1913
|
-
*/
|
|
1914
1478
|
testCaseStatus?: TestCaseRunStatus;
|
|
1915
|
-
/** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
|
|
1916
1479
|
finishedAt?: string;
|
|
1917
1480
|
parent?: ParentExecutionRef;
|
|
1918
1481
|
executionOptions?: RunExecutionOptions;
|
|
@@ -1933,70 +1496,42 @@ interface PersistedRunSchedulingState {
|
|
|
1933
1496
|
pending?: PendingNodeExecution;
|
|
1934
1497
|
queue: RunQueueEntry[];
|
|
1935
1498
|
}
|
|
1936
|
-
/** One persisted suspension entry per suspended item. */
|
|
1937
1499
|
interface PersistedSuspensionEntry {
|
|
1938
|
-
/** Opaque task identifier (UUID v4). */
|
|
1939
1500
|
readonly taskId: string;
|
|
1940
1501
|
readonly nodeId: NodeId;
|
|
1941
1502
|
readonly activationId: NodeActivationId;
|
|
1942
1503
|
readonly itemIndex: number;
|
|
1943
|
-
/** SHA-256 hex digest of the decision schema JSON (for schema-drift detection). */
|
|
1944
1504
|
readonly decisionSchemaHash: string;
|
|
1945
|
-
/** Serialized return value from `SuspensionRequest.deliver` (stored on the HumanTask row). */
|
|
1946
1505
|
readonly deliveryRef: JsonValue;
|
|
1947
|
-
/** ISO timestamp when the task expires. */
|
|
1948
1506
|
readonly timeoutAt: string;
|
|
1949
1507
|
readonly onTimeout: "halt" | "auto-accept";
|
|
1950
1508
|
}
|
|
1951
|
-
/**
|
|
1952
|
-
* When a node is re-activated after suspension, the engine writes the resume context here
|
|
1953
|
-
* so `NodeExecutionRequestHandlerService` can splice `resumeContext` into ctx.
|
|
1954
|
-
* Cleared once the re-activation is consumed.
|
|
1955
|
-
*/
|
|
1956
1509
|
interface PendingResumeEntry {
|
|
1957
1510
|
readonly activationId: NodeActivationId;
|
|
1958
1511
|
readonly nodeId: NodeId;
|
|
1959
|
-
/**
|
|
1960
|
-
* Typed as `unknown` here to avoid a circular import between runTypes ↔ runtimeTypes.
|
|
1961
|
-
* `NodeExecutionRequestHandlerService` casts this to `ResumeContext` from runtimeTypes.
|
|
1962
|
-
*/
|
|
1963
1512
|
readonly resumeContext: unknown;
|
|
1964
1513
|
}
|
|
1965
1514
|
interface PersistedRunState {
|
|
1966
1515
|
runId: RunId;
|
|
1967
1516
|
workflowId: WorkflowId;
|
|
1968
1517
|
startedAt: string;
|
|
1969
|
-
/** Canonical terminal time for listings and retention when persisted on the run root. */
|
|
1970
1518
|
finishedAt?: string;
|
|
1971
|
-
/** Optimistic concurrency / CAS on the run aggregate (repository may increment on save). */
|
|
1972
1519
|
revision?: number;
|
|
1973
1520
|
parent?: ParentExecutionRef;
|
|
1974
1521
|
executionOptions?: RunExecutionOptions;
|
|
1975
1522
|
control?: PersistedRunControlState;
|
|
1976
1523
|
workflowSnapshot?: PersistedWorkflowSnapshot;
|
|
1977
1524
|
mutableState?: PersistedMutableRunState;
|
|
1978
|
-
/** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
|
|
1979
1525
|
policySnapshot?: PersistedRunPolicySnapshot;
|
|
1980
|
-
/** Successful node completions so far (for activation budget). */
|
|
1981
1526
|
engineCounters?: EngineRunCounters;
|
|
1982
1527
|
status: RunStatus;
|
|
1983
|
-
/** Populated when `status === "halted"` to discriminate why the run was halted. */
|
|
1984
1528
|
reason?: RunHaltReason;
|
|
1985
1529
|
pending?: PendingNodeExecution;
|
|
1986
1530
|
queue: RunQueueEntry[];
|
|
1987
1531
|
outputsByNode: Record<NodeId, NodeOutputs>;
|
|
1988
1532
|
nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
|
|
1989
|
-
/** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
|
|
1990
1533
|
connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
|
|
1991
|
-
/**
|
|
1992
|
-
* One entry per outstanding HITL suspension (per-item).
|
|
1993
|
-
* Present and non-empty iff `status === "suspended"`.
|
|
1994
|
-
*/
|
|
1995
1534
|
suspension?: ReadonlyArray<PersistedSuspensionEntry>;
|
|
1996
|
-
/**
|
|
1997
|
-
* Written by `resumeRun()` so `NodeExecutionRequestHandlerService` can splice `resumeContext`
|
|
1998
|
-
* into the ctx when re-executing the suspended node. Cleared once consumed.
|
|
1999
|
-
*/
|
|
2000
1535
|
pendingResume?: PendingResumeEntry;
|
|
2001
1536
|
}
|
|
2002
1537
|
interface WorkflowExecutionRepository {
|
|
@@ -2023,7 +1558,6 @@ interface WorkflowExecutionListingRepository {
|
|
|
2023
1558
|
limit?: number;
|
|
2024
1559
|
}>): Promise<ReadonlyArray<RunSummary>>;
|
|
2025
1560
|
}
|
|
2026
|
-
/** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
|
|
2027
1561
|
interface RunPruneCandidate {
|
|
2028
1562
|
readonly runId: RunId;
|
|
2029
1563
|
readonly workflowId: WorkflowId;
|
|
@@ -2086,42 +1620,13 @@ interface RunEventPublisherDeps {
|
|
|
2086
1620
|
}
|
|
2087
1621
|
//#endregion
|
|
2088
1622
|
//#region src/contracts/agentMcpTypes.d.ts
|
|
2089
|
-
/**
|
|
2090
|
-
* Emitted as a span event when a credential is missing required scopes
|
|
2091
|
-
* (bind-time) or when callTool returns a permission error (runtime).
|
|
2092
|
-
* The credential type id can be looked up from the credential instance when needed.
|
|
2093
|
-
*/
|
|
2094
1623
|
interface NeedsReconsentEvent {
|
|
2095
1624
|
readonly serverId: string;
|
|
2096
1625
|
readonly credentialInstanceId: string;
|
|
2097
1626
|
readonly missingScopesHint?: readonly string[];
|
|
2098
1627
|
}
|
|
2099
|
-
/**
|
|
2100
|
-
* An opaque MCP tool map: keyed by serverId → (toolName → tool definition).
|
|
2101
|
-
* Typed as unknown so core does not depend on the AI SDK's ToolSet type.
|
|
2102
|
-
* AIAgentNode (in core-nodes, which does depend on ai) casts this to
|
|
2103
|
-
* ReadonlyMap<string, ToolSet> before passing to DeferredMetaToolStrategyFactory.
|
|
2104
|
-
*/
|
|
2105
1628
|
type AgentMcpToolMap = ReadonlyMap<string, Readonly<Record<string, unknown>>>;
|
|
2106
|
-
/**
|
|
2107
|
-
* Contract implemented by the host. Resolves MCP server bindings for an agent run
|
|
2108
|
-
* via the standard credential-binding table (one slot per declared server, keyed
|
|
2109
|
-
* by `(workflowId, mcpConnectionNodeId, "credential")`), and returns a ready-to-use
|
|
2110
|
-
* tool map with wrapped execute callbacks for telemetry and 403 detection.
|
|
2111
|
-
* Core-nodes imports this interface so AIAgentNode can inject it without
|
|
2112
|
-
* depending on the host.
|
|
2113
|
-
*/
|
|
2114
1629
|
interface AgentMcpIntegration {
|
|
2115
|
-
/**
|
|
2116
|
-
* Look up the credential binding per server, validate scopes, open pool
|
|
2117
|
-
* connections, and return a tool map keyed by serverId. Each tool's
|
|
2118
|
-
* execute callback includes:
|
|
2119
|
-
* - Telemetry child span (mcp.server_id, mcp.tool_name attributes)
|
|
2120
|
-
* - 403/permission error detection → emits a NeedsReconsentEvent span event
|
|
2121
|
-
*
|
|
2122
|
-
* Throws `AgentBindError` on validation failures (missing server, unbound
|
|
2123
|
-
* credential slot, missing credential instance, insufficient scopes).
|
|
2124
|
-
*/
|
|
2125
1630
|
prepareMcpTools(args: {
|
|
2126
1631
|
readonly workflowId: WorkflowId;
|
|
2127
1632
|
readonly agentNodeId: NodeId;
|
|
@@ -2137,18 +1642,13 @@ interface AgentMcpIntegration {
|
|
|
2137
1642
|
statusMessage?: string;
|
|
2138
1643
|
}) => void;
|
|
2139
1644
|
};
|
|
2140
|
-
/** Per-MCP-tool-call invocation appender. Optional; when omitted the wrapper emits only telemetry spans. */
|
|
2141
1645
|
readonly appendMcpInvocation?: (args: ConnectionInvocationAppendArgs) => Promise<void>;
|
|
2142
|
-
/** Agent activation id to attach to each invocation record (used by canvas + inspector grouping). */
|
|
2143
1646
|
readonly parentAgentActivationId?: NodeActivationId;
|
|
2144
|
-
/** Per-item iteration id when the agent runs inside a per-item loop. */
|
|
2145
1647
|
readonly iterationId?: NodeIterationId;
|
|
2146
|
-
/** Item index (0-based) of the iteration that owns these tool calls. */
|
|
2147
1648
|
readonly itemIndex?: number;
|
|
2148
|
-
/** Parent invocation id when this agent is itself executing as a sub-agent. */
|
|
2149
1649
|
readonly parentInvocationId?: ConnectionInvocationId;
|
|
2150
1650
|
}): Promise<AgentMcpToolMap>;
|
|
2151
1651
|
}
|
|
2152
1652
|
//#endregion
|
|
2153
|
-
export { injectAll as $,
|
|
2154
|
-
//# sourceMappingURL=agentMcpTypes-
|
|
1653
|
+
export { injectAll as $, OutputPortKey as $i, NodeActivationContinuation as $n, TelemetrySpanEnd as $r, RunId as $t, RunHaltReason as A, CredentialInstanceId as Ai, RetryPolicySpec as An, WorkflowRunnerResolver as Ar, JsonPrimitive as At, WorkflowExecutionListingRepository as B, CredentialSetupStatus as Bi, EngineDeps as Bn, WebhookTriggerRoutingDiagnostics as Br, NodeInspectorSummaryRow as Bt, PersistedWorkflowSnapshotNode as C, CredentialAuthDefinition as Ci, runnableNodeInputType as Cn, TriggerRuntimeDiagnostics as Cr, ExecutionMode as Ct, RunCurrentState as D, CredentialHealth as Di, ExponentialRetryPolicySpec as Dn, TriggerTestItemsContext as Dr, JsonArray as Dt, RunCompletionNotifier as E, CredentialFieldSchema as Ei, triggerNodeSetupStateType as En, TriggerSetupStateRepository as Er, Items as Et, RunStatus as F, CredentialOAuth2ScopesFromPublicConfig as Fi, BinaryStorageReadResult as Fn, TriggerInstanceId as Fr, NodeDefinition as Ft, Disposable as G, CredentialUnboundError as Gi, ExecutionContextFactory as Gn, NodeExecutionTelemetry as Gr, NodeRef as Gt, WorkflowExecutionRepository as H, CredentialTypeDefinition as Hi, ExecutableTriggerNode as Hn, WorkflowActivationPolicy as Hr, NodeKind as Ht, RunStopCondition as I, CredentialRequirement as Ii, BinaryStorageStatResult as In, WebhookControlSignal as Ir, NodeErrorHandler as It, RegistrationOptions as J, PollingTriggerLogger as Ji, HumanTaskId as Jn, TelemetryAttributePrimitive as Jr, ParentExecutionRef as Jt, InjectionToken$1 as K, OAuth2ProviderFromPublicConfig as Ki, HumanTaskActor as Kn, TelemetryArtifactAttachment as Kr, NodeSchedulerDecision as Kt, RunSummary as L, CredentialSessionFactory as Li, BinaryStorageWriteRequest as Ln, WebhookInvocationMatch as Lr, NodeErrorHandlerArgs as Lt, RunQueueEntry as M, CredentialJsonRecord as Mi, BinaryAttachmentCreateRequest as Mn, WorkflowSnapshotFactory as Mr, MutableRunData as Mt, RunResult as N, CredentialMaterialSourceKind as Ni, BinaryBody as Nn, WorkflowSnapshotResolver as Nr, NodeActivationId as Nt, RunEventPublisherDeps as O, CredentialHealthStatus as Oi, FixedRetryPolicySpec as On, WorkflowNodeInstanceFactory as Or, JsonNonArray as Ot, RunStateResetRequest as P, CredentialOAuth2AuthDefinition as Pi, BinaryStorage as Pn, HttpMethod as Pr, NodeConfigBase as Pt, inject as Q, NodeId as Qi, MultiInputNode as Qn, TelemetryScope as Qr, RunDataSnapshot as Qt, RunTestContext as R, CredentialSessionFactoryArgs as Ri, BinaryStorageWriteResult as Rn, WebhookTriggerMatcher as Rr, NodeErrorHandlerSpec as Rt, PersistedWorkflowSnapshot as S, CredentialAdvancedSectionPresentation as Si, nodeRef as Sn, TriggerPollingPort as Sr, Edge as St, PinnedNodeOutputsByPort as T, CredentialBindingKey as Ti, triggerNodeOutputType as Tn, TriggerSetupStateFor as Tr, ItemBinary as Tt, Container as U, CredentialTypeId as Ui, ExecutionBinaryService as Un, ExecutionTelemetry as Ur, NodeOffloadPolicy as Ut, WorkflowExecutionPruneRepository as V, CredentialType as Vi, EngineHost as Vn, AllWorkflowsActiveWorkflowActivationPolicy as Vr, NodeIterationId as Vt, DependencyContainer$1 as W, CredentialTypeRegistry as Wi, ExecutionContext as Wn, ExecutionTelemetryFactory as Wr, NodeOutputs as Wt, container as X, InputPortKey as Xi, ItemNode as Xn, TelemetryChildSpanStart as Xr, PollingTriggerConfig as Xt, TypeToken as Y, PollingTriggerDedupWindow as Yi, HumanTaskSubject as Yn, TelemetryAttributes as Yr, PersistedRunPolicySnapshot as Yt, delay as Z, NodeConnectionName as Zi, LiveWorkflowRepository as Zn, TelemetryMetricRecord as Zr, RunDataFactory as Zt, PersistedMutableRunState as _, CollectionStore as _i, WorkflowStoragePolicyDecisionArgs as _n, RunnableNodeExecuteArgs as _r, TestTriggerNodeConfig as _t, ConnectionInvocationId as a, NoOpExecutionTelemetryFactory as ai, TriggerNodeOutputJson as an, NodeExecutionContext as ar, singleton as at, PersistedRunState as b, CredentialAccessTokenSessionArgs as bi, WorkflowStoragePolicySpec as bn, TriggerCleanupHandle as br, BinaryAttachment as bt, EngineRunCounters as c, NoOpTelemetrySpanScope as ci, WorkflowDefinition as cn, NodeExecutionScheduler as cr, ENGINE_EXECUTION_LIMITS_DEFAULTS as ct, NodeExecutionSnapshot as d, CostTrackingPriceQuote as di, WorkflowErrorHandlerSpec as dn, NodeResolver as dr, RunEvent as dt, PersistedTokenId as ea, TelemetrySpanEventRecord as ei, RunIdFactory as en, NodeActivationReceipt as er, injectable as et, NodeExecutionStatus as f, CostTrackingTelemetry as fi, WorkflowGraph as fn, PersistedTriggerSetupState as fr, RunEventBus as ft, PersistedMutableNodeState as g, CostTrackingUsageRecord as gi, WorkflowPrunePolicySpec as gn, RunnableNode as gr, TestSuiteRunId as gt, PendingResumeEntry as h, CostTrackingTelemetryMetricNames as hi, WorkflowPolicyRuntimeDefaults as hn, ResumeContext as hr, TestSuiteRunStatus as ht, ConnectionInvocationAppendArgs as i, CodemationTelemetryAttributeNames as ii, TriggerNodeConfig as in, NodeBinaryAttachmentService as ir, registry as it, RunPruneCandidate as j, CredentialInstanceRecord as ji, BINARY_DEFAULT_MAX_BYTES as jn, WorkflowRunnerService as jr, JsonValue as jt, RunExecutionOptions as k, CredentialHealthTester as ki, NoneRetryPolicySpec as kn, WorkflowRepository as kr, JsonObject as kt, ExecutionFrontierPlan as l, NoOpTelemetryArtifactReference as li, WorkflowErrorContext as ln, NodeExecutionStatePublisher as lr, EngineExecutionLimitsPolicy as lt, PendingNodeExecution as m, CostTrackingTelemetryFactory as mi, WorkflowNodeConnection as mn, PreparedNodeActivationDispatch as mr, TestCaseRunStatus as mt, AgentMcpToolMap as n, CodemationTelemetryMetricNames as ni, RunnableNodeInputJson as nn, NodeActivationRequestBase as nr, instancePerContainerCachingFactory as nt, ConnectionInvocationRecord as o, NoOpExecutionTelemetry as oi, TriggerNodeSetupState as on, NodeExecutionRequest as or, CoreTokens as ot, NodeInputsByPort as p, CostTrackingTelemetryAttributeNames as pi, WorkflowGraphFactory as pn, PollingTriggerHandle as pr, RunEventSubscription as pt, Lifecycle as q, NoOpPollingTriggerLogger as qi, HumanTaskHandle as qn, TelemetryArtifactReference as qr, PairedItemRef as qt, NeedsReconsentEvent as r, GenAiTelemetryAttributeNames as ri, RunnableNodeOutputJson as rn, NodeActivationScheduler as rr, predicateAwareClassFactory as rt, CurrentStateExecutionRequest as s, NoOpNodeExecutionTelemetry as si, UpstreamRefPlaceholder as sn, NodeExecutionRequestHandler as sr, TriggerInvoker as st, AgentMcpIntegration as t, WorkflowId as ta, TelemetrySpanScope as ti, RunnableNodeConfig as tn, NodeActivationRequest as tr, instanceCachingFactory as tt, NodeExecutionError as u, CostTrackingComponent as ui, WorkflowErrorHandler as un, NodeExecutor as ur, EngineExecutionLimitsPolicyConfig as ut, PersistedRunControlState as v, CollectionsContext as vi, WorkflowStoragePolicyMode as vn, SuspensionRequest as vr, TestTriggerSetupContext as vt, PersistedWorkflowTokenRegistryLike as w, CredentialBinding as wi, runnableNodeOutputType as wn, TriggerSetupContext as wr, Item as wt, PersistedSuspensionEntry as x, CredentialAccessTokenSessionFactory as xi, branchRef as xn, TriggerNode as xr, BinaryPreviewKind as xt, PersistedRunSchedulingState as y, AnyCredentialType as yi, WorkflowStoragePolicyResolver as yn, TestableTriggerNode as yr, ActivationIdFactory as yt, WebhookRunResult as z, CredentialSessionService as zi, Duration as zn, WebhookTriggerResolution as zr, NodeIdRef as zt };
|
|
1654
|
+
//# sourceMappingURL=agentMcpTypes-BHX4RQCC.d.cts.map
|