refactor(harness): extract MCP-config registry to internal/harness (phase 1) #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat-harness-registry-p1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 1 of
design/harness-descriptor.md— the behaviour-preserving extraction.What
internal/harness:Params+Descriptor{Name, Render}+Registry(agy/claude/cursor/opencode/gemini/roo/windsurf), plusNames/Expand/Writeand the merge/writer helpers — moved verbatim frominit.go.cmd/init.gois now a thin CLI over the package (cobra command +runInitloop). All generators,mergeJSONConfig,appendCWD,mustJSON,writeConfig,expandHarnessesmoved out.url/serverUrl/httpUrl,mcpServersvsmcp) and merge-preserving writes.No behaviour change
wraptool initemits identical output — verified end-to-end (claude →.mcp.jsontype:sse+cwd; opencode →opencode.jsonmcp/type:remote/enabled).Paramsalready carriesToken/CWDso phase 2 (replace the claude-onlywriteMCPConfig, addAuthMode) won't reshape descriptors.writeMCPConfig/connect.shuntouched here.Full
go test ./...+ golangci-lint clean.🤖 Generated with Claude Code
Phase 1 of design/harness-descriptor.md: move init.go's per-harness MCP-config generators into a shared internal/harness package (Params + Descriptor{Name, Render} + Registry, plus Names/Expand/Write and the merge/writer helpers). cmd/init.go becomes a thin CLI over the package. Behaviour-preserving — no CLI or output change; verified `wraptool init` still emits the correct per-harness formats (claude .mcp.json type:sse, opencode opencode.json mcp/type:remote, …). Params already carries Token/CWD so the container callers (phase 2, replacing the claude-only writeMCPConfig) and per-harness AuthMode won't reshape the descriptors again. Tests move to the harness package and pin the URL-key variance (url/serverUrl/httpUrl) + merge-preserving behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>