dsh-sidenote 0.4.5 → 0.5.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 +14 -35
- package/lib/client.js +4435 -3034
- package/lib/types/client/annotate/anchor.d.ts +7 -3
- package/lib/types/client/annotate/chip.d.ts +1 -5
- package/lib/types/client/annotate/index.d.ts +2 -1
- package/lib/types/client/annotate/overlay.d.ts +35 -17
- package/lib/types/client/annotate/selection.d.ts +5 -4
- package/lib/types/client/annotate/send.d.ts +5 -36
- package/lib/types/client/annotations/boundary.d.ts +16 -0
- package/lib/types/client/annotations/chip.d.ts +16 -0
- package/lib/types/client/{annotate → annotations}/format.d.ts +0 -2
- package/lib/types/client/{annotate → annotations}/model.d.ts +16 -1
- package/lib/types/client/annotations/send.d.ts +12 -0
- package/lib/types/client/annotations/source.d.ts +25 -0
- package/lib/types/client/bridge.d.ts +8 -11
- package/lib/types/client/diagnostics/index.d.ts +2 -0
- package/lib/types/client/diagnostics/mode.d.ts +9 -0
- package/lib/types/client/host/attachments.d.ts +14 -0
- package/lib/types/client/host/chat.d.ts +9 -0
- package/lib/types/client/host/contracts.d.ts +23 -4
- package/lib/types/client/host/dom.d.ts +32 -0
- package/lib/types/client/host/input.d.ts +26 -0
- package/lib/types/client/host/models.d.ts +41 -0
- package/lib/types/client/host/probes.d.ts +27 -11
- package/lib/types/client/host/sidebar.d.ts +38 -0
- package/lib/types/client/host/submission.d.ts +12 -0
- package/lib/types/client/host/tabs.d.ts +4 -0
- package/lib/types/client/locales.d.ts +42 -0
- package/lib/types/client/sidechat/ComposerBar.d.ts +2 -0
- package/lib/types/client/sidechat/SideChatPanel.d.ts +3 -0
- package/lib/types/client/sidechat/composer/attach.d.ts +2 -28
- package/lib/types/client/sidechat/composer.d.ts +7 -5
- package/lib/types/client/sidechat/index.d.ts +2 -1
- package/lib/types/client/sidechat/lifecycle.d.ts +3 -57
- package/lib/types/client/sidechat/metaStore.d.ts +7 -5
- package/lib/types/client/sidechat/native-tab.d.ts +7 -1
- package/lib/types/client/sidechat/native.d.ts +13 -62
- package/lib/types/client/sidechat/open.d.ts +6 -3
- package/lib/types/client/sidechat/recentClosed.d.ts +9 -0
- package/lib/types/client/sidechat/target.d.ts +20 -0
- package/package.json +4 -4
- package/src/client/annotate/anchor.ts +37 -42
- package/src/client/annotate/annotate.module.css +0 -149
- package/src/client/annotate/bubble.ts +2 -2
- package/src/client/annotate/chip.tsx +7 -120
- package/src/client/annotate/hint.tsx +2 -3
- package/src/client/annotate/index.tsx +7 -4
- package/src/client/annotate/overlay.tsx +185 -98
- package/src/client/annotate/selection.ts +20 -40
- package/src/client/annotate/send.ts +50 -152
- package/src/client/annotations/annotations.module.css +160 -0
- package/src/client/annotations/boundary.tsx +15 -0
- package/src/client/annotations/chip.tsx +127 -0
- package/src/client/{annotate → annotations}/format.ts +0 -7
- package/src/client/{annotate → annotations}/model.ts +38 -5
- package/src/client/annotations/send.ts +48 -0
- package/src/client/annotations/source.ts +81 -0
- package/src/client/bridge.ts +4 -11
- package/src/client/diagnostics/diagnostics.module.css +63 -0
- package/src/client/diagnostics/index.tsx +93 -0
- package/src/client/diagnostics/mode.ts +22 -0
- package/src/client/host/attachments.ts +40 -0
- package/src/client/host/chat.ts +31 -0
- package/src/client/host/contracts.ts +13 -4
- package/src/client/host/dom.ts +85 -0
- package/src/client/host/input.ts +103 -0
- package/src/client/host/models.ts +135 -0
- package/src/client/host/probes.ts +114 -95
- package/src/client/host/sidebar.ts +102 -0
- package/src/client/host/submission.ts +123 -0
- package/src/client/host/tabs.ts +7 -0
- package/src/client/index.tsx +8 -8
- package/src/client/locales.ts +68 -0
- package/src/client/sidechat/ComposerBar.tsx +6 -2
- package/src/client/sidechat/SideChatPanel.tsx +35 -25
- package/src/client/sidechat/composer/attach.ts +2 -44
- package/src/client/sidechat/composer.ts +93 -55
- package/src/client/sidechat/index.tsx +7 -8
- package/src/client/sidechat/lifecycle.ts +6 -185
- package/src/client/sidechat/metaStore.ts +20 -6
- package/src/client/sidechat/model.ts +1 -1
- package/src/client/sidechat/native-tab.tsx +38 -8
- package/src/client/sidechat/native.ts +29 -101
- package/src/client/sidechat/open.ts +8 -13
- package/src/client/sidechat/recentClosed.ts +20 -0
- package/src/client/sidechat/referenceSource.ts +2 -1
- package/src/client/sidechat/rows.tsx +3 -3
- package/src/client/sidechat/sidechat.module.css +5 -0
- package/src/client/sidechat/slash.ts +4 -1
- package/src/client/sidechat/target.ts +85 -0
package/README.md
CHANGED
|
@@ -50,8 +50,12 @@ dsh plugin --profile web add dsh-sidenote
|
|
|
50
50
|
## 划选注释——把「这句有问题」变成模型的上下文
|
|
51
51
|
|
|
52
52
|
- 划选 assistant 回复 → 浮层 → 注解编辑器,右缘编号角标锚定原文;
|
|
53
|
-
-
|
|
54
|
-
-
|
|
53
|
+
- 添加到主对话或侧边聊天都保存为同一类受控注释,使用同一套 chip 预览、逐条移除及批量清空;引用和注解全文保留,**草稿零污染**,可只发送引用;
|
|
54
|
+
- 新建注解点击编辑器外部或按 Enter 保存,Esc 明确取消;主→侧先等待选定 Tab 的真实子会话,等待期间可按 Esc 取消,失败则保留注解并提示重试;
|
|
55
|
+
- 通过宿主原生输入机发送,保留 `@` 引用、图片附件和队列/steer 仲裁;目标会话出现持久消息或真实队列记录后,这一批注释才标为已发送,气泡收成「批注 ×N」留痕;
|
|
56
|
+
- 保存的注释按目标会话隔离;存储不可用时提示仅保存在内存。发送失败保留注释与正文,提交期间新增或修改的注释留给下一条消息。
|
|
57
|
+
- 侧边 assistant 正文也支持局部划选、多段落、列表与代码引用,入口只向所在侧聊添加;继承历史同样归当前子会话。流式、跨消息、思考和控件不作为引用。角标与高亮跟随来源消息并裁剪到其可见区域;原文折叠时注释仍在 chip 中。
|
|
58
|
+
- 已保存注释刷新后保留。宿主恢复原生 tab 时重新绑定原子会话;未恢复侧栏时,可用 `/side` 中的“重开”恢复原子会话及注释。新建 fork 使用自己的独立注释列表。
|
|
55
59
|
|
|
56
60
|
| 划选浮层 | 注解编辑器 |
|
|
57
61
|
|---|---|
|
|
@@ -73,14 +77,11 @@ dsh plugin --profile web add dsh-sidenote
|
|
|
73
77
|
|
|
74
78
|
## 兼容性
|
|
75
79
|
|
|
76
|
-
|
|
77
|
-
|---|---|---|
|
|
78
|
-
| ≥ 0.1.5-rc.1 | 任意(无需安装) | **直连 DSH 原生右侧边栏** |
|
|
79
|
-
| ≤ 0.1.2-rc.x | ≤ 0.18.x(必需) | legacy 布局承载 |
|
|
80
|
+
维护范围按精确组合列在[兼容与维护政策](docs/compatibility.md):0.1.7 当前维护,0.1.5 延长维护,0.1.1/0.1.2 的三组旧路径冻结且保留必需验收,0.2.0-rc.2 已通过精确准入并纳入当前维护。未列组合不作已验证承诺;安装引擎范围不代表其中所有版本均兼容。
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
诊断默认关闭。排障时在 **设置 → 通用设置 → dsh-sidenote 诊断模式** 手动开启,顶栏才会出现“兼容诊断”,可查看、重查或导出当前接入状态。选择仅保存在当前浏览器、当前 DSH 地址,刷新后保留;无法本地保存时只在当前页生效。关闭诊断不影响能力检测、输入恢复或失败时的内容保留,也不修改宿主的全局开发者开关。服务尚未就绪不等于不兼容;无法读取的宿主版本显示未知。报告手动下载,不包含用户正文、凭证或本机路径。
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
原生右栏无需 BS;旧版依赖表中的 BS 组合。原生 page kind 每 pane 一个,分栏可容纳多个 pane;普通入口聚焦既有 tab,关闭后 `/side` 重开原 child。其他 BS 共存或未来 `multiple` 能力需单独验收。
|
|
84
85
|
|
|
85
86
|
## 设计要点
|
|
86
87
|
|
|
@@ -93,37 +94,15 @@ dsh plugin --profile web add dsh-sidenote
|
|
|
93
94
|
| 命令 | 说明 |
|
|
94
95
|
|---|---|
|
|
95
96
|
| `pnpm typecheck` | tsc --noEmit |
|
|
96
|
-
| `pnpm test` | vitest
|
|
97
|
+
| `pnpm test` | vitest 单测(先运行 build) |
|
|
97
98
|
| `pnpm build` | 类型声明 + tsdown(host ESM + client CJS bundle,纯度门) |
|
|
98
|
-
| `pnpm test:mount` |
|
|
99
|
+
| `pnpm test:mount` | 真实 `dsh web` + 种子会话 + Playwright 挂载与交互验收(`BS_VERSION`/`DSH_CMD` 切版本矩阵) |
|
|
99
100
|
|
|
100
|
-
|
|
101
|
+
## 参与贡献
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
欢迎报告问题、提出需求、协助复现、改进文档和提交代码。请从 [Issue 入口](https://github.com/g-yixuan/dsh-sidenote/issues/new/choose) 或[贡献指南](CONTRIBUTING.md)开始;中文和 English 都可以。
|
|
103
104
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
> **触发条件是「发布一个 GitHub Release」,不是推 tag。**
|
|
107
|
-
> 只 `git push --tags` 不会发布任何东西——tag 会静静躺在那里。
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
# 1. 改 package.json 的 version,提交
|
|
111
|
-
git commit -am "release: vX.Y.Z——<摘要>"
|
|
112
|
-
|
|
113
|
-
# 2. 打 tag 并推送(这一步还没有发布)
|
|
114
|
-
git tag vX.Y.Z && git push origin main --tags
|
|
115
|
-
|
|
116
|
-
# 3. 创建 GitHub Release —— 这一步才真正触发发布
|
|
117
|
-
gh release create vX.Y.Z --title "vX.Y.Z — <标题>" --notes-file <notes.md>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
workflow 随后自动跑 build → typecheck → test → `pnpm publish --provenance`,并校验 tag 与 `package.json` 版本一致(不一致直接失败)。
|
|
121
|
-
|
|
122
|
-
几个已知的坑:
|
|
123
|
-
|
|
124
|
-
- **registry 有复制延迟**:workflow 显示 `✅ Published` 后,`npm view` 仍可能有 1–5 分钟看到旧版本(Fastly `max-age=300`)。以 workflow 日志为准,不要据此判断失败而重试。
|
|
125
|
-
- **别去折腾 npm token**:npm 正在[系统性废止 bypass-2FA 的 granular token](https://github.blog/changelog/2026-07-31-restricting-npm-bypass-2fa-granular-access-tokens/)。本仓库不依赖任何 token,发布失败请先看 workflow 日志,而不是 token 配置。
|
|
126
|
-
- **CI 的 `plugin-mount` lane 失败不阻塞发版**:那是独立 workflow,Release 流程只跑单测,不跑 e2e。
|
|
105
|
+
维护者见[仓库维护](docs/maintaining.md)和[发布指南](docs/releasing.md)。
|
|
127
106
|
|
|
128
107
|
## License
|
|
129
108
|
|