{"_id":"@arcanemachine/pi-model-switcher","_rev":"5-e4e69b8f288ce47600dd0fce4975e5b0","name":"@arcanemachine/pi-model-switcher","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@arcanemachine/pi-model-switcher","version":"0.1.0","keywords":["pi","pi-coding-agent","pi-extension","pi-package","model-switching"],"author":{"name":"Nicholas Moen"},"license":"MIT","_id":"@arcanemachine/pi-model-switcher@0.1.0","maintainers":[{"name":"arcanemachine","email":"arcanemachine@gmail.com"}],"homepage":"https://github.com/arcanemachine/pi-model-switcher#readme","bugs":{"url":"https://github.com/arcanemachine/pi-model-switcher/issues"},"pi":{"image":"https://raw.githubusercontent.com/arcanemachine/pi-model-switcher/main/logo.jpg","extensions":["./src/index.ts"]},"dist":{"shasum":"d08c155d1b707687620c1d91f0df7666ef9458dc","tarball":"https://registry.npmjs.org/@arcanemachine/pi-model-switcher/-/pi-model-switcher-0.1.0.tgz","fileCount":6,"integrity":"sha512-EDh3uvj+MFb8QfTe1L6mBqiNFwf+jJCzeBcHQi89lIzHgALrMzGh6G8zY5iItQeft+rW07F339remcbR4csowA==","signatures":[{"sig":"MEYCIQDCsIckSgI8PJqMfQOcv1v9sJpJce3zcePYc6bTz+dNDAIhAJXfVFulSgSyldCPPAqlY6oPQeyauMlvWsDuwfftyWdP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109368},"type":"module","engines":{"node":">=22.19.0"},"gitHead":"f1666a555d0856c082499d45b6cf9392b1bfb714","scripts":{"test":"vitest run --exclude '**/dist/**' tests","build":"tsc","format":"prettier --write src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","typecheck":"tsc --noEmit","format:check":"prettier --check src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","prepublishOnly":"npm run format:check && npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"arcanemachine","email":"arcanemachine@gmail.com"},"repository":{"url":"git+https://github.com/arcanemachine/pi-model-switcher.git","type":"git"},"_npmVersion":"11.13.0","description":"User-authorized agent model switching for Pi sessions","directories":{},"_nodeVersion":"24.16.0","dependencies":{"typebox":"1.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.6","prettier":"^3.8.3","typescript":"^5.9.3","@types/node":"^25.3.3","@earendil-works/pi-ai":"0.84.1","@earendil-works/pi-tui":"0.84.1","@earendil-works/pi-coding-agent":"0.84.1"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-ai":{"optional":true},"@earendil-works/pi-tui":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-model-switcher_0.1.0_1787960871502_0.8798506269066397","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@arcanemachine/pi-model-switcher","version":"0.1.1","keywords":["pi","pi-coding-agent","pi-extension","pi-package","model-switching"],"author":{"name":"Nicholas Moen"},"license":"MIT","_id":"@arcanemachine/pi-model-switcher@0.1.1","maintainers":[{"name":"arcanemachine","email":"arcanemachine@gmail.com"}],"homepage":"https://github.com/arcanemachine/pi-model-switcher#readme","bugs":{"url":"https://github.com/arcanemachine/pi-model-switcher/issues"},"pi":{"image":"https://raw.githubusercontent.com/arcanemachine/pi-model-switcher/main/logo.jpg","extensions":["./src/index.ts"]},"dist":{"shasum":"6efcfdde325883134b341f2b60c417c2e9be2486","tarball":"https://registry.npmjs.org/@arcanemachine/pi-model-switcher/-/pi-model-switcher-0.1.1.tgz","fileCount":6,"integrity":"sha512-BGJYXUog8kEH25OTRI+LReepu6q50SG2CK3nmk+lbHufXo6M32O9AY+LQDQ9fJZzMtaArFosBHcrP39tpcFWgg==","signatures":[{"sig":"MEUCIQCWAkK8DGEvFkbPCoixt+VNKoFu07HRlHcG57Z9f05jlwIgGpJZoycbotQpfF3IuknAGwY9Mg1NxVfopdbCIJYPrTs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109447},"type":"module","engines":{"node":">=22.19.0"},"gitHead":"60c26db3dfc9993242f620869ac3450f5e32c59e","scripts":{"test":"vitest run --exclude '**/dist/**' tests","build":"tsc","format":"prettier --write src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","typecheck":"tsc --noEmit","format:check":"prettier --check src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","prepublishOnly":"npm run format:check && npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"arcanemachine","email":"arcanemachine@gmail.com"},"repository":{"url":"git+https://github.com/arcanemachine/pi-model-switcher.git","type":"git"},"_npmVersion":"11.13.0","description":"User-authorized agent model switching for Pi sessions","directories":{},"_nodeVersion":"24.16.0","dependencies":{"typebox":"1.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.6","prettier":"^3.8.3","typescript":"^5.9.3","@types/node":"^25.3.3","@earendil-works/pi-ai":"0.84.1","@earendil-works/pi-tui":"0.84.1","@earendil-works/pi-coding-agent":"0.84.1"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-ai":{"optional":true},"@earendil-works/pi-tui":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-model-switcher_0.1.1_1788479898450_0.9317420460009207","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@arcanemachine/pi-model-switcher","version":"0.1.2","keywords":["pi","pi-coding-agent","pi-extension","pi-package","model-switching"],"author":{"name":"Nicholas Moen"},"license":"MIT","_id":"@arcanemachine/pi-model-switcher@0.1.2","maintainers":[{"name":"arcanemachine","email":"arcanemachine@gmail.com"}],"homepage":"https://github.com/arcanemachine/pi-model-switcher#readme","bugs":{"url":"https://github.com/arcanemachine/pi-model-switcher/issues"},"pi":{"image":"https://raw.githubusercontent.com/arcanemachine/pi-model-switcher/main/logo.jpg","extensions":["./src/index.ts"]},"dist":{"shasum":"e797f9267df9fa71451f92f29f3f36642f9e30b3","tarball":"https://registry.npmjs.org/@arcanemachine/pi-model-switcher/-/pi-model-switcher-0.1.2.tgz","fileCount":6,"integrity":"sha512-/1YIDu8OMvVdN1V+vWv0F2++CuVliTGg5N/W9ZFNfgEF99FsQz0tv6OWVn+/bT4cJ02CNjFjzFol0sZEMqmD8g==","signatures":[{"sig":"MEQCIEqsPW30G0SYYXjfmr4MgJlyv3U2TKdDbHPzXk0EFI5+AiBK7LHNbMtt2/ToV2DO1zQdA8JdDnUp2exN1OVu9sWWEQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":110085},"type":"module","engines":{"node":">=22.19.0"},"gitHead":"bc6e46643312ac1b9ba32626696c7f24dea1c9c5","scripts":{"test":"vitest run --exclude '**/dist/**' tests","build":"tsc","format":"prettier --write src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","typecheck":"tsc --noEmit","format:check":"prettier --check src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","prepublishOnly":"npm run format:check && npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"arcanemachine","email":"arcanemachine@gmail.com"},"repository":{"url":"git+https://github.com/arcanemachine/pi-model-switcher.git","type":"git"},"_npmVersion":"11.13.0","description":"User-authorized agent model switching for Pi sessions","directories":{},"_nodeVersion":"24.16.0","dependencies":{"typebox":"1.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.6","prettier":"^3.8.3","typescript":"^5.9.3","@types/node":"^25.3.3","@earendil-works/pi-ai":"0.84.1","@earendil-works/pi-tui":"0.84.1","@earendil-works/pi-coding-agent":"0.84.1"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-ai":{"optional":true},"@earendil-works/pi-tui":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-model-switcher_0.1.2_1788765781342_0.11604452125639253","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@arcanemachine/pi-model-switcher","version":"0.1.3","keywords":["pi","pi-coding-agent","pi-extension","pi-package","model-switching"],"author":{"name":"Nicholas Moen"},"license":"MIT","_id":"@arcanemachine/pi-model-switcher@0.1.3","maintainers":[{"name":"arcanemachine","email":"arcanemachine@gmail.com"}],"homepage":"https://github.com/arcanemachine/pi-model-switcher#readme","bugs":{"url":"https://github.com/arcanemachine/pi-model-switcher/issues"},"pi":{"image":"https://raw.githubusercontent.com/arcanemachine/pi-model-switcher/main/logo.jpg","extensions":["./src/index.ts"]},"dist":{"shasum":"bb594ff4d7c483713d464d1486a8c3ee2e3ab6dd","tarball":"https://registry.npmjs.org/@arcanemachine/pi-model-switcher/-/pi-model-switcher-0.1.3.tgz","fileCount":6,"integrity":"sha512-dRSXbamaUDoth1sUKl2IgDjA9Fnrq2NhoxxnoXCPooLYyPCTaiMtpYjJiROE2Ib7chhIETzsuuSMd+o5SXjo5w==","signatures":[{"sig":"MEUCIHO0EwbOZbpqd54hGOVm12TCKj84Mj2xJNcC57faJkXzAiEA1Mlvfj6o2gqkIrH8Ej5ir1Gx2X7WkClrhRUDXbO9YCQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":111318},"type":"module","engines":{"node":">=22.19.0"},"gitHead":"18dd8d2e6e43983e846885863f175f89dedaa0f2","scripts":{"test":"vitest run --exclude '**/dist/**' tests","build":"tsc","format":"prettier --write src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","typecheck":"tsc --noEmit","format:check":"prettier --check src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","prepublishOnly":"npm run format:check && npm run typecheck && npm run test && npm run build"},"_npmUser":{"name":"arcanemachine","email":"arcanemachine@gmail.com"},"repository":{"url":"git+https://github.com/arcanemachine/pi-model-switcher.git","type":"git"},"_npmVersion":"11.13.0","description":"User-authorized agent model switching for Pi sessions","directories":{},"_nodeVersion":"24.16.0","dependencies":{"typebox":"1.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.6","prettier":"^3.8.3","typescript":"^5.9.3","@types/node":"^25.3.3","@earendil-works/pi-ai":"0.84.1","@earendil-works/pi-tui":"0.84.1","@earendil-works/pi-coding-agent":"0.84.1"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-ai":{"optional":true},"@earendil-works/pi-tui":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-model-switcher_0.1.3_1788867301110_0.13015525073680356","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"pi":{"image":"https://raw.githubusercontent.com/arcanemachine/pi-model-switcher/main/logo.jpg","extensions":["./src/index.ts"]},"_id":"@arcanemachine/pi-model-switcher@0.1.4","bugs":{"url":"https://github.com/arcanemachine/pi-model-switcher/issues"},"dist":{"shasum":"0d25698dfd07c62b18d05d36c6663abd0c76f2db","tarball":"https://registry.npmjs.org/@arcanemachine/pi-model-switcher/-/pi-model-switcher-0.1.4.tgz","fileCount":6,"integrity":"sha512-Clk4QEW+riBCR8560hu+Gh2RXC9JiMKOdUmha5sh/TEori5Awt7scoiGM1T7yw7pmIhQoApffPj1EA3DxTA0IA==","signatures":[{"sig":"MEYCIQDfUaXiYa9ifizLevyvEH3lAGb5iyjEVyJELxOpmiTm0wIhAL+bA2I+UjHNx0CVbPhEzA4q1/xo8S5O94yHhD/M6mmn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBZL2EEonxLdmXJeG6lHvF1HnBeNeKJcxUG/gqssu3n6AiEAyKhG5qpU0Wi8AjOrpQnBICGMgZB7YTv0vgvjUZsltNc="}],"unpackedSize":114790},"name":"@arcanemachine/pi-model-switcher","type":"module","author":{"name":"Nicholas Moen"},"engines":{"node":">=22.19.0"},"gitHead":"61194511ec3fd44f1d538219c5ab9fb5b5e0a9ea","license":"MIT","scripts":{"test":"vitest run --exclude '**/dist/**' tests","build":"tsc","format":"prettier --write src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","typecheck":"tsc --noEmit","format:check":"prettier --check src/**/*.ts tests/**/*.ts package.json README.md CHANGELOG.md LICENSE.md","prepublishOnly":"npm run format:check && npm run typecheck && npm run test && npm run build"},"version":"0.1.4","_npmUser":{"name":"arcanemachine","email":"arcanemachine@gmail.com"},"homepage":"https://github.com/arcanemachine/pi-model-switcher#readme","keywords":["pi","pi-coding-agent","pi-extension","pi-package","model-switching"],"repository":{"url":"git+https://github.com/arcanemachine/pi-model-switcher.git","type":"git"},"_npmVersion":"11.13.0","description":"User-authorized agent model switching for Pi sessions","directories":{},"maintainers":[{"name":"arcanemachine","email":"arcanemachine@gmail.com"}],"_nodeVersion":"24.16.0","dependencies":{"typebox":"1.3.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.6","prettier":"^3.8.3","typescript":"^5.9.3","@types/node":"^25.3.3","@earendil-works/pi-ai":"0.84.1","@earendil-works/pi-tui":"0.84.1","@earendil-works/pi-coding-agent":"0.84.1"},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-ai":{"optional":true},"@earendil-works/pi-tui":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-model-switcher_0.1.4_1790824088985_0.8657447951069632"}}},"time":{"created":"2026-08-28T23:47:51.336Z","modified":"2026-10-01T03:08:09.292Z","0.1.0":"2026-08-28T23:47:51.771Z","0.1.1":"2026-09-03T23:58:18.595Z","0.1.2":"2026-09-07T07:23:01.476Z","0.1.3":"2026-09-08T11:35:01.263Z","0.1.4":"2026-10-01T03:08:09.126Z"},"bugs":{"url":"https://github.com/arcanemachine/pi-model-switcher/issues"},"author":{"name":"Nicholas Moen"},"license":"MIT","homepage":"https://github.com/arcanemachine/pi-model-switcher#readme","keywords":["pi","pi-coding-agent","pi-extension","pi-package","model-switching"],"repository":{"url":"git+https://github.com/arcanemachine/pi-model-switcher.git","type":"git"},"description":"User-authorized agent model switching for Pi sessions","maintainers":[{"name":"arcanemachine","email":"arcanemachine@gmail.com"}],"readme":"# pi-model-switcher\n\n<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/arcanemachine/pi-model-switcher/main/logo.jpg\" alt=\"pi-model-switcher logo\" width=\"250\" />\n</p>\n\nA [Pi](https://pi.dev) extension for user-authorized agent-driven model switching.\n\nIt reports the active model, lists Pi's currently permitted models and configured aliases, and switches models only after you authorize it for the current session. Aliases can include `when_to_use` guidance so the agent can distinguish model roles. Loading the extension never grants permission: switching is denied by default.\n\n> Like this extension? See [my other Pi extensions](https://github.com/arcanemachine/pi-projects).\n\n## Requirements\n\n- Pi 0.84.1 or later\n- Node.js 22.19.0 or later for package development\n\n## Installation\n\nFrom GitHub:\n\n```bash\npi install git:github.com/arcanemachine/pi-model-switcher\n```\n\nFrom npm:\n\n```bash\npi install npm:@arcanemachine/pi-model-switcher\n```\n\nFor local development:\n\n```bash\npi -e ./src/index.ts\n```\n\n## Quick start\n\n1. Start Pi with the extension installed.\n2. Check the current permission state:\n\n   ```text\n   /model-switcher\n   ```\n\n3. Allow model switching for the current session:\n\n   ```text\n   /model-switcher allow\n   ```\n\n4. Ask the agent to show the available models, then ask it to switch to the model you want. You can use an exact provider/model identifier or a configured alias.\n5. When you are finished, deny switching again:\n\n   ```text\n   /model-switcher deny\n   ```\n\nIf switching is denied, the agent should ask you to run `/model-switcher allow`. An agent cannot authorize itself.\n\n## Permission\n\nShow the effective permission state without changing it:\n\n```text\n/model-switcher\n```\n\nChange authorization for the current session:\n\n```text\n/model-switcher allow\n/model-switcher deny\n```\n\nThese commands persist an explicit override on the active session branch. Resuming or reloading restores that branch's latest override. `/new` and forks start from the flag/configuration baseline; a fork records a reset when it inherited an explicit authorization.\n\nFor a new session, use either CLI flag:\n\n```bash\n--model-switcher-allow\n--model-switcher-deny\n```\n\nIf both flags are supplied, deny wins. Effective precedence is session override, CLI flag, configuration, then denied default.\n\nThe optional status-bar indicator is disabled by default. Enable it in Pi settings:\n\n```json\n{\n  \"model-switcher\": {\n    \"showStatus\": true\n  }\n}\n```\n\nWhen enabled and switching is allowed, it shows `Model switching: allowed 🔄 `. `showStatus` must be a boolean; invalid values stop configuration loading with an error.\n\n## Aliases\n\nAliases let you give a short name to a model and its thinking level. Configure them under `model-switcher.aliases` as strict name-to-preset mappings; each preset may include an optional `when_to_use` string for agent-facing model-selection guidance:\n\n```json\n{\n  \"model-switcher\": {\n    \"aliases\": {\n      \"smart\": {\n        \"model\": \"anthropic/claude-sonnet-4-5\",\n        \"thinkingLevel\": \"high\",\n        \"when_to_use\": \"Complex reasoning and design work\"\n      },\n      \"worker\": {\n        \"model\": \"openai/gpt-5.4\",\n        \"thinkingLevel\": \"medium\",\n        \"when_to_use\": \"Focused implementation work\"\n      }\n    }\n  }\n}\n```\n\nAfter authorization, an alias name works anywhere an exact model identifier works:\n\n```json\n{ \"model\": \"smart\" }\n```\n\nInspect aliases without changing permission:\n\n```text\n/model-switcher aliases\n```\n\nThe aliases command does not change permission or create a session entry.\n\nAlias names must match `[a-z][a-z0-9_-]{0,63}`. They cannot contain `/` or point to another alias. Targets must be exact canonical identifiers; model IDs may contain additional slashes.\n\nThe command and authorized listing show aliases sorted by name with their model, thinking level, and optional `when_to_use` guidance. `when_to_use` is informational model-selection metadata; it never authorizes or requires a switch. Global aliases are used unless a trusted project defines its own `aliases` object. A trusted project's object replaces the global object; it is not merged key-by-key. Untrusted project settings are ignored.\n\nInvalid alias entries are ignored with a warning. This includes invalid names, string values, missing or extra fields, invalid models, invalid thinking levels, and non-string `when_to_use` values. Invalid entries do not affect otherwise valid canonical model switching.\n\n## Settings\n\nThe extension reads global `~/.pi/agent/settings.json` and the trusted project's `.pi/settings.json`. Trusted project fields override corresponding global fields. Arrays replace arrays, and the `aliases` object replaces the global alias object when supplied.\n\nAllow every model in Pi's current native scope:\n\n```json\n{\n  \"model-switcher\": {\n    \"allowed\": true,\n    \"allowedModels\": \"all\"\n  }\n}\n```\n\nNarrow switching to an exact `allowedModels` list:\n\n```json\n{\n  \"model-switcher\": {\n    \"allowed\": true,\n    \"allowedModels\": [\"anthropic/claude-sonnet-4-5\", \"openai/gpt-5.4\"],\n    \"aliases\": {\n      \"smart\": {\n        \"model\": \"anthropic/claude-sonnet-4-5\",\n        \"thinkingLevel\": \"high\",\n        \"when_to_use\": \"Complex reasoning and design work\"\n      }\n    }\n  }\n}\n```\n\nPi's `enabledModels` setting and `--models` flag remain authoritative; this extension can only narrow that scope. Aliases likewise only name targets that already pass those policies.\n\nOmitting `allowedModels` means `\"all\"`; an empty array permits no models. Array entries must be exact canonical identifiers, with invalid entries ignored and duplicates removed. An invalid `allowedModels` value permits no models. The separate `allowed` setting controls authorization, not the model policy.\n\nThe old `allow` setting is unsupported and is never interpreted. If it is present in the effective trusted configuration, the extension warns and permits no models rather than widening the policy. Invalid aliases are ignored as described above.\n\n## Technical reference\n\nThe extension registers exactly three sequential tools. Permission changes never alter the active tool set, preserving prompt-cache stability.\n\n### `model_switcher_whoami`\n\nAlways available and read-only. Reports the live model and thinking level as `model (thinkingLevel)`. When switching is denied, it includes a reminder to ask the user for authorization.\n\n### `model_switcher_list`\n\nRequires user authorization. Refreshes Pi's model registry and lists all configured aliases and currently permitted models together. It takes no arguments. Aliases are shown with their configured targets, including targets that are unavailable or blocked by current policy, so the agent can distinguish configuration from availability.\n\nAliases are sorted by name and models by provider/model. Each section is capped at 200 results. Structured alias details are keyed by alias name:\n\n```json\n{\n  \"aliases\": {\n    \"smart\": {\n      \"model\": \"anthropic/claude-sonnet-4-5\",\n      \"thinkingLevel\": \"high\",\n      \"when_to_use\": \"Complex reasoning and design work\"\n    }\n  }\n}\n```\n\nRefresh failures fall back to Pi's cached registry and are reported in the response. Empty sections explicitly distinguish no configured aliases from no currently available or permitted models.\n\n### `model_switcher_switch`\n\nRequires user authorization. Accepts an exact canonical `provider/model` identifier or exact configured alias. An alias sets both its model and thinking level. Alias presets never broaden Pi's native scope or bypass the `allowedModels` policy.\n\nIf the model is already active, an alias can change only the thinking level. An operation is a no-op only when both model and thinking level already match. Alias thinking takes precedence over native defaults and scoped thinking pins. Direct canonical switching retains native behavior.\n\nThe target model must support the alias's exact thinking level. Unsupported combinations are rejected before any model or thinking mutation; Pi never clamps alias levels. The effective level is checked after application as a defensive invariant.\n\n`when_to_use` appears with aliases in the authorized listing and structured tool details. It is guidance only: the presence of a description does not grant permission or require a switch. If a switch is denied, the agent is told to continue its existing work; when the user did request a switch, it should ask them to run `/model-switcher allow`.\n\nAfter a successful state change, the tool response reports the resulting model and thinking level as `model (thinkingLevel)`, including the alias when one was used. The extension does not emit a separate info notification, so the result is not duplicated. No-op and failed operations are not accompanied by a separate notification.\n\n## Safety and scope\n\nThe extension uses Pi's live model registry and native scope. It does not invent models, authenticate providers, bypass provider errors, or clamp alias thinking levels. Denied requests fail before refreshing or disclosing model and alias inventory. Alias resolution is exact and policy-preserving; aliases cannot bypass the `allowedModels` policy. `when_to_use` is informational only and never grants permission. When a denied tool call occurs, the agent is instructed to continue its existing work and only ask the user for `/model-switcher allow` when the user explicitly requested model switching. Permission changes send hidden session context without triggering unsolicited agent turns.\n\n## Development\n\n```bash\nnpm install --ignore-scripts --workspaces=false\nnpm run typecheck\nnpm run test\nnpm run build\nnpm run format\nnpm pack --dry-run\n```\n\nThe package is source-loaded by Pi from `src/index.ts`; no compiled runtime artifact is required.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}