pi-cliproxyapi-native 0.3.2 → 0.3.3

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
@@ -36,10 +36,10 @@ The extension targets Pi 1.4.0 and CLIProxyAPI 8.0.48, with Node.js 22.19 or new
36
36
  If you installed `pi-cliproxy-native`, remove it before installing the renamed package. Both register the same `cliproxyapi` provider.
37
37
 
38
38
  ```sh
39
- pi install npm:pi-cliproxyapi-native@0.3.2
39
+ pi install npm:pi-cliproxyapi-native@0.3.3
40
40
  ```
41
41
 
42
- For Git installation, use `pi install git:github.com/hawkff/pi-cliproxyapi-native@v0.3.2`. For a local checkout, use `pi install /path/to/pi-cliproxyapi-native`.
42
+ For Git installation, use `pi install git:github.com/hawkff/pi-cliproxyapi-native@v0.3.3`. For a local checkout, use `pi install /path/to/pi-cliproxyapi-native`.
43
43
 
44
44
  The default proxy address is `http://localhost:8317`. For another address, set the [connection](#connection) before logging in. Restart Pi, then run:
45
45
 
@@ -376,7 +376,13 @@ Run `/reload` after changing settings and `/cliproxyapi-refresh` before starting
376
376
 
377
377
  ## Protocol notes
378
378
 
379
- Claude uses the legacy fine-grained tool-streaming header in place of eager tool fields. The extension disables unverified deferred-tool and strict-tool capabilities. Responses function tools use `strict: null` when Pi omits strictness, so optional arguments remain optional. Explicit payload hooks retain final control.
379
+ Claude uses the legacy fine-grained tool-streaming header in place of eager tool fields.
380
+
381
+ GPT models keep Pi's OpenAI Responses capabilities when the proxy lists them as owned by OpenAI. These capabilities are strict tools, grammar tools such as codemode, tool declarations added mid-conversation, tool search, and instructions placed mid-conversation. Each passed live checks through CLIProxyAPI 8.0.48 with an OpenAI API key and with a ChatGPT subscription. OpenAI-compatible providers and other model families keep these capabilities off.
382
+
383
+ On `api/` routes, Pi can send thinking effort as a `configuration_update` item. ChatGPT subscriptions ignore that item, so unprefixed and `oauth/` routes send the effort as a request field.
384
+
385
+ When Pi omits strictness in the top-level Responses tool list, the extension sends `strict: null`, so optional arguments remain optional. Tools declared inside the conversation keep Pi's strictness values. Explicit payload hooks retain final control.
380
386
 
381
387
  OpenAI images POST `model`, `prompt`, `n`, and supplied controls to `/v1/images/generations`, without `response_format`. Editing uses `/v1/images/edits` with JSON `images` and optional `mask` data URLs. A nonzero `partial_images` adds `stream: true`, and the extension reads server-sent events. Each `*.partial_image` frame becomes a progress preview, and the `*.completed` frame carries the final image and usage. xAI uses the same route with `response_format: "b64_json"`. Gemini uses `/v1beta/models/{id}:generateContent`. Media generation sends the prompt and generation options without chat history, system instructions, or tools.
382
388
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-cliproxyapi-native",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "CLIProxyAPI chat discovery, image generation and editing, and video generation with Pi's native adapters",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/catalog.ts CHANGED
@@ -332,6 +332,16 @@ export function mapCatalog(value: unknown, config: Config, known: readonly Model
332
332
  skipped.add(entry.id);
333
333
  continue;
334
334
  }
335
+ // CLIProxyAPI 8.0.48 forwards strict and grammar tools, additional_tools, tool search, and
336
+ // mid-conversation instructions to OpenAI API keys and ChatGPT subscriptions (live-checked).
337
+ // Other owners stay conservative. If an OpenAI-compatible provider shares a bare ID, the proxy
338
+ // lists one owner, and its Chat translator converts these items for that provider.
339
+ const openai =
340
+ api === "openai-responses" &&
341
+ !metadataId.includes("/") &&
342
+ (!prefix || prefix === "api" || prefix === "oauth") &&
343
+ (preferred === "openai" || preferred === "openai-codex") &&
344
+ (reference.provider === "openai" || reference.provider === "openai-codex");
335
345
  const model: Model<CpaApi> = {
336
346
  ...structuredClone(reference),
337
347
  id: entry.id,
@@ -353,15 +363,19 @@ export function mapCatalog(value: unknown, config: Config, known: readonly Model
353
363
  }
354
364
  : api === "google-generative-ai"
355
365
  ? reference.compat
356
- : {
357
- ...reference.compat,
358
- supportsStrictMode: false,
359
- supportsMidConvoSystemMessages: false,
360
- supportsMidConvoToolAdditions: false,
361
- supportsOpenAIGrammarTools: false,
362
- supportsToolSearch: false,
363
- supportsAdditionalTools: false,
364
- },
366
+ : openai
367
+ ? // ChatGPT subscriptions ignore configuration_update effort items; only API keys apply them.
368
+ { ...reference.compat, ...(prefix === "api" ? {} : { supportsMidConvoEffort: false }) }
369
+ : {
370
+ ...reference.compat,
371
+ supportsStrictMode: false,
372
+ supportsMidConvoSystemMessages: false,
373
+ supportsMidConvoToolAdditions: false,
374
+ supportsOpenAIGrammarTools: false,
375
+ supportsToolSearch: false,
376
+ supportsAdditionalTools: false,
377
+ supportsMidConvoEffort: false,
378
+ },
365
379
  };
366
380
  models.set(model.id, model);
367
381
  skipped.delete(model.id);