@ai-setting/roy-agent-core 1.4.13 → 1.4.14
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/packages/core/src/config/index.js +32 -0
- package/dist/packages/core/src/env/agent/index.js +24 -0
- package/dist/packages/core/src/env/commands/index.js +14 -0
- package/dist/packages/core/src/env/debug/formatters/index.js +11 -0
- package/dist/packages/core/src/env/debug/index.js +26 -0
- package/dist/packages/core/src/env/hook/index.js +29 -0
- package/dist/packages/core/src/env/index.js +81 -0
- package/dist/packages/core/src/env/llm/index.js +40 -0
- package/dist/packages/core/src/env/log-trace/index.js +83 -0
- package/dist/packages/core/src/env/mcp/index.js +39 -0
- package/dist/packages/core/src/env/mcp/tool/index.js +14 -0
- package/dist/packages/core/src/env/memory/built-in/index.js +11 -0
- package/dist/packages/core/src/env/memory/index.js +56 -0
- package/dist/packages/core/src/env/memory/plugin/index.js +36 -0
- package/dist/packages/core/src/env/prompt/index.js +20 -0
- package/dist/packages/core/src/env/session/index.js +25 -0
- package/dist/packages/core/src/env/session/storage/index.js +18 -0
- package/dist/packages/core/src/env/skill/index.js +34 -0
- package/dist/packages/core/src/env/skill/tool/index.js +9 -0
- package/dist/packages/core/src/env/task/delegate/index.js +18 -0
- package/dist/packages/core/src/env/task/hooks/index.js +7 -0
- package/dist/packages/core/src/env/task/index.js +30 -0
- package/dist/packages/core/src/env/task/plugins/index.js +23 -0
- package/dist/packages/core/src/env/task/storage/index.js +14 -0
- package/dist/packages/core/src/env/task/tools/index.js +17 -0
- package/dist/packages/core/src/env/task/tools/operation/index.js +15 -0
- package/dist/{shared/chunk-1d4rwms4.js → packages/core/src/env/tool/built-in/index.js} +4 -4
- package/dist/packages/core/src/env/tool/index.js +39 -0
- package/dist/packages/core/src/env/workflow/decorators/index.js +27 -0
- package/dist/packages/core/src/env/workflow/engine/index.js +28 -0
- package/dist/packages/core/src/env/workflow/index.js +132 -0
- package/dist/packages/core/src/env/workflow/nodes/index.js +19 -0
- package/dist/packages/core/src/env/workflow/service/index.js +13 -0
- package/dist/packages/core/src/env/workflow/storage/index.js +27 -0
- package/dist/packages/core/src/env/workflow/tools/index.js +159 -0
- package/dist/packages/core/src/env/workflow/types/index.js +94 -0
- package/dist/packages/core/src/env/workflow/utils/index.js +637 -0
- package/dist/packages/core/src/index.js +398 -0
- package/dist/shared/@ai-setting/roy-agent-core-04fm8177.js +393 -0
- package/dist/shared/@ai-setting/roy-agent-core-04qgbjbe.js +172 -0
- package/dist/shared/@ai-setting/roy-agent-core-084qqd7t.js +11 -0
- package/dist/shared/@ai-setting/roy-agent-core-0gekht4e.js +1130 -0
- package/dist/shared/@ai-setting/roy-agent-core-0hdry23r.js +419 -0
- package/dist/shared/{chunk-ze20rksg.js → @ai-setting/roy-agent-core-0sgn3de4.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-12x57kf1.js +286 -0
- package/dist/shared/@ai-setting/roy-agent-core-1f3xrrm6.js +393 -0
- package/dist/shared/{chunk-q9j99fsm.js → @ai-setting/roy-agent-core-1k28kg7h.js} +6 -6
- package/dist/shared/{chunk-2b5kbhx3.js → @ai-setting/roy-agent-core-1z1zv5g8.js} +9 -117
- package/dist/shared/@ai-setting/roy-agent-core-2hqxnaf3.js +851 -0
- package/dist/shared/@ai-setting/roy-agent-core-3dfq8awb.js +587 -0
- package/dist/shared/@ai-setting/roy-agent-core-3takar0s.js +93 -0
- package/dist/shared/@ai-setting/roy-agent-core-3tnb2005.js +117 -0
- package/dist/shared/@ai-setting/roy-agent-core-4vmcvkav.js +14 -0
- package/dist/shared/{chunk-25x2pdtp.js → @ai-setting/roy-agent-core-4ws8atva.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-5fbp24se.js +603 -0
- package/dist/shared/@ai-setting/roy-agent-core-5my94ywp.js +66 -0
- package/dist/shared/{chunk-rncy3rtd.js → @ai-setting/roy-agent-core-6j0zcmwk.js} +128 -1122
- package/dist/shared/@ai-setting/roy-agent-core-6w4pmxc7.js +266 -0
- package/dist/shared/{chunk-yqmx37vm.js → @ai-setting/roy-agent-core-7vrk3add.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-8dvbn7tw.js +64 -0
- package/dist/shared/@ai-setting/roy-agent-core-8mbmrwzs.js +171 -0
- package/dist/shared/@ai-setting/roy-agent-core-8wzz66qe.js +620 -0
- package/dist/shared/@ai-setting/roy-agent-core-9ykq91jc.js +762 -0
- package/dist/shared/@ai-setting/roy-agent-core-dde19zke.js +1305 -0
- package/dist/shared/@ai-setting/roy-agent-core-f7g67gce.js +913 -0
- package/dist/shared/@ai-setting/roy-agent-core-fq5mtxsy.js +341 -0
- package/dist/shared/@ai-setting/roy-agent-core-fvd9g6k8.js +1205 -0
- package/dist/shared/@ai-setting/roy-agent-core-gv1hrn3x.js +378 -0
- package/dist/shared/@ai-setting/roy-agent-core-gy0wp5h7.js +213 -0
- package/dist/shared/{chunk-mf5xqbdh.js → @ai-setting/roy-agent-core-hyza1gm7.js} +3 -2
- package/dist/shared/{chunk-1qwabsm0.js → @ai-setting/roy-agent-core-j8zx62zr.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-jb2exr0d.js +442 -0
- package/dist/shared/@ai-setting/roy-agent-core-jv3b7v9w.js +57 -0
- package/dist/shared/@ai-setting/roy-agent-core-k1rxf9ya.js +513 -0
- package/dist/shared/@ai-setting/roy-agent-core-kydc9nwb.js +60 -0
- package/dist/shared/@ai-setting/roy-agent-core-m2x48hw6.js +97 -0
- package/dist/shared/@ai-setting/roy-agent-core-m6y668cc.js +377 -0
- package/dist/shared/{chunk-1aakcfp1.js → @ai-setting/roy-agent-core-nczzf0ms.js} +3 -3
- package/dist/shared/@ai-setting/roy-agent-core-nfj6knp5.js +36 -0
- package/dist/shared/@ai-setting/roy-agent-core-ntrp979d.js +204 -0
- package/dist/shared/@ai-setting/roy-agent-core-pd7g8z5v.js +1387 -0
- package/dist/shared/@ai-setting/roy-agent-core-pzk1syce.js +14 -0
- package/dist/shared/@ai-setting/roy-agent-core-q50tg9m2.js +862 -0
- package/dist/shared/{chunk-9qzt1v1p.js → @ai-setting/roy-agent-core-qg9tcaph.js} +3 -2
- package/dist/shared/{chunk-91bas8w5.js → @ai-setting/roy-agent-core-qhyerewk.js} +5 -5
- package/dist/shared/{chunk-1pf5mfgd.js → @ai-setting/roy-agent-core-qxybm159.js} +3 -3
- package/dist/shared/{chunk-g6j5n3gv.js → @ai-setting/roy-agent-core-rh9dpkpw.js} +10 -10
- package/dist/shared/{chunk-0q6s9wm6.js → @ai-setting/roy-agent-core-rr9p1g43.js} +7 -51
- package/dist/shared/@ai-setting/roy-agent-core-sbzvpfn7.js +284 -0
- package/dist/shared/@ai-setting/roy-agent-core-t22nqt4d.js +788 -0
- package/dist/shared/{chunk-t1rh6jtm.js → @ai-setting/roy-agent-core-tkr5ynkh.js} +8 -13
- package/dist/shared/@ai-setting/roy-agent-core-v4aabsf0.js +303 -0
- package/dist/shared/@ai-setting/roy-agent-core-w75rafhy.js +202 -0
- package/dist/shared/@ai-setting/roy-agent-core-w76hqkmg.js +584 -0
- package/dist/shared/@ai-setting/roy-agent-core-yfbgwes2.js +408 -0
- package/dist/shared/{chunk-a9qmy3sc.js → @ai-setting/roy-agent-core-yn761yve.js} +7 -4
- package/dist/shared/@ai-setting/roy-agent-core-yrzmn4m1.js +492 -0
- package/dist/shared/@ai-setting/roy-agent-core-yt8wdh2w.js +206 -0
- package/package.json +8 -7
- package/dist/index.d.ts +0 -7825
- package/dist/index.js +0 -16551
- package/dist/shared/chunk-hs7tbmje.js +0 -24
- /package/dist/shared/{chunk-wbkh7wat.js → @ai-setting/roy-agent-core-fs0mn2jk.js} +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AskUserError,
|
|
3
|
+
init_workflow_hil
|
|
4
|
+
} from "./roy-agent-core-8dvbn7tw.js";
|
|
5
|
+
import {
|
|
6
|
+
__esm,
|
|
7
|
+
__require
|
|
8
|
+
} from "./roy-agent-core-fs0mn2jk.js";
|
|
9
|
+
|
|
10
|
+
// packages/core/src/env/workflow/types/workflow.ts
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
async function getYamlParser() {
|
|
13
|
+
if (!yamlParser) {
|
|
14
|
+
yamlParser = await import("yaml");
|
|
15
|
+
}
|
|
16
|
+
return yamlParser;
|
|
17
|
+
}
|
|
18
|
+
async function parseWorkflowFile(content, filename) {
|
|
19
|
+
const isYaml = filename.endsWith(".yaml") || filename.endsWith(".yml");
|
|
20
|
+
const isJson = filename.endsWith(".json");
|
|
21
|
+
let definition;
|
|
22
|
+
if (isYaml) {
|
|
23
|
+
const yaml = await getYamlParser();
|
|
24
|
+
definition = WorkflowDefinitionSchema.parse(yaml.parse(content));
|
|
25
|
+
} else if (isJson) {
|
|
26
|
+
definition = WorkflowDefinitionSchema.parse(JSON.parse(content));
|
|
27
|
+
} else {
|
|
28
|
+
try {
|
|
29
|
+
definition = WorkflowDefinitionSchema.parse(JSON.parse(content));
|
|
30
|
+
} catch {
|
|
31
|
+
const yaml = await getYamlParser();
|
|
32
|
+
definition = WorkflowDefinitionSchema.parse(yaml.parse(content));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
format: isYaml ? "yaml" : "json",
|
|
37
|
+
definition
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function parseWorkflowFileSync(content, filename) {
|
|
41
|
+
const isYaml = filename.endsWith(".yaml") || filename.endsWith(".yml");
|
|
42
|
+
const isJson = filename.endsWith(".json");
|
|
43
|
+
let definition;
|
|
44
|
+
if (isJson) {
|
|
45
|
+
definition = WorkflowDefinitionSchema.parse(JSON.parse(content));
|
|
46
|
+
} else if (isYaml) {
|
|
47
|
+
throw new Error("Synchronous YAML parsing not supported. Use parseWorkflowFile() instead.");
|
|
48
|
+
} else {
|
|
49
|
+
try {
|
|
50
|
+
definition = WorkflowDefinitionSchema.parse(JSON.parse(content));
|
|
51
|
+
} catch {
|
|
52
|
+
throw new Error("Cannot auto-detect format. Please use .yaml, .yml, or .json extension.");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
format: isJson ? "json" : "yaml",
|
|
57
|
+
definition
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
var DependsOnSchema, RetryConfigSchema, NodeDefinitionSchema, WorkflowConfigSchema, OutputDefinitionSchema, WorkflowMetadataSchema, WorkflowDefinitionSchema, yamlParser = null;
|
|
61
|
+
var init_workflow = __esm(() => {
|
|
62
|
+
DependsOnSchema = z.array(z.string());
|
|
63
|
+
RetryConfigSchema = z.object({
|
|
64
|
+
max_attempts: z.number().min(1).default(1),
|
|
65
|
+
backoff: z.enum(["fixed", "exponential"]).default("exponential"),
|
|
66
|
+
initial_delay: z.number().min(0).default(1000)
|
|
67
|
+
});
|
|
68
|
+
NodeDefinitionSchema = z.object({
|
|
69
|
+
id: z.string().min(1, "Node ID is required"),
|
|
70
|
+
type: z.string().min(1, "Node type is required"),
|
|
71
|
+
name: z.string().optional(),
|
|
72
|
+
config: z.record(z.string(), z.unknown()).optional().default({}),
|
|
73
|
+
depends_on: z.array(z.string()).optional(),
|
|
74
|
+
condition: z.string().optional(),
|
|
75
|
+
retry: RetryConfigSchema.optional(),
|
|
76
|
+
timeout: z.number().optional()
|
|
77
|
+
});
|
|
78
|
+
WorkflowConfigSchema = z.object({
|
|
79
|
+
parallel_limit: z.number().nullable().optional(),
|
|
80
|
+
timeout: z.number().nullable().optional(),
|
|
81
|
+
retry: RetryConfigSchema.optional(),
|
|
82
|
+
debug: z.boolean().optional()
|
|
83
|
+
});
|
|
84
|
+
OutputDefinitionSchema = z.object({
|
|
85
|
+
name: z.string(),
|
|
86
|
+
source: z.string(),
|
|
87
|
+
path: z.string()
|
|
88
|
+
});
|
|
89
|
+
WorkflowMetadataSchema = z.object({
|
|
90
|
+
author: z.string().optional(),
|
|
91
|
+
taskId: z.number().optional(),
|
|
92
|
+
tags: z.array(z.string()).optional().default([]),
|
|
93
|
+
created_at: z.string().optional(),
|
|
94
|
+
updated_at: z.string().optional()
|
|
95
|
+
});
|
|
96
|
+
WorkflowDefinitionSchema = z.object({
|
|
97
|
+
name: z.string().min(1, "Workflow name is required"),
|
|
98
|
+
version: z.string().default("1.0"),
|
|
99
|
+
description: z.string().optional(),
|
|
100
|
+
config: WorkflowConfigSchema.optional().default({}),
|
|
101
|
+
nodes: z.array(NodeDefinitionSchema).min(1, "At least one node is required"),
|
|
102
|
+
entry: z.union([z.string(), z.array(z.string())]).default("__default_entry__"),
|
|
103
|
+
outputs: z.array(OutputDefinitionSchema).optional().default([]),
|
|
104
|
+
metadata: WorkflowMetadataSchema.optional().default({})
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// packages/core/src/env/workflow/types/workflow-message.ts
|
|
109
|
+
import { z as z2 } from "zod";
|
|
110
|
+
var WorkflowMessageRoleSchema;
|
|
111
|
+
var init_workflow_message = __esm(() => {
|
|
112
|
+
init_workflow_hil();
|
|
113
|
+
WorkflowMessageRoleSchema = z2.enum([
|
|
114
|
+
"workflow.node.call",
|
|
115
|
+
"workflow.node.interrupt",
|
|
116
|
+
"workflow.node.result",
|
|
117
|
+
"workflow.node.resume"
|
|
118
|
+
]);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// packages/core/src/env/workflow/types/workflow-session.ts
|
|
122
|
+
function isWorkflowSessionMetadata(metadata) {
|
|
123
|
+
if (typeof metadata !== "object" || metadata === null || !("type" in metadata) || metadata.type !== "workflow") {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
const m = metadata;
|
|
127
|
+
if (!m.workflowId || typeof m.workflowId !== "string") {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
if (!m.workflowName || typeof m.workflowName !== "string") {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
if (!m.status || typeof m.status !== "string") {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
const validStatuses = ["running", "paused", "completed", "failed", "stopped"];
|
|
137
|
+
if (!validStatuses.includes(m.status)) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
function getWorkflowSessionStatus(metadata) {
|
|
143
|
+
return metadata.status || "running";
|
|
144
|
+
}
|
|
145
|
+
var init_workflow_session = () => {};
|
|
146
|
+
|
|
147
|
+
// packages/core/src/env/workflow/types/context.ts
|
|
148
|
+
var init_context = () => {};
|
|
149
|
+
|
|
150
|
+
// packages/core/src/env/workflow/types/event.ts
|
|
151
|
+
import { z as z3 } from "zod";
|
|
152
|
+
function createWorkflowEvent(type, runId, data) {
|
|
153
|
+
return {
|
|
154
|
+
type,
|
|
155
|
+
run_id: runId,
|
|
156
|
+
timestamp: Date.now(),
|
|
157
|
+
...data
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
var BaseEventSchema, WorkflowStartedEventSchema, WorkflowPausedEventSchema, WorkflowResumedEventSchema, WorkflowStoppedEventSchema, WorkflowCompletedEventSchema, WorkflowFailedEventSchema, WorkflowOutputEventSchema, NodeScheduledEventSchema, NodeStartedEventSchema, NodeProgressEventSchema, NodeCompletedEventSchema, NodeFailedEventSchema, NodeSkippedEventSchema, NodeDataEventSchema, NodeAddedEventSchema, NodeRemovedEventSchema, ControlPauseEventSchema, ControlResumeEventSchema, ControlStopEventSchema, NodeInterruptEventSchema, WorkflowAskUserEventSchema, WorkflowEventSchema;
|
|
161
|
+
var init_event = __esm(() => {
|
|
162
|
+
BaseEventSchema = z3.object({
|
|
163
|
+
type: z3.string(),
|
|
164
|
+
run_id: z3.string(),
|
|
165
|
+
timestamp: z3.number()
|
|
166
|
+
});
|
|
167
|
+
WorkflowStartedEventSchema = BaseEventSchema.extend({
|
|
168
|
+
type: z3.literal("workflow.started"),
|
|
169
|
+
workflow_name: z3.string(),
|
|
170
|
+
input: z3.record(z3.string(), z3.unknown()).optional()
|
|
171
|
+
});
|
|
172
|
+
WorkflowPausedEventSchema = BaseEventSchema.extend({
|
|
173
|
+
type: z3.literal("workflow.paused")
|
|
174
|
+
});
|
|
175
|
+
WorkflowResumedEventSchema = BaseEventSchema.extend({
|
|
176
|
+
type: z3.literal("workflow.resumed")
|
|
177
|
+
});
|
|
178
|
+
WorkflowStoppedEventSchema = BaseEventSchema.extend({
|
|
179
|
+
type: z3.literal("workflow.stopped"),
|
|
180
|
+
reason: z3.string()
|
|
181
|
+
});
|
|
182
|
+
WorkflowCompletedEventSchema = BaseEventSchema.extend({
|
|
183
|
+
type: z3.literal("workflow.completed"),
|
|
184
|
+
result: z3.record(z3.string(), z3.unknown()).optional(),
|
|
185
|
+
duration_ms: z3.number()
|
|
186
|
+
});
|
|
187
|
+
WorkflowFailedEventSchema = BaseEventSchema.extend({
|
|
188
|
+
type: z3.literal("workflow.failed"),
|
|
189
|
+
error: z3.object({
|
|
190
|
+
message: z3.string(),
|
|
191
|
+
stack: z3.string().optional()
|
|
192
|
+
}),
|
|
193
|
+
failed_at: z3.string()
|
|
194
|
+
});
|
|
195
|
+
WorkflowOutputEventSchema = BaseEventSchema.extend({
|
|
196
|
+
type: z3.literal("workflow.output"),
|
|
197
|
+
output: z3.record(z3.string(), z3.unknown())
|
|
198
|
+
});
|
|
199
|
+
NodeScheduledEventSchema = BaseEventSchema.extend({
|
|
200
|
+
type: z3.literal("node.scheduled"),
|
|
201
|
+
node_id: z3.string()
|
|
202
|
+
});
|
|
203
|
+
NodeStartedEventSchema = BaseEventSchema.extend({
|
|
204
|
+
type: z3.literal("node.started"),
|
|
205
|
+
node_id: z3.string(),
|
|
206
|
+
input: z3.any(),
|
|
207
|
+
agentSessionId: z3.string().optional(),
|
|
208
|
+
userResponse: z3.string().optional()
|
|
209
|
+
});
|
|
210
|
+
NodeProgressEventSchema = BaseEventSchema.extend({
|
|
211
|
+
type: z3.literal("node.progress"),
|
|
212
|
+
node_id: z3.string(),
|
|
213
|
+
progress: z3.number(),
|
|
214
|
+
message: z3.string().optional()
|
|
215
|
+
});
|
|
216
|
+
NodeCompletedEventSchema = BaseEventSchema.extend({
|
|
217
|
+
type: z3.literal("node.completed"),
|
|
218
|
+
node_id: z3.string(),
|
|
219
|
+
output: z3.any(),
|
|
220
|
+
duration_ms: z3.number()
|
|
221
|
+
});
|
|
222
|
+
NodeFailedEventSchema = BaseEventSchema.extend({
|
|
223
|
+
type: z3.literal("node.failed"),
|
|
224
|
+
node_id: z3.string(),
|
|
225
|
+
error: z3.object({
|
|
226
|
+
message: z3.string(),
|
|
227
|
+
stack: z3.string().optional()
|
|
228
|
+
})
|
|
229
|
+
});
|
|
230
|
+
NodeSkippedEventSchema = BaseEventSchema.extend({
|
|
231
|
+
type: z3.literal("node.skipped"),
|
|
232
|
+
node_id: z3.string(),
|
|
233
|
+
reason: z3.string()
|
|
234
|
+
});
|
|
235
|
+
NodeDataEventSchema = BaseEventSchema.extend({
|
|
236
|
+
type: z3.literal("node.data"),
|
|
237
|
+
from_node: z3.string(),
|
|
238
|
+
to_node: z3.string(),
|
|
239
|
+
data: z3.any()
|
|
240
|
+
});
|
|
241
|
+
NodeAddedEventSchema = BaseEventSchema.extend({
|
|
242
|
+
type: z3.literal("node.added"),
|
|
243
|
+
node_id: z3.string(),
|
|
244
|
+
node: z3.any()
|
|
245
|
+
});
|
|
246
|
+
NodeRemovedEventSchema = BaseEventSchema.extend({
|
|
247
|
+
type: z3.literal("node.removed"),
|
|
248
|
+
node_id: z3.string()
|
|
249
|
+
});
|
|
250
|
+
ControlPauseEventSchema = BaseEventSchema.extend({
|
|
251
|
+
type: z3.literal("control.pause")
|
|
252
|
+
});
|
|
253
|
+
ControlResumeEventSchema = BaseEventSchema.extend({
|
|
254
|
+
type: z3.literal("control.resume")
|
|
255
|
+
});
|
|
256
|
+
ControlStopEventSchema = BaseEventSchema.extend({
|
|
257
|
+
type: z3.literal("control.stop")
|
|
258
|
+
});
|
|
259
|
+
NodeInterruptEventSchema = BaseEventSchema.extend({
|
|
260
|
+
type: z3.literal("node.interrupt"),
|
|
261
|
+
node_id: z3.string(),
|
|
262
|
+
node_type: z3.string(),
|
|
263
|
+
query: z3.string()
|
|
264
|
+
});
|
|
265
|
+
WorkflowAskUserEventSchema = BaseEventSchema.extend({
|
|
266
|
+
type: z3.literal("workflow.ask-user"),
|
|
267
|
+
session_id: z3.string(),
|
|
268
|
+
node_id: z3.string(),
|
|
269
|
+
node_type: z3.string(),
|
|
270
|
+
query: z3.string()
|
|
271
|
+
});
|
|
272
|
+
WorkflowEventSchema = z3.union([
|
|
273
|
+
WorkflowStartedEventSchema,
|
|
274
|
+
WorkflowPausedEventSchema,
|
|
275
|
+
WorkflowResumedEventSchema,
|
|
276
|
+
WorkflowStoppedEventSchema,
|
|
277
|
+
WorkflowCompletedEventSchema,
|
|
278
|
+
WorkflowFailedEventSchema,
|
|
279
|
+
WorkflowOutputEventSchema,
|
|
280
|
+
NodeScheduledEventSchema,
|
|
281
|
+
NodeStartedEventSchema,
|
|
282
|
+
NodeProgressEventSchema,
|
|
283
|
+
NodeCompletedEventSchema,
|
|
284
|
+
NodeFailedEventSchema,
|
|
285
|
+
NodeSkippedEventSchema,
|
|
286
|
+
NodeDataEventSchema,
|
|
287
|
+
NodeAddedEventSchema,
|
|
288
|
+
NodeRemovedEventSchema,
|
|
289
|
+
ControlPauseEventSchema,
|
|
290
|
+
ControlResumeEventSchema,
|
|
291
|
+
ControlStopEventSchema,
|
|
292
|
+
NodeInterruptEventSchema,
|
|
293
|
+
WorkflowAskUserEventSchema
|
|
294
|
+
]);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// packages/core/src/env/workflow/types/run.ts
|
|
298
|
+
import { z as z4 } from "zod";
|
|
299
|
+
function createNodeExecutionContext(params) {
|
|
300
|
+
return {
|
|
301
|
+
...params,
|
|
302
|
+
askUser: (query) => {
|
|
303
|
+
throw new AskUserError(params.runId, params.sessionId, params.nodeId, "unknown", query);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
var RunStatusSchema, NodeStatusSchema;
|
|
308
|
+
var init_run = __esm(() => {
|
|
309
|
+
init_workflow_message();
|
|
310
|
+
RunStatusSchema = z4.enum([
|
|
311
|
+
"idle",
|
|
312
|
+
"running",
|
|
313
|
+
"paused",
|
|
314
|
+
"stopped",
|
|
315
|
+
"completed",
|
|
316
|
+
"failed"
|
|
317
|
+
]);
|
|
318
|
+
NodeStatusSchema = z4.enum([
|
|
319
|
+
"pending",
|
|
320
|
+
"scheduled",
|
|
321
|
+
"started",
|
|
322
|
+
"running",
|
|
323
|
+
"completed",
|
|
324
|
+
"failed",
|
|
325
|
+
"skipped"
|
|
326
|
+
]);
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
// packages/core/src/env/workflow/types/index.ts
|
|
330
|
+
var init_types = __esm(() => {
|
|
331
|
+
init_run();
|
|
332
|
+
init_workflow();
|
|
333
|
+
init_workflow_message();
|
|
334
|
+
init_workflow_session();
|
|
335
|
+
init_context();
|
|
336
|
+
init_workflow_hil();
|
|
337
|
+
init_event();
|
|
338
|
+
init_run();
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
export { BaseEventSchema, WorkflowStartedEventSchema, WorkflowPausedEventSchema, WorkflowResumedEventSchema, WorkflowStoppedEventSchema, WorkflowCompletedEventSchema, WorkflowFailedEventSchema, WorkflowOutputEventSchema, NodeScheduledEventSchema, NodeStartedEventSchema, NodeProgressEventSchema, NodeCompletedEventSchema, NodeFailedEventSchema, NodeSkippedEventSchema, NodeDataEventSchema, NodeAddedEventSchema, NodeRemovedEventSchema, ControlPauseEventSchema, ControlResumeEventSchema, ControlStopEventSchema, NodeInterruptEventSchema, WorkflowAskUserEventSchema, WorkflowEventSchema, createWorkflowEvent, init_event, DependsOnSchema, RetryConfigSchema, NodeDefinitionSchema, WorkflowConfigSchema, OutputDefinitionSchema, WorkflowMetadataSchema, WorkflowDefinitionSchema, parseWorkflowFile, parseWorkflowFileSync, WorkflowMessageRoleSchema, isWorkflowSessionMetadata, getWorkflowSessionStatus, RunStatusSchema, NodeStatusSchema, createNodeExecutionContext, init_types };
|