Repository navigation
Added
doctorcommand.node scripts/install-local.mjs doctorruns nine checks
against a live install: Node >= 22,opencode --version, the package bundle
being present, the sha256 of the installed plugin againstdist/plugin.js,
the audit script being readable, the settings (imported fromdist/config.js
viatakeConfigDiagnostics()),python3, the OpenCode database being
readable, and duplicate plugin registration inopencode.json. It exits 1
only on afail; awarnis reported and still exits 0, so it can gate a
script without failing on the merely unusual.--dry-runoninstallanduninstall. Prints the file operations that
would run and touches nothing. The preview and the real run read the same
plan(), so the two cannot drift. The argv parse was rewritten to filter
--flags rather than readingprocess.argv[2], which is what makes
uninstall --dry-runwork rather than being read as an unknown command.
Documentation
- The
token_norm_statuspayload is declared a public interface. Stable
within a major version,peak >= currentalways, and reads are
side-effect-free — stated indocs/how-it-works.mdabove the payload example
and in the README. No field changed; this documents the existing contract. docs/install.mdshows a--dry-runexample and replaces the "check it
loaded" section with annotateddoctoroutput, explaining what the sha256
and settings checks actually prove.
Internal
- 29 new tests.
test/contract.test.tsis new and asserts behavioral
contracts through the plugin hooks: a throwing audit, a throwing toast, an
async-rejecting toast and an exploding provider all leave the tool call
intact; compaction recovery dropscurrenttoHEALTHYwhilepeakholds
PRESSURE; status reads never latch the peak; block mode keeps the handoff
and cheap tools open even at 50000x over limit; and pressure alone never
blocks.test/install-local.test.tsgrew to 15 tests covering the new
command surface, including exit codes.
Provenance
Built from 8a483717fadc1c026d52063b8a22cd09d050e54c.
| artifact | sha256 |
|---|---|
dist/plugin.js |
4bb0bf8057f0f70622143119549cf026f973f32ef898a1a8c08e6396e9d1f7c0 |
scripts/usage-audit.py |
ad5d1c4e18eac2c73dfc7267ff6c8a1f553783d7f62cd9d32d54f25f2ffa0c73 |
Verify an installed copy:
shasum -a 256 ~/.config/opencode/plugins/opencode-token-norm.js
shasum -a 256 ~/.config/opencode/scripts/usage-audit.py