@diegopetrucci/pi-fast 0.1.7 → 0.1.9

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 (3) hide show
  1. package/README.md +10 -11
  2. package/index.ts +493 -480
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -44,12 +44,11 @@ Direct OpenAI API Fast mode requires all of the following:
44
44
 
45
45
  The direct OpenAI route stays on OpenAI's direct API contract for both API-key
46
46
  auth and Pi's `openai` ChatGPT OAuth. Acceptance of `service_tier: "fast"` by
47
- Pi's `openai` ChatGPT OAuth sign-in endpoint has not been live-verified and
48
- remains deferred to manual gate `pel-71t6`. This direct route is never forwarded
49
- to legacy `openai-codex` or its subscription-usage endpoint. The documented
50
- request shape is support evidence, not live certification; this change was
51
- validated only with mocked eligibility and request payloads, not live or paid
52
- provider calls.
47
+ Pi's `openai` ChatGPT OAuth sign-in endpoint has not been live-verified.
48
+ This direct route is never forwarded to legacy `openai-codex` or its
49
+ subscription-usage endpoint. The documented request shape is support evidence,
50
+ not live certification; this change was validated only with mocked eligibility
51
+ and request payloads, not live or paid provider calls.
53
52
 
54
53
  ### Ultrafast support (initial, fail-closed)
55
54
 
@@ -144,13 +143,13 @@ Optional global config:
144
143
  ~/<pi-config-dir>/agent/extensions/fast.json
145
144
  ```
146
145
 
147
- Optional project config:
146
+ Optional project config, from the nearest ancestor of the working directory (the working directory itself counts):
148
147
 
149
148
  ```text
150
149
  <project>/<pi-config-dir>/fast.json
151
150
  ```
152
151
 
153
- 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.
152
+ Here `<pi-config-dir>` is Pi's runtime config directory name (`CONFIG_DIR_NAME`; `.pi` by default). The loader uses that nearest ancestor `fast.json`, which overrides global config after Pi reports that the project is trusted.
154
153
 
155
154
  ```json
156
155
  {
@@ -162,7 +161,7 @@ Here `<pi-config-dir>` is Pi's runtime config directory name (`CONFIG_DIR_NAME`;
162
161
  - `enabled`: default Fast-mode state when there is no session override.
163
162
  - `showStatus`: show a compact `fast` status when Fast mode is active for the selected model.
164
163
 
165
- The unified extension intentionally does not read `openai-fast.json` or `claude-fast.json`; those files belong to the provider-specific standalone packages and may contain conflicting defaults.
164
+ The unified extension reads only `fast.json`. It does not read `openai-fast.json` or `claude-fast.json`.
166
165
 
167
166
  ## Install
168
167
 
@@ -192,7 +191,7 @@ Then reload pi:
192
191
 
193
192
  ## Legacy provider-specific packages
194
193
 
195
- The collection package loads this unified extension instead of `openai-fast` and `claude-fast`. Both provider-specific packages remain available as standalone alternatives. Do not load them together with this extension: independent Fast-mode state and duplicate `/fast` registrations can produce conflicting behavior.
194
+ The collection package loads this unified extension only (`extensions/fast/index.ts`). `openai-fast` and `claude-fast` remain published as deprecated standalone leftovers. On session start they warn, clear their leftover footer status, and remove `fast-mode-2026-02-01` from the current model header. They do not read config, register commands, or inject Fast fields into requests.
196
195
 
197
196
  ## Notes
198
197
 
@@ -202,6 +201,6 @@ The collection package loads this unified extension instead of `openai-fast` and
202
201
  - Codex Fast availability depends on plan, client, workspace settings, and rollout. Local eligibility is not live-provider certification.
203
202
  - Pi's provider catalog remains the source of reported model pricing, including any tiered pricing; this extension does not apply guessed discounts or rewrite cost metadata.
204
203
  - OpenAI Codex Fast mode intentionally does not affect API-key models.
205
- - The retired `openai-fast` and `claude-fast` packages remain legacy standalone boundaries; new provider/auth behavior belongs only to this unified extension.
204
+ - Deprecated `openai-fast` and `claude-fast` packages no longer implement Fast mode. New provider/auth behavior belongs only to this unified extension.
206
205
  - Existing `speed` and `service_tier` fields are never overwritten.
207
206
  - Pi's model catalog may not include a Fast-mode premium. Cost accounting depends on the provider reporting the effective tier in its streamed response, and this extension does not patch usage totals.
package/index.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import {
4
- CONFIG_DIR_NAME,
5
- getAgentDir,
6
- type ExtensionAPI,
7
- type ExtensionContext,
4
+ CONFIG_DIR_NAME,
5
+ getAgentDir,
6
+ type ExtensionAPI,
7
+ type ExtensionContext,
8
8
  } from "@earendil-works/pi-coding-agent";
9
9
 
10
10
  const EXTENSION_ID = "fast";
@@ -21,585 +21,598 @@ const OPENAI_PROVIDER_ID = "openai-codex";
21
21
  const OPENAI_API_ID = "openai-codex-responses";
22
22
  const OPENAI_FAST_SERVICE_TIER = "priority";
23
23
  const OPENAI_SUPPORTED_MODELS = new Set([
24
- "gpt-5.5",
25
- "gpt-5.6-sol",
26
- "gpt-5.6-terra",
27
- "gpt-5.6-luna",
28
- "gpt-6-astra",
29
- "gpt-6.1-sol",
30
- "gpt-6-sol",
31
- "gpt-6-luna",
24
+ "gpt-5.5",
25
+ "gpt-5.6-sol",
26
+ "gpt-5.6-terra",
27
+ "gpt-5.6-luna",
28
+ "gpt-6-astra",
29
+ "gpt-6.1-sol",
30
+ "gpt-6-sol",
31
+ "gpt-6-luna",
32
32
  ]);
33
33
  const OPENAI_API_PROVIDER_ID = "openai";
34
34
  const OPENAI_API_IDS = new Set(["openai-responses", "openai-completions"]);
35
35
  const OPENAI_API_FAST_SERVICE_TIER = "fast";
36
- const OPENAI_API_SUPPORTED_MODELS = new Set(["gpt-6.1-sol", "gpt-6-astra", "gpt-6-sol", "gpt-6-luna"]);
36
+ const OPENAI_API_SUPPORTED_MODELS = new Set([
37
+ "gpt-6.1-sol",
38
+ "gpt-6-astra",
39
+ "gpt-6-sol",
40
+ "gpt-6-luna",
41
+ ]);
37
42
  const OPENAI_ULTRAFAST_MODEL = "gpt-6-astra";
38
43
  const OPENAI_ULTRAFAST_API_ID = "openai-responses";
39
44
  const OPENAI_ULTRAFAST_SERVICE_TIER = "ultrafast";
40
45
  const OPENAI_CANONICAL_BASE_URL = "https://api.openai.com/v1";
41
46
 
42
47
  const DEFAULT_CONFIG: FastConfig = {
43
- enabled: false,
44
- showStatus: true,
48
+ enabled: false,
49
+ showStatus: true,
45
50
  };
46
51
 
47
52
  type FastOverride = "auto" | "on" | "off";
48
53
  type FastProvider = "anthropic" | "openai";
49
54
 
50
55
  type FastConfig = {
51
- /** Default Fast-mode state when there is no session override. */
52
- enabled: boolean;
53
- /** Show a compact `fast` status when Fast mode is active for the current model. */
54
- showStatus: boolean;
56
+ /** Default Fast-mode state when there is no session override. */
57
+ enabled: boolean;
58
+ /** Show a compact `fast` status when Fast mode is active for the current model. */
59
+ showStatus: boolean;
55
60
  };
56
61
 
57
62
  type SessionState = {
58
- config: FastConfig;
59
- override: FastOverride;
60
- /** Session-only Ultrafast selection; never loaded from configuration. */
61
- ultrafast: boolean;
62
- lastInjectedAt?: number;
63
- lastInjectedModel?: string;
63
+ config: FastConfig;
64
+ override: FastOverride;
65
+ /** Session-only Ultrafast selection; never loaded from configuration. */
66
+ ultrafast: boolean;
67
+ lastInjectedAt?: number;
68
+ lastInjectedModel?: string;
64
69
  };
65
70
 
66
71
  type ProjectConfigContext = {
67
- cwd: string;
68
- isProjectTrusted?: () => boolean;
72
+ cwd: string;
73
+ isProjectTrusted?: () => boolean;
69
74
  };
70
75
 
71
76
  type RecursivePartial<T> = {
72
- [P in keyof T]?: T[P] extends object ? RecursivePartial<T[P]> : T[P];
77
+ [P in keyof T]?: T[P] extends object ? RecursivePartial<T[P]> : T[P];
73
78
  };
74
79
 
75
80
  type PayloadRecord = Record<string, unknown>;
76
81
 
77
82
  type AnthropicHeaderCompat = {
78
- forceAdaptiveThinking?: boolean;
79
- supportsEagerToolInputStreaming?: boolean;
83
+ forceAdaptiveThinking?: boolean;
84
+ supportsEagerToolInputStreaming?: boolean;
80
85
  };
81
86
 
82
87
  type Eligibility = {
83
- eligible: boolean;
84
- modelKey: string;
85
- provider?: FastProvider;
86
- serviceTier?: string;
87
- reason?: string;
88
+ eligible: boolean;
89
+ modelKey: string;
90
+ provider?: FastProvider;
91
+ serviceTier?: string;
92
+ reason?: string;
88
93
  };
89
94
 
90
95
  function readConfigFile(path: string): RecursivePartial<FastConfig> {
91
- if (!existsSync(path)) return {};
92
-
93
- try {
94
- const parsed = JSON.parse(readFileSync(path, "utf-8"));
95
- return isPayloadRecord(parsed) ? (parsed as RecursivePartial<FastConfig>) : {};
96
- } catch (error) {
97
- console.error(`Warning: Could not parse ${path}: ${error}`);
98
- return {};
99
- }
96
+ if (!existsSync(path)) return {};
97
+
98
+ try {
99
+ const parsed = JSON.parse(readFileSync(path, "utf-8"));
100
+ return isPayloadRecord(parsed) ? (parsed as RecursivePartial<FastConfig>) : {};
101
+ } catch (error) {
102
+ console.error(`Warning: Could not parse ${path}: ${error}`);
103
+ return {};
104
+ }
100
105
  }
101
106
 
102
107
  function normalizeBoolean(value: unknown, fallback: boolean): boolean {
103
- return typeof value === "boolean" ? value : fallback;
108
+ return typeof value === "boolean" ? value : fallback;
104
109
  }
105
110
 
106
111
  function mergeConfig(base: FastConfig, overrides: RecursivePartial<FastConfig>): FastConfig {
107
- return {
108
- enabled: normalizeBoolean(overrides.enabled, base.enabled),
109
- showStatus: normalizeBoolean(overrides.showStatus, base.showStatus),
110
- };
112
+ return {
113
+ enabled: normalizeBoolean(overrides.enabled, base.enabled),
114
+ showStatus: normalizeBoolean(overrides.showStatus, base.showStatus),
115
+ };
111
116
  }
112
117
 
113
118
  function canReadProjectConfig(ctx: ProjectConfigContext): boolean {
114
- return typeof ctx.isProjectTrusted === "function" && ctx.isProjectTrusted();
119
+ return typeof ctx.isProjectTrusted === "function" && ctx.isProjectTrusted();
115
120
  }
116
121
 
117
122
  function findProjectConfigPath(cwd: string): string {
118
- let current = cwd;
119
- while (true) {
120
- const candidate = join(current, CONFIG_DIR_NAME, "fast.json");
121
- if (existsSync(candidate)) return candidate;
122
-
123
- const parent = dirname(current);
124
- if (parent === current) return join(cwd, CONFIG_DIR_NAME, "fast.json");
125
- current = parent;
126
- }
123
+ let current = cwd;
124
+ while (true) {
125
+ const candidate = join(current, CONFIG_DIR_NAME, "fast.json");
126
+ if (existsSync(candidate)) return candidate;
127
+
128
+ const parent = dirname(current);
129
+ if (parent === current) return join(cwd, CONFIG_DIR_NAME, "fast.json");
130
+ current = parent;
131
+ }
127
132
  }
128
133
 
129
134
  function loadConfig(ctx: ProjectConfigContext): FastConfig {
130
- const globalConfig = readConfigFile(join(getAgentDir(), "extensions", "fast.json"));
131
- const projectConfig = canReadProjectConfig(ctx) ? readConfigFile(findProjectConfigPath(ctx.cwd)) : {};
132
- return mergeConfig(mergeConfig(DEFAULT_CONFIG, globalConfig), projectConfig);
135
+ const globalConfig = readConfigFile(join(getAgentDir(), "extensions", "fast.json"));
136
+ const projectConfig = canReadProjectConfig(ctx)
137
+ ? readConfigFile(findProjectConfigPath(ctx.cwd))
138
+ : {};
139
+ return mergeConfig(mergeConfig(DEFAULT_CONFIG, globalConfig), projectConfig);
133
140
  }
134
141
 
135
142
  function isPayloadRecord(payload: unknown): payload is PayloadRecord {
136
- return typeof payload === "object" && payload !== null && !Array.isArray(payload);
137
- }
138
-
139
- function modelKey(ctx: ExtensionContext): string {
140
- const model = ctx.model;
141
- return model ? `${model.provider}/${model.id}` : "no-model";
143
+ return typeof payload === "object" && payload !== null && !Array.isArray(payload);
142
144
  }
143
145
 
144
146
  function isFastEnabled(state: SessionState): boolean {
145
- if (state.override === "on") return true;
146
- if (state.override === "off") return false;
147
- return state.config.enabled;
147
+ if (state.override === "on") return true;
148
+ if (state.override === "off") return false;
149
+ return state.config.enabled;
148
150
  }
149
151
 
150
152
  function describeMode(state: SessionState): string {
151
- if (state.override === "on") return "on (session override)";
152
- if (state.override === "off") return "off (session override)";
153
- return state.config.enabled ? "on (config default)" : "off (config default)";
153
+ if (state.override === "on") return "on (session override)";
154
+ if (state.override === "off") return "off (session override)";
155
+ return state.config.enabled ? "on (config default)" : "off (config default)";
154
156
  }
155
157
 
156
158
  function getEligibility(ctx: ExtensionContext): Eligibility {
157
- const model = ctx.model;
158
- if (!model) {
159
- return { eligible: false, modelKey: "no-model", reason: "no model is selected" };
160
- }
161
-
162
- const key = `${model.provider}/${model.id}`;
163
- if (model.provider === ANTHROPIC_PROVIDER_ID) {
164
- if (model.api !== ANTHROPIC_API_ID) {
165
- return {
166
- eligible: false,
167
- modelKey: key,
168
- reason: `current API is ${model.api}, not ${ANTHROPIC_API_ID}`,
169
- };
170
- }
171
-
172
- if (!ANTHROPIC_SUPPORTED_MODELS.has(model.id)) {
173
- return {
174
- eligible: false,
175
- modelKey: key,
176
- reason: "Fast mode is only enabled for Claude Opus 4.8, Claude Opus 5, and Claude Opus 5.5",
177
- };
178
- }
179
-
180
- return { eligible: true, modelKey: key, provider: "anthropic" };
181
- }
182
-
183
- if (model.provider === OPENAI_PROVIDER_ID) {
184
- if (model.api !== OPENAI_API_ID) {
185
- return {
186
- eligible: false,
187
- modelKey: key,
188
- reason: `current API is ${model.api}, not ${OPENAI_API_ID}`,
189
- };
190
- }
191
-
192
- if (!OPENAI_SUPPORTED_MODELS.has(model.id)) {
193
- return {
194
- eligible: false,
195
- modelKey: key,
196
- reason: "Fast mode is not enabled for this OpenAI Codex model",
197
- };
198
- }
199
-
200
- if (!ctx.modelRegistry.isUsingOAuth(model)) {
201
- return {
202
- eligible: false,
203
- modelKey: key,
204
- reason: "ChatGPT OAuth auth is required; API-key auth is intentionally not used",
205
- };
206
- }
207
-
208
- return {
209
- eligible: true,
210
- modelKey: key,
211
- provider: "openai",
212
- serviceTier: OPENAI_FAST_SERVICE_TIER,
213
- };
214
- }
215
-
216
- if (model.provider === OPENAI_API_PROVIDER_ID) {
217
- if (!OPENAI_API_IDS.has(model.api)) {
218
- return {
219
- eligible: false,
220
- modelKey: key,
221
- reason: `current API is ${model.api}, not openai-responses or openai-completions`,
222
- };
223
- }
224
-
225
- if (!OPENAI_API_SUPPORTED_MODELS.has(model.id)) {
226
- return {
227
- eligible: false,
228
- modelKey: key,
229
- reason: "Fast mode is only enabled for GPT-6.1 Sol, GPT-6 Astra, GPT-6 Sol, and GPT-6 Luna on direct OpenAI APIs",
230
- };
231
- }
232
-
233
- return {
234
- eligible: true,
235
- modelKey: key,
236
- provider: "openai",
237
- serviceTier: OPENAI_API_FAST_SERVICE_TIER,
238
- };
239
- }
240
-
241
- return {
242
- eligible: false,
243
- modelKey: key,
244
- reason: `current provider ${model.provider} does not support this extension's Fast mode`,
245
- };
159
+ const model = ctx.model;
160
+ if (!model) {
161
+ return { eligible: false, modelKey: "no-model", reason: "no model is selected" };
162
+ }
163
+
164
+ const key = `${model.provider}/${model.id}`;
165
+ if (model.provider === ANTHROPIC_PROVIDER_ID) {
166
+ if (model.api !== ANTHROPIC_API_ID) {
167
+ return {
168
+ eligible: false,
169
+ modelKey: key,
170
+ reason: `current API is ${model.api}, not ${ANTHROPIC_API_ID}`,
171
+ };
172
+ }
173
+
174
+ if (!ANTHROPIC_SUPPORTED_MODELS.has(model.id)) {
175
+ return {
176
+ eligible: false,
177
+ modelKey: key,
178
+ reason: "Fast mode is only enabled for Claude Opus 4.8, Claude Opus 5, and Claude Opus 5.5",
179
+ };
180
+ }
181
+
182
+ return { eligible: true, modelKey: key, provider: "anthropic" };
183
+ }
184
+
185
+ if (model.provider === OPENAI_PROVIDER_ID) {
186
+ if (model.api !== OPENAI_API_ID) {
187
+ return {
188
+ eligible: false,
189
+ modelKey: key,
190
+ reason: `current API is ${model.api}, not ${OPENAI_API_ID}`,
191
+ };
192
+ }
193
+
194
+ if (!OPENAI_SUPPORTED_MODELS.has(model.id)) {
195
+ return {
196
+ eligible: false,
197
+ modelKey: key,
198
+ reason: "Fast mode is not enabled for this OpenAI Codex model",
199
+ };
200
+ }
201
+
202
+ if (!ctx.modelRegistry.isUsingOAuth(model)) {
203
+ return {
204
+ eligible: false,
205
+ modelKey: key,
206
+ reason: "ChatGPT OAuth auth is required; API-key auth is intentionally not used",
207
+ };
208
+ }
209
+
210
+ return {
211
+ eligible: true,
212
+ modelKey: key,
213
+ provider: "openai",
214
+ serviceTier: OPENAI_FAST_SERVICE_TIER,
215
+ };
216
+ }
217
+
218
+ if (model.provider === OPENAI_API_PROVIDER_ID) {
219
+ if (!OPENAI_API_IDS.has(model.api)) {
220
+ return {
221
+ eligible: false,
222
+ modelKey: key,
223
+ reason: `current API is ${model.api}, not openai-responses or openai-completions`,
224
+ };
225
+ }
226
+
227
+ if (!OPENAI_API_SUPPORTED_MODELS.has(model.id)) {
228
+ return {
229
+ eligible: false,
230
+ modelKey: key,
231
+ reason:
232
+ "Fast mode is only enabled for GPT-6.1 Sol, GPT-6 Astra, GPT-6 Sol, and GPT-6 Luna on direct OpenAI APIs",
233
+ };
234
+ }
235
+
236
+ return {
237
+ eligible: true,
238
+ modelKey: key,
239
+ provider: "openai",
240
+ serviceTier: OPENAI_API_FAST_SERVICE_TIER,
241
+ };
242
+ }
243
+
244
+ return {
245
+ eligible: false,
246
+ modelKey: key,
247
+ reason: `current provider ${model.provider} does not support this extension's Fast mode`,
248
+ };
246
249
  }
247
250
 
248
251
  function isCanonicalOpenAIEndpoint(baseUrl: unknown): boolean {
249
- return baseUrl === OPENAI_CANONICAL_BASE_URL || baseUrl === `${OPENAI_CANONICAL_BASE_URL}/`;
252
+ return baseUrl === OPENAI_CANONICAL_BASE_URL || baseUrl === `${OPENAI_CANONICAL_BASE_URL}/`;
250
253
  }
251
254
 
252
255
  function getUltrafastEligibility(ctx: ExtensionContext): Eligibility {
253
- const model = ctx.model;
254
- if (!model) {
255
- return { eligible: false, modelKey: "no-model", reason: "no model is selected" };
256
- }
257
-
258
- const key = `${model.provider}/${model.id}`;
259
- if (model.provider !== OPENAI_API_PROVIDER_ID) {
260
- return {
261
- eligible: false,
262
- modelKey: key,
263
- reason: "Ultrafast mode requires the direct OpenAI provider",
264
- };
265
- }
266
-
267
- if (model.api !== OPENAI_ULTRAFAST_API_ID) {
268
- return {
269
- eligible: false,
270
- modelKey: key,
271
- reason: `Ultrafast mode requires API ${OPENAI_ULTRAFAST_API_ID}`,
272
- };
273
- }
274
-
275
- if (model.id !== OPENAI_ULTRAFAST_MODEL) {
276
- return {
277
- eligible: false,
278
- modelKey: key,
279
- reason: `Ultrafast mode is only enabled for ${OPENAI_ULTRAFAST_MODEL}`,
280
- };
281
- }
282
-
283
- if (!isCanonicalOpenAIEndpoint(model.baseUrl)) {
284
- return {
285
- eligible: false,
286
- modelKey: key,
287
- reason: `Ultrafast mode requires the canonical endpoint ${OPENAI_CANONICAL_BASE_URL}`,
288
- };
289
- }
290
-
291
- try {
292
- if (ctx.modelRegistry.isUsingOAuth(model)) {
293
- return {
294
- eligible: false,
295
- modelKey: key,
296
- reason: "Ultrafast mode requires direct OpenAI API-key auth; OAuth is unsupported",
297
- };
298
- }
299
- } catch {
300
- return {
301
- eligible: false,
302
- modelKey: key,
303
- reason: "Ultrafast mode requires direct OpenAI API-key auth; auth could not be verified",
304
- };
305
- }
306
-
307
- return {
308
- eligible: true,
309
- modelKey: key,
310
- provider: "openai",
311
- serviceTier: OPENAI_ULTRAFAST_SERVICE_TIER,
312
- };
256
+ const model = ctx.model;
257
+ if (!model) {
258
+ return { eligible: false, modelKey: "no-model", reason: "no model is selected" };
259
+ }
260
+
261
+ const key = `${model.provider}/${model.id}`;
262
+ if (model.provider !== OPENAI_API_PROVIDER_ID) {
263
+ return {
264
+ eligible: false,
265
+ modelKey: key,
266
+ reason: "Ultrafast mode requires the direct OpenAI provider",
267
+ };
268
+ }
269
+
270
+ if (model.api !== OPENAI_ULTRAFAST_API_ID) {
271
+ return {
272
+ eligible: false,
273
+ modelKey: key,
274
+ reason: `Ultrafast mode requires API ${OPENAI_ULTRAFAST_API_ID}`,
275
+ };
276
+ }
277
+
278
+ if (model.id !== OPENAI_ULTRAFAST_MODEL) {
279
+ return {
280
+ eligible: false,
281
+ modelKey: key,
282
+ reason: `Ultrafast mode is only enabled for ${OPENAI_ULTRAFAST_MODEL}`,
283
+ };
284
+ }
285
+
286
+ if (!isCanonicalOpenAIEndpoint(model.baseUrl)) {
287
+ return {
288
+ eligible: false,
289
+ modelKey: key,
290
+ reason: `Ultrafast mode requires the canonical endpoint ${OPENAI_CANONICAL_BASE_URL}`,
291
+ };
292
+ }
293
+
294
+ try {
295
+ if (ctx.modelRegistry.isUsingOAuth(model)) {
296
+ return {
297
+ eligible: false,
298
+ modelKey: key,
299
+ reason: "Ultrafast mode requires direct OpenAI API-key auth; OAuth is unsupported",
300
+ };
301
+ }
302
+ } catch {
303
+ return {
304
+ eligible: false,
305
+ modelKey: key,
306
+ reason: "Ultrafast mode requires direct OpenAI API-key auth; auth could not be verified",
307
+ };
308
+ }
309
+
310
+ return {
311
+ eligible: true,
312
+ modelKey: key,
313
+ provider: "openai",
314
+ serviceTier: OPENAI_ULTRAFAST_SERVICE_TIER,
315
+ };
313
316
  }
314
317
 
315
318
  function updateStatus(ctx: ExtensionContext, state: SessionState): void {
316
- if (!ctx.hasUI) return;
317
- if (!state.config.showStatus) {
318
- ctx.ui.setStatus(EXTENSION_ID, undefined);
319
- return;
320
- }
321
-
322
- if (state.ultrafast) {
323
- const eligibility = getUltrafastEligibility(ctx);
324
- ctx.ui.setStatus(EXTENSION_ID, eligibility.eligible ? "ultrafast" : undefined);
325
- return;
326
- }
327
-
328
- const eligibility = getEligibility(ctx);
329
- ctx.ui.setStatus(
330
- EXTENSION_ID,
331
- isFastEnabled(state) && eligibility.eligible ? "fast" : undefined,
332
- );
319
+ if (!ctx.hasUI) return;
320
+ if (!state.config.showStatus) {
321
+ ctx.ui.setStatus(EXTENSION_ID, undefined);
322
+ return;
323
+ }
324
+
325
+ if (state.ultrafast) {
326
+ const eligibility = getUltrafastEligibility(ctx);
327
+ ctx.ui.setStatus(EXTENSION_ID, eligibility.eligible ? "ultrafast" : undefined);
328
+ return;
329
+ }
330
+
331
+ const eligibility = getEligibility(ctx);
332
+ ctx.ui.setStatus(EXTENSION_ID, isFastEnabled(state) && eligibility.eligible ? "fast" : undefined);
333
333
  }
334
334
 
335
335
  function getStatusMessage(ctx: ExtensionContext, state: SessionState): string {
336
- const injected = state.lastInjectedAt
337
- ? ` Last injected for ${state.lastInjectedModel ?? "unknown model"} ${Math.max(0, Math.round((Date.now() - state.lastInjectedAt) / 1000))}s ago.`
338
- : "";
339
-
340
- if (state.ultrafast) {
341
- const eligibility = getUltrafastEligibility(ctx);
342
- if (eligibility.eligible) {
343
- return `Ultrafast mode is on (session only) and eligible for ${eligibility.modelKey}; requested service_tier=${OPENAI_ULTRAFAST_SERVICE_TIER}. Actual API pricing is 6x Standard, but Pi's current cost display omits this premium.${injected}`;
344
- }
345
- return `Ultrafast mode is on (session only), but not eligible for ${eligibility.modelKey}: ${eligibility.reason}.${injected}`;
346
- }
347
-
348
- const enabled = isFastEnabled(state);
349
- const eligibility = getEligibility(ctx);
350
- const active = enabled && eligibility.eligible;
351
-
352
- if (active) {
353
- const wireSetting =
354
- eligibility.provider === "anthropic"
355
- ? `speed=${ANTHROPIC_FAST_SPEED}`
356
- : `service_tier=${eligibility.serviceTier}`;
357
- return `Fast mode is ${describeMode(state)} and active for ${eligibility.modelKey}; requests will use ${wireSetting}.${injected}`;
358
- }
359
-
360
- if (enabled) {
361
- return `Fast mode is ${describeMode(state)}, but inactive for ${eligibility.modelKey}: ${eligibility.reason}.${injected}`;
362
- }
363
-
364
- return `Fast mode is ${describeMode(state)}. Current model: ${eligibility.modelKey}.${injected}`;
336
+ const injected = state.lastInjectedAt
337
+ ? ` Last injected for ${state.lastInjectedModel ?? "unknown model"} ${Math.max(0, Math.round((Date.now() - state.lastInjectedAt) / 1000))}s ago.`
338
+ : "";
339
+
340
+ if (state.ultrafast) {
341
+ const eligibility = getUltrafastEligibility(ctx);
342
+ if (eligibility.eligible) {
343
+ return `Ultrafast mode is on (session only) and eligible for ${eligibility.modelKey}; requested service_tier=${OPENAI_ULTRAFAST_SERVICE_TIER}. Actual API pricing is 6x Standard, but Pi's current cost display omits this premium.${injected}`;
344
+ }
345
+ return `Ultrafast mode is on (session only), but not eligible for ${eligibility.modelKey}: ${eligibility.reason}.${injected}`;
346
+ }
347
+
348
+ const enabled = isFastEnabled(state);
349
+ const eligibility = getEligibility(ctx);
350
+ const active = enabled && eligibility.eligible;
351
+
352
+ if (active) {
353
+ const wireSetting =
354
+ eligibility.provider === "anthropic"
355
+ ? `speed=${ANTHROPIC_FAST_SPEED}`
356
+ : `service_tier=${eligibility.serviceTier}`;
357
+ return `Fast mode is ${describeMode(state)} and active for ${eligibility.modelKey}; requests will use ${wireSetting}.${injected}`;
358
+ }
359
+
360
+ if (enabled) {
361
+ return `Fast mode is ${describeMode(state)}, but inactive for ${eligibility.modelKey}: ${eligibility.reason}.${injected}`;
362
+ }
363
+
364
+ return `Fast mode is ${describeMode(state)}. Current model: ${eligibility.modelKey}.${injected}`;
365
365
  }
366
366
 
367
367
  function splitBetaHeader(value: string | null | undefined): string[] {
368
- return (value ?? "")
369
- .split(",")
370
- .map((part) => part.trim())
371
- .filter(Boolean);
368
+ return (value ?? "")
369
+ .split(",")
370
+ .map((part) => part.trim())
371
+ .filter(Boolean);
372
372
  }
373
373
 
374
374
  async function isAnthropicOAuth(ctx: ExtensionContext): Promise<boolean> {
375
- try {
376
- const resolution = await ctx.modelRegistry.getProviderAuth(ANTHROPIC_PROVIDER_ID);
377
- const apiKey = resolution?.auth.apiKey;
378
- if (typeof apiKey === "string") return apiKey.includes("sk-ant-oat");
379
- } catch {
380
- // Fall back to the synchronous registry snapshot below.
381
- }
382
-
383
- return ctx.model ? ctx.modelRegistry.isUsingOAuth(ctx.model) : false;
375
+ try {
376
+ const resolution = await ctx.modelRegistry.getProviderAuth(ANTHROPIC_PROVIDER_ID);
377
+ const apiKey = resolution?.auth.apiKey;
378
+ if (typeof apiKey === "string") return apiKey.includes("sk-ant-oat");
379
+ } catch {
380
+ // Fall back to the synchronous registry snapshot below.
381
+ }
382
+
383
+ return ctx.model ? ctx.modelRegistry.isUsingOAuth(ctx.model) : false;
384
384
  }
385
385
 
386
386
  function getAnthropicProviderBetas(ctx: ExtensionContext, hasActiveTools: boolean): string[] {
387
- const model = ctx.model;
388
- if (!model) return [];
389
- const compat = model.compat as AnthropicHeaderCompat | undefined;
390
-
391
- const betas: string[] = [];
392
- if (hasActiveTools && compat?.supportsEagerToolInputStreaming === false) {
393
- betas.push(FINE_GRAINED_TOOL_STREAMING_BETA);
394
- }
395
- if (compat?.forceAdaptiveThinking !== true) {
396
- betas.push(INTERLEAVED_THINKING_BETA);
397
- }
398
- return betas;
387
+ const model = ctx.model;
388
+ if (!model) return [];
389
+ const compat = model.compat as AnthropicHeaderCompat | undefined;
390
+
391
+ const betas: string[] = [];
392
+ if (hasActiveTools && compat?.supportsEagerToolInputStreaming === false) {
393
+ betas.push(FINE_GRAINED_TOOL_STREAMING_BETA);
394
+ }
395
+ if (compat?.forceAdaptiveThinking !== true) {
396
+ betas.push(INTERLEAVED_THINKING_BETA);
397
+ }
398
+ return betas;
399
399
  }
400
400
 
401
401
  async function injectAnthropicFastHeader(
402
- headers: Record<string, string | null>,
403
- ctx: ExtensionContext,
404
- state: SessionState,
405
- hasActiveTools: boolean,
402
+ headers: Record<string, string | null>,
403
+ ctx: ExtensionContext,
404
+ state: SessionState,
405
+ hasActiveTools: boolean,
406
406
  ): Promise<void> {
407
- if (state.ultrafast || !isFastEnabled(state)) return;
408
- const eligibility = getEligibility(ctx);
409
- if (!eligibility.eligible || eligibility.provider !== "anthropic") return;
410
-
411
- const matchingKeys = Object.keys(headers).filter((name) => name.toLowerCase() === "anthropic-beta");
412
- const existing = matchingKeys.flatMap((name) => splitBetaHeader(headers[name]));
413
- const matchingModelEntries = Object.entries(ctx.model?.headers ?? {}).filter(
414
- ([name]) => name.toLowerCase() === "anthropic-beta",
415
- );
416
- const modelBetas = matchingModelEntries.flatMap(([, value]) => splitBetaHeader(value));
417
- const providerBetas = getAnthropicProviderBetas(ctx, hasActiveTools);
418
- const oauthBetas = (await isAnthropicOAuth(ctx)) ? CLAUDE_CODE_OAUTH_BETAS : [];
419
- const next = Array.from(
420
- new Set([...modelBetas, ...existing, ...oauthBetas, ...providerBetas, ANTHROPIC_FAST_BETA]),
421
- );
422
-
423
- for (const key of matchingKeys) delete headers[key];
424
- const outputKey = matchingModelEntries.at(-1)?.[0] ?? "anthropic-beta";
425
- headers[outputKey] = next.join(",");
407
+ if (state.ultrafast || !isFastEnabled(state)) return;
408
+ const eligibility = getEligibility(ctx);
409
+ if (!eligibility.eligible || eligibility.provider !== "anthropic") return;
410
+
411
+ const matchingKeys = Object.keys(headers).filter(
412
+ (name) => name.toLowerCase() === "anthropic-beta",
413
+ );
414
+ const existing = matchingKeys.flatMap((name) => splitBetaHeader(headers[name]));
415
+ const matchingModelEntries = Object.entries(ctx.model?.headers ?? {}).filter(
416
+ ([name]) => name.toLowerCase() === "anthropic-beta",
417
+ );
418
+ const modelBetas = matchingModelEntries.flatMap(([, value]) => splitBetaHeader(value));
419
+ const providerBetas = getAnthropicProviderBetas(ctx, hasActiveTools);
420
+ const oauthBetas = (await isAnthropicOAuth(ctx)) ? CLAUDE_CODE_OAUTH_BETAS : [];
421
+ const next = Array.from(
422
+ new Set([...modelBetas, ...existing, ...oauthBetas, ...providerBetas, ANTHROPIC_FAST_BETA]),
423
+ );
424
+
425
+ for (const key of matchingKeys) delete headers[key];
426
+ const outputKey = matchingModelEntries.at(-1)?.[0] ?? "anthropic-beta";
427
+ headers[outputKey] = next.join(",");
426
428
  }
427
429
 
428
430
  function injectUltrafastPayload(
429
- payload: unknown,
430
- ctx: ExtensionContext,
431
- state: SessionState,
431
+ payload: unknown,
432
+ ctx: ExtensionContext,
433
+ state: SessionState,
432
434
  ): PayloadRecord | undefined {
433
- if (!state.ultrafast) return undefined;
434
- const eligibility = getUltrafastEligibility(ctx);
435
- if (!eligibility.eligible || !eligibility.serviceTier) return undefined;
436
- if (!isPayloadRecord(payload)) return undefined;
437
- if (payload.model !== ctx.model?.id) return undefined;
438
- if ("service_tier" in payload) return undefined;
439
-
440
- state.lastInjectedAt = Date.now();
441
- state.lastInjectedModel = eligibility.modelKey;
442
- return { ...payload, service_tier: eligibility.serviceTier };
435
+ if (!state.ultrafast) return undefined;
436
+ const eligibility = getUltrafastEligibility(ctx);
437
+ if (!eligibility.eligible || !eligibility.serviceTier) return undefined;
438
+ if (!isPayloadRecord(payload)) return undefined;
439
+ if (payload.model !== ctx.model?.id) return undefined;
440
+ if ("service_tier" in payload) return undefined;
441
+
442
+ state.lastInjectedAt = Date.now();
443
+ state.lastInjectedModel = eligibility.modelKey;
444
+ return { ...payload, service_tier: eligibility.serviceTier };
443
445
  }
444
446
 
445
447
  function injectFastPayload(
446
- payload: unknown,
447
- ctx: ExtensionContext,
448
- state: SessionState,
448
+ payload: unknown,
449
+ ctx: ExtensionContext,
450
+ state: SessionState,
449
451
  ): PayloadRecord | undefined {
450
- if (state.ultrafast || !isFastEnabled(state)) return undefined;
451
- const eligibility = getEligibility(ctx);
452
- if (!eligibility.eligible || !eligibility.provider) return undefined;
453
- if (!isPayloadRecord(payload)) return undefined;
454
- if (payload.model !== ctx.model?.id) return undefined;
455
-
456
- if (eligibility.provider === "anthropic") {
457
- if ("speed" in payload) return undefined;
458
- state.lastInjectedAt = Date.now();
459
- state.lastInjectedModel = eligibility.modelKey;
460
- return { ...payload, speed: ANTHROPIC_FAST_SPEED };
461
- }
462
-
463
- if ("service_tier" in payload) return undefined;
464
- if (!eligibility.serviceTier) return undefined;
465
- state.lastInjectedAt = Date.now();
466
- state.lastInjectedModel = eligibility.modelKey;
467
- return { ...payload, service_tier: eligibility.serviceTier };
452
+ if (state.ultrafast || !isFastEnabled(state)) return undefined;
453
+ const eligibility = getEligibility(ctx);
454
+ if (!eligibility.eligible || !eligibility.provider) return undefined;
455
+ if (!isPayloadRecord(payload)) return undefined;
456
+ if (payload.model !== ctx.model?.id) return undefined;
457
+
458
+ if (eligibility.provider === "anthropic") {
459
+ if ("speed" in payload) return undefined;
460
+ state.lastInjectedAt = Date.now();
461
+ state.lastInjectedModel = eligibility.modelKey;
462
+ return { ...payload, speed: ANTHROPIC_FAST_SPEED };
463
+ }
464
+
465
+ if ("service_tier" in payload) return undefined;
466
+ if (!eligibility.serviceTier) return undefined;
467
+ state.lastInjectedAt = Date.now();
468
+ state.lastInjectedModel = eligibility.modelKey;
469
+ return { ...payload, service_tier: eligibility.serviceTier };
468
470
  }
469
471
 
470
472
  function disableUltrafast(ctx: ExtensionContext, state: SessionState, reason?: string): void {
471
- state.ultrafast = false;
472
- // Do not fall back to ordinary Fast when a selected Ultrafast model becomes ineligible.
473
- state.override = "off";
474
- updateStatus(ctx, state);
475
- if (reason) {
476
- ctx.ui.notify(`Ultrafast mode disabled: ${reason}. It remains off until manually enabled.`, "warning");
477
- }
473
+ state.ultrafast = false;
474
+ // Do not fall back to ordinary Fast when a selected Ultrafast model becomes ineligible.
475
+ state.override = "off";
476
+ updateStatus(ctx, state);
477
+ if (reason) {
478
+ ctx.ui.notify(
479
+ `Ultrafast mode disabled: ${reason}. It remains off until manually enabled.`,
480
+ "warning",
481
+ );
482
+ }
478
483
  }
479
484
 
480
485
  function toggleUltrafast(ctx: ExtensionContext, state: SessionState): void {
481
- if (state.ultrafast) {
482
- disableUltrafast(ctx, state);
483
- ctx.ui.notify("Ultrafast mode is off (session only); regular Fast remains off until /fast is toggled.", "info");
484
- return;
485
- }
486
-
487
- const eligibility = getUltrafastEligibility(ctx);
488
- if (!eligibility.eligible) {
489
- ctx.ui.notify(`Cannot enable Ultrafast mode for ${eligibility.modelKey}: ${eligibility.reason}.`, "error");
490
- return;
491
- }
492
-
493
- state.ultrafast = true;
494
- updateStatus(ctx, state);
495
- ctx.ui.notify(getStatusMessage(ctx, state), "info");
486
+ if (state.ultrafast) {
487
+ disableUltrafast(ctx, state);
488
+ ctx.ui.notify(
489
+ "Ultrafast mode is off (session only); regular Fast remains off until /fast is toggled.",
490
+ "info",
491
+ );
492
+ return;
493
+ }
494
+
495
+ const eligibility = getUltrafastEligibility(ctx);
496
+ if (!eligibility.eligible) {
497
+ ctx.ui.notify(
498
+ `Cannot enable Ultrafast mode for ${eligibility.modelKey}: ${eligibility.reason}.`,
499
+ "error",
500
+ );
501
+ return;
502
+ }
503
+
504
+ state.ultrafast = true;
505
+ updateStatus(ctx, state);
506
+ ctx.ui.notify(getStatusMessage(ctx, state), "info");
496
507
  }
497
508
 
498
509
  export default function fastExtension(pi: ExtensionAPI) {
499
- const states = new WeakMap<object, SessionState>();
500
-
501
- function getState(ctx: ExtensionContext): SessionState {
502
- let state = states.get(ctx.sessionManager);
503
- if (!state) {
504
- state = {
505
- config: loadConfig(ctx),
506
- override: "auto",
507
- ultrafast: false,
508
- };
509
- states.set(ctx.sessionManager, state);
510
- }
511
- return state;
512
- }
513
-
514
- pi.on("session_start", (_event, ctx) => {
515
- const state: SessionState = {
516
- config: loadConfig(ctx),
517
- override: "auto",
518
- ultrafast: false,
519
- };
520
- states.set(ctx.sessionManager, state);
521
- updateStatus(ctx, state);
522
- });
523
-
524
- pi.on("model_select", (_event, ctx) => {
525
- const state = getState(ctx);
526
- if (state.ultrafast) {
527
- const eligibility = getUltrafastEligibility(ctx);
528
- if (!eligibility.eligible) {
529
- disableUltrafast(
530
- ctx,
531
- state,
532
- `the selected model ${eligibility.modelKey} is unsupported (${eligibility.reason})`,
533
- );
534
- return;
535
- }
536
- }
537
- updateStatus(ctx, state);
538
- });
539
-
540
- pi.on("before_provider_headers", async (event, ctx) => {
541
- const hasActiveTools = typeof pi.getActiveTools === "function" && pi.getActiveTools().length > 0;
542
- await injectAnthropicFastHeader(event.headers, ctx, getState(ctx), hasActiveTools);
543
- });
544
-
545
- pi.on("before_provider_request", (event, ctx) => {
546
- const state = getState(ctx);
547
- if (state.ultrafast) {
548
- const eligibility = getUltrafastEligibility(ctx);
549
- if (!eligibility.eligible) {
550
- disableUltrafast(
551
- ctx,
552
- state,
553
- `the current model ${eligibility.modelKey} is unsupported (${eligibility.reason})`,
554
- );
555
- return undefined;
556
- }
557
- const nextPayload = injectUltrafastPayload(event.payload, ctx, state);
558
- updateStatus(ctx, state);
559
- return nextPayload;
560
- }
561
-
562
- const nextPayload = injectFastPayload(event.payload, ctx, state);
563
- updateStatus(ctx, state);
564
- return nextPayload;
565
- });
566
-
567
- pi.registerCommand("ultrafast", {
568
- description: "Toggle session-only Ultrafast mode for direct OpenAI API-key GPT-6 Astra",
569
- getArgumentCompletions: () => null,
570
- handler: async (args, ctx) => {
571
- if (args.trim()) {
572
- ctx.ui.notify("Usage: /ultrafast", "warning");
573
- return;
574
- }
575
- toggleUltrafast(ctx, getState(ctx));
576
- },
577
- });
578
-
579
- pi.registerCommand("fast", {
580
- description: "Toggle Fast mode for supported direct OpenAI, OpenAI Codex, and Anthropic Claude models",
581
- getArgumentCompletions: () => null,
582
- handler: async (args, ctx) => {
583
- const state = getState(ctx);
584
- const action = args.trim();
585
-
586
- if (action === "ultrafast") {
587
- toggleUltrafast(ctx, state);
588
- return;
589
- }
590
-
591
- if (!action) {
592
- if (state.ultrafast) {
593
- toggleUltrafast(ctx, state);
594
- return;
595
- }
596
- state.override = isFastEnabled(state) ? "off" : "on";
597
- updateStatus(ctx, state);
598
- ctx.ui.notify(getStatusMessage(ctx, state), "info");
599
- return;
600
- }
601
-
602
- ctx.ui.notify("Usage: /fast [ultrafast]", "warning");
603
- },
604
- });
510
+ const states = new WeakMap<object, SessionState>();
511
+
512
+ function getState(ctx: ExtensionContext): SessionState {
513
+ let state = states.get(ctx.sessionManager);
514
+ if (!state) {
515
+ state = {
516
+ config: loadConfig(ctx),
517
+ override: "auto",
518
+ ultrafast: false,
519
+ };
520
+ states.set(ctx.sessionManager, state);
521
+ }
522
+ return state;
523
+ }
524
+
525
+ pi.on("session_start", (_event, ctx) => {
526
+ const state: SessionState = {
527
+ config: loadConfig(ctx),
528
+ override: "auto",
529
+ ultrafast: false,
530
+ };
531
+ states.set(ctx.sessionManager, state);
532
+ updateStatus(ctx, state);
533
+ });
534
+
535
+ pi.on("model_select", (_event, ctx) => {
536
+ const state = getState(ctx);
537
+ if (state.ultrafast) {
538
+ const eligibility = getUltrafastEligibility(ctx);
539
+ if (!eligibility.eligible) {
540
+ disableUltrafast(
541
+ ctx,
542
+ state,
543
+ `the selected model ${eligibility.modelKey} is unsupported (${eligibility.reason})`,
544
+ );
545
+ return;
546
+ }
547
+ }
548
+ updateStatus(ctx, state);
549
+ });
550
+
551
+ pi.on("before_provider_headers", async (event, ctx) => {
552
+ const hasActiveTools =
553
+ typeof pi.getActiveTools === "function" && pi.getActiveTools().length > 0;
554
+ await injectAnthropicFastHeader(event.headers, ctx, getState(ctx), hasActiveTools);
555
+ });
556
+
557
+ pi.on("before_provider_request", (event, ctx) => {
558
+ const state = getState(ctx);
559
+ if (state.ultrafast) {
560
+ const eligibility = getUltrafastEligibility(ctx);
561
+ if (!eligibility.eligible) {
562
+ disableUltrafast(
563
+ ctx,
564
+ state,
565
+ `the current model ${eligibility.modelKey} is unsupported (${eligibility.reason})`,
566
+ );
567
+ return undefined;
568
+ }
569
+ const nextPayload = injectUltrafastPayload(event.payload, ctx, state);
570
+ updateStatus(ctx, state);
571
+ return nextPayload;
572
+ }
573
+
574
+ const nextPayload = injectFastPayload(event.payload, ctx, state);
575
+ updateStatus(ctx, state);
576
+ return nextPayload;
577
+ });
578
+
579
+ pi.registerCommand("ultrafast", {
580
+ description: "Toggle session-only Ultrafast mode for direct OpenAI API-key GPT-6 Astra",
581
+ getArgumentCompletions: () => null,
582
+ handler: async (args, ctx) => {
583
+ if (args.trim()) {
584
+ ctx.ui.notify("Usage: /ultrafast", "warning");
585
+ return;
586
+ }
587
+ toggleUltrafast(ctx, getState(ctx));
588
+ },
589
+ });
590
+
591
+ pi.registerCommand("fast", {
592
+ description:
593
+ "Toggle Fast mode for supported direct OpenAI, OpenAI Codex, and Anthropic Claude models",
594
+ getArgumentCompletions: () => null,
595
+ handler: async (args, ctx) => {
596
+ const state = getState(ctx);
597
+ const action = args.trim();
598
+
599
+ if (action === "ultrafast") {
600
+ toggleUltrafast(ctx, state);
601
+ return;
602
+ }
603
+
604
+ if (!action) {
605
+ if (state.ultrafast) {
606
+ toggleUltrafast(ctx, state);
607
+ return;
608
+ }
609
+ state.override = isFastEnabled(state) ? "off" : "on";
610
+ updateStatus(ctx, state);
611
+ ctx.ui.notify(getStatusMessage(ctx, state), "info");
612
+ return;
613
+ }
614
+
615
+ ctx.ui.notify("Usage: /fast [ultrafast]", "warning");
616
+ },
617
+ });
605
618
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-fast",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "A pi extension that enables Fast mode for supported direct OpenAI API, OpenAI Codex, and Anthropic Claude models based on the currently selected model.",
5
5
  "keywords": [
6
6
  "pi-package",