deepcode-ai 1.1.17 → 1.1.18
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 -119
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1652,7 +1652,7 @@ var require_cli_spinners = __commonJS({
|
|
|
1652
1652
|
|
|
1653
1653
|
// ../../packages/cli/dist/index.js
|
|
1654
1654
|
import { render as render2 } from "ink";
|
|
1655
|
-
import
|
|
1655
|
+
import React36 from "react";
|
|
1656
1656
|
import { Command as Command2 } from "commander";
|
|
1657
1657
|
|
|
1658
1658
|
// ../../packages/core/dist/index.js
|
|
@@ -7764,10 +7764,10 @@ import { useState as useState2, useEffect as useEffect2, useCallback } from "rea
|
|
|
7764
7764
|
import { Box, Text as Text2, useInput, useApp } from "ink";
|
|
7765
7765
|
import path32 from "path";
|
|
7766
7766
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7767
|
-
import
|
|
7768
|
-
import
|
|
7769
|
-
import { isValidElement, useCallback as
|
|
7770
|
-
import { Box as
|
|
7767
|
+
import fs7 from "fs";
|
|
7768
|
+
import path122 from "path";
|
|
7769
|
+
import { isValidElement, useCallback as useCallback24, useEffect as useEffect25, useMemo as useMemo16, useRef as useRef17, useState as useState27 } from "react";
|
|
7770
|
+
import { Box as Box40, Text as Text48, useInput as useInput4, useStdin as useStdin3 } from "ink";
|
|
7771
7771
|
import os4 from "os";
|
|
7772
7772
|
import path62 from "path";
|
|
7773
7773
|
import fs2 from "fs";
|
|
@@ -9767,10 +9767,15 @@ import { jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
|
9767
9767
|
import { useCallback as useCallback22, useEffect as useEffect24, useMemo as useMemo14, useRef as useRef16, useState as useState26 } from "react";
|
|
9768
9768
|
import { Box as Box37, Text as Text45, useInput as useInput3 } from "ink";
|
|
9769
9769
|
import { jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9770
|
+
import fs6 from "fs";
|
|
9771
|
+
import path112 from "path";
|
|
9772
|
+
import { useCallback as useCallback23, useMemo as useMemo15 } from "react";
|
|
9770
9773
|
import { Box as Box38, Text as Text46 } from "ink";
|
|
9771
9774
|
import { jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9775
|
+
import { Box as Box39, Text as Text47 } from "ink";
|
|
9772
9776
|
import { jsx as jsx48, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9773
|
-
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
9777
|
+
import { jsx as jsx49, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9778
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
9774
9779
|
async function createRuntime(options) {
|
|
9775
9780
|
const worktree = path10.resolve(options.cwd);
|
|
9776
9781
|
const config = await new ConfigLoader().load({ cwd: worktree, configPath: options.configPath });
|
|
@@ -25685,10 +25690,6 @@ function BackgroundTaskViewProvider({
|
|
|
25685
25690
|
}) {
|
|
25686
25691
|
return children;
|
|
25687
25692
|
}
|
|
25688
|
-
var FEEDBACK_DIALOG_KEYS = [];
|
|
25689
|
-
function FeedbackDialog() {
|
|
25690
|
-
return null;
|
|
25691
|
-
}
|
|
25692
25693
|
function defaultRenderLine({
|
|
25693
25694
|
lineText,
|
|
25694
25695
|
isOnCursorLine,
|
|
@@ -26250,13 +26251,6 @@ ${finalValue.trim()}`;
|
|
|
26250
26251
|
if (vimHandleInput && vimHandleInput(key)) {
|
|
26251
26252
|
return true;
|
|
26252
26253
|
}
|
|
26253
|
-
if (uiState.isFeedbackDialogOpen) {
|
|
26254
|
-
if (FEEDBACK_DIALOG_KEYS.includes(key.name)) {
|
|
26255
|
-
return true;
|
|
26256
|
-
} else {
|
|
26257
|
-
uiActions.temporaryCloseFeedbackDialog();
|
|
26258
|
-
}
|
|
26259
|
-
}
|
|
26260
26254
|
const popQueueIntoInput = () => {
|
|
26261
26255
|
const popped = uiActions.popAllQueuedMessages();
|
|
26262
26256
|
if (!popped) return false;
|
|
@@ -27347,7 +27341,6 @@ var Composer = () => {
|
|
|
27347
27341
|
")"
|
|
27348
27342
|
] }) }),
|
|
27349
27343
|
/* @__PURE__ */ jsx40(QueuedMessageDisplay, { messageQueue: uiState.messageQueue }),
|
|
27350
|
-
uiState.isFeedbackDialogOpen && /* @__PURE__ */ jsx40(FeedbackDialog, {}),
|
|
27351
27344
|
uiState.isInputActive && /* @__PURE__ */ jsx40(
|
|
27352
27345
|
InputPrompt,
|
|
27353
27346
|
{
|
|
@@ -27764,6 +27757,15 @@ var authDialogCommand = {
|
|
|
27764
27757
|
supportedModes: ["interactive"],
|
|
27765
27758
|
action: () => openDialog("auth")
|
|
27766
27759
|
};
|
|
27760
|
+
var feedbackDialogCommand = {
|
|
27761
|
+
name: "feedback",
|
|
27762
|
+
get description() {
|
|
27763
|
+
return t("Rate this session (saved locally to .deepcode/feedback.log)");
|
|
27764
|
+
},
|
|
27765
|
+
kind: "built-in",
|
|
27766
|
+
supportedModes: ["interactive"],
|
|
27767
|
+
action: () => openDialog("feedback")
|
|
27768
|
+
};
|
|
27767
27769
|
var CommandDialog = ({
|
|
27768
27770
|
title,
|
|
27769
27771
|
lines,
|
|
@@ -28610,6 +28612,70 @@ var ModelDialog = ({
|
|
|
28610
28612
|
}
|
|
28611
28613
|
);
|
|
28612
28614
|
};
|
|
28615
|
+
var RATINGS = [
|
|
28616
|
+
{ rating: 5, label: "Excellent" },
|
|
28617
|
+
{ rating: 4, label: "Good" },
|
|
28618
|
+
{ rating: 3, label: "Fair" },
|
|
28619
|
+
{ rating: 2, label: "Poor" },
|
|
28620
|
+
{ rating: 1, label: "Very poor" }
|
|
28621
|
+
];
|
|
28622
|
+
var CANCEL_VALUE2 = "__cancel__";
|
|
28623
|
+
function appendFeedbackEntry(cwd, rating, label) {
|
|
28624
|
+
const file = path112.join(cwd, ".deepcode", "feedback.log");
|
|
28625
|
+
const entry = JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), rating, label });
|
|
28626
|
+
try {
|
|
28627
|
+
fs6.mkdirSync(path112.dirname(file), { recursive: true });
|
|
28628
|
+
fs6.appendFileSync(file, `${entry}
|
|
28629
|
+
`, "utf8");
|
|
28630
|
+
} catch {
|
|
28631
|
+
}
|
|
28632
|
+
}
|
|
28633
|
+
var FeedbackDialog = ({ cwd, onClose }) => {
|
|
28634
|
+
const items = useMemo15(
|
|
28635
|
+
() => [
|
|
28636
|
+
...RATINGS.map(({ rating, label }) => ({
|
|
28637
|
+
key: String(rating),
|
|
28638
|
+
value: String(rating),
|
|
28639
|
+
label: `${rating} ${label}`
|
|
28640
|
+
})),
|
|
28641
|
+
{ key: CANCEL_VALUE2, value: CANCEL_VALUE2, label: "Cancel" }
|
|
28642
|
+
],
|
|
28643
|
+
[]
|
|
28644
|
+
);
|
|
28645
|
+
const handleSelect = useCallback23(
|
|
28646
|
+
(value) => {
|
|
28647
|
+
if (value !== CANCEL_VALUE2) {
|
|
28648
|
+
const opt = RATINGS.find((r) => String(r.rating) === value);
|
|
28649
|
+
if (opt) appendFeedbackEntry(cwd, opt.rating, opt.label);
|
|
28650
|
+
}
|
|
28651
|
+
onClose();
|
|
28652
|
+
},
|
|
28653
|
+
[cwd, onClose]
|
|
28654
|
+
);
|
|
28655
|
+
const handleEscape = useCallback23(
|
|
28656
|
+
(key) => {
|
|
28657
|
+
if (key.name === "escape") onClose();
|
|
28658
|
+
},
|
|
28659
|
+
[onClose]
|
|
28660
|
+
);
|
|
28661
|
+
useKeypress(handleEscape, { isActive: true });
|
|
28662
|
+
return /* @__PURE__ */ jsxs43(
|
|
28663
|
+
Box38,
|
|
28664
|
+
{
|
|
28665
|
+
flexDirection: "column",
|
|
28666
|
+
borderStyle: "round",
|
|
28667
|
+
borderColor: theme.border.default,
|
|
28668
|
+
paddingX: 1,
|
|
28669
|
+
marginLeft: 2,
|
|
28670
|
+
marginRight: 2,
|
|
28671
|
+
children: [
|
|
28672
|
+
/* @__PURE__ */ jsx47(Text46, { bold: true, color: theme.text.accent, children: "How useful was DeepCode in this session?" }),
|
|
28673
|
+
/* @__PURE__ */ jsx47(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
28674
|
+
/* @__PURE__ */ jsx47(Text46, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter submit \xB7 Esc cancel" })
|
|
28675
|
+
]
|
|
28676
|
+
}
|
|
28677
|
+
);
|
|
28678
|
+
};
|
|
28613
28679
|
function statusIcon(e) {
|
|
28614
28680
|
if (e.status === "done") return "\u2713";
|
|
28615
28681
|
if (e.status === "failed") return "\u2717";
|
|
@@ -28624,8 +28690,8 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
28624
28690
|
if (subagents.length === 0) return null;
|
|
28625
28691
|
const running = subagents.filter((s) => s.status === "running").length;
|
|
28626
28692
|
const title = running > 0 ? `Subagents (${running} running)` : `Subagents (${subagents.length} finishing\u2026)`;
|
|
28627
|
-
return /* @__PURE__ */
|
|
28628
|
-
|
|
28693
|
+
return /* @__PURE__ */ jsxs44(
|
|
28694
|
+
Box39,
|
|
28629
28695
|
{
|
|
28630
28696
|
flexDirection: "column",
|
|
28631
28697
|
borderStyle: "round",
|
|
@@ -28635,25 +28701,25 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
28635
28701
|
marginTop: 1,
|
|
28636
28702
|
width: Math.min(mainAreaWidth, 80),
|
|
28637
28703
|
children: [
|
|
28638
|
-
/* @__PURE__ */
|
|
28639
|
-
subagents.map((entry) => /* @__PURE__ */
|
|
28640
|
-
/* @__PURE__ */
|
|
28641
|
-
/* @__PURE__ */
|
|
28642
|
-
/* @__PURE__ */
|
|
28704
|
+
/* @__PURE__ */ jsx48(Box39, { paddingX: 1, children: /* @__PURE__ */ jsx48(Text47, { bold: true, color: theme.text.accent, children: title }) }),
|
|
28705
|
+
subagents.map((entry) => /* @__PURE__ */ jsxs44(Box39, { flexDirection: "column", paddingX: 1, children: [
|
|
28706
|
+
/* @__PURE__ */ jsxs44(Box39, { flexDirection: "row", gap: 1, children: [
|
|
28707
|
+
/* @__PURE__ */ jsx48(Text47, { color: statusColor2(entry), children: statusIcon(entry) }),
|
|
28708
|
+
/* @__PURE__ */ jsxs44(Text47, { wrap: "truncate", color: theme.text.primary, children: [
|
|
28643
28709
|
entry.prompt,
|
|
28644
28710
|
entry.prompt.length >= 50 ? "\u2026" : ""
|
|
28645
28711
|
] })
|
|
28646
28712
|
] }),
|
|
28647
|
-
entry.status === "running" && entry.currentTool && /* @__PURE__ */
|
|
28713
|
+
entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs44(Text47, { color: theme.text.secondary, dimColor: true, children: [
|
|
28648
28714
|
" ",
|
|
28649
28715
|
"using ",
|
|
28650
28716
|
entry.currentTool
|
|
28651
28717
|
] }),
|
|
28652
|
-
entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */
|
|
28718
|
+
entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */ jsxs44(Text47, { color: theme.text.secondary, dimColor: true, wrap: "truncate", children: [
|
|
28653
28719
|
" ",
|
|
28654
28720
|
entry.currentOutput.trimStart()
|
|
28655
28721
|
] }),
|
|
28656
|
-
entry.status === "failed" && entry.error && /* @__PURE__ */
|
|
28722
|
+
entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs44(Text47, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
|
|
28657
28723
|
" ",
|
|
28658
28724
|
entry.error.slice(0, 60)
|
|
28659
28725
|
] })
|
|
@@ -28838,7 +28904,6 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28838
28904
|
const [messageQueue, setMessageQueue] = useState27([]);
|
|
28839
28905
|
const [historyRemountKey, setHistoryRemountKey] = useState27(0);
|
|
28840
28906
|
const [pendingItem, setPendingItem] = useState27(null);
|
|
28841
|
-
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = useState27(false);
|
|
28842
28907
|
const [lastPromptTokenCount, setLastPromptTokenCount] = useState27(0);
|
|
28843
28908
|
const [lastOutputTokenCount, setLastOutputTokenCount] = useState27(0);
|
|
28844
28909
|
const [elapsedTime, setElapsedTime] = useState27(0);
|
|
@@ -28881,12 +28946,12 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28881
28946
|
const { stdin, setRawMode } = useStdin3();
|
|
28882
28947
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
28883
28948
|
const mainAreaWidth = Math.min(Math.max(terminalWidth - 4, 20), 120);
|
|
28884
|
-
const promptWidths =
|
|
28949
|
+
const promptWidths = useMemo16(
|
|
28885
28950
|
() => calculatePromptWidths(terminalWidth),
|
|
28886
28951
|
[terminalWidth]
|
|
28887
28952
|
);
|
|
28888
28953
|
const bufferViewportHeight = Math.max(3, Math.min(8, terminalHeight - 10));
|
|
28889
|
-
const loadedSettings =
|
|
28954
|
+
const loadedSettings = useMemo16(
|
|
28890
28955
|
() => ({
|
|
28891
28956
|
merged: {
|
|
28892
28957
|
general: { vimMode: false },
|
|
@@ -28898,14 +28963,14 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28898
28963
|
[]
|
|
28899
28964
|
);
|
|
28900
28965
|
const configAdapter = configAdapterRef.current ?? new DeepCodeConfigAdapter(cwd);
|
|
28901
|
-
const isValidPath =
|
|
28966
|
+
const isValidPath = useCallback24(
|
|
28902
28967
|
(candidate) => {
|
|
28903
|
-
const resolved =
|
|
28904
|
-
const relative2 =
|
|
28905
|
-
if (relative2.startsWith("..") ||
|
|
28968
|
+
const resolved = path122.resolve(cwd, candidate);
|
|
28969
|
+
const relative2 = path122.relative(cwd, resolved);
|
|
28970
|
+
if (relative2.startsWith("..") || path122.isAbsolute(relative2)) {
|
|
28906
28971
|
return false;
|
|
28907
28972
|
}
|
|
28908
|
-
return
|
|
28973
|
+
return fs7.existsSync(resolved);
|
|
28909
28974
|
},
|
|
28910
28975
|
[cwd]
|
|
28911
28976
|
);
|
|
@@ -28916,15 +28981,15 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28916
28981
|
isValidPath,
|
|
28917
28982
|
shellModeActive
|
|
28918
28983
|
});
|
|
28919
|
-
const pendingGeminiHistoryItems =
|
|
28984
|
+
const pendingGeminiHistoryItems = useMemo16(
|
|
28920
28985
|
() => pendingAssistantText ? [{ type: "gemini", text: pendingAssistantText }] : [],
|
|
28921
28986
|
[pendingAssistantText]
|
|
28922
28987
|
);
|
|
28923
|
-
const userMessages =
|
|
28988
|
+
const userMessages = useMemo16(
|
|
28924
28989
|
() => historyManager.history.filter((item) => item.type === "user").map((item) => item.text),
|
|
28925
28990
|
[historyManager.history]
|
|
28926
28991
|
);
|
|
28927
|
-
const slashCommands =
|
|
28992
|
+
const slashCommands = useMemo16(
|
|
28928
28993
|
() => [
|
|
28929
28994
|
helpCommand,
|
|
28930
28995
|
clearCommand,
|
|
@@ -28936,17 +29001,18 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28936
29001
|
settingsDialogCommand,
|
|
28937
29002
|
themeDialogCommand,
|
|
28938
29003
|
permissionsDialogCommand,
|
|
28939
|
-
authDialogCommand
|
|
29004
|
+
authDialogCommand,
|
|
29005
|
+
feedbackDialogCommand
|
|
28940
29006
|
],
|
|
28941
29007
|
[]
|
|
28942
29008
|
);
|
|
28943
|
-
const recentSlashCommands =
|
|
29009
|
+
const recentSlashCommands = useMemo16(
|
|
28944
29010
|
() => recentSlashCommandsState,
|
|
28945
29011
|
[recentSlashCommandsState]
|
|
28946
29012
|
);
|
|
28947
29013
|
const [promptSuggestion, setPromptSuggestion] = useState27(null);
|
|
28948
|
-
const dismissPromptSuggestion =
|
|
28949
|
-
const registerSlashCommandUsage =
|
|
29014
|
+
const dismissPromptSuggestion = useCallback24(() => setPromptSuggestion(null), []);
|
|
29015
|
+
const registerSlashCommandUsage = useCallback24((name) => {
|
|
28950
29016
|
setRecentSlashCommandsState((prev) => {
|
|
28951
29017
|
const next = new Map(prev);
|
|
28952
29018
|
const existing = next.get(name);
|
|
@@ -28958,8 +29024,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28958
29024
|
return next;
|
|
28959
29025
|
});
|
|
28960
29026
|
}, []);
|
|
28961
|
-
const listAvailableProviders =
|
|
28962
|
-
const getSessionCommandState =
|
|
29027
|
+
const listAvailableProviders = useCallback24(() => PROVIDER_IDS, []);
|
|
29028
|
+
const getSessionCommandState = useCallback24(() => {
|
|
28963
29029
|
const runtime = runtimeRef.current;
|
|
28964
29030
|
const session = sessionRef.current;
|
|
28965
29031
|
const fallbackProvider = runtime?.config.defaultProvider ?? PROVIDER_IDS[0];
|
|
@@ -28971,7 +29037,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28971
29037
|
mode: agentMode
|
|
28972
29038
|
};
|
|
28973
29039
|
}, [agentMode]);
|
|
28974
|
-
const setSessionProvider =
|
|
29040
|
+
const setSessionProvider = useCallback24((provider2) => {
|
|
28975
29041
|
const runtime = runtimeRef.current;
|
|
28976
29042
|
const session = sessionRef.current;
|
|
28977
29043
|
if (!runtime || !session) return;
|
|
@@ -28991,7 +29057,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28991
29057
|
);
|
|
28992
29058
|
}
|
|
28993
29059
|
}, [historyManager]);
|
|
28994
|
-
const setSessionModel =
|
|
29060
|
+
const setSessionModel = useCallback24((model2) => {
|
|
28995
29061
|
const runtime = runtimeRef.current;
|
|
28996
29062
|
const session = sessionRef.current;
|
|
28997
29063
|
if (!runtime || !session) return;
|
|
@@ -29002,10 +29068,10 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29002
29068
|
setCurrentModel(session.model ?? "(unconfigured)");
|
|
29003
29069
|
setProviderLabel(formatProviderLabel(session.provider, session.model));
|
|
29004
29070
|
}, []);
|
|
29005
|
-
const setSessionMode =
|
|
29071
|
+
const setSessionMode = useCallback24((mode) => {
|
|
29006
29072
|
setAgentMode(mode);
|
|
29007
29073
|
}, []);
|
|
29008
|
-
const sessionCommandServices =
|
|
29074
|
+
const sessionCommandServices = useMemo16(
|
|
29009
29075
|
() => ({
|
|
29010
29076
|
getState: getSessionCommandState,
|
|
29011
29077
|
setProvider: setSessionProvider,
|
|
@@ -29021,13 +29087,13 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29021
29087
|
setSessionProvider
|
|
29022
29088
|
]
|
|
29023
29089
|
);
|
|
29024
|
-
const handleUndo =
|
|
29090
|
+
const handleUndo = useCallback24(async () => {
|
|
29025
29091
|
const runtime = runtimeRef.current;
|
|
29026
29092
|
const session = sessionRef.current;
|
|
29027
29093
|
if (!runtime || !session) return null;
|
|
29028
29094
|
return runtime.agent.undo(session.id);
|
|
29029
29095
|
}, []);
|
|
29030
|
-
const commandContext =
|
|
29096
|
+
const commandContext = useMemo16(
|
|
29031
29097
|
() => ({
|
|
29032
29098
|
executionMode: "interactive",
|
|
29033
29099
|
services: {
|
|
@@ -29257,7 +29323,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29257
29323
|
unsubscribeRef.current = [];
|
|
29258
29324
|
};
|
|
29259
29325
|
}, [addHistoryItem, config, cwd, model, provider]);
|
|
29260
|
-
const resolveApproval =
|
|
29326
|
+
const resolveApproval = useCallback24(
|
|
29261
29327
|
(decision) => {
|
|
29262
29328
|
const runtime = runtimeRef.current;
|
|
29263
29329
|
const current = approvalQueue[0];
|
|
@@ -29270,7 +29336,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29270
29336
|
},
|
|
29271
29337
|
[approvalQueue]
|
|
29272
29338
|
);
|
|
29273
|
-
const appendTurnItems =
|
|
29339
|
+
const appendTurnItems = useCallback24(
|
|
29274
29340
|
(items) => {
|
|
29275
29341
|
const base = Date.now();
|
|
29276
29342
|
for (const item of items) {
|
|
@@ -29279,7 +29345,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29279
29345
|
},
|
|
29280
29346
|
[historyManager]
|
|
29281
29347
|
);
|
|
29282
|
-
const runPrompt =
|
|
29348
|
+
const runPrompt = useCallback24(
|
|
29283
29349
|
async (rawPrompt) => {
|
|
29284
29350
|
const runtime = runtimeRef.current;
|
|
29285
29351
|
const session = sessionRef.current;
|
|
@@ -29370,7 +29436,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29370
29436
|
},
|
|
29371
29437
|
[agentMode, appendTurnItems, historyManager]
|
|
29372
29438
|
);
|
|
29373
|
-
const executeClientToolCommand =
|
|
29439
|
+
const executeClientToolCommand = useCallback24(
|
|
29374
29440
|
async (toolName, toolArgs) => {
|
|
29375
29441
|
const runtime = runtimeRef.current;
|
|
29376
29442
|
const session = sessionRef.current;
|
|
@@ -29463,7 +29529,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29463
29529
|
},
|
|
29464
29530
|
[agentMode, historyManager]
|
|
29465
29531
|
);
|
|
29466
|
-
const applySlashCommandResult =
|
|
29532
|
+
const applySlashCommandResult = useCallback24(
|
|
29467
29533
|
async (result, _rawInvocation) => {
|
|
29468
29534
|
if (!result) return;
|
|
29469
29535
|
switch (result.type) {
|
|
@@ -29524,7 +29590,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29524
29590
|
},
|
|
29525
29591
|
[appendTurnItems, executeClientToolCommand, historyManager, runPrompt]
|
|
29526
29592
|
);
|
|
29527
|
-
const executeSlashCommand =
|
|
29593
|
+
const executeSlashCommand = useCallback24(
|
|
29528
29594
|
async (rawInput, overwriteConfirmed = false) => {
|
|
29529
29595
|
const trimmed = rawInput.trim();
|
|
29530
29596
|
if (!trimmed.startsWith("/")) return false;
|
|
@@ -29597,7 +29663,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29597
29663
|
slashCommands
|
|
29598
29664
|
]
|
|
29599
29665
|
);
|
|
29600
|
-
const executeSubmission =
|
|
29666
|
+
const executeSubmission = useCallback24(
|
|
29601
29667
|
async (value) => {
|
|
29602
29668
|
const trimmed = value.trim();
|
|
29603
29669
|
if (!trimmed) return;
|
|
@@ -29607,7 +29673,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29607
29673
|
},
|
|
29608
29674
|
[executeSlashCommand, runPrompt]
|
|
29609
29675
|
);
|
|
29610
|
-
const handleFinalSubmit =
|
|
29676
|
+
const handleFinalSubmit = useCallback24(
|
|
29611
29677
|
(value) => {
|
|
29612
29678
|
const prompt = value.trim();
|
|
29613
29679
|
if (!prompt) return;
|
|
@@ -29633,7 +29699,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29633
29699
|
isRunning
|
|
29634
29700
|
]
|
|
29635
29701
|
);
|
|
29636
|
-
const handleRetryLastPrompt =
|
|
29702
|
+
const handleRetryLastPrompt = useCallback24(() => {
|
|
29637
29703
|
const lastPrompt = lastSubmittedPromptRef.current;
|
|
29638
29704
|
if (!lastPrompt) {
|
|
29639
29705
|
historyManager.addItem(
|
|
@@ -29648,7 +29714,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29648
29714
|
}
|
|
29649
29715
|
void runPrompt(lastPrompt);
|
|
29650
29716
|
}, [approvalQueue.length, historyManager, isInitializing, isRunning, runPrompt]);
|
|
29651
|
-
const resolveCommandConfirmation =
|
|
29717
|
+
const resolveCommandConfirmation = useCallback24(
|
|
29652
29718
|
(confirmed) => {
|
|
29653
29719
|
const pending = pendingCommandConfirmation;
|
|
29654
29720
|
if (!pending) return;
|
|
@@ -29679,7 +29745,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29679
29745
|
pendingCommandConfirmation
|
|
29680
29746
|
]
|
|
29681
29747
|
);
|
|
29682
|
-
const persistConfig =
|
|
29748
|
+
const persistConfig = useCallback24(
|
|
29683
29749
|
async (mutate) => {
|
|
29684
29750
|
const loader = new ConfigLoader();
|
|
29685
29751
|
const options = { cwd, configPath: config };
|
|
@@ -29688,7 +29754,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29688
29754
|
},
|
|
29689
29755
|
[config, cwd]
|
|
29690
29756
|
);
|
|
29691
|
-
const handleSelectTheme =
|
|
29757
|
+
const handleSelectTheme = useCallback24(
|
|
29692
29758
|
(nextThemeName) => {
|
|
29693
29759
|
themeManager.setActiveTheme(nextThemeName);
|
|
29694
29760
|
setThemeName(themeManager.getActiveTheme().name);
|
|
@@ -29709,7 +29775,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29709
29775
|
},
|
|
29710
29776
|
[cwd, historyManager]
|
|
29711
29777
|
);
|
|
29712
|
-
const handleSavePermissions =
|
|
29778
|
+
const handleSavePermissions = useCallback24(
|
|
29713
29779
|
(modes) => {
|
|
29714
29780
|
setPermissionModes(modes);
|
|
29715
29781
|
setPermissionSummary(formatPermissionSummary(modes));
|
|
@@ -29738,7 +29804,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29738
29804
|
},
|
|
29739
29805
|
[historyManager, persistConfig]
|
|
29740
29806
|
);
|
|
29741
|
-
const handlePersistToken =
|
|
29807
|
+
const handlePersistToken = useCallback24(
|
|
29742
29808
|
async (token) => {
|
|
29743
29809
|
await persistConfig((cfg) => ({
|
|
29744
29810
|
...cfg,
|
|
@@ -29752,12 +29818,12 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29752
29818
|
},
|
|
29753
29819
|
[persistConfig]
|
|
29754
29820
|
);
|
|
29755
|
-
const providerHasApiKey =
|
|
29821
|
+
const providerHasApiKey = useCallback24((provider2) => {
|
|
29756
29822
|
const runtime = runtimeRef.current;
|
|
29757
29823
|
void providerConfigVersion;
|
|
29758
29824
|
return Boolean(runtime?.config.providers[provider2]?.apiKey?.trim());
|
|
29759
29825
|
}, [providerConfigVersion]);
|
|
29760
|
-
const getProviderKeyHint =
|
|
29826
|
+
const getProviderKeyHint = useCallback24((provider2) => {
|
|
29761
29827
|
const runtime = runtimeRef.current;
|
|
29762
29828
|
void providerConfigVersion;
|
|
29763
29829
|
const key = runtime?.config.providers[provider2]?.apiKey?.trim();
|
|
@@ -29765,7 +29831,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29765
29831
|
if (key.length <= 8) return "\u25CF".repeat(key.length);
|
|
29766
29832
|
return `${key.slice(0, 6)}\u25CF\u25CF\u25CF\u25CF${key.slice(-4)}`;
|
|
29767
29833
|
}, [providerConfigVersion]);
|
|
29768
|
-
const handleSaveProviderApiKey =
|
|
29834
|
+
const handleSaveProviderApiKey = useCallback24(
|
|
29769
29835
|
async (provider2, apiKey) => {
|
|
29770
29836
|
await persistConfig((cfg) => ({
|
|
29771
29837
|
...cfg,
|
|
@@ -29790,7 +29856,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29790
29856
|
},
|
|
29791
29857
|
[historyManager, persistConfig]
|
|
29792
29858
|
);
|
|
29793
|
-
const handleSetDefaultProvider =
|
|
29859
|
+
const handleSetDefaultProvider = useCallback24(
|
|
29794
29860
|
async (provider2) => {
|
|
29795
29861
|
const runtime = runtimeRef.current;
|
|
29796
29862
|
const session = sessionRef.current;
|
|
@@ -29832,7 +29898,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29832
29898
|
},
|
|
29833
29899
|
[historyManager, persistConfig]
|
|
29834
29900
|
);
|
|
29835
|
-
const handleTestProvider =
|
|
29901
|
+
const handleTestProvider = useCallback24(
|
|
29836
29902
|
async (provider2) => {
|
|
29837
29903
|
const runtime = runtimeRef.current;
|
|
29838
29904
|
const session = sessionRef.current;
|
|
@@ -29880,7 +29946,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29880
29946
|
},
|
|
29881
29947
|
[]
|
|
29882
29948
|
);
|
|
29883
|
-
const handleFetchModels =
|
|
29949
|
+
const handleFetchModels = useCallback24(
|
|
29884
29950
|
async (provider2, signal) => {
|
|
29885
29951
|
const runtime = runtimeRef.current;
|
|
29886
29952
|
if (!runtime) throw new Error("Runtime not ready.");
|
|
@@ -29888,15 +29954,15 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29888
29954
|
},
|
|
29889
29955
|
[]
|
|
29890
29956
|
);
|
|
29891
|
-
const handleSelectModel =
|
|
29957
|
+
const handleSelectModel = useCallback24(
|
|
29892
29958
|
(modelId) => {
|
|
29893
29959
|
setSessionModel(modelId);
|
|
29894
29960
|
setActiveDialog(null);
|
|
29895
29961
|
},
|
|
29896
29962
|
[setSessionModel]
|
|
29897
29963
|
);
|
|
29898
|
-
const closeDialog =
|
|
29899
|
-
const previewTheme =
|
|
29964
|
+
const closeDialog = useCallback24(() => setActiveDialog(null), []);
|
|
29965
|
+
const previewTheme = useCallback24(() => setThemeVersion((version) => version + 1), []);
|
|
29900
29966
|
useEffect25(() => {
|
|
29901
29967
|
if (drainingQueueRef.current || isRunning || isInitializing || Boolean(initError) || approvalQueue.length > 0 || messageQueue.length === 0) {
|
|
29902
29968
|
return;
|
|
@@ -29968,7 +30034,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29968
30034
|
abortRef.current?.abort();
|
|
29969
30035
|
}
|
|
29970
30036
|
});
|
|
29971
|
-
const uiActions =
|
|
30037
|
+
const uiActions = useMemo16(
|
|
29972
30038
|
() => ({
|
|
29973
30039
|
refreshStatic: () => {
|
|
29974
30040
|
setHistoryRemountKey((prev) => prev + 1);
|
|
@@ -29983,7 +30049,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29983
30049
|
onSuggestionsVisibilityChange: () => {
|
|
29984
30050
|
},
|
|
29985
30051
|
vimHandleInput: () => false,
|
|
29986
|
-
temporaryCloseFeedbackDialog: () =>
|
|
30052
|
+
temporaryCloseFeedbackDialog: () => {
|
|
30053
|
+
},
|
|
29987
30054
|
popAllQueuedMessages: () => {
|
|
29988
30055
|
const queued = messageQueueRef.current;
|
|
29989
30056
|
if (queued.length === 0) return "";
|
|
@@ -29994,7 +30061,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29994
30061
|
}),
|
|
29995
30062
|
[handleFinalSubmit, handleRetryLastPrompt, historyManager]
|
|
29996
30063
|
);
|
|
29997
|
-
const dialogModel =
|
|
30064
|
+
const dialogModel = useMemo16(
|
|
29998
30065
|
() => buildDialogModel(activeDialog, {
|
|
29999
30066
|
cwd,
|
|
30000
30067
|
providerLabel,
|
|
@@ -30021,8 +30088,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30021
30088
|
themeName
|
|
30022
30089
|
]
|
|
30023
30090
|
);
|
|
30024
|
-
const activeSubagents =
|
|
30025
|
-
const uiState =
|
|
30091
|
+
const activeSubagents = useMemo16(() => Array.from(subagentMap.values()), [subagentMap]);
|
|
30092
|
+
const uiState = useMemo16(
|
|
30026
30093
|
() => ({
|
|
30027
30094
|
history: historyManager.history,
|
|
30028
30095
|
historyManager,
|
|
@@ -30062,7 +30129,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30062
30129
|
mainControlsRef,
|
|
30063
30130
|
constrainHeight: false,
|
|
30064
30131
|
currentModel,
|
|
30065
|
-
sessionName:
|
|
30132
|
+
sessionName: path122.basename(cwd),
|
|
30066
30133
|
isConfigInitialized: !isInitializing && !initError,
|
|
30067
30134
|
sessionStats: {
|
|
30068
30135
|
lastPromptTokenCount,
|
|
@@ -30075,7 +30142,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30075
30142
|
isModelDialogOpen: activeDialog === "model",
|
|
30076
30143
|
isProviderDialogOpen: activeDialog === "provider",
|
|
30077
30144
|
isPermissionsDialogOpen: activeDialog === "permissions",
|
|
30078
|
-
isFeedbackDialogOpen,
|
|
30145
|
+
isFeedbackDialogOpen: false,
|
|
30079
30146
|
showAutoAcceptIndicator: "default",
|
|
30080
30147
|
mcpConnected,
|
|
30081
30148
|
mcpTotal,
|
|
@@ -30096,7 +30163,6 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30096
30163
|
historyManager,
|
|
30097
30164
|
historyRemountKey,
|
|
30098
30165
|
initError,
|
|
30099
|
-
isFeedbackDialogOpen,
|
|
30100
30166
|
isInitializing,
|
|
30101
30167
|
isReceivingContent,
|
|
30102
30168
|
iterationInfo,
|
|
@@ -30120,37 +30186,37 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30120
30186
|
userMessages
|
|
30121
30187
|
]
|
|
30122
30188
|
);
|
|
30123
|
-
return /* @__PURE__ */
|
|
30124
|
-
/* @__PURE__ */
|
|
30125
|
-
/* @__PURE__ */
|
|
30126
|
-
/* @__PURE__ */
|
|
30127
|
-
/* @__PURE__ */
|
|
30128
|
-
/* @__PURE__ */
|
|
30189
|
+
return /* @__PURE__ */ jsx49(CompactModeProvider, { value: { compactMode }, children: /* @__PURE__ */ jsx49(ConfigContext.Provider, { value: configAdapter, children: /* @__PURE__ */ jsx49(SettingsContext.Provider, { value: loadedSettings, children: /* @__PURE__ */ jsx49(StreamingContext.Provider, { value: streamingState, children: /* @__PURE__ */ jsx49(VimModeProvider, { initialVimEnabled: loadedSettings.merged.general?.vimMode ?? false, children: /* @__PURE__ */ jsx49(KeypressProvider, { kittyProtocolEnabled: false, config: configAdapter, children: /* @__PURE__ */ jsx49(ShellFocusContext.Provider, { value: true, children: /* @__PURE__ */ jsx49(AgentViewProvider, { children: /* @__PURE__ */ jsx49(BackgroundTaskViewProvider, { children: /* @__PURE__ */ jsx49(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ jsx49(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ jsxs45(Box40, { flexDirection: "column", flexGrow: 1, children: [
|
|
30190
|
+
/* @__PURE__ */ jsxs45(Box40, { marginLeft: 2, marginRight: 2, marginTop: 1, marginBottom: 1, children: [
|
|
30191
|
+
/* @__PURE__ */ jsx49(Text48, { bold: true, color: theme.text.accent, children: "DeepCode" }),
|
|
30192
|
+
/* @__PURE__ */ jsx49(Text48, { color: theme.text.secondary, children: " Target: " }),
|
|
30193
|
+
/* @__PURE__ */ jsx49(Text48, { color: theme.text.primary, children: providerLabel }),
|
|
30194
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30129
30195
|
" (",
|
|
30130
30196
|
targetSource,
|
|
30131
30197
|
")"
|
|
30132
30198
|
] }),
|
|
30133
|
-
/* @__PURE__ */
|
|
30134
|
-
/* @__PURE__ */
|
|
30135
|
-
|
|
30199
|
+
/* @__PURE__ */ jsx49(Text48, { color: theme.text.secondary, children: " Mode: " }),
|
|
30200
|
+
/* @__PURE__ */ jsx49(
|
|
30201
|
+
Text48,
|
|
30136
30202
|
{
|
|
30137
30203
|
bold: true,
|
|
30138
30204
|
color: agentMode === "build" ? theme.status.success : theme.status.warning,
|
|
30139
30205
|
children: agentMode.toUpperCase()
|
|
30140
30206
|
}
|
|
30141
30207
|
),
|
|
30142
|
-
/* @__PURE__ */
|
|
30208
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30143
30209
|
" ",
|
|
30144
30210
|
streamingState === "responding" ? "running" : streamingState === "waiting_for_confirmation" ? "waiting-approval" : "idle"
|
|
30145
30211
|
] }),
|
|
30146
|
-
iterationInfo && /* @__PURE__ */
|
|
30212
|
+
iterationInfo && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30147
30213
|
" ",
|
|
30148
30214
|
"iter ",
|
|
30149
30215
|
iterationInfo.round,
|
|
30150
30216
|
"/",
|
|
30151
30217
|
iterationInfo.max
|
|
30152
30218
|
] }),
|
|
30153
|
-
lastPromptTokenCount > 0 && /* @__PURE__ */
|
|
30219
|
+
lastPromptTokenCount > 0 && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30154
30220
|
" ",
|
|
30155
30221
|
"\u2191",
|
|
30156
30222
|
formatTokenCount(lastPromptTokenCount),
|
|
@@ -30158,10 +30224,10 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30158
30224
|
formatTokenCount(lastOutputTokenCount)
|
|
30159
30225
|
] })
|
|
30160
30226
|
] }),
|
|
30161
|
-
initError ? /* @__PURE__ */
|
|
30227
|
+
initError ? /* @__PURE__ */ jsx49(Box40, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsxs45(Text48, { color: theme.status.error, children: [
|
|
30162
30228
|
"Failed to initialize runtime: ",
|
|
30163
30229
|
initError
|
|
30164
|
-
] }) }) : /* @__PURE__ */
|
|
30230
|
+
] }) }) : /* @__PURE__ */ jsx49(
|
|
30165
30231
|
MainContent,
|
|
30166
30232
|
{
|
|
30167
30233
|
history: historyManager.history,
|
|
@@ -30175,9 +30241,9 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30175
30241
|
},
|
|
30176
30242
|
historyRemountKey
|
|
30177
30243
|
),
|
|
30178
|
-
approvalQueue.length > 0 && /* @__PURE__ */
|
|
30179
|
-
dialogModel && /* @__PURE__ */
|
|
30180
|
-
activeDialog === "provider" && /* @__PURE__ */
|
|
30244
|
+
approvalQueue.length > 0 && /* @__PURE__ */ jsx49(Box40, { marginLeft: 2, marginRight: 2, marginTop: 1, children: /* @__PURE__ */ jsx49(ApprovalPrompt, { request: approvalQueue[0] }) }),
|
|
30245
|
+
dialogModel && /* @__PURE__ */ jsx49(CommandDialog, { title: dialogModel.title, lines: dialogModel.lines }),
|
|
30246
|
+
activeDialog === "provider" && /* @__PURE__ */ jsx49(
|
|
30181
30247
|
ProviderDialog,
|
|
30182
30248
|
{
|
|
30183
30249
|
providers: listAvailableProviders(),
|
|
@@ -30192,7 +30258,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30192
30258
|
onClose: closeDialog
|
|
30193
30259
|
}
|
|
30194
30260
|
),
|
|
30195
|
-
activeDialog === "model" && /* @__PURE__ */
|
|
30261
|
+
activeDialog === "model" && /* @__PURE__ */ jsx49(
|
|
30196
30262
|
ModelDialog,
|
|
30197
30263
|
{
|
|
30198
30264
|
currentProvider: getSessionCommandState().provider,
|
|
@@ -30202,7 +30268,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30202
30268
|
onClose: closeDialog
|
|
30203
30269
|
}
|
|
30204
30270
|
),
|
|
30205
|
-
activeDialog === "theme" && /* @__PURE__ */
|
|
30271
|
+
activeDialog === "theme" && /* @__PURE__ */ jsx49(
|
|
30206
30272
|
ThemeDialog,
|
|
30207
30273
|
{
|
|
30208
30274
|
onSelect: handleSelectTheme,
|
|
@@ -30210,7 +30276,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30210
30276
|
onPreview: previewTheme
|
|
30211
30277
|
}
|
|
30212
30278
|
),
|
|
30213
|
-
activeDialog === "permissions" && /* @__PURE__ */
|
|
30279
|
+
activeDialog === "permissions" && /* @__PURE__ */ jsx49(
|
|
30214
30280
|
PermissionsDialog,
|
|
30215
30281
|
{
|
|
30216
30282
|
current: permissionModes,
|
|
@@ -30218,7 +30284,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30218
30284
|
onClose: closeDialog
|
|
30219
30285
|
}
|
|
30220
30286
|
),
|
|
30221
|
-
activeDialog === "auth" && runtimeRef.current && /* @__PURE__ */
|
|
30287
|
+
activeDialog === "auth" && runtimeRef.current && /* @__PURE__ */ jsx49(
|
|
30222
30288
|
AuthDialog,
|
|
30223
30289
|
{
|
|
30224
30290
|
clientId: runtimeRef.current.config.github.oauthClientId,
|
|
@@ -30231,7 +30297,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30231
30297
|
onClose: closeDialog
|
|
30232
30298
|
}
|
|
30233
30299
|
),
|
|
30234
|
-
|
|
30300
|
+
activeDialog === "feedback" && /* @__PURE__ */ jsx49(FeedbackDialog, { cwd, onClose: closeDialog }),
|
|
30301
|
+
pendingCommandConfirmation && /* @__PURE__ */ jsx49(
|
|
30235
30302
|
CommandDialog,
|
|
30236
30303
|
{
|
|
30237
30304
|
title: "Confirm action",
|
|
@@ -30243,14 +30310,14 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30243
30310
|
footerText: "Press y or Enter to confirm. Press n or Esc to cancel."
|
|
30244
30311
|
}
|
|
30245
30312
|
),
|
|
30246
|
-
/* @__PURE__ */
|
|
30313
|
+
/* @__PURE__ */ jsx49(
|
|
30247
30314
|
SubagentsPanel,
|
|
30248
30315
|
{
|
|
30249
30316
|
subagents: Array.from(subagentMap.values()),
|
|
30250
30317
|
mainAreaWidth
|
|
30251
30318
|
}
|
|
30252
30319
|
),
|
|
30253
|
-
/* @__PURE__ */
|
|
30320
|
+
/* @__PURE__ */ jsx49(Composer, {})
|
|
30254
30321
|
] }) }) }) }) }) }) }) }) }) }) }) });
|
|
30255
30322
|
};
|
|
30256
30323
|
function formatProviderLabel(provider, model) {
|
|
@@ -30290,14 +30357,14 @@ function formatPermissionSummary(config) {
|
|
|
30290
30357
|
return `read=${config.read}, write=${config.write}, shell=${config.shell}, dangerous=${config.dangerous}, gitLocal=${config.gitLocal}`;
|
|
30291
30358
|
}
|
|
30292
30359
|
function isInteractiveDialog(dialog) {
|
|
30293
|
-
return dialog === "theme" || dialog === "permissions" || dialog === "auth" || dialog === "provider" || dialog === "model";
|
|
30360
|
+
return dialog === "theme" || dialog === "permissions" || dialog === "auth" || dialog === "provider" || dialog === "model" || dialog === "feedback";
|
|
30294
30361
|
}
|
|
30295
30362
|
function tuiThemeFilePath(cwd) {
|
|
30296
|
-
return
|
|
30363
|
+
return path122.join(cwd, ".deepcode", "tui-theme.json");
|
|
30297
30364
|
}
|
|
30298
30365
|
function readSavedTheme(cwd) {
|
|
30299
30366
|
try {
|
|
30300
|
-
const parsed = JSON.parse(
|
|
30367
|
+
const parsed = JSON.parse(fs7.readFileSync(tuiThemeFilePath(cwd), "utf8"));
|
|
30301
30368
|
return typeof parsed.theme === "string" ? parsed.theme : null;
|
|
30302
30369
|
} catch {
|
|
30303
30370
|
return null;
|
|
@@ -30305,8 +30372,8 @@ function readSavedTheme(cwd) {
|
|
|
30305
30372
|
}
|
|
30306
30373
|
function writeSavedTheme(cwd, themeName) {
|
|
30307
30374
|
const file = tuiThemeFilePath(cwd);
|
|
30308
|
-
|
|
30309
|
-
|
|
30375
|
+
fs7.mkdirSync(path122.dirname(file), { recursive: true });
|
|
30376
|
+
fs7.writeFileSync(file, `${JSON.stringify({ theme: themeName }, null, 2)}
|
|
30310
30377
|
`);
|
|
30311
30378
|
}
|
|
30312
30379
|
function errorMessage(error) {
|
|
@@ -30335,7 +30402,7 @@ function buildDialogModel(dialog, options) {
|
|
|
30335
30402
|
]
|
|
30336
30403
|
};
|
|
30337
30404
|
}
|
|
30338
|
-
if (dialog === "theme" || dialog === "provider" || dialog === "permissions" || dialog === "auth" || dialog === "model") {
|
|
30405
|
+
if (dialog === "theme" || dialog === "provider" || dialog === "permissions" || dialog === "auth" || dialog === "model" || dialog === "feedback") {
|
|
30339
30406
|
return null;
|
|
30340
30407
|
}
|
|
30341
30408
|
return {
|
|
@@ -30352,22 +30419,22 @@ function formatAuthSummary(config) {
|
|
|
30352
30419
|
var ApprovalPrompt = ({ request }) => {
|
|
30353
30420
|
if (!request) return null;
|
|
30354
30421
|
const operationLabel = formatApprovalOperationLabel(request);
|
|
30355
|
-
return /* @__PURE__ */
|
|
30356
|
-
/* @__PURE__ */
|
|
30422
|
+
return /* @__PURE__ */ jsxs45(Box40, { flexDirection: "column", marginTop: 1, children: [
|
|
30423
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.status.warning, children: [
|
|
30357
30424
|
"\u26A0 Allow ",
|
|
30358
30425
|
operationLabel,
|
|
30359
30426
|
"?"
|
|
30360
30427
|
] }),
|
|
30361
|
-
request.path && /* @__PURE__ */
|
|
30428
|
+
request.path && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30362
30429
|
" ",
|
|
30363
30430
|
request.path
|
|
30364
30431
|
] }),
|
|
30365
|
-
request.preview?.command && /* @__PURE__ */
|
|
30432
|
+
request.preview?.command && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30366
30433
|
" $ ",
|
|
30367
30434
|
request.preview.command,
|
|
30368
30435
|
request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
|
|
30369
30436
|
] }),
|
|
30370
|
-
/* @__PURE__ */
|
|
30437
|
+
/* @__PURE__ */ jsx49(Text48, { color: theme.text.secondary, children: " [\u21B5/y] once [s] session [a] always [n] deny" })
|
|
30371
30438
|
] });
|
|
30372
30439
|
};
|
|
30373
30440
|
function formatApprovalOperationLabel(request) {
|
|
@@ -30428,7 +30495,7 @@ var DeepCodeConfigAdapter = class {
|
|
|
30428
30495
|
}
|
|
30429
30496
|
};
|
|
30430
30497
|
function App(props) {
|
|
30431
|
-
return /* @__PURE__ */
|
|
30498
|
+
return /* @__PURE__ */ jsx50(
|
|
30432
30499
|
AppContainer,
|
|
30433
30500
|
{
|
|
30434
30501
|
cwd: props.cwd,
|
|
@@ -30586,7 +30653,7 @@ function createProgram() {
|
|
|
30586
30653
|
});
|
|
30587
30654
|
program.command("chat", { isDefault: true }).description("open the terminal UI").option("--provider <provider>", "provider override for this chat session").option("--model <model>", "model override for this chat session (or <provider>/<model>)").action((options) => {
|
|
30588
30655
|
render2(
|
|
30589
|
-
|
|
30656
|
+
React36.createElement(App, {
|
|
30590
30657
|
cwd: program.opts().cwd,
|
|
30591
30658
|
config: program.opts().config,
|
|
30592
30659
|
provider: options.provider,
|