deepcode-ai 1.2.12 → 1.2.13
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/index.js +1062 -437
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7861,10 +7861,10 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
7861
7861
|
import fs2 from "fs";
|
|
7862
7862
|
import os4 from "os";
|
|
7863
7863
|
import path62 from "path";
|
|
7864
|
-
import
|
|
7865
|
-
import
|
|
7864
|
+
import fs9 from "fs";
|
|
7865
|
+
import path16 from "path";
|
|
7866
7866
|
import { isValidElement, useCallback as useCallback27, useEffect as useEffect28, useMemo as useMemo19, useRef as useRef18, useState as useState30 } from "react";
|
|
7867
|
-
import { Box as
|
|
7867
|
+
import { Box as Box47, Text as Text55, useInput as useInput6, useStdin as useStdin3 } from "ink";
|
|
7868
7868
|
import os22 from "os";
|
|
7869
7869
|
import path92 from "path";
|
|
7870
7870
|
import fs22 from "fs";
|
|
@@ -8837,8 +8837,8 @@ import * as path82 from "path";
|
|
|
8837
8837
|
import { promisify } from "util";
|
|
8838
8838
|
import { useState as useState3, useRef, useCallback as useCallback3, useMemo as useMemo2 } from "react";
|
|
8839
8839
|
import { useCallback as useCallback8, useEffect as useEffect14, useMemo as useMemo6, useRef as useRef6, useState as useState12 } from "react";
|
|
8840
|
-
import { Box as
|
|
8841
|
-
import { Box as
|
|
8840
|
+
import { Box as Box26, Static } from "ink";
|
|
8841
|
+
import { Box as Box25, Text as Text28 } from "ink";
|
|
8842
8842
|
import { Box as Box8, Text as Text9 } from "ink";
|
|
8843
8843
|
|
|
8844
8844
|
// ../../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
@@ -9781,23 +9781,31 @@ import { Box as Box20, Text as Text23 } from "ink";
|
|
|
9781
9781
|
import { Fragment as Fragment6, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
9782
9782
|
import React21, { useContext as useContext5 } from "react";
|
|
9783
9783
|
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
9784
|
+
import { Box as Box22, Text as Text25 } from "ink";
|
|
9784
9785
|
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
9785
|
-
import {
|
|
9786
|
+
import { Box as Box23, Text as Text26 } from "ink";
|
|
9786
9787
|
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9787
|
-
import { Box as
|
|
9788
|
+
import { Box as Box24, Text as Text27 } from "ink";
|
|
9789
|
+
import { Fragment as Fragment7, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9790
|
+
import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9791
|
+
import { createContext as createContext5, useContext as useContext6 } from "react";
|
|
9792
|
+
import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9793
|
+
import { Box as Box27, Text as Text29 } from "ink";
|
|
9794
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
9795
|
+
import { Box as Box35, Text as Text43, useIsScreenReaderEnabled as useIsScreenReaderEnabled3 } from "ink";
|
|
9788
9796
|
import { useCallback as useCallback19, useState as useState24 } from "react";
|
|
9789
9797
|
import { useRef as useRef8 } from "react";
|
|
9790
|
-
import { Box as
|
|
9798
|
+
import { Box as Box28, Text as Text30 } from "ink";
|
|
9791
9799
|
import { useEffect as useEffect15, useState as useState13 } from "react";
|
|
9792
9800
|
import { useEffect as useEffect16, useRef as useRef7, useState as useState14 } from "react";
|
|
9793
|
-
import { jsx as
|
|
9801
|
+
import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9794
9802
|
import { useCallback as useCallback17, useEffect as useEffect23, useMemo as useMemo11, useState as useState21, useRef as useRef13 } from "react";
|
|
9795
|
-
import { Box as
|
|
9796
|
-
import { Box as
|
|
9803
|
+
import { Box as Box31, Text as Text34 } from "ink";
|
|
9804
|
+
import { Box as Box29, Text as Text32 } from "ink";
|
|
9797
9805
|
import React25 from "react";
|
|
9798
|
-
import { Text as
|
|
9799
|
-
import { jsx as
|
|
9800
|
-
import { jsx as
|
|
9806
|
+
import { Text as Text31 } from "ink";
|
|
9807
|
+
import { jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
9808
|
+
import { jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9801
9809
|
import { useState as useState15, useCallback as useCallback9 } from "react";
|
|
9802
9810
|
import chalk3 from "chalk";
|
|
9803
9811
|
import { useState as useState16, useEffect as useEffect17, useCallback as useCallback10 } from "react";
|
|
@@ -9814,21 +9822,21 @@ import * as path132 from "path";
|
|
|
9814
9822
|
import { createContext as createContext6, useContext as useContext7 } from "react";
|
|
9815
9823
|
import { createContext as createContext7, useContext as useContext8 } from "react";
|
|
9816
9824
|
import { useCallback as useCallback16 } from "react";
|
|
9817
|
-
import { Box as
|
|
9825
|
+
import { Box as Box30, Text as Text33 } from "ink";
|
|
9818
9826
|
import chalk2 from "chalk";
|
|
9819
|
-
import { jsx as
|
|
9820
|
-
import { Fragment as
|
|
9821
|
-
import { Box as
|
|
9822
|
-
import { Text as Text31 } from "ink";
|
|
9823
|
-
import { Fragment as Fragment8, jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9824
|
-
import { Text as Text32 } from "ink";
|
|
9825
|
-
import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9826
|
-
import { Text as Text33 } from "ink";
|
|
9827
|
-
import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9828
|
-
import { Text as Text34 } from "ink";
|
|
9829
|
-
import { jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9827
|
+
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9828
|
+
import { Fragment as Fragment8, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9829
|
+
import { Box as Box32, Text as Text40 } from "ink";
|
|
9830
9830
|
import { Text as Text35 } from "ink";
|
|
9831
|
-
import { jsxs as
|
|
9831
|
+
import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9832
|
+
import { Text as Text36 } from "ink";
|
|
9833
|
+
import { jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
9834
|
+
import { Text as Text37 } from "ink";
|
|
9835
|
+
import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
9836
|
+
import { Text as Text38 } from "ink";
|
|
9837
|
+
import { jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9838
|
+
import { Text as Text39 } from "ink";
|
|
9839
|
+
import { jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9832
9840
|
import { useState as useState222, useEffect as useEffect24 } from "react";
|
|
9833
9841
|
import { execFile as execFile22 } from "child_process";
|
|
9834
9842
|
import os5 from "os";
|
|
@@ -9838,43 +9846,53 @@ import {
|
|
|
9838
9846
|
useContext as useContext9,
|
|
9839
9847
|
useState as useState23
|
|
9840
9848
|
} from "react";
|
|
9841
|
-
import { jsx as
|
|
9842
|
-
import { jsx as
|
|
9849
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
9850
|
+
import { jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
9843
9851
|
import { useRef as useRef14 } from "react";
|
|
9844
|
-
import { Box as Box29, Text as Text37 } from "ink";
|
|
9845
|
-
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9846
|
-
import { Box as Box30, Text as Text38 } from "ink";
|
|
9847
|
-
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9848
|
-
import { jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
9849
|
-
import { Box as Box32, Text as Text40 } from "ink";
|
|
9850
|
-
import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
9851
|
-
import { useCallback as useCallback20, useMemo as useMemo12, useRef as useRef15 } from "react";
|
|
9852
9852
|
import { Box as Box33, Text as Text41 } from "ink";
|
|
9853
|
-
import { jsx as jsx43, jsxs as
|
|
9853
|
+
import { jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
9854
|
+
import { Box as Box34, Text as Text42 } from "ink";
|
|
9855
|
+
import { jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
9856
|
+
import { jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9857
|
+
import { createContext as createContext9, useContext as useContext10 } from "react";
|
|
9858
|
+
import { Box as Box36, Text as Text44 } from "ink";
|
|
9859
|
+
import { useContext as useContext11 } from "react";
|
|
9860
|
+
import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9861
|
+
import { Box as Box37, Text as Text45 } from "ink";
|
|
9862
|
+
import os6 from "os";
|
|
9863
|
+
import { Fragment as Fragment10, jsx as jsx47, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9864
|
+
import os7 from "os";
|
|
9865
|
+
import path142 from "path";
|
|
9866
|
+
import fs7 from "fs/promises";
|
|
9867
|
+
import { Box as Box38, Text as Text46 } from "ink";
|
|
9868
|
+
import { jsx as jsx48, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9869
|
+
import { useCallback as useCallback20, useMemo as useMemo12, useRef as useRef15 } from "react";
|
|
9870
|
+
import { Box as Box39, Text as Text47 } from "ink";
|
|
9871
|
+
import { jsx as jsx49, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9854
9872
|
import { useCallback as useCallback21, useMemo as useMemo13, useState as useState25 } from "react";
|
|
9855
|
-
import { Box as
|
|
9856
|
-
import { Fragment as
|
|
9873
|
+
import { Box as Box40, Text as Text48, useInput as useInput3 } from "ink";
|
|
9874
|
+
import { Fragment as Fragment11, jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9857
9875
|
import { useCallback as useCallback22, useMemo as useMemo14, useState as useState26 } from "react";
|
|
9858
|
-
import { Box as
|
|
9859
|
-
import { jsx as
|
|
9876
|
+
import { Box as Box41, Text as Text49 } from "ink";
|
|
9877
|
+
import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9860
9878
|
import { useCallback as useCallback23, useEffect as useEffect25, useMemo as useMemo15, useRef as useRef16, useState as useState27 } from "react";
|
|
9861
|
-
import { Box as
|
|
9862
|
-
import { jsx as
|
|
9879
|
+
import { Box as Box42, Text as Text50 } from "ink";
|
|
9880
|
+
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9863
9881
|
import { useCallback as useCallback24, useEffect as useEffect26, useMemo as useMemo16, useRef as useRef17, useState as useState28 } from "react";
|
|
9864
|
-
import { Box as
|
|
9865
|
-
import { jsx as
|
|
9866
|
-
import
|
|
9867
|
-
import
|
|
9882
|
+
import { Box as Box43, Text as Text51, useInput as useInput4 } from "ink";
|
|
9883
|
+
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9884
|
+
import fs8 from "fs";
|
|
9885
|
+
import path15 from "path";
|
|
9868
9886
|
import { useCallback as useCallback25, useMemo as useMemo17 } from "react";
|
|
9869
|
-
import { Box as
|
|
9870
|
-
import { jsx as
|
|
9887
|
+
import { Box as Box44, Text as Text52 } from "ink";
|
|
9888
|
+
import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
9871
9889
|
import { useCallback as useCallback26, useEffect as useEffect27, useMemo as useMemo18, useState as useState29 } from "react";
|
|
9872
|
-
import { Box as
|
|
9873
|
-
import { jsx as
|
|
9874
|
-
import { Box as
|
|
9875
|
-
import { jsx as
|
|
9876
|
-
import { jsx as
|
|
9877
|
-
import { jsx as
|
|
9890
|
+
import { Box as Box45, Text as Text53, useInput as useInput5 } from "ink";
|
|
9891
|
+
import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
9892
|
+
import { Box as Box46, Text as Text54 } from "ink";
|
|
9893
|
+
import { jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
9894
|
+
import { jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
9895
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
9878
9896
|
async function createRuntime(options) {
|
|
9879
9897
|
const worktree = path10.resolve(options.cwd);
|
|
9880
9898
|
const config = await new ConfigLoader().load({ cwd: worktree, configPath: options.configPath });
|
|
@@ -11467,7 +11485,7 @@ function parseVersion(version) {
|
|
|
11467
11485
|
if (!match) return null;
|
|
11468
11486
|
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
11469
11487
|
}
|
|
11470
|
-
var VERSION = "1.2.
|
|
11488
|
+
var VERSION = "1.2.13".length > 0 ? "1.2.13" : "0.0.0-dev";
|
|
11471
11489
|
async function updateCommand() {
|
|
11472
11490
|
writeStdoutLine(`Current version: ${VERSION}`);
|
|
11473
11491
|
const update = await checkForUpdate(VERSION, { force: true });
|
|
@@ -15523,6 +15541,7 @@ var OverflowStateContext = createContext(
|
|
|
15523
15541
|
var OverflowActionsContext = createContext(
|
|
15524
15542
|
void 0
|
|
15525
15543
|
);
|
|
15544
|
+
var useOverflowState = () => useContext(OverflowStateContext);
|
|
15526
15545
|
var useOverflowActions = () => useContext(OverflowActionsContext);
|
|
15527
15546
|
var enableDebugLog = false;
|
|
15528
15547
|
var debugLogger4 = createDebugLogger("MAX_SIZED_BOX");
|
|
@@ -24024,6 +24043,258 @@ var ToolGroupMessage = ({
|
|
|
24024
24043
|
}
|
|
24025
24044
|
);
|
|
24026
24045
|
};
|
|
24046
|
+
function getCompressionText(compression) {
|
|
24047
|
+
const { isPending, originalTokenCount, newTokenCount, compressionStatus } = compression;
|
|
24048
|
+
if (isPending) return "Comprimindo hist\xF3rico...";
|
|
24049
|
+
const orig = originalTokenCount ?? 0;
|
|
24050
|
+
const next = newTokenCount ?? 0;
|
|
24051
|
+
switch (compressionStatus) {
|
|
24052
|
+
case 1:
|
|
24053
|
+
return `Hist\xF3rico comprimido: ${orig} \u2192 ${next} tokens.`;
|
|
24054
|
+
case 2:
|
|
24055
|
+
return orig < 5e4 ? "Compress\xE3o sem benef\xEDcio para esse tamanho de hist\xF3rico." : "Compress\xE3o n\xE3o reduziu o tamanho. Verifique o prompt de compress\xE3o.";
|
|
24056
|
+
case 3:
|
|
24057
|
+
return "N\xE3o foi poss\xEDvel comprimir: erro na contagem de tokens.";
|
|
24058
|
+
case 5:
|
|
24059
|
+
return "Nada para comprimir.";
|
|
24060
|
+
default:
|
|
24061
|
+
return "";
|
|
24062
|
+
}
|
|
24063
|
+
}
|
|
24064
|
+
function CompressionMessage({
|
|
24065
|
+
compression
|
|
24066
|
+
}) {
|
|
24067
|
+
const text = getCompressionText(compression);
|
|
24068
|
+
return /* @__PURE__ */ jsxs21(Box22, { flexDirection: "row", children: [
|
|
24069
|
+
/* @__PURE__ */ jsx27(Box22, { marginRight: 1, children: compression.isPending ? /* @__PURE__ */ jsx27(build_default, { type: "dots" }) : /* @__PURE__ */ jsx27(Text25, { color: theme.text.accent, children: "\u2726" }) }),
|
|
24070
|
+
/* @__PURE__ */ jsx27(Text25, { color: compression.isPending ? theme.text.accent : theme.status.success, children: text })
|
|
24071
|
+
] });
|
|
24072
|
+
}
|
|
24073
|
+
function getSummaryText(summary) {
|
|
24074
|
+
if (summary.isPending) {
|
|
24075
|
+
switch (summary.stage) {
|
|
24076
|
+
case "generating":
|
|
24077
|
+
return "Gerando resumo do projeto...";
|
|
24078
|
+
case "saving":
|
|
24079
|
+
return "Salvando resumo...";
|
|
24080
|
+
default:
|
|
24081
|
+
return "Processando resumo...";
|
|
24082
|
+
}
|
|
24083
|
+
}
|
|
24084
|
+
const base = "Resumo gerado e salvo com sucesso!";
|
|
24085
|
+
return summary.filePath ? `${base} Salvo em: ${summary.filePath}` : base;
|
|
24086
|
+
}
|
|
24087
|
+
var SummaryMessage = ({ summary }) => /* @__PURE__ */ jsxs22(Box23, { flexDirection: "row", children: [
|
|
24088
|
+
/* @__PURE__ */ jsx28(Box23, { marginRight: 1, children: summary.isPending ? /* @__PURE__ */ jsx28(build_default, { type: "dots" }) : /* @__PURE__ */ jsx28(Text26, { color: theme.status.success, children: "\u2713" }) }),
|
|
24089
|
+
/* @__PURE__ */ jsx28(Text26, { color: summary.isPending ? theme.text.accent : theme.status.success, children: getSummaryText(summary) })
|
|
24090
|
+
] });
|
|
24091
|
+
var FILLED = "\u2588";
|
|
24092
|
+
var BUFFER = "\u2592";
|
|
24093
|
+
var EMPTY = "\u2591";
|
|
24094
|
+
var CONTENT_WIDTH = 56;
|
|
24095
|
+
function fmtTokens(n) {
|
|
24096
|
+
if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
|
|
24097
|
+
if (n >= 1e3) return `${(n / 1e3).toFixed(1)}k`;
|
|
24098
|
+
return String(n);
|
|
24099
|
+
}
|
|
24100
|
+
function fmtPct(tokens, total) {
|
|
24101
|
+
if (total <= 0) return "0.0";
|
|
24102
|
+
const p = tokens / total * 100;
|
|
24103
|
+
return p > 100 ? ">100" : p.toFixed(1);
|
|
24104
|
+
}
|
|
24105
|
+
function truncate(s, max) {
|
|
24106
|
+
return s.length <= max ? s : `${s.slice(0, max - 1)}\u2026`;
|
|
24107
|
+
}
|
|
24108
|
+
var ProgressBar = ({ usedPct, bufferPct, width }) => {
|
|
24109
|
+
const used = Math.round(Math.min(usedPct, 100) / 100 * width);
|
|
24110
|
+
const buffer = Math.round(Math.min(bufferPct, 100 - usedPct) / 100 * width);
|
|
24111
|
+
const free = Math.max(0, width - used - buffer);
|
|
24112
|
+
const usedColor = usedPct > 80 ? theme.status.error : usedPct > 60 ? theme.status.warning : theme.text.accent;
|
|
24113
|
+
return /* @__PURE__ */ jsxs23(Text27, { children: [
|
|
24114
|
+
/* @__PURE__ */ jsx29(Text27, { color: usedColor, children: FILLED.repeat(Math.max(0, used)) }),
|
|
24115
|
+
/* @__PURE__ */ jsx29(Text27, { color: theme.text.secondary, children: EMPTY.repeat(Math.max(0, free)) }),
|
|
24116
|
+
/* @__PURE__ */ jsx29(Text27, { color: theme.status.warning, children: BUFFER.repeat(Math.max(0, buffer)) })
|
|
24117
|
+
] });
|
|
24118
|
+
};
|
|
24119
|
+
var CategoryRow = ({ symbol, label, tokens, total, symbolColor, overLimit }) => /* @__PURE__ */ jsxs23(Box24, { width: CONTENT_WIDTH, children: [
|
|
24120
|
+
/* @__PURE__ */ jsx29(Box24, { width: 2, children: /* @__PURE__ */ jsx29(Text27, { color: symbolColor ?? theme.text.secondary, children: symbol }) }),
|
|
24121
|
+
/* @__PURE__ */ jsx29(Box24, { width: 24, children: /* @__PURE__ */ jsx29(Text27, { color: theme.text.primary, children: label }) }),
|
|
24122
|
+
/* @__PURE__ */ jsx29(Box24, { flexGrow: 1, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs23(Text27, { color: overLimit ? theme.status.error : theme.text.secondary, children: [
|
|
24123
|
+
fmtTokens(tokens),
|
|
24124
|
+
" tokens (",
|
|
24125
|
+
fmtPct(tokens, total),
|
|
24126
|
+
"%)"
|
|
24127
|
+
] }) })
|
|
24128
|
+
] });
|
|
24129
|
+
var DetailRow = ({
|
|
24130
|
+
name,
|
|
24131
|
+
tokens
|
|
24132
|
+
}) => /* @__PURE__ */ jsxs23(Box24, { width: CONTENT_WIDTH, paddingLeft: 2, children: [
|
|
24133
|
+
/* @__PURE__ */ jsxs23(Text27, { color: theme.text.secondary, children: [
|
|
24134
|
+
"\u2514",
|
|
24135
|
+
" "
|
|
24136
|
+
] }),
|
|
24137
|
+
/* @__PURE__ */ jsx29(Box24, { width: 32, children: /* @__PURE__ */ jsx29(Text27, { color: theme.text.link, children: truncate(name, 30) }) }),
|
|
24138
|
+
/* @__PURE__ */ jsx29(Box24, { flexGrow: 1, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs23(Text27, { color: theme.text.secondary, children: [
|
|
24139
|
+
fmtTokens(tokens),
|
|
24140
|
+
" tokens"
|
|
24141
|
+
] }) })
|
|
24142
|
+
] });
|
|
24143
|
+
var ContextUsage = ({
|
|
24144
|
+
modelName,
|
|
24145
|
+
totalTokens,
|
|
24146
|
+
contextWindowSize,
|
|
24147
|
+
breakdown,
|
|
24148
|
+
builtinTools,
|
|
24149
|
+
mcpTools,
|
|
24150
|
+
memoryFiles,
|
|
24151
|
+
skills,
|
|
24152
|
+
isEstimated,
|
|
24153
|
+
showDetails = false
|
|
24154
|
+
}) => {
|
|
24155
|
+
const pct = contextWindowSize > 0 ? totalTokens / contextWindowSize * 100 : 0;
|
|
24156
|
+
const overLimit = pct > 100;
|
|
24157
|
+
const bufferPct = contextWindowSize > 0 ? breakdown.autocompactBuffer / contextWindowSize * 100 : 0;
|
|
24158
|
+
const sortDesc = (arr) => [...arr].sort((a, b) => b.tokens - a.tokens);
|
|
24159
|
+
return /* @__PURE__ */ jsxs23(
|
|
24160
|
+
Box24,
|
|
24161
|
+
{
|
|
24162
|
+
borderStyle: "round",
|
|
24163
|
+
borderColor: theme.border.default,
|
|
24164
|
+
flexDirection: "column",
|
|
24165
|
+
paddingY: 1,
|
|
24166
|
+
paddingX: 2,
|
|
24167
|
+
children: [
|
|
24168
|
+
/* @__PURE__ */ jsx29(Text27, { bold: true, color: theme.text.accent, children: "Uso do Contexto" }),
|
|
24169
|
+
/* @__PURE__ */ jsx29(Box24, { height: 1 }),
|
|
24170
|
+
isEstimated ? /* @__PURE__ */ jsx29(Box24, { marginBottom: 1, children: /* @__PURE__ */ jsx29(Text27, { color: theme.status.warning, italic: true, children: "Estimativa \u2014 envie uma mensagem para ver o uso real." }) }) : /* @__PURE__ */ jsxs23(Fragment7, { children: [
|
|
24171
|
+
/* @__PURE__ */ jsxs23(Box24, { width: CONTENT_WIDTH, marginBottom: 1, children: [
|
|
24172
|
+
/* @__PURE__ */ jsxs23(Text27, { color: theme.text.secondary, children: [
|
|
24173
|
+
"Modelo: ",
|
|
24174
|
+
modelName
|
|
24175
|
+
] }),
|
|
24176
|
+
/* @__PURE__ */ jsx29(Box24, { flexGrow: 1, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs23(Text27, { color: theme.text.secondary, children: [
|
|
24177
|
+
"Janela: ",
|
|
24178
|
+
fmtTokens(contextWindowSize),
|
|
24179
|
+
" tokens"
|
|
24180
|
+
] }) })
|
|
24181
|
+
] }),
|
|
24182
|
+
/* @__PURE__ */ jsx29(Box24, { width: CONTENT_WIDTH, children: /* @__PURE__ */ jsx29(
|
|
24183
|
+
ProgressBar,
|
|
24184
|
+
{
|
|
24185
|
+
usedPct: Math.min(pct, 100),
|
|
24186
|
+
bufferPct,
|
|
24187
|
+
width: CONTENT_WIDTH
|
|
24188
|
+
}
|
|
24189
|
+
) }),
|
|
24190
|
+
overLimit && /* @__PURE__ */ jsx29(Box24, { marginBottom: 1, children: /* @__PURE__ */ jsx29(Text27, { color: theme.status.error, children: "Contexto excede o limite! Use /compact ou /clear para reduzir." }) }),
|
|
24191
|
+
/* @__PURE__ */ jsx29(Box24, { height: 1 }),
|
|
24192
|
+
/* @__PURE__ */ jsx29(
|
|
24193
|
+
CategoryRow,
|
|
24194
|
+
{
|
|
24195
|
+
symbol: FILLED,
|
|
24196
|
+
label: "Usado",
|
|
24197
|
+
tokens: totalTokens,
|
|
24198
|
+
total: contextWindowSize,
|
|
24199
|
+
symbolColor: overLimit ? theme.status.error : theme.text.accent,
|
|
24200
|
+
overLimit
|
|
24201
|
+
}
|
|
24202
|
+
),
|
|
24203
|
+
/* @__PURE__ */ jsx29(
|
|
24204
|
+
CategoryRow,
|
|
24205
|
+
{
|
|
24206
|
+
symbol: EMPTY,
|
|
24207
|
+
label: "Livre",
|
|
24208
|
+
tokens: breakdown.freeSpace,
|
|
24209
|
+
total: contextWindowSize,
|
|
24210
|
+
symbolColor: theme.text.secondary
|
|
24211
|
+
}
|
|
24212
|
+
),
|
|
24213
|
+
/* @__PURE__ */ jsx29(
|
|
24214
|
+
CategoryRow,
|
|
24215
|
+
{
|
|
24216
|
+
symbol: BUFFER,
|
|
24217
|
+
label: "Buffer de compress\xE3o",
|
|
24218
|
+
tokens: breakdown.autocompactBuffer,
|
|
24219
|
+
total: contextWindowSize,
|
|
24220
|
+
symbolColor: theme.status.warning
|
|
24221
|
+
}
|
|
24222
|
+
),
|
|
24223
|
+
/* @__PURE__ */ jsx29(Box24, { height: 1 }),
|
|
24224
|
+
/* @__PURE__ */ jsx29(Text27, { bold: true, color: theme.text.primary, children: "Por categoria" })
|
|
24225
|
+
] }),
|
|
24226
|
+
/* @__PURE__ */ jsx29(
|
|
24227
|
+
CategoryRow,
|
|
24228
|
+
{
|
|
24229
|
+
symbol: FILLED,
|
|
24230
|
+
label: "System prompt",
|
|
24231
|
+
tokens: breakdown.systemPrompt,
|
|
24232
|
+
total: contextWindowSize,
|
|
24233
|
+
symbolColor: theme.text.accent
|
|
24234
|
+
}
|
|
24235
|
+
),
|
|
24236
|
+
breakdown.builtinTools > 0 && /* @__PURE__ */ jsx29(
|
|
24237
|
+
CategoryRow,
|
|
24238
|
+
{
|
|
24239
|
+
symbol: FILLED,
|
|
24240
|
+
label: "Ferramentas built-in",
|
|
24241
|
+
tokens: breakdown.builtinTools,
|
|
24242
|
+
total: contextWindowSize,
|
|
24243
|
+
symbolColor: theme.text.accent
|
|
24244
|
+
}
|
|
24245
|
+
),
|
|
24246
|
+
breakdown.mcpTools > 0 && /* @__PURE__ */ jsx29(
|
|
24247
|
+
CategoryRow,
|
|
24248
|
+
{
|
|
24249
|
+
symbol: FILLED,
|
|
24250
|
+
label: "Ferramentas MCP",
|
|
24251
|
+
tokens: breakdown.mcpTools,
|
|
24252
|
+
total: contextWindowSize,
|
|
24253
|
+
symbolColor: theme.text.accent
|
|
24254
|
+
}
|
|
24255
|
+
),
|
|
24256
|
+
breakdown.memoryFiles > 0 && /* @__PURE__ */ jsx29(
|
|
24257
|
+
CategoryRow,
|
|
24258
|
+
{
|
|
24259
|
+
symbol: FILLED,
|
|
24260
|
+
label: "Arquivos de mem\xF3ria",
|
|
24261
|
+
tokens: breakdown.memoryFiles,
|
|
24262
|
+
total: contextWindowSize,
|
|
24263
|
+
symbolColor: theme.text.accent
|
|
24264
|
+
}
|
|
24265
|
+
),
|
|
24266
|
+
!isEstimated && /* @__PURE__ */ jsx29(
|
|
24267
|
+
CategoryRow,
|
|
24268
|
+
{
|
|
24269
|
+
symbol: FILLED,
|
|
24270
|
+
label: "Mensagens",
|
|
24271
|
+
tokens: breakdown.messages,
|
|
24272
|
+
total: contextWindowSize,
|
|
24273
|
+
symbolColor: theme.text.accent
|
|
24274
|
+
}
|
|
24275
|
+
),
|
|
24276
|
+
showDetails ? /* @__PURE__ */ jsxs23(Fragment7, { children: [
|
|
24277
|
+
builtinTools.length > 0 && /* @__PURE__ */ jsxs23(Box24, { flexDirection: "column", marginTop: 1, children: [
|
|
24278
|
+
/* @__PURE__ */ jsx29(Text27, { bold: true, color: theme.text.primary, children: "Ferramentas built-in" }),
|
|
24279
|
+
sortDesc(builtinTools).map((t2) => /* @__PURE__ */ jsx29(DetailRow, { name: t2.name, tokens: t2.tokens }, t2.name))
|
|
24280
|
+
] }),
|
|
24281
|
+
mcpTools.length > 0 && /* @__PURE__ */ jsxs23(Box24, { flexDirection: "column", marginTop: 1, children: [
|
|
24282
|
+
/* @__PURE__ */ jsx29(Text27, { bold: true, color: theme.text.primary, children: "Ferramentas MCP" }),
|
|
24283
|
+
sortDesc(mcpTools).map((t2) => /* @__PURE__ */ jsx29(DetailRow, { name: t2.name, tokens: t2.tokens }, t2.name))
|
|
24284
|
+
] }),
|
|
24285
|
+
memoryFiles.length > 0 && /* @__PURE__ */ jsxs23(Box24, { flexDirection: "column", marginTop: 1, children: [
|
|
24286
|
+
/* @__PURE__ */ jsx29(Text27, { bold: true, color: theme.text.primary, children: "Arquivos de mem\xF3ria" }),
|
|
24287
|
+
sortDesc(memoryFiles).map((f) => /* @__PURE__ */ jsx29(DetailRow, { name: f.path, tokens: f.tokens }, f.path))
|
|
24288
|
+
] }),
|
|
24289
|
+
skills.length > 0 && /* @__PURE__ */ jsxs23(Box24, { flexDirection: "column", marginTop: 1, children: [
|
|
24290
|
+
/* @__PURE__ */ jsx29(Text27, { bold: true, color: theme.text.primary, children: "Skills" }),
|
|
24291
|
+
skills.map((sk) => /* @__PURE__ */ jsx29(DetailRow, { name: sk.name, tokens: sk.tokens }, sk.name))
|
|
24292
|
+
] })
|
|
24293
|
+
] }) : /* @__PURE__ */ jsx29(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text27, { color: theme.text.secondary, italic: true, children: "Use /context detail para ver o detalhamento por item." }) })
|
|
24294
|
+
]
|
|
24295
|
+
}
|
|
24296
|
+
);
|
|
24297
|
+
};
|
|
24027
24298
|
var HistoryItemDisplay = ({
|
|
24028
24299
|
item,
|
|
24029
24300
|
availableTerminalHeight,
|
|
@@ -24041,10 +24312,10 @@ var HistoryItemDisplay = ({
|
|
|
24041
24312
|
const contentWidth = terminalWidth - 4;
|
|
24042
24313
|
const boxWidth = mainAreaWidth ?? contentWidth;
|
|
24043
24314
|
const marginTop = safeItem.type === "gemini_content" || safeItem.type === "gemini_thought_content" ? 0 : 1;
|
|
24044
|
-
return /* @__PURE__ */
|
|
24045
|
-
safeItem.type === "user" && /* @__PURE__ */
|
|
24046
|
-
safeItem.type === "user_shell" && /* @__PURE__ */
|
|
24047
|
-
safeItem.type === "gemini" && /* @__PURE__ */
|
|
24315
|
+
return /* @__PURE__ */ jsxs24(Box25, { flexDirection: "column", marginTop, marginLeft: 2, marginRight: 2, children: [
|
|
24316
|
+
safeItem.type === "user" && /* @__PURE__ */ jsx30(UserMessage, { text: safeItem.text }),
|
|
24317
|
+
safeItem.type === "user_shell" && /* @__PURE__ */ jsx30(UserShellMessage, { text: safeItem.text }),
|
|
24318
|
+
safeItem.type === "gemini" && /* @__PURE__ */ jsx30(
|
|
24048
24319
|
AssistantMessage,
|
|
24049
24320
|
{
|
|
24050
24321
|
text: safeItem.text,
|
|
@@ -24053,7 +24324,7 @@ var HistoryItemDisplay = ({
|
|
|
24053
24324
|
contentWidth
|
|
24054
24325
|
}
|
|
24055
24326
|
),
|
|
24056
|
-
safeItem.type === "gemini_content" && /* @__PURE__ */
|
|
24327
|
+
safeItem.type === "gemini_content" && /* @__PURE__ */ jsx30(
|
|
24057
24328
|
AssistantMessageContent,
|
|
24058
24329
|
{
|
|
24059
24330
|
text: safeItem.text,
|
|
@@ -24062,7 +24333,7 @@ var HistoryItemDisplay = ({
|
|
|
24062
24333
|
contentWidth
|
|
24063
24334
|
}
|
|
24064
24335
|
),
|
|
24065
|
-
!compactMode && safeItem.type === "gemini_thought" && /* @__PURE__ */
|
|
24336
|
+
!compactMode && safeItem.type === "gemini_thought" && /* @__PURE__ */ jsx30(
|
|
24066
24337
|
ThinkMessage,
|
|
24067
24338
|
{
|
|
24068
24339
|
text: safeItem.text,
|
|
@@ -24071,7 +24342,7 @@ var HistoryItemDisplay = ({
|
|
|
24071
24342
|
contentWidth
|
|
24072
24343
|
}
|
|
24073
24344
|
),
|
|
24074
|
-
!compactMode && safeItem.type === "gemini_thought_content" && /* @__PURE__ */
|
|
24345
|
+
!compactMode && safeItem.type === "gemini_thought_content" && /* @__PURE__ */ jsx30(
|
|
24075
24346
|
ThinkMessageContent,
|
|
24076
24347
|
{
|
|
24077
24348
|
text: safeItem.text,
|
|
@@ -24080,11 +24351,11 @@ var HistoryItemDisplay = ({
|
|
|
24080
24351
|
contentWidth
|
|
24081
24352
|
}
|
|
24082
24353
|
),
|
|
24083
|
-
safeItem.type === "info" && /* @__PURE__ */
|
|
24084
|
-
safeItem.type === "success" && /* @__PURE__ */
|
|
24085
|
-
safeItem.type === "warning" && /* @__PURE__ */
|
|
24086
|
-
safeItem.type === "error" && /* @__PURE__ */
|
|
24087
|
-
safeItem.type === "tool_group" && /* @__PURE__ */
|
|
24354
|
+
safeItem.type === "info" && /* @__PURE__ */ jsx30(InfoMessage, { text: safeItem.text }),
|
|
24355
|
+
safeItem.type === "success" && /* @__PURE__ */ jsx30(SuccessMessage, { text: safeItem.text }),
|
|
24356
|
+
safeItem.type === "warning" && /* @__PURE__ */ jsx30(WarningMessage, { text: safeItem.text }),
|
|
24357
|
+
safeItem.type === "error" && /* @__PURE__ */ jsx30(ErrorMessage, { text: safeItem.text }),
|
|
24358
|
+
safeItem.type === "tool_group" && /* @__PURE__ */ jsx30(
|
|
24088
24359
|
ToolGroupMessage,
|
|
24089
24360
|
{
|
|
24090
24361
|
toolCalls: safeItem.tools,
|
|
@@ -24101,38 +24372,55 @@ var HistoryItemDisplay = ({
|
|
|
24101
24372
|
compactLabel
|
|
24102
24373
|
}
|
|
24103
24374
|
),
|
|
24104
|
-
safeItem.type === "
|
|
24375
|
+
safeItem.type === "context_usage" && /* @__PURE__ */ jsx30(
|
|
24376
|
+
ContextUsage,
|
|
24377
|
+
{
|
|
24378
|
+
modelName: safeItem.modelName,
|
|
24379
|
+
totalTokens: safeItem.totalTokens,
|
|
24380
|
+
contextWindowSize: safeItem.contextWindowSize,
|
|
24381
|
+
breakdown: safeItem.breakdown,
|
|
24382
|
+
builtinTools: safeItem.builtinTools,
|
|
24383
|
+
mcpTools: safeItem.mcpTools,
|
|
24384
|
+
memoryFiles: safeItem.memoryFiles,
|
|
24385
|
+
skills: safeItem.skills,
|
|
24386
|
+
isEstimated: safeItem.isEstimated,
|
|
24387
|
+
showDetails: safeItem.showDetails
|
|
24388
|
+
}
|
|
24389
|
+
),
|
|
24390
|
+
safeItem.type === "compression" && /* @__PURE__ */ jsx30(CompressionMessage, { compression: safeItem.compression }),
|
|
24391
|
+
safeItem.type === "summary" && /* @__PURE__ */ jsx30(SummaryMessage, { summary: safeItem.summary }),
|
|
24392
|
+
safeItem.type === "tool_use_summary" && (!compactMode || !summaryAbsorbed) && /* @__PURE__ */ jsx30(Box25, { paddingLeft: 1, children: /* @__PURE__ */ jsxs24(Text28, { dimColor: true, children: [
|
|
24105
24393
|
"\u25CF ",
|
|
24106
24394
|
safeItem.summary
|
|
24107
24395
|
] }) }),
|
|
24108
|
-
safeItem.type === "retry_countdown" && /* @__PURE__ */
|
|
24109
|
-
safeItem.type === "away_recap" && /* @__PURE__ */
|
|
24110
|
-
safeItem.type === "memory_saved" && /* @__PURE__ */
|
|
24396
|
+
safeItem.type === "retry_countdown" && /* @__PURE__ */ jsx30(WarningMessage, { text: safeItem.text }),
|
|
24397
|
+
safeItem.type === "away_recap" && /* @__PURE__ */ jsx30(InfoMessage, { text: safeItem.text }),
|
|
24398
|
+
safeItem.type === "memory_saved" && /* @__PURE__ */ jsx30(
|
|
24111
24399
|
InfoMessage,
|
|
24112
24400
|
{
|
|
24113
24401
|
text: `${safeItem.verb ?? "Saved"} ${safeItem.writtenCount} ${safeItem.writtenCount === 1 ? "memory file" : "memory files"}.`
|
|
24114
24402
|
}
|
|
24115
24403
|
),
|
|
24116
|
-
shouldRenderFallback(safeItem.type) && safeItem.text && /* @__PURE__ */
|
|
24117
|
-
safeItem.type === "quit" && /* @__PURE__ */
|
|
24404
|
+
shouldRenderFallback(safeItem.type) && safeItem.text && /* @__PURE__ */ jsx30(InfoMessage, { text: safeItem.text }),
|
|
24405
|
+
safeItem.type === "quit" && /* @__PURE__ */ jsx30(InfoMessage, { text: `Session ended. Duration: ${safeItem.duration}`, width: boxWidth })
|
|
24118
24406
|
] });
|
|
24119
24407
|
};
|
|
24120
24408
|
function shouldRenderFallback(type) {
|
|
24121
24409
|
return type === "notification" || type === "extensions_list" || type === "model_stats" || type === "tool_stats" || type === "stats";
|
|
24122
24410
|
}
|
|
24123
|
-
var InfoMessage = ({ text }) => /* @__PURE__ */
|
|
24411
|
+
var InfoMessage = ({ text }) => /* @__PURE__ */ jsxs24(Text28, { color: theme.text.secondary, children: [
|
|
24124
24412
|
"\u2139 ",
|
|
24125
24413
|
text
|
|
24126
24414
|
] });
|
|
24127
|
-
var SuccessMessage = ({ text }) => /* @__PURE__ */
|
|
24415
|
+
var SuccessMessage = ({ text }) => /* @__PURE__ */ jsxs24(Text28, { color: theme.status.success, children: [
|
|
24128
24416
|
"\u2713 ",
|
|
24129
24417
|
text
|
|
24130
24418
|
] });
|
|
24131
|
-
var WarningMessage = ({ text }) => /* @__PURE__ */
|
|
24419
|
+
var WarningMessage = ({ text }) => /* @__PURE__ */ jsxs24(Text28, { color: theme.status.warning, children: [
|
|
24132
24420
|
"\u26A0 ",
|
|
24133
24421
|
text
|
|
24134
24422
|
] });
|
|
24135
|
-
var ErrorMessage = ({ text }) => /* @__PURE__ */
|
|
24423
|
+
var ErrorMessage = ({ text }) => /* @__PURE__ */ jsxs24(Text28, { color: theme.status.error, children: [
|
|
24136
24424
|
"\u2717 ",
|
|
24137
24425
|
text
|
|
24138
24426
|
] });
|
|
@@ -24330,8 +24618,8 @@ var MainContent = ({
|
|
|
24330
24618
|
return () => clearImmediate(handle);
|
|
24331
24619
|
}, [replayCount, mergedHistory.length]);
|
|
24332
24620
|
const visibleHistory = mergedHistory.length - replayCount <= PROGRESSIVE_REPLAY_CHUNK_SIZE ? mergedHistory : mergedHistory.slice(0, replayCount);
|
|
24333
|
-
return /* @__PURE__ */
|
|
24334
|
-
/* @__PURE__ */
|
|
24621
|
+
return /* @__PURE__ */ jsxs25(Box26, { flexDirection: "column", flexGrow: 1, children: [
|
|
24622
|
+
/* @__PURE__ */ jsx31(Static, { items: visibleHistory, children: (item) => /* @__PURE__ */ jsx31(
|
|
24335
24623
|
HistoryItemDisplay,
|
|
24336
24624
|
{
|
|
24337
24625
|
item,
|
|
@@ -24344,7 +24632,7 @@ var MainContent = ({
|
|
|
24344
24632
|
},
|
|
24345
24633
|
item.id
|
|
24346
24634
|
) }, historyRemountKey),
|
|
24347
|
-
pendingAssistantText.trim().length > 0 && /* @__PURE__ */
|
|
24635
|
+
pendingAssistantText.trim().length > 0 && /* @__PURE__ */ jsx31(
|
|
24348
24636
|
HistoryItemDisplay,
|
|
24349
24637
|
{
|
|
24350
24638
|
item: { id: -1, type: "gemini", text: pendingAssistantText },
|
|
@@ -24354,7 +24642,7 @@ var MainContent = ({
|
|
|
24354
24642
|
isFocused
|
|
24355
24643
|
}
|
|
24356
24644
|
),
|
|
24357
|
-
liveToolCalls.length > 0 && /* @__PURE__ */
|
|
24645
|
+
liveToolCalls.length > 0 && /* @__PURE__ */ jsx31(
|
|
24358
24646
|
HistoryItemDisplay,
|
|
24359
24647
|
{
|
|
24360
24648
|
item: { id: -2, type: "tool_group", tools: liveToolCalls },
|
|
@@ -24367,6 +24655,14 @@ var MainContent = ({
|
|
|
24367
24655
|
)
|
|
24368
24656
|
] });
|
|
24369
24657
|
};
|
|
24658
|
+
var ShowMoreLines = ({ constrainHeight }) => {
|
|
24659
|
+
const overflowState = useOverflowState();
|
|
24660
|
+
const streamingState = useStreamingContext();
|
|
24661
|
+
if (overflowState === void 0 || overflowState.overflowingIds.size === 0 || !constrainHeight || !(streamingState === "idle" || streamingState === "waiting_for_confirmation")) {
|
|
24662
|
+
return null;
|
|
24663
|
+
}
|
|
24664
|
+
return /* @__PURE__ */ jsx32(Box27, { children: /* @__PURE__ */ jsx32(Text29, { color: theme.text.secondary, wrap: "truncate", children: "Press ctrl-s to show more lines" }) });
|
|
24665
|
+
};
|
|
24370
24666
|
function useTerminalSize() {
|
|
24371
24667
|
const [size, setSize] = useState13({
|
|
24372
24668
|
columns: process.stdout.columns || 80,
|
|
@@ -24466,34 +24762,34 @@ var LoadingIndicator = ({
|
|
|
24466
24762
|
time: timeStr,
|
|
24467
24763
|
tokens: tokenStr
|
|
24468
24764
|
}) : null;
|
|
24469
|
-
return /* @__PURE__ */
|
|
24470
|
-
/* @__PURE__ */
|
|
24471
|
-
|
|
24765
|
+
return /* @__PURE__ */ jsxs26(Box28, { paddingLeft: 2, flexDirection: "column", children: [
|
|
24766
|
+
/* @__PURE__ */ jsxs26(
|
|
24767
|
+
Box28,
|
|
24472
24768
|
{
|
|
24473
24769
|
width: "100%",
|
|
24474
24770
|
flexDirection: isNarrow ? "column" : "row",
|
|
24475
24771
|
alignItems: isNarrow ? "flex-start" : "center",
|
|
24476
24772
|
children: [
|
|
24477
|
-
/* @__PURE__ */
|
|
24478
|
-
/* @__PURE__ */
|
|
24773
|
+
/* @__PURE__ */ jsxs26(Box28, { children: [
|
|
24774
|
+
/* @__PURE__ */ jsx33(Box28, { marginRight: 1, children: /* @__PURE__ */ jsx33(
|
|
24479
24775
|
GeminiRespondingSpinner,
|
|
24480
24776
|
{
|
|
24481
24777
|
nonRespondingDisplay: streamingState === "waiting_for_confirmation" ? "\u280F" : ""
|
|
24482
24778
|
}
|
|
24483
24779
|
) }),
|
|
24484
|
-
primaryText && /* @__PURE__ */
|
|
24485
|
-
!isNarrow && cancelAndTimerContent && /* @__PURE__ */
|
|
24780
|
+
primaryText && /* @__PURE__ */ jsx33(Text30, { color: theme.text.accent, wrap: "truncate-end", children: primaryText }),
|
|
24781
|
+
!isNarrow && cancelAndTimerContent && /* @__PURE__ */ jsxs26(Text30, { color: theme.text.secondary, children: [
|
|
24486
24782
|
" ",
|
|
24487
24783
|
cancelAndTimerContent
|
|
24488
24784
|
] })
|
|
24489
24785
|
] }),
|
|
24490
|
-
!isNarrow && /* @__PURE__ */
|
|
24491
|
-
!isNarrow && rightContent && /* @__PURE__ */
|
|
24786
|
+
!isNarrow && /* @__PURE__ */ jsx33(Box28, { flexGrow: 1 }),
|
|
24787
|
+
!isNarrow && rightContent && /* @__PURE__ */ jsx33(Box28, { children: rightContent })
|
|
24492
24788
|
]
|
|
24493
24789
|
}
|
|
24494
24790
|
),
|
|
24495
|
-
isNarrow && cancelAndTimerContent && /* @__PURE__ */
|
|
24496
|
-
isNarrow && rightContent && /* @__PURE__ */
|
|
24791
|
+
isNarrow && cancelAndTimerContent && /* @__PURE__ */ jsx33(Box28, { children: /* @__PURE__ */ jsx33(Text30, { color: theme.text.secondary, children: cancelAndTimerContent }) }),
|
|
24792
|
+
isNarrow && rightContent && /* @__PURE__ */ jsx33(Box28, { children: rightContent })
|
|
24497
24793
|
] });
|
|
24498
24794
|
};
|
|
24499
24795
|
var MAX_WIDTH = 150;
|
|
@@ -24507,7 +24803,7 @@ var _PrepareLabel = ({
|
|
|
24507
24803
|
const hasMatch = matchedIndex !== void 0 && matchedIndex >= 0 && matchedIndex < label.length && userInput.length > 0;
|
|
24508
24804
|
if (!hasMatch) {
|
|
24509
24805
|
const display = isExpanded ? label : label.length > MAX_WIDTH ? label.slice(0, MAX_WIDTH) + "..." : label;
|
|
24510
|
-
return /* @__PURE__ */
|
|
24806
|
+
return /* @__PURE__ */ jsx34(Text31, { wrap: "wrap", color: textColor, children: display });
|
|
24511
24807
|
}
|
|
24512
24808
|
const matchLength = userInput.length;
|
|
24513
24809
|
let before = "";
|
|
@@ -24546,10 +24842,10 @@ var _PrepareLabel = ({
|
|
|
24546
24842
|
after = after.length >= 3 ? after.slice(0, -3) + "..." : "...";
|
|
24547
24843
|
}
|
|
24548
24844
|
}
|
|
24549
|
-
return /* @__PURE__ */
|
|
24845
|
+
return /* @__PURE__ */ jsxs27(Text31, { color: textColor, wrap: "wrap", children: [
|
|
24550
24846
|
before,
|
|
24551
|
-
match ? match.split(/(\s+)/).map((part, index) => /* @__PURE__ */
|
|
24552
|
-
|
|
24847
|
+
match ? match.split(/(\s+)/).map((part, index) => /* @__PURE__ */ jsx34(
|
|
24848
|
+
Text31,
|
|
24553
24849
|
{
|
|
24554
24850
|
color: theme.background.primary,
|
|
24555
24851
|
backgroundColor: theme.text.primary,
|
|
@@ -24573,7 +24869,7 @@ function SuggestionsDisplay({
|
|
|
24573
24869
|
expandedIndex
|
|
24574
24870
|
}) {
|
|
24575
24871
|
if (isLoading) {
|
|
24576
|
-
return /* @__PURE__ */
|
|
24872
|
+
return /* @__PURE__ */ jsx35(Box29, { width, children: /* @__PURE__ */ jsx35(Text32, { color: "gray", children: t("Loading suggestions...") }) });
|
|
24577
24873
|
}
|
|
24578
24874
|
if (suggestions.length === 0) {
|
|
24579
24875
|
return null;
|
|
@@ -24589,8 +24885,8 @@ function SuggestionsDisplay({
|
|
|
24589
24885
|
...suggestions.map((s) => getFullLabel(s).length)
|
|
24590
24886
|
);
|
|
24591
24887
|
const commandColumnWidth = mode === "slash" ? Math.min(maxLabelLength, Math.floor(width * 0.5)) : 0;
|
|
24592
|
-
return /* @__PURE__ */
|
|
24593
|
-
scrollOffset > 0 && /* @__PURE__ */
|
|
24888
|
+
return /* @__PURE__ */ jsxs28(Box29, { flexDirection: "column", width, children: [
|
|
24889
|
+
scrollOffset > 0 && /* @__PURE__ */ jsx35(Text32, { color: theme.text.primary, children: "\u25B2" }),
|
|
24594
24890
|
visibleSuggestions.map((suggestion, index) => {
|
|
24595
24891
|
const originalIndex = startIndex + index;
|
|
24596
24892
|
const isActive = originalIndex === activeIndex;
|
|
@@ -24603,7 +24899,7 @@ function SuggestionsDisplay({
|
|
|
24603
24899
|
width - commandColumnWidth - 2 - expansionIndicatorWidth,
|
|
24604
24900
|
1
|
|
24605
24901
|
);
|
|
24606
|
-
const labelElement = /* @__PURE__ */
|
|
24902
|
+
const labelElement = /* @__PURE__ */ jsx35(
|
|
24607
24903
|
PrepareLabel,
|
|
24608
24904
|
{
|
|
24609
24905
|
label: displayLabel,
|
|
@@ -24613,39 +24909,39 @@ function SuggestionsDisplay({
|
|
|
24613
24909
|
isExpanded
|
|
24614
24910
|
}
|
|
24615
24911
|
);
|
|
24616
|
-
return /* @__PURE__ */
|
|
24617
|
-
/* @__PURE__ */
|
|
24618
|
-
|
|
24912
|
+
return /* @__PURE__ */ jsxs28(Box29, { flexDirection: "row", children: [
|
|
24913
|
+
/* @__PURE__ */ jsx35(
|
|
24914
|
+
Box29,
|
|
24619
24915
|
{
|
|
24620
24916
|
...mode === "slash" ? { width: commandColumnWidth, flexShrink: 0 } : { flexShrink: 1 },
|
|
24621
|
-
children: /* @__PURE__ */
|
|
24917
|
+
children: /* @__PURE__ */ jsxs28(Box29, { children: [
|
|
24622
24918
|
labelElement,
|
|
24623
|
-
suggestion.argumentHint && /* @__PURE__ */
|
|
24919
|
+
suggestion.argumentHint && /* @__PURE__ */ jsxs28(Text32, { color: theme.text.secondary, children: [
|
|
24624
24920
|
" ",
|
|
24625
24921
|
suggestion.argumentHint
|
|
24626
24922
|
] }),
|
|
24627
|
-
suggestion.sourceBadge && /* @__PURE__ */
|
|
24923
|
+
suggestion.sourceBadge && /* @__PURE__ */ jsxs28(Text32, { color: textColor, children: [
|
|
24628
24924
|
" ",
|
|
24629
24925
|
suggestion.sourceBadge
|
|
24630
24926
|
] })
|
|
24631
24927
|
] })
|
|
24632
24928
|
}
|
|
24633
24929
|
),
|
|
24634
|
-
suggestion.description && /* @__PURE__ */
|
|
24635
|
-
|
|
24930
|
+
suggestion.description && /* @__PURE__ */ jsx35(
|
|
24931
|
+
Box29,
|
|
24636
24932
|
{
|
|
24637
24933
|
width: descriptionColumnWidth,
|
|
24638
24934
|
flexGrow: 1,
|
|
24639
24935
|
flexShrink: 1,
|
|
24640
24936
|
paddingLeft: 2,
|
|
24641
|
-
children: /* @__PURE__ */
|
|
24937
|
+
children: /* @__PURE__ */ jsx35(Text32, { color: textColor, wrap: "wrap", children: suggestion.description })
|
|
24642
24938
|
}
|
|
24643
24939
|
),
|
|
24644
|
-
isActive && isLong && /* @__PURE__ */
|
|
24940
|
+
isActive && isLong && /* @__PURE__ */ jsx35(Box29, { children: /* @__PURE__ */ jsx35(Text32, { color: Colors.Gray, children: isExpanded ? " \u2190 " : " \u2192 " }) })
|
|
24645
24941
|
] }, `${suggestion.value}-${originalIndex}`);
|
|
24646
24942
|
}),
|
|
24647
|
-
endIndex < suggestions.length && /* @__PURE__ */
|
|
24648
|
-
suggestions.length > MAX_SUGGESTIONS_TO_SHOW && /* @__PURE__ */
|
|
24943
|
+
endIndex < suggestions.length && /* @__PURE__ */ jsx35(Text32, { color: "gray", children: "\u25BC" }),
|
|
24944
|
+
suggestions.length > MAX_SUGGESTIONS_TO_SHOW && /* @__PURE__ */ jsxs28(Text32, { color: "gray", children: [
|
|
24649
24945
|
"(",
|
|
24650
24946
|
activeIndex + 1,
|
|
24651
24947
|
"/",
|
|
@@ -26063,10 +26359,10 @@ function useExportCompletion(buffer, slashCommands) {
|
|
|
26063
26359
|
const cyclingActiveRef = useRef11(false);
|
|
26064
26360
|
const nextTextChangeWasUserInputRef = useRef11(false);
|
|
26065
26361
|
const exportFormatSuggestions = useMemo10(() => {
|
|
26066
|
-
const
|
|
26362
|
+
const exportCommand2 = slashCommands.find(
|
|
26067
26363
|
(command) => command.name === EXPORT_COMMAND_INPUT.slice(1)
|
|
26068
26364
|
);
|
|
26069
|
-
const subCommands =
|
|
26365
|
+
const subCommands = exportCommand2?.subCommands;
|
|
26070
26366
|
if (subCommands && subCommands.length > 0) {
|
|
26071
26367
|
return subCommands.map((command) => ({
|
|
26072
26368
|
label: command.name,
|
|
@@ -26085,8 +26381,8 @@ function useExportCompletion(buffer, slashCommands) {
|
|
|
26085
26381
|
nextTextChangeWasUserInputRef.current = true;
|
|
26086
26382
|
}, []);
|
|
26087
26383
|
useEffect222(() => {
|
|
26088
|
-
const
|
|
26089
|
-
if (nextTextChangeWasUserInputRef.current &&
|
|
26384
|
+
const fmt2 = getExportFormatFromInput(buffer.text, exportCycleFormats);
|
|
26385
|
+
if (nextTextChangeWasUserInputRef.current && fmt2 !== null && !cyclingActiveRef.current) {
|
|
26090
26386
|
cyclingActiveRef.current = true;
|
|
26091
26387
|
}
|
|
26092
26388
|
nextTextChangeWasUserInputRef.current = false;
|
|
@@ -26395,11 +26691,11 @@ function defaultRenderLine({
|
|
|
26395
26691
|
showCursor
|
|
26396
26692
|
}) {
|
|
26397
26693
|
if (!isOnCursorLine || !showCursor) {
|
|
26398
|
-
return /* @__PURE__ */
|
|
26694
|
+
return /* @__PURE__ */ jsx36(Text33, { children: lineText || " " });
|
|
26399
26695
|
}
|
|
26400
26696
|
const len = cpLen(lineText);
|
|
26401
26697
|
if (cursorCol >= len) {
|
|
26402
|
-
return /* @__PURE__ */
|
|
26698
|
+
return /* @__PURE__ */ jsxs29(Text33, { children: [
|
|
26403
26699
|
lineText,
|
|
26404
26700
|
chalk2.inverse(" ") + "\u200B"
|
|
26405
26701
|
] });
|
|
@@ -26407,7 +26703,7 @@ function defaultRenderLine({
|
|
|
26407
26703
|
const before = cpSlice(lineText, 0, cursorCol);
|
|
26408
26704
|
const cursorChar = cpSlice(lineText, cursorCol, cursorCol + 1);
|
|
26409
26705
|
const after = cpSlice(lineText, cursorCol + 1);
|
|
26410
|
-
return /* @__PURE__ */
|
|
26706
|
+
return /* @__PURE__ */ jsxs29(Text33, { children: [
|
|
26411
26707
|
before,
|
|
26412
26708
|
chalk2.inverse(cursorChar),
|
|
26413
26709
|
after
|
|
@@ -26530,15 +26826,15 @@ var BaseTextInput = ({
|
|
|
26530
26826
|
const [cursorVisualRow, cursorVisualCol] = buffer.visualCursor;
|
|
26531
26827
|
const scrollVisualRow = buffer.visualScrollRow;
|
|
26532
26828
|
const resolvedBorderColor = borderColor ?? theme.border.focused;
|
|
26533
|
-
const resolvedPrefix = prefix ?? /* @__PURE__ */
|
|
26829
|
+
const resolvedPrefix = prefix ?? /* @__PURE__ */ jsx36(Text33, { color: theme.text.accent, children: "> " });
|
|
26534
26830
|
const columns = process.stdout.columns || 80;
|
|
26535
26831
|
const labelWidth = topRightLabel ? stringWidth(topRightLabel) + 4 : 0;
|
|
26536
26832
|
const dashCount = Math.max(1, columns - labelWidth);
|
|
26537
26833
|
const topBorderLine = topRightLabel ? `${"\u2500".repeat(dashCount)} ${topRightLabel} ${"\u2500".repeat(2)}` : "\u2500".repeat(columns);
|
|
26538
|
-
return /* @__PURE__ */
|
|
26539
|
-
/* @__PURE__ */
|
|
26540
|
-
/* @__PURE__ */
|
|
26541
|
-
|
|
26834
|
+
return /* @__PURE__ */ jsxs29(Box30, { flexDirection: "column", children: [
|
|
26835
|
+
/* @__PURE__ */ jsx36(Text33, { color: resolvedBorderColor, wrap: "truncate-end", children: topBorderLine }),
|
|
26836
|
+
/* @__PURE__ */ jsxs29(
|
|
26837
|
+
Box30,
|
|
26542
26838
|
{
|
|
26543
26839
|
borderStyle: "single",
|
|
26544
26840
|
borderTop: false,
|
|
@@ -26548,13 +26844,13 @@ var BaseTextInput = ({
|
|
|
26548
26844
|
borderColor: resolvedBorderColor,
|
|
26549
26845
|
children: [
|
|
26550
26846
|
resolvedPrefix,
|
|
26551
|
-
/* @__PURE__ */
|
|
26847
|
+
/* @__PURE__ */ jsx36(Box30, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? showCursor ? /* @__PURE__ */ jsxs29(Text33, { children: [
|
|
26552
26848
|
chalk2.inverse(placeholder.slice(0, 1)),
|
|
26553
|
-
/* @__PURE__ */
|
|
26554
|
-
] }) : /* @__PURE__ */
|
|
26849
|
+
/* @__PURE__ */ jsx36(Text33, { color: theme.text.secondary, children: placeholder.slice(1) })
|
|
26850
|
+
] }) : /* @__PURE__ */ jsx36(Text33, { color: theme.text.secondary, children: placeholder }) : linesToRender.map((lineText, idx) => {
|
|
26555
26851
|
const absoluteVisualIndex = scrollVisualRow + idx;
|
|
26556
26852
|
const isOnCursorLine = absoluteVisualIndex === cursorVisualRow;
|
|
26557
|
-
return /* @__PURE__ */
|
|
26853
|
+
return /* @__PURE__ */ jsx36(Box30, { height: 1, children: renderLine({
|
|
26558
26854
|
lineText,
|
|
26559
26855
|
isOnCursorLine,
|
|
26560
26856
|
cursorCol: cursorVisualCol,
|
|
@@ -27518,7 +27814,7 @@ ${currentText}`);
|
|
|
27518
27814
|
}
|
|
27519
27815
|
const color = seg.type === "command" || seg.type === "file" ? theme.text.accent : theme.text.primary;
|
|
27520
27816
|
renderedLine.push(
|
|
27521
|
-
/* @__PURE__ */
|
|
27817
|
+
/* @__PURE__ */ jsx37(Text34, { color, children: display }, `token-${segIdx}`)
|
|
27522
27818
|
);
|
|
27523
27819
|
});
|
|
27524
27820
|
if (isOnCursorLine && cursorVisualColAbsolute === cpLen(lineText)) {
|
|
@@ -27526,31 +27822,31 @@ ${currentText}`);
|
|
|
27526
27822
|
if (ghostText && showCursorOpt && ghostText.text.length > 0) {
|
|
27527
27823
|
if (ghostText.showCursorBeforeText) {
|
|
27528
27824
|
renderedLine.push(
|
|
27529
|
-
/* @__PURE__ */
|
|
27825
|
+
/* @__PURE__ */ jsx37(Text34, { children: chalk3.inverse(" ") }, "ghost-cursor")
|
|
27530
27826
|
);
|
|
27531
27827
|
renderedLine.push(
|
|
27532
|
-
/* @__PURE__ */
|
|
27828
|
+
/* @__PURE__ */ jsx37(Text34, { color: theme.text.secondary, children: ghostText.text }, "ghost-rest")
|
|
27533
27829
|
);
|
|
27534
27830
|
} else {
|
|
27535
27831
|
const firstChar = ghostText.text[0];
|
|
27536
27832
|
const rest = ghostText.text.slice(firstChar.length);
|
|
27537
27833
|
renderedLine.push(
|
|
27538
|
-
/* @__PURE__ */
|
|
27834
|
+
/* @__PURE__ */ jsx37(Text34, { children: chalk3.inverse(firstChar) }, "ghost-cursor")
|
|
27539
27835
|
);
|
|
27540
27836
|
if (rest.length > 0) {
|
|
27541
27837
|
renderedLine.push(
|
|
27542
|
-
/* @__PURE__ */
|
|
27838
|
+
/* @__PURE__ */ jsx37(Text34, { color: theme.text.secondary, children: rest }, "ghost-rest")
|
|
27543
27839
|
);
|
|
27544
27840
|
}
|
|
27545
27841
|
}
|
|
27546
|
-
renderedLine.push(/* @__PURE__ */
|
|
27842
|
+
renderedLine.push(/* @__PURE__ */ jsx37(Text34, { children: `\u200B` }, "ghost-zwsp"));
|
|
27547
27843
|
} else {
|
|
27548
27844
|
renderedLine.push(
|
|
27549
|
-
/* @__PURE__ */
|
|
27845
|
+
/* @__PURE__ */ jsx37(Text34, { children: showCursorOpt ? chalk3.inverse(" ") + "\u200B" : " \u200B" }, `cursor-end-${cursorVisualColAbsolute}`)
|
|
27550
27846
|
);
|
|
27551
27847
|
}
|
|
27552
27848
|
}
|
|
27553
|
-
return /* @__PURE__ */
|
|
27849
|
+
return /* @__PURE__ */ jsx37(Text34, { children: renderedLine });
|
|
27554
27850
|
},
|
|
27555
27851
|
[slashCommands]
|
|
27556
27852
|
);
|
|
@@ -27591,25 +27887,25 @@ ${currentText}`);
|
|
|
27591
27887
|
statusText = t("Accepting edits");
|
|
27592
27888
|
}
|
|
27593
27889
|
const borderColor = isShellFocused && !isEmbeddedShellFocused && !agentTabBarFocused ? statusColor2 ?? theme.border.focused : theme.border.default;
|
|
27594
|
-
const prefixNode = /* @__PURE__ */
|
|
27595
|
-
|
|
27890
|
+
const prefixNode = /* @__PURE__ */ jsxs30(
|
|
27891
|
+
Text34,
|
|
27596
27892
|
{
|
|
27597
27893
|
color: statusColor2 ?? theme.text.accent,
|
|
27598
27894
|
"aria-label": statusText || void 0,
|
|
27599
27895
|
children: [
|
|
27600
|
-
shellModeActive ? reverseSearchActive ? /* @__PURE__ */
|
|
27896
|
+
shellModeActive ? reverseSearchActive ? /* @__PURE__ */ jsxs30(Text34, { color: theme.text.link, "aria-label": SCREEN_READER_USER_PREFIX, children: [
|
|
27601
27897
|
"(r:)",
|
|
27602
27898
|
" "
|
|
27603
|
-
] }) : "!" : commandSearchActive ? /* @__PURE__ */
|
|
27899
|
+
] }) : "!" : commandSearchActive ? /* @__PURE__ */ jsx37(Text34, { color: theme.text.accent, children: "(r:) " }) : showYoloStyling ? "*" : ">",
|
|
27604
27900
|
" "
|
|
27605
27901
|
]
|
|
27606
27902
|
}
|
|
27607
27903
|
);
|
|
27608
|
-
return /* @__PURE__ */
|
|
27609
|
-
attachments.length > 0 && /* @__PURE__ */
|
|
27610
|
-
/* @__PURE__ */
|
|
27611
|
-
attachments.map((att, idx) => /* @__PURE__ */
|
|
27612
|
-
|
|
27904
|
+
return /* @__PURE__ */ jsxs30(Fragment8, { children: [
|
|
27905
|
+
attachments.length > 0 && /* @__PURE__ */ jsxs30(Box31, { marginLeft: 2, marginBottom: 0, children: [
|
|
27906
|
+
/* @__PURE__ */ jsx37(Text34, { color: theme.text.secondary, children: t("Attachments: ") }),
|
|
27907
|
+
attachments.map((att, idx) => /* @__PURE__ */ jsxs30(
|
|
27908
|
+
Text34,
|
|
27613
27909
|
{
|
|
27614
27910
|
color: isAttachmentMode && idx === selectedAttachmentIndex ? theme.status.success : theme.text.secondary,
|
|
27615
27911
|
children: [
|
|
@@ -27622,7 +27918,7 @@ ${currentText}`);
|
|
|
27622
27918
|
att.id
|
|
27623
27919
|
))
|
|
27624
27920
|
] }),
|
|
27625
|
-
/* @__PURE__ */
|
|
27921
|
+
/* @__PURE__ */ jsx37(
|
|
27626
27922
|
BaseTextInput,
|
|
27627
27923
|
{
|
|
27628
27924
|
buffer,
|
|
@@ -27637,7 +27933,7 @@ ${currentText}`);
|
|
|
27637
27933
|
renderLine: renderLineWithHighlighting
|
|
27638
27934
|
}
|
|
27639
27935
|
),
|
|
27640
|
-
shouldShowSuggestions && /* @__PURE__ */
|
|
27936
|
+
shouldShowSuggestions && /* @__PURE__ */ jsx37(Box31, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsx37(
|
|
27641
27937
|
SuggestionsDisplay,
|
|
27642
27938
|
{
|
|
27643
27939
|
suggestions: suggestionDisplayProps.suggestions,
|
|
@@ -27650,7 +27946,7 @@ ${currentText}`);
|
|
|
27650
27946
|
expandedIndex: expandedSuggestionIndex
|
|
27651
27947
|
}
|
|
27652
27948
|
) }),
|
|
27653
|
-
attachments.length > 0 && !shouldShowSuggestions && /* @__PURE__ */
|
|
27949
|
+
attachments.length > 0 && !shouldShowSuggestions && /* @__PURE__ */ jsx37(Box31, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsx37(Text34, { color: theme.text.secondary, children: isAttachmentMode ? t("\u2190 \u2192 select, Delete to remove, \u2193 to exit") : t("\u2191 to manage attachments") }) })
|
|
27654
27950
|
] });
|
|
27655
27951
|
};
|
|
27656
27952
|
function formatPercentageUsed(percentage) {
|
|
@@ -27672,12 +27968,12 @@ var ContextUsageDisplay = ({
|
|
|
27672
27968
|
const isOverLimit = percentage > 1;
|
|
27673
27969
|
const label = terminalWidth < 100 ? t("% used") : t("% context used");
|
|
27674
27970
|
if (isOverLimit) {
|
|
27675
|
-
return /* @__PURE__ */
|
|
27971
|
+
return /* @__PURE__ */ jsx38(Fragment9, { children: /* @__PURE__ */ jsxs31(Text35, { color: theme.status.error, children: [
|
|
27676
27972
|
percentageUsed,
|
|
27677
27973
|
label
|
|
27678
27974
|
] }) });
|
|
27679
27975
|
}
|
|
27680
|
-
return /* @__PURE__ */
|
|
27976
|
+
return /* @__PURE__ */ jsxs31(Text35, { color: theme.text.secondary, children: [
|
|
27681
27977
|
percentageUsed,
|
|
27682
27978
|
label
|
|
27683
27979
|
] });
|
|
@@ -27709,20 +28005,20 @@ var AutoAcceptIndicator = ({
|
|
|
27709
28005
|
default:
|
|
27710
28006
|
break;
|
|
27711
28007
|
}
|
|
27712
|
-
return /* @__PURE__ */
|
|
28008
|
+
return /* @__PURE__ */ jsxs32(Text36, { color: textColor, children: [
|
|
27713
28009
|
textContent,
|
|
27714
|
-
subText && /* @__PURE__ */
|
|
28010
|
+
subText && /* @__PURE__ */ jsx39(Text36, { color: theme.text.secondary, children: subText })
|
|
27715
28011
|
] });
|
|
27716
28012
|
};
|
|
27717
|
-
var ShellModeIndicator = () => /* @__PURE__ */
|
|
28013
|
+
var ShellModeIndicator = () => /* @__PURE__ */ jsxs33(Text37, { color: theme.ui.symbol, children: [
|
|
27718
28014
|
"shell mode enabled",
|
|
27719
|
-
/* @__PURE__ */
|
|
28015
|
+
/* @__PURE__ */ jsx40(Text37, { color: theme.text.secondary, children: " (esc to disable)" })
|
|
27720
28016
|
] });
|
|
27721
28017
|
function BackgroundTasksPill() {
|
|
27722
28018
|
const { activeSubagents } = useUIState();
|
|
27723
28019
|
const running = activeSubagents.filter((s) => s.status === "running").length;
|
|
27724
28020
|
if (running <= 0) return null;
|
|
27725
|
-
return /* @__PURE__ */
|
|
28021
|
+
return /* @__PURE__ */ jsxs34(Text38, { color: theme.text.accent, children: [
|
|
27726
28022
|
" ",
|
|
27727
28023
|
running,
|
|
27728
28024
|
" task",
|
|
@@ -27733,32 +28029,36 @@ function MCPHealthPill() {
|
|
|
27733
28029
|
const { mcpConnected, mcpTotal } = useUIState();
|
|
27734
28030
|
if (mcpTotal === 0) return null;
|
|
27735
28031
|
const color = mcpConnected === mcpTotal ? theme.status.success : theme.status.warning;
|
|
27736
|
-
return /* @__PURE__ */
|
|
28032
|
+
return /* @__PURE__ */ jsxs35(Text39, { color, children: [
|
|
27737
28033
|
" MCP ",
|
|
27738
28034
|
mcpConnected,
|
|
27739
28035
|
"/",
|
|
27740
28036
|
mcpTotal
|
|
27741
28037
|
] });
|
|
27742
28038
|
}
|
|
28039
|
+
var GIT_POLL_INTERVAL_MS = 3e4;
|
|
27743
28040
|
function useStatusLine() {
|
|
27744
28041
|
const config = useConfig();
|
|
27745
28042
|
const cwd = config.getWorkingDir();
|
|
27746
|
-
const [
|
|
28043
|
+
const [branch, setBranch] = useState222(null);
|
|
27747
28044
|
useEffect24(() => {
|
|
27748
|
-
let
|
|
27749
|
-
|
|
27750
|
-
|
|
27751
|
-
|
|
27752
|
-
|
|
27753
|
-
|
|
27754
|
-
|
|
27755
|
-
|
|
27756
|
-
});
|
|
28045
|
+
let alive = true;
|
|
28046
|
+
function poll() {
|
|
28047
|
+
execFile22("git", ["branch", "--show-current"], { cwd }, (err, stdout) => {
|
|
28048
|
+
if (alive) setBranch(err ? null : stdout.trim() || null);
|
|
28049
|
+
});
|
|
28050
|
+
}
|
|
28051
|
+
poll();
|
|
28052
|
+
const timer = setInterval(poll, GIT_POLL_INTERVAL_MS);
|
|
27757
28053
|
return () => {
|
|
27758
|
-
|
|
28054
|
+
alive = false;
|
|
28055
|
+
clearInterval(timer);
|
|
27759
28056
|
};
|
|
27760
28057
|
}, [cwd]);
|
|
27761
|
-
return { lines:
|
|
28058
|
+
if (!branch) return { lines: [] };
|
|
28059
|
+
const home = os5.homedir();
|
|
28060
|
+
const displayCwd = cwd.startsWith(home) ? `~${cwd.slice(home.length)}` : cwd;
|
|
28061
|
+
return { lines: [`${displayCwd} [${branch}]`] };
|
|
27762
28062
|
}
|
|
27763
28063
|
function useConfigInitMessage(_isConfigInitialized) {
|
|
27764
28064
|
return null;
|
|
@@ -27778,7 +28078,7 @@ var VimModeProvider = ({
|
|
|
27778
28078
|
setVimMode(next ? "NORMAL" : "INSERT");
|
|
27779
28079
|
return next;
|
|
27780
28080
|
}, [vimEnabled]);
|
|
27781
|
-
return /* @__PURE__ */
|
|
28081
|
+
return /* @__PURE__ */ jsx41(
|
|
27782
28082
|
VimModeContext.Provider,
|
|
27783
28083
|
{
|
|
27784
28084
|
value: { vimEnabled, vimMode, toggleVimEnabled, setVimMode },
|
|
@@ -27810,16 +28110,16 @@ var Footer = () => {
|
|
|
27810
28110
|
const debugMode = config.getDebugMode();
|
|
27811
28111
|
const contextWindowSize = config.getContentGeneratorConfig()?.contextWindowSize;
|
|
27812
28112
|
const suppressHint = statusLineLines.length > 0;
|
|
27813
|
-
const leftBottomContent = uiState.ctrlCPressedOnce ? /* @__PURE__ */
|
|
27814
|
-
/* @__PURE__ */
|
|
28113
|
+
const leftBottomContent = uiState.ctrlCPressedOnce ? /* @__PURE__ */ jsx42(Text40, { color: theme.status.warning, children: t("Press Ctrl+C again to exit.") }) : uiState.ctrlDPressedOnce ? /* @__PURE__ */ jsx42(Text40, { color: theme.status.warning, children: t("Press Ctrl+D again to exit.") }) : uiState.showEscapePrompt ? /* @__PURE__ */ jsx42(Text40, { color: theme.text.secondary, children: t("Press Esc again to clear.") }) : uiState.rewindEscPending ? /* @__PURE__ */ jsx42(Text40, { color: theme.text.secondary, children: t("Press Esc again to rewind conversation.") }) : vimEnabled && vimMode === "INSERT" ? /* @__PURE__ */ jsx42(Text40, { color: theme.text.secondary, children: "-- INSERT --" }) : uiState.shellModeActive ? /* @__PURE__ */ jsx42(ShellModeIndicator, {}) : configInitMessage ? /* @__PURE__ */ jsxs36(Text40, { color: theme.text.secondary, children: [
|
|
28114
|
+
/* @__PURE__ */ jsx42(GeminiSpinner, {}),
|
|
27815
28115
|
" ",
|
|
27816
28116
|
configInitMessage
|
|
27817
|
-
] }) : showAutoAcceptIndicator !== void 0 && showAutoAcceptIndicator !== "default" ? /* @__PURE__ */
|
|
28117
|
+
] }) : showAutoAcceptIndicator !== void 0 && showAutoAcceptIndicator !== "default" ? /* @__PURE__ */ jsx42(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator }) : suppressHint ? null : /* @__PURE__ */ jsx42(Text40, { color: theme.text.secondary, children: t("? for shortcuts") });
|
|
27818
28118
|
const rightItems = [];
|
|
27819
28119
|
if (sandboxInfo) {
|
|
27820
28120
|
rightItems.push({
|
|
27821
28121
|
key: "sandbox",
|
|
27822
|
-
node: /* @__PURE__ */
|
|
28122
|
+
node: /* @__PURE__ */ jsxs36(Text40, { color: theme.status.success, children: [
|
|
27823
28123
|
"\u{1F512} ",
|
|
27824
28124
|
sandboxInfo
|
|
27825
28125
|
] })
|
|
@@ -27828,13 +28128,13 @@ var Footer = () => {
|
|
|
27828
28128
|
if (debugMode) {
|
|
27829
28129
|
rightItems.push({
|
|
27830
28130
|
key: "debug",
|
|
27831
|
-
node: /* @__PURE__ */
|
|
28131
|
+
node: /* @__PURE__ */ jsx42(Text40, { color: theme.status.warning, children: "Debug Mode" })
|
|
27832
28132
|
});
|
|
27833
28133
|
}
|
|
27834
28134
|
if (promptTokenCount > 0 && contextWindowSize) {
|
|
27835
28135
|
rightItems.push({
|
|
27836
28136
|
key: "context",
|
|
27837
|
-
node: /* @__PURE__ */
|
|
28137
|
+
node: /* @__PURE__ */ jsx42(Text40, { color: theme.text.accent, children: /* @__PURE__ */ jsx42(
|
|
27838
28138
|
ContextUsageDisplay,
|
|
27839
28139
|
{
|
|
27840
28140
|
promptTokenCount,
|
|
@@ -27844,8 +28144,8 @@ var Footer = () => {
|
|
|
27844
28144
|
) })
|
|
27845
28145
|
});
|
|
27846
28146
|
}
|
|
27847
|
-
return /* @__PURE__ */
|
|
27848
|
-
|
|
28147
|
+
return /* @__PURE__ */ jsxs36(
|
|
28148
|
+
Box32,
|
|
27849
28149
|
{
|
|
27850
28150
|
flexDirection: isNarrow ? "column" : "row",
|
|
27851
28151
|
justifyContent: isNarrow ? "flex-start" : "space-between",
|
|
@@ -27853,16 +28153,16 @@ var Footer = () => {
|
|
|
27853
28153
|
paddingX: 2,
|
|
27854
28154
|
gap: isNarrow ? 0 : 1,
|
|
27855
28155
|
children: [
|
|
27856
|
-
/* @__PURE__ */
|
|
27857
|
-
statusLineLines.length > 0 && !uiState.ctrlCPressedOnce && !uiState.ctrlDPressedOnce && statusLineLines.map((line, i) => /* @__PURE__ */
|
|
27858
|
-
/* @__PURE__ */
|
|
27859
|
-
/* @__PURE__ */
|
|
27860
|
-
/* @__PURE__ */
|
|
27861
|
-
/* @__PURE__ */
|
|
28156
|
+
/* @__PURE__ */ jsxs36(Box32, { flexDirection: "column", flexShrink: isNarrow ? 0 : 1, children: [
|
|
28157
|
+
statusLineLines.length > 0 && !uiState.ctrlCPressedOnce && !uiState.ctrlDPressedOnce && statusLineLines.map((line, i) => /* @__PURE__ */ jsx42(Text40, { dimColor: true, wrap: "truncate", children: line }, `status-line-${i}`)),
|
|
28158
|
+
/* @__PURE__ */ jsxs36(Box32, { flexDirection: "row", flexShrink: 1, children: [
|
|
28159
|
+
/* @__PURE__ */ jsx42(Text40, { wrap: "truncate", children: leftBottomContent }),
|
|
28160
|
+
/* @__PURE__ */ jsx42(BackgroundTasksPill, {}),
|
|
28161
|
+
/* @__PURE__ */ jsx42(MCPHealthPill, {})
|
|
27862
28162
|
] })
|
|
27863
28163
|
] }),
|
|
27864
|
-
/* @__PURE__ */
|
|
27865
|
-
index > 0 && /* @__PURE__ */
|
|
28164
|
+
/* @__PURE__ */ jsx42(Box32, { flexShrink: 0, gap: 1, alignItems: "flex-start", children: rightItems.map(({ key, node }, index) => /* @__PURE__ */ jsxs36(Box32, { alignItems: "center", children: [
|
|
28165
|
+
index > 0 && /* @__PURE__ */ jsx42(Text40, { color: theme.text.secondary, children: " | " }),
|
|
27866
28166
|
node
|
|
27867
28167
|
] }, key)) })
|
|
27868
28168
|
]
|
|
@@ -27885,17 +28185,17 @@ var QueuedMessageDisplay = ({
|
|
|
27885
28185
|
wasEmptyRef.current = false;
|
|
27886
28186
|
}
|
|
27887
28187
|
const showHint = hintSeenCountRef.current <= NUM_TIMES_QUEUE_HINT_SHOWN;
|
|
27888
|
-
return /* @__PURE__ */
|
|
28188
|
+
return /* @__PURE__ */ jsxs37(Box33, { flexDirection: "column", marginTop: 1, children: [
|
|
27889
28189
|
messageQueue.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message, index) => {
|
|
27890
28190
|
const preview = message.replace(/\s+/g, " ");
|
|
27891
|
-
return /* @__PURE__ */
|
|
28191
|
+
return /* @__PURE__ */ jsx43(Box33, { paddingLeft: 2, width: "100%", children: /* @__PURE__ */ jsx43(Text41, { dimColor: true, wrap: "truncate", children: preview }) }, index);
|
|
27892
28192
|
}),
|
|
27893
|
-
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */
|
|
28193
|
+
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ jsx43(Box33, { paddingLeft: 2, children: /* @__PURE__ */ jsxs37(Text41, { dimColor: true, children: [
|
|
27894
28194
|
"... (+",
|
|
27895
28195
|
messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES,
|
|
27896
28196
|
" more)"
|
|
27897
28197
|
] }) }),
|
|
27898
|
-
showHint && /* @__PURE__ */
|
|
28198
|
+
showHint && /* @__PURE__ */ jsx43(Box33, { paddingLeft: 2, children: /* @__PURE__ */ jsx43(Text41, { dimColor: true, italic: true, children: t("Press \u2191 to edit queued messages") }) })
|
|
27899
28199
|
] });
|
|
27900
28200
|
};
|
|
27901
28201
|
var getNewlineKey = () => process.platform === "win32" ? "ctrl+enter" : "ctrl+j";
|
|
@@ -27923,8 +28223,8 @@ var getShortcuts = () => [
|
|
|
27923
28223
|
{ key: getExternalEditorKey(), description: t("for external editor") },
|
|
27924
28224
|
{ key: "ctrl+o", description: t("to toggle compact mode") }
|
|
27925
28225
|
];
|
|
27926
|
-
var ShortcutItem = ({ shortcut }) => /* @__PURE__ */
|
|
27927
|
-
/* @__PURE__ */
|
|
28226
|
+
var ShortcutItem = ({ shortcut }) => /* @__PURE__ */ jsxs38(Text42, { color: theme.text.secondary, children: [
|
|
28227
|
+
/* @__PURE__ */ jsx44(Text42, { color: theme.text.accent, children: shortcut.key }),
|
|
27928
28228
|
" ",
|
|
27929
28229
|
shortcut.description
|
|
27930
28230
|
] });
|
|
@@ -27965,18 +28265,18 @@ var KeyboardShortcuts = () => {
|
|
|
27965
28265
|
columns.push(shortcuts.slice(startIndex, startIndex + count));
|
|
27966
28266
|
startIndex += count;
|
|
27967
28267
|
}
|
|
27968
|
-
return /* @__PURE__ */
|
|
27969
|
-
|
|
28268
|
+
return /* @__PURE__ */ jsx44(
|
|
28269
|
+
Box34,
|
|
27970
28270
|
{
|
|
27971
28271
|
flexDirection: "row",
|
|
27972
28272
|
marginLeft: MARGIN_LEFT,
|
|
27973
28273
|
marginRight: MARGIN_RIGHT,
|
|
27974
|
-
children: columns.map((column, colIndex) => /* @__PURE__ */
|
|
27975
|
-
|
|
28274
|
+
children: columns.map((column, colIndex) => /* @__PURE__ */ jsx44(
|
|
28275
|
+
Box34,
|
|
27976
28276
|
{
|
|
27977
28277
|
flexDirection: "column",
|
|
27978
28278
|
marginRight: colIndex < numColumns - 1 ? COLUMN_GAP : 0,
|
|
27979
|
-
children: column.map((shortcut) => /* @__PURE__ */
|
|
28279
|
+
children: column.map((shortcut) => /* @__PURE__ */ jsx44(ShortcutItem, { shortcut }, shortcut.key))
|
|
27980
28280
|
},
|
|
27981
28281
|
colIndex
|
|
27982
28282
|
))
|
|
@@ -28020,8 +28320,8 @@ var Composer = () => {
|
|
|
28020
28320
|
},
|
|
28021
28321
|
[uiActions]
|
|
28022
28322
|
);
|
|
28023
|
-
return /* @__PURE__ */
|
|
28024
|
-
!uiState.embeddedShellFocused && !suppressBottomLoadingIndicator && /* @__PURE__ */
|
|
28323
|
+
return /* @__PURE__ */ jsxs39(Box35, { flexDirection: "column", marginTop: 1, children: [
|
|
28324
|
+
!uiState.embeddedShellFocused && !suppressBottomLoadingIndicator && /* @__PURE__ */ jsx45(
|
|
28025
28325
|
LoadingIndicator,
|
|
28026
28326
|
{
|
|
28027
28327
|
thought: uiState.streamingState === "waiting_for_confirmation" || config.getAccessibility()?.enableLoadingPhrases === false ? void 0 : uiState.thought,
|
|
@@ -28033,13 +28333,13 @@ var Composer = () => {
|
|
|
28033
28333
|
isReceivingContent
|
|
28034
28334
|
}
|
|
28035
28335
|
),
|
|
28036
|
-
!uiState.embeddedShellFocused && suppressBottomLoadingIndicator && /* @__PURE__ */
|
|
28336
|
+
!uiState.embeddedShellFocused && suppressBottomLoadingIndicator && /* @__PURE__ */ jsx45(Box35, { paddingLeft: 2, children: /* @__PURE__ */ jsxs39(Text43, { color: theme.text.secondary, children: [
|
|
28037
28337
|
"(",
|
|
28038
28338
|
t("Esc to cancel"),
|
|
28039
28339
|
")"
|
|
28040
28340
|
] }) }),
|
|
28041
|
-
/* @__PURE__ */
|
|
28042
|
-
uiState.isInputActive && /* @__PURE__ */
|
|
28341
|
+
/* @__PURE__ */ jsx45(QueuedMessageDisplay, { messageQueue: uiState.messageQueue }),
|
|
28342
|
+
uiState.isInputActive && /* @__PURE__ */ jsx45(
|
|
28043
28343
|
InputPrompt,
|
|
28044
28344
|
{
|
|
28045
28345
|
buffer: uiState.buffer,
|
|
@@ -28067,9 +28367,118 @@ var Composer = () => {
|
|
|
28067
28367
|
onPromptSuggestionDismiss: uiState.dismissPromptSuggestion
|
|
28068
28368
|
}
|
|
28069
28369
|
),
|
|
28070
|
-
uiState.isInputActive && !showSuggestions && (showShortcuts ? /* @__PURE__ */
|
|
28370
|
+
uiState.isInputActive && !showSuggestions && (showShortcuts ? /* @__PURE__ */ jsx45(KeyboardShortcuts, {}) : !isScreenReaderEnabled && /* @__PURE__ */ jsx45(Footer, {}))
|
|
28071
28371
|
] });
|
|
28072
28372
|
};
|
|
28373
|
+
var AppContext = createContext9(null);
|
|
28374
|
+
var Notifications = () => {
|
|
28375
|
+
const appCtx = useContext11(AppContext);
|
|
28376
|
+
const warnings = appCtx?.startupWarnings ?? [];
|
|
28377
|
+
if (warnings.length === 0) return null;
|
|
28378
|
+
return /* @__PURE__ */ jsx46(
|
|
28379
|
+
Box36,
|
|
28380
|
+
{
|
|
28381
|
+
flexDirection: "column",
|
|
28382
|
+
marginLeft: 2,
|
|
28383
|
+
marginRight: 2,
|
|
28384
|
+
marginBottom: 1,
|
|
28385
|
+
children: /* @__PURE__ */ jsx46(
|
|
28386
|
+
Box36,
|
|
28387
|
+
{
|
|
28388
|
+
borderStyle: "round",
|
|
28389
|
+
borderColor: theme.status.warning,
|
|
28390
|
+
paddingX: 1,
|
|
28391
|
+
flexDirection: "column",
|
|
28392
|
+
children: warnings.map((w, i) => /* @__PURE__ */ jsxs40(Text44, { color: theme.status.warning, children: [
|
|
28393
|
+
"\u26A0 ",
|
|
28394
|
+
w
|
|
28395
|
+
] }, i))
|
|
28396
|
+
}
|
|
28397
|
+
)
|
|
28398
|
+
}
|
|
28399
|
+
);
|
|
28400
|
+
};
|
|
28401
|
+
function tildeify(p) {
|
|
28402
|
+
const home = os6.homedir();
|
|
28403
|
+
return p.startsWith(home) ? `~${p.slice(home.length)}` : p;
|
|
28404
|
+
}
|
|
28405
|
+
function statusLabel(state) {
|
|
28406
|
+
switch (state) {
|
|
28407
|
+
case "responding":
|
|
28408
|
+
return { text: "running", color: theme.status.success };
|
|
28409
|
+
case "waiting_for_confirmation":
|
|
28410
|
+
return { text: "awaiting approval", color: theme.status.warning };
|
|
28411
|
+
default:
|
|
28412
|
+
return { text: "idle", color: theme.text.secondary };
|
|
28413
|
+
}
|
|
28414
|
+
}
|
|
28415
|
+
function fmt(n) {
|
|
28416
|
+
if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
|
|
28417
|
+
if (n >= 1e3) return `${(n / 1e3).toFixed(1)}k`;
|
|
28418
|
+
return String(n);
|
|
28419
|
+
}
|
|
28420
|
+
var AppHeader = ({
|
|
28421
|
+
version,
|
|
28422
|
+
cwd,
|
|
28423
|
+
providerLabel,
|
|
28424
|
+
mode,
|
|
28425
|
+
iterationInfo
|
|
28426
|
+
}) => {
|
|
28427
|
+
const {
|
|
28428
|
+
streamingState,
|
|
28429
|
+
sessionStats: { lastPromptTokenCount, lastOutputTokenCount },
|
|
28430
|
+
terminalWidth
|
|
28431
|
+
} = useUIState();
|
|
28432
|
+
const status = statusLabel(streamingState);
|
|
28433
|
+
const displayDir = tildeify(cwd);
|
|
28434
|
+
const hasTokens = lastPromptTokenCount > 0;
|
|
28435
|
+
return /* @__PURE__ */ jsxs41(
|
|
28436
|
+
Box37,
|
|
28437
|
+
{
|
|
28438
|
+
flexDirection: "column",
|
|
28439
|
+
marginLeft: 2,
|
|
28440
|
+
marginRight: 2,
|
|
28441
|
+
marginTop: 1,
|
|
28442
|
+
marginBottom: 1,
|
|
28443
|
+
children: [
|
|
28444
|
+
/* @__PURE__ */ jsxs41(Box37, { flexDirection: "row", flexWrap: "nowrap", width: terminalWidth - 4, children: [
|
|
28445
|
+
/* @__PURE__ */ jsx47(Text45, { bold: true, color: theme.text.accent, children: "DeepCode" }),
|
|
28446
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.secondary, children: ` v${version}` }),
|
|
28447
|
+
providerLabel && /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
28448
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.secondary, children: " " }),
|
|
28449
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.primary, children: providerLabel })
|
|
28450
|
+
] }),
|
|
28451
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.secondary, children: " " }),
|
|
28452
|
+
/* @__PURE__ */ jsx47(
|
|
28453
|
+
Text45,
|
|
28454
|
+
{
|
|
28455
|
+
bold: true,
|
|
28456
|
+
color: mode === "build" ? theme.status.success : theme.status.warning,
|
|
28457
|
+
children: mode.toUpperCase()
|
|
28458
|
+
}
|
|
28459
|
+
),
|
|
28460
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.secondary, children: " " }),
|
|
28461
|
+
/* @__PURE__ */ jsx47(Text45, { color: status.color, children: status.text }),
|
|
28462
|
+
iterationInfo && /* @__PURE__ */ jsxs41(Text45, { color: theme.text.secondary, children: [
|
|
28463
|
+
" ",
|
|
28464
|
+
"iter ",
|
|
28465
|
+
iterationInfo.round,
|
|
28466
|
+
"/",
|
|
28467
|
+
iterationInfo.max
|
|
28468
|
+
] }),
|
|
28469
|
+
hasTokens && /* @__PURE__ */ jsxs41(Text45, { color: theme.text.secondary, children: [
|
|
28470
|
+
" ",
|
|
28471
|
+
"\u2191",
|
|
28472
|
+
fmt(lastPromptTokenCount),
|
|
28473
|
+
" \u2193",
|
|
28474
|
+
fmt(lastOutputTokenCount)
|
|
28475
|
+
] })
|
|
28476
|
+
] }),
|
|
28477
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.secondary, dimColor: true, children: displayDir })
|
|
28478
|
+
]
|
|
28479
|
+
}
|
|
28480
|
+
);
|
|
28481
|
+
};
|
|
28073
28482
|
async function diffAction(context) {
|
|
28074
28483
|
const { config } = context.services;
|
|
28075
28484
|
if (!config) {
|
|
@@ -28256,6 +28665,228 @@ var diffCommand = {
|
|
|
28256
28665
|
supportedModes: ["interactive", "non_interactive", "acp"],
|
|
28257
28666
|
action: diffAction
|
|
28258
28667
|
};
|
|
28668
|
+
var EXPORT_FORMATS = ["markdown", "json"];
|
|
28669
|
+
function formatTimestamp(iso) {
|
|
28670
|
+
try {
|
|
28671
|
+
return new Date(iso).toLocaleString();
|
|
28672
|
+
} catch {
|
|
28673
|
+
return iso;
|
|
28674
|
+
}
|
|
28675
|
+
}
|
|
28676
|
+
function toMarkdown({ messages, cwd, model }) {
|
|
28677
|
+
const lines = [];
|
|
28678
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
28679
|
+
lines.push(`# DeepCode Session Export`);
|
|
28680
|
+
lines.push(``);
|
|
28681
|
+
lines.push(`**Exported:** ${formatTimestamp(now)}`);
|
|
28682
|
+
lines.push(`**Directory:** ${cwd}`);
|
|
28683
|
+
if (model) lines.push(`**Model:** ${model}`);
|
|
28684
|
+
lines.push(``);
|
|
28685
|
+
lines.push(`---`);
|
|
28686
|
+
lines.push(``);
|
|
28687
|
+
for (const msg of messages) {
|
|
28688
|
+
if (msg.source === "ui" || msg.source === "agent_internal") continue;
|
|
28689
|
+
if (msg.role === "system") {
|
|
28690
|
+
lines.push(`> *[system]*`);
|
|
28691
|
+
lines.push(``);
|
|
28692
|
+
continue;
|
|
28693
|
+
}
|
|
28694
|
+
if (msg.role === "user") {
|
|
28695
|
+
lines.push(`## User`);
|
|
28696
|
+
lines.push(``);
|
|
28697
|
+
lines.push(msg.content);
|
|
28698
|
+
lines.push(``);
|
|
28699
|
+
continue;
|
|
28700
|
+
}
|
|
28701
|
+
if (msg.role === "assistant") {
|
|
28702
|
+
lines.push(`## Assistant`);
|
|
28703
|
+
lines.push(``);
|
|
28704
|
+
if (msg.toolCalls && msg.toolCalls.length > 0) {
|
|
28705
|
+
for (const call of msg.toolCalls) {
|
|
28706
|
+
lines.push(`**Tool:** \`${call.name}\``);
|
|
28707
|
+
lines.push(``);
|
|
28708
|
+
try {
|
|
28709
|
+
lines.push("```json");
|
|
28710
|
+
lines.push(JSON.stringify(call.arguments, null, 2));
|
|
28711
|
+
lines.push("```");
|
|
28712
|
+
} catch {
|
|
28713
|
+
lines.push(String(call.arguments));
|
|
28714
|
+
}
|
|
28715
|
+
lines.push(``);
|
|
28716
|
+
}
|
|
28717
|
+
}
|
|
28718
|
+
if (msg.content) {
|
|
28719
|
+
lines.push(msg.content);
|
|
28720
|
+
lines.push(``);
|
|
28721
|
+
}
|
|
28722
|
+
continue;
|
|
28723
|
+
}
|
|
28724
|
+
if (msg.role === "tool") {
|
|
28725
|
+
lines.push(`*[tool result]*`);
|
|
28726
|
+
lines.push(``);
|
|
28727
|
+
const preview = msg.content.slice(0, 500);
|
|
28728
|
+
lines.push("```");
|
|
28729
|
+
lines.push(preview + (msg.content.length > 500 ? "\n\u2026" : ""));
|
|
28730
|
+
lines.push("```");
|
|
28731
|
+
lines.push(``);
|
|
28732
|
+
continue;
|
|
28733
|
+
}
|
|
28734
|
+
}
|
|
28735
|
+
return lines.join("\n");
|
|
28736
|
+
}
|
|
28737
|
+
function toJson({ messages, cwd, model }) {
|
|
28738
|
+
const exportable = messages.filter(
|
|
28739
|
+
(m) => m.source !== "ui" && m.source !== "agent_internal"
|
|
28740
|
+
);
|
|
28741
|
+
return JSON.stringify(
|
|
28742
|
+
{
|
|
28743
|
+
exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
28744
|
+
cwd,
|
|
28745
|
+
model,
|
|
28746
|
+
messages: exportable
|
|
28747
|
+
},
|
|
28748
|
+
null,
|
|
28749
|
+
2
|
|
28750
|
+
);
|
|
28751
|
+
}
|
|
28752
|
+
function generateFilename(format, cwd) {
|
|
28753
|
+
const dirName = path142.basename(cwd);
|
|
28754
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
28755
|
+
const ext = format === "markdown" ? "md" : "json";
|
|
28756
|
+
return `deepcode-${dirName}-${ts}.${ext}`;
|
|
28757
|
+
}
|
|
28758
|
+
async function exportSession(opts) {
|
|
28759
|
+
const content = opts.format === "markdown" ? toMarkdown(opts) : toJson(opts);
|
|
28760
|
+
const downloadsDir = path142.join(os7.homedir(), "Downloads");
|
|
28761
|
+
let outputDir = opts.cwd;
|
|
28762
|
+
try {
|
|
28763
|
+
await fs7.access(downloadsDir);
|
|
28764
|
+
outputDir = downloadsDir;
|
|
28765
|
+
} catch {
|
|
28766
|
+
}
|
|
28767
|
+
const filename = generateFilename(opts.format, opts.cwd);
|
|
28768
|
+
const outPath = path142.join(outputDir, filename);
|
|
28769
|
+
await fs7.writeFile(outPath, content, "utf8");
|
|
28770
|
+
return outPath;
|
|
28771
|
+
}
|
|
28772
|
+
var exportCommand = {
|
|
28773
|
+
name: "export",
|
|
28774
|
+
description: "Export session history to a file",
|
|
28775
|
+
kind: "built-in",
|
|
28776
|
+
supportedModes: ["interactive"],
|
|
28777
|
+
subCommands: EXPORT_FORMATS.map((fmt2) => ({
|
|
28778
|
+
name: fmt2,
|
|
28779
|
+
description: fmt2 === "markdown" ? "Markdown (.md)" : "JSON (.json)",
|
|
28780
|
+
kind: "built-in",
|
|
28781
|
+
supportedModes: ["interactive"],
|
|
28782
|
+
action: async () => ({
|
|
28783
|
+
type: "message",
|
|
28784
|
+
messageType: "info",
|
|
28785
|
+
content: `Use /export ${fmt2} from the top-level command.`
|
|
28786
|
+
})
|
|
28787
|
+
})),
|
|
28788
|
+
action: async (context, args) => {
|
|
28789
|
+
const fmt2 = args?.trim() ?? "markdown";
|
|
28790
|
+
if (!EXPORT_FORMATS.includes(fmt2)) {
|
|
28791
|
+
return {
|
|
28792
|
+
type: "message",
|
|
28793
|
+
messageType: "error",
|
|
28794
|
+
content: `Unknown format "${fmt2}". Available: ${EXPORT_FORMATS.join(", ")}`
|
|
28795
|
+
};
|
|
28796
|
+
}
|
|
28797
|
+
const messages = context.ui.getMessages?.() ?? [];
|
|
28798
|
+
const cwd = context.ui.getCwd?.() ?? process.cwd();
|
|
28799
|
+
const model = context.services.session?.getState().model;
|
|
28800
|
+
if (messages.length === 0) {
|
|
28801
|
+
return { type: "message", messageType: "info", content: "Nothing to export yet." };
|
|
28802
|
+
}
|
|
28803
|
+
try {
|
|
28804
|
+
const outPath = await exportSession({ messages, cwd, model, format: fmt2 });
|
|
28805
|
+
return { type: "message", messageType: "info", content: `Exported to: ${outPath}` };
|
|
28806
|
+
} catch (err) {
|
|
28807
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
28808
|
+
return { type: "message", messageType: "error", content: `Export failed: ${msg}` };
|
|
28809
|
+
}
|
|
28810
|
+
}
|
|
28811
|
+
};
|
|
28812
|
+
var CONTEXT_WINDOW_DEFAULT = 128e3;
|
|
28813
|
+
var AUTOCOMPACT_BUFFER_FRACTION = 0.2;
|
|
28814
|
+
function estimateTokens2(messages) {
|
|
28815
|
+
return Math.ceil(
|
|
28816
|
+
messages.reduce((sum, m) => {
|
|
28817
|
+
let chars = m.content.length;
|
|
28818
|
+
if (m.toolCalls) {
|
|
28819
|
+
chars += m.toolCalls.reduce(
|
|
28820
|
+
(s, tc) => s + tc.name.length + JSON.stringify(tc.arguments).length,
|
|
28821
|
+
0
|
|
28822
|
+
);
|
|
28823
|
+
}
|
|
28824
|
+
return sum + chars;
|
|
28825
|
+
}, 0) / 4
|
|
28826
|
+
);
|
|
28827
|
+
}
|
|
28828
|
+
function buildContextUsageItem(messages, modelName, showDetails) {
|
|
28829
|
+
const contextWindowSize = CONTEXT_WINDOW_DEFAULT;
|
|
28830
|
+
const autocompactBuffer = Math.round(contextWindowSize * AUTOCOMPACT_BUFFER_FRACTION);
|
|
28831
|
+
const systemMsgs = messages.filter(
|
|
28832
|
+
(m) => m.role === "system" || m.source === "agent_internal"
|
|
28833
|
+
);
|
|
28834
|
+
const conversationMsgs = messages.filter(
|
|
28835
|
+
(m) => m.role !== "system" && m.source !== "agent_internal" && m.source !== "ui"
|
|
28836
|
+
);
|
|
28837
|
+
const systemTokens = estimateTokens2(systemMsgs);
|
|
28838
|
+
const conversationTokens = estimateTokens2(conversationMsgs);
|
|
28839
|
+
const totalTokens = systemTokens + conversationTokens;
|
|
28840
|
+
const freeSpace = Math.max(0, contextWindowSize - totalTokens - autocompactBuffer);
|
|
28841
|
+
const breakdown = {
|
|
28842
|
+
systemPrompt: systemTokens,
|
|
28843
|
+
builtinTools: 0,
|
|
28844
|
+
mcpTools: 0,
|
|
28845
|
+
memoryFiles: 0,
|
|
28846
|
+
skills: 0,
|
|
28847
|
+
messages: conversationTokens,
|
|
28848
|
+
freeSpace,
|
|
28849
|
+
autocompactBuffer
|
|
28850
|
+
};
|
|
28851
|
+
return {
|
|
28852
|
+
type: "context_usage",
|
|
28853
|
+
modelName: modelName || "(desconhecido)",
|
|
28854
|
+
totalTokens,
|
|
28855
|
+
contextWindowSize,
|
|
28856
|
+
breakdown,
|
|
28857
|
+
builtinTools: [],
|
|
28858
|
+
mcpTools: [],
|
|
28859
|
+
memoryFiles: [],
|
|
28860
|
+
skills: [],
|
|
28861
|
+
isEstimated: true,
|
|
28862
|
+
showDetails
|
|
28863
|
+
};
|
|
28864
|
+
}
|
|
28865
|
+
var contextCommand = {
|
|
28866
|
+
name: "context",
|
|
28867
|
+
description: "Exibe o uso estimado da janela de contexto",
|
|
28868
|
+
kind: "built-in",
|
|
28869
|
+
supportedModes: ["interactive"],
|
|
28870
|
+
subCommands: [
|
|
28871
|
+
{
|
|
28872
|
+
name: "detail",
|
|
28873
|
+
description: "Exibe o detalhamento por categoria",
|
|
28874
|
+
kind: "built-in",
|
|
28875
|
+
supportedModes: ["interactive"],
|
|
28876
|
+
action: async (context) => {
|
|
28877
|
+
const messages = context.ui.getMessages?.() ?? [];
|
|
28878
|
+
const model = context.services.session?.getState().model ?? "";
|
|
28879
|
+
context.ui.addItem(buildContextUsageItem(messages, model, true), Date.now());
|
|
28880
|
+
}
|
|
28881
|
+
}
|
|
28882
|
+
],
|
|
28883
|
+
action: async (context, args) => {
|
|
28884
|
+
const showDetails = args?.trim() === "detail";
|
|
28885
|
+
const messages = context.ui.getMessages?.() ?? [];
|
|
28886
|
+
const model = context.services.session?.getState().model ?? "";
|
|
28887
|
+
context.ui.addItem(buildContextUsageItem(messages, model, showDetails), Date.now());
|
|
28888
|
+
}
|
|
28889
|
+
};
|
|
28259
28890
|
var clearCommand = {
|
|
28260
28891
|
name: "clear",
|
|
28261
28892
|
get description() {
|
|
@@ -28541,10 +29172,10 @@ var CommandDialog = ({
|
|
|
28541
29172
|
title,
|
|
28542
29173
|
lines,
|
|
28543
29174
|
footerText = "Press Esc or Enter to close."
|
|
28544
|
-
}) => /* @__PURE__ */
|
|
28545
|
-
/* @__PURE__ */
|
|
28546
|
-
/* @__PURE__ */
|
|
28547
|
-
/* @__PURE__ */
|
|
29175
|
+
}) => /* @__PURE__ */ jsx48(Box38, { marginLeft: 2, marginRight: 2, marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs42(Box38, { borderStyle: "round", borderColor: theme.border.default, padding: 1, flexDirection: "column", children: [
|
|
29176
|
+
/* @__PURE__ */ jsx48(Text46, { bold: true, color: theme.text.accent, children: title }),
|
|
29177
|
+
/* @__PURE__ */ jsx48(Box38, { marginTop: 1, flexDirection: "column", children: lines.map((line, index) => /* @__PURE__ */ jsx48(Text46, { color: theme.text.primary, children: line }, index)) }),
|
|
29178
|
+
/* @__PURE__ */ jsx48(Box38, { marginTop: 1, children: /* @__PURE__ */ jsx48(Text46, { color: theme.text.secondary, children: footerText }) })
|
|
28548
29179
|
] }) });
|
|
28549
29180
|
var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
28550
29181
|
const originalTheme = useRef15(themeManager.getActiveTheme().name);
|
|
@@ -28581,8 +29212,8 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
28581
29212
|
},
|
|
28582
29213
|
[onPreview]
|
|
28583
29214
|
);
|
|
28584
|
-
return /* @__PURE__ */
|
|
28585
|
-
|
|
29215
|
+
return /* @__PURE__ */ jsxs43(
|
|
29216
|
+
Box39,
|
|
28586
29217
|
{
|
|
28587
29218
|
flexDirection: "column",
|
|
28588
29219
|
borderStyle: "round",
|
|
@@ -28591,8 +29222,8 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
28591
29222
|
marginLeft: 2,
|
|
28592
29223
|
marginRight: 2,
|
|
28593
29224
|
children: [
|
|
28594
|
-
/* @__PURE__ */
|
|
28595
|
-
/* @__PURE__ */
|
|
29225
|
+
/* @__PURE__ */ jsx49(Text47, { bold: true, color: theme.text.accent, children: "Select theme" }),
|
|
29226
|
+
/* @__PURE__ */ jsx49(
|
|
28596
29227
|
RadioButtonSelect,
|
|
28597
29228
|
{
|
|
28598
29229
|
items,
|
|
@@ -28602,7 +29233,7 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
28602
29233
|
isFocused: true
|
|
28603
29234
|
}
|
|
28604
29235
|
),
|
|
28605
|
-
/* @__PURE__ */
|
|
29236
|
+
/* @__PURE__ */ jsx49(Text47, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter apply \xB7 Esc cancel" })
|
|
28606
29237
|
]
|
|
28607
29238
|
}
|
|
28608
29239
|
);
|
|
@@ -28832,8 +29463,8 @@ var ProviderDialog = ({
|
|
|
28832
29463
|
);
|
|
28833
29464
|
const statusColor2 = status ? status.ok ? status.text.startsWith("\u2713") ? theme.status.success : theme.text.secondary : theme.status.error : void 0;
|
|
28834
29465
|
const footer = phase === "apiKey" ? "Enter save Ctrl+U clear Esc cancel" : phase === "providers" ? "\u2191\u2193 navigate Enter select Esc close" : "\u2191\u2193 navigate Enter confirm Esc back";
|
|
28835
|
-
return /* @__PURE__ */
|
|
28836
|
-
|
|
29466
|
+
return /* @__PURE__ */ jsxs44(
|
|
29467
|
+
Box40,
|
|
28837
29468
|
{
|
|
28838
29469
|
flexDirection: "column",
|
|
28839
29470
|
borderStyle: "round",
|
|
@@ -28844,19 +29475,19 @@ var ProviderDialog = ({
|
|
|
28844
29475
|
marginRight: 2,
|
|
28845
29476
|
minWidth: 44,
|
|
28846
29477
|
children: [
|
|
28847
|
-
/* @__PURE__ */
|
|
28848
|
-
/* @__PURE__ */
|
|
28849
|
-
phase !== "providers" && /* @__PURE__ */
|
|
28850
|
-
/* @__PURE__ */
|
|
28851
|
-
/* @__PURE__ */
|
|
29478
|
+
/* @__PURE__ */ jsxs44(Box40, { marginBottom: 1, gap: 1, children: [
|
|
29479
|
+
/* @__PURE__ */ jsx50(Text48, { bold: true, color: theme.text.accent, children: "Providers" }),
|
|
29480
|
+
phase !== "providers" && /* @__PURE__ */ jsxs44(Fragment11, { children: [
|
|
29481
|
+
/* @__PURE__ */ jsx50(Text48, { color: theme.text.secondary, children: "\u203A" }),
|
|
29482
|
+
/* @__PURE__ */ jsx50(Text48, { bold: true, color: theme.text.primary, children: selectedProvider })
|
|
28852
29483
|
] }),
|
|
28853
|
-
phase === "providers" && currentModel && /* @__PURE__ */
|
|
29484
|
+
phase === "providers" && currentModel && /* @__PURE__ */ jsxs44(Text48, { color: theme.text.secondary, children: [
|
|
28854
29485
|
" (",
|
|
28855
29486
|
currentModel,
|
|
28856
29487
|
")"
|
|
28857
29488
|
] })
|
|
28858
29489
|
] }),
|
|
28859
|
-
phase === "providers" && /* @__PURE__ */
|
|
29490
|
+
phase === "providers" && /* @__PURE__ */ jsx50(
|
|
28860
29491
|
BaseSelectionList,
|
|
28861
29492
|
{
|
|
28862
29493
|
items: providerItems,
|
|
@@ -28866,25 +29497,25 @@ var ProviderDialog = ({
|
|
|
28866
29497
|
maxItemsToShow: 8,
|
|
28867
29498
|
renderItem: (item, { titleColor }) => {
|
|
28868
29499
|
const { icon, color, label } = getStatusMark(item.provider, item.keyIsSet);
|
|
28869
|
-
return /* @__PURE__ */
|
|
28870
|
-
/* @__PURE__ */
|
|
28871
|
-
/* @__PURE__ */
|
|
28872
|
-
/* @__PURE__ */
|
|
28873
|
-
item.isCurrent && /* @__PURE__ */
|
|
29500
|
+
return /* @__PURE__ */ jsxs44(Box40, { gap: 1, children: [
|
|
29501
|
+
/* @__PURE__ */ jsx50(Text48, { color, children: icon }),
|
|
29502
|
+
/* @__PURE__ */ jsx50(Text48, { color: titleColor, bold: item.isCurrent, children: item.provider.padEnd(12) }),
|
|
29503
|
+
/* @__PURE__ */ jsx50(Text48, { color, dimColor: !item.keyIsSet && !item.isLocal, children: label }),
|
|
29504
|
+
item.isCurrent && /* @__PURE__ */ jsx50(Text48, { color: theme.text.accent, children: "\u25B6" })
|
|
28874
29505
|
] });
|
|
28875
29506
|
}
|
|
28876
29507
|
}
|
|
28877
29508
|
),
|
|
28878
|
-
phase === "actions" && /* @__PURE__ */
|
|
28879
|
-
/* @__PURE__ */
|
|
28880
|
-
/* @__PURE__ */
|
|
28881
|
-
/* @__PURE__ */
|
|
29509
|
+
phase === "actions" && /* @__PURE__ */ jsxs44(Fragment11, { children: [
|
|
29510
|
+
/* @__PURE__ */ jsxs44(Box40, { marginBottom: 1, gap: 1, children: [
|
|
29511
|
+
/* @__PURE__ */ jsx50(Text48, { color: theme.ui.comment, children: "session" }),
|
|
29512
|
+
/* @__PURE__ */ jsx50(Text48, { color: selectedProvider === currentProvider ? theme.text.accent : theme.text.secondary, children: selectedProvider === currentProvider ? "active" : `still using ${currentProvider}` })
|
|
28882
29513
|
] }),
|
|
28883
|
-
/* @__PURE__ */
|
|
28884
|
-
/* @__PURE__ */
|
|
28885
|
-
isLocal ? /* @__PURE__ */
|
|
29514
|
+
/* @__PURE__ */ jsxs44(Box40, { marginBottom: 1, gap: 1, children: [
|
|
29515
|
+
/* @__PURE__ */ jsx50(Text48, { color: theme.ui.comment, children: "key" }),
|
|
29516
|
+
isLocal ? /* @__PURE__ */ jsx50(Text48, { color: theme.text.accent, children: "no key required" }) : keyHint ? /* @__PURE__ */ jsx50(Text48, { color: theme.text.secondary, children: keyHint }) : /* @__PURE__ */ jsx50(Text48, { color: theme.ui.comment, dimColor: true, children: "not configured" })
|
|
28886
29517
|
] }),
|
|
28887
|
-
/* @__PURE__ */
|
|
29518
|
+
/* @__PURE__ */ jsx50(
|
|
28888
29519
|
BaseSelectionList,
|
|
28889
29520
|
{
|
|
28890
29521
|
items: actionItems,
|
|
@@ -28892,10 +29523,10 @@ var ProviderDialog = ({
|
|
|
28892
29523
|
isFocused: !isBusy,
|
|
28893
29524
|
showNumbers: false,
|
|
28894
29525
|
maxItemsToShow: 6,
|
|
28895
|
-
renderItem: (item, { titleColor }) => /* @__PURE__ */
|
|
28896
|
-
/* @__PURE__ */
|
|
28897
|
-
/* @__PURE__ */
|
|
28898
|
-
item.hint && /* @__PURE__ */
|
|
29526
|
+
renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs44(Box40, { gap: 1, children: [
|
|
29527
|
+
/* @__PURE__ */ jsx50(Text48, { color: titleColor, children: item.icon }),
|
|
29528
|
+
/* @__PURE__ */ jsx50(Text48, { color: titleColor, children: item.label }),
|
|
29529
|
+
item.hint && /* @__PURE__ */ jsxs44(Text48, { color: theme.ui.comment, dimColor: true, children: [
|
|
28899
29530
|
"(",
|
|
28900
29531
|
item.hint,
|
|
28901
29532
|
")"
|
|
@@ -28904,26 +29535,26 @@ var ProviderDialog = ({
|
|
|
28904
29535
|
}
|
|
28905
29536
|
)
|
|
28906
29537
|
] }),
|
|
28907
|
-
phase === "apiKey" && /* @__PURE__ */
|
|
28908
|
-
/* @__PURE__ */
|
|
28909
|
-
/* @__PURE__ */
|
|
28910
|
-
isLocal ? /* @__PURE__ */
|
|
29538
|
+
phase === "apiKey" && /* @__PURE__ */ jsxs44(Box40, { flexDirection: "column", gap: 1, marginBottom: 1, children: [
|
|
29539
|
+
/* @__PURE__ */ jsxs44(Box40, { gap: 1, children: [
|
|
29540
|
+
/* @__PURE__ */ jsx50(Text48, { color: theme.ui.comment, children: "current" }),
|
|
29541
|
+
isLocal ? /* @__PURE__ */ jsx50(Text48, { color: theme.text.accent, children: "no key required" }) : keyHint ? /* @__PURE__ */ jsx50(Text48, { color: theme.text.secondary, children: keyHint }) : /* @__PURE__ */ jsx50(Text48, { color: theme.ui.comment, dimColor: true, children: "not set" })
|
|
28911
29542
|
] }),
|
|
28912
|
-
/* @__PURE__ */
|
|
28913
|
-
/* @__PURE__ */
|
|
28914
|
-
/* @__PURE__ */
|
|
29543
|
+
/* @__PURE__ */ jsxs44(Box40, { gap: 1, children: [
|
|
29544
|
+
/* @__PURE__ */ jsx50(Text48, { color: theme.ui.comment, children: "new key" }),
|
|
29545
|
+
/* @__PURE__ */ jsx50(Box40, { borderStyle: "single", borderColor: theme.border.focused, paddingX: 1, children: /* @__PURE__ */ jsx50(Text48, { color: theme.text.accent, children: apiKeyInput.length > 0 ? maskApiKeyInput(apiKeyInput.length) : /* @__PURE__ */ jsx50(Text48, { color: theme.ui.comment, dimColor: true, children: "paste or type\u2026" }) }) })
|
|
28915
29546
|
] })
|
|
28916
29547
|
] }),
|
|
28917
|
-
status && /* @__PURE__ */
|
|
28918
|
-
phase === "actions" && testLatencyMs !== void 0 && /* @__PURE__ */
|
|
28919
|
-
/* @__PURE__ */
|
|
29548
|
+
status && /* @__PURE__ */ jsx50(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx50(Text48, { color: statusColor2, children: status.text }) }),
|
|
29549
|
+
phase === "actions" && testLatencyMs !== void 0 && /* @__PURE__ */ jsxs44(Box40, { marginTop: 0, gap: 1, children: [
|
|
29550
|
+
/* @__PURE__ */ jsxs44(Text48, { color: getLatencyColor(testLatencyMs), bold: true, children: [
|
|
28920
29551
|
testLatencyMs,
|
|
28921
29552
|
"ms"
|
|
28922
29553
|
] }),
|
|
28923
|
-
/* @__PURE__ */
|
|
29554
|
+
/* @__PURE__ */ jsx50(Text48, { color: theme.text.secondary, children: testLatencyMs < 300 ? "excellent" : testLatencyMs < 800 ? "good" : "slow" })
|
|
28924
29555
|
] }),
|
|
28925
|
-
/* @__PURE__ */
|
|
28926
|
-
|
|
29556
|
+
/* @__PURE__ */ jsx50(
|
|
29557
|
+
Box40,
|
|
28927
29558
|
{
|
|
28928
29559
|
marginTop: 1,
|
|
28929
29560
|
borderStyle: "single",
|
|
@@ -28932,7 +29563,7 @@ var ProviderDialog = ({
|
|
|
28932
29563
|
borderLeft: false,
|
|
28933
29564
|
borderRight: false,
|
|
28934
29565
|
borderColor: theme.ui.comment,
|
|
28935
|
-
children: /* @__PURE__ */
|
|
29566
|
+
children: /* @__PURE__ */ jsxs44(Text48, { color: theme.ui.comment, dimColor: true, children: [
|
|
28936
29567
|
footer,
|
|
28937
29568
|
phase === "actions" && " Test does not change the session."
|
|
28938
29569
|
] })
|
|
@@ -29000,8 +29631,8 @@ var PermissionsDialog = ({
|
|
|
29000
29631
|
[onClose]
|
|
29001
29632
|
);
|
|
29002
29633
|
useKeypress(handleEscape, { isActive: true });
|
|
29003
|
-
return /* @__PURE__ */
|
|
29004
|
-
|
|
29634
|
+
return /* @__PURE__ */ jsxs45(
|
|
29635
|
+
Box41,
|
|
29005
29636
|
{
|
|
29006
29637
|
flexDirection: "column",
|
|
29007
29638
|
borderStyle: "round",
|
|
@@ -29010,9 +29641,9 @@ var PermissionsDialog = ({
|
|
|
29010
29641
|
marginLeft: 2,
|
|
29011
29642
|
marginRight: 2,
|
|
29012
29643
|
children: [
|
|
29013
|
-
/* @__PURE__ */
|
|
29014
|
-
/* @__PURE__ */
|
|
29015
|
-
/* @__PURE__ */
|
|
29644
|
+
/* @__PURE__ */ jsx51(Text49, { bold: true, color: theme.text.accent, children: "Permission policy" }),
|
|
29645
|
+
/* @__PURE__ */ jsx51(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
29646
|
+
/* @__PURE__ */ jsx51(Text49, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter cycles allow/ask/deny \xB7 Esc cancel" })
|
|
29016
29647
|
]
|
|
29017
29648
|
}
|
|
29018
29649
|
);
|
|
@@ -29120,8 +29751,8 @@ var AuthDialog = ({
|
|
|
29120
29751
|
[onClose, phase]
|
|
29121
29752
|
);
|
|
29122
29753
|
useKeypress(handleEscape, { isActive: true });
|
|
29123
|
-
return /* @__PURE__ */
|
|
29124
|
-
|
|
29754
|
+
return /* @__PURE__ */ jsxs46(
|
|
29755
|
+
Box42,
|
|
29125
29756
|
{
|
|
29126
29757
|
flexDirection: "column",
|
|
29127
29758
|
borderStyle: "round",
|
|
@@ -29130,32 +29761,32 @@ var AuthDialog = ({
|
|
|
29130
29761
|
marginLeft: 2,
|
|
29131
29762
|
marginRight: 2,
|
|
29132
29763
|
children: [
|
|
29133
|
-
/* @__PURE__ */
|
|
29134
|
-
/* @__PURE__ */
|
|
29135
|
-
phase === "menu" && /* @__PURE__ */
|
|
29136
|
-
deviceCode && phase === "running" && /* @__PURE__ */
|
|
29137
|
-
/* @__PURE__ */
|
|
29764
|
+
/* @__PURE__ */ jsx52(Text50, { bold: true, color: theme.text.accent, children: "GitHub authentication" }),
|
|
29765
|
+
/* @__PURE__ */ jsx52(Text50, { color: theme.text.secondary, children: statusSummary }),
|
|
29766
|
+
phase === "menu" && /* @__PURE__ */ jsx52(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
29767
|
+
deviceCode && phase === "running" && /* @__PURE__ */ jsxs46(Box42, { flexDirection: "column", marginTop: 1, children: [
|
|
29768
|
+
/* @__PURE__ */ jsxs46(Text50, { children: [
|
|
29138
29769
|
"Open: ",
|
|
29139
|
-
/* @__PURE__ */
|
|
29770
|
+
/* @__PURE__ */ jsx52(Text50, { color: theme.text.accent, children: deviceCode.verificationUri })
|
|
29140
29771
|
] }),
|
|
29141
|
-
/* @__PURE__ */
|
|
29772
|
+
/* @__PURE__ */ jsxs46(Text50, { children: [
|
|
29142
29773
|
"Code: ",
|
|
29143
|
-
/* @__PURE__ */
|
|
29774
|
+
/* @__PURE__ */ jsx52(Text50, { bold: true, color: theme.text.accent, children: deviceCode.userCode })
|
|
29144
29775
|
] }),
|
|
29145
|
-
/* @__PURE__ */
|
|
29776
|
+
/* @__PURE__ */ jsxs46(Text50, { color: theme.text.secondary, children: [
|
|
29146
29777
|
"Expires in ",
|
|
29147
29778
|
Math.round(deviceCode.expiresIn / 60),
|
|
29148
29779
|
" minutes."
|
|
29149
29780
|
] })
|
|
29150
29781
|
] }),
|
|
29151
|
-
message && /* @__PURE__ */
|
|
29152
|
-
|
|
29782
|
+
message && /* @__PURE__ */ jsx52(
|
|
29783
|
+
Text50,
|
|
29153
29784
|
{
|
|
29154
29785
|
color: phase === "error" ? theme.status.error : phase === "done" ? theme.status.success : theme.text.secondary,
|
|
29155
29786
|
children: message
|
|
29156
29787
|
}
|
|
29157
29788
|
),
|
|
29158
|
-
/* @__PURE__ */
|
|
29789
|
+
/* @__PURE__ */ jsx52(Text50, { color: theme.text.secondary, children: phase === "running" ? "Esc cancel login" : phase === "menu" ? "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc close" : "Esc close" })
|
|
29159
29790
|
]
|
|
29160
29791
|
}
|
|
29161
29792
|
);
|
|
@@ -29282,8 +29913,8 @@ var ModelDialog = ({
|
|
|
29282
29913
|
}, { isActive: true });
|
|
29283
29914
|
const canScrollUp = scrollTop > 0;
|
|
29284
29915
|
const canScrollDown = scrollTop + MAX_VISIBLE < rows.length;
|
|
29285
|
-
return /* @__PURE__ */
|
|
29286
|
-
|
|
29916
|
+
return /* @__PURE__ */ jsxs47(
|
|
29917
|
+
Box43,
|
|
29287
29918
|
{
|
|
29288
29919
|
flexDirection: "column",
|
|
29289
29920
|
borderStyle: "round",
|
|
@@ -29294,80 +29925,80 @@ var ModelDialog = ({
|
|
|
29294
29925
|
marginRight: 1,
|
|
29295
29926
|
minWidth: 58,
|
|
29296
29927
|
children: [
|
|
29297
|
-
/* @__PURE__ */
|
|
29298
|
-
/* @__PURE__ */
|
|
29299
|
-
/* @__PURE__ */
|
|
29300
|
-
/* @__PURE__ */
|
|
29301
|
-
/* @__PURE__ */
|
|
29928
|
+
/* @__PURE__ */ jsxs47(Box43, { justifyContent: "space-between", marginBottom: 1, children: [
|
|
29929
|
+
/* @__PURE__ */ jsxs47(Box43, { gap: 1, children: [
|
|
29930
|
+
/* @__PURE__ */ jsx53(Text51, { bold: true, color: theme.text.primary, children: "Select model" }),
|
|
29931
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.text.secondary, children: "for" }),
|
|
29932
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.text.accent, children: currentProvider })
|
|
29302
29933
|
] }),
|
|
29303
|
-
/* @__PURE__ */
|
|
29934
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.ui.comment, dimColor: true, children: "esc" })
|
|
29304
29935
|
] }),
|
|
29305
|
-
/* @__PURE__ */
|
|
29306
|
-
|
|
29936
|
+
/* @__PURE__ */ jsxs47(
|
|
29937
|
+
Box43,
|
|
29307
29938
|
{
|
|
29308
29939
|
borderStyle: "single",
|
|
29309
29940
|
borderColor: search ? theme.border.focused : theme.ui.comment,
|
|
29310
29941
|
paddingX: 1,
|
|
29311
29942
|
marginBottom: 1,
|
|
29312
29943
|
children: [
|
|
29313
|
-
/* @__PURE__ */
|
|
29314
|
-
search ? /* @__PURE__ */
|
|
29944
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.ui.comment, children: "\u2315 " }),
|
|
29945
|
+
search ? /* @__PURE__ */ jsxs47(Text51, { color: theme.text.primary, children: [
|
|
29315
29946
|
search,
|
|
29316
|
-
/* @__PURE__ */
|
|
29317
|
-
] }) : /* @__PURE__ */
|
|
29947
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.text.accent, children: "\u258C" })
|
|
29948
|
+
] }) : /* @__PURE__ */ jsxs47(Text51, { color: theme.ui.comment, dimColor: true, children: [
|
|
29318
29949
|
"Search",
|
|
29319
|
-
/* @__PURE__ */
|
|
29950
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.text.accent, children: "\u258C" })
|
|
29320
29951
|
] })
|
|
29321
29952
|
]
|
|
29322
29953
|
}
|
|
29323
29954
|
),
|
|
29324
|
-
loadState === "loading" && /* @__PURE__ */
|
|
29325
|
-
loadState === "error" && /* @__PURE__ */
|
|
29326
|
-
/* @__PURE__ */
|
|
29327
|
-
/* @__PURE__ */
|
|
29955
|
+
loadState === "loading" && /* @__PURE__ */ jsx53(Box43, { marginY: 1, children: /* @__PURE__ */ jsx53(Text51, { color: theme.text.secondary, children: "Loading models\u2026" }) }),
|
|
29956
|
+
loadState === "error" && /* @__PURE__ */ jsxs47(Box43, { flexDirection: "column", marginY: 1, children: [
|
|
29957
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.status.error, children: "\u2717 Could not load models" }),
|
|
29958
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.ui.comment, dimColor: true, children: errorMsg })
|
|
29328
29959
|
] }),
|
|
29329
|
-
loadState === "ready" && selectableCount === 0 && /* @__PURE__ */
|
|
29960
|
+
loadState === "ready" && selectableCount === 0 && /* @__PURE__ */ jsx53(Box43, { marginY: 1, children: /* @__PURE__ */ jsxs47(Text51, { color: theme.ui.comment, dimColor: true, children: [
|
|
29330
29961
|
'No models match "',
|
|
29331
29962
|
search,
|
|
29332
29963
|
'"'
|
|
29333
29964
|
] }) }),
|
|
29334
|
-
loadState === "ready" && selectableCount > 0 && /* @__PURE__ */
|
|
29335
|
-
canScrollUp && /* @__PURE__ */
|
|
29965
|
+
loadState === "ready" && selectableCount > 0 && /* @__PURE__ */ jsxs47(Box43, { flexDirection: "column", children: [
|
|
29966
|
+
canScrollUp && /* @__PURE__ */ jsx53(Text51, { color: theme.ui.comment, dimColor: true, children: " \u2191" }),
|
|
29336
29967
|
visibleRows.map((row, i) => {
|
|
29337
29968
|
if (row.kind === "header") {
|
|
29338
|
-
return /* @__PURE__ */
|
|
29969
|
+
return /* @__PURE__ */ jsx53(Box43, { marginTop: i === 0 ? 0 : 1, children: /* @__PURE__ */ jsx53(Text51, { color: theme.text.accent, bold: true, children: row.label }) }, `h${i}`);
|
|
29339
29970
|
}
|
|
29340
29971
|
const { model, selIndex } = row;
|
|
29341
29972
|
const isActive = selIndex === clampedIndex;
|
|
29342
29973
|
const isCurrent = model.id === currentModel;
|
|
29343
29974
|
const free = isFree(model);
|
|
29344
29975
|
const group = providerGroup(model);
|
|
29345
|
-
return /* @__PURE__ */
|
|
29346
|
-
/* @__PURE__ */
|
|
29347
|
-
/* @__PURE__ */
|
|
29348
|
-
/* @__PURE__ */
|
|
29349
|
-
|
|
29976
|
+
return /* @__PURE__ */ jsxs47(Box43, { gap: 1, children: [
|
|
29977
|
+
/* @__PURE__ */ jsx53(Text51, { color: isActive ? theme.text.accent : theme.ui.comment, children: isCurrent ? "\u25CF" : isActive ? "\u203A" : " " }),
|
|
29978
|
+
/* @__PURE__ */ jsxs47(Box43, { flexGrow: 1, gap: 1, children: [
|
|
29979
|
+
/* @__PURE__ */ jsx53(
|
|
29980
|
+
Text51,
|
|
29350
29981
|
{
|
|
29351
29982
|
color: isActive ? theme.text.primary : theme.text.secondary,
|
|
29352
29983
|
bold: isActive,
|
|
29353
29984
|
children: model.name
|
|
29354
29985
|
}
|
|
29355
29986
|
),
|
|
29356
|
-
/* @__PURE__ */
|
|
29987
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.text.accent, dimColor: true, children: group })
|
|
29357
29988
|
] }),
|
|
29358
|
-
free && /* @__PURE__ */
|
|
29989
|
+
free && /* @__PURE__ */ jsx53(Text51, { color: theme.status.success, dimColor: !isActive, children: "Free" })
|
|
29359
29990
|
] }, model.id);
|
|
29360
29991
|
}),
|
|
29361
|
-
canScrollDown && /* @__PURE__ */
|
|
29992
|
+
canScrollDown && /* @__PURE__ */ jsx53(Text51, { color: theme.ui.comment, dimColor: true, children: " \u2193" })
|
|
29362
29993
|
] }),
|
|
29363
|
-
loadState === "ready" && /* @__PURE__ */
|
|
29994
|
+
loadState === "ready" && /* @__PURE__ */ jsx53(Box43, { marginTop: 1, children: /* @__PURE__ */ jsxs47(Text51, { color: theme.ui.comment, dimColor: true, children: [
|
|
29364
29995
|
selectableCount,
|
|
29365
29996
|
" model",
|
|
29366
29997
|
selectableCount !== 1 ? "s" : "",
|
|
29367
29998
|
search ? ` \xB7 "${search}"` : ""
|
|
29368
29999
|
] }) }),
|
|
29369
|
-
/* @__PURE__ */
|
|
29370
|
-
|
|
30000
|
+
/* @__PURE__ */ jsx53(
|
|
30001
|
+
Box43,
|
|
29371
30002
|
{
|
|
29372
30003
|
marginTop: 1,
|
|
29373
30004
|
borderStyle: "single",
|
|
@@ -29376,7 +30007,7 @@ var ModelDialog = ({
|
|
|
29376
30007
|
borderLeft: false,
|
|
29377
30008
|
borderRight: false,
|
|
29378
30009
|
borderColor: theme.ui.comment,
|
|
29379
|
-
children: /* @__PURE__ */
|
|
30010
|
+
children: /* @__PURE__ */ jsx53(Text51, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navigate type to search Enter use for session Esc close" })
|
|
29380
30011
|
}
|
|
29381
30012
|
)
|
|
29382
30013
|
]
|
|
@@ -29392,11 +30023,11 @@ var RATINGS = [
|
|
|
29392
30023
|
];
|
|
29393
30024
|
var CANCEL_VALUE2 = "__cancel__";
|
|
29394
30025
|
function appendFeedbackEntry(cwd, rating, label) {
|
|
29395
|
-
const file =
|
|
30026
|
+
const file = path15.join(cwd, ".deepcode", "feedback.log");
|
|
29396
30027
|
const entry = JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), rating, label });
|
|
29397
30028
|
try {
|
|
29398
|
-
|
|
29399
|
-
|
|
30029
|
+
fs8.mkdirSync(path15.dirname(file), { recursive: true });
|
|
30030
|
+
fs8.appendFileSync(file, `${entry}
|
|
29400
30031
|
`, "utf8");
|
|
29401
30032
|
} catch {
|
|
29402
30033
|
}
|
|
@@ -29430,8 +30061,8 @@ var FeedbackDialog = ({ cwd, onClose }) => {
|
|
|
29430
30061
|
[onClose]
|
|
29431
30062
|
);
|
|
29432
30063
|
useKeypress(handleEscape, { isActive: true });
|
|
29433
|
-
return /* @__PURE__ */
|
|
29434
|
-
|
|
30064
|
+
return /* @__PURE__ */ jsxs48(
|
|
30065
|
+
Box44,
|
|
29435
30066
|
{
|
|
29436
30067
|
flexDirection: "column",
|
|
29437
30068
|
borderStyle: "round",
|
|
@@ -29440,9 +30071,9 @@ var FeedbackDialog = ({ cwd, onClose }) => {
|
|
|
29440
30071
|
marginLeft: 2,
|
|
29441
30072
|
marginRight: 2,
|
|
29442
30073
|
children: [
|
|
29443
|
-
/* @__PURE__ */
|
|
29444
|
-
/* @__PURE__ */
|
|
29445
|
-
/* @__PURE__ */
|
|
30074
|
+
/* @__PURE__ */ jsx54(Text52, { bold: true, color: theme.text.accent, children: "How useful was DeepCode in this session?" }),
|
|
30075
|
+
/* @__PURE__ */ jsx54(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
30076
|
+
/* @__PURE__ */ jsx54(Text52, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter submit \xB7 Esc cancel" })
|
|
29446
30077
|
]
|
|
29447
30078
|
}
|
|
29448
30079
|
);
|
|
@@ -29523,8 +30154,8 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
29523
30154
|
}, { isActive: true });
|
|
29524
30155
|
const canScrollUp = scrollTop > 0;
|
|
29525
30156
|
const canScrollDown = scrollTop + MAX_VISIBLE2 < sessions.length;
|
|
29526
|
-
return /* @__PURE__ */
|
|
29527
|
-
|
|
30157
|
+
return /* @__PURE__ */ jsxs49(
|
|
30158
|
+
Box45,
|
|
29528
30159
|
{
|
|
29529
30160
|
flexDirection: "column",
|
|
29530
30161
|
borderStyle: "round",
|
|
@@ -29535,34 +30166,34 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
29535
30166
|
marginRight: 1,
|
|
29536
30167
|
minWidth: 60,
|
|
29537
30168
|
children: [
|
|
29538
|
-
/* @__PURE__ */
|
|
29539
|
-
/* @__PURE__ */
|
|
29540
|
-
/* @__PURE__ */
|
|
30169
|
+
/* @__PURE__ */ jsxs49(Box45, { justifyContent: "space-between", marginBottom: 1, children: [
|
|
30170
|
+
/* @__PURE__ */ jsx55(Text53, { bold: true, color: theme.text.primary, children: "Resume session" }),
|
|
30171
|
+
/* @__PURE__ */ jsx55(Text53, { color: theme.ui.comment, dimColor: true, children: "esc" })
|
|
29541
30172
|
] }),
|
|
29542
|
-
/* @__PURE__ */
|
|
29543
|
-
|
|
30173
|
+
/* @__PURE__ */ jsxs49(
|
|
30174
|
+
Box45,
|
|
29544
30175
|
{
|
|
29545
30176
|
borderStyle: "single",
|
|
29546
30177
|
borderColor: search ? theme.border.focused : theme.ui.comment,
|
|
29547
30178
|
paddingX: 1,
|
|
29548
30179
|
marginBottom: 1,
|
|
29549
30180
|
children: [
|
|
29550
|
-
/* @__PURE__ */
|
|
29551
|
-
search ? /* @__PURE__ */
|
|
30181
|
+
/* @__PURE__ */ jsx55(Text53, { color: theme.ui.comment, children: "\u2315 " }),
|
|
30182
|
+
search ? /* @__PURE__ */ jsxs49(Text53, { color: theme.text.primary, children: [
|
|
29552
30183
|
search,
|
|
29553
|
-
/* @__PURE__ */
|
|
29554
|
-
] }) : /* @__PURE__ */
|
|
30184
|
+
/* @__PURE__ */ jsx55(Text53, { color: theme.text.accent, children: "\u258C" })
|
|
30185
|
+
] }) : /* @__PURE__ */ jsxs49(Text53, { color: theme.ui.comment, dimColor: true, children: [
|
|
29555
30186
|
"Search",
|
|
29556
|
-
/* @__PURE__ */
|
|
30187
|
+
/* @__PURE__ */ jsx55(Text53, { color: theme.text.accent, children: "\u258C" })
|
|
29557
30188
|
] })
|
|
29558
30189
|
]
|
|
29559
30190
|
}
|
|
29560
30191
|
),
|
|
29561
|
-
loadState === "loading" && /* @__PURE__ */
|
|
29562
|
-
loadState === "error" && /* @__PURE__ */
|
|
29563
|
-
loadState === "ready" && sessions.length === 0 && /* @__PURE__ */
|
|
29564
|
-
loadState === "ready" && sessions.length > 0 && /* @__PURE__ */
|
|
29565
|
-
canScrollUp && /* @__PURE__ */
|
|
30192
|
+
loadState === "loading" && /* @__PURE__ */ jsx55(Box45, { marginY: 1, children: /* @__PURE__ */ jsx55(Text53, { color: theme.text.secondary, children: "Loading sessions\u2026" }) }),
|
|
30193
|
+
loadState === "error" && /* @__PURE__ */ jsx55(Box45, { marginY: 1, children: /* @__PURE__ */ jsx55(Text53, { color: theme.status.error, children: "\u2717 Could not load sessions" }) }),
|
|
30194
|
+
loadState === "ready" && sessions.length === 0 && /* @__PURE__ */ jsx55(Box45, { marginY: 1, children: /* @__PURE__ */ jsx55(Text53, { color: theme.ui.comment, dimColor: true, children: search ? `No sessions match "${search}"` : "No sessions found in .deepcode/sessions/" }) }),
|
|
30195
|
+
loadState === "ready" && sessions.length > 0 && /* @__PURE__ */ jsxs49(Box45, { flexDirection: "column", children: [
|
|
30196
|
+
canScrollUp && /* @__PURE__ */ jsx55(Text53, { color: theme.ui.comment, dimColor: true, children: " \u2191" }),
|
|
29566
30197
|
visibleSessions.map((session, visIdx) => {
|
|
29567
30198
|
const globalIdx = scrollTop + visIdx;
|
|
29568
30199
|
const isActive = globalIdx === clampedIndex;
|
|
@@ -29571,11 +30202,11 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
29571
30202
|
const target = session.model ? `${session.provider}/${session.model}` : session.provider;
|
|
29572
30203
|
const msgCount = session.messages.length;
|
|
29573
30204
|
const preview = sessionLabel2(session);
|
|
29574
|
-
return /* @__PURE__ */
|
|
29575
|
-
/* @__PURE__ */
|
|
29576
|
-
/* @__PURE__ */
|
|
29577
|
-
/* @__PURE__ */
|
|
29578
|
-
|
|
30205
|
+
return /* @__PURE__ */ jsxs49(Box45, { flexDirection: "column", children: [
|
|
30206
|
+
/* @__PURE__ */ jsxs49(Box45, { gap: 1, children: [
|
|
30207
|
+
/* @__PURE__ */ jsx55(Text53, { color: isActive ? theme.text.accent : theme.ui.comment, children: isActive ? "\u203A" : " " }),
|
|
30208
|
+
/* @__PURE__ */ jsx55(
|
|
30209
|
+
Text53,
|
|
29579
30210
|
{
|
|
29580
30211
|
color: isActive ? theme.text.primary : theme.text.secondary,
|
|
29581
30212
|
bold: isActive,
|
|
@@ -29584,7 +30215,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
29584
30215
|
}
|
|
29585
30216
|
)
|
|
29586
30217
|
] }),
|
|
29587
|
-
isActive && /* @__PURE__ */
|
|
30218
|
+
isActive && /* @__PURE__ */ jsx55(Box45, { paddingLeft: 2, children: /* @__PURE__ */ jsxs49(Text53, { color: theme.ui.comment, dimColor: true, children: [
|
|
29588
30219
|
shortId,
|
|
29589
30220
|
" ",
|
|
29590
30221
|
target,
|
|
@@ -29595,16 +30226,16 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
29595
30226
|
] }) })
|
|
29596
30227
|
] }, session.id);
|
|
29597
30228
|
}),
|
|
29598
|
-
canScrollDown && /* @__PURE__ */
|
|
29599
|
-
/* @__PURE__ */
|
|
30229
|
+
canScrollDown && /* @__PURE__ */ jsx55(Text53, { color: theme.ui.comment, dimColor: true, children: " \u2193" }),
|
|
30230
|
+
/* @__PURE__ */ jsx55(Box45, { marginTop: 1, children: /* @__PURE__ */ jsxs49(Text53, { color: theme.ui.comment, dimColor: true, children: [
|
|
29600
30231
|
sessions.length,
|
|
29601
30232
|
" session",
|
|
29602
30233
|
sessions.length !== 1 ? "s" : "",
|
|
29603
30234
|
search ? ` \xB7 "${search}"` : ""
|
|
29604
30235
|
] }) })
|
|
29605
30236
|
] }),
|
|
29606
|
-
/* @__PURE__ */
|
|
29607
|
-
|
|
30237
|
+
/* @__PURE__ */ jsx55(
|
|
30238
|
+
Box45,
|
|
29608
30239
|
{
|
|
29609
30240
|
marginTop: 1,
|
|
29610
30241
|
borderStyle: "single",
|
|
@@ -29613,7 +30244,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
29613
30244
|
borderLeft: false,
|
|
29614
30245
|
borderRight: false,
|
|
29615
30246
|
borderColor: theme.ui.comment,
|
|
29616
|
-
children: /* @__PURE__ */
|
|
30247
|
+
children: /* @__PURE__ */ jsx55(Text53, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navigate type to search Enter resume Esc close" })
|
|
29617
30248
|
}
|
|
29618
30249
|
)
|
|
29619
30250
|
]
|
|
@@ -29634,8 +30265,8 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
29634
30265
|
if (subagents.length === 0) return null;
|
|
29635
30266
|
const running = subagents.filter((s) => s.status === "running").length;
|
|
29636
30267
|
const title = running > 0 ? `Subagents (${running} running)` : `Subagents (${subagents.length} finishing\u2026)`;
|
|
29637
|
-
return /* @__PURE__ */
|
|
29638
|
-
|
|
30268
|
+
return /* @__PURE__ */ jsxs50(
|
|
30269
|
+
Box46,
|
|
29639
30270
|
{
|
|
29640
30271
|
flexDirection: "column",
|
|
29641
30272
|
borderStyle: "round",
|
|
@@ -29645,25 +30276,25 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
29645
30276
|
marginTop: 1,
|
|
29646
30277
|
width: Math.min(mainAreaWidth, 80),
|
|
29647
30278
|
children: [
|
|
29648
|
-
/* @__PURE__ */
|
|
29649
|
-
subagents.map((entry) => /* @__PURE__ */
|
|
29650
|
-
/* @__PURE__ */
|
|
29651
|
-
/* @__PURE__ */
|
|
29652
|
-
/* @__PURE__ */
|
|
30279
|
+
/* @__PURE__ */ jsx56(Box46, { paddingX: 1, children: /* @__PURE__ */ jsx56(Text54, { bold: true, color: theme.text.accent, children: title }) }),
|
|
30280
|
+
subagents.map((entry) => /* @__PURE__ */ jsxs50(Box46, { flexDirection: "column", paddingX: 1, children: [
|
|
30281
|
+
/* @__PURE__ */ jsxs50(Box46, { flexDirection: "row", gap: 1, children: [
|
|
30282
|
+
/* @__PURE__ */ jsx56(Text54, { color: statusColor(entry), children: statusIcon(entry) }),
|
|
30283
|
+
/* @__PURE__ */ jsxs50(Text54, { wrap: "truncate", color: theme.text.primary, children: [
|
|
29653
30284
|
entry.prompt,
|
|
29654
30285
|
entry.prompt.length >= 50 ? "\u2026" : ""
|
|
29655
30286
|
] })
|
|
29656
30287
|
] }),
|
|
29657
|
-
entry.status === "running" && entry.currentTool && /* @__PURE__ */
|
|
30288
|
+
entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs50(Text54, { color: theme.text.secondary, dimColor: true, children: [
|
|
29658
30289
|
" ",
|
|
29659
30290
|
"using ",
|
|
29660
30291
|
entry.currentTool
|
|
29661
30292
|
] }),
|
|
29662
|
-
entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */
|
|
30293
|
+
entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */ jsxs50(Text54, { color: theme.text.secondary, dimColor: true, wrap: "truncate", children: [
|
|
29663
30294
|
" ",
|
|
29664
30295
|
entry.currentOutput.trimStart()
|
|
29665
30296
|
] }),
|
|
29666
|
-
entry.status === "failed" && entry.error && /* @__PURE__ */
|
|
30297
|
+
entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs50(Text54, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
|
|
29667
30298
|
" ",
|
|
29668
30299
|
entry.error.slice(0, 60)
|
|
29669
30300
|
] })
|
|
@@ -29900,7 +30531,7 @@ function formatModelCatalogSummary2(result) {
|
|
|
29900
30531
|
return "model catalog unavailable";
|
|
29901
30532
|
}
|
|
29902
30533
|
var APPROVAL_ENTER_ARM_DELAY_MS = 350;
|
|
29903
|
-
var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
30534
|
+
var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarnings = [] }) => {
|
|
29904
30535
|
const historyManager = useHistory();
|
|
29905
30536
|
const addHistoryItem = historyManager.addItem;
|
|
29906
30537
|
const [initError, setInitError] = useState30(null);
|
|
@@ -29917,6 +30548,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
29917
30548
|
/* Idle */
|
|
29918
30549
|
);
|
|
29919
30550
|
const [compactMode, setCompactMode] = useState30(true);
|
|
30551
|
+
const [constrainHeight, setConstrainHeight] = useState30(true);
|
|
29920
30552
|
const [shellModeActive, setShellModeActive] = useState30(false);
|
|
29921
30553
|
const [showEscapePrompt, setShowEscapePrompt] = useState30(false);
|
|
29922
30554
|
const [messageQueue, setMessageQueue] = useState30([]);
|
|
@@ -29947,6 +30579,10 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
29947
30579
|
const [subagentMap, setSubagentMap] = useState30(/* @__PURE__ */ new Map());
|
|
29948
30580
|
const [, setDrainTick] = useState30(0);
|
|
29949
30581
|
const [pendingCommandConfirmation, setPendingCommandConfirmation] = useState30(null);
|
|
30582
|
+
const appContextValue = useMemo19(
|
|
30583
|
+
() => ({ version: VERSION, startupWarnings }),
|
|
30584
|
+
[startupWarnings]
|
|
30585
|
+
);
|
|
29950
30586
|
const runtimeRef = useRef18(null);
|
|
29951
30587
|
const sessionRef = useRef18(null);
|
|
29952
30588
|
const configAdapterRef = useRef18(null);
|
|
@@ -29986,12 +30622,12 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
29986
30622
|
const configAdapter = configAdapterRef.current ?? new DeepCodeConfigAdapter(cwd);
|
|
29987
30623
|
const isValidPath = useCallback27(
|
|
29988
30624
|
(candidate) => {
|
|
29989
|
-
const resolved =
|
|
29990
|
-
const relative2 =
|
|
29991
|
-
if (relative2.startsWith("..") ||
|
|
30625
|
+
const resolved = path16.resolve(cwd, candidate);
|
|
30626
|
+
const relative2 = path16.relative(cwd, resolved);
|
|
30627
|
+
if (relative2.startsWith("..") || path16.isAbsolute(relative2)) {
|
|
29992
30628
|
return false;
|
|
29993
30629
|
}
|
|
29994
|
-
return
|
|
30630
|
+
return fs9.existsSync(resolved);
|
|
29995
30631
|
},
|
|
29996
30632
|
[cwd]
|
|
29997
30633
|
);
|
|
@@ -30017,6 +30653,8 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
30017
30653
|
undoCommand,
|
|
30018
30654
|
compactCommand,
|
|
30019
30655
|
diffCommand,
|
|
30656
|
+
exportCommand,
|
|
30657
|
+
contextCommand,
|
|
30020
30658
|
providerCommand,
|
|
30021
30659
|
modelCommand,
|
|
30022
30660
|
modeCommand,
|
|
@@ -30190,7 +30828,9 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
30190
30828
|
reloadCommands: () => {
|
|
30191
30829
|
},
|
|
30192
30830
|
undo: handleUndo,
|
|
30193
|
-
compact: handleCompact
|
|
30831
|
+
compact: handleCompact,
|
|
30832
|
+
getMessages: () => sessionRef.current?.messages ?? [],
|
|
30833
|
+
getCwd: () => cwd
|
|
30194
30834
|
},
|
|
30195
30835
|
session: {
|
|
30196
30836
|
sessionShellAllowlist: sessionShellAllowlistRef.current
|
|
@@ -31228,6 +31868,13 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31228
31868
|
setCompactMode((prev) => !prev);
|
|
31229
31869
|
return;
|
|
31230
31870
|
}
|
|
31871
|
+
if (key.ctrl && input === "s") {
|
|
31872
|
+
setConstrainHeight(false);
|
|
31873
|
+
return;
|
|
31874
|
+
}
|
|
31875
|
+
if (!constrainHeight) {
|
|
31876
|
+
setConstrainHeight(true);
|
|
31877
|
+
}
|
|
31231
31878
|
if (approvalQueue.length > 0) {
|
|
31232
31879
|
const pressed = input.toLowerCase();
|
|
31233
31880
|
const enterArmed = approvalPromptVisibleAtRef.current !== null && Date.now() - approvalPromptVisibleAtRef.current >= APPROVAL_ENTER_ARM_DELAY_MS;
|
|
@@ -31346,9 +31993,9 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31346
31993
|
availableTerminalHeight: void 0,
|
|
31347
31994
|
staticAreaMaxItemHeight: 200,
|
|
31348
31995
|
mainControlsRef,
|
|
31349
|
-
constrainHeight
|
|
31996
|
+
constrainHeight,
|
|
31350
31997
|
currentModel,
|
|
31351
|
-
sessionName:
|
|
31998
|
+
sessionName: path16.basename(cwd),
|
|
31352
31999
|
isConfigInitialized: !isInitializing && !initError,
|
|
31353
32000
|
sessionStats: {
|
|
31354
32001
|
lastPromptTokenCount,
|
|
@@ -31374,6 +32021,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31374
32021
|
buffer,
|
|
31375
32022
|
commandContext,
|
|
31376
32023
|
compactMode,
|
|
32024
|
+
constrainHeight,
|
|
31377
32025
|
currentModel,
|
|
31378
32026
|
cwd,
|
|
31379
32027
|
dismissPromptSuggestion,
|
|
@@ -31405,62 +32053,38 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31405
32053
|
userMessages
|
|
31406
32054
|
]
|
|
31407
32055
|
);
|
|
31408
|
-
return /* @__PURE__ */
|
|
31409
|
-
/* @__PURE__ */
|
|
31410
|
-
|
|
31411
|
-
|
|
31412
|
-
|
|
31413
|
-
|
|
31414
|
-
|
|
31415
|
-
|
|
31416
|
-
|
|
31417
|
-
|
|
31418
|
-
|
|
31419
|
-
|
|
31420
|
-
|
|
32056
|
+
return /* @__PURE__ */ jsx57(AppContext.Provider, { value: appContextValue, children: /* @__PURE__ */ jsx57(CompactModeProvider, { value: { compactMode }, children: /* @__PURE__ */ jsx57(ConfigContext.Provider, { value: configAdapter, children: /* @__PURE__ */ jsx57(SettingsContext.Provider, { value: loadedSettings, children: /* @__PURE__ */ jsx57(StreamingContext.Provider, { value: streamingState, children: /* @__PURE__ */ jsx57(VimModeProvider, { initialVimEnabled: loadedSettings.merged.general?.vimMode ?? false, children: /* @__PURE__ */ jsx57(KeypressProvider, { kittyProtocolEnabled: false, config: configAdapter, children: /* @__PURE__ */ jsx57(ShellFocusContext.Provider, { value: true, children: /* @__PURE__ */ jsx57(AgentViewProvider, { children: /* @__PURE__ */ jsx57(BackgroundTaskViewProvider, { children: /* @__PURE__ */ jsx57(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ jsx57(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ jsxs51(Box47, { flexDirection: "column", flexGrow: 1, children: [
|
|
32057
|
+
/* @__PURE__ */ jsx57(
|
|
32058
|
+
AppHeader,
|
|
32059
|
+
{
|
|
32060
|
+
version: VERSION,
|
|
32061
|
+
cwd,
|
|
32062
|
+
providerLabel,
|
|
32063
|
+
mode: agentMode,
|
|
32064
|
+
iterationInfo
|
|
32065
|
+
}
|
|
32066
|
+
),
|
|
32067
|
+
initError ? /* @__PURE__ */ jsx57(Box47, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsxs51(Text55, { color: theme.status.error, children: [
|
|
32068
|
+
"Failed to initialize runtime: ",
|
|
32069
|
+
initError
|
|
32070
|
+
] }) }) : /* @__PURE__ */ jsxs51(Box47, { flexDirection: "column", flexGrow: 1, children: [
|
|
32071
|
+
/* @__PURE__ */ jsx57(
|
|
32072
|
+
MainContent,
|
|
31421
32073
|
{
|
|
31422
|
-
|
|
31423
|
-
|
|
31424
|
-
|
|
32074
|
+
history: historyManager.history,
|
|
32075
|
+
historyRemountKey,
|
|
32076
|
+
pendingAssistantText,
|
|
32077
|
+
liveToolCalls,
|
|
32078
|
+
terminalWidth,
|
|
32079
|
+
mainAreaWidth,
|
|
32080
|
+
isFocused: approvalQueue.length === 0
|
|
31425
32081
|
}
|
|
31426
32082
|
),
|
|
31427
|
-
/* @__PURE__ */
|
|
31428
|
-
" ",
|
|
31429
|
-
streamingState === "responding" ? "running" : streamingState === "waiting_for_confirmation" ? "waiting-approval" : "idle"
|
|
31430
|
-
] }),
|
|
31431
|
-
iterationInfo && /* @__PURE__ */ jsxs46(Text49, { color: theme.text.secondary, children: [
|
|
31432
|
-
" ",
|
|
31433
|
-
"iter ",
|
|
31434
|
-
iterationInfo.round,
|
|
31435
|
-
"/",
|
|
31436
|
-
iterationInfo.max
|
|
31437
|
-
] }),
|
|
31438
|
-
lastPromptTokenCount > 0 && /* @__PURE__ */ jsxs46(Text49, { color: theme.text.secondary, children: [
|
|
31439
|
-
" ",
|
|
31440
|
-
"\u2191",
|
|
31441
|
-
formatTokenCount(lastPromptTokenCount),
|
|
31442
|
-
" \u2193",
|
|
31443
|
-
formatTokenCount(lastOutputTokenCount)
|
|
31444
|
-
] })
|
|
32083
|
+
/* @__PURE__ */ jsx57(ShowMoreLines, { constrainHeight })
|
|
31445
32084
|
] }),
|
|
31446
|
-
|
|
31447
|
-
|
|
31448
|
-
|
|
31449
|
-
] }) }) : /* @__PURE__ */ jsx51(
|
|
31450
|
-
MainContent,
|
|
31451
|
-
{
|
|
31452
|
-
history: historyManager.history,
|
|
31453
|
-
historyRemountKey,
|
|
31454
|
-
pendingAssistantText,
|
|
31455
|
-
liveToolCalls,
|
|
31456
|
-
terminalWidth,
|
|
31457
|
-
mainAreaWidth,
|
|
31458
|
-
isFocused: approvalQueue.length === 0
|
|
31459
|
-
}
|
|
31460
|
-
),
|
|
31461
|
-
approvalQueue.length > 0 && /* @__PURE__ */ jsx51(Box41, { marginLeft: 2, marginRight: 2, marginTop: 1, children: /* @__PURE__ */ jsx51(ApprovalPrompt, { request: approvalQueue[0] }) }),
|
|
31462
|
-
dialogModel && /* @__PURE__ */ jsx51(CommandDialog, { title: dialogModel.title, lines: dialogModel.lines }),
|
|
31463
|
-
activeDialog === "provider" && /* @__PURE__ */ jsx51(
|
|
32085
|
+
approvalQueue.length > 0 && /* @__PURE__ */ jsx57(Box47, { marginLeft: 2, marginRight: 2, marginTop: 1, children: /* @__PURE__ */ jsx57(ApprovalPrompt, { request: approvalQueue[0] }) }),
|
|
32086
|
+
dialogModel && /* @__PURE__ */ jsx57(CommandDialog, { title: dialogModel.title, lines: dialogModel.lines }),
|
|
32087
|
+
activeDialog === "provider" && /* @__PURE__ */ jsx57(
|
|
31464
32088
|
ProviderDialog,
|
|
31465
32089
|
{
|
|
31466
32090
|
providers: listAvailableProviders(),
|
|
@@ -31475,7 +32099,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31475
32099
|
onClose: closeDialog
|
|
31476
32100
|
}
|
|
31477
32101
|
),
|
|
31478
|
-
activeDialog === "model" && /* @__PURE__ */
|
|
32102
|
+
activeDialog === "model" && /* @__PURE__ */ jsx57(
|
|
31479
32103
|
ModelDialog,
|
|
31480
32104
|
{
|
|
31481
32105
|
currentProvider: getSessionCommandState().provider,
|
|
@@ -31485,7 +32109,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31485
32109
|
onClose: closeDialog
|
|
31486
32110
|
}
|
|
31487
32111
|
),
|
|
31488
|
-
activeDialog === "theme" && /* @__PURE__ */
|
|
32112
|
+
activeDialog === "theme" && /* @__PURE__ */ jsx57(
|
|
31489
32113
|
ThemeDialog,
|
|
31490
32114
|
{
|
|
31491
32115
|
onSelect: handleSelectTheme,
|
|
@@ -31493,7 +32117,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31493
32117
|
onPreview: previewTheme
|
|
31494
32118
|
}
|
|
31495
32119
|
),
|
|
31496
|
-
activeDialog === "permissions" && /* @__PURE__ */
|
|
32120
|
+
activeDialog === "permissions" && /* @__PURE__ */ jsx57(
|
|
31497
32121
|
PermissionsDialog,
|
|
31498
32122
|
{
|
|
31499
32123
|
current: permissionModes,
|
|
@@ -31501,7 +32125,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31501
32125
|
onClose: closeDialog
|
|
31502
32126
|
}
|
|
31503
32127
|
),
|
|
31504
|
-
activeDialog === "auth" && runtimeRef.current && /* @__PURE__ */
|
|
32128
|
+
activeDialog === "auth" && runtimeRef.current && /* @__PURE__ */ jsx57(
|
|
31505
32129
|
AuthDialog,
|
|
31506
32130
|
{
|
|
31507
32131
|
clientId: runtimeRef.current.config.github.oauthClientId,
|
|
@@ -31514,8 +32138,8 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31514
32138
|
onClose: closeDialog
|
|
31515
32139
|
}
|
|
31516
32140
|
),
|
|
31517
|
-
activeDialog === "feedback" && /* @__PURE__ */
|
|
31518
|
-
activeDialog === "sessions" && /* @__PURE__ */
|
|
32141
|
+
activeDialog === "feedback" && /* @__PURE__ */ jsx57(FeedbackDialog, { cwd, onClose: closeDialog }),
|
|
32142
|
+
activeDialog === "sessions" && /* @__PURE__ */ jsx57(
|
|
31519
32143
|
SessionsDialog,
|
|
31520
32144
|
{
|
|
31521
32145
|
cwd,
|
|
@@ -31523,7 +32147,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31523
32147
|
onClose: closeDialog
|
|
31524
32148
|
}
|
|
31525
32149
|
),
|
|
31526
|
-
pendingCommandConfirmation && /* @__PURE__ */
|
|
32150
|
+
pendingCommandConfirmation && /* @__PURE__ */ jsx57(
|
|
31527
32151
|
CommandDialog,
|
|
31528
32152
|
{
|
|
31529
32153
|
title: "Confirm action",
|
|
@@ -31535,15 +32159,16 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31535
32159
|
footerText: "Press y or Enter to confirm. Press n or Esc to cancel."
|
|
31536
32160
|
}
|
|
31537
32161
|
),
|
|
31538
|
-
/* @__PURE__ */
|
|
32162
|
+
/* @__PURE__ */ jsx57(
|
|
31539
32163
|
SubagentsPanel,
|
|
31540
32164
|
{
|
|
31541
32165
|
subagents: Array.from(subagentMap.values()),
|
|
31542
32166
|
mainAreaWidth
|
|
31543
32167
|
}
|
|
31544
32168
|
),
|
|
31545
|
-
/* @__PURE__ */
|
|
31546
|
-
|
|
32169
|
+
/* @__PURE__ */ jsx57(Notifications, {}),
|
|
32170
|
+
/* @__PURE__ */ jsx57(Composer, {})
|
|
32171
|
+
] }) }) }) }) }) }) }) }) }) }) }) }) });
|
|
31547
32172
|
};
|
|
31548
32173
|
function formatProviderLabel(provider, model) {
|
|
31549
32174
|
return model ? `${provider} \u203A ${model}` : `${provider} \u203A (model unset)`;
|
|
@@ -31585,11 +32210,11 @@ function isInteractiveDialog(dialog) {
|
|
|
31585
32210
|
return dialog === "theme" || dialog === "permissions" || dialog === "auth" || dialog === "provider" || dialog === "model" || dialog === "feedback" || dialog === "sessions";
|
|
31586
32211
|
}
|
|
31587
32212
|
function tuiThemeFilePath(cwd) {
|
|
31588
|
-
return
|
|
32213
|
+
return path16.join(cwd, ".deepcode", "tui-theme.json");
|
|
31589
32214
|
}
|
|
31590
32215
|
function readSavedTheme(cwd) {
|
|
31591
32216
|
try {
|
|
31592
|
-
const parsed = JSON.parse(
|
|
32217
|
+
const parsed = JSON.parse(fs9.readFileSync(tuiThemeFilePath(cwd), "utf8"));
|
|
31593
32218
|
return typeof parsed.theme === "string" ? parsed.theme : null;
|
|
31594
32219
|
} catch {
|
|
31595
32220
|
return null;
|
|
@@ -31597,16 +32222,16 @@ function readSavedTheme(cwd) {
|
|
|
31597
32222
|
}
|
|
31598
32223
|
function writeSavedTheme(cwd, themeName) {
|
|
31599
32224
|
const file = tuiThemeFilePath(cwd);
|
|
31600
|
-
|
|
31601
|
-
|
|
32225
|
+
fs9.mkdirSync(path16.dirname(file), { recursive: true });
|
|
32226
|
+
fs9.writeFileSync(file, `${JSON.stringify({ theme: themeName }, null, 2)}
|
|
31602
32227
|
`);
|
|
31603
32228
|
}
|
|
31604
32229
|
function tuiProviderFilePath(cwd) {
|
|
31605
|
-
return
|
|
32230
|
+
return path16.join(cwd, ".deepcode", "tui-provider.json");
|
|
31606
32231
|
}
|
|
31607
32232
|
function readSavedProvider(cwd) {
|
|
31608
32233
|
try {
|
|
31609
|
-
const parsed = JSON.parse(
|
|
32234
|
+
const parsed = JSON.parse(fs9.readFileSync(tuiProviderFilePath(cwd), "utf8"));
|
|
31610
32235
|
const result = ProviderIdSchema.safeParse(parsed.provider);
|
|
31611
32236
|
if (!result.success) return null;
|
|
31612
32237
|
return {
|
|
@@ -31619,8 +32244,8 @@ function readSavedProvider(cwd) {
|
|
|
31619
32244
|
}
|
|
31620
32245
|
function writeSavedProvider(cwd, provider, model) {
|
|
31621
32246
|
const file = tuiProviderFilePath(cwd);
|
|
31622
|
-
|
|
31623
|
-
|
|
32247
|
+
fs9.mkdirSync(path16.dirname(file), { recursive: true });
|
|
32248
|
+
fs9.writeFileSync(file, `${JSON.stringify({ provider, model }, null, 2)}
|
|
31624
32249
|
`);
|
|
31625
32250
|
}
|
|
31626
32251
|
function errorMessage(error) {
|
|
@@ -31666,22 +32291,22 @@ function formatAuthSummary(config) {
|
|
|
31666
32291
|
var ApprovalPrompt = ({ request }) => {
|
|
31667
32292
|
if (!request) return null;
|
|
31668
32293
|
const operationLabel = formatApprovalOperationLabel(request);
|
|
31669
|
-
return /* @__PURE__ */
|
|
31670
|
-
/* @__PURE__ */
|
|
32294
|
+
return /* @__PURE__ */ jsxs51(Box47, { flexDirection: "column", marginTop: 1, children: [
|
|
32295
|
+
/* @__PURE__ */ jsxs51(Text55, { color: theme.status.warning, children: [
|
|
31671
32296
|
"\u26A0 Allow ",
|
|
31672
32297
|
operationLabel,
|
|
31673
32298
|
"?"
|
|
31674
32299
|
] }),
|
|
31675
|
-
request.path && /* @__PURE__ */
|
|
32300
|
+
request.path && /* @__PURE__ */ jsxs51(Text55, { color: theme.text.secondary, children: [
|
|
31676
32301
|
" ",
|
|
31677
32302
|
request.path
|
|
31678
32303
|
] }),
|
|
31679
|
-
request.preview?.command && /* @__PURE__ */
|
|
32304
|
+
request.preview?.command && /* @__PURE__ */ jsxs51(Text55, { color: theme.text.secondary, children: [
|
|
31680
32305
|
" $ ",
|
|
31681
32306
|
request.preview.command,
|
|
31682
32307
|
request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
|
|
31683
32308
|
] }),
|
|
31684
|
-
/* @__PURE__ */
|
|
32309
|
+
/* @__PURE__ */ jsx57(Text55, { color: theme.text.secondary, children: " [\u21B5/y] once [s] session [a] always [n] deny" })
|
|
31685
32310
|
] });
|
|
31686
32311
|
};
|
|
31687
32312
|
function formatApprovalOperationLabel(request) {
|
|
@@ -31742,7 +32367,7 @@ var DeepCodeConfigAdapter = class {
|
|
|
31742
32367
|
}
|
|
31743
32368
|
};
|
|
31744
32369
|
function App(props) {
|
|
31745
|
-
return /* @__PURE__ */
|
|
32370
|
+
return /* @__PURE__ */ jsx58(
|
|
31746
32371
|
AppContainer,
|
|
31747
32372
|
{
|
|
31748
32373
|
cwd: props.cwd,
|