@hanzlaa/rcode 4.4.4 → 4.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 (43) hide show
  1. package/AGENTS.md +11 -4
  2. package/CLAUDE.md +11 -4
  3. package/CONTRIBUTING.md +6 -1
  4. package/cli/doctor.js +122 -0
  5. package/cli/index.js +4 -0
  6. package/cli/install.js +8 -0
  7. package/cli/lib/namespace-migrate.cjs +216 -0
  8. package/cli/migrate-namespace.js +61 -0
  9. package/cli/update.js +19 -0
  10. package/dist/rcode.js +215 -208
  11. package/package.json +14 -12
  12. package/rcode/agents/rcode-mariam.md +6 -0
  13. package/rcode/agents/rcode-sadiq.md +6 -0
  14. package/rcode/agents/rcode-waleed.md +6 -0
  15. package/rcode/bin/lib/brain.cjs +353 -0
  16. package/rcode/bin/lib/gitignore.cjs +126 -0
  17. package/rcode/bin/lib/memory-drift.cjs +237 -0
  18. package/rcode/bin/lib/memory-select.cjs +263 -0
  19. package/rcode/bin/lib/progress.cjs +440 -0
  20. package/rcode/bin/lib/state-reader.cjs +127 -0
  21. package/rcode/bin/lib/summary.cjs +82 -0
  22. package/rcode/bin/rcode-hooks.cjs +230 -64
  23. package/rcode/bin/rcode-tools.cjs +106 -985
  24. package/rcode/data/intent-table.json +19 -19
  25. package/rcode/skills/actions/4-implementation/rcode-herdr-orchestration/templates/heartbeat.sh +0 -0
  26. package/rcode/skills/agents/mariam-marketing/SKILL.md +1 -0
  27. package/rcode/skills/agents/sadiq-analyst/SKILL.md +1 -0
  28. package/rcode/skills/agents/waleed-architect/SKILL.md +1 -0
  29. package/rcode/templates/memory/INDEX.md +6 -1
  30. package/rcode/templates/settings-hooks.json +12 -1
  31. package/rcode/workflows/council.md +29 -1
  32. package/rcode/workflows/do.md +2 -2
  33. package/rcode/workflows/enable-hooks.md +3 -2
  34. package/rcode/workflows/new-project-roadmap.md +2 -2
  35. package/server/dashboard.js +6 -3
  36. package/server/lib/html/client/components/App.js +1 -1
  37. package/server/lib/html/client/components/OrchPanel.js +2 -2
  38. package/server/lib/html/client/components/XtermPanel.js +98 -23
  39. package/server/lib/html/client/orchestrator.js +28 -15
  40. package/server/lib/html/client/views/OrchestrationView.js +247 -169
  41. package/server/lib/html/css.js +596 -227
  42. package/server/lib/html/shell.js +9 -3
  43. package/server/orchestrator.js +3 -4
@@ -6,8 +6,14 @@ const { renderClientJs } = require('./client');
6
6
 
7
7
  function esc(s) { return String(s || '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); }
8
8
 
9
- function renderHtml(state, orchToken) {
9
+ function renderHtml(state, orchToken, orchPort) {
10
10
  const projectName = state.projectName || 'No project initialized';
11
+ // #969 — the client used to hardcode port 7718 for the orchestrator API.
12
+ // A dashboard started with ORCH_PORT set (e.g. to test in isolation from a
13
+ // production instance) would silently talk to the wrong orchestrator. The
14
+ // actual port is injected here — both into the CSP connect-src allowlist
15
+ // and into window.__ORCH_PORT__ for orchestrator.js to read at runtime.
16
+ const port = parseInt(orchPort, 10) || 7718;
11
17
 
12
18
  // Agent roster moved to server/lib/html/client/agents-data.js (Sprint 31.3).
13
19
  // AgentsView.js renders it client-side; shell.js no longer needs it.
@@ -17,7 +23,7 @@ function renderHtml(state, orchToken) {
17
23
  <head>
18
24
  <meta charset="UTF-8">
19
25
  <meta name="viewport" content="width=device-width, initial-scale=1">
20
- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data:; connect-src 'self' http://localhost:7718 http://127.0.0.1:7718 ws: wss:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'">
26
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data:; connect-src 'self' http://localhost:${port} http://127.0.0.1:${port} ws: wss:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'">
21
27
  <meta http-equiv="X-Content-Type-Options" content="nosniff">
22
28
  <meta name="referrer" content="strict-origin-when-cross-origin">
23
29
  <title>Majlis — ${esc(projectName)}</title>
@@ -26,7 +32,7 @@ function renderHtml(state, orchToken) {
26
32
  <script src="https://cdn.jsdelivr.net/npm/marked@18.0.4/lib/marked.umd.js" integrity="sha384-8RA8Ah4c9upJmKfg5nH01OgjZoQ3mRX+ngrKYWXQYj2dHYxFqYz8POSlii33f0wB" crossorigin="anonymous"><\/script>
27
33
  <script src="https://cdn.jsdelivr.net/npm/xterm@5.3.0/lib/xterm.js" integrity="sha384-/nfmYPUzWMS6v2atn8hbljz7NE0EI1iGx34lJaNzyVjWGDzMv+ciUZUeJpKA3Glc" crossorigin="anonymous"><\/script>
28
34
  <script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.js" integrity="sha384-AQLWHRKAgdTxkolJcLOELg4E9rE89CPE2xMy3tIRFn08NcGKPTsELdvKomqji+DL" crossorigin="anonymous"><\/script>
29
- <script>window.__ORCH_TOKEN__ = ${JSON.stringify(orchToken || '')};<\/script>
35
+ <script>window.__ORCH_TOKEN__ = ${JSON.stringify(orchToken || '')}; window.__ORCH_PORT__ = ${port};<\/script>
30
36
  ${renderCss()}
31
37
  </head>
32
38
  <body>
@@ -791,10 +791,9 @@ const server = http.createServer(async (req, res) => {
791
791
  res.writeHead(404); res.end('Not found');
792
792
  });
793
793
 
794
- server.on('error', (err) => {
795
- console.error('[orchestrator] server error:', err.message);
796
- process.exit(1);
797
- });
794
+ // NOTE: the single server 'error' handler lives below the WebSocket block —
795
+ // a second handler here would fire first and exit(1) before the EADDRINUSE
796
+ // exit(2) path runs, re-triggering the dashboard's 3s respawn loop (#964).
798
797
 
799
798
  // WebSocket upgrade — authenticate, validate the storyId, then hand off.
800
799
  if (WebSocketServer) {