@botconnector/bccli 0.4.0-beta.31 → 0.4.0-beta.32
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/{chunk-Z37BR5H4.js → chunk-FNBTY56Z.js} +1 -1
- package/dist/{chunk-CX5U4EHX.js → chunk-GJAX4NCM.js} +6 -1
- package/dist/cli.js +11 -7
- package/dist/{login-AP2ODLJX.js → login-7IARC5WX.js} +1 -1
- package/dist/{providerCli-J4Y7D6PF.js → providerCli-4JTIW3YA.js} +1 -1
- package/dist/{ui-EFY7SNIW.js → ui-N7SJ7V7V.js} +1 -0
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ function readSecret(prompt) {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
async function runLogin(providerId, cwd) {
|
|
38
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
38
|
+
const { runProviderCommand } = await import("./providerCli-4JTIW3YA.js");
|
|
39
39
|
const { parseCliArgs } = await import("./args-EFFR44JW.js");
|
|
40
40
|
return runProviderCommand(parseCliArgs(["provider", "add", providerId]), {
|
|
41
41
|
env: process.env,
|
|
@@ -117,7 +117,12 @@ function errorMessage(body) {
|
|
|
117
117
|
return body.slice(0, 300);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
var toUsage = (u) => u ? {
|
|
120
|
+
var toUsage = (u) => u ? {
|
|
121
|
+
inputTokens: u.prompt_tokens ?? 0,
|
|
122
|
+
outputTokens: u.completion_tokens ?? 0,
|
|
123
|
+
...u.prompt_tokens_details?.cached_tokens != null ? { cachedInputTokens: u.prompt_tokens_details.cached_tokens } : {},
|
|
124
|
+
...u.prompt_tokens_details?.cache_write_tokens != null ? { cacheWriteTokens: u.prompt_tokens_details.cache_write_tokens } : {}
|
|
125
|
+
} : void 0;
|
|
121
126
|
async function readStream(res, onText, onThinking) {
|
|
122
127
|
let text = "";
|
|
123
128
|
let thinking = "";
|
package/dist/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
createProvider,
|
|
25
25
|
hasPendingProgrammaticReplay,
|
|
26
26
|
listAllModels
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-GJAX4NCM.js";
|
|
28
28
|
import {
|
|
29
29
|
providerName,
|
|
30
30
|
readGlobalConfigFile
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import "./chunk-UJH2JT6H.js";
|
|
33
33
|
import {
|
|
34
34
|
runLogin
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-FNBTY56Z.js";
|
|
36
36
|
import {
|
|
37
37
|
Session,
|
|
38
38
|
pruneSessions
|
|
@@ -1056,6 +1056,8 @@ ${completion.text}` });
|
|
|
1056
1056
|
};
|
|
1057
1057
|
this.totalUsage.inputTokens += usage.inputTokens;
|
|
1058
1058
|
this.totalUsage.outputTokens += usage.outputTokens;
|
|
1059
|
+
this.totalUsage.cachedInputTokens = (this.totalUsage.cachedInputTokens ?? 0) + (usage.cachedInputTokens ?? 0);
|
|
1060
|
+
this.totalUsage.cacheWriteTokens = (this.totalUsage.cacheWriteTokens ?? 0) + (usage.cacheWriteTokens ?? 0);
|
|
1059
1061
|
this.lastInputTokens = usage.inputTokens;
|
|
1060
1062
|
this.onEvent({ type: "usage", ...this.totalUsage });
|
|
1061
1063
|
this.push(completionAssistantMessage(completion));
|
|
@@ -1173,6 +1175,8 @@ ${t("This model may not support tool calling. Try another model with /model.")}`
|
|
|
1173
1175
|
addUsage: (u) => {
|
|
1174
1176
|
this.totalUsage.inputTokens += u.inputTokens;
|
|
1175
1177
|
this.totalUsage.outputTokens += u.outputTokens;
|
|
1178
|
+
this.totalUsage.cachedInputTokens = (this.totalUsage.cachedInputTokens ?? 0) + (u.cachedInputTokens ?? 0);
|
|
1179
|
+
this.totalUsage.cacheWriteTokens = (this.totalUsage.cacheWriteTokens ?? 0) + (u.cacheWriteTokens ?? 0);
|
|
1176
1180
|
this.onEvent({ type: "usage", ...this.totalUsage });
|
|
1177
1181
|
}
|
|
1178
1182
|
};
|
|
@@ -1752,7 +1756,7 @@ function createRuntime(opts) {
|
|
|
1752
1756
|
}
|
|
1753
1757
|
|
|
1754
1758
|
// src/version.ts
|
|
1755
|
-
var VERSION = true ? "0.4.0-beta.
|
|
1759
|
+
var VERSION = true ? "0.4.0-beta.32" : "0.0.0-dev";
|
|
1756
1760
|
|
|
1757
1761
|
// src/cli.ts
|
|
1758
1762
|
function chooseLanguage(argv) {
|
|
@@ -1778,12 +1782,12 @@ async function main() {
|
|
|
1778
1782
|
if (args.command === "login") return runLogin(args.loginProvider ?? "bc-cloud", cwd);
|
|
1779
1783
|
if (args.command === "mcp") {
|
|
1780
1784
|
const { runMcpCommand } = await import("./mcpCli-UGNEDBMU.js");
|
|
1781
|
-
const { readSecret } = await import("./login-
|
|
1785
|
+
const { readSecret } = await import("./login-7IARC5WX.js");
|
|
1782
1786
|
return runMcpCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
1783
1787
|
}
|
|
1784
1788
|
if (args.command === "provider") {
|
|
1785
|
-
const { runProviderCommand } = await import("./providerCli-
|
|
1786
|
-
const { readSecret } = await import("./login-
|
|
1789
|
+
const { runProviderCommand } = await import("./providerCli-4JTIW3YA.js");
|
|
1790
|
+
const { readSecret } = await import("./login-7IARC5WX.js");
|
|
1787
1791
|
return runProviderCommand(args, { env: process.env, cwd, out: (s) => console.log(s), err: (s) => console.error(s), readSecret });
|
|
1788
1792
|
}
|
|
1789
1793
|
if (args.command === "connect" || args.command === "disconnect" || args.command === "integrations") {
|
|
@@ -1823,7 +1827,7 @@ async function main() {
|
|
|
1823
1827
|
}
|
|
1824
1828
|
}
|
|
1825
1829
|
if (!process.stdin.isTTY) throw new ConfigError(t('Interactive mode needs a terminal. For scripts/CI use: bccli -p "task"'));
|
|
1826
|
-
const { startInteractive } = await import("./ui-
|
|
1830
|
+
const { startInteractive } = await import("./ui-N7SJ7V7V.js");
|
|
1827
1831
|
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION });
|
|
1828
1832
|
}
|
|
1829
1833
|
main().then(
|
|
@@ -177,6 +177,7 @@ function statusText(s) {
|
|
|
177
177
|
t("Folder: {cwd}", { cwd: s.cwd }),
|
|
178
178
|
t("MCP: {ready} active, {errors} errors", { ready, errors }),
|
|
179
179
|
t("Session tokens: {input} in \xB7 {output} out", { input: k(s.usage.inputTokens), output: k(s.usage.outputTokens) }),
|
|
180
|
+
`Cache: ${k(s.usage.cachedInputTokens ?? 0)} read \xB7 ${k(s.usage.cacheWriteTokens ?? 0)} write`,
|
|
180
181
|
t("Context: ~{pct}% of 128k", { pct: Math.round(s.lastInputTokens / 128e3 * 100) })
|
|
181
182
|
].join("\n");
|
|
182
183
|
}
|