@ai-setting/roy-agent-core 1.5.102 → 1.5.104
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/env/event-source/index.js +4 -4
- package/dist/env/index.js +10 -10
- package/dist/env/prompt/index.js +2 -2
- package/dist/env/session/index.js +2 -2
- package/dist/env/session/storage/index.js +1 -1
- package/dist/env/task/delegate/index.js +3 -3
- package/dist/env/task/hooks/index.js +1 -1
- package/dist/env/task/index.js +4 -4
- package/dist/env/task/plugins/index.js +3 -3
- package/dist/env/workflow/engine/index.js +2 -2
- package/dist/env/workflow/index.js +4 -4
- package/dist/env/workflow/tools/index.js +1 -1
- package/dist/index.js +13 -13
- package/dist/shared/@ai-setting/{roy-agent-core-92z6t4he.js → roy-agent-core-1pg0fepg.js} +1 -0
- package/dist/shared/@ai-setting/{roy-agent-core-ac18e14n.js → roy-agent-core-1qbny05x.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-j3qb695p.js → roy-agent-core-30k2bms9.js} +30 -2
- package/dist/shared/@ai-setting/{roy-agent-core-81j8yhsw.js → roy-agent-core-57bmm0a1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-fx1fdzbz.js → roy-agent-core-95bbd2jv.js} +12 -3
- package/dist/shared/@ai-setting/{roy-agent-core-wg0zvwx0.js → roy-agent-core-g17zc2kf.js} +29 -2
- package/dist/shared/@ai-setting/{roy-agent-core-vb9aa3kf.js → roy-agent-core-gabw591f.js} +34 -0
- package/dist/shared/@ai-setting/{roy-agent-core-s22egcxa.js → roy-agent-core-gdhcj2x4.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-0ger6zdn.js → roy-agent-core-h5qsyzck.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9ga65zcv.js → roy-agent-core-hq4pqava.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ac0bc4x0.js → roy-agent-core-hzjgv9wd.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-s10azh5q.js → roy-agent-core-jy5hkjtb.js} +47 -18
- package/dist/shared/@ai-setting/{roy-agent-core-b4sbnec8.js → roy-agent-core-kbasdf13.js} +4 -2
- package/dist/shared/@ai-setting/{roy-agent-core-phq62515.js → roy-agent-core-q8n1s1pb.js} +1 -0
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
larkCliHandler,
|
|
11
11
|
resolveBountyIMSystemPrompt,
|
|
12
12
|
timerHandler
|
|
13
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
13
|
+
} from "../../shared/@ai-setting/roy-agent-core-hq4pqava.js";
|
|
14
14
|
import {
|
|
15
15
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
16
16
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
validateEventSourceConfig
|
|
22
22
|
} from "../../shared/@ai-setting/roy-agent-core-ds5f75pg.js";
|
|
23
23
|
import"../../shared/@ai-setting/roy-agent-core-wmkx79b1.js";
|
|
24
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
24
|
+
import"../../shared/@ai-setting/roy-agent-core-gdhcj2x4.js";
|
|
25
25
|
import"../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
26
26
|
import"../../shared/@ai-setting/roy-agent-core-8wd3qwx5.js";
|
|
27
27
|
import"../../shared/@ai-setting/roy-agent-core-4yq23m5g.js";
|
|
28
28
|
import"../../shared/@ai-setting/roy-agent-core-xjdcx45t.js";
|
|
29
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
30
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
29
|
+
import"../../shared/@ai-setting/roy-agent-core-gabw591f.js";
|
|
30
|
+
import"../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
31
31
|
import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
|
|
32
32
|
import"../../shared/@ai-setting/roy-agent-core-pf1c360e.js";
|
|
33
33
|
import"../../shared/@ai-setting/roy-agent-core-ksx9a556.js";
|
package/dist/env/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
EventSourceComponent,
|
|
6
6
|
builtInHandlers,
|
|
7
7
|
larkCliHandler
|
|
8
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
} from "../shared/@ai-setting/roy-agent-core-hq4pqava.js";
|
|
9
9
|
import {
|
|
10
10
|
EventSourceInitHooks,
|
|
11
11
|
getDefaultConfigForType,
|
|
@@ -17,21 +17,21 @@ import"../shared/@ai-setting/roy-agent-core-wmkx79b1.js";
|
|
|
17
17
|
import {
|
|
18
18
|
PluginComponent
|
|
19
19
|
} from "../shared/@ai-setting/roy-agent-core-ws76avbn.js";
|
|
20
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
20
|
+
import"../shared/@ai-setting/roy-agent-core-gdhcj2x4.js";
|
|
21
21
|
import"../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
22
22
|
import {
|
|
23
23
|
WorkflowComponent
|
|
24
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
24
|
+
} from "../shared/@ai-setting/roy-agent-core-hzjgv9wd.js";
|
|
25
25
|
import"../shared/@ai-setting/roy-agent-core-xgnpr28w.js";
|
|
26
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
26
|
+
import"../shared/@ai-setting/roy-agent-core-kbasdf13.js";
|
|
27
27
|
import"../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
28
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
28
|
+
import"../shared/@ai-setting/roy-agent-core-q8n1s1pb.js";
|
|
29
29
|
import"../shared/@ai-setting/roy-agent-core-q88vxmx5.js";
|
|
30
30
|
import"../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
31
31
|
import"../shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
32
32
|
import"../shared/@ai-setting/roy-agent-core-g2mth323.js";
|
|
33
33
|
import"../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
|
|
34
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
34
|
+
import"../shared/@ai-setting/roy-agent-core-30k2bms9.js";
|
|
35
35
|
import"../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
36
36
|
import"../shared/@ai-setting/roy-agent-core-e7t3rj0e.js";
|
|
37
37
|
import"../shared/@ai-setting/roy-agent-core-8wd3qwx5.js";
|
|
@@ -49,12 +49,12 @@ import"../shared/@ai-setting/roy-agent-core-xjdcx45t.js";
|
|
|
49
49
|
import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
50
50
|
import {
|
|
51
51
|
TaskComponent
|
|
52
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
52
|
+
} from "../shared/@ai-setting/roy-agent-core-g17zc2kf.js";
|
|
53
53
|
import"../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
54
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
54
|
+
import"../shared/@ai-setting/roy-agent-core-jy5hkjtb.js";
|
|
55
55
|
import"../shared/@ai-setting/roy-agent-core-pzeexnhf.js";
|
|
56
56
|
import"../shared/@ai-setting/roy-agent-core-9xby523m.js";
|
|
57
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
57
|
+
import"../shared/@ai-setting/roy-agent-core-gabw591f.js";
|
|
58
58
|
import"../shared/@ai-setting/roy-agent-core-k31c3kvz.js";
|
|
59
59
|
import {
|
|
60
60
|
XDG_PATHS,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
} from "../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
64
64
|
import"../shared/@ai-setting/roy-agent-core-0ye4q2jj.js";
|
|
65
65
|
import"../shared/@ai-setting/roy-agent-core-t94ktchq.js";
|
|
66
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
66
|
+
import"../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
67
67
|
import {
|
|
68
68
|
McpComponent
|
|
69
69
|
} from "../shared/@ai-setting/roy-agent-core-bqwj1dq0.js";
|
package/dist/env/prompt/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
PromptConfigSchema,
|
|
4
4
|
PromptPathSchema,
|
|
5
5
|
PromptRenderer
|
|
6
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
7
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../shared/@ai-setting/roy-agent-core-1qbny05x.js";
|
|
7
|
+
import"../../shared/@ai-setting/roy-agent-core-gabw591f.js";
|
|
8
8
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
9
9
|
import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
|
|
10
10
|
import"../../shared/@ai-setting/roy-agent-core-pf1c360e.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SessionComponent
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-h5qsyzck.js";
|
|
4
4
|
import"../../shared/@ai-setting/roy-agent-core-rvxg1wps.js";
|
|
5
5
|
import {
|
|
6
6
|
MemorySessionStore
|
|
7
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
7
|
+
} from "../../shared/@ai-setting/roy-agent-core-95bbd2jv.js";
|
|
8
8
|
import {
|
|
9
9
|
SessionMessageConverter
|
|
10
10
|
} from "../../shared/@ai-setting/roy-agent-core-yfhgxh5a.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
SQLiteSessionStore,
|
|
4
4
|
getDefaultDataDir,
|
|
5
5
|
getDefaultSessionDbPath
|
|
6
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../../shared/@ai-setting/roy-agent-core-95bbd2jv.js";
|
|
7
7
|
import"../../../shared/@ai-setting/roy-agent-core-yfhgxh5a.js";
|
|
8
8
|
import"../../../shared/@ai-setting/roy-agent-core-8x4ngxcy.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-vyygk314.js";
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
BackgroundTaskManager,
|
|
4
4
|
createDelegateTool,
|
|
5
5
|
createStopTool
|
|
6
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../../shared/@ai-setting/roy-agent-core-jy5hkjtb.js";
|
|
7
7
|
import"../../../shared/@ai-setting/roy-agent-core-pzeexnhf.js";
|
|
8
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
import"../../../shared/@ai-setting/roy-agent-core-gabw591f.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-k31c3kvz.js";
|
|
10
10
|
import"../../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
11
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
11
|
+
import"../../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-gp872e7m.js";
|
|
13
13
|
import"../../../shared/@ai-setting/roy-agent-core-zttjq1h3.js";
|
|
14
14
|
import"../../../shared/@ai-setting/roy-agent-core-scp0afxg.js";
|
package/dist/env/task/index.js
CHANGED
|
@@ -5,22 +5,22 @@ import {
|
|
|
5
5
|
TaskPriorityEnum,
|
|
6
6
|
TaskStatusEnum,
|
|
7
7
|
TaskTypeEnum
|
|
8
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
} from "../../shared/@ai-setting/roy-agent-core-g17zc2kf.js";
|
|
9
9
|
import {
|
|
10
10
|
TaskEntityEventTypes
|
|
11
11
|
} from "../../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
12
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
12
|
+
import"../../shared/@ai-setting/roy-agent-core-jy5hkjtb.js";
|
|
13
13
|
import"../../shared/@ai-setting/roy-agent-core-pzeexnhf.js";
|
|
14
14
|
import {
|
|
15
15
|
SQLiteTaskStore,
|
|
16
16
|
getDefaultTaskDbPath
|
|
17
17
|
} from "../../shared/@ai-setting/roy-agent-core-9xby523m.js";
|
|
18
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-gabw591f.js";
|
|
19
19
|
import"../../shared/@ai-setting/roy-agent-core-k31c3kvz.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-0ye4q2jj.js";
|
|
22
22
|
import"../../shared/@ai-setting/roy-agent-core-t94ktchq.js";
|
|
23
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
23
|
+
import"../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
24
24
|
import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
|
|
25
25
|
import"../../shared/@ai-setting/roy-agent-core-pf1c360e.js";
|
|
26
26
|
import"../../shared/@ai-setting/roy-agent-core-ksx9a556.js";
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
formatExtractorInput,
|
|
8
8
|
formatExtractorInputFromDescription,
|
|
9
9
|
parseExtractorOutput
|
|
10
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
} from "../../../shared/@ai-setting/roy-agent-core-gdhcj2x4.js";
|
|
11
11
|
import"../../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-8wd3qwx5.js";
|
|
13
13
|
import"../../../shared/@ai-setting/roy-agent-core-4yq23m5g.js";
|
|
14
14
|
import {
|
|
15
15
|
createAutoTaskPlugin
|
|
16
16
|
} from "../../../shared/@ai-setting/roy-agent-core-xjdcx45t.js";
|
|
17
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
18
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
17
|
+
import"../../../shared/@ai-setting/roy-agent-core-gabw591f.js";
|
|
18
|
+
import"../../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
19
19
|
import"../../../shared/@ai-setting/roy-agent-core-zttjq1h3.js";
|
|
20
20
|
import"../../../shared/@ai-setting/roy-agent-core-scp0afxg.js";
|
|
21
21
|
import"../../../shared/@ai-setting/roy-agent-core-cg146hmg.js";
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
Scheduler,
|
|
6
6
|
WorkflowEngine,
|
|
7
7
|
init_engine
|
|
8
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
} from "../../../shared/@ai-setting/roy-agent-core-kbasdf13.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
10
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
import"../../../shared/@ai-setting/roy-agent-core-q8n1s1pb.js";
|
|
11
11
|
import"../../../shared/@ai-setting/roy-agent-core-q88vxmx5.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
13
13
|
import"../../../shared/@ai-setting/roy-agent-core-g2mth323.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowComponent
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-hzjgv9wd.js";
|
|
4
4
|
import"../../shared/@ai-setting/roy-agent-core-xgnpr28w.js";
|
|
5
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
import"../../shared/@ai-setting/roy-agent-core-kbasdf13.js";
|
|
6
6
|
import"../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
7
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
7
|
+
import"../../shared/@ai-setting/roy-agent-core-q8n1s1pb.js";
|
|
8
8
|
import"../../shared/@ai-setting/roy-agent-core-q88vxmx5.js";
|
|
9
9
|
import"../../shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
10
10
|
import"../../shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
pathNotFound,
|
|
61
61
|
unresolvedVariable
|
|
62
62
|
} from "../../shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
|
|
63
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
63
|
+
import"../../shared/@ai-setting/roy-agent-core-30k2bms9.js";
|
|
64
64
|
import"../../shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
65
65
|
import"../../shared/@ai-setting/roy-agent-core-e7t3rj0e.js";
|
|
66
66
|
import"../../shared/@ai-setting/roy-agent-core-8wd3qwx5.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
getRunWorkflowTool,
|
|
25
25
|
initRunWorkflowTool,
|
|
26
26
|
resetRunWorkflowTool
|
|
27
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
27
|
+
} from "../../../shared/@ai-setting/roy-agent-core-30k2bms9.js";
|
|
28
28
|
import {
|
|
29
29
|
WORKFLOW_SUBMIT_OUTPUT_TOOL_NAME,
|
|
30
30
|
WorkflowJsonOutputMarker,
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromptComponent,
|
|
3
3
|
PromptStore
|
|
4
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
4
|
+
} from "./shared/@ai-setting/roy-agent-core-1qbny05x.js";
|
|
5
5
|
import {
|
|
6
6
|
LLMComponent,
|
|
7
7
|
LLMConfigSchema,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
larkCliHandler,
|
|
75
75
|
resolveBountyIMSystemPrompt,
|
|
76
76
|
timerHandler
|
|
77
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
77
|
+
} from "./shared/@ai-setting/roy-agent-core-hq4pqava.js";
|
|
78
78
|
import {
|
|
79
79
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
80
80
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -93,26 +93,26 @@ import {
|
|
|
93
93
|
} from "./shared/@ai-setting/roy-agent-core-ws76avbn.js";
|
|
94
94
|
import {
|
|
95
95
|
TaskTagPlugin
|
|
96
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
96
|
+
} from "./shared/@ai-setting/roy-agent-core-gdhcj2x4.js";
|
|
97
97
|
import {
|
|
98
98
|
BasePlugin
|
|
99
99
|
} from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
100
100
|
import {
|
|
101
101
|
WorkflowComponent
|
|
102
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
102
|
+
} from "./shared/@ai-setting/roy-agent-core-hzjgv9wd.js";
|
|
103
103
|
import {
|
|
104
104
|
init_node_registry_helper,
|
|
105
105
|
registerDecoratorNodeType
|
|
106
106
|
} from "./shared/@ai-setting/roy-agent-core-xgnpr28w.js";
|
|
107
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
107
|
+
import"./shared/@ai-setting/roy-agent-core-kbasdf13.js";
|
|
108
108
|
import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
109
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
109
|
+
import"./shared/@ai-setting/roy-agent-core-q8n1s1pb.js";
|
|
110
110
|
import"./shared/@ai-setting/roy-agent-core-q88vxmx5.js";
|
|
111
111
|
import"./shared/@ai-setting/roy-agent-core-ddwa0n6h.js";
|
|
112
112
|
import"./shared/@ai-setting/roy-agent-core-hhrg314p.js";
|
|
113
113
|
import"./shared/@ai-setting/roy-agent-core-g2mth323.js";
|
|
114
114
|
import"./shared/@ai-setting/roy-agent-core-qnrf2aw6.js";
|
|
115
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
115
|
+
import"./shared/@ai-setting/roy-agent-core-30k2bms9.js";
|
|
116
116
|
import"./shared/@ai-setting/roy-agent-core-1db4vpc6.js";
|
|
117
117
|
import"./shared/@ai-setting/roy-agent-core-e7t3rj0e.js";
|
|
118
118
|
import"./shared/@ai-setting/roy-agent-core-8wd3qwx5.js";
|
|
@@ -150,9 +150,9 @@ import {
|
|
|
150
150
|
} from "./shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
151
151
|
import {
|
|
152
152
|
TaskComponent
|
|
153
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
153
|
+
} from "./shared/@ai-setting/roy-agent-core-g17zc2kf.js";
|
|
154
154
|
import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
155
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
155
|
+
import"./shared/@ai-setting/roy-agent-core-jy5hkjtb.js";
|
|
156
156
|
import"./shared/@ai-setting/roy-agent-core-pzeexnhf.js";
|
|
157
157
|
import {
|
|
158
158
|
SQLiteTaskStore,
|
|
@@ -161,7 +161,7 @@ import {
|
|
|
161
161
|
import {
|
|
162
162
|
getBuiltInPrompt,
|
|
163
163
|
getBuiltInPromptNames
|
|
164
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
164
|
+
} from "./shared/@ai-setting/roy-agent-core-gabw591f.js";
|
|
165
165
|
import {
|
|
166
166
|
AgentRegistry
|
|
167
167
|
} from "./shared/@ai-setting/roy-agent-core-k31c3kvz.js";
|
|
@@ -174,7 +174,7 @@ import"./shared/@ai-setting/roy-agent-core-0ye4q2jj.js";
|
|
|
174
174
|
import"./shared/@ai-setting/roy-agent-core-t94ktchq.js";
|
|
175
175
|
import {
|
|
176
176
|
TaskHookPoints
|
|
177
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
177
|
+
} from "./shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
178
178
|
import {
|
|
179
179
|
SkillComponent
|
|
180
180
|
} from "./shared/@ai-setting/roy-agent-core-cx67bv9d.js";
|
|
@@ -197,11 +197,11 @@ import"./shared/@ai-setting/roy-agent-core-fnv3ev18.js";
|
|
|
197
197
|
import"./shared/@ai-setting/roy-agent-core-4w6rgxs4.js";
|
|
198
198
|
import {
|
|
199
199
|
SessionComponent
|
|
200
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
200
|
+
} from "./shared/@ai-setting/roy-agent-core-h5qsyzck.js";
|
|
201
201
|
import"./shared/@ai-setting/roy-agent-core-rvxg1wps.js";
|
|
202
202
|
import {
|
|
203
203
|
MemorySessionStore
|
|
204
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
204
|
+
} from "./shared/@ai-setting/roy-agent-core-95bbd2jv.js";
|
|
205
205
|
import"./shared/@ai-setting/roy-agent-core-yfhgxh5a.js";
|
|
206
206
|
import"./shared/@ai-setting/roy-agent-core-8x4ngxcy.js";
|
|
207
207
|
import"./shared/@ai-setting/roy-agent-core-qxhq8ven.js";
|
|
@@ -6,6 +6,7 @@ var TaskHookPoints = {
|
|
|
6
6
|
AFTER_UPDATE: "task:after.update",
|
|
7
7
|
BEFORE_DELETE: "task:before.delete",
|
|
8
8
|
AFTER_DELETE: "task:after.delete",
|
|
9
|
+
AFTER_COMPLETE: "task:after.complete",
|
|
9
10
|
DELEGATE_BEFORE: "task:delegate:before",
|
|
10
11
|
DELEGATE_AFTER: "task:delegate:after",
|
|
11
12
|
OPERATION_BEFORE_CREATE: "task:operation:before.create",
|
|
@@ -611,6 +611,22 @@ function createWorkflowSearchTool(workflowService) {
|
|
|
611
611
|
// src/env/workflow/tools/run-workflow.ts
|
|
612
612
|
init_logger();
|
|
613
613
|
import { z as z8 } from "zod";
|
|
614
|
+
|
|
615
|
+
// src/env/session/session-id.ts
|
|
616
|
+
var MIN_SESSION_ID_LENGTH = 8;
|
|
617
|
+
var MAX_SESSION_ID_LENGTH = 128;
|
|
618
|
+
var SESSION_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
619
|
+
function isValidSessionId(value) {
|
|
620
|
+
if (typeof value !== "string")
|
|
621
|
+
return false;
|
|
622
|
+
if (value.length < MIN_SESSION_ID_LENGTH)
|
|
623
|
+
return false;
|
|
624
|
+
if (value.length > MAX_SESSION_ID_LENGTH)
|
|
625
|
+
return false;
|
|
626
|
+
return SESSION_ID_PATTERN.test(value);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
// src/env/workflow/tools/run-workflow.ts
|
|
614
630
|
var logger7 = createLogger("run-workflow-tool");
|
|
615
631
|
var RunWorkflowInputSchema = z8.object({
|
|
616
632
|
workflow_name: z8.string().describe("Name of the workflow to run"),
|
|
@@ -639,13 +655,22 @@ function createRunWorkflowTool(workflowService) {
|
|
|
639
655
|
const startTime = Date.now();
|
|
640
656
|
const { workflow_name, input, sync = true, timeout = 1800000 } = args;
|
|
641
657
|
logger7.info(`Running workflow: ${workflow_name}`, { input, sync, timeout });
|
|
658
|
+
const ctxSessionId = typeof ctx?.session_id === "string" && isValidSessionId(ctx.session_id) ? ctx.session_id : undefined;
|
|
659
|
+
const envSessionId = typeof process.env.ROY_PARENT_SESSION_ID === "string" && isValidSessionId(process.env.ROY_PARENT_SESSION_ID) ? process.env.ROY_PARENT_SESSION_ID : undefined;
|
|
660
|
+
if (process.env.ROY_PARENT_SESSION_ID && !envSessionId) {
|
|
661
|
+
logger7.warn(`Ignoring malformed ROY_PARENT_SESSION_ID env value (must match /^[A-Za-z0-9_-]{8,128}$/); received length=${process.env.ROY_PARENT_SESSION_ID.length}`);
|
|
662
|
+
}
|
|
663
|
+
const parentSessionId = ctxSessionId ?? envSessionId;
|
|
642
664
|
let timeoutHandle;
|
|
643
665
|
let durationMs;
|
|
644
666
|
try {
|
|
645
667
|
let result;
|
|
646
668
|
if (timeout) {
|
|
647
669
|
result = await Promise.race([
|
|
648
|
-
workflowService.runWorkflow(workflow_name, input, {
|
|
670
|
+
workflowService.runWorkflow(workflow_name, input, {
|
|
671
|
+
sync,
|
|
672
|
+
...parentSessionId ? { parentSessionId } : {}
|
|
673
|
+
}),
|
|
649
674
|
new Promise((_, reject) => {
|
|
650
675
|
timeoutHandle = setTimeout(() => {
|
|
651
676
|
reject(new Error("Workflow execution timed out"));
|
|
@@ -653,7 +678,10 @@ function createRunWorkflowTool(workflowService) {
|
|
|
653
678
|
})
|
|
654
679
|
]);
|
|
655
680
|
} else {
|
|
656
|
-
result = await workflowService.runWorkflow(workflow_name, input, {
|
|
681
|
+
result = await workflowService.runWorkflow(workflow_name, input, {
|
|
682
|
+
sync,
|
|
683
|
+
...parentSessionId ? { parentSessionId } : {}
|
|
684
|
+
});
|
|
657
685
|
}
|
|
658
686
|
if (timeoutHandle) {
|
|
659
687
|
clearTimeout(timeoutHandle);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentComponentAdapter,
|
|
3
3
|
init_agent_component_adapter
|
|
4
|
-
} from "./roy-agent-core-
|
|
4
|
+
} from "./roy-agent-core-q8n1s1pb.js";
|
|
5
5
|
import"./roy-agent-core-1db4vpc6.js";
|
|
6
6
|
import"./roy-agent-core-e25xkv53.js";
|
|
7
7
|
import"./roy-agent-core-gp872e7m.js";
|
|
@@ -38,11 +38,14 @@ class MemorySessionStore extends BaseSessionStore {
|
|
|
38
38
|
messageConverter = new SessionMessageConverter;
|
|
39
39
|
async create(options) {
|
|
40
40
|
const now = Date.now();
|
|
41
|
+
const rawParent = options.parentSessionId !== undefined ? options.parentSessionId : options.parentID ?? null;
|
|
42
|
+
const parentSessionId = typeof rawParent === "string" && rawParent.trim().length > 0 ? rawParent : null;
|
|
41
43
|
const session = {
|
|
42
44
|
id: options.id ?? generateSessionId(),
|
|
43
45
|
title: options.title ?? "Session",
|
|
44
46
|
directory: options.directory ?? "/tmp",
|
|
45
|
-
parentID:
|
|
47
|
+
parentID: parentSessionId ?? undefined,
|
|
48
|
+
parentSessionId,
|
|
46
49
|
createdAt: now,
|
|
47
50
|
updatedAt: now,
|
|
48
51
|
messageCount: 0,
|
|
@@ -533,11 +536,14 @@ class SQLiteSessionStore extends BaseSessionStore {
|
|
|
533
536
|
async create(options) {
|
|
534
537
|
await this.initialize();
|
|
535
538
|
const now = Date.now();
|
|
539
|
+
const rawParent = options.parentSessionId !== undefined ? options.parentSessionId : options.parentID ?? null;
|
|
540
|
+
const parentSessionId = typeof rawParent === "string" && rawParent.trim().length > 0 ? rawParent : null;
|
|
536
541
|
const session = {
|
|
537
542
|
id: options.id ?? generateSessionId2(),
|
|
538
543
|
title: options.title ?? "Session",
|
|
539
544
|
directory: options.directory ?? "/tmp",
|
|
540
|
-
parentID:
|
|
545
|
+
parentID: parentSessionId ?? undefined,
|
|
546
|
+
parentSessionId,
|
|
541
547
|
createdAt: now,
|
|
542
548
|
updatedAt: now,
|
|
543
549
|
messageCount: 0,
|
|
@@ -1062,11 +1068,14 @@ class SQLiteSessionStore extends BaseSessionStore {
|
|
|
1062
1068
|
this.initialized = false;
|
|
1063
1069
|
}
|
|
1064
1070
|
rowToSession(row) {
|
|
1071
|
+
const rawParent = row.parent_id;
|
|
1072
|
+
const parentId = typeof rawParent === "string" && rawParent.trim().length > 0 ? rawParent : null;
|
|
1065
1073
|
return {
|
|
1066
1074
|
id: row.id,
|
|
1067
1075
|
title: row.title,
|
|
1068
1076
|
directory: row.directory,
|
|
1069
|
-
parentID:
|
|
1077
|
+
parentID: parentId ?? undefined,
|
|
1078
|
+
parentSessionId: parentId,
|
|
1070
1079
|
createdAt: row.created_at,
|
|
1071
1080
|
updatedAt: row.updated_at,
|
|
1072
1081
|
messageCount: row.message_count,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
BackgroundTaskManager,
|
|
6
6
|
createDelegateTool,
|
|
7
7
|
createStopTool
|
|
8
|
-
} from "./roy-agent-core-
|
|
8
|
+
} from "./roy-agent-core-jy5hkjtb.js";
|
|
9
9
|
import {
|
|
10
10
|
SQLiteTaskStore,
|
|
11
11
|
getDefaultTaskDbPath
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
} from "./roy-agent-core-t94ktchq.js";
|
|
31
31
|
import {
|
|
32
32
|
TaskHookPoints
|
|
33
|
-
} from "./roy-agent-core-
|
|
33
|
+
} from "./roy-agent-core-1pg0fepg.js";
|
|
34
34
|
import {
|
|
35
35
|
envKeyToConfigKey
|
|
36
36
|
} from "./roy-agent-core-qxhq8ven.js";
|
|
@@ -41,6 +41,10 @@ import {
|
|
|
41
41
|
globalHookManager,
|
|
42
42
|
init_global_hook_manager
|
|
43
43
|
} from "./roy-agent-core-gp872e7m.js";
|
|
44
|
+
import {
|
|
45
|
+
getEnvContextOrEmpty,
|
|
46
|
+
init_env_context
|
|
47
|
+
} from "./roy-agent-core-scp0afxg.js";
|
|
44
48
|
import {
|
|
45
49
|
TracedAs,
|
|
46
50
|
init_decorator
|
|
@@ -75,6 +79,17 @@ var TASK_CONFIG_REGISTRATION = {
|
|
|
75
79
|
// src/env/task/task-component.ts
|
|
76
80
|
init_global_hook_manager();
|
|
77
81
|
|
|
82
|
+
// src/env/task/hooks/contexts.ts
|
|
83
|
+
var TASK_COMPLETE_TERMINAL_STATUSES = [
|
|
84
|
+
"completed",
|
|
85
|
+
"failed",
|
|
86
|
+
"cancelled",
|
|
87
|
+
"timeout"
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
// src/env/task/task-component.ts
|
|
91
|
+
init_env_context();
|
|
92
|
+
|
|
78
93
|
// src/env/task/tag-service.ts
|
|
79
94
|
init_logger();
|
|
80
95
|
var logger = createLogger("task:tag");
|
|
@@ -415,6 +430,18 @@ class TaskComponent extends BaseComponent {
|
|
|
415
430
|
await this.executeHook(TaskHookPoints.AFTER_UPDATE, resultCtx);
|
|
416
431
|
this.publishEvent(TaskEntityEventTypes.UPDATED, { task, changes: options, sessionId: "" }, "");
|
|
417
432
|
logger2.info(`[TaskComponent] Task updated: ${id}`);
|
|
433
|
+
if (options.status && TASK_COMPLETE_TERMINAL_STATUSES.includes(options.status)) {
|
|
434
|
+
const env = getEnvContextOrEmpty();
|
|
435
|
+
const completeCtx = {
|
|
436
|
+
task,
|
|
437
|
+
changes: options,
|
|
438
|
+
terminalStatus: options.status,
|
|
439
|
+
sessionId: env.sessionId ?? "",
|
|
440
|
+
tagService: this.tagService
|
|
441
|
+
};
|
|
442
|
+
await this.executeHook(TaskHookPoints.AFTER_COMPLETE, completeCtx);
|
|
443
|
+
logger2.info(`[TaskComponent] Task completed (AFTER_COMPLETE fired): ${id} -> ${options.status}`);
|
|
444
|
+
}
|
|
418
445
|
}
|
|
419
446
|
return task;
|
|
420
447
|
}
|
|
@@ -230,6 +230,40 @@ delegate_task(
|
|
|
230
230
|
|
|
231
231
|
### 4. 任务超时通知(⏱️ timeout)
|
|
232
232
|
- 分析已完成的部分工作,决定是否需要重新委托(给更长时间)或调整方案
|
|
233
|
+
- **推荐方式:使用 subSessionId 复用重试**(详见 4a),sub agent 继承之前的对话上下文继续推进
|
|
234
|
+
|
|
235
|
+
### 4a. subSessionId 复用重试(关键能力,2026-07-10 新增)
|
|
236
|
+
|
|
237
|
+
后台任务**超时或失败**通知中会携带 \`subSessionId\` 字段,例如:
|
|
238
|
+
|
|
239
|
+
\`\`\`
|
|
240
|
+
[通知] ⏱️ 后台任务「长任务」超时 (5.0秒)
|
|
241
|
+
bgprocess: process_1234_abc
|
|
242
|
+
subSessionId: sub-session-xyz
|
|
243
|
+
\`\`\`
|
|
244
|
+
|
|
245
|
+
**重要:当超时或失败发生时,优先尝试复用 sub session 重试,而不是重新创建**:
|
|
246
|
+
|
|
247
|
+
\`\`\`typescript
|
|
248
|
+
// ❌ 不要这样做(从头开始,丢失上下文)
|
|
249
|
+
delegate_task({ description: "继续工作", prompt: "..." });
|
|
250
|
+
|
|
251
|
+
// ✅ 应该这样做(复用 sub session,sub agent 继承所有历史上下文)
|
|
252
|
+
delegate_task({
|
|
253
|
+
description: "继续工作(重试)",
|
|
254
|
+
prompt: "请基于之前的进度继续推进",
|
|
255
|
+
sub_session_id: "sub-session-xyz", // 从超时通知中复制
|
|
256
|
+
timeout: 3600000, // 适当延长超时
|
|
257
|
+
});
|
|
258
|
+
\`\`\`
|
|
259
|
+
|
|
260
|
+
**适用场景**:
|
|
261
|
+
- ⏱️ 任务超时(特别是 strict-task-agent 等长 workflow)
|
|
262
|
+
- ❌ 网络错误、模型异常退出等可恢复错误
|
|
263
|
+
|
|
264
|
+
**不适用**:
|
|
265
|
+
- ✅ 任务明确完成(无需重试)
|
|
266
|
+
- \uD83D\uDEAB sub agent 明显走偏方向(应新建 session + 明确新 prompt)
|
|
233
267
|
|
|
234
268
|
### 5. 边界条件 — 仅在以下情况才知会用户
|
|
235
269
|
- 任务已经全部完成,需要用户验收
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./roy-agent-core-8wd3qwx5.js";
|
|
7
7
|
import {
|
|
8
8
|
WORKFLOW_EXTRACT_PROMPT
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-gabw591f.js";
|
|
10
10
|
import {
|
|
11
11
|
TaskHookPoints
|
|
12
|
-
} from "./roy-agent-core-
|
|
12
|
+
} from "./roy-agent-core-1pg0fepg.js";
|
|
13
13
|
import {
|
|
14
14
|
init_context
|
|
15
15
|
} from "./roy-agent-core-zttjq1h3.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
WorkflowEngine,
|
|
7
7
|
exports_engine,
|
|
8
8
|
init_engine
|
|
9
|
-
} from "./roy-agent-core-
|
|
9
|
+
} from "./roy-agent-core-kbasdf13.js";
|
|
10
10
|
import {
|
|
11
11
|
askUserTool,
|
|
12
12
|
createRunWorkflowTool,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
createWorkflowSearchTool,
|
|
19
19
|
createWorkflowTagListTool,
|
|
20
20
|
createWorkflowValidateTool
|
|
21
|
-
} from "./roy-agent-core-
|
|
21
|
+
} from "./roy-agent-core-30k2bms9.js";
|
|
22
22
|
import {
|
|
23
23
|
WorkflowService
|
|
24
24
|
} from "./roy-agent-core-e7t3rj0e.js";
|
|
@@ -141,7 +141,7 @@ class WorkflowComponent extends BaseComponent {
|
|
|
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-57bmm0a1.js");
|
|
145
145
|
agentRunner = new AgentComponentAdapter(agentComponent, {}, this.sessionComponent);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./roy-agent-core-pzeexnhf.js";
|
|
5
5
|
import {
|
|
6
6
|
builtInPrompts
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-gabw591f.js";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_SUBAGENT_PROMPT
|
|
10
10
|
} from "./roy-agent-core-k31c3kvz.js";
|
|
11
11
|
import {
|
|
12
12
|
TaskHookPoints
|
|
13
|
-
} from "./roy-agent-core-
|
|
13
|
+
} from "./roy-agent-core-1pg0fepg.js";
|
|
14
14
|
import {
|
|
15
15
|
globalHookManager,
|
|
16
16
|
init_global_hook_manager
|
|
@@ -224,7 +224,8 @@ var DelegateToolParameters = z.object({
|
|
|
224
224
|
subagent_type: z.string().describe("The type of specialized agent to use for this task").default("general"),
|
|
225
225
|
timeout: z.number().describe("Task timeout in milliseconds. Default: 1800000 (30 minutes). If set, task will be terminated after timeout.").optional(),
|
|
226
226
|
reason: z.string().describe("Brief reason for calling this tool (max 30 chars, e.g., 'Delegate refactor task')").optional(),
|
|
227
|
-
similar_task_ids: z.array(z.number()).max(3).describe("Similar task IDs (max 3) to reference for improving task execution. Search for similar tasks before calling this tool.")
|
|
227
|
+
similar_task_ids: z.array(z.number()).max(3).describe("Similar task IDs (max 3) to reference for improving task execution. Search for similar tasks before calling this tool."),
|
|
228
|
+
sub_session_id: z.string().describe("Existing sub-agent session ID to resume. " + "If provided, the sub-agent will continue from the previous conversation " + "context (used for retry on timeout/failure). " + "Leave empty for a new session.").optional()
|
|
228
229
|
});
|
|
229
230
|
function buildEntryAgentPrompt(options) {
|
|
230
231
|
const { workflowName, originalPrompt, description } = options;
|
|
@@ -296,7 +297,7 @@ class BackgroundTaskManager {
|
|
|
296
297
|
}
|
|
297
298
|
}
|
|
298
299
|
async createTask(options) {
|
|
299
|
-
const { parentSessionId, description, prompt, subagentType, timeout, similarTaskIds } = options;
|
|
300
|
+
const { parentSessionId, description, prompt, subagentType, timeout, similarTaskIds, existingSubSessionId } = options;
|
|
300
301
|
const taskIdGen = `process_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`;
|
|
301
302
|
const sessionComponent = this.getSessionComponent();
|
|
302
303
|
if (!sessionComponent) {
|
|
@@ -306,17 +307,44 @@ class BackgroundTaskManager {
|
|
|
306
307
|
if (!parentSession) {
|
|
307
308
|
throw new Error(`Parent session not found: ${parentSessionId}`);
|
|
308
309
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
310
|
+
let subSession;
|
|
311
|
+
if (existingSubSessionId) {
|
|
312
|
+
const reusedSession = await sessionComponent.get(existingSubSessionId);
|
|
313
|
+
if (!reusedSession) {
|
|
314
|
+
throw new Error(`Sub session not found for resume: ${existingSubSessionId}`);
|
|
315
|
+
}
|
|
316
|
+
const createdBy = reusedSession?.info?.metadata?.created_by;
|
|
317
|
+
if (createdBy && createdBy !== "subagent") {
|
|
318
|
+
logger.warn(`[BackgroundTaskManager] Session ${existingSubSessionId} was not created by a sub-agent (created_by=${createdBy}); reusing anyway`);
|
|
319
|
+
}
|
|
320
|
+
subSession = reusedSession;
|
|
321
|
+
try {
|
|
322
|
+
const existingMeta = reusedSession?.info?.metadata || {};
|
|
323
|
+
await sessionComponent.update(existingSubSessionId, {
|
|
324
|
+
metadata: {
|
|
325
|
+
...existingMeta,
|
|
326
|
+
reused_sub_session: true,
|
|
327
|
+
reused_at: Date.now()
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
} catch (err) {
|
|
331
|
+
logger.warn(`[BackgroundTaskManager] Failed to update reused session metadata`, { existingSubSessionId, error: err instanceof Error ? err.message : String(err) });
|
|
332
|
+
}
|
|
333
|
+
logger.info(`[BackgroundTaskManager] Reusing sub session: ${existingSubSessionId} for task ${taskIdGen}`);
|
|
334
|
+
} else {
|
|
335
|
+
const metadata = {
|
|
336
|
+
subagent_type: subagentType,
|
|
337
|
+
created_by: "subagent",
|
|
338
|
+
task_description: description
|
|
339
|
+
};
|
|
340
|
+
subSession = await sessionComponent.create({
|
|
341
|
+
title: `${description} (@${subagentType} subagent)`,
|
|
342
|
+
parentSessionId,
|
|
343
|
+
metadata
|
|
344
|
+
});
|
|
345
|
+
if (!subSession) {
|
|
346
|
+
throw new Error("Failed to create sub-session");
|
|
347
|
+
}
|
|
320
348
|
}
|
|
321
349
|
const abortController = new AbortController;
|
|
322
350
|
const processRegistry = new ProcessRegistry;
|
|
@@ -797,12 +825,12 @@ No need to poll — just wait for the notification and use \`task_get\` with the
|
|
|
797
825
|
};
|
|
798
826
|
await globalHookManager.execute(TaskHookPoints.DELEGATE_BEFORE, delegateCtx, { sessionId: parentSessionId });
|
|
799
827
|
promptWithTaskInfo = delegateCtx.prompt;
|
|
800
|
-
return await handleBackgroundTask(backgroundTaskManager, parentSessionId, description, promptWithTaskInfo, delegateCtx.subagentType, delegateCtx.timeout, similar_task_ids);
|
|
828
|
+
return await handleBackgroundTask(backgroundTaskManager, parentSessionId, description, promptWithTaskInfo, delegateCtx.subagentType, delegateCtx.timeout, similar_task_ids, params.sub_session_id);
|
|
801
829
|
}
|
|
802
830
|
};
|
|
803
831
|
return tool;
|
|
804
832
|
}
|
|
805
|
-
async function handleBackgroundTask(backgroundTaskManager, parentSessionId, description, prompt, subagentType, timeout, similarTaskIds) {
|
|
833
|
+
async function handleBackgroundTask(backgroundTaskManager, parentSessionId, description, prompt, subagentType, timeout, similarTaskIds, existingSubSessionId) {
|
|
806
834
|
const startTime = Date.now();
|
|
807
835
|
try {
|
|
808
836
|
let actualSubagentType = subagentType;
|
|
@@ -826,7 +854,8 @@ async function handleBackgroundTask(backgroundTaskManager, parentSessionId, desc
|
|
|
826
854
|
subagentType: actualSubagentType,
|
|
827
855
|
timeout,
|
|
828
856
|
similarTaskIds,
|
|
829
|
-
originalWorkflowName
|
|
857
|
+
originalWorkflowName,
|
|
858
|
+
existingSubSessionId
|
|
830
859
|
});
|
|
831
860
|
const output = [
|
|
832
861
|
`✅ Background task accepted`,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
AgentComponentAdapter,
|
|
9
9
|
init_agent_component_adapter
|
|
10
|
-
} from "./roy-agent-core-
|
|
10
|
+
} from "./roy-agent-core-q8n1s1pb.js";
|
|
11
11
|
import {
|
|
12
12
|
TemplateResolver,
|
|
13
13
|
init_template_resolver
|
|
@@ -1104,9 +1104,9 @@ var init_agent_node = __esm(() => {
|
|
|
1104
1104
|
await sessionComponent.create({
|
|
1105
1105
|
id: agentSessionId,
|
|
1106
1106
|
title: `Agent: ${nodeId}`,
|
|
1107
|
+
parentSessionId: context.sessionId,
|
|
1107
1108
|
metadata: {
|
|
1108
1109
|
type: "agent",
|
|
1109
|
-
parentSessionId: context.sessionId,
|
|
1110
1110
|
nodeId,
|
|
1111
1111
|
workflowName: context.workflowName
|
|
1112
1112
|
}
|
|
@@ -1359,6 +1359,7 @@ var init_engine = __esm(() => {
|
|
|
1359
1359
|
await this.sessionComponent.create({
|
|
1360
1360
|
id: sessionId,
|
|
1361
1361
|
title: `Workflow: ${workflowName} (${runId})`,
|
|
1362
|
+
parentSessionId: options?.parentSessionId ?? null,
|
|
1362
1363
|
metadata
|
|
1363
1364
|
});
|
|
1364
1365
|
}
|
|
@@ -1405,6 +1406,7 @@ var init_engine = __esm(() => {
|
|
|
1405
1406
|
await this.sessionComponent.create({
|
|
1406
1407
|
id: sessionId,
|
|
1407
1408
|
title: `Workflow: ${workflowName}`,
|
|
1409
|
+
parentSessionId: options?.parentSessionId ?? null,
|
|
1408
1410
|
metadata: sessionMetadata
|
|
1409
1411
|
});
|
|
1410
1412
|
session = await this.sessionComponent.get(sessionId);
|
|
@@ -209,6 +209,7 @@ var init_agent_component_adapter = __esm(() => {
|
|
|
209
209
|
try {
|
|
210
210
|
await this._sessionComponent.create({
|
|
211
211
|
title: `Agent Session: ${config.type} (${agentSessionId})`,
|
|
212
|
+
...workflowSessionId ? { parentSessionId: workflowSessionId } : {},
|
|
212
213
|
metadata: {
|
|
213
214
|
type: "agent",
|
|
214
215
|
workflowRunId: runId,
|