agent-rooms 0.1.6 → 0.1.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.
@@ -0,0 +1,312 @@
1
+ export function dashboardHtml() {
2
+ return String.raw `<!doctype html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <title>Agent Rooms Control</title>
8
+ <style>
9
+ :root {
10
+ color-scheme: light;
11
+ --bg: #f6f5f2;
12
+ --panel: #ffffff;
13
+ --ink: #181715;
14
+ --muted: #69645c;
15
+ --line: #ded8ce;
16
+ --green: #207a4c;
17
+ --amber: #9a6417;
18
+ --red: #a33a32;
19
+ --blue: #2364a8;
20
+ --gold: #a97913;
21
+ --shadow: 0 14px 35px rgba(24, 23, 21, 0.08);
22
+ font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
23
+ }
24
+ * { box-sizing: border-box; }
25
+ body { margin: 0; background: var(--bg); color: var(--ink); }
26
+ button, input, select { font: inherit; }
27
+ .shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
28
+ aside { border-right: 1px solid var(--line); padding: 24px 18px; background: #fbfaf8; }
29
+ main { padding: 26px; max-width: 1180px; width: 100%; }
30
+ .brand { font-size: 15px; font-weight: 800; letter-spacing: 0; margin-bottom: 4px; }
31
+ .sub { color: var(--muted); font-size: 13px; line-height: 1.4; margin-bottom: 22px; }
32
+ .nav { display: grid; gap: 6px; }
33
+ .nav button { border: 0; background: transparent; text-align: left; padding: 10px 11px; border-radius: 8px; color: var(--muted); cursor: pointer; }
34
+ .nav button.active { background: #ece7dd; color: var(--ink); font-weight: 700; }
35
+ .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
36
+ h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: 0; }
37
+ .meta { color: var(--muted); font-size: 13px; }
38
+ .banner { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--blue); box-shadow: var(--shadow); border-radius: 8px; padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
39
+ .banner.ready { border-left-color: var(--green); }
40
+ .banner strong { display: block; margin-bottom: 3px; }
41
+ .grid { display: grid; gap: 16px; }
42
+ .two { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); align-items: start; }
43
+ .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
44
+ .panel h2 { font-size: 16px; padding: 15px 16px 0; margin: 0; }
45
+ .step { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); align-items: center; }
46
+ .step:first-of-type { border-top: 0; }
47
+ .step.done { color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
48
+ .step.frontier { background: #f2f7fb; outline: 2px solid rgba(35, 100, 168, .18); outline-offset: -2px; }
49
+ .dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; background: var(--muted); }
50
+ .ready .dot { background: var(--green); }
51
+ .action_needed .dot { background: var(--amber); }
52
+ .blocked .dot { background: var(--red); }
53
+ .working .dot { background: var(--blue); animation: pulse 1.2s infinite; }
54
+ .attention .dot { background: var(--gold); }
55
+ .absent .dot { background: #a7a29a; }
56
+ @keyframes pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
57
+ .label { font-weight: 750; margin-bottom: 3px; }
58
+ .hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
59
+ .btn { border: 1px solid #25211b; background: #25211b; color: white; border-radius: 7px; min-height: 36px; padding: 0 12px; cursor: pointer; white-space: nowrap; }
60
+ .btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
61
+ .btn.gold { background: var(--gold); border-color: var(--gold); }
62
+ .btn:disabled { opacity: .45; cursor: not-allowed; }
63
+ .kv { display: grid; gap: 9px; padding: 15px 16px; }
64
+ .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 11px 16px; }
65
+ .row:first-child { border-top: 0; }
66
+ .pill { border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
67
+ .pill.ready { color: var(--green); border-color: rgba(32,122,76,.25); background: rgba(32,122,76,.08); }
68
+ .pill.warn { color: var(--amber); border-color: rgba(154,100,23,.25); background: rgba(154,100,23,.08); }
69
+ .pill.bad { color: var(--red); border-color: rgba(163,58,50,.25); background: rgba(163,58,50,.08); }
70
+ .activity { max-height: 460px; overflow: auto; padding: 8px 0; }
71
+ .event { padding: 10px 16px; border-top: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: #37332d; }
72
+ .event:first-child { border-top: 0; }
73
+ .form { display: grid; gap: 12px; padding: 16px; }
74
+ label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
75
+ input, select { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; background: #fff; color: var(--ink); }
76
+ pre { margin: 0; padding: 14px 16px; overflow: auto; border-top: 1px solid var(--line); font-size: 12px; background: #fbfaf8; }
77
+ .hidden { display: none !important; }
78
+ .toast { position: fixed; right: 18px; bottom: 18px; width: min(560px, calc(100vw - 36px)); background: #25211b; color: white; border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 13px; white-space: pre-wrap; }
79
+ @media (max-width: 850px) {
80
+ .shell { grid-template-columns: 1fr; }
81
+ aside { border-right: 0; border-bottom: 1px solid var(--line); }
82
+ main { padding: 18px; }
83
+ .two { grid-template-columns: 1fr; }
84
+ .top, .banner, .row { flex-direction: column; align-items: stretch; }
85
+ .step { grid-template-columns: 22px minmax(0, 1fr); }
86
+ .step .btn { grid-column: 2; justify-self: start; }
87
+ }
88
+ </style>
89
+ </head>
90
+ <body>
91
+ <div id="app"></div>
92
+ <script>
93
+ const token = new URLSearchParams(location.search).get("token") || "";
94
+ let snapshot = null;
95
+ let active = "home";
96
+ let autoFocused = false;
97
+ let userSelectedTab = false;
98
+ let toastTimer = null;
99
+ const app = document.getElementById("app");
100
+
101
+ function api(path, options = {}) {
102
+ return fetch(path, {
103
+ ...options,
104
+ headers: { "content-type": "application/json", "x-agent-rooms-token": token, ...(options.headers || {}) }
105
+ }).then(async (res) => {
106
+ const text = await res.text();
107
+ const body = text ? JSON.parse(text) : {};
108
+ if (!res.ok) throw new Error(body.error || res.statusText);
109
+ return body;
110
+ });
111
+ }
112
+
113
+ async function load() {
114
+ snapshot = await api("/api/readiness");
115
+ if (!autoFocused && !userSelectedTab && snapshot.readiness && !snapshot.readiness.nextAction && snapshot.readiness.listener.running) {
116
+ active = "activity";
117
+ autoFocused = true;
118
+ }
119
+ render();
120
+ }
121
+
122
+ async function act(action, payload = {}) {
123
+ if (action.id === "config.binding.focus") {
124
+ active = "agents";
125
+ render();
126
+ return;
127
+ }
128
+ if (action.id === "host.token.focus") {
129
+ active = "advanced";
130
+ render();
131
+ return;
132
+ }
133
+ if (action.manual) {
134
+ showToast(action.command || "Manual step required.");
135
+ return;
136
+ }
137
+ try {
138
+ const result = await api("/api/actions", { method: "POST", body: JSON.stringify({ action: action.id, host: action.host, payload: { ...(action.payload || {}), ...payload } }) });
139
+ snapshot = result.snapshot;
140
+ if (result.command) showToast(result.command);
141
+ else if (result.message) showToast(result.message);
142
+ render();
143
+ } catch (err) {
144
+ showToast("Action failed: " + err.message);
145
+ }
146
+ }
147
+
148
+ function statusText(status) {
149
+ return {
150
+ ready: "READY",
151
+ action_needed: "ACTION NEEDED",
152
+ blocked: "BLOCKED",
153
+ working: "WORKING",
154
+ attention: "ATTENTION",
155
+ absent: "NOT AVAILABLE"
156
+ }[status] || status;
157
+ }
158
+
159
+ function render() {
160
+ if (!token) {
161
+ app.innerHTML = "<main><h1>Blocked</h1><p>Missing dashboard token.</p></main>";
162
+ return;
163
+ }
164
+ const r = snapshot && snapshot.readiness;
165
+ if (!r) {
166
+ app.innerHTML = "<main><h1>Agent Rooms Control</h1><p>Loading local state...</p></main>";
167
+ return;
168
+ }
169
+ app.innerHTML = '<div class="shell"><aside>' + nav() + '</aside><main>' + page(r) + '</main></div>' + '<div id="toast" class="toast hidden"></div>';
170
+ bind();
171
+ }
172
+
173
+ function nav() {
174
+ return '<div class="brand">Agent Rooms Control</div><div class="sub">Local dashboard on 127.0.0.1. Buttons are driven by detected machine state.</div><div class="nav">' +
175
+ ["home:Readiness", "agents:Agents", "activity:Activity", "advanced:Advanced"].map((item) => {
176
+ const [id, label] = item.split(":");
177
+ return '<button data-tab="' + id + '" class="' + (active === id ? "active" : "") + '">' + label + '</button>';
178
+ }).join("") + '</div>';
179
+ }
180
+
181
+ function page(r) {
182
+ if (active === "agents") return agentsPage(r);
183
+ if (active === "activity") return activityPage();
184
+ if (active === "advanced") return advancedPage(r);
185
+ return homePage(r);
186
+ }
187
+
188
+ function header(title, r) {
189
+ return '<div class="top"><div><h1>' + title + '</h1><div class="meta">API ' + esc(r.apiBase) + ' - config ' + esc(r.configPath) + '</div></div><button class="btn secondary" data-refresh>Re-detect</button></div>';
190
+ }
191
+
192
+ function homePage(r) {
193
+ const next = r.nextAction;
194
+ const pair = snapshot.pendingPair
195
+ ? '<div class="banner"><div><strong>Approve this device: ' + esc(snapshot.pendingPair.user_code) + '</strong><div class="meta">The approval page was opened. After approving it in Agent Rooms, check status here.</div></div><button class="btn" data-action="' + encodeURIComponent(JSON.stringify({ id: "pair.poll", label: "Check approval" })) + '">Check approval</button></div>'
196
+ : "";
197
+ const banner = next
198
+ ? '<div class="banner"><div><strong>Next: ' + esc(next.label) + '</strong><div class="meta">' + esc(next.hint) + '</div></div>' + actionButton(next.action) + '</div>'
199
+ : '<div class="banner ready"><div><strong>All required steps are ready.</strong><div class="meta">Open Activity to watch wakes and errors.</div></div></div>';
200
+ return header("Readiness", r) + pair + banner + '<div class="grid two"><section class="panel"><h2>Path</h2>' + r.steps.map(stepHtml).join("") + '</section>' + sideStatus(r) + '</div>';
201
+ }
202
+
203
+ function stepHtml(step) {
204
+ const cls = "step " + step.status + (snapshot.readiness.nextAction && snapshot.readiness.nextAction.id === step.id ? " frontier" : "") + (step.status === "ready" ? " done" : "");
205
+ return '<div class="' + cls + '"><div class="dot"></div><div><div class="label">' + esc(step.label) + ' <span class="pill">' + statusText(step.status) + '</span></div><div class="hint">' + esc(step.hint) + '</div></div>' + actionButton(step.action) + '</div>';
206
+ }
207
+
208
+ function sideStatus(r) {
209
+ return '<section class="panel"><h2>Local Truth</h2>' +
210
+ '<div class="row"><span>Device</span><span class="pill ' + (r.device.paired ? "ready" : "warn") + '">' + (r.device.paired ? "PAIRED" : "NOT PAIRED") + '</span></div>' +
211
+ '<div class="row"><span>Listener<br><span class="meta">' + (r.listener.running ? 'Serving ' + esc(r.listener.servingCount) + ' instance(s)' : 'Stopped') + '</span></span><span>' + listenerControls(r) + '</span></div>' +
212
+ '<div class="row"><span>Dashboard</span><span class="pill ' + (r.dashboard.updateAvailable ? "warn" : "ready") + '">' + (r.dashboard.updateAvailable ? "UPDATE AVAILABLE" : "UP TO DATE") + '</span></div>' +
213
+ Object.values(r.hosts).map((h) => '<div class="row"><span>' + esc(h.label) + '<br><span class="meta">' + esc(h.version || h.detail) + '</span></span><span class="pill ' + (!h.detected ? "bad" : h.versionOk ? "ready" : "warn") + '">' + (!h.detected ? "MISSING" : h.versionOk ? "DETECTED" : "UPDATE") + '</span></div>').join("") +
214
+ '<h2>Diagnose</h2>' + r.diagnostics.map((d) => '<div class="row"><span><strong>' + esc(d.symptom) + '</strong><br><span class="meta">' + esc(d.cause) + '</span></span>' + actionButton(d.action, "secondary") + '</div>').join("") +
215
+ '</section>';
216
+ }
217
+
218
+ function listenerControls(r) {
219
+ if (r.listener.running) {
220
+ return actionButton({ id: "listener.restart", label: "Restart" }, "secondary") + ' ' + actionButton({ id: "listener.stop", label: "Stop" }, "secondary");
221
+ }
222
+ if (r.device.paired && r.agents.some((a) => !a.paused)) {
223
+ return actionButton({ id: "listener.start", label: "Start" }, "secondary");
224
+ }
225
+ return '<span class="pill warn">WAITING</span>';
226
+ }
227
+
228
+ function agentsPage(r) {
229
+ return header("Agents", r) + '<div class="grid two"><section class="panel"><h2>Bindings</h2>' +
230
+ (r.agents.length ? r.agents.map(agentRow).join("") : '<div class="kv meta">No bindings yet.</div>') +
231
+ '</section><section class="panel"><h2>Add / Replace Binding</h2><form class="form" id="bindingForm">' +
232
+ '<label>Agent plate<input name="agent" placeholder="BRNL-AGT-XXXXXXXX" required /></label>' +
233
+ '<label>Room id(s)<input name="rooms" placeholder="room_1, room_2" required /></label>' +
234
+ '<label>Workspace path<input name="workspace" placeholder="D:\\\\your-project" required /></label>' +
235
+ '<label>Host<select name="host"><option value="claude_code">Claude Code</option><option value="codex">Codex</option></select></label>' +
236
+ '<button class="btn" type="submit">Save binding</button></form></section></div>';
237
+ }
238
+
239
+ function agentRow(a) {
240
+ const status = a.paused ? "PAUSED" : a.workspaceExists ? "READY" : "PATH MISSING";
241
+ const cls = a.paused ? "warn" : a.workspaceExists ? "ready" : "warn";
242
+ const pauseAction = a.paused
243
+ ? { id: "agent.resume", label: "Resume", payload: { agent: a.agent } }
244
+ : { id: "agent.pause", label: "Pause", payload: { agent: a.agent } };
245
+ const removeAction = { id: "config.binding.remove", label: "Remove", payload: { agent: a.agent, workspace: a.workspace } };
246
+ const cost = a.host === "codex" ? '<br><span class="meta">Waking this agent uses your ChatGPT/Codex account usage.</span>' : "";
247
+ return '<div class="row"><span><strong>' + esc(a.agent) + '</strong><br><span class="meta">' + esc(a.host) + ' - ' + esc(a.workspace) + '<br>rooms: ' + esc(a.rooms.join(", ")) + '</span>' + cost + '</span><span><span class="pill ' + cls + '">' + status + '</span><br>' + actionButton(pauseAction, "secondary") + ' ' + actionButton(removeAction, "secondary") + '</span></div>';
248
+ }
249
+
250
+ function activityPage() {
251
+ const rows = (snapshot.activity || []).slice().reverse().map((e) => '<div class="event">[' + new Date(e.at).toLocaleTimeString() + '] ' + esc(e.level.toUpperCase()) + ' ' + esc(e.message) + '</div>').join("");
252
+ return header("Activity", snapshot.readiness) + '<section class="panel"><h2>Live feed</h2><div class="activity">' + (rows || '<div class="event">No events yet.</div>') + '</div></section>';
253
+ }
254
+
255
+ function advancedPage(r) {
256
+ return header("Advanced", r) + '<div class="grid two"><section class="panel"><h2>Commands</h2><pre>' + esc(r.advanced.commands.join("\n")) + '</pre><h2>Codex Bearer Token</h2><form class="form" id="tokenForm"><label>Agent Rooms token<input name="token" type="password" placeholder="Paste token for Codex MCP sessions" /></label><button class="btn" type="submit">Save token</button><button class="btn secondary" type="button" data-action="' + encodeURIComponent(JSON.stringify({ id: "host.clearToken", label: "Clear token", host: "codex", payload: { host: "codex" } })) + '">Clear token</button><div class="meta">Stored locally in the dashboard config; not shown back in the UI.</div></form></section><section class="panel"><h2>Raw Config</h2><pre>' + esc(JSON.stringify(r.advanced.rawConfig, null, 2)) + '</pre></section></div>';
257
+ }
258
+
259
+ function actionButton(action, style = "") {
260
+ if (!action) return "";
261
+ return '<button class="btn ' + style + '" data-action="' + encodeURIComponent(JSON.stringify(action)) + '">' + esc(action.label) + '</button>';
262
+ }
263
+
264
+ function bind() {
265
+ document.querySelectorAll("[data-tab]").forEach((btn) => btn.addEventListener("click", () => { userSelectedTab = true; active = btn.dataset.tab; render(); }));
266
+ document.querySelectorAll("[data-refresh]").forEach((btn) => btn.addEventListener("click", load));
267
+ document.querySelectorAll("[data-action]").forEach((btn) => btn.addEventListener("click", () => act(JSON.parse(decodeURIComponent(btn.dataset.action)))));
268
+ const form = document.getElementById("bindingForm");
269
+ if (form) form.addEventListener("submit", (event) => {
270
+ event.preventDefault();
271
+ const data = new FormData(form);
272
+ act({ id: "config.binding.save", label: "Save binding" }, {
273
+ agent: String(data.get("agent") || ""),
274
+ rooms: String(data.get("rooms") || ""),
275
+ workspace: String(data.get("workspace") || ""),
276
+ host: String(data.get("host") || "claude_code")
277
+ });
278
+ });
279
+ const tokenForm = document.getElementById("tokenForm");
280
+ if (tokenForm) tokenForm.addEventListener("submit", (event) => {
281
+ event.preventDefault();
282
+ const data = new FormData(tokenForm);
283
+ act({ id: "host.saveToken", label: "Save token", host: "codex" }, {
284
+ host: "codex",
285
+ token: String(data.get("token") || "")
286
+ });
287
+ });
288
+ }
289
+
290
+ function showToast(message) {
291
+ const el = document.getElementById("toast");
292
+ if (!el) return;
293
+ el.textContent = message;
294
+ el.classList.remove("hidden");
295
+ clearTimeout(toastTimer);
296
+ toastTimer = setTimeout(() => el.classList.add("hidden"), 9000);
297
+ }
298
+
299
+ function esc(value) {
300
+ return String(value ?? "").replace(/[&<>"']/g, (ch) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }[ch]));
301
+ }
302
+
303
+ window.addEventListener("focus", load);
304
+ setInterval(load, 10000);
305
+ const events = new EventSource("/api/events?token=" + encodeURIComponent(token));
306
+ events.onmessage = (event) => { snapshot = JSON.parse(event.data); render(); };
307
+ load().catch((err) => { app.innerHTML = "<main><h1>Unable to load</h1><p>" + esc(err.message) + "</p></main>"; });
308
+ </script>
309
+ </body>
310
+ </html>`;
311
+ }
312
+ //# sourceMappingURL=ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../src/dashboard/ui.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoTX,CAAC;AACT,CAAC"}
package/dist/hosts.js CHANGED
@@ -5,7 +5,7 @@
5
5
  //
6
6
  // Safety (§9, §10): we never pass --dangerously-skip-permissions. Claude is
7
7
  // constrained to the room MCP tools + read-only workspace ops via --allowedTools;
8
- // Codex relies on its sandbox (--full-auto). A --max-turns cap bounds runaway loops.
8
+ // Codex runs with workspace-write sandboxing. A --max-turns cap bounds runaway loops.
9
9
  import { spawnSync } from "node:child_process";
10
10
  import { existsSync } from "node:fs";
11
11
  import { homedir } from "node:os";
@@ -85,7 +85,7 @@ export const claudeAdapter = {
85
85
  if (spec.sessionId) {
86
86
  args.push("--resume", spec.sessionId);
87
87
  }
88
- return { command: this.bin, args, cwd: spec.workspace, stdin: spec.prompt };
88
+ return { command: this.bin, args, cwd: spec.workspace, stdin: spec.prompt, env: spec.env };
89
89
  },
90
90
  buildMcpAdd(apiBase) {
91
91
  return { command: this.bin, args: ["mcp", "add", "--transport", "http", "--scope", "user", "agent-rooms", `${apiBase}/mcp`], cwd: process.cwd() };
@@ -104,17 +104,21 @@ export const codexAdapter = {
104
104
  // TODO: confirm the Codex on-disk skills dir before auto-installing there.
105
105
  skillDir: null,
106
106
  buildWake(spec) {
107
- // `codex exec` is non-interactive; --full-auto runs in its sandbox with
108
- // auto-approval. The mention IS the prompt (Codex resume needs a prompt).
109
- const base = ["exec"];
107
+ // `codex exec -` reads the prompt from stdin. Keep the multi-line wake
108
+ // prompt out of argv so Windows shell resolution cannot split it.
109
+ const base = ["exec", "--json", "--skip-git-repo-check", "--sandbox", "workspace-write"];
110
110
  if (spec.sessionId) {
111
111
  base.push("resume", spec.sessionId);
112
112
  }
113
- base.push("--json", "--skip-git-repo-check", "--full-auto", spec.prompt);
114
- return { command: this.bin, args: base, cwd: spec.workspace };
113
+ base.push("-");
114
+ return { command: this.bin, args: base, cwd: spec.workspace, stdin: spec.prompt, env: spec.env };
115
115
  },
116
116
  buildMcpAdd(apiBase) {
117
- return { command: this.bin, args: ["mcp", "add", "agent-rooms", "--url", `${apiBase}/mcp`], cwd: process.cwd() };
117
+ return {
118
+ command: this.bin,
119
+ args: ["mcp", "add", "agent-rooms", "--url", `${apiBase}/mcp`, "--bearer-token-env-var", "AGENT_ROOMS_TOKEN"],
120
+ cwd: process.cwd()
121
+ };
118
122
  },
119
123
  buildMcpRemove() {
120
124
  return { command: this.bin, args: ["mcp", "remove", "agent-rooms"], cwd: process.cwd() };
package/dist/hosts.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"hosts.js","sourceRoot":"","sources":["../src/hosts.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,+DAA+D;AAC/D,8DAA8D;AAC9D,4EAA4E;AAC5E,EAAE;AACF,4EAA4E;AAC5E,kFAAkF;AAClF,qFAAqF;AAErF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqCjC,2EAA2E;AAC3E,iFAAiF;AACjF,kFAAkF;AAClF,uEAAuE;AACvE,gFAAgF;AAChF,iFAAiF;AACjF,MAAM,UAAU,GAAG;IACjB,kCAAkC;IAClC,6BAA6B;IAC7B,gCAAgC;IAChC,gCAAgC;IAChC,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC;AAEF,SAAS,cAAc,CAAC,MAAc,EAAE,MAAgB;IACtD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QACpC,IAAI,GAA4B,CAAC;QACjC,IAAI,CAAC;YACH,GAAG,GAAG,IAAI,CAA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