opencode-cmd-provider 1.0.1 → 1.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0 - 2026-08-20
4
+
5
+ Feature: complete capability metadata for every catalog model, with automatic sync of reasoning and pricing facts at release time.
6
+
7
+ - Every auto-registered model now advertises tool calls, reasoning (efforts or reasoning-capable classification), image input, and cost — no more blank CAPABILITIES, blank MODALITIES, or $0.00 rows (fixes #22).
8
+ - Reasoning efforts and per-1M-token rates are generated from the command-code package's bundled `models.md` at snapshot-refresh time (`src/catalog/facts.ts`); the release pipeline now fails loudly if the committed facts drifted (ADR 0003).
9
+ - Corrected real pricing drift: `deepseek-v4-pro`/`flash` rates were stale, and the expired `gpt-5.6-terra`/`luna` discounts are gone. Context-tier pricing was removed — Command Code publishes flat rates only.
10
+ - Added vision entries for `Qwen/Qwen3.8-27B` and `google/gemini-3.7-flash`, and reasoning efforts for `zai-org/GLM-5.3`, `Qwen/Qwen3.8-27B`, `google/gemini-3.7-flash`, and `xai/grok-4.6`.
11
+
12
+ ## 1.0.2 - 2026-08-19
13
+
14
+ Chore: refresh the bundled model catalog snapshot after the live catalog drifted.
15
+
16
+ - Added `Qwen/Qwen3.8-27B` (262144 context) to the bundled snapshot — the release pipeline's stale-snapshot gate would otherwise fail the next tag push (ADR 0003).
17
+
3
18
  ## 1.0.1 - 2026-08-16
4
19
 
5
20
  Chore: harden the release flow so a tag push can no longer publish from an unmerged tree or rewrite tags.
@@ -0,0 +1,10 @@
1
+ export declare const FACTS_SOURCE_URL = "https://unpkg.com/command-code@1.28.1/dist/bundled/command-code-knowledge/reference/models.md";
2
+ export declare const FACTS_PACKAGE_VERSION = "1.28.1";
3
+ export declare const FACTS_LAST_REFRESHED = "2026-08-19";
4
+ export declare const MODEL_EFFORTS: Readonly<Record<string, readonly string[]>>;
5
+ export declare const MODEL_COSTS: Readonly<Record<string, {
6
+ input: number;
7
+ output: number;
8
+ cacheRead: number;
9
+ cacheWrite: number;
10
+ }>>;
@@ -0,0 +1,95 @@
1
+ // src/catalog/facts.ts — GENERATED by scripts/refresh-snapshot.mjs. Do not edit.
2
+ //
3
+ // Capability facts (reasoning efforts + per-1M-token rates) parsed from the
4
+ // command-code npm package's bundled model catalog (models.md). Regenerate
5
+ // with `npm run refresh:snapshot`.
6
+ export const FACTS_SOURCE_URL = "https://unpkg.com/command-code@1.28.1/dist/bundled/command-code-knowledge/reference/models.md";
7
+ export const FACTS_PACKAGE_VERSION = "1.28.1";
8
+ export const FACTS_LAST_REFRESHED = "2026-08-19";
9
+ export const MODEL_EFFORTS = {
10
+ "deepseek/deepseek-v4-pro": ["high", "max"],
11
+ "deepseek/deepseek-v4-flash": ["high", "max"],
12
+ "zai-org/GLM-5.3": ["low", "high", "max"],
13
+ "zai-org/GLM-5.2": ["high", "max"],
14
+ "Qwen/Qwen3.8-Max": ["low", "medium", "xhigh"],
15
+ "Qwen/Qwen3.8-27B": ["low", "medium", "xhigh"],
16
+ "claude-sonnet-5": ["low", "medium", "high", "xhigh", "max"],
17
+ "claude-sonnet-4-6": ["low", "medium", "high", "xhigh", "max"],
18
+ "claude-fable-5": ["low", "medium", "high", "xhigh", "max"],
19
+ "claude-opus-5": ["low", "medium", "high", "xhigh", "max"],
20
+ "claude-opus-4-8": ["low", "medium", "high", "xhigh", "max"],
21
+ "claude-opus-4-7": ["low", "medium", "high", "xhigh", "max"],
22
+ "gpt-5.6-sol": ["low", "medium", "high", "xhigh", "max"],
23
+ "gpt-5.6-terra": ["low", "medium", "high", "xhigh", "max"],
24
+ "gpt-5.6-luna": ["low", "medium", "high", "xhigh", "max"],
25
+ "gpt-5.5": ["low", "medium", "high", "xhigh"],
26
+ "gpt-5.4": ["low", "medium", "high", "xhigh"],
27
+ "gpt-5.3-codex": ["low", "medium", "high", "xhigh"],
28
+ "gpt-5.4-mini": ["low", "medium", "high"],
29
+ "google/gemini-3.7-flash": ["low", "medium", "high"],
30
+ "google/gemini-3.6-flash": ["low", "medium", "high"],
31
+ "google/gemini-3.5-flash": ["low", "medium", "high"],
32
+ "google/gemini-3.5-flash-lite": ["low", "medium", "high"],
33
+ "google/gemini-3.1-flash-lite": ["low", "medium", "high"],
34
+ "sakana/fugu-ultra": ["high", "xhigh"],
35
+ "xai/grok-4.5": ["low", "medium", "high"],
36
+ "xai/grok-4.6": ["low", "medium", "high", "xhigh"],
37
+ };
38
+ export const MODEL_COSTS = {
39
+ "deepseek/deepseek-v4-pro": { input: 0.66, output: 1.98, cacheRead: 0.022, cacheWrite: 0 },
40
+ "deepseek/deepseek-v4-flash": { input: 0.22, output: 0.66, cacheRead: 0.007, cacheWrite: 0 },
41
+ "moonshotai/Kimi-K3": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 0 },
42
+ "moonshotai/Kimi-K2.7-Code": { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 },
43
+ "moonshotai/Kimi-K2.7-Code-Highspeed": { input: 1.9, output: 8, cacheRead: 0.38, cacheWrite: 0 },
44
+ "moonshotai/Kimi-K2.6": { input: 0.95, output: 4, cacheRead: 0.16, cacheWrite: 0 },
45
+ "moonshotai/Kimi-K2.5": { input: 0.6, output: 3, cacheRead: 0.1, cacheWrite: 0 },
46
+ "zai-org/GLM-5.3": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
47
+ "zai-org/GLM-5.2": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
48
+ "zai-org/GLM-5.2-Fast": { input: 3, output: 10.25, cacheRead: 0.5, cacheWrite: 0 },
49
+ "zai-org/GLM-5.1": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
50
+ "zai-org/GLM-5": { input: 1, output: 3.2, cacheRead: 0.2, cacheWrite: 0 },
51
+ "MiniMaxAI/MiniMax-M3": { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0 },
52
+ "MiniMaxAI/MiniMax-M2.7": { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0 },
53
+ "MiniMaxAI/MiniMax-M2.5": { input: 0.3, output: 1.2, cacheRead: 0.03, cacheWrite: 0 },
54
+ "xiaomi/mimo-v2.5-pro": { input: 0.435, output: 0.87, cacheRead: 0.0036, cacheWrite: 0 },
55
+ "xiaomi/mimo-v2.5": { input: 0.14, output: 0.28, cacheRead: 0.0028, cacheWrite: 0 },
56
+ "Qwen/Qwen3.8-Max": { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 2.5 },
57
+ "Qwen/Qwen3.8-27B": { input: 0.4, output: 3, cacheRead: 0.04, cacheWrite: 0 },
58
+ "Qwen/Qwen3.7-Max": { input: 2.5, output: 7.5, cacheRead: 0.5, cacheWrite: 3.13 },
59
+ "Qwen/Qwen3.7-Plus": { input: 0.4, output: 1.6, cacheRead: 0.08, cacheWrite: 0.5 },
60
+ "Qwen/Qwen3.7-Flash": { input: 0.03, output: 0.13, cacheRead: 0.006, cacheWrite: 0.038 },
61
+ "Qwen/Qwen3.6-Max-Preview": { input: 1.3, output: 7.8, cacheRead: 0.26, cacheWrite: 1.63 },
62
+ "Qwen/Qwen3.6-Plus": { input: 0.5, output: 3, cacheRead: 0.1, cacheWrite: 0 },
63
+ "stepfun/Step-3.7-Flash": { input: 0.2, output: 1.15, cacheRead: 0.04, cacheWrite: 0 },
64
+ "stepfun/Step-3.5-Flash": { input: 0.1, output: 0.3, cacheRead: 0.02, cacheWrite: 0 },
65
+ "tencent/hy3-paid": { input: 0.14, output: 0.58, cacheRead: 0.035, cacheWrite: 0 },
66
+ "nvidia/nemotron-3-ultra-550b-a55b": { input: 0.6, output: 2.4, cacheRead: 0.12, cacheWrite: 0 },
67
+ "thinkingmachines/inkling": { input: 1, output: 4.05, cacheRead: 0.17, cacheWrite: 0 },
68
+ "thinkingmachines/inkling-small": { input: 0.5, output: 1.2, cacheRead: 0.1, cacheWrite: 0 },
69
+ "poolside/laguna-s-2.1-free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
70
+ "claude-sonnet-5": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
71
+ "claude-sonnet-4-6": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
72
+ "claude-fable-5": { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 },
73
+ "claude-opus-5": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
74
+ "claude-opus-4-8": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
75
+ "claude-opus-4-7": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
76
+ "claude-haiku-4-5-20251001": { input: 1, output: 5, cacheRead: 0.1, cacheWrite: 1.25 },
77
+ "gpt-5.6-sol": { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 6.25 },
78
+ "gpt-5.6-terra": { input: 2, output: 12, cacheRead: 0.2, cacheWrite: 2.5 },
79
+ "gpt-5.6-luna": { input: 0.2, output: 1.2, cacheRead: 0.02, cacheWrite: 0.25 },
80
+ "gpt-5.5": { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 },
81
+ "gpt-5.4": { input: 2.5, output: 15, cacheRead: 0.25, cacheWrite: 0 },
82
+ "gpt-5.3-codex": { input: 2, output: 8, cacheRead: 0.5, cacheWrite: 0 },
83
+ "gpt-5.4-mini": { input: 0.75, output: 4.5, cacheRead: 0.075, cacheWrite: 0 },
84
+ "google/gemini-3.7-flash": { input: 0.75, output: 3.75, cacheRead: 0.075, cacheWrite: 0.04167 },
85
+ "google/gemini-3.6-flash": { input: 1.5, output: 7.5, cacheRead: 0.15, cacheWrite: 0 },
86
+ "google/gemini-3.5-flash": { input: 1.5, output: 9, cacheRead: 0.15, cacheWrite: 0 },
87
+ "google/gemini-3.5-flash-lite": { input: 0.3, output: 2.5, cacheRead: 0.03, cacheWrite: 0 },
88
+ "google/gemini-3.1-flash-lite": { input: 0.25, output: 1.5, cacheRead: 0.03, cacheWrite: 0 },
89
+ "sakana/fugu-ultra": { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 },
90
+ "meta/muse-spark-1.1": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
91
+ "meta/muse-spark-1.2": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
92
+ "meta/muse-spark-1.2-contributor": { input: 0.1, output: 0.2, cacheRead: 0.002, cacheWrite: 0 },
93
+ "xai/grok-4.5": { input: 2, output: 6, cacheRead: 0.5, cacheWrite: 0 },
94
+ "xai/grok-4.6": { input: 2, output: 6, cacheRead: 0.5, cacheWrite: 0 },
95
+ };
@@ -36,6 +36,7 @@ export const MODEL_SNAPSHOT = [
36
36
  { id: "xiaomi/mimo-v2.5-pro", name: "MiMo V2.5 Pro", contextLength: 1000000 },
37
37
  { id: "xiaomi/mimo-v2.5", name: "MiMo V2.5", contextLength: 1000000 },
38
38
  { id: "Qwen/Qwen3.8-Max", name: "Qwen 3.8 Max", contextLength: 1000000 },
39
+ { id: "Qwen/Qwen3.8-27B", name: "Qwen 3.8 27B", contextLength: 262144 },
39
40
  { id: "Qwen/Qwen3.7-Max", name: "Qwen 3.7 Max", contextLength: 1000000 },
40
41
  { id: "Qwen/Qwen3.7-Plus", name: "Qwen 3.7 Plus", contextLength: 1000000 },
41
42
  { id: "Qwen/Qwen3.7-Flash", name: "Qwen 3.7 Flash", contextLength: 1000000 },
@@ -30,6 +30,11 @@ export declare function autoRegister(config: Config, snapshot: readonly CatalogM
30
30
  * Augments config-declared commandcode models with reasoning metadata and
31
31
  * variants so opencode's `ctrl+t` can cycle reasoning effort.
32
32
  *
33
+ * Gap-fill only: a user-declared `reasoning` value is never overwritten, and
34
+ * no variants are injected when the user explicitly disabled reasoning
35
+ * (variants without `reasoning: true` would make `ctrl+t` cycle an effort the
36
+ * model was told not to use).
37
+ *
33
38
  * In-place mutation of the config object (the plugin `config` hook contract).
34
39
  */
35
40
  export declare function augmentConfigCommandCodeModels(config: Config): void;
@@ -1,5 +1,5 @@
1
1
  import { MODEL_COSTS, ZERO_MODEL_COST } from "../provider/pricing.js";
2
- import { reasoningVariantsForModel } from "../provider/reasoning.js";
2
+ import { reasoningVariantsForModel, isReasoningModel } from "../provider/reasoning.js";
3
3
  import { inputModalitiesForModel } from "../provider/modalities.js";
4
4
  const DEFAULT_MAX_OUTPUT_TOKENS = 65_536;
5
5
  /**
@@ -47,6 +47,11 @@ export function autoRegister(config, snapshot, options) {
47
47
  * Augments config-declared commandcode models with reasoning metadata and
48
48
  * variants so opencode's `ctrl+t` can cycle reasoning effort.
49
49
  *
50
+ * Gap-fill only: a user-declared `reasoning` value is never overwritten, and
51
+ * no variants are injected when the user explicitly disabled reasoning
52
+ * (variants without `reasoning: true` would make `ctrl+t` cycle an effort the
53
+ * model was told not to use).
54
+ *
50
55
  * In-place mutation of the config object (the plugin `config` hook contract).
51
56
  */
52
57
  export function augmentConfigCommandCodeModels(config) {
@@ -56,9 +61,12 @@ export function augmentConfigCommandCodeModels(config) {
56
61
  for (const [modelId, model] of Object.entries(provider.models)) {
57
62
  if (!model)
58
63
  continue;
64
+ if (model.reasoning === undefined && isReasoningModel(modelId))
65
+ model.reasoning = true;
66
+ if (model.reasoning === false)
67
+ continue;
59
68
  const variants = reasoningVariantsForModel(modelId);
60
69
  if (variants) {
61
- model.reasoning = true;
62
70
  model.variants = variants;
63
71
  }
64
72
  }
@@ -78,8 +86,14 @@ function configModelFor(model) {
78
86
  context: model.contextLength,
79
87
  output: Math.min(model.contextLength, DEFAULT_MAX_OUTPUT_TOKENS),
80
88
  },
81
- reasoning: variants ? true : undefined,
89
+ reasoning: isReasoningModel(model.id) ? true : undefined,
82
90
  variants: variants,
91
+ // `tool_call: true` advertises tool use (the runtime already sends tools).
92
+ // `attachment` is deliberately unset: Command Code's published catalog
93
+ // exposes no per-model attachment support, and the runtime converter only
94
+ // handles text + image content parts — claiming attachment support would
95
+ // promise file uploads the plugin cannot deliver.
96
+ tool_call: true,
83
97
  modalities: {
84
98
  input: [...inputModalitiesForModel(model.id)],
85
99
  },
@@ -1,13 +1,5 @@
1
1
  export function calculateCommandCodeCost(model, usage) {
2
- const inputTokens = usage.input + usage.cacheRead + usage.cacheWrite;
3
- let rates = model.cost;
4
- let matchedThreshold = -1;
5
- for (const tier of model.cost.tiers ?? []) {
6
- if (inputTokens > tier.inputTokensAbove && tier.inputTokensAbove > matchedThreshold) {
7
- rates = tier;
8
- matchedThreshold = tier.inputTokensAbove;
9
- }
10
- }
2
+ const rates = model.cost;
11
3
  const longWrite = usage.cacheWrite1h ?? 0;
12
4
  const shortWrite = usage.cacheWrite - longWrite;
13
5
  usage.cost.input = (rates.input / 1_000_000) * usage.input;
@@ -22,6 +22,7 @@ export const MODEL_INPUT_MODALITIES = {
22
22
  "google/gemini-3.5-flash": ["text", "image"],
23
23
  "google/gemini-3.5-flash-lite": ["text", "image"],
24
24
  "google/gemini-3.6-flash": ["text", "image"],
25
+ "google/gemini-3.7-flash": ["text", "image"],
25
26
  "gpt-5.3-codex": ["text", "image"],
26
27
  "gpt-5.4": ["text", "image"],
27
28
  "gpt-5.4-mini": ["text", "image"],
@@ -37,6 +38,7 @@ export const MODEL_INPUT_MODALITIES = {
37
38
  "moonshotai/Kimi-K2.7-Code": ["text", "image"],
38
39
  "moonshotai/Kimi-K2.7-Code-Highspeed": ["text", "image"],
39
40
  "moonshotai/Kimi-K3": ["text", "image"],
41
+ "Qwen/Qwen3.8-27B": ["text", "image"],
40
42
  "sakana/fugu-ultra": ["text", "image"],
41
43
  "stepfun/Step-3.7-Flash": ["text", "image"],
42
44
  "thinkingmachines/inkling": ["text", "image"],
@@ -1,24 +1,11 @@
1
+ import { MODEL_COSTS, FACTS_SOURCE_URL as PRICING_SOURCE_URL, FACTS_LAST_REFRESHED as PRICING_LAST_VERIFIED } from "../catalog/facts.js";
2
+ export { MODEL_COSTS, PRICING_SOURCE_URL, PRICING_LAST_VERIFIED };
1
3
  export interface CommandCodeModelCostRates {
2
4
  input: number;
3
5
  output: number;
4
6
  cacheRead: number;
5
7
  cacheWrite: number;
6
8
  }
7
- export interface CommandCodeModelCostTier extends CommandCodeModelCostRates {
8
- inputTokensAbove: number;
9
- }
10
9
  export interface CommandCodeModelCost extends CommandCodeModelCostRates {
11
- tiers?: readonly CommandCodeModelCostTier[];
12
10
  }
13
- export declare const PRICING_SOURCE_URL = "https://commandcode.ai/docs/resources/pricing-limits";
14
- export declare const PRICING_LAST_VERIFIED = "2026-08-04";
15
11
  export declare const ZERO_MODEL_COST: CommandCodeModelCost;
16
- /**
17
- * Display prices in USD per million tokens.
18
- *
19
- * Context-dependent rates use pi's request-wide input pricing tiers. The
20
- * highest threshold exceeded by input + cache reads + cache writes applies to
21
- * the full request. The Command Code usage page remains authoritative for the
22
- * amount billed for an individual request.
23
- */
24
- export declare const MODEL_COSTS: Readonly<Record<string, CommandCodeModelCost>>;
@@ -1,188 +1,10 @@
1
- // src/provider/pricing.ts — Command Code model pricing table (PLAN #6, port of
2
- // pi's pricing.ts)
3
- export const PRICING_SOURCE_URL = "https://commandcode.ai/docs/resources/pricing-limits";
4
- export const PRICING_LAST_VERIFIED = "2026-08-04";
1
+ // src/provider/pricing.ts — Command Code model pricing types + cost table.
2
+ // MODEL_COSTS is GENERATED (src/catalog/facts.ts) — see FACTS_SOURCE_URL.
3
+ import { MODEL_COSTS, FACTS_SOURCE_URL as PRICING_SOURCE_URL, FACTS_LAST_REFRESHED as PRICING_LAST_VERIFIED, } from "../catalog/facts.js";
4
+ export { MODEL_COSTS, PRICING_SOURCE_URL, PRICING_LAST_VERIFIED };
5
5
  export const ZERO_MODEL_COST = {
6
6
  input: 0,
7
7
  output: 0,
8
8
  cacheRead: 0,
9
9
  cacheWrite: 0,
10
10
  };
11
- /**
12
- * Display prices in USD per million tokens.
13
- *
14
- * Context-dependent rates use pi's request-wide input pricing tiers. The
15
- * highest threshold exceeded by input + cache reads + cache writes applies to
16
- * the full request. The Command Code usage page remains authoritative for the
17
- * amount billed for an individual request.
18
- */
19
- export const MODEL_COSTS = {
20
- // Free models
21
- "poolside/laguna-s-2.1-free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
22
- "inclusionai/ling-3.0-flash-free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
23
- // Open and open-weight models
24
- "tencent/hy3-paid": { input: 0.14, output: 0.58, cacheRead: 0.035, cacheWrite: 0 },
25
- "moonshotai/Kimi-K3": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 0 },
26
- "moonshotai/Kimi-K2.7-Code": { input: 0.95, output: 4, cacheRead: 0.19, cacheWrite: 0 },
27
- "moonshotai/Kimi-K2.7-Code-Highspeed": {
28
- input: 1.9,
29
- output: 8,
30
- cacheRead: 0.38,
31
- cacheWrite: 0,
32
- },
33
- "moonshotai/Kimi-K2.6": { input: 0.95, output: 4, cacheRead: 0.16, cacheWrite: 0 },
34
- "moonshotai/Kimi-K2.5": { input: 0.6, output: 3, cacheRead: 0.1, cacheWrite: 0 },
35
- "zai-org/GLM-5.2": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
36
- "zai-org/GLM-5.2-Fast": { input: 3, output: 10.25, cacheRead: 0.5, cacheWrite: 0 },
37
- "zai-org/GLM-5.1": { input: 1.4, output: 4.4, cacheRead: 0.26, cacheWrite: 0 },
38
- "zai-org/GLM-5": { input: 1, output: 3.2, cacheRead: 0.2, cacheWrite: 0 },
39
- "MiniMaxAI/MiniMax-M3": { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0 },
40
- "MiniMaxAI/MiniMax-M2.7": { input: 0.3, output: 1.2, cacheRead: 0.06, cacheWrite: 0 },
41
- "MiniMaxAI/MiniMax-M2.5": { input: 0.3, output: 1.2, cacheRead: 0.03, cacheWrite: 0 },
42
- // Permanent 75% discount.
43
- "deepseek/deepseek-v4-pro": {
44
- input: 0.435,
45
- output: 0.87,
46
- cacheRead: 0.003625,
47
- cacheWrite: 0,
48
- },
49
- "deepseek/deepseek-v4-flash": {
50
- input: 0.14,
51
- output: 0.28,
52
- cacheRead: 0.0028,
53
- cacheWrite: 0,
54
- },
55
- "Qwen/Qwen3.8-Max": { input: 2, output: 6, cacheRead: 0.25, cacheWrite: 2.5 },
56
- "Qwen/Qwen3.7-Max": { input: 2.5, output: 7.5, cacheRead: 0.5, cacheWrite: 3.13 },
57
- "Qwen/Qwen3.7-Plus": {
58
- input: 0.4,
59
- output: 1.6,
60
- cacheRead: 0.08,
61
- cacheWrite: 0.5,
62
- tiers: [
63
- {
64
- inputTokensAbove: 256_000,
65
- input: 1.2,
66
- output: 4.8,
67
- cacheRead: 0.24,
68
- cacheWrite: 1.5,
69
- },
70
- ],
71
- },
72
- "Qwen/Qwen3.7-Flash": {
73
- input: 0.03,
74
- output: 0.13,
75
- cacheRead: 0.006,
76
- cacheWrite: 0.038,
77
- tiers: [
78
- {
79
- inputTokensAbove: 32_000,
80
- input: 0.1,
81
- output: 0.4,
82
- cacheRead: 0.02,
83
- cacheWrite: 0.125,
84
- },
85
- {
86
- inputTokensAbove: 256_000,
87
- input: 0.2,
88
- output: 0.8,
89
- cacheRead: 0.04,
90
- cacheWrite: 0.25,
91
- },
92
- ],
93
- },
94
- "Qwen/Qwen3.6-Max-Preview": {
95
- input: 1.3,
96
- output: 7.8,
97
- cacheRead: 0.26,
98
- cacheWrite: 1.63,
99
- },
100
- "Qwen/Qwen3.6-Plus": { input: 0.5, output: 3, cacheRead: 0.1, cacheWrite: 0 },
101
- "stepfun/Step-3.7-Flash": { input: 0.2, output: 1.15, cacheRead: 0.04, cacheWrite: 0 },
102
- "stepfun/Step-3.5-Flash": { input: 0.1, output: 0.3, cacheRead: 0.02, cacheWrite: 0 },
103
- // Permanent discounted rates.
104
- "xiaomi/mimo-v2.5-pro": { input: 0.435, output: 0.87, cacheRead: 0.0036, cacheWrite: 0 },
105
- "xiaomi/mimo-v2.5": { input: 0.14, output: 0.28, cacheRead: 0.0028, cacheWrite: 0 },
106
- "nvidia/nemotron-3-ultra-550b-a55b": {
107
- input: 0.6,
108
- output: 2.4,
109
- cacheRead: 0.12,
110
- cacheWrite: 0,
111
- },
112
- "sakana/fugu-ultra": { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 },
113
- "thinkingmachines/inkling": { input: 1, output: 4.05, cacheRead: 0.17, cacheWrite: 0 },
114
- "thinkingmachines/inkling-small": {
115
- input: 0.5,
116
- output: 1.2,
117
- cacheRead: 0.1,
118
- cacheWrite: 0,
119
- },
120
- "meta/muse-spark-1.1": { input: 1.25, output: 4.25, cacheRead: 0.15, cacheWrite: 0 },
121
- // Anthropic
122
- // Introductory pricing through 2026-08-31.
123
- "claude-sonnet-5": { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
124
- "claude-sonnet-4-6": { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
125
- "claude-fable-5": { input: 10, output: 50, cacheRead: 1, cacheWrite: 12.5 },
126
- "claude-opus-5": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
127
- "claude-opus-4-8": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
128
- "claude-opus-4-7": { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
129
- "claude-haiku-4-5-20251001": {
130
- input: 1,
131
- output: 5,
132
- cacheRead: 0.1,
133
- cacheWrite: 1.25,
134
- },
135
- // OpenAI
136
- "gpt-5.6-sol": { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 6.25 },
137
- // Discounted rates through 2026-08-14.
138
- "gpt-5.6-terra": {
139
- input: 1,
140
- output: 6,
141
- cacheRead: 0.1,
142
- cacheWrite: 1.25,
143
- tiers: [
144
- {
145
- inputTokensAbove: 272_000,
146
- input: 2,
147
- output: 9,
148
- cacheRead: 0.2,
149
- cacheWrite: 2.5,
150
- },
151
- ],
152
- },
153
- "gpt-5.6-luna": {
154
- input: 0.1,
155
- output: 0.6,
156
- cacheRead: 0.01,
157
- cacheWrite: 0.125,
158
- tiers: [
159
- {
160
- inputTokensAbove: 272_000,
161
- input: 0.2,
162
- output: 0.9,
163
- cacheRead: 0.02,
164
- cacheWrite: 0.25,
165
- },
166
- ],
167
- },
168
- "gpt-5.5": { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 },
169
- "gpt-5.4": { input: 2.5, output: 15, cacheRead: 0.25, cacheWrite: 0 },
170
- "gpt-5.3-codex": { input: 2, output: 8, cacheRead: 0.5, cacheWrite: 0 },
171
- "gpt-5.4-mini": { input: 0.75, output: 4.5, cacheRead: 0.075, cacheWrite: 0 },
172
- // Google and xAI
173
- "google/gemini-3.6-flash": { input: 1.5, output: 7.5, cacheRead: 0.15, cacheWrite: 0 },
174
- "google/gemini-3.5-flash": { input: 1.5, output: 9, cacheRead: 0.15, cacheWrite: 0 },
175
- "google/gemini-3.5-flash-lite": {
176
- input: 0.3,
177
- output: 2.5,
178
- cacheRead: 0.03,
179
- cacheWrite: 0,
180
- },
181
- "google/gemini-3.1-flash-lite": {
182
- input: 0.25,
183
- output: 1.5,
184
- cacheRead: 0.03,
185
- cacheWrite: 0,
186
- },
187
- "xai/grok-4.5": { input: 2, output: 6, cacheRead: 0.5, cacheWrite: 0 },
188
- };
@@ -1,15 +1,15 @@
1
+ /**
2
+ * Models omitted here let Command Code choose their reasoning depth.
3
+ */
4
+ export declare const MODEL_EFFORTS: Readonly<Record<string, readonly CommandCodeReasoningEffort[]>>;
1
5
  export type PiThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
2
6
  type CommandCodeReasoningEffort = Exclude<PiThinkingLevel, "off">;
3
7
  /**
4
- * Per-model reasoning efforts supported by Command Code's generate endpoint.
5
- *
6
- * The Provider API does not expose reasoning metadata. This is an exact
7
- * snapshot of `reasoningEfforts` from the command-code@1.15.1 model catalog
8
- * (`packages/shared/src/model-catalog.ts`, also published in the generated
9
- * `dist/bundled/command-code-knowledge/reference/models.md`). Models omitted
10
- * here let Command Code choose their reasoning depth, matching the CLI.
8
+ * Models Command Code advertises as reasoning-capable without exposing
9
+ * explicit effort levels (Command Code chooses the reasoning depth). These
10
+ * advertise `reasoning: true` in opencode but never generate `variants`.
11
11
  */
12
- export declare const MODEL_EFFORTS: Readonly<Record<string, readonly CommandCodeReasoningEffort[]>>;
12
+ export declare const REASONING_MODELS: ReadonlySet<string>;
13
13
  export interface ThinkingMetadata {
14
14
  thinkingLevelMap: Partial<Record<PiThinkingLevel, string | null>>;
15
15
  thinking: {
@@ -1,39 +1,44 @@
1
1
  // src/provider/reasoning.ts — reasoning-effort metadata tables (PLAN #5 Part A,
2
- // port of pi's models.ts:67-150; catalog parsing deferred to #6/#7)
2
+ // port of pi's models.ts:67-150). Reasoning metadata now comes from the
3
+ // generated catalog facts (`src/catalog/facts.ts`), with hand-maintained
4
+ // classification sets (`REASONING_MODELS`) layered on top.
5
+ import { MODEL_EFFORTS as GENERATED_MODEL_EFFORTS } from "../catalog/facts.js";
3
6
  /**
4
- * Per-model reasoning efforts supported by Command Code's generate endpoint.
5
- *
6
- * The Provider API does not expose reasoning metadata. This is an exact
7
- * snapshot of `reasoningEfforts` from the command-code@1.15.1 model catalog
8
- * (`packages/shared/src/model-catalog.ts`, also published in the generated
9
- * `dist/bundled/command-code-knowledge/reference/models.md`). Models omitted
10
- * here let Command Code choose their reasoning depth, matching the CLI.
7
+ * Models omitted here let Command Code choose their reasoning depth.
11
8
  */
12
- export const MODEL_EFFORTS = {
13
- "Qwen/Qwen3.8-Max": ["low", "medium", "xhigh"],
14
- "claude-fable-5": ["low", "medium", "high", "xhigh", "max"],
15
- "claude-opus-4-7": ["low", "medium", "high", "xhigh", "max"],
16
- "claude-opus-4-8": ["low", "medium", "high", "xhigh", "max"],
17
- "claude-opus-5": ["low", "medium", "high", "xhigh", "max"],
18
- "claude-sonnet-4-6": ["low", "medium", "high", "xhigh", "max"],
19
- "claude-sonnet-5": ["low", "medium", "high", "xhigh", "max"],
20
- "deepseek/deepseek-v4-flash": ["high", "max"],
21
- "deepseek/deepseek-v4-pro": ["high", "max"],
22
- "gpt-5.3-codex": ["low", "medium", "high", "xhigh"],
23
- "gpt-5.4": ["low", "medium", "high", "xhigh"],
24
- "gpt-5.4-mini": ["low", "medium", "high"],
25
- "gpt-5.5": ["low", "medium", "high", "xhigh"],
26
- "gpt-5.6-luna": ["low", "medium", "high", "xhigh", "max"],
27
- "gpt-5.6-sol": ["low", "medium", "high", "xhigh", "max"],
28
- "gpt-5.6-terra": ["low", "medium", "high", "xhigh", "max"],
29
- "google/gemini-3.1-flash-lite": ["low", "medium", "high"],
30
- "google/gemini-3.5-flash": ["low", "medium", "high"],
31
- "google/gemini-3.5-flash-lite": ["low", "medium", "high"],
32
- "google/gemini-3.6-flash": ["low", "medium", "high"],
33
- "sakana/fugu-ultra": ["high", "xhigh"],
34
- "xai/grok-4.5": ["low", "medium", "high"],
35
- "zai-org/GLM-5.2": ["high", "max"],
36
- };
9
+ // facts.ts types MODEL_EFFORTS values as `readonly string[]`, wider than the
10
+ // local `CommandCodeReasoningEffort` union ("minimal" | "low" | ... | "max"),
11
+ // so a literal `export { MODEL_EFFORTS }` fails typecheck where
12
+ // `ThinkingMetadata` uses the union. The cast assumes every effort string the
13
+ // generated catalog emits is a valid `PiThinkingLevel` (the models.md Efforts
14
+ // column is constrained to those levels; the release gate catches drift). Do
15
+ // NOT "simplify" this back to a direct re-export — it breaks the build.
16
+ export const MODEL_EFFORTS = GENERATED_MODEL_EFFORTS;
17
+ /**
18
+ * Models Command Code advertises as reasoning-capable without exposing
19
+ * explicit effort levels (Command Code chooses the reasoning depth). These
20
+ * advertise `reasoning: true` in opencode but never generate `variants`.
21
+ */
22
+ export const REASONING_MODELS = new Set([
23
+ "MiniMaxAI/MiniMax-M3",
24
+ "Qwen/Qwen3.6-Max-Preview",
25
+ "Qwen/Qwen3.6-Plus",
26
+ "Qwen/Qwen3.7-Flash",
27
+ "Qwen/Qwen3.7-Max",
28
+ "Qwen/Qwen3.7-Plus",
29
+ "meta/muse-spark-1.1",
30
+ "meta/muse-spark-1.2",
31
+ "meta/muse-spark-1.2-contributor",
32
+ "moonshotai/Kimi-K2.7-Code",
33
+ "moonshotai/Kimi-K2.7-Code-Highspeed",
34
+ "moonshotai/Kimi-K3",
35
+ "nvidia/nemotron-3-ultra-550b-a55b",
36
+ "poolside/laguna-s-2.1-free",
37
+ "stepfun/Step-3.7-Flash",
38
+ "tencent/hy3-paid",
39
+ "thinkingmachines/inkling",
40
+ "thinkingmachines/inkling-small",
41
+ ]);
37
42
  const PI_THINKING_LEVELS = [
38
43
  "off",
39
44
  "minimal",
@@ -63,7 +68,7 @@ export function thinkingMetadataForModel(modelId) {
63
68
  };
64
69
  }
65
70
  export function isReasoningModel(modelId) {
66
- return MODEL_EFFORTS[modelId] !== undefined;
71
+ return MODEL_EFFORTS[modelId] !== undefined || REASONING_MODELS.has(modelId);
67
72
  }
68
73
  /**
69
74
  * opencode model `variants` for the Command Code model: one entry per supported
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-cmd-provider",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Command Code provider + plugin for opencode",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "typecheck": "tsc --noEmit",
20
20
  "refresh:snapshot": "node scripts/refresh-snapshot.mjs",
21
21
  "test": "npm run typecheck && npm run test:unit && npm run test:integration && npm run test:contract && npm run format:check",
22
- "test:unit": "tsx tests/env.test.ts && tsx tests/auth-key.test.ts && tsx tests/converters.test.ts && tsx tests/stream.test.ts && tsx tests/redact.test.ts && tsx tests/cost.test.ts && tsx tests/retry.test.ts && tsx tests/reasoning.test.ts && tsx tests/modalities.test.ts && tsx tests/snapshot.test.ts && tsx tests/refresh-snapshot.test.ts && tsx tests/oauth.test.ts && tsx tests/plugin-models.test.ts",
22
+ "test:unit": "tsx tests/env.test.ts && tsx tests/auth-key.test.ts && tsx tests/converters.test.ts && tsx tests/stream.test.ts && tsx tests/redact.test.ts && tsx tests/cost.test.ts && tsx tests/retry.test.ts && tsx tests/reasoning.test.ts && tsx tests/modalities.test.ts && tsx tests/snapshot.test.ts && tsx tests/refresh-snapshot.test.ts && tsx tests/oauth.test.ts && tsx tests/parse-facts.test.ts && tsx tests/catalog-metadata.test.ts && tsx tests/plugin-models.test.ts",
23
23
  "test:integration": "tsx tests/integration-do-stream.test.ts && tsx tests/integration-do-generate.test.ts",
24
24
  "test:contract": "tsx tests/contract.test.ts",
25
25
  "test:e2e": "node tests/e2e-opencode.mjs",