@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.
- package/LICENSE +21 -0
- package/README.md +42 -2
- package/assets/icon.svg +12 -0
- package/cordis.patch.yml +28 -0
- package/lib/agents/presets.d.ts +91 -0
- package/lib/agents/presets.js +282 -0
- package/lib/agents/profiles.d.ts +58 -0
- package/lib/agents/profiles.js +278 -0
- package/lib/agents/row.d.ts +17 -0
- package/lib/agents/row.js +146 -0
- package/lib/client/styles.d.ts +8 -0
- package/lib/client/styles.js +89 -0
- package/lib/client/typert.d.ts +14 -0
- package/lib/client/typert.js +110 -0
- package/lib/client.js +22500 -0
- package/lib/commands/definition.d.ts +40 -0
- package/lib/commands/definition.js +113 -0
- package/lib/commands/output-styles.d.ts +42 -0
- package/lib/commands/output-styles.js +152 -0
- package/lib/commands/row.d.ts +9 -0
- package/lib/commands/row.js +157 -0
- package/lib/context/instructions.d.ts +32 -0
- package/lib/context/instructions.js +88 -0
- package/lib/context/row.d.ts +16 -0
- package/lib/context/row.js +17 -0
- package/lib/dsh/commands.d.ts +30 -0
- package/lib/dsh/commands.js +61 -0
- package/lib/dsh/host.d.ts +107 -0
- package/lib/dsh/host.js +214 -0
- package/lib/dsh/model-route.d.ts +21 -0
- package/lib/dsh/model-route.js +37 -0
- package/lib/dsh/session-records.d.ts +78 -0
- package/lib/dsh/session-records.js +36 -0
- package/lib/dsh/subagents.d.ts +46 -0
- package/lib/dsh/subagents.js +14 -0
- package/lib/forge/contract.d.ts +231 -0
- package/lib/forge/contract.js +43 -0
- package/lib/forge/ledger.d.ts +143 -0
- package/lib/forge/ledger.js +733 -0
- package/lib/forge/live-mounts.d.ts +45 -0
- package/lib/forge/live-mounts.js +78 -0
- package/lib/forge/marketplace-install.d.ts +3 -0
- package/lib/forge/marketplace-install.js +64 -0
- package/lib/forge/npm.d.ts +31 -0
- package/lib/forge/npm.js +60 -0
- package/lib/forge/projects.d.ts +94 -0
- package/lib/forge/projects.js +336 -0
- package/lib/forge/receipts.d.ts +5 -0
- package/lib/forge/receipts.js +31 -0
- package/lib/forge/row.d.ts +32 -0
- package/lib/forge/row.js +59 -0
- package/lib/forge/service.d.ts +105 -0
- package/lib/forge/service.js +274 -0
- package/lib/forge/settings.d.ts +41 -0
- package/lib/forge/settings.js +115 -0
- package/lib/forge/state.d.ts +69 -0
- package/lib/forge/state.js +150 -0
- package/lib/forge/trust.d.ts +48 -0
- package/lib/forge/trust.js +107 -0
- package/lib/forge/turns.d.ts +13 -0
- package/lib/forge/turns.js +56 -0
- package/lib/hooks/broker/engine.d.ts +112 -0
- package/lib/hooks/broker/engine.js +728 -0
- package/lib/hooks/broker/helpers.d.ts +10 -0
- package/lib/hooks/broker/helpers.js +22 -0
- package/lib/hooks/broker/lifecycle.d.ts +65 -0
- package/lib/hooks/broker/lifecycle.js +342 -0
- package/lib/hooks/broker/session-events.d.ts +22 -0
- package/lib/hooks/broker/session-events.js +196 -0
- package/lib/hooks/broker/tools.d.ts +52 -0
- package/lib/hooks/broker/tools.js +424 -0
- package/lib/hooks/broker/types.d.ts +262 -0
- package/lib/hooks/broker/types.js +1 -0
- package/lib/hooks/broker.d.ts +80 -0
- package/lib/hooks/broker.js +95 -0
- package/lib/hooks/codex-user.d.ts +5 -0
- package/lib/hooks/codex-user.js +109 -0
- package/lib/hooks/condition.d.ts +11 -0
- package/lib/hooks/condition.js +181 -0
- package/lib/hooks/config.d.ts +85 -0
- package/lib/hooks/config.js +150 -0
- package/lib/hooks/matcher.d.ts +20 -0
- package/lib/hooks/matcher.js +39 -0
- package/lib/hooks/notice.d.ts +17 -0
- package/lib/hooks/notice.js +39 -0
- package/lib/hooks/output.d.ts +56 -0
- package/lib/hooks/output.js +214 -0
- package/lib/hooks/permissions.d.ts +14 -0
- package/lib/hooks/permissions.js +109 -0
- package/lib/hooks/process.d.ts +47 -0
- package/lib/hooks/process.js +134 -0
- package/lib/hooks/row.d.ts +17 -0
- package/lib/hooks/row.js +94 -0
- package/lib/hooks/runner.d.ts +85 -0
- package/lib/hooks/runner.js +293 -0
- package/lib/hooks/shell-commands.d.ts +19 -0
- package/lib/hooks/shell-commands.js +177 -0
- package/lib/hooks/shell.d.ts +43 -0
- package/lib/hooks/shell.js +126 -0
- package/lib/hooks/transcript.d.ts +28 -0
- package/lib/hooks/transcript.js +141 -0
- package/lib/hooks/vocabulary.d.ts +57 -0
- package/lib/hooks/vocabulary.js +364 -0
- package/lib/index.d.ts +31 -0
- package/lib/index.js +287 -0
- package/lib/mcp/auth.d.ts +35 -0
- package/lib/mcp/auth.js +178 -0
- package/lib/mcp/catalog.d.ts +36 -0
- package/lib/mcp/catalog.js +61 -0
- package/lib/mcp/mount.d.ts +75 -0
- package/lib/mcp/mount.js +217 -0
- package/lib/mcp/remote.d.ts +45 -0
- package/lib/mcp/remote.js +143 -0
- package/lib/mcp/row.d.ts +9 -0
- package/lib/mcp/row.js +131 -0
- package/lib/mods/bundler.d.ts +38 -0
- package/lib/mods/bundler.js +157 -0
- package/lib/mods/chain.d.ts +103 -0
- package/lib/mods/chain.js +436 -0
- package/lib/mods/claude.d.ts +27 -0
- package/lib/mods/claude.js +56 -0
- package/lib/mods/engine.d.ts +160 -0
- package/lib/mods/engine.js +701 -0
- package/lib/mods/expect.d.ts +8 -0
- package/lib/mods/expect.js +248 -0
- package/lib/mods/host.d.ts +105 -0
- package/lib/mods/host.js +462 -0
- package/lib/mods/loader.d.ts +53 -0
- package/lib/mods/loader.js +227 -0
- package/lib/mods/ops.d.ts +13 -0
- package/lib/mods/ops.js +117 -0
- package/lib/mods/row.d.ts +9 -0
- package/lib/mods/row.js +77 -0
- package/lib/mods/runtime.d.ts +60 -0
- package/lib/mods/runtime.js +133 -0
- package/lib/mods/service/commands.d.ts +17 -0
- package/lib/mods/service/commands.js +121 -0
- package/lib/mods/service/drawings.d.ts +36 -0
- package/lib/mods/service/drawings.js +64 -0
- package/lib/mods/service/sessions.d.ts +63 -0
- package/lib/mods/service/sessions.js +345 -0
- package/lib/mods/service/tools.d.ts +32 -0
- package/lib/mods/service/tools.js +253 -0
- package/lib/mods/service/turns.d.ts +32 -0
- package/lib/mods/service/turns.js +161 -0
- package/lib/mods/service/types.d.ts +151 -0
- package/lib/mods/service/types.js +1 -0
- package/lib/mods/service.d.ts +72 -0
- package/lib/mods/service.js +104 -0
- package/lib/mods/surfaces.d.ts +93 -0
- package/lib/mods/surfaces.js +309 -0
- package/lib/mods/values.d.ts +30 -0
- package/lib/mods/values.js +95 -0
- package/lib/opencode/bun.d.ts +40 -0
- package/lib/opencode/bun.js +156 -0
- package/lib/opencode/convert.d.ts +53 -0
- package/lib/opencode/convert.js +255 -0
- package/lib/opencode/row.d.ts +9 -0
- package/lib/opencode/row.js +86 -0
- package/lib/opencode/runtime/core.d.ts +74 -0
- package/lib/opencode/runtime/core.js +249 -0
- package/lib/opencode/runtime/events.d.ts +80 -0
- package/lib/opencode/runtime/events.js +281 -0
- package/lib/opencode/runtime/mount.d.ts +27 -0
- package/lib/opencode/runtime/mount.js +283 -0
- package/lib/opencode/runtime/server.d.ts +27 -0
- package/lib/opencode/runtime/server.js +353 -0
- package/lib/opencode/runtime/types.d.ts +109 -0
- package/lib/opencode/runtime/types.js +1 -0
- package/lib/opencode/runtime.d.ts +55 -0
- package/lib/opencode/runtime.js +79 -0
- package/lib/porting/port-gap.d.ts +30 -0
- package/lib/porting/port-gap.js +122 -0
- package/lib/porting/port-sessions.d.ts +41 -0
- package/lib/porting/port-sessions.js +98 -0
- package/lib/porting/prompt.d.ts +23 -0
- package/lib/porting/prompt.js +49 -0
- package/lib/porting/row.d.ts +16 -0
- package/lib/porting/row.js +25 -0
- package/lib/porting/verify-port.d.ts +53 -0
- package/lib/porting/verify-port.js +104 -0
- package/lib/presets/fs-search.d.ts +25 -0
- package/lib/presets/fs-search.js +17 -0
- package/lib/presets/tool-filter.d.ts +35 -0
- package/lib/presets/tool-filter.js +91 -0
- package/lib/sessions/claude.d.ts +29 -0
- package/lib/sessions/claude.js +83 -0
- package/lib/sessions/codex.d.ts +30 -0
- package/lib/sessions/codex.js +303 -0
- package/lib/sessions/opencode.d.ts +32 -0
- package/lib/sessions/opencode.js +320 -0
- package/lib/sessions/row.d.ts +14 -0
- package/lib/sessions/row.js +35 -0
- package/lib/shared/invocation.d.ts +169 -0
- package/lib/shared/invocation.js +325 -0
- package/lib/shared/render.d.ts +72 -0
- package/lib/shared/render.js +588 -0
- package/lib/shared/util.d.ts +21 -0
- package/lib/shared/util.js +32 -0
- package/lib/skills/bundled.d.ts +3 -0
- package/lib/skills/bundled.js +42 -0
- package/lib/skills/provider.d.ts +72 -0
- package/lib/skills/provider.js +340 -0
- package/lib/skills/row.d.ts +22 -0
- package/lib/skills/row.js +204 -0
- package/lib/workbench/adapter-coverage.d.ts +47 -0
- package/lib/workbench/adapter-coverage.js +102 -0
- package/lib/workbench/model-tools.d.ts +10 -0
- package/lib/workbench/model-tools.js +122 -0
- package/lib/workbench/overview.d.ts +103 -0
- package/lib/workbench/overview.js +159 -0
- package/lib/workbench/remote.d.ts +118 -0
- package/lib/workbench/remote.js +422 -0
- package/lib/workbench/row.d.ts +15 -0
- package/lib/workbench/row.js +16 -0
- package/lib/workbench/settings.d.ts +15 -0
- package/lib/workbench/settings.js +56 -0
- package/lib/workbench/workbench.d.ts +100 -0
- package/lib/workbench/workbench.js +260 -0
- package/locale/agents/en.json +6 -0
- package/locale/agents/zh.json +6 -0
- package/locale/commands/en.json +6 -0
- package/locale/commands/zh.json +6 -0
- package/locale/context/en.json +6 -0
- package/locale/context/zh.json +6 -0
- package/locale/en.json +6 -0
- package/locale/hooks/en.json +6 -0
- package/locale/hooks/zh.json +6 -0
- package/locale/mcp/en.json +6 -0
- package/locale/mcp/zh.json +6 -0
- package/locale/mods/en.json +6 -0
- package/locale/mods/zh.json +6 -0
- package/locale/opencode/en.json +6 -0
- package/locale/opencode/zh.json +6 -0
- package/locale/porter/en.json +6 -0
- package/locale/porter/zh.json +6 -0
- package/locale/sessions/en.json +6 -0
- package/locale/sessions/zh.json +6 -0
- package/locale/skills/en.json +6 -0
- package/locale/skills/zh.json +6 -0
- package/locale/workbench/en.json +6 -0
- package/locale/workbench/zh.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +246 -3
- package/runtime/opencode-host.mjs +270 -0
- package/skills/harness-forge/SKILL.md +47 -0
package/package.json
CHANGED
|
@@ -1,6 +1,249 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirkchinese/harness-forge",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.4.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
|
+
"LICENSE"
|
|
102
|
+
],
|
|
103
|
+
"dsh": {
|
|
104
|
+
"manifestVersion": 1,
|
|
105
|
+
"bundle": {
|
|
106
|
+
"patch": "./cordis.patch.yml"
|
|
107
|
+
},
|
|
108
|
+
"client": {
|
|
109
|
+
"platform": "web",
|
|
110
|
+
"inject": [
|
|
111
|
+
"@deepseek-ai/dsh-client-ui-layout"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"dependencies": {
|
|
116
|
+
"@modelcontextprotocol/client": "2.2.0",
|
|
117
|
+
"@opencode-ai/sdk": "1.19.6",
|
|
118
|
+
"js-yaml": "^4.3.2",
|
|
119
|
+
"yaml": "^2.8.1",
|
|
120
|
+
"@kirkchinese/harness-forge-core": "0.4.0"
|
|
121
|
+
},
|
|
122
|
+
"peerDependencies": {
|
|
123
|
+
"@deepseek-ai/cordis": ">=4.1.0 <5",
|
|
124
|
+
"@deepseek-ai/cordis-plugin-include": ">=1.1.0 <2",
|
|
125
|
+
"@deepseek-ai/dsh-agent-preset-registry": ">=0.2.2-rc.3",
|
|
126
|
+
"@deepseek-ai/dsh-commands": ">=0.2.2-rc.3",
|
|
127
|
+
"@deepseek-ai/dsh-llm": ">=0.2.2-rc.3",
|
|
128
|
+
"@deepseek-ai/dsh-mcp-client": ">=0.2.2-rc.3",
|
|
129
|
+
"@deepseek-ai/dsh-session": ">=0.2.2-rc.3",
|
|
130
|
+
"@deepseek-ai/dsh-skill": ">=0.2.2-rc.3",
|
|
131
|
+
"@deepseek-ai/dsh-tool-fs-search": ">=0.2.2-rc.3",
|
|
132
|
+
"@deepseek-ai/dsh-tool-subagent": ">=0.2.2-rc.3",
|
|
133
|
+
"@deepseek-ai/dsh-tools": ">=0.2.2-rc.3",
|
|
134
|
+
"@deepseek-ai/dsh-typert-protocol": ">=0.2.2-rc.3",
|
|
135
|
+
"@deepseek-ai/schemastery": ">=3.19.0 <4"
|
|
136
|
+
},
|
|
137
|
+
"devDependencies": {
|
|
138
|
+
"@deepseek-ai/cordis": "4.1.0",
|
|
139
|
+
"@deepseek-ai/cordis-plugin-include": "1.1.0",
|
|
140
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.5",
|
|
141
|
+
"@deepseek-ai/dsh-client-locale": "0.2.2-rc.5",
|
|
142
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.5",
|
|
143
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.5",
|
|
144
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.2-rc.5",
|
|
145
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
|
|
146
|
+
"@deepseek-ai/dsh-commands": "0.2.2-rc.5",
|
|
147
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.5",
|
|
148
|
+
"@deepseek-ai/dsh-mcp-client": "0.2.2-rc.5",
|
|
149
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.5",
|
|
150
|
+
"@deepseek-ai/dsh-session-format-catalog": "0.2.2-rc.5",
|
|
151
|
+
"@deepseek-ai/dsh-skill": "0.2.2-rc.5",
|
|
152
|
+
"@deepseek-ai/dsh-tool-subagent": "0.2.2-rc.5",
|
|
153
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.5",
|
|
154
|
+
"@deepseek-ai/dsh-typert-generator": "0.0.1-rc.1",
|
|
155
|
+
"@deepseek-ai/schemastery": "3.19.0",
|
|
156
|
+
"@modelcontextprotocol/node": "2.0.0",
|
|
157
|
+
"@modelcontextprotocol/sdk": "1.32.2",
|
|
158
|
+
"@modelcontextprotocol/server": "2.2.0",
|
|
159
|
+
"@types/js-yaml": "^4.0.9",
|
|
160
|
+
"@types/node": "^22.19.0",
|
|
161
|
+
"@types/react": "~18.3.31",
|
|
162
|
+
"@types/react-dom": "~18.3.7",
|
|
163
|
+
"playwright-core": "^1.65.0",
|
|
164
|
+
"react": "^18.3.1",
|
|
165
|
+
"react-dom": "^18.3.1",
|
|
166
|
+
"tsdown": "^0.22.14",
|
|
167
|
+
"typescript": "^5.9.3",
|
|
168
|
+
"vitest": "^4.0.18",
|
|
169
|
+
"zod": "4.6.6",
|
|
170
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.2-rc.5",
|
|
171
|
+
"@deepseek-ai/dsh-tool-fs-search": "0.2.2-rc.5",
|
|
172
|
+
"@deepseek-ai/dsh-hook-protocol": "0.2.2-rc.5",
|
|
173
|
+
"rolldown": "1.3.2"
|
|
174
|
+
},
|
|
175
|
+
"engines": {
|
|
176
|
+
"node": "^22.19.0 || >=24.0.0",
|
|
177
|
+
"dsh": ">=0.2.2-rc.3"
|
|
178
|
+
},
|
|
179
|
+
"license": "MIT",
|
|
180
|
+
"publishConfig": {
|
|
181
|
+
"access": "public"
|
|
182
|
+
},
|
|
183
|
+
"repository": {
|
|
184
|
+
"type": "git",
|
|
185
|
+
"url": "git+https://github.com/kirkchinese/harness-forge.git",
|
|
186
|
+
"directory": "packages/plugin"
|
|
187
|
+
},
|
|
188
|
+
"keywords": [
|
|
189
|
+
"dsh",
|
|
190
|
+
"dsh-plugin",
|
|
191
|
+
"harness-forge",
|
|
192
|
+
"claude-code",
|
|
193
|
+
"codex",
|
|
194
|
+
"opencode"
|
|
195
|
+
],
|
|
196
|
+
"homepage": "https://github.com/kirkchinese/harness-forge#readme",
|
|
197
|
+
"bugs": {
|
|
198
|
+
"url": "https://github.com/kirkchinese/harness-forge/issues"
|
|
199
|
+
},
|
|
200
|
+
"peerDependenciesMeta": {
|
|
201
|
+
"@deepseek-ai/cordis": {
|
|
202
|
+
"optional": true
|
|
203
|
+
},
|
|
204
|
+
"@deepseek-ai/cordis-plugin-include": {
|
|
205
|
+
"optional": true
|
|
206
|
+
},
|
|
207
|
+
"@deepseek-ai/dsh-agent-preset-registry": {
|
|
208
|
+
"optional": true
|
|
209
|
+
},
|
|
210
|
+
"@deepseek-ai/dsh-commands": {
|
|
211
|
+
"optional": true
|
|
212
|
+
},
|
|
213
|
+
"@deepseek-ai/dsh-llm": {
|
|
214
|
+
"optional": true
|
|
215
|
+
},
|
|
216
|
+
"@deepseek-ai/dsh-mcp-client": {
|
|
217
|
+
"optional": true
|
|
218
|
+
},
|
|
219
|
+
"@deepseek-ai/dsh-session": {
|
|
220
|
+
"optional": true
|
|
221
|
+
},
|
|
222
|
+
"@deepseek-ai/dsh-skill": {
|
|
223
|
+
"optional": true
|
|
224
|
+
},
|
|
225
|
+
"@deepseek-ai/dsh-tool-fs-search": {
|
|
226
|
+
"optional": true
|
|
227
|
+
},
|
|
228
|
+
"@deepseek-ai/dsh-tool-subagent": {
|
|
229
|
+
"optional": true
|
|
230
|
+
},
|
|
231
|
+
"@deepseek-ai/dsh-tools": {
|
|
232
|
+
"optional": true
|
|
233
|
+
},
|
|
234
|
+
"@deepseek-ai/dsh-typert-protocol": {
|
|
235
|
+
"optional": true
|
|
236
|
+
},
|
|
237
|
+
"@deepseek-ai/schemastery": {
|
|
238
|
+
"optional": true
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"scripts": {
|
|
242
|
+
"build": "tsc -p tsconfig.json",
|
|
243
|
+
"build:client": "tsdown",
|
|
244
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
245
|
+
"typecheck:client": "tsc -p tsconfig.client.json",
|
|
246
|
+
"test": "vitest run",
|
|
247
|
+
"clean": "node --eval \"import('node:fs/promises').then(({ rm }) => Promise.all(['lib'].map((path) => rm(path, { force: true, recursive: true }))))\""
|
|
248
|
+
}
|
|
6
249
|
}
|
|
@@ -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.
|