@ssamurias/dsh-fish 1.0.4 → 1.0.5
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 +4 -2
- package/CHANGELOG.md +30 -0
- package/README.md +40 -4
- package/RELEASE-NOTES-1.0.4.md +26 -0
- package/RELEASE-NOTES-1.0.5.md +79 -0
- package/lib/appoint.js +154 -25
- package/lib/ask.js +70 -7
- package/lib/browse.js +136 -8
- package/lib/capture.js +7 -1
- package/lib/client.js +115 -21
- package/lib/configstamp.js +25 -0
- package/lib/derive.js +18 -0
- package/lib/doing.js +11 -2
- package/lib/identity.js +10 -6
- package/lib/index.js +6 -1
- package/lib/look.js +9 -2
- package/lib/note.js +22 -5
- package/lib/observe.js +55 -2
- package/lib/persona.js +9 -2
- package/lib/refuse.js +42 -0
- package/lib/restrict.js +1 -0
- package/lib/say.js +36 -7
- package/lib/scheduler.js +153 -8
- package/lib/selfcheck.js +9 -9
- package/lib/selfpronoun.js +7 -2
- package/lib/session-pressure.js +11 -3
- package/lib/stance.js +212 -16
- package/lib/store.js +4 -0
- package/lib/use.js +2 -0
- package/lib/video.js +3 -0
- package/lib/watch.js +149 -3
- package/lib/wiki.js +116 -40
- package/media/principle-drive.svg +27 -23
- package/package.json +1 -1
package/lib/appoint.js
CHANGED
|
@@ -9,6 +9,17 @@
|
|
|
9
9
|
* 2. 到点只提一次(`notifiedAt`),不天天催。
|
|
10
10
|
* 3. 他没来,也不替她圆——prompt 里明说「没来也别替他找理由」。
|
|
11
11
|
* 4. 做没做到由她自己收:做到(done)、取消(cancel,要说为什么)、改期(move)。
|
|
12
|
+
*
|
|
13
|
+
* 2026-11-18 补「定到几点」(issue #149 / 用户 m01744、m01769、m01793):
|
|
14
|
+
* - 时刻**不是闹钟**,是「最早什么时候能提」——到那一刻她一定先看到这条,
|
|
15
|
+
* 做不做、怎么做由她自己定;催不催、说什么都不由这套代码替她决定。
|
|
16
|
+
* - 带时刻的约定不受作息窗口限制(约定优先);两条不同时刻各叫各的,不合并。
|
|
17
|
+
* - 到点那一刻正忙 / 刚叫过,宽限 5 分钟;超出宽限还忙就照叫——约定比闲聊优先。
|
|
18
|
+
* - 走到点这条链时 DSH 没开着,就晚一点叫,prompt 里写清「本来约的是 HH:MM,
|
|
19
|
+
* 那会儿我这边没开着」;不把「他不在」写进事件流(他可能就守在窗口旁)。
|
|
20
|
+
* - 双方都认下才作数:她可以用 ask_owner(kind='appoint') 问一句,答案在
|
|
21
|
+
* `answer` 事件里,这里是读答案那一端;没问过、问过没答、以后再说,各写各的。
|
|
22
|
+
|
|
12
23
|
*
|
|
13
24
|
* 三条硬约束(和 note.js 同一条线):
|
|
14
25
|
* 1. **不审批**。约一件事不是改自己,不设关卡。
|
|
@@ -45,6 +56,25 @@ export const APPOINT_MAX_DAYS = 60
|
|
|
45
56
|
/** list 一次最多列几条。 */
|
|
46
57
|
export const APPOINT_SHOW_MAX = 5
|
|
47
58
|
|
|
59
|
+
/**
|
|
60
|
+
* 到点后宽限多久还算「准点」(2026-11-18,用户 m01744)。
|
|
61
|
+
* 5 分钟内叫她都算准时;超过就明说晚了多少。
|
|
62
|
+
*/
|
|
63
|
+
export const APPT_GRACE_MS = 5 * 60_000
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 两条到点的约定之间至少隔多久(2026-11-18)。
|
|
67
|
+
* 比作息唤醒的 45 分钟短:它不是「该醒了」,是「这件事到点了」。
|
|
68
|
+
*/
|
|
69
|
+
export const APPT_MIN_GAP_MS = 10 * 60_000
|
|
70
|
+
|
|
71
|
+
/** 时刻写成 08:00 这样;24 小时制。 */
|
|
72
|
+
const HHMM = /^([01]\d|2[0-3]):[0-5]\d$/
|
|
73
|
+
|
|
74
|
+
export function isTime(v) {
|
|
75
|
+
return HHMM.test(String(v ?? '').trim())
|
|
76
|
+
}
|
|
77
|
+
|
|
48
78
|
const STATUSES = ['open', 'done', 'cancelled', 'missed']
|
|
49
79
|
|
|
50
80
|
export function appointPath(root = rootDir()) {
|
|
@@ -90,20 +120,50 @@ export function normalizeAppoint(raw) {
|
|
|
90
120
|
const what = String(raw.what ?? '').replace(/\s+/g, ' ').trim()
|
|
91
121
|
if (!what || !isDay(raw.due)) return null
|
|
92
122
|
const status = STATUSES.includes(String(raw.status)) ? String(raw.status) : 'open'
|
|
123
|
+
const time = isTime(raw.time) ? String(raw.time).trim() : null
|
|
124
|
+
const late = Number(raw.lateMinutes)
|
|
93
125
|
return {
|
|
94
126
|
id: String(raw.id ?? '') || newAppointId(),
|
|
95
127
|
due: String(raw.due),
|
|
128
|
+
// 2026-11-18:带时刻的约定。`null` 是老形状(只认日子)。
|
|
129
|
+
time,
|
|
96
130
|
what: clipText(what, APPOINT_TEXT_MAX, ''),
|
|
97
131
|
created: String(raw.created ?? '') || new Date().toISOString(),
|
|
98
132
|
status,
|
|
99
133
|
// 到点提过一次就写时间;改期会清回 null,让她在新日子再想起来一次
|
|
100
134
|
notifiedAt: raw.notifiedAt == null ? null : String(raw.notifiedAt),
|
|
135
|
+
// 实际叫起来时晚了几分钟(超过宽限才写;没晚就是 null)
|
|
136
|
+
lateMinutes: Number.isFinite(late) && late > 0 ? Math.round(late) : null,
|
|
137
|
+
// 他答应过没有:true 答应、false 没问成或问过他还没答、null 还没问过(不猜)
|
|
138
|
+
agreed: raw.agreed === true ? true : raw.agreed === false ? false : null,
|
|
139
|
+
// 她为这条发的那张确认卡(ask 事件的 id),到点用来看他当时怎么答的
|
|
140
|
+
askId: raw.askId == null || String(raw.askId).trim() === '' ? null : String(raw.askId).trim(),
|
|
101
141
|
closedAt: raw.closedAt == null ? null : String(raw.closedAt),
|
|
102
142
|
outcome: ['done', 'cancelled', 'missed'].includes(String(raw.outcome)) ? String(raw.outcome) : null,
|
|
103
143
|
reason: raw.reason == null ? null : clipText(raw.reason, 200, ''),
|
|
104
144
|
}
|
|
105
145
|
}
|
|
106
146
|
|
|
147
|
+
/**
|
|
148
|
+
* 这条约定「到点的那个瞬间」是哪一刻(毫秒)。没有时刻的返回 null。
|
|
149
|
+
* 用本地时间拼:她说的 08:00 是她那边的 08:00,不是 UTC 的。
|
|
150
|
+
*/
|
|
151
|
+
export function momentOf(appt) {
|
|
152
|
+
if (!appt || !isDay(appt.due) || !isTime(appt.time)) return null
|
|
153
|
+
const [y, m, d] = String(appt.due).split('-').map(Number)
|
|
154
|
+
const [hh, mm] = String(appt.time).split(':').map(Number)
|
|
155
|
+
const t = new Date(y, m - 1, d, hh, mm, 0, 0).getTime()
|
|
156
|
+
return Number.isFinite(t) ? t : null
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** 到点后过去了几分钟(没到点或没时刻返回 null)。 */
|
|
160
|
+
export function lateMinutesOf(appt, now = Date.now()) {
|
|
161
|
+
const at = momentOf(appt)
|
|
162
|
+
if (at == null) return null
|
|
163
|
+
const late = Math.floor((Number(now) - at) / 60_000)
|
|
164
|
+
return late < 0 ? null : late
|
|
165
|
+
}
|
|
166
|
+
|
|
107
167
|
/** 读全部预约。文件坏了/没有都只当空,永不抛。 */
|
|
108
168
|
export async function readAppointments(root = rootDir()) {
|
|
109
169
|
const raw = await readJson(appointPath(root), [])
|
|
@@ -118,20 +178,35 @@ export async function writeAppointments(root, list) {
|
|
|
118
178
|
return rows
|
|
119
179
|
}
|
|
120
180
|
|
|
121
|
-
/**
|
|
181
|
+
/** 未关掉的,按日子从近到远;同一天按时刻排。 */
|
|
122
182
|
export function openAppointments(list, { now = Date.now() } = {}) {
|
|
123
183
|
const today = dateKey(new Date(now))
|
|
124
184
|
return (Array.isArray(list) ? list : [])
|
|
125
185
|
.filter((a) => a?.status === 'open')
|
|
126
|
-
.sort((a, b) =>
|
|
127
|
-
|
|
186
|
+
.sort((a, b) =>
|
|
187
|
+
dayNumber(a.due) - dayNumber(b.due)
|
|
188
|
+
|| String(a.time ?? '').localeCompare(String(b.time ?? ''))
|
|
189
|
+
|| String(a.created).localeCompare(String(b.created)))
|
|
190
|
+
.map((a) => ({ ...a, days: daysBetween(today, a.due), at: momentOf(a) }))
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* 到点了、还没提过的约定(从早到晚)。
|
|
195
|
+
*
|
|
196
|
+
* 2026-11-18(issue #149):带时刻的按「那一刻」算,跟日子无关——
|
|
197
|
+
* 08:00 的约定不会等到晚上 20:00 的作息窗口。老形状(只写日子)
|
|
198
|
+
* 还是只看日子,到当天就算到点。
|
|
199
|
+
*/
|
|
200
|
+
export async function dueAppointments(root = rootDir(), now = Date.now()) {
|
|
201
|
+
const rows = openAppointments(await readAppointments(root), { now })
|
|
202
|
+
.filter((a) => !a.notifiedAt)
|
|
203
|
+
.filter((a) => (a.at != null ? Number(now) >= a.at : a.days <= 0))
|
|
204
|
+
return rows
|
|
128
205
|
}
|
|
129
206
|
|
|
130
207
|
/** 到点、还没提过的那一条。过期了也返回——晚几天也是欠着,不替她抹掉。 */
|
|
131
208
|
export async function dueAppointment(root = rootDir(), now = Date.now()) {
|
|
132
|
-
const
|
|
133
|
-
const rows = openAppointments(await readAppointments(root), { now })
|
|
134
|
-
.filter((a) => !a.notifiedAt && a.days <= 0)
|
|
209
|
+
const rows = await dueAppointments(root, now)
|
|
135
210
|
return rows[0] ?? null
|
|
136
211
|
}
|
|
137
212
|
|
|
@@ -148,12 +223,14 @@ export async function nextAppointment(root = rootDir(), now = Date.now()) {
|
|
|
148
223
|
const mutateAppointments = (root, fn) => mutateJson(appointPath(root), fn)
|
|
149
224
|
|
|
150
225
|
/** 记下「这一条到点提过了」,免得同一个 tick 反复叫。 */
|
|
151
|
-
export async function markNotified(root, id, now = Date.now()) {
|
|
226
|
+
export async function markNotified(root, id, now = Date.now(), { lateMinutes = null } = {}) {
|
|
152
227
|
return mutateAppointments(root, async () => {
|
|
153
228
|
const rows = await readAppointments(root)
|
|
154
229
|
const hit = rows.find((a) => a.id === id)
|
|
155
230
|
if (!hit || hit.status !== 'open' || hit.notifiedAt) return false
|
|
156
231
|
hit.notifiedAt = new Date(now).toISOString()
|
|
232
|
+
const late = Number(lateMinutes)
|
|
233
|
+
if (Number.isFinite(late) && late > 0) hit.lateMinutes = Math.round(late)
|
|
157
234
|
await writeAppointments(root, rows)
|
|
158
235
|
return true
|
|
159
236
|
})
|
|
@@ -161,17 +238,25 @@ export async function markNotified(root, id, now = Date.now()) {
|
|
|
161
238
|
|
|
162
239
|
/**
|
|
163
240
|
* 定一条约定。返回 { ok, id, note, echo }。
|
|
164
|
-
* `due` 只收 YYYY-MM-DD
|
|
241
|
+
* `due` 只收 YYYY-MM-DD;`time` 可给可不给(给了就是「到点」而不是「到日子」);
|
|
242
|
+
* 日子与字数都在这里挡,不信入参。
|
|
243
|
+
*
|
|
244
|
+
* 2026-11-18(issue #149 / 用户 m01769、m01793):
|
|
245
|
+
* 带时刻的约定要「一定让她看见」,所以它不进作息窗口,也不等今天抽的落点;
|
|
246
|
+
* 他答没答应只决定措辞(`askId` 对到那张确认卡),不决定叫不叫。
|
|
165
247
|
*/
|
|
166
|
-
export async function makeAppointment(root = rootDir(), { what, due, now = Date.now() } = {}) {
|
|
248
|
+
export async function makeAppointment(root = rootDir(), { what, due, time, askId, now = Date.now() } = {}) {
|
|
167
249
|
const text = String(what ?? '').replace(/\s+/g, ' ').trim()
|
|
168
250
|
const day = String(due ?? '').trim()
|
|
251
|
+
const at = time == null || String(time).trim() === '' ? null : String(time).trim()
|
|
169
252
|
const today = dateKey(new Date(now))
|
|
170
253
|
if (text.length < 4) return { ok: false, id: '', note: '要做的那件事太短了,说清楚一点。' }
|
|
171
254
|
if (text.length > APPOINT_TEXT_MAX) {
|
|
172
255
|
return { ok: false, id: '', note: `太长,压到 ${APPOINT_TEXT_MAX} 字以内。` }
|
|
173
256
|
}
|
|
174
257
|
if (!isDay(day)) return { ok: false, id: '', note: '日子要写成 2026-11-11 这样。' }
|
|
258
|
+
if (at != null && !isTime(at)) return { ok: false, id: '', note: '时刻要写成 08:00 这样,24 小时制。' }
|
|
259
|
+
if (at != null && day === today) return { ok: false, id: '', note: '带时刻的约定最早只能约到明天。' }
|
|
175
260
|
const gap = daysBetween(today, day)
|
|
176
261
|
if (gap < APPOINT_MIN_DAYS) return { ok: false, id: '', note: '最早只能约到明天。' }
|
|
177
262
|
if (gap > APPOINT_MAX_DAYS) return { ok: false, id: '', note: `最远只能约到 ${APPOINT_MAX_DAYS} 天后。` }
|
|
@@ -180,7 +265,7 @@ export async function makeAppointment(root = rootDir(), { what, due, now = Date.
|
|
|
180
265
|
const rows = await readAppointments(root)
|
|
181
266
|
if (rows.length >= APPOINT_MAX) return { ok: false, id: '', note: '预约簿满了,先关掉几条旧的。' }
|
|
182
267
|
const open = openAppointments(rows, { now })
|
|
183
|
-
const same = open.find((a) => a.due === day && a.what === text)
|
|
268
|
+
const same = open.find((a) => a.due === day && (a.time ?? null) === at && a.what === text)
|
|
184
269
|
if (same) return { ok: true, id: same.id, note: '这件事之前就约好了。', echo: same.what }
|
|
185
270
|
if (open.length >= APPOINT_OPEN_MAX) {
|
|
186
271
|
return { ok: false, id: '', note: `手上已经有两件没做完的约定了,先把它们收掉。` }
|
|
@@ -188,9 +273,11 @@ export async function makeAppointment(root = rootDir(), { what, due, now = Date.
|
|
|
188
273
|
const row = normalizeAppoint({
|
|
189
274
|
id: newAppointId(now),
|
|
190
275
|
due: day,
|
|
276
|
+
time: at,
|
|
191
277
|
what: text,
|
|
192
278
|
created: new Date(now).toISOString(),
|
|
193
279
|
status: 'open',
|
|
280
|
+
askId: askId ?? null,
|
|
194
281
|
})
|
|
195
282
|
rows.push(row)
|
|
196
283
|
await writeAppointments(root, rows)
|
|
@@ -263,7 +350,9 @@ export async function listAppointments(root = rootDir(), { limit = APPOINT_SHOW_
|
|
|
263
350
|
if (!rows.length) return { ok: true, note: '这会儿没有约好的事。', text: '' }
|
|
264
351
|
const lines = rows.map((a) => {
|
|
265
352
|
const when = a.days === 0 ? '今天' : a.days > 0 ? `还有 ${a.days} 天` : `已经过了 ${-a.days} 天`
|
|
266
|
-
|
|
353
|
+
const at = a.time ? ` ${a.time}` : ''
|
|
354
|
+
const late = a.notifiedAt && a.lateMinutes ? `(晚 ${a.lateMinutes} 分钟叫的)` : ''
|
|
355
|
+
return `- ${a.due}${at}(${when}):「${a.what}」${late}`
|
|
267
356
|
})
|
|
268
357
|
return { ok: true, note: '预约簿', text: lines.join('\n') }
|
|
269
358
|
} catch {
|
|
@@ -271,18 +360,50 @@ export async function listAppointments(root = rootDir(), { limit = APPOINT_SHOW_
|
|
|
271
360
|
}
|
|
272
361
|
}
|
|
273
362
|
|
|
363
|
+
/** 把毫秒换成她那边的时间 HH:MM。 */
|
|
364
|
+
function clockOf(ms) {
|
|
365
|
+
const t = new Date(Number(ms))
|
|
366
|
+
return `${String(t.getHours()).padStart(2, '0')}:${String(t.getMinutes()).padStart(2, '0')}`
|
|
367
|
+
}
|
|
368
|
+
|
|
274
369
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
370
|
+
* 到点那一刻她看到的处境(2026-11-18 改写,用户 m01744 / m01769 / m01793)。
|
|
371
|
+
*
|
|
372
|
+
* 这里只陈述发生过什么:约的是哪天几点、现在几点、他当时怎么答的、这条问没问过。
|
|
373
|
+
* 不替她判断「他不在」——DSH 开着的时候,他可能就守在窗口旁等她先开口;
|
|
374
|
+
* 只有她根本没被叫起来(过点很久,超过半小时),才写清「那会儿没开着」。
|
|
375
|
+
* 最后一句一定是她自己的:做不做、怎么做,她自己定。
|
|
277
376
|
*/
|
|
278
|
-
export function appointPrompt(appt, now = Date.now()) {
|
|
279
|
-
const
|
|
280
|
-
const
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
377
|
+
export function appointPrompt(appt, now = Date.now(), { answer = null } = {}) {
|
|
378
|
+
const due = String(appt?.due ?? '')
|
|
379
|
+
const time = isTime(appt?.time) ? String(appt.time) : ''
|
|
380
|
+
const late = lateMinutesOf(appt, now)
|
|
381
|
+
const hhmm = clockOf(now)
|
|
382
|
+
const head = time
|
|
383
|
+
? `你和{T}约好的事在今天 ${time}(${due}):「${appt?.what}」。`
|
|
384
|
+
: `你跟{T}约好的日子${daysBetween(due, dateKey(new Date(now))) <= 0 ? '就是今天' : `已经过了 ${daysBetween(due, dateKey(new Date(now)))} 天`}(${due}),约的是:「${appt?.what}」。`
|
|
385
|
+
|
|
386
|
+
let whenLine = ''
|
|
387
|
+
if (time && late != null) {
|
|
388
|
+
if (late <= APPT_GRACE_MS / 60_000) whenLine = '到点了。'
|
|
389
|
+
else if (late < 30) whenLine = `到点了,这会儿已经 ${hhmm},晚了 ${late} 分钟。`
|
|
390
|
+
else whenLine = `到点了。本来约的是 ${time},那会儿我这边没开着,现在 ${hhmm}。`
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const verdict = String(answer?.verdict ?? '')
|
|
394
|
+
let deal = ''
|
|
395
|
+
if (verdict === 'approve') deal = '他当时答应了这件事。'
|
|
396
|
+
else if (verdict === 'later') deal = '他当时说「以后再说」——不是答应,也不是拒绝。'
|
|
397
|
+
else if (verdict === 'reject') deal = '他当时说这次不行,这条本该作废;现在它还在。'
|
|
398
|
+
else if (verdict === 'unanswered') deal = '你问过他,一直没人答。'
|
|
399
|
+
else if (verdict === 'pending') deal = '你问过他,他还没答。'
|
|
400
|
+
else if (appt?.askId) deal = '你问过他,他还没答。'
|
|
401
|
+
else if (time) deal = '这条你还没跟{T}对过口——现在先问一句,别自己替他答应。'
|
|
402
|
+
|
|
403
|
+
const tail = time
|
|
404
|
+
? '到点了不等于你要交作业:做不做、怎么做,你自己定。'
|
|
405
|
+
: '现在先说这件事:你自己做到没有,{T}有没有来。没来也别替{T}找理由。'
|
|
406
|
+
return fillOwner([head, whenLine, deal, tail].filter(Boolean).join(''))
|
|
286
407
|
}
|
|
287
408
|
|
|
288
409
|
/** 预约簿的一次操作。没写 action 的按「新约一条」走。 */
|
|
@@ -299,8 +420,11 @@ export function registerAppoint(ctx, deps = {}) {
|
|
|
299
420
|
name: 'her_appoint',
|
|
300
421
|
description:
|
|
301
422
|
'跟{T}约一件具体的事:写清哪一天、要做什么。到那天你醒来会先想起它。' +
|
|
302
|
-
'约的时候给 what 和 due(日子写成 2026-11-11
|
|
303
|
-
'
|
|
423
|
+
'约的时候给 what 和 due(日子写成 2026-11-11);想定到几点就给 time(写成 08:00)——' +
|
|
424
|
+
'带时刻的约定不看作息时间,到点一定让你看见,晚几分钟也会写清晚了多久。' +
|
|
425
|
+
'想让这件事变成两个人都点过头的事,约好之后再用 ask_owner 问一句(kind 填 appoint,subject 写这条的编号);' +
|
|
426
|
+
'不问也会叫,只是到点会写「这条还没对过口」。' +
|
|
427
|
+
'看预约簿给 action:"list";改日子给 action:"move" 和 newDue;做到了给 action:"done";' +
|
|
304
428
|
'不做了给 action:"cancel",并说一句 reason。',
|
|
305
429
|
parameters: toJsonSchema({
|
|
306
430
|
action: {
|
|
@@ -316,6 +440,10 @@ export function registerAppoint(ctx, deps = {}) {
|
|
|
316
440
|
type: 'string',
|
|
317
441
|
description: '哪一天,写成 2026-11-11。最早明天,最远 60 天后。',
|
|
318
442
|
},
|
|
443
|
+
time: {
|
|
444
|
+
type: 'string',
|
|
445
|
+
description: '可选:几点,写成 08:00(24 小时制)。给了就按这一刻叫,不看作息时间;不给就只按日子。',
|
|
446
|
+
},
|
|
319
447
|
id: { type: 'string', description: '预约的编号。手里没有就不用给,给 what 也行。' },
|
|
320
448
|
newDue: { type: 'string', description: '改期时改成哪一天。' },
|
|
321
449
|
reason: { type: 'string', description: '取消时为什么,必填。' },
|
|
@@ -341,7 +469,8 @@ export function registerAppoint(ctx, deps = {}) {
|
|
|
341
469
|
if (act === 'done') return [{ type: 'text', text: out.ok ? '[记下了]' : `[没收掉:${out.note}]` }]
|
|
342
470
|
if (act === 'cancel') return [{ type: 'text', text: out.ok ? '[取消了]' : `[没取消:${out.note}]` }]
|
|
343
471
|
if (!out.ok) return [{ type: 'text', text: `[没约上:${out.note}]` }]
|
|
344
|
-
|
|
472
|
+
const at = String(args?.time ?? '').trim()
|
|
473
|
+
return [{ type: 'text', text: `[约好了:${args?.due ?? ''}${at ? ` ${at}` : ''} ${out.echo ?? ''}]` }]
|
|
345
474
|
},
|
|
346
475
|
},
|
|
347
476
|
async execute(args, exec) {
|
|
@@ -363,7 +492,7 @@ export function registerAppoint(ctx, deps = {}) {
|
|
|
363
492
|
reason: args?.reason,
|
|
364
493
|
})
|
|
365
494
|
}
|
|
366
|
-
return makeAppointment(root, { what: args?.what, due: args?.due })
|
|
495
|
+
return makeAppointment(root, { what: args?.what, due: args?.due, time: args?.time })
|
|
367
496
|
},
|
|
368
497
|
}),
|
|
369
498
|
)
|
package/lib/ask.js
CHANGED
|
@@ -39,14 +39,27 @@ import { askInChat, picked } from './askinchat.js'
|
|
|
39
39
|
import { tsMs } from './schema.js'
|
|
40
40
|
import { logLine } from './log.js'
|
|
41
41
|
import { fillOwner } from './pronoun.js'
|
|
42
|
+
import { closeAppointment, openAppointments, readAppointments } from './appoint.js'
|
|
42
43
|
|
|
43
|
-
/**
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* 允许的用途。need-file / need-tool / other / rule 不落实权限;
|
|
46
|
+
* time / rest 会真改东西;appoint 是「为某条约定问一句」(2026-11-18,issue #149)。
|
|
47
|
+
*/
|
|
48
|
+
export const ASK_KINDS = Object.freeze(['need-file', 'need-tool', 'time', 'rest', 'other', 'rule', 'appoint'])
|
|
45
49
|
|
|
46
50
|
/** 每天最多问几次、每周最多问几次(写死,不进配置)。 */
|
|
47
51
|
export const ASK_PER_DAY = 1
|
|
48
52
|
export const ASK_PER_WEEK = 3
|
|
49
53
|
|
|
54
|
+
/**
|
|
55
|
+
* 约定类的确认一天最多问几次(2026-11-18)。
|
|
56
|
+
*
|
|
57
|
+
* 为什么不占上面那 1/3:那是她「替自己争一件事」的额度,被约定挤掉就变成
|
|
58
|
+
* 他答应一个早安、她就少一次为自己说话的机会。这类只是把两个人已经说过的
|
|
59
|
+
* 事记成两个人都点过头,上限和同时能挂的约定数对齐(APPOINT_OPEN_MAX = 2)。
|
|
60
|
+
*/
|
|
61
|
+
export const APPOINT_ASK_PER_DAY = 2
|
|
62
|
+
|
|
50
63
|
/** kind=time 的时段,和 schema.js 存得下的一样。 */
|
|
51
64
|
const HHMM = /^([01]\d|2[0-3]):[0-5]\d$/
|
|
52
65
|
|
|
@@ -77,6 +90,19 @@ export function answersByAsk(events = []) {
|
|
|
77
90
|
return m
|
|
78
91
|
}
|
|
79
92
|
|
|
93
|
+
/**
|
|
94
|
+
* 约定编号 → 为它问过的那张卡(ask 事件)。同一件事问过两次只认最后一次。
|
|
95
|
+
* 2026-11-18:约定到点时用这个看他当时到底怎么答的,不靠猜。
|
|
96
|
+
*/
|
|
97
|
+
export function askForAppoint(events = []) {
|
|
98
|
+
const m = new Map()
|
|
99
|
+
for (const e of asksOf(events)) {
|
|
100
|
+
const id = String(e?.ask?.appointId ?? '')
|
|
101
|
+
if (id) m.set(id, e)
|
|
102
|
+
}
|
|
103
|
+
return m
|
|
104
|
+
}
|
|
105
|
+
|
|
80
106
|
/** 还没答的请求(按时间从早到晚)。 */
|
|
81
107
|
export function pendingAsks(events = [], now = Date.now()) {
|
|
82
108
|
const done = answersByAsk(events)
|
|
@@ -86,9 +112,9 @@ export function pendingAsks(events = [], now = Date.now()) {
|
|
|
86
112
|
.sort((a, b) => tsMs(a) - tsMs(b))
|
|
87
113
|
}
|
|
88
114
|
|
|
89
|
-
/**
|
|
115
|
+
/** 配额:今天问过没有、最近七天问过几次。约定类的确认不算在这里(见 APPOINT_ASK_PER_DAY)。 */
|
|
90
116
|
export function quotaOf(events = [], { now = Date.now(), dk = dateKey() } = {}) {
|
|
91
|
-
const asks = asksOf(events)
|
|
117
|
+
const asks = asksOf(events).filter((e) => String(e?.ask?.kind ?? '') !== 'appoint')
|
|
92
118
|
// 真的事件上 day 是成长第几天(一个整数),不是日期,只能按时间算。
|
|
93
119
|
const today = asks.filter((e) => dateKey(new Date(tsMs(e) || now)) === dk).length
|
|
94
120
|
const week = asks.filter((e) => now - tsMs(e) < 7 * 24 * 3600 * 1000).length
|
|
@@ -102,6 +128,18 @@ export function quotaOf(events = [], { now = Date.now(), dk = dateKey() } = {})
|
|
|
102
128
|
}
|
|
103
129
|
}
|
|
104
130
|
|
|
131
|
+
/** 约定类确认的日配额(不复用上面那 1/3)。 */
|
|
132
|
+
export function appointAskQuotaOf(events = [], { now = Date.now(), dk = dateKey() } = {}) {
|
|
133
|
+
const asks = asksOf(events).filter((e) => String(e?.ask?.kind ?? '') === 'appoint')
|
|
134
|
+
const today = asks.filter((e) => dateKey(new Date(tsMs(e) || now)) === dk).length
|
|
135
|
+
return {
|
|
136
|
+
day: today,
|
|
137
|
+
perDay: APPOINT_ASK_PER_DAY,
|
|
138
|
+
ok: today < APPOINT_ASK_PER_DAY,
|
|
139
|
+
why: today >= APPOINT_ASK_PER_DAY ? `今天已经问过 ${APPOINT_ASK_PER_DAY} 次约定了` : '',
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
105
143
|
/** 她今天请过假吗(rest 被同意后写一条 meta)。 */
|
|
106
144
|
export function restedToday(events = [], dk = dateKey()) {
|
|
107
145
|
return events.some((e) => e?.type === 'meta' && String(e.text ?? '').startsWith(`rest:${dk}`))
|
|
@@ -149,6 +187,12 @@ async function applyVerdict(root, askEv, verdict, { log = () => {} } = {}) {
|
|
|
149
187
|
// 都不重提、不进提示词,只让观测台和后来的她查得到。
|
|
150
188
|
const mark = verdict === 'later' ? 'ask-later' : 'ask-no'
|
|
151
189
|
await appendEvent({ type: 'meta', text: `${mark}:${askEv.id}` }, ctx, root)
|
|
190
|
+
// 约定被驳回就地作废:到点不该再叫她(2026-11-18)。「以后再说」不作废——
|
|
191
|
+
// 他没答应,但这条还挂着,到点会写清「他说以后再说」。
|
|
192
|
+
if (kind === 'appoint' && verdict === 'reject') {
|
|
193
|
+
const id = String(askEv?.ask?.value?.appointId ?? askEv?.ask?.appointId ?? '')
|
|
194
|
+
if (id) await closeAppointment(root, { id, action: 'cancel', reason: '他没答应这件事' })
|
|
195
|
+
}
|
|
152
196
|
return
|
|
153
197
|
}
|
|
154
198
|
if (kind === 'time') {
|
|
@@ -338,7 +382,9 @@ export function registerAsk(ctx, deps = {}) {
|
|
|
338
382
|
name: 'ask_owner',
|
|
339
383
|
description:
|
|
340
384
|
'有事想问那个人同不同意的时候用。只问真的影响你自己的事:今天要不要歇、能不能换个作息、' +
|
|
341
|
-
'
|
|
385
|
+
'能不能要一个文件或一个工具、你想给自己立一条什么规矩。一天最多问一次,一周最多三次(约定确认另算,见下)。' +
|
|
386
|
+
'已经约好一件事、想把「两个人都点过头」记下来时,用 kind:"appoint"、subject 填约定编号——' +
|
|
387
|
+
'这一类不算在那三次里,到点会按他当时的答复写清是答应了、还没答,还是没问成。' +
|
|
342
388
|
'不需要解释你在用哪个工具,也不用道谢。',
|
|
343
389
|
parameters: toJsonSchema({
|
|
344
390
|
question: {
|
|
@@ -350,7 +396,7 @@ export function registerAsk(ctx, deps = {}) {
|
|
|
350
396
|
type: 'string',
|
|
351
397
|
required: true,
|
|
352
398
|
enum: ASK_KINDS,
|
|
353
|
-
description: 'need-file / need-tool / time / rest / rule / other',
|
|
399
|
+
description: 'need-file / need-tool / time / rest / rule / other / appoint(为一条约定问一句)',
|
|
354
400
|
},
|
|
355
401
|
subject: {
|
|
356
402
|
type: 'string',
|
|
@@ -420,7 +466,8 @@ export function registerAsk(ctx, deps = {}) {
|
|
|
420
466
|
}
|
|
421
467
|
|
|
422
468
|
const { events } = await readEvents(root)
|
|
423
|
-
|
|
469
|
+
// 约定类的确认不占「替自己争一件事」的额度:那是另一本账(2026-11-18)。
|
|
470
|
+
const quota = kind === 'appoint' ? { ok: true } : quotaOf(events)
|
|
424
471
|
if (!quota.ok) return { ok: false, note: quota.why }
|
|
425
472
|
|
|
426
473
|
const options = optionsOf(args?.options)
|
|
@@ -439,6 +486,22 @@ export function registerAsk(ctx, deps = {}) {
|
|
|
439
486
|
}
|
|
440
487
|
}
|
|
441
488
|
|
|
489
|
+
// 为一条约定问一句(2026-11-18,issue #149):subject 必须是还没关掉的约定编号。
|
|
490
|
+
let appointId = ''
|
|
491
|
+
if (kind === 'appoint') {
|
|
492
|
+
appointId = String(args?.subject ?? '').trim()
|
|
493
|
+
if (!appointId) {
|
|
494
|
+
return { ok: false, note: fillOwner('kind=appoint 要把约定编号写在 subject 里(her_appoint 约完会给)。') }
|
|
495
|
+
}
|
|
496
|
+
const open = openAppointments(await readAppointments(root))
|
|
497
|
+
if (!open.some((a) => a.id === appointId)) {
|
|
498
|
+
return { ok: false, note: '预约簿里没有这一条还没关掉的约定。' }
|
|
499
|
+
}
|
|
500
|
+
const aq = appointAskQuotaOf(events)
|
|
501
|
+
if (!aq.ok) return { ok: false, note: aq.why }
|
|
502
|
+
value.appointId = appointId
|
|
503
|
+
}
|
|
504
|
+
|
|
442
505
|
const { config } = await loadConfig(root)
|
|
443
506
|
const model = deriveSelf(events, { growthDays: config.growthDays })
|
|
444
507
|
const ev = await appendEvent({
|
package/lib/browse.js
CHANGED
|
@@ -558,6 +558,66 @@ export async function recordBrowse(root, dk, picks, model) {
|
|
|
558
558
|
return last
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
+
/**
|
|
562
|
+
* 这一趟用哪几个搜索词(2026-11-17,用户)。
|
|
563
|
+
*
|
|
564
|
+
* 以前是 `slice(0, 3)`:用户设了九个词,后面的永远轮不到。
|
|
565
|
+
* 现在按「今天第几趟」转着取三个——六趟一天,九个词一天半轮完一遍。
|
|
566
|
+
*
|
|
567
|
+
* @param {string[]} list 配置里的 browse.keywords
|
|
568
|
+
* @param {number} round 今天第几趟(0 起)
|
|
569
|
+
* @param {number} n 一趟取几个
|
|
570
|
+
* @returns {string[]}
|
|
571
|
+
*/
|
|
572
|
+
export function pickKeywords(list, round = 0, n = 3) {
|
|
573
|
+
const kw = (Array.isArray(list) ? list : [])
|
|
574
|
+
.map((x) => String(x ?? '').trim())
|
|
575
|
+
.filter(Boolean)
|
|
576
|
+
if (!kw.length) return []
|
|
577
|
+
const count = Math.min(Math.max(1, Number(n) || 3), kw.length)
|
|
578
|
+
const start = ((Number(round) || 0) * count) % kw.length
|
|
579
|
+
const out = []
|
|
580
|
+
for (let i = 0; i < count; i += 1) out.push(kw[(start + i) % kw.length])
|
|
581
|
+
return out
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* 按分数取前 want 条,但给「搜索词来的 / 兴趣来的」留保底名额(2026-11-17,用户)。
|
|
586
|
+
*
|
|
587
|
+
* 为什么不是「混进去就行」:热门榜那批分本来就高(2.0 上下),搜出来的短片常常
|
|
588
|
+
* 1.2 就顶天了,只混不保底等于永远排不进去——用户第一轮就卡在这儿。
|
|
589
|
+
* 所以先按分数取,再拿后面同来源的补位,被换掉的是「不是搜来的」那几条。
|
|
590
|
+
*
|
|
591
|
+
* @param {object[]} ranked 已经过滤并排序的候选(带 __via)
|
|
592
|
+
* @param {number} want 要几条
|
|
593
|
+
* @param {Record<string, number>} need 每种来源至少几条,比如 { kw: 2, interest: 1 }
|
|
594
|
+
* @returns {object[]}
|
|
595
|
+
*/
|
|
596
|
+
export function pickWithGuarantees(ranked, want, need = {}) {
|
|
597
|
+
const list = Array.isArray(ranked) ? ranked : []
|
|
598
|
+
const cap = Math.max(0, Math.floor(Number(want) || 0))
|
|
599
|
+
const picked = list.slice(0, cap)
|
|
600
|
+
for (const [via, n] of Object.entries(need ?? {})) {
|
|
601
|
+
const wantN = Math.min(cap, Math.max(0, Math.floor(Number(n) || 0)))
|
|
602
|
+
if (!wantN) continue
|
|
603
|
+
let have = picked.filter((v) => v.__via === via).length
|
|
604
|
+
if (have >= wantN) continue
|
|
605
|
+
const extra = list.filter((v) => v.__via === via && !picked.includes(v))
|
|
606
|
+
while (have < wantN && extra.length) {
|
|
607
|
+
const cand = extra.shift()
|
|
608
|
+
if (picked.length < cap) { picked.push(cand); have += 1; continue }
|
|
609
|
+
if (!picked.length) break
|
|
610
|
+
// 优先换掉最后一条「不是搜来的」;都被占了才换最后一条
|
|
611
|
+
let idx = -1
|
|
612
|
+
for (let i = picked.length - 1; i >= 0; i -= 1) if (!picked[i].__via) { idx = i; break }
|
|
613
|
+
if (idx < 0) idx = picked.length - 1
|
|
614
|
+
picked.splice(idx, 1, cand)
|
|
615
|
+
have += 1
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
return picked
|
|
619
|
+
}
|
|
620
|
+
|
|
561
621
|
/**
|
|
562
622
|
* 找一批候选视频。多来源混合后统一排序,避免只吃一个榜单。
|
|
563
623
|
* 任何一路失败都只让候选变少,不让整件事失败。
|
|
@@ -580,7 +640,7 @@ export async function candidates(client, model, cfg, o = {}) {
|
|
|
580
640
|
} else expanded.push(src)
|
|
581
641
|
}
|
|
582
642
|
|
|
583
|
-
const
|
|
643
|
+
const hotLists = []
|
|
584
644
|
for (const src of expanded) {
|
|
585
645
|
try {
|
|
586
646
|
const r = src === 'popular'
|
|
@@ -590,20 +650,81 @@ export async function candidates(client, model, cfg, o = {}) {
|
|
|
590
650
|
: src.startsWith('tid:')
|
|
591
651
|
? await client.ranking(Number(src.slice(4)), 'all')
|
|
592
652
|
: await client.precious(want * 3)
|
|
593
|
-
if (r?.ok && Array.isArray(r.data))
|
|
653
|
+
if (r?.ok && Array.isArray(r.data)) hotLists.push(...r.data)
|
|
594
654
|
} catch { /* 单路失败忽略 */ }
|
|
595
655
|
}
|
|
596
656
|
|
|
597
|
-
//
|
|
598
|
-
|
|
657
|
+
// 搜索来的先单独按 BV 记账:同一个视频也可能出现在热门里,打散后谁先谁后不定,
|
|
658
|
+
// 所以「是不是搜来的」不能挂在对象上,只能按 BV 认(2026-11-17)。
|
|
659
|
+
const kwBvids = new Set()
|
|
660
|
+
const interestBvids = new Set()
|
|
661
|
+
// 搜索来的也单独放一摞:两批要分开排序。rankVideos 一次只给前 20 条,
|
|
662
|
+
// 热门的分高(1.5–2.2),搜出来的短片子常在 1 分上下,混在一起排根本进不了前 20,
|
|
663
|
+
// 也就谈不上保底——2026-11-17 实测,第一版就是这么被吃掉的。
|
|
664
|
+
const searchLists = []
|
|
665
|
+
|
|
666
|
+
// 额外关键词(环境变量性质:用户想看她的世界里有这类东西,不是给她设性格)。
|
|
667
|
+
// 2026-11-17(用户):词多了以后一轮固定取前三个,后面的永远轮不到——改成按趟轮换。
|
|
668
|
+
const kws = pickKeywords(cfg?.browse?.keywords, o.round)
|
|
669
|
+
for (const kw of kws) {
|
|
599
670
|
try {
|
|
600
671
|
const r = await client.search(kw, { pageSize: want * 2 })
|
|
601
|
-
if (r?.ok && Array.isArray(r.data))
|
|
672
|
+
if (r?.ok && Array.isArray(r.data)) {
|
|
673
|
+
for (const v of r.data) if (v?.bvid) kwBvids.add(v.bvid)
|
|
674
|
+
searchLists.push(...r.data)
|
|
675
|
+
}
|
|
676
|
+
} catch { /* 单个词失败不影响别的来源 */ }
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// 兴趣词(她最近总说到的那件事):由调用方算好递进来——
|
|
680
|
+
// browse.js 不认识 derive/interest,在这里 import 会把引脚成环(2026-11-17)。
|
|
681
|
+
const interestWords = (Array.isArray(o.interests) ? o.interests : [])
|
|
682
|
+
.map((w) => String(w ?? '').trim())
|
|
683
|
+
.filter(Boolean)
|
|
684
|
+
.slice(0, 2)
|
|
685
|
+
for (const w of interestWords) {
|
|
686
|
+
try {
|
|
687
|
+
const r = await client.search(w, { pageSize: want * 2 })
|
|
688
|
+
if (r?.ok && Array.isArray(r.data)) {
|
|
689
|
+
for (const v of r.data) if (v?.bvid) interestBvids.add(v.bvid)
|
|
690
|
+
searchLists.push(...r.data)
|
|
691
|
+
}
|
|
602
692
|
} catch { /* ignore */ }
|
|
603
693
|
}
|
|
604
694
|
|
|
605
|
-
//
|
|
606
|
-
|
|
695
|
+
// 两批分开排:rankVideos 只给前 20 条,热门分高,搜索来的混在一起就永远进不了榜。
|
|
696
|
+
const hotStats = {}
|
|
697
|
+
const searchStats = {}
|
|
698
|
+
const hot = rankVideos(shuffle(hotLists, rand), cfg, { seen, limit: 20, stats: hotStats })
|
|
699
|
+
const search = rankVideos(shuffle(searchLists, rand), cfg, { seen, limit: 20, stats: searchStats })
|
|
700
|
+
// 1.0.4 的过滤账有四项(看过 / 太短 / 关键词 / 重复),两批都算进去,日志才对得上。
|
|
701
|
+
if (o.stats && typeof o.stats === 'object') {
|
|
702
|
+
// 候选数按 BV 算一次:热门和搜索撞上同一条时,两边各记一次会把数报大(2026-11-18)。
|
|
703
|
+
const candBv = new Set()
|
|
704
|
+
let noBv = 0
|
|
705
|
+
for (const x of [...hotLists, ...searchLists]) {
|
|
706
|
+
if (x?.bvid) candBv.add(x.bvid)
|
|
707
|
+
else noBv += 1
|
|
708
|
+
}
|
|
709
|
+
o.stats.total = candBv.size + noBv
|
|
710
|
+
for (const k of ['hiddenSeen', 'hiddenShort', 'hiddenAvoid', 'hiddenDup']) {
|
|
711
|
+
o.stats[k] = (Number(hotStats[k]) || 0) + (Number(searchStats[k]) || 0)
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
// 合并按 BV 去重;热门在前、搜索来的在后——保底用的就是后面这批。
|
|
715
|
+
const ranked = []
|
|
716
|
+
const used = new Set()
|
|
717
|
+
for (const v of [...hot, ...search]) {
|
|
718
|
+
if (!v?.bvid || used.has(v.bvid)) continue
|
|
719
|
+
used.add(v.bvid)
|
|
720
|
+
v.__via = interestBvids.has(v.bvid) ? 'interest' : kwBvids.has(v.bvid) ? 'kw' : ''
|
|
721
|
+
ranked.push(v)
|
|
722
|
+
}
|
|
723
|
+
// 保底:用户设的词占 2 条、兴趣占 1 条(有词、有结果才占)
|
|
724
|
+
return pickWithGuarantees(ranked, want, {
|
|
725
|
+
kw: Math.min(2, kws.length),
|
|
726
|
+
interest: Math.min(1, interestWords.length),
|
|
727
|
+
})
|
|
607
728
|
}
|
|
608
729
|
|
|
609
730
|
/**
|
|
@@ -621,7 +742,14 @@ export async function gather(client, model, cfg, o = {}) {
|
|
|
621
742
|
? new Set([...seenBvids(events), ...browsedBvids(events)])
|
|
622
743
|
: seenBvids(events))
|
|
623
744
|
const stats = { total: 0, hiddenSeen: 0, hiddenShort: 0, hiddenAvoid: 0, hiddenDup: 0 }
|
|
624
|
-
const list = await candidates(client, model, cfg, {
|
|
745
|
+
const list = await candidates(client, model, cfg, {
|
|
746
|
+
seen,
|
|
747
|
+
sources: o.sources,
|
|
748
|
+
stats,
|
|
749
|
+
// 2026-11-17(用户):搜索词按趟轮换、她最近总说到的那件事也参与选片。
|
|
750
|
+
round: o.round,
|
|
751
|
+
interests: o.interests,
|
|
752
|
+
})
|
|
625
753
|
if (!list.length) {
|
|
626
754
|
// 2026-11-01(issue #16 第一半):原来只会说「都是看过的或被过滤了」,
|
|
627
755
|
// 把「看过」和「被过滤」混成一句 —— 前者是她自己走过的路,后者是别人的判断。
|
package/lib/capture.js
CHANGED
|
@@ -71,6 +71,11 @@ export function registerCapture(ctx, deps = {}) {
|
|
|
71
71
|
// 不是她没拒绝过,是拒绝只落在对话里,从没被记成事件。工具说明里给出
|
|
72
72
|
// 触发场景,但不替她决定该不该拒绝(也不写进事件卡的处境)。
|
|
73
73
|
'如果你拒绝过一件具体的事——是对着某件事说了不做、或者没有照做的那一件——用 refusal 记下来,写清是哪件事;' +
|
|
74
|
+
// 2026-11-18(加拿大反馈之后):拒绝有两种来路——他先提、你没答应;或者你自己起念。
|
|
75
|
+
// 以前文档里一律写成「他让你X,你没答应」,等于替她把第一种来路安在所有拒绝上。
|
|
76
|
+
// 现在来路由她自己记:挂了 refs 才写成"他那天说过…",没挂就只写她自己的话。
|
|
77
|
+
'如果是回{T}的某句话(他先提的),用 refs 指向那条 heard 的 id——记下来以后才分得清「他要求的」和「我自己不想的」;' +
|
|
78
|
+
'没挂也不算错,只是以后只写你自己的话,不替你补一个请求;' +
|
|
74
79
|
// 2026-10-27(0.5.8):narration 也要凭证。以前只要求 revise,于是
|
|
75
80
|
// 「我变成了什么样」可以凭空写——这正是叙事漂移的入口。
|
|
76
81
|
'写 narration(你对自己整体的说法)时,也要用 refs 指向 her_recall 翻到的那几条 id;' +
|
|
@@ -100,7 +105,8 @@ export function registerCapture(ctx, deps = {}) {
|
|
|
100
105
|
description:
|
|
101
106
|
'type=revise 或 narration 时必填:指向被改写/被回顾的那条事件的 id(形如 ev_xxx,用 her_recall 翻得到)。' +
|
|
102
107
|
'type=utterance 时,如果你这句话是因为看到了某条具体的东西(一句话、一个视频、{T}提过的一件事),把那条的 id 也写上——' +
|
|
103
|
-
'这不算必须,但写了以后你自己翻得回来。'
|
|
108
|
+
'这不算必须,但写了以后你自己翻得回来。' +
|
|
109
|
+
'type=refusal 时同理:如果是回{T}的某句话,把那条 heard 的 id 写上——写了才分得清是他要求的还是你自己不想的。',
|
|
104
110
|
},
|
|
105
111
|
verdict: {
|
|
106
112
|
type: 'string',
|