@monotykamary/pi-opencode-provider 1.0.5 → 1.0.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/AGENTS.md CHANGED
@@ -7,6 +7,7 @@ The following files are **idempotent** and regenerated by `scripts/update-models
7
7
  | File | Why it's auto-generated |
8
8
  |------|------------------------|
9
9
  | `models.json` | Built from the provider API. `update-models.js` fetches models, preserves curated data for known IDs, and writes this file. |
10
+ | `deprecated-models.json` | Graveyard for models the API delisted. update-models.js stamps them with deprecatedAt and pi keeps serving them for a 2-week grace period, then evicts them. Never edit by hand. |
10
11
  | `README.md` (model table) | The table under `## Available Models` is replaced in-place by `update-models.js` after merging base models → patch → custom models. |
11
12
 
12
13
  ## Correct Files to Edit
package/README.md CHANGED
@@ -15,7 +15,7 @@ _GPT, Claude, Gemini, GLM, MiniMax, Kimi, DeepSeek — unified API for [pi](http
15
15
 
16
16
  ## Features
17
17
 
18
- - **52+ AI Models** including GPT-5.x Codex, Claude Opus/Sonnet/Haiku, Gemini 3.x, GLM, MiniMax, Kimi K2.5, and more
18
+ - **60+ AI Models** including GPT-5.x Codex, Claude Opus/Sonnet/Haiku, Gemini 3.x, GLM, MiniMax, Kimi K2.5, and more
19
19
  - **Multi-API Support** — uses the correct API protocol per model (Anthropic, OpenAI Responses, OpenAI Completions, Gemini)
20
20
  - **Cost Tracking** with per-model pricing for budget management
21
21
  - **Reasoning Models** with thinking level maps for proper effort control
@@ -82,6 +82,7 @@ pi
82
82
  | Claude Opus 4.6 | Anthropic | Text + Image | 1.0M | 128K | $5.00 | $25.00 |
83
83
  | Claude Opus 4.7 | Anthropic | Text + Image | 1.0M | 128K | $5.00 | $25.00 |
84
84
  | Claude Opus 4.8 | Anthropic | Text + Image | 1.0M | 128K | $5.00 | $25.00 |
85
+ | Claude Opus 5 | Anthropic | Text + Image | 1.0M | 128K | $5.00 | $25.00 |
85
86
  | Claude Sonnet 4 | Anthropic | Text + Image | 1.0M | 64K | $3.00 | $15.00 |
86
87
  | Claude Sonnet 4.5 | Anthropic | Text + Image | 1.0M | 64K | $3.00 | $15.00 |
87
88
  | Claude Sonnet 4.6 | Anthropic | Text + Image | 1.0M | 64K | $3.00 | $15.00 |
@@ -92,6 +93,8 @@ pi
92
93
  | Gemini 3 Flash | Gemini | Text + Image | 1.0M | 66K | $0.50 | $3.00 |
93
94
  | Gemini 3.1 Pro Preview | Gemini | Text + Image | 1.0M | 66K | $2.00 | $12.00 |
94
95
  | Gemini 3.5 Flash | Gemini | Text + Image | 1.0M | 66K | $1.50 | $9.00 |
96
+ | Gemini 3.5 Flash Lite | Gemini | Text + Image | 1.0M | 66K | $0.30 | $2.50 |
97
+ | Gemini 3.6 Flash | Gemini | Text + Image | 1.0M | 66K | $1.50 | $7.50 |
95
98
  | GLM-5 | Completions | Text | 205K | 131K | $1.00 | $3.20 |
96
99
  | GLM-5.1 | Completions | Text | 205K | 131K | $1.40 | $4.40 |
97
100
  | GLM-5.2 | Completions | Text | 1.0M | 131K | $1.40 | $4.40 |
@@ -112,12 +115,17 @@ pi
112
115
  | GPT-5.4 Pro | Responses | Text + Image | 1.1M | 128K | $30.00 | $180.00 |
113
116
  | GPT-5.5 | Responses | Text + Image | 1.1M | 128K | $5.00 | $30.00 |
114
117
  | GPT-5.5 Pro | Responses | Text + Image | 1.1M | 128K | $30.00 | $180.00 |
115
- | Grok 4.5 | Completions | Text + Image | 500K | 500K | $2.00 | $6.00 |
118
+ | GPT-5.6 Luna | Responses | Text + Image | 1.1M | 128K | $1.00 | $6.00 |
119
+ | GPT-5.6 Sol | Responses | Text + Image | 1.1M | 128K | $5.00 | $30.00 |
120
+ | GPT-5.6 Terra | Responses | Text + Image | 1.1M | 128K | $2.50 | $15.00 |
121
+ | Grok 4.5 | Responses | Text + Image | 500K | 500K | $2.00 | $6.00 |
116
122
  | Grok Build 0.1 | Completions | Text + Image | 256K | 256K | $1.00 | $2.00 |
117
- | Hy3 Free | Completions | Text | 256K | 64K | Free | Free |
118
123
  | Kimi K2.5 | Completions | Text + Image | 262K | 66K | $0.60 | $3.00 |
119
124
  | Kimi K2.6 | Completions | Text + Image | 262K | 66K | $0.95 | $4.00 |
120
125
  | Kimi K2.7 Code | Completions | Text + Image | 262K | 262K | $0.95 | $4.00 |
126
+ | Kimi K3 | Completions | Text + Image | 1.0M | 131K | $3.00 | $15.00 |
127
+ | Laguna S 2.1 Free | Completions | Text | 256K | 32K | Free | Free |
128
+ | Ling-3.0-flash Free | Completions | Text | 262K | 33K | Free | Free |
121
129
  | MiMo V2.5 Free | Completions | Text + Image | 200K | 32K | Free | Free |
122
130
  | MiniMax-M2.5 | Completions | Text | 205K | 131K | $0.30 | $1.20 |
123
131
  | MiniMax-M2.7 | Completions | Text | 205K | 131K | $0.30 | $1.20 |
@@ -0,0 +1 @@
1
+ {}
package/index.ts CHANGED
@@ -26,6 +26,7 @@ import { getAgentDir, type ExtensionAPI, type ModelRegistry } from "@earendil-wo
26
26
  import modelsData from "./models.json" with { type: "json" };
27
27
  import customModelsData from "./custom-models.json" with { type: "json" };
28
28
  import patchData from "./patch.json" with { type: "json" };
29
+ import deprecatedData from "./deprecated-models.json" with { type: "json" };
29
30
  import fs from "fs";
30
31
  import path from "path";
31
32
 
@@ -116,7 +117,10 @@ function applyPatch(model: JsonModel, patch: PatchEntry): JsonModel {
116
117
  function buildModels(base: JsonModel[], custom: JsonModel[], patch: PatchData): JsonModel[] {
117
118
  const modelMap = new Map<string, JsonModel>();
118
119
 
119
- for (const model of base) {
120
+ // Seed with the base list plus grace-period deprecated models so patch.json
121
+ // entries apply to deprecated models exactly as while the model was live
122
+ // (withDeprecated keeps live data on id conflicts).
123
+ for (const model of withDeprecated(base)) {
120
124
  modelMap.set(model.id, model);
121
125
  }
122
126
 
@@ -259,6 +263,35 @@ function mergeWithEmbedded(liveModels: JsonModel[], embeddedModels: JsonModel[])
259
263
  return result;
260
264
  }
261
265
 
266
+ // Grace period for delisted models. When the provider API stops listing a
267
+ // model, update-models.js moves its last-known definition into
268
+ // deprecated-models.json (stamped with deprecatedAt) instead of dropping it.
269
+ // For 14 days the model keeps working here so in-flight sessions and saved
270
+ // model settings do not break; afterwards it is evicted permanently.
271
+ const DEPRECATED_MODEL_TTL_MS = 14 * 24 * 60 * 60 * 1000;
272
+
273
+ // Grace-period deprecated models with deprecation metadata stripped.
274
+ function activeDeprecatedModels(): JsonModel[] {
275
+ const now = Date.now();
276
+ const result: JsonModel[] = [];
277
+ for (const entry of Object.values(deprecatedData as Record<string, JsonModel & { deprecatedAt?: string }>)) {
278
+ if (!entry?.id) continue;
279
+ const removedAt = Date.parse(entry.deprecatedAt ?? "");
280
+ if (Number.isNaN(removedAt) || now - removedAt > DEPRECATED_MODEL_TTL_MS) continue;
281
+ const model = { ...entry } as JsonModel & { deprecatedAt?: string };
282
+ delete model.deprecatedAt;
283
+ result.push(model);
284
+ }
285
+ return result;
286
+ }
287
+
288
+ // Append grace-period deprecated models the list does not already have (live data wins).
289
+ function withDeprecated(models: JsonModel[]): JsonModel[] {
290
+ const seen = new Set(models.map((m) => m.id));
291
+ const extras = activeDeprecatedModels().filter((m) => !seen.has(m.id));
292
+ return extras.length > 0 ? [...models, ...extras] : models;
293
+ }
294
+
262
295
  function loadStaleModels(embeddedModels: JsonModel[]): JsonModel[] {
263
296
  const cached = loadCachedModels();
264
297
  if (!cached || cached.length === 0) return embeddedModels;