@codemation/core 0.0.18 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/EngineRuntimeRegistration.types-0sgV2XL2.d.ts +42 -0
- package/dist/EngineWorkflowRunnerService-Dx7bJsJR.d.cts +73 -0
- package/dist/InMemoryRunDataFactory-qIYQEar7.d.cts +94 -0
- package/dist/{InMemoryLiveWorkflowRepository-DxoualoC.d.ts → RunIntentService-BCvGdOSY.d.ts} +438 -9
- package/dist/{RunIntentService-BB4nqX3-.js → RunIntentService-BFA48UpH.js} +308 -71
- package/dist/RunIntentService-BFA48UpH.js.map +1 -0
- package/dist/{InMemoryLiveWorkflowRepository-orY1VsWG.d.cts → RunIntentService-CV8izV8t.d.cts} +214 -7
- package/dist/{RunIntentService-nRx-m0Xs.cjs → RunIntentService-DcxXf_AM.cjs} +318 -69
- package/dist/RunIntentService-DcxXf_AM.cjs.map +1 -0
- package/dist/bootstrap/index.cjs +14 -1135
- package/dist/bootstrap/index.d.cts +7 -60
- package/dist/bootstrap/index.d.ts +4 -40
- package/dist/bootstrap/index.js +3 -1122
- package/dist/bootstrap-D67Sf2BF.js +1136 -0
- package/dist/bootstrap-D67Sf2BF.js.map +1 -0
- package/dist/bootstrap-DoQHAEQJ.cjs +1203 -0
- package/dist/bootstrap-DoQHAEQJ.cjs.map +1 -0
- package/dist/{index-B4_ZRTyI.d.ts → index-BHmrZIHp.d.ts} +32 -251
- package/dist/index.cjs +98 -223
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +196 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +92 -218
- package/dist/index.js.map +1 -1
- package/dist/testing.cjs +329 -3
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +181 -4
- package/dist/testing.d.ts +181 -3
- package/dist/testing.js +319 -2
- package/dist/testing.js.map +1 -1
- package/dist/workflowActivationPolicy-B8HzTk3o.js +201 -0
- package/dist/workflowActivationPolicy-B8HzTk3o.js.map +1 -0
- package/dist/workflowActivationPolicy-BzyzXLa_.cjs +231 -0
- package/dist/workflowActivationPolicy-BzyzXLa_.cjs.map +1 -0
- package/package.json +1 -1
- package/src/ai/AgentConnectionNodeCollector.ts +99 -0
- package/src/ai/AgentToolFactory.ts +38 -2
- package/src/ai/AiHost.ts +1 -1
- package/src/browser.ts +11 -0
- package/src/contracts/executionPersistenceContracts.ts +186 -0
- package/src/contracts/index.ts +1 -0
- package/src/contracts/runFinishedAtFactory.ts +5 -2
- package/src/contracts/runTypes.ts +10 -0
- package/src/contracts/runtimeTypes.ts +6 -2
- package/src/contracts/workflowTypes.ts +3 -2
- package/src/events/EventPublishingWorkflowExecutionRepository.ts +5 -0
- package/src/execution/ActivationEnqueueService.ts +8 -8
- package/src/execution/PersistedRunStateTerminalBuilder.ts +3 -0
- package/src/index.ts +6 -0
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +11 -6
- package/src/orchestration/RunContinuationService.ts +94 -24
- package/src/planning/CurrentStateFrontierPlanner.ts +24 -1
- package/src/runStorage/InMemoryWorkflowExecutionRepository.ts +14 -1
- package/src/runtime/RunIntentService.ts +68 -14
- package/src/scheduler/DefaultDrivingScheduler.ts +21 -11
- package/src/scheduler/InlineDrivingScheduler.ts +17 -21
- package/src/testing/CapturingScheduler.ts +15 -0
- package/src/testing/EngineTestKitRunIdFactory.ts +24 -0
- package/src/testing/InMemoryTriggerSetupStateRepository.ts +21 -0
- package/src/testing/PrefixedSequentialIdGenerator.ts +17 -0
- package/src/testing/RegistrarEngineTestKit.types.ts +76 -0
- package/src/testing/RegistrarEngineTestKitFactory.ts +154 -0
- package/src/testing/SubWorkflowRunnerTestNode.ts +83 -0
- package/src/testing/WorkflowTestHarnessManualTrigger.ts +39 -0
- package/src/testing/WorkflowTestKit.types.ts +9 -0
- package/src/testing/WorkflowTestKitBuilder.ts +77 -0
- package/src/testing/WorkflowTestKitNodeRegistrationContextFactory.ts +17 -0
- package/src/testing/WorkflowTestKitRunNodeWorkflowFactory.ts +26 -0
- package/src/testing.ts +19 -0
- package/src/types/index.ts +1 -0
- package/src/workflow/definition/ConnectionNodeIdFactory.ts +28 -0
- package/dist/InMemoryLiveWorkflowRepository-BTzHpQ6e.cjs +0 -151
- package/dist/InMemoryLiveWorkflowRepository-BTzHpQ6e.cjs.map +0 -1
- package/dist/InMemoryLiveWorkflowRepository-BoLNnVLg.js +0 -139
- package/dist/InMemoryLiveWorkflowRepository-BoLNnVLg.js.map +0 -1
- package/dist/RunIntentService-BB4nqX3-.js.map +0 -1
- package/dist/RunIntentService-ByuUYsAL.d.cts +0 -279
- package/dist/RunIntentService-nRx-m0Xs.cjs.map +0 -1
- package/dist/WorkflowSnapshotCodec-DSEzKyt3.d.cts +0 -22
- package/dist/bootstrap/index.cjs.map +0 -1
- package/dist/bootstrap/index.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
1
|
+
import { $n as PersistedWorkflowSnapshotNode, An as WebhookInvocationMatch, Bn as EngineRunCounters, Cr as TypeToken, Ct as WorkflowId, Dn as HttpMethod, Dt as WorkflowStoragePolicyDecisionArgs, Fn as WorkflowActivationPolicy, Fr as ENGINE_EXECUTION_LIMITS_DEFAULTS, G as NodeDefinition, Ir as EngineExecutionLimitsPolicy, J as NodeErrorHandlerSpec, K as NodeErrorHandler, Lr as EngineExecutionLimitsPolicyConfig, M as ExecutionMode, Nn as WebhookTriggerRoutingDiagnostics, Q as NodeOutputs, Qt as NodeActivationContinuation, Sn as WorkflowRepository, Tt as WorkflowPolicyRuntimeDefaults, U as NodeConfigBase, Ut as EngineDeps, Xn as PersistedRunSchedulingState, Y as NodeId, Z as NodeOffloadPolicy, Zn as PersistedRunState, _t as WorkflowDefinition, an as NodeExecutionRequest, at as PersistedTokenId, bt as WorkflowErrorHandlerSpec, ct as RunId, en as NodeActivationRequest, et as NodeSchedulerDecision, fn as PreparedNodeActivationDispatch, fr as RunSummary, gr as WorkflowExecutionRepository, hr as WorkflowExecutionPruneRepository, it as PersistedRunPolicySnapshot, jn as WebhookTriggerMatcher, mr as WorkflowExecutionListingRepository, n as InMemoryLiveWorkflowRepository, nn as NodeActivationScheduler, or as RunPruneCandidate, r as Engine, rt as ParentExecutionRef, sn as NodeExecutionScheduler, t as RunIntentService, un as NodeResolver, vr as DependencyContainer, xn as WorkflowNodeInstanceFactory, yt as WorkflowErrorHandler } from "../RunIntentService-CV8izV8t.cjs";
|
|
2
|
+
import { a as WorkflowSnapshotCodec, i as WebhookTriggerMatcherProvider, n as EngineRuntimeRegistrationOptions, r as TriggerRuntimeDiagnosticsProvider, t as EngineWorkflowRunnerService } from "../EngineWorkflowRunnerService-Dx7bJsJR.cjs";
|
|
3
|
+
import { a as InProcessRetryRunner, c as AsyncSleeper, i as UnavailableBinaryStorage, l as CredentialResolverFactory, n as InMemoryBinaryStorage, o as DefaultExecutionContextFactory, r as DefaultExecutionBinaryService, s as DefaultAsyncSleeper, t as InMemoryRunDataFactory } from "../InMemoryRunDataFactory-qIYQEar7.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/workflowSnapshots/MissingRuntimeFallbacksFactory.d.ts
|
|
6
6
|
declare class MissingRuntimeFallbacks {
|
|
@@ -27,43 +27,6 @@ declare class EngineFactory {
|
|
|
27
27
|
create(deps: EngineCompositionDeps): Engine;
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region src/bootstrap/runtime/EngineRuntimeRegistration.types.d.ts
|
|
31
|
-
/**
|
|
32
|
-
* Creates the webhook route matcher used by {@link import("../api/Engine").Engine}.
|
|
33
|
-
* Hosts may supply logging/diagnostics; tests often use the default factory without diagnostics.
|
|
34
|
-
*/
|
|
35
|
-
interface WebhookTriggerMatcherProvider {
|
|
36
|
-
createMatcher(container: DependencyContainer): WebhookTriggerMatcher;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Supplies optional trigger-runtime logging (inactive workflow skips, activation sync).
|
|
40
|
-
*/
|
|
41
|
-
interface TriggerRuntimeDiagnosticsProvider {
|
|
42
|
-
create(container: DependencyContainer): TriggerRuntimeDiagnostics | undefined;
|
|
43
|
-
}
|
|
44
|
-
interface EngineRuntimeRegistrationOptions {
|
|
45
|
-
/**
|
|
46
|
-
* Static limits merged into the factory when the policy token is first resolved.
|
|
47
|
-
* Prefer {@link resolveEngineExecutionLimits} when limits can change after registration (e.g. host `useRuntimeConfig`).
|
|
48
|
-
*/
|
|
49
|
-
engineExecutionLimits?: Partial<EngineExecutionLimitsPolicyConfig>;
|
|
50
|
-
/**
|
|
51
|
-
* Called when the limits policy is first resolved; overrides {@link engineExecutionLimits} when both are set.
|
|
52
|
-
* Use this for host wiring so `runtime.engineExecutionLimits` applied after `registerCoreInfrastructure` is honored.
|
|
53
|
-
*/
|
|
54
|
-
resolveEngineExecutionLimits?: () => Partial<EngineExecutionLimitsPolicyConfig> | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* When {@link webhookTriggerMatcherProvider} is omitted, the registrar builds
|
|
57
|
-
* {@link import("../../runtime/WorkflowRepositoryWebhookTriggerMatcher").WorkflowRepositoryWebhookTriggerMatcher}
|
|
58
|
-
* using this optional routing diagnostics surface.
|
|
59
|
-
*/
|
|
60
|
-
webhookTriggerRoutingDiagnostics?: WebhookTriggerRoutingDiagnostics;
|
|
61
|
-
/** Overrides default webhook matcher construction (e.g. host-injected loggers). */
|
|
62
|
-
webhookTriggerMatcherProvider?: WebhookTriggerMatcherProvider;
|
|
63
|
-
/** Overrides default trigger diagnostics (undefined when omitted). */
|
|
64
|
-
triggerRuntimeDiagnosticsProvider?: TriggerRuntimeDiagnosticsProvider;
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
30
|
//#region src/bootstrap/runtime/EngineRuntimeRegistrar.d.ts
|
|
68
31
|
/**
|
|
69
32
|
* Container-first entry: call on a host/test container **after** workflow, run, node, and credential
|
|
@@ -159,6 +122,7 @@ declare class InMemoryWorkflowExecutionRepository implements WorkflowExecutionRe
|
|
|
159
122
|
engineCounters?: EngineRunCounters;
|
|
160
123
|
}): Promise<void>;
|
|
161
124
|
load(runId: RunId): Promise<PersistedRunState | undefined>;
|
|
125
|
+
loadSchedulingState(runId: RunId): Promise<PersistedRunSchedulingState | undefined>;
|
|
162
126
|
save(state: PersistedRunState): Promise<void>;
|
|
163
127
|
deleteRun(runId: RunId): Promise<void>;
|
|
164
128
|
listRuns(args?: Readonly<{
|
|
@@ -177,20 +141,6 @@ declare class RunSummaryMapper {
|
|
|
177
141
|
static fromPersistedState(state: PersistedRunState): RunSummary;
|
|
178
142
|
}
|
|
179
143
|
//#endregion
|
|
180
|
-
//#region src/runtime/EngineWorkflowRunnerService.d.ts
|
|
181
|
-
declare class EngineWorkflowRunnerService {
|
|
182
|
-
private readonly engine;
|
|
183
|
-
private readonly workflowRepository;
|
|
184
|
-
constructor(engine: Engine, workflowRepository: WorkflowRepository);
|
|
185
|
-
runById(args: {
|
|
186
|
-
workflowId: WorkflowId;
|
|
187
|
-
startAt?: NodeId;
|
|
188
|
-
items: Items;
|
|
189
|
-
parent?: ParentExecutionRef;
|
|
190
|
-
}): Promise<RunResult>;
|
|
191
|
-
private findDefaultStartNodeId;
|
|
192
|
-
}
|
|
193
|
-
//#endregion
|
|
194
144
|
//#region src/runtime/WorkflowRepositoryWebhookTriggerMatcher.d.ts
|
|
195
145
|
/**
|
|
196
146
|
* Resolves webhook HTTP routes from the live workflow repository (no trigger setup / registration).
|
|
@@ -235,11 +185,9 @@ declare class InlineDrivingScheduler implements NodeActivationScheduler {
|
|
|
235
185
|
private readonly drainingRuns;
|
|
236
186
|
private readonly queuesByRunId;
|
|
237
187
|
private readonly scheduledRuns;
|
|
238
|
-
private seq;
|
|
239
188
|
constructor(nodeExecutor: NodeExecutor);
|
|
240
189
|
setContinuation(continuation: NodeActivationContinuation): void;
|
|
241
|
-
|
|
242
|
-
notifyPendingStatePersisted(runId: RunId): void;
|
|
190
|
+
prepareDispatch(request: NodeActivationRequest): Promise<PreparedNodeActivationDispatch>;
|
|
243
191
|
private drainRun;
|
|
244
192
|
private scheduleDrain;
|
|
245
193
|
private resumeAfterExecutionResult;
|
|
@@ -256,8 +204,7 @@ declare class DefaultDrivingScheduler implements NodeActivationScheduler {
|
|
|
256
204
|
private readonly inline;
|
|
257
205
|
constructor(offloadPolicy: NodeOffloadPolicy, workerScheduler: NodeExecutionScheduler, inline: InlineDrivingScheduler);
|
|
258
206
|
setContinuation(continuation: NodeActivationContinuation): void;
|
|
259
|
-
|
|
260
|
-
notifyPendingStatePersisted(runId: string): void;
|
|
207
|
+
prepareDispatch(request: NodeActivationRequest): Promise<PreparedNodeActivationDispatch>;
|
|
261
208
|
/**
|
|
262
209
|
* Scheduler precedence is explicit:
|
|
263
210
|
* 1. run-intent override (`executionOptions.localOnly`)
|
|
@@ -266,7 +213,7 @@ declare class DefaultDrivingScheduler implements NodeActivationScheduler {
|
|
|
266
213
|
*/
|
|
267
214
|
private selectScheduler;
|
|
268
215
|
private hasNodeSchedulingPreference;
|
|
269
|
-
private
|
|
216
|
+
private prepareInlineDispatch;
|
|
270
217
|
}
|
|
271
218
|
//#endregion
|
|
272
219
|
//#region src/scheduler/HintOnlyOffloadPolicy.d.ts
|
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { At as
|
|
1
|
+
import { Ci as ENGINE_EXECUTION_LIMITS_DEFAULTS, Ti as EngineExecutionLimitsPolicyConfig, a as RunTerminalPersistenceCoordinator, an as WorkflowDefinition, c as EngineExecutionLimitsPolicyFactory, di as TypeToken, i as WorkflowPolicyErrorServices, n as InMemoryLiveWorkflowRepository, o as WorkflowStoragePolicyEvaluator, oi as DependencyContainer, qt as PersistedTokenId, r as EngineWorkflowRunnerService, s as RunPolicySnapshotFactory, t as RunIntentService, u as Engine, wi as EngineExecutionLimitsPolicy } from "../RunIntentService-BCvGdOSY.js";
|
|
2
|
+
import { At as AsyncSleeper, Dt as InProcessRetryRunner, Et as NodeExecutor, Nt as EngineCompositionDeps, Ot as DefaultExecutionContextFactory, Pt as EngineFactory, Tt as NodeInstanceFactory, a as ConfigDrivenOffloadPolicy, c as InMemoryWorkflowExecutionRepository, d as DefaultExecutionBinaryService, f as UnavailableBinaryStorage, i as InlineDrivingScheduler, jt as CredentialResolverFactory, kt as DefaultAsyncSleeper, l as InMemoryRunDataFactory, n as HintOnlyOffloadPolicy, o as WorkflowRepositoryWebhookTriggerMatcher, r as DefaultDrivingScheduler, s as RunSummaryMapper, t as LocalOnlyScheduler, u as InMemoryBinaryStorage } from "../index-BHmrZIHp.js";
|
|
3
|
+
import { n as TriggerRuntimeDiagnosticsProvider, r as WebhookTriggerMatcherProvider, t as EngineRuntimeRegistrationOptions } from "../EngineRuntimeRegistration.types-0sgV2XL2.js";
|
|
3
4
|
|
|
4
|
-
//#region src/bootstrap/runtime/EngineRuntimeRegistration.types.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Creates the webhook route matcher used by {@link import("../api/Engine").Engine}.
|
|
8
|
-
* Hosts may supply logging/diagnostics; tests often use the default factory without diagnostics.
|
|
9
|
-
*/
|
|
10
|
-
interface WebhookTriggerMatcherProvider {
|
|
11
|
-
createMatcher(container: DependencyContainer): WebhookTriggerMatcher;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Supplies optional trigger-runtime logging (inactive workflow skips, activation sync).
|
|
15
|
-
*/
|
|
16
|
-
interface TriggerRuntimeDiagnosticsProvider {
|
|
17
|
-
create(container: DependencyContainer): TriggerRuntimeDiagnostics | undefined;
|
|
18
|
-
}
|
|
19
|
-
interface EngineRuntimeRegistrationOptions {
|
|
20
|
-
/**
|
|
21
|
-
* Static limits merged into the factory when the policy token is first resolved.
|
|
22
|
-
* Prefer {@link resolveEngineExecutionLimits} when limits can change after registration (e.g. host `useRuntimeConfig`).
|
|
23
|
-
*/
|
|
24
|
-
engineExecutionLimits?: Partial<EngineExecutionLimitsPolicyConfig>;
|
|
25
|
-
/**
|
|
26
|
-
* Called when the limits policy is first resolved; overrides {@link engineExecutionLimits} when both are set.
|
|
27
|
-
* Use this for host wiring so `runtime.engineExecutionLimits` applied after `registerCoreInfrastructure` is honored.
|
|
28
|
-
*/
|
|
29
|
-
resolveEngineExecutionLimits?: () => Partial<EngineExecutionLimitsPolicyConfig> | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* When {@link webhookTriggerMatcherProvider} is omitted, the registrar builds
|
|
32
|
-
* {@link import("../../runtime/WorkflowRepositoryWebhookTriggerMatcher").WorkflowRepositoryWebhookTriggerMatcher}
|
|
33
|
-
* using this optional routing diagnostics surface.
|
|
34
|
-
*/
|
|
35
|
-
webhookTriggerRoutingDiagnostics?: WebhookTriggerRoutingDiagnostics;
|
|
36
|
-
/** Overrides default webhook matcher construction (e.g. host-injected loggers). */
|
|
37
|
-
webhookTriggerMatcherProvider?: WebhookTriggerMatcherProvider;
|
|
38
|
-
/** Overrides default trigger diagnostics (undefined when omitted). */
|
|
39
|
-
triggerRuntimeDiagnosticsProvider?: TriggerRuntimeDiagnosticsProvider;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
5
|
//#region src/bootstrap/runtime/EngineRuntimeRegistrar.d.ts
|
|
6
|
+
|
|
43
7
|
/**
|
|
44
8
|
* Container-first entry: call on a host/test container **after** workflow, run, node, and credential
|
|
45
9
|
* ports are registered. The registrar owns the default inline scheduler, engine binding,
|