{"_id":"@dreki-gg/pi-past-chats","_rev":"3-4f42263e89228462afbb16cd41d1c1ec","name":"@dreki-gg/pi-past-chats","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.2":{"name":"@dreki-gg/pi-past-chats","version":"0.1.2","keywords":["pi-package"],"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","_id":"@dreki-gg/pi-past-chats@0.1.2","maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"homepage":"https://github.com/dreki-gg/pi-extensions#readme","bugs":{"url":"https://github.com/dreki-gg/pi-extensions/issues"},"pi":{"extensions":["./extensions/past-chats"]},"dist":{"shasum":"eab53e44ae1d0573848ac10d072701ea9047066a","tarball":"https://registry.npmjs.org/@dreki-gg/pi-past-chats/-/pi-past-chats-0.1.2.tgz","fileCount":15,"integrity":"sha512-qYr8PPq28Z7Q1U7Nes8uVzc0Q9oHAIekrLFFUdvDfS3oZs6+OKOd1fKtS66tHnbmqgfusJ5W+ywuPpbgldrlzA==","signatures":[{"sig":"MEQCICkpspNPi/CHX8dq+AVck+AGpHaMAYn0Jt0m8oiiakSvAiB9p7CQlg86TQWscG9cZ8CiryjPef6aU7pqvQKhyqdx3g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34758},"type":"module","gitHead":"c48ed25bbb6c9b5441dd1fa2184e5b59313f02f0","scripts":{"lint":"oxlint extensions","format":"oxfmt --write extensions","typecheck":"tsc --noEmit","format:check":"oxfmt --check extensions"},"_npmUser":{"name":"jalbarrang","email":"jalbarrandev@gmail.com"},"repository":{"url":"git+https://github.com/dreki-gg/pi-extensions.git","type":"git","directory":"packages/past-chats"},"_npmVersion":"11.12.1","description":"Reference previous pi sessions inline with @chat: and @session: autocomplete","directories":{},"_nodeVersion":"24.12.0","dependencies":{"effect":"^3.21.2"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.43.0","oxlint":"^1.58.0","typescript":"^6.0.0","@types/node":"24"},"peerDependencies":{"typebox":"*","@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"typebox":{"optional":true},"@earendil-works/pi-ai":{"optional":true},"@earendil-works/pi-tui":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-past-chats_0.1.2_1780120969826_0.9304602664008457","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@dreki-gg/pi-past-chats","version":"0.2.0","keywords":["pi-package"],"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","_id":"@dreki-gg/pi-past-chats@0.2.0","maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"homepage":"https://github.com/dreki-gg/pi-extensions#readme","bugs":{"url":"https://github.com/dreki-gg/pi-extensions/issues"},"pi":{"extensions":["./extensions/past-chats"]},"dist":{"shasum":"e76581091f26a17ad0aa364101a9a0e5a3e4aabb","tarball":"https://registry.npmjs.org/@dreki-gg/pi-past-chats/-/pi-past-chats-0.2.0.tgz","fileCount":17,"integrity":"sha512-Cy+uSu8ACdgRe5Ya2Sv7rhhYdNrgVRDKFTqhgrWcV2TtKvLtvHlRd5mVhKJKojRn0iV9mYLV3rRKhCJyCZQNpg==","signatures":[{"sig":"MEUCIQC0+yHVpsvYTAzs+7WYu9yMleLKflX4CMMNItIBrpDsDAIgQCevq4M+oTxUEkB5DFkbCB1EM0Xrdu6frhnZHxqpjZA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreki-gg%2fpi-past-chats@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":41528},"type":"module","gitHead":"9c1c52aec6c1e9674da412c2e6f25dca7cdbf547","scripts":{"lint":"oxlint extensions","format":"oxfmt --write extensions","typecheck":"tsc --noEmit","format:check":"oxfmt --check extensions"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b6cd2f1e-9b63-4b04-964b-b4e85a442fe3"}},"repository":{"url":"git+https://github.com/dreki-gg/pi-extensions.git","type":"git","directory":"packages/past-chats"},"_npmVersion":"11.13.0","description":"Reference previous pi sessions inline with @chat: and @session: autocomplete","directories":{},"_nodeVersion":"24.16.0","dependencies":{"effect":"^3.21.2"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.43.0","oxlint":"^1.58.0","typescript":"^6.0.0","@types/node":"24"},"peerDependencies":{"typebox":"*","@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"typebox":{"optional":true},"@earendil-works/pi-ai":{"optional":true},"@earendil-works/pi-tui":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-past-chats_0.2.0_1780538774651_0.3089195263262172","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dreki-gg/pi-past-chats","version":"0.3.0","description":"Reference previous pi sessions inline with @chat: and @session: autocomplete","keywords":["pi-package"],"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/dreki-gg/pi-extensions.git","directory":"packages/past-chats"},"type":"module","scripts":{"typecheck":"tsc --noEmit","lint":"oxlint extensions","format":"oxfmt --write extensions","format:check":"oxfmt --check extensions"},"pi":{"extensions":["./extensions/past-chats"]},"dependencies":{"effect":"^3.21.2"},"devDependencies":{"@types/node":"24","oxfmt":"^0.43.0","oxlint":"^1.58.0","typescript":"^6.0.0"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*","@earendil-works/pi-tui":"*","typebox":"*"},"peerDependenciesMeta":{"@earendil-works/pi-ai":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true},"@earendil-works/pi-tui":{"optional":true},"typebox":{"optional":true}},"gitHead":"2a5c2d4c52118fec134f8400cb76a86dd1e2ddf2","_id":"@dreki-gg/pi-past-chats@0.3.0","bugs":{"url":"https://github.com/dreki-gg/pi-extensions/issues"},"homepage":"https://github.com/dreki-gg/pi-extensions#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-PriGRt4ThnnFMWDxEBJfOzEmO1K4tuQWqdMK8giGSe3n6RodGSFK0pcUkl54VTFLE4EJO/BOm1VBOS+lcHmPag==","shasum":"30fbd13dae99d189fb0e19f3109cbafc6639e983","tarball":"https://registry.npmjs.org/@dreki-gg/pi-past-chats/-/pi-past-chats-0.3.0.tgz","fileCount":19,"unpackedSize":43989,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dreki-gg%2fpi-past-chats@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG1eMHxPlA1238pFX2iVMSYbcjvQUqxb0b+DP6dIhN4kAiEApOYcML3T6h43FdHyOduwLsm05DCLM5xO6Due+ndAtl0="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b6cd2f1e-9b63-4b04-964b-b4e85a442fe3"}},"directories":{},"maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-past-chats_0.3.0_1781575287897_0.04287622355786125"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-30T06:02:49.666Z","modified":"2026-06-16T02:01:28.411Z","0.1.2":"2026-05-30T06:02:49.981Z","0.2.0":"2026-06-04T02:06:14.798Z","0.3.0":"2026-06-16T02:01:28.041Z"},"bugs":{"url":"https://github.com/dreki-gg/pi-extensions/issues"},"author":{"name":"Juan Albarran","email":"jalbarrandev@gmail.com"},"license":"MIT","homepage":"https://github.com/dreki-gg/pi-extensions#readme","keywords":["pi-package"],"repository":{"type":"git","url":"git+https://github.com/dreki-gg/pi-extensions.git","directory":"packages/past-chats"},"description":"Reference previous pi sessions inline with @chat: and @session: autocomplete","maintainers":[{"name":"jalbarrang","email":"jalbarrandev@gmail.com"}],"readme":"# @dreki-gg/pi-past-chats\n\nReference previous Pi sessions inline with `@chat:` or `@session:`.\n\n## Usage\n\nType either prefix in the Pi editor:\n\n```text\nUse the approach from @chat:\nCompare this with @session:\n```\n\nAutocomplete shows sessions from:\n\n1. the current working directory, and\n2. external folders configured in `.pi/past-chats.json`.\n\nSelecting a suggestion inserts a stable token such as `@chat:9ab12cd34ef0`. When you submit the prompt, the extension injects a hidden context message with:\n\n- session title/name\n- session file path\n- cwd/source folder\n- created/modified dates\n- message count\n- deterministic handoff summary\n- optional cached AI handoff summary when enabled\n\nThe agent can use the injected summary immediately, or read the listed session JSONL file for deeper details.\n\n## Agent tool: `search_past_chats`\n\nThe extension also exposes a tool the agent can call directly to discover relevant prior sessions:\n\n- **Input:** `query` (fuzzy search string) and optional `limit` (default 10).\n- **Scope:** the current working directory plus folders configured in `.pi/past-chats.json` (same index as autocomplete).\n- **Output:** for each match, the session JSONL **file path**, a **snippet** showing why it matched, and a **fuzzy score** (lower is better), sorted best match first.\n\nThe agent then reads any returned path with the built-in `read` tool to inspect the full conversation. This lets the agent narrow down which past chats discussed a topic before pulling in the detail it needs.\n\n## Commands\n\n```text\n/past-chats list\n/past-chats add <path> [label]\n/past-chats remove <label|path>\n/past-chats refresh\n/past-chats summarize @session:<id>\n```\n\nExamples:\n\n```text\n/past-chats add ../api API\n/past-chats add /Users/me/work/mobile Mobile App\n/past-chats list\n```\n\n## Config\n\nProject config lives at:\n\n```text\n.pi/past-chats.json\n```\n\nExample:\n\n```json\n{\n  \"folders\": [\n    { \"path\": \"../api\", \"label\": \"API\" },\n    { \"path\": \"/Users/me/work/mobile\", \"label\": \"Mobile App\" }\n  ],\n  \"summary\": {\n    \"ai\": false,\n    \"provider\": \"openai\",\n    \"model\": \"gpt-5-mini\"\n  }\n}\n```\n\nNotes:\n\n- The current cwd is always included implicitly.\n- Folder paths are resolved relative to the current cwd unless absolute.\n- AI summaries are opt-in with `summary.ai: true` and require a configured provider/model/API key.\n- If AI summary generation fails, the extension falls back to deterministic summaries.\n\n## Cache\n\nAI summaries are cached in:\n\n```text\n.pi/past-chats-cache.json\n```\n\nCache entries are invalidated by session path, modified timestamp, summary version, provider, and model.\n\n## Install\n\n```bash\npi install npm:@dreki-gg/pi-past-chats\n```\n","readmeFilename":"README.md"}