mirror of
https://git.sync.wtf/troed/oc-ls-stats.git
synced 2026-08-31 09:43:38 +03:00
2.6 KiB
2.6 KiB
oc-ls-stats
OpenCode TUI plugin that displays live prefill (PP) and generation (TG) rates from a llama.cpp llama-server. Polls /slots, classifies slot activity, renders into the session status bar.
Test / release gate
- All tests live in
test-backoff.ts(node:test, run via tsx):npx tsx test-backoff.ts prepackruns this suite automatically on everynpm pack/npm publish. A failing suite blocks publishing.- No separate lint/typecheck scripts exist; the test suite is the gate.
Conventions
- Commits: lowercase conventional style —
fix: …,feat: …,docs: …, and release bumps aschore: vX.Y.Z — <summary>. - Tags: lightweight, named
vX.Y.Z. - Version bump lands in the same release commit chain as the changes it ships.
Registries
Two registries are used:
| Target | Scope mapping in ~/.npmrc |
|---|---|
| Local Gitea | @troed:registry=https://git.sync.wtf/api/packages/troed/npm/ |
| Public npmjs | @troed:registry=https://registry.npmjs.org/ |
Gotchas learned the hard way:
- The Gitea mapping MUST include the full API path (
/api/packages/troed/npm/). Mapping the bare host breaks bothnpm publishauth (ENEEDAUTH) and plugin installation/loading. - A
--registryCLI flag does NOT override@scope:registryconfig. Scoped operations always use the scope registry — to query a different registry for a scoped package, use its HTTP API directly (e.g.curl https://registry.npmjs.org/@troed%2foc-ls-stats). - Auth tokens are per path in
~/.npmrc://git.sync.wtf/api/packages/troed/npm/:_authToken=…and//registry.npmjs.org/:_authToken=….
Publish to local Gitea registry
# ensure @troed:registry points at https://git.sync.wtf/api/packages/troed/npm/
npm publish
Publish to public npmjs
- Back up the config:
cp ~/.npmrc ~/.npmrc.bak-$(date +%Y%m%d-%H%M%S) - Point the scope at npmjs: set
@troed:registry=https://registry.npmjs.org/in~/.npmrc - Authenticate (browser flow):
npm login --scope=@troed— open the printed URL, thennpm whoamishould printtroed - Publish:
npm publish- npmjs additionally requires a fresh publish-time web authentication (separate from login). Headless, npm masks that URL with
***; run under a pseudo-TTY to get the real link and let it poll until you finish in the browser:script -qec "npm publish --browser=/bin/echo" /dev/null
- npmjs additionally requires a fresh publish-time web authentication (separate from login). Headless, npm masks that URL with
- Verify:
curl -s https://registry.npmjs.org/@troed%2foc-ls-stats | jq '.dist-tags' - Restore the backup (
cp ~/.npmrc.bak-<timestamp> ~/.npmrc) before the next local-registry publish.