@codemation/core 0.13.2 → 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.
Files changed (212) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/dist/{CostCatalogContract-Dxq1BTyi.d.cts → CostCatalogContract-Dwo-ZamG.d.cts} +2 -2
  3. package/dist/EngineRuntimeRegistration.types-BiNasx3G.d.cts +54 -0
  4. package/dist/EngineRuntimeRegistration.types-Dq4ucrdo.d.ts +21 -0
  5. package/dist/{InMemoryRunDataFactory-Csy2evr_.d.cts → InMemoryRunDataFactory-D2U9azmZ.d.cts} +4 -20
  6. package/dist/{InMemoryRunEventBusRegistry-Sa86VxuV.cjs → InMemoryRunEventBusRegistry-DO0WM9Lw.cjs} +1 -1
  7. package/dist/{InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map → InMemoryRunEventBusRegistry-DO0WM9Lw.cjs.map} +1 -1
  8. package/dist/{InMemoryRunEventBusRegistry-Bwunvt1T.js → InMemoryRunEventBusRegistry-Layt2xgm.js} +1 -1
  9. package/dist/{InMemoryRunEventBusRegistry-Bwunvt1T.js.map → InMemoryRunEventBusRegistry-Layt2xgm.js.map} +1 -1
  10. package/dist/{ItemsInputNormalizer-Bi8m-Ijs.d.cts → ItemsInputNormalizer-A5txcOWX.d.cts} +3 -98
  11. package/dist/{ItemsInputNormalizer-BbQTSEkZ.cjs → ItemsInputNormalizer-C1fv3sMW.cjs} +2 -2
  12. package/dist/ItemsInputNormalizer-C1fv3sMW.cjs.map +1 -0
  13. package/dist/{ItemsInputNormalizer-BYljnXU0.d.ts → ItemsInputNormalizer-D2vrMrX1.d.ts} +2 -62
  14. package/dist/{ItemsInputNormalizer-CSZGMgl3.js → ItemsInputNormalizer-fUYo4GLV.js} +2 -2
  15. package/dist/ItemsInputNormalizer-fUYo4GLV.js.map +1 -0
  16. package/dist/{RunIntentService-BitgkKaT.d.cts → RunIntentService-DKxuHTUz.d.cts} +2 -15
  17. package/dist/{RunIntentService-DYpqfu6D.d.ts → RunIntentService-DrpKli2k.d.ts} +2 -22
  18. package/dist/{agentMcpTypes-DGIwk6Ue.d.cts → agentMcpTypes-BHX4RQCC.d.cts} +25 -518
  19. package/dist/bootstrap/index.cjs +9 -5
  20. package/dist/bootstrap/index.d.cts +32 -106
  21. package/dist/bootstrap/index.d.ts +18 -17
  22. package/dist/bootstrap/index.js +6 -5
  23. package/dist/{bootstrap-DIv-vloi.cjs → bootstrap-CTB53rEF.cjs} +9 -60
  24. package/dist/bootstrap-CTB53rEF.cjs.map +1 -0
  25. package/dist/{bootstrap-Bkd-Nfbn.js → bootstrap-DmqKheCI.js} +6 -57
  26. package/dist/bootstrap-DmqKheCI.js.map +1 -0
  27. package/dist/browser.cjs +12 -11
  28. package/dist/browser.d.cts +4 -4
  29. package/dist/browser.d.ts +3 -3
  30. package/dist/browser.js +3 -2
  31. package/dist/contracts-7L1wJHdk.cjs +569 -0
  32. package/dist/contracts-7L1wJHdk.cjs.map +1 -0
  33. package/dist/contracts-CjJ5CZ7N.js +447 -0
  34. package/dist/contracts-CjJ5CZ7N.js.map +1 -0
  35. package/dist/contracts.cjs +9 -2
  36. package/dist/contracts.d.cts +5 -5
  37. package/dist/contracts.d.ts +2 -2
  38. package/dist/contracts.js +3 -2
  39. package/dist/{executionPersistenceContracts-CN9d7AnL.d.cts → deploymentManifestTypes-B8CDmZZK.d.cts} +65 -81
  40. package/dist/di-C6Ubf9o5.cjs +179 -0
  41. package/dist/di-C6Ubf9o5.cjs.map +1 -0
  42. package/dist/di-Cjiil7U-.js +114 -0
  43. package/dist/di-Cjiil7U-.js.map +1 -0
  44. package/dist/{index-rllWL4r-.d.ts → index-CRv3_pY3.d.ts} +112 -808
  45. package/dist/{index-BSQ2LoIh.d.ts → index-mnLS0iQl.d.ts} +39 -372
  46. package/dist/index.cjs +53 -111
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +50 -438
  49. package/dist/index.d.ts +5 -5
  50. package/dist/index.js +28 -94
  51. package/dist/index.js.map +1 -1
  52. package/dist/{params-DRUr0F5v.d.cts → params-CrK4iuG1.d.cts} +3 -13
  53. package/dist/{runtime-CWPdvJpC.js → runtime-CBFDpmiz.js} +112 -648
  54. package/dist/runtime-CBFDpmiz.js.map +1 -0
  55. package/dist/{runtime-_VdHwGkJ.cjs → runtime-Due-FOZ2.cjs} +137 -717
  56. package/dist/runtime-Due-FOZ2.cjs.map +1 -0
  57. package/dist/testing.cjs +8 -40
  58. package/dist/testing.cjs.map +1 -1
  59. package/dist/testing.d.cts +3 -32
  60. package/dist/testing.d.ts +3 -32
  61. package/dist/testing.js +6 -38
  62. package/dist/testing.js.map +1 -1
  63. package/dist/{di-LP2qSHkY.cjs → workflowTypes-BW6Hhee7.cjs} +4 -230
  64. package/dist/workflowTypes-BW6Hhee7.cjs.map +1 -0
  65. package/dist/{di-tom0pM2h.js → workflowTypes-DZtBTmKf.js} +3 -163
  66. package/dist/workflowTypes-DZtBTmKf.js.map +1 -0
  67. package/package.json +1 -1
  68. package/src/ai/AgentConnectionNodeCollector.ts +0 -4
  69. package/src/ai/AgentMessageConfigNormalizerFactory.ts +0 -4
  70. package/src/ai/AiHost.ts +0 -38
  71. package/src/ai/CallableToolConfig.ts +0 -9
  72. package/src/ai/CallableToolKindToken.ts +0 -4
  73. package/src/authoring/callableTool.types.ts +0 -3
  74. package/src/authoring/defineCollection.types.ts +0 -11
  75. package/src/authoring/defineHumanApprovalNode.types.ts +0 -116
  76. package/src/authoring/defineNode.types.ts +18 -32
  77. package/src/authoring/definePollingTrigger.types.ts +36 -155
  78. package/src/authoring/definePollingTriggerInternals.ts +0 -4
  79. package/src/authoring/index.ts +1 -0
  80. package/src/authoring/nodeBaseOptions.types.ts +4 -0
  81. package/src/binaries/boundedReadBinary.types.ts +0 -16
  82. package/src/bootstrap/index.ts +8 -2
  83. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +0 -5
  84. package/src/bootstrap/runtime/EngineRuntimeRegistration.types.ts +0 -23
  85. package/src/browser.ts +0 -3
  86. package/src/contracts/AgentBindError.ts +0 -5
  87. package/src/contracts/Clock.ts +0 -1
  88. package/src/contracts/CodemationTelemetryAttributeNames.ts +0 -10
  89. package/src/contracts/NoOpAgentMcpIntegration.ts +0 -6
  90. package/src/contracts/NoOpTelemetrySpanScope.ts +0 -7
  91. package/src/contracts/RetryPolicy.ts +0 -2
  92. package/src/contracts/agentMcpTypes.ts +0 -34
  93. package/src/contracts/assertionTypes.ts +0 -33
  94. package/src/contracts/baseTypes.ts +0 -6
  95. package/src/contracts/collectionTypes.ts +0 -25
  96. package/src/contracts/credentialTypes.ts +13 -60
  97. package/src/contracts/deploymentManifestTypes.ts +158 -0
  98. package/src/contracts/dispatchTypes.ts +29 -0
  99. package/src/contracts/executionPersistenceContracts.ts +0 -33
  100. package/src/contracts/hitlSeamTypes.ts +0 -14
  101. package/src/contracts/humanTaskStoreTypes.ts +0 -2
  102. package/src/contracts/inboxChannelTypes.ts +0 -9
  103. package/src/contracts/index.ts +3 -0
  104. package/src/contracts/itemExpr.ts +7 -21
  105. package/src/contracts/itemMeta.ts +0 -3
  106. package/src/contracts/mcpTypes.ts +0 -16
  107. package/src/contracts/retryPolicySpec.types.ts +0 -10
  108. package/src/contracts/runFinishedAtFactory.ts +0 -1
  109. package/src/contracts/runTypes.ts +0 -74
  110. package/src/contracts/runtimeTypes.ts +4 -131
  111. package/src/contracts/telemetryTypes.ts +0 -7
  112. package/src/contracts/testTriggerTypes.ts +0 -43
  113. package/src/contracts/triggerInvokerTypes.ts +6 -0
  114. package/src/contracts/webhookTypes.ts +0 -8
  115. package/src/contracts/workflowActivationPolicy.ts +0 -5
  116. package/src/contracts/workflowTypes.ts +5 -80
  117. package/src/contracts/workspaceFileTypes.ts +10 -42
  118. package/src/contracts.ts +18 -10
  119. package/src/credentials/CredentialMaterialProvider.types.ts +0 -28
  120. package/src/credentials/ManagedCredentialMaterialWriteError.ts +0 -6
  121. package/src/credentials/ManagedMaterialFetchError.ts +0 -6
  122. package/src/credentials/OAuthFlowExecutor.types.ts +0 -15
  123. package/src/di/CoreTokens.ts +2 -6
  124. package/src/events/ConnectionInvocationEventPublisher.ts +0 -7
  125. package/src/events/NodeEventPublisher.ts +0 -1
  126. package/src/events/runEvents.ts +0 -8
  127. package/src/execution/ActivationEnqueueService.ts +0 -10
  128. package/src/execution/ChildExecutionScopeFactory.ts +0 -13
  129. package/src/execution/FanInMergeByOriginMerger.ts +0 -11
  130. package/src/execution/InProcessRetryRunner.ts +0 -1
  131. package/src/execution/ItemExprResolver.ts +0 -3
  132. package/src/execution/NodeActivationRequestComposer.ts +0 -3
  133. package/src/execution/NodeActivationRequestInputPreparer.ts +0 -5
  134. package/src/execution/NodeExecutionSnapshotFactory.ts +0 -1
  135. package/src/execution/NodeExecutor.ts +1 -17
  136. package/src/execution/NodeOutputNormalizer.ts +8 -1
  137. package/src/execution/NodeSuspensionHandler.ts +1 -39
  138. package/src/execution/PersistedRunStateTerminalBuilder.ts +0 -5
  139. package/src/execution/RunSuspendedError.ts +0 -10
  140. package/src/execution/RunnableOutputBehaviorResolver.ts +12 -0
  141. package/src/execution/WorkflowRunExecutionContextFactory.ts +0 -3
  142. package/src/index.ts +10 -2
  143. package/src/orchestration/AbortControllerFactory.ts +0 -4
  144. package/src/orchestration/Engine.ts +0 -9
  145. package/src/orchestration/NodeExecutionRequestHandlerService.ts +3 -4
  146. package/src/orchestration/RunContinuationService.ts +7 -39
  147. package/src/orchestration/RunStartService.ts +0 -7
  148. package/src/orchestration/TestSuiteOrchestrator.ts +0 -18
  149. package/src/orchestration/TestSuiteRunIdFactory.ts +0 -4
  150. package/src/orchestration/TriggerRuntimeService.ts +3 -2
  151. package/src/planning/CurrentStateFrontierPlanner.ts +0 -1
  152. package/src/planning/RunQueuePlanner.ts +0 -6
  153. package/src/policies/executionLimits/EngineExecutionLimitsPolicy.ts +0 -8
  154. package/src/policies/executionLimits/EngineExecutionLimitsPolicyFactory.ts +0 -3
  155. package/src/runStorage/RunSummaryMapper.ts +0 -1
  156. package/src/runtime/EngineFactory.ts +6 -11
  157. package/src/runtime/RunIntentService.ts +0 -4
  158. package/src/runtime/WorkflowRepositoryWebhookTriggerMatcher.ts +0 -4
  159. package/src/runtime-types/InjectableRuntimeDecoratorComposerRegistry.ts +0 -4
  160. package/src/runtime-types/PersistedRuntimeTypeMetadataStoreRegistry.ts +0 -4
  161. package/src/runtime-types/PersistedRuntimeTypeNameResolver.ts +0 -1
  162. package/src/runtime-types/persistedRuntimeTypeModelRegistry.ts +0 -4
  163. package/src/runtime-types/runtimeTypeDecorators.types.ts +0 -12
  164. package/src/scheduler/ConfigDrivenOffloadPolicy.ts +0 -1
  165. package/src/scheduler/DefaultDrivingScheduler.ts +0 -6
  166. package/src/scheduler/InlineDrivingScheduler.ts +0 -13
  167. package/src/serialization/ItemsInputNormalizer.ts +0 -5
  168. package/src/testing/CapturingScheduler.ts +0 -3
  169. package/src/testing/EngineTestKitRunIdFactory.ts +0 -3
  170. package/src/testing/ItemHarnessNode.ts +0 -3
  171. package/src/testing/ItemHarnessNodeConfig.ts +0 -4
  172. package/src/testing/PrefixedSequentialIdGenerator.ts +0 -3
  173. package/src/testing/RegistrarEngineTestKit.types.ts +0 -2
  174. package/src/testing/RejectingCredentialSessionService.ts +0 -4
  175. package/src/testing/SubWorkflowRunnerTestNode.ts +0 -3
  176. package/src/testing/WorkflowTestHarnessManualTrigger.ts +0 -3
  177. package/src/testing/WorkflowTestKitBuilder.ts +0 -4
  178. package/src/testing/WorkflowTestKitRunNodeWorkflowFactory.ts +0 -3
  179. package/src/testing.ts +0 -3
  180. package/src/triggers/polling/PollingTriggerDedupWindow.ts +0 -4
  181. package/src/triggers/polling/PollingTriggerLogger.ts +0 -5
  182. package/src/triggers/polling/PollingTriggerRuntime.ts +0 -5
  183. package/src/types/index.ts +0 -6
  184. package/src/validation/WorkflowEdgePortValidator.ts +0 -5
  185. package/src/workflow/definition/ConnectionInvocationIdFactory.ts +0 -7
  186. package/src/workflow/definition/ConnectionNodeIdFactory.ts +0 -6
  187. package/src/workflow/definition/NodeIterationIdFactory.ts +0 -13
  188. package/src/workflow/definition/WorkflowExecutableNodeClassifier.ts +0 -6
  189. package/src/workflow/dsl/ChainCursorResolver.ts +8 -15
  190. package/src/workflow/dsl/NodeIdSlugifier.ts +0 -9
  191. package/src/workflow/dsl/WhenBuilder.ts +49 -2
  192. package/src/workflow/dsl/WorkflowDefinitionError.ts +0 -9
  193. package/src/workflow/dsl/workflowBuilderTypes.ts +5 -0
  194. package/src/workflowSnapshots/MissingRuntimeParityGuard.ts +24 -0
  195. package/src/workflowSnapshots/PersistedWorkflowTokenRegistry.ts +0 -6
  196. package/src/workflowSnapshots/WorkflowParityMismatchError.ts +18 -0
  197. package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +1 -5
  198. package/src/workflowSnapshots/index.ts +3 -0
  199. package/dist/EngineRuntimeRegistration.types-CqcTWexS.d.cts +0 -81
  200. package/dist/EngineRuntimeRegistration.types-Cr75cSfL.d.ts +0 -44
  201. package/dist/ItemsInputNormalizer-BbQTSEkZ.cjs.map +0 -1
  202. package/dist/ItemsInputNormalizer-CSZGMgl3.js.map +0 -1
  203. package/dist/bootstrap-Bkd-Nfbn.js.map +0 -1
  204. package/dist/bootstrap-DIv-vloi.cjs.map +0 -1
  205. package/dist/contracts-CK0x6w_G.cjs +0 -74
  206. package/dist/contracts-CK0x6w_G.cjs.map +0 -1
  207. package/dist/contracts-DXdfTdpW.js +0 -50
  208. package/dist/contracts-DXdfTdpW.js.map +0 -1
  209. package/dist/di-LP2qSHkY.cjs.map +0 -1
  210. package/dist/di-tom0pM2h.js.map +0 -1
  211. package/dist/runtime-CWPdvJpC.js.map +0 -1
  212. package/dist/runtime-_VdHwGkJ.cjs.map +0 -1
@@ -1,8 +1,6 @@
1
1
  import type { NodeExecutionContext } from "./runtimeTypes";
2
2
  import type { Item, Items, NodeActivationId, NodeId, RunDataSnapshot, RunId, WorkflowId } from "./workflowTypes";
3
3
 
4
- const ITEM_EXPR_BRAND = Symbol.for("codemation.itemExpr");
5
-
6
4
  export type ItemExprResolvedContext = Readonly<{
7
5
  runId: RunId;
8
6
  workflowId: WorkflowId;
@@ -11,9 +9,6 @@ export type ItemExprResolvedContext = Readonly<{
11
9
  data: RunDataSnapshot;
12
10
  }>;
13
11
 
14
- /**
15
- * Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
16
- */
17
12
  export type ItemExprContext = ItemExprResolvedContext;
18
13
 
19
14
  export type ItemExprArgs<TItemJson = unknown> = Readonly<{
@@ -26,12 +21,12 @@ export type ItemExprArgs<TItemJson = unknown> = Readonly<{
26
21
  export type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;
27
22
 
28
23
  export type ItemExpr<T, TItemJson = unknown> = Readonly<{
29
- readonly [ITEM_EXPR_BRAND]: true;
24
+ readonly __codemationItemExpr: "codemation.itemExpr";
30
25
  readonly fn: ItemExprCallback<T, TItemJson>;
31
26
  }>;
32
27
 
33
28
  export function itemExpr<T, TItemJson = unknown>(fn: ItemExprCallback<T, TItemJson>): ItemExpr<T, TItemJson> {
34
- return { [ITEM_EXPR_BRAND]: true, fn };
29
+ return { __codemationItemExpr: "codemation.itemExpr", fn };
35
30
  }
36
31
 
37
32
  export function isItemExpr<T, TItemJson = unknown>(value: unknown): value is ItemExpr<T, TItemJson> {
@@ -39,14 +34,7 @@ export function isItemExpr<T, TItemJson = unknown>(value: unknown): value is Ite
39
34
  return false;
40
35
  }
41
36
  const v = value as Record<PropertyKey, unknown>;
42
- if (v[ITEM_EXPR_BRAND] === true) {
43
- return true;
44
- }
45
- // Support snapshot-hydrated itemExpr wrappers where the symbol brand was lost but the callback survived.
46
- // Workflow snapshot hydration currently restores function-valued fields (like `fn`) but may drop symbol-keyed brands.
47
- // We treat the minimal `{ fn: Function }` shape as an itemExpr wrapper to keep runnable configs working.
48
- const keys = Object.keys(v);
49
- if (keys.length === 1 && keys[0] === "fn" && typeof (v as { fn?: unknown }).fn === "function") {
37
+ if (v["__codemationItemExpr"] === "codemation.itemExpr" && typeof v["fn"] === "function") {
50
38
  return true;
51
39
  }
52
40
  for (const sym of Object.getOwnPropertySymbols(v)) {
@@ -54,6 +42,10 @@ export function isItemExpr<T, TItemJson = unknown>(value: unknown): value is Ite
54
42
  return true;
55
43
  }
56
44
  }
45
+ const keys = Object.keys(v);
46
+ if (keys.length === 1 && keys[0] === "fn" && typeof (v as { fn?: unknown }).fn === "function") {
47
+ return true;
48
+ }
57
49
  return false;
58
50
  }
59
51
 
@@ -79,9 +71,6 @@ function containsItemExprInUnknown(value: unknown, seen: WeakSet<object> = new W
79
71
  return false;
80
72
  }
81
73
 
82
- /**
83
- * Deep-resolves {@link itemExpr} leaves. Returns a new graph (does not mutate the original config object).
84
- */
85
74
  export async function resolveItemExprsInUnknown(
86
75
  value: unknown,
87
76
  args: ItemExprArgs,
@@ -117,9 +106,6 @@ export async function resolveItemExprsInUnknown(
117
106
  return out;
118
107
  }
119
108
 
120
- /**
121
- * Clones runnable config (best-effort) so per-item {@link itemExpr} resolution never mutates shared instances.
122
- */
123
109
  export async function resolveItemExprsForExecution(
124
110
  config: unknown,
125
111
  nodeCtx: NodeExecutionContext,
@@ -1,8 +1,5 @@
1
1
  import type { Item } from "./workflowTypes";
2
2
 
3
- /**
4
- * Reads `meta._cm.originIndex` when present (used for fan-in merge-by-origin and Merge routing).
5
- */
6
3
  export function getOriginIndexFromItem(item: Item): number | undefined {
7
4
  const meta = item.meta as Record<string, unknown> | undefined;
8
5
  const cm = meta?._cm as Record<string, unknown> | undefined;
@@ -1,29 +1,13 @@
1
1
  export type McpServerTransport = "http";
2
- // "stdio" is a self-host-only escape hatch (CODEMATION_ALLOW_STDIO_MCP=true); not typed here for managed.
3
2
 
4
3
  export interface McpServerDeclaration {
5
- /** Globally unique slug, e.g. "gmail". Workflow authors reference this. */
6
4
  id: string;
7
5
  displayName: string;
8
6
  description: string;
9
7
  transport: McpServerTransport;
10
8
  url: string;
11
- /**
12
- * Credential types accepted by this MCP server, matching CredentialRequirement.acceptedTypes.
13
- * Absent or empty means no credential is required.
14
- */
15
9
  acceptedCredentialTypes?: ReadonlyArray<string>;
16
- /**
17
- * Documentation only in MVP. The bind-time validator checks
18
- * requiredScopes ⊆ CredentialInstance.scopesGranted.
19
- */
20
10
  requiredScopes?: string[];
21
- /** Non-secret static headers merged onto every MCP request. */
22
11
  staticHeaders?: Record<string, string>;
23
- /**
24
- * Overrides for tool descriptions advertised by the MCP server.
25
- * Applied by the connection pool after tools/list.
26
- * Key: exact tool name as returned by the server.
27
- */
28
12
  toolDescriptionOverrides?: Record<string, string>;
29
13
  }
@@ -1,10 +1,3 @@
1
- /**
2
- * In-process retry policy for runnable nodes. Serialized configs use the same
3
- * `kind` discriminator (`JSON.stringify` / persisted workflows).
4
- *
5
- * `maxAttempts` is the total number of tries including the first (e.g. 3 means up to 2 delays after failures).
6
- */
7
-
8
1
  export type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec;
9
2
 
10
3
  export interface NoneRetryPolicySpec {
@@ -13,18 +6,15 @@ export interface NoneRetryPolicySpec {
13
6
 
14
7
  export interface FixedRetryPolicySpec {
15
8
  readonly kind: "fixed";
16
- /** Total attempts including the first execution. Must be >= 1. */
17
9
  readonly maxAttempts: number;
18
10
  readonly delayMs: number;
19
11
  }
20
12
 
21
13
  export interface ExponentialRetryPolicySpec {
22
14
  readonly kind: "exponential";
23
- /** Total attempts including the first execution. Must be >= 1. */
24
15
  readonly maxAttempts: number;
25
16
  readonly initialDelayMs: number;
26
17
  readonly multiplier: number;
27
18
  readonly maxDelayMs?: number;
28
- /** When true, each delay is multiplied by a random factor in [1, 1.2). */
29
19
  readonly jitter?: boolean;
30
20
  }
@@ -2,7 +2,6 @@ import type { PersistedRunState } from "./runTypes";
2
2
 
3
3
  type RunFinishedAtSource = Pick<PersistedRunState, "status" | "nodeSnapshotsByNodeId" | "finishedAt">;
4
4
 
5
- /** Derives workflow end time from persisted run root or node snapshots for run listings. */
6
5
  export class RunFinishedAtFactory {
7
6
  static resolveIso(state: RunFinishedAtSource): string | undefined {
8
7
  if (state.finishedAt && state.status !== "running" && state.status !== "pending") {
@@ -20,44 +20,26 @@ import type {
20
20
  WorkflowNodeConnection,
21
21
  } from "./workflowTypes";
22
22
 
23
- /**
24
- * Test-suite linkage for a run. When set, this run was started by a TestSuiteOrchestrator
25
- * as one test case inside a TestSuiteRun. The `IsTestRun` node and host-side persisters key
26
- * off the presence of this field. Subworkflow runs inherit it from their parent run.
27
- */
28
23
  export interface RunTestContext {
29
24
  readonly testSuiteRunId: string;
30
25
  readonly testCaseIndex: number;
31
- /**
32
- * Optional human-friendly label for this test case (e.g. an email subject when fixtures
33
- * are loaded from a mailbox). Resolved per item by `TestTrigger.caseLabel(item)` if set,
34
- * persisted on `Run.test_case_label` so the Tests-tab tree-table can show "RFQ for batch 14"
35
- * instead of "run_1777755971399_bbb86beac1396".
36
- */
37
26
  readonly testCaseLabel?: string;
38
27
  }
39
28
 
40
29
  export interface RunExecutionOptions {
41
- /** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
42
30
  localOnly?: boolean;
43
- /** Marks runs started from webhook handling so orchestration can apply webhook-specific continuation rules. */
44
31
  webhook?: boolean;
45
32
  mode?: "manual" | "debug";
46
33
  sourceWorkflowId?: WorkflowId;
47
34
  sourceRunId?: RunId;
48
35
  derivedFromRunId?: RunId;
49
36
  isMutable?: boolean;
50
- /** Set by the engine for this run: 0 = root, 1 = first child subworkflow, … */
51
37
  subworkflowDepth?: number;
52
- /** Effective cap after engine policy merge (successful node completions per run). */
53
38
  maxNodeActivations?: number;
54
- /** Effective cap after engine policy merge (subworkflow nesting). */
55
39
  maxSubworkflowDepth?: number;
56
- /** Present iff started by a TestSuiteOrchestrator; propagates to subworkflow runs via {@link ParentExecutionRef.testContext}. */
57
40
  testContext?: RunTestContext;
58
41
  }
59
42
 
60
- /** Engine-owned counters persisted with the run (worker-safe). */
61
43
  export interface EngineRunCounters {
62
44
  completedNodeActivations: number;
63
45
  }
@@ -88,7 +70,6 @@ export interface PersistedWorkflowSnapshotNode {
88
70
  tokenName?: string;
89
71
  configTokenName?: string;
90
72
  config: unknown;
91
- /** Pre-computed static configuration summary; populated by WorkflowSnapshotCodec. */
92
73
  inspectorSummary?: ReadonlyArray<Readonly<{ label: string; value: string }>>;
93
74
  }
94
75
 
@@ -97,9 +78,7 @@ export interface PersistedWorkflowSnapshot {
97
78
  name: string;
98
79
  nodes: ReadonlyArray<PersistedWorkflowSnapshotNode>;
99
80
  edges: ReadonlyArray<Edge>;
100
- /** When the snapshot was built from a live workflow definition that configured a workflow error handler. */
101
81
  workflowErrorHandlerConfigured?: boolean;
102
- /** Connection metadata for child nodes not in the execution graph (e.g. AI agent attachments). */
103
82
  connections?: ReadonlyArray<WorkflowNodeConnection>;
104
83
  }
105
84
 
@@ -163,20 +142,11 @@ export interface NodeExecutionSnapshot {
163
142
  inputsByPort?: NodeInputsByPort;
164
143
  outputs?: NodeOutputs;
165
144
  error?: NodeExecutionError;
166
- /**
167
- * When the node is a SubWorkflow invocation, the run id of the child run it spawned.
168
- * Populated after the child run completes so the UI can deep-link to that specific execution.
169
- */
170
145
  childRunId?: RunId;
171
146
  }
172
147
 
173
- /** Stable id for a single connection invocation row in {@link ConnectionInvocationRecord}. */
174
148
  export type ConnectionInvocationId = string;
175
149
 
176
- /**
177
- * One logical LLM or tool call under an owning workflow node (e.g. AI agent).
178
- * The owning node defines what {@link managedInput} and {@link managedOutput} contain.
179
- */
180
150
  export interface ConnectionInvocationRecord {
181
151
  readonly invocationId: ConnectionInvocationId;
182
152
  readonly runId: RunId;
@@ -187,24 +157,18 @@ export interface ConnectionInvocationRecord {
187
157
  readonly status: NodeExecutionStatus;
188
158
  readonly managedInput?: JsonValue;
189
159
  readonly managedOutput?: JsonValue;
190
- /** 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. */
191
160
  readonly statusLabel?: string;
192
- /** 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. */
193
161
  readonly subjectName?: string;
194
162
  readonly error?: NodeExecutionError;
195
163
  readonly queuedAt?: string;
196
164
  readonly startedAt?: string;
197
165
  readonly finishedAt?: string;
198
166
  readonly updatedAt: string;
199
- /** Per-item iteration id minted by the engine when this invocation occurred inside a runnable node's per-item loop. */
200
167
  readonly iterationId?: NodeIterationId;
201
- /** Item index (0-based) of the iteration that produced this invocation. */
202
168
  readonly itemIndex?: number;
203
- /** When set, this invocation was produced inside a sub-agent triggered by the named parent invocation. */
204
169
  readonly parentInvocationId?: ConnectionInvocationId;
205
170
  }
206
171
 
207
- /** Arguments for appending a {@link ConnectionInvocationRecord} (engine fills run/workflow ids and timestamps). */
208
172
  export type ConnectionInvocationAppendArgs = Readonly<{
209
173
  invocationId: ConnectionInvocationId;
210
174
  connectionNodeId: NodeId;
@@ -227,7 +191,6 @@ export type ConnectionInvocationAppendArgs = Readonly<{
227
191
  export interface RunCurrentState {
228
192
  outputsByNode: Record<NodeId, NodeOutputs>;
229
193
  nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
230
- /** Append-only history of connection-scoped invocations (LLM/tool) for inspector and canvas. */
231
194
  connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
232
195
  mutableState?: PersistedMutableRunState;
233
196
  }
@@ -258,7 +221,6 @@ export interface ExecutionFrontierPlan {
258
221
 
259
222
  export type RunStatus = "running" | "pending" | "completed" | "failed" | "suspended" | "halted";
260
223
 
261
- /** Reason a run transitioned to {@link RunStatus} `"halted"`. */
262
224
  export type RunHaltReason = "hitl-rejected" | "hitl-timeout" | "hitl-cancelled";
263
225
 
264
226
  export interface RunSummary {
@@ -266,14 +228,7 @@ export interface RunSummary {
266
228
  workflowId: WorkflowId;
267
229
  startedAt: string;
268
230
  status: RunStatus;
269
- /**
270
- * Test-case status for runs dispatched as part of a TestSuiteRun. Carries the
271
- * assertion-rollup-corrected outcome the test orchestrator persists onto the row, so the
272
- * executions list can show "failed" for a run whose workflow completed cleanly but whose
273
- * assertions caught regressions. Absent for non-test runs and legacy rows.
274
- */
275
231
  testCaseStatus?: TestCaseRunStatus;
276
- /** ISO timestamp when the run finished (derived from node snapshots or store `updatedAt`); omit while running/pending. */
277
232
  finishedAt?: string;
278
233
  parent?: ParentExecutionRef;
279
234
  executionOptions?: RunExecutionOptions;
@@ -297,34 +252,20 @@ export interface PersistedRunSchedulingState {
297
252
  queue: RunQueueEntry[];
298
253
  }
299
254
 
300
- /** One persisted suspension entry per suspended item. */
301
255
  export interface PersistedSuspensionEntry {
302
- /** Opaque task identifier (UUID v4). */
303
256
  readonly taskId: string;
304
257
  readonly nodeId: NodeId;
305
258
  readonly activationId: NodeActivationId;
306
259
  readonly itemIndex: number;
307
- /** SHA-256 hex digest of the decision schema JSON (for schema-drift detection). */
308
260
  readonly decisionSchemaHash: string;
309
- /** Serialized return value from `SuspensionRequest.deliver` (stored on the HumanTask row). */
310
261
  readonly deliveryRef: JsonValue;
311
- /** ISO timestamp when the task expires. */
312
262
  readonly timeoutAt: string;
313
263
  readonly onTimeout: "halt" | "auto-accept";
314
264
  }
315
265
 
316
- /**
317
- * When a node is re-activated after suspension, the engine writes the resume context here
318
- * so `NodeExecutionRequestHandlerService` can splice `resumeContext` into ctx.
319
- * Cleared once the re-activation is consumed.
320
- */
321
266
  export interface PendingResumeEntry {
322
267
  readonly activationId: NodeActivationId;
323
268
  readonly nodeId: NodeId;
324
- /**
325
- * Typed as `unknown` here to avoid a circular import between runTypes ↔ runtimeTypes.
326
- * `NodeExecutionRequestHandlerService` casts this to `ResumeContext` from runtimeTypes.
327
- */
328
269
  readonly resumeContext: unknown;
329
270
  }
330
271
 
@@ -332,37 +273,23 @@ export interface PersistedRunState {
332
273
  runId: RunId;
333
274
  workflowId: WorkflowId;
334
275
  startedAt: string;
335
- /** Canonical terminal time for listings and retention when persisted on the run root. */
336
276
  finishedAt?: string;
337
- /** Optimistic concurrency / CAS on the run aggregate (repository may increment on save). */
338
277
  revision?: number;
339
278
  parent?: ParentExecutionRef;
340
279
  executionOptions?: RunExecutionOptions;
341
280
  control?: PersistedRunControlState;
342
281
  workflowSnapshot?: PersistedWorkflowSnapshot;
343
282
  mutableState?: PersistedMutableRunState;
344
- /** Frozen at createRun from workflow + runtime defaults for prune/storage decisions. */
345
283
  policySnapshot?: PersistedRunPolicySnapshot;
346
- /** Successful node completions so far (for activation budget). */
347
284
  engineCounters?: EngineRunCounters;
348
285
  status: RunStatus;
349
- /** Populated when `status === "halted"` to discriminate why the run was halted. */
350
286
  reason?: RunHaltReason;
351
287
  pending?: PendingNodeExecution;
352
288
  queue: RunQueueEntry[];
353
289
  outputsByNode: Record<NodeId, NodeOutputs>;
354
290
  nodeSnapshotsByNodeId: Record<NodeId, NodeExecutionSnapshot>;
355
- /** Append-only history of connection invocations (LLM/tool) nested under owning nodes. */
356
291
  connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
357
- /**
358
- * One entry per outstanding HITL suspension (per-item).
359
- * Present and non-empty iff `status === "suspended"`.
360
- */
361
292
  suspension?: ReadonlyArray<PersistedSuspensionEntry>;
362
- /**
363
- * Written by `resumeRun()` so `NodeExecutionRequestHandlerService` can splice `resumeContext`
364
- * into the ctx when re-executing the suspended node. Cleared once consumed.
365
- */
366
293
  pendingResume?: PendingResumeEntry;
367
294
  }
368
295
 
@@ -389,7 +316,6 @@ export interface WorkflowExecutionListingRepository {
389
316
  listRuns(args?: Readonly<{ workflowId?: WorkflowId; limit?: number }>): Promise<ReadonlyArray<RunSummary>>;
390
317
  }
391
318
 
392
- /** Runs eligible for retention-based pruning (completed or failed, older than cutoff). */
393
319
  export interface RunPruneCandidate {
394
320
  readonly runId: RunId;
395
321
  readonly workflowId: WorkflowId;
@@ -19,56 +19,30 @@ import type { WorkflowActivationPolicy } from "./workflowActivationPolicy";
19
19
  import type { TriggerInstanceId, WebhookTriggerMatcher } from "./webhookTypes";
20
20
  import type { ZodType } from "zod";
21
21
 
22
- // ---------------------------------------------------------------------------
23
- // HITL primitives
24
- // ---------------------------------------------------------------------------
25
-
26
- /** Opaque unique identifier for a single HumanTask instance. */
27
22
  export type HumanTaskId = string;
28
23
 
29
- /**
30
- * Duration string — ISO 8601 duration ("PT24H") or shorthand ("24h").
31
- * Parsed by the timeout job; stored as-is in the suspension record.
32
- */
33
24
  export type Duration = string;
34
25
 
35
- /**
36
- * Minimal handle handed to the `deliver` callback so it can route to the correct
37
- * inbox channel.
38
- */
39
26
  export interface HumanTaskHandle {
40
27
  readonly taskId: HumanTaskId;
41
28
  readonly runId: string;
42
29
  readonly nodeId: string;
43
30
  readonly expiresAt: Date;
44
- /** TODO: real signed URL; placeholder empty string for now. */
45
31
  readonly resumeUrl: string;
46
- /**
47
- * Arbitrary JSON metadata copied from `SuspensionRequest.request.metadata` at suspension time.
48
- * Used by the agent runtime to round-trip the `agentCheckpoint` back to the
49
- * resumed node via `ctx.resumeContext.task.metadata`.
50
- */
51
32
  readonly metadata?: Readonly<Record<string, import("./workflowTypes").JsonValue>>;
52
33
  }
53
34
 
54
- /** Human-readable description surface shown to the reviewer. */
55
35
  export interface HumanTaskSubject {
56
36
  readonly title: string;
57
37
  readonly summary: string;
58
38
  readonly attributes?: import("./workflowTypes").JsonValue;
59
39
  }
60
40
 
61
- /** Identity of the person who made a decision on the task. */
62
41
  export interface HumanTaskActor {
63
42
  readonly actorId: string;
64
43
  readonly displayName?: string;
65
44
  }
66
45
 
67
- /**
68
- * Resume context injected into `NodeExecutionContext` when the engine re-activates
69
- * a previously suspended node. `defineHumanApprovalNode` wraps this with parsed
70
- * `TDecision`; at the engine layer `decision.value` is `unknown`.
71
- */
72
46
  export interface ResumeContext {
73
47
  readonly decision:
74
48
  | Readonly<{ kind: "decided"; value: unknown; actor: HumanTaskActor; decidedAt: Date }>
@@ -78,25 +52,6 @@ export interface ResumeContext {
78
52
  readonly task: HumanTaskHandle;
79
53
  }
80
54
 
81
- /**
82
- * Thrown by a node's `execute()` to request durable suspension of the current item.
83
- * The engine catches this, persists the suspension entry, calls `deliver`, and
84
- * continues to the next item (per-item semantics).
85
- *
86
- * @example
87
- * ```ts
88
- * throw new SuspensionRequest({
89
- * decisionSchema: z.object({ approved: z.boolean() }),
90
- * timeout: "PT24H",
91
- * onTimeout: "halt",
92
- * subject: { title: "Approve invoice", summary: "Invoice #1234 needs approval" },
93
- * deliver: async (handle) => {
94
- * await notifySlack(handle);
95
- * return { channel: "slack", ts: "..." };
96
- * },
97
- * });
98
- * ```
99
- */
100
55
  export class SuspensionRequest<
101
56
  TDecision = unknown,
102
57
  TDelivery extends import("./workflowTypes").JsonValue = import("./workflowTypes").JsonValue,
@@ -111,8 +66,6 @@ export class SuspensionRequest<
111
66
  deliver: (handle: HumanTaskHandle) => Promise<TDelivery>;
112
67
  }>,
113
68
  ) {
114
- // Extending Error so wrappers like InProcessRetryRunner preserve identity
115
- // (`instanceof SuspensionRequest`) instead of coercing via String(thrown).
116
69
  super(`SuspensionRequest(${request.subject?.title ?? "untitled"})`);
117
70
  this.name = "SuspensionRequest";
118
71
  }
@@ -190,11 +143,6 @@ export interface NodeExecutionStatePublisher {
190
143
  error: Error;
191
144
  }): Promise<void>;
192
145
  appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise<void>;
193
- /**
194
- * Annotates the current snapshot for `nodeId` with the id of the child run spawned by a
195
- * SubWorkflow invocation. Called from `SubWorkflowNode.execute` after `runById` resolves.
196
- * The engine's subsequent `markCompleted` call preserves the value via `previous.childRunId`.
197
- */
198
146
  setChildRunId?(args: { nodeId: NodeId; childRunId: RunId }): Promise<void>;
199
147
  }
200
148
 
@@ -227,9 +175,7 @@ export interface BinaryStorage {
227
175
  openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
228
176
  stat(storageKey: string): Promise<BinaryStorageStatResult>;
229
177
  delete(storageKey: string): Promise<void>;
230
- /** Deletes multiple objects in bulk. Keys are batched internally. */
231
178
  deleteMany(storageKeys: ReadonlyArray<string>): Promise<void>;
232
- /** Lists all keys sharing a common prefix. Returns keys in arbitrary order. */
233
179
  listByPrefix(prefix: string): Promise<ReadonlyArray<string>>;
234
180
  }
235
181
 
@@ -246,27 +192,13 @@ export interface NodeBinaryAttachmentService extends ExecutionBinaryService {
246
192
  withAttachment<TJson>(item: Item<TJson>, name: string, attachment: BinaryAttachment): Item<TJson>;
247
193
  }
248
194
 
249
- /** Default maximum bytes read into memory by the bounded helpers (50 MiB). */
250
195
  export const BINARY_DEFAULT_MAX_BYTES = 50 * 1024 * 1024;
251
196
 
252
197
  export interface ExecutionBinaryService {
253
198
  forNode(args: { nodeId: NodeId; activationId: NodeActivationId }): NodeBinaryAttachmentService;
254
199
  openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
255
- /**
256
- * Reads all bytes from the attachment into a contiguous `Uint8Array`.
257
- * Checks `attachment.size` against `maxBytes` *before* any allocation; throws a bounded-read
258
- * error when exceeded (no OOM). Throws if the stream is unavailable or the byte count mismatches.
259
- */
260
200
  getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise<Uint8Array>;
261
- /**
262
- * Reads the attachment and decodes the bytes as UTF-8 text.
263
- * Subject to the same bounded-read safety as `getBytes`.
264
- */
265
201
  getText(attachment: BinaryAttachment, maxBytes?: number): Promise<string>;
266
- /**
267
- * Reads the attachment, decodes as UTF-8 text, and parses as JSON.
268
- * Throws a clear error on invalid JSON. Subject to the same bounded-read safety.
269
- */
270
202
  getJson<T = unknown>(attachment: BinaryAttachment, maxBytes?: number): Promise<T>;
271
203
  }
272
204
 
@@ -274,11 +206,8 @@ export interface ExecutionContext {
274
206
  runId: RunId;
275
207
  workflowId: WorkflowId;
276
208
  parent?: ParentExecutionRef;
277
- /** This run's subworkflow depth (0 = root). */
278
209
  subworkflowDepth: number;
279
- /** Effective activation budget cap for this run (after policy merge). */
280
210
  engineMaxNodeActivations: number;
281
- /** Effective subworkflow nesting cap for this run (after policy merge). */
282
211
  engineMaxSubworkflowDepth: number;
283
212
  now: () => Date;
284
213
  data: RunDataSnapshot;
@@ -286,28 +215,11 @@ export interface ExecutionContext {
286
215
  telemetry: ExecutionTelemetry;
287
216
  binary: ExecutionBinaryService;
288
217
  getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
289
- /** Per-item iteration id, set by {@link NodeExecutor} on the ctx passed into runnable `execute`. */
290
218
  iterationId?: NodeIterationId;
291
- /** Item index (0-based) within the current activation's batch; set alongside {@link iterationId}. */
292
219
  itemIndex?: number;
293
- /** When set, this ctx is executing inside a sub-agent triggered by the named parent invocation. */
294
220
  parentInvocationId?: ConnectionInvocationId;
295
- /**
296
- * Present iff the run was started by a TestSuiteOrchestrator. The {@link IsTestRunNode}
297
- * branches on this; assertion-emitting nodes use it to decide whether to record results.
298
- */
299
221
  testContext?: RunTestContext;
300
- /**
301
- * Collections registered in the codemation config, keyed by collection name.
302
- */
303
222
  readonly collections?: CollectionsContext;
304
- /**
305
- * Resolve a DI token from the host container.
306
- * Allows nodes to reach host-side services (e.g. `InboxChannelResolverToken`)
307
- * without importing host code. Wired by `DefaultExecutionContextFactory`; throws
308
- * a clear error when no resolver is configured (e.g. in unit tests that don't
309
- * set up the full container).
310
- */
311
223
  resolve<T>(token: TypeToken<T>): T;
312
224
  }
313
225
 
@@ -334,19 +246,10 @@ export interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfi
334
246
  config: TConfig;
335
247
  telemetry: NodeExecutionTelemetry;
336
248
  binary: NodeBinaryAttachmentService;
337
- /**
338
- * Present when this node activation is a HITL resume.
339
- * The node checks `ctx.resumeContext !== undefined` and takes the resume branch.
340
- */
341
249
  resumeContext?: ResumeContext;
342
250
  }
343
251
 
344
- export interface PollingTriggerHandle {
345
- /**
346
- * Start the polling loop. The runtime registers its own cleanup handle so callers do not need to
347
- * call {@link TriggerSetupContext.registerCleanup} for the loop.
348
- * @returns The state returned by the first cycle (or `undefined` when the overlap guard fired).
349
- */
252
+ export interface TriggerPollingPort {
350
253
  start<TState, TItem>(args: {
351
254
  intervalMs: number;
352
255
  seedState?: TState;
@@ -355,7 +258,9 @@ export interface PollingTriggerHandle {
355
258
  signal: AbortSignal;
356
259
  }) => Promise<{ items: Items<TItem>; nextState: TState }>;
357
260
  }): Promise<TState | undefined>;
358
- /** Convenience dedup-window helper. */
261
+ }
262
+
263
+ export interface PollingTriggerHandle extends TriggerPollingPort {
359
264
  readonly dedup: import("../triggers/polling/PollingTriggerDedupWindow").PollingTriggerDedupWindow;
360
265
  }
361
266
 
@@ -368,7 +273,6 @@ export interface TriggerSetupContext<
368
273
  previousState: TSetupState;
369
274
  registerCleanup(cleanup: TriggerCleanupHandle): void;
370
275
  emit(items: Items): Promise<void>;
371
- /** Generic polling-trigger surface. Pre-binds trigger id, emit, and registerCleanup. */
372
276
  readonly polling: PollingTriggerHandle;
373
277
  }
374
278
 
@@ -382,12 +286,6 @@ export interface TriggerTestItemsContext<
382
286
  previousState: TSetupState;
383
287
  }
384
288
 
385
- /**
386
- * Trigger setup state is intentionally engine-owned so future ownership and
387
- * leader-election metadata can be coordinated centrally rather than pushed into
388
- * package-level setup code.
389
- */
390
-
391
289
  export interface PersistedTriggerSetupState<TState extends JsonValue | undefined = JsonValue | undefined> {
392
290
  trigger: TriggerInstanceId;
393
291
  updatedAt: string;
@@ -409,12 +307,6 @@ export interface EngineHost {
409
307
  workflows?: WorkflowRunnerService;
410
308
  }
411
309
 
412
- /**
413
- * Per-item runnable node: return JSON, an array to fan-out on `main`, an explicit `Item`, or {@link emitPorts}
414
- * for multi-port emission. Engine applies `inputSchema.parse(item.json)` and passes the result as `args.input`
415
- * (wire `item.json` is unchanged). Transform helpers may opt into binary preservation, while routers and
416
- * pass-through nodes should return explicit items when they need to preserve full item state.
417
- */
418
310
  export interface RunnableNodeExecuteArgs<
419
311
  TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>,
420
312
  TInputJson = unknown,
@@ -432,19 +324,11 @@ export interface RunnableNode<
432
324
  _TOutputJson = unknown,
433
325
  > {
434
326
  readonly kind: "node";
435
- /**
436
- * Declared output ports (e.g. `["main"]`).
437
- *
438
- * Prefer describing dynamic router ports (Switch) and fixed multi-ports (If true/false)
439
- * via {@link NodeConfigBase.declaredOutputPorts}. Engine defaults to `["main"]` when omitted.
440
- */
441
327
  readonly outputPorts?: ReadonlyArray<OutputPortKey>;
442
- /** When omitted, engine uses {@link RunnableNodeConfig.inputSchema} or `z.unknown()`. */
443
328
  readonly inputSchema?: ZodType<TInputJson>;
444
329
  execute(args: RunnableNodeExecuteArgs<TConfig, TInputJson>): Promise<unknown> | unknown;
445
330
  }
446
331
 
447
- /** @deprecated Use {@link RunnableNode} */
448
332
  export type ItemNode<
449
333
  TConfig extends RunnableNodeConfig<any, any> = RunnableNodeConfig<any, any>,
450
334
  TInputJson = unknown,
@@ -453,12 +337,6 @@ export type ItemNode<
453
337
 
454
338
  export interface MultiInputNode<TConfig extends NodeConfigBase = NodeConfigBase> {
455
339
  kind: "node";
456
- /**
457
- * Declared output ports (typically `["main"]`).
458
- *
459
- * Prefer describing ports for authoring/canvas via {@link NodeConfigBase.declaredOutputPorts}.
460
- * Engine defaults to `["main"]` when omitted.
461
- */
462
340
  outputPorts?: ReadonlyArray<OutputPortKey>;
463
341
  executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext<TConfig>): Promise<NodeOutputs>;
464
342
  }
@@ -582,7 +460,6 @@ export interface WorkflowSnapshotResolver {
582
460
  }): WorkflowDefinition | undefined;
583
461
  }
584
462
 
585
- /** Optional host wiring for trigger lifecycle logs (boot skip + activation sync). */
586
463
  export interface TriggerRuntimeDiagnostics {
587
464
  info(message: string): void;
588
465
  warn(message: string): void;
@@ -592,7 +469,6 @@ export interface EngineDeps {
592
469
  credentialSessions: CredentialSessionService;
593
470
  liveWorkflowRepository: LiveWorkflowRepository;
594
471
  workflowRepository: WorkflowRepository;
595
- /** When {@link AllWorkflowsActiveWorkflowActivationPolicy}, all workflows behave as active (tests). */
596
472
  workflowActivationPolicy: WorkflowActivationPolicy;
597
473
  nodeResolver: NodeResolver;
598
474
  triggerSetupStateRepository: TriggerSetupStateRepository;
@@ -608,10 +484,7 @@ export interface EngineDeps {
608
484
  eventBus?: RunEventBus;
609
485
  tokenRegistry: PersistedWorkflowTokenRegistryLike;
610
486
  workflowNodeInstanceFactory: WorkflowNodeInstanceFactory;
611
- /** Defaults for prune/storage snapshot when workflow omits explicit policy fields. */
612
487
  workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults;
613
- /** When set, logs inactive-workflow skips at boot and trigger start/stop on activation changes. */
614
488
  triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics;
615
- /** When set, the polling-trigger runtime uses this logger for cycle info/debug/error. */
616
489
  pollingTriggerLogger?: import("../triggers/polling/PollingTriggerLogger").PollingTriggerLogger;
617
490
  }