@brainervirus/opencode-commandcode 0.10.30 → 0.11.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 +4 -0
- package/README.md +1 -0
- package/_version.txt +1 -1
- package/dist/plugin.js +9 -2
- package/dist/src/catalog.d.ts +2 -0
- package/manifest.json +4 -4
- package/package.json +1 -1
- package/src/catalog.ts +17 -1
- package/src/v2models.ts +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ This package is based on **[FanFan4204/opencode-commandcode-provider](https://gi
|
|
|
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
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
|
+
- Free models show `(Free)` after their display name on V1 and V2 when all catalog prices are zero. Model IDs and routing stay unchanged; this is a name suffix, not a native desktop badge. Names that already end in `Free` or `(Free)` keep their existing label.
|
|
30
31
|
|
|
31
32
|
## How it works
|
|
32
33
|
|
package/_version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.84.0
|
package/dist/plugin.js
CHANGED
|
@@ -20109,6 +20109,13 @@ function toConfigKey(id) {
|
|
|
20109
20109
|
const short = slashIdx >= 0 ? id.slice(slashIdx + 1) : id;
|
|
20110
20110
|
return short.toLowerCase();
|
|
20111
20111
|
}
|
|
20112
|
+
function modelDisplayName(entry) {
|
|
20113
|
+
const prices = [entry.cost, ...entry.cost.tiers ?? []];
|
|
20114
|
+
if (entry.cost.context_over_200k)
|
|
20115
|
+
prices.push(entry.cost.context_over_200k);
|
|
20116
|
+
const free = prices.every((price) => price.input === 0 && price.output === 0 && (price.cache_read ?? 0) === 0 && (price.cache_write ?? 0) === 0);
|
|
20117
|
+
return free && !/(?:\sfree|\(free\))$/i.test(entry.name) ? `${entry.name} (Free)` : entry.name;
|
|
20118
|
+
}
|
|
20112
20119
|
function usesAnthropicMessagesApi(id) {
|
|
20113
20120
|
return /(?:^|[/:])claude-/i.test(id);
|
|
20114
20121
|
}
|
|
@@ -20146,7 +20153,7 @@ function generateOpencodeModels(entries) {
|
|
|
20146
20153
|
}
|
|
20147
20154
|
const model = {
|
|
20148
20155
|
id: entry.id,
|
|
20149
|
-
name: entry
|
|
20156
|
+
name: modelDisplayName(entry),
|
|
20150
20157
|
reasoning: entry.reasoning,
|
|
20151
20158
|
tool_call: entry.tool_call,
|
|
20152
20159
|
attachment: entry.attachment ?? false,
|
|
@@ -20233,7 +20240,7 @@ function toV2Model(entry) {
|
|
|
20233
20240
|
id,
|
|
20234
20241
|
modelID: entry.id,
|
|
20235
20242
|
providerID: "commandcode",
|
|
20236
|
-
name: entry
|
|
20243
|
+
name: modelDisplayName(entry),
|
|
20237
20244
|
...entry.family !== undefined ? { family: entry.family } : {},
|
|
20238
20245
|
capabilities: {
|
|
20239
20246
|
tools: entry.tool_call,
|
package/dist/src/catalog.d.ts
CHANGED
|
@@ -90,6 +90,8 @@ export declare function loadCatalogFromLocalCommandCode(options?: {
|
|
|
90
90
|
}): LocalCatalogResult | null;
|
|
91
91
|
/** Short OpenCode map / UI key. Wire id stays the catalog `entry.id` (vendor/…). */
|
|
92
92
|
export declare function toConfigKey(id: string): string;
|
|
93
|
+
/** Display name with a `(Free)` suffix when every catalog price is $0. Wire id untouched. */
|
|
94
|
+
export declare function modelDisplayName(entry: ModelEntry): string;
|
|
93
95
|
export declare function usesAnthropicMessagesApi(id: string): boolean;
|
|
94
96
|
export type ModelApi = "chat" | "responses" | "messages";
|
|
95
97
|
export declare function modelApi(entry: Pick<ModelEntry, "id" | "supported_endpoints">): ModelApi;
|
package/manifest.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-10-
|
|
4
|
-
"pluginVersion": "0.
|
|
5
|
-
"commandCodeVersion": "1.
|
|
6
|
-
"commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.
|
|
3
|
+
"generatedAt": "2026-10-17T00:01:23.431Z",
|
|
4
|
+
"pluginVersion": "0.11.0",
|
|
5
|
+
"commandCodeVersion": "1.84.0",
|
|
6
|
+
"commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.84.0.tgz",
|
|
7
7
|
"modelCount": 92,
|
|
8
8
|
"reasoningModelCount": 79,
|
|
9
9
|
"extraction": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/opencode-commandcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
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
|
@@ -783,6 +783,22 @@ export function toConfigKey(id: string): string {
|
|
|
783
783
|
return short.toLowerCase();
|
|
784
784
|
}
|
|
785
785
|
|
|
786
|
+
/** Display name with a `(Free)` suffix when every catalog price is $0. Wire id untouched. */
|
|
787
|
+
export function modelDisplayName(entry: ModelEntry): string {
|
|
788
|
+
const prices = [entry.cost, ...(entry.cost.tiers ?? [])];
|
|
789
|
+
if (entry.cost.context_over_200k) prices.push(entry.cost.context_over_200k);
|
|
790
|
+
const free = prices.every(
|
|
791
|
+
(price) =>
|
|
792
|
+
price.input === 0 &&
|
|
793
|
+
price.output === 0 &&
|
|
794
|
+
(price.cache_read ?? 0) === 0 &&
|
|
795
|
+
(price.cache_write ?? 0) === 0,
|
|
796
|
+
);
|
|
797
|
+
// Sync appends both "(Free)" (models.dev SKUs) and " Free" (disambiguateModelNames).
|
|
798
|
+
// The leading space/parens keep it a suffix, so "Carefree" still gets the label.
|
|
799
|
+
return free && !/(?:\sfree|\(free\))$/i.test(entry.name) ? `${entry.name} (Free)` : entry.name;
|
|
800
|
+
}
|
|
801
|
+
|
|
786
802
|
export function usesAnthropicMessagesApi(id: string): boolean {
|
|
787
803
|
return /(?:^|[/:])claude-/i.test(id);
|
|
788
804
|
}
|
|
@@ -829,7 +845,7 @@ export function generateOpencodeModels(entries: ModelEntry[]): Record<string, un
|
|
|
829
845
|
|
|
830
846
|
const model: Record<string, unknown> = {
|
|
831
847
|
id: entry.id,
|
|
832
|
-
name: entry
|
|
848
|
+
name: modelDisplayName(entry),
|
|
833
849
|
reasoning: entry.reasoning,
|
|
834
850
|
tool_call: entry.tool_call,
|
|
835
851
|
attachment: entry.attachment ?? false,
|
package/src/v2models.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { modelApi, toConfigKey, type ModelEntry } from "./catalog.js";
|
|
1
|
+
import { modelApi, modelDisplayName, toConfigKey, type ModelEntry } from "./catalog.js";
|
|
2
2
|
|
|
3
3
|
/** Minimal V2 model shape (structural subset of Model.Info). */
|
|
4
4
|
export interface V2Model {
|
|
@@ -53,7 +53,7 @@ export function toV2Model(entry: ModelEntry): V2Model {
|
|
|
53
53
|
id,
|
|
54
54
|
modelID: entry.id,
|
|
55
55
|
providerID: "commandcode",
|
|
56
|
-
name: entry
|
|
56
|
+
name: modelDisplayName(entry),
|
|
57
57
|
...(entry.family !== undefined ? { family: entry.family } : {}),
|
|
58
58
|
capabilities: {
|
|
59
59
|
tools: entry.tool_call,
|