@diegopetrucci/pi-extensions 0.1.68 → 0.1.70
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/README.md +1 -1
- package/extensions/code-reviewer/index.ts +181 -2
- package/extensions/code-reviewer/package.json +1 -1
- package/extensions/context-inspector/index.ts +84 -5
- package/extensions/context-inspector/package.json +1 -1
- package/extensions/contrarian/index.ts +151 -14
- package/extensions/contrarian/package.json +1 -1
- package/extensions/dynamic-context-pruning/README.md +1 -1
- package/extensions/dynamic-context-pruning/index.ts +120 -18
- package/extensions/dynamic-context-pruning/package.json +1 -1
- package/extensions/minimal-footer/README.md +10 -8
- package/extensions/minimal-footer/index.ts +2 -2
- package/extensions/minimal-footer/minimal-footer.example.json +2 -2
- package/extensions/minimal-footer/openai-usage.ts +52 -4
- package/extensions/minimal-footer/package.json +1 -1
- package/extensions/oracle/index.ts +125 -15
- package/extensions/oracle/package.json +1 -1
- package/package.json +4 -4
|
@@ -12,7 +12,7 @@ It replaces pi's built-in footer with a cleaner two-line layout that focuses on
|
|
|
12
12
|
- current context percentage
|
|
13
13
|
- red `DUMB ZONE` indicator when context usage is above 200k tokens
|
|
14
14
|
- current model and thinking level
|
|
15
|
-
- OpenAI Codex
|
|
15
|
+
- OpenAI Codex usage windows, labeled from the durations reported by OpenAI
|
|
16
16
|
- `xp` marker when Pi experimental features are enabled
|
|
17
17
|
|
|
18
18
|
## Layout
|
|
@@ -45,12 +45,14 @@ When context usage is above 200k tokens, the bottom-left line includes a red war
|
|
|
45
45
|
44.1% · DUMB ZONE
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
When using `openai-codex`, the bottom-left line also includes subscription usage:
|
|
48
|
+
When using `openai-codex`, the bottom-left line also includes subscription usage. A typical account with both windows looks like:
|
|
49
49
|
|
|
50
50
|
```text
|
|
51
51
|
44.1% · 5h 12% · 7d 38%
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
Window labels come from OpenAI's reported durations, so an account that reports only a weekly primary window is shown correctly (for example, `7d 38%`) instead of being assumed to have a 5-hour window.
|
|
55
|
+
|
|
54
56
|
When `PI_EXPERIMENTAL=1`, the bottom-left line also includes an experimental marker:
|
|
55
57
|
|
|
56
58
|
```text
|
|
@@ -116,11 +118,11 @@ Example:
|
|
|
116
118
|
"windows": {
|
|
117
119
|
"primary": {
|
|
118
120
|
"enabled": true,
|
|
119
|
-
"label": "
|
|
121
|
+
"label": "auto"
|
|
120
122
|
},
|
|
121
123
|
"secondary": {
|
|
122
124
|
"enabled": true,
|
|
123
|
-
"label": "
|
|
125
|
+
"label": "auto"
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
},
|
|
@@ -205,9 +207,9 @@ Disable git dirty/ahead/PR status:
|
|
|
205
207
|
- `codexUsage.cacheTtlMs`: in-memory usage cache duration
|
|
206
208
|
- `codexUsage.requestTimeoutMs`: usage request timeout
|
|
207
209
|
- `codexUsage.windows.primary.enabled`: show the primary usage window
|
|
208
|
-
- `codexUsage.windows.primary.label`:
|
|
210
|
+
- `codexUsage.windows.primary.label`: `"auto"` derives the primary label from OpenAI's reported duration; any other value overrides it
|
|
209
211
|
- `codexUsage.windows.secondary.enabled`: show the secondary usage window
|
|
210
|
-
- `codexUsage.windows.secondary.label`:
|
|
212
|
+
- `codexUsage.windows.secondary.label`: `"auto"` derives the secondary label from OpenAI's reported duration; any other value overrides it
|
|
211
213
|
- `experimentalMarker.enabled`: show the marker when `PI_EXPERIMENTAL=1`
|
|
212
214
|
- `experimentalMarker.label`: marker text
|
|
213
215
|
- `experimentalMarker.color`: theme color for the marker (`error`, `warning`, `accent`, `text`, or `dim`)
|
|
@@ -221,7 +223,7 @@ Disable git dirty/ahead/PR status:
|
|
|
221
223
|
- **Top left:** current git branch plus dirty/ahead/PR status when available
|
|
222
224
|
- **Top right:** current repo directory name
|
|
223
225
|
- **Bottom left:** current context usage percentage, plus red `DUMB ZONE` above 200k context tokens
|
|
224
|
-
- **Bottom left on `openai-codex`:** current context usage percentage plus
|
|
226
|
+
- **Bottom left on `openai-codex`:** current context usage percentage plus the Codex usage windows reported for the account
|
|
225
227
|
- **Bottom left with `PI_EXPERIMENTAL=1`:** current context usage percentage plus `xp`
|
|
226
228
|
- **Bottom right:** model id and thinking level
|
|
227
229
|
|
|
@@ -237,5 +239,5 @@ This extension also lives inside the broader [`pi-extensions`](../../README.md)
|
|
|
237
239
|
- Shows `DUMB ZONE` only while context usage is above 200k tokens.
|
|
238
240
|
- Shows the model id rather than a provider-specific display label.
|
|
239
241
|
- Shows `xp` when `PI_EXPERIMENTAL=1`.
|
|
240
|
-
- For `openai-codex`, reads pi's stored OAuth login and fetches usage from ChatGPT's backend usage endpoint.
|
|
242
|
+
- For `openai-codex`, reads pi's stored OAuth login and fetches usage from ChatGPT's backend usage endpoint. Window labels are inferred from each window's reported duration; missing or unrecognized durations use neutral `usage` labels rather than guessing from window position.
|
|
241
243
|
- Usage is cached briefly in memory and refreshed after turns.
|
|
@@ -5,6 +5,7 @@ import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
|
5
5
|
const PROVIDER_ID = "openai-codex";
|
|
6
6
|
|
|
7
7
|
interface WhamUsageWindow {
|
|
8
|
+
limit_window_seconds?: number;
|
|
8
9
|
reset_at?: number;
|
|
9
10
|
used_percent?: number;
|
|
10
11
|
}
|
|
@@ -18,6 +19,7 @@ interface WhamUsageResponse {
|
|
|
18
19
|
|
|
19
20
|
export interface UsageWindow {
|
|
20
21
|
usedPercent?: number;
|
|
22
|
+
windowSeconds?: number;
|
|
21
23
|
resetAt?: number;
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -43,6 +45,11 @@ function normalizeUsedPercent(value?: number): number | undefined {
|
|
|
43
45
|
return Math.min(100, Math.max(0, value));
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
function normalizeWindowSeconds(value?: number): number | undefined {
|
|
49
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return undefined;
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
function normalizeResetAt(value?: number): number | undefined {
|
|
47
54
|
if (typeof value !== "number" || !Number.isFinite(value)) return undefined;
|
|
48
55
|
return value * 1000;
|
|
@@ -51,9 +58,10 @@ function normalizeResetAt(value?: number): number | undefined {
|
|
|
51
58
|
function parseUsageWindow(window?: WhamUsageWindow): UsageWindow | undefined {
|
|
52
59
|
if (!window) return undefined;
|
|
53
60
|
const usedPercent = normalizeUsedPercent(window.used_percent);
|
|
61
|
+
const windowSeconds = normalizeWindowSeconds(window.limit_window_seconds);
|
|
54
62
|
const resetAt = normalizeResetAt(window.reset_at);
|
|
55
|
-
if (usedPercent === undefined && resetAt === undefined) return undefined;
|
|
56
|
-
return { usedPercent, resetAt };
|
|
63
|
+
if (usedPercent === undefined && windowSeconds === undefined && resetAt === undefined) return undefined;
|
|
64
|
+
return { usedPercent, windowSeconds, resetAt };
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
function parseUsageSnapshot(data: WhamUsageResponse): Omit<UsageSnapshot, "fetchedAt"> {
|
|
@@ -125,6 +133,36 @@ function formatUsagePercent(value?: number): string | undefined {
|
|
|
125
133
|
return `${Math.round(value)}%`;
|
|
126
134
|
}
|
|
127
135
|
|
|
136
|
+
// Primary/secondary describe positions, not fixed periods. Match each reported
|
|
137
|
+
// duration the same way Codex does, allowing small backend rounding differences.
|
|
138
|
+
const KNOWN_WINDOW_LABELS: ReadonlyArray<{ seconds: number; label: string }> = [
|
|
139
|
+
{ seconds: 5 * 60 * 60, label: "5h" },
|
|
140
|
+
{ seconds: 24 * 60 * 60, label: "1d" },
|
|
141
|
+
{ seconds: 7 * 24 * 60 * 60, label: "7d" },
|
|
142
|
+
{ seconds: 30 * 24 * 60 * 60, label: "30d" },
|
|
143
|
+
{ seconds: 365 * 24 * 60 * 60, label: "365d" },
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
function isApproximateWindow(actualSeconds: number, expectedSeconds: number): boolean {
|
|
147
|
+
return Math.abs(actualSeconds - expectedSeconds) <= expectedSeconds * 0.05;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function formatUsageWindowLabel(
|
|
151
|
+
window: UsageWindow | undefined,
|
|
152
|
+
configuredLabel: string,
|
|
153
|
+
fallbackLabel: string,
|
|
154
|
+
): string {
|
|
155
|
+
if (configuredLabel.toLowerCase() !== "auto") return configuredLabel;
|
|
156
|
+
const windowSeconds = window?.windowSeconds;
|
|
157
|
+
if (windowSeconds !== undefined) {
|
|
158
|
+
const knownWindow = KNOWN_WINDOW_LABELS.find(({ seconds }) =>
|
|
159
|
+
isApproximateWindow(windowSeconds, seconds)
|
|
160
|
+
);
|
|
161
|
+
if (knownWindow) return knownWindow.label;
|
|
162
|
+
}
|
|
163
|
+
return fallbackLabel;
|
|
164
|
+
}
|
|
165
|
+
|
|
128
166
|
export function isOpenAICodexProvider(provider?: string): boolean {
|
|
129
167
|
return provider === PROVIDER_ID;
|
|
130
168
|
}
|
|
@@ -139,8 +177,18 @@ export function formatUsageSummary(
|
|
|
139
177
|
const secondary = formatUsagePercent(snapshot.secondary?.usedPercent);
|
|
140
178
|
const parts: string[] = [];
|
|
141
179
|
|
|
142
|
-
if (windows.primary.enabled && primary)
|
|
143
|
-
|
|
180
|
+
if (windows.primary.enabled && primary) {
|
|
181
|
+
const label = formatUsageWindowLabel(snapshot.primary, windows.primary.label, "usage");
|
|
182
|
+
parts.push(`${label} ${primary}`);
|
|
183
|
+
}
|
|
184
|
+
if (windows.secondary.enabled && secondary) {
|
|
185
|
+
const label = formatUsageWindowLabel(
|
|
186
|
+
snapshot.secondary,
|
|
187
|
+
windows.secondary.label,
|
|
188
|
+
"secondary usage",
|
|
189
|
+
);
|
|
190
|
+
parts.push(`${label} ${secondary}`);
|
|
191
|
+
}
|
|
144
192
|
|
|
145
193
|
return parts.length > 0 ? parts.join(" · ") : undefined;
|
|
146
194
|
}
|
|
@@ -107,6 +107,13 @@ const ORACLE_CONFIG_FILE = "oracle.json";
|
|
|
107
107
|
|
|
108
108
|
const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
109
109
|
"amazon-bedrock": [
|
|
110
|
+
"global.anthropic.claude-opus-5-5 ",
|
|
111
|
+
"au.anthropic.claude-opus-5-5 ",
|
|
112
|
+
"eu.anthropic.claude-opus-5-5 ",
|
|
113
|
+
"jp.anthropic.claude-opus-5-5 ",
|
|
114
|
+
"us.anthropic.claude-opus-5-5 ",
|
|
115
|
+
"anthropic.claude-opus-5-5 ",
|
|
116
|
+
"claude-opus-5-5",
|
|
110
117
|
"claude-opus-5",
|
|
111
118
|
"claude-fable-5",
|
|
112
119
|
"claude-opus-4-8",
|
|
@@ -115,6 +122,10 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
115
122
|
"claude-opus-4-5",
|
|
116
123
|
"claude-opus-4-1",
|
|
117
124
|
"claude-opus-4",
|
|
125
|
+
"global.openai.gpt-6-astra ",
|
|
126
|
+
"us.openai.gpt-6-astra ",
|
|
127
|
+
"openai.gpt-6-astra ",
|
|
128
|
+
"gpt-6-astra",
|
|
118
129
|
"openai.gpt-5.6-sol",
|
|
119
130
|
"openai.gpt-5.6-terra",
|
|
120
131
|
"openai.gpt-5.6-luna",
|
|
@@ -123,7 +134,6 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
123
134
|
"claude-sonnet-4-5",
|
|
124
135
|
"claude-sonnet-4",
|
|
125
136
|
"deepseek.v3.2",
|
|
126
|
-
"deepseek.r1",
|
|
127
137
|
"kimi-k2.5",
|
|
128
138
|
"minimax-m2.5",
|
|
129
139
|
"minimax-m2.1",
|
|
@@ -131,6 +141,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
131
141
|
"xai.grok-4.6",
|
|
132
142
|
],
|
|
133
143
|
anthropic: [
|
|
144
|
+
"claude-opus-5-5 ",
|
|
145
|
+
"claude-opus-5-5",
|
|
134
146
|
"claude-opus-5",
|
|
135
147
|
"claude-fable-5",
|
|
136
148
|
"claude-opus-4-8",
|
|
@@ -143,8 +155,14 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
143
155
|
],
|
|
144
156
|
"ant-ling": ["Ling-2.6-1T", "Ling-2.6-flash"],
|
|
145
157
|
"azure-openai-responses": [
|
|
158
|
+
"gpt-6-astra ",
|
|
159
|
+
"gpt-6-astra",
|
|
160
|
+
"gpt-6-sol ",
|
|
161
|
+
"gpt-6-sol",
|
|
146
162
|
"gpt-5.6-sol",
|
|
147
163
|
"gpt-5.6-terra",
|
|
164
|
+
"gpt-6-luna ",
|
|
165
|
+
"gpt-6-luna",
|
|
148
166
|
"gpt-5.6-luna",
|
|
149
167
|
"gpt-5.5-pro",
|
|
150
168
|
"gpt-5.5",
|
|
@@ -181,7 +199,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
181
199
|
"zai-org/GLM-5.2-Fast",
|
|
182
200
|
"zai-org/GLM-4.7",
|
|
183
201
|
],
|
|
184
|
-
cerebras: ["gpt-oss-120b", "
|
|
202
|
+
cerebras: ["gpt-oss-120b", "qwen-3.8-27b"],
|
|
185
203
|
"cloudflare-ai-gateway": [
|
|
186
204
|
"claude-fable-5",
|
|
187
205
|
"claude-opus-5",
|
|
@@ -189,6 +207,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
189
207
|
"claude-opus-4.7",
|
|
190
208
|
"claude-opus-4.6",
|
|
191
209
|
"claude-opus-4.5",
|
|
210
|
+
"gpt-6-astra ",
|
|
211
|
+
"gpt-6-astra",
|
|
192
212
|
"gpt-5.5",
|
|
193
213
|
"gpt-5.4",
|
|
194
214
|
"workers-ai/@cf/moonshotai/kimi-k2.7-code",
|
|
@@ -212,7 +232,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
212
232
|
"@cf/qwen/qwen3-30b-a3b-fp8",
|
|
213
233
|
"@cf/zai-org/glm-4.7-flash",
|
|
214
234
|
],
|
|
215
|
-
deepseek: ["deepseek-v4-pro", "deepseek-
|
|
235
|
+
deepseek: ["deepseek-v4-pro", "deepseek-flash"],
|
|
216
236
|
fireworks: [
|
|
217
237
|
"accounts/fireworks/models/kimi-k3",
|
|
218
238
|
"accounts/fireworks/routers/kimi-k3-fast",
|
|
@@ -226,13 +246,20 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
226
246
|
"accounts/fireworks/models/gpt-oss-120b",
|
|
227
247
|
],
|
|
228
248
|
"github-copilot": [
|
|
249
|
+
"claude-opus-5.5 ",
|
|
250
|
+
"claude-opus-5.5",
|
|
229
251
|
"claude-opus-5",
|
|
230
252
|
"claude-fable-5",
|
|
231
253
|
"claude-opus-4.8",
|
|
232
254
|
"claude-opus-4.7",
|
|
255
|
+
"gpt-6-astra ",
|
|
233
256
|
"gpt-6-astra",
|
|
257
|
+
"gpt-6-sol ",
|
|
258
|
+
"gpt-6-sol",
|
|
234
259
|
"gpt-5.6-sol",
|
|
235
260
|
"gpt-5.6-terra",
|
|
261
|
+
"gpt-6-luna ",
|
|
262
|
+
"gpt-6-luna",
|
|
236
263
|
"gpt-5.6-luna",
|
|
237
264
|
"gpt-5.5",
|
|
238
265
|
"gpt-5.4",
|
|
@@ -241,6 +268,10 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
241
268
|
"claude-sonnet-5",
|
|
242
269
|
"claude-sonnet-4.6",
|
|
243
270
|
"gpt-5-mini",
|
|
271
|
+
"grok-4.7 ",
|
|
272
|
+
"grok-4.7",
|
|
273
|
+
"grok-4.6",
|
|
274
|
+
"grok-4.5",
|
|
244
275
|
"kimi-k3",
|
|
245
276
|
"kimi-k2.7-code",
|
|
246
277
|
],
|
|
@@ -285,6 +316,13 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
285
316
|
"Qwen/Qwen3-Coder-Next",
|
|
286
317
|
],
|
|
287
318
|
"kimi-coding": ["k3", "kimi-for-coding", "kimi-for-coding-highspeed"],
|
|
319
|
+
meta: [
|
|
320
|
+
"muse-spark-1.3",
|
|
321
|
+
"muse-spark-1.3-contributor",
|
|
322
|
+
"muse-spark-1.2",
|
|
323
|
+
"muse-spark-1.2-contributor",
|
|
324
|
+
"muse-spark-1.1",
|
|
325
|
+
],
|
|
288
326
|
minimax: ["MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7"],
|
|
289
327
|
"minimax-cn": ["MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7"],
|
|
290
328
|
mistral: [
|
|
@@ -301,9 +339,14 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
301
339
|
"zai-glm-5-2",
|
|
302
340
|
],
|
|
303
341
|
openai: [
|
|
342
|
+
"gpt-6-astra ",
|
|
304
343
|
"gpt-6-astra",
|
|
344
|
+
"gpt-6-sol ",
|
|
345
|
+
"gpt-6-sol",
|
|
305
346
|
"gpt-5.6-sol",
|
|
306
347
|
"gpt-5.6-terra",
|
|
348
|
+
"gpt-6-luna ",
|
|
349
|
+
"gpt-6-luna",
|
|
307
350
|
"gpt-5.6-luna",
|
|
308
351
|
"gpt-5.5-pro",
|
|
309
352
|
"gpt-5.5",
|
|
@@ -321,18 +364,32 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
321
364
|
"gpt-5-mini",
|
|
322
365
|
],
|
|
323
366
|
"openai-codex": [
|
|
367
|
+
"gpt-6-astra ",
|
|
324
368
|
"gpt-6-astra",
|
|
369
|
+
"gpt-6-sol ",
|
|
370
|
+
"gpt-6-sol",
|
|
325
371
|
"gpt-5.6-sol",
|
|
326
372
|
"gpt-5.6-terra",
|
|
373
|
+
"gpt-6-luna ",
|
|
374
|
+
"gpt-6-luna",
|
|
327
375
|
"gpt-5.6-luna",
|
|
328
376
|
"gpt-5.5",
|
|
329
|
-
"gpt-5.4",
|
|
330
|
-
"gpt-5.4-mini",
|
|
331
377
|
"gpt-5.3-codex-spark",
|
|
332
378
|
],
|
|
333
379
|
opencode: [
|
|
380
|
+
"claude-opus-5-5 ",
|
|
381
|
+
"claude-opus-5-5",
|
|
334
382
|
"claude-opus-5",
|
|
335
383
|
"claude-fable-5",
|
|
384
|
+
"gpt-6-astra ",
|
|
385
|
+
"gpt-6-astra",
|
|
386
|
+
"gpt-6-sol ",
|
|
387
|
+
"gpt-6-sol",
|
|
388
|
+
"gpt-5.6-sol",
|
|
389
|
+
"gpt-5.6-terra",
|
|
390
|
+
"gpt-6-luna ",
|
|
391
|
+
"gpt-6-luna",
|
|
392
|
+
"gpt-5.6-luna",
|
|
336
393
|
"gpt-5.5-pro",
|
|
337
394
|
"gpt-5.5",
|
|
338
395
|
"gpt-5.4-pro",
|
|
@@ -344,6 +401,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
344
401
|
"gpt-5.3-codex",
|
|
345
402
|
"gpt-5.2-codex",
|
|
346
403
|
"gpt-5.1-codex",
|
|
404
|
+
"grok-4.6",
|
|
347
405
|
"grok-4.5",
|
|
348
406
|
"gemini-3.5-flash",
|
|
349
407
|
"gemini-3.1-pro",
|
|
@@ -374,8 +432,13 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
374
432
|
"kimi-k3",
|
|
375
433
|
"kimi-k2.7-code",
|
|
376
434
|
"kimi-k2.6",
|
|
435
|
+
"grok-4.7 ",
|
|
436
|
+
"grok-4.7",
|
|
437
|
+
"grok-4.6",
|
|
377
438
|
],
|
|
378
439
|
openrouter: [
|
|
440
|
+
"anthropic/claude-opus-5.5 ",
|
|
441
|
+
"anthropic/claude-opus-5.5",
|
|
379
442
|
"anthropic/claude-opus-5",
|
|
380
443
|
"anthropic/claude-fable-5",
|
|
381
444
|
"~anthropic/claude-fable-latest",
|
|
@@ -384,15 +447,21 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
384
447
|
"anthropic/claude-opus-4.6",
|
|
385
448
|
"anthropic/claude-opus-4.5",
|
|
386
449
|
"anthropic/claude-opus-4.1",
|
|
450
|
+
"openai/gpt-6-astra ",
|
|
451
|
+
"openai/gpt-6-astra",
|
|
452
|
+
"openai/gpt-6-sol ",
|
|
453
|
+
"openai/gpt-6-sol",
|
|
387
454
|
"openai/gpt-5.6-sol-pro",
|
|
388
455
|
"openai/gpt-5.6-sol",
|
|
389
456
|
"openai/gpt-5.6-terra-pro",
|
|
390
457
|
"openai/gpt-5.6-terra",
|
|
458
|
+
"openai/gpt-6-luna ",
|
|
459
|
+
"openai/gpt-6-luna",
|
|
391
460
|
"openai/gpt-5.6-luna-pro",
|
|
392
461
|
"openai/gpt-5.6-luna",
|
|
393
462
|
"openai/gpt-5.5-pro",
|
|
394
463
|
"openai/gpt-5.5",
|
|
395
|
-
"~openai/gpt-latest",
|
|
464
|
+
"~openai/gpt-astra-latest",
|
|
396
465
|
"google/gemini-3.1-pro-preview-customtools",
|
|
397
466
|
"google/gemini-3.1-pro-preview",
|
|
398
467
|
"~google/gemini-pro-latest",
|
|
@@ -403,6 +472,9 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
403
472
|
"~moonshotai/kimi-latest",
|
|
404
473
|
"moonshotai/kimi-k2.6",
|
|
405
474
|
"moonshotai/kimi-k2-thinking",
|
|
475
|
+
"x-ai/grok-4.7 ",
|
|
476
|
+
"x-ai/grok-4.7",
|
|
477
|
+
"x-ai/grok-4.6",
|
|
406
478
|
"x-ai/grok-4.5",
|
|
407
479
|
"~x-ai/grok-latest",
|
|
408
480
|
"deepseek/deepseek-v4-pro",
|
|
@@ -444,6 +516,34 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
444
516
|
"glm-5.2",
|
|
445
517
|
"deepseek-v4-flash-0731",
|
|
446
518
|
],
|
|
519
|
+
radius: [
|
|
520
|
+
"gpt-6-astra ",
|
|
521
|
+
"gpt-6-astra",
|
|
522
|
+
"claude-opus-5-5 ",
|
|
523
|
+
"claude-opus-5-5",
|
|
524
|
+
"claude-opus-5",
|
|
525
|
+
"gpt-6-sol ",
|
|
526
|
+
"gpt-6-sol",
|
|
527
|
+
"gpt-5.6-sol",
|
|
528
|
+
"gpt-5.6-terra",
|
|
529
|
+
"gpt-6-luna ",
|
|
530
|
+
"gpt-6-luna",
|
|
531
|
+
"gpt-5.6-luna",
|
|
532
|
+
"claude-fable-5-1",
|
|
533
|
+
"claude-fable-5",
|
|
534
|
+
"claude-opus-4-8",
|
|
535
|
+
"claude-sonnet-5",
|
|
536
|
+
"gpt-5.5",
|
|
537
|
+
"gpt-5.4",
|
|
538
|
+
"gpt-5.3-codex",
|
|
539
|
+
"kimi-k3",
|
|
540
|
+
"deepseek-v4-pro",
|
|
541
|
+
"glm-5.3",
|
|
542
|
+
"kimi-k2.7-code",
|
|
543
|
+
"deepseek-v4.1-flash",
|
|
544
|
+
"gpt-5.4-mini",
|
|
545
|
+
"glm-5.3-flash",
|
|
546
|
+
],
|
|
447
547
|
together: [
|
|
448
548
|
"deepseek-ai/DeepSeek-V4-Pro",
|
|
449
549
|
"moonshotai/Kimi-K3",
|
|
@@ -461,6 +561,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
461
561
|
"google/gemma-4-31B-it",
|
|
462
562
|
],
|
|
463
563
|
"vercel-ai-gateway": [
|
|
564
|
+
"anthropic/claude-opus-5.5 ",
|
|
565
|
+
"anthropic/claude-opus-5.5",
|
|
464
566
|
"anthropic/claude-opus-5",
|
|
465
567
|
"anthropic/claude-fable-5",
|
|
466
568
|
"anthropic/claude-opus-4.8",
|
|
@@ -469,8 +571,14 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
469
571
|
"anthropic/claude-opus-4.5",
|
|
470
572
|
"anthropic/claude-sonnet-5",
|
|
471
573
|
"anthropic/claude-sonnet-4.6",
|
|
574
|
+
"openai/gpt-6-astra ",
|
|
575
|
+
"openai/gpt-6-astra",
|
|
576
|
+
"openai/gpt-6-sol ",
|
|
577
|
+
"openai/gpt-6-sol",
|
|
472
578
|
"openai/gpt-5.6-sol",
|
|
473
579
|
"openai/gpt-5.6-terra",
|
|
580
|
+
"openai/gpt-6-luna ",
|
|
581
|
+
"openai/gpt-6-luna",
|
|
474
582
|
"openai/gpt-5.6-luna",
|
|
475
583
|
"openai/gpt-5.5-pro",
|
|
476
584
|
"openai/gpt-5.5",
|
|
@@ -495,6 +603,9 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
495
603
|
"google/gemini-3.1-pro-preview",
|
|
496
604
|
"google/gemini-3.5-flash",
|
|
497
605
|
"google/gemini-3-flash",
|
|
606
|
+
"spacexai/grok-4.7 ",
|
|
607
|
+
"spacexai/grok-4.7",
|
|
608
|
+
"spacexai/grok-4.6",
|
|
498
609
|
"xai/grok-4.5",
|
|
499
610
|
"xai/grok-4.20-reasoning",
|
|
500
611
|
"minimax/minimax-m3",
|
|
@@ -503,6 +614,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
503
614
|
"zai/glm-5.1",
|
|
504
615
|
],
|
|
505
616
|
xai: [
|
|
617
|
+
"grok-4.7 ",
|
|
618
|
+
"grok-4.7",
|
|
506
619
|
"grok-4.6",
|
|
507
620
|
"grok-4.5",
|
|
508
621
|
"grok-4.3",
|
|
@@ -515,9 +628,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
515
628
|
"nvidia/nemotron-3-ultra-550b-a55b",
|
|
516
629
|
"nvidia/nemotron-3-super-120b-a12b",
|
|
517
630
|
"moonshotai/kimi-k3",
|
|
518
|
-
"deepseek-ai/deepseek-v4-pro-0813",
|
|
519
631
|
"moonshotai/kimi-k2.6",
|
|
520
|
-
"minimaxai/minimax-m3",
|
|
521
632
|
"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",
|
|
522
633
|
],
|
|
523
634
|
zai: [
|
|
@@ -528,13 +639,12 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
528
639
|
],
|
|
529
640
|
"zai-coding-cn": [
|
|
530
641
|
"glm-5.3",
|
|
531
|
-
"glm-5.
|
|
532
|
-
"glm-5-
|
|
533
|
-
"glm-
|
|
534
|
-
"glm-4.7",
|
|
642
|
+
"glm-5.3-highspeed",
|
|
643
|
+
"glm-5.3-flash",
|
|
644
|
+
"glm-4.6v",
|
|
535
645
|
],
|
|
536
|
-
moonshotai: ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6"
|
|
537
|
-
"moonshotai-cn": ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6"
|
|
646
|
+
moonshotai: ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6"],
|
|
647
|
+
"moonshotai-cn": ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6"],
|
|
538
648
|
};
|
|
539
649
|
|
|
540
650
|
const ORACLE_SYSTEM_PROMPT = [
|
|
@@ -913,7 +1023,7 @@ function clampThinkingLevel(model: PiModel, requested: ThinkingLevel): ThinkingL
|
|
|
913
1023
|
|
|
914
1024
|
function isGpt56SolModel(model: PiModel | undefined): boolean {
|
|
915
1025
|
if (!model) return false;
|
|
916
|
-
return /\bgpt-5\.6-sol\b/i.test(`${model.id} ${model.name ?? ""}`);
|
|
1026
|
+
return /\bgpt-(?:5\.6|6)-sol\b/i.test(`${model.id} ${model.name ?? ""}`);
|
|
917
1027
|
}
|
|
918
1028
|
|
|
919
1029
|
function resolveThinkingLevel(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegopetrucci/pi-extensions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.70",
|
|
4
4
|
"description": "A collection of pi extensions and skills for annotation UIs, context management, workflow audits, contrarian review, review-comment triage, notifications, brrr push alerts, safety guards, GitHub research, repo-local knowledge, todos, tool rendering, model/provider helpers, and Xiaohei-style article illustrations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@earendil-works/pi-ai": "^0.
|
|
75
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
76
|
-
"@earendil-works/pi-tui": "^0.
|
|
74
|
+
"@earendil-works/pi-ai": "^0.87.1",
|
|
75
|
+
"@earendil-works/pi-coding-agent": "^0.87.1",
|
|
76
|
+
"@earendil-works/pi-tui": "^0.87.1",
|
|
77
77
|
"@types/node": "^25.9.1",
|
|
78
78
|
"husky": "^9.1.7",
|
|
79
79
|
"typebox": "^1.3.6",
|