@botconnector/bccli 0.4.0-beta.51 → 0.4.0-beta.53
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 +237 -0
- package/README.md +7 -0
- package/dist/{acp-NWP4FFTG.js → acp-CH5CYAGX.js} +2 -2
- package/dist/{args-2R45YZ42.js → args-44YOL5QJ.js} +4 -4
- package/dist/{chunk-H73FO5YK.js → chunk-2Y3QHA6B.js} +2 -2
- package/dist/{chunk-2QYHSESB.js → chunk-AWGB5Q44.js} +1 -1
- package/dist/{chunk-FTFVW7XD.js → chunk-BHVJIVEF.js} +3 -3
- package/dist/{chunk-KIZC5XV4.js → chunk-CCE6EISW.js} +10 -10
- package/dist/{chunk-YIYX3FFS.js → chunk-FIW4AJH7.js} +1 -1
- package/dist/{chunk-R4BJBTWC.js → chunk-GMKDCZES.js} +2 -2
- package/dist/{chunk-F6ACN47V.js → chunk-HPMYPOCZ.js} +1 -1
- package/dist/{chunk-4WVIPZFV.js → chunk-ILBXVGMJ.js} +2 -2
- package/dist/{chunk-TQWCM5RO.js → chunk-KDZT3TSG.js} +3 -3
- package/dist/{chunk-XLC6T4SX.js → chunk-LUTJZME3.js} +1 -2
- package/dist/{chunk-KD2LMIS4.js → chunk-MYJ7JVSE.js} +6 -6
- package/dist/{chunk-NDEJUL44.js → chunk-N74AEPNA.js} +2 -2
- package/dist/{chunk-QXOV4DUZ.js → chunk-QB45QGNJ.js} +5 -5
- package/dist/{chunk-VU5HNQHX.js → chunk-Y3J5XLHS.js} +1 -1
- package/dist/{chunk-N7KP6RNP.js → chunk-YALWYJLE.js} +4 -4
- package/dist/{chunk-DP7EBW53.js → chunk-YATYUXV7.js} +1 -1
- package/dist/{chunk-SNKVS26H.js → chunk-Z7TGZMYK.js} +1 -1
- package/dist/cli.js +40 -39
- package/dist/{completion-OV3MW2N4.js → completion-OZ6UDMOX.js} +1 -1
- package/dist/{config-AZZFOXKV.js → config-KY5HCYJG.js} +3 -3
- package/dist/{config-H5A7XHHK.js → config-UUKS6MAS.js} +2 -2
- package/dist/{ghBotCli-7WDYF4L7.js → ghBotCli-2LLP6VRD.js} +13 -13
- package/dist/{integrationCli-ZMTSILYF.js → integrationCli-UX4QNT3G.js} +2 -2
- package/dist/{login-W4Y6WHLV.js → login-MMC3MKNY.js} +3 -3
- package/dist/{mcpCli-5QISTOFK.js → mcpCli-SQBUXLGD.js} +5 -5
- package/dist/{modelsCli-FZMBD4OE.js → modelsCli-OKAJOI4B.js} +6 -6
- package/dist/{oauthLogin-VESMXG4M.js → oauthLogin-4YKTBX7B.js} +2 -2
- package/dist/{pluginsCli-GEHR7FQR.js → pluginsCli-KFRFZCFG.js} +2 -2
- package/dist/{prCli-JXA7DJW4.js → prCli-FITKBEUT.js} +1 -1
- package/dist/providerCli-5YZY7GFZ.js +15 -0
- package/dist/sdk.js +3 -4
- package/dist/{serve-6KX4MXHC.js → serve-BHU5LDXB.js} +3 -3
- package/dist/{serve-YSUJD57D.js → serve-CIPCJQEV.js} +14 -14
- package/dist/session-LFDUVEPY.js +12 -0
- package/dist/setup-VWBBGF6G.js +24 -0
- package/dist/{statsCli-H4HEY5ID.js → statsCli-SVJAWOSZ.js} +1 -1
- package/dist/{transferCli-2XUKBG2L.js → transferCli-RE374MK3.js} +4 -4
- package/dist/{ui-6HJVYI46.js → ui-WJQWXRPP.js} +15 -20
- package/dist/{update-O4WCLKOO.js → update-6SGG73NB.js} +14 -7
- package/package.json +1 -1
- package/dist/providerCli-EUZGKP5F.js +0 -15
- package/dist/session-F6MG3UCU.js +0 -12
- package/dist/setup-LLWREJQH.js +0 -24
package/dist/cli.js
CHANGED
|
@@ -2,47 +2,47 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveWorktree,
|
|
4
4
|
runPrint
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KDZT3TSG.js";
|
|
6
6
|
import {
|
|
7
7
|
createRuntime
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CCE6EISW.js";
|
|
9
9
|
import "./chunk-QZKLZELZ.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-FIW4AJH7.js";
|
|
11
|
+
import "./chunk-YATYUXV7.js";
|
|
12
12
|
import "./chunk-PSO7R5AD.js";
|
|
13
13
|
import {
|
|
14
14
|
VERSION
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-Y3J5XLHS.js";
|
|
16
16
|
import {
|
|
17
17
|
helpText,
|
|
18
18
|
parseCliArgs
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BHVJIVEF.js";
|
|
20
20
|
import "./chunk-GAFJEQTJ.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-YALWYJLE.js";
|
|
22
|
+
import "./chunk-QB45QGNJ.js";
|
|
23
23
|
import {
|
|
24
24
|
readGlobalConfigFile
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-AWGB5Q44.js";
|
|
26
26
|
import {
|
|
27
27
|
defaultLoginDeps,
|
|
28
28
|
runLogin
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-MYJ7JVSE.js";
|
|
30
30
|
import "./chunk-7F3IWBPQ.js";
|
|
31
31
|
import {
|
|
32
32
|
pruneSessions
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-HPMYPOCZ.js";
|
|
34
|
+
import "./chunk-GMKDCZES.js";
|
|
35
|
+
import "./chunk-Z7TGZMYK.js";
|
|
36
|
+
import "./chunk-2Y3QHA6B.js";
|
|
37
37
|
import {
|
|
38
38
|
ConfigError,
|
|
39
39
|
setTheme
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-N74AEPNA.js";
|
|
41
41
|
import {
|
|
42
42
|
resolveLanguage,
|
|
43
43
|
setLanguage,
|
|
44
44
|
t
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-LUTJZME3.js";
|
|
46
46
|
|
|
47
47
|
// src/exit.ts
|
|
48
48
|
var EXIT_GRACE_MS = 1e3;
|
|
@@ -84,17 +84,17 @@ async function main() {
|
|
|
84
84
|
if (args.worktree) cwd = (await resolveWorktree(cwd, args.worktree)).path;
|
|
85
85
|
if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd, args, defaultLoginDeps());
|
|
86
86
|
if (args.command === "mcp") {
|
|
87
|
-
const { runMcpCommand } = await import("./mcpCli-
|
|
88
|
-
const { readSecret } = await import("./login-
|
|
87
|
+
const { runMcpCommand } = await import("./mcpCli-SQBUXLGD.js");
|
|
88
|
+
const { readSecret } = await import("./login-MMC3MKNY.js");
|
|
89
89
|
return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
90
90
|
}
|
|
91
91
|
if (args.command === "provider") {
|
|
92
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
93
|
-
const { readSecret } = await import("./login-
|
|
92
|
+
const { runProviderCommand } = await import("./providerCli-5YZY7GFZ.js");
|
|
93
|
+
const { readSecret } = await import("./login-MMC3MKNY.js");
|
|
94
94
|
return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
95
95
|
}
|
|
96
96
|
if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
|
|
97
|
-
const { runIntegrationCommand } = await import("./integrationCli-
|
|
97
|
+
const { runIntegrationCommand } = await import("./integrationCli-UX4QNT3G.js");
|
|
98
98
|
return runIntegrationCommand(args, {
|
|
99
99
|
env: process.env,
|
|
100
100
|
cwd,
|
|
@@ -104,20 +104,20 @@ async function main() {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
if (args.command === "models") {
|
|
107
|
-
const { runModelsCommand } = await import("./modelsCli-
|
|
107
|
+
const { runModelsCommand } = await import("./modelsCli-OKAJOI4B.js");
|
|
108
108
|
return runModelsCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), fetch: globalThis.fetch });
|
|
109
109
|
}
|
|
110
110
|
if (args.command === "update") {
|
|
111
|
-
const { runUpdateCommand } = await import("./update-
|
|
111
|
+
const { runUpdateCommand } = await import("./update-6SGG73NB.js");
|
|
112
112
|
return runUpdateCommand({ env: process.env });
|
|
113
113
|
}
|
|
114
114
|
if (args.command === "acp") {
|
|
115
|
-
const { runtimeAgent, runAcp } = await import("./acp-
|
|
115
|
+
const { runtimeAgent, runAcp } = await import("./acp-CH5CYAGX.js");
|
|
116
116
|
await runAcp(process.stdin, process.stdout, { cwd, newAgent: (c) => runtimeAgent(c, args.allowAll) });
|
|
117
117
|
return 0;
|
|
118
118
|
}
|
|
119
119
|
if (args.command === "serve") {
|
|
120
|
-
const { startServe } = await import("./serve-
|
|
120
|
+
const { startServe } = await import("./serve-CIPCJQEV.js");
|
|
121
121
|
const handle = await startServe({ port: args.port, host: args.host, token: args.token, cwd, env: process.env });
|
|
122
122
|
process.stderr.write(`bccli serve ${handle.url} \u2014 Authorization: Bearer ${handle.token}
|
|
123
123
|
`);
|
|
@@ -131,8 +131,8 @@ async function main() {
|
|
|
131
131
|
return 0;
|
|
132
132
|
}
|
|
133
133
|
if (args.command === "plugins") {
|
|
134
|
-
const { runPluginsCommand } = await import("./pluginsCli-
|
|
135
|
-
const { readGlobalPlugins, updateGlobalConfig } = await import("./config-
|
|
134
|
+
const { runPluginsCommand } = await import("./pluginsCli-KFRFZCFG.js");
|
|
135
|
+
const { readGlobalPlugins, updateGlobalConfig } = await import("./config-UUKS6MAS.js");
|
|
136
136
|
const { runNpmSync } = await import("./npmRunner-LU43GM3W.js");
|
|
137
137
|
return runPluginsCommand(args, {
|
|
138
138
|
out: (s) => console.log(s),
|
|
@@ -146,30 +146,30 @@ async function main() {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
if (args.command === "gh-bot") {
|
|
149
|
-
const { runGhBotCommand } = await import("./ghBotCli-
|
|
149
|
+
const { runGhBotCommand } = await import("./ghBotCli-2LLP6VRD.js");
|
|
150
150
|
return runGhBotCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
151
151
|
}
|
|
152
152
|
if (args.command === "completion") {
|
|
153
|
-
const { runCompletionCommand } = await import("./completion-
|
|
153
|
+
const { runCompletionCommand } = await import("./completion-OZ6UDMOX.js");
|
|
154
154
|
return runCompletionCommand(args, { out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
155
155
|
}
|
|
156
156
|
if (args.command === "stats") {
|
|
157
|
-
const { runStatsCommand } = await import("./statsCli-
|
|
158
|
-
const { bccliHome } = await import("./config-
|
|
157
|
+
const { runStatsCommand } = await import("./statsCli-SVJAWOSZ.js");
|
|
158
|
+
const { bccliHome } = await import("./config-UUKS6MAS.js");
|
|
159
159
|
return runStatsCommand(
|
|
160
160
|
{ subArgs: args.subArgs, home: bccliHome(process.env), cwd, days: args.days, tools: args.tools, models: args.models, project: args.project },
|
|
161
161
|
{ out: (s) => console.log(s), err: (s) => console.error(s) }
|
|
162
162
|
);
|
|
163
163
|
}
|
|
164
164
|
if (args.command === "export" || args.command === "import") {
|
|
165
|
-
const { runExportCommand, runImportCommand } = await import("./transferCli-
|
|
166
|
-
const { bccliHome } = await import("./config-
|
|
165
|
+
const { runExportCommand, runImportCommand } = await import("./transferCli-RE374MK3.js");
|
|
166
|
+
const { bccliHome } = await import("./config-UUKS6MAS.js");
|
|
167
167
|
const deps = { subArgs: args.subArgs, home: bccliHome(process.env), cwd };
|
|
168
168
|
const io = { out: (s) => console.log(s), err: (s) => console.error(s) };
|
|
169
169
|
return args.command === "export" ? runExportCommand(deps, io) : runImportCommand(deps, io);
|
|
170
170
|
}
|
|
171
171
|
if (args.command === "pr") {
|
|
172
|
-
const { runPrCommand } = await import("./prCli-
|
|
172
|
+
const { runPrCommand } = await import("./prCli-FITKBEUT.js");
|
|
173
173
|
return runPrCommand({ subArgs: args.subArgs, cwd }, { out: (s) => console.log(s), err: (s) => console.error(s) });
|
|
174
174
|
}
|
|
175
175
|
const rt = createRuntime({ cwd, args });
|
|
@@ -180,7 +180,7 @@ async function main() {
|
|
|
180
180
|
}
|
|
181
181
|
if (args.print) {
|
|
182
182
|
if (!args.prompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
|
|
183
|
-
const { serversToStart } = await import("./config-
|
|
183
|
+
const { serversToStart } = await import("./config-KY5HCYJG.js");
|
|
184
184
|
const plan = serversToStart(rt.home, cwd);
|
|
185
185
|
for (const s of plan.needTrust) {
|
|
186
186
|
console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
|
|
@@ -193,16 +193,17 @@ async function main() {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
if (!process.stdin.isTTY) throw new ConfigError(t('Interactive mode needs a terminal. For scripts/CI use: bccli -p "task"'));
|
|
196
|
+
let updateMessage;
|
|
196
197
|
if (rt.config.updateCheck !== "off" && !process.env.BCCLI_NO_UPDATE_CHECK) {
|
|
197
198
|
try {
|
|
198
|
-
const { checkForUpdate } = await import("./update-
|
|
199
|
+
const { checkForUpdate } = await import("./update-6SGG73NB.js");
|
|
199
200
|
const update = await checkForUpdate({ home: rt.home, fetch: globalThis.fetch, now: /* @__PURE__ */ new Date() });
|
|
200
|
-
|
|
201
|
+
updateMessage = update;
|
|
201
202
|
} catch {
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
|
-
const { startInteractive } = await import("./ui-
|
|
205
|
-
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION });
|
|
205
|
+
const { startInteractive } = await import("./ui-WJQWXRPP.js");
|
|
206
|
+
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION, updateMessage });
|
|
206
207
|
}
|
|
207
208
|
main().then(
|
|
208
209
|
(code) => settleExit(code),
|
|
@@ -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-2Y3QHA6B.js";
|
|
13
|
+
import "./chunk-N74AEPNA.js";
|
|
14
|
+
import "./chunk-LUTJZME3.js";
|
|
15
15
|
export {
|
|
16
16
|
addGlobalServer,
|
|
17
17
|
expandEnvVars,
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createRuntime
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CCE6EISW.js";
|
|
5
5
|
import "./chunk-QZKLZELZ.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-FIW4AJH7.js";
|
|
7
|
+
import "./chunk-YATYUXV7.js";
|
|
8
8
|
import "./chunk-PSO7R5AD.js";
|
|
9
9
|
import {
|
|
10
10
|
LOOPBACK_BIND,
|
|
11
11
|
parseCliArgs
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BHVJIVEF.js";
|
|
13
13
|
import "./chunk-GAFJEQTJ.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-YALWYJLE.js";
|
|
15
|
+
import "./chunk-QB45QGNJ.js";
|
|
16
|
+
import "./chunk-AWGB5Q44.js";
|
|
17
17
|
import "./chunk-7F3IWBPQ.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-HPMYPOCZ.js";
|
|
19
|
+
import "./chunk-GMKDCZES.js";
|
|
20
|
+
import "./chunk-Z7TGZMYK.js";
|
|
21
|
+
import "./chunk-2Y3QHA6B.js";
|
|
22
22
|
import {
|
|
23
23
|
ConfigError,
|
|
24
24
|
globalConfigPath,
|
|
25
25
|
readJsonConfig
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-N74AEPNA.js";
|
|
27
27
|
import {
|
|
28
28
|
t
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-LUTJZME3.js";
|
|
30
30
|
|
|
31
31
|
// src/ghBotWebhook.ts
|
|
32
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-N74AEPNA.js";
|
|
9
9
|
import {
|
|
10
10
|
t
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LUTJZME3.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-MYJ7JVSE.js";
|
|
8
8
|
import "./chunk-7F3IWBPQ.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-N74AEPNA.js";
|
|
10
|
+
import "./chunk-LUTJZME3.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-ILBXVGMJ.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-2Y3QHA6B.js";
|
|
16
16
|
import {
|
|
17
17
|
bccliHome
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-N74AEPNA.js";
|
|
19
19
|
import {
|
|
20
20
|
t
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-LUTJZME3.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-BHU5LDXB.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-QB45QGNJ.js";
|
|
5
|
+
import "./chunk-AWGB5Q44.js";
|
|
6
|
+
import "./chunk-GMKDCZES.js";
|
|
7
|
+
import "./chunk-Z7TGZMYK.js";
|
|
8
8
|
import {
|
|
9
9
|
loadConfig,
|
|
10
10
|
resolveModel
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-N74AEPNA.js";
|
|
12
12
|
import {
|
|
13
13
|
t
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LUTJZME3.js";
|
|
15
15
|
|
|
16
16
|
// src/modelsCli.ts
|
|
17
17
|
async function runModelsCommand(args, deps) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
t
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LUTJZME3.js";
|
|
5
5
|
|
|
6
6
|
// src/oauthLogin.ts
|
|
7
7
|
import { createHash, randomBytes } from "crypto";
|
|
@@ -179,7 +179,7 @@ async function runOauthLogin(deps) {
|
|
|
179
179
|
}
|
|
180
180
|
deps.out(t("Logged in: openrouter credential saved."));
|
|
181
181
|
if (deps.env[OPENROUTER_ENV_KEY]) {
|
|
182
|
-
deps.out(t("Note: {env} is set in the environment
|
|
182
|
+
deps.out(t("Note: {env} is also set in the environment; the stored credential takes priority and {env} is only the fallback.", { env: OPENROUTER_ENV_KEY }));
|
|
183
183
|
}
|
|
184
184
|
deps.out(t("Verify with: bccli models openrouter (your key is never printed)."));
|
|
185
185
|
return 0;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
bccliHome,
|
|
4
4
|
globalConfigPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-N74AEPNA.js";
|
|
6
6
|
import {
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LUTJZME3.js";
|
|
9
9
|
|
|
10
10
|
// src/pluginsCli.ts
|
|
11
11
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
addProviderKey,
|
|
4
|
+
runProviderCommand
|
|
5
|
+
} from "./chunk-YALWYJLE.js";
|
|
6
|
+
import "./chunk-QB45QGNJ.js";
|
|
7
|
+
import "./chunk-AWGB5Q44.js";
|
|
8
|
+
import "./chunk-GMKDCZES.js";
|
|
9
|
+
import "./chunk-Z7TGZMYK.js";
|
|
10
|
+
import "./chunk-N74AEPNA.js";
|
|
11
|
+
import "./chunk-LUTJZME3.js";
|
|
12
|
+
export {
|
|
13
|
+
addProviderKey,
|
|
14
|
+
runProviderCommand
|
|
15
|
+
};
|
package/dist/sdk.js
CHANGED
|
@@ -281,7 +281,7 @@ Opsi:
|
|
|
281
281
|
"OpenRouter exchange failed ({status}): {detail}. Your stored credential was not changed.": "Pertukaran OpenRouter gagal ({status}): {detail}. Credential tersimpan tidak berubah.",
|
|
282
282
|
"The key was created on your OpenRouter account but could not be saved locally ({reason}). Manage it (copy or revoke) at {dashboard}, then run bccli login openrouter again.": "Key sudah dibuat di akun OpenRouter kamu tetapi gagal disimpan lokal ({reason}). Kelola (salin atau cabut) di {dashboard}, lalu jalankan bccli login openrouter lagi.",
|
|
283
283
|
"Logged in: openrouter credential saved.": "Login berhasil: credential openrouter tersimpan.",
|
|
284
|
-
"Note: {env} is set in the environment
|
|
284
|
+
"Note: {env} is also set in the environment; the stored credential takes priority and {env} is only the fallback.": "Catatan: {env} juga ter-set di environment; credential tersimpan lebih diutamakan dan {env} hanya cadangan.",
|
|
285
285
|
"Verify with: bccli models openrouter (your key is never printed).": "Verifikasi dengan: bccli models openrouter (key kamu tidak pernah dicetak).",
|
|
286
286
|
"openrouter credential removed.": "credential openrouter dihapus.",
|
|
287
287
|
"openrouter credential was not stored.": "credential openrouter tidak tersimpan.",
|
|
@@ -430,7 +430,6 @@ Opsi:
|
|
|
430
430
|
"Could not write {file}: {error}": "Gagal menulis {file}: {error}",
|
|
431
431
|
"Added to {file}.": "Ditambahkan ke {file}.",
|
|
432
432
|
"API key for {provider}": "API key untuk {provider}",
|
|
433
|
-
"Key for {provider} saved, but {env} in the environment takes precedence and is still used.": "Key {provider} tersimpan, tapi {env} di environment lebih diutamakan dan tetap dipakai.",
|
|
434
433
|
"Key for {provider} saved \xB7 {n} models.": "Key {provider} tersimpan \xB7 {n} model.",
|
|
435
434
|
"Stored key deleted, but {env} is still set in the environment and is still used.": "Key tersimpan dihapus, tapi {env} masih ada di environment dan tetap dipakai.",
|
|
436
435
|
"No stored key; {env} is still set in the environment and is still used.": "Tidak ada key tersimpan; {env} masih ada di environment dan tetap dipakai.",
|
|
@@ -741,7 +740,7 @@ function resolveModel(config, modelRef, env = process.env) {
|
|
|
741
740
|
if (!provider) {
|
|
742
741
|
throw new ConfigError(t('Provider "{id}" is not in the config. Available: {list}', { id: providerId, list: Object.keys(config.providers).join(", ") }));
|
|
743
742
|
}
|
|
744
|
-
const apiKey = (provider.apiKeyEnv ? env[provider.apiKeyEnv] : void 0) ||
|
|
743
|
+
const apiKey = readCredentials(env)[providerId] || (provider.apiKeyEnv ? env[provider.apiKeyEnv] : void 0) || void 0;
|
|
745
744
|
if (provider.apiKeyEnv && !apiKey) {
|
|
746
745
|
throw new ConfigError(t("No API key for {id} yet. Run `bccli login` or set the env var {env}.", { id: providerId, env: provider.apiKeyEnv }));
|
|
747
746
|
}
|
|
@@ -4371,7 +4370,7 @@ async function listAllModels(config, env = process.env, opts = {}) {
|
|
|
4371
4370
|
const results = await Promise.all(
|
|
4372
4371
|
ids.map(async (id) => {
|
|
4373
4372
|
const provider = config.providers[id];
|
|
4374
|
-
const apiKey = (opts.keyOverride && id === opts.only ? opts.keyOverride : void 0) || (provider.apiKeyEnv ? env[provider.apiKeyEnv] : void 0) ||
|
|
4373
|
+
const apiKey = (opts.keyOverride && id === opts.only ? opts.keyOverride : void 0) || readCredentials(env)[id] || (provider.apiKeyEnv ? env[provider.apiKeyEnv] : void 0) || void 0;
|
|
4375
4374
|
const local = !provider.apiKeyEnv;
|
|
4376
4375
|
const timedFetch = ((input, init) => baseFetch(input, { ...init, signal: AbortSignal.timeout(timeoutMs) }));
|
|
4377
4376
|
const list2 = createProvider({ baseURL: provider.baseURL.replace(/\/+$/, ""), apiKey, model: "", fetch: timedFetch }).listModels();
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
createFetchTool,
|
|
4
4
|
createWebSearchTool,
|
|
5
5
|
isPrivateHost
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YATYUXV7.js";
|
|
7
7
|
import "./chunk-PSO7R5AD.js";
|
|
8
8
|
import {
|
|
9
9
|
loadConfig,
|
|
10
10
|
readCredentials
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-N74AEPNA.js";
|
|
12
12
|
import {
|
|
13
13
|
t
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LUTJZME3.js";
|
|
15
15
|
|
|
16
16
|
// src/mcpServer/serve.ts
|
|
17
17
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createRuntime
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CCE6EISW.js";
|
|
5
5
|
import "./chunk-QZKLZELZ.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-FIW4AJH7.js";
|
|
7
|
+
import "./chunk-YATYUXV7.js";
|
|
8
8
|
import "./chunk-PSO7R5AD.js";
|
|
9
9
|
import {
|
|
10
10
|
VERSION
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Y3J5XLHS.js";
|
|
12
12
|
import {
|
|
13
13
|
LOOPBACK_BIND,
|
|
14
14
|
MAX_FRAME_BYTES,
|
|
@@ -17,25 +17,25 @@ import {
|
|
|
17
17
|
parseClientFrame,
|
|
18
18
|
randomToken,
|
|
19
19
|
trustFence
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BHVJIVEF.js";
|
|
21
21
|
import "./chunk-GAFJEQTJ.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-YALWYJLE.js";
|
|
23
23
|
import {
|
|
24
24
|
listAllModels
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-QB45QGNJ.js";
|
|
26
|
+
import "./chunk-AWGB5Q44.js";
|
|
27
27
|
import "./chunk-7F3IWBPQ.js";
|
|
28
28
|
import {
|
|
29
29
|
Session
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-HPMYPOCZ.js";
|
|
31
|
+
import "./chunk-GMKDCZES.js";
|
|
32
|
+
import "./chunk-Z7TGZMYK.js";
|
|
33
|
+
import "./chunk-2Y3QHA6B.js";
|
|
34
34
|
import {
|
|
35
35
|
bccliHome,
|
|
36
36
|
loadConfig
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-N74AEPNA.js";
|
|
38
|
+
import "./chunk-LUTJZME3.js";
|
|
39
39
|
|
|
40
40
|
// src/serve.ts
|
|
41
41
|
import { randomBytes } from "crypto";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
createRuntime,
|
|
4
|
+
lunaPtcAutoEnabled
|
|
5
|
+
} from "./chunk-CCE6EISW.js";
|
|
6
|
+
import "./chunk-QZKLZELZ.js";
|
|
7
|
+
import "./chunk-FIW4AJH7.js";
|
|
8
|
+
import "./chunk-YATYUXV7.js";
|
|
9
|
+
import "./chunk-PSO7R5AD.js";
|
|
10
|
+
import "./chunk-GAFJEQTJ.js";
|
|
11
|
+
import "./chunk-YALWYJLE.js";
|
|
12
|
+
import "./chunk-QB45QGNJ.js";
|
|
13
|
+
import "./chunk-AWGB5Q44.js";
|
|
14
|
+
import "./chunk-7F3IWBPQ.js";
|
|
15
|
+
import "./chunk-HPMYPOCZ.js";
|
|
16
|
+
import "./chunk-GMKDCZES.js";
|
|
17
|
+
import "./chunk-Z7TGZMYK.js";
|
|
18
|
+
import "./chunk-2Y3QHA6B.js";
|
|
19
|
+
import "./chunk-N74AEPNA.js";
|
|
20
|
+
import "./chunk-LUTJZME3.js";
|
|
21
|
+
export {
|
|
22
|
+
createRuntime,
|
|
23
|
+
lunaPtcAutoEnabled
|
|
24
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
Session
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-HPMYPOCZ.js";
|
|
5
|
+
import "./chunk-GMKDCZES.js";
|
|
6
|
+
import "./chunk-Z7TGZMYK.js";
|
|
7
7
|
import {
|
|
8
8
|
t
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LUTJZME3.js";
|
|
10
10
|
|
|
11
11
|
// src/transferCli.ts
|
|
12
12
|
import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "fs";
|