@diegopetrucci/pi-extensions 0.1.55 → 0.1.58

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.
Files changed (107) hide show
  1. package/.pi-fleet-tested-version +1 -1
  2. package/README.md +2 -2
  3. package/extensions/agent-workflow-audit/.pi-fleet-tested-version +1 -1
  4. package/extensions/agent-workflow-audit/index.ts +8 -1
  5. package/extensions/agent-workflow-audit/package.json +5 -1
  6. package/extensions/annotate-git-diff/.pi-fleet-tested-version +1 -1
  7. package/extensions/annotate-git-diff/package.json +6 -3
  8. package/extensions/annotate-last-message/.pi-fleet-tested-version +1 -1
  9. package/extensions/annotate-last-message/package.json +5 -2
  10. package/extensions/brrr/.pi-fleet-tested-version +1 -1
  11. package/extensions/brrr/README.md +5 -5
  12. package/extensions/brrr/index.ts +26 -6
  13. package/extensions/brrr/package.json +5 -1
  14. package/extensions/claude-fast/.pi-fleet-tested-version +1 -1
  15. package/extensions/claude-fast/README.md +3 -3
  16. package/extensions/claude-fast/index.ts +1 -2
  17. package/extensions/claude-fast/package.json +5 -1
  18. package/extensions/code-reviewer/.pi-fleet-tested-version +1 -1
  19. package/extensions/code-reviewer/index.ts +36 -21
  20. package/extensions/code-reviewer/package.json +5 -1
  21. package/extensions/confirm-destructive/.pi-fleet-tested-version +1 -1
  22. package/extensions/confirm-destructive/package.json +5 -1
  23. package/extensions/context-cap/.pi-fleet-tested-version +1 -1
  24. package/extensions/context-cap/package.json +5 -1
  25. package/extensions/context-inspector/.pi-fleet-tested-version +1 -1
  26. package/extensions/context-inspector/README.md +4 -2
  27. package/extensions/context-inspector/index.ts +10 -4
  28. package/extensions/context-inspector/package.json +5 -1
  29. package/extensions/contrarian/.pi-fleet-tested-version +1 -1
  30. package/extensions/contrarian/index.ts +115 -96
  31. package/extensions/contrarian/package.json +5 -1
  32. package/extensions/dirty-repo-guard/.pi-fleet-tested-version +1 -1
  33. package/extensions/dirty-repo-guard/package.json +5 -1
  34. package/extensions/dynamic-context-pruning/.pi-fleet-tested-version +1 -1
  35. package/extensions/dynamic-context-pruning/package.json +4 -1
  36. package/extensions/git-footer/.pi-fleet-tested-version +1 -1
  37. package/extensions/git-footer/package.json +5 -1
  38. package/extensions/gnosis/.pi-fleet-tested-version +1 -1
  39. package/extensions/gnosis/package.json +5 -1
  40. package/extensions/illustrations-to-explain-things/.pi-fleet-tested-version +1 -1
  41. package/extensions/illustrations-to-explain-things/package.json +4 -1
  42. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/01-two-breakpoints.webp +0 -0
  43. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/02-minimum-loop.webp +0 -0
  44. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/03-sort-by-purpose.webp +0 -0
  45. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/04-one-fish-many-uses.webp +0 -0
  46. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/05-handoff-path.webp +0 -0
  47. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/06-three-sources.webp +0 -0
  48. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/07-three-content-jobs.webp +0 -0
  49. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/08-handoff-copy-toolbox.webp +0 -0
  50. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/09-common-pits-no-title.webp +0 -0
  51. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/10-information-well.webp +0 -0
  52. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/11-idea-press.webp +0 -0
  53. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/12-content-fermentation.webp +0 -0
  54. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/13-system-bearing.webp +0 -0
  55. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/14-trust-bridge.webp +0 -0
  56. package/extensions/inline-bash/.pi-fleet-tested-version +1 -1
  57. package/extensions/inline-bash/package.json +5 -1
  58. package/extensions/librarian/.pi-fleet-tested-version +1 -1
  59. package/extensions/librarian/README.md +1 -1
  60. package/extensions/librarian/index.ts +47 -9
  61. package/extensions/librarian/package.json +5 -1
  62. package/extensions/minimal-footer/.pi-fleet-tested-version +1 -1
  63. package/extensions/minimal-footer/README.md +3 -3
  64. package/extensions/minimal-footer/index.ts +3 -6
  65. package/extensions/minimal-footer/openai-usage.ts +58 -11
  66. package/extensions/minimal-footer/package.json +5 -1
  67. package/extensions/notify/.pi-fleet-tested-version +1 -1
  68. package/extensions/notify/README.md +5 -5
  69. package/extensions/notify/index.ts +4 -6
  70. package/extensions/notify/package.json +5 -1
  71. package/extensions/openai-fast/.pi-fleet-tested-version +1 -1
  72. package/extensions/openai-fast/README.md +5 -5
  73. package/extensions/openai-fast/index.ts +11 -5
  74. package/extensions/openai-fast/package.json +6 -2
  75. package/extensions/oracle/.pi-fleet-tested-version +1 -1
  76. package/extensions/oracle/index.ts +116 -94
  77. package/extensions/oracle/package.json +5 -1
  78. package/extensions/permission-gate/.pi-fleet-tested-version +1 -1
  79. package/extensions/permission-gate/README.md +11 -4
  80. package/extensions/permission-gate/index.ts +156 -17
  81. package/extensions/permission-gate/package.json +9 -3
  82. package/extensions/quiet-tools/.pi-fleet-tested-version +1 -1
  83. package/extensions/quiet-tools/package.json +5 -1
  84. package/extensions/review/.pi-fleet-tested-version +1 -1
  85. package/extensions/review/README.md +1 -1
  86. package/extensions/review/index.ts +4 -4
  87. package/extensions/review/package.json +5 -1
  88. package/extensions/todo/.pi-fleet-tested-version +1 -1
  89. package/extensions/todo/package.json +5 -1
  90. package/extensions/triage-comments/.pi-fleet-tested-version +1 -1
  91. package/extensions/triage-comments/index.ts +8 -1
  92. package/extensions/triage-comments/package.json +5 -1
  93. package/package.json +14 -7
  94. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/01-two-breakpoints.png +0 -0
  95. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/02-minimum-loop.png +0 -0
  96. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/03-sort-by-purpose.png +0 -0
  97. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/04-one-fish-many-uses.png +0 -0
  98. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/05-handoff-path.png +0 -0
  99. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/06-three-sources.png +0 -0
  100. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/07-three-content-jobs.png +0 -0
  101. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/08-handoff-copy-toolbox.png +0 -0
  102. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/09-common-pits-no-title.png +0 -0
  103. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/10-information-well.png +0 -0
  104. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/11-idea-press.png +0 -0
  105. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/12-content-fermentation.png +0 -0
  106. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/13-system-bearing.png +0 -0
  107. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/14-trust-bridge.png +0 -0
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
package/README.md CHANGED
@@ -14,7 +14,7 @@ A collection of [pi](https://pi.dev) agent extensions I made. (btw, [I am also b
14
14
  ### Providers
15
15
 
16
16
  - [`claude-fast`](./extensions/claude-fast): Adds `/claude-fast` to enable Anthropic Claude Fast mode for supported Claude Opus models by injecting `speed: "fast"`.
17
- - [`openai-fast`](./extensions/openai-fast): Adds `/fast` to enable OpenAI Codex Fast mode for ChatGPT-auth GPT-5.4 and GPT-5.5 by injecting the priority service tier.
17
+ - [`openai-fast`](./extensions/openai-fast): Adds `/fast` to enable OpenAI Codex Fast mode for ChatGPT-auth GPT-5.4, GPT-5.5, and GPT-5.6 Codex variants by injecting the priority service tier.
18
18
 
19
19
  ### UI
20
20
 
@@ -40,7 +40,7 @@ A collection of [pi](https://pi.dev) agent extensions I made. (btw, [I am also b
40
40
 
41
41
  - [`confirm-destructive`](./extensions/confirm-destructive): Confirms before destructive session actions like clear, switch, and fork.
42
42
  - [`dirty-repo-guard`](./extensions/dirty-repo-guard): Prompts before new sessions, session switches, or forks when the current git repo has uncommitted changes.
43
- - [`permission-gate`](./extensions/permission-gate): Prompts for confirmation before dangerous bash commands like `rm -rf`, `sudo`, and `chmod 777`.
43
+ - [`permission-gate`](./extensions/permission-gate): Prompts for confirmation before dangerous bash commands and protected `write`/`edit` targets like `.git`, `node_modules`, and secret-bearing `.env` files.
44
44
 
45
45
  ### Quality of life
46
46
 
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -69,6 +69,13 @@ type ParsedArgs = {
69
69
  error?: string;
70
70
  };
71
71
 
72
+ type CreateAgentSessionOptions = NonNullable<Parameters<typeof createAgentSession>[0]>;
73
+
74
+ function getModelRuntimeOption(ctx: { modelRegistry?: unknown }): Pick<CreateAgentSessionOptions, "modelRuntime"> {
75
+ const modelRuntime = (ctx.modelRegistry as { runtime?: CreateAgentSessionOptions["modelRuntime"] } | undefined)?.runtime;
76
+ return modelRuntime ? { modelRuntime } : {};
77
+ }
78
+
72
79
  function parseArgs(args: string): ParsedArgs {
73
80
  const parts = args.trim().split(/\s+/).filter(Boolean);
74
81
  const focusParts: string[] = [];
@@ -1013,7 +1020,7 @@ async function runAudit(
1013
1020
  const tools = options.planOnly ? ["read", "grep", "find", "ls"] : ["read", "grep", "find", "ls", "bash"];
1014
1021
  const created = await createAgentSession({
1015
1022
  cwd,
1016
- modelRegistry: ctx.modelRegistry,
1023
+ ...getModelRuntimeOption(ctx),
1017
1024
  resourceLoader,
1018
1025
  settingsManager: isolatedSettingsManager,
1019
1026
  sessionManager: SessionManager.inMemory(cwd),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-agent-workflow-audit",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "A pi extension that runs an isolated repo workflow audit and returns only the final report to the main session.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -32,5 +32,9 @@
32
32
  "peerDependencies": {
33
33
  "@earendil-works/pi-coding-agent": "*",
34
34
  "@earendil-works/pi-tui": "*"
35
+ },
36
+ "type": "module",
37
+ "engines": {
38
+ "node": ">=22.19.0"
35
39
  }
36
40
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-annotate-git-diff",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "description": "A standalone pi extension that adds /annotate-git-diff, a native Glimpse UI for annotating git diffs and sending feedback to the editor.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -42,9 +42,12 @@
42
42
  "@earendil-works/pi-coding-agent": "*"
43
43
  },
44
44
  "dependencies": {
45
- "@tailwindcss/browser": "^4.3.0",
45
+ "@tailwindcss/browser": "^4.3.2",
46
46
  "glimpseui": "^0.8.1",
47
47
  "monaco-editor": "0.52.2"
48
48
  },
49
- "type": "module"
49
+ "type": "module",
50
+ "engines": {
51
+ "node": ">=22.19.0"
52
+ }
50
53
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-annotate-last-message",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A standalone pi extension that adds /annotate-last-message, a native Glimpse UI for annotating the latest assistant reply.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -41,5 +41,8 @@
41
41
  "dependencies": {
42
42
  "glimpseui": "^0.8.1"
43
43
  },
44
- "type": "module"
44
+ "type": "module",
45
+ "engines": {
46
+ "node": ">=22.19.0"
47
+ }
45
48
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -1,6 +1,6 @@
1
1
  # brrr
2
2
 
3
- A pi extension that sends [brrr](https://brrr.now) push notifications when pi finishes an agent turn and is ready for input.
3
+ A pi extension that sends [brrr](https://brrr.now) push notifications when pi has fully settled and is ready for input.
4
4
 
5
5
  ## Install
6
6
 
@@ -32,10 +32,10 @@ Then reload pi:
32
32
 
33
33
  Config files are merged, with project config overriding global config:
34
34
 
35
- - `~/.pi/agent/extensions/brrr.json`
36
- - `<project>/.pi/brrr.json`
35
+ - `~/<pi-config-dir>/agent/extensions/brrr.json`
36
+ - `<project>/<pi-config-dir>/brrr.json`
37
37
 
38
- Project config is only read after Pi reports that the project is trusted.
38
+ Here `<pi-config-dir>` is Pi's runtime config directory name (`CONFIG_DIR_NAME`; `.pi` by default). Project config is only read after Pi reports that the project is trusted.
39
39
 
40
40
  The default config expects your webhook in `BRRR_WEBHOOK_URL`:
41
41
 
@@ -81,6 +81,6 @@ Example:
81
81
 
82
82
  ## Notes
83
83
 
84
- - Hooks the `agent_end` event.
84
+ - Hooks the `agent_settled` event so automatic retries, compaction retries, and queued follow-ups do not trigger intermediate notifications.
85
85
  - The extension sends directly to the brrr webhook; it does not require the `brrr` CLI at runtime.
86
86
  - By default, notifications are skipped unless the Mac has been idle for at least 20 seconds.
@@ -5,18 +5,17 @@
5
5
  * for more input.
6
6
  *
7
7
  * Config files (project overrides global):
8
- * - ~/.pi/agent/extensions/brrr.json
9
- * - <cwd>/.pi/brrr.json, when the project is trusted
8
+ * - ~/<pi-config-dir>/agent/extensions/brrr.json
9
+ * - <cwd>/<pi-config-dir>/brrr.json, when the project is trusted
10
10
  */
11
11
 
12
12
  import { execFile } from "node:child_process";
13
13
  import { existsSync, readFileSync } from "node:fs";
14
14
  import { basename, join } from "node:path";
15
15
  import { promisify } from "node:util";
16
- import { getAgentDir, type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
16
+ import { CONFIG_DIR_NAME, getAgentDir, type ExtensionAPI, type ExtensionCommandContext, type SessionEntry } from "@earendil-works/pi-coding-agent";
17
17
 
18
18
  const execFileAsync = promisify(execFile);
19
- const CONFIG_DIR_NAME = ".pi";
20
19
 
21
20
  interface BrrrConfig {
22
21
  enabled: boolean;
@@ -180,6 +179,25 @@ function lastAssistantMessage(messages: readonly unknown[]): string | undefined
180
179
  return undefined;
181
180
  }
182
181
 
182
+ type SessionMessageSource = {
183
+ buildContextEntries(): SessionEntry[];
184
+ };
185
+
186
+ function sessionMessages(sessionManager: SessionMessageSource | undefined): readonly unknown[] {
187
+ if (!sessionManager) return [];
188
+
189
+ return sessionManager
190
+ .buildContextEntries()
191
+ .flatMap((entry: SessionEntry) => (entry.type === "message" ? [entry.message] : []));
192
+ }
193
+
194
+ function resolveAssistantMessage(
195
+ sessionManager: SessionMessageSource | undefined,
196
+ fallbackMessages: readonly unknown[],
197
+ ): string | undefined {
198
+ return lastAssistantMessage(sessionMessages(sessionManager)) ?? lastAssistantMessage(fallbackMessages);
199
+ }
200
+
183
201
  function truncateMessage(value: string): string {
184
202
  const trimmed = value.trim();
185
203
  if (trimmed.length <= 800) return trimmed;
@@ -237,7 +255,7 @@ export default function brrrExtension(pi: ExtensionAPI) {
237
255
  },
238
256
  });
239
257
 
240
- pi.on("agent_end", async (event, ctx) => {
258
+ pi.on("agent_settled", async (event, ctx) => {
241
259
  const config = loadConfig(ctx);
242
260
  if (!config.enabled) return;
243
261
  if (config.onlyWhenInteractive && !ctx.hasUI) return;
@@ -246,7 +264,9 @@ export default function brrrExtension(pi: ExtensionAPI) {
246
264
  if (!webhook || !isBrrrWebhookUrl(webhook)) return;
247
265
  if (await shouldSkipForIdleThreshold(config.idleSeconds)) return;
248
266
 
249
- const assistantMessage = config.includeLastAssistantMessage ? lastAssistantMessage(event.messages as readonly unknown[]) : undefined;
267
+ const assistantMessage = config.includeLastAssistantMessage
268
+ ? resolveAssistantMessage(ctx.sessionManager, (event as { messages?: readonly unknown[] }).messages ?? [])
269
+ : undefined;
250
270
  const message = truncateMessage(assistantMessage || formatTemplate(config.message, ctx.cwd));
251
271
  const result = await sendBrrr(webhook, {
252
272
  title: formatTemplate(config.title, ctx.cwd),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-brrr",
3
- "version": "0.1.5",
3
+ "version": "0.1.8",
4
4
  "description": "A pi extension that sends brrr push notifications when pi is ready for input.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -31,5 +31,9 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@earendil-works/pi-coding-agent": "*"
34
+ },
35
+ "type": "module",
36
+ "engines": {
37
+ "node": ">=22.19.0"
34
38
  }
35
39
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -42,16 +42,16 @@ The extension defaults to off so installing the full collection does not acciden
42
42
  Optional global config:
43
43
 
44
44
  ```text
45
- ~/.pi/agent/extensions/claude-fast.json
45
+ ~/<pi-config-dir>/agent/extensions/claude-fast.json
46
46
  ```
47
47
 
48
48
  Optional project config:
49
49
 
50
50
  ```text
51
- .pi/claude-fast.json
51
+ <project>/<pi-config-dir>/claude-fast.json
52
52
  ```
53
53
 
54
- Project config overrides global config after Pi reports that the project is trusted.
54
+ Here `<pi-config-dir>` is Pi's runtime config directory name (`CONFIG_DIR_NAME`; `.pi` by default). Project config overrides global config after Pi reports that the project is trusted.
55
55
 
56
56
  ```json
57
57
  {
@@ -1,13 +1,12 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import {
4
+ CONFIG_DIR_NAME,
4
5
  getAgentDir,
5
6
  type ExtensionAPI,
6
7
  type ExtensionContext,
7
8
  } from "@earendil-works/pi-coding-agent";
8
9
 
9
- const CONFIG_DIR_NAME = ".pi";
10
-
11
10
  const EXTENSION_ID = "claude-fast";
12
11
  const PROVIDER_ID = "anthropic";
13
12
  const API_ID = "anthropic-messages";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-claude-fast",
3
- "version": "0.1.5",
3
+ "version": "0.1.8",
4
4
  "description": "A pi extension that enables Anthropic Claude Fast mode for supported Claude Opus models by injecting speed=fast.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -31,5 +31,9 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@earendil-works/pi-coding-agent": "*"
34
+ },
35
+ "type": "module",
36
+ "engines": {
37
+ "node": ">=22.19.0"
34
38
  }
35
39
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -16,55 +16,63 @@ const MAX_TURNS = 8;
16
16
  const MAX_RUN_MS = 8 * 60 * 1000;
17
17
  const DEFAULT_BASH_TIMEOUT_SECONDS = 30;
18
18
  const DEFAULT_THINKING_LEVEL = "high";
19
- const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const;
19
+ const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"] as const;
20
20
 
21
21
  type ThinkingLevel = (typeof THINKING_LEVELS)[number];
22
22
  type ThinkingLevelMap = Partial<Record<ThinkingLevel, unknown | null>>;
23
23
  const CODE_REVIEWER_MODEL_PREFERENCES = [
24
+ "gpt-5.6-sol",
25
+ "gpt-5.6-terra",
26
+ "gpt-5.6-luna",
24
27
  "gpt-5.5",
25
28
  "claude-opus-4-8",
26
29
  "claude-opus-4.8",
27
- "claude-sonnet-5-0",
28
- "claude-sonnet-5.0",
29
30
  "claude-sonnet-5",
30
31
  "claude-sonnet-4-6",
31
32
  "claude-sonnet-4.6",
32
33
  "claude-sonnet-4-5",
33
34
  "claude-sonnet-4.5",
34
- "claude-sonnet-4-0",
35
35
  "claude-sonnet-4",
36
+ "grok-4.5",
37
+ "gemini-3.5-flash",
36
38
  ];
37
39
  const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
38
40
  "amazon-bedrock": [
39
41
  "claude-fable-5",
40
42
  "claude-opus-4-8",
41
- "claude-opus-4.8",
42
43
  "claude-sonnet-5",
43
44
  "claude-sonnet-4-6",
44
- "claude-sonnet-4.6",
45
45
  "claude-sonnet-4-5",
46
- "claude-sonnet-4.5",
47
- "claude-sonnet-4",
48
46
  ],
49
47
  anthropic: [
50
48
  "claude-fable-5",
51
49
  "claude-opus-4-8",
52
- "claude-opus-4.8",
53
50
  "claude-sonnet-5",
54
51
  "claude-sonnet-4-6",
55
- "claude-sonnet-4.6",
56
52
  "claude-sonnet-4-5",
57
- "claude-sonnet-4.5",
58
- "claude-sonnet-4",
59
53
  ],
60
- openai: ["gpt-5.5", "gpt-5", "gpt-4.1", "o3", "o4-mini", "o4"],
61
- "vercel-ai-gateway": [
54
+ openai: ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5", "gpt-4.1", "o3", "o4-mini"],
55
+ "openai-codex": [
56
+ "gpt-5.6-sol",
57
+ "gpt-5.6-terra",
58
+ "gpt-5.6-luna",
62
59
  "gpt-5.5",
60
+ "gpt-5.4",
61
+ "gpt-5.4-mini",
62
+ "gpt-5.3-codex-spark",
63
+ ],
64
+ "vercel-ai-gateway": [
63
65
  "anthropic/claude-fable-5",
64
- "anthropic/claude-opus-4.1",
65
- "anthropic/claude-opus-4",
66
+ "anthropic/claude-opus-4.8",
67
+ "anthropic/claude-opus-4.7",
68
+ "anthropic/claude-opus-4.6",
66
69
  "anthropic/claude-sonnet-5",
67
- "anthropic/claude-sonnet-4",
70
+ "openai/gpt-5.6-sol",
71
+ "openai/gpt-5.6-terra",
72
+ "openai/gpt-5.6-luna",
73
+ "openai/gpt-5.5",
74
+ "xai/grok-4.5",
75
+ "google/gemini-3.5-flash",
68
76
  ],
69
77
  };
70
78
 
@@ -212,7 +220,13 @@ type ModelRegistryContext = {
212
220
  modelRegistry: { getAvailable(): PiModel[] | Promise<PiModel[]> };
213
221
  };
214
222
 
215
- type CreateAgentSessionModel = NonNullable<Parameters<typeof createAgentSession>[0]>["model"];
223
+ type CreateAgentSessionOptions = NonNullable<Parameters<typeof createAgentSession>[0]>;
224
+ type CreateAgentSessionModel = CreateAgentSessionOptions["model"];
225
+
226
+ function getModelRuntimeOption(ctx: { modelRegistry?: unknown }): Pick<CreateAgentSessionOptions, "modelRuntime"> {
227
+ const modelRuntime = (ctx.modelRegistry as { runtime?: CreateAgentSessionOptions["modelRuntime"] } | undefined)?.runtime;
228
+ return modelRuntime ? { modelRuntime } : {};
229
+ }
216
230
 
217
231
  const MODEL_AVAILABILITY_ERROR_PATTERN =
218
232
  /\b(?:404|403|not[_ ]?found(?:[_ ]?error)?|model[_ ]?not[_ ]?found(?:[_ ]?error)?|no such model|unknown model|does not exist|is not available|not available|model[_ ]?not[_ ]?available|unsupported model|invalid model|forbidden|access[ _-]?denied|permission[ _-]?denied|not[ _-]?entitled|do(?:es)? not have access)\b/i;
@@ -392,8 +406,8 @@ function isThinkingLevelSupported(model: PiModel, level: ThinkingLevel): boolean
392
406
  if (!model.reasoning) return level === "off";
393
407
 
394
408
  const map = model.thinkingLevelMap;
395
- if (level === "xhigh") {
396
- return !!map && Object.prototype.hasOwnProperty.call(map, "xhigh") && map.xhigh != null;
409
+ if (level === "xhigh" || level === "max") {
410
+ return !!map && Object.prototype.hasOwnProperty.call(map, level) && map[level] != null;
397
411
  }
398
412
  return map?.[level] !== null;
399
413
  }
@@ -1068,6 +1082,7 @@ export const __test__ = {
1068
1082
  buildSafeGitCommand,
1069
1083
  formatToolCall,
1070
1084
  getBlockedBashReason,
1085
+ isModelAvailabilityError,
1071
1086
  normalizeThinkingLevel,
1072
1087
  resolveThinkingLevel,
1073
1088
  selectCodeReviewerModel,
@@ -1173,7 +1188,7 @@ export default function codeReviewerExtension(pi: ExtensionAPI) {
1173
1188
  try {
1174
1189
  const created = await createAgentSession({
1175
1190
  cwd,
1176
- modelRegistry: ctx.modelRegistry,
1191
+ ...getModelRuntimeOption(ctx),
1177
1192
  resourceLoader,
1178
1193
  settingsManager: isolatedSettingsManager,
1179
1194
  sessionManager: SessionManager.inMemory(cwd),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-code-reviewer",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "A standalone pi extension that adds a read-only code_reviewer subagent tool for isolated code reviews.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -31,5 +31,9 @@
31
31
  "peerDependencies": {
32
32
  "@earendil-works/pi-coding-agent": "*",
33
33
  "typebox": "*"
34
+ },
35
+ "type": "module",
36
+ "engines": {
37
+ "node": ">=22.19.0"
34
38
  }
35
39
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-confirm-destructive",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "A pi extension that confirms destructive session actions.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -29,5 +29,9 @@
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@earendil-works/pi-coding-agent": "*"
32
+ },
33
+ "type": "module",
34
+ "engines": {
35
+ "node": ">=22.19.0"
32
36
  }
33
37
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-context-cap",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "A pi extension that caps effective model context windows at 200k tokens for earlier auto-compaction.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -30,5 +30,9 @@
30
30
  "peerDependencies": {
31
31
  "@earendil-works/pi-ai": "*",
32
32
  "@earendil-works/pi-coding-agent": "*"
33
+ },
34
+ "type": "module",
35
+ "engines": {
36
+ "node": ">=22.19.0"
33
37
  }
34
38
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
@@ -28,17 +28,19 @@ The report is self-contained HTML written locally with private file permissions.
28
28
  Options:
29
29
 
30
30
  - `--no-open`: write the HTML report but do not open a browser.
31
- - `--keep`: save under `.pi/context-reports/` instead of the OS temp directory.
31
+ - `--keep`: save under `<pi-config-dir>/context-reports/` instead of the OS temp directory.
32
32
  - `--redact`: keep token attribution but hide message/tool contents plus paths, commands, session identifiers, and timestamps in the report.
33
33
  - `--full`: open the report on the full active branch tab by default.
34
34
 
35
+ `<pi-config-dir>` is Pi's runtime config directory name (`CONFIG_DIR_NAME`; `.pi` by default).
36
+
35
37
  ## Notes
36
38
 
37
39
  - Per-component token counts are estimates. Providers expose aggregate usage, not exact token attribution per message or block.
38
40
  - The current-context chart reconciles to pi's footer-compatible context total when pi knows it.
39
41
  - Immediately after compaction, pi may not know exact current context usage until the next model response.
40
42
  - The full branch tab includes old pre-compaction history for inspection; that history is not necessarily sent verbatim to the model.
41
- - `--keep` writes reports under `.pi/context-reports/`; avoid committing those reports because they can contain sensitive session data unless redacted.
43
+ - `--keep` writes reports under `<pi-config-dir>/context-reports/`; avoid committing those reports because they can contain sensitive session data unless redacted.
42
44
 
43
45
  ## Install
44
46
 
@@ -2,7 +2,7 @@ import { chmodSync, mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
2
2
  import { tmpdir } from "node:os";
3
3
  import { join } from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
- import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
5
+ import { CONFIG_DIR_NAME, type ExtensionAPI, type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
6
6
 
7
7
  const EXTENSION_ID = "context-inspector";
8
8
  const IMAGE_TOKEN_ESTIMATE = 1200;
@@ -309,7 +309,7 @@ function usageText(): string {
309
309
  "",
310
310
  "Options:",
311
311
  " --no-open Write the report but do not open a browser.",
312
- " --keep Save under .pi/context-reports/ instead of the OS temp directory.",
312
+ " --keep Save under " + CONFIG_DIR_NAME + "/context-reports/ instead of the OS temp directory.",
313
313
  " --redact Hide message/tool contents while keeping token attribution.",
314
314
  " --full Open the report on the full active branch tab instead of current context.",
315
315
  ].join("\n");
@@ -757,6 +757,12 @@ function collectCurrentContextEntries(branchEntries: MinimalEntry[]): MinimalEnt
757
757
  return result;
758
758
  }
759
759
 
760
+ function resolveCurrentContextEntries(ctx: ExtensionCommandContext, branchEntries: MinimalEntry[]): MinimalEntry[] {
761
+ const currentEntries = safeCall(() => ctx.sessionManager.buildContextEntries()) as MinimalEntry[] | undefined;
762
+ if (Array.isArray(currentEntries)) return currentEntries;
763
+ return collectCurrentContextEntries(branchEntries);
764
+ }
765
+
760
766
  function analyzeEntries(entries: MinimalEntry[], redact: boolean): { segments: Segment[]; messageCount: number } {
761
767
  const state: AnalyzerState = { segments: [], sequence: 0, turn: 0, redact };
762
768
  let messageCount = 0;
@@ -921,7 +927,7 @@ function getSessionName(ctx: ExtensionCommandContext): string | undefined {
921
927
 
922
928
  function buildReportData(pi: ExtensionAPI, ctx: ExtensionCommandContext, options: CommandOptions): ReportData {
923
929
  const branchEntries = ctx.sessionManager.getBranch() as MinimalEntry[];
924
- const currentEntries = collectCurrentContextEntries(branchEntries);
930
+ const currentEntries = resolveCurrentContextEntries(ctx, branchEntries);
925
931
  const overhead = buildOverheadSegments(pi, ctx, options.redact);
926
932
  const currentAnalysis = analyzeEntries(currentEntries, options.redact);
927
933
  const fullAnalysis = analyzeEntries(branchEntries, options.redact);
@@ -1006,7 +1012,7 @@ function reportPath(ctx: ExtensionCommandContext, options: CommandOptions): stri
1006
1012
  const rawSessionId = options.redact ? "redacted" : (safeCall(() => ctx.sessionManager.getSessionId()) ?? "session");
1007
1013
  const fileName = `pi-context-${sanitizeFilePart(rawSessionId)}-${Date.now()}.html`;
1008
1014
  if (options.keep) {
1009
- const dir = join(ctx.cwd, ".pi", "context-reports");
1015
+ const dir = join(ctx.cwd, CONFIG_DIR_NAME, "context-reports");
1010
1016
  mkdirSync(dir, { recursive: true, mode: 0o700 });
1011
1017
  try { chmodSync(dir, 0o700); } catch { /* best effort */ }
1012
1018
  return join(dir, fileName);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-context-inspector",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "description": "A pi extension that opens a local HTML dashboard explaining where the current session context is going.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -30,5 +30,9 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@earendil-works/pi-coding-agent": "*"
33
+ },
34
+ "type": "module",
35
+ "engines": {
36
+ "node": ">=22.19.0"
33
37
  }
34
38
  }
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6