@ai-setting/roy-agent-core 1.4.10 → 1.4.12
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/dist/config/index.js +23 -0
- package/dist/env/agent/index.js +3035 -0
- package/dist/env/commands/index.js +1685 -0
- package/dist/env/debug/formatters/index.js +639 -0
- package/dist/env/debug/index.js +2300 -0
- package/dist/env/hook/index.js +273 -0
- package/dist/env/index.js +12591 -0
- package/dist/env/llm/index.js +2736 -0
- package/dist/env/log-trace/index.js +1779 -0
- package/dist/env/mcp/index.js +2173 -0
- package/dist/env/mcp/tool/index.js +1149 -0
- package/dist/env/memory/built-in/index.js +225 -0
- package/dist/env/memory/index.js +2171 -0
- package/dist/env/memory/plugin/index.js +1263 -0
- package/dist/env/prompt/index.js +2107 -0
- package/dist/env/session/index.js +3594 -0
- package/dist/env/session/storage/index.js +2049 -0
- package/dist/env/skill/index.js +1635 -0
- package/dist/env/skill/tool/index.js +114 -0
- package/dist/env/task/delegate/index.js +1844 -0
- package/dist/env/task/hooks/index.js +67 -0
- package/dist/env/task/index.js +3578 -0
- package/dist/env/task/plugins/index.js +1626 -0
- package/dist/env/task/storage/index.js +1464 -0
- package/dist/env/task/tools/index.js +344 -0
- package/dist/env/task/tools/operation/index.js +270 -0
- package/dist/env/tool/built-in/index.js +1151 -0
- package/dist/env/tool/index.js +2284 -0
- package/dist/env/workflow/decorators/index.js +449 -0
- package/dist/env/workflow/engine/index.js +4391 -0
- package/dist/env/workflow/index.js +6214 -0
- package/dist/env/workflow/nodes/index.js +650 -0
- package/dist/env/workflow/service/index.js +262 -0
- package/dist/env/workflow/storage/index.js +1236 -0
- package/dist/env/workflow/tools/index.js +1081 -0
- package/dist/env/workflow/types/index.js +479 -0
- package/dist/env/workflow/utils/index.js +1631 -0
- package/dist/index.js +15006 -14265
- package/package.json +2 -2
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
function __accessProp(key) {
|
|
7
|
+
return this[key];
|
|
8
|
+
}
|
|
9
|
+
var __toCommonJS = (from) => {
|
|
10
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
11
|
+
if (entry)
|
|
12
|
+
return entry;
|
|
13
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (var key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(entry, key))
|
|
17
|
+
__defProp(entry, key, {
|
|
18
|
+
get: __accessProp.bind(from, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
__moduleCache.set(from, entry);
|
|
23
|
+
return entry;
|
|
24
|
+
};
|
|
25
|
+
var __moduleCache;
|
|
26
|
+
var __returnValue = (v) => v;
|
|
27
|
+
function __exportSetter(name, newValue) {
|
|
28
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
29
|
+
}
|
|
30
|
+
var __export = (target, all) => {
|
|
31
|
+
for (var name in all)
|
|
32
|
+
__defProp(target, name, {
|
|
33
|
+
get: all[name],
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
set: __exportSetter.bind(all, name)
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
40
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
41
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
42
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
43
|
+
else
|
|
44
|
+
for (var i = decorators.length - 1;i >= 0; i--)
|
|
45
|
+
if (d = decorators[i])
|
|
46
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
47
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
48
|
+
};
|
|
49
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
50
|
+
var __require = import.meta.require;
|
|
51
|
+
|
|
52
|
+
// packages/core/src/env/workflow/types/workflow.ts
|
|
53
|
+
import { z } from "zod";
|
|
54
|
+
async function getYamlParser() {
|
|
55
|
+
if (!yamlParser) {
|
|
56
|
+
yamlParser = await import("yaml");
|
|
57
|
+
}
|
|
58
|
+
return yamlParser;
|
|
59
|
+
}
|
|
60
|
+
async function parseWorkflowFile(content, filename) {
|
|
61
|
+
const isYaml = filename.endsWith(".yaml") || filename.endsWith(".yml");
|
|
62
|
+
const isJson = filename.endsWith(".json");
|
|
63
|
+
let definition;
|
|
64
|
+
if (isYaml) {
|
|
65
|
+
const yaml = await getYamlParser();
|
|
66
|
+
definition = WorkflowDefinitionSchema.parse(yaml.parse(content));
|
|
67
|
+
} else if (isJson) {
|
|
68
|
+
definition = WorkflowDefinitionSchema.parse(JSON.parse(content));
|
|
69
|
+
} else {
|
|
70
|
+
try {
|
|
71
|
+
definition = WorkflowDefinitionSchema.parse(JSON.parse(content));
|
|
72
|
+
} catch {
|
|
73
|
+
const yaml = await getYamlParser();
|
|
74
|
+
definition = WorkflowDefinitionSchema.parse(yaml.parse(content));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
format: isYaml ? "yaml" : "json",
|
|
79
|
+
definition
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function parseWorkflowFileSync(content, filename) {
|
|
83
|
+
const isYaml = filename.endsWith(".yaml") || filename.endsWith(".yml");
|
|
84
|
+
const isJson = filename.endsWith(".json");
|
|
85
|
+
let definition;
|
|
86
|
+
if (isJson) {
|
|
87
|
+
definition = WorkflowDefinitionSchema.parse(JSON.parse(content));
|
|
88
|
+
} else if (isYaml) {
|
|
89
|
+
throw new Error("Synchronous YAML parsing not supported. Use parseWorkflowFile() instead.");
|
|
90
|
+
} else {
|
|
91
|
+
try {
|
|
92
|
+
definition = WorkflowDefinitionSchema.parse(JSON.parse(content));
|
|
93
|
+
} catch {
|
|
94
|
+
throw new Error("Cannot auto-detect format. Please use .yaml, .yml, or .json extension.");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
format: isJson ? "json" : "yaml",
|
|
99
|
+
definition
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
var DependsOnSchema, RetryConfigSchema, NodeDefinitionSchema, WorkflowConfigSchema, OutputDefinitionSchema, WorkflowMetadataSchema, WorkflowDefinitionSchema, yamlParser = null;
|
|
103
|
+
var init_workflow = __esm(() => {
|
|
104
|
+
DependsOnSchema = z.array(z.string());
|
|
105
|
+
RetryConfigSchema = z.object({
|
|
106
|
+
max_attempts: z.number().min(1).default(1),
|
|
107
|
+
backoff: z.enum(["fixed", "exponential"]).default("exponential"),
|
|
108
|
+
initial_delay: z.number().min(0).default(1000)
|
|
109
|
+
});
|
|
110
|
+
NodeDefinitionSchema = z.object({
|
|
111
|
+
id: z.string().min(1, "Node ID is required"),
|
|
112
|
+
type: z.string().min(1, "Node type is required"),
|
|
113
|
+
name: z.string().optional(),
|
|
114
|
+
config: z.record(z.string(), z.unknown()).optional().default({}),
|
|
115
|
+
depends_on: z.array(z.string()).optional(),
|
|
116
|
+
condition: z.string().optional(),
|
|
117
|
+
retry: RetryConfigSchema.optional(),
|
|
118
|
+
timeout: z.number().optional()
|
|
119
|
+
});
|
|
120
|
+
WorkflowConfigSchema = z.object({
|
|
121
|
+
parallel_limit: z.number().nullable().optional(),
|
|
122
|
+
timeout: z.number().nullable().optional(),
|
|
123
|
+
retry: RetryConfigSchema.optional(),
|
|
124
|
+
debug: z.boolean().optional()
|
|
125
|
+
});
|
|
126
|
+
OutputDefinitionSchema = z.object({
|
|
127
|
+
name: z.string(),
|
|
128
|
+
source: z.string(),
|
|
129
|
+
path: z.string()
|
|
130
|
+
});
|
|
131
|
+
WorkflowMetadataSchema = z.object({
|
|
132
|
+
author: z.string().optional(),
|
|
133
|
+
taskId: z.number().optional(),
|
|
134
|
+
tags: z.array(z.string()).optional().default([]),
|
|
135
|
+
created_at: z.string().optional(),
|
|
136
|
+
updated_at: z.string().optional()
|
|
137
|
+
});
|
|
138
|
+
WorkflowDefinitionSchema = z.object({
|
|
139
|
+
name: z.string().min(1, "Workflow name is required"),
|
|
140
|
+
version: z.string().default("1.0"),
|
|
141
|
+
description: z.string().optional(),
|
|
142
|
+
config: WorkflowConfigSchema.optional().default({}),
|
|
143
|
+
nodes: z.array(NodeDefinitionSchema).min(1, "At least one node is required"),
|
|
144
|
+
entry: z.union([z.string(), z.array(z.string())]).default("__default_entry__"),
|
|
145
|
+
outputs: z.array(OutputDefinitionSchema).optional().default([]),
|
|
146
|
+
metadata: WorkflowMetadataSchema.optional().default({})
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// packages/core/src/env/workflow/types/workflow-hil.ts
|
|
151
|
+
function createNodeInterruptEvent(runId, nodeId, nodeType, query, agentSessionId) {
|
|
152
|
+
return {
|
|
153
|
+
type: "node.interrupt",
|
|
154
|
+
run_id: runId,
|
|
155
|
+
timestamp: Date.now(),
|
|
156
|
+
node_id: nodeId,
|
|
157
|
+
node_type: nodeType,
|
|
158
|
+
query,
|
|
159
|
+
...agentSessionId ? { agent_session_id: agentSessionId } : {}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function createWorkflowAskUserEvent(runId, sessionId, nodeId, nodeType, query) {
|
|
163
|
+
return {
|
|
164
|
+
type: "workflow.ask-user",
|
|
165
|
+
run_id: runId,
|
|
166
|
+
timestamp: Date.now(),
|
|
167
|
+
session_id: sessionId,
|
|
168
|
+
node_id: nodeId,
|
|
169
|
+
node_type: nodeType,
|
|
170
|
+
query
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
var AskUserError;
|
|
174
|
+
var init_workflow_hil = __esm(() => {
|
|
175
|
+
AskUserError = class AskUserError extends Error {
|
|
176
|
+
runId;
|
|
177
|
+
sessionId;
|
|
178
|
+
nodeId;
|
|
179
|
+
nodeType;
|
|
180
|
+
query;
|
|
181
|
+
agentSessionId;
|
|
182
|
+
timestamp;
|
|
183
|
+
type = "ask-user";
|
|
184
|
+
name = "AskUserError";
|
|
185
|
+
constructor(runId, sessionId, nodeId, nodeType, query, agentSessionId, timestamp = Date.now()) {
|
|
186
|
+
super(`[${nodeType}:${nodeId}] Ask user: ${query}`);
|
|
187
|
+
this.runId = runId;
|
|
188
|
+
this.sessionId = sessionId;
|
|
189
|
+
this.nodeId = nodeId;
|
|
190
|
+
this.nodeType = nodeType;
|
|
191
|
+
this.query = query;
|
|
192
|
+
this.agentSessionId = agentSessionId;
|
|
193
|
+
this.timestamp = timestamp;
|
|
194
|
+
}
|
|
195
|
+
toEvent() {
|
|
196
|
+
return {
|
|
197
|
+
type: "workflow.ask-user",
|
|
198
|
+
run_id: this.runId,
|
|
199
|
+
timestamp: this.timestamp,
|
|
200
|
+
session_id: this.sessionId,
|
|
201
|
+
node_id: this.nodeId,
|
|
202
|
+
node_type: this.nodeType,
|
|
203
|
+
query: this.query
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// packages/core/src/env/workflow/types/workflow-message.ts
|
|
210
|
+
import { z as z2 } from "zod";
|
|
211
|
+
var WorkflowMessageRoleSchema;
|
|
212
|
+
var init_workflow_message = __esm(() => {
|
|
213
|
+
init_workflow_hil();
|
|
214
|
+
WorkflowMessageRoleSchema = z2.enum([
|
|
215
|
+
"workflow.node.call",
|
|
216
|
+
"workflow.node.interrupt",
|
|
217
|
+
"workflow.node.result",
|
|
218
|
+
"workflow.node.resume"
|
|
219
|
+
]);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// packages/core/src/env/workflow/types/workflow-session.ts
|
|
223
|
+
function isWorkflowSessionMetadata(metadata) {
|
|
224
|
+
if (typeof metadata !== "object" || metadata === null || !("type" in metadata) || metadata.type !== "workflow") {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
const m = metadata;
|
|
228
|
+
if (!m.workflowId || typeof m.workflowId !== "string") {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
if (!m.workflowName || typeof m.workflowName !== "string") {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
if (!m.status || typeof m.status !== "string") {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
const validStatuses = ["running", "paused", "completed", "failed", "stopped"];
|
|
238
|
+
if (!validStatuses.includes(m.status)) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
function getWorkflowSessionStatus(metadata) {
|
|
244
|
+
return metadata.status || "running";
|
|
245
|
+
}
|
|
246
|
+
// packages/core/src/env/workflow/types/event.ts
|
|
247
|
+
import { z as z3 } from "zod";
|
|
248
|
+
function createWorkflowEvent(type, runId, data) {
|
|
249
|
+
return {
|
|
250
|
+
type,
|
|
251
|
+
run_id: runId,
|
|
252
|
+
timestamp: Date.now(),
|
|
253
|
+
...data
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
var BaseEventSchema, WorkflowStartedEventSchema, WorkflowPausedEventSchema, WorkflowResumedEventSchema, WorkflowStoppedEventSchema, WorkflowCompletedEventSchema, WorkflowFailedEventSchema, WorkflowOutputEventSchema, NodeScheduledEventSchema, NodeStartedEventSchema, NodeProgressEventSchema, NodeCompletedEventSchema, NodeFailedEventSchema, NodeSkippedEventSchema, NodeDataEventSchema, NodeAddedEventSchema, NodeRemovedEventSchema, ControlPauseEventSchema, ControlResumeEventSchema, ControlStopEventSchema, NodeInterruptEventSchema, WorkflowAskUserEventSchema, WorkflowEventSchema;
|
|
257
|
+
var init_event = __esm(() => {
|
|
258
|
+
BaseEventSchema = z3.object({
|
|
259
|
+
type: z3.string(),
|
|
260
|
+
run_id: z3.string(),
|
|
261
|
+
timestamp: z3.number()
|
|
262
|
+
});
|
|
263
|
+
WorkflowStartedEventSchema = BaseEventSchema.extend({
|
|
264
|
+
type: z3.literal("workflow.started"),
|
|
265
|
+
workflow_name: z3.string(),
|
|
266
|
+
input: z3.record(z3.string(), z3.unknown()).optional()
|
|
267
|
+
});
|
|
268
|
+
WorkflowPausedEventSchema = BaseEventSchema.extend({
|
|
269
|
+
type: z3.literal("workflow.paused")
|
|
270
|
+
});
|
|
271
|
+
WorkflowResumedEventSchema = BaseEventSchema.extend({
|
|
272
|
+
type: z3.literal("workflow.resumed")
|
|
273
|
+
});
|
|
274
|
+
WorkflowStoppedEventSchema = BaseEventSchema.extend({
|
|
275
|
+
type: z3.literal("workflow.stopped"),
|
|
276
|
+
reason: z3.string()
|
|
277
|
+
});
|
|
278
|
+
WorkflowCompletedEventSchema = BaseEventSchema.extend({
|
|
279
|
+
type: z3.literal("workflow.completed"),
|
|
280
|
+
result: z3.record(z3.string(), z3.unknown()).optional(),
|
|
281
|
+
duration_ms: z3.number()
|
|
282
|
+
});
|
|
283
|
+
WorkflowFailedEventSchema = BaseEventSchema.extend({
|
|
284
|
+
type: z3.literal("workflow.failed"),
|
|
285
|
+
error: z3.object({
|
|
286
|
+
message: z3.string(),
|
|
287
|
+
stack: z3.string().optional()
|
|
288
|
+
}),
|
|
289
|
+
failed_at: z3.string()
|
|
290
|
+
});
|
|
291
|
+
WorkflowOutputEventSchema = BaseEventSchema.extend({
|
|
292
|
+
type: z3.literal("workflow.output"),
|
|
293
|
+
output: z3.record(z3.string(), z3.unknown())
|
|
294
|
+
});
|
|
295
|
+
NodeScheduledEventSchema = BaseEventSchema.extend({
|
|
296
|
+
type: z3.literal("node.scheduled"),
|
|
297
|
+
node_id: z3.string()
|
|
298
|
+
});
|
|
299
|
+
NodeStartedEventSchema = BaseEventSchema.extend({
|
|
300
|
+
type: z3.literal("node.started"),
|
|
301
|
+
node_id: z3.string(),
|
|
302
|
+
input: z3.any(),
|
|
303
|
+
agentSessionId: z3.string().optional(),
|
|
304
|
+
userResponse: z3.string().optional()
|
|
305
|
+
});
|
|
306
|
+
NodeProgressEventSchema = BaseEventSchema.extend({
|
|
307
|
+
type: z3.literal("node.progress"),
|
|
308
|
+
node_id: z3.string(),
|
|
309
|
+
progress: z3.number(),
|
|
310
|
+
message: z3.string().optional()
|
|
311
|
+
});
|
|
312
|
+
NodeCompletedEventSchema = BaseEventSchema.extend({
|
|
313
|
+
type: z3.literal("node.completed"),
|
|
314
|
+
node_id: z3.string(),
|
|
315
|
+
output: z3.any(),
|
|
316
|
+
duration_ms: z3.number()
|
|
317
|
+
});
|
|
318
|
+
NodeFailedEventSchema = BaseEventSchema.extend({
|
|
319
|
+
type: z3.literal("node.failed"),
|
|
320
|
+
node_id: z3.string(),
|
|
321
|
+
error: z3.object({
|
|
322
|
+
message: z3.string(),
|
|
323
|
+
stack: z3.string().optional()
|
|
324
|
+
})
|
|
325
|
+
});
|
|
326
|
+
NodeSkippedEventSchema = BaseEventSchema.extend({
|
|
327
|
+
type: z3.literal("node.skipped"),
|
|
328
|
+
node_id: z3.string(),
|
|
329
|
+
reason: z3.string()
|
|
330
|
+
});
|
|
331
|
+
NodeDataEventSchema = BaseEventSchema.extend({
|
|
332
|
+
type: z3.literal("node.data"),
|
|
333
|
+
from_node: z3.string(),
|
|
334
|
+
to_node: z3.string(),
|
|
335
|
+
data: z3.any()
|
|
336
|
+
});
|
|
337
|
+
NodeAddedEventSchema = BaseEventSchema.extend({
|
|
338
|
+
type: z3.literal("node.added"),
|
|
339
|
+
node_id: z3.string(),
|
|
340
|
+
node: z3.any()
|
|
341
|
+
});
|
|
342
|
+
NodeRemovedEventSchema = BaseEventSchema.extend({
|
|
343
|
+
type: z3.literal("node.removed"),
|
|
344
|
+
node_id: z3.string()
|
|
345
|
+
});
|
|
346
|
+
ControlPauseEventSchema = BaseEventSchema.extend({
|
|
347
|
+
type: z3.literal("control.pause")
|
|
348
|
+
});
|
|
349
|
+
ControlResumeEventSchema = BaseEventSchema.extend({
|
|
350
|
+
type: z3.literal("control.resume")
|
|
351
|
+
});
|
|
352
|
+
ControlStopEventSchema = BaseEventSchema.extend({
|
|
353
|
+
type: z3.literal("control.stop")
|
|
354
|
+
});
|
|
355
|
+
NodeInterruptEventSchema = BaseEventSchema.extend({
|
|
356
|
+
type: z3.literal("node.interrupt"),
|
|
357
|
+
node_id: z3.string(),
|
|
358
|
+
node_type: z3.string(),
|
|
359
|
+
query: z3.string()
|
|
360
|
+
});
|
|
361
|
+
WorkflowAskUserEventSchema = BaseEventSchema.extend({
|
|
362
|
+
type: z3.literal("workflow.ask-user"),
|
|
363
|
+
session_id: z3.string(),
|
|
364
|
+
node_id: z3.string(),
|
|
365
|
+
node_type: z3.string(),
|
|
366
|
+
query: z3.string()
|
|
367
|
+
});
|
|
368
|
+
WorkflowEventSchema = z3.union([
|
|
369
|
+
WorkflowStartedEventSchema,
|
|
370
|
+
WorkflowPausedEventSchema,
|
|
371
|
+
WorkflowResumedEventSchema,
|
|
372
|
+
WorkflowStoppedEventSchema,
|
|
373
|
+
WorkflowCompletedEventSchema,
|
|
374
|
+
WorkflowFailedEventSchema,
|
|
375
|
+
WorkflowOutputEventSchema,
|
|
376
|
+
NodeScheduledEventSchema,
|
|
377
|
+
NodeStartedEventSchema,
|
|
378
|
+
NodeProgressEventSchema,
|
|
379
|
+
NodeCompletedEventSchema,
|
|
380
|
+
NodeFailedEventSchema,
|
|
381
|
+
NodeSkippedEventSchema,
|
|
382
|
+
NodeDataEventSchema,
|
|
383
|
+
NodeAddedEventSchema,
|
|
384
|
+
NodeRemovedEventSchema,
|
|
385
|
+
ControlPauseEventSchema,
|
|
386
|
+
ControlResumeEventSchema,
|
|
387
|
+
ControlStopEventSchema,
|
|
388
|
+
NodeInterruptEventSchema,
|
|
389
|
+
WorkflowAskUserEventSchema
|
|
390
|
+
]);
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
// packages/core/src/env/workflow/types/run.ts
|
|
394
|
+
import { z as z4 } from "zod";
|
|
395
|
+
function createNodeExecutionContext(params) {
|
|
396
|
+
return {
|
|
397
|
+
...params,
|
|
398
|
+
askUser: (query) => {
|
|
399
|
+
throw new AskUserError(params.runId, params.sessionId, params.nodeId, "unknown", query);
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
var RunStatusSchema, NodeStatusSchema;
|
|
404
|
+
var init_run = __esm(() => {
|
|
405
|
+
init_workflow_message();
|
|
406
|
+
RunStatusSchema = z4.enum([
|
|
407
|
+
"idle",
|
|
408
|
+
"running",
|
|
409
|
+
"paused",
|
|
410
|
+
"stopped",
|
|
411
|
+
"completed",
|
|
412
|
+
"failed"
|
|
413
|
+
]);
|
|
414
|
+
NodeStatusSchema = z4.enum([
|
|
415
|
+
"pending",
|
|
416
|
+
"scheduled",
|
|
417
|
+
"started",
|
|
418
|
+
"running",
|
|
419
|
+
"completed",
|
|
420
|
+
"failed",
|
|
421
|
+
"skipped"
|
|
422
|
+
]);
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
// packages/core/src/env/workflow/types/index.ts
|
|
426
|
+
var init_types = __esm(() => {
|
|
427
|
+
init_run();
|
|
428
|
+
init_workflow();
|
|
429
|
+
init_workflow_message();
|
|
430
|
+
init_workflow_hil();
|
|
431
|
+
init_event();
|
|
432
|
+
init_run();
|
|
433
|
+
});
|
|
434
|
+
init_types();
|
|
435
|
+
|
|
436
|
+
export {
|
|
437
|
+
parseWorkflowFileSync,
|
|
438
|
+
parseWorkflowFile,
|
|
439
|
+
isWorkflowSessionMetadata,
|
|
440
|
+
getWorkflowSessionStatus,
|
|
441
|
+
createWorkflowEvent,
|
|
442
|
+
createWorkflowAskUserEvent,
|
|
443
|
+
createNodeInterruptEvent,
|
|
444
|
+
createNodeExecutionContext,
|
|
445
|
+
WorkflowStoppedEventSchema,
|
|
446
|
+
WorkflowStartedEventSchema,
|
|
447
|
+
WorkflowResumedEventSchema,
|
|
448
|
+
WorkflowPausedEventSchema,
|
|
449
|
+
WorkflowOutputEventSchema,
|
|
450
|
+
WorkflowMetadataSchema,
|
|
451
|
+
WorkflowMessageRoleSchema,
|
|
452
|
+
WorkflowFailedEventSchema,
|
|
453
|
+
WorkflowEventSchema,
|
|
454
|
+
WorkflowDefinitionSchema,
|
|
455
|
+
WorkflowConfigSchema,
|
|
456
|
+
WorkflowCompletedEventSchema,
|
|
457
|
+
WorkflowAskUserEventSchema,
|
|
458
|
+
RunStatusSchema,
|
|
459
|
+
RetryConfigSchema,
|
|
460
|
+
OutputDefinitionSchema,
|
|
461
|
+
NodeStatusSchema,
|
|
462
|
+
NodeStartedEventSchema,
|
|
463
|
+
NodeSkippedEventSchema,
|
|
464
|
+
NodeScheduledEventSchema,
|
|
465
|
+
NodeRemovedEventSchema,
|
|
466
|
+
NodeProgressEventSchema,
|
|
467
|
+
NodeInterruptEventSchema,
|
|
468
|
+
NodeFailedEventSchema,
|
|
469
|
+
NodeDefinitionSchema,
|
|
470
|
+
NodeDataEventSchema,
|
|
471
|
+
NodeCompletedEventSchema,
|
|
472
|
+
NodeAddedEventSchema,
|
|
473
|
+
DependsOnSchema,
|
|
474
|
+
ControlStopEventSchema,
|
|
475
|
+
ControlResumeEventSchema,
|
|
476
|
+
ControlPauseEventSchema,
|
|
477
|
+
BaseEventSchema,
|
|
478
|
+
AskUserError
|
|
479
|
+
};
|