@brainervirus/opencode-commandcode 0.10.2 → 0.10.4

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
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.10.4] - 2026-09-29
11
+
12
+ ## [0.10.3] - 2026-09-29
13
+
10
14
  ## [0.10.2] - 2026-09-29
11
15
 
12
16
  ## [0.10.1] - 2026-09-29
package/README.md CHANGED
@@ -25,7 +25,7 @@ This package is based on **[FanFan4204/opencode-commandcode-provider](https://gi
25
25
  - Vision vs text-only comes from the Command Code CLI catalog (`inputModalities` on every SKU). [models.dev](https://models.dev) only adds extra inputs (video/audio/pdf) when it matches.
26
26
  - Reasoning effort **variants** on models that declare `reasoningEfforts`.
27
27
  - Release date, family, input limits, model status, vendor context limits, and matched context-price tiers flow through the bundled catalog. V2 gets native release, family, input, status, and tier fields; V1 keeps its supported fields and base prices, with `context_over_200k` where representable.
28
- - The provider's `supported_endpoints` metadata chooses each model's API route. When a model advertises Messages, it uses Anthropic Messages; otherwise Chat Completions is preferred when available, and Responses is used when it is the only advertised route. This avoids malformed annotation events seen on the provider's Responses stream while preserving Responses-only models. V1 maps Responses to `@ai-sdk/openai`; V2 maps it to `aisdk:@ai-sdk/openai`. Claude Sonnet 4.6 returned `MODEL_NOT_IN_PLAN` with the message “available in Pro and above plans or extra on-demand usage”; entitled Claude access has not been live-verified. If a model fails on an account entitled to use it, please [open an issue](https://github.com/BrainerVirus/opencode-commandcode/issues) with the model ID and OpenCode version, or submit a PR with a reproducible fix.
28
+ - The provider's `supported_endpoints` metadata chooses each model's API route. Messages is preferred when advertised; otherwise Chat Completions is preferred, and Responses is used only when it is the sole advertised route. This avoids the malformed Responses function-call start event observed on DeepSeek V4.1 Flash `#max` in OpenCode V2.0.18: `response.output_item.added` contained a `function_call` item without its required `arguments` string. That exact tool-call flow now passes through Chat Completions on V1 and V2. Responses mappings remain available for response-only models, but the current catalog has none. Claude Sonnet 4.6 returned `MODEL_NOT_IN_PLAN` with the message “available in Pro and above plans or extra on-demand usage”; entitled Claude access has not been live-verified. If a model fails on an account entitled to use it, please [open an issue](https://github.com/BrainerVirus/opencode-commandcode/issues) with the model ID and OpenCode version, or submit a PR with a reproducible fix.
29
29
  - Quiet OpenCode startup (diagnostics go to `startup.json`, not stdout).
30
30
 
31
31
  ## How it works
@@ -35,7 +35,7 @@ For published plugin versions, the six-hour CI schedule extracts the latest `com
35
35
  - **Extract + filter** — model entries (ids, names, reasoning, `inputModalities`, limits) are evaluated out of the minified CLI bundle (`src/catalog.ts`), then intersected with the callable IDs reported by the provider API.
36
36
  - **Metadata + costs merge** — vendor context length tightens only a fallback context limit, while `supported_endpoints` selects Messages, Chat Completions, or Responses per model in that preference order; missing endpoint metadata preserves the last known route data. models.dev contributes release date, family, input limit, status, modalities, and cost tiers when present. Tier rows are accepted only when their base prices match this Command Code catalog. Base costs use CLI bundle → official Command Code docs → free SKUs (`$0`) → [models.dev](https://models.dev) reference prices → unmatched placeholder. Anything still unmatched marks the catalog `degraded`. This runs at sync time only; runtime never fetches metadata or prices.
37
37
  - **Artifacts** — `models.json` (the catalog), `_version.txt` (upstream version), `manifest.json` (counts, per-source cost stats, `healthy`/`degraded`/`broken` status).
38
- - **Version-specific registration** — V1 uses the `plugin` config key, `server()` provider map, and V1 auth callback. V2 uses `plugins`, provider/model transforms, and a `commandcode` integration with key and `COMMANDCODE_API_KEY` environment methods. Both retain the Command Code wire model ID. V2 exposes tiered context pricing; V1 emits its supported `context_over_200k` field and keeps flat pricing for other tiers.
38
+ - **Version-specific registration** — V1 uses the `plugin` config key, direct AI SDK packages, the `server()` provider map, and its auth callback. V2 uses `plugins`, OpenCode's native provider runtimes, provider/model transforms, and a `commandcode` integration with key and `COMMANDCODE_API_KEY` environment methods. Both retain the Command Code wire model ID. V2 exposes tiered context pricing; V1 emits its supported `context_over_200k` field and keeps flat pricing for other tiers.
39
39
  - **Degraded/cache fallbacks** — a `degraded`/`broken` manifest sets the degraded flag with a reason; an unreadable bundled `models.json` falls back to the last-good cache; auth/connect still registers even with an empty catalog.
40
40
 
41
41
  ## Quick Start
@@ -64,7 +64,7 @@ The bare package name is unpinned and resolves npm's `latest` release when OpenC
64
64
 
65
65
  ### 2. No provider block needed
66
66
 
67
- On OpenCode V2 the plugin registers the `commandcode` provider, its models, and its API base URL through the V2 provider API. On V1 the `server` hook fills `provider.commandcode` defaults — `npm: "@ai-sdk/openai-compatible"` plus the Provider API `baseURL`; the plugin package itself is never the SDK `npm` field. Only add a manual provider entry if you need non-default transport options.
67
+ On OpenCode V2 the plugin registers the `commandcode` provider, its models, the native OpenCode runtime, and its API base URL through the V2 provider API. On V1 the `server` hook fills `provider.commandcode` defaults — `npm: "@ai-sdk/openai-compatible"` plus the Provider API `baseURL`; the plugin package itself is never the SDK `npm` field. Only add a manual provider entry if you need non-default transport options.
68
68
 
69
69
  ### 3. Connect
70
70
 
package/_version.txt CHANGED
@@ -1 +1 @@
1
- 1.68.0
1
+ 1.69.0
package/dist/plugin.js CHANGED
@@ -20273,9 +20273,9 @@ function toV2Model(entry) {
20273
20273
  };
20274
20274
  const api2 = modelApi(entry);
20275
20275
  if (api2 === "responses")
20276
- model.package = "aisdk:@ai-sdk/openai";
20276
+ model.package = "@opencode/ai/providers/openai/responses";
20277
20277
  else if (api2 === "messages")
20278
- model.package = "aisdk:@ai-sdk/anthropic";
20278
+ model.package = "@opencode/ai/providers/anthropic";
20279
20279
  return model;
20280
20280
  }
20281
20281
  function generateV2Models(entries) {
@@ -20316,7 +20316,8 @@ var catalogPaths = () => {
20316
20316
 
20317
20317
  // plugin.ts
20318
20318
  var { models: MODELS_PATH, manifest: MANIFEST_PATH, version: VERSION_PATH } = catalogPaths();
20319
- var PROVIDER_SDK_NPM = "@ai-sdk/openai-compatible";
20319
+ var V1_PROVIDER_SDK_NPM = "@ai-sdk/openai-compatible";
20320
+ var V2_PROVIDER_PACKAGE = "@opencode/ai/providers/openai-compatible";
20320
20321
  var PROVIDER_API_BASE_URL = "https://api.commandcode.ai/provider/v1";
20321
20322
  function loadPluginConfig(deps = liveEnv) {
20322
20323
  const dir = join4(deps.homedir(), ".config", "opencode");
@@ -20487,12 +20488,12 @@ async function server() {
20487
20488
  const pluginCfg = loadPluginConfig();
20488
20489
  const debug = pluginCfg.debugStartupLogs === true;
20489
20490
  if (!cc.npm)
20490
- cc.npm = PROVIDER_SDK_NPM;
20491
+ cc.npm = V1_PROVIDER_SDK_NPM;
20491
20492
  if (!cc.name)
20492
20493
  cc.name = "Command Code";
20493
20494
  if (!cc.env)
20494
20495
  cc.env = ["COMMANDCODE_API_KEY"];
20495
- if (cc.npm === PROVIDER_SDK_NPM) {
20496
+ if (cc.npm === V1_PROVIDER_SDK_NPM) {
20496
20497
  if (cc.options === undefined)
20497
20498
  cc.options = {};
20498
20499
  if (typeof cc.options === "object" && cc.options !== null) {
@@ -20555,7 +20556,7 @@ async function setup(ctx) {
20555
20556
  activation: "auto",
20556
20557
  integrationID: "commandcode",
20557
20558
  env: ["COMMANDCODE_API_KEY"],
20558
- package: `aisdk:${PROVIDER_SDK_NPM}`,
20559
+ package: V2_PROVIDER_PACKAGE,
20559
20560
  settings: {
20560
20561
  baseURL: PROVIDER_API_BASE_URL
20561
20562
  }
package/manifest.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-09-29T00:01:39.017Z",
4
- "pluginVersion": "0.10.2",
5
- "commandCodeVersion": "1.68.0",
6
- "commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.68.0.tgz",
3
+ "generatedAt": "2026-09-29T06:01:06.703Z",
4
+ "pluginVersion": "0.10.4",
5
+ "commandCodeVersion": "1.69.0",
6
+ "commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.69.0.tgz",
7
7
  "modelCount": 84,
8
8
  "reasoningModelCount": 71,
9
9
  "extraction": {
package/models.json CHANGED
@@ -1854,9 +1854,25 @@
1854
1854
  ],
1855
1855
  "tool_call": true,
1856
1856
  "cost": {
1857
- "input": 1.2,
1858
- "output": 3.6,
1859
- "cache_read": 0.3
1857
+ "input": 2,
1858
+ "output": 6,
1859
+ "cache_read": 0.5,
1860
+ "tiers": [
1861
+ {
1862
+ "input": 4,
1863
+ "output": 12,
1864
+ "cache_read": 1,
1865
+ "tier": {
1866
+ "type": "context",
1867
+ "size": 200000
1868
+ }
1869
+ }
1870
+ ],
1871
+ "context_over_200k": {
1872
+ "input": 4,
1873
+ "output": 12,
1874
+ "cache_read": 1
1875
+ }
1860
1876
  },
1861
1877
  "limit": {
1862
1878
  "context": 500000,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/opencode-commandcode",
3
- "version": "0.10.2",
3
+ "version": "0.10.4",
4
4
  "description": "Command Code API provider for opencode — use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, and Step models via Command Code",
5
5
  "keywords": [
6
6
  "ai",
package/plugin.ts CHANGED
@@ -16,10 +16,10 @@ import { ManifestSchema, ModelEntrySchema, PluginFileConfigSchema } from "./src/
16
16
 
17
17
  const { models: MODELS_PATH, manifest: MANIFEST_PATH, version: VERSION_PATH } = catalogPaths();
18
18
 
19
- // Transport decision (docs/2026-08-28-ci-catalog/spec.md:20): OpenAI-compatible AI SDK +
20
- // Provider API; this package is the plugin, never the SDK `npm` field. V1 takes the bare
21
- // npm name; the `aisdk:` prefix is V2-only.
22
- const PROVIDER_SDK_NPM = "@ai-sdk/openai-compatible";
19
+ // V1 loads the AI SDK package directly. V2 uses OpenCode's native runtime so provider
20
+ // settings such as baseURL survive registry materialization.
21
+ const V1_PROVIDER_SDK_NPM = "@ai-sdk/openai-compatible";
22
+ const V2_PROVIDER_PACKAGE = "@opencode/ai/providers/openai-compatible";
23
23
  const PROVIDER_API_BASE_URL = "https://api.commandcode.ai/provider/v1";
24
24
 
25
25
  type PluginFileConfig = z.infer<typeof PluginFileConfigSchema>;
@@ -239,13 +239,13 @@ export async function server() {
239
239
  const pluginCfg = loadPluginConfig();
240
240
  const debug = pluginCfg.debugStartupLogs === true;
241
241
 
242
- if (!cc.npm) cc.npm = PROVIDER_SDK_NPM;
242
+ if (!cc.npm) cc.npm = V1_PROVIDER_SDK_NPM;
243
243
  if (!cc.name) cc.name = "Command Code";
244
244
  if (!cc.env) cc.env = ["COMMANDCODE_API_KEY"];
245
245
  // V1 resolves `npm` through BunProc.install and calls the first `create*` export, so
246
246
  // the SDK package must be the OpenAI-compatible one; give it the Provider API URL
247
247
  // unless the user already configured another baseURL (custom npm stays untouched).
248
- if (cc.npm === PROVIDER_SDK_NPM) {
248
+ if (cc.npm === V1_PROVIDER_SDK_NPM) {
249
249
  if (cc.options === undefined) cc.options = {};
250
250
  if (typeof cc.options === "object" && cc.options !== null) {
251
251
  const options = cc.options as Record<string, unknown>;
@@ -307,7 +307,7 @@ async function setup(ctx: any): Promise<void> {
307
307
  activation: "auto",
308
308
  integrationID: "commandcode",
309
309
  env: ["COMMANDCODE_API_KEY"],
310
- package: `aisdk:${PROVIDER_SDK_NPM}`,
310
+ package: V2_PROVIDER_PACKAGE,
311
311
  settings: {
312
312
  baseURL: PROVIDER_API_BASE_URL,
313
313
  },
package/src/v2models.ts CHANGED
@@ -92,8 +92,8 @@ export function toV2Model(entry: ModelEntry): V2Model {
92
92
  },
93
93
  };
94
94
  const api = modelApi(entry);
95
- if (api === "responses") model.package = "aisdk:@ai-sdk/openai";
96
- else if (api === "messages") model.package = "aisdk:@ai-sdk/anthropic";
95
+ if (api === "responses") model.package = "@opencode/ai/providers/openai/responses";
96
+ else if (api === "messages") model.package = "@opencode/ai/providers/anthropic";
97
97
  return model;
98
98
  }
99
99