@infosuweb/prompt-rewriter 0.14.3 → 0.14.4

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 CHANGED
@@ -7,53 +7,67 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [0.14.3] - 2026-09-01
11
-
10
+ ## [0.14.4] - 2026-09-08
11
+
12
+ - **0.14.2-rc.40**: Ground worker summaries in bounded verbatim excerpts, preserve exact rules/skills and source-channel provenance, defer unused worker validation, and require local RC installation in both Cursor and VS Code.
13
+ - **0.14.2-rc.39**: Optional context worker for F6/F7/F9/F10 summarizes oversized project context with an independent backend/model, safe usage metrics, cancellation, and original-context fallback.
14
+ - **0.14.2-rc.38**: README logo uses an absolute jsDelivr URL so the icon renders on the npm package page (relative `./media/icon.png` breaks there).
15
+ - **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.
16
+ - **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).
17
+ - **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.
18
+ - **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.
19
+ - **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.
20
+ - **0.14.2-rc.31**: README — centered `./media/icon.png` logo (128×128) and Marketplace-style Features header; sideload-only install docs unchanged.
21
+ - 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`).
22
+ - **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.
23
+ - **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.
24
+ - **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.
25
+ - **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.
26
+ - **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”.
27
+ - **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.
28
+ - **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).
29
+ - **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.
30
+ - **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).
31
+ - **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.
32
+ - **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.
33
+ - **0.14.2-rc.19**: Rules tab — editable F8 `rewriteSystemPromptRules` (custom rewrite system prompt); empty keeps built-in strict defaults (no inference / preserve ambiguity).
34
+ - **0.14.2-rc.18**: Anthropic workspace ID — strip `/keys` and Console URL path junk when pasting `wrkspc_…` into Setup.
12
35
  ### Added
13
36
 
14
- - Opt-in anonymous usage metrics — command invocations (F6–F12, rewrite selection/clipboard), first-run consent prompt, Rules → Privacy toggle, local aggregates, optional HTTPS endpoint, `Copy Usage Metrics Summary` command; documented in `docs/usage-metrics.md`.
37
+ - **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.
38
+ - **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.
39
+ - **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.
40
+ - **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.
41
+ - **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.
42
+ - **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.
43
+ - Extension marketplace / Activity Bar icon: comic speech-bubble mark.
44
+ - Backend **google** (Gemini via Google’s OpenAI-compatible API) with `promptRewriter.googleApiKey` / `googleBaseUrl` / `googleModel`.
15
45
 
16
46
  ### Fixed
17
47
 
18
- - F8 rewrite validation — positive invention detection with retry and safe fallback instead of brittle token-recall rejections.
19
- - Preserve attached files, screenshots, and pasted console error blocks during rewrite (verbatim placeholders and extended attachment detection).
20
- - Attachment handling after F8 — keep `@.env` when Cursor copy serializes that way; re-chip to U+FFFC only when the original capture already contained chips (fixes invisible attachments from bare U+FFFC writes).
21
-
22
- ## [0.14.2] - 2026-09-01
23
-
24
- ### Added
25
-
26
- - Publish `@infosuweb/prompt-rewriter` to npm (public scoped package with sideload `.vsix`); GitLab Pages and raw installer links.
27
- - Rules tab — agent context settings, editable F8/F9/F10 system prompts, global/workspace rule files with include toggles, in-panel skill creation (`SKILL.md`), and collapsible sections.
28
- - F6/F7 loop structures (JSON / Grill-with-Docs) written into chat input (not executed).
29
- - Backend **google** (Gemini) with native model listing and `promptRewriter.googleApiKey` / `googleBaseUrl` / `googleModel`.
30
- - Backend **cursorAgent** (Cursor Agents CLI) with correct API-key handling separate from OpenAI-compatible keys.
31
- - Curated provider order in Setup (Cursor Agents and paid cloud APIs first).
32
- - `includeLastChatResponse` loads full current chat turns plus budgeted agent transcripts.
33
- - Extension Activity Bar icon and Setup/Rules segmented panel with version display.
34
- - Product improvement backlog in `docs/proposed-improvements.md`.
35
-
36
- ### Fixed
37
-
38
- - F8 rewrite validation — replace token-recall false rejections with positive invention detection; retry and safe fallback keep operator text verbatim.
39
- - Preserve attached files, screenshots, and pasted console error blocks during rewrite (extended `@` / backtick / extension-output detection and verbatim placeholders).
40
- - Attachment handling after F8 — keep `@.env` and bracket labels when Cursor copy serializes that way; re-chip to U+FFFC only when the original capture already contained chips.
41
- - F8 inventing unrelated tasks from chat history — skip transcripts and reject ungrounded model replies.
42
- - F8 echoing `.cursor/rules` / README into chat — lean rewrite context and anti-echo framing.
43
- - Anthropic identity-linked keys — workspace ID header, Setup guidance, and URL normalization.
44
- - Google/Gemini — native `:generateContent` API, Gemini 3.x defaults, live model listing for the configured key.
45
- - OpenAI Setup no longer shows Anthropic base URL after switching providers.
46
- - Cursor Agents backend no longer passes generic OpenAI API key to the Agent CLI.
47
- - Workspace/global rule file create defaults extensionless names to `.mdc`.
48
- - README npm logo uses absolute jsDelivr URL so the icon renders on the package page.
48
+ - Repair valid rewrites that would previously fail the lexical grounding check after restructuring or translating wording.
49
+ - Reject unsupported sections, operational work, file paths, examples, and no-op model responses across prompt modes.
50
+ - **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`.
51
+ - **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`.
52
+ - **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.
53
+ - **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.
54
+ - **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.
55
+ - **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.
56
+ - **0.14.2-rc.4**: Ship progressive Setup disclosure, Google native model listing, and silent curated fallback (no catalog 404 alert) for local testing.
57
+ - 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).
58
+ - 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.
59
+ - Configuration panel no longer shows the backend info alert (e.g. “Runs locally through Ollama…”).
60
+ - 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).
49
61
 
50
62
  ### Changed
51
63
 
52
- - Packaged `.vsix` artifacts under `versions/` with tracked `releases/prompt-rewriter-latest.vsix` for token-free install.
53
- - Configuration sidebar redesigned as minimal **Setup** panel with provider/model pickers, brand icons, and progressive disclosure.
54
- - Progress notifications show the active model during rewrite/expand shortcuts.
55
- - Token-free installer distribution via GitLab Pages and npm `npm pack`.
56
-
64
+ - Ground expert roles across F6-F12 using the operator request and bounded project context.
65
+ - Make repeated F8 calls produce a material refinement instead of repeating the same prompt.
66
+ - Retain bounded project identity in F8 and F12 without loading heavy documentation or global rules.
67
+ - Packaged `.vsix` artifacts are written to `versions/` instead of the repository root.
68
+ - Configuration sidebar redesigned as a minimal **Setup** panel: provider/model pickers with icons, clearer alerts, and plain-language status copy.
69
+ - Progress notifications for rewrite/expand shortcuts now show the active model instead of a vague status-bar-only spinner.
70
+ - Setup panel provider/model icons now use official brand marks (Ollama, OpenAI, Anthropic/Claude, Google/Gemini, Qwen, Meta, LongCat, StepFun, Upstage, OpenRouter).
57
71
 
58
72
  ## [0.14.1] - 2026-08-30
59
73
 
package/README.md CHANGED
@@ -11,12 +11,12 @@ Independent commands:
11
11
 
12
12
  | Command | Shortcut | Description |
13
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). |
14
+ | **Rewrite Current Input** | **F8** | Cleans and iteratively improves wording without inventing ideas, and prefixes a task/project-grounded expert persona (`Act as a …`). Uses skills plus a bounded 6,000-character view of workspace rules and configured root docs; skips chat history, the docs folder, and global rules. Repeating F8 must produce a material refinement rather than the same result. |
15
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
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
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
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). |
19
+ | **Suggest Next Prompt** | **F12** | Uses chat history plus bounded project identity to propose the next ready-to-send agent prompt with a grounded expert role (Grill-with-Docs is used only as internal reasoning, not written into the input). |
20
20
  | **Rewrite Prompt** | — | Rewrites the current editor selection and shows a diff before replacing it. |
21
21
  | **Rewrite Clipboard Prompt** | — | Rewrites the current clipboard text and copies the result back for a manual paste. |
22
22
  | **Open Configuration** | — | Opens the sidebar panel to pick backend + model and save. |
@@ -25,6 +25,8 @@ Independent commands:
25
25
  | **Select Ollama Model** | — | Lists local Ollama models only (same `GET /api/tags` catalog Hermes uses) and saves `promptRewriter.ollamaModel`. |
26
26
  | **Import Hermes Model Settings** | — | Copies Hermes Agent’s primary local model (`hermes config get model.*`) into Prompt Rewriter Ollama settings. |
27
27
 
28
+ Every F6-F12 transformation enforces a specific expert role, validates its output format and scope, rejects invented operational work or file paths, and makes one focused repair attempt when a model response fails those checks. API keys, prompts, file contents, file names, and generated text are never sent to usage metrics.
29
+
28
30
  ## Prerequisites
29
31
 
30
32
  - Visual Studio Code 1.80+ or Cursor (any recent build that installs standard VS Code extensions)
@@ -161,6 +163,11 @@ Open **Settings** and set:
161
163
  | Setting | Purpose |
162
164
  | --- | --- |
163
165
  | `promptRewriter.backend` | `ollama` (local), `openai` (official API), `anthropic` (Claude API), `google` (Gemini), `cursorAgents` (Cursor Agent CLI), or `openaiCompatible` (Hermes/custom). Default: `ollama` |
166
+ | `promptRewriter.worker.enabled` | Opt-in context worker for **F6/F7/F9/F10**. Oversized context is summarized before the main model call. **F8/F12 never delegate.** Default: `false` |
167
+ | `promptRewriter.worker.backend` | Worker backend, independent from the main backend: `ollama`, `openai`, `anthropic`, `google`, or `openaiCompatible`. It reuses that backend's existing credentials, URL, and timeout. Default: `ollama` |
168
+ | `promptRewriter.worker.model` | Worker model id, independent from the main model. Required when the worker is enabled. |
169
+ | `promptRewriter.worker.maxContextChars` | Character threshold above which expand context is summarized. Default: `12000` |
170
+ | `promptRewriter.worker.maxOutputTokens` | Maximum worker context-selection output tokens. Default: `768` |
164
171
  | `promptRewriter.apiKey` | API key for OpenAI / Hermes / openaiCompatible. Do not commit. |
165
172
  | `promptRewriter.cursorApiKey` | Optional Cursor API key when `backend` is `cursorAgents`. Prefer `agent login` / `CURSOR_API_KEY` when unset. |
166
173
  | `promptRewriter.anthropicApiKey` | Anthropic/Claude API key when `backend` is `anthropic`. |
@@ -172,13 +179,13 @@ Open **Settings** and set:
172
179
  | `promptRewriter.ollamaBaseUrl` | Local Ollama server used when `backend` is `ollama`. Default: `http://localhost:11434` |
173
180
  | `promptRewriter.ollamaModel` | Ollama model used by those commands. Default: `qwen2.5-coder:7b` |
174
181
  | `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` |
182
+ | `promptRewriter.contextFolder` | Workspace-relative folder of rules/context for **F6-F12**. Default: `.cursor/rules` |
176
183
  | `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
184
  | `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` |
185
+ | `promptRewriter.disabledContextRuleFiles` | Workspace rule file names (relative to `contextFolder`) excluded from F6-F12. Default: `[]` |
186
+ | `promptRewriter.includeRootDocs` | When true, **F6/F7/F9/F10** load `AGENTS.md`, `README.md`, and `.cursorrules`; **F8/F12** include them only within their bounded 6,000-character lean context. Default: `true` |
180
187
  | `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` |
188
+ | `promptRewriter.includeArchitectureDefaults` | When true, F6-F12 inject built-in SOLID + hexagonal constraints for software work. Default: `true` |
182
189
  | `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
190
  | `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
191
  | `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. |
@@ -189,6 +196,8 @@ Open **Settings** and set:
189
196
  - Prefer **User** settings over **Workspace** settings so the API key is not stored in the repository.
190
197
  - **Save & apply** writes User settings and clears any Workspace overrides for the same keys, so F6–F12 match the panel.
191
198
 
199
+ The original operator prompt, project/global rules, referenced skills, and architecture defaults bypass the worker and stay exact. The worker sees only reducible project documentation and chat context. To keep that reduced context grounded, it returns context-unit identifiers and the extension reconstructs each source channel from bounded, verbatim excerpts; worker-generated prose never reaches the main model. The selection is deliberately lossy and instructs the main model to require direct source reads for debugging, architecture, security, or exact line-level work. On an invalid selection or worker failure, the command logs a sanitized fallback notice and sends the original context to the main model.
200
+
192
201
  **Rewrite Prompt** uses any OpenAI-compatible endpoint that accepts `POST {baseUrl}/chat/completions`.
193
202
 
194
203
  **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:
@@ -349,7 +358,9 @@ Do not edit `version` by hand in feature commits. Use the release scripts only.
349
358
 
350
359
  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
360
 
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.
361
+ It rewrites **only the prompt text**. F8 uses slash skills (`SKILL.md`), architecture defaults, and a bounded 6,000-character view of workspace `.cursor/rules` plus configured root docs to ground the expert role and wording. It deliberately skips chat history, the docs folder, and global rules so transcripts or heavy documentation cannot replace the operator's task. `@` mentions and attachment placeholders are preserved; slash skills are kept on leading lines after replace.
362
+
363
+ Pressing F8 again on its own output starts a refinement pass. If the model returns the same prompt, the extension performs one compact repair that improves precision, traceability, actionability, or verifiability without changing scope.
353
364
 
354
365
  1. Start Ollama. This workspace is configured for `qwen2.5-coder:7b`.
355
366
  2. Grant Accessibility access if macOS asks: **System Settings → Privacy & Security → Accessibility** → enable Cursor.
@@ -394,7 +405,7 @@ Use **Rewrite** when you only want cleaner wording. Use **Expand** when you want
394
405
 
395
406
  ### Suggest the next prompt from chat context (macOS)
396
407
 
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.
408
+ Uses chat history from agent transcripts plus the same bounded project identity as F8, then replaces the input with **only** the ready-to-send next prompt. F12 includes workspace `.cursor/rules`, configured root docs, and architecture defaults within 6,000 characters; it skips the docs folder and Cursor global rules. F8 additionally skips chat history so rewrite cannot invent a different task from transcripts.
398
409
 
399
410
  1. Have at least one prior assistant reply in the current Cursor chat.
400
411
  2. Focus the chat input (it may be empty, or contain a short continue hint).
@@ -409,6 +420,7 @@ Same behavior as **Expand Current Input** (Cursor global rules, rules folder, ro
409
420
 
410
421
  ```json
411
422
  {
423
+ "expert_role": "Act as a …",
412
424
  "goal": "...",
413
425
  "constraints": ["..."],
414
426
  "non_goals": ["..."],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@infosuweb/prompt-rewriter",
3
3
  "displayName": "Prompt Rewriter",
4
4
  "description": "Rewrite a selected prompt so it is clearer and more precise, without adding new ideas.",
5
- "version": "0.14.3",
5
+ "version": "0.14.4",
6
6
  "publisher": "suweb",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -52,8 +52,7 @@
52
52
  "onCommand:promptRewriter.selectOllamaModel",
53
53
  "onCommand:promptRewriter.selectLlmBackend",
54
54
  "onCommand:promptRewriter.selectActiveModel",
55
- "onCommand:promptRewriter.importHermesSettings",
56
- "onCommand:promptRewriter.copyUsageMetricsSummary"
55
+ "onCommand:promptRewriter.importHermesSettings"
57
56
  ],
58
57
  "main": "./out/extension.js",
59
58
  "contributes": {
@@ -140,11 +139,6 @@
140
139
  "command": "promptRewriter.importHermesSettings",
141
140
  "title": "Import Hermes Model Settings",
142
141
  "category": "Prompt Rewriter"
143
- },
144
- {
145
- "command": "promptRewriter.copyUsageMetricsSummary",
146
- "title": "Copy Usage Metrics Summary",
147
- "category": "Prompt Rewriter"
148
142
  }
149
143
  ],
150
144
  "keybindings": [
@@ -235,6 +229,42 @@
235
229
  "default": "ollama",
236
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)."
237
231
  },
232
+ "promptRewriter.worker.enabled": {
233
+ "type": "boolean",
234
+ "default": false,
235
+ "description": "When true, F6/F7/F9/F10 summarize oversized context with a worker model before calling the main model. Rewrite (F8) and Suggest Next (F12) never use the worker."
236
+ },
237
+ "promptRewriter.worker.backend": {
238
+ "type": "string",
239
+ "enum": [
240
+ "ollama",
241
+ "openai",
242
+ "anthropic",
243
+ "google",
244
+ "openaiCompatible"
245
+ ],
246
+ "default": "ollama",
247
+ "description": "Independent backend for context summarization. Uses the existing credentials, base URL, and timeout configured for that backend."
248
+ },
249
+ "promptRewriter.worker.model": {
250
+ "type": "string",
251
+ "default": "",
252
+ "description": "Worker model identifier. Required when promptRewriter.worker.enabled is true and independent from the main model."
253
+ },
254
+ "promptRewriter.worker.maxContextChars": {
255
+ "type": "number",
256
+ "default": 12000,
257
+ "minimum": 1000,
258
+ "maximum": 1000000,
259
+ "description": "Expand context character threshold. Context at or below this size is sent directly to the main model."
260
+ },
261
+ "promptRewriter.worker.maxOutputTokens": {
262
+ "type": "number",
263
+ "default": 768,
264
+ "minimum": 64,
265
+ "maximum": 32768,
266
+ "description": "Maximum worker context-selection output tokens. Applied by Ollama, OpenAI-compatible, OpenAI, Anthropic, and Google adapters."
267
+ },
238
268
  "promptRewriter.cursorApiKey": {
239
269
  "type": "string",
240
270
  "default": "",
@@ -295,17 +325,17 @@
295
325
  "promptRewriter.contextFolder": {
296
326
  "type": "string",
297
327
  "default": ".cursor/rules",
298
- "description": "Workspace-relative folder whose .md/.mdc/.txt files are loaded as rules/context for Rewrite/Expand Current Input (F6/F7/F8/F9/F10)."
328
+ "description": "Workspace-relative folder whose .md/.mdc/.txt files are loaded as project rules/context for current-input transforms (F6-F12)."
299
329
  },
300
330
  "promptRewriter.includeRootDocs": {
301
331
  "type": "boolean",
302
332
  "default": true,
303
- "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."
333
+ "description": "When true, current-input transforms load AGENTS.md, README.md, and .cursorrules when present. F8/F12 include them only within their bounded lean context."
304
334
  },
305
335
  "promptRewriter.includeGlobalCursorRules": {
306
336
  "type": "boolean",
307
337
  "default": true,
308
- "description": "When true, Rewrite/Expand Current Input (F6/F7/F8/F9/F10) load Cursor global/user rules from ~/.cursor/rules into the LLM context."
338
+ "description": "When true, F6/F7/F9/F10 load Cursor global/user rules from ~/.cursor/rules. F8/F12 always skip global rules."
309
339
  },
310
340
  "promptRewriter.disabledGlobalCursorRuleFiles": {
311
341
  "type": "array",
@@ -326,12 +356,12 @@
326
356
  "promptRewriter.docsFolder": {
327
357
  "type": "string",
328
358
  "default": "docs",
329
- "description": "Workspace-relative docs folder loaded by Rewrite/Expand Current Input (.md/.mdc/.txt). Set empty to disable."
359
+ "description": "Workspace-relative docs folder loaded by F6/F7/F9/F10 (.md/.mdc/.txt). Set empty to disable. F8/F12 always skip it."
330
360
  },
331
361
  "promptRewriter.includeArchitectureDefaults": {
332
362
  "type": "boolean",
333
363
  "default": true,
334
- "description": "When true, Rewrite/Expand Current Input include built-in SOLID and hexagonal architecture constraints for software tasks."
364
+ "description": "When true, F6-F12 include built-in SOLID and hexagonal architecture constraints for software tasks."
335
365
  },
336
366
  "promptRewriter.includeLastChatResponse": {
337
367
  "type": "boolean",
@@ -367,16 +397,6 @@
367
397
  "default": "",
368
398
  "editPresentation": "multilineText",
369
399
  "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."
370
- },
371
- "promptRewriter.shareUsageMetrics": {
372
- "type": "boolean",
373
- "default": false,
374
- "description": "When true, record anonymous usage metrics (command id, success/failure, extension version, platform, LLM backend). Never records prompt text, API keys, or personal data. See docs/usage-metrics.md."
375
- },
376
- "promptRewriter.usageMetricsEndpoint": {
377
- "type": "string",
378
- "default": "",
379
- "description": "Optional HTTPS URL to POST anonymous usage event batches when shareUsageMetrics is enabled. Empty keeps metrics local only."
380
400
  }
381
401
  }
382
402
  }
@@ -397,8 +417,7 @@
397
417
  "release:minor": "npm version minor -m \"chore(release): %s\"",
398
418
  "release:major": "npm version major -m \"chore(release): %s\"",
399
419
  "package": "node scripts/package-vsix.mjs",
400
- "publish:npm": "npm run package && npm publish --access public --tag rc",
401
- "publish:npm:stable": "npm run check:changelog && npm run package && npm publish --access public"
420
+ "publish:npm": "npm run package && npm publish --access public --tag rc"
402
421
  },
403
422
  "devDependencies": {
404
423
  "@eslint/js": "^9.34.0",