@diegopetrucci/pi-contrarian 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 0.80.3
1
+ 0.80.6
package/index.ts CHANGED
@@ -7,7 +7,7 @@ import { getAgentDir, getMarkdownTheme, type ExtensionAPI, type ExtensionContext
7
7
  import { Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
8
8
  import { Type } from "typebox";
9
9
 
10
- type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
10
+ type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
11
11
  type ThinkingLevelMap = Partial<Record<ThinkingLevel, unknown | null>>;
12
12
 
13
13
  type PiModel = {
@@ -67,24 +67,26 @@ interface ContrarianPreferences {
67
67
  const READ_ONLY_TOOLS = ["read", "grep", "find", "ls"];
68
68
  const READ_ONLY_PLUS_BASH_TOOLS = [...READ_ONLY_TOOLS, "bash"];
69
69
  const DEFAULT_THINKING_LEVEL: ThinkingLevel = "high";
70
- const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const;
70
+ const THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"] as const;
71
71
  const COLLAPSED_LINE_LIMIT = 8;
72
72
  const CONTRARIAN_STATUS_ID = "contrarian";
73
73
  const CONTRARIAN_WIDGET_ID = "contrarian";
74
74
  const CONTRARIAN_CONFIG_FILE = "contrarian.json";
75
75
  const CONTRARIAN_MODEL_PREFERENCES = [
76
+ "gpt-5.6-sol",
77
+ "gpt-5.6-terra",
78
+ "gpt-5.6-luna",
76
79
  "gpt-5.5",
77
80
  "claude-opus-4-8",
78
81
  "claude-opus-4.8",
79
- "claude-sonnet-5-0",
80
- "claude-sonnet-5.0",
81
82
  "claude-sonnet-5",
82
83
  "claude-sonnet-4-6",
83
84
  "claude-sonnet-4.6",
84
85
  "claude-sonnet-4-5",
85
86
  "claude-sonnet-4.5",
86
- "claude-sonnet-4-0",
87
87
  "claude-sonnet-4",
88
+ "grok-4.5",
89
+ "gemini-3.5-flash",
88
90
  ];
89
91
 
90
92
  const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
@@ -110,40 +112,32 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
110
112
  anthropic: [
111
113
  "claude-fable-5",
112
114
  "claude-opus-4-8",
113
- "claude-opus-4.8",
114
115
  "claude-opus-4-7",
115
- "claude-opus-4.7",
116
116
  "claude-opus-4-6",
117
- "claude-opus-4.6",
118
117
  "claude-opus-4-5",
119
- "claude-opus-4.5",
120
118
  "claude-opus-4-1",
121
- "claude-opus-4.1",
122
- "claude-opus-4-0",
123
- "claude-opus-4",
124
- "claude-sonnet-5-0",
125
- "claude-sonnet-5.0",
126
119
  "claude-sonnet-5",
127
120
  "claude-sonnet-4-6",
128
- "claude-sonnet-4.6",
129
121
  "claude-sonnet-4-5",
130
- "claude-sonnet-4.5",
131
- "claude-sonnet-4-0",
132
- "claude-sonnet-4",
133
- "claude-3-7-sonnet",
134
122
  ],
135
123
  "ant-ling": ["Ling-2.6-1T", "Ling-2.6-flash"],
136
124
  "azure-openai-responses": [
125
+ "gpt-5.6-sol",
126
+ "gpt-5.6-terra",
127
+ "gpt-5.6-luna",
137
128
  "gpt-5.5-pro",
138
129
  "gpt-5.5",
139
130
  "gpt-5.4-pro",
140
131
  "gpt-5.4",
141
132
  "gpt-5.3-codex",
142
133
  "gpt-5-pro",
134
+ "gpt-5-chat-latest",
143
135
  "gpt-5.2-pro",
144
136
  "gpt-5.2",
145
137
  "gpt-5.2-codex",
146
138
  "gpt-5.1-codex-max",
139
+ "gpt-5.1-codex",
140
+ "gpt-5.1",
147
141
  "gpt-5.1-chat-latest",
148
142
  "o3-pro",
149
143
  "o3-deep-research",
@@ -151,7 +145,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
151
145
  "gpt-5.4-mini",
152
146
  "gpt-5-mini",
153
147
  ],
154
- cerebras: ["gpt-oss-120b", "zai-glm-4.7", "llama3.1-8b"],
148
+ cerebras: ["gpt-oss-120b", "zai-glm-4.7", "gemma-4-31b"],
155
149
  "cloudflare-ai-gateway": [
156
150
  "claude-fable-5",
157
151
  "claude-opus-4-7",
@@ -169,8 +163,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
169
163
  "@cf/zai-org/glm-5.2",
170
164
  "@cf/moonshotai/kimi-k2.6",
171
165
  "@cf/nvidia/nemotron-3-120b-a12b",
172
- "@cf/moonshotai/kimi-k2.5",
173
166
  "@cf/openai/gpt-oss-120b",
167
+ "@cf/qwen/qwen3-30b-a3b-fp8",
174
168
  "@cf/zai-org/glm-4.7-flash",
175
169
  ],
176
170
  deepseek: ["deepseek-v4-pro", "deepseek-v4-flash"],
@@ -179,13 +173,17 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
179
173
  "accounts/fireworks/models/kimi-k2p7-code",
180
174
  "accounts/fireworks/routers/kimi-k2p7-code-fast",
181
175
  "accounts/fireworks/models/glm-5p2",
176
+ "accounts/fireworks/routers/glm-5p2-fast",
182
177
  "accounts/fireworks/models/minimax-m3",
183
178
  "accounts/fireworks/models/glm-5p1",
179
+ "accounts/fireworks/routers/glm-5p1-fast",
184
180
  "accounts/fireworks/models/kimi-k2p6",
181
+ "accounts/fireworks/routers/kimi-k2p6-turbo",
182
+ "accounts/fireworks/routers/kimi-k2p6-fast",
185
183
  "accounts/fireworks/models/minimax-m2p7",
186
184
  "accounts/fireworks/models/qwen3p7-plus",
187
- "accounts/fireworks/models/qwen3p6-plus",
188
185
  "accounts/fireworks/models/gpt-oss-120b",
186
+ "accounts/fireworks/models/gpt-oss-20b",
189
187
  ],
190
188
  "github-copilot": [
191
189
  "claude-fable-5",
@@ -196,42 +194,46 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
196
194
  "gpt-5.5",
197
195
  "gpt-5.4",
198
196
  "gpt-5.3-codex",
197
+ "gpt-5.2-codex",
199
198
  "gpt-5.2",
200
- "gpt-5.1-codex-max",
201
- "gpt-5.1",
202
- "gpt-5",
203
199
  "gemini-3.1-pro-preview",
204
- "gemini-3-pro-preview",
205
- "claude-sonnet-5.0",
200
+ "gemini-3.5-flash",
201
+ "gemini-3-flash-preview",
206
202
  "claude-sonnet-5",
207
203
  "claude-sonnet-4.6",
208
204
  "claude-sonnet-4.5",
209
205
  "gemini-2.5-pro",
206
+ "gpt-5-mini",
207
+ "kimi-k2.7-code",
210
208
  ],
211
209
  google: [
212
210
  "gemini-3.1-pro-preview-customtools",
213
211
  "gemini-3.1-pro-preview",
214
212
  "gemini-3-pro-preview",
215
- "gemini-2.5-pro-preview",
213
+ "gemini-3.5-flash",
216
214
  "gemini-2.5-pro",
217
- "gemini-2.5-flash-preview",
218
- "gemini-2.5-flash-lite-preview",
215
+ "gemini-2.5-flash",
216
+ "gemini-3.1-flash-lite-preview",
217
+ "gemini-3.1-flash-lite",
219
218
  "gemini-2.5-flash-lite",
219
+ "gemini-2.0-flash",
220
220
  ],
221
221
  "google-vertex": [
222
222
  "gemini-3.1-pro-preview-customtools",
223
223
  "gemini-3.1-pro-preview",
224
- "gemini-3-pro-preview",
224
+ "gemini-3.5-flash",
225
+ "gemini-3-flash-preview",
225
226
  "gemini-2.5-pro",
227
+ "gemini-2.5-flash",
228
+ "gemini-3.1-flash-lite",
226
229
  "gemini-2.5-flash-lite",
227
- "gemini-2.0-flash-lite",
228
230
  ],
229
231
  groq: [
230
232
  "openai/gpt-oss-120b",
231
- "groq/compound-mini",
232
233
  "qwen/qwen3-32b",
233
- "moonshotai/kimi-k2-instruct",
234
- "meta-llama/llama-4-scout",
234
+ "meta-llama/llama-4-scout-17b-16e-instruct",
235
+ "llama-3.3-70b-versatile",
236
+ "openai/gpt-oss-20b",
235
237
  ],
236
238
  huggingface: [
237
239
  "zai-org/GLM-5.1",
@@ -261,16 +263,22 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
261
263
  "devstral-2512",
262
264
  ],
263
265
  openai: [
266
+ "gpt-5.6-sol",
267
+ "gpt-5.6-terra",
268
+ "gpt-5.6-luna",
264
269
  "gpt-5.5-pro",
265
270
  "gpt-5.5",
266
271
  "gpt-5.4-pro",
267
272
  "gpt-5.4",
268
273
  "gpt-5.3-codex",
269
274
  "gpt-5-pro",
275
+ "gpt-5-chat-latest",
270
276
  "gpt-5.2-pro",
271
277
  "gpt-5.2",
272
278
  "gpt-5.2-codex",
273
279
  "gpt-5.1-codex-max",
280
+ "gpt-5.1-codex",
281
+ "gpt-5.1",
274
282
  "gpt-5.1-chat-latest",
275
283
  "o3-pro",
276
284
  "o3-deep-research",
@@ -279,14 +287,13 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
279
287
  "gpt-5-mini",
280
288
  ],
281
289
  "openai-codex": [
290
+ "gpt-5.6-sol",
291
+ "gpt-5.6-terra",
292
+ "gpt-5.6-luna",
282
293
  "gpt-5.5",
283
294
  "gpt-5.4",
284
- "gpt-5.3-codex",
285
- "gpt-5.2",
286
- "gpt-5.1-codex-max",
287
295
  "gpt-5.4-mini",
288
- "gpt-5.1-codex-mini",
289
- "big-pickle",
296
+ "gpt-5.3-codex-spark",
290
297
  ],
291
298
  opencode: [
292
299
  "claude-fable-5",
@@ -301,15 +308,19 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
301
308
  "gpt-5.3-codex",
302
309
  "gpt-5.2-codex",
303
310
  "gpt-5.1-codex",
311
+ "grok-4.5",
312
+ "gemini-3.5-flash",
304
313
  "gemini-3.1-pro",
314
+ "glm-5.2",
305
315
  "glm-5.1",
306
316
  "glm-5",
317
+ "kimi-k2.7-code",
307
318
  "kimi-k2.6",
308
319
  "kimi-k2.5",
309
320
  "qwen3.6-plus",
310
321
  "qwen3.5-plus",
322
+ "minimax-m3",
311
323
  "minimax-m2.7",
312
- "minimax-m2.5-free",
313
324
  ],
314
325
  "opencode-go": [
315
326
  "deepseek-v4-pro",
@@ -319,12 +330,11 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
319
330
  "qwen3.7-plus",
320
331
  "qwen3.6-plus",
321
332
  "mimo-v2.5-pro",
322
- "mimo-v2-pro",
333
+ "mimo-v2.5",
323
334
  "minimax-m3",
324
335
  "minimax-m2.7",
325
336
  "kimi-k2.7-code",
326
337
  "kimi-k2.6",
327
- "kimi-k2.5",
328
338
  ],
329
339
  openrouter: [
330
340
  "anthropic/claude-fable-5",
@@ -332,20 +342,30 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
332
342
  "anthropic/claude-opus-4.8",
333
343
  "anthropic/claude-opus-4.8-fast",
334
344
  "anthropic/claude-opus-4.7",
335
- "anthropic/claude-opus-4.6-fast",
345
+ "anthropic/claude-opus-4.7-fast",
336
346
  "anthropic/claude-opus-4.6",
337
347
  "anthropic/claude-opus-4.5",
338
- "anthropic/claude-opus-4",
348
+ "anthropic/claude-opus-4.1",
349
+ "openai/gpt-5.6-sol-pro",
350
+ "openai/gpt-5.6-sol",
351
+ "openai/gpt-5.6-terra-pro",
352
+ "openai/gpt-5.6-terra",
353
+ "openai/gpt-5.6-luna-pro",
354
+ "openai/gpt-5.6-luna",
339
355
  "openai/gpt-5.5-pro",
340
356
  "openai/gpt-5.5",
341
- "openai/gpt-5.4-pro",
342
- "openai/gpt-5.4",
357
+ "~openai/gpt-latest",
343
358
  "google/gemini-3.1-pro-preview-customtools",
344
359
  "google/gemini-3.1-pro-preview",
360
+ "~google/gemini-pro-latest",
361
+ "google/gemini-3.5-flash",
345
362
  "google/gemini-2.5-pro",
346
363
  "moonshotai/kimi-k2.7-code",
364
+ "~moonshotai/kimi-latest",
347
365
  "moonshotai/kimi-k2.6",
348
366
  "moonshotai/kimi-k2-thinking",
367
+ "x-ai/grok-4.5",
368
+ "~x-ai/grok-latest",
349
369
  "deepseek/deepseek-v4-pro",
350
370
  "deepseek/deepseek-r1",
351
371
  "deepseek/deepseek-v3.2",
@@ -357,6 +377,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
357
377
  ],
358
378
  together: [
359
379
  "deepseek-ai/DeepSeek-V4-Pro",
380
+ "zai-org/GLM-5.2",
360
381
  "zai-org/GLM-5.1",
361
382
  "moonshotai/Kimi-K2.7-Code",
362
383
  "moonshotai/Kimi-K2.6",
@@ -365,12 +386,10 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
365
386
  "MiniMaxAI/MiniMax-M3",
366
387
  "MiniMaxAI/MiniMax-M2.7",
367
388
  "Qwen/Qwen3.5-397B-A17B",
368
- "Qwen/Qwen3-Coder-Next-FP8",
369
- "Qwen/Qwen3-235B-A22B-Instruct-2507-tput",
370
389
  "openai/gpt-oss-120b",
371
- "moonshotai/Kimi-K2.5",
372
- "deepseek-ai/DeepSeek-V3-1",
373
- "MiniMaxAI/MiniMax-M2.5",
390
+ "openai/gpt-oss-20b",
391
+ "nvidia/nemotron-3-ultra-550b-a55b",
392
+ "google/gemma-4-31B-it",
374
393
  ],
375
394
  "vercel-ai-gateway": [
376
395
  "anthropic/claude-fable-5",
@@ -379,13 +398,17 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
379
398
  "anthropic/claude-opus-4.6",
380
399
  "anthropic/claude-opus-4.5",
381
400
  "anthropic/claude-opus-4.1",
382
- "anthropic/claude-sonnet-5.0",
383
401
  "anthropic/claude-sonnet-5",
384
402
  "anthropic/claude-sonnet-4.6",
403
+ "openai/gpt-5.6-sol",
404
+ "openai/gpt-5.6-terra",
405
+ "openai/gpt-5.6-luna",
385
406
  "openai/gpt-5.5-pro",
386
407
  "openai/gpt-5.5",
387
408
  "openai/gpt-5.4-pro",
388
409
  "openai/gpt-5.4",
410
+ "openai/gpt-5.3-codex",
411
+ "openai/gpt-5.2-codex",
389
412
  "openai/gpt-5.1-codex",
390
413
  "openai/gpt-5-codex",
391
414
  "moonshotai/kimi-k2.7-code",
@@ -396,52 +419,37 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
396
419
  "deepseek/deepseek-v3.2-thinking",
397
420
  "alibaba/qwen3.7-max",
398
421
  "alibaba/qwen3.7-plus",
422
+ "alibaba/qwen3.6-plus",
399
423
  "alibaba/qwen3.5-plus",
400
424
  "alibaba/qwen3-max-thinking",
401
425
  "google/gemini-3.1-pro-preview",
426
+ "google/gemini-3.5-flash",
402
427
  "google/gemini-3-flash",
403
- "xai/grok-4.3",
428
+ "xai/grok-4.5",
429
+ "xai/grok-4.20-reasoning",
404
430
  "minimax/minimax-m3",
405
431
  "zai/glm-5.2",
406
432
  "zai/glm-5.1",
407
433
  ],
408
434
  xai: [
409
- "grok-4.3",
435
+ "grok-4.5",
410
436
  "grok-4.20-0309-reasoning",
411
- "grok-4-1-fast",
412
- "grok-4-fast",
413
- "grok-4",
414
- "grok-3-mini-latest",
415
- "grok-3-mini-fast",
416
- "grok-3-latest",
437
+ "grok-4.20-0309-non-reasoning",
438
+ "grok-4.3",
439
+ "grok-build-0.1",
440
+ "grok-code-fast-1",
441
+ "grok-3-fast",
442
+ "grok-3",
417
443
  ],
418
444
  xiaomi: ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro", "mimo-v2-omni", "mimo-v2-flash"],
419
- "xiaomi-token-plan-ams": [
420
- "mimo-v2.5-pro",
421
- "mimo-v2.5",
422
- "mimo-v2-pro",
423
- "mimo-v2-omni",
424
- "mimo-v2-flash",
425
- ],
426
- "xiaomi-token-plan-cn": [
427
- "mimo-v2.5-pro",
428
- "mimo-v2.5",
429
- "mimo-v2-pro",
430
- "mimo-v2-omni",
431
- "mimo-v2-flash",
432
- ],
433
- "xiaomi-token-plan-sgp": [
434
- "mimo-v2.5-pro",
435
- "mimo-v2.5",
436
- "mimo-v2-pro",
437
- "mimo-v2-omni",
438
- "mimo-v2-flash",
439
- ],
445
+ "xiaomi-token-plan-ams": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
446
+ "xiaomi-token-plan-cn": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
447
+ "xiaomi-token-plan-sgp": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
440
448
  nvidia: [
441
449
  "nvidia/nemotron-3-ultra-550b-a55b",
442
450
  "nvidia/nemotron-3-super-120b-a12b",
443
451
  "moonshotai/kimi-k2.6",
444
- "z-ai/glm-5.1",
452
+ "z-ai/glm-5.2",
445
453
  "qwen/qwen3.5-122b-a10b",
446
454
  "openai/gpt-oss-120b",
447
455
  "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",
@@ -452,11 +460,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
452
460
  "glm-5.1",
453
461
  "glm-5-turbo",
454
462
  "glm-5v-turbo",
455
- "glm-5",
456
463
  "glm-4.7",
457
- "glm-4.7-flash",
458
- "glm-4.6v",
459
- "glm-4.5v",
460
464
  "glm-4.5-air",
461
465
  ],
462
466
  "zai-coding-cn": [
@@ -544,7 +548,7 @@ function normalizeModelPreference(value: unknown): string | undefined {
544
548
  function parseModelPreference(value: unknown): { model?: string; thinkingLevel?: ThinkingLevel } {
545
549
  const model = normalizeModelPreference(value);
546
550
  if (!model) return {};
547
- const match = model.match(/^(.*):(off|minimal|low|medium|high|xhigh)$/i);
551
+ const match = model.match(/^(.*):(off|minimal|low|medium|high|xhigh|max)$/i);
548
552
  if (!match?.[1]) return { model };
549
553
  return { model: match[1], thinkingLevel: parseThinkingLevel(match[2]) };
550
554
  }
@@ -768,7 +772,7 @@ function getPiInvocation(args: string[]): { command: string; args: string[] } {
768
772
  }
769
773
 
770
774
  function withThinking(modelRef: string, thinkingLevel: ThinkingLevel): string {
771
- if (/(?:^|\/)[^:]+:(off|minimal|low|medium|high|xhigh)$/i.test(modelRef)) return modelRef;
775
+ if (/(?:^|\/)[^:]+:(off|minimal|low|medium|high|xhigh|max)$/i.test(modelRef)) return modelRef;
772
776
  return `${modelRef}:${thinkingLevel}`;
773
777
  }
774
778
 
@@ -777,8 +781,8 @@ function isThinkingLevelSupported(model: PiModel, level: ThinkingLevel): boolean
777
781
  if (!model.reasoning) return level === "off";
778
782
 
779
783
  const map = model.thinkingLevelMap;
780
- if (level === "xhigh") {
781
- return !!map && Object.prototype.hasOwnProperty.call(map, "xhigh") && map.xhigh != null;
784
+ if (level === "xhigh" || level === "max") {
785
+ return !!map && Object.prototype.hasOwnProperty.call(map, level) && map[level] != null;
782
786
  }
783
787
  return map?.[level] !== null;
784
788
  }
@@ -1328,7 +1332,7 @@ export default function contrarianExtension(pi: ExtensionAPI) {
1328
1332
  return;
1329
1333
  }
1330
1334
 
1331
- notifyCommand(ctx, "Usage: /contrarian status | model <provider/model|auto> | thinking <off|minimal|low|medium|high|xhigh|auto> | clear [all|model|thinking]", "warning");
1335
+ notifyCommand(ctx, "Usage: /contrarian status | model <provider/model|auto> | thinking <off|minimal|low|medium|high|xhigh|max|auto> | clear [all|model|thinking]", "warning");
1332
1336
  },
1333
1337
  });
1334
1338
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-contrarian",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A read-only contrarian subagent extension for pi that stress-tests plans, designs, assumptions, and conclusions.",
5
5
  "keywords": [
6
6
  "pi-package",