@jungjaehoon/mama-server 1.5.1 → 1.5.4
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
|
@@ -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) {
|