@benvargas/pi-openai-fast 1.0.2 → 1.0.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.
- package/README.md +4 -2
- package/extensions/index.ts +26 -3
- package/package.json +4 -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,9 @@ Default config:
|
|
|
51
51
|
"active": false,
|
|
52
52
|
"supportedModels": [
|
|
53
53
|
"openai/gpt-5.4",
|
|
54
|
-
"openai
|
|
54
|
+
"openai/gpt-5.5",
|
|
55
|
+
"openai-codex/gpt-5.4",
|
|
56
|
+
"openai-codex/gpt-5.5"
|
|
55
57
|
]
|
|
56
58
|
}
|
|
57
59
|
```
|
package/extensions/index.ts
CHANGED
|
@@ -13,14 +13,20 @@
|
|
|
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-codex/gpt-5.4",
|
|
27
|
+
"openai-codex/gpt-5.5",
|
|
28
|
+
] as const;
|
|
29
|
+
const LEGACY_DEFAULT_SUPPORTED_MODEL_KEYS = ["openai/gpt-5.4", "openai-codex/gpt-5.4"] as const;
|
|
24
30
|
|
|
25
31
|
interface FastModeState {
|
|
26
32
|
active: boolean;
|
|
@@ -132,6 +138,20 @@ function parseSupportedModels(value: unknown): FastSupportedModel[] | undefined
|
|
|
132
138
|
return models;
|
|
133
139
|
}
|
|
134
140
|
|
|
141
|
+
function sameModelKeys(left: readonly string[] | undefined, right: readonly string[]): boolean {
|
|
142
|
+
if (!left || left.length !== right.length) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
return left.every((value, index) => value === right[index]);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function migrateSupportedModelKeys(value: string[] | undefined): string[] | undefined {
|
|
149
|
+
if (sameModelKeys(value, LEGACY_DEFAULT_SUPPORTED_MODEL_KEYS)) {
|
|
150
|
+
return [...DEFAULT_SUPPORTED_MODEL_KEYS];
|
|
151
|
+
}
|
|
152
|
+
return value;
|
|
153
|
+
}
|
|
154
|
+
|
|
135
155
|
function readConfigFile(filePath: string): FastConfigFile | null {
|
|
136
156
|
if (!existsSync(filePath)) {
|
|
137
157
|
return null;
|
|
@@ -187,7 +207,8 @@ function resolveFastConfig(cwd: string, homeDir: string = homedir()): ResolvedFa
|
|
|
187
207
|
const selectedConfigPath = existsSync(projectConfigPath) ? projectConfigPath : globalConfigPath;
|
|
188
208
|
const merged = { ...globalConfig, ...projectConfig };
|
|
189
209
|
const supportedModels =
|
|
190
|
-
parseSupportedModels(merged.supportedModels) ??
|
|
210
|
+
parseSupportedModels(migrateSupportedModelKeys(merged.supportedModels)) ??
|
|
211
|
+
parseSupportedModels(DEFAULT_SUPPORTED_MODEL_KEYS);
|
|
191
212
|
|
|
192
213
|
return {
|
|
193
214
|
configPath: selectedConfigPath,
|
|
@@ -379,10 +400,12 @@ export const _test = {
|
|
|
379
400
|
FAST_COMMAND_ARGS,
|
|
380
401
|
FAST_SERVICE_TIER,
|
|
381
402
|
DEFAULT_SUPPORTED_MODEL_KEYS,
|
|
403
|
+
LEGACY_DEFAULT_SUPPORTED_MODEL_KEYS,
|
|
382
404
|
DEFAULT_CONFIG_FILE,
|
|
383
405
|
getConfigPaths,
|
|
384
406
|
parseSupportedModelKey,
|
|
385
407
|
parseSupportedModels,
|
|
408
|
+
migrateSupportedModelKeys,
|
|
386
409
|
readConfigFile,
|
|
387
410
|
resolveFastConfig,
|
|
388
411
|
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.4",
|
|
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,7 @@
|
|
|
10
10
|
"openai",
|
|
11
11
|
"codex",
|
|
12
12
|
"gpt-5.4",
|
|
13
|
+
"gpt-5.5",
|
|
13
14
|
"fast",
|
|
14
15
|
"priority",
|
|
15
16
|
"service-tier"
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
]
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
|
-
"@
|
|
30
|
+
"@earendil-works/pi-coding-agent": ">=0.74.0"
|
|
30
31
|
},
|
|
31
32
|
"repository": {
|
|
32
33
|
"type": "git",
|