@codemation/core 0.11.0 → 0.12.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/CostCatalogContract-DD7fQ4FF.d.cts +19 -0
  3. package/dist/{EngineRuntimeRegistration.types-MPYWsEM0.d.cts → EngineRuntimeRegistration.types-DTV5_7Jw.d.cts} +3 -2
  4. package/dist/{EngineRuntimeRegistration.types-BZ_1XWAJ.d.ts → EngineRuntimeRegistration.types-Dl92Hdoi.d.ts} +2 -2
  5. package/dist/InMemoryRunDataFactory-qMiYjhCK.d.cts +202 -0
  6. package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js → InMemoryRunEventBusRegistry-Bwunvt1T.js} +1 -1
  7. package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js.map → InMemoryRunEventBusRegistry-Bwunvt1T.js.map} +1 -1
  8. package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs → InMemoryRunEventBusRegistry-Sa86VxuV.cjs} +1 -1
  9. package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map → InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map} +1 -1
  10. package/dist/ItemsInputNormalizer-BhuxvZh5.js +36 -0
  11. package/dist/ItemsInputNormalizer-BhuxvZh5.js.map +1 -0
  12. package/dist/ItemsInputNormalizer-C09a7iFP.d.ts +321 -0
  13. package/dist/ItemsInputNormalizer-DLaD6rTl.d.cts +407 -0
  14. package/dist/ItemsInputNormalizer-Div-fb6a.cjs +43 -0
  15. package/dist/ItemsInputNormalizer-Div-fb6a.cjs.map +1 -0
  16. package/dist/RunIntentService-BOSGwmqn.d.ts +299 -0
  17. package/dist/RunIntentService-CWMMrAP4.d.cts +220 -0
  18. package/dist/{RunIntentService-MUHJ1bhO.d.cts → agentMcpTypes-DUmniLOY.d.cts} +183 -206
  19. package/dist/bootstrap/index.cjs +4 -2
  20. package/dist/bootstrap/index.d.cts +63 -5
  21. package/dist/bootstrap/index.d.ts +5 -4
  22. package/dist/bootstrap/index.js +4 -2
  23. package/dist/{bootstrap-Dgzsjoj7.js → bootstrap-CKTMMNmL.js} +174 -3
  24. package/dist/bootstrap-CKTMMNmL.js.map +1 -0
  25. package/dist/{bootstrap-dVmpU1ju.cjs → bootstrap-D460dCgS.cjs} +209 -36
  26. package/dist/bootstrap-D460dCgS.cjs.map +1 -0
  27. package/dist/browser.cjs +17 -0
  28. package/dist/browser.d.cts +4 -0
  29. package/dist/browser.d.ts +3 -0
  30. package/dist/browser.js +4 -0
  31. package/dist/contracts-CK0x6w_G.cjs +74 -0
  32. package/dist/contracts-CK0x6w_G.cjs.map +1 -0
  33. package/dist/contracts-DXdfTdpW.js +50 -0
  34. package/dist/contracts-DXdfTdpW.js.map +1 -0
  35. package/dist/contracts.cjs +6 -0
  36. package/dist/contracts.d.cts +5 -0
  37. package/dist/contracts.d.ts +2 -0
  38. package/dist/contracts.js +3 -0
  39. package/dist/di-DdsgWfVy.js +405 -0
  40. package/dist/di-DdsgWfVy.js.map +1 -0
  41. package/dist/di-tO6R7VJV.cjs +524 -0
  42. package/dist/di-tO6R7VJV.cjs.map +1 -0
  43. package/dist/executionPersistenceContracts-DenJJK2T.d.cts +275 -0
  44. package/dist/{index-Bes88mxT.d.ts → index-BZDhEQ6W.d.ts} +278 -415
  45. package/dist/{RunIntentService-BrEq6Jm6.d.ts → index-CSKKuK60.d.ts} +441 -286
  46. package/dist/index.cjs +97 -250
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +395 -803
  49. package/dist/index.d.ts +5 -3
  50. package/dist/index.js +58 -224
  51. package/dist/index.js.map +1 -1
  52. package/dist/params-DqRvku2h.d.cts +44 -0
  53. package/dist/{runtime-Duf3ClPw.js → runtime-BPZgnZ9G.js} +591 -382
  54. package/dist/runtime-BPZgnZ9G.js.map +1 -0
  55. package/dist/{runtime-vH0EeZzH.cjs → runtime-CyW9c9XM.cjs} +651 -500
  56. package/dist/runtime-CyW9c9XM.cjs.map +1 -0
  57. package/dist/testing.cjs +23 -21
  58. package/dist/testing.cjs.map +1 -1
  59. package/dist/testing.d.cts +3 -2
  60. package/dist/testing.d.ts +3 -2
  61. package/dist/testing.js +5 -3
  62. package/dist/testing.js.map +1 -1
  63. package/package.json +9 -5
  64. package/src/ai/AgentConnectionNodeCollector.ts +1 -1
  65. package/src/authoring/defineHumanApprovalNode.types.ts +379 -0
  66. package/src/authoring/index.ts +6 -0
  67. package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +29 -0
  68. package/src/contracts/CodemationTelemetryAttributeNames.ts +10 -0
  69. package/src/contracts/credentialTypes.ts +10 -0
  70. package/src/contracts/hitlSeamTypes.ts +34 -0
  71. package/src/contracts/humanTaskStoreTypes.ts +48 -0
  72. package/src/contracts/inboxChannelTypes.ts +58 -0
  73. package/src/contracts/index.ts +3 -0
  74. package/src/contracts/runTypes.ts +61 -3
  75. package/src/contracts/runtimeTypes.ts +112 -0
  76. package/src/credentials/CredentialMaterialProvider.types.ts +61 -0
  77. package/src/credentials/ManagedCredentialMaterialWriteError.ts +14 -0
  78. package/src/credentials/ManagedMaterialFetchError.ts +16 -0
  79. package/src/execution/ActivationEnqueueService.ts +16 -0
  80. package/src/execution/DefaultExecutionContextFactory.ts +11 -0
  81. package/src/execution/NodeExecutionSnapshotFactory.ts +7 -1
  82. package/src/execution/NodeExecutor.ts +60 -1
  83. package/src/execution/NodeExecutorFactory.ts +12 -2
  84. package/src/execution/NodeSuspensionHandler.ts +220 -0
  85. package/src/execution/PersistedRunStateTerminalBuilder.ts +5 -2
  86. package/src/execution/RunStateSemantics.ts +5 -0
  87. package/src/execution/RunSuspendedError.ts +21 -0
  88. package/src/index.ts +40 -0
  89. package/src/orchestration/Engine.ts +12 -2
  90. package/src/orchestration/EngineWaiters.ts +1 -1
  91. package/src/orchestration/NodeExecutionRequestHandlerService.ts +25 -2
  92. package/src/orchestration/RunContinuationService.ts +226 -2
  93. package/src/orchestration/TestSuiteOrchestrator.ts +5 -4
  94. package/src/runtime/RunIntentService.ts +3 -0
  95. package/src/workflow/dsl/ChainCursorResolver.ts +36 -0
  96. package/tsdown.config.ts +1 -1
  97. package/dist/InMemoryRunDataFactory-hmkh0lzR.d.cts +0 -138
  98. package/dist/bootstrap-Dgzsjoj7.js.map +0 -1
  99. package/dist/bootstrap-dVmpU1ju.cjs.map +0 -1
  100. package/dist/runtime-Duf3ClPw.js.map +0 -1
  101. package/dist/runtime-vH0EeZzH.cjs.map +0 -1
@@ -0,0 +1,321 @@
1
+ import { Aa as TelemetrySpanScope, Fi as NodeExecutionContext, Mr as RunnableNodeConfig, Nr as RunnableNodeInputJson, On as TypeToken, Rt as ConnectionInvocationId, Sr as NodeOutputs, To as NodeId, fr as NodeConfigBase, gt as Expr, ir as Items, lo as CredentialRequirement, lr as JsonValue, nr as Item, q as McpServerDeclaration, wo as NodeConnectionName } from "./index-CSKKuK60.js";
2
+ import { ZodType, input, output } from "zod";
3
+
4
+ //#region src/ai/NodeBackedToolConfig.d.ts
5
+
6
+ declare class NodeBackedToolConfig<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> implements ToolConfig {
7
+ readonly name: string;
8
+ readonly node: TNodeConfig;
9
+ readonly type: TypeToken<unknown>;
10
+ readonly toolKind: "nodeBacked";
11
+ readonly description?: string;
12
+ readonly presentation?: AgentCanvasPresentation;
13
+ private readonly inputSchemaValue;
14
+ private readonly outputSchemaValue;
15
+ private readonly mapInputValue?;
16
+ private readonly mapOutputValue?;
17
+ constructor(name: string, node: TNodeConfig, options: NodeBackedToolConfigOptions<TNodeConfig, TInputSchema, TOutputSchema>);
18
+ getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
19
+ getInputSchema(): TInputSchema;
20
+ getOutputSchema(): TOutputSchema;
21
+ toNodeItem(args: NodeBackedToolInputMapperArgs<TNodeConfig, input<TInputSchema>>): Item<RunnableNodeInputJson<TNodeConfig>>;
22
+ toToolOutput(args: NodeBackedToolOutputMapperArgs<TNodeConfig, input<TInputSchema>>): output<TOutputSchema>;
23
+ private readDefaultToolOutput;
24
+ private isItem;
25
+ }
26
+ //#endregion
27
+ //#region src/ai/CallableToolConfig.d.ts
28
+ type CallableToolExecuteHandler<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> = (args: ToolExecuteArgs<CallableToolConfig<TInputSchema, TOutputSchema>, input<TInputSchema>>) => Promise<output<TOutputSchema>> | output<TOutputSchema>;
29
+ type CallableToolConfigOptions<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> = Readonly<{
30
+ name: string;
31
+ description?: string;
32
+ presentation?: AgentCanvasPresentation;
33
+ inputSchema: TInputSchema;
34
+ outputSchema: TOutputSchema;
35
+ /**
36
+ * Optional credential slots for this tool (same contract as other {@link ToolConfig} shapes).
37
+ */
38
+ credentialRequirements?: ReadonlyArray<CredentialRequirement>;
39
+ execute: CallableToolExecuteHandler<TInputSchema, TOutputSchema>;
40
+ }>;
41
+ /**
42
+ * Inline callable agent tool: DSL sugar over {@link ToolConfig} without a separate {@link NodeResolver}-registered {@link Tool} class.
43
+ */
44
+ declare class CallableToolConfig<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> implements ToolConfig {
45
+ readonly name: string;
46
+ readonly type: TypeToken<unknown>;
47
+ readonly toolKind: "callable";
48
+ readonly description?: string;
49
+ readonly presentation?: AgentCanvasPresentation;
50
+ private readonly inputSchemaValue;
51
+ private readonly outputSchemaValue;
52
+ private readonly credentialRequirementsValue?;
53
+ private readonly executeHandler;
54
+ constructor(name: string, options: CallableToolConfigOptions<TInputSchema, TOutputSchema>);
55
+ getCredentialRequirements(): ReadonlyArray<CredentialRequirement>;
56
+ getInputSchema(): TInputSchema;
57
+ getOutputSchema(): TOutputSchema;
58
+ /**
59
+ * Parses tool input and output with the configured Zod schemas.
60
+ */
61
+ executeTool(args: ToolExecuteArgs<CallableToolConfig<TInputSchema, TOutputSchema>, input<TInputSchema>>): Promise<output<TOutputSchema>>;
62
+ private parseInput;
63
+ private parseOutput;
64
+ private decorateValidationError;
65
+ }
66
+ //#endregion
67
+ //#region src/ai/CallableToolFactory.d.ts
68
+ declare class CallableToolFactoryImpl {
69
+ callableTool<TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny>(options: CallableToolConfigOptions<TInputSchema, TOutputSchema>): CallableToolConfig<TInputSchema, TOutputSchema>;
70
+ }
71
+ declare const CallableToolFactory: CallableToolFactoryImpl;
72
+ //#endregion
73
+ //#region src/ai/CallableToolKindToken.d.ts
74
+ /**
75
+ * Shared {@link import("../di").TypeToken} marker for {@link CallableToolConfig}.
76
+ * Callable tools are not registered in {@link NodeResolver}; this class only satisfies {@link ToolConfig#type}.
77
+ */
78
+ declare class CallableToolKindToken {}
79
+ //#endregion
80
+ //#region src/ai/AgentToolFactory.d.ts
81
+ declare class AgentToolFactoryImpl {
82
+ asTool<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny>(node: TNodeConfig, options: Readonly<{
83
+ name?: string;
84
+ } & NodeBackedToolConfigOptions<TNodeConfig, TInputSchema, TOutputSchema>>): NodeBackedToolConfig<TNodeConfig, TInputSchema, TOutputSchema>;
85
+ private withDefaultAgentInputMapper;
86
+ private mergeAgentToolInputWithCurrentItem;
87
+ private isMergeableRecord;
88
+ }
89
+ declare const AgentToolFactory: AgentToolFactoryImpl;
90
+ //#endregion
91
+ //#region src/ai/AgentMessageConfigNormalizerFactory.d.ts
92
+ declare class AgentMessageConfigNormalizer {
93
+ /**
94
+ * Prefer {@code input.messages} when present (ItemNode / engine-mapped payloads); otherwise resolve from
95
+ * {@link AgentNodeConfig.messages} templates.
96
+ */
97
+ static resolveFromInputOrConfig<TInputJson, TOutputJson>(input: unknown, config: AgentNodeConfig<TInputJson, TOutputJson>, args: AgentMessageBuildArgs<TInputJson>): ReadonlyArray<AgentMessageDto>;
98
+ static normalize<TInputJson, TOutputJson>(config: AgentNodeConfig<TInputJson, TOutputJson>, args: AgentMessageBuildArgs<TInputJson>): ReadonlyArray<AgentMessageDto>;
99
+ private static tryMessagesFromStructuredInput;
100
+ private static normalizeRichMessages;
101
+ private static lineToDto;
102
+ }
103
+ //#endregion
104
+ //#region src/ai/AgentConfigInspectorFactory.d.ts
105
+ declare class AgentConfigInspector {
106
+ static isAgentNodeConfig(config: NodeConfigBase | undefined): config is AgentNodeConfig<any, any>;
107
+ private static hasCompatibleMessageConfiguration;
108
+ }
109
+ //#endregion
110
+ //#region src/ai/AiHost.d.ts
111
+ interface AgentCanvasPresentation<TIcon extends string = string> {
112
+ readonly label?: string;
113
+ readonly icon?: TIcon;
114
+ }
115
+ type ZodSchemaAny = ZodType<any, any, any>;
116
+ interface ToolConfig {
117
+ readonly type: TypeToken<unknown>;
118
+ readonly name: string;
119
+ readonly description?: string;
120
+ readonly presentation?: AgentCanvasPresentation;
121
+ getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
122
+ }
123
+ type ToolExecuteArgs<TConfig extends ToolConfig = ToolConfig, TInput = unknown> = Readonly<{
124
+ config: TConfig;
125
+ input: TInput;
126
+ ctx: NodeExecutionContext<any>;
127
+ item: Item;
128
+ itemIndex: number;
129
+ items: Items;
130
+ /**
131
+ * Optional sub-agent boundary hooks: when present, the live `agent.tool.call` span and the
132
+ * planned tool-call invocationId are forwarded so node-backed runtimes can re-root their child
133
+ * execution scope. Plain function tools may safely ignore these hooks.
134
+ */
135
+ hooks?: Readonly<{
136
+ parentSpan?: TelemetrySpanScope;
137
+ parentInvocationId?: ConnectionInvocationId;
138
+ }>;
139
+ }>;
140
+ interface Tool<TConfig extends ToolConfig = ToolConfig, TInputSchema extends ZodSchemaAny = ZodSchemaAny, TOutputSchema extends ZodSchemaAny = ZodSchemaAny> {
141
+ readonly defaultDescription: string;
142
+ readonly inputSchema: TInputSchema;
143
+ readonly outputSchema: TOutputSchema;
144
+ execute(args: ToolExecuteArgs<TConfig, input<TInputSchema>>): Promise<output<TOutputSchema>> | output<TOutputSchema>;
145
+ }
146
+ type AgentTool<TInputSchema extends ZodSchemaAny = ZodSchemaAny, TOutputSchema extends ZodSchemaAny = ZodSchemaAny> = Tool<ToolConfig, TInputSchema, TOutputSchema>;
147
+ type AgentToolExecuteArgs<TInput = unknown> = ToolExecuteArgs<ToolConfig, TInput>;
148
+ type AgentToolToken = TypeToken<Tool<ToolConfig, ZodSchemaAny, ZodSchemaAny>>;
149
+ type AgentMessageRole = "system" | "user" | "assistant";
150
+ type AgentMessageBuildArgs<TInputJson = unknown> = Readonly<{
151
+ item: Item<TInputJson>;
152
+ itemIndex: number;
153
+ items: Items<TInputJson>;
154
+ ctx: NodeExecutionContext<any>;
155
+ }>;
156
+ interface AgentMessageDto {
157
+ readonly role: AgentMessageRole;
158
+ readonly content: string;
159
+ }
160
+ type AgentMessageTemplateContent<TInputJson = unknown> = string | ((args: AgentMessageBuildArgs<TInputJson>) => string);
161
+ interface AgentMessageTemplate<TInputJson = unknown> {
162
+ readonly role: AgentMessageRole;
163
+ readonly content: AgentMessageTemplateContent<TInputJson>;
164
+ }
165
+ /** A single prompt line: fixed DTO or template with optional function `content`. */
166
+ type AgentMessageLine<TInputJson = unknown> = AgentMessageDto | AgentMessageTemplate<TInputJson>;
167
+ /**
168
+ * Message list for an agent. Prefer a **plain array** of `{ role, content }` (optionally with function `content` for templates).
169
+ * Use the object form only when you need `buildMessages` to append messages after optional `prompt` lines.
170
+ */
171
+ type AgentMessageConfig<TInputJson = unknown> = Expr<ReadonlyArray<AgentMessageLine<TInputJson>>, TInputJson> | ReadonlyArray<AgentMessageLine<TInputJson>> | {
172
+ readonly prompt?: ReadonlyArray<AgentMessageLine<TInputJson>>;
173
+ readonly buildMessages?: (args: AgentMessageBuildArgs<TInputJson>) => ReadonlyArray<AgentMessageDto>;
174
+ };
175
+ type AgentTurnLimitBehavior = "error" | "respondWithLastMessage";
176
+ interface AgentModelInvocationOptions {
177
+ readonly maxTokens?: number;
178
+ readonly providerOptions?: Readonly<Record<string, JsonValue>>;
179
+ }
180
+ interface AgentGuardrailConfig {
181
+ readonly maxTurns?: number;
182
+ readonly onTurnLimitReached?: AgentTurnLimitBehavior;
183
+ readonly modelInvocationOptions?: AgentModelInvocationOptions;
184
+ }
185
+ /** Defaults aligned with common tool-agent iteration limits (many products use ~10 max rounds). */
186
+ declare const AgentGuardrailDefaults: {
187
+ readonly maxTurns: 10;
188
+ readonly onTurnLimitReached: AgentTurnLimitBehavior;
189
+ };
190
+ interface AgentToolDefinition {
191
+ readonly name: string;
192
+ readonly description: string;
193
+ readonly inputSchema: ZodSchemaAny;
194
+ }
195
+ type AgentToolCall = Readonly<{
196
+ id?: string;
197
+ name: string;
198
+ input: unknown;
199
+ }>;
200
+ type AgentToolCallPlanner<_TNodeConfig = unknown> = (item: Item, index: number, items: Items, ctx: NodeExecutionContext<any>) => ReadonlyArray<AgentToolCall>;
201
+ interface ChatModelConfig {
202
+ readonly type: TypeToken<ChatModelFactory<ChatModelConfig>>;
203
+ readonly name: string;
204
+ readonly provider?: string;
205
+ readonly modelName?: string;
206
+ readonly presentation?: AgentCanvasPresentation;
207
+ getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
208
+ }
209
+ /**
210
+ * Provider-neutral chat language model wrapper returned by a {@link ChatModelFactory}.
211
+ *
212
+ * Thin adapter around an AI SDK `LanguageModelV2` (from `@ai-sdk/provider`) plus the call-site
213
+ * defaults Codemation needs at every generate/stream: the provider label, the model name used for
214
+ * pricing / telemetry, and the default invocation options (max output tokens, temperature,
215
+ * provider-specific overrides).
216
+ *
217
+ * The consumer (AIAgentNode / AgentStructuredOutputRunner) passes `languageModel` directly into
218
+ * `generateText({ model, ... })` from the `ai` package.
219
+ */
220
+ interface ChatLanguageModel {
221
+ /** AI SDK `LanguageModelV2` instance (kept `unknown` to avoid leaking the SDK type into `@codemation/core`). */
222
+ readonly languageModel: unknown;
223
+ /** Stable pricing/telemetry key — e.g. `"gpt-4.1-nano"`. */
224
+ readonly modelName: string;
225
+ /** Provider label — e.g. `"openai"`. Used for cost tracking. */
226
+ readonly provider?: string;
227
+ /** Defaults merged into every call. Consumers may override per-invocation. */
228
+ readonly defaultCallOptions?: ChatLanguageModelCallOptions;
229
+ }
230
+ interface ChatLanguageModelCallOptions {
231
+ readonly maxOutputTokens?: number;
232
+ readonly temperature?: number;
233
+ readonly providerOptions?: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
234
+ }
235
+ /**
236
+ * Options for a structured-output generate call. Mirrors
237
+ * `generateText({ output: Output.object(...) })` from the `ai` package.
238
+ */
239
+ interface StructuredOutputOptions {
240
+ /** Optional schema name — used by some providers as the JSON schema name attribute. */
241
+ readonly schemaName?: string;
242
+ /** When `true`, the consumer should pass a strict-mode-compatible JSON Schema record. */
243
+ readonly strict?: boolean;
244
+ }
245
+ interface ChatModelFactory<TConfig extends ChatModelConfig = ChatModelConfig> {
246
+ create(args: Readonly<{
247
+ config: TConfig;
248
+ ctx: NodeExecutionContext<any>;
249
+ }>): Promise<ChatLanguageModel> | ChatLanguageModel;
250
+ }
251
+ type NodeBackedToolInputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = Readonly<{
252
+ input: TToolInput;
253
+ item: Item;
254
+ itemIndex: number;
255
+ items: Items;
256
+ ctx: NodeExecutionContext<any>;
257
+ node: TNodeConfig;
258
+ }>;
259
+ type NodeBackedToolOutputMapperArgs<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = Readonly<{
260
+ input: TToolInput;
261
+ item: Item;
262
+ itemIndex: number;
263
+ items: Items;
264
+ ctx: NodeExecutionContext<any>;
265
+ node: TNodeConfig;
266
+ outputs: NodeOutputs;
267
+ }>;
268
+ type NodeBackedToolInputMapper<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown> = (args: NodeBackedToolInputMapperArgs<TNodeConfig, TToolInput>) => Item<RunnableNodeInputJson<TNodeConfig>> | RunnableNodeInputJson<TNodeConfig>;
269
+ type NodeBackedToolOutputMapper<TNodeConfig extends RunnableNodeConfig<any, any>, TToolInput = unknown, TToolOutput = unknown> = (args: NodeBackedToolOutputMapperArgs<TNodeConfig, TToolInput>) => TToolOutput;
270
+ type NodeBackedToolConfigOptions<TNodeConfig extends RunnableNodeConfig<any, any>, TInputSchema extends ZodSchemaAny, TOutputSchema extends ZodSchemaAny> = Readonly<{
271
+ description?: string;
272
+ presentation?: AgentCanvasPresentation;
273
+ inputSchema: TInputSchema;
274
+ outputSchema: TOutputSchema;
275
+ mapInput?: NodeBackedToolInputMapper<TNodeConfig, input<TInputSchema>>;
276
+ mapOutput?: NodeBackedToolOutputMapper<TNodeConfig, input<TInputSchema>, output<TOutputSchema>>;
277
+ }>;
278
+ interface AgentNodeConfig<TInputJson = unknown, TOutputJson = unknown> extends RunnableNodeConfig<TInputJson, TOutputJson> {
279
+ readonly messages: AgentMessageConfig<TInputJson>;
280
+ readonly chatModel: ChatModelConfig;
281
+ readonly tools?: ReadonlyArray<ToolConfig>;
282
+ readonly guardrails?: AgentGuardrailConfig;
283
+ readonly outputSchema?: ZodType<TOutputJson>;
284
+ }
285
+ type AgentAttachmentRole = "languageModel" | "tool" | "nestedAgent";
286
+ //#endregion
287
+ //#region src/ai/AgentConnectionNodeCollector.d.ts
288
+ type AgentConnectionNodeRole = "languageModel" | "tool" | "nestedAgent";
289
+ type AgentConnectionCredentialSource = Readonly<{
290
+ getCredentialRequirements?(): ReadonlyArray<CredentialRequirement>;
291
+ }>;
292
+ type AgentConnectionNodeDescriptor = Readonly<{
293
+ nodeId: NodeId;
294
+ parentNodeId: NodeId;
295
+ connectionName: NodeConnectionName;
296
+ role: AgentConnectionNodeRole;
297
+ name: string;
298
+ typeName: string;
299
+ icon?: string;
300
+ credentialSource: AgentConnectionCredentialSource;
301
+ }>;
302
+ type McpServerResolver = (id: string) => McpServerDeclaration | undefined;
303
+ type AgentConnectionNodeCollectorApi = Readonly<{
304
+ collect(parentNodeId: NodeId, agentConfig: AgentNodeConfig<any, any>, mcpServerResolver?: McpServerResolver): ReadonlyArray<AgentConnectionNodeDescriptor>;
305
+ }>;
306
+ declare const AgentConnectionNodeCollector: AgentConnectionNodeCollectorApi;
307
+ //#endregion
308
+ //#region src/serialization/ItemsInputNormalizer.d.ts
309
+ /**
310
+ * Normalizes external inputs into the engine's canonical `Items` shape.
311
+ * Used at host and builder boundaries where callers may provide either a raw value,
312
+ * a single item-like object, or an array of item-like values.
313
+ */
314
+ declare class ItemsInputNormalizer {
315
+ normalize(raw: unknown): Items;
316
+ private normalizeItem;
317
+ private isItem;
318
+ }
319
+ //#endregion
320
+ export { ChatModelFactory as A, ZodSchemaAny as B, AgentToolDefinition as C, ChatLanguageModel as D, AgentTurnLimitBehavior as E, NodeBackedToolOutputMapperArgs as F, CallableToolFactory as G, AgentMessageConfigNormalizer as H, StructuredOutputOptions as I, CallableToolExecuteHandler as J, CallableToolConfig as K, Tool as L, NodeBackedToolInputMapper as M, NodeBackedToolInputMapperArgs as N, ChatLanguageModelCallOptions as O, NodeBackedToolOutputMapper as P, ToolConfig as R, AgentToolCallPlanner as S, AgentToolToken as T, AgentToolFactory as U, AgentConfigInspector as V, CallableToolKindToken as W, NodeBackedToolConfig as Y, AgentMessageTemplateContent as _, AgentConnectionNodeRole as a, AgentTool as b, AgentCanvasPresentation as c, AgentMessageBuildArgs as d, AgentMessageConfig as f, AgentMessageTemplate as g, AgentMessageRole as h, AgentConnectionNodeDescriptor as i, NodeBackedToolConfigOptions as j, ChatModelConfig as k, AgentGuardrailConfig as l, AgentMessageLine as m, AgentConnectionCredentialSource as n, McpServerResolver as o, AgentMessageDto as p, CallableToolConfigOptions as q, AgentConnectionNodeCollector as r, AgentAttachmentRole as s, ItemsInputNormalizer as t, AgentGuardrailDefaults as u, AgentModelInvocationOptions as v, AgentToolExecuteArgs as w, AgentToolCall as x, AgentNodeConfig as y, ToolExecuteArgs as z };
321
+ //# sourceMappingURL=ItemsInputNormalizer-C09a7iFP.d.ts.map