@mars-sea/dsh-commandcode-provider 0.5.0 → 0.6.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 +7 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/lib/client.js +81 -16
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +5 -5
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.6.0] - 2026-08-19
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Synced with the official command-code@1.28.4 CLI** (upstream moved 1.28.1 → 1.28.4: 1.28.2 raised the Qwen 3.8 27B usage allowance on GOAT and Pro, 1.28.3 fixed a CLI UI overlay issue; 1.28.4 is not on the changelog page yet). `COMMAND_CODE_CLI_VERSION` is now `1.28.4`. No snapshot or wire changes: the 1.28.4 bundle's effort map, plan maps, ZA model table, endpoints, request fields, and stream event types are all identical to 1.28.1, and the live catalog still lists the same 56 models.
|
|
12
|
+
- **The settings page's account-usage card is now a carousel.** With several accounts configured, a tab strip (account label + status dot) switches between per-account reports instead of stacking them, so the page no longer grows with each account; the selector defaults to the currently serving account. Each account's report carries its own **remove** button (staged like every other edit, persisted on save) — offered only for accounts the settings document actually owns (the default account and composition-only literal-key accounts are not removable from the page), and the per-row remove buttons in the account-management card below were removed (unsaved additions keep theirs, since they never appear in the Host-side usage report). Accounts staged for removal disappear from the carousel immediately and stay hidden across the post-save refresh.
|
|
13
|
+
|
|
7
14
|
## [0.5.0] - 2026-08-19
|
|
8
15
|
|
|
9
16
|
### Added
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[](https://opensource.org/licenses/MIT)
|
|
11
11
|
[](https://www.npmjs.com/package/@mars-sea/dsh-commandcode-provider)
|
|
12
12
|
|
|
13
|
-
Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) LLM provider plugin for **Command Code**, ported from [pi-commandcode-provider](https://github.com/patlux/pi-commandcode-provider) (MIT). It registers a `commandcode` provider whose requests are translated to Command Code's Provider API (`POST /alpha/generate`, reverse-engineered by the pi plugin, `command-code@1.28.
|
|
13
|
+
Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) LLM provider plugin for **Command Code**, ported from [pi-commandcode-provider](https://github.com/patlux/pi-commandcode-provider) (MIT). It registers a `commandcode` provider whose requests are translated to Command Code's Provider API (`POST /alpha/generate`, reverse-engineered by the pi plugin, `command-code@1.28.4`).
|
|
14
14
|
|
|
15
15
|
> This is a community integration. You need your own Command Code account and API key or subscription, and Command Code's terms apply. This project is not affiliated with Command Code, Inc.
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@ Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harnes
|
|
|
22
22
|
- **API key resolution order**: `config.apiKey` → credential ref `apiKeyEnv` (default `COMMANDCODE_API_KEY`) → launch environment → the official CLI auth file (`~/.commandcode/auth.json`, from `command-code login`).
|
|
23
23
|
- **Model-picker annotations**: every model shows the **minimum plan** that includes it (`KNOWN_PLANS`), an **active deal** or `FREE` badge (`KNOWN_DEALS`, expiry-aware so lapsed discounts hide themselves), the **current peak/off-peak state** (`Peak`/`Half`) for time-of-day-priced models, an **`Image`** marker for Vision models, and the **context window** (`1M` / `256K` / `262K`) — e.g. *"Go · 50% off · Image · 1M"*, *"Go · Half · 1M"*. The list is **sorted by plan tier** (Go → GOAT → Pro → Provider/Max), so the models your plan can use lead the picker.
|
|
24
24
|
- **Plan-aware picker filtering**: the picker **hides models above your subscription tier** outright (resolved live from your account's billing state). It fails open — an unreachable billing endpoint, an unknown plan, or a positive on-demand credit balance (which the official CLI treats as unlocking every model) all keep the full catalog visible — and the server stays the final gate. Set **Hide out-of-plan models** off on the settings page (or `filterModelsByPlan: false` in the `llm-commandcode` settings section) to always list every model.
|
|
25
|
-
- **Reasoning-effort support** for models the official catalog marks as such (`KNOWN_EFFORTS`, matching `command-code@1.28.
|
|
25
|
+
- **Reasoning-effort support** for models the official catalog marks as such (`KNOWN_EFFORTS`, matching `command-code@1.28.4`); reasoning models without effort levels still think automatically, exactly like the official CLI.
|
|
26
26
|
- **Image input for Vision-capable models** (sent in the official wire format via the dsh attachment service); text-only models refuse images loudly (`UNSUPPORTED_CONTENT`) rather than dropping them.
|
|
27
27
|
|
|
28
28
|
<img src="assets/screenshots/model-picker.png" alt="Model picker with plan, deal, image and context annotations" width="250">
|
package/README.zh-CN.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[](https://opensource.org/licenses/MIT)
|
|
11
11
|
[](https://www.npmjs.com/package/@mars-sea/dsh-commandcode-provider)
|
|
12
12
|
|
|
13
|
-
非官方 [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) 的 LLM provider 插件,用于 **Command Code**,移植自 [pi-commandcode-provider](https://github.com/patlux/pi-commandcode-provider)(MIT 协议)。它注册了一个 `commandcode` provider,将请求转换为 Command Code 的 Provider API(`POST /alpha/generate`,由 pi 插件逆向工程,对应 `command-code@1.28.
|
|
13
|
+
非官方 [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) 的 LLM provider 插件,用于 **Command Code**,移植自 [pi-commandcode-provider](https://github.com/patlux/pi-commandcode-provider)(MIT 协议)。它注册了一个 `commandcode` provider,将请求转换为 Command Code 的 Provider API(`POST /alpha/generate`,由 pi 插件逆向工程,对应 `command-code@1.28.4`)。
|
|
14
14
|
|
|
15
15
|
> 这是一个社区集成。你需要自己的 Command Code 账号、API key 或订阅,并遵守 Command Code 的服务条款。本项目与 Command Code, Inc. 无关。
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
- **API key 解析顺序**:`config.apiKey` → 凭据引用 `apiKeyEnv`(默认 `COMMANDCODE_API_KEY`)→ 启动环境变量 → 官方 CLI 认证文件(`~/.commandcode/auth.json`,由 `command-code login` 写入)。
|
|
23
23
|
- **模型选择器标注**:每个模型显示包含它的**最低套餐**(`KNOWN_PLANS`)、**活动折扣**或 `FREE` 徽章(`KNOWN_DEALS`,到期自动隐藏已失效折扣)、峰谷定价模型的**当前时段状态**(`Peak`/`Half`,按当前 UTC 小时动态判断)、Vision 模型的 **`Image`** 标记,以及**上下文长度**(`1M` / `256K` / `262K`)——例如 *"Go · 50% off · Image · 1M"*、*"Go · Half · 1M"*。列表**按套餐排序**(Go → GOAT → Pro → Provider/Max),你当前套餐能用的模型总是排在最前。
|
|
24
24
|
- **按套餐过滤选择器**:选择器会**直接隐藏超出你订阅套餐的模型**(根据账户账单状态实时判断)。全程失败开放——账单接口不可用、套餐未知,或账户持有按需余额(官方 CLI 视为解锁全部模型)时都显示完整目录——服务端仍是最终闸门。在设置页关闭「隐藏套餐外模型」开关(或在 `llm-commandcode` 设置段中设 `filterModelsByPlan: false`)可始终列出全部模型。
|
|
25
|
-
- **推理强度(reasoning-effort)支持**:针对官方目录标为推理模型的模型(`KNOWN_EFFORTS`,与 `command-code@1.28.
|
|
25
|
+
- **推理强度(reasoning-effort)支持**:针对官方目录标为推理模型的模型(`KNOWN_EFFORTS`,与 `command-code@1.28.4` 一致);没有可选档位但仍支持思考的模型会自动思考,与官方 CLI 行为完全一致。
|
|
26
26
|
- **支持视觉模型的图片输入**(通过 dsh 附件服务、以官方 wire 格式发送);纯文本模型会明确拒绝图片(`UNSUPPORTED_CONTENT`)而非静默丢弃。
|
|
27
27
|
|
|
28
28
|
<img src="assets/screenshots/model-picker.png" alt="带套餐、折扣、图片与上下文标注的模型选择器" width="250">
|
package/lib/client.js
CHANGED
|
@@ -216,6 +216,7 @@ window.__ModuleLoader__.load({
|
|
|
216
216
|
filterModelsByPlan: this.field("filterModelsByPlan"),
|
|
217
217
|
activeAccount: this.field("activeAccount"),
|
|
218
218
|
accounts,
|
|
219
|
+
accountsRemoving: [...this.removedRefs],
|
|
219
220
|
dirty: plan.length > 0 || this.accountsDirty(),
|
|
220
221
|
invalid: plan.some((item) => item.run === void 0),
|
|
221
222
|
saving: this.saving,
|
|
@@ -1039,7 +1040,7 @@ window.__ModuleLoader__.load({
|
|
|
1039
1040
|
* One pool account's facts (identity, totals, credits, window limits)
|
|
1040
1041
|
* rendered inside the account-usage card.
|
|
1041
1042
|
*/
|
|
1042
|
-
function AccountReport({ entry, t }) {
|
|
1043
|
+
function AccountReport({ entry, t, onRemove }) {
|
|
1043
1044
|
const report = entry.report;
|
|
1044
1045
|
const account = report.account;
|
|
1045
1046
|
const accountName = account === void 0 ? "" : account.userName || account.name;
|
|
@@ -1072,6 +1073,13 @@ window.__ModuleLoader__.load({
|
|
|
1072
1073
|
planStatus !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1073
1074
|
className: "cc-usagePlanStatus",
|
|
1074
1075
|
children: planStatus
|
|
1076
|
+
}) : null,
|
|
1077
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cc-usageMetaSpacer" }),
|
|
1078
|
+
onRemove !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1079
|
+
type: "button",
|
|
1080
|
+
className: "cc-usageRefresh",
|
|
1081
|
+
onClick: onRemove,
|
|
1082
|
+
children: t("accountRemove")
|
|
1075
1083
|
}) : null
|
|
1076
1084
|
]
|
|
1077
1085
|
}),
|
|
@@ -1161,13 +1169,21 @@ window.__ModuleLoader__.load({
|
|
|
1161
1169
|
]
|
|
1162
1170
|
});
|
|
1163
1171
|
}
|
|
1172
|
+
/** The status dot on an account tab: cooling/invalid warn, everything else ok. */
|
|
1173
|
+
function AccountTabDot({ entry }) {
|
|
1174
|
+
const cls = entry.mark === "invalid-credential" ? "cc-tabDot cc-tabDotError" : entry.mark !== "" || entry.cooldownUntil > 0 ? "cc-tabDot cc-tabDotWarn" : "cc-tabDot cc-tabDotOk";
|
|
1175
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: cls });
|
|
1176
|
+
}
|
|
1164
1177
|
/**
|
|
1165
1178
|
* The account-usage card: the `/commandcode` dashboard's facts rendered as
|
|
1166
|
-
* a native settings card
|
|
1167
|
-
*
|
|
1168
|
-
*
|
|
1179
|
+
* a native settings card. With several accounts the card is a carousel — a
|
|
1180
|
+
* tab strip (label + status dot) switches between accounts so the page stays
|
|
1181
|
+
* short; each account's report carries its own remove affordance (the
|
|
1182
|
+
* default account is not removable). Accounts staged for removal in the
|
|
1183
|
+
* management card are hidden here immediately. Data arrives through the
|
|
1184
|
+
* `commandcode/report` Remote; the API keys never leave the Host.
|
|
1169
1185
|
*/
|
|
1170
|
-
function UsageCard({ t, usage, apiKeyConfigured, onRefresh }) {
|
|
1186
|
+
function UsageCard({ t, usage, apiKeyConfigured, removingIds, removableIds, canManage, onRefresh, onRemoveAccount }) {
|
|
1171
1187
|
(0, react.useEffect)(() => {
|
|
1172
1188
|
if (apiKeyConfigured && usage.status === "idle") onRefresh();
|
|
1173
1189
|
}, [
|
|
@@ -1177,6 +1193,25 @@ window.__ModuleLoader__.load({
|
|
|
1177
1193
|
]);
|
|
1178
1194
|
const loading = usage.status === "loading";
|
|
1179
1195
|
const report = usage.report;
|
|
1196
|
+
const [locallyRemoved, setLocallyRemoved] = (0, react.useState)([]);
|
|
1197
|
+
(0, react.useEffect)(() => {
|
|
1198
|
+
setLocallyRemoved([]);
|
|
1199
|
+
}, [usage.fetchedAt]);
|
|
1200
|
+
const hidden = /* @__PURE__ */ new Set([...removingIds, ...locallyRemoved]);
|
|
1201
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
1202
|
+
const entries = (report?.accounts ?? []).filter((entry) => {
|
|
1203
|
+
if (hidden.has(entry.id)) return false;
|
|
1204
|
+
if (seenIds.has(entry.id)) return false;
|
|
1205
|
+
seenIds.add(entry.id);
|
|
1206
|
+
return true;
|
|
1207
|
+
});
|
|
1208
|
+
const [selectedId, setSelectedId] = (0, react.useState)(void 0);
|
|
1209
|
+
const selected = entries.find((entry) => entry.id === selectedId) ?? entries.find((entry) => entry.active) ?? entries[0];
|
|
1210
|
+
const removeSelected = canManage && selected !== void 0 && removableIds.includes(selected.id) ? () => {
|
|
1211
|
+
const id = selected.id;
|
|
1212
|
+
setLocallyRemoved((prev) => [...prev, id]);
|
|
1213
|
+
onRemoveAccount(id);
|
|
1214
|
+
} : void 0;
|
|
1180
1215
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1181
1216
|
className: "cc-usageCard",
|
|
1182
1217
|
"aria-label": t("usageTitle"),
|
|
@@ -1211,10 +1246,24 @@ window.__ModuleLoader__.load({
|
|
|
1211
1246
|
role: "status",
|
|
1212
1247
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [t("usageError"), usage.error !== void 0 && usage.error !== "" ? ` — ${usage.error}` : ""] })
|
|
1213
1248
|
}) : null,
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1249
|
+
entries.length > 1 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1250
|
+
className: "cc-tabs",
|
|
1251
|
+
role: "tablist",
|
|
1252
|
+
"aria-label": t("accountsTitle"),
|
|
1253
|
+
children: entries.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1254
|
+
type: "button",
|
|
1255
|
+
role: "tab",
|
|
1256
|
+
"aria-selected": selected?.id === entry.id,
|
|
1257
|
+
className: selected?.id === entry.id ? "cc-tab cc-tabActive" : "cc-tab",
|
|
1258
|
+
onClick: () => setSelectedId(entry.id),
|
|
1259
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccountTabDot, { entry }), entry.label]
|
|
1260
|
+
}, entry.id))
|
|
1261
|
+
}) : null,
|
|
1262
|
+
selected !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccountReport, {
|
|
1263
|
+
entry: selected,
|
|
1264
|
+
t,
|
|
1265
|
+
onRemove: removeSelected
|
|
1266
|
+
}, selected.id) : null,
|
|
1218
1267
|
report !== void 0 && usage.fetchedAt !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1219
1268
|
className: "cc-usageMeta",
|
|
1220
1269
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cc-usageMetaSpacer" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
@@ -1229,7 +1278,13 @@ window.__ModuleLoader__.load({
|
|
|
1229
1278
|
]
|
|
1230
1279
|
});
|
|
1231
1280
|
}
|
|
1232
|
-
/**
|
|
1281
|
+
/**
|
|
1282
|
+
* One extra account row: label, key, configured badge. Saved accounts are
|
|
1283
|
+
* removed from the usage card above; a NOT-YET-SAVED addition never appears
|
|
1284
|
+
* there (the usage report is Host-side), so it keeps its own remove button —
|
|
1285
|
+
* otherwise the only way to undo a mistaken Add would be discarding every
|
|
1286
|
+
* other staged edit.
|
|
1287
|
+
*/
|
|
1233
1288
|
function AccountRow({ account, disabled, t, onLabel, onKey, onRemove }) {
|
|
1234
1289
|
const locked = !account.writable;
|
|
1235
1290
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1252,13 +1307,13 @@ window.__ModuleLoader__.load({
|
|
|
1252
1307
|
className: account.configured ? "cc-badge" : "cc-badgeMuted",
|
|
1253
1308
|
children: account.configured ? t("apiKeySet") : t("apiKeyUnset")
|
|
1254
1309
|
}),
|
|
1255
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1310
|
+
account.added ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1256
1311
|
type: "button",
|
|
1257
1312
|
className: "cc-reset",
|
|
1258
1313
|
disabled,
|
|
1259
1314
|
onClick: onRemove,
|
|
1260
1315
|
children: t("accountRemove")
|
|
1261
|
-
})
|
|
1316
|
+
}) : null
|
|
1262
1317
|
]
|
|
1263
1318
|
})]
|
|
1264
1319
|
}),
|
|
@@ -1287,7 +1342,7 @@ window.__ModuleLoader__.load({
|
|
|
1287
1342
|
]
|
|
1288
1343
|
});
|
|
1289
1344
|
}
|
|
1290
|
-
/** The multi-account card: extra accounts in rotation order + add button. */
|
|
1345
|
+
/** The multi-account card: the active-account selector + extra accounts in rotation order + add button. */
|
|
1291
1346
|
function AccountsCard({ t, state, disabled, onAdd, onRemove, onLabel, onKey, onActive, onActiveReset }) {
|
|
1292
1347
|
const active = state.activeAccount;
|
|
1293
1348
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1405,7 +1460,11 @@ window.__ModuleLoader__.load({
|
|
|
1405
1460
|
t,
|
|
1406
1461
|
usage,
|
|
1407
1462
|
apiKeyConfigured: state.anyAccountConfigured,
|
|
1408
|
-
|
|
1463
|
+
removingIds: state.accountsRemoving,
|
|
1464
|
+
removableIds: state.accounts.map((account) => account.id),
|
|
1465
|
+
canManage: state.writable,
|
|
1466
|
+
onRefresh: props.refreshUsage,
|
|
1467
|
+
onRemoveAccount: props.removeAccount
|
|
1409
1468
|
}),
|
|
1410
1469
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccountsCard, {
|
|
1411
1470
|
t,
|
|
@@ -1713,8 +1772,14 @@ window.__ModuleLoader__.load({
|
|
|
1713
1772
|
.cc-usageBarFillWarn{background:var(--dsw-alias-label-error)}
|
|
1714
1773
|
.cc-usageWindowReset{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:1.5}
|
|
1715
1774
|
.cc-usageMeta{align-items:center;gap:8px;display:flex}
|
|
1716
|
-
.cc-accountReport{
|
|
1717
|
-
.cc-
|
|
1775
|
+
.cc-accountReport{flex-direction:column;gap:12px;display:flex}
|
|
1776
|
+
.cc-tabs{flex-wrap:wrap;gap:6px;display:flex}
|
|
1777
|
+
.cc-tab{align-items:center;font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:2px 10px;font-size:12px;line-height:18px;display:inline-flex;gap:6px}
|
|
1778
|
+
.cc-tab:hover:not(.cc-tabActive){color:var(--dsw-alias-label-primary)}
|
|
1779
|
+
.cc-tabActive{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-brand-primary)}
|
|
1780
|
+
.cc-tabDotOk{background:var(--dsw-alias-brand-primary);border-radius:50%;width:6px;height:6px}
|
|
1781
|
+
.cc-tabDotWarn{background:#d97706;border-radius:50%;width:6px;height:6px}
|
|
1782
|
+
.cc-tabDotError{background:var(--dsw-alias-label-error);border-radius:50%;width:6px;height:6px}
|
|
1718
1783
|
.cc-usageMetaSpacer{flex:1}
|
|
1719
1784
|
.cc-usageUpdated{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px;line-height:1.5}
|
|
1720
1785
|
.cc-usagePartial{color:var(--dsw-alias-label-error);margin:0;font-size:11px;line-height:1.5}
|