@benz-ai-x/dsh-md-preview 0.1.0

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/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # @benz-ai-x/dsh-md-preview
2
+
3
+ DSH web GUI 插件:点击对话中出现的 Markdown 文档,在对话右侧打开渲染后的预览面板。
4
+
5
+ ## 效果
6
+
7
+ - 回合产出文件 chip 行中的 `.md` / `.markdown` 文档 → 点击打开右侧预览面板(GFM、代码高亮、TeX)。
8
+ - 每条助手消息的操作区新增「预览文档」按钮,列出该回合产出的 Markdown 文档。
9
+ - 非 Markdown 产出文件保持原有行为(调用系统打开)。
10
+ - 面板可关闭、可拖宽;无预览目标时不渲染。
11
+
12
+ ## 结构
13
+
14
+ | 部分 | 位置 | 说明 |
15
+ | --- | --- | --- |
16
+ | Host Remote | `src/remote.ts` | `mdPreview/read(sessionId, path, signal)`;会话工作区限域、扩展名白名单、字节上限 |
17
+ | Remote contribution | `src/typert/remote-client.ts` | 手工维护的浏览器端描述符(生成器产物的等价物) |
18
+ | 浏览器入口 | `src/client/index.ts` | 挂载 Remote + 注册三个 Slot 贡献 |
19
+ | 预览面板 | `src/client/PreviewOverlay.tsx` | `shell.overlay`(list,增量) |
20
+ | chip 行接管 | `src/client/MdChips.tsx` | `conversation.chat.turnTail`(chain,仅认领含 Markdown 的回合) |
21
+ | 消息操作 | `src/client/PreviewAction.tsx` | `conversation.chat.assistant-actions`(list,增量) |
22
+
23
+ ## 配置
24
+
25
+ ```yaml
26
+ - id: md-preview
27
+ name: '@benz-ai-x/dsh-md-preview'
28
+ config:
29
+ maxBytes: 1048576 # 单文件读取上限(字节)
30
+ allowedExtensions: ['.md', '.markdown']
31
+ ```
32
+
33
+ ## 安装(npm 发布形态)
34
+
35
+ ```sh
36
+ dsh plugin --profile <name> add @benz-ai-x/dsh-md-preview
37
+ dsh --profile <name> --dump-config # 确认 md-preview 行
38
+ dsh --profile <name> # 打开 Web GUI,回合产出 .md 后点击 chip 预览
39
+ dsh plugin --profile <name> remove @benz-ai-x/dsh-md-preview
40
+ ```
41
+
42
+ 要求 DSH 基线 `0.1.2-alpha.3`(见 peerDependencies)。
43
+
44
+ ## 开发(source-linked)
45
+
46
+ ```sh
47
+ pnpm install
48
+ pnpm verify # context:check:strict + typecheck + test + build + built:check
49
+ pnpm context:sync # Harness 检出移动后重写 link 并刷新 lockfile
50
+ ```
51
+
52
+ ## 真实 profile 验证(本地检出)
53
+
54
+ ```sh
55
+ pnpm build
56
+ dsh plugin --profile <name> add ./dsh-md-preview
57
+ dsh --profile <name> --dump-config
58
+ dsh --profile <name> # 打开 Web GUI,写一个 README.md 产出并点击 chip
59
+ dsh plugin --profile <name> remove @benz-ai-x/dsh-md-preview
60
+ ```
61
+
62
+ source-linked 验证证明与固定 Harness 检出(见 `dsh-reference.lock.json`)
63
+ 的兼容性;发布形态以 packed tarball 在干净 profile 中的安装/启动/移除
64
+ 冒烟为准。
@@ -0,0 +1,8 @@
1
+ - insert:
2
+ - id: md-preview
3
+ name: '@benz-ai-x/dsh-md-preview'
4
+ config:
5
+ maxBytes: 1048576
6
+ allowedExtensions:
7
+ - .md
8
+ - .markdown