dsh-timeback 0.0.0-stage → 0.6.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.
@@ -0,0 +1,23 @@
1
+ # Timeback bundle patch.
2
+ #
3
+ # One Host row: the checkpoint service, the capture hooks, the timeback_* tools,
4
+ # and the browser JSON routes. The browser half is loaded from the `./client`
5
+ # export declared in package.json (dsh.client).
6
+ #
7
+ # Configuration (all optional):
8
+ # dataDir snapshot/registry directory; defaults to <DSH_HOME>/timeback
9
+ # capture "workspace" (default) records only in workspaces the user enabled
10
+ # from the panel; "all" records every workspace; "off" disables capture
11
+ # exclude extra gitignore-style patterns kept out of snapshots
12
+ # timeoutMs per-git-command deadline (default 30000)
13
+ # maxCheckpoints checkpoints retained per Session before the oldest are forgotten (default 400)
14
+ # restoreDeletesExtra delete files created after the target checkpoint on restore (default true)
15
+ # routePath HTTP mount path (default /timeback)
16
+ - insert:
17
+ - id: timeback
18
+ name: 'dsh-timeback'
19
+ config:
20
+ capture: workspace
21
+ timeoutMs: 30000
22
+ maxCheckpoints: 400
23
+ restoreDeletesExtra: true
package/docs/DETAIL.md ADDED
@@ -0,0 +1 @@
1
+ ![Illustrative layout of the Timeback right-sidebar panel: conversation branches with per-turn snapshot rows and rewind controls](preview.svg)
@@ -0,0 +1,125 @@
1
+ # 借鉴方许可证与插件市场发布调研
2
+
3
+ 调研日期:2026-11-29。安装版本:DeepSeek Harness `@deepseek-ai/dsh@0.2.2-rc.5`。
4
+ 完整证据与逐条 URL 见本包内的 `research/licenses-and-market.md`(调研原始记录,不随 npm 包发布;保留在源码仓库中可复核)。
5
+
6
+ ## 结论(给着急的人)
7
+
8
+ 1. **同类插件全部是宽松许可证**:MIT / BSD-3-Clause / Apache-2.0,未发现任何 GPL/AGPL/LGPL。
9
+ 因此 timeback 可以继续使用 MIT,并且**可以**发布到插件市场(包括闭源/收费,虽然本项目选择 MIT)。
10
+ 2. **只借鉴思路不触发任何许可证义务**。著作权保护的是代码、文案、图标等表达,不保护功能、
11
+ 交互流程和 UX 思路(17 U.S.C. §102(b))。本项目是独立实现,没有复制任何参考项目的代码、
12
+ 测试、locale 文案、README 散文或图标;`ACKNOWLEDGEMENTS.md` 里以 "ideas only" 标注参考项目。
13
+ 3. **发布可行且免费,但没有官方中央商店**。DSH 自身不内置任何插件索引;GUI 的 Discover
14
+ 是格式 1(format-1)JSON 索引的阅读器,用户自行添加索引源。实际发布路径是:
15
+ npm 发布 bundle + GitHub 仓库加 `dsh-plugin` topic + 向社区索引(awesome-dsh-plugin、
16
+ dshbase、dshhub)提交。
17
+ 4. **发布前必须处理两个现实问题**:
18
+ - 命名:npm 包名 `timeback` 已被占用,且 "TimeBack" 是既有的 App 品牌(商标/混淆风险)。
19
+ 因此本包发布名为 **`dsh-timeback`**(调研时 npm 404 = 可用),README 已声明与
20
+ DeepSeek / TimeBack 均无关联。
21
+ - 兼容范围:`engines.dsh` 必须覆盖 `0.2.2-rc.5`。本包声明
22
+ `">=0.2.2-rc.1 <0.3.0-0"`(DSH 的兼容检查对 prerelease 使用 `includePrerelease: true`,
23
+ 该范围包含 rc.5),`engines.node` 与 DSH 一致为 `>=24.9.0`。
24
+
25
+ ## 借鉴方许可证表(核心项目)
26
+
27
+ | 项目 | 许可证 | 是否 copyleft | 本项目借鉴内容 |
28
+ |---|---|---|---|
29
+ | [PerryLink/dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) | Apache-2.0(非 copyleft,含专利授权) | 否 | 思路:工作区/会话/配置三态检查点、变更前快照、回退事务、回退前安全快照 |
30
+ | [GeoSyntax/dsh-plugin-time-machine](https://github.com/GeoSyntax/dsh-plugin-time-machine) | MIT | 否 | 思路:会话 + 工作区检查点协同、DAG 分支(功能最接近的一个) |
31
+ | [Unintendedz/dsh-conversation-tree](https://github.com/Unintendedz/dsh-conversation-tree) / [orchivo/dsh-conversation-tree](https://github.com/orchivo/dsh-conversation-tree) | MIT | 否 | 思路:不可变子会话、消息级分支、侧栏树浏览 |
32
+ | [Serenity-2026/dsh-treecom](https://github.com/Serenity-2026/dsh-treecom) | MIT | 否 | 思路:一个主对话 + 独立树面板 |
33
+ | [dsh-plugins/dsh-session-tree](https://github.com/dsh-plugins/dsh-session-tree) / [lulaalu/dsh-session-tree](https://github.com/lulaalu/dsh-session-tree) | MIT | 否 | 思路:Host/Client 分层、消息分支模型 |
34
+ | [ANHANP/dsh-branch-tree](https://github.com/ANHANP/dsh-branch-tree) / [YB313/dsh-branch-tree](https://github.com/YB313/dsh-branch-tree) | MIT | 否 | 思路:会话级持久树抽屉 |
35
+ | [SpookySandwich/dsh-plugin-message-edit](https://github.com/SpookySandwich/dsh-plugin-message-edit) | MIT | 否 | 思路:版本树入口 |
36
+ | [helibeiqi/dsh-time-travel](https://github.com/helibeiqi/dsh-time-travel) | MIT | 否 | 思路:工具副作用快照 |
37
+ | [EmptyVessel-000/dsh-file-history](https://github.com/EmptyVessel-000/dsh-file-history) / [lire1131/dsh-undo-savepoint](https://github.com/lire1131/dsh-undo-savepoint) | MIT | 否 | 思路:文件历史/回滚 UX |
38
+ | `@deepseek-ai/dsh-workspace-changes`(DSH 自带) | MIT | 否 | 工程参考:逐轮 git tree 快照、subprocess 封装、turn 钩子。timeback 独立实现,并额外使用持久化私有对象库、`refs/timeback/*` 与 checkout-index 恢复路径 |
39
+
40
+ 另有约 30 个相邻插件被抽查(`dsh-session-rewind`、`@anionex/dsh-turn-rewind`(BSD-3)、
41
+ `dsh-checkpoint-diff`(Apache-2.0)、`dsh-checkpoints`、多个 `dsh-rollback*`、`dsh-chat-tree`、
42
+ `dsh-fork-map` 等),均为 MIT/Apache-2.0/BSD-3。
43
+ **没有 GPL/AGPL/LGPL**。
44
+
45
+ **不可复制代码的项目**(无许可证 = 默认保留所有权利):
46
+ `dsh-composer-rewind`、`DreamYuande/dsh-history-message-editor`。本项目未使用它们的代码。
47
+ 另:`Moeblack/dsh-message-edit` 只在 package.json/npm 声明 MIT,仓库里没有 LICENSE 文件,
48
+ 若未来要复用其代码应特别小心。
49
+
50
+ ### 如果确实要复制代码,义务是什么
51
+
52
+ - **MIT**:保留上游版权声明与许可全文(放进 `LICENSE`/`ACKNOWLEDGEMENTS.md`,并在 `files` 里发布)。
53
+ - **BSD-3-Clause**:同 MIT,另加不得用上游作者名义推广。
54
+ - **Apache-2.0**:附许可副本、保留版权/专利/归属声明、标注被修改的文件;上游有 NOTICE 才需要转发 NOTICE
55
+ (`dsh-checkpoint-rewind` 没有 NOTICE 文件)。
56
+ - **无许可证**:不得复制。
57
+
58
+ ## 发布到 DSH 插件市场:规则与步骤
59
+
60
+ ### 市场是什么
61
+
62
+ - DSH **没有官方中央商店,也没有官方提交审核**。官方文档明确:"DSH ships no index source",
63
+ Discover 读取用户自行添加的 format-1 JSON 索引。官方唯一的分发方式是 npm 发布
64
+ (包必须声明 `dsh.bundle.patch`),可发现性靠 GitHub 的 `dsh-plugin` topic。
65
+ - 事实上的"市场"是社区索引,它们都使用同一种 format-1 文档:
66
+ - **awesome-dsh-plugin**:`data/plugins/<owner>__<repo>.yml` 一个 PR 一个文件;其索引
67
+ `https://cdn.jsdelivr.net/npm/dsh-plugin-catalog/index.json`(npm 包 `dsh-plugin-catalog`,
68
+ 许可证 CC0-1.0,调研时收录 7,247 个插件)。要求:真实可用代码、仓库 ≥1 天、`dsh-plugin` topic、
69
+ README 含安装命令、描述准确。
70
+ - **dshbase**:Issue 表单提交,自动化 L1–L4 安装/启动验证(不是安全审计)。
71
+ - **dshhub.dev**:submit 页 + topic 扫描;明确要求 **"License is stated. No license, no listing."**
72
+ - **dshplugin.online**:只需 GitHub `dsh-plugin` topic,自动收录。
73
+ - 自建索引:用官方 `apps/plugin-market-generator` 生成 `index.json` 放到任意静态托管,
74
+ 用户在 Discover 里添加 URL 即可。
75
+
76
+ ### format-1 索引 schema(已核对官方文档 + 校验器 types.ts + 真实索引)
77
+
78
+ 根对象:`format: 1`(必填)、`title`(必填,LocalizedText 且必须含 `en`)、`description?`、
79
+ `metadata.{categories,labels,sortKeys}?`、`plugins[]`(必填)。
80
+
81
+ 插件对象:`name`(npm 包名,索引内唯一)、`title?`、`description?`、`icon?`(data: URL ≤32 KiB
82
+ 或同源/https URL)、`author?`、`homepage?`、`repository?`、`metadata.{category?,labels?,keywords?,sortKeys}?`、
83
+ `versions[]`(至少 1 个,SemVer 降序)。
84
+
85
+ 版本对象:`version`(精确 SemVer)、`publishTimestamp`(Unix 秒)、
86
+ `source: {type:"npm", registry?} | {type:"git", url, commit(40 hex), path?}`、
87
+ `engines.dsh?`(SemVer 范围;缺省=任意版本)。
88
+
89
+ 托管要求:UTF-8 JSON ≤128 MiB、HTTP 2xx、**不跟随重定向**、远程网络必须 https。
90
+ **format-1 没有 license 字段**,DSH 校验器也不检查 license —— 但各目录要求仓库声明许可证,
91
+ 所以 `LICENSE` + `package.json` 的 `"license": "MIT"` 必须随包发布。
92
+
93
+ ### 本包的发布步骤
94
+
95
+ 1. 推送公开仓库,加 `dsh-plugin` topic,README 写明安装命令与兼容范围。
96
+ 2. `npm publish --access public`(当前包名 `dsh-timeback` @ `0.1.0`;发布前再确认 npm 可用性)。
97
+ 3. 向 awesome-dsh-plugin 提 PR:`data/plugins/<owner>__dsh-timeback.yml`:
98
+ ```yaml
99
+ url: https://github.com/<owner>/dsh-timeback
100
+ name: <owner>/dsh-timeback
101
+ category: session
102
+ description:
103
+ en: 'Conversation tree with per-turn workspace snapshots: branch at any turn and restore the files of that turn.'
104
+ zh: '带逐轮文件快照的对话树:在任意回合分支,并把文件恢复到该回合的状态。'
105
+ ```
106
+ 4. 提交 dshbase issue(声明无需外部账号)与 dshhub submit(声明 MIT 许可证)。
107
+ 5. 维护索引条目里的 `engines.dsh`,与 `package.json` 保持一致。
108
+
109
+ ## 竞品与差异化(功能风险,不是许可证风险)
110
+
111
+ - `dsh-checkpoint-rewind`(Apache-2.0,npm 活跃)已做 工作区/配置/会话 三态回退 + `/rewind`。
112
+ - `dsh-plugin-time-machine`(MIT,仅 GitHub)已做 会话+工作区检查点 + DAG 分支,但声明只支持
113
+ DSH 0.1.5–0.2.0,在当前 rc.5 上大概率不可用。
114
+ - 对话树类有 6+ 个活跃插件。
115
+ - timeback 的差异点:**在本版本 DSH(0.2.2-rc.5)上把"回合级文件快照+恢复"与"对话分支"真正合成
116
+ 一次操作**(分支 + 恢复文件 + 安全快照),并提供 Web 面板、模型工具与三类操作模式;
117
+ 同时保留旧分支,上下文只带到回退点。
118
+
119
+ ## 未验证 / 免责
120
+
121
+ - npmjs.com 网页对 curl 返回 403;npm 事实来自 registry API。
122
+ - 索引格式的 Agent Note 未随 npx 包发布;schema 由官方文档 + `types.ts` + 真实索引三处交叉确认。
123
+ - dshbase 数据里的 license 字段部分为空,不作为许可证证据;以仓库 LICENSE / npm 元数据为准。
124
+ - 未做正式的 TimeBack 商标检索;只用 `dsh-timeback` 包名并声明无关联。
125
+ - 社区目录收录不代表安全/兼容性背书。
package/docs/MARKET.md ADDED
@@ -0,0 +1,109 @@
1
+ # 进入 DSH 插件市场
2
+
3
+ DSH 里有两个“市场”入口,收录机制不同:
4
+
5
+ - **DSH Discover**(宿主自带):读取用户添加的 **format-1 JSON 索引**;本仓库已生成
6
+ `market/index.json`(见下文第 1 节),加索引源即可搜到,无需审核。
7
+ - **dshmarket 应用 / dshmarket.com**:只用**精选目录** awesome-dsh-plugin 的
8
+ `plugins.json`(市场每次打开实时拉取),所以上架 dshmarket = 向 awesome-dsh-plugin 提 PR
9
+ (见下文第 2 节)。dshmarket 可以安装 GitHub 源码条目(`github:` / git 源),**不强制要 npm 包**。
10
+
11
+ 另外,dshmarket 支持用户自己添加 catalog(形状是 `{plugins:[...]}` 的 JSON,不是 format-1 索引),
12
+ 本仓库的 `market/plugins.json` 就是给这种用法准备的(见下文第 1.5 节)。
13
+
14
+ 所以"进入插件市场"有三条互相补充的路,按投入从低到高排列:
15
+
16
+ ## 0. 前提:仓库公开 + topic
17
+
18
+ 1. GitHub 仓库公开(`https://github.com/ppmchen/dsh-timeback`);
19
+ 2. 仓库 Settings → Topics 添加 **`dsh-plugin`**(dshplugin.online、dshhub 会扫描该 topic);
20
+ 3. 仓库首页 About 简介、README 安装命令齐全。
21
+
22
+ ## 1. 自托管索引(最快,100% 可控,无需任何审核)
23
+
24
+ 本仓库已带生成脚本:发布代码 push 后执行
25
+
26
+ ```bash
27
+ cd /home/kali/timeback
28
+ npm run market:index # 读取当前 git commit,写 market/index.json
29
+ git add market/index.json
30
+ git commit -m "chore: regenerate plugin market index"
31
+ git push
32
+ ```
33
+
34
+ 然后把索引地址交给用户(任选一种,都无需托管服务器):
35
+
36
+ - `https://raw.githubusercontent.com/ppmchen/dsh-timeback/main/market/index.json`
37
+ - `https://cdn.jsdelivr.net/gh/ppmchen/dsh-timeback@main/market/index.json`
38
+ - 开启 GitHub Pages(Settings → Pages → Deploy from branch `main` / root)后:
39
+ `https://ppmchen.github.io/dsh-timeback/market/index.json`
40
+
41
+ 用户在 DSH:**Plugins → Discover → Index sources → 添加该 URL**,即可在 Discover 里看到
42
+ Timeback 并一键安装;他们的机器上不会出现域名限制(https + 无重定向即可)。
43
+
44
+ > 每次发版:先 push 代码/tag,再跑 `npm run market:index` 并 push,索引里的 git commit 永远指向
45
+ > 已验证的代码。若已发 npm,可执行 `npm run market:index -- --npm`,索引改用 npm 源。
46
+
47
+ ## 1.5 立即在你自己的 dshmarket 里搜到(无需等 PR)
48
+
49
+ dshmarket 的 **设置 → 插件市场 → 目录/catalogs** 支持添加自定义 catalog(URL 指向
50
+ `{ "plugins": [ ... ] }` 形状的 JSON)。本仓库提供了
51
+ [`market/plugins.json`](../market/plugins.json),安装源是 git(固定 tag `v0.5.9`,无需 npm):
52
+
53
+ ```
54
+ https://raw.githubusercontent.com/ppmchen/dsh-timeback/main/market/plugins.json
55
+ ```
56
+
57
+ 把它加进 dshmarket 的 catalog 列表后,市场里就能搜到并安装 Timeback。这条只影响你自己的
58
+ dshmarket;要让所有人的 dshmarket 搜到,必须走下一节的公共目录 PR。
59
+
60
+ ## 2. 社区目录(awesome-dsh-plugin,dshmarket 的唯一公共收录方式,推荐)
61
+
62
+ 1. Fork <https://github.com/awesome-dsh-plugin/awesome-dsh-plugin>;
63
+ 2. 把本仓库的 [`market/awesome-dsh-plugin.yml`](../market/awesome-dsh-plugin.yml) 复制为
64
+ `data/plugins/ppmchen__dsh-timeback.yml`;
65
+ 3. 提 PR 到 main。要求:仓库有 `dsh.bundle`、真实代码、topic `dsh-plugin`、描述准确、仓库创建
66
+ **≥1 天**(`check-submission.mjs` 的 `MIN_AGE_DAYS = 1`,刚建的仓库 PR 会红叉,等满 24 小时后
67
+ 自动/重跑通过);许可证以仓库 LICENSE 为准(本项目 MIT)。公共目录 merges 后,目录 CI 每日重建
68
+ `plugins.json`,dshmarket 下次打开即可搜到(通常合并后 ≤1 天)。
69
+ 4. PR 合并后会被索引到
70
+ `https://cdn.jsdelivr.net/npm/dsh-plugin-catalog/index.json`(awesome-dsh-plugin.com、dshmarket.com
71
+ 等镜像同步),所有添加了这个索引的用户都能搜索安装。
72
+
73
+ ## 3. dshbase / dshhub / dshplugin.online
74
+
75
+ - **dshplugin.online**:只靠 GitHub topic `dsh-plugin` 自动收录,无需提交;
76
+ - **dshbase**:<https://github.com/ylwl1997/dshbase/issues> 用插件提交表单;
77
+ - **dshhub**:<https://dshhub.dev/submit>(明确要求声明许可证,本项目 MIT)。
78
+
79
+ ## 4. npm(可选但推荐)
80
+
81
+ 进入目录的用户通常直接 `dsh plugin --profile web add dsh-timeback`,所以发 npm 体验最好:
82
+
83
+ ```bash
84
+ cd /home/kali/timeback
85
+ npm login --registry=https://registry.npmjs.org/ # 当前本机默认 registry 是 npmmirror,必须显式切官方
86
+ npm test
87
+ npm pack --dry-run
88
+ npm publish
89
+ ```
90
+
91
+ `package.json` 已声明 `publishConfig.registry = https://registry.npmjs.org/`,只要 token 属于官方
92
+ npm 即可;包名 `dsh-timeback` 当前未被占用(发布前再 `npm view dsh-timeback version` 确认 404)。
93
+
94
+ ## 5. 每次发版的顺序
95
+
96
+ 1. 改代码 → `node --test test/*.test.js`;
97
+ 2. 同步版本:`package.json` 的 `version` 与 `client.js` 的 `BUILD` 标记;
98
+ 3. `git add -A && git commit && git tag vX.Y.Z && git push --follow-tags`;
99
+ 4. (可选)`npm publish`;
100
+ 5. `npm run market:index`(或加 `--npm`)→ commit → push;
101
+ 6. 在 DSH Discover 里验证:索引能加载、版本号正确、安装目标可解析。
102
+
103
+ ## 6. format-1 校验要点(避免索引被拒)
104
+
105
+ - 根对象:`format: 1`、`title`(必须含 `en` 的 LocalizedText)、`plugins[]`;
106
+ - 每个 version:`version`(SemVer)、`publishTimestamp`(Unix 秒)、`source`
107
+ (`{type:'git',url,commit:40hex}` 或 `{type:'npm'}`)、可选 `engines.dsh`;
108
+ - 托管:UTF-8 JSON、HTTP 2xx、**不跟随重定向**、远程网络用 https;
109
+ - 索引里没有 license 字段,但各目录要求仓库声明许可证(本项目 MIT)。
@@ -0,0 +1,180 @@
1
+ # 发布与分享(GitHub / npm / 插件市场)
2
+
3
+ 本仓库已经按“可发布插件包”准备好。下面的命令把 `<you>` 换成一个 GitHub 用户名(例如 `alice`),
4
+ `<repo>` 默认就是 `dsh-timeback`。
5
+
6
+ ## 0. 仓库当前状态(已准备好的部分)
7
+
8
+ - 仓库根目录就是插件包:`package.json` 里的 `dsh.bundle.patch` 指向 `cordis.patch.yml`,
9
+ `dsh.client` 声明浏览器半,`engines.dsh` 覆盖当前运行时 `0.2.2-rc.5`;
10
+ - 无需构建:`client.js` / `index.js` / `src/*.js` 都是可直接加载的 ESM/浏览器模块;
11
+ - `npm test` 的 40 个测试只用 Node 内置 `node:test`,CI 工作流已放在 `.github/workflows/test.yml`;
12
+ - `.gitignore` 排除了 `node_modules`、`*.tgz` 和临时文件;
13
+ - `LICENSE`(MIT)、`ACKNOWLEDGEMENTS.md`、`README.md`、`docs/` 齐全,可随仓库和 npm 包分发。
14
+
15
+ **需要你做的**:创建 GitHub 仓库、推送、按需发布 npm / 提交插件市场。下面逐条给命令。
16
+
17
+ ## 1. 填写仓库元数据(一次性)
18
+
19
+ 创建仓库后把真实地址写进 `package.json`:
20
+
21
+ ```bash
22
+ export GH_USER=<you>
23
+ node -e 'const fs=require("fs");const p=JSON.parse(fs.readFileSync("package.json","utf8"));
24
+ p.repository={type:"git",url:`https://github.com/${process.env.GH_USER}/dsh-timeback.git`};
25
+ p.homepage=`https://github.com/${process.env.GH_USER}/dsh-timeback#readme`;
26
+ p.bugs={url:`https://github.com/${process.env.GH_USER}/dsh-timeback/issues`};
27
+ fs.writeFileSync("package.json",JSON.stringify(p,null,2)+"\n")'
28
+ ```
29
+
30
+ 设置你自己的 git 身份(首次提交作者应为占位身份时,用最后一行改写):
31
+
32
+ ```bash
33
+ git config --global user.name "Your Name"
34
+ git config --global user.email "you@example.com"
35
+ # 如果已经有初始提交并想改成你的身份:
36
+ git commit --amend --reset-author --no-edit
37
+ ```
38
+
39
+ ## 2. 创建 GitHub 仓库并推送
40
+
41
+ 1. 在 GitHub 网页新建空仓库 `dsh-timeback`:**不要**勾选初始化 README / .gitignore / LICENSE(避免冲突)。
42
+ 2. 在本地仓库目录执行:
43
+
44
+ ```bash
45
+ git remote add origin git@github.com:<you>/dsh-timeback.git # 或 https://github.com/<you>/dsh-timeback.git
46
+ git push -u origin main
47
+ # 可选:给这次发布打标签(推荐用 Release 记录版本)
48
+ git tag v0.5.9
49
+ git push origin v0.5.9
50
+ ```
51
+
52
+ 推送完成后,仓库首页应能看到 README、源码和“40 tests passing”的 CI 徽章(在 Actions 里)。
53
+
54
+ ## 3. 让其他人安装(不需要 npm)
55
+
56
+ DSH 的插件安装走 profile,先让用户确认自己用的是哪一套 profile:
57
+
58
+ | 使用方式 | profile |
59
+ |---|---|
60
+ | 浏览器 / `dsh web` | `web` |
61
+ | 桌面 App | `desktop` |
62
+
63
+ **从 GitHub 直接安装**(pnpm 支持的 git 规格):
64
+
65
+ ```bash
66
+ # 最新 main
67
+ dsh plugin --profile web add github:<you>/dsh-timeback
68
+ # 指定标签/版本(推荐给用户精确版本)
69
+ dsh plugin --profile web add github:<you>/dsh-timeback#v0.5.9
70
+ # 或者完整 URL
71
+ dsh plugin --profile web add https://github.com/<you>/dsh-timeback.git
72
+ ```
73
+
74
+ **离线 tarball 安装**(适合发压缩包):
75
+
76
+ ```bash
77
+ npm pack # 生成 dsh-timeback-0.5.9.tgz
78
+ dsh plugin --profile web add ./dsh-timeback-0.5.9.tgz
79
+ ```
80
+
81
+ **本地目录安装**(开发者):
82
+
83
+ ```bash
84
+ dsh plugin --profile web add /path/to/timeback
85
+ ```
86
+
87
+ 安装后的固定动作:
88
+
89
+ 1. 重启 `dsh web`(或桌面 App);
90
+ 2. 浏览器硬刷新(Ctrl+Shift+R);
91
+ 3. 打开任意会话,检查:输入框上方「⏱ 时间回溯」、会话标题栏时钟按钮、右侧栏指南里的「时间回溯」;
92
+ 4. 面板右上角构建标记应为当前版本(例如 `0.5.9+pan`);工作区记录默认**关闭**,需要在新会话行 / 工作区 ⋯ 菜单 / 面板里勾选。
93
+
94
+ > 注意:仓库根目录必须就是包根(`package.json` 与 `cordis.patch.yml` 在同一目录)。本仓库已满足,
95
+ > 不要把它们移进子目录,否则 `github:...` 安装会因为找不到 `dsh.bundle.patch` 而只装成普通依赖、不激活插件。
96
+
97
+ ## 4. 发布到 npm(推荐,插件市场和 `add <包名>` 都依赖它)
98
+
99
+ ```bash
100
+ # 名字是否可用(404 = 可用;本插件当前使用 dsh-timeback)
101
+ npm view dsh-timeback version
102
+
103
+ npm login
104
+ npm pack --dry-run # 检查打包清单:约 17 个文件,不应包含 test/、research/、.github/
105
+ npm publish # 公开包名直接发布;如果改成 scoped 包才需要 --access public
106
+ ```
107
+
108
+ 发布后用户安装:
109
+
110
+ ```bash
111
+ dsh plugin --profile web add dsh-timeback
112
+ dsh plugin --profile web add dsh-timeback@0.5.9
113
+ ```
114
+
115
+ 升级发布流程:改代码 → `npm test` → `npm version patch|minor` → `git push --follow-tags` → `npm publish`。
116
+ 插件市场索引里的 `engines.dsh` 与 `package.json` 保持一致。
117
+
118
+ ## 5. 上架 DSH 插件市场 / 目录
119
+
120
+ DSH 没有官方中央商店;Discover 读取的是 format-1 JSON 索引,实际入口是社区目录:
121
+
122
+ 1. **GitHub topic**:给仓库加 `dsh-plugin` topic —— dshplugin.online / dshhub 会自动扫描收录;
123
+ 2. **awesome-dsh-plugin**:向 <https://github.com/awesome-dsh-plugin/awesome-dsh-plugin> 提 PR,
124
+ 新增 `data/plugins/<your>__dsh-timeback.yml`:
125
+
126
+ ```yaml
127
+ url: https://github.com/<you>/dsh-timeback
128
+ name: <you>/dsh-timeback
129
+ category: session
130
+ description:
131
+ en: 'Conversation map with per-workspace file checkpoints: branch, rewind and restore files together.'
132
+ zh: '带工作区文件快照的对话地图:分支、回溯与文件恢复一体,支持删除节点之后的内容。'
133
+ ```
134
+
135
+ 3. **dshbase**:<https://github.com/ylwl1997/dshbase/issues> 用插件提交表单;
136
+ 4. **dshhub**:<https://dshhub.dev/submit>(要求声明许可证,本仓库 MIT);
137
+ 5. **自建索引**(可选):按 format-1 写一个 `index.json` 放静态托管,例如:
138
+
139
+ ```json
140
+ {
141
+ "format": 1,
142
+ "title": "My DSH plugins",
143
+ "plugins": [
144
+ {
145
+ "name": "dsh-timeback",
146
+ "title": "Timeback",
147
+ "description": "Conversation map with workspace file checkpoints.",
148
+ "metadata": { "category": "session", "keywords": ["checkpoint", "rewind", "branch"] },
149
+ "versions": [
150
+ {
151
+ "version": "0.5.9",
152
+ "publishTimestamp": 1796016000,
153
+ "source": { "type": "npm" },
154
+ "engines": { "dsh": ">=0.2.2-rc.1 <0.3.0-0" }
155
+ }
156
+ ]
157
+ }
158
+ ]
159
+ }
160
+ ```
161
+
162
+ 然后用户在 `Plugins → Discover → Index sources` 添加该 URL 即可。
163
+
164
+ ## 6. 发布前检查清单
165
+
166
+ - [ ] `node --test test/*.test.js` 全绿(当前 40 个)
167
+ - [ ] `package.json` 的 `version` 与 `client.js` 里的 `BUILD` 一致
168
+ - [ ] `npm pack --dry-run` 里包含 `index.js`、`client.js`、`src/`、`locale/`、`icon.svg`、`cordis.patch.yml`
169
+ - [ ] `LICENSE`、`ACKNOWLEDGEMENTS.md`、`README.md` 是当前行为(记录按工作区开关、删除=截断分支+归档)
170
+ - [ ] README 的安装命令、限制(DSH 日志只追加;归档可恢复;大小守卫)是最新的
171
+ - [ ] CI 通过;tag 与 npm 版本一致
172
+ - [ ] 安装到另一个全新 profile 实测一次(`dsh plugin --profile <name> add <包>` → 重启 → 刷新页面 → 勾选工作区记录 → 跑两轮 → 回到前置节点)
173
+
174
+ ## 7. 常见问题
175
+
176
+ - **别人装完看不到面板**:先重启宿主再硬刷新页面(浏览器半需要刷新才会加载新 bundle);再确认装对了 profile;
177
+ - **安装后插件没有 Host 行**:检查仓库根是否还有 `package.json` 的 `dsh.bundle.patch` 和 `cordis.patch.yml`;
178
+ - **`engines.dsh` 不匹配**:DSH 安装时会拒绝;用 `>=0.2.2-rc.1 <0.3.0-0` 覆盖当前 rc 系列,升级 DSH 大版本时同步调整;
179
+ - **工作区默认不记录**:这是设计(隐私);用户需在面板/工作区菜单/新会话行勾选;
180
+ - **“删除后续”不是物理删除**:DSH 会话日志 append-only,本插件用“创建截断分支 + 归档旧会话”实现,旧会话可在 DSH 侧栏归档列表恢复。
@@ -0,0 +1,30 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
2
+ <rect width="640" height="300" rx="18" fill="#f2f5fa"/>
3
+ <rect x="48" y="36" width="330" height="228" rx="14" fill="#ffffff" stroke="#c3cedd" stroke-width="2"/>
4
+ <rect x="70" y="58" width="210" height="11" rx="5.5" fill="#cfd9e6"/>
5
+ <rect x="70" y="80" width="130" height="8" rx="4" fill="#e1e8f1"/>
6
+ <rect x="70" y="112" width="286" height="42" rx="9" fill="#f6f9fd" stroke="#d5dfea" stroke-width="1.5"/>
7
+ <rect x="84" y="124" width="86" height="8" rx="4" fill="#8fa8d8"/>
8
+ <rect x="84" y="138" width="140" height="6" rx="3" fill="#d9e2ee"/>
9
+ <rect x="70" y="164" width="286" height="42" rx="9" fill="#f6f9fd" stroke="#d5dfea" stroke-width="1.5"/>
10
+ <rect x="84" y="176" width="104" height="8" rx="4" fill="#8fa8d8"/>
11
+ <rect x="84" y="190" width="120" height="6" rx="3" fill="#d9e2ee"/>
12
+ <rect x="70" y="216" width="286" height="34" rx="9" fill="#eef4ff" stroke="#b9cdf3" stroke-width="1.5"/>
13
+ <rect x="84" y="229" width="70" height="8" rx="4" fill="#5b8def"/>
14
+ <rect x="404" y="36" width="188" height="228" rx="14" fill="#ffffff" stroke="#5b8def" stroke-width="2"/>
15
+ <rect x="422" y="54" width="86" height="10" rx="5" fill="#5b8def"/>
16
+ <path d="M424 84h10v10" fill="none" stroke="#3ecf8e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
17
+ <path d="M434 84h44" stroke="#d9e2ee" stroke-width="2" stroke-linecap="round"/>
18
+ <path d="M424 114h10v10" fill="none" stroke="#3ecf8e" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
19
+ <path d="M434 114h44" stroke="#d9e2ee" stroke-width="2" stroke-linecap="round"/>
20
+ <rect x="424" y="140" width="148" height="38" rx="8" fill="#f6f9fd" stroke="#d5dfea" stroke-width="1.5"/>
21
+ <path d="M436 159h-6m0 0 3-3m-3 3 3 3" fill="none" stroke="#5b8def" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
22
+ <rect x="446" y="151" width="72" height="7" rx="3.5" fill="#b9cdf3"/>
23
+ <rect x="446" y="163" width="48" height="6" rx="3" fill="#d9e2ee"/>
24
+ <rect x="424" y="186" width="148" height="38" rx="8" fill="#f6f9fd" stroke="#d5dfea" stroke-width="1.5"/>
25
+ <path d="M436 205h-6m0 0 3-3m-3 3 3 3" fill="none" stroke="#5b8def" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
26
+ <rect x="446" y="197" width="64" height="7" rx="3.5" fill="#b9cdf3"/>
27
+ <rect x="446" y="209" width="56" height="6" rx="3" fill="#d9e2ee"/>
28
+ <rect x="424" y="238" width="88" height="9" rx="4.5" fill="#e1e8f1"/>
29
+ <rect x="398" y="120" width="12" height="12" rx="3" fill="#8fa8d8"/>
30
+ </svg>
package/icon.svg ADDED
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none">
2
+ <circle cx="19" cy="19.5" r="10.5" stroke="#5b8def" stroke-width="2.5"/>
3
+ <path d="M19 13.4v6.6l4.4 2.7" stroke="#5b8def" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M5.5 10.5v6.2h6.2" stroke="#3ecf8e" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M6.2 16.2A11.9 11.9 0 0 1 13 6.8" stroke="#3ecf8e" stroke-width="2.2" stroke-linecap="round"/>
6
+ </svg>