claude-mem 12.7.2 → 12.7.3
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/.codex-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/dist/binaries/worker-service-v10.3.1-win-x64.exe +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/npx-cli/index.js +105 -105
- package/dist/sdk/index.d.ts +109 -0
- package/dist/sdk/index.js +183 -0
- package/openclaw/openclaw.plugin.json +1 -1
- package/package.json +2 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -1
- package/plugin/hooks/codex-hooks.json +7 -7
- package/plugin/hooks/hooks.json +7 -7
- package/plugin/package.json +1 -1
- package/plugin/scripts/context-generator.cjs +89 -81
- package/plugin/scripts/mcp-server.cjs +26 -26
- package/plugin/scripts/version-check.js +22 -2
- package/plugin/scripts/worker-service.cjs +228 -215
- package/plugin/skills/version-bump/SKILL.md +6 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude-Mem SDK - TypeScript Declarations
|
|
3
|
+
*
|
|
4
|
+
* Standalone module for external consumers to parse claude-mem observation XML
|
|
5
|
+
* and build prompts for the memory worker.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface ParsedObservation {
|
|
9
|
+
type: string;
|
|
10
|
+
title: string | null;
|
|
11
|
+
subtitle: string | null;
|
|
12
|
+
facts: string[];
|
|
13
|
+
narrative: string | null;
|
|
14
|
+
concepts: string[];
|
|
15
|
+
files_read: string[];
|
|
16
|
+
files_modified: string[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ParsedSummary {
|
|
20
|
+
request: string | null;
|
|
21
|
+
investigated: string | null;
|
|
22
|
+
learned: string | null;
|
|
23
|
+
completed: string | null;
|
|
24
|
+
next_steps: string | null;
|
|
25
|
+
notes: string | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface Observation {
|
|
29
|
+
id: number;
|
|
30
|
+
tool_name: string;
|
|
31
|
+
tool_input: string;
|
|
32
|
+
tool_output: string;
|
|
33
|
+
created_at_epoch: number;
|
|
34
|
+
cwd?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ParseObservationsOptions {
|
|
38
|
+
/** Array of valid observation types. If provided, validates types against this list. */
|
|
39
|
+
validTypes?: string[];
|
|
40
|
+
/** Type to use if type is missing or invalid. Defaults to 'observation'. */
|
|
41
|
+
fallbackType?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Parse observation XML blocks from text
|
|
46
|
+
* Returns all observations found in the text
|
|
47
|
+
*
|
|
48
|
+
* @param text - The text containing observation XML blocks
|
|
49
|
+
* @param options - Optional configuration for type validation
|
|
50
|
+
* @returns Array of parsed observations
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const text = `<observation>
|
|
55
|
+
* <type>code_change</type>
|
|
56
|
+
* <title>Added login feature</title>
|
|
57
|
+
* <facts><fact>New auth module</fact></facts>
|
|
58
|
+
* </observation>`;
|
|
59
|
+
*
|
|
60
|
+
* const observations = parseObservations(text);
|
|
61
|
+
* // => [{ type: 'code_change', title: 'Added login feature', ... }]
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export function parseObservations(
|
|
65
|
+
text: string,
|
|
66
|
+
options?: ParseObservationsOptions
|
|
67
|
+
): ParsedObservation[];
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Parse summary XML block from text
|
|
71
|
+
* Returns null if no valid summary found or if summary was skipped
|
|
72
|
+
*
|
|
73
|
+
* @param text - The text containing summary XML block
|
|
74
|
+
* @returns Parsed summary or null
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const text = `<summary>
|
|
79
|
+
* <request>Implement auth</request>
|
|
80
|
+
* <completed>Added JWT tokens</completed>
|
|
81
|
+
* </summary>`;
|
|
82
|
+
*
|
|
83
|
+
* const summary = parseSummary(text);
|
|
84
|
+
* // => { request: 'Implement auth', completed: 'Added JWT tokens', ... }
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export function parseSummary(text: string): ParsedSummary | null;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Build prompt to send tool observation to SDK agent
|
|
91
|
+
*
|
|
92
|
+
* @param obs - The observation object containing tool data
|
|
93
|
+
* @returns Formatted XML prompt string
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* const obs = {
|
|
98
|
+
* id: 1,
|
|
99
|
+
* tool_name: 'Read',
|
|
100
|
+
* tool_input: '{"file_path": "/src/index.ts"}',
|
|
101
|
+
* tool_output: '{"content": "..."}',
|
|
102
|
+
* created_at_epoch: Date.now()
|
|
103
|
+
* };
|
|
104
|
+
*
|
|
105
|
+
* const prompt = buildObservationPrompt(obs);
|
|
106
|
+
* // => '<observed_from_primary_session>...'
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export function buildObservationPrompt(obs: Observation): string;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude-Mem SDK - Standalone module for external consumers
|
|
3
|
+
*
|
|
4
|
+
* This is a self-contained module that exports parsing and prompt utilities
|
|
5
|
+
* without internal dependencies on the main claude-mem codebase.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { parseObservations, buildObservationPrompt } from 'claude-mem/sdk';
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// Parser Functions
|
|
13
|
+
// ============================================================================
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Parse observation XML blocks from text
|
|
17
|
+
* Returns all observations found in the text
|
|
18
|
+
*
|
|
19
|
+
* @param {string} text - The text containing observation XML blocks
|
|
20
|
+
* @param {Object} [options] - Optional configuration
|
|
21
|
+
* @param {string[]} [options.validTypes] - Array of valid observation types. If provided, validates types.
|
|
22
|
+
* @param {string} [options.fallbackType='observation'] - Type to use if type is missing or invalid
|
|
23
|
+
* @returns {ParsedObservation[]} Array of parsed observations
|
|
24
|
+
*/
|
|
25
|
+
export function parseObservations(text, options = {}) {
|
|
26
|
+
const observations = [];
|
|
27
|
+
const { validTypes, fallbackType = 'observation' } = options;
|
|
28
|
+
|
|
29
|
+
// Match <observation>...</observation> blocks (non-greedy)
|
|
30
|
+
const observationRegex = /<observation>([\s\S]*?)<\/observation>/g;
|
|
31
|
+
|
|
32
|
+
let match;
|
|
33
|
+
while ((match = observationRegex.exec(text)) !== null) {
|
|
34
|
+
const obsContent = match[1];
|
|
35
|
+
|
|
36
|
+
// Extract all fields
|
|
37
|
+
const type = extractField(obsContent, 'type');
|
|
38
|
+
const title = extractField(obsContent, 'title');
|
|
39
|
+
const subtitle = extractField(obsContent, 'subtitle');
|
|
40
|
+
const narrative = extractField(obsContent, 'narrative');
|
|
41
|
+
const facts = extractArrayElements(obsContent, 'facts', 'fact');
|
|
42
|
+
const concepts = extractArrayElements(obsContent, 'concepts', 'concept');
|
|
43
|
+
const files_read = extractArrayElements(obsContent, 'files_read', 'file');
|
|
44
|
+
const files_modified = extractArrayElements(obsContent, 'files_modified', 'file');
|
|
45
|
+
|
|
46
|
+
// Determine final type
|
|
47
|
+
let finalType = fallbackType;
|
|
48
|
+
if (type) {
|
|
49
|
+
const trimmedType = type.trim();
|
|
50
|
+
if (validTypes) {
|
|
51
|
+
finalType = validTypes.includes(trimmedType) ? trimmedType : fallbackType;
|
|
52
|
+
} else {
|
|
53
|
+
finalType = trimmedType;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Filter out type from concepts array (types and concepts are separate dimensions)
|
|
58
|
+
const cleanedConcepts = concepts.filter(c => c !== finalType);
|
|
59
|
+
|
|
60
|
+
observations.push({
|
|
61
|
+
type: finalType,
|
|
62
|
+
title,
|
|
63
|
+
subtitle,
|
|
64
|
+
facts,
|
|
65
|
+
narrative,
|
|
66
|
+
concepts: cleanedConcepts,
|
|
67
|
+
files_read,
|
|
68
|
+
files_modified
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return observations;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Parse summary XML block from text
|
|
77
|
+
* Returns null if no valid summary found or if summary was skipped
|
|
78
|
+
*
|
|
79
|
+
* @param {string} text - The text containing summary XML block
|
|
80
|
+
* @returns {ParsedSummary|null} Parsed summary or null
|
|
81
|
+
*/
|
|
82
|
+
export function parseSummary(text) {
|
|
83
|
+
// Check for skip_summary first
|
|
84
|
+
const skipRegex = /<skip_summary\s+reason="([^"]+)"\s*\/>/;
|
|
85
|
+
const skipMatch = skipRegex.exec(text);
|
|
86
|
+
|
|
87
|
+
if (skipMatch) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Match <summary>...</summary> block (non-greedy)
|
|
92
|
+
const summaryRegex = /<summary>([\s\S]*?)<\/summary>/;
|
|
93
|
+
const summaryMatch = summaryRegex.exec(text);
|
|
94
|
+
|
|
95
|
+
if (!summaryMatch) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const summaryContent = summaryMatch[1];
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
request: extractField(summaryContent, 'request'),
|
|
103
|
+
investigated: extractField(summaryContent, 'investigated'),
|
|
104
|
+
learned: extractField(summaryContent, 'learned'),
|
|
105
|
+
completed: extractField(summaryContent, 'completed'),
|
|
106
|
+
next_steps: extractField(summaryContent, 'next_steps'),
|
|
107
|
+
notes: extractField(summaryContent, 'notes')
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Extract a simple field value from XML content
|
|
113
|
+
* Returns null for missing or empty/whitespace-only fields
|
|
114
|
+
*/
|
|
115
|
+
function extractField(content, fieldName) {
|
|
116
|
+
const regex = new RegExp(`<${fieldName}>([^<]*)</${fieldName}>`);
|
|
117
|
+
const match = regex.exec(content);
|
|
118
|
+
if (!match) return null;
|
|
119
|
+
|
|
120
|
+
const trimmed = match[1].trim();
|
|
121
|
+
return trimmed === '' ? null : trimmed;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Extract array of elements from XML content
|
|
126
|
+
*/
|
|
127
|
+
function extractArrayElements(content, arrayName, elementName) {
|
|
128
|
+
const elements = [];
|
|
129
|
+
|
|
130
|
+
// Match the array block
|
|
131
|
+
const arrayRegex = new RegExp(`<${arrayName}>(.*?)</${arrayName}>`, 's');
|
|
132
|
+
const arrayMatch = arrayRegex.exec(content);
|
|
133
|
+
|
|
134
|
+
if (!arrayMatch) {
|
|
135
|
+
return elements;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const arrayContent = arrayMatch[1];
|
|
139
|
+
|
|
140
|
+
// Extract individual elements
|
|
141
|
+
const elementRegex = new RegExp(`<${elementName}>([^<]+)</${elementName}>`, 'g');
|
|
142
|
+
let elementMatch;
|
|
143
|
+
while ((elementMatch = elementRegex.exec(arrayContent)) !== null) {
|
|
144
|
+
elements.push(elementMatch[1].trim());
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return elements;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ============================================================================
|
|
151
|
+
// Prompt Building Functions
|
|
152
|
+
// ============================================================================
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Build prompt to send tool observation to SDK agent
|
|
156
|
+
*
|
|
157
|
+
* @param {Observation} obs - The observation object containing tool data
|
|
158
|
+
* @returns {string} Formatted XML prompt string
|
|
159
|
+
*/
|
|
160
|
+
export function buildObservationPrompt(obs) {
|
|
161
|
+
// Safely parse tool_input and tool_output - they may be JSON strings
|
|
162
|
+
let toolInput;
|
|
163
|
+
let toolOutput;
|
|
164
|
+
|
|
165
|
+
try {
|
|
166
|
+
toolInput = typeof obs.tool_input === 'string' ? JSON.parse(obs.tool_input) : obs.tool_input;
|
|
167
|
+
} catch {
|
|
168
|
+
toolInput = obs.tool_input;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
try {
|
|
172
|
+
toolOutput = typeof obs.tool_output === 'string' ? JSON.parse(obs.tool_output) : obs.tool_output;
|
|
173
|
+
} catch {
|
|
174
|
+
toolOutput = obs.tool_output;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return `<observed_from_primary_session>
|
|
178
|
+
<what_happened>${obs.tool_name}</what_happened>
|
|
179
|
+
<occurred_at>${new Date(obs.created_at_epoch).toISOString()}</occurred_at>${obs.cwd ? `\n <working_directory>${obs.cwd}</working_directory>` : ''}
|
|
180
|
+
<parameters>${JSON.stringify(toolInput, null, 2)}</parameters>
|
|
181
|
+
<outcome>${JSON.stringify(toolOutput, null, 2)}</outcome>
|
|
182
|
+
</observed_from_primary_session>`;
|
|
183
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "Claude-Mem (Persistent Memory)",
|
|
4
4
|
"description": "Official OpenClaw plugin for Claude-Mem. Records observations from embedded runner sessions and streams them to messaging channels.",
|
|
5
5
|
"kind": "memory",
|
|
6
|
-
"version": "12.7.
|
|
6
|
+
"version": "12.7.3",
|
|
7
7
|
"author": "thedotmack",
|
|
8
8
|
"homepage": "https://claude-mem.com",
|
|
9
9
|
"skills": ["skills/make-plan", "skills/do"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-mem",
|
|
3
|
-
"version": "12.7.
|
|
3
|
+
"version": "12.7.3",
|
|
4
4
|
"description": "Memory compression system for Claude Code - persist context across sessions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"queue": "bun scripts/check-pending-queue.ts",
|
|
83
83
|
"queue:process": "bun scripts/check-pending-queue.ts --process",
|
|
84
84
|
"queue:clear": "bun scripts/clear-failed-queue.ts --all --force",
|
|
85
|
+
"pr:status": "bun scripts/pr-babysit-status.ts",
|
|
85
86
|
"claude-md:regenerate": "bun scripts/regenerate-claude-md.ts",
|
|
86
87
|
"claude-md:dry-run": "bun scripts/regenerate-claude-md.ts --dry-run",
|
|
87
88
|
"strip-comments": "bun scripts/strip-comments.ts",
|
package/plugin/.mcp.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"command": "sh",
|
|
6
6
|
"args": [
|
|
7
7
|
"-c",
|
|
8
|
-
"
|
|
8
|
+
"_C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/mcp-server.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: mcp server not found\" >&2; exit 1; }; exec node \"$_P/scripts/mcp-server.cjs\""
|
|
9
9
|
]
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
"hooks": [
|
|
8
8
|
{
|
|
9
9
|
"type": "command",
|
|
10
|
-
"command": "
|
|
10
|
+
"command": "_HP=$(printenv PATH 2>/dev/null || true); if [ -z \"$_HP\" ] && [ -n \"${SHELL:-}\" ]; then _HP=$(\"$SHELL\" -lc 'printf %s \"$PATH\"' 2>/dev/null || true); fi; _HP=$(printf '%s' \"$_HP\" | tr ' ' ':'); export PATH=\"${_HP:+$_HP:}$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/version-check.js\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: version-check.js not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; CLAUDE_MEM_CODEX_HOOK=1 node \"$_P/scripts/version-check.js\"",
|
|
11
11
|
"timeout": 5
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"type": "command",
|
|
15
|
-
"command": "
|
|
15
|
+
"command": "_HP=$(printenv PATH 2>/dev/null || true); if [ -z \"$_HP\" ] && [ -n \"${SHELL:-}\" ]; then _HP=$(\"$SHELL\" -lc 'printf %s \"$PATH\"' 2>/dev/null || true); fi; _HP=$(printf '%s' \"$_HP\" | tr ' ' ':'); export PATH=\"${_HP:+$_HP:}$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" start",
|
|
16
16
|
"timeout": 60
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"type": "command",
|
|
20
|
-
"command": "
|
|
20
|
+
"command": "_HP=$(printenv PATH 2>/dev/null || true); if [ -z \"$_HP\" ] && [ -n \"${SHELL:-}\" ]; then _HP=$(\"$SHELL\" -lc 'printf %s \"$PATH\"' 2>/dev/null || true); fi; _HP=$(printf '%s' \"$_HP\" | tr ' ' ':'); export PATH=\"${_HP:+$_HP:}$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook codex context",
|
|
21
21
|
"timeout": 60,
|
|
22
22
|
"statusMessage": "Loading claude-mem context"
|
|
23
23
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"hooks": [
|
|
30
30
|
{
|
|
31
31
|
"type": "command",
|
|
32
|
-
"command": "
|
|
32
|
+
"command": "_HP=$(printenv PATH 2>/dev/null || true); if [ -z \"$_HP\" ] && [ -n \"${SHELL:-}\" ]; then _HP=$(\"$SHELL\" -lc 'printf %s \"$PATH\"' 2>/dev/null || true); fi; _HP=$(printf '%s' \"$_HP\" | tr ' ' ':'); export PATH=\"${_HP:+$_HP:}$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook codex session-init",
|
|
33
33
|
"timeout": 60
|
|
34
34
|
}
|
|
35
35
|
]
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"hooks": [
|
|
42
42
|
{
|
|
43
43
|
"type": "command",
|
|
44
|
-
"command": "
|
|
44
|
+
"command": "_HP=$(printenv PATH 2>/dev/null || true); if [ -z \"$_HP\" ] && [ -n \"${SHELL:-}\" ]; then _HP=$(\"$SHELL\" -lc 'printf %s \"$PATH\"' 2>/dev/null || true); fi; _HP=$(printf '%s' \"$_HP\" | tr ' ' ':'); export PATH=\"${_HP:+$_HP:}$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook codex file-context",
|
|
45
45
|
"timeout": 30
|
|
46
46
|
}
|
|
47
47
|
]
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"hooks": [
|
|
54
54
|
{
|
|
55
55
|
"type": "command",
|
|
56
|
-
"command": "
|
|
56
|
+
"command": "_HP=$(printenv PATH 2>/dev/null || true); if [ -z \"$_HP\" ] && [ -n \"${SHELL:-}\" ]; then _HP=$(\"$SHELL\" -lc 'printf %s \"$PATH\"' 2>/dev/null || true); fi; _HP=$(printf '%s' \"$_HP\" | tr ' ' ':'); export PATH=\"${_HP:+$_HP:}$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook codex observation",
|
|
57
57
|
"timeout": 120
|
|
58
58
|
}
|
|
59
59
|
]
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"hooks": [
|
|
65
65
|
{
|
|
66
66
|
"type": "command",
|
|
67
|
-
"command": "
|
|
67
|
+
"command": "_HP=$(printenv PATH 2>/dev/null || true); if [ -z \"$_HP\" ] && [ -n \"${SHELL:-}\" ]; then _HP=$(\"$SHELL\" -lc 'printf %s \"$PATH\"' 2>/dev/null || true); fi; _HP=$(printf '%s' \"$_HP\" | tr ' ' ':'); export PATH=\"${_HP:+$_HP:}$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook codex summarize",
|
|
68
68
|
"timeout": 60
|
|
69
69
|
}
|
|
70
70
|
]
|
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\";
|
|
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\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/version-check.js\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: version-check.js not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/version-check.js\"",
|
|
12
12
|
"timeout": 300
|
|
13
13
|
}
|
|
14
14
|
]
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
{
|
|
22
22
|
"type": "command",
|
|
23
23
|
"shell": "bash",
|
|
24
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\";
|
|
24
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" start; echo '{\"continue\":true,\"suppressOutput\":true}'",
|
|
25
25
|
"timeout": 60
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"type": "command",
|
|
29
29
|
"shell": "bash",
|
|
30
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\";
|
|
30
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook claude-code context",
|
|
31
31
|
"timeout": 60
|
|
32
32
|
}
|
|
33
33
|
]
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
{
|
|
40
40
|
"type": "command",
|
|
41
41
|
"shell": "bash",
|
|
42
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\";
|
|
42
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook claude-code session-init",
|
|
43
43
|
"timeout": 60
|
|
44
44
|
}
|
|
45
45
|
]
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
{
|
|
53
53
|
"type": "command",
|
|
54
54
|
"shell": "bash",
|
|
55
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\";
|
|
55
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook claude-code observation",
|
|
56
56
|
"timeout": 120
|
|
57
57
|
}
|
|
58
58
|
]
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
{
|
|
66
66
|
"type": "command",
|
|
67
67
|
"shell": "bash",
|
|
68
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\";
|
|
68
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook claude-code file-context",
|
|
69
69
|
"timeout": 60
|
|
70
70
|
}
|
|
71
71
|
]
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
{
|
|
78
78
|
"type": "command",
|
|
79
79
|
"shell": "bash",
|
|
80
|
-
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\";
|
|
80
|
+
"command": "export PATH=\"$($SHELL -lc 'echo $PATH' 2>/dev/null):$PATH\"; _C=\"${CLAUDE_CONFIG_DIR:-$HOME/.claude}\"; _E=\"${CLAUDE_PLUGIN_ROOT:-${PLUGIN_ROOT:-}}\"; _P=$({ [ -n \"$_E\" ] && printf '%s\\n' \"$_E\"; ls -dt \"$_C/plugins/cache/thedotmack/claude-mem\"/[0-9]*/ 2>/dev/null; printf '%s\\n' \"$_C/plugins/marketplaces/thedotmack/plugin\"; } | while IFS= read -r _R; do _R=\"${_R%/}\"; [ -d \"$_R/plugin/scripts\" ] && _Q=\"$_R/plugin\" || _Q=\"$_R\"; [ -f \"$_Q/scripts/bun-runner.js\" ] && [ -f \"$_Q/scripts/worker-service.cjs\" ] && { printf '%s\\n' \"$_Q\"; break; }; done); [ -n \"$_P\" ] || { echo \"claude-mem: plugin scripts not found\" >&2; exit 1; }; command -v cygpath >/dev/null 2>&1 && { _W=$(cygpath -w \"$_P\" 2>/dev/null); [ -n \"$_W\" ] && _P=\"$_W\"; }; node \"$_P/scripts/bun-runner.js\" \"$_P/scripts/worker-service.cjs\" hook claude-code summarize",
|
|
81
81
|
"timeout": 120
|
|
82
82
|
}
|
|
83
83
|
]
|