@kirkchinese/harness-forge 0.0.0-stage → 0.5.0

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 (279) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/assets/icon.svg +12 -0
  4. package/cordis.patch.yml +28 -0
  5. package/docs/DETAIL.zh.md +47 -0
  6. package/lib/agents/presets.d.ts +98 -0
  7. package/lib/agents/presets.js +292 -0
  8. package/lib/agents/profiles.d.ts +58 -0
  9. package/lib/agents/profiles.js +279 -0
  10. package/lib/agents/row.d.ts +17 -0
  11. package/lib/agents/row.js +148 -0
  12. package/lib/client/paths.d.ts +12 -0
  13. package/lib/client/paths.js +68 -0
  14. package/lib/client/styles.d.ts +8 -0
  15. package/lib/client/styles.js +89 -0
  16. package/lib/client/typert.d.ts +25 -0
  17. package/lib/client/typert.js +158 -0
  18. package/lib/client.js +23823 -0
  19. package/lib/commands/definition.d.ts +40 -0
  20. package/lib/commands/definition.js +113 -0
  21. package/lib/commands/output-styles.d.ts +42 -0
  22. package/lib/commands/output-styles.js +152 -0
  23. package/lib/commands/row.d.ts +9 -0
  24. package/lib/commands/row.js +157 -0
  25. package/lib/context/instructions.d.ts +32 -0
  26. package/lib/context/instructions.js +88 -0
  27. package/lib/context/row.d.ts +16 -0
  28. package/lib/context/row.js +17 -0
  29. package/lib/dsh/commands.d.ts +30 -0
  30. package/lib/dsh/commands.js +61 -0
  31. package/lib/dsh/host.d.ts +110 -0
  32. package/lib/dsh/host.js +217 -0
  33. package/lib/dsh/model-route.d.ts +21 -0
  34. package/lib/dsh/model-route.js +37 -0
  35. package/lib/dsh/session-records.d.ts +78 -0
  36. package/lib/dsh/session-records.js +36 -0
  37. package/lib/dsh/subagents.d.ts +46 -0
  38. package/lib/dsh/subagents.js +14 -0
  39. package/lib/forge/contract.d.ts +271 -0
  40. package/lib/forge/contract.js +45 -0
  41. package/lib/forge/follow.d.ts +30 -0
  42. package/lib/forge/follow.js +73 -0
  43. package/lib/forge/ledger.d.ts +206 -0
  44. package/lib/forge/ledger.js +1005 -0
  45. package/lib/forge/live-mounts.d.ts +45 -0
  46. package/lib/forge/live-mounts.js +78 -0
  47. package/lib/forge/npm.d.ts +31 -0
  48. package/lib/forge/npm.js +60 -0
  49. package/lib/forge/projects.d.ts +97 -0
  50. package/lib/forge/projects.js +343 -0
  51. package/lib/forge/receipts.d.ts +5 -0
  52. package/lib/forge/receipts.js +31 -0
  53. package/lib/forge/remote/archive.d.ts +65 -0
  54. package/lib/forge/remote/archive.js +565 -0
  55. package/lib/forge/remote/code-parts.d.ts +18 -0
  56. package/lib/forge/remote/code-parts.js +76 -0
  57. package/lib/forge/remote/fetch.d.ts +265 -0
  58. package/lib/forge/remote/fetch.js +1133 -0
  59. package/lib/forge/remote/service.d.ts +256 -0
  60. package/lib/forge/remote/service.js +868 -0
  61. package/lib/forge/row.d.ts +32 -0
  62. package/lib/forge/row.js +59 -0
  63. package/lib/forge/service.d.ts +115 -0
  64. package/lib/forge/service.js +290 -0
  65. package/lib/forge/settings.d.ts +43 -0
  66. package/lib/forge/settings.js +122 -0
  67. package/lib/forge/state.d.ts +129 -0
  68. package/lib/forge/state.js +266 -0
  69. package/lib/forge/trust.d.ts +48 -0
  70. package/lib/forge/trust.js +107 -0
  71. package/lib/forge/turns.d.ts +13 -0
  72. package/lib/forge/turns.js +56 -0
  73. package/lib/hooks/broker/engine.d.ts +112 -0
  74. package/lib/hooks/broker/engine.js +722 -0
  75. package/lib/hooks/broker/helpers.d.ts +10 -0
  76. package/lib/hooks/broker/helpers.js +22 -0
  77. package/lib/hooks/broker/lifecycle.d.ts +65 -0
  78. package/lib/hooks/broker/lifecycle.js +342 -0
  79. package/lib/hooks/broker/session-events.d.ts +27 -0
  80. package/lib/hooks/broker/session-events.js +205 -0
  81. package/lib/hooks/broker/tools.d.ts +52 -0
  82. package/lib/hooks/broker/tools.js +424 -0
  83. package/lib/hooks/broker/types.d.ts +264 -0
  84. package/lib/hooks/broker/types.js +1 -0
  85. package/lib/hooks/broker.d.ts +80 -0
  86. package/lib/hooks/broker.js +95 -0
  87. package/lib/hooks/codex-user.d.ts +5 -0
  88. package/lib/hooks/codex-user.js +109 -0
  89. package/lib/hooks/condition.d.ts +87 -0
  90. package/lib/hooks/condition.js +602 -0
  91. package/lib/hooks/config.d.ts +85 -0
  92. package/lib/hooks/config.js +154 -0
  93. package/lib/hooks/glob.d.ts +41 -0
  94. package/lib/hooks/glob.js +114 -0
  95. package/lib/hooks/matcher.d.ts +20 -0
  96. package/lib/hooks/matcher.js +39 -0
  97. package/lib/hooks/notice.d.ts +17 -0
  98. package/lib/hooks/notice.js +39 -0
  99. package/lib/hooks/output.d.ts +56 -0
  100. package/lib/hooks/output.js +214 -0
  101. package/lib/hooks/permissions.d.ts +19 -0
  102. package/lib/hooks/permissions.js +202 -0
  103. package/lib/hooks/powershell-aliases.d.ts +19 -0
  104. package/lib/hooks/powershell-aliases.js +58 -0
  105. package/lib/hooks/process.d.ts +64 -0
  106. package/lib/hooks/process.js +289 -0
  107. package/lib/hooks/row.d.ts +17 -0
  108. package/lib/hooks/row.js +96 -0
  109. package/lib/hooks/runner.d.ts +98 -0
  110. package/lib/hooks/runner.js +322 -0
  111. package/lib/hooks/shell-commands.d.ts +28 -0
  112. package/lib/hooks/shell-commands.js +241 -0
  113. package/lib/hooks/shell.d.ts +44 -0
  114. package/lib/hooks/shell.js +129 -0
  115. package/lib/hooks/transcript.d.ts +28 -0
  116. package/lib/hooks/transcript.js +141 -0
  117. package/lib/hooks/vocabulary.d.ts +57 -0
  118. package/lib/hooks/vocabulary.js +366 -0
  119. package/lib/index.d.ts +31 -0
  120. package/lib/index.js +287 -0
  121. package/lib/mcp/auth.d.ts +35 -0
  122. package/lib/mcp/auth.js +178 -0
  123. package/lib/mcp/catalog.d.ts +39 -0
  124. package/lib/mcp/catalog.js +69 -0
  125. package/lib/mcp/mount.d.ts +113 -0
  126. package/lib/mcp/mount.js +317 -0
  127. package/lib/mcp/policy.d.ts +42 -0
  128. package/lib/mcp/policy.js +43 -0
  129. package/lib/mcp/remote.d.ts +45 -0
  130. package/lib/mcp/remote.js +133 -0
  131. package/lib/mcp/row.d.ts +9 -0
  132. package/lib/mcp/row.js +225 -0
  133. package/lib/mods/bundler.d.ts +38 -0
  134. package/lib/mods/bundler.js +157 -0
  135. package/lib/mods/chain.d.ts +103 -0
  136. package/lib/mods/chain.js +436 -0
  137. package/lib/mods/claude.d.ts +27 -0
  138. package/lib/mods/claude.js +56 -0
  139. package/lib/mods/engine.d.ts +160 -0
  140. package/lib/mods/engine.js +701 -0
  141. package/lib/mods/expect.d.ts +8 -0
  142. package/lib/mods/expect.js +248 -0
  143. package/lib/mods/host.d.ts +105 -0
  144. package/lib/mods/host.js +462 -0
  145. package/lib/mods/loader.d.ts +53 -0
  146. package/lib/mods/loader.js +231 -0
  147. package/lib/mods/ops.d.ts +13 -0
  148. package/lib/mods/ops.js +117 -0
  149. package/lib/mods/row.d.ts +9 -0
  150. package/lib/mods/row.js +77 -0
  151. package/lib/mods/runtime.d.ts +60 -0
  152. package/lib/mods/runtime.js +133 -0
  153. package/lib/mods/service/commands.d.ts +17 -0
  154. package/lib/mods/service/commands.js +121 -0
  155. package/lib/mods/service/drawings.d.ts +36 -0
  156. package/lib/mods/service/drawings.js +64 -0
  157. package/lib/mods/service/sessions.d.ts +63 -0
  158. package/lib/mods/service/sessions.js +345 -0
  159. package/lib/mods/service/tools.d.ts +32 -0
  160. package/lib/mods/service/tools.js +253 -0
  161. package/lib/mods/service/turns.d.ts +33 -0
  162. package/lib/mods/service/turns.js +136 -0
  163. package/lib/mods/service/types.d.ts +151 -0
  164. package/lib/mods/service/types.js +1 -0
  165. package/lib/mods/service.d.ts +72 -0
  166. package/lib/mods/service.js +104 -0
  167. package/lib/mods/surfaces.d.ts +93 -0
  168. package/lib/mods/surfaces.js +309 -0
  169. package/lib/mods/values.d.ts +30 -0
  170. package/lib/mods/values.js +95 -0
  171. package/lib/opencode/bun.d.ts +40 -0
  172. package/lib/opencode/bun.js +168 -0
  173. package/lib/opencode/convert.d.ts +53 -0
  174. package/lib/opencode/convert.js +255 -0
  175. package/lib/opencode/row.d.ts +22 -0
  176. package/lib/opencode/row.js +104 -0
  177. package/lib/opencode/runtime/core.d.ts +74 -0
  178. package/lib/opencode/runtime/core.js +249 -0
  179. package/lib/opencode/runtime/events.d.ts +80 -0
  180. package/lib/opencode/runtime/events.js +281 -0
  181. package/lib/opencode/runtime/mount.d.ts +27 -0
  182. package/lib/opencode/runtime/mount.js +283 -0
  183. package/lib/opencode/runtime/server.d.ts +27 -0
  184. package/lib/opencode/runtime/server.js +354 -0
  185. package/lib/opencode/runtime/types.d.ts +109 -0
  186. package/lib/opencode/runtime/types.js +1 -0
  187. package/lib/opencode/runtime.d.ts +55 -0
  188. package/lib/opencode/runtime.js +79 -0
  189. package/lib/porting/adapter-paths.d.ts +13 -0
  190. package/lib/porting/adapter-paths.js +120 -0
  191. package/lib/porting/port-gap.d.ts +36 -0
  192. package/lib/porting/port-gap.js +158 -0
  193. package/lib/porting/port-sessions.d.ts +41 -0
  194. package/lib/porting/port-sessions.js +98 -0
  195. package/lib/porting/prompt.d.ts +23 -0
  196. package/lib/porting/prompt.js +51 -0
  197. package/lib/porting/row.d.ts +16 -0
  198. package/lib/porting/row.js +27 -0
  199. package/lib/porting/verify-port.d.ts +46 -0
  200. package/lib/porting/verify-port.js +82 -0
  201. package/lib/presets/fs-search.d.ts +25 -0
  202. package/lib/presets/fs-search.js +17 -0
  203. package/lib/presets/tool-filter.d.ts +35 -0
  204. package/lib/presets/tool-filter.js +91 -0
  205. package/lib/sessions/chat-import.d.ts +48 -0
  206. package/lib/sessions/chat-import.js +44 -0
  207. package/lib/sessions/claude.d.ts +35 -0
  208. package/lib/sessions/claude.js +104 -0
  209. package/lib/sessions/codex-discover.d.ts +34 -0
  210. package/lib/sessions/codex-discover.js +205 -0
  211. package/lib/sessions/codex-meta.d.ts +63 -0
  212. package/lib/sessions/codex-meta.js +148 -0
  213. package/lib/sessions/codex-text.d.ts +9 -0
  214. package/lib/sessions/codex-text.js +44 -0
  215. package/lib/sessions/codex.d.ts +42 -0
  216. package/lib/sessions/codex.js +270 -0
  217. package/lib/sessions/opencode.d.ts +38 -0
  218. package/lib/sessions/opencode.js +339 -0
  219. package/lib/sessions/persist.d.ts +162 -0
  220. package/lib/sessions/persist.js +377 -0
  221. package/lib/sessions/row.d.ts +15 -0
  222. package/lib/sessions/row.js +101 -0
  223. package/lib/sessions/turns.d.ts +31 -0
  224. package/lib/sessions/turns.js +63 -0
  225. package/lib/sessions/zstd.d.ts +15 -0
  226. package/lib/sessions/zstd.js +152 -0
  227. package/lib/shared/invocation.d.ts +169 -0
  228. package/lib/shared/invocation.js +325 -0
  229. package/lib/shared/render.d.ts +101 -0
  230. package/lib/shared/render.js +1353 -0
  231. package/lib/shared/util.d.ts +21 -0
  232. package/lib/shared/util.js +32 -0
  233. package/lib/skills/bundled.d.ts +3 -0
  234. package/lib/skills/bundled.js +42 -0
  235. package/lib/skills/provider.d.ts +74 -0
  236. package/lib/skills/provider.js +346 -0
  237. package/lib/skills/row.d.ts +22 -0
  238. package/lib/skills/row.js +204 -0
  239. package/lib/workbench/adapter-coverage.d.ts +65 -0
  240. package/lib/workbench/adapter-coverage.js +141 -0
  241. package/lib/workbench/model-tools.d.ts +10 -0
  242. package/lib/workbench/model-tools.js +122 -0
  243. package/lib/workbench/overview.d.ts +153 -0
  244. package/lib/workbench/overview.js +246 -0
  245. package/lib/workbench/remote.d.ts +161 -0
  246. package/lib/workbench/remote.js +561 -0
  247. package/lib/workbench/row.d.ts +15 -0
  248. package/lib/workbench/row.js +16 -0
  249. package/lib/workbench/settings.d.ts +19 -0
  250. package/lib/workbench/settings.js +60 -0
  251. package/lib/workbench/workbench.d.ts +130 -0
  252. package/lib/workbench/workbench.js +361 -0
  253. package/locale/agents/en.json +6 -0
  254. package/locale/agents/zh.json +6 -0
  255. package/locale/commands/en.json +6 -0
  256. package/locale/commands/zh.json +6 -0
  257. package/locale/context/en.json +6 -0
  258. package/locale/context/zh.json +6 -0
  259. package/locale/en.json +6 -0
  260. package/locale/hooks/en.json +6 -0
  261. package/locale/hooks/zh.json +6 -0
  262. package/locale/mcp/en.json +6 -0
  263. package/locale/mcp/zh.json +6 -0
  264. package/locale/mods/en.json +6 -0
  265. package/locale/mods/zh.json +6 -0
  266. package/locale/opencode/en.json +6 -0
  267. package/locale/opencode/zh.json +6 -0
  268. package/locale/porter/en.json +6 -0
  269. package/locale/porter/zh.json +6 -0
  270. package/locale/sessions/en.json +6 -0
  271. package/locale/sessions/zh.json +6 -0
  272. package/locale/skills/en.json +6 -0
  273. package/locale/skills/zh.json +6 -0
  274. package/locale/workbench/en.json +6 -0
  275. package/locale/workbench/zh.json +6 -0
  276. package/locale/zh.json +7 -0
  277. package/package.json +247 -3
  278. package/runtime/opencode-host.mjs +270 -0
  279. package/skills/harness-forge/SKILL.md +47 -0
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge page",
4
+ "description": "The Harness Forge page in the sidebar: discover, migrate, switch parts off, fill gaps and import sessions. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge 页面",
4
+ "description": "侧边栏中的 Harness Forge 页面:发现、迁移、关闭单个部分、补上缺口和导入会话。需要 Harness Forge 主行。"
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge",
4
+ "description": "在 DSH 中使用 Claude Code、Codex 和 OpenCode 的插件、设置与会话。在侧边栏打开 Harness Forge,即可查看这台电脑上找到的内容并迁移。其他 Harness Forge 行各自运行一类部分,可以单独关闭。",
5
+ "detail": "docs/DETAIL.zh.md"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,250 @@
1
1
  {
2
2
  "name": "@kirkchinese/harness-forge",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.5.0",
4
+ "description": "Use Claude Code, Codex and OpenCode plugins, settings and sessions in DSH",
5
+ "type": "module",
6
+ "main": "./lib/index.js",
7
+ "types": "./lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./preset-tool-filter": {
14
+ "types": "./lib/presets/tool-filter.d.ts",
15
+ "default": "./lib/presets/tool-filter.js"
16
+ },
17
+ "./preset-fs-search": {
18
+ "types": "./lib/presets/fs-search.d.ts",
19
+ "default": "./lib/presets/fs-search.js"
20
+ },
21
+ "./porter": {
22
+ "types": "./lib/porting/row.d.ts",
23
+ "default": "./lib/porting/row.js"
24
+ },
25
+ "./porter/locale/*.json": "./locale/porter/*.json",
26
+ "./porter/icon": "./assets/icon.svg",
27
+ "./sessions": {
28
+ "types": "./lib/sessions/row.d.ts",
29
+ "default": "./lib/sessions/row.js"
30
+ },
31
+ "./sessions/locale/*.json": "./locale/sessions/*.json",
32
+ "./sessions/icon": "./assets/icon.svg",
33
+ "./opencode": {
34
+ "types": "./lib/opencode/row.d.ts",
35
+ "default": "./lib/opencode/row.js"
36
+ },
37
+ "./opencode/locale/*.json": "./locale/opencode/*.json",
38
+ "./opencode/icon": "./assets/icon.svg",
39
+ "./mods": {
40
+ "types": "./lib/mods/row.d.ts",
41
+ "default": "./lib/mods/row.js"
42
+ },
43
+ "./mods/locale/*.json": "./locale/mods/*.json",
44
+ "./mods/icon": "./assets/icon.svg",
45
+ "./mcp": {
46
+ "types": "./lib/mcp/row.d.ts",
47
+ "default": "./lib/mcp/row.js"
48
+ },
49
+ "./mcp/locale/*.json": "./locale/mcp/*.json",
50
+ "./mcp/icon": "./assets/icon.svg",
51
+ "./hooks": {
52
+ "types": "./lib/hooks/row.d.ts",
53
+ "default": "./lib/hooks/row.js"
54
+ },
55
+ "./hooks/locale/*.json": "./locale/hooks/*.json",
56
+ "./hooks/icon": "./assets/icon.svg",
57
+ "./agents": {
58
+ "types": "./lib/agents/row.d.ts",
59
+ "default": "./lib/agents/row.js"
60
+ },
61
+ "./agents/locale/*.json": "./locale/agents/*.json",
62
+ "./agents/icon": "./assets/icon.svg",
63
+ "./context": {
64
+ "types": "./lib/context/row.d.ts",
65
+ "default": "./lib/context/row.js"
66
+ },
67
+ "./context/locale/*.json": "./locale/context/*.json",
68
+ "./context/icon": "./assets/icon.svg",
69
+ "./commands": {
70
+ "types": "./lib/commands/row.d.ts",
71
+ "default": "./lib/commands/row.js"
72
+ },
73
+ "./commands/locale/*.json": "./locale/commands/*.json",
74
+ "./commands/icon": "./assets/icon.svg",
75
+ "./skills": {
76
+ "types": "./lib/skills/row.d.ts",
77
+ "default": "./lib/skills/row.js"
78
+ },
79
+ "./skills/locale/*.json": "./locale/skills/*.json",
80
+ "./skills/icon": "./assets/icon.svg",
81
+ "./workbench": {
82
+ "types": "./lib/workbench/row.d.ts",
83
+ "default": "./lib/workbench/row.js"
84
+ },
85
+ "./workbench/locale/*.json": "./locale/workbench/*.json",
86
+ "./workbench/icon": "./assets/icon.svg",
87
+ "./locale/*.json": "./locale/*.json",
88
+ "./icon": "./assets/icon.svg",
89
+ "./client": "./lib/client.js",
90
+ "./cordis.patch.yml": "./cordis.patch.yml",
91
+ "./package.json": "./package.json"
92
+ },
93
+ "files": [
94
+ "lib",
95
+ "runtime",
96
+ "skills",
97
+ "assets",
98
+ "locale",
99
+ "cordis.patch.yml",
100
+ "README.md",
101
+ "docs/DETAIL.zh.md",
102
+ "LICENSE"
103
+ ],
104
+ "dsh": {
105
+ "manifestVersion": 1,
106
+ "bundle": {
107
+ "patch": "./cordis.patch.yml"
108
+ },
109
+ "client": {
110
+ "platform": "web",
111
+ "inject": [
112
+ "@deepseek-ai/dsh-client-ui-layout"
113
+ ]
114
+ }
115
+ },
116
+ "dependencies": {
117
+ "@modelcontextprotocol/client": "2.2.0",
118
+ "@opencode-ai/sdk": "1.19.6",
119
+ "js-yaml": "^4.3.2",
120
+ "yaml": "^2.8.1",
121
+ "@kirkchinese/harness-forge-core": "0.5.0"
122
+ },
123
+ "peerDependencies": {
124
+ "@deepseek-ai/cordis": ">=4.1.0 <5",
125
+ "@deepseek-ai/cordis-plugin-include": ">=1.1.0 <2",
126
+ "@deepseek-ai/dsh-agent-preset-registry": ">=0.2.2-rc.3",
127
+ "@deepseek-ai/dsh-commands": ">=0.2.2-rc.3",
128
+ "@deepseek-ai/dsh-llm": ">=0.2.2-rc.3",
129
+ "@deepseek-ai/dsh-mcp-client": ">=0.2.2-rc.3",
130
+ "@deepseek-ai/dsh-session": ">=0.2.2-rc.3",
131
+ "@deepseek-ai/dsh-skill": ">=0.2.2-rc.3",
132
+ "@deepseek-ai/dsh-tool-fs-search": ">=0.2.2-rc.3",
133
+ "@deepseek-ai/dsh-tool-subagent": ">=0.2.2-rc.3",
134
+ "@deepseek-ai/dsh-tools": ">=0.2.2-rc.3",
135
+ "@deepseek-ai/dsh-typert-protocol": ">=0.2.2-rc.3",
136
+ "@deepseek-ai/schemastery": ">=3.19.0 <4"
137
+ },
138
+ "devDependencies": {
139
+ "@deepseek-ai/cordis": "4.1.0",
140
+ "@deepseek-ai/cordis-plugin-include": "1.1.0",
141
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.5",
142
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.5",
143
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.5",
144
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.5",
145
+ "@deepseek-ai/dsh-client-ui-sidebar": "0.2.2-rc.5",
146
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
147
+ "@deepseek-ai/dsh-commands": "0.2.2-rc.5",
148
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.5",
149
+ "@deepseek-ai/dsh-mcp-client": "0.2.2-rc.5",
150
+ "@deepseek-ai/dsh-session": "0.2.2-rc.5",
151
+ "@deepseek-ai/dsh-session-format-catalog": "0.2.2-rc.5",
152
+ "@deepseek-ai/dsh-skill": "0.2.2-rc.5",
153
+ "@deepseek-ai/dsh-tool-subagent": "0.2.2-rc.5",
154
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.5",
155
+ "@deepseek-ai/dsh-typert-generator": "0.0.1-rc.1",
156
+ "@deepseek-ai/schemastery": "3.19.0",
157
+ "@modelcontextprotocol/node": "2.0.0",
158
+ "@modelcontextprotocol/sdk": "1.32.2",
159
+ "@modelcontextprotocol/server": "2.2.0",
160
+ "@types/js-yaml": "^4.0.9",
161
+ "@types/node": "^22.19.0",
162
+ "@types/react": "~18.3.31",
163
+ "@types/react-dom": "~18.3.7",
164
+ "playwright-core": "^1.65.0",
165
+ "react": "^18.3.1",
166
+ "react-dom": "^18.3.1",
167
+ "tsdown": "^0.22.14",
168
+ "typescript": "^5.9.3",
169
+ "vitest": "^4.0.18",
170
+ "zod": "4.6.6",
171
+ "@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.5",
172
+ "@deepseek-ai/dsh-tool-fs-search": "0.2.2-rc.5",
173
+ "@deepseek-ai/dsh-hook-protocol": "0.2.2-rc.5",
174
+ "rolldown": "1.3.2"
175
+ },
176
+ "engines": {
177
+ "node": "^22.19.0 || >=24.0.0",
178
+ "dsh": ">=0.2.2-rc.3"
179
+ },
180
+ "license": "MIT",
181
+ "publishConfig": {
182
+ "access": "public"
183
+ },
184
+ "repository": {
185
+ "type": "git",
186
+ "url": "git+https://github.com/kirkchinese/harness-forge.git",
187
+ "directory": "packages/plugin"
188
+ },
189
+ "keywords": [
190
+ "dsh",
191
+ "dsh-plugin",
192
+ "harness-forge",
193
+ "claude-code",
194
+ "codex",
195
+ "opencode"
196
+ ],
197
+ "homepage": "https://github.com/kirkchinese/harness-forge#readme",
198
+ "bugs": {
199
+ "url": "https://github.com/kirkchinese/harness-forge/issues"
200
+ },
201
+ "peerDependenciesMeta": {
202
+ "@deepseek-ai/cordis": {
203
+ "optional": true
204
+ },
205
+ "@deepseek-ai/cordis-plugin-include": {
206
+ "optional": true
207
+ },
208
+ "@deepseek-ai/dsh-agent-preset-registry": {
209
+ "optional": true
210
+ },
211
+ "@deepseek-ai/dsh-commands": {
212
+ "optional": true
213
+ },
214
+ "@deepseek-ai/dsh-llm": {
215
+ "optional": true
216
+ },
217
+ "@deepseek-ai/dsh-mcp-client": {
218
+ "optional": true
219
+ },
220
+ "@deepseek-ai/dsh-session": {
221
+ "optional": true
222
+ },
223
+ "@deepseek-ai/dsh-skill": {
224
+ "optional": true
225
+ },
226
+ "@deepseek-ai/dsh-tool-fs-search": {
227
+ "optional": true
228
+ },
229
+ "@deepseek-ai/dsh-tool-subagent": {
230
+ "optional": true
231
+ },
232
+ "@deepseek-ai/dsh-tools": {
233
+ "optional": true
234
+ },
235
+ "@deepseek-ai/dsh-typert-protocol": {
236
+ "optional": true
237
+ },
238
+ "@deepseek-ai/schemastery": {
239
+ "optional": true
240
+ }
241
+ },
242
+ "scripts": {
243
+ "build": "tsc -p tsconfig.json",
244
+ "build:client": "tsdown",
245
+ "typecheck": "tsc -p tsconfig.json --noEmit",
246
+ "typecheck:client": "tsc -p tsconfig.client.json",
247
+ "test": "vitest run",
248
+ "clean": "node --eval \"import('node:fs/promises').then(({ rm }) => Promise.all(['lib'].map((path) => rm(path, { force: true, recursive: true }))))\""
249
+ }
6
250
  }
@@ -0,0 +1,270 @@
1
+ /**
2
+ * Harness Forge's OpenCode plugin host: one Bun process per OpenCode plugin,
3
+ * loading it as OpenCode does and serving its hooks and tools to DSH.
4
+ *
5
+ * Started by `@kirkchinese/harness-forge` with the plugin's directory as
6
+ * the working directory and these variables:
7
+ * HF_OC_ENTRY the plugin's entry module
8
+ * HF_OC_SERVER the OpenCode-compatible server the plugin's `client` talks to
9
+ * HF_OC_KEY this host's name on that server
10
+ * HF_OC_SDK the `@opencode-ai/sdk/client` module that builds `client`
11
+ * HF_OC_INPUT JSON: { directory, worktree, project, options, config, auth }
12
+ *
13
+ * Loading follows OpenCode V1: a default export with `server` is the plugin;
14
+ * otherwise every exported function is one, each called once. Every hook runs
15
+ * in load order on the same output object, as OpenCode triggers them.
16
+ */
17
+ import { pathToFileURL } from 'node:url'
18
+ import { createRequire } from 'node:module'
19
+ import { dirname, join } from 'node:path'
20
+
21
+ const entry = process.env.HF_OC_ENTRY
22
+ const server = process.env.HF_OC_SERVER
23
+ const key = process.env.HF_OC_KEY
24
+ const input = JSON.parse(process.env.HF_OC_INPUT ?? '{}')
25
+
26
+ const internal = (path, body) => fetch(`${server}/__hf/${key}/${path}`, {
27
+ method: 'POST',
28
+ headers: { 'content-type': 'application/json' },
29
+ body: JSON.stringify(body ?? {}),
30
+ })
31
+
32
+ const messageOf = error => (error instanceof Error ? error.message : typeof error === 'string' ? error : JSON.stringify(error))
33
+
34
+ /**
35
+ * A deliberate refusal (`throw new Error('...')`, a string) or a crash: a
36
+ * system error (it has a `code`) or a TypeError, ReferenceError, SyntaxError
37
+ * or RangeError.
38
+ */
39
+ const kindOf = error => (error instanceof Error && (typeof error.code === 'string' || ['TypeError', 'ReferenceError', 'SyntaxError', 'RangeError'].includes(error.name)) ? 'crash' : 'stop')
40
+
41
+ async function main() {
42
+ const { createOpencodeClient } = await import(pathToFileURL(process.env.HF_OC_SDK).href)
43
+ const client = createOpencodeClient({ baseUrl: server, directory: input.directory, headers: { 'x-hf-plugin': key } })
44
+ const pluginInput = {
45
+ client,
46
+ project: input.project,
47
+ directory: input.directory,
48
+ worktree: input.worktree,
49
+ experimental_workspace: { register() {} },
50
+ serverUrl: new URL(server),
51
+ $: Bun.$,
52
+ }
53
+
54
+ const module = await import(pathToFileURL(entry).href)
55
+ const plugins = []
56
+ const fromDefault = module.default
57
+ if (fromDefault !== null && typeof fromDefault === 'object' && typeof fromDefault.server === 'function') {
58
+ plugins.push({ name: typeof fromDefault.id === 'string' ? fromDefault.id : 'default', fn: fromDefault.server })
59
+ } else if (fromDefault !== null && typeof fromDefault === 'object' && typeof fromDefault.setup === 'function') {
60
+ // An OpenCode V2 plugin only (`Plugin.define({ id, setup })`): its `setup(ctx)` API is a different one.
61
+ throw new Error(`OpenCode V2 plugin${typeof fromDefault.id === 'string' ? ` ${fromDefault.id}` : ''} (Plugin.define with setup(ctx)): Harness Forge runs OpenCode V1 plugins; the V2 context API is not served yet`)
62
+ } else {
63
+ const seen = new Set()
64
+ for (const [name, value] of Object.entries(module)) {
65
+ if (typeof value !== 'function' || seen.has(value)) continue
66
+ seen.add(value)
67
+ plugins.push({ name, fn: value })
68
+ }
69
+ }
70
+
71
+ const loaded = []
72
+ for (const plugin of plugins) {
73
+ const hooks = await plugin.fn(pluginInput, input.options ?? {})
74
+ if (hooks !== null && typeof hooks === 'object') loaded.push({ name: plugin.name, hooks })
75
+ }
76
+
77
+ // `config` runs once with the whole configuration, which a plugin may extend.
78
+ const config = structuredClone(input.config ?? {})
79
+ for (const { hooks } of loaded) if (typeof hooks.config === 'function') await hooks.config(config)
80
+
81
+ // `auth` loaders receive the stored credential of their provider, as OpenCode loads a provider.
82
+ for (const { hooks } of loaded) {
83
+ const auth = hooks.auth
84
+ if (auth === null || typeof auth !== 'object' || typeof auth.loader !== 'function') continue
85
+ const stored = input.auth?.[auth.provider]
86
+ const provider = config.provider?.[auth.provider] ?? { id: auth.provider, name: auth.provider, env: [], models: {} }
87
+ try {
88
+ await auth.loader(async () => stored ?? { type: 'api', key: '' }, provider)
89
+ } catch (error) {
90
+ console.error(`[harness-forge] auth loader for ${auth.provider}: ${messageOf(error)}`)
91
+ }
92
+ }
93
+
94
+ const zod = await zodFor(dirname(entry))
95
+ const tools = new Map()
96
+ for (const { name: plugin, hooks } of loaded) {
97
+ for (const [toolName, tool] of Object.entries(hooks.tool ?? {})) {
98
+ if (tool === null || typeof tool !== 'object' || typeof tool.execute !== 'function') continue
99
+ tools.set(toolName, { tool, plugin, schema: objectSchema(zod, tool.args) })
100
+ }
101
+ }
102
+
103
+ const calls = new Map()
104
+ const run = async (name, hookInput, output) => {
105
+ let ran = 0
106
+ for (const { hooks } of loaded) {
107
+ const hook = hooks[name]
108
+ if (typeof hook !== 'function') continue
109
+ ran += 1
110
+ await hook(hookInput, output)
111
+ }
112
+ return ran
113
+ }
114
+
115
+ const serve = Bun.serve({
116
+ hostname: '127.0.0.1',
117
+ port: 0,
118
+ idleTimeout: 0,
119
+ async fetch(request) {
120
+ const path = new URL(request.url).pathname
121
+ const body = request.method === 'POST' ? await request.json().catch(() => ({})) : {}
122
+ try {
123
+ if (path === '/hook') {
124
+ const output = body.output ?? {}
125
+ try {
126
+ const ran = await run(body.name, body.input ?? {}, output)
127
+ return Response.json({ ran, output })
128
+ } catch (error) {
129
+ return Response.json({ ran: 1, output, error: messageOf(error), errorKind: kindOf(error) })
130
+ }
131
+ }
132
+ if (path === '/event') {
133
+ // Every plugin hears the event; the first failure is reported.
134
+ let failure
135
+ for (const { hooks } of loaded) {
136
+ if (typeof hooks.event !== 'function') continue
137
+ try {
138
+ await hooks.event({ event: body.event })
139
+ } catch (error) {
140
+ failure ??= messageOf(error)
141
+ }
142
+ }
143
+ return Response.json(failure === undefined ? { ok: true } : { ok: false, error: failure })
144
+ }
145
+ if (path === '/tool') return Response.json(await callTool(body))
146
+ if (path === '/abort') {
147
+ calls.get(body.callID)?.abort(new Error('aborted'))
148
+ return Response.json({ ok: true })
149
+ }
150
+ if (path === '/dispose') {
151
+ let failure
152
+ let ran = 0
153
+ for (const { hooks } of loaded) {
154
+ if (typeof hooks.dispose !== 'function') continue
155
+ ran += 1
156
+ try {
157
+ await hooks.dispose()
158
+ } catch (error) {
159
+ failure ??= messageOf(error)
160
+ }
161
+ }
162
+ setTimeout(() => process.exit(0), 50)
163
+ return Response.json(failure === undefined ? { ok: true, ran } : { ok: false, ran, error: failure })
164
+ }
165
+ return new Response('not found', { status: 404 })
166
+ } catch (error) {
167
+ return Response.json({ error: messageOf(error) }, { status: 500 })
168
+ }
169
+ },
170
+ })
171
+
172
+ async function callTool({ name, args, context }) {
173
+ const entry = tools.get(name)
174
+ if (entry === undefined) return { error: `no tool ${name}` }
175
+ let parsed = args ?? {}
176
+ if (entry.schema?.zod !== undefined) {
177
+ const result = entry.schema.zod.safeParse(parsed)
178
+ if (!result.success) {
179
+ return { error: `The ${name} tool was called with invalid arguments: ${result.error.message}.\nPlease rewrite the input so it satisfies the expected schema.` }
180
+ }
181
+ parsed = result.data
182
+ }
183
+ const controller = new AbortController()
184
+ calls.set(context.callID, controller)
185
+ const toolContext = {
186
+ sessionID: context.sessionID,
187
+ messageID: context.messageID,
188
+ agent: context.agent,
189
+ directory: context.directory,
190
+ worktree: context.worktree,
191
+ abort: controller.signal,
192
+ callID: context.callID,
193
+ metadata(update) {
194
+ void internal('metadata', { callID: context.callID, sessionID: context.sessionID, update }).catch(() => undefined)
195
+ },
196
+ async ask(request) {
197
+ const response = await internal('ask', { callID: context.callID, sessionID: context.sessionID, request, tool: name })
198
+ const answer = await response.json()
199
+ if (answer.allowed !== true) throw new Error(answer.reason ?? `The user rejected permission to use this specific tool call.`)
200
+ },
201
+ }
202
+ try {
203
+ const value = await entry.tool.execute(parsed, toolContext)
204
+ return { result: value }
205
+ } catch (error) {
206
+ return { error: messageOf(error) }
207
+ } finally {
208
+ calls.delete(context.callID)
209
+ }
210
+ }
211
+
212
+ await internal('ready', {
213
+ port: serve.port,
214
+ plugins: loaded.map(({ name, hooks }) => ({
215
+ name,
216
+ hooks: Object.keys(hooks).filter(hook => hook !== 'tool' && hooks[hook] !== undefined),
217
+ tools: Object.keys(hooks.tool ?? {}),
218
+ })),
219
+ tools: [...tools].map(([name, { tool, plugin, schema }]) => ({
220
+ name,
221
+ plugin,
222
+ description: typeof tool.description === 'string' ? tool.description : '',
223
+ parameters: schema?.json ?? { type: 'object', additionalProperties: true },
224
+ })),
225
+ config,
226
+ })
227
+ }
228
+
229
+ /** The plugin's zod (its `@opencode-ai/plugin`'s `tool.schema`, else its own `zod`). */
230
+ async function zodFor(from) {
231
+ const require = createRequire(join(from, 'index.js'))
232
+ for (const specifier of ['@opencode-ai/plugin', 'zod']) {
233
+ try {
234
+ const resolved = Bun.resolveSync(specifier, from)
235
+ const module = await import(pathToFileURL(resolved).href)
236
+ const z = specifier === 'zod' ? (module.z ?? module.default ?? module) : module.tool?.schema
237
+ if (z !== undefined && typeof z.object === 'function') return z
238
+ } catch {
239
+ try {
240
+ const module = require(specifier)
241
+ const z = specifier === 'zod' ? (module.z ?? module) : module.tool?.schema
242
+ if (z !== undefined && typeof z.object === 'function') return z
243
+ } catch {
244
+ // Try the next.
245
+ }
246
+ }
247
+ }
248
+ return undefined
249
+ }
250
+
251
+ /** A tool's argument shape as a zod object and the JSON Schema the model sees, as OpenCode derives them. */
252
+ function objectSchema(z, args) {
253
+ if (args === null || typeof args !== 'object') return undefined
254
+ // A schema already (an object), or a raw shape of field schemas.
255
+ const zodObject = typeof args.safeParse === 'function' ? args : z?.object?.(args)
256
+ if (zodObject === undefined) return undefined
257
+ let json
258
+ try {
259
+ json = typeof z?.toJSONSchema === 'function' ? z.toJSONSchema(zodObject, { io: 'input', unrepresentable: 'any' }) : undefined
260
+ } catch {
261
+ json = undefined
262
+ }
263
+ if (json !== undefined) delete json.$schema
264
+ return { zod: zodObject, json: json ?? { type: 'object', additionalProperties: true } }
265
+ }
266
+
267
+ main().catch(async (error) => {
268
+ await internal('ready', { error: error instanceof Error ? `${error.message}\n${error.stack ?? ''}` : String(error) }).catch(() => undefined)
269
+ process.exit(1)
270
+ })
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: harness-forge
3
+ description: Bring Claude Code, Codex and OpenCode plugins into DSH and report what works. Use when the user mentions a plugin, skill, hook, MCP server, agent or command from another harness, or asks why an imported one does not behave as before.
4
+ ---
5
+
6
+ # Harness Forge
7
+
8
+ Harness Forge installs plugins written for Claude Code, Codex and OpenCode into DSH without changing them, and records what each part actually did at runtime.
9
+
10
+ ## Tools
11
+
12
+ | Tool | Use it to |
13
+ |---|---|
14
+ | `harness_discover` | List the user's own `~/.claude` and `~/.codex` assets and the plugin roots found under `~/.claude/plugins`, `~/.codex/plugins` and the OpenCode plugin directories, with an `installed` flag. |
15
+ | `harness_scan` | Read one plugin root and list its components (skills, commands, agents, hooks, MCP servers, code, UI, unmapped parts). Writes nothing. |
16
+ | `harness_plan` | Show the actions an install would take. |
17
+ | `harness_install` | Install one plugin root. Everything mounts immediately. |
18
+ | `harness_status` | Installed plugins, each component's status, runtime observations and gaps. |
19
+ | `harness_capabilities` | The installed capability catalog and its context cost. |
20
+ | `harness_mcp_login` | Sign in to a remote MCP server that needs OAuth. |
21
+
22
+ The user can do the same from the **Harness** sidebar panel or with `/harness status | list | scan <path> | plan <path> | import <path> | undo <receipt> | remove <plugin-id>`.
23
+
24
+ ## How imported parts appear in DSH
25
+
26
+ - **Skills** join the normal skill catalog under their own names; load them with the `skill` tool. `${CLAUDE_SKILL_DIR}`, `${CLAUDE_PLUGIN_ROOT}` and `` !`command` `` lines are expanded when loaded.
27
+ - **Commands** are slash commands named `/<plugin>-<command>` (Claude's `/plugin:command`). They expand `$ARGUMENTS`, `$0`…, named arguments, `!` shell lines and `@file` references, then send the result as the user's message.
28
+ - **Agents** are offered through the `agent` tool: pass the agent's id as `agent_preset`. Each agent keeps its own prompt and tool list.
29
+ - **MCP servers** expose tools named `mcp__plugin_<plugin>_<server>__<tool>`, exactly as in Claude Code; Codex servers keep their own server name.
30
+ - **Hooks** run on their own: Claude and Codex tool names (`Bash`, `Write`, `apply_patch`, …) are matched against the DSH tools that do the same work.
31
+ - **Claude Code mods** (a plugin's `hooks.json` `modules`) run in DSH sessions: their hooks see prompts, tool calls and checks, commands, turns and subagent spawns; what they draw appears as a band above the prompt and as panes, and their buttons work.
32
+ - **OpenCode code plugins** run in Bun as in OpenCode, with their `client`, hooks (`chat.message`, `tool.execute.before/after`, `permission.ask`, `shell.env`, `command.execute.before`, events) and tools under their original names.
33
+ - **The user's own assets** come over as they are: `~/.claude` (skills, agents, commands, output styles, settings, MCP servers) and `~/.codex` (skills, `/prompts:<name>` prompts, agent roles, `config.toml` MCP servers and `notify`, `rules` as permission rules, `AGENTS.md`).
34
+
35
+ ## Reading a status
36
+
37
+ Each component has a status:
38
+
39
+ - `verified`: it ran in this DSH and every recorded run succeeded.
40
+ - `mounted`: it is installed and has not run yet.
41
+ - `failed`: installing it failed, or its latest run failed. The `observations` list names the event or tool and the error.
42
+ - `skipped`: DSH has no equivalent; the gap list says why.
43
+ - `inactive`: the Harness Forge row that runs this kind of part is turned off in the profile.
44
+
45
+ Gaps name what does not carry over: hook events DSH never raises, events that run but cannot block, handler types that are not executed, LSP servers, app connectors and other unmapped parts.
46
+
47
+ When you report on a plugin, say which parts are verified, which only mounted, which failed with the recorded error, and which gaps apply. For a gap the user needs closed, point them to **Fill with AI** on that part in the Harness Forge panel: it opens a session in DSH's creation mode with a brief of the gap, and that session writes and installs a local adapter plugin.