@monotykamary/pi-better-openai 0.1.38 → 0.1.40

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 CHANGED
@@ -89,7 +89,7 @@ Example config:
89
89
  },
90
90
  "image": {
91
91
  "enabled": true,
92
- "defaultModel": "gpt-image-2",
92
+ "defaultModel": "gpt-image-2.5",
93
93
  "defaultSave": "project",
94
94
  "outputFormat": "png",
95
95
  "timeoutMs": 180000
@@ -147,7 +147,7 @@ Agents can call the `openai_image` tool directly. Supported parameters:
147
147
  - `prompt` (required): pass the user's image wording verbatim.
148
148
  - `action`: `auto`, `generate`, or `edit`. `auto` uses the edit endpoint when `images` are supplied; explicit `edit` requires images, while explicit `generate` does not accept them.
149
149
  - `images`: up to five distinct project-local reference/edit image paths. Paths must stay inside the current workspace and point to readable PNG, JPEG, WebP, or GIF files; each file is limited to 20 MB and the combined input to 50 MB.
150
- - `model`: GPT Image model override for the standalone Codex Images API, for example `gpt-image-2`.
150
+ - `model`: GPT Image model override for the standalone Codex Images API, for example `gpt-image-2.5` or `gpt-image-2`. Values outside the `gpt-image-` family, including legacy Responses chat models, are replaced with the configured default image model.
151
151
  - `outputFormat`: `png`, `jpeg`, or `webp`. Codex returns PNG and the extension converts other formats locally.
152
152
  - `save`: `project`, `global`, `custom`, or `none`.
153
153
  - `saveDir`: required for `save: "custom"` unless `PI_IMAGE_SAVE_DIR` is set.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monotykamary/pi-better-openai",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "Improve OpenAI in pi with fast mode, usage stats, realtime voice, image generation, and footer polish.",
5
5
  "keywords": [
6
6
  "fast",
@@ -57,14 +57,14 @@
57
57
  "dependencies": {
58
58
  "https-proxy-agent": "9.1.0",
59
59
  "proxy-from-env": "2.1.0",
60
- "sharp": "0.35.3",
60
+ "sharp": "0.35.4",
61
61
  "undici": "8.10.0",
62
62
  "ws": "8.21.2"
63
63
  },
64
64
  "devDependencies": {
65
- "@earendil-works/pi-ai": "0.85.0",
66
- "@earendil-works/pi-coding-agent": "0.85.0",
67
- "@earendil-works/pi-tui": "0.85.0",
65
+ "@earendil-works/pi-ai": "0.85.1",
66
+ "@earendil-works/pi-coding-agent": "0.85.1",
67
+ "@earendil-works/pi-tui": "0.85.1",
68
68
  "@types/node": "~22.19.0",
69
69
  "@types/proxy-from-env": "1.0.4",
70
70
  "@types/ws": "8.18.1",
@@ -86,8 +86,8 @@
86
86
  "@oh-my-pi/pi-natives-win32-x64": "17.2.9"
87
87
  },
88
88
  "overrides": {
89
- "@earendil-works/pi-agent-core": "0.85.0",
90
- "@earendil-works/pi-ai": "0.85.0",
89
+ "@earendil-works/pi-agent-core": "0.85.1",
90
+ "@earendil-works/pi-ai": "0.85.1",
91
91
  "brace-expansion": "5.0.9",
92
92
  "nanoid": "3.3.18",
93
93
  "postcss": "8.5.25",
@@ -4,8 +4,7 @@ import {
4
4
  type Provider,
5
5
  type RefreshModelsContext,
6
6
  } from "@earendil-works/pi-ai";
7
- import { openAICodexResponsesApi } from "@earendil-works/pi-ai/api/openai-codex-responses.lazy";
8
- import { openaiCodexProvider } from "@earendil-works/pi-ai/providers/openai-codex";
7
+ import { builtinProviders } from "@earendil-works/pi-ai/providers/all";
9
8
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
10
9
 
11
10
  const CODEX_API = "openai-codex-responses" as const;
@@ -184,7 +183,11 @@ async function fetchCodexModels(
184
183
  export function createOpenAICodexProvider(
185
184
  options: CreateCodexProviderOptions = {},
186
185
  ): Provider<typeof CODEX_API> {
187
- const builtIn = openaiCodexProvider();
186
+ // Use the loader-supported aggregate export and retain the host's native transport.
187
+ const builtIn = builtinProviders().find(
188
+ (provider): provider is Provider<typeof CODEX_API> => provider.id === CODEX_PROVIDER_ID,
189
+ );
190
+ if (!builtIn) throw new Error("The pi host does not provide OpenAI Codex");
188
191
  return createProvider({
189
192
  id: builtIn.id,
190
193
  name: builtIn.name,
@@ -194,7 +197,7 @@ export function createOpenAICodexProvider(
194
197
  models: appendMissingCodexModels(builtIn.getModels()),
195
198
  fetchModels: (context) => fetchCodexModels(context, options),
196
199
  filterModels: builtIn.filterModels,
197
- api: openAICodexResponsesApi(),
200
+ api: builtIn,
198
201
  });
199
202
  }
200
203
 
package/src/config.ts CHANGED
@@ -146,7 +146,9 @@ export const DEFAULT_FOOTER_CONFIG: Required<FooterConfig> = {
146
146
  mode: "replace",
147
147
  };
148
148
 
149
- export const DEFAULT_IMAGE_MODEL = "gpt-image-2";
149
+ export const IMAGE_MODEL_CHOICES = ["gpt-image-2.5", "gpt-image-2"] as const;
150
+
151
+ export const DEFAULT_IMAGE_MODEL = "gpt-image-2.5";
150
152
 
151
153
  export const DEFAULT_IMAGE_CONFIG: Required<ImageConfig> = {
152
154
  enabled: true,
@@ -313,7 +315,7 @@ export const IMAGE_SETTING_DESCRIPTORS: readonly SettingsOptionDescriptor[] = [
313
315
  key: "defaultModel",
314
316
  label: "Image model",
315
317
  currentValue: (cfg) => cfg.image.defaultModel,
316
- values: ["gpt-image-2"],
318
+ values: IMAGE_MODEL_CHOICES,
317
319
  description: "GPT Image model used by the standalone Codex Images API.",
318
320
  parse: stringSetting,
319
321
  },
@@ -606,7 +608,7 @@ export function readRawConfig(path: string): Record<string, unknown> {
606
608
  export function normalizeImageModel(value: string): string {
607
609
  const trimmed = value.trim();
608
610
  const model = trimmed.includes("/") ? trimmed.split("/").pop() || trimmed : trimmed;
609
- return model.startsWith("gpt-5") ? DEFAULT_IMAGE_MODEL : model;
611
+ return model.startsWith("gpt-image-") ? model : DEFAULT_IMAGE_MODEL;
610
612
  }
611
613
 
612
614
  export function readConfig(path: string): ConfigFile | undefined {