dsh-dialog-width 0.0.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 dsh-dialog-width contributors
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.en.md ADDED
@@ -0,0 +1,66 @@
1
+ # dsh-dialog-width
2
+
3
+ > **Version requirement**: requires **DSH v0.1.2-alpha.5 or newer**.
4
+
5
+ A [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) (DSH) web plugin that controls the conversation column width from the Settings panel.
6
+
7
+ ## Features
8
+
9
+ - **Dialog width (default 748 px = DSH's stock column)** — in the Layout settings group, type a value (600–1600, step 20) or pick one of three presets (Default · 748 / Wide · 880 / Extra wide · 1024). The column width is applied to the message column, the composer card, and the stats line.
10
+ - **Plugin width control (default on)** — a master toggle in the same Layout group. **On**: the plugin's input/presets drive the column and **hide DSH's native drag handles**. **Off**: DSH's native handles own the column, and the plugin's width input becomes a **read-only mirror** of whatever the native handles produce. In both states the user's last px is written to the shared `localStorage` slot, so **toggling back and forth never loses the width**.
11
+
12
+ - **Side margin** — blank width (px) on both sides of the conversation column. Visible when the sidebar opens and the column flex-shrinks. Minimum 32 px.
13
+
14
+ ```yaml
15
+ dialog-width:
16
+ dialogWidth: 880 # defaults to 748; 600–1600
17
+ usePluginWidth: true # defaults to true (plugin width control on); false uses DSH's native drag handles
18
+ sideMargin: 50 # defaults to 50; minimum 32. Side margin (px) on both sides of the column
19
+ ```
20
+
21
+ Settings entry: **Settings → Dialog width**.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ # from npm (recommended, prebuilt)
27
+ npx -y @deepseek-ai/dsh plugin --profile web add dsh-dialog-width
28
+
29
+ # from GitHub (source; runs the self-contained prepare build)
30
+ npx -y @deepseek-ai/dsh plugin --profile web add github:zhj9709/dsh-dialog-width
31
+ ```
32
+
33
+ The package spec after `add` is forwarded to pnpm verbatim, so versions can be
34
+ pinned — `@version` for the npm package, `#tag` for the GitHub source:
35
+
36
+ ```bash
37
+ npx -y @deepseek-ai/dsh plugin --profile web add dsh-dialog-width@0.0.1 # pin the npm version
38
+ npx -y @deepseek-ai/dsh plugin --profile web add github:zhj9709/dsh-dialog-width#v0.0.1 # pin a git tag
39
+ ```
40
+
41
+ Restart DSH web once after installing (bundle plugins are scanned at process start).
42
+
43
+ ## Development
44
+
45
+ ```bash
46
+ pnpm install
47
+ pnpm build # tsc (server) + tsc (client) + bundle lib/client.js
48
+ pnpm typecheck
49
+ ```
50
+
51
+ Load against a running DSH with an overlay, or install as a bundle:
52
+
53
+ ```bash
54
+ npx -y @deepseek-ai/dsh web --patch ./cordis.patch.yml # dev overlay
55
+ npx -y @deepseek-ai/dsh plugin --profile web add . # bundle install from this checkout
56
+ ```
57
+
58
+ ## How it works
59
+
60
+ - **Server** (`src/index.ts`) registers the `dialog-width` settings namespace and mounts a same-origin route (`/_dsh/dialog-width/settings`).
61
+ - **Browser** (`src/client/index.tsx`) reads/writes that route, renders the Settings section, and applies the column width live via a runtime `<style>` element.
62
+ - **Width control styles** (`src/client/conversation-width.ts`) hides DSH's native drag handles, sets the CSS variable `--dsh-dialog-width-chat-width`, and persists to `localStorage['dsh.conversation.contentWidth']` when plugin width control is on.
63
+
64
+ ## License
65
+
66
+ MIT
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # dsh-dialog-width
2
+
3
+ > **版本要求**:需要 **DSH v0.1.2-alpha.5 及以上**。
4
+
5
+ [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/)(DSH)Web UI 插件:从设置面板控制对话列宽。
6
+
7
+ ## 功能
8
+
9
+ - **对话框宽度(默认 748 px,即 DSH 原生列宽)**:在设置的「布局」区用数值输入(600–1600,步进 20)或三个预设(默认 · 748 / 稍宽 · 880 / 更宽 · 1024)调整对话列宽。列宽会同步到输入框卡片与统计条。
10
+ - **插件宽度控制(默认开启)**:同一个「布局」区里有一个总开关。**开启时**,插件的数值/预设直接驱动列宽,并**隐藏 DSH 原生的拖拽手柄**;**关闭时**,DSH 原生手柄接管列宽,插件的数值输入改为**只读镜像**——实时显示原生手柄拖出来的值。无论开关状态,用户最后选择的 px 值都会写入共享的 `localStorage` 槽,所以**来回切换不会丢失宽度**。
11
+
12
+ - **两侧边距**:对话列两侧的空白宽度(px),侧边栏打开、列宽自适应缩小时可见。最低 32 px。
13
+
14
+ ```yaml
15
+ dialog-width:
16
+ dialogWidth: 880 # 默认 748;取值 600–1600
17
+ usePluginWidth: true # 默认 true(插件宽度控制开启);false 则使用 DSH 原生拖拽手柄
18
+ sideMargin: 50 # 默认 50;最低 32。对话列两侧边距(px)
19
+ ```
20
+
21
+ 设置入口:**设置 → 对话框宽度**。
22
+
23
+ ## 安装
24
+
25
+ ```bash
26
+ # 方式一:从 npm 安装(推荐,预构建产物)
27
+ npx -y @deepseek-ai/dsh plugin --profile web add dsh-dialog-width
28
+
29
+ # 方式二:从 GitHub 仓库安装(源码,会运行自包含的 prepare 构建)
30
+ npx -y @deepseek-ai/dsh plugin --profile web add github:zhj9709/dsh-dialog-width
31
+ ```
32
+
33
+ `add` 后面的包说明会**原样转发给 pnpm**,因此可以指定版本——npm 包用 `@版本号`,GitHub 源码用 `#tag`:
34
+
35
+ ```bash
36
+ npx -y @deepseek-ai/dsh plugin --profile web add dsh-dialog-width@0.0.1 # 锁定 npm 版本
37
+ npx -y @deepseek-ai/dsh plugin --profile web add github:zhj9709/dsh-dialog-width#v0.0.1 # 锁定 git tag
38
+ ```
39
+
40
+ 安装完成后**重启一次 `dsh web`**(bundle 插件在进程启动时扫描)。
41
+
42
+ ## 开发
43
+
44
+ ```bash
45
+ pnpm install
46
+ pnpm build # tsc(服务端)+ tsc(客户端)+ 打包 lib/client.js
47
+ pnpm typecheck
48
+ ```
49
+
50
+ 本地加载(覆盖层)或作为 bundle 安装:
51
+
52
+ ```bash
53
+ npx -y @deepseek-ai/dsh web --patch ./cordis.patch.yml # 开发覆盖层
54
+ npx -y @deepseek-ai/dsh plugin --profile web add . # 从本目录作为 bundle 安装
55
+ ```
56
+
57
+ ## 工作原理
58
+
59
+ - **服务端**(`src/index.ts`):注册 `dialog-width` 设置命名空间,并挂载同源路由 `/_dsh/dialog-width/settings`。
60
+ - **浏览器端**(`src/client/index.tsx`):读写该路由、渲染设置页,并通过运行时 `<style>` 元素实时应用列宽样式。
61
+ - **宽度控制样式**(`src/client/conversation-width.ts`):插件宽度控制开启时隐藏 DSH 原生拖拽手柄、设置 CSS 变量 `--dsh-dialog-width-chat-width`,并持久化到 `localStorage['dsh.conversation.contentWidth']`。
62
+
63
+ ## 协议
64
+
65
+ MIT
@@ -0,0 +1,12 @@
1
+ # dsh-dialog-width bundle patch
2
+ #
3
+ # Declared by `dsh.bundle.patch` in package.json: when the plugin is installed
4
+ # through the official CLI —
5
+ #
6
+ # dsh plugin --profile <name> add dsh-dialog-width
7
+ #
8
+ # — the command appends `dsh-dialog-width` to the profile's bundle stack and this
9
+ # patch mounts the server-side plugin row.
10
+ - insert:
11
+ - id: dialog-width
12
+ name: 'dsh-dialog-width'