@hir4ta/mneme 0.20.0 → 0.20.2
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/.claude-plugin/plugin.json +1 -1
- package/dist/lib/incremental-save.js +16 -3
- package/dist/public/assets/{index-CFkxnncE.js → index-CeHiZXwl.js} +2 -2
- package/dist/public/assets/{react-force-graph-2d-D3wGjFqA.js → react-force-graph-2d-CGnpkwRw.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/servers/db-server.js +33 -1
- package/hooks/session-end.sh +15 -1
- package/package.json +1 -1
- package/servers/db-server.ts +44 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mneme",
|
|
3
3
|
"description": "A plugin that provides long-term memory for Claude Code. It automatically saves context lost during auto-compact, offering features for session restoration, recording technical decisions, and learning developer patterns.",
|
|
4
|
-
"version": "0.20.
|
|
4
|
+
"version": "0.20.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "hir4ta"
|
|
7
7
|
},
|
|
@@ -197,15 +197,17 @@ function extractSlashCommand(content) {
|
|
|
197
197
|
const match = content.match(/<command-name>([^<]+)<\/command-name>/);
|
|
198
198
|
return match ? match[1] : void 0;
|
|
199
199
|
}
|
|
200
|
-
function extractToolResultMeta(content) {
|
|
200
|
+
function extractToolResultMeta(content, toolUseIdToName) {
|
|
201
201
|
return content.filter((c) => c.type === "tool_result" && c.tool_use_id).map((c) => {
|
|
202
202
|
const contentStr = typeof c.content === "string" ? c.content : c.content ? JSON.stringify(c.content) : "";
|
|
203
203
|
const lineCount = contentStr.split("\n").length;
|
|
204
204
|
const filePathMatch = contentStr.match(
|
|
205
205
|
/^(?:\s*\d+[→|]\s*)?([^\n]+\.(ts|js|py|json|md|sql|sh|tsx|jsx))/
|
|
206
206
|
);
|
|
207
|
+
const toolUseId = c.tool_use_id || "";
|
|
207
208
|
return {
|
|
208
|
-
toolUseId
|
|
209
|
+
toolUseId,
|
|
210
|
+
toolName: toolUseIdToName.get(toolUseId),
|
|
209
211
|
success: !c.is_error,
|
|
210
212
|
contentLength: contentStr.length,
|
|
211
213
|
lineCount: lineCount > 1 ? lineCount : void 0,
|
|
@@ -290,11 +292,22 @@ async function parseTranscriptIncremental(transcriptPath, lastSavedLine) {
|
|
|
290
292
|
slashCommand: extractSlashCommand(content)
|
|
291
293
|
};
|
|
292
294
|
});
|
|
295
|
+
const toolUseIdToName = /* @__PURE__ */ new Map();
|
|
296
|
+
for (const entry of entries) {
|
|
297
|
+
if (entry.type === "assistant" && Array.isArray(entry.message?.content)) {
|
|
298
|
+
for (const c of entry.message.content) {
|
|
299
|
+
if (c.type === "tool_use" && c.id && c.name) {
|
|
300
|
+
toolUseIdToName.set(c.id, c.name);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
293
305
|
const toolResultsByTimestamp = /* @__PURE__ */ new Map();
|
|
294
306
|
for (const entry of entries) {
|
|
295
307
|
if (entry.type === "user" && Array.isArray(entry.message?.content)) {
|
|
296
308
|
const results = extractToolResultMeta(
|
|
297
|
-
entry.message.content
|
|
309
|
+
entry.message.content,
|
|
310
|
+
toolUseIdToName
|
|
298
311
|
);
|
|
299
312
|
if (results.length > 0) {
|
|
300
313
|
const key = entry.timestamp.slice(0, 16);
|