dsh-status-map 0.0.0-stage → 1.0.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 +61 -2
- package/build.mjs +34 -0
- package/client.js +10013 -0
- package/cordis.patch.yml +3 -0
- package/icon.svg +19 -0
- package/index.js +2 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +49 -4
- package/src/client-entry.js +945 -0
package/README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 状态地图(dsh-status-map)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
一个 DeepSeek Harness Web 客户端插件。它在会话的 View 标签栏中新增「状态地图」,把一次问答画成一个流程节点,支持缩放、平移、分叉分支并列显示,以及独立的主题配色。
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
|
|
7
|
+
- **S 型蛇形布局**:相邻问答左右交替,提问与回答在两列间来回排布,左右两列都被填满;提问到下一个提问的连线沿 S 形向下延伸。
|
|
8
|
+
- **分叉分支**:节点上的「从此处继续 / 从此回答后继续」会在当前位置 fork 会话;子会话的流程会作为并列泳道显示在父会话同一张图上,虚线连到分叉点。
|
|
9
|
+
- **画布操作**:滚轮缩放、拖拽平移、缩略图与缩放控件;节点可拖动,位置在流式更新时保留。
|
|
10
|
+
- **主题切换**:画布右上角的主题按钮提供「跟随系统 / 浅色 / 深色 / 自定义」。自定义可编辑强调色、背景、卡片、嵌套层、文字与次要文字;设置仅作用于本视图,不改变软件全局主题。
|
|
11
|
+
- 视图读取框架已组装的 Chat 快照,不自行重放原始事件,也不写入会话日志。
|
|
12
|
+
|
|
13
|
+
## 安装(一条命令)
|
|
14
|
+
|
|
15
|
+
推荐从 npm 安装,版本由 `package.json` 提供,官方插件市场会自动识别并提示更新:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
dsh plugin --profile desktop add dsh-status-map
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
从 GitHub 源码安装也可以:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
dsh plugin --profile desktop add github:lhgo-net/dsh-status-map
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- 将 `desktop` 换成你的 profile 名(例如 Web 版可能是 `web`)。`--profile` 要写在 `add` 之前。
|
|
28
|
+
- 用 `dsh plugin --help` 查看帮助。
|
|
29
|
+
- 安装后刷新 Web GUI,打开任一会话,在 View 标签中选择「状态地图」。
|
|
30
|
+
- 升级到最新版:`dsh plugin --profile desktop update dsh-status-map@latest`
|
|
31
|
+
- 卸载:`dsh plugin --profile desktop remove dsh-status-map`
|
|
32
|
+
|
|
33
|
+
## 版本与自动更新
|
|
34
|
+
|
|
35
|
+
版本号只写在 `package.json` 的 `version` 字段,README、市场条目和构建产物里都不写死版本。发布到 npm 后,官方目录会通过 `repository` 字段把 npm 包关联到本仓库,自动读取 registry 上的最新版本;`dsh-market` 的更新检查也会据此提示可升级。日常改版本只需 `npm version patch|minor|major` 再 `npm publish`,不需要改市场条目。
|
|
36
|
+
|
|
37
|
+
## 从源码重新构建
|
|
38
|
+
|
|
39
|
+
仓库已包含构建好的 `client.js`,普通安装无需构建。只有修改 `src/client-entry.js` 后才需要:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
pnpm install
|
|
43
|
+
pnpm exec node build.mjs
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`build.mjs` 会把 React Flow 及其 CSS 打包进 `client.js`;React、React DOM、React JSX runtime 使用宿主提供的版本。重新构建后刷新页面即可生效。
|
|
47
|
+
|
|
48
|
+
## 文件说明
|
|
49
|
+
|
|
50
|
+
| 文件 | 作用 |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `package.json` | bundle 清单与 `dsh.client` 声明 |
|
|
53
|
+
| `cordis.patch.yml` | 插入 `dsh-status-map` 插件行 |
|
|
54
|
+
| `index.js` | Host 半(本插件无需 Host 逻辑) |
|
|
55
|
+
| `client.js` | 已打包好的浏览器插件入口 |
|
|
56
|
+
| `src/client-entry.js` | 可读源码 |
|
|
57
|
+
| `build.mjs` | 打包脚本 |
|
|
58
|
+
| `locale/` | 插件管理中显示的标题与描述 |
|
|
59
|
+
| `icon.svg` | 插件图标 |
|
|
60
|
+
| `pnpm-lock.yaml` | 构建依赖锁文件 |
|
|
61
|
+
|
|
62
|
+
`node_modules/` 已在 `.gitignore` 中,不会提交到仓库。
|
package/build.mjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { build } from 'esbuild'
|
|
2
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
3
|
+
|
|
4
|
+
const result = await build({
|
|
5
|
+
entryPoints: ['src/client-entry.js'],
|
|
6
|
+
bundle: true,
|
|
7
|
+
format: 'cjs',
|
|
8
|
+
platform: 'browser',
|
|
9
|
+
target: 'es2020',
|
|
10
|
+
external: ['react', 'react-dom', 'react/jsx-runtime'],
|
|
11
|
+
loader: { '.css': 'text' },
|
|
12
|
+
write: false,
|
|
13
|
+
logLevel: 'warning',
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const bundled = result.outputFiles[0].text
|
|
17
|
+
const wrapper = `// Generated by build.mjs — do not edit by hand.
|
|
18
|
+
window.__ModuleLoader__.load({
|
|
19
|
+
id: 'dsh-status-map',
|
|
20
|
+
factory(require) {
|
|
21
|
+
const localRequire = (name) => {
|
|
22
|
+
if (name === 'react' || name === 'react-dom' || name === 'react/jsx-runtime') return require(name)
|
|
23
|
+
throw new Error('dsh-status-map: unexpected module request ' + name)
|
|
24
|
+
}
|
|
25
|
+
const __sf_module = { exports: {} }
|
|
26
|
+
;(function(module, exports, require) {
|
|
27
|
+
${bundled}
|
|
28
|
+
})(__sf_module, __sf_module.exports, localRequire)
|
|
29
|
+
return __sf_module.exports.install()
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
`
|
|
33
|
+
writeFileSync('client.js', wrapper)
|
|
34
|
+
console.log('client.js written:', wrapper.length, 'bytes')
|