@codemation/core 0.10.2 → 0.11.1
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 +183 -0
- package/dist/CostCatalogContract-DZgcUBE4.d.cts +19 -0
- package/dist/{EngineRuntimeRegistration.types-ClLuY1FG.d.ts → EngineRuntimeRegistration.types-BQbS9_gs.d.ts} +2 -2
- package/dist/{EngineRuntimeRegistration.types-BryWi2mA.d.cts → EngineRuntimeRegistration.types-Cggm5GVY.d.cts} +8 -2
- package/dist/{InMemoryRunDataFactory-DeXNJt1O.d.cts → InMemoryRunDataFactory-C7YItvHG.d.cts} +9 -19
- package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js → InMemoryRunEventBusRegistry-Bwunvt1T.js} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-sM4z4n_i.js.map → InMemoryRunEventBusRegistry-Bwunvt1T.js.map} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs → InMemoryRunEventBusRegistry-Sa86VxuV.cjs} +1 -1
- package/dist/{InMemoryRunEventBusRegistry-VM3OWnHo.cjs.map → InMemoryRunEventBusRegistry-Sa86VxuV.cjs.map} +1 -1
- package/dist/ItemsInputNormalizer-C_dpn76M.d.cts +407 -0
- package/dist/ItemsInputNormalizer-CwdOhSAK.cjs +43 -0
- package/dist/ItemsInputNormalizer-CwdOhSAK.cjs.map +1 -0
- package/dist/ItemsInputNormalizer-D-MH8MBs.js +36 -0
- package/dist/ItemsInputNormalizer-D-MH8MBs.js.map +1 -0
- package/dist/ItemsInputNormalizer-_Mfcd3YU.d.ts +321 -0
- package/dist/RunIntentService-BVur7x9n.d.ts +285 -0
- package/dist/RunIntentService-CEF-sFfI.d.cts +206 -0
- package/dist/{RunIntentService-BqNjrksF.d.cts → agentMcpTypes-ZiNbNsEi.d.cts} +1717 -1809
- package/dist/bootstrap/index.cjs +4 -2
- package/dist/bootstrap/index.d.cts +8 -3
- package/dist/bootstrap/index.d.ts +6 -4
- package/dist/bootstrap/index.js +4 -2
- package/dist/{bootstrap-DtjQtuvi.cjs → bootstrap-BxuTFTLB.cjs} +41 -34
- package/dist/bootstrap-BxuTFTLB.cjs.map +1 -0
- package/dist/{bootstrap-BfFKGzyj.js → bootstrap-D_Yyi0wL.js} +9 -2
- package/dist/bootstrap-D_Yyi0wL.js.map +1 -0
- package/dist/browser.cjs +16 -0
- package/dist/browser.d.cts +4 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +4 -0
- package/dist/contracts-CK0x6w_G.cjs +74 -0
- package/dist/contracts-CK0x6w_G.cjs.map +1 -0
- package/dist/contracts-DXdfTdpW.js +50 -0
- package/dist/contracts-DXdfTdpW.js.map +1 -0
- package/dist/contracts.cjs +6 -0
- package/dist/contracts.d.cts +5 -0
- package/dist/contracts.d.ts +2 -0
- package/dist/contracts.js +3 -0
- package/dist/di-0Wop7z1y.js +376 -0
- package/dist/di-0Wop7z1y.js.map +1 -0
- package/dist/di-BlEKdoZS.cjs +489 -0
- package/dist/di-BlEKdoZS.cjs.map +1 -0
- package/dist/executionPersistenceContracts-BgZMRsTa.d.cts +275 -0
- package/dist/{index-CJQtTY_M.d.ts → index-62Ba9f7D.d.ts} +114 -320
- package/dist/{RunIntentService-CI-F8qQ7.d.ts → index-zWGtEhrf.d.ts} +1811 -1914
- package/dist/index.cjs +76 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -656
- package/dist/index.d.ts +5 -3
- package/dist/index.js +52 -50
- package/dist/index.js.map +1 -1
- package/dist/params-B5SENSzZ.d.cts +44 -0
- package/dist/{runtime-_ywksLa6.cjs → runtime-DBzq5YBi.cjs} +125 -489
- package/dist/runtime-DBzq5YBi.cjs.map +1 -0
- package/dist/{runtime-DbMjpb5d.js → runtime-cxmUkk0l.js} +117 -369
- package/dist/runtime-cxmUkk0l.js.map +1 -0
- package/dist/testing.cjs +23 -21
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +4 -3
- package/dist/testing.d.ts +3 -2
- package/dist/testing.js +5 -3
- package/dist/testing.js.map +1 -1
- package/package.json +12 -17
- package/src/ai/AgentConnectionNodeCollector.ts +47 -5
- package/src/authoring/defineNode.types.ts +21 -1
- package/src/authoring/definePollingTrigger.types.ts +20 -0
- package/src/binaries/UnavailableBinaryStorage.ts +6 -0
- package/src/bootstrap/runtime/EngineRuntimeRegistrar.ts +9 -0
- package/src/browser.ts +1 -0
- package/src/contracts/AgentBindError.ts +11 -0
- package/src/contracts/CodemationTelemetryAttributeNames.ts +4 -0
- package/src/contracts/NoOpAgentMcpIntegration.ts +13 -0
- package/src/contracts/agentMcpTypes.ts +64 -0
- package/src/contracts/index.ts +4 -0
- package/src/contracts/mcpTypes.ts +29 -0
- package/src/contracts/runTypes.ts +8 -0
- package/src/contracts/runtimeTypes.ts +4 -0
- package/src/contracts/workflowTypes.ts +21 -0
- package/src/contracts.ts +3 -0
- package/src/credentials/OAuthFlowExecutor.types.ts +45 -0
- package/src/di/CoreTokens.ts +7 -0
- package/src/execution/InProcessRetryRunner.ts +31 -5
- package/src/execution/NodeExecutor.ts +27 -7
- package/src/execution/NodeRunStateWriter.ts +2 -0
- package/src/index.ts +10 -0
- package/src/orchestration/RunContinuationService.ts +6 -2
- package/src/runStorage/InMemoryBinaryStorageRegistry.ts +10 -0
- package/src/scheduler/InlineDrivingScheduler.ts +26 -22
- package/src/types/index.ts +1 -0
- package/src/validation/WorkflowEdgePortError.types.ts +16 -0
- package/src/validation/WorkflowEdgePortValidator.ts +52 -0
- package/src/workflow/definition/ConnectionInvocationIdFactory.ts +4 -3
- package/src/workflow/definition/ConnectionNodeIdFactory.ts +25 -0
- package/src/workflow/definition/NodeIterationIdFactory.ts +5 -3
- package/src/workflowSnapshots/WorkflowSnapshotCodec.ts +42 -10
- package/tsdown.config.ts +1 -1
- package/dist/bootstrap-BfFKGzyj.js.map +0 -1
- package/dist/bootstrap-DtjQtuvi.cjs.map +0 -1
- package/dist/runtime-DbMjpb5d.js.map +0 -1
- package/dist/runtime-_ywksLa6.cjs.map +0 -1
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { $a as NodeId, La as CredentialRequirement, Ln as Item, Qa as NodeConnectionName, St as ConnectionInvocationId, Wn as JsonValue, di as NodeExecutionContext, et as Expr, ia as TelemetrySpanScope, j as McpServerDeclaration, ln as TypeToken, mr as RunnableNodeInputJson, pr as RunnableNodeConfig, qn as NodeConfigBase, rr as NodeOutputs, zn as Items } from "./index-zWGtEhrf.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-_Mfcd3YU.d.ts.map
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { $a as NodeId, $t as WebhookRunResult, At as NodeInputsByPort, Bi as WebhookInvocationMatch, Cn as EngineExecutionLimitsPolicyConfig, Cr as WorkflowErrorHandlerSpec, Dr as WorkflowPolicyRuntimeDefaults, Hi as WebhookTriggerResolution, Ht as RunCurrentState, Ii as WorkflowSnapshotResolver, It as PersistedRunState, Kn as NodeActivationId, Li as HttpMethod, Lt as PersistedWorkflowSnapshot, Mi as WorkflowRepository, Rt as PersistedWorkflowSnapshotNode, Sn as EngineExecutionLimitsPolicy, Sr as WorkflowErrorHandler, Vi as WebhookTriggerMatcher, Wt as RunExecutionOptions, Xt as RunStopCondition, Yn as NodeErrorHandler, Zn as NodeErrorHandlerSpec, _i as NodeResolver, ai as NodeActivationContinuation, br as WorkflowDefinition, cr as PersistedRunPolicySnapshot, dr as RunId, fi as NodeExecutionRequest, kr as WorkflowStoragePolicyDecisionArgs, nn as WorkflowExecutionRepository, no as WorkflowId, pi as NodeExecutionRequestHandler, qn as NodeConfigBase, qt as RunResult, ri as LiveWorkflowRepository, rr as NodeOutputs, sr as ParentExecutionRef, wt as CurrentStateExecutionRequest, zn as Items, zt as PersistedWorkflowTokenRegistryLike } from "./index-zWGtEhrf.js";
|
|
2
|
+
|
|
3
|
+
//#region src/orchestration/Engine.d.ts
|
|
4
|
+
interface EngineTriggerRuntime {
|
|
5
|
+
startTriggers(): Promise<void>;
|
|
6
|
+
stop(): Promise<void>;
|
|
7
|
+
syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise<void>;
|
|
8
|
+
createTriggerTestItems(args: {
|
|
9
|
+
workflow: WorkflowDefinition;
|
|
10
|
+
nodeId: NodeId;
|
|
11
|
+
}): Promise<Items | undefined>;
|
|
12
|
+
}
|
|
13
|
+
interface EngineRunStartService {
|
|
14
|
+
runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{
|
|
15
|
+
workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
|
|
16
|
+
mutableState?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["mutableState"];
|
|
17
|
+
}>): Promise<RunResult>;
|
|
18
|
+
runWorkflowFromState(request: CurrentStateExecutionRequest): Promise<RunResult>;
|
|
19
|
+
}
|
|
20
|
+
interface EngineRunContinuationService {
|
|
21
|
+
markNodeRunning(args: {
|
|
22
|
+
runId: RunId;
|
|
23
|
+
activationId: NodeActivationId;
|
|
24
|
+
nodeId: NodeId;
|
|
25
|
+
inputsByPort: NodeInputsByPort;
|
|
26
|
+
}): Promise<void>;
|
|
27
|
+
resumeFromNodeResult(args: {
|
|
28
|
+
runId: RunId;
|
|
29
|
+
activationId: NodeActivationId;
|
|
30
|
+
nodeId: NodeId;
|
|
31
|
+
outputs: NodeOutputs;
|
|
32
|
+
}): Promise<RunResult>;
|
|
33
|
+
resumeFromNodeError(args: {
|
|
34
|
+
runId: RunId;
|
|
35
|
+
activationId: NodeActivationId;
|
|
36
|
+
nodeId: NodeId;
|
|
37
|
+
error: Error;
|
|
38
|
+
}): Promise<RunResult>;
|
|
39
|
+
resumeFromStepResult(args: {
|
|
40
|
+
runId: RunId;
|
|
41
|
+
activationId: NodeActivationId;
|
|
42
|
+
nodeId: NodeId;
|
|
43
|
+
outputs: NodeOutputs;
|
|
44
|
+
}): Promise<RunResult>;
|
|
45
|
+
resumeFromStepError(args: {
|
|
46
|
+
runId: RunId;
|
|
47
|
+
activationId: NodeActivationId;
|
|
48
|
+
nodeId: NodeId;
|
|
49
|
+
error: Error;
|
|
50
|
+
}): Promise<RunResult>;
|
|
51
|
+
waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
|
|
52
|
+
status: "completed" | "failed";
|
|
53
|
+
}>>;
|
|
54
|
+
waitForWebhookResponse(runId: RunId): Promise<WebhookRunResult>;
|
|
55
|
+
}
|
|
56
|
+
interface EngineNodeExecutionRequestHandler {
|
|
57
|
+
handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
interface EngineFacadeDeps {
|
|
60
|
+
liveWorkflowRepository: LiveWorkflowRepository;
|
|
61
|
+
tokenRegistry: PersistedWorkflowTokenRegistryLike;
|
|
62
|
+
webhookTriggerMatcher: WebhookTriggerMatcher;
|
|
63
|
+
workflowSnapshotResolver: WorkflowSnapshotResolver;
|
|
64
|
+
triggerRuntime: EngineTriggerRuntime;
|
|
65
|
+
runStartService: EngineRunStartService;
|
|
66
|
+
runContinuationService: EngineRunContinuationService;
|
|
67
|
+
nodeExecutionRequestHandler: EngineNodeExecutionRequestHandler;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Runtime facade for orchestration, continuation, triggers, and webhook routing.
|
|
71
|
+
* Prefer {@link import("../intents/RunIntentService").RunIntentService} for host/HTTP invocation boundaries.
|
|
72
|
+
* The class token is exported from `@codemation/core/bootstrap` (not the main `@codemation/core` barrel).
|
|
73
|
+
*/
|
|
74
|
+
declare class Engine implements NodeActivationContinuation, NodeExecutionRequestHandler {
|
|
75
|
+
private readonly deps;
|
|
76
|
+
constructor(deps: EngineFacadeDeps);
|
|
77
|
+
loadWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
78
|
+
getTokenRegistry(): EngineFacadeDeps["tokenRegistry"];
|
|
79
|
+
resolveWorkflowSnapshot(args: {
|
|
80
|
+
workflowId: WorkflowId;
|
|
81
|
+
workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
|
|
82
|
+
}): WorkflowDefinition | undefined;
|
|
83
|
+
startTriggers(): Promise<void>;
|
|
84
|
+
syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise<void>;
|
|
85
|
+
start(workflows: WorkflowDefinition[]): Promise<void>;
|
|
86
|
+
stop(): Promise<void>;
|
|
87
|
+
resolveWebhookTrigger(args: {
|
|
88
|
+
endpointPath: string;
|
|
89
|
+
method: HttpMethod;
|
|
90
|
+
}): WebhookTriggerResolution;
|
|
91
|
+
createTriggerTestItems(args: {
|
|
92
|
+
workflow: WorkflowDefinition;
|
|
93
|
+
nodeId: NodeId;
|
|
94
|
+
}): Promise<Items | undefined>;
|
|
95
|
+
runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{
|
|
96
|
+
workflowSnapshot?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["workflowSnapshot"];
|
|
97
|
+
mutableState?: NonNullable<Awaited<ReturnType<WorkflowExecutionRepository["load"]>>>["mutableState"];
|
|
98
|
+
}>): Promise<RunResult>;
|
|
99
|
+
runWorkflowFromState(request: CurrentStateExecutionRequest): Promise<RunResult>;
|
|
100
|
+
markNodeRunning(args: {
|
|
101
|
+
runId: RunId;
|
|
102
|
+
activationId: NodeActivationId;
|
|
103
|
+
nodeId: NodeId;
|
|
104
|
+
inputsByPort: NodeInputsByPort;
|
|
105
|
+
}): Promise<void>;
|
|
106
|
+
resumeFromNodeResult(args: {
|
|
107
|
+
runId: RunId;
|
|
108
|
+
activationId: NodeActivationId;
|
|
109
|
+
nodeId: NodeId;
|
|
110
|
+
outputs: NodeOutputs;
|
|
111
|
+
}): Promise<RunResult>;
|
|
112
|
+
resumeFromNodeError(args: {
|
|
113
|
+
runId: RunId;
|
|
114
|
+
activationId: NodeActivationId;
|
|
115
|
+
nodeId: NodeId;
|
|
116
|
+
error: Error;
|
|
117
|
+
}): Promise<RunResult>;
|
|
118
|
+
resumeFromStepResult(args: {
|
|
119
|
+
runId: RunId;
|
|
120
|
+
activationId: NodeActivationId;
|
|
121
|
+
nodeId: NodeId;
|
|
122
|
+
outputs: NodeOutputs;
|
|
123
|
+
}): Promise<RunResult>;
|
|
124
|
+
resumeFromStepError(args: {
|
|
125
|
+
runId: RunId;
|
|
126
|
+
activationId: NodeActivationId;
|
|
127
|
+
nodeId: NodeId;
|
|
128
|
+
error: Error;
|
|
129
|
+
}): Promise<RunResult>;
|
|
130
|
+
waitForCompletion(runId: RunId): Promise<Extract<RunResult, {
|
|
131
|
+
status: "completed" | "failed";
|
|
132
|
+
}>>;
|
|
133
|
+
waitForWebhookResponse(runId: RunId): Promise<WebhookRunResult>;
|
|
134
|
+
handleNodeExecutionRequest(request: NodeExecutionRequest): Promise<void>;
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/policies/storage/WorkflowStoragePolicyEvaluator.d.ts
|
|
138
|
+
declare class WorkflowStoragePolicyEvaluator {
|
|
139
|
+
private readonly nodeResolver;
|
|
140
|
+
constructor(nodeResolver: NodeResolver);
|
|
141
|
+
shouldPersist(workflow: WorkflowDefinition, snapshot: PersistedRunPolicySnapshot | undefined, args: WorkflowStoragePolicyDecisionArgs): Promise<boolean>;
|
|
142
|
+
private modeMatches;
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/policies/storage/RunTerminalPersistenceCoordinator.d.ts
|
|
146
|
+
declare class RunTerminalPersistenceCoordinator {
|
|
147
|
+
private readonly runRepository;
|
|
148
|
+
private readonly storageEvaluator;
|
|
149
|
+
constructor(runRepository: WorkflowExecutionRepository, storageEvaluator: WorkflowStoragePolicyEvaluator);
|
|
150
|
+
maybeDeleteAfterTerminalState(args: {
|
|
151
|
+
workflow: WorkflowDefinition;
|
|
152
|
+
state: PersistedRunState;
|
|
153
|
+
finalStatus: "completed" | "failed";
|
|
154
|
+
finishedAt: string;
|
|
155
|
+
}): Promise<void>;
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/policies/WorkflowPolicyErrorServices.d.ts
|
|
159
|
+
declare class WorkflowPolicyErrorServices {
|
|
160
|
+
private readonly nodeResolver;
|
|
161
|
+
constructor(nodeResolver: NodeResolver);
|
|
162
|
+
resolveNodeErrorHandler(spec: NodeErrorHandlerSpec | undefined): NodeErrorHandler | undefined;
|
|
163
|
+
resolveWorkflowErrorHandler(spec: WorkflowErrorHandlerSpec | undefined): WorkflowErrorHandler | undefined;
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/policies/executionLimits/EngineExecutionLimitsPolicyFactory.d.ts
|
|
167
|
+
/**
|
|
168
|
+
* Builds {@link EngineExecutionLimitsPolicy} by merging {@link ENGINE_EXECUTION_LIMITS_DEFAULTS} with optional `overrides` (e.g. host `runtime.engineExecutionLimits`).
|
|
169
|
+
*/
|
|
170
|
+
declare class EngineExecutionLimitsPolicyFactory {
|
|
171
|
+
create(overrides?: Partial<EngineExecutionLimitsPolicyConfig>): EngineExecutionLimitsPolicy;
|
|
172
|
+
}
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/policies/storage/RunPolicySnapshotFactory.d.ts
|
|
175
|
+
declare class RunPolicySnapshotFactory {
|
|
176
|
+
static create(workflow: WorkflowDefinition, defaults?: WorkflowPolicyRuntimeDefaults): PersistedRunPolicySnapshot;
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/workflowSnapshots/WorkflowSnapshotCodec.d.ts
|
|
180
|
+
declare class WorkflowSnapshotCodec {
|
|
181
|
+
private readonly tokenRegistry;
|
|
182
|
+
constructor(tokenRegistry: PersistedWorkflowTokenRegistryLike);
|
|
183
|
+
create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot;
|
|
184
|
+
hydrate(snapshotNode: PersistedWorkflowSnapshotNode, liveConfig: NodeConfigBase): NodeConfigBase;
|
|
185
|
+
private serializeConfig;
|
|
186
|
+
/**
|
|
187
|
+
* Safely call `config.inspectorSummary()` and return a plain JSON-safe array, or undefined.
|
|
188
|
+
* Returns undefined if the method is absent, throws, or produces no valid rows.
|
|
189
|
+
*/
|
|
190
|
+
private safeInspectorSummary;
|
|
191
|
+
private injectTokenIds;
|
|
192
|
+
private mergeValue;
|
|
193
|
+
private mergeNestedValue;
|
|
194
|
+
private restoreNonSerializableProperties;
|
|
195
|
+
private restoreTypeProperty;
|
|
196
|
+
private resolveTokenId;
|
|
197
|
+
private resolveTokenName;
|
|
198
|
+
private asTypeToken;
|
|
199
|
+
private asRecord;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/runtime/EngineWorkflowRunnerService.d.ts
|
|
203
|
+
declare class EngineWorkflowRunnerService {
|
|
204
|
+
private readonly engine;
|
|
205
|
+
private readonly workflowRepository;
|
|
206
|
+
constructor(engine: Engine, workflowRepository: WorkflowRepository);
|
|
207
|
+
runById(args: {
|
|
208
|
+
workflowId: WorkflowId;
|
|
209
|
+
startAt?: NodeId;
|
|
210
|
+
items: Items;
|
|
211
|
+
parent?: ParentExecutionRef;
|
|
212
|
+
}): Promise<RunResult>;
|
|
213
|
+
private findDefaultStartNodeId;
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/runtime/InMemoryLiveWorkflowRepository.d.ts
|
|
217
|
+
declare class InMemoryLiveWorkflowRepository implements LiveWorkflowRepository {
|
|
218
|
+
private readonly workflowsById;
|
|
219
|
+
setWorkflows(workflows: ReadonlyArray<WorkflowDefinition>): void;
|
|
220
|
+
list(): ReadonlyArray<WorkflowDefinition>;
|
|
221
|
+
get(workflowId: WorkflowId): WorkflowDefinition | undefined;
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/runtime/RunIntentService.d.ts
|
|
225
|
+
type StartWorkflowIntent = {
|
|
226
|
+
workflow: WorkflowDefinition;
|
|
227
|
+
startAt?: string;
|
|
228
|
+
items: Items;
|
|
229
|
+
synthesizeTriggerItems?: boolean;
|
|
230
|
+
parent?: CurrentStateExecutionRequest["parent"];
|
|
231
|
+
executionOptions?: RunExecutionOptions;
|
|
232
|
+
workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"];
|
|
233
|
+
mutableState?: CurrentStateExecutionRequest["mutableState"];
|
|
234
|
+
currentState?: RunCurrentState;
|
|
235
|
+
stopCondition?: RunStopCondition;
|
|
236
|
+
reset?: CurrentStateExecutionRequest["reset"];
|
|
237
|
+
};
|
|
238
|
+
type RerunFromNodeIntent = {
|
|
239
|
+
workflow: WorkflowDefinition;
|
|
240
|
+
nodeId: NodeId;
|
|
241
|
+
currentState: RunCurrentState;
|
|
242
|
+
items?: Items;
|
|
243
|
+
synthesizeTriggerItems?: boolean;
|
|
244
|
+
parent?: CurrentStateExecutionRequest["parent"];
|
|
245
|
+
executionOptions?: RunExecutionOptions;
|
|
246
|
+
workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"];
|
|
247
|
+
mutableState?: CurrentStateExecutionRequest["mutableState"];
|
|
248
|
+
};
|
|
249
|
+
type MatchedWebhookRunIntent = {
|
|
250
|
+
endpointPath: string;
|
|
251
|
+
method: HttpMethod;
|
|
252
|
+
requestItem: Items[number];
|
|
253
|
+
};
|
|
254
|
+
type WebhookMatchRunIntent = {
|
|
255
|
+
match: WebhookInvocationMatch;
|
|
256
|
+
requestItem: Items[number];
|
|
257
|
+
};
|
|
258
|
+
declare class RunIntentService {
|
|
259
|
+
private readonly engine;
|
|
260
|
+
private readonly workflowRepository;
|
|
261
|
+
constructor(engine: Engine, workflowRepository: WorkflowRepository);
|
|
262
|
+
startWorkflow(args: StartWorkflowIntent): Promise<RunResult>;
|
|
263
|
+
rerunFromNode(args: RerunFromNodeIntent): Promise<RunResult>;
|
|
264
|
+
private resolveStartWorkflowItems;
|
|
265
|
+
private resolveRerunItems;
|
|
266
|
+
private resolveStartWorkflowTriggerNodeId;
|
|
267
|
+
private resolveRerunTriggerNodeId;
|
|
268
|
+
private firstTriggerNodeId;
|
|
269
|
+
private isTriggerNode;
|
|
270
|
+
private hasNonEmptyItems;
|
|
271
|
+
resolveWebhookTrigger(args: {
|
|
272
|
+
endpointPath: string;
|
|
273
|
+
method: HttpMethod;
|
|
274
|
+
}): WebhookTriggerResolution;
|
|
275
|
+
runMatchedWebhook(args: MatchedWebhookRunIntent): Promise<WebhookRunResult>;
|
|
276
|
+
runWebhookMatch(args: WebhookMatchRunIntent): Promise<WebhookRunResult>;
|
|
277
|
+
/**
|
|
278
|
+
* Webhook-triggered runs always force inline execution first.
|
|
279
|
+
* This is the highest-precedence scheduler override: it wins over node hints and container defaults.
|
|
280
|
+
*/
|
|
281
|
+
private createWebhookExecutionOptions;
|
|
282
|
+
}
|
|
283
|
+
//#endregion
|
|
284
|
+
export { RunPolicySnapshotFactory as a, RunTerminalPersistenceCoordinator as c, WorkflowSnapshotCodec as i, WorkflowStoragePolicyEvaluator as l, InMemoryLiveWorkflowRepository as n, EngineExecutionLimitsPolicyFactory as o, EngineWorkflowRunnerService as r, WorkflowPolicyErrorServices as s, RunIntentService as t, Engine as u };
|
|
285
|
+
//# sourceMappingURL=RunIntentService-BVur7x9n.d.ts.map
|