@bunshin-cc/bunshin 0.3.2 → 0.3.3
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/bin.js +34 -7
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -3352,7 +3352,7 @@ function repoCommit(root) {
|
|
|
3352
3352
|
}
|
|
3353
3353
|
function listDocs(root) {
|
|
3354
3354
|
const listed = git(root, ["ls-files", "-co", "--exclude-standard", "-z"], 3e3);
|
|
3355
|
-
if (listed !== null) return [...new Set(listed.split("\0").filter(Boolean).filter(isDoc))].filter((rel) => fs7.existsSync(path6.join(root, rel))).sort();
|
|
3355
|
+
if (listed !== null) return [...new Set(listed.split("\0").filter(Boolean).filter(isDoc))].filter((rel) => fs7.existsSync(path6.join(root, rel)) && !deployedSkill(root, rel)).sort();
|
|
3356
3356
|
const out = [];
|
|
3357
3357
|
let visited = 0;
|
|
3358
3358
|
const walk = (dir, rel, depth) => {
|
|
@@ -3365,10 +3365,10 @@ function listDocs(root) {
|
|
|
3365
3365
|
}
|
|
3366
3366
|
for (const e of entries) {
|
|
3367
3367
|
if (e.isDirectory()) {
|
|
3368
|
-
if (!SKIP_DIRS.has(e.name)) walk(path6.join(dir, e.name), rel ? `${rel}/${e.name}` : e.name, depth + 1);
|
|
3368
|
+
if (!SKIP_DIRS.has(e.name) && !fs7.existsSync(path6.join(dir, e.name, ".git"))) walk(path6.join(dir, e.name), rel ? `${rel}/${e.name}` : e.name, depth + 1);
|
|
3369
3369
|
} else if (e.isFile()) {
|
|
3370
3370
|
const r = rel ? `${rel}/${e.name}` : e.name;
|
|
3371
|
-
if (isDoc(r)) out.push(r);
|
|
3371
|
+
if (isDoc(r) && !deployedSkill(root, r)) out.push(r);
|
|
3372
3372
|
}
|
|
3373
3373
|
}
|
|
3374
3374
|
};
|
|
@@ -3448,7 +3448,7 @@ function relativeToRoot(root, file, cwd = root) {
|
|
|
3448
3448
|
}
|
|
3449
3449
|
return null;
|
|
3450
3450
|
}
|
|
3451
|
-
var DOC_NAMES, SKIP_DIRS, LIST_TTL_MS, rootCache, isDoc;
|
|
3451
|
+
var DOC_NAMES, SKIP_DIRS, LIST_TTL_MS, rootCache, isDoc, deployedSkill;
|
|
3452
3452
|
var init_repo = __esm({
|
|
3453
3453
|
"src/v2/repo.ts"() {
|
|
3454
3454
|
"use strict";
|
|
@@ -3462,6 +3462,7 @@ var init_repo = __esm({
|
|
|
3462
3462
|
if (parts.some((p) => SKIP_DIRS.has(p))) return false;
|
|
3463
3463
|
return DOC_NAMES.has(parts[parts.length - 1].toLowerCase());
|
|
3464
3464
|
};
|
|
3465
|
+
deployedSkill = (root, rel) => /(^|\/)SKILL\.md$/i.test(rel) && fs7.existsSync(path6.join(root, path6.posix.dirname(rel), ".bunshin.json"));
|
|
3465
3466
|
}
|
|
3466
3467
|
});
|
|
3467
3468
|
|
|
@@ -4515,6 +4516,7 @@ __export(commands_exports, {
|
|
|
4515
4516
|
cmdRecall: () => cmdRecall,
|
|
4516
4517
|
cmdReflectFork: () => cmdReflectFork,
|
|
4517
4518
|
cmdReview: () => cmdReview,
|
|
4519
|
+
cmdReviewDecide: () => cmdReviewDecide,
|
|
4518
4520
|
cmdSuggest: () => cmdSuggest,
|
|
4519
4521
|
cmdSync: () => cmdSync,
|
|
4520
4522
|
robotAttrsFromFlags: () => robotAttrsFromFlags,
|
|
@@ -4556,7 +4558,7 @@ function cmdReview(store, args, cwd, out, err) {
|
|
|
4556
4558
|
`);
|
|
4557
4559
|
}
|
|
4558
4560
|
out(`
|
|
4559
|
-
bunshin review apply <id> | submit <id> | skip <id> | apply-all
|
|
4561
|
+
bunshin review apply <id> | submit <id> | skip <id> | apply-all (owners: approve <id> | reject <id> [--note])
|
|
4560
4562
|
`);
|
|
4561
4563
|
return 0;
|
|
4562
4564
|
}
|
|
@@ -4598,6 +4600,29 @@ bunshin review apply <id> | submit <id> | skip <id> | apply-all
|
|
|
4598
4600
|
`);
|
|
4599
4601
|
return 1;
|
|
4600
4602
|
}
|
|
4603
|
+
async function cmdReviewDecide(store, args, out, err) {
|
|
4604
|
+
const sub = args._[1];
|
|
4605
|
+
const id = args._[2];
|
|
4606
|
+
if (!id) {
|
|
4607
|
+
err(`bunshin review ${sub}: a suggestion id is required (see the console's Review, or bunshin review list --all)
|
|
4608
|
+
`);
|
|
4609
|
+
return 1;
|
|
4610
|
+
}
|
|
4611
|
+
const config = store.config();
|
|
4612
|
+
if (!canCall(config)) {
|
|
4613
|
+
err(`bunshin review ${sub}: this project is not connected to Bunshin
|
|
4614
|
+
`);
|
|
4615
|
+
return 1;
|
|
4616
|
+
}
|
|
4617
|
+
const note = str(args.flags.note);
|
|
4618
|
+
const res = await v2api(config, "POST", `/suggestions/${encodeURIComponent(id)}/review`, {
|
|
4619
|
+
approve: sub === "approve",
|
|
4620
|
+
...note ? { note } : {}
|
|
4621
|
+
});
|
|
4622
|
+
out(`${res.suggestion.id}: ${res.suggestion.status}${res.suggestion.decision?.reason ? ` (${res.suggestion.decision.reason})` : ""}
|
|
4623
|
+
`);
|
|
4624
|
+
return 0;
|
|
4625
|
+
}
|
|
4601
4626
|
async function cmdRecall(store, args, cwd, out, err) {
|
|
4602
4627
|
const abstract = args._.slice(1).join(" ").trim() || str(args.flags.abstract) || "";
|
|
4603
4628
|
if (!abstract) {
|
|
@@ -8344,8 +8369,9 @@ Usage: bunshin <command> [options]
|
|
|
8344
8369
|
print one document (or one part of it) and mark it loaded
|
|
8345
8370
|
learn [focus...] capture what this session learned now (fork reflection),
|
|
8346
8371
|
apply it locally as a trial and submit it
|
|
8347
|
-
review [list [--all]|apply <id>|submit <id>|skip <id>|apply-all]
|
|
8348
|
-
suggestions awaiting review (apply = local trial + submit
|
|
8372
|
+
review [list [--all]|apply <id>|submit <id>|skip <id>|apply-all|approve <id>|reject <id> [--note <text>]]
|
|
8373
|
+
suggestions awaiting review (apply = local trial + submit;
|
|
8374
|
+
approve / reject = owner decision: merge now, or keep it out)
|
|
8349
8375
|
index [--upload] [--json] parse SPEC.md / TESTING.md / SKILL.md into sections
|
|
8350
8376
|
sync [--index] [--json] upload episodes + suggestions (incl. in-place skill edits), pull
|
|
8351
8377
|
the library, install skills / instructions / files, settle trials
|
|
@@ -8515,6 +8541,7 @@ Key saved privately outside the project.
|
|
|
8515
8541
|
case "suggest":
|
|
8516
8542
|
return (await Promise.resolve().then(() => (init_commands(), commands_exports))).cmdSuggest(store, args, cwd, out, err);
|
|
8517
8543
|
case "review":
|
|
8544
|
+
if (args._[1] === "approve" || args._[1] === "reject") return await (await Promise.resolve().then(() => (init_commands(), commands_exports))).cmdReviewDecide(store, args, out, err);
|
|
8518
8545
|
return (await Promise.resolve().then(() => (init_commands(), commands_exports))).cmdReview(store, args, cwd, out, err);
|
|
8519
8546
|
case "questions":
|
|
8520
8547
|
case "question":
|