@botconnector/bccli 0.4.15 → 0.4.17
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-JZW3XHE5.js → acp-HWHF25KU.js} +3 -3
- package/dist/agent.d.ts +11 -0
- package/dist/{args-XVO7TB4C.js → args-XA77XUMD.js} +4 -4
- package/dist/{chunk-INMSTUB2.js → chunk-2IP5F3EK.js} +4 -4
- package/dist/{chunk-S3QEZDKB.js → chunk-5CVHTYBQ.js} +3 -3
- package/dist/{chunk-KEKDRROL.js → chunk-6LO6YRDY.js} +1 -1
- package/dist/{chunk-JUC3ZOCV.js → chunk-6PJRWKVI.js} +2 -2
- package/dist/{chunk-KJIXA6MP.js → chunk-7OTFZK4B.js} +7 -7
- package/dist/{chunk-KDVL2NP6.js → chunk-7U7CMKKI.js} +1 -1
- package/dist/{chunk-ZJRZTMJF.js → chunk-A3NBWIEQ.js} +52 -15
- package/dist/{chunk-6SDRWEPN.js → chunk-FY543EQW.js} +1 -1
- package/dist/{chunk-R754XIBJ.js → chunk-IDZLHEVL.js} +2 -1
- package/dist/{chunk-7GM6NN5E.js → chunk-IF5RNXBI.js} +1 -1
- package/dist/{chunk-ISOKH5WB.js → chunk-M5T4AM4I.js} +3 -3
- package/dist/{chunk-7XD47KN5.js → chunk-NGFWBVHD.js} +1 -1
- package/dist/{chunk-6JK4IBGK.js → chunk-OCEQ2TRJ.js} +2 -2
- package/dist/{chunk-SWNRA3EW.js → chunk-RLSQAZBT.js} +4 -4
- package/dist/{chunk-Q42ZGVAQ.js → chunk-VPFCIUC6.js} +2 -2
- package/dist/{chunk-2PAVSETH.js → chunk-XP5MTJN2.js} +1 -1
- package/dist/{chunk-3CYQYHPK.js → chunk-YGBTNDPK.js} +1 -1
- package/dist/{chunk-TLCL6DC7.js → chunk-ZXWRLN7E.js} +1 -1
- package/dist/cli.js +38 -38
- package/dist/{completion-Q7VHOPPV.js → completion-IRVEVW6H.js} +1 -1
- package/dist/{config-YYEAEN2C.js → config-OVWCUVY7.js} +3 -3
- package/dist/{config-T7MKGJVG.js → config-S3CZUIBB.js} +2 -2
- package/dist/{ghBotCli-7VUGI63S.js → ghBotCli-FYKJDJOD.js} +14 -14
- package/dist/{integrationCli-FBRSTF5F.js → integrationCli-GY73S2K7.js} +2 -2
- package/dist/{login-BSMUGW7L.js → login-KSN63EM4.js} +4 -4
- package/dist/{mcpCli-ZT7CRYMP.js → mcpCli-VWSCCDWT.js} +6 -6
- package/dist/{modelsCli-2ZRW4CC4.js → modelsCli-4Q6KFWV2.js} +6 -6
- package/dist/{oauthLogin-THSM6FE7.js → oauthLogin-JWXQZTMZ.js} +1 -1
- package/dist/{pluginsCli-EKQI4CJW.js → pluginsCli-7XWDLJEL.js} +2 -2
- package/dist/{prCli-FMQTOBIV.js → prCli-FH7N26D4.js} +1 -1
- package/dist/providerCli-YMG4G56R.js +15 -0
- package/dist/sdk.js +43 -5
- package/dist/{serve-V6YVZTNR.js → serve-HSFF6MGB.js} +3 -3
- package/dist/{serve-RKV2JCU7.js → serve-HUQNVOSP.js} +15 -15
- package/dist/session-YM36TGU7.js +12 -0
- package/dist/setup-3YB6EKYX.js +24 -0
- package/dist/{statsCli-7MIQHLVW.js → statsCli-I4TSDU3X.js} +1 -1
- package/dist/{transferCli-SRSYQLSJ.js → transferCli-3B4LMOYI.js} +4 -4
- package/dist/ui/StatusBar.d.ts +6 -1
- package/dist/ui/liveCap.d.ts +21 -1
- package/dist/ui/markdownLayout.d.ts +23 -0
- package/dist/ui/stdinFilter.d.ts +18 -0
- package/dist/{ui-ICUWKBUG.js → ui-TAZMRXRI.js} +229 -56
- package/dist/{update-U4FXFWNV.js → update-5V425FIK.js} +2 -2
- package/package.json +1 -1
- package/dist/providerCli-3TFEKV4C.js +0 -15
- package/dist/session-LX4UNPCD.js +0 -12
- package/dist/setup-MFG3BWEU.js +0 -24
package/dist/cli.js
CHANGED
|
@@ -3,47 +3,47 @@ import {
|
|
|
3
3
|
resolvePrintPrompt,
|
|
4
4
|
resolveWorktree,
|
|
5
5
|
runPrint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5CVHTYBQ.js";
|
|
7
7
|
import {
|
|
8
8
|
createRuntime
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-A3NBWIEQ.js";
|
|
10
10
|
import "./chunk-OK2USAXX.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-7U7CMKKI.js";
|
|
12
|
+
import "./chunk-IF5RNXBI.js";
|
|
13
13
|
import "./chunk-PSO7R5AD.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XP5MTJN2.js";
|
|
17
17
|
import {
|
|
18
18
|
helpText,
|
|
19
19
|
parseCliArgs
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-M5T4AM4I.js";
|
|
21
21
|
import "./chunk-YYTFJUO2.js";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-RLSQAZBT.js";
|
|
23
|
+
import "./chunk-2IP5F3EK.js";
|
|
24
24
|
import {
|
|
25
25
|
readGlobalConfigFile
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FY543EQW.js";
|
|
27
27
|
import {
|
|
28
28
|
defaultLoginDeps,
|
|
29
29
|
runLogin
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-7OTFZK4B.js";
|
|
31
|
+
import "./chunk-YGBTNDPK.js";
|
|
32
32
|
import {
|
|
33
33
|
pruneSessions
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-6LO6YRDY.js";
|
|
35
|
+
import "./chunk-OCEQ2TRJ.js";
|
|
36
|
+
import "./chunk-NGFWBVHD.js";
|
|
37
|
+
import "./chunk-VPFCIUC6.js";
|
|
38
38
|
import {
|
|
39
39
|
ConfigError,
|
|
40
40
|
setTheme
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-ZXWRLN7E.js";
|
|
42
42
|
import {
|
|
43
43
|
resolveLanguage,
|
|
44
44
|
setLanguage,
|
|
45
45
|
t
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-IDZLHEVL.js";
|
|
47
47
|
|
|
48
48
|
// src/exit.ts
|
|
49
49
|
var EXIT_GRACE_MS = 1e3;
|
|
@@ -85,17 +85,17 @@ async function main() {
|
|
|
85
85
|
if (args.worktree) cwd = (await resolveWorktree(cwd, args.worktree)).path;
|
|
86
86
|
if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd, args, defaultLoginDeps());
|
|
87
87
|
if (args.command === "mcp") {
|
|
88
|
-
const { runMcpCommand } = await import("./mcpCli-
|
|
89
|
-
const { readSecret } = await import("./login-
|
|
88
|
+
const { runMcpCommand } = await import("./mcpCli-VWSCCDWT.js");
|
|
89
|
+
const { readSecret } = await import("./login-KSN63EM4.js");
|
|
90
90
|
return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
91
91
|
}
|
|
92
92
|
if (args.command === "provider") {
|
|
93
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
94
|
-
const { readSecret } = await import("./login-
|
|
93
|
+
const { runProviderCommand } = await import("./providerCli-YMG4G56R.js");
|
|
94
|
+
const { readSecret } = await import("./login-KSN63EM4.js");
|
|
95
95
|
return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
96
96
|
}
|
|
97
97
|
if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
|
|
98
|
-
const { runIntegrationCommand } = await import("./integrationCli-
|
|
98
|
+
const { runIntegrationCommand } = await import("./integrationCli-GY73S2K7.js");
|
|
99
99
|
return runIntegrationCommand(args, {
|
|
100
100
|
env: process.env,
|
|
101
101
|
cwd,
|
|
@@ -105,20 +105,20 @@ async function main() {
|
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
if (args.command === "models") {
|
|
108
|
-
const { runModelsCommand } = await import("./modelsCli-
|
|
108
|
+
const { runModelsCommand } = await import("./modelsCli-4Q6KFWV2.js");
|
|
109
109
|
return runModelsCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), fetch: globalThis.fetch });
|
|
110
110
|
}
|
|
111
111
|
if (args.command === "update") {
|
|
112
|
-
const { runUpdateCommand } = await import("./update-
|
|
112
|
+
const { runUpdateCommand } = await import("./update-5V425FIK.js");
|
|
113
113
|
return runUpdateCommand({ env: process.env });
|
|
114
114
|
}
|
|
115
115
|
if (args.command === "acp") {
|
|
116
|
-
const { runtimeAgent, runAcp } = await import("./acp-
|
|
116
|
+
const { runtimeAgent, runAcp } = await import("./acp-HWHF25KU.js");
|
|
117
117
|
await runAcp(process.stdin, process.stdout, { cwd, newAgent: (c) => runtimeAgent(c, args.allowAll) });
|
|
118
118
|
return 0;
|
|
119
119
|
}
|
|
120
120
|
if (args.command === "serve") {
|
|
121
|
-
const { serveBanner, startServe } = await import("./serve-
|
|
121
|
+
const { serveBanner, startServe } = await import("./serve-HUQNVOSP.js");
|
|
122
122
|
const handle = await startServe({ port: args.port, host: args.host, token: args.token, cwd, env: process.env });
|
|
123
123
|
process.stderr.write(serveBanner(handle, { token: args.token }));
|
|
124
124
|
await new Promise((resolve) => {
|
|
@@ -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-7XWDLJEL.js");
|
|
135
|
+
const { readGlobalPlugins, updateGlobalConfig } = await import("./config-S3CZUIBB.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-FYKJDJOD.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-IRVEVW6H.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-I4TSDU3X.js");
|
|
158
|
+
const { bccliHome } = await import("./config-S3CZUIBB.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-3B4LMOYI.js");
|
|
166
|
+
const { bccliHome } = await import("./config-S3CZUIBB.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-FH7N26D4.js");
|
|
173
173
|
return runPrCommand(
|
|
174
174
|
{
|
|
175
175
|
subArgs: args.subArgs,
|
|
@@ -199,7 +199,7 @@ async function main() {
|
|
|
199
199
|
}
|
|
200
200
|
const finalPrompt = resolvePrintPrompt(args.prompt, stdinText);
|
|
201
201
|
if (!finalPrompt) throw new ConfigError(t('-p mode needs a task, e.g. bccli -p "explain this repo"'));
|
|
202
|
-
const { serversToStart } = await import("./config-
|
|
202
|
+
const { serversToStart } = await import("./config-OVWCUVY7.js");
|
|
203
203
|
const plan = serversToStart(rt.home, cwd);
|
|
204
204
|
for (const s of plan.needTrust) {
|
|
205
205
|
console.error(t('Project MCP server "{name}" skipped (not approved yet; run interactive bccli once to approve it).', { name: s.name }));
|
|
@@ -215,13 +215,13 @@ async function main() {
|
|
|
215
215
|
let updateMessage;
|
|
216
216
|
if (rt.config.updateCheck !== "off" && !process.env.BCCLI_NO_UPDATE_CHECK) {
|
|
217
217
|
try {
|
|
218
|
-
const { checkForUpdate } = await import("./update-
|
|
218
|
+
const { checkForUpdate } = await import("./update-5V425FIK.js");
|
|
219
219
|
const update = await checkForUpdate({ home: rt.home, fetch: globalThis.fetch, now: /* @__PURE__ */ new Date() });
|
|
220
220
|
updateMessage = update;
|
|
221
221
|
} catch {
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
const { startInteractive } = await import("./ui-
|
|
224
|
+
const { startInteractive } = await import("./ui-TAZMRXRI.js");
|
|
225
225
|
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION, updateMessage });
|
|
226
226
|
}
|
|
227
227
|
main().then(
|
|
@@ -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-VPFCIUC6.js";
|
|
13
|
+
import "./chunk-ZXWRLN7E.js";
|
|
14
|
+
import "./chunk-IDZLHEVL.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-A3NBWIEQ.js";
|
|
5
5
|
import "./chunk-OK2USAXX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-7U7CMKKI.js";
|
|
7
|
+
import "./chunk-IF5RNXBI.js";
|
|
8
8
|
import "./chunk-PSO7R5AD.js";
|
|
9
9
|
import {
|
|
10
10
|
LOOPBACK_BIND,
|
|
11
11
|
parseCliArgs
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M5T4AM4I.js";
|
|
13
13
|
import "./chunk-YYTFJUO2.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-RLSQAZBT.js";
|
|
15
|
+
import "./chunk-2IP5F3EK.js";
|
|
16
|
+
import "./chunk-FY543EQW.js";
|
|
17
|
+
import "./chunk-YGBTNDPK.js";
|
|
18
|
+
import "./chunk-6LO6YRDY.js";
|
|
19
|
+
import "./chunk-OCEQ2TRJ.js";
|
|
20
|
+
import "./chunk-NGFWBVHD.js";
|
|
21
|
+
import "./chunk-VPFCIUC6.js";
|
|
22
22
|
import {
|
|
23
23
|
ConfigError,
|
|
24
24
|
globalConfigPath,
|
|
25
25
|
readJsonConfig
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZXWRLN7E.js";
|
|
27
27
|
import {
|
|
28
28
|
t
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-IDZLHEVL.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-ZXWRLN7E.js";
|
|
9
9
|
import {
|
|
10
10
|
t
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IDZLHEVL.js";
|
|
12
12
|
|
|
13
13
|
// src/integrationCli.ts
|
|
14
14
|
import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
readLine,
|
|
6
6
|
readSecret,
|
|
7
7
|
runLogin
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-7OTFZK4B.js";
|
|
9
|
+
import "./chunk-YGBTNDPK.js";
|
|
10
|
+
import "./chunk-ZXWRLN7E.js";
|
|
11
|
+
import "./chunk-IDZLHEVL.js";
|
|
12
12
|
export {
|
|
13
13
|
defaultLoginDeps,
|
|
14
14
|
echoFor,
|
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CATALOG,
|
|
4
4
|
fillTemplate
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6PJRWKVI.js";
|
|
6
6
|
import {
|
|
7
7
|
authorizeMcpServer,
|
|
8
8
|
clearTokens
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YGBTNDPK.js";
|
|
10
10
|
import {
|
|
11
11
|
addGlobalServer,
|
|
12
12
|
globalMcpPath,
|
|
13
13
|
readMcpFile,
|
|
14
14
|
removeGlobalServer
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VPFCIUC6.js";
|
|
16
16
|
import {
|
|
17
17
|
bccliHome
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZXWRLN7E.js";
|
|
19
19
|
import {
|
|
20
20
|
t
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-IDZLHEVL.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-HSFF6MGB.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-2IP5F3EK.js";
|
|
5
|
+
import "./chunk-FY543EQW.js";
|
|
6
|
+
import "./chunk-OCEQ2TRJ.js";
|
|
7
|
+
import "./chunk-NGFWBVHD.js";
|
|
8
8
|
import {
|
|
9
9
|
loadConfig,
|
|
10
10
|
resolveModel
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZXWRLN7E.js";
|
|
12
12
|
import {
|
|
13
13
|
t
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IDZLHEVL.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-ZXWRLN7E.js";
|
|
6
6
|
import {
|
|
7
7
|
t
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IDZLHEVL.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-RLSQAZBT.js";
|
|
6
|
+
import "./chunk-2IP5F3EK.js";
|
|
7
|
+
import "./chunk-FY543EQW.js";
|
|
8
|
+
import "./chunk-OCEQ2TRJ.js";
|
|
9
|
+
import "./chunk-NGFWBVHD.js";
|
|
10
|
+
import "./chunk-ZXWRLN7E.js";
|
|
11
|
+
import "./chunk-IDZLHEVL.js";
|
|
12
|
+
export {
|
|
13
|
+
addProviderKey,
|
|
14
|
+
runProviderCommand
|
|
15
|
+
};
|
package/dist/sdk.js
CHANGED
|
@@ -67,7 +67,8 @@ var ID = {
|
|
|
67
67
|
"[n] not yet, revise first": "[n] belum, perbaiki dulu",
|
|
68
68
|
" enter save \xB7 esc cancel": " enter simpan \xB7 esc batal",
|
|
69
69
|
"shift+tab switch mode": "shift+tab ganti mode",
|
|
70
|
-
"{n} tokens": "{n} token",
|
|
70
|
+
"{n} tokens in context": "{n} token dalam konteks",
|
|
71
|
+
"{n} cached": "{n} dari cache",
|
|
71
72
|
"\u273B Thinking": "\u273B Berpikir",
|
|
72
73
|
"\u273B Thinking \xB7 {n} lines": "\u273B Berpikir \xB7 {n} baris",
|
|
73
74
|
"click to toggle": "klik untuk buka/tutup",
|
|
@@ -3933,6 +3934,7 @@ var Agent2 = class {
|
|
|
3933
3934
|
this.budgetModel = opts.budgetModel ?? "";
|
|
3934
3935
|
this.systemPrompt = opts.systemPrompt;
|
|
3935
3936
|
this.reasoning = opts.reasoning ?? "auto";
|
|
3937
|
+
this.seedEstimatedContext();
|
|
3936
3938
|
}
|
|
3937
3939
|
opts;
|
|
3938
3940
|
provider;
|
|
@@ -3940,6 +3942,7 @@ var Agent2 = class {
|
|
|
3940
3942
|
messages;
|
|
3941
3943
|
totalUsage = { inputTokens: 0, outputTokens: 0 };
|
|
3942
3944
|
lastInputTokens = 0;
|
|
3945
|
+
lastInputEstimated = false;
|
|
3943
3946
|
onEvent = () => {
|
|
3944
3947
|
};
|
|
3945
3948
|
reasoning;
|
|
@@ -3958,6 +3961,7 @@ var Agent2 = class {
|
|
|
3958
3961
|
systemPrompt;
|
|
3959
3962
|
setSystemPrompt(text) {
|
|
3960
3963
|
this.systemPrompt = text;
|
|
3964
|
+
this.publishContextMetadata();
|
|
3961
3965
|
}
|
|
3962
3966
|
setContextWindow(window) {
|
|
3963
3967
|
this.contextWindow = window;
|
|
@@ -3974,6 +3978,7 @@ var Agent2 = class {
|
|
|
3974
3978
|
setTools(tools) {
|
|
3975
3979
|
this.tools = tools;
|
|
3976
3980
|
this.definitions = toolDefinitions(tools);
|
|
3981
|
+
this.publishContextMetadata();
|
|
3977
3982
|
}
|
|
3978
3983
|
isParallelSafe(call) {
|
|
3979
3984
|
const tool = this.turnTools.find((t2) => t2.name === call.name);
|
|
@@ -3989,18 +3994,42 @@ var Agent2 = class {
|
|
|
3989
3994
|
this.messages.push(message);
|
|
3990
3995
|
this.opts.onMessage?.(message);
|
|
3991
3996
|
}
|
|
3997
|
+
estimateCurrentInputTokens() {
|
|
3998
|
+
return estimateMessages(this.messages) + estimateTokens(this.systemPrompt) + estimateTokens(JSON.stringify(this.definitions));
|
|
3999
|
+
}
|
|
4000
|
+
seedEstimatedContext() {
|
|
4001
|
+
if (this.messages.length === 0) {
|
|
4002
|
+
this.lastInputTokens = 0;
|
|
4003
|
+
this.lastInputEstimated = false;
|
|
4004
|
+
return;
|
|
4005
|
+
}
|
|
4006
|
+
this.lastInputTokens = this.estimateCurrentInputTokens();
|
|
4007
|
+
this.lastInputEstimated = true;
|
|
4008
|
+
}
|
|
4009
|
+
/** Publish the latest context after prompt/history changes, without changing session usage totals. */
|
|
4010
|
+
publishContextMetadata() {
|
|
4011
|
+
this.seedEstimatedContext();
|
|
4012
|
+
this.onEvent({
|
|
4013
|
+
type: "usage",
|
|
4014
|
+
...this.totalUsage,
|
|
4015
|
+
lastInputTokens: this.lastInputTokens,
|
|
4016
|
+
lastCachedInputTokens: 0,
|
|
4017
|
+
estimated: this.lastInputEstimated
|
|
4018
|
+
});
|
|
4019
|
+
}
|
|
3992
4020
|
/** Swaps in another conversation (resume, new session) without writing to the session log. */
|
|
3993
4021
|
load(messages) {
|
|
3994
4022
|
this.messages = messages;
|
|
3995
4023
|
this.readFiles.clear();
|
|
3996
4024
|
this.webBudget.reset();
|
|
3997
|
-
this.
|
|
4025
|
+
this.publishContextMetadata();
|
|
3998
4026
|
}
|
|
3999
4027
|
clear() {
|
|
4000
4028
|
this.messages = [];
|
|
4001
4029
|
this.readFiles.clear();
|
|
4002
4030
|
this.webBudget.reset();
|
|
4003
4031
|
this.lastInputTokens = 0;
|
|
4032
|
+
this.lastInputEstimated = false;
|
|
4004
4033
|
this.opts.onReset?.();
|
|
4005
4034
|
}
|
|
4006
4035
|
async compact(signal) {
|
|
@@ -4022,6 +4051,7 @@ var Agent2 = class {
|
|
|
4022
4051
|
${completion.text}` });
|
|
4023
4052
|
this.push({ role: "assistant", content: "OK, I will continue from this summary." });
|
|
4024
4053
|
for (const m of keep) this.push(m);
|
|
4054
|
+
this.publishContextMetadata();
|
|
4025
4055
|
this.onEvent({ type: "compacted" });
|
|
4026
4056
|
}
|
|
4027
4057
|
/**
|
|
@@ -4085,8 +4115,9 @@ ${completion.text}` });
|
|
|
4085
4115
|
this.onEvent({ type: "textReplace", text: recovered.text });
|
|
4086
4116
|
}
|
|
4087
4117
|
}
|
|
4118
|
+
const estimated = completion.usage === void 0;
|
|
4088
4119
|
const usage = completion.usage ?? {
|
|
4089
|
-
inputTokens: estimateTokens(this.systemPrompt) + estimateTokens(JSON.stringify(this.messages)),
|
|
4120
|
+
inputTokens: estimateTokens(this.systemPrompt) + estimateTokens(JSON.stringify(this.messages)) + estimateTokens(JSON.stringify(this.turnDefinitions)),
|
|
4090
4121
|
outputTokens: estimateTokens(completion.text) + (completion.toolCalls.length ? estimateTokens(JSON.stringify(completion.toolCalls)) : 0)
|
|
4091
4122
|
};
|
|
4092
4123
|
this.totalUsage.inputTokens += usage.inputTokens;
|
|
@@ -4094,7 +4125,14 @@ ${completion.text}` });
|
|
|
4094
4125
|
this.totalUsage.cachedInputTokens = (this.totalUsage.cachedInputTokens ?? 0) + (usage.cachedInputTokens ?? 0);
|
|
4095
4126
|
this.totalUsage.cacheWriteTokens = (this.totalUsage.cacheWriteTokens ?? 0) + (usage.cacheWriteTokens ?? 0);
|
|
4096
4127
|
this.lastInputTokens = usage.inputTokens;
|
|
4097
|
-
this.
|
|
4128
|
+
this.lastInputEstimated = estimated;
|
|
4129
|
+
this.onEvent({
|
|
4130
|
+
type: "usage",
|
|
4131
|
+
...this.totalUsage,
|
|
4132
|
+
lastInputTokens: usage.inputTokens,
|
|
4133
|
+
lastCachedInputTokens: usage.cachedInputTokens ?? 0,
|
|
4134
|
+
estimated
|
|
4135
|
+
});
|
|
4098
4136
|
this.opts.onUsage?.(usage);
|
|
4099
4137
|
this.push(completionAssistantMessage(completion));
|
|
4100
4138
|
if (completion.finishReason === "repetition") {
|
|
@@ -5325,7 +5363,7 @@ function createTaskTool(opts) {
|
|
|
5325
5363
|
};
|
|
5326
5364
|
return defineTool({
|
|
5327
5365
|
name: "task",
|
|
5328
|
-
description: `Delegate a self-contained sub-task
|
|
5366
|
+
description: `Delegate a self-contained sub-task. Choose an agent whose listed tools can complete it; a read-only agent cannot run shell/SSH/network commands or edit, and a failed run still spends tokens. Available agents:
|
|
5329
5367
|
${list2}`,
|
|
5330
5368
|
schema: z13.object({
|
|
5331
5369
|
agent: z13.string().describe("Agent name"),
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
createFetchTool,
|
|
4
4
|
createWebSearchTool,
|
|
5
5
|
isPrivateHost
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IF5RNXBI.js";
|
|
7
7
|
import "./chunk-PSO7R5AD.js";
|
|
8
8
|
import {
|
|
9
9
|
loadConfig,
|
|
10
10
|
readCredentials
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZXWRLN7E.js";
|
|
12
12
|
import {
|
|
13
13
|
t
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IDZLHEVL.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-A3NBWIEQ.js";
|
|
5
5
|
import "./chunk-OK2USAXX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-7U7CMKKI.js";
|
|
7
|
+
import "./chunk-IF5RNXBI.js";
|
|
8
8
|
import "./chunk-PSO7R5AD.js";
|
|
9
9
|
import {
|
|
10
10
|
VERSION
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XP5MTJN2.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-M5T4AM4I.js";
|
|
21
21
|
import "./chunk-YYTFJUO2.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-RLSQAZBT.js";
|
|
23
23
|
import {
|
|
24
24
|
listAllModels
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-2IP5F3EK.js";
|
|
26
|
+
import "./chunk-FY543EQW.js";
|
|
27
|
+
import "./chunk-YGBTNDPK.js";
|
|
28
28
|
import {
|
|
29
29
|
Session
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
30
|
+
} from "./chunk-6LO6YRDY.js";
|
|
31
|
+
import "./chunk-OCEQ2TRJ.js";
|
|
32
|
+
import "./chunk-NGFWBVHD.js";
|
|
33
|
+
import "./chunk-VPFCIUC6.js";
|
|
34
34
|
import {
|
|
35
35
|
bccliHome,
|
|
36
36
|
loadConfig
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-ZXWRLN7E.js";
|
|
38
|
+
import "./chunk-IDZLHEVL.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-A3NBWIEQ.js";
|
|
6
|
+
import "./chunk-OK2USAXX.js";
|
|
7
|
+
import "./chunk-7U7CMKKI.js";
|
|
8
|
+
import "./chunk-IF5RNXBI.js";
|
|
9
|
+
import "./chunk-PSO7R5AD.js";
|
|
10
|
+
import "./chunk-YYTFJUO2.js";
|
|
11
|
+
import "./chunk-RLSQAZBT.js";
|
|
12
|
+
import "./chunk-2IP5F3EK.js";
|
|
13
|
+
import "./chunk-FY543EQW.js";
|
|
14
|
+
import "./chunk-YGBTNDPK.js";
|
|
15
|
+
import "./chunk-6LO6YRDY.js";
|
|
16
|
+
import "./chunk-OCEQ2TRJ.js";
|
|
17
|
+
import "./chunk-NGFWBVHD.js";
|
|
18
|
+
import "./chunk-VPFCIUC6.js";
|
|
19
|
+
import "./chunk-ZXWRLN7E.js";
|
|
20
|
+
import "./chunk-IDZLHEVL.js";
|
|
21
|
+
export {
|
|
22
|
+
createRuntime,
|
|
23
|
+
lunaPtcAutoEnabled
|
|
24
|
+
};
|