@codemation/core 0.6.0 → 0.8.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 +31 -0
- package/dist/{EngineRuntimeRegistration.types-Dm129RJ6.d.ts → EngineRuntimeRegistration.types-BP6tsaNP.d.ts} +4 -2
- package/dist/{EngineWorkflowRunnerService-Bf88QtwB.d.cts → EngineWorkflowRunnerService-DzOCa1BW.d.cts} +4 -2
- package/dist/{InMemoryRunDataFactory-Dyl4p2s8.d.cts → InMemoryRunDataFactory-1iz7_SnO.d.cts} +27 -7
- package/dist/{workflowActivationPolicy-6V3OJD3N.cjs → InMemoryRunEventBusRegistry-B0_C4OnP.cjs} +1 -16
- package/dist/InMemoryRunEventBusRegistry-B0_C4OnP.cjs.map +1 -0
- package/dist/{workflowActivationPolicy-Td9HTOuD.js → InMemoryRunEventBusRegistry-C2U83Hmv.js} +2 -11
- package/dist/InMemoryRunEventBusRegistry-C2U83Hmv.js.map +1 -0
- package/dist/{RunIntentService-BDiodxhf.d.ts → RunIntentService-BqhmdoA1.d.ts} +258 -21
- package/dist/{RunIntentService-B1Y3v1H6.d.cts → RunIntentService-S-1lW-gS.d.cts} +209 -5
- package/dist/bootstrap/index.cjs +4 -2
- package/dist/bootstrap/index.d.cts +26 -7
- package/dist/bootstrap/index.d.ts +4 -4
- package/dist/bootstrap/index.js +3 -3
- package/dist/{bootstrap-DVL2ue5v.cjs → bootstrap-BaN6hZ5I.cjs} +7 -4
- package/dist/bootstrap-BaN6hZ5I.cjs.map +1 -0
- package/dist/{bootstrap-DdeiJ8cd.js → bootstrap-d_BMaDT4.js} +7 -4
- package/dist/bootstrap-d_BMaDT4.js.map +1 -0
- package/dist/{index-C2af8ssM.d.ts → index-CVs9rVhl.d.ts} +44 -13
- package/dist/index.cjs +59 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -22
- package/dist/index.d.ts +3 -3
- package/dist/index.js +33 -75
- package/dist/index.js.map +1 -1
- package/dist/{runtime-7Xh9z3dw.js → runtime-DUW6tIJ1.js} +454 -64
- package/dist/runtime-DUW6tIJ1.js.map +1 -0
- package/dist/{runtime-DVBwxFvX.cjs → runtime-Dvo2ru5A.cjs} +589 -73
- package/dist/runtime-Dvo2ru5A.cjs.map +1 -0
- package/dist/testing.cjs +6 -6
- 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 +1 -1
- package/src/ai/AgentConfigInspectorFactory.ts +2 -2
- package/src/ai/AgentMessageConfigNormalizerFactory.ts +3 -3
- package/src/ai/AiHost.ts +4 -2
- package/src/ai/CallableToolConfig.ts +28 -3
- package/src/authoring/defineNode.types.ts +35 -9
- package/src/authoring/index.ts +1 -0
- package/src/bootstrap/index.ts +6 -1
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +4 -3
- package/src/bootstrap/runtime/EngineRuntimeRegistration.types.ts +3 -0
- package/src/contracts/CodemationTelemetryAttributeNames.ts +12 -0
- package/src/contracts/CodemationTelemetryMetricNames.ts +7 -0
- package/src/contracts/CostCatalogContract.ts +16 -0
- package/src/contracts/CostTrackingTelemetryContract.ts +47 -0
- package/src/contracts/GenAiTelemetryAttributeNames.ts +10 -0
- package/src/contracts/NoOpCostTrackingTelemetry.ts +16 -0
- package/src/contracts/NoOpCostTrackingTelemetryFactory.ts +9 -0
- package/src/contracts/NoOpExecutionTelemetry.ts +26 -0
- package/src/contracts/NoOpExecutionTelemetryFactory.ts +16 -0
- package/src/contracts/NoOpNodeExecutionTelemetry.ts +15 -0
- package/src/contracts/NoOpTelemetryArtifactReference.ts +9 -0
- package/src/contracts/NoOpTelemetrySpanScope.ts +22 -0
- package/src/contracts/index.ts +3 -1
- package/src/contracts/{itemValue.ts → itemExpr.ts} +31 -32
- package/src/contracts/params.ts +10 -0
- package/src/contracts/runTypes.ts +4 -1
- package/src/contracts/runtimeTypes.ts +7 -0
- package/src/contracts/telemetryTypes.ts +105 -0
- package/src/contracts/workflowTypes.ts +20 -2
- package/src/events/EventPublishingWorkflowExecutionRepository.ts +1 -1
- package/src/execution/CatalogBackedCostTrackingTelemetry.ts +81 -0
- package/src/execution/CatalogBackedCostTrackingTelemetryFactory.ts +12 -0
- package/src/execution/DefaultExecutionContextFactory.ts +23 -0
- package/src/execution/ExecutionTelemetryCostTrackingDecoratorFactory.ts +84 -0
- package/src/execution/{ItemValueResolver.ts → ItemExprResolver.ts} +5 -5
- package/src/execution/NodeActivationRequestComposer.ts +1 -0
- package/src/execution/NodeExecutionSnapshotFactory.ts +2 -0
- package/src/execution/NodeExecutor.ts +6 -6
- package/src/execution/StaticCostCatalog.ts +22 -0
- package/src/execution/WorkflowRunExecutionContextFactory.ts +2 -0
- package/src/execution/index.ts +5 -1
- package/src/index.ts +1 -1
- package/src/orchestration/NodeExecutionRequestHandlerService.ts +1 -0
- package/src/orchestration/RunContinuationService.ts +4 -0
- package/src/orchestration/RunStartService.ts +2 -0
- package/src/policies/storage/RunPolicySnapshotFactory.ts +9 -0
- package/src/runStorage/InMemoryRunData.ts +9 -5
- package/src/runStorage/InMemoryWorkflowExecutionRepository.ts +4 -2
- package/src/types/index.ts +7 -1
- package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +1 -1
- package/dist/bootstrap-DVL2ue5v.cjs.map +0 -1
- package/dist/bootstrap-DdeiJ8cd.js.map +0 -1
- package/dist/runtime-7Xh9z3dw.js.map +0 -1
- package/dist/runtime-DVBwxFvX.cjs.map +0 -1
- package/dist/workflowActivationPolicy-6V3OJD3N.cjs.map +0 -1
- package/dist/workflowActivationPolicy-Td9HTOuD.js.map +0 -1
|
@@ -274,6 +274,190 @@ declare class CredentialUnboundError extends Error {
|
|
|
274
274
|
private static createMessage;
|
|
275
275
|
}
|
|
276
276
|
//#endregion
|
|
277
|
+
//#region src/contracts/CostTrackingTelemetryContract.d.ts
|
|
278
|
+
type CostTrackingComponent = "chat" | "ocr" | "rag";
|
|
279
|
+
declare const CostTrackingTelemetryMetricNames: {
|
|
280
|
+
readonly usage: "codemation.cost.usage";
|
|
281
|
+
readonly estimatedCost: "codemation.cost.estimated";
|
|
282
|
+
};
|
|
283
|
+
declare const CostTrackingTelemetryAttributeNames: {
|
|
284
|
+
readonly component: "cost.component";
|
|
285
|
+
readonly provider: "cost.provider";
|
|
286
|
+
readonly operation: "cost.operation";
|
|
287
|
+
readonly pricingKey: "cost.pricing_key";
|
|
288
|
+
readonly usageUnit: "cost.usage_unit";
|
|
289
|
+
readonly currency: "cost.currency";
|
|
290
|
+
readonly currencyScale: "cost.currency_scale";
|
|
291
|
+
readonly estimateKind: "cost.estimate_kind";
|
|
292
|
+
};
|
|
293
|
+
interface CostTrackingUsageRecord {
|
|
294
|
+
readonly component: CostTrackingComponent;
|
|
295
|
+
readonly provider: string;
|
|
296
|
+
readonly operation: string;
|
|
297
|
+
readonly pricingKey: string;
|
|
298
|
+
readonly usageUnit: string;
|
|
299
|
+
readonly quantity: number;
|
|
300
|
+
readonly modelName?: string;
|
|
301
|
+
readonly attributes?: TelemetryAttributes;
|
|
302
|
+
}
|
|
303
|
+
interface CostTrackingPriceQuote {
|
|
304
|
+
readonly currency: string;
|
|
305
|
+
readonly currencyScale: number;
|
|
306
|
+
readonly estimatedAmountMinor: number;
|
|
307
|
+
readonly estimateKind: "catalog";
|
|
308
|
+
}
|
|
309
|
+
interface CostTrackingTelemetry {
|
|
310
|
+
captureUsage(args: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
311
|
+
forScope(scope: TelemetryScope): CostTrackingTelemetry;
|
|
312
|
+
}
|
|
313
|
+
interface CostTrackingTelemetryFactory {
|
|
314
|
+
create(args: Readonly<{
|
|
315
|
+
telemetry: ExecutionTelemetry;
|
|
316
|
+
}>): CostTrackingTelemetry;
|
|
317
|
+
}
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/contracts/NoOpTelemetryArtifactReference.d.ts
|
|
320
|
+
declare class NoOpTelemetryArtifactReference {
|
|
321
|
+
static readonly value: TelemetryArtifactReference;
|
|
322
|
+
}
|
|
323
|
+
//#endregion
|
|
324
|
+
//#region src/contracts/NoOpTelemetrySpanScope.d.ts
|
|
325
|
+
declare class NoOpTelemetrySpanScope {
|
|
326
|
+
static readonly value: TelemetrySpanScope;
|
|
327
|
+
}
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region src/contracts/NoOpNodeExecutionTelemetry.d.ts
|
|
330
|
+
declare class NoOpNodeExecutionTelemetry {
|
|
331
|
+
static readonly value: NodeExecutionTelemetry;
|
|
332
|
+
}
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/contracts/NoOpExecutionTelemetry.d.ts
|
|
335
|
+
declare class NoOpExecutionTelemetry {
|
|
336
|
+
static readonly value: ExecutionTelemetry;
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region src/contracts/NoOpExecutionTelemetryFactory.d.ts
|
|
340
|
+
declare class NoOpExecutionTelemetryFactory implements ExecutionTelemetryFactory {
|
|
341
|
+
create(_: Readonly<{
|
|
342
|
+
runId: RunId;
|
|
343
|
+
workflowId: WorkflowId;
|
|
344
|
+
parent?: ParentExecutionRef;
|
|
345
|
+
policySnapshot?: PersistedRunPolicySnapshot;
|
|
346
|
+
}>): ExecutionTelemetry;
|
|
347
|
+
}
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/contracts/CodemationTelemetryAttributeNames.d.ts
|
|
350
|
+
declare class CodemationTelemetryAttributeNames {
|
|
351
|
+
static readonly workflowId = "codemation.workflow.id";
|
|
352
|
+
static readonly runId = "codemation.run.id";
|
|
353
|
+
static readonly nodeId = "codemation.node.id";
|
|
354
|
+
static readonly activationId = "codemation.activation.id";
|
|
355
|
+
static readonly nodeType = "codemation.node.type";
|
|
356
|
+
static readonly nodeRole = "codemation.node.role";
|
|
357
|
+
static readonly workflowFolder = "codemation.workflow.folder";
|
|
358
|
+
static readonly connectionInvocationId = "codemation.connection.invocation_id";
|
|
359
|
+
static readonly toolName = "codemation.tool.name";
|
|
360
|
+
static readonly traceParentRunId = "codemation.parent.run.id";
|
|
361
|
+
}
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/contracts/GenAiTelemetryAttributeNames.d.ts
|
|
364
|
+
declare class GenAiTelemetryAttributeNames {
|
|
365
|
+
static readonly operationName = "gen_ai.operation.name";
|
|
366
|
+
static readonly requestModel = "gen_ai.request.model";
|
|
367
|
+
static readonly usageInputTokens = "gen_ai.usage.input_tokens";
|
|
368
|
+
static readonly usageOutputTokens = "gen_ai.usage.output_tokens";
|
|
369
|
+
static readonly usageTotalTokens = "gen_ai.usage.total_tokens";
|
|
370
|
+
static readonly usageCacheReadInputTokens = "gen_ai.usage.cache_read.input_tokens";
|
|
371
|
+
static readonly usageCacheCreationInputTokens = "gen_ai.usage.cache_creation.input_tokens";
|
|
372
|
+
static readonly usageReasoningTokens = "codemation.gen_ai.usage.reasoning_tokens";
|
|
373
|
+
}
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region src/contracts/CodemationTelemetryMetricNames.d.ts
|
|
376
|
+
declare class CodemationTelemetryMetricNames {
|
|
377
|
+
static readonly agentTurns = "codemation.ai.turns";
|
|
378
|
+
static readonly agentToolCalls = "codemation.ai.tool_calls";
|
|
379
|
+
static readonly gmailMessagesEmitted = "codemation.gmail.messages_emitted";
|
|
380
|
+
static readonly gmailAttachments = "codemation.gmail.attachments";
|
|
381
|
+
static readonly gmailAttachmentBytes = "codemation.gmail.attachment_bytes";
|
|
382
|
+
}
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region src/contracts/telemetryTypes.d.ts
|
|
385
|
+
type TelemetryAttributePrimitive = string | number | boolean | null;
|
|
386
|
+
interface TelemetryAttributes {
|
|
387
|
+
readonly [key: string]: TelemetryAttributePrimitive | undefined;
|
|
388
|
+
}
|
|
389
|
+
interface TelemetryMetricRecord {
|
|
390
|
+
readonly name: string;
|
|
391
|
+
readonly value: number;
|
|
392
|
+
readonly unit?: string;
|
|
393
|
+
readonly attributes?: TelemetryAttributes;
|
|
394
|
+
}
|
|
395
|
+
interface TelemetrySpanEventRecord {
|
|
396
|
+
readonly name: string;
|
|
397
|
+
readonly occurredAt?: Date;
|
|
398
|
+
readonly attributes?: TelemetryAttributes;
|
|
399
|
+
}
|
|
400
|
+
interface TelemetryArtifactAttachment {
|
|
401
|
+
readonly kind: string;
|
|
402
|
+
readonly contentType: string;
|
|
403
|
+
readonly previewText?: string;
|
|
404
|
+
readonly previewJson?: JsonValue;
|
|
405
|
+
readonly payloadText?: string;
|
|
406
|
+
readonly payloadJson?: JsonValue;
|
|
407
|
+
readonly bytes?: number;
|
|
408
|
+
readonly truncated?: boolean;
|
|
409
|
+
readonly expiresAt?: Date;
|
|
410
|
+
}
|
|
411
|
+
interface TelemetryArtifactReference {
|
|
412
|
+
readonly artifactId: string;
|
|
413
|
+
readonly traceId?: string;
|
|
414
|
+
readonly spanId?: string;
|
|
415
|
+
}
|
|
416
|
+
interface TelemetrySpanEnd {
|
|
417
|
+
readonly status?: "ok" | "error";
|
|
418
|
+
readonly statusMessage?: string;
|
|
419
|
+
readonly endedAt?: Date;
|
|
420
|
+
readonly attributes?: TelemetryAttributes;
|
|
421
|
+
}
|
|
422
|
+
interface TelemetryChildSpanStart {
|
|
423
|
+
readonly name: string;
|
|
424
|
+
readonly kind?: "internal" | "client";
|
|
425
|
+
readonly startedAt?: Date;
|
|
426
|
+
readonly attributes?: TelemetryAttributes;
|
|
427
|
+
}
|
|
428
|
+
interface TelemetryScope {
|
|
429
|
+
readonly traceId?: string;
|
|
430
|
+
readonly spanId?: string;
|
|
431
|
+
readonly costTracking?: CostTrackingTelemetry;
|
|
432
|
+
addSpanEvent(args: TelemetrySpanEventRecord): Promise<void> | void;
|
|
433
|
+
recordMetric(args: TelemetryMetricRecord): Promise<void> | void;
|
|
434
|
+
attachArtifact(args: TelemetryArtifactAttachment): Promise<TelemetryArtifactReference> | TelemetryArtifactReference;
|
|
435
|
+
}
|
|
436
|
+
interface TelemetrySpanScope extends TelemetryScope {
|
|
437
|
+
readonly traceId: string;
|
|
438
|
+
readonly spanId: string;
|
|
439
|
+
end(args?: TelemetrySpanEnd): Promise<void> | void;
|
|
440
|
+
}
|
|
441
|
+
interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope {
|
|
442
|
+
startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope;
|
|
443
|
+
}
|
|
444
|
+
interface ExecutionTelemetry extends TelemetryScope {
|
|
445
|
+
readonly traceId: string;
|
|
446
|
+
readonly spanId: string;
|
|
447
|
+
forNode(args: Readonly<{
|
|
448
|
+
nodeId: NodeId;
|
|
449
|
+
activationId: NodeActivationId;
|
|
450
|
+
}>): NodeExecutionTelemetry;
|
|
451
|
+
}
|
|
452
|
+
interface ExecutionTelemetryFactory {
|
|
453
|
+
create(args: Readonly<{
|
|
454
|
+
runId: RunId;
|
|
455
|
+
workflowId: WorkflowId;
|
|
456
|
+
parent?: ParentExecutionRef;
|
|
457
|
+
policySnapshot?: PersistedRunPolicySnapshot;
|
|
458
|
+
}>): ExecutionTelemetry;
|
|
459
|
+
}
|
|
460
|
+
//#endregion
|
|
277
461
|
//#region src/contracts/runTypes.d.ts
|
|
278
462
|
interface RunExecutionOptions {
|
|
279
463
|
/** Run-intent override: force the inline scheduler and bypass node-level offload decisions. */
|
|
@@ -356,6 +540,7 @@ interface NodeExecutionError {
|
|
|
356
540
|
message: string;
|
|
357
541
|
name?: string;
|
|
358
542
|
stack?: string;
|
|
543
|
+
details?: JsonValue;
|
|
359
544
|
}
|
|
360
545
|
interface NodeExecutionSnapshot {
|
|
361
546
|
runId: RunId;
|
|
@@ -523,7 +708,8 @@ interface RunPruneCandidate {
|
|
|
523
708
|
}
|
|
524
709
|
interface WorkflowExecutionPruneRepository {
|
|
525
710
|
listRunsOlderThan(args: Readonly<{
|
|
526
|
-
|
|
711
|
+
nowIso: string;
|
|
712
|
+
defaultRetentionSeconds: number;
|
|
527
713
|
limit?: number;
|
|
528
714
|
}>): Promise<ReadonlyArray<RunPruneCandidate>>;
|
|
529
715
|
}
|
|
@@ -736,6 +922,7 @@ interface ExecutionContext {
|
|
|
736
922
|
now: () => Date;
|
|
737
923
|
data: RunDataSnapshot;
|
|
738
924
|
nodeState?: NodeExecutionStatePublisher;
|
|
925
|
+
telemetry: ExecutionTelemetry;
|
|
739
926
|
binary: ExecutionBinaryService;
|
|
740
927
|
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
741
928
|
}
|
|
@@ -744,11 +931,13 @@ interface ExecutionContextFactory {
|
|
|
744
931
|
runId: RunId;
|
|
745
932
|
workflowId: WorkflowId;
|
|
746
933
|
parent?: ParentExecutionRef;
|
|
934
|
+
policySnapshot?: PersistedRunPolicySnapshot;
|
|
747
935
|
subworkflowDepth: number;
|
|
748
936
|
engineMaxNodeActivations: number;
|
|
749
937
|
engineMaxSubworkflowDepth: number;
|
|
750
938
|
data: RunDataSnapshot;
|
|
751
939
|
nodeState?: NodeExecutionStatePublisher;
|
|
940
|
+
telemetry?: ExecutionTelemetry;
|
|
752
941
|
getCredential<TSession = unknown>(slotKey: string): Promise<TSession>;
|
|
753
942
|
}): ExecutionContext;
|
|
754
943
|
}
|
|
@@ -756,6 +945,7 @@ interface NodeExecutionContext<TConfig extends NodeConfigBase = NodeConfigBase>
|
|
|
756
945
|
nodeId: NodeId;
|
|
757
946
|
activationId: NodeActivationId;
|
|
758
947
|
config: TConfig;
|
|
948
|
+
telemetry: NodeExecutionTelemetry;
|
|
759
949
|
binary: NodeBinaryAttachmentService;
|
|
760
950
|
}
|
|
761
951
|
interface TriggerSetupContext<TConfig extends TriggerNodeConfig<any, any> = TriggerNodeConfig<any, any>, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState<TConfig>> extends ExecutionContext {
|
|
@@ -949,6 +1139,7 @@ interface EngineDeps {
|
|
|
949
1139
|
activationScheduler: NodeActivationScheduler;
|
|
950
1140
|
runDataFactory: RunDataFactory;
|
|
951
1141
|
executionContextFactory: ExecutionContextFactory;
|
|
1142
|
+
executionTelemetryFactory?: ExecutionTelemetryFactory;
|
|
952
1143
|
nodeExecutor: NodeExecutor;
|
|
953
1144
|
eventBus?: RunEventBus;
|
|
954
1145
|
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
@@ -990,6 +1181,9 @@ interface ExponentialRetryPolicySpec {
|
|
|
990
1181
|
//#region src/contracts/workflowTypes.d.ts
|
|
991
1182
|
type WorkflowId = string;
|
|
992
1183
|
type NodeId = string;
|
|
1184
|
+
type NodeIdRef<TJson = unknown> = NodeId & Readonly<{
|
|
1185
|
+
__codemationNodeJson?: TJson;
|
|
1186
|
+
}>;
|
|
993
1187
|
type OutputPortKey = string;
|
|
994
1188
|
type InputPortKey = string;
|
|
995
1189
|
type PersistedTokenId = string;
|
|
@@ -1124,6 +1318,7 @@ interface NodeRef {
|
|
|
1124
1318
|
kind: NodeKind;
|
|
1125
1319
|
name?: string;
|
|
1126
1320
|
}
|
|
1321
|
+
declare function nodeRef<TJson>(nodeId: NodeId): NodeIdRef<TJson>;
|
|
1127
1322
|
type PairedItemRef = Readonly<{
|
|
1128
1323
|
nodeId: NodeId;
|
|
1129
1324
|
output: OutputPortKey;
|
|
@@ -1169,8 +1364,8 @@ interface ParentExecutionRef {
|
|
|
1169
1364
|
}
|
|
1170
1365
|
interface RunDataSnapshot {
|
|
1171
1366
|
getOutputs(nodeId: NodeId): NodeOutputs | undefined;
|
|
1172
|
-
getOutputItems(nodeId: NodeId
|
|
1173
|
-
getOutputItem(nodeId: NodeId
|
|
1367
|
+
getOutputItems<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, output?: OutputPortKey): Items<TJson>;
|
|
1368
|
+
getOutputItem<TJson = unknown>(nodeId: NodeId | NodeIdRef<TJson>, itemIndex: number, output?: OutputPortKey): Item<TJson> | undefined;
|
|
1174
1369
|
}
|
|
1175
1370
|
interface MutableRunData extends RunDataSnapshot {
|
|
1176
1371
|
setOutputs(nodeId: NodeId, outputs: NodeOutputs): void;
|
|
@@ -1216,10 +1411,16 @@ interface WorkflowStoragePolicyDecisionArgs {
|
|
|
1216
1411
|
interface WorkflowPrunePolicySpec {
|
|
1217
1412
|
readonly runDataRetentionSeconds?: number;
|
|
1218
1413
|
readonly binaryRetentionSeconds?: number;
|
|
1414
|
+
readonly telemetrySpanRetentionSeconds?: number;
|
|
1415
|
+
readonly telemetryArtifactRetentionSeconds?: number;
|
|
1416
|
+
readonly telemetryMetricRetentionSeconds?: number;
|
|
1219
1417
|
}
|
|
1220
1418
|
interface PersistedRunPolicySnapshot {
|
|
1221
1419
|
readonly retentionSeconds?: number;
|
|
1222
1420
|
readonly binaryRetentionSeconds?: number;
|
|
1421
|
+
readonly telemetrySpanRetentionSeconds?: number;
|
|
1422
|
+
readonly telemetryArtifactRetentionSeconds?: number;
|
|
1423
|
+
readonly telemetryMetricRetentionSeconds?: number;
|
|
1223
1424
|
readonly storagePolicy: WorkflowStoragePolicyMode;
|
|
1224
1425
|
}
|
|
1225
1426
|
interface WorkflowErrorHandler {
|
|
@@ -1250,6 +1451,9 @@ type NodeErrorHandlerSpec = TypeToken<NodeErrorHandler> | NodeErrorHandler;
|
|
|
1250
1451
|
interface WorkflowPolicyRuntimeDefaults {
|
|
1251
1452
|
readonly retentionSeconds?: number;
|
|
1252
1453
|
readonly binaryRetentionSeconds?: number;
|
|
1454
|
+
readonly telemetrySpanRetentionSeconds?: number;
|
|
1455
|
+
readonly telemetryArtifactRetentionSeconds?: number;
|
|
1456
|
+
readonly telemetryMetricRetentionSeconds?: number;
|
|
1253
1457
|
readonly storagePolicy?: WorkflowStoragePolicyMode;
|
|
1254
1458
|
}
|
|
1255
1459
|
//#endregion
|
|
@@ -1271,9 +1475,9 @@ declare function isUnbrandedPortsEmissionShape(value: unknown): value is Readonl
|
|
|
1271
1475
|
*/
|
|
1272
1476
|
declare function getOriginIndexFromItem(item: Item): number | undefined;
|
|
1273
1477
|
//#endregion
|
|
1274
|
-
//#region src/contracts/
|
|
1275
|
-
declare const
|
|
1276
|
-
type
|
|
1478
|
+
//#region src/contracts/itemExpr.d.ts
|
|
1479
|
+
declare const ITEM_EXPR_BRAND: unique symbol;
|
|
1480
|
+
type ItemExprResolvedContext = Readonly<{
|
|
1277
1481
|
runId: RunId;
|
|
1278
1482
|
workflowId: WorkflowId;
|
|
1279
1483
|
nodeId: NodeId;
|
|
@@ -1283,28 +1487,33 @@ type ItemValueResolvedContext = Readonly<{
|
|
|
1283
1487
|
/**
|
|
1284
1488
|
* Context aligned with former {@link ItemInputMapperContext} — use **`data`** to read any completed upstream node.
|
|
1285
1489
|
*/
|
|
1286
|
-
type
|
|
1287
|
-
type
|
|
1490
|
+
type ItemExprContext = ItemExprResolvedContext;
|
|
1491
|
+
type ItemExprArgs<TItemJson = unknown> = Readonly<{
|
|
1288
1492
|
item: Item<TItemJson>;
|
|
1289
1493
|
itemIndex: number;
|
|
1290
1494
|
items: Items<TItemJson>;
|
|
1291
|
-
ctx:
|
|
1495
|
+
ctx: ItemExprContext;
|
|
1292
1496
|
}>;
|
|
1293
|
-
type
|
|
1294
|
-
type
|
|
1295
|
-
readonly [
|
|
1296
|
-
readonly fn:
|
|
1497
|
+
type ItemExprCallback<T, TItemJson = unknown> = (args: ItemExprArgs<TItemJson>) => T | Promise<T>;
|
|
1498
|
+
type ItemExpr<T, TItemJson = unknown> = Readonly<{
|
|
1499
|
+
readonly [ITEM_EXPR_BRAND]: true;
|
|
1500
|
+
readonly fn: ItemExprCallback<T, TItemJson>;
|
|
1297
1501
|
}>;
|
|
1298
|
-
declare function
|
|
1299
|
-
declare function
|
|
1502
|
+
declare function itemExpr<T, TItemJson = unknown>(fn: ItemExprCallback<T, TItemJson>): ItemExpr<T, TItemJson>;
|
|
1503
|
+
declare function isItemExpr<T, TItemJson = unknown>(value: unknown): value is ItemExpr<T, TItemJson>;
|
|
1300
1504
|
/**
|
|
1301
|
-
* Deep-resolves {@link
|
|
1505
|
+
* Deep-resolves {@link itemExpr} leaves. Returns a new graph (does not mutate the original config object).
|
|
1302
1506
|
*/
|
|
1303
|
-
declare function
|
|
1507
|
+
declare function resolveItemExprsInUnknown(value: unknown, args: ItemExprArgs, seen?: WeakSet<object>): Promise<unknown>;
|
|
1304
1508
|
/**
|
|
1305
|
-
* Clones runnable config (best-effort) so per-item {@link
|
|
1509
|
+
* Clones runnable config (best-effort) so per-item {@link itemExpr} resolution never mutates shared instances.
|
|
1306
1510
|
*/
|
|
1307
|
-
declare function
|
|
1511
|
+
declare function resolveItemExprsForExecution(config: unknown, nodeCtx: NodeExecutionContext, item: Item, itemIndex: number, items: Items): Promise<unknown | undefined>;
|
|
1512
|
+
//#endregion
|
|
1513
|
+
//#region src/contracts/params.d.ts
|
|
1514
|
+
type Expr<T, TItemJson = unknown> = ItemExpr<T, TItemJson>;
|
|
1515
|
+
type Param<T, TItemJson = unknown> = T | Expr<T, TItemJson>;
|
|
1516
|
+
type ParamDeep<T, TItemJson = unknown> = Expr<T, TItemJson> | (T extends readonly (infer U)[] ? ReadonlyArray<ParamDeep<U, TItemJson>> : never) | (T extends object ? { [K in keyof T]: ParamDeep<T[K], TItemJson> } : T);
|
|
1308
1517
|
//#endregion
|
|
1309
1518
|
//#region src/contracts/NoRetryPolicy.d.ts
|
|
1310
1519
|
declare class NoRetryPolicy implements NoneRetryPolicySpec {
|
|
@@ -1334,6 +1543,34 @@ declare class ExpRetryPolicy implements ExponentialRetryPolicySpec {
|
|
|
1334
1543
|
constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined);
|
|
1335
1544
|
}
|
|
1336
1545
|
//#endregion
|
|
1546
|
+
//#region src/contracts/CostCatalogContract.d.ts
|
|
1547
|
+
interface CostCatalogEntry {
|
|
1548
|
+
readonly component: CostTrackingUsageRecord["component"];
|
|
1549
|
+
readonly provider: string;
|
|
1550
|
+
readonly operation: string;
|
|
1551
|
+
readonly pricingKey: string;
|
|
1552
|
+
readonly usageUnit: string;
|
|
1553
|
+
readonly currency: string;
|
|
1554
|
+
readonly currencyScale: number;
|
|
1555
|
+
readonly pricePerUnitMinor: number;
|
|
1556
|
+
}
|
|
1557
|
+
interface CostCatalog {
|
|
1558
|
+
findEntry(args: CostTrackingUsageRecord): CostCatalogEntry | undefined;
|
|
1559
|
+
}
|
|
1560
|
+
//#endregion
|
|
1561
|
+
//#region src/contracts/NoOpCostTrackingTelemetry.d.ts
|
|
1562
|
+
declare class NoOpCostTrackingTelemetry implements CostTrackingTelemetry {
|
|
1563
|
+
captureUsage(_: CostTrackingUsageRecord): Promise<CostTrackingPriceQuote | undefined>;
|
|
1564
|
+
forScope(_: TelemetryScope): CostTrackingTelemetry;
|
|
1565
|
+
}
|
|
1566
|
+
//#endregion
|
|
1567
|
+
//#region src/contracts/NoOpCostTrackingTelemetryFactory.d.ts
|
|
1568
|
+
declare class NoOpCostTrackingTelemetryFactory implements CostTrackingTelemetryFactory {
|
|
1569
|
+
create(_: Readonly<{
|
|
1570
|
+
telemetry: ExecutionTelemetry;
|
|
1571
|
+
}>): CostTrackingTelemetry;
|
|
1572
|
+
}
|
|
1573
|
+
//#endregion
|
|
1337
1574
|
//#region src/contracts/executionPersistenceContracts.d.ts
|
|
1338
1575
|
/** Canonical id for persisted execution rows (activation or connection invocation). */
|
|
1339
1576
|
type ExecutionInstanceId = string;
|
|
@@ -1906,5 +2143,5 @@ declare class RunIntentService {
|
|
|
1906
2143
|
private createWebhookExecutionOptions;
|
|
1907
2144
|
}
|
|
1908
2145
|
//#endregion
|
|
1909
|
-
export {
|
|
1910
|
-
//# sourceMappingURL=RunIntentService-
|
|
2146
|
+
export { Expr as $, CredentialJsonRecord as $i, NodeExecutionContext as $n, RunCompletionNotifier as $r, RunIdFactory as $t, ExecutionInstanceDto as A, singleton as Aa, NoOpExecutionTelemetryFactory as Ai, RetryPolicySpec as An, WebhookTriggerRoutingDiagnostics as Ar, MutableRunData as At, RunSlotProjectionState as B, CostTrackingTelemetryMetricNames as Bi, ExecutableTriggerNode as Bn, NodeExecutionSnapshot as Br, NodeKind as Bt, BranchOutputGuard as C, inject as Ca, TelemetryScope as Ci, runnableNodeInputType as Cn, WorkflowSnapshotResolver as Cr, ItemBinary as Ct, RunFinishedAtFactory as D, instancePerContainerCachingFactory as Da, CodemationTelemetryMetricNames as Di, ExponentialRetryPolicySpec as Dn, WebhookInvocationMatch as Dr, JsonObject as Dt, ValidStepSequence as E, instanceCachingFactory as Ea, TelemetrySpanScope as Ei, triggerNodeSetupStateType as En, WebhookControlSignal as Er, JsonNonArray as Et, PersistedExecutionInstanceRecord as F, RunEvent as Fa, CostTrackingComponent as Fi, BinaryStorageStatResult as Fn, ConnectionInvocationRecord as Fr, NodeErrorHandler as Ft, WorkflowRunDetailDto as G, CredentialBinding as Gi, LiveWorkflowRepository as Gn, PersistedMutableRunState as Gr, OutputPortKey as Gt, WorkItemId as H, AnyCredentialType as Hi, ExecutionContext as Hn, NodeInputsByPort as Hr, NodeOutputs as Ht, PersistedRunSlotProjectionRecord as I, RunEventBus as Ia, CostTrackingPriceQuote as Ii, BinaryStorageWriteRequest as In, CurrentStateExecutionRequest as Ir, NodeErrorHandlerArgs as It, CostCatalog as J, CredentialHealth as Ji, NodeActivationReceipt as Jn, PersistedRunState as Jr, PersistedRunPolicySnapshot as Jt, NoOpCostTrackingTelemetryFactory as K, CredentialBindingKey as Ki, MultiInputNode as Kn, PersistedRunControlState as Kr, PairedItemRef as Kt, PersistedRunWorkItemKind as L, RunEventSubscription as La, CostTrackingTelemetry as Li, BinaryStorageWriteResult as Ln, EngineRunCounters as Lr, NodeErrorHandlerSpec as Lt, ExecutionPayloadPolicyFields as M, ENGINE_EXECUTION_LIMITS_DEFAULTS as Ma, NoOpNodeExecutionTelemetry as Mi, BinaryBody as Mn, WorkflowActivationPolicy as Mr, NodeConfigBase as Mt, PayloadStorageKind as N, EngineExecutionLimitsPolicy as Na, NoOpTelemetrySpanScope as Ni, BinaryStorage as Nn, ConnectionInvocationAppendArgs as Nr, NodeConnectionName as Nt, BatchId as O, predicateAwareClassFactory as Oa, GenAiTelemetryAttributeNames as Oi, FixedRetryPolicySpec as On, WebhookTriggerMatcher as Or, JsonPrimitive as Ot, PersistedExecutionInstanceKind as P, EngineExecutionLimitsPolicyConfig as Pa, NoOpTelemetryArtifactReference as Pi, BinaryStorageReadResult as Pn, ConnectionInvocationId as Pr, NodeDefinition as Pt, NoRetryPolicy as Q, CredentialInstanceRecord as Qi, NodeBinaryAttachmentService as Qn, PinnedNodeOutputsByPort as Qr, RunId as Qt, PersistedRunWorkItemRecord as R, CostTrackingTelemetryAttributeNames as Ri, EngineDeps as Rn, ExecutionFrontierPlan as Rr, NodeId as Rt, BranchMoreArgs as S, delay as Sa, TelemetryMetricRecord as Si, nodeRef as Sn, WorkflowSnapshotFactory as Sr, Item as St, StepSequenceOutput as T, injectable as Ta, TelemetrySpanEventRecord as Ti, triggerNodeOutputType as Tn, TriggerInstanceId as Tr, JsonArray as Tt, WorkItemStatus as U, CredentialAdvancedSectionPresentation as Ui, ExecutionContextFactory as Un, PendingNodeExecution as Ur, NodeRef as Ut, SlotExecutionStateDto as V, CostTrackingUsageRecord as Vi, ExecutionBinaryService as Vn, NodeExecutionStatus as Vr, NodeOffloadPolicy as Vt, WorkflowDetailSelectionState as W, CredentialAuthDefinition as Wi, ItemNode as Wn, PersistedMutableNodeState as Wr, NodeSchedulerDecision as Wt, ExpRetryPolicy as X, CredentialHealthTester as Xi, NodeActivationRequestBase as Xn, PersistedWorkflowSnapshotNode as Xr, RunDataFactory as Xt, CostCatalogEntry as Y, CredentialHealthStatus as Yi, NodeActivationRequest as Yn, PersistedWorkflowSnapshot as Yr, PersistedTokenId as Yt, RetryPolicy as Z, CredentialInstanceId as Zi, NodeActivationScheduler as Zn, PersistedWorkflowTokenRegistryLike as Zr, RunDataSnapshot as Zt, ChainCursor as _, InjectionToken$1 as _a, TelemetryArtifactAttachment as _i, WorkflowStoragePolicyDecisionArgs as _n, TriggerTestItemsContext as _r, BinaryAttachment as _t, RunTerminalPersistenceCoordinator as a, CredentialSessionFactoryArgs as aa, RunResult as ai, TriggerNodeSetupState as an, NodeResolver as ar, ItemExprContext as at, AnyTriggerNodeConfig as b, TypeToken as ba, TelemetryAttributes as bi, WorkflowStoragePolicySpec as bn, WorkflowRunnerResolver as br, ExecutionMode as bt, EngineExecutionLimitsPolicyFactory as c, CredentialType as ca, RunStopCondition as ci, WorkflowErrorContext as cn, RunnableNode as cr, itemExpr as ct, DefaultWorkflowGraphFactory as d, CredentialTypeRegistry as da, WorkflowExecutionListingRepository as di, WorkflowGraph as dn, TriggerCleanupHandle as dr, getOriginIndexFromItem as dt, CredentialMaterialSourceKind as ea, RunCurrentState as ei, RunnableNodeConfig as en, NodeExecutionRequest as er, Param as et, WorkflowExecutableNodeClassifierFactory as f, CredentialUnboundError as fa, WorkflowExecutionPruneRepository as fi, WorkflowGraphFactory as fn, TriggerNode as fr, PortsEmission as ft, WorkflowBuilder as g, Disposable as ga, NodeExecutionTelemetry as gi, WorkflowPrunePolicySpec as gn, TriggerSetupStateRepository as gr, ActivationIdFactory as gt, ConnectionInvocationIdFactory as h, DependencyContainer$1 as ha, ExecutionTelemetryFactory as hi, WorkflowPolicyRuntimeDefaults as hn, TriggerSetupStateFor as hr, isUnbrandedPortsEmissionShape as ht, WorkflowPolicyErrorServices as i, CredentialSessionFactory as ia, RunQueueEntry as ii, TriggerNodeOutputJson as in, NodeExecutor as ir, ItemExprCallback as it, ExecutionInstanceId as j, CoreTokens as ja, NoOpExecutionTelemetry as ji, BinaryAttachmentCreateRequest as jn, AllWorkflowsActiveWorkflowActivationPolicy as jr, NodeActivationId as jt, ConnectionInvocationKind as k, registry as ka, CodemationTelemetryAttributeNames as ki, NoneRetryPolicySpec as kn, WebhookTriggerResolution as kr, JsonValue as kt, WorkflowSnapshotCodec as l, CredentialTypeDefinition as la, RunSummary as li, WorkflowErrorHandler as ln, RunnableNodeExecuteArgs as lr, resolveItemExprsForExecution as lt, ConnectionNodeIdFactory as m, Container as ma, ExecutionTelemetry as mi, WorkflowNodeConnection as mn, TriggerSetupContext as mr, isPortsEmission as mt, InMemoryLiveWorkflowRepository as n, CredentialOAuth2ScopesFromPublicConfig as na, RunExecutionOptions as ni, RunnableNodeOutputJson as nn, NodeExecutionScheduler as nr, ItemExpr as nt, WorkflowStoragePolicyEvaluator as o, CredentialSessionService as oa, RunStateResetRequest as oi, UpstreamRefPlaceholder as on, PersistedTriggerSetupState as or, ItemExprResolvedContext as ot, WorkflowExecutableNodeClassifier as p, OAuth2ProviderFromPublicConfig as pa, WorkflowExecutionRepository as pi, WorkflowId as pn, TriggerRuntimeDiagnostics as pr, emitPorts as pt, NoOpCostTrackingTelemetry as q, CredentialFieldSchema as qi, NodeActivationContinuation as qn, PersistedRunSchedulingState as qr, ParentExecutionRef as qt, EngineWorkflowRunnerService as r, CredentialRequirement as ra, RunPruneCandidate as ri, TriggerNodeConfig as rn, NodeExecutionStatePublisher as rr, ItemExprArgs as rt, RunPolicySnapshotFactory as s, CredentialSetupStatus as sa, RunStatus as si, WorkflowDefinition as sn, PreparedNodeActivationDispatch as sr, isItemExpr as st, RunIntentService as t, CredentialOAuth2AuthDefinition as ta, RunEventPublisherDeps as ti, RunnableNodeInputJson as tn, NodeExecutionRequestHandler as tr, ParamDeep as tt, Engine as u, CredentialTypeId as ua, WebhookRunResult as ui, WorkflowErrorHandlerSpec as un, TestableTriggerNode as ur, resolveItemExprsInUnknown as ut, WhenBuilder as v, Lifecycle as va, TelemetryArtifactReference as vi, WorkflowStoragePolicyMode as vn, WorkflowNodeInstanceFactory as vr, BinaryPreviewKind as vt, BranchStepsArg as w, injectAll as wa, TelemetrySpanEnd as wi, runnableNodeOutputType as wn, HttpMethod as wr, Items as wt, BooleanWhenOverloads as x, container$1 as xa, TelemetryChildSpanStart as xi, branchRef as xn, WorkflowRunnerService as xr, InputPortKey as xt, AnyRunnableNodeConfig as y, RegistrationOptions as ya, TelemetryAttributePrimitive as yi, WorkflowStoragePolicyResolver as yn, WorkflowRepository as yr, Edge as yt, RunRevision as z, CostTrackingTelemetryFactory as zi, EngineHost as zn, NodeExecutionError as zr, NodeIdRef as zt };
|
|
2147
|
+
//# sourceMappingURL=RunIntentService-BqhmdoA1.d.ts.map
|