Commit Graph
3 Commits
Author SHA1 Message Date
Sisyphus d052bbff4c fix: opencode plugin install/remove preserves foreign entries verbatim (#1002)
- 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
2026-09-19 20:51:51 +08:00
Sisyphus 0b1ca14aa5 fix(plugin): stop freezing a stale MCP origin into opencode installs (Fixes #926) 2026-09-18 16:39:14 +08:00
Sisyphus bdc894b6b5 feat: standard npm install path for the opencode native plugin (Refs #925)
- 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
2026-09-18 16:00:07 +08:00