doukui 0.0.0-stage → 0.3.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.
Files changed (137) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +42 -0
  3. package/README.md +147 -2
  4. package/bin/commands/build.js +178 -0
  5. package/bin/commands/config.js +88 -0
  6. package/bin/commands/help.js +83 -0
  7. package/bin/commands/init.js +194 -0
  8. package/bin/commands/install.js +202 -0
  9. package/bin/commands/interactive.js +352 -0
  10. package/bin/commands/list.js +108 -0
  11. package/bin/commands/loop-server.js +357 -0
  12. package/bin/commands/loop.js +1443 -0
  13. package/bin/commands/migrate.js +120 -0
  14. package/bin/commands/setup-global.js +81 -0
  15. package/bin/commands/status.js +140 -0
  16. package/bin/commands/team-cleanup.js +190 -0
  17. package/bin/commands/validate-config.js +35 -0
  18. package/bin/commands/validate.js +21 -0
  19. package/bin/commands/version.js +22 -0
  20. package/bin/context.js +143 -0
  21. package/bin/doukui.js +216 -0
  22. package/package.json +47 -4
  23. package/plugins/contracts/capabilities.js +268 -0
  24. package/plugins/contracts/checkresult-schema.json +75 -0
  25. package/plugins/contracts/config-schema.json +179 -0
  26. package/plugins/contracts/plugin-interface.js +262 -0
  27. package/plugins/contracts/plugin-schema.json +104 -0
  28. package/plugins/core/hook-session-start/index.js +281 -0
  29. package/plugins/core/hook-session-start/plugin.json +7 -0
  30. package/plugins/core/hook-skill-gate/index.js +661 -0
  31. package/plugins/core/hook-skill-gate/plugin.json +12 -0
  32. package/plugins/core/provider-loop-engine/index.js +1411 -0
  33. package/plugins/core/provider-loop-engine/plugin.json +15 -0
  34. package/plugins/core/provider-memory-store/index.js +510 -0
  35. package/plugins/core/provider-memory-store/plugin.json +9 -0
  36. package/plugins/core/provider-role-registry/index.js +376 -0
  37. package/plugins/core/provider-role-registry/plugin.json +9 -0
  38. package/plugins/core/provider-state-store/index.js +244 -0
  39. package/plugins/core/provider-state-store/plugin.json +9 -0
  40. package/plugins/core/provider-watchdog/assets/daemon-config.template.json +32 -0
  41. package/plugins/core/provider-watchdog/assets/lib/watchdog-multi-window.js +676 -0
  42. package/plugins/core/provider-watchdog/assets/watchdog.js +754 -0
  43. package/plugins/core/provider-watchdog/index.js +151 -0
  44. package/plugins/core/provider-watchdog/plugin.json +13 -0
  45. package/plugins/core/skill-agent-dispatcher/cleanup-reference.md +214 -0
  46. package/plugins/core/skill-agent-dispatcher/daemon-helpers-reference.md +249 -0
  47. package/plugins/core/skill-agent-dispatcher/plugin.json +13 -0
  48. package/plugins/core/skill-agent-dispatcher/roles-reference.md +253 -0
  49. package/plugins/core/skill-agent-dispatcher/skill.md +1291 -0
  50. package/plugins/core/skill-agentic-loop/plugin.json +20 -0
  51. package/plugins/core/skill-agentic-loop/skill.md +588 -0
  52. package/plugins/core/skill-batch-task-creator/plugin.json +15 -0
  53. package/plugins/core/skill-batch-task-creator/skill.md +620 -0
  54. package/plugins/core/skill-checklist/plugin.json +10 -0
  55. package/plugins/core/skill-checklist/skill.md +171 -0
  56. package/plugins/core/skill-completion-report/plugin.json +10 -0
  57. package/plugins/core/skill-completion-report/skill.md +331 -0
  58. package/plugins/core/skill-doukui-plan/plugin.json +15 -0
  59. package/plugins/core/skill-doukui-plan/skill.md +233 -0
  60. package/plugins/core/skill-doukui-sync/plugin.json +10 -0
  61. package/plugins/core/skill-doukui-sync/skill.md +76 -0
  62. package/plugins/core/skill-experience-logger/plugin.json +10 -0
  63. package/plugins/core/skill-experience-logger/skill.md +235 -0
  64. package/plugins/core/skill-human-checkpoint/plugin.json +10 -0
  65. package/plugins/core/skill-human-checkpoint/skill.md +194 -0
  66. package/plugins/core/skill-progress-tracker/plugin.json +10 -0
  67. package/plugins/core/skill-progress-tracker/skill.md +228 -0
  68. package/plugins/core/skill-role-manager/plugin.json +10 -0
  69. package/plugins/core/skill-role-manager/skill.md +252 -0
  70. package/plugins/core/skill-split-work-package/plugin.json +15 -0
  71. package/plugins/core/skill-split-work-package/skill.md +441 -0
  72. package/plugins/core/skill-task-archive/plugin.json +10 -0
  73. package/plugins/core/skill-task-archive/skill.md +116 -0
  74. package/plugins/core/skill-task-creator/plugin.json +15 -0
  75. package/plugins/core/skill-task-creator/skill.md +886 -0
  76. package/plugins/core/skill-team-cleanup/plugin.json +10 -0
  77. package/plugins/core/skill-team-cleanup/skill.md +266 -0
  78. package/plugins/core/skill-watchdog-manager/plugin.json +10 -0
  79. package/plugins/core/skill-watchdog-manager/skill.md +143 -0
  80. package/plugins/core/skill-workflow-orchestrator/plugin.json +13 -0
  81. package/plugins/core/skill-workflow-orchestrator/skill.md +273 -0
  82. package/plugins/core/validator-doc-sync/index.js +248 -0
  83. package/plugins/core/validator-doc-sync/plugin.json +12 -0
  84. package/plugins/core/validator-work-package/index.js +300 -0
  85. package/plugins/core/validator-work-package/plugin.json +12 -0
  86. package/plugins/plugin-registry.json +186 -0
  87. package/plugins/runtime/agent-def-generator.js +150 -0
  88. package/plugins/runtime/audit-logger.js +311 -0
  89. package/plugins/runtime/build-cli.js +89 -0
  90. package/plugins/runtime/checkresult-validator.js +131 -0
  91. package/plugins/runtime/claude-md-injector.js +159 -0
  92. package/plugins/runtime/cleanup-utils.js +293 -0
  93. package/plugins/runtime/config-manager.js +317 -0
  94. package/plugins/runtime/config-validator.js +320 -0
  95. package/plugins/runtime/context-window.js +81 -0
  96. package/plugins/runtime/event-bus.js +207 -0
  97. package/plugins/runtime/executor-claude.js +828 -0
  98. package/plugins/runtime/executor-default.js +448 -0
  99. package/plugins/runtime/executor-local.js +178 -0
  100. package/plugins/runtime/executor-sdk.js +415 -0
  101. package/plugins/runtime/harness-build.js +1037 -0
  102. package/plugins/runtime/hook-dispatcher.js +315 -0
  103. package/plugins/runtime/logger.js +192 -0
  104. package/plugins/runtime/loop-actuator.js +292 -0
  105. package/plugins/runtime/loop-coordinator.js +347 -0
  106. package/plugins/runtime/loop-defaults.js +29 -0
  107. package/plugins/runtime/loop-dispatch-batch.js +247 -0
  108. package/plugins/runtime/loop-executor.js +120 -0
  109. package/plugins/runtime/loop-report.js +327 -0
  110. package/plugins/runtime/loop-server-core.js +750 -0
  111. package/plugins/runtime/loop-snapshot.js +581 -0
  112. package/plugins/runtime/loop-trace.js +242 -0
  113. package/plugins/runtime/loop-worktree.js +404 -0
  114. package/plugins/runtime/manifest-resolver.js +457 -0
  115. package/plugins/runtime/multi-window-coordinator.js +560 -0
  116. package/plugins/runtime/objective-verifier.js +136 -0
  117. package/plugins/runtime/plan-lint.js +100 -0
  118. package/plugins/runtime/plan-reader.js +763 -0
  119. package/plugins/runtime/plugin-loader.js +798 -0
  120. package/plugins/runtime/plugin-trust.js +182 -0
  121. package/plugins/runtime/plugin-validator.js +491 -0
  122. package/plugins/runtime/provider-failover.js +114 -0
  123. package/plugins/runtime/provider-resolver.js +342 -0
  124. package/plugins/runtime/reflection-evaluator.js +545 -0
  125. package/plugins/runtime/resolve-plugin-path.js +297 -0
  126. package/plugins/runtime/safe-path.js +119 -0
  127. package/plugins/runtime/sandbox-context.js +235 -0
  128. package/plugins/runtime/sandbox-manager.js +609 -0
  129. package/plugins/runtime/sandbox-worker.js +215 -0
  130. package/plugins/runtime/self-rescue-ladder.js +38 -0
  131. package/plugins/runtime/settings-merger.js +172 -0
  132. package/plugins/runtime/state-store.js +527 -0
  133. package/plugins/runtime/team-cleanup.js +497 -0
  134. package/plugins/runtime/text-tokenize.js +25 -0
  135. package/plugins/runtime/validator-pipeline.js +475 -0
  136. package/plugins/runtime/yaml-parser.js +692 -0
  137. package/templates/harness-config.yaml +394 -0
@@ -0,0 +1,394 @@
1
+ # AI Agent Harness 配置文件
2
+ #
3
+ # 此文件定义了 Doukui 框架的核心配置,包括上下文窗口管理、
4
+ # 工作流定义、角色系统和记忆系统等。
5
+ #
6
+ # 配置优先级(从高到低):
7
+ # 1. 环境变量 (HARNESS_<KEY>)
8
+ # 2. 本配置文件 (harness-config.yaml)
9
+ # 3. 插件默认值
10
+ #
11
+ # 环境变量示例:
12
+ # export HARNESS_CONTEXT_WINDOW_MAX_TOKENS=200000
13
+ # export HARNESS_WORKFLOW__DEFAULT__NAME="自定义工作流"
14
+ # 注意:嵌套键使用双下划线分隔
15
+
16
+ # ---------------------------------------------------------------------------
17
+ # 上下文窗口配置
18
+ # 控制任务创建技能在分析大文件时的分块读取行为
19
+ #
20
+ # 分档机制(Phase B-2):loop 运行时会按 provider 自动解析窗口预算并注入
21
+ # executor prompt(日志 context: window=... tokens):
22
+ # 1. loop.providers 各 profile 的 context_window_tokens(显式声明,最高优先)
23
+ # 2. 内置档位表(plugins/runtime/context-window.js TIERS,如 deepseek-v4 → 1M)
24
+ # 3. 保守默认 200000
25
+ # 本段的 max_tokens 是「构建期静态默认」(skill 文本分块策略用);loop 运行时
26
+ # 以分档结果为准。若所用 provider 窗口与默认不符,在对应 profile 显式声明。
27
+ # ---------------------------------------------------------------------------
28
+ context_window:
29
+ # 模型上下文窗口大小(token 数近似值)
30
+ # 不同模型的上下文窗口大小不同,根据使用的模型调整
31
+ max_tokens: 200000
32
+
33
+ # 为指令和输出预留的 token 数,防止上下文溢出
34
+ # 建议设置为 max_tokens 的 15-20%
35
+ safety_margin: 40000
36
+
37
+ # 分块读取时每次 Read 调用的最大行数
38
+ # 当文件超过 medium 阈值时,会按此值分块读取
39
+ chunk_lines: 500
40
+
41
+ # 溢出处理策略
42
+ # - auto: 根据文件类型和大小自动选择策略
43
+ # - greedy: 尽可能多地读取内容
44
+ # - conservative: 优先使用 Grep 扫描,减少读取量
45
+ strategy: "auto"
46
+
47
+ # 文件大小阈值(行数),决定读取策略
48
+ thresholds:
49
+ # 小文件阈值:≤ 此值直接读取全文
50
+ small: 200
51
+
52
+ # 中文件阈值:200-此值之间分块读取
53
+ medium: 800
54
+
55
+ # 大文件阈值:超过此值优先 Grep 扫描,定向读取
56
+ large: 2000
57
+
58
+ # ---------------------------------------------------------------------------
59
+ # 工作流配置
60
+ # 定义 AI Agent 的执行流程和阶段
61
+ # ---------------------------------------------------------------------------
62
+ workflow:
63
+ # 默认工作流
64
+ default:
65
+ name: "标准开发工作流"
66
+ description: "从需求到实现的完整开发流程"
67
+
68
+ # 工作流阶段定义
69
+ stages:
70
+ # 需求分析阶段
71
+ - id: "planning"
72
+ name: "需求分析与规划"
73
+ description: "理解需求,制定实现计划"
74
+ skills: ["task-creator", "split-work-package"]
75
+ auto_advance: false
76
+ checkpoint: true
77
+
78
+ # 审核阶段
79
+ - id: "review"
80
+ name: "计划审核"
81
+ description: "人工审核计划,确认实现方案"
82
+ skills: ["human-checkpoint"]
83
+ auto_advance: false
84
+ checkpoint: true
85
+
86
+ # 执行阶段
87
+ - id: "implementation"
88
+ name: "任务执行"
89
+ description: "按照计划实现功能"
90
+ skills: ["agent-dispatcher"]
91
+ auto_advance: false
92
+ checkpoint: false
93
+
94
+ # 检查阶段
95
+ - id: "verification"
96
+ name: "质量检查"
97
+ description: "验证实现结果,检查验收标准"
98
+ skills: ["checklist", "experience-logger"]
99
+ auto_advance: false
100
+ checkpoint: true
101
+
102
+ # 汇报阶段
103
+ - id: "report"
104
+ name: "完成汇报"
105
+ description: "生成完成报告,总结工作成果"
106
+ skills: ["completion-report"]
107
+ auto_advance: false
108
+ checkpoint: false
109
+
110
+ # 阶段转换规则
111
+ transitions:
112
+ - from: "planning"
113
+ to: "review"
114
+ condition: "plan_complete"
115
+
116
+ - from: "review"
117
+ to: "implementation"
118
+ condition: "plan_approved"
119
+
120
+ - from: "implementation"
121
+ to: "verification"
122
+ condition: "implementation_complete"
123
+
124
+ - from: "verification"
125
+ to: "report"
126
+ condition: "verification_passed"
127
+
128
+ # ---------------------------------------------------------------------------
129
+ # 角色系统配置
130
+ # 定义 AI Agent 角色体系和默认角色
131
+ # ---------------------------------------------------------------------------
132
+ roles:
133
+ # 角色定义文件目录
134
+ roles_dir: ".claude/agents/roles"
135
+
136
+ # 角色注册表文件
137
+ registry_file: ".claude/agents/role-registry.yaml"
138
+
139
+ # 默认角色映射
140
+ defaults:
141
+ # 默认规划者角色
142
+ planner: "planner"
143
+
144
+ # 默认实现者角色
145
+ implementer: "implementer"
146
+
147
+ # 默认审查者角色
148
+ reviewer: "reviewer"
149
+
150
+ # 默认测试者角色
151
+ tester: "tester"
152
+
153
+ # 角色能力矩阵
154
+ capabilities:
155
+ # 规划能力角色
156
+ planning:
157
+ - "architect"
158
+ - "planner"
159
+
160
+ # 实现能力角色
161
+ implementation:
162
+ - "coder"
163
+ - "implementer"
164
+
165
+ # 审查能力角色
166
+ review:
167
+ - "reviewer"
168
+ - "inspector"
169
+
170
+ # ---------------------------------------------------------------------------
171
+ # 记忆系统配置
172
+ # 控制 AI Agent 的知识存储和检索
173
+ # ---------------------------------------------------------------------------
174
+ memory:
175
+ # 记忆存储目录
176
+ storage_dir: ".claude/agents/memories"
177
+
178
+ # 记忆文件格式
179
+ # - yaml: YAML 格式,易读易编辑
180
+ # - json: JSON 格式,便于程序处理
181
+ format: "yaml"
182
+
183
+ # 自动提取配置
184
+ auto_extraction:
185
+ # 是否启用自动记忆提取
186
+ enabled: true
187
+
188
+ # 触发关键词列表
189
+ # 当对话中包含这些关键词时,自动触发记忆提取
190
+ trigger_keywords:
191
+ - "记住"
192
+ - "学习到"
193
+ - "经验"
194
+ - "模式"
195
+ - "解决方案"
196
+
197
+ # 最小置信度阈值
198
+ # 当记忆提取的置信度低于此值时,需要人工确认
199
+ min_confidence: 0.7
200
+
201
+ # 记忆类型定义
202
+ types:
203
+ # 用户记忆
204
+ user:
205
+ enabled: true
206
+ max_entries: 100
207
+
208
+ # 项目记忆
209
+ project:
210
+ enabled: true
211
+ max_entries: 500
212
+
213
+ # 反馈记忆
214
+ feedback:
215
+ enabled: true
216
+ max_entries: 200
217
+
218
+ # 参考记忆
219
+ reference:
220
+ enabled: true
221
+ max_entries: 100
222
+
223
+ # ---------------------------------------------------------------------------
224
+ # Agentic Loop executor / provider 解析配置
225
+ # 控制 `doukui loop --executor=default` 的模型探测与 provider 特性门控。
226
+ #
227
+ # provider-resolver 解析"当前生效模型"的优先级:
228
+ # 1. --settings 文件的 model 字段
229
+ # 2. --settings 文件的 env.ANTHROPIC_DEFAULT_SONNET_MODEL(fallback OPUS/HAIKU)
230
+ # 3. 进程环境变量 ANTHROPIC_MODEL / ANTHROPIC_DEFAULT_SONNET_MODEL
231
+ # 都拿不到 → provider=unknown(纯透传,不启用任何特性)。
232
+ #
233
+ # 匹配规则:按 providers 声明顺序,第一个 modelRegex 命中的胜出。
234
+ # baseUrlRegex(可选)做二次确认:若 --settings 文件携带了 ANTHROPIC_BASE_URL,
235
+ # 且该 URL 不匹配 baseUrlRegex,则视为模型名撞车,跳过该 profile 继续找下一个。
236
+ #
237
+ # quota 段(可选):启用智谱式 5h 滚动窗口额度感知 + 高峰系数。
238
+ # 只有需要本地计量的 provider(如智谱 GLM Coding Plan)才配;mimo/deepseek 等不配。
239
+ # 接近 softThreshold 时 default executor 降速返回 quota_exhausted(不 sleep,
240
+ # 交由 driver 发散检测兜底)。额度状态进程内存,不跨 loop 共享(跨 loop 归 loop-server)。
241
+ #
242
+ # 注意:此处配置仅作用于 default executor 的本地额度感知;loop-server coordinator
243
+ # 有独立的 per-provider 额度池配置(loop-server-core.js),两者解耦。
244
+ # ---------------------------------------------------------------------------
245
+ loop:
246
+ # WP-S1 终态前自救链:diverged/timeout 判定后不直接停人,先穷尽自救梯子:
247
+ # ① switch_provider(需当前 provider profile 的 fallback_settings,复用 WP-D3)
248
+ # ② switch_model(需下方 model_fallback 指定备用模型档,同 provider 换模型重试)
249
+ # 每级至多一次、每 loop 至多 max_switches 次;穷尽后才真停(终态报告标注已试级别)。
250
+ # 自救默认开(北极星:高自主少介入);完全关闭设 enabled: false。
251
+ self_rescue:
252
+ enabled: true
253
+ max_switches: 2
254
+ # model_fallback: "glm-4.6-air" # 换模型自救的备用模型档(走当前 provider 端点)
255
+ extra_iterations: 3 # timeout 自救每次追加的迭代预算
256
+ # extra_wall_ms: 1800000 # timeout 自救每次追加的墙钟(默认 30min)
257
+
258
+ # v0.3.1 T2 系统提示瘦身(仅 --executor=sdk 生效):
259
+ # lean = 自定义精简系统提示替换 SDK 默认大提示(实测每轮 input 结构性大头),
260
+ # 保留 CLAUDE.md/skills 注入与端点配置——省 token 显著但需自行验证任务质量;
261
+ # default = SDK 全量注入(v0.3.0 行为,安全默认)。
262
+ # system_prompt_mode: lean
263
+
264
+ # concurrent-dispatch Step 1:readyWave 并发批调度度。
265
+ # WP-198①:默认并发 2(去默认限速,所有 provider 一视同仁——不再因 GLM 降速)。
266
+ # 优先级:--concurrency flag > 此值 > 2(默认)。N=1 显式串行回退。
267
+ # N>1 时批内额度检查-消耗间隙放大,由 executor softThreshold(0.9) + coordinator
268
+ # hardThreshold(0.95) 兜底;若需限速可设 concurrency:1 或 --concurrency=1。
269
+ #
270
+ # concurrent-dispatch Step 2(per-WP git worktree 隔离,v0.4.1):N>1 + default executor
271
+ # 时,批内每 WP 建独立 git worktree(.doukui/wt-{loopId}-{wpId}),executor 在各自 cwd 跑,
272
+ # readWorktreeDirty per-WP 准确、互不串扰(修复 v0.4.0 noProgress 批级串扰)。
273
+ # 批后逐个 cherry-pick 回主分支(策略 A),冲突不阻断(engine retry/resplit 兜底)。
274
+ # WP-198①:worktree 与 state isolated 解耦——N>1 即开,无需 --loop-id(无 --loop-id 时
275
+ # worktree 落 projectRoot/.doukui/,.gitignore 已覆盖)。N=1 / local / 非 git → 跳过。
276
+ # concurrency: 1 # 默认注释掉 → 走 loop.js fallback=2(WP-198① 默认并发);取消注释可显式覆盖(如 1 限速)
277
+ # no_progress_detect(concurrent-dispatch Step 2 escape hatch,文档 §5.5):N>1 时强制
278
+ # noProgress 归零不累计发散(牺牲 per-WP 进展归因精度换稳定性)。worktree 降级时的兜底。
279
+ # --no-progress-detect flag 优先于此值;默认 false(启用 worktree 隔离时无需开)。
280
+ no_progress_detect: false
281
+ providers:
282
+ # 智谱 GLM(享 Coding Plan 套餐额度,走 claude CLI 中转合规)
283
+ - key: glm
284
+ # 匹配 GLM-5.x 系列 + 4.6/4.7/4.5-air(套餐内可用模型)
285
+ modelRegex: "^glm[-_]?5(?!\d)|^glm[-_]?(4\.[67]|4\.5-air)"
286
+ # 智谱 Anthropic 兼容端点(防 mimo/deepseek 等同名模型撞车)
287
+ baseUrlRegex: "open\.bigmodel\.cn"
288
+ quota:
289
+ windowPrompts: 400 # 5h 窗口 prompts 软上限(Pro 档基准)
290
+ weeklyPrompts: 2000 # 周 prompts 软上限
291
+ softThreshold: 0.9 # 达到 quota*threshold 开始降速
292
+ peakStartHour: 14 # 高峰起(UTC+8 小时)
293
+ peakEndHour: 18 # 高峰止(UTC+8 小时)
294
+ peakCostFactor: 3 # 高峰时段 GLM-5.x 消耗系数
295
+ offpeakCostFactor: 2 # 非高峰 GLM-5.x 消耗系数
296
+ costModelRegex: "^glm[-_]?5(?!\d)" # 仅 5.x 受高峰系数;4.6 等按 1x
297
+ # WP-D3 跨 provider 故障切换:窗口占用 ≥ 0.95 时 driver 自动切换到该 settings
298
+ # 继续跑(default 载体;每 loop 至多切换一次;SDK session 作废)。取消注释启用。
299
+ # fallback_settings: "~/.claude/settings-deepseek.json"
300
+
301
+ # 小米 MiMo(无套餐额度约束,纯透传)
302
+ - key: mimo
303
+ modelRegex: "^mimo"
304
+
305
+ # DeepSeek(无套餐额度约束,纯透传)
306
+ - key: deepseek
307
+ modelRegex: "^deepseek"
308
+ # DeepSeek V4-Pro 官方 1M 窗口(内置档位表已覆盖,此处显式声明为示例——
309
+ # 旧模型 V3 等如需按 128K 计,可另建 profile 或删除此行走档位表/默认)
310
+ context_window_tokens: 1000000
311
+
312
+ # ---------------------------------------------------------------------------
313
+ # MCP 协议配置
314
+ # 定义 Model Context Protocol 服务器配置
315
+ # ---------------------------------------------------------------------------
316
+ mcp:
317
+ # MCP 配置文件目录
318
+ config_dir: ".claude/mcp/servers"
319
+
320
+ # MCP 服务器列表
321
+ servers:
322
+ # 示例:文件系统服务器
323
+ - name: "filesystem"
324
+ type: "stdio"
325
+ enabled: false
326
+ command: "npx"
327
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
328
+
329
+ # 示例:GitHub 服务器
330
+ - name: "github"
331
+ type: "stdio"
332
+ enabled: false
333
+ command: "npx"
334
+ args: ["-y", "@modelcontextprotocol/server-github"]
335
+ env:
336
+ GITHUB_TOKEN: "${GITHUB_TOKEN}"
337
+
338
+ # ---------------------------------------------------------------------------
339
+ # 中间件配置
340
+ # 定义请求处理中间件链
341
+ # ---------------------------------------------------------------------------
342
+ middleware:
343
+ # 中间件执行顺序
344
+ chain:
345
+ - "validator"
346
+ - "logger"
347
+ - "rate-limiter"
348
+
349
+ # 中间件配置
350
+ config:
351
+ # 验证器配置
352
+ validator:
353
+ enabled: true
354
+ strict: false
355
+
356
+ # 日志配置
357
+ logger:
358
+ enabled: true
359
+ level: "info"
360
+ file: ".claude/logs/harness.log"
361
+
362
+ # 限流器配置
363
+ rate-limiter:
364
+ enabled: false
365
+ max_requests: 100
366
+ window_ms: 60000
367
+
368
+ # ---------------------------------------------------------------------------
369
+ # Agent Dispatcher 配置
370
+ # 控制子代理批量任务调度的并发数量
371
+ # ---------------------------------------------------------------------------
372
+ agent_dispatcher:
373
+ concurrency:
374
+ # 默认最大并发数(未匹配任何 schedule 时使用)
375
+ default_max: 6
376
+
377
+ # 时间段调度列表(按顺序匹配第一个命中的)
378
+ schedules:
379
+ # 高峰时段:限制并发数避免资源争抢
380
+ - name: "peak"
381
+ time_range:
382
+ start: "14:00"
383
+ end: "18:00"
384
+ max_concurrent: 3
385
+
386
+ # ---------------------------------------------------------------------------
387
+ # 插件配置覆盖
388
+ # 为特定插件提供自定义配置
389
+ # ---------------------------------------------------------------------------
390
+ overrides:
391
+ # 示例:覆盖特定插件的配置
392
+ # task-creator:
393
+ # max_complexity: 10
394
+ # auto_split: true