@ai-setting/roy-agent-core 1.6.14 → 1.6.16
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 -10
- package/dist/env/agent/index.js +16 -16
- package/dist/env/commands/index.js +10 -10
- package/dist/env/context/index.js +27 -7
- package/dist/env/debug/index.js +10 -10
- package/dist/env/event-source/index.js +17 -15
- package/dist/env/hook/index.js +8 -8
- package/dist/env/index.js +41 -41
- package/dist/env/llm/index.js +12 -12
- package/dist/env/log-trace/index.js +10 -10
- package/dist/env/mcp/index.js +11 -11
- package/dist/env/mcp/tool/index.js +4 -4
- package/dist/env/memory/index.js +11 -11
- package/dist/env/memory/plugin/index.js +4 -4
- package/dist/env/plugin/index.js +10 -10
- package/dist/env/prompt/index.js +11 -11
- package/dist/env/session/index.js +13 -13
- package/dist/env/session/storage/index.js +6 -6
- package/dist/env/skill/index.js +10 -10
- package/dist/env/task/delegate/index.js +11 -11
- package/dist/env/task/index.js +16 -16
- package/dist/env/task/plugins/index.js +10 -10
- package/dist/env/task/storage/index.js +5 -5
- package/dist/env/task/tools/index.js +6 -6
- package/dist/env/tool/built-in/index.js +6 -6
- package/dist/env/tool/index.js +13 -13
- package/dist/env/workflow/engine/index.js +12 -12
- package/dist/env/workflow/index.js +23 -23
- package/dist/env/workflow/nodes/index.js +5 -5
- package/dist/env/workflow/service/index.js +5 -5
- package/dist/env/workflow/storage/index.js +6 -6
- package/dist/env/workflow/tools/index.js +17 -17
- package/dist/env/workflow/utils/index.js +7 -7
- package/dist/index.js +54 -52
- package/dist/shared/@ai-setting/{roy-agent-core-r74v00c7.js → roy-agent-core-02aw62bv.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-80e4a3g5.js → roy-agent-core-1mrc9a1r.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-xxgazz27.js → roy-agent-core-1qjgwjjs.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-fwxqevpf.js → roy-agent-core-25ngkkpb.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-rga3f0hm.js → roy-agent-core-2b0mw2h3.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-ck0m8754.js → roy-agent-core-416rpxkp.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-c6592r3c.js → roy-agent-core-4an1p9a1.js} +31 -2
- package/dist/shared/@ai-setting/{roy-agent-core-r53regz9.js → roy-agent-core-4z7dzcgb.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-txsswwhm.js → roy-agent-core-5pzegp1x.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-htjag2nr.js → roy-agent-core-77wfej1h.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-resnbd2j.js → roy-agent-core-7kw06e4b.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-yfhgxh5a.js → roy-agent-core-7r72622v.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-dcd1s7ct.js → roy-agent-core-8n0e62y4.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-wpw37qqf.js → roy-agent-core-8v0hzw96.js} +30 -9
- package/dist/shared/@ai-setting/{roy-agent-core-fdm579b1.js → roy-agent-core-96mj6gvc.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-1mq9erp8.js → roy-agent-core-ajp566yv.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-j62bjagf.js → roy-agent-core-akb8mb9v.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-5h49ct1a.js → roy-agent-core-ataagh3a.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-606z25nw.js → roy-agent-core-atpchjdz.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9nhwdq9r.js → roy-agent-core-b8wn8yhk.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-mmb9484f.js → roy-agent-core-bq1gskrf.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-nw39k111.js → roy-agent-core-bqe4c9f2.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-px8ghk4g.js → roy-agent-core-bsxgrqzq.js} +28 -13
- package/dist/shared/@ai-setting/{roy-agent-core-6qbyfzsw.js → roy-agent-core-cfqm5w9b.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-1gsnq4p2.js → roy-agent-core-dh9rajdh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-st9y9z07.js → roy-agent-core-dnns0v64.js} +6 -6
- package/dist/shared/@ai-setting/roy-agent-core-dtkbj8fk.js +206 -0
- package/dist/shared/@ai-setting/{roy-agent-core-8x4ngxcy.js → roy-agent-core-e0kaxcy1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-nv4yfy3m.js → roy-agent-core-eaj0b1hm.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-3kbf53sh.js → roy-agent-core-ehpnd2be.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-psfkwe4g.js → roy-agent-core-ez91vxas.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-jw0hbacv.js → roy-agent-core-fxembepv.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-80bdhnwk.js → roy-agent-core-gc75v3px.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-24rmf17n.js → roy-agent-core-gmnex23m.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-atjd1tpt.js → roy-agent-core-keb51jag.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-7z9b1fm8.js → roy-agent-core-m00kamqp.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-4w6rgxs4.js → roy-agent-core-mdp8y7ky.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-vyygk314.js → roy-agent-core-nna4s0qs.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-f79ee0aw.js → roy-agent-core-p4z6nxgz.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-apz6v22z.js → roy-agent-core-pq1q854s.js} +247 -1
- package/dist/shared/@ai-setting/{roy-agent-core-qbm5zy6s.js → roy-agent-core-pr4jekyy.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-rpq0mcvv.js → roy-agent-core-r0t34bbh.js} +79 -4
- package/dist/shared/@ai-setting/{roy-agent-core-ywtmc0bh.js → roy-agent-core-r15sn7ve.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-9hqqhye6.js → roy-agent-core-sqt96sam.js} +4 -2
- package/dist/shared/@ai-setting/{roy-agent-core-v5nknfh0.js → roy-agent-core-tycbpm17.js} +40 -2
- package/dist/shared/@ai-setting/{roy-agent-core-2yavqjsh.js → roy-agent-core-v20nxrs1.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-dbkkjmqz.js → roy-agent-core-vc7p80sd.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-x7fgze6s.js → roy-agent-core-vkesx61c.js} +4 -4
- package/dist/shared/@ai-setting/roy-agent-core-w6kj6nmj.js +11 -0
- package/dist/shared/@ai-setting/{roy-agent-core-wtbyj0q1.js → roy-agent-core-wr3pk3h3.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-wsqnf2za.js +19 -0
- package/dist/shared/@ai-setting/{roy-agent-core-ra4y7e4p.js → roy-agent-core-x36fsm47.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-w6wagmhw.js → roy-agent-core-xzc53mnk.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fvkyv5j6.js → roy-agent-core-ymz9dgw0.js} +14 -12
- package/dist/shared/@ai-setting/{roy-agent-core-m0cnmg7b.js → roy-agent-core-yqxrekhg.js} +82 -14
- package/dist/shared/@ai-setting/{roy-agent-core-nhncpbzz.js → roy-agent-core-yr3fp8tv.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-m0wp34r4.js → roy-agent-core-z1hm09xp.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9abv4ewh.js → roy-agent-core-zdzkzx5g.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-95bbd2jv.js → roy-agent-core-zs4f0tcy.js} +2 -2
- package/dist/utils/temp-file-manager/index.js +4 -4
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-6jqpdjr4.js +0 -19
- package/dist/shared/@ai-setting/roy-agent-core-endah27g.js +0 -81
- package/dist/shared/@ai-setting/roy-agent-core-qfdj8872.js +0 -11
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
7
7
|
import {
|
|
8
8
|
BaseComponent
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
10
10
|
import {
|
|
11
11
|
createLogger,
|
|
12
12
|
init_logger
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
14
14
|
|
|
15
15
|
// src/env/memory/types.ts
|
|
16
16
|
import { z } from "zod";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
init_context
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-sqt96sam.js";
|
|
4
4
|
import {
|
|
5
5
|
getEnvContext
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-dtkbj8fk.js";
|
|
7
7
|
import {
|
|
8
8
|
__esm
|
|
9
9
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -7,21 +7,21 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
getCurrentProcessRegistry,
|
|
9
9
|
killProcessTree
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-eaj0b1hm.js";
|
|
11
11
|
import {
|
|
12
12
|
init_decorator,
|
|
13
13
|
wrapFunction
|
|
14
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
15
15
|
import {
|
|
16
16
|
createLogger,
|
|
17
17
|
init_logger
|
|
18
|
-
} from "./roy-agent-core-
|
|
18
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
19
19
|
import {
|
|
20
20
|
exports_tracer_provider,
|
|
21
21
|
init_propagation,
|
|
22
22
|
init_tracer_provider,
|
|
23
23
|
propagation
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-m00kamqp.js";
|
|
25
25
|
import {
|
|
26
26
|
__toCommonJS
|
|
27
27
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TagRepository
|
|
3
|
+
} from "./roy-agent-core-atpchjdz.js";
|
|
4
|
+
import"./roy-agent-core-96mj6gvc.js";
|
|
5
|
+
import"./roy-agent-core-nna4s0qs.js";
|
|
6
|
+
import"./roy-agent-core-m00kamqp.js";
|
|
7
|
+
import"./roy-agent-core-4an1p9a1.js";
|
|
8
|
+
import"./roy-agent-core-fs0mn2jk.js";
|
|
9
|
+
export {
|
|
10
|
+
TagRepository
|
|
11
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentComponentAdapter,
|
|
3
|
+
init_agent_component_adapter
|
|
4
|
+
} from "./roy-agent-core-gmnex23m.js";
|
|
5
|
+
import"./roy-agent-core-1db4vpc6.js";
|
|
6
|
+
import"./roy-agent-core-e25xkv53.js";
|
|
7
|
+
import"./roy-agent-core-vc7p80sd.js";
|
|
8
|
+
import"./roy-agent-core-sqt96sam.js";
|
|
9
|
+
import"./roy-agent-core-dtkbj8fk.js";
|
|
10
|
+
import"./roy-agent-core-96mj6gvc.js";
|
|
11
|
+
import"./roy-agent-core-nna4s0qs.js";
|
|
12
|
+
import"./roy-agent-core-m00kamqp.js";
|
|
13
|
+
import"./roy-agent-core-4an1p9a1.js";
|
|
14
|
+
import"./roy-agent-core-fs0mn2jk.js";
|
|
15
|
+
init_agent_component_adapter();
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
AgentComponentAdapter
|
|
19
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exports_node_registry_helper,
|
|
3
3
|
init_node_registry_helper
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-77wfej1h.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowEngine,
|
|
7
7
|
exports_engine,
|
|
8
8
|
init_engine
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-yr3fp8tv.js";
|
|
10
10
|
import {
|
|
11
11
|
askUserTool,
|
|
12
12
|
createRunWorkflowTool,
|
|
@@ -18,17 +18,17 @@ import {
|
|
|
18
18
|
createWorkflowSearchTool,
|
|
19
19
|
createWorkflowTagListTool,
|
|
20
20
|
createWorkflowValidateTool
|
|
21
|
-
} from "./roy-agent-core-
|
|
21
|
+
} from "./roy-agent-core-4z7dzcgb.js";
|
|
22
22
|
import {
|
|
23
23
|
WorkflowService
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-r15sn7ve.js";
|
|
25
25
|
import {
|
|
26
26
|
BaseComponent
|
|
27
|
-
} from "./roy-agent-core-
|
|
27
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
28
28
|
import {
|
|
29
29
|
createLogger,
|
|
30
30
|
init_logger
|
|
31
|
-
} from "./roy-agent-core-
|
|
31
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
32
32
|
import {
|
|
33
33
|
__require,
|
|
34
34
|
__toCommonJS
|
|
@@ -104,7 +104,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
104
104
|
return;
|
|
105
105
|
try {
|
|
106
106
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
107
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
107
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-p4z6nxgz.js");
|
|
108
108
|
this.nodeRegistry = new NodeRegistry;
|
|
109
109
|
registerDecoratorNodeType2(this.nodeRegistry);
|
|
110
110
|
this.decoratorsRegistered = true;
|
|
@@ -134,14 +134,14 @@ class WorkflowComponent extends BaseComponent {
|
|
|
134
134
|
}
|
|
135
135
|
async runWorkflow(definition, input, options) {
|
|
136
136
|
const { NodeRegistry } = await import("../../env/workflow/engine/index.js");
|
|
137
|
-
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-
|
|
137
|
+
const { registerDecoratorNodeType: registerDecoratorNodeType2 } = await import("./roy-agent-core-p4z6nxgz.js");
|
|
138
138
|
const toolComponent = this.toolComponent || this._workflowEnv?.getComponent("tool");
|
|
139
139
|
const skillComponent = this._workflowEnv?.getComponent("skill");
|
|
140
140
|
let agentRunner = this.agentRunner;
|
|
141
141
|
if (!agentRunner && this._workflowEnv) {
|
|
142
142
|
const agentComponent = this._workflowEnv.getComponent("agent");
|
|
143
143
|
if (agentComponent) {
|
|
144
|
-
const { AgentComponentAdapter } = await import("./roy-agent-core-
|
|
144
|
+
const { AgentComponentAdapter } = await import("./roy-agent-core-wsqnf2za.js");
|
|
145
145
|
agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -163,7 +163,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
163
163
|
if (this.workflowService) {
|
|
164
164
|
this.workflowService = null;
|
|
165
165
|
try {
|
|
166
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
166
|
+
const { closeDatabase } = await import("./roy-agent-core-pr4jekyy.js");
|
|
167
167
|
closeDatabase();
|
|
168
168
|
componentLogger.info("[WorkflowComponent] SQLite database closed");
|
|
169
169
|
} catch (error) {
|
|
@@ -241,9 +241,9 @@ class WorkflowComponent extends BaseComponent {
|
|
|
241
241
|
}
|
|
242
242
|
async initSqliteService() {
|
|
243
243
|
try {
|
|
244
|
-
const { getDatabase, initializeTables } = await import("./roy-agent-core-
|
|
245
|
-
const { WorkflowRepository } = await import("./roy-agent-core-
|
|
246
|
-
const { TagRepository } = await import("./roy-agent-core-
|
|
244
|
+
const { getDatabase, initializeTables } = await import("./roy-agent-core-pr4jekyy.js");
|
|
245
|
+
const { WorkflowRepository } = await import("./roy-agent-core-fxembepv.js");
|
|
246
|
+
const { TagRepository } = await import("./roy-agent-core-w6kj6nmj.js");
|
|
247
247
|
const db = getDatabase();
|
|
248
248
|
initializeTables();
|
|
249
249
|
const workflowRepository = new WorkflowRepository(db);
|
|
@@ -309,7 +309,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
309
309
|
this.workflowService = null;
|
|
310
310
|
this.nodeRegistry = null;
|
|
311
311
|
try {
|
|
312
|
-
const { closeDatabase } = await import("./roy-agent-core-
|
|
312
|
+
const { closeDatabase } = await import("./roy-agent-core-pr4jekyy.js");
|
|
313
313
|
closeDatabase();
|
|
314
314
|
} catch {}
|
|
315
315
|
this._status = "stopped";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
getTracerProvider,
|
|
4
4
|
init_tracer_provider,
|
|
5
5
|
resetTracerProvider
|
|
6
|
-
} from "./roy-agent-core-
|
|
7
|
-
import"./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-m00kamqp.js";
|
|
7
|
+
import"./roy-agent-core-4an1p9a1.js";
|
|
8
8
|
import"./roy-agent-core-fs0mn2jk.js";
|
|
9
9
|
init_tracer_provider();
|
|
10
10
|
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withTimeout
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-8n0e62y4.js";
|
|
4
4
|
import {
|
|
5
5
|
truncateOutputInline
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-b8wn8yhk.js";
|
|
7
7
|
import {
|
|
8
8
|
AskUserError,
|
|
9
9
|
init_workflow_hil
|
|
10
10
|
} from "./roy-agent-core-e25xkv53.js";
|
|
11
11
|
import {
|
|
12
12
|
AgentRegistry
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-tycbpm17.js";
|
|
14
14
|
import {
|
|
15
15
|
ContextError
|
|
16
16
|
} from "./roy-agent-core-ctdhjv68.js";
|
|
17
17
|
import {
|
|
18
18
|
SessionMessageConverter
|
|
19
|
-
} from "./roy-agent-core-
|
|
19
|
+
} from "./roy-agent-core-7r72622v.js";
|
|
20
20
|
import {
|
|
21
21
|
safeParseToolArgs
|
|
22
|
-
} from "./roy-agent-core-
|
|
22
|
+
} from "./roy-agent-core-e0kaxcy1.js";
|
|
23
23
|
import {
|
|
24
24
|
envKeyToConfigKey
|
|
25
25
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
26
26
|
import {
|
|
27
27
|
BaseComponent
|
|
28
|
-
} from "./roy-agent-core-
|
|
28
|
+
} from "./roy-agent-core-akb8mb9v.js";
|
|
29
29
|
import {
|
|
30
30
|
globalHookManager,
|
|
31
31
|
init_global_hook_manager
|
|
32
|
-
} from "./roy-agent-core-
|
|
32
|
+
} from "./roy-agent-core-vc7p80sd.js";
|
|
33
33
|
import {
|
|
34
34
|
init_context
|
|
35
|
-
} from "./roy-agent-core-
|
|
35
|
+
} from "./roy-agent-core-sqt96sam.js";
|
|
36
36
|
import {
|
|
37
37
|
getCurrentTaskId,
|
|
38
38
|
getEnvContext,
|
|
39
39
|
runWithEnvContextAsync
|
|
40
|
-
} from "./roy-agent-core-
|
|
40
|
+
} from "./roy-agent-core-dtkbj8fk.js";
|
|
41
41
|
import {
|
|
42
42
|
TracedAs,
|
|
43
43
|
init_decorator
|
|
44
|
-
} from "./roy-agent-core-
|
|
44
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
45
45
|
import {
|
|
46
46
|
createLogger,
|
|
47
47
|
init_logger
|
|
48
|
-
} from "./roy-agent-core-
|
|
48
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
49
49
|
import {
|
|
50
50
|
__legacyDecorateClassTS,
|
|
51
51
|
__require
|
|
@@ -363,6 +363,8 @@ class AgentComponent extends BaseComponent {
|
|
|
363
363
|
logger.info(`[AgentComponent] Loaded ${loadedCount} agents from config directory`);
|
|
364
364
|
this.registry.registerWorkflowRunner();
|
|
365
365
|
logger.info("[AgentComponent] Registered built-in workflow-runner");
|
|
366
|
+
this.registry.registerTaskOrganizer();
|
|
367
|
+
logger.info("[AgentComponent] Registered built-in task-organizer");
|
|
366
368
|
this.registry.registerJsonExtractAgent();
|
|
367
369
|
logger.info("[AgentComponent] Registered built-in json-extract agent");
|
|
368
370
|
this.registry.registerWorkflowCreator();
|
|
@@ -739,7 +741,7 @@ class AgentComponent extends BaseComponent {
|
|
|
739
741
|
traceId: effectiveContext.metadata?.traceId,
|
|
740
742
|
sessionId: effectiveContext.sessionId,
|
|
741
743
|
userId: parentEnvContext?.userId ?? (effectiveContext.metadata?.userId ?? ""),
|
|
742
|
-
messageId: effectiveContext.metadata?.messageId,
|
|
744
|
+
messageId: parentEnvContext?.messageId ?? effectiveContext.metadata?.messageId,
|
|
743
745
|
pluginEnabled: { ...parentEnvContext?.pluginEnabled ?? {}, ...effectiveContext.pluginEnabled ?? {} },
|
|
744
746
|
plugins: effectiveContext.plugins,
|
|
745
747
|
envEvent: effectiveContext.envEvent ?? parentEnvContext?.envEvent,
|
|
@@ -3,28 +3,31 @@ import {
|
|
|
3
3
|
} from "./roy-agent-core-az13yzmc.js";
|
|
4
4
|
import {
|
|
5
5
|
validateWorkflowDefinition
|
|
6
|
-
} from "./roy-agent-core-
|
|
6
|
+
} from "./roy-agent-core-1mrc9a1r.js";
|
|
7
7
|
import {
|
|
8
8
|
WORKFLOW_EXTRACT_PROMPT
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-pq1q854s.js";
|
|
10
10
|
import {
|
|
11
11
|
TaskHookPoints
|
|
12
12
|
} from "./roy-agent-core-1pg0fepg.js";
|
|
13
13
|
import {
|
|
14
14
|
init_context
|
|
15
|
-
} from "./roy-agent-core-
|
|
15
|
+
} from "./roy-agent-core-sqt96sam.js";
|
|
16
16
|
import {
|
|
17
|
-
getEnvContextOrEmpty
|
|
18
|
-
|
|
17
|
+
getEnvContextOrEmpty,
|
|
18
|
+
getEventFromEnvContext,
|
|
19
|
+
getLarkMessageId,
|
|
20
|
+
isLarkEvent
|
|
21
|
+
} from "./roy-agent-core-dtkbj8fk.js";
|
|
19
22
|
import {
|
|
20
23
|
TracedAs,
|
|
21
24
|
init_decorator,
|
|
22
25
|
wrapFunction
|
|
23
|
-
} from "./roy-agent-core-
|
|
26
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
24
27
|
import {
|
|
25
28
|
createLogger,
|
|
26
29
|
init_logger
|
|
27
|
-
} from "./roy-agent-core-
|
|
30
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
28
31
|
import {
|
|
29
32
|
__legacyDecorateClassTS,
|
|
30
33
|
__require
|
|
@@ -289,11 +292,11 @@ ${prompt}`;
|
|
|
289
292
|
}
|
|
290
293
|
if (!this._workflowRepo) {
|
|
291
294
|
try {
|
|
292
|
-
const sqlite = await import("./roy-agent-core-
|
|
295
|
+
const sqlite = await import("./roy-agent-core-pr4jekyy.js");
|
|
293
296
|
this.ensureDataDir();
|
|
294
297
|
const db = sqlite.getDatabase();
|
|
295
298
|
sqlite.initializeTables();
|
|
296
|
-
const { WorkflowRepository } = await import("./roy-agent-core-
|
|
299
|
+
const { WorkflowRepository } = await import("./roy-agent-core-fxembepv.js");
|
|
297
300
|
this._workflowRepo = new WorkflowRepository(db);
|
|
298
301
|
return this._workflowRepo;
|
|
299
302
|
} catch {
|
|
@@ -378,6 +381,19 @@ var logger3 = createLogger("lark-cli:task-notify");
|
|
|
378
381
|
function isTaskNotifyDebugEnabled() {
|
|
379
382
|
return process.env.ROY_TASK_NOTIFY_DEBUG === "1" || process.env.ROY_TRACE_DEBUG === "1";
|
|
380
383
|
}
|
|
384
|
+
function extractLarkFields(env) {
|
|
385
|
+
const event = getEventFromEnvContext(env);
|
|
386
|
+
if (!isLarkEvent(event)) {
|
|
387
|
+
return { isLark: false };
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
isLark: true,
|
|
391
|
+
source: event.source,
|
|
392
|
+
messageId: getLarkMessageId(event) ?? env.replyChannel?.messageId,
|
|
393
|
+
chatId: env.replyChannel?.chatId,
|
|
394
|
+
userId: env.replyChannel?.userId
|
|
395
|
+
};
|
|
396
|
+
}
|
|
381
397
|
var NotifyType;
|
|
382
398
|
((NotifyType2) => {
|
|
383
399
|
NotifyType2["TASK_CREATED"] = "task_created";
|
|
@@ -510,6 +526,11 @@ class LarkCliTaskNotifyHook {
|
|
|
510
526
|
if (!replyChannel && _hookContext?.metadata?.envContext) {
|
|
511
527
|
replyChannel = _hookContext.metadata.envContext.replyChannel;
|
|
512
528
|
}
|
|
529
|
+
const larkFields = extractLarkFields(env);
|
|
530
|
+
if (!larkFields.isLark && env.event) {
|
|
531
|
+
logger3.debug(`Skipping notification for non-lark event source: ${larkFields.source}`);
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
513
534
|
const chatId = replyChannel?.chatId;
|
|
514
535
|
const messageId = replyChannel?.messageId;
|
|
515
536
|
if (!chatId && !messageId) {
|
|
@@ -593,11 +614,56 @@ ${content}`;
|
|
|
593
614
|
return text;
|
|
594
615
|
return text.substring(0, maxLen) + "...";
|
|
595
616
|
}
|
|
596
|
-
|
|
617
|
+
appendSpatiotemporalContextLines(lines, task, options = {}) {
|
|
597
618
|
if (task?.project_path) {
|
|
598
|
-
lines.push(`-
|
|
619
|
+
lines.push(`- \uD83D\uDCC2 项目路径: \`${task.project_path}\``);
|
|
620
|
+
}
|
|
621
|
+
const ctxStr = task?.context;
|
|
622
|
+
let parsedCtx = null;
|
|
623
|
+
if (typeof ctxStr === "string" && ctxStr.length > 0) {
|
|
624
|
+
try {
|
|
625
|
+
const obj = JSON.parse(ctxStr);
|
|
626
|
+
if (obj && typeof obj === "object" && !Array.isArray(obj)) {
|
|
627
|
+
parsedCtx = obj;
|
|
628
|
+
}
|
|
629
|
+
} catch {}
|
|
630
|
+
}
|
|
631
|
+
if (!parsedCtx) {
|
|
632
|
+
if (options.appendFullContext && typeof ctxStr === "string") {
|
|
633
|
+
lines.push(`- \uD83D\uDCCB 完整 context: \`${this.truncate(ctxStr, 200)}\``);
|
|
634
|
+
}
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
if (parsedCtx.worktree_path && typeof parsedCtx.worktree_path === "string") {
|
|
638
|
+
lines.push(`- \uD83C\uDF3F Worktree: \`${parsedCtx.worktree_path}\``);
|
|
639
|
+
}
|
|
640
|
+
if (parsedCtx.created_at && typeof parsedCtx.created_at === "string") {
|
|
641
|
+
lines.push(`- ⏰ 时间上下文: ${parsedCtx.created_at}`);
|
|
642
|
+
}
|
|
643
|
+
if (parsedCtx.prior_context && typeof parsedCtx.prior_context === "object") {
|
|
644
|
+
const priorStr = this.formatPriorContext(parsedCtx.prior_context);
|
|
645
|
+
if (priorStr) {
|
|
646
|
+
lines.push(`- \uD83D\uDCDC 背景: ${priorStr}`);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
if (options.appendFullContext) {
|
|
650
|
+
lines.push(`- \uD83D\uDCCB 完整 context: \`${this.truncate(JSON.stringify(parsedCtx), 300)}\``);
|
|
599
651
|
}
|
|
600
652
|
}
|
|
653
|
+
formatPriorContext(prior) {
|
|
654
|
+
if (!prior || typeof prior !== "object")
|
|
655
|
+
return "";
|
|
656
|
+
const entries = [];
|
|
657
|
+
for (const [k, v] of Object.entries(prior)) {
|
|
658
|
+
if (v === null || v === undefined)
|
|
659
|
+
continue;
|
|
660
|
+
const s = typeof v === "object" ? JSON.stringify(v) : String(v);
|
|
661
|
+
if (s === "" || s === "undefined")
|
|
662
|
+
continue;
|
|
663
|
+
entries.push(`${k}=${s}`);
|
|
664
|
+
}
|
|
665
|
+
return entries.join(", ");
|
|
666
|
+
}
|
|
601
667
|
shouldNotify(type) {
|
|
602
668
|
const { notifyTypes } = this.config;
|
|
603
669
|
if (notifyTypes && notifyTypes.length === 0)
|
|
@@ -636,7 +702,7 @@ ${content}`;
|
|
|
636
702
|
if (task.priority) {
|
|
637
703
|
lines.push(`- **优先级**: ${task.priority}`);
|
|
638
704
|
}
|
|
639
|
-
this.
|
|
705
|
+
this.appendSpatiotemporalContextLines(lines, task);
|
|
640
706
|
return lines.join(`
|
|
641
707
|
`);
|
|
642
708
|
}
|
|
@@ -655,7 +721,7 @@ ${content}`;
|
|
|
655
721
|
if (changes?.current_status) {
|
|
656
722
|
lines.push(`- **当前状态**: ${changes.current_status}`);
|
|
657
723
|
}
|
|
658
|
-
this.
|
|
724
|
+
this.appendSpatiotemporalContextLines(lines, task);
|
|
659
725
|
const changeKeys = Object.keys(changes || {}).filter((k) => !["status", "progress", "current_status"].includes(k));
|
|
660
726
|
if (changeKeys.length > 0) {
|
|
661
727
|
lines.push(`- **变更**: ${changeKeys.join(", ")}`);
|
|
@@ -699,7 +765,9 @@ ${content}`;
|
|
|
699
765
|
if (operation.processDescription) {
|
|
700
766
|
lines.push(`- **过程概要**: ${this.truncate(String(operation.processDescription), 200)}`);
|
|
701
767
|
}
|
|
702
|
-
this.
|
|
768
|
+
this.appendSpatiotemporalContextLines(lines, resolvedTask, {
|
|
769
|
+
appendFullContext: true
|
|
770
|
+
});
|
|
703
771
|
if (operation.sessionId) {
|
|
704
772
|
lines.push(`- **Session**: \`${operation.sessionId}\``);
|
|
705
773
|
}
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
AgentComponentAdapter,
|
|
9
9
|
init_agent_component_adapter
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-gmnex23m.js";
|
|
11
11
|
import {
|
|
12
12
|
TemplateResolver,
|
|
13
13
|
init_template_resolver
|
|
14
|
-
} from "./roy-agent-core-
|
|
14
|
+
} from "./roy-agent-core-ez91vxas.js";
|
|
15
15
|
import {
|
|
16
16
|
PythonCallNode,
|
|
17
17
|
SkillNode,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
init_skill_node,
|
|
22
22
|
init_tool_node,
|
|
23
23
|
init_workflow_node
|
|
24
|
-
} from "./roy-agent-core-
|
|
24
|
+
} from "./roy-agent-core-7kw06e4b.js";
|
|
25
25
|
import {
|
|
26
26
|
WORKFLOW_SUBMIT_OUTPUT_TOOL_NAME,
|
|
27
27
|
init_json_schema_to_zod,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
DAGManager,
|
|
35
35
|
init_dag_manager
|
|
36
|
-
} from "./roy-agent-core-
|
|
36
|
+
} from "./roy-agent-core-bq1gskrf.js";
|
|
37
37
|
import {
|
|
38
38
|
WorkflowError,
|
|
39
39
|
createWorkflowEvent,
|
|
@@ -49,11 +49,11 @@ import {
|
|
|
49
49
|
import {
|
|
50
50
|
TracedAs,
|
|
51
51
|
init_decorator
|
|
52
|
-
} from "./roy-agent-core-
|
|
52
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
53
53
|
import {
|
|
54
54
|
createLogger,
|
|
55
55
|
init_logger
|
|
56
|
-
} from "./roy-agent-core-
|
|
56
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
57
57
|
import {
|
|
58
58
|
__esm,
|
|
59
59
|
__export,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TracedAs,
|
|
3
3
|
init_decorator
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-96mj6gvc.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger,
|
|
7
7
|
init_logger
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
9
9
|
import {
|
|
10
10
|
__esm,
|
|
11
11
|
__export,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SessionMessageConverter
|
|
3
|
-
} from "./roy-agent-core-
|
|
3
|
+
} from "./roy-agent-core-7r72622v.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogger,
|
|
6
6
|
init_logger
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-nna4s0qs.js";
|
|
8
8
|
import {
|
|
9
9
|
__require
|
|
10
10
|
} from "./roy-agent-core-fs0mn2jk.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TempFileManager
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
4
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
5
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
6
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-ataagh3a.js";
|
|
4
|
+
import"../../shared/@ai-setting/roy-agent-core-nna4s0qs.js";
|
|
5
|
+
import"../../shared/@ai-setting/roy-agent-core-m00kamqp.js";
|
|
6
|
+
import"../../shared/@ai-setting/roy-agent-core-4an1p9a1.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
8
8
|
export {
|
|
9
9
|
TempFileManager
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AgentComponentAdapter,
|
|
3
|
-
init_agent_component_adapter
|
|
4
|
-
} from "./roy-agent-core-24rmf17n.js";
|
|
5
|
-
import"./roy-agent-core-1db4vpc6.js";
|
|
6
|
-
import"./roy-agent-core-e25xkv53.js";
|
|
7
|
-
import"./roy-agent-core-dbkkjmqz.js";
|
|
8
|
-
import"./roy-agent-core-9hqqhye6.js";
|
|
9
|
-
import"./roy-agent-core-endah27g.js";
|
|
10
|
-
import"./roy-agent-core-fdm579b1.js";
|
|
11
|
-
import"./roy-agent-core-vyygk314.js";
|
|
12
|
-
import"./roy-agent-core-7z9b1fm8.js";
|
|
13
|
-
import"./roy-agent-core-c6592r3c.js";
|
|
14
|
-
import"./roy-agent-core-fs0mn2jk.js";
|
|
15
|
-
init_agent_component_adapter();
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
AgentComponentAdapter
|
|
19
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
init_decorator,
|
|
3
|
-
wrapFunction
|
|
4
|
-
} from "./roy-agent-core-fdm579b1.js";
|
|
5
|
-
import {
|
|
6
|
-
createLogger,
|
|
7
|
-
init_logger
|
|
8
|
-
} from "./roy-agent-core-vyygk314.js";
|
|
9
|
-
import {
|
|
10
|
-
__esm
|
|
11
|
-
} from "./roy-agent-core-fs0mn2jk.js";
|
|
12
|
-
|
|
13
|
-
// src/env/context/env-context.ts
|
|
14
|
-
import { AsyncLocalStorage } from "async_hooks";
|
|
15
|
-
function getEnvContext() {
|
|
16
|
-
return envContextStorage.getStore();
|
|
17
|
-
}
|
|
18
|
-
function getEnvContextOrEmpty() {
|
|
19
|
-
return envContextStorage.getStore() || {};
|
|
20
|
-
}
|
|
21
|
-
function hasEnvContext() {
|
|
22
|
-
return envContextStorage.getStore() !== undefined;
|
|
23
|
-
}
|
|
24
|
-
function getCurrentTaskId() {
|
|
25
|
-
return envContextStorage.getStore()?.agentContext?.currentTaskId;
|
|
26
|
-
}
|
|
27
|
-
function runWithEnvContext(context, fn) {
|
|
28
|
-
if (context) {
|
|
29
|
-
return envContextStorage.run(context, fn);
|
|
30
|
-
}
|
|
31
|
-
return fn();
|
|
32
|
-
}
|
|
33
|
-
async function runWithEnvContextAsync(context, fn) {
|
|
34
|
-
if (context) {
|
|
35
|
-
return envContextStorage.run(context, fn);
|
|
36
|
-
}
|
|
37
|
-
return fn();
|
|
38
|
-
}
|
|
39
|
-
function createEnvContext(options) {
|
|
40
|
-
return {
|
|
41
|
-
envEvent: options.envEvent,
|
|
42
|
-
sourceId: options.sourceId,
|
|
43
|
-
userId: options.userId,
|
|
44
|
-
traceId: options.traceId ?? crypto.randomUUID(),
|
|
45
|
-
requestId: options.requestId ?? crypto.randomUUID(),
|
|
46
|
-
replyChannel: options.replyChannel,
|
|
47
|
-
pluginEnabled: options.pluginEnabled,
|
|
48
|
-
plugins: options.plugins,
|
|
49
|
-
timestamp: options.timestamp ?? Date.now()
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function mergeEnvContext(partial) {
|
|
53
|
-
const current = envContextStorage.getStore();
|
|
54
|
-
if (current) {
|
|
55
|
-
if (partial.agentContext && current.agentContext) {
|
|
56
|
-
Object.assign(current.agentContext, partial.agentContext);
|
|
57
|
-
delete partial.agentContext;
|
|
58
|
-
}
|
|
59
|
-
Object.assign(current, partial);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
var logger, envContextStorage, setCurrentTaskId;
|
|
63
|
-
var init_env_context = __esm(() => {
|
|
64
|
-
init_logger();
|
|
65
|
-
init_decorator();
|
|
66
|
-
logger = createLogger("env:context:env-context");
|
|
67
|
-
envContextStorage = new AsyncLocalStorage;
|
|
68
|
-
setCurrentTaskId = wrapFunction(function _setCurrentTaskId(taskId) {
|
|
69
|
-
const prev = getCurrentTaskId();
|
|
70
|
-
const ctx = envContextStorage.getStore();
|
|
71
|
-
if (ctx) {
|
|
72
|
-
if (!ctx.agentContext) {
|
|
73
|
-
ctx.agentContext = {};
|
|
74
|
-
}
|
|
75
|
-
ctx.agentContext.currentTaskId = taskId;
|
|
76
|
-
}
|
|
77
|
-
logger.info(`[setCurrentTaskId] taskId=${taskId ?? "undefined"} (was: ${prev ?? "undefined"})`);
|
|
78
|
-
}, "env-context.setCurrentTaskId", { recordParams: true, recordResult: false, log: true });
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export { envContextStorage, getEnvContext, getEnvContextOrEmpty, hasEnvContext, getCurrentTaskId, runWithEnvContext, runWithEnvContextAsync, createEnvContext, mergeEnvContext, setCurrentTaskId, init_env_context };
|