@benvargas/pi-openai-fast 1.0.2 → 1.0.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/README.md +10 -2
- package/extensions/index.ts +35 -3
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
This extension does not change the model, thinking level, tools, or prompts. It only adds `service_tier=priority` to provider requests when fast mode is active and the current model matches the configured supported-model list.
|
|
6
6
|
|
|
7
|
-
Requires pi `0.
|
|
7
|
+
Requires pi `0.74.0` or newer.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -51,7 +51,15 @@ Default config:
|
|
|
51
51
|
"active": false,
|
|
52
52
|
"supportedModels": [
|
|
53
53
|
"openai/gpt-5.4",
|
|
54
|
-
"openai
|
|
54
|
+
"openai/gpt-5.5",
|
|
55
|
+
"openai/gpt-5.6-sol",
|
|
56
|
+
"openai/gpt-5.6-terra",
|
|
57
|
+
"openai/gpt-5.6-luna",
|
|
58
|
+
"openai-codex/gpt-5.4",
|
|
59
|
+
"openai-codex/gpt-5.5",
|
|
60
|
+
"openai-codex/gpt-5.6-sol",
|
|
61
|
+
"openai-codex/gpt-5.6-terra",
|
|
62
|
+
"openai-codex/gpt-5.6-luna"
|
|
55
63
|
]
|
|
56
64
|
}
|
|
57
65
|
```
|
package/extensions/index.ts
CHANGED
|
@@ -13,14 +13,29 @@
|
|
|
13
13
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { homedir } from "node:os";
|
|
15
15
|
import { dirname, join } from "node:path";
|
|
16
|
-
import type { ExtensionAPI, ExtensionContext } from "@
|
|
16
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
17
17
|
|
|
18
18
|
const FAST_COMMAND = "fast";
|
|
19
19
|
const FAST_FLAG = "fast";
|
|
20
20
|
const FAST_CONFIG_BASENAME = "pi-openai-fast.json";
|
|
21
21
|
const FAST_COMMAND_ARGS = ["on", "off", "status"] as const;
|
|
22
22
|
const FAST_SERVICE_TIER = "priority";
|
|
23
|
-
const DEFAULT_SUPPORTED_MODEL_KEYS = [
|
|
23
|
+
const DEFAULT_SUPPORTED_MODEL_KEYS = [
|
|
24
|
+
"openai/gpt-5.4",
|
|
25
|
+
"openai/gpt-5.5",
|
|
26
|
+
"openai/gpt-5.6-sol",
|
|
27
|
+
"openai/gpt-5.6-terra",
|
|
28
|
+
"openai/gpt-5.6-luna",
|
|
29
|
+
"openai-codex/gpt-5.4",
|
|
30
|
+
"openai-codex/gpt-5.5",
|
|
31
|
+
"openai-codex/gpt-5.6-sol",
|
|
32
|
+
"openai-codex/gpt-5.6-terra",
|
|
33
|
+
"openai-codex/gpt-5.6-luna",
|
|
34
|
+
] as const;
|
|
35
|
+
const LEGACY_DEFAULT_SUPPORTED_MODEL_KEY_SETS = [
|
|
36
|
+
["openai/gpt-5.4", "openai-codex/gpt-5.4"],
|
|
37
|
+
["openai/gpt-5.4", "openai/gpt-5.5", "openai-codex/gpt-5.4", "openai-codex/gpt-5.5"],
|
|
38
|
+
] as const;
|
|
24
39
|
|
|
25
40
|
interface FastModeState {
|
|
26
41
|
active: boolean;
|
|
@@ -132,6 +147,20 @@ function parseSupportedModels(value: unknown): FastSupportedModel[] | undefined
|
|
|
132
147
|
return models;
|
|
133
148
|
}
|
|
134
149
|
|
|
150
|
+
function sameModelKeys(left: readonly string[] | undefined, right: readonly string[]): boolean {
|
|
151
|
+
if (!left || left.length !== right.length) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
return left.every((value, index) => value === right[index]);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function migrateSupportedModelKeys(value: string[] | undefined): string[] | undefined {
|
|
158
|
+
if (LEGACY_DEFAULT_SUPPORTED_MODEL_KEY_SETS.some((legacyKeys) => sameModelKeys(value, legacyKeys))) {
|
|
159
|
+
return [...DEFAULT_SUPPORTED_MODEL_KEYS];
|
|
160
|
+
}
|
|
161
|
+
return value;
|
|
162
|
+
}
|
|
163
|
+
|
|
135
164
|
function readConfigFile(filePath: string): FastConfigFile | null {
|
|
136
165
|
if (!existsSync(filePath)) {
|
|
137
166
|
return null;
|
|
@@ -187,7 +216,8 @@ function resolveFastConfig(cwd: string, homeDir: string = homedir()): ResolvedFa
|
|
|
187
216
|
const selectedConfigPath = existsSync(projectConfigPath) ? projectConfigPath : globalConfigPath;
|
|
188
217
|
const merged = { ...globalConfig, ...projectConfig };
|
|
189
218
|
const supportedModels =
|
|
190
|
-
parseSupportedModels(merged.supportedModels) ??
|
|
219
|
+
parseSupportedModels(migrateSupportedModelKeys(merged.supportedModels)) ??
|
|
220
|
+
parseSupportedModels(DEFAULT_SUPPORTED_MODEL_KEYS);
|
|
191
221
|
|
|
192
222
|
return {
|
|
193
223
|
configPath: selectedConfigPath,
|
|
@@ -379,10 +409,12 @@ export const _test = {
|
|
|
379
409
|
FAST_COMMAND_ARGS,
|
|
380
410
|
FAST_SERVICE_TIER,
|
|
381
411
|
DEFAULT_SUPPORTED_MODEL_KEYS,
|
|
412
|
+
LEGACY_DEFAULT_SUPPORTED_MODEL_KEY_SETS,
|
|
382
413
|
DEFAULT_CONFIG_FILE,
|
|
383
414
|
getConfigPaths,
|
|
384
415
|
parseSupportedModelKey,
|
|
385
416
|
parseSupportedModels,
|
|
417
|
+
migrateSupportedModelKeys,
|
|
386
418
|
readConfigFile,
|
|
387
419
|
resolveFastConfig,
|
|
388
420
|
isFastSupportedModel,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benvargas/pi-openai-fast",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "OpenAI fast mode toggle for pi - Enables priority service tier on supported GPT-5
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "OpenAI fast mode toggle for pi - Enables priority service tier on supported GPT-5 models",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi",
|
|
7
7
|
"pi-package",
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"openai",
|
|
11
11
|
"codex",
|
|
12
12
|
"gpt-5.4",
|
|
13
|
+
"gpt-5.5",
|
|
14
|
+
"gpt-5.6",
|
|
13
15
|
"fast",
|
|
14
16
|
"priority",
|
|
15
17
|
"service-tier"
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
]
|
|
27
29
|
},
|
|
28
30
|
"peerDependencies": {
|
|
29
|
-
"@
|
|
31
|
+
"@earendil-works/pi-coding-agent": ">=0.74.0"
|
|
30
32
|
},
|
|
31
33
|
"repository": {
|
|
32
34
|
"type": "git",
|