Universal OCP compatibility bridge monorepo. Ship the complete stack — no phased MVP cuts.
- Goal: any OpenCode plugin runs unchanged on cooperating hosts via facades + one autodetection adapter + host kit.
- OCP is an external compatibility layer for MiMo/Kilo/OpenCode — hosts are read-only references; all OCP work lives in this repo.
- User delivery UX (locked): one installable umbrella package (
@opencode-compat/ocp) +ocp setupthat writes install-tree overrides; users then add consumer plugins via host config (plugin/ equivalent) unchanged. Listing OCP itself inpluginis optional bootstrap only — it does not intercept other plugins’ imports by itself. - Facades remapped in plugin install trees / operator overrides (not spoofing public
@opencode-aion npm). Publish public@opencode-compat/*— agent bump/publish runbook in this file; human guidedocs/guides/npm-publish.md. - Scope:
@opencode-compat/*— host bridge packages (internal) + umbrella UX package + named companions that must not redefine OCP success. - License: MPL-2.0 (all packages).
- ZCode is T0 only for OCP (marketplace ≠ OpenCode plugin ABI). Companion
@opencode-compat/migrate-zcodemigrates plugin-packaged skills/commands/marketplace manifests into.zcode-plugintrees (not host MCP; not unchanged@opencode-ai/pluginloadability). - Do not create or plan host-specific forks of consumer plugins (no
cursor-mimocode-provider,cursor-kilocode-provider, ZCode variants, etc.). Close gaps in the bridge. - Do not ship separate per-host adapter packages. Host differences are
HostProfiledata + dispatch inside@opencode-compat/adapter.
packages/ocp # umbrella UX (+ ocp setup)
packages/profile|facade-*|adapter|host-promise-v2|cli|migrate-zcode
fixtures/ # OCP conformance (migrator tests use in-memory mocks)
docs/hosts/ # host enablement notes (operator attach)
docs/ocp/0.1.md # contract
docs/plans/ # ADR + product plan + evidence (+ zcode-asset-migrator-plan.md)
docs/guides/ # companion privacy / ZCode import notes (non-OCP runtime)
- Prefer Bun workspaces; TypeScript strict; ESM only.
- Facades / universal adapter must not hardcode a single fork’s XDG paths — use
HostProfile+ autodetection. - MiMo extension hooks (
actor.*,session.*) are non-portable — never require them for T1 plugins. - Facade
v2/effectmay loud-fail unless host declares capability;v2/promise+ aisdk is the T3 bar. - Do not claim ZCode drop-in without a Z.AI vendor loader.
- Consumer plugins (e.g.
cursor-opencode-provider) are test/matrix subjects, not deliverables of this repo. - Privacy companions: Kilo/MiMo document in-app telemetry opt-out; ZCode telemetry is docs-only firewall/DNS — never claim an OCP plugin kill.
docs/ocp/0.1.md— protocoldocs/plans/phase0-adr-universal-compat.md— decisionsdocs/plans/universal-opencode-plugin-compat-plan.md— product plan
When the user asks to bump the version (e.g. “bump to 0.1.3”), treat that as a full release request and run this checklist end-to-end without stopping for confirmation, unless a gate fails or the target version already exists on npm.
Canonical human guide: docs/guides/npm-publish.md. This section is the agent execution contract.
- Ship the whole train together — all 8
@opencode-compat/*packages share one version. - Packages are public (
publishConfig.access: "public"/--access public). Never private. - Never republish an existing version. If
npm view @opencode-compat/ocp@X.Y.Z versionalready returns that version, stop and ask. - Never bump by hand-editing only
package.json. Always usebun scripts/bump-version.ts <ver>sobun.lockworkspace versions stay in sync. - Bun
pm packrewritesworkspace:*frombun.lock, notpackage.json. A stale lock publishes wrong transitive pins (this is how0.1.1broke).pack:checkmust pass before commit/tag. - Do not use local
bun run publish:npmfor later releases — Trusted Publishers + OIDC on tagv*is the path. - Tag format is
v+ train version (example: packages0.1.2→ tagv0.1.2). Tag must match package versions. - Root
package.jsonversion is monorepo metadata and may lag; do not require it to match the train.
profile → host-promise-v2 → migrate-zcode → adapter → facade-sdk → facade-plugin → cli → ocp
-
Preflight
git statusclean (or only intentional release edits); onmain; pull/pushable.- Confirm target version is new:
npm view @opencode-compat/ocp@X.Y.Z versionmust fail / not equal target. - Confirm current train is consistent: all
packages/*/package.jsonversions equal;bun.lockworkspace versions equal that train. - Optional sanity: last Publish workflow succeeded (
gh run list --workflow=publish.yml -L 3).
-
Bump
bun scripts/bump-version.ts X.Y.Z
This updates each package
package.json,VERSION/ profileOCP_VERSION(packages/profile/src/version.ts), andbun.lock, then runsbun install. -
Docs / defaults sync
- CLI setup default is
OCP_VERSIONfrom@opencode-compat/profile— no hardcoded train pin needed insetup.ts. - Update user-facing train mentions in
INSTALL.md(example default--version/ “today X.Y.Z”) when they still name an older train. - Do not churn historical narrative in
docs/guides/npm-publish.mdbootstrap sections, plan docs, or host-profiledrafts.tsocpVersioncontract examples unless the user asks.
- CLI setup default is
-
Verify (fail closed)
bun run pack:check
Must show:
publish-ready: 8 public packages @ X.Y.Z- eight packs at
X.Y.Z packed-deps-ok: 8 tarballs pin @opencode-compat/* @ X.Y.ZSpot-check tarballs under.tmp/npm-pack/if anything looks off: every@opencode-compat/*dependency must be the exact train version.
-
Commit + push
maingit add -A git commit -m "chore: release X.Y.Z" git push origin mainInclude
bun.lockand any INSTALL/default sync files. -
Tag + push tag (triggers OIDC publish)
git tag vX.Y.Z git push origin vX.Y.Z
.github/workflows/publish.ymlruns onv*→ install → typecheck → test → build →bun scripts/publish.ts --publish --oidc --skip-tests. -
Verify publish
- Watch the run:
gh run watch/gh run list --workflow=publish.yml -L 1until success. - Confirm registry for all 8 (or at least umbrella + leaves):
Transitive
npm view @opencode-compat/ocp version # X.Y.Z npm view @opencode-compat/ocp@X.Y.Z dependencies@opencode-compat/*deps on the published umbrella must be X.Y.Z, not an older train. npm dist-tag ls @opencode-compat/ocp→latestshould beX.Y.Z.- Consumer smoke (when host caches are available):
bun add -g @opencode-compat/ocp@X.Y.Z ocp setup --host mimo --mode npm --version X.Y.Z ocp setup --host kilo --mode npm --version X.Y.Z ocp doctor --host mimo
- Watch the run:
pack:check/ packed-deps gate: fix lock/train drift (bun scripts/bump-version.ts X.Y.Zor repairbun.lock); do not tag.- Publish workflow OIDC / ENEEDAUTH: check Trusted Publisher settings (repo
oakimov/opencode-plugin-compat, workflow filename exactlypublish.yml) andrepository.urlin each package; do not fall back to a long-livedNPM_TOKENunless the user explicitly asks. - Partial train on npm (should not happen via OIDC, but if recovering a local publish):
bun scripts/publish.ts --publish --skip-existing— only with user intent. - Bad version already on registry: you cannot fix-in-place. Deprecate if needed (
npm deprecate pkg@ver "reason"), bump to the next patch, and ship a good train. Do not rely onnpm unpublishfor patched mistakes.
- Retagging
latestonto an older version. - Deprecating prior trains.
- Live MiMo/Kilo model listing beyond setup/doctor smoke.
- Bumping root private workspace
package.jsonversion.
- Prove unchanged plugins (classic +
v2/promise, incl.cursor-opencode-provider) on MiMo/Kilo viaocp setup+ facades + adapter + host kit. - Close path/env gaps in the bridge (
HostProfile, doctor, docs, optional operator copy/symlink into host-native project dirs). - Expand
facade-sdksurface from real plugin smoke failures; keep matrix green. Wirehost-promise-v2from the OCP layer where provider-resolve allows. - Companion migrator MVP is landed (
migrate-zcodelibrary +compat migrate-zcode); keep ZCode OCP at T0; never pack host MCP. Optional Step I = marketplace polish only. - Later releases: follow Version bump / publish above (OIDC on
v*). First-time bootstrap details remain indocs/guides/npm-publish.md.
Companion privacy guides (§7.1) are shipped under docs/guides/ (Kilo/MiMo in-app opt-out; ZCode docs-only firewall/DNS). Doctor prints one-liner pointers; OCP never mutates telemetry.