pi-prompt-template-model-enhanced 0.10.0

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 ADDED
@@ -0,0 +1,368 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ### Changed
6
+ - Updated development-only Pi packages from the deprecated `@mariozechner/*` namespace to `@earendil-works/*` `0.79.7`, and bumped `tsx` to `^4.22.4`.
7
+ - Added Dependabot version updates for npm development dependencies and GitHub Actions.
8
+ - Added Release Please release automation and npm trusted publishing workflow.
9
+
10
+ ## [0.10.0] - 2026-06-18
11
+
12
+ ### Added
13
+ - Published under the separate package name `pi-prompt-template-model-enhanced` for the enhanced fork line.
14
+ - Added plural `skills` frontmatter for prompt templates, including ordered multi-skill injection and constrained suffix-wildcard selectors such as `golang-*`.
15
+
16
+ ### Changed
17
+ - Skill context now renders as one combined context message while preserving backward compatibility for singular `skill` prompts.
18
+
19
+ ### Fixed
20
+ - Fixed delegated prompt execution discovery for current `pi-subagents` npm package layouts, including `src/agents/agents.ts`, so `pi install npm:pi-subagents` works without setting `PI_SUBAGENT_RUNTIME_ROOT` manually.
21
+
22
+ ## [0.9.3] - 2026-04-28
23
+
24
+ ### Fixed
25
+ - Delegated prompt templates now discover `pi-subagents` installs from project-local Pi npm paths and sibling npm package paths instead of the legacy `subagent` extension path, fixing #1. Thanks @hschne for the report.
26
+
27
+ ## [0.9.2] - 2026-04-28
28
+
29
+ ### Fixed
30
+ - Prompt templates now accept provider-qualified model IDs that contain additional slashes, such as `openrouter/openai/gpt-5.4`, across prompt loading, model selection, compare lineups, and `<if-model>` conditionals.
31
+
32
+ ## [0.9.1] - 2026-04-26
33
+
34
+ ### Fixed
35
+ - `boomerang: true` prompt collapses now signal rewind to keep current files automatically, avoiding the restore-options prompt during collapse.
36
+
37
+ ## [0.9.0] - 2026-04-25
38
+
39
+ ### Added
40
+ - Added `boomerang: true` prompt frontmatter so non-chain templates, including looped templates, can run through prompt-template-model and then collapse their execution context back to the pre-run branch.
41
+
42
+ ### Fixed
43
+ - Migrated extension tool schemas from `@sinclair/typebox` to `typebox` 1.x so packaged installs follow Pi's current extension runtime contract.
44
+
45
+ ### Changed
46
+ - Added `typebox` as a runtime dependency for packaged installs.
47
+
48
+ ## [0.8.2] - 2026-04-21
49
+
50
+ ### Added
51
+ - Added the packaged `prompt-template-authoring` skill for creating and maintaining prompt templates with this extension.
52
+
53
+ ### Changed
54
+ - Tightened the shipped skill guide so it stays short, repo-specific, and aligned with the actual prompt-template runtime.
55
+
56
+ ### Fixed
57
+ - Corrected the shipped skill examples for model fallback vs rotation, argument substitution, deterministic handoff behavior, chain context wording, runtime flag syntax, and prompt discovery rules.
58
+ - Removed the emoji from the skill-loaded renderer so the UI copy matches the extension's plain-text style.
59
+
60
+ ## [0.8.1] - 2026-04-21
61
+
62
+ ### Added
63
+ - Added agent skill `prompt-template-authoring` for writing, managing, and running custom prompt templates. Registered in `package.json` under `pi.skills`.
64
+
65
+ ## [0.8.0] - 2026-04-21
66
+
67
+ ### Added
68
+ - Added first-class deterministic prompt-template execution for single prompt templates via `deterministic:` or shorthand `run` / `script` frontmatter. Templates can run one direct command or script before any optional LLM turn.
69
+ - Added configurable deterministic-step handoff policies: `always`, `never`, `on-success`, and `on-failure`.
70
+ - Added deterministic result cards that always show the executed command or script, resolved `cwd`, exit code, duration, and stdout/stderr previews.
71
+ - Added deterministic-step `env` support plus `nonInteractive` control for deploy/release-style scripts that need explicit environment variables or want to disable the default non-interactive guardrail env bundle.
72
+ - Added a visible deterministic completion message for `handoff: never`, so no-handoff runs still end with an explicit completion marker after the result card.
73
+
74
+ ### Changed
75
+ - When a deterministic prompt hands off to the model, the extension now prepends a generated `[Deterministic step]` block with structured execution metadata and truncated stdout/stderr previews before the prompt body.
76
+ - Deterministic stdout/stderr payloads are now capped before they are stored in message details, while preserving total line/character counts and truncation metadata for both the card UI and the LLM handoff block.
77
+
78
+ ### Fixed
79
+ - Added regression coverage for deterministic loader parsing, relative script resolution, handoff gating, and the no-handoff fast path.
80
+ - Deterministic timeouts now escalate from `SIGTERM` to `SIGKILL` if the child process does not exit within the post-timeout grace window.
81
+
82
+ ## [0.7.3] - 2026-04-14
83
+
84
+ ### Fixed
85
+ - `/chain-prompts` and chain templates now resolve plain prompt files without extension-specific frontmatter, so standard prompts like `double-check -> deslop` work in chain execution.
86
+ - Added regression coverage for plain-prompt chain resolution while keeping ordinary prompt-template command registration unchanged.
87
+
88
+ ## [0.7.2] - 2026-04-04
89
+
90
+ ### Changed
91
+ - Added a `promptSnippet` for `run-prompt` so Pi 0.59+ includes it in the default tool prompt section and keeps prompt-template execution discoverable in agent turns.
92
+
93
+ ## [0.7.1] - 2026-04-03
94
+
95
+ ### Changed
96
+ - Bumped `@mariozechner/pi-agent-core`, `@mariozechner/pi-ai`, `@mariozechner/pi-coding-agent`, and `@mariozechner/pi-tui` to `^0.65.0` and updated the extension for the pi `0.65.0` session/runtime breaking changes (`session_start` migration and `getApiKeyAndHeaders()` auth lookup).
97
+
98
+ ### Fixed
99
+ - Added regression coverage for the shipped `best-of-n` example and re-verified the installed prompt still matches the shipped example used for manual installs.
100
+
101
+ ## [0.7.0] - 2026-04-01
102
+
103
+ ### Added
104
+ - Added a first-class `bestOfN:` prompt-template authoring surface for compare workflows, with configurable `workers`, `reviewers`, optional `finalApplier`, and nested `bestOfN.worktree` support.
105
+ - Added configurable compare runtime overrides via `--workers`, `--reviewers`, `--workers-append`, `--reviewers-append`, and `--final-applier`.
106
+ - Added `count: N` compare-slot shorthand so one worker or reviewer slot can fan out into repeated identical runs without manual duplication.
107
+ - Added a shipped `/best-of-n` example prompt that demonstrates mixed worker counts, mixed reviewer counts, thinking-level model suffixes, `taskSuffix`, and final real-branch application.
108
+
109
+ ### Changed
110
+ - Compare prompts now run as worker fan-out, reviewer fan-in, then an optional final apply step that edits the real branch instead of stopping at recommendation prose.
111
+ - Reviewer defaults now stay findings-only, while `finalApplier` handles winner-picking or synthesis plus best-effort verification on the current branch.
112
+ - Legacy top-level compare frontmatter in templates (`workers`, `reviewers`, `finalApplier`, top-level compare `worktree`) is now rejected in favor of `bestOfN:`.
113
+ - Delegated parallel live rendering now shows richer per-task output, including task index, model, recent tools, and bounded rolling output lines.
114
+ - README and bundled examples were refreshed to match the shipped compare/runtime surface, including `bestOfN`, compare-wide vs slot-level `cwd`, and chain `parallel(...)` `cwd` rules under `worktree: true`.
115
+
116
+ ### Fixed
117
+ - Compare execution now allows partial success by phase: worker and reviewer phases continue as long as at least one slot succeeds, and `finalApplier` can still fall back to worker-only evidence when every reviewer fails.
118
+ - Preserved successful worker `=== Worktree Changes ===` summaries when building reviewer and final-apply inputs, so downstream compare stages do not lose worktree evidence.
119
+ - Invalid `bestOfN` blocks and legacy compare templates no longer degrade into ordinary runnable prompts after diagnostics; they are skipped entirely.
120
+ - `finalApplier` validation now correctly rejects unsupported `cwd` and `count` fields in both frontmatter and runtime overrides.
121
+ - Corrected remaining docs/tooling drift, including the `run-prompt` unlimited-loop cap text and compare/chain `cwd` wording.
122
+
123
+ ## [0.6.10] - 2026-03-30
124
+
125
+ ### Added
126
+ - Added lineup-based compare frontmatter for prompt templates: `workers` and `reviewers` slot lists (`agent` or `subagent`, optional `model`, optional `task`, optional `taskSuffix`, optional `cwd`, optional `count`), plus optional `finalApplier` for one final apply step.
127
+ - Added a two-phase compare execution flow for lineup templates: parallel worker phase first, then reviewer phase fed by aggregated worker output.
128
+ - Added runtime lineup override flags for compare templates: `--workers`, `--reviewers`, `--workers-append`, `--reviewers-append`, and `--final-applier`.
129
+ - Added compare lineup `count: N` shorthand so one worker or reviewer slot can expand into repeated identical runs without manually duplicating entries.
130
+ - Added an example compare prompt template under `examples/`: `best-of-n`, intended for manual installation into `~/.pi/agent/prompts/`.
131
+ - Added compare-lineup `subagent` shorthand so prompt authors can use `subagent: true` for default worker/reviewer slots instead of spelling the internal `delegate` / `reviewer` agent names directly.
132
+
133
+ ### Changed
134
+ - Prompt-template compare authoring now uses nested `bestOfN:` frontmatter; the loader lowers `bestOfN.workers`, `bestOfN.reviewers`, `bestOfN.finalApplier`, and `bestOfN.worktree` into the existing runtime compare fields and rejects legacy top-level compare fields in templates.
135
+ - Removed fixed three-worker compare assumptions from docs and prompt guidance; compare lineups are now caller-defined and duplicate slots are preserved.
136
+ - The shipped `best-of-n` example now shows mixed workers, mixed reviewers, and an optional final apply phase, while the runtime fallback still stays at one worker when `workers` is omitted.
137
+ - Reviewers now default to findings-only output, and the optional final phase now applies the real-branch patch instead of ending at recommendation prose.
138
+ - Parallel delegated task contract now supports per-task `cwd` passthrough end-to-end across the prompt-template bridge.
139
+ - README now explains same-model vs multi-model best-of-N configuration explicitly.
140
+
141
+ ### Fixed
142
+ - Compare execution now uses partial-success-by-phase behavior: worker and reviewer phases continue as long as at least one slot succeeds, and `finalApplier` can fall back to worker-only synthesis if reviewer slots all fail.
143
+ - Compare lineup slots now support `taskSuffix` so shared worker/reviewer instructions can stay in the prompt body while slots add small per-model suffixes such as output-file paths.
144
+ - Documented the current compare worktree constraint explicitly: when `worktree: true` is enabled, all worker slots must resolve to the same `cwd`.
145
+
146
+ ## [0.6.9] - 2026-03-28
147
+
148
+ ### Added
149
+ - Added `worktree: true` frontmatter and `--worktree` runtime flag for chain templates with parallel steps. When enabled, each parallel subagent runs in its own git worktree to avoid file conflicts during concurrent execution. Requires a chain with at least one `parallel()` step.
150
+ - Added `parallel: N` frontmatter for delegated prompts. This expands one delegated prompt into `N` parallel `pi-subagents` tasks targeting the same agent, with automatic slot headers like `[Parallel subagent 2/3]` prepended to each task.
151
+
152
+ ### Changed
153
+ - Bumped `@mariozechner/pi-agent-core`, `@mariozechner/pi-ai`, `@mariozechner/pi-coding-agent`, and `@mariozechner/pi-tui` to `^0.64.0`.
154
+ - Delegated prompt execution now forwards `ctx.signal` into subagent runs so turn cancellation can stop in-flight delegated work for both single delegated prompts and delegated parallel chain steps.
155
+ - `worktree: true` now also works on delegated prompts that use `parallel: N`, not just chain templates with `parallel()` steps.
156
+
157
+ ## [0.6.8] - 2026-03-28
158
+
159
+ ### Added
160
+ - Delegated prompt results are now injected back into the parent conversation as a user message, triggering an agent turn so the parent agent can process and respond to the delegation outcome. Applies to single delegated runs, delegated loops, and delegated chain steps.
161
+
162
+ ## [0.6.7] - 2026-03-28
163
+
164
+ ### Changed
165
+ - Delegation progress widget now shows a unified tool stream where completed tools scroll chronologically with the active tool highlighted at the bottom, replacing the old design where the active tool flashed at the top and disappeared on completion.
166
+ - Delegation progress widget now renders the subagent's model name in the header (e.g., `delegate [fork] gpt-5.3-codex | 14 tools, 170k tok, 2m47s`).
167
+ - Delegation progress widget no longer caps tool history or output lines. The box grows to show the full execution trace.
168
+ - Delegation progress widget now refreshes every second during idle periods (model thinking) so the elapsed timer ticks smoothly instead of freezing between progress updates.
169
+ - Enriched the delegation bridge protocol to pass through full `recentOutputLines`, `recentTools` history, and `model` from pi-subagents progress data, replacing the old single-line `recentOutput` and missing tool/model fields.
170
+ - Removed `lastTool`/`lastToolArgs` tracking from live state (dead code after the unified tool stream redesign).
171
+
172
+ ## [0.6.6] - 2026-03-28
173
+
174
+ ### Added
175
+ - Added `--model=provider/model-id` runtime flag to override a template's model for a single invocation. Works with single execution, loops, and delegation.
176
+ - Added `--fork` runtime flag to enable `inheritContext` (forked context) at invocation time. Implies `--subagent` if not already set.
177
+ - Inline loop iterations now include a `[Loop 2/5]` prefix so the agent knows it's in a loop and which iteration it's on. Delegated (subagent) loops are unaffected.
178
+ - Added `loop: unlimited` (and `loop: true`) frontmatter for open-ended loops that run until convergence, user interrupt, or the 999-iteration safety cap.
179
+ - Added model rotation for loop iterations via `rotate: true` frontmatter. Cycles through comma-separated models and thinking levels each iteration instead of using fallback semantics.
180
+
181
+ ### Fixed
182
+ - Pressing Escape during a loop or chain iteration now stops the loop. Previously, aborted inline turns were treated as "no changes" and the loop continued.
183
+ - Delegation errors during loop iterations no longer abort the entire loop. The error is reported and the loop continues to the next iteration (useful with model rotation where one model may fail but others succeed).
184
+ - Per-step bare `--loop` in chain declarations (e.g., `double-check --loop -> deslop`) now correctly runs unlimited iterations instead of running once.
185
+
186
+ ### Changed
187
+ - Unlimited loops (`--loop` bare or `loop: unlimited`) no longer force convergence on. Convergence follows the `converge` field like bounded loops. Safety cap raised from 50 to 999.
188
+
189
+ ## [0.6.5] - 2026-03-24
190
+
191
+ ### Added
192
+ - Added delegated chain-step context summaries via `chainContext: summary` (chain frontmatter), `/chain-prompts ... --chain-context` (command-level), and per-step `--with-context` (single delegated chain steps).
193
+
194
+ ## [0.6.4] - 2026-03-23
195
+
196
+ ### Fixed
197
+ - Updated skill command resolution to use `sourceInfo.path` instead of the removed `path` field on `SlashCommandInfo`, fixing compatibility with pi-coding-agent 0.62.0 source provenance changes.
198
+
199
+ ## [0.6.3] - 2026-03-21
200
+
201
+ ### Added
202
+ - Chain step progress now shows in the status bar (e.g., `step 2/3: simplify`) and persists until the chain completes, instead of only appearing as a notification that scrolls away.
203
+ - Added `parallel(...)` chain step support for delegated prompt templates, including parser/frontmatter validation, delegated task fan-out, aggregated result rendering, and per-task progress display.
204
+
205
+ ### Fixed
206
+ - Delegated subagent errors now show as clean notifications instead of extension crash messages with stack traces, matching how other validation errors (missing skill, missing template, etc.) are presented.
207
+ - When no subagent bridge is listening (extension not loaded, name collision with another extension), delegation now fails immediately with a diagnostic message instead of silently waiting 15 seconds before timing out.
208
+ - Timeout error message no longer dumps the full rendered prompt content; uses the agent name instead.
209
+ - Parallel delegated status now prefers aggregate `parallel X/Y running` updates over first-task tool labels, avoiding misleading `running <tool>` status lines during multi-task execution.
210
+
211
+ ## [0.6.2] - 2026-03-20
212
+
213
+ ### Added
214
+ - Added delegated-subprocess working directory controls via `cwd` frontmatter (for `subagent` prompts and chain-template defaults) plus runtime `--cwd=<path>` overrides.
215
+
216
+ ### Fixed
217
+ - Rewrote README for clarity: fixed default subagent name (`delegate`, not `worker`), corrected provider priority to include `openai-codex`, merged broken frontmatter table into grouped sections with readable descriptions, cut redundant examples, and tightened prose throughout.
218
+
219
+ ## [0.6.1] - 2026-03-20
220
+
221
+ ### Added
222
+ - Added delegated prompt execution via direct extension event bus communication with `subagent` (`prompt-template:subagent:*` channels), including delegated custom-message persistence for loop summaries and context carry-forward.
223
+ - Added prompt frontmatter support for `subagent` and `inheritContext`, with `inheritContext: true` mapped to delegated fork context.
224
+ - Fork context preamble is handled by the subagent extension directly (via `DEFAULT_FORK_PREAMBLE` in `types.ts`), applying to all fork-context subagent runs universally.
225
+ - Added runtime delegation override flags: `--subagent`, `--subagent=<name>`, and `--subagent:<name>`.
226
+ - Added live progress widget above editor during delegated subagent runs showing elapsed time, tool count, tokens, current tool, and task preview — matching the native subagent tool card layout.
227
+ - Added styled completion card with task preview, tool call history, expandable output (Ctrl+O), and usage stats footer.
228
+
229
+ ### Changed
230
+ - Updated provider priority for ambiguous bare model IDs to prefer `openai-codex` before `anthropic`, `github-copilot`, and `openrouter`.
231
+ - Updated loop convergence and fresh-summary analysis to account for delegated subagent message payloads.
232
+
233
+ ### Fixed
234
+ - Delegated start-time hangs now fail fast with explicit timeout errors when a subagent run never emits a start signal.
235
+ - Delegated runs no longer treat arbitrary escape-sequence-bearing terminal input as an Esc cancellation signal; only literal Esc cancels.
236
+ - Chain and loop restore paths now use live runtime model/thinking state during cleanup, preventing skipped restore on mid-step failures.
237
+
238
+ ## [0.6.0] - 2026-03-19
239
+
240
+ ### Changed
241
+
242
+ - Clarified the README chain examples so the optional ` -- ` shared-args separator is clearly distinct from loop flags like `--loop`, `--fresh`, and `--no-converge`.
243
+ - Clarified in the README that chain frontmatter declarations support per-step `--loop N` inside the `chain:` value.
244
+ - Argument substitution now accepts `@$` as an alias for `$@` for compatibility with commonly-typed placeholder variants.
245
+ - Skill injection now uses a next-turn context message from `before_agent_start` instead of mutating the turn system prompt.
246
+ - Non-chain templates can now omit `model` and inherit the current session model, so inline `<if-model ...>` rendering and skill injection still work without explicit model frontmatter.
247
+ - Chain steps without `model` now inherit a fixed chain-start model snapshot, so model-less chain steps behave as if that model were declared in frontmatter while remaining deterministic across step switches.
248
+
249
+ ### Fixed
250
+
251
+ - Chain step execution now avoids implicit previous-step model bleed for model-less templates by resolving them against the chain-start model snapshot instead of whichever model was active after the prior step.
252
+ - Model-less prompt loading now skips plain templates that do not use extension features, preventing command collisions with other extension commands like `/review` and `/handover`.
253
+ - Model-less prompt loading now also ignores no-op/invalid-only extension metadata (for example `restore`-only or invalid loop flags), so ineffective frontmatter does not unnecessarily claim command names.
254
+ - Model-less prompt loading now recognizes invalid conditional closers like `</else>` as extension-relevant markup, so those templates stay in this extension path and surface proper conditional-parse warnings instead of silently bypassing extension handling.
255
+ - Model-less prompt execution now tracks runtime model changes (`model_select` + internal switches/restores) and uses that tracked model instead of potentially stale command-context snapshots.
256
+ - Prompt commands now fail fast when a configured `skill` file is missing or unreadable, instead of silently sending the prompt without skill context.
257
+ - Skill resolution now returns a typed success/error outcome that callers handle explicitly, rather than emitting notifications from inside the resolver and returning sentinel `null` values.
258
+ - Session start/switch now clear any queued skill context message so stale pending skill payloads cannot leak across session boundaries.
259
+ - Session start/switch now also clear pending single-command restore state (`previousModel`/`previousThinking`) so restore writes cannot leak into a different session.
260
+ - Skill frontmatter resolution now checks registered skill commands first (`pi.getCommands()` skill entries), accepts both `<name>` and `skill:<name>` values, searches additional standard pi skill locations (`.agents/skills` in project ancestors and `~/.agents/skills`), supports direct `<skill>.md` files alongside `SKILL.md` directories, and rejects traversal-like skill names for path fallback.
261
+ - `extractLoopCount()` now strips repeated unquoted `--loop` tokens once looping is active, preventing stray loop flags from leaking into prompt arguments.
262
+ - Chain frontmatter step parsing now strips repeated per-step `--loop` tokens once a valid per-step loop is resolved, and keeps the first valid value (including mixed invalid/valid numeric sequences like `--loop 1000 --loop 2`).
263
+ - Loop-mode restore now tracks runtime model/thinking state per iteration instead of relying on command-context model snapshots, so model restoration remains correct even when command context values are stale.
264
+ - Chain execution now restores model/thinking state in a `finally` path, so restore still runs after unexpected runtime errors during a chain step and chain cleanup state is still reset even when restore itself fails.
265
+ - Loop and chain executions no longer report `Loop finished`/`Loop converged` when runtime errors abort execution mid-loop.
266
+ - Loop and chain error propagation now preserves thrown falsy values (for example `throw 0`) instead of treating them as success, preventing swallowed errors and false completion notifications.
267
+
268
+ ## [0.5.0] - 2026-03-17
269
+
270
+ ### Added
271
+
272
+ - Loop execution via `--loop` flag: `--loop N`, `--loop=N` to run a prompt N times (1-999), or bare `--loop` for unlimited until convergence with a 50-iteration safety cap. Bare `--loop` always forces convergence on.
273
+ - Frontmatter loop controls: templates can now set `loop: N` (1-999) and `converge: false` defaults; CLI `--loop` overrides frontmatter `loop`, and `--no-converge` disables convergence for bounded loops.
274
+ - Convergence detection: loops stop early when an iteration makes no file changes (`write`/`edit`). Enabled by default; `--no-converge` opts out.
275
+ - Fresh context mode: `--fresh` flag or `fresh: true` frontmatter collapses conversation between loop iterations, keeping only accumulated summaries. Saves tokens on long loops.
276
+ - Loop iteration context injected into the system prompt so the agent builds on previous work across iterations.
277
+ - Loop progress indicator in the TUI status bar.
278
+ - `run-prompt` agent tool: the agent can run prompt templates, chains, and loops on its own. Opt-in via `/prompt-tool on [guidance]`. Config persists in `~/.pi/agent/prompt-template-model.json`.
279
+ - Chain templates: new `chain` frontmatter field to declare reusable template pipelines (`chain: double-check --loop 2 -> deslop --loop 2`). Per-step `--loop N` loops each step independently. No `model` required — each step uses its own. Supports `loop`, `fresh`, `converge`, `restore` for overall execution control. Chain nesting is rejected at runtime.
280
+
281
+ ### Fixed
282
+
283
+ - `readSkillContent` no longer swallows read errors. The caller now sees the actual error message (e.g., permission denied) instead of a generic "Failed to read skill" notification.
284
+ - `restoreSessionState` no longer clears `pendingSkill` as a side effect unrelated to model/thinking restoration.
285
+ - Error diagnostics now consistently use `String(error)` instead of hardcoded fallback strings.
286
+
287
+ ## [0.4.0] - 2026-03-13
288
+
289
+ ### Added
290
+
291
+ - Inline `<if-model is="...">...</if-model>` blocks with optional `<else>` branches inside prompt bodies.
292
+ - Provider wildcard matching in conditionals with syntax like `anthropic/*`.
293
+ - Conditional rendering now happens after model fallback resolution for both single prompt commands and `/chain-prompts`.
294
+ - Prompt argument substitution now mirrors pi core more closely, including `${@:N}` and `${@:N:L}` slice syntax. See README for full placeholder reference.
295
+
296
+ ### Fixed
297
+
298
+ - Model fallback now preserves the currently active model whenever it matches any listed fallback candidate, including ambiguous bare model IDs that would otherwise resolve through provider preference, instead of switching to an earlier candidate unnecessarily.
299
+ - Prompt templates that collide with reserved slash commands, including built-ins like `/model` and the extension’s own `/chain-prompts`, are now skipped with a warning instead of being silently shadowed.
300
+ - Prompt discovery is now deterministic in a locale-independent way, and duplicate model-enabled prompt names within the same source layer are skipped with a warning instead of silently depending on traversal order.
301
+ - Invalid `model` frontmatter declarations are now rejected during prompt loading with diagnostics instead of failing later at execution time.
302
+ - Literal tags like `<elsewhere>` and `</if-modeling>` no longer get misparsed as malformed conditional directives.
303
+ - Non-interactive notifications now go to stderr so print-mode stdout stays clean.
304
+ - Bare model IDs with multiple providers can now still resolve through OAuth-backed auth checks even when fast availability checks alone are inconclusive.
305
+ - Optional string frontmatter fields are now trimmed so quoted values like `thinking: " high "` and `skill: " tmux "` behave as expected.
306
+ - Existing prompt commands now refresh prompt files before execution, so edits made during a session take effect on the next run instead of waiting for a new session.
307
+ - Skill-loaded custom messages now fail safe if their details payload is missing instead of crashing the renderer.
308
+ - Frontmatter `model` specs and inline conditional `is` specs now reject internal whitespace like `anthropic /model` or `anthropic /*` instead of silently registering values that can never match.
309
+ - Recursive prompt discovery now detects already-visited directories and skips symlink loops instead of risking infinite recursion or duplicate traversal.
310
+ - Bare model IDs now honor provider priority across all auth-capable candidates, including OAuth-backed providers, instead of incorrectly favoring a lower-priority provider just because it appeared in the fast-available set.
311
+ - Prompt loading now rejects non-object YAML frontmatter roots, like lists, with a diagnostic instead of silently treating them as missing `model` fields.
312
+ - `/chain-prompts` now only restores model and thinking when they actually changed, avoiding redundant state writes and noisy restore notifications on no-op chains.
313
+ - `/chain-prompts` now tracks thinking changes caused by model switches even when a step does not set `thinking`, so final restoration stays correct when the runtime clamps or resets thinking during a model change.
314
+ - `/chain-prompts` now rejects empty or quote-only step segments explicitly instead of treating them as blank template names.
315
+ - Single-command auto-restore now also skips no-op thinking restores and notifications when the runtime is already back on the original thinking level.
316
+ - Removed unnecessary exports: `modelSpecMatches` from model-selection.ts and `VALID_THINKING_LEVELS` from prompt-loader.ts are now internal implementation details.
317
+ - `/chain-prompts` now correctly ignores ` -- ` and `->` inside quoted per-step arguments instead of misinterpreting them as separators.
318
+ - `</else>` is now explicitly rejected with a helpful error message explaining that `<else>` is a separator, not a container.
319
+ - Fast-path optimization now correctly includes `</else>` check so standalone invalid tags are caught.
320
+ - Empty prompt abort in single-command mode now notifies as "error" instead of "warning" for consistency with chain mode.
321
+
322
+ ## [0.3.1] - 2026-02-08
323
+
324
+ ### Fixed
325
+
326
+ - Prompts map now initialized at extension load instead of waiting for `session_start`. Commands invoked before the first session event no longer fail with stale empty state.
327
+
328
+ ## [0.3.0] - 2026-02-08
329
+
330
+ ### Added
331
+
332
+ - **Chain command**: `/chain-prompts` orchestrates multiple prompt templates sequentially, each with its own model, skill, and thinking level. Conversation context flows between steps naturally.
333
+ - Per-step args override shared args: `/chain-prompts analyze "error handling" -> fix-plan "focus on perf" -> summarize -- src/main.ts`
334
+ - Mid-chain failure rolls back to the original model and thinking level
335
+ - Step progress notifications show which step is running
336
+ - State isolation: chain uses local variables, never interferes with single-command restore behavior
337
+
338
+ ## [0.2.1] - 2026-01-31
339
+
340
+ ### Fixed
341
+
342
+ - Thinking level now correctly restored after commands that switch model without a `thinking` field. Previously, running a prompt template that only specified `model` would reset thinking to "off" instead of restoring the original level (e.g., "high").
343
+
344
+ ## [0.2.0] - 2025-01-31
345
+
346
+ ### Added
347
+
348
+ - **Model fallback**: The `model` field now accepts a comma-separated list of models tried in order
349
+ - First model that resolves and has auth configured is used
350
+ - Supports mixing bare model IDs and explicit `provider/model-id` specs
351
+ - If the current model matches any candidate, it's used without switching
352
+ - Single consolidated error when all candidates fail
353
+ - Autocomplete shows fallback chain with pipe separator: `[haiku|sonnet]`
354
+ - Banner image
355
+
356
+ ## [0.1.0] - 2025-01-12
357
+
358
+ ### Added
359
+
360
+ - **Model switching** via `model` frontmatter in prompt templates
361
+ - **Print mode support**: Commands work with `pi -p "/command args"` for scripting
362
+ - **Thinking level control**: `thinking` frontmatter field with levels `off`, `minimal`, `low`, `medium`, `high`, `xhigh`
363
+ - **Skill injection**: `skill` frontmatter field injects skill content into system prompt via `<skill>` tags
364
+ - **Subdirectory support**: Recursive scanning creates namespaced commands like `(user:subdir)`
365
+ - **Auto-restore**: Previous model and thinking level restored after response (configurable via `restore: false`)
366
+ - **Provider resolution** with priority fallback (anthropic, github-copilot, openrouter)
367
+ - Support for explicit `provider/model-id` format
368
+ - Fancy TUI display for skill loading with expandable content preview
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nico Bailon
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.