crewbus 11.3.0 → 11.3.1
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/CHANGELOG.md +18 -0
- package/README.md +2 -2
- package/bin/lib/web.js +193 -15
- package/docs/VERSION_SKEW.md +1 -1
- package/documentation.html +4 -3
- package/index.html +3 -3
- package/package.json +1 -1
- package/docs/LEAD_ASSIGN.md +0 -3
- package/docs/M1_CLI_DRAFT.md +0 -175
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 11.3.1
|
|
4
|
+
|
|
5
|
+
Mobile pairing over LAN and cleartext HTTP route support.
|
|
6
|
+
|
|
7
|
+
- `crewbus web` now automatically detects active non-loopback IPv4 network
|
|
8
|
+
interfaces (e.g. `http://192.168.x.x:port`) and embeds them into one-click
|
|
9
|
+
mobile pairing QR codes (`crewbus://pair`) and `GET /api/routes`, so phone
|
|
10
|
+
apps scanning the QR code receive valid, reachable routes.
|
|
11
|
+
- `crewbus web` binds to `0.0.0.0` by default so devices on the local Wi-Fi
|
|
12
|
+
network can connect, while maintaining loopback (`127.0.0.1`) display and
|
|
13
|
+
browser launch formatting.
|
|
14
|
+
- `crewbus web` implements `GET /healthz` and `POST /api/pair/exchange` to
|
|
15
|
+
support direct mobile pairing and device credential provisioning without
|
|
16
|
+
requiring a standalone relay server.
|
|
17
|
+
- Added `withCleartextTraffic` config plugin to `apps/mobile/app.json` so
|
|
18
|
+
standalone Android APKs permit cleartext HTTP traffic to local LAN relays
|
|
19
|
+
and dashboards.
|
|
20
|
+
|
|
3
21
|
## 11.3.0
|
|
4
22
|
|
|
5
23
|
Standard package polish and public npm publishing.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# crewbus v11.3.
|
|
1
|
+
# crewbus v11.3.1 — DM bus
|
|
2
2
|
|
|
3
3
|
[](https://github.com/eamonpluto/crewbus/actions/workflows/ci.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/crewbus)
|
|
@@ -60,7 +60,7 @@ env overrides below.)
|
|
|
60
60
|
Layout: `board.json`, `agents/<name>.json`, `dm/<recipient>/<id>.json`,
|
|
61
61
|
`delivered/<recipient>/<id>.json` (push markers, written by the plugin).
|
|
62
62
|
|
|
63
|
-
Versions: `package.json` (currently 11.3.
|
|
63
|
+
Versions: `package.json` (currently 11.3.1) is the source of truth for the
|
|
64
64
|
release version. `board.json`'s `version: 2` is the **board schema version**
|
|
65
65
|
(a different number on purpose — do not "align" them). New to the project?
|
|
66
66
|
Start with `docs/QUICKSTART.md` (5 minutes).
|
package/bin/lib/web.js
CHANGED
|
@@ -16,17 +16,18 @@ import fs from "node:fs";
|
|
|
16
16
|
import { spawn } from "node:child_process";
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import http from "node:http";
|
|
19
|
+
import os from "node:os";
|
|
19
20
|
import { fileURLToPath } from "node:url";
|
|
20
|
-
import { boardDir, requireBoard, getFlag, fail, writeJson, listJson, cleanWebName, readJson, readBoardMeta, writeBoardMeta, gitRevForBoard, newId, MAX_SPAWN, MAX_BODY_CHARS } from "./store.js";
|
|
21
|
-
import { readAgent, agentTokenMatches, authorizeCheck, ensureOrchestrator, mintToken, newSalt, hashToken, touchAgent } from "./identity.js";
|
|
21
|
+
import { boardDir, requireBoard, getFlag, fail, writeJson, listJson, cleanWebName, readJson, readBoardMeta, writeBoardMeta, gitRevForBoard, newId, MAX_SPAWN, MAX_BODY_CHARS, writeExclusiveJson } from "./store.js";
|
|
22
|
+
import { readAgent, agentTokenMatches, authorizeCheck, ensureOrchestrator, mintToken, newSalt, hashToken, touchAgent, timingSafeEqualStr } from "./identity.js";
|
|
22
23
|
import { readDMs, readVisible, ackedIds, ackedIdSet, findMessageById, deliverDMs, parseRecipients } from "./mail.js";
|
|
23
24
|
import { workerStatus, pidAlive, killWorkers, bootWorker, buildSpawnPrompt, buildSpawnTarget, formatSpawnCmd, installCliToUserPath, ensureBoardCliShim, buildOrchestratorPrompt, provisionOrchestrator,
|
|
24
25
|
ORCHESTRATOR_NAME, isPidStale, parseModelList, modelForIndex } from "./spawn.js";
|
|
25
26
|
import { groupTelemetryData, collectBatch, gatherTelemetry, listBatches } from "./groups.js";
|
|
26
27
|
import { httpJson } from "./sync.js";
|
|
27
28
|
import { readChainRecords, verifyChainRecords, appendChainRecord, readHold, readBoardQuotas } from "./export.js";
|
|
28
|
-
import { launchDrivers, detectHarnessBinaries, validateLaunchPlan, advertiseEnv, buildPairUrl, HARNESS_MODELS, getDiscoveredModels, refreshDiscoveredModels } from "./launch.js";
|
|
29
|
-
import { newPairToken, pairingPath, readRelayState } from "./relay.js";
|
|
29
|
+
import { launchDrivers, detectHarnessBinaries, validateLaunchPlan, advertiseEnv, buildPairUrl, HARNESS_MODELS, getDiscoveredModels, refreshDiscoveredModels, PAIR_SCOPES } from "./launch.js";
|
|
30
|
+
import { newPairToken, pairingPath, readRelayState, newDeviceCred, devicePath } from "./relay.js";
|
|
30
31
|
|
|
31
32
|
export function escapeHtml(s) {
|
|
32
33
|
return String(s === undefined || s === null ? "" : s).replace(/[&<>"']/g, (c) => ({
|
|
@@ -2573,10 +2574,21 @@ export async function handleWebDashboardRoute(req, res, url, d) {
|
|
|
2573
2574
|
fs.mkdirSync(path.join(d.root, "pairing"), { recursive: true });
|
|
2574
2575
|
writeJson(pairingPath(d, doc.tokenHash), doc);
|
|
2575
2576
|
try { appendChainRecord(d, ORCHESTRATOR_NAME, "pair", { label: "dashboard-oneclick", expiresAt: doc.expiresAt }); } catch {}
|
|
2576
|
-
const
|
|
2577
|
-
const
|
|
2577
|
+
const relayDoc = readRelayState(d);
|
|
2578
|
+
const envId = (relayDoc && relayDoc.envId) || ("board:" + path.basename(d.root));
|
|
2579
|
+
let routes = (relayDoc && Array.isArray(relayDoc.advertisedRoutes) && relayDoc.advertisedRoutes.length > 0)
|
|
2580
|
+
? relayDoc.advertisedRoutes
|
|
2581
|
+
: [];
|
|
2582
|
+
if (routes.length === 0) {
|
|
2583
|
+
const port = req.socket.localPort || 8471;
|
|
2584
|
+
routes = localNetworkRoutes(port);
|
|
2585
|
+
}
|
|
2586
|
+
if (routes.length === 0 && req.headers.host && !req.headers.host.startsWith("localhost") && !req.headers.host.startsWith("127.")) {
|
|
2587
|
+
routes.push(`http://${req.headers.host}`);
|
|
2588
|
+
}
|
|
2589
|
+
const pairUrl = buildPairUrl({ envId, routes, caps: ["hlc", "tombstones", "channels", "revoked", "holds", "launch"], pairToken: token });
|
|
2578
2590
|
res.writeHead(200, { "content-type": "application/json; charset=utf-8", "cache-control": "no-store" });
|
|
2579
|
-
res.end(JSON.stringify({ ok: true, pairUrl, expiresAt: doc.expiresAt, envId }));
|
|
2591
|
+
res.end(JSON.stringify({ ok: true, pairUrl, expiresAt: doc.expiresAt, envId, routes }));
|
|
2580
2592
|
} catch (err) {
|
|
2581
2593
|
res.writeHead(500, { "content-type": "application/json; charset=utf-8", "cache-control": "no-store" });
|
|
2582
2594
|
res.end(JSON.stringify({ ok: false, error: String((err && err.message) || err) }));
|
|
@@ -2586,17 +2598,32 @@ export async function handleWebDashboardRoute(req, res, url, d) {
|
|
|
2586
2598
|
return false;
|
|
2587
2599
|
}
|
|
2588
2600
|
|
|
2601
|
+
export function localNetworkRoutes(port) {
|
|
2602
|
+
const routes = [];
|
|
2603
|
+
try {
|
|
2604
|
+
const ifaces = os.networkInterfaces();
|
|
2605
|
+
for (const list of Object.values(ifaces)) {
|
|
2606
|
+
for (const item of list || []) {
|
|
2607
|
+
if (item.family === "IPv4" && !item.internal && item.address && !item.address.startsWith("169.254.") && !item.address.startsWith("127.")) {
|
|
2608
|
+
routes.push(`http://${item.address}:${port}`);
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
} catch {}
|
|
2613
|
+
return routes;
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2589
2616
|
export async function cmdWeb(args) {
|
|
2590
2617
|
const root = boardDir(args);
|
|
2591
2618
|
const d = requireBoard(root);
|
|
2592
2619
|
ensureBoardCliShim(d);
|
|
2593
|
-
const host = getFlag(args, "--host") || "
|
|
2620
|
+
const host = getFlag(args, "--host") || "0.0.0.0";
|
|
2594
2621
|
const port = Number(getFlag(args, "--port") || 0);
|
|
2595
2622
|
// Same local auto-provision as `serve`: the board's single orchestrator is
|
|
2596
2623
|
// ensured on boot (minted on first use, token at logs/orchestrator.token).
|
|
2597
2624
|
try { ensureOrchestrator(d); } catch {}
|
|
2598
2625
|
if (!(port >= 0 && port < 65536)) fail("--port must be 0-65535 (0 = random)");
|
|
2599
|
-
if (host !== "127.0.0.1" && host !== "localhost" && host !== "::1") {
|
|
2626
|
+
if (host !== "127.0.0.1" && host !== "localhost" && host !== "::1" && host !== "0.0.0.0") {
|
|
2600
2627
|
process.stderr.write(`crewbus: warning: binding non-local ${host} — the dashboard has no auth, anyone who can reach it can read the board\n`);
|
|
2601
2628
|
}
|
|
2602
2629
|
const server = http.createServer((req, res) => {
|
|
@@ -2616,6 +2643,144 @@ export async function cmdWeb(args) {
|
|
|
2616
2643
|
}
|
|
2617
2644
|
if (await handleWebDashboardRoute(req, res, url, d)) return;
|
|
2618
2645
|
if (serveBrandAsset(req, res, url.pathname)) return;
|
|
2646
|
+
if (req.method === "GET" && url.pathname === "/healthz") {
|
|
2647
|
+
const s = readRelayState(d);
|
|
2648
|
+
const uptimeSec = Math.floor(process.uptime());
|
|
2649
|
+
const port = req.socket.localPort || 8471;
|
|
2650
|
+
const routes = localNetworkRoutes(port);
|
|
2651
|
+
res.writeHead(200, { "content-type": "application/json; charset=utf-8", "cache-control": "no-store" });
|
|
2652
|
+
res.end(JSON.stringify({
|
|
2653
|
+
role: (s && s.role) || "dashboard",
|
|
2654
|
+
weight: 100,
|
|
2655
|
+
workers: 0,
|
|
2656
|
+
advertisedRoutes: (s && Array.isArray(s.advertisedRoutes) && s.advertisedRoutes.length > 0) ? s.advertisedRoutes : routes,
|
|
2657
|
+
uptimeSec,
|
|
2658
|
+
}));
|
|
2659
|
+
return;
|
|
2660
|
+
}
|
|
2661
|
+
if (req.method === "POST" && url.pathname === "/api/pair/exchange") {
|
|
2662
|
+
const s = readRelayState(d);
|
|
2663
|
+
if (s && s.role === "standby") {
|
|
2664
|
+
res.writeHead(503, { "content-type": "application/json; charset=utf-8", "x-relay-role": "standby" });
|
|
2665
|
+
res.end(JSON.stringify({ error: "standby relay: writes refused", role: "standby" }));
|
|
2666
|
+
return;
|
|
2667
|
+
}
|
|
2668
|
+
if (!String(req.headers["content-type"] || "").includes("application/json")) {
|
|
2669
|
+
res.writeHead(415, { "content-type": "application/json; charset=utf-8" });
|
|
2670
|
+
res.end(JSON.stringify({ error: "content-type must be application/json" }));
|
|
2671
|
+
return;
|
|
2672
|
+
}
|
|
2673
|
+
const chunks = [];
|
|
2674
|
+
let size = 0;
|
|
2675
|
+
let tooBig = false;
|
|
2676
|
+
req.on("data", (c) => {
|
|
2677
|
+
size += c.length;
|
|
2678
|
+
if (size <= 65536) chunks.push(c);
|
|
2679
|
+
else tooBig = true;
|
|
2680
|
+
});
|
|
2681
|
+
req.on("end", () => {
|
|
2682
|
+
try {
|
|
2683
|
+
if (tooBig) {
|
|
2684
|
+
res.writeHead(413, { "content-type": "application/json; charset=utf-8" });
|
|
2685
|
+
res.end(JSON.stringify({ error: "body too large (max 64KB)" }));
|
|
2686
|
+
return;
|
|
2687
|
+
}
|
|
2688
|
+
let body = null;
|
|
2689
|
+
try {
|
|
2690
|
+
body = JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
2691
|
+
} catch {
|
|
2692
|
+
res.writeHead(400, { "content-type": "application/json; charset=utf-8" });
|
|
2693
|
+
res.end(JSON.stringify({ error: "invalid JSON body" }));
|
|
2694
|
+
return;
|
|
2695
|
+
}
|
|
2696
|
+
const presented = String((body && body.pairToken) || "");
|
|
2697
|
+
const label = String((body && body.label) || "").slice(0, 80);
|
|
2698
|
+
let requested = null;
|
|
2699
|
+
if (body && body.scopes !== undefined && body.scopes !== null) {
|
|
2700
|
+
if (!Array.isArray(body.scopes)) {
|
|
2701
|
+
res.writeHead(400, { "content-type": "application/json; charset=utf-8" });
|
|
2702
|
+
res.end(JSON.stringify({ error: "scopes must be an array" }));
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
requested = [];
|
|
2706
|
+
for (const sc of body.scopes) {
|
|
2707
|
+
const c = String(sc).trim();
|
|
2708
|
+
if (!PAIR_SCOPES.includes(c)) {
|
|
2709
|
+
res.writeHead(400, { "content-type": "application/json; charset=utf-8" });
|
|
2710
|
+
res.end(JSON.stringify({ error: `unknown scope "${c.slice(0, 60)}" (want ${PAIR_SCOPES.join("|")})` }));
|
|
2711
|
+
return;
|
|
2712
|
+
}
|
|
2713
|
+
if (!requested.includes(c)) requested.push(c);
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
let rec = null;
|
|
2717
|
+
let recPath = null;
|
|
2718
|
+
try {
|
|
2719
|
+
const dir = path.join(d.root, "pairing");
|
|
2720
|
+
for (const f of fs.readdirSync(dir)) {
|
|
2721
|
+
if (!f.endsWith(".json") || f.endsWith(".used.json")) continue;
|
|
2722
|
+
try {
|
|
2723
|
+
const pdoc = readJson(path.join(dir, f));
|
|
2724
|
+
if (pdoc && pdoc.tokenHash && pdoc.salt && timingSafeEqualStr(hashToken(presented, String(pdoc.salt)), String(pdoc.tokenHash))) {
|
|
2725
|
+
rec = pdoc;
|
|
2726
|
+
recPath = path.join(dir, f);
|
|
2727
|
+
break;
|
|
2728
|
+
}
|
|
2729
|
+
} catch {}
|
|
2730
|
+
}
|
|
2731
|
+
} catch {}
|
|
2732
|
+
if (!rec) {
|
|
2733
|
+
res.writeHead(403, { "content-type": "application/json; charset=utf-8" });
|
|
2734
|
+
res.end(JSON.stringify({ error: "unknown pairing token" }));
|
|
2735
|
+
return;
|
|
2736
|
+
}
|
|
2737
|
+
if (Date.parse(rec.expiresAt) <= Date.now()) {
|
|
2738
|
+
res.writeHead(403, { "content-type": "application/json; charset=utf-8" });
|
|
2739
|
+
res.end(JSON.stringify({ error: "pairing token expired" }));
|
|
2740
|
+
return;
|
|
2741
|
+
}
|
|
2742
|
+
const granted = Array.isArray(rec.scopes) ? rec.scopes : null;
|
|
2743
|
+
if (requested !== null && granted !== null) {
|
|
2744
|
+
const wider = requested.filter((s) => !granted.includes(s));
|
|
2745
|
+
if (wider.length > 0) {
|
|
2746
|
+
res.writeHead(403, { "content-type": "application/json; charset=utf-8" });
|
|
2747
|
+
res.end(JSON.stringify({ error: `scope widen refused (not granted: ${wider.join(",")})` }));
|
|
2748
|
+
return;
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
const usedPath = recPath.replace(/\.json$/, ".used.json");
|
|
2752
|
+
if (!writeExclusiveJson(usedPath, { at: new Date().toISOString(), label })) {
|
|
2753
|
+
res.writeHead(403, { "content-type": "application/json; charset=utf-8" });
|
|
2754
|
+
res.end(JSON.stringify({ error: "pairing token already used" }));
|
|
2755
|
+
return;
|
|
2756
|
+
}
|
|
2757
|
+
const dc = newDeviceCred();
|
|
2758
|
+
const salt = newSalt();
|
|
2759
|
+
fs.mkdirSync(path.join(d.root, "devices"), { recursive: true });
|
|
2760
|
+
writeJson(devicePath(d, dc.id), {
|
|
2761
|
+
id: dc.id, label, secretHash: hashToken(dc.secret, salt), salt,
|
|
2762
|
+
createdBy: rec.createdBy || "", createdAt: new Date().toISOString(),
|
|
2763
|
+
lastSeen: "", revoked: false,
|
|
2764
|
+
scopes: requested !== null ? requested : granted,
|
|
2765
|
+
});
|
|
2766
|
+
try {
|
|
2767
|
+
appendChainRecord(d, "relay", "device-issue", { id: dc.id, label, by: rec.createdBy || "" });
|
|
2768
|
+
} catch {}
|
|
2769
|
+
res.writeHead(200, { "content-type": "application/json; charset=utf-8", "cache-control": "no-store" });
|
|
2770
|
+
res.end(JSON.stringify({ deviceId: dc.id, credential: dc.cred }));
|
|
2771
|
+
} catch (err) {
|
|
2772
|
+
res.writeHead(500, { "content-type": "application/json; charset=utf-8" });
|
|
2773
|
+
res.end(JSON.stringify({ error: `exchange failed: ${(err && err.message) || err}` }));
|
|
2774
|
+
}
|
|
2775
|
+
});
|
|
2776
|
+
req.on("error", () => {
|
|
2777
|
+
try {
|
|
2778
|
+
res.writeHead(400, { "content-type": "application/json; charset=utf-8" });
|
|
2779
|
+
res.end(JSON.stringify({ error: "unreadable body" }));
|
|
2780
|
+
} catch {}
|
|
2781
|
+
});
|
|
2782
|
+
return;
|
|
2783
|
+
}
|
|
2619
2784
|
if (req.method === "POST" && url.pathname === "/api/kill") {
|
|
2620
2785
|
// JSON-only (browsers preflight this; simple CSRF forms can't reach
|
|
2621
2786
|
// it), token-checked like the CLI. Same trust zone as the board.
|
|
@@ -2660,12 +2825,22 @@ export async function cmdWeb(args) {
|
|
|
2660
2825
|
return;
|
|
2661
2826
|
}
|
|
2662
2827
|
if (req.method === "GET" && url.pathname === "/api/routes") {
|
|
2663
|
-
// Control-plane M1: reachability hints. The local dashboard
|
|
2664
|
-
//
|
|
2665
|
-
|
|
2666
|
-
const envId = `board:${path.basename(d.root)}`;
|
|
2828
|
+
// Control-plane M1: reachability hints. The local dashboard exposes
|
|
2829
|
+
// LAN/relay routes so paired clients can reach it.
|
|
2830
|
+
const relayDoc = readRelayState(d);
|
|
2831
|
+
const envId = (relayDoc && relayDoc.envId) || `board:${path.basename(d.root)}`;
|
|
2832
|
+
let routes = (relayDoc && Array.isArray(relayDoc.advertisedRoutes) && relayDoc.advertisedRoutes.length > 0)
|
|
2833
|
+
? relayDoc.advertisedRoutes
|
|
2834
|
+
: [];
|
|
2835
|
+
if (routes.length === 0) {
|
|
2836
|
+
const effectivePort = req.socket.localPort || 8471;
|
|
2837
|
+
routes = localNetworkRoutes(effectivePort);
|
|
2838
|
+
}
|
|
2839
|
+
if (routes.length === 0 && req.headers.host && !req.headers.host.startsWith("localhost") && !req.headers.host.startsWith("127.")) {
|
|
2840
|
+
routes.push(`http://${req.headers.host}`);
|
|
2841
|
+
}
|
|
2667
2842
|
res.writeHead(200, { "content-type": "application/json; charset=utf-8", "cache-control": "no-store" });
|
|
2668
|
-
res.end(JSON.stringify(advertiseEnv({ envId, routes
|
|
2843
|
+
res.end(JSON.stringify(advertiseEnv({ envId, routes, capabilities: ["hlc", "tombstones", "channels", "revoked", "holds", "launch"] })));
|
|
2669
2844
|
return;
|
|
2670
2845
|
}
|
|
2671
2846
|
if (req.method === "POST" && url.pathname === "/api/launch") {
|
|
@@ -2713,7 +2888,10 @@ export async function cmdWeb(args) {
|
|
|
2713
2888
|
server.on("error", reject);
|
|
2714
2889
|
server.listen(port, host, () => {
|
|
2715
2890
|
const a = server.address();
|
|
2716
|
-
const
|
|
2891
|
+
const addr = a && typeof a === "object" ? a.address : host;
|
|
2892
|
+
const effectivePort = a && typeof a === "object" ? a.port : port;
|
|
2893
|
+
const displayHost = (addr === "0.0.0.0" || addr === "::" || addr === "0:0:0:0:0:0:0:0") ? "127.0.0.1" : addr;
|
|
2894
|
+
const shown = `${displayHost}:${effectivePort}`;
|
|
2717
2895
|
const webUrl = `http://${shown}`;
|
|
2718
2896
|
console.log(`crewbus web at ${webUrl} [board ${d.root}]`);
|
|
2719
2897
|
if (args.includes("--open")) {
|
package/docs/VERSION_SKEW.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Version skew (mixed-relay operation)
|
|
2
2
|
|
|
3
|
-
How crewbus versions interoperate. Evidence: `package.json:2` (`11.3.
|
|
3
|
+
How crewbus versions interoperate. Evidence: `package.json:2` (`11.3.1`),
|
|
4
4
|
`CHANGELOG.md` (10.0.0 2026-10-08; 7.0.0 2026-10-05; 6.4.0–6.0.0; 4.1.0/4.0.0 baseline).
|
|
5
5
|
Capabilities: `RELAY_CAPS` + `launch` per `packages/contracts/board-caps.json:6-8`.
|
|
6
6
|
Cell behavior is the NEW side's verified behavior (`bin/lib/sync.js` refs);
|
package/documentation.html
CHANGED
|
@@ -86,7 +86,7 @@ code{overflow-wrap:anywhere}pre code{overflow-wrap:normal}
|
|
|
86
86
|
<main>
|
|
87
87
|
|
|
88
88
|
<h1>crewbus</h1>
|
|
89
|
-
<p class="sub">A zero-dependency local DM bus for AI coding agents — v11.3.
|
|
89
|
+
<p class="sub">A zero-dependency local DM bus for AI coding agents — v11.3.1 · package <code>crewbus</code> · <a href="https://github.com/eamonpluto/crewbus/actions/workflows/ci.yml">CI status</a></p>
|
|
90
90
|
<p class="sub">Primary audience: developers running <strong>mixed-harness crews</strong> (opencode, Claude Code, Codex, Antigravity, grok-build, Cursor, Qwen Code). <code>package.json</code> is the release version source of truth; <code>board.json</code>'s <code>version: 2</code> is the board <em>schema</em> version, not the release.</p>
|
|
91
91
|
|
|
92
92
|
<h2 id="what">1 · What it is</h2>
|
|
@@ -303,6 +303,7 @@ crewbus init --harness <name> --portable # portable wiring
|
|
|
303
303
|
|
|
304
304
|
<h2 id="changes">16 · Changelog</h2>
|
|
305
305
|
<ul>
|
|
306
|
+
<li><strong>11.3.1</strong> — Mobile pairing over LAN: auto-detect active IPv4 interfaces, bind <code>0.0.0.0</code> with loopback fallback, add <code>/healthz</code> and <code>/api/pair/exchange</code> to <code>crewbus web</code>, and permit cleartext HTTP in mobile client for local relay routes.</li>
|
|
306
307
|
<li><strong>11.3.0</strong> — Standard package polish: <code>crewbus --version</code>/<code>version --json</code>, command-level <code>--help</code>, dual-registry <code>update</code> (npm + GitHub Packages, <code>--registry</code> override), MCP/hook version flags, and public npm publishing as <code>crewbus</code>.</li>
|
|
307
308
|
<li><strong>11.2.1</strong> — Kill robustness on Windows: <code>spawn-kill</code> / <code>/api/kill</code> re-check liveness after a failed <code>taskkill</code> and report <code>already-exited</code> instead of a false <code>kill-failed</code>.</li>
|
|
308
309
|
<li><strong>11.2.0</strong> — Orchestrator model selection: <code>--orchestrator-model <m></code> sets the coordinator lane's model on <code>spawn</code>, <code>launch</code>, and <code>pool</code> when the lane is provisioned (standing coordinators keep their boot-time model).</li>
|
|
@@ -345,7 +346,7 @@ crewbus init --harness <name> --portable # portable wiring
|
|
|
345
346
|
<p>Stated plainly: <code>--to</code> fans out to up to 10,000 <em>recipients</em> (a broadcast limit); <code>spawn</code> boots one harness process per worker (20/call default) — budget live crews like compute. There is no tested claim of thousands of concurrent workers. Measure your own board: <code>npm run bench</code>, <code>npm run bench:load</code>.</p>
|
|
346
347
|
|
|
347
348
|
<h2 id="control-plane">18 · Control plane</h2>
|
|
348
|
-
<p>v11.3.
|
|
349
|
+
<p>v11.3.1 live release (spec: <code>docs/CONTROL_PLANE_SPEC.md</code>; full entry: <code>CHANGELOG.md ## 10.0.0</code>). Additive over <code>spawn</code> — same spawn core, same RBAC, same audit. Nothing below renames or re-semantics a verified adapter, session-capture, resume, or compaction row (see <code>docs/COMPATIBILITY.md</code>).</p>
|
|
349
350
|
<h3>Launch wizard + harness detect</h3>
|
|
350
351
|
<p><code>crewbus launch --from <you> --harness <driver> --body "..."</code> validates the plan against <code>packages/contracts/launch.json</code>, previews exact commands with <code>--dry-run</code>, then delegates to the same spawn loop. Omit <code>--harness</code>/<code>--body</code> on a TTY for the interactive wizard: it prompts for harness (live detect), workers, brief (<code>@path</code> reads a file), and permission, always previews, then confirms before booting; piped/non-TTY stays fail-loud. <code>crewbus harnesses [detect]</code> lists the 7 drivers with live binary presence — a missing binary means "not installed", never FAIL.</p>
|
|
351
352
|
<h3>Pairing</h3>
|
|
@@ -359,7 +360,7 @@ crewbus init --harness <name> --portable # portable wiring
|
|
|
359
360
|
<h3>Mobile shell</h3>
|
|
360
361
|
<p>Expo shell, remote-only v1 (see <code>apps/mobile/README.md</code>): pairs by QR scan, walks advertised + learned routes, offers triage/approvals/launch/fleet cards with an offline outbox that only retries on explicit tap. Triage groups inbox by brief thread; the Briefs screen shows one row per fan-out with tap-for-thread; a foreground watcher raises in-app alerts for approvals and dead workers.</p>
|
|
361
362
|
|
|
362
|
-
<footer>crewbus documentation · v11.3.
|
|
363
|
+
<footer>crewbus documentation · v11.3.1 tree · zero dependencies, node ≥18 · MIT</footer>
|
|
363
364
|
|
|
364
365
|
</main>
|
|
365
366
|
</div>
|
package/index.html
CHANGED
|
@@ -114,7 +114,7 @@ details{border-top:1px solid var(--line);padding:14px 0}summary{cursor:pointer;f
|
|
|
114
114
|
|
|
115
115
|
<div class="hero" id="top" data-page="home">
|
|
116
116
|
<div>
|
|
117
|
-
<span class="pill"><i></i>v11.3.
|
|
117
|
+
<span class="pill"><i></i>v11.3.1 is out</span>
|
|
118
118
|
<h1>Let your coding agents talk to each other.</h1>
|
|
119
119
|
<p class="lede">A zero-dependency local DM bus. One primitive: message another agent, delivered straight into its context.</p>
|
|
120
120
|
<div class="cta"><a class="btn" href="#install">Get started</a><a class="btn ghost" href="https://github.com/eamonpluto/crewbus">View on GitHub</a></div>
|
|
@@ -266,7 +266,7 @@ POST /api/launch</pre>
|
|
|
266
266
|
<div id="faq"></div>
|
|
267
267
|
</div></section>
|
|
268
268
|
|
|
269
|
-
<div class="w"><footer><span>crewbus v11.3.
|
|
269
|
+
<div class="w"><footer><span>crewbus v11.3.1 · zero-dependency local DM bus</span><span><a href="https://github.com/eamonpluto/crewbus">GitHub</a></span></footer></div>
|
|
270
270
|
|
|
271
271
|
<script>
|
|
272
272
|
(function(){
|
|
@@ -308,7 +308,7 @@ cards('uses',[['Researchers','Parameter sweeps, parallel proof attempts where th
|
|
|
308
308
|
var C='init|Plants the board, writes agent instructions, installs harness wiring.|init --harness opencode;update|Self-update the global npm install to the registry latest.|update --check;register|First claim mints your token; later calls prove it.|register --from orchestrator;token|Rotate, expire and inspect identity tokens.|token rotate --from orchestrator;agents|Who exists and who is actually alive.|agents --active;send|The primitive: mission, scope and done-criteria in one DM.|send --to bob --body "…";inbox|Your mail, with no mark-read side effects.|inbox --unacked;listen|Block and print new arrivals, locally or via relay.|listen --timeout 60000;thread|One brief plus every reply, across inboxes.|thread --id msg-…;channel|Append-only public logs: post, tail, search, summarize.|channel tail findings;group|Named recipient sets for variant briefs.|group create team-a;gather|Reduce a batch to one transcript.|gather --batch …;ack|Accept a reply, optionally gated on a checker.|ack --verify "npm test";result|Keep verified-only group outcomes.|result record --group …;race|First verified result wins; losers stand down.|race close --kill;artifact|Publish, adopt and verify board artifacts so output compounds.|artifact list;lesson|Scoped one-liners auto-injected into later spawn briefs.|lesson post --scope … --text "…"spawn|Brief workers and boot them detached.|spawn --count 8;spawn-status|Running? Replied? Acked?|spawn-status --all;spawn-kill|Terminate workers by recorded pid.|spawn-kill --to w1;pool|Boot at most S of N at once, auto-replace exits.|pool --count 20;stop|The global kill switch.|stop --all;serve|Relay: sync, remote crews, health checks.|serve --port 8471;sync|Peer-to-peer board merge.|sync --with …;web|Fleet console on localhost.|web --port 0;doctor|Validate wiring and diagnose split boards.|doctor;prune|Retention windows for old mail and logs.|prune --dry-run';
|
|
309
309
|
$('cmds').innerHTML=tbl(['Command','What it does','Try first'],C.split(';').map(function(r){var p=r.split('|');return ['<code>'+p[0]+'</code>',p[1],'<code>'+p[2]+'</code>']}));
|
|
310
310
|
$('docs').innerHTML='QUICKSTART TROUBLESHOOTING WHEN_NOT COMPATIBILITY DELIVERY GROUPS VERIFIER CONSOLIDATOR LIMITS THREAT_MODEL ISOLATION STORAGE EXPERIMENTS IDENTITY RBAC OIDC_TLS AUDIT_EXPORT TENANCY HA SHARED_RESPONSIBILITY CERT_READINESS PAIRING CREWS SPLIT'.split(' ').map(function(d){return '<a href="https://github.com/eamonpluto/crewbus/blob/master/docs/'+d+'.md">'+d.toLowerCase()+'</a>'}).join('');
|
|
311
|
-
var R=[['11.3.0','2026-11-17','Standard package polish: crewbus --version/version --json, command-level --help, dual-registry crewbus update (npm + GitHub Packages) with --registry override, MCP/hook version flags, and public npm publishing as crewbus.'],['11.2.1','2026-10-29','Kill robustness on Windows: spawn-kill / api/kill re-check liveness after a failed taskkill and report already-exited instead of a false kill-failed.'],['11.2.0','2026-10-29','Orchestrator model selection: --orchestrator-model <m> sets the coordinator lane model on spawn, launch, and pool when the lane is provisioned (standing coordinators keep their boot-time model).'],['11.1.0','2026-10-29','Per-worker models: --model a,b,c assigns a different model per spawned worker (cycled in worker order; a single value still applies to all) across spawn, launch, pool, web/RPC, and remote relay boots.'],['11.0.0','2026-10-29','Two-role control plane: one orchestrator plus workers. Removed boss/admin/lead/auditor; spawn "brief" --count N runs as the orchestrator (no --from/--lead); orchestrator init|show; approvals pin to --to orchestrator; docs/contracts/tests updated.'],['10.0.15','2026-10-26','CLI documentation and help flags audit, layout fixes, and Windows test cleanup.'],['10.0.14','2026-10-25','Respawn presence fix: spawnedAt refreshes to the new pid launch on every respawn, so live workers are not read as stale (all harnesses).'],['10.0.13','2026-10-25','Qwen Code harness integration (contracts, spawn targets, session-id preassign, settings init, hooks, dynamic model discovery) and strict lead coordinator auto-provisioning.'],['10.0.12','2026-10-20','Consolidate desktop into standalone crewbus web (/pair QR, --open browser launcher), enforce --lead auto, require managed AI harnesses, retire legacy compatibility.'],['10.0.10','2026-10-18','Observer coordinator lane model (boss / lead / peers), auto-assigned lead (--lead auto|board|none), and Desktop app alignment.'],['10.0.9','2026-10-17','Workbench compound-memory layer: artifacts with adoption/verification and depends-on edges, lessons auto-injected into spawn briefs, needs-by handoff deadlines with inbox --overdue, feed-forward gather metrics; opencode respawn session capture fixed (direct exe boot + SQLite storage fallback).'],['10.0.8','2026-10-16','Launch composer UI refinements: streamlined agent naming, clearer count stepper, flat panel styling, and clean console.'],['10.0.7','2026-10-14','Design refresh and icon fixes across desktop and mobile shells.'],['10.0.6','2026-10-13','Dashboard client hotfix: a template-literal escape killed the whole script block at parse time — fixed, with a regression test that syntax-checks the served page.'],['10.0.5','2026-10-12','Self-update command: crewbus update [--check] [--yes] [--version x.y.z] via your own npm config.'],['10.0.4','2026-10-12','Dashboard Briefs view + gather endpoint, task-scoped spawn rosters, mobile brief/thread/watcher screens.'],['10.0.3','2026-10-10','Worker-record integrity (canonical doc merge), truthful presence, Crew roster block in spawn briefs, doctor dead-man scan.'],['10.0.2','2026-10-09','Target workspace selector and persistence in Launch Studio, clearer project popover, directory picker replaces the upload prompt, desktop companion v0.1.16.'],['10.0.1','2026-10-09','Windows opencode detection fix, model selector sync that blocks incompatible pairings, refreshed model catalog with live discovery.'],['10.0.0','2026-10-08','Multi-harness orchestration (--harness claude,antigravity), canonical model selector, native desktop app, mobile companion with QR pairing, full control plane.'],['7.0.0','2026-10-05','Renamed to crewbus. Human-in-the-loop approvals, long-run resilience, respawn, checkpoints and pool-resume.'],['6.0.0','2026-10-03','Fleet hardening: capability negotiation, credential scrub for workers, per-device pairing, weighted multi-relay crews.'],['5.0.0','2026-10-03','Enterprise tier: RBAC, OIDC, TLS, audit export, legal holds, encrypted backups, quotas, standby relays.'],['3.0.0','2026-09-24','Token-bound identity, presence, pruning, detached spawn, ack and threading, local dashboard.'],['2.0.0','earlier','The DM-only rewrite: one primitive, message another agent, plus the opencode push layer.']];
|
|
311
|
+
var R=[['11.3.1','2026-11-17','Mobile pairing over LAN: auto-detect active IPv4 interfaces, bind 0.0.0.0 with loopback fallback, add /healthz and /api/pair/exchange to crewbus web, and allow cleartext HTTP in mobile client for local relay routes.'],['11.3.0','2026-11-17','Standard package polish: crewbus --version/version --json, command-level --help, dual-registry crewbus update (npm + GitHub Packages) with --registry override, MCP/hook version flags, and public npm publishing as crewbus.'],['11.2.1','2026-10-29','Kill robustness on Windows: spawn-kill / api/kill re-check liveness after a failed taskkill and report already-exited instead of a false kill-failed.'],['11.2.0','2026-10-29','Orchestrator model selection: --orchestrator-model <m> sets the coordinator lane model on spawn, launch, and pool when the lane is provisioned (standing coordinators keep their boot-time model).'],['11.1.0','2026-10-29','Per-worker models: --model a,b,c assigns a different model per spawned worker (cycled in worker order; a single value still applies to all) across spawn, launch, pool, web/RPC, and remote relay boots.'],['11.0.0','2026-10-29','Two-role control plane: one orchestrator plus workers. Removed boss/admin/lead/auditor; spawn "brief" --count N runs as the orchestrator (no --from/--lead); orchestrator init|show; approvals pin to --to orchestrator; docs/contracts/tests updated.'],['10.0.15','2026-10-26','CLI documentation and help flags audit, layout fixes, and Windows test cleanup.'],['10.0.14','2026-10-25','Respawn presence fix: spawnedAt refreshes to the new pid launch on every respawn, so live workers are not read as stale (all harnesses).'],['10.0.13','2026-10-25','Qwen Code harness integration (contracts, spawn targets, session-id preassign, settings init, hooks, dynamic model discovery) and strict lead coordinator auto-provisioning.'],['10.0.12','2026-10-20','Consolidate desktop into standalone crewbus web (/pair QR, --open browser launcher), enforce --lead auto, require managed AI harnesses, retire legacy compatibility.'],['10.0.10','2026-10-18','Observer coordinator lane model (boss / lead / peers), auto-assigned lead (--lead auto|board|none), and Desktop app alignment.'],['10.0.9','2026-10-17','Workbench compound-memory layer: artifacts with adoption/verification and depends-on edges, lessons auto-injected into spawn briefs, needs-by handoff deadlines with inbox --overdue, feed-forward gather metrics; opencode respawn session capture fixed (direct exe boot + SQLite storage fallback).'],['10.0.8','2026-10-16','Launch composer UI refinements: streamlined agent naming, clearer count stepper, flat panel styling, and clean console.'],['10.0.7','2026-10-14','Design refresh and icon fixes across desktop and mobile shells.'],['10.0.6','2026-10-13','Dashboard client hotfix: a template-literal escape killed the whole script block at parse time — fixed, with a regression test that syntax-checks the served page.'],['10.0.5','2026-10-12','Self-update command: crewbus update [--check] [--yes] [--version x.y.z] via your own npm config.'],['10.0.4','2026-10-12','Dashboard Briefs view + gather endpoint, task-scoped spawn rosters, mobile brief/thread/watcher screens.'],['10.0.3','2026-10-10','Worker-record integrity (canonical doc merge), truthful presence, Crew roster block in spawn briefs, doctor dead-man scan.'],['10.0.2','2026-10-09','Target workspace selector and persistence in Launch Studio, clearer project popover, directory picker replaces the upload prompt, desktop companion v0.1.16.'],['10.0.1','2026-10-09','Windows opencode detection fix, model selector sync that blocks incompatible pairings, refreshed model catalog with live discovery.'],['10.0.0','2026-10-08','Multi-harness orchestration (--harness claude,antigravity), canonical model selector, native desktop app, mobile companion with QR pairing, full control plane.'],['7.0.0','2026-10-05','Renamed to crewbus. Human-in-the-loop approvals, long-run resilience, respawn, checkpoints and pool-resume.'],['6.0.0','2026-10-03','Fleet hardening: capability negotiation, credential scrub for workers, per-device pairing, weighted multi-relay crews.'],['5.0.0','2026-10-03','Enterprise tier: RBAC, OIDC, TLS, audit export, legal holds, encrypted backups, quotas, standby relays.'],['3.0.0','2026-09-24','Token-bound identity, presence, pruning, detached spawn, ack and threading, local dashboard.'],['2.0.0','earlier','The DM-only rewrite: one primitive, message another agent, plus the opencode push layer.']];
|
|
312
312
|
$('rel').innerHTML=R.map(function(r){return '<div><b>'+r[0]+'</b><span class="mono">'+r[1]+'</span><p>'+r[2]+'</p></div>'}).join('');
|
|
313
313
|
var F=[['Is this just chat for robots?','No. The DM is the task object: a brief carries mission, scope and definition of done, replies thread back, and acks close the loop.'],['Can it run 10,000 agents at once?','10,000 is a broadcast limit: one brief reaches ten thousand inboxes. Live workers are whole harness processes, so size them like compute.'],['What stops an agent going rogue?','Token-bound identity with roles, relay auth with opt-in remote boot, untrusted-peer envelopes, loop and cost guards, budgets, dead-man timeouts and a global stop.'],['Does it phone home?','No. There are no accounts, no telemetry and no update checks. Boards sync only with peers you name.'],['What happens when a worker dies mid-brief?','The brief survives because it is a file, not a process. respawn reboots the worker with a catch-up brief, and pools replace exits automatically.'],['How are results verified?','ack --verify runs your tests or a checker. Only exit 0 records a verified result with its output.'],['When should I not use it?','Single-session work (use subagents), strict ordered pipelines (use a queue), and anything needing real-time guarantees, since the bus is files on disk.'],['Which Node versions work?','Node 18 and newer on Linux, macOS and Windows.'],['Who pays for the tokens agents burn?','Your model provider does. The bus itself costs nothing to run.']];
|
|
314
314
|
$('faq').innerHTML=F.map(function(f){return '<details><summary>'+f[0]+'</summary><p>'+f[1]+'</p></details>'}).join('');
|
package/package.json
CHANGED
package/docs/LEAD_ASSIGN.md
DELETED
package/docs/M1_CLI_DRAFT.md
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
# M1 CLI draft — `launch` wizard, `harnesses`, `relay pair qr`, serve pairing flags
|
|
2
|
-
|
|
3
|
-
Status: SHIPPED (orchestrator wired `cmdServe` 2026-10-06). Paste §1 into `bin/crewbus.js` USAGE and §2
|
|
4
|
-
into `README.md` after the spawn section ("Running workers (spawn)").
|
|
5
|
-
§1d is now live: `serve --advertise-routes --pair-qrcode` shipped in `cmdServe`;
|
|
6
|
-
`POST /api/launch` + `GET /api/harnesses` + `GET /api/routes` shipped in both
|
|
7
|
-
`web` (`bin/lib/web.js`: `handleApiLaunch`) and relay `serve`; covered by
|
|
8
|
-
`test/crewbus.web-launch.mjs` (18 checks, wired into `npm test`).
|
|
9
|
-
|
|
10
|
-
Sources (verified 2026-10-06):
|
|
11
|
-
|
|
12
|
-
- `bin/lib/launch.js` exports: `LAUNCH_PERMISSIONS`
|
|
13
|
-
(`supervised|autoEdits|auto|full`), `LAUNCH_LIFETIMES`
|
|
14
|
-
(`oneshot|persistent`), `LAUNCH_PRIORITIES` (`high|normal`),
|
|
15
|
-
`PAIR_SCOPES`, `launchDrivers()`, `probeBinary()`,
|
|
16
|
-
`detectHarnessBinaries()`, `validateLaunchPlan()`, `buildPairUrl()`,
|
|
17
|
-
`advertiseEnv()`.
|
|
18
|
-
- `bin/crewbus.js`: `cmdLaunch` (~L2933), `cmdHarnesses` (~L3023),
|
|
19
|
-
`cmdRelayPair` + `qr` branch (~L4490–4524), USAGE lines for
|
|
20
|
-
`launch` / `harnesses` / `relay pair qr` (shipped — keep verbatim §1a–c).
|
|
21
|
-
- Contracts (frozen M0): `packages/contracts/{harness,launch,pairing}.json`.
|
|
22
|
-
- Spec: `docs/CONTROL_PLANE_SPEC.md` §4.1 (wizard + `harnesses
|
|
23
|
-
[detect --json]`, `pair [issue|qr|devices|revoke]`,
|
|
24
|
-
`serve --advertise-routes --pair-qrcode`).
|
|
25
|
-
|
|
26
|
-
Flag verification (role-prompt list vs implementation):
|
|
27
|
-
|
|
28
|
-
| Flag | Status |
|
|
29
|
-
|---|---|
|
|
30
|
-
| `--harness --count/--to --prefix --body/--body-file --subject --priority --model --max-turns --allow-tools --permission supervised\|autoEdits\|auto\|full --isolate --worktree/--branch --oneshot/--persistent --budget-tokens --budget-minutes --timeout --json/--dry-run` | Shipped in `cmdLaunch`, validated by `validateLaunchPlan` |
|
|
31
|
-
| `--target local` | Shipped value is `local` only — `cmdLaunch` hardcodes `target: "local"`; fleet placement stays `crew dispatch`. Document as `--target local` (reserved for fleet) |
|
|
32
|
-
| `--yes` | In shipped USAGE line; no separate consume in `cmdLaunch` (confirm lives in spawn delegation). Keep the token, do not invent semantics |
|
|
33
|
-
| `--permission full` | Needs `--i-understand-danger` (else plan invalid) |
|
|
34
|
-
| `harnesses [detect --json]` | Shipped (`cmdHarnesses`; `detect` optional, bare `harnesses` works) |
|
|
35
|
-
| `relay pair qr --from orchestrator [--label --ttl --routes --json]` | Shipped (`qr` branch of `cmdRelayPair`); prints `crewbus://pair` URL, secret in `#fragment` only |
|
|
36
|
-
| `serve --advertise-routes <url,url> --pair-qrcode` | SHIPPED in `cmdServe` (advertised at `relay.json`, `GET /healthz`, `GET /api/routes`; `--pair-qrcode` needs `--from orchestrator`, same mint + audit as `relay pair`) |
|
|
37
|
-
|
|
38
|
-
## 1. USAGE text blocks (paste-ready)
|
|
39
|
-
|
|
40
|
-
### 1a. `crewbus launch` (shipped — keep verbatim)
|
|
41
|
-
|
|
42
|
-
```text
|
|
43
|
-
crewbus launch --from <you> --harness <driver> --body "..." [--to <a,b> | --count N [--prefix p]] [--subject ...] [--priority high|normal] [--model <m>] [--max-turns <n>] [--allow-tools "..."] [--permission supervised|autoEdits|auto|full] [--isolate] [--worktree <prefix>|--branch <prefix>] [--oneshot|--persistent] [--budget-tokens N] [--budget-minutes M] [--timeout 10m] [--cmd "..."] [--cwd <dir>] [--sender-type ...] [--dry-run] [--yes] [--json]
|
|
44
|
-
(control-plane launch: validates the plan against packages/contracts
|
|
45
|
-
(permission full needs --i-understand-danger); --dry-run prints the
|
|
46
|
-
exact spawn commands via formatSpawnCmd without booting; otherwise
|
|
47
|
-
delegates to the same spawn loop (same RBAC, same audit). --yes skips
|
|
48
|
-
the interactive confirm; --json prints the crewId/batch/workers shape.)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Notes for the orchestrator (do not paste): `--body-file <path>` is also accepted
|
|
52
|
-
(read into the brief before validation); `--target` is `local` (hardcoded —
|
|
53
|
-
fleet goes through `crew dispatch`); `--permission full` additionally
|
|
54
|
-
requires `--i-understand-danger`.
|
|
55
|
-
|
|
56
|
-
### 1b. `crewbus harnesses` (shipped — keep verbatim)
|
|
57
|
-
|
|
58
|
-
```text
|
|
59
|
-
crewbus harnesses [detect] [--json]
|
|
60
|
-
(control-plane detect: lists the 7 drivers with binary presence +
|
|
61
|
-
version + brief channel + resume support. Missing binaries mean
|
|
62
|
-
"not installed", never FAIL.)
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### 1c. `crewbus relay pair qr` (shipped — keep verbatim)
|
|
66
|
-
|
|
67
|
-
```text
|
|
68
|
-
crewbus relay pair qr --from orchestrator [--label <device>] [--ttl 10m] [--routes <url,url>] [--json]
|
|
69
|
-
(prints the one-time crewbus://pair URL (secret in #fragment, never
|
|
70
|
-
query) alongside the plain pairing token. Scan/paste into the mobile
|
|
71
|
-
or desktop client to pair.)
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### 1d. `serve` pairing flags (shipped — keep verbatim)
|
|
75
|
-
|
|
76
|
-
```text
|
|
77
|
-
crewbus serve [...] [--advertise-routes <url,url>] [--pair-qrcode]
|
|
78
|
-
(control-plane pairing helpers: --advertise-routes publishes
|
|
79
|
-
reachability hints for this relay (served at relay.json,
|
|
80
|
-
GET /healthz, GET /api/routes — hints only, the client proves what
|
|
81
|
-
works); --pair-qrcode prints a one-time crewbus://pair URL
|
|
82
|
-
(secret in #fragment, never query) for scanning into the mobile or
|
|
83
|
-
desktop client. Same mint, same audit as `relay pair`.)
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## 2. README section draft (slots directly after "Running workers (spawn)")
|
|
87
|
-
|
|
88
|
-
Paste the block below after the spawn section (after the
|
|
89
|
-
`--persistent`/respawn paragraph, before "## Pulling results").
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
### Launch wizard, harness detect, and pairing (M1 control plane)
|
|
94
|
-
|
|
95
|
-
`launch` is the guided front door over `spawn`: it validates your plan
|
|
96
|
-
against `packages/contracts/launch.json`, previews the exact commands,
|
|
97
|
-
then boots through the same spawn loop (same RBAC, same audit). Nothing
|
|
98
|
-
about `spawn` changes — use whichever surface you prefer.
|
|
99
|
-
|
|
100
|
-
```powershell
|
|
101
|
-
# what can run here? (missing binary = not installed, never FAIL)
|
|
102
|
-
crewbus harnesses # or: crewbus harnesses detect [--json]
|
|
103
|
-
|
|
104
|
-
# preview first — prints exact commands, boots nothing
|
|
105
|
-
crewbus launch --from alice --harness claude --count 2 --prefix w \
|
|
106
|
-
--body "harden the parser; reply with the report" --dry-run
|
|
107
|
-
|
|
108
|
-
# name workers explicitly instead of --count/--prefix
|
|
109
|
-
crewbus launch --from alice --harness claude --to w-1,w-2 \
|
|
110
|
-
--body-file ./brief.md --subject "parser hardening"
|
|
111
|
-
|
|
112
|
-
# permission ladder: supervised (default) | autoEdits | auto | full
|
|
113
|
-
# full needs --i-understand-danger; auto/full warn outside a sandbox
|
|
114
|
-
crewbus launch --from alice --harness opencode --count 1 \
|
|
115
|
-
--body "..." --permission auto --isolate
|
|
116
|
-
|
|
117
|
-
# long briefs live in a file; one of --worktree/--branch; one of
|
|
118
|
-
# --oneshot/--persistent; budgets + timeout guard the run
|
|
119
|
-
crewbus launch --from alice --harness grok --count 2 \
|
|
120
|
-
--body-file ./brief.md --worktree feat- --persistent \
|
|
121
|
-
--budget-tokens 50000 --budget-minutes 30 --timeout 20m
|
|
122
|
-
|
|
123
|
-
# machine-readable plan + commands (crewId/batch/workers shape)
|
|
124
|
-
crewbus launch --from alice --harness codex --count 1 \
|
|
125
|
-
--body "..." --dry-run --json
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Rules worth knowing: the brief caps at 8000 chars (`--body-file` for
|
|
129
|
-
anything long); `--to` and `--count` together warn (`--to` wins);
|
|
130
|
-
`--worktree` and `--branch` are exclusive; `--max-turns` applies to
|
|
131
|
-
claude/grok and `--allow-tools` to claude; cursor/antigravity
|
|
132
|
-
cannot resume (one-shot briefs — the wizard warns, never fakes it);
|
|
133
|
-
`--target` is `local` (fleet placement stays `crew dispatch`).
|
|
134
|
-
|
|
135
|
-
Pair a phone or desktop client without sharing the relay secret:
|
|
136
|
-
|
|
137
|
-
```powershell
|
|
138
|
-
crewbus relay pair qr --from alice --label pixel --ttl 10m \
|
|
139
|
-
--routes https://relay.example.com:8080,http://192.168.1.20:8080
|
|
140
|
-
# prints the one-time crewbus://pair URL (secret in #fragment, never
|
|
141
|
-
# query) plus the plain token; --json for scripting
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
`serve --advertise-routes <url,url> --pair-qrcode` (M1): publishes
|
|
145
|
-
reachability hints for the relay and prints a pairing QR URL on boot —
|
|
146
|
-
same mint, same audit as `relay pair`.
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## 3. COMPATIBILITY.md note
|
|
151
|
-
|
|
152
|
-
No change. The wizard is additive: `cmdLaunch` validates against the
|
|
153
|
-
frozen contracts and delegates to the existing spawn path, so no verified
|
|
154
|
-
row (adapter flags, session-id capture, resume commands, compaction,
|
|
155
|
-
approval pre-approvals) moves. No edit to `docs/COMPATIBILITY.md` —
|
|
156
|
-
no new harness, no flag change, no date to refresh. The one honest
|
|
157
|
-
surface to keep citing is the resume column: cursor/antigravity
|
|
158
|
-
report `resume: false` in `harnesses` output by design (see §2 wording
|
|
159
|
-
above), matching the existing "no" rows.
|
|
160
|
-
|
|
161
|
-
## 4. Paste checklist for the orchestrator
|
|
162
|
-
|
|
163
|
-
1. USAGE: §1a–c already shipped in `bin/crewbus.js` — no paste needed.
|
|
164
|
-
§1d only after `cmdServe` gains `--advertise-routes`/`--pair-qrcode`.
|
|
165
|
-
2. README: paste §2 block after the spawn section
|
|
166
|
-
(after the `--persistent`/respawn paragraph).
|
|
167
|
-
3. COMPATIBILITY.md: no edit (per §3).
|
|
168
|
-
4. Never touched (per role): `bin/crewbus.js`, `package.json`, tests —
|
|
169
|
-
this draft only *adds* `docs/M1_CLI_DRAFT.md`.
|
|
170
|
-
UPDATE (orchestrator, 2026-10-06): serve + web wiring landed after the draft —
|
|
171
|
-
`bin/crewbus.js` (`cmdServe` flags, `/api/routes`, `/api/harnesses`,
|
|
172
|
-
`/api/launch`, USAGE), `bin/lib/web.js` (`handleApiLaunch`,
|
|
173
|
-
`/api/harnesses`, `/api/routes`, `/api/launch`), `package.json`
|
|
174
|
-
(`web-launch` in test chain); new file `test/crewbus.web-launch.mjs`.
|
|
175
|
-
|