{"_id":"@ar-llm/pi-dir-providers","_rev":"7-89a212b343d2e05450724e0862526e3b","name":"@ar-llm/pi-dir-providers","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@ar-llm/pi-dir-providers","version":"0.1.0","keywords":["pi-package","pi-extension","pi","providers","directory"],"license":"Unlicense","_id":"@ar-llm/pi-dir-providers@0.1.0","maintainers":[{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}],"homepage":"https://github.com/arichiardi/ar-llm/tree/main/extensions/pi-dir-providers#readme","bugs":{"url":"https://github.com/arichiardi/ar-llm/issues"},"pi":{"extensions":["./src/dir-providers.ts"]},"dist":{"shasum":"5576f8bd7f03b5e816a9ab6b5f37ada7f76805ed","tarball":"https://registry.npmjs.org/@ar-llm/pi-dir-providers/-/pi-dir-providers-0.1.0.tgz","fileCount":6,"integrity":"sha512-lO/l+Ka5pJ07l9n8Eyz/Lr+zdTZnfIerg0fHg1q9BwpqaFsGO2RdxKgsfizGfy3aSJiX7ScU0DNJtOOiuDasiw==","signatures":[{"sig":"MEYCIQD3m38EL/xz3qp/b6UF/K5pud0jsPFhrR8ZsDuajIoRuQIhAOF+HDjtSkfKqrcVltKiMVHgKczKZtkhvnFrYCjcR5hq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22268},"type":"module","gitHead":"13cb6449adc4d7383a089a35d94fb33de81b90d6","private":false,"scripts":{"typecheck":"tsc --noEmit"},"_npmUser":{"name":"arichiardi","email":"a.richiardi.work@gmail.com"},"repository":{"url":"git+https://github.com/arichiardi/ar-llm.git","type":"git","directory":"extensions/pi-dir-providers"},"_npmVersion":"11.17.0","description":"Pi extension that scopes the providers visible in /model based on the working directory.","directories":{},"_nodeVersion":"26.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@earendil-works/pi-coding-agent":"0.79.10"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-dir-providers_0.1.0_1785869957269_0.5353107259303027","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ar-llm/pi-dir-providers","version":"0.1.1","keywords":["pi-package","pi-extension","pi","providers","directory"],"license":"Unlicense","_id":"@ar-llm/pi-dir-providers@0.1.1","maintainers":[{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}],"homepage":"https://github.com/arichiardi/ar-llm/tree/main/extensions/pi-dir-providers#readme","bugs":{"url":"https://github.com/arichiardi/ar-llm/issues"},"pi":{"extensions":["./src/dir-providers.ts"]},"dist":{"shasum":"ded38a552af9dc78383032a71d67629e6e3a20ea","tarball":"https://registry.npmjs.org/@ar-llm/pi-dir-providers/-/pi-dir-providers-0.1.1.tgz","fileCount":10,"integrity":"sha512-jk5y+KNMvLFoR8WPzvMC86ciiwCtLg/JWj/hP0WMu+nENRYkX7BFu0ADaksu0ZMBEsZVCn8773nsD+sQsj3/bA==","signatures":[{"sig":"MEYCIQDa3SSQRrqhjfepfgSJaAb7tyG5JcFT3OWEMrkan/htrAIhALsBZOqucSudMGpp6OTA4jh1poC83+adHFzgIcwqrEV5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35255},"type":"module","engines":{"node":">=22.6.0"},"gitHead":"2d45473f877cb8b890eaaac01833426b8cf10596","private":false,"scripts":{"test":"node --import ./test/register.mjs --test test/match.test.ts test/config.test.ts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arichiardi","email":"a.richiardi.work@gmail.com"},"repository":{"url":"git+https://github.com/arichiardi/ar-llm.git","type":"git","directory":"extensions/pi-dir-providers"},"_npmVersion":"11.17.0","description":"Pi extension that scopes the providers visible in /model based on the working directory.","directories":{},"_nodeVersion":"26.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@earendil-works/pi-coding-agent":"0.79.10"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-dir-providers_0.1.1_1785939290920_0.48394886049384866","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@ar-llm/pi-dir-providers","version":"0.1.2","keywords":["pi-package","pi-extension","pi","providers","directory"],"license":"Unlicense","_id":"@ar-llm/pi-dir-providers@0.1.2","maintainers":[{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}],"homepage":"https://github.com/arichiardi/ar-llm/tree/main/extensions/pi-dir-providers#readme","bugs":{"url":"https://github.com/arichiardi/ar-llm/issues"},"pi":{"extensions":["./src/dir-providers.ts"]},"dist":{"shasum":"803a0a047f240210f2b28709b72ccc8bb8c6cbbe","tarball":"https://registry.npmjs.org/@ar-llm/pi-dir-providers/-/pi-dir-providers-0.1.2.tgz","fileCount":10,"integrity":"sha512-B4m1NItszDbzi/XFsOVbVwffgbOIWU56EaZZvGHIYrS+zRH3iVbySWnTrrJqTO00AfUrWevvp8x+p1KTlhD//Q==","signatures":[{"sig":"MEUCIGS33jofDR66KQIhytn5eha8VU2T1ndjjpx0N2850APlAiEA3y9SoCFohXHsRUUwXxx8bAx0oQPDlYKfuzeQJmJJYPg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37387},"type":"module","engines":{"node":">=22.6.0"},"gitHead":"ee543f8ec296916ca1a3e213c71d9e1ac0bebf75","private":false,"scripts":{"test":"node --import ./test/register.mjs --test test/match.test.ts test/config.test.ts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arichiardi","email":"a.richiardi.work@gmail.com"},"repository":{"url":"git+https://github.com/arichiardi/ar-llm.git","type":"git","directory":"extensions/pi-dir-providers"},"_npmVersion":"11.17.0","description":"Pi extension that scopes the providers visible in /model based on the working directory.","directories":{},"_nodeVersion":"26.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@earendil-works/pi-coding-agent":"0.79.10"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-dir-providers_0.1.2_1785939314598_0.07042744317432392","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@ar-llm/pi-dir-providers","version":"0.1.3","keywords":["pi-package","pi-extension","pi","providers","directory"],"license":"Unlicense","_id":"@ar-llm/pi-dir-providers@0.1.3","maintainers":[{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}],"homepage":"https://github.com/arichiardi/ar-llm/tree/main/extensions/pi-dir-providers#readme","bugs":{"url":"https://github.com/arichiardi/ar-llm/issues"},"pi":{"extensions":["./src/dir-providers.ts"]},"dist":{"shasum":"2b483bfcb40c3929d82ad8295b6a9a07f65073cf","tarball":"https://registry.npmjs.org/@ar-llm/pi-dir-providers/-/pi-dir-providers-0.1.3.tgz","fileCount":10,"integrity":"sha512-35Hcd2mVQ/qMnMNst1tQNOqK6DLHx3FbWC/7w+/uVy/oqi0xYexttEpfkOi1XiLA59pZ7w9XwRYG1MVbrPixHA==","signatures":[{"sig":"MEUCIQCtR0/3nYMoVp/SBOdBdm7pUW5W/EuUQmZxX5Oc/uopYgIgfhmr8n1lNkrDdxDl805bkuo0Quszyq8w/VYJ5wCYyIM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37387},"type":"module","engines":{"node":">=22.6.0"},"gitHead":"391f9fb39b54b56a6ef0b83616c287c7aeddbd5f","private":false,"scripts":{"test":"node --import ./test/register.mjs --test test/match.test.ts test/config.test.ts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arichiardi","email":"a.richiardi.work@gmail.com"},"repository":{"url":"git+https://github.com/arichiardi/ar-llm.git","type":"git","directory":"extensions/pi-dir-providers"},"_npmVersion":"11.17.0","description":"Pi extension that scopes the providers visible in /model based on the working directory.","directories":{},"_nodeVersion":"26.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@earendil-works/pi-coding-agent":"0.79.10"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-dir-providers_0.1.3_1785945790160_0.6727722385506991","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@ar-llm/pi-dir-providers","version":"0.1.5","keywords":["pi-package","pi-extension","pi","providers","directory"],"license":"Unlicense","_id":"@ar-llm/pi-dir-providers@0.1.5","maintainers":[{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}],"homepage":"https://github.com/arichiardi/ar-llm/tree/main/extensions/pi-dir-providers#readme","bugs":{"url":"https://github.com/arichiardi/ar-llm/issues"},"pi":{"extensions":["./src/dir-providers.ts"]},"dist":{"shasum":"00d4c4fd5bdaa984ad36f861c4617caa6d85ef98","tarball":"https://registry.npmjs.org/@ar-llm/pi-dir-providers/-/pi-dir-providers-0.1.5.tgz","fileCount":10,"integrity":"sha512-0UgI7lh4krHAouUt47dlG77Td/vDMqeaqbpDAuvoa19RPXi1LGekSk5t63rGNJP9s++B9k8fp3/zSbZmFVnUCA==","signatures":[{"sig":"MEUCIQDidRg6js8twdKSk+0OoQPqbBr6TSiailWSl/PNhOr67AIgQw9X222gjS8HQvufdu0w1DK73JmbNHRyK2uVNW4Wx1s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39292},"type":"module","engines":{"node":">=22.6.0"},"gitHead":"70d877edbb04e69dfb3735f83cb2f9afc858dff5","private":false,"scripts":{"test":"node --import ./test/register.mjs --test test/match.test.ts test/config.test.ts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arichiardi","email":"a.richiardi.work@gmail.com","approver":{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}},"repository":{"url":"git+https://github.com/arichiardi/ar-llm.git","type":"git","directory":"extensions/pi-dir-providers"},"_npmVersion":"11.17.0","description":"Pi extension that scopes the providers visible in /model based on the working directory.","directories":{},"_nodeVersion":"26.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@earendil-works/pi-coding-agent":"0.79.10"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-dir-providers_0.1.5_1785952608932_0.1699625902432833","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ar-llm/pi-dir-providers","version":"0.2.0","keywords":["pi-package","pi-extension","pi","providers","directory"],"license":"Unlicense","_id":"@ar-llm/pi-dir-providers@0.2.0","maintainers":[{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}],"homepage":"https://github.com/arichiardi/ar-llm/tree/main/extensions/pi-dir-providers#readme","bugs":{"url":"https://github.com/arichiardi/ar-llm/issues"},"pi":{"extensions":["./src/dir-providers.ts"]},"dist":{"shasum":"b45900daf3733dd5a33fba8a9b78d2db2e84d156","tarball":"https://registry.npmjs.org/@ar-llm/pi-dir-providers/-/pi-dir-providers-0.2.0.tgz","fileCount":10,"integrity":"sha512-TVAXTBYr3XJUTChhbgJjNKUnbEtM2S/TGF0Wo0Y1HgTh3K9RO9cO6Cx3wtTQI5vkbj8nRVGpB4Vkb3fmWJIvrg==","signatures":[{"sig":"MEUCIQDKEclc3FZG7oLs1NkG8Mw4kbs2uLDUS9NvsYgqMtGEUAIgT2q1JaZJ1rL+ZRgWTh819M9gsOB4snodtarLg15Ms/w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40667},"type":"module","engines":{"node":">=22.6.0"},"gitHead":"1e2473ce72a81be04be43871829923de213388ca","private":false,"scripts":{"test":"node --import ./test/register.mjs --test test/match.test.ts test/config.test.ts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"arichiardi","email":"a.richiardi.work@gmail.com","approver":{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}},"repository":{"url":"git+https://github.com/arichiardi/ar-llm.git","type":"git","directory":"extensions/pi-dir-providers"},"_npmVersion":"12.0.2","description":"Pi extension that scopes the providers visible in /model based on the working directory.","directories":{},"_nodeVersion":"26.5.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@earendil-works/pi-coding-agent":"0.79.10"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-dir-providers_0.2.0_1787864554441_0.7339695554525512","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"pi":{"extensions":["./src/dir-providers.ts"]},"_id":"@ar-llm/pi-dir-providers@0.2.1","bugs":{"url":"https://github.com/arichiardi/ar-llm/issues"},"dist":{"shasum":"ddfa0d927d3b242a4981bef3297cb037db739c41","tarball":"https://registry.npmjs.org/@ar-llm/pi-dir-providers/-/pi-dir-providers-0.2.1.tgz","integrity":"sha512-Gdaeo45pdSo/jjo310PvFsdyf9Yx/jRGSYey3GehtFdw1AX4g4xDmp0iSRAmg/HQWNuHKzOPvznYAkZMT9hXTA==","fileCount":12,"unpackedSize":46432,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDOJ89N9Lg8Pw8t7EPpvNDZK2xL/DrsdtF7awCV7TwOQwIgRa/r47uaySRuhOogbiKkyQ/gEHx286b84fj/SoaRYO8="}]},"name":"@ar-llm/pi-dir-providers","type":"module","engines":{"node":">=22.6.0"},"gitHead":"abdcc66df785195d7197b28b7d86dad195a351ce","license":"Unlicense","private":false,"scripts":{"test":"node --import ./test/register.mjs --test test/match.test.ts test/config.test.ts test/providers.test.ts","typecheck":"tsc --noEmit"},"version":"0.2.1","_npmUser":{"name":"arichiardi","email":"a.richiardi.work@gmail.com","approver":{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}},"homepage":"https://github.com/arichiardi/ar-llm/tree/main/extensions/pi-dir-providers#readme","keywords":["pi-package","pi-extension","pi","providers","directory"],"repository":{"url":"git+https://github.com/arichiardi/ar-llm.git","type":"git","directory":"extensions/pi-dir-providers"},"_npmVersion":"12.0.2","description":"Pi extension that scopes the providers visible in /model based on the working directory.","directories":{},"maintainers":[{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}],"_nodeVersion":"26.5.0","devDependencies":{"typescript":"^6.0.3","@types/node":"^25.6.0","@earendil-works/pi-coding-agent":"0.79.10"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-dir-providers_0.2.1_1789408309234_0.5038777689255112"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-04T18:59:17.124Z","modified":"2026-09-14T17:51:49.476Z","0.1.0":"2026-08-04T18:59:17.434Z","0.1.1":"2026-08-05T14:14:51.064Z","0.1.2":"2026-08-05T14:15:14.766Z","0.1.3":"2026-08-05T16:03:10.392Z","0.1.5":"2026-08-05T17:56:49.017Z","0.2.0":"2026-08-27T21:02:34.576Z","0.2.1":"2026-09-14T17:51:49.359Z"},"bugs":{"url":"https://github.com/arichiardi/ar-llm/issues"},"license":"Unlicense","homepage":"https://github.com/arichiardi/ar-llm/tree/main/extensions/pi-dir-providers#readme","keywords":["pi-package","pi-extension","pi","providers","directory"],"repository":{"url":"git+https://github.com/arichiardi/ar-llm.git","type":"git","directory":"extensions/pi-dir-providers"},"description":"Pi extension that scopes the providers visible in /model based on the working directory.","maintainers":[{"name":"arichiardi","email":"a.richiardi.work@gmail.com"}],"readme":"# @ar-llm/pi-dir-providers\n\n[![npm](https://img.shields.io/npm/v/@ar-llm/pi-dir-providers)](https://www.npmjs.com/package/@ar-llm/pi-dir-providers) [![Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](./LICENSE)\n\nPi extension that scopes which providers are visible in `/model` based on the\nworking directory. In `~/git` you may only want `anthropic` and `openrouter` —\n`github-copilot` and everything else disappear from model\nselection entirely.\n\n## Install\n\n```bash\npi install 'npm:@ar-llm/pi-dir-providers'\n```\n\nOr try without installing:\n\n```bash\npi -e 'npm:@ar-llm/pi-dir-providers'\n```\n\n## Config\n\nCreate `<agentDir>/ar-llm/dir-providers.json` (same convention as\n`pi-custom-compaction`; `<agentDir>` is `$PI_CODING_AGENT_DIR` or\n`~/.config/pi/agent`):\n\n```json\n{\n  \"rules\": [\n    {\n      \"dirs\": [\"~/git\"],\n      \"allowedProviders\": [\"anthropic\", \"openrouter\"],\n      \"defaultModel\": \"anthropic/claude-sonnet-4-5\"\n    },\n    {\n      \"dirs\": [\"~/git/acme-corp\", \"~/work/acme-corp\"],\n      \"allowedProviders\": [\"anthropic\"],\n      \"providers\": {\n        \"anthropic\": { \"baseUrl\": \"https://anthropic-proxy.acme.com/v1\" }\n      }\n    }\n  ]\n}\n```\n\n### Rule ordering (important!)\n\nRules are applied **strictly in array order** — not by specificity. Every rule\nwhose `dirs` match the current working directory applies; for `allowedProviders`\nand `defaultModel`, **the last matching rule wins** (its value replaces any\nearlier rule's value). The `providers` field is different: overrides from all\nmatching rules are **merged** together per provider id.\n\n> **You must order rules from least specific to most specific.** Put the broadest\n> directory rules first and the narrowest (most specific) directory rules last.\n> If you reverse this order, a generic rule will silently override a specific\n> one. For example, with rules `[{dirs: [\"~/git/managing-construction\"], allowedProviders: [\"github-copilot\"]}, {dirs: [\"~/git\"], allowedProviders: [\"openrouter\"]}]`, running in\n> `~/git/managing-construction/gossamer` matches **both** rules, and the second\n> rule's `openrouter` wins — `github-copilot` gets hidden. The correct order is\n> to swap them so `~/git` comes first and `~/git/managing-construction` comes\n> second.\n\n- `dirs`: list of directory subtrees. A leading `~` is expanded; a directory\n  matches when the cwd equals it or is inside it (subdirectories inherit their\n  ancestor's rules; a more-specific rule then overrides on top). Directory\n  paths are symlink-resolved, so `/tmp` on macOS (which resolves to\n  `/private/tmp`) matches the physical cwd. Nonexistent or inaccessible\n  directories warn at startup and match as-is; point the rule at the real\n  resolved path.\n- `allowedProviders`: **replaces** the effective set of visible providers.\n  Providers outside the set are hidden from `/model` (their models are removed\n  for the session; auth/`/login` state is untouched).\n- `defaultModel`: `\"provider/model-id\"` applied to fresh sessions when the\n  current model differs. Skipped when `--model`/`--provider` was passed on the\n  command line. Note that switching the model persists the choice to\n  `settings.json`, exactly like picking a model manually in `/model`.\n- `providers`: per-provider overrides with `models.json` override semantics\n  (e.g. `baseUrl`, `headers`), merged across matching rules per provider id.\n\nIf no rule matches, the extension does nothing.\n\n## Disable marker\n\nCreate a `.pi-dir-providers-disable` file in any directory to disable the\nextension for that directory and all its subdirectories. This is useful when\nyou want to temporarily bypass provider restrictions without modifying the\nconfig file.\n\n- The marker is checked in the current directory and all parent directories\n- When found, the extension becomes a no-op: no providers are hidden\n- The `/dir-providers` command reports \"disabled by .pi-dir-providers-disable marker file\"\n- Remove the file to re-enable the extension\n\n## How it works\n\nHiding happens at extension-factory time — before pi selects the initial\nmodel\n— by registering a `models: []` overlay on each disallowed provider via\n`pi.registerProvider()`. This goes through pi's normal provider-composition\npath and is **in-memory only**: nothing on disk is touched, and `/reload` or a\nnew pi process restores the default provider set.\n\nProvider overrides (`baseUrl`, `headers`, extra fields, `models`) are applied\nthe same way — as a `registerProvider` overlay — and are therefore also\nin-memory and reversible. A `models` field in an override replaces the\nprovider's model set (like `models.json`), whereas an override object without\n`models` only tweaks connection fields and keeps the provider's existing models.\n\n## Validation\n\n- Missing config file, invalid JSON, or a missing `rules` array disable the\n  extension (it stays a no-op).\n- Per-rule problems (empty `dirs`, relative dirs, duplicate dirs across rules,\n  nonexistent dirs, malformed `defaultModel`, `defaultModel` provider not in\n  the rule's `allowedProviders`) produce warnings and skip the offending part.\n- Unknown provider ids in `allowedProviders` warn at startup; check actual ids\n  with `pi --list-models`. Builtin providers plus those declared in the agent\n  dir's `models.json` and `models-store.json` are recognized.\n- If a later rule's directory is a **parent** of an earlier rule's directory (i.e.\n  the broad rule appears after the narrow one), a warning is emitted at startup:\n  the parent rule's `allowedProviders`/`defaultModel` will silently override the\n  child rule's, and reordering is needed to fix it.\n\n## Commands\n\n- `/dir-providers` — print the effective profile for the current directory:\n  matched rule indices, allowed providers, default model, and merged provider\n  overrides. The TUI status bar also shows the active provider set\n  (`dir-providers: providers: ...`) whenever the extension is active.\n\n  Config-loading warnings (nonexistent/inaccessible dirs, unknown providers,\n  rule shadowing) are **not** printed to stderr by default — they would only\n  appear before the TUI starts, where they're invisible. Instead they are\n  captured and surfaced as a `Warning:` notification in the TUI at\n  `session_start`, so they are always visible when running interactively.\n\n  For headless or non-TUI runs (or to debug startup behavior), set\n  `PI_DIR_PROVIDERS_DEBUG=1`: diagnostics are written to\n  `$TMPDIR/ar-llm/dir-providers.log` (never stderr).\n\n## Debug\n\nThe extension is quiet on stderr by default — diagnostics are routed to the\nTUI instead. To inspect raw startup behavior (e.g. for headless runs or to\nconfirm which rules/providers resolved), enable verbose logging:\n\n```bash\nPI_DIR_PROVIDERS_DEBUG=1 pi ...\n```\n\nDiagnostics are written to `$TMPDIR/ar-llm/dir-providers.log`, including:\n- The `[dir-providers] Active in <cwd>: rules ..., allowed [...], hid N providers`\n  status line.\n- All captured config warnings (EPERM, unknown providers, rule shadowing).\n\n## Development\n\n```bash\nmake typecheck   # type-check source + tests\nmake test        # run unit tests (26 checks across match.ts and config.ts)\nmake test-watch  # same as `make test` but re-runs on file changes\n```\n\nTests use Node.js's built-in `node:test` runtime — no external test runner\nis required (Node ≥ 22.6). The `test/` directory contains a small ESM loader\n(`loader.mjs` + `register.mjs`) that maps NodeNext-style `.js` imports\nto their `.ts` source files so they can be imported without a build step.\n\n## Limitations\n\n- Providers registered by *other* extensions are not enumerated and cannot be\n  hidden.\n- Directory globs are not supported; use explicit directory subtrees.\n- The profile is computed once per pi process from the startup cwd.\n\n## License\n\n[The Unlicense](./LICENSE) — public domain. Original work.\n","readmeFilename":"README.md"}