@mars-sea/dsh-commandcode-provider 0.10.4 → 0.10.6
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 +30 -0
- package/README.md +26 -5
- package/README.zh-CN.md +24 -4
- package/lib/client.js +1 -1
- package/lib/index.d.ts +49 -4
- package/lib/index.js +320 -46
- package/lib/index.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,36 @@ 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.10.6] - 2026-09-12
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- **Thinking models no longer fail every tool-loop turn with `The reasoning_content in the thinking mode must be passed back to the API`** ([#34](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/34)). On the `/alpha/generate` transport the adapter ported the pi plugin's behavior of dropping historical reasoning blocks, on the theory that private reasoning must not leak into later turns — but the official CLI does the opposite (`toWireMessages`, command-code@1.53.1, converts every `thinking` block into a `{ type: 'reasoning', text }` part of the assistant message), and the provider rebuilds its DeepSeek request from those parts: an assistant turn whose tool calls arrive without their reasoning is rejected outright. The failure was the whole turn, on every iteration after the first tool call, so a Go-plan or fallback-transport session was unusable with a thinking model. Reasoning is now replayed in content order on the CLI transport, and the Provider API transport keeps passing it back as `reasoning_content` as before.
|
|
11
|
+
|
|
12
|
+
- **A tool whose parameter schema has no object root no longer kills the turn** ([#35](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/35)). The gateway validates the root of every function schema and refuses the entire request otherwise (`Invalid schema for function 'x': schema must be a JSON Schema of 'type: "object"', got 'type: null'`). The harness's own tool builder always declares that root, so the offending schema comes from a tool registered outside it — a plugin's or MCP bridge's hand-written schema (a type-less `{ properties, required }`), an empty one, or a generator's root `$ref`. Choosing a strict model (e.g. `deepseek/deepseek-v4.1-flash`) then failed the turn no matter which tool the model wanted to call: one badly declared tool poisoned the request for all of them. Both bodies now pass every schema through `toolParametersSchema()`: an object-rooted schema is untouched, a type-less object-shaped one gains `type: 'object'`, a `["object","null"]` union is collapsed, a root `$ref` is inlined from its local `$defs`/`definitions`, an `allOf`/`anyOf`/`oneOf` root is flattened into one object (branch properties unioned; `required` kept only where every alternative demands it), and a non-object root degrades to a permissive free-form object rather than failing the request. Only the root is rewritten and every path returns a copy, so the caller's (possibly deep-frozen) schema is never mutated.
|
|
13
|
+
|
|
14
|
+
- **Reading several images in one turn no longer makes the conversation unusable** ([#33](https://github.com/Mars-Sea/dsh-commandcode-provider/pull/33)). When one assistant turn issued parallel tool calls whose results each carried an image (two `read_image` calls, say), both transports emitted each image carrier as a user message directly after its own tool result, so a user message sat between the two tool messages. The gateway requires an assistant's tool blocks to be answered consecutively and rejected the request with HTTP 400 (`An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'`); because that history is replayed on every later turn, the conversation could not continue on this provider at all — a retry did not help and only switching provider or model worked. The carriers are now buffered and flushed once the whole tool group has been emitted, so parallel results stay adjacent (`assistant → tool → tool → user → user`) on both the CLI and the Provider API transport. A single-call turn keeps the shape from [#30](https://github.com/Mars-Sea/dsh-commandcode-provider/issues/30). Because those carriers now travel as a group, each one names the tool call it came out of (`Attached image(s) from tool result (call-a):`) — every `read_image` result renders the same envelope text, so without that the notes would be identical and the only thing tying an image to its own result would be position.
|
|
15
|
+
|
|
16
|
+
- **A user message that converts to nothing is now dropped by both transports.** The CLI transport emitted it as `{ role: 'user', content: [] }` while the Provider API transport skipped it, so the same conversation could be assembled two different ways — and an empty content array is a shape the gateway has no reason to accept. Both now skip a user message that produced no text and no image (including one whose only blocks are ones this adapter does not put on the wire). An image carried out of a tool result is still flushed before the skip, so a pending image is never lost with the message.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **Synced with the official command-code@1.53.1 CLI** (2026-09-12, four CLI-local items: default compaction model set to DeepSeek V4.1 Flash in `/config`, a BYOK reasoning-effort fix, and two `/usage` summary-line changes — Extra Credits shown separately, the `$X left` field removed). `COMMAND_CODE_CLI_VERSION` is now `1.53.1`. Static inspection of both bundles finds no data or protocol drift: the `/alpha/generate` request body, both endpoints, the per-model effort map, the subscription plan maps, every plan tier, every deal, and the peak/off-peak membership and schedule are unchanged, and the catalog still serves the same 69 models (`gpt-6-astra` remains a CLI/pricing/docs-only model, absent from the public Provider catalog, as before). The one bundle difference is upstream-internal: `gpt-5.6-terra` and `gpt-5.6-luna` are now routed through vercel-ai-gateway instead of openrouter, with the same efforts, modalities and 1.05M context. The BYOK fix renames the CLI's own `providers.json` option key from `reasoning_effort` to `reasoningEffort` — a CLI-side BYOK channel, not the Command Code API contract this plugin speaks.
|
|
20
|
+
- **`npm run typecheck` now checks the test suite too.** `tsconfig.json` included only `src`, so `tests/` was never type-checked — `tsx` strips types without checking them, which is why a test file could reference an undeclared type for months and still pass. Every test file type-checks now, and CI's existing `typecheck` step covers them from here on. No shipped behavior changed: this is the quality gate catching up with the suite.
|
|
21
|
+
|
|
22
|
+
## [0.10.5] - 2026-09-11
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **The terminal settings page lists every model as a checkbox.** The TUI's model allowlist was a text field expecting comma-separated catalog ids typed from memory; it now renders the whole catalog under plan-tier headings (Go → GOAT → Pro → Provider), free models first, each row carrying its plan/deal/context summary as the footer hint. Everything reads as checked until something is excluded, matching the adapter's "an unset allowlist shows every model" rule, and a model this build does not recognize (retired upstream, or added after this release) still gets a row of its own instead of becoming impossible to switch from the terminal.
|
|
26
|
+
- **`Config.modelVisibility`, a per-model override layer beside `visibleModels`.** The TUI cannot add an id to the array it edits, so each checkbox records `modelVisibility.<id>` (true listed / false hidden) instead; an id absent from the map keeps following `visibleModels`, and the subscription-tier filter still applies on top. A hand-edited document carrying a non-boolean entry falls back to the array rather than hiding the model.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
- **The terminal model checkboxes now save the model you toggled.** dsh-TUI keys a staged edit by the field's PATH, so the whole list of checkboxes sharing one `visibleModels` path shared one draft: each of them parsed that same draft on save, every write op addressed the same path, and only the last field's op survived — silently replacing the allowlist with what the last catalog model's row evaluated to instead of the row the user had switched. Each checkbox now addresses a path of its own, and a toggle writes only when it disagrees with the inherited state, so switching a model back leaves no residue in the document.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- **Per-release compatibility now covers dsh `0.1.5-rc.2`.** `dsh.compatibility.dshReleases` declares it `compatible` alongside `0.1.2-rc.1`, `0.1.3-alpha.1`, `0.1.3-alpha.2`, `0.1.5-alpha.1` and `0.1.5-rc.1`, so the DSH STORE can list the plugin for the current Harness release. Verified on a dsh-TUI profile running that engine: the `/settings` → Command Code page, the model checkbox list, and the picker's catalog all behave as they do on 0.1.5-rc.1. An older release keeps its own record rather than being replaced, so a user who has not moved to the newest engine still sees the listing.
|
|
33
|
+
|
|
34
|
+
### Documentation
|
|
35
|
+
- **The install and update instructions now say which profile receives the plugin and how to escape pnpm's release-age gate** (both READMEs). A `dsh-tui` profile owns its own plugin list, so the web install does not reach the terminal: the terminal UI needs its own `dsh plugin --profile dsh-tui add`, and it now shows an exact version because a bare package name — or `@latest` — is silently resolved to the previous release for the first 24 hours after a publish (pnpm 11's `minimumReleaseAge`) and the install still exits successfully, which is how a fresh terminal install can end up with no Command Code settings page and no `commandcode` models at all.
|
|
36
|
+
|
|
7
37
|
## [0.10.4] - 2026-09-11
|
|
8
38
|
|
|
9
39
|
### Added
|
package/README.md
CHANGED
|
@@ -47,7 +47,15 @@ Pick the release line that matches your DeepSeek Harness version:
|
|
|
47
47
|
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.9.1
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
> The `latest` tag
|
|
50
|
+
> The `latest` tag points at the current 0.1.2-line plugin release. Users on the old 0.5.0-era Harness line must pin `@0.9.1` explicitly.
|
|
51
|
+
|
|
52
|
+
**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:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.10.6
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The same applies to every profile you install into, including the terminal UI below.
|
|
51
59
|
|
|
52
60
|
Fresh pnpm 10 marketplace generations are supported directly. Do not add a separate `@deepseek-ai/dsh-invariants` dependency; the plugin declares it as a Host peer so the active dsh profile remains the owner of Harness packages.
|
|
53
61
|
|
|
@@ -60,6 +68,14 @@ dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest #
|
|
|
60
68
|
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 # older dsh (0.5.0 line, unmaintained)
|
|
61
69
|
```
|
|
62
70
|
|
|
71
|
+
Each profile updates separately — the terminal UI owns its own plugin list (see below):
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.10.6
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
63
79
|
Then restart the web app.
|
|
64
80
|
|
|
65
81
|
## Getting an API key
|
|
@@ -81,12 +97,14 @@ After restart, enter your API key in **Settings → Command Code** and save; **S
|
|
|
81
97
|
|
|
82
98
|
## Terminal UI (dsh-TUI)
|
|
83
99
|
|
|
84
|
-
The plugin also works under a terminal front door
|
|
100
|
+
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:
|
|
85
101
|
|
|
86
102
|
```sh
|
|
87
|
-
dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider
|
|
103
|
+
dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.10.6
|
|
88
104
|
```
|
|
89
105
|
|
|
106
|
+
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.
|
|
107
|
+
|
|
90
108
|
Then pick the provider in the model selector, or name it directly:
|
|
91
109
|
|
|
92
110
|
```text
|
|
@@ -95,7 +113,9 @@ Then pick the provider in the model selector, or name it directly:
|
|
|
95
113
|
|
|
96
114
|
`/model` lists every registered provider, with Command Code's live catalog and its plan/deal/context annotations. The `/commandcode` usage dashboard works there too.
|
|
97
115
|
|
|
98
|
-
**Entering the key.** The TUI has no web Models page, so the plugin declares its own page in the TUI settings screen — **`/settings` → Command Code** — with the API key, the API base, the out-of-plan model filter, the
|
|
116
|
+
**Entering the key.** The TUI has no web Models page, so the plugin declares its own page in the TUI settings screen — **`/settings` → Command Code** — with the API key, the API base, the out-of-plan model filter, the active account, and the command language. The key field is write-only: it shows whether a key is configured and writes what you type to the credential store, never to a settings document. The same page is the only place a TUI-only user needs to visit.
|
|
117
|
+
|
|
118
|
+
**Picking models.** That page lists the whole catalog as checkboxes, grouped by plan tier (Go → GOAT → Pro → Provider) with the free models first, so nothing has to be typed from memory. Everything starts checked, because an unset allowlist means "show every model" — uncheck the ones you do not want in the picker. The choice is stored as per-model overrides next to the `visibleModels` list the web page edits, so both surfaces can be used interchangeably and a plain `visibleModels` written by hand still works.
|
|
99
119
|
|
|
100
120
|
Alternatively, set the key outside the TUI — any of these work, in this order of precedence:
|
|
101
121
|
|
|
@@ -197,7 +217,8 @@ When your deployment's dsh shell mounts the web capability (`@deepseek-ai/dsh-we
|
|
|
197
217
|
- **Image input is model-gated** — only Vision models accept images; text-only models refuse them.
|
|
198
218
|
- Switching to a text-only model in an image-bearing session is rejected by dsh — pick a model marked *`Image`* or remove the images first.
|
|
199
219
|
- **No `stop` sequences** — requests carrying one fail.
|
|
200
|
-
-
|
|
220
|
+
- Historical reasoning is replayed on both transports so a tool-calling loop keeps its chain of thought: `/provider/v1/chat/completions` passes it back as `reasoning_content`, and `/alpha/generate` carries it as a `reasoning` block inside the rebuilt assistant turn (the shape the official CLI sends) — a DeepSeek thinking-mode tool loop is rejected without it. Only tool calls with a paired tool result are replayed on either transport.
|
|
221
|
+
- Every tool's parameter schema is normalized to the object root the provider requires, so a tool declared without one (a third-party plugin's hand-written schema, an MCP server's own `inputSchema`, a generated root `$ref`) no longer fails the whole turn with `schema must be a JSON Schema of 'type: "object"'`.
|
|
201
222
|
- The model catalog is browsable without a key; chat requests need one.
|
|
202
223
|
|
|
203
224
|
## Permissions & privacy
|
package/README.zh-CN.md
CHANGED
|
@@ -45,7 +45,15 @@
|
|
|
45
45
|
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.9.1
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
> `latest` tag
|
|
48
|
+
> `latest` tag 指向当前 0.1.2 线的插件版本。旧 0.5.0 时代的 Harness 用户必须显式钉住 `@0.9.1`。
|
|
49
|
+
|
|
50
|
+
**pnpm 11 会拦下刚发布的新版本。** 它的 `minimumReleaseAge` 默认为 1440 分钟,发布不足一天的版本会被跳过,`@latest` 解析到**上一个**版本 —— 而且是静默的,命令照样以成功退出。想装 24 小时内发布的版本,必须写精确版本号:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.10.6
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
这一点对每个 profile 都成立,包括下面的终端界面。
|
|
49
57
|
|
|
50
58
|
插件可直接在 pnpm 10 的全新插件市场 generation 中安装。不要另行添加 `@deepseek-ai/dsh-invariants` dependency;插件已将其声明为 Host peer,Harness 包仍由当前 dsh profile 统一管理。
|
|
51
59
|
|
|
@@ -58,6 +66,14 @@ dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest #
|
|
|
58
66
|
dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@0.9.1 # 更早的 dsh(0.5.0 线,不再维护)
|
|
59
67
|
```
|
|
60
68
|
|
|
69
|
+
每个 profile 各自更新 —— 终端界面有独立的插件列表(见下文):
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@0.10.6
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
要更新到发布不足 24 小时的版本,和上面的安装一样写精确版本号;pnpm 11 的年龄门禁会把 `@latest` 解析成上一个版本。
|
|
76
|
+
|
|
61
77
|
然后重启 Web 应用。
|
|
62
78
|
|
|
63
79
|
## 获取 API key
|
|
@@ -79,12 +95,14 @@ cmd login # macOS/Linux;Windows 原生版:cmdc login
|
|
|
79
95
|
|
|
80
96
|
## 终端界面(dsh-TUI)
|
|
81
97
|
|
|
82
|
-
|
|
98
|
+
插件同样支持终端前端。**每个 dsh profile 有独立的插件列表**,所以上面那条 Web 安装命令不会装到终端里 —— 还要把插件装进 `dsh-tui` profile:
|
|
83
99
|
|
|
84
100
|
```sh
|
|
85
|
-
dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider
|
|
101
|
+
dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@0.10.6
|
|
86
102
|
```
|
|
87
103
|
|
|
104
|
+
这里请写精确版本号。新版本发布后的 24 小时内,只写包名(或 `@latest`)会被静默解析到上一个版本 —— 安装命令照样成功,但 profile 里拿到的是旧版本,结果就是全新的终端安装里既没有 **`/settings` → Command Code** 页面,也看不到任何 `commandcode` 模型。
|
|
105
|
+
|
|
88
106
|
之后在模型选择器里选,或者直接指定:
|
|
89
107
|
|
|
90
108
|
```text
|
|
@@ -93,7 +111,9 @@ dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider
|
|
|
93
111
|
|
|
94
112
|
`/model` 会列出所有已注册的 provider,Command Code 的实时目录连同套餐/优惠/上下文标注一起出现,`/commandcode` 用量面板在终端里同样可用。
|
|
95
113
|
|
|
96
|
-
**填写 API key。** 终端没有网页版 Models 页面,所以插件会在终端设置页里声明自己的页面 —— **`/settings` → Command Code** —— 包含 API key、API
|
|
114
|
+
**填写 API key。** 终端没有网页版 Models 页面,所以插件会在终端设置页里声明自己的页面 —— **`/settings` → Command Code** —— 包含 API key、API 地址、隐藏套餐外模型、当前账号和命令语言。key 字段是只写的:它只显示"是否已配置",输入的内容写进凭据库,不会写进任何 settings 文档。只用终端的用户只需要访问这一个页面。
|
|
115
|
+
|
|
116
|
+
**选择模型。** 同一页面把整个模型目录列成勾选框,按套餐档位分组(Go → GOAT → Pro → Provider),免费模型排在最前,不需要手打任何模型 id。默认全部勾选——未设置白名单就等于"显示全部模型";把不想在选择器里看到的取消勾选即可。选择会以「单模型覆盖」的形式保存在网页端编辑的 `visibleModels` 列表旁边,两个界面可以混用,手写的 `visibleModels` 也照常生效。
|
|
97
117
|
|
|
98
118
|
也可以在终端外配置 key,以下三种方式按优先级生效:
|
|
99
119
|
|
package/lib/client.js
CHANGED
|
@@ -2051,7 +2051,7 @@ window.__ModuleLoader__.load({
|
|
|
2051
2051
|
}
|
|
2052
2052
|
//#endregion
|
|
2053
2053
|
//#region package.json
|
|
2054
|
-
var version = "0.10.
|
|
2054
|
+
var version = "0.10.6";
|
|
2055
2055
|
var repository = {
|
|
2056
2056
|
"type": "git",
|
|
2057
2057
|
"url": "git+https://github.com/Mars-Sea/dsh-commandcode-provider.git"
|
package/lib/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { Context } from "@deepseek-ai/cordis";
|
|
|
7
7
|
import { AttachmentStore } from "@deepseek-ai/dsh-attachment";
|
|
8
8
|
import { CommandDefinition } from "@deepseek-ai/dsh-commands";
|
|
9
9
|
//#region src/adapter.d.ts
|
|
10
|
-
declare const COMMAND_CODE_CLI_VERSION = "1.53.
|
|
10
|
+
declare const COMMAND_CODE_CLI_VERSION = "1.53.1";
|
|
11
11
|
declare const DEFAULT_API_BASE = "https://api.commandcode.ai";
|
|
12
12
|
declare const DEFAULT_GENERATE_MAX_TOKENS = 64000;
|
|
13
13
|
declare const DEFAULT_MAX_OUTPUT_TOKENS = 65536;
|
|
@@ -52,6 +52,16 @@ interface CommandCodeConnectionOptions {
|
|
|
52
52
|
* catalog regardless so the page can always offer every model.
|
|
53
53
|
*/
|
|
54
54
|
visibleModels?: string[] | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Per-model visibility overrides, keyed by catalog id. Written by the
|
|
57
|
+
* terminal settings page, whose checkbox list gives every model its own
|
|
58
|
+
* boolean field: a field writes one value at one path, so membership in
|
|
59
|
+
* {@link visibleModels} cannot be expressed from there, while a flag can.
|
|
60
|
+
* An id present here decides that model on its own (true = listed, false =
|
|
61
|
+
* hidden); an id absent here follows {@link visibleModels} exactly as it did
|
|
62
|
+
* before, so composition configs and the web page are unaffected.
|
|
63
|
+
*/
|
|
64
|
+
modelVisibility?: Readonly<Record<string, boolean>> | undefined;
|
|
55
65
|
/**
|
|
56
66
|
* Optional protocol hint. `'auto'` (default) uses billing/cache plus
|
|
57
67
|
* Provider API fallback; `'cli'` forces `/alpha/generate`; `'openai'`
|
|
@@ -1277,6 +1287,17 @@ interface TuiSettingsSectionsService {
|
|
|
1277
1287
|
declare const ACTIVE_ACCOUNT_AUTO = "auto";
|
|
1278
1288
|
/** The selector value meaning "no language override — follow the shell locale". */
|
|
1279
1289
|
declare const LANG_AUTO = "auto";
|
|
1290
|
+
/** One catalog model offered as a checkbox. */
|
|
1291
|
+
interface TuiModelChoice {
|
|
1292
|
+
/** Catalog model id, e.g. `deepseek/deepseek-v4-pro`. */
|
|
1293
|
+
readonly id: string;
|
|
1294
|
+
/** Minimum plan tier key from `KNOWN_PLANS`. */
|
|
1295
|
+
readonly tier: string;
|
|
1296
|
+
/** Whether the model is currently free, so it leads its group. */
|
|
1297
|
+
readonly free: boolean;
|
|
1298
|
+
/** Footer hint for the focused row: plan tier · deal · peak · `Image`. */
|
|
1299
|
+
readonly hint: string;
|
|
1300
|
+
}
|
|
1280
1301
|
/** Everything the section needs from the plugin entry. */
|
|
1281
1302
|
interface CommandCodeTuiSettingsDeps {
|
|
1282
1303
|
/** The plugin's settings namespace (`llm-commandcode`). */
|
|
@@ -1298,6 +1319,21 @@ interface CommandCodeTuiSettingsDeps {
|
|
|
1298
1319
|
id: string;
|
|
1299
1320
|
label: string;
|
|
1300
1321
|
}[];
|
|
1322
|
+
/**
|
|
1323
|
+
* The stored model allowlist, read LIVE at save time. A checkbox judges its
|
|
1324
|
+
* inherited state against this, so it must be read when the write runs, not
|
|
1325
|
+
* captured when the section was registered. An empty list means "every model
|
|
1326
|
+
* is visible" (the adapter's rule).
|
|
1327
|
+
*/
|
|
1328
|
+
visibleModels: () => readonly string[];
|
|
1329
|
+
/**
|
|
1330
|
+
* The per-model override map the checkboxes write, read per registration so
|
|
1331
|
+
* ids this build's catalog does not know still get a row of their own. Same
|
|
1332
|
+
* live-read rule as {@link visibleModels}.
|
|
1333
|
+
*/
|
|
1334
|
+
modelVisibility?: () => Readonly<Record<string, boolean>> | undefined;
|
|
1335
|
+
/** The models to offer as checkboxes; defaults to the static snapshot. */
|
|
1336
|
+
modelChoices?: () => readonly TuiModelChoice[];
|
|
1301
1337
|
}
|
|
1302
1338
|
/**
|
|
1303
1339
|
* Build the section descriptor. Pure, so tests can pin the exact fields
|
|
@@ -1308,9 +1344,9 @@ interface CommandCodeTuiSettingsDeps {
|
|
|
1308
1344
|
* cannot express "unset" — cycling only ever lands on a declared option, so a
|
|
1309
1345
|
* `select` would strand the user on a pinned value with no way back to
|
|
1310
1346
|
* automatic. The `auto` sentinel plus a `parse` that clears the path keeps the
|
|
1311
|
-
* unset state reachable.
|
|
1312
|
-
* (
|
|
1313
|
-
*
|
|
1347
|
+
* unset state reachable. `filterModelsByPlan` formats its EFFECTIVE default
|
|
1348
|
+
* (unset means true at the adapter), so a fresh install reads true instead of
|
|
1349
|
+
* the screen's "(empty)".
|
|
1314
1350
|
*/
|
|
1315
1351
|
declare function buildCommandCodeTuiSection(deps: CommandCodeTuiSettingsDeps): TuiSettingsSection;
|
|
1316
1352
|
/**
|
|
@@ -1367,6 +1403,15 @@ interface Config {
|
|
|
1367
1403
|
* filter card; applies after the subscription-tier filter.
|
|
1368
1404
|
*/
|
|
1369
1405
|
visibleModels?: string[];
|
|
1406
|
+
/**
|
|
1407
|
+
* Per-model visibility overrides from the terminal settings page's checkbox
|
|
1408
|
+
* list, keyed by catalog id (`true` = listed, `false` = hidden). An id here
|
|
1409
|
+
* decides that model on its own; an id absent here follows `visibleModels`.
|
|
1410
|
+
* dsh-TUI keys a staged edit by the field's path, so the checkboxes need one
|
|
1411
|
+
* path per model — a map — because a boolean field cannot express "this id
|
|
1412
|
+
* is a member of the array".
|
|
1413
|
+
*/
|
|
1414
|
+
modelVisibility?: Record<string, boolean>;
|
|
1370
1415
|
/**
|
|
1371
1416
|
* Extra accounts for multi-account rotation. The top-level
|
|
1372
1417
|
* `apiKey`/`apiKeyEnv` (plus the CLI auth file) always form the first
|