@prettier-ai/dsh-client-ui-model-selection 0.1.2-alpha.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/client/ui-model-selection/README.md
5
+ README.md: 3883ebf860b9503e69df770e8d1dc8a8769fa9d0
6
+ README.zh.md: 943a21a6815896e6cee7996bc05b32e938244fe1
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ ---
2
+ description: "Model selection for the Web GUI: the /model popup and the composer model seat over one per-session provider-grouped directory; for users and maintainers of model routing."
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-client-ui-model-selection
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ This package provides model selection in the Web GUI: the `/model` popup command and the composer's model seat, both over one per-session directory of provider-grouped models. Choosing a model submits the complete selection — provider, model, and reasoning effort — which the Host snapshots at the next prompt-assembly boundary, so the following request uses it while a running step keeps its assembled selection. The composer seat shows a two-level Model/Effort menu: models stay provider-grouped, and the selected exact model supplies its adapter-owned effort names and default. When the Host reports that no adapter serves the session's route, the composer input goes inert until a route becomes available.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ Mount this plugin alongside `ui-conversation` and the commands package; the composer then shows the model seat next to the pending indicator, and `/model` opens the same directory as a popup. Both surfaces show the host-reported current selection when the exact provider/model pair remains in the advertised groups; a missing catalog row leaves the routable selection intact while the trigger prompts `Select model`.
29
+
30
+ ### Model and effort
31
+
32
+ Models stay grouped by provider. The menu shows model and effort names only; catalog descriptions remain available to other consumers. The `/model` popup applies the selected model's default effort; the composer can then choose any advertised effort. An adapter without reasoning metadata leaves the Effort row absent; there is no arbitrary effort input.
33
+
34
+ ### Unroutable sessions
35
+
36
+ When the Host reports that no adapter serves the session's route, this plugin raises a composer block and the input goes inert with its own copy; recovering clears it without a reload. A `null` before the first load or after one failed never blocks, and catalog membership never blocks either — a route serving a model it does not advertise is missing from the groups yet usable.
37
+
38
+ -----
39
+
40
+ <a id="understand-the-implementation"></a>
41
+ ## Understand the implementation
42
+
43
+ <details>
44
+ <summary>Implementation internals — click to expand</summary>
45
+
46
+ Two entries over ONE per-session directory owned by `ModelDirectoryResolver` (`ctx.modelDirectories`): the `/model` popupSelect contribution (registered through `ctx.commandUi`) and the composer's named `conversation.input.model` seat both load the session's advisory directory through `session.models` and submit through `session.selectModel` via the same `ModelDirectory` instance, so a switch made in either entry is what the other shows next. Directory loads and selections share a generation counter so an older response never overwrites a newer one; a connection reset drops every resident projection and repulls the Host-restored selection. Directories are per-session, resolved lazily, and disposed with the session scope; addressed subagent sessions expose neither entry. Every resident directory refetches directly on forwarded `llm/adapters-updated` and `settings/document-updated` owner events.
47
+
48
+ </details>
49
+
50
+ -----
51
+
52
+ <a id="further-exploration"></a>
53
+ ## Further Exploration
54
+
55
+ Read these pages when the model surface is not enough. They move from the browser surfaces to the command popup shell and the selection contract.
56
+
57
+ - [ui-commands](../ui-commands/README.md) — the popupSelect shell the `/model` contribution registers into.
58
+ - [ui-conversation](../ui-conversation/README.md) — declares the composer's `conversation.input.model` seat and the composer block.
59
+ - [dsh-agent-default-model](../../core/agent-default-model/README.md) — the default-model service for sessions that never choose.
60
+ - [Client package map](../README.md) — adjacent browser UI packages.
61
+
62
+ -----
63
+
64
+ <a id="model-experience"></a>
65
+ ## Model Experience
66
+
67
+ Indirectly, through the `session.selectModel` selection both entries submit: the Host snapshots the complete `ModelSelection` at the next prompt-assembly boundary and owns the model-visible effect, while a running step keeps its assembled selection.
68
+
69
+ #### KV Cache effect
70
+
71
+ Switching the route can reduce or invalidate provider-side cache reuse for subsequent requests; the prompt prefix itself is untouched.
72
+
73
+ ## Known Limitations and Deferred Work
74
+
75
+ <a id="known-limitations-and-deferred-work"></a>
76
+
77
+
78
+ These limits define the current model surface. They are current package constraints, not a general model-router comparison or a task backlog.
79
+
80
+ - **No create-time or addressed-subagent selection** — both entries require an existing ordinary session's Agent; there is no draft-phase model choice to fold into session creation, and subagent continuation deliberately exposes no independent model-selection contract.
81
+ - **Directory names are presentation-only** — selection and persistence use provider/model/effort ids; a provider whose catalog or exact-model metadata lookup fails lists as an unselectable failure row until reload.
82
+ - **No arbitrary effort input** — the composer offers only the exact model's adapter-advertised levels; an adapter without reasoning metadata leaves the Effort row absent.
83
+
84
+ <a id="dev-note"></a>
85
+ ### Dev Note
86
+
87
+ <details>
88
+ <summary>Working context for maintainers — click to expand</summary>
89
+
90
+ None.
91
+
92
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,92 @@
1
+ ---
2
+ description: "Web GUI 的模型选择:/model 弹窗与 composer 模型位共用一份按提供方分组的会话级目录;供模型路由的用户与维护者阅读。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-client-ui-model-selection
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ 本包提供 Web GUI 的模型选择:`/model` 弹窗命令与 composer 模型位,两者共用一份按提供方分组的会话级目录。选择模型会提交完整选择——提供方、模型与推理强度——宿主在下一次提示词组装边界对其快照,因此后续请求采用该选择,而运行中的步骤保留已组装选择。composer 位显示两级 Model/Effort 菜单:模型按提供方分组,所选具体模型提供其适配器持有的推理强度名称与默认值。当宿主报告没有适配器服务该会话的路由时,composer 输入停用,直到路由恢复可用。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [进一步探索](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延期工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 与 `ui-conversation` 及命令包一起挂载本插件;composer 随即在待处理指示器旁显示模型位,`/model` 则以弹窗打开同一份目录。当确切提供方/模型对仍在已公布分组中时,两个表面都显示宿主报告的当前选择;目录行缺席时,可路由的选择保持不变,触发器提示 `Select model`。
29
+
30
+ ### 模型与推理强度
31
+
32
+ 模型按提供方分组。菜单只显示模型与推理强度名称;目录中的说明仍可供其他消费方使用。`/model` 弹窗应用所选模型的默认推理强度;composer 随后可以选择任一已公布的推理强度。适配器没有推理元数据时不显示 Effort 行;不存在任意推理强度输入。
33
+
34
+ ### 不可路由的会话
35
+
36
+ 当宿主报告没有适配器服务该会话的路由时,本插件注册一个 composer 阻塞块,输入随本插件自己的文案停用;恢复后无需重新加载即清除。首次加载之前或加载失败之后的 `null` 绝不阻断;目录成员关系同样不阻断——一条仍在服务、只是不公布该模型的路由不在分组里,却可用。
37
+
38
+ -----
39
+
40
+ <a id="understand-the-implementation"></a>
41
+ ## 理解实现
42
+
43
+ <details>
44
+ <summary>实现细节——点击展开</summary>
45
+
46
+ 两个入口共用一份由 `ModelDirectoryResolver`(`ctx.modelDirectories`)持有的会话级目录:`/model` popupSelect 贡献项(经 `ctx.commandUi` 注册)与 composer 的具名 `conversation.input.model` 位都经 `session.models` 加载会话的建议目录、经 `session.selectModel` 通过同一个 `ModelDirectory` 实例提交,因此任一人口所做的切换正是另一个入口接下来显示的。目录加载与选择共享一个代次计数器,旧响应不会覆盖新结果;连接重置丢弃所有常驻投影,并在显示前重新拉取宿主恢复的选择。目录按会话惰性解析,随会话作用域一并释放;已寻址 subagent 会话不公开任一入口。每份常驻目录都会直接在转发的 `llm/adapters-updated` 与 `settings/document-updated` owner 事件上重拉。
47
+
48
+ </details>
49
+
50
+ -----
51
+
52
+ <a id="further-exploration"></a>
53
+ ## 进一步探索
54
+
55
+ 当模型面不够用时阅读以下页面。它们从浏览器表面进入命令弹窗外壳与选择约定。
56
+
57
+ - [ui-commands](../ui-commands/README.zh.md)——`/model` 贡献项注册进的 popupSelect 外壳。
58
+ - [ui-conversation](../ui-conversation/README.zh.md)——声明 composer 的 `conversation.input.model` 位与 composer 阻塞块。
59
+ - [dsh-agent-default-model](../../core/agent-default-model/README.zh.md)——为从未选择的会话提供默认模型的默认模型服务。
60
+ - [客户端包映射](../README.zh.md)——相邻的浏览器 UI 包。
61
+
62
+ -----
63
+
64
+ <a id="model-experience"></a>
65
+ ## 模型体验
66
+
67
+ 间接影响。两个入口都提交 `session.selectModel` 选择;宿主在下一次提示词组装边界对完整 `ModelSelection` 快照并拥有模型可见效果,而运行中的步骤保留已组装选择。
68
+
69
+ #### KV Cache 影响
70
+
71
+ 切换路由可能减少提供方侧后续请求的缓存复用,或使其失效;提示词前缀本身不受影响。
72
+
73
+ ## 已知限制与延期工作
74
+
75
+ <a id="known-limitations-and-deferred-work"></a>
76
+
77
+
78
+ 这些限制界定了当前模型表面。它们是当前包约束,不是通用模型路由器对比或任务积压。
79
+
80
+ - **无创建期或已寻址 subagent 选择**——两个入口都要求既有普通会话的 agent;没有可纳入会话创建的草稿阶段模型选择,subagent 继续执行也有意不公开独立的模型选择约定。
81
+ - **目录名仅供呈现**——选择与持久化使用提供方/模型/推理强度 id;目录查询或确切模型元数据查询失败的提供方以不可选失败行列出,重新加载前保持原样。
82
+ - **不能任意输入推理强度**——composer 仅提供确切模型由适配器公布的推理强度;适配器没有推理元数据时不显示 Effort 行。
83
+
84
+ <a id="dev-note"></a>
85
+ ### 开发备注
86
+
87
+ <details>
88
+ <summary>维护者的工作上下文——点击展开</summary>
89
+
90
+ 无。
91
+
92
+ </details>