@brainbase-labs/cli 0.10.1 → 0.11.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 +23 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29449,7 +29449,7 @@ function padStart(s, n) {
|
|
|
29449
29449
|
// package.json
|
|
29450
29450
|
var package_default = {
|
|
29451
29451
|
name: "@brainbase-labs/cli",
|
|
29452
|
-
version: "0.
|
|
29452
|
+
version: "0.11.0",
|
|
29453
29453
|
description: "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
|
|
29454
29454
|
type: "module",
|
|
29455
29455
|
bin: {
|
|
@@ -52792,6 +52792,14 @@ function diffSecrets(local, cloud) {
|
|
|
52792
52792
|
};
|
|
52793
52793
|
}
|
|
52794
52794
|
|
|
52795
|
+
// src/core/entrypoint-gate.ts
|
|
52796
|
+
function entrypointExecutionAllowed(opts) {
|
|
52797
|
+
if (opts.flag)
|
|
52798
|
+
return true;
|
|
52799
|
+
const v3 = (opts.env.BRAINBASE_RUN_ENTRYPOINT ?? "").trim().toLowerCase();
|
|
52800
|
+
return v3 === "1" || v3 === "true";
|
|
52801
|
+
}
|
|
52802
|
+
|
|
52795
52803
|
// src/cli/agent-pull.ts
|
|
52796
52804
|
async function runAgentPull(cwd2, args) {
|
|
52797
52805
|
banner("agent pull — bring cloud changes into this folder");
|
|
@@ -53007,7 +53015,7 @@ async function runAgentPull(cwd2, args) {
|
|
|
53007
53015
|
};
|
|
53008
53016
|
writeSyncState(cwd2, newState);
|
|
53009
53017
|
await pullSecrets(cwd2, agentId);
|
|
53010
|
-
await runEntrypointIfPresent(cwd2, yaml);
|
|
53018
|
+
await runEntrypointIfPresent(cwd2, yaml, entrypointExecutionAllowed({ flag: args.runEntrypoint, env: process.env }));
|
|
53011
53019
|
$e(`Pulled ${cloudAgent.name} at revision ${cloud.revision}.`);
|
|
53012
53020
|
} finally {
|
|
53013
53021
|
try {
|
|
@@ -53326,7 +53334,7 @@ function buildLinkFromAgent(agent, harness, prev) {
|
|
|
53326
53334
|
tracking: prev?.tracking
|
|
53327
53335
|
};
|
|
53328
53336
|
}
|
|
53329
|
-
async function runEntrypointIfPresent(cwd2, manifest) {
|
|
53337
|
+
async function runEntrypointIfPresent(cwd2, manifest, execute) {
|
|
53330
53338
|
if (!manifest.entrypoint)
|
|
53331
53339
|
return;
|
|
53332
53340
|
const body = resolveEntrypoint(cwd2, manifest);
|
|
@@ -53340,6 +53348,10 @@ async function runEntrypointIfPresent(cwd2, manifest) {
|
|
|
53340
53348
|
try {
|
|
53341
53349
|
fs45.chmodSync(scriptPath, 493);
|
|
53342
53350
|
} catch {}
|
|
53351
|
+
if (!execute) {
|
|
53352
|
+
f2.info(`Agent has an entrypoint — written to ${import_picocolors25.default.dim(path48.relative(cwd2, scriptPath))}, not executed. ` + `Run it with ${import_picocolors25.default.cyan("brainbase run bash .brainbase/entrypoint.sh")} or re-pull with ${import_picocolors25.default.cyan("--run-entrypoint")}. Sandboxes run it automatically.`);
|
|
53353
|
+
return;
|
|
53354
|
+
}
|
|
53343
53355
|
f2.info(`Running entrypoint ${import_picocolors25.default.dim(`(${path48.relative(cwd2, scriptPath)})`)}`);
|
|
53344
53356
|
const secrets = readLocalSecrets(cwd2);
|
|
53345
53357
|
const env3 = { ...process.env, ...secrets };
|
|
@@ -54811,7 +54823,8 @@ async function runAgent(cwd2, sub, args, opts) {
|
|
|
54811
54823
|
yes: opts.yes,
|
|
54812
54824
|
scope: opts.scope,
|
|
54813
54825
|
agentIdArg: args[0],
|
|
54814
|
-
force: opts.force
|
|
54826
|
+
force: opts.force,
|
|
54827
|
+
runEntrypoint: opts.runEntrypoint
|
|
54815
54828
|
});
|
|
54816
54829
|
return;
|
|
54817
54830
|
case "push":
|
|
@@ -54849,7 +54862,7 @@ function printHelp() {
|
|
|
54849
54862
|
out.push(` ${import_picocolors32.default.bold("brainbase agent")} ${import_picocolors32.default.dim("<sub> [options]")}`);
|
|
54850
54863
|
out.push("");
|
|
54851
54864
|
out.push(` ${import_picocolors32.default.cyan("create")} ${import_picocolors32.default.dim("claim an unclaimed brainbase.agent.yaml and create the cloud agent")}`);
|
|
54852
|
-
out.push(` ${import_picocolors32.default.cyan("pull")} ${import_picocolors32.default.dim("[<id>]")} ${import_picocolors32.default.dim("apply cloud changes into this folder — pass <id> to switch (--force to override)")}`);
|
|
54865
|
+
out.push(` ${import_picocolors32.default.cyan("pull")} ${import_picocolors32.default.dim("[<id>]")} ${import_picocolors32.default.dim("apply cloud changes into this folder — pass <id> to switch (--force to override); --run-entrypoint to also execute the agent entrypoint")}`);
|
|
54853
54866
|
out.push(` ${import_picocolors32.default.cyan("push")} ${import_picocolors32.default.dim("send local changes to the cloud")}`);
|
|
54854
54867
|
out.push(` ${import_picocolors32.default.cyan("unpack")} ${import_picocolors32.default.dim("install the claimed agent into a harness layout (--harness to override)")}`);
|
|
54855
54868
|
out.push(` ${import_picocolors32.default.cyan("status")} ${import_picocolors32.default.dim("show what would push and what would pull")}`);
|
|
@@ -56782,7 +56795,7 @@ function help() {
|
|
|
56782
56795
|
out.push(divider("LINKED AGENT"));
|
|
56783
56796
|
out.push("");
|
|
56784
56797
|
out.push(` ${import_picocolors41.default.cyan("agent create")} ${import_picocolors41.default.dim("claim an unclaimed brainbase.agent.yaml and create the cloud agent")}`);
|
|
56785
|
-
out.push(` ${import_picocolors41.default.cyan("agent pull")} ${import_picocolors41.default.dim("[<id>]")} ${import_picocolors41.default.dim("bring cloud changes into this folder (--force to override)")}`);
|
|
56798
|
+
out.push(` ${import_picocolors41.default.cyan("agent pull")} ${import_picocolors41.default.dim("[<id>]")} ${import_picocolors41.default.dim("bring cloud changes into this folder (--force to override; --run-entrypoint to also execute the agent entrypoint)")}`);
|
|
56786
56799
|
out.push(` ${import_picocolors41.default.cyan("agent push")} ${import_picocolors41.default.dim("send local changes to the cloud")}`);
|
|
56787
56800
|
out.push(` ${import_picocolors41.default.cyan("agent unpack")} ${import_picocolors41.default.dim("install the claimed agent into a harness layout")}`);
|
|
56788
56801
|
out.push(` ${import_picocolors41.default.cyan("link")} ${import_picocolors41.default.dim("attach this folder to an existing agent")}`);
|
|
@@ -56846,6 +56859,7 @@ function help() {
|
|
|
56846
56859
|
out.push(` ${import_picocolors41.default.dim("BRAINBASE_TOKEN")} long-lived CLI PAT (overrides token.json)`);
|
|
56847
56860
|
out.push(` ${import_picocolors41.default.dim("BRAINBASE_SKIP_AUTH")} bypass the auth gate for development`);
|
|
56848
56861
|
out.push(` ${import_picocolors41.default.dim("BRAINBASE_NON_INTERACTIVE")} force non-interactive mode — skip/auto-default prompts (CI & agents)`);
|
|
56862
|
+
out.push(` ${import_picocolors41.default.dim("BRAINBASE_RUN_ENTRYPOINT")} =1 → agent pull executes the agent entrypoint (sandbox boots; or pass --run-entrypoint)`);
|
|
56849
56863
|
out.push("");
|
|
56850
56864
|
out.push(divider("HARNESSES"));
|
|
56851
56865
|
out.push("");
|
|
@@ -56950,6 +56964,7 @@ async function main() {
|
|
|
56950
56964
|
const noTracking = hasFlag2(argv, "--no-tracking");
|
|
56951
56965
|
const track = hasFlag2(argv, "--track");
|
|
56952
56966
|
const forceFlag = hasFlag2(argv, "--force");
|
|
56967
|
+
const runEntrypointFlag = hasFlag2(argv, "--run-entrypoint");
|
|
56953
56968
|
const graphOnlyFlag = hasFlag2(argv, "--graph-only");
|
|
56954
56969
|
const nameFlag = getFlag(argv, "--name");
|
|
56955
56970
|
const skillVersionFlag = getFlag(argv, "--skill-version");
|
|
@@ -57041,7 +57056,8 @@ async function main() {
|
|
|
57041
57056
|
teamId: teamIdFlag,
|
|
57042
57057
|
noTracking,
|
|
57043
57058
|
track,
|
|
57044
|
-
force: forceFlag
|
|
57059
|
+
force: forceFlag,
|
|
57060
|
+
runEntrypoint: runEntrypointFlag
|
|
57045
57061
|
});
|
|
57046
57062
|
break;
|
|
57047
57063
|
}
|