@ai-setting/roy-agent-core 1.5.55 → 1.5.57

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 (83) hide show
  1. package/dist/config/index.js +9 -9
  2. package/dist/env/agent/index.js +12 -12
  3. package/dist/env/commands/index.js +9 -9
  4. package/dist/env/context/index.js +5 -5
  5. package/dist/env/debug/index.js +9 -9
  6. package/dist/env/event-source/index.js +11 -11
  7. package/dist/env/hook/index.js +7 -7
  8. package/dist/env/index.js +30 -30
  9. package/dist/env/llm/index.js +10 -10
  10. package/dist/env/log-trace/index.js +9 -9
  11. package/dist/env/mcp/index.js +10 -10
  12. package/dist/env/mcp/tool/index.js +3 -3
  13. package/dist/env/memory/index.js +10 -10
  14. package/dist/env/memory/plugin/index.js +3 -3
  15. package/dist/env/plugin/index.js +9 -9
  16. package/dist/env/prompt/index.js +9 -9
  17. package/dist/env/session/index.js +10 -10
  18. package/dist/env/skill/index.js +9 -9
  19. package/dist/env/task/delegate/index.js +8 -8
  20. package/dist/env/task/index.js +13 -13
  21. package/dist/env/task/plugins/index.js +6 -6
  22. package/dist/env/task/storage/index.js +3 -3
  23. package/dist/env/task/tools/index.js +5 -5
  24. package/dist/env/tool/built-in/index.js +2 -2
  25. package/dist/env/tool/index.js +10 -10
  26. package/dist/env/workflow/engine/index.js +11 -11
  27. package/dist/env/workflow/index.js +15 -15
  28. package/dist/env/workflow/nodes/index.js +4 -4
  29. package/dist/env/workflow/storage/index.js +4 -4
  30. package/dist/env/workflow/tools/index.js +2 -2
  31. package/dist/env/workflow/utils/index.js +4 -4
  32. package/dist/index.js +42 -42
  33. package/dist/shared/@ai-setting/{roy-agent-core-5t6cryce.js → roy-agent-core-07290s9n.js} +2 -2
  34. package/dist/shared/@ai-setting/{roy-agent-core-9bmtxmp6.js → roy-agent-core-0jc06hhg.js} +2 -2
  35. package/dist/shared/@ai-setting/{roy-agent-core-mab4mzg3.js → roy-agent-core-2h38rvyj.js} +2 -2
  36. package/dist/shared/@ai-setting/{roy-agent-core-zmw5d68q.js → roy-agent-core-3czy06aq.js} +3 -3
  37. package/dist/shared/@ai-setting/{roy-agent-core-nfa6fc3a.js → roy-agent-core-48jprgqk.js} +72 -234
  38. package/dist/shared/@ai-setting/{roy-agent-core-8n4bz6y3.js → roy-agent-core-496zzm5a.js} +1 -1
  39. package/dist/shared/@ai-setting/{roy-agent-core-fwq0hs6e.js → roy-agent-core-58yjq16r.js} +7 -7
  40. package/dist/shared/@ai-setting/{roy-agent-core-5k8watmp.js → roy-agent-core-5c2mfq1q.js} +5 -5
  41. package/dist/shared/@ai-setting/{roy-agent-core-4ch3ghj6.js → roy-agent-core-65yjzwv5.js} +1 -1
  42. package/dist/shared/@ai-setting/{roy-agent-core-9ffsvvcf.js → roy-agent-core-6b57g1zk.js} +1 -1
  43. package/dist/shared/@ai-setting/{roy-agent-core-29867p67.js → roy-agent-core-6d5v531t.js} +3 -3
  44. package/dist/shared/@ai-setting/{roy-agent-core-egsx6js7.js → roy-agent-core-6ph5va4n.js} +9 -8
  45. package/dist/shared/@ai-setting/{roy-agent-core-f336bk4g.js → roy-agent-core-6s3vec2y.js} +6 -6
  46. package/dist/shared/@ai-setting/{roy-agent-core-zwp3jp02.js → roy-agent-core-74cp3zp1.js} +3 -3
  47. package/dist/shared/@ai-setting/{roy-agent-core-qmr365f5.js → roy-agent-core-7tp56w6n.js} +2 -2
  48. package/dist/shared/@ai-setting/{roy-agent-core-kjdpe2ey.js → roy-agent-core-7wdjpbcr.js} +2 -2
  49. package/dist/shared/@ai-setting/{roy-agent-core-58k274fg.js → roy-agent-core-7z9b1fm8.js} +1 -0
  50. package/dist/shared/@ai-setting/{roy-agent-core-bwrzwq5x.js → roy-agent-core-8pk6a00t.js} +1 -1
  51. package/dist/shared/@ai-setting/{roy-agent-core-3jk7ngmx.js → roy-agent-core-8vkr264k.js} +7 -7
  52. package/dist/shared/@ai-setting/{roy-agent-core-6vxg2gmr.js → roy-agent-core-9r8pew8y.js} +1 -1
  53. package/dist/shared/@ai-setting/{roy-agent-core-ty33mnr7.js → roy-agent-core-am646wfz.js} +4 -4
  54. package/dist/shared/@ai-setting/{roy-agent-core-rz57pqpa.js → roy-agent-core-ap59dpve.js} +5 -6
  55. package/dist/shared/@ai-setting/{roy-agent-core-t5kc8f7p.js → roy-agent-core-at22pe4k.js} +5 -5
  56. package/dist/shared/@ai-setting/{roy-agent-core-hd9p5490.js → roy-agent-core-b8r4tfqq.js} +1 -1
  57. package/dist/shared/@ai-setting/{roy-agent-core-z5sxe4p7.js → roy-agent-core-c6vet6xc.js} +4 -4
  58. package/dist/shared/@ai-setting/{roy-agent-core-1bfmxx89.js → roy-agent-core-djtkntar.js} +1 -1
  59. package/dist/shared/@ai-setting/{roy-agent-core-2xah3h0z.js → roy-agent-core-e1704378.js} +2 -2
  60. package/dist/shared/@ai-setting/roy-agent-core-ggvv4snf.js +20 -0
  61. package/dist/shared/@ai-setting/{roy-agent-core-9m9m6fe1.js → roy-agent-core-hkeegfq0.js} +4 -4
  62. package/dist/shared/@ai-setting/{roy-agent-core-v002ynpa.js → roy-agent-core-hkfkhaas.js} +1 -1
  63. package/dist/shared/@ai-setting/{roy-agent-core-q5qj0fes.js → roy-agent-core-k05v31rc.js} +6 -3
  64. package/dist/shared/@ai-setting/{roy-agent-core-2g5j2nw6.js → roy-agent-core-n19rm7tw.js} +4 -4
  65. package/dist/shared/@ai-setting/{roy-agent-core-emk3q2nt.js → roy-agent-core-nx3c3ce2.js} +17 -13
  66. package/dist/shared/@ai-setting/{roy-agent-core-e68xspar.js → roy-agent-core-prdngx28.js} +2 -2
  67. package/dist/shared/@ai-setting/{roy-agent-core-nt1q2g91.js → roy-agent-core-pwzkgtgr.js} +4 -4
  68. package/dist/shared/@ai-setting/{roy-agent-core-vbyct0e7.js → roy-agent-core-q16bh5e9.js} +13 -11
  69. package/dist/shared/@ai-setting/{roy-agent-core-13vzexp2.js → roy-agent-core-qg4rma4c.js} +1 -1
  70. package/dist/shared/@ai-setting/{roy-agent-core-cssnkkkg.js → roy-agent-core-rgckng3p.js} +2 -2
  71. package/dist/shared/@ai-setting/{roy-agent-core-dpc9tz73.js → roy-agent-core-rmd82vf7.js} +12 -12
  72. package/dist/shared/@ai-setting/{roy-agent-core-cpf38des.js → roy-agent-core-sfqx98j6.js} +5 -5
  73. package/dist/shared/@ai-setting/{roy-agent-core-10n2jh7p.js → roy-agent-core-shme7set.js} +1 -1
  74. package/dist/shared/@ai-setting/{roy-agent-core-88d3k0p0.js → roy-agent-core-v8xa6vs8.js} +4 -4
  75. package/dist/shared/@ai-setting/{roy-agent-core-e8eefm0k.js → roy-agent-core-w4f871e2.js} +1 -1
  76. package/dist/shared/@ai-setting/{roy-agent-core-qakqwbbh.js → roy-agent-core-w6wagmhw.js} +1 -1
  77. package/dist/shared/@ai-setting/{roy-agent-core-kwhv9dcd.js → roy-agent-core-x3gtyqax.js} +2 -2
  78. package/dist/shared/@ai-setting/{roy-agent-core-c3ct1346.js → roy-agent-core-xhcgg11h.js} +1 -1
  79. package/dist/shared/@ai-setting/{roy-agent-core-v7583cf9.js → roy-agent-core-y5d04fm3.js} +2 -2
  80. package/dist/shared/@ai-setting/{roy-agent-core-t6zhkk09.js → roy-agent-core-zgtmazxg.js} +2 -2
  81. package/dist/shared/@ai-setting/{roy-agent-core-0x3g6snw.js → roy-agent-core-zkwe508t.js} +7 -7
  82. package/package.json +1 -1
  83. package/dist/shared/@ai-setting/roy-agent-core-de0y1a5s.js +0 -20
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  withTimeout
3
- } from "./roy-agent-core-4ch3ghj6.js";
3
+ } from "./roy-agent-core-65yjzwv5.js";
4
4
  import {
5
5
  AskUserError,
6
6
  init_workflow_hil
7
7
  } from "./roy-agent-core-e25xkv53.js";
8
8
  import {
9
9
  AgentRegistry
10
- } from "./roy-agent-core-emk3q2nt.js";
10
+ } from "./roy-agent-core-nx3c3ce2.js";
11
11
  import {
12
12
  ContextError
13
13
  } from "./roy-agent-core-ctdhjv68.js";
@@ -19,27 +19,27 @@ import {
19
19
  } from "./roy-agent-core-qxhq8ven.js";
20
20
  import {
21
21
  BaseComponent
22
- } from "./roy-agent-core-cssnkkkg.js";
22
+ } from "./roy-agent-core-rgckng3p.js";
23
23
  import {
24
24
  globalHookManager,
25
25
  init_global_hook_manager
26
- } from "./roy-agent-core-qmr365f5.js";
26
+ } from "./roy-agent-core-7tp56w6n.js";
27
27
  import {
28
28
  init_context
29
- } from "./roy-agent-core-13vzexp2.js";
29
+ } from "./roy-agent-core-qg4rma4c.js";
30
30
  import {
31
31
  getCurrentTaskId,
32
32
  getEnvContext,
33
33
  runWithEnvContextAsync
34
- } from "./roy-agent-core-v7583cf9.js";
34
+ } from "./roy-agent-core-y5d04fm3.js";
35
35
  import {
36
36
  TracedAs,
37
37
  init_decorator
38
- } from "./roy-agent-core-q5qj0fes.js";
38
+ } from "./roy-agent-core-k05v31rc.js";
39
39
  import {
40
40
  createLogger,
41
41
  init_logger
42
- } from "./roy-agent-core-10n2jh7p.js";
42
+ } from "./roy-agent-core-shme7set.js";
43
43
  import {
44
44
  __legacyDecorateClassTS
45
45
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -572,6 +572,7 @@ class AgentComponent extends BaseComponent {
572
572
  const parentEnvContext = getEnvContext();
573
573
  const envContext = {
574
574
  ...parentEnvContext,
575
+ agentContext: parentEnvContext?.agentContext ?? {},
575
576
  traceId: effectiveContext.metadata?.traceId,
576
577
  sessionId: effectiveContext.sessionId,
577
578
  userId: effectiveContext.metadata?.userId ?? "",
@@ -6,18 +6,18 @@ import {
6
6
  } from "./roy-agent-core-92z6t4he.js";
7
7
  import {
8
8
  init_context
9
- } from "./roy-agent-core-13vzexp2.js";
9
+ } from "./roy-agent-core-qg4rma4c.js";
10
10
  import {
11
11
  getEnvContextOrEmpty
12
- } from "./roy-agent-core-v7583cf9.js";
12
+ } from "./roy-agent-core-y5d04fm3.js";
13
13
  import {
14
14
  TracedAs,
15
15
  init_decorator
16
- } from "./roy-agent-core-q5qj0fes.js";
16
+ } from "./roy-agent-core-k05v31rc.js";
17
17
  import {
18
18
  createLogger,
19
19
  init_logger
20
- } from "./roy-agent-core-10n2jh7p.js";
20
+ } from "./roy-agent-core-shme7set.js";
21
21
  import {
22
22
  __legacyDecorateClassTS,
23
23
  __require
@@ -368,11 +368,11 @@ ${prompt}`;
368
368
  }
369
369
  if (!this._workflowRepo) {
370
370
  try {
371
- const sqlite = await import("./roy-agent-core-zwp3jp02.js");
371
+ const sqlite = await import("./roy-agent-core-74cp3zp1.js");
372
372
  this.ensureDataDir();
373
373
  const db = sqlite.getDatabase();
374
374
  sqlite.initializeTables();
375
- const { WorkflowRepository } = await import("./roy-agent-core-ty33mnr7.js");
375
+ const { WorkflowRepository } = await import("./roy-agent-core-am646wfz.js");
376
376
  this._workflowRepo = new WorkflowRepository(db);
377
377
  return this._workflowRepo;
378
378
  } catch {
@@ -5,9 +5,9 @@ import {
5
5
  initDatabase,
6
6
  initializeTables,
7
7
  resetDatabase
8
- } from "./roy-agent-core-9ffsvvcf.js";
9
- import"./roy-agent-core-10n2jh7p.js";
10
- import"./roy-agent-core-58k274fg.js";
8
+ } from "./roy-agent-core-6b57g1zk.js";
9
+ import"./roy-agent-core-shme7set.js";
10
+ import"./roy-agent-core-7z9b1fm8.js";
11
11
  import"./roy-agent-core-c6592r3c.js";
12
12
  import"./roy-agent-core-fs0mn2jk.js";
13
13
  export {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  init_context
3
- } from "./roy-agent-core-13vzexp2.js";
3
+ } from "./roy-agent-core-qg4rma4c.js";
4
4
  import {
5
5
  getEnvContext
6
- } from "./roy-agent-core-v7583cf9.js";
6
+ } from "./roy-agent-core-y5d04fm3.js";
7
7
  import {
8
8
  __esm
9
9
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -4,11 +4,11 @@ import {
4
4
  } from "./roy-agent-core-qxhq8ven.js";
5
5
  import {
6
6
  BaseComponent
7
- } from "./roy-agent-core-cssnkkkg.js";
7
+ } from "./roy-agent-core-rgckng3p.js";
8
8
  import {
9
9
  createLogger,
10
10
  init_logger
11
- } from "./roy-agent-core-10n2jh7p.js";
11
+ } from "./roy-agent-core-shme7set.js";
12
12
 
13
13
  // src/env/commands/commands-component.ts
14
14
  import path2 from "path";
@@ -330,6 +330,7 @@ class OTelTracerImpl {
330
330
  return Math.floor(Math.random() * 18446744073709552000).toString(16).padStart(16, "0");
331
331
  }
332
332
  handleSpanEnd(spanId, parentSpanId) {
333
+ this.activeSpans.delete(spanId);
333
334
  if (parentSpanId) {
334
335
  const parentSpan = this.activeSpans.get(parentSpanId);
335
336
  if (parentSpan) {
@@ -3,7 +3,7 @@ import {
3
3
  init_propagation,
4
4
  init_tracer_provider,
5
5
  propagation
6
- } from "./roy-agent-core-58k274fg.js";
6
+ } from "./roy-agent-core-7z9b1fm8.js";
7
7
  import {
8
8
  __toCommonJS
9
9
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -10,15 +10,15 @@ import {
10
10
  tracedExtractStructuredJsonViaLlm,
11
11
  tracedRunWorkflowJsonOutputExtraction,
12
12
  unregisterWorkflowJsonOutputPlugin
13
- } from "./roy-agent-core-29867p67.js";
13
+ } from "./roy-agent-core-6d5v531t.js";
14
14
  import"./roy-agent-core-nhfy3p8q.js";
15
15
  import"./roy-agent-core-e25xkv53.js";
16
- import"./roy-agent-core-qmr365f5.js";
17
- import"./roy-agent-core-13vzexp2.js";
18
- import"./roy-agent-core-v7583cf9.js";
19
- import"./roy-agent-core-q5qj0fes.js";
20
- import"./roy-agent-core-10n2jh7p.js";
21
- import"./roy-agent-core-58k274fg.js";
16
+ import"./roy-agent-core-7tp56w6n.js";
17
+ import"./roy-agent-core-qg4rma4c.js";
18
+ import"./roy-agent-core-y5d04fm3.js";
19
+ import"./roy-agent-core-k05v31rc.js";
20
+ import"./roy-agent-core-shme7set.js";
21
+ import"./roy-agent-core-7z9b1fm8.js";
22
22
  import"./roy-agent-core-c6592r3c.js";
23
23
  import"./roy-agent-core-fs0mn2jk.js";
24
24
  init_workflow_json_output_plugin();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TracedAs,
3
3
  init_decorator
4
- } from "./roy-agent-core-q5qj0fes.js";
4
+ } from "./roy-agent-core-k05v31rc.js";
5
5
  import {
6
6
  __esm,
7
7
  __legacyDecorateClassTS
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  WorkflowRepository,
3
3
  rowToWorkflow
4
- } from "./roy-agent-core-8n4bz6y3.js";
5
- import"./roy-agent-core-9ffsvvcf.js";
4
+ } from "./roy-agent-core-496zzm5a.js";
5
+ import"./roy-agent-core-6b57g1zk.js";
6
6
  import"./roy-agent-core-rvxg1wps.js";
7
- import"./roy-agent-core-10n2jh7p.js";
8
- import"./roy-agent-core-58k274fg.js";
7
+ import"./roy-agent-core-shme7set.js";
8
+ import"./roy-agent-core-7z9b1fm8.js";
9
9
  import"./roy-agent-core-c6592r3c.js";
10
10
  import"./roy-agent-core-fs0mn2jk.js";
11
11
  export {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  BaseComponent
3
- } from "./roy-agent-core-cssnkkkg.js";
3
+ } from "./roy-agent-core-rgckng3p.js";
4
4
  import {
5
5
  globalHookManager,
6
6
  init_global_hook_manager
7
- } from "./roy-agent-core-qmr365f5.js";
7
+ } from "./roy-agent-core-7tp56w6n.js";
8
8
  import {
9
9
  createLogger,
10
10
  init_logger
11
- } from "./roy-agent-core-10n2jh7p.js";
11
+ } from "./roy-agent-core-shme7set.js";
12
12
 
13
13
  // src/env/plugin/plugin-component.ts
14
14
  init_global_hook_manager();
@@ -63,15 +63,14 @@ class PluginComponent extends BaseComponent {
63
63
  if (!plugin) {
64
64
  return false;
65
65
  }
66
+ this.registry.delete(name);
66
67
  try {
67
68
  plugin.dispose();
68
- this.registry.delete(name);
69
69
  this.logger.info(`Unregistered plugin: ${name}`);
70
- return true;
71
70
  } catch (err) {
72
71
  this.logger.error(`Failed to dispose plugin ${name}: ${err}`);
73
- return false;
74
72
  }
73
+ return true;
75
74
  }
76
75
  get(name) {
77
76
  return this.registry.get(name);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AgentComponentAdapter,
3
3
  init_agent_component_adapter
4
- } from "./roy-agent-core-t6zhkk09.js";
4
+ } from "./roy-agent-core-zgtmazxg.js";
5
5
  import {
6
6
  buildWorkflowNodeMetadata,
7
7
  getWorkflowNodeIdFromMetadata,
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  TemplateResolver,
13
13
  init_template_resolver
14
- } from "./roy-agent-core-v002ynpa.js";
14
+ } from "./roy-agent-core-hkfkhaas.js";
15
15
  import {
16
16
  SkillNode,
17
17
  ToolNode,
@@ -19,7 +19,7 @@ import {
19
19
  init_skill_node,
20
20
  init_tool_node,
21
21
  init_workflow_node
22
- } from "./roy-agent-core-6vxg2gmr.js";
22
+ } from "./roy-agent-core-9r8pew8y.js";
23
23
  import {
24
24
  WorkflowError,
25
25
  createWorkflowEvent,
@@ -43,11 +43,11 @@ import {
43
43
  import {
44
44
  TracedAs,
45
45
  init_decorator
46
- } from "./roy-agent-core-q5qj0fes.js";
46
+ } from "./roy-agent-core-k05v31rc.js";
47
47
  import {
48
48
  createLogger,
49
49
  init_logger
50
- } from "./roy-agent-core-10n2jh7p.js";
50
+ } from "./roy-agent-core-shme7set.js";
51
51
  import {
52
52
  __esm,
53
53
  __export,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_global_hook_manager,
3
3
  init_hook_manager
4
- } from "./roy-agent-core-qmr365f5.js";
4
+ } from "./roy-agent-core-7tp56w6n.js";
5
5
 
6
6
  // src/env/hook/types.ts
7
7
  function createHook(meta, fn) {
@@ -3,11 +3,11 @@ import {
3
3
  hasDecoratorNodes,
4
4
  init_node_registry_helper,
5
5
  registerDecoratorNodeType
6
- } from "./roy-agent-core-9bmtxmp6.js";
6
+ } from "./roy-agent-core-0jc06hhg.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";
8
+ import"./roy-agent-core-k05v31rc.js";
9
+ import"./roy-agent-core-shme7set.js";
10
+ import"./roy-agent-core-7z9b1fm8.js";
11
11
  import"./roy-agent-core-c6592r3c.js";
12
12
  import"./roy-agent-core-fs0mn2jk.js";
13
13
  init_node_registry_helper();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createLogger,
3
3
  init_logger
4
- } from "./roy-agent-core-10n2jh7p.js";
4
+ } from "./roy-agent-core-shme7set.js";
5
5
 
6
6
  // src/env/mcp/tool/adapter.ts
7
7
  init_logger();
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  init_env_context,
3
3
  setCurrentTaskId
4
- } from "./roy-agent-core-v7583cf9.js";
4
+ } from "./roy-agent-core-y5d04fm3.js";
5
5
  import {
6
6
  createLogger,
7
7
  init_logger
8
- } from "./roy-agent-core-10n2jh7p.js";
8
+ } from "./roy-agent-core-shme7set.js";
9
9
 
10
10
  // src/env/task/tools/task-types.ts
11
11
  import { z } from "zod";
@@ -0,0 +1,20 @@
1
+ import {
2
+ AgentComponentAdapter,
3
+ init_agent_component_adapter
4
+ } from "./roy-agent-core-zgtmazxg.js";
5
+ import"./roy-agent-core-6d5v531t.js";
6
+ import"./roy-agent-core-nhfy3p8q.js";
7
+ import"./roy-agent-core-e25xkv53.js";
8
+ import"./roy-agent-core-7tp56w6n.js";
9
+ import"./roy-agent-core-qg4rma4c.js";
10
+ import"./roy-agent-core-y5d04fm3.js";
11
+ import"./roy-agent-core-k05v31rc.js";
12
+ import"./roy-agent-core-shme7set.js";
13
+ import"./roy-agent-core-7z9b1fm8.js";
14
+ import"./roy-agent-core-c6592r3c.js";
15
+ import"./roy-agent-core-fs0mn2jk.js";
16
+ init_agent_component_adapter();
17
+
18
+ export {
19
+ AgentComponentAdapter
20
+ };
@@ -9,21 +9,21 @@ import {
9
9
  } from "./roy-agent-core-pcjenbaf.js";
10
10
  import {
11
11
  SummaryAgent
12
- } from "./roy-agent-core-kwhv9dcd.js";
12
+ } from "./roy-agent-core-x3gtyqax.js";
13
13
  import {
14
14
  envKeyToConfigKey
15
15
  } from "./roy-agent-core-qxhq8ven.js";
16
16
  import {
17
17
  BaseComponent
18
- } from "./roy-agent-core-cssnkkkg.js";
18
+ } from "./roy-agent-core-rgckng3p.js";
19
19
  import {
20
20
  TracedAs,
21
21
  init_decorator
22
- } from "./roy-agent-core-q5qj0fes.js";
22
+ } from "./roy-agent-core-k05v31rc.js";
23
23
  import {
24
24
  createLogger,
25
25
  init_logger
26
- } from "./roy-agent-core-10n2jh7p.js";
26
+ } from "./roy-agent-core-shme7set.js";
27
27
  import {
28
28
  __legacyDecorateClassTS
29
29
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  TracedAs,
9
9
  init_decorator
10
- } from "./roy-agent-core-q5qj0fes.js";
10
+ } from "./roy-agent-core-k05v31rc.js";
11
11
  import {
12
12
  __esm,
13
13
  __legacyDecorateClassTS
@@ -3,11 +3,11 @@ import {
3
3
  getMaxOutput,
4
4
  init_logger,
5
5
  simplifyFilePath
6
- } from "./roy-agent-core-10n2jh7p.js";
6
+ } from "./roy-agent-core-shme7set.js";
7
7
  import {
8
8
  getTracerProvider,
9
9
  init_tracer_provider
10
- } from "./roy-agent-core-58k274fg.js";
10
+ } from "./roy-agent-core-7z9b1fm8.js";
11
11
  import {
12
12
  __esm
13
13
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -135,7 +135,10 @@ function wrapFunction(fn, name, options) {
135
135
  }
136
136
  }
137
137
  const callerLocation = getCallerLocation();
138
- const span = tracer.startSpan(name, { attributes });
138
+ let span;
139
+ try {
140
+ span = tracer.startSpan(name, { attributes });
141
+ } catch {}
139
142
  logFn("enter", args, callerLocation);
140
143
  try {
141
144
  const result = fn.call(this, ...args);
@@ -4,7 +4,7 @@ import {
4
4
  } from "./roy-agent-core-rvv6ydff.js";
5
5
  import {
6
6
  BaseComponent
7
- } from "./roy-agent-core-cssnkkkg.js";
7
+ } from "./roy-agent-core-rgckng3p.js";
8
8
  import {
9
9
  __require
10
10
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -590,7 +590,7 @@ class DebugComponent extends BaseComponent {
590
590
  }
591
591
  async getLiveTrace(traceId) {
592
592
  try {
593
- const { getTracerProvider } = await import("./roy-agent-core-qakqwbbh.js");
593
+ const { getTracerProvider } = await import("./roy-agent-core-w6wagmhw.js");
594
594
  const provider = getTracerProvider();
595
595
  if (!provider.isInitialized()) {
596
596
  await provider.initialize();
@@ -635,7 +635,7 @@ class DebugComponent extends BaseComponent {
635
635
  }
636
636
  async listLiveTraces(limit = 20) {
637
637
  try {
638
- const { getTracerProvider } = await import("./roy-agent-core-qakqwbbh.js");
638
+ const { getTracerProvider } = await import("./roy-agent-core-w6wagmhw.js");
639
639
  const provider = getTracerProvider();
640
640
  if (!provider.isInitialized()) {
641
641
  await provider.initialize();
@@ -653,7 +653,7 @@ class DebugComponent extends BaseComponent {
653
653
  }
654
654
  async formatLiveTrace(traceId) {
655
655
  try {
656
- const { getTracerProvider } = await import("./roy-agent-core-qakqwbbh.js");
656
+ const { getTracerProvider } = await import("./roy-agent-core-w6wagmhw.js");
657
657
  const provider = getTracerProvider();
658
658
  if (!provider.isInitialized()) {
659
659
  await provider.initialize();
@@ -4,18 +4,18 @@ import {
4
4
  import {
5
5
  TracedAs,
6
6
  init_decorator
7
- } from "./roy-agent-core-q5qj0fes.js";
7
+ } from "./roy-agent-core-k05v31rc.js";
8
8
  import {
9
9
  createLogger,
10
10
  init_logger
11
- } from "./roy-agent-core-10n2jh7p.js";
11
+ } from "./roy-agent-core-shme7set.js";
12
12
  import {
13
13
  __legacyDecorateClassTS
14
14
  } from "./roy-agent-core-fs0mn2jk.js";
15
15
 
16
16
  // src/env/agent/agent-registry.ts
17
- import { readdir, readFile, writeFile, mkdir, unlink } from "fs/promises";
18
- import { existsSync } from "fs";
17
+ import * as realFsPromises from "fs/promises";
18
+ import * as realFs from "fs";
19
19
  import { join } from "path";
20
20
  import { z } from "zod";
21
21
  import yaml from "yaml";
@@ -46,10 +46,14 @@ class AgentRegistry {
46
46
  configComponent;
47
47
  promptComponent;
48
48
  resolvePromptComponent;
49
+ fs;
50
+ fsPromises;
49
51
  constructor(options) {
50
52
  this.configComponent = options.configComponent;
51
53
  this.promptComponent = options.promptComponent ?? null;
52
54
  this.resolvePromptComponent = options.resolvePromptComponent;
55
+ this.fs = options.fs || realFs;
56
+ this.fsPromises = options.fsPromises || realFsPromises;
53
57
  const customDir = this.configComponent?.get?.("agent.configDir");
54
58
  if (customDir && typeof customDir === "string" && customDir.length > 0) {
55
59
  this.configDir = customDir;
@@ -156,11 +160,11 @@ class AgentRegistry {
156
160
  async loadFromDirectory(directory) {
157
161
  let loaded = 0;
158
162
  try {
159
- if (!existsSync(directory)) {
163
+ if (!this.fs.existsSync(directory)) {
160
164
  logger.debug(`[AgentRegistry] Config directory does not exist: ${directory}`);
161
165
  return 0;
162
166
  }
163
- const files = await readdir(directory, { withFileTypes: true });
167
+ const files = await this.fsPromises.readdir(directory, { withFileTypes: true });
164
168
  for (const file of files) {
165
169
  const fullPath = join(directory, file.name);
166
170
  if (file.isDirectory()) {
@@ -170,7 +174,7 @@ class AgentRegistry {
170
174
  continue;
171
175
  }
172
176
  try {
173
- const content = await readFile(fullPath, "utf-8");
177
+ const content = await this.fsPromises.readFile(fullPath, "utf-8");
174
178
  const agent = this.parseAgentConfig(content, fullPath);
175
179
  if (agent) {
176
180
  this.agents.set(agent.name, agent);
@@ -213,7 +217,7 @@ class AgentRegistry {
213
217
  await this.ensureConfigDir();
214
218
  const yamlContent = this.agentToYaml(agent);
215
219
  const filePath = join(this.configDir, `${agent.name}.yaml`);
216
- await writeFile(filePath, yamlContent, "utf-8");
220
+ await this.fsPromises.writeFile(filePath, yamlContent, "utf-8");
217
221
  this.agents.set(agent.name, agent);
218
222
  logger.info(`[AgentRegistry] Saved agent: ${agent.name} to ${filePath}`);
219
223
  return true;
@@ -223,8 +227,8 @@ class AgentRegistry {
223
227
  }
224
228
  }
225
229
  async ensureConfigDir() {
226
- if (!existsSync(this.configDir)) {
227
- await mkdir(this.configDir, { recursive: true });
230
+ if (!this.fs.existsSync(this.configDir)) {
231
+ await this.fsPromises.mkdir(this.configDir, { recursive: true });
228
232
  logger.debug(`[AgentRegistry] Created config directory: ${this.configDir}`);
229
233
  }
230
234
  }
@@ -257,8 +261,8 @@ class AgentRegistry {
257
261
  }
258
262
  try {
259
263
  const filePath = join(this.configDir, `${name}.yaml`);
260
- if (existsSync(filePath)) {
261
- await unlink(filePath);
264
+ if (this.fs.existsSync(filePath)) {
265
+ await this.fsPromises.unlink(filePath);
262
266
  logger.info(`[AgentRegistry] Deleted agent file: ${filePath}`);
263
267
  }
264
268
  this.agents.delete(name);
@@ -282,7 +286,7 @@ class AgentRegistry {
282
286
  return this.agents.size;
283
287
  }
284
288
  configDirExists() {
285
- return existsSync(this.configDir);
289
+ return this.fs.existsSync(this.configDir);
286
290
  }
287
291
  getAgentFilePath(name) {
288
292
  return join(this.configDir, `${name}.yaml`);
@@ -7,7 +7,7 @@ import {
7
7
  } from "./roy-agent-core-qxhq8ven.js";
8
8
  import {
9
9
  BaseComponent
10
- } from "./roy-agent-core-cssnkkkg.js";
10
+ } from "./roy-agent-core-rgckng3p.js";
11
11
  import {
12
12
  __require
13
13
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -339,7 +339,7 @@ class FileSource {
339
339
  }
340
340
  try {
341
341
  this.watcherHandle = fsSync.watch(this.filePath, async (eventType) => {
342
- if (eventType === "change") {
342
+ if (eventType === "change" || eventType === "rename") {
343
343
  await new Promise((r) => setTimeout(r, 50));
344
344
  await this.reloadFromFile();
345
345
  }
@@ -8,20 +8,20 @@ import {
8
8
  } from "./roy-agent-core-qxhq8ven.js";
9
9
  import {
10
10
  BaseComponent
11
- } from "./roy-agent-core-cssnkkkg.js";
11
+ } from "./roy-agent-core-rgckng3p.js";
12
12
  import {
13
13
  ToolHookPoints,
14
14
  globalHookManager,
15
15
  init_global_hook_manager
16
- } from "./roy-agent-core-qmr365f5.js";
16
+ } from "./roy-agent-core-7tp56w6n.js";
17
17
  import {
18
18
  getCurrentTaskId,
19
19
  init_env_context
20
- } from "./roy-agent-core-v7583cf9.js";
20
+ } from "./roy-agent-core-y5d04fm3.js";
21
21
  import {
22
22
  createLogger,
23
23
  init_logger
24
- } from "./roy-agent-core-10n2jh7p.js";
24
+ } from "./roy-agent-core-shme7set.js";
25
25
  import {
26
26
  __require
27
27
  } from "./roy-agent-core-fs0mn2jk.js";