@ssamurias/dsh-fish 1.0.0 → 1.0.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.
Files changed (64) hide show
  1. package/AGENTS.md +6 -3
  2. package/CHANGELOG.md +572 -368
  3. package/README.md +148 -14
  4. package/RELEASE-NOTES-1.0.0.md +62 -3
  5. package/RELEASE-NOTES-1.0.1.md +363 -0
  6. package/RELEASE-NOTES-1.0.2.md +114 -0
  7. package/THIRD-PARTY-NOTICES.md +13 -3
  8. package/docs/troubleshooting.md +119 -0
  9. package/docs//346/217/222/344/273/266/347/272/246/345/256/232.md +167 -0
  10. package/docs//347/264/240/346/235/220/345/245/221/347/272/246.md +96 -0
  11. package/lib/ask.js +3 -3
  12. package/lib/at.js +4 -2
  13. package/lib/autobackup.js +414 -0
  14. package/lib/backup.js +75 -5
  15. package/lib/bili.js +132 -21
  16. package/lib/browse.js +33 -16
  17. package/lib/capture.js +27 -1
  18. package/lib/client.js +1329 -349
  19. package/lib/cloudbackup.js +352 -0
  20. package/lib/cloudcrypto.js +161 -0
  21. package/lib/clouddrive.js +693 -0
  22. package/lib/cloudsmtp.js +331 -0
  23. package/lib/cloudtargets.js +228 -0
  24. package/lib/comment.js +23 -5
  25. package/lib/contract.js +7 -2
  26. package/lib/deliver.js +4 -1
  27. package/lib/doing.js +316 -0
  28. package/lib/events.js +22 -4
  29. package/lib/firstwake.js +74 -0
  30. package/lib/freewake.js +5 -0
  31. package/lib/generator.js +35 -4
  32. package/lib/handoff.js +166 -0
  33. package/lib/hear.js +102 -7
  34. package/lib/home.js +169 -204
  35. package/lib/identity.js +498 -28
  36. package/lib/index.js +14 -2
  37. package/lib/look.js +37 -3
  38. package/lib/material.js +12 -1
  39. package/lib/note.js +100 -9
  40. package/lib/observe.js +365 -36
  41. package/lib/persona.js +61 -41
  42. package/lib/proactive.js +12 -5
  43. package/lib/recall.js +159 -10
  44. package/lib/report.js +14 -7
  45. package/lib/say.js +10 -2
  46. package/lib/scheduler.js +238 -26
  47. package/lib/schema.js +8 -1
  48. package/lib/scrub.js +105 -4
  49. package/lib/selfcheck.js +13 -1
  50. package/lib/selfdoc.js +170 -12
  51. package/lib/selfpronoun.js +112 -0
  52. package/lib/selfrules.js +50 -0
  53. package/lib/sessionnote.js +7 -3
  54. package/lib/settings.js +163 -13
  55. package/lib/status.js +16 -8
  56. package/lib/sub.js +42 -5
  57. package/lib/turnexport.js +123 -0
  58. package/lib/turns.js +102 -10
  59. package/lib/video.js +1 -1
  60. package/lib/voices.js +24 -1
  61. package/media/principle-drive.svg +131 -0
  62. package/media/principle-loop.svg +3 -3
  63. package/media/principle-memory.svg +1 -1
  64. package/package.json +2 -1
package/lib/index.js CHANGED
@@ -31,6 +31,7 @@ import { registerPronounAsk } from './pronounask.js'
31
31
  import { answerCard } from './cardanswer.js'
32
32
  import { registerDream } from './dream.js'
33
33
  import { registerProactive } from './proactive.js'
34
+ import { registerDoingHooks } from './doing.js'
34
35
  import { registerObserve } from './observe.js'
35
36
  import { startScheduler } from './scheduler.js'
36
37
  import { registerTurns } from './turns.js'
@@ -57,7 +58,7 @@ export const name = 'dsh-fish'
57
58
  * 版本号,必须和 package.json 的 version 一样(test/boot.test.mjs 盯着)。
58
59
  * 不只是日志:升级自检和设置页的「检查更新」拿它当「正在跑的版本」。
59
60
  */
60
- export const VERSION = '1.0.0'
61
+ export const VERSION = '1.0.2'
61
62
 
62
63
  // ⚠️ 一个数组写全,不要拆成对象
63
64
  // 2026-10-30(m02961):`userQuestions` **不再写进 inject**。写进 inject 的东西缺一个,
@@ -461,6 +462,11 @@ export function apply(ctx, baseConfig = {}) {
461
462
  const obs = registerObserve(ctx, { root, version: VERSION, tenancy, install, compat })
462
463
  if (obs?.dispose) disposers.push(() => obs.dispose())
463
464
 
465
+ // 动手回合的闸与记账(2026-11-14,用户 m01237):只在主动回合里生效,
466
+ // 他自己找她、定时叫醒都不经过;拿不到会话时一律放行。
467
+ const doingOff = registerDoingHooks(ctx, { root, log: (...a) => logger.info(...a) })
468
+ if (doingOff) disposers.push(doingOff)
469
+
464
470
  // 生物钟:把屋子信息一起传下去。她每晚醒来说话要落进**同一个**会话,
465
471
  // 不是每晚新开一个藏起来的会话(用户定案:打开侧栏就该看见她)。
466
472
  //
@@ -511,8 +517,14 @@ export function apply(ctx, baseConfig = {}) {
511
517
  try { scheduler?.dispose?.() } catch { /* ignore */ }
512
518
  try { clearWakeSection() } catch { /* ignore */ }
513
519
  for (const d of disposers) { try { d() } catch { /* ignore */ } }
520
+ // 临走前抢刷一次兜底备份(用户 m00597):谁也不知道哪次启动是最后一次,
521
+ // 关机前这一下是最后的机会。跟 released 一起 race,且自带 2 秒上限——
522
+ // 磁盘卡住时不能把卸载也挂住,依赖这个插件的服务还在等它。
523
+ const flushed = Promise.resolve()
524
+ .then(() => scheduler?.flushBackup?.())
525
+ .catch(() => {})
514
526
  // 磁盘卡住时别把卸载也挂住,依赖这个插件的服务要等它。用不 ref 的定时器,它不该拖住进程
515
- return Promise.race([released, sleep(2000, undefined, { ref: false })])
527
+ return Promise.race([Promise.all([released, flushed]), sleep(2000, undefined, { ref: false })])
516
528
  }
517
529
 
518
530
  // 宿主的 cordis 4 没有 'dispose' 事件,也不管 apply 返回的 { dispose },只认 ctx.effect。
package/lib/look.js CHANGED
@@ -28,6 +28,37 @@ import { guardWrite } from './tenant.js'
28
28
 
29
29
  import { defineTool } from './tool.js'
30
30
 
31
+ /**
32
+ * 「没读出回复」时到底该说什么(2026-11-13,issue #136 B)。
33
+ *
34
+ * 原来这里只有一句写死的话:「你最近没在谁的评论下面被人回过——也可能是我这边
35
+ * 查不到(B 站这会儿回了个 -412)」。可 -412 从没发生过,她照着这句去理解,
36
+ * 得到的是一个不存在的风控;真正的原因(没发过评论 / 没人回 / 网络没通)全被
37
+ * `readMyReplies` 里那句 `continue` 吞掉了。现在按 diag 里的事实分句说。
38
+ */
39
+ export function repliesMissNote(diag = {}, { bvid = '' } = {}) {
40
+ const days = Number(diag.days) || 0
41
+ const failed = Array.isArray(diag.failed) ? diag.failed : []
42
+ const codes = failed.map((f) => Number(f?.code))
43
+ if (diag.off) return 'B 站那边是关着的(设置里关了),现在没法去看。'
44
+ const risk = codes.find((n) => RISK_CODES.has(n))
45
+ if (risk) return `B 站这会儿没让我查(回了 ${risk}),过一会儿再看。`
46
+ if (failed.some((f) => String(f?.code) === 'NOT_LOGIN')) return 'B 站登录过期了,查不了回复。'
47
+ if (failed.some((f) => String(f?.code) === 'NETWORK')) return '网络没通,这次没查成回复。'
48
+ if (!diag.roots) {
49
+ return bvid
50
+ ? `你在 ${bvid} 下面没发过评论,所以没有「谁回你」可看。`
51
+ : `最近 ${days || '几'} 天你没在 B 站发过评论,所以没有「谁回你」可看。`
52
+ }
53
+ if (failed.length) return `有几条(${failed.length} 条)没查成,剩下那些下面没人回你。`
54
+ // 分不清就不能说成「没有人回你」:她自己是这么说的——「别把「没有」和「查不成」合成一句」。
55
+ if (Number(diag.unresolved) > 0) return `有 ${diag.unresolved} 条这次没打开(没拿到视频详情),所以分不清是不是有人回你,过一会儿再看。`
56
+ return '你发过的那几条评论下面还没有人说话。'
57
+ }
58
+
59
+ /** 风控码:只有这些才算「B 站不让我查」。 */
60
+ const RISK_CODES = new Set([-412, -352, -509])
61
+
31
62
  /**
32
63
  * 调一次"看":返回素材文本。永不抛出。
33
64
  * 单独抽出来是为了能在观测台/单测里直接调(不经模型)。
@@ -67,13 +98,15 @@ export async function lookOnce(o = {}) {
67
98
  // 而且那条提醒被她看过一次就被 cseen 掉了,回头再看永远是空的。
68
99
  // 这里给她一个自己去看的动作:不滤 cseen,带上回楼中楼要用的编号。
69
100
  if (what === 'replies') {
70
- const got = await readMyReplies({ root, client, events, bvid: String(o.bvid ?? '').trim() })
71
- const txt = renderMyReplies(got, { bvid: String(o.bvid ?? '').trim() })
101
+ const want = String(o.bvid ?? '').trim()
102
+ const diag = {}
103
+ const got = await readMyReplies({ root, client, events, bvid: want, diag })
104
+ const txt = renderMyReplies(got, { bvid: want })
72
105
  if (!txt) {
73
106
  return {
74
107
  ok: false,
75
108
  text: '',
76
- note: got.length ? '' : '你最近没在谁的评论下面被人回过——也可能是我这边还查不到(B 站这会儿回了个 -412)。',
109
+ note: repliesMissNote(diag, { bvid: want }),
77
110
  picks: [],
78
111
  }
79
112
  }
@@ -315,6 +348,7 @@ export function registerLook(ctx, deps = {}) {
315
348
  '去看一眼 B 站:首页在推什么、搜一个词、看某条视频之后平台又接着推什么,' +
316
349
  '或者直接看指定的那一条(给 BV 号或链接)。' +
317
350
  '也可以看你自己发过的评论下面有没有人回你(what=replies)。' +
351
+ '别人在 B 站 @ 你,不在这个工具里——那时候那条内容会直接递进你的会话。' +
318
352
  '只读,不会留下痕迹。给的是标题、简介、标签、热评、弹幕——没有视频画面。' +
319
353
  '不用它也可以。',
320
354
  // 注意:必须 toJsonSchema 包一层。简写 DSL 直接发出去会被 provider 拒:
package/lib/material.js CHANGED
@@ -46,11 +46,16 @@ export function isDissent(text) {
46
46
  * 为什么不多:一次素材里出现两三条反例就够她对照了;给太多,素材会变成
47
47
  * 评论区吵架现场,她的注意力会被拽到争论上,而不是那件事本身。
48
48
  * 按点赞降序挑,最多 max 条。
49
+ *
50
+ * 2026-11-13(issue #135):传进来的列表来自 `sort=2`,是 B 站**热度序**,
51
+ * 赞数并不单调(实测 30/55/44/348…)。这句「按点赞降序」从 0.9.8 起就写在
52
+ * 注释里,代码却是照顺序取——现在真排一次,挑出来的才是「最多人赞同的那条反例」。
49
53
  */
50
54
  export function pickDisputes(comments = [], { max = 2 } = {}) {
51
55
  const out = []
52
56
  const seen = new Set()
53
- for (const c of comments) {
57
+ const ranked = [...comments].sort((a, b) => (Number(b?.like) || 0) - (Number(a?.like) || 0))
58
+ for (const c of ranked) {
54
59
  const text = String(c?.text ?? '').trim()
55
60
  if (!text || seen.has(text)) continue
56
61
  if (!isDissent(text)) continue
@@ -94,6 +99,12 @@ export function toMaterial(pack = {}, o = {}) {
94
99
  const text = String(c?.text ?? '').trim()
95
100
  if (text) quotes.push({ by: '评论', kind: 'comment', grade: GRADE.OPINION, text, like: Number(c?.like) || 0 })
96
101
  }
102
+ // 置顶评论(2026-11-13,issue #135):B 站单独放在 data.top 里,跟着一条标出来,
103
+ // 否则她读到的评论区和网页上看到的那组不是同一组。
104
+ for (const c of pack.pinned ?? []) {
105
+ const text = String(c?.text ?? '').trim()
106
+ if (text) quotes.push({ by: '评论', kind: 'pinned', grade: GRADE.OPINION, text, like: Number(c?.like) || 0 })
107
+ }
97
108
  for (const c of pack.disputes ?? []) {
98
109
  const text = String(c?.text ?? '').trim()
99
110
  if (text) quotes.push({ by: '评论', kind: 'dissent', grade: GRADE.OPINION, text, like: Number(c?.like) || 0 })
package/lib/note.js CHANGED
@@ -17,7 +17,10 @@
17
17
  * 「没日子的」不再只提一次,也不天天摆:记下满 7 天起,每次醒来最多提一张,
18
18
  * 提过就记 `nshow:<id> <dk>`,隔 7 天再提;划掉/放下就不再提(2026-11-12,用户 m01513)。
19
19
  * 到期的那几张照旧每次醒来都摆——有日子就有账可算。
20
- * update(改一句)暂不做:直接覆盖文本会把她改过什么抹掉,要做得先定好留痕的字段。
20
+ * 2026-11-14(用户 m00209):一件事做了一半,目标会变、也可能只剩最后一段。
21
+ * 所以便条现在能**改写那一句**(update,旧文本覆盖掉、只留 revisedAt 的时间痕迹),
22
+ * 也能**往同一张上记进展**(log,追加不覆盖)。进展落进 `progress` 数组,
23
+ * 醒来那行和回翻那行都只带最近一笔——她是看着这条路走到哪儿,不是看流水账。
21
24
  *
22
25
  * 三条硬约束(从 letter.js 沿下来的同一条线):
23
26
  * 1. **不审批**。记一张纸条不是改自己,不设关卡。
@@ -48,6 +51,15 @@ export const NOTE_SHOW_MAX = 5
48
51
  export const NOTE_LIST_MAX = 20
49
52
  /** list 能看的几类:open=还没关掉的,due=写了日子的,done/dropped=关掉的,all=全要。 */
50
53
  export const NOTE_FILTERS = ['open', 'due', 'done', 'dropped', 'all']
54
+ /**
55
+ * 一张便条最多留几笔进展(2026-11-14,用户 m00209)。
56
+ *
57
+ * 只留最近几笔:她说的是「这件事做到哪儿了」,不是要她把每天的日记抄进便条。
58
+ * 满了丢最旧的一笔——跨天的事靠**最近一笔**说明现在在哪,早期那些已经过去了。
59
+ */
60
+ export const NOTE_PROGRESS_MAX = 5
61
+ /** 一笔进展最多多少字。比正文短:一句进展是「做到哪」,不是「这件事是什么」。 */
62
+ export const NOTE_PROGRESS_TEXT_MAX = 120
51
63
 
52
64
  export function notesPath(root = rootDir()) {
53
65
  return join(root, NOTES_FILE)
@@ -82,9 +94,30 @@ export function normalizeNote(raw) {
82
94
  status,
83
95
  reason: raw.reason == null ? null : String(raw.reason).slice(0, 200),
84
96
  closedAt: raw.closedAt == null ? null : String(raw.closedAt),
85
- // 只有 update 会写;其余时候是 null。留着它,改过的痕迹至少还在时间上
97
+ // 只有 update / log 会写;其余时候是 null。留着它,动过的痕迹至少还在时间上
86
98
  revisedAt: raw.revisedAt == null ? null : String(raw.revisedAt),
99
+ // 进展:追加进去的几笔,每笔一句话 + 记下的时刻。坏项直接丢掉,不猜。
100
+ progress: normalizeProgress(raw.progress),
101
+ }
102
+ }
103
+
104
+ /** 进展数组的规整:只留形如 `{at, text}` 的,超出上限的砍最旧。 */
105
+ export function normalizeProgress(raw) {
106
+ const list = Array.isArray(raw) ? raw : []
107
+ const out = []
108
+ for (const p of list) {
109
+ if (!p || typeof p !== 'object') continue
110
+ const text = String(p.text ?? '').replace(/\s+/g, ' ').trim()
111
+ if (!text) continue
112
+ out.push({ at: String(p.at ?? '') || new Date().toISOString(), text: text.slice(0, NOTE_PROGRESS_TEXT_MAX) })
87
113
  }
114
+ return out.slice(-NOTE_PROGRESS_MAX)
115
+ }
116
+
117
+ /** 一张便条最近记下的那一笔进展(没有就是 null)。 */
118
+ export function lastProgress(n) {
119
+ const list = Array.isArray(n?.progress) ? n.progress : []
120
+ return list.length ? list[list.length - 1] : null
88
121
  }
89
122
 
90
123
  /** `YYYY-MM-DD` 且真是那一天(2026-02-30 不算)。 */
@@ -234,7 +267,11 @@ export function renderNotes(notes, now = new Date(), { seen = new Map() } = {})
234
267
  for (const n of shown) {
235
268
  const mmdd = `${n.due.slice(5, 7)}-${n.due.slice(8, 10)}`
236
269
  const tail = n.late === 0 ? '就是今天。' : `晚了${cnNum(n.late)}天。`
237
- lines.push(`${mmdd} ${n.text},${tail}`)
270
+ // 有进展的那张,把最近一笔缀在后面:她一眼看见的是「这十天走到哪儿」,
271
+ // 不是又从头读一遍这件事。只给最近一笔,不报条数(那是流水账,也是状态)。
272
+ const last = lastProgress(n)
273
+ const mark = last ? `(最近:${last.text})` : ''
274
+ lines.push(`${mmdd} ${n.text}${mark},${tail}`)
238
275
  }
239
276
  const rest = due.length - shown.length
240
277
  if (rest > 0) lines.push(`还有${cnCount(rest)}条没列出来,都在便条里。`)
@@ -364,7 +401,10 @@ function listLine(n) {
364
401
  const at = md(n.closedAt)
365
402
  return `✗ ${n.text}${at ? `(${at} 放下)` : ''}${n.reason ? `—— ${n.reason}` : ''}`
366
403
  }
367
- return n.due ? `${n.due.slice(5)} ${n.text}` : `(没日子)${n.text}`
404
+ // 翻到一张做了一半的:把最近一笔缀在后面,才看得出「它不是又摆回来了,是往前走了」。
405
+ const last = lastProgress(n)
406
+ const mark = last ? `(最近:${last.text})` : ''
407
+ return `${n.due ? `${n.due.slice(5)} ` : '(没日子)'}${n.text}${mark}`
368
408
  }
369
409
 
370
410
  /** 还没关掉的先按到期日(没日子的排最后),关掉的按关掉的时间倒序。 */
@@ -480,6 +520,45 @@ export async function updateNote(root, { id, text, newText, due } = {}) {
480
520
  }
481
521
  }
482
522
 
523
+ /**
524
+ * 在一张便条上记一笔进展(2026-11-14,用户 m00209)。永不抛。
525
+ *
526
+ * 跟 update 是两件事:update 改「这件事是什么」,progress 记「做到哪儿了」。
527
+ * 一件事做了一半发现目标变了——先用 update 把那一句改掉,之前记的进展原样留着:
528
+ * 路是她自己走过来的,新写法不该把走过的脚印擦掉。
529
+ *
530
+ * 只认没关掉的那张:划掉之后就没「进展」可言了,要接着做请重新记一张。
531
+ * @returns {Promise<{ok:boolean, id:string, note:string, echo?:string}>}
532
+ */
533
+ export async function logProgress(root, { id, text, progress } = {}) {
534
+ const key = String(id ?? '').trim()
535
+ const body = String(text ?? '').replace(/\s+/g, ' ').trim()
536
+ const said = String(progress ?? '').replace(/\s+/g, ' ').trim()
537
+ if (!key && !body) return { ok: false, id: '', note: '要往哪一张上记?把当时记的那句话告诉我。' }
538
+ if (!said) return { ok: false, id: '', note: '记下哪一句?做到哪儿了,一句话就行。' }
539
+ if (said.length > NOTE_PROGRESS_TEXT_MAX) {
540
+ return { ok: false, id: '', note: `一笔进展压到 ${NOTE_PROGRESS_TEXT_MAX} 字以内,说清做到哪儿就够。` }
541
+ }
542
+ try {
543
+ return await mutateNotes(root, async () => {
544
+ const notes = await readNotes(root)
545
+ const hit = locate(notes, { id: key, text: body })
546
+ if (!hit) {
547
+ return { ok: false, id: '', note: '便条里没有这一张。要和当时记的那句话一字不差。' }
548
+ }
549
+ if (hit.status === 'done') return { ok: false, id: '', note: '这张已经划掉了,记不上进展。要接着做就重新记一张。' }
550
+ if (hit.status === 'dropped') return { ok: false, id: '', note: '这张已经放下了,记不上进展。' }
551
+ const at = new Date().toISOString()
552
+ hit.progress = normalizeProgress([...(Array.isArray(hit.progress) ? hit.progress : []), { at, text: said }])
553
+ hit.revisedAt = at
554
+ await writeNotes(root, notes)
555
+ return { ok: true, id: hit.id, note: '记下了。', echo: `记下一笔:${said}` }
556
+ })
557
+ } catch (err) {
558
+ return { ok: false, id: '', note: '这会儿写不进去,等一下再试。' }
559
+ }
560
+ }
561
+
483
562
  /**
484
563
  * 放下(决定不做,并写一句为什么)。永不抛。
485
564
  *
@@ -519,7 +598,7 @@ export async function dropNote(root, { id, text, reason } = {}) {
519
598
  /** 这一次是哪件事。没写 action 的按老路走:status=done 或只给 id 是划掉,其余是记一张。 */
520
599
  export function noteAction(args = {}) {
521
600
  const a = String(args?.action ?? '').trim()
522
- if (['add', 'list', 'update', 'drop', 'done'].includes(a)) return a
601
+ if (['add', 'list', 'update', 'log', 'drop', 'done'].includes(a)) return a
523
602
  return isClosing(args) ? 'done' : 'add'
524
603
  }
525
604
 
@@ -535,16 +614,18 @@ export function registerNote(ctx, deps = {}) {
535
614
  defineTool({
536
615
  name: 'her_note',
537
616
  description:
538
- '醒来时摆在你最前面的那叠便条:记一张还没做的事、翻一翻有哪些、划掉做完的、或者放下决定不做的。' +
617
+ '醒来时摆在你最前面的那叠便条:记一张还没做的事、翻一翻有哪些、往一张上面记进展、改那一句、划掉做完的、或者放下决定不做的。' +
539
618
  '记的时候给 text(和日子 due,可以不给);划掉把当时记的那句话原样放进 text,再加 status:"done";' +
540
619
  '看便条有哪些给 action:"list"(filter 可以选 open / due / done / dropped / all,列不完用 offset 往后翻);' +
541
- '改一句给 action:"update"(text 指认原来那句,newText 写新的);' +
620
+ '一件事做了一半,给 action:"log":text 指认是哪一张,progress 写这一回做到哪儿了(只追一笔,不覆盖之前那些);' +
621
+ '事情本身变了(目标改了、只剩最后一段),给 action:"update":text 指认原来那句,newText 写新的;' +
542
622
  '放下给 action:"drop"(同样用 text 指认,reason 写一句为什么)。',
543
623
  parameters: toJsonSchema({
544
624
  action: {
545
625
  type: 'string',
546
- enum: ['add', 'list', 'update', 'drop', 'done'],
547
- description: '要做哪件事:记一张(add,不给就是这个)、翻便条(list)、改一句(update)、放下(drop)、划掉(done)。',
626
+ enum: ['add', 'list', 'update', 'log', 'drop', 'done'],
627
+ description:
628
+ '要做哪件事:记一张(add,不给就是这个)、翻便条(list)、记一笔进展(log)、改一句(update)、放下(drop)、划掉(done)。',
548
629
  },
549
630
  text: {
550
631
  type: 'string',
@@ -565,6 +646,10 @@ export function registerNote(ctx, deps = {}) {
565
646
  offset: { type: 'integer', description: 'list 时从第几张往后翻,默认从最前面。' },
566
647
  limit: { type: 'integer', description: 'list 时一次最多列几张,默认 20。' },
567
648
  newText: { type: 'string', description: 'update 时改成哪句话。' },
649
+ progress: {
650
+ type: 'string',
651
+ description: 'log 时这一回做到哪儿了,一句话(不超过 120 字)。只说这一步,别重述整件事。',
652
+ },
568
653
  reason: { type: 'string', description: 'drop 时为什么不做了,必填。' },
569
654
  }),
570
655
  output: {
@@ -590,6 +675,9 @@ export function registerNote(ctx, deps = {}) {
590
675
  if (act === 'update') {
591
676
  return [{ type: 'text', text: out.ok ? '[改好了]' : `[没改:${out.note}]` }]
592
677
  }
678
+ if (act === 'log') {
679
+ return [{ type: 'text', text: out.ok ? '[记下了]' : `[没记上:${out.note}]` }]
680
+ }
593
681
  if (act === 'drop') {
594
682
  return [{ type: 'text', text: out.ok ? '[放下了]' : `[没放下:${out.note}]` }]
595
683
  }
@@ -613,6 +701,9 @@ export function registerNote(ctx, deps = {}) {
613
701
  if (act === 'update') {
614
702
  return updateNote(root, { id: args?.id, text: args?.text, newText: args?.newText, due: args?.due })
615
703
  }
704
+ if (act === 'log') {
705
+ return logProgress(root, { id: args?.id, text: args?.text, progress: args?.progress })
706
+ }
616
707
  if (act === 'drop') {
617
708
  return dropNote(root, { id: args?.id, text: args?.text, reason: args?.reason })
618
709
  }