@ai-setting/roy-agent-core 1.6.18 → 1.6.19
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/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 +2 -2
- package/dist/env/task/index.js +3 -3
- package/dist/env/task/plugins/index.js +2 -2
- package/dist/env/workflow/engine/index.js +1 -1
- package/dist/env/workflow/index.js +2 -2
- package/dist/index.js +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-65vpkh7x.js → roy-agent-core-4djnmd86.js} +37 -22
- package/dist/shared/@ai-setting/{roy-agent-core-h07kk80k.js → roy-agent-core-5ka95kh7.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mvmgy9t0.js → roy-agent-core-5kc9qtej.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-6mz26khm.js → roy-agent-core-8wd5awxg.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-nreqmmtz.js → roy-agent-core-btp589bw.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-yr3fp8tv.js → roy-agent-core-f1cjs6c4.js} +28 -5
- package/dist/shared/@ai-setting/{roy-agent-core-vc8e968b.js → roy-agent-core-m0wy7p0q.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-f6x6ksz3.js → roy-agent-core-mekk4as5.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-n1fx2fx4.js → roy-agent-core-mqeqevym.js} +1 -1
- package/package.json +1 -1
|
@@ -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-8wd5awxg.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-btp589bw.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-4djnmd86.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-m0wy7p0q.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-8wd5awxg.js";
|
|
9
9
|
import {
|
|
10
10
|
EventSourceInitHooks,
|
|
11
11
|
getDefaultConfigForType,
|
|
@@ -17,13 +17,13 @@ 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-btp589bw.js";
|
|
21
21
|
import"../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
22
22
|
import {
|
|
23
23
|
WorkflowComponent
|
|
24
|
-
} from "../shared/@ai-setting/roy-agent-core-
|
|
24
|
+
} from "../shared/@ai-setting/roy-agent-core-mekk4as5.js";
|
|
25
25
|
import"../shared/@ai-setting/roy-agent-core-77wfej1h.js";
|
|
26
|
-
import"../shared/@ai-setting/roy-agent-core-
|
|
26
|
+
import"../shared/@ai-setting/roy-agent-core-f1cjs6c4.js";
|
|
27
27
|
import"../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
28
28
|
import"../shared/@ai-setting/roy-agent-core-gmnex23m.js";
|
|
29
29
|
import"../shared/@ai-setting/roy-agent-core-ez91vxas.js";
|
|
@@ -48,13 +48,13 @@ 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-5kc9qtej.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-mqeqevym.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-4djnmd86.js";
|
|
58
58
|
import"../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
59
59
|
import"../shared/@ai-setting/roy-agent-core-tycbpm17.js";
|
|
60
60
|
import {
|
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-5ka95kh7.js";
|
|
7
|
+
import"../../shared/@ai-setting/roy-agent-core-4djnmd86.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,9 +3,9 @@ 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-mqeqevym.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-4djnmd86.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
10
10
|
import"../../../shared/@ai-setting/roy-agent-core-tycbpm17.js";
|
|
11
11
|
import"../../../shared/@ai-setting/roy-agent-core-qxnbvgwe.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-5kc9qtej.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-mqeqevym.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-4djnmd86.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-tycbpm17.js";
|
|
22
22
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.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-btp589bw.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-4djnmd86.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";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
Scheduler,
|
|
6
6
|
WorkflowEngine,
|
|
7
7
|
init_engine
|
|
8
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
} from "../../../shared/@ai-setting/roy-agent-core-f1cjs6c4.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
10
10
|
import"../../../shared/@ai-setting/roy-agent-core-gmnex23m.js";
|
|
11
11
|
import"../../../shared/@ai-setting/roy-agent-core-ez91vxas.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowComponent
|
|
3
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
3
|
+
} from "../../shared/@ai-setting/roy-agent-core-mekk4as5.js";
|
|
4
4
|
import"../../shared/@ai-setting/roy-agent-core-77wfej1h.js";
|
|
5
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
import"../../shared/@ai-setting/roy-agent-core-f1cjs6c4.js";
|
|
6
6
|
import"../../shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-gmnex23m.js";
|
|
8
8
|
import"../../shared/@ai-setting/roy-agent-core-ez91vxas.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-5ka95kh7.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-m0wy7p0q.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-8wd5awxg.js";
|
|
80
80
|
import {
|
|
81
81
|
BUILT_IN_EVENT_SOURCE_TYPES,
|
|
82
82
|
BUILT_IN_EVENT_SOURCE_TYPE_LIST,
|
|
@@ -96,18 +96,18 @@ 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-btp589bw.js";
|
|
100
100
|
import {
|
|
101
101
|
BasePlugin
|
|
102
102
|
} from "./shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
103
103
|
import {
|
|
104
104
|
WorkflowComponent
|
|
105
|
-
} from "./shared/@ai-setting/roy-agent-core-
|
|
105
|
+
} from "./shared/@ai-setting/roy-agent-core-mekk4as5.js";
|
|
106
106
|
import {
|
|
107
107
|
init_node_registry_helper,
|
|
108
108
|
registerDecoratorNodeType
|
|
109
109
|
} from "./shared/@ai-setting/roy-agent-core-77wfej1h.js";
|
|
110
|
-
import"./shared/@ai-setting/roy-agent-core-
|
|
110
|
+
import"./shared/@ai-setting/roy-agent-core-f1cjs6c4.js";
|
|
111
111
|
import"./shared/@ai-setting/roy-agent-core-6atd905e.js";
|
|
112
112
|
import"./shared/@ai-setting/roy-agent-core-gmnex23m.js";
|
|
113
113
|
import"./shared/@ai-setting/roy-agent-core-ez91vxas.js";
|
|
@@ -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-5kc9qtej.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-mqeqevym.js";
|
|
157
157
|
import"./shared/@ai-setting/roy-agent-core-44g3synv.js";
|
|
158
158
|
import {
|
|
159
159
|
SQLiteTaskStore,
|
|
@@ -162,7 +162,7 @@ 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-4djnmd86.js";
|
|
166
166
|
import"./shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
167
167
|
import {
|
|
168
168
|
AgentRegistry
|
|
@@ -377,52 +377,67 @@ const status = await query_background_process({ bgProcessId: result.bgProcessId
|
|
|
377
377
|
|
|
378
378
|
## Workflow 操作指南
|
|
379
379
|
|
|
380
|
-
Workflow
|
|
380
|
+
Workflow 是预定义的自动化流程,可以高效解决常见类型的任务。**Default agent 自身不应直接 bash 跑 workflow**——所有 workflow 调用必须通过 \`delegate_task\` 委托给 \`workflow-runner\` 子智能体执行。
|
|
381
|
+
|
|
382
|
+
### 如何通过 \`delegate_task\` 调用 workflow(标准路径)
|
|
381
383
|
|
|
382
|
-
### 如何用 workflow 辅助解决任务
|
|
383
384
|
1. **查 tag 发现可用 workflow**:\`workflow tag list\` — 查看 tag 池,找与任务领域匹配的 tag
|
|
384
385
|
2. **按 tag 搜索 workflow**:\`workflow list --tag <tag>\` — 找到相关的 workflow
|
|
385
386
|
3. **按关键词搜索**:\`workflow search --keyword <key>\` — 用关键词匹配
|
|
386
387
|
4. **查看详情**:\`workflow get <name>\` — 了解 workflow 的输入参数和节点流程
|
|
387
|
-
5.
|
|
388
|
+
5. **委托 \`workflow-runner\` 执行**:用下列模板派发
|
|
389
|
+
|
|
390
|
+
\`\`\`text
|
|
391
|
+
delegate_task(
|
|
392
|
+
subagent_type="workflow-runner",
|
|
393
|
+
prompt="调用 workflow_run 执行 workflow <workflow-name>,输入参数: {...}"
|
|
394
|
+
)
|
|
395
|
+
\`\`\`
|
|
388
396
|
|
|
389
397
|
> \uD83D\uDCA1 **什么时候该用 workflow?**
|
|
390
|
-
> - ✅ 你的任务与现有 workflow 的 tag 或描述高度匹配时 →
|
|
398
|
+
> - ✅ 你的任务与现有 workflow 的 tag 或描述高度匹配时 → 委托 \`workflow-runner\` 执行
|
|
391
399
|
> - ✅ 现有 workflow 可以作为参考模板 → 参考其设计自行实现
|
|
392
|
-
> - ❌ 找不到匹配的 workflow →
|
|
400
|
+
> - ❌ 找不到匹配的 workflow → **用传统方式解决**(委托 \`roy\` / \`general\` / \`explore\` / 直接编码)
|
|
401
|
+
|
|
402
|
+
### 可用命令速查(仅供 \`workflow-runner\` 子智能体使用,**default agent 不要直接调用**)
|
|
393
403
|
|
|
394
|
-
### 可用命令速查
|
|
395
404
|
- \`workflow tag list\` — 查看所有 tag
|
|
396
405
|
- \`workflow list --tag <tag>\` — 按 tag 搜索
|
|
397
|
-
- \`workflow search --keyword <
|
|
406
|
+
- \`workflow search --keyword <keyword>\` — 按关键词搜索
|
|
398
407
|
- \`workflow get <name>\` — 查看详情
|
|
399
|
-
- \`workflow
|
|
400
|
-
- \`workflow add --file <path> --tags "a,b,c"\` — 添加新 workflow
|
|
408
|
+
- \`workflow add --file <path> --tags "a,b,c"\` — 添加新 workflow(默认 1-3 个 tag)
|
|
401
409
|
- \`workflow validate --file <path>\` — 验证 workflow 定义
|
|
402
410
|
|
|
411
|
+
> ⚠️ \`workflow run <name>\` 是 workflow-runner 的内部触发命令——**default agent 不要直接 bash 调用**,必须通过 \`delegate_task(subagent_type="workflow-runner", ...)\` 委托子智能体执行。
|
|
412
|
+
|
|
403
413
|
### ⚠️ 重要原则
|
|
404
414
|
- **Workflow 是辅助手段,不是目的**。如果能找到现成 workflow 就使用它;如果找不到或效果不好,**用非 workflow 方式解决**也是完全正确的
|
|
405
415
|
- **不要为了用 workflow 而用**,强行创建一个不合适的 workflow 来套用任务不如直接用传统方式解决
|
|
406
|
-
-
|
|
407
|
-
|
|
408
|
-
### ⚡ Session 恢复(重要,耗时 workflow 必备)
|
|
416
|
+
- **Default agent 不直接调用 workflow**:所有 workflow 调用必须通过 \`delegate_task(subagent_type="workflow-runner", ...)\` 委托子智能体执行
|
|
409
417
|
|
|
410
|
-
|
|
418
|
+
### ⚡ Session 恢复(重要,耗时 workflow 必备 — default agent 视角)
|
|
411
419
|
|
|
412
|
-
|
|
413
|
-
roy-agent workflow run <workflow-name> --input '{"query":"..."}'
|
|
420
|
+
workflow-runner 报告 workflow runId 后,对于耗时较长、易超时的 workflow(如 \`strict-task-agent\`),如遇超时/中断,**default agent 应重新派发 \`delegate_task\` 给 \`workflow-runner\`**,并附带 \`-s\` / \`--session\` 选项让 workflow-runner 从断点继续运行:
|
|
414
421
|
|
|
415
|
-
|
|
416
|
-
|
|
422
|
+
\`\`\`text
|
|
423
|
+
# 初次调用:直接派发 delegate_task(workflow-runner 内部用 workflow_run 启动)
|
|
424
|
+
delegate_task(
|
|
425
|
+
subagent_type="workflow-runner",
|
|
426
|
+
prompt="调用 workflow_run 执行 workflow <workflow-name>,输入参数: {...}"
|
|
427
|
+
)
|
|
417
428
|
|
|
418
|
-
|
|
419
|
-
|
|
429
|
+
# 拿到 runId 后(如 workflow_run_1783407282099_1_ah8pho),从中断处继续:
|
|
430
|
+
delegate_task(
|
|
431
|
+
subagent_type="workflow-runner",
|
|
432
|
+
prompt="调用 workflow_run 续跑 workflow <workflow-name>,-s workflow_run_1783407282099_1_ah8pho"
|
|
433
|
+
)
|
|
434
|
+
\`\`\`
|
|
420
435
|
|
|
421
|
-
>
|
|
436
|
+
> **关键规则**(Task #1837 — runId == sessionId):
|
|
422
437
|
> - Run ID / Session ID 形如 \`workflow_\${Date.now()}_\${counter}_\${random}\`,直接以 \`workflow_\` 开头
|
|
423
438
|
> - runId 和 sessionId 是同一个值(不再需要 \`workflow_\${runId}\` 派生)
|
|
424
|
-
> -
|
|
425
|
-
> - agentNode
|
|
439
|
+
> - 引擎从 last message 推断恢复点(\`workflow.node.start\` → 节点级 resume;\`workflow.node.end\` → 下一节点;\`workflow.node.interrupt\` → ask_user)
|
|
440
|
+
> - agentNode 恢复时自动 attach \`agentSessionId\`,agent 从中断的 sub-session 继续
|
|
426
441
|
> - 适合长时间 workflow(通过 \`workflow-runner\` 调度的任意 workflow)的超时重试
|
|
427
442
|
|
|
428
443
|
### {{memory}}`,
|
|
@@ -2322,7 +2322,7 @@ var init_engine = __esm(() => {
|
|
|
2322
2322
|
scheduler.markFailed(nodeId);
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
|
-
async checkLoopGuardWithSnapshot(sessionState, templateResolver, reEntryId,
|
|
2325
|
+
async checkLoopGuardWithSnapshot(sessionState, templateResolver, reEntryId, snapshotPreviousOutput) {
|
|
2326
2326
|
const guard = sessionState.dagManager.getLoopGuard(reEntryId);
|
|
2327
2327
|
if (!guard) {
|
|
2328
2328
|
return { trip: false, counterKey: "", nextCount: 0 };
|
|
@@ -2330,19 +2330,42 @@ var init_engine = __esm(() => {
|
|
|
2330
2330
|
const counterKey = `_loop_guard_consecutive_${reEntryId}`;
|
|
2331
2331
|
const previousCount = sessionState.loopGuardCounters.get(reEntryId) ?? 0;
|
|
2332
2332
|
const previousValue = templateResolver.resolveValue(guard.previous_signal);
|
|
2333
|
-
const
|
|
2333
|
+
const resolvedCwdRaw = templateResolver.resolveValue(guard.cwd);
|
|
2334
|
+
const resolvedCwd = typeof resolvedCwdRaw === "string" && resolvedCwdRaw.length > 0 ? resolvedCwdRaw : undefined;
|
|
2335
|
+
const resolvedCommandRaw = templateResolver.resolveValue(guard.current_signal_command);
|
|
2336
|
+
const resolvedCommand = typeof resolvedCommandRaw === "string" && resolvedCommandRaw.length > 0 ? resolvedCommandRaw : guard.current_signal_command;
|
|
2337
|
+
const cwd = resolvedCwd ?? sessionState.config.workflowInput?.project_path ?? process.cwd();
|
|
2334
2338
|
let currentValue;
|
|
2335
2339
|
try {
|
|
2336
|
-
const { stdout } = await execFileAsync("/bin/sh", ["-c",
|
|
2340
|
+
const { stdout } = await execFileAsync("/bin/sh", ["-c", resolvedCommand], {
|
|
2337
2341
|
cwd,
|
|
2338
2342
|
timeout: 1e4
|
|
2339
2343
|
});
|
|
2340
2344
|
currentValue = stdout.trim();
|
|
2341
2345
|
} catch (err) {
|
|
2342
|
-
|
|
2343
|
-
|
|
2346
|
+
const errMessage = err instanceof Error ? err.message : String(err);
|
|
2347
|
+
logger3.error(`[WorkflowEngine] loop_guard command failed for ${reEntryId}: ${errMessage}. Counting as no-progress.`);
|
|
2348
|
+
const nextCount2 = previousCount + 1;
|
|
2349
|
+
const maxAllowed2 = guard.max_consecutive_no_progress;
|
|
2350
|
+
if (nextCount2 >= maxAllowed2) {
|
|
2351
|
+
const failMessage = guard.fail_message ?? `loop_guard command failed for ${reEntryId} after ${nextCount2} consecutive re-entries: ${errMessage}`;
|
|
2352
|
+
return { trip: true, failMessage, counterKey, nextCount: nextCount2 };
|
|
2353
|
+
}
|
|
2354
|
+
sessionState.loopGuardCounters.set(reEntryId, nextCount2);
|
|
2355
|
+
return { trip: false, counterKey, nextCount: nextCount2 };
|
|
2344
2356
|
}
|
|
2345
2357
|
if (previousValue === undefined) {
|
|
2358
|
+
const snapshotHasContent = snapshotPreviousOutput !== undefined && snapshotPreviousOutput !== null && typeof snapshotPreviousOutput === "object" && Object.keys(snapshotPreviousOutput).length > 0;
|
|
2359
|
+
if (snapshotHasContent) {
|
|
2360
|
+
const nextCount2 = previousCount + 1;
|
|
2361
|
+
const maxAllowed2 = guard.max_consecutive_no_progress;
|
|
2362
|
+
if (nextCount2 >= maxAllowed2) {
|
|
2363
|
+
const failMessage = guard.fail_message ?? `loop_guard previous_signal path unresolved for ${reEntryId} after ${nextCount2} consecutive re-entries: ${guard.previous_signal}`;
|
|
2364
|
+
return { trip: true, failMessage, counterKey, nextCount: nextCount2 };
|
|
2365
|
+
}
|
|
2366
|
+
sessionState.loopGuardCounters.set(reEntryId, nextCount2);
|
|
2367
|
+
return { trip: false, counterKey, nextCount: nextCount2 };
|
|
2368
|
+
}
|
|
2346
2369
|
return { trip: false, counterKey, nextCount: 0 };
|
|
2347
2370
|
}
|
|
2348
2371
|
const isUnchanged = JSON.stringify(previousValue) === JSON.stringify(currentValue);
|