callman-core 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-packs/scenario-nodes.md +57 -2
- package/dist/ai/prompts/scenario.d.ts +1 -1
- package/dist/ai/prompts/scenario.d.ts.map +1 -1
- package/dist/ai/prompts/scenario.js +3 -1
- package/dist/ai/prompts/scenario.js.map +1 -1
- package/dist/ai/prompts/scenarioNodeDefaults.d.ts.map +1 -1
- package/dist/ai/prompts/scenarioNodeDefaults.js +9 -0
- package/dist/ai/prompts/scenarioNodeDefaults.js.map +1 -1
- package/dist/ai/prompts/scenarioNodeReference.d.ts.map +1 -1
- package/dist/ai/prompts/scenarioNodeReference.js +80 -2
- package/dist/ai/prompts/scenarioNodeReference.js.map +1 -1
- package/dist/host/index.d.ts +2 -0
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +3 -0
- package/dist/host/index.js.map +1 -1
- package/dist/host/temporal/temporalService.d.ts +67 -0
- package/dist/host/temporal/temporalService.d.ts.map +1 -0
- package/dist/host/temporal/temporalService.js +1182 -0
- package/dist/host/temporal/temporalService.js.map +1 -0
- package/dist/host/temporal/types.d.ts +13 -0
- package/dist/host/temporal/types.d.ts.map +1 -0
- package/dist/host/temporal/types.js +5 -0
- package/dist/host/temporal/types.js.map +1 -0
- package/dist/scenario-runner/adapters/connection-config.d.ts +17 -1
- package/dist/scenario-runner/adapters/connection-config.d.ts.map +1 -1
- package/dist/scenario-runner/adapters/index.d.ts +3 -2
- package/dist/scenario-runner/adapters/index.d.ts.map +1 -1
- package/dist/scenario-runner/adapters/index.js +7 -0
- package/dist/scenario-runner/adapters/index.js.map +1 -1
- package/dist/scenario-runner/adapters/temporal-executor.d.ts +10 -0
- package/dist/scenario-runner/adapters/temporal-executor.d.ts.map +1 -0
- package/dist/scenario-runner/adapters/temporal-executor.js +186 -0
- package/dist/scenario-runner/adapters/temporal-executor.js.map +1 -0
- package/dist/scenario-runner/adapters/types.d.ts +16 -5
- package/dist/scenario-runner/adapters/types.d.ts.map +1 -1
- package/dist/scenario-runner/condition.d.ts.map +1 -1
- package/dist/scenario-runner/condition.js +73 -0
- package/dist/scenario-runner/condition.js.map +1 -1
- package/dist/scenario-runner/graphTraversal.d.ts +6 -0
- package/dist/scenario-runner/graphTraversal.d.ts.map +1 -1
- package/dist/scenario-runner/graphTraversal.js +9 -0
- package/dist/scenario-runner/graphTraversal.js.map +1 -1
- package/dist/scenario-runner/index.d.ts +1 -0
- package/dist/scenario-runner/index.d.ts.map +1 -1
- package/dist/scenario-runner/index.js +3 -0
- package/dist/scenario-runner/index.js.map +1 -1
- package/dist/scenario-runner/nodePolicy.d.ts +2 -2
- package/dist/scenario-runner/nodePolicy.d.ts.map +1 -1
- package/dist/scenario-runner/nodePolicy.js +3 -0
- package/dist/scenario-runner/nodePolicy.js.map +1 -1
- package/dist/scenario-runner/runScenario.d.ts.map +1 -1
- package/dist/scenario-runner/runScenario.js +76 -0
- package/dist/scenario-runner/runScenario.js.map +1 -1
- package/dist/scenario-runner/temporal.d.ts +73 -0
- package/dist/scenario-runner/temporal.d.ts.map +1 -0
- package/dist/scenario-runner/temporal.js +377 -0
- package/dist/scenario-runner/temporal.js.map +1 -0
- package/dist/scenario-runner/types.d.ts +206 -4
- package/dist/scenario-runner/types.d.ts.map +1 -1
- package/dist/ui-test/commands.d.ts.map +1 -1
- package/dist/ui-test/commands.js +71 -0
- package/dist/ui-test/commands.js.map +1 -1
- package/dist-cjs/ai/prompts/scenario.js +3 -1
- package/dist-cjs/ai/prompts/scenario.js.map +1 -1
- package/dist-cjs/ai/prompts/scenarioNodeDefaults.js +9 -0
- package/dist-cjs/ai/prompts/scenarioNodeDefaults.js.map +1 -1
- package/dist-cjs/ai/prompts/scenarioNodeReference.js +79 -1
- package/dist-cjs/ai/prompts/scenarioNodeReference.js.map +1 -1
- package/dist-cjs/host/index.js +20 -2
- package/dist-cjs/host/index.js.map +1 -1
- package/dist-cjs/host/temporal/temporalService.js +1200 -0
- package/dist-cjs/host/temporal/temporalService.js.map +1 -0
- package/dist-cjs/host/temporal/types.js +6 -0
- package/dist-cjs/host/temporal/types.js.map +1 -0
- package/dist-cjs/scenario-runner/adapters/index.js +9 -1
- package/dist-cjs/scenario-runner/adapters/index.js.map +1 -1
- package/dist-cjs/scenario-runner/adapters/temporal-executor.js +190 -0
- package/dist-cjs/scenario-runner/adapters/temporal-executor.js.map +1 -0
- package/dist-cjs/scenario-runner/condition.js +73 -0
- package/dist-cjs/scenario-runner/condition.js.map +1 -1
- package/dist-cjs/scenario-runner/graphTraversal.js +10 -1
- package/dist-cjs/scenario-runner/graphTraversal.js.map +1 -1
- package/dist-cjs/scenario-runner/index.js +3 -0
- package/dist-cjs/scenario-runner/index.js.map +1 -1
- package/dist-cjs/scenario-runner/nodePolicy.js +3 -0
- package/dist-cjs/scenario-runner/nodePolicy.js.map +1 -1
- package/dist-cjs/scenario-runner/runScenario.js +76 -0
- package/dist-cjs/scenario-runner/runScenario.js.map +1 -1
- package/dist-cjs/scenario-runner/temporal.js +386 -0
- package/dist-cjs/scenario-runner/temporal.js.map +1 -0
- package/dist-cjs/ui-test/commands.js +71 -0
- package/dist-cjs/ui-test/commands.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
// Temporal node helpers shared by the executor, the hosts and the authoring
|
|
2
|
+
// tools (desktop builder validation, backend zod schema, MCP required-field
|
|
3
|
+
// check all read TEMPORAL_OPERATION_SPECS instead of keeping their own list).
|
|
4
|
+
//
|
|
5
|
+
// `resolveTemporalOperation` turns a node config + the live template values
|
|
6
|
+
// into a fully resolved, typed operation (templates substituted, JSON args
|
|
7
|
+
// parsed) and is the ONE place that decides what is required per operation.
|
|
8
|
+
export const TEMPORAL_OPERATIONS = [
|
|
9
|
+
"startWorkflow",
|
|
10
|
+
"signal",
|
|
11
|
+
"signalWithStart",
|
|
12
|
+
"query",
|
|
13
|
+
"update",
|
|
14
|
+
"awaitResult",
|
|
15
|
+
"describe",
|
|
16
|
+
"history",
|
|
17
|
+
"cancel",
|
|
18
|
+
"terminate",
|
|
19
|
+
"list",
|
|
20
|
+
"count",
|
|
21
|
+
"describeTaskQueue",
|
|
22
|
+
];
|
|
23
|
+
export const isTemporalOperation = (value) => typeof value === "string" && TEMPORAL_OPERATIONS.includes(value);
|
|
24
|
+
const START_OPTIONS = [
|
|
25
|
+
"idReusePolicy",
|
|
26
|
+
"idConflictPolicy",
|
|
27
|
+
"memo",
|
|
28
|
+
"searchAttributes",
|
|
29
|
+
"workflowExecutionTimeoutMs",
|
|
30
|
+
"workflowRunTimeoutMs",
|
|
31
|
+
"workflowTaskTimeoutMs",
|
|
32
|
+
"startDelayMs",
|
|
33
|
+
"retryPolicy",
|
|
34
|
+
];
|
|
35
|
+
export const TEMPORAL_OPERATION_SPECS = {
|
|
36
|
+
startWorkflow: {
|
|
37
|
+
operation: "startWorkflow",
|
|
38
|
+
label: "Start workflow",
|
|
39
|
+
summary: "Start a workflow execution; optionally wait for its result.",
|
|
40
|
+
required: ["workflowType", "taskQueue"],
|
|
41
|
+
optional: ["workflowId", "args", "waitForResult", "followRuns", "onTimeout", ...START_OPTIONS],
|
|
42
|
+
waits: true,
|
|
43
|
+
},
|
|
44
|
+
signal: {
|
|
45
|
+
operation: "signal",
|
|
46
|
+
label: "Signal",
|
|
47
|
+
summary: "Send a signal to a running workflow.",
|
|
48
|
+
required: ["workflowId", "signalName"],
|
|
49
|
+
optional: ["runId", "args"],
|
|
50
|
+
waits: false,
|
|
51
|
+
},
|
|
52
|
+
signalWithStart: {
|
|
53
|
+
operation: "signalWithStart",
|
|
54
|
+
label: "Signal with start",
|
|
55
|
+
summary: "Signal the workflow, starting it first when it is not running.",
|
|
56
|
+
required: ["workflowId", "workflowType", "taskQueue", "signalName"],
|
|
57
|
+
optional: ["args", "signalArgs", ...START_OPTIONS],
|
|
58
|
+
waits: false,
|
|
59
|
+
},
|
|
60
|
+
query: {
|
|
61
|
+
operation: "query",
|
|
62
|
+
label: "Query",
|
|
63
|
+
summary: "Read workflow state through a query handler (works on closed workflows too).",
|
|
64
|
+
required: ["workflowId", "queryName"],
|
|
65
|
+
optional: ["runId", "args"],
|
|
66
|
+
waits: false,
|
|
67
|
+
},
|
|
68
|
+
update: {
|
|
69
|
+
operation: "update",
|
|
70
|
+
label: "Update",
|
|
71
|
+
summary: "Invoke an update handler and wait for its result.",
|
|
72
|
+
required: ["workflowId", "updateName"],
|
|
73
|
+
optional: ["runId", "args", "waitForStage"],
|
|
74
|
+
waits: true,
|
|
75
|
+
},
|
|
76
|
+
awaitResult: {
|
|
77
|
+
operation: "awaitResult",
|
|
78
|
+
label: "Await result",
|
|
79
|
+
summary: "Wait for the workflow to close and expose its result or failure.",
|
|
80
|
+
required: ["workflowId"],
|
|
81
|
+
optional: ["runId", "followRuns", "onTimeout"],
|
|
82
|
+
waits: true,
|
|
83
|
+
},
|
|
84
|
+
describe: {
|
|
85
|
+
operation: "describe",
|
|
86
|
+
label: "Describe",
|
|
87
|
+
summary: "Status, type, task queue, timings, memo, search attributes and pending activities.",
|
|
88
|
+
required: ["workflowId"],
|
|
89
|
+
optional: ["runId"],
|
|
90
|
+
waits: false,
|
|
91
|
+
},
|
|
92
|
+
history: {
|
|
93
|
+
operation: "history",
|
|
94
|
+
label: "History",
|
|
95
|
+
summary: "Fetch the event history and summarize it (event counts, activities, signals, timers, failure).",
|
|
96
|
+
required: ["workflowId"],
|
|
97
|
+
optional: ["runId", "eventTypes", "historyLimit"],
|
|
98
|
+
waits: false,
|
|
99
|
+
},
|
|
100
|
+
cancel: {
|
|
101
|
+
operation: "cancel",
|
|
102
|
+
label: "Cancel",
|
|
103
|
+
summary: "Request cancellation (the workflow runs its cleanup).",
|
|
104
|
+
required: ["workflowId"],
|
|
105
|
+
optional: ["runId", "reason"],
|
|
106
|
+
waits: false,
|
|
107
|
+
},
|
|
108
|
+
terminate: {
|
|
109
|
+
operation: "terminate",
|
|
110
|
+
label: "Terminate",
|
|
111
|
+
summary: "Terminate the workflow immediately (no cleanup).",
|
|
112
|
+
required: ["workflowId"],
|
|
113
|
+
optional: ["runId", "reason"],
|
|
114
|
+
waits: false,
|
|
115
|
+
},
|
|
116
|
+
list: {
|
|
117
|
+
operation: "list",
|
|
118
|
+
label: "List",
|
|
119
|
+
summary: "List workflow executions matching a visibility filter.",
|
|
120
|
+
required: ["query"],
|
|
121
|
+
optional: ["pageSize"],
|
|
122
|
+
waits: false,
|
|
123
|
+
},
|
|
124
|
+
count: {
|
|
125
|
+
operation: "count",
|
|
126
|
+
label: "Count",
|
|
127
|
+
summary: "Count workflow executions matching a visibility filter (GROUP BY supported).",
|
|
128
|
+
required: ["query"],
|
|
129
|
+
optional: [],
|
|
130
|
+
waits: false,
|
|
131
|
+
},
|
|
132
|
+
describeTaskQueue: {
|
|
133
|
+
operation: "describeTaskQueue",
|
|
134
|
+
label: "Describe task queue",
|
|
135
|
+
summary: "Which workers poll a task queue — a worker-is-alive check.",
|
|
136
|
+
required: ["taskQueue"],
|
|
137
|
+
optional: ["taskQueueType"],
|
|
138
|
+
waits: false,
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
export const TEMPORAL_WORKFLOW_ID_REUSE_POLICIES = [
|
|
142
|
+
"ALLOW_DUPLICATE",
|
|
143
|
+
"ALLOW_DUPLICATE_FAILED_ONLY",
|
|
144
|
+
"REJECT_DUPLICATE",
|
|
145
|
+
"TERMINATE_IF_RUNNING",
|
|
146
|
+
];
|
|
147
|
+
export const TEMPORAL_WORKFLOW_ID_CONFLICT_POLICIES = [
|
|
148
|
+
"FAIL",
|
|
149
|
+
"USE_EXISTING",
|
|
150
|
+
"TERMINATE_EXISTING",
|
|
151
|
+
];
|
|
152
|
+
/** Every key of ScenarioTemporalResult, with its "not applicable" value. */
|
|
153
|
+
export const createEmptyTemporalResult = (operation, namespace) => ({
|
|
154
|
+
operation,
|
|
155
|
+
namespace,
|
|
156
|
+
workflowId: null,
|
|
157
|
+
runId: null,
|
|
158
|
+
status: null,
|
|
159
|
+
workflowType: null,
|
|
160
|
+
taskQueue: null,
|
|
161
|
+
result: null,
|
|
162
|
+
failure: null,
|
|
163
|
+
startTime: null,
|
|
164
|
+
closeTime: null,
|
|
165
|
+
historyLength: null,
|
|
166
|
+
memo: null,
|
|
167
|
+
searchAttributes: null,
|
|
168
|
+
activities: [],
|
|
169
|
+
pendingChildren: [],
|
|
170
|
+
events: [],
|
|
171
|
+
eventCounts: {},
|
|
172
|
+
signals: [],
|
|
173
|
+
timers: [],
|
|
174
|
+
truncatedHistory: false,
|
|
175
|
+
executions: [],
|
|
176
|
+
count: null,
|
|
177
|
+
groups: [],
|
|
178
|
+
pollers: [],
|
|
179
|
+
hasPollers: null,
|
|
180
|
+
updateId: null,
|
|
181
|
+
requested: null,
|
|
182
|
+
timedOut: false,
|
|
183
|
+
durationMs: 0,
|
|
184
|
+
});
|
|
185
|
+
export class TemporalConfigError extends Error {
|
|
186
|
+
constructor(message) {
|
|
187
|
+
super(message);
|
|
188
|
+
this.name = "TemporalConfigError";
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const FIELD_LABELS = {
|
|
192
|
+
workflowId: "workflow id",
|
|
193
|
+
workflowType: "workflow type",
|
|
194
|
+
taskQueue: "task queue",
|
|
195
|
+
signalName: "signal name",
|
|
196
|
+
queryName: "query name",
|
|
197
|
+
updateName: "update name",
|
|
198
|
+
query: "list filter",
|
|
199
|
+
};
|
|
200
|
+
const describeField = (field) => FIELD_LABELS[field] ?? String(field);
|
|
201
|
+
const isBlank = (value) => value === undefined || value === null || (typeof value === "string" && value.trim() === "");
|
|
202
|
+
/**
|
|
203
|
+
* Static validation (no templates resolved): which required fields are empty
|
|
204
|
+
* for the chosen operation. Hosts use it in the builder / on save.
|
|
205
|
+
*/
|
|
206
|
+
export const getTemporalNodeMissingFields = (config) => {
|
|
207
|
+
const operation = config?.operation;
|
|
208
|
+
if (!isTemporalOperation(operation)) {
|
|
209
|
+
return ["operation"];
|
|
210
|
+
}
|
|
211
|
+
const missing = [];
|
|
212
|
+
if (isBlank(config?.connectionId)) {
|
|
213
|
+
missing.push("connectionId");
|
|
214
|
+
}
|
|
215
|
+
for (const field of TEMPORAL_OPERATION_SPECS[operation].required) {
|
|
216
|
+
if (isBlank(config?.[field])) {
|
|
217
|
+
missing.push(String(field));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return missing;
|
|
221
|
+
};
|
|
222
|
+
const parseJsonArray = (raw, field, resolve) => {
|
|
223
|
+
const text = (raw ?? "").trim();
|
|
224
|
+
if (!text) {
|
|
225
|
+
return [];
|
|
226
|
+
}
|
|
227
|
+
const resolved = resolve(text);
|
|
228
|
+
let parsed;
|
|
229
|
+
try {
|
|
230
|
+
parsed = JSON.parse(resolved);
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
throw new TemporalConfigError(`Temporal ${field} must be a JSON array after template resolution (got: ${resolved.slice(0, 80)}).`);
|
|
234
|
+
}
|
|
235
|
+
if (Array.isArray(parsed)) {
|
|
236
|
+
return parsed;
|
|
237
|
+
}
|
|
238
|
+
// A single value is a convenience for one-argument handlers.
|
|
239
|
+
return [parsed];
|
|
240
|
+
};
|
|
241
|
+
const parseJsonObject = (raw, field, resolve) => {
|
|
242
|
+
const text = (raw ?? "").trim();
|
|
243
|
+
if (!text) {
|
|
244
|
+
return undefined;
|
|
245
|
+
}
|
|
246
|
+
const resolved = resolve(text);
|
|
247
|
+
let parsed;
|
|
248
|
+
try {
|
|
249
|
+
parsed = JSON.parse(resolved);
|
|
250
|
+
}
|
|
251
|
+
catch {
|
|
252
|
+
throw new TemporalConfigError(`Temporal ${field} must be a JSON object after template resolution (got: ${resolved.slice(0, 80)}).`);
|
|
253
|
+
}
|
|
254
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
255
|
+
throw new TemporalConfigError(`Temporal ${field} must be a JSON object.`);
|
|
256
|
+
}
|
|
257
|
+
return parsed;
|
|
258
|
+
};
|
|
259
|
+
const positiveInt = (value) => typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.round(value) : undefined;
|
|
260
|
+
const createGeneratedWorkflowId = (label) => {
|
|
261
|
+
const slug = label
|
|
262
|
+
.trim()
|
|
263
|
+
.toLowerCase()
|
|
264
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
265
|
+
.replace(/^-+|-+$/g, "")
|
|
266
|
+
.slice(0, 40);
|
|
267
|
+
const random = globalThis.crypto?.randomUUID?.() ??
|
|
268
|
+
`${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
269
|
+
return `callman-${slug || "workflow"}-${random}`;
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Resolve every template in the config and parse the JSON fields. Throws
|
|
273
|
+
* TemporalConfigError when a required field is empty or JSON is invalid —
|
|
274
|
+
* the executor turns that into a fail-fast node failure (no gRPC call).
|
|
275
|
+
*/
|
|
276
|
+
export const resolveTemporalOperation = (config, resolve, resolveJson, options = {}) => {
|
|
277
|
+
if (!isTemporalOperation(config.operation)) {
|
|
278
|
+
throw new TemporalConfigError(`Temporal node has no operation. Choose one of: ${TEMPORAL_OPERATIONS.join(", ")}.`);
|
|
279
|
+
}
|
|
280
|
+
const spec = TEMPORAL_OPERATION_SPECS[config.operation];
|
|
281
|
+
const text = (value) => {
|
|
282
|
+
const resolved = resolve((value ?? "").trim()).trim();
|
|
283
|
+
return resolved ? resolved : null;
|
|
284
|
+
};
|
|
285
|
+
for (const field of spec.required) {
|
|
286
|
+
const value = config[field];
|
|
287
|
+
const resolved = typeof value === "string" ? text(value) : value;
|
|
288
|
+
if (isBlank(resolved)) {
|
|
289
|
+
throw new TemporalConfigError(`Temporal ${spec.label.toLowerCase()} needs a ${describeField(field)}.`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
let workflowId = text(config.workflowId);
|
|
293
|
+
if (!workflowId && config.operation === "startWorkflow") {
|
|
294
|
+
workflowId = createGeneratedWorkflowId(options.nodeLabel ?? "workflow");
|
|
295
|
+
}
|
|
296
|
+
const historyLimit = positiveInt(config.historyLimit);
|
|
297
|
+
const pageSize = positiveInt(config.pageSize);
|
|
298
|
+
return {
|
|
299
|
+
operation: config.operation,
|
|
300
|
+
namespace: text(config.namespace),
|
|
301
|
+
workflowId,
|
|
302
|
+
runId: text(config.runId),
|
|
303
|
+
workflowType: text(config.workflowType),
|
|
304
|
+
taskQueue: text(config.taskQueue),
|
|
305
|
+
args: parseJsonArray(config.args, "args", resolveJson),
|
|
306
|
+
signalName: text(config.signalName),
|
|
307
|
+
signalArgs: parseJsonArray(config.signalArgs, "signalArgs", resolveJson),
|
|
308
|
+
queryName: text(config.queryName),
|
|
309
|
+
updateName: text(config.updateName),
|
|
310
|
+
waitForStage: config.waitForStage === "ACCEPTED" ? "ACCEPTED" : "COMPLETED",
|
|
311
|
+
waitForResult: config.waitForResult === true,
|
|
312
|
+
followRuns: config.followRuns !== false,
|
|
313
|
+
reason: text(config.reason),
|
|
314
|
+
query: text(config.query),
|
|
315
|
+
pageSize: pageSize ?? null,
|
|
316
|
+
eventTypes: Array.isArray(config.eventTypes)
|
|
317
|
+
? config.eventTypes
|
|
318
|
+
.map((entry) => (typeof entry === "string" ? entry.trim() : ""))
|
|
319
|
+
.filter((entry) => entry.length > 0)
|
|
320
|
+
: [],
|
|
321
|
+
historyLimit: historyLimit ?? null,
|
|
322
|
+
taskQueueType: config.taskQueueType === "activity" ? "activity" : "workflow",
|
|
323
|
+
startOptions: {
|
|
324
|
+
...(config.idReusePolicy &&
|
|
325
|
+
TEMPORAL_WORKFLOW_ID_REUSE_POLICIES.includes(config.idReusePolicy)
|
|
326
|
+
? { idReusePolicy: config.idReusePolicy }
|
|
327
|
+
: {}),
|
|
328
|
+
...(config.idConflictPolicy &&
|
|
329
|
+
TEMPORAL_WORKFLOW_ID_CONFLICT_POLICIES.includes(config.idConflictPolicy)
|
|
330
|
+
? { idConflictPolicy: config.idConflictPolicy }
|
|
331
|
+
: {}),
|
|
332
|
+
...(parseJsonObject(config.memo, "memo", resolveJson)
|
|
333
|
+
? { memo: parseJsonObject(config.memo, "memo", resolveJson) }
|
|
334
|
+
: {}),
|
|
335
|
+
...(parseJsonObject(config.searchAttributes, "searchAttributes", resolveJson)
|
|
336
|
+
? {
|
|
337
|
+
searchAttributes: parseJsonObject(config.searchAttributes, "searchAttributes", resolveJson),
|
|
338
|
+
}
|
|
339
|
+
: {}),
|
|
340
|
+
...(positiveInt(config.workflowExecutionTimeoutMs)
|
|
341
|
+
? { workflowExecutionTimeoutMs: positiveInt(config.workflowExecutionTimeoutMs) }
|
|
342
|
+
: {}),
|
|
343
|
+
...(positiveInt(config.workflowRunTimeoutMs)
|
|
344
|
+
? { workflowRunTimeoutMs: positiveInt(config.workflowRunTimeoutMs) }
|
|
345
|
+
: {}),
|
|
346
|
+
...(positiveInt(config.workflowTaskTimeoutMs)
|
|
347
|
+
? { workflowTaskTimeoutMs: positiveInt(config.workflowTaskTimeoutMs) }
|
|
348
|
+
: {}),
|
|
349
|
+
...(positiveInt(config.startDelayMs) ? { startDelayMs: positiveInt(config.startDelayMs) } : {}),
|
|
350
|
+
...(config.retryPolicy && typeof config.retryPolicy === "object"
|
|
351
|
+
? { retryPolicy: normalizeRetryPolicy(config.retryPolicy) }
|
|
352
|
+
: {}),
|
|
353
|
+
},
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
const normalizeRetryPolicy = (value) => ({
|
|
357
|
+
...(positiveInt(value.maximumAttempts) ? { maximumAttempts: positiveInt(value.maximumAttempts) } : {}),
|
|
358
|
+
...(positiveInt(value.initialIntervalMs)
|
|
359
|
+
? { initialIntervalMs: positiveInt(value.initialIntervalMs) }
|
|
360
|
+
: {}),
|
|
361
|
+
...(typeof value.backoffCoefficient === "number" && value.backoffCoefficient >= 1
|
|
362
|
+
? { backoffCoefficient: value.backoffCoefficient }
|
|
363
|
+
: {}),
|
|
364
|
+
...(positiveInt(value.maximumIntervalMs)
|
|
365
|
+
? { maximumIntervalMs: positiveInt(value.maximumIntervalMs) }
|
|
366
|
+
: {}),
|
|
367
|
+
});
|
|
368
|
+
/** Deep link into the Temporal Web UI, when the connection names one. */
|
|
369
|
+
export const buildTemporalUiUrl = (uiBaseUrl, namespace, workflowId, runId) => {
|
|
370
|
+
const base = (uiBaseUrl ?? "").trim().replace(/\/+$/, "");
|
|
371
|
+
if (!base || !workflowId) {
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
const path = `${base}/namespaces/${encodeURIComponent(namespace)}/workflows/${encodeURIComponent(workflowId)}`;
|
|
375
|
+
return runId ? `${path}/${encodeURIComponent(runId)}` : path;
|
|
376
|
+
};
|
|
377
|
+
//# sourceMappingURL=temporal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal.js","sourceRoot":"","sources":["../../src/scenario-runner/temporal.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,4EAA4E;AAW5E,MAAM,CAAC,MAAM,mBAAmB,GAAiC;IAC/D,eAAe;IACf,QAAQ;IACR,iBAAiB;IACjB,OAAO;IACP,QAAQ;IACR,aAAa;IACb,UAAU;IACV,SAAS;IACT,QAAQ;IACR,WAAW;IACX,MAAM;IACN,OAAO;IACP,mBAAmB;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAc,EAA8B,EAAE,CAChF,OAAO,KAAK,KAAK,QAAQ,IAAK,mBAAyC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAc1F,MAAM,aAAa,GAAG;IACpB,eAAe;IACf,kBAAkB;IAClB,MAAM;IACN,kBAAkB;IAClB,4BAA4B;IAC5B,sBAAsB;IACtB,uBAAuB;IACvB,cAAc;IACd,aAAa;CACL,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAAqD;IACxF,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
|
import type { ContractFormat } from "../contract/formats.js";
|
|
4
4
|
import type { ClientCertificateConfig, ContractSortedRule, ContractUniqueRule, OAuth2AuthConfig, OAuth2ClientAuth, OAuth2GrantType } from "../types/index.js";
|
|
5
5
|
export type { OAuth2AuthConfig, OAuth2ClientAuth, OAuth2GrantType };
|
|
6
|
-
export type ScenarioNodeType = "request" | "condition" | "assertion" | "wait" | "script" | "db" | "kafka" | "redis" | "notification" | "set-vars" | "poll" | "end" | "aggregator" | "subscenario" | "scenario-ref" | "foreach" | "websocket" | "ai";
|
|
6
|
+
export type ScenarioNodeType = "request" | "condition" | "assertion" | "wait" | "script" | "db" | "kafka" | "redis" | "notification" | "set-vars" | "poll" | "end" | "aggregator" | "subscenario" | "scenario-ref" | "foreach" | "websocket" | "ai" | "temporal";
|
|
7
7
|
export type ScenarioEdgeType = "default" | "yes" | "no" | "error";
|
|
8
8
|
export type ScenarioNodeFailurePolicy = "stop" | "continue";
|
|
9
9
|
export type ScenarioRequestContractValueType = "string" | "number" | "boolean" | "object" | "array" | "null";
|
|
@@ -186,13 +186,73 @@ export interface RedisScenarioNodeConfig extends ScenarioNodeConfigWithExecution
|
|
|
186
186
|
connectionId: string;
|
|
187
187
|
commands: string[];
|
|
188
188
|
}
|
|
189
|
-
export type
|
|
189
|
+
export type TemporalOperation = "startWorkflow" | "signal" | "signalWithStart" | "query" | "update" | "awaitResult" | "describe" | "history" | "cancel" | "terminate" | "list" | "count" | "describeTaskQueue";
|
|
190
|
+
export type TemporalWorkflowIdReusePolicy = "ALLOW_DUPLICATE" | "ALLOW_DUPLICATE_FAILED_ONLY" | "REJECT_DUPLICATE" | "TERMINATE_IF_RUNNING";
|
|
191
|
+
export type TemporalWorkflowIdConflictPolicy = "FAIL" | "USE_EXISTING" | "TERMINATE_EXISTING";
|
|
192
|
+
export interface TemporalRetryPolicyConfig {
|
|
193
|
+
maximumAttempts?: number;
|
|
194
|
+
initialIntervalMs?: number;
|
|
195
|
+
backoffCoefficient?: number;
|
|
196
|
+
maximumIntervalMs?: number;
|
|
197
|
+
}
|
|
198
|
+
export interface TemporalScenarioNodeConfig extends ScenarioNodeConfigWithExecutionPolicy {
|
|
199
|
+
connectionId: string;
|
|
200
|
+
operation: TemporalOperation;
|
|
201
|
+
/** Overrides the connection's namespace (template-resolved). */
|
|
202
|
+
namespace?: string;
|
|
203
|
+
/** Target workflow (template). On startWorkflow, empty = generated id. */
|
|
204
|
+
workflowId?: string;
|
|
205
|
+
runId?: string;
|
|
206
|
+
workflowType?: string;
|
|
207
|
+
taskQueue?: string;
|
|
208
|
+
/** JSON array template string — the workflow / query / update / signal arguments. */
|
|
209
|
+
args?: string;
|
|
210
|
+
/** startWorkflow: block until the workflow closes and expose its result. */
|
|
211
|
+
waitForResult?: boolean;
|
|
212
|
+
idReusePolicy?: TemporalWorkflowIdReusePolicy;
|
|
213
|
+
idConflictPolicy?: TemporalWorkflowIdConflictPolicy;
|
|
214
|
+
/** JSON object template string. */
|
|
215
|
+
memo?: string;
|
|
216
|
+
/** JSON object template string. */
|
|
217
|
+
searchAttributes?: string;
|
|
218
|
+
workflowExecutionTimeoutMs?: number;
|
|
219
|
+
workflowRunTimeoutMs?: number;
|
|
220
|
+
workflowTaskTimeoutMs?: number;
|
|
221
|
+
startDelayMs?: number;
|
|
222
|
+
retryPolicy?: TemporalRetryPolicyConfig;
|
|
223
|
+
signalName?: string;
|
|
224
|
+
/** signalWithStart only: JSON array template string for the signal. */
|
|
225
|
+
signalArgs?: string;
|
|
226
|
+
queryName?: string;
|
|
227
|
+
updateName?: string;
|
|
228
|
+
waitForStage?: "ACCEPTED" | "COMPLETED";
|
|
229
|
+
/** Follow continue-as-new / retry chains (default true). */
|
|
230
|
+
followRuns?: boolean;
|
|
231
|
+
/** Keep only these event types (names without the EVENT_TYPE_ prefix). */
|
|
232
|
+
eventTypes?: string[];
|
|
233
|
+
/** Max events kept in the output (default/cap in graphTraversal). */
|
|
234
|
+
historyLimit?: number;
|
|
235
|
+
reason?: string;
|
|
236
|
+
/** Temporal visibility list filter, e.g. `WorkflowType = 'Order' AND ExecutionStatus = 'Running'`. */
|
|
237
|
+
query?: string;
|
|
238
|
+
pageSize?: number;
|
|
239
|
+
taskQueueType?: "workflow" | "activity";
|
|
240
|
+
/** Per-node budget for the operation (default/cap in graphTraversal). */
|
|
241
|
+
timeoutMs?: number;
|
|
242
|
+
/** awaitResult / startWorkflow+wait: what a timeout does (default fail). */
|
|
243
|
+
onTimeout?: "fail" | "continue";
|
|
244
|
+
/** Checks against the node's OWN output (`<Label>.status`, `<Label>.result.x`, …). */
|
|
245
|
+
expect?: ConditionRule[];
|
|
246
|
+
expectMatchMode?: AssertionMatchMode;
|
|
247
|
+
}
|
|
248
|
+
export type PollActionType = "request" | "db" | "redis" | "script" | "temporal";
|
|
190
249
|
export interface PollScenarioNodeConfig extends ScenarioNodeConfigWithExecutionPolicy {
|
|
191
250
|
actionType: PollActionType;
|
|
192
251
|
request?: RequestScenarioNodeConfig;
|
|
193
252
|
db?: DbScenarioNodeConfig;
|
|
194
253
|
redis?: RedisScenarioNodeConfig;
|
|
195
254
|
script?: ScriptScenarioNodeConfig;
|
|
255
|
+
temporal?: TemporalScenarioNodeConfig;
|
|
196
256
|
/** Success test, evaluated after every tick — full condition engine. */
|
|
197
257
|
successCondition: ConditionNodeConfig;
|
|
198
258
|
/** Delay between ticks. */
|
|
@@ -383,7 +443,7 @@ export interface AssertionEvaluationResult {
|
|
|
383
443
|
failedCount: number;
|
|
384
444
|
checks: AssertionCheckResult[];
|
|
385
445
|
}
|
|
386
|
-
export type ScenarioNodeConfig = RequestScenarioNodeConfig | DbScenarioNodeConfig | WaitScenarioNodeConfig | ScriptScenarioNodeConfig | KafkaScenarioNodeConfig | RedisScenarioNodeConfig | NotificationScenarioNodeConfig | ConditionNodeConfig | AssertionScenarioNodeConfig | SetVarsScenarioNodeConfig | PollScenarioNodeConfig | EndScenarioNodeConfig | AggregatorScenarioNodeConfig | SubScenarioNodeConfig | ScenarioRefNodeConfig | ForeachNodeConfig | WebsocketScenarioNodeConfig | AiScenarioNodeConfig;
|
|
446
|
+
export type ScenarioNodeConfig = RequestScenarioNodeConfig | DbScenarioNodeConfig | WaitScenarioNodeConfig | ScriptScenarioNodeConfig | KafkaScenarioNodeConfig | RedisScenarioNodeConfig | NotificationScenarioNodeConfig | ConditionNodeConfig | AssertionScenarioNodeConfig | SetVarsScenarioNodeConfig | PollScenarioNodeConfig | EndScenarioNodeConfig | AggregatorScenarioNodeConfig | SubScenarioNodeConfig | ScenarioRefNodeConfig | ForeachNodeConfig | WebsocketScenarioNodeConfig | AiScenarioNodeConfig | TemporalScenarioNodeConfig;
|
|
387
447
|
interface BaseScenarioNode<TType extends ScenarioNodeType, TConfig extends ScenarioNodeConfig> {
|
|
388
448
|
id: string;
|
|
389
449
|
type: TType;
|
|
@@ -411,8 +471,9 @@ export type ScenarioRefNode = BaseScenarioNode<"scenario-ref", ScenarioRefNodeCo
|
|
|
411
471
|
export type ForeachScenarioNode = BaseScenarioNode<"foreach", ForeachNodeConfig>;
|
|
412
472
|
export type WebsocketScenarioNode = BaseScenarioNode<"websocket", WebsocketScenarioNodeConfig>;
|
|
413
473
|
export type AiScenarioNode = BaseScenarioNode<"ai", AiScenarioNodeConfig>;
|
|
474
|
+
export type TemporalScenarioNode = BaseScenarioNode<"temporal", TemporalScenarioNodeConfig>;
|
|
414
475
|
export type ScenarioPolicyCapableNodeType = Exclude<ScenarioNodeType, "condition">;
|
|
415
|
-
export type ScenarioNode = RequestScenarioNode | DbScenarioNode | WaitScenarioNode | ScriptScenarioNode | KafkaScenarioNode | RedisScenarioNode | NotificationScenarioNode | ConditionScenarioNode | AssertionScenarioNode | SetVarsScenarioNode | PollScenarioNode | EndScenarioNode | AggregatorScenarioNode | SubScenarioNode | ScenarioRefNode | ForeachScenarioNode | WebsocketScenarioNode | AiScenarioNode;
|
|
476
|
+
export type ScenarioNode = RequestScenarioNode | DbScenarioNode | WaitScenarioNode | ScriptScenarioNode | KafkaScenarioNode | RedisScenarioNode | NotificationScenarioNode | ConditionScenarioNode | AssertionScenarioNode | SetVarsScenarioNode | PollScenarioNode | EndScenarioNode | AggregatorScenarioNode | SubScenarioNode | ScenarioRefNode | ForeachScenarioNode | WebsocketScenarioNode | AiScenarioNode | TemporalScenarioNode;
|
|
416
477
|
export type ScenarioPolicyCapableNode = Exclude<ScenarioNode, ConditionScenarioNode>;
|
|
417
478
|
export interface ScenarioEdge {
|
|
418
479
|
id: string;
|
|
@@ -857,6 +918,142 @@ export interface ScenarioAiExecutionResult {
|
|
|
857
918
|
durationMs: number;
|
|
858
919
|
failureMessage: string | null;
|
|
859
920
|
}
|
|
921
|
+
export type TemporalWorkflowStatus = "RUNNING" | "COMPLETED" | "FAILED" | "CANCELED" | "TERMINATED" | "TIMED_OUT" | "CONTINUED_AS_NEW" | "UNKNOWN";
|
|
922
|
+
export interface ScenarioTemporalFailure {
|
|
923
|
+
message: string;
|
|
924
|
+
/** ApplicationFailure type / failure kind (e.g. "ActivityFailure", "CanceledFailure"). */
|
|
925
|
+
type: string | null;
|
|
926
|
+
stackTrace?: string | null;
|
|
927
|
+
/** Flattened cause chain (outermost first), each `{ message, type }`. */
|
|
928
|
+
cause?: Array<{
|
|
929
|
+
message: string;
|
|
930
|
+
type: string | null;
|
|
931
|
+
}>;
|
|
932
|
+
}
|
|
933
|
+
export interface ScenarioTemporalHistoryEvent {
|
|
934
|
+
eventId: number;
|
|
935
|
+
/** Event type name without the EVENT_TYPE_ prefix, e.g. "ActivityTaskCompleted". */
|
|
936
|
+
eventType: string;
|
|
937
|
+
eventTime: string | null;
|
|
938
|
+
/** The event's attribute object, payloads decoded (bounded by the host). */
|
|
939
|
+
attributes?: unknown;
|
|
940
|
+
}
|
|
941
|
+
export type ScenarioTemporalActivityStatus = "scheduled" | "started" | "completed" | "failed" | "timed_out" | "canceled";
|
|
942
|
+
export interface ScenarioTemporalActivity {
|
|
943
|
+
activityId: string;
|
|
944
|
+
activityType: string;
|
|
945
|
+
status: ScenarioTemporalActivityStatus;
|
|
946
|
+
attempt: number;
|
|
947
|
+
scheduledAt: string | null;
|
|
948
|
+
startedAt: string | null;
|
|
949
|
+
closedAt: string | null;
|
|
950
|
+
durationMs: number | null;
|
|
951
|
+
failure: string | null;
|
|
952
|
+
result?: unknown;
|
|
953
|
+
}
|
|
954
|
+
export interface ScenarioTemporalExecutionSummary {
|
|
955
|
+
workflowId: string;
|
|
956
|
+
runId: string;
|
|
957
|
+
type: string;
|
|
958
|
+
status: TemporalWorkflowStatus;
|
|
959
|
+
startTime: string | null;
|
|
960
|
+
closeTime: string | null;
|
|
961
|
+
taskQueue: string | null;
|
|
962
|
+
}
|
|
963
|
+
export interface ScenarioTemporalPoller {
|
|
964
|
+
identity: string;
|
|
965
|
+
lastAccessTime: string | null;
|
|
966
|
+
ratePerSecond: number | null;
|
|
967
|
+
}
|
|
968
|
+
export interface ScenarioTemporalResult {
|
|
969
|
+
operation: TemporalOperation;
|
|
970
|
+
namespace: string;
|
|
971
|
+
workflowId: string | null;
|
|
972
|
+
runId: string | null;
|
|
973
|
+
status: TemporalWorkflowStatus | null;
|
|
974
|
+
workflowType: string | null;
|
|
975
|
+
taskQueue: string | null;
|
|
976
|
+
/** awaitResult / query / update / startWorkflow+wait: decoded payload. */
|
|
977
|
+
result: unknown;
|
|
978
|
+
failure: ScenarioTemporalFailure | null;
|
|
979
|
+
startTime: string | null;
|
|
980
|
+
closeTime: string | null;
|
|
981
|
+
historyLength: number | null;
|
|
982
|
+
/** describe: decoded memo / search attributes. */
|
|
983
|
+
memo: Record<string, unknown> | null;
|
|
984
|
+
searchAttributes: Record<string, unknown> | null;
|
|
985
|
+
/** describe: in-flight activities; history: every activity seen. */
|
|
986
|
+
activities: ScenarioTemporalActivity[];
|
|
987
|
+
pendingChildren: Array<{
|
|
988
|
+
workflowId: string;
|
|
989
|
+
runId: string | null;
|
|
990
|
+
workflowType: string | null;
|
|
991
|
+
}>;
|
|
992
|
+
/** history */
|
|
993
|
+
events: ScenarioTemporalHistoryEvent[];
|
|
994
|
+
eventCounts: Record<string, number>;
|
|
995
|
+
signals: Array<{
|
|
996
|
+
name: string;
|
|
997
|
+
eventId: number;
|
|
998
|
+
eventTime: string | null;
|
|
999
|
+
}>;
|
|
1000
|
+
timers: Array<{
|
|
1001
|
+
timerId: string;
|
|
1002
|
+
fired: boolean;
|
|
1003
|
+
startedAt: string | null;
|
|
1004
|
+
}>;
|
|
1005
|
+
truncatedHistory: boolean;
|
|
1006
|
+
/** list */
|
|
1007
|
+
executions: ScenarioTemporalExecutionSummary[];
|
|
1008
|
+
/** count */
|
|
1009
|
+
count: number | null;
|
|
1010
|
+
groups: Array<{
|
|
1011
|
+
values: string[];
|
|
1012
|
+
count: number;
|
|
1013
|
+
}>;
|
|
1014
|
+
/** describeTaskQueue */
|
|
1015
|
+
pollers: ScenarioTemporalPoller[];
|
|
1016
|
+
hasPollers: boolean | null;
|
|
1017
|
+
/** update: server-assigned update id. */
|
|
1018
|
+
updateId: string | null;
|
|
1019
|
+
/** cancel / terminate / signal */
|
|
1020
|
+
requested: boolean | null;
|
|
1021
|
+
/** awaitResult / startWorkflow+wait: the wait hit the node budget. */
|
|
1022
|
+
timedOut: boolean;
|
|
1023
|
+
durationMs: number;
|
|
1024
|
+
}
|
|
1025
|
+
export interface ScenarioTemporalExecutionInput {
|
|
1026
|
+
runId: string;
|
|
1027
|
+
stepId: string;
|
|
1028
|
+
node: TemporalScenarioNode;
|
|
1029
|
+
context: Readonly<ScenarioRuntimeContextState>;
|
|
1030
|
+
signal?: AbortLikeSignal;
|
|
1031
|
+
}
|
|
1032
|
+
export interface ScenarioTemporalNodeDetails {
|
|
1033
|
+
connectionId: string | null;
|
|
1034
|
+
connectionName: string | null;
|
|
1035
|
+
address: string | null;
|
|
1036
|
+
namespace: string | null;
|
|
1037
|
+
operation: TemporalOperation | null;
|
|
1038
|
+
workflowId: string | null;
|
|
1039
|
+
runId: string | null;
|
|
1040
|
+
/** Deep link into the Temporal Web UI when the connection has `uiBaseUrl`. */
|
|
1041
|
+
uiUrl: string | null;
|
|
1042
|
+
durationMs: number;
|
|
1043
|
+
truncatedHistory: boolean;
|
|
1044
|
+
}
|
|
1045
|
+
export interface ScenarioTemporalExecutionResult {
|
|
1046
|
+
outputData: ScenarioTemporalResult | null;
|
|
1047
|
+
details: ScenarioTemporalNodeDetails;
|
|
1048
|
+
/** Resolved operation parameters — becomes the step's `resolvedInput`. */
|
|
1049
|
+
resolvedInput: unknown;
|
|
1050
|
+
durationMs: number;
|
|
1051
|
+
assertionResults: AssertionCheckResult[];
|
|
1052
|
+
assertionSummary: AssertionEvaluationResult | null;
|
|
1053
|
+
/** Timed out with `onTimeout: "continue"` — mark the step partial_success. */
|
|
1054
|
+
degraded: boolean;
|
|
1055
|
+
failureMessage: string | null;
|
|
1056
|
+
}
|
|
860
1057
|
export interface ScenarioNotificationExecutionInput {
|
|
861
1058
|
runId: string;
|
|
862
1059
|
stepId: string;
|
|
@@ -874,6 +1071,7 @@ export interface ScenarioRuntimeAdapters {
|
|
|
874
1071
|
websocketExecutor: (input: ScenarioWebsocketExecutionInput) => Promise<ScenarioWebsocketExecutionResult>;
|
|
875
1072
|
notificationExecutor: (input: ScenarioNotificationExecutionInput) => Promise<ScenarioNotificationExecutionResult>;
|
|
876
1073
|
aiExecutor?: (input: ScenarioAiExecutionInput) => Promise<ScenarioAiExecutionResult>;
|
|
1074
|
+
temporalExecutor?: (input: ScenarioTemporalExecutionInput) => Promise<ScenarioTemporalExecutionResult>;
|
|
877
1075
|
dbSessionRelease?: (input: {
|
|
878
1076
|
runId: string;
|
|
879
1077
|
outcome: "commit" | "rollback";
|
|
@@ -981,6 +1179,7 @@ export type ScenarioRunEvent = {
|
|
|
981
1179
|
conditionDebug?: ConditionGroupEvaluation | null;
|
|
982
1180
|
activeBranch?: ScenarioBranchKey | null;
|
|
983
1181
|
ai?: ScenarioAiNodeDetails | null;
|
|
1182
|
+
temporal?: ScenarioTemporalNodeDetails | null;
|
|
984
1183
|
outputData?: unknown;
|
|
985
1184
|
}) | (ScenarioStepBaseEvent & {
|
|
986
1185
|
type: "step:fail";
|
|
@@ -1022,6 +1221,7 @@ export type ScenarioRunEvent = {
|
|
|
1022
1221
|
conditionDebug?: ConditionGroupEvaluation | null;
|
|
1023
1222
|
activeBranch?: ScenarioBranchKey | null;
|
|
1024
1223
|
ai?: ScenarioAiNodeDetails | null;
|
|
1224
|
+
temporal?: ScenarioTemporalNodeDetails | null;
|
|
1025
1225
|
outputData?: unknown;
|
|
1026
1226
|
}) | (ScenarioStepBaseEvent & {
|
|
1027
1227
|
type: "step:skip";
|
|
@@ -1130,6 +1330,8 @@ export interface ScenarioNodeExecutionRecord {
|
|
|
1130
1330
|
activeBranch: ScenarioBranchKey | null;
|
|
1131
1331
|
/** AI node only (additive): provider/model/token metadata + raw reply. */
|
|
1132
1332
|
ai?: ScenarioAiNodeDetails | null;
|
|
1333
|
+
/** Temporal node only (additive): connection/workflow identifiers + UI link. */
|
|
1334
|
+
temporal?: ScenarioTemporalNodeDetails | null;
|
|
1133
1335
|
inputData: unknown | null;
|
|
1134
1336
|
/** Additive (core >= 1.27): see ScenarioStepBaseEvent.resolvedInput. */
|
|
1135
1337
|
resolvedInput?: unknown | null;
|