@jungjaehoon/mama-server 1.5.1 ā 1.5.5
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/package.json
CHANGED
|
@@ -172,6 +172,30 @@ Before saving: scan for TODOs or missing tests and state them plainly.`,
|
|
|
172
172
|
handler: async (args) => {
|
|
173
173
|
const { summary, open_files, next_steps } = args;
|
|
174
174
|
|
|
175
|
+
// Search for related decisions before saving
|
|
176
|
+
let relatedDecisions = [];
|
|
177
|
+
let relatedDecisionsHint = '';
|
|
178
|
+
try {
|
|
179
|
+
const searchResults = await search(summary, { limit: 3, threshold: 0.8 });
|
|
180
|
+
if (searchResults && searchResults.length > 0) {
|
|
181
|
+
relatedDecisions = searchResults.map((d) => ({
|
|
182
|
+
id: d.id,
|
|
183
|
+
topic: d.topic,
|
|
184
|
+
decision: d.decision?.substring(0, 100) + (d.decision?.length > 100 ? '...' : ''),
|
|
185
|
+
similarity: d.similarity?.toFixed(2),
|
|
186
|
+
}));
|
|
187
|
+
relatedDecisionsHint =
|
|
188
|
+
`\n\nš Related Decisions Found (consider linking in summary):\n` +
|
|
189
|
+
relatedDecisions
|
|
190
|
+
.map((d) => ` ⢠${d.topic} [${d.similarity}]: ${d.decision}`)
|
|
191
|
+
.join('\n') +
|
|
192
|
+
`\n\nš” To link: Add "Related decisions: ${relatedDecisions.map((d) => d.id).join(', ')}" to summary if relevant.`;
|
|
193
|
+
}
|
|
194
|
+
} catch (error) {
|
|
195
|
+
// Silent fail - don't block checkpoint save
|
|
196
|
+
console.warn('[saveCheckpoint] Failed to search related decisions:', error.message);
|
|
197
|
+
}
|
|
198
|
+
|
|
175
199
|
// BMad Workflow Integration: Check Story status before saving
|
|
176
200
|
const currentStory = inferCurrentStory(summary);
|
|
177
201
|
let bmadWorkflowWarning = '';
|
|
@@ -221,7 +245,7 @@ Before saving: scan for TODOs or missing tests and state them plainly.`,
|
|
|
221
245
|
content: [
|
|
222
246
|
{
|
|
223
247
|
type: 'text',
|
|
224
|
-
text: `ā
Checkpoint saved (ID: ${id})\nSummary: ${summary}${bmadWorkflowWarning}`,
|
|
248
|
+
text: `ā
Checkpoint saved (ID: ${id})\nSummary: ${summary}${relatedDecisionsHint}${bmadWorkflowWarning}`,
|
|
225
249
|
},
|
|
226
250
|
],
|
|
227
251
|
};
|
|
@@ -30,6 +30,10 @@ You are not just an AI assistant; you are a partner in this project. Your insigh
|
|
|
30
30
|
- **Insights**: If you discover something new ("Ah, this library conflicts with that one"), save it.
|
|
31
31
|
- **Requests**: If the user says "Remember this" or "Note that", use this tool immediately.
|
|
32
32
|
|
|
33
|
+
**EXAMPLES:**
|
|
34
|
+
ā User: "Let's use token bucket" ā save(topic="rate_limiter", decision="Token bucket", reasoning="...")
|
|
35
|
+
ā You discover: "Library X conflicts with Y" ā save(topic="lib_conflict", decision="Avoid X+Y", reasoning="...")
|
|
36
|
+
|
|
33
37
|
**COLLABORATION MODES:**
|
|
34
38
|
When you find similar past decisions (returned in similar_decisions), choose your approach:
|
|
35
39
|
- **build_on**: Extend the existing decision with new insights. Use same topic to create supersedes edge.
|
|
@@ -58,16 +58,11 @@ export class ChatModule {
|
|
|
58
58
|
this.maxHistoryMessages = 50;
|
|
59
59
|
this.historyExpiryMs = 24 * 60 * 60 * 1000; // 24 hours
|
|
60
60
|
|
|
61
|
-
// Auto checkpoint state
|
|
62
|
-
this.idleTimer = null;
|
|
63
|
-
this.idleDelay = 5 * 60 * 1000; // 5 minutes
|
|
64
|
-
|
|
65
61
|
// Initialize
|
|
66
62
|
this.initChatInput();
|
|
67
63
|
this.initLongPressCopy();
|
|
68
64
|
this.initSpeechRecognition();
|
|
69
65
|
this.initSpeechSynthesis();
|
|
70
|
-
this.initAutoCheckpoint();
|
|
71
66
|
}
|
|
72
67
|
|
|
73
68
|
// =============================================
|
|
@@ -1362,55 +1357,7 @@ export class ChatModule {
|
|
|
1362
1357
|
// =============================================
|
|
1363
1358
|
|
|
1364
1359
|
/**
|
|
1365
|
-
*
|
|
1366
|
-
*/
|
|
1367
|
-
initAutoCheckpoint() {
|
|
1368
|
-
// Reset timer on user activity
|
|
1369
|
-
const resetTimer = () => this.resetIdleTimer();
|
|
1370
|
-
|
|
1371
|
-
document.addEventListener('keydown', resetTimer);
|
|
1372
|
-
document.addEventListener('click', resetTimer);
|
|
1373
|
-
document.addEventListener('touchstart', resetTimer);
|
|
1374
|
-
|
|
1375
|
-
console.log('[Chat] Auto checkpoint initialized (5 min idle)');
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
/**
|
|
1379
|
-
* Reset idle timer
|
|
1380
|
-
*/
|
|
1381
|
-
resetIdleTimer() {
|
|
1382
|
-
if (this.idleTimer) {
|
|
1383
|
-
clearTimeout(this.idleTimer);
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
this.idleTimer = setTimeout(() => {
|
|
1387
|
-
this.autoSaveCheckpoint();
|
|
1388
|
-
}, this.idleDelay);
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
/**
|
|
1392
|
-
* Auto-save checkpoint when idle
|
|
1393
|
-
*/
|
|
1394
|
-
async autoSaveCheckpoint() {
|
|
1395
|
-
// Only save if there's content
|
|
1396
|
-
if (this.history.length === 0) {
|
|
1397
|
-
console.log('[Chat] No history to save');
|
|
1398
|
-
return;
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
try {
|
|
1402
|
-
const summary = this.generateCheckpointSummary();
|
|
1403
|
-
await this.saveCheckpoint(summary);
|
|
1404
|
-
showToast('š¾ Session auto-saved');
|
|
1405
|
-
console.log('[Chat] Auto checkpoint saved');
|
|
1406
|
-
} catch (error) {
|
|
1407
|
-
console.error('[Chat] Auto checkpoint failed:', error);
|
|
1408
|
-
// Silent fail - don't disturb user
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
/**
|
|
1413
|
-
* Generate checkpoint summary from current session
|
|
1360
|
+
* Generate checkpoint summary from current session (for manual /checkpoint command)
|
|
1414
1361
|
*/
|
|
1415
1362
|
generateCheckpointSummary() {
|
|
1416
1363
|
const summary = {
|
|
@@ -570,7 +570,7 @@ export class GraphModule {
|
|
|
570
570
|
* Save outcome for current node
|
|
571
571
|
*/
|
|
572
572
|
async saveOutcome() {
|
|
573
|
-
const select = document.getElementById('outcome-select');
|
|
573
|
+
const select = document.getElementById('detail-outcome-select');
|
|
574
574
|
const newOutcome = select.value;
|
|
575
575
|
|
|
576
576
|
if (!this.currentNodeId || !newOutcome) {
|