@brainbase-labs/cli 0.29.1 → 0.30.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 +90 -45
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -36018,7 +36018,7 @@ function padStart(s, n) {
|
|
|
36018
36018
|
// package.json
|
|
36019
36019
|
var package_default = {
|
|
36020
36020
|
name: "@brainbase-labs/cli",
|
|
36021
|
-
version: "0.
|
|
36021
|
+
version: "0.30.0",
|
|
36022
36022
|
description: "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
|
|
36023
36023
|
type: "module",
|
|
36024
36024
|
bin: {
|
|
@@ -62408,14 +62408,16 @@ var McpEntrySchema = exports_external.object({
|
|
|
62408
62408
|
args: exports_external.array(exports_external.string()).optional(),
|
|
62409
62409
|
env: exports_external.record(exports_external.string()).optional(),
|
|
62410
62410
|
headers: exports_external.record(exports_external.string()).optional(),
|
|
62411
|
-
is_enabled: exports_external.boolean().optional()
|
|
62411
|
+
is_enabled: exports_external.boolean().optional(),
|
|
62412
|
+
runtime_meta: exports_external.record(exports_external.unknown()).optional()
|
|
62412
62413
|
});
|
|
62413
62414
|
var CapabilitiesSchema = exports_external.object({
|
|
62414
62415
|
memory: exports_external.boolean().optional(),
|
|
62415
62416
|
browser: exports_external.boolean().optional(),
|
|
62416
62417
|
slack: exports_external.boolean().optional(),
|
|
62417
62418
|
meeting: exports_external.boolean().optional(),
|
|
62418
|
-
github: exports_external.boolean().optional()
|
|
62419
|
+
github: exports_external.boolean().optional(),
|
|
62420
|
+
linear: exports_external.boolean().optional()
|
|
62419
62421
|
});
|
|
62420
62422
|
var EvalOutputShape = exports_external.enum(["binary", "rating", "classification"]);
|
|
62421
62423
|
var EVAL_SLUG_RE = /^[a-z0-9][a-z0-9-]*$/;
|
|
@@ -63581,6 +63583,39 @@ function buildGithubMcpComponent(scope) {
|
|
|
63581
63583
|
};
|
|
63582
63584
|
}
|
|
63583
63585
|
|
|
63586
|
+
// src/core/linear-mcp.ts
|
|
63587
|
+
var DEFAULT_LINEAR_MCP_BASE = "https://brainbase-linear-mcp.onrender.com";
|
|
63588
|
+
var LINEAR_MCP_SLUG = "brainbase-linear";
|
|
63589
|
+
function linearMcpBaseUrl() {
|
|
63590
|
+
const envOverride = process.env.BRAINBASE_LINEAR_MCP_URL;
|
|
63591
|
+
if (envOverride)
|
|
63592
|
+
return envOverride.replace(/\/+$/, "");
|
|
63593
|
+
return DEFAULT_LINEAR_MCP_BASE;
|
|
63594
|
+
}
|
|
63595
|
+
function linearMcpUrl() {
|
|
63596
|
+
return `${linearMcpBaseUrl()}/t/\${BRAINBASE_THREAD_ID}/mcp`;
|
|
63597
|
+
}
|
|
63598
|
+
function linearMcpPayload() {
|
|
63599
|
+
return {
|
|
63600
|
+
url: linearMcpUrl(),
|
|
63601
|
+
headers: {
|
|
63602
|
+
Authorization: "Bearer ${BRAINBASE_TOKEN}"
|
|
63603
|
+
}
|
|
63604
|
+
};
|
|
63605
|
+
}
|
|
63606
|
+
function buildLinearMcpComponent(scope) {
|
|
63607
|
+
return {
|
|
63608
|
+
type: "mcp",
|
|
63609
|
+
slug: LINEAR_MCP_SLUG,
|
|
63610
|
+
scope,
|
|
63611
|
+
rootDir: "",
|
|
63612
|
+
description: "This agent's Linear connector (read and update issues, comment, and " + "report progress on delegated work). Scoped to this agent only.",
|
|
63613
|
+
meta: { mcp: linearMcpPayload() },
|
|
63614
|
+
payload: linearMcpPayload(),
|
|
63615
|
+
checksum: "builtin:brainbase-linear:v1"
|
|
63616
|
+
};
|
|
63617
|
+
}
|
|
63618
|
+
|
|
63584
63619
|
// src/core/browser-mcp.ts
|
|
63585
63620
|
var DEFAULT_BROWSER_MCP_BASE = "https://brainbase-browser-mcp.onrender.com";
|
|
63586
63621
|
var BROWSER_MCP_SLUG = "brainbase-browser";
|
|
@@ -63621,7 +63656,8 @@ function capabilitiesFromAgent(agent) {
|
|
|
63621
63656
|
browser: agent.browser_enabled !== false,
|
|
63622
63657
|
slack: agent.slack_connected === true,
|
|
63623
63658
|
meeting: agent.meeting_connected === true,
|
|
63624
|
-
github: agent.github_connected === true
|
|
63659
|
+
github: agent.github_connected === true,
|
|
63660
|
+
linear: agent.linear_connected === true
|
|
63625
63661
|
};
|
|
63626
63662
|
}
|
|
63627
63663
|
function capabilitiesFromManifest(manifest) {
|
|
@@ -63631,7 +63667,8 @@ function capabilitiesFromManifest(manifest) {
|
|
|
63631
63667
|
browser: c2.browser !== false,
|
|
63632
63668
|
slack: c2.slack === true,
|
|
63633
63669
|
meeting: c2.meeting === true,
|
|
63634
|
-
github: c2.github === true
|
|
63670
|
+
github: c2.github === true,
|
|
63671
|
+
linear: c2.linear === true
|
|
63635
63672
|
};
|
|
63636
63673
|
}
|
|
63637
63674
|
function resolveBuiltinMcps(input) {
|
|
@@ -63642,7 +63679,8 @@ function resolveBuiltinMcps(input) {
|
|
|
63642
63679
|
{ slug: BROWSER_MCP_SLUG, enabled: caps.browser, build: buildBrowserMcpComponent },
|
|
63643
63680
|
{ slug: SLACK_MCP_SLUG, enabled: caps.slack, build: buildSlackMcpComponent },
|
|
63644
63681
|
{ slug: MEETING_MCP_SLUG, enabled: caps.meeting, build: buildMeetingMcpComponent },
|
|
63645
|
-
{ slug: GITHUB_MCP_SLUG, enabled: caps.github, build: buildGithubMcpComponent }
|
|
63682
|
+
{ slug: GITHUB_MCP_SLUG, enabled: caps.github, build: buildGithubMcpComponent },
|
|
63683
|
+
{ slug: LINEAR_MCP_SLUG, enabled: caps.linear, build: buildLinearMcpComponent }
|
|
63646
63684
|
];
|
|
63647
63685
|
const install = [];
|
|
63648
63686
|
const removeSlugs = [];
|
|
@@ -64408,7 +64446,7 @@ function diffAgentMeta(manifestMeta, lockMeta, cloudMeta) {
|
|
|
64408
64446
|
};
|
|
64409
64447
|
}
|
|
64410
64448
|
var WRITABLE_CAPABILITIES = ["memory", "browser"];
|
|
64411
|
-
var MIRRORED_CAPABILITIES = ["slack", "meeting", "github"];
|
|
64449
|
+
var MIRRORED_CAPABILITIES = ["slack", "meeting", "github", "linear"];
|
|
64412
64450
|
function manifestConfigState(manifest) {
|
|
64413
64451
|
return {
|
|
64414
64452
|
...manifest.machine_kind !== undefined ? { machine_kind: manifest.machine_kind } : {},
|
|
@@ -64432,7 +64470,8 @@ function staleConnectionMirrors(manifest, cloud) {
|
|
|
64432
64470
|
const actualByName = {
|
|
64433
64471
|
slack: cloud.slack_connected,
|
|
64434
64472
|
meeting: cloud.meeting_connected,
|
|
64435
|
-
github: cloud.github_connected
|
|
64473
|
+
github: cloud.github_connected,
|
|
64474
|
+
linear: cloud.linear_connected
|
|
64436
64475
|
};
|
|
64437
64476
|
const stale = [];
|
|
64438
64477
|
for (const name of MIRRORED_CAPABILITIES) {
|
|
@@ -64595,6 +64634,41 @@ function capabilityBaselineAfterPush(cloudAgent, previous, diff2) {
|
|
|
64595
64634
|
return out;
|
|
64596
64635
|
}
|
|
64597
64636
|
|
|
64637
|
+
// src/core/mcp-merge.ts
|
|
64638
|
+
var RUNTIME_META_PREFIX = "runtime_";
|
|
64639
|
+
function runtimeMetaFromComponent(component) {
|
|
64640
|
+
const meta = component.meta ?? {};
|
|
64641
|
+
const carried = {};
|
|
64642
|
+
for (const [key2, value] of Object.entries(meta)) {
|
|
64643
|
+
if (key2.startsWith(RUNTIME_META_PREFIX) && value !== undefined) {
|
|
64644
|
+
carried[key2] = value;
|
|
64645
|
+
}
|
|
64646
|
+
}
|
|
64647
|
+
return Object.keys(carried).length > 0 ? carried : undefined;
|
|
64648
|
+
}
|
|
64649
|
+
function mcpEntriesFromCloudComponents(components) {
|
|
64650
|
+
return components.filter((c2) => c2.type === "mcp").map((c2) => {
|
|
64651
|
+
const payload = (c2.meta ?? {}).mcp ?? {};
|
|
64652
|
+
const entry = { name: c2.slug };
|
|
64653
|
+
if (typeof payload.url === "string")
|
|
64654
|
+
entry.url = payload.url;
|
|
64655
|
+
if (typeof payload.command === "string")
|
|
64656
|
+
entry.command = payload.command;
|
|
64657
|
+
if (Array.isArray(payload.args))
|
|
64658
|
+
entry.args = payload.args.map(String);
|
|
64659
|
+
if (payload.env && typeof payload.env === "object")
|
|
64660
|
+
entry.env = payload.env;
|
|
64661
|
+
if (payload.headers && typeof payload.headers === "object")
|
|
64662
|
+
entry.headers = payload.headers;
|
|
64663
|
+
if (typeof payload.is_enabled === "boolean")
|
|
64664
|
+
entry.is_enabled = payload.is_enabled;
|
|
64665
|
+
const runtimeMeta = runtimeMetaFromComponent(c2);
|
|
64666
|
+
if (runtimeMeta)
|
|
64667
|
+
entry.runtime_meta = runtimeMeta;
|
|
64668
|
+
return entry;
|
|
64669
|
+
});
|
|
64670
|
+
}
|
|
64671
|
+
|
|
64598
64672
|
// src/core/secrets-env.ts
|
|
64599
64673
|
import path78 from "node:path";
|
|
64600
64674
|
import fs71 from "node:fs";
|
|
@@ -65445,23 +65519,7 @@ function mergeManifest(cwd2, prev, cloud, cloudAgent, harness, localOnly = {}, s
|
|
|
65445
65519
|
content
|
|
65446
65520
|
};
|
|
65447
65521
|
});
|
|
65448
|
-
const mcp = cloud.components
|
|
65449
|
-
const payload = (c2.meta ?? {}).mcp ?? {};
|
|
65450
|
-
const entry = { name: c2.slug };
|
|
65451
|
-
if (typeof payload.url === "string")
|
|
65452
|
-
entry.url = payload.url;
|
|
65453
|
-
if (typeof payload.command === "string")
|
|
65454
|
-
entry.command = payload.command;
|
|
65455
|
-
if (Array.isArray(payload.args))
|
|
65456
|
-
entry.args = payload.args.map(String);
|
|
65457
|
-
if (payload.env && typeof payload.env === "object")
|
|
65458
|
-
entry.env = payload.env;
|
|
65459
|
-
if (payload.headers && typeof payload.headers === "object")
|
|
65460
|
-
entry.headers = payload.headers;
|
|
65461
|
-
if (typeof payload.is_enabled === "boolean")
|
|
65462
|
-
entry.is_enabled = payload.is_enabled;
|
|
65463
|
-
return entry;
|
|
65464
|
-
});
|
|
65522
|
+
const mcp = mcpEntriesFromCloudComponents(cloud.components);
|
|
65465
65523
|
const evals = evalsFromCloudComponents(cloud.components);
|
|
65466
65524
|
const caps = capabilitiesFromAgent(cloudAgent);
|
|
65467
65525
|
const machineKind = cloudAgent.machine_kind ?? prev?.machine_kind;
|
|
@@ -65496,7 +65554,8 @@ function mergeManifest(cwd2, prev, cloud, cloudAgent, harness, localOnly = {}, s
|
|
|
65496
65554
|
browser: caps.browser,
|
|
65497
65555
|
slack: caps.slack,
|
|
65498
65556
|
meeting: caps.meeting,
|
|
65499
|
-
github: caps.github
|
|
65557
|
+
github: caps.github,
|
|
65558
|
+
linear: caps.linear
|
|
65500
65559
|
}
|
|
65501
65560
|
};
|
|
65502
65561
|
}
|
|
@@ -65881,7 +65940,7 @@ async function buildOutgoingComponents(cwd2, manifest, cloud, resolvedVersions)
|
|
|
65881
65940
|
slug: entry.name,
|
|
65882
65941
|
hash: "",
|
|
65883
65942
|
files: [],
|
|
65884
|
-
meta: { mcp: payload }
|
|
65943
|
+
meta: { ...entry.runtime_meta ?? {}, mcp: payload }
|
|
65885
65944
|
});
|
|
65886
65945
|
}
|
|
65887
65946
|
return out;
|
|
@@ -69044,23 +69103,7 @@ function buildManifestFromCloud(cloud, agent, localOnly = {}) {
|
|
|
69044
69103
|
return { source: `registry:${c2.slug}` };
|
|
69045
69104
|
});
|
|
69046
69105
|
const hasInstructions = cloud.components.some((c2) => c2.type === "instruction" && c2.files[0]?.content?.trim());
|
|
69047
|
-
const mcp = cloud.components
|
|
69048
|
-
const payload = (c2.meta ?? {}).mcp ?? {};
|
|
69049
|
-
const entry = { name: c2.slug };
|
|
69050
|
-
if (typeof payload.url === "string")
|
|
69051
|
-
entry.url = payload.url;
|
|
69052
|
-
if (typeof payload.command === "string")
|
|
69053
|
-
entry.command = payload.command;
|
|
69054
|
-
if (Array.isArray(payload.args))
|
|
69055
|
-
entry.args = payload.args.map(String);
|
|
69056
|
-
if (payload.env && typeof payload.env === "object")
|
|
69057
|
-
entry.env = payload.env;
|
|
69058
|
-
if (payload.headers && typeof payload.headers === "object")
|
|
69059
|
-
entry.headers = payload.headers;
|
|
69060
|
-
if (typeof payload.is_enabled === "boolean")
|
|
69061
|
-
entry.is_enabled = payload.is_enabled;
|
|
69062
|
-
return entry;
|
|
69063
|
-
});
|
|
69106
|
+
const mcp = mcpEntriesFromCloudComponents(cloud.components);
|
|
69064
69107
|
const playbooks = cloud.components.filter((c2) => c2.type === "playbook").map((c2) => {
|
|
69065
69108
|
const raw = c2.files[0]?.content ?? "";
|
|
69066
69109
|
const { frontmatter } = stripPlaybookFrontmatter(raw);
|
|
@@ -69100,7 +69143,8 @@ function buildManifestFromCloud(cloud, agent, localOnly = {}) {
|
|
|
69100
69143
|
browser: caps.browser,
|
|
69101
69144
|
slack: caps.slack,
|
|
69102
69145
|
meeting: caps.meeting,
|
|
69103
|
-
github: caps.github
|
|
69146
|
+
github: caps.github,
|
|
69147
|
+
linear: caps.linear
|
|
69104
69148
|
}
|
|
69105
69149
|
};
|
|
69106
69150
|
}
|
|
@@ -89048,6 +89092,7 @@ function help() {
|
|
|
89048
89092
|
out.push(` ${import_picocolors61.default.dim("BRAINBASE_SLACK_MCP_URL")} override the built-in Slack MCP host`);
|
|
89049
89093
|
out.push(` ${import_picocolors61.default.dim("BRAINBASE_MEETING_MCP_URL")} override the built-in meeting MCP host`);
|
|
89050
89094
|
out.push(` ${import_picocolors61.default.dim("BRAINBASE_GITHUB_MCP_URL")} override the built-in GitHub MCP host`);
|
|
89095
|
+
out.push(` ${import_picocolors61.default.dim("BRAINBASE_LINEAR_MCP_URL")} override the built-in Linear MCP host`);
|
|
89051
89096
|
out.push(` ${import_picocolors61.default.dim("BRAINBASE_ORCHESTRATION_MCP_URL")} override the built-in orchestration MCP host`);
|
|
89052
89097
|
out.push("");
|
|
89053
89098
|
out.push(divider("HARNESSES"));
|