@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
@@ -73,13 +73,6 @@ export interface TelemetrySpanScope extends TelemetryScope {
73
73
  readonly traceId: string;
74
74
  readonly spanId: string;
75
75
  end(args?: TelemetrySpanEnd): Promise<void> | void;
76
- /**
77
- * Lift this span into a {@link NodeExecutionTelemetry} scoped to a different (nodeId, activationId).
78
- * Children created via the returned telemetry's `startChildSpan` get this span as their parent.
79
- *
80
- * Used at the sub-agent boundary so that nested runtime telemetry parents under the agent.tool.call
81
- * span instead of the orchestrator's node-level span.
82
- */
83
76
  asNodeTelemetry(args: Readonly<{ nodeId: NodeId; activationId: NodeActivationId }>): NodeExecutionTelemetry;
84
77
  }
85
78
 
@@ -1,18 +1,8 @@
1
1
  import type { Item, NodeId, WorkflowId } from "./workflowTypes";
2
2
  import type { TriggerNodeConfig } from "./workflowTypes";
3
3
 
4
- /**
5
- * Identifier minted by the host (or in-memory test runner) for one execution of a test suite.
6
- * One TestSuiteRun produces N child workflow runs, one per item yielded by `generateItems`.
7
- */
8
4
  export type TestSuiteRunId = string;
9
5
 
10
- /**
11
- * Setup context passed to a {@link TestTriggerNodeConfig.generateItems} callback. Distinct from
12
- * {@link import("./runtimeTypes").TriggerSetupContext} on purpose: test triggers are not
13
- * activated by the live trigger lifecycle (webhooks, cron, polling) and never call `emit` —
14
- * the orchestrator pulls from the iterable they return and dispatches one run per item.
15
- */
16
6
  export interface TestTriggerSetupContext<
17
7
  TConfig extends TestTriggerNodeConfig<unknown> = TestTriggerNodeConfig<unknown>,
18
8
  > {
@@ -20,47 +10,14 @@ export interface TestTriggerSetupContext<
20
10
  readonly nodeId: NodeId;
21
11
  readonly config: TConfig;
22
12
  readonly testSuiteRunId: TestSuiteRunId;
23
- /**
24
- * Resolves a credential session for a slot declared on this trigger's
25
- * {@link import("./workflowTypes").NodeConfigBase.getCredentialRequirements}. Same contract as
26
- * {@link import("./runtimeTypes").ExecutionContext.getCredential}.
27
- */
28
13
  getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
29
- /** AbortSignal raised when the suite is cancelled — long-running pulls should bail out. */
30
14
  readonly signal: AbortSignal;
31
15
  }
32
16
 
33
- /**
34
- * A trigger config that emits **test cases**. Each item yielded by {@link generateItems}
35
- * becomes one workflow run (with `executionOptions.testContext` set), so 10 yielded items
36
- * → 10 runs marked under the same TestSuiteRun.
37
- *
38
- * The trigger is otherwise a normal {@link TriggerNodeConfig} (so the canvas treats it like
39
- * any other trigger), but its `triggerKind` is `"test"` so the live activation policy skips it.
40
- */
41
17
  export interface TestTriggerNodeConfig<TOutputJson = unknown> extends TriggerNodeConfig<TOutputJson, undefined> {
42
18
  readonly triggerKind: "test";
43
- /**
44
- * Author-supplied async iterable of items, evaluated lazily. Implementations may fetch from
45
- * credentialed APIs, read fixture files, or yield hard-coded items. The orchestrator iterates
46
- * and dispatches one run per item, with concurrency capped by {@link concurrency} (default 4).
47
- */
48
19
  generateItems(ctx: TestTriggerSetupContext<TestTriggerNodeConfig<TOutputJson>>): AsyncIterable<Item<TOutputJson>>;
49
- /** Per-suite-run cap on simultaneously-executing test cases. Default: 4. */
50
20
  readonly concurrency?: number;
51
- /**
52
- * Free-form description of where the test cases come from — surfaced in the node properties
53
- * panel and the suite-detail header so authors revisiting the workflow six months later
54
- * remember which mailbox / folder / fixture file the cases originate from.
55
- *
56
- * Example: `"All emails in the Gmail label \"test/triage-fixtures\" — 14 messages as of 2026-05-03."`
57
- */
58
21
  readonly description?: string;
59
- /**
60
- * Resolves a human-readable label for one yielded test case (e.g. email subject). The
61
- * orchestrator calls this once per yielded item, persists the result on the run, and the
62
- * Tests-tab UI uses it to render the case row instead of the opaque runId. Return
63
- * `undefined` to fall back to "Case #N".
64
- */
65
22
  caseLabel?(item: Item<TOutputJson>): string | undefined;
66
23
  }
@@ -0,0 +1,6 @@
1
+ import type { Items, TriggerNodeConfig } from "./workflowTypes";
2
+ import type { TriggerInstanceId } from "./webhookTypes";
3
+
4
+ export interface TriggerInvoker {
5
+ invoke(trigger: TriggerInstanceId, config: TriggerNodeConfig, lastRanAt: string | undefined): Promise<Items>;
6
+ }
@@ -11,7 +11,6 @@ export interface WebhookControlSignal {
11
11
 
12
12
  export interface WebhookTriggerRoutingDiagnostics {
13
13
  warn(message: string): void;
14
- /** Inactive workflows omitted from the webhook route index (optional; host should wire for clarity at boot/reload). */
15
14
  info?(message: string): void;
16
15
  }
17
16
 
@@ -20,9 +19,7 @@ export interface TriggerInstanceId {
20
19
  nodeId: NodeId;
21
20
  }
22
21
 
23
- /** Match for an incoming HTTP request: user-defined URL segment + workflow trigger node. */
24
22
  export interface WebhookInvocationMatch {
25
- /** Same value as the webhook trigger's configured endpoint key (URL segment under the webhook base path). */
26
23
  endpointPath: string;
27
24
  workflowId: WorkflowId;
28
25
  nodeId: NodeId;
@@ -30,20 +27,15 @@ export interface WebhookInvocationMatch {
30
27
  parseJsonBody?: (body: unknown) => unknown;
31
28
  }
32
29
 
33
- /** Result of resolving an HTTP method + endpoint path against the catalog webhook index (404 vs 405 vs match). */
34
30
  export type WebhookTriggerResolution =
35
31
  | { status: "notFound" }
36
32
  | { status: "methodNotAllowed"; match: WebhookInvocationMatch }
37
33
  | { status: "ok"; match: WebhookInvocationMatch };
38
34
 
39
- /**
40
- * Resolves webhook routes from workflow definitions (catalog-backed index, no registration at trigger setup).
41
- */
42
35
  export interface WebhookTriggerMatcher {
43
36
  match(args: { endpointPath: string; method: HttpMethod }): WebhookInvocationMatch | undefined;
44
37
  lookup(endpointPath: string): WebhookInvocationMatch | undefined;
45
38
  onEngineWorkflowsLoaded?(): void;
46
39
  onEngineStopped?(): void;
47
- /** Rebuild route index after activation changes without stopping the engine. */
48
40
  reloadWebhookRoutes?(): void;
49
41
  }
@@ -1,14 +1,9 @@
1
1
  import type { WorkflowId } from "./workflowTypes";
2
2
 
3
- /**
4
- * Host-controlled policy: when false, trigger {@link TriggerNode} setup is skipped and webhook routes
5
- * for that workflow are not registered (see engine trigger runtime + webhook matcher).
6
- */
7
3
  export interface WorkflowActivationPolicy {
8
4
  isActive(workflowId: WorkflowId): boolean;
9
5
  }
10
6
 
11
- /** Default for tests and harnesses: every workflow is treated as active (legacy behavior). */
12
7
  export class AllWorkflowsActiveWorkflowActivationPolicy implements WorkflowActivationPolicy {
13
8
  isActive(_workflowId: WorkflowId): boolean {
14
9
  return true;
@@ -23,7 +23,6 @@ export interface JsonObject {
23
23
  }
24
24
  export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
25
25
  export type JsonArray = ReadonlyArray<JsonValue>;
26
- /** JSON value that is not a top-level array (nested arrays inside objects are allowed). */
27
26
  export type JsonNonArray = JsonPrimitive | JsonObject;
28
27
 
29
28
  export interface Edge {
@@ -31,11 +30,6 @@ export interface Edge {
31
30
  to: { nodeId: NodeId; input: InputPortKey };
32
31
  }
33
32
 
34
- /**
35
- * Named connection from a parent node to child nodes that exist in {@link WorkflowDefinition.nodes}
36
- * but are not traversed by the main execution graph. Parents are commonly executable nodes, but may
37
- * also be connection-owned nodes for recursive agent attachments.
38
- */
39
33
  export interface WorkflowNodeConnection {
40
34
  readonly parentNodeId: NodeId;
41
35
  readonly connectionName: NodeConnectionName;
@@ -47,18 +41,10 @@ export interface WorkflowDefinition {
47
41
  name: string;
48
42
  nodes: NodeDefinition[];
49
43
  edges: Edge[];
50
- /**
51
- * Optional metadata: which nodes are connection-owned children (e.g. AI agent `llm` / `tools` slots).
52
- * When omitted, all nodes in {@link nodes} are treated as executable for topology.
53
- */
54
44
  readonly connections?: ReadonlyArray<WorkflowNodeConnection>;
55
- /** Directory + file-stem path under a workflow discovery root (for UI grouping only). */
56
45
  discoveryPathSegments?: readonly string[];
57
- /** Retention for run JSON and binaries (seconds). Host/env may supply defaults when omitted. */
58
46
  readonly prunePolicy?: WorkflowPrunePolicySpec;
59
- /** Whether to keep run data after completion. Host/env may supply defaults when omitted. */
60
47
  readonly storagePolicy?: WorkflowStoragePolicySpec;
61
- /** Invoked after a node fails permanently (retries exhausted) and node error handler did not recover. */
62
48
  readonly workflowErrorHandler?: WorkflowErrorHandlerSpec;
63
49
  }
64
50
 
@@ -76,50 +62,22 @@ export interface NodeConfigBase {
76
62
  readonly name?: string;
77
63
  readonly id?: NodeId;
78
64
  readonly icon?: string;
65
+ readonly description?: string;
79
66
  readonly execution?: Readonly<{ hint?: "local" | "worker"; queue?: string }>;
80
- /** In-process execute retries (runnable nodes). Triggers typically omit this. */
81
67
  readonly retryPolicy?: RetryPolicySpec;
82
- /** Recover from execute failures; return outputs to continue, or rethrow to fail the node. */
83
68
  readonly nodeErrorHandler?: NodeErrorHandlerSpec;
84
- /**
85
- * When true, edges carrying zero items on an output port still schedule single-input downstream nodes.
86
- * Decided from the **source** node that produced the (empty) output. Default (false/undefined): empty
87
- * main batches skip downstream execution and propagate the empty path.
88
- */
89
69
  readonly continueWhenEmptyOutput?: boolean;
90
- /**
91
- * Declared I/O port names for canvas authoring (unioned with ports inferred from edges).
92
- * Use for dynamic routers (Switch) and future error ports.
93
- */
94
70
  readonly declaredOutputPorts?: ReadonlyArray<OutputPortKey>;
95
71
  readonly declaredInputPorts?: ReadonlyArray<InputPortKey>;
96
72
  getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
97
- /**
98
- * Marker: this node emits {@link import("./assertionTypes").AssertionResult}-shaped items on its
99
- * `main` port. The TestSuiteOrchestrator (and host-side TestAssertionPersister) listen for
100
- * `nodeCompleted` events from nodes with this flag set, and persist their output items as
101
- * TestAssertion records (only when the run carries a `testContext`). Set on assertion node
102
- * configs (e.g. `AssertionNodeConfig`, `StringEqualsAssertionNodeConfig`).
103
- */
104
73
  readonly emitsAssertions?: true;
105
- /**
106
- * Static configuration summary surfaced in the workflow inspector — the design-time
107
- * "what does this node do" panel that renders before any run telemetry exists.
108
- *
109
- * Return 2–6 short label/value pairs derived from this config (method + url for an HTTP
110
- * call, model + tool list for an agent, schedule + timezone for a cron trigger, etc.).
111
- * Values are truncated by the UI; aim for one line each. Return `undefined` to opt out
112
- * — the inspector hides the section when no rows are produced.
113
- *
114
- * Implement on the config class instance so the function can read sibling config fields.
115
- * `defineNode({ inspectorSummary })` plumbs through to this.
116
- */
117
74
  inspectorSummary?(): ReadonlyArray<NodeInspectorSummaryRow> | undefined;
118
75
  }
119
76
 
120
- /**
121
- * One row of a node's static configuration summary. See {@link NodeConfigBase.inspectorSummary}.
122
- */
77
+ export interface PollingTriggerConfig {
78
+ getTriggerPollConfig(): Readonly<{ config: JsonObject; pollIntervalMs?: number }>;
79
+ }
80
+
123
81
  export interface NodeInspectorSummaryRow {
124
82
  readonly label: string;
125
83
  readonly value: string;
@@ -129,24 +87,11 @@ export declare const runnableNodeInputType: unique symbol;
129
87
  export declare const runnableNodeOutputType: unique symbol;
130
88
  export declare const triggerNodeOutputType: unique symbol;
131
89
 
132
- /**
133
- * Runnable node: **`TInputJson`** is what **`inputSchema`** validates on **`item.json`** (the wire payload).
134
- * **`TOutputJson`** is emitted `item.json` on outputs.
135
- */
136
90
  export interface RunnableNodeConfig<TInputJson = unknown, TOutputJson = unknown> extends NodeConfigBase {
137
91
  readonly kind: "node";
138
92
  readonly [runnableNodeInputType]?: TInputJson;
139
93
  readonly [runnableNodeOutputType]?: TOutputJson;
140
- /**
141
- * Optional Zod input contract for {@link RunnableNode} when not set on the node class.
142
- * Resolution order: node instance `inputSchema`, then config `inputSchema`, then `z.unknown()`.
143
- */
144
94
  readonly inputSchema?: ZodType<TInputJson>;
145
- /**
146
- * When an activation receives **zero** input items, the engine normally runs `execute` zero times.
147
- * Set to **`runOnce`** to run `execute` once with an empty `items` batch (and a synthetic wire item for schema parsing).
148
- * Used by batch-style callback nodes (built-in `Callback`) so `callback([], ctx)` still runs.
149
- */
150
95
  readonly emptyBatchExecution?: "skip" | "runOnce";
151
96
  }
152
97
 
@@ -159,11 +104,6 @@ export interface TriggerNodeConfig<
159
104
  readonly kind: "trigger";
160
105
  readonly [triggerNodeOutputType]?: TOutputJson;
161
106
  readonly [triggerNodeSetupStateType]?: TSetupState;
162
- /**
163
- * Distinguishes triggers driven by the live activation policy (webhooks, cron, polling) from
164
- * triggers driven only by the {@link TestSuiteOrchestrator}. `WorkflowActivation` skips
165
- * `"test"` triggers; the orchestrator skips `"live"` triggers. Defaults to `"live"` when omitted.
166
- */
167
107
  readonly triggerKind?: "live" | "test";
168
108
  }
169
109
 
@@ -232,28 +172,15 @@ export type NodeOutputs = Partial<Record<OutputPortKey, Items>>;
232
172
 
233
173
  export type RunId = string;
234
174
  export type NodeActivationId = string;
235
- /**
236
- * One per-item iteration of a runnable node's execute loop. Refines `NodeActivationId` for
237
- * per-item connection invocations and telemetry. Undefined when the executing node is a batch
238
- * node or trigger that does not iterate items.
239
- */
240
175
  export type NodeIterationId = string;
241
176
 
242
177
  export interface ParentExecutionRef {
243
178
  runId: RunId;
244
179
  workflowId: WorkflowId;
245
180
  nodeId: NodeId;
246
- /** Subworkflow depth of the **spawning** run (0 = root). Passed when starting a child run. */
247
181
  subworkflowDepth?: number;
248
- /** Effective max node activations from the parent run (propagated to child policy merge). */
249
182
  engineMaxNodeActivations?: number;
250
- /** Effective max subworkflow depth from the parent run (propagated to child policy merge). */
251
183
  engineMaxSubworkflowDepth?: number;
252
- /**
253
- * Test-suite linkage inherited by the child subworkflow run. Set by whichever node
254
- * spawns the subworkflow when its own `ctx.testContext` is present, so assertions
255
- * emitted inside a subworkflow land under the correct parent test case.
256
- */
257
184
  testContext?: import("./runTypes").RunTestContext;
258
185
  }
259
186
 
@@ -298,7 +225,6 @@ export interface NodeOffloadPolicy {
298
225
  decide(args: { workflowId: WorkflowId; nodeId: NodeId; config: NodeConfigBase }): NodeSchedulerDecision;
299
226
  }
300
227
 
301
- /** Whether to persist run execution data after the workflow finishes. */
302
228
  export type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER";
303
229
 
304
230
  export type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken<WorkflowStoragePolicyResolver>;
@@ -363,7 +289,6 @@ export interface NodeErrorHandler {
363
289
 
364
290
  export type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
365
291
 
366
- /** Runtime defaults when workflow omits prune/storage fields (typically from host env). */
367
292
  export interface WorkflowPolicyRuntimeDefaults {
368
293
  readonly retentionSeconds?: number;
369
294
  readonly binaryRetentionSeconds?: number;
@@ -1,62 +1,26 @@
1
1
  import type { TypeToken } from "../di";
2
2
 
3
- /**
4
- * Metadata returned for a workspace file object.
5
- * Filename and contentType come from the S3 object's custom metadata
6
- * (stamped by the control plane at upload time — story 03).
7
- * The local-fs driver reads them from a companion .meta.json sidecar.
8
- */
9
3
  export interface WorkspaceFileMetadata {
10
- /** Storage key: `<workspaceId>/files/<fileId>` */
11
4
  readonly key: string;
12
- /** Last path segment of the storage key. */
13
5
  readonly fileId: string;
14
- /** Original filename as stamped by the CP at upload time. Empty string if not yet stamped (pre-story-03). */
15
6
  readonly filename: string;
16
7
  readonly contentType: string;
17
8
  readonly size: number;
18
9
  readonly lastModified: Date;
19
10
  }
20
11
 
21
- /**
22
- * Read-only, workspace-scoped port for accessing the shared workspace file pool.
23
- * Implemented in `@codemation/host`; nodes reach it via `ctx.resolve(WorkspaceFileStorageToken)`.
24
- *
25
- * Key scheme: `<workspaceId>/files/<fileId>` — but nodes never construct raw keys.
26
- * Use the workspace-level helpers (`listFiles`, `getFileByName`, `getFileById`) instead.
27
- *
28
- * This adapter is SEPARATE from the run-scoped BinaryStorage — do not confuse the two.
29
- */
30
12
  export interface IWorkspaceFileStorage {
31
- /**
32
- * Lists all files in this workspace, sorted newest-first by lastModified.
33
- * Optional case-insensitive substring filter on filename.
34
- */
35
13
  listFiles(filenameFilter?: string): Promise<ReadonlyArray<WorkspaceFileMetadata>>;
36
14
 
37
- /**
38
- * Returns metadata for the newest file with the given filename in this workspace.
39
- * @throws WorkspaceFileNotFoundError when no file with that name exists.
40
- */
41
15
  getFileByName(filename: string): Promise<WorkspaceFileMetadata>;
42
16
 
43
- /**
44
- * Returns metadata for the file with the given fileId in this workspace.
45
- * @throws WorkspaceFileNotFoundError when no file with that id exists.
46
- */
47
17
  getFileById(fileId: string): Promise<WorkspaceFileMetadata>;
48
18
 
49
- /**
50
- * Returns a non-buffered stream of the stored object's bytes.
51
- * Accepts a full storage key or a fileId (prefixes as needed).
52
- * @throws WorkspaceFileNotFoundError when the key does not exist.
53
- */
54
19
  getStream(key: string): Promise<ReadableStream<Uint8Array>>;
20
+
21
+ writeFile(filename: string, body: Uint8Array, contentType: string): Promise<WorkspaceFileMetadata>;
55
22
  }
56
23
 
57
- /**
58
- * Error thrown when a requested workspace file key does not exist.
59
- */
60
24
  export class WorkspaceFileNotFoundError extends Error {
61
25
  constructor(readonly key: string) {
62
26
  super(`Workspace file not found: ${key}`);
@@ -64,10 +28,14 @@ export class WorkspaceFileNotFoundError extends Error {
64
28
  }
65
29
  }
66
30
 
67
- /**
68
- * DI token for the workspace-scoped file storage adapter.
69
- * Registered by `@codemation/host`; resolved by workspace-file nodes via `ctx.resolve(...)`.
70
- */
31
+ export interface IWorkspaceFileRegistrar {
32
+ register(meta: WorkspaceFileMetadata): Promise<void>;
33
+ }
34
+
71
35
  export const WorkspaceFileStorageToken = Symbol.for("codemation.core.WorkspaceFileStorage") as TypeToken<
72
36
  IWorkspaceFileStorage | undefined
73
37
  >;
38
+
39
+ export const WorkspaceFileRegistrarToken = Symbol.for("codemation.core.WorkspaceFileRegistrar") as TypeToken<
40
+ IWorkspaceFileRegistrar | undefined
41
+ >;
package/src/contracts.ts CHANGED
@@ -1,28 +1,23 @@
1
- // Pure-type-only re-exports. Use this for type-only consumers that should not drag in runtime DSL or factory code.
2
- // This subpath prevents unnecessary compile-graph bloat for packages that only need types like NodeId, Items, etc.
3
-
4
1
  export type * from "./contracts/agentMcpTypes";
2
+ export type { WorkspaceId, DispatchItemMeta, WorkflowDispatch } from "./contracts/dispatchTypes";
3
+ export { serializeDispatch, deserializeDispatch } from "./contracts/dispatchTypes";
5
4
  export * from "./contracts/AgentBindError";
6
5
  export * from "./contracts/NoOpAgentMcpIntegration";
7
6
  export type * from "./contracts/baseTypes";
8
7
  export type * from "./contracts/assertionTypes";
9
- // assertionTypes also exports a runtime helper for deriving pass/fail from a score+threshold.
10
- // We keep the type-only re-export above and surface the helper explicitly here so UI consumers
11
- // (next-host) don't need to re-implement the comparison.
12
8
  export { deriveAssertionPassed, DEFAULT_ASSERTION_PASS_THRESHOLD } from "./contracts/assertionTypes";
13
9
  export type * from "./contracts/params";
14
10
  export type * from "./contracts/retryPolicySpec.types";
15
11
  export type * from "./contracts/CostCatalogContract";
16
12
  export type * from "./contracts/executionPersistenceContracts";
17
13
  export type * from "./contracts/runtimeTypes";
14
+ export type * from "./contracts/triggerInvokerTypes";
18
15
  export type * from "./contracts/telemetryTypes";
19
16
  export type * from "./contracts/testTriggerTypes";
20
17
  export type * from "./contracts/runTypes";
21
18
  export type * from "./contracts/webhookTypes";
22
19
  export type * from "./contracts/workflowTypes";
23
20
 
24
- // credentialTypes mixes types (Credential* interfaces) with runtime (CredentialUnboundError class).
25
- // Export type-only subset for pure type consumers.
26
21
  export type {
27
22
  CredentialTypeId,
28
23
  CredentialInstanceId,
@@ -44,6 +39,8 @@ export type {
44
39
  CredentialInstanceRecord,
45
40
  CredentialSessionFactoryArgs,
46
41
  CredentialSessionFactory,
42
+ CredentialAccessTokenSessionArgs,
43
+ CredentialAccessTokenSessionFactory,
47
44
  CredentialHealthTester,
48
45
  CredentialType,
49
46
  AnyCredentialType,
@@ -51,8 +48,6 @@ export type {
51
48
  CredentialTypeRegistry,
52
49
  } from "./contracts/credentialTypes";
53
50
 
54
- // CostTrackingTelemetryContract mixes types with const runtime values (metric/attribute names).
55
- // Export type-only subset for pure type consumers.
56
51
  export type {
57
52
  CostTrackingComponent,
58
53
  CostTrackingUsageRecord,
@@ -60,3 +55,16 @@ export type {
60
55
  CostTrackingTelemetry,
61
56
  CostTrackingTelemetryFactory,
62
57
  } from "./contracts/CostTrackingTelemetryContract";
58
+
59
+ export type {
60
+ DeploymentManifestSchemaVersion,
61
+ ManifestTriggerConfig,
62
+ ManifestNodeCredentialShape,
63
+ WorkflowDeploymentManifest,
64
+ } from "./contracts/deploymentManifestTypes";
65
+ export {
66
+ DEPLOYMENT_MANIFEST_SCHEMA_VERSION,
67
+ serializeManifest,
68
+ deserializeManifest,
69
+ emitWorkflowManifest,
70
+ } from "./contracts/deploymentManifestTypes";
@@ -1,35 +1,12 @@
1
1
  import type { OAuthMaterial } from "./OAuthFlowExecutor.types";
2
2
 
3
- /**
4
- * Material provider seam — see `docs/design/credentials-oauth-unification.md`,
5
- * "Material provider seam" section. Sits beside the workspace's
6
- * `CredentialStore`; persistence of the row stays at the store, persistence of
7
- * the bytes goes through this provider so they can live at the control plane
8
- * in managed mode.
9
- */
10
-
11
- /**
12
- * Pointer to material bytes. For local rows `ref` is the workspace instance id
13
- * and the bytes co-locate with the row (existing `CredentialOAuth2Material` /
14
- * `CredentialSecretMaterial` tables). For control-plane rows `ref` is the
15
- * CP-side credential id; the workspace stores only the pointer.
16
- */
17
3
  export type CredentialMaterialRef = Readonly<{
18
4
  source: "local" | "control-plane";
19
5
  id: string;
20
6
  }>;
21
7
 
22
- /**
23
- * Decrypted material bytes returned by a provider. Shape matches
24
- * `OAuthMaterial` — every supported credential type today is OAuth-shaped.
25
- */
26
8
  export type MaterialBundle = OAuthMaterial;
27
9
 
28
- /**
29
- * Caller context recorded by the CP material endpoint per fetch (D5 in the
30
- * `credentials-vault` sprint README). The local provider accepts but ignores
31
- * it; standalone mode has no audit log.
32
- */
33
10
  export type CallerContext = Readonly<{
34
11
  workspaceId: string;
35
12
  caller:
@@ -45,11 +22,6 @@ export interface CredentialMaterialProvider {
45
22
  setMaterial(ref: CredentialMaterialRef, material: MaterialBundle): Promise<void>;
46
23
  }
47
24
 
48
- /**
49
- * Thrown by a provider when asked to operate on a `ref.source` it does not
50
- * handle (e.g. the local provider being asked to read `control-plane` bytes).
51
- * Exported so `instanceof`-checks work across the workspace boundary.
52
- */
53
25
  export class IllegalMaterialSourceError extends Error {
54
26
  constructor(
55
27
  public readonly source: CredentialMaterialRef["source"],
@@ -1,9 +1,3 @@
1
- /**
2
- * Thrown by managed-mode providers when `setMaterial` is called. Managed
3
- * credential bytes are owned by the control plane; the workspace must not
4
- * mutate them. See `docs/design/credentials-oauth-unification.md` and
5
- * `planning/sprints/credentials-vault/02-controlplane-material-provider.md`.
6
- */
7
1
  export class ManagedCredentialMaterialWriteError extends Error {
8
2
  constructor(
9
3
  message: string = "managed credentials are owned by the control plane; use the Connected apps page to create or modify them.",
@@ -1,9 +1,3 @@
1
- /**
2
- * Thrown by `ControlPlaneCredentialMaterialProvider` when the control-plane
3
- * material endpoint returns a non-2xx response or a malformed body. Exposes
4
- * the HTTP status and the raw error body so call sites can surface actionable
5
- * detail without parsing strings.
6
- */
7
1
  export class ManagedMaterialFetchError extends Error {
8
2
  constructor(
9
3
  public readonly status: number,
@@ -1,13 +1,3 @@
1
- /**
2
- * Four-concept model for credentials (see docs/design/credentials-oauth-unification.md):
3
- * 1. CredentialType — schema for stored material (e.g. "oauth.google.gmail").
4
- * 2. Credential slot requirement — which types a node or MCP server accepts.
5
- * 3. CredentialInstance — a stored, usable token row in the host's credential store.
6
- * 4. OAuthFlowExecutor (this file) — the only concept that differs between deployment
7
- * modes. DI selects one implementation at boot; the rest of the system programs
8
- * against this interface alone.
9
- */
10
-
11
1
  export interface OAuthFlowStartArgs {
12
2
  readonly typeId: string;
13
3
  readonly scopes: ReadonlyArray<string>;
@@ -34,11 +24,6 @@ export interface OAuthMaterial {
34
24
 
35
25
  export interface OAuthFlowExecutor {
36
26
  start(args: OAuthFlowStartArgs): Promise<OAuthFlowStartResult>;
37
- /**
38
- * Returns the instanceId associated with a pending stateToken without consuming it.
39
- * Used by callback routes to identify the target instance before calling completeCallback.
40
- * Returns undefined when the stateToken is unknown or already consumed.
41
- */
42
27
  lookupInstanceId(stateToken: string): string | undefined;
43
28
  completeCallback(args: OAuthFlowCallbackArgs): Promise<OAuthMaterial>;
44
29
  refresh(args: { typeId: string; instanceId: string; material: OAuthMaterial }): Promise<OAuthMaterial>;
@@ -21,6 +21,7 @@ import type {
21
21
  WorkflowRepository,
22
22
  WorkflowRunnerService,
23
23
  } from "../types";
24
+ import type { TriggerInvoker } from "../contracts/triggerInvokerTypes";
24
25
 
25
26
  export const CoreTokens = {
26
27
  PersistedWorkflowTokenRegistry: Symbol.for(
@@ -51,17 +52,12 @@ export const CoreTokens = {
51
52
  RunEventBus: Symbol.for("codemation.core.RunEventBus") as TypeToken<RunEventBus>,
52
53
  BinaryStorage: Symbol.for("codemation.core.BinaryStorage") as TypeToken<BinaryStorage>,
53
54
  WebhookBasePath: Symbol.for("codemation.core.WebhookBasePath") as TypeToken<string>,
54
- /** Engine execution limits (defaults + optional host overrides). Consumers may bind a custom instance to override. */
55
55
  EngineExecutionLimitsPolicy: Symbol.for(
56
56
  "codemation.core.EngineExecutionLimitsPolicy",
57
57
  ) as TypeToken<EngineExecutionLimitsPolicy>,
58
58
  WorkflowActivationPolicy: Symbol.for(
59
59
  "codemation.core.WorkflowActivationPolicy",
60
60
  ) as TypeToken<WorkflowActivationPolicy>,
61
- /**
62
- * Optional. When registered, AIAgentNode uses it to resolve mcpServers bindings,
63
- * validate scopes, open pool connections, and prepare the MCP ToolSet map.
64
- * Not registered in the default core bootstrap — the host provides the implementation.
65
- */
66
61
  AgentMcpIntegration: Symbol.for("codemation.core.AgentMcpIntegration") as TypeToken<AgentMcpIntegration>,
62
+ TriggerInvoker: Symbol.for("codemation.core.TriggerInvoker") as TypeToken<TriggerInvoker>,
67
63
  } as const;
@@ -2,13 +2,6 @@ import type { ConnectionInvocationRecord } from "../contracts/runTypes";
2
2
  import type { ParentExecutionRef } from "../types";
3
3
  import type { RunEventBus } from "./runEvents";
4
4
 
5
- /**
6
- * Publishes per-invocation lifecycle records onto the run {@link RunEventBus}.
7
- *
8
- * Surgical, per-invocation events let the UI update the right-side inspector
9
- * timeline as each LLM round / tool call transitions through `running` → `completed`
10
- * (or `failed`) without depending on a coarse `runSaved` poll.
11
- */
12
5
  export class ConnectionInvocationEventPublisher {
13
6
  constructor(
14
7
  private readonly eventBus: RunEventBus | undefined,
@@ -1,7 +1,6 @@
1
1
  import type { RunEventBus } from "./runEvents";
2
2
  import type { NodeExecutionSnapshot } from "../types";
3
3
 
4
- /** Publishes node lifecycle snapshots onto the run {@link RunEventBus}. */
5
4
  export class NodeEventPublisher {
6
5
  constructor(private readonly eventBus: RunEventBus | undefined) {}
7
6
 
@@ -2,15 +2,7 @@ import type { TestSuiteRunId } from "../contracts/testTriggerTypes";
2
2
  import type { ConnectionInvocationRecord } from "../contracts/runTypes";
3
3
  import type { NodeExecutionSnapshot, ParentExecutionRef, PersistedRunState, RunId, WorkflowId } from "../types";
4
4
 
5
- /**
6
- * Outcome of a single test case (one workflow run dispatched by the test-suite orchestrator).
7
- * - `running`: workflow still in flight
8
- * - `succeeded`: workflow completed AND all assertions passed (or no assertions)
9
- * - `failed`: workflow failed OR (workflow completed but ≥1 assertion failed)
10
- * - `errored` / `cancelled`: workflow itself errored or was cancelled
11
- */
12
5
  export type TestCaseRunStatus = "running" | "succeeded" | "failed" | "errored" | "cancelled";
13
- /** Aggregate outcome of a TestSuiteRun. */
14
6
  export type TestSuiteRunStatus = "succeeded" | "failed" | "partial" | "errored" | "cancelled";
15
7
 
16
8
  export type RunEvent =
@@ -47,15 +47,7 @@ export type ActivationEnqueueRequest = {
47
47
  planner: RunQueuePlanner;
48
48
  engineCounters?: EngineRunCounters;
49
49
  connectionInvocations?: ReadonlyArray<ConnectionInvocationRecord>;
50
- /**
51
- * Remaining suspension entries after consuming one for a HITL resume.
52
- * When provided, saved alongside the new pending state so they survive the enqueue.
53
- */
54
50
  suspension?: ReadonlyArray<PersistedSuspensionEntry>;
55
- /**
56
- * Resume context to attach to the re-activated node's execution context.
57
- * Written here and consumed by `NodeExecutionRequestHandlerService` when building ctx.
58
- */
59
51
  pendingResume?: PendingResumeEntry;
60
52
  };
61
53
 
@@ -126,8 +118,6 @@ export class ActivationEnqueueService {
126
118
  ...args.previousNodeSnapshotsByNodeId,
127
119
  [args.request.nodeId]: queuedSnapshot,
128
120
  },
129
- // HITL: preserve suspension entries and resume context when re-activating a
130
- // suspended node. Omit fields when not provided (avoids polluting normal enqueue).
131
121
  ...(args.suspension !== undefined ? { suspension: args.suspension } : {}),
132
122
  ...(args.pendingResume !== undefined ? { pendingResume: args.pendingResume } : {}),
133
123
  });