@diegopetrucci/pi-contrarian 0.1.2 → 0.1.5
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/.pi-fleet-tested-version +1 -1
- package/index.ts +115 -96
- package/package.json +5 -1
package/.pi-fleet-tested-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.80.
|
|
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", "
|
|
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-
|
|
205
|
-
"
|
|
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-
|
|
213
|
+
"gemini-3.5-flash",
|
|
216
214
|
"gemini-2.5-pro",
|
|
217
|
-
"gemini-2.5-flash
|
|
218
|
-
"gemini-
|
|
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-
|
|
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
|
-
"
|
|
234
|
-
"
|
|
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",
|
|
@@ -245,7 +247,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
245
247
|
"MiniMaxAI/MiniMax-M2.5",
|
|
246
248
|
"Qwen/Qwen3-Coder-Next",
|
|
247
249
|
],
|
|
248
|
-
"kimi-coding": ["
|
|
250
|
+
"kimi-coding": ["k3", "kimi-for-coding", "kimi-for-coding-highspeed"],
|
|
249
251
|
minimax: ["MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7"],
|
|
250
252
|
"minimax-cn": ["MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7"],
|
|
251
253
|
mistral: [
|
|
@@ -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.
|
|
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
|
|
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.
|
|
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-
|
|
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",
|
|
@@ -355,22 +375,39 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
355
375
|
"z-ai/glm-5.2",
|
|
356
376
|
"z-ai/glm-5.1",
|
|
357
377
|
],
|
|
378
|
+
"qwen-token-plan": [
|
|
379
|
+
"qwen3.8-max-preview",
|
|
380
|
+
"qwen3.7-max",
|
|
381
|
+
"qwen3.7-plus",
|
|
382
|
+
"qwen3.6-plus",
|
|
383
|
+
"deepseek-v4-pro",
|
|
384
|
+
"glm-5.2",
|
|
385
|
+
"kimi-k2.7-code",
|
|
386
|
+
"minimax-m2.5",
|
|
387
|
+
],
|
|
388
|
+
"qwen-token-plan-cn": [
|
|
389
|
+
"qwen3.8-max-preview",
|
|
390
|
+
"qwen3.7-max",
|
|
391
|
+
"qwen3.7-plus",
|
|
392
|
+
"qwen3.6-plus",
|
|
393
|
+
"deepseek-v4-pro",
|
|
394
|
+
"glm-5.2",
|
|
395
|
+
"kimi-k2.7-code",
|
|
396
|
+
"minimax-m2.5",
|
|
397
|
+
],
|
|
358
398
|
together: [
|
|
359
399
|
"deepseek-ai/DeepSeek-V4-Pro",
|
|
360
|
-
"zai-org/GLM-5.
|
|
400
|
+
"zai-org/GLM-5.2",
|
|
361
401
|
"moonshotai/Kimi-K2.7-Code",
|
|
362
402
|
"moonshotai/Kimi-K2.6",
|
|
363
403
|
"Qwen/Qwen3.7-Max",
|
|
364
404
|
"Qwen/Qwen3.6-Plus",
|
|
365
405
|
"MiniMaxAI/MiniMax-M3",
|
|
366
406
|
"MiniMaxAI/MiniMax-M2.7",
|
|
367
|
-
"Qwen/Qwen3.5-397B-A17B",
|
|
368
|
-
"Qwen/Qwen3-Coder-Next-FP8",
|
|
369
|
-
"Qwen/Qwen3-235B-A22B-Instruct-2507-tput",
|
|
370
407
|
"openai/gpt-oss-120b",
|
|
371
|
-
"
|
|
372
|
-
"
|
|
373
|
-
"
|
|
408
|
+
"openai/gpt-oss-20b",
|
|
409
|
+
"nvidia/nemotron-3-ultra-550b-a55b",
|
|
410
|
+
"google/gemma-4-31B-it",
|
|
374
411
|
],
|
|
375
412
|
"vercel-ai-gateway": [
|
|
376
413
|
"anthropic/claude-fable-5",
|
|
@@ -379,13 +416,17 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
379
416
|
"anthropic/claude-opus-4.6",
|
|
380
417
|
"anthropic/claude-opus-4.5",
|
|
381
418
|
"anthropic/claude-opus-4.1",
|
|
382
|
-
"anthropic/claude-sonnet-5.0",
|
|
383
419
|
"anthropic/claude-sonnet-5",
|
|
384
420
|
"anthropic/claude-sonnet-4.6",
|
|
421
|
+
"openai/gpt-5.6-sol",
|
|
422
|
+
"openai/gpt-5.6-terra",
|
|
423
|
+
"openai/gpt-5.6-luna",
|
|
385
424
|
"openai/gpt-5.5-pro",
|
|
386
425
|
"openai/gpt-5.5",
|
|
387
426
|
"openai/gpt-5.4-pro",
|
|
388
427
|
"openai/gpt-5.4",
|
|
428
|
+
"openai/gpt-5.3-codex",
|
|
429
|
+
"openai/gpt-5.2-codex",
|
|
389
430
|
"openai/gpt-5.1-codex",
|
|
390
431
|
"openai/gpt-5-codex",
|
|
391
432
|
"moonshotai/kimi-k2.7-code",
|
|
@@ -396,53 +437,34 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
396
437
|
"deepseek/deepseek-v3.2-thinking",
|
|
397
438
|
"alibaba/qwen3.7-max",
|
|
398
439
|
"alibaba/qwen3.7-plus",
|
|
440
|
+
"alibaba/qwen3.6-plus",
|
|
399
441
|
"alibaba/qwen3.5-plus",
|
|
400
442
|
"alibaba/qwen3-max-thinking",
|
|
401
443
|
"google/gemini-3.1-pro-preview",
|
|
444
|
+
"google/gemini-3.5-flash",
|
|
402
445
|
"google/gemini-3-flash",
|
|
403
|
-
"xai/grok-4.
|
|
446
|
+
"xai/grok-4.5",
|
|
447
|
+
"xai/grok-4.20-reasoning",
|
|
404
448
|
"minimax/minimax-m3",
|
|
405
449
|
"zai/glm-5.2",
|
|
406
450
|
"zai/glm-5.1",
|
|
407
451
|
],
|
|
408
452
|
xai: [
|
|
453
|
+
"grok-4.5",
|
|
409
454
|
"grok-4.3",
|
|
410
|
-
"grok-
|
|
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",
|
|
455
|
+
"grok-build-0.1",
|
|
417
456
|
],
|
|
418
457
|
xiaomi: ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro", "mimo-v2-omni", "mimo-v2-flash"],
|
|
419
|
-
"xiaomi-token-plan-ams": [
|
|
420
|
-
|
|
421
|
-
|
|
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
|
-
],
|
|
458
|
+
"xiaomi-token-plan-ams": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
|
|
459
|
+
"xiaomi-token-plan-cn": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
|
|
460
|
+
"xiaomi-token-plan-sgp": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
|
|
440
461
|
nvidia: [
|
|
441
462
|
"nvidia/nemotron-3-ultra-550b-a55b",
|
|
442
463
|
"nvidia/nemotron-3-super-120b-a12b",
|
|
443
464
|
"moonshotai/kimi-k2.6",
|
|
444
|
-
"z-ai/glm-5.
|
|
445
|
-
"
|
|
465
|
+
"z-ai/glm-5.2",
|
|
466
|
+
"minimaxai/minimax-m3",
|
|
467
|
+
"mistralai/mistral-large-3-675b-instruct-2512",
|
|
446
468
|
"openai/gpt-oss-120b",
|
|
447
469
|
"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",
|
|
448
470
|
"nvidia/nemotron-3-nano-30b-a3b",
|
|
@@ -452,11 +474,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
452
474
|
"glm-5.1",
|
|
453
475
|
"glm-5-turbo",
|
|
454
476
|
"glm-5v-turbo",
|
|
455
|
-
"glm-5",
|
|
456
477
|
"glm-4.7",
|
|
457
|
-
"glm-4.7-flash",
|
|
458
|
-
"glm-4.6v",
|
|
459
|
-
"glm-4.5v",
|
|
460
478
|
"glm-4.5-air",
|
|
461
479
|
],
|
|
462
480
|
"zai-coding-cn": [
|
|
@@ -544,7 +562,7 @@ function normalizeModelPreference(value: unknown): string | undefined {
|
|
|
544
562
|
function parseModelPreference(value: unknown): { model?: string; thinkingLevel?: ThinkingLevel } {
|
|
545
563
|
const model = normalizeModelPreference(value);
|
|
546
564
|
if (!model) return {};
|
|
547
|
-
const match = model.match(/^(.*):(off|minimal|low|medium|high|xhigh)$/i);
|
|
565
|
+
const match = model.match(/^(.*):(off|minimal|low|medium|high|xhigh|max)$/i);
|
|
548
566
|
if (!match?.[1]) return { model };
|
|
549
567
|
return { model: match[1], thinkingLevel: parseThinkingLevel(match[2]) };
|
|
550
568
|
}
|
|
@@ -768,7 +786,7 @@ function getPiInvocation(args: string[]): { command: string; args: string[] } {
|
|
|
768
786
|
}
|
|
769
787
|
|
|
770
788
|
function withThinking(modelRef: string, thinkingLevel: ThinkingLevel): string {
|
|
771
|
-
if (/(?:^|\/)[^:]+:(off|minimal|low|medium|high|xhigh)$/i.test(modelRef)) return modelRef;
|
|
789
|
+
if (/(?:^|\/)[^:]+:(off|minimal|low|medium|high|xhigh|max)$/i.test(modelRef)) return modelRef;
|
|
772
790
|
return `${modelRef}:${thinkingLevel}`;
|
|
773
791
|
}
|
|
774
792
|
|
|
@@ -777,8 +795,8 @@ function isThinkingLevelSupported(model: PiModel, level: ThinkingLevel): boolean
|
|
|
777
795
|
if (!model.reasoning) return level === "off";
|
|
778
796
|
|
|
779
797
|
const map = model.thinkingLevelMap;
|
|
780
|
-
if (level === "xhigh") {
|
|
781
|
-
return !!map && Object.prototype.hasOwnProperty.call(map,
|
|
798
|
+
if (level === "xhigh" || level === "max") {
|
|
799
|
+
return !!map && Object.prototype.hasOwnProperty.call(map, level) && map[level] != null;
|
|
782
800
|
}
|
|
783
801
|
return map?.[level] !== null;
|
|
784
802
|
}
|
|
@@ -1207,6 +1225,7 @@ function renderCollapsedText(text: string, lineLimit = COLLAPSED_LINE_LIMIT): st
|
|
|
1207
1225
|
|
|
1208
1226
|
export const __test__ = {
|
|
1209
1227
|
findAvailableModel,
|
|
1228
|
+
isModelAvailabilityError,
|
|
1210
1229
|
parseModelPreference,
|
|
1211
1230
|
resolveThinkingLevel,
|
|
1212
1231
|
selectContrarianModel,
|
|
@@ -1328,7 +1347,7 @@ export default function contrarianExtension(pi: ExtensionAPI) {
|
|
|
1328
1347
|
return;
|
|
1329
1348
|
}
|
|
1330
1349
|
|
|
1331
|
-
notifyCommand(ctx, "Usage: /contrarian status | model <provider/model|auto> | thinking <off|minimal|low|medium|high|xhigh|auto> | clear [all|model|thinking]", "warning");
|
|
1350
|
+
notifyCommand(ctx, "Usage: /contrarian status | model <provider/model|auto> | thinking <off|minimal|low|medium|high|xhigh|max|auto> | clear [all|model|thinking]", "warning");
|
|
1332
1351
|
},
|
|
1333
1352
|
});
|
|
1334
1353
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegopetrucci/pi-contrarian",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
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",
|
|
@@ -33,5 +33,9 @@
|
|
|
33
33
|
"@earendil-works/pi-coding-agent": "*",
|
|
34
34
|
"@earendil-works/pi-tui": "*",
|
|
35
35
|
"typebox": "*"
|
|
36
|
+
},
|
|
37
|
+
"type": "module",
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=22.19.0"
|
|
36
40
|
}
|
|
37
41
|
}
|