@ai-setting/roy-agent-core 1.5.14-test → 1.5.15-test

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 (141) hide show
  1. package/package.json +1 -1
  2. package/dist/config/index.d.ts +0 -1250
  3. package/dist/config/index.js +0 -32
  4. package/dist/env/agent/index.d.ts +0 -2279
  5. package/dist/env/agent/index.js +0 -24
  6. package/dist/env/commands/index.d.ts +0 -1131
  7. package/dist/env/commands/index.js +0 -14
  8. package/dist/env/debug/formatters/index.d.ts +0 -236
  9. package/dist/env/debug/formatters/index.js +0 -11
  10. package/dist/env/debug/index.d.ts +0 -1652
  11. package/dist/env/debug/index.js +0 -26
  12. package/dist/env/hook/index.d.ts +0 -279
  13. package/dist/env/hook/index.js +0 -29
  14. package/dist/env/index.d.ts +0 -3481
  15. package/dist/env/index.js +0 -82
  16. package/dist/env/llm/index.d.ts +0 -1760
  17. package/dist/env/llm/index.js +0 -40
  18. package/dist/env/log-trace/index.d.ts +0 -1574
  19. package/dist/env/log-trace/index.js +0 -83
  20. package/dist/env/mcp/index.d.ts +0 -1331
  21. package/dist/env/mcp/index.js +0 -39
  22. package/dist/env/mcp/tool/index.d.ts +0 -183
  23. package/dist/env/mcp/tool/index.js +0 -14
  24. package/dist/env/memory/built-in/index.d.ts +0 -232
  25. package/dist/env/memory/built-in/index.js +0 -11
  26. package/dist/env/memory/index.d.ts +0 -1799
  27. package/dist/env/memory/index.js +0 -56
  28. package/dist/env/memory/plugin/index.d.ts +0 -747
  29. package/dist/env/memory/plugin/index.js +0 -36
  30. package/dist/env/prompt/index.d.ts +0 -1164
  31. package/dist/env/prompt/index.js +0 -20
  32. package/dist/env/session/index.d.ts +0 -1908
  33. package/dist/env/session/index.js +0 -25
  34. package/dist/env/session/storage/index.d.ts +0 -564
  35. package/dist/env/session/storage/index.js +0 -18
  36. package/dist/env/skill/index.d.ts +0 -1266
  37. package/dist/env/skill/index.js +0 -34
  38. package/dist/env/skill/tool/index.d.ts +0 -193
  39. package/dist/env/skill/tool/index.js +0 -9
  40. package/dist/env/task/delegate/index.d.ts +0 -1612
  41. package/dist/env/task/delegate/index.js +0 -18
  42. package/dist/env/task/events/index.d.ts +0 -171
  43. package/dist/env/task/events/index.js +0 -7
  44. package/dist/env/task/hooks/index.d.ts +0 -624
  45. package/dist/env/task/hooks/index.js +0 -7
  46. package/dist/env/task/index.d.ts +0 -1553
  47. package/dist/env/task/index.js +0 -34
  48. package/dist/env/task/plugins/index.d.ts +0 -466
  49. package/dist/env/task/plugins/index.js +0 -23
  50. package/dist/env/task/storage/index.d.ts +0 -241
  51. package/dist/env/task/storage/index.js +0 -14
  52. package/dist/env/task/tools/index.d.ts +0 -1485
  53. package/dist/env/task/tools/index.js +0 -17
  54. package/dist/env/task/tools/operation/index.d.ts +0 -1484
  55. package/dist/env/task/tools/operation/index.js +0 -15
  56. package/dist/env/tool/built-in/index.d.ts +0 -218
  57. package/dist/env/tool/built-in/index.js +0 -25
  58. package/dist/env/tool/index.d.ts +0 -1396
  59. package/dist/env/tool/index.js +0 -39
  60. package/dist/env/workflow/decorators/index.d.ts +0 -2161
  61. package/dist/env/workflow/decorators/index.js +0 -27
  62. package/dist/env/workflow/engine/index.d.ts +0 -3453
  63. package/dist/env/workflow/engine/index.js +0 -28
  64. package/dist/env/workflow/index.d.ts +0 -3546
  65. package/dist/env/workflow/index.js +0 -136
  66. package/dist/env/workflow/nodes/index.d.ts +0 -2092
  67. package/dist/env/workflow/nodes/index.js +0 -19
  68. package/dist/env/workflow/service/index.d.ts +0 -227
  69. package/dist/env/workflow/service/index.js +0 -13
  70. package/dist/env/workflow/storage/index.d.ts +0 -165
  71. package/dist/env/workflow/storage/index.js +0 -27
  72. package/dist/env/workflow/tools/index.d.ts +0 -416
  73. package/dist/env/workflow/tools/index.js +0 -159
  74. package/dist/env/workflow/types/index.d.ts +0 -2255
  75. package/dist/env/workflow/types/index.js +0 -98
  76. package/dist/env/workflow/utils/index.d.ts +0 -2031
  77. package/dist/env/workflow/utils/index.js +0 -637
  78. package/dist/index.d.ts +0 -7858
  79. package/dist/index.js +0 -399
  80. package/dist/shared/@ai-setting/roy-agent-core-0rtxwr28.js +0 -258
  81. package/dist/shared/@ai-setting/roy-agent-core-0vbdz0x7.js +0 -36
  82. package/dist/shared/@ai-setting/roy-agent-core-1akcqxj9.js +0 -349
  83. package/dist/shared/@ai-setting/roy-agent-core-1ce3fqrk.js +0 -117
  84. package/dist/shared/@ai-setting/roy-agent-core-2dhd60aw.js +0 -11
  85. package/dist/shared/@ai-setting/roy-agent-core-3jywqmdd.js +0 -393
  86. package/dist/shared/@ai-setting/roy-agent-core-3rr5k71j.js +0 -200
  87. package/dist/shared/@ai-setting/roy-agent-core-44hnfb02.js +0 -299
  88. package/dist/shared/@ai-setting/roy-agent-core-4t40mkpv.js +0 -206
  89. package/dist/shared/@ai-setting/roy-agent-core-4txzpsbt.js +0 -393
  90. package/dist/shared/@ai-setting/roy-agent-core-5x94xmt6.js +0 -350
  91. package/dist/shared/@ai-setting/roy-agent-core-69jskqjg.js +0 -180
  92. package/dist/shared/@ai-setting/roy-agent-core-6kvtahqv.js +0 -408
  93. package/dist/shared/@ai-setting/roy-agent-core-7fgf85wc.js +0 -284
  94. package/dist/shared/@ai-setting/roy-agent-core-81w1963m.js +0 -762
  95. package/dist/shared/@ai-setting/roy-agent-core-8gxth0eh.js +0 -10
  96. package/dist/shared/@ai-setting/roy-agent-core-92z6t4he.js +0 -14
  97. package/dist/shared/@ai-setting/roy-agent-core-93zfb3r1.js +0 -922
  98. package/dist/shared/@ai-setting/roy-agent-core-9yxb3ty9.js +0 -15
  99. package/dist/shared/@ai-setting/roy-agent-core-b0x5dda6.js +0 -1130
  100. package/dist/shared/@ai-setting/roy-agent-core-bcbqy27c.js +0 -14
  101. package/dist/shared/@ai-setting/roy-agent-core-bvr1761x.js +0 -653
  102. package/dist/shared/@ai-setting/roy-agent-core-ctdhjv68.js +0 -93
  103. package/dist/shared/@ai-setting/roy-agent-core-d7cyjkf7.js +0 -872
  104. package/dist/shared/@ai-setting/roy-agent-core-dh9d7a3m.js +0 -11
  105. package/dist/shared/@ai-setting/roy-agent-core-e25xkv53.js +0 -64
  106. package/dist/shared/@ai-setting/roy-agent-core-eajcvp4e.js +0 -378
  107. package/dist/shared/@ai-setting/roy-agent-core-f7q2x5z6.js +0 -492
  108. package/dist/shared/@ai-setting/roy-agent-core-fs0mn2jk.js +0 -52
  109. package/dist/shared/@ai-setting/roy-agent-core-g1s2h0e5.js +0 -171
  110. package/dist/shared/@ai-setting/roy-agent-core-g99pxzn5.js +0 -862
  111. package/dist/shared/@ai-setting/roy-agent-core-gbqcyegm.js +0 -1387
  112. package/dist/shared/@ai-setting/roy-agent-core-gjq1yk68.js +0 -208
  113. package/dist/shared/@ai-setting/roy-agent-core-gq20wsgv.js +0 -139
  114. package/dist/shared/@ai-setting/roy-agent-core-gwc4h96n.js +0 -534
  115. package/dist/shared/@ai-setting/roy-agent-core-jfh9q2qh.js +0 -204
  116. package/dist/shared/@ai-setting/roy-agent-core-jvatggbb.js +0 -603
  117. package/dist/shared/@ai-setting/roy-agent-core-kkbwepqb.js +0 -97
  118. package/dist/shared/@ai-setting/roy-agent-core-pjr12nnd.js +0 -587
  119. package/dist/shared/@ai-setting/roy-agent-core-psv4v63c.js +0 -176
  120. package/dist/shared/@ai-setting/roy-agent-core-psvxt4c9.js +0 -60
  121. package/dist/shared/@ai-setting/roy-agent-core-qqceba6k.js +0 -442
  122. package/dist/shared/@ai-setting/roy-agent-core-qxhq8ven.js +0 -57
  123. package/dist/shared/@ai-setting/roy-agent-core-qxnbvgwe.js +0 -66
  124. package/dist/shared/@ai-setting/roy-agent-core-r9ezzemr.js +0 -10
  125. package/dist/shared/@ai-setting/roy-agent-core-rhmtwnw1.js +0 -267
  126. package/dist/shared/@ai-setting/roy-agent-core-rvv6ydff.js +0 -584
  127. package/dist/shared/@ai-setting/roy-agent-core-rvxg1wps.js +0 -102
  128. package/dist/shared/@ai-setting/roy-agent-core-satmq6sh.js +0 -549
  129. package/dist/shared/@ai-setting/roy-agent-core-sx7wsvnn.js +0 -15
  130. package/dist/shared/@ai-setting/roy-agent-core-t94ktchq.js +0 -213
  131. package/dist/shared/@ai-setting/roy-agent-core-vf215qfv.js +0 -812
  132. package/dist/shared/@ai-setting/roy-agent-core-vkz81f7v.js +0 -1316
  133. package/dist/shared/@ai-setting/roy-agent-core-vn2bc59q.js +0 -1205
  134. package/dist/shared/@ai-setting/roy-agent-core-wa1kzqky.js +0 -328
  135. package/dist/shared/@ai-setting/roy-agent-core-wft9ra24.js +0 -20
  136. package/dist/shared/@ai-setting/roy-agent-core-wrcy0h6z.js +0 -2098
  137. package/dist/shared/@ai-setting/roy-agent-core-xq8hhqb8.js +0 -419
  138. package/dist/shared/@ai-setting/roy-agent-core-xs5rsgat.js +0 -368
  139. package/dist/shared/@ai-setting/roy-agent-core-zbkpc41z.js +0 -377
  140. package/dist/shared/@ai-setting/roy-agent-core-zgypchmt.js +0 -172
  141. package/dist/shared/@ai-setting/roy-agent-core-zpn0bqa8.js +0 -103
@@ -1,368 +0,0 @@
1
- import {
2
- SQLiteSpanStorage,
3
- init_span_storage
4
- } from "./roy-agent-core-psv4v63c.js";
5
- import {
6
- __esm,
7
- __export,
8
- __require
9
- } from "./roy-agent-core-fs0mn2jk.js";
10
-
11
- // src/env/log-trace/opentelemetry/propagation.ts
12
- function padLeft(str, length) {
13
- return str.padStart(length, "0");
14
- }
15
- function isValidHex(str) {
16
- return /^[0-9a-f]+$/i.test(str);
17
- }
18
- function serialize(context) {
19
- const traceId = padLeft(context.traceId.toLowerCase(), TRACE_ID_LENGTH);
20
- const spanId = padLeft(context.spanId.toLowerCase(), PARENT_SPAN_ID_LENGTH);
21
- const parts = [
22
- TRACE_CONTEXT_VERSION,
23
- traceId,
24
- spanId,
25
- TRACE_FLAGS_SAMPLED
26
- ];
27
- return parts.join("-");
28
- }
29
- function parse(traceparent) {
30
- if (!traceparent || typeof traceparent !== "string") {
31
- return;
32
- }
33
- const trimmed = traceparent.trim();
34
- const parts = trimmed.split("-");
35
- if (parts.length !== 4) {
36
- return;
37
- }
38
- const [version, traceId, senderSpanId, flags] = parts;
39
- if (version !== TRACE_CONTEXT_VERSION) {
40
- if (version > TRACE_CONTEXT_VERSION) {
41
- return;
42
- }
43
- }
44
- if (traceId.length !== TRACE_ID_LENGTH || !isValidHex(traceId)) {
45
- return;
46
- }
47
- if (senderSpanId.length !== PARENT_SPAN_ID_LENGTH || !isValidHex(senderSpanId)) {
48
- return;
49
- }
50
- if (flags.length !== FLAGS_LENGTH || !isValidHex(flags)) {
51
- return;
52
- }
53
- return {
54
- traceId: traceId.toLowerCase(),
55
- spanId: senderSpanId.toLowerCase()
56
- };
57
- }
58
- var TRACE_CONTEXT_VERSION = "00", TRACE_FLAGS_SAMPLED = "01", TRACEPARENT_HEADER = "TRACEPARENT", TRACE_ID_LENGTH = 32, PARENT_SPAN_ID_LENGTH = 16, FLAGS_LENGTH = 2, propagation;
59
- var init_propagation = __esm(() => {
60
- propagation = {
61
- inject(carrier, context) {
62
- carrier[TRACEPARENT_HEADER] = serialize(context);
63
- },
64
- extract(carrier) {
65
- const traceparent = carrier[TRACEPARENT_HEADER];
66
- if (!traceparent) {
67
- return;
68
- }
69
- return parse(traceparent);
70
- },
71
- getTraceparentHeader() {
72
- return TRACEPARENT_HEADER;
73
- }
74
- };
75
- });
76
-
77
- // src/env/log-trace/types.ts
78
- var SpanKind, SpanStatus;
79
- var init_types = __esm(() => {
80
- ((SpanKind2) => {
81
- SpanKind2["CLIENT"] = "client";
82
- SpanKind2["SERVER"] = "server";
83
- SpanKind2["INTERNAL"] = "internal";
84
- })(SpanKind ||= {});
85
- ((SpanStatus2) => {
86
- SpanStatus2["OK"] = "ok";
87
- SpanStatus2["ERROR"] = "error";
88
- })(SpanStatus ||= {});
89
- });
90
-
91
- // src/env/log-trace/opentelemetry/tracer-provider.ts
92
- var exports_tracer_provider = {};
93
- __export(exports_tracer_provider, {
94
- resetTracerProvider: () => resetTracerProvider,
95
- getTracerProvider: () => getTracerProvider,
96
- OTelTracerProvider: () => OTelTracerProvider
97
- });
98
-
99
- class OTelSpanImpl {
100
- name;
101
- kind;
102
- spanContext;
103
- attributes = {};
104
- startTime;
105
- endTime;
106
- error;
107
- storage;
108
- parentSpanContext;
109
- onEnd;
110
- constructor(name, spanContext, storage, parentSpanContext, onEnd) {
111
- this.name = name;
112
- this.kind = "internal";
113
- this.spanContext = spanContext;
114
- this.parentSpanContext = parentSpanContext;
115
- this.startTime = Date.now();
116
- this.storage = storage;
117
- this.onEnd = onEnd;
118
- }
119
- setAttribute(key, value) {
120
- this.attributes[key] = value;
121
- }
122
- addEvent(name, attributes) {
123
- const events = this.attributes._events || [];
124
- events.push({ name, attributes });
125
- this.attributes._events = events;
126
- }
127
- end(result, error) {
128
- this.endTime = Date.now();
129
- if (error) {
130
- this.error = error.message;
131
- }
132
- this.storage.save({
133
- traceId: this.spanContext.traceId,
134
- spanId: this.spanContext.spanId,
135
- parentSpanId: this.spanContext.parentSpanId,
136
- name: this.name,
137
- kind: this.kind,
138
- status: error ? "error" /* ERROR */ : "ok" /* OK */,
139
- startTime: this.startTime,
140
- endTime: this.endTime,
141
- attributes: this.attributes,
142
- result,
143
- error: this.error
144
- });
145
- this.onEnd?.();
146
- }
147
- }
148
-
149
- class OTelTracerImpl {
150
- name;
151
- version;
152
- storage;
153
- currentContext;
154
- activeSpans = new Map;
155
- onSpanEndCallback;
156
- provider;
157
- constructor(name, version, storage, provider) {
158
- this.name = name;
159
- this.version = version;
160
- this.storage = storage;
161
- this.provider = provider;
162
- }
163
- setOnSpanEndCallback(callback) {
164
- this.onSpanEndCallback = callback;
165
- }
166
- getActiveSpanCount() {
167
- return this.activeSpans.size;
168
- }
169
- startSpan(name, options) {
170
- const parentFromOptions = options?.parent;
171
- const hasExplicitParent = options && "parent" in options;
172
- const globalContext = this.provider.getGlobalContext();
173
- let effectiveParentContext;
174
- if (hasExplicitParent) {
175
- effectiveParentContext = parentFromOptions;
176
- } else if (this.currentContext) {
177
- effectiveParentContext = this.currentContext;
178
- } else if (globalContext) {
179
- effectiveParentContext = globalContext;
180
- }
181
- const traceId = effectiveParentContext?.traceId || this.generateTraceId();
182
- const spanId = this.generateSpanId();
183
- let parentSpanId;
184
- if (hasExplicitParent && parentFromOptions) {
185
- parentSpanId = parentFromOptions.parentSpanId || parentFromOptions.spanId;
186
- } else if (this.currentContext) {
187
- parentSpanId = this.currentContext.spanId;
188
- } else if (globalContext) {
189
- parentSpanId = globalContext.spanId;
190
- }
191
- const spanContext = {
192
- traceId,
193
- spanId,
194
- parentSpanId
195
- };
196
- this.currentContext = {
197
- traceId,
198
- spanId,
199
- parentSpanId
200
- };
201
- const span = new OTelSpanImpl(name, spanContext, this.storage, effectiveParentContext, () => this.handleSpanEnd(spanContext.spanId, effectiveParentContext?.spanId));
202
- if (options?.attributes) {
203
- for (const [key, value] of Object.entries(options.attributes)) {
204
- span.setAttribute(key, value);
205
- }
206
- }
207
- this.activeSpans.set(spanId, span);
208
- return span;
209
- }
210
- injectToEnv(env) {
211
- if (this.currentContext) {
212
- propagation.inject(env, this.currentContext);
213
- }
214
- }
215
- getCurrentContext() {
216
- return this.currentContext;
217
- }
218
- setCurrentContext(context) {
219
- this.currentContext = context;
220
- }
221
- endSpan(span) {
222
- const spanContext = span.spanContext;
223
- this.activeSpans.delete(spanContext.spanId);
224
- const currentTraceId = this.currentContext?.traceId;
225
- if (spanContext.parentSpanId) {
226
- const parentSpan = this.activeSpans.get(spanContext.parentSpanId);
227
- if (parentSpan) {
228
- const parentContext = {
229
- traceId: spanContext.traceId,
230
- spanId: parentSpan.spanContext.spanId,
231
- parentSpanId: parentSpan.spanContext.parentSpanId
232
- };
233
- this.currentContext = parentContext;
234
- return parentContext;
235
- }
236
- if (currentTraceId) {
237
- const parentContext = {
238
- traceId: currentTraceId,
239
- spanId: spanContext.parentSpanId,
240
- parentSpanId: undefined
241
- };
242
- this.currentContext = parentContext;
243
- return parentContext;
244
- }
245
- }
246
- this.currentContext = undefined;
247
- return;
248
- }
249
- generateTraceId() {
250
- const timestamp = Date.now().toString(16).padStart(12, "0");
251
- const random = Array.from({ length: 5 }, () => Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0")).join("");
252
- return (timestamp + random).slice(0, 32).padStart(32, "0");
253
- }
254
- generateSpanId() {
255
- return Math.floor(Math.random() * 18446744073709552000).toString(16).padStart(16, "0");
256
- }
257
- handleSpanEnd(spanId, parentSpanId) {
258
- this.activeSpans.delete(spanId);
259
- const currentTraceId = this.currentContext?.traceId;
260
- if (parentSpanId) {
261
- const parentSpan = this.activeSpans.get(parentSpanId);
262
- if (parentSpan) {
263
- this.currentContext = {
264
- traceId: parentSpan.spanContext.traceId,
265
- spanId: parentSpan.spanContext.spanId,
266
- parentSpanId: parentSpan.spanContext.parentSpanId
267
- };
268
- return;
269
- }
270
- if (currentTraceId) {
271
- this.currentContext = {
272
- traceId: currentTraceId,
273
- spanId: parentSpanId,
274
- parentSpanId: undefined
275
- };
276
- return;
277
- }
278
- }
279
- this.currentContext = undefined;
280
- }
281
- }
282
-
283
- class OTelTracerProvider {
284
- tracers = new Map;
285
- storage;
286
- initialized = false;
287
- globalContext;
288
- constructor(storage, dbPath) {
289
- this.storage = storage || new SQLiteSpanStorage(dbPath || getDefaultDbPath());
290
- }
291
- async initialize() {
292
- if (this.initialized)
293
- return;
294
- await this.storage.initialize();
295
- this.initialized = true;
296
- }
297
- isInitialized() {
298
- return this.initialized;
299
- }
300
- getGlobalContext() {
301
- return this.globalContext;
302
- }
303
- setGlobalContext(context) {
304
- this.globalContext = context;
305
- }
306
- getTracer(name, version) {
307
- const key = `${name}@${version || "0.0.0"}`;
308
- let tracer = this.tracers.get(key);
309
- if (!tracer) {
310
- tracer = new OTelTracerImpl(name, version, this.storage, this);
311
- this.tracers.set(key, tracer);
312
- if (this.initialized) {
313
- this.restoreFromEnv(tracer);
314
- }
315
- }
316
- return tracer;
317
- }
318
- restoreFromEnv(tracer) {
319
- const extracted = propagation.extract(process.env);
320
- if (extracted) {
321
- tracer.setCurrentContext({
322
- traceId: extracted.traceId,
323
- spanId: extracted.spanId,
324
- parentSpanId: undefined
325
- });
326
- }
327
- }
328
- shutdown() {
329
- for (const tracer of this.tracers.values()) {}
330
- this.tracers.clear();
331
- this.storage.close();
332
- this.initialized = false;
333
- this.globalContext = undefined;
334
- delete process.env["TRACEPARENT"];
335
- delete process.env["TRACE_ID"];
336
- delete process.env["LOG_TRACE_REQUEST_ID"];
337
- }
338
- getStorage() {
339
- return this.storage;
340
- }
341
- }
342
- function getTracerProvider() {
343
- if (!providerInstance) {
344
- providerInstance = new OTelTracerProvider;
345
- }
346
- return providerInstance;
347
- }
348
- function resetTracerProvider() {
349
- if (providerInstance) {
350
- providerInstance.shutdown();
351
- providerInstance = null;
352
- }
353
- }
354
- function getDefaultDbPath() {
355
- const os = __require("os");
356
- const path = __require("path");
357
- const home = os.homedir();
358
- const dataHome = process.env.XDG_DATA_HOME || path.join(home, ".local", "share");
359
- return path.join(dataHome, "roy-agent", "traces.db");
360
- }
361
- var providerInstance = null;
362
- var init_tracer_provider = __esm(() => {
363
- init_span_storage();
364
- init_propagation();
365
- init_types();
366
- });
367
-
368
- export { serialize, parse, propagation, init_propagation, SpanKind, SpanStatus, init_types, OTelTracerProvider, getTracerProvider, resetTracerProvider, exports_tracer_provider, init_tracer_provider };