@codemation/core 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/CostCatalogContract-DD7fQ4FF.d.cts +19 -0
  3. package/dist/{EngineRuntimeRegistration.types-MPYWsEM0.d.cts → EngineRuntimeRegistration.types-DTV5_7Jw.d.cts} +3 -2
  4. package/dist/{EngineRuntimeRegistration.types-BZ_1XWAJ.d.ts → EngineRuntimeRegistration.types-Dl92Hdoi.d.ts} +2 -2
  5. package/dist/InMemoryRunDataFactory-qMiYjhCK.d.cts +202 -0
  6. package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js → InMemoryRunEventBusRegistry-Bwunvt1T.js} +1 -1
  7. package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js.map → InMemoryRunEventBusRegistry-Bwunvt1T.js.map} +1 -1
  8. package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs → InMemoryRunEventBusRegistry-Sa86VxuV.cjs} +1 -1
  9. package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map → InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map} +1 -1
  10. package/dist/ItemsInputNormalizer-BhuxvZh5.js +36 -0
  11. package/dist/ItemsInputNormalizer-BhuxvZh5.js.map +1 -0
  12. package/dist/ItemsInputNormalizer-C09a7iFP.d.ts +321 -0
  13. package/dist/ItemsInputNormalizer-DLaD6rTl.d.cts +407 -0
  14. package/dist/ItemsInputNormalizer-Div-fb6a.cjs +43 -0
  15. package/dist/ItemsInputNormalizer-Div-fb6a.cjs.map +1 -0
  16. package/dist/RunIntentService-BOSGwmqn.d.ts +299 -0
  17. package/dist/RunIntentService-CWMMrAP4.d.cts +220 -0
  18. package/dist/{RunIntentService-MUHJ1bhO.d.cts → agentMcpTypes-DUmniLOY.d.cts} +183 -206
  19. package/dist/bootstrap/index.cjs +4 -2
  20. package/dist/bootstrap/index.d.cts +63 -5
  21. package/dist/bootstrap/index.d.ts +5 -4
  22. package/dist/bootstrap/index.js +4 -2
  23. package/dist/{bootstrap-Dgzsjoj7.js → bootstrap-CKTMMNmL.js} +174 -3
  24. package/dist/bootstrap-CKTMMNmL.js.map +1 -0
  25. package/dist/{bootstrap-dVmpU1ju.cjs → bootstrap-D460dCgS.cjs} +209 -36
  26. package/dist/bootstrap-D460dCgS.cjs.map +1 -0
  27. package/dist/browser.cjs +17 -0
  28. package/dist/browser.d.cts +4 -0
  29. package/dist/browser.d.ts +3 -0
  30. package/dist/browser.js +4 -0
  31. package/dist/contracts-CK0x6w_G.cjs +74 -0
  32. package/dist/contracts-CK0x6w_G.cjs.map +1 -0
  33. package/dist/contracts-DXdfTdpW.js +50 -0
  34. package/dist/contracts-DXdfTdpW.js.map +1 -0
  35. package/dist/contracts.cjs +6 -0
  36. package/dist/contracts.d.cts +5 -0
  37. package/dist/contracts.d.ts +2 -0
  38. package/dist/contracts.js +3 -0
  39. package/dist/di-DdsgWfVy.js +405 -0
  40. package/dist/di-DdsgWfVy.js.map +1 -0
  41. package/dist/di-tO6R7VJV.cjs +524 -0
  42. package/dist/di-tO6R7VJV.cjs.map +1 -0
  43. package/dist/executionPersistenceContracts-DenJJK2T.d.cts +275 -0
  44. package/dist/{index-Bes88mxT.d.ts → index-BZDhEQ6W.d.ts} +278 -415
  45. package/dist/{RunIntentService-BrEq6Jm6.d.ts → index-CSKKuK60.d.ts} +441 -286
  46. package/dist/index.cjs +97 -250
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +395 -803
  49. package/dist/index.d.ts +5 -3
  50. package/dist/index.js +58 -224
  51. package/dist/index.js.map +1 -1
  52. package/dist/params-DqRvku2h.d.cts +44 -0
  53. package/dist/{runtime-Duf3ClPw.js → runtime-BPZgnZ9G.js} +591 -382
  54. package/dist/runtime-BPZgnZ9G.js.map +1 -0
  55. package/dist/{runtime-vH0EeZzH.cjs → runtime-CyW9c9XM.cjs} +651 -500
  56. package/dist/runtime-CyW9c9XM.cjs.map +1 -0
  57. package/dist/testing.cjs +23 -21
  58. package/dist/testing.cjs.map +1 -1
  59. package/dist/testing.d.cts +3 -2
  60. package/dist/testing.d.ts +3 -2
  61. package/dist/testing.js +5 -3
  62. package/dist/testing.js.map +1 -1
  63. package/package.json +9 -5
  64. package/src/ai/AgentConnectionNodeCollector.ts +1 -1
  65. package/src/authoring/defineHumanApprovalNode.types.ts +379 -0
  66. package/src/authoring/index.ts +6 -0
  67. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +29 -0
  68. package/src/contracts/CodemationTelemetryAttributeNames.ts +10 -0
  69. package/src/contracts/credentialTypes.ts +10 -0
  70. package/src/contracts/hitlSeamTypes.ts +34 -0
  71. package/src/contracts/humanTaskStoreTypes.ts +48 -0
  72. package/src/contracts/inboxChannelTypes.ts +58 -0
  73. package/src/contracts/index.ts +3 -0
  74. package/src/contracts/runTypes.ts +61 -3
  75. package/src/contracts/runtimeTypes.ts +112 -0
  76. package/src/credentials/CredentialMaterialProvider.types.ts +61 -0
  77. package/src/credentials/ManagedCredentialMaterialWriteError.ts +14 -0
  78. package/src/credentials/ManagedMaterialFetchError.ts +16 -0
  79. package/src/execution/ActivationEnqueueService.ts +16 -0
  80. package/src/execution/DefaultExecutionContextFactory.ts +11 -0
  81. package/src/execution/NodeExecutionSnapshotFactory.ts +7 -1
  82. package/src/execution/NodeExecutor.ts +60 -1
  83. package/src/execution/NodeExecutorFactory.ts +12 -2
  84. package/src/execution/NodeSuspensionHandler.ts +220 -0
  85. package/src/execution/PersistedRunStateTerminalBuilder.ts +5 -2
  86. package/src/execution/RunStateSemantics.ts +5 -0
  87. package/src/execution/RunSuspendedError.ts +21 -0
  88. package/src/index.ts +40 -0
  89. package/src/orchestration/Engine.ts +12 -2
  90. package/src/orchestration/EngineWaiters.ts +1 -1
  91. package/src/orchestration/NodeExecutionRequestHandlerService.ts +25 -2
  92. package/src/orchestration/RunContinuationService.ts +226 -2
  93. package/src/orchestration/TestSuiteOrchestrator.ts +5 -4
  94. package/src/runtime/RunIntentService.ts +3 -0
  95. package/src/workflow/dsl/ChainCursorResolver.ts +36 -0
  96. package/tsdown.config.ts +1 -1
  97. package/dist/InMemoryRunDataFactory-hmkh0lzR.d.cts +0 -138
  98. package/dist/bootstrap-Dgzsjoj7.js.map +0 -1
  99. package/dist/bootstrap-dVmpU1ju.cjs.map +0 -1
  100. package/dist/runtime-Duf3ClPw.js.map +0 -1
  101. package/dist/runtime-vH0EeZzH.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @codemation/core
2
2
 
3
+ ## 0.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#167](https://github.com/MadeRelevant/codemation/pull/167) [`3044474`](https://github.com/MadeRelevant/codemation/commit/3044474495525490735510ff74500b53761284b6) Thanks [@cblokland90](https://github.com/cblokland90)! - feat(hitl): Human-in-the-Loop — engine suspend/resume, inbox approval node + channels (local + control-plane), agent-as-tool, decision/timeout handling, inbox decision UX (toast + node status icons + "waiting for approval"), plus the consolidated dev/canvas/host fixes shipped alongside.
8
+
9
+ ## 0.11.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#154](https://github.com/MadeRelevant/codemation/pull/154) [`e0933eb`](https://github.com/MadeRelevant/codemation/commit/e0933ebc51806a9593f94758860c591b8346a7a5) Thanks [@cblokland90](https://github.com/cblokland90)! - fix: compile `./browser` and `./contracts` subpath exports (were shipping raw .ts, broke Turbopack consumers)
14
+
15
+ The `./browser` and `./contracts` subpaths in `@codemation/core` were pointing at raw TypeScript source files (`./src/browser.ts`, `./src/contracts.ts`). Turbopack (used by Next.js) and other browser bundlers refuse to process raw `.ts` from published npm packages, causing builds to fail with "Unknown module type" errors.
16
+
17
+ Both entry points are now compiled by tsdown and the exports map points at `./dist/browser.{js,cjs,d.ts}` and `./dist/contracts.{js,cjs,d.ts}`. A `development` condition retains the direct-source path for framework-author mode. API surface is unchanged.
18
+
3
19
  ## 0.11.0
4
20
 
5
21
  ### Minor Changes
@@ -0,0 +1,19 @@
1
+ import { fi as CostTrackingUsageRecord } from "./agentMcpTypes-DUmniLOY.cjs";
2
+
3
+ //#region src/contracts/CostCatalogContract.d.ts
4
+ interface CostCatalogEntry {
5
+ readonly component: CostTrackingUsageRecord["component"];
6
+ readonly provider: string;
7
+ readonly operation: string;
8
+ readonly pricingKey: string;
9
+ readonly usageUnit: string;
10
+ readonly currency: string;
11
+ readonly currencyScale: number;
12
+ readonly pricePerUnitMinor: number;
13
+ }
14
+ interface CostCatalog {
15
+ findEntry(args: CostTrackingUsageRecord): CostCatalogEntry | undefined;
16
+ }
17
+ //#endregion
18
+ export { CostCatalogEntry as n, CostCatalog as t };
19
+ //# sourceMappingURL=CostCatalogContract-DD7fQ4FF.d.cts.map
@@ -1,4 +1,5 @@
1
- import { C as PersistedWorkflowSnapshot, Dr as WebhookTriggerMatcher, Hi as WorkflowId, N as RunResult, Nt as NodeConfigBase, T as PersistedWorkflowTokenRegistryLike, Tt as Items, W as DependencyContainer, fr as TriggerRuntimeDiagnostics, kr as WebhookTriggerRoutingDiagnostics, lt as EngineExecutionLimitsPolicyConfig, on as WorkflowDefinition, pn as WorkflowPolicyRuntimeDefaults, qt as ParentExecutionRef, r as Engine, vr as WorkflowRepository, w as PersistedWorkflowSnapshotNode, zi as NodeId } from "./RunIntentService-MUHJ1bhO.cjs";
1
+ import { C as PersistedWorkflowSnapshotNode, Ir as WebhookTriggerRoutingDiagnostics, Ki as NodeId, N as RunResult, Nt as NodeConfigBase, Pr as WebhookTriggerMatcher, S as PersistedWorkflowSnapshot, Tr as WorkflowRepository, Tt as Items, W as DependencyContainer, Yi as WorkflowId, lt as EngineExecutionLimitsPolicyConfig, on as WorkflowDefinition, pn as WorkflowPolicyRuntimeDefaults, qt as ParentExecutionRef, w as PersistedWorkflowTokenRegistryLike, yr as TriggerRuntimeDiagnostics } from "./agentMcpTypes-DUmniLOY.cjs";
2
+ import { r as Engine } from "./RunIntentService-CWMMrAP4.cjs";
2
3
 
3
4
  //#region src/workflowSnapshots/WorkflowSnapshotCodec.d.ts
4
5
  declare class WorkflowSnapshotCodec {
@@ -77,4 +78,4 @@ interface EngineRuntimeRegistrationOptions {
77
78
  }
78
79
  //#endregion
79
80
  export { WorkflowSnapshotCodec as a, EngineWorkflowRunnerService as i, TriggerRuntimeDiagnosticsProvider as n, WebhookTriggerMatcherProvider as r, EngineRuntimeRegistrationOptions as t };
80
- //# sourceMappingURL=EngineRuntimeRegistration.types-MPYWsEM0.d.cts.map
81
+ //# sourceMappingURL=EngineRuntimeRegistration.types-DTV5_7Jw.d.cts.map
@@ -1,4 +1,4 @@
1
- import { $i as WebhookTriggerRoutingDiagnostics, Ii as TriggerRuntimeDiagnostics, Lr as WorkflowPolicyRuntimeDefaults, Nn as EngineExecutionLimitsPolicyConfig, Zi as WebhookTriggerMatcher, mn as DependencyContainer } from "./RunIntentService-BrEq6Jm6.js";
1
+ import { Cn as DependencyContainer, Hn as EngineExecutionLimitsPolicyConfig, Kr as WorkflowPolicyRuntimeDefaults, Qi as TriggerRuntimeDiagnostics, ha as WebhookTriggerRoutingDiagnostics, pa as WebhookTriggerMatcher } from "./index-CSKKuK60.js";
2
2
 
3
3
  //#region src/bootstrap/runtime/EngineRuntimeRegistration.types.d.ts
4
4
 
@@ -41,4 +41,4 @@ interface EngineRuntimeRegistrationOptions {
41
41
  }
42
42
  //#endregion
43
43
  export { TriggerRuntimeDiagnosticsProvider as n, WebhookTriggerMatcherProvider as r, EngineRuntimeRegistrationOptions as t };
44
- //# sourceMappingURL=EngineRuntimeRegistration.types-BZ_1XWAJ.d.ts.map
44
+ //# sourceMappingURL=EngineRuntimeRegistration.types-Dl92Hdoi.d.ts.map
@@ -0,0 +1,202 @@
1
+ import { $t as RunnableNodeConfig, An as BinaryBody, At as JsonValue, Bn as ExecutionBinaryService, Br as ExecutionTelemetryFactory, Ct as Item, Fn as BinaryStorageWriteResult, Hn as ExecutionContextFactory, Jt as PersistedRunPolicySnapshot, Ki as NodeId, Kn as HumanTaskSubject, Mn as BinaryStorageReadResult, Mt as NodeActivationId, Ni as CredentialSessionService, Nn as BinaryStorageStatResult, On as RetryPolicySpec, R as RunTestContext, Un as HumanTaskActor, Ut as NodeOutputs, Vn as ExecutionContext, Xt as RunDataSnapshot, Y as TypeToken, Yi as WorkflowId, Yt as RunDataFactory, Zt as RunId, cr as NodeResolver, jn as BinaryStorage, jt as MutableRunData, mi as CollectionsContext, nr as NodeExecutionContext, or as NodeExecutionStatePublisher, qt as ParentExecutionRef, tr as NodeBinaryAttachmentService, ui as CostTrackingTelemetryFactory, yt as BinaryAttachment } from "./agentMcpTypes-DUmniLOY.cjs";
2
+
3
+ //#region src/execution/CredentialResolverFactory.d.ts
4
+ declare class CredentialResolverFactory {
5
+ private readonly credentialSessions;
6
+ constructor(credentialSessions: CredentialSessionService);
7
+ create(workflowId: WorkflowId, nodeId: NodeId, config?: NodeExecutionContext["config"]): NodeExecutionContext["getCredential"];
8
+ }
9
+ //#endregion
10
+ //#region src/contracts/humanTaskStoreTypes.d.ts
11
+ type HumanTaskStatus = "pending" | "decided" | "timed_out" | "auto_accepted" | "cancelled";
12
+ /** Persisted record for a single HITL task instance. */
13
+ interface HumanTaskRecord {
14
+ readonly id: string;
15
+ readonly runId: string;
16
+ readonly workflowId: string;
17
+ readonly workspaceId?: string;
18
+ readonly nodeId: string;
19
+ readonly activationId: string;
20
+ readonly itemIndex: number;
21
+ readonly status: HumanTaskStatus;
22
+ readonly channel: string;
23
+ readonly subject: HumanTaskSubject;
24
+ readonly metadata: Record<string, JsonValue>;
25
+ readonly decisionSchemaJson: string;
26
+ readonly decisionSchemaHash: string;
27
+ readonly onTimeout: "halt" | "auto-accept";
28
+ readonly deliveryRef?: JsonValue;
29
+ readonly decision?: JsonValue;
30
+ readonly decidedAt?: Date;
31
+ readonly decidedBy?: HumanTaskActor;
32
+ readonly resumeTokenHash: string;
33
+ readonly expiresAt: Date;
34
+ readonly createdAt: Date;
35
+ }
36
+ interface HumanTaskStore {
37
+ create(record: HumanTaskRecord): Promise<void>;
38
+ findById(taskId: string): Promise<HumanTaskRecord | undefined>;
39
+ findByResumeTokenHash(tokenHash: string): Promise<HumanTaskRecord | undefined>;
40
+ findPendingForWorkspace(workspaceId: string): Promise<ReadonlyArray<HumanTaskRecord>>;
41
+ /** Returns all pending tasks regardless of workspace. Used by the local dev inbox (non-managed mode). */
42
+ findAllPending(): Promise<ReadonlyArray<HumanTaskRecord>>;
43
+ markDecided(args: {
44
+ taskId: string;
45
+ decision: JsonValue;
46
+ decidedBy: HumanTaskActor;
47
+ decidedAt: Date;
48
+ }): Promise<void>;
49
+ markTimedOut(taskId: string): Promise<void>;
50
+ markAutoAccepted(taskId: string): Promise<void>;
51
+ markCancelled(taskId: string): Promise<void>;
52
+ cancelPendingForRun(runId: string): Promise<void>;
53
+ }
54
+ declare const HumanTaskStoreToken: TypeToken<HumanTaskStore | undefined>;
55
+ //#endregion
56
+ //#region src/contracts/hitlSeamTypes.d.ts
57
+ /**
58
+ * Seam interfaces for HITL collaborators that are implemented in `@codemation/host`
59
+ * and injected into `NodeSuspensionHandler` at runtime. Core defines the interface only —
60
+ * no HTTP, vendor SDK, or Prisma dependencies here.
61
+ */
62
+ /** Signs and hashes a HITL resume token. Core only needs the sign and hash operations. */
63
+ interface HitlResumeTokenSignerSeam {
64
+ sign(args: {
65
+ taskId: string;
66
+ expiresAt: Date;
67
+ schemaHash: string;
68
+ }): string;
69
+ hashToken(token: string): string;
70
+ }
71
+ /** Schedules a delayed BullMQ job that drives the timeout path. */
72
+ interface HitlTimeoutJobSchedulerSeam {
73
+ enqueueTimeoutJob(args: {
74
+ taskId: string;
75
+ expiresAt: Date;
76
+ }): Promise<void>;
77
+ }
78
+ declare const HitlResumeTokenSignerToken: TypeToken<HitlResumeTokenSignerSeam | undefined>;
79
+ declare const HitlTimeoutJobSchedulerToken: TypeToken<HitlTimeoutJobSchedulerSeam | undefined>;
80
+ /**
81
+ * Optional workspace ID injected into NodeSuspensionHandler in managed mode (T7 security fix).
82
+ * Allows the handler to stamp the workspaceId on each HumanTaskRecord so HitlCallbackHandler
83
+ * can assert workspace identity independently of the HMAC middleware.
84
+ * Not registered in non-managed mode; NodeSuspensionHandler defaults to null.
85
+ */
86
+ declare const HitlWorkspaceIdToken: TypeToken<string | undefined>;
87
+ //#endregion
88
+ //#region src/binaries/UnavailableBinaryStorage.d.ts
89
+ declare class UnavailableBinaryStorage implements BinaryStorage {
90
+ readonly driverName = "unavailable";
91
+ write(): Promise<never>;
92
+ openReadStream(): Promise<undefined>;
93
+ stat(): Promise<{
94
+ exists: false;
95
+ }>;
96
+ delete(): Promise<void>;
97
+ deleteMany(): Promise<void>;
98
+ listByPrefix(): Promise<ReadonlyArray<string>>;
99
+ }
100
+ //#endregion
101
+ //#region src/binaries/DefaultExecutionBinaryServiceFactory.d.ts
102
+ declare class DefaultExecutionBinaryService implements ExecutionBinaryService {
103
+ private readonly storage;
104
+ private readonly workflowId;
105
+ private readonly runId;
106
+ private readonly now;
107
+ constructor(storage: BinaryStorage, workflowId: WorkflowId, runId: RunId, now: () => Date);
108
+ forNode(args: {
109
+ nodeId: NodeId;
110
+ activationId: NodeActivationId;
111
+ }): NodeBinaryAttachmentService;
112
+ openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
113
+ }
114
+ //#endregion
115
+ //#region src/execution/asyncSleeper.types.d.ts
116
+ interface AsyncSleeper {
117
+ sleep(ms: number): Promise<void>;
118
+ }
119
+ //#endregion
120
+ //#region src/execution/DefaultAsyncSleeper.d.ts
121
+ declare class DefaultAsyncSleeper implements AsyncSleeper {
122
+ sleep(ms: number): Promise<void>;
123
+ }
124
+ //#endregion
125
+ //#region src/execution/DefaultExecutionContextFactory.d.ts
126
+ declare class DefaultExecutionContextFactory implements ExecutionContextFactory {
127
+ private readonly binaryStorage;
128
+ private readonly telemetryFactory;
129
+ private readonly costTrackingFactory;
130
+ private readonly currentDate;
131
+ private readonly collections?;
132
+ private readonly nodeResolver?;
133
+ private readonly telemetryDecoratorFactory;
134
+ constructor(binaryStorage?: BinaryStorage, telemetryFactory?: ExecutionTelemetryFactory, costTrackingFactory?: CostTrackingTelemetryFactory, currentDate?: () => Date, collections?: CollectionsContext | undefined, nodeResolver?: NodeResolver | undefined);
135
+ create(args: {
136
+ runId: RunId;
137
+ workflowId: WorkflowId;
138
+ parent?: ParentExecutionRef;
139
+ policySnapshot?: PersistedRunPolicySnapshot;
140
+ subworkflowDepth: number;
141
+ engineMaxNodeActivations: number;
142
+ engineMaxSubworkflowDepth: number;
143
+ data: RunDataSnapshot;
144
+ nodeState?: NodeExecutionStatePublisher;
145
+ telemetry?: ExecutionContext["telemetry"];
146
+ getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
147
+ testContext?: RunTestContext;
148
+ }): ExecutionContext;
149
+ }
150
+ //#endregion
151
+ //#region src/execution/InProcessRetryRunner.d.ts
152
+ declare class InProcessRetryRunner {
153
+ private readonly sleeper;
154
+ constructor(sleeper: AsyncSleeper);
155
+ run<T>(policy: RetryPolicySpec | undefined, work: () => Promise<T>, shouldRetry?: (error: unknown) => boolean, warn?: (message: string) => void): Promise<T>;
156
+ private static delayAfterFailureMs;
157
+ private static normalizePolicy;
158
+ private static clampMaxAttempts;
159
+ private static assertPositiveInt;
160
+ private static assertNonNegativeFinite;
161
+ private static assertMultiplier;
162
+ }
163
+ //#endregion
164
+ //#region src/execution/ItemExprResolver.d.ts
165
+ /**
166
+ * Resolves {@link import("../contracts/itemExpr").ItemExpr} leaves on runnable config before {@link RunnableNode.execute}.
167
+ */
168
+ declare class ItemExprResolver {
169
+ resolveConfigForItem<TConfig extends RunnableNodeConfig<any, any>>(ctx: NodeExecutionContext<TConfig>, item: Item, itemIndex: number, items: ReadonlyArray<Item>): Promise<NodeExecutionContext<TConfig>>;
170
+ }
171
+ //#endregion
172
+ //#region src/execution/RunnableOutputBehaviorResolver.d.ts
173
+ type RunnableOutputBehavior = Readonly<{
174
+ keepBinaries: boolean;
175
+ }>;
176
+ declare class RunnableOutputBehaviorResolver {
177
+ resolve(config: RunnableNodeConfig): RunnableOutputBehavior;
178
+ private isKeepBinariesEnabled;
179
+ }
180
+ //#endregion
181
+ //#region src/runStorage/InMemoryBinaryStorageRegistry.d.ts
182
+ declare class InMemoryBinaryStorage implements BinaryStorage {
183
+ readonly driverName = "memory";
184
+ private readonly values;
185
+ write(args: {
186
+ storageKey: string;
187
+ body: BinaryBody;
188
+ }): Promise<BinaryStorageWriteResult>;
189
+ openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
190
+ stat(storageKey: string): Promise<BinaryStorageStatResult>;
191
+ delete(storageKey: string): Promise<void>;
192
+ deleteMany(storageKeys: ReadonlyArray<string>): Promise<void>;
193
+ listByPrefix(prefix: string): Promise<ReadonlyArray<string>>;
194
+ }
195
+ //#endregion
196
+ //#region src/runStorage/InMemoryRunDataFactory.d.ts
197
+ declare class InMemoryRunDataFactory implements RunDataFactory {
198
+ create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
199
+ }
200
+ //#endregion
201
+ export { HumanTaskRecord as _, ItemExprResolver as a, HumanTaskStoreToken as b, DefaultAsyncSleeper as c, UnavailableBinaryStorage as d, HitlResumeTokenSignerSeam as f, HitlWorkspaceIdToken as g, HitlTimeoutJobSchedulerToken as h, RunnableOutputBehaviorResolver as i, AsyncSleeper as l, HitlTimeoutJobSchedulerSeam as m, InMemoryBinaryStorage as n, InProcessRetryRunner as o, HitlResumeTokenSignerToken as p, RunnableOutputBehavior as r, DefaultExecutionContextFactory as s, InMemoryRunDataFactory as t, DefaultExecutionBinaryService as u, HumanTaskStatus as v, CredentialResolverFactory as x, HumanTaskStore as y };
202
+ //# sourceMappingURL=InMemoryRunDataFactory-qMiYjhCK.d.cts.map
@@ -38,4 +38,4 @@ var InMemoryRunEventBus = class {
38
38
 
39
39
  //#endregion
40
40
  export { InMemoryRunEventBus as t };
41
- //# sourceMappingURL=InMemoryRunEventBusRegistry-sM4z4n_i.js.map
41
+ //# sourceMappingURL=InMemoryRunEventBusRegistry-Bwunvt1T.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InMemoryRunEventBusRegistry-sM4z4n_i.js","names":["onClose: () => void"],"sources":["../src/events/InMemoryRunEventSubscription.ts","../src/events/InMemoryRunEventBusRegistry.ts"],"sourcesContent":["import type { RunEventSubscription } from \"./runEvents\";\n\nexport class InMemoryRunEventSubscription implements RunEventSubscription {\n constructor(private readonly onClose: () => void) {}\n\n async close(): Promise<void> {\n this.onClose();\n }\n}\n","import type { WorkflowId } from \"../types\";\n\nimport type { RunEvent, RunEventBus, RunEventSubscription } from \"./runEvents\";\n\nimport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n\nexport class InMemoryRunEventBus implements RunEventBus {\n private readonly globalListeners = new Set<(event: RunEvent) => void>();\n private readonly listenersByWorkflowId = new Map<WorkflowId, Set<(event: RunEvent) => void>>();\n\n async publish(event: RunEvent): Promise<void> {\n for (const listener of this.globalListeners) listener(event);\n for (const listener of this.listenersByWorkflowId.get(event.workflowId) ?? []) listener(event);\n }\n\n async subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n this.globalListeners.add(onEvent);\n return new InMemoryRunEventSubscription(() => {\n this.globalListeners.delete(onEvent);\n });\n }\n\n async subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n const existing = this.listenersByWorkflowId.get(workflowId) ?? new Set<(event: RunEvent) => void>();\n existing.add(onEvent);\n this.listenersByWorkflowId.set(workflowId, existing);\n\n return new InMemoryRunEventSubscription(() => {\n const listeners = this.listenersByWorkflowId.get(workflowId);\n if (!listeners) return;\n listeners.delete(onEvent);\n if (listeners.size === 0) this.listenersByWorkflowId.delete(workflowId);\n });\n }\n}\n\nexport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n"],"mappings":";AAEA,IAAa,+BAAb,MAA0E;CACxE,YAAY,AAAiBA,SAAqB;EAArB;;CAE7B,MAAM,QAAuB;AAC3B,OAAK,SAAS;;;;;;ACAlB,IAAa,sBAAb,MAAwD;CACtD,AAAiB,kCAAkB,IAAI,KAAgC;CACvE,AAAiB,wCAAwB,IAAI,KAAiD;CAE9F,MAAM,QAAQ,OAAgC;AAC5C,OAAK,MAAM,YAAY,KAAK,gBAAiB,UAAS,MAAM;AAC5D,OAAK,MAAM,YAAY,KAAK,sBAAsB,IAAI,MAAM,WAAW,IAAI,EAAE,CAAE,UAAS,MAAM;;CAGhG,MAAM,UAAU,SAAmE;AACjF,OAAK,gBAAgB,IAAI,QAAQ;AACjC,SAAO,IAAI,mCAAmC;AAC5C,QAAK,gBAAgB,OAAO,QAAQ;IACpC;;CAGJ,MAAM,oBAAoB,YAAwB,SAAmE;EACnH,MAAM,WAAW,KAAK,sBAAsB,IAAI,WAAW,oBAAI,IAAI,KAAgC;AACnG,WAAS,IAAI,QAAQ;AACrB,OAAK,sBAAsB,IAAI,YAAY,SAAS;AAEpD,SAAO,IAAI,mCAAmC;GAC5C,MAAM,YAAY,KAAK,sBAAsB,IAAI,WAAW;AAC5D,OAAI,CAAC,UAAW;AAChB,aAAU,OAAO,QAAQ;AACzB,OAAI,UAAU,SAAS,EAAG,MAAK,sBAAsB,OAAO,WAAW;IACvE"}
1
+ {"version":3,"file":"InMemoryRunEventBusRegistry-Bwunvt1T.js","names":["onClose: () => void"],"sources":["../src/events/InMemoryRunEventSubscription.ts","../src/events/InMemoryRunEventBusRegistry.ts"],"sourcesContent":["import type { RunEventSubscription } from \"./runEvents\";\n\nexport class InMemoryRunEventSubscription implements RunEventSubscription {\n constructor(private readonly onClose: () => void) {}\n\n async close(): Promise<void> {\n this.onClose();\n }\n}\n","import type { WorkflowId } from \"../types\";\n\nimport type { RunEvent, RunEventBus, RunEventSubscription } from \"./runEvents\";\n\nimport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n\nexport class InMemoryRunEventBus implements RunEventBus {\n private readonly globalListeners = new Set<(event: RunEvent) => void>();\n private readonly listenersByWorkflowId = new Map<WorkflowId, Set<(event: RunEvent) => void>>();\n\n async publish(event: RunEvent): Promise<void> {\n for (const listener of this.globalListeners) listener(event);\n for (const listener of this.listenersByWorkflowId.get(event.workflowId) ?? []) listener(event);\n }\n\n async subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n this.globalListeners.add(onEvent);\n return new InMemoryRunEventSubscription(() => {\n this.globalListeners.delete(onEvent);\n });\n }\n\n async subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n const existing = this.listenersByWorkflowId.get(workflowId) ?? new Set<(event: RunEvent) => void>();\n existing.add(onEvent);\n this.listenersByWorkflowId.set(workflowId, existing);\n\n return new InMemoryRunEventSubscription(() => {\n const listeners = this.listenersByWorkflowId.get(workflowId);\n if (!listeners) return;\n listeners.delete(onEvent);\n if (listeners.size === 0) this.listenersByWorkflowId.delete(workflowId);\n });\n }\n}\n\nexport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n"],"mappings":";AAEA,IAAa,+BAAb,MAA0E;CACxE,YAAY,AAAiBA,SAAqB;EAArB;;CAE7B,MAAM,QAAuB;AAC3B,OAAK,SAAS;;;;;;ACAlB,IAAa,sBAAb,MAAwD;CACtD,AAAiB,kCAAkB,IAAI,KAAgC;CACvE,AAAiB,wCAAwB,IAAI,KAAiD;CAE9F,MAAM,QAAQ,OAAgC;AAC5C,OAAK,MAAM,YAAY,KAAK,gBAAiB,UAAS,MAAM;AAC5D,OAAK,MAAM,YAAY,KAAK,sBAAsB,IAAI,MAAM,WAAW,IAAI,EAAE,CAAE,UAAS,MAAM;;CAGhG,MAAM,UAAU,SAAmE;AACjF,OAAK,gBAAgB,IAAI,QAAQ;AACjC,SAAO,IAAI,mCAAmC;AAC5C,QAAK,gBAAgB,OAAO,QAAQ;IACpC;;CAGJ,MAAM,oBAAoB,YAAwB,SAAmE;EACnH,MAAM,WAAW,KAAK,sBAAsB,IAAI,WAAW,oBAAI,IAAI,KAAgC;AACnG,WAAS,IAAI,QAAQ;AACrB,OAAK,sBAAsB,IAAI,YAAY,SAAS;AAEpD,SAAO,IAAI,mCAAmC;GAC5C,MAAM,YAAY,KAAK,sBAAsB,IAAI,WAAW;AAC5D,OAAI,CAAC,UAAW;AAChB,aAAU,OAAO,QAAQ;AACzB,OAAI,UAAU,SAAS,EAAG,MAAK,sBAAsB,OAAO,WAAW;IACvE"}
@@ -44,4 +44,4 @@ Object.defineProperty(exports, 'InMemoryRunEventBus', {
44
44
  return InMemoryRunEventBus;
45
45
  }
46
46
  });
47
- //# sourceMappingURL=InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map
47
+ //# sourceMappingURL=InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"InMemoryRunEventBusRegistry-VM3OWnHo.cjs","names":["onClose: () => void"],"sources":["../src/events/InMemoryRunEventSubscription.ts","../src/events/InMemoryRunEventBusRegistry.ts"],"sourcesContent":["import type { RunEventSubscription } from \"./runEvents\";\n\nexport class InMemoryRunEventSubscription implements RunEventSubscription {\n constructor(private readonly onClose: () => void) {}\n\n async close(): Promise<void> {\n this.onClose();\n }\n}\n","import type { WorkflowId } from \"../types\";\n\nimport type { RunEvent, RunEventBus, RunEventSubscription } from \"./runEvents\";\n\nimport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n\nexport class InMemoryRunEventBus implements RunEventBus {\n private readonly globalListeners = new Set<(event: RunEvent) => void>();\n private readonly listenersByWorkflowId = new Map<WorkflowId, Set<(event: RunEvent) => void>>();\n\n async publish(event: RunEvent): Promise<void> {\n for (const listener of this.globalListeners) listener(event);\n for (const listener of this.listenersByWorkflowId.get(event.workflowId) ?? []) listener(event);\n }\n\n async subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n this.globalListeners.add(onEvent);\n return new InMemoryRunEventSubscription(() => {\n this.globalListeners.delete(onEvent);\n });\n }\n\n async subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n const existing = this.listenersByWorkflowId.get(workflowId) ?? new Set<(event: RunEvent) => void>();\n existing.add(onEvent);\n this.listenersByWorkflowId.set(workflowId, existing);\n\n return new InMemoryRunEventSubscription(() => {\n const listeners = this.listenersByWorkflowId.get(workflowId);\n if (!listeners) return;\n listeners.delete(onEvent);\n if (listeners.size === 0) this.listenersByWorkflowId.delete(workflowId);\n });\n }\n}\n\nexport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n"],"mappings":";;AAEA,IAAa,+BAAb,MAA0E;CACxE,YAAY,AAAiBA,SAAqB;EAArB;;CAE7B,MAAM,QAAuB;AAC3B,OAAK,SAAS;;;;;;ACAlB,IAAa,sBAAb,MAAwD;CACtD,AAAiB,kCAAkB,IAAI,KAAgC;CACvE,AAAiB,wCAAwB,IAAI,KAAiD;CAE9F,MAAM,QAAQ,OAAgC;AAC5C,OAAK,MAAM,YAAY,KAAK,gBAAiB,UAAS,MAAM;AAC5D,OAAK,MAAM,YAAY,KAAK,sBAAsB,IAAI,MAAM,WAAW,IAAI,EAAE,CAAE,UAAS,MAAM;;CAGhG,MAAM,UAAU,SAAmE;AACjF,OAAK,gBAAgB,IAAI,QAAQ;AACjC,SAAO,IAAI,mCAAmC;AAC5C,QAAK,gBAAgB,OAAO,QAAQ;IACpC;;CAGJ,MAAM,oBAAoB,YAAwB,SAAmE;EACnH,MAAM,WAAW,KAAK,sBAAsB,IAAI,WAAW,oBAAI,IAAI,KAAgC;AACnG,WAAS,IAAI,QAAQ;AACrB,OAAK,sBAAsB,IAAI,YAAY,SAAS;AAEpD,SAAO,IAAI,mCAAmC;GAC5C,MAAM,YAAY,KAAK,sBAAsB,IAAI,WAAW;AAC5D,OAAI,CAAC,UAAW;AAChB,aAAU,OAAO,QAAQ;AACzB,OAAI,UAAU,SAAS,EAAG,MAAK,sBAAsB,OAAO,WAAW;IACvE"}
1
+ {"version":3,"file":"InMemoryRunEventBusRegistry-Sa86VxuV.cjs","names":["onClose: () => void"],"sources":["../src/events/InMemoryRunEventSubscription.ts","../src/events/InMemoryRunEventBusRegistry.ts"],"sourcesContent":["import type { RunEventSubscription } from \"./runEvents\";\n\nexport class InMemoryRunEventSubscription implements RunEventSubscription {\n constructor(private readonly onClose: () => void) {}\n\n async close(): Promise<void> {\n this.onClose();\n }\n}\n","import type { WorkflowId } from \"../types\";\n\nimport type { RunEvent, RunEventBus, RunEventSubscription } from \"./runEvents\";\n\nimport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n\nexport class InMemoryRunEventBus implements RunEventBus {\n private readonly globalListeners = new Set<(event: RunEvent) => void>();\n private readonly listenersByWorkflowId = new Map<WorkflowId, Set<(event: RunEvent) => void>>();\n\n async publish(event: RunEvent): Promise<void> {\n for (const listener of this.globalListeners) listener(event);\n for (const listener of this.listenersByWorkflowId.get(event.workflowId) ?? []) listener(event);\n }\n\n async subscribe(onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n this.globalListeners.add(onEvent);\n return new InMemoryRunEventSubscription(() => {\n this.globalListeners.delete(onEvent);\n });\n }\n\n async subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise<RunEventSubscription> {\n const existing = this.listenersByWorkflowId.get(workflowId) ?? new Set<(event: RunEvent) => void>();\n existing.add(onEvent);\n this.listenersByWorkflowId.set(workflowId, existing);\n\n return new InMemoryRunEventSubscription(() => {\n const listeners = this.listenersByWorkflowId.get(workflowId);\n if (!listeners) return;\n listeners.delete(onEvent);\n if (listeners.size === 0) this.listenersByWorkflowId.delete(workflowId);\n });\n }\n}\n\nexport { InMemoryRunEventSubscription } from \"./InMemoryRunEventSubscription\";\n"],"mappings":";;AAEA,IAAa,+BAAb,MAA0E;CACxE,YAAY,AAAiBA,SAAqB;EAArB;;CAE7B,MAAM,QAAuB;AAC3B,OAAK,SAAS;;;;;;ACAlB,IAAa,sBAAb,MAAwD;CACtD,AAAiB,kCAAkB,IAAI,KAAgC;CACvE,AAAiB,wCAAwB,IAAI,KAAiD;CAE9F,MAAM,QAAQ,OAAgC;AAC5C,OAAK,MAAM,YAAY,KAAK,gBAAiB,UAAS,MAAM;AAC5D,OAAK,MAAM,YAAY,KAAK,sBAAsB,IAAI,MAAM,WAAW,IAAI,EAAE,CAAE,UAAS,MAAM;;CAGhG,MAAM,UAAU,SAAmE;AACjF,OAAK,gBAAgB,IAAI,QAAQ;AACjC,SAAO,IAAI,mCAAmC;AAC5C,QAAK,gBAAgB,OAAO,QAAQ;IACpC;;CAGJ,MAAM,oBAAoB,YAAwB,SAAmE;EACnH,MAAM,WAAW,KAAK,sBAAsB,IAAI,WAAW,oBAAI,IAAI,KAAgC;AACnG,WAAS,IAAI,QAAQ;AACrB,OAAK,sBAAsB,IAAI,YAAY,SAAS;AAEpD,SAAO,IAAI,mCAAmC;GAC5C,MAAM,YAAY,KAAK,sBAAsB,IAAI,WAAW;AAC5D,OAAI,CAAC,UAAW;AAChB,aAAU,OAAO,QAAQ;AACzB,OAAI,UAAU,SAAS,EAAG,MAAK,sBAAsB,OAAO,WAAW;IACvE"}
@@ -0,0 +1,36 @@
1
+ import { a as injectable } from "./di-DdsgWfVy.js";
2
+
3
+ //#region \0@oxc-project+runtime@0.95.0/helpers/decorate.js
4
+ function __decorate(decorators, target, key, desc) {
5
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
7
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
8
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
9
+ }
10
+
11
+ //#endregion
12
+ //#region src/serialization/ItemsInputNormalizer.ts
13
+ let ItemsInputNormalizer = class ItemsInputNormalizer$1 {
14
+ normalize(raw) {
15
+ if (raw === void 0 || raw === null) return [];
16
+ if (Array.isArray(raw)) return raw.map((value) => this.normalizeItem(value));
17
+ return [this.normalizeItem(raw)];
18
+ }
19
+ normalizeItem(raw) {
20
+ if (!this.isItem(raw)) return { json: raw };
21
+ return {
22
+ json: raw.json,
23
+ ...raw.binary === void 0 ? {} : { binary: raw.binary },
24
+ ...raw.meta === void 0 ? {} : { meta: raw.meta },
25
+ ...raw.paired === void 0 ? {} : { paired: raw.paired }
26
+ };
27
+ }
28
+ isItem(raw) {
29
+ return typeof raw === "object" && raw !== null && Object.prototype.hasOwnProperty.call(raw, "json");
30
+ }
31
+ };
32
+ ItemsInputNormalizer = __decorate([injectable()], ItemsInputNormalizer);
33
+
34
+ //#endregion
35
+ export { ItemsInputNormalizer as t };
36
+ //# sourceMappingURL=ItemsInputNormalizer-BhuxvZh5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ItemsInputNormalizer-BhuxvZh5.js","names":["ItemsInputNormalizer"],"sources":["../src/serialization/ItemsInputNormalizer.ts"],"sourcesContent":["import type { Item, Items } from \"../contracts/workflowTypes\";\nimport { injectable } from \"../di\";\n\n/**\n * Normalizes external inputs into the engine's canonical `Items` shape.\n * Used at host and builder boundaries where callers may provide either a raw value,\n * a single item-like object, or an array of item-like values.\n */\n@injectable()\nexport class ItemsInputNormalizer {\n normalize(raw: unknown): Items {\n if (raw === undefined || raw === null) {\n return [];\n }\n if (Array.isArray(raw)) {\n return raw.map((value) => this.normalizeItem(value));\n }\n return [this.normalizeItem(raw)];\n }\n\n private normalizeItem(raw: unknown): Item {\n if (!this.isItem(raw)) {\n return { json: raw };\n }\n return {\n json: raw.json,\n ...(raw.binary === undefined ? {} : { binary: raw.binary }),\n ...(raw.meta === undefined ? {} : { meta: raw.meta }),\n ...(raw.paired === undefined ? {} : { paired: raw.paired }),\n };\n }\n\n private isItem(raw: unknown): raw is Item {\n return typeof raw === \"object\" && raw !== null && Object.prototype.hasOwnProperty.call(raw, \"json\");\n }\n}\n"],"mappings":";;;;;;;;;;;;AASO,iCAAMA,uBAAqB;CAChC,UAAU,KAAqB;AAC7B,MAAI,QAAQ,UAAa,QAAQ,KAC/B,QAAO,EAAE;AAEX,MAAI,MAAM,QAAQ,IAAI,CACpB,QAAO,IAAI,KAAK,UAAU,KAAK,cAAc,MAAM,CAAC;AAEtD,SAAO,CAAC,KAAK,cAAc,IAAI,CAAC;;CAGlC,AAAQ,cAAc,KAAoB;AACxC,MAAI,CAAC,KAAK,OAAO,IAAI,CACnB,QAAO,EAAE,MAAM,KAAK;AAEtB,SAAO;GACL,MAAM,IAAI;GACV,GAAI,IAAI,WAAW,SAAY,EAAE,GAAG,EAAE,QAAQ,IAAI,QAAQ;GAC1D,GAAI,IAAI,SAAS,SAAY,EAAE,GAAG,EAAE,MAAM,IAAI,MAAM;GACpD,GAAI,IAAI,WAAW,SAAY,EAAE,GAAG,EAAE,QAAQ,IAAI,QAAQ;GAC3D;;CAGH,AAAQ,OAAO,KAA2B;AACxC,SAAO,OAAO,QAAQ,YAAY,QAAQ,QAAQ,OAAO,UAAU,eAAe,KAAK,KAAK,OAAO;;;mCAzBtG,YAAY"}