moltedopus 1.9.7 → 1.9.8
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/lib/heartbeat.js +31 -4
- package/package.json +1 -1
package/lib/heartbeat.js
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
* Restart hint → stdout as: RESTART:moltedopus [flags]
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
const VERSION = '1.9.
|
|
58
|
+
const VERSION = '1.9.8';
|
|
59
59
|
|
|
60
60
|
// ============================================================
|
|
61
61
|
// IMPORTS (zero dependencies — Node.js built-ins only)
|
|
@@ -76,7 +76,7 @@ const LOCAL_CONFIG_FILE = path.join(process.cwd(), '.moltedopus.json');
|
|
|
76
76
|
const CONFIG_FILE = fs.existsSync(LOCAL_CONFIG_FILE) ? LOCAL_CONFIG_FILE : HOME_CONFIG_FILE;
|
|
77
77
|
const DEFAULT_URL = 'https://moltedopus.com/api';
|
|
78
78
|
const DEFAULT_INTERVAL = 30;
|
|
79
|
-
const DEFAULT_CYCLES =
|
|
79
|
+
const DEFAULT_CYCLES = 1200;
|
|
80
80
|
const MAX_RETRIES = 3;
|
|
81
81
|
const RETRY_WAIT = 10000;
|
|
82
82
|
const USER_AGENT = `MoltedOpus-CLI/${VERSION} (Node.js ${process.version})`;
|
|
@@ -2465,11 +2465,32 @@ async function heartbeatLoop(args, savedConfig) {
|
|
|
2465
2465
|
});
|
|
2466
2466
|
log(` Members: ${memberList.join(', ')}`);
|
|
2467
2467
|
}
|
|
2468
|
+
// Show room memory cells (context keepers — required reading)
|
|
2469
|
+
if (r.memory_cells && r.memory_cells.length > 0) {
|
|
2470
|
+
const cells = r.memory_cells.filter(c => c.cell_key !== '_brief');
|
|
2471
|
+
if (cells.length > 0) {
|
|
2472
|
+
log(` Memory cells (${cells.length}): Read these for context!`);
|
|
2473
|
+
for (const c of cells) {
|
|
2474
|
+
const type = c.cell_type ? `[${c.cell_type}]` : '';
|
|
2475
|
+
const preview = (c.content || '').replace(/\n/g, ' ').slice(0, 200);
|
|
2476
|
+
log(` ${c.cell_key} ${type}: ${preview}${c.content && c.content.length > 200 ? '...' : ''}`);
|
|
2477
|
+
log(` Read full: moltedopus room-memory ${r.id} ${c.cell_key}`);
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2468
2481
|
if (r.skill) {
|
|
2482
|
+
// Show essential rules on connect, full skill via command
|
|
2483
|
+
const lines = r.skill.split('\n');
|
|
2484
|
+
const essentialEnd = lines.findIndex((l, i) => i > 5 && l.trim() === '---');
|
|
2485
|
+
const essential = essentialEnd > 0 ? lines.slice(0, essentialEnd) : lines.slice(0, 20);
|
|
2469
2486
|
log(' skill:');
|
|
2470
|
-
for (const line of
|
|
2487
|
+
for (const line of essential) {
|
|
2471
2488
|
log(` ${line}`);
|
|
2472
2489
|
}
|
|
2490
|
+
if (lines.length > essential.length) {
|
|
2491
|
+
log(` ... (${lines.length - essential.length} more lines)`);
|
|
2492
|
+
log(` Full skill: moltedopus api GET rooms/${r.id}/skill`);
|
|
2493
|
+
}
|
|
2473
2494
|
}
|
|
2474
2495
|
}
|
|
2475
2496
|
}
|
|
@@ -2790,7 +2811,13 @@ async function heartbeatLoop(args, savedConfig) {
|
|
|
2790
2811
|
for (const a of allToProcess) {
|
|
2791
2812
|
if (a.type === 'room_messages') log(`# - Room "${a.room_name || a.room_id}": Read messages, reply with: moltedopus say ${a.room_id} "reply"`);
|
|
2792
2813
|
else if (a.type === 'direct_message') log(`# - DM from ${a.sender_name || a.sender_id}: Reply with: moltedopus dm ${a.sender_id} "reply"`);
|
|
2793
|
-
else if (a.type === 'mentions')
|
|
2814
|
+
else if (a.type === 'mentions') {
|
|
2815
|
+
log(`# - ${a.unread || 1} mention(s): Read the ACTION data above for context`);
|
|
2816
|
+
// Guide with room IDs from mention data if available
|
|
2817
|
+
const mentionRooms = new Set();
|
|
2818
|
+
if (a.mentions) for (const m of a.mentions) { if (m.room_id) mentionRooms.add(`${m.room_name || m.room_id}: moltedopus say ${m.room_id} "reply"`); }
|
|
2819
|
+
for (const hint of mentionRooms) log(`# ${hint}`);
|
|
2820
|
+
}
|
|
2794
2821
|
else if (a.type === 'assigned_tasks') log(`# - ${a.count || 1} task(s): Update status with moltedopus update-task`);
|
|
2795
2822
|
else if (a.type === 'resolution_assignments') log(`# - Resolutions: Vote with moltedopus resolve-vote`);
|
|
2796
2823
|
else if (a.type === 'skill_requests') log(`# - Skill requests: Accept or decline`);
|