@ssamurias/dsh-fish 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +12 -6
- package/CHANGELOG.md +98 -0
- package/README.md +28 -3
- package/RELEASE-NOTES-1.1.4.md +87 -0
- package/docs//350/256/244/344/272/272/345/210/244/346/215/256.md +4 -1
- package/lib/absence.js +1 -1
- package/lib/ask.js +3 -3
- package/lib/backup.js +44 -1
- package/lib/basis.js +85 -0
- package/lib/capture.js +16 -2
- package/lib/claim.js +35 -0
- package/lib/client/01-state-load.js +15 -0
- package/lib/client/04-pressure-lab.js +15 -0
- package/lib/client/09-tab-outing.js +88 -1
- package/lib/client/11-tab-data-frame.js +2 -0
- package/lib/client/12-pressure-chip-mount.js +14 -0
- package/lib/client.js +134 -1
- package/lib/comment.js +824 -823
- package/lib/compactionlog.js +181 -0
- package/lib/derive.js +287 -47
- package/lib/dream.js +1 -1
- package/lib/firstwake.js +6 -3
- package/lib/generator.js +4 -0
- package/lib/handoff.js +65 -8
- package/lib/health.js +4 -1
- package/lib/hear.js +15 -4
- package/lib/herpeople.js +28 -14
- package/lib/herperson.js +126 -31
- package/lib/identity.js +11 -3
- package/lib/index.js +17 -2
- package/lib/letter.js +1 -1
- package/lib/match.js +3 -1
- package/lib/memorymap.js +3 -1
- package/lib/notice.js +60 -0
- package/lib/observe-bili.js +1 -1
- package/lib/observe-home.js +1 -1
- package/lib/observe-http.js +20 -1
- package/lib/observe-state.js +22 -3
- package/lib/observe-trip.js +1 -1
- package/lib/people.js +60 -13
- package/lib/peopledoc.js +1 -1
- package/lib/person.js +13 -1
- package/lib/persona.js +34 -24
- package/lib/proactive.js +1 -1
- package/lib/pronounask.js +2 -2
- package/lib/recall.js +267 -17
- package/lib/say.js +35 -3
- package/lib/scheduler.js +107 -22
- package/lib/schema.js +54 -5
- package/lib/selfdoc.js +10 -3
- package/lib/session-pressure-analysis.js +24 -4
- package/lib/session-pressure-data.js +5 -0
- package/lib/session-pressure.js +32 -6
- package/lib/settings.js +3 -2
- package/lib/sleepfact.js +9 -3
- package/lib/stance.js +56 -19
- package/lib/store.js +53 -5
- package/lib/talkmem.js +151 -21
- package/lib/turnexport.js +34 -5
- package/lib/turns.js +46 -6
- package/lib/types.d.ts +2 -1
- package/lib/unclaimed.js +102 -0
- package/lib/whatseen.js +17 -0
- package/lib/wiki.js +86 -1
- package/package.json +1 -1
package/lib/handoff.js
CHANGED
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
import { readFileSync } from 'node:fs'
|
|
19
19
|
import { join } from 'node:path'
|
|
20
20
|
|
|
21
|
-
import { paths } from './store.js'
|
|
21
|
+
import { paths, readEvents } from './store.js'
|
|
22
|
+
import { deriveSelf } from './derive.js'
|
|
23
|
+
import { worksForDesk } from './works.js'
|
|
22
24
|
import { readNotes } from './note.js'
|
|
23
25
|
import { readAppointments } from './appoint.js'
|
|
24
26
|
import { recentExchanges } from './talkmem.js'
|
|
@@ -26,16 +28,20 @@ import { fillOwner } from './pronoun.js'
|
|
|
26
28
|
import { clipText } from './clip.js'
|
|
27
29
|
|
|
28
30
|
/** 默认一页最多多少字(带 3 轮时)。超了就截——它不是档案,是「刚才」。 */
|
|
29
|
-
export const HANDOFF_LIMIT =
|
|
31
|
+
export const HANDOFF_LIMIT = 540
|
|
30
32
|
/** 不管设置带多少轮,一页最多这么多字。 */
|
|
31
|
-
export const HANDOFF_LIMIT_MAX =
|
|
33
|
+
export const HANDOFF_LIMIT_MAX = 1340
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
36
|
* 设置里的「带几轮原话」= 实际摆几轮(2026-11-17,用户 m04639 定案 A+C)。
|
|
35
37
|
*
|
|
36
38
|
* 以前固定「最后 1 轮 + 再往前 2 轮」,`chat.carry` 只决定读几轮,不决定摆几轮;
|
|
37
39
|
* 用户调了看不出变化。现在让它真的生效:轮数越多,页面上限按每轮 80 字放大,
|
|
38
|
-
*
|
|
40
|
+
* 但有硬顶,避免有人拉到 20 轮把第一轮撑爆。
|
|
41
|
+
*
|
|
42
|
+
* 2026-11-28(外部报告 P0-2,用户选 B):整页上限抬 140 字,让「上次停下的时候」
|
|
43
|
+
* 那三样(手上的活 / 最近一句判断 / 欠谁一句答话)进得来。理由是这三样比多带
|
|
44
|
+
* 一轮原话值钱——原话是语气,这三样是「我正做到哪」。
|
|
39
45
|
*/
|
|
40
46
|
export function handoffLimit(carry = 3) {
|
|
41
47
|
const n = Math.max(0, Math.min(20, Math.trunc(Number(carry) || 0)))
|
|
@@ -47,6 +53,10 @@ const NOTES_MAX = 2
|
|
|
47
53
|
const APPOINTS_MAX = 1
|
|
48
54
|
/** 每条摆多长。 */
|
|
49
55
|
const OPEN_TEXT_MAX = 40
|
|
56
|
+
/** 「上次停下的时候」那三样(2026-11-28,外部报告 P0-2):每样摆多长。 */
|
|
57
|
+
const WIP_TITLE_MAX = 24
|
|
58
|
+
const BELIEF_TEXT_MAX = 40
|
|
59
|
+
const ASK_TEXT_MAX = 40
|
|
50
60
|
|
|
51
61
|
// 「这一次该不该出现」是内存里的一个开关,不落盘:
|
|
52
62
|
// 落盘就要考虑「重启之后还算不算这一次」,而它本来就只活在这一轮里。
|
|
@@ -156,12 +166,15 @@ function dueOf(due) {
|
|
|
156
166
|
* @param {Array<{at?: string, me?: string, her?: string}>} o.exchanges 按时间先后
|
|
157
167
|
* @param {Array<object>} o.notes 便条
|
|
158
168
|
* @param {Array<object>} o.appointments 约定
|
|
169
|
+
* @param {{wip?: {title?: string, stale?: boolean}|null}} [o.works] 手上的活(worksForDesk 的返回)
|
|
170
|
+
* @param {{text?: string, since?: string, verdict?: string}|null} [o.belief] 最近写过的一句判断
|
|
171
|
+
* @param {Array<{text?: string}>} [o.asks] 还欠着的答话(pendingAsks 的返回)
|
|
159
172
|
* @param {string} [o.room] 换到了哪儿(群里 / 书房),空就不写
|
|
160
173
|
* @param {number} [o.now]
|
|
161
174
|
* @param {number} [o.carry] 设置里带几轮原话(0 = 只带还挂着的事)
|
|
162
175
|
* @returns {string}
|
|
163
176
|
*/
|
|
164
|
-
export function renderHandoff({ exchanges = [], notes = [], appointments = [], room = '', now = Date.now(), carry = 3 } = {}) {
|
|
177
|
+
export function renderHandoff({ exchanges = [], notes = [], appointments = [], works = null, belief = null, asks = [], room = '', now = Date.now(), carry = 3 } = {}) {
|
|
165
178
|
const want = Math.max(0, Math.min(20, Math.trunc(Number(carry) || 0)))
|
|
166
179
|
const rows = (Array.isArray(exchanges) ? exchanges : []).filter((e) => e && (e.me || e.her))
|
|
167
180
|
const parts = []
|
|
@@ -178,7 +191,27 @@ export function renderHandoff({ exchanges = [], notes = [], appointments = [], r
|
|
|
178
191
|
}
|
|
179
192
|
}
|
|
180
193
|
|
|
181
|
-
// 2)
|
|
194
|
+
// 2) 上次停下的时候(2026-11-28,外部报告 P0-2):手上的活、最近一句判断、
|
|
195
|
+
// 还欠着谁的答话。这三样和「最后两句」不一样——那两句是语气,这三样是位置。
|
|
196
|
+
// 换间屋子最难受的不是忘了刚说过什么,是不知道自己正做到哪。
|
|
197
|
+
// 空的那一样整行不出现,不写「手上什么也没有」这种空话。
|
|
198
|
+
const place = []
|
|
199
|
+
const wip = works?.wip
|
|
200
|
+
if (wip?.title) {
|
|
201
|
+
place.push(`- 你手上那件《${clipText(String(wip.title), WIP_TITLE_MAX, '…')}》${wip.stale ? '有些天没动了' : '还没弄完'}`)
|
|
202
|
+
}
|
|
203
|
+
if (belief && String(belief.text ?? '').trim()) {
|
|
204
|
+
const since = Date.parse(String(belief.since ?? ''))
|
|
205
|
+
const at = Number.isFinite(since) ? `${new Date(since).getMonth() + 1} 月 ${new Date(since).getDate()} 日` : ''
|
|
206
|
+
place.push(`- 你${at ? ` ${at}` : '最近'}写过一句:「${clipText(String(belief.text), BELIEF_TEXT_MAX, '…')}」`)
|
|
207
|
+
}
|
|
208
|
+
const openAsks = (Array.isArray(asks) ? asks : []).filter((a) => String(a?.text ?? '').trim())
|
|
209
|
+
if (openAsks.length) {
|
|
210
|
+
place.push(`- 你还欠{T}一句答话:「${clipText(String(openAsks[0].text), ASK_TEXT_MAX, '…')}」`)
|
|
211
|
+
}
|
|
212
|
+
if (place.length) parts.push(['上次停下的时候:', ...place].join('\n'))
|
|
213
|
+
|
|
214
|
+
// 3) 还挂着的事:写内容,不写「你还有 N 条」——那是催办,note.js / appoint.js
|
|
182
215
|
// 从第一天起就把它当硬约束禁掉了。
|
|
183
216
|
const hanging = []
|
|
184
217
|
const openNotes = (Array.isArray(notes) ? notes : [])
|
|
@@ -214,7 +247,10 @@ export function renderHandoff({ exchanges = [], notes = [], appointments = [], r
|
|
|
214
247
|
const head2 = room ? [`## 上次停在这(${room})`] : ['## 上次停在这']
|
|
215
248
|
const text = [
|
|
216
249
|
...head2,
|
|
217
|
-
|
|
250
|
+
// 2026-11-28(P0-2):以前这里写「下面都是原话,没有替你总结」。
|
|
251
|
+
// 现在多了「上次停下的时候」那三样——手上的活、最近一句判断、欠谁的答话,
|
|
252
|
+
// 它们是从账上摘的,不是原话。那句不能再照原样说了,否则等于跟她说谎。
|
|
253
|
+
'(这些是你换窗口之前的事。原话照抄,另外三样是从你账上摘的,没有替你总结。)',
|
|
218
254
|
'',
|
|
219
255
|
...(room ? [`这次换到了${room}。`] : []),
|
|
220
256
|
...parts.flatMap((p, i) => (i ? ['', p] : [p])),
|
|
@@ -234,5 +270,26 @@ export async function buildHandoff(root, { turns = 3, room = '' } = {}) {
|
|
|
234
270
|
const exchanges = want > 0 ? await recentExchanges(root, want).catch(() => []) : []
|
|
235
271
|
const notes = await readNotes(root).catch(() => [])
|
|
236
272
|
const appointments = await readAppointments(root).catch(() => [])
|
|
237
|
-
|
|
273
|
+
const works = await worksForDesk(root).catch(() => ({ wip: null }))
|
|
274
|
+
|
|
275
|
+
// 最近一句判断、还欠着的答话:都从事件流里现算。
|
|
276
|
+
// 读不出来就当没有——少两行,不该让整页交接跟着塌。
|
|
277
|
+
let belief = null
|
|
278
|
+
let asks = []
|
|
279
|
+
try {
|
|
280
|
+
const { events } = await readEvents(root)
|
|
281
|
+
const model = deriveSelf(events, {}, root)
|
|
282
|
+
// `model.beliefs` 是按「够不够格」排的(solid、被提起的次数),不是按时间——
|
|
283
|
+
// 拿 [0] 当「最近一条」会把一句很早的老判断摆成这一轮刚写的。这里按 since 取最新。
|
|
284
|
+
belief = [...(model?.beliefs ?? [])]
|
|
285
|
+
.sort((a, b) => (Date.parse(String(b?.since ?? '')) || 0) - (Date.parse(String(a?.since ?? '')) || 0))[0] ?? null
|
|
286
|
+
// ask.js 经 askinchat → identity → 这里绕回来一圈,静态 import 会在加载时就成环,
|
|
287
|
+
// 所以按本仓库惯用的做法延后取(home.js / pronounask.js 也是这么绕的)。
|
|
288
|
+
const { pendingAsks } = await import('./ask.js')
|
|
289
|
+
asks = pendingAsks(events, Date.now())
|
|
290
|
+
} catch {
|
|
291
|
+
/* 算不出来就只少这两样 */
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return renderHandoff({ exchanges, notes, appointments, works, belief, asks, room, carry: want })
|
|
238
295
|
}
|
package/lib/health.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import { deriveSelf } from './derive.js'
|
|
16
16
|
import { parseGuardLine } from './guardlog.js'
|
|
17
|
+
import { isDigestEvent } from './schema.js'
|
|
17
18
|
import { BELIEF_SHOWN } from './persona.js'
|
|
18
19
|
|
|
19
20
|
const DAY_MS = 86_400_000
|
|
@@ -195,7 +196,9 @@ function peopleStats(list, model) {
|
|
|
195
196
|
// 从前这里只看 id,于是 her_people 里认得的人,体检里一个都不算——两个数对不上。
|
|
196
197
|
const id = String(ev?.who?.id ?? '') || (String(ev?.who?.name ?? '').trim() ? `name:${String(ev.who.name).trim()}` : '')
|
|
197
198
|
if (type === 'utterance' && ev?.scene === 'group') herWords += 1
|
|
198
|
-
|
|
199
|
+
// 1.1.4(外部报告 B7):折叠出来的要点带着 voice,但它不是「别人说的那一句」,
|
|
200
|
+
// 算进来会让「群里留下的话:别人说的 N 条」凭空变大。
|
|
201
|
+
if (type === 'voice' && ev?.scene === 'group' && !isDigestEvent(ev)) othersWords += 1
|
|
199
202
|
if (!id) continue
|
|
200
203
|
const isJudge = type === 'utterance' || type === 'revise'
|
|
201
204
|
if (id === 'owner') {
|
package/lib/hear.js
CHANGED
|
@@ -22,9 +22,17 @@
|
|
|
22
22
|
import { appendEvent, readEvents } from './store.js'
|
|
23
23
|
import { hearMark, setHearMark } from './home.js'
|
|
24
24
|
import { loadConfig } from './settings.js'
|
|
25
|
+
import { isDigestEvent } from './schema.js'
|
|
25
26
|
|
|
26
|
-
/**
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* 一句最多多少字(对齐 talkmem 的 TALK_SNIPPET)。
|
|
29
|
+
*
|
|
30
|
+
* 2026-11-29(用户 m01632):160 → 320。存的本来就是「开头一段」,160 字经常
|
|
31
|
+
* 把后半句切掉、语义可能反过来;提一倍能少切很多,代价只是每条多一百来字。
|
|
32
|
+
*/
|
|
33
|
+
export const HEAR_SNIPPET = 320
|
|
34
|
+
/** 群里别人的话默认最多多少字(跟「他的话」分开:那一路只是凭据,不参与判断)。 */
|
|
35
|
+
export const OTHERS_SNIPPET = 160
|
|
28
36
|
/** 太短的话不值得记:「嗯」「好」记下来也翻不出什么 */
|
|
29
37
|
export const HEAR_MIN_CHARS = 8
|
|
30
38
|
/** 默认每几轮记一次 */
|
|
@@ -276,13 +284,16 @@ export async function rememberGroupMemberWord(root, o = {}) {
|
|
|
276
284
|
const flat = String(o.text ?? '').replace(/\s+/g, ' ').trim()
|
|
277
285
|
// 太短的话不值得记(「嗯」「好」),和他那边同一个门槛。
|
|
278
286
|
if (flat.length < HEAR_MIN_CHARS) return { written: false, why: 'too-short' }
|
|
279
|
-
|
|
287
|
+
// 别人的话仍按 160 起算:这一路只是凭据,不该跟着「他的话」一起被抬到 320。
|
|
288
|
+
const chars = Math.max(1, Number(gate.othersCharMax ?? OTHERS_SNIPPET) || OTHERS_SNIPPET)
|
|
280
289
|
const sentence = flat.length > chars ? flat.slice(0, chars - 1) + '…' : flat
|
|
281
290
|
|
|
282
291
|
const day = Number(o.day ?? 0)
|
|
283
292
|
const { events } = await readEvents(root).catch(() => ({ events: [] }))
|
|
284
293
|
// 只数「今天、群聊、别人说的」那几条;她自己的话(utterance)不算在额度里。
|
|
285
|
-
|
|
294
|
+
// 1.1.4(外部报告 B7):群房折叠出来的要点也是 voice+group,但它不是「谁说的那一句」,
|
|
295
|
+
// 算进额度里就等于折叠替别人占掉了今天的名额。
|
|
296
|
+
const mine = (e) => e?.type === 'voice' && e?.scene === 'group' && Number(e?.day) === day && !isDigestEvent(e)
|
|
286
297
|
const today = events.filter(mine)
|
|
287
298
|
if (today.length >= Number(gate.othersPerDayMax ?? 5)) return { written: false, why: 'per-day' }
|
|
288
299
|
const same = today.filter((e) => {
|
package/lib/herpeople.js
CHANGED
|
@@ -17,12 +17,9 @@ import { rootDir, readEvents } from './store.js'
|
|
|
17
17
|
import { loadConfig } from './settings.js'
|
|
18
18
|
import { defineTool } from './tool.js'
|
|
19
19
|
import { deriveSelf } from './derive.js'
|
|
20
|
-
import {
|
|
20
|
+
import { renderPerson, PEOPLE_READ_MAX } from './people.js'
|
|
21
21
|
import { pronounOf } from './pronoun.js'
|
|
22
22
|
|
|
23
|
-
/** 一次名单回几条:名单本身很短,全给也行,但这里与 `PEOPLE_MAX` 对齐。 */
|
|
24
|
-
const LIST_MAX = 24
|
|
25
|
-
|
|
26
23
|
/** 名字匹配词最长多少个字(防止她拿一整段话当名字)。 */
|
|
27
24
|
const WANT_MAX = 40
|
|
28
25
|
|
|
@@ -57,7 +54,7 @@ export function registerHerPeople(ctx, deps = {}) {
|
|
|
57
54
|
name: 'her_people',
|
|
58
55
|
description:
|
|
59
56
|
'翻你认识的人:你怎么看这个人、这个人说过什么、你拒绝过什么。' +
|
|
60
|
-
'
|
|
57
|
+
'不给名字就回一份名单;给一个名字(或者名字里的几个字)就回那一个人;对上好几个会把候选摆出来。' +
|
|
61
58
|
'一次一份,太长的会截断。',
|
|
62
59
|
parameters: toJsonSchema({
|
|
63
60
|
name: {
|
|
@@ -92,6 +89,7 @@ export function registerHerPeople(ctx, deps = {}) {
|
|
|
92
89
|
// 去查也查不到。现在跟身份段走同一个派生(`deriveSelf`),一个真相源。
|
|
93
90
|
const model = deriveSelf(Array.isArray(events) ? events : [], {
|
|
94
91
|
growthDays: config?.growthDays,
|
|
92
|
+
owner: config?.owner,
|
|
95
93
|
})
|
|
96
94
|
const call = String(model?.name ?? '').trim().slice(0, WANT_MAX)
|
|
97
95
|
// 开关关着时,她的世界里只有{T}一个人——工具也不该把别人翻出来。
|
|
@@ -100,6 +98,7 @@ export function registerHerPeople(ctx, deps = {}) {
|
|
|
100
98
|
// 只有称呼、没有任何往来记录的人不摆:一个空壳子页面对她没信息量,
|
|
101
99
|
// 还会让「你现在认识 N 个人」这个数虚高。
|
|
102
100
|
const hasContent = (p) =>
|
|
101
|
+
p.registered === true ||
|
|
103
102
|
p.times > 0 || p.judgments.length > 0 || p.changed.length > 0 || p.said.length > 0 || p.didTo.length > 0
|
|
104
103
|
const people = (others ? all : all.filter((p) => p.id === 'owner')).filter(hasContent)
|
|
105
104
|
|
|
@@ -118,22 +117,37 @@ export function registerHerPeople(ctx, deps = {}) {
|
|
|
118
117
|
.slice(0, WANT_MAX)
|
|
119
118
|
|
|
120
119
|
if (args?.list === true || !want) {
|
|
121
|
-
|
|
120
|
+
// 2026-11-29(用户 m03353):名单不再截 24 条——50 个实名的人里,
|
|
121
|
+
// 后 26 个从前她永远看不见。名字本身很短,全列出来比藏一半有用。
|
|
122
122
|
return {
|
|
123
123
|
found: true,
|
|
124
|
-
text: [`你现在认识 ${people.length} 个人:`, ...
|
|
124
|
+
text: [`你现在认识 ${people.length} 个人:`, ...people.map((p) => nameLine(p, call))].join('\n'),
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
// 名单里写的是哪个字,就得能用那个字查到(见 `labelOf
|
|
129
|
-
//
|
|
130
|
-
|
|
128
|
+
// 名单里写的是哪个字,就得能用那个字查到(见 `labelOf`)。
|
|
129
|
+
// 2026-11-29(用户 m03353):先认全名,再认几个字;几个字对上多个人的时候
|
|
130
|
+
// 不替她挑——把候选摆出来,让她自己说清是哪一个。
|
|
131
|
+
const label = (p) => labelOf(p, call)
|
|
132
|
+
const candidates = (list) =>
|
|
133
|
+
list
|
|
134
|
+
.map((p) => {
|
|
135
|
+
const j = p.judgments[0]
|
|
136
|
+
const tail = j ? `:你写过「${String(j.text ?? '').slice(0, 30)}」` : ''
|
|
137
|
+
return `- ${label(p)}(${p.id})${tail}`
|
|
138
|
+
})
|
|
139
|
+
.join('\n')
|
|
140
|
+
const ambiguous = (list) =>
|
|
141
|
+
[`有 ${list.length} 个人都对得上「${want}」:`, candidates(list), '要看哪一个,把名字说全一点,或者把后面那个 id 说给我。'].join('\n')
|
|
142
|
+
let hit = people.filter((p) => label(p) === want)
|
|
143
|
+
if (hit.length > 1) return { found: true, text: ambiguous(hit) }
|
|
131
144
|
if (!hit.length) {
|
|
132
|
-
const
|
|
133
|
-
const n =
|
|
134
|
-
return n
|
|
145
|
+
const fuzzy = people.filter((p) => {
|
|
146
|
+
const n = label(p)
|
|
147
|
+
return n && (n.includes(want) || want.includes(n))
|
|
135
148
|
})
|
|
136
|
-
if (
|
|
149
|
+
if (fuzzy.length > 1) return { found: true, text: ambiguous(fuzzy) }
|
|
150
|
+
hit = fuzzy
|
|
137
151
|
}
|
|
138
152
|
if (!hit.length) {
|
|
139
153
|
return {
|
package/lib/herperson.js
CHANGED
|
@@ -21,6 +21,7 @@ import { guardWrite } from './tenant.js'
|
|
|
21
21
|
import { logLine } from './log.js'
|
|
22
22
|
import { deriveSelf } from './derive.js'
|
|
23
23
|
import {
|
|
24
|
+
PERSON_ANON_MAX,
|
|
24
25
|
PERSON_REGISTRY_MAX,
|
|
25
26
|
PERSON_NATURE_TEXT,
|
|
26
27
|
PERSON_NAME_MAX,
|
|
@@ -31,9 +32,6 @@ import {
|
|
|
31
32
|
normalizePid,
|
|
32
33
|
} from './person.js'
|
|
33
34
|
|
|
34
|
-
/** 名单一次回几条。 */
|
|
35
|
-
const LIST_MAX = 24
|
|
36
|
-
|
|
37
35
|
/** `nature` 的取值,回给模型时用同一套词。 */
|
|
38
36
|
const NATURES = Object.keys(PERSON_NATURE_TEXT)
|
|
39
37
|
|
|
@@ -47,7 +45,25 @@ function describe(row, call) {
|
|
|
47
45
|
return `${name}(${nature})${row.note ? `:${row.note}` : ''}`
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* 名单里的一行:名字、哪一种人、一句「这是谁」(只留开头),和 id。
|
|
50
|
+
*
|
|
51
|
+
* 2026-11-29(用户 m03353):名单从前只回前 24 条,实名 50 个时后 26 个会查不到。
|
|
52
|
+
* 每人一行、note 只留开头,70 行也放得下——名单是给她看的,不该有查不到的人。
|
|
53
|
+
*/
|
|
54
|
+
function listLine(row) {
|
|
55
|
+
const nature = PERSON_NATURE_TEXT[row.nature] || PERSON_NATURE_TEXT.real
|
|
56
|
+
const name = row.name || '(没名字)'
|
|
57
|
+
const note = String(row.note ?? '').replace(/\s+/g, ' ').trim()
|
|
58
|
+
const brief = note.length > 40 ? `${note.slice(0, 40)}…` : note
|
|
59
|
+
return `- ${name}(${nature})${brief ? `:${brief}` : ''} ${row.id}`
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** 已登记的人(按先后顺序,同 id 以后写的为准;被并掉的并进目标那一个)。
|
|
63
|
+
*
|
|
64
|
+
* `person_drop`(1.1.4,用户 m02973)只把这一行从名单里拿掉,不删事件:
|
|
65
|
+
* 她再 add 一次同一个 pid 就复活——所以这里按事件顺序算,drop 之后再 add 能加回来。
|
|
66
|
+
*/
|
|
51
67
|
function registered(events) {
|
|
52
68
|
const byId = new Map()
|
|
53
69
|
const mergeTo = new Map()
|
|
@@ -58,6 +74,11 @@ function registered(events) {
|
|
|
58
74
|
if (from && into && from !== into) mergeTo.set(from, into)
|
|
59
75
|
continue
|
|
60
76
|
}
|
|
77
|
+
if (e?.type === 'person_drop') {
|
|
78
|
+
const id = normalizePid(e.pid)
|
|
79
|
+
if (id) byId.delete(id)
|
|
80
|
+
continue
|
|
81
|
+
}
|
|
61
82
|
if (e?.type !== 'person_add') continue
|
|
62
83
|
const id = normalizePid(e.pid)
|
|
63
84
|
if (!id) continue
|
|
@@ -104,6 +125,43 @@ function resolveOne(rows, want) {
|
|
|
104
125
|
return { id: '', why: `还没有叫「${name}」的人。` }
|
|
105
126
|
}
|
|
106
127
|
|
|
128
|
+
/** 名额(1.1.4,用户 m02973):实名 50 个、没名字的 20 个,分开算。 */
|
|
129
|
+
function countsOf(rows) {
|
|
130
|
+
const anon = rows.filter((r) => r.nature === 'anonymous').length
|
|
131
|
+
return { real: rows.length - anon, anon }
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 名额满了的时候给她几个「可以放掉」的候选(1.1.4,用户 m02973)。
|
|
136
|
+
*
|
|
137
|
+
* 判据只有两条:挂的判断少的先放、最久没被提到的先放。
|
|
138
|
+
* 只列不挑——放掉哪个是她的事,工具不替她决定。
|
|
139
|
+
*/
|
|
140
|
+
function dropCandidates(events, rows, limit = 4) {
|
|
141
|
+
const lastSeen = new Map()
|
|
142
|
+
const judged = new Map()
|
|
143
|
+
for (const e of Array.isArray(events) ? events : []) {
|
|
144
|
+
const at = Number(Date.parse(String(e?.ts ?? ''))) || 0
|
|
145
|
+
const pid = normalizePid(e?.about)
|
|
146
|
+
if (pid) {
|
|
147
|
+
if (at > (lastSeen.get(pid) || 0)) lastSeen.set(pid, at)
|
|
148
|
+
if (e?.type === 'utterance' || e?.type === 'revise') judged.set(pid, (judged.get(pid) || 0) + 1)
|
|
149
|
+
}
|
|
150
|
+
const wid = normalizePid(e?.who?.id)
|
|
151
|
+
if (wid && at > (lastSeen.get(wid) || 0)) lastSeen.set(wid, at)
|
|
152
|
+
}
|
|
153
|
+
return rows
|
|
154
|
+
.slice()
|
|
155
|
+
.sort((a, b) => {
|
|
156
|
+
const ja = judged.get(a.id) || 0
|
|
157
|
+
const jb = judged.get(b.id) || 0
|
|
158
|
+
if (ja !== jb) return ja - jb
|
|
159
|
+
return (lastSeen.get(a.id) || 0) - (lastSeen.get(b.id) || 0)
|
|
160
|
+
})
|
|
161
|
+
.slice(0, limit)
|
|
162
|
+
.map((r) => `${r.name || '(没名字)'}(${r.id}${judged.get(r.id) ? `,挂着 ${judged.get(r.id)} 条判断` : ',没挂过判断'})`)
|
|
163
|
+
}
|
|
164
|
+
|
|
107
165
|
/**
|
|
108
166
|
* 注册 her_person 工具。
|
|
109
167
|
*
|
|
@@ -118,18 +176,19 @@ export function registerHerPerson(ctx, deps = {}) {
|
|
|
118
176
|
description:
|
|
119
177
|
'哪天你心里把一个人跟别的人分开了——{T}提过的朋友、你读到的作者、群里那个人——就先把这个人记下来:' +
|
|
120
178
|
'叫什么、是哪一种人、一句话说清这是谁。记下来以后,growth_commit 的 about 填这个 id,你写的判断就有地方挂了。' +
|
|
121
|
-
'add 记一个人;list 看已经记了谁;alias 给同一个人再加一个叫法;merge
|
|
179
|
+
'add 记一个人;list 看已经记了谁;alias 给同一个人再加一个叫法;merge 把记重的两个人并成一个;' +
|
|
180
|
+
'drop 把不再需要单独记的人放掉(判断与材料都还在,只是不再摆出来)。',
|
|
122
181
|
parameters: toJsonSchema({
|
|
123
182
|
action: {
|
|
124
183
|
type: 'string',
|
|
125
184
|
required: true,
|
|
126
|
-
enum: ['add', 'list', 'alias', 'merge'],
|
|
127
|
-
description: '要做哪件事:add 记一个人、list 看名单、alias 加一个叫法、merge
|
|
185
|
+
enum: ['add', 'list', 'alias', 'merge', 'drop'],
|
|
186
|
+
description: '要做哪件事:add 记一个人、list 看名单、alias 加一个叫法、merge 并掉重复的那个、drop 放掉一个。',
|
|
128
187
|
},
|
|
129
188
|
name: {
|
|
130
189
|
type: 'string',
|
|
131
190
|
required: false,
|
|
132
|
-
description: `add 时要记的人叫什么(${PERSON_NAME_MAX}
|
|
191
|
+
description: `add 时要记的人叫什么(${PERSON_NAME_MAX} 字以内;没名字的人可以不填)。alias/merge/drop 也可以用它代替 id。`,
|
|
133
192
|
},
|
|
134
193
|
nature: {
|
|
135
194
|
type: 'string',
|
|
@@ -145,7 +204,7 @@ export function registerHerPerson(ctx, deps = {}) {
|
|
|
145
204
|
id: {
|
|
146
205
|
type: 'string',
|
|
147
206
|
required: false,
|
|
148
|
-
description: 'alias/merge 时指认原来那个人:填 p_ 开头的 id。',
|
|
207
|
+
description: 'alias/merge/drop 时指认原来那个人:填 p_ 开头的 id。',
|
|
149
208
|
},
|
|
150
209
|
alias: {
|
|
151
210
|
type: 'string',
|
|
@@ -177,7 +236,7 @@ export function registerHerPerson(ctx, deps = {}) {
|
|
|
177
236
|
const { events } = await readEvents(root).catch(() => ({ events: [] }))
|
|
178
237
|
const { config } = await loadConfig(root).catch(() => ({ config: {} }))
|
|
179
238
|
const list = Array.isArray(events) ? events : []
|
|
180
|
-
const model = deriveSelf(list, { growthDays: config?.growthDays })
|
|
239
|
+
const model = deriveSelf(list, { growthDays: config?.growthDays, owner: config?.owner })
|
|
181
240
|
const rows = registered(list)
|
|
182
241
|
const action = String(args?.action ?? '').trim()
|
|
183
242
|
const call = String(model?.name ?? '').trim()
|
|
@@ -192,37 +251,50 @@ export function registerHerPerson(ctx, deps = {}) {
|
|
|
192
251
|
'叫什么、是哪一种人、一句话说清这是谁。',
|
|
193
252
|
}
|
|
194
253
|
}
|
|
195
|
-
const lines = rows.
|
|
196
|
-
|
|
197
|
-
|
|
254
|
+
const lines = rows.map((r) => listLine(r))
|
|
255
|
+
// 名额(1.1.4,用户 m02973):两个名额分开报,快满的时候她自己心里有数。
|
|
256
|
+
const n = countsOf(rows)
|
|
257
|
+
const head = `你现在记着 ${rows.length} 个人(实名 ${n.real}/${PERSON_REGISTRY_MAX}、没名字的 ${n.anon}/${PERSON_ANON_MAX}):`
|
|
258
|
+
return { ok: true, id: '', note: [head, ...lines].join('\n') }
|
|
198
259
|
}
|
|
199
260
|
|
|
200
261
|
if (action === 'add') {
|
|
201
|
-
if (rows.length >= PERSON_REGISTRY_MAX) {
|
|
202
|
-
return {
|
|
203
|
-
ok: false,
|
|
204
|
-
id: '',
|
|
205
|
-
note: `记着的人已经到上限了(${PERSON_REGISTRY_MAX} 个)。先把记重的并掉,或者把不必再分的删掉——记人这一项只加不改,删不了单条。`,
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const name = normalizePersonName(args?.name)
|
|
209
|
-
if (!name) return { ok: false, id: '', note: '先说要记的人叫什么。' }
|
|
210
|
-
const nature = normalizeNature(args?.nature)
|
|
211
262
|
if (!String(args?.nature ?? '').trim()) {
|
|
212
|
-
return { ok: false, id: '', note: '
|
|
263
|
+
return { ok: false, id: '', note: '要说清这是哪一种人:现实里的、作品里的、写东西的、群里的、你自己,还是没名字的人。' }
|
|
213
264
|
}
|
|
265
|
+
const nature = normalizeNature(args?.nature)
|
|
266
|
+
// 没名字的人(1.1.4,用户 m02973):可以不留名字,但那句「怎么认出来的」必须留着,
|
|
267
|
+
// 否则下次见面她自己也不知道是不是同一个。
|
|
268
|
+
const name = normalizePersonName(args?.name)
|
|
269
|
+
if (!name && nature !== 'anonymous') return { ok: false, id: '', note: '先说要记的人叫什么。' }
|
|
214
270
|
const note = String(args?.note ?? '').trim()
|
|
215
271
|
if (note.length < 4) {
|
|
216
272
|
return { ok: false, id: '', note: '再说一句这是谁——只写一个名字,以后就想不起来了。' }
|
|
217
273
|
}
|
|
218
|
-
|
|
219
|
-
|
|
274
|
+
// 名额(1.1.4,用户 m02973):实名 50、没名字的 20,分开算。
|
|
275
|
+
// 满了不静默丢,回一句人话并给几个可以放掉的候选——她自己决定放谁。
|
|
276
|
+
const n = countsOf(rows)
|
|
277
|
+
const cap = nature === 'anonymous' ? PERSON_ANON_MAX : PERSON_REGISTRY_MAX
|
|
278
|
+
const used = nature === 'anonymous' ? n.anon : n.real
|
|
279
|
+
if (used >= cap) {
|
|
280
|
+
const pool = rows.filter((r) => (r.nature === 'anonymous') === (nature === 'anonymous'))
|
|
281
|
+
const hints = dropCandidates(list, pool)
|
|
220
282
|
return {
|
|
221
283
|
ok: false,
|
|
222
|
-
id:
|
|
223
|
-
note:
|
|
284
|
+
id: '',
|
|
285
|
+
note:
|
|
286
|
+
(nature === 'anonymous'
|
|
287
|
+
? `没名字的人已经记满了(${PERSON_ANON_MAX} 个)。`
|
|
288
|
+
: `记的人已经太多了(实名 ${PERSON_REGISTRY_MAX} 个),记满了。`) +
|
|
289
|
+
`要腾位置就把其中一个放掉:her_person drop。<br>可以先看这几个:${hints.join(';')}`.replace('<br>', '\n'),
|
|
224
290
|
}
|
|
225
291
|
}
|
|
292
|
+
// 同名(1.1.4,用户 m02973):允许记两个同名的人,但必须用那句「这是谁」区分开。
|
|
293
|
+
// 同一句话再说一遍就是记过了,回原来的 id,不新增。
|
|
294
|
+
const dup = name ? rows.find((r) => r.name === name) : null
|
|
295
|
+
if (dup && dup.note === note) {
|
|
296
|
+
return { ok: false, id: dup.id, note: `已经记过叫「${name}」的了:${dup.id}。如果是同一个人,用 alias 加叫法。` }
|
|
297
|
+
}
|
|
226
298
|
const pid = newPersonId(Date.now())
|
|
227
299
|
await appendEvent(
|
|
228
300
|
{
|
|
@@ -236,8 +308,31 @@ export function registerHerPerson(ctx, deps = {}) {
|
|
|
236
308
|
{ day: model.day, stage: model.stage, source: 'tool' },
|
|
237
309
|
root,
|
|
238
310
|
)
|
|
239
|
-
logLine('info', ['her_person: 记下一个人', `id=${pid}`, `name=${name}`], root)
|
|
240
|
-
|
|
311
|
+
logLine('info', ['her_person: 记下一个人', `id=${pid}`, `name=${name || '(没名字)'}`, `nature=${nature}`], root)
|
|
312
|
+
const tail = dup
|
|
313
|
+
? `现在有两个叫「${name}」的人(${dup.id} 和 ${pid}),写判断时用 id 说清是哪一个。`
|
|
314
|
+
: `以后写判断时 about 填 ${pid}。`
|
|
315
|
+
return { ok: true, id: pid, note: `记下了:${name || '(没名字)'}(${PERSON_NATURE_TEXT[nature] || ''})。${tail}` }
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if (action === 'drop') {
|
|
319
|
+
const target = resolveOne(rows, args?.id || args?.name)
|
|
320
|
+
if (!target.id) return { ok: false, id: '', note: target.why }
|
|
321
|
+
await appendEvent(
|
|
322
|
+
{
|
|
323
|
+
type: 'person_drop',
|
|
324
|
+
text: '不再单独记这个人',
|
|
325
|
+
pid: target.id,
|
|
326
|
+
...(who.sessionId ? { sessionId: who.sessionId } : {}),
|
|
327
|
+
},
|
|
328
|
+
{ day: model.day, stage: model.stage, source: 'tool' },
|
|
329
|
+
root,
|
|
330
|
+
)
|
|
331
|
+
return {
|
|
332
|
+
ok: true,
|
|
333
|
+
id: target.id,
|
|
334
|
+
note: `放掉了 ${target.id}:名单里不再摆出来。写过的判断与材料都还在账本里,以后再想记这个人,用同一个 id 记一次就回来了。`,
|
|
335
|
+
}
|
|
241
336
|
}
|
|
242
337
|
|
|
243
338
|
if (action === 'alias') {
|
|
@@ -278,7 +373,7 @@ export function registerHerPerson(ctx, deps = {}) {
|
|
|
278
373
|
return { ok: true, id: into.id, note: `把 ${from.id} 并到 ${into.id} 了;以后都算这一个人。` }
|
|
279
374
|
}
|
|
280
375
|
|
|
281
|
-
return { ok: false, id: '', note: 'action 只有 add / list / alias / merge
|
|
376
|
+
return { ok: false, id: '', note: 'action 只有 add / list / alias / merge / drop 五种。' }
|
|
282
377
|
} catch (err) {
|
|
283
378
|
logLine('warn', ['her_person: 没写成', err?.message ?? err], root)
|
|
284
379
|
return { ok: false, id: '', note: '这条没记下。' }
|
package/lib/identity.js
CHANGED
|
@@ -30,7 +30,7 @@ import { fillOwner, pronounFor } from './pronoun.js'
|
|
|
30
30
|
import { cwdOf, foldedRecallNote, isHerHome, toolSurfaceFor, visibleToolsOf } from './restrict.js'
|
|
31
31
|
import { paths } from './store.js'
|
|
32
32
|
import { whenHers, whenClaimed, underDir } from './claim.js'
|
|
33
|
-
import { normalizeNote, notesPath } from './note.js'
|
|
33
|
+
import { lastProgress, normalizeNote, notesPath } from './note.js'
|
|
34
34
|
import { appointPath } from './appoint.js'
|
|
35
35
|
import { activeOutingSync, bindOutingSession } from './outing.js'
|
|
36
36
|
import { attachStreamScrub } from './scrub.js'
|
|
@@ -203,7 +203,13 @@ export function splitRulesBlock(text = '') {
|
|
|
203
203
|
|
|
204
204
|
const NOTES_TAIL_CACHE = new Map()
|
|
205
205
|
|
|
206
|
-
/**
|
|
206
|
+
/**
|
|
207
|
+
* 一张便条摆成一行:正文 + 什么时候记的 / 到哪天 / 在等什么 + 上次记到哪。
|
|
208
|
+
*
|
|
209
|
+
* 最后那一截是 2026-11-29(用户 m01632)加的:只有正文与日子时,她看到的是
|
|
210
|
+
* 「这件事还开着」,看不出「已经走了一半」,于是容易从零开始接着说。
|
|
211
|
+
* 取最近一笔进展(`lastProgress`),没有就不加,保持原样。
|
|
212
|
+
*/
|
|
207
213
|
function noteTailLine(n) {
|
|
208
214
|
const text = String(n?.text ?? '').replace(/\s+/g, ' ').trim()
|
|
209
215
|
if (!text) return ''
|
|
@@ -212,7 +218,9 @@ function noteTailLine(n) {
|
|
|
212
218
|
: n.due
|
|
213
219
|
? `到 ${String(n.due).slice(5)}`
|
|
214
220
|
: `${String(n.created ?? '').slice(5, 10)} 记下的`
|
|
215
|
-
|
|
221
|
+
const last = lastProgress(n)
|
|
222
|
+
const progress = last?.text ? `|上次记到:${last.text}` : ''
|
|
223
|
+
return `- 「${text}」(${stamp}${progress})`
|
|
216
224
|
}
|
|
217
225
|
|
|
218
226
|
/**
|
package/lib/index.js
CHANGED
|
@@ -43,6 +43,7 @@ import { registerDoingHooks } from './doing.js'
|
|
|
43
43
|
import { registerObserve } from './observe.js'
|
|
44
44
|
import { startScheduler } from './scheduler.js'
|
|
45
45
|
import { registerTurns } from './turns.js'
|
|
46
|
+
import { registerCompactionLog } from './compactionlog.js'
|
|
46
47
|
import { bootstrapHome, homeStatus, wakeIfBlank } from './home.js'
|
|
47
48
|
import { ensurePocketOrder, findPocketWorkspace } from './pocket.js'
|
|
48
49
|
import { noteRoot } from './homes.js'
|
|
@@ -52,6 +53,7 @@ import { runPendingReset } from './reset-pending.js'
|
|
|
52
53
|
import { rootMovedAway } from './move.js'
|
|
53
54
|
import { setRiskLog } from './bili.js'
|
|
54
55
|
import { registerToolRestrict, seedHerSessions, isHerSessionId } from './restrict.js'
|
|
56
|
+
import { setBridgeDirs } from './claim.js'
|
|
55
57
|
// `clearWakeSection` 在 dispose 里用:它挂在 system prompt 段上,是个模块级变量,
|
|
56
58
|
// 停用时不清的话下次启用会带着上一次的残留(2026-10-25)。
|
|
57
59
|
import { clearWakeSection, registerIdentity } from './identity.js'
|
|
@@ -68,7 +70,7 @@ export const name = 'dsh-fish'
|
|
|
68
70
|
* 版本号,必须和 package.json 的 version 一样(test/boot.test.mjs 盯着)。
|
|
69
71
|
* 不只是日志:升级自检和设置页的「检查更新」拿它当「正在跑的版本」。
|
|
70
72
|
*/
|
|
71
|
-
export const VERSION = '1.1.
|
|
73
|
+
export const VERSION = '1.1.4'
|
|
72
74
|
|
|
73
75
|
// ⚠️ 一个数组写全,不要拆成对象
|
|
74
76
|
// 2026-10-30(m02961):`userQuestions` **不再写进 inject**。写进 inject 的东西缺一个,
|
|
@@ -319,7 +321,7 @@ export function apply(ctx, baseConfig = {}) {
|
|
|
319
321
|
}
|
|
320
322
|
}
|
|
321
323
|
|
|
322
|
-
const model = deriveSelf(await readEvents(root).then((r) => r.events), { growthDays: config.growthDays })
|
|
324
|
+
const model = deriveSelf(await readEvents(root).then((r) => r.events), { growthDays: config.growthDays, owner: config.owner })
|
|
323
325
|
if (stopped) return
|
|
324
326
|
|
|
325
327
|
// ---- 她的屋子:工作区 + 专属会话(P3 核心)----
|
|
@@ -332,6 +334,7 @@ export function apply(ctx, baseConfig = {}) {
|
|
|
332
334
|
// 2026-11-22:先把她已有的会话 id 读回来(home.json / channels.json)。
|
|
333
335
|
// 重启后家里那条会冷着,身份守卫要是只认「这次建出来的」,就会把她判成别人;
|
|
334
336
|
// 反过来,读回来以后 cwd 落在她屋里**但不是这些 id** 的会话(他本人的)不再被认成她。
|
|
337
|
+
try { setBridgeDirs(config?.bridge?.dirs ?? []) } catch { /* 配置坏了等于没声明 */ }
|
|
335
338
|
try { seedHerSessions(root) } catch { /* 台账读坏了等于没读,退化成旧判据 */ }
|
|
336
339
|
try {
|
|
337
340
|
const off = registerToolRestrict(ctx, /** @type {any} */ ({
|
|
@@ -449,6 +452,17 @@ export function apply(ctx, baseConfig = {}) {
|
|
|
449
452
|
logger.warn('[dsh-fish] 轮数观察没挂上', err?.message ?? err)
|
|
450
453
|
}
|
|
451
454
|
|
|
455
|
+
// ---- 压缩记账(1.1.4,外部报告 B1 轻量版)----
|
|
456
|
+
// 宿主的自动压缩与 `/compact` 默认就挂在链上,可插件这边一直看不见「压过没有」。
|
|
457
|
+
// 这里只写一条 `meta` 账(`compaction:<id>` 开头),不进判断、不进身份段、
|
|
458
|
+
// `her_recall` 也不放行——她读不到,翻日志的人查得到。
|
|
459
|
+
try {
|
|
460
|
+
const off = registerCompactionLog(ctx, root)
|
|
461
|
+
if (typeof off.dispose === 'function') disposers.push(off.dispose)
|
|
462
|
+
} catch (err) {
|
|
463
|
+
logger.warn('[dsh-fish] 压缩记账没挂上', err?.message ?? err)
|
|
464
|
+
}
|
|
465
|
+
|
|
452
466
|
// 工具:一个写(growth_commit)、一个看(bili_look)。
|
|
453
467
|
// 两者都必须成功注册;缺了任何一个她都会变残(只会说不会看,或只会记不会看)。
|
|
454
468
|
if (ctx.tools?.register) {
|
|
@@ -615,3 +629,4 @@ export function apply(ctx, baseConfig = {}) {
|
|
|
615
629
|
}
|
|
616
630
|
}
|
|
617
631
|
|
|
632
|
+
|
package/lib/letter.js
CHANGED
|
@@ -126,7 +126,7 @@ export async function leaveLetter(root, text, { log, sessionId = '' } = {}) {
|
|
|
126
126
|
return { ok: false, id: '', note: '今天已经留过了。明天再说也一样。' }
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
const model = deriveSelf(events, { growthDays: config.growthDays })
|
|
129
|
+
const model = deriveSelf(events, { growthDays: config.growthDays, owner: config.owner })
|
|
130
130
|
const env = { day: model.day, stage: model.stage, source: 'tool' }
|
|
131
131
|
// 跟 growth_commit 一样带上「谁写的」(2026-10-28 用户 m01319):
|
|
132
132
|
// 两个家共用一个 root 时,信箱里的话也得认得出是哪一位留的。
|