crewbus 10.0.11 → 10.0.12

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/bin/lib/launch.js CHANGED
@@ -28,7 +28,6 @@ export const LAUNCH_DRIVER_FALLBACK = [
28
28
  { driver: "grok", displayName: "grok-build", binary: "grok", briefDelivery: "file", sessionCapture: "preassigned", resume: true, spawnArgs: "--prompt-file <brief> -s <uuid>", resumeArgs: "--prompt-file <catchup> -r <id>" },
29
29
  { driver: "antigravity", displayName: "Antigravity", binary: "agy", briefDelivery: "inline", sessionCapture: "none", resume: false, spawnArgs: "--print --mode accept-edits \"<brief>\"", resumeArgs: "unsupported (no stable conversation id)" },
30
30
  { driver: "cursor", displayName: "Cursor", binary: "cursor-agent", briefDelivery: "inline", sessionCapture: "none", resume: false, spawnArgs: "cursor-agent -p --force --trust \"<brief>\"", resumeArgs: "unsupported (id lives in stream-json)" },
31
- { driver: "generic", displayName: "generic", binary: null, briefDelivery: "file", sessionCapture: "none", resume: false, spawnArgs: "--cmd \"<arbitrary>\"", resumeArgs: "fresh boot only" },
32
31
  ];
33
32
  // Resolve the driver table: contracts file wins, fallback otherwise.
34
33
  export function launchDrivers() {
@@ -36,7 +35,7 @@ export function launchDrivers() {
36
35
  const here = path.dirname(new URL(import.meta.url).pathname);
37
36
  const p = path.join(here, "..", "..", "packages", "contracts", "harness.json");
38
37
  const doc = JSON.parse(fs.readFileSync(p, "utf8"));
39
- if (doc && Array.isArray(doc.drivers) && doc.drivers.length === 7) return doc.drivers;
38
+ if (doc && Array.isArray(doc.drivers) && doc.drivers.length === 6) return doc.drivers;
40
39
  } catch {}
41
40
  return LAUNCH_DRIVER_FALLBACK;
42
41
  }
@@ -151,7 +150,6 @@ export const HARNESS_MODELS = {
151
150
  { id: "claude-3.7-sonnet", label: "Claude 3.7 Sonnet (Legacy)", tier: "standard" },
152
151
  { id: "gpt-4o", label: "GPT-4o (Legacy)", tier: "standard" },
153
152
  ],
154
- generic: [],
155
153
  };
156
154
 
157
155
  // Dynamic discovered model cache for harnesses capable of live discovery (e.g., opencode).
@@ -183,27 +181,72 @@ export function refreshDiscoveredModels(timeoutMs = 15000) {
183
181
  const { execFile } = await import("node:child_process");
184
182
  const { promisify } = await import("node:util");
185
183
  const execFileAsync = promisify(execFile);
186
- const { stdout } = await execFileAsync("opencode", ["models"], {
187
- timeout: timeoutMs,
188
- shell: isWin,
189
- });
190
- const rawLines = String(stdout || "").split("\n")
191
- .map((l) => l.trim())
192
- .filter((l) => l && !l.startsWith("⠀") && !l.startsWith("█") && !l.includes(" "));
193
- if (rawLines.length > 0) {
194
- const opencodeModels = rawLines.map((m) => {
195
- const parts = m.split("/");
196
- const name = parts[1] || parts[0];
197
- const tier = /pro|r1|opus|3\.7|o3|o1|gpt-5|grok-4|max/i.test(m)
198
- ? "frontier"
199
- : /haiku|flash|mini|nano|free/i.test(m)
200
- ? "fast"
201
- : "standard";
202
- return { id: m, label: `${name} (${parts[0]})`, tier };
184
+
185
+ // opencode model discovery
186
+ try {
187
+ const { stdout } = await execFileAsync("opencode", ["models"], {
188
+ timeout: timeoutMs,
189
+ shell: isWin,
203
190
  });
204
- if (!_cachedDiscoveredModels) _cachedDiscoveredModels = {};
205
- _cachedDiscoveredModels.opencode = opencodeModels;
206
- }
191
+ const rawLines = String(stdout || "").split("\n")
192
+ .map((l) => l.trim())
193
+ .filter((l) => l && !l.startsWith("⠀") && !l.startsWith("█") && !l.includes(" "));
194
+ if (rawLines.length > 0) {
195
+ const opencodeModels = rawLines.map((m) => {
196
+ const parts = m.split("/");
197
+ const name = parts[1] || parts[0];
198
+ const tier = /pro|r1|opus|3\.7|o3|o1|gpt-5|grok-4|max/i.test(m)
199
+ ? "frontier"
200
+ : /haiku|flash|mini|nano|free/i.test(m)
201
+ ? "fast"
202
+ : "standard";
203
+ return { id: m, label: `${name} (${parts[0]})`, tier };
204
+ });
205
+ if (!_cachedDiscoveredModels) _cachedDiscoveredModels = {};
206
+ _cachedDiscoveredModels.opencode = opencodeModels;
207
+ }
208
+ } catch {}
209
+
210
+ // grok model discovery
211
+ try {
212
+ const { stdout: gOut } = await execFileAsync("grok", ["models"], {
213
+ timeout: timeoutMs,
214
+ shell: isWin,
215
+ });
216
+ const gLines = String(gOut || "").split("\n")
217
+ .map((l) => l.trim())
218
+ .filter((l) => l.startsWith("*") || l.startsWith("-"))
219
+ .map((l) => l.replace(/^[*-\s]+/, "").split(" ")[0].trim())
220
+ .filter(Boolean);
221
+ if (gLines.length > 0) {
222
+ if (!_cachedDiscoveredModels) _cachedDiscoveredModels = {};
223
+ _cachedDiscoveredModels.grok = gLines.map((id) => ({
224
+ id,
225
+ label: `${id.charAt(0).toUpperCase() + id.slice(1)} (Discovered)`,
226
+ tier: /4\.[6-9]|5/i.test(id) ? "frontier" : "standard",
227
+ }));
228
+ }
229
+ } catch {}
230
+
231
+ // antigravity model discovery
232
+ try {
233
+ const { stdout: aOut } = await execFileAsync("agy", ["models"], {
234
+ timeout: timeoutMs,
235
+ shell: isWin,
236
+ });
237
+ const aLines = String(aOut || "").split("\n")
238
+ .map((l) => l.trim())
239
+ .filter((l) => l && !l.toLowerCase().startsWith("fetching") && l.includes("\t"))
240
+ .map((l) => {
241
+ const [id, label] = l.split("\t");
242
+ const tier = /high|pro|opus|4/i.test(label || id) ? "frontier" : /low|lite|mini/i.test(label || id) ? "fast" : "standard";
243
+ return { id: id.trim(), label: (label || id).trim(), tier };
244
+ });
245
+ if (aLines.length > 0) {
246
+ if (!_cachedDiscoveredModels) _cachedDiscoveredModels = {};
247
+ _cachedDiscoveredModels.antigravity = aLines;
248
+ }
249
+ } catch {}
207
250
  } catch {
208
251
  // Ignore discovery errors — static catalog remains available
209
252
  } finally {
@@ -282,10 +325,10 @@ export function validateLaunchPlan(raw) {
282
325
  if (model && model.length > 100) errors.push("model name too long (max 100 chars)");
283
326
 
284
327
  const lead = r.lead === undefined || r.lead === null || String(r.lead).trim() === "" ? "auto" : String(r.lead).trim().toLowerCase();
285
- if (!["auto", "board", "none"].includes(lead)) errors.push(`bad lead mode "${r.lead}" (want auto|board|none)`);
328
+ if (lead !== "auto") errors.push(`bad lead mode "${r.lead}" (only "auto" supported)`);
286
329
 
287
330
  const plan = {
288
- harness, harnesses: harnesses.length > 0 ? harnesses : ["generic"],
331
+ harness, harnesses: harnesses.length > 0 ? harnesses : ["opencode"],
289
332
  model, body, count: Number.isInteger(count) && count > 0 ? count : 1,
290
333
  prefix: r.prefix === undefined ? undefined : String(r.prefix),
291
334
  to: r.to === undefined ? undefined : String(r.to),