@diegopetrucci/pi-oracle 0.1.16 → 0.1.20

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.79.10
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,7 +67,7 @@ interface OraclePreferences {
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 = "xhigh";
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 ORACLE_STATUS_ID = "oracle";
73
73
  const ORACLE_WIDGET_ID = "oracle";
@@ -82,6 +82,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
82
82
  "claude-opus-4-5",
83
83
  "claude-opus-4-1",
84
84
  "claude-opus-4",
85
+ "claude-sonnet-5",
85
86
  "claude-sonnet-4-6",
86
87
  "claude-sonnet-4-5",
87
88
  "claude-sonnet-4",
@@ -95,37 +96,32 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
95
96
  anthropic: [
96
97
  "claude-fable-5",
97
98
  "claude-opus-4-8",
98
- "claude-opus-4.8",
99
99
  "claude-opus-4-7",
100
- "claude-opus-4.7",
101
100
  "claude-opus-4-6",
102
- "claude-opus-4.6",
103
101
  "claude-opus-4-5",
104
- "claude-opus-4.5",
105
102
  "claude-opus-4-1",
106
- "claude-opus-4.1",
107
- "claude-opus-4-0",
108
- "claude-opus-4",
103
+ "claude-sonnet-5",
109
104
  "claude-sonnet-4-6",
110
- "claude-sonnet-4.6",
111
105
  "claude-sonnet-4-5",
112
- "claude-sonnet-4.5",
113
- "claude-sonnet-4-0",
114
- "claude-sonnet-4",
115
- "claude-3-7-sonnet",
116
106
  ],
117
107
  "ant-ling": ["Ling-2.6-1T", "Ling-2.6-flash"],
118
108
  "azure-openai-responses": [
109
+ "gpt-5.6-sol",
110
+ "gpt-5.6-terra",
111
+ "gpt-5.6-luna",
119
112
  "gpt-5.5-pro",
120
113
  "gpt-5.5",
121
114
  "gpt-5.4-pro",
122
115
  "gpt-5.4",
123
116
  "gpt-5.3-codex",
124
117
  "gpt-5-pro",
118
+ "gpt-5-chat-latest",
125
119
  "gpt-5.2-pro",
126
120
  "gpt-5.2",
127
121
  "gpt-5.2-codex",
128
122
  "gpt-5.1-codex-max",
123
+ "gpt-5.1-codex",
124
+ "gpt-5.1",
129
125
  "gpt-5.1-chat-latest",
130
126
  "o3-pro",
131
127
  "o3-deep-research",
@@ -133,7 +129,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
133
129
  "gpt-5.4-mini",
134
130
  "gpt-5-mini",
135
131
  ],
136
- cerebras: ["gpt-oss-120b", "zai-glm-4.7", "llama3.1-8b"],
132
+ cerebras: ["gpt-oss-120b", "zai-glm-4.7", "gemma-4-31b"],
137
133
  "cloudflare-ai-gateway": [
138
134
  "claude-fable-5",
139
135
  "claude-opus-4-7",
@@ -151,8 +147,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
151
147
  "@cf/zai-org/glm-5.2",
152
148
  "@cf/moonshotai/kimi-k2.6",
153
149
  "@cf/nvidia/nemotron-3-120b-a12b",
154
- "@cf/moonshotai/kimi-k2.5",
155
150
  "@cf/openai/gpt-oss-120b",
151
+ "@cf/qwen/qwen3-30b-a3b-fp8",
156
152
  "@cf/zai-org/glm-4.7-flash",
157
153
  ],
158
154
  deepseek: ["deepseek-v4-pro", "deepseek-v4-flash"],
@@ -161,13 +157,17 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
161
157
  "accounts/fireworks/models/kimi-k2p7-code",
162
158
  "accounts/fireworks/routers/kimi-k2p7-code-fast",
163
159
  "accounts/fireworks/models/glm-5p2",
160
+ "accounts/fireworks/routers/glm-5p2-fast",
164
161
  "accounts/fireworks/models/minimax-m3",
165
162
  "accounts/fireworks/models/glm-5p1",
163
+ "accounts/fireworks/routers/glm-5p1-fast",
166
164
  "accounts/fireworks/models/kimi-k2p6",
165
+ "accounts/fireworks/routers/kimi-k2p6-turbo",
166
+ "accounts/fireworks/routers/kimi-k2p6-fast",
167
167
  "accounts/fireworks/models/minimax-m2p7",
168
168
  "accounts/fireworks/models/qwen3p7-plus",
169
- "accounts/fireworks/models/qwen3p6-plus",
170
169
  "accounts/fireworks/models/gpt-oss-120b",
170
+ "accounts/fireworks/models/gpt-oss-20b",
171
171
  ],
172
172
  "github-copilot": [
173
173
  "claude-fable-5",
@@ -178,40 +178,46 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
178
178
  "gpt-5.5",
179
179
  "gpt-5.4",
180
180
  "gpt-5.3-codex",
181
+ "gpt-5.2-codex",
181
182
  "gpt-5.2",
182
- "gpt-5.1-codex-max",
183
- "gpt-5.1",
184
- "gpt-5",
185
183
  "gemini-3.1-pro-preview",
186
- "gemini-3-pro-preview",
184
+ "gemini-3.5-flash",
185
+ "gemini-3-flash-preview",
186
+ "claude-sonnet-5",
187
187
  "claude-sonnet-4.6",
188
188
  "claude-sonnet-4.5",
189
189
  "gemini-2.5-pro",
190
+ "gpt-5-mini",
191
+ "kimi-k2.7-code",
190
192
  ],
191
193
  google: [
192
194
  "gemini-3.1-pro-preview-customtools",
193
195
  "gemini-3.1-pro-preview",
194
196
  "gemini-3-pro-preview",
195
- "gemini-2.5-pro-preview",
197
+ "gemini-3.5-flash",
196
198
  "gemini-2.5-pro",
197
- "gemini-2.5-flash-preview",
198
- "gemini-2.5-flash-lite-preview",
199
+ "gemini-2.5-flash",
200
+ "gemini-3.1-flash-lite-preview",
201
+ "gemini-3.1-flash-lite",
199
202
  "gemini-2.5-flash-lite",
203
+ "gemini-2.0-flash",
200
204
  ],
201
205
  "google-vertex": [
202
206
  "gemini-3.1-pro-preview-customtools",
203
207
  "gemini-3.1-pro-preview",
204
- "gemini-3-pro-preview",
208
+ "gemini-3.5-flash",
209
+ "gemini-3-flash-preview",
205
210
  "gemini-2.5-pro",
211
+ "gemini-2.5-flash",
212
+ "gemini-3.1-flash-lite",
206
213
  "gemini-2.5-flash-lite",
207
- "gemini-2.0-flash-lite",
208
214
  ],
209
215
  groq: [
210
216
  "openai/gpt-oss-120b",
211
- "groq/compound-mini",
212
217
  "qwen/qwen3-32b",
213
- "moonshotai/kimi-k2-instruct",
214
- "meta-llama/llama-4-scout",
218
+ "meta-llama/llama-4-scout-17b-16e-instruct",
219
+ "llama-3.3-70b-versatile",
220
+ "openai/gpt-oss-20b",
215
221
  ],
216
222
  huggingface: [
217
223
  "zai-org/GLM-5.1",
@@ -225,7 +231,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
225
231
  "MiniMaxAI/MiniMax-M2.5",
226
232
  "Qwen/Qwen3-Coder-Next",
227
233
  ],
228
- "kimi-coding": ["k2p7", "kimi-k2-thinking", "kimi-for-coding"],
234
+ "kimi-coding": ["k3", "kimi-for-coding", "kimi-for-coding-highspeed"],
229
235
  minimax: ["MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7"],
230
236
  "minimax-cn": ["MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7"],
231
237
  mistral: [
@@ -241,16 +247,22 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
241
247
  "devstral-2512",
242
248
  ],
243
249
  openai: [
250
+ "gpt-5.6-sol",
251
+ "gpt-5.6-terra",
252
+ "gpt-5.6-luna",
244
253
  "gpt-5.5-pro",
245
254
  "gpt-5.5",
246
255
  "gpt-5.4-pro",
247
256
  "gpt-5.4",
248
257
  "gpt-5.3-codex",
249
258
  "gpt-5-pro",
259
+ "gpt-5-chat-latest",
250
260
  "gpt-5.2-pro",
251
261
  "gpt-5.2",
252
262
  "gpt-5.2-codex",
253
263
  "gpt-5.1-codex-max",
264
+ "gpt-5.1-codex",
265
+ "gpt-5.1",
254
266
  "gpt-5.1-chat-latest",
255
267
  "o3-pro",
256
268
  "o3-deep-research",
@@ -259,14 +271,13 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
259
271
  "gpt-5-mini",
260
272
  ],
261
273
  "openai-codex": [
274
+ "gpt-5.6-sol",
275
+ "gpt-5.6-terra",
276
+ "gpt-5.6-luna",
262
277
  "gpt-5.5",
263
278
  "gpt-5.4",
264
- "gpt-5.3-codex",
265
- "gpt-5.2",
266
- "gpt-5.1-codex-max",
267
279
  "gpt-5.4-mini",
268
- "gpt-5.1-codex-mini",
269
- "big-pickle",
280
+ "gpt-5.3-codex-spark",
270
281
  ],
271
282
  opencode: [
272
283
  "claude-fable-5",
@@ -281,15 +292,19 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
281
292
  "gpt-5.3-codex",
282
293
  "gpt-5.2-codex",
283
294
  "gpt-5.1-codex",
295
+ "grok-4.5",
296
+ "gemini-3.5-flash",
284
297
  "gemini-3.1-pro",
298
+ "glm-5.2",
285
299
  "glm-5.1",
286
300
  "glm-5",
301
+ "kimi-k2.7-code",
287
302
  "kimi-k2.6",
288
303
  "kimi-k2.5",
289
304
  "qwen3.6-plus",
290
305
  "qwen3.5-plus",
306
+ "minimax-m3",
291
307
  "minimax-m2.7",
292
- "minimax-m2.5-free",
293
308
  ],
294
309
  "opencode-go": [
295
310
  "deepseek-v4-pro",
@@ -299,12 +314,11 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
299
314
  "qwen3.7-plus",
300
315
  "qwen3.6-plus",
301
316
  "mimo-v2.5-pro",
302
- "mimo-v2-pro",
317
+ "mimo-v2.5",
303
318
  "minimax-m3",
304
319
  "minimax-m2.7",
305
320
  "kimi-k2.7-code",
306
321
  "kimi-k2.6",
307
- "kimi-k2.5",
308
322
  ],
309
323
  openrouter: [
310
324
  "anthropic/claude-fable-5",
@@ -312,20 +326,30 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
312
326
  "anthropic/claude-opus-4.8",
313
327
  "anthropic/claude-opus-4.8-fast",
314
328
  "anthropic/claude-opus-4.7",
315
- "anthropic/claude-opus-4.6-fast",
329
+ "anthropic/claude-opus-4.7-fast",
316
330
  "anthropic/claude-opus-4.6",
317
331
  "anthropic/claude-opus-4.5",
318
- "anthropic/claude-opus-4",
332
+ "anthropic/claude-opus-4.1",
333
+ "openai/gpt-5.6-sol-pro",
334
+ "openai/gpt-5.6-sol",
335
+ "openai/gpt-5.6-terra-pro",
336
+ "openai/gpt-5.6-terra",
337
+ "openai/gpt-5.6-luna-pro",
338
+ "openai/gpt-5.6-luna",
319
339
  "openai/gpt-5.5-pro",
320
340
  "openai/gpt-5.5",
321
- "openai/gpt-5.4-pro",
322
- "openai/gpt-5.4",
341
+ "~openai/gpt-latest",
323
342
  "google/gemini-3.1-pro-preview-customtools",
324
343
  "google/gemini-3.1-pro-preview",
344
+ "~google/gemini-pro-latest",
345
+ "google/gemini-3.5-flash",
325
346
  "google/gemini-2.5-pro",
326
347
  "moonshotai/kimi-k2.7-code",
348
+ "~moonshotai/kimi-latest",
327
349
  "moonshotai/kimi-k2.6",
328
350
  "moonshotai/kimi-k2-thinking",
351
+ "x-ai/grok-4.5",
352
+ "~x-ai/grok-latest",
329
353
  "deepseek/deepseek-v4-pro",
330
354
  "deepseek/deepseek-r1",
331
355
  "deepseek/deepseek-v3.2",
@@ -335,22 +359,39 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
335
359
  "z-ai/glm-5.2",
336
360
  "z-ai/glm-5.1",
337
361
  ],
362
+ "qwen-token-plan": [
363
+ "qwen3.8-max-preview",
364
+ "qwen3.7-max",
365
+ "qwen3.7-plus",
366
+ "qwen3.6-plus",
367
+ "deepseek-v4-pro",
368
+ "glm-5.2",
369
+ "kimi-k2.7-code",
370
+ "minimax-m2.5",
371
+ ],
372
+ "qwen-token-plan-cn": [
373
+ "qwen3.8-max-preview",
374
+ "qwen3.7-max",
375
+ "qwen3.7-plus",
376
+ "qwen3.6-plus",
377
+ "deepseek-v4-pro",
378
+ "glm-5.2",
379
+ "kimi-k2.7-code",
380
+ "minimax-m2.5",
381
+ ],
338
382
  together: [
339
383
  "deepseek-ai/DeepSeek-V4-Pro",
340
- "zai-org/GLM-5.1",
384
+ "zai-org/GLM-5.2",
341
385
  "moonshotai/Kimi-K2.7-Code",
342
386
  "moonshotai/Kimi-K2.6",
343
387
  "Qwen/Qwen3.7-Max",
344
388
  "Qwen/Qwen3.6-Plus",
345
389
  "MiniMaxAI/MiniMax-M3",
346
390
  "MiniMaxAI/MiniMax-M2.7",
347
- "Qwen/Qwen3.5-397B-A17B",
348
- "Qwen/Qwen3-Coder-Next-FP8",
349
- "Qwen/Qwen3-235B-A22B-Instruct-2507-tput",
350
391
  "openai/gpt-oss-120b",
351
- "moonshotai/Kimi-K2.5",
352
- "deepseek-ai/DeepSeek-V3-1",
353
- "MiniMaxAI/MiniMax-M2.5",
392
+ "openai/gpt-oss-20b",
393
+ "nvidia/nemotron-3-ultra-550b-a55b",
394
+ "google/gemma-4-31B-it",
354
395
  ],
355
396
  "vercel-ai-gateway": [
356
397
  "anthropic/claude-fable-5",
@@ -359,11 +400,17 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
359
400
  "anthropic/claude-opus-4.6",
360
401
  "anthropic/claude-opus-4.5",
361
402
  "anthropic/claude-opus-4.1",
403
+ "anthropic/claude-sonnet-5",
362
404
  "anthropic/claude-sonnet-4.6",
405
+ "openai/gpt-5.6-sol",
406
+ "openai/gpt-5.6-terra",
407
+ "openai/gpt-5.6-luna",
363
408
  "openai/gpt-5.5-pro",
364
409
  "openai/gpt-5.5",
365
410
  "openai/gpt-5.4-pro",
366
411
  "openai/gpt-5.4",
412
+ "openai/gpt-5.3-codex",
413
+ "openai/gpt-5.2-codex",
367
414
  "openai/gpt-5.1-codex",
368
415
  "openai/gpt-5-codex",
369
416
  "moonshotai/kimi-k2.7-code",
@@ -374,53 +421,34 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
374
421
  "deepseek/deepseek-v3.2-thinking",
375
422
  "alibaba/qwen3.7-max",
376
423
  "alibaba/qwen3.7-plus",
424
+ "alibaba/qwen3.6-plus",
377
425
  "alibaba/qwen3.5-plus",
378
426
  "alibaba/qwen3-max-thinking",
379
427
  "google/gemini-3.1-pro-preview",
428
+ "google/gemini-3.5-flash",
380
429
  "google/gemini-3-flash",
381
- "xai/grok-4.3",
430
+ "xai/grok-4.5",
431
+ "xai/grok-4.20-reasoning",
382
432
  "minimax/minimax-m3",
383
433
  "zai/glm-5.2",
384
434
  "zai/glm-5.1",
385
435
  ],
386
436
  xai: [
437
+ "grok-4.5",
387
438
  "grok-4.3",
388
- "grok-4.20-0309-reasoning",
389
- "grok-4-1-fast",
390
- "grok-4-fast",
391
- "grok-4",
392
- "grok-3-mini-latest",
393
- "grok-3-mini-fast",
394
- "grok-3-latest",
439
+ "grok-build-0.1",
395
440
  ],
396
441
  xiaomi: ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro", "mimo-v2-omni", "mimo-v2-flash"],
397
- "xiaomi-token-plan-ams": [
398
- "mimo-v2.5-pro",
399
- "mimo-v2.5",
400
- "mimo-v2-pro",
401
- "mimo-v2-omni",
402
- "mimo-v2-flash",
403
- ],
404
- "xiaomi-token-plan-cn": [
405
- "mimo-v2.5-pro",
406
- "mimo-v2.5",
407
- "mimo-v2-pro",
408
- "mimo-v2-omni",
409
- "mimo-v2-flash",
410
- ],
411
- "xiaomi-token-plan-sgp": [
412
- "mimo-v2.5-pro",
413
- "mimo-v2.5",
414
- "mimo-v2-pro",
415
- "mimo-v2-omni",
416
- "mimo-v2-flash",
417
- ],
442
+ "xiaomi-token-plan-ams": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
443
+ "xiaomi-token-plan-cn": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
444
+ "xiaomi-token-plan-sgp": ["mimo-v2.5-pro", "mimo-v2.5", "mimo-v2-pro"],
418
445
  nvidia: [
419
446
  "nvidia/nemotron-3-ultra-550b-a55b",
420
447
  "nvidia/nemotron-3-super-120b-a12b",
421
448
  "moonshotai/kimi-k2.6",
422
- "z-ai/glm-5.1",
423
- "qwen/qwen3.5-122b-a10b",
449
+ "z-ai/glm-5.2",
450
+ "minimaxai/minimax-m3",
451
+ "mistralai/mistral-large-3-675b-instruct-2512",
424
452
  "openai/gpt-oss-120b",
425
453
  "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",
426
454
  "nvidia/nemotron-3-nano-30b-a3b",
@@ -430,11 +458,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
430
458
  "glm-5.1",
431
459
  "glm-5-turbo",
432
460
  "glm-5v-turbo",
433
- "glm-5",
434
461
  "glm-4.7",
435
- "glm-4.7-flash",
436
- "glm-4.6v",
437
- "glm-4.5v",
438
462
  "glm-4.5-air",
439
463
  ],
440
464
  "zai-coding-cn": [
@@ -516,7 +540,7 @@ function normalizeModelPreference(value: unknown): string | undefined {
516
540
  function parseModelPreference(value: unknown): { model?: string; thinkingLevel?: ThinkingLevel } {
517
541
  const model = normalizeModelPreference(value);
518
542
  if (!model) return {};
519
- const match = model.match(/^(.*):(off|minimal|low|medium|high|xhigh)$/i);
543
+ const match = model.match(/^(.*):(off|minimal|low|medium|high|xhigh|max)$/i);
520
544
  if (!match?.[1]) return { model };
521
545
  return { model: match[1], thinkingLevel: parseThinkingLevel(match[2]) };
522
546
  }
@@ -713,7 +737,7 @@ function getPiInvocation(args: string[]): { command: string; args: string[] } {
713
737
  }
714
738
 
715
739
  function withThinking(modelRef: string, thinkingLevel: ThinkingLevel): string {
716
- if (/(?:^|\/)[^:]+:(off|minimal|low|medium|high|xhigh)$/i.test(modelRef)) return modelRef;
740
+ if (/(?:^|\/)[^:]+:(off|minimal|low|medium|high|xhigh|max)$/i.test(modelRef)) return modelRef;
717
741
  return `${modelRef}:${thinkingLevel}`;
718
742
  }
719
743
 
@@ -722,8 +746,8 @@ function isThinkingLevelSupported(model: PiModel, level: ThinkingLevel): boolean
722
746
  if (!model.reasoning) return level === "off";
723
747
 
724
748
  const map = model.thinkingLevelMap;
725
- if (level === "xhigh") {
726
- return !!map && Object.prototype.hasOwnProperty.call(map, "xhigh") && map.xhigh != null;
749
+ if (level === "xhigh" || level === "max") {
750
+ return !!map && Object.prototype.hasOwnProperty.call(map, level) && map[level] != null;
727
751
  }
728
752
  return map?.[level] !== null;
729
753
  }
@@ -744,11 +768,16 @@ function clampThinkingLevel(model: PiModel, requested: ThinkingLevel): ThinkingL
744
768
  return "off";
745
769
  }
746
770
 
771
+ function isGpt56SolModel(model: PiModel | undefined): boolean {
772
+ if (!model) return false;
773
+ return /\bgpt-5\.6-sol\b/i.test(`${model.id} ${model.name ?? ""}`);
774
+ }
775
+
747
776
  function resolveThinkingLevel(
748
777
  model: PiModel | undefined,
749
778
  override: ThinkingLevel | undefined,
750
779
  ): { requested: ThinkingLevel; effective: ThinkingLevel; clamped: boolean } {
751
- const requested = override ?? (model?.reasoning ? DEFAULT_THINKING_LEVEL : "off");
780
+ const requested = override ?? (model?.reasoning ? (isGpt56SolModel(model) ? "high" : DEFAULT_THINKING_LEVEL) : "off");
752
781
  const effective = model ? clampThinkingLevel(model, requested) : requested;
753
782
  return { requested, effective, clamped: effective !== requested };
754
783
  }
@@ -1108,6 +1137,14 @@ function renderCollapsedText(text: string, lineLimit = COLLAPSED_LINE_LIMIT): st
1108
1137
  return [...lines.slice(0, lineLimit), `... (${lines.length - lineLimit} more lines)`].join("\n");
1109
1138
  }
1110
1139
 
1140
+ export const __test__ = {
1141
+ findAvailableModel,
1142
+ isModelAvailabilityError,
1143
+ parseModelPreference,
1144
+ resolveThinkingLevel,
1145
+ selectOracleModel,
1146
+ };
1147
+
1111
1148
  export default function oracleExtension(pi: ExtensionAPI) {
1112
1149
  const activeRuns = new Map<string, OracleUiRun>();
1113
1150
  let preferences: OraclePreferences = {};
@@ -1224,7 +1261,7 @@ export default function oracleExtension(pi: ExtensionAPI) {
1224
1261
  return;
1225
1262
  }
1226
1263
 
1227
- notifyCommand(ctx, "Usage: /oracle status | model <provider/model|auto> | thinking <off|minimal|low|medium|high|xhigh|auto> | clear [all|model|thinking]", "warning");
1264
+ notifyCommand(ctx, "Usage: /oracle status | model <provider/model|auto> | thinking <off|minimal|low|medium|high|xhigh|max|auto> | clear [all|model|thinking]", "warning");
1228
1265
  },
1229
1266
  });
1230
1267
 
@@ -1270,13 +1307,17 @@ export default function oracleExtension(pi: ExtensionAPI) {
1270
1307
  parameters: OracleParams,
1271
1308
 
1272
1309
  async execute(toolCallId, params, signal, onUpdate, ctx) {
1310
+ const rawTask = (params as { task?: unknown }).task;
1311
+ const task = typeof rawTask === "string" ? rawTask.trim() : "";
1312
+ if (!task) throw new Error("Invalid parameters: expected task to be a non-empty string.");
1313
+
1273
1314
  const explicitModel = parseModelPreference(params.model);
1274
1315
  const defaultModel = parseModelPreference(preferences.model);
1275
1316
  const configuredModel = explicitModel.model ?? defaultModel.model;
1276
1317
  const configuredThinkingLevel =
1277
1318
  params.thinkingLevel ?? explicitModel.thinkingLevel ?? preferences.thinkingLevel ?? defaultModel.thinkingLevel;
1278
1319
  const uiRun: OracleUiRun = {
1279
- task: params.task,
1320
+ task,
1280
1321
  includeBash: params.includeBash ?? false,
1281
1322
  startedAt: Date.now(),
1282
1323
  };
@@ -1368,7 +1409,7 @@ export default function oracleExtension(pi: ExtensionAPI) {
1368
1409
  uiRun.selection = attempt;
1369
1410
  updateOracleUi(ctx, activeRuns);
1370
1411
 
1371
- const result = await runOracle(attempt, params, signal, handleUpdate, ctx.cwd);
1412
+ const result = await runOracle(attempt, { ...params, task }, signal, handleUpdate, ctx.cwd);
1372
1413
  if (result.ok) {
1373
1414
  return {
1374
1415
  content: [{ type: "text", text: result.output }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-oracle",
3
- "version": "0.1.16",
3
+ "version": "0.1.20",
4
4
  "description": "An Amp-style oracle extension for pi that consults the strongest reasoning model on your current provider.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -34,5 +34,9 @@
34
34
  "@earendil-works/pi-coding-agent": "*",
35
35
  "@earendil-works/pi-tui": "*",
36
36
  "typebox": "*"
37
+ },
38
+ "type": "module",
39
+ "engines": {
40
+ "node": ">=22.19.0"
37
41
  }
38
42
  }