@infosuweb/prompt-rewriter 0.14.2-rc.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +125 -0
- package/LICENSE +21 -0
- package/README.md +504 -0
- package/media/icon.png +0 -0
- package/package.json +396 -0
- package/releases/prompt-rewriter-latest.vsix +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Prompt Rewriter are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
- **0.14.2-rc.37**: Publish `@infosuweb/prompt-rewriter` to npm (public scoped package with the sideload `.vsix`); README documents npm install alongside existing GitLab Pages / raw / source flows.
|
|
11
|
+
- **0.14.2-rc.36**: Token-free installer distribution — track `releases/prompt-rewriter-latest.vsix`, publish it on GitLab Pages, and simplify README to curl/install without a GitLab token (project must be Public).
|
|
12
|
+
- **0.14.2-rc.35**: README install — explicit 3-step flow (get `.vsix` → install → reload); browser download is the default; optional `curl` only with GitLab `PRIVATE-TOKEN` for the private project.
|
|
13
|
+
- **0.14.2-rc.34**: Move the GitLab project to `suweb1/llm-extension` (same group as Tervia) and update clone, pipeline, and VSIX download URLs.
|
|
14
|
+
- **0.14.2-rc.32**: README preview — GitLab-safe centered HTML header (logo + title without markdown heading-anchor clutter) and a Features table; keep the exact VSIX download URL in a code block so the pipeline table does not overflow.
|
|
15
|
+
- **0.14.2-rc.31**: README — centered `./media/icon.png` logo (128×128) and Marketplace-style Features header; sideload-only install docs unchanged.
|
|
16
|
+
- Sideload distribution (no Marketplace): package a stable `prompt-rewriter-latest.vsix`, publish GitLab CI artifacts / tag releases, and document exact Cursor / VS Code install commands (`$HOME/Downloads/prompt-rewriter-latest.vsix` or `$(pwd)/versions/prompt-rewriter-latest.vsix`).
|
|
17
|
+
- **0.14.2-rc.30**: Fix F8 inventing unrelated tasks from chat history (e.g. commit/push) — rewrite skips transcripts, strengthens anti-invention framing, and rejects ungrounded model replies.
|
|
18
|
+
- **0.14.2-rc.29**: F6/F7 write loop structures (JSON / Grill-with-Docs) using the same command, keybinding, and Rules-tab pattern as F10/F9. Loops are written into the chat input only; they are not executed.
|
|
19
|
+
- **0.14.2-rc.28**: Fix F8 rewrite echoing `.cursor/rules` / README into chat — lean context (skip root docs/docs/global rules), anti-echo rewrite framing, and reject context-dump replies.
|
|
20
|
+
- **0.14.2-rc.27**: Rules tab — Delete (×) on each workspace rule file with modal confirm; removes the file from disk (Trash when available) and refreshes the list. Global rules unchanged.
|
|
21
|
+
- **0.14.2-rc.26**: Fix workspace/global rule file create — names without an extension (e.g. `test-nueva-rule`) now default to `.mdc` instead of “Invalid rule file path”.
|
|
22
|
+
- **0.14.2-rc.25**: Rules tab — collapsible sections (Context, F8/F9/F10 prompts, global/workspace rule files, Skills) so the panel is scannable without scrolling past large textareas.
|
|
23
|
+
- **0.14.2-rc.24**: Rules tab — F8/F9/F10 headers use shortcut + action name + one-line purpose blurb (clearer than “system prompt rules” labels).
|
|
24
|
+
- **0.14.2-rc.23**: `includeLastChatResponse` loads full current chat turns plus older agent transcripts (budgeted), not only the last assistant reply; Rules label updated.
|
|
25
|
+
- **0.14.2-rc.22**: F9/F10 built-in expand rules require the same context-grounded expert persona as F8 (`Act as a …` line / `expert_role` JSON field).
|
|
26
|
+
- **0.14.2-rc.21**: Rules tab — editable F9 expand and F10 expand-JSON system prompts (same pattern as F8); Save settings / Reset per shortcut.
|
|
27
|
+
- **0.14.2-rc.20**: F8 built-in rewrite rules always prefix a context-grounded expert agent persona (`Act as a …`) without inventing scope; still no inference / gap-filling; preserve ambiguity.
|
|
28
|
+
- **0.14.2-rc.19**: Rules tab — editable F8 `rewriteSystemPromptRules` (custom rewrite system prompt); empty keeps built-in strict defaults (no inference / preserve ambiguity).
|
|
29
|
+
- **0.14.2-rc.18**: Anthropic workspace ID — strip `/keys` and Console URL path junk when pasting `wrkspc_…` into Setup.
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **0.14.2-rc.12**: Fix Cursor Agents backend — do not pass OpenAI/generic `promptRewriter.apiKey` to the Agent CLI; use `cursorApiKey` or `agent login` only.
|
|
33
|
+
- **0.14.2-rc.11**: Rules tab — per-file include toggles for global (`~/.cursor/rules`) and workspace rule files, create/edit global rule files in-panel, and persist disabled files via Save settings.
|
|
34
|
+
- **0.14.2-rc.10**: Rules tab **Edit** link next to Include `~/.cursor/rules` opens those global rule files in the editor (or reveals the folder if empty); disk edits apply on the next rewrite when Include is enabled.
|
|
35
|
+
- **0.14.2-rc.9**: Curated provider order in Setup — Cursor Agents and paid cloud APIs (OpenAI, Claude, Google) appear first; curated model suggestions list before the full catalog alphabetically.
|
|
36
|
+
- **0.14.2-rc.7**: Rules tab more visible (segmented Setup/Rules control), show extension version in the panel, refresh webview HTML on show so RC installs apply without full window reload; remove shadowed older RC installs when packaging locally.
|
|
37
|
+
- **0.14.2-rc.6**: Setup panel **Rules** tab — configure agent context settings, edit rule files, create skill files (`SKILL.md`), and assign named task prompts to skills.
|
|
38
|
+
- Extension marketplace / Activity Bar icon: comic speech-bubble mark.
|
|
39
|
+
- Backend **google** (Gemini via Google’s OpenAI-compatible API) with `promptRewriter.googleApiKey` / `googleBaseUrl` / `googleModel`.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- **0.14.2-rc.17**: Anthropic identity-linked keys — clearer HTTP 400 guidance, Setup warning when workspace ID is empty, optional `ANTHROPIC_WORKSPACE_ID` env fallback, and stronger UI copy for `anthropicWorkspaceId`.
|
|
44
|
+
- **0.14.2-rc.16**: Google Setup model picker lists only models available to the configured API key (live `/v1beta/models`); retired curated Gemini 2.x ids are no longer injected; catalog 403/404 errors surface in the panel; default remains `gemini-3.6-flash`.
|
|
45
|
+
- **0.14.2-rc.15**: Google default/curated models moved to Gemini 3.x (`gemini-3.6-flash`); retired 2.5/2.0 ids are remapped; drop deprecated `temperature` on native generateContent; clearer 403/404 hints.
|
|
46
|
+
- **0.14.2-rc.14**: Google/Gemini rewrite/expand uses the native Generative Language `:generateContent` API (with `x-goog-api-key`) instead of the OpenAI-compat `/chat/completions` path that returned opaque HTTP 404.
|
|
47
|
+
- **0.14.2-rc.13**: Anthropic identity-linked keys — optional `promptRewriter.anthropicWorkspaceId` sent as `anthropic-workspace-id` header; Gemini base URL normalized to `/v1beta/openai` to fix HTTP 404.
|
|
48
|
+
- **0.14.2-rc.5**: OpenAI Setup no longer shows Anthropic’s base URL after switching providers; Anthropic URL is saved to `anthropicBaseUrl` and foreign hosts are rewritten for the OpenAI preset.
|
|
49
|
+
- **0.14.2-rc.4**: Ship progressive Setup disclosure, Google native model listing, and silent curated fallback (no catalog 404 alert) for local testing.
|
|
50
|
+
- Setup panel no longer shows a catalog warning when live listing fails; Google models are listed via the native Gemini API (the OpenAI-compatible `/models` route often returns 404).
|
|
51
|
+
- Configuration panel: Connection / Model / Request stay hidden until a provider is chosen; model selection is kept per provider so switching (e.g. Google) no longer keeps a Claude id.
|
|
52
|
+
- Configuration panel no longer shows the backend info alert (e.g. “Runs locally through Ollama…”).
|
|
53
|
+
- Configuration panel **Save & apply** (and backend/model commands) clear Workspace overrides so User settings are not shadowed (e.g. a checked-in `.vscode/settings.json` forcing Hermes while the panel shows Ollama).
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- Packaged `.vsix` artifacts are written to `versions/` instead of the repository root.
|
|
58
|
+
- Configuration sidebar redesigned as a minimal **Setup** panel: provider/model pickers with icons, clearer alerts, and plain-language status copy.
|
|
59
|
+
- Progress notifications for rewrite/expand shortcuts now show the active model instead of a vague status-bar-only spinner.
|
|
60
|
+
- Setup panel provider/model icons now use official brand marks (Ollama, OpenAI, Anthropic/Claude, Google/Gemini, Qwen, Meta, LongCat, StepFun, Upstage, OpenRouter).
|
|
61
|
+
|
|
62
|
+
## [0.14.1] - 2026-08-30
|
|
63
|
+
|
|
64
|
+
### Fixed
|
|
65
|
+
|
|
66
|
+
- Restore F8–F12 paste path: remove the “agent tab changed” hard-fail regression that aborted rewrites when Accessibility retarget failed. Current-input commands again write/paste into the focused chat input.
|
|
67
|
+
|
|
68
|
+
## [0.14.0] - 2026-08-30
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
|
|
72
|
+
- Backends **openai** (official OpenAI API) and **anthropic** (Claude Messages API) with direct API-key auth.
|
|
73
|
+
- Setting `promptRewriter.anthropicApiKey` / `promptRewriter.anthropicBaseUrl`.
|
|
74
|
+
- Curated OpenAI and Claude model suggestions in the configuration panel.
|
|
75
|
+
- Lean context for cloud/Hermes on F8 rewrite and F12 (skips heavy docs/global rules) to reduce latency.
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
|
|
79
|
+
- Hermes/OpenAI-compatible remains available as `openaiCompatible`; free Hermes routes can be slow — prefer OpenAI/Claude APIs for speed.
|
|
80
|
+
- Cloud completions send `max_tokens` (2048) to avoid long slow generations.
|
|
81
|
+
|
|
82
|
+
## [0.13.0] - 2026-08-30
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
|
|
86
|
+
- Sidebar **Configuration** webview and command **Open Configuration**.
|
|
87
|
+
- Command **Select Ollama Model** to pick a local model from Ollama `GET /api/tags` and save `promptRewriter.ollamaModel`.
|
|
88
|
+
- Command **Select LLM Backend** (`ollama` or `openaiCompatible`) for F8–F12 and clipboard rewrite.
|
|
89
|
+
- Command **Select Active Model** for the current backend (Ollama tags or Hermes/OpenAI `GET /models`).
|
|
90
|
+
- Command **Import Hermes Model Settings** to copy Hermes Agent primary local model into Prompt Rewriter Ollama settings.
|
|
91
|
+
- `ModelCatalog` application port with Ollama listing adapter; Hermes config read/map helpers under `src/hermes/`.
|
|
92
|
+
- SemVer release scripts (`release:patch` / `release:minor` / `release:major`), version sync check, and Keep a Changelog workflow.
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
|
|
96
|
+
- Shared request timeout `promptRewriter.ollamaTimeoutMs` applies to both Ollama and OpenAI-compatible backends.
|
|
97
|
+
|
|
98
|
+
## [0.12.7] - 2026-08-29
|
|
99
|
+
|
|
100
|
+
### Added
|
|
101
|
+
|
|
102
|
+
- Setting `promptRewriter.ollamaTimeoutMs` (default 180000 ms).
|
|
103
|
+
|
|
104
|
+
### Changed
|
|
105
|
+
|
|
106
|
+
- Prompt extraction strips leading framing headers before rewrite/expand.
|
|
107
|
+
|
|
108
|
+
## [0.12.6] - 2026-08-28
|
|
109
|
+
|
|
110
|
+
### Added
|
|
111
|
+
|
|
112
|
+
- Command **Suggest Next Prompt** (**F12**) using last chat response and shared context stack.
|
|
113
|
+
|
|
114
|
+
## [0.9.0] - 2026-08-20
|
|
115
|
+
|
|
116
|
+
### Added
|
|
117
|
+
|
|
118
|
+
- Preservation of `@` mentions and slash skills during rewrite/expand.
|
|
119
|
+
- Skill context loading (`SKILL.md`) for expanded prompts.
|
|
120
|
+
|
|
121
|
+
## [0.1.0] - 2026-08-01
|
|
122
|
+
|
|
123
|
+
### Added
|
|
124
|
+
|
|
125
|
+
- Initial Prompt Rewriter VS Code / Cursor extension (rewrite selection, clipboard, and current input).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Prompt Rewriter contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./media/icon.png" alt="Prompt Rewriter" width="128" height="128">
|
|
3
|
+
<h1>Prompt Rewriter</h1>
|
|
4
|
+
<p>A Visual Studio Code and Cursor extension that turns a rough prompt into a clearer one with local Qwen/Ollama before you send it to an agent. It does not send the message automatically.</p>
|
|
5
|
+
<p>This extension is <strong>not</strong> published to the VS Code Marketplace. Install it from npm or from a <code>.vsix</code> — see <a href="#install-locally-no-marketplace">Install locally (no Marketplace)</a>.</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
Independent commands:
|
|
11
|
+
|
|
12
|
+
| Command | Shortcut | Description |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| **Rewrite Current Input** | **F8** | Cleans wording without inventing ideas, and prefixes a context-grounded expert agent persona (`Act as a …`). Shares skills, workspace `.cursor/rules`, and architecture defaults; skips chat history, root docs / docs folder, and global `~/.cursor/rules` so local models rewrite only what you typed (no README dumps or invented “next” tasks from transcripts). |
|
|
15
|
+
| **Expand Current Input** | **F9** | Formats a Cursor-agent-ready Grill-with-Docs prompt starting with a context-grounded `Act as a …` expert role, then Goal / Constraints / Non-Goals / Acceptance Criteria, using the full shared context stack (including root docs when enabled). |
|
|
16
|
+
| **Expand Current Input (JSON)** | **F10** | Same expand behavior, but the output is a JSON object (`expert_role`, `goal`, `constraints`, `non_goals`, `acceptance_criteria`). |
|
|
17
|
+
| **Expand Current Input (Loop)** | **F7** | Same expand flow as F9, but writes a Grill-with-Docs **loop** (iteration structure to repeat work until done), not a one-shot prompt. Adds an optional `### Loop` section from iteration details already in the input; does not execute the loop. |
|
|
18
|
+
| **Expand Current Input (Loop JSON)** | **F6** | Same loop behavior as F7, but the output is a JSON object (`expert_role`, `goal`, `loop`, `constraints`, `non_goals`, `acceptance_criteria`). |
|
|
19
|
+
| **Suggest Next Prompt** | **F12** | Uses chat history (agent transcripts) to propose the next ready-to-send agent prompt (Grill-with-Docs is used only as internal reasoning, not written into the input). |
|
|
20
|
+
| **Rewrite Prompt** | — | Rewrites the current editor selection and shows a diff before replacing it. |
|
|
21
|
+
| **Rewrite Clipboard Prompt** | — | Rewrites the current clipboard text and copies the result back for a manual paste. |
|
|
22
|
+
| **Open Configuration** | — | Opens the sidebar panel to pick backend + model and save. |
|
|
23
|
+
| **Select LLM Backend** | — | Chooses `ollama`, `openai`, `anthropic`, `google`, `cursorAgents`, or `openaiCompatible` for F6–F12 and clipboard. |
|
|
24
|
+
| **Select Active Model** | — | Lists models for the current backend (Ollama `/api/tags`, Cursor `agent models`, Hermes/OpenAI `GET /models`, curated ids when live listing is unavailable). |
|
|
25
|
+
| **Select Ollama Model** | — | Lists local Ollama models only (same `GET /api/tags` catalog Hermes uses) and saves `promptRewriter.ollamaModel`. |
|
|
26
|
+
| **Import Hermes Model Settings** | — | Copies Hermes Agent’s primary local model (`hermes config get model.*`) into Prompt Rewriter Ollama settings. |
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
- Visual Studio Code 1.80+ or Cursor (any recent build that installs standard VS Code extensions)
|
|
31
|
+
- To **build** the `.vsix` from source (not required if you already have the installer file): Node.js 22 or later and npm 10 or later
|
|
32
|
+
- For **Rewrite Current Input**, **Expand Current Input**, and **Rewrite Clipboard Prompt**: a configured backend (Ollama with a pulled model, cloud API key, or Cursor Agent CLI on PATH)
|
|
33
|
+
- For **Cursor Agents** backend: Cursor Agent CLI (`agent` / `cursor-agent`) on `PATH`, authenticated via `agent login` or `CURSOR_API_KEY`
|
|
34
|
+
- For current-input commands on macOS: Accessibility permission for Cursor (or VS Code) so `osascript` can send Cmd+A / Cmd+C / Cmd+V to the focused field
|
|
35
|
+
|
|
36
|
+
## Install locally (no Marketplace)
|
|
37
|
+
|
|
38
|
+
This extension is **not** on the VS Code Marketplace. The installer is the `.vsix` file `releases/prompt-rewriter-latest.vsix`. Prefer **npm** (no GitLab login). GitLab Pages / raw links remain available.
|
|
39
|
+
|
|
40
|
+
Package on npm: [@infosuweb/prompt-rewriter](https://www.npmjs.com/package/@infosuweb/prompt-rewriter) (org packages: https://www.npmjs.com/settings/infosuweb/packages).
|
|
41
|
+
|
|
42
|
+
### From npm (recommended)
|
|
43
|
+
|
|
44
|
+
Downloads the published package (includes the `.vsix`), then sideloads it into Cursor or VS Code. No GitLab token.
|
|
45
|
+
|
|
46
|
+
**Cursor — macOS / Linux:**
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm pack @infosuweb/prompt-rewriter@rc
|
|
50
|
+
tar -xzf infosuweb-prompt-rewriter-*.tgz
|
|
51
|
+
cursor --install-extension "$(pwd)/package/releases/prompt-rewriter-latest.vsix" --force
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**VS Code — macOS / Linux:**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm pack @infosuweb/prompt-rewriter@rc
|
|
58
|
+
tar -xzf infosuweb-prompt-rewriter-*.tgz
|
|
59
|
+
code --install-extension "$(pwd)/package/releases/prompt-rewriter-latest.vsix" --force
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Cursor — Windows (PowerShell):**
|
|
63
|
+
|
|
64
|
+
```powershell
|
|
65
|
+
npm pack @infosuweb/prompt-rewriter@rc
|
|
66
|
+
tar -xzf (Get-Item infosuweb-prompt-rewriter-*.tgz).FullName
|
|
67
|
+
cursor --install-extension "$(Join-Path (Get-Location) 'package\releases\prompt-rewriter-latest.vsix')" --force
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**VS Code — Windows (PowerShell):**
|
|
71
|
+
|
|
72
|
+
```powershell
|
|
73
|
+
npm pack @infosuweb/prompt-rewriter@rc
|
|
74
|
+
tar -xzf (Get-Item infosuweb-prompt-rewriter-*.tgz).FullName
|
|
75
|
+
code --install-extension "$(Join-Path (Get-Location) 'package\releases\prompt-rewriter-latest.vsix')" --force
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
After install: Command Palette → **Developer: Reload Window** → **Prompt Rewriter: Open Configuration**.
|
|
79
|
+
|
|
80
|
+
Pinned version (example): `npm pack @infosuweb/prompt-rewriter@0.14.2-rc.37` instead of `@rc`.
|
|
81
|
+
|
|
82
|
+
### From GitLab Pages / raw `.vsix`
|
|
83
|
+
|
|
84
|
+
No GitLab token is required once the project is **Public** (one-time: [Settings → General → Visibility](https://gitlab.com/suweb1/llm-extension/edit) → **Public**).
|
|
85
|
+
|
|
86
|
+
Public installer URL (same file, two mirrors):
|
|
87
|
+
|
|
88
|
+
- Pages: https://suweb1.gitlab.io/llm-extension/prompt-rewriter-latest.vsix
|
|
89
|
+
- Raw file on `main`: https://gitlab.com/suweb1/llm-extension/-/raw/main/releases/prompt-rewriter-latest.vsix
|
|
90
|
+
|
|
91
|
+
### Cursor (macOS / Linux) — curl from GitLab
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
curl --fail --location --output "$HOME/Downloads/prompt-rewriter-latest.vsix" \
|
|
95
|
+
"https://suweb1.gitlab.io/llm-extension/prompt-rewriter-latest.vsix"
|
|
96
|
+
cursor --install-extension "$HOME/Downloads/prompt-rewriter-latest.vsix" --force
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Then: Command Palette → **Developer: Reload Window** → **Prompt Rewriter: Open Configuration**.
|
|
100
|
+
|
|
101
|
+
### VS Code (macOS / Linux) — curl from GitLab
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
curl --fail --location --output "$HOME/Downloads/prompt-rewriter-latest.vsix" \
|
|
105
|
+
"https://suweb1.gitlab.io/llm-extension/prompt-rewriter-latest.vsix"
|
|
106
|
+
code --install-extension "$HOME/Downloads/prompt-rewriter-latest.vsix" --force
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Then: Command Palette → **Developer: Reload Window** → **Prompt Rewriter: Open Configuration**.
|
|
110
|
+
|
|
111
|
+
### Windows (PowerShell) — Cursor — curl from GitLab
|
|
112
|
+
|
|
113
|
+
```powershell
|
|
114
|
+
curl.exe --fail --location --output "$env:USERPROFILE\Downloads\prompt-rewriter-latest.vsix" `
|
|
115
|
+
"https://suweb1.gitlab.io/llm-extension/prompt-rewriter-latest.vsix"
|
|
116
|
+
cursor --install-extension "$env:USERPROFILE\Downloads\prompt-rewriter-latest.vsix" --force
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Windows (PowerShell) — VS Code — curl from GitLab
|
|
120
|
+
|
|
121
|
+
```powershell
|
|
122
|
+
curl.exe --fail --location --output "$env:USERPROFILE\Downloads\prompt-rewriter-latest.vsix" `
|
|
123
|
+
"https://suweb1.gitlab.io/llm-extension/prompt-rewriter-latest.vsix"
|
|
124
|
+
code --install-extension "$env:USERPROFILE\Downloads\prompt-rewriter-latest.vsix" --force
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Browser (no terminal)
|
|
128
|
+
|
|
129
|
+
1. Open https://suweb1.gitlab.io/llm-extension/ and download **prompt-rewriter-latest.vsix** (or use the raw link above), or download the npm tarball from https://www.npmjs.com/package/@infosuweb/prompt-rewriter and extract `package/releases/prompt-rewriter-latest.vsix`.
|
|
130
|
+
2. Command Palette → **Extensions: Install from VSIX…** → select the `.vsix` file.
|
|
131
|
+
3. **Developer: Reload Window**.
|
|
132
|
+
|
|
133
|
+
If Pages is not ready yet, use the raw `main` URL or the npm method above.
|
|
134
|
+
|
|
135
|
+
### Build from source (optional)
|
|
136
|
+
|
|
137
|
+
Needs Node.js 22+:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
git clone git@gitlab.com:suweb1/llm-extension.git
|
|
141
|
+
cd llm-extension
|
|
142
|
+
npm install
|
|
143
|
+
npm run package
|
|
144
|
+
cursor --install-extension "$(pwd)/releases/prompt-rewriter-latest.vsix" --force
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
To uninstall: Extensions view → **Prompt Rewriter** → Uninstall.
|
|
148
|
+
|
|
149
|
+
The extension uses only the standard VS Code extension API. It does not depend on Cursor-specific APIs or GitHub Copilot.
|
|
150
|
+
|
|
151
|
+
## Install dependencies (from source)
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npm install
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Configure the LLM provider
|
|
158
|
+
|
|
159
|
+
Open **Settings** and set:
|
|
160
|
+
|
|
161
|
+
| Setting | Purpose |
|
|
162
|
+
| --- | --- |
|
|
163
|
+
| `promptRewriter.backend` | `ollama` (local), `openai` (official API), `anthropic` (Claude API), `google` (Gemini), `cursorAgents` (Cursor Agent CLI), or `openaiCompatible` (Hermes/custom). Default: `ollama` |
|
|
164
|
+
| `promptRewriter.apiKey` | API key for OpenAI / Hermes / openaiCompatible. Do not commit. |
|
|
165
|
+
| `promptRewriter.cursorApiKey` | Optional Cursor API key when `backend` is `cursorAgents`. Prefer `agent login` / `CURSOR_API_KEY` when unset. |
|
|
166
|
+
| `promptRewriter.anthropicApiKey` | Anthropic/Claude API key when `backend` is `anthropic`. |
|
|
167
|
+
| `promptRewriter.anthropicWorkspaceId` | Workspace ID (`wrkspc_…`) for identity-linked / multi-workspace Anthropic keys. Sent as `anthropic-workspace-id` on each request. |
|
|
168
|
+
| `promptRewriter.googleApiKey` | Google AI Studio API key when `backend` is `google`. Used to list models available to that key and to call `:generateContent`. |
|
|
169
|
+
| `promptRewriter.googleBaseUrl` | Gemini API host (OpenAI-compat form). Used to derive the native `:generateContent` / `/models` endpoints. Default: `https://generativelanguage.googleapis.com/v1beta/openai/` |
|
|
170
|
+
| `promptRewriter.googleModel` | Preferred Gemini model id. Default: `gemini-3.6-flash`. Retired ids such as `gemini-2.5-flash` are remapped automatically. |
|
|
171
|
+
| `promptRewriter.baseUrl` | OpenAI-compatible base URL. OpenAI preset uses `https://api.openai.com/v1`. |
|
|
172
|
+
| `promptRewriter.ollamaBaseUrl` | Local Ollama server used when `backend` is `ollama`. Default: `http://localhost:11434` |
|
|
173
|
+
| `promptRewriter.ollamaModel` | Ollama model used by those commands. Default: `qwen2.5-coder:7b` |
|
|
174
|
+
| `promptRewriter.ollamaTimeoutMs` | Ollama request timeout in ms. Default: `180000` (3 minutes) |
|
|
175
|
+
| `promptRewriter.contextFolder` | Workspace-relative folder of rules/context for **F6/F7/F8/F9/F10**. Default: `.cursor/rules` |
|
|
176
|
+
| `promptRewriter.includeGlobalCursorRules` | When true, **F6/F7/F9/F10** load Cursor global/user rules from `~/.cursor/rules`. **F8/F12** always skip global rules (lean context). Default: `true` |
|
|
177
|
+
| `promptRewriter.disabledGlobalCursorRuleFiles` | Global rule file names under `~/.cursor/rules` excluded from F6/F7/F9/F10 even when global rules are enabled. Default: `[]` |
|
|
178
|
+
| `promptRewriter.disabledContextRuleFiles` | Workspace rule file names (relative to `contextFolder`) excluded from F6/F7/F8/F9/F10. Default: `[]` |
|
|
179
|
+
| `promptRewriter.includeRootDocs` | When true, **F6/F7/F9/F10** also load `AGENTS.md`, `README.md`, and `.cursorrules` if present. **F8/F12** always skip root docs. Default: `true` |
|
|
180
|
+
| `promptRewriter.docsFolder` | Docs folder for **F6/F7/F9/F10** (`.md`/`.mdc`/`.txt`). Default: `docs`. Empty disables it. **F8/F12** always skip the docs folder. |
|
|
181
|
+
| `promptRewriter.includeArchitectureDefaults` | When true, F6/F7/F8/F9/F10 inject built-in SOLID + hexagonal constraints for software work. Default: `true` |
|
|
182
|
+
| `promptRewriter.includeLastChatResponse` | When true, **F6/F7/F9/F10** include full chat history from Cursor agent transcripts (current conversation turns + older transcripts when budget allows). **F8** always skips chat history (lean rewrite). **F12** always loads it. Default: `true` |
|
|
183
|
+
| `promptRewriter.rewriteSystemPromptRules` | Custom system prompt for **F8 Rewrite**. Empty uses the built-in strict defaults (no inference, preserve ambiguity) and always prefixes a context-grounded expert agent persona. Editable in the Rules tab. |
|
|
184
|
+
| `promptRewriter.expandSystemPromptRules` | Custom system prompt for **F9 Expand**. Empty uses built-in Grill-with-Docs expand rules with a context-grounded `Act as a …` expert role line. Editable in the Rules tab. |
|
|
185
|
+
| `promptRewriter.expandJsonSystemPromptRules` | Custom system prompt for **F10 Expand JSON**. Empty uses built-in JSON expand rules with required `expert_role` (`Act as a …`). Editable in the Rules tab. |
|
|
186
|
+
| `promptRewriter.loopSystemPromptRules` | Custom system prompt for **F7 Loop**. Empty uses built-in Grill-with-Docs loop rules with a context-grounded `Act as a …` expert role line. Editable in the Rules tab. |
|
|
187
|
+
| `promptRewriter.loopJsonSystemPromptRules` | Custom system prompt for **F6 Loop JSON**. Empty uses built-in JSON loop rules with required `expert_role` (`Act as a …`). Editable in the Rules tab. |
|
|
188
|
+
|
|
189
|
+
- Prefer **User** settings over **Workspace** settings so the API key is not stored in the repository.
|
|
190
|
+
- **Save & apply** writes User settings and clears any Workspace overrides for the same keys, so F6–F12 match the panel.
|
|
191
|
+
|
|
192
|
+
**Rewrite Prompt** uses any OpenAI-compatible endpoint that accepts `POST {baseUrl}/chat/completions`.
|
|
193
|
+
|
|
194
|
+
**Rewrite Clipboard Prompt** uses the same `promptRewriter.backend` as F6–F12 (Ollama `/api/chat` or OpenAI-compatible / Hermes proxy). For local Ollama, pull a model first:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
ollama pull qwen2.5-coder:7b
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Prefer **User** settings for `promptRewriter.ollamaModel` so it works in every project, not only this workspace.
|
|
201
|
+
|
|
202
|
+
## Configure from the sidebar panel
|
|
203
|
+
|
|
204
|
+
The simplest way to get F6–F12 working with the model you want:
|
|
205
|
+
|
|
206
|
+
1. Press **F5** (Extension Development Host), or install the `.vsix`.
|
|
207
|
+
2. Click the **Prompt Rewriter** icon in the Activity Bar (left), or run **Prompt Rewriter: Open Configuration**.
|
|
208
|
+
3. Use the top tabs:
|
|
209
|
+
- **Setup** — choose a **Provider**:
|
|
210
|
+
- **Ollama** — fastest on-machine option.
|
|
211
|
+
- **OpenAI** — set your API key + model (`gpt-4o-mini`, …).
|
|
212
|
+
- **Claude** — set your Anthropic API key + Claude model.
|
|
213
|
+
- **Google** — set your Google AI Studio key + Gemini model (default **gemini-3.6-flash**). The Setup model list is loaded from that API key via the native `/v1beta/models` catalog.
|
|
214
|
+
- **Cursor Agents** — Cursor Agent CLI (`agent`) in ask/print mode (Composer and account models).
|
|
215
|
+
- **Compatible** — Hermes proxy / any OpenAI-compatible endpoint (free routes can be slow).
|
|
216
|
+
- **Rules** — configure agent context settings; edit **F8 Rewrite / F9 Expand / F10 Expand JSON / F7 Loop / F6 Loop JSON** system prompts (labeled by purpose in the panel); toggle individual global (`~/.cursor/rules`) and workspace rule files on/off; create or edit rule files in-panel; create/edit skill files (`SKILL.md`); assign named task prompts to skills (stored as `## Task:` sections). Click **Save settings** after toggling includes or editing prompt rules.
|
|
217
|
+
4. On **Setup**, pick a **Model** from the icon list (or type a custom id), then **Save & apply**.
|
|
218
|
+
5. Use **F6** / **F7** / **F8** / **F9** / **F10** / **F12** in Cursor chat.
|
|
219
|
+
|
|
220
|
+
**Performance tip:** Hermes free models are often slow. For everyday use prefer **Ollama**, **OpenAI**, **Claude**, **Google**, or **Cursor Agents**.
|
|
221
|
+
|
|
222
|
+
That panel writes the same `promptRewriter.*` User settings as the Command Palette helpers.
|
|
223
|
+
|
|
224
|
+
## Cursor Agent CLI integration
|
|
225
|
+
|
|
226
|
+
This extension reuses the **Cursor Agent CLI** already on the machine (`agent` / `cursor-agent`). It does not call Cursor HTTP APIs directly and does not add `@cursor/sdk`.
|
|
227
|
+
|
|
228
|
+
| Cursor CLI capability reused | How Prompt Rewriter uses it |
|
|
229
|
+
| --- | --- |
|
|
230
|
+
| `agent models` | Live model catalog for **Cursor Agents** in Setup / Select Active Model |
|
|
231
|
+
| `agent -p --mode ask --model …` | F6–F12 / clipboard rewrite-expand completions (read-only ask mode) |
|
|
232
|
+
|
|
233
|
+
Prerequisites:
|
|
234
|
+
|
|
235
|
+
1. Install Cursor CLI so `agent` is on `PATH` ([Cursor CLI docs](https://cursor.com/docs/cli/overview)).
|
|
236
|
+
2. Authenticate once: `agent login` (or set `CURSOR_API_KEY` / optional `promptRewriter.cursorApiKey`).
|
|
237
|
+
3. Setup → **Cursor Agents** → Refresh models → pick e.g. `composer-2.5` → **Save & apply**.
|
|
238
|
+
|
|
239
|
+
The extension never runs `agent login` itself (that can open a browser).
|
|
240
|
+
|
|
241
|
+
## Hermes Agent integration
|
|
242
|
+
|
|
243
|
+
This extension reuses **existing Hermes Agent solutions** already on the machine. It does not vendor Hermes source, add npm dependencies, or call Hermes cloud APIs.
|
|
244
|
+
|
|
245
|
+
| Hermes solution reused | How Prompt Rewriter uses it |
|
|
246
|
+
| --- | --- |
|
|
247
|
+
| Local Ollama model catalog (`GET /api/tags`) | Command **Select Ollama Model** — same listing path Hermes uses for local Ollama |
|
|
248
|
+
| `hermes config get model.default` / `model.provider` / `model.base_url` | Command **Import Hermes Model Settings** — syncs Hermes primary Ollama/custom model into `promptRewriter.ollamaModel` and `promptRewriter.ollamaBaseUrl` |
|
|
249
|
+
| `~/.hermes/skills/<name>/SKILL.md` | Slash-skill resolution also searches Hermes user skills (after workspace / `~/.agents` / `~/.cursor` / `~/.claude` skills) |
|
|
250
|
+
|
|
251
|
+
### Select Ollama Model
|
|
252
|
+
|
|
253
|
+
1. Ensure Ollama is running (`ollama list`).
|
|
254
|
+
2. Command Palette → **Prompt Rewriter: Select Ollama Model**.
|
|
255
|
+
3. Pick a model. It is stored in **User** settings as `promptRewriter.ollamaModel`.
|
|
256
|
+
|
|
257
|
+
### Import Hermes Model Settings
|
|
258
|
+
|
|
259
|
+
Prerequisites: Hermes Agent CLI on `PATH` (`hermes --version`), with a **local** primary model (`provider: custom` or `ollama`, typically `http://localhost:11434/v1`).
|
|
260
|
+
|
|
261
|
+
1. Command Palette → **Prompt Rewriter: Import Hermes Model Settings**.
|
|
262
|
+
2. The extension runs `hermes config get` for `model.default`, `model.provider`, and `model.base_url`.
|
|
263
|
+
3. It strips Hermes’ OpenAI-compatible `/v1` suffix so the rewriter can keep using Ollama’s native `/api/chat`.
|
|
264
|
+
4. Values are written to **User** settings (`promptRewriter.ollamaModel`, `promptRewriter.ollamaBaseUrl`).
|
|
265
|
+
|
|
266
|
+
If Hermes primary provider is cloud-only (for example `nvidia` / Nous), import is refused — switch Hermes to Ollama with `hermes model` first, or use **Select Ollama Model**.
|
|
267
|
+
|
|
268
|
+
The extension never reads `~/.hermes/.env` or `auth.json`.
|
|
269
|
+
|
|
270
|
+
### Test free Hermes/Nous models (Longcat, etc.)
|
|
271
|
+
|
|
272
|
+
Hermes can expose Nous Portal models through a local OpenAI-compatible proxy. With `promptRewriter.backend` set to `openaiCompatible`, **F6/F7/F8/F9/F10/F12**, **Rewrite Clipboard**, and **Rewrite Prompt** all use that endpoint.
|
|
273
|
+
|
|
274
|
+
1. Ensure Nous Portal is logged in (`hermes status` → Nous Portal ✓).
|
|
275
|
+
2. Start the proxy (leave it running):
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
hermes proxy start --provider nous --host 127.0.0.1 --port 8645
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
3. Command Palette → **Prompt Rewriter: Select LLM Backend** → `openaiCompatible`.
|
|
282
|
+
4. Command Palette → **Prompt Rewriter: Select Active Model** → pick e.g. `meituan/longcat-2.0:free` (lists `:free` ids from the proxy).
|
|
283
|
+
5. Or set settings directly:
|
|
284
|
+
|
|
285
|
+
| Setting | Example |
|
|
286
|
+
| --- | --- |
|
|
287
|
+
| `promptRewriter.backend` | `openaiCompatible` |
|
|
288
|
+
| `promptRewriter.baseUrl` | `http://127.0.0.1:8645/v1` |
|
|
289
|
+
| `promptRewriter.model` | `meituan/longcat-2.0:free` |
|
|
290
|
+
| `promptRewriter.apiKey` | `unused` (the proxy attaches the real Nous credential) |
|
|
291
|
+
|
|
292
|
+
Other free IDs: `stepfun/step-3.7-flash:free`, `upstage/solar-pro4:free`.
|
|
293
|
+
|
|
294
|
+
6. Use **F6** / **F7** / **F8** / **F9** / **F10** / **F12** in Cursor chat, or **Rewrite Prompt** on a selection.
|
|
295
|
+
|
|
296
|
+
To go back to local Ollama: **Select LLM Backend** → `ollama`, then **Select Active Model** (or **Select Ollama Model**).
|
|
297
|
+
|
|
298
|
+
**Note:** `promptRewriter.ollamaTimeoutMs` is the shared request timeout for both backends.
|
|
299
|
+
|
|
300
|
+
Architecture note: model discovery is a `ModelCatalog` port (`src/application/ModelCatalog.ts`) with an Ollama adapter (`src/llm/listOllamaModels.ts`). Hermes config mapping lives in `src/hermes/` (pure map + CLI adapter) so application commands stay free of Hermes/HTTP details.
|
|
301
|
+
|
|
302
|
+
## Run locally (Extension Development Host)
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
npm install
|
|
306
|
+
npm run compile
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Then, in VS Code or Cursor, open this folder and start **Run Extension** from the Run and Debug view (F5). A new Extension Development Host window opens with Prompt Rewriter loaded.
|
|
310
|
+
|
|
311
|
+
## Run lint, typecheck, and tests
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
npm run lint
|
|
315
|
+
npm run typecheck
|
|
316
|
+
npm test
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Watch mode for compilation:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
npm run watch
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## Versioning and release
|
|
326
|
+
|
|
327
|
+
This project uses [Semantic Versioning](https://semver.org/) with `package.json` as the single source of truth. Notable changes go in `CHANGELOG.md` ([Keep a Changelog](https://keepachangelog.com/)).
|
|
328
|
+
|
|
329
|
+
While the major version is `0`, treat breaking command/setting changes as a `minor` bump (or `major` if you prefer a hard break). Otherwise:
|
|
330
|
+
|
|
331
|
+
| Change | Command |
|
|
332
|
+
| --- | --- |
|
|
333
|
+
| Fix / docs / tests only | `npm run release:patch` |
|
|
334
|
+
| New compatible command, setting, or capability | `npm run release:minor` |
|
|
335
|
+
| Breaking change | `npm run release:major` |
|
|
336
|
+
|
|
337
|
+
Release flow:
|
|
338
|
+
|
|
339
|
+
1. Move notes from `## [Unreleased]` in `CHANGELOG.md` into `## [X.Y.Z] - YYYY-MM-DD` for the **next** version (the one the bump will create).
|
|
340
|
+
2. Commit that changelog edit (working tree must be clean before the bump).
|
|
341
|
+
3. Run `npm run release:patch`, `npm run release:minor`, or `npm run release:major`.
|
|
342
|
+
4. That runs typecheck/tests, bumps `package.json` + `package-lock.json`, verifies the changelog section, creates commit `chore(release): X.Y.Z` and tag `vX.Y.Z`, then packages the `.vsix` under `versions/`.
|
|
343
|
+
|
|
344
|
+
Do not edit `version` by hand in feature commits. Use the release scripts only.
|
|
345
|
+
|
|
346
|
+
## How to use
|
|
347
|
+
|
|
348
|
+
### Rewrite the current input (Cursor chat, macOS)
|
|
349
|
+
|
|
350
|
+
This is the main flow. It uses the standard clipboard API plus macOS keystrokes (`osascript`). It does not use Cursor-internal APIs and never presses Enter.
|
|
351
|
+
|
|
352
|
+
It rewrites **only the prompt text**, with the same shared context stack as F9/F10: chat history, slash skills (`SKILL.md`), project/global rules, docs, and architecture defaults (used only to bound/phrase the rewrite). `@` mentions and attachment placeholders are preserved; slash skills are kept on leading lines after replace.
|
|
353
|
+
|
|
354
|
+
1. Start Ollama. This workspace is configured for `qwen2.5-coder:7b`.
|
|
355
|
+
2. Grant Accessibility access if macOS asks: **System Settings → Privacy & Security → Accessibility** → enable Cursor.
|
|
356
|
+
3. Focus the Cursor chat input and type a prompt. Do not send it.
|
|
357
|
+
4. Keep the cursor in the chat input and press **Ctrl+Shift+Alt+P** or **F8**.
|
|
358
|
+
5. Wait until the input text is replaced. A notification confirms it. The message is not sent.
|
|
359
|
+
|
|
360
|
+
The Cursor chat input often swallows regular shortcuts, including `Ctrl+Cmd+H`. That is why the default is now **Ctrl+Shift+Alt+P** (and **F8** as a fallback).
|
|
361
|
+
|
|
362
|
+
`Cmd+H` is not used: on macOS that shortcut hides the application. `Cmd+Shift+H` is **Replace in Files**.
|
|
363
|
+
|
|
364
|
+
If nothing happens, open **View → Output**, choose **Prompt Rewriter**, and check the log. Also enable **System Settings → Privacy & Security → Accessibility → Cursor**.
|
|
365
|
+
|
|
366
|
+
Do not run this command from the Command Palette while testing the chat: the palette steals focus, so the extension can no longer see the chat text.
|
|
367
|
+
|
|
368
|
+
If the focused input is empty, the extension shows an error and does not call Ollama. If Ollama or the keystroke step fails, the original input text is left in place.
|
|
369
|
+
|
|
370
|
+
F6–F12 replace the focused chat input in place (Accessibility write, or Cmd+A / Cmd+V paste). Keep the chat input focused while the model runs for best results.
|
|
371
|
+
|
|
372
|
+
### Expand the current input (faithful prompt engineer, macOS)
|
|
373
|
+
|
|
374
|
+
Same capture/replace flow as **Rewrite Current Input**, with the same shared context stack (last chat, skills, rules/docs, architecture defaults), but optimized for Cursor agents:
|
|
375
|
+
|
|
376
|
+
- Output format: Grill-with-Docs sections (`### Goal`, `### Constraints`, `### Non-Goals`, `### Acceptance Criteria`).
|
|
377
|
+
- Loads project context, in order: Cursor global rules (`~/.cursor/rules`), `promptRewriter.contextFolder` (default `.cursor/rules`), root docs (`AGENTS.md`, `README.md`, `.cursorrules`), then `promptRewriter.docsFolder` (default `docs`).
|
|
378
|
+
- When the input includes slash skills (for example `/grill-with-docs`), Expand loads matching `SKILL.md` files from workspace/user skill folders — including Hermes `~/.hermes/skills` — and nested `/skill` references, then builds the prompt from what those skills expect.
|
|
379
|
+
- Slash skills are kept on leading lines of the expanded text so the invocation remains visible after replace.
|
|
380
|
+
- Also loads **chat history** from Cursor agent transcripts — the current conversation in full (user + assistant turns) plus older project transcripts when the character budget allows (toggle with `promptRewriter.includeLastChatResponse`) so follow-up prompts can reference prior context.
|
|
381
|
+
- Cursor global rules are injected into the Expand LLM context and must be reflected as Constraints so expanded prompts carry them implicitly.
|
|
382
|
+
- When project documentation is present, Expand instructs the model to put relevant doc requirements into Constraints / Acceptance Criteria (without inventing product scope from the docs).
|
|
383
|
+
- Always injects built-in **SOLID + hexagonal** defaults for software tasks (disable with `promptRewriter.includeArchitectureDefaults: false`).
|
|
384
|
+
- Forbids inventing stacks, features, examples, or speculative gaps.
|
|
385
|
+
|
|
386
|
+
1. Put global Cursor rules in `~/.cursor/rules`; put project rules in `.cursor/rules` and optional docs in `docs/` / `AGENTS.md` / `README.md`.
|
|
387
|
+
2. Optionally include a slash skill such as `/grill-with-docs` (skills live under `.agents/skills`, `.cursor/skills`, `~/.agents/skills`, or Hermes `~/.hermes/skills`).
|
|
388
|
+
3. Focus the Cursor chat input and type a rough prompt. Do not send it.
|
|
389
|
+
4. Press **Ctrl+Shift+Alt+E** or **F9**.
|
|
390
|
+
5. Review the expanded text in the input. The message is not sent.
|
|
391
|
+
6. If a slash skill appears as plain text (not a teal chip), re-select it from Cursor’s skill menu so it is marked again — the extension cannot recreate Cursor’s chip UI.
|
|
392
|
+
|
|
393
|
+
Use **Rewrite** when you only want cleaner wording. Use **Expand** when you want a longer agent-ready Grill-with-Docs prompt.
|
|
394
|
+
|
|
395
|
+
### Suggest the next prompt from chat context (macOS)
|
|
396
|
+
|
|
397
|
+
Uses the shared context stack and **always** loads chat history from agent transcripts. Reasons with Grill-with-Docs internally, then replaces the input with **only** the ready-to-send next prompt. To keep local Ollama fast and avoid README echo, F12 (like F8) skips root docs, the docs folder, and Cursor global rules (project `.cursor/rules` and architecture defaults still apply). F8 additionally skips chat history so rewrite cannot invent a different task from transcripts.
|
|
398
|
+
|
|
399
|
+
1. Have at least one prior assistant reply in the current Cursor chat.
|
|
400
|
+
2. Focus the chat input (it may be empty, or contain a short continue hint).
|
|
401
|
+
3. Press **Ctrl+Shift+Alt+N** or **F12**.
|
|
402
|
+
4. Review the suggested next prompt in the input. The message is not sent.
|
|
403
|
+
|
|
404
|
+
If Ollama times out, raise `promptRewriter.ollamaTimeoutMs` or switch `promptRewriter.ollamaModel` to `qwen2.5-coder:7b` (large models like 32b often exceed 60s with long context).
|
|
405
|
+
|
|
406
|
+
### Expand the current input as JSON (macOS)
|
|
407
|
+
|
|
408
|
+
Same behavior as **Expand Current Input** (Cursor global rules, rules folder, root docs, docs folder, SOLID/hexagonal defaults, faithful expansion), but the result is pretty-printed JSON:
|
|
409
|
+
|
|
410
|
+
```json
|
|
411
|
+
{
|
|
412
|
+
"goal": "...",
|
|
413
|
+
"constraints": ["..."],
|
|
414
|
+
"non_goals": ["..."],
|
|
415
|
+
"acceptance_criteria": ["..."]
|
|
416
|
+
}
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
1. Focus the Cursor chat input and type a rough prompt. Do not send it.
|
|
420
|
+
2. Press **Ctrl+Shift+Alt+J** or **F10**.
|
|
421
|
+
3. Review the JSON in the input. The message is not sent.
|
|
422
|
+
|
|
423
|
+
### Expand the current input as a loop (macOS)
|
|
424
|
+
|
|
425
|
+
Same capture/replace flow and shared context stack as **Expand Current Input** (F9), but the result is a **loop structure** (iteration instructions to repeat work until done), not a one-shot prompt. It writes the loop into the chat input; it does not execute the loop.
|
|
426
|
+
|
|
427
|
+
- Output format: Grill-with-Docs sections (`### Goal`, `### Loop`, `### Constraints`, `### Non-Goals`, `### Acceptance Criteria`).
|
|
428
|
+
- `### Loop` is included only when the input already has iteration details (what to repeat, when to stop, cadence). Interval, cadence, and stop conditions are not invented.
|
|
429
|
+
|
|
430
|
+
1. Focus the Cursor chat input and type a rough request. Do not send it.
|
|
431
|
+
2. Press **F7**.
|
|
432
|
+
3. Review the loop in the input. The message is not sent.
|
|
433
|
+
|
|
434
|
+
### Expand the current input as a JSON loop (macOS)
|
|
435
|
+
|
|
436
|
+
Same behavior as **Expand Current Input (Loop)** (F7), but the result is pretty-printed JSON:
|
|
437
|
+
|
|
438
|
+
```json
|
|
439
|
+
{
|
|
440
|
+
"expert_role": "Act as a …",
|
|
441
|
+
"goal": "...",
|
|
442
|
+
"loop": ["..."],
|
|
443
|
+
"constraints": ["..."],
|
|
444
|
+
"non_goals": ["..."],
|
|
445
|
+
"acceptance_criteria": ["..."]
|
|
446
|
+
}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
`loop` is omitted when the input has no iteration details.
|
|
450
|
+
|
|
451
|
+
1. Focus the Cursor chat input and type a rough request. Do not send it.
|
|
452
|
+
2. Press **F6**.
|
|
453
|
+
3. Review the JSON loop in the input. The message is not sent.
|
|
454
|
+
|
|
455
|
+
### Rewrite a selection in the editor
|
|
456
|
+
|
|
457
|
+
1. Configure `promptRewriter.apiKey`, `promptRewriter.baseUrl`, and `promptRewriter.model`.
|
|
458
|
+
2. Select the prompt text in the editor.
|
|
459
|
+
3. Run **Rewrite Prompt** from the Command Palette, or press `Ctrl+Alt+Shift+R` (`Cmd+Alt+Shift+R` on macOS).
|
|
460
|
+
4. Review the original vs rewritten diff.
|
|
461
|
+
5. Choose **Accept** to replace the selection, or **Cancel** to keep the original text.
|
|
462
|
+
|
|
463
|
+
If nothing is selected, the extension shows a warning and does not call the LLM.
|
|
464
|
+
|
|
465
|
+
### Rewrite a prompt from any text field, including Cursor chat
|
|
466
|
+
|
|
467
|
+
This command uses only the standard VS Code clipboard API. It does not use Cursor-internal APIs and does not type into the chat input.
|
|
468
|
+
|
|
469
|
+
1. Start Ollama and pull a Qwen model if needed (`ollama pull qwen2.5-coder:7b`).
|
|
470
|
+
2. Optionally set `promptRewriter.ollamaBaseUrl` and `promptRewriter.ollamaModel`.
|
|
471
|
+
3. Write the prompt in any text field, including the Cursor chat input.
|
|
472
|
+
4. Copy the text to the clipboard (`Cmd+C` or `Ctrl+C`).
|
|
473
|
+
5. Run **Rewrite Clipboard Prompt** from the Command Palette, or press `Ctrl+Alt+Shift+C` (`Cmd+Alt+Shift+C` on macOS).
|
|
474
|
+
6. Wait for the notification that the rewritten prompt is ready.
|
|
475
|
+
7. Paste it manually (`Cmd+V` or `Ctrl+V`).
|
|
476
|
+
|
|
477
|
+
If the clipboard is empty, the extension shows an error and does not call Ollama. If Ollama fails, the original clipboard text is left unchanged.
|
|
478
|
+
|
|
479
|
+
## Keyboard shortcuts
|
|
480
|
+
|
|
481
|
+
| Command | Default shortcut | Context |
|
|
482
|
+
| --- | --- | --- |
|
|
483
|
+
| **Rewrite Current Input** | `Ctrl+Shift+Alt+P` or `F8` | Global. Strict cleaner |
|
|
484
|
+
| **Expand Current Input** | `Ctrl+Shift+Alt+E` or `F9` | Global. Faithful prompt engineer (markdown) |
|
|
485
|
+
| **Expand Current Input (JSON)** | `Ctrl+Shift+Alt+J` or `F10` | Global. Same expand, JSON output |
|
|
486
|
+
| **Expand Current Input (Loop)** | `F7` | Global. Same expand as F9, writes a loop structure |
|
|
487
|
+
| **Expand Current Input (Loop JSON)** | `F6` | Global. Same loop as F7, JSON output |
|
|
488
|
+
| **Suggest Next Prompt** | `Ctrl+Shift+Alt+N` or `F12` | Global. Next ready-to-send prompt from last chat |
|
|
489
|
+
| **Rewrite Prompt** | `Ctrl+Alt+Shift+R` (macOS: `Cmd+Alt+Shift+R`) | Editor focused |
|
|
490
|
+
| **Rewrite Clipboard Prompt** | `Ctrl+Alt+Shift+C` (macOS: `Cmd+Alt+Shift+C`) | Global |
|
|
491
|
+
|
|
492
|
+
To change a shortcut:
|
|
493
|
+
|
|
494
|
+
1. Open **Keyboard Shortcuts**.
|
|
495
|
+
2. Search for `Rewrite Prompt` or `Rewrite Clipboard Prompt`.
|
|
496
|
+
3. Assign a new keybinding.
|
|
497
|
+
|
|
498
|
+
## Environment variables and secrets
|
|
499
|
+
|
|
500
|
+
This extension does not read `.env` files or environment variables. Configure the API key through `promptRewriter.apiKey` in editor settings. Never commit real secrets.
|
|
501
|
+
|
|
502
|
+
## License
|
|
503
|
+
|
|
504
|
+
MIT
|
package/media/icon.png
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@infosuweb/prompt-rewriter",
|
|
3
|
+
"displayName": "Prompt Rewriter",
|
|
4
|
+
"description": "Rewrite a selected prompt so it is clearer and more precise, without adding new ideas.",
|
|
5
|
+
"version": "0.14.2-rc.37",
|
|
6
|
+
"publisher": "suweb",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://gitlab.com/suweb1/llm-extension.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://www.npmjs.com/package/@infosuweb/prompt-rewriter",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://gitlab.com/suweb1/llm-extension/-/issues"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public",
|
|
18
|
+
"registry": "https://registry.npmjs.org/"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"releases/prompt-rewriter-latest.vsix",
|
|
22
|
+
"media/icon.png",
|
|
23
|
+
"README.md",
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"vscode",
|
|
29
|
+
"cursor",
|
|
30
|
+
"extension",
|
|
31
|
+
"prompt",
|
|
32
|
+
"vsix"
|
|
33
|
+
],
|
|
34
|
+
"icon": "media/icon.png",
|
|
35
|
+
"engines": {
|
|
36
|
+
"vscode": "^1.80.0"
|
|
37
|
+
},
|
|
38
|
+
"categories": [
|
|
39
|
+
"Other"
|
|
40
|
+
],
|
|
41
|
+
"activationEvents": [
|
|
42
|
+
"onView:promptRewriter.configView",
|
|
43
|
+
"onCommand:promptRewriter.openConfiguration",
|
|
44
|
+
"onCommand:promptRewriter.rewritePrompt",
|
|
45
|
+
"onCommand:promptRewriter.rewriteClipboardPrompt",
|
|
46
|
+
"onCommand:promptRewriter.rewriteCurrentInput",
|
|
47
|
+
"onCommand:promptRewriter.expandCurrentInput",
|
|
48
|
+
"onCommand:promptRewriter.expandJsonCurrentInput",
|
|
49
|
+
"onCommand:promptRewriter.expandLoopCurrentInput",
|
|
50
|
+
"onCommand:promptRewriter.expandLoopJsonCurrentInput",
|
|
51
|
+
"onCommand:promptRewriter.suggestNextCurrentInput",
|
|
52
|
+
"onCommand:promptRewriter.selectOllamaModel",
|
|
53
|
+
"onCommand:promptRewriter.selectLlmBackend",
|
|
54
|
+
"onCommand:promptRewriter.selectActiveModel",
|
|
55
|
+
"onCommand:promptRewriter.importHermesSettings"
|
|
56
|
+
],
|
|
57
|
+
"main": "./out/extension.js",
|
|
58
|
+
"contributes": {
|
|
59
|
+
"viewsContainers": {
|
|
60
|
+
"activitybar": [
|
|
61
|
+
{
|
|
62
|
+
"id": "prompt-rewriter",
|
|
63
|
+
"title": "Prompt Rewriter",
|
|
64
|
+
"icon": "media/prompt-rewriter.svg"
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"views": {
|
|
69
|
+
"prompt-rewriter": [
|
|
70
|
+
{
|
|
71
|
+
"type": "webview",
|
|
72
|
+
"id": "promptRewriter.configView",
|
|
73
|
+
"name": "Setup"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
"commands": [
|
|
78
|
+
{
|
|
79
|
+
"command": "promptRewriter.openConfiguration",
|
|
80
|
+
"title": "Open Configuration",
|
|
81
|
+
"category": "Prompt Rewriter"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"command": "promptRewriter.rewritePrompt",
|
|
85
|
+
"title": "Rewrite Prompt",
|
|
86
|
+
"category": "Prompt Rewriter"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"command": "promptRewriter.rewriteClipboardPrompt",
|
|
90
|
+
"title": "Rewrite Clipboard Prompt",
|
|
91
|
+
"category": "Prompt Rewriter"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"command": "promptRewriter.rewriteCurrentInput",
|
|
95
|
+
"title": "Rewrite Current Input",
|
|
96
|
+
"category": "Prompt Rewriter"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"command": "promptRewriter.expandCurrentInput",
|
|
100
|
+
"title": "Expand Current Input",
|
|
101
|
+
"category": "Prompt Rewriter"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"command": "promptRewriter.expandJsonCurrentInput",
|
|
105
|
+
"title": "Expand Current Input (JSON)",
|
|
106
|
+
"category": "Prompt Rewriter"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"command": "promptRewriter.expandLoopCurrentInput",
|
|
110
|
+
"title": "Expand Current Input (Loop)",
|
|
111
|
+
"category": "Prompt Rewriter"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"command": "promptRewriter.expandLoopJsonCurrentInput",
|
|
115
|
+
"title": "Expand Current Input (Loop JSON)",
|
|
116
|
+
"category": "Prompt Rewriter"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"command": "promptRewriter.suggestNextCurrentInput",
|
|
120
|
+
"title": "Suggest Next Prompt",
|
|
121
|
+
"category": "Prompt Rewriter"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"command": "promptRewriter.selectOllamaModel",
|
|
125
|
+
"title": "Select Ollama Model",
|
|
126
|
+
"category": "Prompt Rewriter"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"command": "promptRewriter.selectLlmBackend",
|
|
130
|
+
"title": "Select LLM Backend",
|
|
131
|
+
"category": "Prompt Rewriter"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"command": "promptRewriter.selectActiveModel",
|
|
135
|
+
"title": "Select Active Model",
|
|
136
|
+
"category": "Prompt Rewriter"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"command": "promptRewriter.importHermesSettings",
|
|
140
|
+
"title": "Import Hermes Model Settings",
|
|
141
|
+
"category": "Prompt Rewriter"
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"keybindings": [
|
|
145
|
+
{
|
|
146
|
+
"command": "promptRewriter.rewritePrompt",
|
|
147
|
+
"key": "ctrl+alt+shift+r",
|
|
148
|
+
"mac": "cmd+alt+shift+r",
|
|
149
|
+
"when": "editorTextFocus"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"command": "promptRewriter.rewriteClipboardPrompt",
|
|
153
|
+
"key": "ctrl+alt+shift+c",
|
|
154
|
+
"mac": "cmd+alt+shift+c"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"command": "promptRewriter.rewriteCurrentInput",
|
|
158
|
+
"key": "ctrl+shift+alt+p",
|
|
159
|
+
"mac": "ctrl+shift+alt+p"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"command": "promptRewriter.rewriteCurrentInput",
|
|
163
|
+
"key": "f8"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"command": "promptRewriter.expandCurrentInput",
|
|
167
|
+
"key": "ctrl+shift+alt+e",
|
|
168
|
+
"mac": "ctrl+shift+alt+e"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"command": "promptRewriter.expandCurrentInput",
|
|
172
|
+
"key": "f9"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"command": "promptRewriter.expandJsonCurrentInput",
|
|
176
|
+
"key": "ctrl+shift+alt+j",
|
|
177
|
+
"mac": "ctrl+shift+alt+j"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"command": "promptRewriter.expandJsonCurrentInput",
|
|
181
|
+
"key": "f10"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"command": "promptRewriter.expandLoopCurrentInput",
|
|
185
|
+
"key": "f7"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"command": "promptRewriter.expandLoopJsonCurrentInput",
|
|
189
|
+
"key": "f6"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"command": "promptRewriter.suggestNextCurrentInput",
|
|
193
|
+
"key": "ctrl+shift+alt+n",
|
|
194
|
+
"mac": "ctrl+shift+alt+n"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"command": "promptRewriter.suggestNextCurrentInput",
|
|
198
|
+
"key": "f12"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"configuration": {
|
|
202
|
+
"title": "Prompt Rewriter",
|
|
203
|
+
"properties": {
|
|
204
|
+
"promptRewriter.apiKey": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"default": "",
|
|
207
|
+
"description": "API key for the OpenAI-compatible LLM provider. Do not commit this value."
|
|
208
|
+
},
|
|
209
|
+
"promptRewriter.baseUrl": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"default": "https://api.openai.com/v1",
|
|
212
|
+
"description": "Base URL of an OpenAI-compatible Chat Completions API, for example https://api.openai.com/v1."
|
|
213
|
+
},
|
|
214
|
+
"promptRewriter.model": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"default": "",
|
|
217
|
+
"description": "Model identifier sent to the OpenAI-compatible provider, for example gpt-4o-mini or meituan/longcat-2.0:free (Hermes proxy)."
|
|
218
|
+
},
|
|
219
|
+
"promptRewriter.backend": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"enum": [
|
|
222
|
+
"ollama",
|
|
223
|
+
"openai",
|
|
224
|
+
"anthropic",
|
|
225
|
+
"google",
|
|
226
|
+
"openaiCompatible",
|
|
227
|
+
"cursorAgents"
|
|
228
|
+
],
|
|
229
|
+
"default": "ollama",
|
|
230
|
+
"description": "LLM backend for F6/F7/F8/F9/F10/F12 and Rewrite Clipboard: ollama (local), openai, anthropic (Claude), google (Gemini), openaiCompatible (Hermes/custom), or cursorAgents (Cursor Agent CLI)."
|
|
231
|
+
},
|
|
232
|
+
"promptRewriter.cursorApiKey": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"default": "",
|
|
235
|
+
"description": "Optional Cursor API key for the cursorAgents backend. Prefer `agent login` / CURSOR_API_KEY when unset. Do not commit this value."
|
|
236
|
+
},
|
|
237
|
+
"promptRewriter.anthropicApiKey": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"default": "",
|
|
240
|
+
"description": "Anthropic/Claude API key used when promptRewriter.backend is anthropic. Do not commit this value."
|
|
241
|
+
},
|
|
242
|
+
"promptRewriter.anthropicBaseUrl": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"default": "https://api.anthropic.com",
|
|
245
|
+
"description": "Anthropic API base URL (usually https://api.anthropic.com)."
|
|
246
|
+
},
|
|
247
|
+
"promptRewriter.anthropicWorkspaceId": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"default": "",
|
|
250
|
+
"description": "Anthropic workspace ID (wrkspc_…) required for identity-linked / multi-workspace API keys. Sent as the anthropic-workspace-id header."
|
|
251
|
+
},
|
|
252
|
+
"promptRewriter.googleApiKey": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"default": "",
|
|
255
|
+
"description": "Google AI Studio API key used when promptRewriter.backend is google. Do not commit this value."
|
|
256
|
+
},
|
|
257
|
+
"promptRewriter.googleBaseUrl": {
|
|
258
|
+
"type": "string",
|
|
259
|
+
"default": "https://generativelanguage.googleapis.com/v1beta/openai/",
|
|
260
|
+
"description": "Google Gemini OpenAI-compatible base URL (default: generativelanguage.googleapis.com/v1beta/openai/)."
|
|
261
|
+
},
|
|
262
|
+
"promptRewriter.googleModel": {
|
|
263
|
+
"type": "string",
|
|
264
|
+
"default": "gemini-3.6-flash",
|
|
265
|
+
"description": "Preferred Gemini model id when promptRewriter.backend is google, for example gemini-3.6-flash."
|
|
266
|
+
},
|
|
267
|
+
"promptRewriter.catalogFreeOnly": {
|
|
268
|
+
"type": "boolean",
|
|
269
|
+
"default": false,
|
|
270
|
+
"description": "When true, the configuration panel prefers Hermes/OpenAI model ids ending with :free. You can still type any model id."
|
|
271
|
+
},
|
|
272
|
+
"promptRewriter.ollamaBaseUrl": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"default": "http://localhost:11434",
|
|
275
|
+
"description": "Base URL of the local Ollama server used by Rewrite Clipboard Prompt."
|
|
276
|
+
},
|
|
277
|
+
"promptRewriter.ollamaModel": {
|
|
278
|
+
"type": "string",
|
|
279
|
+
"default": "qwen2.5-coder:7b",
|
|
280
|
+
"description": "Ollama model identifier for Rewrite Current Input / Clipboard, for example qwen2.5-coder:7b."
|
|
281
|
+
},
|
|
282
|
+
"promptRewriter.ollamaTimeoutMs": {
|
|
283
|
+
"type": "number",
|
|
284
|
+
"default": 180000,
|
|
285
|
+
"minimum": 10000,
|
|
286
|
+
"maximum": 600000,
|
|
287
|
+
"description": "Timeout in milliseconds for Ollama requests used by current-input and clipboard commands. Default: 180000 (3 minutes)."
|
|
288
|
+
},
|
|
289
|
+
"promptRewriter.contextFolder": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"default": ".cursor/rules",
|
|
292
|
+
"description": "Workspace-relative folder whose .md/.mdc/.txt files are loaded as rules/context for Rewrite/Expand Current Input (F6/F7/F8/F9/F10)."
|
|
293
|
+
},
|
|
294
|
+
"promptRewriter.includeRootDocs": {
|
|
295
|
+
"type": "boolean",
|
|
296
|
+
"default": true,
|
|
297
|
+
"description": "When true, Rewrite/Expand Current Input (F6/F7/F8/F9/F10) also load AGENTS.md, README.md, and .cursorrules from the workspace root if present."
|
|
298
|
+
},
|
|
299
|
+
"promptRewriter.includeGlobalCursorRules": {
|
|
300
|
+
"type": "boolean",
|
|
301
|
+
"default": true,
|
|
302
|
+
"description": "When true, Rewrite/Expand Current Input (F6/F7/F8/F9/F10) load Cursor global/user rules from ~/.cursor/rules into the LLM context."
|
|
303
|
+
},
|
|
304
|
+
"promptRewriter.disabledGlobalCursorRuleFiles": {
|
|
305
|
+
"type": "array",
|
|
306
|
+
"items": {
|
|
307
|
+
"type": "string"
|
|
308
|
+
},
|
|
309
|
+
"default": [],
|
|
310
|
+
"description": "Global rule file names under ~/.cursor/rules excluded from rewrite/expand context even when includeGlobalCursorRules is true."
|
|
311
|
+
},
|
|
312
|
+
"promptRewriter.disabledContextRuleFiles": {
|
|
313
|
+
"type": "array",
|
|
314
|
+
"items": {
|
|
315
|
+
"type": "string"
|
|
316
|
+
},
|
|
317
|
+
"default": [],
|
|
318
|
+
"description": "Workspace rule file names (relative to contextFolder) excluded from rewrite/expand context."
|
|
319
|
+
},
|
|
320
|
+
"promptRewriter.docsFolder": {
|
|
321
|
+
"type": "string",
|
|
322
|
+
"default": "docs",
|
|
323
|
+
"description": "Workspace-relative docs folder loaded by Rewrite/Expand Current Input (.md/.mdc/.txt). Set empty to disable."
|
|
324
|
+
},
|
|
325
|
+
"promptRewriter.includeArchitectureDefaults": {
|
|
326
|
+
"type": "boolean",
|
|
327
|
+
"default": true,
|
|
328
|
+
"description": "When true, Rewrite/Expand Current Input include built-in SOLID and hexagonal architecture constraints for software tasks."
|
|
329
|
+
},
|
|
330
|
+
"promptRewriter.includeLastChatResponse": {
|
|
331
|
+
"type": "boolean",
|
|
332
|
+
"default": true,
|
|
333
|
+
"description": "When true, Expand Current Input (F6/F7/F9/F10) include chat history from Cursor agent transcripts: the current conversation (user + assistant turns) plus older project transcripts when the character budget allows. F8 Rewrite always skips chat history. F12 Suggest Next always loads it."
|
|
334
|
+
},
|
|
335
|
+
"promptRewriter.rewriteSystemPromptRules": {
|
|
336
|
+
"type": "string",
|
|
337
|
+
"default": "",
|
|
338
|
+
"editPresentation": "multilineText",
|
|
339
|
+
"description": "Custom system prompt for Rewrite Current Input (F8). When empty, the built-in strict rewrite rules are used (no inference, no gap-filling, preserve ambiguity) and always prefix a context-grounded expert agent persona. Editable from the Rules tab."
|
|
340
|
+
},
|
|
341
|
+
"promptRewriter.expandSystemPromptRules": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"default": "",
|
|
344
|
+
"editPresentation": "multilineText",
|
|
345
|
+
"description": "Custom system prompt for Expand Current Input (F9). When empty, the built-in Grill-with-Docs expand rules are used, including a context-grounded Act as a … expert role line. Editable from the Rules tab."
|
|
346
|
+
},
|
|
347
|
+
"promptRewriter.expandJsonSystemPromptRules": {
|
|
348
|
+
"type": "string",
|
|
349
|
+
"default": "",
|
|
350
|
+
"editPresentation": "multilineText",
|
|
351
|
+
"description": "Custom system prompt for Expand Current Input (JSON) (F10). When empty, the built-in JSON expand rules are used, including a required expert_role (Act as a …). Editable from the Rules tab."
|
|
352
|
+
},
|
|
353
|
+
"promptRewriter.loopSystemPromptRules": {
|
|
354
|
+
"type": "string",
|
|
355
|
+
"default": "",
|
|
356
|
+
"editPresentation": "multilineText",
|
|
357
|
+
"description": "Custom system prompt for Expand Current Input (Loop) (F7). When empty, the built-in Grill-with-Docs loop rules are used, including a context-grounded Act as a … expert role line. Editable from the Rules tab."
|
|
358
|
+
},
|
|
359
|
+
"promptRewriter.loopJsonSystemPromptRules": {
|
|
360
|
+
"type": "string",
|
|
361
|
+
"default": "",
|
|
362
|
+
"editPresentation": "multilineText",
|
|
363
|
+
"description": "Custom system prompt for Expand Current Input (Loop JSON) (F6). When empty, the built-in JSON loop rules are used, including a required expert_role (Act as a …). Editable from the Rules tab."
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"scripts": {
|
|
369
|
+
"vscode:prepublish": "npm run compile",
|
|
370
|
+
"compile": "tsc -p ./",
|
|
371
|
+
"watch": "tsc -watch -p ./",
|
|
372
|
+
"lint": "eslint src",
|
|
373
|
+
"typecheck": "tsc --noEmit -p ./",
|
|
374
|
+
"check:version": "node scripts/check-version-sync.mjs",
|
|
375
|
+
"check:changelog": "node scripts/check-changelog-has-version.mjs",
|
|
376
|
+
"test": "npm run check:version && vitest run",
|
|
377
|
+
"preversion": "npm run check:version && npm run typecheck && npm run test",
|
|
378
|
+
"version": "npm run check:changelog",
|
|
379
|
+
"postversion": "npm run package",
|
|
380
|
+
"release:patch": "npm version patch -m \"chore(release): %s\"",
|
|
381
|
+
"release:minor": "npm version minor -m \"chore(release): %s\"",
|
|
382
|
+
"release:major": "npm version major -m \"chore(release): %s\"",
|
|
383
|
+
"package": "node scripts/package-vsix.mjs",
|
|
384
|
+
"publish:npm": "npm run package && npm publish --access public --tag rc"
|
|
385
|
+
},
|
|
386
|
+
"devDependencies": {
|
|
387
|
+
"@eslint/js": "^9.34.0",
|
|
388
|
+
"@types/node": "^22.17.0",
|
|
389
|
+
"@types/vscode": "^1.80.0",
|
|
390
|
+
"@vscode/vsce": "^3.6.0",
|
|
391
|
+
"eslint": "^9.34.0",
|
|
392
|
+
"typescript": "^5.9.2",
|
|
393
|
+
"typescript-eslint": "^8.41.0",
|
|
394
|
+
"vitest": "^3.2.4"
|
|
395
|
+
}
|
|
396
|
+
}
|
|
Binary file
|