@jeffreyjyz/opencode-command-code 0.5.20 → 0.5.21
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/README.md +7 -7
- package/dist/index.js +8 -24
- package/dist/sidebar/rows.d.ts +1 -6
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Add the plugin to `opencode.json` (v2 hosts use `plugins`; v1's singular `plugin
|
|
|
25
25
|
|
|
26
26
|
```json
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
"plugins": ["@jeffreyjyz/opencode-command-code"]
|
|
29
29
|
}
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -67,12 +67,12 @@ Usage comes from `cmduse` polled every 5 seconds, read from opencode's message s
|
|
|
67
67
|
|
|
68
68
|
Each command passes its arguments through to the CLI that owns it, and each has an agent-facing tool of the same name, so the model can fetch the same text without you typing a slash command.
|
|
69
69
|
|
|
70
|
-
| Command
|
|
71
|
-
|
|
72
|
-
| `/cmd-usage`
|
|
73
|
-
| `/ocuse-usage`
|
|
74
|
-
| `/arkuse-usage` | `arkuse_usage` | `arkuse` — Volcengine ARK Agent Plan meters in AFP; empty args mean `-1`
|
|
75
|
-
| —
|
|
70
|
+
| Command | Tool | Spawns |
|
|
71
|
+
| --------------- | -------------- | ----------------------------------------------------------------------------- |
|
|
72
|
+
| `/cmd-usage` | `cmd_usage` | `cmduse` — plan, credits, windows, billing period; `plans` for the plan table |
|
|
73
|
+
| `/ocuse-usage` | `ocuse_usage` | `ocuse` — OpenCode Go/Zen meters and per-model spend; empty args mean `-1` |
|
|
74
|
+
| `/arkuse-usage` | `arkuse_usage` | `arkuse` — Volcengine ARK Agent Plan meters in AFP; empty args mean `-1` |
|
|
75
|
+
| — | `mpc_prices` | `mpc` — per-model price comparison across Command Code and OpenCode Go plans |
|
|
76
76
|
|
|
77
77
|
A bare `ocuse` or `arkuse` is a live watch loop that would never return to the dialog, so an empty argument means the one-shot dashboard.
|
|
78
78
|
|
package/dist/index.js
CHANGED
|
@@ -2414,7 +2414,7 @@ function superRefine(fn) {
|
|
|
2414
2414
|
// package.json
|
|
2415
2415
|
var package_default = {
|
|
2416
2416
|
name: "@jeffreyjyz/opencode-command-code",
|
|
2417
|
-
version: "0.5.
|
|
2417
|
+
version: "0.5.21",
|
|
2418
2418
|
description: "Command Code provider + usage dashboard for opencode: two providers (Anthropic wire for Claude, OpenAI wire for everything else) against api.commandcode.ai, live model list, plan gating, /cmd-usage. Requires the cmduse CLI for usage rendering.",
|
|
2419
2419
|
type: "module",
|
|
2420
2420
|
main: "dist/index.js",
|
|
@@ -2426,7 +2426,8 @@ var package_default = {
|
|
|
2426
2426
|
scripts: {
|
|
2427
2427
|
build: "rm -rf dist && bun build src/index.ts --outdir dist --target bun --external @opencode-ai/plugin --external @opencode/plugin --external @opencode/plugin/tui && bun scripts/build-tui.ts && tsc -p tsconfig.build.json",
|
|
2428
2428
|
test: "bun test",
|
|
2429
|
-
|
|
2429
|
+
lint: "biome lint --write .",
|
|
2430
|
+
typecheck: "bun check",
|
|
2430
2431
|
"build:tui": "bun scripts/build-tui.ts",
|
|
2431
2432
|
"extract:catalog": "bun scripts/extract-catalog.ts"
|
|
2432
2433
|
},
|
|
@@ -4046,12 +4047,7 @@ function sseDecoder(onEvent) {
|
|
|
4046
4047
|
var text = (v) => typeof v === "string" ? v : "";
|
|
4047
4048
|
var num = (v) => typeof v === "number" && Number.isFinite(v) ? v : 0;
|
|
4048
4049
|
var rec = (v) => v && typeof v === "object" ? v : {};
|
|
4049
|
-
var TOOL_FINISH = new Set([
|
|
4050
|
-
"tool_use",
|
|
4051
|
-
"tool_calls",
|
|
4052
|
-
"tool-call",
|
|
4053
|
-
"function_call"
|
|
4054
|
-
]);
|
|
4050
|
+
var TOOL_FINISH = new Set(["tool_use", "tool_calls", "tool-call", "function_call"]);
|
|
4055
4051
|
var LENGTH_FINISH = new Set([
|
|
4056
4052
|
"length",
|
|
4057
4053
|
"max_tokens",
|
|
@@ -4100,9 +4096,7 @@ function anthropicReducer() {
|
|
|
4100
4096
|
const open = (index, kind) => {
|
|
4101
4097
|
const id = `${kind === "text" ? "text" : "reasoning"}-${index}`;
|
|
4102
4098
|
blocks.set(index, { type: kind, id });
|
|
4103
|
-
return [
|
|
4104
|
-
{ type: kind === "text" ? "text-start" : "reasoning-start", id }
|
|
4105
|
-
];
|
|
4099
|
+
return [{ type: kind === "text" ? "text-start" : "reasoning-start", id }];
|
|
4106
4100
|
};
|
|
4107
4101
|
return {
|
|
4108
4102
|
feed(event) {
|
|
@@ -4143,19 +4137,13 @@ function anthropicReducer() {
|
|
|
4143
4137
|
if (textDelta) {
|
|
4144
4138
|
const parts = block?.type === "text" ? [] : open(index, "text");
|
|
4145
4139
|
const id = blocks.get(index)?.id ?? `text-${index}`;
|
|
4146
|
-
return [
|
|
4147
|
-
...parts,
|
|
4148
|
-
{ type: "text-delta", id, delta: textDelta }
|
|
4149
|
-
];
|
|
4140
|
+
return [...parts, { type: "text-delta", id, delta: textDelta }];
|
|
4150
4141
|
}
|
|
4151
4142
|
const thinking = text(delta.thinking);
|
|
4152
4143
|
if (thinking) {
|
|
4153
4144
|
const parts = block?.type === "thinking" ? [] : open(index, "thinking");
|
|
4154
4145
|
const id = blocks.get(index)?.id ?? `reasoning-${index}`;
|
|
4155
|
-
return [
|
|
4156
|
-
...parts,
|
|
4157
|
-
{ type: "reasoning-delta", id, delta: thinking }
|
|
4158
|
-
];
|
|
4146
|
+
return [...parts, { type: "reasoning-delta", id, delta: thinking }];
|
|
4159
4147
|
}
|
|
4160
4148
|
const partial = text(delta.partial_json);
|
|
4161
4149
|
if (partial && block?.type === "tool_use") {
|
|
@@ -4382,11 +4370,7 @@ function openaiReducer() {
|
|
|
4382
4370
|
return parts;
|
|
4383
4371
|
},
|
|
4384
4372
|
close() {
|
|
4385
|
-
const parts = [
|
|
4386
|
-
...closeReasoning(),
|
|
4387
|
-
...closeText(),
|
|
4388
|
-
...flushTools()
|
|
4389
|
-
];
|
|
4373
|
+
const parts = [...closeReasoning(), ...closeText(), ...flushTools()];
|
|
4390
4374
|
if (pending && !finished) {
|
|
4391
4375
|
finished = true;
|
|
4392
4376
|
parts.push({
|
package/dist/sidebar/rows.d.ts
CHANGED
|
@@ -11,12 +11,7 @@ export type Tone = "base" | "muted" | "strong" | "ok" | "warn" | "crit";
|
|
|
11
11
|
* A row. `headline` marks the two rows whose label names the thing the panel is
|
|
12
12
|
* about (the plan, the active model); the panel colours their labels apart.
|
|
13
13
|
*/
|
|
14
|
-
export type SidebarRow = [
|
|
15
|
-
label: string,
|
|
16
|
-
value: string,
|
|
17
|
-
tone?: Tone,
|
|
18
|
-
headline?: true
|
|
19
|
-
];
|
|
14
|
+
export type SidebarRow = [label: string, value: string, tone?: Tone, headline?: true];
|
|
20
15
|
/** Headroom severity: comfortable to 70%, tight to 90%, over after that. */
|
|
21
16
|
export declare function pctTone(pct: number): Tone;
|
|
22
17
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeffreyjyz/opencode-command-code",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.21",
|
|
4
4
|
"description": "Command Code provider + usage dashboard for opencode: two providers (Anthropic wire for Claude, OpenAI wire for everything else) against api.commandcode.ai, live model list, plan gating, /cmd-usage. Requires the cmduse CLI for usage rendering.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "rm -rf dist && bun build src/index.ts --outdir dist --target bun --external @opencode-ai/plugin --external @opencode/plugin --external @opencode/plugin/tui && bun scripts/build-tui.ts && tsc -p tsconfig.build.json",
|
|
14
14
|
"test": "bun test",
|
|
15
|
-
"
|
|
15
|
+
"lint": "biome lint --write .",
|
|
16
|
+
"typecheck": "bun check",
|
|
16
17
|
"build:tui": "bun scripts/build-tui.ts",
|
|
17
18
|
"extract:catalog": "bun scripts/extract-catalog.ts"
|
|
18
19
|
},
|