@botconnector/bccli 0.4.6 → 0.4.7
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-YGQXX2L7.js → acp-XGG33CZJ.js} +2 -2
- package/dist/{args-TFKRCKTY.js → args-SQRIBI2Q.js} +4 -4
- package/dist/{chunk-27REMLDV.js → chunk-34Z6BXTO.js} +1 -1
- package/dist/{chunk-6EGQI6HJ.js → chunk-3MCGYPYI.js} +1 -1
- package/dist/{chunk-3JQZ2IKV.js → chunk-3WYR6KVQ.js} +3 -3
- package/dist/{chunk-CILTKMZW.js → chunk-42VCJJTW.js} +7 -7
- package/dist/{chunk-WTCWBY2D.js → chunk-54PFT7F5.js} +2 -2
- package/dist/{chunk-2Y6TH4MA.js → chunk-6GC5I2RK.js} +4 -4
- package/dist/{chunk-NSARPM5C.js → chunk-CSIQDFEF.js} +1 -1
- package/dist/{chunk-XSUFHD67.js → chunk-EAR2C6TS.js} +1 -1
- package/dist/{chunk-QZKB6VTU.js → chunk-EG7GJBSV.js} +4 -4
- package/dist/{chunk-XQVEAF3F.js → chunk-HR7T3BY2.js} +2 -2
- package/dist/{chunk-BBZLRWPR.js → chunk-L5FKXSFK.js} +4 -4
- package/dist/{chunk-D7GAZKXT.js → chunk-SE6SM2EI.js} +3 -3
- package/dist/{chunk-AK6TWKET.js → chunk-T5Z3FCT2.js} +2 -2
- package/dist/{chunk-AN7SNPFA.js → chunk-TCRAN6ZO.js} +11 -11
- package/dist/{chunk-ZGIK5INC.js → chunk-V4LPDP3Z.js} +1 -1
- package/dist/{chunk-O5ATYRUP.js → chunk-WSSJH765.js} +1 -1
- package/dist/{chunk-EOOWV6C6.js → chunk-XCVYR5BK.js} +1 -0
- package/dist/{chunk-BL2KOEXJ.js → chunk-Y57FCAGM.js} +1 -1
- package/dist/cli.js +38 -38
- package/dist/{completion-JCBMQKNQ.js → completion-FETH4OGC.js} +1 -1
- package/dist/{config-2MR6V7U7.js → config-BUSQGUWY.js} +2 -2
- package/dist/{config-JCI7NAVY.js → config-PVEZPRMH.js} +3 -3
- package/dist/{ghBotCli-IXRHTHC5.js → ghBotCli-X6HEOQMZ.js} +14 -14
- package/dist/{integrationCli-KOCF73GG.js → integrationCli-552UYCXJ.js} +2 -2
- package/dist/{login-IMVSN4X3.js → login-SWK74XO5.js} +4 -4
- package/dist/{mcpCli-IBC3WCHG.js → mcpCli-DH4R5B7F.js} +6 -6
- package/dist/{modelsCli-BOPAZIG4.js → modelsCli-4YEUPYBF.js} +6 -6
- package/dist/{oauthLogin-TUXZLIQN.js → oauthLogin-NR22NWEV.js} +1 -1
- package/dist/{pluginsCli-X7NZRU7X.js → pluginsCli-CIW35MNB.js} +2 -2
- package/dist/{prCli-GPDLWYWC.js → prCli-6FCI36AJ.js} +1 -1
- package/dist/providerCli-N64TSYMT.js +15 -0
- package/dist/sdk.js +4 -3
- package/dist/{serve-XRFCR6MG.js → serve-DAC2JGEH.js} +15 -15
- package/dist/{serve-A764QS5U.js → serve-N2TUTZGD.js} +3 -3
- package/dist/session-QZAXEQRE.js +12 -0
- package/dist/setup-2KMWTHDZ.js +24 -0
- package/dist/{statsCli-FKGON32O.js → statsCli-FR7GOKWO.js} +1 -1
- package/dist/{transferCli-BQXPUFPH.js → transferCli-ZY7WIIPY.js} +4 -4
- package/dist/ui/thinkingMouse.d.ts +2 -0
- package/dist/{ui-S6OQOIFO.js → ui-A7DY4X4E.js} +190 -72
- package/dist/{update-SYDSYLR6.js → update-36PG64GC.js} +2 -2
- package/package.json +1 -1
- package/dist/providerCli-IRJTX5JF.js +0 -15
- package/dist/session-NPKTEDKV.js +0 -12
- package/dist/setup-KYDIUOOG.js +0 -24
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CATALOG,
|
|
4
4
|
fillTemplate
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HR7T3BY2.js";
|
|
6
6
|
import {
|
|
7
7
|
MAX_VERIFY_ROUNDS,
|
|
8
8
|
runVerify,
|
|
9
9
|
toolLabel,
|
|
10
10
|
verifyFollowup,
|
|
11
11
|
worktreeListText
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SE6SM2EI.js";
|
|
13
13
|
import {
|
|
14
14
|
BUILTIN_AGENTS,
|
|
15
15
|
appendMemory,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
runCommand,
|
|
25
25
|
runHooks,
|
|
26
26
|
validateGlobPattern
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CSIQDFEF.js";
|
|
28
28
|
import "./chunk-PSO7R5AD.js";
|
|
29
29
|
import {
|
|
30
30
|
nextMode,
|
|
@@ -34,39 +34,39 @@ import {
|
|
|
34
34
|
hasKey,
|
|
35
35
|
providerName,
|
|
36
36
|
writeGlobalConfig
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-34Z6BXTO.js";
|
|
38
38
|
import {
|
|
39
39
|
Session
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-Y57FCAGM.js";
|
|
41
41
|
import {
|
|
42
42
|
contentText
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-L5FKXSFK.js";
|
|
44
44
|
import {
|
|
45
45
|
REASONING_LEVELS,
|
|
46
46
|
assertReasoningSupported,
|
|
47
47
|
parseReasoningLevel,
|
|
48
48
|
supportedReasoningLevels
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-EAR2C6TS.js";
|
|
50
50
|
import {
|
|
51
51
|
addGlobalServer,
|
|
52
52
|
globalMcpPath,
|
|
53
53
|
readMcpFile,
|
|
54
54
|
removeGlobalServer
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-54PFT7F5.js";
|
|
56
56
|
import {
|
|
57
57
|
ACCENT,
|
|
58
58
|
PRESETS,
|
|
59
59
|
color,
|
|
60
60
|
matchKeybind,
|
|
61
61
|
removeCredential
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-T5Z3FCT2.js";
|
|
63
63
|
import {
|
|
64
64
|
getLanguage,
|
|
65
65
|
locale,
|
|
66
66
|
parseLang,
|
|
67
67
|
setLanguage,
|
|
68
68
|
t
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-XCVYR5BK.js";
|
|
70
70
|
|
|
71
71
|
// src/ui/index.tsx
|
|
72
72
|
import { render } from "ink";
|
|
@@ -82,6 +82,7 @@ import { useCallback, useEffect as useEffect3, useRef as useRef2, useState as us
|
|
|
82
82
|
// src/commands.ts
|
|
83
83
|
var SLASH_COMMANDS = [
|
|
84
84
|
{ name: "help", description: "list of commands and shortcuts" },
|
|
85
|
+
{ name: "thinking", description: "show/hide the model\u2019s thinking" },
|
|
85
86
|
{ name: "model", description: "change model" },
|
|
86
87
|
{ name: "reasoning", description: "set reasoning: auto/off/low/medium/high/max" },
|
|
87
88
|
{ name: "provider", description: "add/choose an AI provider" },
|
|
@@ -841,7 +842,7 @@ function clickedThinking(click, cursorRow, rootHeight, target) {
|
|
|
841
842
|
const origin = cursorRow - rootHeight + 1;
|
|
842
843
|
const row = origin + target.y;
|
|
843
844
|
const col = target.x + 1;
|
|
844
|
-
return (click.y === row || click.y === row - 1) && click.x >= col && click.x < col + Math.min(target.width,
|
|
845
|
+
return (click.y === row || click.y === row - 1) && click.x >= col && click.x < col + Math.min(target.width, 72);
|
|
845
846
|
}
|
|
846
847
|
function parseMouseWheel(input) {
|
|
847
848
|
const match = /^\[<?(\d+);\d+;\d+[mM]$/.exec(input);
|
|
@@ -853,6 +854,9 @@ function parseMouseWheel(input) {
|
|
|
853
854
|
if (dir === 1) return "down";
|
|
854
855
|
return void 0;
|
|
855
856
|
}
|
|
857
|
+
function hasMouseWheelSequence(chunk) {
|
|
858
|
+
return chunk.includes("\x1B[") && /\[<?6[4567];\d+;\d+[mM]/.test(chunk);
|
|
859
|
+
}
|
|
856
860
|
function isMouseControlInput(input) {
|
|
857
861
|
return /^\[<[\d;]*[mM]?$/.test(input) || /^\[(?:\d+;){2}\d+[mM]$/.test(input) || /^\[(?:\d+;)+\d*R?$/.test(input) || /^\[M[\s\S]{0,3}$/.test(input) || input.includes("\x1B[<");
|
|
858
862
|
}
|
|
@@ -1853,17 +1857,44 @@ function App({ runtime, initialPrompt, version, updateMessage }) {
|
|
|
1853
1857
|
const [showToolOutput, setShowToolOutput] = useState10(false);
|
|
1854
1858
|
const [staticKey, setStaticKey] = useState10(0);
|
|
1855
1859
|
const [, setConfigRev] = useState10(0);
|
|
1856
|
-
const
|
|
1860
|
+
const lastUserIdx = transcript.done.findLastIndex((e) => e.kind === "user");
|
|
1857
1861
|
const { stdin } = useStdin();
|
|
1858
1862
|
const { stdout } = useStdout2();
|
|
1863
|
+
const isRealTty = Boolean(stdout?.isTTY && "fd" in stdout);
|
|
1864
|
+
const maxLiveLines = Math.max(8, (stdout?.rows ?? 24) - 10);
|
|
1865
|
+
const maxSplitIdxRef = useRef2(0);
|
|
1859
1866
|
const refreshStatic = useCallback(() => {
|
|
1860
1867
|
if (stdout?.isTTY && "fd" in stdout) {
|
|
1861
1868
|
stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
1862
1869
|
}
|
|
1870
|
+
maxSplitIdxRef.current = 0;
|
|
1863
1871
|
setStaticKey((k2) => k2 + 1);
|
|
1864
1872
|
}, [stdout]);
|
|
1873
|
+
let splitIdx = Math.max(maxSplitIdxRef.current, lastUserIdx > 0 ? lastUserIdx : 0);
|
|
1874
|
+
if (isRealTty) {
|
|
1875
|
+
const entryLines = (e) => {
|
|
1876
|
+
if (e.kind === "thinking") return showThinking ? Math.min(maxLiveLines, e.text.split("\n").length + 2) : 2;
|
|
1877
|
+
if (e.kind === "tool") return showToolOutput ? Math.min(maxLiveLines, (e.output ?? e.display ?? "").split("\n").length + 2) : 5;
|
|
1878
|
+
if (e.kind === "assistant" || e.kind === "notice" || e.kind === "user") return e.text.split("\n").length + 1;
|
|
1879
|
+
return 2;
|
|
1880
|
+
};
|
|
1881
|
+
const liveLines = transcript.live.reduce((acc, e) => acc + entryLines(e), 0);
|
|
1882
|
+
let doneLines = transcript.done.slice(splitIdx).reduce((acc, e) => acc + entryLines(e), 0);
|
|
1883
|
+
while (splitIdx < transcript.done.length - 1 && doneLines + liveLines > maxLiveLines) {
|
|
1884
|
+
doneLines -= entryLines(transcript.done[splitIdx]);
|
|
1885
|
+
splitIdx++;
|
|
1886
|
+
}
|
|
1887
|
+
maxSplitIdxRef.current = splitIdx;
|
|
1888
|
+
}
|
|
1889
|
+
const staticDone = transcript.done.slice(0, splitIdx);
|
|
1890
|
+
const activeTurnDone = transcript.done.slice(splitIdx);
|
|
1891
|
+
const activeTurnEntries = [...activeTurnDone, ...transcript.live];
|
|
1892
|
+
const lastThinkingEntryId = activeTurnEntries.findLast((e) => e.kind === "thinking" && !!e.text.trim())?.id;
|
|
1893
|
+
const hasThinking = lastThinkingEntryId !== void 0 || transcript.done.some((e) => e.kind === "thinking" && !!e.text.trim());
|
|
1865
1894
|
const liveRootRef = useRef2(null);
|
|
1866
1895
|
const thinkingTargetRef = useRef2(null);
|
|
1896
|
+
const spinnerTargetRef = useRef2(null);
|
|
1897
|
+
const thinkingEntryRefs = useRef2(/* @__PURE__ */ new Map());
|
|
1867
1898
|
const [injected, setInjected] = useState10();
|
|
1868
1899
|
useEffect3(() => runtime.todos.subscribe(setTodos), [runtime]);
|
|
1869
1900
|
const extraCommands = [
|
|
@@ -1946,16 +1977,50 @@ function App({ runtime, initialPrompt, version, updateMessage }) {
|
|
|
1946
1977
|
},
|
|
1947
1978
|
[runtime, notice]
|
|
1948
1979
|
);
|
|
1980
|
+
const toggleThinking = useCallback(() => {
|
|
1981
|
+
const next = !showThinkingRef.current;
|
|
1982
|
+
showThinkingRef.current = next;
|
|
1983
|
+
setShowThinking(next);
|
|
1984
|
+
if (maxSplitIdxRef.current > 0) refreshStatic();
|
|
1985
|
+
try {
|
|
1986
|
+
writeGlobalConfig({ thinkingVisible: next }, runtime.env);
|
|
1987
|
+
} catch (error) {
|
|
1988
|
+
notice(t("Could not save thinking visibility: {error}", { error: error.message }), "warn");
|
|
1989
|
+
}
|
|
1990
|
+
}, [runtime, notice, refreshStatic]);
|
|
1949
1991
|
const runSlashCommand = useCallback(
|
|
1950
1992
|
async (name, args) => {
|
|
1951
1993
|
switch (name) {
|
|
1952
1994
|
case "help":
|
|
1953
1995
|
notice(helpText(runtime));
|
|
1954
1996
|
return;
|
|
1997
|
+
case "thinking":
|
|
1998
|
+
case "t": {
|
|
1999
|
+
const v = args.trim().toLowerCase();
|
|
2000
|
+
if (v === "on" || v === "true") {
|
|
2001
|
+
if (!showThinkingRef.current) toggleThinking();
|
|
2002
|
+
} else if (v === "off" || v === "false") {
|
|
2003
|
+
if (showThinkingRef.current) toggleThinking();
|
|
2004
|
+
} else {
|
|
2005
|
+
toggleThinking();
|
|
2006
|
+
}
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
case "output":
|
|
2010
|
+
case "o":
|
|
2011
|
+
setShowToolOutput((prev) => !prev);
|
|
2012
|
+
if (maxSplitIdxRef.current > 0) refreshStatic();
|
|
2013
|
+
return;
|
|
1955
2014
|
case "exit":
|
|
2015
|
+
case "quit":
|
|
1956
2016
|
exit();
|
|
1957
2017
|
return;
|
|
1958
2018
|
case "clear":
|
|
2019
|
+
controller.current?.abort();
|
|
2020
|
+
controller.current = null;
|
|
2021
|
+
setQueued([]);
|
|
2022
|
+
setBusy(false);
|
|
2023
|
+
setCancelling(false);
|
|
1959
2024
|
runtime.agent.clear();
|
|
1960
2025
|
setTokens(0);
|
|
1961
2026
|
setShowToolOutput(false);
|
|
@@ -2053,6 +2118,11 @@ function App({ runtime, initialPrompt, version, updateMessage }) {
|
|
|
2053
2118
|
return;
|
|
2054
2119
|
}
|
|
2055
2120
|
case "new":
|
|
2121
|
+
controller.current?.abort();
|
|
2122
|
+
controller.current = null;
|
|
2123
|
+
setQueued([]);
|
|
2124
|
+
setBusy(false);
|
|
2125
|
+
setCancelling(false);
|
|
2056
2126
|
runtime.newSession();
|
|
2057
2127
|
setTokens(0);
|
|
2058
2128
|
setShowToolOutput(false);
|
|
@@ -2403,7 +2473,7 @@ function App({ runtime, initialPrompt, version, updateMessage }) {
|
|
|
2403
2473
|
notice(t("Unknown command: /{name}. Type /help.", { name }), "warn");
|
|
2404
2474
|
}
|
|
2405
2475
|
},
|
|
2406
|
-
[runtime, notice, exit, version, runTurn, ask, refreshStatic]
|
|
2476
|
+
[runtime, notice, exit, version, runTurn, ask, refreshStatic, toggleThinking]
|
|
2407
2477
|
);
|
|
2408
2478
|
const runSlash = useCallback(
|
|
2409
2479
|
(name, args) => runSlashCommand(name, args).catch((error) => notice(`/${name}: ${error.message}`, "error")),
|
|
@@ -2447,7 +2517,7 @@ ${out}` };
|
|
|
2447
2517
|
}
|
|
2448
2518
|
const command = runtime.commands.find((c) => c.name.toLowerCase() === slash.name);
|
|
2449
2519
|
const skill = runtime.skills.find((s) => s.name.toLowerCase() === slash.name);
|
|
2450
|
-
if (SLASH_COMMANDS.some((b) => b.name === slash.name) || !command && !skill) void runSlash(slash.name, slash.args);
|
|
2520
|
+
if (SLASH_COMMANDS.some((b) => b.name === slash.name) || slash.name === "t" || slash.name === "output" || slash.name === "o" || slash.name === "quit" || !command && !skill) void runSlash(slash.name, slash.args);
|
|
2451
2521
|
else if (command) void runTurn(expandCommand(command, slash.args));
|
|
2452
2522
|
else if (skill) {
|
|
2453
2523
|
let body;
|
|
@@ -2466,10 +2536,26 @@ ARGUMENTS: ${slash.args}`);
|
|
|
2466
2536
|
);
|
|
2467
2537
|
const onPrompt = useCallback(
|
|
2468
2538
|
(text) => {
|
|
2469
|
-
if (busy)
|
|
2470
|
-
|
|
2539
|
+
if (!busy) {
|
|
2540
|
+
submit(text);
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
if (text.startsWith("#") && text.slice(1).trim()) {
|
|
2544
|
+
submit(text);
|
|
2545
|
+
return;
|
|
2546
|
+
}
|
|
2547
|
+
const slash = parseSlash(text);
|
|
2548
|
+
if (slash) {
|
|
2549
|
+
const turnMutating = /* @__PURE__ */ new Set(["init", "pr", "compact", "rewind", "undo", "redo", "resume"]);
|
|
2550
|
+
const isCustomTurn = !SLASH_COMMANDS.some((b) => b.name === slash.name) && slash.name !== "t" && slash.name !== "output" && slash.name !== "o" && slash.name !== "quit" && (runtime.commands.some((c) => c.name.toLowerCase() === slash.name) || runtime.skills.some((s) => s.name.toLowerCase() === slash.name));
|
|
2551
|
+
if (!turnMutating.has(slash.name) && !isCustomTurn) {
|
|
2552
|
+
submit(text);
|
|
2553
|
+
return;
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
setQueued((q) => [...q, text]);
|
|
2471
2557
|
},
|
|
2472
|
-
[busy, submit]
|
|
2558
|
+
[busy, submit, runtime]
|
|
2473
2559
|
);
|
|
2474
2560
|
useEffect3(() => {
|
|
2475
2561
|
if (busy || pending || planAsk || !queued.length) return;
|
|
@@ -2484,17 +2570,6 @@ ARGUMENTS: ${slash.args}`);
|
|
|
2484
2570
|
submit(initialPrompt);
|
|
2485
2571
|
}
|
|
2486
2572
|
}, [initialPrompt, submit]);
|
|
2487
|
-
const toggleThinking = useCallback(() => {
|
|
2488
|
-
const next = !showThinkingRef.current;
|
|
2489
|
-
showThinkingRef.current = next;
|
|
2490
|
-
setShowThinking(next);
|
|
2491
|
-
refreshStatic();
|
|
2492
|
-
try {
|
|
2493
|
-
writeGlobalConfig({ thinkingVisible: next }, runtime.env);
|
|
2494
|
-
} catch (error) {
|
|
2495
|
-
notice(t("Could not save thinking visibility: {error}", { error: error.message }), "warn");
|
|
2496
|
-
}
|
|
2497
|
-
}, [runtime, notice, refreshStatic]);
|
|
2498
2573
|
useEffect3(() => {
|
|
2499
2574
|
if (!stdout?.isTTY || !("fd" in stdout)) return;
|
|
2500
2575
|
stdout.write("\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l\x1B[?2004h");
|
|
@@ -2512,39 +2587,57 @@ ARGUMENTS: ${slash.args}`);
|
|
|
2512
2587
|
}, [scrollableModalOpen, stdout]);
|
|
2513
2588
|
useEffect3(() => {
|
|
2514
2589
|
const modalOpen = !!(pending || planAsk || picker || listPicker || mcpMenu || providerMenu || prompt);
|
|
2515
|
-
if (!runtime.config.thinkingClickCollapse || !busy || modalOpen || !stdin.isTTY || !stdout.isTTY
|
|
2590
|
+
if (!runtime.config.thinkingClickCollapse || !busy && !hasThinking || modalOpen || !stdin.isTTY || !stdout.isTTY) return;
|
|
2516
2591
|
let click;
|
|
2517
2592
|
let mouseBuffer = "";
|
|
2593
|
+
let wheelTimer;
|
|
2518
2594
|
const onData = (data) => {
|
|
2519
|
-
|
|
2595
|
+
const chunk = String(data);
|
|
2596
|
+
if (hasMouseWheelSequence(chunk)) {
|
|
2597
|
+
stdout.write("\x1B[?1000l\x1B[?1006l");
|
|
2598
|
+
if (wheelTimer) clearTimeout(wheelTimer);
|
|
2599
|
+
wheelTimer = setTimeout(() => {
|
|
2600
|
+
stdout.write("\x1B[?1000h\x1B[?1006h");
|
|
2601
|
+
}, 1200);
|
|
2602
|
+
}
|
|
2603
|
+
mouseBuffer += chunk;
|
|
2520
2604
|
const reports = parseThinkingReports(mouseBuffer);
|
|
2521
2605
|
mouseBuffer = reports.rest.slice(-80);
|
|
2522
2606
|
for (const report of reports.events) {
|
|
2523
2607
|
if (report.type === "mouse") {
|
|
2524
2608
|
click = report.press;
|
|
2525
2609
|
stdout.write("\x1B[6n");
|
|
2526
|
-
} else if (click && liveRootRef.current
|
|
2610
|
+
} else if (click && liveRootRef.current) {
|
|
2527
2611
|
const current = click;
|
|
2528
2612
|
click = void 0;
|
|
2529
2613
|
const root = measureElement(liveRootRef.current);
|
|
2530
|
-
const
|
|
2531
|
-
if (
|
|
2614
|
+
const candidates = [];
|
|
2615
|
+
if (thinkingTargetRef.current) candidates.push(thinkingTargetRef.current);
|
|
2616
|
+
if (spinnerTargetRef.current) candidates.push(spinnerTargetRef.current);
|
|
2617
|
+
for (const el of thinkingEntryRefs.current.values()) {
|
|
2618
|
+
if (!candidates.includes(el)) candidates.push(el);
|
|
2619
|
+
}
|
|
2620
|
+
if (candidates.some((el) => clickedThinking(current, report.cursor.row, root.height, measureElement(el)))) {
|
|
2621
|
+
toggleThinking();
|
|
2622
|
+
}
|
|
2532
2623
|
}
|
|
2533
2624
|
}
|
|
2534
2625
|
};
|
|
2535
2626
|
stdin.on("data", onData);
|
|
2536
2627
|
stdout.write("\x1B[?1000h\x1B[?1006h");
|
|
2537
2628
|
return () => {
|
|
2629
|
+
if (wheelTimer) clearTimeout(wheelTimer);
|
|
2538
2630
|
stdin.off("data", onData);
|
|
2539
2631
|
stdout.write("\x1B[?1000l\x1B[?1006l");
|
|
2540
2632
|
};
|
|
2541
|
-
}, [busy, pending, planAsk, picker, listPicker, mcpMenu, providerMenu, prompt, stdin, stdout, toggleThinking, runtime.config.thinkingClickCollapse]);
|
|
2633
|
+
}, [busy, hasThinking, pending, planAsk, picker, listPicker, mcpMenu, providerMenu, prompt, stdin, stdout, toggleThinking, runtime.config.thinkingClickCollapse]);
|
|
2542
2634
|
useInput9((input, key) => {
|
|
2635
|
+
const modalOpen = !!(pending || planAsk || picker || listPicker || mcpMenu || providerMenu || prompt);
|
|
2543
2636
|
if (key.tab && key.shift) {
|
|
2544
2637
|
const next = nextMode(runtime.agent.permissions.mode);
|
|
2545
2638
|
runtime.agent.permissions.mode = next;
|
|
2546
2639
|
setMode(next);
|
|
2547
|
-
} else if (key.escape && busy && !
|
|
2640
|
+
} else if (key.escape && busy && !modalOpen) {
|
|
2548
2641
|
controller.current?.abort();
|
|
2549
2642
|
setCancelling(true);
|
|
2550
2643
|
if (queued.length) {
|
|
@@ -2561,11 +2654,11 @@ ARGUMENTS: ${slash.args}`);
|
|
|
2561
2654
|
notice(t("No image on the clipboard."), "warn");
|
|
2562
2655
|
}
|
|
2563
2656
|
})();
|
|
2564
|
-
} else if (matchKeybind(runtime.config.keybinds.thinking, input, key)) {
|
|
2657
|
+
} else if (matchKeybind(runtime.config.keybinds.thinking, input, key) || key.meta && !key.ctrl && input.toLowerCase() === "t") {
|
|
2565
2658
|
toggleThinking();
|
|
2566
2659
|
} else if (matchKeybind(runtime.config.keybinds.toolOutput, input, key)) {
|
|
2567
2660
|
setShowToolOutput((prev) => !prev);
|
|
2568
|
-
refreshStatic();
|
|
2661
|
+
if (maxSplitIdxRef.current > 0) refreshStatic();
|
|
2569
2662
|
} else if (key.ctrl && input.toLowerCase() === "l") {
|
|
2570
2663
|
refreshStatic();
|
|
2571
2664
|
}
|
|
@@ -2632,8 +2725,6 @@ ARGUMENTS: ${slash.args}`);
|
|
|
2632
2725
|
pending?.resolve(a);
|
|
2633
2726
|
setAsks((q) => q.slice(1));
|
|
2634
2727
|
};
|
|
2635
|
-
const isRealTty = Boolean(stdout?.isTTY && "fd" in stdout);
|
|
2636
|
-
const maxLiveLines = Math.max(8, (stdout?.rows ?? 24) - 10);
|
|
2637
2728
|
const capLiveMarkdown = (raw) => {
|
|
2638
2729
|
if (!isRealTty) return raw;
|
|
2639
2730
|
const lines = raw.split("\n");
|
|
@@ -2676,21 +2767,35 @@ ARGUMENTS: ${slash.args}`);
|
|
|
2676
2767
|
const lines = allLines.length;
|
|
2677
2768
|
const shownText = isLive && isRealTty && allLines.length > maxLiveLines ? `\u2026 (${allLines.length - maxLiveLines} lines above) \u2026
|
|
2678
2769
|
${allLines.slice(-maxLiveLines).join("\n")}` : text;
|
|
2679
|
-
const isTarget = e.id ===
|
|
2680
|
-
return /* @__PURE__ */ jsxs12(
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2770
|
+
const isTarget = e.id === lastThinkingEntryId;
|
|
2771
|
+
return /* @__PURE__ */ jsxs12(
|
|
2772
|
+
Box13,
|
|
2773
|
+
{
|
|
2774
|
+
ref: (el) => {
|
|
2775
|
+
if (isTarget) thinkingTargetRef.current = el;
|
|
2776
|
+
if (el) thinkingEntryRefs.current.set(e.id, el);
|
|
2777
|
+
else thinkingEntryRefs.current.delete(e.id);
|
|
2778
|
+
},
|
|
2779
|
+
marginTop: 1,
|
|
2780
|
+
flexDirection: "column",
|
|
2781
|
+
children: [
|
|
2782
|
+
/* @__PURE__ */ jsxs12(Box13, { flexDirection: "row", children: [
|
|
2783
|
+
/* @__PURE__ */ jsx16(Text16, { dimColor: true, children: showThinking ? t("\u273B Thinking") : t("\u273B Thinking \xB7 {n} lines", { n: lines }) }),
|
|
2784
|
+
/* @__PURE__ */ jsxs12(Text16, { dimColor: true, children: [
|
|
2785
|
+
" \xB7 ",
|
|
2786
|
+
runtime.config.keybinds.thinking.spec,
|
|
2787
|
+
" / alt+t",
|
|
2788
|
+
runtime.config.thinkingClickCollapse ? ` \xB7 ${t("click to toggle")}` : ""
|
|
2789
|
+
] })
|
|
2790
|
+
] }),
|
|
2791
|
+
showThinking ? /* @__PURE__ */ jsxs12(Box13, { flexDirection: "column", paddingLeft: 2, children: [
|
|
2792
|
+
/* @__PURE__ */ jsx16(Text16, { dimColor: true, children: t("Model: {model} \xB7 reasoning: {level}", { model: runtime.modelRef, level: reasoning }) }),
|
|
2793
|
+
/* @__PURE__ */ jsx16(Text16, { dimColor: true, italic: true, children: shownText })
|
|
2794
|
+
] }) : null
|
|
2795
|
+
]
|
|
2796
|
+
},
|
|
2797
|
+
e.id
|
|
2798
|
+
);
|
|
2694
2799
|
}
|
|
2695
2800
|
case "tool":
|
|
2696
2801
|
return /* @__PURE__ */ jsx16(ToolBlock, { tool: e.tool, target: e.target, output: e.output, display: e.display, isError: e.isError, done: e.done, expanded: showToolOutput, sub: e.sub, moreBind: runtime.config.keybinds.toolOutput.spec }, e.id);
|
|
@@ -2704,23 +2809,36 @@ ${allLines.slice(-maxLiveLines).join("\n")}` : text;
|
|
|
2704
2809
|
const activeSpinnerSummary = activeToolEntry ? `${toolLabel(activeToolEntry.tool)}${activeTarget ? ` ${activeTarget.length > 20 ? `${activeTarget.slice(0, 20)}\u2026` : activeTarget}` : ""}` : "";
|
|
2705
2810
|
const activeToolSummary = activeToolEntry ? `${toolLabel(activeToolEntry.tool)}${activeTarget ? ` ${activeTarget.length > 68 ? `${activeTarget.slice(0, 68)}\u2026` : activeTarget}` : ""}` : "";
|
|
2706
2811
|
return /* @__PURE__ */ jsxs12(Box13, { ref: liveRootRef, flexDirection: "column", children: [
|
|
2707
|
-
/* @__PURE__ */ jsx16(Static, { items:
|
|
2812
|
+
/* @__PURE__ */ jsx16(Static, { items: staticDone, children: renderEntry }, staticKey),
|
|
2813
|
+
activeTurnDone.map(renderEntry),
|
|
2708
2814
|
transcript.live.map(renderEntry),
|
|
2709
|
-
busy && !pending && !planAsk ? /* @__PURE__ */ jsxs12(
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2815
|
+
busy && !pending && !planAsk ? /* @__PURE__ */ jsxs12(
|
|
2816
|
+
Box13,
|
|
2817
|
+
{
|
|
2818
|
+
ref: (el) => {
|
|
2819
|
+
spinnerTargetRef.current = el;
|
|
2820
|
+
if (lastThinkingEntryId === void 0) thinkingTargetRef.current = el;
|
|
2821
|
+
},
|
|
2822
|
+
marginTop: 1,
|
|
2823
|
+
flexDirection: "column",
|
|
2824
|
+
children: [
|
|
2825
|
+
/* @__PURE__ */ jsxs12(Box13, { flexDirection: "row", children: [
|
|
2826
|
+
/* @__PURE__ */ jsx16(Spinner, { label: cancelling ? t("Cancelling") : activeSpinnerSummary ? `${t("Thinking")} \xB7 ${activeSpinnerSummary}` : t("Thinking"), startedAt }),
|
|
2827
|
+
/* @__PURE__ */ jsxs12(Text16, { dimColor: true, children: [
|
|
2828
|
+
" \xB7 ",
|
|
2829
|
+
runtime.config.keybinds.thinking.spec,
|
|
2830
|
+
" / alt+t",
|
|
2831
|
+
runtime.config.thinkingClickCollapse ? ` \xB7 ${t("click to toggle")}` : ""
|
|
2832
|
+
] })
|
|
2833
|
+
] }),
|
|
2834
|
+
showThinking && lastThinkingEntryId === void 0 ? /* @__PURE__ */ jsxs12(Box13, { flexDirection: "column", paddingLeft: 2, children: [
|
|
2835
|
+
/* @__PURE__ */ jsx16(Text16, { dimColor: true, children: t("Model: {model} \xB7 reasoning: {level}", { model: runtime.modelRef, level: reasoning }) }),
|
|
2836
|
+
activeToolSummary ? /* @__PURE__ */ jsx16(Text16, { dimColor: true, children: `\u25B6 ${activeToolSummary}` }) : null,
|
|
2837
|
+
!activeToolSummary ? /* @__PURE__ */ jsx16(Text16, { dimColor: true, children: t("No reasoning summary received yet; tool activity remains visible above.") }) : null
|
|
2838
|
+
] }) : null
|
|
2839
|
+
]
|
|
2840
|
+
}
|
|
2841
|
+
) : null,
|
|
2724
2842
|
pending ? /* @__PURE__ */ jsx16(PermissionPrompt, { request: pending.request, onAnswer: answer }, pending.id) : null,
|
|
2725
2843
|
picker ? /* @__PURE__ */ jsx16(
|
|
2726
2844
|
ModelPicker,
|
|
@@ -2773,7 +2891,7 @@ ${allLines.slice(-maxLiveLines).join("\n")}` : text;
|
|
|
2773
2891
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2774
2892
|
async function startInteractive(rt, opts) {
|
|
2775
2893
|
if (opts.resume) {
|
|
2776
|
-
const { Session: Session2 } = await import("./session-
|
|
2894
|
+
const { Session: Session2 } = await import("./session-QZAXEQRE.js");
|
|
2777
2895
|
const list = Session2.list(rt.home, rt.cwd).slice(0, 20);
|
|
2778
2896
|
if (!list.length) console.log(t("No sessions in this folder yet; starting a new one."));
|
|
2779
2897
|
else {
|
|
@@ -2789,7 +2907,7 @@ async function startInteractive(rt, opts) {
|
|
|
2789
2907
|
if (chosen) rt.resume(chosen.session);
|
|
2790
2908
|
}
|
|
2791
2909
|
}
|
|
2792
|
-
const { serversToStart, setProjectTrust } = await import("./config-
|
|
2910
|
+
const { serversToStart, setProjectTrust } = await import("./config-PVEZPRMH.js");
|
|
2793
2911
|
const plan = serversToStart(rt.home, rt.cwd);
|
|
2794
2912
|
if (plan.needTrust.length) {
|
|
2795
2913
|
const { createInterface } = await import("readline/promises");
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
addProviderKey,
|
|
4
|
-
runProviderCommand
|
|
5
|
-
} from "./chunk-QZKB6VTU.js";
|
|
6
|
-
import "./chunk-2Y6TH4MA.js";
|
|
7
|
-
import "./chunk-27REMLDV.js";
|
|
8
|
-
import "./chunk-BBZLRWPR.js";
|
|
9
|
-
import "./chunk-XSUFHD67.js";
|
|
10
|
-
import "./chunk-AK6TWKET.js";
|
|
11
|
-
import "./chunk-EOOWV6C6.js";
|
|
12
|
-
export {
|
|
13
|
-
addProviderKey,
|
|
14
|
-
runProviderCommand
|
|
15
|
-
};
|
package/dist/session-NPKTEDKV.js
DELETED
package/dist/setup-KYDIUOOG.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
createRuntime,
|
|
4
|
-
lunaPtcAutoEnabled
|
|
5
|
-
} from "./chunk-AN7SNPFA.js";
|
|
6
|
-
import "./chunk-OK2USAXX.js";
|
|
7
|
-
import "./chunk-NSARPM5C.js";
|
|
8
|
-
import "./chunk-O5ATYRUP.js";
|
|
9
|
-
import "./chunk-PSO7R5AD.js";
|
|
10
|
-
import "./chunk-WFZKJY3R.js";
|
|
11
|
-
import "./chunk-QZKB6VTU.js";
|
|
12
|
-
import "./chunk-2Y6TH4MA.js";
|
|
13
|
-
import "./chunk-27REMLDV.js";
|
|
14
|
-
import "./chunk-6EGQI6HJ.js";
|
|
15
|
-
import "./chunk-BL2KOEXJ.js";
|
|
16
|
-
import "./chunk-BBZLRWPR.js";
|
|
17
|
-
import "./chunk-XSUFHD67.js";
|
|
18
|
-
import "./chunk-WTCWBY2D.js";
|
|
19
|
-
import "./chunk-AK6TWKET.js";
|
|
20
|
-
import "./chunk-EOOWV6C6.js";
|
|
21
|
-
export {
|
|
22
|
-
createRuntime,
|
|
23
|
-
lunaPtcAutoEnabled
|
|
24
|
-
};
|