@botconnector/bccli 0.4.0-beta.42 → 0.4.0-beta.44
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/{acp-PP7ZONVQ.js → acp-U25MNDND.js} +2 -2
- package/dist/{args-3DGIMRTG.js → args-MFTMBNRN.js} +4 -4
- package/dist/{chunk-LYFN6AEV.js → chunk-25DSN3Y3.js} +4 -4
- package/dist/{chunk-A2XKKKKU.js → chunk-2ON3WIDP.js} +4 -4
- package/dist/{chunk-HVGXCPDG.js → chunk-BQHKN7JI.js} +1 -1
- package/dist/{chunk-ADS5FDWL.js → chunk-CYTRCZXI.js} +20 -7
- package/dist/{chunk-AGIZBZ64.js → chunk-GIGWZFCY.js} +1 -1
- package/dist/{chunk-3P5N6UPF.js → chunk-I7GXIJCY.js} +2 -2
- package/dist/{chunk-Q2ZBR4OU.js → chunk-LTAQXU5Z.js} +1 -1
- package/dist/{chunk-QZM66F3A.js → chunk-NVRNFR4S.js} +1 -1
- package/dist/{chunk-DRK3XTVZ.js → chunk-PSRNKKGA.js} +1 -1
- package/dist/{chunk-NFJPKNHL.js → chunk-PZC2Q6MJ.js} +2 -2
- package/dist/{chunk-VBEX5YHF.js → chunk-QHNWI3OT.js} +22 -1
- package/dist/{chunk-LYQHLA43.js → chunk-RMDW3OQ6.js} +2 -2
- package/dist/{chunk-O74EQFYI.js → chunk-TW5HZOTB.js} +3 -3
- package/dist/chunk-U6PCNS4B.js +20 -0
- package/dist/{chunk-I422TPGX.js → chunk-VO6MF6JJ.js} +1 -1
- package/dist/{chunk-I4THUZRD.js → chunk-Y3QKYORR.js} +6 -6
- package/dist/{chunk-HQB227LD.js → chunk-ZGH4B7OU.js} +15 -23
- package/dist/{chunk-AWNQDAOY.js → chunk-ZKMSTD6G.js} +1 -1
- package/dist/cli.js +70 -33
- package/dist/completion-6K4AXKK2.js +125 -0
- package/dist/{config-UKEKWMCG.js → config-LCY27K3L.js} +2 -2
- package/dist/{config-LFT2FNSE.js → config-Z4HSA435.js} +3 -3
- package/dist/{ghBotCli-DWQXAIKE.js → ghBotCli-TJMKJU3E.js} +14 -13
- package/dist/{integrationCli-RSJCJ3NW.js → integrationCli-33KU6GIK.js} +2 -2
- package/dist/{login-L3SUO4H4.js → login-LNF7ZV2S.js} +3 -3
- package/dist/{mcpCli-RSLEDQQ7.js → mcpCli-TXFS3AOJ.js} +5 -5
- package/dist/{modelsCli-IKZLORLH.js → modelsCli-IZSMIYVB.js} +6 -6
- package/dist/{oauthLogin-XHEMYL6L.js → oauthLogin-QGDYTOW7.js} +1 -1
- package/dist/{pluginsCli-MRS547WG.js → pluginsCli-RD4QW3DX.js} +2 -2
- package/dist/prCli-PE7KIPMK.js +72 -0
- package/dist/providerCli-AA3CHCGV.js +15 -0
- package/dist/sdk.js +34 -5
- package/dist/{serve-GFNJ5PSL.js → serve-HW5XZ5LF.js} +15 -14
- package/dist/{serve-A4E67R5E.js → serve-YNKE332Z.js} +3 -3
- package/dist/session-KRV2UP5C.js +12 -0
- package/dist/setup-L4OPF3XW.js +24 -0
- package/dist/statsCli-4KYPVYCN.js +109 -0
- package/dist/transferCli-RQBB6RVY.js +71 -0
- package/dist/{ui-STI6HSOR.js → ui-4ZTUMTYM.js} +12 -12
- package/dist/{update-KMWE2P2I.js → update-34FDI6H3.js} +2 -2
- package/package.json +1 -1
- package/dist/providerCli-7GRUL3BS.js +0 -15
- package/dist/session-VKVBMGCC.js +0 -12
- package/dist/setup-XWX64X5Q.js +0 -23
package/dist/cli.js
CHANGED
|
@@ -2,46 +2,63 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveWorktree,
|
|
4
4
|
runPrint
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TW5HZOTB.js";
|
|
6
6
|
import {
|
|
7
7
|
createRuntime
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-ZGH4B7OU.js";
|
|
9
|
+
import "./chunk-U6PCNS4B.js";
|
|
10
|
+
import "./chunk-PSRNKKGA.js";
|
|
11
|
+
import "./chunk-NVRNFR4S.js";
|
|
11
12
|
import "./chunk-PSO7R5AD.js";
|
|
12
13
|
import {
|
|
13
14
|
VERSION
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LTAQXU5Z.js";
|
|
15
16
|
import {
|
|
16
17
|
helpText,
|
|
17
18
|
parseCliArgs
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CYTRCZXI.js";
|
|
19
20
|
import "./chunk-GAFJEQTJ.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-2ON3WIDP.js";
|
|
22
|
+
import "./chunk-25DSN3Y3.js";
|
|
22
23
|
import {
|
|
23
24
|
readGlobalConfigFile
|
|
24
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-VO6MF6JJ.js";
|
|
25
26
|
import {
|
|
26
27
|
defaultLoginDeps,
|
|
27
28
|
runLogin
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-Y3QKYORR.js";
|
|
29
30
|
import "./chunk-7F3IWBPQ.js";
|
|
30
31
|
import {
|
|
31
32
|
pruneSessions
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-BQHKN7JI.js";
|
|
34
|
+
import "./chunk-RMDW3OQ6.js";
|
|
35
|
+
import "./chunk-ZKMSTD6G.js";
|
|
36
|
+
import "./chunk-PZC2Q6MJ.js";
|
|
36
37
|
import {
|
|
37
38
|
ConfigError,
|
|
38
39
|
setTheme
|
|
39
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-GIGWZFCY.js";
|
|
40
41
|
import {
|
|
41
42
|
resolveLanguage,
|
|
42
43
|
setLanguage,
|
|
43
44
|
t
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-QHNWI3OT.js";
|
|
46
|
+
|
|
47
|
+
// src/exit.ts
|
|
48
|
+
var EXIT_GRACE_MS = 1e3;
|
|
49
|
+
function settleExit(code, deps) {
|
|
50
|
+
const d = {
|
|
51
|
+
setExitCode: (c) => {
|
|
52
|
+
process.exitCode = c;
|
|
53
|
+
},
|
|
54
|
+
exit: (c) => process.exit(c),
|
|
55
|
+
setTimer: (fn, ms) => setTimeout(fn, ms),
|
|
56
|
+
...deps
|
|
57
|
+
};
|
|
58
|
+
d.setExitCode(code);
|
|
59
|
+
const force = d.setTimer(() => d.exit(code), EXIT_GRACE_MS);
|
|
60
|
+
force.unref();
|
|
61
|
+
}
|
|
45
62
|
|
|
46
63
|
// src/cli.ts
|
|
47
64
|
function chooseLanguage(argv) {
|
|
@@ -67,17 +84,17 @@ async function main() {
|
|
|
67
84
|
if (args.worktree) cwd = (await resolveWorktree(cwd, args.worktree)).path;
|
|
68
85
|
if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd, args, defaultLoginDeps());
|
|
69
86
|
if (args.command === "mcp") {
|
|
70
|
-
const { runMcpCommand } = await import("./mcpCli-
|
|
71
|
-
const { readSecret } = await import("./login-
|
|
87
|
+
const { runMcpCommand } = await import("./mcpCli-TXFS3AOJ.js");
|
|
88
|
+
const { readSecret } = await import("./login-LNF7ZV2S.js");
|
|
72
89
|
return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
73
90
|
}
|
|
74
91
|
if (args.command === "provider") {
|
|
75
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
76
|
-
const { readSecret } = await import("./login-
|
|
92
|
+
const { runProviderCommand } = await import("./providerCli-AA3CHCGV.js");
|
|
93
|
+
const { readSecret } = await import("./login-LNF7ZV2S.js");
|
|
77
94
|
return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
78
95
|
}
|
|
79
96
|
if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
|
|
80
|
-
const { runIntegrationCommand } = await import("./integrationCli-
|
|
97
|
+
const { runIntegrationCommand } = await import("./integrationCli-33KU6GIK.js");
|
|
81
98
|
return runIntegrationCommand(args, {
|
|
82
99
|
env: process.env,
|
|
83
100
|
cwd,
|
|
@@ -87,20 +104,20 @@ async function main() {
|
|
|
87
104
|
});
|
|
88
105
|
}
|
|
89
106
|
if (args.command === "models") {
|
|
90
|
-
const { runModelsCommand } = await import("./modelsCli-
|
|
107
|
+
const { runModelsCommand } = await import("./modelsCli-IZSMIYVB.js");
|
|
91
108
|
return runModelsCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), fetch: globalThis.fetch });
|
|
92
109
|
}
|
|
93
110
|
if (args.command === "update") {
|
|
94
|
-
const { runUpdateCommand } = await import("./update-
|
|
111
|
+
const { runUpdateCommand } = await import("./update-34FDI6H3.js");
|
|
95
112
|
return runUpdateCommand({ env: process.env });
|
|
96
113
|
}
|
|
97
114
|
if (args.command === "acp") {
|
|
98
|
-
const { runtimeAgent, runAcp } = await import("./acp-
|
|
115
|
+
const { runtimeAgent, runAcp } = await import("./acp-U25MNDND.js");
|
|
99
116
|
await runAcp(process.stdin, process.stdout, { cwd, newAgent: (c) => runtimeAgent(c) });
|
|
100
117
|
return 0;
|
|
101
118
|
}
|
|
102
119
|
if (args.command === "serve") {
|
|
103
|
-
const { startServe } = await import("./serve-
|
|
120
|
+
const { startServe } = await import("./serve-HW5XZ5LF.js");
|
|
104
121
|
const handle = await startServe({ port: args.port, host: args.host, token: args.token, cwd, env: process.env });
|
|
105
122
|
process.stderr.write(`bccli serve ${handle.url} \u2014 Authorization: Bearer ${handle.token}
|
|
106
123
|
`);
|
|
@@ -114,8 +131,8 @@ async function main() {
|
|
|
114
131
|
return 0;
|
|
115
132
|
}
|
|
116
133
|
if (args.command === "plugins") {
|
|
117
|
-
const { runPluginsCommand } = await import("./pluginsCli-
|
|
118
|
-
const { readGlobalPlugins, updateGlobalConfig } = await import("./config-
|
|
134
|
+
const { runPluginsCommand } = await import("./pluginsCli-RD4QW3DX.js");
|
|
135
|
+
const { readGlobalPlugins, updateGlobalConfig } = await import("./config-LCY27K3L.js");
|
|
119
136
|
const { runNpmSync } = await import("./npmRunner-LU43GM3W.js");
|
|
120
137
|
return runPluginsCommand(args, {
|
|
121
138
|
out: (s) => console.log(s),
|
|
@@ -129,9 +146,29 @@ async function main() {
|
|
|
129
146
|
});
|
|
130
147
|
}
|
|
131
148
|
if (args.command === "gh-bot") {
|
|
132
|
-
const { runGhBotCommand } = await import("./ghBotCli-
|
|
149
|
+
const { runGhBotCommand } = await import("./ghBotCli-TJMKJU3E.js");
|
|
133
150
|
return runGhBotCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
134
151
|
}
|
|
152
|
+
if (args.command === "completion") {
|
|
153
|
+
const { runCompletionCommand } = await import("./completion-6K4AXKK2.js");
|
|
154
|
+
return runCompletionCommand(args, { out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
155
|
+
}
|
|
156
|
+
if (args.command === "stats") {
|
|
157
|
+
const { runStatsCommand } = await import("./statsCli-4KYPVYCN.js");
|
|
158
|
+
const { bccliHome } = await import("./config-LCY27K3L.js");
|
|
159
|
+
return runStatsCommand({ subArgs: args.subArgs, home: bccliHome(process.env), days: args.days }, { out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
160
|
+
}
|
|
161
|
+
if (args.command === "export" || args.command === "import") {
|
|
162
|
+
const { runExportCommand, runImportCommand } = await import("./transferCli-RQBB6RVY.js");
|
|
163
|
+
const { bccliHome } = await import("./config-LCY27K3L.js");
|
|
164
|
+
const deps = { subArgs: args.subArgs, home: bccliHome(process.env), cwd };
|
|
165
|
+
const io = { out: (s) => console.log(s), err: (s) => console.error(s) };
|
|
166
|
+
return args.command === "export" ? runExportCommand(deps, io) : runImportCommand(deps, io);
|
|
167
|
+
}
|
|
168
|
+
if (args.command === "pr") {
|
|
169
|
+
const { runPrCommand } = await import("./prCli-PE7KIPMK.js");
|
|
170
|
+
return runPrCommand({ subArgs: args.subArgs, cwd }, { out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
171
|
+
}
|
|
135
172
|
const rt = createRuntime({ cwd, args });
|
|
136
173
|
setTheme(rt.config.theme);
|
|
137
174
|
try {
|
|
@@ -140,7 +177,7 @@ async function main() {
|
|
|
140
177
|
}
|
|
141
178
|
if (args.print) {
|
|
142
179
|
if (!args.prompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
|
|
143
|
-
const { serversToStart } = await import("./config-
|
|
180
|
+
const { serversToStart } = await import("./config-Z4HSA435.js");
|
|
144
181
|
const plan = serversToStart(rt.home, cwd);
|
|
145
182
|
for (const s of plan.needTrust) {
|
|
146
183
|
console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
|
|
@@ -155,19 +192,19 @@ async function main() {
|
|
|
155
192
|
if (!process.stdin.isTTY) throw new ConfigError(t('Interactive mode needs a terminal. For scripts/CI use: bccli -p "task"'));
|
|
156
193
|
if (rt.config.updateCheck !== "off" && !process.env.BCCLI_NO_UPDATE_CHECK) {
|
|
157
194
|
try {
|
|
158
|
-
const { checkForUpdate } = await import("./update-
|
|
195
|
+
const { checkForUpdate } = await import("./update-34FDI6H3.js");
|
|
159
196
|
const update = await checkForUpdate({ home: rt.home, fetch: globalThis.fetch, now: /* @__PURE__ */ new Date() });
|
|
160
197
|
if (update) console.error(update);
|
|
161
198
|
} catch {
|
|
162
199
|
}
|
|
163
200
|
}
|
|
164
|
-
const { startInteractive } = await import("./ui-
|
|
201
|
+
const { startInteractive } = await import("./ui-4ZTUMTYM.js");
|
|
165
202
|
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION });
|
|
166
203
|
}
|
|
167
204
|
main().then(
|
|
168
|
-
(code) =>
|
|
205
|
+
(code) => settleExit(code),
|
|
169
206
|
(error) => {
|
|
170
207
|
console.error(error instanceof ConfigError || error?.code === "ERR_PARSE_ARGS_UNKNOWN_OPTION" ? error.message : error);
|
|
171
|
-
|
|
208
|
+
settleExit(1);
|
|
172
209
|
}
|
|
173
210
|
);
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
t
|
|
4
|
+
} from "./chunk-QHNWI3OT.js";
|
|
5
|
+
|
|
6
|
+
// src/completion.ts
|
|
7
|
+
var SHELLS = ["bash", "zsh", "fish", "powershell"];
|
|
8
|
+
function isCompletionShell(value) {
|
|
9
|
+
return SHELLS.includes(value);
|
|
10
|
+
}
|
|
11
|
+
var COMMANDS = [
|
|
12
|
+
"completion",
|
|
13
|
+
"stats",
|
|
14
|
+
"export",
|
|
15
|
+
"import",
|
|
16
|
+
"pr",
|
|
17
|
+
"login",
|
|
18
|
+
"models",
|
|
19
|
+
"update",
|
|
20
|
+
"acp",
|
|
21
|
+
"serve",
|
|
22
|
+
"plugins",
|
|
23
|
+
"gh-bot",
|
|
24
|
+
"provider",
|
|
25
|
+
"mcp",
|
|
26
|
+
"connect",
|
|
27
|
+
"disconnect",
|
|
28
|
+
"integrations"
|
|
29
|
+
];
|
|
30
|
+
var FLAGS = [
|
|
31
|
+
"-p",
|
|
32
|
+
"--print",
|
|
33
|
+
"-m",
|
|
34
|
+
"--model",
|
|
35
|
+
"--reasoning",
|
|
36
|
+
"-c",
|
|
37
|
+
"--continue",
|
|
38
|
+
"-r",
|
|
39
|
+
"--resume",
|
|
40
|
+
"--allow-all",
|
|
41
|
+
"--allowed-tools",
|
|
42
|
+
"-w",
|
|
43
|
+
"--worktree",
|
|
44
|
+
"--output-format",
|
|
45
|
+
"--permission-mode",
|
|
46
|
+
"--lang",
|
|
47
|
+
"-v",
|
|
48
|
+
"--version",
|
|
49
|
+
"-h",
|
|
50
|
+
"--help"
|
|
51
|
+
];
|
|
52
|
+
var WORDS = [...COMMANDS, ...FLAGS].join(" ");
|
|
53
|
+
function bashScript() {
|
|
54
|
+
return `# bccli bash completion \u2014 add to your shell rc:
|
|
55
|
+
# bccli completion bash > ~/.local/share/bash-completion/completions/bccli
|
|
56
|
+
_bccli_complete() {
|
|
57
|
+
local cur
|
|
58
|
+
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
59
|
+
COMPREPLY=( $(compgen -W "${WORDS}" -- "$cur") )
|
|
60
|
+
}
|
|
61
|
+
complete -F _bccli_complete bccli
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
function zshScript() {
|
|
65
|
+
return `# bccli zsh completion \u2014 add to your shell rc:
|
|
66
|
+
# bccli completion zsh > "\${fpath[1]}/_bccli"
|
|
67
|
+
#compdef bccli
|
|
68
|
+
_bccli() {
|
|
69
|
+
local -a words_list
|
|
70
|
+
words_list=(${WORDS})
|
|
71
|
+
_describe 'command' words_list
|
|
72
|
+
}
|
|
73
|
+
compdef _bccli bccli
|
|
74
|
+
`;
|
|
75
|
+
}
|
|
76
|
+
function fishScript() {
|
|
77
|
+
const lines = [
|
|
78
|
+
"# bccli fish completion \u2014 add to your config:",
|
|
79
|
+
"# bccli completion fish > ~/.config/fish/completions/bccli.fish",
|
|
80
|
+
`# flags: ${FLAGS.join(" ")}`
|
|
81
|
+
];
|
|
82
|
+
for (const w of COMMANDS) lines.push(`complete -c bccli -f -a '${w}'`);
|
|
83
|
+
for (const f of FLAGS) lines.push(`complete -c bccli -l '${f.replace(/^-+/, "")}'`);
|
|
84
|
+
return `${lines.join("\n")}
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
function powershellScript() {
|
|
88
|
+
return `# bccli powershell completion \u2014 add to your profile:
|
|
89
|
+
# bccli completion powershell >> $PROFILE
|
|
90
|
+
Register-ArgumentCompleter -Native -CommandName bccli -ScriptBlock {
|
|
91
|
+
param($wordToComplete, $commandAst, $cursorPosition)
|
|
92
|
+
$words = '${WORDS}' -split ' '
|
|
93
|
+
$words | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
|
|
94
|
+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
function completionScript(shell) {
|
|
100
|
+
switch (shell) {
|
|
101
|
+
case "bash":
|
|
102
|
+
return bashScript();
|
|
103
|
+
case "zsh":
|
|
104
|
+
return zshScript();
|
|
105
|
+
case "fish":
|
|
106
|
+
return fishScript();
|
|
107
|
+
case "powershell":
|
|
108
|
+
return powershellScript();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function runCompletionCommand(args, deps) {
|
|
112
|
+
const shell = (args.subArgs[0] ?? "").trim();
|
|
113
|
+
if (!shell || !isCompletionShell(shell)) {
|
|
114
|
+
deps.err?.(t("usage: bccli completion <{shells}>", { shells: SHELLS.join(", ") }));
|
|
115
|
+
return 1;
|
|
116
|
+
}
|
|
117
|
+
for (const line of completionScript(shell).split("\n")) deps.out(line);
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
SHELLS,
|
|
122
|
+
completionScript,
|
|
123
|
+
isCompletionShell,
|
|
124
|
+
runCompletionCommand
|
|
125
|
+
};
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
removeGlobalServer,
|
|
10
10
|
serversToStart,
|
|
11
11
|
setProjectTrust
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-PZC2Q6MJ.js";
|
|
13
|
+
import "./chunk-GIGWZFCY.js";
|
|
14
|
+
import "./chunk-QHNWI3OT.js";
|
|
15
15
|
export {
|
|
16
16
|
addGlobalServer,
|
|
17
17
|
expandEnvVars,
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createRuntime
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ZGH4B7OU.js";
|
|
5
|
+
import "./chunk-U6PCNS4B.js";
|
|
6
|
+
import "./chunk-PSRNKKGA.js";
|
|
7
|
+
import "./chunk-NVRNFR4S.js";
|
|
7
8
|
import "./chunk-PSO7R5AD.js";
|
|
8
9
|
import {
|
|
9
10
|
LOOPBACK_BIND,
|
|
10
11
|
parseCliArgs
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CYTRCZXI.js";
|
|
12
13
|
import "./chunk-GAFJEQTJ.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-2ON3WIDP.js";
|
|
15
|
+
import "./chunk-25DSN3Y3.js";
|
|
16
|
+
import "./chunk-VO6MF6JJ.js";
|
|
16
17
|
import "./chunk-7F3IWBPQ.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-BQHKN7JI.js";
|
|
19
|
+
import "./chunk-RMDW3OQ6.js";
|
|
20
|
+
import "./chunk-ZKMSTD6G.js";
|
|
21
|
+
import "./chunk-PZC2Q6MJ.js";
|
|
21
22
|
import {
|
|
22
23
|
ConfigError,
|
|
23
24
|
globalConfigPath,
|
|
24
25
|
readJsonConfig
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GIGWZFCY.js";
|
|
26
27
|
import {
|
|
27
28
|
t
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-QHNWI3OT.js";
|
|
29
30
|
|
|
30
31
|
// src/ghBotWebhook.ts
|
|
31
32
|
import { createHmac, timingSafeEqual } from "crypto";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
loadConfig,
|
|
6
6
|
readCredentials,
|
|
7
7
|
resolveModel
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GIGWZFCY.js";
|
|
9
9
|
import {
|
|
10
10
|
t
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QHNWI3OT.js";
|
|
12
12
|
|
|
13
13
|
// src/integrationCli.ts
|
|
14
14
|
import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
readLine,
|
|
5
5
|
readSecret,
|
|
6
6
|
runLogin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Y3QKYORR.js";
|
|
8
8
|
import "./chunk-7F3IWBPQ.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-GIGWZFCY.js";
|
|
10
|
+
import "./chunk-QHNWI3OT.js";
|
|
11
11
|
export {
|
|
12
12
|
defaultLoginDeps,
|
|
13
13
|
readLine,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CATALOG,
|
|
4
4
|
fillTemplate
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-I7GXIJCY.js";
|
|
6
6
|
import {
|
|
7
7
|
authorizeMcpServer,
|
|
8
8
|
clearTokens
|
|
@@ -12,20 +12,20 @@ import {
|
|
|
12
12
|
globalMcpPath,
|
|
13
13
|
readMcpFile,
|
|
14
14
|
removeGlobalServer
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PZC2Q6MJ.js";
|
|
16
16
|
import {
|
|
17
17
|
bccliHome
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GIGWZFCY.js";
|
|
19
19
|
import {
|
|
20
20
|
t
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QHNWI3OT.js";
|
|
22
22
|
|
|
23
23
|
// src/mcpCli.ts
|
|
24
24
|
async function runMcpCommand(args, deps) {
|
|
25
25
|
const home = bccliHome(deps.env);
|
|
26
26
|
const [action = "list", name] = args.subArgs;
|
|
27
27
|
if (action === "serve") {
|
|
28
|
-
const { runMcpServe } = await import("./serve-
|
|
28
|
+
const { runMcpServe } = await import("./serve-YNKE332Z.js");
|
|
29
29
|
return runMcpServe(args, deps);
|
|
30
30
|
}
|
|
31
31
|
const installed = readMcpFile(globalMcpPath(home));
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
listAllModels
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-25DSN3Y3.js";
|
|
5
|
+
import "./chunk-VO6MF6JJ.js";
|
|
6
|
+
import "./chunk-RMDW3OQ6.js";
|
|
7
|
+
import "./chunk-ZKMSTD6G.js";
|
|
8
8
|
import {
|
|
9
9
|
loadConfig,
|
|
10
10
|
resolveModel
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GIGWZFCY.js";
|
|
12
12
|
import {
|
|
13
13
|
t
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QHNWI3OT.js";
|
|
15
15
|
|
|
16
16
|
// src/modelsCli.ts
|
|
17
17
|
async function runModelsCommand(args, deps) {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
bccliHome,
|
|
4
4
|
globalConfigPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GIGWZFCY.js";
|
|
6
6
|
import {
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QHNWI3OT.js";
|
|
9
9
|
|
|
10
10
|
// src/pluginsCli.ts
|
|
11
11
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
t
|
|
4
|
+
} from "./chunk-QHNWI3OT.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
|
+
async function defaultRunTask(opts) {
|
|
24
|
+
const entry = process.argv[1];
|
|
25
|
+
if (!entry) return 1;
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
const child = spawn(process.execPath, [entry, ...opts.prompt ? ["-p", opts.prompt] : [], "--allow-all"], {
|
|
28
|
+
shell: false,
|
|
29
|
+
stdio: "inherit",
|
|
30
|
+
cwd: opts.cwd
|
|
31
|
+
});
|
|
32
|
+
child.on("error", () => resolve(1));
|
|
33
|
+
child.on("close", (code) => resolve(code ?? 1));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async function runPrCommand(args, deps) {
|
|
37
|
+
const rest = [...args.subArgs];
|
|
38
|
+
let repo;
|
|
39
|
+
const words = [];
|
|
40
|
+
for (let i = 0; i < rest.length; i++) {
|
|
41
|
+
if (rest[i] === "--repo") {
|
|
42
|
+
repo = rest[++i];
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
words.push(rest[i]);
|
|
46
|
+
}
|
|
47
|
+
const number = words.shift();
|
|
48
|
+
if (!number || !/^\d+$/.test(number)) {
|
|
49
|
+
deps.err?.(t("usage: bccli pr <number> [--repo owner/name] [task]"));
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
const task = words.length ? words.join(" ") : void 0;
|
|
53
|
+
const gh = deps.gh ?? defaultGh;
|
|
54
|
+
const checkoutArgv = ["pr", "checkout", number, ...repo ? ["--repo", repo] : []];
|
|
55
|
+
let res;
|
|
56
|
+
try {
|
|
57
|
+
res = await gh(checkoutArgv);
|
|
58
|
+
} catch (e) {
|
|
59
|
+
deps.err?.(t("gh is not available ({error}); install GitHub CLI first", { error: String(e) }));
|
|
60
|
+
return 1;
|
|
61
|
+
}
|
|
62
|
+
if (res.code !== 0) {
|
|
63
|
+
deps.err?.(t("gh pr checkout {n} failed (exit {code})", { n: number, code: String(res.code) }));
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
deps.out(t("checked out PR #{n}", { n: number }));
|
|
67
|
+
const runTask = deps.runTask ?? defaultRunTask;
|
|
68
|
+
return runTask({ prompt: task, allowAll: true, cwd: args.cwd });
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
runPrCommand
|
|
72
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
addProviderKey,
|
|
4
|
+
runProviderCommand
|
|
5
|
+
} from "./chunk-2ON3WIDP.js";
|
|
6
|
+
import "./chunk-25DSN3Y3.js";
|
|
7
|
+
import "./chunk-VO6MF6JJ.js";
|
|
8
|
+
import "./chunk-RMDW3OQ6.js";
|
|
9
|
+
import "./chunk-ZKMSTD6G.js";
|
|
10
|
+
import "./chunk-GIGWZFCY.js";
|
|
11
|
+
import "./chunk-QHNWI3OT.js";
|
|
12
|
+
export {
|
|
13
|
+
addProviderKey,
|
|
14
|
+
runProviderCommand
|
|
15
|
+
};
|