@ai-setting/roy-agent-core 1.5.43 → 1.5.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/config/index.js +5 -5
  2. package/dist/env/agent/index.js +5 -5
  3. package/dist/env/commands/index.js +5 -5
  4. package/dist/env/context/index.js +4 -1
  5. package/dist/env/debug/index.js +5 -5
  6. package/dist/env/event-source/index.js +7 -7
  7. package/dist/env/hook/index.js +3 -3
  8. package/dist/env/index.js +24 -20
  9. package/dist/env/llm/index.js +5 -5
  10. package/dist/env/log-trace/index.js +5 -5
  11. package/dist/env/mcp/index.js +20 -6
  12. package/dist/env/memory/index.js +5 -5
  13. package/dist/env/plugin/index.js +5 -5
  14. package/dist/env/prompt/index.js +5 -5
  15. package/dist/env/session/index.js +6 -6
  16. package/dist/env/session/storage/index.js +1 -1
  17. package/dist/env/skill/index.js +5 -5
  18. package/dist/env/task/delegate/index.js +3 -3
  19. package/dist/env/task/index.js +6 -6
  20. package/dist/env/task/plugins/index.js +2 -2
  21. package/dist/env/tool/built-in/index.js +1 -1
  22. package/dist/env/tool/index.js +6 -6
  23. package/dist/env/workflow/decorators/index.js +1 -1
  24. package/dist/env/workflow/engine/index.js +10 -4
  25. package/dist/env/workflow/index.js +42 -24
  26. package/dist/env/workflow/nodes/index.js +5 -1
  27. package/dist/env/workflow/tools/index.js +14 -0
  28. package/dist/env/workflow/types/index.js +16 -2
  29. package/dist/env/workflow/utils/index.js +15 -196
  30. package/dist/index.js +35 -31
  31. package/dist/shared/@ai-setting/{roy-agent-core-kajktp3d.js → roy-agent-core-20fm423j.js} +47 -26
  32. package/dist/shared/@ai-setting/{roy-agent-core-ffb9fq4v.js → roy-agent-core-2vhsccvz.js} +54 -12
  33. package/dist/shared/@ai-setting/{roy-agent-core-69jskqjg.js → roy-agent-core-44g4dhzg.js} +75 -7
  34. package/dist/shared/@ai-setting/{roy-agent-core-e9fdm13a.js → roy-agent-core-4gmxjdhn.js} +4 -2
  35. package/dist/shared/@ai-setting/{roy-agent-core-b4wd9tn6.js → roy-agent-core-4k9a823d.js} +1 -1
  36. package/dist/shared/@ai-setting/roy-agent-core-68qy97r3.js +31 -0
  37. package/dist/shared/@ai-setting/roy-agent-core-6atd905e.js +42 -0
  38. package/dist/shared/@ai-setting/{roy-agent-core-4jqq077c.js → roy-agent-core-6e3wz81d.js} +2 -2
  39. package/dist/shared/@ai-setting/{roy-agent-core-pwkk12p4.js → roy-agent-core-6mcb7nqa.js} +60 -0
  40. package/dist/shared/@ai-setting/roy-agent-core-6vxg2gmr.js +321 -0
  41. package/dist/shared/@ai-setting/{roy-agent-core-9p43ap7h.js → roy-agent-core-8y804aat.js} +4 -2
  42. package/dist/shared/@ai-setting/{roy-agent-core-0rtxwr28.js → roy-agent-core-9bmtxmp6.js} +77 -120
  43. package/dist/shared/@ai-setting/{roy-agent-core-r6rwsr54.js → roy-agent-core-9p604xjf.js} +29 -9
  44. package/dist/shared/@ai-setting/{roy-agent-core-z1xf2fdk.js → roy-agent-core-a67e90d1.js} +6 -4
  45. package/dist/shared/@ai-setting/{roy-agent-core-xkb264a8.js → roy-agent-core-bp3xggmb.js} +192 -26
  46. package/dist/shared/@ai-setting/{roy-agent-core-zrja5v78.js → roy-agent-core-ce9w0j8n.js} +10 -2
  47. package/dist/shared/@ai-setting/{roy-agent-core-bmr6bdfb.js → roy-agent-core-cr8xer31.js} +15 -8
  48. package/dist/shared/@ai-setting/roy-agent-core-dbxm76wf.js +190 -0
  49. package/dist/shared/@ai-setting/{roy-agent-core-nj8yerg9.js → roy-agent-core-eftqdsy5.js} +1 -1
  50. package/dist/shared/@ai-setting/{roy-agent-core-7fgf85wc.js → roy-agent-core-h0x19xgn.js} +6 -7
  51. package/dist/shared/@ai-setting/{roy-agent-core-psvwzdhj.js → roy-agent-core-hdszq729.js} +9 -5
  52. package/dist/shared/@ai-setting/{roy-agent-core-dxbsc1zy.js → roy-agent-core-ja9qhg6d.js} +1 -1
  53. package/dist/shared/@ai-setting/{roy-agent-core-cevpwnq7.js → roy-agent-core-mjbfgqen.js} +5 -3
  54. package/dist/shared/@ai-setting/roy-agent-core-nhfy3p8q.js +132 -0
  55. package/dist/shared/@ai-setting/{roy-agent-core-2jnzv9at.js → roy-agent-core-nn9dmffw.js} +629 -288
  56. package/dist/shared/@ai-setting/roy-agent-core-qnrf2aw6.js +441 -0
  57. package/dist/shared/@ai-setting/{roy-agent-core-ee6nnnqw.js → roy-agent-core-r9hq4cjx.js} +8 -1
  58. package/dist/shared/@ai-setting/{roy-agent-core-jqy2mdyq.js → roy-agent-core-rgj6hq15.js} +52 -41
  59. package/dist/shared/@ai-setting/{roy-agent-core-z33en0cz.js → roy-agent-core-rm3hay00.js} +15 -2
  60. package/dist/shared/@ai-setting/{roy-agent-core-e130w7mv.js → roy-agent-core-rx74rye7.js} +5 -3
  61. package/dist/shared/@ai-setting/{roy-agent-core-pxcrzyv9.js → roy-agent-core-sk535ft2.js} +1 -1
  62. package/dist/shared/@ai-setting/roy-agent-core-v002ynpa.js +435 -0
  63. package/dist/shared/@ai-setting/{roy-agent-core-2dhd60aw.js → roy-agent-core-vdwvamre.js} +10 -0
  64. package/dist/shared/@ai-setting/{roy-agent-core-1zq3p19q.js → roy-agent-core-w64zachx.js} +8 -4
  65. package/dist/shared/@ai-setting/roy-agent-core-ye0z728h.js +18 -0
  66. package/dist/shared/@ai-setting/{roy-agent-core-rsybkb38.js → roy-agent-core-ysvh8er9.js} +36 -39
  67. package/dist/shared/@ai-setting/{roy-agent-core-9yxb3ty9.js → roy-agent-core-z5sxe4p7.js} +5 -1
  68. package/dist/shared/@ai-setting/{roy-agent-core-eg6nv09z.js → roy-agent-core-ztx5eh72.js} +1 -1
  69. package/dist/shared/@ai-setting/{roy-agent-core-nqgrjja0.js → roy-agent-core-zwq6vhpj.js} +1 -1
  70. package/package.json +1 -1
  71. package/dist/shared/@ai-setting/roy-agent-core-5x94xmt6.js +0 -350
  72. package/dist/shared/@ai-setting/roy-agent-core-dh9d7a3m.js +0 -11
  73. package/dist/shared/@ai-setting/roy-agent-core-jvatggbb.js +0 -603
@@ -0,0 +1,435 @@
1
+ import {
2
+ init_types,
3
+ nodeNotFound,
4
+ pathNotFound,
5
+ unresolvedVariable
6
+ } from "./roy-agent-core-qnrf2aw6.js";
7
+ import {
8
+ TracedAs,
9
+ init_decorator
10
+ } from "./roy-agent-core-q5qj0fes.js";
11
+ import {
12
+ __esm,
13
+ __legacyDecorateClassTS
14
+ } from "./roy-agent-core-fs0mn2jk.js";
15
+
16
+ // src/env/workflow/utils/template-resolver.ts
17
+ function resolveTemplates(input, context) {
18
+ const resolver = TemplateResolver.fromContext(context);
19
+ return resolver.resolveValue(input);
20
+ }
21
+ function resolveTemplateString(template, context) {
22
+ const resolver = TemplateResolver.fromContext(context);
23
+ return resolver.resolveString(template);
24
+ }
25
+ var TemplateResolver;
26
+ var init_template_resolver = __esm(() => {
27
+ init_decorator();
28
+ init_types();
29
+ TemplateResolver = class TemplateResolver {
30
+ input;
31
+ previousOutputs;
32
+ constructor(options = {}) {
33
+ this.input = options.input ?? {};
34
+ this.previousOutputs = options.previousOutputs ?? new Map;
35
+ }
36
+ static fromContext(context) {
37
+ return new TemplateResolver({
38
+ input: context.workflowInput ?? context.input,
39
+ previousOutputs: context.previousOutputs
40
+ });
41
+ }
42
+ resolveValue(input) {
43
+ if (input === null || input === undefined) {
44
+ return input;
45
+ }
46
+ if (typeof input === "string") {
47
+ const pureTemplate = this.extractPureTemplate(input);
48
+ if (pureTemplate) {
49
+ return this.resolvePureTemplate(pureTemplate);
50
+ }
51
+ return this.resolveString(input);
52
+ }
53
+ if (Array.isArray(input)) {
54
+ return input.map((item) => this.resolveValue(item));
55
+ }
56
+ if (typeof input === "object") {
57
+ const resolved = {};
58
+ for (const [key, value] of Object.entries(input)) {
59
+ resolved[key] = this.resolveValue(value);
60
+ }
61
+ return resolved;
62
+ }
63
+ return input;
64
+ }
65
+ extractPureTemplate(str) {
66
+ const trimmed = str.trim();
67
+ if (trimmed.startsWith("{{") && trimmed.endsWith("}}") && trimmed.length > 4) {
68
+ const content = trimmed.slice(2, -2).trim();
69
+ if (!content.includes("{{") && !content.includes("}}")) {
70
+ return content;
71
+ }
72
+ }
73
+ return null;
74
+ }
75
+ resolvePureTemplate(templateContent) {
76
+ const value = this.resolveTemplateContent(templateContent);
77
+ return value;
78
+ }
79
+ resolveTemplateContent(templateContent) {
80
+ const trimmed = templateContent.trim();
81
+ if (trimmed.startsWith("input.")) {
82
+ return this.getNestedValue(this.input, trimmed.slice(6));
83
+ }
84
+ if (trimmed.startsWith("inputs.")) {
85
+ return this.getNestedValue(this.input, trimmed.slice(7));
86
+ }
87
+ if (trimmed.startsWith("nodes.")) {
88
+ return this.resolveNodePath(trimmed.slice(6));
89
+ }
90
+ if (trimmed !== "input" && trimmed !== "inputs" && trimmed !== "nodes") {
91
+ const segments = trimmed.split(".");
92
+ const nodeId = segments[0];
93
+ const restPath = segments.slice(1).join(".") || undefined;
94
+ return this.resolveNodePath(`${nodeId}${restPath ? "." + restPath : ""}`);
95
+ }
96
+ return;
97
+ }
98
+ resolveString(template) {
99
+ if (!template || typeof template !== "string") {
100
+ return template;
101
+ }
102
+ let resolved = template;
103
+ resolved = resolved.replace(/\{\{inputs\./g, "{{input.");
104
+ resolved = resolved.replace(/\{\{input\.([^}]+)\}\}/g, (match, path) => {
105
+ const value = this.getNestedValue(this.input, path);
106
+ return this.stringify(value, match);
107
+ });
108
+ resolved = resolved.replace(/\{\{nodes\.([^}]+)\}\}/g, (match, path) => {
109
+ const value = this.resolveNodePath(path);
110
+ return this.stringify(value, match);
111
+ });
112
+ resolved = resolved.replace(/\{\{([a-zA-Z_][a-zA-Z0-9_-]*)(?:\.([^}]+))?\}\}/g, (match, nodeId, path) => {
113
+ if (nodeId === "input") {
114
+ return match;
115
+ }
116
+ if (nodeId === "nodes") {
117
+ return match;
118
+ }
119
+ const value = this.resolveNodePath(`${nodeId}${path ? "." + path : ""}`);
120
+ return this.stringify(value, match);
121
+ });
122
+ return resolved;
123
+ }
124
+ resolveNodePath(path) {
125
+ const segments = path.split(".");
126
+ const nodeId = segments[0];
127
+ if (!nodeId) {
128
+ return;
129
+ }
130
+ let value = this.previousOutputs.get(nodeId);
131
+ if (value === undefined) {
132
+ const normalizedUnderscore = nodeId.replace(/-/g, "_");
133
+ const normalizedHyphen = nodeId.replace(/_/g, "-");
134
+ if (normalizedUnderscore !== nodeId) {
135
+ value = this.previousOutputs.get(normalizedUnderscore);
136
+ }
137
+ if (value === undefined && normalizedHyphen !== nodeId) {
138
+ value = this.previousOutputs.get(normalizedHyphen);
139
+ }
140
+ }
141
+ if (value === undefined) {
142
+ return;
143
+ }
144
+ if (segments.length === 1) {
145
+ if (value && typeof value === "object" && "result" in value && !("nodes" in value)) {
146
+ value = value.result;
147
+ }
148
+ return value;
149
+ }
150
+ const secondSegment = segments[1];
151
+ if (secondSegment === "result" || secondSegment === "output") {
152
+ if (value && typeof value === "object" && "result" in value) {
153
+ value = value.result;
154
+ if (segments.length === 2) {
155
+ return value;
156
+ }
157
+ for (let i = 2;i < segments.length; i++) {
158
+ if (value === null || value === undefined) {
159
+ return;
160
+ }
161
+ value = value[segments[i]];
162
+ }
163
+ return value;
164
+ }
165
+ }
166
+ for (let i = 1;i < segments.length; i++) {
167
+ if (value === null || value === undefined) {
168
+ return;
169
+ }
170
+ value = value[segments[i]];
171
+ }
172
+ return value;
173
+ }
174
+ getNestedValue(obj, path) {
175
+ if (!obj || !path) {
176
+ return;
177
+ }
178
+ const segments = path.split(".");
179
+ let current = obj;
180
+ for (const segment of segments) {
181
+ if (current === null || current === undefined) {
182
+ return;
183
+ }
184
+ if (typeof current !== "object") {
185
+ return;
186
+ }
187
+ current = current[segment];
188
+ }
189
+ return current;
190
+ }
191
+ stringify(value, originalTemplate) {
192
+ if (value === undefined) {
193
+ return originalTemplate;
194
+ }
195
+ if (typeof value === "string") {
196
+ return value;
197
+ }
198
+ if (value === null) {
199
+ return "null";
200
+ }
201
+ return JSON.stringify(value);
202
+ }
203
+ containsTemplates(str) {
204
+ if (typeof str !== "string") {
205
+ return false;
206
+ }
207
+ return /\{\{[^}]+\}\}/.test(str);
208
+ }
209
+ extractTemplates(str) {
210
+ if (typeof str !== "string") {
211
+ return [];
212
+ }
213
+ const matches = str.match(/\{\{[^}]+\}\}/g);
214
+ return matches ?? [];
215
+ }
216
+ resolveAndValidate(input) {
217
+ const unresolved = [];
218
+ const resolved = this.resolveValueWithTracking(input, unresolved);
219
+ return { resolved, unresolved };
220
+ }
221
+ resolveValueWithTracking(input, unresolved) {
222
+ if (input === null || input === undefined) {
223
+ return input;
224
+ }
225
+ if (typeof input === "string") {
226
+ const pureTemplate = this.extractPureTemplate(input);
227
+ if (pureTemplate) {
228
+ const value = this.resolvePureTemplate(pureTemplate);
229
+ if (value === undefined) {
230
+ unresolved.push(input);
231
+ return input;
232
+ }
233
+ return value;
234
+ }
235
+ return this.resolveStringWithTracking(input, unresolved);
236
+ }
237
+ if (Array.isArray(input)) {
238
+ return input.map((item) => this.resolveValueWithTracking(item, unresolved));
239
+ }
240
+ if (typeof input === "object") {
241
+ const result = {};
242
+ for (const [key, value] of Object.entries(input)) {
243
+ result[key] = this.resolveValueWithTracking(value, unresolved);
244
+ }
245
+ return result;
246
+ }
247
+ return input;
248
+ }
249
+ resolveStringWithTracking(str, unresolved) {
250
+ const templates = this.extractTemplates(str);
251
+ let resolved = str;
252
+ for (const template of templates) {
253
+ const pureContent = template.slice(2, -2).trim();
254
+ const value = this.resolveTemplateContent(pureContent);
255
+ if (value === undefined) {
256
+ unresolved.push(template);
257
+ } else {
258
+ const resolvedValue = this.stringify(value, template);
259
+ resolved = resolved.replace(template, resolvedValue);
260
+ }
261
+ }
262
+ return resolved;
263
+ }
264
+ resolveStrict(input, nodeId) {
265
+ const result = this.resolveAndValidate(input);
266
+ if (result.unresolved.length > 0) {
267
+ for (const template of result.unresolved) {
268
+ const path = template.replace(/^\{\{|\}\}$/g, "");
269
+ if (path.startsWith("input.")) {
270
+ const inputKey = path.slice(6);
271
+ const value = this.getNestedValue(this.input, inputKey);
272
+ if (value === undefined) {
273
+ throw unresolvedVariable(template, inputKey);
274
+ }
275
+ continue;
276
+ }
277
+ if (path.startsWith("inputs.")) {
278
+ const inputKey = path.slice(7);
279
+ const value = this.getNestedValue(this.input, inputKey);
280
+ if (value === undefined) {
281
+ throw unresolvedVariable(template, inputKey);
282
+ }
283
+ continue;
284
+ }
285
+ if (path.startsWith("nodes.")) {
286
+ const afterPrefix = path.slice(6);
287
+ const nodeParts = afterPrefix.split(".");
288
+ const refNodeId = nodeParts[0];
289
+ if (!this.previousOutputs.has(refNodeId)) {
290
+ throw nodeNotFound(refNodeId, [template]);
291
+ }
292
+ if (nodeParts.length > 1) {
293
+ const refPath = nodeParts.slice(1).join(".");
294
+ const nodeValue = this.previousOutputs.get(refNodeId);
295
+ const nestedValue = this.getNestedValue(nodeValue, refPath);
296
+ if (nestedValue === undefined) {
297
+ throw pathNotFound(refNodeId, refPath, template);
298
+ }
299
+ }
300
+ continue;
301
+ }
302
+ if (path.includes(".")) {
303
+ const [refNodeId, ...pathParts] = path.split(".");
304
+ if (this.previousOutputs.has(refNodeId)) {
305
+ const refPath = pathParts.join(".");
306
+ const nodeValue = this.previousOutputs.get(refNodeId);
307
+ const nestedValue = this.getNestedValue(nodeValue, refPath);
308
+ if (nestedValue === undefined) {
309
+ throw pathNotFound(refNodeId, refPath, template);
310
+ }
311
+ } else {
312
+ throw nodeNotFound(refNodeId, [template]);
313
+ }
314
+ } else {
315
+ if (!this.previousOutputs.has(path)) {
316
+ throw nodeNotFound(path, [template]);
317
+ }
318
+ }
319
+ }
320
+ throw unresolvedVariable(result.unresolved[0], result.unresolved.join(", "));
321
+ }
322
+ return result.resolved;
323
+ }
324
+ evaluateCondition(condition) {
325
+ const resolved = this.resolveString(condition);
326
+ return this.parseCondition(resolved);
327
+ }
328
+ parseCondition(condition) {
329
+ const expr = condition.trim();
330
+ if (expr === "true")
331
+ return true;
332
+ if (expr === "false")
333
+ return false;
334
+ if (expr.startsWith("!")) {
335
+ return !this.parseCondition(expr.slice(1).trim());
336
+ }
337
+ const orParts = this.splitByOperator(expr, "||");
338
+ if (orParts.length > 1) {
339
+ return orParts.some((p) => this.parseCondition(p.trim()));
340
+ }
341
+ const andParts = this.splitByOperator(expr, "&&");
342
+ if (andParts.length > 1) {
343
+ return andParts.every((p) => this.parseCondition(p.trim()));
344
+ }
345
+ const comparisonPatterns = [
346
+ { pattern: /^(.+)\s*===\s*(.+)$/, op: "===" },
347
+ { pattern: /^(.+)\s*!==\s*(.+)$/, op: "!==" },
348
+ { pattern: /^(.+)\s*==\s*(.+)$/, op: "==" },
349
+ { pattern: /^(.+)\s*!=\s*(.+)$/, op: "!=" },
350
+ { pattern: /^(.+)\s*>=\s*(.+)$/, op: ">=" },
351
+ { pattern: /^(.+)\s*<=\s*(.+)$/, op: "<=" },
352
+ { pattern: /^(.+)\s*>\s*(.+)$/, op: ">" },
353
+ { pattern: /^(.+)\s*<\s*(.+)$/, op: "<" }
354
+ ];
355
+ for (const { pattern, op } of comparisonPatterns) {
356
+ const match = expr.match(pattern);
357
+ if (match) {
358
+ const left = this.evaluateValue(match[1].trim());
359
+ const right = this.evaluateValue(match[2].trim());
360
+ return this.compare(left, right, op);
361
+ }
362
+ }
363
+ return Boolean(this.evaluateValue(expr));
364
+ }
365
+ splitByOperator(expr, op) {
366
+ const parts = [];
367
+ let current = "";
368
+ let inQuotes = null;
369
+ for (let i = 0;i < expr.length; i++) {
370
+ const char = expr[i];
371
+ if (char === '"' || char === "'") {
372
+ if (inQuotes === char) {
373
+ inQuotes = null;
374
+ } else if (inQuotes === null) {
375
+ inQuotes = char;
376
+ }
377
+ current += char;
378
+ } else if (inQuotes) {
379
+ current += char;
380
+ } else if (expr.slice(i, i + op.length) === op) {
381
+ parts.push(current);
382
+ current = "";
383
+ i += op.length - 1;
384
+ } else {
385
+ current += char;
386
+ }
387
+ }
388
+ if (current) {
389
+ parts.push(current);
390
+ }
391
+ return parts;
392
+ }
393
+ evaluateValue(value) {
394
+ const v = value.trim();
395
+ if (v === "true")
396
+ return true;
397
+ if (v === "false")
398
+ return false;
399
+ if (!isNaN(Number(v)))
400
+ return Number(v);
401
+ if (v.startsWith('"') && v.endsWith('"') || v.startsWith("'") && v.endsWith("'")) {
402
+ return v.slice(1, -1);
403
+ }
404
+ return v;
405
+ }
406
+ compare(left, right, op) {
407
+ switch (op) {
408
+ case "===":
409
+ case "==":
410
+ return left === right;
411
+ case "!==":
412
+ case "!=":
413
+ return left !== right;
414
+ case ">":
415
+ return Number(left) > Number(right);
416
+ case "<":
417
+ return Number(left) < Number(right);
418
+ case ">=":
419
+ return Number(left) >= Number(right);
420
+ case "<=":
421
+ return Number(left) <= Number(right);
422
+ default:
423
+ return false;
424
+ }
425
+ }
426
+ };
427
+ __legacyDecorateClassTS([
428
+ TracedAs("workflow.template.resolveAndValidate", { log: true })
429
+ ], TemplateResolver.prototype, "resolveAndValidate", null);
430
+ __legacyDecorateClassTS([
431
+ TracedAs("workflow.template.resolveStrict", { log: true })
432
+ ], TemplateResolver.prototype, "resolveStrict", null);
433
+ });
434
+
435
+ export { TemplateResolver, resolveTemplates, resolveTemplateString, init_template_resolver };
@@ -1,3 +1,8 @@
1
+ import {
2
+ init_global_hook_manager,
3
+ init_hook_manager
4
+ } from "./roy-agent-core-rgj6hq15.js";
5
+
1
6
  // src/env/hook/types.ts
2
7
  function createHook(meta, fn) {
3
8
  return {
@@ -8,4 +13,9 @@ function createHook(meta, fn) {
8
13
  function createPriorityHook(name, fn, priority) {
9
14
  return createHook({ name, priority }, fn);
10
15
  }
16
+
17
+ // src/env/hook/index.ts
18
+ init_hook_manager();
19
+ init_global_hook_manager();
20
+
11
21
  export { createHook, createPriorityHook };
@@ -2,7 +2,7 @@ import {
2
2
  BackgroundTaskManager,
3
3
  createDelegateTool,
4
4
  createStopTool
5
- } from "./roy-agent-core-9p43ap7h.js";
5
+ } from "./roy-agent-core-8y804aat.js";
6
6
  import {
7
7
  SQLiteTaskStore,
8
8
  getDefaultTaskDbPath
@@ -37,10 +37,11 @@ import {
37
37
  } from "./roy-agent-core-qxhq8ven.js";
38
38
  import {
39
39
  BaseComponent
40
- } from "./roy-agent-core-4jqq077c.js";
40
+ } from "./roy-agent-core-6e3wz81d.js";
41
41
  import {
42
- globalHookManager
43
- } from "./roy-agent-core-jqy2mdyq.js";
42
+ globalHookManager,
43
+ init_global_hook_manager
44
+ } from "./roy-agent-core-rgj6hq15.js";
44
45
  import {
45
46
  createLogger,
46
47
  init_logger
@@ -68,6 +69,9 @@ var TASK_CONFIG_REGISTRATION = {
68
69
  ]
69
70
  };
70
71
 
72
+ // src/env/task/task-component.ts
73
+ init_global_hook_manager();
74
+
71
75
  // src/env/task/tag-service.ts
72
76
  init_logger();
73
77
  var logger = createLogger("task:tag");
@@ -0,0 +1,18 @@
1
+ import {
2
+ AgentComponentAdapter,
3
+ init_agent_component_adapter
4
+ } from "./roy-agent-core-44g4dhzg.js";
5
+ import"./roy-agent-core-dbxm76wf.js";
6
+ import"./roy-agent-core-nhfy3p8q.js";
7
+ import"./roy-agent-core-e25xkv53.js";
8
+ import"./roy-agent-core-rgj6hq15.js";
9
+ import"./roy-agent-core-rm3hay00.js";
10
+ import"./roy-agent-core-10n2jh7p.js";
11
+ import"./roy-agent-core-58k274fg.js";
12
+ import"./roy-agent-core-c6592r3c.js";
13
+ import"./roy-agent-core-fs0mn2jk.js";
14
+ init_agent_component_adapter();
15
+
16
+ export {
17
+ AgentComponentAdapter
18
+ };
@@ -287,16 +287,13 @@ var bashTool = {
287
287
  };
288
288
 
289
289
  // src/env/tool/built-in/echo.ts
290
+ import { z as z2 } from "zod";
290
291
  var echoTool = {
291
292
  name: "echo",
292
293
  description: "Echo a message to the console. Useful for logging in workflows.",
293
- parameters: {
294
- name: "message",
295
- schema: {
296
- type: "string",
297
- description: "The message to echo"
298
- }
299
- },
294
+ parameters: z2.object({
295
+ message: z2.string().optional().describe("The message to echo")
296
+ }),
300
297
  execute: async (args, _ctx) => {
301
298
  const message = args?.message || "(no message)";
302
299
  return {
@@ -310,18 +307,18 @@ var echoTool = {
310
307
  };
311
308
 
312
309
  // src/env/tool/built-in/glob.ts
313
- import { z as z2 } from "zod";
310
+ import { z as z3 } from "zod";
314
311
  import { glob as globAsync } from "glob";
315
312
  import { stat } from "fs/promises";
316
313
  import path from "path";
317
314
  var globTool = {
318
315
  name: "glob",
319
316
  description: "Search for files matching a glob pattern. Use this to find files by name patterns like **/*.ts or **/*.md.",
320
- parameters: z2.object({
321
- pattern: z2.string().min(1).describe("Glob pattern to match (e.g., **/*.ts, **/*.md)"),
322
- cwd: z2.string().optional().describe("Working directory to search in"),
323
- maxResults: z2.number().int().positive().default(100).optional().describe("Maximum number of results to return"),
324
- ignore: z2.array(z2.string()).optional().describe("Patterns to ignore")
317
+ parameters: z3.object({
318
+ pattern: z3.string().min(1).describe("Glob pattern to match (e.g., **/*.ts, **/*.md)"),
319
+ cwd: z3.string().optional().describe("Working directory to search in"),
320
+ maxResults: z3.number().int().positive().default(100).optional().describe("Maximum number of results to return"),
321
+ ignore: z3.array(z3.string()).optional().describe("Patterns to ignore")
325
322
  }),
326
323
  sandbox: {
327
324
  enabled: true
@@ -415,17 +412,17 @@ var globTool = {
415
412
  };
416
413
 
417
414
  // src/env/tool/built-in/read-file.ts
418
- import { z as z3 } from "zod";
415
+ import { z as z4 } from "zod";
419
416
  import { readFile, stat as stat2 } from "fs/promises";
420
417
  import path2 from "path";
421
418
  var readFileTool = {
422
419
  name: "read_file",
423
420
  description: "Read the contents of a file. Use this to read source code, configuration files, or any text files.",
424
- parameters: z3.object({
425
- path: z3.string().describe("The file path to read"),
426
- offset: z3.number().int().nonnegative().optional().describe("Line offset to start reading from"),
427
- limit: z3.number().int().positive().optional().describe("Number of lines to read"),
428
- encoding: z3.enum(["utf-8", "base64"]).default("utf-8").optional().describe("File encoding")
421
+ parameters: z4.object({
422
+ path: z4.string().describe("The file path to read"),
423
+ offset: z4.number().int().nonnegative().optional().describe("Line offset to start reading from"),
424
+ limit: z4.number().int().positive().optional().describe("Number of lines to read"),
425
+ encoding: z4.enum(["utf-8", "base64"]).default("utf-8").optional().describe("File encoding")
429
426
  }),
430
427
  sandbox: {
431
428
  enabled: true,
@@ -530,17 +527,17 @@ var readFileTool = {
530
527
  };
531
528
 
532
529
  // src/env/tool/built-in/write-file.ts
533
- import { z as z4 } from "zod";
530
+ import { z as z5 } from "zod";
534
531
  import { writeFile, mkdir, stat as stat3 } from "fs/promises";
535
532
  import path3 from "path";
536
533
  var writeFileTool = {
537
534
  name: "write_file",
538
535
  description: "Write content to a file. Use this to create new files or overwrite existing ones.",
539
- parameters: z4.object({
540
- path: z4.string().describe("The file path to write to"),
541
- content: z4.string().describe("The content to write"),
542
- createDirs: z4.boolean().default(false).optional().describe("Create parent directories if they don't exist"),
543
- append: z4.boolean().default(false).optional().describe("Append to file instead of overwrite")
536
+ parameters: z5.object({
537
+ path: z5.string().describe("The file path to write to"),
538
+ content: z5.string().describe("The content to write"),
539
+ createDirs: z5.boolean().default(false).optional().describe("Create parent directories if they don't exist"),
540
+ append: z5.boolean().default(false).optional().describe("Append to file instead of overwrite")
544
541
  }),
545
542
  sandbox: {
546
543
  enabled: true,
@@ -620,18 +617,18 @@ var writeFileTool = {
620
617
  };
621
618
 
622
619
  // src/env/tool/built-in/edit-file.ts
623
- import { z as z5 } from "zod";
620
+ import { z as z6 } from "zod";
624
621
  import { readFile as readFile2, writeFile as writeFile2, stat as stat4, unlink } from "fs/promises";
625
622
  import path4 from "path";
626
623
  import { randomUUID } from "crypto";
627
624
  var editFileTool = {
628
625
  name: "edit_file",
629
626
  description: "Edit a file by replacing specific text. Use this to make targeted changes to files by specifying what to find and what to replace.",
630
- parameters: z5.object({
631
- path: z5.string().describe("The file path to edit"),
632
- oldString: z5.string().describe("The text to find and replace"),
633
- newString: z5.string().describe("The replacement text"),
634
- replaceAll: z5.boolean().default(false).optional().describe("Replace all occurrences instead of just the first")
627
+ parameters: z6.object({
628
+ path: z6.string().describe("The file path to edit"),
629
+ oldString: z6.string().describe("The text to find and replace"),
630
+ newString: z6.string().describe("The replacement text"),
631
+ replaceAll: z6.boolean().default(false).optional().describe("Replace all occurrences instead of just the first")
635
632
  }),
636
633
  sandbox: {
637
634
  enabled: true,
@@ -736,7 +733,7 @@ function escapeRegExp(string) {
736
733
  }
737
734
 
738
735
  // src/env/tool/built-in/grep.ts
739
- import { z as z6 } from "zod";
736
+ import { z as z7 } from "zod";
740
737
  import { readFile as readFile3, stat as stat5 } from "fs/promises";
741
738
  import { glob as globAsync2 } from "glob";
742
739
  import path5 from "path";
@@ -751,13 +748,13 @@ function isBinaryContent(content) {
751
748
  var grepTool = {
752
749
  name: "grep",
753
750
  description: "Search for text patterns in files. Use this to find specific strings, code patterns, or content across multiple files.",
754
- parameters: z6.object({
755
- pattern: z6.string().min(1).describe("The pattern to search for"),
756
- path: z6.string().optional().describe("File or directory path to search in"),
757
- include: z6.string().optional().describe("Glob pattern for files to include (e.g., *.ts, *.js)"),
758
- caseSensitive: z6.boolean().default(true).optional().describe("Whether the search should be case sensitive"),
759
- maxResults: z6.number().int().positive().default(50).optional().describe("Maximum number of results"),
760
- showLineNumbers: z6.boolean().default(true).optional().describe("Show line numbers in results")
751
+ parameters: z7.object({
752
+ pattern: z7.string().min(1).describe("The pattern to search for"),
753
+ path: z7.string().optional().describe("File or directory path to search in"),
754
+ include: z7.string().optional().describe("Glob pattern for files to include (e.g., *.ts, *.js)"),
755
+ caseSensitive: z7.boolean().default(true).optional().describe("Whether the search should be case sensitive"),
756
+ maxResults: z7.number().int().positive().default(50).optional().describe("Maximum number of results"),
757
+ showLineNumbers: z7.boolean().default(true).optional().describe("Show line numbers in results")
761
758
  }),
762
759
  sandbox: {
763
760
  enabled: true
@@ -3,8 +3,12 @@ import {
3
3
  hasDecoratorNodes,
4
4
  init_node_registry_helper,
5
5
  registerDecoratorNodeType
6
- } from "./roy-agent-core-0rtxwr28.js";
6
+ } from "./roy-agent-core-9bmtxmp6.js";
7
7
  import"./roy-agent-core-1ce3fqrk.js";
8
+ import"./roy-agent-core-q5qj0fes.js";
9
+ import"./roy-agent-core-10n2jh7p.js";
10
+ import"./roy-agent-core-58k274fg.js";
11
+ import"./roy-agent-core-c6592r3c.js";
8
12
  import"./roy-agent-core-fs0mn2jk.js";
9
13
  init_node_registry_helper();
10
14
 
@@ -6,7 +6,7 @@ import {
6
6
  } from "./roy-agent-core-qxhq8ven.js";
7
7
  import {
8
8
  BaseComponent
9
- } from "./roy-agent-core-4jqq077c.js";
9
+ } from "./roy-agent-core-6e3wz81d.js";
10
10
  import {
11
11
  createLogger,
12
12
  init_logger
@@ -4,7 +4,7 @@ import {
4
4
  } from "./roy-agent-core-rvv6ydff.js";
5
5
  import {
6
6
  BaseComponent
7
- } from "./roy-agent-core-4jqq077c.js";
7
+ } from "./roy-agent-core-6e3wz81d.js";
8
8
  import {
9
9
  __require
10
10
  } from "./roy-agent-core-fs0mn2jk.js";