@brainbase-labs/cli 0.20.0 → 0.21.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.
Files changed (2) hide show
  1. package/dist/index.js +76 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -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.20.0",
36011
+ version: "0.21.0",
36012
36012
  description: "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
36013
36013
  type: "module",
36014
36014
  bin: {
@@ -61679,6 +61679,20 @@ var DEFAULT_INSTRUCTIONS_FILE = ".brainbase/instructions.md";
61679
61679
  var DEFAULT_ENTRYPOINT_FILE = ".brainbase/entrypoint.sh";
61680
61680
  var DEFAULT_PLAYBOOKS_DIR = ".brainbase/playbooks";
61681
61681
  var REGISTRY_SOURCE_RE = /^registry:(?:([a-z0-9_-]+)\/)?([a-z0-9_-]+)(?:@(.+))?$/i;
61682
+ var EXACT_VERSION_RE = /^\d+\.\d+\.\d+$/;
61683
+ function skillSourceVersionError(raw) {
61684
+ const m3 = raw.match(REGISTRY_SOURCE_RE);
61685
+ if (!m3) {
61686
+ if (!/^registry:/i.test(raw))
61687
+ return null;
61688
+ return `"${raw}" is not a valid registry source — expected ` + `"registry:creator/slug" or "registry:creator/slug@1.0.0".`;
61689
+ }
61690
+ const version = m3[3];
61691
+ if (!version || EXACT_VERSION_RE.test(version))
61692
+ return null;
61693
+ const head3 = m3[1] ? `${m3[1]}/${m3[2]}` : m3[2];
61694
+ return `"@${version}" is not supported — pin an exact version, e.g. ` + `"registry:${head3}@1.0.0", or drop the version to track the latest.`;
61695
+ }
61682
61696
  function parseSkillSource2(raw) {
61683
61697
  if (!raw || typeof raw !== "string") {
61684
61698
  throw new Error("Skill source must be a non-empty string");
@@ -61734,7 +61748,11 @@ var PlaybookSchema = exports_external.object({
61734
61748
  content: PlaybookContentSchema
61735
61749
  });
61736
61750
  var SkillEntrySchema = exports_external.object({
61737
- source: exports_external.string().min(1)
61751
+ source: exports_external.string().min(1).superRefine((raw, ctx) => {
61752
+ const message = skillSourceVersionError(raw);
61753
+ if (message)
61754
+ ctx.addIssue({ code: exports_external.ZodIssueCode.custom, message });
61755
+ })
61738
61756
  });
61739
61757
  var McpEntrySchema = exports_external.object({
61740
61758
  name: exports_external.string().min(1),
@@ -62938,6 +62956,7 @@ async function runSync(cwd2, args) {
62938
62956
  caps = capabilitiesFromManifest(readManifest(cwd2));
62939
62957
  } catch (err) {
62940
62958
  f2.error(err.message);
62959
+ process.exitCode = 1;
62941
62960
  return;
62942
62961
  }
62943
62962
  const declaredMcpSlugs = new Set(manifest.components.filter((c2) => c2.type === "mcp").map((c2) => c2.slug));
@@ -63697,6 +63716,7 @@ async function runAgentUnpack(cwd2, args) {
63697
63716
  manifest = readManifest(cwd2);
63698
63717
  } catch (err) {
63699
63718
  f2.error(err.message);
63719
+ process.exitCode = 1;
63700
63720
  return;
63701
63721
  }
63702
63722
  if (!manifest.id) {
@@ -64251,6 +64271,7 @@ function resolveTargetAgentId(cwd2, args) {
64251
64271
  manifest = hasManifest(cwd2) ? readManifest(cwd2) : null;
64252
64272
  } catch (err) {
64253
64273
  f2.error(err.message);
64274
+ process.exitCode = 1;
64254
64275
  return null;
64255
64276
  }
64256
64277
  const manifestId = manifest?.id;
@@ -64835,6 +64856,7 @@ async function runAgentPush(cwd2, args) {
64835
64856
  manifest = readManifest(cwd2);
64836
64857
  } catch (err) {
64837
64858
  f2.error(err.message);
64859
+ process.exitCode = 1;
64838
64860
  return;
64839
64861
  }
64840
64862
  if (!manifest.id) {
@@ -65388,13 +65410,27 @@ async function runAgentStatus(cwd2) {
65388
65410
  break;
65389
65411
  }
65390
65412
  }
65413
+ let secretDrift = {
65414
+ localOnly: [],
65415
+ cloudOnly: [],
65416
+ changed: []
65417
+ };
65418
+ try {
65419
+ const localSecrets = readLocalSecrets(cwd2);
65420
+ const cloudRes = await api.getAgentSecrets(link2.agent_id);
65421
+ secretDrift = diffSecrets(localSecrets, cloudRes.secrets ?? {});
65422
+ } catch {}
65423
+ const componentsDrifted = conflicts.length > 0 || toPush.length > 0 || toPull.length > 0;
65424
+ const metaDrifted = meta.localChanged || meta.cloudChanged;
65425
+ const configDrifted = config.unsupported.length > 0 || config.machineMismatch || config.machineCloudChanged || config.defaultModelLocalChanged || config.defaultModelCloudChanged;
65426
+ const secretsDrifted = secretDrift.localOnly.length > 0 || secretDrift.cloudOnly.length > 0 || secretDrift.changed.length > 0;
65391
65427
  const lines = [];
65392
65428
  lines.push("");
65393
65429
  lines.push(` ${import_picocolors29.default.bold(link2.name)} ${import_picocolors29.default.dim(`(${link2.slug})`)}`);
65394
65430
  lines.push(` ${import_picocolors29.default.dim("agent_id")} ${link2.agent_id}`);
65395
65431
  lines.push(` ${import_picocolors29.default.dim("revision")} cloud ${cloud.revision}${lock ? ` · lock ${lock.revision}` : " · never pulled"}`);
65396
65432
  lines.push("");
65397
- if (meta.localChanged || meta.cloudChanged) {
65433
+ if (metaDrifted) {
65398
65434
  lines.push(` ${import_picocolors29.default.bold("agent metadata")}`);
65399
65435
  if (meta.localChanged) {
65400
65436
  lines.push(` ${import_picocolors29.default.yellow("→ push")} name/tagline edited in brainbase.agent.yaml`);
@@ -65404,7 +65440,7 @@ async function runAgentStatus(cwd2) {
65404
65440
  }
65405
65441
  lines.push("");
65406
65442
  }
65407
- if (config.unsupported.length > 0 || config.machineMismatch || config.machineCloudChanged || config.defaultModelLocalChanged || config.defaultModelCloudChanged) {
65443
+ if (configDrifted) {
65408
65444
  lines.push(` ${import_picocolors29.default.bold("runtime config")}`);
65409
65445
  if (config.unsupported.length > 0) {
65410
65446
  lines.push(` ${import_picocolors29.default.red("! unsupported")} ${config.unsupported.join(", ")} not exposed by this control plane`);
@@ -65427,23 +65463,17 @@ async function runAgentStatus(cwd2) {
65427
65463
  }
65428
65464
  lines.push("");
65429
65465
  }
65430
- try {
65431
- const localSecrets = readLocalSecrets(cwd2);
65432
- const cloudRes = await api.getAgentSecrets(link2.agent_id);
65433
- const cloudSecrets = cloudRes.secrets ?? {};
65434
- const sd = diffSecrets(localSecrets, cloudSecrets);
65435
- if (sd.localOnly.length || sd.cloudOnly.length || sd.changed.length) {
65436
- lines.push(` ${import_picocolors29.default.bold("secrets")}`);
65437
- if (sd.localOnly.length)
65438
- lines.push(` ${import_picocolors29.default.yellow("→ push")} new locally: ${sd.localOnly.join(", ")}`);
65439
- if (sd.changed.length)
65440
- lines.push(` ${import_picocolors29.default.yellow("→ push")} values changed: ${sd.changed.join(", ")}`);
65441
- if (sd.cloudOnly.length)
65442
- lines.push(` ${import_picocolors29.default.cyan("← pull")} new on cloud: ${sd.cloudOnly.join(", ")}`);
65443
- lines.push("");
65444
- }
65445
- } catch {}
65446
- if (conflicts.length === 0 && toPush.length === 0 && toPull.length === 0 && !meta.localChanged && !meta.cloudChanged && config.unsupported.length === 0 && !config.machineMismatch && !config.machineCloudChanged && !config.defaultModelLocalChanged && !config.defaultModelCloudChanged) {
65466
+ if (secretsDrifted) {
65467
+ lines.push(` ${import_picocolors29.default.bold("secrets")}`);
65468
+ if (secretDrift.localOnly.length)
65469
+ lines.push(` ${import_picocolors29.default.yellow("→ push")} new locally: ${secretDrift.localOnly.join(", ")}`);
65470
+ if (secretDrift.changed.length)
65471
+ lines.push(` ${import_picocolors29.default.yellow("→ push")} values changed: ${secretDrift.changed.join(", ")}`);
65472
+ if (secretDrift.cloudOnly.length)
65473
+ lines.push(` ${import_picocolors29.default.cyan("← pull")} new on cloud: ${secretDrift.cloudOnly.join(", ")}`);
65474
+ lines.push("");
65475
+ }
65476
+ if (!componentsDrifted && !metaDrifted && !configDrifted && !secretsDrifted) {
65447
65477
  lines.push(` ${import_picocolors29.default.green("✓")} everything is in sync`);
65448
65478
  lines.push("");
65449
65479
  console.log(lines.join(`
@@ -65982,6 +66012,7 @@ async function loadOrScaffoldManifest(cwd2, args) {
65982
66012
  return readManifest(cwd2);
65983
66013
  } catch (err) {
65984
66014
  f2.error(err.message);
66015
+ process.exitCode = 1;
65985
66016
  return null;
65986
66017
  }
65987
66018
  }
@@ -67777,15 +67808,11 @@ async function runRun(cwd2, args) {
67777
67808
 
67778
67809
  // src/cli/publish.ts
67779
67810
  var import_picocolors44 = __toESM(require_picocolors(), 1);
67780
- async function runPublish(cwd2, _args) {
67781
- banner("publish — send your changes to the team");
67782
- const link2 = readLink(cwd2);
67783
- if (!link2) {
67784
- f2.warn("This folder is not linked to any agent.");
67785
- f2.info(`Run ${import_picocolors44.default.cyan("brainbase link")} first.`);
67786
- return;
67787
- }
67788
- f2.info(`${import_picocolors44.default.bold("publish")} is coming soon — for now, edit the agent on the web app and run ${import_picocolors44.default.cyan("brainbase sync")} to bring changes here.`);
67811
+ function runPublish() {
67812
+ banner("publish — moved");
67813
+ f2.error(`${import_picocolors44.default.bold("brainbase publish")} does not exist.`);
67814
+ f2.info(`Use ${import_picocolors44.default.cyan("brainbase agent push")} to send your local changes to the cloud.`);
67815
+ process.exit(1);
67789
67816
  }
67790
67817
 
67791
67818
  // src/ui/ink/StatusCard.tsx
@@ -78979,16 +79006,17 @@ var PROTECTED = new Set([
78979
79006
  "link",
78980
79007
  "unlink",
78981
79008
  "sync",
78982
- "publish",
78983
79009
  "status",
78984
79010
  "token"
78985
79011
  ]);
78986
79012
  var STORED_PAT_COMMANDS = new Set([
78987
79013
  "template",
78988
79014
  "skill",
78989
- "publish",
78990
79015
  "token"
78991
79016
  ]);
79017
+ var SUBCOMMAND_OWNED_FLAGS = {
79018
+ token: ["--scope", "--name"]
79019
+ };
78992
79020
  function help() {
78993
79021
  const out = [];
78994
79022
  out.push("");
@@ -79092,6 +79120,7 @@ function help() {
79092
79120
  out.push(divider("ENV"));
79093
79121
  out.push("");
79094
79122
  out.push(` ${import_picocolors49.default.dim("BRAINBASE_HOME")} override the local config dir (default ~/.brainbase)`);
79123
+ out.push(` ${import_picocolors49.default.dim("BRAINBASE_DEBUG")} print full stack traces on error (any value; unset to disable)`);
79095
79124
  out.push(` ${import_picocolors49.default.dim("BRAINBASE_WEB_URL")} override the web app URL used by login`);
79096
79125
  out.push(` ${import_picocolors49.default.dim("BRAINBASE_CONTROL_PLANE_URL")} override the MAS host (/v2/cli; task create uses /v2/tasks)`);
79097
79126
  out.push(` ${import_picocolors49.default.dim("BRAINBASE_API_URL")} legacy KLS host override (uses /api/cli; proxy/registry fallback)`);
@@ -79102,6 +79131,13 @@ function help() {
79102
79131
  out.push(` ${import_picocolors49.default.dim("BRAINBASE_NON_INTERACTIVE")} force non-interactive mode — skip/auto-default prompts (CI & agents)`);
79103
79132
  out.push(` ${import_picocolors49.default.dim("BRAINBASE_RUN_ENTRYPOINT")} =1 → agent pull executes the agent entrypoint (sandbox boots; or pass --run-entrypoint)`);
79104
79133
  out.push("");
79134
+ out.push(` ${import_picocolors49.default.dim("BRAINBASE_MEMORY_MCP_URL")} override the built-in memory MCP host`);
79135
+ out.push(` ${import_picocolors49.default.dim("BRAINBASE_BROWSER_MCP_URL")} override the built-in browser MCP host`);
79136
+ out.push(` ${import_picocolors49.default.dim("BRAINBASE_SLACK_MCP_URL")} override the built-in Slack MCP host`);
79137
+ out.push(` ${import_picocolors49.default.dim("BRAINBASE_MEETING_MCP_URL")} override the built-in meeting MCP host`);
79138
+ out.push(` ${import_picocolors49.default.dim("BRAINBASE_GITHUB_MCP_URL")} override the built-in GitHub MCP host`);
79139
+ out.push(` ${import_picocolors49.default.dim("BRAINBASE_ORCHESTRATION_MCP_URL")} override the built-in orchestration MCP host`);
79140
+ out.push("");
79105
79141
  out.push(divider("HARNESSES"));
79106
79142
  out.push("");
79107
79143
  out.push(` ${import_picocolors49.default.dim("•")} ${import_picocolors49.default.bold("claude-code")} ${import_picocolors49.default.dim("skills, mcps, agents, commands, playbooks, instructions, files")}`);
@@ -79200,10 +79236,15 @@ async function main() {
79200
79236
  return;
79201
79237
  }
79202
79238
  const sharedArgs = cmd === "task" || cmd === "benchmark" ? [] : argv;
79239
+ const ownedFlags = new Set(SUBCOMMAND_OWNED_FLAGS[cmd] ?? []);
79240
+ const takeFlag = (...names) => {
79241
+ const consumable = names.filter((n) => !ownedFlags.has(n));
79242
+ return consumable.length > 0 ? getFlag(sharedArgs, ...consumable) : undefined;
79243
+ };
79203
79244
  const yes = hasFlag2(sharedArgs, "--yes", "-y");
79204
79245
  const all = hasFlag2(sharedArgs, "--all");
79205
79246
  const harness = getFlag(sharedArgs, "--harness");
79206
- const scopeFlag = getFlag(sharedArgs, "--scope");
79247
+ const scopeFlag = takeFlag("--scope");
79207
79248
  const web = getFlag(sharedArgs, "--web");
79208
79249
  const visibility = getFlag(sharedArgs, "--visibility");
79209
79250
  const category = getFlag(sharedArgs, "--category");
@@ -79218,7 +79259,7 @@ async function main() {
79218
79259
  const forceFlag = hasFlag2(sharedArgs, "--force");
79219
79260
  const runEntrypointFlag = hasFlag2(sharedArgs, "--run-entrypoint");
79220
79261
  const graphOnlyFlag = hasFlag2(sharedArgs, "--graph-only");
79221
- const nameFlag = getFlag(sharedArgs, "--name");
79262
+ const nameFlag = takeFlag("--name");
79222
79263
  const skillVersionFlag = getFlag(sharedArgs, "--skill-version");
79223
79264
  const taglineFlag = getFlag(sharedArgs, "--tagline");
79224
79265
  const orgIdFlag = getFlag(sharedArgs, "--org");
@@ -79352,7 +79393,7 @@ async function main() {
79352
79393
  break;
79353
79394
  }
79354
79395
  case "publish": {
79355
- await runPublish(cwd2, { yes });
79396
+ runPublish();
79356
79397
  break;
79357
79398
  }
79358
79399
  case "status": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainbase-labs/cli",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
5
5
  "type": "module",
6
6
  "bin": {