@mars-sea/dsh-commandcode-provider 0.11.0 → 0.11.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
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.11.1] - 2026-09-15
10
+
11
+ ### Changed
12
+ - **The sidebar plans & quota card is now off by default, with a switch to show it** ([#42](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/42)). The card used to render unconditionally at the bottom of the sidebar. It is now opt-in: **Settings → Command Code → Advanced** carries a *"Show the quota card in the sidebar"* toggle (`showSidebarQuota`, default off). While hidden the card renders nothing at all — no card in the expanded sidebar and no icon in the 56px rail — and starts no background usage poll, so an unused panel costs nothing. The dashboard behind the card stays registered; with the card hidden it simply has no trigger. Saving the switch on shows the card again immediately, with no restart; an unsaved edit never moves it.
13
+
9
14
  ## [0.11.0] - 2026-09-15
10
15
 
11
16
  ### Added
package/README.md CHANGED
@@ -27,7 +27,7 @@ Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harnes
27
27
  - **Plan-aware picker** — models above your subscription tier are hidden by default (toggleable); an optional **Model allowlist** keeps only your favorites in the picker.
28
28
  - **Reasoning-effort support** — models with selectable reasoning effort levels expose them in the picker.
29
29
  - **Image input** — Vision-capable models accept images.
30
- - **Plans & quota panel** — a Command Code card at the bottom of the sidebar (directly above Settings) shows the serving account's plan and its 5-hour and weekly windows; clicking it opens a dashboard with the billing period, both windows as progress bars with reset times, monthly credit consumption, and the purchased/free balances. Needs dsh 0.1.5 (rc.1) or newer, and reads in English on every harness language.
30
+ - **Plans & quota panel** — an optional Command Code card at the bottom of the sidebar (directly above Settings) shows the serving account's plan and its 5-hour and weekly windows; clicking it opens a dashboard with the billing period, both windows as progress bars with reset times, monthly credit consumption, and the purchased/free balances. **Off by default** — turn on *"Show the quota card in the sidebar"* under **Settings → Command Code → Advanced** to show it, and the same switch hides it again (a hidden card draws nothing at all and runs no background usage poll); the change lands as soon as you save. Needs dsh 0.1.5 (rc.1) or newer, and reads in English on every harness language.
31
31
  - **Session cost estimate** — published-rate estimates (`≈`) beside the composer token counter and in its usage dialog, using each request's model, request time and context tier from durable session history. Model switches and viewing the session later do not reprice earlier requests. Mixed-provider or unpriced usage shows a labeled subtotal (`≥`); missing history or wholly unpriceable usage stays hidden. These are estimates from the installed price snapshot, not provider invoices. Also English on every harness language.
32
32
  - **Web search** — the dsh `web_search` tool is backed by the Command Code Provider API (`/alpha/web-search`) with the same key/endpoint as chat, so no separate search key or base URL is needed. See [Web search](#web-search).
33
33
 
@@ -54,7 +54,7 @@ Pick the release line that matches your DeepSeek Harness version:
54
54
  **pnpm 11 holds back new releases.** Its `minimumReleaseAge` defaults to 1440 minutes, so a version published less than a day ago is skipped and `@latest` resolves to the *previous* release — silently, with a success exit code. To install a release from the last 24 hours, name it exactly:
55
55
 
56
56
  ```sh
57
- dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.0
57
+ dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.1
58
58
  ```
59
59
 
60
60
  The same applies to every profile you install into, including the terminal UI below.
@@ -73,7 +73,7 @@ dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 #
73
73
  Each profile updates separately — the terminal UI owns its own plugin list (see below):
74
74
 
75
75
  ```sh
76
- dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.11.0
76
+ dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.11.1
77
77
  ```
78
78
 
79
79
  To move to a version published less than 24 hours ago, name it exactly as in Install above; pnpm 11's age gate resolves `@latest` to the previous release instead.
@@ -102,7 +102,7 @@ After restart, enter your API key in **Settings → Command Code** and save; **S
102
102
  The plugin also works under a terminal front door. **Each dsh profile owns its own plugin list**, so the web install above does not reach the terminal — add the plugin to the `dsh-tui` profile as well:
103
103
 
104
104
  ```sh
105
- dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.11.0
105
+ dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.11.1
106
106
  ```
107
107
 
108
108
  Pin the exact version here. For the first 24 hours after a release, a bare package name (or `@latest`) is silently resolved to the previous one: the install succeeds, but the profile gets the older build — which is how a fresh terminal install ends up with no **`/settings` → Command Code** page and no `commandcode` models at all.
@@ -188,7 +188,7 @@ llm-commandcode:
188
188
 
189
189
  ## Configure
190
190
 
191
- **Settings → Command Code** covers the API key, API base URL, working directory, and request/stream timeouts; once a key is saved, a live **Account usage** card appears at the top of the page.
191
+ **Settings → Command Code** covers the API key, API base URL, working directory, and request/stream timeouts; once a key is saved, a live **Account usage** card appears at the top of the page. The **Advanced** card holds the toggles — hide out-of-plan models, serve web search with Command Code, and show the quota card in the sidebar (off by default).
192
192
 
193
193
  The same options live in `$DSH_HOME/settings.yaml` (changes apply immediately, no restart):
194
194
 
@@ -200,6 +200,7 @@ llm-commandcode:
200
200
  modelsCachePath: ~/.commandcode/models-cache.json
201
201
  requestTimeoutMs: 60000 # default 60s
202
202
  streamIdleTimeoutMs: 300000 # default 300s
203
+ showSidebarQuota: true # optional: show the plans & quota card in the sidebar (default off)
203
204
  ```
204
205
 
205
206
  ## Web search
package/README.zh-CN.md CHANGED
@@ -27,7 +27,7 @@
27
27
  - **按套餐过滤**:默认隐藏超出订阅套餐的模型,可一键关闭;「模型白名单」可进一步只保留常用模型。
28
28
  - **推理强度支持**:支持推理强度的模型可在选择器中选择档位。
29
29
  - **图片输入**:Vision 模型支持发送图片。
30
- - **套餐与配额面板**:侧边栏底部(Settings 正上方)新增 Command Code 卡片,显示当前服务账号的套餐与 5 小时 / 每周两个配额窗口;点击后在中间栏打开面板,包含计费周期、两个窗口的进度条与重置时间、月度额度消耗,以及已购买 / 赠送余额。需要 dsh 0.1.5(rc.1)或更高版本;无论 Harness 语言如何,该面板固定为英文。
30
+ - **套餐与配额面板**:可选的 Command Code 卡片位于侧边栏底部(Settings 正上方),显示当前服务账号的套餐与 5 小时 / 每周两个配额窗口;点击后在中间栏打开面板,包含计费周期、两个窗口的进度条与重置时间、月度额度消耗,以及已购买 / 赠送余额。**默认关闭**——在 **设置 → Command Code → 高级设置** 中打开「在侧边栏显示额度卡片」即可显示,同一开关也能随时隐藏(隐藏时左侧不渲染任何内容,也不会为其后台刷新用量)。需要 dsh 0.1.5(rc.1)或更高版本;无论 Harness 语言如何,该面板固定为英文。
31
31
  - **会话费用估算**:在输入框下方的 token 计数旁及用量对话框中显示估算金额(`≈`),根据持久化历史中每次请求的模型、请求时间和上下文阶梯分别计价。切换模型或稍后查看不会重新定价之前的请求。混合供应商或缺少费率时显示已定价部分的小计(`≥`);缺少历史事实或完全无法定价时不显示金额。结果基于插件内的价格快照,不等同于供应商账单。同样固定为英文。
32
32
  - **联网搜索**:dsh 的 `web_search` 工具由 Command Code Provider API(`/alpha/web-search`)承载,复用聊天同一个 key 与端点,无需单独配置搜索 key 或地址。详见[联网搜索](#联网搜索)。
33
33
 
@@ -52,7 +52,7 @@
52
52
  **pnpm 11 会拦下刚发布的新版本。** 它的 `minimumReleaseAge` 默认为 1440 分钟,发布不足一天的版本会被跳过,`@latest` 解析到**上一个**版本 —— 而且是静默的,命令照样以成功退出。想装 24 小时内发布的版本,必须写精确版本号:
53
53
 
54
54
  ```sh
55
- dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.0
55
+ dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.1
56
56
  ```
57
57
 
58
58
  这一点对每个 profile 都成立,包括下面的终端界面。
@@ -71,7 +71,7 @@ dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 #
71
71
  每个 profile 各自更新 —— 终端界面有独立的插件列表(见下文):
72
72
 
73
73
  ```sh
74
- dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.11.0
74
+ dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.11.1
75
75
  ```
76
76
 
77
77
  要更新到发布不足 24 小时的版本,和上面的安装一样写精确版本号;pnpm 11 的年龄门禁会把 `@latest` 解析成上一个版本。
@@ -100,7 +100,7 @@ cmd login # macOS/Linux;Windows 原生版:cmdc login
100
100
  插件同样支持终端前端。**每个 dsh profile 有独立的插件列表**,所以上面那条 Web 安装命令不会装到终端里 —— 还要把插件装进 `dsh-tui` profile:
101
101
 
102
102
  ```sh
103
- dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.11.0
103
+ dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.11.1
104
104
  ```
105
105
 
106
106
  这里请写精确版本号。新版本发布后的 24 小时内,只写包名(或 `@latest`)会被静默解析到上一个版本 —— 安装命令照样成功,但 profile 里拿到的是旧版本,结果就是全新的终端安装里既没有 **`/settings` → Command Code** 页面,也看不到任何 `commandcode` 模型。
@@ -186,7 +186,7 @@ llm-commandcode:
186
186
 
187
187
  ## 配置
188
188
 
189
- **设置 → Command Code** 可配置 API key、API 地址、工作目录与请求/流超时;配置好 key 后,页面顶部会显示实时「账户用量」卡片。
189
+ **设置 → Command Code** 可配置 API key、API 地址、工作目录与请求/流超时;配置好 key 后,页面顶部会显示实时「账户用量」卡片。**高级设置**卡片里集中了各个开关:隐藏套餐外模型、用 Command Code 承载联网搜索,以及在侧边栏显示额度卡片(默认关闭)。
190
190
 
191
191
  同一组选项也位于 `$DSH_HOME/settings.yaml`(修改即刻生效,无需重启):
192
192
 
@@ -198,6 +198,7 @@ llm-commandcode:
198
198
  modelsCachePath: ~/.commandcode/models-cache.json
199
199
  requestTimeoutMs: 60000 # 默认 60s
200
200
  streamIdleTimeoutMs: 300000 # 默认 300s
201
+ showSidebarQuota: true # 可选:在侧边栏显示套餐与配额卡片(默认关闭)
201
202
  ```
202
203
 
203
204
  ## 联网搜索
package/lib/client.js CHANGED
@@ -303,6 +303,7 @@ window.__ModuleLoader__.load({
303
303
  }),
304
304
  booleanField$1("filterModelsByPlan"),
305
305
  booleanField$1("webSearch"),
306
+ booleanField$1("showSidebarQuota"),
306
307
  textField("activeAccount")
307
308
  ];
308
309
  /** Whether two model-id lists are equal as sets (order-insensitive). */
@@ -455,6 +456,8 @@ window.__ModuleLoader__.load({
455
456
  streamIdleTimeoutMs: this.field("streamIdleTimeoutMs"),
456
457
  filterModelsByPlan: this.field("filterModelsByPlan"),
457
458
  webSearch: this.field("webSearch"),
459
+ showSidebarQuota: this.field("showSidebarQuota"),
460
+ sidebarQuota: this.sectionValue("showSidebarQuota") === true,
458
461
  activeAccount: this.field("activeAccount"),
459
462
  accounts,
460
463
  accountsRemoving: [...this.removedRefs],
@@ -2291,7 +2294,7 @@ window.__ModuleLoader__.load({
2291
2294
  }
2292
2295
  //#endregion
2293
2296
  //#region package.json
2294
- var version = "0.11.0";
2297
+ var version = "0.11.1";
2295
2298
  var repository = {
2296
2299
  "type": "git",
2297
2300
  "url": "git+https://github.com/Mars-Sea/dsh-commandcode-provider.git"
@@ -2491,7 +2494,8 @@ window.__ModuleLoader__.load({
2491
2494
  "requestTimeoutMs",
2492
2495
  "streamIdleTimeoutMs",
2493
2496
  "filterModelsByPlan",
2494
- "webSearch"
2497
+ "webSearch",
2498
+ "showSidebarQuota"
2495
2499
  ];
2496
2500
  /** One labelled field row in the page body. */
2497
2501
  function Field({ id, label, hint, state, disabled, numeric, placeholder, onEdit, onReset, t }) {
@@ -2543,11 +2547,12 @@ window.__ModuleLoader__.load({
2543
2547
  return t("invalidNumber");
2544
2548
  }
2545
2549
  /**
2546
- * The collapsed "Advanced" card: API base, working dir, both timeouts, and
2547
- * the plan filter live here so the page leads with the facts a user actually
2548
- * touches. Starts collapsed on every visit; expands on demand. While
2549
- * collapsed, a badge names the customized count so a nonzero override stays
2550
- * visible (a number field's error blocks save and must be reachable).
2550
+ * The collapsed "Advanced" card: API base, working dir, both timeouts, the
2551
+ * plan filter, the web-search backend and the sidebar quota card live here so
2552
+ * the page leads with the facts a user actually touches. Starts collapsed on
2553
+ * every visit; expands on demand. While collapsed, a badge names the
2554
+ * customized count so a nonzero override stays visible (a number field's error
2555
+ * blocks save and must be reachable).
2551
2556
  */
2552
2557
  function AdvancedSection({ state, disabled, t, onEdit, onReset }) {
2553
2558
  const [expanded, setExpanded] = (0, react.useState)(false);
@@ -2654,6 +2659,17 @@ window.__ModuleLoader__.load({
2654
2659
  onEdit: (text) => onEdit("webSearch", text),
2655
2660
  onReset: () => onReset("webSearch"),
2656
2661
  t
2662
+ }),
2663
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleField, {
2664
+ id: "cc-show-sidebar-quota",
2665
+ label: t("showSidebarQuota"),
2666
+ hint: t("showSidebarQuotaHint"),
2667
+ state: state.showSidebarQuota,
2668
+ disabled,
2669
+ defaultChecked: false,
2670
+ onEdit: (text) => onEdit("showSidebarQuota", text),
2671
+ onReset: () => onReset("showSidebarQuota"),
2672
+ t
2657
2673
  })
2658
2674
  ]
2659
2675
  }) : null,
@@ -4773,11 +4789,23 @@ window.__ModuleLoader__.load({
4773
4789
  * matching the shell's own rail geometry. `wide` comes from the shell as an
4774
4790
  * owner prop — unlike the old `sidebar.panellist` row, this slot really does
4775
4791
  * supply it.
4792
+ *
4793
+ * Rendering is gated on the settings page's `showSidebarQuota` toggle, which
4794
+ * defaults OFF: a fresh install shows no quota surface in the sidebar and runs
4795
+ * no background poll. The gate reads the STORED document (the settings
4796
+ * controller's `sidebarQuota` fact), so an unsaved draft cannot show the card,
4797
+ * while a landed save flips it live. The entry is still REGISTERED — this is a
4798
+ * render decision, not a slot registration, so nothing churns the slot ledger.
4776
4799
  */
4777
4800
  function CommandCodeFooterEntry(props) {
4801
+ const visible = props.useCommandCodeSettings((snapshot) => snapshot.sidebarQuota);
4778
4802
  const view = usePanelView(props);
4779
4803
  const startAutoRefresh = props.startAutoRefresh;
4780
- (0, react.useEffect)(() => startAutoRefresh(), [startAutoRefresh]);
4804
+ (0, react.useEffect)(() => {
4805
+ if (!visible) return void 0;
4806
+ return startAutoRefresh();
4807
+ }, [visible, startAutoRefresh]);
4808
+ if (!visible) return null;
4781
4809
  const text = (key) => view.text[key] ?? key;
4782
4810
  const headline = view.footerBars[0];
4783
4811
  const title = view.footTitle;
@@ -5787,7 +5815,7 @@ window.__ModuleLoader__.load({
5787
5815
  streamIdleTimeoutMs: "流空闲超时(毫秒)",
5788
5816
  streamIdleTimeoutMsHint: "生成流停滞多久视为断连;默认 300000(长思考模型可静默数分钟,默认值刻意放宽)。",
5789
5817
  advancedSettings: "高级设置",
5790
- advancedSettingsHint: "API 地址、工作目录、超时与模型过滤等不常修改的选项。",
5818
+ advancedSettingsHint: "API 地址、工作目录、超时、模型过滤、联网搜索与侧边栏额度卡片等不常修改的选项。",
5791
5819
  advancedOverriddenOne: "已自定义 1 项",
5792
5820
  advancedOverriddenMany: "已自定义 {count} 项",
5793
5821
  advancedInvalid: "高级设置中有未填好的数字,请展开修正后再保存。",
@@ -5795,6 +5823,8 @@ window.__ModuleLoader__.load({
5795
5823
  filterModelsByPlanHint: "开启后,模型选择器只列出当前套餐可用的模型;账户持有按需余额时会显示全部。",
5796
5824
  webSearch: "用 Command Code 承载联网搜索",
5797
5825
  webSearchHint: "开启后,dsh 的 web_search 工具由 Command Code 承担(复用同一个 API key 与地址),并优先于其他搜索后端;关闭则把选择权交还给之前的后端(如 modsearch),而不是强制回退到 DeepSeek 搜索。",
5826
+ showSidebarQuota: "在侧边栏显示额度卡片",
5827
+ showSidebarQuotaHint: "开启后,侧边栏底部(Settings 上方)显示 Command Code 套餐与配额卡片,点击可在中间栏打开完整仪表盘。默认关闭:左侧不显示任何额度信息,也不会为其后台刷新用量。保存后立即生效。",
5798
5828
  accountsTitle: "多账户轮换",
5799
5829
  accountsHint: "当前账户达到用量限额(429)或密钥失效(401)时,请求自动切换到下一个账户;全部耗尽时会提示最早的重置时间。",
5800
5830
  accountAdd: "添加账户",
@@ -5919,7 +5949,7 @@ window.__ModuleLoader__.load({
5919
5949
  streamIdleTimeoutMs: "Stream idle timeout (ms)",
5920
5950
  streamIdleTimeoutMsHint: "How long a stalled stream is treated as dead; default 300000 (deliberately generous — long-thinking models can stay silent for minutes).",
5921
5951
  advancedSettings: "Advanced",
5922
- advancedSettingsHint: "Rarely touched options: API base URL, working directory, timeouts, and model filtering.",
5952
+ advancedSettingsHint: "Rarely touched options: API base URL, working directory, timeouts, model filtering, web search, and the sidebar quota card.",
5923
5953
  advancedOverriddenOne: "1 customized",
5924
5954
  advancedOverriddenMany: "{count} customized",
5925
5955
  advancedInvalid: "A number in Advanced settings is not ready to save; expand to fix it.",
@@ -5927,6 +5957,8 @@ window.__ModuleLoader__.load({
5927
5957
  filterModelsByPlanHint: "When on, the model picker lists only models your subscription includes; any on-demand credit balance shows the full catalog.",
5928
5958
  webSearch: "Serve dsh web search with Command Code",
5929
5959
  webSearchHint: "When on, the model-facing web_search tool is backed by Command Code (same API key and base URL as chat), winning over other search backends. Off hands the selection back to the previous backend (e.g. modsearch) instead of forcing the shipped DeepSeek search.",
5960
+ showSidebarQuota: "Show the quota card in the sidebar",
5961
+ showSidebarQuotaHint: "When on, a Command Code plan & quota card sits at the bottom of the sidebar (above Settings) and opens the full dashboard in the centre column. Off by default: nothing is shown on the left, and no background usage poll runs for it. Applies on save.",
5930
5962
  accountsTitle: "Account rotation",
5931
5963
  accountsHint: "When the active account hits its usage limit (429) or its key fails (401), requests switch to the next account; when every account is exhausted the error names the earliest window reset.",
5932
5964
  accountAdd: "Add account",