deepcode-ai 1.2.17 → 1.2.19
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 +287 -213
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7863,7 +7863,7 @@ 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
|
|
7866
|
+
import { isValidElement, useCallback as useCallback28, useEffect as useEffect31, useMemo as useMemo19, useRef as useRef21, useState as useState33 } from "react";
|
|
7867
7867
|
import { Box as Box52, Text as Text60, useInput as useInput6, useStdin as useStdin3 } from "ink";
|
|
7868
7868
|
import os22 from "os";
|
|
7869
7869
|
import path92 from "path";
|
|
@@ -9804,7 +9804,7 @@ import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
|
9804
9804
|
import { Box as Box31, Text as Text33 } from "ink";
|
|
9805
9805
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
9806
9806
|
import { Box as Box39, Text as Text47, useIsScreenReaderEnabled as useIsScreenReaderEnabled3 } from "ink";
|
|
9807
|
-
import { useCallback as useCallback19, useState as
|
|
9807
|
+
import { useCallback as useCallback19, useState as useState23 } from "react";
|
|
9808
9808
|
import { useRef as useRef8 } from "react";
|
|
9809
9809
|
import { Box as Box32, Text as Text34 } from "ink";
|
|
9810
9810
|
import { useEffect as useEffect16, useRef as useRef7, useState as useState14 } from "react";
|
|
@@ -9847,14 +9847,11 @@ import { Text as Text42 } from "ink";
|
|
|
9847
9847
|
import { jsxs as jsxs38 } from "react/jsx-runtime";
|
|
9848
9848
|
import { Text as Text43 } from "ink";
|
|
9849
9849
|
import { jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9850
|
-
import { useState as useState222, useEffect as useEffect24 } from "react";
|
|
9851
|
-
import { execFile as execFile22 } from "child_process";
|
|
9852
|
-
import os5 from "os";
|
|
9853
9850
|
import {
|
|
9854
9851
|
createContext as createContext8,
|
|
9855
9852
|
useCallback as useCallback18,
|
|
9856
9853
|
useContext as useContext9,
|
|
9857
|
-
useState as
|
|
9854
|
+
useState as useState222
|
|
9858
9855
|
} from "react";
|
|
9859
9856
|
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
9860
9857
|
import { jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
@@ -9869,9 +9866,9 @@ import { Box as Box40, Text as Text48 } from "ink";
|
|
|
9869
9866
|
import { useContext as useContext11 } from "react";
|
|
9870
9867
|
import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9871
9868
|
import { Box as Box41, Text as Text49 } from "ink";
|
|
9872
|
-
import
|
|
9873
|
-
import { useState as
|
|
9874
|
-
import { execFile as
|
|
9869
|
+
import os5 from "os";
|
|
9870
|
+
import { useState as useState24, useEffect as useEffect24, useCallback as useCallback20 } from "react";
|
|
9871
|
+
import { execFile as execFile22 } from "child_process";
|
|
9875
9872
|
import fs7 from "fs";
|
|
9876
9873
|
import fsPromises from "fs/promises";
|
|
9877
9874
|
import path142 from "path";
|
|
@@ -9879,33 +9876,33 @@ import { Fragment as Fragment11, jsx as jsx51, jsxs as jsxs45 } from "react/jsx-
|
|
|
9879
9876
|
import { memo, useMemo as useMemo12 } from "react";
|
|
9880
9877
|
import { Box as Box42, Text as Text50 } from "ink";
|
|
9881
9878
|
import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9882
|
-
import { useState as
|
|
9883
|
-
import { useState as
|
|
9884
|
-
import { useState as
|
|
9885
|
-
import
|
|
9879
|
+
import { useState as useState27, useEffect as useEffect27, useRef as useRef17 } from "react";
|
|
9880
|
+
import { useState as useState25, useEffect as useEffect25, useRef as useRef15 } from "react";
|
|
9881
|
+
import { useState as useState26, useEffect as useEffect26, useRef as useRef16 } from "react";
|
|
9882
|
+
import os6 from "os";
|
|
9886
9883
|
import path15 from "path";
|
|
9887
9884
|
import fs8 from "fs/promises";
|
|
9888
9885
|
import fs9 from "fs";
|
|
9889
9886
|
import path16 from "path";
|
|
9890
9887
|
import process4 from "process";
|
|
9891
9888
|
import fs10 from "fs";
|
|
9892
|
-
import
|
|
9889
|
+
import os7 from "os";
|
|
9893
9890
|
import path17 from "path";
|
|
9894
9891
|
import { Box as Box43, Text as Text51 } from "ink";
|
|
9895
9892
|
import { jsx as jsx53, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9896
9893
|
import { useCallback as useCallback21, useMemo as useMemo13, useRef as useRef18 } from "react";
|
|
9897
9894
|
import { Box as Box44, Text as Text52 } from "ink";
|
|
9898
9895
|
import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
9899
|
-
import { useCallback as useCallback22, useMemo as useMemo14, useState as
|
|
9896
|
+
import { useCallback as useCallback22, useMemo as useMemo14, useState as useState28 } from "react";
|
|
9900
9897
|
import { Box as Box45, Text as Text53, useInput as useInput3 } from "ink";
|
|
9901
9898
|
import { Fragment as Fragment12, jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
9902
|
-
import { useCallback as useCallback23, useState as
|
|
9899
|
+
import { useCallback as useCallback23, useState as useState29 } from "react";
|
|
9903
9900
|
import { Box as Box46, Text as Text54 } from "ink";
|
|
9904
9901
|
import { jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
9905
|
-
import { useCallback as useCallback24, useEffect as
|
|
9902
|
+
import { useCallback as useCallback24, useEffect as useEffect28, useMemo as useMemo15, useRef as useRef19, useState as useState30 } from "react";
|
|
9906
9903
|
import { Box as Box47, Text as Text55 } from "ink";
|
|
9907
9904
|
import { jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
9908
|
-
import { useCallback as useCallback25, useEffect as
|
|
9905
|
+
import { useCallback as useCallback25, useEffect as useEffect29, useMemo as useMemo16, useRef as useRef20, useState as useState31 } from "react";
|
|
9909
9906
|
import { Box as Box48, Text as Text56, useInput as useInput4 } from "ink";
|
|
9910
9907
|
import { jsx as jsx58, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
9911
9908
|
import fs11 from "fs";
|
|
@@ -9913,7 +9910,7 @@ import path18 from "path";
|
|
|
9913
9910
|
import { useCallback as useCallback26, useMemo as useMemo17 } from "react";
|
|
9914
9911
|
import { Box as Box49, Text as Text57 } from "ink";
|
|
9915
9912
|
import { jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
9916
|
-
import { useCallback as useCallback27, useEffect as
|
|
9913
|
+
import { useCallback as useCallback27, useEffect as useEffect30, useMemo as useMemo18, useState as useState32 } from "react";
|
|
9917
9914
|
import { Box as Box50, Text as Text58, useInput as useInput5 } from "ink";
|
|
9918
9915
|
import { jsx as jsx60, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
9919
9916
|
import { Box as Box51, Text as Text59 } from "ink";
|
|
@@ -11512,7 +11509,7 @@ function parseVersion(version) {
|
|
|
11512
11509
|
if (!match) return null;
|
|
11513
11510
|
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
11514
11511
|
}
|
|
11515
|
-
var VERSION = "1.2.
|
|
11512
|
+
var VERSION = "1.2.19".length > 0 ? "1.2.19" : "0.0.0-dev";
|
|
11516
11513
|
async function updateCommand() {
|
|
11517
11514
|
writeStdoutLine(`Current version: ${VERSION}`);
|
|
11518
11515
|
const update = await checkForUpdate(VERSION, { force: true });
|
|
@@ -17883,18 +17880,21 @@ var ThinkMessage = ({
|
|
|
17883
17880
|
isPending,
|
|
17884
17881
|
availableTerminalHeight,
|
|
17885
17882
|
contentWidth
|
|
17886
|
-
}) => /* @__PURE__ */
|
|
17887
|
-
|
|
17888
|
-
|
|
17889
|
-
|
|
17890
|
-
|
|
17891
|
-
|
|
17892
|
-
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
|
|
17896
|
-
|
|
17897
|
-
|
|
17883
|
+
}) => /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
|
|
17884
|
+
/* @__PURE__ */ jsx10(Text9, { color: theme.text.secondary, dimColor: true, children: "\u25C9 pensando\u2026" }),
|
|
17885
|
+
/* @__PURE__ */ jsx10(
|
|
17886
|
+
PrefixedMarkdownMessage,
|
|
17887
|
+
{
|
|
17888
|
+
text,
|
|
17889
|
+
prefix: "\u2502",
|
|
17890
|
+
prefixColor: theme.ui.comment,
|
|
17891
|
+
isPending,
|
|
17892
|
+
availableTerminalHeight,
|
|
17893
|
+
contentWidth,
|
|
17894
|
+
textColor: theme.text.secondary
|
|
17895
|
+
}
|
|
17896
|
+
)
|
|
17897
|
+
] });
|
|
17898
17898
|
var ThinkMessageContent = ({
|
|
17899
17899
|
text,
|
|
17900
17900
|
isPending,
|
|
@@ -17907,7 +17907,7 @@ var ThinkMessageContent = ({
|
|
|
17907
17907
|
isPending,
|
|
17908
17908
|
availableTerminalHeight,
|
|
17909
17909
|
contentWidth,
|
|
17910
|
-
basePrefix: "\
|
|
17910
|
+
basePrefix: "\u2502",
|
|
17911
17911
|
textColor: theme.text.secondary
|
|
17912
17912
|
}
|
|
17913
17913
|
);
|
|
@@ -28321,29 +28321,8 @@ function MCPHealthPill() {
|
|
|
28321
28321
|
mcpTotal
|
|
28322
28322
|
] });
|
|
28323
28323
|
}
|
|
28324
|
-
var GIT_POLL_INTERVAL_MS = 3e4;
|
|
28325
28324
|
function useStatusLine() {
|
|
28326
|
-
|
|
28327
|
-
const cwd = config.getWorkingDir();
|
|
28328
|
-
const [branch, setBranch] = useState222(null);
|
|
28329
|
-
useEffect24(() => {
|
|
28330
|
-
let alive = true;
|
|
28331
|
-
function poll() {
|
|
28332
|
-
execFile22("git", ["branch", "--show-current"], { cwd }, (err, stdout) => {
|
|
28333
|
-
if (alive) setBranch(err ? null : stdout.trim() || null);
|
|
28334
|
-
});
|
|
28335
|
-
}
|
|
28336
|
-
poll();
|
|
28337
|
-
const timer = setInterval(poll, GIT_POLL_INTERVAL_MS);
|
|
28338
|
-
return () => {
|
|
28339
|
-
alive = false;
|
|
28340
|
-
clearInterval(timer);
|
|
28341
|
-
};
|
|
28342
|
-
}, [cwd]);
|
|
28343
|
-
if (!branch) return { lines: [] };
|
|
28344
|
-
const home = os5.homedir();
|
|
28345
|
-
const displayCwd = cwd.startsWith(home) ? `~${cwd.slice(home.length)}` : cwd;
|
|
28346
|
-
return { lines: [`${displayCwd} [${branch}]`] };
|
|
28325
|
+
return { lines: [] };
|
|
28347
28326
|
}
|
|
28348
28327
|
function useConfigInitMessage(_isConfigInitialized) {
|
|
28349
28328
|
return null;
|
|
@@ -28353,8 +28332,8 @@ var VimModeProvider = ({
|
|
|
28353
28332
|
children,
|
|
28354
28333
|
initialVimEnabled = false
|
|
28355
28334
|
}) => {
|
|
28356
|
-
const [vimEnabled, setVimEnabled] =
|
|
28357
|
-
const [vimMode, setVimMode] =
|
|
28335
|
+
const [vimEnabled, setVimEnabled] = useState222(initialVimEnabled);
|
|
28336
|
+
const [vimMode, setVimMode] = useState222(
|
|
28358
28337
|
initialVimEnabled ? "NORMAL" : "INSERT"
|
|
28359
28338
|
);
|
|
28360
28339
|
const toggleVimEnabled = useCallback18(async () => {
|
|
@@ -28399,7 +28378,7 @@ var Footer = () => {
|
|
|
28399
28378
|
/* @__PURE__ */ jsx46(GeminiSpinner, {}),
|
|
28400
28379
|
" ",
|
|
28401
28380
|
configInitMessage
|
|
28402
|
-
] }) : showAutoAcceptIndicator !== void 0 && showAutoAcceptIndicator !== "default" ? /* @__PURE__ */ jsx46(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator }) : suppressHint ? null : /* @__PURE__ */ jsx46(Text44, { color: theme.text.secondary, children:
|
|
28381
|
+
] }) : showAutoAcceptIndicator !== void 0 && showAutoAcceptIndicator !== "default" ? /* @__PURE__ */ jsx46(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator }) : suppressHint ? null : /* @__PURE__ */ jsx46(Text44, { color: theme.text.secondary, children: "/help para ajuda \xB7 /yolo para aprovar tudo" });
|
|
28403
28382
|
const rightItems = [];
|
|
28404
28383
|
if (sandboxInfo) {
|
|
28405
28384
|
rightItems.push({
|
|
@@ -28593,11 +28572,11 @@ var Composer = () => {
|
|
|
28593
28572
|
}
|
|
28594
28573
|
}
|
|
28595
28574
|
}
|
|
28596
|
-
const [showShortcuts, setShowShortcuts] =
|
|
28575
|
+
const [showShortcuts, setShowShortcuts] = useState23(false);
|
|
28597
28576
|
const handleToggleShortcuts = useCallback19(() => {
|
|
28598
28577
|
setShowShortcuts((prev) => !prev);
|
|
28599
28578
|
}, []);
|
|
28600
|
-
const [showSuggestions, setShowSuggestions] =
|
|
28579
|
+
const [showSuggestions, setShowSuggestions] = useState23(false);
|
|
28601
28580
|
const handleSuggestionsVisibilityChange = useCallback19(
|
|
28602
28581
|
(visible) => {
|
|
28603
28582
|
setShowSuggestions(visible);
|
|
@@ -28685,14 +28664,14 @@ var Notifications = () => {
|
|
|
28685
28664
|
};
|
|
28686
28665
|
function gitExec(args, cwd) {
|
|
28687
28666
|
return new Promise((resolve3, reject) => {
|
|
28688
|
-
|
|
28667
|
+
execFile22("git", args, { cwd }, (err, stdout) => {
|
|
28689
28668
|
if (err) reject(err);
|
|
28690
28669
|
else resolve3(stdout.toString().trim());
|
|
28691
28670
|
});
|
|
28692
28671
|
});
|
|
28693
28672
|
}
|
|
28694
28673
|
function useGitBranchName(cwd) {
|
|
28695
|
-
const [branchName, setBranchName] =
|
|
28674
|
+
const [branchName, setBranchName] = useState24(void 0);
|
|
28696
28675
|
const fetchBranchName = useCallback20(async () => {
|
|
28697
28676
|
try {
|
|
28698
28677
|
const branch = await gitExec(["rev-parse", "--abbrev-ref", "HEAD"], cwd);
|
|
@@ -28706,7 +28685,7 @@ function useGitBranchName(cwd) {
|
|
|
28706
28685
|
setBranchName(void 0);
|
|
28707
28686
|
}
|
|
28708
28687
|
}, [cwd]);
|
|
28709
|
-
|
|
28688
|
+
useEffect24(() => {
|
|
28710
28689
|
void fetchBranchName();
|
|
28711
28690
|
const gitLogsHeadPath = path142.join(cwd, ".git", "logs", "HEAD");
|
|
28712
28691
|
let watcher;
|
|
@@ -28725,7 +28704,7 @@ function useGitBranchName(cwd) {
|
|
|
28725
28704
|
return branchName;
|
|
28726
28705
|
}
|
|
28727
28706
|
function tildeify(p) {
|
|
28728
|
-
const home =
|
|
28707
|
+
const home = os5.homedir();
|
|
28729
28708
|
return p.startsWith(home) ? `~${p.slice(home.length)}` : p;
|
|
28730
28709
|
}
|
|
28731
28710
|
function statusLabel(state) {
|
|
@@ -28966,11 +28945,11 @@ var StickyTodoList = memo(
|
|
|
28966
28945
|
(prev, next) => prev.width === next.width && prev.maxVisibleItems === next.maxVisibleItems && getStickyTodosRenderKey(prev.todos) === getStickyTodosRenderKey(next.todos)
|
|
28967
28946
|
);
|
|
28968
28947
|
var useTimer = (isActive, resetKey) => {
|
|
28969
|
-
const [elapsedTime, setElapsedTime] =
|
|
28948
|
+
const [elapsedTime, setElapsedTime] = useState25(0);
|
|
28970
28949
|
const timerRef = useRef15(null);
|
|
28971
28950
|
const prevResetKeyRef = useRef15(resetKey);
|
|
28972
28951
|
const prevIsActiveRef = useRef15(isActive);
|
|
28973
|
-
|
|
28952
|
+
useEffect25(() => {
|
|
28974
28953
|
let shouldReset = false;
|
|
28975
28954
|
if (prevResetKeyRef.current !== resetKey) {
|
|
28976
28955
|
shouldReset = true;
|
|
@@ -29013,9 +28992,9 @@ var DEFAULT_PHRASES = [
|
|
|
29013
28992
|
];
|
|
29014
28993
|
var usePhraseCycler = (isActive, isWaiting, customPhrases) => {
|
|
29015
28994
|
const phrases = customPhrases && customPhrases.length > 0 ? customPhrases : DEFAULT_PHRASES;
|
|
29016
|
-
const [phrase, setPhrase] =
|
|
28995
|
+
const [phrase, setPhrase] = useState26(phrases[0] ?? "");
|
|
29017
28996
|
const intervalRef = useRef16(null);
|
|
29018
|
-
|
|
28997
|
+
useEffect26(() => {
|
|
29019
28998
|
if (isWaiting) {
|
|
29020
28999
|
setPhrase("Aguardando confirma\xE7\xE3o...");
|
|
29021
29000
|
if (intervalRef.current) {
|
|
@@ -29044,15 +29023,15 @@ var usePhraseCycler = (isActive, isWaiting, customPhrases) => {
|
|
|
29044
29023
|
return phrase;
|
|
29045
29024
|
};
|
|
29046
29025
|
var useLoadingIndicator = (streamingState, customPhrases) => {
|
|
29047
|
-
const [timerResetKey, setTimerResetKey] =
|
|
29026
|
+
const [timerResetKey, setTimerResetKey] = useState27(0);
|
|
29048
29027
|
const isTimerActive = streamingState === "responding";
|
|
29049
29028
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
29050
29029
|
const isPhraseCyclingActive = streamingState === "responding";
|
|
29051
29030
|
const isWaiting = streamingState === "waiting_for_confirmation";
|
|
29052
29031
|
const currentLoadingPhrase = usePhraseCycler(isPhraseCyclingActive, isWaiting, customPhrases);
|
|
29053
|
-
const [retainedElapsedTime, setRetainedElapsedTime] =
|
|
29032
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = useState27(0);
|
|
29054
29033
|
const prevStateRef = useRef17(null);
|
|
29055
|
-
|
|
29034
|
+
useEffect27(() => {
|
|
29056
29035
|
const prev = prevStateRef.current;
|
|
29057
29036
|
if (prev === "waiting_for_confirmation" && streamingState === "responding") {
|
|
29058
29037
|
setTimerResetKey((k) => k + 1);
|
|
@@ -29348,7 +29327,7 @@ function generateFilename(format, cwd) {
|
|
|
29348
29327
|
}
|
|
29349
29328
|
async function exportSession(opts) {
|
|
29350
29329
|
const content = opts.format === "markdown" ? toMarkdown(opts) : toJson(opts);
|
|
29351
|
-
const downloadsDir = path15.join(
|
|
29330
|
+
const downloadsDir = path15.join(os6.homedir(), "Downloads");
|
|
29352
29331
|
let outputDir = opts.cwd;
|
|
29353
29332
|
try {
|
|
29354
29333
|
await fs8.access(downloadsDir);
|
|
@@ -29389,7 +29368,7 @@ var exportCommand = {
|
|
|
29389
29368
|
const cwd = context.ui.getCwd?.() ?? process.cwd();
|
|
29390
29369
|
const model = context.services.session?.getState().model;
|
|
29391
29370
|
if (messages.length === 0) {
|
|
29392
|
-
return { type: "message", messageType: "info", content: "
|
|
29371
|
+
return { type: "message", messageType: "info", content: "Nada para exportar ainda." };
|
|
29393
29372
|
}
|
|
29394
29373
|
try {
|
|
29395
29374
|
const outPath = await exportSession({ messages, cwd, model, format: fmt2 });
|
|
@@ -29514,12 +29493,12 @@ var undoCommand = {
|
|
|
29514
29493
|
action: async (context) => {
|
|
29515
29494
|
const result = await context.ui.undo();
|
|
29516
29495
|
if (!result) {
|
|
29517
|
-
return { type: "message", messageType: "info", content:
|
|
29496
|
+
return { type: "message", messageType: "info", content: "Nada para desfazer." };
|
|
29518
29497
|
}
|
|
29519
29498
|
return {
|
|
29520
29499
|
type: "message",
|
|
29521
29500
|
messageType: "info",
|
|
29522
|
-
content: `\u21A9
|
|
29501
|
+
content: `\u21A9 Restaurado: ${result.path}`
|
|
29523
29502
|
};
|
|
29524
29503
|
}
|
|
29525
29504
|
};
|
|
@@ -29668,37 +29647,37 @@ var statsCommand = {
|
|
|
29668
29647
|
};
|
|
29669
29648
|
var updateCommand2 = {
|
|
29670
29649
|
name: "update",
|
|
29671
|
-
description: "
|
|
29650
|
+
description: "Verifica vers\xF5es publicadas do DeepCode",
|
|
29672
29651
|
kind: "built-in",
|
|
29673
29652
|
supportedModes: ["interactive"],
|
|
29674
29653
|
action: async () => {
|
|
29675
29654
|
const update = await checkForUpdate(VERSION, { force: true });
|
|
29676
|
-
const lines = [`
|
|
29655
|
+
const lines = [`Vers\xE3o atual: ${VERSION}`];
|
|
29677
29656
|
if (!update) {
|
|
29678
|
-
lines.push("
|
|
29657
|
+
lines.push("N\xE3o foi poss\xEDvel acessar o registro npm agora.");
|
|
29679
29658
|
} else {
|
|
29680
|
-
const latestStatus = isNewer(VERSION, update.latest) ? "
|
|
29681
|
-
lines.push(`
|
|
29659
|
+
const latestStatus = isNewer(VERSION, update.latest) ? "dispon\xEDvel" : "atual ou mais recente";
|
|
29660
|
+
lines.push(`Vers\xE3o latest: ${update.latest} (${latestStatus})`);
|
|
29682
29661
|
if (update.stable) {
|
|
29683
|
-
const stableStatus = isNewer(VERSION, update.stable) ? "
|
|
29684
|
-
lines.push(`
|
|
29662
|
+
const stableStatus = isNewer(VERSION, update.stable) ? "dispon\xEDvel" : "atual ou mais recente";
|
|
29663
|
+
lines.push(`Vers\xE3o stable: ${update.stable} (${stableStatus})`);
|
|
29685
29664
|
} else {
|
|
29686
|
-
lines.push("
|
|
29665
|
+
lines.push("Vers\xE3o stable: ainda n\xE3o publicada");
|
|
29687
29666
|
}
|
|
29688
29667
|
}
|
|
29689
29668
|
lines.push("");
|
|
29690
|
-
lines.push("
|
|
29691
|
-
lines.push("
|
|
29669
|
+
lines.push("Instalar latest: npm install -g deepcode-ai@latest");
|
|
29670
|
+
lines.push("Instalar stable: npm install -g deepcode-ai@stable");
|
|
29692
29671
|
return { type: "message", messageType: "info", content: lines.join("\n") };
|
|
29693
29672
|
}
|
|
29694
29673
|
};
|
|
29695
29674
|
function memoryIndexPath(cwd) {
|
|
29696
29675
|
const slug = cwd.replace(/\//g, "-");
|
|
29697
|
-
return path17.join(
|
|
29676
|
+
return path17.join(os7.homedir(), ".claude", "projects", slug, "memory", "MEMORY.md");
|
|
29698
29677
|
}
|
|
29699
29678
|
function memoryDirPath(cwd) {
|
|
29700
29679
|
const slug = cwd.replace(/\//g, "-");
|
|
29701
|
-
return path17.join(
|
|
29680
|
+
return path17.join(os7.homedir(), ".claude", "projects", slug, "memory");
|
|
29702
29681
|
}
|
|
29703
29682
|
var memoryCommand = {
|
|
29704
29683
|
name: "memory",
|
|
@@ -29770,6 +29749,15 @@ var safeCommand = {
|
|
|
29770
29749
|
);
|
|
29771
29750
|
}
|
|
29772
29751
|
};
|
|
29752
|
+
var newCommand = {
|
|
29753
|
+
name: "new",
|
|
29754
|
+
description: "Inicia uma nova sess\xE3o em branco (mant\xE9m provider/modelo atual)",
|
|
29755
|
+
kind: "built-in",
|
|
29756
|
+
supportedModes: ["interactive"],
|
|
29757
|
+
action: async (context) => {
|
|
29758
|
+
await context.ui.newSession?.();
|
|
29759
|
+
}
|
|
29760
|
+
};
|
|
29773
29761
|
function sessionNotReady() {
|
|
29774
29762
|
return {
|
|
29775
29763
|
type: "message",
|
|
@@ -30071,12 +30059,12 @@ var ProviderDialog = ({
|
|
|
30071
30059
|
onTestProvider,
|
|
30072
30060
|
onClose
|
|
30073
30061
|
}) => {
|
|
30074
|
-
const [phase, setPhase] =
|
|
30075
|
-
const [selectedProvider, setSelectedProvider] =
|
|
30076
|
-
const [apiKeyInput, setApiKeyInput] =
|
|
30077
|
-
const [isBusy, setIsBusy] =
|
|
30078
|
-
const [status, setStatus] =
|
|
30079
|
-
const [testLatencyMs, setTestLatencyMs] =
|
|
30062
|
+
const [phase, setPhase] = useState28("providers");
|
|
30063
|
+
const [selectedProvider, setSelectedProvider] = useState28(currentProvider);
|
|
30064
|
+
const [apiKeyInput, setApiKeyInput] = useState28("");
|
|
30065
|
+
const [isBusy, setIsBusy] = useState28(false);
|
|
30066
|
+
const [status, setStatus] = useState28(null);
|
|
30067
|
+
const [testLatencyMs, setTestLatencyMs] = useState28(void 0);
|
|
30080
30068
|
const isLocal = CREDENTIAL_FREE_PROVIDERS.has(selectedProvider);
|
|
30081
30069
|
const keyIsSet = hasApiKey(selectedProvider);
|
|
30082
30070
|
const keyHint = getProviderKeyHint(selectedProvider);
|
|
@@ -30405,8 +30393,8 @@ var PermissionsDialog = ({
|
|
|
30405
30393
|
onSave,
|
|
30406
30394
|
onClose
|
|
30407
30395
|
}) => {
|
|
30408
|
-
const [modes, setModes] =
|
|
30409
|
-
const [focusIndex, setFocusIndex] =
|
|
30396
|
+
const [modes, setModes] = useState29(current);
|
|
30397
|
+
const [focusIndex, setFocusIndex] = useState29(0);
|
|
30410
30398
|
const dirty = PERMISSION_KEYS.some((k) => modes[k] !== current[k]);
|
|
30411
30399
|
const handleKey = useCallback23(
|
|
30412
30400
|
(key) => {
|
|
@@ -30481,9 +30469,9 @@ var AuthDialog = ({
|
|
|
30481
30469
|
onPersistToken,
|
|
30482
30470
|
onClose
|
|
30483
30471
|
}) => {
|
|
30484
|
-
const [phase, setPhase] =
|
|
30485
|
-
const [deviceCode, setDeviceCode] =
|
|
30486
|
-
const [message, setMessage] =
|
|
30472
|
+
const [phase, setPhase] = useState30("menu");
|
|
30473
|
+
const [deviceCode, setDeviceCode] = useState30(null);
|
|
30474
|
+
const [message, setMessage] = useState30("");
|
|
30487
30475
|
const abortRef = useRef19(null);
|
|
30488
30476
|
const items = useMemo15(
|
|
30489
30477
|
() => [
|
|
@@ -30559,7 +30547,7 @@ var AuthDialog = ({
|
|
|
30559
30547
|
},
|
|
30560
30548
|
[clearToken, onClose, startLogin]
|
|
30561
30549
|
);
|
|
30562
|
-
|
|
30550
|
+
useEffect28(() => () => {
|
|
30563
30551
|
abortRef.current?.abort();
|
|
30564
30552
|
}, []);
|
|
30565
30553
|
const handleEscape = useCallback24(
|
|
@@ -30621,6 +30609,19 @@ function providerGroup(model) {
|
|
|
30621
30609
|
function isFree(model) {
|
|
30622
30610
|
return model.pricing !== void 0 && model.pricing.inputPer1k === 0 && model.pricing.outputPer1k === 0;
|
|
30623
30611
|
}
|
|
30612
|
+
function fmtCtx(n) {
|
|
30613
|
+
if (n >= 1e6) return `${(n / 1e6).toFixed(0)}M ctx`;
|
|
30614
|
+
if (n >= 1e3) return `${Math.round(n / 1e3)}k ctx`;
|
|
30615
|
+
return `${n} ctx`;
|
|
30616
|
+
}
|
|
30617
|
+
function fmtPrice(model) {
|
|
30618
|
+
if (!model.pricing) return null;
|
|
30619
|
+
if (isFree(model)) return "Free";
|
|
30620
|
+
const inp = model.pricing.inputPer1k;
|
|
30621
|
+
const out = model.pricing.outputPer1k;
|
|
30622
|
+
const fmtUsd = (n) => n < 0.01 ? `$${(n * 1e3).toFixed(2)}/M` : `$${n.toFixed(3)}/k`;
|
|
30623
|
+
return `${fmtUsd(inp)} in \xB7 ${fmtUsd(out)} out`;
|
|
30624
|
+
}
|
|
30624
30625
|
function buildRows(models, currentId, search) {
|
|
30625
30626
|
const q = search.toLowerCase();
|
|
30626
30627
|
const filtered = search ? models.filter(
|
|
@@ -30655,13 +30656,13 @@ var ModelDialog = ({
|
|
|
30655
30656
|
onSelectModel,
|
|
30656
30657
|
onClose
|
|
30657
30658
|
}) => {
|
|
30658
|
-
const [loadState, setLoadState] =
|
|
30659
|
-
const [models, setModels] =
|
|
30660
|
-
const [errorMsg, setErrorMsg] =
|
|
30661
|
-
const [search, setSearch] =
|
|
30662
|
-
const [activeSelIndex, setActiveSelIndex] =
|
|
30659
|
+
const [loadState, setLoadState] = useState31("loading");
|
|
30660
|
+
const [models, setModels] = useState31([]);
|
|
30661
|
+
const [errorMsg, setErrorMsg] = useState31("");
|
|
30662
|
+
const [search, setSearch] = useState31("");
|
|
30663
|
+
const [activeSelIndex, setActiveSelIndex] = useState31(0);
|
|
30663
30664
|
const abortRef = useRef20(null);
|
|
30664
|
-
|
|
30665
|
+
useEffect29(() => {
|
|
30665
30666
|
const ctrl = new AbortController();
|
|
30666
30667
|
abortRef.current = ctrl;
|
|
30667
30668
|
onFetchModels(currentProvider, ctrl.signal).then((fetched) => {
|
|
@@ -30681,7 +30682,7 @@ var ModelDialog = ({
|
|
|
30681
30682
|
);
|
|
30682
30683
|
const selectableCount = rows.filter((r) => r.kind === "item").length;
|
|
30683
30684
|
const clampedIndex = Math.min(activeSelIndex, Math.max(0, selectableCount - 1));
|
|
30684
|
-
|
|
30685
|
+
useEffect29(() => {
|
|
30685
30686
|
setActiveSelIndex(0);
|
|
30686
30687
|
}, [search]);
|
|
30687
30688
|
const activeRowPos = useMemo16(
|
|
@@ -30794,22 +30795,35 @@ var ModelDialog = ({
|
|
|
30794
30795
|
const { model, selIndex } = row;
|
|
30795
30796
|
const isActive = selIndex === clampedIndex;
|
|
30796
30797
|
const isCurrent = model.id === currentModel;
|
|
30797
|
-
const
|
|
30798
|
+
const price = fmtPrice(model);
|
|
30798
30799
|
const group = providerGroup(model);
|
|
30799
|
-
return /* @__PURE__ */ jsxs52(Box48, {
|
|
30800
|
-
/* @__PURE__ */
|
|
30801
|
-
|
|
30802
|
-
/* @__PURE__ */
|
|
30800
|
+
return /* @__PURE__ */ jsxs52(Box48, { flexDirection: "column", children: [
|
|
30801
|
+
/* @__PURE__ */ jsxs52(Box48, { gap: 1, children: [
|
|
30802
|
+
/* @__PURE__ */ jsx58(Text56, { color: isActive ? theme.text.accent : theme.ui.comment, children: isCurrent ? "\u25CF" : isActive ? "\u203A" : " " }),
|
|
30803
|
+
/* @__PURE__ */ jsxs52(Box48, { flexGrow: 1, gap: 1, children: [
|
|
30804
|
+
/* @__PURE__ */ jsx58(
|
|
30805
|
+
Text56,
|
|
30806
|
+
{
|
|
30807
|
+
color: isActive ? theme.text.primary : theme.text.secondary,
|
|
30808
|
+
bold: isActive,
|
|
30809
|
+
children: model.name
|
|
30810
|
+
}
|
|
30811
|
+
),
|
|
30812
|
+
/* @__PURE__ */ jsx58(Text56, { color: theme.text.accent, dimColor: true, children: group })
|
|
30813
|
+
] }),
|
|
30814
|
+
price && /* @__PURE__ */ jsx58(
|
|
30803
30815
|
Text56,
|
|
30804
30816
|
{
|
|
30805
|
-
color:
|
|
30806
|
-
|
|
30807
|
-
children:
|
|
30817
|
+
color: price === "Free" ? theme.status.success : theme.ui.comment,
|
|
30818
|
+
dimColor: !isActive,
|
|
30819
|
+
children: price
|
|
30808
30820
|
}
|
|
30809
|
-
)
|
|
30810
|
-
/* @__PURE__ */ jsx58(Text56, { color: theme.text.accent, dimColor: true, children: group })
|
|
30821
|
+
)
|
|
30811
30822
|
] }),
|
|
30812
|
-
|
|
30823
|
+
isActive && /* @__PURE__ */ jsxs52(Box48, { paddingLeft: 2, gap: 2, children: [
|
|
30824
|
+
/* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: model.id }),
|
|
30825
|
+
model.contextLength > 0 && /* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: fmtCtx(model.contextLength) })
|
|
30826
|
+
] })
|
|
30813
30827
|
] }, model.id);
|
|
30814
30828
|
}),
|
|
30815
30829
|
canScrollDown && /* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: " \u2193" })
|
|
@@ -30920,16 +30934,17 @@ function relativeTime(iso) {
|
|
|
30920
30934
|
return `h\xE1 ${diffMonths} m\xEAs${diffMonths !== 1 ? "es" : ""}`;
|
|
30921
30935
|
}
|
|
30922
30936
|
function sessionLabel2(session) {
|
|
30923
|
-
const name = typeof session.metadata["name"] === "string" ? session.metadata["name"] : void 0;
|
|
30937
|
+
const name = typeof session.metadata["name"] === "string" && session.metadata["name"].trim() ? session.metadata["name"].trim() : void 0;
|
|
30924
30938
|
const firstUser = session.messages.find((m) => m.role === "user");
|
|
30925
|
-
|
|
30939
|
+
const preview = typeof firstUser?.content === "string" ? firstUser.content.trim().slice(0, 60) : "";
|
|
30940
|
+
return name ?? (preview || "(sem mensagens)");
|
|
30926
30941
|
}
|
|
30927
30942
|
var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
30928
|
-
const [loadState, setLoadState] =
|
|
30929
|
-
const [allSessions, setAllSessions] =
|
|
30930
|
-
const [search, setSearch] =
|
|
30931
|
-
const [activeIndex, setActiveIndex] =
|
|
30932
|
-
|
|
30943
|
+
const [loadState, setLoadState] = useState32("loading");
|
|
30944
|
+
const [allSessions, setAllSessions] = useState32([]);
|
|
30945
|
+
const [search, setSearch] = useState32("");
|
|
30946
|
+
const [activeIndex, setActiveIndex] = useState32(0);
|
|
30947
|
+
useEffect30(() => {
|
|
30933
30948
|
const manager = new SessionManager(cwd);
|
|
30934
30949
|
manager.loadAll().then((loaded) => {
|
|
30935
30950
|
const sorted = [...loaded].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
@@ -30937,7 +30952,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30937
30952
|
setLoadState("ready");
|
|
30938
30953
|
}).catch(() => setLoadState("error"));
|
|
30939
30954
|
}, [cwd]);
|
|
30940
|
-
|
|
30955
|
+
useEffect30(() => {
|
|
30941
30956
|
setActiveIndex(0);
|
|
30942
30957
|
}, [search]);
|
|
30943
30958
|
const sessions = useMemo18(() => {
|
|
@@ -31374,53 +31389,53 @@ var APPROVAL_ENTER_ARM_DELAY_MS = 350;
|
|
|
31374
31389
|
var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarnings = [] }) => {
|
|
31375
31390
|
const historyManager = useHistory();
|
|
31376
31391
|
const addHistoryItem = historyManager.addItem;
|
|
31377
|
-
const [initError, setInitError] =
|
|
31378
|
-
const [isInitializing, setIsInitializing] =
|
|
31379
|
-
const [isRunning, setIsRunning] =
|
|
31380
|
-
const [pendingAssistantText, setPendingAssistantText] =
|
|
31381
|
-
const [approvalQueue, setApprovalQueue] =
|
|
31382
|
-
const [providerLabel, setProviderLabel] =
|
|
31383
|
-
const [targetSource, setTargetSource] =
|
|
31384
|
-
const [currentModel, setCurrentModel] =
|
|
31385
|
-
const [agentMode, setAgentMode] =
|
|
31386
|
-
const [streamingState, setStreamingState] =
|
|
31392
|
+
const [initError, setInitError] = useState33(null);
|
|
31393
|
+
const [isInitializing, setIsInitializing] = useState33(true);
|
|
31394
|
+
const [isRunning, setIsRunning] = useState33(false);
|
|
31395
|
+
const [pendingAssistantText, setPendingAssistantText] = useState33("");
|
|
31396
|
+
const [approvalQueue, setApprovalQueue] = useState33([]);
|
|
31397
|
+
const [providerLabel, setProviderLabel] = useState33("(unconfigured)");
|
|
31398
|
+
const [targetSource, setTargetSource] = useState33("config");
|
|
31399
|
+
const [currentModel, setCurrentModel] = useState33("(unconfigured)");
|
|
31400
|
+
const [agentMode, setAgentMode] = useState33("build");
|
|
31401
|
+
const [streamingState, setStreamingState] = useState33(
|
|
31387
31402
|
"idle"
|
|
31388
31403
|
/* Idle */
|
|
31389
31404
|
);
|
|
31390
|
-
const [compactMode, setCompactMode] =
|
|
31391
|
-
const [constrainHeight, setConstrainHeight] =
|
|
31392
|
-
const [shellModeActive, setShellModeActive] =
|
|
31393
|
-
const [showEscapePrompt, setShowEscapePrompt] =
|
|
31394
|
-
const [messageQueue, setMessageQueue] =
|
|
31395
|
-
const [historyRemountKey, setHistoryRemountKey] =
|
|
31396
|
-
const [pendingItem, setPendingItem] =
|
|
31397
|
-
const [lastPromptTokenCount, setLastPromptTokenCount] =
|
|
31398
|
-
const [lastOutputTokenCount, setLastOutputTokenCount] =
|
|
31399
|
-
const [totalPromptTokenCount, setTotalPromptTokenCount] =
|
|
31400
|
-
const [totalOutputTokenCount, setTotalOutputTokenCount] =
|
|
31401
|
-
const [isReceivingContent, setIsReceivingContent] =
|
|
31402
|
-
const [iterationInfo, setIterationInfo] =
|
|
31403
|
-
const [liveToolCalls, setLiveToolCalls] =
|
|
31404
|
-
const [recentSlashCommandsState, setRecentSlashCommandsState] =
|
|
31405
|
-
const [activeDialog, setActiveDialog] =
|
|
31406
|
-
const [themeName, setThemeName] =
|
|
31407
|
-
const [permissionSummary, setPermissionSummary] =
|
|
31408
|
-
const [authSummary, setAuthSummary] =
|
|
31409
|
-
const [permissionModes, setPermissionModes] =
|
|
31405
|
+
const [compactMode, setCompactMode] = useState33(true);
|
|
31406
|
+
const [constrainHeight, setConstrainHeight] = useState33(true);
|
|
31407
|
+
const [shellModeActive, setShellModeActive] = useState33(false);
|
|
31408
|
+
const [showEscapePrompt, setShowEscapePrompt] = useState33(false);
|
|
31409
|
+
const [messageQueue, setMessageQueue] = useState33([]);
|
|
31410
|
+
const [historyRemountKey, setHistoryRemountKey] = useState33(0);
|
|
31411
|
+
const [pendingItem, setPendingItem] = useState33(null);
|
|
31412
|
+
const [lastPromptTokenCount, setLastPromptTokenCount] = useState33(0);
|
|
31413
|
+
const [lastOutputTokenCount, setLastOutputTokenCount] = useState33(0);
|
|
31414
|
+
const [totalPromptTokenCount, setTotalPromptTokenCount] = useState33(0);
|
|
31415
|
+
const [totalOutputTokenCount, setTotalOutputTokenCount] = useState33(0);
|
|
31416
|
+
const [isReceivingContent, setIsReceivingContent] = useState33(false);
|
|
31417
|
+
const [iterationInfo, setIterationInfo] = useState33(null);
|
|
31418
|
+
const [liveToolCalls, setLiveToolCalls] = useState33([]);
|
|
31419
|
+
const [recentSlashCommandsState, setRecentSlashCommandsState] = useState33(/* @__PURE__ */ new Map());
|
|
31420
|
+
const [activeDialog, setActiveDialog] = useState33(null);
|
|
31421
|
+
const [themeName, setThemeName] = useState33("(unknown)");
|
|
31422
|
+
const [permissionSummary, setPermissionSummary] = useState33("(unknown)");
|
|
31423
|
+
const [authSummary, setAuthSummary] = useState33("(unknown)");
|
|
31424
|
+
const [permissionModes, setPermissionModes] = useState33({
|
|
31410
31425
|
read: "allow",
|
|
31411
31426
|
write: "ask",
|
|
31412
31427
|
gitLocal: "allow",
|
|
31413
31428
|
shell: "ask",
|
|
31414
31429
|
dangerous: "ask"
|
|
31415
31430
|
});
|
|
31416
|
-
const [sessionDisplayName, setSessionDisplayName] =
|
|
31417
|
-
const [providerConfigVersion, setProviderConfigVersion] =
|
|
31418
|
-
const [, setThemeVersion] =
|
|
31419
|
-
const [mcpConnected, setMcpConnected] =
|
|
31420
|
-
const [mcpTotal, setMcpTotal] =
|
|
31421
|
-
const [subagentMap, setSubagentMap] =
|
|
31422
|
-
const [, setDrainTick] =
|
|
31423
|
-
const [pendingCommandConfirmation, setPendingCommandConfirmation] =
|
|
31431
|
+
const [sessionDisplayName, setSessionDisplayName] = useState33("");
|
|
31432
|
+
const [providerConfigVersion, setProviderConfigVersion] = useState33(0);
|
|
31433
|
+
const [, setThemeVersion] = useState33(0);
|
|
31434
|
+
const [mcpConnected, setMcpConnected] = useState33(0);
|
|
31435
|
+
const [mcpTotal, setMcpTotal] = useState33(0);
|
|
31436
|
+
const [subagentMap, setSubagentMap] = useState33(/* @__PURE__ */ new Map());
|
|
31437
|
+
const [, setDrainTick] = useState33(0);
|
|
31438
|
+
const [pendingCommandConfirmation, setPendingCommandConfirmation] = useState33(null);
|
|
31424
31439
|
const appContextValue = useMemo19(
|
|
31425
31440
|
() => ({ version: VERSION, startupWarnings }),
|
|
31426
31441
|
[startupWarnings]
|
|
@@ -31512,6 +31527,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31512
31527
|
memoryCommand,
|
|
31513
31528
|
yoloCommand,
|
|
31514
31529
|
safeCommand,
|
|
31530
|
+
newCommand,
|
|
31515
31531
|
providerCommand,
|
|
31516
31532
|
modelCommand,
|
|
31517
31533
|
modeCommand,
|
|
@@ -31530,7 +31546,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31530
31546
|
() => recentSlashCommandsState,
|
|
31531
31547
|
[recentSlashCommandsState]
|
|
31532
31548
|
);
|
|
31533
|
-
const [promptSuggestion, setPromptSuggestion] =
|
|
31549
|
+
const [promptSuggestion, setPromptSuggestion] = useState33(null);
|
|
31534
31550
|
const dismissPromptSuggestion = useCallback28(() => setPromptSuggestion(null), []);
|
|
31535
31551
|
const registerSlashCommandUsage = useCallback28((name) => {
|
|
31536
31552
|
setRecentSlashCommandsState((prev) => {
|
|
@@ -31636,19 +31652,34 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31636
31652
|
if (!runtime || !session) return null;
|
|
31637
31653
|
return runtime.agent.undo(session.id);
|
|
31638
31654
|
}, []);
|
|
31655
|
+
const handleNewSession = useCallback28(async () => {
|
|
31656
|
+
const runtime = runtimeRef.current;
|
|
31657
|
+
if (!runtime) return;
|
|
31658
|
+
const currentSession = sessionRef.current;
|
|
31659
|
+
const target = {
|
|
31660
|
+
provider: currentSession?.provider ?? "anthropic",
|
|
31661
|
+
model: currentSession?.model
|
|
31662
|
+
};
|
|
31663
|
+
const fresh = runtime.sessions.create(target);
|
|
31664
|
+
sessionRef.current = fresh;
|
|
31665
|
+
setSessionDisplayName("");
|
|
31666
|
+
historyManager.clearItems();
|
|
31667
|
+
setHistoryRemountKey((k) => k + 1);
|
|
31668
|
+
historyManager.addItem({ type: "info", text: "Nova sess\xE3o iniciada." }, Date.now());
|
|
31669
|
+
}, [historyManager]);
|
|
31639
31670
|
const handleCompact = useCallback28(async () => {
|
|
31640
31671
|
const runtime = runtimeRef.current;
|
|
31641
31672
|
const session = sessionRef.current;
|
|
31642
31673
|
if (!runtime || !session) return;
|
|
31643
31674
|
if (session.messages.length === 0) {
|
|
31644
|
-
addHistoryItem({ type: "info", text: "
|
|
31675
|
+
addHistoryItem({ type: "info", text: "Nada para compactar \u2014 a conversa est\xE1 vazia." }, Date.now());
|
|
31645
31676
|
return;
|
|
31646
31677
|
}
|
|
31647
31678
|
setIsRunning(true);
|
|
31648
31679
|
try {
|
|
31649
31680
|
const summary = await generateCompactSummary(runtime, session, void 0);
|
|
31650
31681
|
if (!summary) {
|
|
31651
|
-
addHistoryItem({ type: "warning", text: "
|
|
31682
|
+
addHistoryItem({ type: "warning", text: "Falha ao compactar: n\xE3o foi poss\xEDvel gerar resumo." }, Date.now());
|
|
31652
31683
|
return;
|
|
31653
31684
|
}
|
|
31654
31685
|
const summaryMsg = buildSummaryMessage(summary);
|
|
@@ -31657,10 +31688,10 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31657
31688
|
});
|
|
31658
31689
|
historyManager.clearItems();
|
|
31659
31690
|
setHistoryRemountKey((k) => k + 1);
|
|
31660
|
-
addHistoryItem({ type: "info", text: "
|
|
31691
|
+
addHistoryItem({ type: "info", text: "Conversa compactada." }, Date.now());
|
|
31661
31692
|
addHistoryItem({ type: "gemini", text: summary }, Date.now());
|
|
31662
31693
|
} catch {
|
|
31663
|
-
addHistoryItem({ type: "error", text: "
|
|
31694
|
+
addHistoryItem({ type: "error", text: "Falha ao compactar." }, Date.now());
|
|
31664
31695
|
} finally {
|
|
31665
31696
|
setIsRunning(false);
|
|
31666
31697
|
}
|
|
@@ -31706,18 +31737,19 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31706
31737
|
lastOutputTokens: lastOutputTokenCount,
|
|
31707
31738
|
sessionStartedAt: sessionStartedAtRef.current
|
|
31708
31739
|
}),
|
|
31709
|
-
setPermissions: (modes) => setPermissionModes((prev) => ({ ...prev, ...modes }))
|
|
31740
|
+
setPermissions: (modes) => setPermissionModes((prev) => ({ ...prev, ...modes })),
|
|
31741
|
+
newSession: handleNewSession
|
|
31710
31742
|
},
|
|
31711
31743
|
session: {
|
|
31712
31744
|
sessionShellAllowlist: sessionShellAllowlistRef.current
|
|
31713
31745
|
}
|
|
31714
31746
|
}),
|
|
31715
|
-
[agentMode, configAdapter, cwd, handleCompact, handleUndo, historyManager, lastOutputTokenCount, lastPromptTokenCount, mcpConnected, mcpTotal, pendingItem, sessionCommandServices, setPermissionModes]
|
|
31747
|
+
[agentMode, configAdapter, cwd, handleCompact, handleNewSession, handleUndo, historyManager, lastOutputTokenCount, lastPromptTokenCount, mcpConnected, mcpTotal, pendingItem, sessionCommandServices, setPermissionModes]
|
|
31716
31748
|
);
|
|
31717
|
-
|
|
31749
|
+
useEffect31(() => {
|
|
31718
31750
|
messageQueueRef.current = messageQueue;
|
|
31719
31751
|
}, [messageQueue]);
|
|
31720
|
-
|
|
31752
|
+
useEffect31(() => {
|
|
31721
31753
|
if (approvalQueue.length > 0) {
|
|
31722
31754
|
approvalPromptVisibleAtRef.current ??= Date.now();
|
|
31723
31755
|
setStreamingState(
|
|
@@ -31739,7 +31771,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31739
31771
|
/* Idle */
|
|
31740
31772
|
);
|
|
31741
31773
|
}, [approvalQueue.length, isRunning]);
|
|
31742
|
-
|
|
31774
|
+
useEffect31(() => {
|
|
31743
31775
|
if (!isRunning) {
|
|
31744
31776
|
runStartedAtRef.current = null;
|
|
31745
31777
|
setIsReceivingContent(false);
|
|
@@ -31756,7 +31788,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31756
31788
|
() => getStickyTodoMaxVisibleItems(terminalHeight),
|
|
31757
31789
|
[terminalHeight]
|
|
31758
31790
|
);
|
|
31759
|
-
|
|
31791
|
+
useEffect31(() => {
|
|
31760
31792
|
const id = setInterval(() => {
|
|
31761
31793
|
const text = pendingTextBufferRef.current;
|
|
31762
31794
|
if (text) {
|
|
@@ -31789,7 +31821,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31789
31821
|
}, 50);
|
|
31790
31822
|
return () => clearInterval(id);
|
|
31791
31823
|
}, []);
|
|
31792
|
-
|
|
31824
|
+
useEffect31(() => {
|
|
31793
31825
|
let mounted = true;
|
|
31794
31826
|
const initialize = async () => {
|
|
31795
31827
|
try {
|
|
@@ -31827,7 +31859,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31827
31859
|
runtime.sessions.save(session);
|
|
31828
31860
|
}
|
|
31829
31861
|
addHistoryItem(
|
|
31830
|
-
{ type: "warning", text: `
|
|
31862
|
+
{ type: "warning", text: `Sess\xE3o ${resumeSessionId} n\xE3o encontrada; iniciando nova sess\xE3o.` },
|
|
31831
31863
|
Date.now()
|
|
31832
31864
|
);
|
|
31833
31865
|
}
|
|
@@ -31961,7 +31993,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31961
31993
|
addHistoryItem(
|
|
31962
31994
|
{
|
|
31963
31995
|
type: "info",
|
|
31964
|
-
text: `
|
|
31996
|
+
text: `Sess\xE3o ${session.id.slice(-8)} retomada (${session.messages.length} mensagens).`
|
|
31965
31997
|
},
|
|
31966
31998
|
Date.now()
|
|
31967
31999
|
);
|
|
@@ -31988,7 +32020,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31988
32020
|
addHistoryItem(
|
|
31989
32021
|
{
|
|
31990
32022
|
type: "info",
|
|
31991
|
-
text: `
|
|
32023
|
+
text: `Atualiza\xE7\xE3o dispon\xEDvel: ${available.join(", ")}. Execute /update para instru\xE7\xF5es.`
|
|
31992
32024
|
},
|
|
31993
32025
|
Date.now()
|
|
31994
32026
|
);
|
|
@@ -32145,7 +32177,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32145
32177
|
const session = sessionRef.current;
|
|
32146
32178
|
if (!runtime || !session) {
|
|
32147
32179
|
historyManager.addItem(
|
|
32148
|
-
{ type: "error", text: "Runtime
|
|
32180
|
+
{ type: "error", text: "Runtime n\xE3o est\xE1 pronto para executar comandos de ferramenta." },
|
|
32149
32181
|
Date.now()
|
|
32150
32182
|
);
|
|
32151
32183
|
return;
|
|
@@ -32156,7 +32188,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32156
32188
|
historyManager.addItem(
|
|
32157
32189
|
{
|
|
32158
32190
|
type: "error",
|
|
32159
|
-
text: `
|
|
32191
|
+
text: `Ferramenta desconhecida: ${toolName}${available ? ` (dispon\xEDveis: ${available})` : ""}`
|
|
32160
32192
|
},
|
|
32161
32193
|
Date.now()
|
|
32162
32194
|
);
|
|
@@ -32303,7 +32335,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32303
32335
|
historyManager.addItem(
|
|
32304
32336
|
{
|
|
32305
32337
|
type: "info",
|
|
32306
|
-
text: `
|
|
32338
|
+
text: `Comandos dispon\xEDveis: ${slashCommands.map((command2) => `/${command2.name}`).join(", ")}`
|
|
32307
32339
|
},
|
|
32308
32340
|
Date.now()
|
|
32309
32341
|
);
|
|
@@ -32323,14 +32355,14 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32323
32355
|
const { command, name, args } = invocation;
|
|
32324
32356
|
if (!command.action) {
|
|
32325
32357
|
historyManager.addItem(
|
|
32326
|
-
{ type: "warning", text: `
|
|
32358
|
+
{ type: "warning", text: `Comando sem a\xE7\xE3o: /${name}` },
|
|
32327
32359
|
Date.now()
|
|
32328
32360
|
);
|
|
32329
32361
|
return true;
|
|
32330
32362
|
}
|
|
32331
32363
|
if (command.supportedModes && !command.supportedModes.includes("interactive")) {
|
|
32332
32364
|
historyManager.addItem(
|
|
32333
|
-
{ type: "error", text: `
|
|
32365
|
+
{ type: "error", text: `Comando n\xE3o suportado no modo interativo: /${name}` },
|
|
32334
32366
|
Date.now()
|
|
32335
32367
|
);
|
|
32336
32368
|
return true;
|
|
@@ -32408,7 +32440,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32408
32440
|
const lastPrompt = lastSubmittedPromptRef.current;
|
|
32409
32441
|
if (!lastPrompt) {
|
|
32410
32442
|
historyManager.addItem(
|
|
32411
|
-
{ type: "warning", text: "
|
|
32443
|
+
{ type: "warning", text: "Nenhum prompt anterior para repetir." },
|
|
32412
32444
|
Date.now()
|
|
32413
32445
|
);
|
|
32414
32446
|
return;
|
|
@@ -32425,7 +32457,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32425
32457
|
if (!pending) return;
|
|
32426
32458
|
setPendingCommandConfirmation(null);
|
|
32427
32459
|
if (!confirmed) {
|
|
32428
|
-
historyManager.addItem({ type: "info", text: "
|
|
32460
|
+
historyManager.addItem({ type: "info", text: "Opera\xE7\xE3o cancelada." }, Date.now());
|
|
32429
32461
|
return;
|
|
32430
32462
|
}
|
|
32431
32463
|
if (isInitializing || isRunning || approvalQueue.length > 0 || initError) {
|
|
@@ -32494,7 +32526,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32494
32526
|
permissions: { ...cfg.permissions, ...modes }
|
|
32495
32527
|
})).then(() => {
|
|
32496
32528
|
historyManager.addItem(
|
|
32497
|
-
{ type: "info", text: "
|
|
32529
|
+
{ type: "info", text: "Pol\xEDtica de permiss\xF5es atualizada." },
|
|
32498
32530
|
Date.now()
|
|
32499
32531
|
);
|
|
32500
32532
|
}).catch((error) => {
|
|
@@ -32555,7 +32587,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32555
32587
|
}
|
|
32556
32588
|
setProviderConfigVersion((version) => version + 1);
|
|
32557
32589
|
historyManager.addItem(
|
|
32558
|
-
{ type: "info", text: `API
|
|
32590
|
+
{ type: "info", text: `Chave API atualizada para ${provider2}.` },
|
|
32559
32591
|
Date.now()
|
|
32560
32592
|
);
|
|
32561
32593
|
},
|
|
@@ -32590,7 +32622,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32590
32622
|
setTargetSource("config");
|
|
32591
32623
|
setProviderConfigVersion((version) => version + 1);
|
|
32592
32624
|
historyManager.addItem(
|
|
32593
|
-
{ type: "info", text: `
|
|
32625
|
+
{ type: "info", text: `Provider padr\xE3o salvo: ${provider2}.` },
|
|
32594
32626
|
Date.now()
|
|
32595
32627
|
);
|
|
32596
32628
|
if (!configuredModel) {
|
|
@@ -32676,7 +32708,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32676
32708
|
const existing = allSessions.find((s) => s.id === sessionId);
|
|
32677
32709
|
if (!existing) {
|
|
32678
32710
|
historyManager.addItem(
|
|
32679
|
-
{ type: "warning", text: `
|
|
32711
|
+
{ type: "warning", text: `Sess\xE3o ${sessionId.slice(-8)} n\xE3o encontrada.` },
|
|
32680
32712
|
Date.now()
|
|
32681
32713
|
);
|
|
32682
32714
|
setActiveDialog(null);
|
|
@@ -32691,7 +32723,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32691
32723
|
setHistoryRemountKey((k) => k + 1);
|
|
32692
32724
|
restoreHistoryFromSession(existing, (item) => historyManager.addItem(item, Date.now()));
|
|
32693
32725
|
historyManager.addItem(
|
|
32694
|
-
{ type: "info", text: `
|
|
32726
|
+
{ type: "info", text: `Sess\xE3o ${sessionId.slice(-8)} retomada (${existing.messages.length} mensagens).` },
|
|
32695
32727
|
Date.now()
|
|
32696
32728
|
);
|
|
32697
32729
|
setActiveDialog(null);
|
|
@@ -32700,7 +32732,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32700
32732
|
);
|
|
32701
32733
|
const closeDialog = useCallback28(() => setActiveDialog(null), []);
|
|
32702
32734
|
const previewTheme = useCallback28(() => setThemeVersion((version) => version + 1), []);
|
|
32703
|
-
|
|
32735
|
+
useEffect31(() => {
|
|
32704
32736
|
if (drainingQueueRef.current || isRunning || isInitializing || Boolean(initError) || approvalQueue.length > 0 || messageQueue.length === 0) {
|
|
32705
32737
|
return;
|
|
32706
32738
|
}
|
|
@@ -33154,12 +33186,34 @@ function buildDialogModel(dialog, options) {
|
|
|
33154
33186
|
if (!dialog) return null;
|
|
33155
33187
|
if (dialog === "help") {
|
|
33156
33188
|
const maxNameLen = Math.max(...options.commands.map((c) => c.name.length + 1));
|
|
33189
|
+
const commandLines = options.commands.map((c) => {
|
|
33190
|
+
const label = `/${c.name}`.padEnd(maxNameLen + 1);
|
|
33191
|
+
return `${label} ${c.description}`;
|
|
33192
|
+
});
|
|
33193
|
+
const shortcuts = [
|
|
33194
|
+
["Ctrl+C", "cancela execu\xE7\xE3o do agente (ou sai do campo de input)"],
|
|
33195
|
+
["Ctrl+D", "encerra a sess\xE3o"],
|
|
33196
|
+
["Ctrl+L", "limpa o hist\xF3rico vis\xEDvel na tela"],
|
|
33197
|
+
["Ctrl+S", "expande mensagem longa (quando truncada)"],
|
|
33198
|
+
["\u2191 / \u2193", "navega hist\xF3rico de prompts enviados"],
|
|
33199
|
+
["Tab / \u2192", "aceita sugest\xE3o de follow-up"],
|
|
33200
|
+
["Esc", "cancela aprova\xE7\xE3o pendente / fecha di\xE1logo"],
|
|
33201
|
+
["y / \u21B5", "aprova ferramenta (uma vez)"],
|
|
33202
|
+
["s", "aprova ferramenta para toda a sess\xE3o"],
|
|
33203
|
+
["a", "aprova ferramenta permanentemente"],
|
|
33204
|
+
["n", "nega aprova\xE7\xE3o de ferramenta"]
|
|
33205
|
+
];
|
|
33206
|
+
const shortcutKeyLen = Math.max(...shortcuts.map(([k]) => k.length));
|
|
33207
|
+
const shortcutLines = shortcuts.map(([k, v]) => ` ${k.padEnd(shortcutKeyLen)} ${v}`);
|
|
33157
33208
|
return {
|
|
33158
|
-
title: "
|
|
33159
|
-
lines:
|
|
33160
|
-
|
|
33161
|
-
|
|
33162
|
-
|
|
33209
|
+
title: "Ajuda \u2014 DeepCode",
|
|
33210
|
+
lines: [
|
|
33211
|
+
"\u2500\u2500 Slash commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
33212
|
+
...commandLines,
|
|
33213
|
+
"",
|
|
33214
|
+
"\u2500\u2500 Atalhos de teclado \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
33215
|
+
...shortcutLines
|
|
33216
|
+
]
|
|
33163
33217
|
};
|
|
33164
33218
|
}
|
|
33165
33219
|
if (dialog === "settings") {
|
|
@@ -33188,26 +33242,46 @@ function formatAuthSummary(config) {
|
|
|
33188
33242
|
const enterprise = config.enterpriseUrl?.trim() ? `enterprise=${config.enterpriseUrl}` : "enterprise=github.com";
|
|
33189
33243
|
return `github token=${tokenState}, ${oauthState}, ${enterprise}`;
|
|
33190
33244
|
}
|
|
33245
|
+
var APPROVAL_PREVIEW_MAX_LINES = 6;
|
|
33191
33246
|
var ApprovalPrompt = ({ request }) => {
|
|
33192
33247
|
if (!request) return null;
|
|
33193
33248
|
const operationLabel = formatApprovalOperationLabel(request);
|
|
33194
|
-
|
|
33195
|
-
|
|
33196
|
-
|
|
33197
|
-
|
|
33198
|
-
|
|
33199
|
-
|
|
33200
|
-
|
|
33201
|
-
|
|
33202
|
-
|
|
33203
|
-
|
|
33204
|
-
|
|
33205
|
-
|
|
33206
|
-
|
|
33207
|
-
|
|
33208
|
-
|
|
33209
|
-
|
|
33210
|
-
|
|
33249
|
+
let previewLines = [];
|
|
33250
|
+
if (request.diff?.after) {
|
|
33251
|
+
previewLines = request.diff.after.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
|
|
33252
|
+
} else if (request.preview?.content) {
|
|
33253
|
+
previewLines = request.preview.content.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
|
|
33254
|
+
}
|
|
33255
|
+
const previewTruncated = (request.diff?.after ?? request.preview?.content ?? "").split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
|
|
33256
|
+
return /* @__PURE__ */ jsxs56(
|
|
33257
|
+
Box52,
|
|
33258
|
+
{
|
|
33259
|
+
flexDirection: "column",
|
|
33260
|
+
borderStyle: "round",
|
|
33261
|
+
borderColor: theme.status.warning,
|
|
33262
|
+
paddingX: 1,
|
|
33263
|
+
marginLeft: 2,
|
|
33264
|
+
marginRight: 2,
|
|
33265
|
+
marginTop: 1,
|
|
33266
|
+
children: [
|
|
33267
|
+
/* @__PURE__ */ jsxs56(Text60, { bold: true, color: theme.status.warning, children: [
|
|
33268
|
+
"\u26A0 ",
|
|
33269
|
+
operationLabel
|
|
33270
|
+
] }),
|
|
33271
|
+
request.path && /* @__PURE__ */ jsx62(Text60, { color: theme.text.secondary, children: request.path }),
|
|
33272
|
+
request.preview?.command && /* @__PURE__ */ jsxs56(Text60, { color: theme.text.primary, children: [
|
|
33273
|
+
"$ ",
|
|
33274
|
+
request.preview.command,
|
|
33275
|
+
request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
|
|
33276
|
+
] }),
|
|
33277
|
+
previewLines.length > 0 && /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", marginTop: 1, children: [
|
|
33278
|
+
previewLines.map((line, i) => /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, wrap: "truncate", children: line }, i)),
|
|
33279
|
+
previewTruncated && /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
|
|
33280
|
+
] }),
|
|
33281
|
+
/* @__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" }) })
|
|
33282
|
+
]
|
|
33283
|
+
}
|
|
33284
|
+
);
|
|
33211
33285
|
};
|
|
33212
33286
|
function formatApprovalOperationLabel(request) {
|
|
33213
33287
|
const labels = {
|