{"_id":"@anton-kochev/pithos.context-bar","_rev":"2-59b158122aa40d126796bc9f53e85438","name":"@anton-kochev/pithos.context-bar","dist-tags":{"bootstrap":"0.0.0","latest":"0.1.0"},"versions":{"0.0.0":{"name":"@anton-kochev/pithos.context-bar","version":"0.0.0","keywords":["pi-package","pi-extension","pithos","context-window","tokens","tui"],"license":"MIT","_id":"@anton-kochev/pithos.context-bar@0.0.0","maintainers":[{"name":"anton-kochev","email":"anton.kochev@gmail.com"}],"homepage":"https://github.com/anton-kochev/pithos-kit#readme","bugs":{"url":"https://github.com/anton-kochev/pithos-kit/issues"},"pi":{"extensions":["./extensions"]},"dist":{"shasum":"9cb6818fe486ccfd0dd4705bc3fc1262d727666c","tarball":"https://registry.npmjs.org/@anton-kochev/pithos.context-bar/-/pithos.context-bar-0.0.0.tgz","fileCount":7,"integrity":"sha512-zE+mFBelGwKF4+cwQmt12+fJYP2OPJDLBOpLXi3i427IWIjJws+nnTnxX03C2xngpW3N4/ledYKqmz+BsyN20g==","signatures":[{"sig":"MEUCIQDlbCUVdpBKP/mmNbsgrIfjZdQcRdvgbSrVB5v8XLKqoAIgF5iaTaggFb8pltczqHNcDlxb87BZqmYEDmLW7mOfEPI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34429},"type":"module","scripts":{"test":"node --import tsx --test test/*.test.ts","audit":"npm audit --audit-level=moderate","typecheck":"tsc --noEmit"},"_npmUser":{"name":"anton-kochev","email":"anton.kochev@gmail.com"},"repository":{"url":"git+https://github.com/anton-kochev/pithos-kit.git","type":"git","directory":"pithos.context-bar"},"_npmVersion":"10.9.2","description":"A thin, stacked context-window composition bar for Pi.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.4","typescript":"^5.9.0","@types/node":"^24.0.0","@earendil-works/pi-tui":"^0.84.1"},"peerDependencies":{"@earendil-works/pi-coding-agent":">=0.84.1"},"_npmOperationalInternal":{"tmp":"tmp/pithos.context-bar_0.0.0_1786363692072_0.38808088203076974","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@anton-kochev/pithos.context-bar","version":"0.1.0","description":"A thin, stacked context-window composition bar for Pi.","keywords":["pi-package","pi-extension","pithos","context-window","tokens","tui"],"license":"MIT","type":"module","repository":{"type":"git","url":"git+https://github.com/anton-kochev/pithos-kit.git","directory":"pithos.context-bar"},"publishConfig":{"access":"public"},"devDependencies":{"@earendil-works/pi-tui":"^0.84.1","@types/node":"^24.0.0","tsx":"^4.20.4","typescript":"^5.9.0"},"peerDependencies":{"@earendil-works/pi-coding-agent":">=0.84.1"},"pi":{"extensions":["./extensions"]},"scripts":{"test":"node --import tsx --test test/*.test.ts","typecheck":"tsc --noEmit","audit":"npm audit --audit-level=moderate"},"gitHead":"14e32cc67fc85c72b7588bf1c31b78361f1eaa8c","_id":"@anton-kochev/pithos.context-bar@0.1.0","bugs":{"url":"https://github.com/anton-kochev/pithos-kit/issues"},"homepage":"https://github.com/anton-kochev/pithos-kit#readme","_nodeVersion":"24.18.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-6wO+xM9fwLozrTZNB9jRgKCu3hIKsTzj2RW236vLJe4yICjvstOCgkpoel2XECfYcnWl0b1+XXRbIXcVFUypyQ==","shasum":"14a9bb329c46154f4e50c5d0da933d4dc43dc4b0","tarball":"https://registry.npmjs.org/@anton-kochev/pithos.context-bar/-/pithos.context-bar-0.1.0.tgz","fileCount":7,"unpackedSize":34429,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anton-kochev%2fpithos.context-bar@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCeX3d+oP8/nFA3BWDWAjehZQIXJ0PZQjEbR7QhTUa2TwIhAML6Y2Uh9sL+XmPRwUu4oONsDN3+uSAYmGraRaD5Vr+D"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:41b68e7d-e857-43c5-915f-c1a8957542c1"}},"directories":{},"maintainers":[{"name":"anton-kochev","email":"anton.kochev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pithos.context-bar_0.1.0_1786376391337_0.8286577945551803"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-10T12:08:11.858Z","modified":"2026-08-10T15:39:51.836Z","0.0.0":"2026-08-10T12:08:12.231Z","0.1.0":"2026-08-10T15:39:51.481Z"},"bugs":{"url":"https://github.com/anton-kochev/pithos-kit/issues"},"license":"MIT","homepage":"https://github.com/anton-kochev/pithos-kit#readme","keywords":["pi-package","pi-extension","pithos","context-window","tokens","tui"],"repository":{"type":"git","url":"git+https://github.com/anton-kochev/pithos-kit.git","directory":"pithos.context-bar"},"description":"A thin, stacked context-window composition bar for Pi.","maintainers":[{"name":"anton-kochev","email":"anton.kochev@gmail.com"}],"readme":"# context-bar\n\nA thin, stacked context-window composition bar for [pi](https://github.com/earendil-works/pi-mono), rendered directly above the editor.\n\n```text\n▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀────────────────────────42%\n```\n\nThe real bar uses a harmonious theme-aware color progression and spans the terminal width. Used context renders as upper-half `▀` blocks, while free capacity renders as a thin `─` line matching the editor's current border color. This leaves balanced spacing around the input cursor. While enabled, context-bar removes Pi's separate top-border row; disabling the bar restores it. Its only inline text is a normal-size integer percentage at the far right.\n\n## Install\n\n```bash\npi install npm:@anton-kochev/pithos.context-bar\n```\n\nFor local development:\n\n```bash\npi install -l ./pithos.context-bar\n```\n\n## Commands\n\n| Command | Action |\n|---|---|\n| `/context-bar` | Toggle the bar |\n| `/context-bar on` | Enable it |\n| `/context-bar off` | Disable it |\n| `/context-bar status` | Show the legend, estimated counts, model/window, and estimation basis |\n\nNew sessions start enabled. Explicit changes are stored as non-context entries on the active session branch, so they survive reload, resume, and fork without creating project or global configuration.\n\n## Segments\n\nSegments always appear in this order:\n\n| Segment | Includes | Pi theme color |\n|---|---|---|\n| **Prompt** | Pi's base prompt, custom/append prompts, working directory, and extension prompt changes | Violet (`customMessageLabel`) |\n| **Project context** | Loaded `AGENTS.md`, `CLAUDE.md`, and related project instruction context | Blue (`mdLink`) |\n| **Skills** | Skill catalogue metadata, explicit `/skill:*` expansions, and recognized skill-file read results | Teal (`accent`) |\n| **Tools** | Active definitions/schemas, prompt guidance, calls, arguments, results, and context-visible shell output | Green (`success`) |\n| **Conversation** | User content, prompt templates, images, assistant text/thinking, summaries, and custom context messages | Amber (`mdHeading`) |\n| **Other** | Provider framing, serialization differences, extension rewrites, and estimation residual | Gray (`muted`) |\n| **Free** | Remaining context capacity | Thin line matching the current editor border (`borderMuted` fallback) |\n\nThe violet → blue → teal → green → amber progression adapts to Pi's dark, light, and custom themes. Free capacity follows the editor border as its mode/thinking color changes. The percentage uses the same dim theme color as Pi's footer path; it does not change color at thresholds.\n\n## Accuracy\n\nPi exposes aggregate context usage, but not exact additive token counts by source. The colored composition is therefore an estimate:\n\n- Text uses Pi-compatible conservative character-based token estimation.\n- Images use Pi's fixed image estimate.\n- A current provider aggregate is preferred only when it belongs to the selected model and matches the effective prompt/tool fingerprint; changed requests fall back to the safer local estimate.\n- Positive unexplained residual is assigned to **Other**; overestimates are proportionally reconciled.\n- Startup, model-switch, and post-compaction states use a complete local estimate until correlated provider usage is available.\n\n`/context-bar status` identifies the current basis as `provider-backed total` or `local estimate`. The extension persists only the enabled/disabled boolean. While enabled, it reads Pi's in-memory prompt, context, and schema objects to recompute the bar; it clears its references when disabled or shut down and never writes or logs those inputs or provider payloads.\n\nTiny categories may occupy less than one terminal cell and disappear from the passive bar rather than being visually exaggerated. They remain visible in `/context-bar status`.\n\n## Development\n\nRequires Node.js 22.19 or later and Pi 0.84.1 or later. This minimum includes upstream fixes for the dependency advisories affecting Pi 0.83.0.\n\n```bash\nnpm install\nnpm test\nnpm run audit\nnpm run typecheck\nnpm pack --dry-run\n```\n","readmeFilename":"README.md"}