dsh-sticky 0.3.1 → 0.3.3
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 +7 -1
- package/lib/client.js +90 -93
- package/lib/index.js +4 -10
- package/package.json +3 -3
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.3-alpha.2`, publishing `0.2.3-alpha.2`.
|
|
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.4-0`: it accepts every version from the floor baseline up through the whole 0.2.3 line, prereleases included, and rejects everything below the floor and everything from `0.2.4-0` up. 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
|
@@ -61,6 +61,12 @@
|
|
|
61
61
|
|
|
62
62
|
围栏里的标识符如果不在列表里(手写的 ```` ```rust ````),会作为一个「未收录」项保留在下拉里,不会被重置成空:语言是正文的一部分,静默改写等于丢数据。
|
|
63
63
|
|
|
64
|
+
## 行内代码
|
|
65
|
+
|
|
66
|
+
行内代码用便签自己的标记色浅铺一层底,与卡片左侧的边缘线、选区浮条的底色同源:胶囊跟着纸色走,换一张便签就换一套颜色,不引入第二套配色。编辑器底色是对话框的,没有纸色可依,所以对话框携带便签的颜色,用同一个标记色。
|
|
67
|
+
|
|
68
|
+
代码块里的代码不着这层底:围栏已经把它和正文分开了。
|
|
69
|
+
|
|
64
70
|
## 链接
|
|
65
71
|
|
|
66
72
|
点链接按钮打开一个对话框,两个字段:链接文字与地址。
|
|
@@ -138,7 +144,7 @@
|
|
|
138
144
|
|
|
139
145
|
## 底部按钮
|
|
140
146
|
|
|
141
|
-
|
|
147
|
+
「取消」在左、「保存」在右,同在对话框右下角。两个按钮等高、同字重,描边按钮的边框计入高度。
|
|
142
148
|
|
|
143
149
|
## 查看
|
|
144
150
|
|