toon-memory 2.11.0 → 3.1.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/README.de.md +1211 -0
- package/README.es.md +1216 -0
- package/README.fr.md +1211 -0
- package/README.ja.md +1211 -0
- package/README.ko.md +1211 -0
- package/README.md +22 -7
- package/README.pt-br.md +1213 -0
- package/README.zh.md +1211 -0
- package/dist/cli/session-start.js +32 -1
- package/dist/cli/setup.js +133 -22
- package/mcp/server.js +28719 -27935
- package/package.json +4 -2
- package/src/cli/agents.ts +10 -9
- package/src/cli/commands.ts +1 -1
- package/src/cli/config-writer.ts +90 -3
- package/src/cli/hooks.ts +2 -2
- package/src/cli/opencode-plugin.ts +58 -11
- package/src/cli/session-start.ts +47 -1
- package/src/cli/types.ts +4 -2
- package/src/lib/graph.ts +4 -0
- package/src/lib/quality.ts +61 -10
- package/src/mcp/config.ts +2 -0
- package/src/mcp/consolidation.ts +52 -7
- package/src/mcp/scoring.ts +7 -2
- package/src/mcp/tools.ts +747 -5
package/src/mcp/scoring.ts
CHANGED
|
@@ -48,8 +48,9 @@ export function findRelatedEntries(text: string, excludeKey: string = "", limit:
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* Increment the `accessed` counter
|
|
52
|
-
* Used by recall/suggest so frequently-used
|
|
51
|
+
* Increment the `accessed` counter and update `lastAccessed` timestamp
|
|
52
|
+
* for the given entry ids. Used by recall/suggest so frequently-used
|
|
53
|
+
* memories rank higher.
|
|
53
54
|
*/
|
|
54
55
|
export function bumpAccessed(ids: string[]): void {
|
|
55
56
|
if (ids.length === 0) return
|
|
@@ -59,6 +60,7 @@ export function bumpAccessed(ids: string[]): void {
|
|
|
59
60
|
const headerIdx = lines.findIndex((l) => l.startsWith("entries[") || /^\[\d+\|]/.test(l))
|
|
60
61
|
if (headerIdx === -1) return
|
|
61
62
|
|
|
63
|
+
const now = new Date().toISOString()
|
|
62
64
|
for (let i = headerIdx + 1; i < lines.length; i++) {
|
|
63
65
|
const line = lines[i]
|
|
64
66
|
if (!line.startsWith(" ") || !line.includes("|")) continue
|
|
@@ -67,6 +69,9 @@ export function bumpAccessed(ids: string[]): void {
|
|
|
67
69
|
if (idSet.has(parts[0])) {
|
|
68
70
|
const accessed = parts.length > 8 ? (parseInt(parts[8]) || 0) + 1 : 1
|
|
69
71
|
parts[8] = String(accessed)
|
|
72
|
+
// Ensure we have enough fields for lastAccessed (field 12)
|
|
73
|
+
while (parts.length < 13) parts.push("")
|
|
74
|
+
parts[12] = now
|
|
70
75
|
lines[i] = ` ${parts.join("|")}`
|
|
71
76
|
}
|
|
72
77
|
}
|