@codemation/core 0.8.1 → 0.10.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 +380 -0
- package/dist/{EngineRuntimeRegistration.types-BP6tsaNP.d.ts → EngineRuntimeRegistration.types-D1fyApMI.d.ts} +2 -2
- package/dist/{EngineWorkflowRunnerService-DzOCa1BW.d.cts → EngineRuntimeRegistration.types-pB3FnzqR.d.cts} +17 -17
- package/dist/{InMemoryRunDataFactory-1iz7_SnO.d.cts → InMemoryRunDataFactory-Xw7v4-sj.d.cts} +31 -29
- package/dist/InMemoryRunEventBusRegistry-VM3OWnHo.cjs +47 -0
- package/dist/InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map +1 -0
- package/dist/InMemoryRunEventBusRegistry-sM4z4n_i.js +41 -0
- package/dist/InMemoryRunEventBusRegistry-sM4z4n_i.js.map +1 -0
- package/dist/{RunIntentService-BqhmdoA1.d.ts → RunIntentService-BE9CAkbf.d.ts} +966 -471
- package/dist/{RunIntentService-S-1lW-gS.d.cts → RunIntentService-siBSjaaY.d.cts} +859 -493
- package/dist/bootstrap/index.cjs +5 -2
- package/dist/bootstrap/index.d.cts +212 -135
- package/dist/bootstrap/index.d.ts +4 -4
- package/dist/bootstrap/index.js +3 -3
- package/dist/{bootstrap-Bx1u4cbS.cjs → bootstrap-Cm5ruQxx.cjs} +253 -2
- package/dist/bootstrap-Cm5ruQxx.cjs.map +1 -0
- package/dist/{bootstrap-BoknFKnw.js → bootstrap-D3r505ko.js} +236 -3
- package/dist/bootstrap-D3r505ko.js.map +1 -0
- package/dist/{index-CVs9rVhl.d.ts → index-DeLl1Tne.d.ts} +632 -230
- package/dist/index.cjs +323 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +544 -91
- package/dist/index.d.ts +3 -3
- package/dist/index.js +299 -166
- package/dist/index.js.map +1 -1
- package/dist/{runtime-DUW6tIJ1.js → runtime-BGNbRnqs.js} +934 -75
- package/dist/runtime-BGNbRnqs.js.map +1 -0
- package/dist/{runtime-Dvo2ru5A.cjs → runtime-DKXJwTNv.cjs} +1028 -73
- package/dist/runtime-DKXJwTNv.cjs.map +1 -0
- package/dist/testing.cjs +4 -4
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +3 -3
- package/package.json +7 -2
- package/src/ai/AiHost.ts +42 -14
- package/src/authoring/DefinedCollectionRegistry.ts +17 -0
- package/src/authoring/defineCollection.types.ts +181 -0
- package/src/authoring/definePollingTrigger.types.ts +396 -0
- package/src/authoring/definePollingTriggerInternals.ts +74 -0
- package/src/authoring/index.ts +19 -0
- package/src/bootstrap/index.ts +9 -0
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +8 -0
- package/src/browser.ts +1 -0
- package/src/contracts/CodemationTelemetryAttributeNames.ts +6 -0
- package/src/contracts/NoOpNodeExecutionTelemetry.ts +2 -11
- package/src/contracts/NoOpTelemetrySpanScope.ts +46 -10
- package/src/contracts/assertionTypes.ts +63 -0
- package/src/contracts/baseTypes.ts +12 -0
- package/src/contracts/collectionTypes.ts +44 -0
- package/src/contracts/credentialTypes.ts +23 -1
- package/src/contracts/executionPersistenceContracts.ts +30 -0
- package/src/contracts/index.ts +4 -0
- package/src/contracts/runTypes.ts +37 -1
- package/src/contracts/runtimeTypes.ts +42 -0
- package/src/contracts/telemetryTypes.ts +8 -0
- package/src/contracts/testTriggerTypes.ts +66 -0
- package/src/contracts/workflowTypes.ts +36 -7
- package/src/contracts.ts +59 -0
- package/src/events/ConnectionInvocationEventPublisher.ts +46 -0
- package/src/events/index.ts +1 -0
- package/src/events/runEvents.ts +74 -0
- package/src/execution/ChildExecutionScopeFactory.ts +55 -0
- package/src/execution/DefaultExecutionContextFactory.ts +6 -0
- package/src/execution/ExecutionTelemetryCostTrackingDecoratorFactory.ts +18 -0
- package/src/execution/NodeExecutor.ts +10 -2
- package/src/execution/NodeInstanceFactory.ts +13 -1
- package/src/execution/NodeInstantiationError.ts +16 -0
- package/src/execution/NodeRunStateWriter.ts +7 -0
- package/src/execution/NodeRunStateWriterFactory.ts +7 -0
- package/src/execution/WorkflowRunExecutionContextFactory.ts +3 -0
- package/src/execution/index.ts +2 -0
- package/src/index.ts +8 -0
- package/src/orchestration/AbortControllerFactory.ts +9 -0
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +1 -0
- package/src/orchestration/RunContinuationService.ts +3 -0
- package/src/orchestration/RunStartService.ts +122 -3
- package/src/orchestration/TestSuiteOrchestrator.ts +350 -0
- package/src/orchestration/TestSuiteRunIdFactory.ts +11 -0
- package/src/orchestration/TriggerRuntimeService.ts +34 -7
- package/src/orchestration/index.ts +9 -0
- package/src/runtime/EngineFactory.ts +12 -0
- package/src/triggers/polling/PollingTriggerDedupWindow.ts +23 -0
- package/src/triggers/polling/PollingTriggerLogger.ts +18 -0
- package/src/triggers/polling/PollingTriggerRuntime.ts +122 -0
- package/src/triggers/polling/index.ts +5 -0
- package/src/types/index.ts +12 -9
- package/src/workflow/definition/NodeIterationIdFactory.ts +26 -0
- package/src/workflow/dsl/NodeIdSlugifier.ts +18 -0
- package/src/workflow/dsl/WorkflowBuilder.ts +71 -3
- package/src/workflow/dsl/WorkflowDefinitionError.ts +15 -0
- package/src/workflow/index.ts +3 -0
- package/dist/InMemoryRunEventBusRegistry-B0_C4OnP.cjs +0 -262
- package/dist/InMemoryRunEventBusRegistry-B0_C4OnP.cjs.map +0 -1
- package/dist/InMemoryRunEventBusRegistry-C2U83Hmv.js +0 -238
- package/dist/InMemoryRunEventBusRegistry-C2U83Hmv.js.map +0 -1
- package/dist/bootstrap-BoknFKnw.js.map +0 -1
- package/dist/bootstrap-Bx1u4cbS.cjs.map +0 -1
- package/dist/runtime-DUW6tIJ1.js.map +0 -1
- package/dist/runtime-Dvo2ru5A.cjs.map +0 -1
|
@@ -1,37 +1,13 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $t as PersistedRunPolicySnapshot, Aa as TypeToken, Ai as CredentialSessionFactoryArgs, Bi as PollingTriggerLogger, Bn as BinaryStorageWriteResult, Bt as NodeDefinition, Ca as WorkflowExecutionRepository, Cr as WorkflowRepository, Fi as CredentialTypeId, Fn as BinaryBody, Ga as RunEvent, Gn as ExecutionContext, In as BinaryStorage, Ir as WorkflowActivationPolicy, It as JsonValue, Ja as TestCaseRunStatus, Jt as NodeOutputs, Ka as RunEventBus, Ki as EngineRunCounters, Kn as ExecutionContextFactory, Ln as BinaryStorageReadResult, Lr as ExecutionTelemetry, Lt as MutableRunData, Mr as WebhookTriggerMatcher, Ni as CredentialType, Nn as RetryPolicySpec, Oi as CredentialRequirement, Or as HttpMethod, Ot as ExecutionMode, Pi as CredentialTypeDefinition, Pr as WebhookTriggerRoutingDiagnostics, Qn as NodeActivationRequest, Qt as ParentExecutionRef, Rn as BinaryStorageStatResult, Rr as ExecutionTelemetryFactory, Rt as NodeActivationId, Sa as WorkflowExecutionPruneRepository, Sr as WorkflowNodeInstanceFactory, Tt as BinaryAttachment, Ua as EngineExecutionLimitsPolicy, Ui as ConnectionInvocationId, Vn as EngineDeps, Wi as ConnectionInvocationRecord, Wn as ExecutionBinaryService, Xa as TestSuiteRunId, Xn as NodeActivationContinuation, Xt as NodeSchedulerDecision, Ya as TestSuiteRunStatus, Yi as NodeExecutionSnapshot, Yr as TelemetrySpanScope, aa as PersistedWorkflowSnapshotNode, an as RunnableNodeInputJson, ar as NodeExecutionScheduler, br as TriggerSetupStateRepository, ci as CostTrackingTelemetryFactory, cr as NodeResolver, ct as Expr, da as RunExecutionOptions, dn as WorkflowDefinition, dr as PreparedNodeActivationDispatch, en as RunDataFactory, eo as NodeConnectionName, er as NodeActivationScheduler, fa as RunPruneCandidate, fi as CollectionsContext, i as WorkflowSnapshotCodec, in as RunnableNodeConfig, io as WorkflowId, ji as CredentialSessionService, jr as WebhookInvocationMatch, jt as Items, kr as TriggerInstanceId, kt as Item, ma as RunResult, na as PersistedRunSchedulingState, nn as RunId, nr as NodeExecutionContext, oi as CostTrackingTelemetry, or as NodeExecutionStatePublisher, ot as CostCatalog, pi as AnyCredentialType, qa as RunEventSubscription, qt as NodeOffloadPolicy, ra as PersistedRunState, rr as NodeExecutionRequest, sn as TriggerNodeConfig, st as CostCatalogEntry, tn as RunDataSnapshot, to as NodeId, tr as NodeBinaryAttachmentService, u as Engine, ui as CostTrackingUsageRecord, ut as ParamDeep, va as RunSummary, vi as CredentialFieldSchema, wi as CredentialJsonRecord, wt as ActivationIdFactory, xa as WorkflowExecutionListingRepository, xr as TriggerTestItemsContext, ya as RunTestContext, yi as CredentialHealth, zt as NodeConfigBase } from "./RunIntentService-BE9CAkbf.js";
|
|
2
2
|
import { ZodType, input, output, z } from "zod";
|
|
3
3
|
|
|
4
|
-
//#region src/
|
|
5
|
-
declare class MissingRuntimeFallbacks {
|
|
6
|
-
createDefinition(snapshotNode: PersistedWorkflowSnapshotNode): NodeDefinition;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/runtime/EngineFactory.d.ts
|
|
10
|
-
/**
|
|
11
|
-
* {@link EngineDeps} plus optional overrides for workflow-snapshot materialization.
|
|
12
|
-
* Overrides keep default construction in this factory while allowing tests or advanced wiring to inject instances.
|
|
13
|
-
*/
|
|
14
|
-
type EngineCompositionDeps = EngineDeps & {
|
|
15
|
-
workflowSnapshotCodec?: WorkflowSnapshotCodec;
|
|
16
|
-
missingRuntimeFallbacks?: MissingRuntimeFallbacks;
|
|
17
|
-
/** When set, used for run-start, trigger, and continuation limit defaults. */
|
|
18
|
-
executionLimitsPolicy?: EngineExecutionLimitsPolicy;
|
|
19
|
-
};
|
|
4
|
+
//#region src/orchestration/AbortControllerFactory.d.ts
|
|
20
5
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Exported from `@codemation/core/bootstrap` (not the main `@codemation/core` barrel).
|
|
6
|
+
* Mints fresh {@link AbortController}s. Injected (rather than direct `new`) to honor the
|
|
7
|
+
* codebase's no-direct-construction rule and to give tests a seam for substituting a fake.
|
|
24
8
|
*/
|
|
25
|
-
declare class
|
|
26
|
-
create(
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/events/NodeEventPublisher.d.ts
|
|
30
|
-
/** Publishes node lifecycle snapshots onto the run {@link RunEventBus}. */
|
|
31
|
-
declare class NodeEventPublisher {
|
|
32
|
-
private readonly eventBus;
|
|
33
|
-
constructor(eventBus: RunEventBus | undefined);
|
|
34
|
-
publish(kind: "nodeQueued" | "nodeStarted" | "nodeCompleted" | "nodeFailed", snapshot: NodeExecutionSnapshot): Promise<void>;
|
|
9
|
+
declare class AbortControllerFactory {
|
|
10
|
+
create(): AbortController;
|
|
35
11
|
}
|
|
36
12
|
//#endregion
|
|
37
13
|
//#region src/execution/CredentialResolverFactory.d.ts
|
|
@@ -41,122 +17,12 @@ declare class CredentialResolverFactory {
|
|
|
41
17
|
create(workflowId: WorkflowId, nodeId: NodeId, config?: NodeExecutionContext["config"]): NodeExecutionContext["getCredential"];
|
|
42
18
|
}
|
|
43
19
|
//#endregion
|
|
44
|
-
//#region src/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
declare class DefaultAsyncSleeper implements AsyncSleeper {
|
|
51
|
-
sleep(ms: number): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/execution/DefaultExecutionContextFactory.d.ts
|
|
55
|
-
declare class DefaultExecutionContextFactory implements ExecutionContextFactory {
|
|
56
|
-
private readonly binaryStorage;
|
|
57
|
-
private readonly telemetryFactory;
|
|
58
|
-
private readonly costTrackingFactory;
|
|
59
|
-
private readonly currentDate;
|
|
60
|
-
private readonly telemetryDecoratorFactory;
|
|
61
|
-
constructor(binaryStorage?: BinaryStorage, telemetryFactory?: ExecutionTelemetryFactory, costTrackingFactory?: CostTrackingTelemetryFactory, currentDate?: () => Date);
|
|
62
|
-
create(args: {
|
|
63
|
-
runId: RunId;
|
|
64
|
-
workflowId: WorkflowId;
|
|
65
|
-
parent?: ParentExecutionRef;
|
|
66
|
-
policySnapshot?: PersistedRunPolicySnapshot;
|
|
67
|
-
subworkflowDepth: number;
|
|
68
|
-
engineMaxNodeActivations: number;
|
|
69
|
-
engineMaxSubworkflowDepth: number;
|
|
70
|
-
data: RunDataSnapshot;
|
|
71
|
-
nodeState?: NodeExecutionStatePublisher;
|
|
72
|
-
telemetry?: ExecutionContext["telemetry"];
|
|
73
|
-
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
74
|
-
}): ExecutionContext;
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/execution/CatalogBackedCostTrackingTelemetryFactory.d.ts
|
|
78
|
-
declare class CatalogBackedCostTrackingTelemetryFactory implements CostTrackingTelemetryFactory {
|
|
79
|
-
private readonly costCatalog;
|
|
80
|
-
constructor(costCatalog: CostCatalog);
|
|
81
|
-
create(args: Readonly<{
|
|
82
|
-
telemetry: ExecutionTelemetry;
|
|
83
|
-
}>): CostTrackingTelemetry;
|
|
84
|
-
}
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/execution/InProcessRetryRunner.d.ts
|
|
87
|
-
declare class InProcessRetryRunner {
|
|
88
|
-
private readonly sleeper;
|
|
89
|
-
constructor(sleeper: AsyncSleeper);
|
|
90
|
-
run<T>(policy: RetryPolicySpec | undefined, work: () => Promise<T>): Promise<T>;
|
|
91
|
-
private static delayAfterFailureMs;
|
|
92
|
-
private static normalizePolicy;
|
|
93
|
-
private static assertPositiveInt;
|
|
94
|
-
private static assertNonNegativeFinite;
|
|
95
|
-
private static assertMultiplier;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/execution/ItemExprResolver.d.ts
|
|
99
|
-
/**
|
|
100
|
-
* Resolves {@link import("../contracts/itemExpr").ItemExpr} leaves on runnable config before {@link RunnableNode.execute}.
|
|
101
|
-
*/
|
|
102
|
-
declare class ItemExprResolver {
|
|
103
|
-
resolveConfigForItem<TConfig$1 extends RunnableNodeConfig<any, any>>(ctx: NodeExecutionContext<TConfig$1>, item: Item, itemIndex: number, items: ReadonlyArray<Item>): Promise<NodeExecutionContext<TConfig$1>>;
|
|
104
|
-
}
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region src/execution/RunnableOutputBehaviorResolver.d.ts
|
|
107
|
-
type RunnableOutputBehavior = Readonly<{
|
|
108
|
-
keepBinaries: boolean;
|
|
109
|
-
}>;
|
|
110
|
-
declare class RunnableOutputBehaviorResolver {
|
|
111
|
-
resolve(config: RunnableNodeConfig): RunnableOutputBehavior;
|
|
112
|
-
private isKeepBinariesEnabled;
|
|
113
|
-
}
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/execution/NodeOutputNormalizer.d.ts
|
|
116
|
-
declare class NodeOutputNormalizer {
|
|
117
|
-
normalizeExecuteResult(args: Readonly<{
|
|
118
|
-
baseItem: Item;
|
|
119
|
-
raw: unknown;
|
|
120
|
-
behavior: RunnableOutputBehavior;
|
|
121
|
-
}>): NodeOutputs;
|
|
122
|
-
private arrayFanOutToMain;
|
|
123
|
-
private emitPortsToOutputs;
|
|
124
|
-
private normalizePortPayload;
|
|
125
|
-
private isItemLike;
|
|
126
|
-
private applyOutput;
|
|
127
|
-
}
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region src/execution/NodeExecutor.d.ts
|
|
130
|
-
declare class NodeExecutor {
|
|
131
|
-
private readonly nodeInstanceFactory;
|
|
132
|
-
private readonly retryRunner;
|
|
133
|
-
private readonly fanInMerger;
|
|
134
|
-
private readonly outputNormalizer;
|
|
135
|
-
private readonly itemExprResolver;
|
|
136
|
-
private readonly outputBehaviorResolver;
|
|
137
|
-
constructor(nodeInstanceFactory: WorkflowNodeInstanceFactory, retryRunner: InProcessRetryRunner, itemExprResolver?: ItemExprResolver, outputBehaviorResolver?: RunnableOutputBehaviorResolver);
|
|
138
|
-
execute(request: NodeActivationRequest): Promise<NodeOutputs>;
|
|
139
|
-
private executeMultiInputActivation;
|
|
140
|
-
private executeSingleInputNode;
|
|
141
|
-
private isTriggerNode;
|
|
142
|
-
private isRunnableNode;
|
|
143
|
-
private hasExecuteMulti;
|
|
144
|
-
private asMultiFromSingleActivation;
|
|
145
|
-
private executeRunnableActivation;
|
|
146
|
-
/** Use resolver ctx only when {@link NodeExecutionContext.config} is non-nullish. */
|
|
147
|
-
private pickExecutionContext;
|
|
148
|
-
private resolveInputSchema;
|
|
149
|
-
private assertItemJsonNotTopLevelArray;
|
|
150
|
-
private assertNoPortEnvelopeBypass;
|
|
151
|
-
}
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region src/execution/NodeInstanceFactory.d.ts
|
|
154
|
-
declare class NodeInstanceFactory implements WorkflowNodeInstanceFactory {
|
|
155
|
-
private readonly nodeResolver;
|
|
156
|
-
constructor(nodeResolver: NodeResolver);
|
|
157
|
-
createNodes(workflow: WorkflowDefinition): Map<NodeId, unknown>;
|
|
158
|
-
createNode(definition: WorkflowDefinition["nodes"][number]): unknown;
|
|
159
|
-
createByType(type: TypeToken<unknown>): unknown;
|
|
20
|
+
//#region src/events/NodeEventPublisher.d.ts
|
|
21
|
+
/** Publishes node lifecycle snapshots onto the run {@link RunEventBus}. */
|
|
22
|
+
declare class NodeEventPublisher {
|
|
23
|
+
private readonly eventBus;
|
|
24
|
+
constructor(eventBus: RunEventBus | undefined);
|
|
25
|
+
publish(kind: "nodeQueued" | "nodeStarted" | "nodeCompleted" | "nodeFailed", snapshot: NodeExecutionSnapshot): Promise<void>;
|
|
160
26
|
}
|
|
161
27
|
//#endregion
|
|
162
28
|
//#region src/contracts/Clock.d.ts
|
|
@@ -169,7 +35,7 @@ declare class SystemClock implements Clock {
|
|
|
169
35
|
}
|
|
170
36
|
//#endregion
|
|
171
37
|
//#region src/authoring/defineNode.types.d.ts
|
|
172
|
-
type MaybePromise$
|
|
38
|
+
type MaybePromise$2<TValue> = TValue | Promise<TValue>;
|
|
173
39
|
type ResolvableCredentialType = AnyCredentialType | CredentialTypeId;
|
|
174
40
|
type SessionForCredentialType<TCredential extends ResolvableCredentialType> = TCredential extends AnyCredentialType ? Awaited<ReturnType<TCredential["createSession"]>> : unknown;
|
|
175
41
|
type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{
|
|
@@ -235,7 +101,7 @@ interface DefineNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJ
|
|
|
235
101
|
readonly inputSchema?: ZodType<TInputJson>;
|
|
236
102
|
/** Preserve inbound `item.binary` when `execute` returns plain JSON or item-shaped results without `binary`. */
|
|
237
103
|
readonly keepBinaries?: boolean;
|
|
238
|
-
execute(args: DefineNodeExecuteArgs<TConfig$1, TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$
|
|
104
|
+
execute(args: DefineNodeExecuteArgs<TConfig$1, TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<TOutputJson>;
|
|
239
105
|
}
|
|
240
106
|
/**
|
|
241
107
|
* Batch-oriented defined node: `run` receives all item JSON once (last item in activation); emits one output per input row.
|
|
@@ -248,7 +114,7 @@ interface DefineBatchNodeOptions<TKey$1 extends string, TConfig$1 extends Creden
|
|
|
248
114
|
readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
|
|
249
115
|
readonly configSchema?: z.ZodType<TConfig$1>;
|
|
250
116
|
readonly credentials?: TBindings;
|
|
251
|
-
run(items: ReadonlyArray<TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$
|
|
117
|
+
run(items: ReadonlyArray<TInputJson>, context: DefinedNodeRunContext<TConfig$1, TBindings>): MaybePromise$2<ReadonlyArray<TOutputJson>>;
|
|
252
118
|
}
|
|
253
119
|
declare function defineNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
|
|
254
120
|
declare function defineBatchNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefineBatchNodeOptions<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>): DefinedNode<TKey$1, TConfig$1, TInputJson, TOutputJson, TBindings>;
|
|
@@ -261,7 +127,7 @@ declare class DefinedNodeRegistry {
|
|
|
261
127
|
}
|
|
262
128
|
//#endregion
|
|
263
129
|
//#region src/authoring/defineCredential.types.d.ts
|
|
264
|
-
type MaybePromise<TValue> = TValue | Promise<TValue>;
|
|
130
|
+
type MaybePromise$1<TValue> = TValue | Promise<TValue>;
|
|
265
131
|
type CredentialFieldInput = CredentialFieldSchema["type"] | Readonly<Omit<CredentialFieldSchema, "key">>;
|
|
266
132
|
type CredentialFieldMap<TConfig$1 extends CredentialJsonRecord> = Readonly<Record<keyof TConfig$1 & string, CredentialFieldInput>>;
|
|
267
133
|
type ZodObjectSchema<TConfig$1 extends CredentialJsonRecord = CredentialJsonRecord> = z.ZodType<TConfig$1>;
|
|
@@ -274,8 +140,8 @@ interface DefineCredentialOptions<TPublicSource extends CredentialFieldMap<any>
|
|
|
274
140
|
readonly secret: TSecretSource;
|
|
275
141
|
readonly supportedSourceKinds?: CredentialTypeDefinition["supportedSourceKinds"];
|
|
276
142
|
readonly auth?: CredentialTypeDefinition["auth"];
|
|
277
|
-
createSession(args: CredentialSessionFactoryArgs<InferCredentialConfig<TPublicSource>, InferCredentialConfig<TSecretSource>>): MaybePromise<TSession>;
|
|
278
|
-
test(args: CredentialSessionFactoryArgs<InferCredentialConfig<TPublicSource>, InferCredentialConfig<TSecretSource>>): MaybePromise<CredentialHealth>;
|
|
143
|
+
createSession(args: CredentialSessionFactoryArgs<InferCredentialConfig<TPublicSource>, InferCredentialConfig<TSecretSource>>): MaybePromise$1<TSession>;
|
|
144
|
+
test(args: CredentialSessionFactoryArgs<InferCredentialConfig<TPublicSource>, InferCredentialConfig<TSecretSource>>): MaybePromise$1<CredentialHealth>;
|
|
279
145
|
}
|
|
280
146
|
declare function defineCredential<TPublicSource extends CredentialFieldMap<any> | ZodObjectSchema<any>, TSecretSource extends CredentialFieldMap<any> | ZodObjectSchema<any>, TSession>(options: DefineCredentialOptions<TPublicSource, TSecretSource, TSession>): CredentialType<InferCredentialConfig<TPublicSource>, InferCredentialConfig<TSecretSource>, TSession> & {
|
|
281
147
|
readonly key: string;
|
|
@@ -406,6 +272,15 @@ type ToolExecuteArgs<TConfig$1 extends ToolConfig = ToolConfig, TInput = unknown
|
|
|
406
272
|
item: Item;
|
|
407
273
|
itemIndex: number;
|
|
408
274
|
items: Items;
|
|
275
|
+
/**
|
|
276
|
+
* Optional sub-agent boundary hooks: when present, the live `agent.tool.call` span and the
|
|
277
|
+
* planned tool-call invocationId are forwarded so node-backed runtimes can re-root their child
|
|
278
|
+
* execution scope. Plain function tools may safely ignore these hooks.
|
|
279
|
+
*/
|
|
280
|
+
hooks?: Readonly<{
|
|
281
|
+
parentSpan?: TelemetrySpanScope;
|
|
282
|
+
parentInvocationId?: ConnectionInvocationId;
|
|
283
|
+
}>;
|
|
409
284
|
}>;
|
|
410
285
|
interface Tool<TConfig$1 extends ToolConfig = ToolConfig, TInputSchema extends ZodSchemaAny = ZodSchemaAny, TOutputSchema extends ZodSchemaAny = ZodSchemaAny> {
|
|
411
286
|
readonly defaultDescription: string;
|
|
@@ -476,25 +351,47 @@ interface ChatModelConfig {
|
|
|
476
351
|
readonly presentation?: AgentCanvasPresentation;
|
|
477
352
|
getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
|
|
478
353
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
354
|
+
/**
|
|
355
|
+
* Provider-neutral chat language model wrapper returned by a {@link ChatModelFactory}.
|
|
356
|
+
*
|
|
357
|
+
* Thin adapter around an AI SDK `LanguageModelV2` (from `@ai-sdk/provider`) plus the call-site
|
|
358
|
+
* defaults Codemation needs at every generate/stream: the provider label, the model name used for
|
|
359
|
+
* pricing / telemetry, and the default invocation options (max output tokens, temperature,
|
|
360
|
+
* provider-specific overrides).
|
|
361
|
+
*
|
|
362
|
+
* The consumer (AIAgentNode / AgentStructuredOutputRunner) passes `languageModel` directly into
|
|
363
|
+
* `generateText({ model, ... })` from the `ai` package.
|
|
364
|
+
*/
|
|
365
|
+
interface ChatLanguageModel {
|
|
366
|
+
/** AI SDK `LanguageModelV2` instance (kept `unknown` to avoid leaking the SDK type into `@codemation/core`). */
|
|
367
|
+
readonly languageModel: unknown;
|
|
368
|
+
/** Stable pricing/telemetry key — e.g. `"gpt-4.1-nano"`. */
|
|
369
|
+
readonly modelName: string;
|
|
370
|
+
/** Provider label — e.g. `"openai"`. Used for cost tracking. */
|
|
371
|
+
readonly provider?: string;
|
|
372
|
+
/** Defaults merged into every call. Consumers may override per-invocation. */
|
|
373
|
+
readonly defaultCallOptions?: ChatLanguageModelCallOptions;
|
|
483
374
|
}
|
|
484
|
-
interface
|
|
485
|
-
|
|
375
|
+
interface ChatLanguageModelCallOptions {
|
|
376
|
+
readonly maxOutputTokens?: number;
|
|
377
|
+
readonly temperature?: number;
|
|
378
|
+
readonly providerOptions?: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
|
|
486
379
|
}
|
|
487
|
-
|
|
488
|
-
|
|
380
|
+
/**
|
|
381
|
+
* Options for a structured-output generate call. Mirrors
|
|
382
|
+
* `generateText({ output: Output.object(...) })` from the `ai` package.
|
|
383
|
+
*/
|
|
384
|
+
interface StructuredOutputOptions {
|
|
385
|
+
/** Optional schema name — used by some providers as the JSON schema name attribute. */
|
|
386
|
+
readonly schemaName?: string;
|
|
387
|
+
/** When `true`, the consumer should pass a strict-mode-compatible JSON Schema record. */
|
|
489
388
|
readonly strict?: boolean;
|
|
490
|
-
readonly includeRaw?: boolean;
|
|
491
|
-
readonly tools?: ReadonlyArray<unknown>;
|
|
492
389
|
}
|
|
493
390
|
interface ChatModelFactory<TConfig$1 extends ChatModelConfig = ChatModelConfig> {
|
|
494
391
|
create(args: Readonly<{
|
|
495
392
|
config: TConfig$1;
|
|
496
393
|
ctx: NodeExecutionContext<any>;
|
|
497
|
-
}>): Promise<
|
|
394
|
+
}>): Promise<ChatLanguageModel> | ChatLanguageModel;
|
|
498
395
|
}
|
|
499
396
|
type NodeBackedToolInputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = Readonly<{
|
|
500
397
|
input: TToolInput;
|
|
@@ -538,6 +435,219 @@ type AgentAttachmentRole = "languageModel" | "tool" | "nestedAgent";
|
|
|
538
435
|
*/
|
|
539
436
|
declare function callableTool<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny>(options: CallableToolConfigOptions<TInputSchema, TOutputSchema>): CallableToolConfig<TInputSchema, TOutputSchema>;
|
|
540
437
|
//#endregion
|
|
438
|
+
//#region src/authoring/defineCollection.types.d.ts
|
|
439
|
+
type CollectionFieldType = "text" | "int" | "bigint" | "double" | "bool" | "timestamptz" | "jsonb" | "uuid";
|
|
440
|
+
interface CollectionColumnBuilder {
|
|
441
|
+
notNull(): CollectionColumnBuilder;
|
|
442
|
+
default(value: unknown): CollectionColumnBuilder;
|
|
443
|
+
readonly _type: CollectionFieldType;
|
|
444
|
+
readonly _nullable: boolean;
|
|
445
|
+
readonly _default?: unknown;
|
|
446
|
+
}
|
|
447
|
+
declare const c: {
|
|
448
|
+
readonly text: () => CollectionColumnBuilder;
|
|
449
|
+
readonly int: () => CollectionColumnBuilder;
|
|
450
|
+
readonly bigint: () => CollectionColumnBuilder;
|
|
451
|
+
readonly double: () => CollectionColumnBuilder;
|
|
452
|
+
readonly bool: () => CollectionColumnBuilder;
|
|
453
|
+
readonly timestamptz: () => CollectionColumnBuilder;
|
|
454
|
+
readonly jsonb: () => CollectionColumnBuilder;
|
|
455
|
+
readonly uuid: () => CollectionColumnBuilder;
|
|
456
|
+
};
|
|
457
|
+
interface CollectionFieldDefinition {
|
|
458
|
+
readonly type: CollectionFieldType;
|
|
459
|
+
readonly nullable: boolean;
|
|
460
|
+
readonly default?: unknown;
|
|
461
|
+
}
|
|
462
|
+
interface CollectionIndexDefinition {
|
|
463
|
+
readonly on: ReadonlyArray<string>;
|
|
464
|
+
readonly unique?: boolean;
|
|
465
|
+
}
|
|
466
|
+
interface CollectionDefinition {
|
|
467
|
+
readonly name: string;
|
|
468
|
+
readonly fields: Readonly<Record<string, CollectionFieldDefinition>>;
|
|
469
|
+
readonly indexes: ReadonlyArray<CollectionIndexDefinition>;
|
|
470
|
+
}
|
|
471
|
+
interface DefinedCollection<TDefinition extends CollectionDefinition = CollectionDefinition> {
|
|
472
|
+
readonly kind: "defined-collection";
|
|
473
|
+
readonly definition: TDefinition;
|
|
474
|
+
register(context: {
|
|
475
|
+
registerCollection(d: CollectionDefinition): void;
|
|
476
|
+
}): void;
|
|
477
|
+
}
|
|
478
|
+
interface DefineCollectionOptions {
|
|
479
|
+
readonly name: string;
|
|
480
|
+
readonly fields: Record<string, CollectionColumnBuilder>;
|
|
481
|
+
readonly indexes?: ReadonlyArray<CollectionIndexDefinition>;
|
|
482
|
+
}
|
|
483
|
+
declare function defineCollection<TName extends string>(options: DefineCollectionOptions & {
|
|
484
|
+
name: TName;
|
|
485
|
+
}): DefinedCollection<CollectionDefinition & {
|
|
486
|
+
name: TName;
|
|
487
|
+
}>;
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/authoring/DefinedCollectionRegistry.d.ts
|
|
490
|
+
declare class DefinedCollectionRegistry {
|
|
491
|
+
private static readonly definitions;
|
|
492
|
+
static register(definition: CollectionDefinition): void;
|
|
493
|
+
static resolve(name: string): CollectionDefinition | undefined;
|
|
494
|
+
static list(): ReadonlyArray<CollectionDefinition>;
|
|
495
|
+
}
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region src/authoring/definePollingTrigger.types.d.ts
|
|
498
|
+
type MaybePromise<TValue> = TValue | Promise<TValue>;
|
|
499
|
+
/**
|
|
500
|
+
* Context passed into the `poll` callback on each tick.
|
|
501
|
+
*/
|
|
502
|
+
interface DefinePollingTriggerPollContext<TConfig$1 extends CredentialJsonRecord, TState extends JsonValue | undefined, TBindings extends DefinedNodeCredentialBindings | undefined> {
|
|
503
|
+
readonly config: TConfig$1;
|
|
504
|
+
readonly state: TState;
|
|
505
|
+
readonly credentials: DefinedNodeCredentialAccessors<TBindings>;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* What `poll` must return each tick.
|
|
509
|
+
*/
|
|
510
|
+
interface DefinePollingTriggerPollResult<TItemJson, TState extends JsonValue | undefined> {
|
|
511
|
+
/**
|
|
512
|
+
* New items to emit. Each item may carry an optional `dedupKey`; duplicate keys are
|
|
513
|
+
* filtered out against a rolling dedup window (managed internally by the runtime).
|
|
514
|
+
* Items without a `dedupKey` are always emitted.
|
|
515
|
+
*/
|
|
516
|
+
readonly items: ReadonlyArray<{
|
|
517
|
+
json: TItemJson;
|
|
518
|
+
dedupKey?: string;
|
|
519
|
+
}>;
|
|
520
|
+
/** Persisted as the trigger's setup state for the next tick. */
|
|
521
|
+
readonly nextState: TState;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Context passed into the `execute` callback for post-emit enrichment (e.g. fetching
|
|
525
|
+
* attachment bytes). Mirrors `NodeExecutionContext` so plugin authors use familiar patterns.
|
|
526
|
+
*/
|
|
527
|
+
type DefinePollingTriggerExecuteContext<TConfig$1 extends TriggerNodeConfig<any, any>> = NodeExecutionContext<TConfig$1>;
|
|
528
|
+
/**
|
|
529
|
+
* Context passed into the `testItems` callback.
|
|
530
|
+
*/
|
|
531
|
+
type DefinePollingTriggerTestItemsContext<TConfig$1 extends TriggerNodeConfig<any, any>> = TriggerTestItemsContext<TConfig$1>;
|
|
532
|
+
/**
|
|
533
|
+
* Options accepted by `definePollingTrigger`.
|
|
534
|
+
*/
|
|
535
|
+
interface DefinePollingTriggerOptions<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TItemJson, TState extends JsonValue | undefined, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
536
|
+
/**
|
|
537
|
+
* Unique node-token-id-style key, e.g. `"msgraph-mail.on-new-mail"`.
|
|
538
|
+
* Used as the persisted runtime type name — must be stable across deployments.
|
|
539
|
+
*/
|
|
540
|
+
readonly key: TKey$1;
|
|
541
|
+
readonly title: string;
|
|
542
|
+
readonly description?: string;
|
|
543
|
+
/** Canvas icon (same contract as `NodeConfigBase.icon`). */
|
|
544
|
+
readonly icon?: string;
|
|
545
|
+
/**
|
|
546
|
+
* Zod schema for the trigger's user-facing configuration.
|
|
547
|
+
* When provided, the returned `create()` method is typed against the inferred config type.
|
|
548
|
+
*/
|
|
549
|
+
readonly configSchema?: ZodType<TConfig$1>;
|
|
550
|
+
/** Credential bindings keyed by slot (same format as `defineNode`). */
|
|
551
|
+
readonly credentials?: TBindings;
|
|
552
|
+
/**
|
|
553
|
+
* Called once when the trigger arms (or re-arms after a server restart) to provide the
|
|
554
|
+
* initial value for `state` when no persisted state exists.
|
|
555
|
+
*/
|
|
556
|
+
initialState?(): TState;
|
|
557
|
+
/**
|
|
558
|
+
* Polling interval in milliseconds. The runtime enforces a minimum of 25 ms.
|
|
559
|
+
* @default 60_000
|
|
560
|
+
*/
|
|
561
|
+
readonly pollIntervalMs?: number;
|
|
562
|
+
/**
|
|
563
|
+
* The per-tick poll logic. Called by the runtime each interval.
|
|
564
|
+
* Must return new items plus the next persisted state.
|
|
565
|
+
*/
|
|
566
|
+
poll(pollCtx: DefinePollingTriggerPollContext<TConfig$1, TState, TBindings>): MaybePromise<DefinePollingTriggerPollResult<TItemJson, TState>>;
|
|
567
|
+
/**
|
|
568
|
+
* Optional post-emit enrichment step (runs in the normal node-execute phase after the
|
|
569
|
+
* trigger fires and the workflow run starts). Use for expensive per-item work such as
|
|
570
|
+
* fetching attachment bytes via `ctx.binary.attach`. When omitted, the trigger passes
|
|
571
|
+
* items through unchanged.
|
|
572
|
+
*/
|
|
573
|
+
execute?(items: Items<TItemJson>, ctx: NodeExecutionContext<DefinedPollingTriggerConfig<TConfig$1, TItemJson>>): MaybePromise<NodeOutputs>;
|
|
574
|
+
/**
|
|
575
|
+
* Optional implementation for the workflow UI's "Test" button. Should return a small
|
|
576
|
+
* sample of current items without consulting or mutating polling state.
|
|
577
|
+
*/
|
|
578
|
+
testItems?(ctx: TriggerTestItemsContext<DefinedPollingTriggerConfig<TConfig$1, TItemJson>>): MaybePromise<Items<TItemJson>>;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* The object returned by `definePollingTrigger`. Register it via
|
|
582
|
+
* `definePlugin({ nodes: [myTrigger] })` or call `.register(ctx)` directly.
|
|
583
|
+
*
|
|
584
|
+
* `poll` is also directly callable for unit-testing — no runtime needed.
|
|
585
|
+
*/
|
|
586
|
+
interface DefinedPollingTrigger<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TItemJson, TState extends JsonValue | undefined, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
587
|
+
readonly kind: "defined-polling-trigger";
|
|
588
|
+
readonly key: TKey$1;
|
|
589
|
+
readonly title: string;
|
|
590
|
+
readonly description?: string;
|
|
591
|
+
/**
|
|
592
|
+
* Create the trigger config for use in workflow definitions.
|
|
593
|
+
* @param cfg - User-facing trigger configuration.
|
|
594
|
+
* @param name - Display name (defaults to `title`).
|
|
595
|
+
* @param id - Optional stable node id.
|
|
596
|
+
*/
|
|
597
|
+
create(cfg: TConfig$1, name?: string, id?: string): DefinedPollingTriggerConfig<TConfig$1, TItemJson>;
|
|
598
|
+
/**
|
|
599
|
+
* Test seam: call `poll` directly without starting the runtime.
|
|
600
|
+
* Returns `{ items, nextState }` just like the real runtime receives.
|
|
601
|
+
*/
|
|
602
|
+
poll(pollCtx: Omit<DefinePollingTriggerPollContext<TConfig$1, TState, TBindings>, "credentials"> & {
|
|
603
|
+
credentials?: DefinedNodeCredentialAccessors<TBindings>;
|
|
604
|
+
}): MaybePromise<DefinePollingTriggerPollResult<TItemJson, TState>>;
|
|
605
|
+
/** Registers the synthesised runtime class with the plugin container. */
|
|
606
|
+
register(context: {
|
|
607
|
+
registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
|
|
608
|
+
}): void;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* TriggerNodeConfig produced by `DefinedPollingTrigger.create(...)`.
|
|
612
|
+
* Holds user configuration and credential requirements for the engine.
|
|
613
|
+
* The setup state type is opaque `JsonValue | undefined` — the runtime
|
|
614
|
+
* uses an internal wrapped shape that plugin authors never see.
|
|
615
|
+
*/
|
|
616
|
+
declare class DefinedPollingTriggerConfig<TConfig$1 extends CredentialJsonRecord, TItemJson> implements TriggerNodeConfig<TItemJson, JsonValue | undefined> {
|
|
617
|
+
readonly name: string;
|
|
618
|
+
readonly cfg: TConfig$1;
|
|
619
|
+
private readonly credentialRequirements;
|
|
620
|
+
readonly id?: string | undefined;
|
|
621
|
+
readonly kind: "trigger";
|
|
622
|
+
readonly type: TypeToken<unknown>;
|
|
623
|
+
readonly icon: string | undefined;
|
|
624
|
+
constructor(name: string, cfg: TConfig$1, typeToken: TypeToken<unknown>, icon: string | undefined, credentialRequirements: ReadonlyArray<CredentialRequirement>, id?: string | undefined);
|
|
625
|
+
getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Declarative helper for authoring polling triggers.
|
|
629
|
+
*
|
|
630
|
+
* ```ts
|
|
631
|
+
* export const onNewMail = definePollingTrigger({
|
|
632
|
+
* key: "my-plugin.on-new-mail",
|
|
633
|
+
* title: "On new mail",
|
|
634
|
+
* configSchema: z.object({ folder: z.string() }),
|
|
635
|
+
* credentials: { auth: myOAuthCredentialType },
|
|
636
|
+
* initialState: () => ({ lastSeenId: undefined }),
|
|
637
|
+
* pollIntervalMs: 60_000,
|
|
638
|
+
* async poll({ config, state, credentials }) {
|
|
639
|
+
* const session = await credentials.auth();
|
|
640
|
+
* const messages = await fetchMessages(session, config.folder, state.lastSeenId);
|
|
641
|
+
* return {
|
|
642
|
+
* items: messages.map(m => ({ json: m, dedupKey: m.id })),
|
|
643
|
+
* nextState: { lastSeenId: messages[0]?.id ?? state.lastSeenId },
|
|
644
|
+
* };
|
|
645
|
+
* },
|
|
646
|
+
* });
|
|
647
|
+
* ```
|
|
648
|
+
*/
|
|
649
|
+
declare function definePollingTrigger<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TItemJson, TState extends JsonValue | undefined, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(options: DefinePollingTriggerOptions<TKey$1, TConfig$1, TItemJson, TState, TBindings>): DefinedPollingTrigger<TKey$1, TConfig$1, TItemJson, TState, TBindings>;
|
|
650
|
+
//#endregion
|
|
541
651
|
//#region src/ai/AgentConnectionNodeCollector.d.ts
|
|
542
652
|
type AgentConnectionNodeRole = "languageModel" | "tool" | "nestedAgent";
|
|
543
653
|
type AgentConnectionCredentialSource = Readonly<{
|
|
@@ -558,6 +668,22 @@ type AgentConnectionNodeCollectorApi = Readonly<{
|
|
|
558
668
|
}>;
|
|
559
669
|
declare const AgentConnectionNodeCollector: AgentConnectionNodeCollectorApi;
|
|
560
670
|
//#endregion
|
|
671
|
+
//#region src/events/ConnectionInvocationEventPublisher.d.ts
|
|
672
|
+
/**
|
|
673
|
+
* Publishes per-invocation lifecycle records onto the run {@link RunEventBus}.
|
|
674
|
+
*
|
|
675
|
+
* Surgical, per-invocation events let the UI update the right-side inspector
|
|
676
|
+
* timeline as each LLM round / tool call transitions through `running` → `completed`
|
|
677
|
+
* (or `failed`) without depending on a coarse `runSaved` poll.
|
|
678
|
+
*/
|
|
679
|
+
declare class ConnectionInvocationEventPublisher {
|
|
680
|
+
private readonly eventBus;
|
|
681
|
+
private readonly parent;
|
|
682
|
+
constructor(eventBus: RunEventBus | undefined, parent: ParentExecutionRef | undefined);
|
|
683
|
+
publish(record: ConnectionInvocationRecord): Promise<void>;
|
|
684
|
+
private kindFor;
|
|
685
|
+
}
|
|
686
|
+
//#endregion
|
|
561
687
|
//#region src/events/InMemoryRunEventBusRegistry.d.ts
|
|
562
688
|
declare class InMemoryRunEventBus implements RunEventBus {
|
|
563
689
|
private readonly globalListeners;
|
|
@@ -686,84 +812,150 @@ declare class DefaultExecutionBinaryService implements ExecutionBinaryService {
|
|
|
686
812
|
openReadStream(attachment: BinaryAttachment): Promise<BinaryStorageReadResult | undefined>;
|
|
687
813
|
}
|
|
688
814
|
//#endregion
|
|
689
|
-
//#region src/
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
815
|
+
//#region src/execution/ChildExecutionScopeFactory.d.ts
|
|
816
|
+
/**
|
|
817
|
+
* Builds a re-rooted child execution context for sub-agent (and other deeply-nested) invocations.
|
|
818
|
+
*
|
|
819
|
+
* At the orchestrator's `agent.tool.call` boundary the inner runtime needs a ctx whose:
|
|
820
|
+
* - `nodeId` is the tool's connection node id (so inner LLM/tool connection ids derive correctly),
|
|
821
|
+
* - `activationId` is fresh (so its connection-invocation rows are uniquely identifiable),
|
|
822
|
+
* - `telemetry` parents children under the tool-call span (not the orchestrator's node span),
|
|
823
|
+
* - `binary` is scoped to the new (nodeId, activationId),
|
|
824
|
+
* - `parentInvocationId` points back to the tool-call invocation for downstream lineage.
|
|
825
|
+
*
|
|
826
|
+
* Registered via factory in {@link EngineRuntimeRegistrar} so constructors stay free of parameter
|
|
827
|
+
* decorators (Next/SWC and coverage tooling cannot parse them on in-repo sources).
|
|
828
|
+
*/
|
|
829
|
+
declare class ChildExecutionScopeFactory {
|
|
830
|
+
private readonly activationIdFactory;
|
|
831
|
+
constructor(activationIdFactory: ActivationIdFactory);
|
|
832
|
+
forSubAgent<TConfig$1 extends RunnableNodeConfig<any, any>>(args: Readonly<{
|
|
833
|
+
parentCtx: NodeExecutionContext<TConfig$1>;
|
|
834
|
+
childNodeId: NodeId;
|
|
835
|
+
childConfig: TConfig$1;
|
|
836
|
+
parentInvocationId: ConnectionInvocationId;
|
|
837
|
+
parentSpan: TelemetrySpanScope;
|
|
838
|
+
}>): NodeExecutionContext<TConfig$1>;
|
|
700
839
|
}
|
|
701
840
|
//#endregion
|
|
702
|
-
//#region src/
|
|
703
|
-
|
|
704
|
-
|
|
841
|
+
//#region src/execution/asyncSleeper.types.d.ts
|
|
842
|
+
interface AsyncSleeper {
|
|
843
|
+
sleep(ms: number): Promise<void>;
|
|
705
844
|
}
|
|
706
845
|
//#endregion
|
|
707
|
-
//#region src/
|
|
708
|
-
declare class
|
|
709
|
-
|
|
710
|
-
|
|
846
|
+
//#region src/execution/DefaultAsyncSleeper.d.ts
|
|
847
|
+
declare class DefaultAsyncSleeper implements AsyncSleeper {
|
|
848
|
+
sleep(ms: number): Promise<void>;
|
|
849
|
+
}
|
|
850
|
+
//#endregion
|
|
851
|
+
//#region src/execution/DefaultExecutionContextFactory.d.ts
|
|
852
|
+
declare class DefaultExecutionContextFactory implements ExecutionContextFactory {
|
|
853
|
+
private readonly binaryStorage;
|
|
854
|
+
private readonly telemetryFactory;
|
|
855
|
+
private readonly costTrackingFactory;
|
|
856
|
+
private readonly currentDate;
|
|
857
|
+
private readonly collections?;
|
|
858
|
+
private readonly telemetryDecoratorFactory;
|
|
859
|
+
constructor(binaryStorage?: BinaryStorage, telemetryFactory?: ExecutionTelemetryFactory, costTrackingFactory?: CostTrackingTelemetryFactory, currentDate?: () => Date, collections?: CollectionsContext | undefined);
|
|
860
|
+
create(args: {
|
|
711
861
|
runId: RunId;
|
|
712
862
|
workflowId: WorkflowId;
|
|
713
|
-
startedAt: string;
|
|
714
863
|
parent?: ParentExecutionRef;
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
deleteRun(runId: RunId): Promise<void>;
|
|
726
|
-
listRuns(args?: Readonly<{
|
|
727
|
-
workflowId?: WorkflowId;
|
|
728
|
-
limit?: number;
|
|
729
|
-
}>): Promise<ReadonlyArray<RunSummary>>;
|
|
730
|
-
listRunsOlderThan(args: Readonly<{
|
|
731
|
-
nowIso: string;
|
|
732
|
-
defaultRetentionSeconds: number;
|
|
733
|
-
limit?: number;
|
|
734
|
-
}>): Promise<ReadonlyArray<RunPruneCandidate>>;
|
|
864
|
+
policySnapshot?: PersistedRunPolicySnapshot;
|
|
865
|
+
subworkflowDepth: number;
|
|
866
|
+
engineMaxNodeActivations: number;
|
|
867
|
+
engineMaxSubworkflowDepth: number;
|
|
868
|
+
data: RunDataSnapshot;
|
|
869
|
+
nodeState?: NodeExecutionStatePublisher;
|
|
870
|
+
telemetry?: ExecutionContext["telemetry"];
|
|
871
|
+
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
872
|
+
testContext?: RunTestContext;
|
|
873
|
+
}): ExecutionContext;
|
|
735
874
|
}
|
|
736
875
|
//#endregion
|
|
737
|
-
//#region src/
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
876
|
+
//#region src/execution/CatalogBackedCostTrackingTelemetryFactory.d.ts
|
|
877
|
+
declare class CatalogBackedCostTrackingTelemetryFactory implements CostTrackingTelemetryFactory {
|
|
878
|
+
private readonly costCatalog;
|
|
879
|
+
constructor(costCatalog: CostCatalog);
|
|
880
|
+
create(args: Readonly<{
|
|
881
|
+
telemetry: ExecutionTelemetry;
|
|
882
|
+
}>): CostTrackingTelemetry;
|
|
741
883
|
}
|
|
742
884
|
//#endregion
|
|
743
|
-
//#region src/
|
|
885
|
+
//#region src/execution/InProcessRetryRunner.d.ts
|
|
886
|
+
declare class InProcessRetryRunner {
|
|
887
|
+
private readonly sleeper;
|
|
888
|
+
constructor(sleeper: AsyncSleeper);
|
|
889
|
+
run<T>(policy: RetryPolicySpec | undefined, work: () => Promise<T>): Promise<T>;
|
|
890
|
+
private static delayAfterFailureMs;
|
|
891
|
+
private static normalizePolicy;
|
|
892
|
+
private static assertPositiveInt;
|
|
893
|
+
private static assertNonNegativeFinite;
|
|
894
|
+
private static assertMultiplier;
|
|
895
|
+
}
|
|
896
|
+
//#endregion
|
|
897
|
+
//#region src/execution/ItemExprResolver.d.ts
|
|
744
898
|
/**
|
|
745
|
-
* Resolves
|
|
746
|
-
* Maintains an in-memory index keyed by user-defined endpoint path for O(1) lookups after reload.
|
|
899
|
+
* Resolves {@link import("../contracts/itemExpr").ItemExpr} leaves on runnable config before {@link RunnableNode.execute}.
|
|
747
900
|
*/
|
|
748
|
-
declare class
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
901
|
+
declare class ItemExprResolver {
|
|
902
|
+
resolveConfigForItem<TConfig$1 extends RunnableNodeConfig<any, any>>(ctx: NodeExecutionContext<TConfig$1>, item: Item, itemIndex: number, items: ReadonlyArray<Item>): Promise<NodeExecutionContext<TConfig$1>>;
|
|
903
|
+
}
|
|
904
|
+
//#endregion
|
|
905
|
+
//#region src/execution/RunnableOutputBehaviorResolver.d.ts
|
|
906
|
+
type RunnableOutputBehavior = Readonly<{
|
|
907
|
+
keepBinaries: boolean;
|
|
908
|
+
}>;
|
|
909
|
+
declare class RunnableOutputBehaviorResolver {
|
|
910
|
+
resolve(config: RunnableNodeConfig): RunnableOutputBehavior;
|
|
911
|
+
private isKeepBinariesEnabled;
|
|
912
|
+
}
|
|
913
|
+
//#endregion
|
|
914
|
+
//#region src/execution/NodeOutputNormalizer.d.ts
|
|
915
|
+
declare class NodeOutputNormalizer {
|
|
916
|
+
normalizeExecuteResult(args: Readonly<{
|
|
917
|
+
baseItem: Item;
|
|
918
|
+
raw: unknown;
|
|
919
|
+
behavior: RunnableOutputBehavior;
|
|
920
|
+
}>): NodeOutputs;
|
|
921
|
+
private arrayFanOutToMain;
|
|
922
|
+
private emitPortsToOutputs;
|
|
923
|
+
private normalizePortPayload;
|
|
924
|
+
private isItemLike;
|
|
925
|
+
private applyOutput;
|
|
926
|
+
}
|
|
927
|
+
//#endregion
|
|
928
|
+
//#region src/execution/NodeExecutor.d.ts
|
|
929
|
+
declare class NodeExecutor {
|
|
930
|
+
private readonly nodeInstanceFactory;
|
|
931
|
+
private readonly retryRunner;
|
|
932
|
+
private readonly fanInMerger;
|
|
933
|
+
private readonly outputNormalizer;
|
|
934
|
+
private readonly itemExprResolver;
|
|
935
|
+
private readonly outputBehaviorResolver;
|
|
936
|
+
constructor(nodeInstanceFactory: WorkflowNodeInstanceFactory, retryRunner: InProcessRetryRunner, itemExprResolver?: ItemExprResolver, outputBehaviorResolver?: RunnableOutputBehaviorResolver);
|
|
937
|
+
execute(request: NodeActivationRequest): Promise<NodeOutputs>;
|
|
938
|
+
private executeMultiInputActivation;
|
|
939
|
+
private executeSingleInputNode;
|
|
940
|
+
private isTriggerNode;
|
|
941
|
+
private isRunnableNode;
|
|
942
|
+
private hasExecuteMulti;
|
|
943
|
+
private asMultiFromSingleActivation;
|
|
944
|
+
private executeRunnableActivation;
|
|
945
|
+
/** Use resolver ctx only when {@link NodeExecutionContext.config} is non-nullish. */
|
|
946
|
+
private pickExecutionContext;
|
|
947
|
+
private resolveInputSchema;
|
|
948
|
+
private assertItemJsonNotTopLevelArray;
|
|
949
|
+
private assertNoPortEnvelopeBypass;
|
|
950
|
+
}
|
|
951
|
+
//#endregion
|
|
952
|
+
//#region src/execution/NodeInstanceFactory.d.ts
|
|
953
|
+
declare class NodeInstanceFactory implements WorkflowNodeInstanceFactory {
|
|
954
|
+
private readonly nodeResolver;
|
|
955
|
+
constructor(nodeResolver: NodeResolver);
|
|
956
|
+
createNodes(workflow: WorkflowDefinition): Map<NodeId, unknown>;
|
|
957
|
+
createNode(definition: WorkflowDefinition["nodes"][number]): unknown;
|
|
958
|
+
createByType(type: TypeToken<unknown>): unknown;
|
|
767
959
|
}
|
|
768
960
|
//#endregion
|
|
769
961
|
//#region src/execution/StaticCostCatalog.d.ts
|
|
@@ -840,5 +1032,215 @@ declare class LocalOnlyScheduler implements NodeExecutionScheduler {
|
|
|
840
1032
|
}>;
|
|
841
1033
|
}
|
|
842
1034
|
//#endregion
|
|
843
|
-
|
|
844
|
-
|
|
1035
|
+
//#region src/runStorage/InMemoryBinaryStorageRegistry.d.ts
|
|
1036
|
+
declare class InMemoryBinaryStorage implements BinaryStorage {
|
|
1037
|
+
readonly driverName = "memory";
|
|
1038
|
+
private readonly values;
|
|
1039
|
+
write(args: {
|
|
1040
|
+
storageKey: string;
|
|
1041
|
+
body: BinaryBody;
|
|
1042
|
+
}): Promise<BinaryStorageWriteResult>;
|
|
1043
|
+
openReadStream(storageKey: string): Promise<BinaryStorageReadResult | undefined>;
|
|
1044
|
+
stat(storageKey: string): Promise<BinaryStorageStatResult>;
|
|
1045
|
+
delete(storageKey: string): Promise<void>;
|
|
1046
|
+
}
|
|
1047
|
+
//#endregion
|
|
1048
|
+
//#region src/runStorage/InMemoryRunDataFactory.d.ts
|
|
1049
|
+
declare class InMemoryRunDataFactory implements RunDataFactory {
|
|
1050
|
+
create(initial?: Record<NodeId, NodeOutputs>): MutableRunData;
|
|
1051
|
+
}
|
|
1052
|
+
//#endregion
|
|
1053
|
+
//#region src/runStorage/InMemoryWorkflowExecutionRepository.d.ts
|
|
1054
|
+
declare class InMemoryWorkflowExecutionRepository implements WorkflowExecutionRepository, WorkflowExecutionListingRepository, WorkflowExecutionPruneRepository {
|
|
1055
|
+
private readonly runs;
|
|
1056
|
+
createRun(args: {
|
|
1057
|
+
runId: RunId;
|
|
1058
|
+
workflowId: WorkflowId;
|
|
1059
|
+
startedAt: string;
|
|
1060
|
+
parent?: ParentExecutionRef;
|
|
1061
|
+
executionOptions?: PersistedRunState["executionOptions"];
|
|
1062
|
+
control?: PersistedRunState["control"];
|
|
1063
|
+
workflowSnapshot?: PersistedRunState["workflowSnapshot"];
|
|
1064
|
+
mutableState?: PersistedRunState["mutableState"];
|
|
1065
|
+
policySnapshot?: PersistedRunState["policySnapshot"];
|
|
1066
|
+
engineCounters?: EngineRunCounters;
|
|
1067
|
+
}): Promise<void>;
|
|
1068
|
+
load(runId: RunId): Promise<PersistedRunState | undefined>;
|
|
1069
|
+
loadSchedulingState(runId: RunId): Promise<PersistedRunSchedulingState | undefined>;
|
|
1070
|
+
save(state: PersistedRunState): Promise<void>;
|
|
1071
|
+
deleteRun(runId: RunId): Promise<void>;
|
|
1072
|
+
listRuns(args?: Readonly<{
|
|
1073
|
+
workflowId?: WorkflowId;
|
|
1074
|
+
limit?: number;
|
|
1075
|
+
}>): Promise<ReadonlyArray<RunSummary>>;
|
|
1076
|
+
listRunsOlderThan(args: Readonly<{
|
|
1077
|
+
nowIso: string;
|
|
1078
|
+
defaultRetentionSeconds: number;
|
|
1079
|
+
limit?: number;
|
|
1080
|
+
}>): Promise<ReadonlyArray<RunPruneCandidate>>;
|
|
1081
|
+
}
|
|
1082
|
+
//#endregion
|
|
1083
|
+
//#region src/runStorage/RunSummaryMapper.d.ts
|
|
1084
|
+
/** Maps persisted run state to API run summaries for listings. */
|
|
1085
|
+
declare class RunSummaryMapper {
|
|
1086
|
+
static fromPersistedState(state: PersistedRunState): RunSummary;
|
|
1087
|
+
}
|
|
1088
|
+
//#endregion
|
|
1089
|
+
//#region src/workflowSnapshots/MissingRuntimeFallbacksFactory.d.ts
|
|
1090
|
+
declare class MissingRuntimeFallbacks {
|
|
1091
|
+
createDefinition(snapshotNode: PersistedWorkflowSnapshotNode): NodeDefinition;
|
|
1092
|
+
}
|
|
1093
|
+
//#endregion
|
|
1094
|
+
//#region src/runtime/EngineFactory.d.ts
|
|
1095
|
+
/**
|
|
1096
|
+
* {@link EngineDeps} plus optional overrides for workflow-snapshot materialization.
|
|
1097
|
+
* Overrides keep default construction in this factory while allowing tests or advanced wiring to inject instances.
|
|
1098
|
+
*/
|
|
1099
|
+
type EngineCompositionDeps = EngineDeps & {
|
|
1100
|
+
workflowSnapshotCodec?: WorkflowSnapshotCodec;
|
|
1101
|
+
missingRuntimeFallbacks?: MissingRuntimeFallbacks;
|
|
1102
|
+
/** When set, used for run-start, trigger, and continuation limit defaults. */
|
|
1103
|
+
executionLimitsPolicy?: EngineExecutionLimitsPolicy;
|
|
1104
|
+
};
|
|
1105
|
+
/**
|
|
1106
|
+
* Composes the {@link Engine} graph from {@link EngineCompositionDeps}. Production wiring usually goes through
|
|
1107
|
+
* {@link import("../bootstrap/runtime/EngineRuntimeRegistrar").EngineRuntimeRegistrar}; this factory remains for tests and custom composition.
|
|
1108
|
+
* Exported from `@codemation/core/bootstrap` (not the main `@codemation/core` barrel).
|
|
1109
|
+
*/
|
|
1110
|
+
declare class EngineFactory {
|
|
1111
|
+
create(deps: EngineCompositionDeps): Engine;
|
|
1112
|
+
}
|
|
1113
|
+
//#endregion
|
|
1114
|
+
//#region src/runtime/WorkflowRepositoryWebhookTriggerMatcher.d.ts
|
|
1115
|
+
/**
|
|
1116
|
+
* Resolves webhook HTTP routes from the live workflow repository (no trigger setup / registration).
|
|
1117
|
+
* Maintains an in-memory index keyed by user-defined endpoint path for O(1) lookups after reload.
|
|
1118
|
+
*/
|
|
1119
|
+
declare class WorkflowRepositoryWebhookTriggerMatcher implements WebhookTriggerMatcher {
|
|
1120
|
+
private readonly workflowRepository;
|
|
1121
|
+
private readonly workflowActivationPolicy;
|
|
1122
|
+
private readonly diagnostics?;
|
|
1123
|
+
private readonly routeByPath;
|
|
1124
|
+
private engineRoutesActive;
|
|
1125
|
+
constructor(workflowRepository: WorkflowRepository, workflowActivationPolicy: WorkflowActivationPolicy, diagnostics?: WebhookTriggerRoutingDiagnostics | undefined);
|
|
1126
|
+
onEngineWorkflowsLoaded(): void;
|
|
1127
|
+
onEngineStopped(): void;
|
|
1128
|
+
reloadWebhookRoutes(): void;
|
|
1129
|
+
lookup(endpointPath: string): WebhookInvocationMatch | undefined;
|
|
1130
|
+
match(args: {
|
|
1131
|
+
endpointPath: string;
|
|
1132
|
+
method: HttpMethod;
|
|
1133
|
+
}): WebhookInvocationMatch | undefined;
|
|
1134
|
+
private rebuildRouteIndex;
|
|
1135
|
+
private collectWebhookEndpointPaths;
|
|
1136
|
+
private tryMatchFromTriggerNode;
|
|
1137
|
+
private normalizeEndpointPath;
|
|
1138
|
+
}
|
|
1139
|
+
//#endregion
|
|
1140
|
+
//#region src/triggers/polling/PollingTriggerRuntime.d.ts
|
|
1141
|
+
interface PollingRunCycleArgs<TState> {
|
|
1142
|
+
previousState: TState | undefined;
|
|
1143
|
+
signal: AbortSignal;
|
|
1144
|
+
}
|
|
1145
|
+
interface PollingRunCycleResult<TState, TItem> {
|
|
1146
|
+
items: Items<TItem>;
|
|
1147
|
+
nextState: TState;
|
|
1148
|
+
}
|
|
1149
|
+
interface PollingTriggerStartArgs<TState, TItem> {
|
|
1150
|
+
trigger: TriggerInstanceId;
|
|
1151
|
+
intervalMs: number;
|
|
1152
|
+
seedState?: TState;
|
|
1153
|
+
runCycle: (cycleCtx: PollingRunCycleArgs<TState>) => Promise<PollingRunCycleResult<TState, TItem>>;
|
|
1154
|
+
emit: (items: Items) => Promise<void>;
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Generic polling-trigger runtime. Owns the set-interval loop, overlap guard, and persistence.
|
|
1158
|
+
* Constructed by {@link import("../../runtime/EngineFactory").EngineFactory} and exposed to plugin
|
|
1159
|
+
* authors via {@link import("../../contracts/runtimeTypes").TriggerSetupContext}.polling.
|
|
1160
|
+
*/
|
|
1161
|
+
declare class PollingTriggerRuntime {
|
|
1162
|
+
private readonly triggerSetupStateRepository;
|
|
1163
|
+
private readonly logger;
|
|
1164
|
+
private readonly activeTriggers;
|
|
1165
|
+
private readonly intervalsByTrigger;
|
|
1166
|
+
private readonly busyTriggers;
|
|
1167
|
+
constructor(triggerSetupStateRepository: TriggerSetupStateRepository, logger: PollingTriggerLogger);
|
|
1168
|
+
start<TState, TItem>(args: PollingTriggerStartArgs<TState, TItem>): Promise<TState | undefined>;
|
|
1169
|
+
stop(trigger: TriggerInstanceId): Promise<void>;
|
|
1170
|
+
private ensureLoop;
|
|
1171
|
+
private runCycle;
|
|
1172
|
+
private toKey;
|
|
1173
|
+
private describe;
|
|
1174
|
+
private logError;
|
|
1175
|
+
}
|
|
1176
|
+
//#endregion
|
|
1177
|
+
//#region src/orchestration/TestSuiteRunIdFactory.d.ts
|
|
1178
|
+
/**
|
|
1179
|
+
* Mints unique TestSuiteRun identifiers. Separated from {@link import("../types").RunIdFactory}
|
|
1180
|
+
* so suite ids and per-case workflow run ids never alias.
|
|
1181
|
+
*/
|
|
1182
|
+
declare class TestSuiteRunIdFactory {
|
|
1183
|
+
makeTestSuiteRunId(): TestSuiteRunId;
|
|
1184
|
+
}
|
|
1185
|
+
//#endregion
|
|
1186
|
+
//#region src/orchestration/TestSuiteOrchestrator.d.ts
|
|
1187
|
+
/**
|
|
1188
|
+
* Engine-facade subset the orchestrator needs. Kept narrow on purpose so unit tests can
|
|
1189
|
+
* substitute a fake without depending on the full Engine wiring.
|
|
1190
|
+
*/
|
|
1191
|
+
interface TestSuiteOrchestratorEngine {
|
|
1192
|
+
runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions): Promise<RunResult>;
|
|
1193
|
+
waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
|
|
1194
|
+
status: "completed" | "failed";
|
|
1195
|
+
}>>;
|
|
1196
|
+
}
|
|
1197
|
+
interface TestSuiteCaseOutcome {
|
|
1198
|
+
readonly testCaseIndex: number;
|
|
1199
|
+
readonly runId: RunId;
|
|
1200
|
+
readonly status: TestCaseRunStatus;
|
|
1201
|
+
}
|
|
1202
|
+
interface TestSuiteRunResult {
|
|
1203
|
+
readonly testSuiteRunId: TestSuiteRunId;
|
|
1204
|
+
readonly workflowId: WorkflowId;
|
|
1205
|
+
readonly triggerNodeId: NodeId;
|
|
1206
|
+
readonly status: TestSuiteRunStatus;
|
|
1207
|
+
readonly totalCases: number;
|
|
1208
|
+
readonly passedCases: number;
|
|
1209
|
+
readonly failedCases: number;
|
|
1210
|
+
readonly cases: ReadonlyArray<TestSuiteCaseOutcome>;
|
|
1211
|
+
}
|
|
1212
|
+
interface RunTestSuiteArgs {
|
|
1213
|
+
readonly workflow: WorkflowDefinition;
|
|
1214
|
+
readonly triggerNodeId: NodeId;
|
|
1215
|
+
readonly testSuiteRunId?: TestSuiteRunId;
|
|
1216
|
+
readonly concurrency?: number;
|
|
1217
|
+
readonly signal?: AbortSignal;
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* Drives a {@link TestTriggerNodeConfig.generateItems} iterable into one workflow run per item,
|
|
1221
|
+
* with bounded concurrency. Pure engine logic — no persistence, no HTTP, no UI. Hosts adapt by
|
|
1222
|
+
* subscribing to {@link RunEventBus} and writing rows on `testSuite*` / `testCase*` / `nodeCompleted`.
|
|
1223
|
+
*
|
|
1224
|
+
* Cancellation: the supplied `AbortSignal` aborts the source iterable (so credentialed pulls bail)
|
|
1225
|
+
* and stops scheduling further cases. In-flight cases are awaited; engine-level cancellation of
|
|
1226
|
+
* an already-dispatched run is not yet wired (Phase 2).
|
|
1227
|
+
*/
|
|
1228
|
+
declare class TestSuiteOrchestrator {
|
|
1229
|
+
private readonly engine;
|
|
1230
|
+
private readonly testSuiteRunIdFactory;
|
|
1231
|
+
private readonly credentialResolverFactory;
|
|
1232
|
+
private readonly abortControllerFactory;
|
|
1233
|
+
private readonly eventBus;
|
|
1234
|
+
private readonly currentDate;
|
|
1235
|
+
constructor(engine: TestSuiteOrchestratorEngine, testSuiteRunIdFactory: TestSuiteRunIdFactory, credentialResolverFactory: CredentialResolverFactory, abortControllerFactory: AbortControllerFactory, eventBus: RunEventBus | undefined, currentDate?: () => Date);
|
|
1236
|
+
runSuite(args: RunTestSuiteArgs): Promise<TestSuiteRunResult>;
|
|
1237
|
+
private runOneCase;
|
|
1238
|
+
private deriveSuiteStatus;
|
|
1239
|
+
private now;
|
|
1240
|
+
/** Defensive label resolver — author-supplied callbacks throw / return non-strings; we tolerate both. */
|
|
1241
|
+
private resolveCaseLabel;
|
|
1242
|
+
private publish;
|
|
1243
|
+
}
|
|
1244
|
+
//#endregion
|
|
1245
|
+
export { AgentConnectionNodeCollector as $, ZodSchemaAny as $t, CatalogBackedCostTrackingTelemetryFactory as A, AgentMessageTemplateContent as At, node as B, ChatLanguageModel as Bt, StaticCostCatalog as C, Clock as Cn, AgentGuardrailDefaults as Ct, RunnableOutputBehaviorResolver as D, AbortControllerFactory as Dn, AgentMessageLine as Dt, NodeOutputNormalizer as E, CredentialResolverFactory as En, AgentMessageDto as Et, DefaultExecutionBinaryService as F, AgentToolCallPlanner as Ft, InjectableRuntimeDecoratorComposer as G, NodeBackedToolInputMapper as Gt, StackTraceCallSitePathResolver as H, ChatModelConfig as Ht, UnavailableBinaryStorage as I, AgentToolDefinition as It, PersistedRuntimeTypeMetadata as J, NodeBackedToolOutputMapperArgs as Jt, PersistedRuntimeTypeDecoratorOptions as K, NodeBackedToolInputMapperArgs as Kt, ItemsInputNormalizer as L, AgentToolExecuteArgs as Lt, DefaultAsyncSleeper as M, AgentNodeConfig as Mt, AsyncSleeper as N, AgentTool as Nt, ItemExprResolver as O, AgentMessageRole as Ot, ChildExecutionScopeFactory as P, AgentToolCall as Pt, AgentConnectionCredentialSource as Q, ToolExecuteArgs as Qt, chatModel as R, AgentToolToken as Rt, ConfigDrivenOffloadPolicy as S, defineNode as Sn, AgentGuardrailConfig as St, NodeExecutor as T, NodeEventPublisher as Tn, AgentMessageConfig as Tt, PersistedRuntimeTypeNameResolver as U, ChatModelFactory as Ut, tool as V, ChatLanguageModelCallOptions as Vt, PersistedRuntimeTypeMetadataStore as W, NodeBackedToolConfigOptions as Wt, InMemoryRunEventBus as X, Tool as Xt, EventPublishingWorkflowExecutionRepository as Y, StructuredOutputOptions as Yt, ConnectionInvocationEventPublisher as Z, ToolConfig as Zt, InMemoryBinaryStorage as _, DefinedNodeCredentialAccessors as _n, c as _t, TestSuiteRunResult as a, CallableToolConfig as an, DefinePollingTriggerPollResult as at, DefaultDrivingScheduler as b, DefinedNodeRunContext as bn, AgentAttachmentRole as bt, PollingRunCycleResult as c, NodeBackedToolConfig as cn, DefinedPollingTriggerConfig as ct, WorkflowRepositoryWebhookTriggerMatcher as d, DefinedNodeRegistry as dn, CollectionColumnBuilder as dt, AgentConfigInspector as en, AgentConnectionNodeDescriptor as et, EngineCompositionDeps as f, DefineBatchNodeOptions as fn, CollectionDefinition as ft, InMemoryRunDataFactory as g, DefinedNodeConfigInput as gn, DefinedCollection as gt, InMemoryWorkflowExecutionRepository as h, DefinedNode as hn, DefineCollectionOptions as ht, TestSuiteOrchestratorEngine as i, CallableToolFactory as in, DefinePollingTriggerPollContext as it, DefaultExecutionContextFactory as j, AgentModelInvocationOptions as jt, InProcessRetryRunner as k, AgentMessageTemplate as kt, PollingTriggerRuntime as l, DefineCredentialOptions as ln, definePollingTrigger as lt, RunSummaryMapper as m, DefineNodeOptions as mn, CollectionIndexDefinition as mt, TestSuiteCaseOutcome as n, AgentToolFactory as nn, DefinePollingTriggerExecuteContext as nt, TestSuiteRunIdFactory as o, CallableToolConfigOptions as on, DefinePollingTriggerTestItemsContext as ot, EngineFactory as p, DefineNodeExecuteArgs as pn, CollectionFieldDefinition as pt, PersistedRuntimeTypeKind as q, NodeBackedToolOutputMapper as qt, TestSuiteOrchestrator as r, CallableToolKindToken as rn, DefinePollingTriggerOptions as rt, PollingRunCycleArgs as s, CallableToolExecuteHandler as sn, DefinedPollingTrigger as st, RunTestSuiteArgs as t, AgentMessageConfigNormalizer as tn, AgentConnectionNodeRole as tt, PollingTriggerStartArgs as u, defineCredential as un, DefinedCollectionRegistry as ut, LocalOnlyScheduler as v, DefinedNodeCredentialBinding as vn, defineCollection as vt, NodeInstanceFactory as w, SystemClock as wn, AgentMessageBuildArgs as wt, InlineDrivingScheduler as x, defineBatchNode as xn, AgentCanvasPresentation as xt, HintOnlyOffloadPolicy as y, DefinedNodeCredentialBindings as yn, callableTool as yt, getPersistedRuntimeTypeMetadata as z, AgentTurnLimitBehavior as zt };
|
|
1246
|
+
//# sourceMappingURL=index-DeLl1Tne.d.ts.map
|