- applyOpencodePluginEntry now operates on the RAW plugin value: object
entries ({package, options}), map-form plugins with per-key options and
odd scalars survive install in form and position; a strings-only
projection is never written back
- 'plugin present' short-circuits BEFORE any write — an idempotent
install no longer rewrites (and mangles) the key
- opencodeRemove drops the key only when NOTHING raw survives, and keeps
map form; foreign entries are no longer collapsed to bare keys
- backup re-snapshots on every write whose pre-write bytes differ from
bili's own last output (.bili-last sidecar hash): user edits refresh
the backup, bili's consecutive writes do not — the install→upgrade→
remove restore chain still yields the user's pre-install value
- codex/omp write paths funnel through the same writeConfigText discipline
Fixes#1002
- package.json: explicit exports { ".": dist/index.js, "./server":
dist/agent/opencode-native.js } — opencode's loader tries <pkg>/server
first (verified in the shipped @opencode/cli 2.0.7 binary), so the bare
name no longer falls back to main and runs the CLI in-host
- plugin install opencode: origin-aware — npm installs (package root under
node_modules) write the bare package name (host-managed via Npm.add,
portable config); checkout/dev installs keep the local shim dir and say
so in the output; remove/status handle both forms; re-run migrates
- tests: 8 new cases (origin table, both forms fresh/migrate/idempotent,
full install/remove/status e2e); docs EN+ZH