pi-prompt-template-model 0.7.0 → 0.7.2

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
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.7.2] - 2026-04-04
6
+
7
+ ### Changed
8
+ - 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.
9
+
10
+ ## [0.7.1] - 2026-04-03
11
+
12
+ ### Changed
13
+ - 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).
14
+
15
+ ### Fixed
16
+ - 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.
17
+
3
18
  ## [0.7.0] - 2026-04-01
4
19
 
5
20
  ### Added
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Best-of-N parallel implementation compare in the current repo with one openai-codex lineup plus an optional final apply phase (worktree needs a clean repo)
2
+ description: Best-of-N code task with parallel workers using different models in separate worktrees, parallel reviewers, and a final apply step that picks or synthesizes the final patch.
3
3
  # Usage: /best-of-n fix the flaky auth test
4
4
  # Usage: /best-of-n implement the plan: /path/to/plan.md
5
5
  bestOfN:
@@ -13,7 +13,9 @@ bestOfN:
13
13
  - model: openai-codex/gpt-5.4-mini:high
14
14
  count: 2
15
15
  reviewers:
16
- # All reviewers see the same aggregated successful worker results.
16
+ # Reviewers use the base `reviewer` agent from `~/.pi/agent/extensions/subagent/agents/reviewer.md`.
17
+ # These slots can override its default model, and they get a generated compare task built from
18
+ # the original request, successful worker outputs/worktree summaries, and these slot instructions.
17
19
  # count works the same way here: it runs the same reviewer slot multiple times in parallel.
18
20
  # taskSuffix appends extra instructions to just that slot without replacing the shared prompt body.
19
21
  - model: openai-codex/gpt-5.3-codex-spark:medium
package/index.ts CHANGED
@@ -1522,10 +1522,6 @@ export default function promptModelExtension(pi: ExtensionAPI) {
1522
1522
  resetSessionScopedState(ctx);
1523
1523
  });
1524
1524
 
1525
- pi.on("session_switch", async (_event, ctx) => {
1526
- resetSessionScopedState(ctx);
1527
- });
1528
-
1529
1525
  pi.on("model_select", async (event) => {
1530
1526
  runtimeModel = event.model;
1531
1527
  });
@@ -14,7 +14,12 @@ export interface RegistryLike {
14
14
  getAvailable(): Model<any>[];
15
15
  isUsingOAuth(model: Model<any>): boolean;
16
16
  hasConfiguredAuth?: (model: Model<any>) => boolean;
17
- getApiKey?: (model: Model<any>) => Promise<string | undefined>;
17
+ getApiKeyAndHeaders?: (model: Model<any>) => Promise<{
18
+ ok: boolean;
19
+ apiKey?: string;
20
+ headers?: Record<string, string>;
21
+ error?: string;
22
+ }>;
18
23
  }
19
24
 
20
25
  function isSameModel(a: Model<any>, b: Model<any>): boolean {
@@ -78,7 +83,10 @@ async function hasUsableAuth(model: Model<any>, registry: RegistryLike): Promise
78
83
  if (availableMatch) return true;
79
84
  if (!registry.isUsingOAuth(model)) return false;
80
85
  if (registry.hasConfiguredAuth) return registry.hasConfiguredAuth(model);
81
- if (registry.getApiKey) return Boolean(await registry.getApiKey(model));
86
+ if (registry.getApiKeyAndHeaders) {
87
+ const auth = await registry.getApiKeyAndHeaders(model);
88
+ return auth.ok;
89
+ }
82
90
  return false;
83
91
  }
84
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-prompt-template-model",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "description": "Prompt template model selector extension for pi coding agent",
6
6
  "author": "Nico Bailon",
@@ -47,10 +47,10 @@
47
47
  "test": "tsx --test test/**/*.test.ts"
48
48
  },
49
49
  "devDependencies": {
50
- "@mariozechner/pi-agent-core": "^0.64.0",
51
- "@mariozechner/pi-ai": "^0.64.0",
52
- "@mariozechner/pi-coding-agent": "^0.64.0",
53
- "@mariozechner/pi-tui": "^0.64.0",
50
+ "@mariozechner/pi-agent-core": "^0.65.0",
51
+ "@mariozechner/pi-ai": "^0.65.0",
52
+ "@mariozechner/pi-coding-agent": "^0.65.0",
53
+ "@mariozechner/pi-tui": "^0.65.0",
54
54
  "tsx": "^4.20.5"
55
55
  },
56
56
  "pi": {
package/tool-manager.ts CHANGED
@@ -62,6 +62,8 @@ export function createToolManager(pi: ExtensionAPI, deps: ToolManagerDeps) {
62
62
  "--fresh for context collapse between iterations, and --no-converge to disable early stopping for bounded loops. " +
63
63
  "Supports runtime delegation override via --subagent, --subagent=<name>, or --subagent:<name>. " +
64
64
  "Use 'chain-prompts template1 -> template2' for chaining and add --chain-context to pass previous step summaries into delegated steps.",
65
+ promptSnippet:
66
+ "Use this to run slash/prompt templates by name with args (including --loop/--fresh and chain-prompts flows) when the user asks to execute a prompt template.",
65
67
  parameters: Type.Object({
66
68
  command: Type.String({
67
69
  description: "Template name and arguments (e.g. 'deslop --loop 5 --fresh', 'deslop --subagent:worker', 'deslop --subagent', 'chain-prompts analyze -> fix --chain-context', 'chain-prompts analyze -> fix --loop=3')",