claude-mem 12.4.4 → 12.4.6
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/dist/npx-cli/index.js +156 -153
- package/dist/opencode-plugin/index.js +2 -2
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +8 -8
- package/plugin/package.json +2 -1
- package/plugin/scripts/context-generator.cjs +79 -66
- package/plugin/scripts/mcp-server.cjs +36 -74
- package/plugin/scripts/smart-install.js +2 -57
- package/plugin/scripts/worker-service.cjs +211 -191
- package/plugin/skills/timeline-report/SKILL.md +15 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
`)}}}}},
|
|
1
|
+
function S(){let t=process.env.CLAUDE_MEM_WORKER_PORT,n=t?Number.parseInt(t.trim(),10):NaN;if(Number.isInteger(n)&&n>=1&&n<=65535)return String(n);let s=typeof process.getuid=="function"?process.getuid():77;return String(37700+s%100)}var g=`http://127.0.0.1:${S()}`,u=1e3,m={"Content-Type":"application/json"};function d(t,n){fetch(`${g}${t}`,{method:"POST",headers:m,body:JSON.stringify(n)}).catch(s=>{let o=s instanceof Error?s.message:String(s);o.includes("ECONNREFUSED")||console.warn(`[claude-mem] Worker POST ${t} failed: ${o}`)})}async function w(t){try{let n=await fetch(`${g}${t}`,{headers:m});return n.ok?await n.text():(console.warn(`[claude-mem] Worker GET ${t} returned ${n.status}`),null)}catch(n){let s=n instanceof Error?n.message:String(n);return s.includes("ECONNREFUSED")||console.warn(`[claude-mem] Worker GET ${t} failed: ${s}`),null}}var c=new Map,k=1e3;function l(t){if(!c.has(t)){for(;c.size>=k;){let n=c.keys().next().value;if(n!==void 0)c.delete(n);else break}c.set(t,`opencode-${t}-${Date.now()}`)}return c.get(t)}var v=async t=>{let n=t.project?.name||"opencode";return console.log(`[claude-mem] OpenCode plugin loading (project: ${n})`),{hooks:{tool:{execute:{after:(s,o)=>{let e=l(s.sessionID),r=o.output||"";r.length>u&&(r=r.slice(0,u)),d("/api/sessions/observations",{contentSessionId:e,tool_name:s.tool,tool_input:s.args||{},tool_response:r,cwd:t.directory})}}}},event:(s,o)=>{switch(s){case"session.created":{let{event:e}=o,r=l(e.sessionID);d("/api/sessions/init",{contentSessionId:r,project:n,prompt:""});break}case"message.updated":{let{event:e}=o;if(e.role!=="assistant")break;let r=l(e.sessionID),a=e.content||"";a.length>u&&(a=a.slice(0,u)),d("/api/sessions/observations",{contentSessionId:r,tool_name:"assistant_message",tool_input:{},tool_response:a,cwd:t.directory});break}case"session.compacted":{let{event:e}=o,r=l(e.sessionID);d("/api/sessions/summarize",{contentSessionId:r,last_assistant_message:e.summary||""});break}case"file.edited":{let{event:e}=o,r=l(e.sessionID);d("/api/sessions/observations",{contentSessionId:r,tool_name:"file_edit",tool_input:{path:e.path},tool_response:e.diff?e.diff.slice(0,u):`File edited: ${e.path}`,cwd:t.directory});break}case"session.deleted":{let{event:e}=o;c.delete(e.sessionID);break}}},tool:{claude_mem_search:{description:"Search claude-mem memory database for past observations, sessions, and context",args:{query:{type:"string",description:"Search query for memory observations"}},async execute(s){let o=String(s.query||"");if(!o)return"Please provide a search query.";let e=await w(`/api/search/observations?query=${encodeURIComponent(o)}&limit=10`);if(!e)return"claude-mem worker is not running. Start it with: npx claude-mem start";let r;try{r=JSON.parse(e)}catch(i){return console.warn("[claude-mem] Failed to parse search results:",i instanceof Error?i.message:String(i)),"Failed to parse search results."}let a=Array.isArray(r.items)?r.items:[];return a.length===0?`No results found for "${o}".`:a.slice(0,10).map((i,f)=>{let p=String(i.title||i.subtitle||"Untitled"),E=i.project?` [${String(i.project)}]`:"";return`${f+1}. ${p}${E}`}).join(`
|
|
2
|
+
`)}}}}},y=v;export{v as ClaudeMemPlugin,y as default};
|
package/package.json
CHANGED
package/plugin/hooks/hooks.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{
|
|
9
9
|
"type": "command",
|
|
10
10
|
"shell": "bash",
|
|
11
|
-
"command": "export PATH=\"$HOME/.nvm/versions/node/v$(ls \\\"$HOME/.nvm/versions/node\\\" 2>/dev/null | sed 's/^v//' | sort -t. -k1,1n -k2,2n -k3,3n | tail -1)/bin:$HOME/.local/bin:/usr/local/bin:/opt/homebrew/bin:$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt $HOME/.claude/plugins/cache/thedotmack/claude-mem/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/smart-install.js\"",
|
|
11
|
+
"command": "export PATH=\"$HOME/.nvm/versions/node/v$(ls \\\"$HOME/.nvm/versions/node\\\" 2>/dev/null | sed 's/^v//' | sort -t. -k1,1n -k2,2n -k3,3n | tail -1)/bin:$HOME/.local/bin:/usr/local/bin:/opt/homebrew/bin:$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt \"$HOME/.claude/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_R\" 2>/dev/null); [ -n \"$_W\" ] && _R=\"$_W\"; }; node \"$_R/scripts/smart-install.js\"",
|
|
12
12
|
"timeout": 300
|
|
13
13
|
}
|
|
14
14
|
]
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
{
|
|
22
22
|
"type": "command",
|
|
23
23
|
"shell": "bash",
|
|
24
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt $HOME/.claude/plugins/cache/thedotmack/claude-mem/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/smart-install.js\"",
|
|
24
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt \"$HOME/.claude/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_R\" 2>/dev/null); [ -n \"$_W\" ] && _R=\"$_W\"; }; node \"$_R/scripts/smart-install.js\"",
|
|
25
25
|
"timeout": 300
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"type": "command",
|
|
29
29
|
"shell": "bash",
|
|
30
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt $HOME/.claude/plugins/cache/thedotmack/claude-mem/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" start; echo '{\"continue\":true,\"suppressOutput\":true}'",
|
|
30
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt \"$HOME/.claude/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_R\" 2>/dev/null); [ -n \"$_W\" ] && _R=\"$_W\"; }; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" start; echo '{\"continue\":true,\"suppressOutput\":true}'",
|
|
31
31
|
"timeout": 60
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"type": "command",
|
|
35
35
|
"shell": "bash",
|
|
36
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt $HOME/.claude/plugins/cache/thedotmack/claude-mem/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code context",
|
|
36
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt \"$HOME/.claude/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_R\" 2>/dev/null); [ -n \"$_W\" ] && _R=\"$_W\"; }; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code context",
|
|
37
37
|
"timeout": 60
|
|
38
38
|
}
|
|
39
39
|
]
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
{
|
|
46
46
|
"type": "command",
|
|
47
47
|
"shell": "bash",
|
|
48
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt $HOME/.claude/plugins/cache/thedotmack/claude-mem/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code session-init",
|
|
48
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt \"$HOME/.claude/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_R\" 2>/dev/null); [ -n \"$_W\" ] && _R=\"$_W\"; }; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code session-init",
|
|
49
49
|
"timeout": 60
|
|
50
50
|
}
|
|
51
51
|
]
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
{
|
|
59
59
|
"type": "command",
|
|
60
60
|
"shell": "bash",
|
|
61
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt $HOME/.claude/plugins/cache/thedotmack/claude-mem/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code observation",
|
|
61
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt \"$HOME/.claude/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_R\" 2>/dev/null); [ -n \"$_W\" ] && _R=\"$_W\"; }; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code observation",
|
|
62
62
|
"timeout": 120
|
|
63
63
|
}
|
|
64
64
|
]
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
{
|
|
72
72
|
"type": "command",
|
|
73
73
|
"shell": "bash",
|
|
74
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt $HOME/.claude/plugins/cache/thedotmack/claude-mem/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code file-context",
|
|
74
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt \"$HOME/.claude/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_R\" 2>/dev/null); [ -n \"$_W\" ] && _R=\"$_W\"; }; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code file-context",
|
|
75
75
|
"timeout": 60
|
|
76
76
|
}
|
|
77
77
|
]
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
{
|
|
84
84
|
"type": "command",
|
|
85
85
|
"shell": "bash",
|
|
86
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt $HOME/.claude/plugins/cache/thedotmack/claude-mem/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code summarize",
|
|
86
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=$(ls -dt \"$HOME/.claude/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null | head -1); _R=\"${_R%/}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_R\" 2>/dev/null); [ -n \"$_W\" ] && _R=\"$_W\"; }; node \"$_R/scripts/bun-runner.js\" \"$_R/scripts/worker-service.cjs\" hook claude-code summarize",
|
|
87
87
|
"timeout": 120
|
|
88
88
|
}
|
|
89
89
|
]
|
package/plugin/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-mem-plugin",
|
|
3
|
-
"version": "12.4.
|
|
3
|
+
"version": "12.4.6",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Runtime dependencies for claude-mem bundled hooks",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
8
|
+
"zod": "^4.3.6",
|
|
8
9
|
"tree-sitter-cli": "^0.26.5",
|
|
9
10
|
"tree-sitter-c": "^0.24.1",
|
|
10
11
|
"tree-sitter-cpp": "^0.23.4",
|