@kirkchinese/harness-forge 0.0.0-stage → 0.4.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 (246) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -2
  3. package/assets/icon.svg +12 -0
  4. package/cordis.patch.yml +28 -0
  5. package/lib/agents/presets.d.ts +91 -0
  6. package/lib/agents/presets.js +282 -0
  7. package/lib/agents/profiles.d.ts +58 -0
  8. package/lib/agents/profiles.js +278 -0
  9. package/lib/agents/row.d.ts +17 -0
  10. package/lib/agents/row.js +146 -0
  11. package/lib/client/styles.d.ts +8 -0
  12. package/lib/client/styles.js +89 -0
  13. package/lib/client/typert.d.ts +14 -0
  14. package/lib/client/typert.js +110 -0
  15. package/lib/client.js +22500 -0
  16. package/lib/commands/definition.d.ts +40 -0
  17. package/lib/commands/definition.js +113 -0
  18. package/lib/commands/output-styles.d.ts +42 -0
  19. package/lib/commands/output-styles.js +152 -0
  20. package/lib/commands/row.d.ts +9 -0
  21. package/lib/commands/row.js +157 -0
  22. package/lib/context/instructions.d.ts +32 -0
  23. package/lib/context/instructions.js +88 -0
  24. package/lib/context/row.d.ts +16 -0
  25. package/lib/context/row.js +17 -0
  26. package/lib/dsh/commands.d.ts +30 -0
  27. package/lib/dsh/commands.js +61 -0
  28. package/lib/dsh/host.d.ts +107 -0
  29. package/lib/dsh/host.js +214 -0
  30. package/lib/dsh/model-route.d.ts +21 -0
  31. package/lib/dsh/model-route.js +37 -0
  32. package/lib/dsh/session-records.d.ts +78 -0
  33. package/lib/dsh/session-records.js +36 -0
  34. package/lib/dsh/subagents.d.ts +46 -0
  35. package/lib/dsh/subagents.js +14 -0
  36. package/lib/forge/contract.d.ts +231 -0
  37. package/lib/forge/contract.js +43 -0
  38. package/lib/forge/ledger.d.ts +143 -0
  39. package/lib/forge/ledger.js +733 -0
  40. package/lib/forge/live-mounts.d.ts +45 -0
  41. package/lib/forge/live-mounts.js +78 -0
  42. package/lib/forge/marketplace-install.d.ts +3 -0
  43. package/lib/forge/marketplace-install.js +64 -0
  44. package/lib/forge/npm.d.ts +31 -0
  45. package/lib/forge/npm.js +60 -0
  46. package/lib/forge/projects.d.ts +94 -0
  47. package/lib/forge/projects.js +336 -0
  48. package/lib/forge/receipts.d.ts +5 -0
  49. package/lib/forge/receipts.js +31 -0
  50. package/lib/forge/row.d.ts +32 -0
  51. package/lib/forge/row.js +59 -0
  52. package/lib/forge/service.d.ts +105 -0
  53. package/lib/forge/service.js +274 -0
  54. package/lib/forge/settings.d.ts +41 -0
  55. package/lib/forge/settings.js +115 -0
  56. package/lib/forge/state.d.ts +69 -0
  57. package/lib/forge/state.js +150 -0
  58. package/lib/forge/trust.d.ts +48 -0
  59. package/lib/forge/trust.js +107 -0
  60. package/lib/forge/turns.d.ts +13 -0
  61. package/lib/forge/turns.js +56 -0
  62. package/lib/hooks/broker/engine.d.ts +112 -0
  63. package/lib/hooks/broker/engine.js +728 -0
  64. package/lib/hooks/broker/helpers.d.ts +10 -0
  65. package/lib/hooks/broker/helpers.js +22 -0
  66. package/lib/hooks/broker/lifecycle.d.ts +65 -0
  67. package/lib/hooks/broker/lifecycle.js +342 -0
  68. package/lib/hooks/broker/session-events.d.ts +22 -0
  69. package/lib/hooks/broker/session-events.js +196 -0
  70. package/lib/hooks/broker/tools.d.ts +52 -0
  71. package/lib/hooks/broker/tools.js +424 -0
  72. package/lib/hooks/broker/types.d.ts +262 -0
  73. package/lib/hooks/broker/types.js +1 -0
  74. package/lib/hooks/broker.d.ts +80 -0
  75. package/lib/hooks/broker.js +95 -0
  76. package/lib/hooks/codex-user.d.ts +5 -0
  77. package/lib/hooks/codex-user.js +109 -0
  78. package/lib/hooks/condition.d.ts +11 -0
  79. package/lib/hooks/condition.js +181 -0
  80. package/lib/hooks/config.d.ts +85 -0
  81. package/lib/hooks/config.js +150 -0
  82. package/lib/hooks/matcher.d.ts +20 -0
  83. package/lib/hooks/matcher.js +39 -0
  84. package/lib/hooks/notice.d.ts +17 -0
  85. package/lib/hooks/notice.js +39 -0
  86. package/lib/hooks/output.d.ts +56 -0
  87. package/lib/hooks/output.js +214 -0
  88. package/lib/hooks/permissions.d.ts +14 -0
  89. package/lib/hooks/permissions.js +109 -0
  90. package/lib/hooks/process.d.ts +47 -0
  91. package/lib/hooks/process.js +134 -0
  92. package/lib/hooks/row.d.ts +17 -0
  93. package/lib/hooks/row.js +94 -0
  94. package/lib/hooks/runner.d.ts +85 -0
  95. package/lib/hooks/runner.js +293 -0
  96. package/lib/hooks/shell-commands.d.ts +19 -0
  97. package/lib/hooks/shell-commands.js +177 -0
  98. package/lib/hooks/shell.d.ts +43 -0
  99. package/lib/hooks/shell.js +126 -0
  100. package/lib/hooks/transcript.d.ts +28 -0
  101. package/lib/hooks/transcript.js +141 -0
  102. package/lib/hooks/vocabulary.d.ts +57 -0
  103. package/lib/hooks/vocabulary.js +364 -0
  104. package/lib/index.d.ts +31 -0
  105. package/lib/index.js +287 -0
  106. package/lib/mcp/auth.d.ts +35 -0
  107. package/lib/mcp/auth.js +178 -0
  108. package/lib/mcp/catalog.d.ts +36 -0
  109. package/lib/mcp/catalog.js +61 -0
  110. package/lib/mcp/mount.d.ts +75 -0
  111. package/lib/mcp/mount.js +217 -0
  112. package/lib/mcp/remote.d.ts +45 -0
  113. package/lib/mcp/remote.js +143 -0
  114. package/lib/mcp/row.d.ts +9 -0
  115. package/lib/mcp/row.js +131 -0
  116. package/lib/mods/bundler.d.ts +38 -0
  117. package/lib/mods/bundler.js +157 -0
  118. package/lib/mods/chain.d.ts +103 -0
  119. package/lib/mods/chain.js +436 -0
  120. package/lib/mods/claude.d.ts +27 -0
  121. package/lib/mods/claude.js +56 -0
  122. package/lib/mods/engine.d.ts +160 -0
  123. package/lib/mods/engine.js +701 -0
  124. package/lib/mods/expect.d.ts +8 -0
  125. package/lib/mods/expect.js +248 -0
  126. package/lib/mods/host.d.ts +105 -0
  127. package/lib/mods/host.js +462 -0
  128. package/lib/mods/loader.d.ts +53 -0
  129. package/lib/mods/loader.js +227 -0
  130. package/lib/mods/ops.d.ts +13 -0
  131. package/lib/mods/ops.js +117 -0
  132. package/lib/mods/row.d.ts +9 -0
  133. package/lib/mods/row.js +77 -0
  134. package/lib/mods/runtime.d.ts +60 -0
  135. package/lib/mods/runtime.js +133 -0
  136. package/lib/mods/service/commands.d.ts +17 -0
  137. package/lib/mods/service/commands.js +121 -0
  138. package/lib/mods/service/drawings.d.ts +36 -0
  139. package/lib/mods/service/drawings.js +64 -0
  140. package/lib/mods/service/sessions.d.ts +63 -0
  141. package/lib/mods/service/sessions.js +345 -0
  142. package/lib/mods/service/tools.d.ts +32 -0
  143. package/lib/mods/service/tools.js +253 -0
  144. package/lib/mods/service/turns.d.ts +32 -0
  145. package/lib/mods/service/turns.js +161 -0
  146. package/lib/mods/service/types.d.ts +151 -0
  147. package/lib/mods/service/types.js +1 -0
  148. package/lib/mods/service.d.ts +72 -0
  149. package/lib/mods/service.js +104 -0
  150. package/lib/mods/surfaces.d.ts +93 -0
  151. package/lib/mods/surfaces.js +309 -0
  152. package/lib/mods/values.d.ts +30 -0
  153. package/lib/mods/values.js +95 -0
  154. package/lib/opencode/bun.d.ts +40 -0
  155. package/lib/opencode/bun.js +156 -0
  156. package/lib/opencode/convert.d.ts +53 -0
  157. package/lib/opencode/convert.js +255 -0
  158. package/lib/opencode/row.d.ts +9 -0
  159. package/lib/opencode/row.js +86 -0
  160. package/lib/opencode/runtime/core.d.ts +74 -0
  161. package/lib/opencode/runtime/core.js +249 -0
  162. package/lib/opencode/runtime/events.d.ts +80 -0
  163. package/lib/opencode/runtime/events.js +281 -0
  164. package/lib/opencode/runtime/mount.d.ts +27 -0
  165. package/lib/opencode/runtime/mount.js +283 -0
  166. package/lib/opencode/runtime/server.d.ts +27 -0
  167. package/lib/opencode/runtime/server.js +353 -0
  168. package/lib/opencode/runtime/types.d.ts +109 -0
  169. package/lib/opencode/runtime/types.js +1 -0
  170. package/lib/opencode/runtime.d.ts +55 -0
  171. package/lib/opencode/runtime.js +79 -0
  172. package/lib/porting/port-gap.d.ts +30 -0
  173. package/lib/porting/port-gap.js +122 -0
  174. package/lib/porting/port-sessions.d.ts +41 -0
  175. package/lib/porting/port-sessions.js +98 -0
  176. package/lib/porting/prompt.d.ts +23 -0
  177. package/lib/porting/prompt.js +49 -0
  178. package/lib/porting/row.d.ts +16 -0
  179. package/lib/porting/row.js +25 -0
  180. package/lib/porting/verify-port.d.ts +53 -0
  181. package/lib/porting/verify-port.js +104 -0
  182. package/lib/presets/fs-search.d.ts +25 -0
  183. package/lib/presets/fs-search.js +17 -0
  184. package/lib/presets/tool-filter.d.ts +35 -0
  185. package/lib/presets/tool-filter.js +91 -0
  186. package/lib/sessions/claude.d.ts +29 -0
  187. package/lib/sessions/claude.js +83 -0
  188. package/lib/sessions/codex.d.ts +30 -0
  189. package/lib/sessions/codex.js +303 -0
  190. package/lib/sessions/opencode.d.ts +32 -0
  191. package/lib/sessions/opencode.js +320 -0
  192. package/lib/sessions/row.d.ts +14 -0
  193. package/lib/sessions/row.js +35 -0
  194. package/lib/shared/invocation.d.ts +169 -0
  195. package/lib/shared/invocation.js +325 -0
  196. package/lib/shared/render.d.ts +72 -0
  197. package/lib/shared/render.js +588 -0
  198. package/lib/shared/util.d.ts +21 -0
  199. package/lib/shared/util.js +32 -0
  200. package/lib/skills/bundled.d.ts +3 -0
  201. package/lib/skills/bundled.js +42 -0
  202. package/lib/skills/provider.d.ts +72 -0
  203. package/lib/skills/provider.js +340 -0
  204. package/lib/skills/row.d.ts +22 -0
  205. package/lib/skills/row.js +204 -0
  206. package/lib/workbench/adapter-coverage.d.ts +47 -0
  207. package/lib/workbench/adapter-coverage.js +102 -0
  208. package/lib/workbench/model-tools.d.ts +10 -0
  209. package/lib/workbench/model-tools.js +122 -0
  210. package/lib/workbench/overview.d.ts +103 -0
  211. package/lib/workbench/overview.js +159 -0
  212. package/lib/workbench/remote.d.ts +118 -0
  213. package/lib/workbench/remote.js +422 -0
  214. package/lib/workbench/row.d.ts +15 -0
  215. package/lib/workbench/row.js +16 -0
  216. package/lib/workbench/settings.d.ts +15 -0
  217. package/lib/workbench/settings.js +56 -0
  218. package/lib/workbench/workbench.d.ts +100 -0
  219. package/lib/workbench/workbench.js +260 -0
  220. package/locale/agents/en.json +6 -0
  221. package/locale/agents/zh.json +6 -0
  222. package/locale/commands/en.json +6 -0
  223. package/locale/commands/zh.json +6 -0
  224. package/locale/context/en.json +6 -0
  225. package/locale/context/zh.json +6 -0
  226. package/locale/en.json +6 -0
  227. package/locale/hooks/en.json +6 -0
  228. package/locale/hooks/zh.json +6 -0
  229. package/locale/mcp/en.json +6 -0
  230. package/locale/mcp/zh.json +6 -0
  231. package/locale/mods/en.json +6 -0
  232. package/locale/mods/zh.json +6 -0
  233. package/locale/opencode/en.json +6 -0
  234. package/locale/opencode/zh.json +6 -0
  235. package/locale/porter/en.json +6 -0
  236. package/locale/porter/zh.json +6 -0
  237. package/locale/sessions/en.json +6 -0
  238. package/locale/sessions/zh.json +6 -0
  239. package/locale/skills/en.json +6 -0
  240. package/locale/skills/zh.json +6 -0
  241. package/locale/workbench/en.json +6 -0
  242. package/locale/workbench/zh.json +6 -0
  243. package/locale/zh.json +6 -0
  244. package/package.json +246 -3
  245. package/runtime/opencode-host.mjs +270 -0
  246. package/skills/harness-forge/SKILL.md +47 -0
@@ -0,0 +1,260 @@
1
+ /**
2
+ * The workbench's read side: settings, discovery, capabilities and context
3
+ * cost, the overview and diagnostics, and migrating a whole harness. It keeps
4
+ * no state; the workbench row and the `/harness` command both read through it.
5
+ * @module @kirkchinese/harness-forge
6
+ */
7
+ import { createRequire } from 'node:module';
8
+ import { resolve } from 'node:path';
9
+ import { assess, discoverPlugins, pluginId } from '@kirkchinese/harness-forge-core';
10
+ import { itemOf, overviewOf, unreadableItemOf } from './overview.js';
11
+ import { adapterCoverage, enabledAdapters } from './adapter-coverage.js';
12
+ import { readSettings, writeSettings } from './settings.js';
13
+ import { messageOf } from '../shared/util.js';
14
+ import { dshService } from '../dsh/host.js';
15
+ import { findBun } from '../opencode/bun.js';
16
+ /** A package's version as this process resolves it, if it resolves. */
17
+ function versionOf(specifier) {
18
+ try {
19
+ return createRequire(import.meta.url)(specifier).version;
20
+ }
21
+ catch {
22
+ return undefined;
23
+ }
24
+ }
25
+ /** Read the current host's optional services. */
26
+ export function probeHostCapabilities(ctx) {
27
+ const has = (name) => dshService(ctx, name) !== undefined;
28
+ return {
29
+ skills: has('skills'),
30
+ commands: has('commands'),
31
+ agentPresets: has('agentPresets'),
32
+ shell: has('shell'),
33
+ webServer: has('webServer'),
34
+ workingDirectory: has('workingDirectory'),
35
+ };
36
+ }
37
+ /** Workbench views over the installations. */
38
+ export class Workbench {
39
+ forge;
40
+ installs;
41
+ constructor(forge) {
42
+ this.forge = forge;
43
+ this.installs = forge.ledger;
44
+ }
45
+ /** Read the persisted workbench settings. */
46
+ settings() {
47
+ return readSettings(this.installs.statePath);
48
+ }
49
+ /** Save workbench settings; only known fields are accepted. */
50
+ saveSettings(input) {
51
+ const current = this.settings();
52
+ const roots = Array.isArray(input.discoveryRoots)
53
+ ? [...new Set(input.discoveryRoots
54
+ .filter((value) => typeof value === 'string' && value.trim().length > 0)
55
+ .map(value => resolve(value)))]
56
+ : current.discoveryRoots;
57
+ const autoDiscover = typeof input.autoDiscover === 'boolean' ? input.autoDiscover : current.autoDiscover;
58
+ const contextBudgetTokens = typeof input.contextBudgetTokens === 'number'
59
+ && Number.isFinite(input.contextBudgetTokens)
60
+ && input.contextBudgetTokens > 0
61
+ ? Math.round(input.contextBudgetTokens)
62
+ : undefined;
63
+ const next = {
64
+ schemaVersion: 1,
65
+ discoveryRoots: roots.length > 0 ? roots : current.discoveryRoots,
66
+ autoDiscover,
67
+ ...(contextBudgetTokens !== undefined ? { contextBudgetTokens } : {}),
68
+ };
69
+ writeSettings(this.installs.statePath, next);
70
+ return next;
71
+ }
72
+ /**
73
+ * A plugin the overview lists, by id, read from disk now, with its gaps:
74
+ * an installed plugin's recorded ones, else those its scan shows.
75
+ */
76
+ findPlugin(id) {
77
+ const record = this.installs.list().find(item => item.id === id);
78
+ if (record !== undefined) {
79
+ const plugin = this.installs.scan(record.root, record.source);
80
+ return { plugin, gaps: record.compat?.gaps ?? assess(plugin).gaps };
81
+ }
82
+ // The overview lists a discovered plugin under its scanned id; the discovered name is only a hint.
83
+ const found = this.discover().plugins.filter(item => !item.installed);
84
+ for (const item of [...found.filter(item => pluginId(item.source, item.name) === id), ...found.filter(item => pluginId(item.source, item.name) !== id)]) {
85
+ let plugin;
86
+ try {
87
+ plugin = this.installs.scan(item.root, item.source);
88
+ }
89
+ catch {
90
+ continue;
91
+ }
92
+ if (plugin.id === id)
93
+ return { plugin, gaps: assess(plugin).gaps };
94
+ }
95
+ throw new Error(`no plugin ${id} is installed or discovered`);
96
+ }
97
+ /** Discover plugin roots using the saved settings. */
98
+ discover() {
99
+ const settings = this.settings();
100
+ const result = discoverPlugins(settings.discoveryRoots);
101
+ const installedRoots = new Set([...this.installs.live.values()].map(install => resolve(install.record.root)));
102
+ return {
103
+ settings,
104
+ plugins: result.plugins.map(plugin => ({
105
+ ...plugin,
106
+ installed: installedRoots.has(resolve(plugin.root)) || this.installs.live.has(pluginId(plugin.source, plugin.name)),
107
+ })),
108
+ missingRoots: result.missingRoots,
109
+ };
110
+ }
111
+ /** Aggregate capabilities and context cost for installed plugins. */
112
+ capabilities() {
113
+ const settings = this.settings();
114
+ const meter = dshService(this.installs.ctx, 'tokenMeter');
115
+ const estimate = (text) => {
116
+ if (meter === undefined)
117
+ return Math.ceil(text.length / 4);
118
+ try {
119
+ return meter.estimateMessage({ role: 'user', content: [{ type: 'text', text }] });
120
+ }
121
+ catch {
122
+ return Math.ceil(text.length / 4);
123
+ }
124
+ };
125
+ const plugins = [];
126
+ const totals = {};
127
+ let residentTokens = 0;
128
+ for (const install of this.installs.live.values()) {
129
+ const plugin = this.installs.scanRoot(install.record.root, install.record.source);
130
+ const compat = assess(plugin, [...install.outcomes.values()]);
131
+ const items = plugin.components.map((component) => {
132
+ const description = 'description' in component ? component.description : undefined;
133
+ return {
134
+ pluginId: plugin.id,
135
+ pluginName: plugin.name,
136
+ kind: component.kind,
137
+ name: component.name,
138
+ ...(description !== undefined ? { description } : {}),
139
+ source: plugin.source,
140
+ };
141
+ });
142
+ for (const item of items)
143
+ totals[item.kind] = (totals[item.kind] ?? 0) + 1;
144
+ const measured = items.reduce((sum, item) => (item.kind === 'skill' || item.kind === 'command' || item.kind === 'agent'
145
+ ? sum + estimate(`${item.name}\n${item.description ?? ''}`)
146
+ : sum), 0);
147
+ residentTokens += measured;
148
+ plugins.push({ pluginId: plugin.id, name: plugin.name, source: plugin.source, items, compat, residentTokens: measured });
149
+ }
150
+ const budgetTokens = settings.contextBudgetTokens;
151
+ const tools = dshService(this.installs.ctx, 'tools');
152
+ let toolCount = 0;
153
+ let toolTokens = 0;
154
+ try {
155
+ const schemas = tools?.schemas() ?? [];
156
+ toolCount = schemas.length;
157
+ toolTokens = schemas.reduce((sum, schema) => sum + estimate(JSON.stringify(schema)), 0);
158
+ }
159
+ catch {
160
+ // A composition without tool schema projection reports zero tools.
161
+ }
162
+ const totalResident = residentTokens + toolTokens;
163
+ return {
164
+ plugins,
165
+ totals,
166
+ residentTokens: totalResident,
167
+ ...(toolCount > 0 ? { toolCount } : {}),
168
+ ...(toolTokens > 0 ? { toolTokens } : {}),
169
+ ...(budgetTokens !== undefined ? { budgetTokens } : {}),
170
+ overBudget: budgetTokens !== undefined && totalResident > budgetTokens,
171
+ basis: `${meter === undefined ? 'bytes/4' : 'ctx.tokenMeter'} over catalog text + visible tool schemas`,
172
+ };
173
+ }
174
+ /** Current optional host services, for diagnostics. */
175
+ hostCapabilities() {
176
+ return probeHostCapabilities(this.forge.ctx);
177
+ }
178
+ /** The adapter packages installed in this DSH profile (see `adapter-coverage.ts`), read from disk now. */
179
+ adapters() {
180
+ const profile = dshService(this.installs.ctx, 'profileContext');
181
+ return adapterCoverage(profile?.dir !== undefined && profile.dir.length > 0 ? profile.dir : undefined);
182
+ }
183
+ /**
184
+ * The adapters on disk that DSH lists as installed and enabled: what `harness_verify_port` requires too, so a link
185
+ * left by a failed install covers nothing.
186
+ */
187
+ enabledAdapters() {
188
+ return enabledAdapters(this.adapters(), dshService(this.forge.ctx, 'pluginManager'));
189
+ }
190
+ /** The workbench's plain-language view of every harness: see `overview.ts`. */
191
+ async overview() {
192
+ const adapters = await this.enabledAdapters();
193
+ const items = [];
194
+ const seen = new Set();
195
+ for (const record of this.installs.list()) {
196
+ seen.add(resolve(record.root).toLowerCase());
197
+ try {
198
+ items.push(itemOf(this.installs.scan(record.root, record.source), record, adapters));
199
+ }
200
+ catch (error) {
201
+ // Its files are gone or unreadable: it stays listed, every part an error, with why.
202
+ items.push(unreadableItemOf(record, messageOf(error)));
203
+ }
204
+ }
205
+ for (const found of this.discover().plugins) {
206
+ if (found.installed || seen.has(resolve(found.root).toLowerCase()))
207
+ continue;
208
+ try {
209
+ items.push(itemOf(this.installs.scan(found.root, found.source), undefined, adapters));
210
+ }
211
+ catch {
212
+ // An unreadable root has nothing to show.
213
+ }
214
+ }
215
+ return overviewOf(items);
216
+ }
217
+ /** Read-only workbench diagnostics: host services, mounts, tool budget and row failures. */
218
+ diagnostics() {
219
+ const catalog = this.capabilities();
220
+ return {
221
+ host: this.hostCapabilities(),
222
+ hookShell: { bash: this.forge.shell.bash ?? null, powershell: this.forge.shell.powershell, default: this.forge.shell.defaultKind },
223
+ bun: findBun(this.installs.dataRoot) ?? null,
224
+ versions: {
225
+ forge: versionOf('../package.json') ?? null,
226
+ dsh: versionOf('@deepseek-ai/dsh-session/package.json') ?? null,
227
+ node: process.versions.node,
228
+ },
229
+ platform: process.platform,
230
+ faults: this.forge.faults(),
231
+ tools: { count: catalog.toolCount ?? 0, tokens: catalog.toolTokens ?? 0, residentTokens: catalog.residentTokens },
232
+ skillRoots: this.listSkillRoots(),
233
+ failedMounts: this.installs.list().flatMap(plugin => (plugin.mounts ?? [])
234
+ .filter(mount => mount.status === 'failed')
235
+ .map(mount => ({ pluginId: plugin.id, kind: mount.kind, name: mount.name, error: mount.error ?? '' }))),
236
+ plugins: this.installs.list().map(plugin => ({ id: plugin.id, source: plugin.source, root: plugin.root, installedAt: plugin.installedAt })),
237
+ statePath: this.installs.statePath,
238
+ dataRoot: this.installs.dataRoot,
239
+ };
240
+ }
241
+ /** List all skill roots the skills row serves (none while it is off). */
242
+ listSkillRoots() {
243
+ return this.forge.lookup('skills')?.roots() ?? [];
244
+ }
245
+ /** Migrate everything of one harness that is not migrated yet: its plugins and the person's own assets. */
246
+ async migrate(source) {
247
+ const installed = [];
248
+ const failed = [];
249
+ for (const found of this.discover().plugins.filter(item => item.source === source && !item.installed)) {
250
+ try {
251
+ const report = await this.forge.install(found.root, found.source);
252
+ installed.push(report.plugin.name);
253
+ }
254
+ catch (error) {
255
+ failed.push({ name: found.name, error: messageOf(error) });
256
+ }
257
+ }
258
+ return { installed, failed };
259
+ }
260
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge agents",
4
+ "description": "Makes migrated agents (subagents) available to DSH's delegation tool, with their model, skills and MCP servers. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge 智能体",
4
+ "description": "让迁移来的智能体(子代理)可通过 DSH 的委派工具使用,并带上它们的模型、技能和 MCP 服务器。需要 Harness Forge 主行。"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge commands",
4
+ "description": "Adds migrated slash commands and Claude Code output styles to DSH. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge 命令",
4
+ "description": "把迁移来的斜杠命令和 Claude Code 输出风格加入 DSH。需要 Harness Forge 主行。"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge instructions",
4
+ "description": "Adds Claude Code's instruction files that DSH does not read (~/.claude/CLAUDE.md, .claude/CLAUDE.md, @path imports) and Codex's global AGENTS.md to the system prompt. Yields when the Recollect plugin runs. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge 指令文件",
4
+ "description": "把 DSH 自己不读取的 Claude Code 指令文件(~/.claude/CLAUDE.md、.claude/CLAUDE.md、@path 导入)和 Codex 的全局 AGENTS.md 加入系统提示。Recollect 插件运行时整体让位。需要 Harness Forge 主行。"
5
+ }
6
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge",
4
+ "description": "Use Claude Code, Codex and OpenCode plugins, settings and sessions in DSH. Open Harness Forge in the sidebar to see what was found on this computer and migrate it. The other Harness Forge rows each run one kind of part and can be switched off on their own."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge hooks",
4
+ "description": "Runs migrated Claude Code and Codex hooks when DSH does the matching work, such as before a tool runs. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge 钩子",
4
+ "description": "在 DSH 做对应工作时(例如运行工具前)执行迁移来的 Claude Code 和 Codex 钩子。需要 Harness Forge 主行。"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge MCP servers",
4
+ "description": "Connects migrated MCP servers, including ones that need you to sign in. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge MCP 服务器",
4
+ "description": "连接迁移来的 MCP 服务器,包括需要登录的服务器。需要 Harness Forge 主行。"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge Claude Code mods",
4
+ "description": "Runs migrated Claude Code mods in each session and shows what they draw above the prompt. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge Claude Code 模组",
4
+ "description": "在每个会话中运行迁移来的 Claude Code 模组,并在输入框上方显示它们绘制的内容。需要 Harness Forge 主行。"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge OpenCode plugins",
4
+ "description": "Runs migrated OpenCode code plugins, each in its own Bun process. Needs the Harness Forge row; Bun is installed on first use if missing."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge OpenCode 插件",
4
+ "description": "运行迁移来的 OpenCode 代码插件,每个在自己的 Bun 进程中。需要 Harness Forge 主行;缺少 Bun 时首次使用会自动安装。"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge porting",
4
+ "description": "Describes a Claude Code, Codex or OpenCode plugin part DSH cannot run as it is and hands the brief to DSH's creation mode, which writes and installs a local adapter plugin. Turn it off to hide porting. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge 移植",
4
+ "description": "说明 DSH 无法原样运行的 Claude Code、Codex 或 OpenCode 插件部分,并把任务说明交给 DSH 的创造模式,由它编写并安装本地适配器插件。关闭后不再提供移植。需要 Harness Forge 主行。"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge sessions",
4
+ "description": "Imports past Claude Code, Codex and OpenCode conversations as DSH sessions (Harness Forge → More → Import sessions). Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge 会话导入",
4
+ "description": "把以前的 Claude Code、Codex 和 OpenCode 对话导入为 DSH 会话(Harness Forge → 更多 → 导入会话)。需要 Harness Forge 主行。"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge skills",
4
+ "description": "Makes migrated skills (SKILL.md) available in DSH from where they are. Needs the Harness Forge row."
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge 技能",
4
+ "description": "让迁移来的技能(SKILL.md)在原位置直接供 DSH 使用。需要 Harness Forge 主行。"
5
+ }
6
+ }
@@ -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,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Harness Forge",
4
+ "description": "在 DSH 中使用 Claude Code、Codex 和 OpenCode 的插件、设置与会话。在侧边栏打开 Harness Forge,即可查看这台电脑上找到的内容并迁移。其他 Harness Forge 行各自运行一类部分,可以单独关闭。"
5
+ }
6
+ }