@ai-setting/roy-agent-core 1.5.13-test → 1.5.15-test

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 (141) hide show
  1. package/package.json +1 -1
  2. package/dist/config/index.d.ts +0 -1250
  3. package/dist/config/index.js +0 -32
  4. package/dist/env/agent/index.d.ts +0 -2279
  5. package/dist/env/agent/index.js +0 -24
  6. package/dist/env/commands/index.d.ts +0 -1131
  7. package/dist/env/commands/index.js +0 -14
  8. package/dist/env/debug/formatters/index.d.ts +0 -236
  9. package/dist/env/debug/formatters/index.js +0 -11
  10. package/dist/env/debug/index.d.ts +0 -1652
  11. package/dist/env/debug/index.js +0 -26
  12. package/dist/env/hook/index.d.ts +0 -279
  13. package/dist/env/hook/index.js +0 -29
  14. package/dist/env/index.d.ts +0 -3481
  15. package/dist/env/index.js +0 -82
  16. package/dist/env/llm/index.d.ts +0 -1760
  17. package/dist/env/llm/index.js +0 -40
  18. package/dist/env/log-trace/index.d.ts +0 -1574
  19. package/dist/env/log-trace/index.js +0 -83
  20. package/dist/env/mcp/index.d.ts +0 -1331
  21. package/dist/env/mcp/index.js +0 -39
  22. package/dist/env/mcp/tool/index.d.ts +0 -183
  23. package/dist/env/mcp/tool/index.js +0 -14
  24. package/dist/env/memory/built-in/index.d.ts +0 -232
  25. package/dist/env/memory/built-in/index.js +0 -11
  26. package/dist/env/memory/index.d.ts +0 -1799
  27. package/dist/env/memory/index.js +0 -56
  28. package/dist/env/memory/plugin/index.d.ts +0 -747
  29. package/dist/env/memory/plugin/index.js +0 -36
  30. package/dist/env/prompt/index.d.ts +0 -1164
  31. package/dist/env/prompt/index.js +0 -20
  32. package/dist/env/session/index.d.ts +0 -1908
  33. package/dist/env/session/index.js +0 -25
  34. package/dist/env/session/storage/index.d.ts +0 -564
  35. package/dist/env/session/storage/index.js +0 -18
  36. package/dist/env/skill/index.d.ts +0 -1266
  37. package/dist/env/skill/index.js +0 -34
  38. package/dist/env/skill/tool/index.d.ts +0 -193
  39. package/dist/env/skill/tool/index.js +0 -9
  40. package/dist/env/task/delegate/index.d.ts +0 -1612
  41. package/dist/env/task/delegate/index.js +0 -18
  42. package/dist/env/task/events/index.d.ts +0 -171
  43. package/dist/env/task/events/index.js +0 -7
  44. package/dist/env/task/hooks/index.d.ts +0 -624
  45. package/dist/env/task/hooks/index.js +0 -7
  46. package/dist/env/task/index.d.ts +0 -1553
  47. package/dist/env/task/index.js +0 -34
  48. package/dist/env/task/plugins/index.d.ts +0 -466
  49. package/dist/env/task/plugins/index.js +0 -23
  50. package/dist/env/task/storage/index.d.ts +0 -241
  51. package/dist/env/task/storage/index.js +0 -14
  52. package/dist/env/task/tools/index.d.ts +0 -1485
  53. package/dist/env/task/tools/index.js +0 -17
  54. package/dist/env/task/tools/operation/index.d.ts +0 -1484
  55. package/dist/env/task/tools/operation/index.js +0 -15
  56. package/dist/env/tool/built-in/index.d.ts +0 -218
  57. package/dist/env/tool/built-in/index.js +0 -25
  58. package/dist/env/tool/index.d.ts +0 -1396
  59. package/dist/env/tool/index.js +0 -39
  60. package/dist/env/workflow/decorators/index.d.ts +0 -2161
  61. package/dist/env/workflow/decorators/index.js +0 -27
  62. package/dist/env/workflow/engine/index.d.ts +0 -3453
  63. package/dist/env/workflow/engine/index.js +0 -28
  64. package/dist/env/workflow/index.d.ts +0 -3546
  65. package/dist/env/workflow/index.js +0 -136
  66. package/dist/env/workflow/nodes/index.d.ts +0 -2092
  67. package/dist/env/workflow/nodes/index.js +0 -19
  68. package/dist/env/workflow/service/index.d.ts +0 -227
  69. package/dist/env/workflow/service/index.js +0 -13
  70. package/dist/env/workflow/storage/index.d.ts +0 -165
  71. package/dist/env/workflow/storage/index.js +0 -27
  72. package/dist/env/workflow/tools/index.d.ts +0 -416
  73. package/dist/env/workflow/tools/index.js +0 -159
  74. package/dist/env/workflow/types/index.d.ts +0 -2255
  75. package/dist/env/workflow/types/index.js +0 -98
  76. package/dist/env/workflow/utils/index.d.ts +0 -2031
  77. package/dist/env/workflow/utils/index.js +0 -637
  78. package/dist/index.d.ts +0 -7858
  79. package/dist/index.js +0 -399
  80. package/dist/shared/@ai-setting/roy-agent-core-0rtxwr28.js +0 -258
  81. package/dist/shared/@ai-setting/roy-agent-core-0vbdz0x7.js +0 -36
  82. package/dist/shared/@ai-setting/roy-agent-core-1akcqxj9.js +0 -349
  83. package/dist/shared/@ai-setting/roy-agent-core-1ce3fqrk.js +0 -117
  84. package/dist/shared/@ai-setting/roy-agent-core-2dhd60aw.js +0 -11
  85. package/dist/shared/@ai-setting/roy-agent-core-3jywqmdd.js +0 -393
  86. package/dist/shared/@ai-setting/roy-agent-core-3rr5k71j.js +0 -200
  87. package/dist/shared/@ai-setting/roy-agent-core-44hnfb02.js +0 -299
  88. package/dist/shared/@ai-setting/roy-agent-core-4t40mkpv.js +0 -206
  89. package/dist/shared/@ai-setting/roy-agent-core-4txzpsbt.js +0 -393
  90. package/dist/shared/@ai-setting/roy-agent-core-5x94xmt6.js +0 -350
  91. package/dist/shared/@ai-setting/roy-agent-core-69jskqjg.js +0 -180
  92. package/dist/shared/@ai-setting/roy-agent-core-6kvtahqv.js +0 -408
  93. package/dist/shared/@ai-setting/roy-agent-core-7fgf85wc.js +0 -284
  94. package/dist/shared/@ai-setting/roy-agent-core-81w1963m.js +0 -762
  95. package/dist/shared/@ai-setting/roy-agent-core-8gxth0eh.js +0 -10
  96. package/dist/shared/@ai-setting/roy-agent-core-92z6t4he.js +0 -14
  97. package/dist/shared/@ai-setting/roy-agent-core-93zfb3r1.js +0 -922
  98. package/dist/shared/@ai-setting/roy-agent-core-9yxb3ty9.js +0 -15
  99. package/dist/shared/@ai-setting/roy-agent-core-b0x5dda6.js +0 -1130
  100. package/dist/shared/@ai-setting/roy-agent-core-bcbqy27c.js +0 -14
  101. package/dist/shared/@ai-setting/roy-agent-core-bvr1761x.js +0 -653
  102. package/dist/shared/@ai-setting/roy-agent-core-ctdhjv68.js +0 -93
  103. package/dist/shared/@ai-setting/roy-agent-core-d7cyjkf7.js +0 -872
  104. package/dist/shared/@ai-setting/roy-agent-core-dh9d7a3m.js +0 -11
  105. package/dist/shared/@ai-setting/roy-agent-core-e25xkv53.js +0 -64
  106. package/dist/shared/@ai-setting/roy-agent-core-eajcvp4e.js +0 -378
  107. package/dist/shared/@ai-setting/roy-agent-core-f7q2x5z6.js +0 -492
  108. package/dist/shared/@ai-setting/roy-agent-core-fs0mn2jk.js +0 -52
  109. package/dist/shared/@ai-setting/roy-agent-core-g1s2h0e5.js +0 -171
  110. package/dist/shared/@ai-setting/roy-agent-core-g99pxzn5.js +0 -862
  111. package/dist/shared/@ai-setting/roy-agent-core-gbqcyegm.js +0 -1387
  112. package/dist/shared/@ai-setting/roy-agent-core-gjq1yk68.js +0 -208
  113. package/dist/shared/@ai-setting/roy-agent-core-gq20wsgv.js +0 -139
  114. package/dist/shared/@ai-setting/roy-agent-core-gwc4h96n.js +0 -534
  115. package/dist/shared/@ai-setting/roy-agent-core-jfh9q2qh.js +0 -204
  116. package/dist/shared/@ai-setting/roy-agent-core-jvatggbb.js +0 -603
  117. package/dist/shared/@ai-setting/roy-agent-core-kkbwepqb.js +0 -97
  118. package/dist/shared/@ai-setting/roy-agent-core-pjr12nnd.js +0 -587
  119. package/dist/shared/@ai-setting/roy-agent-core-psv4v63c.js +0 -176
  120. package/dist/shared/@ai-setting/roy-agent-core-psvxt4c9.js +0 -60
  121. package/dist/shared/@ai-setting/roy-agent-core-qqceba6k.js +0 -442
  122. package/dist/shared/@ai-setting/roy-agent-core-qxhq8ven.js +0 -57
  123. package/dist/shared/@ai-setting/roy-agent-core-qxnbvgwe.js +0 -66
  124. package/dist/shared/@ai-setting/roy-agent-core-r9ezzemr.js +0 -10
  125. package/dist/shared/@ai-setting/roy-agent-core-rhmtwnw1.js +0 -267
  126. package/dist/shared/@ai-setting/roy-agent-core-rvv6ydff.js +0 -584
  127. package/dist/shared/@ai-setting/roy-agent-core-rvxg1wps.js +0 -102
  128. package/dist/shared/@ai-setting/roy-agent-core-satmq6sh.js +0 -549
  129. package/dist/shared/@ai-setting/roy-agent-core-sx7wsvnn.js +0 -15
  130. package/dist/shared/@ai-setting/roy-agent-core-t94ktchq.js +0 -213
  131. package/dist/shared/@ai-setting/roy-agent-core-vf215qfv.js +0 -812
  132. package/dist/shared/@ai-setting/roy-agent-core-vkz81f7v.js +0 -1316
  133. package/dist/shared/@ai-setting/roy-agent-core-vn2bc59q.js +0 -1205
  134. package/dist/shared/@ai-setting/roy-agent-core-wa1kzqky.js +0 -328
  135. package/dist/shared/@ai-setting/roy-agent-core-wft9ra24.js +0 -20
  136. package/dist/shared/@ai-setting/roy-agent-core-wrcy0h6z.js +0 -2098
  137. package/dist/shared/@ai-setting/roy-agent-core-xq8hhqb8.js +0 -419
  138. package/dist/shared/@ai-setting/roy-agent-core-xs5rsgat.js +0 -368
  139. package/dist/shared/@ai-setting/roy-agent-core-zbkpc41z.js +0 -377
  140. package/dist/shared/@ai-setting/roy-agent-core-zgypchmt.js +0 -172
  141. package/dist/shared/@ai-setting/roy-agent-core-zpn0bqa8.js +0 -103
@@ -1,34 +0,0 @@
1
- import {
2
- ActionTypeEnum,
3
- TaskComponent,
4
- TaskConfigSchema,
5
- TaskPriorityEnum,
6
- TaskStatusEnum
7
- } from "../../shared/@ai-setting/roy-agent-core-gwc4h96n.js";
8
- import"../../shared/@ai-setting/roy-agent-core-vf215qfv.js";
9
- import {
10
- SQLiteTaskStore
11
- } from "../../shared/@ai-setting/roy-agent-core-bvr1761x.js";
12
- import"../../shared/@ai-setting/roy-agent-core-wa1kzqky.js";
13
- import"../../shared/@ai-setting/roy-agent-core-t94ktchq.js";
14
- import"../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
15
- import {
16
- TaskEntityEventTypes
17
- } from "../../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
18
- import"../../shared/@ai-setting/roy-agent-core-qxhq8ven.js";
19
- import"../../shared/@ai-setting/roy-agent-core-kkbwepqb.js";
20
- import"../../shared/@ai-setting/roy-agent-core-2dhd60aw.js";
21
- import"../../shared/@ai-setting/roy-agent-core-gjq1yk68.js";
22
- import"../../shared/@ai-setting/roy-agent-core-44hnfb02.js";
23
- import"../../shared/@ai-setting/roy-agent-core-xs5rsgat.js";
24
- import"../../shared/@ai-setting/roy-agent-core-psv4v63c.js";
25
- import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
26
- export {
27
- TaskStatusEnum,
28
- TaskPriorityEnum,
29
- TaskEntityEventTypes,
30
- TaskConfigSchema,
31
- TaskComponent,
32
- SQLiteTaskStore,
33
- ActionTypeEnum
34
- };
@@ -1,466 +0,0 @@
1
- import { z as z5 } from "zod";
2
- /**
3
- * Agent 类型
4
- */
5
- type AgentType = "primary" | "sub" | "summary";
6
- /**
7
- * Agent 实例配置
8
- */
9
- interface AgentInstanceConfig {
10
- /** Agent 类型 */
11
- type: AgentType;
12
- /** Agent 名称 */
13
- name?: string;
14
- /** System Prompt */
15
- systemPrompt?: string;
16
- /** Behavior Spec ID */
17
- behaviorSpecId?: string;
18
- /** 使用的模型 */
19
- model?: string;
20
- /** 最大迭代次数 */
21
- maxIterations?: number;
22
- /** 最大错误重试次数 */
23
- maxErrorRetries?: number;
24
- /** 死循环检测阈值 */
25
- doomLoopThreshold?: number;
26
- /** 允许的工具列表 */
27
- allowedTools?: string[];
28
- /** 拒绝的工具列表 */
29
- deniedTools?: string[];
30
- /** 工具超时(毫秒) */
31
- toolTimeout?: number;
32
- /** 工具重试次数 */
33
- toolRetries?: number;
34
- /** 是否过滤 history 中的 tool 消息(默认过滤,避免上下文过长) */
35
- filterHistory?: boolean;
36
- }
37
- /**
38
- * Checkpoint type
39
- */
40
- type CheckpointType = "compact" | "manual";
41
- /**
42
- * Checkpoint metadata (stored in Session.metadata)
43
- */
44
- interface CheckpointMeta {
45
- id: string;
46
- messageIndex: number;
47
- title: string;
48
- createdAt: number;
49
- type: CheckpointType;
50
- }
51
- /**
52
- * User Intent type - represents a user's intent extracted from conversation
53
- */
54
- type UserIntent = string;
55
- /**
56
- * Recent message for checkpoint
57
- *
58
- * Stores a simplified version of a message for context preservation
59
- */
60
- interface RecentMessage {
61
- role: string;
62
- content: string;
63
- }
64
- /**
65
- * Complete checkpoint information (includes generated content)
66
- */
67
- interface SessionCheckpoint extends CheckpointMeta {
68
- summary: string;
69
- processKeyPoints: string[];
70
- currentState: string;
71
- nextSteps: string[];
72
- messageCountBefore: number;
73
- metadata?: Record<string, unknown>;
74
- /** User intents extracted from the conversation */
75
- userIntents: UserIntent[];
76
- /**
77
- * Recent messages preserved from the compacted conversation
78
- *
79
- * Contains the last N turns of user query + assistant text response
80
- * (excluding tool calls and tool results).
81
- * This allows the checkpoint to serve as a fresh history context.
82
- *
83
- * Format: [user, assistant, user, assistant, ...] from most recent
84
- */
85
- recentMessages?: RecentMessage[];
86
- }
87
- /**
88
- * Session message
89
- */
90
- interface SessionMessage {
91
- id: string;
92
- sessionID: string;
93
- role: Role;
94
- content: string;
95
- timestamp: number;
96
- parts?: MessagePart[];
97
- /** Whether the message has been archived (compacted) */
98
- isArchived?: boolean;
99
- /** Timestamp when the message was archived */
100
- archivedAt?: number;
101
- /** Checkpoint ID this message belongs to */
102
- checkpointId?: string;
103
- /** Message metadata (includes checkpoint info if this is a checkpoint message) */
104
- metadata?: MessageMetadata;
105
- }
106
- /**
107
- * Message metadata
108
- */
109
- interface MessageMetadata extends Record<string, unknown> {
110
- /** 消息类型标识,用于过滤和分类 */
111
- type?: "tool_call" | "tool_result" | "checkpoint" | "user_intent" | "workflow.node.start" | "workflow.node.interrupt" | "workflow.node.end" | "workflow.node.resume";
112
- isCheckpoint?: boolean;
113
- checkpointId?: string;
114
- checkpointMeta?: SessionCheckpoint;
115
- /** Workflow node ID (for workflow.node.* messages) */
116
- workflowNodeId?: string;
117
- /** Workflow node type (for workflow.node.* messages) */
118
- workflowNodeType?: string;
119
- /** Agent session ID (for agent nodes in workflow) */
120
- agentSessionId?: string;
121
- /** User response (for workflow.node.resume messages) */
122
- response?: string;
123
- /** Success flag (for workflow.node.end messages) */
124
- success?: boolean;
125
- }
126
- /**
127
- * Message role
128
- */
129
- type Role = "user" | "assistant" | "system" | "tool" | "workflow.node.start" | "workflow.node.interrupt" | "workflow.node.end" | "workflow.node.resume";
130
- /**
131
- * Message part
132
- */
133
- type MessagePart = SessionPart;
134
- /**
135
- * Text part - plain text content
136
- */
137
- interface TextPart {
138
- type: "text";
139
- content: string;
140
- /** If true, this part was generated by the system (e.g., auto-summary) */
141
- synthetic?: boolean;
142
- /** If true, this part should be ignored (e.g., replaced by reasoning) */
143
- ignored?: boolean;
144
- }
145
- /**
146
- * Tool call part - represents a tool invocation
147
- */
148
- interface ToolCallPart {
149
- type: "tool-call";
150
- /** AI SDK standard field name */
151
- toolCallId: string;
152
- toolName: string;
153
- /** Tool arguments - can be string (JSON) or object */
154
- arguments: string | Record<string, unknown>;
155
- state: "pending" | "running";
156
- }
157
- /**
158
- * Tool result part - represents the result of a tool execution
159
- */
160
- interface ToolResultPart {
161
- type: "tool-result";
162
- toolCallId: string;
163
- toolName: string;
164
- output: string;
165
- error?: string;
166
- state: "completed" | "error";
167
- }
168
- /**
169
- * Reasoning part - AI thinking/thought content
170
- */
171
- interface ReasoningPart {
172
- type: "reasoning";
173
- /** Reasoning content */
174
- content: string;
175
- /** Reasoning type (for different models) */
176
- reasoningType?: "core" | "effort" | "summary";
177
- /** State */
178
- state?: "thinking" | "completed";
179
- /** Whether to collapse by default (like AI SDK default) */
180
- isCollapsed?: boolean;
181
- /** Metadata */
182
- metadata?: {
183
- tokenCount?: number;
184
- time?: {
185
- start: number;
186
- end?: number;
187
- };
188
- };
189
- }
190
- /**
191
- * File part - file attachment
192
- */
193
- interface FilePart {
194
- type: "file";
195
- mime: string;
196
- url: string;
197
- filename?: string;
198
- }
199
- /**
200
- * Checkpoint part - compaction checkpoint marker
201
- *
202
- * Represents a checkpoint message in the conversation history.
203
- * This is stored as a user role message with markdown content summarizing
204
- * the compacted conversation segment.
205
- */
206
- interface CheckpointPart {
207
- type: "checkpoint";
208
- /** Checkpoint ID reference */
209
- checkpointId: string;
210
- /** Markdown content summarizing the checkpoint */
211
- content: string;
212
- /** Title of the checkpoint */
213
- title?: string;
214
- /** Process key points */
215
- processKeyPoints?: string[];
216
- /** Current state description */
217
- currentState?: string;
218
- /** Next steps */
219
- nextSteps?: string[];
220
- /** Number of messages that were compacted */
221
- messageCountBefore?: number;
222
- /** Creation timestamp */
223
- createdAt?: number;
224
- }
225
- /**
226
- * Union type for all Session Part types
227
- */
228
- type SessionPart = TextPart | ToolCallPart | ToolResultPart | ReasoningPart | FilePart | CheckpointPart | WorkflowNodeStartPart | WorkflowNodeInterruptPart | WorkflowNodeEndPart | WorkflowNodeResumePart;
229
- /**
230
- * workflow.node.start 消息 part (对应 tool-call)
231
- */
232
- interface WorkflowNodeStartPart {
233
- type: "workflow-node-start";
234
- nodeId: string;
235
- nodeType: string;
236
- input?: unknown;
237
- startTime: number;
238
- /** Agent session ID (only for agent nodes) */
239
- agentSessionId?: string;
240
- }
241
- /**
242
- * workflow.node.interrupt 消息 part
243
- */
244
- interface WorkflowNodeInterruptPart {
245
- type: "workflow-node-interrupt";
246
- nodeId: string;
247
- nodeType: string;
248
- query: string;
249
- options?: string[];
250
- timestamp: number;
251
- /** Agent session ID (only for agent nodes) */
252
- agentSessionId?: string;
253
- }
254
- /**
255
- * workflow.node.end 消息 part (对应 tool-result)
256
- */
257
- interface WorkflowNodeEndPart {
258
- type: "workflow-node-end";
259
- nodeId: string;
260
- nodeType: string;
261
- output?: unknown;
262
- error?: string;
263
- durationMs: number;
264
- /** Agent session ID (only for agent nodes) */
265
- agentSessionId?: string;
266
- }
267
- /**
268
- * workflow.node.resume 消息 part
269
- */
270
- interface WorkflowNodeResumePart {
271
- type: "workflow-node-resume";
272
- nodeId: string;
273
- response: string;
274
- timestamp: number;
275
- /** Agent session ID (only for agent nodes) */
276
- agentSessionId?: string;
277
- }
278
- declare const WorkflowDefinitionSchema: unknown;
279
- type WorkflowDefinition = z5.infer<typeof WorkflowDefinitionSchema>;
280
- /**
281
- * TaskPlugin 配置
282
- */
283
- interface TaskPluginConfig {
284
- /** 是否启用 */
285
- enabled?: boolean;
286
- /** 优先级 */
287
- priority?: number;
288
- }
289
- /**
290
- * TaskPlugin Hook 定义
291
- */
292
- interface TaskPluginHook {
293
- /** Hook 点 */
294
- point: string;
295
- /** 优先级(数字越大越先执行)*/
296
- priority?: number;
297
- }
298
- /**
299
- * TaskPlugin 基类
300
- */
301
- declare abstract class TaskPlugin {
302
- abstract readonly name: string;
303
- abstract readonly hooks: TaskPluginHook[];
304
- protected config: TaskPluginConfig;
305
- constructor(config?: TaskPluginConfig);
306
- /**
307
- * 设置依赖组件(可选实现)
308
- */
309
- setComponents?(llmComponent: unknown, taskComponent: unknown): void;
310
- /**
311
- * 获取 Hook 点列表
312
- */
313
- getHookPoints(): string[];
314
- /**
315
- * 获取指定 Hook 点的优先级
316
- */
317
- getPriorityForHook(hookPoint: string): number;
318
- /**
319
- * 检查是否启用
320
- */
321
- isEnabled(): boolean;
322
- /**
323
- * 设置启用状态
324
- */
325
- setEnabled(enabled: boolean): void;
326
- }
327
- import { z as z7 } from "zod";
328
- /**
329
- * Task status enum
330
- */
331
- declare const TaskStatusEnum: unknown;
332
- type TaskStatus = z7.infer<typeof TaskStatusEnum>;
333
- /**
334
- * Task priority enum
335
- */
336
- declare const TaskPriorityEnum: unknown;
337
- type TaskPriority = z7.infer<typeof TaskPriorityEnum>;
338
- /**
339
- * Action type for task operations
340
- */
341
- declare const ActionTypeEnum: unknown;
342
- type ActionType = z7.infer<typeof ActionTypeEnum>;
343
- /**
344
- * Task entity
345
- */
346
- interface Task {
347
- id: number;
348
- title: string;
349
- description: string;
350
- status: TaskStatus;
351
- priority: TaskPriority;
352
- progress: number;
353
- current_status: string;
354
- goals_and_expected_deliverables: string;
355
- parent_task_id?: number;
356
- createdAt: string;
357
- updatedAt: string;
358
- due_date?: string;
359
- tags?: string[];
360
- /** Project root path for task positioning */
361
- project_path: string;
362
- /** JSON string with time-space positioning info (worktree, branch, etc.) */
363
- context: string;
364
- }
365
- /**
366
- * TaskOperation entity
367
- *
368
- * 记录任务的操作历史,每个操作关联到一个 sessionId
369
- */
370
- interface TaskOperation {
371
- id: number;
372
- taskId: number;
373
- sessionId: string;
374
- actionType: ActionType;
375
- actionTitle: string;
376
- actionDescription: string;
377
- timestamp: string;
378
- mdPath?: string;
379
- }
380
- interface TaskComponentLike {
381
- getTask(id: number): Promise<Task | undefined>;
382
- listOperations(options: {
383
- taskId: number;
384
- limit?: number;
385
- }): Promise<Array<{
386
- id: number;
387
- taskId: number;
388
- actionType: string;
389
- actionTitle: string;
390
- actionDescription: string;
391
- }>>;
392
- createOperation(options: any): Promise<any>;
393
- env?: {
394
- getComponent(name: string): unknown;
395
- };
396
- }
397
- declare class TaskTagPlugin extends TaskPlugin {
398
- readonly name = "TaskTagPlugin";
399
- readonly hooks: readonly [{
400
- readonly priority: 20;
401
- }, {
402
- readonly priority: 10;
403
- }];
404
- private taskComponent;
405
- private agentComponent;
406
- constructor(config?: TaskPluginConfig);
407
- static getRequiredAgents(): unknown;
408
- setComponents(_llmComponent: unknown, taskComponent: TaskComponentLike | null): void;
409
- execute(ctx: any): Promise<void>;
410
- /**
411
- * 委派前:注入类似任务信息
412
- *
413
- * 1. 从 task.tags 和 title 提取关键词
414
- * 2. 检索最多 5 个类似任务
415
- * 3. 只注入任务 ID、描述和目标
416
- * 4. 提示可通过 task_get 获取详细信息
417
- */
418
- private onDelegateBefore;
419
- /**
420
- * 从 task 提取关键词
421
- */
422
- private extractKeywords;
423
- /**
424
- * 格式化类似任务(简洁版)
425
- *
426
- * 注入格式:
427
- * - Task ID: 用于引用和检索
428
- * - Title: 任务标题
429
- * - Description: 任务描述(截断至 100 字符)
430
- * - Goal: 目标(截断至 100 字符)
431
- * - 提醒:通过 task_get 和 task_operation_list 获取详细信息
432
- */
433
- private formatSimilarTasks;
434
- private onOperationAfterCreate;
435
- private extractWorkflow;
436
- private getWorkflowRepository;
437
- private ensureDataDir;
438
- private _workflowRepo;
439
- }
440
- /**
441
- * Workflow Extractor Agent System Prompt
442
- */
443
- declare const WORKFLOW_EXTRACTOR_PROMPT = "你是 Workflow 提取专家,负责将自然语言描述转换为符合规范的 Workflow YAML。\n\n## 提取原则\n\n1. **优先具象节点**:优先使用特定工具节点(如 read_file, write_file, grep, bash 等)\n2. **Fallback 到通用节点**:没有对应工具时,使用 agent/llm/bash 节点\n3. **避免条件分支**:不提取循环和条件判断,保持线性流程\n4. **泛化但可执行**:步骤描述可泛化,但节点类型和工具要具体\n\n## 构建流程\n\n**重要**:构建的 Workflow 必须通过 `roy workflow validate` 验证才能输出。\n\n```\n1. 理解用户需求\n2. 参考 roy workflow nodes 查看可用节点类型\n3. 参考 roy workflow get <name> 查看已有 workflow 示例\n4. 生成 Workflow YAML\n5. 使用 roy workflow validate --yaml \"<生成的YAML>\" 验证\n6. 验证通过后输出最终结果\n```\n\n## 验证检查清单\n\n完成 Workflow 构建后,必须使用以下命令验证:\n\n```bash\nroy workflow validate --yaml \"<your-yaml>\"\n```\n\n验证通过后(无错误输出)才输出最终结果。验证失败时根据错误信息修正后重新验证。\n\n## 可用的 Workflow 节点类型\n\n使用以下命令查看所有节点类型的详细配置:\n\n```bash\nroy workflow nodes # 列出所有节点类型\nroy workflow nodes <type> # 查看特定节点详情(如 tool, agent, skill)\n```\n\n**支持的节点类型:**\n- **tool**:执行工具(bash, read-file, write-file, grep 等)\n- **skill**:调用技能\n- **agent**:AI Agent\n- **workflow**:子工作流\n- **condition**:条件判断\n- **merge**:合并结果\n- **decorator**:装饰器方法\n\n## 查看已有 Workflow 示例\n\n使用以下命令查看已有 workflow 的 YAML 结构:\n\n```bash\nroy workflow list # 列出所有 workflow\nroy workflow get <name> # 获取指定 workflow 详情(YAML 格式)\n```\n\n## 输出要求\n\n验证通过后,输出符合以下格式的 YAML Workflow:\n\n```yaml\nname: {泛化的任务名称}\nversion: \"1.0\"\ndescription: {一句话描述}\nnodes:\n - id: node-1\n type: tool|skill|agent|workflow|condition|merge|decorator\n name: {节点名称}\n config:\n # 根据类型配置必填字段:\n # tool: tool, input/args\n # skill: skill, input\n # agent: agent_type, prompt, options\n # workflow: workflow_name, input\n # condition: condition\n # merge: strategy, depends_on\n # decorator: _methodName, _instance\n depends_on: []\noutputs: []\n```\n\n## 限制\n\n- 至少 2 个节点才有意义\n- 不要生成条件节点(if/else/switch)\n- 不要生成循环节点(while/for)\n- 每个节点要有清晰的名称和描述\n- 必须为 tool 节点指定 tool 名称\n- 必须为 agent 节点指定 agent_type 和 prompt";
444
- /**
445
- * 创建 WorkflowExtractorAgent 配置
446
- */
447
- declare function createWorkflowExtractorAgent(): AgentInstanceConfig;
448
- /**
449
- * 格式化提取器输入 - 从 Task 提取
450
- */
451
- declare function formatExtractorInput(params: {
452
- task: Task;
453
- operations: TaskOperation[];
454
- messages: SessionMessage[];
455
- }): string;
456
- /**
457
- * 格式化提取器输入 - 从自然语言描述提取
458
- */
459
- declare function formatExtractorInputFromDescription(params: {
460
- description: string;
461
- }): string;
462
- /**
463
- * 解析提取器输出
464
- */
465
- declare function parseExtractorOutput(output: string): Promise<WorkflowDefinition | null>;
466
- export { parseExtractorOutput, formatExtractorInputFromDescription, formatExtractorInput, createWorkflowExtractorAgent, WORKFLOW_EXTRACTOR_PROMPT, TaskTagPlugin, TaskPluginHook, TaskPluginConfig, TaskPlugin };
@@ -1,23 +0,0 @@
1
- import {
2
- TaskPlugin,
3
- TaskTagPlugin,
4
- WORKFLOW_EXTRACTOR_PROMPT,
5
- createWorkflowExtractorAgent,
6
- formatExtractorInput,
7
- formatExtractorInputFromDescription,
8
- parseExtractorOutput
9
- } from "../../../shared/@ai-setting/roy-agent-core-3jywqmdd.js";
10
- import"../../../shared/@ai-setting/roy-agent-core-92z6t4he.js";
11
- import"../../../shared/@ai-setting/roy-agent-core-44hnfb02.js";
12
- import"../../../shared/@ai-setting/roy-agent-core-xs5rsgat.js";
13
- import"../../../shared/@ai-setting/roy-agent-core-psv4v63c.js";
14
- import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
15
- export {
16
- parseExtractorOutput,
17
- formatExtractorInputFromDescription,
18
- formatExtractorInput,
19
- createWorkflowExtractorAgent,
20
- WORKFLOW_EXTRACTOR_PROMPT,
21
- TaskTagPlugin,
22
- TaskPlugin
23
- };