{"_id":"@metaharness/host-opencode","_rev":"5-aee507b181e5509e36c7e8fb8936bc34","name":"@metaharness/host-opencode","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@metaharness/host-opencode","version":"0.1.0","keywords":["agent-harness","opencode","sst-opencode","tui","mcp","host-adapter","ruflo","ADR-036"],"license":"MIT","_id":"@metaharness/host-opencode@0.1.0","maintainers":[{"name":"ruvnet","email":"ruv@ruv.net"}],"homepage":"https://github.com/ruvnet/agent-harness-generator","bugs":{"url":"https://github.com/ruvnet/agent-harness-generator/issues"},"dist":{"shasum":"64ef25d9370ba6071924ba1dcff8fb24699d69e5","tarball":"https://registry.npmjs.org/@metaharness/host-opencode/-/host-opencode-0.1.0.tgz","fileCount":7,"integrity":"sha512-s5gf3LBhLi2eN/iSrDULrfuWtm+gPu57MnUYyyfnvpawvOMfJmLn8TmPi0sJ1fBrecvHLGjYZCu2cWtJP38u0g==","signatures":[{"sig":"MEYCIQD0rzMn6FCrwb7xgliRtHGEow4SEBnXgZjlByYQD3/h5gIhAME6mWKYdwVUt7GNBdiAXT83lYVvybWH5zxaLModaN9H","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13181},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"5b81b587a95a11537dac220392b949e14934e873","scripts":{"lint":"tsc --noEmit","test":"vitest run --passWithNoTests","build":"tsc"},"_npmUser":{"name":"ruvnet","email":"ruv@ruv.net"},"repository":{"url":"git+https://github.com/ruvnet/agent-harness-generator.git","type":"git","directory":"packages/host-opencode"},"_npmVersion":"11.10.0","description":"OpenCode (sst/opencode) host adapter for agent-harness-generator. Emits .opencode/opencode.json (ADR-036).","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@metaharness/kernel":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/host-opencode_0.1.0_1781486131024_0.46835839825408754","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@metaharness/host-opencode","version":"0.1.1","keywords":["agent-harness","opencode","sst-opencode","tui","mcp","host-adapter","ruflo","ADR-036"],"license":"MIT","_id":"@metaharness/host-opencode@0.1.1","maintainers":[{"name":"ruvnet","email":"ruv@ruv.net"}],"homepage":"https://github.com/ruvnet/agent-harness-generator","bugs":{"url":"https://github.com/ruvnet/agent-harness-generator/issues"},"dist":{"shasum":"a8135e4cdaa482ef5e8a6696f18f3caaaacb50cc","tarball":"https://registry.npmjs.org/@metaharness/host-opencode/-/host-opencode-0.1.1.tgz","fileCount":7,"integrity":"sha512-4+vV7GYt1NpKaGcF4ZW1WgrcePBUmrZnnyejMKFlKfoVqvfvnT+TaS9aB01AYjrUTDoqeDT6dUr0KUFvmZ+Jow==","signatures":[{"sig":"MEQCIAFgI+xwGxjDjMb7tjVIxj0fxGO2mJKvLaUD6UsvYvAfAiB3Xj0UfEN6KQS8an7bzEWjRrHDiNOJuz9yVaAtF8Dhsg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19140},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"db1af4134a9c8330bacaa1a53cba2a21d28b78ad","scripts":{"lint":"tsc --noEmit","test":"vitest run --passWithNoTests","build":"tsc"},"_npmUser":{"name":"ruvnet","email":"ruv@ruv.net"},"repository":{"url":"git+https://github.com/ruvnet/agent-harness-generator.git","type":"git","directory":"packages/host-opencode"},"_npmVersion":"10.9.7","description":"OpenCode (sst/opencode) host adapter for agent-harness-generator. Emits .opencode/opencode.json (ADR-036).","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@metaharness/kernel":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/host-opencode_0.1.1_1781637575825_0.6991885601393002","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@metaharness/host-opencode","version":"0.1.2","keywords":["agent-harness","opencode","sst-opencode","tui","mcp","host-adapter","ruflo","ADR-036"],"license":"MIT","_id":"@metaharness/host-opencode@0.1.2","maintainers":[{"name":"ruvnet","email":"ruv@ruv.net"}],"homepage":"https://github.com/ruvnet/agent-harness-generator","bugs":{"url":"https://github.com/ruvnet/agent-harness-generator/issues"},"dist":{"shasum":"eb6d46fb7accdcd7f594422eb9dc33d7e549b754","tarball":"https://registry.npmjs.org/@metaharness/host-opencode/-/host-opencode-0.1.2.tgz","fileCount":7,"integrity":"sha512-mIvqB4Hj7h134HthfIXzQ9pcMxaJ80Ert2hycGIodOoGIO+zkl6RDtJttwh2HGaGXZu2F0EtFtwQAdBAsHa7Og==","signatures":[{"sig":"MEUCIFSgdZLNDHfPdHGXTBMUn3D8t5Dw2zbyGL2wAd5Y2swKAiEAv7djeY9IDxiN/zJxpqnqU/JXyHf4erox8b5rhRsZ0Bo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19141},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"82b3ce543ca7807e8bf95115563e81a601fc0738","scripts":{"lint":"tsc --noEmit","test":"vitest run --passWithNoTests","build":"tsc"},"_npmUser":{"name":"ruvnet","email":"ruv@ruv.net"},"repository":{"url":"git+https://github.com/ruvnet/agent-harness-generator.git","type":"git","directory":"packages/host-opencode"},"_npmVersion":"10.9.7","description":"OpenCode (sst/opencode) host adapter for agent-harness-generator. Emits .opencode/opencode.json (ADR-036).","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@metaharness/kernel":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/host-opencode_0.1.2_1781736110732_0.8857681592278306","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@metaharness/host-opencode","version":"0.1.3","keywords":["agent-harness","opencode","sst-opencode","tui","mcp","host-adapter","ruflo","ADR-036"],"license":"MIT","_id":"@metaharness/host-opencode@0.1.3","maintainers":[{"name":"ruvnet","email":"ruv@ruv.net"}],"homepage":"https://github.com/ruvnet/agent-harness-generator","bugs":{"url":"https://github.com/ruvnet/agent-harness-generator/issues"},"dist":{"shasum":"597aeb0d22edea128719d64e43bd43e66f1cc26f","tarball":"https://registry.npmjs.org/@metaharness/host-opencode/-/host-opencode-0.1.3.tgz","fileCount":7,"integrity":"sha512-QCE7MSQa77WcSgFhcAeWNFZ9juO6VNjksECOR1Ra0nHfxJhqMoyRrCJoDExe8HNma3jzEL0dA3hmTFjTcW8IWw==","signatures":[{"sig":"MEUCIQDeYN51NU3c14k43cCg2eI4YFrNx0k5Tb3FBNpsumd8ZAIgBBcwHj40orpLIJZm+9YEa/e8vdq3ngROPQ9n9x9KuzI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQD2fny/TjFICtbOqTiGP6IDubF/1iS1qOehPhqIA6/VzQIhAMxwkvkwgGsp5O3ebXQ4Y4zy4/C8PVS2FVjRBh3lDkbI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19883},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"lint":"tsc --noEmit","test":"vitest run --passWithNoTests","build":"tsc"},"_npmUser":{"name":"ruvnet","email":"ruv@ruv.net"},"repository":{"url":"git+https://github.com/ruvnet/agent-harness-generator.git","type":"git","directory":"packages/host-opencode"},"_npmVersion":"10.9.8","description":"OpenCode (sst/opencode) host adapter for agent-harness-generator. Emits .opencode/opencode.json (ADR-036).","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@metaharness/kernel":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.0.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/host-opencode_0.1.3_1790437754907_0.7741812138941078","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"_id":"@metaharness/host-opencode@0.1.4","bugs":{"url":"https://github.com/ruvnet/metaharness/issues"},"dist":{"shasum":"ba50b1ac461735435496c4c1b6b72505f7a15781","tarball":"https://registry.npmjs.org/@metaharness/host-opencode/-/host-opencode-0.1.4.tgz","fileCount":7,"integrity":"sha512-bSw+AeUMf4Y/GQHmuFDH8HByXHYqgnZsD7CxkVSbOrre83eDlcl+mAnNlZi1Zl3R88NLM9mZ88lCsVl7m5ONmg==","signatures":[{"sig":"MEYCIQDBhdo2//Wxji06cns9WhpRYJd2fkZY7MxNUpwtADUx6gIhANWsOPrXT7ucT85hzIWw4Sk7ijCho1pH3+sn5Rm55/gi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDjiFc2neuf408iVA/Z2QysH5Z5MfAF54lehGnOnzwvagIhAIiYK31hFA0t9ciJe0J1vCSuQeA1IlI26TfK7Hyuk6UZ"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@metaharness%2fhost-opencode@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":21536},"main":"./dist/index.js","name":"@metaharness/host-opencode","type":"module","_from":"file:/home/runner/work/metaharness/metaharness/dist-release/metaharness-host-opencode-0.1.4.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"license":"MIT","scripts":{"lint":"tsc --noEmit","test":"vitest run --passWithNoTests","build":"tsc"},"version":"0.1.4","_npmUser":{"name":"ruvnet","email":"ruv@ruv.net"},"homepage":"https://ruv.io","keywords":["metaharness","agent-harness","opencode","sst-opencode","tui","mcp","model-context-protocol","host-adapter"],"_resolved":"/home/runner/work/metaharness/metaharness/dist-release/metaharness-host-opencode-0.1.4.tgz","_integrity":"sha512-bSw+AeUMf4Y/GQHmuFDH8HByXHYqgnZsD7CxkVSbOrre83eDlcl+mAnNlZi1Zl3R88NLM9mZ88lCsVl7m5ONmg==","repository":{"url":"git+https://github.com/ruvnet/metaharness.git","type":"git","directory":"packages/host-opencode"},"_npmVersion":"10.9.9","description":"OpenCode (sst/opencode) host adapter for MetaHarness: emits .opencode/opencode.json with MCP and permission settings from a harness spec.","directories":{},"maintainers":[{"name":"ruvnet","email":"ruv@ruv.net"}],"_nodeVersion":"22.23.4","dependencies":{"@metaharness/kernel":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.12","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/host-opencode_0.1.4_1794227148926_0.792274566374045"}}},"time":{"created":"2026-06-15T01:15:30.843Z","modified":"2026-11-09T12:25:49.483Z","0.1.0":"2026-06-15T01:15:31.156Z","0.1.1":"2026-06-16T19:19:35.985Z","0.1.2":"2026-06-17T22:41:50.884Z","0.1.3":"2026-09-26T15:49:14.999Z","0.1.4":"2026-11-09T12:25:49.027Z"},"bugs":{"url":"https://github.com/ruvnet/metaharness/issues"},"license":"MIT","homepage":"https://ruv.io","keywords":["metaharness","agent-harness","opencode","sst-opencode","tui","mcp","model-context-protocol","host-adapter"],"repository":{"url":"git+https://github.com/ruvnet/metaharness.git","type":"git","directory":"packages/host-opencode"},"description":"OpenCode (sst/opencode) host adapter for MetaHarness: emits .opencode/opencode.json with MCP and permission settings from a harness spec.","maintainers":[{"name":"ruvnet","email":"ruv@ruv.net"}],"readme":"# @metaharness/host-opencode\n\n<!-- ruv-seo:start (ADR-356) -->\nTurns a MetaHarness harness spec into the files OpenCode (sst/opencode) reads: `.opencode/opencode.json` with MCP and permission settings, an `AGENTS.md`, and an install runbook.\n\n**Supported environments:** Node.js 20+ on Linux, macOS and Windows. ESM only (`import`, not `require`). Pure JavaScript with no native build step; `@metaharness/kernel` is used only for its `HarnessSpec` and `HostAdapter` types.\n\n## Quickstart\n\n```bash\nnpm install @metaharness/host-opencode\n```\n\nSave this as `quickstart.mjs` and run `node quickstart.mjs`:\n\n```js\nimport adapter from '@metaharness/host-opencode';\n\nconst files = adapter.generateConfig({\n  name: 'my-bot',\n  description: 'demo harness',\n  mcpServers: [{ name: 'my-bot', command: ['node', './bin/mcp.js'] }],\n});\nconsole.log(`host: ${adapter.name}`);\nfor (const [path, body] of Object.entries(files)) {\n  console.log(`${path}  (${body.split('\\n').length} lines)`);\n}\n```\n\nExpected output:\n\n```text\nhost: opencode\n.opencode/opencode.json  (21 lines)\ninstall.md  (30 lines)\nAGENTS.md  (6 lines)\n```\n\n**Next:** [`@metaharness/opencode`](https://www.npmjs.com/package/@metaharness/opencode) — scaffold a complete, doctor-checked harness for this host in one command (`npx @metaharness/opencode my-bot`).\n\n**Where it fits:** `npx metaharness new <name> --host opencode` adds this package as a dependency of the generated harness, and the generated `__tests__/smoke.test.ts` imports it, so `npm test` in that harness fails if the adapter is missing or broken.\n<!-- ruv-seo:end -->\n\n## Reference\n\n> [OpenCode](https://opencode.ai) (sst/opencode) host adapter for\n> [agent-harness-generator](https://github.com/ruvnet/agent-harness-generator).\n> The 8th host adapter, per [ADR-036](https://github.com/ruvnet/agent-harness-generator/blob/main/docs/adrs/ADR-036-host-opencode.md).\n\n## What it does\n\nGenerates the config files a harness needs to run inside **OpenCode**, the\nopen-source terminal AI coding agent by SST.\n\nEmits per `adapter.generateConfig(spec)`:\n\n- `.opencode/opencode.json` — the OpenCode 1.x project-scoped config:\n  `$schema` anchor, `mcp.servers` registration table, `mcp.permissions`\n  allow/deny block\n- `install.md` — runbook for `opencode auth login`, model-provider\n  selection, and the first-boot smoke\n\n## Schema (OpenCode 1.x)\n\n```json\n{\n  \"$schema\": \"https://opencode.ai/schema/opencode.json\",\n  \"mcp\": {\n    \"servers\": {\n      \"codeindex\": {\n        \"command\": \"node\",\n        \"args\": [\"./dist/mcp-server.js\"],\n        \"env\": { \"LOG_LEVEL\": \"info\" }\n      },\n      \"remote\": {\n        \"url\": \"https://example.com/mcp\"\n      }\n    },\n    \"permissions\": {\n      \"allow\": [\"mcp__codeindex__*\"],\n      \"deny\": [\"Bash(rm:*)\", \"Bash(git push:*)\"]\n    }\n  }\n}\n```\n\n## Default-deny composition\n\nOpenCode evaluates `mcp.permissions.deny` **before** `allow`. This adapter\ncopies the harness's `.harness/mcp-policy.json` deny rules verbatim, so the\ndefault-deny posture from [ADR-022](https://github.com/ruvnet/agent-harness-generator/blob/main/docs/adrs/ADR-022-mcp-primitive.md)\nwins through OpenCode's own enforcement gate — no second source of truth.\n\n## Constraints\n\n- **OpenCode 1.0+** — earlier 0.x versions had a different config layout\n- A model provider configured (`opencode auth login`)\n- `.opencode/opencode.json` is re-read on `:reload`, not hot-edit\n\n## Programmatic use\n\nThis adapter is normally consumed via `npx metaharness <name> --host opencode`.\nDirect programmatic use:\n\n```ts\nimport { adapter } from '@metaharness/host-opencode';\nconst files = adapter.generateConfig!(harnessSpec);\n// files === { '.opencode/opencode.json': '...', 'install.md': '...' }\n```\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","readmeFilename":"README.md"}