dsh-quote-annotate-pro 0.2.9 → 0.2.10
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/CHANGELOG.md +9 -0
- package/README.en.md +6 -0
- package/README.md +8 -0
- package/lib/client.js +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的所有重要变更都记在这里。版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## 0.2.10 — 文档更正:如实披露 localhost 诊断探测
|
|
6
|
+
|
|
7
|
+
- PR #697(`0xsline/awesome-deepseek-harness`)**已合并**,但维护者把我们的收录文案从 "no network access" 改写成
|
|
8
|
+
*"the client enables localhost diagnostic requests by default"* —— 因为插件默认确实会向 `127.0.0.1:47821` 发一次探测
|
|
9
|
+
- README / README.en 新增「隐私 / 网络」小节:如实说明"纯客户端、不访问外部服务、不碰凭证",
|
|
10
|
+
但**默认会向本机 47821 发一次探测**;想让"零请求"成真就设 `DIAG_ENABLED = false`
|
|
11
|
+
- 发布工具包 `PR-TEXTS.md` 同步改写(EN/ZH 两处模板 + 复查清单加了一条 ⚠️ 提醒),避免后续插件再写错
|
|
12
|
+
- 仅文档变更,代码行为不变
|
|
13
|
+
|
|
5
14
|
## 0.2.9 — 编辑框定位再修:排除"贴文档原点"的退化矩形
|
|
6
15
|
|
|
7
16
|
- 0.2.8 只拦了"尺寸为 0"的矩形;实测选区被打断后 `getBoundingClientRect()` 会返回**贴文档原点、但高度非 0** 的退化矩形,仍会算出 `left≈12 / top≈8`(窗口左上角)
|
package/README.en.md
CHANGED
|
@@ -81,6 +81,12 @@ npm run diag # local diagnostics sink (http://127.0.0.1:47821)
|
|
|
81
81
|
|
|
82
82
|
`lib/client.js` is a hand-written bundle (no build step) — edit and save; the client HMR reloads it. See [README.md](./README.md) (Chinese) for the diagnostics channel and known limitations.
|
|
83
83
|
|
|
84
|
+
### Privacy / network (state this accurately in directory entries)
|
|
85
|
+
|
|
86
|
+
This is a client-side plugin: **no external services, no credentials**. Its only data store is the anchor map in `localStorage` (≤60 entries per session).
|
|
87
|
+
|
|
88
|
+
⚠️ It **does** send one probe to `http://127.0.0.1:47821` on load by default (`DIAG_ENABLED = true`) plus diagnostics once a local sink answers — so **do not describe it as "no network access"**. On 2026-10-16 the `0xsline/awesome-deepseek-harness` maintainer corrected exactly that claim while merging our entry to *"the client enables localhost diagnostic requests by default"*. Set `DIAG_ENABLED = false` if you want zero requests to be literally true.
|
|
89
|
+
|
|
84
90
|
## Releasing (maintainers)
|
|
85
91
|
|
|
86
92
|
Releases go through **npm Trusted Publishing (OIDC)** — no token is stored in the repository and no one-time code is needed:
|
package/README.md
CHANGED
|
@@ -129,6 +129,14 @@ const DIAG_URL = 'http://127.0.0.1:47821/dsh-quote-pro'
|
|
|
129
129
|
插件启动时 POST 一次 `/ping`;**探测不到接收端就本次运行静默**(不会产生网络噪音)。
|
|
130
130
|
配合 `npm run diag`,终端会实时打出全链路事件:
|
|
131
131
|
|
|
132
|
+
> ⚠️ **隐私 / 网络说明(收录信息里必须如实写)**:本插件是纯客户端插件,**不访问任何外部服务、不碰凭证**,
|
|
133
|
+
> 唯一的数据落点是 `localStorage` 里的锚点表(每会话 ≤60 条)。
|
|
134
|
+
> 但它默认会向**本机** `http://127.0.0.1:47821` 发一次探测(以及探测成功后的诊断事件)——
|
|
135
|
+
> 这是 `DIAG_ENABLED = true` 的默认行为,**不要写成"零网络请求"**。
|
|
136
|
+
> 2026-10-16 我们就因为这句不准确的表述,被 `0xsline/awesome-deepseek-harness` 的维护者在合并时改写成
|
|
137
|
+
> *"the client enables localhost diagnostic requests by default"*。想让"无网络请求"成为事实,就把 `DIAG_ENABLED` 改成 `false`。
|
|
138
|
+
|
|
139
|
+
|
|
132
140
|
```
|
|
133
141
|
module:materialized / apply:start / register:ok … 插件加载与槽位注册
|
|
134
142
|
selection:show / selection:stage 划词与「批注」
|
package/lib/client.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
// dsh-quote-annotate-pro —— Client 半区(浏览器)
|
|
2
2
|
// Fork of dsh-quote-annotate v0.1.1 (MIT, wangwei-wade) —— 增强:精确锚点 / 可观测性
|
|
3
3
|
// 上游 bundle 形态保留:window.__ModuleLoader__ 工厂式 CJS
|
|
4
|
+
//
|
|
5
|
+
// ⚠️ 开发注意(踩过的坑,改装饰逻辑前必读)
|
|
6
|
+
// 1) 装饰(把"【引用 · 第N轮 · 角色】+ 原文"重排成紧凑块)**绝不能破坏用户当前选区**:
|
|
7
|
+
// 一旦替换了用户正在划词的文本节点,range.getBoundingClientRect() 会退化成"贴文档原点"的矩形,
|
|
8
|
+
// 用它算出的位置正好是 left≈12/top≈8 —— 批注编辑框就跑到窗口左上角(0.2.8 的现象)。
|
|
9
|
+
// 因此:① 扫描时用 selectionTouches(row) 跳过用户正在划词的那条消息;
|
|
10
|
+
// ② 编辑框定位一律走 anchorRect():优先**当前活着的选区** → 校验过的旧矩形 → 视口底部居中。
|
|
11
|
+
// 2) 装饰必须是"幂等 + 只加样式类/包一层隐藏元素",且判定要看**内容**(是否还有未接管的位置行),
|
|
12
|
+
// 不能只看 data-* 标记 —— 宿主会重排气泡内容,标记会骗人。
|
|
13
|
+
// 3) 所有装饰都要 try/catch 且不抛到 React 渲染路径上;观察者回调里同步执行(先于绘制)才不会闪。
|
|
4
14
|
window.__ModuleLoader__.load({
|
|
5
15
|
id: 'dsh-quote-annotate-pro',
|
|
6
16
|
factory: (require) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-quote-annotate-pro",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "选区引用与锚点批注(增强 fork):划词 → 批注 → 带精确锚点的引用;输入框上方只显示原文片段,点一下跳回原文;发送时把轮次/角色写入引用块,让模型精确知道你指的是哪一处。",
|
|
5
5
|
"keywords": ["dsh", "dsh-plugin", "deepseek-harness", "quote", "annotate", "selection", "reference", "anchor"],
|
|
6
6
|
"license": "MIT",
|