@ai-setting/roy-agent-core 1.7.37 → 1.7.39

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 (82) hide show
  1. package/dist/config/index.js +7 -7
  2. package/dist/env/agent/index.js +10 -10
  3. package/dist/env/commands/index.js +7 -7
  4. package/dist/env/context/index.js +7 -3
  5. package/dist/env/debug/index.js +7 -7
  6. package/dist/env/event-source/index.js +24 -14
  7. package/dist/env/hook/index.js +5 -5
  8. package/dist/env/index.js +33 -32
  9. package/dist/env/llm/index.js +7 -7
  10. package/dist/env/log-trace/index.js +7 -7
  11. package/dist/env/mcp/index.js +7 -7
  12. package/dist/env/memory/index.js +7 -7
  13. package/dist/env/plugin/index.js +7 -7
  14. package/dist/env/prompt/index.js +7 -7
  15. package/dist/env/session/index.js +7 -7
  16. package/dist/env/skill/index.js +7 -7
  17. package/dist/env/task/delegate/index.js +7 -6
  18. package/dist/env/task/index.js +12 -11
  19. package/dist/env/task/plugins/index.js +7 -7
  20. package/dist/env/task/storage/index.js +2 -2
  21. package/dist/env/task/tools/index.js +3 -3
  22. package/dist/env/tool/built-in/index.js +2 -2
  23. package/dist/env/tool/index.js +8 -8
  24. package/dist/env/workflow/engine/index.js +9 -9
  25. package/dist/env/workflow/index.js +17 -17
  26. package/dist/env/workflow/nodes/index.js +2 -2
  27. package/dist/env/workflow/service/index.js +2 -2
  28. package/dist/env/workflow/storage/index.js +3 -3
  29. package/dist/env/workflow/tools/index.js +11 -11
  30. package/dist/env/workflow/utils/index.js +4 -4
  31. package/dist/index.js +53 -43
  32. package/dist/shared/@ai-setting/{roy-agent-core-yf0ex8y1.js → roy-agent-core-333apxaa.js} +1 -1
  33. package/dist/shared/@ai-setting/{roy-agent-core-pxyyrxnn.js → roy-agent-core-34je386q.js} +4 -4
  34. package/dist/shared/@ai-setting/{roy-agent-core-q8vew3zh.js → roy-agent-core-3h7ajma5.js} +2 -2
  35. package/dist/shared/@ai-setting/{roy-agent-core-e4v61k3j.js → roy-agent-core-47wrv4ex.js} +94 -32
  36. package/dist/shared/@ai-setting/{roy-agent-core-9drbkjfr.js → roy-agent-core-4cj6hram.js} +1 -1
  37. package/dist/shared/@ai-setting/{roy-agent-core-fytqnxrd.js → roy-agent-core-4cqcdk7k.js} +3 -3
  38. package/dist/shared/@ai-setting/{roy-agent-core-zda3rfr3.js → roy-agent-core-4kbvfnn1.js} +54 -5
  39. package/dist/shared/@ai-setting/{roy-agent-core-bb57xjfh.js → roy-agent-core-5exnp10h.js} +11 -8
  40. package/dist/shared/@ai-setting/{roy-agent-core-jq7g5nxz.js → roy-agent-core-5j4awbgc.js} +3 -3
  41. package/dist/shared/@ai-setting/{roy-agent-core-1vj7dd14.js → roy-agent-core-6mnwqcqf.js} +1 -1
  42. package/dist/shared/@ai-setting/{roy-agent-core-wgttzq8e.js → roy-agent-core-6vbgswjw.js} +1 -1
  43. package/dist/shared/@ai-setting/{roy-agent-core-1q6gjxba.js → roy-agent-core-6vwf03cz.js} +10 -7
  44. package/dist/shared/@ai-setting/{roy-agent-core-a8zf7ts4.js → roy-agent-core-754b0078.js} +5 -5
  45. package/dist/shared/@ai-setting/{roy-agent-core-j9ejsmsj.js → roy-agent-core-8nv07zgr.js} +1 -1
  46. package/dist/shared/@ai-setting/{roy-agent-core-yw07bvqz.js → roy-agent-core-9cqpdrnk.js} +3 -3
  47. package/dist/shared/@ai-setting/{roy-agent-core-q3zvkbj6.js → roy-agent-core-9qn92jhf.js} +2 -2
  48. package/dist/shared/@ai-setting/{roy-agent-core-m7dppx2p.js → roy-agent-core-9t675te0.js} +2 -2
  49. package/dist/shared/@ai-setting/{roy-agent-core-fym6zz5a.js → roy-agent-core-a236mps6.js} +2 -2
  50. package/dist/shared/@ai-setting/{roy-agent-core-qhjm0bxm.js → roy-agent-core-a9pbda78.js} +23 -13
  51. package/dist/shared/@ai-setting/{roy-agent-core-s53yya0w.js → roy-agent-core-asxe1nt4.js} +5 -5
  52. package/dist/shared/@ai-setting/{roy-agent-core-em8618g6.js → roy-agent-core-cazvr63z.js} +237 -14
  53. package/dist/shared/@ai-setting/{roy-agent-core-ds5f75pg.js → roy-agent-core-ck60j1q9.js} +19 -1
  54. package/dist/shared/@ai-setting/{roy-agent-core-w457586k.js → roy-agent-core-cw89yj9d.js} +1 -1
  55. package/dist/shared/@ai-setting/{roy-agent-core-462v5d24.js → roy-agent-core-cysnmvcy.js} +1 -1
  56. package/dist/shared/@ai-setting/{roy-agent-core-88tfzaxg.js → roy-agent-core-f18jk3cw.js} +1 -1
  57. package/dist/shared/@ai-setting/{roy-agent-core-qz9jb9sp.js → roy-agent-core-hkj5v9xq.js} +1 -1
  58. package/dist/shared/@ai-setting/{roy-agent-core-dzfyjzgw.js → roy-agent-core-jadrj0bz.js} +27 -2
  59. package/dist/shared/@ai-setting/{roy-agent-core-dfay0w56.js → roy-agent-core-jawzpf5k.js} +2 -2
  60. package/dist/shared/@ai-setting/{roy-agent-core-zekkw27m.js → roy-agent-core-jg8cv1f7.js} +128 -29
  61. package/dist/shared/@ai-setting/{roy-agent-core-mwaesrpc.js → roy-agent-core-jjw7xcxv.js} +4 -4
  62. package/dist/shared/@ai-setting/{roy-agent-core-2qke91fm.js → roy-agent-core-krppch0s.js} +3 -3
  63. package/dist/shared/@ai-setting/{roy-agent-core-mxwaq8ey.js → roy-agent-core-m3ffkexb.js} +13 -13
  64. package/dist/shared/@ai-setting/{roy-agent-core-2wbdfrtg.js → roy-agent-core-n1ceexfz.js} +1 -1
  65. package/dist/shared/@ai-setting/{roy-agent-core-1btakphh.js → roy-agent-core-pc8x07p0.js} +1 -1
  66. package/dist/shared/@ai-setting/{roy-agent-core-d5gwqrr5.js → roy-agent-core-pd0exvnq.js} +1 -1
  67. package/dist/shared/@ai-setting/{roy-agent-core-1nvqn17p.js → roy-agent-core-qfktfbrr.js} +4 -4
  68. package/dist/shared/@ai-setting/{roy-agent-core-x4wev4rn.js → roy-agent-core-rczz7e81.js} +5 -5
  69. package/dist/shared/@ai-setting/{roy-agent-core-e3qjt852.js → roy-agent-core-rgpkygbc.js} +1 -1
  70. package/dist/shared/@ai-setting/{roy-agent-core-rx8whb18.js → roy-agent-core-s44egzrh.js} +35 -4
  71. package/dist/shared/@ai-setting/{roy-agent-core-k5csz66y.js → roy-agent-core-tm57tmds.js} +1 -1
  72. package/dist/shared/@ai-setting/{roy-agent-core-qhtejtpc.js → roy-agent-core-vsrfzaze.js} +1 -1
  73. package/dist/shared/@ai-setting/{roy-agent-core-whta3f53.js → roy-agent-core-wn59p0zw.js} +1 -1
  74. package/dist/shared/@ai-setting/{roy-agent-core-mdaew65f.js → roy-agent-core-wybj8emq.js} +1 -1
  75. package/dist/shared/@ai-setting/{roy-agent-core-ddq5hcp5.js → roy-agent-core-x6c45yqd.js} +3 -1
  76. package/dist/shared/@ai-setting/roy-agent-core-xyys5m1a.js +159 -0
  77. package/dist/shared/@ai-setting/{roy-agent-core-wphva2vs.js → roy-agent-core-y1n63tse.js} +2 -2
  78. package/dist/shared/@ai-setting/{roy-agent-core-jcdsghyr.js → roy-agent-core-yjjqm4ww.js} +1 -1
  79. package/dist/shared/@ai-setting/{roy-agent-core-n3pwkwjh.js → roy-agent-core-za09t5g3.js} +1 -1
  80. package/dist/shared/@ai-setting/{roy-agent-core-n82acszf.js → roy-agent-core-zbb3sk72.js} +17 -3
  81. package/package.json +1 -1
  82. /package/dist/shared/@ai-setting/{roy-agent-core-k5hxvaf0.js → roy-agent-core-3ztzc83c.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TagRepository
3
- } from "./roy-agent-core-d5gwqrr5.js";
3
+ } from "./roy-agent-core-pd0exvnq.js";
4
4
  import {
5
5
  exports_search_query_parser,
6
6
  init_search_query_parser
@@ -129,9 +129,58 @@ function initDatabase(path) {
129
129
  return db;
130
130
  }
131
131
 
132
+ // src/env/workflow/storage/safe-json.ts
133
+ function parseJsonOrThrow(raw, fieldName, rowCtx = {}) {
134
+ if (raw === null || raw === undefined || raw === "") {
135
+ throw new Error(`[workflow-repo] Required field "${fieldName}" is empty for row id=${rowCtx.id ?? "?"} name=${rowCtx.name ?? "?"}`);
136
+ }
137
+ const str = typeof raw === "string" ? raw : String(raw);
138
+ try {
139
+ return JSON.parse(str);
140
+ } catch (err) {
141
+ const snippet = str.length > 80 ? str.slice(0, 80) + "..." : str;
142
+ const detail = err instanceof Error ? err.message : String(err);
143
+ throw new Error(`[workflow-repo] Corrupt JSON in required field "${fieldName}" for row id=${rowCtx.id ?? "?"} name=${rowCtx.name ?? "?"}: ${detail}. Raw: ${snippet}`);
144
+ }
145
+ }
146
+ function parseJsonObjectOrEmpty(raw, fieldName) {
147
+ if (raw === null || raw === undefined || raw === "") {
148
+ return {};
149
+ }
150
+ const str = typeof raw === "string" ? raw : String(raw);
151
+ try {
152
+ const parsed = JSON.parse(str);
153
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
154
+ return parsed;
155
+ }
156
+ return {};
157
+ } catch {
158
+ return {};
159
+ }
160
+ }
161
+ function parseTagsSafely(raw) {
162
+ if (raw === null || raw === undefined || raw === "") {
163
+ return [];
164
+ }
165
+ const str = typeof raw === "string" ? raw : String(raw);
166
+ try {
167
+ const parsed = JSON.parse(str);
168
+ if (Array.isArray(parsed)) {
169
+ return parsed;
170
+ }
171
+ if (typeof parsed === "string") {
172
+ return [parsed];
173
+ }
174
+ return [];
175
+ } catch {
176
+ return [str];
177
+ }
178
+ }
179
+
132
180
  // src/env/workflow/storage/workflow-repo.ts
133
181
  function rowToWorkflow(row) {
134
- const metadata = JSON.parse(row.metadata);
182
+ const rowCtx = { id: row.id, name: row.name };
183
+ const metadata = parseJsonOrThrow(row.metadata, "metadata", rowCtx);
135
184
  if (row.task_id !== null) {
136
185
  metadata.taskId = row.task_id;
137
186
  }
@@ -140,10 +189,10 @@ function rowToWorkflow(row) {
140
189
  name: row.name,
141
190
  version: row.version,
142
191
  description: row.description || undefined,
143
- definition: JSON.parse(row.definition),
144
- config: JSON.parse(row.config),
192
+ definition: parseJsonOrThrow(row.definition, "definition", rowCtx),
193
+ config: parseJsonObjectOrEmpty(row.config, "config"),
145
194
  metadata,
146
- tags: JSON.parse(row.tags),
195
+ tags: parseTagsSafely(row.tags),
147
196
  createdAt: new Date(row.created_at),
148
197
  updatedAt: new Date(row.updated_at)
149
198
  };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  truncateOutputInline
3
- } from "./roy-agent-core-mwaesrpc.js";
3
+ } from "./roy-agent-core-jjw7xcxv.js";
4
4
  import {
5
5
  AgentRegistry
6
- } from "./roy-agent-core-n3pwkwjh.js";
6
+ } from "./roy-agent-core-za09t5g3.js";
7
7
  import {
8
8
  enqueueToAddFakeUserMessage
9
- } from "./roy-agent-core-9drbkjfr.js";
9
+ } from "./roy-agent-core-4cj6hram.js";
10
10
  import {
11
11
  SessionMessageConverter
12
12
  } from "./roy-agent-core-djdwq743.js";
@@ -29,23 +29,24 @@ import {
29
29
  } from "./roy-agent-core-7hh0brvs.js";
30
30
  import {
31
31
  BaseComponent
32
- } from "./roy-agent-core-m7dppx2p.js";
32
+ } from "./roy-agent-core-9t675te0.js";
33
33
  import {
34
34
  globalHookManager,
35
35
  init_global_hook_manager
36
- } from "./roy-agent-core-fym6zz5a.js";
36
+ } from "./roy-agent-core-a236mps6.js";
37
37
  import {
38
38
  init_context
39
- } from "./roy-agent-core-whta3f53.js";
39
+ } from "./roy-agent-core-wn59p0zw.js";
40
40
  import {
41
41
  getCurrentTaskId,
42
42
  getEnvContext,
43
+ resolveEnvParentTaskId,
43
44
  runWithEnvContextAsync
44
- } from "./roy-agent-core-n82acszf.js";
45
+ } from "./roy-agent-core-zbb3sk72.js";
45
46
  import {
46
47
  TracedAs,
47
48
  init_decorator
48
- } from "./roy-agent-core-qhjm0bxm.js";
49
+ } from "./roy-agent-core-a9pbda78.js";
49
50
  import {
50
51
  createLogger,
51
52
  init_logger
@@ -866,6 +867,7 @@ class AgentComponent extends BaseComponent {
866
867
  }
867
868
  }
868
869
  const parentEnvContext = getEnvContext();
870
+ const envBoundParentTaskId = resolveEnvParentTaskId(effectiveContext.envEvent, parentEnvContext);
869
871
  const envContext = {
870
872
  ...parentEnvContext,
871
873
  agentContext: parentEnvContext?.agentContext ?? {},
@@ -879,6 +881,7 @@ class AgentComponent extends BaseComponent {
879
881
  replyChannel: parentEnvContext?.replyChannel ?? effectiveContext.envEvent?.metadata?.replyChannel,
880
882
  sourceId: parentEnvContext?.sourceId ?? effectiveContext.envEvent?.metadata?.sourceId,
881
883
  sourceType: parentEnvContext?.sourceType ?? effectiveContext.envEvent?.metadata?.sourceType,
884
+ parentTaskId: envBoundParentTaskId,
882
885
  metadata: { ...effectiveContext.metadata }
883
886
  };
884
887
  return await runWithEnvContextAsync(envContext, async () => {
@@ -2,10 +2,10 @@ import {
2
2
  WorkflowRepository,
3
3
  migrateEmptyTagsToDefault,
4
4
  rowToWorkflow
5
- } from "./roy-agent-core-zda3rfr3.js";
6
- import"./roy-agent-core-d5gwqrr5.js";
5
+ } from "./roy-agent-core-4kbvfnn1.js";
6
+ import"./roy-agent-core-pd0exvnq.js";
7
7
  import"./roy-agent-core-rvxg1wps.js";
8
- import"./roy-agent-core-qhjm0bxm.js";
8
+ import"./roy-agent-core-a9pbda78.js";
9
9
  import"./roy-agent-core-8seq65bp.js";
10
10
  import"./roy-agent-core-jnszp0jq.js";
11
11
  import"./roy-agent-core-fs0mn2jk.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./roy-agent-core-7hh0brvs.js";
7
7
  import {
8
8
  BaseComponent
9
- } from "./roy-agent-core-m7dppx2p.js";
9
+ } from "./roy-agent-core-9t675te0.js";
10
10
  import {
11
11
  createLogger,
12
12
  init_logger
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DAGManager,
3
3
  init_dag_manager
4
- } from "./roy-agent-core-k5csz66y.js";
4
+ } from "./roy-agent-core-tm57tmds.js";
5
5
 
6
6
  // src/env/workflow/utils/validate-workflow-definition.ts
7
7
  init_dag_manager();
@@ -9,7 +9,7 @@ import {
9
9
  searchTasksTool,
10
10
  treeTasksTool,
11
11
  updateTaskTool
12
- } from "./roy-agent-core-qhtejtpc.js";
12
+ } from "./roy-agent-core-vsrfzaze.js";
13
13
  import {
14
14
  createOperationTool,
15
15
  deleteOperationTool,
@@ -27,11 +27,11 @@ import {
27
27
  BackgroundTaskManager,
28
28
  createDelegateTool,
29
29
  createStopTool
30
- } from "./roy-agent-core-zekkw27m.js";
30
+ } from "./roy-agent-core-jg8cv1f7.js";
31
31
  import {
32
32
  SQLiteTaskStore,
33
33
  getDefaultTaskDbPath
34
- } from "./roy-agent-core-dzfyjzgw.js";
34
+ } from "./roy-agent-core-jadrj0bz.js";
35
35
  import {
36
36
  TaskHookPoints
37
37
  } from "./roy-agent-core-1pg0fepg.js";
@@ -40,19 +40,19 @@ import {
40
40
  } from "./roy-agent-core-7hh0brvs.js";
41
41
  import {
42
42
  BaseComponent
43
- } from "./roy-agent-core-m7dppx2p.js";
43
+ } from "./roy-agent-core-9t675te0.js";
44
44
  import {
45
45
  globalHookManager,
46
46
  init_global_hook_manager
47
- } from "./roy-agent-core-fym6zz5a.js";
47
+ } from "./roy-agent-core-a236mps6.js";
48
48
  import {
49
49
  getEnvContextOrEmpty,
50
50
  init_env_context
51
- } from "./roy-agent-core-n82acszf.js";
51
+ } from "./roy-agent-core-zbb3sk72.js";
52
52
  import {
53
53
  TracedAs,
54
54
  init_decorator
55
- } from "./roy-agent-core-qhjm0bxm.js";
55
+ } from "./roy-agent-core-a9pbda78.js";
56
56
  import {
57
57
  createLogger,
58
58
  init_logger
@@ -432,6 +432,9 @@ class TaskComponent extends BaseComponent {
432
432
  async getTask(id) {
433
433
  return this.store.getTask(id);
434
434
  }
435
+ async getTaskIdBySessionId(sessionId) {
436
+ return this.store.getTaskIdBySessionId(sessionId);
437
+ }
435
438
  async getTaskWithOperations(id) {
436
439
  const task = await this.store.getTask(id);
437
440
  if (!task)
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  createAutoTaskPlugin
3
- } from "./roy-agent-core-e4v61k3j.js";
3
+ } from "./roy-agent-core-47wrv4ex.js";
4
4
  import {
5
5
  ContextError,
6
6
  ErrorCodes
7
7
  } from "./roy-agent-core-ctdhjv68.js";
8
8
  import {
9
9
  BaseComponent
10
- } from "./roy-agent-core-m7dppx2p.js";
10
+ } from "./roy-agent-core-9t675te0.js";
11
11
  import {
12
12
  init_context
13
- } from "./roy-agent-core-whta3f53.js";
13
+ } from "./roy-agent-core-wn59p0zw.js";
14
14
  import {
15
15
  getEnvContext,
16
16
  init_env_context,
17
17
  runWithEnvContextAsync
18
- } from "./roy-agent-core-n82acszf.js";
18
+ } from "./roy-agent-core-zbb3sk72.js";
19
19
  import {
20
20
  TracedAs,
21
21
  init_decorator
22
- } from "./roy-agent-core-qhjm0bxm.js";
22
+ } from "./roy-agent-core-a9pbda78.js";
23
23
  import {
24
24
  createLogger,
25
25
  init_logger
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  TracedAs,
6
6
  init_decorator
7
- } from "./roy-agent-core-qhjm0bxm.js";
7
+ } from "./roy-agent-core-a9pbda78.js";
8
8
  import {
9
9
  createLogger,
10
10
  init_logger
@@ -5,10 +5,10 @@ import {
5
5
  initDatabase,
6
6
  initializeTables,
7
7
  resetDatabase
8
- } from "./roy-agent-core-zda3rfr3.js";
9
- import"./roy-agent-core-d5gwqrr5.js";
8
+ } from "./roy-agent-core-4kbvfnn1.js";
9
+ import"./roy-agent-core-pd0exvnq.js";
10
10
  import"./roy-agent-core-rvxg1wps.js";
11
- import"./roy-agent-core-qhjm0bxm.js";
11
+ import"./roy-agent-core-a9pbda78.js";
12
12
  import"./roy-agent-core-8seq65bp.js";
13
13
  import"./roy-agent-core-jnszp0jq.js";
14
14
  import"./roy-agent-core-fs0mn2jk.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TagRepository
3
- } from "./roy-agent-core-d5gwqrr5.js";
4
- import"./roy-agent-core-qhjm0bxm.js";
3
+ } from "./roy-agent-core-pd0exvnq.js";
4
+ import"./roy-agent-core-a9pbda78.js";
5
5
  import"./roy-agent-core-8seq65bp.js";
6
6
  import"./roy-agent-core-jnszp0jq.js";
7
7
  import"./roy-agent-core-fs0mn2jk.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createHook
3
- } from "./roy-agent-core-w457586k.js";
3
+ } from "./roy-agent-core-cw89yj9d.js";
4
4
  import {
5
5
  HookManager
6
- } from "./roy-agent-core-fym6zz5a.js";
6
+ } from "./roy-agent-core-a236mps6.js";
7
7
 
8
8
  // src/env/component.ts
9
9
  class BaseComponent {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  init_context
3
- } from "./roy-agent-core-whta3f53.js";
3
+ } from "./roy-agent-core-wn59p0zw.js";
4
4
  import {
5
5
  getEnvContext
6
- } from "./roy-agent-core-n82acszf.js";
6
+ } from "./roy-agent-core-zbb3sk72.js";
7
7
  import {
8
8
  __esm
9
9
  } from "./roy-agent-core-fs0mn2jk.js";
@@ -12,20 +12,30 @@ import {
12
12
 
13
13
  // src/env/log-trace/decorator.ts
14
14
  function Traced(options) {
15
+ const buildOptions = () => ({
16
+ recordParams: options?.recordParams ?? true,
17
+ recordResult: options?.recordResult ?? false,
18
+ recordError: options?.recordError ?? true,
19
+ log: options?.log ?? false,
20
+ maxLogSize: options?.maxLogSize,
21
+ paramFilter: options?.paramFilter,
22
+ resultFilter: options?.resultFilter,
23
+ flattenParamFilter: options?.flattenParamFilter
24
+ });
15
25
  return function(target, propertyKey, descriptor) {
16
- const originalFn = descriptor.value;
17
- const spanName = options?.name || propertyKey;
18
- descriptor.value = wrapFunction(originalFn, spanName, {
19
- recordParams: options?.recordParams ?? true,
20
- recordResult: options?.recordResult ?? false,
21
- recordError: options?.recordError ?? true,
22
- log: options?.log ?? false,
23
- maxLogSize: options?.maxLogSize,
24
- paramFilter: options?.paramFilter,
25
- resultFilter: options?.resultFilter,
26
- flattenParamFilter: options?.flattenParamFilter
27
- });
28
- return descriptor;
26
+ if (descriptor !== undefined && descriptor !== null && typeof descriptor === "object" && "value" in descriptor) {
27
+ const originalFn = descriptor.value;
28
+ const spanName = options?.name || String(propertyKey);
29
+ descriptor.value = wrapFunction(originalFn, spanName, buildOptions());
30
+ return descriptor;
31
+ }
32
+ const value = target;
33
+ const context = propertyKey || {};
34
+ if (typeof value === "function") {
35
+ const spanName = options?.name || (context?.name ? String(context.name) : "anonymous");
36
+ return wrapFunction(value, spanName, buildOptions());
37
+ }
38
+ return value;
29
39
  };
30
40
  }
31
41
  function TracedAs(name, options) {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  AgentComponentAdapter,
3
3
  init_agent_component_adapter
4
- } from "./roy-agent-core-q8vew3zh.js";
4
+ } from "./roy-agent-core-3h7ajma5.js";
5
5
  import"./roy-agent-core-1db4vpc6.js";
6
6
  import"./roy-agent-core-e25xkv53.js";
7
- import"./roy-agent-core-fym6zz5a.js";
8
- import"./roy-agent-core-whta3f53.js";
9
- import"./roy-agent-core-n82acszf.js";
10
- import"./roy-agent-core-qhjm0bxm.js";
7
+ import"./roy-agent-core-a236mps6.js";
8
+ import"./roy-agent-core-wn59p0zw.js";
9
+ import"./roy-agent-core-zbb3sk72.js";
10
+ import"./roy-agent-core-a9pbda78.js";
11
11
  import"./roy-agent-core-8seq65bp.js";
12
12
  import"./roy-agent-core-jnszp0jq.js";
13
13
  import"./roy-agent-core-fs0mn2jk.js";