@hanzlaa/rcode 4.10.4 → 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.4",
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": {
@@ -5,11 +5,21 @@ Run this check at the very start of any workflow that needs project state.
5
5
  ## Step: Detect project initialization
6
6
 
7
7
  ```bash
8
- test -f .rcode/config.yaml && echo "rcode-ready" || echo "rcode-not-initialized"
8
+ if [ ! -f .rcode/config.yaml ]; then
9
+ echo "rcode-not-initialized"
10
+ elif grep -q "Generated by install" .rcode/config.yaml 2>/dev/null && [ ! -f .rcode/JOURNEY.md ]; then
11
+ echo "rcode-seeded-not-configured"
12
+ else
13
+ echo "rcode-ready"
14
+ fi
9
15
  ```
10
16
 
17
+ **Why the middle case matters (confirmed live, issue class closed by #1034-#1036's fixes):** `rcode install` pre-seeds `config.yaml` with installer defaults (`user_name: "$USER"`, `mode: "guided"`, etc.) so the tool has something to read before the user ever runs `/rcode-init`. A plain `test -f .rcode/config.yaml` check can't tell "the user was actually asked their preferences" apart from "the installer wrote plausible-looking defaults nobody confirmed" — both produce a config.yaml that exists. `/rcode-init` itself distinguishes these correctly (via its own `JOURNEY.md`-presence check), but every OTHER workflow that dispatches through this lightweight guard (e.g. `/rcode-do`) was checking existence only, so a user routed entirely through `/rcode-do` could go through many sessions on installer defaults, never once asked their name/language/mode/model-profile — while a user who happened to run `/rcode-init` directly got asked properly. That inconsistency is now closed: `rcode-seeded-not-configured` routes to the same question flow as `rcode-not-initialized` below, just skipping the bin-bootstrap step (already done by install).
18
+
11
19
  **If `rcode-ready`:** continue with the workflow normally.
12
20
 
21
+ **If `rcode-seeded-not-configured`:** skip Step 1 (bin bootstrap — install already did this) and go straight to Step 2 (ask the 5 config questions) below, then continue with Steps 3-6 as written (Step 3's `.rcode/config.yaml` write overwrites the installer-seeded stub with real answers).
22
+
13
23
  **If `rcode-not-initialized`:** the user has never set up rcode for this project. Do NOT fail or continue blindly. Run the project init flow inline before proceeding:
14
24
 
15
25
  ---
@@ -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(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`);