@codemation/core 0.2.0 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{EngineRuntimeRegistration.types-0sgV2XL2.d.ts → EngineRuntimeRegistration.types-Bjeo7Sfq.d.ts} +2 -2
  3. package/dist/{EngineWorkflowRunnerService-Dx7bJsJR.d.cts → EngineWorkflowRunnerService-Dd4yD31l.d.cts} +2 -2
  4. package/dist/{InMemoryRunDataFactory-qIYQEar7.d.cts → InMemoryRunDataFactory-OUzDmAHt.d.cts} +2 -2
  5. package/dist/{RunIntentService-BCvGdOSY.d.ts → RunIntentService-BAKikN8h.d.ts} +80 -12
  6. package/dist/{RunIntentService-CV8izV8t.d.cts → RunIntentService-Bkg4oYrM.d.cts} +74 -5
  7. package/dist/bootstrap/index.cjs +31 -31
  8. package/dist/bootstrap/index.d.cts +5 -3
  9. package/dist/bootstrap/index.d.ts +3 -3
  10. package/dist/bootstrap/index.js +2 -2
  11. package/dist/bootstrap-BD6CobHl.js +215 -0
  12. package/dist/bootstrap-BD6CobHl.js.map +1 -0
  13. package/dist/bootstrap-DwS5S7s9.cjs +240 -0
  14. package/dist/bootstrap-DwS5S7s9.cjs.map +1 -0
  15. package/dist/{index-BHmrZIHp.d.ts → index-BDHCiN22.d.ts} +23 -10
  16. package/dist/index.cjs +60 -32
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +28 -17
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.js +29 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/{RunIntentService-BFA48UpH.js → runtime-Cy-3FTI_.js} +1224 -94
  23. package/dist/runtime-Cy-3FTI_.js.map +1 -0
  24. package/dist/{RunIntentService-DcxXf_AM.cjs → runtime-ZJUpWmPH.cjs} +1251 -132
  25. package/dist/runtime-ZJUpWmPH.cjs.map +1 -0
  26. package/dist/testing.cjs +74 -29
  27. package/dist/testing.cjs.map +1 -1
  28. package/dist/testing.d.cts +55 -3
  29. package/dist/testing.d.ts +55 -3
  30. package/dist/testing.js +46 -3
  31. package/dist/testing.js.map +1 -1
  32. package/dist/workflowActivationPolicy-B8HzTk3o.js.map +1 -1
  33. package/dist/workflowActivationPolicy-BzyzXLa_.cjs.map +1 -1
  34. package/package.json +1 -1
  35. package/src/ai/AgentMessageConfigNormalizerFactory.ts +43 -0
  36. package/src/ai/AgentToolFactory.ts +2 -2
  37. package/src/ai/AiHost.ts +10 -9
  38. package/src/ai/NodeBackedToolConfig.ts +1 -1
  39. package/src/authoring/defineNode.types.ts +7 -1
  40. package/src/contracts/runtimeTypes.ts +26 -0
  41. package/src/contracts/workflowTypes.ts +67 -5
  42. package/src/execution/ActivationEnqueueService.ts +8 -5
  43. package/src/execution/NodeActivationRequestInputPreparer.ts +89 -0
  44. package/src/execution/NodeExecutor.ts +38 -1
  45. package/src/execution/NodeInputContractError.ts +13 -0
  46. package/src/execution/index.ts +2 -0
  47. package/src/orchestration/RunContinuationService.ts +181 -50
  48. package/src/planning/RunQueuePlanner.ts +12 -1
  49. package/src/runtime/EngineFactory.ts +3 -0
  50. package/src/testing/ItemHarnessNode.ts +27 -0
  51. package/src/testing/ItemHarnessNodeConfig.ts +43 -0
  52. package/src/testing/RegistrarEngineTestKitFactory.ts +2 -0
  53. package/src/testing.ts +2 -0
  54. package/src/workflow/dsl/ChainCursorResolver.ts +1 -1
  55. package/src/workflow/dsl/workflowBuilderTypes.ts +8 -5
  56. package/dist/RunIntentService-BFA48UpH.js.map +0 -1
  57. package/dist/RunIntentService-DcxXf_AM.cjs.map +0 -1
  58. package/dist/bootstrap-D67Sf2BF.js +0 -1136
  59. package/dist/bootstrap-D67Sf2BF.js.map +0 -1
  60. package/dist/bootstrap-DoQHAEQJ.cjs +0 -1203
  61. package/dist/bootstrap-DoQHAEQJ.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { $t as RunnableNodeInputJson, An as BinaryStorageWriteResult, At as NodeActivationId, Bn as NodeActivationContinuation, Bt as NodeOutputs, Cr as WorkflowActivationPolicy, Di as RunEventBus, Dn as BinaryStorageReadResult, Ei as RunEvent, En as BinaryStorage, Fi as RetryPolicySpec, Fn as ExecutionContext, Gn as NodeBinaryAttachmentService, Gt as ParentExecutionRef, Hn as NodeActivationRequest, Ht as NodeSchedulerDecision, In as ExecutionContextFactory, Jr as RunPruneCandidate, Jt as RunDataFactory, K as AnyCredentialType, Kn as NodeExecutionContext, Lt as NodeId, Mt as NodeConnectionName, Nt as NodeDefinition, Oi as RunEventSubscription, On as BinaryStorageStatResult, Or as EngineRunCounters, Ot as JsonValue, Pn as ExecutionBinaryService, Qn as NodeResolver, Qt as RunnableNodeConfig, Rr as PersistedRunSchedulingState, St as Item, Tn as BinaryBody, Vr as PersistedWorkflowSnapshotNode, Wn as NodeActivationScheduler, X as CredentialFieldSchema, Xn as NodeExecutionStatePublisher, Xt as RunId, Yn as NodeExecutionScheduler, Yt as RunDataSnapshot, Z as CredentialHealth, _t as BinaryAttachment, an as WorkflowDefinition, at as CredentialRequirement, bt as ExecutionMode, ct as CredentialSessionService, di as TypeToken, dn as WorkflowId, dt as CredentialTypeDefinition, ei as RunSummary, er as PreparedNodeActivationDispatch, ft as CredentialTypeId, hr as HttpMethod, ii as WorkflowExecutionRepository, jn as EngineDeps, jr as NodeExecutionSnapshot, jt as NodeConfigBase, kt as MutableRunData, l as WorkflowSnapshotCodec, lr as WorkflowNodeInstanceFactory, ni as WorkflowExecutionListingRepository, nt as CredentialJsonRecord, qn as NodeExecutionRequest, ri as WorkflowExecutionPruneRepository, st as CredentialSessionFactoryArgs, u as Engine, ur as WorkflowRepository, ut as CredentialType, vr as WebhookInvocationMatch, wi as EngineExecutionLimitsPolicy, wt as Items, xr as WebhookTriggerRoutingDiagnostics, yr as WebhookTriggerMatcher, zr as PersistedRunState, zt as NodeOffloadPolicy } from "./RunIntentService-BCvGdOSY.js";
1
+ import { $n as NodeExecutionRequest, $t as RunId, Ai as EngineExecutionLimitsPolicy, An as BinaryBody, Bn as ExecutionContext, Bt as NodeId, Dr as WebhookTriggerRoutingDiagnostics, Dt as Items, Fn as BinaryStorageWriteResult, Ft as NodeConnectionName, Gr as PersistedRunState, Gt as NodeSchedulerDecision, Ht as NodeOffloadPolicy, In as EngineDeps, It as NodeDefinition, Jn as NodeActivationRequest, Jt as ParentExecutionRef, K as AnyCredentialType, Kn as NodeActivationContinuation, Lr as NodeExecutionSnapshot, Mi as RunEvent, Mn as BinaryStorageReadResult, Mt as MutableRunData, Ni as RunEventBus, Nn as BinaryStorageStatResult, Nt as NodeActivationId, Pi as RunEventSubscription, Pr as EngineRunCounters, Pt as NodeConfigBase, Qn as NodeExecutionContext, Qt as RunDataSnapshot, St as Item, Tr as WebhookTriggerMatcher, Ut as NodeOutputs, Vi as RetryPolicySpec, Vn as ExecutionContextFactory, Wr as PersistedRunSchedulingState, X as CredentialFieldSchema, Xn as NodeActivationScheduler, Z as CredentialHealth, Zn as NodeBinaryAttachmentService, Zt as RunDataFactory, _i as TypeToken, _t as BinaryAttachment, at as CredentialRequirement, bt as ExecutionMode, ci as WorkflowExecutionListingRepository, ct as CredentialSessionService, dt as CredentialTypeDefinition, ei as RunPruneCandidate, ft as CredentialTypeId, gr as WorkflowRepository, hn as WorkflowId, hr as WorkflowNodeInstanceFactory, ir as NodeResolver, jn as BinaryStorage, jt as JsonValue, kr as WorkflowActivationPolicy, l as WorkflowSnapshotCodec, li as WorkflowExecutionPruneRepository, ln as WorkflowDefinition, nn as RunnableNodeInputJson, nr as NodeExecutionStatePublisher, nt as CredentialJsonRecord, oi as RunSummary, or as PreparedNodeActivationDispatch, qr as PersistedWorkflowSnapshotNode, st as CredentialSessionFactoryArgs, tn as RunnableNodeConfig, tr as NodeExecutionScheduler, u as Engine, ui as WorkflowExecutionRepository, ut as CredentialType, wr as WebhookInvocationMatch, xr as HttpMethod, zn as ExecutionBinaryService } from "./RunIntentService-BAKikN8h.js";
2
2
  import { ZodType, input, output, z } from "zod";
3
3
 
4
4
  //#region src/workflowSnapshots/MissingRuntimeFallbacksFactory.d.ts
@@ -89,6 +89,8 @@ declare class NodeExecutor {
89
89
  execute(request: NodeActivationRequest): Promise<NodeOutputs>;
90
90
  private executeMultiInputNode;
91
91
  private executeSingleInputNode;
92
+ private hasExecuteOne;
93
+ private executeItemNode;
92
94
  }
93
95
  //#endregion
94
96
  //#region src/execution/NodeInstanceFactory.d.ts
@@ -144,6 +146,11 @@ interface DefineNodeOptions<TKey$1 extends string, TConfig$1 extends CredentialJ
144
146
  readonly key: TKey$1;
145
147
  readonly title: string;
146
148
  readonly description?: string;
149
+ /**
150
+ * Canvas icon for this node (same contract as `NodeConfigBase.icon` on runnable configs).
151
+ * The Next host resolves Lucide (`lucide:…`), built-in SVGs (`builtin:…`), Simple Icons (`si:…`), and image URLs (`https:`, `data:`, `/…`).
152
+ */
153
+ readonly icon?: string;
147
154
  readonly input?: Readonly<Record<keyof TConfig$1 & string, unknown>>;
148
155
  readonly configSchema?: z.ZodType<TConfig$1>;
149
156
  readonly credentials?: TBindings;
@@ -180,7 +187,7 @@ declare function defineCredential<TPublicSource extends CredentialFieldMap<any>
180
187
  };
181
188
  //#endregion
182
189
  //#region src/ai/NodeBackedToolConfig.d.ts
183
- declare class NodeBackedToolConfig<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> implements ToolConfig {
190
+ declare class NodeBackedToolConfig<TNodeConfig extends RunnableNodeConfig<any, any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> implements ToolConfig {
184
191
  readonly name: string;
185
192
  readonly node: TNodeConfig;
186
193
  readonly type: TypeToken<unknown>;
@@ -203,7 +210,7 @@ declare class NodeBackedToolConfig<TNodeConfig extends RunnableNodeConfig<any, a
203
210
  //#endregion
204
211
  //#region src/ai/AgentToolFactory.d.ts
205
212
  declare class AgentToolFactoryImpl {
206
- asTool<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny>(node: TNodeConfig, options: Readonly<{
213
+ asTool<TNodeConfig extends RunnableNodeConfig<any, any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny>(node: TNodeConfig, options: Readonly<{
207
214
  name?: string;
208
215
  } & NodeBackedToolConfigOptions<TNodeConfig, TInputSchema, TOutputSchema>>): NodeBackedToolConfig<TNodeConfig, TInputSchema, TOutputSchema>;
209
216
  private withDefaultAgentInputMapper;
@@ -214,7 +221,13 @@ declare const AgentToolFactory: AgentToolFactoryImpl;
214
221
  //#endregion
215
222
  //#region src/ai/AgentMessageConfigNormalizerFactory.d.ts
216
223
  declare class AgentMessageConfigNormalizer {
224
+ /**
225
+ * Prefer {@code input.messages} when present (ItemNode / engine-mapped payloads); otherwise resolve from
226
+ * {@link AgentNodeConfig.messages} templates.
227
+ */
228
+ static resolveFromInputOrConfig<TInputJson, TOutputJson>(input: unknown, config: AgentNodeConfig<TInputJson, TOutputJson>, args: AgentMessageBuildArgs<TInputJson>): ReadonlyArray<AgentMessageDto>;
217
229
  static normalize<TInputJson, TOutputJson>(config: AgentNodeConfig<TInputJson, TOutputJson>, args: AgentMessageBuildArgs<TInputJson>): ReadonlyArray<AgentMessageDto>;
230
+ private static tryMessagesFromStructuredInput;
218
231
  private static normalizeRichMessages;
219
232
  private static lineToDto;
220
233
  }
@@ -323,7 +336,7 @@ interface ChatModelFactory<TConfig$1 extends ChatModelConfig = ChatModelConfig>
323
336
  ctx: NodeExecutionContext<any>;
324
337
  }>): Promise<LangChainChatModelLike> | LangChainChatModelLike;
325
338
  }
326
- type NodeBackedToolInputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = Readonly<{
339
+ type NodeBackedToolInputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any, any>, TToolInput = unknown> = Readonly<{
327
340
  input: TToolInput;
328
341
  item: Item;
329
342
  itemIndex: number;
@@ -331,7 +344,7 @@ type NodeBackedToolInputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, a
331
344
  ctx: NodeExecutionContext<any>;
332
345
  node: TNodeConfig;
333
346
  }>;
334
- type NodeBackedToolOutputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = Readonly<{
347
+ type NodeBackedToolOutputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any, any>, TToolInput = unknown> = Readonly<{
335
348
  input: TToolInput;
336
349
  item: Item;
337
350
  itemIndex: number;
@@ -340,9 +353,9 @@ type NodeBackedToolOutputMapperArgs<TNodeConfig extends RunnableNodeConfig<any,
340
353
  node: TNodeConfig;
341
354
  outputs: NodeOutputs;
342
355
  }>;
343
- type NodeBackedToolInputMapper<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = (args: NodeBackedToolInputMapperArgs<TNodeConfig, TToolInput>) => Item<RunnableNodeInputJson<TNodeConfig>> | RunnableNodeInputJson<TNodeConfig>;
344
- type NodeBackedToolOutputMapper<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown, TToolOutput = unknown> = (args: NodeBackedToolOutputMapperArgs<TNodeConfig, TToolInput>) => TToolOutput;
345
- type NodeBackedToolConfigOptions<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> = Readonly<{
356
+ type NodeBackedToolInputMapper<TNodeConfig extends RunnableNodeConfig<any, any, any>, TToolInput = unknown> = (args: NodeBackedToolInputMapperArgs<TNodeConfig, TToolInput>) => Item<RunnableNodeInputJson<TNodeConfig>> | RunnableNodeInputJson<TNodeConfig>;
357
+ type NodeBackedToolOutputMapper<TNodeConfig extends RunnableNodeConfig<any, any, any>, TToolInput = unknown, TToolOutput = unknown> = (args: NodeBackedToolOutputMapperArgs<TNodeConfig, TToolInput>) => TToolOutput;
358
+ type NodeBackedToolConfigOptions<TNodeConfig extends RunnableNodeConfig<any, any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> = Readonly<{
346
359
  description?: string;
347
360
  presentation?: AgentCanvasPresentation;
348
361
  inputSchema: TInputSchema;
@@ -350,7 +363,7 @@ type NodeBackedToolConfigOptions<TNodeConfig extends RunnableNodeConfig<any, any
350
363
  mapInput?: NodeBackedToolInputMapper<TNodeConfig, input<TInputSchema>>;
351
364
  mapOutput?: NodeBackedToolOutputMapper<TNodeConfig, input<TInputSchema>, output<TOutputSchema>>;
352
365
  }>;
353
- interface AgentNodeConfig<TInputJson = unknown, TOutputJson = unknown> extends RunnableNodeConfig<TInputJson, TOutputJson> {
366
+ interface AgentNodeConfig<TInputJson = unknown, TOutputJson = unknown, TWireJson = TInputJson> extends RunnableNodeConfig<TInputJson, TOutputJson, TWireJson> {
354
367
  readonly messages: AgentMessageConfig<TInputJson>;
355
368
  readonly chatModel: ChatModelConfig;
356
369
  readonly tools?: ReadonlyArray<ToolConfig>;
@@ -650,4 +663,4 @@ declare class LocalOnlyScheduler implements NodeExecutionScheduler {
650
663
  }
651
664
  //#endregion
652
665
  export { LangChainChatModelLike as $, AgentConnectionNodeRole as A, AsyncSleeper as At, AgentMessageTemplate as B, PersistedRuntimeTypeKind as C, Clock as Ct, AgentConnectionCredentialSource as D, InProcessRetryRunner as Dt, InMemoryRunEventBus as E, NodeExecutor as Et, AgentMessageBuildArgs as F, AgentToolCall as G, AgentModelInvocationOptions as H, AgentMessageConfig as I, AgentToolExecuteArgs as J, AgentToolCallPlanner as K, AgentMessageDto as L, AgentCanvasPresentation as M, NodeEventPublisher as Mt, AgentGuardrailConfig as N, EngineCompositionDeps as Nt, AgentConnectionNodeCollector as O, DefaultExecutionContextFactory as Ot, AgentGuardrailDefaults as P, EngineFactory as Pt, ChatModelFactory as Q, AgentMessageLine as R, PersistedRuntimeTypeDecoratorOptions as S, defineNode as St, EventPublishingWorkflowExecutionRepository as T, NodeInstanceFactory as Tt, AgentNodeConfig as U, AgentMessageTemplateContent as V, AgentTool as W, AgentTurnLimitBehavior as X, AgentToolToken as Y, ChatModelConfig as Z, tool as _, DefinedNode as _t, ConfigDrivenOffloadPolicy as a, Tool as at, PersistedRuntimeTypeMetadataStore as b, DefinedNodeCredentialBindings as bt, InMemoryWorkflowExecutionRepository as c, ZodSchemaAny as ct, DefaultExecutionBinaryService as d, AgentToolFactory as dt, NodeBackedToolConfigOptions as et, UnavailableBinaryStorage as f, NodeBackedToolConfig as ft, node as g, DefineNodeOptions as gt, getPersistedRuntimeTypeMetadata as h, DefinedNodeRegistry as ht, InlineDrivingScheduler as i, NodeBackedToolOutputMapperArgs as it, AgentAttachmentRole as j, CredentialResolverFactory as jt, AgentConnectionNodeDescriptor as k, DefaultAsyncSleeper as kt, InMemoryRunDataFactory as l, AgentConfigInspector as lt, chatModel as m, defineCredential as mt, HintOnlyOffloadPolicy as n, NodeBackedToolInputMapperArgs as nt, WorkflowRepositoryWebhookTriggerMatcher as o, ToolConfig as ot, ItemsInputNormalizer as p, DefineCredentialOptions as pt, AgentToolDefinition as q, DefaultDrivingScheduler as r, NodeBackedToolOutputMapper as rt, RunSummaryMapper as s, ToolExecuteArgs as st, LocalOnlyScheduler as t, NodeBackedToolInputMapper as tt, InMemoryBinaryStorage as u, AgentMessageConfigNormalizer as ut, StackTraceCallSitePathResolver as v, DefinedNodeCredentialAccessors as vt, PersistedRuntimeTypeMetadata as w, SystemClock as wt, InjectableRuntimeDecoratorComposer as x, DefinedNodeRunContext as xt, PersistedRuntimeTypeNameResolver as y, DefinedNodeCredentialBinding as yt, AgentMessageRole as z };
653
- //# sourceMappingURL=index-BHmrZIHp.d.ts.map
666
+ //# sourceMappingURL=index-BDHCiN22.d.ts.map
package/dist/index.cjs CHANGED
@@ -1,11 +1,11 @@
1
- const require_RunIntentService = require('./RunIntentService-DcxXf_AM.cjs');
1
+ const require_runtime = require('./runtime-ZJUpWmPH.cjs');
2
2
  const require_workflowActivationPolicy = require('./workflowActivationPolicy-BzyzXLa_.cjs');
3
3
  let zod = require("zod");
4
- zod = require_RunIntentService.__toESM(zod);
4
+ zod = require_runtime.__toESM(zod);
5
5
  let node_crypto = require("node:crypto");
6
- node_crypto = require_RunIntentService.__toESM(node_crypto);
6
+ node_crypto = require_runtime.__toESM(node_crypto);
7
7
  let tsyringe = require("tsyringe");
8
- tsyringe = require_RunIntentService.__toESM(tsyringe);
8
+ tsyringe = require_runtime.__toESM(tsyringe);
9
9
 
10
10
  //#region src/contracts/Clock.ts
11
11
  var SystemClock = class {
@@ -83,10 +83,11 @@ function defineNode(options) {
83
83
  }) };
84
84
  }
85
85
  };
86
- require_RunIntentService.node({ name: options.key })(DefinedNodeRuntime);
86
+ require_runtime.node({ name: options.key })(DefinedNodeRuntime);
87
87
  const DefinedRunnableNodeConfig = class {
88
88
  kind = "node";
89
89
  type = DefinedNodeRuntime;
90
+ icon = options.icon;
90
91
  constructor(name, config, id) {
91
92
  this.name = name;
92
93
  this.config = config;
@@ -288,11 +289,38 @@ const AgentToolFactory = new AgentToolFactoryImpl();
288
289
  //#endregion
289
290
  //#region src/ai/AgentMessageConfigNormalizerFactory.ts
290
291
  var AgentMessageConfigNormalizer = class {
292
+ /**
293
+ * Prefer {@code input.messages} when present (ItemNode / engine-mapped payloads); otherwise resolve from
294
+ * {@link AgentNodeConfig.messages} templates.
295
+ */
296
+ static resolveFromInputOrConfig(input, config, args) {
297
+ const fromInput = this.tryMessagesFromStructuredInput(input);
298
+ if (fromInput.length > 0) return fromInput;
299
+ return this.normalize(config, args);
300
+ }
291
301
  static normalize(config, args) {
292
302
  const fromMessages = this.normalizeRichMessages(config.messages, args);
293
303
  if (fromMessages.length > 0) return fromMessages;
294
304
  throw new Error("AIAgent messages must be a non-empty array, or an object with a non-empty prompt array and/or buildMessages that returns messages.");
295
305
  }
306
+ static tryMessagesFromStructuredInput(input) {
307
+ if (!input || typeof input !== "object") return [];
308
+ const raw = input.messages;
309
+ if (!Array.isArray(raw) || raw.length === 0) return [];
310
+ const out = [];
311
+ for (const m of raw) {
312
+ if (!m || typeof m !== "object") continue;
313
+ const role = m.role;
314
+ const content = m.content;
315
+ if (role !== "system" && role !== "user" && role !== "assistant") continue;
316
+ if (typeof content !== "string") continue;
317
+ out.push({
318
+ role,
319
+ content
320
+ });
321
+ }
322
+ return out;
323
+ }
296
324
  static normalizeRichMessages(config, args) {
297
325
  if (Array.isArray(config)) return config.map((line) => this.lineToDto(line, args));
298
326
  const structured = config;
@@ -328,7 +356,7 @@ const AgentConnectionNodeCollector = new class {
328
356
  }
329
357
  collectInto(parentNodeId, agentConfig, collected) {
330
358
  collected.push({
331
- nodeId: require_RunIntentService.ConnectionNodeIdFactory.languageModelConnectionNodeId(parentNodeId),
359
+ nodeId: require_runtime.ConnectionNodeIdFactory.languageModelConnectionNodeId(parentNodeId),
332
360
  parentNodeId,
333
361
  connectionName: "llm",
334
362
  role: "languageModel",
@@ -338,7 +366,7 @@ const AgentConnectionNodeCollector = new class {
338
366
  credentialSource: agentConfig.chatModel
339
367
  });
340
368
  for (const tool$1 of agentConfig.tools ?? []) {
341
- const toolNodeId = require_RunIntentService.ConnectionNodeIdFactory.toolConnectionNodeId(parentNodeId, tool$1.name);
369
+ const toolNodeId = require_runtime.ConnectionNodeIdFactory.toolConnectionNodeId(parentNodeId, tool$1.name);
342
370
  const isNestedAgent = this.isNodeBackedAgentTool(tool$1);
343
371
  collected.push({
344
372
  nodeId: toolNodeId,
@@ -572,24 +600,24 @@ exports.AgentToolFactory = AgentToolFactory;
572
600
  exports.AllWorkflowsActiveWorkflowActivationPolicy = require_workflowActivationPolicy.AllWorkflowsActiveWorkflowActivationPolicy;
573
601
  exports.ChainCursor = require_workflowActivationPolicy.ChainCursor;
574
602
  exports.ConnectionInvocationIdFactory = ConnectionInvocationIdFactory;
575
- exports.ConnectionNodeIdFactory = require_RunIntentService.ConnectionNodeIdFactory;
576
- exports.CoreTokens = require_RunIntentService.CoreTokens;
577
- exports.CredentialResolverFactory = require_RunIntentService.CredentialResolverFactory;
603
+ exports.ConnectionNodeIdFactory = require_runtime.ConnectionNodeIdFactory;
604
+ exports.CoreTokens = require_runtime.CoreTokens;
605
+ exports.CredentialResolverFactory = require_runtime.CredentialResolverFactory;
578
606
  exports.CredentialUnboundError = CredentialUnboundError;
579
- exports.DefaultAsyncSleeper = require_RunIntentService.DefaultAsyncSleeper;
580
- exports.DefaultExecutionBinaryService = require_RunIntentService.DefaultExecutionBinaryService;
581
- exports.DefaultExecutionContextFactory = require_RunIntentService.DefaultExecutionContextFactory;
607
+ exports.DefaultAsyncSleeper = require_runtime.DefaultAsyncSleeper;
608
+ exports.DefaultExecutionBinaryService = require_runtime.DefaultExecutionBinaryService;
609
+ exports.DefaultExecutionContextFactory = require_runtime.DefaultExecutionContextFactory;
582
610
  exports.DefaultWorkflowGraphFactory = DefaultWorkflowGraphFactory;
583
611
  exports.DefinedNodeRegistry = DefinedNodeRegistry;
584
- exports.EngineExecutionLimitsPolicy = require_RunIntentService.EngineExecutionLimitsPolicy;
612
+ exports.EngineExecutionLimitsPolicy = require_runtime.EngineExecutionLimitsPolicy;
585
613
  exports.EventPublishingWorkflowExecutionRepository = EventPublishingWorkflowExecutionRepository;
586
614
  exports.ExpRetryPolicy = ExpRetryPolicy;
587
- exports.InMemoryBinaryStorage = require_RunIntentService.InMemoryBinaryStorage;
588
- exports.InMemoryLiveWorkflowRepository = require_RunIntentService.InMemoryLiveWorkflowRepository;
589
- exports.InMemoryRunDataFactory = require_RunIntentService.InMemoryRunDataFactory;
615
+ exports.InMemoryBinaryStorage = require_runtime.InMemoryBinaryStorage;
616
+ exports.InMemoryLiveWorkflowRepository = require_runtime.InMemoryLiveWorkflowRepository;
617
+ exports.InMemoryRunDataFactory = require_runtime.InMemoryRunDataFactory;
590
618
  exports.InMemoryRunEventBus = require_workflowActivationPolicy.InMemoryRunEventBus;
591
- exports.InProcessRetryRunner = require_RunIntentService.InProcessRetryRunner;
592
- exports.InjectableRuntimeDecoratorComposer = require_RunIntentService.InjectableRuntimeDecoratorComposer;
619
+ exports.InProcessRetryRunner = require_runtime.InProcessRetryRunner;
620
+ exports.InjectableRuntimeDecoratorComposer = require_runtime.InjectableRuntimeDecoratorComposer;
593
621
  Object.defineProperty(exports, 'ItemsInputNormalizer', {
594
622
  enumerable: true,
595
623
  get: function () {
@@ -598,21 +626,21 @@ Object.defineProperty(exports, 'ItemsInputNormalizer', {
598
626
  });
599
627
  exports.NoRetryPolicy = NoRetryPolicy;
600
628
  exports.NodeBackedToolConfig = NodeBackedToolConfig;
601
- exports.NodeEventPublisher = require_RunIntentService.NodeEventPublisher;
602
- exports.PersistedRuntimeTypeMetadataStore = require_RunIntentService.PersistedRuntimeTypeMetadataStore;
603
- exports.PersistedRuntimeTypeNameResolver = require_RunIntentService.PersistedRuntimeTypeNameResolver;
629
+ exports.NodeEventPublisher = require_runtime.NodeEventPublisher;
630
+ exports.PersistedRuntimeTypeMetadataStore = require_runtime.PersistedRuntimeTypeMetadataStore;
631
+ exports.PersistedRuntimeTypeNameResolver = require_runtime.PersistedRuntimeTypeNameResolver;
604
632
  exports.RetryPolicy = RetryPolicy;
605
- exports.RunFinishedAtFactory = require_RunIntentService.RunFinishedAtFactory;
606
- exports.RunIntentService = require_RunIntentService.RunIntentService;
607
- exports.StackTraceCallSitePathResolver = require_RunIntentService.StackTraceCallSitePathResolver;
633
+ exports.RunFinishedAtFactory = require_runtime.RunFinishedAtFactory;
634
+ exports.RunIntentService = require_runtime.RunIntentService;
635
+ exports.StackTraceCallSitePathResolver = require_runtime.StackTraceCallSitePathResolver;
608
636
  exports.SystemClock = SystemClock;
609
- exports.UnavailableBinaryStorage = require_RunIntentService.UnavailableBinaryStorage;
637
+ exports.UnavailableBinaryStorage = require_runtime.UnavailableBinaryStorage;
610
638
  exports.WhenBuilder = require_workflowActivationPolicy.WhenBuilder;
611
639
  exports.WorkflowBuilder = require_workflowActivationPolicy.WorkflowBuilder;
612
- exports.WorkflowExecutableNodeClassifier = require_RunIntentService.WorkflowExecutableNodeClassifier;
613
- exports.WorkflowExecutableNodeClassifierFactory = require_RunIntentService.WorkflowExecutableNodeClassifierFactory;
640
+ exports.WorkflowExecutableNodeClassifier = require_runtime.WorkflowExecutableNodeClassifier;
641
+ exports.WorkflowExecutableNodeClassifierFactory = require_runtime.WorkflowExecutableNodeClassifierFactory;
614
642
  exports.branchRef = branchRef;
615
- exports.chatModel = require_RunIntentService.chatModel;
643
+ exports.chatModel = require_runtime.chatModel;
616
644
  Object.defineProperty(exports, 'container', {
617
645
  enumerable: true,
618
646
  get: function () {
@@ -627,7 +655,7 @@ Object.defineProperty(exports, 'delay', {
627
655
  return tsyringe.delay;
628
656
  }
629
657
  });
630
- exports.getPersistedRuntimeTypeMetadata = require_RunIntentService.getPersistedRuntimeTypeMetadata;
658
+ exports.getPersistedRuntimeTypeMetadata = require_runtime.getPersistedRuntimeTypeMetadata;
631
659
  Object.defineProperty(exports, 'inject', {
632
660
  enumerable: true,
633
661
  get: function () {
@@ -658,7 +686,7 @@ Object.defineProperty(exports, 'instancePerContainerCachingFactory', {
658
686
  return tsyringe.instancePerContainerCachingFactory;
659
687
  }
660
688
  });
661
- exports.node = require_RunIntentService.node;
689
+ exports.node = require_runtime.node;
662
690
  Object.defineProperty(exports, 'predicateAwareClassFactory', {
663
691
  enumerable: true,
664
692
  get: function () {
@@ -677,5 +705,5 @@ Object.defineProperty(exports, 'singleton', {
677
705
  return tsyringe.singleton;
678
706
  }
679
707
  });
680
- exports.tool = require_RunIntentService.tool;
708
+ exports.tool = require_runtime.tool;
681
709
  //# sourceMappingURL=index.cjs.map