@skillre/dsh-plugin-sticky-wall 0.7.0 → 0.8.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.en.md +34 -11
- package/README.md +35 -14
- package/UNINSTALL.md +22 -7
- package/compatibility.json +78 -1
- package/lib/client.js +1062 -337
- package/lib/config.d.ts +18 -0
- package/lib/config.js +27 -0
- package/lib/frontmatter.d.ts +81 -0
- package/lib/frontmatter.js +440 -0
- package/lib/index.d.ts +9 -4
- package/lib/index.js +153 -36
- package/lib/migrate.d.ts +53 -0
- package/lib/migrate.js +156 -0
- package/lib/store.d.ts +123 -68
- package/lib/store.js +305 -96
- package/lib/transport.d.ts +7 -4
- package/lib/transport.js +14 -3
- package/lib/types.d.ts +87 -6
- package/lib/types.js +38 -5
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +3 -3
- package/docs/PREVIEW.md +0 -39
package/lib/types.d.ts
CHANGED
|
@@ -11,13 +11,42 @@ export declare const ENDPOINT = "skillre-sticky-wall/execute";
|
|
|
11
11
|
/** Sidebar panel id, main panel key, and locale namespace. */
|
|
12
12
|
export declare const PANEL_ID = "skillre-sticky-wall";
|
|
13
13
|
export declare const LOCALE_NAMESPACE = "skillreStickyWall";
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/**
|
|
15
|
+
* LEGACY storage-domain identity, kept only so the one-time migration can still
|
|
16
|
+
* open the JSON domain a 0.7.x install left behind.
|
|
17
|
+
*
|
|
18
|
+
* 0.8.0 moved the notes onto real `.md` files under the notes directory, so
|
|
19
|
+
* nothing else reads this any more. Removing it would strand an existing user's
|
|
20
|
+
* wall in a format the plugin can no longer name, so it stays until the
|
|
21
|
+
* migration is retired.
|
|
22
|
+
*/
|
|
23
|
+
export declare const LEGACY_DOMAIN_NAME = "skillre_sticky_wall";
|
|
24
|
+
export declare const LEGACY_DOMAIN_VERSION = 1;
|
|
25
|
+
/** The private directory, under the DSH home, that holds one `.md` per note. */
|
|
26
|
+
export declare const NOTES_DIR_NAME = "sticky-notes";
|
|
27
|
+
/** Every note file carries this suffix; the id alone is the basename. */
|
|
28
|
+
export declare const NOTE_FILE_SUFFIX = ".md";
|
|
29
|
+
/** Marker written once, after a successful migration, beside the notes. */
|
|
30
|
+
export declare const MIGRATION_MARKER = "migration.json";
|
|
31
|
+
/**
|
|
32
|
+
* The frontmatter schema generation this build writes.
|
|
33
|
+
*
|
|
34
|
+
* `schema:` is a forward-compatibility marker, not a migration trigger: a file
|
|
35
|
+
* written by a NEWER build parses with its known keys and keeps the rest in
|
|
36
|
+
* `extra` rather than being silently rewritten.
|
|
37
|
+
*/
|
|
38
|
+
export declare const FRONTMATTER_SCHEMA = 1;
|
|
17
39
|
/** Hard limits, enforced on both halves so a bad payload never reaches storage. */
|
|
18
40
|
export declare const LIMITS: Readonly<{
|
|
19
|
-
/**
|
|
20
|
-
|
|
41
|
+
/**
|
|
42
|
+
* One note's body, in characters.
|
|
43
|
+
*
|
|
44
|
+
* 0.8.0 lifted the old 4000-character cap, because the body now lives in a
|
|
45
|
+
* plain `.md` file rather than a JSON record and a note is allowed to be a
|
|
46
|
+
* real document. This is a resource guard against a pathological file, not a
|
|
47
|
+
* product limit: at 200k characters a note is a short book.
|
|
48
|
+
*/
|
|
49
|
+
body: 200000;
|
|
21
50
|
/** One note's title, in characters. */
|
|
22
51
|
title: 120;
|
|
23
52
|
/** A note's free-form tag list. */
|
|
@@ -28,6 +57,10 @@ export declare const LIMITS: Readonly<{
|
|
|
28
57
|
notes: 400;
|
|
29
58
|
/** Note ids accepted in one request. */
|
|
30
59
|
bulk: 200;
|
|
60
|
+
/** One note file's size on disk, in bytes; larger files are refused unread. */
|
|
61
|
+
fileBytes: number;
|
|
62
|
+
/** Newest notes the agent `list` action returns. */
|
|
63
|
+
listLimit: 50;
|
|
31
64
|
}>;
|
|
32
65
|
/** Pastel note colors the wall offers; the Client renders them as literal hex. */
|
|
33
66
|
export declare const COLORS: readonly ["yellow", "pink", "green", "blue", "purple", "orange"];
|
|
@@ -129,7 +162,7 @@ export interface NoteLayout {
|
|
|
129
162
|
}
|
|
130
163
|
/** One sticky note as stored and as sent over the wire. */
|
|
131
164
|
export interface Note {
|
|
132
|
-
/** Stable id; `crypto.randomUUID()` for locally created notes. */
|
|
165
|
+
/** Stable id; `crypto.randomUUID()` for locally created notes. Also the file's basename. */
|
|
133
166
|
id: string;
|
|
134
167
|
/** Optional short heading; the body alone is enough for a quick capture. */
|
|
135
168
|
title: string;
|
|
@@ -149,21 +182,69 @@ export interface Note {
|
|
|
149
182
|
updatedAt: string;
|
|
150
183
|
/** Free-canvas placement, or `null` for a note the user never positioned. */
|
|
151
184
|
layout: NoteLayout | null;
|
|
185
|
+
/**
|
|
186
|
+
* Why this note's frontmatter could not be read, when it could not.
|
|
187
|
+
*
|
|
188
|
+
* A note with a broken frontmatter block is NOT dropped and NOT rejected: the
|
|
189
|
+
* body still renders and the card keeps default attributes, with this message
|
|
190
|
+
* carried so the wall can flag it. Losing a user's note because they (or the
|
|
191
|
+
* model) mangled a YAML line would be far worse than showing it with the
|
|
192
|
+
* wrong color — this is the fail-soft contract the storage domain used to
|
|
193
|
+
* provide through `invalidRecords: 'backup-and-skip'`.
|
|
194
|
+
*/
|
|
195
|
+
metaError?: string | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* Frontmatter keys this build does not understand, preserved verbatim.
|
|
198
|
+
*
|
|
199
|
+
* A newer build may add keys, or the user may hand-add their own (a `due:`
|
|
200
|
+
* date, a link). Rewriting the file without them would silently destroy that
|
|
201
|
+
* data, so they are carried through every read/write cycle untouched.
|
|
202
|
+
*/
|
|
203
|
+
extra?: Readonly<Record<string, string>> | undefined;
|
|
152
204
|
}
|
|
153
205
|
/** The complete wall state a Client renders. */
|
|
154
206
|
export interface WallSnapshot {
|
|
155
207
|
notes: Note[];
|
|
208
|
+
/**
|
|
209
|
+
* Monotonic change counter.
|
|
210
|
+
*
|
|
211
|
+
* The Client cannot be pushed to (the Connection envelope has no
|
|
212
|
+
* server-initiated variant), so it polls. This is what makes a poll cheap and
|
|
213
|
+
* SAFE: an unchanged revision means the caller must not touch component state
|
|
214
|
+
* at all, which is what stops a background refresh from interrupting someone
|
|
215
|
+
* mid-composition in the editor.
|
|
216
|
+
*/
|
|
217
|
+
revision: number;
|
|
218
|
+
/** Absolute directory the notes live in, so the UI can reveal/copy it. */
|
|
219
|
+
notesDir: string;
|
|
156
220
|
/** Schema marker so a Client never renders an unknown future shape. */
|
|
157
221
|
domain: {
|
|
158
222
|
name: string;
|
|
159
223
|
version: number;
|
|
160
224
|
};
|
|
161
225
|
}
|
|
226
|
+
/** Everything the agent-side `read` action returns for one note. */
|
|
227
|
+
export interface NoteDocument {
|
|
228
|
+
note: Note;
|
|
229
|
+
/** Absolute path of the backing `.md` file, for native `read`/`edit`. */
|
|
230
|
+
path: string;
|
|
231
|
+
}
|
|
162
232
|
/** Request kinds accepted by the Host endpoint. */
|
|
163
233
|
export type WallRequest = {
|
|
164
234
|
action: 'list';
|
|
165
235
|
includeArchived?: boolean;
|
|
166
236
|
sort?: NoteSort;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* The cheap poll.
|
|
240
|
+
*
|
|
241
|
+
* The wall refreshes while visible, and a refresh that re-sends every note
|
|
242
|
+
* body just to learn that nothing changed would dominate the channel. This
|
|
243
|
+
* action returns the revision and the note count only; the Client refetches
|
|
244
|
+
* the wall solely when the number it gets back differs from what it holds.
|
|
245
|
+
*/
|
|
246
|
+
| {
|
|
247
|
+
action: 'revision';
|
|
167
248
|
} | {
|
|
168
249
|
action: 'create';
|
|
169
250
|
note: NoteInput;
|
package/lib/types.js
CHANGED
|
@@ -11,13 +11,42 @@ export const ENDPOINT = 'skillre-sticky-wall/execute';
|
|
|
11
11
|
/** Sidebar panel id, main panel key, and locale namespace. */
|
|
12
12
|
export const PANEL_ID = 'skillre-sticky-wall';
|
|
13
13
|
export const LOCALE_NAMESPACE = 'skillreStickyWall';
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/**
|
|
15
|
+
* LEGACY storage-domain identity, kept only so the one-time migration can still
|
|
16
|
+
* open the JSON domain a 0.7.x install left behind.
|
|
17
|
+
*
|
|
18
|
+
* 0.8.0 moved the notes onto real `.md` files under the notes directory, so
|
|
19
|
+
* nothing else reads this any more. Removing it would strand an existing user's
|
|
20
|
+
* wall in a format the plugin can no longer name, so it stays until the
|
|
21
|
+
* migration is retired.
|
|
22
|
+
*/
|
|
23
|
+
export const LEGACY_DOMAIN_NAME = 'skillre_sticky_wall';
|
|
24
|
+
export const LEGACY_DOMAIN_VERSION = 1;
|
|
25
|
+
/** The private directory, under the DSH home, that holds one `.md` per note. */
|
|
26
|
+
export const NOTES_DIR_NAME = 'sticky-notes';
|
|
27
|
+
/** Every note file carries this suffix; the id alone is the basename. */
|
|
28
|
+
export const NOTE_FILE_SUFFIX = '.md';
|
|
29
|
+
/** Marker written once, after a successful migration, beside the notes. */
|
|
30
|
+
export const MIGRATION_MARKER = 'migration.json';
|
|
31
|
+
/**
|
|
32
|
+
* The frontmatter schema generation this build writes.
|
|
33
|
+
*
|
|
34
|
+
* `schema:` is a forward-compatibility marker, not a migration trigger: a file
|
|
35
|
+
* written by a NEWER build parses with its known keys and keeps the rest in
|
|
36
|
+
* `extra` rather than being silently rewritten.
|
|
37
|
+
*/
|
|
38
|
+
export const FRONTMATTER_SCHEMA = 1;
|
|
17
39
|
/** Hard limits, enforced on both halves so a bad payload never reaches storage. */
|
|
18
40
|
export const LIMITS = Object.freeze({
|
|
19
|
-
/**
|
|
20
|
-
|
|
41
|
+
/**
|
|
42
|
+
* One note's body, in characters.
|
|
43
|
+
*
|
|
44
|
+
* 0.8.0 lifted the old 4000-character cap, because the body now lives in a
|
|
45
|
+
* plain `.md` file rather than a JSON record and a note is allowed to be a
|
|
46
|
+
* real document. This is a resource guard against a pathological file, not a
|
|
47
|
+
* product limit: at 200k characters a note is a short book.
|
|
48
|
+
*/
|
|
49
|
+
body: 200_000,
|
|
21
50
|
/** One note's title, in characters. */
|
|
22
51
|
title: 120,
|
|
23
52
|
/** A note's free-form tag list. */
|
|
@@ -28,6 +57,10 @@ export const LIMITS = Object.freeze({
|
|
|
28
57
|
notes: 400,
|
|
29
58
|
/** Note ids accepted in one request. */
|
|
30
59
|
bulk: 200,
|
|
60
|
+
/** One note file's size on disk, in bytes; larger files are refused unread. */
|
|
61
|
+
fileBytes: 4 * 1024 * 1024,
|
|
62
|
+
/** Newest notes the agent `list` action returns. */
|
|
63
|
+
listLimit: 50,
|
|
31
64
|
});
|
|
32
65
|
/** Pastel note colors the wall offers; the Client renders them as literal hex. */
|
|
33
66
|
export const COLORS = Object.freeze([
|
package/locale/en.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Sticky Wall",
|
|
4
|
-
"description": "A
|
|
4
|
+
"description": "A sticky-note wall in the DSH sidebar where every note is a real Markdown file you can drag, tidy and open anywhere.",
|
|
5
5
|
"detail": "docs/DETAIL.md"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/locale/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillre/dsh-plugin-sticky-wall",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "便签墙:DSH 侧栏的自由画布便签板,可拖动摆放、一键整理,正文按 Markdown 渲染",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"type": "module",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"docs/DETAIL.zh.md",
|
|
38
38
|
"docs/preview.svg",
|
|
39
39
|
"docs/preview.zh.svg",
|
|
40
|
-
"docs/PREVIEW.md",
|
|
41
40
|
"README.md",
|
|
42
41
|
"README.en.md",
|
|
43
42
|
"UNINSTALL.md",
|
|
44
|
-
"LICENSE"
|
|
43
|
+
"LICENSE",
|
|
44
|
+
"!docs/PREVIEW.md"
|
|
45
45
|
],
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
package/docs/PREVIEW.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# 预览图画板
|
|
2
|
-
|
|
3
|
-
详情页的预览图以**飞书画板**为编辑源,`docs/preview*.svg` 是它的导出快照。
|
|
4
|
-
本文件记录两种语言各自对应的画板,供 `node scripts/preview.mjs push|pull` 使用。
|
|
5
|
-
|
|
6
|
-
> 状态:当前 `docs/preview.svg` 与 `docs/preview.zh.svg` 由手写 SVG 直接绘制,
|
|
7
|
-
> 尚未回填到飞书画板。下表的 token 为空即表示「尚未建板」;建板后用 `push` 上传,
|
|
8
|
-
> 再把文档 URL 与 token 填回来,此后改图走 `pull` / `push` 往返。
|
|
9
|
-
|
|
10
|
-
| 语言 | 文档 | 画板 token |
|
|
11
|
-
|---|---|---|
|
|
12
|
-
| `en` | (待建:飞书文档 URL) | (待建:whiteboard token) |
|
|
13
|
-
| `zh` | (待建:飞书文档 URL) | (待建:whiteboard token) |
|
|
14
|
-
|
|
15
|
-
## 操作
|
|
16
|
-
|
|
17
|
-
```sh
|
|
18
|
-
# 把本地 SVG 推上画板(整板重建)
|
|
19
|
-
node scripts/preview.mjs push --lang zh
|
|
20
|
-
|
|
21
|
-
# 从画板导出 SVG 覆盖本地文件
|
|
22
|
-
node scripts/preview.mjs pull --lang zh
|
|
23
|
-
|
|
24
|
-
# 离线校验(npm run check 会自动调用)
|
|
25
|
-
node scripts/preview.mjs check
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## 画面约定
|
|
29
|
-
|
|
30
|
-
两张图必须同构,只换语言:
|
|
31
|
-
|
|
32
|
-
1. **主体**:深色画布上散落 7–9 张大小、角度不同的便签卡(六色柔和底色之一),
|
|
33
|
-
卡片之间刻意不排成网格 —— 这正是「自由画布」与旧版瀑布流的区别。
|
|
34
|
-
2. **机制**:卡内正文展示 Markdown 的真实渲染结果 —— 标题、粗体、列表、
|
|
35
|
-
代码块、复选清单各出现一次,说明「正文即 Markdown」。
|
|
36
|
-
3. **界面**:左侧栏入口、顶部搜索框与筛选 chip、画布左下角悬浮缩放控件。
|
|
37
|
-
4. **细节**:置顶卡的左侧色条与星标;一张卡带拖拽提示(虚线框或光标)。
|
|
38
|
-
|
|
39
|
-
规则见 fleet 的 `docs/display-contract.md`。
|