@brainbase-labs/cli 0.13.0 → 0.13.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 +33 -1
- 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.13.
|
|
29452
|
+
version: "0.13.1",
|
|
29453
29453
|
description: "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
|
|
29454
29454
|
type: "module",
|
|
29455
29455
|
bin: {
|
|
@@ -51314,6 +51314,28 @@ function assignPlaybookSlugs(titles) {
|
|
|
51314
51314
|
return slug;
|
|
51315
51315
|
});
|
|
51316
51316
|
}
|
|
51317
|
+
function backfillPlaybookIds(playbooks, cloudComponents) {
|
|
51318
|
+
const idBySlug = new Map;
|
|
51319
|
+
for (const c2 of cloudComponents) {
|
|
51320
|
+
if (c2.type !== "playbook")
|
|
51321
|
+
continue;
|
|
51322
|
+
const id = c2.meta?.playbook_id;
|
|
51323
|
+
if (typeof id === "string" && id)
|
|
51324
|
+
idBySlug.set(c2.slug, id);
|
|
51325
|
+
}
|
|
51326
|
+
const slugs = assignPlaybookSlugs(playbooks.map((e2) => e2.title));
|
|
51327
|
+
let changed = false;
|
|
51328
|
+
const next = playbooks.map((entry, i) => {
|
|
51329
|
+
if (entry.id)
|
|
51330
|
+
return entry;
|
|
51331
|
+
const id = idBySlug.get(slugs[i]);
|
|
51332
|
+
if (!id)
|
|
51333
|
+
return entry;
|
|
51334
|
+
changed = true;
|
|
51335
|
+
return { id, ...entry };
|
|
51336
|
+
});
|
|
51337
|
+
return { playbooks: changed ? next : playbooks, changed };
|
|
51338
|
+
}
|
|
51317
51339
|
|
|
51318
51340
|
// src/core/link.ts
|
|
51319
51341
|
var LINK_DIR = ".brainbase";
|
|
@@ -53981,6 +54003,11 @@ async function runAgentPush(cwd2, args) {
|
|
|
53981
54003
|
}
|
|
53982
54004
|
return handleApiError3(err);
|
|
53983
54005
|
}
|
|
54006
|
+
const backfill = backfillPlaybookIds(manifest.playbooks ?? [], updatedCloud.components);
|
|
54007
|
+
if (backfill.changed) {
|
|
54008
|
+
manifest.playbooks = backfill.playbooks;
|
|
54009
|
+
writeManifest(cwd2, manifest);
|
|
54010
|
+
}
|
|
53984
54011
|
const existing = readLink(cwd2);
|
|
53985
54012
|
if (existing) {
|
|
53986
54013
|
writeLink(cwd2, {
|
|
@@ -54542,6 +54569,11 @@ async function runAgentCreate(cwd2, args) {
|
|
|
54542
54569
|
}
|
|
54543
54570
|
}
|
|
54544
54571
|
if (updatedCloud) {
|
|
54572
|
+
const backfill = backfillPlaybookIds(manifest.playbooks ?? [], updatedCloud.components);
|
|
54573
|
+
if (backfill.changed) {
|
|
54574
|
+
manifest.playbooks = backfill.playbooks;
|
|
54575
|
+
writeManifest(cwd2, manifest);
|
|
54576
|
+
}
|
|
54545
54577
|
const localHashByKey = new Map;
|
|
54546
54578
|
for (const lc of readLocalComponents(cwd2, manifest)) {
|
|
54547
54579
|
if (lc.hash)
|