bamboo-agents 0.1.5-dev.30 → 0.1.5-dev.32
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/VERSION +1 -1
- package/dist/index.js +364 -74
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.5-dev.
|
|
1
|
+
0.1.5-dev.32
|
package/dist/index.js
CHANGED
|
@@ -3037,7 +3037,7 @@ var VERSION;
|
|
|
3037
3037
|
var init_version = __esm({
|
|
3038
3038
|
"src/version.ts"() {
|
|
3039
3039
|
"use strict";
|
|
3040
|
-
VERSION = "0.1.5-dev.
|
|
3040
|
+
VERSION = "0.1.5-dev.32";
|
|
3041
3041
|
}
|
|
3042
3042
|
});
|
|
3043
3043
|
|
|
@@ -13281,58 +13281,16 @@ var init_magic_moment_phase = __esm({
|
|
|
13281
13281
|
}
|
|
13282
13282
|
});
|
|
13283
13283
|
|
|
13284
|
-
// src/lib/claude-desktop.ts
|
|
13285
|
-
import { execFile as execFile7 } from "node:child_process";
|
|
13286
|
-
import { platform as platform3 } from "node:os";
|
|
13287
|
-
import { promisify as promisify7 } from "node:util";
|
|
13288
|
-
async function detectClaudeDesktop() {
|
|
13289
|
-
const plat = platform3();
|
|
13290
|
-
if (plat === "darwin") return await detectMacOS();
|
|
13291
|
-
if (plat === "win32") return await detectWindows();
|
|
13292
|
-
return { kind: "unsupported_platform" };
|
|
13293
|
-
}
|
|
13294
|
-
async function detectMacOS() {
|
|
13295
|
-
try {
|
|
13296
|
-
const { stdout } = await execFileP2(
|
|
13297
|
-
"mdfind",
|
|
13298
|
-
[`kMDItemCFBundleIdentifier == "${MACOS_BUNDLE_ID}"`],
|
|
13299
|
-
{ encoding: "utf8" }
|
|
13300
|
-
);
|
|
13301
|
-
return stdout.trim().length > 0 ? { kind: "installed" } : { kind: "missing" };
|
|
13302
|
-
} catch {
|
|
13303
|
-
return { kind: "missing" };
|
|
13304
|
-
}
|
|
13305
|
-
}
|
|
13306
|
-
async function detectWindows() {
|
|
13307
|
-
try {
|
|
13308
|
-
await execFileP2(
|
|
13309
|
-
"reg",
|
|
13310
|
-
["query", "HKCU\\Software\\Classes\\claude"],
|
|
13311
|
-
{ encoding: "utf8" }
|
|
13312
|
-
);
|
|
13313
|
-
return { kind: "installed" };
|
|
13314
|
-
} catch {
|
|
13315
|
-
return { kind: "missing" };
|
|
13316
|
-
}
|
|
13317
|
-
}
|
|
13318
|
-
var execFileP2, MACOS_BUNDLE_ID;
|
|
13319
|
-
var init_claude_desktop = __esm({
|
|
13320
|
-
"src/lib/claude-desktop.ts"() {
|
|
13321
|
-
"use strict";
|
|
13322
|
-
execFileP2 = promisify7(execFile7);
|
|
13323
|
-
MACOS_BUNDLE_ID = "com.anthropic.claudefordesktop";
|
|
13324
|
-
}
|
|
13325
|
-
});
|
|
13326
|
-
|
|
13327
13284
|
// src/lib/phases-impl/open-phase.ts
|
|
13328
|
-
|
|
13285
|
+
function isCodingAgentInvocation() {
|
|
13286
|
+
return Boolean(process.env.CLAUDECODE || process.env.CLAUDE_CODE_ENTRYPOINT);
|
|
13287
|
+
}
|
|
13288
|
+
var openSpec;
|
|
13329
13289
|
var init_open_phase = __esm({
|
|
13330
13290
|
"src/lib/phases-impl/open-phase.ts"() {
|
|
13331
13291
|
"use strict";
|
|
13332
13292
|
init_open();
|
|
13333
13293
|
init_api();
|
|
13334
|
-
init_claude_desktop();
|
|
13335
|
-
DOWNLOAD_URL = "https://claude.com/download";
|
|
13336
13294
|
openSpec = {
|
|
13337
13295
|
name: "open",
|
|
13338
13296
|
async probe(ctx) {
|
|
@@ -13343,26 +13301,9 @@ var init_open_phase = __esm({
|
|
|
13343
13301
|
reason: "Internal: openPhase probe called without a config."
|
|
13344
13302
|
};
|
|
13345
13303
|
}
|
|
13346
|
-
const status = await detectClaudeDesktop();
|
|
13347
|
-
if (status.kind === "missing") {
|
|
13348
|
-
return {
|
|
13349
|
-
status: "needs_action",
|
|
13350
|
-
summary: "(Claude Desktop missing)",
|
|
13351
|
-
reason: `Claude Desktop isn't installed. Get it at ${DOWNLOAD_URL}, then re-run.
|
|
13352
|
-
Your workspace is cloned at ${ctx.config.repo_path}.`
|
|
13353
|
-
};
|
|
13354
|
-
}
|
|
13355
|
-
if (status.kind === "unsupported_platform") {
|
|
13356
|
-
return {
|
|
13357
|
-
status: "needs_action",
|
|
13358
|
-
summary: "(Linux \u2014 Claude Desktop unavailable)",
|
|
13359
|
-
reason: `Claude Desktop isn't available on Linux yet.
|
|
13360
|
-
Your workspace is cloned at: ${ctx.config.repo_path}`
|
|
13361
|
-
};
|
|
13362
|
-
}
|
|
13363
13304
|
return {
|
|
13364
13305
|
status: "needs_work",
|
|
13365
|
-
summary: "
|
|
13306
|
+
summary: "hand off to next surface"
|
|
13366
13307
|
};
|
|
13367
13308
|
},
|
|
13368
13309
|
async execute(ctx) {
|
|
@@ -13372,11 +13313,16 @@ var init_open_phase = __esm({
|
|
|
13372
13313
|
reason: "Internal: openPhase.execute called without a config."
|
|
13373
13314
|
};
|
|
13374
13315
|
}
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13316
|
+
if (isCodingAgentInvocation()) {
|
|
13317
|
+
console.log("");
|
|
13318
|
+
console.log(` Workspace ready at: ${ctx.config.repo_path}`);
|
|
13319
|
+
console.log(` To continue, run: cd ${ctx.config.repo_path}`);
|
|
13320
|
+
return {
|
|
13321
|
+
kind: "advanced",
|
|
13322
|
+
summary: `Workspace at ${ctx.config.repo_path}`
|
|
13323
|
+
};
|
|
13324
|
+
}
|
|
13325
|
+
const dashboardUrl = ctx.agentId ? `${apiBase()}/app/agents/${ctx.agentId}?tab=context&source=cli-onboarding` : `${apiBase()}/app`;
|
|
13380
13326
|
console.log("");
|
|
13381
13327
|
console.log(` \u2192 Continue setup at ${dashboardUrl}`);
|
|
13382
13328
|
try {
|
|
@@ -13385,7 +13331,7 @@ var init_open_phase = __esm({
|
|
|
13385
13331
|
}
|
|
13386
13332
|
return {
|
|
13387
13333
|
kind: "advanced",
|
|
13388
|
-
summary: `
|
|
13334
|
+
summary: `Continue at ${dashboardUrl}`
|
|
13389
13335
|
};
|
|
13390
13336
|
}
|
|
13391
13337
|
};
|
|
@@ -13541,6 +13487,49 @@ var init_orchestrator = __esm({
|
|
|
13541
13487
|
}
|
|
13542
13488
|
});
|
|
13543
13489
|
|
|
13490
|
+
// src/lib/claude-desktop.ts
|
|
13491
|
+
import { execFile as execFile7 } from "node:child_process";
|
|
13492
|
+
import { platform as platform3 } from "node:os";
|
|
13493
|
+
import { promisify as promisify7 } from "node:util";
|
|
13494
|
+
async function detectClaudeDesktop() {
|
|
13495
|
+
const plat = platform3();
|
|
13496
|
+
if (plat === "darwin") return await detectMacOS();
|
|
13497
|
+
if (plat === "win32") return await detectWindows();
|
|
13498
|
+
return { kind: "unsupported_platform" };
|
|
13499
|
+
}
|
|
13500
|
+
async function detectMacOS() {
|
|
13501
|
+
try {
|
|
13502
|
+
const { stdout } = await execFileP2(
|
|
13503
|
+
"mdfind",
|
|
13504
|
+
[`kMDItemCFBundleIdentifier == "${MACOS_BUNDLE_ID}"`],
|
|
13505
|
+
{ encoding: "utf8" }
|
|
13506
|
+
);
|
|
13507
|
+
return stdout.trim().length > 0 ? { kind: "installed" } : { kind: "missing" };
|
|
13508
|
+
} catch {
|
|
13509
|
+
return { kind: "missing" };
|
|
13510
|
+
}
|
|
13511
|
+
}
|
|
13512
|
+
async function detectWindows() {
|
|
13513
|
+
try {
|
|
13514
|
+
await execFileP2(
|
|
13515
|
+
"reg",
|
|
13516
|
+
["query", "HKCU\\Software\\Classes\\claude"],
|
|
13517
|
+
{ encoding: "utf8" }
|
|
13518
|
+
);
|
|
13519
|
+
return { kind: "installed" };
|
|
13520
|
+
} catch {
|
|
13521
|
+
return { kind: "missing" };
|
|
13522
|
+
}
|
|
13523
|
+
}
|
|
13524
|
+
var execFileP2, MACOS_BUNDLE_ID;
|
|
13525
|
+
var init_claude_desktop = __esm({
|
|
13526
|
+
"src/lib/claude-desktop.ts"() {
|
|
13527
|
+
"use strict";
|
|
13528
|
+
execFileP2 = promisify7(execFile7);
|
|
13529
|
+
MACOS_BUNDLE_ID = "com.anthropic.claudefordesktop";
|
|
13530
|
+
}
|
|
13531
|
+
});
|
|
13532
|
+
|
|
13544
13533
|
// src/commands/open.ts
|
|
13545
13534
|
var open_exports = {};
|
|
13546
13535
|
__export(open_exports, {
|
|
@@ -13555,7 +13544,7 @@ async function runOpen() {
|
|
|
13555
13544
|
const status = await detectClaudeDesktop();
|
|
13556
13545
|
if (status.kind === "missing") {
|
|
13557
13546
|
console.error(
|
|
13558
|
-
`Claude Desktop isn't installed. Get it at ${
|
|
13547
|
+
`Claude Desktop isn't installed. Get it at ${DOWNLOAD_URL}, then re-run \`bamboo-agents open\`.`
|
|
13559
13548
|
);
|
|
13560
13549
|
console.error(`(Your workspace is cloned at ${cfg.repo_path}.)`);
|
|
13561
13550
|
process.exit(1);
|
|
@@ -13572,14 +13561,14 @@ async function runOpen() {
|
|
|
13572
13561
|
console.log(`Opening Claude Code at ${cfg.repo_path}\u2026`);
|
|
13573
13562
|
console.log("(Claude Desktop will ask you to trust the folder the first time.)");
|
|
13574
13563
|
}
|
|
13575
|
-
var
|
|
13564
|
+
var DOWNLOAD_URL;
|
|
13576
13565
|
var init_open2 = __esm({
|
|
13577
13566
|
"src/commands/open.ts"() {
|
|
13578
13567
|
"use strict";
|
|
13579
13568
|
init_open();
|
|
13580
13569
|
init_claude_desktop();
|
|
13581
13570
|
init_state();
|
|
13582
|
-
|
|
13571
|
+
DOWNLOAD_URL = "https://claude.com/download";
|
|
13583
13572
|
}
|
|
13584
13573
|
});
|
|
13585
13574
|
|
|
@@ -13788,6 +13777,298 @@ var init_doctor = __esm({
|
|
|
13788
13777
|
}
|
|
13789
13778
|
});
|
|
13790
13779
|
|
|
13780
|
+
// src/lib/skills-local.ts
|
|
13781
|
+
import { readdir as readdir2, readFile as readFile4, stat as stat2 } from "node:fs/promises";
|
|
13782
|
+
import { join as join2 } from "node:path";
|
|
13783
|
+
function parseSimpleFrontmatter(raw) {
|
|
13784
|
+
const text = raw.replace(/\r\n/g, "\n");
|
|
13785
|
+
const m = text.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);
|
|
13786
|
+
if (!m) {
|
|
13787
|
+
return { data: {}, body: text };
|
|
13788
|
+
}
|
|
13789
|
+
const fm = m[1] ?? "";
|
|
13790
|
+
const body = m[2] ?? "";
|
|
13791
|
+
const data = {};
|
|
13792
|
+
const lines = fm.split("\n");
|
|
13793
|
+
let i = 0;
|
|
13794
|
+
while (i < lines.length) {
|
|
13795
|
+
const line = lines[i];
|
|
13796
|
+
i++;
|
|
13797
|
+
if (!line.trim() || line.trim().startsWith("#")) continue;
|
|
13798
|
+
const colon = line.indexOf(":");
|
|
13799
|
+
if (colon < 0) continue;
|
|
13800
|
+
const key = line.slice(0, colon).trim();
|
|
13801
|
+
let value = line.slice(colon + 1).trim();
|
|
13802
|
+
if (!key) continue;
|
|
13803
|
+
const blockMatch = value.match(/^([>|])([+-]?)\s*$/);
|
|
13804
|
+
if (blockMatch) {
|
|
13805
|
+
const style = blockMatch[1];
|
|
13806
|
+
const chomp = blockMatch[2] ?? "";
|
|
13807
|
+
const collected = [];
|
|
13808
|
+
while (i < lines.length) {
|
|
13809
|
+
const next = lines[i];
|
|
13810
|
+
if (next.trim() === "") {
|
|
13811
|
+
collected.push("");
|
|
13812
|
+
i++;
|
|
13813
|
+
continue;
|
|
13814
|
+
}
|
|
13815
|
+
if (!/^\s/.test(next)) break;
|
|
13816
|
+
collected.push(next.replace(/^\s+/, ""));
|
|
13817
|
+
i++;
|
|
13818
|
+
}
|
|
13819
|
+
while (collected.length && collected[collected.length - 1] === "") {
|
|
13820
|
+
collected.pop();
|
|
13821
|
+
}
|
|
13822
|
+
let folded;
|
|
13823
|
+
if (style === ">") {
|
|
13824
|
+
const parts = [];
|
|
13825
|
+
let buf = [];
|
|
13826
|
+
for (const c of collected) {
|
|
13827
|
+
if (c === "") {
|
|
13828
|
+
if (buf.length) {
|
|
13829
|
+
parts.push(buf.join(" "));
|
|
13830
|
+
buf = [];
|
|
13831
|
+
}
|
|
13832
|
+
parts.push("");
|
|
13833
|
+
} else {
|
|
13834
|
+
buf.push(c);
|
|
13835
|
+
}
|
|
13836
|
+
}
|
|
13837
|
+
if (buf.length) parts.push(buf.join(" "));
|
|
13838
|
+
folded = parts.join("\n").replace(/\n+/g, (m2) => m2.length > 1 ? "\n\n" : "\n");
|
|
13839
|
+
} else {
|
|
13840
|
+
folded = collected.join("\n");
|
|
13841
|
+
}
|
|
13842
|
+
if (chomp !== "-") folded += "\n";
|
|
13843
|
+
data[key] = folded;
|
|
13844
|
+
continue;
|
|
13845
|
+
}
|
|
13846
|
+
if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
|
|
13847
|
+
value = value.slice(1, -1);
|
|
13848
|
+
}
|
|
13849
|
+
if (value.startsWith("[") && value.endsWith("]")) {
|
|
13850
|
+
const inner = value.slice(1, -1).trim();
|
|
13851
|
+
data[key] = inner ? inner.split(",").map((s) => s.trim().replace(/^["']|["']$/g, "")) : [];
|
|
13852
|
+
continue;
|
|
13853
|
+
}
|
|
13854
|
+
if (value === "true") {
|
|
13855
|
+
data[key] = true;
|
|
13856
|
+
continue;
|
|
13857
|
+
}
|
|
13858
|
+
if (value === "false") {
|
|
13859
|
+
data[key] = false;
|
|
13860
|
+
continue;
|
|
13861
|
+
}
|
|
13862
|
+
data[key] = value;
|
|
13863
|
+
}
|
|
13864
|
+
return { data, body };
|
|
13865
|
+
}
|
|
13866
|
+
function parseSkillContent(raw, sourcePath) {
|
|
13867
|
+
const { data: fm, body } = parseSimpleFrontmatter(raw);
|
|
13868
|
+
const name = typeof fm.name === "string" ? fm.name : "";
|
|
13869
|
+
const description = typeof fm.description === "string" ? fm.description.trim() : "";
|
|
13870
|
+
const disableModelInvocation = fm["disable-model-invocation"] === true || fm.disableModelInvocation === true;
|
|
13871
|
+
const allowedToolsRaw = fm["allowed-tools"] ?? fm.allowedTools;
|
|
13872
|
+
const allowedTools = Array.isArray(allowedToolsRaw) ? allowedToolsRaw.filter((t) => typeof t === "string") : [];
|
|
13873
|
+
const errors = [];
|
|
13874
|
+
if (!name) errors.push("missing name");
|
|
13875
|
+
if (name.length > 64) errors.push(`name > 64 chars (${name.length})`);
|
|
13876
|
+
if (name && !/^[a-z0-9-]+$/.test(name)) errors.push("name must be kebab-case");
|
|
13877
|
+
if (!description) errors.push("missing description");
|
|
13878
|
+
if (description.length > 1024)
|
|
13879
|
+
errors.push(`description > 1024 chars (${description.length})`);
|
|
13880
|
+
if (body.split("\n").length > 500) errors.push("body > 500 lines");
|
|
13881
|
+
if (errors.length) {
|
|
13882
|
+
console.warn(
|
|
13883
|
+
`bamboo-agents: skipping ${sourcePath}: ${errors.join("; ")}`
|
|
13884
|
+
);
|
|
13885
|
+
return null;
|
|
13886
|
+
}
|
|
13887
|
+
return {
|
|
13888
|
+
name,
|
|
13889
|
+
description,
|
|
13890
|
+
disableModelInvocation,
|
|
13891
|
+
allowedTools,
|
|
13892
|
+
content: body.replace(/^\n+/, "").trimEnd(),
|
|
13893
|
+
sourcePath
|
|
13894
|
+
};
|
|
13895
|
+
}
|
|
13896
|
+
async function resolveSkillsDir(repoPath) {
|
|
13897
|
+
const dir = join2(repoPath, "skills");
|
|
13898
|
+
try {
|
|
13899
|
+
const s = await stat2(dir);
|
|
13900
|
+
return s.isDirectory() ? dir : null;
|
|
13901
|
+
} catch {
|
|
13902
|
+
return null;
|
|
13903
|
+
}
|
|
13904
|
+
}
|
|
13905
|
+
async function listLocalSkills(repoPath) {
|
|
13906
|
+
const dir = await resolveSkillsDir(repoPath);
|
|
13907
|
+
if (!dir) return [];
|
|
13908
|
+
const entries = await readdir2(dir);
|
|
13909
|
+
const matches = entries.filter((e) => e.endsWith(".skill.md"));
|
|
13910
|
+
const skills2 = [];
|
|
13911
|
+
for (const entry of matches) {
|
|
13912
|
+
const full = join2(dir, entry);
|
|
13913
|
+
let raw;
|
|
13914
|
+
try {
|
|
13915
|
+
raw = await readFile4(full, "utf8");
|
|
13916
|
+
} catch (err) {
|
|
13917
|
+
console.warn(
|
|
13918
|
+
`bamboo-agents: couldn't read ${full}: ${err.message}`
|
|
13919
|
+
);
|
|
13920
|
+
continue;
|
|
13921
|
+
}
|
|
13922
|
+
const parsed = parseSkillContent(raw, full);
|
|
13923
|
+
if (parsed) skills2.push(parsed);
|
|
13924
|
+
}
|
|
13925
|
+
skills2.sort((a, b) => a.name.localeCompare(b.name));
|
|
13926
|
+
return skills2;
|
|
13927
|
+
}
|
|
13928
|
+
async function getLocalSkill(repoPath, name) {
|
|
13929
|
+
const dir = await resolveSkillsDir(repoPath);
|
|
13930
|
+
if (!dir) return null;
|
|
13931
|
+
const expectedFile = `${name}.skill.md`;
|
|
13932
|
+
const entries = await readdir2(dir);
|
|
13933
|
+
if (!entries.includes(expectedFile)) return null;
|
|
13934
|
+
const full = join2(dir, expectedFile);
|
|
13935
|
+
let raw;
|
|
13936
|
+
try {
|
|
13937
|
+
raw = await readFile4(full, "utf8");
|
|
13938
|
+
} catch {
|
|
13939
|
+
return null;
|
|
13940
|
+
}
|
|
13941
|
+
return parseSkillContent(raw, full);
|
|
13942
|
+
}
|
|
13943
|
+
var init_skills_local = __esm({
|
|
13944
|
+
"src/lib/skills-local.ts"() {
|
|
13945
|
+
"use strict";
|
|
13946
|
+
}
|
|
13947
|
+
});
|
|
13948
|
+
|
|
13949
|
+
// src/commands/skills.ts
|
|
13950
|
+
var skills_exports = {};
|
|
13951
|
+
__export(skills_exports, {
|
|
13952
|
+
runSkillsGet: () => runSkillsGet,
|
|
13953
|
+
runSkillsList: () => runSkillsList
|
|
13954
|
+
});
|
|
13955
|
+
async function resolveWorkspacePath() {
|
|
13956
|
+
const cfg = await readConfig();
|
|
13957
|
+
if (!cfg) {
|
|
13958
|
+
console.error(
|
|
13959
|
+
"bamboo-agents: no workspace configured. Run `bamboo-agents init` first."
|
|
13960
|
+
);
|
|
13961
|
+
process.exit(1);
|
|
13962
|
+
}
|
|
13963
|
+
return cfg.repo_path;
|
|
13964
|
+
}
|
|
13965
|
+
function summarize(description, max = 80) {
|
|
13966
|
+
const oneLine = description.replace(/\s+/g, " ").trim();
|
|
13967
|
+
if (oneLine.length <= max) return oneLine;
|
|
13968
|
+
return oneLine.slice(0, max - 1) + "\u2026";
|
|
13969
|
+
}
|
|
13970
|
+
function padRight(s, n) {
|
|
13971
|
+
return s.length >= n ? s : s + " ".repeat(n - s.length);
|
|
13972
|
+
}
|
|
13973
|
+
async function runSkillsList() {
|
|
13974
|
+
const repoPath = await resolveWorkspacePath();
|
|
13975
|
+
const skills2 = await listLocalSkills(repoPath);
|
|
13976
|
+
if (skills2.length === 0) {
|
|
13977
|
+
console.log("");
|
|
13978
|
+
console.log(" No skills found.");
|
|
13979
|
+
console.log(` Looked in: ${repoPath}/skills/`);
|
|
13980
|
+
console.log(
|
|
13981
|
+
" Skills are seeded into your workspace on provision (BAM-2309)."
|
|
13982
|
+
);
|
|
13983
|
+
console.log(
|
|
13984
|
+
" If this is empty, the workspace may not have synced yet \u2014 try"
|
|
13985
|
+
);
|
|
13986
|
+
console.log(" `bamboo-agents doctor` to verify your setup.");
|
|
13987
|
+
console.log("");
|
|
13988
|
+
return;
|
|
13989
|
+
}
|
|
13990
|
+
const nameCol = Math.max(
|
|
13991
|
+
"name".length,
|
|
13992
|
+
...skills2.map((s) => s.name.length)
|
|
13993
|
+
);
|
|
13994
|
+
const header = ` ${padRight("name", nameCol)} description`;
|
|
13995
|
+
const rule = " " + "\u2500".repeat(nameCol) + " " + "\u2500".repeat(Math.min(60, 80 - nameCol));
|
|
13996
|
+
console.log("");
|
|
13997
|
+
console.log(header);
|
|
13998
|
+
console.log(rule);
|
|
13999
|
+
for (const skill of skills2) {
|
|
14000
|
+
console.log(
|
|
14001
|
+
` ${padRight(skill.name, nameCol)} ${summarize(skill.description, 80 - nameCol - 4)}`
|
|
14002
|
+
);
|
|
14003
|
+
}
|
|
14004
|
+
console.log("");
|
|
14005
|
+
console.log(` ${skills2.length} skill${skills2.length === 1 ? "" : "s"}.`);
|
|
14006
|
+
console.log("");
|
|
14007
|
+
console.log(" Print one with: bamboo-agents skills get <name>");
|
|
14008
|
+
console.log("");
|
|
14009
|
+
}
|
|
14010
|
+
async function runSkillsGet(name) {
|
|
14011
|
+
if (!name || !name.trim()) {
|
|
14012
|
+
console.error("bamboo-agents: skills get requires a skill name.");
|
|
14013
|
+
console.error("Example: bamboo-agents skills get enhance-instructions");
|
|
14014
|
+
process.exit(2);
|
|
14015
|
+
}
|
|
14016
|
+
const repoPath = await resolveWorkspacePath();
|
|
14017
|
+
const skill = await getLocalSkill(repoPath, name.trim());
|
|
14018
|
+
if (!skill) {
|
|
14019
|
+
await printNotFound(repoPath, name);
|
|
14020
|
+
process.exit(2);
|
|
14021
|
+
}
|
|
14022
|
+
printSkillToStdout(skill);
|
|
14023
|
+
}
|
|
14024
|
+
function printSkillToStdout(skill) {
|
|
14025
|
+
process.stdout.write("---\n");
|
|
14026
|
+
process.stdout.write(`name: ${skill.name}
|
|
14027
|
+
`);
|
|
14028
|
+
process.stdout.write(`description: ${skill.description}
|
|
14029
|
+
`);
|
|
14030
|
+
if (skill.disableModelInvocation) {
|
|
14031
|
+
process.stdout.write("disable-model-invocation: true\n");
|
|
14032
|
+
}
|
|
14033
|
+
if (skill.allowedTools.length > 0) {
|
|
14034
|
+
process.stdout.write(
|
|
14035
|
+
`allowed-tools: [${skill.allowedTools.join(", ")}]
|
|
14036
|
+
`
|
|
14037
|
+
);
|
|
14038
|
+
}
|
|
14039
|
+
process.stdout.write("---\n");
|
|
14040
|
+
process.stdout.write("\n");
|
|
14041
|
+
process.stdout.write(skill.content);
|
|
14042
|
+
if (!skill.content.endsWith("\n")) process.stdout.write("\n");
|
|
14043
|
+
}
|
|
14044
|
+
async function printNotFound(repoPath, name) {
|
|
14045
|
+
const all = await listLocalSkills(repoPath);
|
|
14046
|
+
console.error(`bamboo-agents: skill not found: ${name}`);
|
|
14047
|
+
if (all.length === 0) {
|
|
14048
|
+
console.error(`No skills in ${repoPath}/skills/.`);
|
|
14049
|
+
return;
|
|
14050
|
+
}
|
|
14051
|
+
const lower = name.toLowerCase();
|
|
14052
|
+
const prefixMatches = all.filter(
|
|
14053
|
+
(s) => s.name.toLowerCase().startsWith(lower)
|
|
14054
|
+
);
|
|
14055
|
+
const suggestions = prefixMatches.length > 0 ? prefixMatches : all;
|
|
14056
|
+
console.error("");
|
|
14057
|
+
console.error(
|
|
14058
|
+
prefixMatches.length > 0 ? "Did you mean:" : "Available skills (run `bamboo-agents skills list` for descriptions):"
|
|
14059
|
+
);
|
|
14060
|
+
for (const s of suggestions) {
|
|
14061
|
+
console.error(` ${s.name}`);
|
|
14062
|
+
}
|
|
14063
|
+
}
|
|
14064
|
+
var init_skills = __esm({
|
|
14065
|
+
"src/commands/skills.ts"() {
|
|
14066
|
+
"use strict";
|
|
14067
|
+
init_state();
|
|
14068
|
+
init_skills_local();
|
|
14069
|
+
}
|
|
14070
|
+
});
|
|
14071
|
+
|
|
13791
14072
|
// node_modules/commander/esm.mjs
|
|
13792
14073
|
var import_index = __toESM(require_commander(), 1);
|
|
13793
14074
|
var {
|
|
@@ -13833,6 +14114,15 @@ program2.command("doctor").description("Verify your local setup is ready").actio
|
|
|
13833
14114
|
const { runDoctor: runDoctor2 } = await Promise.resolve().then(() => (init_doctor(), doctor_exports));
|
|
13834
14115
|
await runDoctor2();
|
|
13835
14116
|
});
|
|
14117
|
+
var skills = program2.command("skills").description("Read workspace skills from your local clone");
|
|
14118
|
+
skills.command("list").description("List every skill in the workspace").action(async () => {
|
|
14119
|
+
const { runSkillsList: runSkillsList2 } = await Promise.resolve().then(() => (init_skills(), skills_exports));
|
|
14120
|
+
await runSkillsList2();
|
|
14121
|
+
});
|
|
14122
|
+
skills.command("get <name>").description("Print one skill's SKILL.md body to stdout").action(async (name) => {
|
|
14123
|
+
const { runSkillsGet: runSkillsGet2 } = await Promise.resolve().then(() => (init_skills(), skills_exports));
|
|
14124
|
+
await runSkillsGet2(name);
|
|
14125
|
+
});
|
|
13836
14126
|
program2.parseAsync().catch((err) => {
|
|
13837
14127
|
const message = err instanceof Error ? err.message : String(err);
|
|
13838
14128
|
console.error(`bamboo-agents: ${message}`);
|