@brainbase-labs/cli 0.13.2 → 0.13.4

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 +24 -29
  2. 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.2",
29452
+ version: "0.13.4",
29453
29453
  description: "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
29454
29454
  type: "module",
29455
29455
  bin: {
@@ -48912,6 +48912,24 @@ function defaultSkillSlug(source) {
48912
48912
  return "skill";
48913
48913
  }
48914
48914
  }
48915
+ function looseSkillComponentSlug(raw) {
48916
+ const scoped = raw.match(/^registry:([a-z0-9_-]+)\/([a-z0-9_-]+)/i);
48917
+ if (scoped)
48918
+ return `${scoped[1]}--${scoped[2]}`;
48919
+ const unscoped = raw.match(/^registry:([a-z0-9_-]+)(?:@|$)/i);
48920
+ if (unscoped)
48921
+ return unscoped[1];
48922
+ if (raw.startsWith("./") || raw.startsWith("../") || raw.startsWith("/")) {
48923
+ return path32.basename(raw);
48924
+ }
48925
+ try {
48926
+ const source = parseSkillSource(raw);
48927
+ if (source.type !== "inline" && source.type !== "local") {
48928
+ return defaultSkillSlug(source);
48929
+ }
48930
+ } catch {}
48931
+ return null;
48932
+ }
48915
48933
  function describeSource(source) {
48916
48934
  switch (source.type) {
48917
48935
  case "inline":
@@ -53299,14 +53317,7 @@ function materializePlaybooks(cwd2, cloud, toInstall, keepLocal, existingManifes
53299
53317
  }
53300
53318
  function mergeManifest(cwd2, prev, cloud, cloudAgent, harness) {
53301
53319
  const skills = cloud.components.filter((c2) => c2.type === "skill").map((c2) => {
53302
- const localDecl = prev?.skills.find((s3) => {
53303
- try {
53304
- const parsed = parseSourceLoose(s3.source);
53305
- return parsed?.slug === c2.slug;
53306
- } catch {
53307
- return false;
53308
- }
53309
- });
53320
+ const localDecl = prev?.skills.find((s3) => looseSkillComponentSlug(s3.source) === c2.slug);
53310
53321
  if (localDecl)
53311
53322
  return { source: localDecl.source };
53312
53323
  const meta = c2.meta ?? {};
@@ -53403,21 +53414,6 @@ function materializeEntrypoint(cwd2, cloudEntrypoint, prev) {
53403
53414
  fs45.chmodSync(target, 493);
53404
53415
  } catch {}
53405
53416
  }
53406
- function parseSourceLoose(raw) {
53407
- const m3 = raw.match(/^registry:[a-z0-9_-]+\/([a-z0-9_-]+)/i);
53408
- if (m3)
53409
- return { slug: m3[1] };
53410
- if (raw.startsWith("./") || raw.startsWith("../") || raw.startsWith("/")) {
53411
- return { slug: path48.basename(raw) };
53412
- }
53413
- try {
53414
- const core = parseSkillSource(raw);
53415
- if (core.type !== "inline" && core.type !== "local") {
53416
- return { slug: defaultSkillSlug(core) };
53417
- }
53418
- } catch {}
53419
- return null;
53420
- }
53421
53417
  function buildLockComponents(input) {
53422
53418
  const prevByKey = new Map((input.prevLock?.components ?? []).map((c2) => [`${c2.type}/${c2.slug}`, c2]));
53423
53419
  const localHashByKey = new Map;
@@ -53435,10 +53431,7 @@ function buildLockComponents(input) {
53435
53431
  continue;
53436
53432
  }
53437
53433
  }
53438
- const sourceDecl = m3.type === "skill" ? input.localManifest.skills.find((s3) => {
53439
- const parsed = parseSourceLoose(s3.source);
53440
- return parsed?.slug === m3.slug;
53441
- })?.source : undefined;
53434
+ const sourceDecl = m3.type === "skill" ? input.localManifest.skills.find((s3) => looseSkillComponentSlug(s3.source) === m3.slug)?.source : undefined;
53442
53435
  const localHash = localHashByKey.get(key2);
53443
53436
  out.push({
53444
53437
  type: m3.type,
@@ -55373,7 +55366,9 @@ function materializeInstructions2(cwd2, cloud) {
55373
55366
  const body = c2.files[0]?.content ?? "";
55374
55367
  if (!body.trim())
55375
55368
  continue;
55376
- fs49.writeFileSync(path53.join(cwd2, DEFAULT_INSTRUCTIONS_FILE), body, "utf8");
55369
+ const target = path53.join(cwd2, DEFAULT_INSTRUCTIONS_FILE);
55370
+ ensureDir(path53.dirname(target));
55371
+ fs49.writeFileSync(target, normalizeInstructionBody(body), "utf8");
55377
55372
  return;
55378
55373
  }
55379
55374
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainbase-labs/cli",
3
- "version": "0.13.2",
3
+ "version": "0.13.4",
4
4
  "description": "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
5
5
  "type": "module",
6
6
  "bin": {