@hanzlaa/rcode 4.10.5 → 4.10.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzlaa/rcode",
3
- "version": "4.10.5",
3
+ "version": "4.10.6",
4
4
  "description": "rcode — the AI team that never forgets. Persistent memory, specialist agents, and slash commands for AI IDEs. Works in Claude Code, Cursor, Gemini, VS Code, and Antigravity.",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
@@ -54,6 +54,14 @@ independent agents.
54
54
  fires when `/loop` is active — clarify the heartbeat path with the user first.
55
55
  6. **Ignore stray buffer text in panes.** Leftover user text at an idle prompt is NOT
56
56
  an agent question — do not Enter it.
57
+ 7. **First message to every newly spawned agent starts with `/rcode-do`.** After `cld`
58
+ launches in a pane and the agent is ready, the very first line sent via
59
+ `herdr pane send-text` must be the literal `/rcode-do <task description>`, followed by
60
+ the rest of the task context (worktree path, branch, scope). This routes the agent's
61
+ first action through rcode's command picker instead of a hand-rolled instruction, so
62
+ ad-hoc orchestration prompts stay consistent with the rest of the toolset. Applies to
63
+ both Mode 1 (single-shot) and Mode 2 (wave) dispatch — not to follow-up messages sent
64
+ later in the same pane.
57
65
 
58
66
  ---
59
67
 
@@ -95,7 +103,8 @@ Use when work is bounded and can finish in one batch.
95
103
  2. Create worktrees: `git worktree add ../sm-worktrees/$A -b audit-$A master` for each area.
96
104
  3. Create tab + split panes, one per worktree.
97
105
  4. Launch `cld` in every pane (`send-text "cld"` + `send-keys Enter`). Sleep 7s after.
98
- 5. Send each agent a self-contained prompt with worktree path, branch, and task.
106
+ 5. Send each agent a self-contained prompt with worktree path, branch, and task
107
+ the first line must be the literal `/rcode-do <task description>` (Golden rule 7).
99
108
  - Audits: diagnose-only first. Fixes: incremental edits, no rewrites, commit each fix.
100
109
  6. Monitor: `herdr pane list` every ~2 min. Unblock stuck panes via `send-keys`/`send-text`.
101
110
  7. Merge back: `git add -f .planning/audits/*.md && git commit` inside each worktree, then
@@ -5,6 +5,8 @@ Use this as the body of `herdr pane send-text` when dispatching each agent in a
5
5
  ---
6
6
 
7
7
  ```
8
+ /rcode-do fix top pending items from <AUDIT_DOC_PATH> on branch <BRANCH_NAME>
9
+
8
10
  You are in an isolated worktree at <WORKTREE_PATH> on branch <BRANCH_NAME>. <REPO_NAME> repo.
9
11
 
10
12
  YOUR PARENT BRANCH IS <INTEGRATION_BRANCH> (NOT master). Your branch was forked from <INTEGRATION_BRANCH>. When you finish, the orchestrator will merge your branch INTO <INTEGRATION_BRANCH> (not master). Master stays untouched throughout the campaign.
@@ -35,7 +35,7 @@ const { handleApiState, handleApiFiles, handleApiFile, handleApiHierarchy, handl
35
35
  const { renderHtml } = require('./lib/html/shell');
36
36
 
37
37
  // ---------- Configuration ----------
38
- const PORT = parseInt(process.env.PORT || '7717', 10);
38
+ let PORT = parseInt(process.env.PORT || '7717', 10);
39
39
  // #969 — the orchestrator's actual port, injected into the client so it never
40
40
  // has to hardcode 7718. Defaults match orchestrator.js's own default.
41
41
  const ORCH_PORT = parseInt(process.env.ORCH_PORT || '7718', 10);
@@ -191,6 +191,23 @@ function handleRequest(req, res) {
191
191
  res.end('Not found');
192
192
  }
193
193
 
194
+ // If PORT is already taken (e.g. another dashboard instance is running),
195
+ // retry on the next port up rather than crashing on an unhandled 'error' event.
196
+ const MAX_PORT_ATTEMPTS = 20;
197
+ let portAttempts = 0;
198
+
199
+ server.on('error', err => {
200
+ if (err.code === 'EADDRINUSE' && portAttempts < MAX_PORT_ATTEMPTS) {
201
+ portAttempts++;
202
+ console.log(`[dashboard] port ${PORT} in use, trying ${PORT + 1}...`);
203
+ PORT++;
204
+ server.listen(PORT, '127.0.0.1');
205
+ return;
206
+ }
207
+ console.error('[dashboard] server error:', err.message);
208
+ process.exit(1);
209
+ });
210
+
194
211
  server.listen(PORT, '127.0.0.1', () => {
195
212
  console.log(`\n🕌 Majlis (مجلس) — rcode Dashboard`);
196
213
  console.log(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);