@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.
Files changed (59) hide show
  1. package/README.en.md +242 -0
  2. package/README.md +95 -3
  3. package/dist/acp-ATIL4JOZ.js +182 -0
  4. package/dist/args-J5ONVGIF.js +13 -0
  5. package/dist/chunk-45SDLMTV.js +341 -0
  6. package/dist/chunk-6M5X2KZE.js +8 -0
  7. package/dist/chunk-7F3IWBPQ.js +191 -0
  8. package/dist/{chunk-CLN4Z5E3.js → chunk-BLOYFIAD.js} +6 -3
  9. package/dist/chunk-BNA74HPN.js +145 -0
  10. package/dist/{chunk-DX7CZTBB.js → chunk-BQ2IGPBR.js} +14 -9
  11. package/dist/chunk-JL5ZCSP2.js +76 -0
  12. package/dist/chunk-KEMYIGCP.js +235 -0
  13. package/dist/{chunk-BFZXRKW5.js → chunk-L7QI6JN2.js} +24 -2
  14. package/dist/chunk-LACUWBWS.js +361 -0
  15. package/dist/chunk-M7CALSP3.js +733 -0
  16. package/dist/{chunk-ELML4KVQ.js → chunk-O7M3TGIW.js} +34 -2
  17. package/dist/chunk-PSO7R5AD.js +10 -0
  18. package/dist/chunk-PUN4HMAG.js +940 -0
  19. package/dist/{chunk-SJH3YLW4.js → chunk-QDQU6VY2.js} +60 -6
  20. package/dist/chunk-QZKLZELZ.js +64 -0
  21. package/dist/{chunk-7S6JXQCH.js → chunk-SPRNLS7K.js} +2 -1
  22. package/dist/chunk-TLPFQIS2.js +231 -0
  23. package/dist/chunk-TVALKHFB.js +2143 -0
  24. package/dist/chunk-UZWJQF67.js +500 -0
  25. package/dist/chunk-XBO5GACQ.js +56 -0
  26. package/dist/cli.js +162 -1383
  27. package/dist/completion-HPPFDAPB.js +125 -0
  28. package/dist/{config-YUNKPCNB.js → config-COPNMMV6.js} +5 -2
  29. package/dist/config-RZ5JONMX.js +30 -0
  30. package/dist/ghBotCli-IBCZIWT5.js +677 -0
  31. package/dist/integrationCli-P75R2VSC.js +685 -0
  32. package/dist/login-SYIQP46J.js +16 -0
  33. package/dist/{mcpCli-DZWQPTOS.js → mcpCli-QUV5SD64.js} +42 -9
  34. package/dist/modelsCli-TRRB5LX4.js +36 -0
  35. package/dist/npmRunner-LU43GM3W.js +46 -0
  36. package/dist/oauthLogin-6FWQABJ7.js +210 -0
  37. package/dist/pluginsCli-GNW4TPVV.js +284 -0
  38. package/dist/prCli-5IMV3VNQ.js +78 -0
  39. package/dist/providerCli-FAOZHOKW.js +15 -0
  40. package/dist/sdk.js +5490 -0
  41. package/dist/serve-6QLBJUYW.js +178 -0
  42. package/dist/serve-JG7RLIUD.js +515 -0
  43. package/dist/session-KBAQ4BZ5.js +12 -0
  44. package/dist/setup-FJAWDWV4.js +24 -0
  45. package/dist/statsCli-CF3R7ATL.js +353 -0
  46. package/dist/transferCli-TK2GSVRK.js +71 -0
  47. package/dist/ui-B3CJ6TGE.js +2365 -0
  48. package/dist/update-K5IQ2MYR.js +145 -0
  49. package/package.json +25 -4
  50. package/dist/args-FLTRM57K.js +0 -12
  51. package/dist/chunk-2MGINW4O.js +0 -114
  52. package/dist/chunk-IM3KMPVZ.js +0 -52
  53. package/dist/chunk-KV27KTOX.js +0 -254
  54. package/dist/chunk-U7GK73CK.js +0 -341
  55. package/dist/chunk-Z7PM3LTC.js +0 -93
  56. package/dist/login-JXFORO3J.js +0 -9
  57. package/dist/providerCli-Q7LRM2NP.js +0 -12
  58. package/dist/session-7UB77CEG.js +0 -9
  59. 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
+ };