opencode-cmd-provider 1.2.0 → 1.2.1
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.2.1 - 2026-08-21
|
|
4
|
+
|
|
5
|
+
Fix: `/connect` no longer lists Command Code — the plugin failed to load.
|
|
6
|
+
|
|
7
|
+
- The `cmd_plan_summary` tool runtime-imported `@opencode-ai/plugin`, an
|
|
8
|
+
optional peer dependency that `opencode plugin <pkg>` installs in
|
|
9
|
+
`.opencode/`, not next to the plugin. That import threw `ERR_MODULE_NOT_FOUND`
|
|
10
|
+
at load, silently killing the whole server plugin — no auto-registration and
|
|
11
|
+
no `/connect` entry (Command Code vanished from the provider list).
|
|
12
|
+
- The tool now builds its Zod args from a direct `zod` dependency instead of
|
|
13
|
+
`@opencode-ai/plugin`'s `tool()` helper, so the server bundle has zero
|
|
14
|
+
runtime imports of optional peers.
|
|
15
|
+
- Added a contract test that scans the built `dist/` and fails on any runtime
|
|
16
|
+
`@opencode-ai/*` import, so this class of regression can't ship again.
|
|
17
|
+
|
|
3
18
|
## 1.2.0 - 2026-08-21
|
|
4
19
|
|
|
5
20
|
Feature: Deals intelligence — per-model pricing/allowance data in a sidebar panel and a plan-summary tool, delivered zero-step.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import { type ModelDeals, type PlanId, type PlanInfo } from "./catalog.js";
|
|
2
3
|
export declare function normalizePlan(value: unknown): PlanId | undefined;
|
|
3
4
|
export declare function resolvePlan(planArg: string | undefined, env?: NodeJS.ProcessEnv): Promise<PlanId>;
|
|
@@ -5,9 +6,9 @@ export declare function renderPlanSummary(plan: PlanId, deals?: Readonly<Record<
|
|
|
5
6
|
export declare function planSummaryTool(): {
|
|
6
7
|
description: string;
|
|
7
8
|
args: {
|
|
8
|
-
plan:
|
|
9
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
9
10
|
};
|
|
10
|
-
execute(args: {
|
|
11
|
-
plan?: string
|
|
12
|
-
}
|
|
11
|
+
execute: (args: {
|
|
12
|
+
plan?: string;
|
|
13
|
+
}) => Promise<string>;
|
|
13
14
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// breakdown. Plan resolution: tool arg → COMMANDCODE_PLAN → live /alpha/whoami
|
|
3
3
|
// (when a key is present and the network works) → default "go". Rendering is a
|
|
4
4
|
// pure function so tests never touch the network.
|
|
5
|
-
import {
|
|
5
|
+
import { z } from "zod";
|
|
6
6
|
import { MODEL_COSTS } from "../catalog/facts.js";
|
|
7
7
|
import { MODEL_DEALS, PLAN_CATALOG, } from "./catalog.js";
|
|
8
8
|
import { getApiBase } from "../env.js";
|
|
@@ -150,11 +150,11 @@ function estimateMonthlyRequests(modelId, allowance) {
|
|
|
150
150
|
return Math.floor(allowance / perRequest + 1e-9);
|
|
151
151
|
}
|
|
152
152
|
export function planSummaryTool() {
|
|
153
|
-
return
|
|
153
|
+
return {
|
|
154
154
|
description: "Show the Command Code plan's credits, usage windows, per-model monthly allowances (GOAT/Pro) or active deals (other plans), with estimated monthly request counts. Set COMMANDCODE_PLAN (go|goat|pro|max|max20|teampro|provider) to pin the plan without network access.",
|
|
155
155
|
args: {
|
|
156
|
-
plan:
|
|
156
|
+
plan: z.string().optional().describe("go|goat|pro|max|max20|teampro|provider"),
|
|
157
157
|
},
|
|
158
158
|
execute: async (args) => renderPlanSummary(await resolvePlan(args.plan)),
|
|
159
|
-
}
|
|
159
|
+
};
|
|
160
160
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-cmd-provider",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Command Code provider + plugin for opencode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"@ai-sdk/provider": "^4.0.7",
|
|
47
47
|
"@opentui/core": "^0.5.4",
|
|
48
48
|
"@opentui/solid": "^0.5.4",
|
|
49
|
-
"solid-js": "1.9.12"
|
|
49
|
+
"solid-js": "1.9.12",
|
|
50
|
+
"zod": "^4.1.8"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"@opencode-ai/plugin": "*",
|