@howaboua/pi-gpt-switcher 0.1.4 → 0.1.6
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/CHANGELOG.md +8 -1
- package/README.md +13 -10
- package/biome.json +1 -1
- package/codex-model-shortcuts.ts +1 -0
- package/config.ts +8 -10
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @howaboua/pi-gpt-switcher
|
|
2
2
|
|
|
3
|
+
## 0.1.6
|
|
4
|
+
|
|
5
|
+
- Added `/terra` to switch to GPT-6.1 Terra with configurable context and reasoning defaults.
|
|
6
|
+
|
|
7
|
+
## 0.1.5
|
|
8
|
+
|
|
9
|
+
- Fixed model shortcuts rejecting configured context windows above their defaults.
|
|
10
|
+
|
|
3
11
|
## 0.1.4
|
|
4
12
|
|
|
5
13
|
- The `/sol` shortcut now selects GPT-6.1 Sol while preserving configured context and reasoning defaults.
|
|
@@ -7,7 +15,6 @@
|
|
|
7
15
|
## 0.1.3
|
|
8
16
|
|
|
9
17
|
- GPT-6 Sol and Luna now share Astra's Codex support.
|
|
10
|
-
|
|
11
18
|
- Removed `/terra`; use `/luna` instead.
|
|
12
19
|
- Added Responses Lite, non-destructive reasoning changes and terse context guidance for GPT-6 Sol and Luna.
|
|
13
20
|
- Image descriptions now use GPT-6 Luna directly instead of preferring older mini models.
|
package/README.md
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Pi extension adding quick model commands:
|
|
4
4
|
|
|
5
|
-
| Command
|
|
6
|
-
|
|
|
7
|
-
| `/sol [reasoning]`
|
|
8
|
-
| `/
|
|
9
|
-
| `/
|
|
5
|
+
| Command | Model |
|
|
6
|
+
| -------------------- | ---------------------------- |
|
|
7
|
+
| `/sol [reasoning]` | `openai-codex/gpt-6.1-sol` |
|
|
8
|
+
| `/terra [reasoning]` | `openai-codex/gpt-6.1-terra` |
|
|
9
|
+
| `/luna [reasoning]` | `openai-codex/gpt-6-luna` |
|
|
10
|
+
| `/astra [reasoning]` | `openai-codex/gpt-6-astra` |
|
|
10
11
|
|
|
11
12
|
An explicit reasoning argument overrides the configured default. Valid arguments
|
|
12
13
|
are `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`; for example,
|
|
@@ -19,16 +20,18 @@ agent directory:
|
|
|
19
20
|
|
|
20
21
|
```json
|
|
21
22
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
"sol": { "contextWindow": 272000, "reasoning": "high" },
|
|
24
|
+
"terra": { "contextWindow": 272000, "reasoning": "high" },
|
|
25
|
+
"luna": { "contextWindow": 472000, "reasoning": "xhigh" },
|
|
26
|
+
"astra": { "contextWindow": 272000, "reasoning": "low" }
|
|
25
27
|
}
|
|
26
28
|
```
|
|
27
29
|
|
|
28
30
|
Edit the file to change a shortcut's session context window or default
|
|
29
31
|
reasoning. Changes apply on the next shortcut invocation and do not alter the
|
|
30
|
-
provider catalogue. Context windows
|
|
31
|
-
above the shortcut's
|
|
32
|
+
provider catalogue. Context windows must be safe integers of at least 128k.
|
|
33
|
+
Values above the shortcut's default are accepted. Set a window supported by
|
|
34
|
+
your provider; this setting changes Pi's budget, not the provider's capacity.
|
|
32
35
|
|
|
33
36
|
Existing config files need no migration: omitted shortcuts use their shipped defaults, and unknown entries are ignored.
|
|
34
37
|
|
package/biome.json
CHANGED
package/codex-model-shortcuts.ts
CHANGED
package/config.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { getAgentDir } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const SHORTCUT_ALIASES = ["sol", "terra", "luna", "astra"] as const;
|
|
6
6
|
export type ShortcutAlias = (typeof SHORTCUT_ALIASES)[number];
|
|
7
7
|
export type ThinkingLevel =
|
|
8
8
|
| "off"
|
|
@@ -23,15 +23,16 @@ export const THINKING_LEVELS = new Set<ThinkingLevel>([
|
|
|
23
23
|
"max",
|
|
24
24
|
]);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
type ShortcutDefaults = {
|
|
27
27
|
contextWindow: number;
|
|
28
28
|
reasoning: ThinkingLevel;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export type GptSwitcherConfig = Record<ShortcutAlias, ShortcutDefaults>;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const DEFAULT_GPT_SWITCHER_CONFIG: GptSwitcherConfig = {
|
|
34
34
|
sol: { contextWindow: 272_000, reasoning: "high" },
|
|
35
|
+
terra: { contextWindow: 272_000, reasoning: "high" },
|
|
35
36
|
luna: { contextWindow: 472_000, reasoning: "xhigh" },
|
|
36
37
|
astra: { contextWindow: 272_000, reasoning: "low" },
|
|
37
38
|
};
|
|
@@ -56,12 +57,11 @@ function normalizeContextWindow(
|
|
|
56
57
|
if (
|
|
57
58
|
typeof value === "number" &&
|
|
58
59
|
Number.isSafeInteger(value) &&
|
|
59
|
-
value >= MIN_CONTEXT_WINDOW
|
|
60
|
-
value <= fallback
|
|
60
|
+
value >= MIN_CONTEXT_WINDOW
|
|
61
61
|
)
|
|
62
62
|
return value;
|
|
63
63
|
configurationError(
|
|
64
|
-
`${alias}.contextWindow must be
|
|
64
|
+
`${alias}.contextWindow must be a safe integer of at least ${MIN_CONTEXT_WINDOW}; using the default`,
|
|
65
65
|
);
|
|
66
66
|
return fallback;
|
|
67
67
|
}
|
|
@@ -83,7 +83,7 @@ function normalizeReasoning(
|
|
|
83
83
|
return fallback;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
function normalizeGptSwitcherConfig(value: unknown): GptSwitcherConfig {
|
|
87
87
|
if (!isObject(value)) {
|
|
88
88
|
configurationError("configuration must be a JSON object; using defaults");
|
|
89
89
|
return structuredClone(DEFAULT_GPT_SWITCHER_CONFIG);
|
|
@@ -117,9 +117,7 @@ export function normalizeGptSwitcherConfig(value: unknown): GptSwitcherConfig {
|
|
|
117
117
|
) as GptSwitcherConfig;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
agentDir: string = getAgentDir(),
|
|
122
|
-
): string {
|
|
120
|
+
function getGptSwitcherConfigPath(agentDir: string = getAgentDir()): string {
|
|
123
121
|
return join(agentDir, CONFIG_BASENAME);
|
|
124
122
|
}
|
|
125
123
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-gpt-switcher",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Quick Pi commands for switching between GPT Codex models and reasoning levels.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,18 +45,17 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@earendil-works/pi-coding-agent": ">=0.
|
|
49
|
-
"@earendil-works/pi-tui": ">=0.
|
|
48
|
+
"@earendil-works/pi-coding-agent": ">=1.0.0",
|
|
49
|
+
"@earendil-works/pi-tui": ">=1.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@biomejs/biome": "^2.
|
|
53
|
-
"@earendil-works/pi-coding-agent": "
|
|
52
|
+
"@biomejs/biome": "^2.6.3",
|
|
53
|
+
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
54
54
|
"typescript": "^7.0.2"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
|
-
"check": "bun run lint && bun run typecheck
|
|
57
|
+
"check": "bun run lint && bun run typecheck",
|
|
58
58
|
"prepack": "bun run check",
|
|
59
|
-
"test": "bun test",
|
|
60
59
|
"typecheck": "tsgo --noEmit",
|
|
61
60
|
"lint": "biome check .",
|
|
62
61
|
"format": "biome check --write .",
|