@monotykamary/pi-opencode-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
@@ -567,6 +567,15 @@
567
567
  "api": "openai-completions",
568
568
  "baseUrl": "https://opencode.ai/zen/v1",
569
569
  "reasoning": true,
570
+ "thinkingLevelMap": {
571
+ "off": null,
572
+ "minimal": null,
573
+ "low": "low",
574
+ "medium": null,
575
+ "high": "high",
576
+ "xhigh": null,
577
+ "max": "max"
578
+ },
570
579
  "input": [
571
580
  "text",
572
581
  "image"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monotykamary/pi-opencode-provider",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Opencode provider extension for pi - Access GPT, Claude, Gemini, GLM, MiniMax, Kimi and more 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
+ "x-preview-f-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
  "gpt-5.1-codex-mini": {
3
22
  "thinkingLevelMap": {
4
23
  "off": null,
@@ -66,6 +66,28 @@ function getInputTypes(modalities) {
66
66
  if (!filtered.includes('text')) filtered.unshift('text');
67
67
  return filtered;
68
68
  }
69
+ // Canonical pi thinking levels, in picker order. A null entry excludes a level
70
+ // from the picker; a string maps the pi level to the API effort value (identity
71
+ // here, since models.dev reasoning_options values are the raw effort strings).
72
+ const PI_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
73
+
74
+ // Derive a thinking-level map from models.dev reasoning_options so models that
75
+ // declare effort values (e.g. ox-alpha: low/high/max) get real picker levels
76
+ // without a hand-written patch.json entry. Unadvertised levels and "off" (models
77
+ // that cannot disable thinking, like ox-alpha) map to null.
78
+ function getThinkingLevelMap(model) {
79
+ if (!model.reasoning) return undefined;
80
+ const effort = (model.reasoning_options || []).find((o) => o && o.type === "effort");
81
+ const values = effort && Array.isArray(effort.values) ? effort.values.filter((v) => typeof v === "string") : [];
82
+ if (values.length === 0) return undefined;
83
+ const supported = new Set(values);
84
+ const map = {};
85
+ for (const level of PI_THINKING_LEVELS) {
86
+ map[level] = supported.has(level) ? level : null;
87
+ }
88
+ return map;
89
+ }
90
+
69
91
 
70
92
  // Get API label for display
71
93
  function getApiLabel(api) {
@@ -92,6 +114,9 @@ function convertModel(model) {
92
114
  api,
93
115
  baseUrl,
94
116
  reasoning: model.reasoning || false,
117
+ // JSON.stringify drops undefined-valued keys, so models without effort
118
+ // metadata simply emit no thinkingLevelMap field.
119
+ thinkingLevelMap: getThinkingLevelMap(model),
95
120
  input: inputTypes,
96
121
  cost: {
97
122
  input: cost.input || 0,