dsh-memu-memory 1.3.7 → 1.3.9
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 +1 -1
- package/CHANGELOG.md +70 -0
- package/README.md +7 -7
- package/README.zh.md +7 -7
- package/docs/client-conventions.md +1 -0
- package/docs/contributing.md +2 -2
- package/docs/host-adaptation.md +1 -1
- package/docs/memory-semantics.md +7 -6
- package/docs/troubleshooting.md +74 -7
- package/lib/auto-link/decide.js +0 -4
- package/lib/binding-diagnostics.js +2 -2
- package/lib/client.js +150 -81
- package/lib/consolidation-ledger.js +6 -2
- package/lib/curator.js +42 -10
- package/lib/cycle.js +28 -3
- package/lib/inbound.js +24 -9
- package/lib/inject.js +379 -215
- package/lib/local-vector-service.js +1 -10
- package/lib/memory.js +704 -181
- package/lib/paths.js +24 -0
- package/lib/private.js +294 -134
- package/lib/rpc.js +53 -6
- package/lib/snippet.js +49 -28
- package/lib/state.js +185 -26
- package/lib/tools.js +137 -28
- package/lib/webui.js +25 -1
- package/lib/worker-pool.js +260 -26
- package/package.json +1 -1
- package/scripts/check-i18n.mjs +19 -0
- package/scripts/recall-bench.mjs +4 -4
- package/scripts/simulate-injection.mjs +3 -0
- package/tests/activity-wiring.test.mjs +52 -0
- package/tests/client-render.test.mjs +207 -0
- package/tests/consolidation-feed.test.mjs +26 -0
- package/tests/consolidation-fork.test.mjs +587 -26
- package/tests/cross-library-recall.test.mjs +156 -0
- package/tests/cue.test.mjs +15 -2
- package/tests/curator-contract.test.mjs +191 -0
- package/tests/curator-probe.test.mjs +5 -5
- package/tests/curator.test.mjs +3 -1
- package/tests/hybrid-recall.test.mjs +488 -0
- package/tests/inbound.test.mjs +49 -4
- package/tests/inject-conflict.test.mjs +70 -9
- package/tests/inject-guide.test.mjs +13 -1
- package/tests/inject.test.mjs +10 -0
- package/tests/injection-budget.test.mjs +101 -0
- package/tests/injection-chain.test.mjs +37 -0
- package/tests/injection-rollback.test.mjs +172 -9
- package/tests/issue2-chain.test.mjs +169 -0
- package/tests/lexicon-inject.test.mjs +33 -5
- package/tests/managed-memory.test.mjs +625 -1
- package/tests/media.test.mjs +1 -1
- package/tests/new-session-gate.test.mjs +280 -25
- package/tests/open-loop-date.test.mjs +11 -1
- package/tests/recall-intent.test.mjs +52 -3
- package/tests/regression-sweep.test.mjs +281 -0
- package/tests/simulate-injection.test.mjs +4 -4
- package/tests/snippet.test.mjs +33 -1
- package/tests/state.test.mjs +8 -3
- package/tests/tool-schema.test.mjs +52 -0
- package/tests/tools.test.mjs +394 -0
- package/tests/webui.test.mjs +16 -2
- package/tests/worker-lifecycle.test.mjs +419 -36
package/lib/paths.js
CHANGED
|
@@ -69,6 +69,30 @@ export function redactSecrets(value, secrets = []) {
|
|
|
69
69
|
.replace(/(https?:\/\/)[^/@\s]+:[^/@\s]+@/g, '$1[REDACTED]@')
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
export function memoryRefKey({ scope, libraryId = null, id }) {
|
|
73
|
+
return JSON.stringify([scope, libraryId, id])
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function memoryContentRevision(entry) {
|
|
77
|
+
const content = {
|
|
78
|
+
title: redactSecrets(entry?.title || ''),
|
|
79
|
+
body: redactSecrets(entry?.content || ''),
|
|
80
|
+
source: entry?.source || 'inferred', sourceKind: entry?.source_kind || null,
|
|
81
|
+
disclosure: entry?.disclosure || 'can_tell', visibility: entry?.visibility || 'shared',
|
|
82
|
+
owner: entry?.owner || null, layer: entry?.layer || 'long_term',
|
|
83
|
+
speakerId: entry?.speaker_id || null, absoluteDate: entry?.absolute_date || null,
|
|
84
|
+
confidence: entry?.confidence ?? null, conflictsWith: entry?.conflicts_with || null,
|
|
85
|
+
context: entry?.context || null, knownBy: entry?.known_by || null,
|
|
86
|
+
links: entry?.links || [],
|
|
87
|
+
attachments: (entry?.attachments || []).map(item => [item.sha256 || null, redactSecrets(item.caption || ''), item.kind || null]),
|
|
88
|
+
}
|
|
89
|
+
return crypto.createHash('sha256').update(JSON.stringify(content)).digest('hex')
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function memoryRef({ scope, libraryId = null, id, entry }) {
|
|
93
|
+
return { scope, libraryId: scope === 'global' ? null : libraryId, id, revision: memoryContentRevision(entry) }
|
|
94
|
+
}
|
|
95
|
+
|
|
72
96
|
export function readJsonStrict(file) {
|
|
73
97
|
let raw
|
|
74
98
|
try {
|