@brainervirus/opencode-commandcode 0.10.1 → 0.10.2
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 +2 -0
- package/README.md +6 -6
- package/dist/plugin.js +2 -2
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/src/catalog.ts +1 -1
package/CHANGELOG.md
CHANGED
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.
|
|
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.
|
|
29
29
|
- Quiet OpenCode startup (diagnostics go to `startup.json`, not stdout).
|
|
30
30
|
|
|
31
31
|
## How it works
|
|
@@ -33,7 +33,7 @@ This package is based on **[FanFan4204/opencode-commandcode-provider](https://gi
|
|
|
33
33
|
For published plugin versions, the six-hour CI schedule extracts the latest `command-code` npm bundle and refreshes callable models plus endpoint metadata, even when the CLI version is unchanged. It opens a catalog PR only when generated artifacts change; at startup the plugin loads those artifacts and registers them with OpenCode — never the other way around.
|
|
34
34
|
|
|
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
|
-
- **Metadata + costs merge** — vendor context length tightens only a fallback context limit, while `supported_endpoints` selects Chat Completions,
|
|
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
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.
|
|
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.
|
|
@@ -46,7 +46,7 @@ OpenCode V2:
|
|
|
46
46
|
|
|
47
47
|
```json
|
|
48
48
|
{
|
|
49
|
-
"plugins": ["@brainervirus/opencode-commandcode
|
|
49
|
+
"plugins": ["@brainervirus/opencode-commandcode"]
|
|
50
50
|
}
|
|
51
51
|
```
|
|
52
52
|
|
|
@@ -54,11 +54,11 @@ OpenCode V1:
|
|
|
54
54
|
|
|
55
55
|
```json
|
|
56
56
|
{
|
|
57
|
-
"plugin": ["@brainervirus/opencode-commandcode
|
|
57
|
+
"plugin": ["@brainervirus/opencode-commandcode"]
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
The bare package name is unpinned and resolves npm's `latest` release when OpenCode installs or updates it; adding `@latest` is unnecessary. OpenCode V2 checks for updates at startup but keeps an existing cached package. Apply a newer package with OpenCode's plugin-update action, then restart to load it. OpenCode V1 can refresh the global package with `opencode plugin @brainervirus/opencode-commandcode --global --force`.
|
|
62
62
|
|
|
63
63
|
`file://` checkouts are **not** updated by npm; `git pull` after CI commits, or switch to the npm plugin line.
|
|
64
64
|
|
|
@@ -76,7 +76,7 @@ Set `COMMANDCODE_API_KEY`, or connect interactively. OpenCode V1 provides **Comm
|
|
|
76
76
|
/models
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
Catalog patches
|
|
79
|
+
Catalog patches ship in new npm releases. OpenCode loads the version in its package cache; an update must be applied through the host before the new catalog appears. If a new model is missing after an announced sync, check the installed package version, apply the update, and restart OpenCode.
|
|
80
80
|
|
|
81
81
|
## Plugin config file
|
|
82
82
|
|
package/dist/plugin.js
CHANGED
|
@@ -20118,12 +20118,12 @@ function modelApi(entry) {
|
|
|
20118
20118
|
const path = (endpoint.split(/[?#]/, 1)[0] ?? "").replace(/\/+$/, "");
|
|
20119
20119
|
return path === route || path.endsWith(`/${route}`);
|
|
20120
20120
|
}) ?? false;
|
|
20121
|
-
if (supports("responses"))
|
|
20122
|
-
return "responses";
|
|
20123
20121
|
if (supports("messages"))
|
|
20124
20122
|
return "messages";
|
|
20125
20123
|
if (supports("chat/completions"))
|
|
20126
20124
|
return "chat";
|
|
20125
|
+
if (supports("responses"))
|
|
20126
|
+
return "responses";
|
|
20127
20127
|
return usesAnthropicMessagesApi(entry.id) ? "messages" : "chat";
|
|
20128
20128
|
}
|
|
20129
20129
|
function generateOpencodeModels(entries) {
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"generatedAt": "2026-09-29T00:01:39.017Z",
|
|
4
|
-
"pluginVersion": "0.10.
|
|
4
|
+
"pluginVersion": "0.10.2",
|
|
5
5
|
"commandCodeVersion": "1.68.0",
|
|
6
6
|
"commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.68.0.tgz",
|
|
7
7
|
"modelCount": 84,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/opencode-commandcode",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
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/src/catalog.ts
CHANGED
|
@@ -797,9 +797,9 @@ export function modelApi(entry: Pick<ModelEntry, "id" | "supported_endpoints">):
|
|
|
797
797
|
return path === route || path.endsWith(`/${route}`);
|
|
798
798
|
}) ?? false;
|
|
799
799
|
|
|
800
|
-
if (supports("responses")) return "responses";
|
|
801
800
|
if (supports("messages")) return "messages";
|
|
802
801
|
if (supports("chat/completions")) return "chat";
|
|
802
|
+
if (supports("responses")) return "responses";
|
|
803
803
|
return usesAnthropicMessagesApi(entry.id) ? "messages" : "chat";
|
|
804
804
|
}
|
|
805
805
|
|