claude-memory-store 0.2.0 → 0.2.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/dist/atlas/indexes.d.ts.map +1 -1
- package/dist/atlas/indexes.js +4 -0
- package/dist/atlas/indexes.js.map +1 -1
- package/dist/atlas/vector.d.ts +6 -0
- package/dist/atlas/vector.d.ts.map +1 -1
- package/dist/atlas/vector.js +90 -6
- package/dist/atlas/vector.js.map +1 -1
- package/dist/bin/claude-memory.js +135 -80
- package/dist/bin/claude-memory.js.map +1 -1
- package/dist/bin/mcp-server.js +48 -8
- package/dist/bin/mcp-server.js.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +43 -2
- package/dist/config.js.map +1 -1
- package/dist/hooks/hook-input.d.ts +34 -0
- package/dist/hooks/hook-input.d.ts.map +1 -0
- package/dist/hooks/hook-input.js +68 -0
- package/dist/hooks/hook-input.js.map +1 -0
- package/dist/hooks/post-tool-use.d.ts +8 -2
- package/dist/hooks/post-tool-use.d.ts.map +1 -1
- package/dist/hooks/post-tool-use.js +203 -3
- package/dist/hooks/post-tool-use.js.map +1 -1
- package/dist/hooks/pre-compact.d.ts +3 -0
- package/dist/hooks/pre-compact.d.ts.map +1 -0
- package/dist/hooks/pre-compact.js +36 -0
- package/dist/hooks/pre-compact.js.map +1 -0
- package/dist/hooks/pre-tool-use.d.ts +15 -0
- package/dist/hooks/pre-tool-use.d.ts.map +1 -1
- package/dist/hooks/pre-tool-use.js +166 -8
- package/dist/hooks/pre-tool-use.js.map +1 -1
- package/dist/hooks/stop.js +6 -99
- package/dist/hooks/stop.js.map +1 -1
- package/dist/hooks/transcript-utils.d.ts +18 -0
- package/dist/hooks/transcript-utils.d.ts.map +1 -0
- package/dist/hooks/transcript-utils.js +110 -0
- package/dist/hooks/transcript-utils.js.map +1 -0
- package/dist/memory/commands.d.ts.map +1 -1
- package/dist/memory/commands.js +7 -1
- package/dist/memory/commands.js.map +1 -1
- package/dist/memory/developer.d.ts +16 -0
- package/dist/memory/developer.d.ts.map +1 -1
- package/dist/memory/developer.js +28 -0
- package/dist/memory/developer.js.map +1 -1
- package/dist/memory/project.d.ts +26 -0
- package/dist/memory/project.d.ts.map +1 -1
- package/dist/memory/project.js +79 -0
- package/dist/memory/project.js.map +1 -1
- package/dist/memory/working.d.ts.map +1 -1
- package/dist/memory/working.js +2 -1
- package/dist/memory/working.js.map +1 -1
- package/dist/modes/code.d.ts +7 -0
- package/dist/modes/code.d.ts.map +1 -0
- package/dist/modes/code.js +15 -0
- package/dist/modes/code.js.map +1 -0
- package/dist/modes/index.d.ts +16 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +29 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/research.d.ts +7 -0
- package/dist/modes/research.d.ts.map +1 -0
- package/dist/modes/research.js +15 -0
- package/dist/modes/research.js.map +1 -0
- package/dist/natural-language/router.js +1 -3
- package/dist/natural-language/router.js.map +1 -1
- package/dist/startup/injector.d.ts.map +1 -1
- package/dist/startup/injector.js +64 -38
- package/dist/startup/injector.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +10 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +33 -0
- package/dist/utils.js.map +1 -1
- package/dist/watch/event-log.d.ts.map +1 -1
- package/dist/watch/event-log.js +23 -0
- package/dist/watch/event-log.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/mcp-server.js
CHANGED
|
@@ -16,6 +16,7 @@ const zod_1 = require("zod");
|
|
|
16
16
|
const client_js_1 = require("../atlas/client.js");
|
|
17
17
|
const config_js_1 = require("../config.js");
|
|
18
18
|
const vector_js_1 = require("../atlas/vector.js");
|
|
19
|
+
const utils_js_1 = require("../utils.js");
|
|
19
20
|
const project_id_js_1 = require("../project-id.js");
|
|
20
21
|
const parser_js_1 = require("../natural-language/parser.js");
|
|
21
22
|
const project_js_1 = require("../memory/project.js");
|
|
@@ -23,7 +24,7 @@ const developer_js_1 = require("../memory/developer.js");
|
|
|
23
24
|
const working_js_1 = require("../memory/working.js");
|
|
24
25
|
const server = new mcp_js_1.McpServer({
|
|
25
26
|
name: 'claude-memory',
|
|
26
|
-
version: '0.2.
|
|
27
|
+
version: '0.2.2',
|
|
27
28
|
});
|
|
28
29
|
let connected = false;
|
|
29
30
|
async function ensureConnected() {
|
|
@@ -36,7 +37,11 @@ async function ensureConnected() {
|
|
|
36
37
|
connected = true;
|
|
37
38
|
}
|
|
38
39
|
// ─── Tool: recall ───────────────────────────────────────────────────────────
|
|
39
|
-
server.tool('recall', 'Search persistent memory for decisions, patterns, commands, or context about a topic.
|
|
40
|
+
server.tool('recall', 'Search persistent memory for decisions, patterns, commands, or context about a topic. Returns compact one-line summaries by default. Use recall_detail(id) to get full content of any item.', {
|
|
41
|
+
topic: zod_1.z.string().describe('Topic to search memory for'),
|
|
42
|
+
limit: zod_1.z.number().int().min(1).max(20).default(5).describe('Max results to return'),
|
|
43
|
+
detail: zod_1.z.enum(['compact', 'full']).default('compact').describe('compact = one-line summaries with IDs, full = complete content'),
|
|
44
|
+
}, async ({ topic, limit, detail }) => {
|
|
40
45
|
await ensureConnected();
|
|
41
46
|
const projectId = (0, project_id_js_1.getProjectId)();
|
|
42
47
|
const results = await (0, vector_js_1.search)(topic, projectId, limit);
|
|
@@ -45,11 +50,46 @@ server.tool('recall', 'Search persistent memory for decisions, patterns, command
|
|
|
45
50
|
content: [{ type: 'text', text: `No memory found for "${topic}".` }],
|
|
46
51
|
};
|
|
47
52
|
}
|
|
53
|
+
if (detail === 'full') {
|
|
54
|
+
const formatted = results
|
|
55
|
+
.map((r) => `[${r.type}] ${r.content}`)
|
|
56
|
+
.join('\n\n');
|
|
57
|
+
return {
|
|
58
|
+
content: [{ type: 'text', text: `=== MEMORY RECALL: ${topic} ===\n\n${formatted}` }],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// Compact mode (default): one-line summaries with IDs
|
|
62
|
+
const showSavings = (0, config_js_1.getContextShowTokenSavings)();
|
|
48
63
|
const formatted = results
|
|
49
|
-
.map((r) =>
|
|
50
|
-
.
|
|
64
|
+
.map((r) => {
|
|
65
|
+
const line = (0, utils_js_1.formatCompactLine)(r.type, r.id, r.content);
|
|
66
|
+
if (showSavings && r.document) {
|
|
67
|
+
const discoveryTokens = typeof r.document.discovery_tokens === 'number' ? r.document.discovery_tokens : 0;
|
|
68
|
+
if (discoveryTokens > 0) {
|
|
69
|
+
const compactTokens = Math.ceil(line.length / 4);
|
|
70
|
+
const saved = discoveryTokens - compactTokens;
|
|
71
|
+
if (saved > 0)
|
|
72
|
+
return `${line} (saved ~${saved} tokens)`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return line;
|
|
76
|
+
})
|
|
77
|
+
.join('\n');
|
|
78
|
+
return {
|
|
79
|
+
content: [{ type: 'text', text: `=== MEMORY RECALL: ${topic} ===\n\n${formatted}\n\nUse recall_detail(id) for full content.` }],
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
// ─── Tool: recall_detail ────────────────────────────────────────────────────
|
|
83
|
+
server.tool('recall_detail', 'Retrieve the full content of a specific memory document by ID. Use after seeing compact results from recall() to get complete details.', { id: zod_1.z.string().describe('Memory document ID (8-char short hash or full 24-char ObjectId from recall results)') }, async ({ id }) => {
|
|
84
|
+
await ensureConnected();
|
|
85
|
+
const result = await (0, vector_js_1.findMemoryById)(id);
|
|
86
|
+
if (!result) {
|
|
87
|
+
return {
|
|
88
|
+
content: [{ type: 'text', text: `No memory found with ID "${id}".` }],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
51
91
|
return {
|
|
52
|
-
content: [{ type: 'text', text:
|
|
92
|
+
content: [{ type: 'text', text: `[${result.type}] ${result.content}` }],
|
|
53
93
|
};
|
|
54
94
|
});
|
|
55
95
|
// ─── Tool: remember ─────────────────────────────────────────────────────────
|
|
@@ -101,7 +141,7 @@ server.tool('memory_threads', 'List all open threads — unresolved issues, defe
|
|
|
101
141
|
// ─── Tool: memory_stats ─────────────────────────────────────────────────────
|
|
102
142
|
server.tool('memory_stats', 'Show memory statistics — counts of stored decisions, patterns, avoid rules, commands, threads, preferences, and session history.', {}, async () => {
|
|
103
143
|
await ensureConnected();
|
|
104
|
-
const [pm, dm, arch, patterns, avoid, threads, commands, prefs, styles,
|
|
144
|
+
const [pm, dm, arch, patterns, avoid, threads, commands, prefs, styles, sessionCount] = await Promise.all([
|
|
105
145
|
(0, project_js_1.getProjectMeta)(),
|
|
106
146
|
(0, developer_js_1.getDeveloperMeta)(),
|
|
107
147
|
(0, project_js_1.getArchitectureDecisions)(),
|
|
@@ -111,7 +151,7 @@ server.tool('memory_stats', 'Show memory statistics — counts of stored decisio
|
|
|
111
151
|
(0, project_js_1.getAllCommands)(),
|
|
112
152
|
(0, developer_js_1.getPreferences)(),
|
|
113
153
|
(0, developer_js_1.getStyles)(),
|
|
114
|
-
(0, working_js_1.
|
|
154
|
+
(0, working_js_1.getWorkingMemoryCount)(),
|
|
115
155
|
]);
|
|
116
156
|
const lines = [
|
|
117
157
|
`=== MEMORY STATS: ${(0, project_id_js_1.getProjectName)()} ===`,
|
|
@@ -131,7 +171,7 @@ server.tool('memory_stats', 'Show memory statistics — counts of stored decisio
|
|
|
131
171
|
` Style rules: ${styles.length}`,
|
|
132
172
|
` Total sessions (all projects): ${dm?.session_count || 0}`,
|
|
133
173
|
'',
|
|
134
|
-
`Working memory: ${
|
|
174
|
+
`Working memory: ${sessionCount} session(s) stored`,
|
|
135
175
|
];
|
|
136
176
|
return {
|
|
137
177
|
content: [{ type: 'text', text: lines.join('\n') }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/bin/mcp-server.ts"],"names":[],"mappings":";;;AACA;;;;;;;;GAQG;AACH,oEAAoE;AACpE,wEAAiF;AACjF,6BAAwB;AACxB,k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,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,sDAAsD;IACtD,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;AAC/D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;IACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ export declare function getMemoryTtlDays(): number;
|
|
|
10
10
|
export declare const VECTOR_RELEVANCE_THRESHOLD = 0.55;
|
|
11
11
|
export declare const DUPLICATE_SIMILARITY_THRESHOLD = 0.92;
|
|
12
12
|
export declare const MAX_INJECTION_CHARS = 2000;
|
|
13
|
+
export declare function getContextDetail(): 'compact' | 'full';
|
|
14
|
+
export declare function getContextMaxResults(): number;
|
|
15
|
+
export declare function getContextMaxInjectionChars(): number;
|
|
16
|
+
export declare function getContextShowTokenSavings(): boolean;
|
|
17
|
+
export declare function getContextStartupMode(): 'minimal' | 'standard' | 'verbose';
|
|
18
|
+
export declare function getMode(): string;
|
|
19
|
+
export declare function getAutoCapture(): boolean;
|
|
13
20
|
export declare function getDecayHalfLifeDays(): number;
|
|
14
21
|
export declare function getDecayDeathThreshold(): number;
|
|
15
22
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAoBrD,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,eAAe,IAAI,IAAI,CAItC;AAED,wBAAgB,UAAU,IAAI,kBAAkB,CAW/C;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAG3D;AAED,wBAAgB,WAAW,IAAI,MAAM,CAOpC;AAED,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAGzC;AAID,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAK/C,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAGnD,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,wBAAgB,gBAAgB,IAAI,SAAS,GAAG,MAAM,CAGrD;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAG7C;AAED,wBAAgB,2BAA2B,IAAI,MAAM,CAGpD;AAED,wBAAgB,0BAA0B,IAAI,OAAO,CAGpD;AAED,wBAAgB,qBAAqB,IAAI,SAAS,GAAG,UAAU,GAAG,SAAS,CAG1E;AAED,wBAAgB,OAAO,IAAI,MAAM,CAGhC;AAED,wBAAgB,cAAc,IAAI,OAAO,CAGxC;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAG7C;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAG/C"}
|
package/dist/config.js
CHANGED
|
@@ -42,6 +42,13 @@ exports.saveConfig = saveConfig;
|
|
|
42
42
|
exports.getAtlasUri = getAtlasUri;
|
|
43
43
|
exports.isConfigured = isConfigured;
|
|
44
44
|
exports.getMemoryTtlDays = getMemoryTtlDays;
|
|
45
|
+
exports.getContextDetail = getContextDetail;
|
|
46
|
+
exports.getContextMaxResults = getContextMaxResults;
|
|
47
|
+
exports.getContextMaxInjectionChars = getContextMaxInjectionChars;
|
|
48
|
+
exports.getContextShowTokenSavings = getContextShowTokenSavings;
|
|
49
|
+
exports.getContextStartupMode = getContextStartupMode;
|
|
50
|
+
exports.getMode = getMode;
|
|
51
|
+
exports.getAutoCapture = getAutoCapture;
|
|
45
52
|
exports.getDecayHalfLifeDays = getDecayHalfLifeDays;
|
|
46
53
|
exports.getDecayDeathThreshold = getDecayDeathThreshold;
|
|
47
54
|
const fs = __importStar(require("node:fs"));
|
|
@@ -55,6 +62,13 @@ const DEFAULT_CONFIG = {
|
|
|
55
62
|
memory_ttl_days: 30,
|
|
56
63
|
decay_half_life_days: 7,
|
|
57
64
|
decay_death_threshold: 0.05,
|
|
65
|
+
context_detail: 'compact',
|
|
66
|
+
context_max_results: 5,
|
|
67
|
+
context_max_injection_chars: 2000,
|
|
68
|
+
context_show_token_savings: false,
|
|
69
|
+
context_startup_mode: 'standard',
|
|
70
|
+
mode: 'code',
|
|
71
|
+
auto_capture: true,
|
|
58
72
|
};
|
|
59
73
|
function getConfigDir() {
|
|
60
74
|
return CONFIG_DIR;
|
|
@@ -106,9 +120,36 @@ exports.VECTOR_RELEVANCE_THRESHOLD = 0.55;
|
|
|
106
120
|
// If a new memory scores >= this against an existing one, treat as duplicate.
|
|
107
121
|
// Higher = stricter dedup. Lower = more aggressive merging.
|
|
108
122
|
exports.DUPLICATE_SIMILARITY_THRESHOLD = 0.92;
|
|
109
|
-
// Maximum characters injected from memory per prompt.
|
|
110
|
-
// Prevents memory from accidentally consuming the context window.
|
|
123
|
+
// Maximum characters injected from memory per prompt (default, overridable via config).
|
|
111
124
|
exports.MAX_INJECTION_CHARS = 2000;
|
|
125
|
+
function getContextDetail() {
|
|
126
|
+
const config = loadConfig();
|
|
127
|
+
return config.context_detail ?? 'compact';
|
|
128
|
+
}
|
|
129
|
+
function getContextMaxResults() {
|
|
130
|
+
const config = loadConfig();
|
|
131
|
+
return config.context_max_results ?? 5;
|
|
132
|
+
}
|
|
133
|
+
function getContextMaxInjectionChars() {
|
|
134
|
+
const config = loadConfig();
|
|
135
|
+
return config.context_max_injection_chars ?? exports.MAX_INJECTION_CHARS;
|
|
136
|
+
}
|
|
137
|
+
function getContextShowTokenSavings() {
|
|
138
|
+
const config = loadConfig();
|
|
139
|
+
return config.context_show_token_savings ?? false;
|
|
140
|
+
}
|
|
141
|
+
function getContextStartupMode() {
|
|
142
|
+
const config = loadConfig();
|
|
143
|
+
return config.context_startup_mode ?? 'standard';
|
|
144
|
+
}
|
|
145
|
+
function getMode() {
|
|
146
|
+
const config = loadConfig();
|
|
147
|
+
return config.mode ?? 'code';
|
|
148
|
+
}
|
|
149
|
+
function getAutoCapture() {
|
|
150
|
+
const config = loadConfig();
|
|
151
|
+
return config.auto_capture ?? true;
|
|
152
|
+
}
|
|
112
153
|
function getDecayHalfLifeDays() {
|
|
113
154
|
const config = loadConfig();
|
|
114
155
|
return config.decay_half_life_days ?? 7;
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,oCAEC;AAED,sCAEC;AAED,0CAIC;AAED,gCAWC;AAED,gCAGC;AAED,kCAOC;AAED,oCAEC;AAED,4CAGC;AAcD,4CAGC;AAED,oDAGC;AAED,kEAGC;AAED,gEAGC;AAED,sDAGC;AAED,0BAGC;AAED,wCAGC;AAED,oDAGC;AAED,wDAGC;AAhID,4CAA8B;AAC9B,gDAAkC;AAClC,4CAA8B;AAG9B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,gBAAgB,CAAC,CAAC;AAC7D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAEzD,MAAM,cAAc,GAAuB;IACzC,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,KAAK;IAClB,eAAe,EAAE,EAAE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AACnD,CAAC;AAED,SAAgB,OAAO;IACrB,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC;AAC/B,CAAC;AAED,SAAgB,cAAc;IAC5B,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC;AACrC,CAAC;AAED,SAAgB,oBAAoB;IAClC,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC,oBAAoB,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,SAAgB,sBAAsB;IACpC,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC,qBAAqB,IAAI,IAAI,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses the structured JSON that Claude Code sends to hooks via stdin.
|
|
3
|
+
*
|
|
4
|
+
* Claude Code passes tool metadata (tool_name, tool_input, tool_result)
|
|
5
|
+
* as JSON. Previously we treated stdin as raw text, losing this data.
|
|
6
|
+
*/
|
|
7
|
+
export interface HookInput {
|
|
8
|
+
session_id?: string;
|
|
9
|
+
hook_event_name?: string;
|
|
10
|
+
tool_name?: string;
|
|
11
|
+
tool_input?: Record<string, unknown>;
|
|
12
|
+
tool_result?: string;
|
|
13
|
+
transcript_path?: string;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Try to parse raw stdin as Claude Code hook JSON.
|
|
18
|
+
* Returns null if the input is not valid JSON (legacy plain-text invocation).
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseHookInput(raw: string): HookInput | null;
|
|
21
|
+
/**
|
|
22
|
+
* Extract the file path from Edit, Write, or Read tool_input.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getFilePath(input: HookInput): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Extract the bash command string from Bash tool_input.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getBashCommand(input: HookInput): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Extract a meaningful search query from the hook input.
|
|
31
|
+
* Falls back to stringifying tool_input keys for unknown tools.
|
|
32
|
+
*/
|
|
33
|
+
export declare function extractSearchQuery(input: HookInput): string | null;
|
|
34
|
+
//# sourceMappingURL=hook-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-input.d.ts","sourceRoot":"","sources":["../../src/hooks/hook-input.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAU5D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAwBlE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Parses the structured JSON that Claude Code sends to hooks via stdin.
|
|
4
|
+
*
|
|
5
|
+
* Claude Code passes tool metadata (tool_name, tool_input, tool_result)
|
|
6
|
+
* as JSON. Previously we treated stdin as raw text, losing this data.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.parseHookInput = parseHookInput;
|
|
10
|
+
exports.getFilePath = getFilePath;
|
|
11
|
+
exports.getBashCommand = getBashCommand;
|
|
12
|
+
exports.extractSearchQuery = extractSearchQuery;
|
|
13
|
+
/**
|
|
14
|
+
* Try to parse raw stdin as Claude Code hook JSON.
|
|
15
|
+
* Returns null if the input is not valid JSON (legacy plain-text invocation).
|
|
16
|
+
*/
|
|
17
|
+
function parseHookInput(raw) {
|
|
18
|
+
try {
|
|
19
|
+
const parsed = JSON.parse(raw);
|
|
20
|
+
if (typeof parsed === 'object' && parsed !== null) {
|
|
21
|
+
return parsed;
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Extract the file path from Edit, Write, or Read tool_input.
|
|
31
|
+
*/
|
|
32
|
+
function getFilePath(input) {
|
|
33
|
+
return input.tool_input?.file_path ?? null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Extract the bash command string from Bash tool_input.
|
|
37
|
+
*/
|
|
38
|
+
function getBashCommand(input) {
|
|
39
|
+
return input.tool_input?.command ?? null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Extract a meaningful search query from the hook input.
|
|
43
|
+
* Falls back to stringifying tool_input keys for unknown tools.
|
|
44
|
+
*/
|
|
45
|
+
function extractSearchQuery(input) {
|
|
46
|
+
const toolName = input.tool_name || '';
|
|
47
|
+
switch (toolName) {
|
|
48
|
+
case 'Edit':
|
|
49
|
+
case 'Write':
|
|
50
|
+
return getFilePath(input);
|
|
51
|
+
case 'Bash':
|
|
52
|
+
return getBashCommand(input);
|
|
53
|
+
case 'Read':
|
|
54
|
+
case 'Glob':
|
|
55
|
+
case 'Grep':
|
|
56
|
+
// Read-only tools — no injection needed
|
|
57
|
+
return null;
|
|
58
|
+
default: {
|
|
59
|
+
// For MCP tools, Agent, etc. — try to extract something useful
|
|
60
|
+
const toolInput = input.tool_input;
|
|
61
|
+
if (!toolInput)
|
|
62
|
+
return null;
|
|
63
|
+
const values = Object.values(toolInput).filter((v) => typeof v === 'string' && v.length > 5 && v.length < 500);
|
|
64
|
+
return values.length > 0 ? values.join(' ') : null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=hook-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-input.js","sourceRoot":"","sources":["../../src/hooks/hook-input.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAgBH,wCAUC;AAKD,kCAEC;AAKD,wCAEC;AAMD,gDAwBC;AA1DD;;;GAGG;AACH,SAAgB,cAAc,CAAC,GAAW;IACxC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAClD,OAAO,MAAmB,CAAC;QAC7B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAgB;IAC1C,OAAQ,KAAK,CAAC,UAAU,EAAE,SAAoB,IAAI,IAAI,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAgB;IAC7C,OAAQ,KAAK,CAAC,UAAU,EAAE,OAAkB,IAAI,IAAI,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,KAAgB;IACjD,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC;IAEvC,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,KAAK,MAAM;YACT,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;QAC/B,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,wCAAwC;YACxC,OAAO,IAAI,CAAC;QACd,OAAO,CAAC,CAAC,CAAC;YACR,+DAA+D;YAC/D,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,SAAS;gBAAE,OAAO,IAAI,CAAC;YAC5B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAC5C,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,GAAG,CAC/D,CAAC;YACF,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import type { HookInput } from './hook-input.js';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
3
|
+
* New entry point: dispatches to tool-specific handlers based on
|
|
4
|
+
* the structured JSON from Claude Code stdin.
|
|
5
|
+
*/
|
|
6
|
+
export declare function postToolUseDispatch(input: HookInput): Promise<string | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Original PostToolUse entry point.
|
|
9
|
+
* Kept for backward compatibility when stdin is not JSON.
|
|
4
10
|
*/
|
|
5
11
|
export declare function postToolUse(toolName: string, toolInput: string, toolOutput: string): Promise<string | null>;
|
|
6
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-tool-use.d.ts","sourceRoot":"","sources":["../../src/hooks/post-tool-use.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post-tool-use.d.ts","sourceRoot":"","sources":["../../src/hooks/post-tool-use.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AA0DjD;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYlF;AAqJD;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAKxB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBjF"}
|
|
@@ -1,15 +1,215 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.postToolUseDispatch = postToolUseDispatch;
|
|
3
4
|
exports.postToolUse = postToolUse;
|
|
4
5
|
exports.processMemoryCommand = processMemoryCommand;
|
|
5
6
|
const router_js_1 = require("../natural-language/router.js");
|
|
6
7
|
const intent_js_1 = require("../natural-language/intent.js");
|
|
8
|
+
const project_js_1 = require("../memory/project.js");
|
|
9
|
+
const parser_js_1 = require("../natural-language/parser.js");
|
|
10
|
+
const config_js_1 = require("../config.js");
|
|
11
|
+
const hook_input_js_1 = require("./hook-input.js");
|
|
12
|
+
// ─── Auto-Capture Helper ───────────────────────────────────────────────────
|
|
7
13
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
14
|
+
* Fire-and-forget: stores a summary string as context.
|
|
15
|
+
* Config-gated, secret-safe, never blocks the hook.
|
|
16
|
+
*/
|
|
17
|
+
function autoCapture(content) {
|
|
18
|
+
if (!(0, config_js_1.getAutoCapture)())
|
|
19
|
+
return;
|
|
20
|
+
if (!content || content.length < 10)
|
|
21
|
+
return;
|
|
22
|
+
if ((0, parser_js_1.containsSecret)(content))
|
|
23
|
+
return;
|
|
24
|
+
(async () => {
|
|
25
|
+
try {
|
|
26
|
+
await (0, project_js_1.ensureProjectMeta)();
|
|
27
|
+
await (0, project_js_1.addContext)(content);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
// Silent — never block the hook
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
33
|
+
}
|
|
34
|
+
// Config files that warrant a memory suggestion when changed
|
|
35
|
+
const SIGNIFICANT_FILES = [
|
|
36
|
+
'package.json',
|
|
37
|
+
'tsconfig.json',
|
|
38
|
+
'tsconfig.build.json',
|
|
39
|
+
'Dockerfile',
|
|
40
|
+
'docker-compose.yml',
|
|
41
|
+
'docker-compose.yaml',
|
|
42
|
+
'.env.example',
|
|
43
|
+
'.gitignore',
|
|
44
|
+
'.dockerignore',
|
|
45
|
+
'jest.config',
|
|
46
|
+
'vitest.config',
|
|
47
|
+
'webpack.config',
|
|
48
|
+
'vite.config',
|
|
49
|
+
'next.config',
|
|
50
|
+
'tailwind.config',
|
|
51
|
+
'eslint.config',
|
|
52
|
+
'.eslintrc',
|
|
53
|
+
'.prettierrc',
|
|
54
|
+
'CLAUDE.md',
|
|
55
|
+
];
|
|
56
|
+
// Patterns in code that indicate structural/architectural changes
|
|
57
|
+
const STRUCTURAL_PATTERNS = [
|
|
58
|
+
/^export\s+(default\s+)?(class|interface|type|enum|const|function)\s/m,
|
|
59
|
+
/^(class|interface|type|enum)\s+\w+/m,
|
|
60
|
+
/module\.exports/m,
|
|
61
|
+
/createRouter|createApp|express\(\)/m,
|
|
62
|
+
/new\s+(MongoClient|Pool|Redis|Server)/m,
|
|
63
|
+
];
|
|
64
|
+
// ─── Tool-Specific Dispatch ─────────────────────────────────────────────────
|
|
65
|
+
/**
|
|
66
|
+
* New entry point: dispatches to tool-specific handlers based on
|
|
67
|
+
* the structured JSON from Claude Code stdin.
|
|
68
|
+
*/
|
|
69
|
+
async function postToolUseDispatch(input) {
|
|
70
|
+
const toolName = input.tool_name || '';
|
|
71
|
+
switch (toolName) {
|
|
72
|
+
case 'Edit':
|
|
73
|
+
case 'Write':
|
|
74
|
+
return postToolUseFileChange(input);
|
|
75
|
+
case 'Bash':
|
|
76
|
+
return postToolUseBash(input);
|
|
77
|
+
default:
|
|
78
|
+
return postToolUseGeneric(input);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* After Edit/Write: detect significant code changes worth remembering.
|
|
83
|
+
* Uses heuristics, not AI — fast and free.
|
|
84
|
+
*/
|
|
85
|
+
async function postToolUseFileChange(input) {
|
|
86
|
+
const filePath = (0, hook_input_js_1.getFilePath)(input);
|
|
87
|
+
if (!filePath)
|
|
88
|
+
return null;
|
|
89
|
+
const fileName = filePath.split('/').pop() || '';
|
|
90
|
+
const reasons = [];
|
|
91
|
+
// Check 1: Is this a significant config file?
|
|
92
|
+
if (SIGNIFICANT_FILES.some((sf) => fileName.includes(sf) || filePath.endsWith(sf))) {
|
|
93
|
+
reasons.push('config file changed');
|
|
94
|
+
}
|
|
95
|
+
// Check 2: Does the change contain structural patterns?
|
|
96
|
+
// For Edit: check new_string. For Write: check content (full file).
|
|
97
|
+
const newContent = input.tool_input?.new_string || input.tool_input?.content || '';
|
|
98
|
+
const oldContent = input.tool_input?.old_string || '';
|
|
99
|
+
const combinedContent = newContent + ' ' + oldContent;
|
|
100
|
+
if (combinedContent.trim() && STRUCTURAL_PATTERNS.some((p) => p.test(combinedContent))) {
|
|
101
|
+
reasons.push('structural code change');
|
|
102
|
+
}
|
|
103
|
+
// Check 3: First-time file touch — not mentioned in any memory
|
|
104
|
+
if (reasons.length === 0) {
|
|
105
|
+
try {
|
|
106
|
+
const existing = await (0, project_js_1.searchByFilePath)(filePath);
|
|
107
|
+
if (existing.length === 0) {
|
|
108
|
+
reasons.push('first-time file touch');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
// Skip first-touch check on DB error
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (reasons.length === 0)
|
|
116
|
+
return null;
|
|
117
|
+
const shortPath = filePath.split('/').slice(-2).join('/');
|
|
118
|
+
// Auto-capture: store a summary of what changed
|
|
119
|
+
if (reasons.includes('config file changed')) {
|
|
120
|
+
autoCapture(`Config changed: ${shortPath}`);
|
|
121
|
+
}
|
|
122
|
+
if (reasons.includes('structural code change')) {
|
|
123
|
+
autoCapture(`Code structure change in ${shortPath} (new export/class/interface/type)`);
|
|
124
|
+
}
|
|
125
|
+
if (reasons.includes('first-time file touch')) {
|
|
126
|
+
autoCapture(`New file touched: ${filePath.split('/').slice(-3).join('/')}`);
|
|
127
|
+
}
|
|
128
|
+
return `[MEMORY] Notable change in ${shortPath} (${reasons.join(', ')}). Use the \`remember\` MCP tool if this is an architecture decision worth preserving.`;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* After Bash: flag notable command outcomes (errors, test results, deploys).
|
|
132
|
+
*/
|
|
133
|
+
async function postToolUseBash(input) {
|
|
134
|
+
const command = (0, hook_input_js_1.getBashCommand)(input);
|
|
135
|
+
const result = input.tool_result || '';
|
|
136
|
+
if (!command || !result)
|
|
137
|
+
return null;
|
|
138
|
+
// Only check meaningful output
|
|
139
|
+
if (result.length < 20)
|
|
140
|
+
return null;
|
|
141
|
+
const resultLower = result.toLowerCase();
|
|
142
|
+
const commandLower = command.toLowerCase();
|
|
143
|
+
// Test results
|
|
144
|
+
const isTestCommand = commandLower.includes('npm test') ||
|
|
145
|
+
commandLower.includes('vitest') ||
|
|
146
|
+
commandLower.includes('jest') ||
|
|
147
|
+
commandLower.includes('pytest') ||
|
|
148
|
+
commandLower.includes('npm run test');
|
|
149
|
+
if (isTestCommand) {
|
|
150
|
+
const hasFail = resultLower.includes('fail') || resultLower.includes('error');
|
|
151
|
+
if (hasFail) {
|
|
152
|
+
// Extract first meaningful error line for the auto-capture summary
|
|
153
|
+
const errorLine = extractFirstErrorLine(result);
|
|
154
|
+
const shortCmd = command.length > 60 ? command.slice(0, 60) + '...' : command;
|
|
155
|
+
autoCapture(`Test failure: ${shortCmd} — ${errorLine}`);
|
|
156
|
+
return `[MEMORY] Test failures detected. If this reveals a pattern or known issue, consider storing it with the \`remember\` MCP tool.`;
|
|
157
|
+
}
|
|
158
|
+
// Don't nag on passing tests
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
// Deploy/publish commands
|
|
162
|
+
const isDeployCommand = commandLower.includes('npm publish') ||
|
|
163
|
+
commandLower.includes('docker push') ||
|
|
164
|
+
commandLower.includes('git push');
|
|
165
|
+
if (isDeployCommand) {
|
|
166
|
+
const shortCmd = command.length > 80 ? command.slice(0, 80) + '...' : command;
|
|
167
|
+
autoCapture(`Deploy completed: ${shortCmd}`);
|
|
168
|
+
return `[MEMORY] Deploy/publish command completed. Consider storing the version or outcome with the \`remember\` MCP tool.`;
|
|
169
|
+
}
|
|
170
|
+
// Significant errors (silent capture — no suggestion string)
|
|
171
|
+
const errorPatterns = /\b(error:|fatal:|enoent|permission denied|command not found|segmentation fault|killed|oom)\b/i;
|
|
172
|
+
if (errorPatterns.test(result)) {
|
|
173
|
+
const errorLine = extractFirstErrorLine(result);
|
|
174
|
+
const shortCmd = command.length > 60 ? command.slice(0, 60) + '...' : command;
|
|
175
|
+
autoCapture(`Command error: ${shortCmd} — ${errorLine}`);
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Extract the first meaningful error/failure line from command output.
|
|
181
|
+
* Skips blank lines and common noise. Truncates to 150 chars.
|
|
182
|
+
*/
|
|
183
|
+
function extractFirstErrorLine(output) {
|
|
184
|
+
const lines = output.split('\n');
|
|
185
|
+
const errorLine = lines.find((line) => {
|
|
186
|
+
const trimmed = line.trim();
|
|
187
|
+
if (!trimmed || trimmed.length < 5)
|
|
188
|
+
return false;
|
|
189
|
+
return /\b(error|fail|fatal|exception|panic|enoent|denied|not found)\b/i.test(trimmed);
|
|
190
|
+
});
|
|
191
|
+
const raw = errorLine?.trim() || lines.find((l) => l.trim().length > 10)?.trim() || 'unknown error';
|
|
192
|
+
return raw.length > 150 ? raw.slice(0, 150) + '...' : raw;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Generic fallback: natural language intent detection for memory commands.
|
|
196
|
+
* Handles "remember X", "store this", "recall Y" etc.
|
|
197
|
+
*/
|
|
198
|
+
async function postToolUseGeneric(input) {
|
|
199
|
+
// Extract conversational text from tool input
|
|
200
|
+
const text = input.tool_input?.prompt ||
|
|
201
|
+
input.tool_input?.content ||
|
|
202
|
+
'';
|
|
203
|
+
if (!text)
|
|
204
|
+
return null;
|
|
205
|
+
return processMemoryCommand(text);
|
|
206
|
+
}
|
|
207
|
+
// ─── Legacy Entry Points (backward compat) ──────────────────────────────────
|
|
208
|
+
/**
|
|
209
|
+
* Original PostToolUse entry point.
|
|
210
|
+
* Kept for backward compatibility when stdin is not JSON.
|
|
10
211
|
*/
|
|
11
212
|
async function postToolUse(toolName, toolInput, toolOutput) {
|
|
12
|
-
// Check tool input for explicit memory commands from the developer
|
|
13
213
|
if (toolInput) {
|
|
14
214
|
return processMemoryCommand(toolInput);
|
|
15
215
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-tool-use.js","sourceRoot":"","sources":["../../src/hooks/post-tool-use.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"post-tool-use.js","sourceRoot":"","sources":["../../src/hooks/post-tool-use.ts"],"names":[],"mappings":";;AAmEA,kDAYC;AAyJD,kCASC;AAMD,oDAkBC;AAzQD,6DAA4D;AAC5D,6DAA6D;AAC7D,qDAAuF;AACvF,6DAA+D;AAC/D,4CAA8C;AAE9C,mDAA8D;AAE9D,8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