@ai-setting/roy-agent-core 1.5.58 → 1.5.60
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/agent/index.js +2 -2
- package/dist/env/event-source/index.js +2 -2
- package/dist/env/index.js +9 -9
- package/dist/env/llm/index.js +2 -2
- package/dist/env/prompt/index.js +1 -1
- package/dist/env/task/delegate/index.js +1 -1
- package/dist/env/task/index.js +4 -4
- package/dist/env/task/plugins/index.js +1 -1
- package/dist/env/task/storage/index.js +1 -1
- package/dist/env/task/tools/index.js +8 -2
- package/dist/index.js +11 -11
- package/dist/shared/@ai-setting/{roy-agent-core-e1704378.js → roy-agent-core-3s9va046.js} +198 -8
- package/dist/shared/@ai-setting/{roy-agent-core-q16bh5e9.js → roy-agent-core-8am1xdvb.js} +21 -7
- package/dist/shared/@ai-setting/{roy-agent-core-w4f871e2.js → roy-agent-core-cgq7btak.js} +233 -34
- package/dist/shared/@ai-setting/{roy-agent-core-0hhxwz5f.js → roy-agent-core-dkevkmas.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-6ph5va4n.js → roy-agent-core-hg3q4f82.js} +19 -9
- package/dist/shared/@ai-setting/{roy-agent-core-65yjzwv5.js → roy-agent-core-nd3amf4x.js} +5 -2
- package/dist/shared/@ai-setting/{roy-agent-core-6s3vec2y.js → roy-agent-core-qqhbxq56.js} +72 -5
- package/dist/shared/@ai-setting/{roy-agent-core-zkwe508t.js → roy-agent-core-s2zz85a9.js} +19 -2
- package/dist/shared/@ai-setting/{roy-agent-core-5c2mfq1q.js → roy-agent-core-t3367jkk.js} +2 -0
- package/dist/shared/@ai-setting/{roy-agent-core-skaha0yj.js → roy-agent-core-wqzkxab9.js} +32 -5
- package/dist/shared/@ai-setting/{roy-agent-core-sfqx98j6.js → roy-agent-core-xztzw1yb.js} +1 -1
- package/package.json +1 -1
package/dist/env/agent/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentComponent,
|
|
3
3
|
AgentComponentConfigSchema
|
|
4
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
5
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
4
|
+
} from "../../shared/@ai-setting/roy-agent-core-hg3q4f82.js";
|
|
5
|
+
import"../../shared/@ai-setting/roy-agent-core-nd3amf4x.js";
|
|
6
6
|
import"../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-nx3c3ce2.js";
|
|
8
8
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
builtInHandlers,
|
|
5
5
|
getBuiltInHandler,
|
|
6
6
|
larkCliHandler
|
|
7
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
7
|
+
} from "../../shared/@ai-setting/roy-agent-core-s2zz85a9.js";
|
|
8
8
|
import {
|
|
9
9
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
10
10
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
validateEventSourceConfig
|
|
16
16
|
} from "../../shared/@ai-setting/roy-agent-core-xb4hvk1m.js";
|
|
17
17
|
import"../../shared/@ai-setting/roy-agent-core-v8xa6vs8.js";
|
|
18
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-qqhbxq56.js";
|
|
19
19
|
import"../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.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-
|
|
3
|
+
} from "../shared/@ai-setting/roy-agent-core-t3367jkk.js";
|
|
4
4
|
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-s2zz85a9.js";
|
|
9
9
|
import {
|
|
10
10
|
EventSourceInitHooks,
|
|
11
11
|
getDefaultConfigForType,
|
|
@@ -17,7 +17,7 @@ import"../shared/@ai-setting/roy-agent-core-v8xa6vs8.js";
|
|
|
17
17
|
import {
|
|
18
18
|
PluginComponent
|
|
19
19
|
} from "../shared/@ai-setting/roy-agent-core-ap59dpve.js";
|
|
20
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
20
|
+
import"../shared/@ai-setting/roy-agent-core-qqhbxq56.js";
|
|
21
21
|
import"../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
22
22
|
import {
|
|
23
23
|
WorkflowComponent
|
|
@@ -38,22 +38,22 @@ import"../shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
|
38
38
|
import {
|
|
39
39
|
AgentComponent,
|
|
40
40
|
AgentComponentConfigSchema
|
|
41
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
42
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
41
|
+
} from "../shared/@ai-setting/roy-agent-core-hg3q4f82.js";
|
|
42
|
+
import"../shared/@ai-setting/roy-agent-core-nd3amf4x.js";
|
|
43
43
|
import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
44
44
|
import {
|
|
45
45
|
TaskComponent
|
|
46
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
46
|
+
} from "../shared/@ai-setting/roy-agent-core-wqzkxab9.js";
|
|
47
47
|
import"../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
48
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
49
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
48
|
+
import"../shared/@ai-setting/roy-agent-core-dkevkmas.js";
|
|
49
|
+
import"../shared/@ai-setting/roy-agent-core-cgq7btak.js";
|
|
50
50
|
import"../shared/@ai-setting/roy-agent-core-nx3c3ce2.js";
|
|
51
51
|
import {
|
|
52
52
|
XDG_PATHS,
|
|
53
53
|
getXDGPath,
|
|
54
54
|
getXDGPaths
|
|
55
55
|
} from "../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
56
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
56
|
+
import"../shared/@ai-setting/roy-agent-core-3s9va046.js";
|
|
57
57
|
import"../shared/@ai-setting/roy-agent-core-t94ktchq.js";
|
|
58
58
|
import"../shared/@ai-setting/roy-agent-core-92z6t4he.js";
|
|
59
59
|
import {
|
package/dist/env/llm/index.js
CHANGED
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
ProviderCapabilitiesSchema,
|
|
9
9
|
ProviderConfigSchema,
|
|
10
10
|
ProviderManager
|
|
11
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
11
|
+
} from "../../shared/@ai-setting/roy-agent-core-xztzw1yb.js";
|
|
12
12
|
import {
|
|
13
13
|
createInvokeConfig,
|
|
14
14
|
invoke,
|
|
15
15
|
invokeNonStream,
|
|
16
16
|
parseModelString
|
|
17
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
17
|
+
} from "../../shared/@ai-setting/roy-agent-core-nd3amf4x.js";
|
|
18
18
|
import"../../shared/@ai-setting/roy-agent-core-ctdhjv68.js";
|
|
19
19
|
import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-rgckng3p.js";
|
package/dist/env/prompt/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
PromptConfigSchema,
|
|
4
4
|
PromptPathSchema,
|
|
5
5
|
PromptRenderer
|
|
6
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../shared/@ai-setting/roy-agent-core-8am1xdvb.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
8
8
|
import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
|
|
9
9
|
import"../../shared/@ai-setting/roy-agent-core-rgckng3p.js";
|
|
@@ -3,7 +3,7 @@ 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-dkevkmas.js";
|
|
7
7
|
import"../../../shared/@ai-setting/roy-agent-core-nx3c3ce2.js";
|
|
8
8
|
import"../../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
|
package/dist/env/task/index.js
CHANGED
|
@@ -5,18 +5,18 @@ 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-wqzkxab9.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-dkevkmas.js";
|
|
13
13
|
import {
|
|
14
14
|
SQLiteTaskStore,
|
|
15
15
|
getDefaultTaskDbPath
|
|
16
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
16
|
+
} from "../../shared/@ai-setting/roy-agent-core-cgq7btak.js";
|
|
17
17
|
import"../../shared/@ai-setting/roy-agent-core-nx3c3ce2.js";
|
|
18
18
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
19
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
19
|
+
import"../../shared/@ai-setting/roy-agent-core-3s9va046.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-t94ktchq.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
|
|
22
22
|
import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
formatExtractorInput,
|
|
9
9
|
formatExtractorInputFromDescription,
|
|
10
10
|
parseExtractorOutput
|
|
11
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
11
|
+
} from "../../../shared/@ai-setting/roy-agent-core-qqhbxq56.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
13
13
|
import"../../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
|
|
14
14
|
import"../../../shared/@ai-setting/roy-agent-core-qg4rma4c.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
SQLiteTaskStore,
|
|
3
3
|
getDefaultDataDir,
|
|
4
4
|
getDefaultTaskDbPath
|
|
5
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
} from "../../../shared/@ai-setting/roy-agent-core-cgq7btak.js";
|
|
6
6
|
import"../../../shared/@ai-setting/roy-agent-core-shme7set.js";
|
|
7
7
|
import"../../../shared/@ai-setting/roy-agent-core-7z9b1fm8.js";
|
|
8
8
|
import"../../../shared/@ai-setting/roy-agent-core-c6592r3c.js";
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
batchArchiveTaskTool,
|
|
3
|
+
batchDeleteTaskTool,
|
|
2
4
|
completeTaskTool,
|
|
3
5
|
createTaskTool,
|
|
4
6
|
deleteTaskTool,
|
|
5
7
|
getTaskTool,
|
|
6
8
|
listTasksTool,
|
|
9
|
+
searchTasksTool,
|
|
7
10
|
updateTaskTool
|
|
8
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
11
|
+
} from "../../../shared/@ai-setting/roy-agent-core-3s9va046.js";
|
|
9
12
|
import"../../../shared/@ai-setting/roy-agent-core-y5d04fm3.js";
|
|
10
13
|
import"../../../shared/@ai-setting/roy-agent-core-k05v31rc.js";
|
|
11
14
|
import"../../../shared/@ai-setting/roy-agent-core-shme7set.js";
|
|
@@ -14,9 +17,12 @@ import"../../../shared/@ai-setting/roy-agent-core-c6592r3c.js";
|
|
|
14
17
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
15
18
|
export {
|
|
16
19
|
updateTaskTool,
|
|
20
|
+
searchTasksTool,
|
|
17
21
|
listTasksTool,
|
|
18
22
|
getTaskTool,
|
|
19
23
|
deleteTaskTool,
|
|
20
24
|
createTaskTool,
|
|
21
|
-
completeTaskTool
|
|
25
|
+
completeTaskTool,
|
|
26
|
+
batchDeleteTaskTool,
|
|
27
|
+
batchArchiveTaskTool
|
|
22
28
|
};
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
PromptStore,
|
|
4
4
|
getBuiltInPrompt,
|
|
5
5
|
getBuiltInPromptNames
|
|
6
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "./shared/@ai-setting/roy-agent-core-8am1xdvb.js";
|
|
7
7
|
import {
|
|
8
8
|
LLMComponent,
|
|
9
9
|
LLMConfigSchema,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ModelLimitsSchema,
|
|
12
12
|
ProviderCapabilitiesSchema,
|
|
13
13
|
ProviderConfigSchema
|
|
14
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
14
|
+
} from "./shared/@ai-setting/roy-agent-core-xztzw1yb.js";
|
|
15
15
|
import {
|
|
16
16
|
ConfigComponent
|
|
17
17
|
} from "./shared/@ai-setting/roy-agent-core-prdngx28.js";
|
|
@@ -57,13 +57,13 @@ import {
|
|
|
57
57
|
BaseEnvironment,
|
|
58
58
|
generateDescendingId,
|
|
59
59
|
generateId
|
|
60
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
60
|
+
} from "./shared/@ai-setting/roy-agent-core-t3367jkk.js";
|
|
61
61
|
import {
|
|
62
62
|
EventSourceComponent,
|
|
63
63
|
builtInHandlers,
|
|
64
64
|
getBuiltInHandler,
|
|
65
65
|
larkCliHandler
|
|
66
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
66
|
+
} from "./shared/@ai-setting/roy-agent-core-s2zz85a9.js";
|
|
67
67
|
import {
|
|
68
68
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
69
69
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
} from "./shared/@ai-setting/roy-agent-core-ap59dpve.js";
|
|
83
83
|
import {
|
|
84
84
|
TaskTagPlugin
|
|
85
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
85
|
+
} from "./shared/@ai-setting/roy-agent-core-qqhbxq56.js";
|
|
86
86
|
import {
|
|
87
87
|
BasePlugin
|
|
88
88
|
} from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
@@ -114,26 +114,26 @@ import"./shared/@ai-setting/roy-agent-core-1ce3fqrk.js";
|
|
|
114
114
|
import {
|
|
115
115
|
AgentComponent,
|
|
116
116
|
AgentComponentConfigSchema
|
|
117
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
117
|
+
} from "./shared/@ai-setting/roy-agent-core-hg3q4f82.js";
|
|
118
118
|
import {
|
|
119
119
|
createInvokeConfig,
|
|
120
120
|
invoke,
|
|
121
121
|
invokeNonStream,
|
|
122
122
|
parseModelString
|
|
123
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
123
|
+
} from "./shared/@ai-setting/roy-agent-core-nd3amf4x.js";
|
|
124
124
|
import {
|
|
125
125
|
AskUserError,
|
|
126
126
|
init_workflow_hil
|
|
127
127
|
} from "./shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
128
128
|
import {
|
|
129
129
|
TaskComponent
|
|
130
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
130
|
+
} from "./shared/@ai-setting/roy-agent-core-wqzkxab9.js";
|
|
131
131
|
import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
132
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
132
|
+
import"./shared/@ai-setting/roy-agent-core-dkevkmas.js";
|
|
133
133
|
import {
|
|
134
134
|
SQLiteTaskStore,
|
|
135
135
|
getDefaultTaskDbPath
|
|
136
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
136
|
+
} from "./shared/@ai-setting/roy-agent-core-cgq7btak.js";
|
|
137
137
|
import {
|
|
138
138
|
AgentRegistry
|
|
139
139
|
} from "./shared/@ai-setting/roy-agent-core-nx3c3ce2.js";
|
|
@@ -142,7 +142,7 @@ import {
|
|
|
142
142
|
getXDGPath,
|
|
143
143
|
getXDGPaths
|
|
144
144
|
} from "./shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
145
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
145
|
+
import"./shared/@ai-setting/roy-agent-core-3s9va046.js";
|
|
146
146
|
import"./shared/@ai-setting/roy-agent-core-t94ktchq.js";
|
|
147
147
|
import {
|
|
148
148
|
TaskHookPoints
|
|
@@ -18,6 +18,7 @@ var CreateTaskToolSchema = z.object({
|
|
|
18
18
|
due_date: z.string().optional().describe("Due date (ISO format)"),
|
|
19
19
|
tags: z.array(z.string()).optional().describe("Task tags (for search, stored in task.tags JSON field)"),
|
|
20
20
|
project_path: z.string().describe("Project root path for task positioning. " + "Used to locate the project space for this task. " + "Use 'unknown' if unknown."),
|
|
21
|
+
parent_task_id: z.number().optional().describe("父任务 ID(可选,用于构建任务树)"),
|
|
21
22
|
context: z.string().describe("JSON string with time-space positioning information for task continuity. " + "This field is crucial for Agent task handoff. " + "Core fields: worktree_path (git worktree path), branch (current branch), type (feature/bug/refactor/chore). " + 'Example for coding: {"worktree_path": "/path/worktree", "branch": "feature/xyz", "type": "feature"}. ' + 'Example for other: {"type": "general"}. ' + `If unknown, use '{}' or '{"type":"unknown"}'. ` + "IMPORTANT: Must be a valid JSON string!")
|
|
22
23
|
});
|
|
23
24
|
var GetTaskToolSchema = z.object({
|
|
@@ -25,17 +26,30 @@ var GetTaskToolSchema = z.object({
|
|
|
25
26
|
include_operations: z.boolean().optional().default(false).describe("Include operation records")
|
|
26
27
|
});
|
|
27
28
|
var ListTasksToolSchema = z.object({
|
|
28
|
-
status: z.enum(["todo", "active", "completed", "paused", "cancelled"]).optional(),
|
|
29
|
+
status: z.enum(["todo", "active", "completed", "paused", "cancelled", "archived"]).optional(),
|
|
29
30
|
priority: z.enum(["low", "medium", "high"]).optional(),
|
|
30
31
|
type: z.enum(["normal", "cycle", "longterm"]).optional().describe("Filter by task type"),
|
|
31
32
|
limit: z.number().optional().default(20),
|
|
32
|
-
offset: z.number().optional().default(0)
|
|
33
|
+
offset: z.number().optional().default(0),
|
|
34
|
+
depth: z.number().optional().describe("检索层级深度:0=只根任务(无父任务),1=根+一层子任务,2=根+二层子任务,-1 或忽略=全部"),
|
|
35
|
+
include_archived: z.boolean().optional().default(false).describe("是否包含已归档任务(status=archived 的任务默认被排除)")
|
|
36
|
+
});
|
|
37
|
+
var SearchTasksToolSchema = z.object({
|
|
38
|
+
keywords: z.array(z.string()).describe("关键词列表(AND 逻辑,匹配 title/description/goals/tags/operations)"),
|
|
39
|
+
limit: z.number().optional().default(20).describe("返回数量"),
|
|
40
|
+
offset: z.number().optional().default(0).describe("偏移量"),
|
|
41
|
+
status: z.enum(["todo", "active", "completed", "paused", "cancelled", "archived"]).optional().describe("按状态筛选"),
|
|
42
|
+
priority: z.enum(["low", "medium", "high"]).optional().describe("按优先级筛选"),
|
|
43
|
+
type: z.enum(["normal", "cycle", "longterm"]).optional().describe("按类型筛选"),
|
|
44
|
+
exclude_task_id: z.number().optional().describe("排除的 task ID"),
|
|
45
|
+
depth: z.number().optional().describe("检索层级深度:0=只根任务,1=根+一层子任务,2=根+二层子任务,-1 或忽略=全部"),
|
|
46
|
+
include_archived: z.boolean().optional().default(false).describe("是否包含已归档任务(status=archived 的任务默认被排除)")
|
|
33
47
|
});
|
|
34
48
|
var UpdateTaskToolSchema = z.object({
|
|
35
49
|
task_id: z.number().describe("Task ID"),
|
|
36
50
|
title: z.string().optional(),
|
|
37
51
|
description: z.string().optional(),
|
|
38
|
-
status: z.enum(["todo", "active", "completed", "paused", "cancelled"]).optional(),
|
|
52
|
+
status: z.enum(["todo", "active", "completed", "paused", "cancelled", "archived"]).optional(),
|
|
39
53
|
priority: z.enum(["low", "medium", "high"]).optional(),
|
|
40
54
|
type: z.enum(["normal", "cycle", "longterm"]).optional().describe("Task type"),
|
|
41
55
|
progress: z.number().min(0).max(100).optional(),
|
|
@@ -49,6 +63,13 @@ var UpdateTaskToolSchema = z.object({
|
|
|
49
63
|
var DeleteTaskToolSchema = z.object({
|
|
50
64
|
task_id: z.number().describe("Task ID")
|
|
51
65
|
});
|
|
66
|
+
var BatchArchiveToolSchema = z.object({
|
|
67
|
+
task_ids: z.array(z.number()).describe("要归档的任务 ID 列表"),
|
|
68
|
+
reason: z.string().optional().describe("归档原因(可选,会写入每个任务的 operation 记录)")
|
|
69
|
+
});
|
|
70
|
+
var BatchDeleteToolSchema = z.object({
|
|
71
|
+
task_ids: z.array(z.number()).describe("要删除的任务 ID 列表")
|
|
72
|
+
});
|
|
52
73
|
|
|
53
74
|
// src/env/task/tools/create-tool.ts
|
|
54
75
|
init_env_context();
|
|
@@ -100,6 +121,7 @@ function createTaskTool(taskComponent) {
|
|
|
100
121
|
const sessionId = ctx.session_id || "unknown";
|
|
101
122
|
try {
|
|
102
123
|
const task = await taskComponent.createTask({
|
|
124
|
+
parent_task_id: params.parent_task_id,
|
|
103
125
|
title: params.title,
|
|
104
126
|
description: params.description,
|
|
105
127
|
priority: params.priority,
|
|
@@ -189,21 +211,31 @@ function getTaskTool(taskComponent) {
|
|
|
189
211
|
function listTasksTool(taskComponent) {
|
|
190
212
|
return {
|
|
191
213
|
name: "task_list",
|
|
192
|
-
description: "List tasks with optional filters for status, priority, and
|
|
214
|
+
description: "List tasks with optional filters for status, priority, type, parent_task_id, " + "and depth (hierarchy level). " + `depth: 0=只根任务(无父任务),1=根+一层子任务,2=根+二层子任务,-1 或忽略=全部。
|
|
215
|
+
` + "Returns { tasks, total, limit, offset } where total is the count of all " + "matching tasks BEFORE pagination.",
|
|
193
216
|
parameters: ListTasksToolSchema,
|
|
194
217
|
execute: async (args, ctx) => {
|
|
195
218
|
const params = ListTasksToolSchema.parse(args);
|
|
196
219
|
try {
|
|
197
|
-
const
|
|
220
|
+
const result = await taskComponent.listTasks({
|
|
198
221
|
status: params.status,
|
|
199
222
|
priority: params.priority,
|
|
200
223
|
type: params.type,
|
|
201
224
|
limit: params.limit,
|
|
202
|
-
offset: params.offset
|
|
225
|
+
offset: params.offset,
|
|
226
|
+
depth: params.depth,
|
|
227
|
+
include_archived: params.include_archived
|
|
203
228
|
});
|
|
204
229
|
return {
|
|
205
230
|
success: true,
|
|
206
|
-
output: JSON.stringify({
|
|
231
|
+
output: JSON.stringify({
|
|
232
|
+
tasks: result.tasks,
|
|
233
|
+
total: result.total,
|
|
234
|
+
count: result.tasks.length,
|
|
235
|
+
limit: params.limit,
|
|
236
|
+
offset: params.offset,
|
|
237
|
+
depth: params.depth
|
|
238
|
+
}),
|
|
207
239
|
metadata: { execution_time_ms: 0 }
|
|
208
240
|
};
|
|
209
241
|
} catch (error) {
|
|
@@ -217,6 +249,164 @@ function listTasksTool(taskComponent) {
|
|
|
217
249
|
}
|
|
218
250
|
};
|
|
219
251
|
}
|
|
252
|
+
// src/env/task/tools/search-tool.ts
|
|
253
|
+
function searchTasksTool(taskComponent) {
|
|
254
|
+
return {
|
|
255
|
+
name: "task_search",
|
|
256
|
+
description: "Search tasks by keywords across title, description, goals, tags, and " + "operation records. Use this when you need to find tasks related to a " + "topic, feature, bug, or area of work — even when the keyword is only " + `in description / goals / tags / past operation logs.
|
|
257
|
+
|
|
258
|
+
` + `Returns { tasks, total, limit, offset } so you can paginate large result sets.
|
|
259
|
+
|
|
260
|
+
` + "If `keywords` is empty, returns no results.",
|
|
261
|
+
parameters: SearchTasksToolSchema,
|
|
262
|
+
execute: async (args, ctx) => {
|
|
263
|
+
const params = SearchTasksToolSchema.parse(args);
|
|
264
|
+
try {
|
|
265
|
+
const result = await taskComponent.searchTasksByKeywords(params.keywords, {
|
|
266
|
+
limit: params.limit,
|
|
267
|
+
offset: params.offset,
|
|
268
|
+
excludeTaskId: params.exclude_task_id,
|
|
269
|
+
status: params.status,
|
|
270
|
+
priority: params.priority,
|
|
271
|
+
type: params.type,
|
|
272
|
+
depth: params.depth,
|
|
273
|
+
include_archived: params.include_archived
|
|
274
|
+
});
|
|
275
|
+
return {
|
|
276
|
+
success: true,
|
|
277
|
+
output: JSON.stringify({
|
|
278
|
+
tasks: result.tasks,
|
|
279
|
+
total: result.total,
|
|
280
|
+
limit: params.limit,
|
|
281
|
+
offset: params.offset
|
|
282
|
+
}),
|
|
283
|
+
metadata: { execution_time_ms: 0 }
|
|
284
|
+
};
|
|
285
|
+
} catch (error) {
|
|
286
|
+
return {
|
|
287
|
+
success: false,
|
|
288
|
+
output: "",
|
|
289
|
+
error: error instanceof Error ? error.message : String(error),
|
|
290
|
+
metadata: { execution_time_ms: 0 }
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
// src/env/task/tools/batch-archive-tool.ts
|
|
297
|
+
function batchArchiveTaskTool(taskComponent) {
|
|
298
|
+
return {
|
|
299
|
+
name: "task_batch_archive",
|
|
300
|
+
description: "Batch archive multiple tasks at once. Sets all specified tasks to " + `'archived' status and creates operation records for each.
|
|
301
|
+
|
|
302
|
+
` + "Use this when you need to quickly archive a group of completed, " + `obsolete, or historical tasks (e.g., during task organization).
|
|
303
|
+
|
|
304
|
+
` + "Returns summary of how many tasks were successfully archived " + "and any errors encountered.",
|
|
305
|
+
parameters: BatchArchiveToolSchema,
|
|
306
|
+
execute: async (args, ctx) => {
|
|
307
|
+
const params = BatchArchiveToolSchema.parse(args);
|
|
308
|
+
const taskIds = params.task_ids;
|
|
309
|
+
const sessionId = ctx.session_id || "batch-archive";
|
|
310
|
+
if (!taskIds || taskIds.length === 0) {
|
|
311
|
+
return {
|
|
312
|
+
success: true,
|
|
313
|
+
output: JSON.stringify({ archived_count: 0, errors: [] }),
|
|
314
|
+
metadata: { execution_time_ms: 0 }
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
const results = [];
|
|
318
|
+
let archivedCount = 0;
|
|
319
|
+
for (const taskId of taskIds) {
|
|
320
|
+
try {
|
|
321
|
+
const task = await taskComponent.updateTask(taskId, { status: "archived" });
|
|
322
|
+
if (task) {
|
|
323
|
+
await taskComponent.createOperation({
|
|
324
|
+
taskId,
|
|
325
|
+
sessionId,
|
|
326
|
+
actionType: "completed",
|
|
327
|
+
actionTitle: "Batch archived",
|
|
328
|
+
actionDescription: params.reason || "批量归档(任务整理)"
|
|
329
|
+
});
|
|
330
|
+
archivedCount++;
|
|
331
|
+
results.push({ id: taskId, success: true });
|
|
332
|
+
} else {
|
|
333
|
+
results.push({ id: taskId, success: false, error: "Task not found" });
|
|
334
|
+
}
|
|
335
|
+
} catch (error) {
|
|
336
|
+
results.push({
|
|
337
|
+
id: taskId,
|
|
338
|
+
success: false,
|
|
339
|
+
error: error instanceof Error ? error.message : String(error)
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
const hasErrors = results.some((r) => !r.success);
|
|
344
|
+
return {
|
|
345
|
+
success: !hasErrors,
|
|
346
|
+
output: JSON.stringify({
|
|
347
|
+
archived_count: archivedCount,
|
|
348
|
+
total: taskIds.length,
|
|
349
|
+
errors: results.filter((r) => !r.success).map((r) => ({ id: r.id, error: r.error })),
|
|
350
|
+
results
|
|
351
|
+
}, null, 2),
|
|
352
|
+
metadata: { execution_time_ms: 0 }
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
// src/env/task/tools/batch-delete-tool.ts
|
|
358
|
+
function batchDeleteTaskTool(taskComponent) {
|
|
359
|
+
return {
|
|
360
|
+
name: "task_batch_delete",
|
|
361
|
+
description: "Batch delete multiple tasks at once. Deletes each task and all its " + `operation records.
|
|
362
|
+
|
|
363
|
+
` + "Use this when you need to quickly remove a group of test, temporary, " + `or otherwise worthless tasks (e.g., during task organization).
|
|
364
|
+
|
|
365
|
+
` + "Returns summary of how many tasks were successfully deleted " + "and any errors encountered.",
|
|
366
|
+
parameters: BatchDeleteToolSchema,
|
|
367
|
+
execute: async (args, ctx) => {
|
|
368
|
+
const params = BatchDeleteToolSchema.parse(args);
|
|
369
|
+
const taskIds = params.task_ids;
|
|
370
|
+
if (!taskIds || taskIds.length === 0) {
|
|
371
|
+
return {
|
|
372
|
+
success: true,
|
|
373
|
+
output: JSON.stringify({ deleted_count: 0, errors: [] }),
|
|
374
|
+
metadata: { execution_time_ms: 0 }
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
const results = [];
|
|
378
|
+
let deletedCount = 0;
|
|
379
|
+
for (const taskId of taskIds) {
|
|
380
|
+
try {
|
|
381
|
+
const deleted = await taskComponent.deleteTask(taskId);
|
|
382
|
+
if (deleted) {
|
|
383
|
+
deletedCount++;
|
|
384
|
+
results.push({ id: taskId, success: true });
|
|
385
|
+
} else {
|
|
386
|
+
results.push({ id: taskId, success: false, error: "Task not found" });
|
|
387
|
+
}
|
|
388
|
+
} catch (error) {
|
|
389
|
+
results.push({
|
|
390
|
+
id: taskId,
|
|
391
|
+
success: false,
|
|
392
|
+
error: error instanceof Error ? error.message : String(error)
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
const hasErrors = results.some((r) => !r.success);
|
|
397
|
+
return {
|
|
398
|
+
success: !hasErrors,
|
|
399
|
+
output: JSON.stringify({
|
|
400
|
+
deleted_count: deletedCount,
|
|
401
|
+
total: taskIds.length,
|
|
402
|
+
errors: results.filter((r) => !r.success).map((r) => ({ id: r.id, error: r.error })),
|
|
403
|
+
results
|
|
404
|
+
}, null, 2),
|
|
405
|
+
metadata: { execution_time_ms: 0 }
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
}
|
|
220
410
|
// src/env/task/tools/update-tool.ts
|
|
221
411
|
init_env_context();
|
|
222
412
|
init_logger();
|
|
@@ -374,4 +564,4 @@ function completeTaskTool(taskComponent) {
|
|
|
374
564
|
}
|
|
375
565
|
};
|
|
376
566
|
}
|
|
377
|
-
export { createTaskTool, getTaskTool, listTasksTool, updateTaskTool, deleteTaskTool, completeTaskTool };
|
|
567
|
+
export { createTaskTool, getTaskTool, listTasksTool, searchTasksTool, batchArchiveTaskTool, batchDeleteTaskTool, updateTaskTool, deleteTaskTool, completeTaskTool };
|
|
@@ -105,16 +105,30 @@ var builtInPrompts = {
|
|
|
105
105
|
|
|
106
106
|
## 你的工具
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
你有一组任务查询工具和两个执行工具可用:
|
|
109
109
|
|
|
110
|
-
| 工具 | 描述 |
|
|
111
|
-
|
|
112
|
-
| \`
|
|
113
|
-
| \`
|
|
110
|
+
| 工具 | 类别 | 描述 |
|
|
111
|
+
|------|------|------|
|
|
112
|
+
| \`task_search\` | **查询** | 关键词搜索任务(匹配 title/description/goals/tags/operations),带分页和 relevance 排序 |
|
|
113
|
+
| \`task_get\` | **查询** | 获取单个任务详情(含 operations) |
|
|
114
|
+
| \`task_list\` | **查询** | 按 status/priority/type/depth 列出任务,支持分页 |
|
|
115
|
+
| \`task_operation_list\` | **查询** | 查看任务的操作记录 |
|
|
116
|
+
| \`delegate_task\` | **执行** | 委托复杂/多步骤任务给子智能体执行 |
|
|
117
|
+
| \`bash\` | **执行** | 仅用于执行一行简单的 shell 命令 |
|
|
114
118
|
|
|
115
|
-
###
|
|
119
|
+
### 查询工具(可直接使用)
|
|
116
120
|
|
|
117
|
-
|
|
121
|
+
以下任务查询工具 **不需要委托**,可以直接调用:
|
|
122
|
+
- \`task_search(keywords=["关键词"], limit=10)\` — 搜索相关任务
|
|
123
|
+
- \`task_get(task_id=123)\` — 查看任务详情
|
|
124
|
+
- \`task_list(status="active")\` — 列出任务
|
|
125
|
+
- \`task_operation_list(task_id=123)\` — 查看操作记录
|
|
126
|
+
|
|
127
|
+
> ✅ 用户询问任务状态、搜索已有任务、查看任务详情时,**直接使用查询工具**,无需委托。
|
|
128
|
+
|
|
129
|
+
### 执行工具使用规则
|
|
130
|
+
|
|
131
|
+
**\`delegate_task\`** — 这是你的**主要执行工具**。用于一切复杂、多步骤、需要读文件、运行命令、代码分析、搜索、实现功能等场景。**当不确定用哪个时,选 \`delegate_task\`。**
|
|
118
132
|
|
|
119
133
|
**\`bash\`** — **仅限**以下**一次性简单操作**:
|
|
120
134
|
- 调用一行 \`roy-agent\` 命令(如 \`bun packages/cli/dist/bin/roy-agent.js tasks list\`)
|