@brainbase-labs/cli 0.6.0 → 0.6.1
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 +27 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52553,6 +52553,7 @@ async function runAgentPull(cwd2, args) {
|
|
|
52553
52553
|
writeManifest(cwd2, yaml);
|
|
52554
52554
|
writeLink(cwd2, buildLinkFromAgent(cloudAgent, harness, readLink(cwd2)));
|
|
52555
52555
|
const lockComponents = buildLockComponents({
|
|
52556
|
+
cwd: cwd2,
|
|
52556
52557
|
cloud,
|
|
52557
52558
|
prevLock: lock,
|
|
52558
52559
|
justInstalledPaths,
|
|
@@ -52568,7 +52569,7 @@ async function runAgentPull(cwd2, args) {
|
|
|
52568
52569
|
agentMeta: {
|
|
52569
52570
|
name: cloudAgent.name,
|
|
52570
52571
|
tagline: cloudAgent.tagline,
|
|
52571
|
-
...cloudAgent.entrypoint ? { entrypoint: cloudAgent.entrypoint } : {}
|
|
52572
|
+
...cloudAgent.entrypoint ? { entrypoint: cloudAgent.entrypoint.trim() } : {}
|
|
52572
52573
|
}
|
|
52573
52574
|
};
|
|
52574
52575
|
writeSyncState(cwd2, newState);
|
|
@@ -52825,6 +52826,11 @@ function parseSourceLoose(raw) {
|
|
|
52825
52826
|
}
|
|
52826
52827
|
function buildLockComponents(input) {
|
|
52827
52828
|
const prevByKey = new Map((input.prevLock?.components ?? []).map((c2) => [`${c2.type}/${c2.slug}`, c2]));
|
|
52829
|
+
const localHashByKey = new Map;
|
|
52830
|
+
for (const lc of readLocalComponents(input.cwd, input.localManifest)) {
|
|
52831
|
+
if (lc.hash)
|
|
52832
|
+
localHashByKey.set(`${lc.type}/${lc.slug}`, lc.hash);
|
|
52833
|
+
}
|
|
52828
52834
|
const out = [];
|
|
52829
52835
|
for (const m3 of input.cloud.components) {
|
|
52830
52836
|
const key2 = `${m3.type}/${m3.slug}`;
|
|
@@ -52839,10 +52845,11 @@ function buildLockComponents(input) {
|
|
|
52839
52845
|
const parsed = parseSourceLoose(s3.source);
|
|
52840
52846
|
return parsed?.slug === m3.slug;
|
|
52841
52847
|
})?.source : undefined;
|
|
52848
|
+
const localHash = localHashByKey.get(key2);
|
|
52842
52849
|
out.push({
|
|
52843
52850
|
type: m3.type,
|
|
52844
52851
|
slug: m3.slug,
|
|
52845
|
-
hash: m3.hash,
|
|
52852
|
+
hash: localHash ?? m3.hash,
|
|
52846
52853
|
installedPaths: input.justInstalledPaths.get(key2) ?? prevByKey.get(key2)?.installedPaths ?? [],
|
|
52847
52854
|
...sourceDecl ? { source: sourceDecl } : {}
|
|
52848
52855
|
});
|
|
@@ -52864,7 +52871,7 @@ function buildLockFromCloud(agent_id, cloud, prev, cloudAgent) {
|
|
|
52864
52871
|
agentMeta: cloudAgent ? {
|
|
52865
52872
|
name: cloudAgent.name,
|
|
52866
52873
|
tagline: cloudAgent.tagline,
|
|
52867
|
-
...cloudAgent.entrypoint ? { entrypoint: cloudAgent.entrypoint } : {}
|
|
52874
|
+
...cloudAgent.entrypoint ? { entrypoint: cloudAgent.entrypoint.trim() } : {}
|
|
52868
52875
|
} : prev?.agentMeta
|
|
52869
52876
|
};
|
|
52870
52877
|
}
|
|
@@ -53172,7 +53179,7 @@ async function runAgentPush(cwd2, args) {
|
|
|
53172
53179
|
resolvedEntrypoint = "";
|
|
53173
53180
|
}
|
|
53174
53181
|
}
|
|
53175
|
-
const entrypointChanged = resolvedEntrypoint !== undefined && resolvedEntrypoint !== (lock?.agentMeta?.entrypoint ?? "");
|
|
53182
|
+
const entrypointChanged = resolvedEntrypoint !== undefined && (resolvedEntrypoint ?? "").trim() !== (lock?.agentMeta?.entrypoint ?? "").trim();
|
|
53176
53183
|
for (const r2 of rows) {
|
|
53177
53184
|
if (r2.type !== "instruction" && r2.type !== "skill" && r2.type !== "mcp" && r2.type !== "playbook") {
|
|
53178
53185
|
f2.error(`Component ${fmtType(r2.type)} ${import_picocolors27.default.bold(r2.slug)} can't be pushed yet — the server accepts instructions, skills, mcps, and playbooks in this version.`);
|
|
@@ -53308,6 +53315,11 @@ async function runAgentPush(cwd2, args) {
|
|
|
53308
53315
|
tagline: manifest.agent.tagline
|
|
53309
53316
|
});
|
|
53310
53317
|
}
|
|
53318
|
+
const localHashByKey = new Map;
|
|
53319
|
+
for (const lc of localComponents) {
|
|
53320
|
+
if (lc.hash)
|
|
53321
|
+
localHashByKey.set(`${lc.type}/${lc.slug}`, lc.hash);
|
|
53322
|
+
}
|
|
53311
53323
|
const newLock = {
|
|
53312
53324
|
schemaVersion: 1,
|
|
53313
53325
|
agent_id: agentId,
|
|
@@ -53323,10 +53335,11 @@ async function runAgentPush(cwd2, args) {
|
|
|
53323
53335
|
}
|
|
53324
53336
|
})?.source;
|
|
53325
53337
|
const prior = lock?.components.find((pc26) => pc26.type === c2.type && pc26.slug === c2.slug);
|
|
53338
|
+
const localHash = localHashByKey.get(`${c2.type}/${c2.slug}`);
|
|
53326
53339
|
return {
|
|
53327
53340
|
type: c2.type,
|
|
53328
53341
|
slug: c2.slug,
|
|
53329
|
-
hash: c2.hash,
|
|
53342
|
+
hash: localHash ?? c2.hash,
|
|
53330
53343
|
installedPaths: prior?.installedPaths ?? [],
|
|
53331
53344
|
...decl ? { source: decl } : {}
|
|
53332
53345
|
};
|
|
@@ -53334,7 +53347,7 @@ async function runAgentPush(cwd2, args) {
|
|
|
53334
53347
|
agentMeta: {
|
|
53335
53348
|
name: manifest.agent.name,
|
|
53336
53349
|
tagline: manifest.agent.tagline,
|
|
53337
|
-
entrypoint: resolvedEntrypoint !== undefined ? resolvedEntrypoint : lock?.agentMeta?.entrypoint
|
|
53350
|
+
entrypoint: resolvedEntrypoint !== undefined ? resolvedEntrypoint.trim() : lock?.agentMeta?.entrypoint
|
|
53338
53351
|
}
|
|
53339
53352
|
};
|
|
53340
53353
|
writeSyncState(cwd2, newLock);
|
|
@@ -53838,10 +53851,15 @@ async function runAgentCreate(cwd2, args) {
|
|
|
53838
53851
|
}
|
|
53839
53852
|
}
|
|
53840
53853
|
if (updatedCloud) {
|
|
53854
|
+
const localHashByKey = new Map;
|
|
53855
|
+
for (const lc of readLocalComponents(cwd2, manifest)) {
|
|
53856
|
+
if (lc.hash)
|
|
53857
|
+
localHashByKey.set(`${lc.type}/${lc.slug}`, lc.hash);
|
|
53858
|
+
}
|
|
53841
53859
|
const syncedComponents = updatedCloud.components.map((c2) => ({
|
|
53842
53860
|
type: c2.type,
|
|
53843
53861
|
slug: c2.slug,
|
|
53844
|
-
hash: c2.hash,
|
|
53862
|
+
hash: localHashByKey.get(`${c2.type}/${c2.slug}`) ?? c2.hash,
|
|
53845
53863
|
installedPaths: []
|
|
53846
53864
|
}));
|
|
53847
53865
|
const state = {
|
|
@@ -53853,7 +53871,7 @@ async function runAgentCreate(cwd2, args) {
|
|
|
53853
53871
|
agentMeta: {
|
|
53854
53872
|
name: agent.name,
|
|
53855
53873
|
tagline: agent.tagline,
|
|
53856
|
-
...resolvedEntrypoint ? { entrypoint: resolvedEntrypoint } : {}
|
|
53874
|
+
...resolvedEntrypoint ? { entrypoint: resolvedEntrypoint.trim() } : {}
|
|
53857
53875
|
}
|
|
53858
53876
|
};
|
|
53859
53877
|
writeSyncState(cwd2, state);
|
|
@@ -55916,7 +55934,7 @@ var PROTECTED = new Set([
|
|
|
55916
55934
|
function help() {
|
|
55917
55935
|
const out = [];
|
|
55918
55936
|
out.push("");
|
|
55919
|
-
out.push(` ${brandTint("◆")} ${import_picocolors40.default.bold("brainbase")} ${import_picocolors40.default.dim("v0.6.
|
|
55937
|
+
out.push(` ${brandTint("◆")} ${import_picocolors40.default.bold("brainbase")} ${import_picocolors40.default.dim("v0.6.1")}`);
|
|
55920
55938
|
out.push(` ${import_picocolors40.default.dim("connect your local agent to the brainbase platform")}`);
|
|
55921
55939
|
out.push("");
|
|
55922
55940
|
out.push(divider("USAGE"));
|