deepcode-ai 1.2.18 → 1.2.20
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 +186 -180
- 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.20".length > 0 ? "1.2.20" : "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(
|
|
@@ -30668,13 +30656,13 @@ var ModelDialog = ({
|
|
|
30668
30656
|
onSelectModel,
|
|
30669
30657
|
onClose
|
|
30670
30658
|
}) => {
|
|
30671
|
-
const [loadState, setLoadState] =
|
|
30672
|
-
const [models, setModels] =
|
|
30673
|
-
const [errorMsg, setErrorMsg] =
|
|
30674
|
-
const [search, setSearch] =
|
|
30675
|
-
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);
|
|
30676
30664
|
const abortRef = useRef20(null);
|
|
30677
|
-
|
|
30665
|
+
useEffect29(() => {
|
|
30678
30666
|
const ctrl = new AbortController();
|
|
30679
30667
|
abortRef.current = ctrl;
|
|
30680
30668
|
onFetchModels(currentProvider, ctrl.signal).then((fetched) => {
|
|
@@ -30694,7 +30682,7 @@ var ModelDialog = ({
|
|
|
30694
30682
|
);
|
|
30695
30683
|
const selectableCount = rows.filter((r) => r.kind === "item").length;
|
|
30696
30684
|
const clampedIndex = Math.min(activeSelIndex, Math.max(0, selectableCount - 1));
|
|
30697
|
-
|
|
30685
|
+
useEffect29(() => {
|
|
30698
30686
|
setActiveSelIndex(0);
|
|
30699
30687
|
}, [search]);
|
|
30700
30688
|
const activeRowPos = useMemo16(
|
|
@@ -30946,16 +30934,17 @@ function relativeTime(iso) {
|
|
|
30946
30934
|
return `h\xE1 ${diffMonths} m\xEAs${diffMonths !== 1 ? "es" : ""}`;
|
|
30947
30935
|
}
|
|
30948
30936
|
function sessionLabel2(session) {
|
|
30949
|
-
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;
|
|
30950
30938
|
const firstUser = session.messages.find((m) => m.role === "user");
|
|
30951
|
-
|
|
30939
|
+
const preview = typeof firstUser?.content === "string" ? firstUser.content.trim().slice(0, 60) : "";
|
|
30940
|
+
return name ?? (preview || "(sem mensagens)");
|
|
30952
30941
|
}
|
|
30953
30942
|
var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
30954
|
-
const [loadState, setLoadState] =
|
|
30955
|
-
const [allSessions, setAllSessions] =
|
|
30956
|
-
const [search, setSearch] =
|
|
30957
|
-
const [activeIndex, setActiveIndex] =
|
|
30958
|
-
|
|
30943
|
+
const [loadState, setLoadState] = useState32("loading");
|
|
30944
|
+
const [allSessions, setAllSessions] = useState32([]);
|
|
30945
|
+
const [search, setSearch] = useState32("");
|
|
30946
|
+
const [activeIndex, setActiveIndex] = useState32(0);
|
|
30947
|
+
useEffect30(() => {
|
|
30959
30948
|
const manager = new SessionManager(cwd);
|
|
30960
30949
|
manager.loadAll().then((loaded) => {
|
|
30961
30950
|
const sorted = [...loaded].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
@@ -30963,7 +30952,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30963
30952
|
setLoadState("ready");
|
|
30964
30953
|
}).catch(() => setLoadState("error"));
|
|
30965
30954
|
}, [cwd]);
|
|
30966
|
-
|
|
30955
|
+
useEffect30(() => {
|
|
30967
30956
|
setActiveIndex(0);
|
|
30968
30957
|
}, [search]);
|
|
30969
30958
|
const sessions = useMemo18(() => {
|
|
@@ -31400,53 +31389,53 @@ var APPROVAL_ENTER_ARM_DELAY_MS = 350;
|
|
|
31400
31389
|
var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarnings = [] }) => {
|
|
31401
31390
|
const historyManager = useHistory();
|
|
31402
31391
|
const addHistoryItem = historyManager.addItem;
|
|
31403
|
-
const [initError, setInitError] =
|
|
31404
|
-
const [isInitializing, setIsInitializing] =
|
|
31405
|
-
const [isRunning, setIsRunning] =
|
|
31406
|
-
const [pendingAssistantText, setPendingAssistantText] =
|
|
31407
|
-
const [approvalQueue, setApprovalQueue] =
|
|
31408
|
-
const [providerLabel, setProviderLabel] =
|
|
31409
|
-
const [targetSource, setTargetSource] =
|
|
31410
|
-
const [currentModel, setCurrentModel] =
|
|
31411
|
-
const [agentMode, setAgentMode] =
|
|
31412
|
-
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(
|
|
31413
31402
|
"idle"
|
|
31414
31403
|
/* Idle */
|
|
31415
31404
|
);
|
|
31416
|
-
const [compactMode, setCompactMode] =
|
|
31417
|
-
const [constrainHeight, setConstrainHeight] =
|
|
31418
|
-
const [shellModeActive, setShellModeActive] =
|
|
31419
|
-
const [showEscapePrompt, setShowEscapePrompt] =
|
|
31420
|
-
const [messageQueue, setMessageQueue] =
|
|
31421
|
-
const [historyRemountKey, setHistoryRemountKey] =
|
|
31422
|
-
const [pendingItem, setPendingItem] =
|
|
31423
|
-
const [lastPromptTokenCount, setLastPromptTokenCount] =
|
|
31424
|
-
const [lastOutputTokenCount, setLastOutputTokenCount] =
|
|
31425
|
-
const [totalPromptTokenCount, setTotalPromptTokenCount] =
|
|
31426
|
-
const [totalOutputTokenCount, setTotalOutputTokenCount] =
|
|
31427
|
-
const [isReceivingContent, setIsReceivingContent] =
|
|
31428
|
-
const [iterationInfo, setIterationInfo] =
|
|
31429
|
-
const [liveToolCalls, setLiveToolCalls] =
|
|
31430
|
-
const [recentSlashCommandsState, setRecentSlashCommandsState] =
|
|
31431
|
-
const [activeDialog, setActiveDialog] =
|
|
31432
|
-
const [themeName, setThemeName] =
|
|
31433
|
-
const [permissionSummary, setPermissionSummary] =
|
|
31434
|
-
const [authSummary, setAuthSummary] =
|
|
31435
|
-
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({
|
|
31436
31425
|
read: "allow",
|
|
31437
31426
|
write: "ask",
|
|
31438
31427
|
gitLocal: "allow",
|
|
31439
31428
|
shell: "ask",
|
|
31440
31429
|
dangerous: "ask"
|
|
31441
31430
|
});
|
|
31442
|
-
const [sessionDisplayName, setSessionDisplayName] =
|
|
31443
|
-
const [providerConfigVersion, setProviderConfigVersion] =
|
|
31444
|
-
const [, setThemeVersion] =
|
|
31445
|
-
const [mcpConnected, setMcpConnected] =
|
|
31446
|
-
const [mcpTotal, setMcpTotal] =
|
|
31447
|
-
const [subagentMap, setSubagentMap] =
|
|
31448
|
-
const [, setDrainTick] =
|
|
31449
|
-
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);
|
|
31450
31439
|
const appContextValue = useMemo19(
|
|
31451
31440
|
() => ({ version: VERSION, startupWarnings }),
|
|
31452
31441
|
[startupWarnings]
|
|
@@ -31538,6 +31527,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31538
31527
|
memoryCommand,
|
|
31539
31528
|
yoloCommand,
|
|
31540
31529
|
safeCommand,
|
|
31530
|
+
newCommand,
|
|
31541
31531
|
providerCommand,
|
|
31542
31532
|
modelCommand,
|
|
31543
31533
|
modeCommand,
|
|
@@ -31556,7 +31546,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31556
31546
|
() => recentSlashCommandsState,
|
|
31557
31547
|
[recentSlashCommandsState]
|
|
31558
31548
|
);
|
|
31559
|
-
const [promptSuggestion, setPromptSuggestion] =
|
|
31549
|
+
const [promptSuggestion, setPromptSuggestion] = useState33(null);
|
|
31560
31550
|
const dismissPromptSuggestion = useCallback28(() => setPromptSuggestion(null), []);
|
|
31561
31551
|
const registerSlashCommandUsage = useCallback28((name) => {
|
|
31562
31552
|
setRecentSlashCommandsState((prev) => {
|
|
@@ -31662,19 +31652,34 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31662
31652
|
if (!runtime || !session) return null;
|
|
31663
31653
|
return runtime.agent.undo(session.id);
|
|
31664
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]);
|
|
31665
31670
|
const handleCompact = useCallback28(async () => {
|
|
31666
31671
|
const runtime = runtimeRef.current;
|
|
31667
31672
|
const session = sessionRef.current;
|
|
31668
31673
|
if (!runtime || !session) return;
|
|
31669
31674
|
if (session.messages.length === 0) {
|
|
31670
|
-
addHistoryItem({ type: "info", text: "
|
|
31675
|
+
addHistoryItem({ type: "info", text: "Nada para compactar \u2014 a conversa est\xE1 vazia." }, Date.now());
|
|
31671
31676
|
return;
|
|
31672
31677
|
}
|
|
31673
31678
|
setIsRunning(true);
|
|
31674
31679
|
try {
|
|
31675
31680
|
const summary = await generateCompactSummary(runtime, session, void 0);
|
|
31676
31681
|
if (!summary) {
|
|
31677
|
-
addHistoryItem({ type: "warning", text: "
|
|
31682
|
+
addHistoryItem({ type: "warning", text: "Falha ao compactar: n\xE3o foi poss\xEDvel gerar resumo." }, Date.now());
|
|
31678
31683
|
return;
|
|
31679
31684
|
}
|
|
31680
31685
|
const summaryMsg = buildSummaryMessage(summary);
|
|
@@ -31683,10 +31688,10 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31683
31688
|
});
|
|
31684
31689
|
historyManager.clearItems();
|
|
31685
31690
|
setHistoryRemountKey((k) => k + 1);
|
|
31686
|
-
addHistoryItem({ type: "info", text: "
|
|
31691
|
+
addHistoryItem({ type: "info", text: "Conversa compactada." }, Date.now());
|
|
31687
31692
|
addHistoryItem({ type: "gemini", text: summary }, Date.now());
|
|
31688
31693
|
} catch {
|
|
31689
|
-
addHistoryItem({ type: "error", text: "
|
|
31694
|
+
addHistoryItem({ type: "error", text: "Falha ao compactar." }, Date.now());
|
|
31690
31695
|
} finally {
|
|
31691
31696
|
setIsRunning(false);
|
|
31692
31697
|
}
|
|
@@ -31732,18 +31737,19 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31732
31737
|
lastOutputTokens: lastOutputTokenCount,
|
|
31733
31738
|
sessionStartedAt: sessionStartedAtRef.current
|
|
31734
31739
|
}),
|
|
31735
|
-
setPermissions: (modes) => setPermissionModes((prev) => ({ ...prev, ...modes }))
|
|
31740
|
+
setPermissions: (modes) => setPermissionModes((prev) => ({ ...prev, ...modes })),
|
|
31741
|
+
newSession: handleNewSession
|
|
31736
31742
|
},
|
|
31737
31743
|
session: {
|
|
31738
31744
|
sessionShellAllowlist: sessionShellAllowlistRef.current
|
|
31739
31745
|
}
|
|
31740
31746
|
}),
|
|
31741
|
-
[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]
|
|
31742
31748
|
);
|
|
31743
|
-
|
|
31749
|
+
useEffect31(() => {
|
|
31744
31750
|
messageQueueRef.current = messageQueue;
|
|
31745
31751
|
}, [messageQueue]);
|
|
31746
|
-
|
|
31752
|
+
useEffect31(() => {
|
|
31747
31753
|
if (approvalQueue.length > 0) {
|
|
31748
31754
|
approvalPromptVisibleAtRef.current ??= Date.now();
|
|
31749
31755
|
setStreamingState(
|
|
@@ -31765,7 +31771,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31765
31771
|
/* Idle */
|
|
31766
31772
|
);
|
|
31767
31773
|
}, [approvalQueue.length, isRunning]);
|
|
31768
|
-
|
|
31774
|
+
useEffect31(() => {
|
|
31769
31775
|
if (!isRunning) {
|
|
31770
31776
|
runStartedAtRef.current = null;
|
|
31771
31777
|
setIsReceivingContent(false);
|
|
@@ -31782,7 +31788,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31782
31788
|
() => getStickyTodoMaxVisibleItems(terminalHeight),
|
|
31783
31789
|
[terminalHeight]
|
|
31784
31790
|
);
|
|
31785
|
-
|
|
31791
|
+
useEffect31(() => {
|
|
31786
31792
|
const id = setInterval(() => {
|
|
31787
31793
|
const text = pendingTextBufferRef.current;
|
|
31788
31794
|
if (text) {
|
|
@@ -31815,7 +31821,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31815
31821
|
}, 50);
|
|
31816
31822
|
return () => clearInterval(id);
|
|
31817
31823
|
}, []);
|
|
31818
|
-
|
|
31824
|
+
useEffect31(() => {
|
|
31819
31825
|
let mounted = true;
|
|
31820
31826
|
const initialize = async () => {
|
|
31821
31827
|
try {
|
|
@@ -31853,7 +31859,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31853
31859
|
runtime.sessions.save(session);
|
|
31854
31860
|
}
|
|
31855
31861
|
addHistoryItem(
|
|
31856
|
-
{ type: "warning", text: `
|
|
31862
|
+
{ type: "warning", text: `Sess\xE3o ${resumeSessionId} n\xE3o encontrada; iniciando nova sess\xE3o.` },
|
|
31857
31863
|
Date.now()
|
|
31858
31864
|
);
|
|
31859
31865
|
}
|
|
@@ -31987,7 +31993,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
31987
31993
|
addHistoryItem(
|
|
31988
31994
|
{
|
|
31989
31995
|
type: "info",
|
|
31990
|
-
text: `
|
|
31996
|
+
text: `Sess\xE3o ${session.id.slice(-8)} retomada (${session.messages.length} mensagens).`
|
|
31991
31997
|
},
|
|
31992
31998
|
Date.now()
|
|
31993
31999
|
);
|
|
@@ -32014,7 +32020,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32014
32020
|
addHistoryItem(
|
|
32015
32021
|
{
|
|
32016
32022
|
type: "info",
|
|
32017
|
-
text: `
|
|
32023
|
+
text: `Atualiza\xE7\xE3o dispon\xEDvel: ${available.join(", ")}. Execute /update para instru\xE7\xF5es.`
|
|
32018
32024
|
},
|
|
32019
32025
|
Date.now()
|
|
32020
32026
|
);
|
|
@@ -32171,7 +32177,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32171
32177
|
const session = sessionRef.current;
|
|
32172
32178
|
if (!runtime || !session) {
|
|
32173
32179
|
historyManager.addItem(
|
|
32174
|
-
{ type: "error", text: "Runtime
|
|
32180
|
+
{ type: "error", text: "Runtime n\xE3o est\xE1 pronto para executar comandos de ferramenta." },
|
|
32175
32181
|
Date.now()
|
|
32176
32182
|
);
|
|
32177
32183
|
return;
|
|
@@ -32182,7 +32188,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32182
32188
|
historyManager.addItem(
|
|
32183
32189
|
{
|
|
32184
32190
|
type: "error",
|
|
32185
|
-
text: `
|
|
32191
|
+
text: `Ferramenta desconhecida: ${toolName}${available ? ` (dispon\xEDveis: ${available})` : ""}`
|
|
32186
32192
|
},
|
|
32187
32193
|
Date.now()
|
|
32188
32194
|
);
|
|
@@ -32329,7 +32335,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32329
32335
|
historyManager.addItem(
|
|
32330
32336
|
{
|
|
32331
32337
|
type: "info",
|
|
32332
|
-
text: `
|
|
32338
|
+
text: `Comandos dispon\xEDveis: ${slashCommands.map((command2) => `/${command2.name}`).join(", ")}`
|
|
32333
32339
|
},
|
|
32334
32340
|
Date.now()
|
|
32335
32341
|
);
|
|
@@ -32349,14 +32355,14 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32349
32355
|
const { command, name, args } = invocation;
|
|
32350
32356
|
if (!command.action) {
|
|
32351
32357
|
historyManager.addItem(
|
|
32352
|
-
{ type: "warning", text: `
|
|
32358
|
+
{ type: "warning", text: `Comando sem a\xE7\xE3o: /${name}` },
|
|
32353
32359
|
Date.now()
|
|
32354
32360
|
);
|
|
32355
32361
|
return true;
|
|
32356
32362
|
}
|
|
32357
32363
|
if (command.supportedModes && !command.supportedModes.includes("interactive")) {
|
|
32358
32364
|
historyManager.addItem(
|
|
32359
|
-
{ type: "error", text: `
|
|
32365
|
+
{ type: "error", text: `Comando n\xE3o suportado no modo interativo: /${name}` },
|
|
32360
32366
|
Date.now()
|
|
32361
32367
|
);
|
|
32362
32368
|
return true;
|
|
@@ -32434,7 +32440,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32434
32440
|
const lastPrompt = lastSubmittedPromptRef.current;
|
|
32435
32441
|
if (!lastPrompt) {
|
|
32436
32442
|
historyManager.addItem(
|
|
32437
|
-
{ type: "warning", text: "
|
|
32443
|
+
{ type: "warning", text: "Nenhum prompt anterior para repetir." },
|
|
32438
32444
|
Date.now()
|
|
32439
32445
|
);
|
|
32440
32446
|
return;
|
|
@@ -32451,7 +32457,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32451
32457
|
if (!pending) return;
|
|
32452
32458
|
setPendingCommandConfirmation(null);
|
|
32453
32459
|
if (!confirmed) {
|
|
32454
|
-
historyManager.addItem({ type: "info", text: "
|
|
32460
|
+
historyManager.addItem({ type: "info", text: "Opera\xE7\xE3o cancelada." }, Date.now());
|
|
32455
32461
|
return;
|
|
32456
32462
|
}
|
|
32457
32463
|
if (isInitializing || isRunning || approvalQueue.length > 0 || initError) {
|
|
@@ -32520,7 +32526,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32520
32526
|
permissions: { ...cfg.permissions, ...modes }
|
|
32521
32527
|
})).then(() => {
|
|
32522
32528
|
historyManager.addItem(
|
|
32523
|
-
{ type: "info", text: "
|
|
32529
|
+
{ type: "info", text: "Pol\xEDtica de permiss\xF5es atualizada." },
|
|
32524
32530
|
Date.now()
|
|
32525
32531
|
);
|
|
32526
32532
|
}).catch((error) => {
|
|
@@ -32581,7 +32587,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32581
32587
|
}
|
|
32582
32588
|
setProviderConfigVersion((version) => version + 1);
|
|
32583
32589
|
historyManager.addItem(
|
|
32584
|
-
{ type: "info", text: `API
|
|
32590
|
+
{ type: "info", text: `Chave API atualizada para ${provider2}.` },
|
|
32585
32591
|
Date.now()
|
|
32586
32592
|
);
|
|
32587
32593
|
},
|
|
@@ -32616,7 +32622,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32616
32622
|
setTargetSource("config");
|
|
32617
32623
|
setProviderConfigVersion((version) => version + 1);
|
|
32618
32624
|
historyManager.addItem(
|
|
32619
|
-
{ type: "info", text: `
|
|
32625
|
+
{ type: "info", text: `Provider padr\xE3o salvo: ${provider2}.` },
|
|
32620
32626
|
Date.now()
|
|
32621
32627
|
);
|
|
32622
32628
|
if (!configuredModel) {
|
|
@@ -32702,7 +32708,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32702
32708
|
const existing = allSessions.find((s) => s.id === sessionId);
|
|
32703
32709
|
if (!existing) {
|
|
32704
32710
|
historyManager.addItem(
|
|
32705
|
-
{ type: "warning", text: `
|
|
32711
|
+
{ type: "warning", text: `Sess\xE3o ${sessionId.slice(-8)} n\xE3o encontrada.` },
|
|
32706
32712
|
Date.now()
|
|
32707
32713
|
);
|
|
32708
32714
|
setActiveDialog(null);
|
|
@@ -32717,7 +32723,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32717
32723
|
setHistoryRemountKey((k) => k + 1);
|
|
32718
32724
|
restoreHistoryFromSession(existing, (item) => historyManager.addItem(item, Date.now()));
|
|
32719
32725
|
historyManager.addItem(
|
|
32720
|
-
{ type: "info", text: `
|
|
32726
|
+
{ type: "info", text: `Sess\xE3o ${sessionId.slice(-8)} retomada (${existing.messages.length} mensagens).` },
|
|
32721
32727
|
Date.now()
|
|
32722
32728
|
);
|
|
32723
32729
|
setActiveDialog(null);
|
|
@@ -32726,7 +32732,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
|
|
|
32726
32732
|
);
|
|
32727
32733
|
const closeDialog = useCallback28(() => setActiveDialog(null), []);
|
|
32728
32734
|
const previewTheme = useCallback28(() => setThemeVersion((version) => version + 1), []);
|
|
32729
|
-
|
|
32735
|
+
useEffect31(() => {
|
|
32730
32736
|
if (drainingQueueRef.current || isRunning || isInitializing || Boolean(initError) || approvalQueue.length > 0 || messageQueue.length === 0) {
|
|
32731
32737
|
return;
|
|
32732
32738
|
}
|