mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-06 05:17:15 +00:00
## What changed
- `plugin-catalog/tokstat.yaml`: `sha` → `5c11db13…7ce71` (was `fb7516b…7682a7`), `version` → `"1.0.1"`.
- Plus all catalog-relevant changes in heerey525/tokstat 5c11db13:
## Why this bump
The plugin worked when the app locale was English. On a `zh`-locale build the
status-bar chip still printed English (Total / Turn / Last / Context / Cache)
even though the rest of the Desktop UI was Chinese.
Root cause — the bundles violated two host i18n rules that only bite silently:
1. Bundles must be nested trees. The host resolves a key by walking the
tree on `.`, so flat `'label.total': '总量'` entries were never found
and the raw key was returned in every locale.
2. Interpolated messages must be functions — a plain string is returned
verbatim and `{0}` is never substituted (that convenience exists only for
app-level packs, not plugin bundles).
Fix: register nested objects (`label{}`, `tip{}`) whose leaves are strings or
arrow functions, and translate via `usePluginI18n('tokstat')` so a live
locale switch re-renders instead of `ctx.i18n.t`, which only sampled the
locale and never re-rendered. (See heerey525/tokstat commit 5c11db13.)
## Surfaces
Desktop only — single `desktop/plugin.js`; no gateway or Python code; no
`requires_env`.
## Validation
- `hermes plugins validate` passes on the pinned commit.
- 7/7 single-file desktop-plugin tests green (incl. assertions that pin
the dotted-path walk and the function-message interpolation rules).
- Full line: `node --test tests/plugin.test.mjs`.
- Installed locally: `hermes plugins install tokstat` lands on the pinned
commit on both `local` and catalog builds; chip switches locale live.
- No app-side changes (no `requires_hermes` bump — still `>=0.20.2`).
## Pin
`sha: 5c11db13bd8ddba5fb958f07bce564efd947ce71`
16 lines
617 B
YAML
16 lines
617 B
YAML
name: tokstat
|
|
repo: https://github.com/heerey525/tokstat
|
|
sha: 5c11db13bd8ddba5fb958f07bce564efd947ce71
|
|
description: "Live token usage in the Hermes Desktop status bar: cumulative total, a real-time this-turn counter, last-turn delta, context occupancy, and prompt-cache hit rate. Event-driven (no polling, no RPC); English and Chinese, follows the app locale."
|
|
maintainer: heerey525
|
|
tier: community
|
|
category: desktop
|
|
version: "1.0.1"
|
|
docs_url: https://github.com/heerey525/tokstat#readme
|
|
requires_hermes: ">=0.20.2"
|
|
capabilities:
|
|
provides_tools: []
|
|
provides_hooks: []
|
|
provides_middleware: []
|
|
requires_env: []
|