oh-my-claude-sisyphus 2.5.0 → 2.6.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/dist/__tests__/hooks.test.js +255 -1
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +1 -1
- package/dist/__tests__/notepad.test.d.ts +2 -0
- package/dist/__tests__/notepad.test.d.ts.map +1 -0
- package/dist/__tests__/notepad.test.js +374 -0
- package/dist/__tests__/notepad.test.js.map +1 -0
- package/dist/__tests__/ralph-prd.test.d.ts +2 -0
- package/dist/__tests__/ralph-prd.test.d.ts.map +1 -0
- package/dist/__tests__/ralph-prd.test.js +308 -0
- package/dist/__tests__/ralph-prd.test.js.map +1 -0
- package/dist/__tests__/ralph-progress.test.d.ts +2 -0
- package/dist/__tests__/ralph-progress.test.d.ts.map +1 -0
- package/dist/__tests__/ralph-progress.test.js +312 -0
- package/dist/__tests__/ralph-progress.test.js.map +1 -0
- package/dist/__tests__/skills.test.js +5 -3
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/agents/definitions.d.ts +4 -0
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +147 -3
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/prometheus.js +2 -2
- package/dist/agents/prometheus.js.map +1 -1
- package/dist/cli/index.js +0 -0
- package/dist/features/builtin-skills/skills.d.ts.map +1 -1
- package/dist/features/builtin-skills/skills.js +61 -0
- package/dist/features/builtin-skills/skills.js.map +1 -1
- package/dist/features/magic-keywords.js +1 -1
- package/dist/hooks/index.d.ts +5 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +15 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/notepad/index.d.ts +114 -0
- package/dist/hooks/notepad/index.d.ts.map +1 -0
- package/dist/hooks/notepad/index.js +372 -0
- package/dist/hooks/notepad/index.js.map +1 -0
- package/dist/hooks/persistent-mode/index.d.ts +5 -0
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +71 -5
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/ralph-loop/index.d.ts +48 -0
- package/dist/hooks/ralph-loop/index.d.ts.map +1 -1
- package/dist/hooks/ralph-loop/index.js +127 -0
- package/dist/hooks/ralph-loop/index.js.map +1 -1
- package/dist/hooks/ralph-prd/index.d.ts +130 -0
- package/dist/hooks/ralph-prd/index.d.ts.map +1 -0
- package/dist/hooks/ralph-prd/index.js +310 -0
- package/dist/hooks/ralph-prd/index.js.map +1 -0
- package/dist/hooks/ralph-progress/index.d.ts +102 -0
- package/dist/hooks/ralph-progress/index.d.ts.map +1 -0
- package/dist/hooks/ralph-progress/index.js +408 -0
- package/dist/hooks/ralph-progress/index.js.map +1 -0
- package/dist/hooks/sisyphus-orchestrator/index.d.ts.map +1 -1
- package/dist/hooks/sisyphus-orchestrator/index.js +26 -0
- package/dist/hooks/sisyphus-orchestrator/index.js.map +1 -1
- package/dist/hooks/ultraqa-loop/index.d.ts +94 -0
- package/dist/hooks/ultraqa-loop/index.d.ts.map +1 -0
- package/dist/hooks/ultraqa-loop/index.js +216 -0
- package/dist/hooks/ultraqa-loop/index.js.map +1 -0
- package/dist/installer/hooks.d.ts +28 -0
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +262 -2
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +426 -12
- package/dist/installer/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/persistent-mode.mjs +167 -6
- package/scripts/post-tool-verifier.mjs +62 -1
- package/scripts/session-start.mjs +22 -0
- package/scripts/test-max-attempts.ts +94 -0
- package/scripts/test-mutual-exclusion.ts +152 -0
- package/scripts/test-notepad-integration.ts +495 -0
- package/scripts/test-remember-tags.ts +121 -0
- package/scripts/test-session-injection.ts +41 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UltraQA Loop Hook
|
|
3
|
+
*
|
|
4
|
+
* QA cycling workflow that runs test → oracle verify → fix → repeat
|
|
5
|
+
* until the QA goal is met or max cycles reached.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs';
|
|
8
|
+
import { join } from 'path';
|
|
9
|
+
import { readRalphState } from '../ralph-loop/index.js';
|
|
10
|
+
const DEFAULT_MAX_CYCLES = 5;
|
|
11
|
+
const SAME_FAILURE_THRESHOLD = 3;
|
|
12
|
+
/**
|
|
13
|
+
* Get the state file path for UltraQA
|
|
14
|
+
*/
|
|
15
|
+
function getStateFilePath(directory) {
|
|
16
|
+
const sisyphusDir = join(directory, '.sisyphus');
|
|
17
|
+
return join(sisyphusDir, 'ultraqa-state.json');
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Ensure the .sisyphus directory exists
|
|
21
|
+
*/
|
|
22
|
+
function ensureStateDir(directory) {
|
|
23
|
+
const sisyphusDir = join(directory, '.sisyphus');
|
|
24
|
+
if (!existsSync(sisyphusDir)) {
|
|
25
|
+
mkdirSync(sisyphusDir, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Read UltraQA state from disk
|
|
30
|
+
*/
|
|
31
|
+
export function readUltraQAState(directory) {
|
|
32
|
+
const stateFile = getStateFilePath(directory);
|
|
33
|
+
if (!existsSync(stateFile)) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const content = readFileSync(stateFile, 'utf-8');
|
|
38
|
+
return JSON.parse(content);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Write UltraQA state to disk
|
|
46
|
+
*/
|
|
47
|
+
export function writeUltraQAState(directory, state) {
|
|
48
|
+
try {
|
|
49
|
+
ensureStateDir(directory);
|
|
50
|
+
const stateFile = getStateFilePath(directory);
|
|
51
|
+
writeFileSync(stateFile, JSON.stringify(state, null, 2));
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Clear UltraQA state
|
|
60
|
+
*/
|
|
61
|
+
export function clearUltraQAState(directory) {
|
|
62
|
+
const stateFile = getStateFilePath(directory);
|
|
63
|
+
if (!existsSync(stateFile)) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
unlinkSync(stateFile);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check if Ralph Loop is active (mutual exclusion check)
|
|
76
|
+
*/
|
|
77
|
+
export function isRalphLoopActive(directory) {
|
|
78
|
+
const ralphState = readRalphState(directory);
|
|
79
|
+
return ralphState !== null && ralphState.active === true;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Start a new UltraQA cycle
|
|
83
|
+
* Returns false if Ralph Loop is already active (mutual exclusion)
|
|
84
|
+
*/
|
|
85
|
+
export function startUltraQA(directory, goalType, sessionId, options) {
|
|
86
|
+
// Mutual exclusion check: cannot start UltraQA if Ralph Loop is active
|
|
87
|
+
if (isRalphLoopActive(directory)) {
|
|
88
|
+
return {
|
|
89
|
+
success: false,
|
|
90
|
+
error: 'Cannot start UltraQA while Ralph Loop is active. Cancel Ralph Loop first with /cancel-ralph.'
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const state = {
|
|
94
|
+
active: true,
|
|
95
|
+
goal_type: goalType,
|
|
96
|
+
goal_pattern: options?.customPattern ?? null,
|
|
97
|
+
cycle: 1,
|
|
98
|
+
max_cycles: options?.maxCycles ?? DEFAULT_MAX_CYCLES,
|
|
99
|
+
failures: [],
|
|
100
|
+
started_at: new Date().toISOString(),
|
|
101
|
+
session_id: sessionId
|
|
102
|
+
};
|
|
103
|
+
const written = writeUltraQAState(directory, state);
|
|
104
|
+
return { success: written };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Record a failure and increment cycle
|
|
108
|
+
*/
|
|
109
|
+
export function recordFailure(directory, failureDescription) {
|
|
110
|
+
const state = readUltraQAState(directory);
|
|
111
|
+
if (!state || !state.active) {
|
|
112
|
+
return { state: null, shouldExit: true, reason: 'not_active' };
|
|
113
|
+
}
|
|
114
|
+
// Add failure to array
|
|
115
|
+
state.failures.push(failureDescription);
|
|
116
|
+
// Check for repeated same failure
|
|
117
|
+
const recentFailures = state.failures.slice(-SAME_FAILURE_THRESHOLD);
|
|
118
|
+
if (recentFailures.length >= SAME_FAILURE_THRESHOLD) {
|
|
119
|
+
const allSame = recentFailures.every(f => normalizeFailure(f) === normalizeFailure(recentFailures[0]));
|
|
120
|
+
if (allSame) {
|
|
121
|
+
return {
|
|
122
|
+
state,
|
|
123
|
+
shouldExit: true,
|
|
124
|
+
reason: `Same failure detected ${SAME_FAILURE_THRESHOLD} times: ${recentFailures[0]}`
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// Increment cycle
|
|
129
|
+
state.cycle += 1;
|
|
130
|
+
// Check max cycles
|
|
131
|
+
if (state.cycle > state.max_cycles) {
|
|
132
|
+
return {
|
|
133
|
+
state,
|
|
134
|
+
shouldExit: true,
|
|
135
|
+
reason: `Max cycles (${state.max_cycles}) reached`
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
writeUltraQAState(directory, state);
|
|
139
|
+
return { state, shouldExit: false };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Mark UltraQA as successful
|
|
143
|
+
*/
|
|
144
|
+
export function completeUltraQA(directory) {
|
|
145
|
+
const state = readUltraQAState(directory);
|
|
146
|
+
if (!state) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
const result = {
|
|
150
|
+
success: true,
|
|
151
|
+
cycles: state.cycle,
|
|
152
|
+
reason: 'goal_met'
|
|
153
|
+
};
|
|
154
|
+
clearUltraQAState(directory);
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Stop UltraQA with failure
|
|
159
|
+
*/
|
|
160
|
+
export function stopUltraQA(directory, reason, diagnosis) {
|
|
161
|
+
const state = readUltraQAState(directory);
|
|
162
|
+
if (!state) {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
const result = {
|
|
166
|
+
success: false,
|
|
167
|
+
cycles: state.cycle,
|
|
168
|
+
reason,
|
|
169
|
+
diagnosis
|
|
170
|
+
};
|
|
171
|
+
clearUltraQAState(directory);
|
|
172
|
+
return result;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Cancel UltraQA
|
|
176
|
+
*/
|
|
177
|
+
export function cancelUltraQA(directory) {
|
|
178
|
+
return clearUltraQAState(directory);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Normalize failure description for comparison
|
|
182
|
+
*/
|
|
183
|
+
function normalizeFailure(failure) {
|
|
184
|
+
// Remove timestamps, line numbers, and other variable parts
|
|
185
|
+
return failure
|
|
186
|
+
.replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/g, '') // ISO timestamps
|
|
187
|
+
.replace(/:\d+:\d+/g, '') // line:col numbers
|
|
188
|
+
.replace(/\d+ms/g, '') // timing
|
|
189
|
+
.replace(/\s+/g, ' ')
|
|
190
|
+
.trim()
|
|
191
|
+
.toLowerCase();
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Get goal command based on goal type
|
|
195
|
+
*/
|
|
196
|
+
export function getGoalCommand(goalType) {
|
|
197
|
+
switch (goalType) {
|
|
198
|
+
case 'tests':
|
|
199
|
+
return 'npm test';
|
|
200
|
+
case 'build':
|
|
201
|
+
return 'npm run build';
|
|
202
|
+
case 'lint':
|
|
203
|
+
return 'npm run lint';
|
|
204
|
+
case 'typecheck':
|
|
205
|
+
return 'npm run typecheck || tsc --noEmit';
|
|
206
|
+
case 'custom':
|
|
207
|
+
return '# Custom command based on goal pattern';
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Format progress message
|
|
212
|
+
*/
|
|
213
|
+
export function formatProgressMessage(cycle, maxCycles, status) {
|
|
214
|
+
return `[ULTRAQA Cycle ${cycle}/${maxCycles}] ${status}`;
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/ultraqa-loop/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAyCxD,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAEjC;;GAEG;AACH,SAAS,gBAAgB,CAAC,SAAiB;IACzC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACjD,OAAO,IAAI,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACjD,IA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AC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAa,EACb,SAAiB,EACjB,MAAc;IAEd,OAAO,kBAAkB,KAAK,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -94,6 +94,16 @@ export declare const PERSISTENT_MODE_SCRIPT_NODE = "#!/usr/bin/env node\n// Sisy
|
|
|
94
94
|
* Node.js Session Start Hook Script
|
|
95
95
|
*/
|
|
96
96
|
export declare const SESSION_START_SCRIPT_NODE = "#!/usr/bin/env node\n// Sisyphus Session Start Hook (Node.js)\n// Restores persistent mode states when session starts\n// Cross-platform: Windows, macOS, Linux\n\nimport { existsSync, readFileSync, readdirSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\n\nasync function readStdin() {\n const chunks = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk);\n }\n return Buffer.concat(chunks).toString('utf-8');\n}\n\nfunction readJsonFile(path) {\n try {\n if (!existsSync(path)) return null;\n return JSON.parse(readFileSync(path, 'utf-8'));\n } catch {\n return null;\n }\n}\n\nfunction countIncompleteTodos(todosDir) {\n let count = 0;\n if (existsSync(todosDir)) {\n try {\n const files = readdirSync(todosDir).filter(f => f.endsWith('.json'));\n for (const file of files) {\n const todos = readJsonFile(join(todosDir, file));\n if (Array.isArray(todos)) {\n count += todos.filter(t => t.status !== 'completed' && t.status !== 'cancelled').length;\n }\n }\n } catch {}\n }\n return count;\n}\n\nasync function main() {\n try {\n const input = await readStdin();\n let data = {};\n try { data = JSON.parse(input); } catch {}\n\n const directory = data.directory || process.cwd();\n const messages = [];\n\n // Check for ultrawork state\n const ultraworkState = readJsonFile(join(directory, '.sisyphus', 'ultrawork-state.json'))\n || readJsonFile(join(homedir(), '.claude', 'ultrawork-state.json'));\n\n if (ultraworkState?.active) {\n messages.push(`<session-restore>\n\n[ULTRAWORK MODE RESTORED]\n\nYou have an active ultrawork session from ${ultraworkState.started_at}.\nOriginal task: ${ultraworkState.original_prompt}\n\nContinue working in ultrawork mode until all tasks are complete.\n\n</session-restore>\n\n---\n`);\n }\n\n // Check for incomplete todos\n const todosDir = join(homedir(), '.claude', 'todos');\n const incompleteCount = countIncompleteTodos(todosDir);\n\n if (incompleteCount > 0) {\n messages.push(`<session-restore>\n\n[PENDING TASKS DETECTED]\n\nYou have ${incompleteCount} incomplete tasks from a previous session.\nPlease continue working on these tasks.\n\n</session-restore>\n\n---\n`);\n }\n\n if (messages.length > 0) {\n console.log(JSON.stringify({ continue: true, message: messages.join('\\n') }));\n } else {\n console.log(JSON.stringify({ continue: true }));\n }\n } catch (error) {\n console.log(JSON.stringify({ continue: true }));\n }\n}\n\nmain();\n";
|
|
97
|
+
/**
|
|
98
|
+
* Post-Tool-Use Bash script
|
|
99
|
+
* Processes <remember> tags from Task agent output and saves to notepad.md
|
|
100
|
+
*/
|
|
101
|
+
export declare const POST_TOOL_USE_SCRIPT = "#!/bin/bash\n# Sisyphus Post-Tool-Use Hook\n# Processes <remember> tags from Task agent output\n# Saves to .sisyphus/notepad.md for compaction-resilient memory\n\n# Read stdin\nINPUT=$(cat)\n\n# Get directory and tool info\nDIRECTORY=\"\"\nTOOL_NAME=\"\"\nTOOL_OUTPUT=\"\"\nif command -v jq &> /dev/null; then\n DIRECTORY=$(echo \"$INPUT\" | jq -r '.directory // \"\"' 2>/dev/null)\n TOOL_NAME=$(echo \"$INPUT\" | jq -r '.toolName // \"\"' 2>/dev/null)\n TOOL_OUTPUT=$(echo \"$INPUT\" | jq -r '.toolOutput // \"\"' 2>/dev/null)\nelse\n # Fallback: use grep/sed for extraction\n DIRECTORY=$(echo \"$INPUT\" | grep -oP '\"directory\"\\s*:\\s*\"\\K[^\"]+' | head -1)\n TOOL_NAME=$(echo \"$INPUT\" | grep -oP '\"toolName\"\\s*:\\s*\"\\K[^\"]+' | head -1)\n TOOL_OUTPUT=$(echo \"$INPUT\" | grep -oP '\"toolOutput\"\\s*:\\s*\"\\K[^\"]+' | head -1)\nfi\n\nif [ -z \"$DIRECTORY\" ]; then\n DIRECTORY=$(pwd)\nfi\n\n# Only process Task tool output\nif [ \"$TOOL_NAME\" != \"Task\" ] && [ \"$TOOL_NAME\" != \"task\" ]; then\n echo '{\"continue\": true}'\n exit 0\nfi\n\n# Check for <remember> tags\nif ! echo \"$TOOL_OUTPUT\" | grep -q '<remember'; then\n echo '{\"continue\": true}'\n exit 0\nfi\n\n# Create .sisyphus directory if needed\nSISYPHUS_DIR=\"$DIRECTORY/.sisyphus\"\nNOTEPAD_FILE=\"$SISYPHUS_DIR/notepad.md\"\nmkdir -p \"$SISYPHUS_DIR\" 2>/dev/null\n\n# Initialize notepad.md if it doesn't exist\nif [ ! -f \"$NOTEPAD_FILE\" ]; then\n cat > \"$NOTEPAD_FILE\" << 'NOTEPAD_INIT'\n# Notepad\n<!-- Auto-managed by Sisyphus. Manual edits preserved in MANUAL section. -->\n\n## Priority Context\n<!-- ALWAYS loaded. Keep under 500 chars. Critical discoveries only. -->\n\n## Working Memory\n<!-- Session notes. Auto-pruned after 7 days. -->\n\n## MANUAL\n<!-- User content. Never auto-pruned. -->\nNOTEPAD_INIT\nfi\n\n# Process priority remember tags\nPRIORITY_CONTENT=$(echo \"$TOOL_OUTPUT\" | grep -oP '<remember\\s+priority>\\K[\\s\\S]*?(?=</remember>)' | head -1)\nif [ -n \"$PRIORITY_CONTENT\" ]; then\n # Read current notepad\n NOTEPAD_CONTENT=$(cat \"$NOTEPAD_FILE\")\n # Replace Priority Context section\n NEW_NOTEPAD=$(echo \"$NOTEPAD_CONTENT\" | sed '/## Priority Context/,/## Working Memory/{\n /## Priority Context/!{/## Working Memory/!d}\n }' | sed \"/## Priority Context/a\\\\<!-- ALWAYS loaded. Keep under 500 chars. Critical discoveries only. -->\\n$PRIORITY_CONTENT\")\n echo \"$NEW_NOTEPAD\" > \"$NOTEPAD_FILE\"\nfi\n\n# Process regular remember tags\nwhile IFS= read -r CONTENT; do\n if [ -n \"$CONTENT\" ]; then\n TIMESTAMP=$(date '+%Y-%m-%d %H:%M')\n # Append to Working Memory section (before MANUAL)\n sed -i \"/## MANUAL/i\\\\### $TIMESTAMP\\n$CONTENT\\n\" \"$NOTEPAD_FILE\" 2>/dev/null || {\n # macOS sed fallback\n sed -i '' \"/## MANUAL/i\\\\\n### $TIMESTAMP\\\n$CONTENT\\\n\" \"$NOTEPAD_FILE\"\n }\n fi\ndone < <(echo \"$TOOL_OUTPUT\" | grep -oP '<remember>\\K[\\s\\S]*?(?=</remember>)')\n\necho '{\"continue\": true}'\nexit 0\n";
|
|
102
|
+
/**
|
|
103
|
+
* Post-Tool-Use Node.js script
|
|
104
|
+
* Processes <remember> tags from Task agent output
|
|
105
|
+
*/
|
|
106
|
+
export declare const POST_TOOL_USE_SCRIPT_NODE = "#!/usr/bin/env node\n// Sisyphus Post-Tool-Use Hook (Node.js)\n// Processes <remember> tags from Task agent output\n// Saves to .sisyphus/notepad.md for compaction-resilient memory\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';\nimport { join } from 'path';\n\n// Constants\nconst NOTEPAD_TEMPLATE = '# Notepad\\n' +\n '<!-- Auto-managed by Sisyphus. Manual edits preserved in MANUAL section. -->\\n\\n' +\n '## Priority Context\\n' +\n '<!-- ALWAYS loaded. Keep under 500 chars. Critical discoveries only. -->\\n\\n' +\n '## Working Memory\\n' +\n '<!-- Session notes. Auto-pruned after 7 days. -->\\n\\n' +\n '## MANUAL\\n' +\n '<!-- User content. Never auto-pruned. -->\\n';\n\n// Read all stdin\nasync function readStdin() {\n const chunks = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk);\n }\n return Buffer.concat(chunks).toString('utf-8');\n}\n\n// Initialize notepad.md if needed\nfunction initNotepad(directory) {\n const sisyphusDir = join(directory, '.sisyphus');\n const notepadPath = join(sisyphusDir, 'notepad.md');\n\n if (!existsSync(sisyphusDir)) {\n try { mkdirSync(sisyphusDir, { recursive: true }); } catch {}\n }\n\n if (!existsSync(notepadPath)) {\n try { writeFileSync(notepadPath, NOTEPAD_TEMPLATE); } catch {}\n }\n\n return notepadPath;\n}\n\n// Set priority context\nfunction setPriorityContext(notepadPath, content) {\n try {\n let notepad = readFileSync(notepadPath, 'utf-8');\n\n // Find and replace Priority Context section\n const priorityMatch = notepad.match(/## Priority Context[\\s\\S]*?(?=## Working Memory)/);\n if (priorityMatch) {\n const newPriority = '## Priority Context\\n' +\n '<!-- ALWAYS loaded. Keep under 500 chars. Critical discoveries only. -->\\n' +\n content.trim() + '\\n\\n';\n notepad = notepad.replace(priorityMatch[0], newPriority);\n writeFileSync(notepadPath, notepad);\n }\n } catch {}\n}\n\n// Add working memory entry\nfunction addWorkingMemoryEntry(notepadPath, content) {\n try {\n let notepad = readFileSync(notepadPath, 'utf-8');\n\n const timestamp = new Date().toISOString().slice(0, 16).replace('T', ' ');\n const entry = '### ' + timestamp + '\\n' + content.trim() + '\\n\\n';\n\n // Insert before MANUAL section\n const manualIndex = notepad.indexOf('## MANUAL');\n if (manualIndex !== -1) {\n notepad = notepad.slice(0, manualIndex) + entry + notepad.slice(manualIndex);\n writeFileSync(notepadPath, notepad);\n }\n } catch {}\n}\n\n// Process remember tags\nfunction processRememberTags(output, notepadPath) {\n if (!output) return;\n\n // Process priority remember tags\n const priorityRegex = /<remember\\s+priority>([\\s\\S]*?)<\\/remember>/gi;\n let match;\n while ((match = priorityRegex.exec(output)) !== null) {\n const content = match[1].trim();\n if (content) {\n setPriorityContext(notepadPath, content);\n }\n }\n\n // Process regular remember tags\n const regularRegex = /<remember>([\\s\\S]*?)<\\/remember>/gi;\n while ((match = regularRegex.exec(output)) !== null) {\n const content = match[1].trim();\n if (content) {\n addWorkingMemoryEntry(notepadPath, content);\n }\n }\n}\n\nasync function main() {\n try {\n const input = await readStdin();\n const data = JSON.parse(input);\n\n const toolName = data.toolName || '';\n const toolOutput = data.toolOutput || '';\n const directory = data.directory || process.cwd();\n\n // Only process Task tool output\n if (toolName !== 'Task' && toolName !== 'task') {\n console.log(JSON.stringify({ continue: true }));\n return;\n }\n\n // Check for remember tags\n if (!toolOutput.includes('<remember')) {\n console.log(JSON.stringify({ continue: true }));\n return;\n }\n\n // Initialize notepad and process tags\n const notepadPath = initNotepad(directory);\n processRememberTags(toolOutput, notepadPath);\n\n console.log(JSON.stringify({ continue: true }));\n } catch (error) {\n console.log(JSON.stringify({ continue: true }));\n }\n}\n\nmain();\n";
|
|
97
107
|
/**
|
|
98
108
|
* Settings.json hooks configuration for Bash (Unix)
|
|
99
109
|
* Configures Claude Code to run our bash hook scripts
|
|
@@ -112,6 +122,12 @@ export declare const HOOKS_SETTINGS_CONFIG_BASH: {
|
|
|
112
122
|
command: string;
|
|
113
123
|
}[];
|
|
114
124
|
}[];
|
|
125
|
+
PostToolUse: {
|
|
126
|
+
hooks: {
|
|
127
|
+
type: "command";
|
|
128
|
+
command: string;
|
|
129
|
+
}[];
|
|
130
|
+
}[];
|
|
115
131
|
Stop: {
|
|
116
132
|
hooks: {
|
|
117
133
|
type: "command";
|
|
@@ -138,6 +154,12 @@ export declare const HOOKS_SETTINGS_CONFIG_NODE: {
|
|
|
138
154
|
command: string;
|
|
139
155
|
}[];
|
|
140
156
|
}[];
|
|
157
|
+
PostToolUse: {
|
|
158
|
+
hooks: {
|
|
159
|
+
type: "command";
|
|
160
|
+
command: string;
|
|
161
|
+
}[];
|
|
162
|
+
}[];
|
|
141
163
|
Stop: {
|
|
142
164
|
hooks: {
|
|
143
165
|
type: "command";
|
|
@@ -168,6 +190,12 @@ export declare const HOOKS_SETTINGS_CONFIG: {
|
|
|
168
190
|
command: string;
|
|
169
191
|
}[];
|
|
170
192
|
}[];
|
|
193
|
+
PostToolUse: {
|
|
194
|
+
hooks: {
|
|
195
|
+
type: "command";
|
|
196
|
+
command: string;
|
|
197
|
+
}[];
|
|
198
|
+
}[];
|
|
171
199
|
Stop: {
|
|
172
200
|
hooks: {
|
|
173
201
|
type: "command";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/installer/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,iDAAiD;AACjD,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,kCAAkC;AAClC,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,IAAI,OAAO,CAU5C;AAED,4DAA4D;AAC5D,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,mCAAmC;AACnC,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,woJA2F7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,wcAgB9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,2TAU1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,8cAgB3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,+PAME,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,khMAsGnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,u7CAwCpC,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,+lNAsMxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,svEAgFzC,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,yqSA4KlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,g0EA8DhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,4oOA+OvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,0iFAoGrC,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/installer/hooks.ts"],"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;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDtC,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,0BAA0B,CAE1E;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA6B,CAAC;AAMhE;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMpD,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvD;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAqB,CAAC"}
|
package/dist/installer/hooks.js
CHANGED
|
@@ -1250,6 +1250,242 @@ Please continue working on these tasks.
|
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
1252
|
|
|
1253
|
+
main();
|
|
1254
|
+
`;
|
|
1255
|
+
// =============================================================================
|
|
1256
|
+
// POST-TOOL-USE HOOK (Remember Tag Processing)
|
|
1257
|
+
// =============================================================================
|
|
1258
|
+
/**
|
|
1259
|
+
* Post-Tool-Use Bash script
|
|
1260
|
+
* Processes <remember> tags from Task agent output and saves to notepad.md
|
|
1261
|
+
*/
|
|
1262
|
+
export const POST_TOOL_USE_SCRIPT = `#!/bin/bash
|
|
1263
|
+
# Sisyphus Post-Tool-Use Hook
|
|
1264
|
+
# Processes <remember> tags from Task agent output
|
|
1265
|
+
# Saves to .sisyphus/notepad.md for compaction-resilient memory
|
|
1266
|
+
|
|
1267
|
+
# Read stdin
|
|
1268
|
+
INPUT=$(cat)
|
|
1269
|
+
|
|
1270
|
+
# Get directory and tool info
|
|
1271
|
+
DIRECTORY=""
|
|
1272
|
+
TOOL_NAME=""
|
|
1273
|
+
TOOL_OUTPUT=""
|
|
1274
|
+
if command -v jq &> /dev/null; then
|
|
1275
|
+
DIRECTORY=$(echo "$INPUT" | jq -r '.directory // ""' 2>/dev/null)
|
|
1276
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.toolName // ""' 2>/dev/null)
|
|
1277
|
+
TOOL_OUTPUT=$(echo "$INPUT" | jq -r '.toolOutput // ""' 2>/dev/null)
|
|
1278
|
+
else
|
|
1279
|
+
# Fallback: use grep/sed for extraction
|
|
1280
|
+
DIRECTORY=$(echo "$INPUT" | grep -oP '"directory"\\s*:\\s*"\\K[^"]+' | head -1)
|
|
1281
|
+
TOOL_NAME=$(echo "$INPUT" | grep -oP '"toolName"\\s*:\\s*"\\K[^"]+' | head -1)
|
|
1282
|
+
TOOL_OUTPUT=$(echo "$INPUT" | grep -oP '"toolOutput"\\s*:\\s*"\\K[^"]+' | head -1)
|
|
1283
|
+
fi
|
|
1284
|
+
|
|
1285
|
+
if [ -z "$DIRECTORY" ]; then
|
|
1286
|
+
DIRECTORY=$(pwd)
|
|
1287
|
+
fi
|
|
1288
|
+
|
|
1289
|
+
# Only process Task tool output
|
|
1290
|
+
if [ "$TOOL_NAME" != "Task" ] && [ "$TOOL_NAME" != "task" ]; then
|
|
1291
|
+
echo '{"continue": true}'
|
|
1292
|
+
exit 0
|
|
1293
|
+
fi
|
|
1294
|
+
|
|
1295
|
+
# Check for <remember> tags
|
|
1296
|
+
if ! echo "$TOOL_OUTPUT" | grep -q '<remember'; then
|
|
1297
|
+
echo '{"continue": true}'
|
|
1298
|
+
exit 0
|
|
1299
|
+
fi
|
|
1300
|
+
|
|
1301
|
+
# Create .sisyphus directory if needed
|
|
1302
|
+
SISYPHUS_DIR="$DIRECTORY/.sisyphus"
|
|
1303
|
+
NOTEPAD_FILE="$SISYPHUS_DIR/notepad.md"
|
|
1304
|
+
mkdir -p "$SISYPHUS_DIR" 2>/dev/null
|
|
1305
|
+
|
|
1306
|
+
# Initialize notepad.md if it doesn't exist
|
|
1307
|
+
if [ ! -f "$NOTEPAD_FILE" ]; then
|
|
1308
|
+
cat > "$NOTEPAD_FILE" << 'NOTEPAD_INIT'
|
|
1309
|
+
# Notepad
|
|
1310
|
+
<!-- Auto-managed by Sisyphus. Manual edits preserved in MANUAL section. -->
|
|
1311
|
+
|
|
1312
|
+
## Priority Context
|
|
1313
|
+
<!-- ALWAYS loaded. Keep under 500 chars. Critical discoveries only. -->
|
|
1314
|
+
|
|
1315
|
+
## Working Memory
|
|
1316
|
+
<!-- Session notes. Auto-pruned after 7 days. -->
|
|
1317
|
+
|
|
1318
|
+
## MANUAL
|
|
1319
|
+
<!-- User content. Never auto-pruned. -->
|
|
1320
|
+
NOTEPAD_INIT
|
|
1321
|
+
fi
|
|
1322
|
+
|
|
1323
|
+
# Process priority remember tags
|
|
1324
|
+
PRIORITY_CONTENT=$(echo "$TOOL_OUTPUT" | grep -oP '<remember\\s+priority>\\K[\\s\\S]*?(?=</remember>)' | head -1)
|
|
1325
|
+
if [ -n "$PRIORITY_CONTENT" ]; then
|
|
1326
|
+
# Read current notepad
|
|
1327
|
+
NOTEPAD_CONTENT=$(cat "$NOTEPAD_FILE")
|
|
1328
|
+
# Replace Priority Context section
|
|
1329
|
+
NEW_NOTEPAD=$(echo "$NOTEPAD_CONTENT" | sed '/## Priority Context/,/## Working Memory/{
|
|
1330
|
+
/## Priority Context/!{/## Working Memory/!d}
|
|
1331
|
+
}' | sed "/## Priority Context/a\\\\<!-- ALWAYS loaded. Keep under 500 chars. Critical discoveries only. -->\\n$PRIORITY_CONTENT")
|
|
1332
|
+
echo "$NEW_NOTEPAD" > "$NOTEPAD_FILE"
|
|
1333
|
+
fi
|
|
1334
|
+
|
|
1335
|
+
# Process regular remember tags
|
|
1336
|
+
while IFS= read -r CONTENT; do
|
|
1337
|
+
if [ -n "$CONTENT" ]; then
|
|
1338
|
+
TIMESTAMP=$(date '+%Y-%m-%d %H:%M')
|
|
1339
|
+
# Append to Working Memory section (before MANUAL)
|
|
1340
|
+
sed -i "/## MANUAL/i\\\\### $TIMESTAMP\\n$CONTENT\\n" "$NOTEPAD_FILE" 2>/dev/null || {
|
|
1341
|
+
# macOS sed fallback
|
|
1342
|
+
sed -i '' "/## MANUAL/i\\\\
|
|
1343
|
+
### $TIMESTAMP\\
|
|
1344
|
+
$CONTENT\\
|
|
1345
|
+
" "$NOTEPAD_FILE"
|
|
1346
|
+
}
|
|
1347
|
+
fi
|
|
1348
|
+
done < <(echo "$TOOL_OUTPUT" | grep -oP '<remember>\\K[\\s\\S]*?(?=</remember>)')
|
|
1349
|
+
|
|
1350
|
+
echo '{"continue": true}'
|
|
1351
|
+
exit 0
|
|
1352
|
+
`;
|
|
1353
|
+
/**
|
|
1354
|
+
* Post-Tool-Use Node.js script
|
|
1355
|
+
* Processes <remember> tags from Task agent output
|
|
1356
|
+
*/
|
|
1357
|
+
export const POST_TOOL_USE_SCRIPT_NODE = `#!/usr/bin/env node
|
|
1358
|
+
// Sisyphus Post-Tool-Use Hook (Node.js)
|
|
1359
|
+
// Processes <remember> tags from Task agent output
|
|
1360
|
+
// Saves to .sisyphus/notepad.md for compaction-resilient memory
|
|
1361
|
+
|
|
1362
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
1363
|
+
import { join } from 'path';
|
|
1364
|
+
|
|
1365
|
+
// Constants
|
|
1366
|
+
const NOTEPAD_TEMPLATE = '# Notepad\\n' +
|
|
1367
|
+
'<!-- Auto-managed by Sisyphus. Manual edits preserved in MANUAL section. -->\\n\\n' +
|
|
1368
|
+
'## Priority Context\\n' +
|
|
1369
|
+
'<!-- ALWAYS loaded. Keep under 500 chars. Critical discoveries only. -->\\n\\n' +
|
|
1370
|
+
'## Working Memory\\n' +
|
|
1371
|
+
'<!-- Session notes. Auto-pruned after 7 days. -->\\n\\n' +
|
|
1372
|
+
'## MANUAL\\n' +
|
|
1373
|
+
'<!-- User content. Never auto-pruned. -->\\n';
|
|
1374
|
+
|
|
1375
|
+
// Read all stdin
|
|
1376
|
+
async function readStdin() {
|
|
1377
|
+
const chunks = [];
|
|
1378
|
+
for await (const chunk of process.stdin) {
|
|
1379
|
+
chunks.push(chunk);
|
|
1380
|
+
}
|
|
1381
|
+
return Buffer.concat(chunks).toString('utf-8');
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
// Initialize notepad.md if needed
|
|
1385
|
+
function initNotepad(directory) {
|
|
1386
|
+
const sisyphusDir = join(directory, '.sisyphus');
|
|
1387
|
+
const notepadPath = join(sisyphusDir, 'notepad.md');
|
|
1388
|
+
|
|
1389
|
+
if (!existsSync(sisyphusDir)) {
|
|
1390
|
+
try { mkdirSync(sisyphusDir, { recursive: true }); } catch {}
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
if (!existsSync(notepadPath)) {
|
|
1394
|
+
try { writeFileSync(notepadPath, NOTEPAD_TEMPLATE); } catch {}
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
return notepadPath;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
// Set priority context
|
|
1401
|
+
function setPriorityContext(notepadPath, content) {
|
|
1402
|
+
try {
|
|
1403
|
+
let notepad = readFileSync(notepadPath, 'utf-8');
|
|
1404
|
+
|
|
1405
|
+
// Find and replace Priority Context section
|
|
1406
|
+
const priorityMatch = notepad.match(/## Priority Context[\\s\\S]*?(?=## Working Memory)/);
|
|
1407
|
+
if (priorityMatch) {
|
|
1408
|
+
const newPriority = '## Priority Context\\n' +
|
|
1409
|
+
'<!-- ALWAYS loaded. Keep under 500 chars. Critical discoveries only. -->\\n' +
|
|
1410
|
+
content.trim() + '\\n\\n';
|
|
1411
|
+
notepad = notepad.replace(priorityMatch[0], newPriority);
|
|
1412
|
+
writeFileSync(notepadPath, notepad);
|
|
1413
|
+
}
|
|
1414
|
+
} catch {}
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
// Add working memory entry
|
|
1418
|
+
function addWorkingMemoryEntry(notepadPath, content) {
|
|
1419
|
+
try {
|
|
1420
|
+
let notepad = readFileSync(notepadPath, 'utf-8');
|
|
1421
|
+
|
|
1422
|
+
const timestamp = new Date().toISOString().slice(0, 16).replace('T', ' ');
|
|
1423
|
+
const entry = '### ' + timestamp + '\\n' + content.trim() + '\\n\\n';
|
|
1424
|
+
|
|
1425
|
+
// Insert before MANUAL section
|
|
1426
|
+
const manualIndex = notepad.indexOf('## MANUAL');
|
|
1427
|
+
if (manualIndex !== -1) {
|
|
1428
|
+
notepad = notepad.slice(0, manualIndex) + entry + notepad.slice(manualIndex);
|
|
1429
|
+
writeFileSync(notepadPath, notepad);
|
|
1430
|
+
}
|
|
1431
|
+
} catch {}
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
// Process remember tags
|
|
1435
|
+
function processRememberTags(output, notepadPath) {
|
|
1436
|
+
if (!output) return;
|
|
1437
|
+
|
|
1438
|
+
// Process priority remember tags
|
|
1439
|
+
const priorityRegex = /<remember\\s+priority>([\\s\\S]*?)<\\/remember>/gi;
|
|
1440
|
+
let match;
|
|
1441
|
+
while ((match = priorityRegex.exec(output)) !== null) {
|
|
1442
|
+
const content = match[1].trim();
|
|
1443
|
+
if (content) {
|
|
1444
|
+
setPriorityContext(notepadPath, content);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
// Process regular remember tags
|
|
1449
|
+
const regularRegex = /<remember>([\\s\\S]*?)<\\/remember>/gi;
|
|
1450
|
+
while ((match = regularRegex.exec(output)) !== null) {
|
|
1451
|
+
const content = match[1].trim();
|
|
1452
|
+
if (content) {
|
|
1453
|
+
addWorkingMemoryEntry(notepadPath, content);
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
async function main() {
|
|
1459
|
+
try {
|
|
1460
|
+
const input = await readStdin();
|
|
1461
|
+
const data = JSON.parse(input);
|
|
1462
|
+
|
|
1463
|
+
const toolName = data.toolName || '';
|
|
1464
|
+
const toolOutput = data.toolOutput || '';
|
|
1465
|
+
const directory = data.directory || process.cwd();
|
|
1466
|
+
|
|
1467
|
+
// Only process Task tool output
|
|
1468
|
+
if (toolName !== 'Task' && toolName !== 'task') {
|
|
1469
|
+
console.log(JSON.stringify({ continue: true }));
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
// Check for remember tags
|
|
1474
|
+
if (!toolOutput.includes('<remember')) {
|
|
1475
|
+
console.log(JSON.stringify({ continue: true }));
|
|
1476
|
+
return;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
// Initialize notepad and process tags
|
|
1480
|
+
const notepadPath = initNotepad(directory);
|
|
1481
|
+
processRememberTags(toolOutput, notepadPath);
|
|
1482
|
+
|
|
1483
|
+
console.log(JSON.stringify({ continue: true }));
|
|
1484
|
+
} catch (error) {
|
|
1485
|
+
console.log(JSON.stringify({ continue: true }));
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1253
1489
|
main();
|
|
1254
1490
|
`;
|
|
1255
1491
|
// =============================================================================
|
|
@@ -1281,6 +1517,16 @@ export const HOOKS_SETTINGS_CONFIG_BASH = {
|
|
|
1281
1517
|
]
|
|
1282
1518
|
}
|
|
1283
1519
|
],
|
|
1520
|
+
PostToolUse: [
|
|
1521
|
+
{
|
|
1522
|
+
hooks: [
|
|
1523
|
+
{
|
|
1524
|
+
type: "command",
|
|
1525
|
+
command: "bash $HOME/.claude/hooks/post-tool-use.sh"
|
|
1526
|
+
}
|
|
1527
|
+
]
|
|
1528
|
+
}
|
|
1529
|
+
],
|
|
1284
1530
|
Stop: [
|
|
1285
1531
|
{
|
|
1286
1532
|
hooks: [
|
|
@@ -1325,6 +1571,18 @@ export const HOOKS_SETTINGS_CONFIG_NODE = {
|
|
|
1325
1571
|
]
|
|
1326
1572
|
}
|
|
1327
1573
|
],
|
|
1574
|
+
PostToolUse: [
|
|
1575
|
+
{
|
|
1576
|
+
hooks: [
|
|
1577
|
+
{
|
|
1578
|
+
type: "command",
|
|
1579
|
+
command: isWindows()
|
|
1580
|
+
? 'node "%USERPROFILE%\\.claude\\hooks\\post-tool-use.mjs"'
|
|
1581
|
+
: 'node "$HOME/.claude/hooks/post-tool-use.mjs"'
|
|
1582
|
+
}
|
|
1583
|
+
]
|
|
1584
|
+
}
|
|
1585
|
+
],
|
|
1328
1586
|
Stop: [
|
|
1329
1587
|
{
|
|
1330
1588
|
hooks: [
|
|
@@ -1360,7 +1618,8 @@ export const HOOK_SCRIPTS_BASH = {
|
|
|
1360
1618
|
'keyword-detector.sh': KEYWORD_DETECTOR_SCRIPT,
|
|
1361
1619
|
'stop-continuation.sh': STOP_CONTINUATION_SCRIPT,
|
|
1362
1620
|
'persistent-mode.sh': PERSISTENT_MODE_SCRIPT,
|
|
1363
|
-
'session-start.sh': SESSION_START_SCRIPT
|
|
1621
|
+
'session-start.sh': SESSION_START_SCRIPT,
|
|
1622
|
+
'post-tool-use.sh': POST_TOOL_USE_SCRIPT
|
|
1364
1623
|
};
|
|
1365
1624
|
/**
|
|
1366
1625
|
* Node.js hook scripts (Cross-platform)
|
|
@@ -1369,7 +1628,8 @@ export const HOOK_SCRIPTS_NODE = {
|
|
|
1369
1628
|
'keyword-detector.mjs': KEYWORD_DETECTOR_SCRIPT_NODE,
|
|
1370
1629
|
'stop-continuation.mjs': STOP_CONTINUATION_SCRIPT_NODE,
|
|
1371
1630
|
'persistent-mode.mjs': PERSISTENT_MODE_SCRIPT_NODE,
|
|
1372
|
-
'session-start.mjs': SESSION_START_SCRIPT_NODE
|
|
1631
|
+
'session-start.mjs': SESSION_START_SCRIPT_NODE,
|
|
1632
|
+
'post-tool-use.mjs': POST_TOOL_USE_SCRIPT_NODE
|
|
1373
1633
|
};
|
|
1374
1634
|
/**
|
|
1375
1635
|
* Get the appropriate hook scripts for the current platform
|
|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vD,sBAAsB,EAAE,4BAA4B;IACpD,uBAAuB,EAAE,6BAA6B;IACtD,qBAAqB,EAAE,2BAA2B;IAClD,mBAAmB,EAAE,yBAAyB;IAC9C,mBAAmB,EAAE,yBAAyB;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,kBAAkB,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAA2B,iBAAiB,CAAC"}
|
|
@@ -24,7 +24,7 @@ export declare const HOOKS_DIR: string;
|
|
|
24
24
|
export declare const SETTINGS_FILE: string;
|
|
25
25
|
export declare const VERSION_FILE: string;
|
|
26
26
|
/** Current version */
|
|
27
|
-
export declare const VERSION = "2.
|
|
27
|
+
export declare const VERSION = "2.6.0";
|
|
28
28
|
/** Installation result */
|
|
29
29
|
export interface InstallResult {
|
|
30
30
|
success: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/installer/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAeH,0CAA0C;AAC1C,eAAO,MAAM,iBAAiB,QAA6B,CAAC;AAC5D,eAAO,MAAM,UAAU,QAAoC,CAAC;AAC5D,eAAO,MAAM,YAAY,QAAsC,CAAC;AAChE,eAAO,MAAM,UAAU,QAAoC,CAAC;AAC5D,eAAO,MAAM,SAAS,QAAmC,CAAC;AAC1D,eAAO,MAAM,aAAa,QAA2C,CAAC;AACtE,eAAO,MAAM,YAAY,QAAoD,CAAC;AAE9E,sBAAsB;AACtB,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,0BAA0B;AAC1B,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAA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