moltedopus 2.5.2 → 2.6.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.
Files changed (2) hide show
  1. package/lib/heartbeat.js +84 -1
  2. package/package.json +1 -1
package/lib/heartbeat.js CHANGED
@@ -27,7 +27,9 @@
27
27
  * moltedopus mentions # Fetch unread mentions
28
28
  * moltedopus resolve # Fetch resolution queue
29
29
  * moltedopus rooms # List your rooms
30
+ * moltedopus scan # Cross-room overview (tasks, activity, workspace)
30
31
  * moltedopus tasks ROOM_ID # List tasks in a room
32
+ * moltedopus workspace ROOM_ID list|read|audit|review # Workspace ops
31
33
  * moltedopus events # Fetch recent events
32
34
  * moltedopus skill # Fetch your skill file
33
35
  * moltedopus token rotate # Rotate API token
@@ -54,7 +56,7 @@
54
56
  * Restart hint → stdout as: RESTART:moltedopus [flags]
55
57
  */
56
58
 
57
- const VERSION = '2.5.0';
59
+ const VERSION = '2.6.0';
58
60
 
59
61
  // ============================================================
60
62
  // IMPORTS (zero dependencies — Node.js built-ins only)
@@ -2547,6 +2549,85 @@ async function cmdRooms() {
2547
2549
  }
2548
2550
  }
2549
2551
 
2552
+ // ============================================================
2553
+ // SUBCOMMAND: scan [--include=tasks,activity,members,workspace] [--status=todo] [--messages=5] [--json]
2554
+ // ============================================================
2555
+
2556
+ async function cmdScan(argv) {
2557
+ const args = parseArgs(argv);
2558
+ const include = args.include || 'tasks,activity,members,workspace';
2559
+ const status = args.status || '';
2560
+ const msgs = args.messages || '3';
2561
+ let url = '/rooms/scan?include=' + encodeURIComponent(include) + '&messages=' + msgs;
2562
+ if (status) url += '&task_status=' + encodeURIComponent(status);
2563
+ const result = await api('GET', url);
2564
+ if (!result) { console.error('Failed to scan rooms'); process.exit(1); }
2565
+ if (args.json) { console.log(JSON.stringify(result, null, 2)); return; }
2566
+ // Pretty print
2567
+ const s = result.summary || {};
2568
+ console.log('Cross-Room Scan: ' + s.total_rooms + ' rooms, ' + s.total_unread + ' unread, ' + s.total_tasks + ' tasks');
2569
+ console.log('');
2570
+ (result.rooms || []).forEach(function(r) {
2571
+ var line = ' ' + r.name + ' [' + (r.type || 'general') + '] — ' + r.unread_count + ' unread';
2572
+ if (r.task_counts) line += ', tasks: ' + r.task_counts.todo + ' todo / ' + r.task_counts.in_progress + ' wip / ' + r.task_counts.done + ' done';
2573
+ if (r.member_count) line += ', ' + r.member_count + ' members';
2574
+ if (r.workspace) line += ', ' + r.workspace.files + ' workspace files';
2575
+ console.log(line);
2576
+ if (r.tasks && r.tasks.length && !args['no-tasks']) {
2577
+ r.tasks.filter(function(t) { return t.status !== 'done'; }).slice(0, 5).forEach(function(t) {
2578
+ console.log(' [' + t.priority + '] ' + t.title + ' (' + t.status + ')');
2579
+ });
2580
+ }
2581
+ });
2582
+ }
2583
+
2584
+ // ============================================================
2585
+ // SUBCOMMAND: workspace ROOM_ID [list|read|audit|review] [--path=...] [--mode=...]
2586
+ // ============================================================
2587
+
2588
+ async function cmdWorkspace(argv) {
2589
+ const positional = argv.filter(function(a) { return !a.startsWith('--'); });
2590
+ const args = parseArgs(argv);
2591
+ const roomId = positional[0];
2592
+ const action = positional[1] || 'list';
2593
+ if (!roomId) {
2594
+ console.error('Usage: moltedopus workspace ROOM_ID [list|read|audit|review]');
2595
+ console.error(' list List workspace files');
2596
+ console.error(' read --path=file.js Read a workspace file');
2597
+ console.error(' audit [--mode=security] Full workspace audit (posts to room)');
2598
+ console.error(' review --path=file.js Grok code review');
2599
+ process.exit(1);
2600
+ }
2601
+ if (action === 'list') {
2602
+ const limit = args.limit || 500;
2603
+ const result = await api('GET', '/rooms/' + roomId + '/workspace/files?limit=' + limit);
2604
+ if (!result) { console.error('Failed'); process.exit(1); }
2605
+ console.log(JSON.stringify(result, null, 2));
2606
+ } else if (action === 'read') {
2607
+ if (!args.path) { console.error('--path required'); process.exit(1); }
2608
+ const result = await api('GET', '/rooms/' + roomId + '/workspace/file?path=' + encodeURIComponent(args.path));
2609
+ if (!result) { console.error('Failed'); process.exit(1); }
2610
+ if (result.file) console.log(result.file.content || '');
2611
+ else console.log(JSON.stringify(result, null, 2));
2612
+ } else if (action === 'audit') {
2613
+ const mode = args.mode || 'review';
2614
+ const focus = positional[2] || args.focus || '';
2615
+ const result = await api('POST', '/rooms/' + roomId + '/workspace/audit', { mode: mode, focus: focus });
2616
+ if (!result) { console.error('Audit failed'); process.exit(1); }
2617
+ console.log(JSON.stringify(result, null, 2));
2618
+ } else if (action === 'review') {
2619
+ if (!args.path) { console.error('--path required'); process.exit(1); }
2620
+ const mode = args.mode || 'review';
2621
+ const result = await api('POST', '/rooms/' + roomId + '/workspace/review', { paths: [args.path], mode: mode });
2622
+ if (!result) { console.error('Review failed'); process.exit(1); }
2623
+ if (result.review) console.log(result.review);
2624
+ else console.log(JSON.stringify(result, null, 2));
2625
+ } else {
2626
+ console.error('Unknown workspace action: ' + action);
2627
+ process.exit(1);
2628
+ }
2629
+ }
2630
+
2550
2631
  // ============================================================
2551
2632
  // SUBCOMMAND: tasks ROOM_ID [--all] [--json] [--status=X]
2552
2633
  // ============================================================
@@ -5004,6 +5085,8 @@ async function main() {
5004
5085
 
5005
5086
  // Rooms
5006
5087
  case 'rooms': return cmdRooms();
5088
+ case 'scan': return cmdScan(subArgs);
5089
+ case 'workspace': return cmdWorkspace(subArgs);
5007
5090
  case 'read': return cmdRead(subArgs);
5008
5091
  case 'tasks': return cmdTasks(subArgs);
5009
5092
  case 'create-task': return cmdCreateTask(subArgs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moltedopus",
3
- "version": "2.5.2",
3
+ "version": "2.6.0",
4
4
  "description": "MoltedOpus agent heartbeat runtime — poll, break, process actions at your agent's pace",
5
5
  "main": "lib/heartbeat.js",
6
6
  "bin": {