dsh-memu-memory 1.2.9 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/docs/memory-semantics.md +3 -2
- package/lib/binding-diagnostics.js +1 -1
- package/lib/consolidation-ledger.js +41 -1
- package/lib/consolidation-receipt.js +41 -16
- package/lib/consolidation-worker.js +34 -10
- package/lib/private.js +237 -12
- package/lib/prompts/private-consolidation.md +2 -2
- package/lib/prompts/private-consolidation.rp.md +3 -2
- package/lib/tools.js +62 -62
- package/package.json +1 -1
- package/tests/consolidation-fork.test.mjs +61 -15
- package/tests/consolidation-ledger.test.mjs +64 -3
- package/tests/consolidation-snapshot.test.mjs +25 -9
- package/tests/injection-chain.test.mjs +2 -2
- package/tests/prompt-semantics.test.mjs +1 -1
- package/tests/prompts.test.mjs +1 -1
package/lib/private.js
CHANGED
|
@@ -8,6 +8,25 @@ import { condenseEvents, readSessionSnapshot } from './curator.js'
|
|
|
8
8
|
import { record } from './activity-log.js'
|
|
9
9
|
import { ACTIVE_MEMORY_POLICY, assessWake, collectEvidence } from './active-memory.js'
|
|
10
10
|
import { entryFingerprint } from './consolidation-receipt.js'
|
|
11
|
+
import { DEFAULT_TIME_ZONE } from './temporal.js'
|
|
12
|
+
|
|
13
|
+
// The consolidation worker only sees the transcript as text. Without a visible
|
|
14
|
+
// per-turn clock it falls back to the wall clock (or a single batch sceneTime),
|
|
15
|
+
// which is exactly how "前天" gets written months away from the scene. The seed
|
|
16
|
+
// event keeps the replayed logical time; surface it as a leading text block so
|
|
17
|
+
// the worker can pass that turn's observed_at to the write tools.
|
|
18
|
+
function eventTimeLabel(event) {
|
|
19
|
+
const explicit = event?.data?.sceneTime
|
|
20
|
+
const at = explicit ? new Date(explicit) : (Number.isFinite(event?.time) ? new Date(event.time) : null)
|
|
21
|
+
if (!at || !Number.isFinite(at.getTime())) return null
|
|
22
|
+
const parts = new Intl.DateTimeFormat('en-CA', {
|
|
23
|
+
timeZone: DEFAULT_TIME_ZONE,
|
|
24
|
+
year: 'numeric', month: '2-digit', day: '2-digit',
|
|
25
|
+
hour: '2-digit', minute: '2-digit', hour12: false,
|
|
26
|
+
}).formatToParts(at)
|
|
27
|
+
const pick = (type) => parts.find((part) => part.type === type)?.value || ''
|
|
28
|
+
return `${pick('year')}-${pick('month')}-${pick('day')} ${pick('hour')}:${pick('minute')}`
|
|
29
|
+
}
|
|
11
30
|
|
|
12
31
|
// Short-term entries expire on a clock, so the idle pass is the last moment anyone
|
|
13
32
|
// can decide what they were worth. The list is generated in code rather than added
|
|
@@ -148,13 +167,16 @@ export function assessConsolidationValue(events) {
|
|
|
148
167
|
// tail, compact the noise, and leave the rest for the next window.
|
|
149
168
|
export const CONSOLIDATION_BACKLOG_EVENTS = 200
|
|
150
169
|
export const CONSOLIDATION_BACKLOG_TURNS = 10
|
|
151
|
-
|
|
170
|
+
// A checkpoint is measured in session events, and six of them are pure turn/step
|
|
171
|
+
// wrappers. 300 events therefore bought only ~50 turns of transcript. 500 keeps
|
|
172
|
+
// the same seed size in practice but cuts one fork for a 200-turn catch-up.
|
|
173
|
+
export const CONSOLIDATION_WINDOW_EVENTS = 500
|
|
152
174
|
export const CONSOLIDATION_PROBE_MINUTES = 15
|
|
153
175
|
export const CONSOLIDATION_SNAPSHOT_FAILURE_LIMIT = 2
|
|
154
|
-
const SEED_TOOL_RESULT_CHARS =
|
|
155
|
-
const SEED_TOOL_CALL_CHARS =
|
|
156
|
-
const SEED_TEXT_CHARS =
|
|
157
|
-
const SEED_CATALOG_ENTRIES =
|
|
176
|
+
const SEED_TOOL_RESULT_CHARS = 1_200
|
|
177
|
+
const SEED_TOOL_CALL_CHARS = 600
|
|
178
|
+
const SEED_TEXT_CHARS = 12_000
|
|
179
|
+
const SEED_CATALOG_ENTRIES = 18
|
|
158
180
|
|
|
159
181
|
// Types that carry conversation, plus the structural events a seeded Session
|
|
160
182
|
// replays. Everything else is host bookkeeping: request headers, permissions,
|
|
@@ -237,6 +259,8 @@ export function compactSeedEvents(events, catalogEvent = null) {
|
|
|
237
259
|
clone.data.arguments = capSeedText(event.data?.arguments, SEED_TOOL_CALL_CHARS)
|
|
238
260
|
} else if (event.type === 'user/message') {
|
|
239
261
|
clone.data.content = cloneSeedBlocks(event.data?.content, { text: SEED_TEXT_CHARS })
|
|
262
|
+
const timeLabel = eventTimeLabel(event)
|
|
263
|
+
if (timeLabel) clone.data.content.unshift({ type: 'text', text: `[事件时间 ${timeLabel}]` })
|
|
240
264
|
}
|
|
241
265
|
kept.push(clone)
|
|
242
266
|
}
|
|
@@ -263,6 +287,158 @@ export function compactSeedEvents(events, catalogEvent = null) {
|
|
|
263
287
|
return out
|
|
264
288
|
}
|
|
265
289
|
|
|
290
|
+
// P3: spend the worker's context on turns that can produce a durable memory.
|
|
291
|
+
// Zero-token local filter: strong signals (dates, promises, corrections,
|
|
292
|
+
// identities) count double; generic preference/social words count once. Whole
|
|
293
|
+
// turns are kept, plus the turn before/after for context. If nothing looks
|
|
294
|
+
// salient, keep everything rather than silently dropping the window.
|
|
295
|
+
const SALIENCE_STRONG = /今天|明天|昨天|前天|后天|大后天|下周|上周|这周|月底|月初|年初|年底|生日|纪念日|周年|星期[一二三四五六日天]|周[一二三四五六日天]|\d{1,2}\s*[月日号]|\d{4}\s*[-/年]|\d{1,2}\s*[点时]|答应|约定|说好|提醒|帮我|帮忙|欠|借|还|截止|到期|记得|别忘|改口|说错|更正|其实|矛盾|两版|之前说/g
|
|
296
|
+
const SALIENCE_WEAK = /喜欢|讨厌|不吃|不要|不能|不想|边界|秘密|别说|打算|计划|准备|要去|想去|叫|称呼|名字|岁|住|工作|职业|负责|接手|登记|换|孩子|父亲|母亲|老公|老婆|朋友|同事|邻居/g
|
|
297
|
+
|
|
298
|
+
function turnText(events) {
|
|
299
|
+
const parts = []
|
|
300
|
+
for (const event of events) {
|
|
301
|
+
if (event.type === 'user/message') {
|
|
302
|
+
for (const block of event.data?.content || []) if (block?.type === 'text' && typeof block.text === 'string') parts.push(block.text)
|
|
303
|
+
} else if (event.type === 'assistant/message') {
|
|
304
|
+
for (const block of event.data?.message?.content || []) if (block?.type === 'text' && typeof block.text === 'string') parts.push(block.text)
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return parts.join('\n')
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function salienceScore(text) {
|
|
311
|
+
const strong = (String(text).match(SALIENCE_STRONG) || []).length
|
|
312
|
+
const weak = (String(text).match(SALIENCE_WEAK) || []).length
|
|
313
|
+
return strong * 2 + weak
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Keep salient complete turns and one neighbour on each side. */
|
|
317
|
+
export function candidateSeedEvents(events, { maxTurns = 60 } = {}) {
|
|
318
|
+
const groups = []
|
|
319
|
+
let current = null
|
|
320
|
+
for (const event of Array.isArray(events) ? events : []) {
|
|
321
|
+
if (event?.type === 'turn/start' || current === null) {
|
|
322
|
+
current = []
|
|
323
|
+
groups.push(current)
|
|
324
|
+
}
|
|
325
|
+
current.push(event)
|
|
326
|
+
if (event?.type === 'turn/end') current = null
|
|
327
|
+
}
|
|
328
|
+
const kept = new Set()
|
|
329
|
+
groups.forEach((group, index) => {
|
|
330
|
+
if (salienceScore(turnText(group)) >= 2) kept.add(index)
|
|
331
|
+
})
|
|
332
|
+
if (kept.size === 0) return Array.isArray(events) ? [...events] : []
|
|
333
|
+
const expanded = new Set(kept)
|
|
334
|
+
for (const index of kept) {
|
|
335
|
+
if (index > 0) expanded.add(index - 1)
|
|
336
|
+
if (index + 1 < groups.length) expanded.add(index + 1)
|
|
337
|
+
}
|
|
338
|
+
const selected = [...expanded].sort((a, b) => a - b).slice(0, maxTurns)
|
|
339
|
+
const covered = selected.reduce((sum, index) => sum + groups[index].length, 0)
|
|
340
|
+
if (covered >= events.length * 0.8) return [...events]
|
|
341
|
+
return selected.flatMap((index) => groups[index])
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// P4:本地零 Token 抽「本窗必写候选」。worker 的任务选择常常只覆盖带日期/数字的
|
|
345
|
+
// 几条,新人物、换人接手、只有一句约定的轮次会被漏掉;这些轮次在 salience 里分数
|
|
346
|
+
// 不低,却在模型的 topic selection 里没有位置。给它就是一份带 seq 的短清单:要么
|
|
347
|
+
// 写,要么在回执里说明为什么不写,不能静默跳过。
|
|
348
|
+
const MUST_COVER_PERSON = /叫|自称|称呼|换|接手|改成|换成|新来|同事|师傅|阿姨|房东|店长|老板|邻居|朋友|家人/
|
|
349
|
+
export function mustCoverCandidates(events, { max = 8, minScore = 3 } = {}) {
|
|
350
|
+
const groups = []
|
|
351
|
+
let current = null
|
|
352
|
+
for (const event of Array.isArray(events) ? events : []) {
|
|
353
|
+
if (event?.type === 'turn/start' || current === null) {
|
|
354
|
+
current = []
|
|
355
|
+
groups.push(current)
|
|
356
|
+
}
|
|
357
|
+
current.push(event)
|
|
358
|
+
if (event?.type === 'turn/end') current = null
|
|
359
|
+
}
|
|
360
|
+
const rows = []
|
|
361
|
+
const seen = new Set()
|
|
362
|
+
groups.forEach((group) => {
|
|
363
|
+
const text = turnText(group)
|
|
364
|
+
const score = salienceScore(text)
|
|
365
|
+
if (score < minScore) return
|
|
366
|
+
const userText = group
|
|
367
|
+
.filter((event) => event?.type === 'user/message' && event.data?.source?.kind === 'user')
|
|
368
|
+
.flatMap((event) => (event.data?.content || []).filter((block) => block?.type === 'text').map((block) => String(block.text || '')))
|
|
369
|
+
.join(' ')
|
|
370
|
+
const source = (userText || text).replace(/\s+/g, ' ').trim().slice(0, 90)
|
|
371
|
+
if (!source || seen.has(source)) return
|
|
372
|
+
seen.add(source)
|
|
373
|
+
const observedAt = group
|
|
374
|
+
.filter((event) => event?.type === 'user/message' && event.data?.source?.kind === 'user')
|
|
375
|
+
.map((event) => event.data?.sceneTime)
|
|
376
|
+
.find((value) => typeof value === 'string' && value) || null
|
|
377
|
+
rows.push({
|
|
378
|
+
fromSeq: Number(group[0]?.seq),
|
|
379
|
+
throughSeq: Number(group[group.length - 1]?.seq),
|
|
380
|
+
score,
|
|
381
|
+
tag: MUST_COVER_PERSON.test(text) ? '人物/关系' : '事实',
|
|
382
|
+
text: source,
|
|
383
|
+
observedAt,
|
|
384
|
+
})
|
|
385
|
+
})
|
|
386
|
+
return rows
|
|
387
|
+
.sort((a, b) => b.score - a.score)
|
|
388
|
+
.slice(0, Math.max(1, Number(max) || 8))
|
|
389
|
+
.sort((a, b) => a.fromSeq - b.fromSeq)
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/** 顺延候选优先占位,但最多 4 条;其余名额留给本窗新候选。 */
|
|
393
|
+
export function mergeMustCover(carry, fresh, { max = 8, carryMax = 4 } = {}) {
|
|
394
|
+
const rows = []
|
|
395
|
+
const seen = new Set()
|
|
396
|
+
const add = (row) => {
|
|
397
|
+
if (!row || typeof row.text !== 'string') return
|
|
398
|
+
const key = row.text.replace(/\s+/g, '').slice(0, 60)
|
|
399
|
+
if (!key || seen.has(key)) return
|
|
400
|
+
seen.add(key)
|
|
401
|
+
rows.push(row)
|
|
402
|
+
}
|
|
403
|
+
for (const row of (Array.isArray(carry) ? carry : []).slice(0, Math.max(0, Number(carryMax) || 0))) {
|
|
404
|
+
add({ ...row, carried: true })
|
|
405
|
+
}
|
|
406
|
+
for (const row of Array.isArray(fresh) ? fresh : []) add(row)
|
|
407
|
+
return rows.slice(0, Math.max(1, Number(max) || 8))
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const COVER_DATE_RE = /\d{4}-\d{2}-\d{2}|\d{1,2}\s*[月日号]/
|
|
411
|
+
// 这些 bigram 到处出现,不能证明候选被写进库;命中两个以上才算覆盖。
|
|
412
|
+
const COVER_STOP = new Set([
|
|
413
|
+
'我们', '他们', '你们', '现在', '已经', '可以', '什么', '这个', '那个',
|
|
414
|
+
'时候', '今天', '明天', '昨天', '一下', '一个', '还是', '不是', '就是',
|
|
415
|
+
])
|
|
416
|
+
function coverTokens(text) {
|
|
417
|
+
return new Set(tokenize(String(text || ''))
|
|
418
|
+
.filter((token) => typeof token === 'string' && token.length >= 2 && !COVER_STOP.has(token)))
|
|
419
|
+
}
|
|
420
|
+
/** 本地零 Token 核验:候选里的关键事实是否真的出现在本窗新增/更新的条目里。 */
|
|
421
|
+
export function candidateCovered(candidate, writtenIds, index) {
|
|
422
|
+
const entries = index?.entries || {}
|
|
423
|
+
const text = String(candidate?.text || '')
|
|
424
|
+
if (!text) return true
|
|
425
|
+
const date = (text.match(COVER_DATE_RE) || [])[0] || null
|
|
426
|
+
const wanted = coverTokens(text)
|
|
427
|
+
if (wanted.size === 0 && !date) return true
|
|
428
|
+
for (const id of Array.isArray(writtenIds) ? writtenIds : []) {
|
|
429
|
+
const entry = entries[id]
|
|
430
|
+
if (!entry) continue
|
|
431
|
+
const body = String(entry.title || '') + ' ' + String(entry.content || '')
|
|
432
|
+
if (date && body.includes(date)) return true
|
|
433
|
+
const have = coverTokens(body)
|
|
434
|
+
let shared = 0
|
|
435
|
+
for (const token of wanted) {
|
|
436
|
+
if (have.has(token) && (shared += 1) >= 2) return true
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return false
|
|
440
|
+
}
|
|
441
|
+
|
|
266
442
|
/** Existing entries, compact, for dedupe/update instead of duplicate writes. */
|
|
267
443
|
export function memoryCatalogEvent(binding, now = Date.now()) {
|
|
268
444
|
if (!binding?.libraryId) return null
|
|
@@ -520,6 +696,37 @@ async function attachWorkerTools(agents, childId, parentId) {
|
|
|
520
696
|
// workerToolsPartial true = 未证明 worker 拿到完整 wanted 集(子集、空集、或挂载
|
|
521
697
|
// 整体失败)。刻意把"一件都没挂上"也标 true:若失败标 false,
|
|
522
698
|
// false 会被一眼读成"全量挂载",元数据又不准了。
|
|
699
|
+
// A fork inherits the parent preset's plugin tools. `tools.restrict()` is scoped
|
|
700
|
+
// to the child agent, so this removes every plugin tool the worker never uses
|
|
701
|
+
// without touching the parent session. Restrict before followup: the host
|
|
702
|
+
// resolves the admitted set at step start.
|
|
703
|
+
async function restrictWorkerTools(agents, childId, parentId) {
|
|
704
|
+
for (let attempt = 0; attempt < 6; attempt += 1) {
|
|
705
|
+
let record = null
|
|
706
|
+
try { record = agents.get?.(childId) || null } catch { record = null }
|
|
707
|
+
const actx = record?.ctx || record?.agent?.ctx || null
|
|
708
|
+
if (actx && actx.tools && typeof actx.tools.restrict === 'function') {
|
|
709
|
+
try {
|
|
710
|
+
const dispose = actx.tools.restrict({ allow: WORKER_TOOL_ALLOW })
|
|
711
|
+
return { dispose, allowed: [...WORKER_TOOL_ALLOW] }
|
|
712
|
+
} catch (error) {
|
|
713
|
+
// A host missing one of the optional tools must not lose consolidation;
|
|
714
|
+
// retry with the write/read core and let the brief tell the truth.
|
|
715
|
+
const core = ['memu_private_remember', 'memu_private_update', 'memu_private_list', 'memu_status']
|
|
716
|
+
try {
|
|
717
|
+
return { dispose: actx.tools.restrict({ allow: core }), allowed: core }
|
|
718
|
+
} catch (inner) {
|
|
719
|
+
warn('consolidation worker tool restriction failed: ' + String(inner?.message || inner))
|
|
720
|
+
return null
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if (record || !(agents.get?.(parentId))) return null
|
|
725
|
+
await new Promise(resolve => setTimeout(resolve, 100))
|
|
726
|
+
}
|
|
727
|
+
return null
|
|
728
|
+
}
|
|
729
|
+
|
|
523
730
|
function workerToolsMeta(workerTools) {
|
|
524
731
|
const wanted = [...WORKER_WRITE_TOOLS, ...WORKER_READ_TOOLS]
|
|
525
732
|
if (!workerTools) {
|
|
@@ -540,16 +747,18 @@ const inFlight = new Map()
|
|
|
540
747
|
const WORKER_STOP_GRACE_MS = 5_000
|
|
541
748
|
|
|
542
749
|
// 这里的 import 刻意写在语句之后:lib/binding-diagnostics.js 的 RUNTIME_STATE 把 `inFlight`
|
|
543
|
-
// 的 file:line 当成诊断契约(当前 lib/private.js:
|
|
750
|
+
// 的 file:line 当成诊断契约(当前 lib/private.js:742),修改位置时同步更新该诊断映射,
|
|
544
751
|
// 而那是别人的文件、本包不改。ESM 的 import 声明是提升的,写在语句之后合法。
|
|
545
752
|
import { warn } from './paths.js'
|
|
546
753
|
import { captureSessionSnapshot, eventSeq, safePrefix, snapshotHash } from './consolidation-snapshot.js'
|
|
547
754
|
import {
|
|
548
755
|
beginJob, completeJob, failJob, findOperation, noteEvidence, operationKey,
|
|
549
756
|
recoverStaleJobs, recordOperation, scopeGenerationOf, clearSessionState, skipRange,
|
|
757
|
+
readCarryCandidates, setCarryCandidates,
|
|
550
758
|
} from './consolidation-ledger.js'
|
|
551
759
|
import { decideCompletion, receiptContractText } from './consolidation-receipt.js'
|
|
552
|
-
import { buildWorkerBrief, probeToolSurface, WORKER_READ_TOOLS, WORKER_WRITE_TOOLS } from './consolidation-worker.js'
|
|
760
|
+
import { buildWorkerBrief, probeToolSurface, WORKER_READ_TOOLS, WORKER_WRITE_TOOLS, WORKER_TOOL_ALLOW } from './consolidation-worker.js'
|
|
761
|
+
import { tokenize } from './text-retrieval.js'
|
|
553
762
|
import { isGoneSessionError } from './cycle.js'
|
|
554
763
|
import { autoLinkPrivateMemories } from './private-links.js'
|
|
555
764
|
import { registerTools } from './tools.js'
|
|
@@ -652,6 +861,7 @@ export async function requestHistoricalConsolidation(ctx, sessionId, options = {
|
|
|
652
861
|
let jobId = null
|
|
653
862
|
let scopeChanged = null
|
|
654
863
|
let workerTools = null
|
|
864
|
+
let workerRestriction = null
|
|
655
865
|
const assistantTexts = []
|
|
656
866
|
let childId = null
|
|
657
867
|
// 每次整理都要在活动日志里留一条:谁触发(手动/空闲)、fork 有没有建、结果是完成、
|
|
@@ -829,7 +1039,7 @@ export async function requestHistoricalConsolidation(ctx, sessionId, options = {
|
|
|
829
1039
|
const snapshotMeta = snapshotMetaOf(windowSnapshot)
|
|
830
1040
|
// 范围大小决定等多久:显式给了就听调用方的,没给按这一窗的事件数推。
|
|
831
1041
|
const budgetMs = Number.isInteger(maxWaitMs) && maxWaitMs > 0 ? maxWaitMs : consolidationWaitBudget(window.events.length)
|
|
832
|
-
const seedEvents = compactSeedEvents(window.events, memoryCatalogEvent({ ...binding, sessionId }))
|
|
1042
|
+
const seedEvents = compactSeedEvents(candidateSeedEvents(window.events), memoryCatalogEvent({ ...binding, sessionId }))
|
|
833
1043
|
if (seedEvents.length === 0) {
|
|
834
1044
|
return finish({ ok: true, sessionId, skipped: 'empty-seed', settled: true, snapshot: snapshotMeta })
|
|
835
1045
|
}
|
|
@@ -841,9 +1051,11 @@ export async function requestHistoricalConsolidation(ctx, sessionId, options = {
|
|
|
841
1051
|
if (previous && (previous.outcome === 'completed' || previous.outcome === 'skipped')) {
|
|
842
1052
|
return finish({ ok: true, sessionId, skipped: 'already-consolidated', settled: true, snapshot: snapshotMeta, credential: previous })
|
|
843
1053
|
}
|
|
844
|
-
//
|
|
845
|
-
//
|
|
846
|
-
|
|
1054
|
+
// 同一份快照连续失败到上限就不再「自动」重跑:窗口已经很小,重试成本可控,但
|
|
1055
|
+
// 没有新事件的同一段转录不值得无限重试。手动整理(force)是明确的一次再决定,
|
|
1056
|
+
// 不受上限约束——否则冻结回放/用户重试都会被永久卡在同一个窗口。新消息会改变
|
|
1057
|
+
// 快照哈希,自动路径也重新获得机会。
|
|
1058
|
+
if (!force && previous?.outcome === 'failed' && Number(previous.failures) >= CONSOLIDATION_SNAPSHOT_FAILURE_LIMIT) {
|
|
847
1059
|
return finish({
|
|
848
1060
|
ok: true, sessionId, skipped: 'snapshot-failed', settled: true, reasonCode: 'snapshot-failed-too-many',
|
|
849
1061
|
snapshot: snapshotMeta, failures: Number(previous.failures) || 0,
|
|
@@ -951,6 +1163,7 @@ export async function requestHistoricalConsolidation(ctx, sessionId, options = {
|
|
|
951
1163
|
if (probe.hasWrite !== true) {
|
|
952
1164
|
workerTools = await attachWorkerTools(agents, childId, sessionId)
|
|
953
1165
|
}
|
|
1166
|
+
workerRestriction = await restrictWorkerTools(agents, childId, sessionId)
|
|
954
1167
|
|
|
955
1168
|
// 先记"已开始"再等结果:一个大会话的 fork 可能跑好几分钟,没有这条记录,
|
|
956
1169
|
// 侧边栏和日志页在等待期间只会显示上一次的结果,用户会以为按钮没生效。
|
|
@@ -1026,6 +1239,10 @@ export async function requestHistoricalConsolidation(ctx, sessionId, options = {
|
|
|
1026
1239
|
// 不继承 mood。显式写 null 而不是留空:缺字段和「这一刻是中性」在写入时都走
|
|
1027
1240
|
// 同一条兜底,但只有 null 能把「后台 worker 没有当下心境」说清楚。
|
|
1028
1241
|
mood: null,
|
|
1242
|
+
// The fork writes memories on the same logical clock as its parent. Without
|
|
1243
|
+
// this the worker falls back to the wall clock at fork time; the per-turn
|
|
1244
|
+
// [事件时间] markers in the seed remain the authoritative override.
|
|
1245
|
+
sceneTime: binding.sceneTime || null,
|
|
1029
1246
|
parentSessionId: sessionId,
|
|
1030
1247
|
parentScopeGeneration: generationAtStart,
|
|
1031
1248
|
snapshotHash: snapshot.hash,
|
|
@@ -1053,7 +1270,9 @@ export async function requestHistoricalConsolidation(ctx, sessionId, options = {
|
|
|
1053
1270
|
})
|
|
1054
1271
|
}
|
|
1055
1272
|
|
|
1056
|
-
const
|
|
1273
|
+
const carry = safeLedger(() => readCarryCandidates(sessionId), [])
|
|
1274
|
+
const mustCover = mergeMustCover(carry, mustCoverCandidates(window.events))
|
|
1275
|
+
const brief = buildWorkerBrief({ snapshot, probe, contract: receiptContractText({ jobId, snapshotHash: snapshot.hash }), reason: force ? 'manual' : 'auto', jobId, mustCover })
|
|
1057
1276
|
handle.agent.followup(noticeMessage([buildPrivateConsolidationPrompt(sessionId), '', brief].join('\n'), '整理这场对话的私有记忆'))
|
|
1058
1277
|
// followup only queues. whenIdle says the driver stopped; turn/end says
|
|
1059
1278
|
// whether that turn actually succeeded, so both are checked below.
|
|
@@ -1125,6 +1344,11 @@ export async function requestHistoricalConsolidation(ctx, sessionId, options = {
|
|
|
1125
1344
|
error: 'the consolidation ledger could not verify the covered snapshot range' })
|
|
1126
1345
|
}
|
|
1127
1346
|
setSessionBinding(sessionId, { lastSleepSeq: snapshot.throughSeq })
|
|
1347
|
+
// 候选跨窗顺延:本窗没写进库的候选留给下一窗的必写清单;最后一窗也在同一份
|
|
1348
|
+
// brief 里见到它们,不需要为了补写再开一次整窗 fork。核验纯本地,0 Token。
|
|
1349
|
+
const writtenIds = [...(decision.createdIds || []), ...(decision.updatedIds || []), ...(decision.heldIds || [])]
|
|
1350
|
+
const missed = mustCover.filter((candidate) => !candidateCovered(candidate, writtenIds, index))
|
|
1351
|
+
safeLedger(() => setCarryCandidates(sessionId, missed))
|
|
1128
1352
|
safeLedger(() => recordOperation({ sessionId, key: opKey, outcome: decision.status, ids: decision.createdIds || [] }))
|
|
1129
1353
|
// 私有自动关联(§5.6 兜底):只在整理真的对账并推进边界之后跑,纯算法,
|
|
1130
1354
|
// 0 token。worker 若已调用 memu_private_link_suggest,这一遍是幂等的(已有的
|
|
@@ -1195,6 +1419,7 @@ export async function requestHistoricalConsolidation(ctx, sessionId, options = {
|
|
|
1195
1419
|
inFlight.delete(sessionId)
|
|
1196
1420
|
try { await stopWorker() } catch {}
|
|
1197
1421
|
try { workerTools?.dispose?.() } catch {}
|
|
1422
|
+
try { workerRestriction?.dispose?.() } catch {}
|
|
1198
1423
|
try { if (childId) deleteSessionBinding(childId) } catch {}
|
|
1199
1424
|
}
|
|
1200
1425
|
}
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
- 一条只写一件事,并且自包含:以后看不到这段对话,要写清背景。
|
|
12
12
|
- 优先写具体的东西:一句原话、一个决定和它的理由、一次踩过的坑。
|
|
13
13
|
- 可以写有后续影响的关系、感受或限制,但要有具体事件与来源;一次礼貌或情绪不推导稳定人格,不按轮数增加亲密度。只有明确的叙事内容才用角色口吻。
|
|
14
|
-
-
|
|
14
|
+
- 只与实际提供或成功检索到的旧记忆去重:兼容可合并,矛盾保留来源、时间与条件供复核,不抹旧正文或自行宣布取代。**最多新增 8 条,按价值排序**:约定/承诺 > 日期/改口/冲突 > 身份/称呼/边界/第三方人物与变化 > 偏好/计划 > 其他明确事实;普通日常流水、打招呼、重复对话不写,没有值得留的就不写。
|
|
15
15
|
|
|
16
16
|
字段:
|
|
17
17
|
- title:8–40 字,写具体事实(人名、物名、事件、结论的关键词)。锚点与召回只显示标题、不显示正文,所以标题就是目录项;
|
|
18
18
|
不要「一些事」「那段对话」「关于……的记录」这类空标签,细节全部放进 content。合并/吸收后的标题要覆盖来源的关键词。
|
|
19
|
-
- content
|
|
19
|
+
- content:自包含的具体内容、对象/条件及后续意义,**50–170 字,尽量小但精准**;只保留人物、地点、时间、事情、原话/说话人,不复述整段对话,不写成行为日志。
|
|
20
20
|
- tags:可选,便于以后检索。
|
|
21
21
|
- salient_date:只在确有日期时填,且要落成绝对日期。每年复发的那一天(生日、周年)用 `MM-DD`;
|
|
22
22
|
一次性的约定或安排用 `YYYY-MM-DD`。说「明天」「后天」「下周」的约定必须按今天算出具体年月日——
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
- 同一件事有两种说法:各写一条,`conflicts_with` 互指;不要合并成一条,也不要自行裁决。
|
|
17
17
|
- 承诺/约定写 `commitment`(对谁/做什么/`due_at`/`status`);梦、假设、转述标 `source_kind`。
|
|
18
18
|
- 助手说过的承诺和计划同样要写;不要只收用户消息。
|
|
19
|
-
-
|
|
19
|
+
- 每窗最多新增 8 条。按价值排序:约定/承诺 = 新人物首次出现/换人接手/称呼变化 > 日期/改口/冲突 > 身份/边界/第三方人物 > 偏好/计划 > 其他明确事实。前两类必须写,不得因为已经写了几条就省略。明确说过的日常事实(颜色、物品、口味、作息、行程、称呼变更)也要各自成条;同一件事的两种说法各写一条,保留时间和来源,不要自行裁决。条数不能靠少写省掉;「少写」只指单条正文精准。
|
|
20
|
+
- 人物首次出现、换人接手或称呼变化必须单独成一条,写清先后(谁先、谁后来接手)与发生轮次;这类事实不并入生活流水,也不因为主体是第三方就不写。
|
|
20
21
|
|
|
21
22
|
写什么(活人感):
|
|
22
23
|
- 用角色的口吻、第一人称写,像在回想,不像在归档。
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
字段:
|
|
30
31
|
- title:8–40 字,写清这件事是什么——具体的人名、称谓、物件、事件或结论关键词。锚点/召回只显示标题、不显示正文,
|
|
31
32
|
所以标题就是目录项;不要「关于……的回忆」「一些对话」这类空标签,细节留在 content。合并/吸收后的标题要覆盖来源的关键词。
|
|
32
|
-
- content:一个瞬间 + 它对之后的影响,通常
|
|
33
|
+
- content:一个瞬间 + 它对之后的影响,通常 50–170 字,不硬凑长度;最多引一句有出处的原话。能让下次称呼、选择或分寸自然接续,比抒情更重要。
|
|
33
34
|
- tags:可选。
|
|
34
35
|
- salient_date:只在确有日期时填,且要落成绝对日期。每年复发的那一天(生日、周年)用 `MM-DD`;
|
|
35
36
|
一次性的约定或安排用 `YYYY-MM-DD`。说「明天」「后天」「下周」的约定必须按今天算出具体年月日——
|
package/lib/tools.js
CHANGED
|
@@ -267,19 +267,19 @@ export function registerTools(ctx, { only = null } = {}) {
|
|
|
267
267
|
|
|
268
268
|
tools.push(toolBase(
|
|
269
269
|
'memu_private_remember',
|
|
270
|
-
'Write one
|
|
270
|
+
'Write one durable private memory. Match the domain; never copy a transcript or invent evidence. layer=must_remember requires pin_reason and pin_source.',
|
|
271
271
|
{
|
|
272
|
-
content: { type: 'string', required: true, description: 'Self-contained
|
|
273
|
-
title: { type: 'string', description: '8-40
|
|
274
|
-
layer: { type: 'string', description: 'long_term (default), short_term,
|
|
272
|
+
content: { type: 'string', required: true, description: 'Self-contained 50-170 char body: people, place, time, event, exact words. Coding keeps conclusion and verification; RP keeps evidenced moments, no invented facts.' },
|
|
273
|
+
title: { type: 'string', description: '8-40 chars naming the concrete fact; title is a permanent index, the anchor shows only titles WITHOUT the body. No empty labels. Defaults to content.' },
|
|
274
|
+
layer: { type: 'string', description: 'long_term (default), short_term, must_remember. short_term expires unless promoted.' },
|
|
275
275
|
pin_reason: { type: 'string', description: 'Required for must_remember; first-person reason.' },
|
|
276
276
|
pin_source: { type: 'string', description: 'user_explicit, side_event, or self.' },
|
|
277
277
|
side_event_id: { type: 'string', description: 'Required when pin_source=side_event.' },
|
|
278
|
-
fact_key: { type: 'string', description: 'Optional stable key
|
|
279
|
-
conflicts_with: { type: 'string', description: '
|
|
280
|
-
supersedes: { type: 'string', description: '
|
|
278
|
+
fact_key: { type: 'string', description: 'Optional stable key. Reusing it marks another version of the same fact (conflict pair unless supersedes).' },
|
|
279
|
+
conflicts_with: { type: 'string', description: 'Existing memory id with a different version of the same fact; both stay active and recall together.' },
|
|
280
|
+
supersedes: { type: 'string', description: 'Existing memory id this explicitly replaces; old text stays but is retired.' },
|
|
281
281
|
tags: { type: 'array', items: { type: 'string' }, description: 'Optional tags.' },
|
|
282
|
-
open_loop: { type: 'boolean', description: '
|
|
282
|
+
open_loop: { type: 'boolean', description: 'Unfinished promise/task; prefer commitment.' },
|
|
283
283
|
commitment: {
|
|
284
284
|
type: 'object',
|
|
285
285
|
properties: {
|
|
@@ -291,51 +291,51 @@ export function registerTools(ctx, { only = null } = {}) {
|
|
|
291
291
|
evidence_seq: { type: 'integer' },
|
|
292
292
|
},
|
|
293
293
|
additionalProperties: false,
|
|
294
|
-
description: '
|
|
294
|
+
description: 'Promise: counterparty, action, due_at (YYYY-MM-DD/ISO), status (open/done/cancelled/expired), closed_by/evidence_seq.',
|
|
295
295
|
},
|
|
296
|
-
disclosure: { type: 'string', description: 'can_tell, only_if_asked,
|
|
297
|
-
owner: { type: 'string', description: 'me, us, about_user,
|
|
298
|
-
visibility: { type: 'string', description: 'shared (default
|
|
296
|
+
disclosure: { type: 'string', description: 'can_tell, only_if_asked, never_say.' },
|
|
297
|
+
owner: { type: 'string', description: 'me, us, about_user, about_project.' },
|
|
298
|
+
visibility: { type: 'string', description: 'shared (default) or secret (no automatic injection/recall).' },
|
|
299
299
|
source: {
|
|
300
300
|
type: 'string',
|
|
301
|
-
description: '
|
|
301
|
+
description: 'inferred (default), user_said (quotable), assistant_said, imagined, told, tool.',
|
|
302
302
|
},
|
|
303
|
-
source_kind: { type: 'string', description: '
|
|
304
|
-
speaker_id: { type: 'string', description: '
|
|
303
|
+
source_kind: { type: 'string', description: 'Same values as source; assistant promises/plans must not be user_said.' },
|
|
304
|
+
speaker_id: { type: 'string', description: 'user, assistant, character:<id>, group:<id>; never infer from a name.' },
|
|
305
305
|
quote_span: {
|
|
306
306
|
type: 'object',
|
|
307
307
|
properties: { seq: { type: 'integer' }, turn: { type: 'integer' }, textHash: { type: 'string' } },
|
|
308
308
|
additionalProperties: false,
|
|
309
|
-
description: 'Optional
|
|
309
|
+
description: 'Optional source pointer; do not paste the whole quote.',
|
|
310
310
|
},
|
|
311
|
-
storyline_id: { type: 'string', description: 'Optional storyline
|
|
312
|
-
branch_id: { type: 'string', description: 'Optional branch id
|
|
313
|
-
known_by: { type: 'array', items: { type: 'string' }, description: 'Character
|
|
314
|
-
confidence: { type: 'number', description: '0-1
|
|
315
|
-
mood_valence: { type: 'number', description: '
|
|
316
|
-
arousal: { type: 'number', description: '
|
|
311
|
+
storyline_id: { type: 'string', description: 'Optional storyline id.' },
|
|
312
|
+
branch_id: { type: 'string', description: 'Optional branch id.' },
|
|
313
|
+
known_by: { type: 'array', items: { type: 'string' }, description: 'Character ids that know this fact.' },
|
|
314
|
+
confidence: { type: 'number', description: '0-1; below 0.45 is injected as a hedge.' },
|
|
315
|
+
mood_valence: { type: 'number', description: '-1..1; omit to inherit the conversation reading.' },
|
|
316
|
+
arousal: { type: 'number', description: '0-1 intensity.' },
|
|
317
317
|
emotion: {
|
|
318
318
|
type: 'object',
|
|
319
319
|
properties: { joy: { type: 'number' }, anger: { type: 'number' }, sorrow: { type: 'number' }, fear: { type: 'number' } },
|
|
320
320
|
// 四个轴是封闭集合:多写的键只会被误当成第五种情绪。
|
|
321
321
|
additionalProperties: false,
|
|
322
|
-
description: '
|
|
322
|
+
description: 'joy/anger/sorrow/fear for the remembered event, not the consolidation mood. Omit to inherit; all-zero is neutral.',
|
|
323
323
|
},
|
|
324
|
-
dominance: { type: 'number', description: '
|
|
325
|
-
peak: { type: 'boolean', description: '
|
|
326
|
-
allow_duplicate: { type: 'boolean', description: 'Only for
|
|
327
|
-
salient_date: { type: 'string', description: 'MM-DD for
|
|
328
|
-
observed_at: { type: 'string', description: 'ISO
|
|
329
|
-
absolute_date: { type: 'string', description: 'YYYY-MM-DD this
|
|
330
|
-
valid_from: { type: 'string', description: 'Optional YYYY-MM-DD
|
|
331
|
-
valid_to: { type: 'string', description: 'Optional YYYY-MM-DD after which
|
|
332
|
-
date_precision: { type: 'string', description: 'day
|
|
333
|
-
track: { type: 'string', description: 'memory (default) or habit
|
|
334
|
-
attachments: { type: 'array', items: { type: 'object', properties: { sha256: { type: 'string', required: true } }, additionalProperties: true }, description: 'At most 8 sha256
|
|
324
|
+
dominance: { type: 'number', description: '-1..1; omit to inherit.' },
|
|
325
|
+
peak: { type: 'boolean', description: 'High/low point of the arc.' },
|
|
326
|
+
allow_duplicate: { type: 'boolean', description: 'Only for a genuinely independent second observation; default false refuses near-duplicates.' },
|
|
327
|
+
salient_date: { type: 'string', description: 'MM-DD for yearly recurrence; YYYY-MM-DD for a one-off appointment. Resolve 今天/明天/下周 to the absolute date; never send a bare MM-DD for a one-off.' },
|
|
328
|
+
observed_at: { type: 'string', description: 'ISO scene time of this statement; relative dates resolve against it, never the wall clock. Omit to use the conversation sceneTime.' },
|
|
329
|
+
absolute_date: { type: 'string', description: 'YYYY-MM-DD this fact is about; omit to let the plugin resolve observed_at + relative wording.' },
|
|
330
|
+
valid_from: { type: 'string', description: 'Optional YYYY-MM-DD when the fact starts.' },
|
|
331
|
+
valid_to: { type: 'string', description: 'Optional YYYY-MM-DD after which it no longer holds.' },
|
|
332
|
+
date_precision: { type: 'string', description: 'day, month, year, or unknown.' },
|
|
333
|
+
track: { type: 'string', description: 'memory (default) or habit (aggregated repeated expression).' },
|
|
334
|
+
attachments: { type: 'array', items: { type: 'object', properties: { sha256: { type: 'string', required: true } }, additionalProperties: true }, description: 'At most 8 sha256 refs received in this conversation; never paths or bytes.' },
|
|
335
335
|
context: { type: 'object', properties: {
|
|
336
336
|
speakerId: { type: 'string' }, channelId: { type: 'string' }, characterId: { type: 'string' }, worldId: { type: 'string' }, branchId: { type: 'string' },
|
|
337
337
|
knownBy: { type: 'array', items: { type: 'string' } }, occurredAt: { type: 'string' },
|
|
338
|
-
}, additionalProperties: true, description: 'Stable identities only;
|
|
338
|
+
}, additionalProperties: true, description: 'Stable identities only; scope inherits the conversation and cannot widen it.' },
|
|
339
339
|
},
|
|
340
340
|
async (args, exec) => {
|
|
341
341
|
const result = await privateRemember({
|
|
@@ -462,14 +462,14 @@ export function registerTools(ctx, { only = null } = {}) {
|
|
|
462
462
|
|
|
463
463
|
tools.push(toolBase(
|
|
464
464
|
'memu_private_update',
|
|
465
|
-
'Update a private memory
|
|
465
|
+
'Update a private memory. Content changes rewrite the stored body; metadata-only changes stay local. Rewrite the title when the new body no longer fits it.',
|
|
466
466
|
{
|
|
467
467
|
id: { type: 'string', required: true, description: 'Memory id.' },
|
|
468
|
-
content: { type: 'string', description: 'New body.' },
|
|
469
|
-
title: { type: 'string', description: '
|
|
468
|
+
content: { type: 'string', description: 'New 50-170 char body.' },
|
|
469
|
+
title: { type: 'string', description: '8-40 chars naming the concrete fact; title is a permanent index, the anchor shows only titles WITHOUT the body. No empty labels. Omit to keep.' },
|
|
470
470
|
tags: { type: 'array', items: { type: 'string' } },
|
|
471
|
-
status: { type: 'string', description: 'active, archived, fragment, suppressed,
|
|
472
|
-
layer: { type: 'string', description: 'long_term
|
|
471
|
+
status: { type: 'string', description: 'active, archived, fragment, suppressed, expired.' },
|
|
472
|
+
layer: { type: 'string', description: 'long_term (promote), short_term (re-arm expiry); must_remember only via remember.' },
|
|
473
473
|
open_loop: { type: 'boolean' },
|
|
474
474
|
commitment: {
|
|
475
475
|
type: 'object',
|
|
@@ -482,38 +482,38 @@ export function registerTools(ctx, { only = null } = {}) {
|
|
|
482
482
|
evidence_seq: { type: 'integer' },
|
|
483
483
|
},
|
|
484
484
|
additionalProperties: false,
|
|
485
|
-
description: 'Replace
|
|
485
|
+
description: 'Replace commitment; status=done/cancelled/expired closes it.',
|
|
486
486
|
},
|
|
487
|
-
disclosure: { type: 'string', description: 'can_tell, only_if_asked,
|
|
488
|
-
owner: { type: 'string', description: 'me, us, about_user,
|
|
489
|
-
visibility: { type: 'string', description: 'shared or secret.
|
|
487
|
+
disclosure: { type: 'string', description: 'can_tell, only_if_asked, never_say.' },
|
|
488
|
+
owner: { type: 'string', description: 'me, us, about_user, about_project.' },
|
|
489
|
+
visibility: { type: 'string', description: 'shared or secret.' },
|
|
490
490
|
confidence: { type: 'number' },
|
|
491
491
|
// Provenance and track are claims about what a memory *is*; both were writable
|
|
492
492
|
// in memory.js and the panel while staying unreachable from the tool surface,
|
|
493
493
|
// so the agent could file a quote as an inference and never correct it.
|
|
494
|
-
source: { type: 'string', description: 'user_said, assistant_said, told, imagined, inferred,
|
|
495
|
-
source_kind: { type: 'string', description: 'Same values as source;
|
|
496
|
-
speaker_id: { type: 'string', description: '
|
|
497
|
-
quote_span: { type: 'object', properties: { seq: { type: 'integer' }, turn: { type: 'integer' }, textHash: { type: 'string' } }, additionalProperties: false, description: '
|
|
498
|
-
storyline_id: { type: 'string', description: 'Storyline
|
|
499
|
-
branch_id: { type: 'string', description: 'Branch id; empty
|
|
500
|
-
known_by: { type: 'array', items: { type: 'string' }, description: 'Character
|
|
501
|
-
track: { type: 'string', description: 'memory or habit.
|
|
502
|
-
peak: { type: 'boolean', description: 'Flashbulb flag
|
|
503
|
-
mood_valence: { type: 'number', description: '
|
|
504
|
-
arousal: { type: 'number', description: '
|
|
494
|
+
source: { type: 'string', description: 'user_said, assistant_said, told, imagined, inferred, tool.' },
|
|
495
|
+
source_kind: { type: 'string', description: 'Same values as source; keep in sync.' },
|
|
496
|
+
speaker_id: { type: 'string', description: 'user, assistant, character:<id>, group:<id>; empty clears.' },
|
|
497
|
+
quote_span: { type: 'object', properties: { seq: { type: 'integer' }, turn: { type: 'integer' }, textHash: { type: 'string' } }, additionalProperties: false, description: 'Source pointer; omit to keep, null to clear.' },
|
|
498
|
+
storyline_id: { type: 'string', description: 'Storyline id; empty clears.' },
|
|
499
|
+
branch_id: { type: 'string', description: 'Branch id; empty clears.' },
|
|
500
|
+
known_by: { type: 'array', items: { type: 'string' }, description: 'Character ids; empty clears.' },
|
|
501
|
+
track: { type: 'string', description: 'memory or habit.' },
|
|
502
|
+
peak: { type: 'boolean', description: 'Flashbulb flag.' },
|
|
503
|
+
mood_valence: { type: 'number', description: '-1..1 retrieval lens; omit keeps.' },
|
|
504
|
+
arousal: { type: 'number', description: '0..1 retrieval lens; omit keeps.' },
|
|
505
505
|
emotion: {
|
|
506
506
|
type: 'object',
|
|
507
507
|
properties: { joy: { type: 'number' }, anger: { type: 'number' }, sorrow: { type: 'number' }, fear: { type: 'number' } },
|
|
508
508
|
additionalProperties: false,
|
|
509
|
-
description: '
|
|
509
|
+
description: 'Omit keeps; null clears; object replaces after normalisation. Event feeling, not current mood.',
|
|
510
510
|
},
|
|
511
|
-
dominance: { type: 'number', description: '
|
|
512
|
-
salient_date: { type: 'string', description: '
|
|
513
|
-
observed_at: { type: 'string', description: 'ISO scene time for this edit;
|
|
514
|
-
absolute_date: { type: 'string', description: 'YYYY-MM-DD
|
|
515
|
-
valid_from: { type: 'string', description: 'YYYY-MM-DD
|
|
516
|
-
valid_to: { type: 'string', description: 'YYYY-MM-DD
|
|
511
|
+
dominance: { type: 'number', description: '-1..1; omit keeps.' },
|
|
512
|
+
salient_date: { type: 'string', description: 'MM-DD yearly or YYYY-MM-DD one-off; empty clears.' },
|
|
513
|
+
observed_at: { type: 'string', description: 'ISO scene time for this edit; omit uses conversation sceneTime.' },
|
|
514
|
+
absolute_date: { type: 'string', description: 'YYYY-MM-DD; omit re-derives, empty clears.' },
|
|
515
|
+
valid_from: { type: 'string', description: 'YYYY-MM-DD start; empty clears.' },
|
|
516
|
+
valid_to: { type: 'string', description: 'YYYY-MM-DD end; empty clears.' },
|
|
517
517
|
},
|
|
518
518
|
async (args, exec) => {
|
|
519
519
|
const result = await privateUpdate({
|