@codemation/core 0.6.0 → 0.7.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 +9 -0
- package/dist/{EngineRuntimeRegistration.types-Dm129RJ6.d.ts → EngineRuntimeRegistration.types-_M7KFD3D.d.ts} +2 -2
- package/dist/{EngineWorkflowRunnerService-Bf88QtwB.d.cts → EngineWorkflowRunnerService-D0Cwngv7.d.cts} +2 -2
- package/dist/{InMemoryRunDataFactory-Dyl4p2s8.d.cts → InMemoryRunDataFactory-BIWx6e02.d.cts} +6 -6
- package/dist/{RunIntentService-B1Y3v1H6.d.cts → RunIntentService-5k0p-J67.d.cts} +8 -4
- package/dist/{RunIntentService-BDiodxhf.d.ts → RunIntentService-CuXAIO6_.d.ts} +29 -20
- package/dist/bootstrap/index.cjs +2 -2
- package/dist/bootstrap/index.d.cts +5 -5
- package/dist/bootstrap/index.d.ts +3 -3
- package/dist/bootstrap/index.js +2 -2
- package/dist/{bootstrap-DdeiJ8cd.js → bootstrap-BhYxSivA.js} +3 -3
- package/dist/bootstrap-BhYxSivA.js.map +1 -0
- package/dist/{bootstrap-DVL2ue5v.cjs → bootstrap-D-TDU9Lu.cjs} +3 -3
- package/dist/bootstrap-D-TDU9Lu.cjs.map +1 -0
- package/dist/{index-C2af8ssM.d.ts → index-BnJ7_IrO.d.ts} +11 -10
- package/dist/index.cjs +16 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -21
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/{runtime-DVBwxFvX.cjs → runtime-3YVDd2vY.cjs} +42 -42
- package/dist/runtime-3YVDd2vY.cjs.map +1 -0
- package/dist/{runtime-7Xh9z3dw.js → runtime-CJnObwsU.js} +33 -33
- package/dist/runtime-CJnObwsU.js.map +1 -0
- package/dist/testing.cjs +2 -2
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +2 -2
- package/package.json +1 -1
- package/src/ai/AgentConfigInspectorFactory.ts +2 -2
- package/src/ai/AgentMessageConfigNormalizerFactory.ts +3 -3
- package/src/ai/AiHost.ts +2 -2
- package/src/authoring/defineNode.types.ts +35 -9
- package/src/authoring/index.ts +1 -0
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +3 -3
- package/src/contracts/index.ts +2 -1
- package/src/contracts/{itemValue.ts → itemExpr.ts} +31 -32
- package/src/contracts/params.ts +10 -0
- package/src/contracts/workflowTypes.ts +11 -2
- package/src/execution/{ItemValueResolver.ts → ItemExprResolver.ts} +5 -5
- package/src/execution/NodeExecutor.ts +6 -6
- package/src/execution/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/runStorage/InMemoryRunData.ts +9 -5
- package/src/types/index.ts +2 -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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $n as NodeExecutionStatePublisher, $r as RunPruneCandidate, Ai as CredentialType, An as BinaryStorageReadResult, At as NodeDefinition, Bt as NodeSchedulerDecision, Cr as WebhookInvocationMatch, Di as CredentialSessionFactoryArgs, Dt as NodeActivationId, En as RetryPolicySpec, Er as WebhookTriggerRoutingDiagnostics, Et as MutableRunData, Gn as NodeActivationRequest, Hi as TypeToken, Ir as NodeExecutionSnapshot, Jn as NodeBinaryAttachmentService, Jt as RunId, Kr as PersistedWorkflowSnapshotNode, Kt as RunDataFactory, Ln as ExecutionBinaryService, Lt as NodeOffloadPolicy, Mi as CredentialTypeId, Nn as BinaryStorageWriteResult, Nr as EngineRunCounters, Oi as CredentialSessionService, On as BinaryBody, Or as WorkflowActivationPolicy, Ot as NodeConfigBase, Pn as EngineDeps, Pt as NodeId, Qn as NodeExecutionScheduler, Rn as ExecutionContext, Rt as NodeOutputs, Ti as CredentialRequirement, Tt as JsonValue, Un as NodeActivationContinuation, Ur as PersistedRunSchedulingState, Ut as ParentExecutionRef, Wr as PersistedRunState, Xn as NodeExecutionRequest, Xt as RunnableNodeConfig, Y as Expr, Yn as NodeExecutionContext, Z as ParamDeep, Zt as RunnableNodeInputJson, aa as RunEventSubscription, ai as RunSummary, br as HttpMethod, bt as Items, ci as WorkflowExecutionPruneRepository, gi as CredentialHealth, gt as ExecutionMode, hi as CredentialFieldSchema, hr as WorkflowRepository, ia as RunEventBus, ji as CredentialTypeDefinition, jn as BinaryStorageStatResult, kn as BinaryStorage, kt as NodeConnectionName, l as WorkflowSnapshotCodec, li as WorkflowExecutionRepository, ln as WorkflowId, mr as WorkflowNodeInstanceFactory, pt as BinaryAttachment, qn as NodeActivationScheduler, qt as RunDataSnapshot, ra as RunEvent, rn as WorkflowDefinition, rr as PreparedNodeActivationDispatch, si as WorkflowExecutionListingRepository, ta as EngineExecutionLimitsPolicy, tr as NodeResolver, u as Engine, ui as AnyCredentialType, vt as Item, wr as WebhookTriggerMatcher, xi as CredentialJsonRecord, zn as ExecutionContextFactory } from "./RunIntentService-CuXAIO6_.js";
|
|
2
2
|
import { ZodType, input, output, z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/workflowSnapshots/MissingRuntimeFallbacksFactory.d.ts
|
|
@@ -81,11 +81,11 @@ declare class InProcessRetryRunner {
|
|
|
81
81
|
private static assertMultiplier;
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
|
-
//#region src/execution/
|
|
84
|
+
//#region src/execution/ItemExprResolver.d.ts
|
|
85
85
|
/**
|
|
86
|
-
* Resolves {@link import("../contracts/
|
|
86
|
+
* Resolves {@link import("../contracts/itemExpr").ItemExpr} leaves on runnable config before {@link RunnableNode.execute}.
|
|
87
87
|
*/
|
|
88
|
-
declare class
|
|
88
|
+
declare class ItemExprResolver {
|
|
89
89
|
resolveConfigForItem<TConfig$1 extends RunnableNodeConfig<any, any>>(ctx: NodeExecutionContext<TConfig$1>, item: Item, itemIndex: number, items: ReadonlyArray<Item>): Promise<NodeExecutionContext<TConfig$1>>;
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
@@ -118,9 +118,9 @@ declare class NodeExecutor {
|
|
|
118
118
|
private readonly retryRunner;
|
|
119
119
|
private readonly fanInMerger;
|
|
120
120
|
private readonly outputNormalizer;
|
|
121
|
-
private readonly
|
|
121
|
+
private readonly itemExprResolver;
|
|
122
122
|
private readonly outputBehaviorResolver;
|
|
123
|
-
constructor(nodeInstanceFactory: WorkflowNodeInstanceFactory, retryRunner: InProcessRetryRunner,
|
|
123
|
+
constructor(nodeInstanceFactory: WorkflowNodeInstanceFactory, retryRunner: InProcessRetryRunner, itemExprResolver?: ItemExprResolver, outputBehaviorResolver?: RunnableOutputBehaviorResolver);
|
|
124
124
|
execute(request: NodeActivationRequest): Promise<NodeOutputs>;
|
|
125
125
|
private executeMultiInputActivation;
|
|
126
126
|
private executeSingleInputNode;
|
|
@@ -188,12 +188,13 @@ type DefineNodeExecuteArgs<TConfig$1 extends CredentialJsonRecord, TInputJson> =
|
|
|
188
188
|
config: TConfig$1;
|
|
189
189
|
}>>;
|
|
190
190
|
}>;
|
|
191
|
+
type DefinedNodeConfigInput<TConfigResolved extends CredentialJsonRecord, TItemJson> = ParamDeep<TConfigResolved, TItemJson>;
|
|
191
192
|
interface DefinedNode<TKey$1 extends string, TConfig$1 extends CredentialJsonRecord, TInputJson, TOutputJson, _TBindings extends DefinedNodeCredentialBindings | undefined = undefined> {
|
|
192
193
|
readonly kind: "defined-node";
|
|
193
194
|
readonly key: TKey$1;
|
|
194
195
|
readonly title: string;
|
|
195
196
|
readonly description?: string;
|
|
196
|
-
create(config: TConfig$1, name?: string, id?: string): RunnableNodeConfig<TInputJson, TOutputJson>;
|
|
197
|
+
create<TConfigItemJson = TInputJson>(config: DefinedNodeConfigInput<TConfig$1, TConfigItemJson>, name?: string, id?: string): RunnableNodeConfig<TInputJson, TOutputJson>;
|
|
197
198
|
register(context: {
|
|
198
199
|
registerNode<TValue>(token: TypeToken<TValue>, implementation?: TypeToken<TValue>): void;
|
|
199
200
|
}): void;
|
|
@@ -420,7 +421,7 @@ type AgentMessageLine<TInputJson = unknown> = AgentMessageDto | AgentMessageTemp
|
|
|
420
421
|
* Message list for an agent. Prefer a **plain array** of `{ role, content }` (optionally with function `content` for templates).
|
|
421
422
|
* Use the object form only when you need `buildMessages` to append messages after optional `prompt` lines.
|
|
422
423
|
*/
|
|
423
|
-
type AgentMessageConfig<TInputJson = unknown> =
|
|
424
|
+
type AgentMessageConfig<TInputJson = unknown> = Expr<ReadonlyArray<AgentMessageLine<TInputJson>>, TInputJson> | ReadonlyArray<AgentMessageLine<TInputJson>> | {
|
|
424
425
|
readonly prompt?: ReadonlyArray<AgentMessageLine<TInputJson>>;
|
|
425
426
|
readonly buildMessages?: (args: AgentMessageBuildArgs<TInputJson>) => ReadonlyArray<AgentMessageDto>;
|
|
426
427
|
};
|
|
@@ -809,5 +810,5 @@ declare class LocalOnlyScheduler implements NodeExecutionScheduler {
|
|
|
809
810
|
}>;
|
|
810
811
|
}
|
|
811
812
|
//#endregion
|
|
812
|
-
export { ChatModelFactory as $, AgentConnectionNodeRole as A,
|
|
813
|
-
//# sourceMappingURL=index-
|
|
813
|
+
export { ChatModelFactory as $, AgentConnectionNodeRole as A, DefinedNodeCredentialBinding as At, AgentMessageRole as B, RunnableOutputBehaviorResolver as Bt, PersistedRuntimeTypeKind as C, DefinedNodeRegistry as Ct, AgentConnectionCredentialSource as D, DefinedNode as Dt, InMemoryRunEventBus as E, DefineNodeOptions as Et, AgentGuardrailDefaults as F, Clock as Ft, AgentTool as G, AsyncSleeper as Gt, AgentMessageTemplateContent as H, InProcessRetryRunner as Ht, AgentMessageBuildArgs as I, SystemClock as It, AgentToolDefinition as J, EngineCompositionDeps as Jt, AgentToolCall as K, CredentialResolverFactory as Kt, AgentMessageConfig as L, NodeInstanceFactory as Lt, AgentAttachmentRole as M, DefinedNodeRunContext as Mt, AgentCanvasPresentation as N, defineBatchNode as Nt, AgentConnectionNodeCollector as O, DefinedNodeConfigInput as Ot, AgentGuardrailConfig as P, defineNode as Pt, ChatModelConfig as Q, AgentMessageDto as R, NodeExecutor as Rt, PersistedRuntimeTypeDecoratorOptions as S, defineCredential as St, EventPublishingWorkflowExecutionRepository as T, DefineNodeExecuteArgs as Tt, AgentModelInvocationOptions as U, DefaultExecutionContextFactory as Ut, AgentMessageTemplate as V, ItemExprResolver as Vt, AgentNodeConfig as W, DefaultAsyncSleeper as Wt, AgentToolToken as X, AgentToolExecuteArgs as Y, EngineFactory as Yt, AgentTurnLimitBehavior as Z, tool as _, CallableToolConfig as _t, ConfigDrivenOffloadPolicy as a, NodeBackedToolInputMapperArgs as at, PersistedRuntimeTypeMetadataStore as b, NodeBackedToolConfig as bt, InMemoryWorkflowExecutionRepository as c, Tool as ct, DefaultExecutionBinaryService as d, ZodSchemaAny as dt, ChatModelStructuredOutputOptions as et, UnavailableBinaryStorage as f, AgentConfigInspector as ft, node as g, CallableToolFactory as gt, getPersistedRuntimeTypeMetadata as h, CallableToolKindToken as ht, InlineDrivingScheduler as i, NodeBackedToolInputMapper as it, callableTool as j, DefinedNodeCredentialBindings as jt, AgentConnectionNodeDescriptor as k, DefinedNodeCredentialAccessors as kt, InMemoryRunDataFactory as l, ToolConfig as lt, chatModel as m, AgentToolFactory as mt, HintOnlyOffloadPolicy as n, LangChainStructuredOutputModelLike as nt, WorkflowRepositoryWebhookTriggerMatcher as o, NodeBackedToolOutputMapper as ot, ItemsInputNormalizer as p, AgentMessageConfigNormalizer as pt, AgentToolCallPlanner as q, NodeEventPublisher as qt, DefaultDrivingScheduler as r, NodeBackedToolConfigOptions as rt, RunSummaryMapper as s, NodeBackedToolOutputMapperArgs as st, LocalOnlyScheduler as t, LangChainChatModelLike as tt, InMemoryBinaryStorage as u, ToolExecuteArgs as ut, StackTraceCallSitePathResolver as v, CallableToolConfigOptions as vt, PersistedRuntimeTypeMetadata as w, DefineBatchNodeOptions as wt, InjectableRuntimeDecoratorComposer as x, DefineCredentialOptions as xt, PersistedRuntimeTypeNameResolver as y, CallableToolExecuteHandler as yt, AgentMessageLine as z, NodeOutputNormalizer as zt };
|
|
814
|
+
//# sourceMappingURL=index-BnJ7_IrO.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_runtime = require('./runtime-
|
|
1
|
+
const require_runtime = require('./runtime-3YVDd2vY.cjs');
|
|
2
2
|
const require_workflowActivationPolicy = require('./workflowActivationPolicy-6V3OJD3N.cjs');
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
zod = require_runtime.__toESM(zod);
|
|
@@ -95,9 +95,10 @@ function defineNode(options) {
|
|
|
95
95
|
keepBinaries = options.keepBinaries ?? false;
|
|
96
96
|
constructor(name, config, id) {
|
|
97
97
|
this.name = name;
|
|
98
|
-
this.config = config;
|
|
99
98
|
this.id = id;
|
|
99
|
+
this.config = config;
|
|
100
100
|
}
|
|
101
|
+
config;
|
|
101
102
|
getCredentialRequirements() {
|
|
102
103
|
return credentialRequirements;
|
|
103
104
|
}
|
|
@@ -140,9 +141,10 @@ function defineBatchNode(options) {
|
|
|
140
141
|
icon = options.icon;
|
|
141
142
|
constructor(name, config, id) {
|
|
142
143
|
this.name = name;
|
|
143
|
-
this.config = config;
|
|
144
144
|
this.id = id;
|
|
145
|
+
this.config = config;
|
|
145
146
|
}
|
|
147
|
+
config;
|
|
146
148
|
getCredentialRequirements() {
|
|
147
149
|
return credentialRequirements;
|
|
148
150
|
}
|
|
@@ -375,7 +377,7 @@ var AgentConfigInspector = class {
|
|
|
375
377
|
if (messages === void 0 || messages === null) return false;
|
|
376
378
|
if (Array.isArray(messages)) return messages.length > 0;
|
|
377
379
|
if (typeof messages === "object") {
|
|
378
|
-
if (require_runtime.
|
|
380
|
+
if (require_runtime.isItemExpr(messages)) return true;
|
|
379
381
|
const o = messages;
|
|
380
382
|
return Array.isArray(o.prompt) && o.prompt.length > 0 || typeof o.buildMessages === "function";
|
|
381
383
|
}
|
|
@@ -445,7 +447,7 @@ var AgentMessageConfigNormalizer = class {
|
|
|
445
447
|
return out;
|
|
446
448
|
}
|
|
447
449
|
static normalizeRichMessages(config, args) {
|
|
448
|
-
if (require_runtime.
|
|
450
|
+
if (require_runtime.isItemExpr(config)) throw new Error("AIAgent messages wrapped in itemExpr(...) must be resolved by the engine before prompt normalization.");
|
|
449
451
|
if (Array.isArray(config)) return config.map((line) => this.lineToDto(line, args));
|
|
450
452
|
const structured = config;
|
|
451
453
|
const messages = [];
|
|
@@ -713,6 +715,9 @@ var CredentialUnboundError = class CredentialUnboundError extends Error {
|
|
|
713
715
|
|
|
714
716
|
//#endregion
|
|
715
717
|
//#region src/contracts/workflowTypes.ts
|
|
718
|
+
function nodeRef(nodeId) {
|
|
719
|
+
return nodeId;
|
|
720
|
+
}
|
|
716
721
|
const branchRef = (index) => `$${index}`;
|
|
717
722
|
|
|
718
723
|
//#endregion
|
|
@@ -745,7 +750,7 @@ exports.InMemoryRunDataFactory = require_runtime.InMemoryRunDataFactory;
|
|
|
745
750
|
exports.InMemoryRunEventBus = require_workflowActivationPolicy.InMemoryRunEventBus;
|
|
746
751
|
exports.InProcessRetryRunner = require_runtime.InProcessRetryRunner;
|
|
747
752
|
exports.InjectableRuntimeDecoratorComposer = require_runtime.InjectableRuntimeDecoratorComposer;
|
|
748
|
-
exports.
|
|
753
|
+
exports.ItemExprResolver = require_runtime.ItemExprResolver;
|
|
749
754
|
Object.defineProperty(exports, 'ItemsInputNormalizer', {
|
|
750
755
|
enumerable: true,
|
|
751
756
|
get: function () {
|
|
@@ -820,11 +825,12 @@ Object.defineProperty(exports, 'instancePerContainerCachingFactory', {
|
|
|
820
825
|
return tsyringe.instancePerContainerCachingFactory;
|
|
821
826
|
}
|
|
822
827
|
});
|
|
823
|
-
exports.
|
|
828
|
+
exports.isItemExpr = require_runtime.isItemExpr;
|
|
824
829
|
exports.isPortsEmission = require_runtime.isPortsEmission;
|
|
825
830
|
exports.isUnbrandedPortsEmissionShape = require_runtime.isUnbrandedPortsEmissionShape;
|
|
826
|
-
exports.
|
|
831
|
+
exports.itemExpr = require_runtime.itemExpr;
|
|
827
832
|
exports.node = require_runtime.node;
|
|
833
|
+
exports.nodeRef = nodeRef;
|
|
828
834
|
Object.defineProperty(exports, 'predicateAwareClassFactory', {
|
|
829
835
|
enumerable: true,
|
|
830
836
|
get: function () {
|
|
@@ -837,8 +843,8 @@ Object.defineProperty(exports, 'registry', {
|
|
|
837
843
|
return tsyringe.registry;
|
|
838
844
|
}
|
|
839
845
|
});
|
|
840
|
-
exports.
|
|
841
|
-
exports.
|
|
846
|
+
exports.resolveItemExprsForExecution = require_runtime.resolveItemExprsForExecution;
|
|
847
|
+
exports.resolveItemExprsInUnknown = require_runtime.resolveItemExprsInUnknown;
|
|
842
848
|
Object.defineProperty(exports, 'singleton', {
|
|
843
849
|
enumerable: true,
|
|
844
850
|
get: function () {
|