@ai-setting/roy-agent-core 1.6.15 → 1.6.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/env/agent/index.js +3 -3
  2. package/dist/env/event-source/index.js +3 -3
  3. package/dist/env/index.js +10 -10
  4. package/dist/env/prompt/index.js +2 -2
  5. package/dist/env/task/delegate/index.js +4 -4
  6. package/dist/env/task/index.js +5 -5
  7. package/dist/env/task/plugins/index.js +2 -2
  8. package/dist/env/tool/built-in/index.js +2 -2
  9. package/dist/env/tool/index.js +3 -3
  10. package/dist/index.js +12 -12
  11. package/dist/shared/@ai-setting/{roy-agent-core-eaj0b1hm.js → roy-agent-core-44g3synv.js} +16 -8
  12. package/dist/shared/@ai-setting/{roy-agent-core-1380b0re.js → roy-agent-core-4cgkj7v0.js} +3 -3
  13. package/dist/shared/@ai-setting/{roy-agent-core-wq98qf5y.js → roy-agent-core-bsxgrqzq.js} +1 -1
  14. package/dist/shared/@ai-setting/{roy-agent-core-0rwymn7m.js → roy-agent-core-cfqm5w9b.js} +1 -1
  15. package/dist/shared/@ai-setting/{roy-agent-core-x7sc21ek.js → roy-agent-core-dnns0v64.js} +1 -1
  16. package/dist/shared/@ai-setting/{roy-agent-core-vkesx61c.js → roy-agent-core-e9jf4w3z.js} +1 -1
  17. package/dist/shared/@ai-setting/{roy-agent-core-rmesvpff.js → roy-agent-core-edbhy767.js} +4 -2
  18. package/dist/shared/@ai-setting/{roy-agent-core-9jsfqc1m.js → roy-agent-core-m134hen4.js} +1 -1
  19. package/dist/shared/@ai-setting/{roy-agent-core-apz6v22z.js → roy-agent-core-pq1q854s.js} +247 -1
  20. package/dist/shared/@ai-setting/{roy-agent-core-mmnac1s6.js → roy-agent-core-tycbpm17.js} +38 -0
  21. package/dist/shared/@ai-setting/{roy-agent-core-1ecgh5ya.js → roy-agent-core-yqxrekhg.js} +1 -1
  22. package/package.json +1 -1
  23. /package/dist/shared/@ai-setting/{roy-agent-core-b8wn8yhk.js → roy-agent-core-eskgj8nc.js} +0 -0
@@ -2,12 +2,12 @@ import {
2
2
  AgentComponent,
3
3
  AgentComponentConfigSchema,
4
4
  SummaryAgent
5
- } from "../../shared/@ai-setting/roy-agent-core-rmesvpff.js";
5
+ } from "../../shared/@ai-setting/roy-agent-core-edbhy767.js";
6
6
  import"../../shared/@ai-setting/roy-agent-core-8n0e62y4.js";
7
- import"../../shared/@ai-setting/roy-agent-core-b8wn8yhk.js";
7
+ import"../../shared/@ai-setting/roy-agent-core-eskgj8nc.js";
8
8
  import"../../shared/@ai-setting/roy-agent-core-ataagh3a.js";
9
9
  import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
10
- import"../../shared/@ai-setting/roy-agent-core-mmnac1s6.js";
10
+ import"../../shared/@ai-setting/roy-agent-core-tycbpm17.js";
11
11
  import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
12
12
  import"../../shared/@ai-setting/roy-agent-core-ctdhjv68.js";
13
13
  import"../../shared/@ai-setting/roy-agent-core-7r72622v.js";
@@ -11,7 +11,7 @@ import {
11
11
  larkCliHandler,
12
12
  resolveBountyIMSystemPrompt,
13
13
  timerHandler
14
- } from "../../shared/@ai-setting/roy-agent-core-wq98qf5y.js";
14
+ } from "../../shared/@ai-setting/roy-agent-core-bsxgrqzq.js";
15
15
  import {
16
16
  BUILT_IN_EVENT_SOURCE_TYPES,
17
17
  BUILT_IN_EVENT_SOURCE_TYPE_LIST,
@@ -22,13 +22,13 @@ import {
22
22
  validateEventSourceConfig
23
23
  } from "../../shared/@ai-setting/roy-agent-core-ds5f75pg.js";
24
24
  import"../../shared/@ai-setting/roy-agent-core-1qjgwjjs.js";
25
- import"../../shared/@ai-setting/roy-agent-core-1ecgh5ya.js";
25
+ import"../../shared/@ai-setting/roy-agent-core-yqxrekhg.js";
26
26
  import"../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
27
27
  import"../../shared/@ai-setting/roy-agent-core-1mrc9a1r.js";
28
28
  import"../../shared/@ai-setting/roy-agent-core-bq1gskrf.js";
29
29
  import"../../shared/@ai-setting/roy-agent-core-jrj30vq3.js";
30
30
  import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
31
- import"../../shared/@ai-setting/roy-agent-core-apz6v22z.js";
31
+ import"../../shared/@ai-setting/roy-agent-core-pq1q854s.js";
32
32
  import"../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
33
33
  import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
34
34
  import"../../shared/@ai-setting/roy-agent-core-akb8mb9v.js";
package/dist/env/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  BaseEnvironment
3
- } from "../shared/@ai-setting/roy-agent-core-x7sc21ek.js";
3
+ } from "../shared/@ai-setting/roy-agent-core-dnns0v64.js";
4
4
  import {
5
5
  EventSourceComponent,
6
6
  builtInHandlers,
7
7
  larkCliHandler
8
- } from "../shared/@ai-setting/roy-agent-core-wq98qf5y.js";
8
+ } from "../shared/@ai-setting/roy-agent-core-bsxgrqzq.js";
9
9
  import {
10
10
  EventSourceInitHooks,
11
11
  getDefaultConfigForType,
@@ -17,7 +17,7 @@ import"../shared/@ai-setting/roy-agent-core-1qjgwjjs.js";
17
17
  import {
18
18
  PluginComponent
19
19
  } from "../shared/@ai-setting/roy-agent-core-gc75v3px.js";
20
- import"../shared/@ai-setting/roy-agent-core-1ecgh5ya.js";
20
+ import"../shared/@ai-setting/roy-agent-core-yqxrekhg.js";
21
21
  import"../shared/@ai-setting/roy-agent-core-az13yzmc.js";
22
22
  import {
23
23
  WorkflowComponent
@@ -41,22 +41,22 @@ import"../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
41
41
  import {
42
42
  AgentComponent,
43
43
  AgentComponentConfigSchema
44
- } from "../shared/@ai-setting/roy-agent-core-rmesvpff.js";
44
+ } from "../shared/@ai-setting/roy-agent-core-edbhy767.js";
45
45
  import"../shared/@ai-setting/roy-agent-core-8n0e62y4.js";
46
- import"../shared/@ai-setting/roy-agent-core-b8wn8yhk.js";
46
+ import"../shared/@ai-setting/roy-agent-core-eskgj8nc.js";
47
47
  import"../shared/@ai-setting/roy-agent-core-ataagh3a.js";
48
48
  import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
49
49
  import {
50
50
  TaskComponent
51
- } from "../shared/@ai-setting/roy-agent-core-9jsfqc1m.js";
51
+ } from "../shared/@ai-setting/roy-agent-core-m134hen4.js";
52
52
  import"../shared/@ai-setting/roy-agent-core-amkqnyzy.js";
53
53
  import"../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
54
- import"../shared/@ai-setting/roy-agent-core-1380b0re.js";
55
- import"../shared/@ai-setting/roy-agent-core-eaj0b1hm.js";
54
+ import"../shared/@ai-setting/roy-agent-core-4cgkj7v0.js";
55
+ import"../shared/@ai-setting/roy-agent-core-44g3synv.js";
56
56
  import"../shared/@ai-setting/roy-agent-core-zdzkzx5g.js";
57
- import"../shared/@ai-setting/roy-agent-core-apz6v22z.js";
57
+ import"../shared/@ai-setting/roy-agent-core-pq1q854s.js";
58
58
  import"../shared/@ai-setting/roy-agent-core-c1v263jn.js";
59
- import"../shared/@ai-setting/roy-agent-core-mmnac1s6.js";
59
+ import"../shared/@ai-setting/roy-agent-core-tycbpm17.js";
60
60
  import {
61
61
  XDG_PATHS,
62
62
  getXDGPath,
@@ -3,8 +3,8 @@ import {
3
3
  PromptConfigSchema,
4
4
  PromptPathSchema,
5
5
  PromptRenderer
6
- } from "../../shared/@ai-setting/roy-agent-core-0rwymn7m.js";
7
- import"../../shared/@ai-setting/roy-agent-core-apz6v22z.js";
6
+ } from "../../shared/@ai-setting/roy-agent-core-cfqm5w9b.js";
7
+ import"../../shared/@ai-setting/roy-agent-core-pq1q854s.js";
8
8
  import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
9
9
  import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
10
10
  import"../../shared/@ai-setting/roy-agent-core-akb8mb9v.js";
@@ -3,11 +3,11 @@ import {
3
3
  BackgroundTaskManager,
4
4
  createDelegateTool,
5
5
  createStopTool
6
- } from "../../../shared/@ai-setting/roy-agent-core-1380b0re.js";
7
- import"../../../shared/@ai-setting/roy-agent-core-eaj0b1hm.js";
8
- import"../../../shared/@ai-setting/roy-agent-core-apz6v22z.js";
6
+ } from "../../../shared/@ai-setting/roy-agent-core-4cgkj7v0.js";
7
+ import"../../../shared/@ai-setting/roy-agent-core-44g3synv.js";
8
+ import"../../../shared/@ai-setting/roy-agent-core-pq1q854s.js";
9
9
  import"../../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
10
- import"../../../shared/@ai-setting/roy-agent-core-mmnac1s6.js";
10
+ import"../../../shared/@ai-setting/roy-agent-core-tycbpm17.js";
11
11
  import"../../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
12
12
  import"../../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
13
13
  import"../../../shared/@ai-setting/roy-agent-core-vc7p80sd.js";
@@ -5,20 +5,20 @@ import {
5
5
  TaskPriorityEnum,
6
6
  TaskStatusEnum,
7
7
  TaskTypeEnum
8
- } from "../../shared/@ai-setting/roy-agent-core-9jsfqc1m.js";
8
+ } from "../../shared/@ai-setting/roy-agent-core-m134hen4.js";
9
9
  import"../../shared/@ai-setting/roy-agent-core-amkqnyzy.js";
10
10
  import {
11
11
  TaskEntityEventTypes
12
12
  } from "../../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
13
- import"../../shared/@ai-setting/roy-agent-core-1380b0re.js";
14
- import"../../shared/@ai-setting/roy-agent-core-eaj0b1hm.js";
13
+ import"../../shared/@ai-setting/roy-agent-core-4cgkj7v0.js";
14
+ import"../../shared/@ai-setting/roy-agent-core-44g3synv.js";
15
15
  import {
16
16
  SQLiteTaskStore,
17
17
  getDefaultTaskDbPath
18
18
  } from "../../shared/@ai-setting/roy-agent-core-zdzkzx5g.js";
19
- import"../../shared/@ai-setting/roy-agent-core-apz6v22z.js";
19
+ import"../../shared/@ai-setting/roy-agent-core-pq1q854s.js";
20
20
  import"../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
21
- import"../../shared/@ai-setting/roy-agent-core-mmnac1s6.js";
21
+ import"../../shared/@ai-setting/roy-agent-core-tycbpm17.js";
22
22
  import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
23
23
  import"../../shared/@ai-setting/roy-agent-core-r0t34bbh.js";
24
24
  import"../../shared/@ai-setting/roy-agent-core-rn57psp0.js";
@@ -8,13 +8,13 @@ import {
8
8
  formatExtractorInput,
9
9
  formatExtractorInputFromDescription,
10
10
  parseExtractorOutput
11
- } from "../../../shared/@ai-setting/roy-agent-core-1ecgh5ya.js";
11
+ } from "../../../shared/@ai-setting/roy-agent-core-yqxrekhg.js";
12
12
  import"../../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
13
13
  import"../../../shared/@ai-setting/roy-agent-core-1mrc9a1r.js";
14
14
  import"../../../shared/@ai-setting/roy-agent-core-bq1gskrf.js";
15
15
  import"../../../shared/@ai-setting/roy-agent-core-jrj30vq3.js";
16
16
  import"../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
17
- import"../../../shared/@ai-setting/roy-agent-core-apz6v22z.js";
17
+ import"../../../shared/@ai-setting/roy-agent-core-pq1q854s.js";
18
18
  import"../../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
19
19
  import"../../../shared/@ai-setting/roy-agent-core-sqt96sam.js";
20
20
  import"../../../shared/@ai-setting/roy-agent-core-dtkbj8fk.js";
@@ -8,7 +8,7 @@ import {
8
8
  grepTool,
9
9
  readFileTool,
10
10
  writeFileTool
11
- } from "../../../shared/@ai-setting/roy-agent-core-vkesx61c.js";
11
+ } from "../../../shared/@ai-setting/roy-agent-core-e9jf4w3z.js";
12
12
  import {
13
13
  getUnderstandImageLLMProvider,
14
14
  resetUnderstandImageLLMProvider,
@@ -19,7 +19,7 @@ import {
19
19
  createQueryBackgroundProcessTool,
20
20
  queryBackgroundProcessTool
21
21
  } from "../../../shared/@ai-setting/roy-agent-core-amkqnyzy.js";
22
- import"../../../shared/@ai-setting/roy-agent-core-eaj0b1hm.js";
22
+ import"../../../shared/@ai-setting/roy-agent-core-44g3synv.js";
23
23
  import"../../../shared/@ai-setting/roy-agent-core-96mj6gvc.js";
24
24
  import"../../../shared/@ai-setting/roy-agent-core-nna4s0qs.js";
25
25
  import"../../../shared/@ai-setting/roy-agent-core-m00kamqp.js";
@@ -9,7 +9,7 @@ import {
9
9
  grepTool,
10
10
  readFileTool,
11
11
  writeFileTool
12
- } from "../../shared/@ai-setting/roy-agent-core-vkesx61c.js";
12
+ } from "../../shared/@ai-setting/roy-agent-core-e9jf4w3z.js";
13
13
  import {
14
14
  getUnderstandImageLLMProvider,
15
15
  resetUnderstandImageLLMProvider,
@@ -22,11 +22,11 @@ import {
22
22
  ToolValidator,
23
23
  getMaxOutputSize,
24
24
  setToolConfigComponent
25
- } from "../../shared/@ai-setting/roy-agent-core-b8wn8yhk.js";
25
+ } from "../../shared/@ai-setting/roy-agent-core-eskgj8nc.js";
26
26
  import"../../shared/@ai-setting/roy-agent-core-ataagh3a.js";
27
27
  import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
28
28
  import"../../shared/@ai-setting/roy-agent-core-amkqnyzy.js";
29
- import"../../shared/@ai-setting/roy-agent-core-eaj0b1hm.js";
29
+ import"../../shared/@ai-setting/roy-agent-core-44g3synv.js";
30
30
  import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
31
31
  import"../../shared/@ai-setting/roy-agent-core-akb8mb9v.js";
32
32
  import"../../shared/@ai-setting/roy-agent-core-02aw62bv.js";
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-0rwymn7m.js";
4
+ } from "./shared/@ai-setting/roy-agent-core-cfqm5w9b.js";
5
5
  import {
6
6
  LLMComponent,
7
7
  LLMConfigSchema,
@@ -27,7 +27,7 @@ import {
27
27
  grepTool,
28
28
  readFileTool,
29
29
  writeFileTool
30
- } from "./shared/@ai-setting/roy-agent-core-vkesx61c.js";
30
+ } from "./shared/@ai-setting/roy-agent-core-e9jf4w3z.js";
31
31
  import {
32
32
  ATTACH_FILE_MAX_BYTES,
33
33
  getUnderstandImageLLMProvider,
@@ -63,7 +63,7 @@ import {
63
63
  BaseEnvironment,
64
64
  generateDescendingId,
65
65
  generateId
66
- } from "./shared/@ai-setting/roy-agent-core-x7sc21ek.js";
66
+ } from "./shared/@ai-setting/roy-agent-core-dnns0v64.js";
67
67
  import {
68
68
  BountyIMInstance,
69
69
  EventSourceComponent,
@@ -76,7 +76,7 @@ import {
76
76
  larkCliHandler,
77
77
  resolveBountyIMSystemPrompt,
78
78
  timerHandler
79
- } from "./shared/@ai-setting/roy-agent-core-wq98qf5y.js";
79
+ } from "./shared/@ai-setting/roy-agent-core-bsxgrqzq.js";
80
80
  import {
81
81
  BUILT_IN_EVENT_SOURCE_TYPES,
82
82
  BUILT_IN_EVENT_SOURCE_TYPE_LIST,
@@ -96,7 +96,7 @@ import {
96
96
  import {
97
97
  TaskTagPlugin,
98
98
  createAutoTaskPlugin
99
- } from "./shared/@ai-setting/roy-agent-core-1ecgh5ya.js";
99
+ } from "./shared/@ai-setting/roy-agent-core-yqxrekhg.js";
100
100
  import {
101
101
  BasePlugin
102
102
  } from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
@@ -131,7 +131,7 @@ import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
131
131
  import {
132
132
  AgentComponent,
133
133
  AgentComponentConfigSchema
134
- } from "./shared/@ai-setting/roy-agent-core-rmesvpff.js";
134
+ } from "./shared/@ai-setting/roy-agent-core-edbhy767.js";
135
135
  import {
136
136
  createInvokeConfig,
137
137
  invoke,
@@ -142,7 +142,7 @@ import {
142
142
  ToolComponent,
143
143
  ToolRegistry,
144
144
  ToolValidator
145
- } from "./shared/@ai-setting/roy-agent-core-b8wn8yhk.js";
145
+ } from "./shared/@ai-setting/roy-agent-core-eskgj8nc.js";
146
146
  import"./shared/@ai-setting/roy-agent-core-ataagh3a.js";
147
147
  import {
148
148
  AskUserError,
@@ -150,11 +150,11 @@ 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-9jsfqc1m.js";
153
+ } from "./shared/@ai-setting/roy-agent-core-m134hen4.js";
154
154
  import"./shared/@ai-setting/roy-agent-core-amkqnyzy.js";
155
155
  import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
156
- import"./shared/@ai-setting/roy-agent-core-1380b0re.js";
157
- import"./shared/@ai-setting/roy-agent-core-eaj0b1hm.js";
156
+ import"./shared/@ai-setting/roy-agent-core-4cgkj7v0.js";
157
+ import"./shared/@ai-setting/roy-agent-core-44g3synv.js";
158
158
  import {
159
159
  SQLiteTaskStore,
160
160
  getDefaultTaskDbPath
@@ -162,11 +162,11 @@ import {
162
162
  import {
163
163
  getBuiltInPrompt,
164
164
  getBuiltInPromptNames
165
- } from "./shared/@ai-setting/roy-agent-core-apz6v22z.js";
165
+ } from "./shared/@ai-setting/roy-agent-core-pq1q854s.js";
166
166
  import"./shared/@ai-setting/roy-agent-core-c1v263jn.js";
167
167
  import {
168
168
  AgentRegistry
169
- } from "./shared/@ai-setting/roy-agent-core-mmnac1s6.js";
169
+ } from "./shared/@ai-setting/roy-agent-core-tycbpm17.js";
170
170
  import {
171
171
  XDG_PATHS,
172
172
  getXDGPath,
@@ -2,28 +2,34 @@ import {
2
2
  createLogger,
3
3
  init_logger
4
4
  } from "./roy-agent-core-nna4s0qs.js";
5
+ import {
6
+ __require
7
+ } from "./roy-agent-core-fs0mn2jk.js";
5
8
 
6
9
  // src/env/task/delegate/process-registry.ts
7
10
  import { AsyncLocalStorage } from "async_hooks";
8
11
 
9
12
  // src/util/process/process-tree-killer.ts
10
13
  init_logger();
11
- import {
12
- spawn as _childProcessSpawn,
13
- spawnSync as _childProcessSpawnSync
14
- } from "child_process";
15
14
  var logger = createLogger("process-tree-killer");
15
+ function getChildProcess() {
16
+ return __require("child_process");
17
+ }
16
18
  var spawnInjector;
17
19
  function spawn(cmd, args, opts) {
18
20
  if (spawnInjector)
19
21
  return spawnInjector(cmd, args, opts);
20
- return _childProcessSpawn(cmd, args, opts);
22
+ return getChildProcess().spawn(cmd, args, opts);
21
23
  }
22
24
  var spawnSyncInjector;
23
25
  function spawnSyncFn(cmd, args, opts) {
24
26
  if (spawnSyncInjector)
25
27
  return spawnSyncInjector(cmd, args, opts);
26
- return _childProcessSpawnSync(cmd, args, opts);
28
+ const cp = getChildProcess();
29
+ if (typeof cp.spawnSync !== "function") {
30
+ return;
31
+ }
32
+ return cp.spawnSync(cmd, args, opts);
27
33
  }
28
34
  var platformOverride;
29
35
  function currentPlatform() {
@@ -43,12 +49,14 @@ function isProcessAlivePosix(pid) {
43
49
  }
44
50
  function isProcessAliveWindows(pid) {
45
51
  try {
46
- const { stdout } = spawnSyncFn("tasklist", ["/fi", `PID eq ${pid}`, "/nh"], {
52
+ const result = spawnSyncFn("tasklist", ["/fi", `PID eq ${pid}`, "/nh"], {
47
53
  stdio: ["ignore", "pipe", "ignore"],
48
54
  windowsHide: true,
49
55
  timeout: 3000
50
56
  });
51
- return stdout.toString().includes(String(pid));
57
+ if (!result)
58
+ return true;
59
+ return result.stdout.toString().includes(String(pid));
52
60
  } catch {
53
61
  return true;
54
62
  }
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  ProcessRegistry,
3
3
  runWithProcessRegistryAsync
4
- } from "./roy-agent-core-eaj0b1hm.js";
4
+ } from "./roy-agent-core-44g3synv.js";
5
5
  import {
6
6
  builtInPrompts
7
- } from "./roy-agent-core-apz6v22z.js";
7
+ } from "./roy-agent-core-pq1q854s.js";
8
8
  import {
9
9
  runWithBgTaskIdAsync
10
10
  } from "./roy-agent-core-c1v263jn.js";
11
11
  import {
12
12
  DEFAULT_SUBAGENT_PROMPT
13
- } from "./roy-agent-core-mmnac1s6.js";
13
+ } from "./roy-agent-core-tycbpm17.js";
14
14
  import {
15
15
  TaskHookPoints
16
16
  } from "./roy-agent-core-1pg0fepg.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  TaskTagPlugin,
3
3
  createLarkCliTaskNotifyHook
4
- } from "./roy-agent-core-1ecgh5ya.js";
4
+ } from "./roy-agent-core-yqxrekhg.js";
5
5
  import {
6
6
  envKeyToConfigKey
7
7
  } from "./roy-agent-core-7hh0brvs.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  builtInPrompts
3
- } from "./roy-agent-core-apz6v22z.js";
3
+ } from "./roy-agent-core-pq1q854s.js";
4
4
  import {
5
5
  getXDGPath
6
6
  } from "./roy-agent-core-qxnbvgwe.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createAutoTaskPlugin
3
- } from "./roy-agent-core-1ecgh5ya.js";
3
+ } from "./roy-agent-core-yqxrekhg.js";
4
4
  import {
5
5
  ContextError,
6
6
  ErrorCodes
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  getCurrentProcessRegistry,
9
9
  killProcessTree
10
- } from "./roy-agent-core-eaj0b1hm.js";
10
+ } from "./roy-agent-core-44g3synv.js";
11
11
  import {
12
12
  init_decorator,
13
13
  wrapFunction
@@ -3,14 +3,14 @@ import {
3
3
  } from "./roy-agent-core-8n0e62y4.js";
4
4
  import {
5
5
  truncateOutputInline
6
- } from "./roy-agent-core-b8wn8yhk.js";
6
+ } from "./roy-agent-core-eskgj8nc.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-mmnac1s6.js";
13
+ } from "./roy-agent-core-tycbpm17.js";
14
14
  import {
15
15
  ContextError
16
16
  } from "./roy-agent-core-ctdhjv68.js";
@@ -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();
@@ -8,7 +8,7 @@ import {
8
8
  BackgroundTaskManager,
9
9
  createDelegateTool,
10
10
  createStopTool
11
- } from "./roy-agent-core-1380b0re.js";
11
+ } from "./roy-agent-core-4cgkj7v0.js";
12
12
  import {
13
13
  SQLiteTaskStore,
14
14
  getDefaultTaskDbPath
@@ -1565,7 +1565,253 @@ outputs: [] # 输出定义(可空)
1565
1565
  - ❌ 不要 \`delegate_task\` / \`stop_task\`(deniedTools 已禁,禁止递归委托)
1566
1566
  - ❌ 不要跳过 \`workflow_validate\`
1567
1567
  - ❌ 不要自动 merge / push / tag
1568
- - ❌ 不要硬编码大段 text(应引用 \`{{input.x}}\` 模板)`
1568
+ - ❌ 不要硬编码大段 text(应引用 \`{{input.x}}\` 模板)`,
1569
+ "task-organizer": `# Task Organizer(任务整理助手)
1570
+
1571
+ ## 你的身份
1572
+
1573
+ 你是 Roy 系统的 **task-organizer** 子代理(type=sub),专门负责**维护任务树形态健康**。
1574
+ 其它 agent 在创建任务时遵循"先 \`task_tree({depth: 1})\` 再 \`task_create({parent_task_id: ...})\`"
1575
+ 的强约束(参考 roy prompt 的 Task Tree Hygiene 章节);你的职责是**事后巡检 + 整理 + 修复**:
1576
+ 把已存在的脏树(孤儿 / 重复 / 根任务膨胀)还原到健康的 tree shape。
1577
+
1578
+ - **名称**: task-organizer
1579
+ - **角色**: 任务树整理专家(re-parent / merge / archive / delete)
1580
+ - **输入**: 用户指令("整理任务"、"收敛根任务"、"归档测试任务"、"合并重复任务"等)
1581
+ - **输出**: 结构化 JSON 报告 + 操作记录(操作前 dry-run,重要操作通过 \`task_operation_create\` 记录原因)
1582
+
1583
+ ---
1584
+
1585
+ ## \uD83C\uDF32 树形健康目标(铁律)
1586
+
1587
+ | 指标 | 目标 | 说明 |
1588
+ |------|------|------|
1589
+ | **非归档根任务数量** | **10-20** | 根任务膨胀 = 任务空间失控 |
1590
+ | **根任务类型分布** | **100% longterm** | 根任务 = 长期愿景/方向,不能是 normal/cycle |
1591
+ | **最大深度** | **≤ 5** | 过深 = 必须上提 / 重新组织 |
1592
+ | **每个父任务子节点数** | **≤ 50** | 超过 = 拆分子父任务 |
1593
+ | **孤儿率** | **< 5%** | 孤儿 = 无 parent 且无明确主题的根任务 |
1594
+
1595
+ > 核心原则:**根任务越少、longterm 化越彻底,任务空间越能反映用户的长期愿景和方向。**
1596
+ > \`task_tree --depth=N\` 是你观察树形是否健康的主要工具,要养成**多颗粒度**查看的习惯。
1597
+
1598
+ ### Hard Rules(自动触发)
1599
+
1600
+ - 根任务 **> 20 个** = **必须** 合并 / re-parent / 归档
1601
+ - 根任务 **不是 longterm** = **必须** re-parent 到任务树中语义最匹配的有意义祖先节点下
1602
+ (不一定是 longterm 根;可以是 longterm 根下的子/孙任务;如果实在找不到合适的 longterm 域,
1603
+ 可以创建一个新的 longterm 父任务来容纳,但**禁止无脑新建根**)
1604
+ - 根任务 **> 5 层深度** = **必须** 上提 / 重新组织
1605
+ - 重复任务(相似 title + tags)= **合并**(保留最新 + operations 合并)
1606
+
1607
+ ---
1608
+
1609
+ ## \uD83C\uDFAF 核心目标:把根任务收敛到 10-20 个 longterm 根,并把散落的非 longterm 根挂到任务树中最合适的位置
1610
+
1611
+ 你的最重要工作是**把当前脏树的根任务重新挂载到任务树中语义最匹配的有意义祖先节点下(不一定是 longterm 根)**,使得:
1612
+
1613
+ \`\`\`
1614
+ \uD83C\uDF33 健康的 Roy 任务树
1615
+ ├── [Longterm] A 方向(根 #100)
1616
+ │ ├── normal 子任务 #101
1617
+ │ ├── normal 子任务 #102
1618
+ │ └── cycle 子任务 #103
1619
+ ├── [Longterm] B 方向(根 #200)
1620
+ │ ├── normal 子任务 #201
1621
+ │ └── ...
1622
+ ├── [Longterm] C 方向(根 #300)
1623
+ ...
1624
+ └── [Longterm] T 方向(根 #900) ← 10-20 个 longterm 根
1625
+ \`\`\`
1626
+
1627
+ 而不是:
1628
+
1629
+ \`\`\`
1630
+ ❌ 失控的任务树
1631
+ ├── normal 根 #1 ← 应挂到 longterm
1632
+ ├── normal 根 #2 ← 应挂到 longterm
1633
+ ├── cycle 根 #3 ← 应挂到 longterm
1634
+ ├── normal 根 #4 ← 应挂到 longterm
1635
+ ... 60+ 根 ...
1636
+ \`\`\`
1637
+
1638
+ > 注意:散落任务的挂载目标**不一定是 longterm 根**,可以是 longterm 根下任意深度的子/孙任务
1639
+ > (沿树找语义最匹配节点)。例如下面的孙任务挂载场景:
1640
+ >
1641
+ > \`\`\`
1642
+ > \uD83C\uDF33 真实的 Roy 任务树(多深度挂载示例)
1643
+ > └── [Longterm] Roy 系统(根 #100)
1644
+ > ├── [Longterm] core 包
1645
+ > │ ├── [Longterm] agent-component 模块
1646
+ > │ │ └── [Normal] 修复 ask_user 工具超时 bug ← ✅ 散落任务挂这里(孙任务)
1647
+ > │ └── [Longterm] tool-component 模块
1648
+ > │ └── [Normal] 新增 ask_user 多模态输入支持
1649
+ > └── [Longterm] cli 包
1650
+ > └── [Normal] roy-agent 二进制发布流程优化
1651
+ > \`\`\`
1652
+
1653
+ ---
1654
+
1655
+ ## \uD83D\uDEE0 你的工具(白名单)
1656
+
1657
+ 你只能用以下工具,**没有 bash / edit_file / 写文件的能力**:
1658
+
1659
+ | 工具 | 用途 |
1660
+ |------|------|
1661
+ | \`task_search\` | 关键词搜索(title/description/goals/tags/operations) |
1662
+ | \`task_list\` | 按 status/priority/type/depth 列出任务 |
1663
+ | \`task_get\` | 查看任务详情(含 operations) |
1664
+ | \`task_tree\` | **关键工具** — 多颗粒度观察任务树 |
1665
+ | \`task_operation_list\` | 查看任务的操作记录 |
1666
+ | \`task_create\` | **必要时** 创建新的 longterm 父任务来容纳非 longterm 根 |
1667
+ | \`task_update\` | **关键工具** — 改 \`parent_task_id\`(re-parent)、\`type\`、\`status\` 等 |
1668
+ | \`task_complete\` | 标记 normal 任务完成(仅 normal) |
1669
+ | \`task_batch_archive\` | 批量归档(已完成 + 历史价值) |
1670
+ | \`task_batch_delete\` | 批量删除(测试/垃圾/重复) |
1671
+ | \`task_delete\` | 单个删除 |
1672
+ | \`task_operation_create\` | 记录批量操作原因(**强烈推荐**) |
1673
+
1674
+ > ⚠️ **没有 bash 工具** — 你无法执行 shell 命令。所有工作都只能通过任务管理工具完成。
1675
+
1676
+ ---
1677
+
1678
+ ## \uD83D\uDCCB 整理工作流(按顺序执行)
1679
+
1680
+ ### 第 1 步:观察树形
1681
+
1682
+ \`\`\`bash
1683
+ # 1.1 看根任务全景
1684
+ task_tree({depth: 0})
1685
+
1686
+ # 1.2 看二级树
1687
+ task_tree({depth: 2})
1688
+
1689
+ # 1.3 看所有 longterm 根(attach 目标池)
1690
+ task_list({ type: "longterm", status: "active" })
1691
+
1692
+ # 1.4 看所有非归档根任务
1693
+ task_list({ depth: 0, include_archived: false })
1694
+ \`\`\`
1695
+
1696
+ 记录:当前 root count / max depth / 类型分布 / 是否有明显的非 longterm 根。
1697
+
1698
+ ### 第 2 步:分类非 longterm 根
1699
+
1700
+ 对每个根任务,分类:
1701
+
1702
+ - **正常 longterm 根**:跳过
1703
+ - **normal 根**:需要 re-parent 到匹配的 longterm 父任务
1704
+ - **cycle 根**:需要 re-parent 到匹配的 longterm 父任务(除非它本身就是 longterm 级的周期工作)
1705
+ - **纯测试/临时根**:批量归档或删除
1706
+ - **重复根**:合并
1707
+
1708
+ ### 第 3 步:Re-parent 非 longterm 根(核心操作)
1709
+
1710
+ 对每个待 re-parent 的根任务:
1711
+
1712
+ 1. 用 \`task_get({ task_id: N })\` 读详情,理解语义
1713
+ 2. 用 \`task_list({ type: "longterm" })\` 找到 longterm 根(attach 目标池的顶层)
1714
+ 3. 用 \`task_tree --depth=3\` 或更深的搜索找到 longterm 根下所有子/孙任务(attach 目标池的深层)
1715
+ 4. 综合 2+3 的结果,按"**挂得深但语义匹配**"优先原则选定 attach 目标
1716
+ 5. 用 \`task_update({ task_id: N, parent_task_id: <matching_id> })\` 重新挂载
1717
+ 6. 用 \`task_operation_create\` 记录原因("Re-parented normal root #N to #M (semantic match: ..., depth: X)")
1718
+
1719
+ **匹配 attach 目标的优先级**(沿 task_tree 自上而下找语义最匹配的有意义祖先):
1720
+
1721
+ 1. **现有 longterm 根**(最匹配主题)→ 强优先(避免新增根)
1722
+ 2. **现有 longterm 根**(次匹配主题)→ 次优
1723
+ 3. **现有 longterm 根的子/孙任务**(最匹配主题)→ ✅ **完全合法**!
1724
+ 例:把"实现 X 模块的某个函数"挂到 longterm 根"Roy 系统" → 子任务"core 包" → 孙任务"agent-component 模块" 下
1725
+ 4. **现有 longterm 根的子/孙任务**(次匹配主题)→ 兜底
1726
+ 5. 全部找不到 → **创建新的 longterm 根**(用 \`task_create({ type: "longterm", parent_task_id: null })\`),
1727
+ 但**禁止无脑新建** — 至少 2-3 个 normal 根要明显属于同一新主题时才建
1728
+
1729
+ **关键原则**:挂载目标**不一定是 longterm 根**,可以是 longterm 根下任意深度的子/孙任务,
1730
+ 关键是**沿 task_tree 找语义最匹配的有意义节点**。**挂得"深"比挂得"错"好**。
1731
+
1732
+ **禁止**:
1733
+ - ❌ 不要把不同 longterm 域的孤儿 attach 到错误根
1734
+ - ❌ 不要把 normal 根硬塞给不相干的 longterm 父任务
1735
+ - ❌ 不要 re-parent 已 completed 的历史任务(破坏历史语义)
1736
+
1737
+ **避免子任务过载**:
1738
+ 挂载前先看 attach 目标已有多少子任务:**超过 20 个时优先往下一层孙任务挂**,避免单父过载。
1739
+ 如果整个分支都过载,再考虑**新建一个同主题子任务**作为中间层(而不是直接挂到根)。
1740
+
1741
+ ### 第 4 步:合并重复 / 批量清理
1742
+
1743
+ **合并重复**:
1744
+ - 保留最新 + 最完善的一条
1745
+ - 用 \`task_batch_delete\` 删除副本(reason: "merged into #N")
1746
+
1747
+ **批量清理**:
1748
+ - 测试任务(标题含 test/测试/demo/mock/sample/试验)→ \`task_batch_delete\`
1749
+ - 已完成 + 历史价值(调研/检索/旧 fix)→ \`task_batch_archive\`
1750
+ - 长期未更新(> 30 天 status=active 但无 progress)→ 标记 paused 或 archive
1751
+
1752
+ ### 第 5 步:报告
1753
+
1754
+ 输出 JSON 报告:
1755
+
1756
+ \`\`\`json
1757
+ {
1758
+ "before": { "root_count": 28, "non_longterm_root_count": 15, "max_depth": 7 },
1759
+ "after": { "root_count": 12, "non_longterm_root_count": 0, "max_depth": 4 },
1760
+ "reparent": [
1761
+ { "task_id": 1234, "from": null, "to": 2068, "type": "normal", "reason": "matched [Longterm] roy-agent 开源" }
1762
+ ],
1763
+ "merge": [{ "kept": 100, "deleted": [101, 102], "reason": "duplicate" }],
1764
+ "archive": [{ "task_ids": [8001, 8002], "reason": "completed > 30d" }],
1765
+ "delete": [{ "task_ids": [9001, 9002], "reason": "test tasks" }],
1766
+ "next_steps": ["建议保留 #N 作为 [Longterm] X 方向的根"]
1767
+ }
1768
+ \`\`\`
1769
+
1770
+ ---
1771
+
1772
+ ## \uD83D\uDEA8 禁止操作
1773
+
1774
+ - ❌ **不要**无脑新建根任务(必须确认至少 2-3 个非 longterm 根明显同主题才建)
1775
+ - ❌ **不要**修改 longterm 根任务的语义(title / description / goals)
1776
+ - ❌ **不要**把不同 longterm 域的根 attach 到错误根
1777
+ - ❌ **不要**re-parent 已 completed 的历史任务
1778
+ - ❌ **不要**批量操作前不 dry-run
1779
+ - ❌ **不要**在没有 \`task_operation_create\` 记录的情况下做批量动作
1780
+
1781
+ ---
1782
+
1783
+ ## 类型修正指南
1784
+
1785
+ 如果发现任务的 \`type\` 与实际情况不符,用 \`task_update({ type: ... })\` 修正:
1786
+
1787
+ | 现状 | 应改为 | 判断依据 |
1788
+ |------|--------|----------|
1789
+ | \`normal\` 但内容明显是周期性的 | → \`cycle\` | 标题含"周报/日报/月报/定期/每日/每周/巡检/备份" |
1790
+ | \`normal\` 但描述抽象无明确完成条件 | → \`longterm\` | 愿景类描述,无法一次完成 |
1791
+ | \`cycle\` 但只是普通任务 | → \`normal\` | 没有周期性特征 |
1792
+
1793
+ ---
1794
+
1795
+ ## 关键双维度记录(批量操作必填)
1796
+
1797
+ 每次批量操作都必须用 \`task_operation_create\` 留下双维度记录:
1798
+
1799
+ - **milestone_type**: \`milestone\`("我做了什么")或 \`progress\`("我推进到 X 状态")
1800
+ - **milestone_title**: 一句话标题(如 "Re-parented 5 non-longterm roots to [Longterm] roy-agent")
1801
+ - **milestone_description**: 详细描述(操作范围、影响)
1802
+ - **process_description**: 100-150 字符简要过程
1803
+
1804
+ ---
1805
+
1806
+ ## 终止与报告
1807
+
1808
+ 整理完成后必须输出最终 JSON 报告,然后一句话总结:
1809
+
1810
+ > ✅ 任务树整理完成。根任务从 N 收敛到 M(目标 10-20),其中 longterm 占比从 X% 提升到 100%,re-parent/merge/archive/delete 共 K 项。详见 operations。
1811
+
1812
+ 如果没有任何改动:
1813
+
1814
+ > ✅ 任务树形态良好(root=N, depth=X, non_longterm_root=0)。无需操作。`
1569
1815
  };
1570
1816
  var WORKFLOW_EXTRACT_PROMPT = builtInPrompts["workflow-extract"];
1571
1817
  function getBuiltInPromptNames() {
@@ -172,6 +172,37 @@ class AgentRegistry {
172
172
  };
173
173
  this.agents.set(name, agent);
174
174
  }
175
+ registerTaskOrganizer() {
176
+ const name = "task-organizer";
177
+ if (this.agents.has(name))
178
+ return;
179
+ const agent = {
180
+ name,
181
+ type: "sub",
182
+ description: "任务树整理子智能体 — 把非 longterm 类型的根任务重新挂载到 longterm 父任务下,根任务收敛到 10-20 个;维护任务树形态健康(re-parent / merge / archive / delete)。Task #2348。",
183
+ systemPromptRef: "task-organizer",
184
+ allowedTools: [
185
+ "task_create",
186
+ "task_get",
187
+ "task_list",
188
+ "task_update",
189
+ "task_delete",
190
+ "task_complete",
191
+ "task_tree",
192
+ "task_search",
193
+ "task_batch_archive",
194
+ "task_batch_delete",
195
+ "task_operation_create",
196
+ "task_operation_get",
197
+ "task_operation_list",
198
+ "task_operation_update",
199
+ "task_operation_delete"
200
+ ],
201
+ deniedTools: ["delegate_task", "stop_task"],
202
+ maxIterations: 30
203
+ };
204
+ this.agents.set(name, agent);
205
+ }
175
206
  registerJsonExtractAgent() {
176
207
  const name = "json-extract";
177
208
  if (this.agents.has(name))
@@ -445,6 +476,13 @@ __legacyDecorateClassTS([
445
476
  log: true
446
477
  })
447
478
  ], AgentRegistry.prototype, "registerWorkflowRunner", null);
479
+ __legacyDecorateClassTS([
480
+ TracedAs("agent.registry.registerTaskOrganizer", {
481
+ recordParams: false,
482
+ recordResult: true,
483
+ log: true
484
+ })
485
+ ], AgentRegistry.prototype, "registerTaskOrganizer", null);
448
486
  __legacyDecorateClassTS([
449
487
  TracedAs("agent.registry.registerWorkflowCreator", {
450
488
  recordParams: false,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./roy-agent-core-1mrc9a1r.js";
7
7
  import {
8
8
  WORKFLOW_EXTRACT_PROMPT
9
- } from "./roy-agent-core-apz6v22z.js";
9
+ } from "./roy-agent-core-pq1q854s.js";
10
10
  import {
11
11
  TaskHookPoints
12
12
  } from "./roy-agent-core-1pg0fepg.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-core",
3
- "version": "1.6.15",
3
+ "version": "1.6.17",
4
4
  "type": "module",
5
5
  "description": "Core SDK for roy-agent - Environment, Components, Tools, Sessions, Tasks",
6
6
  "main": "./dist/index.js",