@ai-setting/roy-agent-core 1.5.49 → 1.5.50
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/config/index.js +10 -6
- package/dist/env/agent/index.js +7 -7
- package/dist/env/commands/index.js +7 -6
- package/dist/env/context/index.js +6 -2
- package/dist/env/debug/index.js +10 -6
- package/dist/env/event-source/index.js +9 -9
- package/dist/env/hook/index.js +8 -4
- package/dist/env/index.js +20 -20
- package/dist/env/llm/index.js +7 -7
- package/dist/env/log-trace/index.js +7 -7
- package/dist/env/mcp/index.js +7 -6
- package/dist/env/memory/index.js +7 -6
- package/dist/env/plugin/index.js +7 -6
- package/dist/env/prompt/index.js +7 -6
- package/dist/env/session/index.js +7 -7
- package/dist/env/skill/index.js +7 -6
- package/dist/env/task/delegate/index.js +4 -4
- package/dist/env/task/index.js +9 -9
- package/dist/env/task/plugins/index.js +3 -3
- package/dist/env/task/tools/index.js +3 -2
- package/dist/env/tool/index.js +7 -6
- package/dist/env/workflow/engine/index.js +6 -6
- package/dist/env/workflow/index.js +9 -9
- package/dist/index.js +34 -34
- package/dist/shared/@ai-setting/{roy-agent-core-d40gbvzj.js → roy-agent-core-316v7cm4.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-nxf64fn4.js → roy-agent-core-48v06q1b.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-3nw9vxp2.js → roy-agent-core-4b18eceq.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-pxp9yq24.js → roy-agent-core-5ng0awvn.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-cv8kqab8.js → roy-agent-core-5qe84a90.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-5dkewp2h.js → roy-agent-core-8nd895aq.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-n1awj8ks.js → roy-agent-core-9a2n122m.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-476ewnwy.js → roy-agent-core-9sarrbw9.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-dvrfs18y.js → roy-agent-core-a8gvea2f.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-8f8dq3kj.js → roy-agent-core-c7cm1wjt.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ym6qbh1e.js → roy-agent-core-d8v4n80n.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-607ktjxs.js → roy-agent-core-ezfwx334.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-h6bqx4jj.js → roy-agent-core-fpb999vd.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-1a38hg1q.js → roy-agent-core-fy1y1aqx.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-7qj11qp8.js → roy-agent-core-hd6kd06t.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-g3j3ftbw.js → roy-agent-core-m5g2jx7f.js} +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-4zjdkqry.js → roy-agent-core-mangq9x1.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-sj2yd6g4.js → roy-agent-core-pa9wz5q0.js} +27 -17
- package/dist/shared/@ai-setting/{roy-agent-core-8whpa5yz.js → roy-agent-core-pvswd18d.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-wv9as4ds.js → roy-agent-core-qfdgg56t.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-gfzqwb6v.js → roy-agent-core-rjf59e7k.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-dre9rcs0.js → roy-agent-core-s7bgrtch.js} +17 -4
- package/dist/shared/@ai-setting/{roy-agent-core-2m5qnhv9.js → roy-agent-core-sxd8snnj.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-rwt7b6dh.js → roy-agent-core-t32gmaqn.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xpw0mtfv.js → roy-agent-core-vfk5mtbx.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-rrsn14cr.js → roy-agent-core-w65c5gac.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-yv7dppda.js → roy-agent-core-wtnwxn8h.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-bjphrqsm.js → roy-agent-core-y30njf6b.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-14fna5qg.js → roy-agent-core-y85xsddt.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-z3pq1nx9.js → roy-agent-core-yq4fv8ce.js} +1 -1
- package/package.json +1 -1
|
@@ -11,27 +11,28 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
SessionMessageConverter
|
|
13
13
|
} from "./roy-agent-core-7b35emr7.js";
|
|
14
|
-
import {
|
|
15
|
-
TracedAs,
|
|
16
|
-
init_decorator
|
|
17
|
-
} from "./roy-agent-core-q5qj0fes.js";
|
|
18
14
|
import {
|
|
19
15
|
envKeyToConfigKey
|
|
20
16
|
} from "./roy-agent-core-qxhq8ven.js";
|
|
21
17
|
import {
|
|
22
18
|
BaseComponent
|
|
23
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-rjf59e7k.js";
|
|
24
20
|
import {
|
|
25
21
|
globalHookManager,
|
|
26
22
|
init_global_hook_manager
|
|
27
|
-
} from "./roy-agent-core-
|
|
23
|
+
} from "./roy-agent-core-48v06q1b.js";
|
|
28
24
|
import {
|
|
29
25
|
init_context
|
|
30
|
-
} from "./roy-agent-core-
|
|
26
|
+
} from "./roy-agent-core-c7cm1wjt.js";
|
|
31
27
|
import {
|
|
32
28
|
getCurrentTaskId,
|
|
29
|
+
getEnvContext,
|
|
33
30
|
runWithEnvContextAsync
|
|
34
|
-
} from "./roy-agent-core-
|
|
31
|
+
} from "./roy-agent-core-s7bgrtch.js";
|
|
32
|
+
import {
|
|
33
|
+
TracedAs,
|
|
34
|
+
init_decorator
|
|
35
|
+
} from "./roy-agent-core-q5qj0fes.js";
|
|
35
36
|
import {
|
|
36
37
|
createLogger,
|
|
37
38
|
init_logger
|
|
@@ -565,10 +566,12 @@ class AgentComponent extends BaseComponent {
|
|
|
565
566
|
logger.warn(`Failed to load session history: ${err}`);
|
|
566
567
|
}
|
|
567
568
|
}
|
|
569
|
+
const parentEnvContext = getEnvContext();
|
|
568
570
|
const envContext = {
|
|
571
|
+
...parentEnvContext,
|
|
569
572
|
traceId: effectiveContext.metadata?.traceId,
|
|
570
573
|
sessionId: effectiveContext.sessionId,
|
|
571
|
-
userId: effectiveContext.metadata?.userId,
|
|
574
|
+
userId: effectiveContext.metadata?.userId ?? "",
|
|
572
575
|
messageId: effectiveContext.metadata?.messageId,
|
|
573
576
|
pluginEnabled: effectiveContext.pluginEnabled,
|
|
574
577
|
plugins: effectiveContext.plugins,
|
|
@@ -949,14 +952,7 @@ class AgentComponent extends BaseComponent {
|
|
|
949
952
|
}
|
|
950
953
|
logger.info(`Agent aborted: ${agentName}`);
|
|
951
954
|
}
|
|
952
|
-
async
|
|
953
|
-
const messages = [];
|
|
954
|
-
if (ctx.systemPrompt) {
|
|
955
|
-
messages.push({
|
|
956
|
-
role: "system",
|
|
957
|
-
content: ctx.systemPrompt
|
|
958
|
-
});
|
|
959
|
-
}
|
|
955
|
+
async _buildAdditionInfo(ctx) {
|
|
960
956
|
let additionInfo = ctx.context?.additionInfo || "";
|
|
961
957
|
const currentTaskId = getCurrentTaskId();
|
|
962
958
|
if (currentTaskId !== undefined) {
|
|
@@ -965,6 +961,17 @@ class AgentComponent extends BaseComponent {
|
|
|
965
961
|
|
|
966
962
|
${taskInfo}` : taskInfo;
|
|
967
963
|
}
|
|
964
|
+
return additionInfo;
|
|
965
|
+
}
|
|
966
|
+
async buildMessages(ctx) {
|
|
967
|
+
const messages = [];
|
|
968
|
+
if (ctx.systemPrompt) {
|
|
969
|
+
messages.push({
|
|
970
|
+
role: "system",
|
|
971
|
+
content: ctx.systemPrompt
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
const additionInfo = await this._buildAdditionInfo(ctx);
|
|
968
975
|
if (additionInfo) {
|
|
969
976
|
messages.push({
|
|
970
977
|
role: "user",
|
|
@@ -1271,6 +1278,9 @@ __legacyDecorateClassTS([
|
|
|
1271
1278
|
__legacyDecorateClassTS([
|
|
1272
1279
|
TracedAs("agent.component.run", { recordParams: true, recordResult: true, log: true })
|
|
1273
1280
|
], AgentComponent.prototype, "_run", null);
|
|
1281
|
+
__legacyDecorateClassTS([
|
|
1282
|
+
TracedAs("agent.component.buildAdditionInfo", { recordParams: true, recordResult: true, log: true })
|
|
1283
|
+
], AgentComponent.prototype, "_buildAdditionInfo", null);
|
|
1274
1284
|
__legacyDecorateClassTS([
|
|
1275
1285
|
TracedAs("agent.component.invokeLLM", { recordParams: true, recordResult: true, log: true })
|
|
1276
1286
|
], AgentComponent.prototype, "invokeLLM", null);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHook
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-yq4fv8ce.js";
|
|
4
4
|
import {
|
|
5
5
|
HookManager
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-48v06q1b.js";
|
|
7
7
|
|
|
8
8
|
// src/env/component.ts
|
|
9
9
|
class BaseComponent {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_decorator,
|
|
3
|
+
wrapFunction
|
|
4
|
+
} from "./roy-agent-core-q5qj0fes.js";
|
|
5
|
+
import {
|
|
6
|
+
createLogger,
|
|
7
|
+
init_logger
|
|
8
|
+
} from "./roy-agent-core-10n2jh7p.js";
|
|
1
9
|
import {
|
|
2
10
|
__esm
|
|
3
11
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -47,12 +55,17 @@ function mergeEnvContext(partial) {
|
|
|
47
55
|
Object.assign(current, partial);
|
|
48
56
|
}
|
|
49
57
|
}
|
|
50
|
-
|
|
51
|
-
mergeEnvContext({ currentTaskId: taskId });
|
|
52
|
-
}
|
|
53
|
-
var envContextStorage;
|
|
58
|
+
var logger, envContextStorage, setCurrentTaskId;
|
|
54
59
|
var init_env_context = __esm(() => {
|
|
60
|
+
init_logger();
|
|
61
|
+
init_decorator();
|
|
62
|
+
logger = createLogger("env:context:env-context");
|
|
55
63
|
envContextStorage = new AsyncLocalStorage;
|
|
64
|
+
setCurrentTaskId = wrapFunction(function _setCurrentTaskId(taskId) {
|
|
65
|
+
const prev = getCurrentTaskId();
|
|
66
|
+
mergeEnvContext({ currentTaskId: taskId });
|
|
67
|
+
logger.info(`[setCurrentTaskId] taskId=${taskId ?? "undefined"} (was: ${prev ?? "undefined"})`);
|
|
68
|
+
}, "env-context.setCurrentTaskId", { recordParams: true, recordResult: false, log: true });
|
|
56
69
|
});
|
|
57
70
|
|
|
58
71
|
export { envContextStorage, getEnvContext, getEnvContextOrEmpty, hasEnvContext, getCurrentTaskId, runWithEnvContext, runWithEnvContextAsync, createEnvContext, mergeEnvContext, setCurrentTaskId, init_env_context };
|
|
@@ -2,22 +2,22 @@ import {
|
|
|
2
2
|
ContextError,
|
|
3
3
|
ErrorCodes
|
|
4
4
|
} from "./roy-agent-core-ctdhjv68.js";
|
|
5
|
-
import {
|
|
6
|
-
TracedAs,
|
|
7
|
-
init_decorator
|
|
8
|
-
} from "./roy-agent-core-q5qj0fes.js";
|
|
9
5
|
import {
|
|
10
6
|
envKeyToConfigKey,
|
|
11
7
|
toEnvKey
|
|
12
8
|
} from "./roy-agent-core-qxhq8ven.js";
|
|
13
9
|
import {
|
|
14
10
|
BaseComponent
|
|
15
|
-
} from "./roy-agent-core-
|
|
11
|
+
} from "./roy-agent-core-rjf59e7k.js";
|
|
16
12
|
import {
|
|
17
13
|
LLMHookPoints,
|
|
18
14
|
globalHookManager,
|
|
19
15
|
init_global_hook_manager
|
|
20
|
-
} from "./roy-agent-core-
|
|
16
|
+
} from "./roy-agent-core-48v06q1b.js";
|
|
17
|
+
import {
|
|
18
|
+
TracedAs,
|
|
19
|
+
init_decorator
|
|
20
|
+
} from "./roy-agent-core-q5qj0fes.js";
|
|
21
21
|
import {
|
|
22
22
|
createLogger,
|
|
23
23
|
init_logger
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_decorator
|
|
3
|
-
} from "./roy-agent-core-q5qj0fes.js";
|
|
4
1
|
import {
|
|
5
2
|
envKeyToConfigKey
|
|
6
3
|
} from "./roy-agent-core-qxhq8ven.js";
|
|
7
4
|
import {
|
|
8
5
|
BaseComponent
|
|
9
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-rjf59e7k.js";
|
|
7
|
+
import {
|
|
8
|
+
init_decorator
|
|
9
|
+
} from "./roy-agent-core-q5qj0fes.js";
|
|
10
10
|
import {
|
|
11
11
|
createLogger,
|
|
12
12
|
init_logger,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
BackgroundTaskManager,
|
|
6
6
|
createDelegateTool,
|
|
7
7
|
createStopTool
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-m5g2jx7f.js";
|
|
9
9
|
import {
|
|
10
10
|
SQLiteTaskStore,
|
|
11
11
|
getDefaultTaskDbPath
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
getTaskTool,
|
|
18
18
|
listTasksTool,
|
|
19
19
|
updateTaskTool
|
|
20
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-hd6kd06t.js";
|
|
21
21
|
import {
|
|
22
22
|
createOperationTool,
|
|
23
23
|
deleteOperationTool,
|
|
@@ -28,20 +28,20 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
TaskHookPoints
|
|
30
30
|
} from "./roy-agent-core-92z6t4he.js";
|
|
31
|
-
import {
|
|
32
|
-
TracedAs,
|
|
33
|
-
init_decorator
|
|
34
|
-
} from "./roy-agent-core-q5qj0fes.js";
|
|
35
31
|
import {
|
|
36
32
|
envKeyToConfigKey
|
|
37
33
|
} from "./roy-agent-core-qxhq8ven.js";
|
|
38
34
|
import {
|
|
39
35
|
BaseComponent
|
|
40
|
-
} from "./roy-agent-core-
|
|
36
|
+
} from "./roy-agent-core-rjf59e7k.js";
|
|
41
37
|
import {
|
|
42
38
|
globalHookManager,
|
|
43
39
|
init_global_hook_manager
|
|
44
|
-
} from "./roy-agent-core-
|
|
40
|
+
} from "./roy-agent-core-48v06q1b.js";
|
|
41
|
+
import {
|
|
42
|
+
TracedAs,
|
|
43
|
+
init_decorator
|
|
44
|
+
} from "./roy-agent-core-q5qj0fes.js";
|
|
45
45
|
import {
|
|
46
46
|
createLogger,
|
|
47
47
|
init_logger
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
TaskHookPoints
|
|
6
6
|
} from "./roy-agent-core-92z6t4he.js";
|
|
7
|
-
import {
|
|
8
|
-
TracedAs,
|
|
9
|
-
init_decorator
|
|
10
|
-
} from "./roy-agent-core-q5qj0fes.js";
|
|
11
7
|
import {
|
|
12
8
|
init_context
|
|
13
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-c7cm1wjt.js";
|
|
14
10
|
import {
|
|
15
11
|
getEnvContextOrEmpty
|
|
16
|
-
} from "./roy-agent-core-
|
|
12
|
+
} from "./roy-agent-core-s7bgrtch.js";
|
|
13
|
+
import {
|
|
14
|
+
TracedAs,
|
|
15
|
+
init_decorator
|
|
16
|
+
} from "./roy-agent-core-q5qj0fes.js";
|
|
17
17
|
import {
|
|
18
18
|
createLogger,
|
|
19
19
|
init_logger
|