{"_id":"@a-fig/accordion","_rev":"3-4cdc0dbb322efb810e7088caf2830e16","name":"@a-fig/accordion","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@a-fig/accordion","version":"0.1.0","keywords":["pi-package"],"_id":"@a-fig/accordion@0.1.0","maintainers":[{"name":"a-fig","email":"tylerd2474@gmail.com"}],"pi":{"extensions":["./accordion.js"]},"dist":{"shasum":"dc976d590ecf2ab515cfe2c4ff8e1e6deb96b44c","tarball":"https://registry.npmjs.org/@a-fig/accordion/-/accordion-0.1.0.tgz","fileCount":66,"integrity":"sha512-mT/53vDf1Dhwg/E4aTvz6lGjQBEhVPilqpYOF9XzMFvjHuZVBBElKsDYVSN9fmNJ+trdYlqxKP4Kalw0f/MFXw==","signatures":[{"sig":"MEUCIA9TrBGaaM0lsYoD6fi7G+fWwKhvpfIa61+3ERc+iAwdAiEA0S0OktF07OwGSJyWvbxmsYo5Fc06mMtb9fedggAIb1o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2366113},"type":"module","gitHead":"1dff8bef457abb44d2f8a4b9e1ce497f80a219e0","scripts":{"build":"npm run build:client && npm run build:extension","smoke":"node smoke.mjs","build:client":"node ./build-client.mjs","build:extension":"node ./build-extension.mjs"},"_npmUser":{"name":"a-fig","email":"tylerd2474@gmail.com"},"_npmVersion":"11.13.0","description":"Accordion live link — a pi extension that streams context to the Accordion GUI and applies the fold plan the GUI returns.","directories":{},"_nodeVersion":"24.17.0","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.7.0","esbuild":"^0.25.0"},"peerDependencies":{"typebox":"*","@earendil-works/pi-ai":"*","@earendil-works/pi-agent-core":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/accordion_0.1.0_1782539208022_0.26065031332807775","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@a-fig/accordion","version":"0.1.1","keywords":["pi-package"],"_id":"@a-fig/accordion@0.1.1","maintainers":[{"name":"a-fig","email":"tylerd2474@gmail.com"}],"pi":{"extensions":["./accordion.js"]},"dist":{"shasum":"45cebebae4383fa94ba18b0a121dd887481bdc81","tarball":"https://registry.npmjs.org/@a-fig/accordion/-/accordion-0.1.1.tgz","fileCount":67,"integrity":"sha512-tQ71Ys58lMj1nwXgYAODATA/WjWVqG9PIeexgM9F+BlEWH05ufFgNRiIgBYzMqatYRIldOxblPPCQqrXZnGKBg==","signatures":[{"sig":"MEUCIQDM7qBWIeIPZGU4yEJU8pK9mr6AJI0aRHCqQmyt9Pgs8QIgbFYOYb7exUbMGK+i8BiT0dRrFlcmxpz78bi3zLzXxM0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2370677},"type":"module","gitHead":"1dff8bef457abb44d2f8a4b9e1ce497f80a219e0","scripts":{"build":"npm run build:client && npm run build:extension","smoke":"node smoke.mjs","build:client":"node ./build-client.mjs","build:extension":"node ./build-extension.mjs"},"_npmUser":{"name":"a-fig","email":"tylerd2474@gmail.com"},"_npmVersion":"11.13.0","description":"Accordion live link — a pi extension that streams context to the Accordion GUI and applies the fold plan the GUI returns.","directories":{},"_nodeVersion":"24.17.0","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.7.0","esbuild":"^0.25.0"},"peerDependencies":{"typebox":"*","@earendil-works/pi-ai":"*","@earendil-works/pi-agent-core":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/accordion_0.1.1_1782540387987_0.661536953563536","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@a-fig/accordion","version":"0.1.2","type":"module","description":"Accordion live link — a pi extension that streams context to the Accordion GUI and applies the fold plan the GUI returns.","keywords":["pi-package"],"scripts":{"build:app":"npm --prefix ../app run build","build:extension":"node ./build-extension.mjs","build:client":"node ./build-client.mjs","build":"npm run build:app && npm run build:client && npm run build:extension","prepack":"npm run build && npm run smoke","smoke":"node smoke.mjs"},"pi":{"extensions":["./accordion.js"]},"dependencies":{"ws":"^8.18.0"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*","@earendil-works/pi-agent-core":"*","@earendil-works/pi-ai":"*","typebox":"*"},"devDependencies":{"esbuild":"^0.25.0","jiti":"^2.7.0"},"gitHead":"2bed5bd4a6e954f11f78afa97917425f30f0b0db","_id":"@a-fig/accordion@0.1.2","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-kbTi6yT1QUF9I24zOC2UTl98HfbUH6OGhsBbedqYR4CWJO7n/ItKVXQ+a4eaUIz67JF0umIzbEFmo1ZVLesUpg==","shasum":"d03ffe711ed9ee2ae57d79f094222cd1e146cd2a","tarball":"https://registry.npmjs.org/@a-fig/accordion/-/accordion-0.1.2.tgz","fileCount":67,"unpackedSize":2374384,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD+oAdn1HU2+QM8zRDGxhtIBLOSczQ0Wu8Mhq4HCBlxJQIhAPfrFqfzgF9+hIjwpg0iK52BILDmiLEn8v0Kx9u0jj/e"}]},"_npmUser":{"name":"a-fig","email":"tylerd2474@gmail.com"},"directories":{},"maintainers":[{"name":"a-fig","email":"tylerd2474@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/accordion_0.1.2_1782548263682_0.21256055198609025"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-27T05:46:47.872Z","modified":"2026-06-27T08:17:44.008Z","0.1.0":"2026-06-27T05:46:48.197Z","0.1.1":"2026-06-27T06:06:28.187Z","0.1.2":"2026-06-27T08:17:43.899Z"},"keywords":["pi-package"],"description":"Accordion live link — a pi extension that streams context to the Accordion GUI and applies the fold plan the GUI returns.","maintainers":[{"name":"a-fig","email":"tylerd2474@gmail.com"}],"readme":"<div align=\"center\">\r\n\r\n<picture>\r\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/a-Fig/Accordion/main/docs/assets/logo-lockup-white.png\">\r\n  <img alt=\"Accordion\" src=\"https://raw.githubusercontent.com/a-Fig/Accordion/main/docs/assets/logo-lockup-black.png\" width=\"440\">\r\n</picture>\r\n\r\n### /compact is the naive solution. Accordion is the intelligent one.\r\n\r\n**See everything your AI agent holds in context — and fold it like an accordion instead.**\r\n\r\n<img src=\"https://raw.githubusercontent.com/a-Fig/Accordion/main/docs/assets/accordion-hero.gif\" alt=\"Accordion — the context map demo: blocks folding and unfolding while the protected tail stays intact\" width=\"820\">\r\n\r\n</div>\r\n\r\n---\r\n\r\nAccordion is a [pi](https://github.com/earendil-works/pi) extension that shows you your\r\nagent's entire context window at a glance and lets you manage it — manually or with\r\nintelligence through a **conductor**.\r\n\r\nThis package ships the **pi extension** (the live link that streams context and applies\r\nyour fold plan) plus a **browser-served UI**, so you can run Accordion with `pi install`\r\nalone — no Rust, no desktop app required.\r\n\r\n## Install\r\n\r\n```bash\r\npi install npm:@a-fig/accordion\r\n```\r\n\r\nThat adds the package to `~/.pi/agent/settings.json`. Restart pi, then in any project:\r\n\r\n```bash\r\n/accordion\r\n```\r\n\r\nThe extension HTTP-serves the Accordion UI on a local ephemeral port and prints the URL\r\n(also opens it). The page auto-connects to the running session. Folding is **off by\r\ndefault** — flip the **Folding** toggle in the header to start steering what the agent\r\nsees.\r\n\r\n> **Single session, browser only.** This package serves the UI in your browser for the\r\n> current pi session. For multi-session discovery, conductors that need local model\r\n> resources, and the native window, build the\r\n> [desktop app](https://github.com/a-Fig/Accordion) from source.\r\n\r\n## How it works\r\n\r\nThe **context Map** is the whole window at a glance: one square per block, sized by token\r\nweight (a dice face, 1–6), colored by kind — **user** messages, **assistant** responses,\r\n**thinking**, **tool calls**, and **tool results** each get their own hue. Bright = live;\r\nrecessed and hatched = folded.\r\n\r\nThree hands share the controls:\r\n\r\n- **You** — fold, unfold, pin, and peek by hand. Your overrides always win.\r\n- **The agent** — reaches back to unfold or pin context it needs mid-task, or **recall**\r\n  a folded block as a tool result (like `read_file`) without changing what's standing in\r\n  context.\r\n- **The Conductor** — an automatic strategy that, between turns, folds what's gone cold\r\n  and unfolds what's becoming relevant. Collaborative by default; an *exclusive*\r\n  conductor you approve can take over specific controls, and **detach** is always your\r\n  kill switch.\r\n\r\nEvery block is **Full**, **Folded** (shown as a short tagged summary), or **Pinned**\r\n(locked open). Folds are **content substitution, never removal** — provider-safe and\r\nfully reversible. The most recent ~20k tokens are a **protected working tail** the agent\r\nreasons over at full fidelity.\r\n\r\n<div align=\"center\">\r\n<img src=\"https://raw.githubusercontent.com/a-Fig/Accordion/main/docs/assets/attention-conductor.png\" alt=\"Attention conductor view — each block tinted by how much the working tail still attends back to it\" width=\"600\">\r\n</div>\r\n\r\n## Skills included\r\n\r\nThis package registers two pi skills the agent uses to interact with folded context:\r\n\r\n- **accordion-context-folding** — the `unfold` tool: restore a folded block into standing\r\n  context (sticky, attributed to the agent).\r\n- **accordion-context-recall** — the `recall` tool: read a folded block's full content as\r\n  a tool result *without* mutating the view, like `read_file`. Never lockable.\r\n\r\n## What works today\r\n\r\n- ✅ Browser-served UI — no desktop app required\r\n- ✅ Live link to a running pi session\r\n- ✅ Opt-in live steering — apply your fold plan to what the agent is shown\r\n- ✅ Reversible, provider-safe folding with deterministic `{#code FOLDED}` digests\r\n- ✅ Agent-driven unfold + `recall`, involvement locks\r\n- ✅ The Conductor — automatic fold/unfold between turns\r\n- ✅ LLM-generated summaries, computed once and cached\r\n\r\n## Links\r\n\r\n- **Source & full docs:** [github.com/a-Fig/Accordion](https://github.com/a-Fig/Accordion)\r\n- **Vision:** [VISION.md](https://github.com/a-Fig/Accordion/blob/main/VISION.md)\r\n- **pi (the harness):** [github.com/earendil-works/pi](https://github.com/earendil-works/pi)\r\n\r\n---\r\n\r\n<div align=\"center\">\r\n\r\n🏆 &nbsp;Built at the **AI Hackathon 2026 @ UC Berkeley** — a winning project.\r\n\r\n🪗\r\n\r\n</div>\r\n","readmeFilename":"README.md"}