@gtrabanco/pi-nan-provider 1.5.8 → 1.6.0

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/AGENTS.md CHANGED
@@ -416,8 +416,44 @@ Since 1.0.0 the package version **aligns its MAJOR.MINOR with the pi release lin
416
416
  `src/reasoning-only-stream-guard.ts` (issue #21) keys on that marker;
417
417
  earlier comment/message text said "60,000 characters" and was corrected to
418
418
  the documented figures.
419
- - **pi 1.4.0 / pi-ai 1.4.0 compat** (verified 2026-10-24, the current verified
420
- baseline): devDependencies bumped 1.3.0 → 1.4.0; **the peer range floor rose to
419
+ - **pi 1.6.0 / pi-ai 1.6.0 compat** (verified 2026-11-21, the current verified
420
+ baseline; devDependencies 1.5.1 → 1.6.0, package 1.5.8 → 1.6.0, peer range
421
+ unchanged at `^1.4.0` because nothing here needs 1.6.0). **No `src/` change:** pi-ai
422
+ `dist/index.d.ts`, `dist/compat.d.ts`, `dist/api/openai-completions.d.ts` and
423
+ pi-coding-agent `dist/index.d.ts` are byte-identical to 1.5.1, and a base-vs-change
424
+ capture of every catalog model × `off`/`low`/`max` (tool history + thinking blocks
425
+ included) is byte-identical on the wire. What DID move, and why it does or does not
426
+ touch this package:
427
+ - `detectCompat()` now defaults `supportsDeveloperRole` to **true only for
428
+ api.openai.com** (#10741), sending `system` everywhere else. The generated catalog
429
+ pins `supportsDeveloperRole: false` per entry, so NaN's wire never moved — pinned by
430
+ `test/pi-ai-1-6-0-contract.test.ts`.
431
+ - `parseChunkUsage` falls back to a **top-level `usage.reasoning_tokens`** when
432
+ `completion_tokens_details.reasoning_tokens` is absent (0 on 1.5.1). NaN reports the
433
+ nested field, so this is tolerance only.
434
+ - `RETRYABLE_PROVIDER_ERROR_PATTERN` gains `connection.?closed`, bare
435
+ `ECONNRESET|ECONNABORTED|ECONNREFUSED|ETIMEDOUT|EPIPE` (lookaround-guarded),
436
+ `connection reset by peer` and the Codex websocket lifetime text (#12064, #12128,
437
+ #12124). Directly relevant to NaN's LiteLLM gateway, which closes SSE streams
438
+ mid-turn (issue #2): those drops are now retried with no package change. The
439
+ deterministic NaN 400 stays non-retryable.
440
+ - `constrained-sampling.js` rejects schema nodes without `type` in strict mode
441
+ (#12049). Unreachable for NaN: `openai-completions` keeps
442
+ `supportsStrictMode: false` in `detectCompat()`, so no `strict` field is ever sent
443
+ (pinned by the same contract test). The `supportsStrictMode` compat key itself is
444
+ documented and added to the Mistral schema only.
445
+ - pi-coding-agent: the **breaking** change (extension components `render()` returning
446
+ `readonly string[]`) does not apply — this package registers no TUI components;
447
+ `core/model-resolver.d.ts` drops `resolveModelScope` / `restoreModelFromSession`
448
+ (never imported); `ExtensionRuntime.reportError` is additive. Upstream fixes that
449
+ help NaN users: MCP `tool_search` tools survive resume/`/reload`, and
450
+ `AgentSession.reload()` emits `session_start` again under
451
+ `bindExtensions({})`, so the media MCP server reconnects.
452
+ - `env-api-keys.js` gains the Qwen Token Plan per-plan variables; `PI_AI_VERSION` is
453
+ `1.6.0`. Neither is used by this package.
454
+ Regression test: `test/pi-ai-1-6-0-contract.test.ts` (RED on 1.5.1 for the flat
455
+ reasoning-token and retry-coverage groups, green on 1.6.0). Issue #45.
456
+ - **pi 1.4.0 / pi-ai 1.4.0 compat** (verified 2026-10-24): devDependencies bumped 1.3.0 → 1.4.0; **the peer range floor rose to
421
457
  `"^1.3.0"`** and the version-gated cross-model thinking guard plus
422
458
  `src/pi-ai-version.ts` were REMOVED as scheduled (pi-ai >= 1.3.0 drops
423
459
  cross-model thinking itself). The pi-ai 1.4.0 type surface only ADDS exports
@@ -587,7 +623,7 @@ uno cite una versión o requisito que el otro no lleve.
587
623
  5. **Cita el peer floor real, no la historia.** El peer range se actualiza con cada
588
624
  release de pi: lee `package.json` peerDependencies, no AGENTS.md (que documenta
589
625
  releases históricos y puede quedar obsoleto). Para este paquete: el floor es
590
- `^1.4.0` (desde package 1.5.0), verificado contra pi 1.5.1 / pi-ai 1.5.1.
626
+ `^1.4.0` (desde package 1.5.0), verificado contra pi 1.6.0 / pi-ai 1.6.0.
591
627
  6. **Las cifras de catálogo van contra `scripts/models.generated.ts`, no contra AGENTS.md.**
592
628
  AGENTS.md es documentación de releases y puede contener floor o ranges ya antiguos;
593
629
  el catálogo generado es la fuente viva de `contextWindow`/`maxTokens`/`reasoningEffortValues`
package/README.es.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @gtrabanco/𝜋-nan-provider
2
2
 
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
- [![Version](https://img.shields.io/badge/version-1.5.9-blue)](https://github.com/gtrabanco/pi-nan-provider/releases)
4
+ [![Version](https://img.shields.io/badge/version-1.6.0-blue)](https://github.com/gtrabanco/pi-nan-provider/releases)
5
5
  [![Built with NaN](https://nan.builders/badge/built-with-nan-compact.svg)](https://cloud.nan.builders/r/7GK06FX8)
6
6
 
7
7
  [NaN Builders](https://cloud.nan.builders/r/7GK06FX8) model provider + MCP nativo para [pi](https://github.com/earendil-works/pi).
@@ -9,7 +9,7 @@
9
9
  Registra el proveedor `nan` vía `pi.registerProvider()` usando la API OpenAI-compatible de NaN (`https://api.nan.builders/v1`), y registra el servidor MCP de media de la comunidad con `pi.registerMcpServer()`.
10
10
 
11
11
  > [!NOTE]
12
- > **Requisitos:** pi **≥ 1.4.0** (rango peer `^1.4.0`). El paquete está verificado contra **pi 1.5.1 / pi-ai 1.5.1**; el floor del rango peer solo sube con los re-aligns de menor de pi.
12
+ > **Requisitos:** pi **≥ 1.4.0** (rango peer `^1.4.0`). El paquete está verificado contra **pi 1.6.0 / pi-ai 1.6.0**; el floor del rango peer solo sube con los re-aligns de menor de pi.
13
13
 
14
14
  ## ✨ Funciones
15
15
 
@@ -120,7 +120,7 @@ Puedes sobrescribir el `compat` de cualquier modelo en `~/.pi/agent/models.json`
120
120
 
121
121
  > Poner `supportsFinishReason: false` restaura el antiguo stall silencioso — no recomendado.
122
122
 
123
- **Escape hatches de compatibilidad de pi-ai 1.5.1** (`~/.pi/agent/models.json`, por modelo): `compat.requiresToolsWithToolHistory: true` restaura el envío de `tools: []` en conversaciones con historial de tools (pi-ai 1.5.1 lo omite por defecto, arreglando los rechazos `tools must not be an empty array` de vLLM 0.20+ detrás de LiteLLM); `compat.requiresNonNullAssistantContent: true` envía `""` en vez de `null` en mensajes de asistente que solo llevan tool calls; `compat.promptCacheKeyMode: "disabled"` garantiza que nunca se envíe `prompt_cache_key` al gateway (el valor por defecto `auto` ya nunca lo activa para NaN).
123
+ **Escape hatches de compatibilidad de pi-ai 1.5.1+** (`~/.pi/agent/models.json`, por modelo, sin cambios en 1.6.0): `compat.requiresToolsWithToolHistory: true` restaura el envío de `tools: []` en conversaciones con historial de tools (pi-ai 1.5.1 lo omite por defecto, arreglando los rechazos `tools must not be an empty array` de vLLM 0.20+ detrás de LiteLLM); `compat.requiresNonNullAssistantContent: true` envía `""` en vez de `null` en mensajes de asistente que solo llevan tool calls; `compat.promptCacheKeyMode: "disabled"` garantiza que nunca se envíe `prompt_cache_key` al gateway (el valor por defecto `auto` ya nunca lo activa para NaN).
124
124
 
125
125
  **Uso de tokens en streaming:** `supportsUsageInStreaming` es `true` por defecto. El esquema publicado de NaN no documenta `stream_options`, pero el gateway real lo acepta y lo aplica — medido el 2026-09-16 ([#7](https://github.com/gtrabanco/pi-nan-provider/issues/7)): dos llamadas de streaming idénticas por modelo, 0 chunks de usage sin el flag y exactamente 1 con él, en `deepseek-v4-flash`, `glm5.3-flash`, `qwen3.6`, `gemma4` y `mimo-v2.5` (ya eliminado). Por eso pi muestra tokens reales de entrada/salida/reasoning/caché en lugar de ceros. Si un modelo resulta no devolver el usage en streaming, desactívalo por modelo — el sanitizer entonces elimina `stream_options` y el payload vuelve a ser estricto:
126
126
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @gtrabanco/𝜋-nan-provider
2
2
 
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
- [![Version](https://img.shields.io/badge/version-1.5.9-blue)](https://github.com/gtrabanco/pi-nan-provider/releases)
4
+ [![Version](https://img.shields.io/badge/version-1.6.0-blue)](https://github.com/gtrabanco/pi-nan-provider/releases)
5
5
  [![Built with NaN](https://nan.builders/badge/built-with-nan-compact.svg)](https://cloud.nan.builders/r/7GK06FX8)
6
6
 
7
7
  [NaN Builders](https://cloud.nan.builders/r/7GK06FX8) model provider + a native MCP server for [pi](https://github.com/earendil-works/pi).
@@ -9,7 +9,7 @@
9
9
  Registers the `nan` provider via `pi.registerProvider()` using NaN's OpenAI-compatible API (`https://api.nan.builders/v1`), and registers the community media MCP server via pi's native `pi.registerMcpServer()`.
10
10
 
11
11
  > [!NOTE]
12
- > **Requirements:** pi **≥ 1.4.0** (peer range `^1.4.0`). The package is verified against **pi 1.5.1 / pi-ai 1.5.1**; the peer floor only rises on pi minor realigns.
12
+ > **Requirements:** pi **≥ 1.4.0** (peer range `^1.4.0`). The package is verified against **pi 1.6.0 / pi-ai 1.6.0**; the peer floor only rises on pi minor realigns.
13
13
 
14
14
  ## ✨ Features
15
15
 
@@ -120,7 +120,7 @@ You can override any model's `compat` per-model in `~/.pi/agent/models.json` (pi
120
120
 
121
121
  > Setting `supportsFinishReason: false` restores the old silent-stall behavior — not recommended.
122
122
 
123
- **pi-ai 1.5.1 compat escape hatches** (`~/.pi/agent/models.json`, per model): `compat.requiresToolsWithToolHistory: true` restores sending `tools: []` in conversations with tool history (pi-ai 1.5.1 omits it by default, fixing vLLM 0.20+ `tools must not be an empty array` rejections behind LiteLLM); `compat.requiresNonNullAssistantContent: true` sends `""` instead of `null` in assistant messages that only carry tool calls; `compat.promptCacheKeyMode: "disabled"` guarantees `prompt_cache_key` is never sent to the gateway (the default `auto` already never enables it for NaN).
123
+ **pi-ai 1.5.1+ compat escape hatches** (`~/.pi/agent/models.json`, per model, unchanged in 1.6.0): `compat.requiresToolsWithToolHistory: true` restores sending `tools: []` in conversations with tool history (pi-ai 1.5.1 omits it by default, fixing vLLM 0.20+ `tools must not be an empty array` rejections behind LiteLLM); `compat.requiresNonNullAssistantContent: true` sends `""` instead of `null` in assistant messages that only carry tool calls; `compat.promptCacheKeyMode: "disabled"` guarantees `prompt_cache_key` is never sent to the gateway (the default `auto` already never enables it for NaN).
124
124
 
125
125
  **Streaming token usage:** `supportsUsageInStreaming` is `true` by default. NaN's published schema does not document `stream_options`, but the live gateway honors it — measured 2026-09-16 ([#7](https://github.com/gtrabanco/pi-nan-provider/issues/7)): two identical streaming calls per model, 0 usage chunks without the flag and exactly 1 with it, on `deepseek-v4-flash`, `glm5.3-flash`, `qwen3.6`, `gemma4` and `mimo-v2.5` (since removed). pi therefore reports real input/output/reasoning/cache token counts instead of zeros. If a model turns out not to report streaming usage, opt out per model — the request sanitizer then strips `stream_options` and the payload stays strict:
126
126
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtrabanco/pi-nan-provider",
3
- "version": "1.5.8",
3
+ "version": "1.6.0",
4
4
  "description": "NaN Builders (api.nan.builders) model provider for pi - OpenAI-compatible registration with a models.dev-generated fallback, tier-aware live catalog, and an optional community media MCP bridge",
5
5
  "keywords": [
6
6
  "pi",
@@ -47,8 +47,8 @@
47
47
  "@earendil-works/pi-coding-agent": "^1.4.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@earendil-works/pi-ai": "1.5.1",
51
- "@earendil-works/pi-coding-agent": "1.5.1",
50
+ "@earendil-works/pi-ai": "1.6.0",
51
+ "@earendil-works/pi-coding-agent": "1.6.0",
52
52
  "@types/bun": "1.4",
53
53
  "typescript": "7"
54
54
  },
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated by scripts/generate-models.ts
2
2
  // Do not edit manually — run `bun run generate-models` to update.
3
3
  //
4
- // Source: https://models.dev/api.json (provider "nan"), fetched 2026-11-18T22:57:47.883Z
4
+ // Source: https://models.dev/api.json (provider "nan"), fetched 2026-11-21T10:25:10.741Z
5
5
  // Provenance: every contextWindow/maxTokens/input/cost value traces to
6
6
  // models.dev or to the per-entry notes below. Nothing is invented; entries
7
7
  // models.dev documents incompletely are omitted and flagged instead.
@@ -136,7 +136,7 @@ export const NAN_GENERATED_MODELS: readonly GeneratedModelEntry[] = [
136
136
  "id": "deepseek-v4-pro",
137
137
  "name": "DeepSeek V4 Pro 0813",
138
138
  "description": "DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes",
139
- "family": "deepseek-thinking",
139
+ "family": "deepseek-pro",
140
140
  "attachment": false,
141
141
  "reasoning": true,
142
142
  "reasoning_options": [
@@ -480,7 +480,7 @@ export const NAN_GENERATED_MODELS: readonly GeneratedModelEntry[] = [
480
480
  "id": "hy4",
481
481
  "name": "Hy4",
482
482
  "description": "A next-generation multimodal productivity model with significantly enhanced Agent and complex task execution capabilities.",
483
- "family": "Hy",
483
+ "family": "hy",
484
484
  "attachment": true,
485
485
  "reasoning": true,
486
486
  "reasoning_options": [
@@ -591,7 +591,7 @@ export const NAN_GENERATED_MODELS: readonly GeneratedModelEntry[] = [
591
591
  "id": "kimi-k3.1-pro",
592
592
  "name": "Kimi K3.1 Pro",
593
593
  "description": "Multimodal Kimi model with a 1M-token context window and always-on reasoning, for coding, 3D creation and financial research",
594
- "family": "kimi-k3",
594
+ "family": "kimi-pro",
595
595
  "attachment": true,
596
596
  "reasoning": true,
597
597
  "reasoning_options": [
@@ -676,7 +676,7 @@ export const NAN_GENERATED_MODELS: readonly GeneratedModelEntry[] = [
676
676
  "id": "mimo-v2.6-flash",
677
677
  "name": "MiMo-V2.6-Flash",
678
678
  "description": "MiMo Flash model for multimodal coding agents and long-context automation",
679
- "family": "mimo",
679
+ "family": "mimo-flash",
680
680
  "attachment": true,
681
681
  "reasoning": true,
682
682
  "reasoning_options": [
@@ -849,7 +849,7 @@ export const NAN_GENERATED_MODELS: readonly GeneratedModelEntry[] = [
849
849
  "id": "qwen3.8-flash",
850
850
  "name": "Qwen3.8 Flash",
851
851
  "description": "Qwen vision-language model for visual reasoning, documents, and agent tasks",
852
- "family": "qwen",
852
+ "family": "qwen-flash",
853
853
  "attachment": true,
854
854
  "reasoning": true,
855
855
  "reasoning_options": [
@@ -937,7 +937,7 @@ export const NAN_GENERATED_MODELS: readonly GeneratedModelEntry[] = [
937
937
  "id": "qwen3.8-max",
938
938
  "name": "Qwen3.8 Max",
939
939
  "description": "2.4-trillion-parameter MoE flagship for coding, professional work, multimodal understanding, and long-horizon agentic workflows",
940
- "family": "qwen",
940
+ "family": "qwen-max",
941
941
  "attachment": true,
942
942
  "reasoning": true,
943
943
  "reasoning_options": [
@@ -1027,7 +1027,7 @@ export const NAN_GENERATED_MODELS: readonly GeneratedModelEntry[] = [
1027
1027
  export const GENERATED_CATALOG_META = {
1028
1028
  source: "https://models.dev/api.json",
1029
1029
  modelsDevProvider: "nan",
1030
- fetchedAt: "2026-11-18T22:57:47.883Z",
1030
+ fetchedAt: "2026-11-21T10:25:10.741Z",
1031
1031
  modelCount: 13,
1032
1032
  models: ["deepseek-v4-flash","deepseek-v4-pro","gemma4","glm5.3","glm5.3-flash","hy4","hy4-flash","kimi-k3.1-pro","mimo-v2.6-flash","qwen3.6","qwen3.8-flash","qwen3.8-max","qwen4-max"],
1033
1033
  notes: [