@ssamurias/dsh-fish 1.0.9 → 1.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.
@@ -0,0 +1,55 @@
1
+ # dsh-fish 1.1.0
2
+
3
+ 2026-11-24
4
+
5
+ 这一版只做一件事:**她开始有一份「认识的人」档案**。
6
+
7
+ 上一版她第一次能把判断挂到「谁」头上,但那份东西只活在一个位置——身份文档里一段四行,写的是你。这一版把它变成一张真的名单:认几个人、每个她写过什么、这个人说过什么、她拒绝过什么。**没有任何新采集**,材料全是上一版起事件流里已经有的「谁说的」,这一版只是第一次把它读成人。
8
+
9
+ ## 她知道谁了
10
+
11
+ - **判断能挂到别人身上**:三条判据任一命中就算「关于这个人的」——事件自己带 `who.id`;`topic` 命中一个已知的人名;`refs` 指到那个人的事件。三样都没写就**不挂人**:她自己没说是关于谁的,插件不替她认。
12
+ - **群里她说过的话不算判断**:那些是凭据(`uncommitted`),进不了这一层。凭据和判断分开,她才不会因为说过两句客套话就以为自己「了解」谁。
13
+ - **一个人身上记六样**:第一次见到、最近一次、她写下的判断、这个人说过的、她拒绝过的——**一个数字都不给**。没有「好感度」「亲密度」这类东西,这一版也没有加。
14
+ - **主人永远第一行**,其余按最近出现排。最多同时摆三个人——身份文档的余量只有六百多字,摆多了会把她别的东西挤掉。
15
+
16
+ ## 完整的那份在 `home/她认识的人.md`
17
+
18
+ 身份文档里只摆三个人、每人一行,想看清「她到底怎么看这个人」得有一份完整的。这份文件和你已经熟悉的 `她的身份.md` 是同一种东西:**从事件流重算出来的抄本,改它不会生效**,下一次重算就覆盖。
19
+
20
+ - 开关关着时,这份文档里只有你一个人——关掉「认识别人」,她的世界里就只有你。
21
+ - 内容没变就不写盘;写不出来只记日志,不影响身份文档。
22
+
23
+ ## 新工具 `her_people`
24
+
25
+ 她想细看谁,就翻这一页。参数只有名字(或名字里的几个字),**没有路径**——`../` 这种东西在这里没有入口。一次给一个人,太长的会截断。名单空着的时候她会看到一句实话:「你现在还没往谁名下写过什么」,而不是一个空白。
26
+
27
+ 读到的内容既不进身份文档,也不进她的回忆检索:那是她主动翻才看得到的东西,不是每轮都摆在眼前的。
28
+
29
+ ## 只给名字的人,现在也认得出
30
+
31
+ 桥递话时可能只给昵称、不给 id。上一版遇到这种情况会把这个人跳过——于是接桥的人打开名单永远只有你一个。现在改成:有 id 按 id,只有名字就按名字记住,并在那一页上明说一句「这个名字对上的可能不止一个人」。
32
+
33
+ 同时 `/say` 多了一个可选字段 `speakerId`(QQ 号之类的稳定 id)。给了就用它——名字会重、会改,id 不会。
34
+
35
+ ## 她也会数一数
36
+
37
+ 「记下来过几次」「其中几次在夜里」「跨了几天」——这三样现在会算出来,但**只在人物档案和 `her_people` 里摆,身份文档里一个字都不加**。那一段每轮都读,摆数字就成了仪表盘。
38
+
39
+ 而且有门槛:加起来不到 5 次、夜里不到 5 次、跨不到 7 天,就不说。「记了两次」写出来像统计,不像记得一个人。用词是「记下来过 N 次」——她只看得见被记下来的往来,看不见他在群里原本说了多少句。
40
+
41
+ ## 判断分给谁,也数一数
42
+
43
+ 判断现在分成两边:「你自己说过的话」只摆关于世界的,写到某个人名下的摆在身份段那一节。那一段最多摆三条——所以体检里多一行,把两边的实际条数对着上限摆出来。世界那条是 0 的时候它会直说「不是被挤掉,是还没有关于世界的」,省得以为是 bug。一条判断都没有时不摆这几个数。
44
+
45
+ ## 一件容易忽略的事:老账本还认得
46
+
47
+ 「谁说的」是上一版才开始写的。所以这一版特意留了一条兜底:老账本里一条 `who` 都没有的时候,那段「第一次说话」「你记着{T}说过的一句」照旧出现——升级不该让她少一段。
48
+
49
+ 这条兜底由人格快照逐字守着:和上一版比,14 个固定场景的产出**一个字都没变**。
50
+
51
+ ## 数字
52
+
53
+ - 测试:新增 27 条(`test/people.test.mjs` 14 条、`test/peopledoc.test.mjs` 4 条、`test/herpeople.test.mjs` 5 条、`test/health.test.mjs` 3 条),全量 **3273 pass / 0 fail**(226 个测试文件)。
54
+ - 工具面:家里能用的工具 16 → 17 件;工具说明书 2302 → 2357 字(上限 2400 没动)。
55
+ - 自动备份:核心清单加了 `home/她认识的人.md`。
package/lib/autobackup.js CHANGED
@@ -80,6 +80,10 @@ export const AUTO_SKIP = ['out/covers']
80
80
  const CORE_PATHS = [
81
81
  PRESSURE_OBSERVATIONS,
82
82
  'events.jsonl', 'config.json', 'diary', 'home.json', 'home/她的身份.md',
83
+ // 1.1.0(S3-b):她认识的人(派生抄本)。1.0.9 的注释要求「新增顶层状态文件时回来补一行」——
84
+ // 它不是真相源,但换机器恢复完如果少了它,`her_people` 要等下一次写事件才重新生成,
85
+ // 中间那段时间她翻不到自己写过的人。
86
+ 'home/她认识的人.md',
83
87
  'inbox-state.json', 'inbox.md', 'talk-recent.json', '说明.md',
84
88
  'avatar.png', 'avatar.jpg', 'avatar.webp', 'avatar.gif',
85
89
  // 顶层的小台账(都是她活着要用、丢了补不回来的东西)。不并进核心,选「仅核心」
@@ -312,6 +312,136 @@ window.__ModuleLoader__.load({
312
312
  // ---------------------------------------------------------------- 工具
313
313
  const esc = (s) => String(s == null ? '' : s)
314
314
 
315
+ // ---------------------------------------------------------------- 月历
316
+ // 「挑一个日子」的公共实现(2026-11-24,用户 m01923):数据页的「每日报告」和
317
+ // 上网页的「看过的视频」都要这一件东西。各写一份的话,灰格子、日期框、跨年翻月
318
+ // 这些细节迟早会走样成两套;而且用户在两处看到的应该是同一个操作。
319
+ //
320
+ // 判据沿用日报那一次的结论(NN/g 的日期输入建议):可选项过十个就不该再铺成一条
321
+ // 长列表,日历负责「看得见哪天有」,输入框负责「知道是哪天直接写」。
322
+ const CAL_WEEK = ['一', '二', '三', '四', '五', '六', '日']
323
+ const calMonthOf = (d) => String(d || '').slice(0, 7)
324
+ const calCell = {
325
+ width: '30px', height: '28px', padding: 0, lineHeight: '28px',
326
+ textAlign: 'center', fontVariantNumeric: 'tabular-nums',
327
+ }
328
+ function calShiftMonth(key, delta) {
329
+ const m = /^(\d{4})-(\d{2})$/.exec(String(key || ''))
330
+ if (!m) return ''
331
+ const t = new Date(Date.UTC(Number(m[1]), Number(m[2]) - 1 + delta, 1))
332
+ return `${t.getUTCFullYear()}-${String(t.getUTCMonth() + 1).padStart(2, '0')}`
333
+ }
334
+ function calMonthTitle(key) {
335
+ const m = /^(\d{4})-(\d{2})$/.exec(String(key || ''))
336
+ return m ? `${Number(m[1])} 年 ${Number(m[2])} 月` : ''
337
+ }
338
+ // 手打的日期先洗一遍:2026/9/3、2026.9.3、2026-9-3 都认;2 月 31 号不认。
339
+ function calReadDay(raw) {
340
+ const m = /^(\d{4})[-/.](\d{1,2})[-/.](\d{1,2})$/.exec(String(raw || '').trim())
341
+ if (!m) return ''
342
+ const y = Number(m[1]); const mo = Number(m[2]); const d = Number(m[3])
343
+ const t = new Date(Date.UTC(y, mo - 1, d))
344
+ if (t.getUTCFullYear() !== y || t.getUTCMonth() !== mo - 1 || t.getUTCDate() !== d) return ''
345
+ return `${m[1]}-${String(mo).padStart(2, '0')}-${String(d).padStart(2, '0')}`
346
+ }
347
+
348
+ /**
349
+ * 一块月历面板:日期框 + 翻月 + 「最近」 + 七列格子(周一起)。
350
+ *
351
+ * @param {object} o
352
+ * days 能点的那几天('YYYY-MM-DD',从新到旧)——不在里面的日子一律灰着
353
+ * month 现在摊开哪个月('YYYY-MM');空或非法时按 picked / days[0] 推
354
+ * picked 当前选中的那天(只用来标出来,没有就空着)
355
+ * setMonth 翻月用(受控:翻到哪个月由调用方记)
356
+ * onPick 点了有东西的那天
357
+ * busy / emptyTitle / haveTitle / inputTitle / prevTitle / nextTitle / recentTitle 文案
358
+ *
359
+ * 灰格子不是错,是「那天没有东西可看」——所以标题里要把原因说清,
360
+ * 别让人以为是加载失败(2026-11-24,用户 m01579 的原话就是「点了没提示」)。
361
+ */
362
+ function calPicker(o) {
363
+ const days = Array.isArray(o.days) ? o.days : []
364
+ const have = new Set(days)
365
+ const month = /^\d{4}-\d{2}$/.test(String(o.month || ''))
366
+ ? String(o.month)
367
+ : (calMonthOf(o.picked) || calMonthOf(days[0]))
368
+ const first = /^\d{4}-\d{2}$/.test(month)
369
+ ? new Date(Date.UTC(Number(month.slice(0, 4)), Number(month.slice(5, 7)) - 1, 1))
370
+ : null
371
+ const lead = first ? (first.getUTCDay() + 6) % 7 : 0
372
+ const total = first
373
+ ? new Date(Date.UTC(first.getUTCFullYear(), first.getUTCMonth() + 1, 0)).getUTCDate()
374
+ : 0
375
+ const cells = []
376
+ for (let i = 0; i < lead; i += 1) cells.push(h('span', { key: `pad${i}`, style: calCell }))
377
+ for (let d = 1; d <= total; d += 1) {
378
+ const key = `${month}-${String(d).padStart(2, '0')}`
379
+ if (!have.has(key)) {
380
+ cells.push(h('span', {
381
+ key,
382
+ className: 'dim',
383
+ title: o.emptyTitle,
384
+ style: { ...calCell, opacity: '.35', cursor: 'default' },
385
+ }, String(d)))
386
+ continue
387
+ }
388
+ cells.push(h('button', {
389
+ key,
390
+ disabled: o.busy,
391
+ title: o.haveTitle,
392
+ onClick: () => o.onPick(key),
393
+ style: key === o.picked
394
+ ? { ...calCell, borderColor: 'var(--dsw-alias-state-business-primary)' }
395
+ : calCell,
396
+ }, String(d)))
397
+ }
398
+ return h('div', {
399
+ style: {
400
+ display: 'inline-block', marginTop: '6px', padding: '8px 10px',
401
+ border: '1px solid rgba(128,128,128,.28)', borderRadius: '8px',
402
+ },
403
+ },
404
+ h('div', { className: 'row', style: { alignItems: 'center', flexWrap: 'wrap', gap: '6px' } },
405
+ h('input', {
406
+ // type=date 自带选择器和键盘:敲 20260903 或按年月日分段都能填。
407
+ // 用 defaultValue + key:一边打一边重渲染时别把输入抹掉。
408
+ // 2026-11-24(用户 m02329):key 里带上「现在摊开哪个月」,框里只显示属于这个月的选中日。
409
+ // 以前 key 只跟 picked 走,翻月之后框里还留着上个月的日期——
410
+ // 「框里写着 11-20、月历已经是 2027 年 1 月」,两套真源,看着像坏了。
411
+ key: `day-${month}-${o.picked}`,
412
+ type: 'date',
413
+ disabled: o.busy,
414
+ defaultValue: calMonthOf(o.picked) === month ? String(o.picked) : '',
415
+ min: days.length ? days[days.length - 1] : undefined,
416
+ max: days.length ? days[0] : undefined,
417
+ title: o.inputTitle,
418
+ onChange: (e) => {
419
+ const d = calReadDay(e.target.value)
420
+ if (!d) return
421
+ if (have.has(d)) o.onPick(d)
422
+ else {
423
+ // 写了一个没有东西的日子:跳到那个月,并让调用方说一句「那天没有」——
424
+ // 只跳月不说话,人会以为点了没反应(2026-11-24,用户 m02329)。
425
+ o.onMiss?.(d)
426
+ o.setMonth(calMonthOf(d))
427
+ }
428
+ },
429
+ style: { maxWidth: '170px' },
430
+ }),
431
+ h('button', { disabled: o.busy || !month, title: o.prevTitle, onClick: () => o.setMonth(calShiftMonth(month, -1)) }, '‹'),
432
+ h('span', { style: { minWidth: '86px', textAlign: 'center' } }, calMonthTitle(month)),
433
+ h('button', { disabled: o.busy || !month, title: o.nextTitle, onClick: () => o.setMonth(calShiftMonth(month, 1)) }, '›'),
434
+ h('button', { disabled: o.busy || !days.length, title: o.recentTitle, onClick: () => o.setMonth(calMonthOf(days[0])) }, '最近')),
435
+ h('div', {
436
+ style: {
437
+ display: 'grid', gridTemplateColumns: 'repeat(7, 30px)',
438
+ gap: '2px', marginTop: '6px', alignItems: 'center',
439
+ },
440
+ },
441
+ ...CAL_WEEK.map((w) => h('span', { key: w, className: 'dim', style: { ...calCell, height: '20px', lineHeight: '20px' } }, w)),
442
+ ...cells))
443
+ }
444
+
315
445
  /**
316
446
  * 把质量指标渲染成两位小数。
317
447
  *
@@ -27,7 +27,7 @@
27
27
  const [rotateAfter, setRotateAfter] = useState(120)
28
28
  // 换新会话时带几轮原话过去(0 = 不带)。默认 3(2026-11-17 用户 m04639)。
29
29
  const [carryTurns, setCarryTurns] = useState(3)
30
- const [docBudget, setDocBudget] = useState(2800)
30
+ const [docBudget, setDocBudget] = useState(3600)
31
31
  // 0.9.7 T1:身份段里摆不摆「你最近说过的几句话」(默认开)
32
32
  const [echoOn, setEchoOn] = useState(true)
33
33
  const [beliefsShown, setBeliefsShown] = useState(3)
@@ -285,6 +285,15 @@
285
285
  // 设置界面 2.0(2026-10-24):观看历史分页 + 报告默认收起
286
286
  const [histPage, setHistPage] = useState(0)
287
287
  const [showReport, setShowReport] = useState(false)
288
+ // 每日报告的日子入口(2026-11-24,用户 m01711):月历摊开没有、摊在哪一个月。
289
+ const [reportOpen, setReportOpen] = useState(false)
290
+ const [reportMonth, setReportMonth] = useState('')
291
+ // 看过的视频:搜索词 / 挑中的那一天 / 月历摊开没有 / 摊在哪个月
292
+ // (2026-11-24,用户 m01923:记录攒到几百条之后,「查多久」那一颗已经不够用了)
293
+ const [histQ, setHistQ] = useState('')
294
+ const [histPick, setHistPick] = useState('')
295
+ const [histOpen, setHistOpen] = useState(false)
296
+ const [histMonth, setHistMonth] = useState('')
288
297
  // 常见问题解答(2026-10-28 用户 m00416):改成就地展开,不再开新窗口(见 feedbackPage 前的注释)
289
298
  const [faq, setFaq] = useState(null)
290
299
  const [faqOpen, setFaqOpen] = useState(false)
@@ -553,21 +562,47 @@
553
562
  // 字幕一次读多少(2026-11-21,用户 m01746 / issue #155):'page' | 'whole'。
554
563
  // 只能加在 hook 列表末尾:test/client.test.mjs 按下标找 hook,往前挪会把别人错位。
555
564
  const [subRead, setSubRead] = useState('page')
565
+ // 日期 UI 的三处收尾(2026-11-24,用户 m02329):请求序号、筛选提示、取数中的忙态。
566
+ // 同样只加在末尾,hook 下标不能往前挪。
567
+ const reportSeq = useRef(0)
568
+ const [reportHint, setReportHint] = useState('')
569
+ const histSeq = useRef(0)
570
+ const histQRef = useRef('')
571
+ const histQTimer = useRef(null)
572
+ const [histBusy, setHistBusy] = useState(false)
573
+ const [histHint, setHistHint] = useState('')
556
574
 
557
575
  // 读一次「看过的视频」(issue #69)。回来时天数已经换了(在路上时用户又选了别的)就丢掉,
558
576
  // 别盖住新选的列表;当前这个天数没读到、列表里也不是这个天数的,就记下原因。
559
- const readHist = async (days) => {
577
+ // 2026-11-24(用户 m02329):搜索走后端,词也一起存;两件事都可能变,所以按序号判先后。
578
+ const readHist = async (days, q = '') => {
579
+ const seq = (histSeq.current += 1)
580
+ const word = String(q || '').trim()
581
+ setHistBusy(true)
560
582
  try {
561
- const r = await jget(`/history?days=${days}`)
562
- if (histDaysRef.current !== days) return
583
+ const r = await jget(`/history?days=${days}${word ? `&q=${encodeURIComponent(word)}` : ''}`)
584
+ if (seq !== histSeq.current) return
563
585
  histShown.current = days
586
+ histQRef.current = word
564
587
  setHist(r)
565
588
  setHistErr('')
566
589
  } catch (e) {
567
- if (histDaysRef.current === days && histShown.current !== days) setHistErr(e.message)
590
+ if (seq === histSeq.current && histShown.current !== days) setHistErr(e.message)
591
+ } finally {
592
+ if (seq === histSeq.current) setHistBusy(false)
568
593
  }
569
594
  }
570
595
 
596
+ // 打字不用每一下都发请求:停手 300ms 再搜(用户 m02329)。
597
+ const searchHist = (word) => {
598
+ histQRef.current = String(word || '')
599
+ if (histQTimer.current) clearTimeout(histQTimer.current)
600
+ histQTimer.current = setTimeout(() => {
601
+ histQTimer.current = null
602
+ void readHist(histDaysRef.current, histQRef.current)
603
+ }, 300)
604
+ }
605
+
571
606
  const load = useCallback(async () => {
572
607
  setErr('')
573
608
  // 重新读盘之后要重新记基线(撤销 / 刷新都走这里)。
@@ -753,7 +788,7 @@
753
788
  setToolsAllowText((cfg.tools?.allow ?? []).join(', '))
754
789
  setToolsAllowSaved(Array.isArray(cfg.tools?.allow) ? cfg.tools.allow.map(String) : [])
755
790
  setToolsRestrict(cfg.tools?.restrict !== false)
756
- setDocBudget(Number(cfg.memory?.docBudget ?? 2800))
791
+ setDocBudget(Number(cfg.memory?.docBudget ?? 3600))
757
792
  setBeliefsShown(Number(cfg.memory?.beliefsShown ?? 3))
758
793
  setHearEvery(Number(cfg.memory?.hearEvery ?? 3))
759
794
  setGrowthDaysUi(Number(cfg.growthDays ?? 30))
@@ -839,10 +874,16 @@
839
874
  setHistDays(days)
840
875
  setHistPage(0)
841
876
  setHistErr('')
877
+ // 换了查询范围,原来挑的那一天多半已经不在这段记录里了:一起清掉,
878
+ // 不然会停在「对上的 0 条」上,还以为是搜坏了(2026-11-24,用户 m02329 的第 1 条)。
879
+ setHistPick('')
880
+ setHistOpen(false)
881
+ setHistHint('')
882
+ if (histQTimer.current) { clearTimeout(histQTimer.current); histQTimer.current = null }
842
883
  storeHistDays(days)
843
884
  // 先选 90 再选 7,90 那次晚到时下拉框是 7、列表却是 90 天的:readHist 对不上就丢掉(issue #69)。
844
885
  // 只读卡片,失败不打断别处,只在这张卡里说没读到。
845
- await readHist(days)
886
+ await readHist(days, histQRef.current)
846
887
  }, [])
847
888
 
848
889
  // 在线状态每 30 秒刷一次;页面在后台就不轮询(省电,也不制造无谓请求)。
@@ -394,7 +394,7 @@
394
394
  // 导出报告:纯前端拼一个 markdown 文件下载,不新开任何服务端路由。
395
395
  const downloadReport = () => {
396
396
  const md = reports?.md || ''
397
- if (!md) { setNote('这一天的报告正文还没取到,没有可导出的。点一下上面那天的日期再取一次。'); return }
397
+ if (!md) { setNote('这一天的报告正文还没取到,没有可导出的。点一下那天的日期,取来之后再导。'); return }
398
398
  if (typeof document === 'undefined' || typeof Blob === 'undefined') { setNote('这个环境不支持下载。'); return }
399
399
  try {
400
400
  const blob = new Blob([md], { type: 'text/markdown;charset=utf-8' })
@@ -247,9 +247,19 @@
247
247
  const histFlat = (hist?.groups || []).flatMap((g) =>
248
248
  (g.items || []).map((it) => ({ ...it, date: g.date })))
249
249
  const histDayCount = (hist?.groups || []).length
250
+ // 搜索 + 挑一天(2026-11-24,用户 m01923;当晚按 m02329 收到服务端):
251
+ // 记录攒到几百条之后,只有「查多久」一颗不够用——想找「那个讲 XX 的视频」、想找「上周三看的」
252
+ // 都得自己一页页翻。词交回服务端筛(/history?q=,见 lib/history.js),这样 365 天全量也不用
253
+ // 先把七万条发到浏览器再丢掉;日子仍然在客户端挑,它只是「列表里有的那几天」。
254
+ const histDates = (hist?.groups || []).map((g) => g.date)
255
+ const histFound = histPick ? histFlat.filter((it) => it.date === histPick) : histFlat
256
+ const histFiltered = Boolean(histPick) || Boolean(String(histQ || '').trim())
257
+ // 「这段一共几条」用服务端报的 total(它数的是真账本,筛完之后也是它数);
258
+ // 手上这份是逐条摊平的,没筛时两者应当一致,不一致就取大的那个,别少报。
259
+ const histAll = histErr ? 0 : Math.max(histFlat.length, Number(hist?.total) || 0)
250
260
  // 当前选的天数没读到(histErr):手上那份不是这个天数的,翻页条也不出(列表本身见下面的 histErr)
251
- const histTotal = histErr ? 0 : histFlat.length
252
- const histPerDay = histDayCount ? histTotal / histDayCount : 0
261
+ const histTotal = histErr ? 0 : histFound.length
262
+ const histPerDay = histDayCount ? histFlat.length / histDayCount : 0
253
263
  const histPageSize = histTotal === 0 ? HIST_PAGE_MAX
254
264
  : histTotal <= 8 ? histTotal
255
265
  : histPerDay > 20 ? 6
@@ -258,13 +268,14 @@
258
268
  : HIST_PAGE_MAX
259
269
  const histPages = Math.max(1, Math.ceil(histTotal / histPageSize))
260
270
  const histAt = Math.min(histPage, histPages - 1)
261
- const histSlice = histFlat.slice(histAt * histPageSize, histAt * histPageSize + histPageSize)
271
+ const histSlice = histFound.slice(histAt * histPageSize, histAt * histPageSize + histPageSize)
262
272
  const histPager = histPages > 1
263
273
  ? h('div', { className: 'row' },
264
274
  h('button', { disabled: histAt <= 0, onClick: () => setHistPage(histAt - 1) }, '较新'),
265
275
  h('span', { className: 'dim' }, `第 ${histAt + 1} / ${histPages} 页 · 一页 ${histPageSize} 条`),
266
276
  h('button', { disabled: histAt >= histPages - 1, onClick: () => setHistPage(histAt + 1) }, '更早'))
267
277
  : null
278
+ const histHow = (how) => (how === 'watch' ? '看过画面' : how === 'look' ? '点开读过' : '只是翻到过')
268
279
 
269
280
  const biliPage = h('div', { className: 'page' },
270
281
  // 第二个参数是这一组的说明(note),控件从第三个起。0.9.5 把装控件的 grid2 填进了 note 位,
@@ -471,22 +482,80 @@
471
482
 
472
483
  // ---- 以前看了什么(视频观看历史,分页) ----
473
484
  groupFull('看过的视频',
474
- // 其余那部分有 look:(她自己点开的)和 browse:(自动逛和以前刷站记的),不只是旧版(issue #69)
475
- S('按天从近到远,点标题打开原视频;标「看过画面」的是抽帧看过的,其余是她自己点开的,或者自动逛时翻到的。'),
476
- h('div', { className: 'grid2', style: { marginBottom: '10px' } },
485
+ // 三种关系分开说(2026-11-24,用户 m01923):以前只剩「看过画面」一种标,
486
+ // 另外两类(她自己点开读过、自动逛时只是翻到过)在列表里长得一样,只能猜。
487
+ S('按天从近到远,点标题打开原视频。「看过画面」是抽帧看过的,「点开读过」是她自己点开的,「只是翻到过」是自动逛时翻到的。'),
488
+ h('div', { className: 'grid2', style: { marginBottom: '6px' } },
489
+ Text({ label: '找一条', value: histQ,
490
+ onChange: (v) => { setHistQ(v); setHistPage(0); searchHist(v) },
491
+ placeholder: '标题 / UP 名 / BV 号',
492
+ hint: '在整段记录里找;空格分开的每个词都要对上。' }),
477
493
  Sel({ label: '查多久的记录', value: histDays,
478
494
  onChange: pickHistDays,
479
495
  options: HIST_DAYS_OPTIONS,
480
496
  fmt: (v) => `${v} 个有记录的日子`,
481
497
  hint: '按有记录的日子数,不按日历:没上网的日子不占数。只是查询范围,不会删记录;改完立刻重列,下次打开还记得。' })),
482
- h('div', { className: 'row', style: { marginBottom: '8px' } },
483
- h('span', { className: 'dim' }, histErr ? '没读到' : `共 ${histDayCount} 天 · ${hist?.total ?? 0} 条`),
484
- histPager),
498
+ // 一份记录都没有的时候不摆「挑一天」:点开是一屏全灰的月历(第 4 条)。
499
+ histDates.length ? h('div', { className: 'row', style: { alignItems: 'center', flexWrap: 'wrap', marginBottom: '8px' } },
500
+ h('button', {
501
+ disabled: histBusy,
502
+ onClick: () => {
503
+ setHistOpen(!histOpen)
504
+ if (!histOpen) setHistMonth(calMonthOf(histPick || histDates[0]))
505
+ setHistPage(0)
506
+ },
507
+ }, histOpen ? '收起日子' : '挑一天'),
508
+ histPick ? h('span', { className: 'tag' }, `只看 ${histPick}`) : null,
509
+ histFiltered
510
+ ? h('button', {
511
+ onClick: () => {
512
+ // 清筛选也要把服务端那份重读回来:词是在后端筛的,光清本地状态列表还是空的。
513
+ if (histQTimer.current) { clearTimeout(histQTimer.current); histQTimer.current = null }
514
+ histQRef.current = ''
515
+ setHistQ('')
516
+ setHistPick('')
517
+ setHistOpen(false)
518
+ setHistHint('')
519
+ setHistPage(0)
520
+ void readHist(histDaysRef.current, '')
521
+ },
522
+ }, '清掉筛选')
523
+ : null,
524
+ h('span', { className: 'dim' }, histErr ? '没读到'
525
+ : histBusy ? '正在读…'
526
+ : histFiltered
527
+ ? `共 ${histDayCount} 天 · 对上的 ${histTotal} 条 / 这段一共 ${histAll} 条`
528
+ : `共 ${histDayCount} 天 · ${histAll} 条`)) : null,
529
+ // 取数期间、手写的日子没有记录时,都要有一句人话(第 5 条)。
530
+ histHint ? h('p', { className: 'hint' }, histHint) : null,
531
+ // 挑日子用和数据页同一块月历(calPicker,见 00-shell.js):
532
+ // 有记录的那天能点,没有的灰着——灰格子不是加载失败,是那天没上网。
533
+ histOpen && histDates.length
534
+ ? calPicker({
535
+ days: histDates,
536
+ month: histMonth,
537
+ picked: histPick,
538
+ busy: histBusy,
539
+ setMonth: setHistMonth,
540
+ onPick: (d) => { setHistPick(d); setHistOpen(false); setHistPage(0) },
541
+ onMiss: (d) => setHistHint(`${d} 这一天没有记录(那天没上网)。`),
542
+ emptyTitle: S('这一天没有记录——没上网就没有这一条。'),
543
+ haveTitle: S('这一天有记录,点开只看这天的。'),
544
+ inputTitle: S('知道哪天就写上,比如 2026-11-20。'),
545
+ prevTitle: S('往前一个月。'),
546
+ nextTitle: S('往后一个月。'),
547
+ recentTitle: S('回到最近有记录的那个月。'),
548
+ })
549
+ : null,
485
550
  // 当前选的天数没读到(histErr):手上那份不是这个天数的,一条都不摆
486
- histErr || !histFlat.length
551
+ histErr || !histFlat.length || !histFound.length
487
552
  ? h('p', { className: 'empty' }, histErr
488
553
  ? `这段时间的记录没读到,不是没有记录。换个天数,或者过一会儿再选一次。(${histErr})`
489
- : '还没有记录。')
554
+ : String(histQ || '').trim() && !histFound.length
555
+ ? '这段记录里没有对得上的——换个词,或者把日子放宽一点。'
556
+ : histPick
557
+ ? `这一天没有记录(${histPick})。把日子放宽,或者清掉筛选。`
558
+ : (histBusy ? '正在读…' : '还没有记录。'))
490
559
  : h('div', null, histSlice.map((it, i) => h('div', {
491
560
  // 列表按时间从新到旧摊平;换天时插一条日期标签(一页 12 条,不是一天一页)
492
561
  key: `${it.date}|${it.bvid}|${i}`,
@@ -511,9 +580,8 @@
511
580
  }),
512
581
  // 2026-10-30:真的抽帧看过画面的那几条要能一眼认出来,
513
582
  // 否则它跟"只扫了眼标题"在列表里长得一样(客户反馈的原点)。
514
- it.how === 'watch'
515
- ? h('span', { className: 'tag', style: { flex: '0 0 auto' } }, '看过画面')
516
- : h('span', { style: { flex: '0 0 auto', width: '0' } }),
583
+ // 2026-11-24(用户 m01923):三类分开标,「看过画面」不再吃掉另两类的区别。
584
+ h('span', { className: 'tag', style: { flex: '0 0 auto' } }, histHow(it.how)),
517
585
  h('a', {
518
586
  href: it.url,
519
587
  target: '_blank',
@@ -50,7 +50,7 @@
50
50
  },
51
51
  hint: S('只影响换窗口后的第一轮:最后 1 轮不裁剪,再往前每轮 40 字;页面上限随轮数放大(400–1200 字)。带得越多,第一轮越贵,也越容易接着旧话题说。0 = 不带原话,只带还挂着的事;更早的事用 her_recall 翻。') }),
52
52
  Num({ label: '身份段字数', value: docBudget, onChange: setDocBudget, min: 1800, max: 8000, step: 100, unit: '字',
53
- hint: S('她每轮读到的身份段最多多少字;超了先省次要段。范围 1800–8000:1800 以下装不下现在已经有的段,8000 以上每轮都在为这段文字付钱。') }))),
53
+ hint: S('她每轮读到的身份段最多多少字;超了先省次要段。现在默认 3600:加进「你认识的{T}」之后,把认识的人摆满再叠上日常长的判断,实测要 3437 字才一段不丢(2800 会先丢「你对自己的说法」和「更早以前」——那两段正是"她是什么样的人"的材料)。3600 = 3437 + 一点余量给之后还会长的一两句。范围 1800–8000:1800 以下装不下现在已经有的段,8000 以上每轮都在为这段文字付钱。') }))),
54
54
 
55
55
  // 会话压力不再放在设置页(2026-11-17,用户 m02888):挪到对话页的「压力」页签 + 头部小胶囊。
56
56
 
@@ -89,6 +89,18 @@
89
89
  })),
90
90
  h('span', { className: 'dim' },
91
91
  `${mem.selfDoc?.chars ?? 0} / ${mem.selfDoc?.budget ?? 0} 字`)),
92
+ // 2026-11-24(用户 m06175):光有上面那条用量,看不出「为什么这段不见了、
93
+ // 下次会先丢什么」。这里把放不下时的次序直接写出来——真身是
94
+ // lib/persona.js 的 OPTIONAL_ORDER(只排可选段,核心段位置不动),
95
+ // 改那边的时候记得回来对一遍。
96
+ h('div', { style: { fontSize: '12px', lineHeight: '1.8', marginTop: '8px', opacity: 0.85 } },
97
+ h('div', null, '放不下时按这个次序一段一段往里放,先放前面的;轮到哪一段放不下,先换短版,短版也放不下才整段撤掉(字数额够了它会自己回来):'),
98
+ h('div', { className: 'dim', style: { marginTop: '2px' } },
99
+ S('1 最近说过的几句话 → 2 你自己说过的话 → 3 两句话对不上 → 4 说法变过 → 5 没定的事 → 6 你拒绝过 → 7 你被打脸过 → 8 你对自己的说法 → 9 你读到的一句话 → 10 你反复想起过的事 → 11 她曾想让你改掉她 → 12 有些事你想不起来了 → 13 更早以前')),
100
+ h('div', { className: 'dim', style: { marginTop: '2px' } },
101
+ S('排在这份名单前面的几段永远都在(她是谁、现在、不能做的、认识的人那一节、你说的事和她的判断),字数再紧也不挤掉。')),
102
+ h('div', { className: 'dim', style: { marginTop: '2px' } },
103
+ S('其中「你自己说过的话」每轮只逐条摆最显著的几条,再往前的折成一行,更早的只剩一句「还有 N 条」——原文一直都在,她能按关键词捞回来。'))),
92
104
  h('div', { style: { fontSize: '12px', lineHeight: '1.9', marginTop: '8px', opacity: 0.85 } },
93
105
  // 2026-11-23(外部报告):这一段是可选段,字数不够时会被整段挤掉。
94
106
  // 以前不管有没有挤掉都按设置报「最显著的 N 条在眼前」,面板和她真读到的对不上;
@@ -186,6 +198,17 @@
186
198
  ? [h('div', null,
187
199
  `· 同一个人的说法变过 ${health.people.drifts ?? 0} 处,一直没定 ${health.people.unsettled ?? 0} 处`)]
188
200
  : []),
201
+ // 1.1.0 收尾(用户 m04951):人判断会不会把世界判断挤没。
202
+ // 「你自己说过的话」只摆关于世界的判断,关于人的摆在身份段那一节——两边都摆数,
203
+ // 谁被挤了才看得见。上限由后端一起给,界面不写死。
204
+ ...(health.beliefView
205
+ ? [h('div', { title: S('「你自己说过的话」那一段只摆关于世界的判断;写到某个人名下的,摆在身份段「你认识的人」那一节。那一段最多摆几条是固定的。') },
206
+ `· 判断分给谁:写到人身上 ${health.beliefView.person} 条,关于世界 ${health.beliefView.world} 条(这一段摆出来 ${health.beliefView.shown} 条,最多 ${health.beliefView.max} 条)`)]
207
+ : []),
208
+ ...(health.beliefView && health.beliefView.world === 0 && health.beliefView.person > 0
209
+ ? [h('div', { className: 'dim' },
210
+ S(` 「你自己说过的话」这一段现在是空的:${SELF_SHE}的判断全都写在人身上了。不是被挤掉,是还没有关于世界的。`))]
211
+ : []),
189
212
  health.empty
190
213
  ? h('p', { className: 'dim', style: { margin: '4px 0 0' } }, S('还太早:等她说出第一条判断,这里才有东西可看。'))
191
214
  : null,
@@ -688,7 +688,7 @@
688
688
  : '0 = 不开。填一个没人用的端口(比如 17888)就开;只有本机连得进来。',
689
689
  }), bridgePort > 0
690
690
  ? h('p', { className: 'hint', style: { margin: 0 } },
691
- '投递的写法:POST JSON 到 /say,正文 {"text":"要说的话"};可选 scene、channel、room、speaker、guest、owner、image。'
691
+ '投递的写法:POST JSON 到 /say,正文 {"text":"要说的话"};可选 scene、channel、room、speaker、speakerId、guest、owner、image。'
692
692
  + '不传 scene 就是私聊、进家里那条会话。')
693
693
  : null)
694
694