@howaboua/pi-gpt-switcher 0.1.1 → 0.1.2
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 +4 -0
- package/README.md +5 -1
- package/biome.json +1 -1
- package/changelog.ts +11 -1
- package/codex-model-shortcuts.ts +3 -2
- package/config.ts +2 -1
- package/index.ts +11 -1
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Pi extension adding quick model commands:
|
|
|
7
7
|
| `/sol [reasoning]` | `openai-codex/gpt-5.6-sol` |
|
|
8
8
|
| `/terra [reasoning]` | `openai-codex/gpt-5.6-terra` |
|
|
9
9
|
| `/luna [reasoning]` | `openai-codex/gpt-5.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,
|
|
@@ -21,7 +22,8 @@ agent directory:
|
|
|
21
22
|
{
|
|
22
23
|
"sol": { "contextWindow": 272000, "reasoning": "high" },
|
|
23
24
|
"terra": { "contextWindow": 872000, "reasoning": "high" },
|
|
24
|
-
"luna": { "contextWindow": 472000, "reasoning": "xhigh" }
|
|
25
|
+
"luna": { "contextWindow": 472000, "reasoning": "xhigh" },
|
|
26
|
+
"astra": { "contextWindow": 272000, "reasoning": "low" }
|
|
25
27
|
}
|
|
26
28
|
```
|
|
27
29
|
|
|
@@ -30,6 +32,8 @@ reasoning. Changes apply on the next shortcut invocation and do not alter the
|
|
|
30
32
|
provider catalogue. Context windows may be lowered to 128k but not raised
|
|
31
33
|
above the shortcut's shipped limit.
|
|
32
34
|
|
|
35
|
+
Existing config files need no migration: omitted shortcuts use their shipped defaults.
|
|
36
|
+
|
|
33
37
|
## Install
|
|
34
38
|
|
|
35
39
|
```bash
|
package/biome.json
CHANGED
package/changelog.ts
CHANGED
|
@@ -182,9 +182,19 @@ function packageMarkdown(
|
|
|
182
182
|
registration: PackageRegistration,
|
|
183
183
|
entries: ChangelogEntry[],
|
|
184
184
|
): string {
|
|
185
|
+
const body = (entry: ChangelogEntry) =>
|
|
186
|
+
entry.content
|
|
187
|
+
.replace(/^##[^\n]*\n*/, "")
|
|
188
|
+
.replace(/^###\s+(?:Changes|Minor Changes|Patch Changes)\s*\n*/gim, "")
|
|
189
|
+
.replace(/^###\s+(.+)$/gm, "**$1**");
|
|
190
|
+
if (entries.length === 1) {
|
|
191
|
+
const [entry] = entries;
|
|
192
|
+
if (!entry) return "";
|
|
193
|
+
return `## ${registration.name} ${entry.version}\n\n${body(entry)}`;
|
|
194
|
+
}
|
|
185
195
|
return [
|
|
186
196
|
`## ${registration.name}`,
|
|
187
|
-
...entries.map((entry) => entry.
|
|
197
|
+
...entries.map((entry) => `**${entry.version}**\n\n${body(entry)}`),
|
|
188
198
|
].join("\n\n");
|
|
189
199
|
}
|
|
190
200
|
|
package/codex-model-shortcuts.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Adds short slash commands for
|
|
2
|
+
* Adds short slash commands for OpenAI Codex model variants.
|
|
3
3
|
* The commands use Pi's model registry, so normal provider authentication and
|
|
4
4
|
* model availability checks remain in charge.
|
|
5
5
|
*/
|
|
@@ -18,6 +18,7 @@ const MODELS = {
|
|
|
18
18
|
sol: "gpt-5.6-sol",
|
|
19
19
|
terra: "gpt-5.6-terra",
|
|
20
20
|
luna: "gpt-5.6-luna",
|
|
21
|
+
astra: "gpt-6-astra",
|
|
21
22
|
} as const;
|
|
22
23
|
|
|
23
24
|
type Alias = keyof typeof MODELS & ShortcutAlias;
|
|
@@ -42,7 +43,7 @@ export default function (
|
|
|
42
43
|
|
|
43
44
|
for (const alias of Object.keys(MODELS) as Alias[]) {
|
|
44
45
|
pi.registerCommand(alias, {
|
|
45
|
-
description: `Switch to GPT
|
|
46
|
+
description: `Switch to GPT-${alias === "astra" ? "6" : "5.6"} ${alias.charAt(0).toUpperCase()}${alias.slice(1)}`,
|
|
46
47
|
handler: async (args, ctx) => {
|
|
47
48
|
const defaults = getConfig()[alias];
|
|
48
49
|
const thinkingLevel = parseThinkingLevel(args, defaults.reasoning);
|
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
|
-
export const SHORTCUT_ALIASES = ["sol", "terra", "luna"] as const;
|
|
5
|
+
export 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"
|
|
@@ -34,6 +34,7 @@ export const DEFAULT_GPT_SWITCHER_CONFIG: GptSwitcherConfig = {
|
|
|
34
34
|
sol: { contextWindow: 272_000, reasoning: "high" },
|
|
35
35
|
terra: { contextWindow: 872_000, reasoning: "high" },
|
|
36
36
|
luna: { contextWindow: 472_000, reasoning: "xhigh" },
|
|
37
|
+
astra: { contextWindow: 272_000, reasoning: "low" },
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
const CONFIG_BASENAME = "pi-gpt-switcher.json";
|
package/index.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
/** Pi package entry point for the Codex model shortcut extension. */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
import registerPackageChangelog from "./changelog.js";
|
|
5
|
+
import registerCodexModelShortcuts from "./codex-model-shortcuts.js";
|
|
6
|
+
|
|
7
|
+
export default function gptSwitcher(
|
|
8
|
+
pi: ExtensionAPI,
|
|
9
|
+
options: Parameters<typeof registerCodexModelShortcuts>[1] = {},
|
|
10
|
+
): void {
|
|
11
|
+
registerPackageChangelog(pi);
|
|
12
|
+
registerCodexModelShortcuts(pi, options);
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-gpt-switcher",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Quick Pi commands for switching between GPT
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Quick Pi commands for switching between GPT Codex models and reasoning levels.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Igor Warzocha",
|
|
@@ -41,18 +41,17 @@
|
|
|
41
41
|
],
|
|
42
42
|
"pi": {
|
|
43
43
|
"extensions": [
|
|
44
|
-
"./changelog.ts",
|
|
45
44
|
"./index.ts"
|
|
46
45
|
]
|
|
47
46
|
},
|
|
48
47
|
"peerDependencies": {
|
|
49
|
-
"@earendil-works/pi-coding-agent": ">=0.
|
|
50
|
-
"@earendil-works/pi-tui": "
|
|
48
|
+
"@earendil-works/pi-coding-agent": ">=0.84.3",
|
|
49
|
+
"@earendil-works/pi-tui": ">=0.84.3"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
|
-
"@biomejs/biome": "^2.
|
|
54
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
55
|
-
"typescript": "^
|
|
52
|
+
"@biomejs/biome": "^2.5.10",
|
|
53
|
+
"@earendil-works/pi-coding-agent": "0.85.0",
|
|
54
|
+
"typescript": "^7.0.2"
|
|
56
55
|
},
|
|
57
56
|
"scripts": {
|
|
58
57
|
"check": "bun run lint && bun run typecheck && bun run test",
|