deepcode-ai 1.2.24 → 1.2.28
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 +438 -397
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7863,8 +7863,8 @@ import os4 from "os";
|
|
|
7863
7863
|
import path62 from "path";
|
|
7864
7864
|
import fs12 from "fs";
|
|
7865
7865
|
import path19 from "path";
|
|
7866
|
-
import { isValidElement, useCallback as useCallback28, useEffect as useEffect31, useMemo as useMemo19, useRef as useRef21, useState as useState33 } from "react";
|
|
7867
|
-
import { Box as
|
|
7866
|
+
import React41, { isValidElement, useCallback as useCallback28, useEffect as useEffect31, useMemo as useMemo19, useRef as useRef21, useState as useState33 } from "react";
|
|
7867
|
+
import { Box as Box53, Text as Text61, 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";
|
|
@@ -9873,9 +9873,11 @@ import fs7 from "fs";
|
|
|
9873
9873
|
import fsPromises from "fs/promises";
|
|
9874
9874
|
import path142 from "path";
|
|
9875
9875
|
import { Fragment as Fragment10, jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9876
|
-
import { memo, useMemo as useMemo12 } from "react";
|
|
9877
9876
|
import { Box as Box42, Text as Text50 } from "ink";
|
|
9878
9877
|
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9878
|
+
import { memo, useMemo as useMemo12 } from "react";
|
|
9879
|
+
import { Box as Box43, Text as Text51 } from "ink";
|
|
9880
|
+
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9879
9881
|
import { useState as useState27, useEffect as useEffect27, useRef as useRef17 } from "react";
|
|
9880
9882
|
import { useState as useState25, useEffect as useEffect25, useRef as useRef15 } from "react";
|
|
9881
9883
|
import { useState as useState26, useEffect as useEffect26, useRef as useRef16 } from "react";
|
|
@@ -9888,35 +9890,35 @@ import process4 from "process";
|
|
|
9888
9890
|
import fs10 from "fs";
|
|
9889
9891
|
import os7 from "os";
|
|
9890
9892
|
import path17 from "path";
|
|
9891
|
-
import { Box as Box43, Text as Text51 } from "ink";
|
|
9892
|
-
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9893
|
-
import { useCallback as useCallback21, useMemo as useMemo13, useRef as useRef18 } from "react";
|
|
9894
9893
|
import { Box as Box44, Text as Text52 } from "ink";
|
|
9895
9894
|
import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
9895
|
+
import { useCallback as useCallback21, useMemo as useMemo13, useRef as useRef18 } from "react";
|
|
9896
|
+
import { Box as Box45, Text as Text53 } from "ink";
|
|
9897
|
+
import { jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
9896
9898
|
import { useCallback as useCallback22, useMemo as useMemo14, useState as useState28 } from "react";
|
|
9897
|
-
import { Box as
|
|
9898
|
-
import { Fragment as Fragment11, jsx as
|
|
9899
|
+
import { Box as Box46, Text as Text54, useInput as useInput3 } from "ink";
|
|
9900
|
+
import { Fragment as Fragment11, jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
9899
9901
|
import { useCallback as useCallback23, useState as useState29 } from "react";
|
|
9900
|
-
import { Box as Box46, Text as Text54 } from "ink";
|
|
9901
|
-
import { jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
9902
|
-
import { useCallback as useCallback24, useEffect as useEffect28, useMemo as useMemo15, useRef as useRef19, useState as useState30 } from "react";
|
|
9903
9902
|
import { Box as Box47, Text as Text55 } from "ink";
|
|
9904
9903
|
import { jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
9905
|
-
import { useCallback as
|
|
9906
|
-
import { Box as Box48, Text as Text56
|
|
9904
|
+
import { useCallback as useCallback24, useEffect as useEffect28, useMemo as useMemo15, useRef as useRef19, useState as useState30 } from "react";
|
|
9905
|
+
import { Box as Box48, Text as Text56 } from "ink";
|
|
9907
9906
|
import { jsx as jsx58, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
9907
|
+
import { useCallback as useCallback25, useEffect as useEffect29, useMemo as useMemo16, useRef as useRef20, useState as useState31 } from "react";
|
|
9908
|
+
import { Box as Box49, Text as Text57, useInput as useInput4 } from "ink";
|
|
9909
|
+
import { jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
9908
9910
|
import fs11 from "fs";
|
|
9909
9911
|
import path18 from "path";
|
|
9910
9912
|
import { useCallback as useCallback26, useMemo as useMemo17 } from "react";
|
|
9911
|
-
import { Box as
|
|
9912
|
-
import { jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
9913
|
-
import { useCallback as useCallback27, useEffect as useEffect30, useMemo as useMemo18, useState as useState32 } from "react";
|
|
9914
|
-
import { Box as Box50, Text as Text58, useInput as useInput5 } from "ink";
|
|
9913
|
+
import { Box as Box50, Text as Text58 } from "ink";
|
|
9915
9914
|
import { jsx as jsx60, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
9916
|
-
import {
|
|
9915
|
+
import { useCallback as useCallback27, useEffect as useEffect30, useMemo as useMemo18, useState as useState32 } from "react";
|
|
9916
|
+
import { Box as Box51, Text as Text59, useInput as useInput5 } from "ink";
|
|
9917
9917
|
import { jsx as jsx61, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
9918
|
+
import { Box as Box52, Text as Text60 } from "ink";
|
|
9918
9919
|
import { jsx as jsx62, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
9919
|
-
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
9920
|
+
import { jsx as jsx63, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
9921
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
9920
9922
|
async function createRuntime(options) {
|
|
9921
9923
|
const worktree = path10.resolve(options.cwd);
|
|
9922
9924
|
const config = await new ConfigLoader().load({ cwd: worktree, configPath: options.configPath });
|
|
@@ -11509,7 +11511,7 @@ function parseVersion(version) {
|
|
|
11509
11511
|
if (!match) return null;
|
|
11510
11512
|
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
11511
11513
|
}
|
|
11512
|
-
var VERSION = "1.2.
|
|
11514
|
+
var VERSION = "1.2.28".length > 0 ? "1.2.28" : "0.0.0-dev";
|
|
11513
11515
|
async function updateCommand() {
|
|
11514
11516
|
writeStdoutLine(`Current version: ${VERSION}`);
|
|
11515
11517
|
const update = await checkForUpdate(VERSION, { force: true });
|
|
@@ -28727,7 +28729,8 @@ var AppHeader = ({
|
|
|
28727
28729
|
providerLabel,
|
|
28728
28730
|
mode,
|
|
28729
28731
|
iterationInfo,
|
|
28730
|
-
updateAvailable
|
|
28732
|
+
updateAvailable,
|
|
28733
|
+
sessionName
|
|
28731
28734
|
}) => {
|
|
28732
28735
|
const {
|
|
28733
28736
|
streamingState,
|
|
@@ -28787,6 +28790,10 @@ var AppHeader = ({
|
|
|
28787
28790
|
] }),
|
|
28788
28791
|
/* @__PURE__ */ jsxs45(Box41, { flexDirection: "row", children: [
|
|
28789
28792
|
/* @__PURE__ */ jsx51(Text49, { color: theme.text.secondary, dimColor: true, children: displayDir }),
|
|
28793
|
+
sessionName && /* @__PURE__ */ jsxs45(Text49, { color: theme.text.accent, dimColor: true, children: [
|
|
28794
|
+
" ",
|
|
28795
|
+
sessionName
|
|
28796
|
+
] }),
|
|
28790
28797
|
branchName && /* @__PURE__ */ jsxs45(Text49, { color: theme.text.accent, dimColor: true, children: [
|
|
28791
28798
|
" ",
|
|
28792
28799
|
"(",
|
|
@@ -28813,6 +28820,83 @@ var AppHeader = ({
|
|
|
28813
28820
|
}
|
|
28814
28821
|
);
|
|
28815
28822
|
};
|
|
28823
|
+
var APPROVAL_PREVIEW_MAX_LINES = 4;
|
|
28824
|
+
function formatApprovalOperationLabel(request) {
|
|
28825
|
+
const labels = {
|
|
28826
|
+
write_file: "escrever arquivo",
|
|
28827
|
+
edit_file: "editar arquivo",
|
|
28828
|
+
read_file: "ler arquivo",
|
|
28829
|
+
bash: "executar comando shell",
|
|
28830
|
+
shell: "executar comando shell",
|
|
28831
|
+
git: "executar comando git",
|
|
28832
|
+
fetch_web: "acessar URL",
|
|
28833
|
+
search_text: "buscar em arquivos",
|
|
28834
|
+
list_dir: "listar diret\xF3rio",
|
|
28835
|
+
analyze_code: "analisar c\xF3digo"
|
|
28836
|
+
};
|
|
28837
|
+
return labels[request.operation] ?? request.operation.replace(/_/g, " ");
|
|
28838
|
+
}
|
|
28839
|
+
var ApprovalPrompt = ({ request, queueLength = 1 }) => {
|
|
28840
|
+
if (!request) return null;
|
|
28841
|
+
const operationLabel = formatApprovalOperationLabel(request);
|
|
28842
|
+
const hasDiff = !!(request.diff?.before && request.diff?.after);
|
|
28843
|
+
let beforeLines = [];
|
|
28844
|
+
let afterLines = [];
|
|
28845
|
+
let singleLines = [];
|
|
28846
|
+
let truncated = false;
|
|
28847
|
+
if (hasDiff) {
|
|
28848
|
+
beforeLines = request.diff.before.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
|
|
28849
|
+
afterLines = request.diff.after.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
|
|
28850
|
+
truncated = request.diff.before.split("\n").length > APPROVAL_PREVIEW_MAX_LINES || request.diff.after.split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
|
|
28851
|
+
} else {
|
|
28852
|
+
const raw = request.diff?.after ?? request.preview?.content ?? "";
|
|
28853
|
+
singleLines = raw.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
|
|
28854
|
+
truncated = raw.split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
|
|
28855
|
+
}
|
|
28856
|
+
return /* @__PURE__ */ jsxs46(
|
|
28857
|
+
Box42,
|
|
28858
|
+
{
|
|
28859
|
+
flexDirection: "column",
|
|
28860
|
+
borderStyle: "round",
|
|
28861
|
+
borderColor: theme.status.warning,
|
|
28862
|
+
paddingX: 1,
|
|
28863
|
+
marginLeft: 2,
|
|
28864
|
+
marginRight: 2,
|
|
28865
|
+
marginTop: 1,
|
|
28866
|
+
children: [
|
|
28867
|
+
/* @__PURE__ */ jsxs46(Text50, { bold: true, color: theme.status.warning, children: [
|
|
28868
|
+
"\u26A0 ",
|
|
28869
|
+
operationLabel,
|
|
28870
|
+
queueLength > 1 && /* @__PURE__ */ jsx52(Text50, { color: theme.text.secondary, children: ` (1 de ${queueLength})` })
|
|
28871
|
+
] }),
|
|
28872
|
+
request.path && /* @__PURE__ */ jsx52(Text50, { color: theme.text.secondary, children: request.path }),
|
|
28873
|
+
request.preview?.command && /* @__PURE__ */ jsxs46(Text50, { color: theme.text.primary, children: [
|
|
28874
|
+
"$ ",
|
|
28875
|
+
request.preview.command,
|
|
28876
|
+
request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
|
|
28877
|
+
] }),
|
|
28878
|
+
hasDiff && /* @__PURE__ */ jsxs46(Box42, { flexDirection: "column", marginTop: 1, children: [
|
|
28879
|
+
/* @__PURE__ */ jsx52(Text50, { color: theme.status.error, dimColor: true, children: "\u2500\u2500 antes" }),
|
|
28880
|
+
beforeLines.map((line, i) => /* @__PURE__ */ jsxs46(Text50, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
|
|
28881
|
+
"\u2212 ",
|
|
28882
|
+
line
|
|
28883
|
+
] }, `b${i}`)),
|
|
28884
|
+
/* @__PURE__ */ jsx52(Text50, { color: theme.status.success, dimColor: true, children: "\u2500\u2500 depois" }),
|
|
28885
|
+
afterLines.map((line, i) => /* @__PURE__ */ jsxs46(Text50, { color: theme.status.success, dimColor: true, wrap: "truncate", children: [
|
|
28886
|
+
"+ ",
|
|
28887
|
+
line
|
|
28888
|
+
] }, `a${i}`)),
|
|
28889
|
+
truncated && /* @__PURE__ */ jsx52(Text50, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
|
|
28890
|
+
] }),
|
|
28891
|
+
!hasDiff && singleLines.length > 0 && /* @__PURE__ */ jsxs46(Box42, { flexDirection: "column", marginTop: 1, children: [
|
|
28892
|
+
singleLines.map((line, i) => /* @__PURE__ */ jsx52(Text50, { color: theme.ui.comment, dimColor: true, wrap: "truncate", children: line }, i)),
|
|
28893
|
+
truncated && /* @__PURE__ */ jsx52(Text50, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
|
|
28894
|
+
] }),
|
|
28895
|
+
/* @__PURE__ */ jsx52(Box42, { marginTop: 1, children: /* @__PURE__ */ jsx52(Text50, { color: theme.text.secondary, dimColor: true, children: "[\u21B5/y] uma vez [s] sess\xE3o [a] sempre [n/Esc] negar" }) })
|
|
28896
|
+
]
|
|
28897
|
+
}
|
|
28898
|
+
);
|
|
28899
|
+
};
|
|
28816
28900
|
var STICKY_TODO_MAX_VISIBLE_ITEMS = 5;
|
|
28817
28901
|
var MIN_HISTORY_ITEMS_AFTER_TODO_BEFORE_STICKY = 2;
|
|
28818
28902
|
var STICKY_TODO_ROWS_PER_VISIBLE_ITEM = 5;
|
|
@@ -28908,8 +28992,8 @@ var StickyTodoListComponent = ({
|
|
|
28908
28992
|
const hidden = ordered.length - visible.length;
|
|
28909
28993
|
const numColWidth = Math.max(...visible.map((t2, i) => (numberById.get(t2.id) ?? `${i + 1}.`).length)) + 1;
|
|
28910
28994
|
const contentColWidth = Math.max(1, width - numColWidth - 6);
|
|
28911
|
-
return /* @__PURE__ */
|
|
28912
|
-
|
|
28995
|
+
return /* @__PURE__ */ jsxs47(
|
|
28996
|
+
Box43,
|
|
28913
28997
|
{
|
|
28914
28998
|
marginX: 2,
|
|
28915
28999
|
width,
|
|
@@ -28918,15 +29002,15 @@ var StickyTodoListComponent = ({
|
|
|
28918
29002
|
borderColor: theme.border.default,
|
|
28919
29003
|
paddingX: 1,
|
|
28920
29004
|
children: [
|
|
28921
|
-
/* @__PURE__ */
|
|
29005
|
+
/* @__PURE__ */ jsx53(Text51, { color: theme.text.secondary, bold: true, children: "Tarefas em andamento" }),
|
|
28922
29006
|
visible.map((todo, i) => {
|
|
28923
29007
|
const num = numberById.get(todo.id) ?? `${i + 1}.`;
|
|
28924
29008
|
const color = todo.status === "in_progress" ? theme.status.success : theme.text.primary;
|
|
28925
|
-
return /* @__PURE__ */
|
|
28926
|
-
/* @__PURE__ */
|
|
28927
|
-
/* @__PURE__ */
|
|
28928
|
-
/* @__PURE__ */
|
|
28929
|
-
|
|
29009
|
+
return /* @__PURE__ */ jsxs47(Box43, { flexDirection: "row", height: 1, children: [
|
|
29010
|
+
/* @__PURE__ */ jsx53(Box43, { width: numColWidth, children: /* @__PURE__ */ jsx53(Text51, { color: theme.text.secondary, children: num }) }),
|
|
29011
|
+
/* @__PURE__ */ jsx53(Box43, { width: 2, children: /* @__PURE__ */ jsx53(Text51, { color, children: STATUS_ICONS3[todo.status] }) }),
|
|
29012
|
+
/* @__PURE__ */ jsx53(Box43, { width: contentColWidth, children: /* @__PURE__ */ jsx53(
|
|
29013
|
+
Text51,
|
|
28930
29014
|
{
|
|
28931
29015
|
color,
|
|
28932
29016
|
strikethrough: todo.status === "completed",
|
|
@@ -28936,10 +29020,10 @@ var StickyTodoListComponent = ({
|
|
|
28936
29020
|
) })
|
|
28937
29021
|
] }, todo.id);
|
|
28938
29022
|
}),
|
|
28939
|
-
hidden > 0 && /* @__PURE__ */
|
|
28940
|
-
/* @__PURE__ */
|
|
28941
|
-
/* @__PURE__ */
|
|
28942
|
-
/* @__PURE__ */
|
|
29023
|
+
hidden > 0 && /* @__PURE__ */ jsxs47(Box43, { flexDirection: "row", height: 1, children: [
|
|
29024
|
+
/* @__PURE__ */ jsx53(Box43, { width: numColWidth }),
|
|
29025
|
+
/* @__PURE__ */ jsx53(Box43, { width: 2 }),
|
|
29026
|
+
/* @__PURE__ */ jsx53(Box43, { width: contentColWidth, children: /* @__PURE__ */ jsxs47(Text51, { color: theme.text.secondary, wrap: "truncate-end", children: [
|
|
28943
29027
|
"... e mais ",
|
|
28944
29028
|
hidden
|
|
28945
29029
|
] }) })
|
|
@@ -29510,6 +29594,22 @@ var undoCommand = {
|
|
|
29510
29594
|
};
|
|
29511
29595
|
}
|
|
29512
29596
|
};
|
|
29597
|
+
var vimCommand = {
|
|
29598
|
+
name: "vim",
|
|
29599
|
+
get description() {
|
|
29600
|
+
return t("Toggle Vim mode (Normal/Insert)");
|
|
29601
|
+
},
|
|
29602
|
+
kind: "built-in",
|
|
29603
|
+
supportedModes: ["interactive"],
|
|
29604
|
+
action: async (context) => {
|
|
29605
|
+
const enabled = await context.ui.toggleVimEnabled();
|
|
29606
|
+
return {
|
|
29607
|
+
type: "message",
|
|
29608
|
+
messageType: "info",
|
|
29609
|
+
content: enabled ? "Vim mode ativado. Pressione 'i' para INSERT, 'Esc' para NORMAL." : "Vim mode desativado."
|
|
29610
|
+
};
|
|
29611
|
+
}
|
|
29612
|
+
};
|
|
29513
29613
|
var compactCommand = {
|
|
29514
29614
|
name: "compact",
|
|
29515
29615
|
get description() {
|
|
@@ -29973,10 +30073,10 @@ var CommandDialog = ({
|
|
|
29973
30073
|
title,
|
|
29974
30074
|
lines,
|
|
29975
30075
|
footerText = "Press Esc or Enter to close."
|
|
29976
|
-
}) => /* @__PURE__ */
|
|
29977
|
-
/* @__PURE__ */
|
|
29978
|
-
/* @__PURE__ */
|
|
29979
|
-
/* @__PURE__ */
|
|
30076
|
+
}) => /* @__PURE__ */ jsx54(Box44, { marginLeft: 2, marginRight: 2, marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs48(Box44, { borderStyle: "round", borderColor: theme.border.default, padding: 1, flexDirection: "column", children: [
|
|
30077
|
+
/* @__PURE__ */ jsx54(Text52, { bold: true, color: theme.text.accent, children: title }),
|
|
30078
|
+
/* @__PURE__ */ jsx54(Box44, { marginTop: 1, flexDirection: "column", children: lines.map((line, index) => /* @__PURE__ */ jsx54(Text52, { color: theme.text.primary, children: line }, index)) }),
|
|
30079
|
+
/* @__PURE__ */ jsx54(Box44, { marginTop: 1, children: /* @__PURE__ */ jsx54(Text52, { color: theme.text.secondary, children: footerText }) })
|
|
29980
30080
|
] }) });
|
|
29981
30081
|
var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
29982
30082
|
const originalTheme = useRef18(themeManager.getActiveTheme().name);
|
|
@@ -30013,8 +30113,8 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
30013
30113
|
},
|
|
30014
30114
|
[onPreview]
|
|
30015
30115
|
);
|
|
30016
|
-
return /* @__PURE__ */
|
|
30017
|
-
|
|
30116
|
+
return /* @__PURE__ */ jsxs49(
|
|
30117
|
+
Box45,
|
|
30018
30118
|
{
|
|
30019
30119
|
flexDirection: "column",
|
|
30020
30120
|
borderStyle: "round",
|
|
@@ -30023,8 +30123,8 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
30023
30123
|
marginLeft: 2,
|
|
30024
30124
|
marginRight: 2,
|
|
30025
30125
|
children: [
|
|
30026
|
-
/* @__PURE__ */
|
|
30027
|
-
/* @__PURE__ */
|
|
30126
|
+
/* @__PURE__ */ jsx55(Text53, { bold: true, color: theme.text.accent, children: "Select theme" }),
|
|
30127
|
+
/* @__PURE__ */ jsx55(
|
|
30028
30128
|
RadioButtonSelect,
|
|
30029
30129
|
{
|
|
30030
30130
|
items,
|
|
@@ -30034,7 +30134,7 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
30034
30134
|
isFocused: true
|
|
30035
30135
|
}
|
|
30036
30136
|
),
|
|
30037
|
-
/* @__PURE__ */
|
|
30137
|
+
/* @__PURE__ */ jsx55(Text53, { color: theme.text.secondary, children: "\u2191\u2193 navegar \xB7 Enter aplicar \xB7 Esc cancelar" })
|
|
30038
30138
|
]
|
|
30039
30139
|
}
|
|
30040
30140
|
);
|
|
@@ -30264,8 +30364,8 @@ var ProviderDialog = ({
|
|
|
30264
30364
|
);
|
|
30265
30365
|
const statusColor2 = status ? status.ok ? status.text.startsWith("\u2713") ? theme.status.success : theme.text.secondary : theme.status.error : void 0;
|
|
30266
30366
|
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";
|
|
30267
|
-
return /* @__PURE__ */
|
|
30268
|
-
|
|
30367
|
+
return /* @__PURE__ */ jsxs50(
|
|
30368
|
+
Box46,
|
|
30269
30369
|
{
|
|
30270
30370
|
flexDirection: "column",
|
|
30271
30371
|
borderStyle: "round",
|
|
@@ -30276,19 +30376,19 @@ var ProviderDialog = ({
|
|
|
30276
30376
|
marginRight: 2,
|
|
30277
30377
|
minWidth: 44,
|
|
30278
30378
|
children: [
|
|
30279
|
-
/* @__PURE__ */
|
|
30280
|
-
/* @__PURE__ */
|
|
30281
|
-
phase !== "providers" && /* @__PURE__ */
|
|
30282
|
-
/* @__PURE__ */
|
|
30283
|
-
/* @__PURE__ */
|
|
30379
|
+
/* @__PURE__ */ jsxs50(Box46, { marginBottom: 1, gap: 1, children: [
|
|
30380
|
+
/* @__PURE__ */ jsx56(Text54, { bold: true, color: theme.text.accent, children: "Providers" }),
|
|
30381
|
+
phase !== "providers" && /* @__PURE__ */ jsxs50(Fragment11, { children: [
|
|
30382
|
+
/* @__PURE__ */ jsx56(Text54, { color: theme.text.secondary, children: "\u203A" }),
|
|
30383
|
+
/* @__PURE__ */ jsx56(Text54, { bold: true, color: theme.text.primary, children: selectedProvider })
|
|
30284
30384
|
] }),
|
|
30285
|
-
phase === "providers" && currentModel && /* @__PURE__ */
|
|
30385
|
+
phase === "providers" && currentModel && /* @__PURE__ */ jsxs50(Text54, { color: theme.text.secondary, children: [
|
|
30286
30386
|
" (",
|
|
30287
30387
|
currentModel,
|
|
30288
30388
|
")"
|
|
30289
30389
|
] })
|
|
30290
30390
|
] }),
|
|
30291
|
-
phase === "providers" && /* @__PURE__ */
|
|
30391
|
+
phase === "providers" && /* @__PURE__ */ jsx56(
|
|
30292
30392
|
BaseSelectionList,
|
|
30293
30393
|
{
|
|
30294
30394
|
items: providerItems,
|
|
@@ -30298,25 +30398,25 @@ var ProviderDialog = ({
|
|
|
30298
30398
|
maxItemsToShow: 8,
|
|
30299
30399
|
renderItem: (item, { titleColor }) => {
|
|
30300
30400
|
const { icon, color, label } = getStatusMark(item.provider, item.keyIsSet);
|
|
30301
|
-
return /* @__PURE__ */
|
|
30302
|
-
/* @__PURE__ */
|
|
30303
|
-
/* @__PURE__ */
|
|
30304
|
-
/* @__PURE__ */
|
|
30305
|
-
item.isCurrent && /* @__PURE__ */
|
|
30401
|
+
return /* @__PURE__ */ jsxs50(Box46, { gap: 1, children: [
|
|
30402
|
+
/* @__PURE__ */ jsx56(Text54, { color, children: icon }),
|
|
30403
|
+
/* @__PURE__ */ jsx56(Text54, { color: titleColor, bold: item.isCurrent, children: item.provider.padEnd(12) }),
|
|
30404
|
+
/* @__PURE__ */ jsx56(Text54, { color, dimColor: !item.keyIsSet && !item.isLocal, children: label }),
|
|
30405
|
+
item.isCurrent && /* @__PURE__ */ jsx56(Text54, { color: theme.text.accent, children: "\u25B6" })
|
|
30306
30406
|
] });
|
|
30307
30407
|
}
|
|
30308
30408
|
}
|
|
30309
30409
|
),
|
|
30310
|
-
phase === "actions" && /* @__PURE__ */
|
|
30311
|
-
/* @__PURE__ */
|
|
30312
|
-
/* @__PURE__ */
|
|
30313
|
-
/* @__PURE__ */
|
|
30410
|
+
phase === "actions" && /* @__PURE__ */ jsxs50(Fragment11, { children: [
|
|
30411
|
+
/* @__PURE__ */ jsxs50(Box46, { marginBottom: 1, gap: 1, children: [
|
|
30412
|
+
/* @__PURE__ */ jsx56(Text54, { color: theme.ui.comment, children: "session" }),
|
|
30413
|
+
/* @__PURE__ */ jsx56(Text54, { color: selectedProvider === currentProvider ? theme.text.accent : theme.text.secondary, children: selectedProvider === currentProvider ? "active" : `still using ${currentProvider}` })
|
|
30314
30414
|
] }),
|
|
30315
|
-
/* @__PURE__ */
|
|
30316
|
-
/* @__PURE__ */
|
|
30317
|
-
isLocal ? /* @__PURE__ */
|
|
30415
|
+
/* @__PURE__ */ jsxs50(Box46, { marginBottom: 1, gap: 1, children: [
|
|
30416
|
+
/* @__PURE__ */ jsx56(Text54, { color: theme.ui.comment, children: "key" }),
|
|
30417
|
+
isLocal ? /* @__PURE__ */ jsx56(Text54, { color: theme.text.accent, children: "no key required" }) : keyHint ? /* @__PURE__ */ jsx56(Text54, { color: theme.text.secondary, children: keyHint }) : /* @__PURE__ */ jsx56(Text54, { color: theme.ui.comment, dimColor: true, children: "not configured" })
|
|
30318
30418
|
] }),
|
|
30319
|
-
/* @__PURE__ */
|
|
30419
|
+
/* @__PURE__ */ jsx56(
|
|
30320
30420
|
BaseSelectionList,
|
|
30321
30421
|
{
|
|
30322
30422
|
items: actionItems,
|
|
@@ -30324,10 +30424,10 @@ var ProviderDialog = ({
|
|
|
30324
30424
|
isFocused: !isBusy,
|
|
30325
30425
|
showNumbers: false,
|
|
30326
30426
|
maxItemsToShow: 6,
|
|
30327
|
-
renderItem: (item, { titleColor }) => /* @__PURE__ */
|
|
30328
|
-
/* @__PURE__ */
|
|
30329
|
-
/* @__PURE__ */
|
|
30330
|
-
item.hint && /* @__PURE__ */
|
|
30427
|
+
renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs50(Box46, { gap: 1, children: [
|
|
30428
|
+
/* @__PURE__ */ jsx56(Text54, { color: titleColor, children: item.icon }),
|
|
30429
|
+
/* @__PURE__ */ jsx56(Text54, { color: titleColor, children: item.label }),
|
|
30430
|
+
item.hint && /* @__PURE__ */ jsxs50(Text54, { color: theme.ui.comment, dimColor: true, children: [
|
|
30331
30431
|
"(",
|
|
30332
30432
|
item.hint,
|
|
30333
30433
|
")"
|
|
@@ -30336,26 +30436,26 @@ var ProviderDialog = ({
|
|
|
30336
30436
|
}
|
|
30337
30437
|
)
|
|
30338
30438
|
] }),
|
|
30339
|
-
phase === "apiKey" && /* @__PURE__ */
|
|
30340
|
-
/* @__PURE__ */
|
|
30341
|
-
/* @__PURE__ */
|
|
30342
|
-
isLocal ? /* @__PURE__ */
|
|
30439
|
+
phase === "apiKey" && /* @__PURE__ */ jsxs50(Box46, { flexDirection: "column", gap: 1, marginBottom: 1, children: [
|
|
30440
|
+
/* @__PURE__ */ jsxs50(Box46, { gap: 1, children: [
|
|
30441
|
+
/* @__PURE__ */ jsx56(Text54, { color: theme.ui.comment, children: "current" }),
|
|
30442
|
+
isLocal ? /* @__PURE__ */ jsx56(Text54, { color: theme.text.accent, children: "no key required" }) : keyHint ? /* @__PURE__ */ jsx56(Text54, { color: theme.text.secondary, children: keyHint }) : /* @__PURE__ */ jsx56(Text54, { color: theme.ui.comment, dimColor: true, children: "not set" })
|
|
30343
30443
|
] }),
|
|
30344
|
-
/* @__PURE__ */
|
|
30345
|
-
/* @__PURE__ */
|
|
30346
|
-
/* @__PURE__ */
|
|
30444
|
+
/* @__PURE__ */ jsxs50(Box46, { gap: 1, children: [
|
|
30445
|
+
/* @__PURE__ */ jsx56(Text54, { color: theme.ui.comment, children: "new key" }),
|
|
30446
|
+
/* @__PURE__ */ jsx56(Box46, { borderStyle: "single", borderColor: theme.border.focused, paddingX: 1, children: /* @__PURE__ */ jsx56(Text54, { color: theme.text.accent, children: apiKeyInput.length > 0 ? maskApiKeyInput(apiKeyInput.length) : /* @__PURE__ */ jsx56(Text54, { color: theme.ui.comment, dimColor: true, children: "paste or type\u2026" }) }) })
|
|
30347
30447
|
] })
|
|
30348
30448
|
] }),
|
|
30349
|
-
status && /* @__PURE__ */
|
|
30350
|
-
phase === "actions" && testLatencyMs !== void 0 && /* @__PURE__ */
|
|
30351
|
-
/* @__PURE__ */
|
|
30449
|
+
status && /* @__PURE__ */ jsx56(Box46, { marginTop: 1, children: /* @__PURE__ */ jsx56(Text54, { color: statusColor2, children: status.text }) }),
|
|
30450
|
+
phase === "actions" && testLatencyMs !== void 0 && /* @__PURE__ */ jsxs50(Box46, { marginTop: 0, gap: 1, children: [
|
|
30451
|
+
/* @__PURE__ */ jsxs50(Text54, { color: getLatencyColor(testLatencyMs), bold: true, children: [
|
|
30352
30452
|
testLatencyMs,
|
|
30353
30453
|
"ms"
|
|
30354
30454
|
] }),
|
|
30355
|
-
/* @__PURE__ */
|
|
30455
|
+
/* @__PURE__ */ jsx56(Text54, { color: theme.text.secondary, children: testLatencyMs < 300 ? "excellent" : testLatencyMs < 800 ? "good" : "slow" })
|
|
30356
30456
|
] }),
|
|
30357
|
-
/* @__PURE__ */
|
|
30358
|
-
|
|
30457
|
+
/* @__PURE__ */ jsx56(
|
|
30458
|
+
Box46,
|
|
30359
30459
|
{
|
|
30360
30460
|
marginTop: 1,
|
|
30361
30461
|
borderStyle: "single",
|
|
@@ -30364,7 +30464,7 @@ var ProviderDialog = ({
|
|
|
30364
30464
|
borderLeft: false,
|
|
30365
30465
|
borderRight: false,
|
|
30366
30466
|
borderColor: theme.ui.comment,
|
|
30367
|
-
children: /* @__PURE__ */
|
|
30467
|
+
children: /* @__PURE__ */ jsxs50(Text54, { color: theme.ui.comment, dimColor: true, children: [
|
|
30368
30468
|
footer,
|
|
30369
30469
|
phase === "actions" && " Test does not change the session."
|
|
30370
30470
|
] })
|
|
@@ -30438,8 +30538,8 @@ var PermissionsDialog = ({
|
|
|
30438
30538
|
[focusIndex, modes, onClose, onSave]
|
|
30439
30539
|
);
|
|
30440
30540
|
useKeypress(handleKey, { isActive: true });
|
|
30441
|
-
return /* @__PURE__ */
|
|
30442
|
-
|
|
30541
|
+
return /* @__PURE__ */ jsxs51(
|
|
30542
|
+
Box47,
|
|
30443
30543
|
{
|
|
30444
30544
|
flexDirection: "column",
|
|
30445
30545
|
borderStyle: "round",
|
|
@@ -30448,25 +30548,25 @@ var PermissionsDialog = ({
|
|
|
30448
30548
|
marginLeft: 2,
|
|
30449
30549
|
marginRight: 2,
|
|
30450
30550
|
children: [
|
|
30451
|
-
/* @__PURE__ */
|
|
30551
|
+
/* @__PURE__ */ jsx57(Text55, { bold: true, color: theme.text.accent, children: "Permiss\xF5es" }),
|
|
30452
30552
|
PERMISSION_KEYS.map((key, i) => {
|
|
30453
30553
|
const focused = focusIndex === i;
|
|
30454
30554
|
const mode = modes[key];
|
|
30455
|
-
return /* @__PURE__ */
|
|
30456
|
-
/* @__PURE__ */
|
|
30457
|
-
/* @__PURE__ */
|
|
30458
|
-
/* @__PURE__ */
|
|
30555
|
+
return /* @__PURE__ */ jsxs51(Box47, { flexDirection: "row", gap: 1, children: [
|
|
30556
|
+
/* @__PURE__ */ jsx57(Text55, { color: focused ? theme.text.accent : theme.text.secondary, children: focused ? "\u203A" : " " }),
|
|
30557
|
+
/* @__PURE__ */ jsx57(Text55, { color: focused ? theme.text.primary : theme.text.secondary, bold: focused, children: KEY_LABEL[key].padEnd(10) }),
|
|
30558
|
+
/* @__PURE__ */ jsx57(Text55, { color: modeColor(mode), bold: focused, children: mode })
|
|
30459
30559
|
] }, key);
|
|
30460
30560
|
}),
|
|
30461
|
-
/* @__PURE__ */
|
|
30561
|
+
/* @__PURE__ */ jsx57(Box47, { marginTop: 1, flexDirection: "column", children: ACTIONS3.map((action, i) => {
|
|
30462
30562
|
const focused = focusIndex === PERMISSION_KEYS.length + i;
|
|
30463
30563
|
const label = action === "save" ? dirty ? "Salvar" : "Salvar (sem edi\xE7\xF5es)" : "Cancelar";
|
|
30464
|
-
return /* @__PURE__ */
|
|
30465
|
-
/* @__PURE__ */
|
|
30466
|
-
/* @__PURE__ */
|
|
30564
|
+
return /* @__PURE__ */ jsxs51(Box47, { flexDirection: "row", gap: 1, children: [
|
|
30565
|
+
/* @__PURE__ */ jsx57(Text55, { color: focused ? theme.text.accent : theme.text.secondary, children: focused ? "\u203A" : " " }),
|
|
30566
|
+
/* @__PURE__ */ jsx57(Text55, { color: focused ? theme.text.primary : theme.text.secondary, bold: focused, children: label })
|
|
30467
30567
|
] }, action);
|
|
30468
30568
|
}) }),
|
|
30469
|
-
/* @__PURE__ */
|
|
30569
|
+
/* @__PURE__ */ jsx57(Text55, { color: theme.text.secondary, dimColor: true, children: "\u2191\u2193 navegar \xB7 Enter cicla allow/ask/deny ou confirma \xB7 Esc cancelar" })
|
|
30470
30570
|
]
|
|
30471
30571
|
}
|
|
30472
30572
|
);
|
|
@@ -30574,8 +30674,8 @@ var AuthDialog = ({
|
|
|
30574
30674
|
[onClose, phase]
|
|
30575
30675
|
);
|
|
30576
30676
|
useKeypress(handleEscape, { isActive: true });
|
|
30577
|
-
return /* @__PURE__ */
|
|
30578
|
-
|
|
30677
|
+
return /* @__PURE__ */ jsxs52(
|
|
30678
|
+
Box48,
|
|
30579
30679
|
{
|
|
30580
30680
|
flexDirection: "column",
|
|
30581
30681
|
borderStyle: "round",
|
|
@@ -30584,32 +30684,32 @@ var AuthDialog = ({
|
|
|
30584
30684
|
marginLeft: 2,
|
|
30585
30685
|
marginRight: 2,
|
|
30586
30686
|
children: [
|
|
30587
|
-
/* @__PURE__ */
|
|
30588
|
-
/* @__PURE__ */
|
|
30589
|
-
phase === "menu" && /* @__PURE__ */
|
|
30590
|
-
deviceCode && phase === "running" && /* @__PURE__ */
|
|
30591
|
-
/* @__PURE__ */
|
|
30687
|
+
/* @__PURE__ */ jsx58(Text56, { bold: true, color: theme.text.accent, children: "GitHub authentication" }),
|
|
30688
|
+
/* @__PURE__ */ jsx58(Text56, { color: theme.text.secondary, children: statusSummary }),
|
|
30689
|
+
phase === "menu" && /* @__PURE__ */ jsx58(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
30690
|
+
deviceCode && phase === "running" && /* @__PURE__ */ jsxs52(Box48, { flexDirection: "column", marginTop: 1, children: [
|
|
30691
|
+
/* @__PURE__ */ jsxs52(Text56, { children: [
|
|
30592
30692
|
"Open: ",
|
|
30593
|
-
/* @__PURE__ */
|
|
30693
|
+
/* @__PURE__ */ jsx58(Text56, { color: theme.text.accent, children: deviceCode.verificationUri })
|
|
30594
30694
|
] }),
|
|
30595
|
-
/* @__PURE__ */
|
|
30695
|
+
/* @__PURE__ */ jsxs52(Text56, { children: [
|
|
30596
30696
|
"Code: ",
|
|
30597
|
-
/* @__PURE__ */
|
|
30697
|
+
/* @__PURE__ */ jsx58(Text56, { bold: true, color: theme.text.accent, children: deviceCode.userCode })
|
|
30598
30698
|
] }),
|
|
30599
|
-
/* @__PURE__ */
|
|
30699
|
+
/* @__PURE__ */ jsxs52(Text56, { color: theme.text.secondary, children: [
|
|
30600
30700
|
"Expires in ",
|
|
30601
30701
|
Math.round(deviceCode.expiresIn / 60),
|
|
30602
30702
|
" minutes."
|
|
30603
30703
|
] })
|
|
30604
30704
|
] }),
|
|
30605
|
-
message && /* @__PURE__ */
|
|
30606
|
-
|
|
30705
|
+
message && /* @__PURE__ */ jsx58(
|
|
30706
|
+
Text56,
|
|
30607
30707
|
{
|
|
30608
30708
|
color: phase === "error" ? theme.status.error : phase === "done" ? theme.status.success : theme.text.secondary,
|
|
30609
30709
|
children: message
|
|
30610
30710
|
}
|
|
30611
30711
|
),
|
|
30612
|
-
/* @__PURE__ */
|
|
30712
|
+
/* @__PURE__ */ jsx58(Text56, { color: theme.text.secondary, children: phase === "running" ? "Esc cancel login" : phase === "menu" ? "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc close" : "Esc close" })
|
|
30613
30713
|
]
|
|
30614
30714
|
}
|
|
30615
30715
|
);
|
|
@@ -30749,8 +30849,8 @@ var ModelDialog = ({
|
|
|
30749
30849
|
}, { isActive: true });
|
|
30750
30850
|
const canScrollUp = scrollTop > 0;
|
|
30751
30851
|
const canScrollDown = scrollTop + MAX_VISIBLE < rows.length;
|
|
30752
|
-
return /* @__PURE__ */
|
|
30753
|
-
|
|
30852
|
+
return /* @__PURE__ */ jsxs53(
|
|
30853
|
+
Box49,
|
|
30754
30854
|
{
|
|
30755
30855
|
flexDirection: "column",
|
|
30756
30856
|
borderStyle: "round",
|
|
@@ -30761,70 +30861,70 @@ var ModelDialog = ({
|
|
|
30761
30861
|
marginRight: 1,
|
|
30762
30862
|
minWidth: 58,
|
|
30763
30863
|
children: [
|
|
30764
|
-
/* @__PURE__ */
|
|
30765
|
-
/* @__PURE__ */
|
|
30766
|
-
/* @__PURE__ */
|
|
30767
|
-
/* @__PURE__ */
|
|
30768
|
-
/* @__PURE__ */
|
|
30864
|
+
/* @__PURE__ */ jsxs53(Box49, { justifyContent: "space-between", marginBottom: 1, children: [
|
|
30865
|
+
/* @__PURE__ */ jsxs53(Box49, { gap: 1, children: [
|
|
30866
|
+
/* @__PURE__ */ jsx59(Text57, { bold: true, color: theme.text.primary, children: "Selecionar modelo" }),
|
|
30867
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.text.secondary, children: "para" }),
|
|
30868
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.text.accent, children: currentProvider })
|
|
30769
30869
|
] }),
|
|
30770
|
-
/* @__PURE__ */
|
|
30870
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.ui.comment, dimColor: true, children: "esc" })
|
|
30771
30871
|
] }),
|
|
30772
|
-
/* @__PURE__ */
|
|
30773
|
-
|
|
30872
|
+
/* @__PURE__ */ jsxs53(
|
|
30873
|
+
Box49,
|
|
30774
30874
|
{
|
|
30775
30875
|
borderStyle: "single",
|
|
30776
30876
|
borderColor: search ? theme.border.focused : theme.ui.comment,
|
|
30777
30877
|
paddingX: 1,
|
|
30778
30878
|
marginBottom: 1,
|
|
30779
30879
|
children: [
|
|
30780
|
-
/* @__PURE__ */
|
|
30781
|
-
search ? /* @__PURE__ */
|
|
30880
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.ui.comment, children: "\u2315 " }),
|
|
30881
|
+
search ? /* @__PURE__ */ jsxs53(Text57, { color: theme.text.primary, children: [
|
|
30782
30882
|
search,
|
|
30783
|
-
/* @__PURE__ */
|
|
30784
|
-
] }) : /* @__PURE__ */
|
|
30883
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.text.accent, children: "\u258C" })
|
|
30884
|
+
] }) : /* @__PURE__ */ jsxs53(Text57, { color: theme.ui.comment, dimColor: true, children: [
|
|
30785
30885
|
"Search",
|
|
30786
|
-
/* @__PURE__ */
|
|
30886
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.text.accent, children: "\u258C" })
|
|
30787
30887
|
] })
|
|
30788
30888
|
]
|
|
30789
30889
|
}
|
|
30790
30890
|
),
|
|
30791
|
-
loadState === "loading" && /* @__PURE__ */
|
|
30792
|
-
loadState === "error" && /* @__PURE__ */
|
|
30793
|
-
/* @__PURE__ */
|
|
30794
|
-
/* @__PURE__ */
|
|
30891
|
+
loadState === "loading" && /* @__PURE__ */ jsx59(Box49, { marginY: 1, children: /* @__PURE__ */ jsx59(Text57, { color: theme.text.secondary, children: "Carregando modelos\u2026" }) }),
|
|
30892
|
+
loadState === "error" && /* @__PURE__ */ jsxs53(Box49, { flexDirection: "column", marginY: 1, children: [
|
|
30893
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.status.error, children: "\u2717 N\xE3o foi poss\xEDvel carregar modelos" }),
|
|
30894
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.ui.comment, dimColor: true, children: errorMsg })
|
|
30795
30895
|
] }),
|
|
30796
|
-
loadState === "ready" && selectableCount === 0 && /* @__PURE__ */
|
|
30896
|
+
loadState === "ready" && selectableCount === 0 && /* @__PURE__ */ jsx59(Box49, { marginY: 1, children: /* @__PURE__ */ jsxs53(Text57, { color: theme.ui.comment, dimColor: true, children: [
|
|
30797
30897
|
'Nenhum modelo para "',
|
|
30798
30898
|
search,
|
|
30799
30899
|
'"'
|
|
30800
30900
|
] }) }),
|
|
30801
|
-
loadState === "ready" && selectableCount > 0 && /* @__PURE__ */
|
|
30802
|
-
canScrollUp && /* @__PURE__ */
|
|
30901
|
+
loadState === "ready" && selectableCount > 0 && /* @__PURE__ */ jsxs53(Box49, { flexDirection: "column", children: [
|
|
30902
|
+
canScrollUp && /* @__PURE__ */ jsx59(Text57, { color: theme.ui.comment, dimColor: true, children: " \u2191" }),
|
|
30803
30903
|
visibleRows.map((row, i) => {
|
|
30804
30904
|
if (row.kind === "header") {
|
|
30805
|
-
return /* @__PURE__ */
|
|
30905
|
+
return /* @__PURE__ */ jsx59(Box49, { marginTop: i === 0 ? 0 : 1, children: /* @__PURE__ */ jsx59(Text57, { color: theme.text.accent, bold: true, children: row.label }) }, `h${i}`);
|
|
30806
30906
|
}
|
|
30807
30907
|
const { model, selIndex } = row;
|
|
30808
30908
|
const isActive = selIndex === clampedIndex;
|
|
30809
30909
|
const isCurrent = model.id === currentModel;
|
|
30810
30910
|
const price = fmtPrice(model);
|
|
30811
30911
|
const group = providerGroup(model);
|
|
30812
|
-
return /* @__PURE__ */
|
|
30813
|
-
/* @__PURE__ */
|
|
30814
|
-
/* @__PURE__ */
|
|
30815
|
-
/* @__PURE__ */
|
|
30816
|
-
/* @__PURE__ */
|
|
30817
|
-
|
|
30912
|
+
return /* @__PURE__ */ jsxs53(Box49, { flexDirection: "column", children: [
|
|
30913
|
+
/* @__PURE__ */ jsxs53(Box49, { gap: 1, children: [
|
|
30914
|
+
/* @__PURE__ */ jsx59(Text57, { color: isActive ? theme.text.accent : theme.ui.comment, children: isCurrent ? "\u25CF" : isActive ? "\u203A" : " " }),
|
|
30915
|
+
/* @__PURE__ */ jsxs53(Box49, { flexGrow: 1, gap: 1, children: [
|
|
30916
|
+
/* @__PURE__ */ jsx59(
|
|
30917
|
+
Text57,
|
|
30818
30918
|
{
|
|
30819
30919
|
color: isActive ? theme.text.primary : theme.text.secondary,
|
|
30820
30920
|
bold: isActive,
|
|
30821
30921
|
children: model.name
|
|
30822
30922
|
}
|
|
30823
30923
|
),
|
|
30824
|
-
/* @__PURE__ */
|
|
30924
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.text.accent, dimColor: true, children: group })
|
|
30825
30925
|
] }),
|
|
30826
|
-
price && /* @__PURE__ */
|
|
30827
|
-
|
|
30926
|
+
price && /* @__PURE__ */ jsx59(
|
|
30927
|
+
Text57,
|
|
30828
30928
|
{
|
|
30829
30929
|
color: price === "Free" ? theme.status.success : theme.ui.comment,
|
|
30830
30930
|
dimColor: !isActive,
|
|
@@ -30832,29 +30932,29 @@ var ModelDialog = ({
|
|
|
30832
30932
|
}
|
|
30833
30933
|
)
|
|
30834
30934
|
] }),
|
|
30835
|
-
isActive && /* @__PURE__ */
|
|
30836
|
-
/* @__PURE__ */
|
|
30837
|
-
model.contextLength > 0 && /* @__PURE__ */
|
|
30935
|
+
isActive && /* @__PURE__ */ jsxs53(Box49, { paddingLeft: 2, gap: 2, children: [
|
|
30936
|
+
/* @__PURE__ */ jsx59(Text57, { color: theme.ui.comment, dimColor: true, children: model.id }),
|
|
30937
|
+
model.contextLength > 0 && /* @__PURE__ */ jsx59(Text57, { color: theme.ui.comment, dimColor: true, children: fmtCtx(model.contextLength) })
|
|
30838
30938
|
] })
|
|
30839
30939
|
] }, model.id);
|
|
30840
30940
|
}),
|
|
30841
|
-
canScrollDown && /* @__PURE__ */
|
|
30941
|
+
canScrollDown && /* @__PURE__ */ jsx59(Text57, { color: theme.ui.comment, dimColor: true, children: " \u2193" })
|
|
30842
30942
|
] }),
|
|
30843
|
-
loadState === "ready" && /* @__PURE__ */
|
|
30844
|
-
/* @__PURE__ */
|
|
30943
|
+
loadState === "ready" && /* @__PURE__ */ jsxs53(Box49, { marginTop: 1, justifyContent: "space-between", children: [
|
|
30944
|
+
/* @__PURE__ */ jsxs53(Text57, { color: theme.ui.comment, dimColor: true, children: [
|
|
30845
30945
|
selectableCount,
|
|
30846
30946
|
" model",
|
|
30847
30947
|
selectableCount !== 1 ? "s" : "",
|
|
30848
30948
|
search ? ` \xB7 "${search}"` : ""
|
|
30849
30949
|
] }),
|
|
30850
|
-
selectableCount > MAX_VISIBLE && /* @__PURE__ */
|
|
30950
|
+
selectableCount > MAX_VISIBLE && /* @__PURE__ */ jsxs53(Text57, { color: theme.ui.comment, dimColor: true, children: [
|
|
30851
30951
|
clampedIndex + 1,
|
|
30852
30952
|
"/",
|
|
30853
30953
|
selectableCount
|
|
30854
30954
|
] })
|
|
30855
30955
|
] }),
|
|
30856
|
-
/* @__PURE__ */
|
|
30857
|
-
|
|
30956
|
+
/* @__PURE__ */ jsx59(
|
|
30957
|
+
Box49,
|
|
30858
30958
|
{
|
|
30859
30959
|
marginTop: 1,
|
|
30860
30960
|
borderStyle: "single",
|
|
@@ -30863,7 +30963,7 @@ var ModelDialog = ({
|
|
|
30863
30963
|
borderLeft: false,
|
|
30864
30964
|
borderRight: false,
|
|
30865
30965
|
borderColor: theme.ui.comment,
|
|
30866
|
-
children: /* @__PURE__ */
|
|
30966
|
+
children: /* @__PURE__ */ jsx59(Text57, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navegar digitar para buscar Enter usar Esc fechar" })
|
|
30867
30967
|
}
|
|
30868
30968
|
)
|
|
30869
30969
|
]
|
|
@@ -30917,8 +31017,8 @@ var FeedbackDialog = ({ cwd, onClose }) => {
|
|
|
30917
31017
|
[onClose]
|
|
30918
31018
|
);
|
|
30919
31019
|
useKeypress(handleEscape, { isActive: true });
|
|
30920
|
-
return /* @__PURE__ */
|
|
30921
|
-
|
|
31020
|
+
return /* @__PURE__ */ jsxs54(
|
|
31021
|
+
Box50,
|
|
30922
31022
|
{
|
|
30923
31023
|
flexDirection: "column",
|
|
30924
31024
|
borderStyle: "round",
|
|
@@ -30927,9 +31027,9 @@ var FeedbackDialog = ({ cwd, onClose }) => {
|
|
|
30927
31027
|
marginLeft: 2,
|
|
30928
31028
|
marginRight: 2,
|
|
30929
31029
|
children: [
|
|
30930
|
-
/* @__PURE__ */
|
|
30931
|
-
/* @__PURE__ */
|
|
30932
|
-
/* @__PURE__ */
|
|
31030
|
+
/* @__PURE__ */ jsx60(Text58, { bold: true, color: theme.text.accent, children: "How useful was DeepCode in this session?" }),
|
|
31031
|
+
/* @__PURE__ */ jsx60(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
31032
|
+
/* @__PURE__ */ jsx60(Text58, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter submit \xB7 Esc cancel" })
|
|
30933
31033
|
]
|
|
30934
31034
|
}
|
|
30935
31035
|
);
|
|
@@ -30958,7 +31058,7 @@ function sessionLabel2(session) {
|
|
|
30958
31058
|
const preview = typeof firstUser?.content === "string" ? firstUser.content.trim().slice(0, 60) : "";
|
|
30959
31059
|
return name ?? (preview || "(sem mensagens)");
|
|
30960
31060
|
}
|
|
30961
|
-
var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
31061
|
+
var SessionsDialog = ({ cwd, currentSessionId, onSelect, onClose }) => {
|
|
30962
31062
|
const [loadState, setLoadState] = useState32("loading");
|
|
30963
31063
|
const [allSessions, setAllSessions] = useState32([]);
|
|
30964
31064
|
const [search, setSearch] = useState32("");
|
|
@@ -31028,8 +31128,8 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
31028
31128
|
}, { isActive: true });
|
|
31029
31129
|
const canScrollUp = scrollTop > 0;
|
|
31030
31130
|
const canScrollDown = scrollTop + MAX_VISIBLE2 < sessions.length;
|
|
31031
|
-
return /* @__PURE__ */
|
|
31032
|
-
|
|
31131
|
+
return /* @__PURE__ */ jsxs55(
|
|
31132
|
+
Box51,
|
|
31033
31133
|
{
|
|
31034
31134
|
flexDirection: "column",
|
|
31035
31135
|
borderStyle: "round",
|
|
@@ -31040,34 +31140,34 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
31040
31140
|
marginRight: 1,
|
|
31041
31141
|
minWidth: 60,
|
|
31042
31142
|
children: [
|
|
31043
|
-
/* @__PURE__ */
|
|
31044
|
-
/* @__PURE__ */
|
|
31045
|
-
/* @__PURE__ */
|
|
31143
|
+
/* @__PURE__ */ jsxs55(Box51, { justifyContent: "space-between", marginBottom: 1, children: [
|
|
31144
|
+
/* @__PURE__ */ jsx61(Text59, { bold: true, color: theme.text.primary, children: "Retomar sess\xE3o" }),
|
|
31145
|
+
/* @__PURE__ */ jsx61(Text59, { color: theme.ui.comment, dimColor: true, children: "esc" })
|
|
31046
31146
|
] }),
|
|
31047
|
-
/* @__PURE__ */
|
|
31048
|
-
|
|
31147
|
+
/* @__PURE__ */ jsxs55(
|
|
31148
|
+
Box51,
|
|
31049
31149
|
{
|
|
31050
31150
|
borderStyle: "single",
|
|
31051
31151
|
borderColor: search ? theme.border.focused : theme.ui.comment,
|
|
31052
31152
|
paddingX: 1,
|
|
31053
31153
|
marginBottom: 1,
|
|
31054
31154
|
children: [
|
|
31055
|
-
/* @__PURE__ */
|
|
31056
|
-
search ? /* @__PURE__ */
|
|
31155
|
+
/* @__PURE__ */ jsx61(Text59, { color: theme.ui.comment, children: "\u2315 " }),
|
|
31156
|
+
search ? /* @__PURE__ */ jsxs55(Text59, { color: theme.text.primary, children: [
|
|
31057
31157
|
search,
|
|
31058
|
-
/* @__PURE__ */
|
|
31059
|
-
] }) : /* @__PURE__ */
|
|
31158
|
+
/* @__PURE__ */ jsx61(Text59, { color: theme.text.accent, children: "\u258C" })
|
|
31159
|
+
] }) : /* @__PURE__ */ jsxs55(Text59, { color: theme.ui.comment, dimColor: true, children: [
|
|
31060
31160
|
"Search",
|
|
31061
|
-
/* @__PURE__ */
|
|
31161
|
+
/* @__PURE__ */ jsx61(Text59, { color: theme.text.accent, children: "\u258C" })
|
|
31062
31162
|
] })
|
|
31063
31163
|
]
|
|
31064
31164
|
}
|
|
31065
31165
|
),
|
|
31066
|
-
loadState === "loading" && /* @__PURE__ */
|
|
31067
|
-
loadState === "error" && /* @__PURE__ */
|
|
31068
|
-
loadState === "ready" && sessions.length === 0 && /* @__PURE__ */
|
|
31069
|
-
loadState === "ready" && sessions.length > 0 && /* @__PURE__ */
|
|
31070
|
-
canScrollUp && /* @__PURE__ */
|
|
31166
|
+
loadState === "loading" && /* @__PURE__ */ jsx61(Box51, { marginY: 1, children: /* @__PURE__ */ jsx61(Text59, { color: theme.text.secondary, children: "Carregando sess\xF5es\u2026" }) }),
|
|
31167
|
+
loadState === "error" && /* @__PURE__ */ jsx61(Box51, { marginY: 1, children: /* @__PURE__ */ jsx61(Text59, { color: theme.status.error, children: "\u2717 N\xE3o foi poss\xEDvel carregar sess\xF5es" }) }),
|
|
31168
|
+
loadState === "ready" && sessions.length === 0 && /* @__PURE__ */ jsx61(Box51, { marginY: 1, children: /* @__PURE__ */ jsx61(Text59, { color: theme.ui.comment, dimColor: true, children: search ? `Nenhuma sess\xE3o para "${search}"` : "Nenhuma sess\xE3o em .deepcode/sessions/" }) }),
|
|
31169
|
+
loadState === "ready" && sessions.length > 0 && /* @__PURE__ */ jsxs55(Box51, { flexDirection: "column", children: [
|
|
31170
|
+
canScrollUp && /* @__PURE__ */ jsx61(Text59, { color: theme.ui.comment, dimColor: true, children: " \u2191" }),
|
|
31071
31171
|
visibleSessions.map((session, visIdx) => {
|
|
31072
31172
|
const globalIdx = scrollTop + visIdx;
|
|
31073
31173
|
const isActive = globalIdx === clampedIndex;
|
|
@@ -31076,11 +31176,12 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
31076
31176
|
const target = session.model ? `${session.provider}/${session.model}` : session.provider;
|
|
31077
31177
|
const msgCount = session.messages.length;
|
|
31078
31178
|
const preview = sessionLabel2(session);
|
|
31079
|
-
|
|
31080
|
-
|
|
31081
|
-
|
|
31082
|
-
/* @__PURE__ */
|
|
31083
|
-
|
|
31179
|
+
const isCurrent = session.id === currentSessionId;
|
|
31180
|
+
return /* @__PURE__ */ jsxs55(Box51, { flexDirection: "column", children: [
|
|
31181
|
+
/* @__PURE__ */ jsxs55(Box51, { gap: 1, children: [
|
|
31182
|
+
/* @__PURE__ */ jsx61(Text59, { color: isActive ? theme.text.accent : isCurrent ? theme.status.success : theme.ui.comment, children: isCurrent ? "\u25CF" : isActive ? "\u203A" : " " }),
|
|
31183
|
+
/* @__PURE__ */ jsx61(
|
|
31184
|
+
Text59,
|
|
31084
31185
|
{
|
|
31085
31186
|
color: isActive ? theme.text.primary : theme.text.secondary,
|
|
31086
31187
|
bold: isActive,
|
|
@@ -31089,7 +31190,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
31089
31190
|
}
|
|
31090
31191
|
)
|
|
31091
31192
|
] }),
|
|
31092
|
-
isActive && /* @__PURE__ */
|
|
31193
|
+
isActive && /* @__PURE__ */ jsx61(Box51, { paddingLeft: 2, children: /* @__PURE__ */ jsxs55(Text59, { color: theme.ui.comment, dimColor: true, children: [
|
|
31093
31194
|
shortId,
|
|
31094
31195
|
" ",
|
|
31095
31196
|
target,
|
|
@@ -31100,23 +31201,23 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
31100
31201
|
] }) })
|
|
31101
31202
|
] }, session.id);
|
|
31102
31203
|
}),
|
|
31103
|
-
canScrollDown && /* @__PURE__ */
|
|
31104
|
-
/* @__PURE__ */
|
|
31105
|
-
/* @__PURE__ */
|
|
31204
|
+
canScrollDown && /* @__PURE__ */ jsx61(Text59, { color: theme.ui.comment, dimColor: true, children: " \u2193" }),
|
|
31205
|
+
/* @__PURE__ */ jsxs55(Box51, { marginTop: 1, justifyContent: "space-between", children: [
|
|
31206
|
+
/* @__PURE__ */ jsxs55(Text59, { color: theme.ui.comment, dimColor: true, children: [
|
|
31106
31207
|
sessions.length,
|
|
31107
31208
|
" session",
|
|
31108
31209
|
sessions.length !== 1 ? "s" : "",
|
|
31109
31210
|
search ? ` \xB7 "${search}"` : ""
|
|
31110
31211
|
] }),
|
|
31111
|
-
sessions.length > MAX_VISIBLE2 && /* @__PURE__ */
|
|
31212
|
+
sessions.length > MAX_VISIBLE2 && /* @__PURE__ */ jsxs55(Text59, { color: theme.ui.comment, dimColor: true, children: [
|
|
31112
31213
|
clampedIndex + 1,
|
|
31113
31214
|
"/",
|
|
31114
31215
|
sessions.length
|
|
31115
31216
|
] })
|
|
31116
31217
|
] })
|
|
31117
31218
|
] }),
|
|
31118
|
-
/* @__PURE__ */
|
|
31119
|
-
|
|
31219
|
+
/* @__PURE__ */ jsx61(
|
|
31220
|
+
Box51,
|
|
31120
31221
|
{
|
|
31121
31222
|
marginTop: 1,
|
|
31122
31223
|
borderStyle: "single",
|
|
@@ -31125,7 +31226,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
31125
31226
|
borderLeft: false,
|
|
31126
31227
|
borderRight: false,
|
|
31127
31228
|
borderColor: theme.ui.comment,
|
|
31128
|
-
children: /* @__PURE__ */
|
|
31229
|
+
children: /* @__PURE__ */ jsx61(Text59, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navegar digitar para buscar Enter retomar Esc fechar" })
|
|
31129
31230
|
}
|
|
31130
31231
|
)
|
|
31131
31232
|
]
|
|
@@ -31146,8 +31247,8 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
31146
31247
|
if (subagents.length === 0) return null;
|
|
31147
31248
|
const running = subagents.filter((s) => s.status === "running").length;
|
|
31148
31249
|
const title = running > 0 ? `Subagents (${running} running)` : `Subagents (${subagents.length} finishing\u2026)`;
|
|
31149
|
-
return /* @__PURE__ */
|
|
31150
|
-
|
|
31250
|
+
return /* @__PURE__ */ jsxs56(
|
|
31251
|
+
Box52,
|
|
31151
31252
|
{
|
|
31152
31253
|
flexDirection: "column",
|
|
31153
31254
|
borderStyle: "round",
|
|
@@ -31157,25 +31258,25 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
31157
31258
|
marginTop: 1,
|
|
31158
31259
|
width: Math.min(mainAreaWidth, 80),
|
|
31159
31260
|
children: [
|
|
31160
|
-
/* @__PURE__ */
|
|
31161
|
-
subagents.map((entry) => /* @__PURE__ */
|
|
31162
|
-
/* @__PURE__ */
|
|
31163
|
-
/* @__PURE__ */
|
|
31164
|
-
/* @__PURE__ */
|
|
31261
|
+
/* @__PURE__ */ jsx62(Box52, { paddingX: 1, children: /* @__PURE__ */ jsx62(Text60, { bold: true, color: theme.text.accent, children: title }) }),
|
|
31262
|
+
subagents.map((entry) => /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", paddingX: 1, children: [
|
|
31263
|
+
/* @__PURE__ */ jsxs56(Box52, { flexDirection: "row", gap: 1, children: [
|
|
31264
|
+
/* @__PURE__ */ jsx62(Text60, { color: statusColor(entry), children: statusIcon(entry) }),
|
|
31265
|
+
/* @__PURE__ */ jsxs56(Text60, { wrap: "truncate", color: theme.text.primary, children: [
|
|
31165
31266
|
entry.prompt,
|
|
31166
31267
|
entry.prompt.length >= 50 ? "\u2026" : ""
|
|
31167
31268
|
] })
|
|
31168
31269
|
] }),
|
|
31169
|
-
entry.status === "running" && entry.currentTool && /* @__PURE__ */
|
|
31270
|
+
entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs56(Text60, { color: theme.text.secondary, dimColor: true, children: [
|
|
31170
31271
|
" ",
|
|
31171
31272
|
"using ",
|
|
31172
31273
|
entry.currentTool
|
|
31173
31274
|
] }),
|
|
31174
|
-
entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */
|
|
31275
|
+
entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */ jsxs56(Text60, { color: theme.text.secondary, dimColor: true, wrap: "truncate", children: [
|
|
31175
31276
|
" ",
|
|
31176
31277
|
entry.currentOutput.trimStart()
|
|
31177
31278
|
] }),
|
|
31178
|
-
entry.status === "failed" && entry.error && /* @__PURE__ */
|
|
31279
|
+
entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs56(Text60, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
|
|
31179
31280
|
" ",
|
|
31180
31281
|
entry.error.slice(0, 60)
|
|
31181
31282
|
] })
|
|
@@ -31412,6 +31513,13 @@ function formatModelCatalogSummary2(result) {
|
|
|
31412
31513
|
return "model catalog unavailable";
|
|
31413
31514
|
}
|
|
31414
31515
|
var APPROVAL_ENTER_ARM_DELAY_MS = 350;
|
|
31516
|
+
var VimToggleRegistrar = ({ onRegister }) => {
|
|
31517
|
+
const { toggleVimEnabled } = useVimMode();
|
|
31518
|
+
React41.useEffect(() => {
|
|
31519
|
+
onRegister(toggleVimEnabled);
|
|
31520
|
+
}, [onRegister, toggleVimEnabled]);
|
|
31521
|
+
return null;
|
|
31522
|
+
};
|
|
31415
31523
|
var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarnings = [] }) => {
|
|
31416
31524
|
const historyManager = useHistory();
|
|
31417
31525
|
const addHistoryItem = historyManager.addItem;
|
|
@@ -31456,6 +31564,10 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31456
31564
|
});
|
|
31457
31565
|
const [sessionDisplayName, setSessionDisplayName] = useState33("");
|
|
31458
31566
|
const [updateAvailable, setUpdateAvailable] = useState33(null);
|
|
31567
|
+
const vimToggleRef = useRef21(null);
|
|
31568
|
+
const registerVimToggle = React41.useCallback((fn) => {
|
|
31569
|
+
vimToggleRef.current = fn;
|
|
31570
|
+
}, []);
|
|
31459
31571
|
const [providerConfigVersion, setProviderConfigVersion] = useState33(0);
|
|
31460
31572
|
const [, setThemeVersion] = useState33(0);
|
|
31461
31573
|
const [mcpConnected, setMcpConnected] = useState33(0);
|
|
@@ -31545,6 +31657,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31545
31657
|
clearCommand,
|
|
31546
31658
|
undoCommand,
|
|
31547
31659
|
compactCommand,
|
|
31660
|
+
vimCommand,
|
|
31548
31661
|
diffCommand,
|
|
31549
31662
|
exportCommand,
|
|
31550
31663
|
contextCommand,
|
|
@@ -31739,7 +31852,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31739
31852
|
pendingItem,
|
|
31740
31853
|
setPendingItem,
|
|
31741
31854
|
loadHistory: historyManager.loadHistory,
|
|
31742
|
-
toggleVimEnabled:
|
|
31855
|
+
toggleVimEnabled: () => vimToggleRef.current?.() ?? Promise.resolve(false),
|
|
31743
31856
|
reloadCommands: () => {
|
|
31744
31857
|
},
|
|
31745
31858
|
undo: handleUndo,
|
|
@@ -33001,131 +33114,136 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
33001
33114
|
userMessages
|
|
33002
33115
|
]
|
|
33003
33116
|
);
|
|
33004
|
-
return /* @__PURE__ */
|
|
33005
|
-
/* @__PURE__ */
|
|
33006
|
-
|
|
33007
|
-
|
|
33008
|
-
|
|
33009
|
-
cwd,
|
|
33010
|
-
providerLabel,
|
|
33011
|
-
mode: agentMode,
|
|
33012
|
-
iterationInfo,
|
|
33013
|
-
updateAvailable
|
|
33014
|
-
}
|
|
33015
|
-
),
|
|
33016
|
-
initError ? /* @__PURE__ */ jsx62(Box52, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsxs56(Text60, { color: theme.status.error, children: [
|
|
33017
|
-
"Failed to initialize runtime: ",
|
|
33018
|
-
initError
|
|
33019
|
-
] }) }) : /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", flexGrow: 1, children: [
|
|
33020
|
-
/* @__PURE__ */ jsx62(
|
|
33021
|
-
MainContent,
|
|
33117
|
+
return /* @__PURE__ */ jsx63(AppContext.Provider, { value: appContextValue, children: /* @__PURE__ */ jsx63(CompactModeProvider, { value: { compactMode }, children: /* @__PURE__ */ jsx63(ConfigContext.Provider, { value: configAdapter, children: /* @__PURE__ */ jsx63(SettingsContext.Provider, { value: loadedSettings, children: /* @__PURE__ */ jsx63(StreamingContext.Provider, { value: streamingState, children: /* @__PURE__ */ jsxs57(VimModeProvider, { initialVimEnabled: loadedSettings.merged.general?.vimMode ?? false, children: [
|
|
33118
|
+
/* @__PURE__ */ jsx63(VimToggleRegistrar, { onRegister: registerVimToggle }),
|
|
33119
|
+
/* @__PURE__ */ jsx63(KeypressProvider, { kittyProtocolEnabled: false, config: configAdapter, children: /* @__PURE__ */ jsx63(ShellFocusContext.Provider, { value: true, children: /* @__PURE__ */ jsx63(AgentViewProvider, { children: /* @__PURE__ */ jsx63(BackgroundTaskViewProvider, { children: /* @__PURE__ */ jsx63(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ jsx63(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ jsxs57(Box53, { flexDirection: "column", flexGrow: 1, children: [
|
|
33120
|
+
/* @__PURE__ */ jsx63(
|
|
33121
|
+
AppHeader,
|
|
33022
33122
|
{
|
|
33023
|
-
|
|
33024
|
-
|
|
33025
|
-
|
|
33026
|
-
|
|
33027
|
-
|
|
33028
|
-
|
|
33029
|
-
|
|
33123
|
+
version: VERSION,
|
|
33124
|
+
cwd,
|
|
33125
|
+
providerLabel,
|
|
33126
|
+
mode: agentMode,
|
|
33127
|
+
iterationInfo,
|
|
33128
|
+
updateAvailable,
|
|
33129
|
+
sessionName: sessionDisplayName || void 0
|
|
33030
33130
|
}
|
|
33031
33131
|
),
|
|
33032
|
-
/* @__PURE__ */
|
|
33033
|
-
|
|
33034
|
-
|
|
33035
|
-
|
|
33036
|
-
|
|
33037
|
-
|
|
33038
|
-
|
|
33039
|
-
|
|
33040
|
-
|
|
33041
|
-
|
|
33042
|
-
|
|
33043
|
-
|
|
33044
|
-
|
|
33045
|
-
|
|
33046
|
-
|
|
33047
|
-
|
|
33048
|
-
|
|
33049
|
-
}
|
|
33050
|
-
|
|
33051
|
-
|
|
33052
|
-
|
|
33053
|
-
|
|
33054
|
-
|
|
33055
|
-
|
|
33056
|
-
|
|
33057
|
-
|
|
33058
|
-
|
|
33059
|
-
|
|
33060
|
-
|
|
33061
|
-
|
|
33062
|
-
|
|
33063
|
-
|
|
33064
|
-
|
|
33065
|
-
|
|
33066
|
-
|
|
33067
|
-
|
|
33068
|
-
|
|
33069
|
-
|
|
33070
|
-
|
|
33071
|
-
|
|
33072
|
-
|
|
33073
|
-
|
|
33074
|
-
|
|
33075
|
-
|
|
33076
|
-
|
|
33077
|
-
|
|
33078
|
-
|
|
33079
|
-
|
|
33080
|
-
|
|
33081
|
-
|
|
33082
|
-
|
|
33083
|
-
|
|
33084
|
-
|
|
33085
|
-
|
|
33086
|
-
|
|
33087
|
-
|
|
33088
|
-
|
|
33089
|
-
|
|
33090
|
-
|
|
33091
|
-
|
|
33092
|
-
|
|
33093
|
-
|
|
33094
|
-
|
|
33095
|
-
|
|
33096
|
-
|
|
33097
|
-
|
|
33098
|
-
|
|
33099
|
-
|
|
33100
|
-
|
|
33101
|
-
|
|
33102
|
-
|
|
33103
|
-
|
|
33104
|
-
|
|
33105
|
-
|
|
33106
|
-
|
|
33107
|
-
|
|
33108
|
-
|
|
33109
|
-
|
|
33110
|
-
|
|
33111
|
-
|
|
33112
|
-
|
|
33113
|
-
|
|
33114
|
-
|
|
33115
|
-
|
|
33116
|
-
|
|
33117
|
-
|
|
33118
|
-
|
|
33119
|
-
|
|
33120
|
-
|
|
33121
|
-
|
|
33122
|
-
|
|
33123
|
-
|
|
33124
|
-
|
|
33125
|
-
|
|
33126
|
-
|
|
33127
|
-
|
|
33128
|
-
|
|
33132
|
+
initError ? /* @__PURE__ */ jsx63(Box53, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsxs57(Text61, { color: theme.status.error, children: [
|
|
33133
|
+
"Failed to initialize runtime: ",
|
|
33134
|
+
initError
|
|
33135
|
+
] }) }) : /* @__PURE__ */ jsxs57(Box53, { flexDirection: "column", flexGrow: 1, children: [
|
|
33136
|
+
/* @__PURE__ */ jsx63(
|
|
33137
|
+
MainContent,
|
|
33138
|
+
{
|
|
33139
|
+
history: historyManager.history,
|
|
33140
|
+
historyRemountKey,
|
|
33141
|
+
pendingAssistantText,
|
|
33142
|
+
liveToolCalls,
|
|
33143
|
+
terminalWidth,
|
|
33144
|
+
mainAreaWidth,
|
|
33145
|
+
isFocused: approvalQueue.length === 0
|
|
33146
|
+
}
|
|
33147
|
+
),
|
|
33148
|
+
/* @__PURE__ */ jsx63(ShowMoreLines, { constrainHeight })
|
|
33149
|
+
] }),
|
|
33150
|
+
approvalQueue.length > 0 && /* @__PURE__ */ jsx63(Box53, { marginLeft: 2, marginRight: 2, marginTop: 1, children: /* @__PURE__ */ jsx63(ApprovalPrompt, { request: approvalQueue[0], queueLength: approvalQueue.length }) }),
|
|
33151
|
+
dialogModel && /* @__PURE__ */ jsx63(CommandDialog, { title: dialogModel.title, lines: dialogModel.lines }),
|
|
33152
|
+
activeDialog === "provider" && /* @__PURE__ */ jsx63(
|
|
33153
|
+
ProviderDialog,
|
|
33154
|
+
{
|
|
33155
|
+
providers: listAvailableProviders(),
|
|
33156
|
+
currentProvider: getSessionCommandState().provider,
|
|
33157
|
+
currentModel: getSessionCommandState().model,
|
|
33158
|
+
hasApiKey: providerHasApiKey,
|
|
33159
|
+
getProviderKeyHint,
|
|
33160
|
+
onSelectProvider: setSessionProvider,
|
|
33161
|
+
onSetDefaultProvider: handleSetDefaultProvider,
|
|
33162
|
+
onSaveApiKey: handleSaveProviderApiKey,
|
|
33163
|
+
onTestProvider: handleTestProvider,
|
|
33164
|
+
onClose: closeDialog
|
|
33165
|
+
}
|
|
33166
|
+
),
|
|
33167
|
+
activeDialog === "model" && /* @__PURE__ */ jsx63(
|
|
33168
|
+
ModelDialog,
|
|
33169
|
+
{
|
|
33170
|
+
currentProvider: getSessionCommandState().provider,
|
|
33171
|
+
currentModel: getSessionCommandState().model,
|
|
33172
|
+
onFetchModels: handleFetchModels,
|
|
33173
|
+
onSelectModel: handleSelectModel,
|
|
33174
|
+
onClose: closeDialog
|
|
33175
|
+
}
|
|
33176
|
+
),
|
|
33177
|
+
activeDialog === "theme" && /* @__PURE__ */ jsx63(
|
|
33178
|
+
ThemeDialog,
|
|
33179
|
+
{
|
|
33180
|
+
onSelect: handleSelectTheme,
|
|
33181
|
+
onClose: closeDialog,
|
|
33182
|
+
onPreview: previewTheme
|
|
33183
|
+
}
|
|
33184
|
+
),
|
|
33185
|
+
activeDialog === "permissions" && /* @__PURE__ */ jsx63(
|
|
33186
|
+
PermissionsDialog,
|
|
33187
|
+
{
|
|
33188
|
+
current: permissionModes,
|
|
33189
|
+
onSave: handleSavePermissions,
|
|
33190
|
+
onClose: closeDialog
|
|
33191
|
+
}
|
|
33192
|
+
),
|
|
33193
|
+
activeDialog === "auth" && runtimeRef.current && /* @__PURE__ */ jsx63(
|
|
33194
|
+
AuthDialog,
|
|
33195
|
+
{
|
|
33196
|
+
clientId: runtimeRef.current.config.github.oauthClientId,
|
|
33197
|
+
scopes: runtimeRef.current.config.github.oauthScopes,
|
|
33198
|
+
enterpriseUrl: runtimeRef.current.config.github.enterpriseUrl,
|
|
33199
|
+
worktree: cwd,
|
|
33200
|
+
statusSummary: authSummary,
|
|
33201
|
+
hasToken: Boolean(runtimeRef.current.config.github.token),
|
|
33202
|
+
onPersistToken: handlePersistToken,
|
|
33203
|
+
onClose: closeDialog
|
|
33204
|
+
}
|
|
33205
|
+
),
|
|
33206
|
+
activeDialog === "feedback" && /* @__PURE__ */ jsx63(FeedbackDialog, { cwd, onClose: closeDialog }),
|
|
33207
|
+
activeDialog === "sessions" && /* @__PURE__ */ jsx63(
|
|
33208
|
+
SessionsDialog,
|
|
33209
|
+
{
|
|
33210
|
+
cwd,
|
|
33211
|
+
currentSessionId: sessionRef.current?.id,
|
|
33212
|
+
onSelect: handleSelectSession,
|
|
33213
|
+
onClose: closeDialog
|
|
33214
|
+
}
|
|
33215
|
+
),
|
|
33216
|
+
pendingCommandConfirmation && /* @__PURE__ */ jsx63(
|
|
33217
|
+
CommandDialog,
|
|
33218
|
+
{
|
|
33219
|
+
title: "Confirm action",
|
|
33220
|
+
lines: [
|
|
33221
|
+
...pendingCommandConfirmation.promptLines,
|
|
33222
|
+
"",
|
|
33223
|
+
`Command: ${pendingCommandConfirmation.rawInvocation}`
|
|
33224
|
+
],
|
|
33225
|
+
footerText: "Press y or Enter to confirm. Press n or Esc to cancel."
|
|
33226
|
+
}
|
|
33227
|
+
),
|
|
33228
|
+
/* @__PURE__ */ jsx63(
|
|
33229
|
+
SubagentsPanel,
|
|
33230
|
+
{
|
|
33231
|
+
subagents: Array.from(subagentMap.values()),
|
|
33232
|
+
mainAreaWidth
|
|
33233
|
+
}
|
|
33234
|
+
),
|
|
33235
|
+
stickyTodos && /* @__PURE__ */ jsx63(
|
|
33236
|
+
StickyTodoList,
|
|
33237
|
+
{
|
|
33238
|
+
todos: stickyTodos,
|
|
33239
|
+
width: mainAreaWidth,
|
|
33240
|
+
maxVisibleItems: stickyTodoMaxItems
|
|
33241
|
+
}
|
|
33242
|
+
),
|
|
33243
|
+
/* @__PURE__ */ jsx63(Notifications, {}),
|
|
33244
|
+
/* @__PURE__ */ jsx63(Composer, {})
|
|
33245
|
+
] }) }) }) }) }) }) })
|
|
33246
|
+
] }) }) }) }) }) });
|
|
33129
33247
|
};
|
|
33130
33248
|
function formatProviderLabel(provider, model) {
|
|
33131
33249
|
return model ? `${provider} \u203A ${model}` : `${provider} \u203A (model unset)`;
|
|
@@ -33268,83 +33386,6 @@ function formatAuthSummary(config) {
|
|
|
33268
33386
|
const enterprise = config.enterpriseUrl?.trim() ? `enterprise=${config.enterpriseUrl}` : "enterprise=github.com";
|
|
33269
33387
|
return `github token=${tokenState}, ${oauthState}, ${enterprise}`;
|
|
33270
33388
|
}
|
|
33271
|
-
var APPROVAL_PREVIEW_MAX_LINES = 4;
|
|
33272
|
-
var ApprovalPrompt = ({ request, queueLength = 1 }) => {
|
|
33273
|
-
if (!request) return null;
|
|
33274
|
-
const operationLabel = formatApprovalOperationLabel(request);
|
|
33275
|
-
const hasDiff = !!(request.diff?.before && request.diff?.after);
|
|
33276
|
-
let beforeLines = [];
|
|
33277
|
-
let afterLines = [];
|
|
33278
|
-
let singleLines = [];
|
|
33279
|
-
let truncated = false;
|
|
33280
|
-
if (hasDiff) {
|
|
33281
|
-
beforeLines = request.diff.before.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
|
|
33282
|
-
afterLines = request.diff.after.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
|
|
33283
|
-
truncated = request.diff.before.split("\n").length > APPROVAL_PREVIEW_MAX_LINES || request.diff.after.split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
|
|
33284
|
-
} else {
|
|
33285
|
-
const raw = request.diff?.after ?? request.preview?.content ?? "";
|
|
33286
|
-
singleLines = raw.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
|
|
33287
|
-
truncated = raw.split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
|
|
33288
|
-
}
|
|
33289
|
-
return /* @__PURE__ */ jsxs56(
|
|
33290
|
-
Box52,
|
|
33291
|
-
{
|
|
33292
|
-
flexDirection: "column",
|
|
33293
|
-
borderStyle: "round",
|
|
33294
|
-
borderColor: theme.status.warning,
|
|
33295
|
-
paddingX: 1,
|
|
33296
|
-
marginLeft: 2,
|
|
33297
|
-
marginRight: 2,
|
|
33298
|
-
marginTop: 1,
|
|
33299
|
-
children: [
|
|
33300
|
-
/* @__PURE__ */ jsxs56(Text60, { bold: true, color: theme.status.warning, children: [
|
|
33301
|
-
"\u26A0 ",
|
|
33302
|
-
operationLabel,
|
|
33303
|
-
queueLength > 1 && /* @__PURE__ */ jsx62(Text60, { color: theme.text.secondary, children: ` (1 de ${queueLength})` })
|
|
33304
|
-
] }),
|
|
33305
|
-
request.path && /* @__PURE__ */ jsx62(Text60, { color: theme.text.secondary, children: request.path }),
|
|
33306
|
-
request.preview?.command && /* @__PURE__ */ jsxs56(Text60, { color: theme.text.primary, children: [
|
|
33307
|
-
"$ ",
|
|
33308
|
-
request.preview.command,
|
|
33309
|
-
request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
|
|
33310
|
-
] }),
|
|
33311
|
-
hasDiff && /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", marginTop: 1, children: [
|
|
33312
|
-
/* @__PURE__ */ jsx62(Text60, { color: theme.status.error, dimColor: true, children: "\u2500\u2500 antes" }),
|
|
33313
|
-
beforeLines.map((line, i) => /* @__PURE__ */ jsxs56(Text60, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
|
|
33314
|
-
"\u2212 ",
|
|
33315
|
-
line
|
|
33316
|
-
] }, `b${i}`)),
|
|
33317
|
-
/* @__PURE__ */ jsx62(Text60, { color: theme.status.success, dimColor: true, children: "\u2500\u2500 depois" }),
|
|
33318
|
-
afterLines.map((line, i) => /* @__PURE__ */ jsxs56(Text60, { color: theme.status.success, dimColor: true, wrap: "truncate", children: [
|
|
33319
|
-
"+ ",
|
|
33320
|
-
line
|
|
33321
|
-
] }, `a${i}`)),
|
|
33322
|
-
truncated && /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
|
|
33323
|
-
] }),
|
|
33324
|
-
!hasDiff && singleLines.length > 0 && /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", marginTop: 1, children: [
|
|
33325
|
-
singleLines.map((line, i) => /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, wrap: "truncate", children: line }, i)),
|
|
33326
|
-
truncated && /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
|
|
33327
|
-
] }),
|
|
33328
|
-
/* @__PURE__ */ jsx62(Box52, { marginTop: 1, children: /* @__PURE__ */ jsx62(Text60, { color: theme.text.secondary, dimColor: true, children: "[\u21B5/y] uma vez [s] sess\xE3o [a] sempre [n/Esc] negar" }) })
|
|
33329
|
-
]
|
|
33330
|
-
}
|
|
33331
|
-
);
|
|
33332
|
-
};
|
|
33333
|
-
function formatApprovalOperationLabel(request) {
|
|
33334
|
-
const labels = {
|
|
33335
|
-
write_file: "escrever arquivo",
|
|
33336
|
-
edit_file: "editar arquivo",
|
|
33337
|
-
read_file: "ler arquivo",
|
|
33338
|
-
bash: "executar comando shell",
|
|
33339
|
-
shell: "executar comando shell",
|
|
33340
|
-
git: "executar comando git",
|
|
33341
|
-
fetch_web: "acessar URL",
|
|
33342
|
-
search_text: "buscar em arquivos",
|
|
33343
|
-
list_dir: "listar diret\xF3rio",
|
|
33344
|
-
analyze_code: "analisar c\xF3digo"
|
|
33345
|
-
};
|
|
33346
|
-
return labels[request.operation] ?? request.operation.replace(/_/g, " ");
|
|
33347
|
-
}
|
|
33348
33389
|
var DeepCodeConfigAdapter = class {
|
|
33349
33390
|
constructor(cwd) {
|
|
33350
33391
|
this.cwd = cwd;
|
|
@@ -33388,7 +33429,7 @@ var DeepCodeConfigAdapter = class {
|
|
|
33388
33429
|
}
|
|
33389
33430
|
};
|
|
33390
33431
|
function App(props) {
|
|
33391
|
-
return /* @__PURE__ */
|
|
33432
|
+
return /* @__PURE__ */ jsx64(
|
|
33392
33433
|
AppContainer,
|
|
33393
33434
|
{
|
|
33394
33435
|
cwd: props.cwd,
|