{"_id":"@alasano/pi-extra-context","_rev":"2-2cbba15acc3857d7c05a9ab9ebf3fc7a","name":"@alasano/pi-extra-context","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@alasano/pi-extra-context","version":"0.1.0","keywords":["pi-package"],"license":"MIT","_id":"@alasano/pi-extra-context@0.1.0","maintainers":[{"name":"alasano","email":"aljosa.a@gmail.com"}],"homepage":"https://github.com/alasano/house-of-pi#readme","bugs":{"url":"https://github.com/alasano/house-of-pi/issues"},"pi":{"image":"https://raw.githubusercontent.com/alasano/house-of-pi/master/packages/pi-extra-context/assets/screenshot.png","extensions":["./extensions"]},"dist":{"shasum":"b4b13bdeb6e46c79937e3d624f6b0f4c54df4487","tarball":"https://registry.npmjs.org/@alasano/pi-extra-context/-/pi-extra-context-0.1.0.tgz","fileCount":4,"integrity":"sha512-22Iz1IdvYXWKwlocXLaiwmY5sQumsNYEH/nCR3IhyRaCLOiPDNxKoX+nASSGNDQH4vO0Ai4tzJeIpnWHGME33Q==","signatures":[{"sig":"MEUCIAK8Evn0q7PMlKMCzxMIzphG+ck18FhGDKd7OTJ0SHJdAiEAjV8qQwRugXbJGcDxxyztK1GCP/ZEkNZNvozEQuLCb5E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":116375},"type":"module","engines":{"node":">=22.17.0"},"gitHead":"445e375e8483569fe709ff44a433deceef856844","scripts":{"typecheck":"tsc --noEmit"},"_npmUser":{"name":"alasano","email":"aljosa.a@gmail.com"},"repository":{"url":"git+https://github.com/alasano/house-of-pi.git","type":"git","directory":"packages/pi-extra-context"},"_npmVersion":"11.12.1","description":"Load extra configured context files into pi sessions","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@mariozechner/pi-coding-agent":"^0.65.0"},"peerDependencies":{"@mariozechner/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-extra-context_0.1.0_1777329863354_0.5145123026174792","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@alasano/pi-extra-context","version":"0.1.1","description":"Load extra configured context files into pi sessions","keywords":["pi-package"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/alasano/house-of-pi.git","directory":"packages/pi-extra-context"},"type":"module","engines":{"node":">=22.17.0"},"scripts":{"typecheck":"tsc --noEmit"},"pi":{"extensions":["./extensions"],"image":"https://raw.githubusercontent.com/alasano/house-of-pi/master/packages/pi-extra-context/assets/screenshot.png"},"peerDependencies":{"@earendil-works/pi-coding-agent":">=0.79.9"},"devDependencies":{"@earendil-works/pi-coding-agent":"^0.79.9"},"gitHead":"aab77744fa8e9cfe0de2b9d46bd220fa60f22278","_id":"@alasano/pi-extra-context@0.1.1","bugs":{"url":"https://github.com/alasano/house-of-pi/issues"},"homepage":"https://github.com/alasano/house-of-pi#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-3YcXPEL4OwvzaMni2HlhQMjQFS29wdDqxGufiH6KpXoHopqpYZ6wdDOR40LjkCuZXaIf3CRY4opUdFCUYMvCLw==","shasum":"f380a1a75acd6132659844bb3c6123be1d8e5cdb","tarball":"https://registry.npmjs.org/@alasano/pi-extra-context/-/pi-extra-context-0.1.1.tgz","fileCount":4,"unpackedSize":116388,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alasano%2fpi-extra-context@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCjmkj3qpepJPyLRJsG5Hrl9ZT/8/uzqpc3qQ+sre3CQgIhALzrkcZnJrX3w7PsgPxSjjzkPCPOMDscf/gd9vBz3yfG"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d4907a62-679f-414c-8b94-5ec38d8b1e57"}},"directories":{},"maintainers":[{"name":"alasano","email":"aljosa.a@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-extra-context_0.1.1_1782010702958_0.8983852599732651"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-27T22:44:23.279Z","modified":"2026-06-21T02:58:23.330Z","0.1.0":"2026-04-27T22:44:23.501Z","0.1.1":"2026-06-21T02:58:23.097Z"},"bugs":{"url":"https://github.com/alasano/house-of-pi/issues"},"license":"MIT","homepage":"https://github.com/alasano/house-of-pi#readme","keywords":["pi-package"],"repository":{"type":"git","url":"git+https://github.com/alasano/house-of-pi.git","directory":"packages/pi-extra-context"},"description":"Load extra configured context files into pi sessions","maintainers":[{"name":"alasano","email":"aljosa.a@gmail.com"}],"readme":"# pi-extra-context\n\n![pi-extra-context screenshot](assets/screenshot.png)\n\nLoad extra configured context files into [pi](https://pi.dev) sessions.\n\n`pi-extra-context` is a small extension for adding project, ancestor, global, or absolute Markdown/text files to the system prompt alongside Pi's built-in `AGENTS.md` / `CLAUDE.md` context.\n\n## Install\n\n```bash\npi install npm:@alasano/pi-extra-context\n```\n\n## Configuration\n\nCreate one or both config files:\n\n| Path                                           | Scope         |\n| ---------------------------------------------- | ------------- |\n| `~/.pi/agent/extensions/pi-extra-context.json` | Global        |\n| `.pi/pi-extra-context.json`                    | Project-local |\n\nGlobal and project configs are merged. File entries are appended in this order:\n\n1. global config files\n2. project config files\n\nProject config values override global values for limits like `maxBytesPerFile` and `maxTotalBytes`.\n\n### Example: load `CLAUDE.local.md`\n\n```json\n{\n  \"files\": [\n    {\n      \"path\": \"CLAUDE.local.md\",\n      \"mode\": \"ancestor\",\n      \"optional\": true\n    }\n  ]\n}\n```\n\nWith `mode: \"ancestor\"`, the extension walks from the filesystem root to the current working directory and loads matching files parent-first. This mirrors Pi's built-in parent-directory context behavior, but for files you choose.\n\n### Example: load project rules and global notes\n\n```json\n{\n  \"files\": [\n    {\n      \"path\": \".cursor/rules/*.md\",\n      \"mode\": \"project\",\n      \"optional\": true\n    },\n    {\n      \"path\": \"local-context/**/*.md\",\n      \"mode\": \"global\",\n      \"optional\": true\n    },\n    {\n      \"path\": \"~/Notes/pi/**/*.md\",\n      \"mode\": \"absolute\",\n      \"optional\": true\n    }\n  ],\n  \"maxBytesPerFile\": 50000,\n  \"maxTotalBytes\": 200000\n}\n```\n\n## File entries\n\nEach file entry supports:\n\n| Field      | Type      | Default     | Description                              |\n| ---------- | --------- | ----------- | ---------------------------------------- |\n| `path`     | `string`  | required    | File path or glob pattern                |\n| `mode`     | `string`  | `\"project\"` | How to resolve `path`                    |\n| `optional` | `boolean` | `true`      | Whether missing matches should be silent |\n\nString shorthand is also supported:\n\n```json\n{\n  \"files\": [\"docs/project-context.md\"]\n}\n```\n\nString entries are treated as project-relative and optional.\n\n## Modes\n\n| Mode       | Resolution behavior                                     |\n| ---------- | ------------------------------------------------------- |\n| `project`  | Resolve `path` relative to the current Pi working dir   |\n| `ancestor` | Apply `path` at every ancestor from root to current dir |\n| `global`   | Resolve `path` relative to `~/.pi/agent`                |\n| `absolute` | Resolve `path` as an absolute or `~`-prefixed path      |\n\nPaths may use Node's built-in glob syntax. This package requires Node `>=22.17.0`, where `fsPromises.glob()` is stable.\n\n## Limits\n\nDefaults:\n\n```json\n{\n  \"maxBytesPerFile\": 50000,\n  \"maxTotalBytes\": 200000\n}\n```\n\nFiles exceeding `maxBytesPerFile` are skipped. Files that would exceed `maxTotalBytes` are also skipped. Skipped files appear in `/pi-extra-context status`.\n\n## Commands\n\n| Command                    | Description                             |\n| -------------------------- | --------------------------------------- |\n| `/pi-extra-context`        | Show current status                     |\n| `/pi-extra-context status` | Show loaded files, limits, and warnings |\n| `/pi-extra-context reload` | Reread config and context files         |\n\nPi also reloads the extension on `/reload`, so config and files are reread then as well.\n\n## How it works\n\nOn session start and `/reload`, the extension:\n\n1. reads global and project config\n2. resolves configured files and glob patterns\n3. deduplicates files by real path\n4. enforces byte limits\n5. caches file contents in memory\n\nBefore each agent turn, it appends the cached contents to the system prompt. It does **not** reread files every turn and does **not** append messages to the conversation transcript.\n\n## Limitations\n\nPi's extension API does not currently allow extensions to contribute native context files through `resources_discover`. As a result, `pi-extra-context` appends cached content to the system prompt rather than registering files in Pi's native `AGENTS.md` / `CLAUDE.md` context-file list.\n","readmeFilename":"README.md"}