pi-opencode-go-provider 1.0.12 → 1.0.13

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/models.json CHANGED
@@ -229,6 +229,15 @@
229
229
  "api": "openai-completions",
230
230
  "baseUrl": "https://opencode.ai/zen/go/v1",
231
231
  "reasoning": true,
232
+ "thinkingLevelMap": {
233
+ "off": null,
234
+ "minimal": null,
235
+ "low": "low",
236
+ "medium": null,
237
+ "high": "high",
238
+ "xhigh": null,
239
+ "max": "max"
240
+ },
232
241
  "input": [
233
242
  "text",
234
243
  "image"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-opencode-go-provider",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Opencode Go provider extension for pi - Fast, efficient GLM, Kimi, and MiniMax models through the opencode.ai API",
5
5
  "type": "module",
6
6
  "main": "index.ts",
package/patch.json CHANGED
@@ -1,4 +1,23 @@
1
1
  {
2
+ "ox-alpha-free": {
3
+ "thinkingLevelMap": {
4
+ "off": null,
5
+ "minimal": null,
6
+ "low": "low",
7
+ "medium": null,
8
+ "high": "high",
9
+ "xhigh": null,
10
+ "max": "max"
11
+ },
12
+ "compat": {
13
+ "supportsStore": false,
14
+ "supportsDeveloperRole": false,
15
+ "maxTokensField": "max_tokens",
16
+ "requiresReasoningContentOnAssistantMessages": true,
17
+ "thinkingFormat": "deepseek",
18
+ "supportsReasoningEffort": true
19
+ }
20
+ },
2
21
  "glm-5.1": {
3
22
  "compat": {
4
23
  "supportsStore": false,
@@ -64,6 +64,28 @@ function getInputTypes(modalities) {
64
64
  if (!filtered.includes('text')) filtered.unshift('text');
65
65
  return filtered;
66
66
  }
67
+ // Canonical pi thinking levels, in picker order. A null entry excludes a level
68
+ // from the picker; a string maps the pi level to the API effort value (identity
69
+ // here, since models.dev reasoning_options values are the raw effort strings).
70
+ const PI_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
71
+
72
+ // Derive a thinking-level map from models.dev reasoning_options so models that
73
+ // declare effort values (e.g. ox-alpha: low/high/max) get real picker levels
74
+ // without a hand-written patch.json entry. Unadvertised levels and "off" (models
75
+ // that cannot disable thinking, like ox-alpha) map to null.
76
+ function getThinkingLevelMap(model) {
77
+ if (!model.reasoning) return undefined;
78
+ const effort = (model.reasoning_options || []).find((o) => o && o.type === "effort");
79
+ const values = effort && Array.isArray(effort.values) ? effort.values.filter((v) => typeof v === "string") : [];
80
+ if (values.length === 0) return undefined;
81
+ const supported = new Set(values);
82
+ const map = {};
83
+ for (const level of PI_THINKING_LEVELS) {
84
+ map[level] = supported.has(level) ? level : null;
85
+ }
86
+ return map;
87
+ }
88
+
67
89
 
68
90
  // Get API label for display
69
91
  function getApiLabel(api) {
@@ -90,6 +112,9 @@ function convertModel(model) {
90
112
  api,
91
113
  baseUrl,
92
114
  reasoning: model.reasoning || false,
115
+ // JSON.stringify drops undefined-valued keys, so models without effort
116
+ // metadata simply emit no thinkingLevelMap field.
117
+ thinkingLevelMap: getThinkingLevelMap(model),
93
118
  input: inputTypes,
94
119
  cost: {
95
120
  input: cost.input || 0,