@ai-setting/roy-agent-core 1.4.13 → 1.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packages/core/src/config/index.js +32 -0
- package/dist/packages/core/src/env/agent/index.js +24 -0
- package/dist/packages/core/src/env/commands/index.js +14 -0
- package/dist/packages/core/src/env/debug/formatters/index.js +11 -0
- package/dist/packages/core/src/env/debug/index.js +26 -0
- package/dist/packages/core/src/env/hook/index.js +29 -0
- package/dist/packages/core/src/env/index.js +81 -0
- package/dist/packages/core/src/env/llm/index.js +40 -0
- package/dist/packages/core/src/env/log-trace/index.js +83 -0
- package/dist/packages/core/src/env/mcp/index.js +39 -0
- package/dist/packages/core/src/env/mcp/tool/index.js +14 -0
- package/dist/packages/core/src/env/memory/built-in/index.js +11 -0
- package/dist/packages/core/src/env/memory/index.js +56 -0
- package/dist/packages/core/src/env/memory/plugin/index.js +36 -0
- package/dist/packages/core/src/env/prompt/index.js +20 -0
- package/dist/packages/core/src/env/session/index.js +25 -0
- package/dist/packages/core/src/env/session/storage/index.js +18 -0
- package/dist/packages/core/src/env/skill/index.js +34 -0
- package/dist/packages/core/src/env/skill/tool/index.js +9 -0
- package/dist/packages/core/src/env/task/delegate/index.js +18 -0
- package/dist/packages/core/src/env/task/hooks/index.js +7 -0
- package/dist/packages/core/src/env/task/index.js +30 -0
- package/dist/packages/core/src/env/task/plugins/index.js +23 -0
- package/dist/packages/core/src/env/task/storage/index.js +14 -0
- package/dist/packages/core/src/env/task/tools/index.js +17 -0
- package/dist/packages/core/src/env/task/tools/operation/index.js +15 -0
- package/dist/{shared/chunk-1d4rwms4.js → packages/core/src/env/tool/built-in/index.js} +4 -4
- package/dist/packages/core/src/env/tool/index.js +39 -0
- package/dist/packages/core/src/env/workflow/decorators/index.js +27 -0
- package/dist/packages/core/src/env/workflow/engine/index.js +28 -0
- package/dist/packages/core/src/env/workflow/index.js +132 -0
- package/dist/packages/core/src/env/workflow/nodes/index.js +19 -0
- package/dist/packages/core/src/env/workflow/service/index.js +13 -0
- package/dist/packages/core/src/env/workflow/storage/index.js +27 -0
- package/dist/packages/core/src/env/workflow/tools/index.js +159 -0
- package/dist/packages/core/src/env/workflow/types/index.js +94 -0
- package/dist/packages/core/src/env/workflow/utils/index.js +637 -0
- package/dist/packages/core/src/index.js +398 -0
- package/dist/shared/@ai-setting/roy-agent-core-04fm8177.js +393 -0
- package/dist/shared/@ai-setting/roy-agent-core-04qgbjbe.js +172 -0
- package/dist/shared/@ai-setting/roy-agent-core-084qqd7t.js +11 -0
- package/dist/shared/@ai-setting/roy-agent-core-0gekht4e.js +1130 -0
- package/dist/shared/@ai-setting/roy-agent-core-0hdry23r.js +419 -0
- package/dist/shared/{chunk-ze20rksg.js → @ai-setting/roy-agent-core-0sgn3de4.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-12x57kf1.js +286 -0
- package/dist/shared/@ai-setting/roy-agent-core-1f3xrrm6.js +393 -0
- package/dist/shared/{chunk-q9j99fsm.js → @ai-setting/roy-agent-core-1k28kg7h.js} +6 -6
- package/dist/shared/{chunk-2b5kbhx3.js → @ai-setting/roy-agent-core-1z1zv5g8.js} +9 -117
- package/dist/shared/@ai-setting/roy-agent-core-2hqxnaf3.js +851 -0
- package/dist/shared/@ai-setting/roy-agent-core-3dfq8awb.js +587 -0
- package/dist/shared/@ai-setting/roy-agent-core-3takar0s.js +93 -0
- package/dist/shared/@ai-setting/roy-agent-core-3tnb2005.js +117 -0
- package/dist/shared/@ai-setting/roy-agent-core-4vmcvkav.js +14 -0
- package/dist/shared/{chunk-25x2pdtp.js → @ai-setting/roy-agent-core-4ws8atva.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-5fbp24se.js +603 -0
- package/dist/shared/@ai-setting/roy-agent-core-5my94ywp.js +66 -0
- package/dist/shared/{chunk-rncy3rtd.js → @ai-setting/roy-agent-core-6j0zcmwk.js} +128 -1122
- package/dist/shared/@ai-setting/roy-agent-core-6w4pmxc7.js +266 -0
- package/dist/shared/{chunk-yqmx37vm.js → @ai-setting/roy-agent-core-7vrk3add.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-8dvbn7tw.js +64 -0
- package/dist/shared/@ai-setting/roy-agent-core-8mbmrwzs.js +171 -0
- package/dist/shared/@ai-setting/roy-agent-core-8wzz66qe.js +620 -0
- package/dist/shared/@ai-setting/roy-agent-core-9ykq91jc.js +762 -0
- package/dist/shared/@ai-setting/roy-agent-core-dde19zke.js +1305 -0
- package/dist/shared/@ai-setting/roy-agent-core-f7g67gce.js +913 -0
- package/dist/shared/@ai-setting/roy-agent-core-fq5mtxsy.js +341 -0
- package/dist/shared/@ai-setting/roy-agent-core-fvd9g6k8.js +1205 -0
- package/dist/shared/@ai-setting/roy-agent-core-gv1hrn3x.js +378 -0
- package/dist/shared/@ai-setting/roy-agent-core-gy0wp5h7.js +213 -0
- package/dist/shared/{chunk-mf5xqbdh.js → @ai-setting/roy-agent-core-hyza1gm7.js} +3 -2
- package/dist/shared/{chunk-1qwabsm0.js → @ai-setting/roy-agent-core-j8zx62zr.js} +2 -2
- package/dist/shared/@ai-setting/roy-agent-core-jb2exr0d.js +442 -0
- package/dist/shared/@ai-setting/roy-agent-core-jv3b7v9w.js +57 -0
- package/dist/shared/@ai-setting/roy-agent-core-k1rxf9ya.js +513 -0
- package/dist/shared/@ai-setting/roy-agent-core-kydc9nwb.js +60 -0
- package/dist/shared/@ai-setting/roy-agent-core-m2x48hw6.js +97 -0
- package/dist/shared/@ai-setting/roy-agent-core-m6y668cc.js +377 -0
- package/dist/shared/{chunk-1aakcfp1.js → @ai-setting/roy-agent-core-nczzf0ms.js} +3 -3
- package/dist/shared/@ai-setting/roy-agent-core-nfj6knp5.js +36 -0
- package/dist/shared/@ai-setting/roy-agent-core-ntrp979d.js +204 -0
- package/dist/shared/@ai-setting/roy-agent-core-pd7g8z5v.js +1387 -0
- package/dist/shared/@ai-setting/roy-agent-core-pzk1syce.js +14 -0
- package/dist/shared/@ai-setting/roy-agent-core-q50tg9m2.js +862 -0
- package/dist/shared/{chunk-9qzt1v1p.js → @ai-setting/roy-agent-core-qg9tcaph.js} +3 -2
- package/dist/shared/{chunk-91bas8w5.js → @ai-setting/roy-agent-core-qhyerewk.js} +5 -5
- package/dist/shared/{chunk-1pf5mfgd.js → @ai-setting/roy-agent-core-qxybm159.js} +3 -3
- package/dist/shared/{chunk-g6j5n3gv.js → @ai-setting/roy-agent-core-rh9dpkpw.js} +10 -10
- package/dist/shared/{chunk-0q6s9wm6.js → @ai-setting/roy-agent-core-rr9p1g43.js} +7 -51
- package/dist/shared/@ai-setting/roy-agent-core-sbzvpfn7.js +284 -0
- package/dist/shared/@ai-setting/roy-agent-core-t22nqt4d.js +788 -0
- package/dist/shared/{chunk-t1rh6jtm.js → @ai-setting/roy-agent-core-tkr5ynkh.js} +8 -13
- package/dist/shared/@ai-setting/roy-agent-core-v4aabsf0.js +303 -0
- package/dist/shared/@ai-setting/roy-agent-core-w75rafhy.js +202 -0
- package/dist/shared/@ai-setting/roy-agent-core-w76hqkmg.js +584 -0
- package/dist/shared/@ai-setting/roy-agent-core-yfbgwes2.js +408 -0
- package/dist/shared/{chunk-a9qmy3sc.js → @ai-setting/roy-agent-core-yn761yve.js} +7 -4
- package/dist/shared/@ai-setting/roy-agent-core-yrzmn4m1.js +492 -0
- package/dist/shared/@ai-setting/roy-agent-core-yt8wdh2w.js +206 -0
- package/package.json +8 -7
- package/dist/index.d.ts +0 -7825
- package/dist/index.js +0 -16551
- package/dist/shared/chunk-hs7tbmje.js +0 -24
- /package/dist/shared/{chunk-wbkh7wat.js → @ai-setting/roy-agent-core-fs0mn2jk.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SQLiteSpanStorage,
|
|
3
3
|
init_span_storage
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./roy-agent-core-j8zx62zr.js";
|
|
5
5
|
import {
|
|
6
6
|
__esm,
|
|
7
7
|
__export,
|
|
8
8
|
__require
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./roy-agent-core-fs0mn2jk.js";
|
|
10
10
|
|
|
11
|
-
// src/env/log-trace/opentelemetry/propagation.ts
|
|
11
|
+
// packages/core/src/env/log-trace/opentelemetry/propagation.ts
|
|
12
12
|
function padLeft(str, length) {
|
|
13
13
|
return str.padStart(length, "0");
|
|
14
14
|
}
|
|
@@ -74,7 +74,7 @@ var init_propagation = __esm(() => {
|
|
|
74
74
|
};
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
// src/env/log-trace/types.ts
|
|
77
|
+
// packages/core/src/env/log-trace/types.ts
|
|
78
78
|
var SpanKind, SpanStatus;
|
|
79
79
|
var init_types = __esm(() => {
|
|
80
80
|
((SpanKind2) => {
|
|
@@ -88,7 +88,7 @@ var init_types = __esm(() => {
|
|
|
88
88
|
})(SpanStatus ||= {});
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
// src/env/log-trace/opentelemetry/tracer-provider.ts
|
|
91
|
+
// packages/core/src/env/log-trace/opentelemetry/tracer-provider.ts
|
|
92
92
|
var exports_tracer_provider = {};
|
|
93
93
|
__export(exports_tracer_provider, {
|
|
94
94
|
resetTracerProvider: () => resetTracerProvider,
|
|
@@ -365,4 +365,4 @@ var init_tracer_provider = __esm(() => {
|
|
|
365
365
|
init_types();
|
|
366
366
|
});
|
|
367
367
|
|
|
368
|
-
export { propagation, init_propagation, SpanKind, SpanStatus, init_types, OTelTracerProvider, getTracerProvider, resetTracerProvider, exports_tracer_provider, init_tracer_provider };
|
|
368
|
+
export { serialize, parse, propagation, init_propagation, SpanKind, SpanStatus, init_types, OTelTracerProvider, getTracerProvider, resetTracerProvider, exports_tracer_provider, init_tracer_provider };
|
|
@@ -1,121 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DecoratorNode,
|
|
3
|
+
init_decorator_node
|
|
4
|
+
} from "./roy-agent-core-3tnb2005.js";
|
|
1
5
|
import {
|
|
2
6
|
__esm,
|
|
3
7
|
__export
|
|
4
|
-
} from "./
|
|
5
|
-
|
|
6
|
-
// src/env/workflow/decorators/decorator-node.ts
|
|
7
|
-
class DecoratorNode {
|
|
8
|
-
type = "decorator";
|
|
9
|
-
id;
|
|
10
|
-
methodName;
|
|
11
|
-
instance;
|
|
12
|
-
dependsOn;
|
|
13
|
-
timeout;
|
|
14
|
-
retryConfig;
|
|
15
|
-
constructor(definition) {
|
|
16
|
-
const config = definition.config;
|
|
17
|
-
this.id = definition.id;
|
|
18
|
-
this.methodName = config._methodName;
|
|
19
|
-
this.instance = config._instance;
|
|
20
|
-
this.dependsOn = definition.depends_on || [];
|
|
21
|
-
this.timeout = definition.timeout;
|
|
22
|
-
this.retryConfig = definition.retry;
|
|
23
|
-
}
|
|
24
|
-
async execute(context) {
|
|
25
|
-
const startTime = Date.now();
|
|
26
|
-
const method = this.instance[this.methodName];
|
|
27
|
-
if (typeof method !== "function") {
|
|
28
|
-
return {
|
|
29
|
-
success: false,
|
|
30
|
-
error: `Method '${this.methodName}' is not a function`,
|
|
31
|
-
duration: Date.now() - startTime
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const input = this.prepareInput(context);
|
|
35
|
-
const result = await this.executeWithRetry(input, context.abort);
|
|
36
|
-
return {
|
|
37
|
-
success: !result.error,
|
|
38
|
-
output: result.output,
|
|
39
|
-
error: result.error,
|
|
40
|
-
duration: Date.now() - startTime,
|
|
41
|
-
metadata: {
|
|
42
|
-
methodName: this.methodName
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
prepareInput(context) {
|
|
47
|
-
const nodeOutputs = context.nodeOutputs;
|
|
48
|
-
if (this.dependsOn.length === 0) {
|
|
49
|
-
return context.input || {};
|
|
50
|
-
}
|
|
51
|
-
const input = {};
|
|
52
|
-
for (const depId of this.dependsOn) {
|
|
53
|
-
const depOutput = nodeOutputs instanceof Map ? nodeOutputs.get(depId) : nodeOutputs?.[depId];
|
|
54
|
-
if (depOutput && typeof depOutput === "object") {
|
|
55
|
-
if ("output" in depOutput) {
|
|
56
|
-
input[depId] = depOutput.output;
|
|
57
|
-
} else {
|
|
58
|
-
input[depId] = depOutput;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return input;
|
|
63
|
-
}
|
|
64
|
-
async executeWithRetry(input, abort) {
|
|
65
|
-
const maxAttempts = this.retryConfig?.max_attempts ?? 1;
|
|
66
|
-
const backoff = this.retryConfig?.backoff ?? "exponential";
|
|
67
|
-
const initialDelay = this.retryConfig?.initial_delay ?? 1000;
|
|
68
|
-
let lastError;
|
|
69
|
-
for (let attempt = 1;attempt <= maxAttempts; attempt++) {
|
|
70
|
-
if (abort?.aborted) {
|
|
71
|
-
return { error: "Execution aborted" };
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
const output = await this.executeWithTimeout(input, abort);
|
|
75
|
-
return { output };
|
|
76
|
-
} catch (error) {
|
|
77
|
-
lastError = error instanceof Error ? error : new Error(String(error));
|
|
78
|
-
if (attempt < maxAttempts) {
|
|
79
|
-
const delay = this.calculateBackoff(backoff, initialDelay, attempt - 1);
|
|
80
|
-
await this.sleep(delay, abort);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return { error: lastError?.message || "Unknown error" };
|
|
85
|
-
}
|
|
86
|
-
async executeWithTimeout(input, abort) {
|
|
87
|
-
if (!this.timeout) {
|
|
88
|
-
return this.instance[this.methodName](input);
|
|
89
|
-
}
|
|
90
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
91
|
-
setTimeout(() => {
|
|
92
|
-
reject(new Error(`Execution timeout after ${this.timeout}ms`));
|
|
93
|
-
}, this.timeout);
|
|
94
|
-
});
|
|
95
|
-
return Promise.race([
|
|
96
|
-
this.instance[this.methodName](input),
|
|
97
|
-
timeoutPromise
|
|
98
|
-
]);
|
|
99
|
-
}
|
|
100
|
-
calculateBackoff(backoff, initialDelay, attempt) {
|
|
101
|
-
if (backoff === "exponential") {
|
|
102
|
-
return initialDelay * Math.pow(2, attempt);
|
|
103
|
-
}
|
|
104
|
-
return initialDelay;
|
|
105
|
-
}
|
|
106
|
-
sleep(ms, abort) {
|
|
107
|
-
return new Promise((resolve) => {
|
|
108
|
-
const timeout = setTimeout(resolve, ms);
|
|
109
|
-
abort?.addEventListener("abort", () => {
|
|
110
|
-
clearTimeout(timeout);
|
|
111
|
-
resolve();
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
var init_decorator_node = () => {};
|
|
8
|
+
} from "./roy-agent-core-fs0mn2jk.js";
|
|
117
9
|
|
|
118
|
-
// src/env/workflow/nodes/condition-node.ts
|
|
10
|
+
// packages/core/src/env/workflow/nodes/condition-node.ts
|
|
119
11
|
class ConditionNode {
|
|
120
12
|
definition;
|
|
121
13
|
type = "condition";
|
|
@@ -248,7 +140,7 @@ class ConditionNode {
|
|
|
248
140
|
}
|
|
249
141
|
var init_condition_node = () => {};
|
|
250
142
|
|
|
251
|
-
// src/env/workflow/nodes/merge-node.ts
|
|
143
|
+
// packages/core/src/env/workflow/nodes/merge-node.ts
|
|
252
144
|
class MergeNode {
|
|
253
145
|
definition;
|
|
254
146
|
type = "merge";
|
|
@@ -333,7 +225,7 @@ class MergeNode {
|
|
|
333
225
|
}
|
|
334
226
|
var init_merge_node = () => {};
|
|
335
227
|
|
|
336
|
-
// src/env/workflow/utils/node-registry-helper.ts
|
|
228
|
+
// packages/core/src/env/workflow/utils/node-registry-helper.ts
|
|
337
229
|
var exports_node_registry_helper = {};
|
|
338
230
|
__export(exports_node_registry_helper, {
|
|
339
231
|
registerDecoratorNodeType: () => registerDecoratorNodeType,
|
|
@@ -363,4 +255,4 @@ var init_node_registry_helper = __esm(() => {
|
|
|
363
255
|
init_merge_node();
|
|
364
256
|
});
|
|
365
257
|
|
|
366
|
-
export {
|
|
258
|
+
export { registerDecoratorNodeType, hasDecoratorNodes, getDecoratorNodes, exports_node_registry_helper, init_node_registry_helper };
|