@ai-setting/roy-agent-core 1.5.66 → 1.5.67

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/index.js CHANGED
@@ -44,17 +44,17 @@ import"../shared/@ai-setting/roy-agent-core-ecth1zak.js";
44
44
  import"../shared/@ai-setting/roy-agent-core-e25xkv53.js";
45
45
  import {
46
46
  TaskComponent
47
- } from "../shared/@ai-setting/roy-agent-core-z2fxjh6k.js";
47
+ } from "../shared/@ai-setting/roy-agent-core-84vtpbw6.js";
48
48
  import"../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
49
49
  import"../shared/@ai-setting/roy-agent-core-eq52jra7.js";
50
- import"../shared/@ai-setting/roy-agent-core-cgq7btak.js";
50
+ import"../shared/@ai-setting/roy-agent-core-r9y8ct0w.js";
51
51
  import"../shared/@ai-setting/roy-agent-core-nx3c3ce2.js";
52
52
  import {
53
53
  XDG_PATHS,
54
54
  getXDGPath,
55
55
  getXDGPaths
56
56
  } from "../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
57
- import"../shared/@ai-setting/roy-agent-core-3s9va046.js";
57
+ import"../shared/@ai-setting/roy-agent-core-7t0jen73.js";
58
58
  import"../shared/@ai-setting/roy-agent-core-t94ktchq.js";
59
59
  import"../shared/@ai-setting/roy-agent-core-92z6t4he.js";
60
60
  import {
@@ -5,7 +5,7 @@ import {
5
5
  TaskPriorityEnum,
6
6
  TaskStatusEnum,
7
7
  TaskTypeEnum
8
- } from "../../shared/@ai-setting/roy-agent-core-z2fxjh6k.js";
8
+ } from "../../shared/@ai-setting/roy-agent-core-84vtpbw6.js";
9
9
  import {
10
10
  TaskEntityEventTypes
11
11
  } from "../../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
@@ -13,10 +13,10 @@ import"../../shared/@ai-setting/roy-agent-core-eq52jra7.js";
13
13
  import {
14
14
  SQLiteTaskStore,
15
15
  getDefaultTaskDbPath
16
- } from "../../shared/@ai-setting/roy-agent-core-cgq7btak.js";
16
+ } from "../../shared/@ai-setting/roy-agent-core-r9y8ct0w.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-3s9va046.js";
19
+ import"../../shared/@ai-setting/roy-agent-core-7t0jen73.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";
@@ -2,7 +2,7 @@ import {
2
2
  SQLiteTaskStore,
3
3
  getDefaultDataDir,
4
4
  getDefaultTaskDbPath
5
- } from "../../../shared/@ai-setting/roy-agent-core-cgq7btak.js";
5
+ } from "../../../shared/@ai-setting/roy-agent-core-r9y8ct0w.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";
@@ -8,7 +8,7 @@ import {
8
8
  listTasksTool,
9
9
  searchTasksTool,
10
10
  updateTaskTool
11
- } from "../../../shared/@ai-setting/roy-agent-core-3s9va046.js";
11
+ } from "../../../shared/@ai-setting/roy-agent-core-7t0jen73.js";
12
12
  import"../../../shared/@ai-setting/roy-agent-core-y5d04fm3.js";
13
13
  import"../../../shared/@ai-setting/roy-agent-core-k05v31rc.js";
14
14
  import"../../../shared/@ai-setting/roy-agent-core-shme7set.js";
package/dist/index.js CHANGED
@@ -129,13 +129,13 @@ import {
129
129
  } from "./shared/@ai-setting/roy-agent-core-e25xkv53.js";
130
130
  import {
131
131
  TaskComponent
132
- } from "./shared/@ai-setting/roy-agent-core-z2fxjh6k.js";
132
+ } from "./shared/@ai-setting/roy-agent-core-84vtpbw6.js";
133
133
  import"./shared/@ai-setting/roy-agent-core-8gxth0eh.js";
134
134
  import"./shared/@ai-setting/roy-agent-core-eq52jra7.js";
135
135
  import {
136
136
  SQLiteTaskStore,
137
137
  getDefaultTaskDbPath
138
- } from "./shared/@ai-setting/roy-agent-core-cgq7btak.js";
138
+ } from "./shared/@ai-setting/roy-agent-core-r9y8ct0w.js";
139
139
  import {
140
140
  AgentRegistry
141
141
  } from "./shared/@ai-setting/roy-agent-core-nx3c3ce2.js";
@@ -144,7 +144,7 @@ import {
144
144
  getXDGPath,
145
145
  getXDGPaths
146
146
  } from "./shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
147
- import"./shared/@ai-setting/roy-agent-core-3s9va046.js";
147
+ import"./shared/@ai-setting/roy-agent-core-7t0jen73.js";
148
148
  import"./shared/@ai-setting/roy-agent-core-t94ktchq.js";
149
149
  import {
150
150
  TaskHookPoints
@@ -18,7 +18,15 @@ 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
+ parent_task_id: z.number().describe(`父任务 ID(必填)。所有新任务都必须挂载到某个父任务下,以维护良好的任务树结构。
22
+ ` + `为什么 parent_task_id 是必填的:
23
+ ` + ` 1. 任务聚类:将相关任务聚合到同一父任务下,便于管理和追踪
24
+ ` + ` 2. 维护任务树:保持根任务数量可控(≤10个),深度适中(≤5层)
25
+ ` + `如何选择合适的父任务:
26
+ ` + ` 1. 使用 task_list(depth=0) 查看当前所有根任务
27
+ ` + ` 2. 使用 task_search 搜索与当前任务相关的父任务
28
+ ` + ` 3. 按主题归类:将相似主题的任务挂载到同一个父任务下
29
+ ` + "如果确实找不到合适的父任务,可以先创建一个合适的父任务,再创建子任务。"),
22
30
  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!")
23
31
  });
24
32
  var GetTaskToolSchema = z.object({
@@ -114,6 +122,29 @@ function createTaskTool(taskComponent) {
114
122
  {"type": "unknown"}
115
123
 
116
124
  **DO NOT leave this as plain text** - it must be valid JSON!
125
+
126
+ ## ⚠️ parent_task_id is REQUIRED
127
+
128
+ All new tasks MUST have a parent_task_id. This is critical for:
129
+
130
+ 1. **Task Tree Structure**: Every task must be attached to a parent,
131
+ maintaining a clean hierarchy (根任务 ≤10, 深度 ≤5).
132
+
133
+ 2. **Task Clustering**: Related tasks are grouped under the same parent,
134
+ making it easy to track progress and find related work.
135
+
136
+ **How to choose a parent task:**
137
+
138
+ 1. First, use \`task_list(depth=0)\` to see all root tasks (top-level tasks).
139
+ 2. Use \`task_search\` with relevant keywords to find existing tasks
140
+ that could serve as the parent.
141
+ 3. Group by topic: put similar tasks under the same parent.
142
+ 4. If no suitable parent exists, create a parent task first,
143
+ then create the child task with that parent_task_id.
144
+
145
+ **Example:**
146
+ - First: task_list(depth=0) → find root task #619 "roy-agent"
147
+ - Then: task_create(title="New feature", parent_task_id=619, ...)
117
148
  `,
118
149
  parameters: CreateTaskToolSchema,
119
150
  execute: async (args, ctx) => {
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  SQLiteTaskStore,
11
11
  getDefaultTaskDbPath
12
- } from "./roy-agent-core-cgq7btak.js";
12
+ } from "./roy-agent-core-r9y8ct0w.js";
13
13
  import {
14
14
  batchArchiveTaskTool,
15
15
  batchDeleteTaskTool,
@@ -20,7 +20,7 @@ import {
20
20
  listTasksTool,
21
21
  searchTasksTool,
22
22
  updateTaskTool
23
- } from "./roy-agent-core-3s9va046.js";
23
+ } from "./roy-agent-core-7t0jen73.js";
24
24
  import {
25
25
  createOperationTool,
26
26
  deleteOperationTool,
@@ -358,6 +358,13 @@ class TaskComponent extends BaseComponent {
358
358
  }
359
359
  async createTask(options) {
360
360
  const sessionId = options.sessionId;
361
+ if (options.parent_task_id === undefined || options.parent_task_id === null) {
362
+ throw new Error("parent_task_id is required. All tasks must be attached to a parent task. " + "Use task_list(depth=0) to find root tasks, or create a parent task first.");
363
+ }
364
+ const parentTask = await this.store.getTask(options.parent_task_id);
365
+ if (!parentTask) {
366
+ throw new Error(`Parent task #${options.parent_task_id} not found. ` + "Please provide a valid parent_task_id. Use task_list(depth=0) to see all root tasks.");
367
+ }
361
368
  const createCtx = {
362
369
  options: { ...options },
363
370
  sessionId,
@@ -940,6 +940,8 @@ class SQLiteTaskStore {
940
940
  this.db = null;
941
941
  this.initialized = false;
942
942
  }
943
+ this.tasksCache.clear();
944
+ this.operationsCache.clear();
943
945
  }
944
946
  }
945
947
  var logger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-agent-core",
3
- "version": "1.5.66",
3
+ "version": "1.5.67",
4
4
  "type": "module",
5
5
  "description": "Core SDK for roy-agent - Environment, Components, Tools, Sessions, Tasks",
6
6
  "main": "./dist/index.js",