memobank-cli 0.2.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/CHANGELOG.md +139 -0
- package/LICENSE +21 -0
- package/README.md +300 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +294 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/capture.d.ts +12 -0
- package/dist/commands/capture.d.ts.map +1 -0
- package/dist/commands/capture.js +191 -0
- package/dist/commands/capture.js.map +1 -0
- package/dist/commands/import.d.ts +28 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +356 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/index.d.ts +12 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +82 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/install.d.ts +16 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +142 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/lifecycle.d.ts +21 -0
- package/dist/commands/lifecycle.d.ts.map +1 -0
- package/dist/commands/lifecycle.js +106 -0
- package/dist/commands/lifecycle.js.map +1 -0
- package/dist/commands/map.d.ts +10 -0
- package/dist/commands/map.d.ts.map +1 -0
- package/dist/commands/map.js +72 -0
- package/dist/commands/map.js.map +1 -0
- package/dist/commands/onboarding.d.ts +10 -0
- package/dist/commands/onboarding.d.ts.map +1 -0
- package/dist/commands/onboarding.js +420 -0
- package/dist/commands/onboarding.js.map +1 -0
- package/dist/commands/recall.d.ts +13 -0
- package/dist/commands/recall.d.ts.map +1 -0
- package/dist/commands/recall.js +89 -0
- package/dist/commands/recall.js.map +1 -0
- package/dist/commands/review.d.ts +11 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +66 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/search.d.ts +13 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +107 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/setup.d.ts +9 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +354 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/write.d.ts +14 -0
- package/dist/commands/write.d.ts.map +1 -0
- package/dist/commands/write.js +247 -0
- package/dist/commands/write.js.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +147 -0
- package/dist/config.js.map +1 -0
- package/dist/core/decay-engine.d.ts +16 -0
- package/dist/core/decay-engine.d.ts.map +1 -0
- package/dist/core/decay-engine.js +91 -0
- package/dist/core/decay-engine.js.map +1 -0
- package/dist/core/embedding.d.ts +60 -0
- package/dist/core/embedding.d.ts.map +1 -0
- package/dist/core/embedding.js +169 -0
- package/dist/core/embedding.js.map +1 -0
- package/dist/core/lifecycle-manager.d.ts +105 -0
- package/dist/core/lifecycle-manager.d.ts.map +1 -0
- package/dist/core/lifecycle-manager.js +332 -0
- package/dist/core/lifecycle-manager.js.map +1 -0
- package/dist/core/memory-template.d.ts +70 -0
- package/dist/core/memory-template.d.ts.map +1 -0
- package/dist/core/memory-template.js +496 -0
- package/dist/core/memory-template.js.map +1 -0
- package/dist/core/noise-filter.d.ts +39 -0
- package/dist/core/noise-filter.d.ts.map +1 -0
- package/dist/core/noise-filter.js +168 -0
- package/dist/core/noise-filter.js.map +1 -0
- package/dist/core/retriever.d.ts +21 -0
- package/dist/core/retriever.d.ts.map +1 -0
- package/dist/core/retriever.js +77 -0
- package/dist/core/retriever.js.map +1 -0
- package/dist/core/sanitizer.d.ts +9 -0
- package/dist/core/sanitizer.d.ts.map +1 -0
- package/dist/core/sanitizer.js +57 -0
- package/dist/core/sanitizer.js.map +1 -0
- package/dist/core/smart-extractor.d.ts +12 -0
- package/dist/core/smart-extractor.d.ts.map +1 -0
- package/dist/core/smart-extractor.js +102 -0
- package/dist/core/smart-extractor.js.map +1 -0
- package/dist/core/store.d.ts +40 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +233 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/tool-config.d.ts +33 -0
- package/dist/core/tool-config.d.ts.map +1 -0
- package/dist/core/tool-config.js +253 -0
- package/dist/core/tool-config.js.map +1 -0
- package/dist/engines/engine-adapter.d.ts +22 -0
- package/dist/engines/engine-adapter.d.ts.map +1 -0
- package/dist/engines/engine-adapter.js +7 -0
- package/dist/engines/engine-adapter.js.map +1 -0
- package/dist/engines/lancedb-engine.d.ts +55 -0
- package/dist/engines/lancedb-engine.d.ts.map +1 -0
- package/dist/engines/lancedb-engine.js +279 -0
- package/dist/engines/lancedb-engine.js.map +1 -0
- package/dist/engines/text-engine.d.ts +30 -0
- package/dist/engines/text-engine.d.ts.map +1 -0
- package/dist/engines/text-engine.js +100 -0
- package/dist/engines/text-engine.js.map +1 -0
- package/dist/platforms/claude-code.d.ts +13 -0
- package/dist/platforms/claude-code.d.ts.map +1 -0
- package/dist/platforms/claude-code.js +85 -0
- package/dist/platforms/claude-code.js.map +1 -0
- package/dist/platforms/codex.d.ts +9 -0
- package/dist/platforms/codex.d.ts.map +1 -0
- package/dist/platforms/codex.js +102 -0
- package/dist/platforms/codex.js.map +1 -0
- package/dist/platforms/cursor.d.ts +9 -0
- package/dist/platforms/cursor.d.ts.map +1 -0
- package/dist/platforms/cursor.js +112 -0
- package/dist/platforms/cursor.js.map +1 -0
- package/dist/types.d.ts +55 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Memory Lifecycle Manager
|
|
4
|
+
* Handles memory promotion, demotion, archival, and correction
|
|
5
|
+
* Ported and adapted from memory-lancedb-pro
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.loadAccessLogs = loadAccessLogs;
|
|
42
|
+
exports.saveAccessLogs = saveAccessLogs;
|
|
43
|
+
exports.recordAccess = recordAccess;
|
|
44
|
+
exports.getMemoryTier = getMemoryTier;
|
|
45
|
+
exports.analyzeLifecycle = analyzeLifecycle;
|
|
46
|
+
exports.loadCorrections = loadCorrections;
|
|
47
|
+
exports.saveCorrections = saveCorrections;
|
|
48
|
+
exports.recordCorrection = recordCorrection;
|
|
49
|
+
exports.getFlaggedMemories = getFlaggedMemories;
|
|
50
|
+
exports.archiveMemory = archiveMemory;
|
|
51
|
+
exports.deleteMemory = deleteMemory;
|
|
52
|
+
exports.updateMemory = updateMemory;
|
|
53
|
+
exports.generateLifecycleReport = generateLifecycleReport;
|
|
54
|
+
const fs = __importStar(require("fs"));
|
|
55
|
+
const path = __importStar(require("path"));
|
|
56
|
+
const store_1 = require("./store");
|
|
57
|
+
const DEFAULT_CONFIG = {
|
|
58
|
+
coreThreshold: 10,
|
|
59
|
+
peripheralThreshold: 90,
|
|
60
|
+
archiveAfterDays: 180,
|
|
61
|
+
deleteAfterDays: 365,
|
|
62
|
+
allowCorrections: true,
|
|
63
|
+
correctionThreshold: 3,
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Access log file path
|
|
67
|
+
*/
|
|
68
|
+
function getAccessLogPath(repoRoot) {
|
|
69
|
+
return path.join(repoRoot, 'meta', 'access-log.json');
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Corrections log file path
|
|
73
|
+
*/
|
|
74
|
+
function getCorrectionsPath(repoRoot) {
|
|
75
|
+
return path.join(repoRoot, 'meta', 'corrections.json');
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Load access logs
|
|
79
|
+
*/
|
|
80
|
+
function loadAccessLogs(repoRoot) {
|
|
81
|
+
const accessLogPath = getAccessLogPath(repoRoot);
|
|
82
|
+
if (!fs.existsSync(accessLogPath)) {
|
|
83
|
+
return {};
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const content = fs.readFileSync(accessLogPath, 'utf-8');
|
|
87
|
+
const data = JSON.parse(content);
|
|
88
|
+
// Convert string dates back to Date objects
|
|
89
|
+
for (const key of Object.keys(data)) {
|
|
90
|
+
data[key].lastAccessed = new Date(data[key].lastAccessed);
|
|
91
|
+
}
|
|
92
|
+
return data;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.warn(`Could not load access logs: ${error.message}`);
|
|
96
|
+
return {};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Save access logs
|
|
101
|
+
*/
|
|
102
|
+
function saveAccessLogs(repoRoot, logs) {
|
|
103
|
+
const accessLogPath = getAccessLogPath(repoRoot);
|
|
104
|
+
const logDir = path.dirname(accessLogPath);
|
|
105
|
+
if (!fs.existsSync(logDir)) {
|
|
106
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
107
|
+
}
|
|
108
|
+
fs.writeFileSync(accessLogPath, JSON.stringify(logs, null, 2), 'utf-8');
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Record memory access
|
|
112
|
+
*/
|
|
113
|
+
function recordAccess(repoRoot, memoryPath, query) {
|
|
114
|
+
const logs = loadAccessLogs(repoRoot);
|
|
115
|
+
const now = new Date();
|
|
116
|
+
if (!logs[memoryPath]) {
|
|
117
|
+
logs[memoryPath] = {
|
|
118
|
+
memoryPath,
|
|
119
|
+
lastAccessed: now,
|
|
120
|
+
accessCount: 0,
|
|
121
|
+
recallQueries: [],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const log = logs[memoryPath];
|
|
125
|
+
log.lastAccessed = now;
|
|
126
|
+
log.accessCount++;
|
|
127
|
+
if (query) {
|
|
128
|
+
log.recallQueries.unshift(query);
|
|
129
|
+
if (log.recallQueries.length > 10) {
|
|
130
|
+
log.recallQueries.pop(); // Keep last 10 queries
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
saveAccessLogs(repoRoot, logs);
|
|
134
|
+
return log;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get memory tier based on access patterns
|
|
138
|
+
*/
|
|
139
|
+
function getMemoryTier(memory, accessLog, config = DEFAULT_CONFIG) {
|
|
140
|
+
const accessCount = accessLog?.accessCount || 0;
|
|
141
|
+
// High access count → core
|
|
142
|
+
if (accessCount >= config.coreThreshold) {
|
|
143
|
+
return 'core';
|
|
144
|
+
}
|
|
145
|
+
// Check days since last access
|
|
146
|
+
if (accessLog?.lastAccessed) {
|
|
147
|
+
const daysSinceAccess = (Date.now() - accessLog.lastAccessed.getTime()) / (1000 * 60 * 60 * 24);
|
|
148
|
+
// Long time without access → peripheral
|
|
149
|
+
if (daysSinceAccess > config.peripheralThreshold) {
|
|
150
|
+
return 'peripheral';
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Default → working
|
|
154
|
+
return 'working';
|
|
155
|
+
}
|
|
156
|
+
function analyzeLifecycle(repoRoot, config = DEFAULT_CONFIG) {
|
|
157
|
+
const memories = (0, store_1.loadAll)(repoRoot);
|
|
158
|
+
const accessLogs = loadAccessLogs(repoRoot);
|
|
159
|
+
const now = Date.now();
|
|
160
|
+
return memories.map((memory) => {
|
|
161
|
+
const accessLog = accessLogs[memory.path];
|
|
162
|
+
const tier = getMemoryTier(memory, accessLog, config);
|
|
163
|
+
const daysSinceAccess = accessLog?.lastAccessed
|
|
164
|
+
? (now - accessLog.lastAccessed.getTime()) / (1000 * 60 * 60 * 24)
|
|
165
|
+
: null;
|
|
166
|
+
const isArchivalCandidate = (daysSinceAccess || 0) > config.archiveAfterDays;
|
|
167
|
+
const isDeletionCandidate = isArchivalCandidate && tier === 'peripheral';
|
|
168
|
+
let suggestion;
|
|
169
|
+
if (tier === 'core') {
|
|
170
|
+
suggestion = 'Keep - frequently accessed';
|
|
171
|
+
}
|
|
172
|
+
else if (tier === 'peripheral') {
|
|
173
|
+
suggestion = 'Consider archiving or deleting';
|
|
174
|
+
}
|
|
175
|
+
else if (isArchivalCandidate) {
|
|
176
|
+
suggestion = 'Consider archiving';
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
memory,
|
|
180
|
+
tier,
|
|
181
|
+
accessCount: accessLog?.accessCount || 0,
|
|
182
|
+
daysSinceAccess,
|
|
183
|
+
isArchivalCandidate,
|
|
184
|
+
isDeletionCandidate,
|
|
185
|
+
suggestion,
|
|
186
|
+
};
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Load corrections log
|
|
191
|
+
*/
|
|
192
|
+
function loadCorrections(repoRoot) {
|
|
193
|
+
const correctionsPath = getCorrectionsPath(repoRoot);
|
|
194
|
+
if (!fs.existsSync(correctionsPath)) {
|
|
195
|
+
return {};
|
|
196
|
+
}
|
|
197
|
+
try {
|
|
198
|
+
return JSON.parse(fs.readFileSync(correctionsPath, 'utf-8'));
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
console.warn(`Could not load corrections: ${error.message}`);
|
|
202
|
+
return {};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Save corrections log
|
|
207
|
+
*/
|
|
208
|
+
function saveCorrections(repoRoot, corrections) {
|
|
209
|
+
const correctionsPath = getCorrectionsPath(repoRoot);
|
|
210
|
+
const logDir = path.dirname(correctionsPath);
|
|
211
|
+
if (!fs.existsSync(logDir)) {
|
|
212
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
213
|
+
}
|
|
214
|
+
fs.writeFileSync(correctionsPath, JSON.stringify(corrections, null, 2), 'utf-8');
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Record a memory correction
|
|
218
|
+
*/
|
|
219
|
+
function recordCorrection(repoRoot, memoryPath, originalText, correctedText, reason) {
|
|
220
|
+
const corrections = loadCorrections(repoRoot);
|
|
221
|
+
if (!corrections[memoryPath]) {
|
|
222
|
+
corrections[memoryPath] = {
|
|
223
|
+
memoryPath,
|
|
224
|
+
corrections: [],
|
|
225
|
+
flaggedForReview: false,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const record = corrections[memoryPath];
|
|
229
|
+
record.corrections.push({
|
|
230
|
+
date: new Date().toISOString(),
|
|
231
|
+
originalText,
|
|
232
|
+
correctedText,
|
|
233
|
+
reason,
|
|
234
|
+
});
|
|
235
|
+
// Flag for review if too many corrections
|
|
236
|
+
if (record.corrections.length >= 3) {
|
|
237
|
+
record.flaggedForReview = true;
|
|
238
|
+
}
|
|
239
|
+
saveCorrections(repoRoot, corrections);
|
|
240
|
+
return record;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get memories flagged for review
|
|
244
|
+
*/
|
|
245
|
+
function getFlaggedMemories(repoRoot) {
|
|
246
|
+
const corrections = loadCorrections(repoRoot);
|
|
247
|
+
const memories = (0, store_1.loadAll)(repoRoot);
|
|
248
|
+
const flaggedPaths = new Set(Object.entries(corrections)
|
|
249
|
+
.filter(([_, record]) => record.flaggedForReview)
|
|
250
|
+
.map(([path, _]) => path));
|
|
251
|
+
return memories.filter((m) => flaggedPaths.has(m.path));
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Archive a memory (move to archive directory)
|
|
255
|
+
*/
|
|
256
|
+
function archiveMemory(repoRoot, memoryPath) {
|
|
257
|
+
const archiveDir = path.join(repoRoot, 'archive');
|
|
258
|
+
const memoryName = path.basename(memoryPath);
|
|
259
|
+
const archivePath = path.join(archiveDir, memoryName);
|
|
260
|
+
if (!fs.existsSync(archiveDir)) {
|
|
261
|
+
fs.mkdirSync(archiveDir, { recursive: true });
|
|
262
|
+
}
|
|
263
|
+
fs.renameSync(memoryPath, archivePath);
|
|
264
|
+
console.log(`Archived: ${memoryName}`);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Delete a memory permanently
|
|
268
|
+
*/
|
|
269
|
+
function deleteMemory(repoRoot, memoryPath) {
|
|
270
|
+
fs.unlinkSync(memoryPath);
|
|
271
|
+
console.log(`Deleted: ${path.basename(memoryPath)}`);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Update memory content (correction)
|
|
275
|
+
*/
|
|
276
|
+
function updateMemory(repoRoot, memoryPath, updates) {
|
|
277
|
+
const memories = (0, store_1.loadAll)(repoRoot);
|
|
278
|
+
const memory = memories.find((m) => m.path === memoryPath);
|
|
279
|
+
if (!memory) {
|
|
280
|
+
throw new Error(`Memory not found: ${memoryPath}`);
|
|
281
|
+
}
|
|
282
|
+
// Apply updates
|
|
283
|
+
const updatedMemory = { ...memory, ...updates };
|
|
284
|
+
// Write updated memory
|
|
285
|
+
(0, store_1.writeMemory)(repoRoot, {
|
|
286
|
+
type: updatedMemory.type,
|
|
287
|
+
name: updatedMemory.name,
|
|
288
|
+
description: updatedMemory.description,
|
|
289
|
+
tags: updatedMemory.tags,
|
|
290
|
+
content: updatedMemory.content,
|
|
291
|
+
confidence: updatedMemory.confidence,
|
|
292
|
+
created: updatedMemory.created,
|
|
293
|
+
});
|
|
294
|
+
console.log(`Updated: ${path.basename(memoryPath)}`);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Generate lifecycle report
|
|
298
|
+
*/
|
|
299
|
+
function generateLifecycleReport(repoRoot, config = DEFAULT_CONFIG) {
|
|
300
|
+
const analysis = analyzeLifecycle(repoRoot, config);
|
|
301
|
+
const core = analysis.filter((a) => a.tier === 'core');
|
|
302
|
+
const working = analysis.filter((a) => a.tier === 'working');
|
|
303
|
+
const peripheral = analysis.filter((a) => a.tier === 'peripheral');
|
|
304
|
+
const archival = analysis.filter((a) => a.isArchivalCandidate);
|
|
305
|
+
let report = '## Memory Lifecycle Report\n\n';
|
|
306
|
+
report += `**Total Memories:** ${analysis.length}\n\n`;
|
|
307
|
+
report += `### Tier Distribution\n`;
|
|
308
|
+
report += `- Core (frequently accessed): ${core.length}\n`;
|
|
309
|
+
report += `- Working (active): ${working.length}\n`;
|
|
310
|
+
report += `- Peripheral (inactive): ${peripheral.length}\n\n`;
|
|
311
|
+
if (archival.length > 0) {
|
|
312
|
+
report += `### Archival Candidates (${archival.length})\n`;
|
|
313
|
+
for (const item of archival.slice(0, 10)) {
|
|
314
|
+
report += `- ${item.memory.name} (${item.daysSinceAccess?.toFixed(0)} days inactive)\n`;
|
|
315
|
+
}
|
|
316
|
+
if (archival.length > 10) {
|
|
317
|
+
report += `... and ${archival.length - 10} more\n`;
|
|
318
|
+
}
|
|
319
|
+
report += '\n';
|
|
320
|
+
}
|
|
321
|
+
const flagged = getFlaggedMemories(repoRoot);
|
|
322
|
+
if (flagged.length > 0) {
|
|
323
|
+
report += `### Flagged for Review (${flagged.length})\n`;
|
|
324
|
+
report += 'These memories have been corrected multiple times:\n';
|
|
325
|
+
for (const memory of flagged) {
|
|
326
|
+
report += `- ${memory.name}\n`;
|
|
327
|
+
}
|
|
328
|
+
report += '\n';
|
|
329
|
+
}
|
|
330
|
+
return report;
|
|
331
|
+
}
|
|
332
|
+
//# sourceMappingURL=lifecycle-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-manager.js","sourceRoot":"","sources":["../../src/core/lifecycle-manager.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEH,wCAqBC;AAKD,wCASC;AAKD,oCA8BC;AAKD,sCAwBC;AAeD,4CAsCC;AAmBD,0CAaC;AAKD,0CASC;AAKD,4CAgCC;AAKD,gDAWC;AAKD,sCAWC;AAKD,oCAGC;AAKD,oCA2BC;AAKD,0DAwCC;AA/ZD,uCAAyB;AACzB,2CAA6B;AAE7B,mCAA6D;AAkC7D,MAAM,cAAc,GAAoB;IACtC,aAAa,EAAE,EAAE;IACjB,mBAAmB,EAAE,EAAE;IACvB,gBAAgB,EAAE,GAAG;IACrB,eAAe,EAAE,GAAG;IACpB,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,SAAS,gBAAgB,CAAC,QAAgB;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;A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IAAI,IAAI,CAAC;IACjB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory Template Module
|
|
3
|
+
* Provides templates and sanitization for memobank memories
|
|
4
|
+
* Aligned with: https://github.com/clawde-agent/memobank/blob/master/docs/specs/2026-03-17-memobank-design.md
|
|
5
|
+
*/
|
|
6
|
+
export type MemoryType = 'lesson' | 'decision' | 'workflow' | 'architecture';
|
|
7
|
+
export type Confidence = 'low' | 'medium' | 'high';
|
|
8
|
+
/**
|
|
9
|
+
* Memory template with frontmatter - aligned with memobank design spec
|
|
10
|
+
*/
|
|
11
|
+
export interface MemoryTemplate {
|
|
12
|
+
name: string;
|
|
13
|
+
type: MemoryType;
|
|
14
|
+
description: string;
|
|
15
|
+
tags: string[];
|
|
16
|
+
created: string;
|
|
17
|
+
updated?: string;
|
|
18
|
+
reviewAfter?: string;
|
|
19
|
+
confidence?: Confidence;
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sanitize content by removing sensitive information
|
|
24
|
+
*/
|
|
25
|
+
export declare function sanitizeContent(content: string): {
|
|
26
|
+
sanitized: string;
|
|
27
|
+
redacted: string[];
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Check if content contains sensitive topics
|
|
31
|
+
*/
|
|
32
|
+
export declare function checkSensitiveTopics(content: string): string[];
|
|
33
|
+
/**
|
|
34
|
+
* Validate memory content for safety
|
|
35
|
+
*/
|
|
36
|
+
export declare function validateMemoryContent(content: string): {
|
|
37
|
+
valid: boolean;
|
|
38
|
+
warnings: string[];
|
|
39
|
+
errors: string[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Generate memory file name (slug format)
|
|
43
|
+
*/
|
|
44
|
+
export declare function generateMemorySlug(name: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Generate memory file content with frontmatter
|
|
47
|
+
* Aligned with memobank design spec:
|
|
48
|
+
* - Filename: <date>-<name>.md
|
|
49
|
+
* - Frontmatter: YAML with required fields
|
|
50
|
+
* - Body: Free-form Markdown
|
|
51
|
+
* - Design Goal: Human-readable, Git-native, Portable
|
|
52
|
+
*/
|
|
53
|
+
export declare function generateMemoryFile(template: MemoryTemplate): {
|
|
54
|
+
fileName: string;
|
|
55
|
+
content: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Get template by type
|
|
59
|
+
* Aligned with memobank design spec directory semantics:
|
|
60
|
+
* - lessons/: Post-mortems, bugs fixed, gotchas
|
|
61
|
+
* - decisions/: ADRs: context, options, decision, consequences
|
|
62
|
+
* - workflows/: Step-by-step runbooks, deploy flows, onboarding
|
|
63
|
+
* - architecture/: System diagrams, component descriptions, data flows
|
|
64
|
+
*/
|
|
65
|
+
export declare function getTemplateByType(type: MemoryType): string;
|
|
66
|
+
/**
|
|
67
|
+
* Validate memory abstraction level
|
|
68
|
+
*/
|
|
69
|
+
export declare function checkAbstractionLevel(content: string): 'high' | 'medium' | 'low' | 'too-specific';
|
|
70
|
+
//# sourceMappingURL=memory-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-template.d.ts","sourceRoot":"","sources":["../../src/core/memory-template.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,CAAC;AAC7E,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAA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