dsh-sticky 0.3.0 → 0.3.2
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 +1 -1
- package/docs/compatibility.md +5 -3
- package/docs/data-format.md +8 -4
- package/docs/editor.md +4 -2
- package/lib/client.js +111 -121
- package/lib/index.js +4 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-sticky)
|
|
6
6
|
[](https://github.com/zerolzg/dsh-sticky/blob/main/LICENSE)
|
|
7
|
-
[](https://github.com/zerolzg/dsh-sticky/blob/main/docs/compatibility.md)
|
|
8
8
|
|
|
9
9
|
DeepSeek Harness 的便签插件:右侧栏里的一个便签 tab,装着一面 Markdown 便签卡片墙。便签以 Markdown 文本存成本机的独立 JSON 文件,支持颜色标记、固定、归档与全文搜索。
|
|
10
10
|
|
package/docs/compatibility.md
CHANGED
|
@@ -4,8 +4,10 @@ This plugin rides a supported DeepSeek Harness release. `docs/compatibility.md`
|
|
|
4
4
|
|
|
5
5
|
## Baseline
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- `tests/seams.ts` pins
|
|
7
|
+
- Floor baseline `dsh-v0.2.2-rc.3`, publishing `@deepseek-ai/dsh` `0.2.2-rc.3`; newest baseline `dsh-v0.2.2-rc.5`, publishing `0.2.2-rc.5`.
|
|
8
|
+
- `tests/seams.ts` pins both tags in `BASELINES` and states `DSH_RANGE`, the single source of truth for `package.json` `engines.dsh`; `tests/compat/manifest.spec.ts` asserts the manifest carries `DSH_RANGE` verbatim.
|
|
9
|
+
- `engines.dsh` is `>=0.2.2-rc.3 <0.2.3-0`: it accepts every version from the floor baseline up through the 0.2.2 patch range, including the 0.2.2 final release, and rejects everything below the floor, from `0.2.3-0` up, and the 0.2.3 releases. The cap is the newest baseline's next patch, the first release the seams make no promise about.
|
|
10
|
+
- Upgrading to a newer Harness release: verify the 9 needles on the new checkout, update the newest entry in `BASELINES` and the cap in `DSH_RANGE`, and update the README badge, all in the same commit.
|
|
9
11
|
- `package.json` `dsh.client.inject` names three provider packages and nothing is required from them: the rows express load order only.
|
|
10
12
|
- `@deepseek-ai/dsh-client-ui-sidebar-right` provides `sidebarRightTabs`.
|
|
11
13
|
- `@deepseek-ai/dsh-api-session-controller` provides `sessions`, whose `scope(id)` borrows the current Session's scope.
|
|
@@ -45,5 +47,5 @@ A shell-seeded module never joins `dsh.client.external`: the Harness packaging v
|
|
|
45
47
|
`tests/compat/` runs against the built `lib/` bundle and a Harness checkout resolved from `$DSH_REPO`, defaulting to `~/Projects/github/deepseek-harness`:
|
|
46
48
|
|
|
47
49
|
- On a development box a missing checkout or missing build skips the affected specs and prints the reason.
|
|
48
|
-
- In CI (`CI` environment set) the same conditions fail the run; the
|
|
50
|
+
- In CI (`CI` environment set) the same conditions fail the run; the two baseline tags are fetched shallowly by the workflows.
|
|
49
51
|
- `tests/compat/manifest.spec.ts` keeps `package.json` in lockstep with the baseline: engines, exports, files, external modules, and shipped scripts.
|
package/docs/data-format.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
每条便签是 `$DSH_HOME/storages/dsh-sticky/notes/<id>.json` 一个文件,`$DSH_HOME` 缺省为 `~/.dsh`。插件启动时不迁移旧位置,也不回退到别处。
|
|
8
8
|
|
|
9
|
-
便签自有的图片在 `$DSH_HOME/storages/dsh-sticky/images/<id
|
|
9
|
+
便签自有的图片在 `$DSH_HOME/storages/dsh-sticky/images/<id>/<数字前缀>-<6位十六进制>.<扩展名>`,一个便签一个目录。数字前缀是写入时的时钟值(1–16 位数字,测试注入的短时钟与毫秒时间戳都合法),十六进制段防同毫秒碰撞。目录名就是归属:删便签时整个目录一起删,不需要扫别的便签判断某张图是否还有别处引用。
|
|
10
10
|
|
|
11
11
|
便签自有图片的根目录(`$DSH_HOME/storages/dsh-sticky/images`)通过 `GET /api/sticky/paths` 交给浏览器半边,回答 `{ ok: true, imagesRoot }`,`imagesRoot` 就是目录本身,不拼接、不规范化。它只用于把正文里的 `notes-asset:` 引用改写成绝对路径(见[编辑器交互](editor.md))。这是唯一一条把文件系统路径交给浏览器的通道,而且只交根目录,不交单个文件的路径。
|
|
12
12
|
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
- `version
|
|
33
|
-
- `id`:同时作为文件名,字母表受限(见 `NOTE_ID_PATTERN
|
|
34
|
-
- `title
|
|
32
|
+
- `version`:文档格式版本。读取时大于当前版本的文档视为不可读,与损坏文件同样跳过并警告:当前代码不能改写为它编写的未来格式;小于或等于当前版本、或字段缺省时按当前版本读。
|
|
33
|
+
- `id`:同时作为文件名,字母表受限(见 `NOTE_ID_PATTERN`)。文档内的 `id` 必须与文件名一致,不一致的文件按损坏文档处理(跳过并警告):路径由文件名推导,两个文件共用一个 id 会让列表重复、写入落到别的文件。写入前也断言两者一致。
|
|
34
|
+
- `title`:空标题从正文首行推导。创建时缺省即用推导;**未命名兜底文案由面板负责本地化**——面板带空标题时自行填入界面对应语言的「未命名便签」,Host 不读 locale。`POST /create` 接受调用方传来的任意标题并原样存储;标题缺省时用 Host 自己的 fallback。
|
|
35
35
|
- `markdown`:正文以 Markdown 文本保存,不存渲染后的 HTML。自有图片在这段文本里写作 `notes-asset:<id>/<文件名>`。
|
|
36
36
|
- `color`:`yellow` / `green` / `blue` / `violet` / `red` / `gray` 之一。
|
|
37
37
|
- `pinned`:影响排序,不占单独筛选。归档的便签恒为 `false`,见下。
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
|
|
42
42
|
图片宽度存在这里而不是正文里,是因为 Markdown 没有宽度语法:写成裸 `<img width>` 会让正文不再是 Markdown,而解析器会把裸 HTML 标签转义成文本(见 `escapeRawHtml`),宽度和图片本身都会丢。正文始终是纯 Markdown,宽度是随正文一起走的版式信息。
|
|
43
43
|
|
|
44
|
+
### 保存与创建的必填字段
|
|
45
|
+
|
|
46
|
+
`/save` 是整条便签的整写:面板的 `NoteDraft` 每次都带全 `title`、`markdown`、`color` 三个内容字段,任一缺失即 `sticky/bad-request`,不再补默认值——补默认值会把一条只带 id 的请求变成清空标题、正文与颜色的写入。属性字段(`pinned`、`imageWidths`)缺省表示保持原值。`/create` 不受这条规则约束:创建从空便签开始,缺省字段取各自默认值(颜色 `yellow`、标题由正文推导)。
|
|
47
|
+
|
|
44
48
|
### 归档即未固定
|
|
45
49
|
|
|
46
50
|
`archived` 为 `true` 的便签,`pinned` 恒为 `false`:归档的便签已经离开便签墙,它的排序不再有任何意义。
|
package/docs/editor.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
撤销/重做、H1–H3、粗体、斜体、下划线、删除线、行内代码、无序列表、有序列表、勾选列表、引用、代码块、链接、表格、分隔线。按钮反映当前光标位置的状态:光标在标题里,H 级按钮就是按下态。
|
|
8
8
|
|
|
9
|
-
鼠标在按钮上停 400 ms
|
|
9
|
+
鼠标在按钮上停 400 ms,出现一条气泡写着这个按钮的名字,贴着被 hover 按钮所在行的正下方:工具栏换行时气泡可能盖住相邻行,指针所在的那行本来就是可点的。气泡只是视觉提示,读屏靠按钮的 `aria-label`。
|
|
10
10
|
|
|
11
11
|
## 复制为 Markdown
|
|
12
12
|
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
「引用文本」把选区作为[引用](../GLOSSARY.md)送进当前会话的输入框,落成草稿里的一段引用块。
|
|
45
45
|
|
|
46
46
|
- 送纯文本:粗体、链接、行内代码的标记与代码块围栏都不出现,只剩文字本身;块之间换行,行与行之间不留空行,顺序与选区一致。
|
|
47
|
-
- 图片只送图片根目录下的绝对路径,不带 `![]()` 和 alt
|
|
47
|
+
- 图片只送图片根目录下的绝对路径,不带 `![]()` 和 alt,路径两侧各留一个空格作分隔。作者在图片旁边写的空格保留,所以原本有空格的地方读起来是两个。取不到根目录时路径保持 `notes-asset:` 原样,文字照送。
|
|
48
48
|
- 不带便签的标题、id 或任何出处,不设长度上限。
|
|
49
49
|
- 送成功后浮条关掉。输入框拒绝时浮条留在原地,理由提示在输入框上:会话正在发送时说「会话正在发送,稍后再试」,其余(子会话、会话已移除、输入框被占用)合并说「这条会话不能接收引用」。
|
|
50
50
|
- 当前没有会话时按钮置灰。
|
|
@@ -144,6 +144,8 @@
|
|
|
144
144
|
|
|
145
145
|
归档便签点开是只读的,用的是同一个对话框和同一套排版:正文仍然是那个 880px 宽、继承编辑器字体的滚动区,不会因为只读而收窄,也不加行宽限制。
|
|
146
146
|
|
|
147
|
+
编辑时点击正文下方的空白处,光标落到正文末尾;来自正文内容本身的点击不在此列,仍由浏览器自己放置光标。
|
|
148
|
+
|
|
147
149
|
只读形态下:
|
|
148
150
|
|
|
149
151
|
- 没有工具栏、没有颜色色块组、没有保存,底部只有一个「关闭」。
|