@botconnector/bccli 0.4.15 → 0.4.16
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-2PAVSETH.js → chunk-V5D6PJQN.js} +1 -1
- package/dist/cli.js +5 -5
- package/dist/{serve-RKV2JCU7.js → serve-3BODPEPR.js} +1 -1
- package/dist/ui/stdinFilter.d.ts +18 -0
- package/dist/{ui-ICUWKBUG.js → ui-LZ4JGF2V.js} +42 -0
- package/dist/{update-U4FXFWNV.js → update-P7MU4ZM7.js} +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import "./chunk-7GM6NN5E.js";
|
|
|
13
13
|
import "./chunk-PSO7R5AD.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-V5D6PJQN.js";
|
|
17
17
|
import {
|
|
18
18
|
helpText,
|
|
19
19
|
parseCliArgs
|
|
@@ -109,7 +109,7 @@ async function main() {
|
|
|
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-P7MU4ZM7.js");
|
|
113
113
|
return runUpdateCommand({ env: process.env });
|
|
114
114
|
}
|
|
115
115
|
if (args.command === "acp") {
|
|
@@ -118,7 +118,7 @@ async function main() {
|
|
|
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-3BODPEPR.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) => {
|
|
@@ -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-P7MU4ZM7.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-LZ4JGF2V.js");
|
|
225
225
|
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION, updateMessage });
|
|
226
226
|
}
|
|
227
227
|
main().then(
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminals without SGR support answer mouse tracking (`\x1b[?1000h`, which bccli only turns on while the Thinking
|
|
3
|
+
* block is clickable) with legacy X10 reports: `ESC [ M` followed by three raw bytes. Ink 8 drops the `ESC [ M`
|
|
4
|
+
* prefix but passes those three bytes to `useInput` as if typed, so they land in the prompt as punctuation.
|
|
5
|
+
* Remove the whole report here, where the prefix is still visible.
|
|
6
|
+
*
|
|
7
|
+
* `carry` is the tail of a report split across chunks; feed it back as the second argument on the next chunk.
|
|
8
|
+
*/
|
|
9
|
+
export declare function stripLegacyMouseReports(chunk: string, carry?: string): {
|
|
10
|
+
text: string;
|
|
11
|
+
carry: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Ink owns the input stream, so a report can only be kept out of `useInput` if it never reaches Ink's reader.
|
|
15
|
+
* Ink 8 reads stdin with `read()`, so the filter wraps that single method: everything that is not an X10 report is
|
|
16
|
+
* forwarded byte for byte and every other stream property (raw mode, TTY flags, event handlers) stays the real one.
|
|
17
|
+
*/
|
|
18
|
+
export declare function installLegacyMouseFilter(source: NodeJS.ReadStream): () => void;
|
|
@@ -2824,6 +2824,46 @@ ${allLines.slice(-maxLiveLines).join("\n")}` : text;
|
|
|
2824
2824
|
] });
|
|
2825
2825
|
}
|
|
2826
2826
|
|
|
2827
|
+
// src/ui/stdinFilter.ts
|
|
2828
|
+
var X10_START = "\x1B[M";
|
|
2829
|
+
var X10_PAYLOAD = 3;
|
|
2830
|
+
function stripLegacyMouseReports(chunk, carry = "") {
|
|
2831
|
+
const input = carry + chunk;
|
|
2832
|
+
let text = "";
|
|
2833
|
+
let index = 0;
|
|
2834
|
+
while (index < input.length) {
|
|
2835
|
+
if (input[index] === "\x1B") {
|
|
2836
|
+
const remaining = input.length - index;
|
|
2837
|
+
if (remaining < X10_START.length) {
|
|
2838
|
+
const tail = input.slice(index);
|
|
2839
|
+
if (X10_START.startsWith(tail)) return { text, carry: tail };
|
|
2840
|
+
} else if (input.startsWith(X10_START, index)) {
|
|
2841
|
+
if (remaining < X10_START.length + X10_PAYLOAD) return { text, carry: input.slice(index) };
|
|
2842
|
+
index += X10_START.length + X10_PAYLOAD;
|
|
2843
|
+
continue;
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
text += input[index];
|
|
2847
|
+
index++;
|
|
2848
|
+
}
|
|
2849
|
+
return { text, carry: "" };
|
|
2850
|
+
}
|
|
2851
|
+
function installLegacyMouseFilter(source) {
|
|
2852
|
+
const mutable = source;
|
|
2853
|
+
const original = mutable.read.bind(source);
|
|
2854
|
+
let carry = "";
|
|
2855
|
+
mutable.read = (size) => {
|
|
2856
|
+
const chunk = original(size);
|
|
2857
|
+
if (chunk === null) return null;
|
|
2858
|
+
const stripped = stripLegacyMouseReports(String(chunk), carry);
|
|
2859
|
+
carry = stripped.carry;
|
|
2860
|
+
return stripped.text;
|
|
2861
|
+
};
|
|
2862
|
+
return () => {
|
|
2863
|
+
mutable.read = original;
|
|
2864
|
+
};
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2827
2867
|
// src/ui/index.tsx
|
|
2828
2868
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2829
2869
|
async function startInteractive(rt, opts) {
|
|
@@ -2861,8 +2901,10 @@ async function startInteractive(rt, opts) {
|
|
|
2861
2901
|
void rt.startMcp(plan.start).catch((error) => {
|
|
2862
2902
|
console.error(t("Could not start MCP servers: {error}", { error: error instanceof Error ? error.message : String(error) }));
|
|
2863
2903
|
});
|
|
2904
|
+
const disposeMouseFilter = process.stdin.isTTY ? installLegacyMouseFilter(process.stdin) : void 0;
|
|
2864
2905
|
const instance = render(/* @__PURE__ */ jsx17(App, { runtime: rt, initialPrompt: opts.initialPrompt, version: opts.version, updateMessage: opts.updateMessage }), { exitOnCtrlC: true });
|
|
2865
2906
|
await instance.waitUntilExit();
|
|
2907
|
+
disposeMouseFilter?.();
|
|
2866
2908
|
await rt.mcp.stop();
|
|
2867
2909
|
return 0;
|
|
2868
2910
|
}
|