@botconnector/bccli 0.4.0-beta.8 → 0.4.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/README.en.md +242 -0
- package/README.md +95 -3
- package/dist/acp-ATIL4JOZ.js +182 -0
- package/dist/args-J5ONVGIF.js +13 -0
- package/dist/chunk-45SDLMTV.js +341 -0
- package/dist/chunk-6M5X2KZE.js +8 -0
- package/dist/chunk-7F3IWBPQ.js +191 -0
- package/dist/{chunk-CLN4Z5E3.js → chunk-BLOYFIAD.js} +6 -3
- package/dist/chunk-BNA74HPN.js +145 -0
- package/dist/{chunk-DX7CZTBB.js → chunk-BQ2IGPBR.js} +14 -9
- package/dist/chunk-JL5ZCSP2.js +76 -0
- package/dist/chunk-KEMYIGCP.js +235 -0
- package/dist/{chunk-BFZXRKW5.js → chunk-L7QI6JN2.js} +24 -2
- package/dist/chunk-LACUWBWS.js +361 -0
- package/dist/chunk-M7CALSP3.js +733 -0
- package/dist/{chunk-ELML4KVQ.js → chunk-O7M3TGIW.js} +34 -2
- package/dist/chunk-PSO7R5AD.js +10 -0
- package/dist/chunk-PUN4HMAG.js +940 -0
- package/dist/{chunk-SJH3YLW4.js → chunk-QDQU6VY2.js} +60 -6
- package/dist/chunk-QZKLZELZ.js +64 -0
- package/dist/{chunk-7S6JXQCH.js → chunk-SPRNLS7K.js} +2 -1
- package/dist/chunk-TLPFQIS2.js +231 -0
- package/dist/chunk-TVALKHFB.js +2143 -0
- package/dist/chunk-UZWJQF67.js +500 -0
- package/dist/chunk-XBO5GACQ.js +56 -0
- package/dist/cli.js +162 -1383
- package/dist/completion-HPPFDAPB.js +125 -0
- package/dist/{config-YUNKPCNB.js → config-COPNMMV6.js} +5 -2
- package/dist/config-RZ5JONMX.js +30 -0
- package/dist/ghBotCli-IBCZIWT5.js +677 -0
- package/dist/integrationCli-P75R2VSC.js +685 -0
- package/dist/login-SYIQP46J.js +16 -0
- package/dist/{mcpCli-DZWQPTOS.js → mcpCli-QUV5SD64.js} +42 -9
- package/dist/modelsCli-TRRB5LX4.js +36 -0
- package/dist/npmRunner-LU43GM3W.js +46 -0
- package/dist/oauthLogin-6FWQABJ7.js +210 -0
- package/dist/pluginsCli-GNW4TPVV.js +284 -0
- package/dist/prCli-5IMV3VNQ.js +78 -0
- package/dist/providerCli-FAOZHOKW.js +15 -0
- package/dist/sdk.js +5490 -0
- package/dist/serve-6QLBJUYW.js +178 -0
- package/dist/serve-JG7RLIUD.js +515 -0
- package/dist/session-KBAQ4BZ5.js +12 -0
- package/dist/setup-FJAWDWV4.js +24 -0
- package/dist/statsCli-CF3R7ATL.js +353 -0
- package/dist/transferCli-TK2GSVRK.js +71 -0
- package/dist/ui-B3CJ6TGE.js +2365 -0
- package/dist/update-K5IQ2MYR.js +145 -0
- package/package.json +25 -4
- package/dist/args-FLTRM57K.js +0 -12
- package/dist/chunk-2MGINW4O.js +0 -114
- package/dist/chunk-IM3KMPVZ.js +0 -52
- package/dist/chunk-KV27KTOX.js +0 -254
- package/dist/chunk-U7GK73CK.js +0 -341
- package/dist/chunk-Z7PM3LTC.js +0 -93
- package/dist/login-JXFORO3J.js +0 -9
- package/dist/providerCli-Q7LRM2NP.js +0 -12
- package/dist/session-7UB77CEG.js +0 -9
- package/dist/ui-6GTQUJOE.js +0 -1415
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
t
|
|
4
|
+
} from "./chunk-UZWJQF67.js";
|
|
5
|
+
|
|
6
|
+
// src/prCli.ts
|
|
7
|
+
import { spawn } from "child_process";
|
|
8
|
+
function defaultGh(argv) {
|
|
9
|
+
return new Promise((resolve) => {
|
|
10
|
+
const child = spawn("gh", argv, { shell: false, stdio: ["ignore", "pipe", "pipe"] });
|
|
11
|
+
let stdout = "";
|
|
12
|
+
let stderr = "";
|
|
13
|
+
child.stdout?.on("data", (d) => {
|
|
14
|
+
stdout += d;
|
|
15
|
+
});
|
|
16
|
+
child.stderr?.on("data", (d) => {
|
|
17
|
+
stderr += d;
|
|
18
|
+
});
|
|
19
|
+
child.on("error", (e) => resolve({ code: 127, stdout, stderr: String(e) }));
|
|
20
|
+
child.on("close", (code) => resolve({ code: code ?? 1, stdout, stderr }));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function prTaskArgv(entry, opts) {
|
|
24
|
+
return [entry, ...opts.prompt ? ["-p", opts.prompt] : [], ...opts.allowAll ? ["--allow-all"] : []];
|
|
25
|
+
}
|
|
26
|
+
async function defaultRunTask(opts) {
|
|
27
|
+
const entry = process.argv[1];
|
|
28
|
+
if (!entry) return 1;
|
|
29
|
+
return new Promise((resolve) => {
|
|
30
|
+
const child = spawn(process.execPath, prTaskArgv(entry, opts), {
|
|
31
|
+
shell: false,
|
|
32
|
+
stdio: "inherit",
|
|
33
|
+
cwd: opts.cwd
|
|
34
|
+
});
|
|
35
|
+
child.on("error", () => resolve(1));
|
|
36
|
+
child.on("close", (code) => resolve(code ?? 1));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async function runPrCommand(args, deps) {
|
|
40
|
+
const rest = [...args.subArgs];
|
|
41
|
+
let repo;
|
|
42
|
+
const words = [];
|
|
43
|
+
for (let i = 0; i < rest.length; i++) {
|
|
44
|
+
if (rest[i] === "--repo") {
|
|
45
|
+
repo = rest[++i];
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
words.push(rest[i]);
|
|
49
|
+
}
|
|
50
|
+
const number = words.shift();
|
|
51
|
+
if (!number || !/^\d+$/.test(number)) {
|
|
52
|
+
deps.err?.(t("usage: bccli pr <number> [--repo owner/name] [task]"));
|
|
53
|
+
return 1;
|
|
54
|
+
}
|
|
55
|
+
const task = words.length ? words.join(" ") : void 0;
|
|
56
|
+
const gh = deps.gh ?? defaultGh;
|
|
57
|
+
const checkoutArgv = ["pr", "checkout", number, ...repo ? ["--repo", repo] : []];
|
|
58
|
+
let res;
|
|
59
|
+
try {
|
|
60
|
+
res = await gh(checkoutArgv);
|
|
61
|
+
} catch (e) {
|
|
62
|
+
deps.err?.(t("gh is not available ({error}); install GitHub CLI first", { error: String(e) }));
|
|
63
|
+
return 1;
|
|
64
|
+
}
|
|
65
|
+
if (res.code !== 0) {
|
|
66
|
+
deps.err?.(t("gh pr checkout {n} failed (exit {code})", { n: number, code: String(res.code) }));
|
|
67
|
+
return 1;
|
|
68
|
+
}
|
|
69
|
+
deps.out(t("checked out PR #{n}", { n: number }));
|
|
70
|
+
const runTask = deps.runTask ?? defaultRunTask;
|
|
71
|
+
const allowAll = args.allowAll === true;
|
|
72
|
+
if (allowAll) deps.err?.(t("--allow-all: the PR task runs every tool without asking"));
|
|
73
|
+
return runTask({ prompt: task, allowAll, cwd: args.cwd });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
prTaskArgv,
|
|
77
|
+
runPrCommand
|
|
78
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
addProviderKey,
|
|
4
|
+
runProviderCommand
|
|
5
|
+
} from "./chunk-JL5ZCSP2.js";
|
|
6
|
+
import "./chunk-XBO5GACQ.js";
|
|
7
|
+
import "./chunk-SPRNLS7K.js";
|
|
8
|
+
import "./chunk-PUN4HMAG.js";
|
|
9
|
+
import "./chunk-BLOYFIAD.js";
|
|
10
|
+
import "./chunk-LACUWBWS.js";
|
|
11
|
+
import "./chunk-UZWJQF67.js";
|
|
12
|
+
export {
|
|
13
|
+
addProviderKey,
|
|
14
|
+
runProviderCommand
|
|
15
|
+
};
|