dsh-cross-memory 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +247 -2
- package/cordis.patch.yml +27 -0
- package/docs/DETAIL.md +13 -0
- package/docs/DETAIL.zh.md +17 -0
- package/icon.svg +1 -0
- package/lib/backfill.js +273 -0
- package/lib/citations.js +305 -0
- package/lib/client.js +1550 -0
- package/lib/config.js +736 -0
- package/lib/consolidate.js +1119 -0
- package/lib/extract.js +570 -0
- package/lib/gate.js +137 -0
- package/lib/git-origin.js +224 -0
- package/lib/index.js +4475 -0
- package/lib/log.js +260 -0
- package/lib/loops.js +186 -0
- package/lib/notices.js +195 -0
- package/lib/notify.js +33 -0
- package/lib/persona.js +112 -0
- package/lib/query.js +93 -0
- package/lib/raw-recall.js +286 -0
- package/lib/reflection.js +291 -0
- package/lib/remote.js +455 -0
- package/lib/render.js +678 -0
- package/lib/retention.js +64 -0
- package/lib/schedule.js +245 -0
- package/lib/search.js +1068 -0
- package/lib/skills.js +220 -0
- package/lib/state.js +701 -0
- package/lib/storage.js +1424 -0
- package/lib/sync-runtime.js +268 -0
- package/lib/sync.js +620 -0
- package/lib/test/activity.test.js +74 -0
- package/lib/test/archive.test.js +182 -0
- package/lib/test/backfill.test.js +144 -0
- package/lib/test/citations.test.js +91 -0
- package/lib/test/client-wiring.test.js +134 -0
- package/lib/test/consolidate-job.test.js +95 -0
- package/lib/test/consolidate.test.js +430 -0
- package/lib/test/consolidation-selection.test.js +152 -0
- package/lib/test/dedupe-keys.test.js +230 -0
- package/lib/test/delta.test.js +93 -0
- package/lib/test/derived.test.js +110 -0
- package/lib/test/disputes-panel.test.js +314 -0
- package/lib/test/eval.test.js +171 -0
- package/lib/test/expand.test.js +164 -0
- package/lib/test/extract.test.js +1020 -0
- package/lib/test/git-origin.test.js +189 -0
- package/lib/test/injection.test.js +440 -0
- package/lib/test/kind-filter.test.js +49 -0
- package/lib/test/legacy-state.test.js +69 -0
- package/lib/test/log.test.js +156 -0
- package/lib/test/loops.test.js +86 -0
- package/lib/test/memory.test.js +855 -0
- package/lib/test/notices.test.js +140 -0
- package/lib/test/persona.test.js +73 -0
- package/lib/test/prefilter.test.js +73 -0
- package/lib/test/preset.test.js +77 -0
- package/lib/test/raw-recall.test.js +186 -0
- package/lib/test/recall.test.js +433 -0
- package/lib/test/reflection.test.js +64 -0
- package/lib/test/remote.test.js +227 -0
- package/lib/test/retention.test.js +117 -0
- package/lib/test/retrieval.test.js +142 -0
- package/lib/test/rotation.test.js +228 -0
- package/lib/test/schedule.test.js +112 -0
- package/lib/test/settings-card.test.js +58 -0
- package/lib/test/skills.test.js +129 -0
- package/lib/test/state.test.js +212 -0
- package/lib/test/subagent-contract.test.js +139 -0
- package/lib/test/sweep.test.js +159 -0
- package/lib/test/sync.test.js +314 -0
- package/lib/test/time.test.js +171 -0
- package/lib/time.js +303 -0
- package/lib/tool.js +330 -0
- package/lib/types/backfill.d.ts +96 -0
- package/lib/types/citations.d.ts +105 -0
- package/lib/types/config.d.ts +811 -0
- package/lib/types/consolidate.d.ts +742 -0
- package/lib/types/extract.d.ts +352 -0
- package/lib/types/gate.d.ts +83 -0
- package/lib/types/git-origin.d.ts +23 -0
- package/lib/types/index.d.ts +1316 -0
- package/lib/types/log.d.ts +144 -0
- package/lib/types/loops.d.ts +82 -0
- package/lib/types/notices.d.ts +117 -0
- package/lib/types/notify.d.ts +12 -0
- package/lib/types/persona.d.ts +43 -0
- package/lib/types/query.d.ts +45 -0
- package/lib/types/raw-recall.d.ts +84 -0
- package/lib/types/reflection.d.ts +122 -0
- package/lib/types/remote.d.ts +233 -0
- package/lib/types/render.d.ts +286 -0
- package/lib/types/retention.d.ts +66 -0
- package/lib/types/schedule.d.ts +116 -0
- package/lib/types/search.d.ts +583 -0
- package/lib/types/skills.d.ts +71 -0
- package/lib/types/state.d.ts +294 -0
- package/lib/types/storage.d.ts +458 -0
- package/lib/types/sync-runtime.d.ts +103 -0
- package/lib/types/sync.d.ts +222 -0
- package/lib/types/test/activity.test.d.ts +1 -0
- package/lib/types/test/archive.test.d.ts +1 -0
- package/lib/types/test/backfill.test.d.ts +1 -0
- package/lib/types/test/citations.test.d.ts +1 -0
- package/lib/types/test/client-wiring.test.d.ts +1 -0
- package/lib/types/test/consolidate-job.test.d.ts +1 -0
- package/lib/types/test/consolidate.test.d.ts +1 -0
- package/lib/types/test/consolidation-selection.test.d.ts +1 -0
- package/lib/types/test/dedupe-keys.test.d.ts +1 -0
- package/lib/types/test/delta.test.d.ts +1 -0
- package/lib/types/test/derived.test.d.ts +1 -0
- package/lib/types/test/disputes-panel.test.d.ts +1 -0
- package/lib/types/test/eval.test.d.ts +1 -0
- package/lib/types/test/expand.test.d.ts +1 -0
- package/lib/types/test/extract.test.d.ts +1 -0
- package/lib/types/test/git-origin.test.d.ts +1 -0
- package/lib/types/test/injection.test.d.ts +1 -0
- package/lib/types/test/kind-filter.test.d.ts +1 -0
- package/lib/types/test/legacy-state.test.d.ts +1 -0
- package/lib/types/test/log.test.d.ts +1 -0
- package/lib/types/test/loops.test.d.ts +1 -0
- package/lib/types/test/memory.test.d.ts +1 -0
- package/lib/types/test/notices.test.d.ts +1 -0
- package/lib/types/test/persona.test.d.ts +1 -0
- package/lib/types/test/prefilter.test.d.ts +1 -0
- package/lib/types/test/preset.test.d.ts +1 -0
- package/lib/types/test/raw-recall.test.d.ts +1 -0
- package/lib/types/test/recall.test.d.ts +1 -0
- package/lib/types/test/reflection.test.d.ts +1 -0
- package/lib/types/test/remote.test.d.ts +1 -0
- package/lib/types/test/retention.test.d.ts +1 -0
- package/lib/types/test/retrieval.test.d.ts +1 -0
- package/lib/types/test/rotation.test.d.ts +1 -0
- package/lib/types/test/schedule.test.d.ts +1 -0
- package/lib/types/test/settings-card.test.d.ts +1 -0
- package/lib/types/test/skills.test.d.ts +1 -0
- package/lib/types/test/state.test.d.ts +1 -0
- package/lib/types/test/subagent-contract.test.d.ts +1 -0
- package/lib/types/test/sweep.test.d.ts +1 -0
- package/lib/types/test/sync.test.d.ts +1 -0
- package/lib/types/test/time.test.d.ts +1 -0
- package/lib/types/time.d.ts +67 -0
- package/lib/types/tool.d.ts +9 -0
- package/lib/types/types.d.ts +374 -0
- package/lib/types/workspace.d.ts +20 -0
- package/lib/types.js +47 -0
- package/lib/workspace.js +65 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +126 -4
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime half of the store sync: what the plugin itself owns.
|
|
3
|
+
*
|
|
4
|
+
* `sync.ts` knows git and entry arbitration but nothing about this plugin: it
|
|
5
|
+
* takes a resolver and a logger. This module supplies both — the model route a
|
|
6
|
+
* conflict is handed to, the settings that decide whether sync runs at all — and
|
|
7
|
+
* keeps that wiring out of the runtime file, which is already the largest one
|
|
8
|
+
* here.
|
|
9
|
+
*
|
|
10
|
+
* @module dsh-cross-memory/sync-runtime
|
|
11
|
+
*/
|
|
12
|
+
import { readFile } from 'node:fs/promises';
|
|
13
|
+
import { hostname } from 'node:os';
|
|
14
|
+
import { join } from 'node:path';
|
|
15
|
+
import { BlockAssembler, createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
16
|
+
import { CONSOLIDATE_SYSTEM, classifyPlan, mergePendingPlan, parsePlan, pinExistingScopes } from './consolidate.js';
|
|
17
|
+
import { formatEntry, parseEntry, slugify } from './storage.js';
|
|
18
|
+
import { MemorySync, parseClockTime } from './sync.js';
|
|
19
|
+
import { MEMORY_SOURCE_KIND } from './types.js';
|
|
20
|
+
/**
|
|
21
|
+
* Owns the store's {@link MemorySync} for one plugin instance.
|
|
22
|
+
*
|
|
23
|
+
* Starting is idempotent because the settings watcher restarts it on every
|
|
24
|
+
* commit; stopping is safe at any time.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The instruction that turns a consolidation pass into a one-entry merge.
|
|
28
|
+
*
|
|
29
|
+
* Same vocabulary as the consolidation pass, so the model does not have to learn
|
|
30
|
+
* a second output shape: a sync conflict is one memory with two revisions.
|
|
31
|
+
*/
|
|
32
|
+
export function renderConflictPrompt(id, ours, theirs) {
|
|
33
|
+
return [
|
|
34
|
+
CONSOLIDATE_SYSTEM,
|
|
35
|
+
'',
|
|
36
|
+
'SPECIAL CASE: the input below is TWO REVISIONS OF THE SAME MEMORY (id: ' + id + '), written on two machines.',
|
|
37
|
+
'Return the usual plan JSON with EXACTLY ONE memory: the merged revision, keeping id ' + id + '.',
|
|
38
|
+
'Do not retire it and do not add a second memory. Keep every fact from both revisions; when they contradict, keep both statements and prefer the newer revision for wording.',
|
|
39
|
+
'',
|
|
40
|
+
'--- REVISION A (this machine) ---',
|
|
41
|
+
ours,
|
|
42
|
+
'',
|
|
43
|
+
'--- REVISION B (other machine) ---',
|
|
44
|
+
theirs,
|
|
45
|
+
].join('\n');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Turn a model reply into the merged entry file, or into the disputes it raised.
|
|
49
|
+
*
|
|
50
|
+
* Pure so the arbitration is testable without an LLM: the caller hands in the
|
|
51
|
+
* reply and both revisions, and this decides with the same rules the
|
|
52
|
+
* consolidation pass obeys (`parsePlan` for shape, `classifyPlan` for loss).
|
|
53
|
+
*/
|
|
54
|
+
export function applyConflictPlan(reply, oursText, theirsText) {
|
|
55
|
+
const ours = parseEntry(oursText, 'global', 'unknown') ?? parseEntry(oursText, 'project', 'unknown');
|
|
56
|
+
const theirs = parseEntry(theirsText, 'global', 'unknown') ?? parseEntry(theirsText, 'project', 'unknown');
|
|
57
|
+
const id = ours?.id ?? theirs?.id;
|
|
58
|
+
if (id === undefined || ours === undefined)
|
|
59
|
+
return { disputes: [] };
|
|
60
|
+
const plan = parsePlan(reply, new Set([id]), 1);
|
|
61
|
+
if (plan === undefined || plan.upserts.length !== 1)
|
|
62
|
+
return { disputes: [] };
|
|
63
|
+
// A conflict is two revisions of ONE file, and the merge is written back to
|
|
64
|
+
// that same path: scope is part of the path, so the merge cannot move the
|
|
65
|
+
// entry between scopes. Pinning is the same rule every consolidation pass
|
|
66
|
+
// follows, and it also keeps a model that echoed the other revision's scope
|
|
67
|
+
// from staging a "move" that would write a second copy instead of editing the
|
|
68
|
+
// file both machines already share.
|
|
69
|
+
const pinned = pinExistingScopes(plan, [ours]).plan;
|
|
70
|
+
const classified = classifyPlan(pinned, { entries: [ours] });
|
|
71
|
+
// The fragment travels with the rows so accepting one is a plain write.
|
|
72
|
+
if (classified.disputes.length > 0)
|
|
73
|
+
return { disputes: classified.disputes, upserts: pinned.upserts };
|
|
74
|
+
const item = classified.safe.upserts[0];
|
|
75
|
+
if (item === undefined || item.id !== id)
|
|
76
|
+
return { disputes: [] };
|
|
77
|
+
const merged = {
|
|
78
|
+
...ours,
|
|
79
|
+
scope: item.scope,
|
|
80
|
+
kind: item.kind,
|
|
81
|
+
title: item.title,
|
|
82
|
+
body: item.body,
|
|
83
|
+
tags: item.tags,
|
|
84
|
+
keys: item.keys ?? ours.keys,
|
|
85
|
+
updatedAt: Math.max(ours.updatedAt, theirs?.updatedAt ?? 0),
|
|
86
|
+
...(item.appliesTo !== undefined ? { appliesTo: item.appliesTo } : {}),
|
|
87
|
+
...(item.durability !== undefined ? { durability: item.durability } : {}),
|
|
88
|
+
...(item.asOf !== undefined ? { asOf: item.asOf } : {}),
|
|
89
|
+
};
|
|
90
|
+
return { text: formatEntry(merged), merged: true };
|
|
91
|
+
}
|
|
92
|
+
/** A store path that belongs to one project's entry directory. */
|
|
93
|
+
const PROJECT_ENTRY_PATH = /^projects\/([^/]+)\/entries\//u;
|
|
94
|
+
/**
|
|
95
|
+
* Whether a store path is a retired entry's file rather than a live one.
|
|
96
|
+
*
|
|
97
|
+
* Retirements are archived, not deleted, and a store sync merges an archived
|
|
98
|
+
* file exactly like a live one — but applying a plan always writes into
|
|
99
|
+
* `entries/`. A question staged for an archived file would therefore let
|
|
100
|
+
* "accept" resurrect a memory somebody retired, so those conflicts stay on the
|
|
101
|
+
* timestamp rule instead of becoming a decision.
|
|
102
|
+
*
|
|
103
|
+
* @param path - store-relative path of the conflicting file.
|
|
104
|
+
* @returns true for `archive/<id>.md` and `projects/<slug>/archive/<id>.md`.
|
|
105
|
+
*/
|
|
106
|
+
export function isArchivedEntryPath(path) {
|
|
107
|
+
return /(^|\/)archive\//u.test(path);
|
|
108
|
+
}
|
|
109
|
+
/** Read the `root` of one project descriptor, or `undefined` when absent or unusable. */
|
|
110
|
+
async function readDescriptorRoot(file) {
|
|
111
|
+
try {
|
|
112
|
+
const parsed = JSON.parse(await readFile(file, 'utf8'));
|
|
113
|
+
return typeof parsed.root === 'string' && parsed.root.length > 0 ? parsed.root : undefined;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// Missing or unreadable is "unknown", never a reason to invent a path: a
|
|
117
|
+
// wrong root would write one project's merge into another project's store.
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Resolve this machine's checkout of the project a conflicting entry lives in.
|
|
123
|
+
*
|
|
124
|
+
* A project entry is written back through the workspace root the store keys
|
|
125
|
+
* that project by, and a sync conflict only carries store-relative paths. The
|
|
126
|
+
* host descriptor is the primary source because `project.json` is rewritten by
|
|
127
|
+
* whichever machine synced last, while `hosts/<host>.json` keeps THIS machine's
|
|
128
|
+
* checkout and is never overwritten by another machine. The host file is named
|
|
129
|
+
* after the same slug `writeHostDescriptor` uses, not the raw hostname.
|
|
130
|
+
*
|
|
131
|
+
* @param memoriesDir - the memory store root.
|
|
132
|
+
* @param path - the conflicting entry path relative to the store.
|
|
133
|
+
* @returns the checkout root to write through, or `undefined` for a global entry
|
|
134
|
+
* or when no descriptor names one.
|
|
135
|
+
*/
|
|
136
|
+
export async function projectRootOf(memoriesDir, path) {
|
|
137
|
+
const slug = PROJECT_ENTRY_PATH.exec(path)?.[1];
|
|
138
|
+
if (slug === undefined)
|
|
139
|
+
return undefined;
|
|
140
|
+
const projectDir = join(memoriesDir, 'projects', slug);
|
|
141
|
+
const own = await readDescriptorRoot(join(projectDir, 'hosts', `${slugify(hostname())}.json`));
|
|
142
|
+
if (own !== undefined)
|
|
143
|
+
return own;
|
|
144
|
+
return readDescriptorRoot(join(projectDir, 'project.json'));
|
|
145
|
+
}
|
|
146
|
+
export class StoreSyncService {
|
|
147
|
+
host;
|
|
148
|
+
sync;
|
|
149
|
+
constructor(host) {
|
|
150
|
+
this.host = host;
|
|
151
|
+
}
|
|
152
|
+
/** Start (or restart) sync from the current settings. */
|
|
153
|
+
start() {
|
|
154
|
+
const settings = this.host.settings();
|
|
155
|
+
this.stop();
|
|
156
|
+
const sync = new MemorySync({
|
|
157
|
+
memoriesDir: this.host.memoriesDir,
|
|
158
|
+
remote: settings.syncRemote,
|
|
159
|
+
intervalMs: settings.syncIntervalMinutes > 0 ? settings.syncIntervalMinutes * 60_000 : 0,
|
|
160
|
+
clock: settings.syncClock.split(',').map((part) => part.trim()).filter((part) => parseClockTime(part) !== undefined),
|
|
161
|
+
debounceMs: settings.syncDebounceSeconds * 1_000,
|
|
162
|
+
gitTimeoutMs: 30_000,
|
|
163
|
+
networkTimeoutMs: 60_000,
|
|
164
|
+
log: this.host.log,
|
|
165
|
+
host: hostname(),
|
|
166
|
+
resolveConflict: (conflict) => this.resolve(conflict),
|
|
167
|
+
});
|
|
168
|
+
this.sync = sync;
|
|
169
|
+
void sync.init().then(() => {
|
|
170
|
+
if (this.sync !== sync)
|
|
171
|
+
return;
|
|
172
|
+
sync.start();
|
|
173
|
+
this.host.log.decision('dsh-cross-memory: 记忆库同步已启动(remote=%s,间隔 %d 分钟)', settings.syncRemote.length > 0 ? settings.syncRemote : '本地', settings.syncIntervalMinutes);
|
|
174
|
+
}, (error) => {
|
|
175
|
+
this.host.log.warn('dsh-cross-memory: 记忆库同步初始化失败:%o', error);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/** Stop the timer and any queued commit. */
|
|
179
|
+
stop() {
|
|
180
|
+
this.sync?.stop();
|
|
181
|
+
this.sync = undefined;
|
|
182
|
+
}
|
|
183
|
+
/** Note that the store changed; the commit happens on the debounce timer. */
|
|
184
|
+
markChanged() {
|
|
185
|
+
this.sync?.queueCommit();
|
|
186
|
+
}
|
|
187
|
+
/** Commit, pull and push once, now. */
|
|
188
|
+
async runNow() {
|
|
189
|
+
await this.sync?.run('manual');
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Merge two revisions of one memory through the consolidation machinery.
|
|
193
|
+
*
|
|
194
|
+
* Every failure path returns undefined, which makes `sync.ts` fall back to the
|
|
195
|
+
* newer revision. A merge the loss rules call risky is not written at all: it is
|
|
196
|
+
* staged in the pending proposal, so a sync conflict is answered in the same
|
|
197
|
+
* place as every other consolidation question.
|
|
198
|
+
*/
|
|
199
|
+
async resolve(conflict) {
|
|
200
|
+
const llm = this.host.llm();
|
|
201
|
+
if (llm === undefined)
|
|
202
|
+
return undefined;
|
|
203
|
+
const settings = this.host.settings();
|
|
204
|
+
const provider = settings.syncConflictProvider || settings.extractProvider;
|
|
205
|
+
const model = settings.syncConflictModel || settings.extractModel;
|
|
206
|
+
if (provider.length === 0 || model.length === 0) {
|
|
207
|
+
this.host.log.decision('dsh-cross-memory: 记忆冲突没有可用模型路由(%s),按更新时间取新版', conflict.path);
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
const ours = parseEntry(conflict.ours, 'global', 'unknown') ?? parseEntry(conflict.ours, 'project', 'unknown');
|
|
211
|
+
const id = ours?.id ?? parseEntry(conflict.theirs, 'global', 'unknown')?.id;
|
|
212
|
+
if (id === undefined)
|
|
213
|
+
return undefined;
|
|
214
|
+
try {
|
|
215
|
+
const assembler = new BlockAssembler();
|
|
216
|
+
for await (const chunk of llm.stream({
|
|
217
|
+
provider,
|
|
218
|
+
model,
|
|
219
|
+
messages: [createUserMessage({ content: [{ type: 'text', text: renderConflictPrompt(id, conflict.ours, conflict.theirs) }], source: { kind: MEMORY_SOURCE_KIND } })],
|
|
220
|
+
system: CONSOLIDATE_SYSTEM,
|
|
221
|
+
maxTokens: 2048,
|
|
222
|
+
purpose: 'compaction',
|
|
223
|
+
signal: AbortSignal.timeout(settings.extractTimeoutMs),
|
|
224
|
+
}))
|
|
225
|
+
assembler.push(chunk);
|
|
226
|
+
const text = assembler.blocks()
|
|
227
|
+
.filter((block) => block.type === 'text')
|
|
228
|
+
.map((block) => block.text)
|
|
229
|
+
.join('\n');
|
|
230
|
+
const applied = applyConflictPlan(text, conflict.ours, conflict.theirs);
|
|
231
|
+
if ('merged' in applied)
|
|
232
|
+
return applied.text;
|
|
233
|
+
if (applied.disputes.length > 0) {
|
|
234
|
+
// Applying a row writes the entry into the live tree, so a conflicted
|
|
235
|
+
// archive file must never become a row: accepting it would bring a
|
|
236
|
+
// retired memory back. The newer revision wins, as everywhere else.
|
|
237
|
+
if (isArchivedEntryPath(conflict.path)) {
|
|
238
|
+
this.host.log.decision('dsh-cross-memory: 归档条目 %s 的合并会丢信息,按更新时间取新版而不进待裁决', conflict.path);
|
|
239
|
+
return undefined;
|
|
240
|
+
}
|
|
241
|
+
// A project entry is written back through its workspace root, and the
|
|
242
|
+
// staged row has to carry it: staging '' made accepting it throw
|
|
243
|
+
// "a project scope requires a workspace root" and roll back, so the
|
|
244
|
+
// question could never be answered. A global entry needs no root, and
|
|
245
|
+
// an unknown one stays '' rather than being guessed.
|
|
246
|
+
const projectRoot = await projectRootOf(this.host.memoriesDir, conflict.path) ?? '';
|
|
247
|
+
await mergePendingPlan(this.host.memoriesDir, {
|
|
248
|
+
// The merged body travels with the rows: staging only the question
|
|
249
|
+
// left "accept" with nothing to write, and the panel called that a
|
|
250
|
+
// rewrite.
|
|
251
|
+
plan: { upserts: applied.upserts ?? [], retire: [], skills: [], notes: '同步冲突待裁决' },
|
|
252
|
+
disputes: applied.disputes,
|
|
253
|
+
projectRoot,
|
|
254
|
+
at: Date.now(),
|
|
255
|
+
label: '记忆同步冲突(' + id + ')',
|
|
256
|
+
}).catch((error) => {
|
|
257
|
+
this.host.log.warn('dsh-cross-memory: 同步冲突未能进入待裁决队列:%o', error);
|
|
258
|
+
});
|
|
259
|
+
this.host.log.decision('dsh-cross-memory: 冲突 %s 的合并会丢信息,已进入待裁决;本轮取更新时间较新的版本', conflict.path);
|
|
260
|
+
}
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
this.host.log.warn('dsh-cross-memory: 记忆冲突的模型解析失败,按更新时间取新版:%o', error);
|
|
265
|
+
return undefined;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|