harness-engineering-agent 0.1.1 → 0.1.3

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 (338) hide show
  1. package/README.md +21 -7
  2. package/dist/config/config-defaults.d.ts +0 -0
  3. package/dist/config/config-defaults.d.ts.map +0 -0
  4. package/dist/config/config-defaults.js +0 -0
  5. package/dist/config/config-defaults.js.map +0 -0
  6. package/dist/config/config-errors.d.ts +0 -0
  7. package/dist/config/config-errors.d.ts.map +0 -0
  8. package/dist/config/config-errors.js +0 -0
  9. package/dist/config/config-errors.js.map +0 -0
  10. package/dist/config/config-file.d.ts +0 -0
  11. package/dist/config/config-file.d.ts.map +0 -0
  12. package/dist/config/config-file.js +0 -0
  13. package/dist/config/config-file.js.map +0 -0
  14. package/dist/config/config-merge.d.ts +0 -0
  15. package/dist/config/config-merge.d.ts.map +0 -0
  16. package/dist/config/config-merge.js +0 -0
  17. package/dist/config/config-merge.js.map +0 -0
  18. package/dist/config/config-schema.d.ts +0 -0
  19. package/dist/config/config-schema.d.ts.map +0 -0
  20. package/dist/config/config-schema.js +0 -0
  21. package/dist/config/config-schema.js.map +0 -0
  22. package/dist/config/config-types.d.ts +0 -0
  23. package/dist/config/config-types.d.ts.map +0 -0
  24. package/dist/config/config-types.js +0 -0
  25. package/dist/config/config-types.js.map +0 -0
  26. package/dist/config/harness-config.d.ts +0 -0
  27. package/dist/config/harness-config.d.ts.map +0 -0
  28. package/dist/config/harness-config.js +0 -0
  29. package/dist/config/harness-config.js.map +0 -0
  30. package/dist/config/index.d.ts +0 -0
  31. package/dist/config/index.d.ts.map +0 -0
  32. package/dist/config/index.js +0 -0
  33. package/dist/config/index.js.map +0 -0
  34. package/dist/config/load-harness-config.d.ts +0 -0
  35. package/dist/config/load-harness-config.d.ts.map +0 -0
  36. package/dist/config/load-harness-config.js +0 -0
  37. package/dist/config/load-harness-config.js.map +0 -0
  38. package/dist/controller/agent-output.d.ts +0 -0
  39. package/dist/controller/agent-output.d.ts.map +0 -0
  40. package/dist/controller/agent-output.js +0 -0
  41. package/dist/controller/agent-output.js.map +0 -0
  42. package/dist/controller/agent-session.d.ts +0 -0
  43. package/dist/controller/agent-session.d.ts.map +0 -0
  44. package/dist/controller/agent-session.js +0 -0
  45. package/dist/controller/agent-session.js.map +0 -0
  46. package/dist/controller/contracts.d.ts +0 -0
  47. package/dist/controller/contracts.d.ts.map +0 -0
  48. package/dist/controller/contracts.js +0 -0
  49. package/dist/controller/contracts.js.map +0 -0
  50. package/dist/controller/errors.d.ts +0 -0
  51. package/dist/controller/errors.d.ts.map +0 -0
  52. package/dist/controller/errors.js +0 -0
  53. package/dist/controller/errors.js.map +0 -0
  54. package/dist/controller/evidence-factory.d.ts +0 -0
  55. package/dist/controller/evidence-factory.d.ts.map +0 -0
  56. package/dist/controller/evidence-factory.js +0 -0
  57. package/dist/controller/evidence-factory.js.map +0 -0
  58. package/dist/controller/failure-analysis.d.ts +0 -0
  59. package/dist/controller/failure-analysis.d.ts.map +0 -0
  60. package/dist/controller/failure-analysis.js +0 -0
  61. package/dist/controller/failure-analysis.js.map +0 -0
  62. package/dist/controller/failure-factory.d.ts +0 -0
  63. package/dist/controller/failure-factory.d.ts.map +0 -0
  64. package/dist/controller/failure-factory.js +0 -0
  65. package/dist/controller/failure-factory.js.map +0 -0
  66. package/dist/controller/graph-validator.d.ts +0 -0
  67. package/dist/controller/graph-validator.d.ts.map +0 -0
  68. package/dist/controller/graph-validator.js +0 -0
  69. package/dist/controller/graph-validator.js.map +0 -0
  70. package/dist/controller/index.d.ts +0 -0
  71. package/dist/controller/index.d.ts.map +0 -0
  72. package/dist/controller/index.js +0 -0
  73. package/dist/controller/index.js.map +0 -0
  74. package/dist/controller/repair-loop.d.ts +0 -0
  75. package/dist/controller/repair-loop.d.ts.map +0 -0
  76. package/dist/controller/repair-loop.js +0 -0
  77. package/dist/controller/repair-loop.js.map +0 -0
  78. package/dist/controller/report-factory.d.ts +0 -0
  79. package/dist/controller/report-factory.d.ts.map +0 -0
  80. package/dist/controller/report-factory.js +0 -0
  81. package/dist/controller/report-factory.js.map +0 -0
  82. package/dist/controller/role-prompts.d.ts +0 -0
  83. package/dist/controller/role-prompts.d.ts.map +0 -0
  84. package/dist/controller/role-prompts.js +0 -0
  85. package/dist/controller/role-prompts.js.map +0 -0
  86. package/dist/controller/run-controller.d.ts +0 -0
  87. package/dist/controller/run-controller.d.ts.map +0 -0
  88. package/dist/controller/run-controller.js +0 -0
  89. package/dist/controller/run-controller.js.map +0 -0
  90. package/dist/controller/run-persistence.d.ts +0 -0
  91. package/dist/controller/run-persistence.d.ts.map +0 -0
  92. package/dist/controller/run-persistence.js +0 -0
  93. package/dist/controller/run-persistence.js.map +0 -0
  94. package/dist/controller/run-state.d.ts +0 -0
  95. package/dist/controller/run-state.d.ts.map +0 -0
  96. package/dist/controller/run-state.js +0 -0
  97. package/dist/controller/run-state.js.map +0 -0
  98. package/dist/controller/task-agent-output.d.ts +0 -0
  99. package/dist/controller/task-agent-output.d.ts.map +0 -0
  100. package/dist/controller/task-agent-output.js +0 -0
  101. package/dist/controller/task-agent-output.js.map +0 -0
  102. package/dist/controller/task-agent-schemas.d.ts +0 -0
  103. package/dist/controller/task-agent-schemas.d.ts.map +0 -0
  104. package/dist/controller/task-agent-schemas.js +0 -0
  105. package/dist/controller/task-agent-schemas.js.map +0 -0
  106. package/dist/controller/task-executor.d.ts +0 -0
  107. package/dist/controller/task-executor.d.ts.map +0 -0
  108. package/dist/controller/task-executor.js +0 -0
  109. package/dist/controller/task-executor.js.map +0 -0
  110. package/dist/controller/task-paths.d.ts +0 -0
  111. package/dist/controller/task-paths.d.ts.map +0 -0
  112. package/dist/controller/task-paths.js +0 -0
  113. package/dist/controller/task-paths.js.map +0 -0
  114. package/dist/controller/task-retry.d.ts +0 -0
  115. package/dist/controller/task-retry.d.ts.map +0 -0
  116. package/dist/controller/task-retry.js +0 -0
  117. package/dist/controller/task-retry.js.map +0 -0
  118. package/dist/controller/worktree-eligibility.d.ts +0 -0
  119. package/dist/controller/worktree-eligibility.d.ts.map +0 -0
  120. package/dist/controller/worktree-eligibility.js +0 -0
  121. package/dist/controller/worktree-eligibility.js.map +0 -0
  122. package/dist/controller/worktree-scheduler.d.ts +0 -0
  123. package/dist/controller/worktree-scheduler.d.ts.map +0 -0
  124. package/dist/controller/worktree-scheduler.js +0 -0
  125. package/dist/controller/worktree-scheduler.js.map +0 -0
  126. package/dist/domain/agent-result.d.ts +0 -0
  127. package/dist/domain/agent-result.d.ts.map +0 -0
  128. package/dist/domain/agent-result.js +0 -0
  129. package/dist/domain/agent-result.js.map +0 -0
  130. package/dist/domain/evidence.d.ts +0 -0
  131. package/dist/domain/evidence.d.ts.map +0 -0
  132. package/dist/domain/evidence.js +0 -0
  133. package/dist/domain/evidence.js.map +0 -0
  134. package/dist/domain/failure.d.ts +0 -0
  135. package/dist/domain/failure.d.ts.map +0 -0
  136. package/dist/domain/failure.js +0 -0
  137. package/dist/domain/failure.js.map +0 -0
  138. package/dist/domain/index.d.ts +0 -0
  139. package/dist/domain/index.d.ts.map +0 -0
  140. package/dist/domain/index.js +0 -0
  141. package/dist/domain/index.js.map +0 -0
  142. package/dist/domain/report.d.ts +0 -0
  143. package/dist/domain/report.d.ts.map +0 -0
  144. package/dist/domain/report.js +0 -0
  145. package/dist/domain/report.js.map +0 -0
  146. package/dist/domain/requirement.d.ts +0 -0
  147. package/dist/domain/requirement.d.ts.map +0 -0
  148. package/dist/domain/requirement.js +0 -0
  149. package/dist/domain/requirement.js.map +0 -0
  150. package/dist/domain/run.d.ts +0 -0
  151. package/dist/domain/run.d.ts.map +0 -0
  152. package/dist/domain/run.js +0 -0
  153. package/dist/domain/run.js.map +0 -0
  154. package/dist/domain/shared.d.ts +0 -0
  155. package/dist/domain/shared.d.ts.map +0 -0
  156. package/dist/domain/shared.js +0 -0
  157. package/dist/domain/shared.js.map +0 -0
  158. package/dist/domain/task.d.ts +0 -0
  159. package/dist/domain/task.d.ts.map +0 -0
  160. package/dist/domain/task.js +0 -0
  161. package/dist/domain/task.js.map +0 -0
  162. package/dist/index.d.ts +0 -0
  163. package/dist/index.d.ts.map +0 -0
  164. package/dist/index.js +0 -0
  165. package/dist/index.js.map +0 -0
  166. package/dist/mcp/cli.d.ts +3 -0
  167. package/dist/mcp/cli.d.ts.map +1 -0
  168. package/dist/mcp/cli.js +17 -0
  169. package/dist/mcp/cli.js.map +1 -0
  170. package/dist/mcp/server.d.ts +6 -0
  171. package/dist/mcp/server.d.ts.map +1 -0
  172. package/dist/mcp/server.js +24 -0
  173. package/dist/mcp/server.js.map +1 -0
  174. package/dist/path/workspace-path.d.ts +0 -0
  175. package/dist/path/workspace-path.d.ts.map +0 -0
  176. package/dist/path/workspace-path.js +0 -0
  177. package/dist/path/workspace-path.js.map +0 -0
  178. package/dist/plugin/create-harness-plugin.d.ts +0 -0
  179. package/dist/plugin/create-harness-plugin.d.ts.map +1 -1
  180. package/dist/plugin/create-harness-plugin.js +1 -16
  181. package/dist/plugin/create-harness-plugin.js.map +1 -1
  182. package/dist/plugin/harness-agent-config.d.ts +0 -0
  183. package/dist/plugin/harness-agent-config.d.ts.map +0 -0
  184. package/dist/plugin/harness-agent-config.js +2 -2
  185. package/dist/plugin/harness-agent-config.js.map +1 -1
  186. package/dist/plugin/harness-chat-hook.d.ts +0 -0
  187. package/dist/plugin/harness-chat-hook.d.ts.map +0 -0
  188. package/dist/plugin/harness-chat-hook.js +0 -0
  189. package/dist/plugin/harness-chat-hook.js.map +0 -0
  190. package/dist/plugin/harness-chat-parts.d.ts +0 -0
  191. package/dist/plugin/harness-chat-parts.d.ts.map +0 -0
  192. package/dist/plugin/harness-chat-parts.js +0 -0
  193. package/dist/plugin/harness-chat-parts.js.map +0 -0
  194. package/dist/plugin/harness-chat-protocol.d.ts +0 -0
  195. package/dist/plugin/harness-chat-protocol.d.ts.map +0 -0
  196. package/dist/plugin/harness-chat-protocol.js +0 -0
  197. package/dist/plugin/harness-chat-protocol.js.map +0 -0
  198. package/dist/plugin/harness-coordinator.d.ts +0 -0
  199. package/dist/plugin/harness-coordinator.d.ts.map +0 -0
  200. package/dist/plugin/harness-coordinator.js +0 -0
  201. package/dist/plugin/harness-coordinator.js.map +0 -0
  202. package/dist/plugin/harness-intake-prompt.d.ts +0 -0
  203. package/dist/plugin/harness-intake-prompt.d.ts.map +0 -0
  204. package/dist/plugin/harness-intake-prompt.js +0 -0
  205. package/dist/plugin/harness-intake-prompt.js.map +0 -0
  206. package/dist/plugin/harness-intent.d.ts +0 -0
  207. package/dist/plugin/harness-intent.d.ts.map +0 -0
  208. package/dist/plugin/harness-intent.js +0 -0
  209. package/dist/plugin/harness-intent.js.map +0 -0
  210. package/dist/plugin/harness-parent-session-dispatcher.d.ts +0 -0
  211. package/dist/plugin/harness-parent-session-dispatcher.d.ts.map +0 -0
  212. package/dist/plugin/harness-parent-session-dispatcher.js +0 -0
  213. package/dist/plugin/harness-parent-session-dispatcher.js.map +0 -0
  214. package/dist/plugin/harness-requirement.d.ts +0 -0
  215. package/dist/plugin/harness-requirement.d.ts.map +0 -0
  216. package/dist/plugin/harness-requirement.js +0 -0
  217. package/dist/plugin/harness-requirement.js.map +0 -0
  218. package/dist/server.d.ts +7 -0
  219. package/dist/server.d.ts.map +1 -0
  220. package/dist/server.js +9 -0
  221. package/dist/server.js.map +1 -0
  222. package/dist/session/contracts.d.ts +0 -0
  223. package/dist/session/contracts.d.ts.map +0 -0
  224. package/dist/session/contracts.js +0 -0
  225. package/dist/session/contracts.js.map +0 -0
  226. package/dist/session/fake-session-adapter.d.ts +0 -0
  227. package/dist/session/fake-session-adapter.d.ts.map +0 -0
  228. package/dist/session/fake-session-adapter.js +0 -0
  229. package/dist/session/fake-session-adapter.js.map +0 -0
  230. package/dist/session/fake-session-errors.d.ts +0 -0
  231. package/dist/session/fake-session-errors.d.ts.map +0 -0
  232. package/dist/session/fake-session-errors.js +0 -0
  233. package/dist/session/fake-session-errors.js.map +0 -0
  234. package/dist/session/harness-agent-names.d.ts +0 -0
  235. package/dist/session/harness-agent-names.d.ts.map +0 -0
  236. package/dist/session/harness-agent-names.js +0 -0
  237. package/dist/session/harness-agent-names.js.map +0 -0
  238. package/dist/session/index.d.ts +0 -0
  239. package/dist/session/index.d.ts.map +0 -0
  240. package/dist/session/index.js +0 -0
  241. package/dist/session/index.js.map +0 -0
  242. package/dist/session/opencode-session-adapter.d.ts +0 -0
  243. package/dist/session/opencode-session-adapter.d.ts.map +0 -0
  244. package/dist/session/opencode-session-adapter.js +0 -0
  245. package/dist/session/opencode-session-adapter.js.map +0 -0
  246. package/dist/session/opencode-session-client.d.ts +0 -0
  247. package/dist/session/opencode-session-client.d.ts.map +0 -0
  248. package/dist/session/opencode-session-client.js +0 -0
  249. package/dist/session/opencode-session-client.js.map +0 -0
  250. package/dist/session/opencode-session-errors.d.ts +0 -0
  251. package/dist/session/opencode-session-errors.d.ts.map +0 -0
  252. package/dist/session/opencode-session-errors.js +0 -0
  253. package/dist/session/opencode-session-errors.js.map +0 -0
  254. package/dist/session/opencode-session-prompts.d.ts +0 -0
  255. package/dist/session/opencode-session-prompts.d.ts.map +0 -0
  256. package/dist/session/opencode-session-prompts.js +0 -0
  257. package/dist/session/opencode-session-prompts.js.map +0 -0
  258. package/dist/store/filesystem-run-store-io.d.ts +0 -0
  259. package/dist/store/filesystem-run-store-io.d.ts.map +0 -0
  260. package/dist/store/filesystem-run-store-io.js +0 -0
  261. package/dist/store/filesystem-run-store-io.js.map +0 -0
  262. package/dist/store/filesystem-run-store.d.ts +0 -0
  263. package/dist/store/filesystem-run-store.d.ts.map +0 -0
  264. package/dist/store/filesystem-run-store.js +0 -0
  265. package/dist/store/filesystem-run-store.js.map +0 -0
  266. package/dist/store/index.d.ts +0 -0
  267. package/dist/store/index.d.ts.map +0 -0
  268. package/dist/store/index.js +0 -0
  269. package/dist/store/index.js.map +0 -0
  270. package/dist/store/run-event.d.ts +0 -0
  271. package/dist/store/run-event.d.ts.map +0 -0
  272. package/dist/store/run-event.js +0 -0
  273. package/dist/store/run-event.js.map +0 -0
  274. package/dist/store/run-store-errors.d.ts +0 -0
  275. package/dist/store/run-store-errors.d.ts.map +0 -0
  276. package/dist/store/run-store-errors.js +0 -0
  277. package/dist/store/run-store-errors.js.map +0 -0
  278. package/dist/tools/context7-client.d.ts +0 -0
  279. package/dist/tools/context7-client.d.ts.map +0 -0
  280. package/dist/tools/context7-client.js +0 -0
  281. package/dist/tools/context7-client.js.map +0 -0
  282. package/dist/tools/grep-app-client.d.ts +0 -0
  283. package/dist/tools/grep-app-client.d.ts.map +0 -0
  284. package/dist/tools/grep-app-client.js +0 -0
  285. package/dist/tools/grep-app-client.js.map +0 -0
  286. package/dist/tools/harness-research-tools.d.ts +3 -13
  287. package/dist/tools/harness-research-tools.d.ts.map +1 -1
  288. package/dist/tools/harness-research-tools.js +75 -80
  289. package/dist/tools/harness-research-tools.js.map +1 -1
  290. package/dist/tools/lsp-client.d.ts +0 -0
  291. package/dist/tools/lsp-client.d.ts.map +0 -0
  292. package/dist/tools/lsp-client.js +0 -0
  293. package/dist/tools/lsp-client.js.map +0 -0
  294. package/dist/tools/lsp-json-rpc.d.ts +0 -0
  295. package/dist/tools/lsp-json-rpc.d.ts.map +0 -0
  296. package/dist/tools/lsp-json-rpc.js +0 -0
  297. package/dist/tools/lsp-json-rpc.js.map +0 -0
  298. package/dist/verification/command-policy.d.ts +0 -0
  299. package/dist/verification/command-policy.d.ts.map +0 -0
  300. package/dist/verification/command-policy.js +0 -0
  301. package/dist/verification/command-policy.js.map +0 -0
  302. package/dist/verification/contracts.d.ts +0 -0
  303. package/dist/verification/contracts.d.ts.map +0 -0
  304. package/dist/verification/contracts.js +0 -0
  305. package/dist/verification/contracts.js.map +0 -0
  306. package/dist/verification/fake-process-runner.d.ts +0 -0
  307. package/dist/verification/fake-process-runner.d.ts.map +0 -0
  308. package/dist/verification/fake-process-runner.js +0 -0
  309. package/dist/verification/fake-process-runner.js.map +0 -0
  310. package/dist/verification/index.d.ts +0 -0
  311. package/dist/verification/index.d.ts.map +0 -0
  312. package/dist/verification/index.js +0 -0
  313. package/dist/verification/index.js.map +0 -0
  314. package/dist/verification/node-process-runner.d.ts +0 -0
  315. package/dist/verification/node-process-runner.d.ts.map +0 -0
  316. package/dist/verification/node-process-runner.js +0 -0
  317. package/dist/verification/node-process-runner.js.map +0 -0
  318. package/dist/verification/verification-runner.d.ts +0 -0
  319. package/dist/verification/verification-runner.d.ts.map +0 -0
  320. package/dist/verification/verification-runner.js +0 -0
  321. package/dist/verification/verification-runner.js.map +0 -0
  322. package/dist/workspace/git-baseline.d.ts +0 -0
  323. package/dist/workspace/git-baseline.d.ts.map +0 -0
  324. package/dist/workspace/git-baseline.js +0 -0
  325. package/dist/workspace/git-baseline.js.map +0 -0
  326. package/dist/workspace/git-workspace-adapter.d.ts +0 -0
  327. package/dist/workspace/git-workspace-adapter.d.ts.map +0 -0
  328. package/dist/workspace/git-workspace-adapter.js +0 -0
  329. package/dist/workspace/git-workspace-adapter.js.map +0 -0
  330. package/dist/workspace/git-worktree-adapter.d.ts +0 -0
  331. package/dist/workspace/git-worktree-adapter.d.ts.map +0 -0
  332. package/dist/workspace/git-worktree-adapter.js +0 -0
  333. package/dist/workspace/git-worktree-adapter.js.map +0 -0
  334. package/dist/workspace/index.d.ts +0 -0
  335. package/dist/workspace/index.d.ts.map +0 -0
  336. package/dist/workspace/index.js +0 -0
  337. package/dist/workspace/index.js.map +0 -0
  338. package/package.json +13 -1
package/README.md CHANGED
@@ -192,21 +192,21 @@ Luban / harness-worker:
192
192
 
193
193
  `harness` primary 同样只读,不使用任何研究工具。
194
194
 
195
- ## 内部工程工具
195
+ ## Harness MCP 工具
196
196
 
197
- Harness 自研并注册以下只读工程工具,不依赖 OMO 或用户的 MCP 配置:
197
+ Harness 通过本地 stdio MCP Server 提供以下只读工程工具:
198
198
 
199
199
  - `harness_context7_resolve`、`harness_context7_query`:直连 Context7 官方 HTTP API。
200
200
  - `harness_grep_app_search`:通过自研 Streamable HTTP MCP 客户端调用 grep.app 官方 `searchGitHub`。
201
201
  - `harness_lsp_status`、`harness_lsp_diagnostics`、`harness_lsp_definition`、`harness_lsp_references`:通过自研 JSON-RPC stdio 客户端访问 JDT LS 和 TypeScript Language Server。
202
202
 
203
- 这些工具在执行时边界校验 Agent 身份,普通 OpenCode Agent 无法调用。工具使用权限按角色分配:
203
+ OpenCode `harness` 作为 MCP Server 名称,因此最终工具名保持 `harness_*`。工具使用权限按角色分配:
204
204
 
205
205
  - **全部研究工具**:Fuxi(Planner)、Luban(Worker)、Zhulong(Verifier)、Xingtian(Failure Analyzer)、Jingwei(Repair Worker)。
206
206
  - **grep.app + LSP**:Yinglong(Acceptance)。
207
207
  - **不使用研究工具**:Harness(primary)、Nuwa(Intake)。
208
208
 
209
- LSP 只提供只读查询,不实现重命名或代码写入。JDT LS 数据目录位于系统临时目录,并在插件释放时清理。
209
+ LSP 只提供只读查询,不实现重命名或代码写入。JDT LS 数据目录位于系统临时目录,并在 MCP Server 退出时清理。
210
210
 
211
211
  Context7 默认匿名访问,可通过环境变量 `CONTEXT7_API_KEY` 提升限额。JDT LS 命令可通过 `HARNESS_JDTLS_COMMAND` 覆盖。
212
212
 
@@ -373,15 +373,29 @@ pnpm publish:npm -- --token-auth
373
373
 
374
374
  ## OpenCode npm 引用
375
375
 
376
- 发布后在 `opencode.json` 中通过 npm 包名加载:
376
+ 发布后在 `opencode.json` 中加载插件并注册 Harness MCP Server:
377
377
 
378
378
  ```json
379
379
  {
380
380
  "$schema": "https://opencode.ai/config.json",
381
- "plugin": ["harness-engineering-agent"]
381
+ "plugin": ["harness-engineering-agent"],
382
+ "mcp": {
383
+ "harness": {
384
+ "type": "local",
385
+ "command": ["npx", "-y", "harness-engineering-agent@latest"],
386
+ "enabled": true,
387
+ "timeout": 30000
388
+ }
389
+ }
382
390
  }
383
391
  ```
384
392
 
393
+ OpenCode 会通过包的 `./server` 导出加载专用插件入口;根入口仍保留完整 SDK 导出,供其它
394
+ npm 调用方使用。
395
+
396
+ Harness 的内部 Agent 使用 `mode: "all"` 注册,会显示在 OpenCode Agent/Model 选择列表中,
397
+ 同时仍可作为 Harness 内部会话角色调用。
398
+
385
399
  ## 项目配置
386
400
 
387
401
  在目标项目创建 `.harness/config.yaml`:
@@ -562,4 +576,4 @@ pnpm build # 构建
562
576
 
563
577
  ## 许可证
564
578
 
565
- 本项目采用 [MIT License](LICENSE) 开源协议。
579
+ 本项目采用 [MIT License](LICENSE) 开源协议。
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/index.d.ts CHANGED
File without changes
File without changes
package/dist/index.js CHANGED
File without changes
package/dist/index.js.map CHANGED
File without changes
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/mcp/cli.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { createHarnessMcpServer } from "./server.js";
4
+ const runtime = createHarnessMcpServer();
5
+ const transport = new StdioServerTransport();
6
+ const shutdown = async () => {
7
+ await runtime.close();
8
+ await runtime.server.close();
9
+ };
10
+ process.once("SIGINT", () => {
11
+ void shutdown();
12
+ });
13
+ process.once("SIGTERM", () => {
14
+ void shutdown();
15
+ });
16
+ await runtime.server.connect(transport);
17
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/mcp/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAEhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEpD,MAAM,OAAO,GAAG,sBAAsB,EAAE,CAAA;AACxC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;AAE5C,MAAM,QAAQ,GAAG,KAAK,IAAmB,EAAE;IACzC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;IACrB,MAAM,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;AAC9B,CAAC,CAAA;AAED,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;IAC1B,KAAK,QAAQ,EAAE,CAAA;AACjB,CAAC,CAAC,CAAA;AACF,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;IAC3B,KAAK,QAAQ,EAAE,CAAA;AACjB,CAAC,CAAC,CAAA;AAEF,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare const createHarnessMcpServer: () => {
3
+ readonly server: McpServer;
4
+ readonly close: () => Promise<void>;
5
+ };
6
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AASnE,eAAO,MAAM,sBAAsB,QAAO;IACxC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CA2BpC,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { createContext7Client } from "../tools/context7-client.js";
3
+ import { createGrepAppClient } from "../tools/grep-app-client.js";
4
+ import { registerHarnessResearchTools } from "../tools/harness-research-tools.js";
5
+ import { createLspClient } from "../tools/lsp-client.js";
6
+ const CONTEXT7_API_KEY = "CONTEXT7_API_KEY";
7
+ export const createHarnessMcpServer = () => {
8
+ const lsp = createLspClient();
9
+ const server = new McpServer({
10
+ name: "harness",
11
+ version: "1.0.0",
12
+ }, {
13
+ capabilities: { tools: {} },
14
+ instructions: "Harness research tools are read-only and intended for Harness internal agents.",
15
+ });
16
+ const context7ApiKey = process.env[CONTEXT7_API_KEY];
17
+ registerHarnessResearchTools(server, {
18
+ context7: createContext7Client(context7ApiKey === undefined ? {} : { apiKey: context7ApiKey }),
19
+ grepApp: createGrepAppClient(),
20
+ lsp,
21
+ }, process.cwd());
22
+ return { server, close: () => lsp.close() };
23
+ };
24
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAEnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAGpC,EAAE;IACF,MAAM,GAAG,GAAG,eAAe,EAAE,CAAA;IAC7B,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,OAAO;KACjB,EACD;QACE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QAC3B,YAAY,EACV,gFAAgF;KACnF,CACF,CAAA;IACD,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;IACpD,4BAA4B,CAC1B,MAAM,EACN;QACE,QAAQ,EAAE,oBAAoB,CAC5B,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,CAC/D;QACD,OAAO,EAAE,mBAAmB,EAAE;QAC9B,GAAG;KACJ,EACD,OAAO,CAAC,GAAG,EAAE,CACd,CAAA;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAA;AAC7C,CAAC,CAAA"}
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"create-harness-plugin.d.ts","sourceRoot":"","sources":["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