dsh-quicknote 0.0.0-stage → 0.1.1
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/AGENTS.md +28 -0
- package/CHANGELOG.md +28 -0
- package/LICENSE +21 -0
- package/PUBLISHING.md +11 -0
- package/README.md +68 -2
- package/README.zh.md +67 -0
- package/cordis.patch.yml +5 -0
- package/icon.svg +4 -0
- package/lib/client.js +1407 -0
- package/lib/index.js +351 -0
- package/llms.txt +32 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +76 -4
package/AGENTS.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# dsh-quicknote — agent notes
|
|
2
|
+
|
|
3
|
+
Read this before changing code. User docs: [README.md](README.md).
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
pnpm verify # format → lint → typecheck → test → build → pack
|
|
10
|
+
pnpm typecheck
|
|
11
|
+
pnpm test
|
|
12
|
+
pnpm build
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Layout
|
|
16
|
+
|
|
17
|
+
- `src/host/` — Host half: services, tools, routes. No browser APIs.
|
|
18
|
+
- `src/client/` — browser half: React 19 components (TSX), slots, styles. No Node APIs.
|
|
19
|
+
- `src/shared/` — constants both halves import (`NAME`, `NS`, `PLUGIN_ID`).
|
|
20
|
+
- `lib/` — generated. Never edit by hand.
|
|
21
|
+
- `tests/` — one suite per half.
|
|
22
|
+
|
|
23
|
+
## Invariants
|
|
24
|
+
|
|
25
|
+
- `package.json` `name` === `src/shared/constants.ts` `NAME` === the client bundle id.
|
|
26
|
+
- The `window.__ModuleLoader__.load` wrapper is generated by `tsdown.config.ts`; source must not contain it.
|
|
27
|
+
- No network calls, no telemetry, no `console.log` in shipped code.
|
|
28
|
+
- Any destructive action must be reversible and must state its consequence.
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
- Restore dark-mode styling with the DSH theme tokens
|
|
6
|
+
- Restore the notebook icon and use Quick Note / 随手记 consistently in the composer
|
|
7
|
+
- Add search, All/Open/Done filters, timestamps, copy and insert actions
|
|
8
|
+
- Add copy-all as Markdown and the primary+alt+S capture shortcut
|
|
9
|
+
- Record the source Session on captured notes
|
|
10
|
+
- Show a parked-draft receipt with undo after “save and clear draft”
|
|
11
|
+
- Parse `#tag` in notes and filter the list by tag
|
|
12
|
+
- Make delete reversible with an undo toast, including batch undo
|
|
13
|
+
- Insert a note into the current Session even while the page covers the conversation
|
|
14
|
+
- Open the notes page from the capture card with View all
|
|
15
|
+
- Return to the conversation from the notes page, with the Session name in the link
|
|
16
|
+
- Serialize note-store writes so overlapping requests cannot corrupt the JSON file
|
|
17
|
+
- Stack note actions under the text in narrow windows so labels no longer wrap
|
|
18
|
+
- Package homepage now points to the plugin documentation, not the GitHub repository
|
|
19
|
+
|
|
20
|
+
## 0.1.0
|
|
21
|
+
|
|
22
|
+
First release.
|
|
23
|
+
|
|
24
|
+
- Composer toolbar button with a capture card prefilled from the current draft
|
|
25
|
+
- Save note, or save and explicitly clear the draft
|
|
26
|
+
- Sidebar page: newest-first list, done/reopen, delete
|
|
27
|
+
- Four Agent tools: add, list, done, delete
|
|
28
|
+
- Local JSON store at `~/.dsh/quicknote/notes.json` (0600, atomic writes)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-kit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PUBLISHING.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Publishing
|
|
2
|
+
|
|
3
|
+
1. Run `pnpm verify` and make sure it is green.
|
|
4
|
+
2. Bump `version` and add the matching `CHANGELOG.md` entry.
|
|
5
|
+
3. Inspect the artifact: `npm pack --dry-run`.
|
|
6
|
+
4. Publish with provenance: `npm publish --provenance`.
|
|
7
|
+
5. Tag the release: `git tag v<version>` and push the tag.
|
|
8
|
+
6. Install the published package into a fresh profile and check the client bundle is served.
|
|
9
|
+
|
|
10
|
+
For local development, `dsh plugin --profile <profile> add link:$PWD` installs the working copy instead of a
|
|
11
|
+
published version.
|
package/README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-quicknote
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-quicknote)
|
|
4
|
+
[](https://github.com/dsh-kit/dsh-quicknote/releases)
|
|
5
|
+
|
|
6
|
+
Capture a note from the composer, keep it out of the way, and find it again on one page.
|
|
7
|
+
|
|
8
|
+
- **From the composer**: click **Quick Note** in the composer toolbar. The card opens with the current draft; save it
|
|
9
|
+
as a note, save and explicitly clear the draft, or jump to the notes page with **View all**.
|
|
10
|
+
- **From the sidebar**: search, filter All/Open/Done or by `#tag`, copy, insert into the active draft, and mark done or
|
|
11
|
+
delete with an undo toast.
|
|
12
|
+
- **From an agent**: `quicknote_add`, `quicknote_list`, `quicknote_done`, `quicknote_delete`.
|
|
13
|
+
- **Storage**: `~/.dsh/quicknote/notes.json` — local, mode `0600`, atomic writes. No telemetry.
|
|
14
|
+
|
|
15
|
+
## Documentation
|
|
16
|
+
|
|
17
|
+
<https://dsh-kit.github.io/dsh-quicknote/>
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
For development, link the working copy into a CLI/web profile:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
dsh plugin --profile web add link:$PWD
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For the desktop app, use the in-app plugin page; the `desktop` profile is app-managed.
|
|
28
|
+
|
|
29
|
+
A published release installs by package name into a CLI/web profile:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
dsh plugin --profile web add dsh-quicknote
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For the desktop app, use its plugin page; the `desktop` profile is app-managed.
|
|
36
|
+
|
|
37
|
+
## Verify
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
dsh --profile web --dump-config | grep -A2 "id: dsh-quicknote"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Develop
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm install
|
|
47
|
+
pnpm verify # format → lint → typecheck → tests → build → pack
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
npm works too: `npm install && npm run verify`.
|
|
51
|
+
|
|
52
|
+
- `src/host/` — store, JSON routes and four Agent tools.
|
|
53
|
+
- `src/client/` — composer button, capture card, sidebar page.
|
|
54
|
+
- `lib/` — generated, committed (a `link:` install never builds).
|
|
55
|
+
- `tests/` — store and client registration.
|
|
56
|
+
- `AGENTS.md` / `llms.txt` — agent context.
|
|
57
|
+
- `PUBLISHING.md` — release checklist.
|
|
58
|
+
|
|
59
|
+
## Data and API
|
|
60
|
+
|
|
61
|
+
- `GET /api/quicknote/notes`
|
|
62
|
+
- `POST /api/quicknote/notes/create` `{ text }`
|
|
63
|
+
- `POST /api/quicknote/notes/update` `{ id, done }`
|
|
64
|
+
- `POST /api/quicknote/notes/delete` `{ id }` (returns the removed note)
|
|
65
|
+
- `POST /api/quicknote/notes/restore` `{ note }`
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# dsh-quicknote
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-quicknote)
|
|
4
|
+
[](https://github.com/dsh-kit/dsh-quicknote/releases)
|
|
5
|
+
|
|
6
|
+
从输入框随手记下一条,不打断当前对话,之后在一页里找回。
|
|
7
|
+
|
|
8
|
+
- **从输入框**:点击工具栏的 **随手记**;卡片会带上当前草稿。可以只保存笔记、显式选择“保存并清空输入框”,或点卡片右上角的 **查看全部** 直接打开笔记页。
|
|
9
|
+
- **从侧栏**:随手记页面支持搜索、全部/未完成/已完成或 `#标签` 筛选、复制、插入当前草稿,以及完成或删除(删除后可撤销)。
|
|
10
|
+
- **从 Agent**:`quicknote_add`、`quicknote_list`、`quicknote_done`、`quicknote_delete`。
|
|
11
|
+
- **存储**:`~/.dsh/quicknote/notes.json`,本地、权限 `0600`、原子写入,无遥测。
|
|
12
|
+
|
|
13
|
+
## 文档
|
|
14
|
+
|
|
15
|
+
<https://dsh-kit.github.io/dsh-quicknote/zh/>
|
|
16
|
+
|
|
17
|
+
## 安装
|
|
18
|
+
|
|
19
|
+
开发时链接到 CLI/web profile:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
dsh plugin --profile web add link:$PWD
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
桌面端请使用应用内插件页;`desktop` profile 由应用管理。
|
|
26
|
+
|
|
27
|
+
发布后按包名安装到 CLI/web profile:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
dsh plugin --profile web add dsh-quicknote
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
桌面端请使用应用内插件页;`desktop` profile 由应用管理。
|
|
34
|
+
|
|
35
|
+
## 验证
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dsh --profile web --dump-config | grep -A2 "id: dsh-quicknote"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 开发
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm install
|
|
45
|
+
pnpm verify # 格式 → lint → 类型 → 测试 → 构建 → 打包
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
npm 也可用:`npm install && npm run verify`。
|
|
49
|
+
|
|
50
|
+
- `src/host/`:存储、JSON 路由、四个 Agent 工具;
|
|
51
|
+
- `src/client/`:输入框按钮、记录卡片、侧栏页面;
|
|
52
|
+
- `lib/`:构建产物,提交进仓库(`link:` 安装不会构建);
|
|
53
|
+
- `tests/`:存储与客户端注册测试;
|
|
54
|
+
- `AGENTS.md` / `llms.txt`:agent 上下文;
|
|
55
|
+
- `PUBLISHING.md`:发布清单。
|
|
56
|
+
|
|
57
|
+
## 数据与 API
|
|
58
|
+
|
|
59
|
+
- `GET /api/quicknote/notes`
|
|
60
|
+
- `POST /api/quicknote/notes/create` `{ text }`
|
|
61
|
+
- `POST /api/quicknote/notes/update` `{ id, done }`
|
|
62
|
+
- `POST /api/quicknote/notes/delete` `{ id }`(返回被删除的笔记)
|
|
63
|
+
- `POST /api/quicknote/notes/restore` `{ note }`
|
|
64
|
+
|
|
65
|
+
## 许可
|
|
66
|
+
|
|
67
|
+
MIT
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none">
|
|
2
|
+
<rect x="4" y="3.5" width="16" height="17" rx="3" stroke="currentColor" stroke-width="1.6"/>
|
|
3
|
+
<path d="M8 8h8M8 12h8M8 16h5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
|
4
|
+
</svg>
|