dsh-better-memo 0.0.0-stage → 0.1.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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/client.js +683 -0
- package/cordis.patch.yml +5 -0
- package/icon.png +0 -0
- package/index.js +252 -0
- package/lib/store.js +183 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +66 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 — 2026-11-20
|
|
4
|
+
|
|
5
|
+
首版。
|
|
6
|
+
|
|
7
|
+
- 三层备忘录:`session`(本会话)/ `profile`(本 profile 所有会话)/ `user`(仅用户可见)。
|
|
8
|
+
- 两个 agent 工具:`memo_list` 查收、`memo_edit` 增改删。`user` 档不进 `memo_list`,也不接受工具写入。
|
|
9
|
+
- 浏览器半段:会话 tab 行新增「备忘录」座位,点开是面板——三组列表 + 常驻新增表单 + 行内改 + 两次确认删除。
|
|
10
|
+
- 存储:`$DSH_HOME/memo/memos.json`,原子写;上限 500 条,标题 120 字、正文 4000 字。
|
|
11
|
+
- 面板进入 / 列表错峰 / 删除退出三处动效,`prefers-reduced-motion` 下退化。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MeruSu
|
|
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/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 备忘录 · dsh-better-memo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
给 DeepSeek Harness 加一层**三层备忘录**:同一个面板里管三档归属,其中两档 AI 能读能改,第三档只有你自己看得到。
|
|
4
|
+
|
|
5
|
+
| 作用域 | 谁收得到 | AI 能看 | AI 能写 |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| **本会话** `session` | 只有这一个会话 | ✅ | ✅ |
|
|
8
|
+
| **本 profile** `profile` | 这个 profile 的所有会话 | ✅ | ✅ |
|
|
9
|
+
| **仅我可见** `user` | 只有面板里的你 | ❌ 永远不返回 | ❌ 只有你能写 |
|
|
10
|
+
|
|
11
|
+
## 安装
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
dsh plugin --profile <你的 profile> add dsh-better-memo
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
装完**重启该 profile 的 GUI**(浏览器半段与 locale 元数据都是启动时读的)。
|
|
18
|
+
|
|
19
|
+
## 用
|
|
20
|
+
|
|
21
|
+
会话 tab 行里会多一个 **备忘录** 座位,点开就是面板:
|
|
22
|
+
|
|
23
|
+
- 三组分开列:`本会话 (n)` / `本 profile (n)` / `仅我可见 (n)`
|
|
24
|
+
- 顶上常驻新增表单:选作用域 → 填标题/正文 → 存下
|
|
25
|
+
- 每行可以勾完成、行内改、删(删除要点两次,3 秒内不确认自动恢复)
|
|
26
|
+
|
|
27
|
+
## 给 AI 的两个工具
|
|
28
|
+
|
|
29
|
+
- **`memo_list`** —— 返回本会话该查收的条目:本会话的 `session` + 本 profile 的 `profile`,已勾完成的会过滤掉。**`仅我可见` 的条目永远不会出现在这里。**
|
|
30
|
+
- **`memo_edit`** —— `op=add|update|delete`。`add` 必须给 `scope`(`session` 或 `profile`);`update`/`delete` 要 `id`。只能改自己看得到的条目,跨会话或 `user` 条目会被拒。
|
|
31
|
+
|
|
32
|
+
在预设的系统提示里建议加一句(本插件已自带一段提示词,一般不用再写):
|
|
33
|
+
|
|
34
|
+
> 会话开始时如果用户提到「备忘录 / 备忘 / 记一下 / 待办」,先调 `memo_list`。
|
|
35
|
+
|
|
36
|
+
## 数据放哪
|
|
37
|
+
|
|
38
|
+
`$DSH_HOME/memo/memos.json`(`DSH_HOME` 缺省 `~/.dsh`),一个 JSON 文件,原子写。删掉它等于清空全部备忘录。
|
|
39
|
+
|
|
40
|
+
条目上限 500 条;标题 120 字、正文 4000 字(超出截断)。
|
|
41
|
+
|
|
42
|
+
## 已知限制
|
|
43
|
+
|
|
44
|
+
- 入口是 **tab 座位 + tab 内容面板**,不是浮层弹窗。顶栏那套要处理 Windows 上 40px 拖拽带与窗口按钮挤压,属于另一次改动。
|
|
45
|
+
- 单机单文件,没有多端同步。
|
|
46
|
+
- profile 档只在本 profile 内共享;跨 profile 不共享(`session` 条目记了所属 profile,切 profile 后看不到)。
|
|
47
|
+
- 没有提醒/定时:这不是提醒插件,是备忘录。
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|
package/client.js
ADDED
|
@@ -0,0 +1,683 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-better-memo — Client half.
|
|
3
|
+
*
|
|
4
|
+
* One tab seat on conversation.view (better-memo-seat, order 1, label
|
|
5
|
+
* 「备忘录」) that renders the three-scope memo panel. Everything lives inside
|
|
6
|
+
* factory(require) — the host concatenates every plugin client into one module,
|
|
7
|
+
* so a single top-level const would collide with another plugin and take the
|
|
8
|
+
* whole page down.
|
|
9
|
+
*
|
|
10
|
+
* Data path: the panel only ever talks to the host route /better-memo
|
|
11
|
+
* (GET /state?sessionId=… and GET /write?…), always with the
|
|
12
|
+
* x-better-memo: 1 marker. The host's webserver answers GET/HEAD only, so
|
|
13
|
+
* writes are GETs too. Every write answers the full, fresh state payload, which
|
|
14
|
+
* the panel swaps straight in — no follow-up read.
|
|
15
|
+
*
|
|
16
|
+
* The current session id comes from the seat component's props.sessionId;
|
|
17
|
+
* when a view has none, the 本会话 group is hidden and the session scope option
|
|
18
|
+
* is disabled rather than guessed.
|
|
19
|
+
*
|
|
20
|
+
* DO NOT introduce a top-level declaration, a template literal in the CSS, or a
|
|
21
|
+
* native confirm dialog (deletes use an inline two-step confirm instead).
|
|
22
|
+
*/
|
|
23
|
+
window.__ModuleLoader__.load({
|
|
24
|
+
id: 'dsh-better-memo',
|
|
25
|
+
factory(require) {
|
|
26
|
+
const React = require('react');
|
|
27
|
+
const h = React.createElement;
|
|
28
|
+
|
|
29
|
+
const NS = 'better-memo';
|
|
30
|
+
const VERSION = '0.1.0';
|
|
31
|
+
const SLOT = 'conversation.view';
|
|
32
|
+
const SEAT_ID = 'better-memo-seat';
|
|
33
|
+
const ROUTE = '/better-memo';
|
|
34
|
+
const MARKER = { 'x-better-memo': '1' };
|
|
35
|
+
const STYLE_ID = 'better-memo-style';
|
|
36
|
+
const CONFIRM_MS = 3000;
|
|
37
|
+
const OUT_MS = 160;
|
|
38
|
+
const MAX_STAGGER = 8;
|
|
39
|
+
const STAGGER_MS = 40;
|
|
40
|
+
|
|
41
|
+
const FALLBACK_LIMITS = { title: 120, body: 4000, entries: 500 };
|
|
42
|
+
const GROUP_LABEL = { session: '本会话', profile: '本 profile', user: '仅我可见' };
|
|
43
|
+
const HINT_TEXT =
|
|
44
|
+
'本会话只在本会话里出现;本 profile 会出现在同一 profile 的所有会话;' +
|
|
45
|
+
'仅我可见只有你自己在这个面板里看得到,AI 读不到,也改不了。';
|
|
46
|
+
|
|
47
|
+
/** One style element per page, injected once; guarded by this flag inside the factory. */
|
|
48
|
+
let styleInjected = false;
|
|
49
|
+
|
|
50
|
+
/* CSS is plain string concatenation on purpose: a template literal here would
|
|
51
|
+
let an accidental backtick truncate the file and break the whole bundle. */
|
|
52
|
+
const CSS = [
|
|
53
|
+
'.bm-panel{display:flex;flex-direction:column;gap:14px;padding:16px 20px;font-size:13px;color:inherit;box-sizing:border-box;animation:bm-enter-frames 200ms cubic-bezier(.22,1,.36,1) both}',
|
|
54
|
+
'.bm-panel *{box-sizing:border-box}',
|
|
55
|
+
'.bm-head{display:flex;align-items:center;gap:6px}',
|
|
56
|
+
'.bm-title{font-size:15px;font-weight:600;margin:0}',
|
|
57
|
+
'.bm-version{font-size:11px;color:var(--dsw-alias-label-secondary,#8a8f98);margin-left:2px}',
|
|
58
|
+
'.bm-head-spacer{flex:1 1 auto}',
|
|
59
|
+
'.bm-btn{font:inherit;font-size:12px;line-height:1;border-radius:7px;border:1px solid var(--dsw-alias-border-l4,rgba(127,127,127,.32));background:transparent;color:inherit;padding:7px 12px;cursor:pointer}',
|
|
60
|
+
'.bm-btn:hover{border-color:var(--dsw-alias-border-l3,rgba(127,127,127,.5))}',
|
|
61
|
+
'.bm-btn:disabled{opacity:.45;cursor:not-allowed}',
|
|
62
|
+
'.bm-btn-primary{background:var(--dsw-alias-accent,#3b82f6);border-color:transparent;color:#fff}',
|
|
63
|
+
'.bm-btn-ghost{border-color:transparent;color:var(--dsw-alias-label-secondary,#8a8f98);padding:6px 8px}',
|
|
64
|
+
'.bm-btn-danger{color:var(--dsw-alias-danger,#e5484d);border-color:var(--dsw-alias-danger,#e5484d)}',
|
|
65
|
+
'.bm-hint{margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#8a8f98)}',
|
|
66
|
+
'.bm-form{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:10px;background:var(--dsw-alias-bg-l2,rgba(127,127,127,.07));border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.16))}',
|
|
67
|
+
'.bm-form-top{display:flex;gap:8px;align-items:center}',
|
|
68
|
+
'.bm-field{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary,#8a8f98)}',
|
|
69
|
+
'.bm-input{font:inherit;font-size:13px;width:100%;border-radius:8px;border:1px solid var(--dsw-alias-border-l4,rgba(127,127,127,.32));background:var(--dsw-alias-bg-base,transparent);color:inherit;padding:8px 10px}',
|
|
70
|
+
'.bm-input:focus{outline:none;border-color:var(--dsw-alias-accent,#3b82f6)}',
|
|
71
|
+
'.bm-select{font:inherit;font-size:13px;border-radius:8px;border:1px solid var(--dsw-alias-border-l4,rgba(127,127,127,.32));background:var(--dsw-alias-bg-base,transparent);color:inherit;padding:6px 8px}',
|
|
72
|
+
'.bm-textarea{resize:vertical;min-height:58px;line-height:19px}',
|
|
73
|
+
'.bm-form-actions{display:flex;justify-content:flex-end;gap:8px}',
|
|
74
|
+
'.bm-note{margin:0;font-size:11px;color:var(--dsw-alias-label-tertiary,#9aa0a6)}',
|
|
75
|
+
'.bm-groups{display:flex;flex-direction:column;gap:14px}',
|
|
76
|
+
'.bm-group{display:flex;flex-direction:column;gap:8px}',
|
|
77
|
+
'.bm-group-head{font-size:12px;font-weight:600;color:var(--dsw-alias-label-secondary,#8a8f98);margin:0}',
|
|
78
|
+
'.bm-empty{margin:0;font-size:12px;color:var(--dsw-alias-label-tertiary,#9aa0a6);padding:4px 2px}',
|
|
79
|
+
'.bm-list{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}',
|
|
80
|
+
'.bm-row{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border-radius:9px;border:1px solid var(--dsw-alias-border-l2,rgba(127,127,127,.18));background:var(--dsw-alias-bg-l1,rgba(127,127,127,.04));animation:bm-item-frames 240ms cubic-bezier(.22,1,.36,1) both}',
|
|
81
|
+
'.bm-row-out{animation:bm-out-frames 160ms cubic-bezier(.4,0,1,1) forwards;pointer-events:none}',
|
|
82
|
+
'.bm-row-head{display:flex;align-items:flex-start;gap:8px}',
|
|
83
|
+
'.bm-check{display:flex;align-items:flex-start;gap:8px;flex:1 1 auto;min-width:0;cursor:pointer}',
|
|
84
|
+
'.bm-check input{margin:2px 0 0}',
|
|
85
|
+
'.bm-row-title{font-size:13px;font-weight:500;word-break:break-word}',
|
|
86
|
+
'.bm-done{text-decoration:line-through;color:var(--dsw-alias-label-tertiary,#9aa0a6)}',
|
|
87
|
+
'.bm-row-body{margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#8a8f98);white-space:pre-wrap;word-break:break-word;max-height:120px;overflow:auto}',
|
|
88
|
+
'.bm-row-actions{display:flex;justify-content:flex-end;gap:6px}',
|
|
89
|
+
'.bm-edit{display:flex;flex-direction:column;gap:6px}',
|
|
90
|
+
'.bm-edit-actions{display:flex;justify-content:flex-end;gap:6px}',
|
|
91
|
+
'.bm-error{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;border:1px solid var(--dsw-alias-danger,#e5484d);color:var(--dsw-alias-danger,#e5484d);font-size:12px}',
|
|
92
|
+
'.bm-error-spacer{flex:1 1 auto}',
|
|
93
|
+
'.bm-loading{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary,#8a8f98)}',
|
|
94
|
+
'@keyframes bm-enter-frames{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}',
|
|
95
|
+
'@keyframes bm-item-frames{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}',
|
|
96
|
+
'@keyframes bm-out-frames{to{opacity:0;transform:scale(.92)}}',
|
|
97
|
+
'@keyframes bm-fade-frames{from{opacity:0}to{opacity:1}}',
|
|
98
|
+
'@media (prefers-reduced-motion: reduce){.bm-panel,.bm-row:not(.bm-row-out){animation-name:bm-fade-frames !important;animation-duration:120ms !important;animation-delay:0ms !important}.bm-row-out{animation:bm-out-frames 1ms linear forwards !important}}',
|
|
99
|
+
].join('\n');
|
|
100
|
+
|
|
101
|
+
function injectStyle() {
|
|
102
|
+
if (styleInjected === true) return;
|
|
103
|
+
styleInjected = true;
|
|
104
|
+
try {
|
|
105
|
+
if (document.getElementById(STYLE_ID) !== null) return;
|
|
106
|
+
const style = document.createElement('style');
|
|
107
|
+
style.id = STYLE_ID;
|
|
108
|
+
style.textContent = CSS;
|
|
109
|
+
(document.head || document.documentElement).appendChild(style);
|
|
110
|
+
} catch (thrown) {
|
|
111
|
+
/* styling is best effort: the panel still works without it */
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function messageOf(thrown) {
|
|
116
|
+
return thrown instanceof Error ? thrown.message : String(thrown);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function prefersReduced() {
|
|
120
|
+
try {
|
|
121
|
+
return !!(window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
122
|
+
} catch (thrown) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function queryOf(params) {
|
|
128
|
+
const query = new URLSearchParams();
|
|
129
|
+
const keys = Object.keys(params);
|
|
130
|
+
for (let index = 0; index < keys.length; index += 1) {
|
|
131
|
+
const value = params[keys[index]];
|
|
132
|
+
if (value !== undefined && value !== null) query.set(keys[index], String(value));
|
|
133
|
+
}
|
|
134
|
+
return query.toString();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
async function requestState(sessionId) {
|
|
138
|
+
const query = queryOf({ sessionId: sessionId === '' ? undefined : sessionId });
|
|
139
|
+
const response = await fetch(ROUTE + '/state?' + query, { method: 'GET', headers: MARKER });
|
|
140
|
+
let payload = null;
|
|
141
|
+
try {
|
|
142
|
+
payload = await response.json();
|
|
143
|
+
} catch (thrown) {
|
|
144
|
+
payload = null;
|
|
145
|
+
}
|
|
146
|
+
if (response.ok === false || payload === null || payload.ok === false) {
|
|
147
|
+
const reason = payload && payload.reason ? payload.reason : 'HTTP ' + response.status;
|
|
148
|
+
const detail = payload && payload.error ? ':' + payload.error : '';
|
|
149
|
+
throw new Error(reason + detail);
|
|
150
|
+
}
|
|
151
|
+
return payload;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async function requestWrite(params) {
|
|
155
|
+
const response = await fetch(ROUTE + '/write?' + queryOf(params), { method: 'GET', headers: MARKER });
|
|
156
|
+
let payload = null;
|
|
157
|
+
try {
|
|
158
|
+
payload = await response.json();
|
|
159
|
+
} catch (thrown) {
|
|
160
|
+
payload = null;
|
|
161
|
+
}
|
|
162
|
+
if (response.ok === false || payload === null || payload.ok === false) {
|
|
163
|
+
const reason = payload && payload.reason ? payload.reason : 'HTTP ' + response.status;
|
|
164
|
+
const detail = payload && payload.error ? ':' + payload.error : '';
|
|
165
|
+
throw new Error(reason + detail);
|
|
166
|
+
}
|
|
167
|
+
return payload;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The panel. props.sessionId is the id of the conversation currently shown
|
|
172
|
+
* on this tab; the host passes it to every conversation.view seat.
|
|
173
|
+
*/
|
|
174
|
+
function Panel(props) {
|
|
175
|
+
injectStyle();
|
|
176
|
+
|
|
177
|
+
const sessionId = props && typeof props.sessionId === 'string' ? props.sessionId : '';
|
|
178
|
+
const hasSession = sessionId !== '';
|
|
179
|
+
|
|
180
|
+
const [payload, setPayload] = React.useState(null);
|
|
181
|
+
const [loading, setLoading] = React.useState(true);
|
|
182
|
+
const [error, setError] = React.useState(null);
|
|
183
|
+
|
|
184
|
+
const [scope, setScope] = React.useState(hasSession ? 'session' : 'profile');
|
|
185
|
+
const [title, setTitle] = React.useState('');
|
|
186
|
+
const [body, setBody] = React.useState('');
|
|
187
|
+
const [submitting, setSubmitting] = React.useState(false);
|
|
188
|
+
|
|
189
|
+
const [editingId, setEditingId] = React.useState(null);
|
|
190
|
+
const [editTitle, setEditTitle] = React.useState('');
|
|
191
|
+
const [editBody, setEditBody] = React.useState('');
|
|
192
|
+
|
|
193
|
+
const [confirmId, setConfirmId] = React.useState(null);
|
|
194
|
+
const [removingId, setRemovingId] = React.useState(null);
|
|
195
|
+
const [showHint, setShowHint] = React.useState(false);
|
|
196
|
+
|
|
197
|
+
const confirmTimer = React.useRef(null);
|
|
198
|
+
|
|
199
|
+
const limits = payload && payload.limits ? payload.limits : FALLBACK_LIMITS;
|
|
200
|
+
const effectiveScope = !hasSession && scope === 'session' ? 'profile' : scope;
|
|
201
|
+
|
|
202
|
+
function fetchNow() {
|
|
203
|
+
setLoading(true);
|
|
204
|
+
setError(null);
|
|
205
|
+
requestState(sessionId)
|
|
206
|
+
.then(function (next) {
|
|
207
|
+
setPayload(next);
|
|
208
|
+
setLoading(false);
|
|
209
|
+
})
|
|
210
|
+
.catch(function (thrown) {
|
|
211
|
+
setError(messageOf(thrown));
|
|
212
|
+
setLoading(false);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
React.useEffect(
|
|
217
|
+
function () {
|
|
218
|
+
fetchNow();
|
|
219
|
+
},
|
|
220
|
+
[sessionId],
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
React.useEffect(
|
|
224
|
+
function () {
|
|
225
|
+
return function () {
|
|
226
|
+
if (confirmTimer.current !== null) {
|
|
227
|
+
clearTimeout(confirmTimer.current);
|
|
228
|
+
confirmTimer.current = null;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
},
|
|
232
|
+
[],
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
function applyPayload(next) {
|
|
236
|
+
if (next && next.ok !== false) setPayload(next);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function submitAdd() {
|
|
240
|
+
const cleanTitle = title.trim();
|
|
241
|
+
const cleanBody = body.trim();
|
|
242
|
+
if (cleanTitle === '' && cleanBody === '') return;
|
|
243
|
+
setSubmitting(true);
|
|
244
|
+
setError(null);
|
|
245
|
+
const params = { op: 'add', scope: effectiveScope, title: cleanTitle, body: cleanBody };
|
|
246
|
+
params.sessionId = sessionId;
|
|
247
|
+
requestWrite(params)
|
|
248
|
+
.then(function (next) {
|
|
249
|
+
applyPayload(next);
|
|
250
|
+
setTitle('');
|
|
251
|
+
setBody('');
|
|
252
|
+
setSubmitting(false);
|
|
253
|
+
})
|
|
254
|
+
.catch(function (thrown) {
|
|
255
|
+
setError(messageOf(thrown));
|
|
256
|
+
setSubmitting(false);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function toggleDone(entry) {
|
|
261
|
+
setError(null);
|
|
262
|
+
requestWrite({ op: 'update', id: entry.id, done: entry.done === true ? '0' : '1', sessionId: sessionId })
|
|
263
|
+
.then(applyPayload)
|
|
264
|
+
.catch(function (thrown) {
|
|
265
|
+
setError(messageOf(thrown));
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function startEdit(entry) {
|
|
270
|
+
setConfirmId(null);
|
|
271
|
+
setEditingId(entry.id);
|
|
272
|
+
setEditTitle(entry.title);
|
|
273
|
+
setEditBody(entry.body);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function cancelEdit() {
|
|
277
|
+
setEditingId(null);
|
|
278
|
+
setEditTitle('');
|
|
279
|
+
setEditBody('');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function saveEdit(entry) {
|
|
283
|
+
const cleanTitle = editTitle.trim();
|
|
284
|
+
const cleanBody = editBody.trim();
|
|
285
|
+
if (cleanTitle === '' && cleanBody === '') {
|
|
286
|
+
setError('标题和正文不能都空');
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
setError(null);
|
|
290
|
+
requestWrite({ op: 'update', id: entry.id, title: cleanTitle, body: cleanBody, sessionId: sessionId })
|
|
291
|
+
.then(function (next) {
|
|
292
|
+
applyPayload(next);
|
|
293
|
+
cancelEdit();
|
|
294
|
+
})
|
|
295
|
+
.catch(function (thrown) {
|
|
296
|
+
setError(messageOf(thrown));
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function requestDelete(entry) {
|
|
301
|
+
if (confirmId === entry.id) {
|
|
302
|
+
performDelete(entry);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
setConfirmId(entry.id);
|
|
306
|
+
if (confirmTimer.current !== null) clearTimeout(confirmTimer.current);
|
|
307
|
+
confirmTimer.current = setTimeout(function () {
|
|
308
|
+
setConfirmId(null);
|
|
309
|
+
confirmTimer.current = null;
|
|
310
|
+
}, CONFIRM_MS);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function performDelete(entry) {
|
|
314
|
+
setConfirmId(null);
|
|
315
|
+
if (confirmTimer.current !== null) {
|
|
316
|
+
clearTimeout(confirmTimer.current);
|
|
317
|
+
confirmTimer.current = null;
|
|
318
|
+
}
|
|
319
|
+
setError(null);
|
|
320
|
+
setRemovingId(entry.id);
|
|
321
|
+
const wait = prefersReduced() ? 0 : OUT_MS;
|
|
322
|
+
setTimeout(function () {
|
|
323
|
+
requestWrite({ op: 'delete', id: entry.id, sessionId: sessionId })
|
|
324
|
+
.then(function (next) {
|
|
325
|
+
setRemovingId(null);
|
|
326
|
+
applyPayload(next);
|
|
327
|
+
})
|
|
328
|
+
.catch(function (thrown) {
|
|
329
|
+
setRemovingId(null);
|
|
330
|
+
setError(messageOf(thrown));
|
|
331
|
+
});
|
|
332
|
+
}, wait);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function displayTitle(entry) {
|
|
336
|
+
if (typeof entry.title === 'string' && entry.title !== '') return entry.title;
|
|
337
|
+
const first = String(entry.body || '').split('\n')[0].trim();
|
|
338
|
+
if (first === '') return '(无标题)';
|
|
339
|
+
return first.length > 40 ? first.slice(0, 40) + '…' : first;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function renderHead() {
|
|
343
|
+
return h('div', { key: 'head', className: 'bm-head' }, [
|
|
344
|
+
h('span', { key: 'title', className: 'bm-title' }, '备忘录'),
|
|
345
|
+
h('span', { key: 'version', className: 'bm-version' }, 'v' + VERSION),
|
|
346
|
+
h('span', { key: 'spacer', className: 'bm-head-spacer' }),
|
|
347
|
+
h(
|
|
348
|
+
'button',
|
|
349
|
+
{
|
|
350
|
+
key: 'hint',
|
|
351
|
+
type: 'button',
|
|
352
|
+
className: 'bm-btn bm-btn-ghost',
|
|
353
|
+
'data-bm-hint-toggle': '1',
|
|
354
|
+
onClick: function () {
|
|
355
|
+
setShowHint(!showHint);
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
showHint ? '收起说明' : '说明',
|
|
359
|
+
),
|
|
360
|
+
h(
|
|
361
|
+
'button',
|
|
362
|
+
{
|
|
363
|
+
key: 'refresh',
|
|
364
|
+
type: 'button',
|
|
365
|
+
className: 'bm-btn bm-btn-ghost',
|
|
366
|
+
'data-bm-refresh': '1',
|
|
367
|
+
disabled: loading,
|
|
368
|
+
onClick: fetchNow,
|
|
369
|
+
},
|
|
370
|
+
loading ? '刷新中…' : '刷新',
|
|
371
|
+
),
|
|
372
|
+
]);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function renderForm() {
|
|
376
|
+
return h('div', { key: 'form', className: 'bm-form' }, [
|
|
377
|
+
h('div', { key: 'top', className: 'bm-form-top' }, [
|
|
378
|
+
h('label', { key: 'scope', className: 'bm-field' }, [
|
|
379
|
+
h('span', { key: 'sl', className: 'bm-field-label' }, '作用域'),
|
|
380
|
+
h(
|
|
381
|
+
'select',
|
|
382
|
+
{
|
|
383
|
+
key: 'select',
|
|
384
|
+
className: 'bm-select',
|
|
385
|
+
'data-bm-scope': '1',
|
|
386
|
+
value: effectiveScope,
|
|
387
|
+
disabled: submitting,
|
|
388
|
+
onChange: function (event) {
|
|
389
|
+
setScope(event.target.value);
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
[
|
|
393
|
+
h('option', { key: 'session', value: 'session', disabled: !hasSession }, '本会话'),
|
|
394
|
+
h('option', { key: 'profile', value: 'profile' }, '本 profile'),
|
|
395
|
+
h('option', { key: 'user', value: 'user' }, '仅我可见'),
|
|
396
|
+
],
|
|
397
|
+
),
|
|
398
|
+
]),
|
|
399
|
+
]),
|
|
400
|
+
h('input', {
|
|
401
|
+
key: 'title',
|
|
402
|
+
className: 'bm-input',
|
|
403
|
+
'data-bm-input': 'title',
|
|
404
|
+
type: 'text',
|
|
405
|
+
placeholder: '一句话',
|
|
406
|
+
maxLength: limits.title,
|
|
407
|
+
value: title,
|
|
408
|
+
disabled: submitting,
|
|
409
|
+
onChange: function (event) {
|
|
410
|
+
setTitle(event.target.value);
|
|
411
|
+
},
|
|
412
|
+
}),
|
|
413
|
+
h('textarea', {
|
|
414
|
+
key: 'body',
|
|
415
|
+
className: 'bm-input bm-textarea',
|
|
416
|
+
'data-bm-input': 'body',
|
|
417
|
+
rows: 3,
|
|
418
|
+
placeholder: '要记住的事',
|
|
419
|
+
maxLength: limits.body,
|
|
420
|
+
value: body,
|
|
421
|
+
disabled: submitting,
|
|
422
|
+
onChange: function (event) {
|
|
423
|
+
setBody(event.target.value);
|
|
424
|
+
},
|
|
425
|
+
}),
|
|
426
|
+
hasSession
|
|
427
|
+
? null
|
|
428
|
+
: h(
|
|
429
|
+
'p',
|
|
430
|
+
{ key: 'note', className: 'bm-note' },
|
|
431
|
+
'这个视图没带会话,只能用「本 profile」或「仅我可见」。',
|
|
432
|
+
),
|
|
433
|
+
h('div', { key: 'actions', className: 'bm-form-actions' }, [
|
|
434
|
+
h(
|
|
435
|
+
'button',
|
|
436
|
+
{
|
|
437
|
+
key: 'save',
|
|
438
|
+
type: 'button',
|
|
439
|
+
className: 'bm-btn bm-btn-primary',
|
|
440
|
+
'data-bm-add': '1',
|
|
441
|
+
disabled: submitting || (title.trim() === '' && body.trim() === ''),
|
|
442
|
+
onClick: submitAdd,
|
|
443
|
+
},
|
|
444
|
+
submitting ? '存中…' : '存下',
|
|
445
|
+
),
|
|
446
|
+
]),
|
|
447
|
+
]);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function renderRow(entry, index) {
|
|
451
|
+
const editing = editingId === entry.id;
|
|
452
|
+
const removing = removingId === entry.id;
|
|
453
|
+
const delay = Math.min(index * STAGGER_MS, (MAX_STAGGER - 1) * STAGGER_MS) + 'ms';
|
|
454
|
+
const style = removing ? undefined : { animationDelay: delay };
|
|
455
|
+
const children = [];
|
|
456
|
+
|
|
457
|
+
if (editing) {
|
|
458
|
+
children.push(
|
|
459
|
+
h('div', { key: 'edit', className: 'bm-edit' }, [
|
|
460
|
+
h('input', {
|
|
461
|
+
key: 'et',
|
|
462
|
+
className: 'bm-input',
|
|
463
|
+
type: 'text',
|
|
464
|
+
maxLength: limits.title,
|
|
465
|
+
placeholder: '一句话',
|
|
466
|
+
value: editTitle,
|
|
467
|
+
onChange: function (event) {
|
|
468
|
+
setEditTitle(event.target.value);
|
|
469
|
+
},
|
|
470
|
+
}),
|
|
471
|
+
h('textarea', {
|
|
472
|
+
key: 'eb',
|
|
473
|
+
className: 'bm-input bm-textarea',
|
|
474
|
+
rows: 3,
|
|
475
|
+
maxLength: limits.body,
|
|
476
|
+
placeholder: '要记住的事',
|
|
477
|
+
value: editBody,
|
|
478
|
+
onChange: function (event) {
|
|
479
|
+
setEditBody(event.target.value);
|
|
480
|
+
},
|
|
481
|
+
}),
|
|
482
|
+
h('div', { key: 'ea', className: 'bm-edit-actions' }, [
|
|
483
|
+
h(
|
|
484
|
+
'button',
|
|
485
|
+
{
|
|
486
|
+
key: 'save',
|
|
487
|
+
type: 'button',
|
|
488
|
+
className: 'bm-btn bm-btn-primary',
|
|
489
|
+
'data-bm-edit-save': entry.id,
|
|
490
|
+
onClick: function () {
|
|
491
|
+
saveEdit(entry);
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
'存',
|
|
495
|
+
),
|
|
496
|
+
h(
|
|
497
|
+
'button',
|
|
498
|
+
{
|
|
499
|
+
key: 'cancel',
|
|
500
|
+
type: 'button',
|
|
501
|
+
className: 'bm-btn',
|
|
502
|
+
'data-bm-edit-cancel': entry.id,
|
|
503
|
+
onClick: cancelEdit,
|
|
504
|
+
},
|
|
505
|
+
'取消',
|
|
506
|
+
),
|
|
507
|
+
]),
|
|
508
|
+
]),
|
|
509
|
+
);
|
|
510
|
+
} else {
|
|
511
|
+
children.push(
|
|
512
|
+
h('div', { key: 'head', className: 'bm-row-head' }, [
|
|
513
|
+
h('label', { key: 'label', className: 'bm-check' }, [
|
|
514
|
+
h('input', {
|
|
515
|
+
key: 'cb',
|
|
516
|
+
type: 'checkbox',
|
|
517
|
+
'data-bm-done': entry.id,
|
|
518
|
+
checked: entry.done === true,
|
|
519
|
+
onChange: function () {
|
|
520
|
+
toggleDone(entry);
|
|
521
|
+
},
|
|
522
|
+
}),
|
|
523
|
+
h(
|
|
524
|
+
'span',
|
|
525
|
+
{ key: 't', className: entry.done === true ? 'bm-row-title bm-done' : 'bm-row-title' },
|
|
526
|
+
displayTitle(entry),
|
|
527
|
+
),
|
|
528
|
+
]),
|
|
529
|
+
]),
|
|
530
|
+
);
|
|
531
|
+
if (typeof entry.body === 'string' && entry.body !== '') {
|
|
532
|
+
children.push(h('div', { key: 'body', className: 'bm-row-body' }, entry.body));
|
|
533
|
+
}
|
|
534
|
+
const confirming = confirmId === entry.id;
|
|
535
|
+
children.push(
|
|
536
|
+
h('div', { key: 'actions', className: 'bm-row-actions' }, [
|
|
537
|
+
h(
|
|
538
|
+
'button',
|
|
539
|
+
{
|
|
540
|
+
key: 'edit',
|
|
541
|
+
type: 'button',
|
|
542
|
+
className: 'bm-btn',
|
|
543
|
+
'data-bm-edit': entry.id,
|
|
544
|
+
onClick: function () {
|
|
545
|
+
startEdit(entry);
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
'改',
|
|
549
|
+
),
|
|
550
|
+
h(
|
|
551
|
+
'button',
|
|
552
|
+
{
|
|
553
|
+
key: 'delete',
|
|
554
|
+
type: 'button',
|
|
555
|
+
className: confirming ? 'bm-btn bm-btn-danger' : 'bm-btn',
|
|
556
|
+
'data-bm-delete': entry.id,
|
|
557
|
+
onClick: function () {
|
|
558
|
+
requestDelete(entry);
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
confirming ? '确定删?' : '删',
|
|
562
|
+
),
|
|
563
|
+
]),
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
return h(
|
|
568
|
+
'li',
|
|
569
|
+
{
|
|
570
|
+
key: entry.id,
|
|
571
|
+
className: 'bm-row' + (removing ? ' bm-row-out' : ''),
|
|
572
|
+
'data-bm-row': entry.id,
|
|
573
|
+
style: style,
|
|
574
|
+
},
|
|
575
|
+
children,
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
function renderGroup(key) {
|
|
580
|
+
const entries = payload !== null && Array.isArray(payload[key]) ? payload[key] : [];
|
|
581
|
+
const list =
|
|
582
|
+
entries.length === 0
|
|
583
|
+
? h('p', { key: 'empty', className: 'bm-empty' }, '这一栏还空着')
|
|
584
|
+
: h(
|
|
585
|
+
'ul',
|
|
586
|
+
{ key: 'list', className: 'bm-list' },
|
|
587
|
+
entries.map(function (entry, index) {
|
|
588
|
+
return renderRow(entry, index);
|
|
589
|
+
}),
|
|
590
|
+
);
|
|
591
|
+
return h('section', { key: key, className: 'bm-group', 'data-bm-group': key }, [
|
|
592
|
+
h('div', { key: 'head', className: 'bm-group-head' }, GROUP_LABEL[key] + ' (' + entries.length + ')'),
|
|
593
|
+
list,
|
|
594
|
+
]);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function renderError() {
|
|
598
|
+
return h('div', { key: 'error', className: 'bm-error', 'data-bm-error': '1' }, [
|
|
599
|
+
h('span', { key: 'msg' }, '出错了:' + error),
|
|
600
|
+
h('span', { key: 'spacer', className: 'bm-error-spacer' }),
|
|
601
|
+
h(
|
|
602
|
+
'button',
|
|
603
|
+
{
|
|
604
|
+
key: 'retry',
|
|
605
|
+
type: 'button',
|
|
606
|
+
className: 'bm-btn',
|
|
607
|
+
'data-bm-retry': '1',
|
|
608
|
+
onClick: fetchNow,
|
|
609
|
+
},
|
|
610
|
+
'重试',
|
|
611
|
+
),
|
|
612
|
+
]);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
const groups = hasSession ? ['session', 'profile', 'user'] : ['profile', 'user'];
|
|
616
|
+
|
|
617
|
+
return h(
|
|
618
|
+
'div',
|
|
619
|
+
{
|
|
620
|
+
className: 'bm-panel',
|
|
621
|
+
'data-better-memo': 'panel',
|
|
622
|
+
'data-better-memo-version': VERSION,
|
|
623
|
+
},
|
|
624
|
+
[
|
|
625
|
+
renderHead(),
|
|
626
|
+
showHint ? h('p', { key: 'hint', className: 'bm-hint' }, HINT_TEXT) : null,
|
|
627
|
+
renderForm(),
|
|
628
|
+
error !== null ? renderError() : null,
|
|
629
|
+
loading && payload === null ? h('p', { key: 'loading', className: 'bm-loading' }, '加载中…') : null,
|
|
630
|
+
payload !== null
|
|
631
|
+
? h(
|
|
632
|
+
'div',
|
|
633
|
+
{ key: 'groups', className: 'bm-groups' },
|
|
634
|
+
groups.map(function (key) {
|
|
635
|
+
return renderGroup(key);
|
|
636
|
+
}),
|
|
637
|
+
)
|
|
638
|
+
: null,
|
|
639
|
+
],
|
|
640
|
+
);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* `ctx.slots` throws until the entry declares it, so ask with `ctx.get`,
|
|
645
|
+
* and retry briefly: the client half can apply before the renderer has
|
|
646
|
+
* published the service. No scope capture, no polling loop of our own.
|
|
647
|
+
*/
|
|
648
|
+
function apply(ctx) {
|
|
649
|
+
const waitForSlots = (attemptsLeft) => {
|
|
650
|
+
let slots = null;
|
|
651
|
+
try {
|
|
652
|
+
slots = typeof ctx.get === 'function' ? ctx.get('slots') : undefined;
|
|
653
|
+
} catch (thrown) {
|
|
654
|
+
slots = undefined;
|
|
655
|
+
}
|
|
656
|
+
if (slots === undefined || slots === null) {
|
|
657
|
+
if (attemptsLeft > 0) setTimeout(() => waitForSlots(attemptsLeft - 1), 250);
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
try {
|
|
661
|
+
if (slots.spec(SLOT) === undefined) {
|
|
662
|
+
if (attemptsLeft > 0) setTimeout(() => waitForSlots(attemptsLeft - 1), 250);
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
slots.register(
|
|
666
|
+
{
|
|
667
|
+
name: SLOT,
|
|
668
|
+
id: SEAT_ID,
|
|
669
|
+
order: 1,
|
|
670
|
+
label: () => '备忘录',
|
|
671
|
+
},
|
|
672
|
+
Panel,
|
|
673
|
+
);
|
|
674
|
+
} catch (thrown) {
|
|
675
|
+
console.error('[better-memo] seat registration failed', thrown);
|
|
676
|
+
}
|
|
677
|
+
};
|
|
678
|
+
waitForSlots(20);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return { apply };
|
|
682
|
+
},
|
|
683
|
+
});
|
package/cordis.patch.yml
ADDED
package/icon.png
ADDED
|
Binary file
|
package/index.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-better-memo — Host half.
|
|
3
|
+
*
|
|
4
|
+
* Two agent tools (`memo_list`, `memo_edit`) and one HTTP prefix the client half
|
|
5
|
+
* reads and writes through (`/better-memo/state`, `/better-memo/write`).
|
|
6
|
+
*
|
|
7
|
+
* Scope rules live in lib/store.js. The one rule worth repeating here: the
|
|
8
|
+
* `user` scope is the user's own drawer. No tool returns it and no tool writes
|
|
9
|
+
* it — only the panel does, over the route.
|
|
10
|
+
*/
|
|
11
|
+
import { addEntry, AGENT_SCOPES, deleteEntry, read, updateEntry, visibleTo, write, LIMITS } from './lib/store.js';
|
|
12
|
+
|
|
13
|
+
export const name = 'dsh-better-memo';
|
|
14
|
+
export const inject = ['tools', 'systemPrompt'];
|
|
15
|
+
|
|
16
|
+
export const ROUTE = '/better-memo';
|
|
17
|
+
const MARKER = { 'x-better-memo': '1' };
|
|
18
|
+
|
|
19
|
+
const OUT = {
|
|
20
|
+
schema: { type: 'object', additionalProperties: true },
|
|
21
|
+
render(_args, value) {
|
|
22
|
+
const text = typeof value === 'string' ? value : JSON.stringify(value, null, 2);
|
|
23
|
+
const limit = 20000;
|
|
24
|
+
if (text.length <= limit) return [{ type: 'text', text }];
|
|
25
|
+
return [{ type: 'text', text: `${text.slice(0, limit)}\n…[truncated ${text.length - limit} chars]` }];
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function schema(properties, required = []) {
|
|
30
|
+
return { type: 'object', properties, required, additionalProperties: false };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The profile this host process serves: `--profile <name>` on argv, else default. */
|
|
34
|
+
export function profileOf(argv = process.argv, env = process.env) {
|
|
35
|
+
const fromEnv = env.DSH_PROFILE;
|
|
36
|
+
if (typeof fromEnv === 'string' && fromEnv.trim() !== '') return fromEnv.trim();
|
|
37
|
+
const list = Array.isArray(argv) ? argv : [];
|
|
38
|
+
for (let index = 0; index < list.length; index += 1) {
|
|
39
|
+
const item = String(list[index]);
|
|
40
|
+
if (item === '--profile' && index + 1 < list.length) return String(list[index + 1]);
|
|
41
|
+
if (item.startsWith('--profile=')) return item.slice('--profile='.length);
|
|
42
|
+
}
|
|
43
|
+
return 'default';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function markerOk(request) {
|
|
47
|
+
try {
|
|
48
|
+
return request.headers.get('x-better-memo') === '1';
|
|
49
|
+
} catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function shape(entry) {
|
|
55
|
+
return {
|
|
56
|
+
id: entry.id,
|
|
57
|
+
scope: entry.scope,
|
|
58
|
+
title: entry.title,
|
|
59
|
+
body: entry.body,
|
|
60
|
+
done: entry.done,
|
|
61
|
+
createdAt: entry.createdAt,
|
|
62
|
+
updatedAt: entry.updatedAt,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function panelPayload({ sessionId, profile, env = process.env }) {
|
|
67
|
+
const db = read(env);
|
|
68
|
+
const seen = visibleTo(db, { sessionId, profile });
|
|
69
|
+
return {
|
|
70
|
+
ok: true,
|
|
71
|
+
profileName: profile,
|
|
72
|
+
sessionId,
|
|
73
|
+
session: seen.session.map(shape),
|
|
74
|
+
profile: seen.profile.map(shape),
|
|
75
|
+
user: seen.user.map(shape),
|
|
76
|
+
limits: LIMITS,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function serveState(request, env = process.env) {
|
|
81
|
+
if (markerOk(request) === false) return Response.json({ ok: false, reason: 'no-marker' }, { status: 403 });
|
|
82
|
+
try {
|
|
83
|
+
const params = new URL(request.url).searchParams;
|
|
84
|
+
const sessionId = params.get('sessionId');
|
|
85
|
+
return Response.json(panelPayload({
|
|
86
|
+
sessionId: sessionId === null || sessionId === '' ? null : sessionId,
|
|
87
|
+
profile: profileOf(process.argv, process.env),
|
|
88
|
+
env,
|
|
89
|
+
}));
|
|
90
|
+
} catch (thrown) {
|
|
91
|
+
const message = thrown instanceof Error ? thrown.message : String(thrown);
|
|
92
|
+
return Response.json({ ok: false, reason: 'error', error: message }, { status: 500 });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function serveWrite(request, env = process.env) {
|
|
97
|
+
if (markerOk(request) === false) return Response.json({ ok: false, reason: 'no-marker' }, { status: 403 });
|
|
98
|
+
try {
|
|
99
|
+
const params = new URL(request.url).searchParams;
|
|
100
|
+
const sessionId = params.get('sessionId');
|
|
101
|
+
const scope = params.get('scope');
|
|
102
|
+
const profile = profileOf(process.argv, process.env);
|
|
103
|
+
const db = read(env);
|
|
104
|
+
const op = params.get('op');
|
|
105
|
+
if (op === 'add') {
|
|
106
|
+
addEntry(db, {
|
|
107
|
+
scope: scope === null ? 'user' : scope,
|
|
108
|
+
sessionId: sessionId === null || sessionId === '' ? null : sessionId,
|
|
109
|
+
profile,
|
|
110
|
+
title: params.get('title') ?? '',
|
|
111
|
+
body: params.get('body') ?? '',
|
|
112
|
+
createdBy: 'user',
|
|
113
|
+
});
|
|
114
|
+
} else if (op === 'update') {
|
|
115
|
+
updateEntry(db, {
|
|
116
|
+
id: params.get('id') ?? '',
|
|
117
|
+
title: params.get('title') === null ? undefined : params.get('title'),
|
|
118
|
+
body: params.get('body') === null ? undefined : params.get('body'),
|
|
119
|
+
done: params.get('done') === null ? undefined : params.get('done') === '1',
|
|
120
|
+
});
|
|
121
|
+
} else if (op === 'delete') {
|
|
122
|
+
deleteEntry(db, { id: params.get('id') ?? '' });
|
|
123
|
+
} else {
|
|
124
|
+
return Response.json({ ok: false, reason: 'bad-op', error: `unknown op "${String(op)}"` }, { status: 400 });
|
|
125
|
+
}
|
|
126
|
+
write(db, env);
|
|
127
|
+
return Response.json(panelPayload({ sessionId: sessionId === null || sessionId === '' ? null : sessionId, profile, env }));
|
|
128
|
+
} catch (thrown) {
|
|
129
|
+
const message = thrown instanceof Error ? thrown.message : String(thrown);
|
|
130
|
+
return Response.json({ ok: false, reason: 'error', error: message }, { status: 400 });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** One prefix, dispatched by pathname so router order cannot pick the handler. */
|
|
135
|
+
export function serveRequest(request, env = process.env) {
|
|
136
|
+
let pathname = '';
|
|
137
|
+
try {
|
|
138
|
+
pathname = new URL(request.url).pathname.replace(/\/+$/, '');
|
|
139
|
+
} catch {
|
|
140
|
+
pathname = '';
|
|
141
|
+
}
|
|
142
|
+
if (pathname === `${ROUTE}/state`) return serveState(request, env);
|
|
143
|
+
if (pathname === `${ROUTE}/write`) return serveWrite(request, env);
|
|
144
|
+
return Response.json({ ok: false, reason: 'not-found' }, { status: 404 });
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function apply(ctx, config = {}) {
|
|
148
|
+
if (config?.announceToAgent !== false && ctx.systemPrompt?.section) {
|
|
149
|
+
ctx.systemPrompt.section({
|
|
150
|
+
name: 'tool:better-memo',
|
|
151
|
+
order: 142,
|
|
152
|
+
text:
|
|
153
|
+
'备忘录(memo)有三种归属:session(只发给本会话)、profile(发给本 profile 的所有会话)、user(只有用户自己看得到,你看不到)。' +
|
|
154
|
+
'会话开始时若用户提到「备忘录 / 备忘 / 记一下 / 待办」,先调 memo_list 看有没有留给你的条目;收到后按条目办事。' +
|
|
155
|
+
'要记东西用 memo_edit(op=add)。只能写 session 和 profile 两种归属,写不了 user。',
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const sessionOf = (exec) => {
|
|
160
|
+
const id = exec?.agent?.id;
|
|
161
|
+
return typeof id === 'string' && id !== '' ? id : null;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
ctx.tools.register({
|
|
165
|
+
name: 'memo_list',
|
|
166
|
+
description:
|
|
167
|
+
'查看当前会话应当查收的备忘录:本会话的 session 条目 + 本 profile 的 profile 条目。' +
|
|
168
|
+
'归 user(仅用户可见)的条目不会出现在这里。',
|
|
169
|
+
parameters: schema({}),
|
|
170
|
+
output: OUT,
|
|
171
|
+
async execute(_args, exec) {
|
|
172
|
+
const sessionId = sessionOf(exec);
|
|
173
|
+
if (sessionId === null) return { ok: false, error: 'no session in this call' };
|
|
174
|
+
const profile = profileOf();
|
|
175
|
+
const db = read();
|
|
176
|
+
const seen = visibleTo(db, { sessionId, profile });
|
|
177
|
+
const rows = [...seen.session, ...seen.profile].filter((entry) => entry.done !== true);
|
|
178
|
+
return {
|
|
179
|
+
ok: true,
|
|
180
|
+
profile,
|
|
181
|
+
sessionId,
|
|
182
|
+
count: rows.length,
|
|
183
|
+
memos: rows.map((entry) => ({ ...shape(entry), scope: entry.scope })),
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
ctx.tools.register({
|
|
189
|
+
name: 'memo_edit',
|
|
190
|
+
description:
|
|
191
|
+
'新增 / 修改 / 删除备忘录。op=add 需要 scope(session|profile) + title 或 body;' +
|
|
192
|
+
'op=update / op=delete 需要 id。只能改自己看得到的 session / profile 条目,user 条目改不了。',
|
|
193
|
+
parameters: schema(
|
|
194
|
+
{
|
|
195
|
+
op: { type: 'string', enum: ['add', 'update', 'delete'], description: '要做的操作。' },
|
|
196
|
+
id: { type: 'string', description: 'update / delete 用的条目 id(memo_list 返回的那个)。' },
|
|
197
|
+
scope: { type: 'string', enum: AGENT_SCOPES, description: 'add 用:session 只给本会话,profile 给本 profile 所有会话。' },
|
|
198
|
+
title: { type: 'string', description: `一句话标题,最多 ${LIMITS.title} 字。` },
|
|
199
|
+
body: { type: 'string', description: `正文,最多 ${LIMITS.body} 字。` },
|
|
200
|
+
done: { type: 'boolean', description: 'update 用:是否标记为已完成。' },
|
|
201
|
+
},
|
|
202
|
+
['op'],
|
|
203
|
+
),
|
|
204
|
+
output: OUT,
|
|
205
|
+
async execute(args, exec) {
|
|
206
|
+
const sessionId = sessionOf(exec);
|
|
207
|
+
if (sessionId === null) return { ok: false, error: 'no session in this call' };
|
|
208
|
+
const profile = profileOf();
|
|
209
|
+
const db = read();
|
|
210
|
+
const op = args?.op;
|
|
211
|
+
try {
|
|
212
|
+
if (op === 'add') {
|
|
213
|
+
const entry = addEntry(db, {
|
|
214
|
+
scope: args?.scope,
|
|
215
|
+
sessionId,
|
|
216
|
+
profile,
|
|
217
|
+
title: args?.title,
|
|
218
|
+
body: args?.body,
|
|
219
|
+
createdBy: 'agent',
|
|
220
|
+
});
|
|
221
|
+
write(db);
|
|
222
|
+
return { ok: true, op: 'add', memo: shape(entry) };
|
|
223
|
+
}
|
|
224
|
+
if (op === 'update' || op === 'delete') {
|
|
225
|
+
const visible = visibleTo(db, { sessionId, profile });
|
|
226
|
+
const reachable = [...visible.session, ...visible.profile].some((entry) => entry.id === args?.id);
|
|
227
|
+
if (reachable === false) return { ok: false, error: `no memo with id "${String(args?.id)}" that you may change` };
|
|
228
|
+
const entry = op === 'update'
|
|
229
|
+
? updateEntry(db, { id: args.id, title: args.title, body: args.body, done: args.done })
|
|
230
|
+
: deleteEntry(db, { id: args.id });
|
|
231
|
+
write(db);
|
|
232
|
+
return { ok: true, op, memo: shape(entry) };
|
|
233
|
+
}
|
|
234
|
+
return { ok: false, error: `unknown op "${String(op)}"` };
|
|
235
|
+
} catch (thrown) {
|
|
236
|
+
return { ok: false, error: thrown instanceof Error ? thrown.message : String(thrown) };
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
ctx.inject(['webServer'], (webCtx) => {
|
|
242
|
+
webCtx.effect(
|
|
243
|
+
() =>
|
|
244
|
+
webCtx.webServer.register({
|
|
245
|
+
kind: 'prefix',
|
|
246
|
+
path: ROUTE,
|
|
247
|
+
resource: (request) => serveRequest(request),
|
|
248
|
+
}),
|
|
249
|
+
'better-memo: state and write',
|
|
250
|
+
);
|
|
251
|
+
});
|
|
252
|
+
}
|
package/lib/store.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memo storage: one JSON file under $DSH_HOME/memo/memos.json.
|
|
3
|
+
*
|
|
4
|
+
* Three scopes, decided by the user:
|
|
5
|
+
* session — only the session that owns it receives it
|
|
6
|
+
* profile — every session of that profile receives it
|
|
7
|
+
* user — the user writes it for themselves; no tool ever returns it
|
|
8
|
+
*
|
|
9
|
+
* Everything here is pure apart from read/write/update/remove, which touch the
|
|
10
|
+
* file named by `dataFile()`. Tests pass a temp dir through `env`.
|
|
11
|
+
*/
|
|
12
|
+
import fs from 'node:fs';
|
|
13
|
+
import os from 'node:os';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
|
|
16
|
+
export const SCOPES = ['session', 'profile', 'user'];
|
|
17
|
+
/** Scopes an agent may write. `user` is the user's own drawer and is UI-only. */
|
|
18
|
+
export const AGENT_SCOPES = ['session', 'profile'];
|
|
19
|
+
|
|
20
|
+
export const LIMITS = {
|
|
21
|
+
title: 120,
|
|
22
|
+
body: 4000,
|
|
23
|
+
entries: 500,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function homeDir(env = process.env) {
|
|
27
|
+
const explicit = env.DSH_HOME;
|
|
28
|
+
if (typeof explicit === 'string' && explicit.trim() !== '') return explicit;
|
|
29
|
+
return path.join(os.homedir(), '.dsh');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function dataFile(env = process.env) {
|
|
33
|
+
const home = homeDir(env);
|
|
34
|
+
const override = env.DSH_MEMO_FILE;
|
|
35
|
+
if (typeof override === 'string' && override.trim() !== '') return override;
|
|
36
|
+
return path.join(home, 'memo', 'memos.json');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function emptyDb() {
|
|
40
|
+
return { version: 1, entries: [] };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function str(value, max) {
|
|
44
|
+
if (typeof value !== 'string') return '';
|
|
45
|
+
const trimmed = value.trim();
|
|
46
|
+
return trimmed.length > max ? trimmed.slice(0, max) : trimmed;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function num(value, fallback) {
|
|
50
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : fallback;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Coerce anything on disk into the shape the rest of the module expects.
|
|
55
|
+
* Unknown fields are dropped, bad rows are skipped: a corrupted file must not
|
|
56
|
+
* take the plugin down.
|
|
57
|
+
*/
|
|
58
|
+
export function sanitizeDb(raw) {
|
|
59
|
+
const db = emptyDb();
|
|
60
|
+
const list = raw !== null && typeof raw === 'object' && Array.isArray(raw.entries) ? raw.entries : [];
|
|
61
|
+
for (const row of list) {
|
|
62
|
+
if (row === null || typeof row !== 'object') continue;
|
|
63
|
+
const scope = SCOPES.includes(row.scope) ? row.scope : null;
|
|
64
|
+
if (scope === null) continue;
|
|
65
|
+
const sessionId = typeof row.sessionId === 'string' && row.sessionId !== '' ? row.sessionId : null;
|
|
66
|
+
if (scope === 'session' && sessionId === null) continue;
|
|
67
|
+
const title = str(row.title, LIMITS.title);
|
|
68
|
+
const body = str(row.body, LIMITS.body);
|
|
69
|
+
if (title === '' && body === '') continue;
|
|
70
|
+
const createdAt = num(row.createdAt, 0);
|
|
71
|
+
db.entries.push({
|
|
72
|
+
id: str(row.id, 64) || newId(),
|
|
73
|
+
scope,
|
|
74
|
+
sessionId,
|
|
75
|
+
profile: str(row.profile, 64) || 'default',
|
|
76
|
+
title,
|
|
77
|
+
body,
|
|
78
|
+
done: row.done === true,
|
|
79
|
+
createdBy: row.createdBy === 'user' ? 'user' : 'agent',
|
|
80
|
+
createdAt,
|
|
81
|
+
updatedAt: num(row.updatedAt, createdAt),
|
|
82
|
+
});
|
|
83
|
+
if (db.entries.length >= LIMITS.entries) break;
|
|
84
|
+
}
|
|
85
|
+
return db;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function read(env = process.env) {
|
|
89
|
+
const file = dataFile(env);
|
|
90
|
+
try {
|
|
91
|
+
const text = fs.readFileSync(file, 'utf8');
|
|
92
|
+
return sanitizeDb(JSON.parse(text));
|
|
93
|
+
} catch {
|
|
94
|
+
return emptyDb();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function write(db, env = process.env) {
|
|
99
|
+
const file = dataFile(env);
|
|
100
|
+
const dir = path.dirname(file);
|
|
101
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
102
|
+
const tmp = `${file}.${process.pid}.${Date.now()}.tmp`;
|
|
103
|
+
fs.writeFileSync(tmp, JSON.stringify(db, null, "\t"), 'utf8');
|
|
104
|
+
fs.renameSync(tmp, file);
|
|
105
|
+
return db;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
let counter = 0;
|
|
109
|
+
export function newId() {
|
|
110
|
+
counter = (counter + 1) % 4096;
|
|
111
|
+
const rand = Math.floor(Math.random() * 0xfffff).toString(16).padStart(5, '0');
|
|
112
|
+
return `m_${Date.now().toString(36)}${counter.toString(36)}${rand}`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* What each reader sees.
|
|
117
|
+
* agent — session scope of this session + profile scope of this profile; never `user`
|
|
118
|
+
* panel — everything the user may see here: the two above plus `user`
|
|
119
|
+
*/
|
|
120
|
+
export function visibleTo(db, { sessionId = null, profile = 'default' } = {}) {
|
|
121
|
+
const session = [];
|
|
122
|
+
const byProfile = [];
|
|
123
|
+
const user = [];
|
|
124
|
+
for (const entry of db.entries) {
|
|
125
|
+
if (entry.scope === 'session') {
|
|
126
|
+
if (entry.sessionId !== null && entry.sessionId === sessionId) session.push(entry);
|
|
127
|
+
} else if (entry.scope === 'profile') {
|
|
128
|
+
if (entry.profile === profile) byProfile.push(entry);
|
|
129
|
+
} else if (entry.scope === 'user') {
|
|
130
|
+
user.push(entry);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return { session, profile: byProfile, user };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function requireScope(scope, { sessionId }) {
|
|
137
|
+
if (!SCOPES.includes(scope)) throw new Error(`unknown scope "${String(scope)}" (session|profile|user)`);
|
|
138
|
+
if (scope === 'session' && (sessionId === null || sessionId === '')) {
|
|
139
|
+
throw new Error('scope "session" needs a session id');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function addEntry(db, input) {
|
|
144
|
+
const scope = input.scope;
|
|
145
|
+
requireScope(scope, input);
|
|
146
|
+
const title = str(input.title, LIMITS.title);
|
|
147
|
+
const body = str(input.body, LIMITS.body);
|
|
148
|
+
if (title === '' && body === '') throw new Error('a memo needs a title or a body');
|
|
149
|
+
if (db.entries.length >= LIMITS.entries) throw new Error(`the memo list is full (${LIMITS.entries})`);
|
|
150
|
+
const now = num(input.now, Date.now());
|
|
151
|
+
const entry = {
|
|
152
|
+
id: newId(),
|
|
153
|
+
scope,
|
|
154
|
+
sessionId: scope === 'session' ? input.sessionId : null,
|
|
155
|
+
profile: scope === 'session' ? str(input.profile, 64) || 'default' : str(input.profile, 64) || 'default',
|
|
156
|
+
title,
|
|
157
|
+
body,
|
|
158
|
+
done: false,
|
|
159
|
+
createdBy: input.createdBy === 'user' ? 'user' : 'agent',
|
|
160
|
+
createdAt: now,
|
|
161
|
+
updatedAt: now,
|
|
162
|
+
};
|
|
163
|
+
db.entries.push(entry);
|
|
164
|
+
return entry;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function updateEntry(db, input) {
|
|
168
|
+
const entry = db.entries.find((row) => row.id === input.id);
|
|
169
|
+
if (entry === undefined) throw new Error(`no memo with id "${String(input.id)}"`);
|
|
170
|
+
if (input.title !== undefined) entry.title = str(input.title, LIMITS.title);
|
|
171
|
+
if (input.body !== undefined) entry.body = str(input.body, LIMITS.body);
|
|
172
|
+
if (input.done !== undefined) entry.done = input.done === true;
|
|
173
|
+
if (entry.title === '' && entry.body === '') throw new Error('a memo needs a title or a body');
|
|
174
|
+
entry.updatedAt = num(input.now, Date.now());
|
|
175
|
+
return entry;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function deleteEntry(db, input) {
|
|
179
|
+
const index = db.entries.findIndex((row) => row.id === input.id);
|
|
180
|
+
if (index < 0) throw new Error(`no memo with id "${String(input.id)}"`);
|
|
181
|
+
const [entry] = db.entries.splice(index, 1);
|
|
182
|
+
return entry;
|
|
183
|
+
}
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-better-memo",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Memo notes for DeepSeek Harness in three scopes — this session, this profile, or the user only — with agent tools to read and edit them. 三层备忘录:会话级 / profile 级 / 仅用户可见。",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.js",
|
|
10
|
+
"./client": "./client.js",
|
|
11
|
+
"./package.json": "./package.json",
|
|
12
|
+
"./locale/*.json": "./locale/*.json",
|
|
13
|
+
"./icon": "./icon.png"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"client.js",
|
|
18
|
+
"lib",
|
|
19
|
+
"cordis.patch.yml",
|
|
20
|
+
"README.md",
|
|
21
|
+
"CHANGELOG.md",
|
|
22
|
+
"LICENSE",
|
|
23
|
+
"locale",
|
|
24
|
+
"icon.png"
|
|
25
|
+
],
|
|
26
|
+
"dsh": {
|
|
27
|
+
"bundle": {
|
|
28
|
+
"patch": "./cordis.patch.yml"
|
|
29
|
+
},
|
|
30
|
+
"client": {
|
|
31
|
+
"platform": "web",
|
|
32
|
+
"immediately": true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"icon": "./icon.png",
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=20",
|
|
38
|
+
"dsh": ">=0.2.2-rc.1 <0.3.0-0"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"dsh",
|
|
42
|
+
"dsh-plugin",
|
|
43
|
+
"deepseek-harness",
|
|
44
|
+
"memo",
|
|
45
|
+
"notes",
|
|
46
|
+
"todo",
|
|
47
|
+
"cordis"
|
|
48
|
+
],
|
|
49
|
+
"author": {
|
|
50
|
+
"name": "MeruSu"
|
|
51
|
+
},
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/MeruSu/dsh-better-memo.git"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/MeruSu/dsh-better-memo#readme",
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/MeruSu/dsh-better-memo/issues"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public",
|
|
62
|
+
"registry": "https://registry.npmjs.org/"
|
|
63
|
+
},
|
|
64
|
+
"os": [
|
|
65
|
+
"win32"
|
|
66
|
+
],
|
|
67
|
+
"license": "MIT"
|
|
68
|
+
}
|