@brainbase-labs/cli 0.60.0 → 0.61.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.
- package/README.md +7 -0
- package/dist/index.js +821 -408
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35182,9 +35182,9 @@ var require_dist2 = __commonJS((exports, module) => {
|
|
|
35182
35182
|
});
|
|
35183
35183
|
|
|
35184
35184
|
// src/index.ts
|
|
35185
|
-
var
|
|
35186
|
-
import
|
|
35187
|
-
import
|
|
35185
|
+
var import_picocolors87 = __toESM(require_picocolors(), 1);
|
|
35186
|
+
import process15 from "node:process";
|
|
35187
|
+
import fs98 from "node:fs";
|
|
35188
35188
|
|
|
35189
35189
|
// src/cli/template.ts
|
|
35190
35190
|
var import_picocolors12 = __toESM(require_picocolors(), 1);
|
|
@@ -36091,7 +36091,7 @@ function padStart(s, n) {
|
|
|
36091
36091
|
// package.json
|
|
36092
36092
|
var package_default = {
|
|
36093
36093
|
name: "@brainbase-labs/cli",
|
|
36094
|
-
version: "0.
|
|
36094
|
+
version: "0.61.0",
|
|
36095
36095
|
description: "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
|
|
36096
36096
|
type: "module",
|
|
36097
36097
|
bin: {
|
|
@@ -85234,6 +85234,7 @@ async function waitForTask(taskId, options) {
|
|
|
85234
85234
|
downtimeTimer = undefined;
|
|
85235
85235
|
failedPolls = 0;
|
|
85236
85236
|
latest = polled.value;
|
|
85237
|
+
options.onTask?.(latest);
|
|
85237
85238
|
if (latest.status !== lastStatus) {
|
|
85238
85239
|
lastStatus = latest.status;
|
|
85239
85240
|
options.onStatus?.(latest);
|
|
@@ -86050,7 +86051,8 @@ var DECISION_MODELS = [
|
|
|
86050
86051
|
"classify-1",
|
|
86051
86052
|
"microsoft-decision-1",
|
|
86052
86053
|
"clef-omni",
|
|
86053
|
-
"d1"
|
|
86054
|
+
"d1",
|
|
86055
|
+
"gemini-decision-1"
|
|
86054
86056
|
];
|
|
86055
86057
|
var DEFAULT_DECISION_MODEL = "clef-flash";
|
|
86056
86058
|
var DECISION_LIMITS = {
|
|
@@ -90952,10 +90954,10 @@ async function waitForAccount(agentId, slug, before2, options) {
|
|
|
90952
90954
|
}
|
|
90953
90955
|
|
|
90954
90956
|
// src/cli/task.ts
|
|
90955
|
-
var
|
|
90957
|
+
var import_picocolors75 = __toESM(require_picocolors(), 1);
|
|
90956
90958
|
|
|
90957
90959
|
// src/cli/task-create.ts
|
|
90958
|
-
var
|
|
90960
|
+
var import_picocolors71 = __toESM(require_picocolors(), 1);
|
|
90959
90961
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
90960
90962
|
|
|
90961
90963
|
// src/cli/task-update.ts
|
|
@@ -91121,6 +91123,33 @@ function format(task) {
|
|
|
91121
91123
|
`);
|
|
91122
91124
|
}
|
|
91123
91125
|
|
|
91126
|
+
// src/cli/task-model-notice.ts
|
|
91127
|
+
var import_picocolors70 = __toESM(require_picocolors(), 1);
|
|
91128
|
+
function modelNoticeOf(body) {
|
|
91129
|
+
if (!body || typeof body !== "object")
|
|
91130
|
+
return;
|
|
91131
|
+
const notice = body.model_notice;
|
|
91132
|
+
if (!notice || typeof notice !== "object")
|
|
91133
|
+
return;
|
|
91134
|
+
const message3 = notice.message;
|
|
91135
|
+
return typeof message3 === "string" && message3.trim() ? notice : undefined;
|
|
91136
|
+
}
|
|
91137
|
+
function modelNoticeLines(taskId, notice) {
|
|
91138
|
+
const id = /^[A-Za-z0-9_-]+$/.test(taskId) ? taskId : "<task-id>";
|
|
91139
|
+
return [
|
|
91140
|
+
`${import_picocolors70.default.yellow("warning:")} ${sanitizeLabel(notice.message)}`,
|
|
91141
|
+
` To decide, run \`brainbase task update ${id} --clear-model\` to use the agent default, or \`brainbase task update ${id} --model <id>\` to pick a model.`
|
|
91142
|
+
];
|
|
91143
|
+
}
|
|
91144
|
+
function warnModelNotice(taskId, body) {
|
|
91145
|
+
const notice = modelNoticeOf(body);
|
|
91146
|
+
if (!notice)
|
|
91147
|
+
return false;
|
|
91148
|
+
console.error(modelNoticeLines(taskId, notice).join(`
|
|
91149
|
+
`));
|
|
91150
|
+
return true;
|
|
91151
|
+
}
|
|
91152
|
+
|
|
91124
91153
|
// src/cli/task-create.ts
|
|
91125
91154
|
var DEFAULT_POLL_INTERVAL_MS2 = 2000;
|
|
91126
91155
|
async function createTask(input, options) {
|
|
@@ -91197,6 +91226,8 @@ async function runTaskCreate(cwd2, options, dependencies = {}) {
|
|
|
91197
91226
|
}
|
|
91198
91227
|
throw interfaceId ? toInterfaceError(error2) : error2;
|
|
91199
91228
|
}
|
|
91229
|
+
const warned = warnModelNotice(created.id, created.task);
|
|
91230
|
+
const notice = modelNoticeOf(created.task);
|
|
91200
91231
|
if (!options.wait) {
|
|
91201
91232
|
if (options.json) {
|
|
91202
91233
|
console.log(JSON.stringify({
|
|
@@ -91204,6 +91235,7 @@ async function runTaskCreate(cwd2, options, dependencies = {}) {
|
|
|
91204
91235
|
agent_id: created.agent_id,
|
|
91205
91236
|
status: created.status,
|
|
91206
91237
|
...versionFields(version2),
|
|
91238
|
+
...notice ? { model_notice: notice } : {},
|
|
91207
91239
|
...created.task ? { task: created.task } : {}
|
|
91208
91240
|
}));
|
|
91209
91241
|
return;
|
|
@@ -91218,9 +91250,9 @@ async function runTaskCreate(cwd2, options, dependencies = {}) {
|
|
|
91218
91250
|
`));
|
|
91219
91251
|
return;
|
|
91220
91252
|
}
|
|
91221
|
-
await waitForCreatedTask(created, options, dependencies, version2);
|
|
91253
|
+
await waitForCreatedTask(created, options, dependencies, version2, warned);
|
|
91222
91254
|
}
|
|
91223
|
-
async function waitForCreatedTask(created, options, dependencies, version2) {
|
|
91255
|
+
async function waitForCreatedTask(created, options, dependencies, version2, warned) {
|
|
91224
91256
|
const setExitCode = dependencies.setExitCode ?? ((code) => process.exitCode = code);
|
|
91225
91257
|
const controller = new AbortController;
|
|
91226
91258
|
const onSigint = () => controller.abort();
|
|
@@ -91236,11 +91268,16 @@ async function waitForCreatedTask(created, options, dependencies, version2) {
|
|
|
91236
91268
|
intervalMs: options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS2,
|
|
91237
91269
|
timeoutMs: options.timeoutSeconds === undefined ? undefined : options.timeoutSeconds * 1000,
|
|
91238
91270
|
signal: controller.signal,
|
|
91271
|
+
onTask: (task) => {
|
|
91272
|
+
if (!warned)
|
|
91273
|
+
warned = warnModelNotice(created.id, task);
|
|
91274
|
+
},
|
|
91239
91275
|
onStatus: options.json ? undefined : (task) => console.log(`Status: ${task.status}`)
|
|
91240
91276
|
});
|
|
91241
91277
|
const status = outcome.task?.status ?? created.status;
|
|
91242
91278
|
const code = exitCodeForWaitOutcome(outcome);
|
|
91243
91279
|
setExitCode(code);
|
|
91280
|
+
const notice = modelNoticeOf(outcome.task ?? created.task);
|
|
91244
91281
|
if (outcome.kind === "unreachable") {
|
|
91245
91282
|
console.error(waitUnreachableNotice(`Task ${created.id}'s status`, `check with \`brainbase task get ${created.id}\``, outcome.budgetMs));
|
|
91246
91283
|
}
|
|
@@ -91252,6 +91289,7 @@ async function waitForCreatedTask(created, options, dependencies, version2) {
|
|
|
91252
91289
|
outcome: outcome.kind,
|
|
91253
91290
|
exit_code: code,
|
|
91254
91291
|
...versionFields(version2),
|
|
91292
|
+
...notice ? { model_notice: notice } : {},
|
|
91255
91293
|
...outcome.task ?? created.task ? { task: outcome.task ?? created.task } : {}
|
|
91256
91294
|
}));
|
|
91257
91295
|
return;
|
|
@@ -91260,24 +91298,24 @@ async function waitForCreatedTask(created, options, dependencies, version2) {
|
|
|
91260
91298
|
return;
|
|
91261
91299
|
}
|
|
91262
91300
|
if (outcome.kind === "timeout") {
|
|
91263
|
-
console.log(
|
|
91301
|
+
console.log(import_picocolors71.default.yellow(`Timed out after ${options.timeoutSeconds}s with the task still ${status}.`));
|
|
91264
91302
|
return;
|
|
91265
91303
|
}
|
|
91266
91304
|
if (outcome.kind === "interrupted") {
|
|
91267
|
-
console.log(
|
|
91305
|
+
console.log(import_picocolors71.default.yellow("Interrupted. The task is still running."));
|
|
91268
91306
|
return;
|
|
91269
91307
|
}
|
|
91270
|
-
console.log(code === 0 ?
|
|
91308
|
+
console.log(code === 0 ? import_picocolors71.default.green("Task completed.") : import_picocolors71.default.red(`Task finished as ${status}.`));
|
|
91271
91309
|
} finally {
|
|
91272
91310
|
process.removeListener("SIGINT", onSigint);
|
|
91273
91311
|
}
|
|
91274
91312
|
}
|
|
91275
91313
|
|
|
91276
91314
|
// src/cli/task-get.ts
|
|
91277
|
-
var
|
|
91315
|
+
var import_picocolors73 = __toESM(require_picocolors(), 1);
|
|
91278
91316
|
|
|
91279
91317
|
// src/cli/task-list.ts
|
|
91280
|
-
var
|
|
91318
|
+
var import_picocolors72 = __toESM(require_picocolors(), 1);
|
|
91281
91319
|
|
|
91282
91320
|
// src/core/agent-names.ts
|
|
91283
91321
|
async function agentNames(ids) {
|
|
@@ -91342,29 +91380,29 @@ function labelFilter(options) {
|
|
|
91342
91380
|
function formatTaskList(tasks, names, agentId, interfaceId, labelFiltered = false) {
|
|
91343
91381
|
const lines = [""];
|
|
91344
91382
|
if (tasks.length === 0 && labelFiltered) {
|
|
91345
|
-
lines.push(` ${
|
|
91383
|
+
lines.push(` ${import_picocolors72.default.dim("No tasks carry every label given with --metadata.")}`, "");
|
|
91346
91384
|
return lines.join(`
|
|
91347
91385
|
`);
|
|
91348
91386
|
}
|
|
91349
91387
|
if (tasks.length === 0 && interfaceId) {
|
|
91350
91388
|
const id = sanitizeLabel(interfaceId);
|
|
91351
|
-
lines.push(` ${
|
|
91389
|
+
lines.push(` ${import_picocolors72.default.dim(`No build conversations for interface ${id}.`)}`, "", ` ${import_picocolors72.default.dim("start one with")} ${import_picocolors72.default.cyan(`brainbase interface build ${id} "..."`)}`, "");
|
|
91352
91390
|
return lines.join(`
|
|
91353
91391
|
`);
|
|
91354
91392
|
}
|
|
91355
91393
|
if (tasks.length === 0) {
|
|
91356
|
-
lines.push(` ${
|
|
91394
|
+
lines.push(` ${import_picocolors72.default.dim(agentId ? `No tasks for agent ${agentId}.` : "No tasks yet.")}`, "", ` ${import_picocolors72.default.dim("start one with")} ${import_picocolors72.default.cyan('brainbase task create --message "..."')}`, "");
|
|
91357
91395
|
return lines.join(`
|
|
91358
91396
|
`);
|
|
91359
91397
|
}
|
|
91360
91398
|
for (const task of tasks) {
|
|
91361
|
-
const title = sanitizeLabel(task.title ?? "").trim() ||
|
|
91362
|
-
lines.push(` ${statusLabel(task.status)} ${
|
|
91363
|
-
lines.push(` ${
|
|
91364
|
-
lines.push(` ${
|
|
91399
|
+
const title = sanitizeLabel(task.title ?? "").trim() || import_picocolors72.default.dim("(untitled)");
|
|
91400
|
+
lines.push(` ${statusLabel(task.status)} ${import_picocolors72.default.bold(title)}`);
|
|
91401
|
+
lines.push(` ${import_picocolors72.default.dim(sanitizeLabel(task.id))}`);
|
|
91402
|
+
lines.push(` ${import_picocolors72.default.dim(`agent ${agentLabel(task.agent_id, names)} · created ${sanitizeLabel(task.created_at)}`)}`);
|
|
91365
91403
|
lines.push("");
|
|
91366
91404
|
}
|
|
91367
|
-
lines.push(` ${
|
|
91405
|
+
lines.push(` ${import_picocolors72.default.dim("inspect one with")} ${import_picocolors72.default.cyan("brainbase task get <id>")}`, "");
|
|
91368
91406
|
return lines.join(`
|
|
91369
91407
|
`);
|
|
91370
91408
|
}
|
|
@@ -91372,16 +91410,16 @@ function statusLabel(status) {
|
|
|
91372
91410
|
const padded = sanitizeLabel(status).padEnd(14);
|
|
91373
91411
|
switch (status) {
|
|
91374
91412
|
case "success":
|
|
91375
|
-
return
|
|
91413
|
+
return import_picocolors72.default.green(padded);
|
|
91376
91414
|
case "fail":
|
|
91377
|
-
return
|
|
91415
|
+
return import_picocolors72.default.red(padded);
|
|
91378
91416
|
case "need_more_info":
|
|
91379
|
-
return
|
|
91417
|
+
return import_picocolors72.default.yellow(padded);
|
|
91380
91418
|
case "running":
|
|
91381
91419
|
case "initializing":
|
|
91382
|
-
return
|
|
91420
|
+
return import_picocolors72.default.cyan(padded);
|
|
91383
91421
|
default:
|
|
91384
|
-
return
|
|
91422
|
+
return import_picocolors72.default.dim(padded);
|
|
91385
91423
|
}
|
|
91386
91424
|
}
|
|
91387
91425
|
|
|
@@ -91391,6 +91429,7 @@ async function runTaskGet(taskId, options = {}) {
|
|
|
91391
91429
|
banner("task get — one task");
|
|
91392
91430
|
const task = await masApi.getTask(taskId);
|
|
91393
91431
|
const evals = await readEvalRuns(task);
|
|
91432
|
+
warnModelNotice(task.id, task);
|
|
91394
91433
|
if (options.json) {
|
|
91395
91434
|
const payload = { task, eval_runs: evals.runs };
|
|
91396
91435
|
if (evals.unavailable)
|
|
@@ -91415,60 +91454,60 @@ async function readEvalRuns(task) {
|
|
|
91415
91454
|
}
|
|
91416
91455
|
function format2(task, evals, names) {
|
|
91417
91456
|
const lines = [""];
|
|
91418
|
-
const title = sanitizeLabel(task.title ?? "").trim() ||
|
|
91457
|
+
const title = sanitizeLabel(task.title ?? "").trim() || import_picocolors73.default.dim("(untitled)");
|
|
91419
91458
|
const id = sanitizeLabel(task.id);
|
|
91420
|
-
lines.push(` ${statusLabel(task.status)} ${
|
|
91459
|
+
lines.push(` ${statusLabel(task.status)} ${import_picocolors73.default.bold(title)}`);
|
|
91421
91460
|
lines.push("");
|
|
91422
|
-
lines.push(` ${
|
|
91423
|
-
lines.push(` ${
|
|
91461
|
+
lines.push(` ${import_picocolors73.default.dim("task")} ${id}`);
|
|
91462
|
+
lines.push(` ${import_picocolors73.default.dim("agent")} ${agentLabel(task.agent_id, names)}`);
|
|
91424
91463
|
if (task.model !== undefined) {
|
|
91425
|
-
const model = task.model?.trim() ? sanitizeLabel(task.model) :
|
|
91426
|
-
lines.push(` ${
|
|
91464
|
+
const model = task.model?.trim() ? sanitizeLabel(task.model) : import_picocolors73.default.dim("agent default");
|
|
91465
|
+
lines.push(` ${import_picocolors73.default.dim("model")} ${model}`);
|
|
91427
91466
|
}
|
|
91428
|
-
lines.push(` ${
|
|
91467
|
+
lines.push(` ${import_picocolors73.default.dim("created")} ${sanitizeLabel(task.created_at)}`);
|
|
91429
91468
|
if (task.parent_task_id) {
|
|
91430
|
-
lines.push(` ${
|
|
91469
|
+
lines.push(` ${import_picocolors73.default.dim("parent")} ${sanitizeLabel(task.parent_task_id)}`);
|
|
91431
91470
|
}
|
|
91432
91471
|
if (task.machine_id) {
|
|
91433
91472
|
const size2 = task.machine_size ? ` (size ${sanitizeLabel(task.machine_size)})` : "";
|
|
91434
|
-
lines.push(` ${
|
|
91473
|
+
lines.push(` ${import_picocolors73.default.dim("machine")} ${sanitizeLabel(task.machine_id)}${size2}`);
|
|
91435
91474
|
}
|
|
91436
91475
|
if (task.sandbox_id)
|
|
91437
|
-
lines.push(` ${
|
|
91476
|
+
lines.push(` ${import_picocolors73.default.dim("sandbox")} ${sanitizeLabel(task.sandbox_id)}`);
|
|
91438
91477
|
const [failure, ...failureRest] = sanitizeLines(failureSummary(task) ?? "").filter((line2) => line2.trim());
|
|
91439
91478
|
if (failure) {
|
|
91440
91479
|
const label3 = " failure ";
|
|
91441
91480
|
lines.push("");
|
|
91442
|
-
lines.push(` ${
|
|
91481
|
+
lines.push(` ${import_picocolors73.default.red("failure")} ${failure}`);
|
|
91443
91482
|
for (const line2 of failureRest)
|
|
91444
91483
|
lines.push(`${" ".repeat(label3.length)}${line2}`);
|
|
91445
91484
|
}
|
|
91446
91485
|
const metadata = Object.entries(task.metadata ?? {});
|
|
91447
91486
|
if (metadata.length > 0) {
|
|
91448
91487
|
lines.push("");
|
|
91449
|
-
lines.push(` ${
|
|
91488
|
+
lines.push(` ${import_picocolors73.default.bold(import_picocolors73.default.dim("METADATA"))}`);
|
|
91450
91489
|
for (const [key2, value3] of metadata) {
|
|
91451
|
-
lines.push(` ${
|
|
91490
|
+
lines.push(` ${import_picocolors73.default.dim(sanitizeLabel(key2))} ${sanitizeLabel(String(value3))}`);
|
|
91452
91491
|
}
|
|
91453
91492
|
}
|
|
91454
91493
|
lines.push("");
|
|
91455
|
-
lines.push(` ${
|
|
91494
|
+
lines.push(` ${import_picocolors73.default.bold(import_picocolors73.default.dim("EVAL VERDICTS"))}`);
|
|
91456
91495
|
if (evals.unavailable) {
|
|
91457
|
-
lines.push(` ${
|
|
91496
|
+
lines.push(` ${import_picocolors73.default.dim(sanitizeLabel(evals.unavailable))}`);
|
|
91458
91497
|
} else if (evals.runs.length === 0) {
|
|
91459
|
-
lines.push(` ${
|
|
91498
|
+
lines.push(` ${import_picocolors73.default.dim("none")}`);
|
|
91460
91499
|
} else {
|
|
91461
91500
|
for (const run of evals.runs) {
|
|
91462
|
-
const verdict = run.passed === true ?
|
|
91501
|
+
const verdict = run.passed === true ? import_picocolors73.default.green("pass") : run.passed === false ? import_picocolors73.default.red("fail") : import_picocolors73.default.dim(sanitizeLabel(run.status));
|
|
91463
91502
|
lines.push(` ${verdict} ${sanitizeLabel(run.eval_slug ?? run.eval_id)}`);
|
|
91464
91503
|
for (const line2 of sanitizeLines(run.reasoning ?? "")) {
|
|
91465
91504
|
if (line2.trim())
|
|
91466
|
-
lines.push(` ${
|
|
91505
|
+
lines.push(` ${import_picocolors73.default.dim(line2)}`);
|
|
91467
91506
|
}
|
|
91468
91507
|
}
|
|
91469
91508
|
}
|
|
91470
91509
|
lines.push("");
|
|
91471
|
-
lines.push(` ${
|
|
91510
|
+
lines.push(` ${import_picocolors73.default.dim("read its transcript with")} ${import_picocolors73.default.cyan(`brainbase task logs ${id}`)}`, "");
|
|
91472
91511
|
return lines.join(`
|
|
91473
91512
|
`);
|
|
91474
91513
|
}
|
|
@@ -91485,7 +91524,7 @@ function failureSummary(task) {
|
|
|
91485
91524
|
}
|
|
91486
91525
|
|
|
91487
91526
|
// src/cli/task-logs.ts
|
|
91488
|
-
var
|
|
91527
|
+
var import_picocolors74 = __toESM(require_picocolors(), 1);
|
|
91489
91528
|
|
|
91490
91529
|
// src/core/task-events.ts
|
|
91491
91530
|
var LEGACY_RETRY_BUDGET_MS = 60000;
|
|
@@ -92066,7 +92105,7 @@ async function runTaskLogs(taskId, options = {}, dependencies = {}) {
|
|
|
92066
92105
|
const setExitCode = dependencies.setExitCode ?? ((code) => process.exitCode = code);
|
|
92067
92106
|
events = error2.collected;
|
|
92068
92107
|
renderTranscript(events, options);
|
|
92069
|
-
console.error(
|
|
92108
|
+
console.error(import_picocolors74.default.dim(error2.message));
|
|
92070
92109
|
setExitCode(error2 instanceof TranscriptPageBudgetExhaustedError ? STREAM_EXHAUSTED_EXIT_CODE : 1);
|
|
92071
92110
|
return;
|
|
92072
92111
|
}
|
|
@@ -92090,14 +92129,14 @@ function renderTranscript(events, options) {
|
|
|
92090
92129
|
console.log(renderEvent(event, messages));
|
|
92091
92130
|
}
|
|
92092
92131
|
if (ordered.length === 0) {
|
|
92093
|
-
console.log(
|
|
92132
|
+
console.log(import_picocolors74.default.dim("No events for this task yet."));
|
|
92094
92133
|
}
|
|
92095
92134
|
}
|
|
92096
92135
|
async function followTranscript(taskId, options, dependencies) {
|
|
92097
92136
|
const backfill = options.limit === undefined ? "" : `?backfill=${options.limit}`;
|
|
92098
92137
|
const { url: url2, resolveBearer } = await masStreamTarget(`/tasks/${encodeURIComponent(taskId)}/events/stream${backfill}`);
|
|
92099
92138
|
if (!options.json) {
|
|
92100
|
-
console.log(
|
|
92139
|
+
console.log(import_picocolors74.default.dim(`Following task ${taskId} — Ctrl-C to stop.`));
|
|
92101
92140
|
}
|
|
92102
92141
|
const setExitCode = dependencies.setExitCode ?? ((code) => process.exitCode = code);
|
|
92103
92142
|
const controller = new AbortController;
|
|
@@ -92142,20 +92181,20 @@ async function followTranscript(taskId, options, dependencies) {
|
|
|
92142
92181
|
} else if (options.json) {
|
|
92143
92182
|
console.log(JSON.stringify(frame));
|
|
92144
92183
|
} else {
|
|
92145
|
-
console.log(
|
|
92184
|
+
console.log(import_picocolors74.default.dim(frame.type));
|
|
92146
92185
|
}
|
|
92147
92186
|
},
|
|
92148
92187
|
onOpen: () => settle.noteFrame(),
|
|
92149
92188
|
onReconnect: (reason) => {
|
|
92150
92189
|
settle.noteDisconnected();
|
|
92151
|
-
console.error(
|
|
92190
|
+
console.error(import_picocolors74.default.dim(`reconnecting — ${reason}`));
|
|
92152
92191
|
}
|
|
92153
92192
|
});
|
|
92154
92193
|
if (interruptCode !== undefined)
|
|
92155
92194
|
setExitCode(interruptCode);
|
|
92156
92195
|
} catch (error2) {
|
|
92157
92196
|
if (error2 instanceof FollowBudgetExhaustedError) {
|
|
92158
|
-
console.error(
|
|
92197
|
+
console.error(import_picocolors74.default.red(error2.message));
|
|
92159
92198
|
setExitCode(STREAM_EXHAUSTED_EXIT_CODE);
|
|
92160
92199
|
return;
|
|
92161
92200
|
}
|
|
@@ -92516,6 +92555,7 @@ async function runTaskSend(taskId, message3, options = {}) {
|
|
|
92516
92555
|
} finally {
|
|
92517
92556
|
stopWatching();
|
|
92518
92557
|
}
|
|
92558
|
+
warnModelNotice(taskId, result2);
|
|
92519
92559
|
if (options.json) {
|
|
92520
92560
|
console.log(JSON.stringify({ ...result2, expected_generation: expectedGeneration }, null, 2));
|
|
92521
92561
|
} else {
|
|
@@ -92942,78 +92982,80 @@ ${didYouMean(sub, ["create", "list", "get", "logs", "send", "stop", "update", "d
|
|
|
92942
92982
|
function printHelp5() {
|
|
92943
92983
|
const out = [];
|
|
92944
92984
|
out.push("");
|
|
92945
|
-
out.push(` ${
|
|
92985
|
+
out.push(` ${import_picocolors75.default.bold("brainbase task")} ${import_picocolors75.default.dim("<sub> [options]")}`);
|
|
92946
92986
|
out.push("");
|
|
92947
|
-
out.push(` ${
|
|
92948
|
-
out.push(` ${
|
|
92949
|
-
out.push(` ${
|
|
92950
|
-
out.push(` ${
|
|
92951
|
-
out.push(` ${
|
|
92952
|
-
out.push(` ${
|
|
92953
|
-
out.push(` ${
|
|
92954
|
-
out.push(` ${
|
|
92987
|
+
out.push(` ${import_picocolors75.default.cyan("create")} ${import_picocolors75.default.dim("--message <text>")} ${import_picocolors75.default.dim("create a task and start its first run")}`);
|
|
92988
|
+
out.push(` ${import_picocolors75.default.cyan("list | ls")} ${import_picocolors75.default.dim("recent tasks you can reach (--json for scripts)")}`);
|
|
92989
|
+
out.push(` ${import_picocolors75.default.cyan("get")} ${import_picocolors75.default.dim("<task-id>")} ${import_picocolors75.default.dim("one task: status, agent, machine, eval verdicts")}`);
|
|
92990
|
+
out.push(` ${import_picocolors75.default.cyan("logs")} ${import_picocolors75.default.dim("<task-id> [--follow]")} ${import_picocolors75.default.dim("one line per event in the task's transcript, or tail it live")}`);
|
|
92991
|
+
out.push(` ${import_picocolors75.default.cyan("send")} ${import_picocolors75.default.dim("<task-id> <message>")} ${import_picocolors75.default.dim("send a follow-up, including while the agent is running")}`);
|
|
92992
|
+
out.push(` ${import_picocolors75.default.cyan("stop")} ${import_picocolors75.default.dim("<task-id>")} ${import_picocolors75.default.dim("stop execution and cancel pending follow-ups, retaining their text")}`);
|
|
92993
|
+
out.push(` ${import_picocolors75.default.cyan("update")} ${import_picocolors75.default.dim("<task-id>")} ${import_picocolors75.default.dim("rename a task, change its metadata labels, switch its model or reset it to the agent default, including while it runs")}`);
|
|
92994
|
+
out.push(` ${import_picocolors75.default.cyan("delete")} ${import_picocolors75.default.dim("<task-id>")} ${import_picocolors75.default.dim("permanently delete a stopped task and tear down its sandbox (--yes to skip the prompt)")}`);
|
|
92955
92995
|
out.push("");
|
|
92956
|
-
out.push(` ${
|
|
92957
|
-
out.push(` ${
|
|
92958
|
-
out.push(` ${
|
|
92959
|
-
out.push(` ${
|
|
92960
|
-
out.push(` ${
|
|
92961
|
-
out.push(` ${
|
|
92962
|
-
out.push(` ${
|
|
92963
|
-
out.push(` ${
|
|
92964
|
-
out.push(` ${
|
|
92965
|
-
out.push(` ${
|
|
92996
|
+
out.push(` ${import_picocolors75.default.bold("create flags")}`);
|
|
92997
|
+
out.push(` ${import_picocolors75.default.dim("--message <text>")} required first user message`);
|
|
92998
|
+
out.push(` ${import_picocolors75.default.dim("--agent <id>")} override the claimed agent in brainbase.agent.yaml`);
|
|
92999
|
+
out.push(` ${import_picocolors75.default.dim("--interface <id>")} open it as a build conversation for this interface (agent defaults to the interface's)`);
|
|
93000
|
+
out.push(` ${import_picocolors75.default.dim("--title <text>")} optional task title`);
|
|
93001
|
+
out.push(` ${import_picocolors75.default.dim("--model <id>")} optional model override`);
|
|
93002
|
+
out.push(` ${import_picocolors75.default.dim("--version <v>")} run a saved version of the agent: 12, v12 or a version id (\`agent versions list\`)`);
|
|
93003
|
+
out.push(` ${import_picocolors75.default.dim("--metadata key=value")} label the task (repeatable)`);
|
|
93004
|
+
out.push(` ${import_picocolors75.default.dim("--wait")} block until the task finishes; exit 1 unless it succeeded`);
|
|
93005
|
+
out.push(` ${import_picocolors75.default.dim("--timeout <secs>")} give up waiting after <secs> and exit 1 (needs --wait)`);
|
|
92966
93006
|
out.push("");
|
|
92967
|
-
out.push(` ${
|
|
92968
|
-
out.push(` ${
|
|
92969
|
-
out.push(` ${
|
|
92970
|
-
out.push(` ${
|
|
92971
|
-
out.push(` ${
|
|
93007
|
+
out.push(` ${import_picocolors75.default.bold("list flags")}`);
|
|
93008
|
+
out.push(` ${import_picocolors75.default.dim("--agent <id>")} only this agent's tasks`);
|
|
93009
|
+
out.push(` ${import_picocolors75.default.dim("--interface <id>")} only this interface's build conversations (hidden from a plain list)`);
|
|
93010
|
+
out.push(` ${import_picocolors75.default.dim("--metadata key=value")} only tasks carrying this label (repeatable; all must match)`);
|
|
93011
|
+
out.push(` ${import_picocolors75.default.dim("--limit <n>")} cap the page (1-200, server default 50)`);
|
|
92972
93012
|
out.push("");
|
|
92973
|
-
out.push(` ${
|
|
92974
|
-
out.push(` ${
|
|
92975
|
-
out.push(` ${
|
|
93013
|
+
out.push(` ${import_picocolors75.default.bold("logs flags")}`);
|
|
93014
|
+
out.push(` ${import_picocolors75.default.dim("--limit <n>")} stop after <n> events instead of the whole transcript; with --follow, the first page size`);
|
|
93015
|
+
out.push(` ${import_picocolors75.default.dim("--follow, -f")} stay attached and print events as they land, until the task finishes and any queued follow-ups have run`);
|
|
92976
93016
|
out.push("");
|
|
92977
|
-
out.push(` ${
|
|
92978
|
-
out.push(` ${
|
|
92979
|
-
out.push(` ${
|
|
92980
|
-
out.push(` ${
|
|
92981
|
-
out.push(` ${
|
|
92982
|
-
out.push(` ${
|
|
92983
|
-
out.push(` ${
|
|
92984
|
-
out.push(` ${
|
|
92985
|
-
out.push(` ${
|
|
93017
|
+
out.push(` ${import_picocolors75.default.bold("update flags")}`);
|
|
93018
|
+
out.push(` ${import_picocolors75.default.dim("--title <text>")} new title`);
|
|
93019
|
+
out.push(` ${import_picocolors75.default.dim("--clear-title")} remove the title; automatic titling may name the task again on a later turn`);
|
|
93020
|
+
out.push(` ${import_picocolors75.default.dim("--metadata key=value")} set one label, keeping the others (repeatable)`);
|
|
93021
|
+
out.push(` ${import_picocolors75.default.dim("--unset-metadata <key>")} remove one label (repeatable)`);
|
|
93022
|
+
out.push(` ${import_picocolors75.default.dim(" the server applies label edits in one step, so concurrent edits from other clients are kept")}`);
|
|
93023
|
+
out.push(` ${import_picocolors75.default.dim("--clear-metadata")} remove every label; with --metadata, the labels become exactly those given`);
|
|
93024
|
+
out.push(` ${import_picocolors75.default.dim("--model <id>")} switch the model the task's next turn runs on (the running turn keeps its model)`);
|
|
93025
|
+
out.push(` ${import_picocolors75.default.dim("--clear-model")} go back to the agent's default model from the next turn`);
|
|
93026
|
+
out.push(` ${import_picocolors75.default.dim(" when a task's picked model has been retired, create, send and get print a warning on stderr until one of these two decides")}`);
|
|
92986
93027
|
out.push("");
|
|
92987
|
-
out.push(` ${
|
|
92988
|
-
out.push(` ${
|
|
92989
|
-
out.push(` ${
|
|
92990
|
-
out.push(` ${
|
|
93028
|
+
out.push(` ${import_picocolors75.default.bold("send flags")}`);
|
|
93029
|
+
out.push(` ${import_picocolors75.default.dim("--input-id <uuid>")} recover the same request using its original ID and identical message`);
|
|
93030
|
+
out.push(` ${import_picocolors75.default.dim(" omit it to send a new follow-up; an unconfirmed receipt is never automatically replayed")}`);
|
|
93031
|
+
out.push(` ${import_picocolors75.default.dim(" admission disabled/recovery unavailable means no input was admitted; retry the same ID after recovery")}`);
|
|
92991
93032
|
out.push("");
|
|
92992
|
-
out.push(` ${
|
|
92993
|
-
out.push(` ${
|
|
92994
|
-
out.push(` ${
|
|
93033
|
+
out.push(` ${import_picocolors75.default.bold("send and stop flags")}`);
|
|
93034
|
+
out.push(` ${import_picocolors75.default.dim("--generation <n>")} retain the printed generation when retrying; defaults to a fresh snapshot for a new operation`);
|
|
93035
|
+
out.push(` ${import_picocolors75.default.dim(" Stop errors may follow queued-input cancellation; retry the printed command to avoid stopping newer work")}`);
|
|
92995
93036
|
out.push("");
|
|
92996
|
-
out.push(` ${
|
|
92997
|
-
out.push(` ${
|
|
92998
|
-
out.push(` ${
|
|
92999
|
-
out.push(` ${
|
|
93037
|
+
out.push(` ${import_picocolors75.default.bold("every subcommand")}`);
|
|
93038
|
+
out.push(` ${import_picocolors75.default.dim("--json")} machine-readable output — create prints task_id, agent_id and status (with --version, also agent_version_id and version_number); list, get, logs, send, stop and update print the raw records; delete prints id and deleted`);
|
|
93039
|
+
out.push(` ${import_picocolors75.default.dim(" send and stop include expected_generation for safe retries; send also reports idempotency_replayed when present")}`);
|
|
93040
|
+
out.push(` ${import_picocolors75.default.dim(" logs --follow --json prints one record per line, since a live stream has no end to close on")}`);
|
|
93041
|
+
out.push(` ${import_picocolors75.default.dim(" create, send and get carry model_notice when the task's picked model has been retired; the warning itself goes to stderr")}`);
|
|
93000
93042
|
out.push("");
|
|
93001
|
-
out.push(` ${
|
|
93002
|
-
out.push(` ${
|
|
93003
|
-
out.push(` ${
|
|
93004
|
-
out.push(` ${
|
|
93043
|
+
out.push(` ${import_picocolors75.default.dim("Exit codes with --wait:")} ${import_picocolors75.default.dim("0 succeeded · 1 failed, needs input, or timed out · 130 interrupted")}`);
|
|
93044
|
+
out.push(` ${import_picocolors75.default.dim("Exit codes with --follow:")} ${import_picocolors75.default.dim("0 task reached a terminal state · 1 stream refused, or unreachable for 60s · 130 interrupted (Ctrl-C) · 143 terminated")}`);
|
|
93045
|
+
out.push(` ${import_picocolors75.default.dim("Exit codes with send:")} ${import_picocolors75.default.dim("0 queued, dispatching, submitted or completed · 1 unconfirmed, cancelled, failed or request error")}`);
|
|
93046
|
+
out.push(` ${import_picocolors75.default.dim("Ctrl-C while waiting or following logs detaches; use task stop to cancel remote work.")}`);
|
|
93005
93047
|
out.push("");
|
|
93006
|
-
out.push(` ${
|
|
93048
|
+
out.push(` ${import_picocolors75.default.dim("Flag-like values:")} use ${import_picocolors75.default.cyan("--flag=value")} or ${import_picocolors75.default.cyan("--flag -- <value>")}`);
|
|
93007
93049
|
out.push("");
|
|
93008
93050
|
console.log(out.join(`
|
|
93009
93051
|
`));
|
|
93010
93052
|
}
|
|
93011
93053
|
|
|
93012
93054
|
// src/cli/machine.ts
|
|
93013
|
-
var
|
|
93055
|
+
var import_picocolors78 = __toESM(require_picocolors(), 1);
|
|
93014
93056
|
|
|
93015
93057
|
// src/cli/machine-list.ts
|
|
93016
|
-
var
|
|
93058
|
+
var import_picocolors76 = __toESM(require_picocolors(), 1);
|
|
93017
93059
|
async function runMachineList(args = {}) {
|
|
93018
93060
|
if (!args.json)
|
|
93019
93061
|
banner("machine list — sandboxes you can reach");
|
|
@@ -93031,7 +93073,7 @@ async function runMachineList(args = {}) {
|
|
|
93031
93073
|
function formatMachineList(machines, includedDead, names = new Map) {
|
|
93032
93074
|
const lines = [""];
|
|
93033
93075
|
if (machines.length === 0) {
|
|
93034
|
-
lines.push(` ${
|
|
93076
|
+
lines.push(` ${import_picocolors76.default.dim(includedDead ? "No machines." : "No live machines. Pass --all to include torn-down ones.")}`, "");
|
|
93035
93077
|
return lines.join(`
|
|
93036
93078
|
`);
|
|
93037
93079
|
}
|
|
@@ -93051,7 +93093,7 @@ function formatMachineList(machines, includedDead, names = new Map) {
|
|
|
93051
93093
|
const statusWidth = width((row) => row.status);
|
|
93052
93094
|
const sizeWidth = width((row) => row.size);
|
|
93053
93095
|
const agentWidth = width((row) => row.agent);
|
|
93054
|
-
lines.push(` ${
|
|
93096
|
+
lines.push(` ${import_picocolors76.default.dim([
|
|
93055
93097
|
header.id.padEnd(idWidth),
|
|
93056
93098
|
header.kind.padEnd(kindWidth),
|
|
93057
93099
|
header.status.padEnd(statusWidth),
|
|
@@ -93067,21 +93109,21 @@ function formatMachineList(machines, includedDead, names = new Map) {
|
|
|
93067
93109
|
row.dead ? status : statusTint(row.status, status),
|
|
93068
93110
|
row.size.padEnd(sizeWidth),
|
|
93069
93111
|
row.agent.padEnd(agentWidth),
|
|
93070
|
-
|
|
93112
|
+
import_picocolors76.default.dim(row.age)
|
|
93071
93113
|
].join(" ");
|
|
93072
|
-
lines.push(` ${row.dead ?
|
|
93114
|
+
lines.push(` ${row.dead ? import_picocolors76.default.dim(cells) : cells}`);
|
|
93073
93115
|
}
|
|
93074
|
-
lines.push("", ` ${
|
|
93116
|
+
lines.push("", ` ${import_picocolors76.default.dim("tear one down with")} ${import_picocolors76.default.cyan("brainbase machine rm <id>")}`, "");
|
|
93075
93117
|
return lines.join(`
|
|
93076
93118
|
`);
|
|
93077
93119
|
}
|
|
93078
93120
|
function statusTint(status, padded) {
|
|
93079
93121
|
switch (status) {
|
|
93080
93122
|
case "running":
|
|
93081
|
-
return
|
|
93123
|
+
return import_picocolors76.default.green(padded);
|
|
93082
93124
|
case "stopped":
|
|
93083
93125
|
case "starting":
|
|
93084
|
-
return
|
|
93126
|
+
return import_picocolors76.default.yellow(padded);
|
|
93085
93127
|
default:
|
|
93086
93128
|
return padded;
|
|
93087
93129
|
}
|
|
@@ -93104,7 +93146,7 @@ function age(createdAt) {
|
|
|
93104
93146
|
}
|
|
93105
93147
|
|
|
93106
93148
|
// src/cli/machine-rm.ts
|
|
93107
|
-
var
|
|
93149
|
+
var import_picocolors77 = __toESM(require_picocolors(), 1);
|
|
93108
93150
|
async function runMachineRm(args, dependencies = {}) {
|
|
93109
93151
|
const setExitCode = dependencies.setExitCode ?? ((code) => process.exitCode = code);
|
|
93110
93152
|
const machineId = args.machineId?.trim();
|
|
@@ -93118,7 +93160,7 @@ async function runMachineRm(args, dependencies = {}) {
|
|
|
93118
93160
|
if (args.json) {
|
|
93119
93161
|
console.log(JSON.stringify({ id: machineId, torn_down: false, outcome: "declined" }, null, 2));
|
|
93120
93162
|
} else {
|
|
93121
|
-
console.log(` ${
|
|
93163
|
+
console.log(` ${import_picocolors77.default.dim("Left alone.")}`);
|
|
93122
93164
|
}
|
|
93123
93165
|
return;
|
|
93124
93166
|
}
|
|
@@ -93136,7 +93178,7 @@ async function promptForTeardown(args) {
|
|
|
93136
93178
|
return true;
|
|
93137
93179
|
if (!args.json) {
|
|
93138
93180
|
console.log(`
|
|
93139
|
-
${
|
|
93181
|
+
${import_picocolors77.default.red("This destroys the sandbox.")} ${import_picocolors77.default.dim("Anything not committed out of it is lost. The machine row is kept for cost history.")}
|
|
93140
93182
|
`);
|
|
93141
93183
|
}
|
|
93142
93184
|
const answer = await se({
|
|
@@ -93148,9 +93190,9 @@ async function promptForTeardown(args) {
|
|
|
93148
93190
|
function formatMachineRm(machine) {
|
|
93149
93191
|
const lines = [""];
|
|
93150
93192
|
if (machine.destroyed_at) {
|
|
93151
|
-
lines.push(` ${
|
|
93193
|
+
lines.push(` ${import_picocolors77.default.green("✓")} ${machine.kind} sandbox ${machine.id} is torn down.`, ` ${import_picocolors77.default.dim(`destroyed_at ${machine.destroyed_at}`)}`);
|
|
93152
93194
|
} else {
|
|
93153
|
-
lines.push(` ${
|
|
93195
|
+
lines.push(` ${import_picocolors77.default.yellow("!")} ${machine.id} came back without a teardown timestamp (status ${machine.status}).`, ` ${import_picocolors77.default.dim("Re-check with `brainbase machine ls --all` before assuming it stopped billing.")}`);
|
|
93154
93196
|
}
|
|
93155
93197
|
lines.push("");
|
|
93156
93198
|
return lines.join(`
|
|
@@ -93191,25 +93233,25 @@ ${didYouMean(sub, ["ls", "rm"], "brainbase machine")}`);
|
|
|
93191
93233
|
function printHelp6() {
|
|
93192
93234
|
const out = [];
|
|
93193
93235
|
out.push("");
|
|
93194
|
-
out.push(` ${
|
|
93236
|
+
out.push(` ${import_picocolors78.default.bold("brainbase machine")} ${import_picocolors78.default.dim("<sub> [options]")}`);
|
|
93195
93237
|
out.push("");
|
|
93196
|
-
out.push(` ${
|
|
93197
|
-
out.push(` ${
|
|
93238
|
+
out.push(` ${import_picocolors78.default.cyan("ls")} ${import_picocolors78.default.dim("list your sandboxes — live ones only unless --all")}`);
|
|
93239
|
+
out.push(` ${import_picocolors78.default.cyan("rm")} ${import_picocolors78.default.dim("<id>")} ${import_picocolors78.default.dim("tear a sandbox down (terminal; the row is kept for cost history)")}`);
|
|
93198
93240
|
out.push("");
|
|
93199
|
-
out.push(` ${
|
|
93200
|
-
out.push(` ${
|
|
93201
|
-
out.push(` ${
|
|
93202
|
-
out.push(` ${
|
|
93241
|
+
out.push(` ${import_picocolors78.default.dim("--all")} ${import_picocolors78.default.dim("for ls: include machines already torn down")}`);
|
|
93242
|
+
out.push(` ${import_picocolors78.default.dim("--limit <n>")} ${import_picocolors78.default.dim("for ls: how many to fetch (1-200, default 50)")}`);
|
|
93243
|
+
out.push(` ${import_picocolors78.default.dim("--yes, -y")} ${import_picocolors78.default.dim("for rm: skip the confirmation")}`);
|
|
93244
|
+
out.push(` ${import_picocolors78.default.dim("--json")} ${import_picocolors78.default.dim("machine-readable output")}`);
|
|
93203
93245
|
out.push("");
|
|
93204
93246
|
console.log(out.join(`
|
|
93205
93247
|
`));
|
|
93206
93248
|
}
|
|
93207
93249
|
|
|
93208
93250
|
// src/cli/interface.ts
|
|
93209
|
-
var
|
|
93251
|
+
var import_picocolors84 = __toESM(require_picocolors(), 1);
|
|
93210
93252
|
|
|
93211
93253
|
// src/cli/interface-build.ts
|
|
93212
|
-
var
|
|
93254
|
+
var import_picocolors79 = __toESM(require_picocolors(), 1);
|
|
93213
93255
|
var USAGE2 = 'brainbase interface build <id> "<request>" [--timeout <seconds>] [--idempotency-key <key>] [--json]';
|
|
93214
93256
|
var SETTLE_TIMEOUT_MS = 120000;
|
|
93215
93257
|
async function reportingErrors(json4, work) {
|
|
@@ -93308,28 +93350,28 @@ function buildExitCode(outcome) {
|
|
|
93308
93350
|
function reportBuild(say, interfaceId, outcome, timeoutSeconds) {
|
|
93309
93351
|
switch (outcome.kind) {
|
|
93310
93352
|
case "built":
|
|
93311
|
-
say(` ${
|
|
93353
|
+
say(` ${import_picocolors79.default.dim("build")} ${safe(outcome.build.id)} ${import_picocolors79.default.green("succeeded")}`);
|
|
93312
93354
|
say("");
|
|
93313
|
-
say(` ${
|
|
93355
|
+
say(` ${import_picocolors79.default.dim("Next:")} ${import_picocolors79.default.cyan(`brainbase interface publish ${safe(interfaceId)}`)}`);
|
|
93314
93356
|
return;
|
|
93315
93357
|
case "failed": {
|
|
93316
93358
|
const reason = outcome.build?.error_summary ?? outcome.operation?.error ?? outcome.operation?.reason ?? null;
|
|
93317
|
-
say(` ${
|
|
93359
|
+
say(` ${import_picocolors79.default.dim("build")} ${outcome.build ? safe(outcome.build.id) : import_picocolors79.default.dim("none")} ${import_picocolors79.default.red("failed")}`);
|
|
93318
93360
|
if (reason)
|
|
93319
93361
|
say(` ${safeBlock(reason).split(`
|
|
93320
93362
|
`).join(`
|
|
93321
93363
|
`)}`);
|
|
93322
|
-
say(` ${
|
|
93364
|
+
say(` ${import_picocolors79.default.dim("Try again with")} ${import_picocolors79.default.cyan(`brainbase interface rebuild ${safe(interfaceId)}`)}`);
|
|
93323
93365
|
return;
|
|
93324
93366
|
}
|
|
93325
93367
|
case "busy":
|
|
93326
|
-
say(` ${
|
|
93368
|
+
say(` ${import_picocolors79.default.yellow(safe(outcome.message))}`);
|
|
93327
93369
|
return;
|
|
93328
93370
|
case "timeout":
|
|
93329
|
-
say(` ${
|
|
93371
|
+
say(` ${import_picocolors79.default.yellow(`Still building after ${timeoutSeconds}s.`)} ${import_picocolors79.default.dim(`It keeps going; check \`brainbase interface builds ${safe(interfaceId)}\`.`)}`);
|
|
93330
93372
|
return;
|
|
93331
93373
|
case "interrupted":
|
|
93332
|
-
say(` ${
|
|
93374
|
+
say(` ${import_picocolors79.default.yellow("Stopped waiting.")} ${import_picocolors79.default.dim(`The build keeps going; check \`brainbase interface builds ${safe(interfaceId)}\`.`)}`);
|
|
93333
93375
|
return;
|
|
93334
93376
|
default: {
|
|
93335
93377
|
const unreachable = outcome;
|
|
@@ -93376,8 +93418,8 @@ async function build(ctx) {
|
|
|
93376
93418
|
throw held;
|
|
93377
93419
|
}
|
|
93378
93420
|
const reattach = `brainbase task logs ${safe(taskId)} --follow`;
|
|
93379
|
-
say(` ${
|
|
93380
|
-
say(` ${
|
|
93421
|
+
say(` ${import_picocolors79.default.dim("Build conversation")} ${import_picocolors79.default.bold(safe(taskId))} ${import_picocolors79.default.dim(`on ${safe(before2.name)}`)}`);
|
|
93422
|
+
say(` ${import_picocolors79.default.dim(`If this stops early, reattach with \`${reattach}\`.`)}`);
|
|
93381
93423
|
const finish = (result2, exitCode) => {
|
|
93382
93424
|
if (json4)
|
|
93383
93425
|
console.log(JSON.stringify({ type: "result", task_id: taskId, ...result2 }));
|
|
@@ -93394,13 +93436,13 @@ async function build(ctx) {
|
|
|
93394
93436
|
});
|
|
93395
93437
|
} catch (error2) {
|
|
93396
93438
|
say("");
|
|
93397
|
-
say(` ${
|
|
93398
|
-
say(` ${
|
|
93439
|
+
say(` ${import_picocolors79.default.red(`Lost the conversation's event stream: ${safe(error2.message)}`)}`);
|
|
93440
|
+
say(` ${import_picocolors79.default.dim(`Conversation ${safe(taskId)} may still be running. Reattach with`)} ${import_picocolors79.default.cyan(reattach)}`);
|
|
93399
93441
|
finish({ version_id: null, build_id: null, status: "stream_lost", task_status: null }, 1);
|
|
93400
93442
|
return;
|
|
93401
93443
|
}
|
|
93402
93444
|
if (followExit !== undefined) {
|
|
93403
|
-
say(` ${
|
|
93445
|
+
say(` ${import_picocolors79.default.yellow("Stopped following.")} ${import_picocolors79.default.dim(`The conversation keeps running. Reattach with \`${reattach}\`.`)}`);
|
|
93404
93446
|
finish({ version_id: null, build_id: null, status: "interrupted", task_status: null }, followExit);
|
|
93405
93447
|
return;
|
|
93406
93448
|
}
|
|
@@ -93420,7 +93462,7 @@ async function build(ctx) {
|
|
|
93420
93462
|
if (settled.kind !== "terminal") {
|
|
93421
93463
|
const interrupted = settled.kind === "interrupted";
|
|
93422
93464
|
const status2 = settled.task?.status ?? null;
|
|
93423
|
-
say(` ${
|
|
93465
|
+
say(` ${import_picocolors79.default.yellow(interrupted ? "Stopped." : `The conversation is still ${safe(status2 ?? "running")}.`)} ${import_picocolors79.default.dim(`Check it with \`brainbase task get ${safe(taskId)}\`.`)}`);
|
|
93424
93466
|
finish({ version_id: null, build_id: null, status: interrupted ? "interrupted" : "task_unsettled", task_status: status2 }, interrupted ? SIGINT_EXIT_CODE : 1);
|
|
93425
93467
|
return;
|
|
93426
93468
|
}
|
|
@@ -93440,36 +93482,36 @@ async function build(ctx) {
|
|
|
93440
93482
|
}
|
|
93441
93483
|
const codes = [exitCodeForTaskStatus(task.status)];
|
|
93442
93484
|
say("");
|
|
93443
|
-
say(` ${
|
|
93485
|
+
say(` ${import_picocolors79.default.dim("conversation")} ${safe(taskId)} ${import_picocolors79.default.dim("ended")} ${safe(task.status)}`);
|
|
93444
93486
|
if (mine?.status === "failed") {
|
|
93445
93487
|
codes.push(1);
|
|
93446
93488
|
const why = [mine.reason, mine.error].filter(Boolean).map((part) => safe(part)).join(": ");
|
|
93447
|
-
say(` ${
|
|
93489
|
+
say(` ${import_picocolors79.default.red(`This conversation's build work failed${why ? ` (${why})` : ""}.`)}`);
|
|
93448
93490
|
} else if (task.status !== "success" && task.status !== "need_more_info") {
|
|
93449
|
-
say(` ${
|
|
93491
|
+
say(` ${import_picocolors79.default.red(`The conversation finished as ${safe(task.status)}.`)} ${import_picocolors79.default.dim(`See \`brainbase task logs ${safe(taskId)}\`.`)}`);
|
|
93450
93492
|
}
|
|
93451
93493
|
if (task.status === "need_more_info") {
|
|
93452
93494
|
const question = await lastAgentMessage(taskId);
|
|
93453
93495
|
say("");
|
|
93454
93496
|
if (question) {
|
|
93455
|
-
say(` ${
|
|
93497
|
+
say(` ${import_picocolors79.default.bold("The agent asks:")}`);
|
|
93456
93498
|
say(` ${safeBlock(question).split(`
|
|
93457
93499
|
`).join(`
|
|
93458
93500
|
`)}`);
|
|
93459
93501
|
} else {
|
|
93460
|
-
say(` ${
|
|
93502
|
+
say(` ${import_picocolors79.default.bold("The agent needs more from you before it can go on.")}`);
|
|
93461
93503
|
}
|
|
93462
93504
|
say("");
|
|
93463
|
-
say(` ${
|
|
93464
|
-
say(` ${
|
|
93505
|
+
say(` ${import_picocolors79.default.dim("Reply with")} ${import_picocolors79.default.cyan(`brainbase task send ${safe(taskId)} "<reply>"`)}`);
|
|
93506
|
+
say(` ${import_picocolors79.default.dim("then follow it with")} ${import_picocolors79.default.cyan(reattach)}`);
|
|
93465
93507
|
}
|
|
93466
93508
|
let status;
|
|
93467
93509
|
let buildId = null;
|
|
93468
93510
|
if (versionId) {
|
|
93469
93511
|
say("");
|
|
93470
|
-
say(` ${
|
|
93512
|
+
say(` ${import_picocolors79.default.dim("version")} ${safe(versionId)}`);
|
|
93471
93513
|
if (!json4)
|
|
93472
|
-
say(` ${
|
|
93514
|
+
say(` ${import_picocolors79.default.dim("Waiting for its build...")}`);
|
|
93473
93515
|
const buildKey = `${key2}-build`;
|
|
93474
93516
|
let outcome;
|
|
93475
93517
|
try {
|
|
@@ -93479,7 +93521,7 @@ async function build(ctx) {
|
|
|
93479
93521
|
signal: stop.signal,
|
|
93480
93522
|
now: deps.now,
|
|
93481
93523
|
idempotencyKey: buildKey,
|
|
93482
|
-
onStall: () => say(` ${
|
|
93524
|
+
onStall: () => say(` ${import_picocolors79.default.yellow("The build looks stalled; still waiting in case another worker picks it up.")}`)
|
|
93483
93525
|
});
|
|
93484
93526
|
} catch (error2) {
|
|
93485
93527
|
if (error2 instanceof LostResponseError) {
|
|
@@ -93495,9 +93537,9 @@ async function build(ctx) {
|
|
|
93495
93537
|
status = noVersionStatus(mine?.status === "failed", task.status);
|
|
93496
93538
|
if (status === "no_version") {
|
|
93497
93539
|
codes.push(1);
|
|
93498
|
-
say(` ${
|
|
93540
|
+
say(` ${import_picocolors79.default.red("The conversation finished without committing a version, so there is nothing to build.")}`);
|
|
93499
93541
|
} else if (task.status !== "need_more_info") {
|
|
93500
|
-
say(` ${
|
|
93542
|
+
say(` ${import_picocolors79.default.dim("This conversation produced no version, so there is nothing to build.")}`);
|
|
93501
93543
|
}
|
|
93502
93544
|
}
|
|
93503
93545
|
if (!json4)
|
|
@@ -93512,7 +93554,7 @@ async function build(ctx) {
|
|
|
93512
93554
|
var buildCommands = { build };
|
|
93513
93555
|
|
|
93514
93556
|
// src/cli/interface-lifecycle.ts
|
|
93515
|
-
var
|
|
93557
|
+
var import_picocolors81 = __toESM(require_picocolors(), 1);
|
|
93516
93558
|
|
|
93517
93559
|
// src/core/org-members.ts
|
|
93518
93560
|
async function listAllOrgMembers(orgId) {
|
|
@@ -93566,7 +93608,7 @@ function membersById(members) {
|
|
|
93566
93608
|
}
|
|
93567
93609
|
|
|
93568
93610
|
// src/cli/interface-read.ts
|
|
93569
|
-
var
|
|
93611
|
+
var import_picocolors80 = __toESM(require_picocolors(), 1);
|
|
93570
93612
|
function interfaceState(row) {
|
|
93571
93613
|
if (row.archived_at)
|
|
93572
93614
|
return "archived";
|
|
@@ -93588,11 +93630,11 @@ function threadsLabel(shared) {
|
|
|
93588
93630
|
function stateTint(state) {
|
|
93589
93631
|
switch (state) {
|
|
93590
93632
|
case "live":
|
|
93591
|
-
return
|
|
93633
|
+
return import_picocolors80.default.green;
|
|
93592
93634
|
case "building":
|
|
93593
|
-
return
|
|
93635
|
+
return import_picocolors80.default.yellow;
|
|
93594
93636
|
case "archived":
|
|
93595
|
-
return
|
|
93637
|
+
return import_picocolors80.default.dim;
|
|
93596
93638
|
case "draft":
|
|
93597
93639
|
return (cell) => cell;
|
|
93598
93640
|
default: {
|
|
@@ -93625,7 +93667,7 @@ async function list3(ctx) {
|
|
|
93625
93667
|
if (shown.length === 0) {
|
|
93626
93668
|
const empty = onlyArchived ? "No archived interfaces." : includeArchived ? "No interfaces. Create one with `brainbase interface create`." : await emptyWithoutArchived(agentId);
|
|
93627
93669
|
console.log(`
|
|
93628
|
-
${
|
|
93670
|
+
${import_picocolors80.default.dim(empty)}
|
|
93629
93671
|
`);
|
|
93630
93672
|
return;
|
|
93631
93673
|
}
|
|
@@ -93638,7 +93680,7 @@ async function list3(ctx) {
|
|
|
93638
93680
|
audienceWord(row),
|
|
93639
93681
|
ago(row.last_edited_at ?? row.created_at, now2)
|
|
93640
93682
|
]);
|
|
93641
|
-
console.log(["", ...table(cells, [null,
|
|
93683
|
+
console.log(["", ...table(cells, [null, import_picocolors80.default.bold, null, null, null, import_picocolors80.default.dim]), ""].join(`
|
|
93642
93684
|
`));
|
|
93643
93685
|
});
|
|
93644
93686
|
}
|
|
@@ -93672,13 +93714,13 @@ async function get2(ctx) {
|
|
|
93672
93714
|
out.push(field2("id", safe(row.id)));
|
|
93673
93715
|
out.push(field2("agent", agentLabel(safe(row.agent_id), await agentNames([row.agent_id]))));
|
|
93674
93716
|
out.push(field2("state", stateTint(state)(state)));
|
|
93675
|
-
out.push(field2("address", row.live_release ? safe(row.live_release.url) : `${safe(row.slug)} ${
|
|
93717
|
+
out.push(field2("address", row.live_release ? safe(row.live_release.url) : `${safe(row.slug)} ${import_picocolors80.default.dim("(nothing live yet)")}`));
|
|
93676
93718
|
out.push(field2("audience", audienceLabel(row)));
|
|
93677
93719
|
out.push(field2("threads", threadsLabel(row.share_agent_threads)));
|
|
93678
|
-
out.push(field2("live", row.live_release ? `${safe(row.live_release.id)} ${
|
|
93679
|
-
out.push(field2("draft", row.draft_version_id ? safe(row.draft_version_id) :
|
|
93720
|
+
out.push(field2("live", row.live_release ? `${safe(row.live_release.id)} ${import_picocolors80.default.dim(`published ${ago(row.live_release.published_at)}`)}` : import_picocolors80.default.dim("none")));
|
|
93721
|
+
out.push(field2("draft", row.draft_version_id ? safe(row.draft_version_id) : import_picocolors80.default.dim("none yet")));
|
|
93680
93722
|
if (row.running_generation) {
|
|
93681
|
-
out.push(field2("building", `conversation ${safe(row.running_generation.thread_id ?? "")} ${
|
|
93723
|
+
out.push(field2("building", `conversation ${safe(row.running_generation.thread_id ?? "")} ${import_picocolors80.default.dim(`(follow it with \`brainbase task logs ${safe(row.running_generation.thread_id ?? "")} --follow\`)`)}`));
|
|
93682
93724
|
}
|
|
93683
93725
|
if (row.archived_at)
|
|
93684
93726
|
out.push(field2("archived", ago(row.archived_at)));
|
|
@@ -93707,7 +93749,7 @@ async function open(ctx) {
|
|
|
93707
93749
|
}
|
|
93708
93750
|
console.log(safe(url2));
|
|
93709
93751
|
if (new URL(url2).hostname.endsWith("vercel.app")) {
|
|
93710
|
-
console.error(
|
|
93752
|
+
console.error(import_picocolors80.default.yellow("This is the raw Vercel deployment address, which sits behind Vercel protection and will not open for viewers. The control plane has no public interfaces domain configured."));
|
|
93711
93753
|
}
|
|
93712
93754
|
});
|
|
93713
93755
|
}
|
|
@@ -93745,7 +93787,7 @@ async function history(ctx, name) {
|
|
|
93745
93787
|
banner(`interface ${name} — ${safe(id)}`);
|
|
93746
93788
|
if (rows.length === 0) {
|
|
93747
93789
|
console.log(`
|
|
93748
|
-
${
|
|
93790
|
+
${import_picocolors80.default.dim(`No ${name} yet.`)}
|
|
93749
93791
|
`);
|
|
93750
93792
|
return;
|
|
93751
93793
|
}
|
|
@@ -93822,7 +93864,7 @@ function exactlyOne(parsed, flags) {
|
|
|
93822
93864
|
}
|
|
93823
93865
|
function peopleLine(access, members) {
|
|
93824
93866
|
const ids = grantIds(access);
|
|
93825
|
-
return ids.length ? namesOf(ids, members) :
|
|
93867
|
+
return ids.length ? namesOf(ids, members) : import_picocolors81.default.dim("nobody named");
|
|
93826
93868
|
}
|
|
93827
93869
|
function printAccess(row, access, members) {
|
|
93828
93870
|
console.log([
|
|
@@ -93918,11 +93960,11 @@ async function create3(ctx) {
|
|
|
93918
93960
|
const id = safe(created.id);
|
|
93919
93961
|
const out = [
|
|
93920
93962
|
"",
|
|
93921
|
-
` ${
|
|
93963
|
+
` ${import_picocolors81.default.green("Created")} ${import_picocolors81.default.bold(safe(created.name))}`,
|
|
93922
93964
|
"",
|
|
93923
93965
|
field2("id", id),
|
|
93924
93966
|
field2("agent", safe(created.agent_id)),
|
|
93925
|
-
field2("address", `${safe(created.slug)} ${
|
|
93967
|
+
field2("address", `${safe(created.slug)} ${import_picocolors81.default.dim("(nothing live yet)")}`),
|
|
93926
93968
|
field2("threads", threadsLabel(created.share_agent_threads))
|
|
93927
93969
|
];
|
|
93928
93970
|
if (access) {
|
|
@@ -93934,11 +93976,11 @@ async function create3(ctx) {
|
|
|
93934
93976
|
out.push("", ` Nobody can open it until you choose who can: \`brainbase interface access ${id} --everyone\` or \`--people <emails>\`.`);
|
|
93935
93977
|
}
|
|
93936
93978
|
if (created.share_agent_threads) {
|
|
93937
|
-
out.push(` ${
|
|
93979
|
+
out.push(` ${import_picocolors81.default.dim(`To show viewers only their own conversations: \`brainbase interface threads ${id} --private\`.`)}`);
|
|
93938
93980
|
}
|
|
93939
93981
|
if (note)
|
|
93940
93982
|
out.push("", ` ${safe(note)}`);
|
|
93941
|
-
out.push("", ` ${
|
|
93983
|
+
out.push("", ` ${import_picocolors81.default.dim(`Next: \`brainbase interface build ${id} "<what to build>"\``)}`, "");
|
|
93942
93984
|
console.log(out.join(`
|
|
93943
93985
|
`));
|
|
93944
93986
|
if (readFailed) {
|
|
@@ -94074,7 +94116,7 @@ async function threads(ctx) {
|
|
|
94074
94116
|
printJson({ id: row.id, share_agent_threads: row.share_agent_threads });
|
|
94075
94117
|
return;
|
|
94076
94118
|
}
|
|
94077
|
-
const already = wanted === null ? "" : ` ${
|
|
94119
|
+
const already = wanted === null ? "" : ` ${import_picocolors81.default.dim("(already set; nothing changed)")}`;
|
|
94078
94120
|
console.log(`
|
|
94079
94121
|
${field2("threads", `${threadsLabel(row.share_agent_threads)}${already}`)}
|
|
94080
94122
|
`);
|
|
@@ -94113,7 +94155,7 @@ async function rename(ctx) {
|
|
|
94113
94155
|
return;
|
|
94114
94156
|
}
|
|
94115
94157
|
console.log(`
|
|
94116
|
-
Renamed ${safe(updated.id)} to ${
|
|
94158
|
+
Renamed ${safe(updated.id)} to ${import_picocolors81.default.bold(safe(updated.name))}.
|
|
94117
94159
|
`);
|
|
94118
94160
|
});
|
|
94119
94161
|
}
|
|
@@ -94149,7 +94191,7 @@ async function address(ctx) {
|
|
|
94149
94191
|
}
|
|
94150
94192
|
const where = updated.live_release ? safe(updated.live_release.url) : safe(updated.slug);
|
|
94151
94193
|
console.log(`
|
|
94152
|
-
${safe(updated.name)} is now at ${
|
|
94194
|
+
${safe(updated.name)} is now at ${import_picocolors81.default.bold(where)}.
|
|
94153
94195
|
`);
|
|
94154
94196
|
});
|
|
94155
94197
|
}
|
|
@@ -94241,9 +94283,9 @@ var lifecycleCommands = {
|
|
|
94241
94283
|
};
|
|
94242
94284
|
|
|
94243
94285
|
// src/cli/interface-preview.ts
|
|
94244
|
-
var
|
|
94286
|
+
var import_picocolors82 = __toESM(require_picocolors(), 1);
|
|
94245
94287
|
function warn(line2) {
|
|
94246
|
-
console.error(
|
|
94288
|
+
console.error(import_picocolors82.default.yellow(line2));
|
|
94247
94289
|
}
|
|
94248
94290
|
var PREVIEW_TIMEOUT_SECONDS = 300;
|
|
94249
94291
|
var PROBE_INTERVAL_MS = 2000;
|
|
@@ -94333,12 +94375,12 @@ async function preview(ctx) {
|
|
|
94333
94375
|
const say = progress(json4);
|
|
94334
94376
|
const row = await interfacesApi.get(id);
|
|
94335
94377
|
const { taskId, why } = await pickConversation(row, stringOption(parsed, "task")?.trim() || undefined);
|
|
94336
|
-
say(
|
|
94378
|
+
say(import_picocolors82.default.dim(` Previewing ${why}, ${safe(taskId)}.`));
|
|
94337
94379
|
const started = await interfacesApi.startPreview(taskId, row.id);
|
|
94338
94380
|
const address2 = previewAddress(started, row);
|
|
94339
94381
|
let outcome = started.state === "serving" ? "serving" : "not_waited";
|
|
94340
94382
|
if (outcome !== "serving" && !noWait) {
|
|
94341
|
-
say(
|
|
94383
|
+
say(import_picocolors82.default.dim(" Starting the dev server in the sandbox…"));
|
|
94342
94384
|
outcome = await waitUntilServing(started, { timeoutMs: waitMs, deps: ctx.deps });
|
|
94343
94385
|
}
|
|
94344
94386
|
if (json4) {
|
|
@@ -94346,12 +94388,12 @@ async function preview(ctx) {
|
|
|
94346
94388
|
} else {
|
|
94347
94389
|
const out = [
|
|
94348
94390
|
"",
|
|
94349
|
-
` ${outcome === "serving" ?
|
|
94391
|
+
` ${outcome === "serving" ? import_picocolors82.default.green("Preview ready") : import_picocolors82.default.yellow("Preview starting")} ${import_picocolors82.default.bold(safe(started.name))}`,
|
|
94350
94392
|
"",
|
|
94351
|
-
field2("address", address2 ? safe(address2) :
|
|
94393
|
+
field2("address", address2 ? safe(address2) : import_picocolors82.default.dim(missingAddress(started))),
|
|
94352
94394
|
field2("showing", showing(started, taskId)),
|
|
94353
94395
|
"",
|
|
94354
|
-
` ${
|
|
94396
|
+
` ${import_picocolors82.default.dim("Opens for people who can edit the agent, after signing in. Nothing is published.")}`,
|
|
94355
94397
|
""
|
|
94356
94398
|
];
|
|
94357
94399
|
console.log(out.join(`
|
|
@@ -94372,13 +94414,13 @@ async function preview(ctx) {
|
|
|
94372
94414
|
var previewCommands = { preview };
|
|
94373
94415
|
|
|
94374
94416
|
// src/cli/interface-release.ts
|
|
94375
|
-
var
|
|
94417
|
+
var import_picocolors83 = __toESM(require_picocolors(), 1);
|
|
94376
94418
|
var PUBLISH_TIMEOUT_SECONDS = 300;
|
|
94377
94419
|
var REBUILD_USAGE = "brainbase interface rebuild <id> [--version <version id>] [--yes]";
|
|
94378
94420
|
var PUBLISH_USAGE = "brainbase interface publish <id> [--build <build id>]";
|
|
94379
94421
|
var ROLLBACK_USAGE = "brainbase interface rollback <id> --release <release id>";
|
|
94380
94422
|
function warn2(line2) {
|
|
94381
|
-
console.error(
|
|
94423
|
+
console.error(import_picocolors83.default.yellow(line2));
|
|
94382
94424
|
}
|
|
94383
94425
|
function text3(value3) {
|
|
94384
94426
|
return typeof value3 === "string" && value3.trim() ? value3 : null;
|
|
@@ -94395,7 +94437,7 @@ async function follow(operationId, what, options) {
|
|
|
94395
94437
|
intervalMs: options.deps.pollIntervalMs,
|
|
94396
94438
|
signal: stop.signal,
|
|
94397
94439
|
now: options.deps.now,
|
|
94398
|
-
onStatus: (operation) => say(
|
|
94440
|
+
onStatus: (operation) => say(import_picocolors83.default.dim(` ${what} ${operation.status}`)),
|
|
94399
94441
|
onStall: () => warn2(`The ${what} looks stalled: its worker stopped checking in. Still waiting, in case another worker picks it up.`)
|
|
94400
94442
|
});
|
|
94401
94443
|
if (outcome.kind === "settled") {
|
|
@@ -94414,7 +94456,7 @@ function reportUnsuccessful(result2, what, options) {
|
|
|
94414
94456
|
if (options.json) {
|
|
94415
94457
|
printJson({ outcome: result2.outcome, operation_id: result2.operationId, operation: result2.operation });
|
|
94416
94458
|
} else if (result2.outcome === "failed") {
|
|
94417
|
-
console.error(
|
|
94459
|
+
console.error(import_picocolors83.default.red(`The ${what} failed (operation ${id}):`));
|
|
94418
94460
|
console.error(safeBlock(result2.operation?.error ?? "Brainbase gave no reason."));
|
|
94419
94461
|
} else if (result2.outcome === "timeout") {
|
|
94420
94462
|
warn2(`Stopped waiting after ${Math.round(options.timeoutMs / 1000)}s. The ${what} keeps running on the server (operation ${id}).`);
|
|
@@ -94474,7 +94516,7 @@ async function rebuild(ctx) {
|
|
|
94474
94516
|
if (json4)
|
|
94475
94517
|
printJson({ outcome: "started", operation_id: operationId, operation });
|
|
94476
94518
|
else
|
|
94477
|
-
console.log(
|
|
94519
|
+
console.log(import_picocolors83.default.dim(` Follow it with \`brainbase interface builds ${safe(id)}\`.`));
|
|
94478
94520
|
return;
|
|
94479
94521
|
}
|
|
94480
94522
|
const result2 = await follow(operationId, "build", { json: json4, timeoutMs: waitMs, deps: ctx.deps });
|
|
@@ -94486,8 +94528,8 @@ async function rebuild(ctx) {
|
|
|
94486
94528
|
}
|
|
94487
94529
|
const buildId = safe(result2.operation?.build_id ?? "");
|
|
94488
94530
|
const version2 = safe(result2.operation?.source_version_id ?? "");
|
|
94489
|
-
console.log(
|
|
94490
|
-
console.log(
|
|
94531
|
+
console.log(import_picocolors83.default.green(`✓ Build ${buildId} succeeded${version2 ? ` (version ${version2})` : ""}.`));
|
|
94532
|
+
console.log(import_picocolors83.default.dim(` Publish it with \`brainbase interface publish ${safe(id)} --build ${buildId}\`.`));
|
|
94491
94533
|
});
|
|
94492
94534
|
}
|
|
94493
94535
|
function liveBuildOf(row, releases) {
|
|
@@ -94545,7 +94587,7 @@ function describeBuild(buildId, builds) {
|
|
|
94545
94587
|
const build2 = builds.find((candidate) => candidate.id === buildId);
|
|
94546
94588
|
if (!build2)
|
|
94547
94589
|
return `build ${safe(buildId)}`;
|
|
94548
|
-
return `build ${safe(build2.id)} ${
|
|
94590
|
+
return `build ${safe(build2.id)} ${import_picocolors83.default.dim(`(version ${safe(build2.source_version_id)}, built ${ago(build2.created_at)})`)}`;
|
|
94549
94591
|
}
|
|
94550
94592
|
function reportAlreadyLive(json4, buildId, releaseId, url2) {
|
|
94551
94593
|
if (json4) {
|
|
@@ -94599,8 +94641,8 @@ async function publish(ctx) {
|
|
|
94599
94641
|
}
|
|
94600
94642
|
if (!json4) {
|
|
94601
94643
|
console.log("");
|
|
94602
|
-
console.log(` ${
|
|
94603
|
-
console.log(` ${
|
|
94644
|
+
console.log(` ${import_picocolors83.default.dim("Live now".padEnd(14))}${liveBuildId ? `${describeBuild(liveBuildId, builds)} at ${safe(row.live_release?.url)}` : row.live_release ? `release ${safe(row.live_release.id)} at ${safe(row.live_release.url)}` : import_picocolors83.default.dim("nothing")}`);
|
|
94645
|
+
console.log(` ${import_picocolors83.default.dim("Will publish".padEnd(14))}${describeBuild(buildId, builds)}`);
|
|
94604
94646
|
console.log("");
|
|
94605
94647
|
}
|
|
94606
94648
|
const proceed = await confirmChange({
|
|
@@ -94643,7 +94685,7 @@ async function publish(ctx) {
|
|
|
94643
94685
|
if (json4)
|
|
94644
94686
|
printJson({ outcome: "started", operation_id: operationId, operation });
|
|
94645
94687
|
else
|
|
94646
|
-
console.log(
|
|
94688
|
+
console.log(import_picocolors83.default.dim(` Check it with \`brainbase interface get ${safe(id)}\`.`));
|
|
94647
94689
|
return;
|
|
94648
94690
|
}
|
|
94649
94691
|
const result2 = await follow(operationId, "publish", { json: json4, timeoutMs: waitMs, deps: ctx.deps });
|
|
@@ -94660,11 +94702,11 @@ async function publish(ctx) {
|
|
|
94660
94702
|
printJson({ outcome: "succeeded", operation_id: operationId, operation: result2.operation, url: url2 });
|
|
94661
94703
|
return;
|
|
94662
94704
|
}
|
|
94663
|
-
console.log(
|
|
94705
|
+
console.log(import_picocolors83.default.green(`✓ Build ${safe(buildId)} is live.`));
|
|
94664
94706
|
if (url2)
|
|
94665
94707
|
console.log(` ${safe(url2)}`);
|
|
94666
94708
|
if (urlUnread) {
|
|
94667
|
-
console.log(
|
|
94709
|
+
console.log(import_picocolors83.default.dim(` Its address could not be read just now; see it with \`brainbase interface open ${safe(id)}\`.`));
|
|
94668
94710
|
}
|
|
94669
94711
|
});
|
|
94670
94712
|
}
|
|
@@ -94700,8 +94742,8 @@ async function rollback(ctx) {
|
|
|
94700
94742
|
}
|
|
94701
94743
|
if (!json4) {
|
|
94702
94744
|
console.log("");
|
|
94703
|
-
console.log(` ${
|
|
94704
|
-
console.log(` ${
|
|
94745
|
+
console.log(` ${import_picocolors83.default.dim("Live now".padEnd(16))}release ${safe(row.live_release.id)} at ${safe(row.live_release.url)}`);
|
|
94746
|
+
console.log(` ${import_picocolors83.default.dim("Will republish".padEnd(16))}release ${safe(releaseId)} ${import_picocolors83.default.dim("as a new release, with a new id")}`);
|
|
94705
94747
|
console.log("");
|
|
94706
94748
|
}
|
|
94707
94749
|
const proceed = await confirmChange({
|
|
@@ -94734,7 +94776,7 @@ async function rollback(ctx) {
|
|
|
94734
94776
|
printJson(release);
|
|
94735
94777
|
return;
|
|
94736
94778
|
}
|
|
94737
|
-
console.log(
|
|
94779
|
+
console.log(import_picocolors83.default.green(release.id === releaseId ? `✓ Release ${safe(releaseId)} is live (build ${safe(release.build_id)}).` : `✓ Republished release ${safe(releaseId)} as new release ${safe(release.id)} (build ${safe(release.build_id)}). It is live.`));
|
|
94738
94780
|
console.log(` ${safe(release.url)}`);
|
|
94739
94781
|
});
|
|
94740
94782
|
}
|
|
@@ -94769,14 +94811,14 @@ ${didYouMean(sub, Object.keys(COMMANDS2), "brainbase interface")}`);
|
|
|
94769
94811
|
await command({ cwd: cwd2, args, deps });
|
|
94770
94812
|
}
|
|
94771
94813
|
function line2(command, args, description) {
|
|
94772
|
-
return ` ${
|
|
94773
|
-
${
|
|
94814
|
+
return ` ${import_picocolors84.default.cyan(command)}${args ? ` ${import_picocolors84.default.dim(args)}` : ""}
|
|
94815
|
+
${import_picocolors84.default.dim(description)}`;
|
|
94774
94816
|
}
|
|
94775
94817
|
function printHelp7() {
|
|
94776
94818
|
const out = [];
|
|
94777
94819
|
out.push("");
|
|
94778
|
-
out.push(` ${
|
|
94779
|
-
out.push(` ${
|
|
94820
|
+
out.push(` ${import_picocolors84.default.bold("brainbase interface")} ${import_picocolors84.default.dim("<sub> [options]")}`);
|
|
94821
|
+
out.push(` ${import_picocolors84.default.dim("Dashboards for an agent: build them in a conversation, publish them, choose who can open them.")}`);
|
|
94780
94822
|
out.push("");
|
|
94781
94823
|
out.push(line2("ls", "[--agent <id>] [--archived | --only-archived]", "list interfaces you can see"));
|
|
94782
94824
|
out.push(line2("get", "<id>", "one interface: address, audience, live release, draft, running build conversation"));
|
|
@@ -94796,22 +94838,22 @@ function printHelp7() {
|
|
|
94796
94838
|
out.push(line2("rollback", "<id> --release <id>", "republish an earlier release; it goes live under a new release id"));
|
|
94797
94839
|
out.push(line2("preview", "<id> [--task <id>] [--no-wait]", "serve the unpublished draft from its build conversation and print the preview address"));
|
|
94798
94840
|
out.push("");
|
|
94799
|
-
out.push(` ${
|
|
94800
|
-
out.push(` ${
|
|
94801
|
-
out.push(` ${
|
|
94802
|
-
out.push(` ${
|
|
94803
|
-
out.push(` ${
|
|
94841
|
+
out.push(` ${import_picocolors84.default.dim("--json")} machine-readable output; never prompts`);
|
|
94842
|
+
out.push(` ${import_picocolors84.default.dim("--yes, -y")} skip confirmation (required without a terminal)`);
|
|
94843
|
+
out.push(` ${import_picocolors84.default.dim("--no-wait")} for rebuild and publish: return the operation at once; for preview: do not wait for the dev server`);
|
|
94844
|
+
out.push(` ${import_picocolors84.default.dim("--timeout <seconds>")} for build, rebuild, publish and preview: how long to wait (builds 900, publish and preview 300)`);
|
|
94845
|
+
out.push(` ${import_picocolors84.default.dim("--idempotency-key <key>")} replay a create, build, rebuild, publish or rollback whose answer was lost`);
|
|
94804
94846
|
out.push("");
|
|
94805
|
-
out.push(` ${
|
|
94806
|
-
out.push(` ${
|
|
94807
|
-
out.push(` ${
|
|
94847
|
+
out.push(` ${import_picocolors84.default.dim("People are emails (see `brainbase member ls`), user ids, or `me`. Audience members also need access to the agent.")}`);
|
|
94848
|
+
out.push(` ${import_picocolors84.default.dim("Audience: everyone (--everyone, `org` under --json) or chosen people (--people, `users` under --json).")}`);
|
|
94849
|
+
out.push(` ${import_picocolors84.default.dim("Exit codes: 0 done, 1 refused or failed, 130 interrupted (the server keeps working).")}`);
|
|
94808
94850
|
out.push("");
|
|
94809
94851
|
console.log(out.join(`
|
|
94810
94852
|
`));
|
|
94811
94853
|
}
|
|
94812
94854
|
|
|
94813
94855
|
// src/cli/member.ts
|
|
94814
|
-
var
|
|
94856
|
+
var import_picocolors85 = __toESM(require_picocolors(), 1);
|
|
94815
94857
|
async function runMember(sub, args, opts) {
|
|
94816
94858
|
if (args.some((arg) => arg === "--help" || arg === "-h")) {
|
|
94817
94859
|
printHelp8();
|
|
@@ -94854,7 +94896,7 @@ async function runMemberList(opts) {
|
|
|
94854
94896
|
function formatMemberList(members) {
|
|
94855
94897
|
if (members.length === 0)
|
|
94856
94898
|
return `
|
|
94857
|
-
${
|
|
94899
|
+
${import_picocolors85.default.dim("Nobody here you can see.")}
|
|
94858
94900
|
`;
|
|
94859
94901
|
const sorted = [...members].sort((a3, b4) => (a3.email ?? a3.id).localeCompare(b4.email ?? b4.id));
|
|
94860
94902
|
const rows = sorted.map((member) => ({
|
|
@@ -94868,24 +94910,24 @@ function formatMemberList(members) {
|
|
|
94868
94910
|
const roleWidth = Math.max(...rows.map((row) => row.role.length));
|
|
94869
94911
|
const lines = [""];
|
|
94870
94912
|
for (const row of rows) {
|
|
94871
|
-
lines.push(` ${row.email.padEnd(emailWidth)} ${row.name.padEnd(nameWidth)} ${
|
|
94913
|
+
lines.push(` ${row.email.padEnd(emailWidth)} ${row.name.padEnd(nameWidth)} ${import_picocolors85.default.dim(row.role.padEnd(roleWidth))} ${import_picocolors85.default.dim(row.teams)}`.trimEnd());
|
|
94872
94914
|
}
|
|
94873
|
-
lines.push("", ` ${
|
|
94915
|
+
lines.push("", ` ${import_picocolors85.default.dim("share a dashboard with one of them:")} ${import_picocolors85.default.cyan("brainbase interface access <id> --add <email>")}`, "");
|
|
94874
94916
|
return lines.join(`
|
|
94875
94917
|
`);
|
|
94876
94918
|
}
|
|
94877
94919
|
function printHelp8() {
|
|
94878
94920
|
const out = [];
|
|
94879
94921
|
out.push("");
|
|
94880
|
-
out.push(` ${
|
|
94922
|
+
out.push(` ${import_picocolors85.default.bold("brainbase member")} ${import_picocolors85.default.dim("<sub> [options]")}`);
|
|
94881
94923
|
out.push("");
|
|
94882
|
-
out.push(` ${
|
|
94924
|
+
out.push(` ${import_picocolors85.default.cyan("ls")} ${import_picocolors85.default.dim("the people in an organization you can see, with their emails, roles and teams")}`);
|
|
94883
94925
|
out.push("");
|
|
94884
|
-
out.push(` ${
|
|
94885
|
-
out.push(` ${
|
|
94926
|
+
out.push(` ${import_picocolors85.default.dim("--org <id-or-slug>")} ${import_picocolors85.default.dim("which organization (picked automatically when you are in one)")}`);
|
|
94927
|
+
out.push(` ${import_picocolors85.default.dim("--json")} ${import_picocolors85.default.dim("machine-readable output")}`);
|
|
94886
94928
|
out.push("");
|
|
94887
|
-
out.push(` ${
|
|
94888
|
-
out.push(` ${
|
|
94929
|
+
out.push(` ${import_picocolors85.default.dim("Owners and admins see everyone. Anyone else sees the owners, the admins, themselves")}`);
|
|
94930
|
+
out.push(` ${import_picocolors85.default.dim("and the people who share a team with them, as in the web app.")}`);
|
|
94889
94931
|
out.push("");
|
|
94890
94932
|
console.log(out.join(`
|
|
94891
94933
|
`));
|
|
@@ -97978,7 +98020,7 @@ async function runBenchmarkPhase(specPathInput, resultPathInput, expectedPhase,
|
|
|
97978
98020
|
}
|
|
97979
98021
|
|
|
97980
98022
|
// src/cli/benchmark-control.ts
|
|
97981
|
-
var
|
|
98023
|
+
var import_picocolors86 = __toESM(require_picocolors(), 1);
|
|
97982
98024
|
import fs93 from "node:fs";
|
|
97983
98025
|
import path104 from "node:path";
|
|
97984
98026
|
|
|
@@ -100507,20 +100549,20 @@ async function emitCursorPages(output, fetchPage, options) {
|
|
|
100507
100549
|
function commandHelp() {
|
|
100508
100550
|
return [
|
|
100509
100551
|
"",
|
|
100510
|
-
` ${
|
|
100552
|
+
` ${import_picocolors86.default.bold("brainbase benchmark")} ${import_picocolors86.default.dim("<command> [options]")}`,
|
|
100511
100553
|
"",
|
|
100512
|
-
` ${
|
|
100513
|
-
` ${
|
|
100514
|
-
` ${
|
|
100515
|
-
` ${
|
|
100516
|
-
` ${
|
|
100554
|
+
` ${import_picocolors86.default.cyan("init | list | show | create | validate | pull | push")}`,
|
|
100555
|
+
` ${import_picocolors86.default.cyan("publish | revisions | import | export | archive | restore")}`,
|
|
100556
|
+
` ${import_picocolors86.default.cyan("run plan|start|watch|list|show|cancel|resume")}`,
|
|
100557
|
+
` ${import_picocolors86.default.cyan("results | diagnoses | attempt | artifacts | export-results")}`,
|
|
100558
|
+
` ${import_picocolors86.default.cyan("history | baseline show|set|clear")}`,
|
|
100517
100559
|
"",
|
|
100518
|
-
` ${
|
|
100560
|
+
` ${import_picocolors86.default.dim("Use --agent to override brainbase.agent.yaml, and --json or --jsonl for automation.")}`,
|
|
100519
100561
|
"",
|
|
100520
|
-
` ${
|
|
100521
|
-
` ${
|
|
100522
|
-
` ${
|
|
100523
|
-
` ${
|
|
100562
|
+
` ${import_picocolors86.default.bold("benchmark runtime (machine-only)")}`,
|
|
100563
|
+
` ${import_picocolors86.default.cyan("hydrate")} ${import_picocolors86.default.dim("--spec <path> --result <path> --json")}`,
|
|
100564
|
+
` ${import_picocolors86.default.cyan("evaluate")} ${import_picocolors86.default.dim("--spec <path> --result <path> --json")}`,
|
|
100565
|
+
` ${import_picocolors86.default.cyan("capabilities")} ${import_picocolors86.default.dim("--json")}`,
|
|
100524
100566
|
""
|
|
100525
100567
|
].join(`
|
|
100526
100568
|
`);
|
|
@@ -102483,7 +102525,8 @@ Questions:
|
|
|
102483
102525
|
joey-1, d1.1, mammoth-1, elephant-1, drex-max,
|
|
102484
102526
|
pplx-decider-flash-v1.2, pplx-decider-v1.2,
|
|
102485
102527
|
d1-ultra, jev-1.14, classify-1,
|
|
102486
|
-
microsoft-decision-1, clef-omni or
|
|
102528
|
+
microsoft-decision-1, clef-omni, d1 or
|
|
102529
|
+
gemini-decision-1
|
|
102487
102530
|
(default: the server's default)
|
|
102488
102531
|
--min-confidence <0-1> mark answers below this confidence as uncertain
|
|
102489
102532
|
|
|
@@ -102812,6 +102855,368 @@ function routeConsoleThroughStreams() {
|
|
|
102812
102855
|
process.stderr.on("error", ignoreClosedReader);
|
|
102813
102856
|
}
|
|
102814
102857
|
|
|
102858
|
+
// src/core/telemetry.ts
|
|
102859
|
+
import { spawn as spawn6 } from "node:child_process";
|
|
102860
|
+
import crypto12 from "node:crypto";
|
|
102861
|
+
import fs97 from "node:fs";
|
|
102862
|
+
import os20 from "node:os";
|
|
102863
|
+
import path109 from "node:path";
|
|
102864
|
+
import process14 from "node:process";
|
|
102865
|
+
var POSTHOG_PROJECT_KEY = "phc_HV6qImqhLGuZ0g6AaxRVJrprKhf1yCMXXPzsfcOI9Iu";
|
|
102866
|
+
var POSTHOG_HOST = "https://us.i.posthog.com";
|
|
102867
|
+
var TELEMETRY_EVENT = "cli_command";
|
|
102868
|
+
var TELEMETRY_FILE = path109.join(BRAINBASE_HOME, "telemetry.json");
|
|
102869
|
+
var TRUTHY = new Set(["1", "true", "yes", "on"]);
|
|
102870
|
+
function truthy(value3) {
|
|
102871
|
+
return value3 !== undefined && TRUTHY.has(value3.trim().toLowerCase());
|
|
102872
|
+
}
|
|
102873
|
+
function readTelemetryState(file = TELEMETRY_FILE) {
|
|
102874
|
+
try {
|
|
102875
|
+
const parsed = JSON.parse(fs97.readFileSync(file, "utf8"));
|
|
102876
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
102877
|
+
} catch {
|
|
102878
|
+
return {};
|
|
102879
|
+
}
|
|
102880
|
+
}
|
|
102881
|
+
function updateTelemetryState(change, file = TELEMETRY_FILE, lockTimeoutMs = 2000) {
|
|
102882
|
+
const release = acquireLock(`${file}.lock`, lockTimeoutMs);
|
|
102883
|
+
if (!release)
|
|
102884
|
+
return false;
|
|
102885
|
+
try {
|
|
102886
|
+
writeJsonAtomic(file, change(readTelemetryState(file)));
|
|
102887
|
+
return true;
|
|
102888
|
+
} finally {
|
|
102889
|
+
release();
|
|
102890
|
+
}
|
|
102891
|
+
}
|
|
102892
|
+
function telemetryDisabledReason(env3 = process14.env, state = readTelemetryState()) {
|
|
102893
|
+
if (truthy(env3.BRAINBASE_TELEMETRY_DISABLED))
|
|
102894
|
+
return "env";
|
|
102895
|
+
if (truthy(env3.DO_NOT_TRACK))
|
|
102896
|
+
return "do_not_track";
|
|
102897
|
+
if (env3.BRAINBASE_THREAD_ID || env3.BB_TASK_KEY || env3.BRAINBASE_BENCHMARK_WORKSPACE) {
|
|
102898
|
+
return "sandbox";
|
|
102899
|
+
}
|
|
102900
|
+
if (state.enabled === false)
|
|
102901
|
+
return "config";
|
|
102902
|
+
return null;
|
|
102903
|
+
}
|
|
102904
|
+
var KNOWN_SUBCOMMANDS = {
|
|
102905
|
+
login: [],
|
|
102906
|
+
logout: [],
|
|
102907
|
+
whoami: [],
|
|
102908
|
+
link: [],
|
|
102909
|
+
unlink: [],
|
|
102910
|
+
sync: [],
|
|
102911
|
+
status: [],
|
|
102912
|
+
publish: [],
|
|
102913
|
+
decide: [],
|
|
102914
|
+
run: [],
|
|
102915
|
+
help: [],
|
|
102916
|
+
version: [],
|
|
102917
|
+
telemetry: ["status", "enable", "disable"],
|
|
102918
|
+
template: [
|
|
102919
|
+
"info",
|
|
102920
|
+
"install",
|
|
102921
|
+
"list",
|
|
102922
|
+
"ls",
|
|
102923
|
+
"onboard",
|
|
102924
|
+
"pack",
|
|
102925
|
+
"publish",
|
|
102926
|
+
"remove",
|
|
102927
|
+
"rm",
|
|
102928
|
+
"search",
|
|
102929
|
+
"show",
|
|
102930
|
+
"uninstall"
|
|
102931
|
+
],
|
|
102932
|
+
skill: [
|
|
102933
|
+
"add",
|
|
102934
|
+
"info",
|
|
102935
|
+
"install",
|
|
102936
|
+
"list",
|
|
102937
|
+
"ls",
|
|
102938
|
+
"publish",
|
|
102939
|
+
"remove",
|
|
102940
|
+
"rm",
|
|
102941
|
+
"search",
|
|
102942
|
+
"show",
|
|
102943
|
+
"uninstall",
|
|
102944
|
+
"update",
|
|
102945
|
+
"upgrade"
|
|
102946
|
+
],
|
|
102947
|
+
token: ["clear", "create", "list", "ls", "new", "rename", "revoke", "rm"],
|
|
102948
|
+
agent: [
|
|
102949
|
+
"connect",
|
|
102950
|
+
"connections",
|
|
102951
|
+
"create",
|
|
102952
|
+
"delete",
|
|
102953
|
+
"design",
|
|
102954
|
+
"designs",
|
|
102955
|
+
"disconnect",
|
|
102956
|
+
"env",
|
|
102957
|
+
"eval",
|
|
102958
|
+
"init",
|
|
102959
|
+
"list",
|
|
102960
|
+
"ls",
|
|
102961
|
+
"pull",
|
|
102962
|
+
"push",
|
|
102963
|
+
"status",
|
|
102964
|
+
"surface",
|
|
102965
|
+
"unpack",
|
|
102966
|
+
"versions"
|
|
102967
|
+
],
|
|
102968
|
+
team: ["list", "ls"],
|
|
102969
|
+
member: ["list", "ls"],
|
|
102970
|
+
task: ["create", "delete", "get", "list", "logs", "ls", "send", "stop", "update"],
|
|
102971
|
+
interface: ["access", "build", "create", "list", "ls", "open", "preview", "publish", "rollback"],
|
|
102972
|
+
machine: ["list", "ls", "rm"],
|
|
102973
|
+
benchmark: [
|
|
102974
|
+
"archive",
|
|
102975
|
+
"artifacts",
|
|
102976
|
+
"attempt",
|
|
102977
|
+
"baseline",
|
|
102978
|
+
"capabilities",
|
|
102979
|
+
"create",
|
|
102980
|
+
"diagnoses",
|
|
102981
|
+
"evaluate",
|
|
102982
|
+
"export",
|
|
102983
|
+
"export-results",
|
|
102984
|
+
"history",
|
|
102985
|
+
"hydrate",
|
|
102986
|
+
"import",
|
|
102987
|
+
"init",
|
|
102988
|
+
"list",
|
|
102989
|
+
"publish",
|
|
102990
|
+
"pull",
|
|
102991
|
+
"push",
|
|
102992
|
+
"restore",
|
|
102993
|
+
"results",
|
|
102994
|
+
"revisions",
|
|
102995
|
+
"run",
|
|
102996
|
+
"show",
|
|
102997
|
+
"validate"
|
|
102998
|
+
],
|
|
102999
|
+
orchestration: [
|
|
103000
|
+
"add",
|
|
103001
|
+
"add-agent",
|
|
103002
|
+
"create",
|
|
103003
|
+
"delete",
|
|
103004
|
+
"from-agent",
|
|
103005
|
+
"init",
|
|
103006
|
+
"list",
|
|
103007
|
+
"ls",
|
|
103008
|
+
"pull",
|
|
103009
|
+
"push",
|
|
103010
|
+
"status",
|
|
103011
|
+
"trigger",
|
|
103012
|
+
"triggers"
|
|
103013
|
+
],
|
|
103014
|
+
mcp: ["add", "call", "check", "connect", "list", "search", "tools"],
|
|
103015
|
+
integrations: [
|
|
103016
|
+
"actions",
|
|
103017
|
+
"add",
|
|
103018
|
+
"allow",
|
|
103019
|
+
"ask",
|
|
103020
|
+
"connect",
|
|
103021
|
+
"context",
|
|
103022
|
+
"deny",
|
|
103023
|
+
"disconnect",
|
|
103024
|
+
"list",
|
|
103025
|
+
"remove",
|
|
103026
|
+
"search"
|
|
103027
|
+
]
|
|
103028
|
+
};
|
|
103029
|
+
var COMMAND_ALIASES = {
|
|
103030
|
+
teams: "team",
|
|
103031
|
+
members: "member",
|
|
103032
|
+
interfaces: "interface",
|
|
103033
|
+
machines: "machine",
|
|
103034
|
+
orch: "orchestration",
|
|
103035
|
+
integration: "integrations",
|
|
103036
|
+
"--help": "help",
|
|
103037
|
+
"-h": "help",
|
|
103038
|
+
"--version": "version",
|
|
103039
|
+
"-v": "version"
|
|
103040
|
+
};
|
|
103041
|
+
var FLAG = /^--?[a-zA-Z][a-zA-Z0-9-]{0,39}$/;
|
|
103042
|
+
function describeInvocation(argv) {
|
|
103043
|
+
const [first, ...rest2] = argv;
|
|
103044
|
+
if (first === undefined)
|
|
103045
|
+
return { command: "none", subcommand: null, flags: [] };
|
|
103046
|
+
const name = COMMAND_ALIASES[first] ?? first;
|
|
103047
|
+
const subcommands = Object.hasOwn(KNOWN_SUBCOMMANDS, name) ? KNOWN_SUBCOMMANDS[name] : undefined;
|
|
103048
|
+
if (subcommands === undefined)
|
|
103049
|
+
return { command: "unknown", subcommand: null, flags: [] };
|
|
103050
|
+
if (name === "run")
|
|
103051
|
+
return { command: name, subcommand: null, flags: [] };
|
|
103052
|
+
const separator = rest2.indexOf("--");
|
|
103053
|
+
const own = separator < 0 ? rest2 : rest2.slice(0, separator);
|
|
103054
|
+
let subcommand = null;
|
|
103055
|
+
if (subcommands.length > 0 && own[0] !== undefined && !own[0].startsWith("-")) {
|
|
103056
|
+
subcommand = subcommands.includes(own[0]) ? own[0] : "other";
|
|
103057
|
+
}
|
|
103058
|
+
const flags = new Set;
|
|
103059
|
+
for (const token of own) {
|
|
103060
|
+
const flag = token.split("=", 1)[0];
|
|
103061
|
+
if (FLAG.test(flag))
|
|
103062
|
+
flags.add(flag);
|
|
103063
|
+
}
|
|
103064
|
+
return { command: name, subcommand, flags: [...flags].sort() };
|
|
103065
|
+
}
|
|
103066
|
+
function activeCredential() {
|
|
103067
|
+
const active = describeCredentials().active;
|
|
103068
|
+
if (active === "env_pat")
|
|
103069
|
+
return "env_token";
|
|
103070
|
+
return active ?? "none";
|
|
103071
|
+
}
|
|
103072
|
+
function anonymousId(file) {
|
|
103073
|
+
let id = readTelemetryState(file).anonymousId;
|
|
103074
|
+
if (id)
|
|
103075
|
+
return id;
|
|
103076
|
+
const minted = crypto12.randomUUID();
|
|
103077
|
+
try {
|
|
103078
|
+
updateTelemetryState((state) => {
|
|
103079
|
+
id = state.anonymousId ?? minted;
|
|
103080
|
+
return { ...state, anonymousId: id };
|
|
103081
|
+
}, file, 0);
|
|
103082
|
+
} catch {}
|
|
103083
|
+
return id ?? minted;
|
|
103084
|
+
}
|
|
103085
|
+
function buildEvent(argv, exitCode, durationMs, options = {}) {
|
|
103086
|
+
const env3 = options.env ?? process14.env;
|
|
103087
|
+
const file = options.file ?? TELEMETRY_FILE;
|
|
103088
|
+
const session = options.session === undefined ? readAuth() : options.session;
|
|
103089
|
+
const storedPatUserId = options.storedPatUserId === undefined ? readToken()?.user_id ?? null : options.storedPatUserId;
|
|
103090
|
+
const credential = options.credential ?? activeCredential();
|
|
103091
|
+
const userId = credential === "stored_pat" ? storedPatUserId : credential === "session" || credential === "none" ? session?.user_id ?? null : null;
|
|
103092
|
+
const { command, subcommand, flags } = describeInvocation(argv);
|
|
103093
|
+
return {
|
|
103094
|
+
api_key: POSTHOG_PROJECT_KEY,
|
|
103095
|
+
event: TELEMETRY_EVENT,
|
|
103096
|
+
distinct_id: userId ?? anonymousId(file),
|
|
103097
|
+
timestamp: new Date().toISOString(),
|
|
103098
|
+
properties: {
|
|
103099
|
+
command,
|
|
103100
|
+
subcommand,
|
|
103101
|
+
command_path: subcommand ? `${command} ${subcommand}` : command,
|
|
103102
|
+
flags,
|
|
103103
|
+
exit_code: exitCode,
|
|
103104
|
+
success: exitCode === 0,
|
|
103105
|
+
duration_ms: Math.round(durationMs),
|
|
103106
|
+
cli_version: VERSION,
|
|
103107
|
+
os: process14.platform,
|
|
103108
|
+
os_release: os20.release(),
|
|
103109
|
+
arch: process14.arch,
|
|
103110
|
+
runtime: typeof globalThis.Bun !== "undefined" ? "bun" : "node",
|
|
103111
|
+
runtime_version: process14.versions.bun ?? process14.versions.node,
|
|
103112
|
+
ci: env3.CI !== undefined && !["", "0", "false", "no", "off"].includes(env3.CI.trim().toLowerCase()),
|
|
103113
|
+
interactive: Boolean(process14.stdout.isTTY),
|
|
103114
|
+
credential,
|
|
103115
|
+
$lib: "brainbase-cli",
|
|
103116
|
+
$lib_version: VERSION,
|
|
103117
|
+
$geoip_disable: true,
|
|
103118
|
+
$process_person_profile: userId !== null
|
|
103119
|
+
}
|
|
103120
|
+
};
|
|
103121
|
+
}
|
|
103122
|
+
var SENDER = `
|
|
103123
|
+
fetch(process.env.BRAINBASE_TELEMETRY_URL, { method: 'POST',
|
|
103124
|
+
headers: { 'content-type': 'application/json' }, body: process.env.BRAINBASE_TELEMETRY_BODY,
|
|
103125
|
+
signal: AbortSignal.timeout(3000) }).catch(() => {}).finally(() => process.exit(0));
|
|
103126
|
+
`;
|
|
103127
|
+
function sendDetached(event) {
|
|
103128
|
+
const child = spawn6(process14.execPath, ["-e", SENDER], {
|
|
103129
|
+
detached: true,
|
|
103130
|
+
stdio: "ignore",
|
|
103131
|
+
env: {
|
|
103132
|
+
PATH: process14.env.PATH ?? "",
|
|
103133
|
+
BRAINBASE_TELEMETRY_URL: `${(process14.env.BRAINBASE_TELEMETRY_HOST || POSTHOG_HOST).replace(/\/+$/, "")}/i/v0/e/`,
|
|
103134
|
+
BRAINBASE_TELEMETRY_BODY: JSON.stringify(event)
|
|
103135
|
+
}
|
|
103136
|
+
});
|
|
103137
|
+
child.on("error", () => {});
|
|
103138
|
+
child.unref();
|
|
103139
|
+
}
|
|
103140
|
+
function noticeText() {
|
|
103141
|
+
return [
|
|
103142
|
+
"",
|
|
103143
|
+
"The brainbase CLI sends usage data to help us improve it: which commands and",
|
|
103144
|
+
"flag names you run, exit codes and timings. Never arguments, flag values, paths",
|
|
103145
|
+
"or prompts. It is tied to your Brainbase account when you are logged in.",
|
|
103146
|
+
"Turn it off with `brainbase telemetry disable` or BRAINBASE_TELEMETRY_DISABLED=1.",
|
|
103147
|
+
""
|
|
103148
|
+
].join(`
|
|
103149
|
+
`);
|
|
103150
|
+
}
|
|
103151
|
+
function startTelemetry(argv) {
|
|
103152
|
+
try {
|
|
103153
|
+
const state = readTelemetryState();
|
|
103154
|
+
if (telemetryDisabledReason(process14.env, state) !== null)
|
|
103155
|
+
return;
|
|
103156
|
+
if (argv[0] === "telemetry")
|
|
103157
|
+
return;
|
|
103158
|
+
if (!state.noticeShownAt && process14.stderr.isTTY) {
|
|
103159
|
+
process14.stderr.write(`${noticeText()}
|
|
103160
|
+
`);
|
|
103161
|
+
try {
|
|
103162
|
+
updateTelemetryState((current) => ({ ...current, noticeShownAt: new Date().toISOString() }), TELEMETRY_FILE, 0);
|
|
103163
|
+
} catch {}
|
|
103164
|
+
}
|
|
103165
|
+
const started = performance.now();
|
|
103166
|
+
const snapshot = [...argv];
|
|
103167
|
+
process14.once("exit", (code) => {
|
|
103168
|
+
try {
|
|
103169
|
+
if (telemetryDisabledReason(process14.env, readTelemetryState()) !== null)
|
|
103170
|
+
return;
|
|
103171
|
+
const event = buildEvent(snapshot, code, performance.now() - started);
|
|
103172
|
+
if (truthy(process14.env.BRAINBASE_TELEMETRY_DEBUG)) {
|
|
103173
|
+
process14.stderr.write(`[telemetry] ${JSON.stringify(event)}
|
|
103174
|
+
`);
|
|
103175
|
+
return;
|
|
103176
|
+
}
|
|
103177
|
+
sendDetached(event);
|
|
103178
|
+
} catch {}
|
|
103179
|
+
});
|
|
103180
|
+
} catch {}
|
|
103181
|
+
}
|
|
103182
|
+
function runTelemetry(sub) {
|
|
103183
|
+
switch (sub) {
|
|
103184
|
+
case "enable":
|
|
103185
|
+
case "disable": {
|
|
103186
|
+
const enabled = sub === "enable";
|
|
103187
|
+
if (!updateTelemetryState((current) => ({ ...current, enabled }))) {
|
|
103188
|
+
console.error(`Could not change ${TELEMETRY_FILE}: another brainbase process holds ${TELEMETRY_FILE}.lock. ` + "Try again, or remove that file if no brainbase command is running.");
|
|
103189
|
+
return 1;
|
|
103190
|
+
}
|
|
103191
|
+
console.log(enabled ? "Telemetry enabled." : "Telemetry disabled. Nothing more will be sent from this machine.");
|
|
103192
|
+
return 0;
|
|
103193
|
+
}
|
|
103194
|
+
case undefined:
|
|
103195
|
+
case "status": {
|
|
103196
|
+
const reason = telemetryDisabledReason(process14.env, readTelemetryState());
|
|
103197
|
+
const why = {
|
|
103198
|
+
env: "BRAINBASE_TELEMETRY_DISABLED is set",
|
|
103199
|
+
do_not_track: "DO_NOT_TRACK is set",
|
|
103200
|
+
config: "turned off with `brainbase telemetry disable`",
|
|
103201
|
+
sandbox: "running inside a Brainbase sandbox"
|
|
103202
|
+
};
|
|
103203
|
+
console.log(reason === null ? "Telemetry is on." : `Telemetry is off (${why[reason]}).`);
|
|
103204
|
+
console.log(noticeText().trim());
|
|
103205
|
+
return 0;
|
|
103206
|
+
}
|
|
103207
|
+
case "help":
|
|
103208
|
+
case "--help":
|
|
103209
|
+
case "-h":
|
|
103210
|
+
console.log("Usage: brainbase telemetry [status|enable|disable]");
|
|
103211
|
+
console.log(noticeText().trim());
|
|
103212
|
+
return 0;
|
|
103213
|
+
default:
|
|
103214
|
+
console.error(`Unknown telemetry subcommand: ${sub}
|
|
103215
|
+
Usage: brainbase telemetry [status|enable|disable]`);
|
|
103216
|
+
return 1;
|
|
103217
|
+
}
|
|
103218
|
+
}
|
|
103219
|
+
|
|
102815
103220
|
// src/index.ts
|
|
102816
103221
|
routeConsoleThroughStreams();
|
|
102817
103222
|
var PROTECTED = new Set([
|
|
@@ -102847,6 +103252,7 @@ var COMMANDS3 = [
|
|
|
102847
103252
|
"integrations",
|
|
102848
103253
|
"decide",
|
|
102849
103254
|
"run",
|
|
103255
|
+
"telemetry",
|
|
102850
103256
|
"help",
|
|
102851
103257
|
"version"
|
|
102852
103258
|
];
|
|
@@ -102856,224 +103262,226 @@ var SUBCOMMAND_OWNED_FLAGS = {
|
|
|
102856
103262
|
function help() {
|
|
102857
103263
|
const out = [];
|
|
102858
103264
|
out.push("");
|
|
102859
|
-
out.push(` ${brandTint("◆")} ${
|
|
102860
|
-
out.push(` ${
|
|
103265
|
+
out.push(` ${brandTint("◆")} ${import_picocolors87.default.bold("brainbase")} ${import_picocolors87.default.dim(`v${VERSION}`)}`);
|
|
103266
|
+
out.push(` ${import_picocolors87.default.dim("connect your local agent to the brainbase platform")}`);
|
|
102861
103267
|
out.push("");
|
|
102862
103268
|
out.push(divider("USAGE"));
|
|
102863
103269
|
out.push("");
|
|
102864
|
-
out.push(` ${
|
|
103270
|
+
out.push(` ${import_picocolors87.default.bold("brainbase")} ${import_picocolors87.default.dim("<command> [options]")}`);
|
|
102865
103271
|
out.push("");
|
|
102866
103272
|
out.push(divider("AUTH"));
|
|
102867
103273
|
out.push("");
|
|
102868
|
-
out.push(` ${
|
|
102869
|
-
out.push(` ${
|
|
102870
|
-
out.push(` ${
|
|
103274
|
+
out.push(` ${import_picocolors87.default.cyan("login")} ${import_picocolors87.default.dim(" open the web app and connect this device")}`);
|
|
103275
|
+
out.push(` ${import_picocolors87.default.cyan("logout")} ${import_picocolors87.default.dim(" clear the local session")}`);
|
|
103276
|
+
out.push(` ${import_picocolors87.default.cyan("whoami")} ${import_picocolors87.default.dim("[--json]")} ${import_picocolors87.default.dim(" show which credential is in use and what it covers")}`);
|
|
103277
|
+
out.push(` ${import_picocolors87.default.cyan("telemetry")} ${import_picocolors87.default.dim("[status|enable|disable]")} ${import_picocolors87.default.dim(" see or change usage data collection")}`);
|
|
102871
103278
|
out.push("");
|
|
102872
103279
|
out.push(divider("DISCOVERY"));
|
|
102873
103280
|
out.push("");
|
|
102874
|
-
out.push(` ${
|
|
102875
|
-
out.push(` ${
|
|
102876
|
-
out.push(` ${
|
|
103281
|
+
out.push(` ${import_picocolors87.default.cyan("team list")} ${import_picocolors87.default.dim("show the teams you can create agents in")}`);
|
|
103282
|
+
out.push(` ${import_picocolors87.default.cyan("member ls")} ${import_picocolors87.default.dim("show the people in an organization, with the emails interface access takes")}`);
|
|
103283
|
+
out.push(` ${import_picocolors87.default.cyan("agent list")} ${import_picocolors87.default.dim("show a team's agents and their ids")}`);
|
|
102877
103284
|
out.push("");
|
|
102878
103285
|
out.push(divider("LINKED AGENT"));
|
|
102879
103286
|
out.push("");
|
|
102880
|
-
out.push(` ${
|
|
102881
|
-
out.push(` ${
|
|
102882
|
-
out.push(` ${
|
|
102883
|
-
out.push(` ${
|
|
102884
|
-
out.push(` ${
|
|
102885
|
-
out.push(` ${
|
|
102886
|
-
out.push(` ${
|
|
102887
|
-
out.push(` ${
|
|
102888
|
-
out.push(` ${
|
|
102889
|
-
out.push(` ${
|
|
102890
|
-
out.push(` ${
|
|
102891
|
-
out.push(` ${
|
|
102892
|
-
out.push(` ${
|
|
102893
|
-
out.push(` ${
|
|
102894
|
-
out.push(` ${
|
|
102895
|
-
out.push(` ${
|
|
102896
|
-
out.push(` ${
|
|
102897
|
-
out.push(` ${
|
|
103287
|
+
out.push(` ${import_picocolors87.default.cyan("agent init")} ${import_picocolors87.default.dim("write a starter brainbase.agent.yaml here — offline, no login needed")}`);
|
|
103288
|
+
out.push(` ${import_picocolors87.default.cyan("agent create")} ${import_picocolors87.default.dim("claim an unclaimed brainbase.agent.yaml and create the cloud agent")}`);
|
|
103289
|
+
out.push(` ${import_picocolors87.default.cyan("agent pull")} ${import_picocolors87.default.dim("[<id>]")} ${import_picocolors87.default.dim("bring cloud changes into this folder (--force to override; --run-entrypoint to also execute the agent entrypoint; --link to link first)")}`);
|
|
103290
|
+
out.push(` ${import_picocolors87.default.cyan("agent push")} ${import_picocolors87.default.dim("send local changes to the cloud (--force to overwrite cloud-side conflicts with local)")}`);
|
|
103291
|
+
out.push(` ${import_picocolors87.default.cyan("agent delete")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("permanently delete a cloud agent and every task it has run")}`);
|
|
103292
|
+
out.push(` ${import_picocolors87.default.cyan("agent unpack")} ${import_picocolors87.default.dim("install the claimed agent into a harness layout")}`);
|
|
103293
|
+
out.push(` ${import_picocolors87.default.cyan("link")} ${import_picocolors87.default.dim("attach this folder to an existing agent")}`);
|
|
103294
|
+
out.push(` ${import_picocolors87.default.cyan("agent status")} ${import_picocolors87.default.dim("show what would pull and what would push")}`);
|
|
103295
|
+
out.push(` ${import_picocolors87.default.cyan("agent connections")} ${import_picocolors87.default.dim("show which integrations this agent is wired to (--json for CI)")}`);
|
|
103296
|
+
out.push(` ${import_picocolors87.default.cyan("agent connect")} ${import_picocolors87.default.dim("<name>")} ${import_picocolors87.default.dim("connect chat, slack, meeting, github, linear or phone")}`);
|
|
103297
|
+
out.push(` ${import_picocolors87.default.cyan("agent disconnect")} ${import_picocolors87.default.dim("<name>")} ${import_picocolors87.default.dim("disable or disconnect an agent surface")}`);
|
|
103298
|
+
out.push(` ${import_picocolors87.default.cyan("agent surface")} ${import_picocolors87.default.dim("<name>")} ${import_picocolors87.default.dim("status, settings and setup for all six surfaces (--help)")}`);
|
|
103299
|
+
out.push(` ${import_picocolors87.default.cyan("agent versions")} ${import_picocolors87.default.dim("saved versions: list, show, diff, label, restore, pin and unpin (`agent versions --help`)")}`);
|
|
103300
|
+
out.push(` ${import_picocolors87.default.cyan("agent eval")} ${import_picocolors87.default.dim("<list|runs>")} ${import_picocolors87.default.dim("read eval definitions and judge verdicts (`agent eval --help`)")}`);
|
|
103301
|
+
out.push(` ${import_picocolors87.default.cyan("agent env")} ${import_picocolors87.default.dim("print export lines for `eval $(brainbase agent env)`")}`);
|
|
103302
|
+
out.push(` ${import_picocolors87.default.cyan("run")} ${import_picocolors87.default.dim("<cmd> [args...]")} ${import_picocolors87.default.dim("run <cmd> with secrets.env loaded into env")}`);
|
|
103303
|
+
out.push(` ${import_picocolors87.default.cyan("status")} ${import_picocolors87.default.dim("show what this folder is linked to")}`);
|
|
103304
|
+
out.push(` ${import_picocolors87.default.cyan("unlink")} ${import_picocolors87.default.dim("disconnect this folder")}`);
|
|
102898
103305
|
out.push("");
|
|
102899
103306
|
out.push(divider("TASKS"));
|
|
102900
103307
|
out.push("");
|
|
102901
|
-
out.push(` ${
|
|
102902
|
-
out.push(` ${
|
|
102903
|
-
out.push(` ${
|
|
102904
|
-
out.push(` ${
|
|
102905
|
-
out.push(` ${
|
|
102906
|
-
out.push(` ${
|
|
102907
|
-
out.push(` ${
|
|
102908
|
-
out.push(` ${
|
|
103308
|
+
out.push(` ${import_picocolors87.default.cyan("task create")} ${import_picocolors87.default.dim("--message <text>")} ${import_picocolors87.default.dim("create a managed task and start its first run (--wait to block on it; --interface <id> for a build conversation)")}`);
|
|
103309
|
+
out.push(` ${import_picocolors87.default.cyan("task list")} ${import_picocolors87.default.dim("recent tasks you can reach (--metadata k=v to filter by label; --interface <id> for its build conversations)")}`);
|
|
103310
|
+
out.push(` ${import_picocolors87.default.cyan("task get")} ${import_picocolors87.default.dim("<task-id>")} ${import_picocolors87.default.dim("one task: status, agent, machine, eval verdicts")}`);
|
|
103311
|
+
out.push(` ${import_picocolors87.default.cyan("task logs")} ${import_picocolors87.default.dim("<task-id> [--follow]")} ${import_picocolors87.default.dim("one line per event in the task's transcript, or tail it live")}`);
|
|
103312
|
+
out.push(` ${import_picocolors87.default.cyan("task send")} ${import_picocolors87.default.dim("<task-id> <message>")} ${import_picocolors87.default.dim("send a follow-up during execution, or queue it for the next turn")}`);
|
|
103313
|
+
out.push(` ${import_picocolors87.default.cyan("task stop")} ${import_picocolors87.default.dim("<task-id>")} ${import_picocolors87.default.dim("stop execution and cancel pending follow-ups, retaining their text")}`);
|
|
103314
|
+
out.push(` ${import_picocolors87.default.cyan("task update")} ${import_picocolors87.default.dim("<task-id>")} ${import_picocolors87.default.dim("rename a task, change its metadata labels, switch its model or reset it to the agent default, including while it runs")}`);
|
|
103315
|
+
out.push(` ${import_picocolors87.default.cyan("task delete")} ${import_picocolors87.default.dim("<task-id>")} ${import_picocolors87.default.dim("permanently delete a stopped task and tear down its sandbox")}`);
|
|
102909
103316
|
out.push("");
|
|
102910
103317
|
out.push(divider("INTERFACES"));
|
|
102911
103318
|
out.push("");
|
|
102912
|
-
out.push(` ${
|
|
102913
|
-
out.push(` ${
|
|
102914
|
-
out.push(` ${
|
|
102915
|
-
out.push(` ${
|
|
102916
|
-
out.push(` ${
|
|
102917
|
-
out.push(` ${
|
|
102918
|
-
out.push(` ${
|
|
103319
|
+
out.push(` ${import_picocolors87.default.cyan("interface ls")} ${import_picocolors87.default.dim("dashboards you can see (--agent to narrow)")}`);
|
|
103320
|
+
out.push(` ${import_picocolors87.default.cyan("interface create")} ${import_picocolors87.default.dim("--name <n>")} ${import_picocolors87.default.dim("create one on an agent, with who can open it")}`);
|
|
103321
|
+
out.push(` ${import_picocolors87.default.cyan("interface build")} ${import_picocolors87.default.dim('<id> "<ask>"')} ${import_picocolors87.default.dim("describe a change; the agent builds it while you watch")}`);
|
|
103322
|
+
out.push(` ${import_picocolors87.default.cyan("interface publish")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("make the newest succeeded build live")}`);
|
|
103323
|
+
out.push(` ${import_picocolors87.default.cyan("interface rollback")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("republish an earlier release under a new id (--release <id>)")}`);
|
|
103324
|
+
out.push(` ${import_picocolors87.default.cyan("interface access")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("show or set who can open it")}`);
|
|
103325
|
+
out.push(` ${import_picocolors87.default.cyan("interface --help")} ${import_picocolors87.default.dim("every interface subcommand")}`);
|
|
102919
103326
|
out.push("");
|
|
102920
103327
|
out.push(divider("SANDBOXES"));
|
|
102921
103328
|
out.push("");
|
|
102922
|
-
out.push(` ${
|
|
102923
|
-
out.push(` ${
|
|
103329
|
+
out.push(` ${import_picocolors87.default.cyan("machine ls")} ${import_picocolors87.default.dim("[--all]")} ${import_picocolors87.default.dim("list your sandboxes — live ones only unless --all")}`);
|
|
103330
|
+
out.push(` ${import_picocolors87.default.cyan("machine rm")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("tear a sandbox down (it bills until you do)")}`);
|
|
102924
103331
|
out.push("");
|
|
102925
103332
|
out.push(divider("BENCHMARKS"));
|
|
102926
103333
|
out.push("");
|
|
102927
|
-
out.push(` ${
|
|
102928
|
-
out.push(` ${
|
|
102929
|
-
out.push(` ${
|
|
102930
|
-
out.push(` ${
|
|
102931
|
-
out.push(` ${
|
|
103334
|
+
out.push(` ${import_picocolors87.default.cyan("benchmark list")} ${import_picocolors87.default.dim("list benchmarks for the linked agent")}`);
|
|
103335
|
+
out.push(` ${import_picocolors87.default.cyan("benchmark init")} ${import_picocolors87.default.dim("[directory]")} ${import_picocolors87.default.dim("scaffold a local benchmark")}`);
|
|
103336
|
+
out.push(` ${import_picocolors87.default.cyan("benchmark create")} ${import_picocolors87.default.dim("[path|-]")} ${import_picocolors87.default.dim("create a benchmark draft")}`);
|
|
103337
|
+
out.push(` ${import_picocolors87.default.cyan("benchmark run")} ${import_picocolors87.default.dim("<benchmark> --yes")} ${import_picocolors87.default.dim("plan and start a benchmark run")}`);
|
|
103338
|
+
out.push(` ${import_picocolors87.default.cyan("benchmark results")} ${import_picocolors87.default.dim("<run>")} ${import_picocolors87.default.dim("inspect normalized benchmark results")}`);
|
|
102932
103339
|
out.push("");
|
|
102933
103340
|
out.push(divider("BENCHMARK RUNTIME"));
|
|
102934
103341
|
out.push("");
|
|
102935
|
-
out.push(` ${
|
|
102936
|
-
out.push(` ${
|
|
102937
|
-
out.push(` ${
|
|
103342
|
+
out.push(` ${import_picocolors87.default.cyan("benchmark hydrate")} ${import_picocolors87.default.dim("--spec <path> --result <path> --json")}`);
|
|
103343
|
+
out.push(` ${import_picocolors87.default.cyan("benchmark evaluate")} ${import_picocolors87.default.dim("--spec <path> --result <path> --json")}`);
|
|
103344
|
+
out.push(` ${import_picocolors87.default.cyan("benchmark capabilities")} ${import_picocolors87.default.dim("--json")}`);
|
|
102938
103345
|
out.push("");
|
|
102939
103346
|
out.push(divider("ORCHESTRATIONS"));
|
|
102940
103347
|
out.push("");
|
|
102941
|
-
out.push(` ${
|
|
102942
|
-
out.push(` ${
|
|
102943
|
-
out.push(` ${
|
|
102944
|
-
out.push(` ${
|
|
102945
|
-
out.push(` ${
|
|
102946
|
-
out.push(` ${
|
|
102947
|
-
out.push(` ${
|
|
102948
|
-
out.push(` ${
|
|
103348
|
+
out.push(` ${import_picocolors87.default.cyan("orchestration init")} ${import_picocolors87.default.dim("write a starter brainbase-orchestration.yaml here (offline, no login)")}`);
|
|
103349
|
+
out.push(` ${import_picocolors87.default.cyan("orchestration create")} ${import_picocolors87.default.dim("claim a local orchestration manifest and create it in the cloud")}`);
|
|
103350
|
+
out.push(` ${import_picocolors87.default.cyan("orchestration from-agent")} ${import_picocolors87.default.dim("turn an existing agent into an orchestration")}`);
|
|
103351
|
+
out.push(` ${import_picocolors87.default.cyan("orchestration list")} ${import_picocolors87.default.dim("list orchestrations under a team")}`);
|
|
103352
|
+
out.push(` ${import_picocolors87.default.cyan("orchestration pull")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("recursively fetch an orchestration + every member agent (--force to discard local concurrency edits)")}`);
|
|
103353
|
+
out.push(` ${import_picocolors87.default.cyan("orchestration push")} ${import_picocolors87.default.dim("recursively push each member, then update the graph")}`);
|
|
103354
|
+
out.push(` ${import_picocolors87.default.cyan("orchestration status")} ${import_picocolors87.default.dim("show what would push and what would pull")}`);
|
|
103355
|
+
out.push(` ${import_picocolors87.default.cyan("orchestration delete")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("permanently delete an orchestration graph (member agents are kept)")}`);
|
|
102949
103356
|
out.push("");
|
|
102950
103357
|
out.push(divider("TEMPLATES"));
|
|
102951
103358
|
out.push("");
|
|
102952
|
-
out.push(` ${
|
|
102953
|
-
out.push(` ${
|
|
102954
|
-
out.push(` ${
|
|
102955
|
-
out.push(` ${
|
|
102956
|
-
out.push(` ${
|
|
102957
|
-
out.push(` ${
|
|
102958
|
-
out.push(` ${
|
|
103359
|
+
out.push(` ${import_picocolors87.default.cyan("template pack")} ${import_picocolors87.default.dim("bundle the current agent into a template")}`);
|
|
103360
|
+
out.push(` ${import_picocolors87.default.cyan("template publish")} ${import_picocolors87.default.dim("upload a template to the registry")}`);
|
|
103361
|
+
out.push(` ${import_picocolors87.default.cyan("template search")} ${import_picocolors87.default.dim("[query]")} ${import_picocolors87.default.dim("search the registry")}`);
|
|
103362
|
+
out.push(` ${import_picocolors87.default.cyan("template info")} ${import_picocolors87.default.dim("<creator/slug>")} ${import_picocolors87.default.dim("show registry details for a template")}`);
|
|
103363
|
+
out.push(` ${import_picocolors87.default.cyan("template onboard")} ${import_picocolors87.default.dim("<creator/slug>")} ${import_picocolors87.default.dim("install (or refresh) a template")}`);
|
|
103364
|
+
out.push(` ${import_picocolors87.default.cyan("template list")} ${import_picocolors87.default.dim("show installed templates")}`);
|
|
103365
|
+
out.push(` ${import_picocolors87.default.cyan("template remove")} ${import_picocolors87.default.dim("<creator/slug>")} ${import_picocolors87.default.dim("uninstall a template")}`);
|
|
102959
103366
|
out.push("");
|
|
102960
103367
|
out.push(divider("SKILLS"));
|
|
102961
103368
|
out.push("");
|
|
102962
|
-
out.push(` ${
|
|
102963
|
-
out.push(` ${
|
|
102964
|
-
out.push(` ${
|
|
102965
|
-
out.push(` ${
|
|
102966
|
-
out.push(` ${
|
|
102967
|
-
out.push(` ${
|
|
102968
|
-
out.push(` ${
|
|
103369
|
+
out.push(` ${import_picocolors87.default.cyan("skill add")} ${import_picocolors87.default.dim("<source>")} ${import_picocolors87.default.dim("install a skill (github / git / brainbase)")}`);
|
|
103370
|
+
out.push(` ${import_picocolors87.default.cyan("skill list")} ${import_picocolors87.default.dim("show locally installed skills + their source")}`);
|
|
103371
|
+
out.push(` ${import_picocolors87.default.cyan("skill update")} ${import_picocolors87.default.dim("<slug>")} ${import_picocolors87.default.dim("re-fetch a skill from its recorded source")}`);
|
|
103372
|
+
out.push(` ${import_picocolors87.default.cyan("skill remove")} ${import_picocolors87.default.dim("<slug>")} ${import_picocolors87.default.dim("uninstall a skill")}`);
|
|
103373
|
+
out.push(` ${import_picocolors87.default.cyan("skill search")} ${import_picocolors87.default.dim("[query]")} ${import_picocolors87.default.dim("search the brainbase skill registry")}`);
|
|
103374
|
+
out.push(` ${import_picocolors87.default.cyan("skill info")} ${import_picocolors87.default.dim("<creator/slug>")} ${import_picocolors87.default.dim("show registry details for a skill")}`);
|
|
103375
|
+
out.push(` ${import_picocolors87.default.cyan("skill publish")} ${import_picocolors87.default.dim("[dir]")} ${import_picocolors87.default.dim("publish a SKILL.md folder (defaults to .)")}`);
|
|
102969
103376
|
out.push("");
|
|
102970
103377
|
out.push(divider("CLI TOKENS"));
|
|
102971
103378
|
out.push("");
|
|
102972
|
-
out.push(` ${
|
|
102973
|
-
out.push(` ${
|
|
102974
|
-
out.push(` ${
|
|
102975
|
-
out.push(` ${
|
|
103379
|
+
out.push(` ${import_picocolors87.default.cyan("token create")} ${import_picocolors87.default.dim("issue a long-lived CLI key for CI / scripts")}`);
|
|
103380
|
+
out.push(` ${import_picocolors87.default.cyan("token list")} ${import_picocolors87.default.dim("show your tokens")}`);
|
|
103381
|
+
out.push(` ${import_picocolors87.default.cyan("token rename")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("relabel a token")}`);
|
|
103382
|
+
out.push(` ${import_picocolors87.default.cyan("token revoke")} ${import_picocolors87.default.dim("<id>")} ${import_picocolors87.default.dim("revoke a token")}`);
|
|
102976
103383
|
out.push("");
|
|
102977
103384
|
out.push(divider("DECISIONS"));
|
|
102978
103385
|
out.push("");
|
|
102979
|
-
out.push(` ${
|
|
103386
|
+
out.push(` ${import_picocolors87.default.cyan("decide")} ${import_picocolors87.default.dim("-q <questions.json> <sources...>")} ${import_picocolors87.default.dim("answer decision-model questions over many files or rows in a few requests (`decide --help`)")}`);
|
|
102980
103387
|
out.push("");
|
|
102981
103388
|
out.push(divider("MCP"));
|
|
102982
103389
|
out.push("");
|
|
102983
|
-
out.push(` ${
|
|
102984
|
-
out.push(` ${
|
|
102985
|
-
out.push(` ${
|
|
102986
|
-
out.push(` ${
|
|
102987
|
-
out.push(` ${
|
|
102988
|
-
out.push(` ${
|
|
102989
|
-
out.push(` ${
|
|
103390
|
+
out.push(` ${import_picocolors87.default.cyan("mcp check")} ${import_picocolors87.default.dim("[--json]")} ${import_picocolors87.default.dim("verify MCP server connectivity through the brainbase proxy (runs at sandbox bootstrap)")}`);
|
|
103391
|
+
out.push(` ${import_picocolors87.default.cyan("mcp list")} ${import_picocolors87.default.dim("[--json]")} ${import_picocolors87.default.dim("show configured servers with OAuth state and expiry")}`);
|
|
103392
|
+
out.push(` ${import_picocolors87.default.cyan("mcp connect")} ${import_picocolors87.default.dim("<name>")} ${import_picocolors87.default.dim("authorize an OAuth-backed server: prints a single-use link, opens it, waits for approval")}`);
|
|
103393
|
+
out.push(` ${import_picocolors87.default.cyan("mcp tools")} ${import_picocolors87.default.dim("<server>")} ${import_picocolors87.default.dim("list a server's tools, including the built-in slack connector (--agent <id>)")}`);
|
|
103394
|
+
out.push(` ${import_picocolors87.default.cyan("mcp call")} ${import_picocolors87.default.dim("<server> <tool>")} ${import_picocolors87.default.dim("call a tool with --args '<json>', --args-file <path> or JSON on stdin; writes need --yes with no terminal")}`);
|
|
103395
|
+
out.push(` ${import_picocolors87.default.cyan("mcp search")} ${import_picocolors87.default.dim("<query>")} ${import_picocolors87.default.dim("find MCP servers in the registry, Pipedream and Brainbase (--source, --limit)")}`);
|
|
103396
|
+
out.push(` ${import_picocolors87.default.cyan("mcp add")} ${import_picocolors87.default.dim("<registry-name>")} ${import_picocolors87.default.dim("add a registry server to brainbase.agent.yaml (--name); then agent push")}`);
|
|
102990
103397
|
out.push("");
|
|
102991
103398
|
out.push(divider("INTEGRATIONS"));
|
|
102992
103399
|
out.push("");
|
|
102993
|
-
out.push(` ${
|
|
102994
|
-
out.push(` ${
|
|
102995
|
-
out.push(` ${
|
|
102996
|
-
out.push(` ${
|
|
102997
|
-
out.push(` ${
|
|
102998
|
-
out.push(` ${
|
|
102999
|
-
out.push(` ${
|
|
103000
|
-
out.push(` ${
|
|
103001
|
-
out.push(` ${
|
|
103002
|
-
out.push(` ${
|
|
103400
|
+
out.push(` ${import_picocolors87.default.cyan("integrations list")} ${import_picocolors87.default.dim("show the agent's Pipedream apps, accounts and app-level permission")}`);
|
|
103401
|
+
out.push(` ${import_picocolors87.default.cyan("integrations search")} ${import_picocolors87.default.dim("<query>")} ${import_picocolors87.default.dim("find apps in the Pipedream catalog")}`);
|
|
103402
|
+
out.push(` ${import_picocolors87.default.cyan("integrations actions")} ${import_picocolors87.default.dim("<app>")} ${import_picocolors87.default.dim("list an app's actions and whether each is allowed")}`);
|
|
103403
|
+
out.push(` ${import_picocolors87.default.cyan("integrations add")} ${import_picocolors87.default.dim("<app>")} ${import_picocolors87.default.dim("install an app; one that needs an account runs connect")}`);
|
|
103404
|
+
out.push(` ${import_picocolors87.default.cyan("integrations connect")} ${import_picocolors87.default.dim("<app>")} ${import_picocolors87.default.dim("open Pipedream's connect page for the app and wait for the account")}`);
|
|
103405
|
+
out.push(` ${import_picocolors87.default.cyan("integrations disconnect")} ${import_picocolors87.default.dim("<app>")} ${import_picocolors87.default.dim("delete the app's connected account")}`);
|
|
103406
|
+
out.push(` ${import_picocolors87.default.cyan("integrations remove")} ${import_picocolors87.default.dim("<app>")} ${import_picocolors87.default.dim("uninstall an app that needs no account")}`);
|
|
103407
|
+
out.push(` ${import_picocolors87.default.cyan("integrations allow|ask|deny")} ${import_picocolors87.default.dim("<app>[.<action>]")} ${import_picocolors87.default.dim("set the permission for an app or one of its actions")}`);
|
|
103408
|
+
out.push(` ${import_picocolors87.default.cyan("integrations context create")} ${import_picocolors87.default.dim("--application <name>")} ${import_picocolors87.default.dim("let a program outside Brainbase (the SDK) use the agent's integrations; prints a renewal handle once")}`);
|
|
103409
|
+
out.push(` ${import_picocolors87.default.cyan("integrations context end")} ${import_picocolors87.default.dim("<context-id>")} ${import_picocolors87.default.dim("end a standalone integration context now")}`);
|
|
103003
103410
|
out.push("");
|
|
103004
103411
|
out.push(divider("FLAGS"));
|
|
103005
103412
|
out.push("");
|
|
103006
|
-
out.push(` ${
|
|
103007
|
-
out.push(` ${
|
|
103008
|
-
out.push(` ${
|
|
103413
|
+
out.push(` ${import_picocolors87.default.dim("--harness <id>")} force harness for onboard / sync (e.g. claude-code)`);
|
|
103414
|
+
out.push(` ${import_picocolors87.default.dim("--scope <s>")} force scope: global | project`);
|
|
103415
|
+
out.push(` ${import_picocolors87.default.dim("--yes, -y")} skip confirmations / auto-overwrite`);
|
|
103009
103416
|
out.push(` ${" ".repeat("--yes, -y".length)} required for destructive commands with no terminal (pipes, CI)`);
|
|
103010
|
-
out.push(` ${
|
|
103011
|
-
out.push(` ${
|
|
103012
|
-
out.push(` ${
|
|
103013
|
-
out.push(` ${
|
|
103014
|
-
out.push(` ${
|
|
103015
|
-
out.push(` ${
|
|
103016
|
-
out.push(` ${
|
|
103017
|
-
out.push(` ${
|
|
103018
|
-
out.push(` ${
|
|
103019
|
-
out.push(` ${
|
|
103020
|
-
out.push(` ${
|
|
103021
|
-
out.push(` ${
|
|
103022
|
-
out.push(` ${
|
|
103023
|
-
out.push(` ${
|
|
103024
|
-
out.push(` ${
|
|
103025
|
-
out.push(` ${
|
|
103026
|
-
out.push(` ${
|
|
103027
|
-
out.push(` ${
|
|
103028
|
-
out.push(` ${
|
|
103029
|
-
out.push(` ${
|
|
103030
|
-
out.push(` ${
|
|
103031
|
-
out.push(` ${
|
|
103032
|
-
out.push(` ${
|
|
103033
|
-
out.push(` ${
|
|
103034
|
-
out.push(` ${
|
|
103035
|
-
out.push(` ${
|
|
103036
|
-
out.push(` ${
|
|
103037
|
-
out.push(` ${
|
|
103038
|
-
out.push(` ${
|
|
103039
|
-
out.push(` ${
|
|
103040
|
-
out.push(` ${
|
|
103041
|
-
out.push(` ${
|
|
103042
|
-
out.push(` ${
|
|
103043
|
-
out.push(` ${
|
|
103044
|
-
out.push(` ${
|
|
103045
|
-
out.push(` ${
|
|
103046
|
-
out.push(` ${
|
|
103417
|
+
out.push(` ${import_picocolors87.default.dim("--agent <id>")} for link/task create/mcp list/connect/tools/call/integrations: use this agent id explicitly instead of the linked folder's (task list: filter to it)`);
|
|
103418
|
+
out.push(` ${import_picocolors87.default.dim("--message <text>")} for task create: required first user message`);
|
|
103419
|
+
out.push(` ${import_picocolors87.default.dim("--title <text>")} for task create: optional task title; for task update: the new title`);
|
|
103420
|
+
out.push(` ${import_picocolors87.default.dim("--clear-title")} for task update: remove the title (automatic titling may name it again later)`);
|
|
103421
|
+
out.push(` ${import_picocolors87.default.dim("--metadata k=v")} for task create: label the task; for task list: only tasks with this label; for task update: set one label, keeping the others (all repeatable)`);
|
|
103422
|
+
out.push(` ${import_picocolors87.default.dim("--unset-metadata <k>")} for task update: remove one label (repeatable)`);
|
|
103423
|
+
out.push(` ${import_picocolors87.default.dim("--clear-metadata")} for task update: remove every label; with --metadata, keep only those given`);
|
|
103424
|
+
out.push(` ${import_picocolors87.default.dim("--model <id>")} for task create: optional model override; for task update: switch the model the task's next turn runs on (the running turn keeps its model)`);
|
|
103425
|
+
out.push(` ${import_picocolors87.default.dim("--clear-model")} for task update: go back to the agent's default model from the next turn`);
|
|
103426
|
+
out.push(` ${import_picocolors87.default.dim("--version <v>")} for task create: run a saved version of the agent (12, v12 or a version id)`);
|
|
103427
|
+
out.push(` ${import_picocolors87.default.dim("--wait")} for task create: block until the task finishes; exit 1 unless it succeeded`);
|
|
103428
|
+
out.push(` ${import_picocolors87.default.dim("--timeout <secs>")} for task create --wait: give up after <secs> and exit 1`);
|
|
103429
|
+
out.push(` ${import_picocolors87.default.dim("--limit <n>")} for task list (1-200), task logs (events to print; with --follow, the first page size) and machine ls`);
|
|
103430
|
+
out.push(` ${import_picocolors87.default.dim("--follow, -f")} for task logs: stay attached and print events as they land`);
|
|
103431
|
+
out.push(` ${import_picocolors87.default.dim("--org <id-or-slug>")} pick the organization (team/agent list, agent create, orchestration create/list)`);
|
|
103432
|
+
out.push(` ${import_picocolors87.default.dim("--team <id>")} pick the team, same commands (works without --org)`);
|
|
103433
|
+
out.push(` ${import_picocolors87.default.dim("--all-teams")} for agent list: every team in the org (the default with no terminal)`);
|
|
103434
|
+
out.push(` ${import_picocolors87.default.dim("--json")} machine-readable output for supported commands`);
|
|
103435
|
+
out.push(` ${import_picocolors87.default.dim("--no-tracking")} for link / agent pull --link: skip routing LLM traffic through brainbase`);
|
|
103436
|
+
out.push(` ${import_picocolors87.default.dim("--link")} for agent pull: link this folder to the agent first, as \`brainbase link --agent <id> --yes\` would, in one process`);
|
|
103437
|
+
out.push(` ${import_picocolors87.default.dim("--track")} for agent create: enable tracking non-interactively (off without a TTY)`);
|
|
103438
|
+
out.push(` ${import_picocolors87.default.dim("--shell <sh|fish>")} for agent env: pick output format (auto-detected from $SHELL)`);
|
|
103439
|
+
out.push(` ${import_picocolors87.default.dim("--bot-token <t>")} for agent connect slack (or BRAINBASE_SLACK_BOT_TOKEN, or stdin); without one, a setup link opens instead`);
|
|
103440
|
+
out.push(` ${import_picocolors87.default.dim("--signing-secret <s>")} for agent connect slack (or BRAINBASE_SLACK_SIGNING_SECRET, or stdin)`);
|
|
103441
|
+
out.push(` ${import_picocolors87.default.dim("--bot-name <name>")} for agent connect meeting: the bot's display name`);
|
|
103442
|
+
out.push(` ${import_picocolors87.default.dim("--app-id <id> / --app-name <name>")} optional Slack app identity`);
|
|
103443
|
+
out.push(` ${import_picocolors87.default.dim("--bot-image-url <url>")} optional meeting bot image`);
|
|
103444
|
+
out.push(` ${import_picocolors87.default.dim("--full")} for agent/orchestration init: write a commented template covering every block`);
|
|
103445
|
+
out.push(` ${import_picocolors87.default.dim("--minimal")} for agent init: write the starter manifest (the default)`);
|
|
103446
|
+
out.push(` ${import_picocolors87.default.dim("--all")} for template list: include installs from other folders; for machine ls: include torn-down machines`);
|
|
103447
|
+
out.push(` ${import_picocolors87.default.dim("--web <url>")} for login: web app URL (default https://app.brainbaselabs.com)`);
|
|
103448
|
+
out.push(` ${import_picocolors87.default.dim("--no-open")} for mcp/integrations/slack connect: print the link without opening a browser (implied with no terminal)`);
|
|
103449
|
+
out.push(` ${import_picocolors87.default.dim("--no-wait")} for mcp/integrations/slack connect: print the link and exit instead of waiting`);
|
|
103450
|
+
out.push(` ${import_picocolors87.default.dim("--account <id>")} for integrations disconnect: which account, when the app has more than one`);
|
|
103451
|
+
out.push(` ${import_picocolors87.default.dim("--application <name>")} for integrations context create: names the program the context is for`);
|
|
103452
|
+
out.push(` ${import_picocolors87.default.dim("--max-lifetime <dur>")} for integrations context create: when the context ends at the latest, 60s-30d (default 7d)`);
|
|
103453
|
+
out.push(` ${import_picocolors87.default.dim("--reason <text>")} for integrations context end: recorded with the context`);
|
|
103047
103454
|
out.push("");
|
|
103048
103455
|
out.push(divider("ENV"));
|
|
103049
103456
|
out.push("");
|
|
103050
|
-
out.push(` ${
|
|
103051
|
-
out.push(` ${
|
|
103457
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_HOME")} override the local config dir (default ~/.brainbase)`);
|
|
103458
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_DEBUG")} print full stack traces on error (any value; unset to disable)`);
|
|
103052
103459
|
if (httpRetryEnabled())
|
|
103053
|
-
out.push(` ${
|
|
103054
|
-
out.push(` ${
|
|
103055
|
-
out.push(` ${
|
|
103056
|
-
out.push(` ${
|
|
103057
|
-
out.push(` ${
|
|
103058
|
-
out.push(` ${
|
|
103059
|
-
out.push(` ${
|
|
103060
|
-
out.push(` ${
|
|
103061
|
-
out.push(` ${
|
|
103062
|
-
out.push(` ${
|
|
103460
|
+
out.push(` ${import_picocolors87.default.dim("--debug")} print stack traces and the full error cause chain`);
|
|
103461
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_WEB_URL")} override the web app URL used by login, console links and integrations`);
|
|
103462
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_CONTROL_PLANE_URL")} override the MAS host (/v2/cli; task and interface commands use /v2/tasks and /v2/interfaces)`);
|
|
103463
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_API_URL")} legacy KLS host override (uses /api/cli; proxy/registry fallback)`);
|
|
103464
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_PROXY_URL")} override the model-proxy URL used by harness traffic (default https://api.v1.brainbaselabs.com)`);
|
|
103465
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_REGISTRY_URL")} override the registry API URL (default https://api.v1.brainbaselabs.com)`);
|
|
103466
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_TOKEN")} long-lived CLI PAT; outranks the login session and the PAT saved in token.json`);
|
|
103467
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_SKIP_AUTH")} bypass the auth gate for development`);
|
|
103468
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_NON_INTERACTIVE")} force non-interactive mode — skip/auto-default prompts (CI & agents)`);
|
|
103469
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_RUN_ENTRYPOINT")} =1 → agent pull executes the agent entrypoint (sandbox boots; or pass --run-entrypoint)`);
|
|
103470
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_TELEMETRY_DISABLED")} =1 → send no usage data (also DO_NOT_TRACK=1, or brainbase telemetry disable)`);
|
|
103063
103471
|
out.push("");
|
|
103064
|
-
out.push(` ${
|
|
103065
|
-
out.push(` ${
|
|
103066
|
-
out.push(` ${
|
|
103067
|
-
out.push(` ${
|
|
103068
|
-
out.push(` ${
|
|
103069
|
-
out.push(` ${
|
|
103070
|
-
out.push(` ${
|
|
103472
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_MEMORY_MCP_URL")} override the built-in memory MCP host`);
|
|
103473
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_BROWSER_MCP_URL")} override the built-in browser MCP host`);
|
|
103474
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_SLACK_MCP_URL")} override the built-in Slack MCP host`);
|
|
103475
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_MEETING_MCP_URL")} override the built-in meeting MCP host`);
|
|
103476
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_GITHUB_MCP_URL")} override the built-in GitHub MCP host`);
|
|
103477
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_LINEAR_MCP_URL")} override the built-in Linear MCP host`);
|
|
103478
|
+
out.push(` ${import_picocolors87.default.dim("BRAINBASE_ORCHESTRATION_MCP_URL")} override the built-in orchestration MCP host`);
|
|
103071
103479
|
out.push("");
|
|
103072
103480
|
out.push(divider("HARNESSES"));
|
|
103073
103481
|
out.push("");
|
|
103074
|
-
out.push(` ${
|
|
103075
|
-
out.push(` ${
|
|
103076
|
-
out.push(` ${
|
|
103482
|
+
out.push(` ${import_picocolors87.default.dim("•")} ${import_picocolors87.default.bold("claude-code")} ${import_picocolors87.default.dim("skills, mcps, agents, commands, playbooks, instructions, files")}`);
|
|
103483
|
+
out.push(` ${import_picocolors87.default.dim("•")} ${import_picocolors87.default.bold("codex")} ${import_picocolors87.default.dim("skills, mcps, commands, playbooks, instructions, files")}`);
|
|
103484
|
+
out.push(` ${import_picocolors87.default.dim("•")} ${import_picocolors87.default.bold("kafka")} ${import_picocolors87.default.dim("skills, mcps, agents, commands, playbooks, instructions, files")}`);
|
|
103077
103485
|
out.push("");
|
|
103078
103486
|
console.log(out.join(`
|
|
103079
103487
|
`));
|
|
@@ -103206,9 +103614,9 @@ function hasFlag2(args, ...names) {
|
|
|
103206
103614
|
async function requireAuth(cmd) {
|
|
103207
103615
|
if (!PROTECTED.has(cmd))
|
|
103208
103616
|
return;
|
|
103209
|
-
if (
|
|
103617
|
+
if (process15.env.BRAINBASE_SKIP_AUTH === "1")
|
|
103210
103618
|
return;
|
|
103211
|
-
const envToken =
|
|
103619
|
+
const envToken = process15.env.BRAINBASE_TOKEN;
|
|
103212
103620
|
if (envToken && envToken.trim())
|
|
103213
103621
|
return;
|
|
103214
103622
|
let status = authStatus();
|
|
@@ -103231,15 +103639,15 @@ async function requireAuth(cmd) {
|
|
|
103231
103639
|
if (storedPatFor(status.session))
|
|
103232
103640
|
return;
|
|
103233
103641
|
console.error("");
|
|
103234
|
-
console.error(` ${brandTint("◆")} ${
|
|
103642
|
+
console.error(` ${brandTint("◆")} ${import_picocolors87.default.bold("brainbase")}`);
|
|
103235
103643
|
console.error("");
|
|
103236
|
-
console.error(` ${
|
|
103237
|
-
console.error(` ${
|
|
103644
|
+
console.error(` ${import_picocolors87.default.red("✗")} You need to sign in to use ${import_picocolors87.default.bold("brainbase " + cmd)}.`);
|
|
103645
|
+
console.error(` ${import_picocolors87.default.dim(noUsableCredentialMessage())}`);
|
|
103238
103646
|
console.error("");
|
|
103239
|
-
|
|
103647
|
+
process15.exit(1);
|
|
103240
103648
|
}
|
|
103241
103649
|
async function main() {
|
|
103242
|
-
const argv =
|
|
103650
|
+
const argv = process15.argv.slice(2);
|
|
103243
103651
|
const separator = argv.indexOf("--");
|
|
103244
103652
|
const debugIndex = argv.findIndex((arg, index) => arg === "--debug" && !isValueOfPriorFlag2(argv, index) && (separator < 0 || index < separator));
|
|
103245
103653
|
const debug = httpRetryEnabled() && argv[0] !== "run" && debugIndex >= 0;
|
|
@@ -103247,11 +103655,12 @@ async function main() {
|
|
|
103247
103655
|
argv.splice(debugIndex, 1);
|
|
103248
103656
|
enableDebugOutput();
|
|
103249
103657
|
}
|
|
103658
|
+
startTelemetry(argv);
|
|
103250
103659
|
const cmd = argv.shift();
|
|
103251
|
-
const rawCwd =
|
|
103660
|
+
const rawCwd = process15.cwd();
|
|
103252
103661
|
const cwd2 = (() => {
|
|
103253
103662
|
try {
|
|
103254
|
-
return
|
|
103663
|
+
return fs98.realpathSync(rawCwd);
|
|
103255
103664
|
} catch {
|
|
103256
103665
|
return rawCwd;
|
|
103257
103666
|
}
|
|
@@ -103341,6 +103750,10 @@ async function main() {
|
|
|
103341
103750
|
await runWhoami({ json: jsonFlag });
|
|
103342
103751
|
break;
|
|
103343
103752
|
}
|
|
103753
|
+
case "telemetry": {
|
|
103754
|
+
process15.exitCode = runTelemetry(argv.shift());
|
|
103755
|
+
break;
|
|
103756
|
+
}
|
|
103344
103757
|
case "template": {
|
|
103345
103758
|
const sub = argv.shift();
|
|
103346
103759
|
await runTemplate(cwd2, sub, argv, {
|
|
@@ -103461,7 +103874,7 @@ async function main() {
|
|
|
103461
103874
|
}
|
|
103462
103875
|
case "benchmark": {
|
|
103463
103876
|
const sub = argv.shift();
|
|
103464
|
-
|
|
103877
|
+
process15.exitCode = await runBenchmark(sub, argv, undefined, cwd2);
|
|
103465
103878
|
break;
|
|
103466
103879
|
}
|
|
103467
103880
|
case "orchestration":
|
|
@@ -103502,17 +103915,17 @@ async function main() {
|
|
|
103502
103915
|
noOpen: noOpenFlag,
|
|
103503
103916
|
noWait: noWaitFlag
|
|
103504
103917
|
});
|
|
103505
|
-
|
|
103918
|
+
process15.exitCode = code;
|
|
103506
103919
|
break;
|
|
103507
103920
|
}
|
|
103508
103921
|
case "decide": {
|
|
103509
|
-
|
|
103922
|
+
process15.exitCode = await runDecide(cwd2, argv);
|
|
103510
103923
|
break;
|
|
103511
103924
|
}
|
|
103512
103925
|
case "integration":
|
|
103513
103926
|
case "integrations": {
|
|
103514
103927
|
const sub = argv.shift();
|
|
103515
|
-
|
|
103928
|
+
process15.exitCode = await runIntegrations(cwd2, sub, argv, {
|
|
103516
103929
|
agentId: agentFlag,
|
|
103517
103930
|
json: jsonFlag,
|
|
103518
103931
|
yes: yes2,
|
|
@@ -103526,20 +103939,20 @@ async function main() {
|
|
|
103526
103939
|
console.error(`Unknown command: ${cmd}
|
|
103527
103940
|
${didYouMean(cmd, COMMANDS3, "brainbase")}`);
|
|
103528
103941
|
help();
|
|
103529
|
-
|
|
103942
|
+
process15.exit(1);
|
|
103530
103943
|
}
|
|
103531
103944
|
} catch (err) {
|
|
103532
103945
|
const message3 = sanitizeLines(err.message).join(`
|
|
103533
103946
|
`);
|
|
103534
|
-
console.error(
|
|
103947
|
+
console.error(import_picocolors87.default.red(`
|
|
103535
103948
|
${message3}`));
|
|
103536
103949
|
if (err instanceof ApiError && err.status === 401 && !err.message.includes("brainbase login")) {
|
|
103537
|
-
console.error(` Run ${
|
|
103950
|
+
console.error(` Run ${import_picocolors87.default.cyan("brainbase login")} to connect this device.`);
|
|
103538
103951
|
}
|
|
103539
|
-
if (debug ||
|
|
103952
|
+
if (debug || process15.env.BRAINBASE_DEBUG) {
|
|
103540
103953
|
console.error(debug || httpRetryEnabled() ? formatErrorCauseChain(err) : err.stack);
|
|
103541
103954
|
}
|
|
103542
|
-
|
|
103955
|
+
process15.exit(1);
|
|
103543
103956
|
}
|
|
103544
103957
|
}
|
|
103545
103958
|
main();
|