@brainbase-labs/cli 0.26.0 → 0.27.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/dist/index.js +723 -270
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35141,7 +35141,7 @@ var require_dist2 = __commonJS((exports, module) => {
|
|
|
35141
35141
|
});
|
|
35142
35142
|
|
|
35143
35143
|
// src/index.ts
|
|
35144
|
-
var
|
|
35144
|
+
var import_picocolors54 = __toESM(require_picocolors(), 1);
|
|
35145
35145
|
import process14 from "node:process";
|
|
35146
35146
|
import fs83 from "node:fs";
|
|
35147
35147
|
|
|
@@ -36008,7 +36008,7 @@ function padStart(s, n) {
|
|
|
36008
36008
|
// package.json
|
|
36009
36009
|
var package_default = {
|
|
36010
36010
|
name: "@brainbase-labs/cli",
|
|
36011
|
-
version: "0.
|
|
36011
|
+
version: "0.27.0",
|
|
36012
36012
|
description: "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
|
|
36013
36013
|
type: "module",
|
|
36014
36014
|
bin: {
|
|
@@ -54439,6 +54439,21 @@ var api = {
|
|
|
54439
54439
|
body: JSON.stringify(input)
|
|
54440
54440
|
});
|
|
54441
54441
|
},
|
|
54442
|
+
async listAgentEvals(agentId, opts) {
|
|
54443
|
+
const qs = opts?.includeArchived ? "?include_archived=true" : "";
|
|
54444
|
+
const body = await request(`/agents/${encodeURIComponent(agentId)}/evals${qs}`);
|
|
54445
|
+
return Array.isArray(body) ? body : body.items ?? [];
|
|
54446
|
+
},
|
|
54447
|
+
async listAgentEvalRuns(agentId, opts) {
|
|
54448
|
+
const params = new URLSearchParams;
|
|
54449
|
+
if (opts?.taskId)
|
|
54450
|
+
params.set("task_id", opts.taskId);
|
|
54451
|
+
if (opts?.limit !== undefined)
|
|
54452
|
+
params.set("limit", String(opts.limit));
|
|
54453
|
+
const qs = params.toString() ? `?${params.toString()}` : "";
|
|
54454
|
+
const body = await request(`/agents/${encodeURIComponent(agentId)}/eval-runs${qs}`);
|
|
54455
|
+
return Array.isArray(body) ? body : body.items ?? [];
|
|
54456
|
+
},
|
|
54442
54457
|
async getAgentSecrets(agentId) {
|
|
54443
54458
|
const body = await request(`/agents/${encodeURIComponent(agentId)}/secrets`);
|
|
54444
54459
|
const secrets = body && typeof body === "object" ? body.secrets : undefined;
|
|
@@ -62276,6 +62291,37 @@ function backfillPlaybookIds(playbooks, cloudComponents) {
|
|
|
62276
62291
|
});
|
|
62277
62292
|
return { playbooks: changed ? next : playbooks, changed };
|
|
62278
62293
|
}
|
|
62294
|
+
function backfillEvalIds(evals, cloudComponents) {
|
|
62295
|
+
const bySlug = new Map;
|
|
62296
|
+
for (const c2 of cloudComponents) {
|
|
62297
|
+
if (c2.type !== "eval")
|
|
62298
|
+
continue;
|
|
62299
|
+
const id = c2.meta?.eval_id;
|
|
62300
|
+
const payload = c2.meta?.eval;
|
|
62301
|
+
const judgeAgent = payload?.judge_agent;
|
|
62302
|
+
bySlug.set(c2.slug, {
|
|
62303
|
+
...typeof id === "string" && id ? { id } : {},
|
|
62304
|
+
...typeof judgeAgent === "string" && judgeAgent ? { judgeAgent } : {}
|
|
62305
|
+
});
|
|
62306
|
+
}
|
|
62307
|
+
let changed = false;
|
|
62308
|
+
const next = evals.map((entry) => {
|
|
62309
|
+
const cloud = bySlug.get(entry.slug);
|
|
62310
|
+
if (!cloud)
|
|
62311
|
+
return entry;
|
|
62312
|
+
let updated = entry;
|
|
62313
|
+
if (!updated.id && cloud.id) {
|
|
62314
|
+
updated = { id: cloud.id, ...updated };
|
|
62315
|
+
changed = true;
|
|
62316
|
+
}
|
|
62317
|
+
if (cloud.judgeAgent && updated.judge_agent !== undefined && updated.judge_agent !== cloud.judgeAgent) {
|
|
62318
|
+
updated = { ...updated, judge_agent: cloud.judgeAgent };
|
|
62319
|
+
changed = true;
|
|
62320
|
+
}
|
|
62321
|
+
return updated;
|
|
62322
|
+
});
|
|
62323
|
+
return { evals: changed ? next : evals, changed };
|
|
62324
|
+
}
|
|
62279
62325
|
function stripPlaybookFrontmatter(raw) {
|
|
62280
62326
|
const m3 = /^---\s*\n([\s\S]*?)\n---[ \t]*(?:\n|$)/.exec(raw);
|
|
62281
62327
|
if (!m3)
|
|
@@ -63545,7 +63591,7 @@ function runHarnessInstall(harnessId, components, opts, agentName) {
|
|
|
63545
63591
|
}
|
|
63546
63592
|
|
|
63547
63593
|
// src/cli/agent.ts
|
|
63548
|
-
var
|
|
63594
|
+
var import_picocolors39 = __toESM(require_picocolors(), 1);
|
|
63549
63595
|
|
|
63550
63596
|
// src/cli/agent-pull.ts
|
|
63551
63597
|
import { spawn as spawn2 } from "node:child_process";
|
|
@@ -63721,6 +63767,21 @@ function hashMcpEntry(entry) {
|
|
|
63721
63767
|
payload.is_enabled = entry.is_enabled ?? true;
|
|
63722
63768
|
return crypto4.createHash("sha256").update(canonicalJson(payload)).digest("hex");
|
|
63723
63769
|
}
|
|
63770
|
+
function evalWirePayload(entry) {
|
|
63771
|
+
return {
|
|
63772
|
+
criteria: entry.criteria,
|
|
63773
|
+
enabled: entry.enabled,
|
|
63774
|
+
icon: entry.icon || null,
|
|
63775
|
+
judge_agent: entry.judge_agent ?? null,
|
|
63776
|
+
judge_model: entry.judge_model,
|
|
63777
|
+
judge_type: entry.judge_type,
|
|
63778
|
+
output_shape: entry.output_shape,
|
|
63779
|
+
classification_values: entry.classification_values && entry.classification_values.length > 0 ? entry.classification_values : null
|
|
63780
|
+
};
|
|
63781
|
+
}
|
|
63782
|
+
function hashEvalEntry(entry) {
|
|
63783
|
+
return crypto4.createHash("sha256").update(canonicalJson(evalWirePayload(entry))).digest("hex");
|
|
63784
|
+
}
|
|
63724
63785
|
function fileHash(p2) {
|
|
63725
63786
|
if (!exists(p2))
|
|
63726
63787
|
return null;
|
|
@@ -63836,6 +63897,13 @@ function readLocalComponents(cwd2, manifest) {
|
|
|
63836
63897
|
hash: componentHashFromFileHashes([hashString(wireBody)])
|
|
63837
63898
|
});
|
|
63838
63899
|
}
|
|
63900
|
+
for (const entry of manifest.evals ?? []) {
|
|
63901
|
+
out.push({
|
|
63902
|
+
type: "eval",
|
|
63903
|
+
slug: entry.slug,
|
|
63904
|
+
hash: hashEvalEntry(entry)
|
|
63905
|
+
});
|
|
63906
|
+
}
|
|
63839
63907
|
return out;
|
|
63840
63908
|
}
|
|
63841
63909
|
function threeWayDiff(input) {
|
|
@@ -64064,6 +64132,52 @@ function threeWayField(supported, authored, cloudRaw, lock, key2) {
|
|
|
64064
64132
|
return result2;
|
|
64065
64133
|
}
|
|
64066
64134
|
|
|
64135
|
+
// src/core/eval-merge.ts
|
|
64136
|
+
function evalsFromCloudComponents(components) {
|
|
64137
|
+
return components.filter((c2) => c2.type === "eval").map((c2) => {
|
|
64138
|
+
const meta = c2.meta ?? {};
|
|
64139
|
+
const payload = meta.eval ?? {};
|
|
64140
|
+
const classification = payload.classification_values;
|
|
64141
|
+
return {
|
|
64142
|
+
...typeof meta.eval_id === "string" && meta.eval_id ? { id: meta.eval_id } : {},
|
|
64143
|
+
slug: c2.slug,
|
|
64144
|
+
criteria: typeof payload.criteria === "string" ? payload.criteria : "",
|
|
64145
|
+
...typeof payload.icon === "string" && payload.icon ? { icon: payload.icon } : {},
|
|
64146
|
+
enabled: payload.enabled !== false,
|
|
64147
|
+
judge_model: typeof payload.judge_model === "string" && payload.judge_model ? payload.judge_model : "claude-sonnet-4-6",
|
|
64148
|
+
judge_type: payload.judge_type === "agent" ? "agent" : "model",
|
|
64149
|
+
...typeof payload.judge_agent === "string" && payload.judge_agent ? { judge_agent: payload.judge_agent } : {},
|
|
64150
|
+
output_shape: payload.output_shape === "rating" || payload.output_shape === "classification" ? payload.output_shape : "binary",
|
|
64151
|
+
...Array.isArray(classification) && classification.length > 0 ? { classification_values: classification.map(String) } : {}
|
|
64152
|
+
};
|
|
64153
|
+
});
|
|
64154
|
+
}
|
|
64155
|
+
function mergeEvals(input) {
|
|
64156
|
+
const localBySlug = new Map(input.local.map((e2) => [e2.slug, e2]));
|
|
64157
|
+
const cloudSlugs = new Set(input.cloud.map((e2) => e2.slug));
|
|
64158
|
+
const merged = input.cloud.map((cloudEntry) => {
|
|
64159
|
+
if (!input.keepLocalEvalSlugs.has(cloudEntry.slug))
|
|
64160
|
+
return cloudEntry;
|
|
64161
|
+
return localBySlug.get(cloudEntry.slug) ?? cloudEntry;
|
|
64162
|
+
});
|
|
64163
|
+
const preservedEdits = [];
|
|
64164
|
+
for (const entry of input.local) {
|
|
64165
|
+
if (cloudSlugs.has(entry.slug))
|
|
64166
|
+
continue;
|
|
64167
|
+
const baseline = input.syncedEvalHashes.get(entry.slug);
|
|
64168
|
+
if (baseline !== undefined) {
|
|
64169
|
+
if (baseline === hashEvalEntry(entry))
|
|
64170
|
+
continue;
|
|
64171
|
+
preservedEdits.push(entry.slug);
|
|
64172
|
+
}
|
|
64173
|
+
merged.push(entry);
|
|
64174
|
+
}
|
|
64175
|
+
if (preservedEdits.length && input.onPreservedEdits) {
|
|
64176
|
+
input.onPreservedEdits(preservedEdits);
|
|
64177
|
+
}
|
|
64178
|
+
return merged;
|
|
64179
|
+
}
|
|
64180
|
+
|
|
64067
64181
|
// src/core/capability-baseline.ts
|
|
64068
64182
|
var CLOUD_KEY = {
|
|
64069
64183
|
memory: "memory_enabled",
|
|
@@ -64742,7 +64856,7 @@ async function runAgentPull(cwd2, args) {
|
|
|
64742
64856
|
materializeInstructions(cwd2, cloud, toInstallKeys, keepLocalKeys, existingManifest);
|
|
64743
64857
|
materializeEntrypoint(cwd2, cloudAgent.entrypoint ?? "", existingManifest);
|
|
64744
64858
|
materializePlaybooks(cwd2, cloud, toInstallKeys, keepLocalKeys, existingManifest);
|
|
64745
|
-
const yaml = mergeManifest(cwd2, existingManifest, cloud, cloudAgent, harness, override ? {} : readLocalOnlyContentReporting(cwd2));
|
|
64859
|
+
const yaml = mergeManifest(cwd2, existingManifest, cloud, cloudAgent, harness, override ? {} : readLocalOnlyContentReporting(cwd2), new Map((lock?.components ?? []).filter((c2) => c2.type === "eval").map((c2) => [c2.slug, c2.hash])), new Set([...keepLocalKeys].filter((key2) => key2.startsWith("eval/")).map((key2) => key2.slice("eval/".length))));
|
|
64746
64860
|
writeManifest(cwd2, yaml);
|
|
64747
64861
|
writeLink(cwd2, buildLinkFromAgent(cloudAgent, harness, readLink(cwd2)));
|
|
64748
64862
|
const lockComponents = buildLockComponents({
|
|
@@ -64904,7 +65018,7 @@ function materializePlaybooks(cwd2, cloud, toInstall, keepLocal, existingManifes
|
|
|
64904
65018
|
fs73.writeFileSync(target, body, "utf8");
|
|
64905
65019
|
}
|
|
64906
65020
|
}
|
|
64907
|
-
function mergeManifest(cwd2, prev, cloud, cloudAgent, harness, localOnly = {}) {
|
|
65021
|
+
function mergeManifest(cwd2, prev, cloud, cloudAgent, harness, localOnly = {}, syncedEvalHashes = new Map, keepLocalEvalSlugs = new Set) {
|
|
64908
65022
|
const skills = cloud.components.filter((c2) => c2.type === "skill").map((c2) => {
|
|
64909
65023
|
const localDecl = prev?.skills.find((s3) => looseSkillComponentSlug(s3.source) === c2.slug);
|
|
64910
65024
|
if (localDecl)
|
|
@@ -64967,6 +65081,7 @@ function mergeManifest(cwd2, prev, cloud, cloudAgent, harness, localOnly = {}) {
|
|
|
64967
65081
|
entry.is_enabled = payload.is_enabled;
|
|
64968
65082
|
return entry;
|
|
64969
65083
|
});
|
|
65084
|
+
const evals = evalsFromCloudComponents(cloud.components);
|
|
64970
65085
|
const caps = capabilitiesFromAgent(cloudAgent);
|
|
64971
65086
|
const machineKind = cloudAgent.machine_kind ?? prev?.machine_kind;
|
|
64972
65087
|
const defaultModelSupported = Object.prototype.hasOwnProperty.call(cloudAgent, "default_model");
|
|
@@ -64985,8 +65100,16 @@ function mergeManifest(cwd2, prev, cloud, cloudAgent, harness, localOnly = {}) {
|
|
|
64985
65100
|
playbooks,
|
|
64986
65101
|
skills,
|
|
64987
65102
|
mcp,
|
|
64988
|
-
evals: [],
|
|
64989
65103
|
...localOnly,
|
|
65104
|
+
evals: mergeEvals({
|
|
65105
|
+
cloud: evals,
|
|
65106
|
+
local: localOnly.evals ?? [],
|
|
65107
|
+
syncedEvalHashes,
|
|
65108
|
+
keepLocalEvalSlugs,
|
|
65109
|
+
onPreservedEdits: (slugs) => {
|
|
65110
|
+
f2.warn(`Kept ${slugs.length} eval${slugs.length === 1 ? "" : "s"} with unpushed edits that ${slugs.length === 1 ? "has" : "have"} been deleted in the cloud: ${slugs.map((s3) => import_picocolors26.default.bold(s3)).join(", ")}. ${import_picocolors26.default.dim("Push to restore, or remove from the manifest to accept the deletion.")}`);
|
|
65111
|
+
}
|
|
65112
|
+
}),
|
|
64990
65113
|
capabilities: {
|
|
64991
65114
|
memory: caps.memory,
|
|
64992
65115
|
browser: caps.browser,
|
|
@@ -65172,6 +65295,30 @@ function handleApiError2(err) {
|
|
|
65172
65295
|
// src/cli/agent-push.ts
|
|
65173
65296
|
var import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
65174
65297
|
|
|
65298
|
+
// src/core/eval-reconcile.ts
|
|
65299
|
+
function manifestClaimsEvals(manifest) {
|
|
65300
|
+
return (manifest.evals ?? []).length > 0;
|
|
65301
|
+
}
|
|
65302
|
+
function decideEvalReconcile(input) {
|
|
65303
|
+
const evalRows = input.rows.filter((r2) => r2.type === "eval");
|
|
65304
|
+
const unseen = evalRows.filter((r2) => r2.status === "added-cloud").map((r2) => r2.slug).sort();
|
|
65305
|
+
const cloudModified = evalRows.filter((r2) => r2.status === "modified-cloud" || r2.status === "modified-both" || r2.status === "added-local" && r2.localHash !== undefined && r2.cloudHash !== undefined && r2.localHash !== r2.cloudHash).map((r2) => r2.slug).sort();
|
|
65306
|
+
const archives = evalRows.filter((r2) => r2.status === "removed-local").map((r2) => r2.slug).sort();
|
|
65307
|
+
if (!input.claimsEvals && archives.length === 0) {
|
|
65308
|
+
if (unseen.length > 0 || cloudModified.length > 0) {
|
|
65309
|
+
return { kind: "skip", unseen: [...unseen, ...cloudModified].sort() };
|
|
65310
|
+
}
|
|
65311
|
+
return { kind: "reconcile", archives: [] };
|
|
65312
|
+
}
|
|
65313
|
+
if (input.force) {
|
|
65314
|
+
return { kind: "reconcile", archives: [...archives, ...unseen].sort() };
|
|
65315
|
+
}
|
|
65316
|
+
if (unseen.length === 0 && cloudModified.length === 0) {
|
|
65317
|
+
return { kind: "reconcile", archives };
|
|
65318
|
+
}
|
|
65319
|
+
return { kind: "blocked", unseen, cloudModified, archives };
|
|
65320
|
+
}
|
|
65321
|
+
|
|
65175
65322
|
// src/core/agent-outgoing.ts
|
|
65176
65323
|
var import_picocolors27 = __toESM(require_picocolors(), 1);
|
|
65177
65324
|
async function buildOutgoingComponents(cwd2, manifest, cloud, resolvedVersions) {
|
|
@@ -65274,6 +65421,18 @@ async function buildOutgoingComponents(cwd2, manifest, cloud, resolvedVersions)
|
|
|
65274
65421
|
}
|
|
65275
65422
|
});
|
|
65276
65423
|
}
|
|
65424
|
+
for (const entry of manifest.evals ?? []) {
|
|
65425
|
+
out.push({
|
|
65426
|
+
type: "eval",
|
|
65427
|
+
slug: entry.slug,
|
|
65428
|
+
hash: hashEvalEntry(entry),
|
|
65429
|
+
files: [],
|
|
65430
|
+
meta: {
|
|
65431
|
+
eval: evalWirePayload(entry),
|
|
65432
|
+
...entry.id ? { eval_id: entry.id } : {}
|
|
65433
|
+
}
|
|
65434
|
+
});
|
|
65435
|
+
}
|
|
65277
65436
|
for (const entry of manifest.mcp ?? []) {
|
|
65278
65437
|
if (!entry.url && !entry.command) {
|
|
65279
65438
|
f2.error(`MCP ${import_picocolors27.default.bold(entry.name)} needs either ${import_picocolors27.default.cyan("url")} or ${import_picocolors27.default.cyan("command")}.`);
|
|
@@ -65535,12 +65694,33 @@ async function runAgentPush(cwd2, args) {
|
|
|
65535
65694
|
}
|
|
65536
65695
|
const entrypointChanged = resolvedEntrypoint !== undefined && (resolvedEntrypoint ?? "").trim() !== (lock?.agentMeta?.entrypoint ?? "").trim();
|
|
65537
65696
|
for (const r2 of rows) {
|
|
65538
|
-
if (r2.type !== "instruction" && r2.type !== "skill" && r2.type !== "mcp" && r2.type !== "playbook") {
|
|
65539
|
-
f2.error(`Component ${fmtType(r2.type)} ${import_picocolors28.default.bold(r2.slug)} can't be pushed yet — the server accepts instructions, skills, and
|
|
65697
|
+
if (r2.type !== "instruction" && r2.type !== "skill" && r2.type !== "mcp" && r2.type !== "playbook" && r2.type !== "eval") {
|
|
65698
|
+
f2.error(`Component ${fmtType(r2.type)} ${import_picocolors28.default.bold(r2.slug)} can't be pushed yet — the server accepts instructions, skills, mcps, playbooks, and evals in this version.`);
|
|
65540
65699
|
process.exitCode = 1;
|
|
65541
65700
|
return;
|
|
65542
65701
|
}
|
|
65543
65702
|
}
|
|
65703
|
+
const evalDecision = decideEvalReconcile({
|
|
65704
|
+
rows,
|
|
65705
|
+
claimsEvals: manifestClaimsEvals(manifest),
|
|
65706
|
+
force: !!args.force
|
|
65707
|
+
});
|
|
65708
|
+
if (evalDecision.kind === "blocked") {
|
|
65709
|
+
const { unseen, cloudModified } = evalDecision;
|
|
65710
|
+
f2.error(unseen.length > 0 ? "Cannot push: the cloud has eval changes this folder has never seen." : "Cannot push: evals changed both locally and in the cloud.");
|
|
65711
|
+
for (const slug of unseen) {
|
|
65712
|
+
console.error(` ${import_picocolors28.default.red("!")} ${fmtType("eval")} ${import_picocolors28.default.bold(slug)} ${import_picocolors28.default.dim("(only in the cloud — pushing would archive it)")}`);
|
|
65713
|
+
}
|
|
65714
|
+
for (const slug of cloudModified) {
|
|
65715
|
+
console.error(` ${import_picocolors28.default.red("!")} ${fmtType("eval")} ${import_picocolors28.default.bold(slug)} ${import_picocolors28.default.dim("(edited in the cloud — pushing would overwrite that edit)")}`);
|
|
65716
|
+
}
|
|
65717
|
+
f2.info(`Run ${import_picocolors28.default.cyan("brainbase agent pull")} to bring ${unseen.length + cloudModified.length === 1 ? "it" : "them"} into ${import_picocolors28.default.bold("brainbase.agent.yaml")}, then push — or ${import_picocolors28.default.cyan("brainbase agent push --force")} to make your local evals authoritative and archive the rest.`);
|
|
65718
|
+
process.exitCode = 1;
|
|
65719
|
+
return;
|
|
65720
|
+
}
|
|
65721
|
+
if (evalDecision.kind === "skip") {
|
|
65722
|
+
f2.warn(`${evalDecision.unseen.length} cloud eval${evalDecision.unseen.length === 1 ? "" : "s"} (${evalDecision.unseen.map((s3) => import_picocolors28.default.bold(s3)).join(", ")}) ${evalDecision.unseen.length === 1 ? "is" : "are"} not in ${import_picocolors28.default.bold("brainbase.agent.yaml")} and will be left untouched. Run ${import_picocolors28.default.cyan("brainbase agent pull")} to manage ${evalDecision.unseen.length === 1 ? "it" : "them"} from here.`);
|
|
65723
|
+
}
|
|
65544
65724
|
for (const entry of manifest.skills) {
|
|
65545
65725
|
let parsed;
|
|
65546
65726
|
try {
|
|
@@ -65691,14 +65871,28 @@ async function runAgentPush(cwd2, args) {
|
|
|
65691
65871
|
text: secretDiffSummary(secretPlan.diff)
|
|
65692
65872
|
});
|
|
65693
65873
|
}
|
|
65874
|
+
const evalArchives = evalDecision.kind === "reconcile" ? evalDecision.archives : [];
|
|
65875
|
+
if (evalArchives.length) {
|
|
65876
|
+
resultRows.push({
|
|
65877
|
+
type: "rem",
|
|
65878
|
+
label: "archive evals",
|
|
65879
|
+
text: `${evalArchives.length} · ${evalArchives.join(", ")}`
|
|
65880
|
+
});
|
|
65881
|
+
}
|
|
65694
65882
|
await showResultCard({
|
|
65695
65883
|
title: "PUSH",
|
|
65696
65884
|
tone: "info",
|
|
65697
65885
|
subtitle: `${manifest.agent.name} ← local`,
|
|
65698
65886
|
rows: resultRows
|
|
65699
65887
|
});
|
|
65888
|
+
if (evalArchives.length) {
|
|
65889
|
+
f2.warn(`${evalArchives.length} cloud eval${evalArchives.length === 1 ? "" : "s"} ${evalArchives.length === 1 ? "is" : "are"} missing from ${import_picocolors28.default.bold("brainbase.agent.yaml")} and will be archived: ${evalArchives.map((s3) => import_picocolors28.default.bold(s3)).join(", ")}. ${import_picocolors28.default.dim("Archived, not deleted — past verdicts are kept, and re-adding the eval restores it.")}`);
|
|
65890
|
+
}
|
|
65700
65891
|
if (!autoProceed(args.yes)) {
|
|
65701
|
-
const ok = await se({
|
|
65892
|
+
const ok = await se({
|
|
65893
|
+
message: evalArchives.length ? `Send these changes, archiving ${evalArchives.length} eval${evalArchives.length === 1 ? "" : "s"}?` : "Send these changes?",
|
|
65894
|
+
initialValue: evalArchives.length === 0
|
|
65895
|
+
});
|
|
65702
65896
|
if (!ensureNotCancelled(ok)) {
|
|
65703
65897
|
$e("Aborted.");
|
|
65704
65898
|
return;
|
|
@@ -65763,10 +65957,13 @@ async function runAgentPush(cwd2, args) {
|
|
|
65763
65957
|
pushSpinner.start("Pushing…");
|
|
65764
65958
|
let updatedCloud;
|
|
65765
65959
|
try {
|
|
65960
|
+
const reconcileEvals = evalDecision.kind !== "skip";
|
|
65961
|
+
const components = reconcileEvals ? outgoing : outgoing.filter((c2) => c2.type !== "eval");
|
|
65766
65962
|
updatedCloud = await api.pushAgentManifest(agentId, {
|
|
65767
|
-
components
|
|
65963
|
+
components,
|
|
65768
65964
|
base_revision: cloud.revision,
|
|
65769
|
-
reconcile_playbooks: true
|
|
65965
|
+
reconcile_playbooks: true,
|
|
65966
|
+
reconcile_evals: reconcileEvals
|
|
65770
65967
|
});
|
|
65771
65968
|
pushSpinner.stop(`Pushed. New revision ${updatedCloud.revision}.`);
|
|
65772
65969
|
} catch (err) {
|
|
@@ -65780,10 +65977,21 @@ async function runAgentPush(cwd2, args) {
|
|
|
65780
65977
|
return handleApiError3(err);
|
|
65781
65978
|
}
|
|
65782
65979
|
const backfill = backfillPlaybookIds(manifest.playbooks ?? [], updatedCloud.components);
|
|
65980
|
+
let manifestChanged = backfill.changed;
|
|
65783
65981
|
if (backfill.changed) {
|
|
65784
65982
|
manifest.playbooks = backfill.playbooks;
|
|
65983
|
+
}
|
|
65984
|
+
const evalBackfill = backfillEvalIds(manifest.evals ?? [], updatedCloud.components);
|
|
65985
|
+
if (evalBackfill.changed) {
|
|
65986
|
+
manifest.evals = evalBackfill.evals;
|
|
65987
|
+
manifestChanged = true;
|
|
65988
|
+
}
|
|
65989
|
+
if (manifestChanged) {
|
|
65785
65990
|
writeManifest(cwd2, manifest);
|
|
65786
65991
|
}
|
|
65992
|
+
for (const warning of updatedCloud.warnings ?? []) {
|
|
65993
|
+
f2.warn(warning);
|
|
65994
|
+
}
|
|
65787
65995
|
const existing = readLink(cwd2);
|
|
65788
65996
|
if (existing) {
|
|
65789
65997
|
writeLink(cwd2, {
|
|
@@ -65797,12 +66005,27 @@ async function runAgentPush(cwd2, args) {
|
|
|
65797
66005
|
if (lc.hash)
|
|
65798
66006
|
localHashByKey.set(`${lc.type}/${lc.slug}`, lc.hash);
|
|
65799
66007
|
}
|
|
66008
|
+
if (evalBackfill.changed) {
|
|
66009
|
+
for (const entry of manifest.evals ?? []) {
|
|
66010
|
+
localHashByKey.set(`eval/${entry.slug}`, hashEvalEntry(entry));
|
|
66011
|
+
}
|
|
66012
|
+
}
|
|
66013
|
+
const lockSource = evalDecision.kind === "skip" ? [
|
|
66014
|
+
...updatedCloud.components.filter((c2) => c2.type !== "eval"),
|
|
66015
|
+
...(lock?.components ?? []).filter((c2) => c2.type === "eval").map((c2) => ({
|
|
66016
|
+
type: c2.type,
|
|
66017
|
+
slug: c2.slug,
|
|
66018
|
+
hash: c2.hash,
|
|
66019
|
+
files: [],
|
|
66020
|
+
meta: undefined
|
|
66021
|
+
}))
|
|
66022
|
+
] : updatedCloud.components;
|
|
65800
66023
|
const newLock = {
|
|
65801
66024
|
schemaVersion: 1,
|
|
65802
66025
|
agent_id: agentId,
|
|
65803
66026
|
revision: updatedCloud.revision,
|
|
65804
66027
|
synced_at: new Date().toISOString(),
|
|
65805
|
-
components:
|
|
66028
|
+
components: lockSource.map((c2) => {
|
|
65806
66029
|
const decl = manifest.skills.find((s3) => {
|
|
65807
66030
|
try {
|
|
65808
66031
|
const parsed = parseSkillSource2(s3.source);
|
|
@@ -66018,6 +66241,17 @@ async function runAgentStatus(cwd2, args = {}) {
|
|
|
66018
66241
|
const secretsDrifted = secretDrift.localOnly.length > 0 || secretDrift.cloudOnly.length > 0 || secretDrift.changed.length > 0;
|
|
66019
66242
|
const everythingInSync = !componentsDrifted && !metaDrifted && !configDrifted && !secretsDrifted;
|
|
66020
66243
|
const unchecked = secretsChecked ? [] : [{ signal: "secrets", reason: secretsUncheckedReason }];
|
|
66244
|
+
const evalPlan = decideEvalReconcile({
|
|
66245
|
+
rows,
|
|
66246
|
+
claimsEvals: manifestClaimsEvals(manifest),
|
|
66247
|
+
force: false
|
|
66248
|
+
});
|
|
66249
|
+
const evalReport = {
|
|
66250
|
+
archive: evalPlan.kind === "reconcile" ? evalPlan.archives : [],
|
|
66251
|
+
unseen: evalPlan.kind === "reconcile" ? [] : evalPlan.unseen,
|
|
66252
|
+
cloudModified: evalPlan.kind === "blocked" ? evalPlan.cloudModified : [],
|
|
66253
|
+
pushBlocked: evalPlan.kind === "blocked"
|
|
66254
|
+
};
|
|
66021
66255
|
if (json) {
|
|
66022
66256
|
emitJson({
|
|
66023
66257
|
linked: true,
|
|
@@ -66046,6 +66280,7 @@ async function runAgentStatus(cwd2, args = {}) {
|
|
|
66046
66280
|
pull: toPull.map(rowJson),
|
|
66047
66281
|
conflicts: conflicts.map(rowJson)
|
|
66048
66282
|
},
|
|
66283
|
+
evals: evalReport,
|
|
66049
66284
|
inSync: everythingInSync,
|
|
66050
66285
|
unchecked
|
|
66051
66286
|
});
|
|
@@ -66149,6 +66384,31 @@ async function runAgentStatus(cwd2, args = {}) {
|
|
|
66149
66384
|
lines.push(` ${import_picocolors29.default.red("!")} ${fmtRow(r2)}`);
|
|
66150
66385
|
lines.push("");
|
|
66151
66386
|
}
|
|
66387
|
+
if (evalReport.archive.length) {
|
|
66388
|
+
lines.push(` ${import_picocolors29.default.bold("evals a push would archive")} ${import_picocolors29.default.dim(`(${evalReport.archive.length})`)}`);
|
|
66389
|
+
for (const slug of evalReport.archive) {
|
|
66390
|
+
lines.push(` ${import_picocolors29.default.yellow("⨯")} ${import_picocolors29.default.bold(slug)} ${import_picocolors29.default.dim("— in the cloud, not in this manifest")}`);
|
|
66391
|
+
}
|
|
66392
|
+
lines.push(` ${import_picocolors29.default.dim("archived, not deleted: past verdicts are kept and re-adding the eval restores it")}`);
|
|
66393
|
+
lines.push("");
|
|
66394
|
+
}
|
|
66395
|
+
if (evalReport.pushBlocked) {
|
|
66396
|
+
lines.push(` ${import_picocolors29.default.bold(import_picocolors29.default.red("evals: push blocked"))}`);
|
|
66397
|
+
for (const slug of evalReport.unseen) {
|
|
66398
|
+
lines.push(` ${import_picocolors29.default.red("!")} ${import_picocolors29.default.bold(slug)} ${import_picocolors29.default.dim("— only in the cloud; pushing would archive it")}`);
|
|
66399
|
+
}
|
|
66400
|
+
for (const slug of evalReport.cloudModified) {
|
|
66401
|
+
lines.push(` ${import_picocolors29.default.red("!")} ${import_picocolors29.default.bold(slug)} ${import_picocolors29.default.dim("— edited in the cloud; pushing would overwrite that edit")}`);
|
|
66402
|
+
}
|
|
66403
|
+
lines.push(` ${import_picocolors29.default.dim("run")} ${import_picocolors29.default.cyan("brainbase agent pull")} ${import_picocolors29.default.dim("first")}`);
|
|
66404
|
+
lines.push("");
|
|
66405
|
+
} else if (evalReport.unseen.length) {
|
|
66406
|
+
lines.push(` ${import_picocolors29.default.bold("evals only in the cloud")} ${import_picocolors29.default.dim(`(${evalReport.unseen.length})`)}`);
|
|
66407
|
+
for (const slug of evalReport.unseen) {
|
|
66408
|
+
lines.push(` ${import_picocolors29.default.cyan("←")} ${import_picocolors29.default.bold(slug)} ${import_picocolors29.default.dim("— left untouched by push; pull to manage it here")}`);
|
|
66409
|
+
}
|
|
66410
|
+
lines.push("");
|
|
66411
|
+
}
|
|
66152
66412
|
lines.push(` ${import_picocolors29.default.dim("run")} ${import_picocolors29.default.cyan("brainbase agent pull")} ${import_picocolors29.default.dim("to apply cloud changes,")} ${import_picocolors29.default.cyan("brainbase agent push")} ${import_picocolors29.default.dim("to send yours")}`);
|
|
66153
66413
|
lines.push("");
|
|
66154
66414
|
console.log(lines.join(`
|
|
@@ -66751,7 +67011,7 @@ async function runAgentCreate(cwd2, args) {
|
|
|
66751
67011
|
writeLink(cwd2, link2);
|
|
66752
67012
|
manifest = readManifest(cwd2);
|
|
66753
67013
|
let updatedCloud = null;
|
|
66754
|
-
const hasContent = !!manifest.instructions || manifest.skills.length > 0 || (manifest.mcp ?? []).length > 0 || (manifest.playbooks ?? []).length > 0;
|
|
67014
|
+
const hasContent = !!manifest.instructions || manifest.skills.length > 0 || (manifest.mcp ?? []).length > 0 || (manifest.playbooks ?? []).length > 0 || (manifest.evals ?? []).length > 0;
|
|
66755
67015
|
if (hasContent) {
|
|
66756
67016
|
const outgoing = await buildOutgoingComponents(cwd2, manifest, null);
|
|
66757
67017
|
if (outgoing === null) {
|
|
@@ -66763,7 +67023,8 @@ async function runAgentCreate(cwd2, args) {
|
|
|
66763
67023
|
updatedCloud = await api.pushAgentManifest(agent.id, {
|
|
66764
67024
|
components: outgoing,
|
|
66765
67025
|
base_revision: 0,
|
|
66766
|
-
reconcile_playbooks: true
|
|
67026
|
+
reconcile_playbooks: true,
|
|
67027
|
+
reconcile_evals: true
|
|
66767
67028
|
});
|
|
66768
67029
|
pushSpinner.stop(`Pushed at revision ${updatedCloud.revision}.`);
|
|
66769
67030
|
} catch (err) {
|
|
@@ -66778,8 +67039,16 @@ async function runAgentCreate(cwd2, args) {
|
|
|
66778
67039
|
}
|
|
66779
67040
|
if (updatedCloud) {
|
|
66780
67041
|
const backfill = backfillPlaybookIds(manifest.playbooks ?? [], updatedCloud.components);
|
|
67042
|
+
let manifestChanged = backfill.changed;
|
|
66781
67043
|
if (backfill.changed) {
|
|
66782
67044
|
manifest.playbooks = backfill.playbooks;
|
|
67045
|
+
}
|
|
67046
|
+
const evalBackfill = backfillEvalIds(manifest.evals ?? [], updatedCloud.components);
|
|
67047
|
+
if (evalBackfill.changed) {
|
|
67048
|
+
manifest.evals = evalBackfill.evals;
|
|
67049
|
+
manifestChanged = true;
|
|
67050
|
+
}
|
|
67051
|
+
if (manifestChanged) {
|
|
66783
67052
|
writeManifest(cwd2, manifest);
|
|
66784
67053
|
}
|
|
66785
67054
|
}
|
|
@@ -67400,10 +67669,170 @@ async function disconnect(cwd2, target, args, json) {
|
|
|
67400
67669
|
f2.info(`Run ${import_picocolors37.default.cyan("brainbase agent pull")} to drop the built-in ${target} MCP server locally.`);
|
|
67401
67670
|
}
|
|
67402
67671
|
|
|
67672
|
+
// src/cli/agent-eval.ts
|
|
67673
|
+
var import_picocolors38 = __toESM(require_picocolors(), 1);
|
|
67674
|
+
async function runAgentEval(cwd2, sub, args) {
|
|
67675
|
+
const json = Boolean(args.json);
|
|
67676
|
+
if (sub !== "list" && sub !== "runs") {
|
|
67677
|
+
if (json) {
|
|
67678
|
+
console.log(JSON.stringify({ error: `unknown subcommand: ${sub ?? "(none)"}`, expected: ["list", "runs"] }, null, 2));
|
|
67679
|
+
} else {
|
|
67680
|
+
console.error(`Unknown eval subcommand: ${sub ?? "(none)"}
|
|
67681
|
+
`);
|
|
67682
|
+
printEvalHelp();
|
|
67683
|
+
}
|
|
67684
|
+
process.exitCode = 1;
|
|
67685
|
+
return;
|
|
67686
|
+
}
|
|
67687
|
+
if (!json) {
|
|
67688
|
+
banner(sub === "list" ? "agent eval list — the evals the cloud holds" : "agent eval runs — judge verdicts, newest first");
|
|
67689
|
+
}
|
|
67690
|
+
const link2 = readLink(cwd2);
|
|
67691
|
+
if (!link2) {
|
|
67692
|
+
if (json) {
|
|
67693
|
+
console.log(JSON.stringify({ linked: false, items: [] }, null, 2));
|
|
67694
|
+
} else {
|
|
67695
|
+
f2.warn("This folder is not linked to any agent.");
|
|
67696
|
+
f2.info(`Run ${import_picocolors38.default.cyan("brainbase link")} first.`);
|
|
67697
|
+
}
|
|
67698
|
+
process.exitCode = 1;
|
|
67699
|
+
return;
|
|
67700
|
+
}
|
|
67701
|
+
try {
|
|
67702
|
+
if (sub === "list") {
|
|
67703
|
+
const evals = await api.listAgentEvals(link2.agent_id, {
|
|
67704
|
+
includeArchived: args.archived
|
|
67705
|
+
});
|
|
67706
|
+
if (json) {
|
|
67707
|
+
console.log(JSON.stringify({ linked: true, items: evals }, null, 2));
|
|
67708
|
+
return;
|
|
67709
|
+
}
|
|
67710
|
+
console.log(formatEvals(evals));
|
|
67711
|
+
return;
|
|
67712
|
+
}
|
|
67713
|
+
const runs = await api.listAgentEvalRuns(link2.agent_id, {
|
|
67714
|
+
taskId: args.taskId,
|
|
67715
|
+
limit: args.limit
|
|
67716
|
+
});
|
|
67717
|
+
if (json) {
|
|
67718
|
+
console.log(JSON.stringify({ linked: true, items: runs }, null, 2));
|
|
67719
|
+
return;
|
|
67720
|
+
}
|
|
67721
|
+
console.log(formatRuns(runs));
|
|
67722
|
+
} catch (err) {
|
|
67723
|
+
if (err instanceof ApiError && err.status === 404) {
|
|
67724
|
+
const detail = (err.message || "").trim();
|
|
67725
|
+
const looksLikeAccess = /agent not found/i.test(detail);
|
|
67726
|
+
const message2 = looksLikeAccess ? `${detail} — check that this folder is linked to an agent you can access (${import_picocolors38.default.cyan("brainbase agent status")}).` : `${detail || "Not found"} — this control plane may not expose eval reads yet; upgrade the server, or use the web app.`;
|
|
67727
|
+
if (json) {
|
|
67728
|
+
console.log(JSON.stringify({ linked: true, error: message2, detail, items: [] }, null, 2));
|
|
67729
|
+
} else {
|
|
67730
|
+
f2.error(message2);
|
|
67731
|
+
}
|
|
67732
|
+
process.exitCode = 1;
|
|
67733
|
+
return;
|
|
67734
|
+
}
|
|
67735
|
+
if (!json)
|
|
67736
|
+
throw err;
|
|
67737
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
67738
|
+
console.log(JSON.stringify({ linked: true, error: message, items: [] }, null, 2));
|
|
67739
|
+
process.exitCode = 1;
|
|
67740
|
+
}
|
|
67741
|
+
}
|
|
67742
|
+
function formatEvals(evals) {
|
|
67743
|
+
if (evals.length === 0) {
|
|
67744
|
+
return `
|
|
67745
|
+
${import_picocolors38.default.dim("No evals on this agent.")}
|
|
67746
|
+
${import_picocolors38.default.dim("Add an")} ${import_picocolors38.default.cyan("evals:")} ${import_picocolors38.default.dim("block to brainbase.agent.yaml and run")} ${import_picocolors38.default.cyan("brainbase agent push")}${import_picocolors38.default.dim(".")}
|
|
67747
|
+
`;
|
|
67748
|
+
}
|
|
67749
|
+
const lines = [""];
|
|
67750
|
+
for (const e2 of evals) {
|
|
67751
|
+
const archived = e2.status === "archived";
|
|
67752
|
+
const state = archived ? import_picocolors38.default.dim("⊘") : e2.enabled ? import_picocolors38.default.green("✓") : import_picocolors38.default.dim("·");
|
|
67753
|
+
const judge = e2.judge_type === "agent" ? `agent ${e2.judge_agent ?? import_picocolors38.default.red("(missing)")}` : e2.judge_model;
|
|
67754
|
+
const shape = e2.output_shape === "classification" && e2.classification_values?.length ? `classification (${e2.classification_values.join(" | ")})` : e2.output_shape;
|
|
67755
|
+
lines.push(` ${state} ${import_picocolors38.default.bold(e2.slug)}${archived ? import_picocolors38.default.dim(" (archived)") : ""} ${import_picocolors38.default.dim(shape)} ${import_picocolors38.default.dim("·")} ${import_picocolors38.default.dim(judge)}`);
|
|
67756
|
+
lines.push(` ${e2.criteria}`);
|
|
67757
|
+
if (archived) {
|
|
67758
|
+
lines.push(` ${import_picocolors38.default.dim("archived — not scored; re-add the slug to the manifest and push to restore it")}`);
|
|
67759
|
+
} else if (!e2.enabled) {
|
|
67760
|
+
lines.push(` ${import_picocolors38.default.dim("disabled — not scored")}`);
|
|
67761
|
+
}
|
|
67762
|
+
}
|
|
67763
|
+
lines.push("");
|
|
67764
|
+
return lines.join(`
|
|
67765
|
+
`);
|
|
67766
|
+
}
|
|
67767
|
+
function formatRuns(runs) {
|
|
67768
|
+
if (runs.length === 0) {
|
|
67769
|
+
return `
|
|
67770
|
+
${import_picocolors38.default.dim("No eval runs yet. Evals are scored as the agent finishes a turn.")}
|
|
67771
|
+
`;
|
|
67772
|
+
}
|
|
67773
|
+
const lines = [""];
|
|
67774
|
+
for (const r2 of runs) {
|
|
67775
|
+
lines.push(` ${verdictMark(r2)} ${import_picocolors38.default.bold(r2.eval_slug ?? r2.eval_id)} ${import_picocolors38.default.dim(verdictText(r2))}`);
|
|
67776
|
+
lines.push(` ${import_picocolors38.default.dim("task")} ${r2.task_id}${r2.created_at ? ` ${import_picocolors38.default.dim("·")} ${import_picocolors38.default.dim(r2.created_at)}` : ""}`);
|
|
67777
|
+
if (r2.reasoning)
|
|
67778
|
+
lines.push(` ${r2.reasoning}`);
|
|
67779
|
+
if (r2.error)
|
|
67780
|
+
lines.push(` ${import_picocolors38.default.red(r2.error)}`);
|
|
67781
|
+
if (r2.judge_task_id) {
|
|
67782
|
+
lines.push(` ${import_picocolors38.default.dim(`judge run: ${r2.judge_task_id}`)}`);
|
|
67783
|
+
}
|
|
67784
|
+
}
|
|
67785
|
+
lines.push("");
|
|
67786
|
+
return lines.join(`
|
|
67787
|
+
`);
|
|
67788
|
+
}
|
|
67789
|
+
function verdictMark(r2) {
|
|
67790
|
+
if (r2.status === "errored")
|
|
67791
|
+
return import_picocolors38.default.yellow("!");
|
|
67792
|
+
if (r2.passed === true)
|
|
67793
|
+
return import_picocolors38.default.green("✓");
|
|
67794
|
+
if (r2.passed === false)
|
|
67795
|
+
return import_picocolors38.default.red("✗");
|
|
67796
|
+
if (typeof r2.rating === "number")
|
|
67797
|
+
return r2.rating >= 4 ? import_picocolors38.default.green("✓") : import_picocolors38.default.yellow("~");
|
|
67798
|
+
if (r2.category)
|
|
67799
|
+
return import_picocolors38.default.cyan("•");
|
|
67800
|
+
return import_picocolors38.default.dim("·");
|
|
67801
|
+
}
|
|
67802
|
+
function verdictText(r2) {
|
|
67803
|
+
if (r2.status === "errored")
|
|
67804
|
+
return "judge errored";
|
|
67805
|
+
if (r2.passed === true)
|
|
67806
|
+
return "passed";
|
|
67807
|
+
if (r2.passed === false)
|
|
67808
|
+
return "failed";
|
|
67809
|
+
if (typeof r2.rating === "number")
|
|
67810
|
+
return `${r2.rating}/5`;
|
|
67811
|
+
if (r2.category)
|
|
67812
|
+
return r2.category;
|
|
67813
|
+
return r2.status;
|
|
67814
|
+
}
|
|
67815
|
+
function printEvalHelp() {
|
|
67816
|
+
const out = [""];
|
|
67817
|
+
out.push(` ${import_picocolors38.default.bold("brainbase agent eval")} ${import_picocolors38.default.dim("<sub> [options]")}`);
|
|
67818
|
+
out.push("");
|
|
67819
|
+
out.push(` ${import_picocolors38.default.cyan("list")} ${import_picocolors38.default.dim("the evals the cloud holds for this agent (--archived to include archived, --json for scripts)")}`);
|
|
67820
|
+
out.push(` ${import_picocolors38.default.cyan("runs")} ${import_picocolors38.default.dim("judge verdicts, newest first (--task-id <id>, --limit <n>, --json for scripts)")}`);
|
|
67821
|
+
out.push("");
|
|
67822
|
+
out.push(` ${import_picocolors38.default.dim("Eval definitions are declarative: edit the")} ${import_picocolors38.default.cyan("evals:")} ${import_picocolors38.default.dim("block in brainbase.agent.yaml")}`);
|
|
67823
|
+
out.push(` ${import_picocolors38.default.dim("and run")} ${import_picocolors38.default.cyan("brainbase agent push")}${import_picocolors38.default.dim(". These commands read; they do not write.")}`);
|
|
67824
|
+
out.push("");
|
|
67825
|
+
console.log(out.join(`
|
|
67826
|
+
`));
|
|
67827
|
+
}
|
|
67828
|
+
|
|
67403
67829
|
// src/cli/agent.ts
|
|
67404
67830
|
async function runAgent(cwd2, sub, args, opts) {
|
|
67405
67831
|
if (args.some((arg) => arg === "--help" || arg === "-h")) {
|
|
67406
|
-
|
|
67832
|
+
if (sub === "eval")
|
|
67833
|
+
printEvalHelp();
|
|
67834
|
+
else
|
|
67835
|
+
printHelp();
|
|
67407
67836
|
return;
|
|
67408
67837
|
}
|
|
67409
67838
|
switch (sub) {
|
|
@@ -67478,6 +67907,14 @@ async function runAgent(cwd2, sub, args, opts) {
|
|
|
67478
67907
|
case "disconnect":
|
|
67479
67908
|
await runAgentDisconnect(cwd2, args[0], { yes: opts.yes, json: opts.json });
|
|
67480
67909
|
return;
|
|
67910
|
+
case "eval":
|
|
67911
|
+
await runAgentEval(cwd2, args[0], {
|
|
67912
|
+
json: opts.json,
|
|
67913
|
+
taskId: opts.taskId,
|
|
67914
|
+
limit: opts.limit,
|
|
67915
|
+
archived: opts.archived
|
|
67916
|
+
});
|
|
67917
|
+
return;
|
|
67481
67918
|
case "env":
|
|
67482
67919
|
await runAgentEnv(cwd2, { shell: opts.shell });
|
|
67483
67920
|
return;
|
|
@@ -67497,32 +67934,33 @@ async function runAgent(cwd2, sub, args, opts) {
|
|
|
67497
67934
|
function printHelp() {
|
|
67498
67935
|
const out = [];
|
|
67499
67936
|
out.push("");
|
|
67500
|
-
out.push(` ${
|
|
67937
|
+
out.push(` ${import_picocolors39.default.bold("brainbase agent")} ${import_picocolors39.default.dim("<sub> [options]")}`);
|
|
67501
67938
|
out.push("");
|
|
67502
|
-
out.push(` ${
|
|
67503
|
-
out.push(` ${
|
|
67504
|
-
out.push(` ${
|
|
67505
|
-
out.push(` ${
|
|
67506
|
-
out.push(` ${
|
|
67507
|
-
out.push(` ${
|
|
67508
|
-
out.push(` ${
|
|
67509
|
-
out.push(` ${
|
|
67510
|
-
out.push(` ${
|
|
67511
|
-
out.push(` ${
|
|
67512
|
-
out.push(` ${
|
|
67939
|
+
out.push(` ${import_picocolors39.default.cyan("list")} ${import_picocolors39.default.dim("show the agents in a team, with the ids `brainbase link` takes (--json for scripts)")}`);
|
|
67940
|
+
out.push(` ${import_picocolors39.default.cyan("init")} ${import_picocolors39.default.dim("write a starter brainbase.agent.yaml here — offline, no login (--full for a commented template, --force to overwrite)")}`);
|
|
67941
|
+
out.push(` ${import_picocolors39.default.cyan("create")} ${import_picocolors39.default.dim("claim an unclaimed brainbase.agent.yaml and create the cloud agent (scaffolds one if the folder has none)")}`);
|
|
67942
|
+
out.push(` ${import_picocolors39.default.cyan("pull")} ${import_picocolors39.default.dim("[<id>]")} ${import_picocolors39.default.dim("apply cloud changes into this folder — pass <id> to switch (--force to override); --run-entrypoint to also execute the agent entrypoint")}`);
|
|
67943
|
+
out.push(` ${import_picocolors39.default.cyan("push")} ${import_picocolors39.default.dim("send local changes to the cloud — instructions, playbooks, skills, MCPs, evals, entrypoint (--force to overwrite cloud-side conflicts with local)")}`);
|
|
67944
|
+
out.push(` ${import_picocolors39.default.cyan("unpack")} ${import_picocolors39.default.dim("install the claimed agent into a harness layout (--harness to override)")}`);
|
|
67945
|
+
out.push(` ${import_picocolors39.default.cyan("status")} ${import_picocolors39.default.dim("show what would push, what would pull, and which manifest blocks are ignored (--json for scripts)")}`);
|
|
67946
|
+
out.push(` ${import_picocolors39.default.cyan("connections")} ${import_picocolors39.default.dim("show which integrations this agent is wired to (--json for scripts)")}`);
|
|
67947
|
+
out.push(` ${import_picocolors39.default.cyan("connect")} ${import_picocolors39.default.dim("<name>")} ${import_picocolors39.default.dim("connect slack or meeting — credentials come from flags, env, or stdin")}`);
|
|
67948
|
+
out.push(` ${import_picocolors39.default.cyan("disconnect")} ${import_picocolors39.default.dim("<name>")} ${import_picocolors39.default.dim("revoke a slack or meeting install")}`);
|
|
67949
|
+
out.push(` ${import_picocolors39.default.cyan("eval")} ${import_picocolors39.default.dim("<list|runs>")} ${import_picocolors39.default.dim("read eval definitions and judge verdicts — definitions are edited in the manifest and pushed (--json for scripts)")}`);
|
|
67950
|
+
out.push(` ${import_picocolors39.default.cyan("env")} ${import_picocolors39.default.dim('print export statements — use with `eval "$(brainbase agent env)"`')}`);
|
|
67513
67951
|
out.push("");
|
|
67514
|
-
out.push(` ${
|
|
67515
|
-
out.push(` ${
|
|
67952
|
+
out.push(` ${import_picocolors39.default.dim("Slack credentials:")} ${import_picocolors39.default.dim("--bot-token / BRAINBASE_SLACK_BOT_TOKEN, --signing-secret / BRAINBASE_SLACK_SIGNING_SECRET,")}`);
|
|
67953
|
+
out.push(` ${import_picocolors39.default.dim('or pipe {"bot_token":"…","signing_secret":"…"} on stdin to keep them out of argv.')}`);
|
|
67516
67954
|
out.push("");
|
|
67517
67955
|
console.log(out.join(`
|
|
67518
67956
|
`));
|
|
67519
67957
|
}
|
|
67520
67958
|
|
|
67521
67959
|
// src/cli/team.ts
|
|
67522
|
-
var
|
|
67960
|
+
var import_picocolors41 = __toESM(require_picocolors(), 1);
|
|
67523
67961
|
|
|
67524
67962
|
// src/cli/team-list.ts
|
|
67525
|
-
var
|
|
67963
|
+
var import_picocolors40 = __toESM(require_picocolors(), 1);
|
|
67526
67964
|
async function runTeamList(args) {
|
|
67527
67965
|
if (!args.json)
|
|
67528
67966
|
banner("team list — teams you can put agents in");
|
|
@@ -67542,25 +67980,25 @@ async function runTeamList(args) {
|
|
|
67542
67980
|
function formatTeamList(grouped) {
|
|
67543
67981
|
const lines = [""];
|
|
67544
67982
|
if (grouped.length === 0) {
|
|
67545
|
-
lines.push(` ${
|
|
67983
|
+
lines.push(` ${import_picocolors40.default.dim("You are not a member of any organization.")}`, "");
|
|
67546
67984
|
return lines.join(`
|
|
67547
67985
|
`);
|
|
67548
67986
|
}
|
|
67549
67987
|
const nameWidth = Math.max(...grouped.flatMap(({ teams }) => teams.map((t) => t.name.length)), 0);
|
|
67550
67988
|
for (const { org, teams, error } of grouped) {
|
|
67551
|
-
const slug = org.slug ? ` ${
|
|
67552
|
-
lines.push(` ${
|
|
67989
|
+
const slug = org.slug ? ` ${import_picocolors40.default.dim(org.slug)}` : "";
|
|
67990
|
+
lines.push(` ${import_picocolors40.default.bold(org.name)}${slug}`);
|
|
67553
67991
|
if (error) {
|
|
67554
|
-
lines.push(` ${
|
|
67992
|
+
lines.push(` ${import_picocolors40.default.red(`could not load teams: ${error}`)}`);
|
|
67555
67993
|
} else if (teams.length === 0) {
|
|
67556
|
-
lines.push(` ${
|
|
67994
|
+
lines.push(` ${import_picocolors40.default.dim("no teams yet — create one in the web app")}`);
|
|
67557
67995
|
}
|
|
67558
67996
|
for (const team of teams) {
|
|
67559
|
-
lines.push(` ${team.name.padEnd(nameWidth)} ${
|
|
67997
|
+
lines.push(` ${team.name.padEnd(nameWidth)} ${import_picocolors40.default.dim(team.id)}`);
|
|
67560
67998
|
}
|
|
67561
67999
|
lines.push("");
|
|
67562
68000
|
}
|
|
67563
|
-
lines.push(` ${
|
|
68001
|
+
lines.push(` ${import_picocolors40.default.dim("list a team’s agents with")} ${import_picocolors40.default.cyan("brainbase agent list --team <id>")}`, "");
|
|
67564
68002
|
return lines.join(`
|
|
67565
68003
|
`);
|
|
67566
68004
|
}
|
|
@@ -67591,24 +68029,24 @@ async function runTeam(sub, args, opts) {
|
|
|
67591
68029
|
function printHelp2() {
|
|
67592
68030
|
const out = [];
|
|
67593
68031
|
out.push("");
|
|
67594
|
-
out.push(` ${
|
|
68032
|
+
out.push(` ${import_picocolors41.default.bold("brainbase team")} ${import_picocolors41.default.dim("<sub> [options]")}`);
|
|
67595
68033
|
out.push("");
|
|
67596
|
-
out.push(` ${
|
|
68034
|
+
out.push(` ${import_picocolors41.default.cyan("list")} ${import_picocolors41.default.dim("show the teams you can create agents in, grouped by organization")}`);
|
|
67597
68035
|
out.push("");
|
|
67598
|
-
out.push(` ${
|
|
67599
|
-
out.push(` ${
|
|
68036
|
+
out.push(` ${import_picocolors41.default.dim("--org <id-or-slug>")} ${import_picocolors41.default.dim("limit to one organization")}`);
|
|
68037
|
+
out.push(` ${import_picocolors41.default.dim("--json")} ${import_picocolors41.default.dim("machine-readable output")}`);
|
|
67600
68038
|
out.push("");
|
|
67601
68039
|
console.log(out.join(`
|
|
67602
68040
|
`));
|
|
67603
68041
|
}
|
|
67604
68042
|
|
|
67605
68043
|
// src/cli/orchestration.ts
|
|
67606
|
-
var
|
|
68044
|
+
var import_picocolors48 = __toESM(require_picocolors(), 1);
|
|
67607
68045
|
|
|
67608
68046
|
// src/cli/orchestration-pull.ts
|
|
67609
68047
|
import path87 from "node:path";
|
|
67610
68048
|
import fs78 from "node:fs";
|
|
67611
|
-
var
|
|
68049
|
+
var import_picocolors42 = __toESM(require_picocolors(), 1);
|
|
67612
68050
|
|
|
67613
68051
|
// src/core/orchestration-manifest.ts
|
|
67614
68052
|
import path84 from "node:path";
|
|
@@ -68036,8 +68474,13 @@ function buildManifestFromCloud(cloud, agent, localOnly = {}) {
|
|
|
68036
68474
|
},
|
|
68037
68475
|
...hasInstructions ? { instructions: { file: DEFAULT_INSTRUCTIONS_FILE } } : {},
|
|
68038
68476
|
playbooks,
|
|
68039
|
-
evals: localOnly.evals ?? [],
|
|
68040
68477
|
...localOnly,
|
|
68478
|
+
evals: mergeEvals({
|
|
68479
|
+
cloud: evalsFromCloudComponents(cloud.components),
|
|
68480
|
+
local: localOnly.evals ?? [],
|
|
68481
|
+
syncedEvalHashes: new Map,
|
|
68482
|
+
keepLocalEvalSlugs: new Set
|
|
68483
|
+
}),
|
|
68041
68484
|
skills,
|
|
68042
68485
|
mcp,
|
|
68043
68486
|
capabilities: {
|
|
@@ -68129,8 +68572,8 @@ async function runOrchestrationPull(cwd2, args) {
|
|
|
68129
68572
|
orchId = args.orchestrationId;
|
|
68130
68573
|
} else {
|
|
68131
68574
|
f2.warn("This folder is not linked to any orchestration.");
|
|
68132
|
-
f2.info(`Run ${
|
|
68133
|
-
or ${
|
|
68575
|
+
f2.info(`Run ${import_picocolors42.default.cyan("brainbase orchestration pull <id>")} with an orchestration id,
|
|
68576
|
+
or ${import_picocolors42.default.cyan("brainbase orchestration list")} to find one.`);
|
|
68134
68577
|
return;
|
|
68135
68578
|
}
|
|
68136
68579
|
const sp = de();
|
|
@@ -68149,24 +68592,24 @@ async function runOrchestrationPull(cwd2, args) {
|
|
|
68149
68592
|
const slugFor = (agentId) => slugByAgent.get(agentId) ?? agentId;
|
|
68150
68593
|
const planLines = [];
|
|
68151
68594
|
planLines.push("");
|
|
68152
|
-
planLines.push(` ${
|
|
68595
|
+
planLines.push(` ${import_picocolors42.default.bold(cloud.name)} ${import_picocolors42.default.dim(`(${cloud.id})`)}`);
|
|
68153
68596
|
if (cloud.description)
|
|
68154
|
-
planLines.push(` ${
|
|
68597
|
+
planLines.push(` ${import_picocolors42.default.dim(cloud.description)}`);
|
|
68155
68598
|
planLines.push("");
|
|
68156
|
-
planLines.push(` ${
|
|
68599
|
+
planLines.push(` ${import_picocolors42.default.dim("members:")}`);
|
|
68157
68600
|
for (const m3 of cloud.members) {
|
|
68158
68601
|
const skipped = !m3.manifest;
|
|
68159
|
-
const tail2 = skipped ?
|
|
68160
|
-
planLines.push(` ${
|
|
68602
|
+
const tail2 = skipped ? import_picocolors42.default.red(" (manifest unavailable — skipped)") : "";
|
|
68603
|
+
planLines.push(` ${import_picocolors42.default.cyan("•")} ${import_picocolors42.default.bold(slugFor(m3.agent_id))} ${import_picocolors42.default.dim(`(${m3.name})`)}${tail2}`);
|
|
68161
68604
|
}
|
|
68162
68605
|
if (cloud.edges.length) {
|
|
68163
68606
|
planLines.push("");
|
|
68164
|
-
planLines.push(` ${
|
|
68607
|
+
planLines.push(` ${import_picocolors42.default.dim("edges:")}`);
|
|
68165
68608
|
for (const e2 of cloud.edges) {
|
|
68166
68609
|
const from = slugFor(e2.from_agent_id);
|
|
68167
68610
|
const to2 = slugFor(e2.to_agent_id);
|
|
68168
|
-
const desc = e2.description ? ` ${
|
|
68169
|
-
planLines.push(` ${
|
|
68611
|
+
const desc = e2.description ? ` ${import_picocolors42.default.dim("— " + e2.description)}` : "";
|
|
68612
|
+
planLines.push(` ${import_picocolors42.default.cyan(from)} ${import_picocolors42.default.dim("→")} ${import_picocolors42.default.cyan(to2)}${desc}`);
|
|
68170
68613
|
}
|
|
68171
68614
|
}
|
|
68172
68615
|
planLines.push("");
|
|
@@ -68175,7 +68618,7 @@ async function runOrchestrationPull(cwd2, args) {
|
|
|
68175
68618
|
const isRefresh = !!existingLink;
|
|
68176
68619
|
if (!autoProceed(args.yes) && !isRefresh) {
|
|
68177
68620
|
const ok = await se({
|
|
68178
|
-
message: `Pull into ${
|
|
68621
|
+
message: `Pull into ${import_picocolors42.default.bold(cwd2)}?`,
|
|
68179
68622
|
initialValue: true
|
|
68180
68623
|
});
|
|
68181
68624
|
if (!ensureNotCancelled(ok)) {
|
|
@@ -68219,7 +68662,7 @@ async function runOrchestrationPull(cwd2, args) {
|
|
|
68219
68662
|
scope: "project",
|
|
68220
68663
|
pullSecrets: true
|
|
68221
68664
|
});
|
|
68222
|
-
memberSp.stop(`Installed ${
|
|
68665
|
+
memberSp.stop(`Installed ${import_picocolors42.default.bold(slug)} ${import_picocolors42.default.dim(`(${m3.manifest.components.length} components)`)}.`);
|
|
68223
68666
|
installedMembers.push({
|
|
68224
68667
|
agent_id: m3.agent_id,
|
|
68225
68668
|
slug,
|
|
@@ -68280,7 +68723,7 @@ async function runOrchestrationPull(cwd2, args) {
|
|
|
68280
68723
|
payload_schema: e2.payload_schema ?? {}
|
|
68281
68724
|
}))
|
|
68282
68725
|
});
|
|
68283
|
-
$e(`Pulled ${cloud.name} at revision ${cloud.revision} into ${path87.basename(cwd2)}/ ${
|
|
68726
|
+
$e(`Pulled ${cloud.name} at revision ${cloud.revision} into ${path87.basename(cwd2)}/ ${import_picocolors42.default.dim(`(${installedMembers.length}/${cloud.members.length} members)`)}.`);
|
|
68284
68727
|
}
|
|
68285
68728
|
function handleApiError5(err) {
|
|
68286
68729
|
if (err instanceof ApiError) {
|
|
@@ -68297,7 +68740,7 @@ function handleApiError5(err) {
|
|
|
68297
68740
|
}
|
|
68298
68741
|
|
|
68299
68742
|
// src/cli/orchestration-push.ts
|
|
68300
|
-
var
|
|
68743
|
+
var import_picocolors43 = __toESM(require_picocolors(), 1);
|
|
68301
68744
|
|
|
68302
68745
|
// src/core/orchestration-outgoing.ts
|
|
68303
68746
|
function buildOrchestrationGraphPayload(manifest, slugToAgentId) {
|
|
@@ -68380,7 +68823,7 @@ function findUnpushableMembers(cwd2, members) {
|
|
|
68380
68823
|
continue;
|
|
68381
68824
|
}
|
|
68382
68825
|
if (!memberManifest.id) {
|
|
68383
|
-
f2.error(`${m3.slug}: ${AGENT_MANIFEST_FILE} is unclaimed (no ${
|
|
68826
|
+
f2.error(`${m3.slug}: ${AGENT_MANIFEST_FILE} is unclaimed (no ${import_picocolors43.default.cyan("id")}), so there is nothing to push to.`);
|
|
68384
68827
|
blocked.push(m3.slug);
|
|
68385
68828
|
continue;
|
|
68386
68829
|
}
|
|
@@ -68395,12 +68838,12 @@ async function runOrchestrationPush(cwd2, args) {
|
|
|
68395
68838
|
const link2 = readOrchLink(cwd2);
|
|
68396
68839
|
if (!link2) {
|
|
68397
68840
|
f2.warn("This folder is not linked to any orchestration.");
|
|
68398
|
-
f2.info(`Run ${
|
|
68841
|
+
f2.info(`Run ${import_picocolors43.default.cyan("brainbase orchestration pull <id>")} first.`);
|
|
68399
68842
|
return;
|
|
68400
68843
|
}
|
|
68401
68844
|
if (!hasOrchManifest(cwd2)) {
|
|
68402
|
-
f2.warn(`No ${
|
|
68403
|
-
f2.info(`Run ${
|
|
68845
|
+
f2.warn(`No ${import_picocolors43.default.bold(ORCH_MANIFEST_FILE)} here.`);
|
|
68846
|
+
f2.info(`Run ${import_picocolors43.default.cyan("brainbase orchestration pull")} to materialise the manifest before pushing.`);
|
|
68404
68847
|
return;
|
|
68405
68848
|
}
|
|
68406
68849
|
let manifest;
|
|
@@ -68424,7 +68867,7 @@ async function runOrchestrationPush(cwd2, args) {
|
|
|
68424
68867
|
}
|
|
68425
68868
|
if (missing.length) {
|
|
68426
68869
|
f2.error(`Missing local checkouts for: ${missing.join(", ")}.`);
|
|
68427
|
-
f2.info(`Run ${
|
|
68870
|
+
f2.info(`Run ${import_picocolors43.default.cyan("brainbase orchestration pull")} to materialise the missing folders.`);
|
|
68428
68871
|
process.exitCode = 1;
|
|
68429
68872
|
return;
|
|
68430
68873
|
}
|
|
@@ -68445,13 +68888,13 @@ async function runOrchestrationPush(cwd2, args) {
|
|
|
68445
68888
|
}
|
|
68446
68889
|
}
|
|
68447
68890
|
const plan = [""];
|
|
68448
|
-
plan.push(` ${
|
|
68449
|
-
plan.push(` ${
|
|
68891
|
+
plan.push(` ${import_picocolors43.default.bold(link2.name)} ${import_picocolors43.default.dim(`(${link2.orchestration_id})`)}`);
|
|
68892
|
+
plan.push(` ${import_picocolors43.default.dim(`${manifest.members.length} member${manifest.members.length === 1 ? "" : "s"}, ${manifest.edges.length} edge${manifest.edges.length === 1 ? "" : "s"}, ${graph.triggers.length} trigger${graph.triggers.length === 1 ? "" : "s"}`)}`);
|
|
68450
68893
|
plan.push("");
|
|
68451
68894
|
if (!args.graphOnly) {
|
|
68452
|
-
plan.push(` ${
|
|
68895
|
+
plan.push(` ${import_picocolors43.default.dim("per-member agent push:")}`);
|
|
68453
68896
|
for (const m3 of manifest.members) {
|
|
68454
|
-
plan.push(` ${
|
|
68897
|
+
plan.push(` ${import_picocolors43.default.cyan("•")} ${import_picocolors43.default.bold(m3.slug)}`);
|
|
68455
68898
|
}
|
|
68456
68899
|
plan.push("");
|
|
68457
68900
|
}
|
|
@@ -68471,7 +68914,7 @@ async function runOrchestrationPush(cwd2, args) {
|
|
|
68471
68914
|
for (const m3 of manifest.members) {
|
|
68472
68915
|
const dir = memberDir(cwd2, m3.slug);
|
|
68473
68916
|
console.log("");
|
|
68474
|
-
console.log(`${
|
|
68917
|
+
console.log(`${import_picocolors43.default.dim("───")} ${import_picocolors43.default.bold(m3.slug)} ${import_picocolors43.default.dim("───")}`);
|
|
68475
68918
|
const exitCodeBeforePush = process.exitCode;
|
|
68476
68919
|
try {
|
|
68477
68920
|
await runAgentPush(dir, { yes: true });
|
|
@@ -68535,7 +68978,7 @@ function handleApiError6(err) {
|
|
|
68535
68978
|
f2.error("You do not have access to this orchestration.");
|
|
68536
68979
|
} else if (err.status === 409) {
|
|
68537
68980
|
f2.error(err.message);
|
|
68538
|
-
f2.info(`Run ${
|
|
68981
|
+
f2.info(`Run ${import_picocolors43.default.cyan("brainbase orchestration pull")} to reconcile, then push again.`);
|
|
68539
68982
|
} else {
|
|
68540
68983
|
f2.error(err.message);
|
|
68541
68984
|
}
|
|
@@ -68545,13 +68988,13 @@ function handleApiError6(err) {
|
|
|
68545
68988
|
}
|
|
68546
68989
|
|
|
68547
68990
|
// src/cli/orchestration-status.ts
|
|
68548
|
-
var
|
|
68991
|
+
var import_picocolors44 = __toESM(require_picocolors(), 1);
|
|
68549
68992
|
async function runOrchestrationStatus(cwd2) {
|
|
68550
68993
|
banner("orchestration status — what changed locally, remotely, both");
|
|
68551
68994
|
const link2 = readOrchLink(cwd2);
|
|
68552
68995
|
if (!link2) {
|
|
68553
68996
|
f2.warn("This folder is not linked to any orchestration.");
|
|
68554
|
-
f2.info(`Run ${
|
|
68997
|
+
f2.info(`Run ${import_picocolors44.default.cyan("brainbase orchestration pull <id>")} first.`);
|
|
68555
68998
|
return;
|
|
68556
68999
|
}
|
|
68557
69000
|
const localManifest = hasOrchManifest(cwd2) ? readOrchManifest(cwd2) : null;
|
|
@@ -68574,8 +69017,8 @@ async function runOrchestrationStatus(cwd2) {
|
|
|
68574
69017
|
}
|
|
68575
69018
|
const lines = [];
|
|
68576
69019
|
lines.push("");
|
|
68577
|
-
lines.push(` ${
|
|
68578
|
-
lines.push(` ${
|
|
69020
|
+
lines.push(` ${import_picocolors44.default.bold(link2.name)} ${import_picocolors44.default.dim(`(${link2.orchestration_id})`)}`);
|
|
69021
|
+
lines.push(` ${import_picocolors44.default.dim("revision")} cloud ${cloud.revision}${lock ? ` · lock ${lock.revision}` : " · never pulled"}`);
|
|
68579
69022
|
lines.push("");
|
|
68580
69023
|
const localSlugByAgentId = new Map;
|
|
68581
69024
|
for (const m3 of localManifest?.members ?? []) {
|
|
@@ -68589,12 +69032,12 @@ async function runOrchestrationStatus(cwd2) {
|
|
|
68589
69032
|
const membersAdded = [...localMemberSet].filter((s3) => !cloudMemberSet.has(s3));
|
|
68590
69033
|
const membersRemoved = [...cloudMemberSet].filter((s3) => !localMemberSet.has(s3));
|
|
68591
69034
|
if (membersAdded.length || membersRemoved.length) {
|
|
68592
|
-
lines.push(` ${
|
|
69035
|
+
lines.push(` ${import_picocolors44.default.bold("members")}`);
|
|
68593
69036
|
for (const slug of membersAdded) {
|
|
68594
|
-
lines.push(` ${
|
|
69037
|
+
lines.push(` ${import_picocolors44.default.yellow("→ push")} added in yaml: ${import_picocolors44.default.bold(slug)}`);
|
|
68595
69038
|
}
|
|
68596
69039
|
for (const slug of membersRemoved) {
|
|
68597
|
-
lines.push(` ${
|
|
69040
|
+
lines.push(` ${import_picocolors44.default.cyan("← pull")} added on cloud: ${import_picocolors44.default.bold(slug)}`);
|
|
68598
69041
|
}
|
|
68599
69042
|
lines.push("");
|
|
68600
69043
|
}
|
|
@@ -68609,11 +69052,11 @@ async function runOrchestrationStatus(cwd2) {
|
|
|
68609
69052
|
const edgesAdded = [...localEdges.keys()].filter((k3) => !cloudEdges.has(k3));
|
|
68610
69053
|
const edgesRemoved = [...cloudEdges.keys()].filter((k3) => !localEdges.has(k3));
|
|
68611
69054
|
if (edgesAdded.length || edgesRemoved.length) {
|
|
68612
|
-
lines.push(` ${
|
|
69055
|
+
lines.push(` ${import_picocolors44.default.bold("edges")}`);
|
|
68613
69056
|
for (const k3 of edgesAdded)
|
|
68614
|
-
lines.push(` ${
|
|
69057
|
+
lines.push(` ${import_picocolors44.default.yellow("→ push")} added in yaml: ${k3}`);
|
|
68615
69058
|
for (const k3 of edgesRemoved)
|
|
68616
|
-
lines.push(` ${
|
|
69059
|
+
lines.push(` ${import_picocolors44.default.cyan("← pull")} added on cloud: ${k3}`);
|
|
68617
69060
|
lines.push("");
|
|
68618
69061
|
}
|
|
68619
69062
|
const cloudTriggerKey = (t) => {
|
|
@@ -68651,11 +69094,11 @@ async function runOrchestrationStatus(cwd2) {
|
|
|
68651
69094
|
const triggersAdded = [...localTriggers.keys()].filter((k3) => !cloudTriggers.has(k3));
|
|
68652
69095
|
const triggersRemoved = [...cloudTriggers.keys()].filter((k3) => !localTriggers.has(k3));
|
|
68653
69096
|
if (triggersAdded.length || triggersRemoved.length) {
|
|
68654
|
-
lines.push(` ${
|
|
69097
|
+
lines.push(` ${import_picocolors44.default.bold("schedule triggers")}`);
|
|
68655
69098
|
for (const k3 of triggersAdded)
|
|
68656
|
-
lines.push(` ${
|
|
69099
|
+
lines.push(` ${import_picocolors44.default.yellow("→ push")} added/changed in yaml: ${localTriggers.get(k3) ?? k3}`);
|
|
68657
69100
|
for (const k3 of triggersRemoved)
|
|
68658
|
-
lines.push(` ${
|
|
69101
|
+
lines.push(` ${import_picocolors44.default.cyan("← pull")} added/changed on cloud: ${cloudTriggers.get(k3) ?? k3}`);
|
|
68659
69102
|
lines.push("");
|
|
68660
69103
|
}
|
|
68661
69104
|
const lockByAgentId = new Map((lock?.members ?? []).map((m3) => [m3.agent_id, m3]));
|
|
@@ -68678,27 +69121,27 @@ async function runOrchestrationStatus(cwd2) {
|
|
|
68678
69121
|
}
|
|
68679
69122
|
}
|
|
68680
69123
|
if (memberDrift.length) {
|
|
68681
|
-
lines.push(` ${
|
|
69124
|
+
lines.push(` ${import_picocolors44.default.bold("member content drift")}`);
|
|
68682
69125
|
for (const d3 of memberDrift) {
|
|
68683
|
-
lines.push(` ${
|
|
69126
|
+
lines.push(` ${import_picocolors44.default.cyan("?")} ${import_picocolors44.default.bold(d3.slug)} ${import_picocolors44.default.dim("— " + d3.reason)}`);
|
|
68684
69127
|
}
|
|
68685
|
-
lines.push(` ${
|
|
69128
|
+
lines.push(` ${import_picocolors44.default.dim("cd into each member folder and run")} ${import_picocolors44.default.cyan("brainbase agent status")}`);
|
|
68686
69129
|
lines.push("");
|
|
68687
69130
|
}
|
|
68688
69131
|
const revisionDrift = lock?.revision != null && cloud.revision !== lock.revision;
|
|
68689
69132
|
if (revisionDrift) {
|
|
68690
|
-
lines.push(` ${
|
|
68691
|
-
lines.push(` ${
|
|
69133
|
+
lines.push(` ${import_picocolors44.default.bold("cloud revision")}`);
|
|
69134
|
+
lines.push(` ${import_picocolors44.default.cyan("← pull")} cloud changed since last pull: ${import_picocolors44.default.dim(`lock ${lock.revision} → cloud ${cloud.revision}`)}`);
|
|
68692
69135
|
lines.push("");
|
|
68693
69136
|
}
|
|
68694
69137
|
if (!membersAdded.length && !membersRemoved.length && !edgesAdded.length && !edgesRemoved.length && !triggersAdded.length && !triggersRemoved.length && !memberDrift.length && !revisionDrift) {
|
|
68695
|
-
lines.push(` ${
|
|
69138
|
+
lines.push(` ${import_picocolors44.default.green("✓")} everything is in sync`);
|
|
68696
69139
|
lines.push("");
|
|
68697
69140
|
console.log(lines.join(`
|
|
68698
69141
|
`));
|
|
68699
69142
|
return;
|
|
68700
69143
|
}
|
|
68701
|
-
lines.push(` ${
|
|
69144
|
+
lines.push(` ${import_picocolors44.default.dim("run")} ${import_picocolors44.default.cyan("brainbase orchestration pull")} ${import_picocolors44.default.dim("to apply cloud changes,")} ${import_picocolors44.default.cyan("brainbase orchestration push")} ${import_picocolors44.default.dim("to send yours")}`);
|
|
68702
69145
|
lines.push("");
|
|
68703
69146
|
console.log(lines.join(`
|
|
68704
69147
|
`));
|
|
@@ -68713,7 +69156,7 @@ function stableJson(value) {
|
|
|
68713
69156
|
}
|
|
68714
69157
|
|
|
68715
69158
|
// src/cli/orchestration-list.ts
|
|
68716
|
-
var
|
|
69159
|
+
var import_picocolors45 = __toESM(require_picocolors(), 1);
|
|
68717
69160
|
async function runOrchestrationList(args) {
|
|
68718
69161
|
banner("orchestration list — orchestrations under a team");
|
|
68719
69162
|
const { org, team } = await resolveOrgAndTeam({
|
|
@@ -68737,13 +69180,13 @@ async function runOrchestrationList(args) {
|
|
|
68737
69180
|
}
|
|
68738
69181
|
const lines = [""];
|
|
68739
69182
|
for (const o2 of items) {
|
|
68740
|
-
lines.push(` ${
|
|
69183
|
+
lines.push(` ${import_picocolors45.default.bold(o2.name)} ${import_picocolors45.default.dim(o2.id)}`);
|
|
68741
69184
|
if (o2.description)
|
|
68742
|
-
lines.push(` ${
|
|
68743
|
-
lines.push(` ${
|
|
69185
|
+
lines.push(` ${import_picocolors45.default.dim(o2.description)}`);
|
|
69186
|
+
lines.push(` ${import_picocolors45.default.dim(`${o2.member_count} member${o2.member_count === 1 ? "" : "s"} · ${o2.edge_count} edge${o2.edge_count === 1 ? "" : "s"}`)}`);
|
|
68744
69187
|
lines.push("");
|
|
68745
69188
|
}
|
|
68746
|
-
lines.push(` ${
|
|
69189
|
+
lines.push(` ${import_picocolors45.default.dim("pull one with")} ${import_picocolors45.default.cyan("brainbase orchestration pull <id>")}`);
|
|
68747
69190
|
lines.push("");
|
|
68748
69191
|
console.log(lines.join(`
|
|
68749
69192
|
`));
|
|
@@ -68751,7 +69194,7 @@ async function runOrchestrationList(args) {
|
|
|
68751
69194
|
|
|
68752
69195
|
// src/cli/orchestration-add-agent.ts
|
|
68753
69196
|
import fs79 from "node:fs";
|
|
68754
|
-
var
|
|
69197
|
+
var import_picocolors46 = __toESM(require_picocolors(), 1);
|
|
68755
69198
|
|
|
68756
69199
|
// src/core/orchestration-add.ts
|
|
68757
69200
|
function resolveOrgIdForGroup(groupId, orgsWithTeams) {
|
|
@@ -68816,7 +69259,7 @@ async function runOrchestrationAddAgent(cwd2, args) {
|
|
|
68816
69259
|
const link2 = readOrchLink(cwd2);
|
|
68817
69260
|
if (!link2 || !hasOrchManifest(cwd2)) {
|
|
68818
69261
|
f2.warn("This folder is not a linked orchestration.");
|
|
68819
|
-
f2.info(`Run ${
|
|
69262
|
+
f2.info(`Run ${import_picocolors46.default.cyan("brainbase orchestration pull <id>")} first.`);
|
|
68820
69263
|
return;
|
|
68821
69264
|
}
|
|
68822
69265
|
let manifest;
|
|
@@ -68842,7 +69285,7 @@ async function runOrchestrationAddAgent(cwd2, args) {
|
|
|
68842
69285
|
while (manifest.members.some((m3) => m3.slug === candidate) || fs79.existsSync(memberDir(cwd2, candidate))) {
|
|
68843
69286
|
candidate = `${slug}-${++n}`;
|
|
68844
69287
|
}
|
|
68845
|
-
f2.info(`Slug ${
|
|
69288
|
+
f2.info(`Slug ${import_picocolors46.default.bold(slug)} is taken — using ${import_picocolors46.default.bold(candidate)}.`);
|
|
68846
69289
|
slug = candidate;
|
|
68847
69290
|
}
|
|
68848
69291
|
let payloadSchema;
|
|
@@ -68866,7 +69309,7 @@ async function runOrchestrationAddAgent(cwd2, args) {
|
|
|
68866
69309
|
const resolved = resolveOrgIdForGroup(link2.group_id, orgsWithTeams);
|
|
68867
69310
|
if (!resolved) {
|
|
68868
69311
|
sp.stop("Failed.");
|
|
68869
|
-
f2.error(`Could not find an org that owns group ${
|
|
69312
|
+
f2.error(`Could not find an org that owns group ${import_picocolors46.default.bold(link2.group_id)}. ` + `Pass ${import_picocolors46.default.cyan("--org <id>")} explicitly.`);
|
|
68870
69313
|
return;
|
|
68871
69314
|
}
|
|
68872
69315
|
orgId = resolved;
|
|
@@ -68883,14 +69326,14 @@ async function runOrchestrationAddAgent(cwd2, args) {
|
|
|
68883
69326
|
if (from.length === 0 && to2.length === 0 && isInteractive() && manifest.members.length > 0) {
|
|
68884
69327
|
const memberOptions = manifest.members.map((m3) => ({ value: m3.slug, label: m3.slug }));
|
|
68885
69328
|
const pickedFrom = await ae({
|
|
68886
|
-
message: `Connect ${
|
|
69329
|
+
message: `Connect ${import_picocolors46.default.bold(slug)} FROM which member(s)? — edges INTO ${slug} (space to select, enter to skip)`,
|
|
68887
69330
|
options: memberOptions,
|
|
68888
69331
|
required: false
|
|
68889
69332
|
});
|
|
68890
69333
|
if (Array.isArray(pickedFrom))
|
|
68891
69334
|
from = pickedFrom;
|
|
68892
69335
|
const pickedTo = await ae({
|
|
68893
|
-
message: `Connect ${
|
|
69336
|
+
message: `Connect ${import_picocolors46.default.bold(slug)} TO which member(s)? — edges OUT of ${slug} (space to select, enter to skip)`,
|
|
68894
69337
|
options: memberOptions,
|
|
68895
69338
|
required: false
|
|
68896
69339
|
});
|
|
@@ -68929,23 +69372,23 @@ async function runOrchestrationAddAgent(cwd2, args) {
|
|
|
68929
69372
|
}
|
|
68930
69373
|
writeOrchManifest(cwd2, updated);
|
|
68931
69374
|
if (args.noPush) {
|
|
68932
|
-
f2.info(`Manifest updated. Run ${
|
|
69375
|
+
f2.info(`Manifest updated. Run ${import_picocolors46.default.cyan("brainbase orchestration push")} to apply.`);
|
|
68933
69376
|
return;
|
|
68934
69377
|
}
|
|
68935
69378
|
await runOrchestrationPush(cwd2, { yes: true, graphOnly: true });
|
|
68936
69379
|
}
|
|
68937
69380
|
|
|
68938
69381
|
// src/cli/orchestration-create.ts
|
|
68939
|
-
var
|
|
69382
|
+
var import_picocolors47 = __toESM(require_picocolors(), 1);
|
|
68940
69383
|
async function runOrchestrationCreate(cwd2, args) {
|
|
68941
69384
|
banner("orchestration create — claim a brainbase-orchestration.yaml");
|
|
68942
69385
|
if (readOrchLink(cwd2)) {
|
|
68943
69386
|
f2.warn("This folder is already linked to an orchestration.");
|
|
68944
|
-
f2.info(`Run ${
|
|
69387
|
+
f2.info(`Run ${import_picocolors47.default.cyan("brainbase orchestration push")} to update it.`);
|
|
68945
69388
|
return;
|
|
68946
69389
|
}
|
|
68947
69390
|
if (!hasOrchManifest(cwd2)) {
|
|
68948
|
-
f2.warn(`No ${
|
|
69391
|
+
f2.warn(`No ${import_picocolors47.default.bold(ORCH_MANIFEST_FILE)} here.`);
|
|
68949
69392
|
f2.info(`Create one, or pull an existing orchestration first.`);
|
|
68950
69393
|
return;
|
|
68951
69394
|
}
|
|
@@ -68978,10 +69421,10 @@ async function runOrchestrationCreate(cwd2, args) {
|
|
|
68978
69421
|
});
|
|
68979
69422
|
const plan = [
|
|
68980
69423
|
"",
|
|
68981
|
-
` ${
|
|
68982
|
-
` ${
|
|
68983
|
-
` ${
|
|
68984
|
-
` ${
|
|
69424
|
+
` ${import_picocolors47.default.bold(manifest.orchestration.name)}`,
|
|
69425
|
+
` ${import_picocolors47.default.dim("org")} ${import_picocolors47.default.bold(target.org.name)}`,
|
|
69426
|
+
` ${import_picocolors47.default.dim("team")} ${import_picocolors47.default.bold(target.team.name)}`,
|
|
69427
|
+
` ${import_picocolors47.default.dim("graph")} ${manifest.members.length} member${manifest.members.length === 1 ? "" : "s"}, ${manifest.edges.length} edge${manifest.edges.length === 1 ? "" : "s"}, ${graph.triggers.length} trigger${graph.triggers.length === 1 ? "" : "s"}`,
|
|
68985
69428
|
""
|
|
68986
69429
|
];
|
|
68987
69430
|
console.log(plan.join(`
|
|
@@ -69011,7 +69454,7 @@ async function runOrchestrationCreate(cwd2, args) {
|
|
|
69011
69454
|
edges: graph.edges,
|
|
69012
69455
|
triggers: graph.triggers
|
|
69013
69456
|
});
|
|
69014
|
-
sp.stop(`Created ${
|
|
69457
|
+
sp.stop(`Created ${import_picocolors47.default.bold(created.name)}.`);
|
|
69015
69458
|
writeOrchLink(cwd2, {
|
|
69016
69459
|
schemaVersion: 1,
|
|
69017
69460
|
orchestration_id: created.id,
|
|
@@ -69124,21 +69567,21 @@ async function runOrchestration(cwd2, sub, args, opts) {
|
|
|
69124
69567
|
function printHelp3() {
|
|
69125
69568
|
const out = [];
|
|
69126
69569
|
out.push("");
|
|
69127
|
-
out.push(` ${
|
|
69570
|
+
out.push(` ${import_picocolors48.default.bold("brainbase orchestration")} ${import_picocolors48.default.dim("<sub> [options]")}`);
|
|
69128
69571
|
out.push("");
|
|
69129
|
-
out.push(` ${
|
|
69130
|
-
out.push(` ${
|
|
69131
|
-
out.push(` ${
|
|
69132
|
-
out.push(` ${
|
|
69133
|
-
out.push(` ${
|
|
69134
|
-
out.push(` ${
|
|
69572
|
+
out.push(` ${import_picocolors48.default.cyan("create")} ${import_picocolors48.default.dim("claim a local orchestration manifest and create it in the cloud")}`);
|
|
69573
|
+
out.push(` ${import_picocolors48.default.cyan("pull")} ${import_picocolors48.default.dim("<id>")} ${import_picocolors48.default.dim("fetch orchestration + every member agent into this folder")}`);
|
|
69574
|
+
out.push(` ${import_picocolors48.default.cyan("push")} ${import_picocolors48.default.dim("push each member, then update the orchestration graph")}`);
|
|
69575
|
+
out.push(` ${import_picocolors48.default.cyan("add-agent")} ${import_picocolors48.default.dim("<name>")} ${import_picocolors48.default.dim("create a member agent, wire edges (--from/--to), and push")}`);
|
|
69576
|
+
out.push(` ${import_picocolors48.default.cyan("status")} ${import_picocolors48.default.dim("show what would push and what would pull")}`);
|
|
69577
|
+
out.push(` ${import_picocolors48.default.cyan("list")} ${import_picocolors48.default.dim("list orchestrations under a team")}`);
|
|
69135
69578
|
out.push("");
|
|
69136
|
-
out.push(` ${
|
|
69137
|
-
out.push(` ${
|
|
69138
|
-
out.push(` ${
|
|
69139
|
-
out.push(` ${
|
|
69140
|
-
out.push(` ${
|
|
69141
|
-
out.push(` ${
|
|
69579
|
+
out.push(` ${import_picocolors48.default.bold("Flags")}`);
|
|
69580
|
+
out.push(` ${import_picocolors48.default.dim("--yes, -y")} skip confirmations`);
|
|
69581
|
+
out.push(` ${import_picocolors48.default.dim("--harness <id>")} harness for newly-created member folders (default claude-code)`);
|
|
69582
|
+
out.push(` ${import_picocolors48.default.dim("--graph-only")} for push: only update members + edges, skip per-member push`);
|
|
69583
|
+
out.push(` ${import_picocolors48.default.dim("--org <id>")} for create/list: org id or slug (CLI vocab — DB teams.id)`);
|
|
69584
|
+
out.push(` ${import_picocolors48.default.dim("--team <id>")} for create/list: team id (CLI vocab — DB groups.id)`);
|
|
69142
69585
|
out.push("");
|
|
69143
69586
|
console.log(out.join(`
|
|
69144
69587
|
`));
|
|
@@ -69183,11 +69626,11 @@ async function runRun(cwd2, args) {
|
|
|
69183
69626
|
}
|
|
69184
69627
|
|
|
69185
69628
|
// src/cli/publish.ts
|
|
69186
|
-
var
|
|
69629
|
+
var import_picocolors49 = __toESM(require_picocolors(), 1);
|
|
69187
69630
|
function runPublish() {
|
|
69188
69631
|
banner("publish — moved");
|
|
69189
|
-
f2.error(`${
|
|
69190
|
-
f2.info(`Use ${
|
|
69632
|
+
f2.error(`${import_picocolors49.default.bold("brainbase publish")} does not exist.`);
|
|
69633
|
+
f2.info(`Use ${import_picocolors49.default.cyan("brainbase agent push")} to send your local changes to the cloud.`);
|
|
69191
69634
|
process.exit(1);
|
|
69192
69635
|
}
|
|
69193
69636
|
|
|
@@ -69486,7 +69929,7 @@ async function runStatus(cwd2) {
|
|
|
69486
69929
|
}
|
|
69487
69930
|
|
|
69488
69931
|
// src/cli/token.ts
|
|
69489
|
-
var
|
|
69932
|
+
var import_picocolors50 = __toESM(require_picocolors(), 1);
|
|
69490
69933
|
|
|
69491
69934
|
// src/ui/ink/TokenCards.tsx
|
|
69492
69935
|
var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
|
|
@@ -69908,7 +70351,7 @@ async function runTokenRename(args) {
|
|
|
69908
70351
|
}
|
|
69909
70352
|
}
|
|
69910
70353
|
if (name === target.name.trim()) {
|
|
69911
|
-
console.log(`${sym.ok} ${
|
|
70354
|
+
console.log(`${sym.ok} ${import_picocolors50.default.bold(target.name.trim())} already has that label; nothing to do.`);
|
|
69912
70355
|
return;
|
|
69913
70356
|
}
|
|
69914
70357
|
try {
|
|
@@ -69916,7 +70359,7 @@ async function runTokenRename(args) {
|
|
|
69916
70359
|
} catch (error) {
|
|
69917
70360
|
throw withLoginHint(error);
|
|
69918
70361
|
}
|
|
69919
|
-
console.log(`${sym.ok} Renamed ${
|
|
70362
|
+
console.log(`${sym.ok} Renamed ${import_picocolors50.default.dim(target.name)} → ${import_picocolors50.default.bold(name)}`);
|
|
69920
70363
|
}
|
|
69921
70364
|
async function runTokenRevoke(args) {
|
|
69922
70365
|
if (!args.id) {
|
|
@@ -69934,14 +70377,14 @@ async function runTokenRevoke(args) {
|
|
|
69934
70377
|
throw new Error(`No token with id ${args.id}. Run \`brainbase token list\` to see yours.`);
|
|
69935
70378
|
}
|
|
69936
70379
|
if (target.revoked_at) {
|
|
69937
|
-
reconcileDeadToken(target, `${
|
|
70380
|
+
reconcileDeadToken(target, `${import_picocolors50.default.bold(target.name)} is already revoked.`);
|
|
69938
70381
|
return;
|
|
69939
70382
|
}
|
|
69940
70383
|
const stored = readToken();
|
|
69941
70384
|
const isLocalToken = Boolean(stored && stored.token.startsWith(target.prefix));
|
|
69942
70385
|
if (!autoProceed(args.yes)) {
|
|
69943
70386
|
const ok = await se({
|
|
69944
|
-
message: isLocalToken ? `Revoke ${
|
|
70387
|
+
message: isLocalToken ? `Revoke ${import_picocolors50.default.bold(target.name)} (${args.id})? This is the token this CLI is using, so it will stop working here too.` : `Revoke ${import_picocolors50.default.bold(target.name)} (${args.id})? CIs and machines using it will stop working.`,
|
|
69945
70388
|
initialValue: false
|
|
69946
70389
|
});
|
|
69947
70390
|
if (!ensureNotCancelled(ok))
|
|
@@ -69952,14 +70395,14 @@ async function runTokenRevoke(args) {
|
|
|
69952
70395
|
} catch (error) {
|
|
69953
70396
|
if (error instanceof ApiError && error.status === 404) {
|
|
69954
70397
|
if (isExpired2(target)) {
|
|
69955
|
-
reconcileDeadToken(target, `${
|
|
70398
|
+
reconcileDeadToken(target, `${import_picocolors50.default.bold(target.name)} had already expired.`);
|
|
69956
70399
|
return;
|
|
69957
70400
|
}
|
|
69958
70401
|
throw new Error(`The server reported no active token with id ${args.id}, but it listed one a moment ago. ` + "The local token has been left alone, since that key may still work. " + "If this server predates `DELETE /v1/registry/cli-tokens/{id}`, revoke from the web app instead.");
|
|
69959
70402
|
}
|
|
69960
70403
|
throw withLoginHint(error);
|
|
69961
70404
|
}
|
|
69962
|
-
reconcileDeadToken(target, `Revoked ${
|
|
70405
|
+
reconcileDeadToken(target, `Revoked ${import_picocolors50.default.bold(target.name)}.`);
|
|
69963
70406
|
}
|
|
69964
70407
|
function reconcileDeadToken(target, headline) {
|
|
69965
70408
|
let outcome;
|
|
@@ -69993,7 +70436,7 @@ function reportLocalToken(headline, outcome) {
|
|
|
69993
70436
|
}
|
|
69994
70437
|
async function runTokenClear() {
|
|
69995
70438
|
if (!readToken()) {
|
|
69996
|
-
console.log(
|
|
70439
|
+
console.log(import_picocolors50.default.dim("No local token stored."));
|
|
69997
70440
|
return;
|
|
69998
70441
|
}
|
|
69999
70442
|
clearToken();
|
|
@@ -70093,28 +70536,28 @@ async function runToken(sub, rest2, args) {
|
|
|
70093
70536
|
function printTokenHelp() {
|
|
70094
70537
|
const out = [];
|
|
70095
70538
|
out.push("");
|
|
70096
|
-
out.push(` ${
|
|
70539
|
+
out.push(` ${import_picocolors50.default.bold("brainbase token")} ${import_picocolors50.default.dim("<command>")}`);
|
|
70097
70540
|
out.push("");
|
|
70098
|
-
out.push(` ${
|
|
70099
|
-
out.push(` ${
|
|
70100
|
-
out.push(` ${
|
|
70101
|
-
out.push(` ${
|
|
70102
|
-
out.push(` ${
|
|
70541
|
+
out.push(` ${import_picocolors50.default.cyan("create")} ${import_picocolors50.default.dim("issue a new long-lived CLI key (PAT)")}`);
|
|
70542
|
+
out.push(` ${import_picocolors50.default.cyan("list")} ${import_picocolors50.default.dim("show your tokens")}`);
|
|
70543
|
+
out.push(` ${import_picocolors50.default.cyan("rename")} ${import_picocolors50.default.dim("<id>")} ${import_picocolors50.default.dim("relabel a token by id")}`);
|
|
70544
|
+
out.push(` ${import_picocolors50.default.cyan("revoke")} ${import_picocolors50.default.dim("<id>")} ${import_picocolors50.default.dim("revoke a token by id")}`);
|
|
70545
|
+
out.push(` ${import_picocolors50.default.cyan("clear")} ${import_picocolors50.default.dim("forget the local token (does not revoke)")}`);
|
|
70103
70546
|
out.push("");
|
|
70104
|
-
out.push(` ${
|
|
70105
|
-
out.push(` ${
|
|
70106
|
-
out.push(` ${
|
|
70107
|
-
out.push(` ${
|
|
70547
|
+
out.push(` ${import_picocolors50.default.bold("create flags")}`);
|
|
70548
|
+
out.push(` ${import_picocolors50.default.cyan("--name, -n")} ${import_picocolors50.default.dim("<label>")} ${import_picocolors50.default.dim("token label (prompted if omitted)")}`);
|
|
70549
|
+
out.push(` ${import_picocolors50.default.cyan("--scopes")} ${import_picocolors50.default.dim("<list>")} ${import_picocolors50.default.dim("comma-separated; allowed: read, publish, admin")}`);
|
|
70550
|
+
out.push(` ${import_picocolors50.default.dim("default: read,publish")}`);
|
|
70108
70551
|
out.push("");
|
|
70109
|
-
out.push(` ${
|
|
70110
|
-
out.push(` ${
|
|
70552
|
+
out.push(` ${import_picocolors50.default.bold("rename flags")}`);
|
|
70553
|
+
out.push(` ${import_picocolors50.default.cyan("--name, -n")} ${import_picocolors50.default.dim("<label>")} ${import_picocolors50.default.dim("new label (prompted if omitted)")}`);
|
|
70111
70554
|
out.push("");
|
|
70112
70555
|
console.log(out.join(`
|
|
70113
70556
|
`));
|
|
70114
70557
|
}
|
|
70115
70558
|
|
|
70116
70559
|
// src/cli/mcp.ts
|
|
70117
|
-
var
|
|
70560
|
+
var import_picocolors51 = __toESM(require_picocolors(), 1);
|
|
70118
70561
|
|
|
70119
70562
|
// src/core/mcp-check/collect-servers.ts
|
|
70120
70563
|
import path88 from "node:path";
|
|
@@ -78471,17 +78914,17 @@ async function runMcpCheck(cwd2, options) {
|
|
|
78471
78914
|
function renderHuman(report2) {
|
|
78472
78915
|
const lines = [];
|
|
78473
78916
|
if (report2.check_status === "skipped") {
|
|
78474
|
-
lines.push(
|
|
78917
|
+
lines.push(import_picocolors51.default.dim("No MCP servers configured — nothing to check."));
|
|
78475
78918
|
return lines.join(`
|
|
78476
78919
|
`) + `
|
|
78477
78920
|
`;
|
|
78478
78921
|
}
|
|
78479
78922
|
for (const s3 of report2.servers) {
|
|
78480
|
-
const mark = s3.status === "ok" ?
|
|
78481
|
-
const detail = s3.status === "ok" ?
|
|
78923
|
+
const mark = s3.status === "ok" ? import_picocolors51.default.green("✓") : s3.status === "auth_failed" ? import_picocolors51.default.red("✗") : import_picocolors51.default.yellow("⚠");
|
|
78924
|
+
const detail = s3.status === "ok" ? import_picocolors51.default.dim(`${s3.tool_count} tool${s3.tool_count === 1 ? "" : "s"}`) : import_picocolors51.default.dim(s3.status + (s3.error ? ` — ${s3.error}` : ""));
|
|
78482
78925
|
lines.push(` ${mark} ${s3.name} ${detail}`);
|
|
78483
78926
|
}
|
|
78484
|
-
const summary = report2.check_status === "ok" ?
|
|
78927
|
+
const summary = report2.check_status === "ok" ? import_picocolors51.default.green("All MCP servers connected.") : import_picocolors51.default.yellow("Some MCP servers are unhealthy.");
|
|
78485
78928
|
lines.push("", summary);
|
|
78486
78929
|
return lines.join(`
|
|
78487
78930
|
`) + `
|
|
@@ -78577,12 +79020,12 @@ function isUnhealthy(server) {
|
|
|
78577
79020
|
}
|
|
78578
79021
|
function renderServerList(servers) {
|
|
78579
79022
|
if (servers.length === 0) {
|
|
78580
|
-
return
|
|
79023
|
+
return import_picocolors51.default.dim("No MCP servers configured for this agent.") + `
|
|
78581
79024
|
`;
|
|
78582
79025
|
}
|
|
78583
79026
|
const lines = [""];
|
|
78584
79027
|
for (const s3 of servers) {
|
|
78585
|
-
const mark = s3.auth === "oauth_expired" ?
|
|
79028
|
+
const mark = s3.auth === "oauth_expired" ? import_picocolors51.default.red("✗") : s3.auth === "oauth_required" || isUnhealthy(s3) ? import_picocolors51.default.yellow("!") : !s3.is_enabled ? import_picocolors51.default.dim("·") : import_picocolors51.default.green("✓");
|
|
78586
79029
|
const bits = [s3.transport];
|
|
78587
79030
|
if (!s3.is_enabled)
|
|
78588
79031
|
bits.push("disabled");
|
|
@@ -78595,10 +79038,10 @@ function renderServerList(servers) {
|
|
|
78595
79038
|
const expiry = describeExpiry(s3);
|
|
78596
79039
|
if (expiry)
|
|
78597
79040
|
bits.push(expiry);
|
|
78598
|
-
lines.push(` ${mark} ${
|
|
79041
|
+
lines.push(` ${mark} ${import_picocolors51.default.bold(s3.name)} ${import_picocolors51.default.dim(bits.join(" · "))}`);
|
|
78599
79042
|
}
|
|
78600
79043
|
if (servers.some((s3) => s3.auth === "oauth_required" || s3.auth === "oauth_expired")) {
|
|
78601
|
-
lines.push("",
|
|
79044
|
+
lines.push("", import_picocolors51.default.dim("Authorize OAuth-backed servers in the web app; the CLI cannot run that flow yet."));
|
|
78602
79045
|
}
|
|
78603
79046
|
lines.push("");
|
|
78604
79047
|
return lines.join(`
|
|
@@ -78641,7 +79084,7 @@ async function runMcp(cwd2, sub, _argv, options) {
|
|
|
78641
79084
|
}
|
|
78642
79085
|
|
|
78643
79086
|
// src/cli/task.ts
|
|
78644
|
-
var
|
|
79087
|
+
var import_picocolors52 = __toESM(require_picocolors(), 1);
|
|
78645
79088
|
|
|
78646
79089
|
// src/cli/task-create.ts
|
|
78647
79090
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -78827,25 +79270,25 @@ async function runTask(cwd2, sub, args) {
|
|
|
78827
79270
|
function printHelp4() {
|
|
78828
79271
|
const out = [];
|
|
78829
79272
|
out.push("");
|
|
78830
|
-
out.push(` ${
|
|
79273
|
+
out.push(` ${import_picocolors52.default.bold("brainbase task")} ${import_picocolors52.default.dim("<sub> [options]")}`);
|
|
78831
79274
|
out.push("");
|
|
78832
|
-
out.push(` ${
|
|
79275
|
+
out.push(` ${import_picocolors52.default.cyan("create")} ${import_picocolors52.default.dim("--message <text>")} ${import_picocolors52.default.dim("create a task and start its first run")}`);
|
|
78833
79276
|
out.push("");
|
|
78834
|
-
out.push(` ${
|
|
78835
|
-
out.push(` ${
|
|
78836
|
-
out.push(` ${
|
|
78837
|
-
out.push(` ${
|
|
78838
|
-
out.push(` ${
|
|
78839
|
-
out.push(` ${
|
|
79277
|
+
out.push(` ${import_picocolors52.default.bold("create flags")}`);
|
|
79278
|
+
out.push(` ${import_picocolors52.default.dim("--message <text>")} required first user message`);
|
|
79279
|
+
out.push(` ${import_picocolors52.default.dim("--agent <id>")} override the claimed agent in brainbase.agent.yaml`);
|
|
79280
|
+
out.push(` ${import_picocolors52.default.dim("--title <text>")} optional task title`);
|
|
79281
|
+
out.push(` ${import_picocolors52.default.dim("--model <id>")} optional model override`);
|
|
79282
|
+
out.push(` ${import_picocolors52.default.dim("--json")} print task_id, agent_id, and status as JSON`);
|
|
78840
79283
|
out.push("");
|
|
78841
|
-
out.push(` ${
|
|
79284
|
+
out.push(` ${import_picocolors52.default.dim("Flag-like values:")} use ${import_picocolors52.default.cyan("--flag=value")} or ${import_picocolors52.default.cyan("--flag -- <value>")}`);
|
|
78842
79285
|
out.push("");
|
|
78843
79286
|
console.log(out.join(`
|
|
78844
79287
|
`));
|
|
78845
79288
|
}
|
|
78846
79289
|
|
|
78847
79290
|
// src/cli/benchmark.ts
|
|
78848
|
-
var
|
|
79291
|
+
var import_picocolors53 = __toESM(require_picocolors(), 1);
|
|
78849
79292
|
import {
|
|
78850
79293
|
execFileSync as execFileSync3,
|
|
78851
79294
|
spawn as spawn5
|
|
@@ -82265,13 +82708,13 @@ async function runBenchmark(sub, args, write = (value) => process.stdout.write(v
|
|
|
82265
82708
|
function printHelp5() {
|
|
82266
82709
|
const out = [];
|
|
82267
82710
|
out.push("");
|
|
82268
|
-
out.push(` ${
|
|
82711
|
+
out.push(` ${import_picocolors53.default.bold("brainbase benchmark")} ${import_picocolors53.default.dim("<sub> [options]")}`);
|
|
82269
82712
|
out.push("");
|
|
82270
|
-
out.push(` ${
|
|
82271
|
-
out.push(` ${
|
|
82272
|
-
out.push(` ${
|
|
82713
|
+
out.push(` ${import_picocolors53.default.cyan("hydrate")} ${import_picocolors53.default.dim("--spec <path> --result <path> --json")}`);
|
|
82714
|
+
out.push(` ${import_picocolors53.default.cyan("evaluate")} ${import_picocolors53.default.dim("--spec <path> --result <path> --json")}`);
|
|
82715
|
+
out.push(` ${import_picocolors53.default.cyan("capabilities")} ${import_picocolors53.default.dim("--json")}`);
|
|
82273
82716
|
out.push("");
|
|
82274
|
-
out.push(` ${
|
|
82717
|
+
out.push(` ${import_picocolors53.default.dim("These machine-only commands execute versioned benchmark phase specs inside a task sandbox.")}`);
|
|
82275
82718
|
out.push("");
|
|
82276
82719
|
console.log(out.join(`
|
|
82277
82720
|
`));
|
|
@@ -82298,140 +82741,140 @@ var SUBCOMMAND_OWNED_FLAGS = {
|
|
|
82298
82741
|
function help() {
|
|
82299
82742
|
const out = [];
|
|
82300
82743
|
out.push("");
|
|
82301
|
-
out.push(` ${brandTint("◆")} ${
|
|
82302
|
-
out.push(` ${
|
|
82744
|
+
out.push(` ${brandTint("◆")} ${import_picocolors54.default.bold("brainbase")} ${import_picocolors54.default.dim(`v${VERSION}`)}`);
|
|
82745
|
+
out.push(` ${import_picocolors54.default.dim("connect your local agent to the brainbase platform")}`);
|
|
82303
82746
|
out.push("");
|
|
82304
82747
|
out.push(divider("USAGE"));
|
|
82305
82748
|
out.push("");
|
|
82306
|
-
out.push(` ${
|
|
82749
|
+
out.push(` ${import_picocolors54.default.bold("brainbase")} ${import_picocolors54.default.dim("<command> [options]")}`);
|
|
82307
82750
|
out.push("");
|
|
82308
82751
|
out.push(divider("AUTH"));
|
|
82309
82752
|
out.push("");
|
|
82310
|
-
out.push(` ${
|
|
82311
|
-
out.push(` ${
|
|
82312
|
-
out.push(` ${
|
|
82753
|
+
out.push(` ${import_picocolors54.default.cyan("login")} ${import_picocolors54.default.dim(" open the web app and connect this device")}`);
|
|
82754
|
+
out.push(` ${import_picocolors54.default.cyan("logout")} ${import_picocolors54.default.dim(" clear the local session")}`);
|
|
82755
|
+
out.push(` ${import_picocolors54.default.cyan("whoami")} ${import_picocolors54.default.dim("[--json]")} ${import_picocolors54.default.dim(" show which credential is in use and what it covers")}`);
|
|
82313
82756
|
out.push("");
|
|
82314
82757
|
out.push(divider("DISCOVERY"));
|
|
82315
82758
|
out.push("");
|
|
82316
|
-
out.push(` ${
|
|
82317
|
-
out.push(` ${
|
|
82759
|
+
out.push(` ${import_picocolors54.default.cyan("team list")} ${import_picocolors54.default.dim("show the teams you can create agents in")}`);
|
|
82760
|
+
out.push(` ${import_picocolors54.default.cyan("agent list")} ${import_picocolors54.default.dim("show a team's agents and their ids")}`);
|
|
82318
82761
|
out.push("");
|
|
82319
82762
|
out.push(divider("LINKED AGENT"));
|
|
82320
82763
|
out.push("");
|
|
82321
|
-
out.push(` ${
|
|
82322
|
-
out.push(` ${
|
|
82323
|
-
out.push(` ${
|
|
82324
|
-
out.push(` ${
|
|
82325
|
-
out.push(` ${
|
|
82326
|
-
out.push(` ${
|
|
82327
|
-
out.push(` ${
|
|
82328
|
-
out.push(` ${
|
|
82329
|
-
out.push(` ${
|
|
82330
|
-
out.push(` ${
|
|
82331
|
-
out.push(` ${
|
|
82332
|
-
out.push(` ${
|
|
82333
|
-
out.push(` ${
|
|
82334
|
-
out.push(` ${
|
|
82764
|
+
out.push(` ${import_picocolors54.default.cyan("agent init")} ${import_picocolors54.default.dim("write a starter brainbase.agent.yaml here — offline, no login needed")}`);
|
|
82765
|
+
out.push(` ${import_picocolors54.default.cyan("agent create")} ${import_picocolors54.default.dim("claim an unclaimed brainbase.agent.yaml and create the cloud agent")}`);
|
|
82766
|
+
out.push(` ${import_picocolors54.default.cyan("agent pull")} ${import_picocolors54.default.dim("[<id>]")} ${import_picocolors54.default.dim("bring cloud changes into this folder (--force to override; --run-entrypoint to also execute the agent entrypoint)")}`);
|
|
82767
|
+
out.push(` ${import_picocolors54.default.cyan("agent push")} ${import_picocolors54.default.dim("send local changes to the cloud (--force to overwrite cloud-side conflicts with local)")}`);
|
|
82768
|
+
out.push(` ${import_picocolors54.default.cyan("agent unpack")} ${import_picocolors54.default.dim("install the claimed agent into a harness layout")}`);
|
|
82769
|
+
out.push(` ${import_picocolors54.default.cyan("link")} ${import_picocolors54.default.dim("attach this folder to an existing agent")}`);
|
|
82770
|
+
out.push(` ${import_picocolors54.default.cyan("agent status")} ${import_picocolors54.default.dim("show what would pull and what would push")}`);
|
|
82771
|
+
out.push(` ${import_picocolors54.default.cyan("agent connections")} ${import_picocolors54.default.dim("show which integrations this agent is wired to (--json for CI)")}`);
|
|
82772
|
+
out.push(` ${import_picocolors54.default.cyan("agent connect")} ${import_picocolors54.default.dim("<name>")} ${import_picocolors54.default.dim("connect slack or meeting from the terminal")}`);
|
|
82773
|
+
out.push(` ${import_picocolors54.default.cyan("agent disconnect")} ${import_picocolors54.default.dim("<name>")} ${import_picocolors54.default.dim("revoke a slack or meeting install")}`);
|
|
82774
|
+
out.push(` ${import_picocolors54.default.cyan("agent env")} ${import_picocolors54.default.dim("print export lines for `eval $(brainbase agent env)`")}`);
|
|
82775
|
+
out.push(` ${import_picocolors54.default.cyan("run")} ${import_picocolors54.default.dim("<cmd> [args...]")} ${import_picocolors54.default.dim("run <cmd> with secrets.env loaded into env")}`);
|
|
82776
|
+
out.push(` ${import_picocolors54.default.cyan("status")} ${import_picocolors54.default.dim("show what this folder is linked to")}`);
|
|
82777
|
+
out.push(` ${import_picocolors54.default.cyan("unlink")} ${import_picocolors54.default.dim("disconnect this folder")}`);
|
|
82335
82778
|
out.push("");
|
|
82336
82779
|
out.push(divider("TASKS"));
|
|
82337
82780
|
out.push("");
|
|
82338
|
-
out.push(` ${
|
|
82781
|
+
out.push(` ${import_picocolors54.default.cyan("task create")} ${import_picocolors54.default.dim("--message <text>")} ${import_picocolors54.default.dim("create a managed task and start its first run")}`);
|
|
82339
82782
|
out.push("");
|
|
82340
82783
|
out.push(divider("BENCHMARK RUNTIME"));
|
|
82341
82784
|
out.push("");
|
|
82342
|
-
out.push(` ${
|
|
82343
|
-
out.push(` ${
|
|
82344
|
-
out.push(` ${
|
|
82785
|
+
out.push(` ${import_picocolors54.default.cyan("benchmark hydrate")} ${import_picocolors54.default.dim("--spec <path> --result <path> --json")}`);
|
|
82786
|
+
out.push(` ${import_picocolors54.default.cyan("benchmark evaluate")} ${import_picocolors54.default.dim("--spec <path> --result <path> --json")}`);
|
|
82787
|
+
out.push(` ${import_picocolors54.default.cyan("benchmark capabilities")} ${import_picocolors54.default.dim("--json")}`);
|
|
82345
82788
|
out.push("");
|
|
82346
82789
|
out.push(divider("ORCHESTRATIONS"));
|
|
82347
82790
|
out.push("");
|
|
82348
|
-
out.push(` ${
|
|
82349
|
-
out.push(` ${
|
|
82350
|
-
out.push(` ${
|
|
82351
|
-
out.push(` ${
|
|
82352
|
-
out.push(` ${
|
|
82791
|
+
out.push(` ${import_picocolors54.default.cyan("orchestration create")} ${import_picocolors54.default.dim("claim a local orchestration manifest and create it in the cloud")}`);
|
|
82792
|
+
out.push(` ${import_picocolors54.default.cyan("orchestration list")} ${import_picocolors54.default.dim("list orchestrations under a team")}`);
|
|
82793
|
+
out.push(` ${import_picocolors54.default.cyan("orchestration pull")} ${import_picocolors54.default.dim("<id>")} ${import_picocolors54.default.dim("recursively fetch an orchestration + every member agent")}`);
|
|
82794
|
+
out.push(` ${import_picocolors54.default.cyan("orchestration push")} ${import_picocolors54.default.dim("recursively push each member, then update the graph")}`);
|
|
82795
|
+
out.push(` ${import_picocolors54.default.cyan("orchestration status")} ${import_picocolors54.default.dim("show what would push and what would pull")}`);
|
|
82353
82796
|
out.push("");
|
|
82354
82797
|
out.push(divider("TEMPLATES"));
|
|
82355
82798
|
out.push("");
|
|
82356
|
-
out.push(` ${
|
|
82357
|
-
out.push(` ${
|
|
82358
|
-
out.push(` ${
|
|
82359
|
-
out.push(` ${
|
|
82360
|
-
out.push(` ${
|
|
82361
|
-
out.push(` ${
|
|
82362
|
-
out.push(` ${
|
|
82799
|
+
out.push(` ${import_picocolors54.default.cyan("template pack")} ${import_picocolors54.default.dim("bundle the current agent into a template")}`);
|
|
82800
|
+
out.push(` ${import_picocolors54.default.cyan("template publish")} ${import_picocolors54.default.dim("upload a template to the registry")}`);
|
|
82801
|
+
out.push(` ${import_picocolors54.default.cyan("template search")} ${import_picocolors54.default.dim("[query]")} ${import_picocolors54.default.dim("search the registry")}`);
|
|
82802
|
+
out.push(` ${import_picocolors54.default.cyan("template info")} ${import_picocolors54.default.dim("<creator/slug>")} ${import_picocolors54.default.dim("show registry details for a template")}`);
|
|
82803
|
+
out.push(` ${import_picocolors54.default.cyan("template onboard")} ${import_picocolors54.default.dim("<creator/slug>")} ${import_picocolors54.default.dim("install (or refresh) a template")}`);
|
|
82804
|
+
out.push(` ${import_picocolors54.default.cyan("template list")} ${import_picocolors54.default.dim("show installed templates")}`);
|
|
82805
|
+
out.push(` ${import_picocolors54.default.cyan("template remove")} ${import_picocolors54.default.dim("<creator/slug>")} ${import_picocolors54.default.dim("uninstall a template")}`);
|
|
82363
82806
|
out.push("");
|
|
82364
82807
|
out.push(divider("SKILLS"));
|
|
82365
82808
|
out.push("");
|
|
82366
|
-
out.push(` ${
|
|
82367
|
-
out.push(` ${
|
|
82368
|
-
out.push(` ${
|
|
82369
|
-
out.push(` ${
|
|
82370
|
-
out.push(` ${
|
|
82371
|
-
out.push(` ${
|
|
82372
|
-
out.push(` ${
|
|
82809
|
+
out.push(` ${import_picocolors54.default.cyan("skill add")} ${import_picocolors54.default.dim("<source>")} ${import_picocolors54.default.dim("install a skill (github / git / brainbase)")}`);
|
|
82810
|
+
out.push(` ${import_picocolors54.default.cyan("skill list")} ${import_picocolors54.default.dim("show locally installed skills + their source")}`);
|
|
82811
|
+
out.push(` ${import_picocolors54.default.cyan("skill update")} ${import_picocolors54.default.dim("<slug>")} ${import_picocolors54.default.dim("re-fetch a skill from its recorded source")}`);
|
|
82812
|
+
out.push(` ${import_picocolors54.default.cyan("skill remove")} ${import_picocolors54.default.dim("<slug>")} ${import_picocolors54.default.dim("uninstall a skill")}`);
|
|
82813
|
+
out.push(` ${import_picocolors54.default.cyan("skill search")} ${import_picocolors54.default.dim("[query]")} ${import_picocolors54.default.dim("search the brainbase skill registry")}`);
|
|
82814
|
+
out.push(` ${import_picocolors54.default.cyan("skill info")} ${import_picocolors54.default.dim("<creator/slug>")} ${import_picocolors54.default.dim("show registry details for a skill")}`);
|
|
82815
|
+
out.push(` ${import_picocolors54.default.cyan("skill publish")} ${import_picocolors54.default.dim("[dir]")} ${import_picocolors54.default.dim("publish a SKILL.md folder (defaults to .)")}`);
|
|
82373
82816
|
out.push("");
|
|
82374
82817
|
out.push(divider("CLI TOKENS"));
|
|
82375
82818
|
out.push("");
|
|
82376
|
-
out.push(` ${
|
|
82377
|
-
out.push(` ${
|
|
82378
|
-
out.push(` ${
|
|
82379
|
-
out.push(` ${
|
|
82819
|
+
out.push(` ${import_picocolors54.default.cyan("token create")} ${import_picocolors54.default.dim("issue a long-lived CLI key for CI / scripts")}`);
|
|
82820
|
+
out.push(` ${import_picocolors54.default.cyan("token list")} ${import_picocolors54.default.dim("show your tokens")}`);
|
|
82821
|
+
out.push(` ${import_picocolors54.default.cyan("token rename")} ${import_picocolors54.default.dim("<id>")} ${import_picocolors54.default.dim("relabel a token")}`);
|
|
82822
|
+
out.push(` ${import_picocolors54.default.cyan("token revoke")} ${import_picocolors54.default.dim("<id>")} ${import_picocolors54.default.dim("revoke a token")}`);
|
|
82380
82823
|
out.push("");
|
|
82381
82824
|
out.push(divider("MCP"));
|
|
82382
82825
|
out.push("");
|
|
82383
|
-
out.push(` ${
|
|
82384
|
-
out.push(` ${
|
|
82826
|
+
out.push(` ${import_picocolors54.default.cyan("mcp check")} ${import_picocolors54.default.dim("[--json]")} ${import_picocolors54.default.dim("verify MCP server connectivity through the brainbase proxy (runs at sandbox bootstrap)")}`);
|
|
82827
|
+
out.push(` ${import_picocolors54.default.cyan("mcp list")} ${import_picocolors54.default.dim("[--json]")} ${import_picocolors54.default.dim("show configured servers with OAuth state and expiry")}`);
|
|
82385
82828
|
out.push("");
|
|
82386
82829
|
out.push(divider("FLAGS"));
|
|
82387
82830
|
out.push("");
|
|
82388
|
-
out.push(` ${
|
|
82389
|
-
out.push(` ${
|
|
82390
|
-
out.push(` ${
|
|
82391
|
-
out.push(` ${
|
|
82392
|
-
out.push(` ${
|
|
82393
|
-
out.push(` ${
|
|
82394
|
-
out.push(` ${
|
|
82395
|
-
out.push(` ${
|
|
82396
|
-
out.push(` ${
|
|
82397
|
-
out.push(` ${
|
|
82398
|
-
out.push(` ${
|
|
82399
|
-
out.push(` ${
|
|
82400
|
-
out.push(` ${
|
|
82401
|
-
out.push(` ${
|
|
82402
|
-
out.push(` ${
|
|
82403
|
-
out.push(` ${
|
|
82404
|
-
out.push(` ${
|
|
82405
|
-
out.push(` ${
|
|
82406
|
-
out.push(` ${
|
|
82407
|
-
out.push(` ${
|
|
82831
|
+
out.push(` ${import_picocolors54.default.dim("--harness <id>")} force harness for onboard / sync (e.g. claude-code)`);
|
|
82832
|
+
out.push(` ${import_picocolors54.default.dim("--scope <s>")} force scope: global | project`);
|
|
82833
|
+
out.push(` ${import_picocolors54.default.dim("--yes, -y")} skip confirmations / auto-overwrite`);
|
|
82834
|
+
out.push(` ${import_picocolors54.default.dim("--agent <id>")} for link/task create: use this agent id explicitly`);
|
|
82835
|
+
out.push(` ${import_picocolors54.default.dim("--message <text>")} for task create: required first user message`);
|
|
82836
|
+
out.push(` ${import_picocolors54.default.dim("--title <text>")} for task create: optional task title`);
|
|
82837
|
+
out.push(` ${import_picocolors54.default.dim("--model <id>")} for task create: optional model override`);
|
|
82838
|
+
out.push(` ${import_picocolors54.default.dim("--org <id-or-slug>")} pick the organization (team/agent list, agent create, orchestration create/list)`);
|
|
82839
|
+
out.push(` ${import_picocolors54.default.dim("--team <id>")} pick the team, same commands (works without --org)`);
|
|
82840
|
+
out.push(` ${import_picocolors54.default.dim("--json")} machine-readable output for supported commands`);
|
|
82841
|
+
out.push(` ${import_picocolors54.default.dim("--no-tracking")} for link: skip routing LLM traffic through brainbase`);
|
|
82842
|
+
out.push(` ${import_picocolors54.default.dim("--track")} for agent create: enable tracking non-interactively (off without a TTY)`);
|
|
82843
|
+
out.push(` ${import_picocolors54.default.dim("--shell <sh|fish>")} for agent env: pick output format (auto-detected from $SHELL)`);
|
|
82844
|
+
out.push(` ${import_picocolors54.default.dim("--bot-token <t>")} for agent connect slack (or BRAINBASE_SLACK_BOT_TOKEN, or stdin)`);
|
|
82845
|
+
out.push(` ${import_picocolors54.default.dim("--signing-secret <s>")} for agent connect slack (or BRAINBASE_SLACK_SIGNING_SECRET, or stdin)`);
|
|
82846
|
+
out.push(` ${import_picocolors54.default.dim("--bot-name <name>")} for agent connect meeting: the bot's display name`);
|
|
82847
|
+
out.push(` ${import_picocolors54.default.dim("--full")} for agent init: write a commented template covering every block`);
|
|
82848
|
+
out.push(` ${import_picocolors54.default.dim("--minimal")} for agent init: write the starter manifest (the default)`);
|
|
82849
|
+
out.push(` ${import_picocolors54.default.dim("--all")} for template list: include installs from other folders`);
|
|
82850
|
+
out.push(` ${import_picocolors54.default.dim("--web <url>")} for login: web app URL (default https://app.brainbaselabs.com)`);
|
|
82408
82851
|
out.push("");
|
|
82409
82852
|
out.push(divider("ENV"));
|
|
82410
82853
|
out.push("");
|
|
82411
|
-
out.push(` ${
|
|
82412
|
-
out.push(` ${
|
|
82413
|
-
out.push(` ${
|
|
82414
|
-
out.push(` ${
|
|
82415
|
-
out.push(` ${
|
|
82416
|
-
out.push(` ${
|
|
82417
|
-
out.push(` ${
|
|
82418
|
-
out.push(` ${
|
|
82419
|
-
out.push(` ${
|
|
82420
|
-
out.push(` ${
|
|
82421
|
-
out.push(` ${
|
|
82854
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_HOME")} override the local config dir (default ~/.brainbase)`);
|
|
82855
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_DEBUG")} print full stack traces on error (any value; unset to disable)`);
|
|
82856
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_WEB_URL")} override the web app URL used by login`);
|
|
82857
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_CONTROL_PLANE_URL")} override the MAS host (/v2/cli; task create uses /v2/tasks)`);
|
|
82858
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_API_URL")} legacy KLS host override (uses /api/cli; proxy/registry fallback)`);
|
|
82859
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_PROXY_URL")} override the model-proxy URL used by harness traffic (default https://api.v1.brainbaselabs.com)`);
|
|
82860
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_REGISTRY_URL")} override the registry API URL (default https://api.v1.brainbaselabs.com)`);
|
|
82861
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_TOKEN")} long-lived CLI PAT; the only PAT control-plane commands accept (token.json is not read there)`);
|
|
82862
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_SKIP_AUTH")} bypass the auth gate for development`);
|
|
82863
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_NON_INTERACTIVE")} force non-interactive mode — skip/auto-default prompts (CI & agents)`);
|
|
82864
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_RUN_ENTRYPOINT")} =1 → agent pull executes the agent entrypoint (sandbox boots; or pass --run-entrypoint)`);
|
|
82422
82865
|
out.push("");
|
|
82423
|
-
out.push(` ${
|
|
82424
|
-
out.push(` ${
|
|
82425
|
-
out.push(` ${
|
|
82426
|
-
out.push(` ${
|
|
82427
|
-
out.push(` ${
|
|
82428
|
-
out.push(` ${
|
|
82866
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_MEMORY_MCP_URL")} override the built-in memory MCP host`);
|
|
82867
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_BROWSER_MCP_URL")} override the built-in browser MCP host`);
|
|
82868
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_SLACK_MCP_URL")} override the built-in Slack MCP host`);
|
|
82869
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_MEETING_MCP_URL")} override the built-in meeting MCP host`);
|
|
82870
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_GITHUB_MCP_URL")} override the built-in GitHub MCP host`);
|
|
82871
|
+
out.push(` ${import_picocolors54.default.dim("BRAINBASE_ORCHESTRATION_MCP_URL")} override the built-in orchestration MCP host`);
|
|
82429
82872
|
out.push("");
|
|
82430
82873
|
out.push(divider("HARNESSES"));
|
|
82431
82874
|
out.push("");
|
|
82432
|
-
out.push(` ${
|
|
82433
|
-
out.push(` ${
|
|
82434
|
-
out.push(` ${
|
|
82875
|
+
out.push(` ${import_picocolors54.default.dim("•")} ${import_picocolors54.default.bold("claude-code")} ${import_picocolors54.default.dim("skills, mcps, agents, commands, playbooks, instructions, files")}`);
|
|
82876
|
+
out.push(` ${import_picocolors54.default.dim("•")} ${import_picocolors54.default.bold("codex")} ${import_picocolors54.default.dim("skills, mcps, commands, playbooks, instructions, files")}`);
|
|
82877
|
+
out.push(` ${import_picocolors54.default.dim("•")} ${import_picocolors54.default.bold("kafka")} ${import_picocolors54.default.dim("skills, mcps, agents, commands, playbooks, instructions, files")}`);
|
|
82435
82878
|
out.push("");
|
|
82436
82879
|
console.log(out.join(`
|
|
82437
82880
|
`));
|
|
@@ -82462,7 +82905,9 @@ var VALUE_TAKING_FLAGS = new Set([
|
|
|
82462
82905
|
"--app-id",
|
|
82463
82906
|
"--app-name",
|
|
82464
82907
|
"--bot-name",
|
|
82465
|
-
"--bot-image-url"
|
|
82908
|
+
"--bot-image-url",
|
|
82909
|
+
"--task-id",
|
|
82910
|
+
"--limit"
|
|
82466
82911
|
]);
|
|
82467
82912
|
function isValueOfPriorFlag2(args, index) {
|
|
82468
82913
|
return index > 0 && VALUE_TAKING_FLAGS.has(args[index - 1]);
|
|
@@ -82583,13 +83028,13 @@ async function requireAuth(cmd) {
|
|
|
82583
83028
|
if (STORED_PAT_COMMANDS.has(cmd) && readToken())
|
|
82584
83029
|
return;
|
|
82585
83030
|
console.error("");
|
|
82586
|
-
console.error(` ${brandTint("◆")} ${
|
|
83031
|
+
console.error(` ${brandTint("◆")} ${import_picocolors54.default.bold("brainbase")}`);
|
|
82587
83032
|
console.error("");
|
|
82588
|
-
console.error(` ${
|
|
83033
|
+
console.error(` ${import_picocolors54.default.red("✗")} You need to sign in to use ${import_picocolors54.default.bold("brainbase " + cmd)}.`);
|
|
82589
83034
|
if (status.reason)
|
|
82590
|
-
console.error(` ${
|
|
83035
|
+
console.error(` ${import_picocolors54.default.dim(status.reason)}`);
|
|
82591
83036
|
console.error("");
|
|
82592
|
-
console.error(` Run ${
|
|
83037
|
+
console.error(` Run ${import_picocolors54.default.cyan("brainbase login")} to connect this device.`);
|
|
82593
83038
|
console.error("");
|
|
82594
83039
|
process14.exit(1);
|
|
82595
83040
|
}
|
|
@@ -82656,6 +83101,11 @@ async function main() {
|
|
|
82656
83101
|
const appNameFlag = getFlag(sharedArgs, "--app-name");
|
|
82657
83102
|
const botNameFlag = getFlag(sharedArgs, "--bot-name");
|
|
82658
83103
|
const botImageUrlFlag = getFlag(sharedArgs, "--bot-image-url");
|
|
83104
|
+
const taskIdFlag = getFlag(sharedArgs, "--task-id");
|
|
83105
|
+
const limitRaw = getFlag(sharedArgs, "--limit");
|
|
83106
|
+
const limitParsed = limitRaw === undefined ? NaN : Number(limitRaw);
|
|
83107
|
+
const limitFlag = Number.isInteger(limitParsed) && limitParsed >= 1 && limitParsed <= 200 ? limitParsed : undefined;
|
|
83108
|
+
const archivedFlag = hasFlag2(sharedArgs, "--archived");
|
|
82659
83109
|
ensureSkillResolversRegistered();
|
|
82660
83110
|
await requireAuth(cmd);
|
|
82661
83111
|
try {
|
|
@@ -82747,7 +83197,10 @@ async function main() {
|
|
|
82747
83197
|
appId: appIdFlag,
|
|
82748
83198
|
appName: appNameFlag,
|
|
82749
83199
|
botName: botNameFlag,
|
|
82750
|
-
botImageUrl: botImageUrlFlag
|
|
83200
|
+
botImageUrl: botImageUrlFlag,
|
|
83201
|
+
taskId: taskIdFlag,
|
|
83202
|
+
limit: limitFlag,
|
|
83203
|
+
archived: archivedFlag
|
|
82751
83204
|
});
|
|
82752
83205
|
break;
|
|
82753
83206
|
}
|
|
@@ -82806,10 +83259,10 @@ async function main() {
|
|
|
82806
83259
|
process14.exit(1);
|
|
82807
83260
|
}
|
|
82808
83261
|
} catch (err) {
|
|
82809
|
-
console.error(
|
|
83262
|
+
console.error(import_picocolors54.default.red(`
|
|
82810
83263
|
${err.message}`));
|
|
82811
83264
|
if (err instanceof ApiError && err.status === 401) {
|
|
82812
|
-
console.error(` Run ${
|
|
83265
|
+
console.error(` Run ${import_picocolors54.default.cyan("brainbase login")} to connect this device.`);
|
|
82813
83266
|
}
|
|
82814
83267
|
if (process14.env.BRAINBASE_DEBUG)
|
|
82815
83268
|
console.error(err.stack);
|