@ai-setting/roy-agent-core 1.5.4 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.d.ts +1250 -0
- package/dist/env/agent/index.d.ts +2279 -0
- package/dist/env/agent/index.js +7 -7
- package/dist/env/commands/index.d.ts +1131 -0
- package/dist/env/commands/index.js +4 -4
- package/dist/env/debug/formatters/index.d.ts +236 -0
- package/dist/env/debug/index.d.ts +1652 -0
- package/dist/env/debug/index.js +1 -1
- package/dist/env/hook/index.d.ts +279 -0
- package/dist/env/index.d.ts +3460 -0
- package/dist/env/index.js +18 -18
- package/dist/env/llm/index.d.ts +1760 -0
- package/dist/env/llm/index.js +5 -5
- package/dist/env/log-trace/index.d.ts +1574 -0
- package/dist/env/log-trace/index.js +5 -5
- package/dist/env/mcp/index.d.ts +1331 -0
- package/dist/env/mcp/index.js +5 -5
- package/dist/env/mcp/tool/index.d.ts +183 -0
- package/dist/env/mcp/tool/index.js +4 -4
- package/dist/env/memory/built-in/index.d.ts +232 -0
- package/dist/env/memory/index.d.ts +1799 -0
- package/dist/env/memory/index.js +5 -5
- package/dist/env/memory/plugin/index.d.ts +747 -0
- package/dist/env/memory/plugin/index.js +4 -4
- package/dist/env/prompt/index.d.ts +1164 -0
- package/dist/env/prompt/index.js +4 -4
- package/dist/env/session/index.d.ts +1908 -0
- package/dist/env/session/index.js +8 -8
- package/dist/env/session/storage/index.d.ts +564 -0
- package/dist/env/session/storage/index.js +6 -6
- package/dist/env/skill/index.d.ts +1266 -0
- package/dist/env/skill/index.js +4 -4
- package/dist/env/skill/tool/index.d.ts +193 -0
- package/dist/env/task/delegate/index.d.ts +1622 -0
- package/dist/env/task/delegate/index.js +4 -4
- package/dist/env/task/hooks/index.d.ts +607 -0
- package/dist/env/task/index.d.ts +1415 -0
- package/dist/env/task/index.js +6 -6
- package/dist/env/task/plugins/index.d.ts +462 -0
- package/dist/env/task/plugins/index.js +4 -4
- package/dist/env/task/storage/index.d.ts +224 -0
- package/dist/env/task/storage/index.js +4 -4
- package/dist/env/task/tools/index.d.ts +1464 -0
- package/dist/env/task/tools/operation/index.d.ts +1463 -0
- package/dist/env/tool/built-in/index.d.ts +218 -0
- package/dist/env/tool/built-in/index.js +3 -3
- package/dist/env/tool/index.d.ts +1396 -0
- package/dist/env/tool/index.js +5 -5
- package/dist/env/workflow/decorators/index.d.ts +2161 -0
- package/dist/env/workflow/engine/index.d.ts +3453 -0
- package/dist/env/workflow/engine/index.js +8 -8
- package/dist/env/workflow/index.d.ts +3546 -0
- package/dist/env/workflow/index.js +13 -9
- package/dist/env/workflow/nodes/index.d.ts +2092 -0
- package/dist/env/workflow/nodes/index.js +1 -1
- package/dist/env/workflow/service/index.d.ts +227 -0
- package/dist/env/workflow/storage/index.d.ts +165 -0
- package/dist/env/workflow/storage/index.js +5 -5
- package/dist/env/workflow/tools/index.d.ts +416 -0
- package/dist/env/workflow/tools/index.js +3 -3
- package/dist/env/workflow/types/index.d.ts +2255 -0
- package/dist/env/workflow/types/index.js +5 -1
- package/dist/env/workflow/utils/index.d.ts +2031 -0
- package/dist/env/workflow/utils/index.js +4 -4
- package/dist/index.d.ts +7837 -0
- package/dist/index.js +31 -31
- package/dist/shared/@ai-setting/{roy-agent-core-6a72jfdy.js → roy-agent-core-1akcqxj9.js} +50 -4
- package/dist/shared/@ai-setting/{roy-agent-core-12zkpda2.js → roy-agent-core-3jywqmdd.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-7n436rb4.js → roy-agent-core-3rr5k71j.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zfbxb999.js → roy-agent-core-3xwneva0.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-j3wc4465.js → roy-agent-core-44hnfb02.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-cv890rg5.js → roy-agent-core-4txzpsbt.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-rzp9kxne.js → roy-agent-core-5x94xmt6.js} +14 -5
- package/dist/shared/@ai-setting/{roy-agent-core-pc9g3962.js → roy-agent-core-69jskqjg.js} +41 -66
- package/dist/shared/@ai-setting/{roy-agent-core-qya7seh6.js → roy-agent-core-6kvtahqv.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-kv5nkf8j.js → roy-agent-core-81w1963m.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-zqjdy75r.js → roy-agent-core-93zfb3r1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-fsvb6bwe.js → roy-agent-core-b0x5dda6.js} +5 -5
- package/dist/shared/@ai-setting/roy-agent-core-bcbqy27c.js +14 -0
- package/dist/shared/@ai-setting/{roy-agent-core-2x0m2p66.js → roy-agent-core-d7cyjkf7.js} +24 -3
- package/dist/shared/@ai-setting/{roy-agent-core-r973kbm7.js → roy-agent-core-dc497hmk.js} +9 -8
- package/dist/shared/@ai-setting/{roy-agent-core-z2t8hse8.js → roy-agent-core-dh9d7a3m.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-j3bbr2n0.js → roy-agent-core-eajcvp4e.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-m61m1vqf.js → roy-agent-core-f7q2x5z6.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8a96qnjv.js → roy-agent-core-g99pxzn5.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-5v9bh6wz.js → roy-agent-core-gbqcyegm.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-qw0ebh1d.js → roy-agent-core-gq20wsgv.js} +49 -17
- package/dist/shared/@ai-setting/{roy-agent-core-2kg2wma8.js → roy-agent-core-htwpckw9.js} +24 -3
- package/dist/shared/@ai-setting/{roy-agent-core-e62e2a5a.js → roy-agent-core-jfh9q2qh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-3agad0d9.js → roy-agent-core-jvatggbb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-j8q93v21.js → roy-agent-core-n2cvdgd6.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-nga1gqft.js → roy-agent-core-pjr12nnd.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-bncgx3gb.js → roy-agent-core-psv4v63c.js} +24 -2
- package/dist/shared/@ai-setting/{roy-agent-core-p4xv133t.js → roy-agent-core-qqceba6k.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e5jcp24a.js → roy-agent-core-r9ezzemr.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ewrj1c4k.js → roy-agent-core-satmq6sh.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-7f303ffd.js → roy-agent-core-sx7wsvnn.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-q779wnwm.js → roy-agent-core-wft9ra24.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-fdb6m4e4.js → roy-agent-core-wrcy0h6z.js} +134 -182
- package/dist/shared/@ai-setting/{roy-agent-core-8y8tw6ns.js → roy-agent-core-xq8hhqb8.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-fv32jaa8.js → roy-agent-core-xs5rsgat.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-t2nc5acr.js → roy-agent-core-z62zee1e.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-72zpazpc.js → roy-agent-core-zbkpc41z.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-35x0wrtt.js → roy-agent-core-zgypchmt.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-37e4tep3.js → roy-agent-core-zpn0bqa8.js} +24 -3
- package/package.json +5 -2
- package/dist/shared/@ai-setting/roy-agent-core-rft3fmp0.js +0 -14
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Task status enum
|
|
4
|
+
*/
|
|
5
|
+
declare const TaskStatusEnum: unknown;
|
|
6
|
+
type TaskStatus = z.infer<typeof TaskStatusEnum>;
|
|
7
|
+
/**
|
|
8
|
+
* Task priority enum
|
|
9
|
+
*/
|
|
10
|
+
declare const TaskPriorityEnum: unknown;
|
|
11
|
+
type TaskPriority = z.infer<typeof TaskPriorityEnum>;
|
|
12
|
+
/**
|
|
13
|
+
* Action type for task operations
|
|
14
|
+
*/
|
|
15
|
+
declare const ActionTypeEnum: unknown;
|
|
16
|
+
type ActionType = z.infer<typeof ActionTypeEnum>;
|
|
17
|
+
/**
|
|
18
|
+
* Task entity
|
|
19
|
+
*/
|
|
20
|
+
interface Task {
|
|
21
|
+
id: number;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
status: TaskStatus;
|
|
25
|
+
priority: TaskPriority;
|
|
26
|
+
progress: number;
|
|
27
|
+
current_status: string;
|
|
28
|
+
goals_and_expected_deliverables: string;
|
|
29
|
+
parent_task_id?: number;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
due_date?: string;
|
|
33
|
+
tags?: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* TaskOperation entity
|
|
37
|
+
*
|
|
38
|
+
* 记录任务的操作历史,每个操作关联到一个 sessionId
|
|
39
|
+
*/
|
|
40
|
+
interface TaskOperation {
|
|
41
|
+
id: number;
|
|
42
|
+
taskId: number;
|
|
43
|
+
sessionId: string;
|
|
44
|
+
actionType: ActionType;
|
|
45
|
+
actionTitle: string;
|
|
46
|
+
actionDescription: string;
|
|
47
|
+
timestamp: string;
|
|
48
|
+
mdPath?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* TaskTag entity
|
|
52
|
+
*
|
|
53
|
+
* Tag 池中的单个 Tag
|
|
54
|
+
*/
|
|
55
|
+
interface TaskTag {
|
|
56
|
+
id: number;
|
|
57
|
+
name: string;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
taskCount: number;
|
|
60
|
+
}
|
|
61
|
+
interface CreateTaskOptions {
|
|
62
|
+
title: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
priority?: TaskPriority;
|
|
65
|
+
parent_task_id?: number;
|
|
66
|
+
goals_and_expected_deliverables?: string;
|
|
67
|
+
due_date?: string;
|
|
68
|
+
tags?: string[];
|
|
69
|
+
sessionId: string;
|
|
70
|
+
}
|
|
71
|
+
interface UpdateTaskOptions {
|
|
72
|
+
title?: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
status?: TaskStatus;
|
|
75
|
+
priority?: TaskPriority;
|
|
76
|
+
progress?: number;
|
|
77
|
+
current_status?: string;
|
|
78
|
+
goals_and_expected_deliverables?: string;
|
|
79
|
+
due_date?: string;
|
|
80
|
+
tags?: string[];
|
|
81
|
+
}
|
|
82
|
+
interface ListTasksOptions {
|
|
83
|
+
status?: TaskStatus;
|
|
84
|
+
priority?: TaskPriority;
|
|
85
|
+
parent_task_id?: number;
|
|
86
|
+
limit?: number;
|
|
87
|
+
offset?: number;
|
|
88
|
+
}
|
|
89
|
+
interface CreateOperationOptions {
|
|
90
|
+
taskId: number;
|
|
91
|
+
sessionId: string;
|
|
92
|
+
actionType: ActionType;
|
|
93
|
+
actionTitle: string;
|
|
94
|
+
actionDescription?: string;
|
|
95
|
+
mdPath?: string;
|
|
96
|
+
}
|
|
97
|
+
interface ListOperationsOptions {
|
|
98
|
+
taskId: number;
|
|
99
|
+
actionType?: ActionType;
|
|
100
|
+
limit?: number;
|
|
101
|
+
offset?: number;
|
|
102
|
+
}
|
|
103
|
+
interface ListTagsOptions {
|
|
104
|
+
limit?: number;
|
|
105
|
+
offset?: number;
|
|
106
|
+
orderBy?: "count" | "name" | "created_at";
|
|
107
|
+
}
|
|
108
|
+
interface SearchTagsOptions {
|
|
109
|
+
query: string;
|
|
110
|
+
limit?: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get default data directory for task storage
|
|
114
|
+
*/
|
|
115
|
+
declare function getDefaultDataDir(): string;
|
|
116
|
+
/**
|
|
117
|
+
* Get default database path for task storage
|
|
118
|
+
*/
|
|
119
|
+
declare function getDefaultTaskDbPath(): string;
|
|
120
|
+
interface TaskStore {
|
|
121
|
+
createTask(options: CreateTaskOptions): Promise<Task>;
|
|
122
|
+
getTask(id: number): Promise<Task | undefined>;
|
|
123
|
+
updateTask(id: number, options: UpdateTaskOptions): Promise<Task | undefined>;
|
|
124
|
+
deleteTask(id: number): Promise<boolean>;
|
|
125
|
+
listTasks(options?: ListTasksOptions): Promise<Task[]>;
|
|
126
|
+
createOperation(options: CreateOperationOptions): Promise<TaskOperation>;
|
|
127
|
+
getOperation(id: number): Promise<TaskOperation | undefined>;
|
|
128
|
+
updateOperation(id: number, updates: {
|
|
129
|
+
actionTitle?: string;
|
|
130
|
+
actionDescription?: string;
|
|
131
|
+
}): Promise<TaskOperation | undefined>;
|
|
132
|
+
deleteOperation(id: number): Promise<boolean>;
|
|
133
|
+
listOperations(options: ListOperationsOptions): Promise<TaskOperation[]>;
|
|
134
|
+
createTag(name: string): Promise<TaskTag>;
|
|
135
|
+
getTag(id: number): Promise<TaskTag | undefined>;
|
|
136
|
+
getTagByName(name: string): Promise<TaskTag | undefined>;
|
|
137
|
+
listTags(options?: ListTagsOptions): Promise<TaskTag[]>;
|
|
138
|
+
searchTags(options: SearchTagsOptions): Promise<TaskTag[]>;
|
|
139
|
+
deleteTag(id: number): Promise<boolean>;
|
|
140
|
+
addTagsToTask(taskId: number, tagIds: number[]): Promise<void>;
|
|
141
|
+
removeTagsFromTask(taskId: number, tagIds: number[]): Promise<void>;
|
|
142
|
+
getTagsForTask(taskId: number): Promise<TaskTag[]>;
|
|
143
|
+
getTaskIdsByTags(tagNames: string[]): Promise<number[]>;
|
|
144
|
+
updateTaskTags(taskId: number, tagNames: string[]): Promise<void>;
|
|
145
|
+
/** Search tasks by keywords (tags, description, goals, operations) */
|
|
146
|
+
searchTasksByKeywords(keywords: string[], options?: {
|
|
147
|
+
limit?: number;
|
|
148
|
+
excludeTaskId?: number;
|
|
149
|
+
}): Promise<Task[]>;
|
|
150
|
+
/** Find similar tasks using new keywords search */
|
|
151
|
+
findSimilarTasksByKeywords(keywords: string[], options?: {
|
|
152
|
+
limit?: number;
|
|
153
|
+
excludeTaskId?: number;
|
|
154
|
+
}): Promise<Task[]>;
|
|
155
|
+
findSimilarTasks(taskId: number, limit?: number): Promise<Task[]>;
|
|
156
|
+
searchTasks(query: string, limit?: number): Promise<Task[]>;
|
|
157
|
+
close(): void;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* SQLite-based Task Store
|
|
161
|
+
*
|
|
162
|
+
* 参考 Session SQLiteStore 实现模式:
|
|
163
|
+
* - 使用 bun:sqlite 内置模块
|
|
164
|
+
* - 内存缓存提高性能
|
|
165
|
+
* - 默认路径:~/.local/share/roy-agent/tasks.db
|
|
166
|
+
*/
|
|
167
|
+
declare class SQLiteTaskStore implements TaskStore {
|
|
168
|
+
private db;
|
|
169
|
+
private dbPath;
|
|
170
|
+
private initialized;
|
|
171
|
+
private tasksCache;
|
|
172
|
+
private operationsCache;
|
|
173
|
+
constructor(dbPath?: string);
|
|
174
|
+
private initialize;
|
|
175
|
+
createTask(options: CreateTaskOptions): Promise<Task>;
|
|
176
|
+
getTask(id: number): Promise<Task | undefined>;
|
|
177
|
+
updateTask(id: number, options: UpdateTaskOptions): Promise<Task | undefined>;
|
|
178
|
+
deleteTask(id: number): Promise<boolean>;
|
|
179
|
+
listTasks(options?: ListTasksOptions): Promise<Task[]>;
|
|
180
|
+
createOperation(options: CreateOperationOptions): Promise<TaskOperation>;
|
|
181
|
+
getOperation(id: number): Promise<TaskOperation | undefined>;
|
|
182
|
+
updateOperation(id: number, updates: {
|
|
183
|
+
actionTitle?: string;
|
|
184
|
+
actionDescription?: string;
|
|
185
|
+
}): Promise<TaskOperation | undefined>;
|
|
186
|
+
deleteOperation(id: number): Promise<boolean>;
|
|
187
|
+
listOperations(options: ListOperationsOptions): Promise<TaskOperation[]>;
|
|
188
|
+
private rowToTask;
|
|
189
|
+
private rowToOperation;
|
|
190
|
+
createTag(name: string): Promise<TaskTag>;
|
|
191
|
+
getTag(id: number): Promise<TaskTag | undefined>;
|
|
192
|
+
getTagByName(name: string): Promise<TaskTag | undefined>;
|
|
193
|
+
listTags(options?: ListTagsOptions): Promise<TaskTag[]>;
|
|
194
|
+
searchTags(options: SearchTagsOptions): Promise<TaskTag[]>;
|
|
195
|
+
deleteTag(id: number): Promise<boolean>;
|
|
196
|
+
addTagsToTask(taskId: number, tagIds: number[]): Promise<void>;
|
|
197
|
+
removeTagsFromTask(taskId: number, tagIds: number[]): Promise<void>;
|
|
198
|
+
getTagsForTask(taskId: number): Promise<TaskTag[]>;
|
|
199
|
+
getTaskIdsByTags(tagNames: string[]): Promise<number[]>;
|
|
200
|
+
updateTaskTags(taskId: number, tagNames: string[]): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Search tasks by keywords list
|
|
203
|
+
* Searches in: tags (JSON), description, goals_and_expected_deliverables, operations
|
|
204
|
+
*/
|
|
205
|
+
searchTasksByKeywords(keywords: string[], options?: {
|
|
206
|
+
limit?: number;
|
|
207
|
+
excludeTaskId?: number;
|
|
208
|
+
}): Promise<Task[]>;
|
|
209
|
+
/**
|
|
210
|
+
* Find similar tasks by keywords
|
|
211
|
+
* Excludes the target task and sorts by relevance
|
|
212
|
+
* Default limit is 5 to keep prompt concise
|
|
213
|
+
*/
|
|
214
|
+
findSimilarTasksByKeywords(keywords: string[], options?: {
|
|
215
|
+
limit?: number;
|
|
216
|
+
excludeTaskId?: number;
|
|
217
|
+
}): Promise<Task[]>;
|
|
218
|
+
findSimilarTasks(taskId: number, limit?: number): Promise<Task[]>;
|
|
219
|
+
searchTasks(query: string, limit?: number): Promise<Task[]>;
|
|
220
|
+
private rowToTag;
|
|
221
|
+
private syncTaskTagsJson;
|
|
222
|
+
close(): Promise<void>;
|
|
223
|
+
}
|
|
224
|
+
export { getDefaultTaskDbPath, getDefaultDataDir, TaskStore, SQLiteTaskStore };
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
SQLiteTaskStore,
|
|
3
3
|
getDefaultDataDir,
|
|
4
4
|
getDefaultTaskDbPath
|
|
5
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
6
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
7
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
8
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
} from "../../../shared/@ai-setting/roy-agent-core-htwpckw9.js";
|
|
6
|
+
import"../../../shared/@ai-setting/roy-agent-core-44hnfb02.js";
|
|
7
|
+
import"../../../shared/@ai-setting/roy-agent-core-xs5rsgat.js";
|
|
8
|
+
import"../../../shared/@ai-setting/roy-agent-core-psv4v63c.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
10
10
|
export {
|
|
11
11
|
getDefaultTaskDbPath,
|