{"_id":"@dxvapor/pi-prompt-enhancer","name":"@dxvapor/pi-prompt-enhancer","dist-tags":{"latest":"1.2.0"},"versions":{"1.2.0":{"name":"@dxvapor/pi-prompt-enhancer","version":"1.2.0","description":"Prompt enhancer with comparison popup, version history, searchable model picker, and quick-enhance mode","keywords":["pi-package","pi","pi-extension","prompt","enhance","prompt-enhancer","rewrite","ai","coding-agent"],"license":"MIT","type":"module","publishConfig":{"access":"public"},"pi":{"extensions":["./index.ts"]},"peerDependencies":{"@mariozechner/pi-ai":"*","@mariozechner/pi-coding-agent":"*"},"gitHead":"1c5cf2aba9c11aa3c5f49cf3b715de93006b778f","_id":"@dxvapor/pi-prompt-enhancer@1.2.0","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-R1RqzOAiFJLPpsEB4clBenRGW/P+U8YViHyxkSgKy05Vwx5NbwVfKGMylfSsR88XYlG8OamkST+8Tm28ebAgpA==","shasum":"e86f5407275520ca6434fcc167ca65dcdce17dad","tarball":"https://registry.npmjs.org/@dxvapor/pi-prompt-enhancer/-/pi-prompt-enhancer-1.2.0.tgz","fileCount":5,"unpackedSize":35441,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGr2PuY+jnm/rab9IOcipHwM5MsZ2x+PhFAHki7dum6bAiA/JAr5ZhMZ+ytb9INKgG1nXR+lcdfnqNqVDIpzRVazGw=="}]},"_npmUser":{"name":"dxvapor","email":"npmjs.elevation906@passmail.com"},"directories":{},"maintainers":[{"name":"dxvapor","email":"npmjs.elevation906@passmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-prompt-enhancer_1.2.0_1777796986018_0.49520957655502507"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-03T08:29:45.908Z","1.2.0":"2026-05-03T08:29:46.188Z","modified":"2026-05-03T08:29:46.442Z"},"maintainers":[{"name":"dxvapor","email":"npmjs.elevation906@passmail.com"}],"description":"Prompt enhancer with comparison popup, version history, searchable model picker, and quick-enhance mode","keywords":["pi-package","pi","pi-extension","prompt","enhance","prompt-enhancer","rewrite","ai","coding-agent"],"license":"MIT","readme":"# pi-prompt-enhancer\n\nA fork of [@danchamorro/pi-prompt-enhancer](https://github.com/danchamorro/pi-agent-toolkit/tree/main/packages/prompt-enhancer) for the [pi coding agent](https://github.com/badlogic/pi-mono), extending it with a **configurable dedicated model** for prompt enhancement.\n\nInstead of always using whatever model is currently active in your session, you can pin a specific model (e.g. a free GitHub Copilot model) that is used exclusively for enhancement — regardless of what you have selected for regular coding work.\n\n---\n\n## Features\n\n- `Ctrl+Shift+E` — enhance the current editor text in-place\n- `Ctrl+Shift+Z` — restore original prompt (undo enhancement)\n- `/enhance <prompt>` — enhance inline text, place result in editor\n- `/enhance-model` — interactive picker to set the enhancement model from your configured providers\n- Status bar indicator showing the currently pinned model (`✨ gpt-5-mini`)\n- Global and project-level config, with project taking precedence\n- Merge-safe config writes — other keys in the JSON are preserved\n\n---\n\n## Prerequisites\n\n- [pi coding agent](https://github.com/badlogic/pi-mono) installed and running\n- At least one AI provider configured in pi (run `/model` inside pi to verify)\n\n---\n\n## Installation\n\n### Option A — `extensions` entry in `settings.json` (recommended)\n\nClone the repo somewhere on your machine:\n\n```bash\ngit clone https://github.com/DxVapor/pi-prompt-enhancer.git ~/projects/pi-prompt-enhancer\n```\n\nAdd it to `~/.pi/agent/settings.json`:\n\n```json\n{\n  \"extensions\": [\n    \"~/projects/pi-prompt-enhancer\"\n  ]\n}\n```\n\nThen run `/reload` inside pi.\n\n### Option B — copy into the extensions directory\n\n```bash\ncp ~/projects/pi-prompt-enhancer/{index.ts,clean.ts} ~/.pi/agent/extensions/prompt-enhancer/\n```\n\n> **Note:** If you previously had `\"npm:@danchamorro/pi-prompt-enhancer\"` in your `packages` list, remove it first to avoid duplicate command registration.\n\n---\n\n## Configuration\n\n### Interactive (recommended)\n\nRun `/enhance-model` inside pi. Two sequential prompts appear:\n\n1. **Scope** — global (all projects) or project-local\n2. **Model** — every model that has auth configured in pi's registry\n\nThere is a **\"↩ Use active session model\"** option at the top to clear a previously pinned model.\n\nThe command writes to the JSON config file automatically (creating directories as needed).\n\n### Manual JSON\n\n**Global** — applies to all projects:\n\n```\n~/.pi/agent/extensions/prompt-enhancer.json\n```\n\n**Project-local** — overrides global for one project:\n\n```\n<project-root>/.pi/extensions/prompt-enhancer.json\n```\n\nBoth files use the same format:\n\n```json\n{ \"model\": \"gpt-5-mini\" }\n```\n\n`model` must match the `id` of a model in pi's registry. Run `/model` inside pi to browse available IDs.\n\n### Model resolution order\n\n| Priority | Source |\n|---|---|\n| 1 | `model` in project config (`.pi/extensions/prompt-enhancer.json`) |\n| 2 | `model` in global config (`~/.pi/agent/extensions/prompt-enhancer.json`) |\n| 3 | Active session model — original upstream behaviour |\n\n> **Tip:** When the same model ID exists under multiple providers (e.g. `gpt-5-mini` appears under both `azure-openai-responses` and `github-copilot`), the extension picks the first one that has auth configured — so you always get a working model rather than a silent failure.\n\n---\n\n## Usage\n\n| Key / Command | Action |\n|---|---|\n| `Ctrl+Shift+E` | Enhance editor text in-place |\n| `Ctrl+Shift+Z` | Restore original (undo) |\n| `/enhance <prompt>` | Enhance inline text, place result in editor |\n| `/enhance-model` | Pick or reset the dedicated enhancement model |\n\nThe status bar shows `✨ <model-id>` when a model is pinned. While enhancement is running it briefly shows `✨ Enhancing (<model-name>)...`.\n\n---\n\n## How it differs from the upstream\n\n| | [@danchamorro/pi-prompt-enhancer](https://github.com/danchamorro/pi-agent-toolkit/tree/main/packages/prompt-enhancer) | This fork |\n|---|---|---|\n| Model used | Active session model | Config file → fallback to active model |\n| Config | — | `prompt-enhancer.json` (global + project) |\n| Model picker | — | `/enhance-model` command |\n| Status bar | — | `✨ <model-id>` when pinned |\n| Duplicate provider fix | — | Searches authed models first |\n\nThe system prompt, enhancement logic, `clean()`, and all shortcuts are unchanged from upstream.\n\n---\n\n## Contributing\n\nContributions are welcome. Please open an issue before submitting a large PR so we can discuss the approach first.\n\n1. Fork the repo and create a branch: `git checkout -b feat/your-feature`\n2. Make your changes\n3. Commit using [Conventional Commits](https://www.conventionalcommits.org/): `feat(config): add support for per-session overrides`\n4. Open a pull request against `main`\n\nFor bug reports, please include:\n- pi version (`pi --version`)\n- Contents of your `prompt-enhancer.json` (redact any keys)\n- The error notification or behaviour you observed\n\n---\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n\nOriginal extension by [Daniel Chamorro](https://github.com/danchamorro).\n","readmeFilename":"README.md","_rev":"1-e90bee1e3e9a912b0a93268836067893"}