@mzzsfy/dsh-rs-workflow 1.0.0 → 1.0.1
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.
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// 单批次执行器脚本:宿主 workflowEngine 裸 vm body,globals 仅 agent/parallel/pipeline/phase/log/args,无模块语法
|
|
2
|
+
const BATCH_PHASE = '若水批次'
|
|
3
|
+
const NULL_OUTPUT_ERROR = '子代理未提交结构化产出'
|
|
4
|
+
|
|
5
|
+
const errorText = (error) => String((error && error.message) || error)
|
|
6
|
+
const settle = (callId, outputs) => outputs === null
|
|
7
|
+
? { callId, ok: false, error: NULL_OUTPUT_ERROR }
|
|
8
|
+
: { callId, ok: true, outputs }
|
|
9
|
+
|
|
10
|
+
const { calls } = args
|
|
11
|
+
// v5 引擎 parallel 契约:零参 thunk 数组(每个 thunk 失败→null),不再是 promise 数组;
|
|
12
|
+
// agent() options 键存在则值必须是 JSON(undefined 不行),缺省键须整键省略
|
|
13
|
+
const dispatches = calls.map((call) => () => agent(call.prompt, {
|
|
14
|
+
label: call.label,
|
|
15
|
+
phase: BATCH_PHASE,
|
|
16
|
+
...call.schema !== undefined ? { schema: call.schema } : {},
|
|
17
|
+
...call.provider !== undefined ? { provider: call.provider } : {},
|
|
18
|
+
...call.model !== undefined ? { model: call.model } : {},
|
|
19
|
+
}).then((outputs) => settle(call.callId, outputs))
|
|
20
|
+
.catch((error) => ({ callId: call.callId, ok: false, error: errorText(error) })))
|
|
21
|
+
|
|
22
|
+
const results = await parallel(dispatches)
|
|
23
|
+
return { results }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mzzsfy/dsh-rs-workflow",
|
|
3
3
|
"description": "若水工作流设置面:流程模板管理与工作位/预算配置(模板编辑/校验/配置读写)。编排运行时按 v5 设计(docs/rsww-v5/)另行实现。",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"lib",
|
|
30
30
|
"src",
|
|
31
|
+
"engine",
|
|
32
|
+
"preset",
|
|
31
33
|
"cordis.patch.yml",
|
|
32
34
|
"README.md"
|
|
33
35
|
],
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# The `rs-workflow` agent preset: 若水工作流(v5,主循环协作编排)。
|
|
2
|
+
#
|
|
3
|
+
# 本文件是释放骨架源:release 生成器把它作为唯一源生成 rs-<id> 模式组合
|
|
4
|
+
# (运行时仅改写 orchestrator 行的 templateId 锚定),不在包内被宿主装载。
|
|
5
|
+
#
|
|
6
|
+
# 基底是 `standard` 全功能编码代理行集,差异:
|
|
7
|
+
# 1. persona 换成流程模式纪律 v5(人机接口+受约束规划者,任务交付由编排子代理承担);
|
|
8
|
+
# 2. delegation 组内 rs-workflow-orchestrator 工具行与 template-tool 行;
|
|
9
|
+
# 3. 无 report 行(trace 事件 + run-store 取代);plan-mode 组移除(规划在编排内)。
|
|
10
|
+
|
|
11
|
+
# ── identity ────────────────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
- id: persona
|
|
14
|
+
name: '@deepseek-ai/dsh-persona'
|
|
15
|
+
config:
|
|
16
|
+
prefix: |-
|
|
17
|
+
你是"若水工作流"会话代理,由 {{model}} 模型驱动。你负责人机协作与编排调度;
|
|
18
|
+
任务交付由流程引擎接管下的子代理完成,你不直接产出交付物。
|
|
19
|
+
职责判据:
|
|
20
|
+
1. 纯会话内请求(问答、解释、讨论,不产生文件)→ 直接答复,不起编排;
|
|
21
|
+
2. 凡需新建或修改交付物文件(代码、页面、脚本、文档、配置,无论大小与步骤数,例如"写个贪吃蛇html")
|
|
22
|
+
→ 必须调用 rs_workflow_start,提交结构化规划(steps 各步要点与验收口径);禁止以"一句话能答、
|
|
23
|
+
改动小"为由绕开编排自行产出文件;此通道无豁免:规划被拒按 errors 修正重交,不许改道自行完成;
|
|
24
|
+
3. 编排运行中你只被段结束通知或用户消息唤醒:任一唤醒轮先 rs_workflow_status 检查现役 run——
|
|
25
|
+
status=running 且无活跃段 job(待拉起)或 status=paused 且 awaitingResume=true(页签已发恢复)
|
|
26
|
+
时,即 rs_workflow_resume 补拉;waiting_approval 一律不补拉,轮到裁决:按模板 autoApprove 决定
|
|
27
|
+
代审或 ask_user 转呈真人,裁决经 rs_workflow_verdict 回写(autoApprove 代审 by 缺省,转呈真人
|
|
28
|
+
by=user,意见必填),裁决受理后 rs_workflow_resume 拉起下一段;
|
|
29
|
+
终态则汇报(完成经 deliverables 交付,汇报必须引用 runId 供页签核验;失败/阻塞说明卡点与建议);
|
|
30
|
+
任何交付说明若无对应 run 记录即为违规——禁止把自行产出的文件当交付物汇报;
|
|
31
|
+
用户中途纠偏经 rs_workflow_message 注入,下一步骤边界进入编排;
|
|
32
|
+
4. 你不代替子代理执行编排内步骤,不伪造产出,不跳过引擎直接交付;
|
|
33
|
+
5. 引擎不可用或编排启动失败时,不得自行完成文件类请求——向用户说明故障与已尝试的调用,
|
|
34
|
+
等待用户处置;文件交付只有 rs_workflow_ 通道,没有自行兜底。
|
|
35
|
+
suffix: Your working directory is {{cwd}}.
|
|
36
|
+
|
|
37
|
+
- id: agent-instructions
|
|
38
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
39
|
+
config:
|
|
40
|
+
maxBytes: 65536
|
|
41
|
+
|
|
42
|
+
# ── shell ───────────────────────────────────────────────────────────────────
|
|
43
|
+
|
|
44
|
+
# 注:不可禁本组合 shell/fs 工具行——宿主 workflow worker 的段子代理继承组合行集,
|
|
45
|
+
# 禁行使段子代理无法落盘交付物(实测证实)。主循环不写文件由 persona 判据约束,
|
|
46
|
+
# 物理隔离需宿主提供 worker 行集覆写能力(外部依赖)。
|
|
47
|
+
|
|
48
|
+
- id: tool-bash
|
|
49
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
50
|
+
disabled: !!js process.platform === 'win32'
|
|
51
|
+
|
|
52
|
+
- id: tool-pwsh
|
|
53
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
54
|
+
disabled: !!js process.platform !== 'win32'
|
|
55
|
+
|
|
56
|
+
# ── filesystem ──────────────────────────────────────────────────────────────
|
|
57
|
+
|
|
58
|
+
- id: tool-fs
|
|
59
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
60
|
+
|
|
61
|
+
- id: tool-fs-search
|
|
62
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
63
|
+
config:
|
|
64
|
+
sampleOverCapGlobResults: false
|
|
65
|
+
|
|
66
|
+
# ── background jobs ────────────────────────────────────────────────────────
|
|
67
|
+
|
|
68
|
+
- id: tool-jobs
|
|
69
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
70
|
+
|
|
71
|
+
# ── skills ──────────────────────────────────────────────────────────────────
|
|
72
|
+
|
|
73
|
+
- id: skill-filesystem
|
|
74
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
75
|
+
|
|
76
|
+
- id: tool-skill
|
|
77
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
78
|
+
|
|
79
|
+
# ── web ─────────────────────────────────────────────────────────────────────
|
|
80
|
+
|
|
81
|
+
- id: tool-web
|
|
82
|
+
name: '@deepseek-ai/dsh-tool-web'
|
|
83
|
+
config:
|
|
84
|
+
fetch: false
|
|
85
|
+
searchTimeoutMs: 60000
|
|
86
|
+
|
|
87
|
+
# ── compaction ──────────────────────────────────────────────────────────────
|
|
88
|
+
|
|
89
|
+
# 编排子代理上下文较长,保留 standard 的压缩组。
|
|
90
|
+
- id: compaction
|
|
91
|
+
name: cordis:group
|
|
92
|
+
group: true
|
|
93
|
+
isolate:
|
|
94
|
+
compaction: true
|
|
95
|
+
toolResultPruner: true
|
|
96
|
+
config:
|
|
97
|
+
- id: compaction-basic
|
|
98
|
+
name: '@deepseek-ai/dsh-compaction-basic'
|
|
99
|
+
|
|
100
|
+
- id: command-compact
|
|
101
|
+
name: '@deepseek-ai/dsh-command-compact'
|
|
102
|
+
|
|
103
|
+
- id: tool-result-pruner
|
|
104
|
+
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
105
|
+
config:
|
|
106
|
+
thresholdChars: 8192
|
|
107
|
+
headChars: 4096
|
|
108
|
+
tailChars: 1024
|
|
109
|
+
|
|
110
|
+
# ── delegation and workflows ────────────────────────────────────────────────
|
|
111
|
+
|
|
112
|
+
# workflowEngine 是预设私有服务(preset 组合发布全局服务会被宿主拒绝 mount),
|
|
113
|
+
# 所有触达它的行共享一个 entry-local isolate realm。
|
|
114
|
+
# orchestrator 行注册 rs_workflow_* 六工具(含裁决回写 rs_workflow_verdict)并经 jobs 服务拉起分段 continuable job;
|
|
115
|
+
# 控制队列与 store 为普通模块单例,host/agent 行经同一 realpath 解析共享实例。
|
|
116
|
+
- id: delegation
|
|
117
|
+
name: cordis:group
|
|
118
|
+
group: true
|
|
119
|
+
isolate:
|
|
120
|
+
workflowEngine: true
|
|
121
|
+
config:
|
|
122
|
+
- id: tool-subagent-control
|
|
123
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
124
|
+
|
|
125
|
+
- id: tool-subagent-list-agents
|
|
126
|
+
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
127
|
+
|
|
128
|
+
- id: tool-subagent
|
|
129
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
130
|
+
config:
|
|
131
|
+
provider: spawn
|
|
132
|
+
toolName: subagent
|
|
133
|
+
backgroundMode: continuable
|
|
134
|
+
|
|
135
|
+
- id: tool-subagent-fork
|
|
136
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
137
|
+
config:
|
|
138
|
+
provider: fork
|
|
139
|
+
toolName: subagent_fork
|
|
140
|
+
backgroundMode: continuable
|
|
141
|
+
|
|
142
|
+
- id: workflow-worker-thread
|
|
143
|
+
name: '@deepseek-ai/dsh-workflow-worker-thread'
|
|
144
|
+
config:
|
|
145
|
+
provider: spawn
|
|
146
|
+
|
|
147
|
+
- id: tool-workflow
|
|
148
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
|
149
|
+
|
|
150
|
+
- id: tool-ralph
|
|
151
|
+
name: '@deepseek-ai/dsh-tool-ralph'
|
|
152
|
+
config:
|
|
153
|
+
subagentProvider: spawn
|
|
154
|
+
maxRounds: 64
|
|
155
|
+
|
|
156
|
+
# orchestrator 工具行:模板 id 由组合名承载(rs-<id> → <id>),释放生成器按组合名写入
|
|
157
|
+
- id: rs-workflow-orchestrator
|
|
158
|
+
name: '@mzzsfy/dsh-rs-workflow'
|
|
159
|
+
config:
|
|
160
|
+
role: orchestrator
|
|
161
|
+
templateId: TPL_ANCHOR
|
|
162
|
+
|
|
163
|
+
# 模板编辑工具行:rs_workflow_template(AI 按口述逻辑生成/修改流程模板)
|
|
164
|
+
- id: rs-workflow-template-tool
|
|
165
|
+
name: '@mzzsfy/dsh-rs-workflow'
|
|
166
|
+
config:
|
|
167
|
+
role: template-tool
|
|
168
|
+
|
|
169
|
+
# ── remaining model-facing rows ─────────────────────────────────────────────
|
|
170
|
+
|
|
171
|
+
- id: tool-ask-user
|
|
172
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
173
|
+
|
|
174
|
+
- id: tool-todo
|
|
175
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
176
|
+
config:
|
|
177
|
+
allowParallelInProgress: true
|