@ai-setting/roy-agent-core 1.6.19 → 1.6.20
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 +3 -3
- package/dist/env/index.js +8 -8
- package/dist/env/prompt/index.js +2 -2
- package/dist/env/task/delegate/index.js +3 -3
- package/dist/env/task/index.js +4 -4
- package/dist/env/task/plugins/index.js +2 -2
- package/dist/index.js +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-mqeqevym.js → roy-agent-core-8n3je2r0.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-m0wy7p0q.js → roy-agent-core-b9q2jfx4.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8wd5awxg.js → roy-agent-core-bwqjwa0d.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-5ka95kh7.js → roy-agent-core-ett06sn8.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-tycbpm17.js → roy-agent-core-fntxq0gf.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-btp589bw.js → roy-agent-core-grajzyhd.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-5kc9qtej.js → roy-agent-core-rdf8tqj7.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-4djnmd86.js → roy-agent-core-skqt40yy.js} +85 -12
- package/dist/shared/@ai-setting/{roy-agent-core-qyb2z42s.js → roy-agent-core-zeztnvvb.js} +1 -1
- package/package.json +1 -1
package/dist/env/agent/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
AgentComponent,
|
|
3
3
|
AgentComponentConfigSchema,
|
|
4
4
|
SummaryAgent
|
|
5
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
} from "../../shared/@ai-setting/roy-agent-core-zeztnvvb.js";
|
|
6
6
|
import"../../shared/@ai-setting/roy-agent-core-8n0e62y4.js";
|
|
7
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-
|
|
10
|
+
import"../../shared/@ai-setting/roy-agent-core-fntxq0gf.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-
|
|
14
|
+
} from "../../shared/@ai-setting/roy-agent-core-bwqjwa0d.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-
|
|
25
|
+
import"../../shared/@ai-setting/roy-agent-core-grajzyhd.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-
|
|
31
|
+
import"../../shared/@ai-setting/roy-agent-core-skqt40yy.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-
|
|
3
|
+
} from "../shared/@ai-setting/roy-agent-core-b9q2jfx4.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-bwqjwa0d.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-
|
|
20
|
+
import"../shared/@ai-setting/roy-agent-core-grajzyhd.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-
|
|
44
|
+
} from "../shared/@ai-setting/roy-agent-core-zeztnvvb.js";
|
|
45
45
|
import"../shared/@ai-setting/roy-agent-core-8n0e62y4.js";
|
|
46
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-
|
|
51
|
+
} from "../shared/@ai-setting/roy-agent-core-rdf8tqj7.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-
|
|
54
|
+
import"../shared/@ai-setting/roy-agent-core-8n3je2r0.js";
|
|
55
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-
|
|
57
|
+
import"../shared/@ai-setting/roy-agent-core-skqt40yy.js";
|
|
58
58
|
import"../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
59
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
59
|
+
import"../shared/@ai-setting/roy-agent-core-fntxq0gf.js";
|
|
60
60
|
import {
|
|
61
61
|
XDG_PATHS,
|
|
62
62
|
getXDGPath,
|
package/dist/env/prompt/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
PromptConfigSchema,
|
|
4
4
|
PromptPathSchema,
|
|
5
5
|
PromptRenderer
|
|
6
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
7
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../shared/@ai-setting/roy-agent-core-ett06sn8.js";
|
|
7
|
+
import"../../shared/@ai-setting/roy-agent-core-skqt40yy.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-
|
|
6
|
+
} from "../../../shared/@ai-setting/roy-agent-core-8n3je2r0.js";
|
|
7
7
|
import"../../../shared/@ai-setting/roy-agent-core-44g3synv.js";
|
|
8
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
import"../../../shared/@ai-setting/roy-agent-core-skqt40yy.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
10
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
import"../../../shared/@ai-setting/roy-agent-core-fntxq0gf.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";
|
package/dist/env/task/index.js
CHANGED
|
@@ -5,20 +5,20 @@ 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-rdf8tqj7.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-
|
|
13
|
+
import"../../shared/@ai-setting/roy-agent-core-8n3je2r0.js";
|
|
14
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-
|
|
19
|
+
import"../../shared/@ai-setting/roy-agent-core-skqt40yy.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
21
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
21
|
+
import"../../shared/@ai-setting/roy-agent-core-fntxq0gf.js";
|
|
22
22
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
23
23
|
import"../../shared/@ai-setting/roy-agent-core-c7e3htaq.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-
|
|
11
|
+
} from "../../../shared/@ai-setting/roy-agent-core-grajzyhd.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-
|
|
17
|
+
import"../../../shared/@ai-setting/roy-agent-core-skqt40yy.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";
|
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-
|
|
4
|
+
} from "./shared/@ai-setting/roy-agent-core-ett06sn8.js";
|
|
5
5
|
import {
|
|
6
6
|
LLMComponent,
|
|
7
7
|
LLMConfigSchema,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
BaseEnvironment,
|
|
64
64
|
generateDescendingId,
|
|
65
65
|
generateId
|
|
66
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
66
|
+
} from "./shared/@ai-setting/roy-agent-core-b9q2jfx4.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-
|
|
79
|
+
} from "./shared/@ai-setting/roy-agent-core-bwqjwa0d.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-
|
|
99
|
+
} from "./shared/@ai-setting/roy-agent-core-grajzyhd.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-
|
|
134
|
+
} from "./shared/@ai-setting/roy-agent-core-zeztnvvb.js";
|
|
135
135
|
import {
|
|
136
136
|
createInvokeConfig,
|
|
137
137
|
invoke,
|
|
@@ -150,10 +150,10 @@ 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-
|
|
153
|
+
} from "./shared/@ai-setting/roy-agent-core-rdf8tqj7.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-
|
|
156
|
+
import"./shared/@ai-setting/roy-agent-core-8n3je2r0.js";
|
|
157
157
|
import"./shared/@ai-setting/roy-agent-core-44g3synv.js";
|
|
158
158
|
import {
|
|
159
159
|
SQLiteTaskStore,
|
|
@@ -162,11 +162,11 @@ import {
|
|
|
162
162
|
import {
|
|
163
163
|
getBuiltInPrompt,
|
|
164
164
|
getBuiltInPromptNames
|
|
165
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
165
|
+
} from "./shared/@ai-setting/roy-agent-core-skqt40yy.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-
|
|
169
|
+
} from "./shared/@ai-setting/roy-agent-core-fntxq0gf.js";
|
|
170
170
|
import {
|
|
171
171
|
XDG_PATHS,
|
|
172
172
|
getXDGPath,
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./roy-agent-core-44g3synv.js";
|
|
5
5
|
import {
|
|
6
6
|
builtInPrompts
|
|
7
|
-
} from "./roy-agent-core-
|
|
7
|
+
} from "./roy-agent-core-skqt40yy.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-
|
|
13
|
+
} from "./roy-agent-core-fntxq0gf.js";
|
|
14
14
|
import {
|
|
15
15
|
TaskHookPoints
|
|
16
16
|
} from "./roy-agent-core-1pg0fepg.js";
|
|
@@ -165,7 +165,7 @@ class AgentRegistry {
|
|
|
165
165
|
const agent = {
|
|
166
166
|
name,
|
|
167
167
|
type: "sub",
|
|
168
|
-
description: "Workflow runner —
|
|
168
|
+
description: "Workflow runner — 接受带 workflow_name(必填)的委托,或指示其按 search-first 流程自行选定(workflow_tag_list + workflow_search + workflow_list + workflow_get),然后通过 workflow_run 执行 workflow;支持 session resume 和 stop;失败接管由 prompt 推理触发 (Task #2251)。**调用方必须在 prompt 中明确指定 workflow 名,或指示 sub-agent 自行搜索选择;禁止盲猜/绕过/跳过 schema 验证** (Task #2486)。",
|
|
169
169
|
systemPromptRef: "workflow-runner",
|
|
170
170
|
deniedTools: ["delegate_task", "stop_task"],
|
|
171
171
|
maxIterations: 30
|
|
@@ -110,6 +110,10 @@ var builtInPrompts = {
|
|
|
110
110
|
|
|
111
111
|
## 子智能体选择策略
|
|
112
112
|
|
|
113
|
+
**核心铁律**:选了某个 subagent 后,必须**遵循该 subagent 的工作模式**——把任务用它的 prompt 模板、工具集和决策路径表达,**不能用自己的方式硬塞**。
|
|
114
|
+
|
|
115
|
+
> \uD83D\uDCA1 **典型例子**:选 \`workflow-runner\` 时,prompt 必须**明确指定 workflow 名**(让 sub-agent 直接 \`workflow_run\`)**或**让 sub-agent **先 \`workflow_search\` / \`workflow_list\` / \`workflow_get\` 自行选定**——不要让 sub-agent 替你做不属于它的决策(如 \`workflow_creat\`)。
|
|
116
|
+
|
|
113
117
|
你有多类子智能体。**默认首次委托使用 \`roy\`**。**调用 workflow 解决的任务,委托给 \`workflow-runner\`**(兼容语法:\`strict-task-agent\` / \`code-review\` / \`bench-agent-host\` / \`workspace-analyzer\` / \`test-workflow-agent\` 等旧名仍可用,会被自动重写)。
|
|
114
118
|
|
|
115
119
|
### \uD83E\uDD47 首选:\`roy\`(首次委托默认)
|
|
@@ -147,15 +151,34 @@ delegate_task(
|
|
|
147
151
|
- **安全关键型变更** — 验证不可妥协
|
|
148
152
|
- **代码审查/审计** — 需要系统性对照目标进行检查
|
|
149
153
|
|
|
150
|
-
|
|
154
|
+
#### 两种合法委托模式(**workflow_name 必传 / search-first 二选一**)
|
|
155
|
+
|
|
156
|
+
\`workflow-runner\` 的 \`<workflow_name>\` 是它的第一铁律(参见 \`workflow-runner\` prompt 的"## ⚠️ workflow_name 处理规则")。委托时必须在 prompt 里:
|
|
157
|
+
|
|
158
|
+
- **模式 A — 传具体 workflow_name**(首选):你已经知道该跑哪个 workflow,直接在 prompt 中指定名字,sub-agent 直接 \`workflow_get(name)\` → \`workflow_run\`。
|
|
159
|
+
- **模式 B — search-first 兜底**:你只知道任务目标但不确定 workflow 名,指示 sub-agent 自行 \`workflow_tag_list\` + \`workflow_search\` + \`workflow_list\` + \`workflow_get\` 选定再 \`workflow_run\`。
|
|
160
|
+
|
|
161
|
+
**禁止**:让 sub-agent 猜 workflow_name、绕过 workflow 自己完成任务、或跳过 schema 验证。
|
|
162
|
+
|
|
163
|
+
#### 模式 A 示例 — 传具体 workflow_name
|
|
164
|
+
|
|
151
165
|
\`\`\`
|
|
152
166
|
delegate_task(
|
|
153
|
-
description="
|
|
154
|
-
prompt="
|
|
167
|
+
description="执行 strict-task-agent workflow",
|
|
168
|
+
prompt="调用 workflow_run 执行 workflow strict-task-agent,任务是修复 roy-rd-with-trace 中的 X bug。",
|
|
169
|
+
subagent_type="workflow-runner",
|
|
170
|
+
similar_task_ids=[]
|
|
171
|
+
)
|
|
172
|
+
\`\`\`
|
|
155
173
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
174
|
+
#### 模式 B 示例 — search-first 兜底
|
|
175
|
+
|
|
176
|
+
\`\`\`
|
|
177
|
+
delegate_task(
|
|
178
|
+
description="寻找并执行合适的 workflow",
|
|
179
|
+
prompt="用户目标:批量跑 stock 筛选分析。请按 workflow-runner 的 search-first 流程:先 \`workflow_tag_list\` + \`workflow_search --keyword stock\` + \`workflow_list\` 找到匹配的 workflow,再 \`workflow_get <name>\` 验证 schema,最后 \`workflow_run <name>\` 执行。不要猜测 workflow 名。",
|
|
180
|
+
subagent_type="workflow-runner",
|
|
181
|
+
similar_task_ids=[]
|
|
159
182
|
)
|
|
160
183
|
\`\`\`
|
|
161
184
|
|
|
@@ -379,13 +402,22 @@ const status = await query_background_process({ bgProcessId: result.bgProcessId
|
|
|
379
402
|
|
|
380
403
|
Workflow 是预定义的自动化流程,可以高效解决常见类型的任务。**Default agent 自身不应直接 bash 跑 workflow**——所有 workflow 调用必须通过 \`delegate_task\` 委托给 \`workflow-runner\` 子智能体执行。
|
|
381
404
|
|
|
405
|
+
### ⚠️ 委托时 workflow_name 必传 / search-first 二选一(Task #2486)
|
|
406
|
+
|
|
407
|
+
\`workflow-runner\` 的 \`<workflow_name>\` 是它的**第一铁律**(详见 \`workflow-runner\` prompt "## ⚠️ workflow_name 处理规则")。**Default agent 在委托时必须**:
|
|
408
|
+
|
|
409
|
+
- **指定 workflow 名** — prompt 里明确写出 \`运行 workflow <workflow-name>\`,sub-agent 直接 \`workflow_get(name)\` → \`workflow_run\`。
|
|
410
|
+
- **或指示 sub-agent 自行搜索** — prompt 里说"按 search-first 流程:先 \`workflow_tag_list\` + \`workflow_search\` + \`workflow_list\` + \`workflow_get\` 选定再执行",让 sub-agent 自决。
|
|
411
|
+
|
|
412
|
+
**绝对禁止**:让 sub-agent 猜 workflow 名 / 绕过 workflow / 跳过 schema 验证。
|
|
413
|
+
|
|
382
414
|
### 如何通过 \`delegate_task\` 调用 workflow(标准路径)
|
|
383
415
|
|
|
384
416
|
1. **查 tag 发现可用 workflow**:\`workflow tag list\` — 查看 tag 池,找与任务领域匹配的 tag
|
|
385
417
|
2. **按 tag 搜索 workflow**:\`workflow list --tag <tag>\` — 找到相关的 workflow
|
|
386
418
|
3. **按关键词搜索**:\`workflow search --keyword <key>\` — 用关键词匹配
|
|
387
419
|
4. **查看详情**:\`workflow get <name>\` — 了解 workflow 的输入参数和节点流程
|
|
388
|
-
5. **委托 \`workflow-runner\`
|
|
420
|
+
5. **委托 \`workflow-runner\` 执行**:用下列模板派发(workflow_name 由 default agent 自己查好后填入,或改成"按 search-first 流程自行选定")
|
|
389
421
|
|
|
390
422
|
\`\`\`text
|
|
391
423
|
delegate_task(
|
|
@@ -394,6 +426,14 @@ delegate_task(
|
|
|
394
426
|
)
|
|
395
427
|
\`\`\`
|
|
396
428
|
|
|
429
|
+
**search-first 替代模板**(当你不确定 workflow 名时):
|
|
430
|
+
\`\`\`text
|
|
431
|
+
delegate_task(
|
|
432
|
+
subagent_type="workflow-runner",
|
|
433
|
+
prompt="按 search-first 流程执行:先 \`workflow_tag_list\` + \`workflow_search --keyword <key>\` + \`workflow_list\` 找到匹配 workflow,再 \`workflow_get <name>\` 验证 schema,最后 \`workflow_run <name>\` 执行。"
|
|
434
|
+
)
|
|
435
|
+
\`\`\`
|
|
436
|
+
|
|
397
437
|
> \uD83D\uDCA1 **什么时候该用 workflow?**
|
|
398
438
|
> - ✅ 你的任务与现有 workflow 的 tag 或描述高度匹配时 → 委托 \`workflow-runner\` 执行
|
|
399
439
|
> - ✅ 现有 workflow 可以作为参考模板 → 参考其设计自行实现
|
|
@@ -1111,6 +1151,36 @@ When reusing an existing task, you MUST follow these rules:
|
|
|
1111
1151
|
|
|
1112
1152
|
workflow 名必须从 \`<workflow_name>\` 标签读取,不得根据上下文猜测。
|
|
1113
1153
|
|
|
1154
|
+
## ⚠️ workflow_name 处理规则(关键 — Task #2486)
|
|
1155
|
+
|
|
1156
|
+
**这是 workflow-runner 的第一铁律。** 在调用任何 \`workflow_run\` 之前,**必须**确认 workflow 名是真实、确定的。
|
|
1157
|
+
|
|
1158
|
+
### 三种合法情况
|
|
1159
|
+
|
|
1160
|
+
| 情况 | 判定 | 第一步动作 |
|
|
1161
|
+
|---|---|---|
|
|
1162
|
+
| (1) **parent 已传具体 workflow_name** | \`<workflow_name>\` 标签里是非空字符串(如 \`roy-rd-with-trace\`) | 直接走"## 默认 workflow-run 模式" — 调 \`workflow_get(name)\` 确认 schema 后 \`workflow_run\` |
|
|
1163
|
+
| (2) **parent 没传 workflow_name**,但 original_prompt / task_description 里**明确指名** | 用户在原任务里说"跑 X workflow" | 用文本中提到的名字当作 workflow_name,调 \`workflow_get(name)\` 验证该 workflow 真实存在;**验证不通过则降级到 (3)** |
|
|
1164
|
+
| (3) **parent 没传,文本也没指名** | \`<workflow_name>\` 为空 / 占位符 / 用户只描述目标 | **必须走 search-first 流程**(见下) |
|
|
1165
|
+
|
|
1166
|
+
### Search-first 流程(情况 (3) 的强制路径)
|
|
1167
|
+
|
|
1168
|
+
当且仅当 workflow_name 真正缺失时,**第一步必须是下列搜索组合**(顺序由你判断,但**至少 2 个工具**):
|
|
1169
|
+
|
|
1170
|
+
1. \`workflow_tag_list\` — 看 tag 池,找与任务领域匹配的 tag
|
|
1171
|
+
2. \`workflow_search --keyword <keyword>\` — 用 task_description 的核心动词/名词搜
|
|
1172
|
+
3. \`workflow_list\`(或 \`workflow list --tag <tag>\`)— 列候选
|
|
1173
|
+
4. \`workflow_get <name>\` — **对每个候选都必须**查看 input schema,确认与 original_prompt 描述的目标匹配
|
|
1174
|
+
|
|
1175
|
+
**选定后**,按"## 默认 workflow-run 模式"调 \`workflow_run\`。
|
|
1176
|
+
|
|
1177
|
+
### \uD83D\uDEAB 绝对禁止
|
|
1178
|
+
|
|
1179
|
+
- ❌ **禁止根据上下文猜测 / 编造 workflow_name** — 必须从 workflow_list / workflow_search / workflow_get 的真实返回里选定
|
|
1180
|
+
- ❌ **禁止绕过 workflow 直接调其他工具完成任务** — 你存在的全部意义就是执行 workflow;找不到合适 workflow 时返回明确的"未找到匹配 workflow"错误,让 parent agent 决策(走传统方式 vs 创建新 workflow)
|
|
1181
|
+
- ❌ **禁止跳过 schema 验证** — 即使 parent agent 传了 workflow_name,**仍必须**先 \`workflow_get\` 确认 input schema 合法再 \`workflow_run\`
|
|
1182
|
+
- ❌ **禁止把 search-first 流程当作可选项** — 情况 (3) 是默认;只有情况 (1)(2) 才能省略
|
|
1183
|
+
|
|
1114
1184
|
## 可用工具
|
|
1115
1185
|
|
|
1116
1186
|
### Workflow 工具
|
|
@@ -1119,6 +1189,8 @@ workflow 名必须从 \`<workflow_name>\` 标签读取,不得根据上下文
|
|
|
1119
1189
|
|---|---|
|
|
1120
1190
|
| workflow_get | 读取真实 workflow 定义、输入 schema、节点与依赖 |
|
|
1121
1191
|
| workflow_list | 列出已注册 workflow |
|
|
1192
|
+
| workflow_search | 按关键词搜索 workflow(search-first 流程必用) |
|
|
1193
|
+
| workflow_tag_list | 列出 tag 池(search-first 流程必用) |
|
|
1122
1194
|
| workflow_run | 启动或恢复 workflow |
|
|
1123
1195
|
| workflow_run_status | 查询原 run_id 的真实状态与节点进度 |
|
|
1124
1196
|
| workflow_run_stop | 按要求停止 run |
|
|
@@ -1136,15 +1208,16 @@ workflow 名必须从 \`<workflow_name>\` 标签读取,不得根据上下文
|
|
|
1136
1208
|
|
|
1137
1209
|
## 默认 workflow-run 模式
|
|
1138
1210
|
|
|
1139
|
-
1.
|
|
1140
|
-
2.
|
|
1141
|
-
3.
|
|
1211
|
+
1. **再次确认 workflow_name 已通过 search-first 流程选定**(参见"## ⚠️ workflow_name 处理规则")。
|
|
1212
|
+
2. 调 \`workflow_get(name)\`,确认 input schema、节点描述和 DAG 依赖。
|
|
1213
|
+
3. 从 original_prompt 提取合法 input。
|
|
1214
|
+
4. 没有 existing_sub_session_id 时调用 fresh \`workflow_run\`;有该 ID 时先调
|
|
1142
1215
|
\`workflow_run_status(run_id)\`,再以同一 ID 作为 session 恢复。runId == sessionId。
|
|
1143
1216
|
|
|
1144
1217
|
Copy-paste CLI 示例:
|
|
1145
1218
|
\`roy-agent workflow run roy-rd-with-trace -s workflow_run_1783407282099_1_ah8pho\`
|
|
1146
|
-
|
|
1147
|
-
|
|
1219
|
+
5. 对 \`completed\` / \`paused\` 返回真实 output;对 \`running\` / \`stopped\` 按真实状态报告。
|
|
1220
|
+
6. 对每次 \`failed\` / \`timeout\`,扫描你自己最近的 workflow_run tool results,推理连续失败次数。
|
|
1148
1221
|
|
|
1149
1222
|
## 连续 2 次失败阈值(由 LLM 自行推理)
|
|
1150
1223
|
|