deepcode-ai 1.1.16 → 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 +214 -120
- 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
|
{
|
|
@@ -27591,6 +27584,25 @@ var helpCommand = {
|
|
|
27591
27584
|
supportedModes: ["interactive"],
|
|
27592
27585
|
action: () => helpAction()
|
|
27593
27586
|
};
|
|
27587
|
+
var undoCommand = {
|
|
27588
|
+
name: "undo",
|
|
27589
|
+
get description() {
|
|
27590
|
+
return t("Undo the last file write or edit made by the agent");
|
|
27591
|
+
},
|
|
27592
|
+
kind: "built-in",
|
|
27593
|
+
supportedModes: ["interactive"],
|
|
27594
|
+
action: async (context) => {
|
|
27595
|
+
const result = await context.ui.undo();
|
|
27596
|
+
if (!result) {
|
|
27597
|
+
return { type: "message", messageType: "info", content: t("Nothing to undo.") };
|
|
27598
|
+
}
|
|
27599
|
+
return {
|
|
27600
|
+
type: "message",
|
|
27601
|
+
messageType: "info",
|
|
27602
|
+
content: `\u21A9 ${t("Restored")}: ${result.path}`
|
|
27603
|
+
};
|
|
27604
|
+
}
|
|
27605
|
+
};
|
|
27594
27606
|
function sessionNotReady() {
|
|
27595
27607
|
return {
|
|
27596
27608
|
type: "message",
|
|
@@ -27745,6 +27757,15 @@ var authDialogCommand = {
|
|
|
27745
27757
|
supportedModes: ["interactive"],
|
|
27746
27758
|
action: () => openDialog("auth")
|
|
27747
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
|
+
};
|
|
27748
27769
|
var CommandDialog = ({
|
|
27749
27770
|
title,
|
|
27750
27771
|
lines,
|
|
@@ -28591,6 +28612,70 @@ var ModelDialog = ({
|
|
|
28591
28612
|
}
|
|
28592
28613
|
);
|
|
28593
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
|
+
};
|
|
28594
28679
|
function statusIcon(e) {
|
|
28595
28680
|
if (e.status === "done") return "\u2713";
|
|
28596
28681
|
if (e.status === "failed") return "\u2717";
|
|
@@ -28605,8 +28690,8 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
28605
28690
|
if (subagents.length === 0) return null;
|
|
28606
28691
|
const running = subagents.filter((s) => s.status === "running").length;
|
|
28607
28692
|
const title = running > 0 ? `Subagents (${running} running)` : `Subagents (${subagents.length} finishing\u2026)`;
|
|
28608
|
-
return /* @__PURE__ */
|
|
28609
|
-
|
|
28693
|
+
return /* @__PURE__ */ jsxs44(
|
|
28694
|
+
Box39,
|
|
28610
28695
|
{
|
|
28611
28696
|
flexDirection: "column",
|
|
28612
28697
|
borderStyle: "round",
|
|
@@ -28616,25 +28701,25 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
28616
28701
|
marginTop: 1,
|
|
28617
28702
|
width: Math.min(mainAreaWidth, 80),
|
|
28618
28703
|
children: [
|
|
28619
|
-
/* @__PURE__ */
|
|
28620
|
-
subagents.map((entry) => /* @__PURE__ */
|
|
28621
|
-
/* @__PURE__ */
|
|
28622
|
-
/* @__PURE__ */
|
|
28623
|
-
/* @__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: [
|
|
28624
28709
|
entry.prompt,
|
|
28625
28710
|
entry.prompt.length >= 50 ? "\u2026" : ""
|
|
28626
28711
|
] })
|
|
28627
28712
|
] }),
|
|
28628
|
-
entry.status === "running" && entry.currentTool && /* @__PURE__ */
|
|
28713
|
+
entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs44(Text47, { color: theme.text.secondary, dimColor: true, children: [
|
|
28629
28714
|
" ",
|
|
28630
28715
|
"using ",
|
|
28631
28716
|
entry.currentTool
|
|
28632
28717
|
] }),
|
|
28633
|
-
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: [
|
|
28634
28719
|
" ",
|
|
28635
28720
|
entry.currentOutput.trimStart()
|
|
28636
28721
|
] }),
|
|
28637
|
-
entry.status === "failed" && entry.error && /* @__PURE__ */
|
|
28722
|
+
entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs44(Text47, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
|
|
28638
28723
|
" ",
|
|
28639
28724
|
entry.error.slice(0, 60)
|
|
28640
28725
|
] })
|
|
@@ -28819,7 +28904,6 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28819
28904
|
const [messageQueue, setMessageQueue] = useState27([]);
|
|
28820
28905
|
const [historyRemountKey, setHistoryRemountKey] = useState27(0);
|
|
28821
28906
|
const [pendingItem, setPendingItem] = useState27(null);
|
|
28822
|
-
const [isFeedbackDialogOpen, setIsFeedbackDialogOpen] = useState27(false);
|
|
28823
28907
|
const [lastPromptTokenCount, setLastPromptTokenCount] = useState27(0);
|
|
28824
28908
|
const [lastOutputTokenCount, setLastOutputTokenCount] = useState27(0);
|
|
28825
28909
|
const [elapsedTime, setElapsedTime] = useState27(0);
|
|
@@ -28862,12 +28946,12 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28862
28946
|
const { stdin, setRawMode } = useStdin3();
|
|
28863
28947
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
28864
28948
|
const mainAreaWidth = Math.min(Math.max(terminalWidth - 4, 20), 120);
|
|
28865
|
-
const promptWidths =
|
|
28949
|
+
const promptWidths = useMemo16(
|
|
28866
28950
|
() => calculatePromptWidths(terminalWidth),
|
|
28867
28951
|
[terminalWidth]
|
|
28868
28952
|
);
|
|
28869
28953
|
const bufferViewportHeight = Math.max(3, Math.min(8, terminalHeight - 10));
|
|
28870
|
-
const loadedSettings =
|
|
28954
|
+
const loadedSettings = useMemo16(
|
|
28871
28955
|
() => ({
|
|
28872
28956
|
merged: {
|
|
28873
28957
|
general: { vimMode: false },
|
|
@@ -28879,14 +28963,14 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28879
28963
|
[]
|
|
28880
28964
|
);
|
|
28881
28965
|
const configAdapter = configAdapterRef.current ?? new DeepCodeConfigAdapter(cwd);
|
|
28882
|
-
const isValidPath =
|
|
28966
|
+
const isValidPath = useCallback24(
|
|
28883
28967
|
(candidate) => {
|
|
28884
|
-
const resolved =
|
|
28885
|
-
const relative2 =
|
|
28886
|
-
if (relative2.startsWith("..") ||
|
|
28968
|
+
const resolved = path122.resolve(cwd, candidate);
|
|
28969
|
+
const relative2 = path122.relative(cwd, resolved);
|
|
28970
|
+
if (relative2.startsWith("..") || path122.isAbsolute(relative2)) {
|
|
28887
28971
|
return false;
|
|
28888
28972
|
}
|
|
28889
|
-
return
|
|
28973
|
+
return fs7.existsSync(resolved);
|
|
28890
28974
|
},
|
|
28891
28975
|
[cwd]
|
|
28892
28976
|
);
|
|
@@ -28897,18 +28981,19 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28897
28981
|
isValidPath,
|
|
28898
28982
|
shellModeActive
|
|
28899
28983
|
});
|
|
28900
|
-
const pendingGeminiHistoryItems =
|
|
28984
|
+
const pendingGeminiHistoryItems = useMemo16(
|
|
28901
28985
|
() => pendingAssistantText ? [{ type: "gemini", text: pendingAssistantText }] : [],
|
|
28902
28986
|
[pendingAssistantText]
|
|
28903
28987
|
);
|
|
28904
|
-
const userMessages =
|
|
28988
|
+
const userMessages = useMemo16(
|
|
28905
28989
|
() => historyManager.history.filter((item) => item.type === "user").map((item) => item.text),
|
|
28906
28990
|
[historyManager.history]
|
|
28907
28991
|
);
|
|
28908
|
-
const slashCommands =
|
|
28992
|
+
const slashCommands = useMemo16(
|
|
28909
28993
|
() => [
|
|
28910
28994
|
helpCommand,
|
|
28911
28995
|
clearCommand,
|
|
28996
|
+
undoCommand,
|
|
28912
28997
|
diffCommand,
|
|
28913
28998
|
providerCommand,
|
|
28914
28999
|
modelCommand,
|
|
@@ -28916,17 +29001,18 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28916
29001
|
settingsDialogCommand,
|
|
28917
29002
|
themeDialogCommand,
|
|
28918
29003
|
permissionsDialogCommand,
|
|
28919
|
-
authDialogCommand
|
|
29004
|
+
authDialogCommand,
|
|
29005
|
+
feedbackDialogCommand
|
|
28920
29006
|
],
|
|
28921
29007
|
[]
|
|
28922
29008
|
);
|
|
28923
|
-
const recentSlashCommands =
|
|
29009
|
+
const recentSlashCommands = useMemo16(
|
|
28924
29010
|
() => recentSlashCommandsState,
|
|
28925
29011
|
[recentSlashCommandsState]
|
|
28926
29012
|
);
|
|
28927
29013
|
const [promptSuggestion, setPromptSuggestion] = useState27(null);
|
|
28928
|
-
const dismissPromptSuggestion =
|
|
28929
|
-
const registerSlashCommandUsage =
|
|
29014
|
+
const dismissPromptSuggestion = useCallback24(() => setPromptSuggestion(null), []);
|
|
29015
|
+
const registerSlashCommandUsage = useCallback24((name) => {
|
|
28930
29016
|
setRecentSlashCommandsState((prev) => {
|
|
28931
29017
|
const next = new Map(prev);
|
|
28932
29018
|
const existing = next.get(name);
|
|
@@ -28938,8 +29024,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28938
29024
|
return next;
|
|
28939
29025
|
});
|
|
28940
29026
|
}, []);
|
|
28941
|
-
const listAvailableProviders =
|
|
28942
|
-
const getSessionCommandState =
|
|
29027
|
+
const listAvailableProviders = useCallback24(() => PROVIDER_IDS, []);
|
|
29028
|
+
const getSessionCommandState = useCallback24(() => {
|
|
28943
29029
|
const runtime = runtimeRef.current;
|
|
28944
29030
|
const session = sessionRef.current;
|
|
28945
29031
|
const fallbackProvider = runtime?.config.defaultProvider ?? PROVIDER_IDS[0];
|
|
@@ -28951,7 +29037,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28951
29037
|
mode: agentMode
|
|
28952
29038
|
};
|
|
28953
29039
|
}, [agentMode]);
|
|
28954
|
-
const setSessionProvider =
|
|
29040
|
+
const setSessionProvider = useCallback24((provider2) => {
|
|
28955
29041
|
const runtime = runtimeRef.current;
|
|
28956
29042
|
const session = sessionRef.current;
|
|
28957
29043
|
if (!runtime || !session) return;
|
|
@@ -28971,7 +29057,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28971
29057
|
);
|
|
28972
29058
|
}
|
|
28973
29059
|
}, [historyManager]);
|
|
28974
|
-
const setSessionModel =
|
|
29060
|
+
const setSessionModel = useCallback24((model2) => {
|
|
28975
29061
|
const runtime = runtimeRef.current;
|
|
28976
29062
|
const session = sessionRef.current;
|
|
28977
29063
|
if (!runtime || !session) return;
|
|
@@ -28982,10 +29068,10 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
28982
29068
|
setCurrentModel(session.model ?? "(unconfigured)");
|
|
28983
29069
|
setProviderLabel(formatProviderLabel(session.provider, session.model));
|
|
28984
29070
|
}, []);
|
|
28985
|
-
const setSessionMode =
|
|
29071
|
+
const setSessionMode = useCallback24((mode) => {
|
|
28986
29072
|
setAgentMode(mode);
|
|
28987
29073
|
}, []);
|
|
28988
|
-
const sessionCommandServices =
|
|
29074
|
+
const sessionCommandServices = useMemo16(
|
|
28989
29075
|
() => ({
|
|
28990
29076
|
getState: getSessionCommandState,
|
|
28991
29077
|
setProvider: setSessionProvider,
|
|
@@ -29001,7 +29087,13 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29001
29087
|
setSessionProvider
|
|
29002
29088
|
]
|
|
29003
29089
|
);
|
|
29004
|
-
const
|
|
29090
|
+
const handleUndo = useCallback24(async () => {
|
|
29091
|
+
const runtime = runtimeRef.current;
|
|
29092
|
+
const session = sessionRef.current;
|
|
29093
|
+
if (!runtime || !session) return null;
|
|
29094
|
+
return runtime.agent.undo(session.id);
|
|
29095
|
+
}, []);
|
|
29096
|
+
const commandContext = useMemo16(
|
|
29005
29097
|
() => ({
|
|
29006
29098
|
executionMode: "interactive",
|
|
29007
29099
|
services: {
|
|
@@ -29019,13 +29111,14 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29019
29111
|
loadHistory: historyManager.loadHistory,
|
|
29020
29112
|
toggleVimEnabled: async () => false,
|
|
29021
29113
|
reloadCommands: () => {
|
|
29022
|
-
}
|
|
29114
|
+
},
|
|
29115
|
+
undo: handleUndo
|
|
29023
29116
|
},
|
|
29024
29117
|
session: {
|
|
29025
29118
|
sessionShellAllowlist: sessionShellAllowlistRef.current
|
|
29026
29119
|
}
|
|
29027
29120
|
}),
|
|
29028
|
-
[configAdapter, historyManager, pendingItem, sessionCommandServices]
|
|
29121
|
+
[configAdapter, handleUndo, historyManager, pendingItem, sessionCommandServices]
|
|
29029
29122
|
);
|
|
29030
29123
|
useEffect25(() => {
|
|
29031
29124
|
messageQueueRef.current = messageQueue;
|
|
@@ -29230,7 +29323,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29230
29323
|
unsubscribeRef.current = [];
|
|
29231
29324
|
};
|
|
29232
29325
|
}, [addHistoryItem, config, cwd, model, provider]);
|
|
29233
|
-
const resolveApproval =
|
|
29326
|
+
const resolveApproval = useCallback24(
|
|
29234
29327
|
(decision) => {
|
|
29235
29328
|
const runtime = runtimeRef.current;
|
|
29236
29329
|
const current = approvalQueue[0];
|
|
@@ -29243,7 +29336,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29243
29336
|
},
|
|
29244
29337
|
[approvalQueue]
|
|
29245
29338
|
);
|
|
29246
|
-
const appendTurnItems =
|
|
29339
|
+
const appendTurnItems = useCallback24(
|
|
29247
29340
|
(items) => {
|
|
29248
29341
|
const base = Date.now();
|
|
29249
29342
|
for (const item of items) {
|
|
@@ -29252,7 +29345,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29252
29345
|
},
|
|
29253
29346
|
[historyManager]
|
|
29254
29347
|
);
|
|
29255
|
-
const runPrompt =
|
|
29348
|
+
const runPrompt = useCallback24(
|
|
29256
29349
|
async (rawPrompt) => {
|
|
29257
29350
|
const runtime = runtimeRef.current;
|
|
29258
29351
|
const session = sessionRef.current;
|
|
@@ -29343,7 +29436,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29343
29436
|
},
|
|
29344
29437
|
[agentMode, appendTurnItems, historyManager]
|
|
29345
29438
|
);
|
|
29346
|
-
const executeClientToolCommand =
|
|
29439
|
+
const executeClientToolCommand = useCallback24(
|
|
29347
29440
|
async (toolName, toolArgs) => {
|
|
29348
29441
|
const runtime = runtimeRef.current;
|
|
29349
29442
|
const session = sessionRef.current;
|
|
@@ -29436,7 +29529,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29436
29529
|
},
|
|
29437
29530
|
[agentMode, historyManager]
|
|
29438
29531
|
);
|
|
29439
|
-
const applySlashCommandResult =
|
|
29532
|
+
const applySlashCommandResult = useCallback24(
|
|
29440
29533
|
async (result, _rawInvocation) => {
|
|
29441
29534
|
if (!result) return;
|
|
29442
29535
|
switch (result.type) {
|
|
@@ -29497,7 +29590,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29497
29590
|
},
|
|
29498
29591
|
[appendTurnItems, executeClientToolCommand, historyManager, runPrompt]
|
|
29499
29592
|
);
|
|
29500
|
-
const executeSlashCommand =
|
|
29593
|
+
const executeSlashCommand = useCallback24(
|
|
29501
29594
|
async (rawInput, overwriteConfirmed = false) => {
|
|
29502
29595
|
const trimmed = rawInput.trim();
|
|
29503
29596
|
if (!trimmed.startsWith("/")) return false;
|
|
@@ -29570,7 +29663,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29570
29663
|
slashCommands
|
|
29571
29664
|
]
|
|
29572
29665
|
);
|
|
29573
|
-
const executeSubmission =
|
|
29666
|
+
const executeSubmission = useCallback24(
|
|
29574
29667
|
async (value) => {
|
|
29575
29668
|
const trimmed = value.trim();
|
|
29576
29669
|
if (!trimmed) return;
|
|
@@ -29580,7 +29673,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29580
29673
|
},
|
|
29581
29674
|
[executeSlashCommand, runPrompt]
|
|
29582
29675
|
);
|
|
29583
|
-
const handleFinalSubmit =
|
|
29676
|
+
const handleFinalSubmit = useCallback24(
|
|
29584
29677
|
(value) => {
|
|
29585
29678
|
const prompt = value.trim();
|
|
29586
29679
|
if (!prompt) return;
|
|
@@ -29606,7 +29699,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29606
29699
|
isRunning
|
|
29607
29700
|
]
|
|
29608
29701
|
);
|
|
29609
|
-
const handleRetryLastPrompt =
|
|
29702
|
+
const handleRetryLastPrompt = useCallback24(() => {
|
|
29610
29703
|
const lastPrompt = lastSubmittedPromptRef.current;
|
|
29611
29704
|
if (!lastPrompt) {
|
|
29612
29705
|
historyManager.addItem(
|
|
@@ -29621,7 +29714,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29621
29714
|
}
|
|
29622
29715
|
void runPrompt(lastPrompt);
|
|
29623
29716
|
}, [approvalQueue.length, historyManager, isInitializing, isRunning, runPrompt]);
|
|
29624
|
-
const resolveCommandConfirmation =
|
|
29717
|
+
const resolveCommandConfirmation = useCallback24(
|
|
29625
29718
|
(confirmed) => {
|
|
29626
29719
|
const pending = pendingCommandConfirmation;
|
|
29627
29720
|
if (!pending) return;
|
|
@@ -29652,7 +29745,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29652
29745
|
pendingCommandConfirmation
|
|
29653
29746
|
]
|
|
29654
29747
|
);
|
|
29655
|
-
const persistConfig =
|
|
29748
|
+
const persistConfig = useCallback24(
|
|
29656
29749
|
async (mutate) => {
|
|
29657
29750
|
const loader = new ConfigLoader();
|
|
29658
29751
|
const options = { cwd, configPath: config };
|
|
@@ -29661,7 +29754,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29661
29754
|
},
|
|
29662
29755
|
[config, cwd]
|
|
29663
29756
|
);
|
|
29664
|
-
const handleSelectTheme =
|
|
29757
|
+
const handleSelectTheme = useCallback24(
|
|
29665
29758
|
(nextThemeName) => {
|
|
29666
29759
|
themeManager.setActiveTheme(nextThemeName);
|
|
29667
29760
|
setThemeName(themeManager.getActiveTheme().name);
|
|
@@ -29682,7 +29775,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29682
29775
|
},
|
|
29683
29776
|
[cwd, historyManager]
|
|
29684
29777
|
);
|
|
29685
|
-
const handleSavePermissions =
|
|
29778
|
+
const handleSavePermissions = useCallback24(
|
|
29686
29779
|
(modes) => {
|
|
29687
29780
|
setPermissionModes(modes);
|
|
29688
29781
|
setPermissionSummary(formatPermissionSummary(modes));
|
|
@@ -29711,7 +29804,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29711
29804
|
},
|
|
29712
29805
|
[historyManager, persistConfig]
|
|
29713
29806
|
);
|
|
29714
|
-
const handlePersistToken =
|
|
29807
|
+
const handlePersistToken = useCallback24(
|
|
29715
29808
|
async (token) => {
|
|
29716
29809
|
await persistConfig((cfg) => ({
|
|
29717
29810
|
...cfg,
|
|
@@ -29725,12 +29818,12 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29725
29818
|
},
|
|
29726
29819
|
[persistConfig]
|
|
29727
29820
|
);
|
|
29728
|
-
const providerHasApiKey =
|
|
29821
|
+
const providerHasApiKey = useCallback24((provider2) => {
|
|
29729
29822
|
const runtime = runtimeRef.current;
|
|
29730
29823
|
void providerConfigVersion;
|
|
29731
29824
|
return Boolean(runtime?.config.providers[provider2]?.apiKey?.trim());
|
|
29732
29825
|
}, [providerConfigVersion]);
|
|
29733
|
-
const getProviderKeyHint =
|
|
29826
|
+
const getProviderKeyHint = useCallback24((provider2) => {
|
|
29734
29827
|
const runtime = runtimeRef.current;
|
|
29735
29828
|
void providerConfigVersion;
|
|
29736
29829
|
const key = runtime?.config.providers[provider2]?.apiKey?.trim();
|
|
@@ -29738,7 +29831,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29738
29831
|
if (key.length <= 8) return "\u25CF".repeat(key.length);
|
|
29739
29832
|
return `${key.slice(0, 6)}\u25CF\u25CF\u25CF\u25CF${key.slice(-4)}`;
|
|
29740
29833
|
}, [providerConfigVersion]);
|
|
29741
|
-
const handleSaveProviderApiKey =
|
|
29834
|
+
const handleSaveProviderApiKey = useCallback24(
|
|
29742
29835
|
async (provider2, apiKey) => {
|
|
29743
29836
|
await persistConfig((cfg) => ({
|
|
29744
29837
|
...cfg,
|
|
@@ -29763,7 +29856,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29763
29856
|
},
|
|
29764
29857
|
[historyManager, persistConfig]
|
|
29765
29858
|
);
|
|
29766
|
-
const handleSetDefaultProvider =
|
|
29859
|
+
const handleSetDefaultProvider = useCallback24(
|
|
29767
29860
|
async (provider2) => {
|
|
29768
29861
|
const runtime = runtimeRef.current;
|
|
29769
29862
|
const session = sessionRef.current;
|
|
@@ -29805,7 +29898,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29805
29898
|
},
|
|
29806
29899
|
[historyManager, persistConfig]
|
|
29807
29900
|
);
|
|
29808
|
-
const handleTestProvider =
|
|
29901
|
+
const handleTestProvider = useCallback24(
|
|
29809
29902
|
async (provider2) => {
|
|
29810
29903
|
const runtime = runtimeRef.current;
|
|
29811
29904
|
const session = sessionRef.current;
|
|
@@ -29853,7 +29946,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29853
29946
|
},
|
|
29854
29947
|
[]
|
|
29855
29948
|
);
|
|
29856
|
-
const handleFetchModels =
|
|
29949
|
+
const handleFetchModels = useCallback24(
|
|
29857
29950
|
async (provider2, signal) => {
|
|
29858
29951
|
const runtime = runtimeRef.current;
|
|
29859
29952
|
if (!runtime) throw new Error("Runtime not ready.");
|
|
@@ -29861,15 +29954,15 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29861
29954
|
},
|
|
29862
29955
|
[]
|
|
29863
29956
|
);
|
|
29864
|
-
const handleSelectModel =
|
|
29957
|
+
const handleSelectModel = useCallback24(
|
|
29865
29958
|
(modelId) => {
|
|
29866
29959
|
setSessionModel(modelId);
|
|
29867
29960
|
setActiveDialog(null);
|
|
29868
29961
|
},
|
|
29869
29962
|
[setSessionModel]
|
|
29870
29963
|
);
|
|
29871
|
-
const closeDialog =
|
|
29872
|
-
const previewTheme =
|
|
29964
|
+
const closeDialog = useCallback24(() => setActiveDialog(null), []);
|
|
29965
|
+
const previewTheme = useCallback24(() => setThemeVersion((version) => version + 1), []);
|
|
29873
29966
|
useEffect25(() => {
|
|
29874
29967
|
if (drainingQueueRef.current || isRunning || isInitializing || Boolean(initError) || approvalQueue.length > 0 || messageQueue.length === 0) {
|
|
29875
29968
|
return;
|
|
@@ -29941,7 +30034,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29941
30034
|
abortRef.current?.abort();
|
|
29942
30035
|
}
|
|
29943
30036
|
});
|
|
29944
|
-
const uiActions =
|
|
30037
|
+
const uiActions = useMemo16(
|
|
29945
30038
|
() => ({
|
|
29946
30039
|
refreshStatic: () => {
|
|
29947
30040
|
setHistoryRemountKey((prev) => prev + 1);
|
|
@@ -29956,7 +30049,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29956
30049
|
onSuggestionsVisibilityChange: () => {
|
|
29957
30050
|
},
|
|
29958
30051
|
vimHandleInput: () => false,
|
|
29959
|
-
temporaryCloseFeedbackDialog: () =>
|
|
30052
|
+
temporaryCloseFeedbackDialog: () => {
|
|
30053
|
+
},
|
|
29960
30054
|
popAllQueuedMessages: () => {
|
|
29961
30055
|
const queued = messageQueueRef.current;
|
|
29962
30056
|
if (queued.length === 0) return "";
|
|
@@ -29967,7 +30061,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29967
30061
|
}),
|
|
29968
30062
|
[handleFinalSubmit, handleRetryLastPrompt, historyManager]
|
|
29969
30063
|
);
|
|
29970
|
-
const dialogModel =
|
|
30064
|
+
const dialogModel = useMemo16(
|
|
29971
30065
|
() => buildDialogModel(activeDialog, {
|
|
29972
30066
|
cwd,
|
|
29973
30067
|
providerLabel,
|
|
@@ -29994,8 +30088,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
29994
30088
|
themeName
|
|
29995
30089
|
]
|
|
29996
30090
|
);
|
|
29997
|
-
const activeSubagents =
|
|
29998
|
-
const uiState =
|
|
30091
|
+
const activeSubagents = useMemo16(() => Array.from(subagentMap.values()), [subagentMap]);
|
|
30092
|
+
const uiState = useMemo16(
|
|
29999
30093
|
() => ({
|
|
30000
30094
|
history: historyManager.history,
|
|
30001
30095
|
historyManager,
|
|
@@ -30035,7 +30129,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30035
30129
|
mainControlsRef,
|
|
30036
30130
|
constrainHeight: false,
|
|
30037
30131
|
currentModel,
|
|
30038
|
-
sessionName:
|
|
30132
|
+
sessionName: path122.basename(cwd),
|
|
30039
30133
|
isConfigInitialized: !isInitializing && !initError,
|
|
30040
30134
|
sessionStats: {
|
|
30041
30135
|
lastPromptTokenCount,
|
|
@@ -30048,7 +30142,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30048
30142
|
isModelDialogOpen: activeDialog === "model",
|
|
30049
30143
|
isProviderDialogOpen: activeDialog === "provider",
|
|
30050
30144
|
isPermissionsDialogOpen: activeDialog === "permissions",
|
|
30051
|
-
isFeedbackDialogOpen,
|
|
30145
|
+
isFeedbackDialogOpen: false,
|
|
30052
30146
|
showAutoAcceptIndicator: "default",
|
|
30053
30147
|
mcpConnected,
|
|
30054
30148
|
mcpTotal,
|
|
@@ -30069,7 +30163,6 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30069
30163
|
historyManager,
|
|
30070
30164
|
historyRemountKey,
|
|
30071
30165
|
initError,
|
|
30072
|
-
isFeedbackDialogOpen,
|
|
30073
30166
|
isInitializing,
|
|
30074
30167
|
isReceivingContent,
|
|
30075
30168
|
iterationInfo,
|
|
@@ -30093,37 +30186,37 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30093
30186
|
userMessages
|
|
30094
30187
|
]
|
|
30095
30188
|
);
|
|
30096
|
-
return /* @__PURE__ */
|
|
30097
|
-
/* @__PURE__ */
|
|
30098
|
-
/* @__PURE__ */
|
|
30099
|
-
/* @__PURE__ */
|
|
30100
|
-
/* @__PURE__ */
|
|
30101
|
-
/* @__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: [
|
|
30102
30195
|
" (",
|
|
30103
30196
|
targetSource,
|
|
30104
30197
|
")"
|
|
30105
30198
|
] }),
|
|
30106
|
-
/* @__PURE__ */
|
|
30107
|
-
/* @__PURE__ */
|
|
30108
|
-
|
|
30199
|
+
/* @__PURE__ */ jsx49(Text48, { color: theme.text.secondary, children: " Mode: " }),
|
|
30200
|
+
/* @__PURE__ */ jsx49(
|
|
30201
|
+
Text48,
|
|
30109
30202
|
{
|
|
30110
30203
|
bold: true,
|
|
30111
30204
|
color: agentMode === "build" ? theme.status.success : theme.status.warning,
|
|
30112
30205
|
children: agentMode.toUpperCase()
|
|
30113
30206
|
}
|
|
30114
30207
|
),
|
|
30115
|
-
/* @__PURE__ */
|
|
30208
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30116
30209
|
" ",
|
|
30117
30210
|
streamingState === "responding" ? "running" : streamingState === "waiting_for_confirmation" ? "waiting-approval" : "idle"
|
|
30118
30211
|
] }),
|
|
30119
|
-
iterationInfo && /* @__PURE__ */
|
|
30212
|
+
iterationInfo && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30120
30213
|
" ",
|
|
30121
30214
|
"iter ",
|
|
30122
30215
|
iterationInfo.round,
|
|
30123
30216
|
"/",
|
|
30124
30217
|
iterationInfo.max
|
|
30125
30218
|
] }),
|
|
30126
|
-
lastPromptTokenCount > 0 && /* @__PURE__ */
|
|
30219
|
+
lastPromptTokenCount > 0 && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30127
30220
|
" ",
|
|
30128
30221
|
"\u2191",
|
|
30129
30222
|
formatTokenCount(lastPromptTokenCount),
|
|
@@ -30131,10 +30224,10 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30131
30224
|
formatTokenCount(lastOutputTokenCount)
|
|
30132
30225
|
] })
|
|
30133
30226
|
] }),
|
|
30134
|
-
initError ? /* @__PURE__ */
|
|
30227
|
+
initError ? /* @__PURE__ */ jsx49(Box40, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsxs45(Text48, { color: theme.status.error, children: [
|
|
30135
30228
|
"Failed to initialize runtime: ",
|
|
30136
30229
|
initError
|
|
30137
|
-
] }) }) : /* @__PURE__ */
|
|
30230
|
+
] }) }) : /* @__PURE__ */ jsx49(
|
|
30138
30231
|
MainContent,
|
|
30139
30232
|
{
|
|
30140
30233
|
history: historyManager.history,
|
|
@@ -30148,9 +30241,9 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30148
30241
|
},
|
|
30149
30242
|
historyRemountKey
|
|
30150
30243
|
),
|
|
30151
|
-
approvalQueue.length > 0 && /* @__PURE__ */
|
|
30152
|
-
dialogModel && /* @__PURE__ */
|
|
30153
|
-
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(
|
|
30154
30247
|
ProviderDialog,
|
|
30155
30248
|
{
|
|
30156
30249
|
providers: listAvailableProviders(),
|
|
@@ -30165,7 +30258,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30165
30258
|
onClose: closeDialog
|
|
30166
30259
|
}
|
|
30167
30260
|
),
|
|
30168
|
-
activeDialog === "model" && /* @__PURE__ */
|
|
30261
|
+
activeDialog === "model" && /* @__PURE__ */ jsx49(
|
|
30169
30262
|
ModelDialog,
|
|
30170
30263
|
{
|
|
30171
30264
|
currentProvider: getSessionCommandState().provider,
|
|
@@ -30175,7 +30268,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30175
30268
|
onClose: closeDialog
|
|
30176
30269
|
}
|
|
30177
30270
|
),
|
|
30178
|
-
activeDialog === "theme" && /* @__PURE__ */
|
|
30271
|
+
activeDialog === "theme" && /* @__PURE__ */ jsx49(
|
|
30179
30272
|
ThemeDialog,
|
|
30180
30273
|
{
|
|
30181
30274
|
onSelect: handleSelectTheme,
|
|
@@ -30183,7 +30276,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30183
30276
|
onPreview: previewTheme
|
|
30184
30277
|
}
|
|
30185
30278
|
),
|
|
30186
|
-
activeDialog === "permissions" && /* @__PURE__ */
|
|
30279
|
+
activeDialog === "permissions" && /* @__PURE__ */ jsx49(
|
|
30187
30280
|
PermissionsDialog,
|
|
30188
30281
|
{
|
|
30189
30282
|
current: permissionModes,
|
|
@@ -30191,7 +30284,7 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30191
30284
|
onClose: closeDialog
|
|
30192
30285
|
}
|
|
30193
30286
|
),
|
|
30194
|
-
activeDialog === "auth" && runtimeRef.current && /* @__PURE__ */
|
|
30287
|
+
activeDialog === "auth" && runtimeRef.current && /* @__PURE__ */ jsx49(
|
|
30195
30288
|
AuthDialog,
|
|
30196
30289
|
{
|
|
30197
30290
|
clientId: runtimeRef.current.config.github.oauthClientId,
|
|
@@ -30204,7 +30297,8 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30204
30297
|
onClose: closeDialog
|
|
30205
30298
|
}
|
|
30206
30299
|
),
|
|
30207
|
-
|
|
30300
|
+
activeDialog === "feedback" && /* @__PURE__ */ jsx49(FeedbackDialog, { cwd, onClose: closeDialog }),
|
|
30301
|
+
pendingCommandConfirmation && /* @__PURE__ */ jsx49(
|
|
30208
30302
|
CommandDialog,
|
|
30209
30303
|
{
|
|
30210
30304
|
title: "Confirm action",
|
|
@@ -30216,14 +30310,14 @@ var AppContainer = ({ cwd, config, provider, model }) => {
|
|
|
30216
30310
|
footerText: "Press y or Enter to confirm. Press n or Esc to cancel."
|
|
30217
30311
|
}
|
|
30218
30312
|
),
|
|
30219
|
-
/* @__PURE__ */
|
|
30313
|
+
/* @__PURE__ */ jsx49(
|
|
30220
30314
|
SubagentsPanel,
|
|
30221
30315
|
{
|
|
30222
30316
|
subagents: Array.from(subagentMap.values()),
|
|
30223
30317
|
mainAreaWidth
|
|
30224
30318
|
}
|
|
30225
30319
|
),
|
|
30226
|
-
/* @__PURE__ */
|
|
30320
|
+
/* @__PURE__ */ jsx49(Composer, {})
|
|
30227
30321
|
] }) }) }) }) }) }) }) }) }) }) }) });
|
|
30228
30322
|
};
|
|
30229
30323
|
function formatProviderLabel(provider, model) {
|
|
@@ -30263,14 +30357,14 @@ function formatPermissionSummary(config) {
|
|
|
30263
30357
|
return `read=${config.read}, write=${config.write}, shell=${config.shell}, dangerous=${config.dangerous}, gitLocal=${config.gitLocal}`;
|
|
30264
30358
|
}
|
|
30265
30359
|
function isInteractiveDialog(dialog) {
|
|
30266
|
-
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";
|
|
30267
30361
|
}
|
|
30268
30362
|
function tuiThemeFilePath(cwd) {
|
|
30269
|
-
return
|
|
30363
|
+
return path122.join(cwd, ".deepcode", "tui-theme.json");
|
|
30270
30364
|
}
|
|
30271
30365
|
function readSavedTheme(cwd) {
|
|
30272
30366
|
try {
|
|
30273
|
-
const parsed = JSON.parse(
|
|
30367
|
+
const parsed = JSON.parse(fs7.readFileSync(tuiThemeFilePath(cwd), "utf8"));
|
|
30274
30368
|
return typeof parsed.theme === "string" ? parsed.theme : null;
|
|
30275
30369
|
} catch {
|
|
30276
30370
|
return null;
|
|
@@ -30278,8 +30372,8 @@ function readSavedTheme(cwd) {
|
|
|
30278
30372
|
}
|
|
30279
30373
|
function writeSavedTheme(cwd, themeName) {
|
|
30280
30374
|
const file = tuiThemeFilePath(cwd);
|
|
30281
|
-
|
|
30282
|
-
|
|
30375
|
+
fs7.mkdirSync(path122.dirname(file), { recursive: true });
|
|
30376
|
+
fs7.writeFileSync(file, `${JSON.stringify({ theme: themeName }, null, 2)}
|
|
30283
30377
|
`);
|
|
30284
30378
|
}
|
|
30285
30379
|
function errorMessage(error) {
|
|
@@ -30308,7 +30402,7 @@ function buildDialogModel(dialog, options) {
|
|
|
30308
30402
|
]
|
|
30309
30403
|
};
|
|
30310
30404
|
}
|
|
30311
|
-
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") {
|
|
30312
30406
|
return null;
|
|
30313
30407
|
}
|
|
30314
30408
|
return {
|
|
@@ -30325,22 +30419,22 @@ function formatAuthSummary(config) {
|
|
|
30325
30419
|
var ApprovalPrompt = ({ request }) => {
|
|
30326
30420
|
if (!request) return null;
|
|
30327
30421
|
const operationLabel = formatApprovalOperationLabel(request);
|
|
30328
|
-
return /* @__PURE__ */
|
|
30329
|
-
/* @__PURE__ */
|
|
30422
|
+
return /* @__PURE__ */ jsxs45(Box40, { flexDirection: "column", marginTop: 1, children: [
|
|
30423
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.status.warning, children: [
|
|
30330
30424
|
"\u26A0 Allow ",
|
|
30331
30425
|
operationLabel,
|
|
30332
30426
|
"?"
|
|
30333
30427
|
] }),
|
|
30334
|
-
request.path && /* @__PURE__ */
|
|
30428
|
+
request.path && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30335
30429
|
" ",
|
|
30336
30430
|
request.path
|
|
30337
30431
|
] }),
|
|
30338
|
-
request.preview?.command && /* @__PURE__ */
|
|
30432
|
+
request.preview?.command && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
30339
30433
|
" $ ",
|
|
30340
30434
|
request.preview.command,
|
|
30341
30435
|
request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
|
|
30342
30436
|
] }),
|
|
30343
|
-
/* @__PURE__ */
|
|
30437
|
+
/* @__PURE__ */ jsx49(Text48, { color: theme.text.secondary, children: " [\u21B5/y] once [s] session [a] always [n] deny" })
|
|
30344
30438
|
] });
|
|
30345
30439
|
};
|
|
30346
30440
|
function formatApprovalOperationLabel(request) {
|
|
@@ -30401,7 +30495,7 @@ var DeepCodeConfigAdapter = class {
|
|
|
30401
30495
|
}
|
|
30402
30496
|
};
|
|
30403
30497
|
function App(props) {
|
|
30404
|
-
return /* @__PURE__ */
|
|
30498
|
+
return /* @__PURE__ */ jsx50(
|
|
30405
30499
|
AppContainer,
|
|
30406
30500
|
{
|
|
30407
30501
|
cwd: props.cwd,
|
|
@@ -30559,7 +30653,7 @@ function createProgram() {
|
|
|
30559
30653
|
});
|
|
30560
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) => {
|
|
30561
30655
|
render2(
|
|
30562
|
-
|
|
30656
|
+
React36.createElement(App, {
|
|
30563
30657
|
cwd: program.opts().cwd,
|
|
30564
30658
|
config: program.opts().config,
|
|
30565
30659
|
provider: options.provider,
|