@deepseek-ai/dsh-experimental-client-ui-claude-code-mods 0.2.1-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 +21 -0
- package/README.i18n.yaml +37 -0
- package/README.md +78 -0
- package/README.zh.md +78 -0
- package/lib/client.js +4682 -0
- package/lib/index.js +6 -0
- package/lib/types/client/Band.d.ts +23 -0
- package/lib/types/client/index.d.ts +12 -0
- package/lib/types/client/locales.d.ts +20 -0
- package/lib/types/client/mount.d.ts +20 -0
- package/lib/types/index.d.ts +4 -0
- package/package.json +83 -0
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.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
|
|
2
|
+
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
|
3
|
+
# After editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/experimental/client-ui-claude-code-mods/README.md
|
|
5
|
+
/:
|
|
6
|
+
en: 88916b7aac3cfa9e
|
|
7
|
+
zh: 8ce800daa10eb8f4
|
|
8
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods:
|
|
9
|
+
en: 4ea2761226775912
|
|
10
|
+
zh: a9a23542e2e90acb
|
|
11
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/summary:
|
|
12
|
+
en: 1f06afca4cea6c54
|
|
13
|
+
zh: f35d49a5e8829947
|
|
14
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/table-of-contents:
|
|
15
|
+
en: d152484eb41ac6b4
|
|
16
|
+
zh: 09388d293f9be9cb
|
|
17
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/use-this-package:
|
|
18
|
+
en: ca73e7e3ee8f081b
|
|
19
|
+
zh: 9e288df88595a98c
|
|
20
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/understand-the-implementation:
|
|
21
|
+
en: 84e553fad0acc4e7
|
|
22
|
+
zh: 59e022f910b106ab
|
|
23
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/further-exploration:
|
|
24
|
+
en: 03b6c28629e1ceb3
|
|
25
|
+
zh: dd5cb161f6a15738
|
|
26
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/model-experience:
|
|
27
|
+
en: 628c0f0f837e8f43
|
|
28
|
+
zh: 63546356a4d74fda
|
|
29
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/model-experience/kv-cache-effect:
|
|
30
|
+
en: 60835eca1cee4e0e
|
|
31
|
+
zh: 045010345127cfbb
|
|
32
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/known-limitations-and-deferred-work:
|
|
33
|
+
en: 93eb37dfcac156eb
|
|
34
|
+
zh: 5043f1be81e1039a
|
|
35
|
+
/deepseek-ai-dsh-experimental-client-ui-claude-code-mods/known-limitations-and-deferred-work/dev-note:
|
|
36
|
+
en: 0225ba087c5266f3
|
|
37
|
+
zh: 0400e21a2683a23c
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Web band above the prompt for Claude Code mods: draws each session's mod tree from the bridge's Remote and sends button clicks back."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-experimental-client-ui-claude-code-mods
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
This optional browser plugin draws the band a [Claude Code mod](../claude-code-mods/README.md) renders above the prompt. It mounts the bridge's `claudeCodeMods` Remote, watches each open session's band, and renders the serialized `Box`/`Text`/`Button` tree as a full-width entry above the composer card; clicking a button runs the mod's `onPress` on the Host and the band redraws. Without a mod that draws, nothing is shown.
|
|
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
|
+
Compose it beside the bridge and the mods; the [opt-in overlay](../claude-code-mods/cordis.source.patch.yml) does so for a source launch of the Web profile. The band appears only while a mod's `ui.render` hook returns a tree: Token Weather's forecast after the first turn, Blast Radius's Proceed and Cancel while a risky command is held, Replay Theater's hint after a turn with edits. Colors follow Claude Code's terminal palette on this theme's tokens; a hotkey is shown as a hint beside the label, and a press is a click. While a press is in flight every button is disabled; a press the Host refuses shows its message under the band.
|
|
29
|
+
|
|
30
|
+
-----
|
|
31
|
+
|
|
32
|
+
<a id="understand-the-implementation"></a>
|
|
33
|
+
## Understand the implementation
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary>Maintainer details — click to expand</summary>
|
|
37
|
+
|
|
38
|
+
The browser entry imports the generated Remote contribution and hands it to `mountModsBand`, which mounts the contribution through `ctx.remote.$mount()` and registers one `conversation.input.dock` entry. The entry's `inject` keeps one `watchBand` stream per session behind a small observable store the slot renderer exposes as `useBand`; `press` calls `pressBand` with the generation the band was drawn in and applies the snapshot it returns. Disposal ends every stream and the Remote mount. [`Band.tsx`](src/client/Band.tsx) renders the serialized tree: `Box` as a flex container with `data-direction`, `data-border`, and padding and gap from the props, `Text` as a span carrying `data-color`, `data-bold`, `data-dim`, `data-italic`, `data-underline`, and `Button` as a button disabled without an action id or while a press runs.
|
|
39
|
+
|
|
40
|
+
</details>
|
|
41
|
+
|
|
42
|
+
-----
|
|
43
|
+
|
|
44
|
+
<a id="further-exploration"></a>
|
|
45
|
+
## Further Exploration
|
|
46
|
+
|
|
47
|
+
- [The bridge](../claude-code-mods/README.md) — how the band is drawn and which mods draw first.
|
|
48
|
+
- [Compatibility with Claude Code mods](../../../docs/subsystems/claude-code-mods.md) — the element and prop subset this band renders.
|
|
49
|
+
|
|
50
|
+
-----
|
|
51
|
+
|
|
52
|
+
<a id="model-experience"></a>
|
|
53
|
+
## Model Experience
|
|
54
|
+
|
|
55
|
+
None, as the band is drawn from Host state and never enters a model request; a button's effect reaches the model only through the mod's own hooks.
|
|
56
|
+
|
|
57
|
+
#### KV Cache effect
|
|
58
|
+
|
|
59
|
+
No direct effect.
|
|
60
|
+
|
|
61
|
+
## Known Limitations and Deferred Work
|
|
62
|
+
|
|
63
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
64
|
+
|
|
65
|
+
- One band per session; no docked `Pane`, `TextInput`, hotkeys, focus, or scrolling. The Host renders for a band 120 columns wide and the band wraps; `width`, `height`, `overflow`, `wrap`, and `truncate` props are ignored.
|
|
66
|
+
- The band reflects the Host's redraw triggers; a mod that changes state outside them is drawn at the next trigger.
|
|
67
|
+
|
|
68
|
+
-----
|
|
69
|
+
|
|
70
|
+
<a id="dev-note"></a>
|
|
71
|
+
### Dev Note
|
|
72
|
+
|
|
73
|
+
<details>
|
|
74
|
+
<summary>Maintainer details — click to expand</summary>
|
|
75
|
+
|
|
76
|
+
None.
|
|
77
|
+
|
|
78
|
+
</details>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "面向 Claude Code 模组的提示框上方 Web 横幅:从桥接的 Remote 绘制每个会话的模组树,并把按钮点击发回。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-experimental-client-ui-claude-code-mods
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
这个可选的浏览器插件绘制 [Claude Code 模组](../claude-code-mods/README.zh.md)在提示框上方渲染的横幅。它挂载桥接的 `claudeCodeMods` Remote,监视每个已打开会话的横幅,并把序列化的 `Box`/`Text`/`Button` 树渲染为输入卡片上方的整行条目;点击按钮会在宿主上运行模组的 `onPress`,横幅随之重绘。没有模组绘制时,什么也不显示。
|
|
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
|
+
与桥接和模组一起组合;[可选叠加层](../claude-code-mods/cordis.source.patch.yml)为 Web 配置文件的源码启动完成了这一组合。横幅只在某个模组的 `ui.render` 钩子返回树时出现:首轮之后 Token Weather 的预报、风险命令被持有期间 Blast Radius 的 Proceed 与 Cancel、含编辑的一轮之后 Replay Theater 的提示。颜色按 Claude Code 的终端调色板映射到本主题的令牌;热键显示为标签旁的提示,按下即点击。按下处理期间所有按钮禁用;被宿主拒绝的按下会在横幅下方显示其消息。
|
|
29
|
+
|
|
30
|
+
-----
|
|
31
|
+
|
|
32
|
+
<a id="understand-the-implementation"></a>
|
|
33
|
+
## 理解实现
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary>维护者细节 — 点击展开</summary>
|
|
37
|
+
|
|
38
|
+
浏览器入口导入生成的 Remote 贡献并交给 `mountModsBand`,后者通过 `ctx.remote.$mount()` 挂载该贡献并注册一个 `conversation.input.dock` 条目。条目的 `inject` 为每个会话保持一条 `watchBand` 流,置于一个小型可观察存储之后,由槽位渲染器暴露为 `useBand`;`press` 以横幅绘制时的代数调用 `pressBand`,并应用其返回的快照。销毁时结束每条流与 Remote 挂载。[`Band.tsx`](src/client/Band.tsx) 渲染序列化的树:`Box` 为带 `data-direction`、`data-border` 以及来自属性的内边距与间距的 flex 容器,`Text` 为携带 `data-color`、`data-bold`、`data-dim`、`data-italic`、`data-underline` 的 span,`Button` 为没有动作 id 或按下进行中时禁用的按钮。
|
|
39
|
+
|
|
40
|
+
</details>
|
|
41
|
+
|
|
42
|
+
-----
|
|
43
|
+
|
|
44
|
+
<a id="further-exploration"></a>
|
|
45
|
+
## 进一步探索
|
|
46
|
+
|
|
47
|
+
- [桥接](../claude-code-mods/README.zh.md) — 横幅如何绘制,以及哪些模组先绘制。
|
|
48
|
+
- [与 Claude Code 模组的兼容性](../../../docs/subsystems/claude-code-mods.zh.md) — 本横幅渲染的元素与属性子集。
|
|
49
|
+
|
|
50
|
+
-----
|
|
51
|
+
|
|
52
|
+
<a id="model-experience"></a>
|
|
53
|
+
## 模型体验
|
|
54
|
+
|
|
55
|
+
None, as 横幅由宿主状态绘制,从不进入模型请求;按钮的效果只经模组自身的钩子到达模型。
|
|
56
|
+
|
|
57
|
+
#### KV 缓存影响
|
|
58
|
+
|
|
59
|
+
无直接影响。
|
|
60
|
+
|
|
61
|
+
## 已知限制与延期工作
|
|
62
|
+
|
|
63
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
64
|
+
|
|
65
|
+
- 每会话一条横幅;没有停靠的 `Pane`、`TextInput`、热键、焦点或滚动。宿主按 120 列宽渲染,横幅会换行;`width`、`height`、`overflow`、`wrap`、`truncate` 属性被忽略。
|
|
66
|
+
- 横幅反映宿主的重绘触发;在触发之外改变状态的模组会在下一次触发时绘出。
|
|
67
|
+
|
|
68
|
+
-----
|
|
69
|
+
|
|
70
|
+
<a id="dev-note"></a>
|
|
71
|
+
### 开发备注
|
|
72
|
+
|
|
73
|
+
<details>
|
|
74
|
+
<summary>维护者细节 — 点击展开</summary>
|
|
75
|
+
|
|
76
|
+
无。
|
|
77
|
+
|
|
78
|
+
</details>
|