osagent 0.1.23 → 0.1.25
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/cli.js +277 -143
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -146108,7 +146108,7 @@ function createContentGeneratorConfig(config, authType, generationConfig) {
|
|
|
146108
146108
|
};
|
|
146109
146109
|
}
|
|
146110
146110
|
async function createContentGenerator(config, gcConfig, sessionId2, isInitialAuth) {
|
|
146111
|
-
const version2 = "0.1.
|
|
146111
|
+
const version2 = "0.1.25";
|
|
146112
146112
|
const userAgent2 = `OSAgent/${version2} (${process.platform}; ${process.arch})`;
|
|
146113
146113
|
const baseHeaders = {
|
|
146114
146114
|
"User-Agent": userAgent2
|
|
@@ -239426,7 +239426,7 @@ var require_backend = __commonJS({
|
|
|
239426
239426
|
});
|
|
239427
239427
|
return a._currentValue;
|
|
239428
239428
|
}, "useContext"),
|
|
239429
|
-
useEffect: /* @__PURE__ */ __name(function
|
|
239429
|
+
useEffect: /* @__PURE__ */ __name(function useEffect61(a) {
|
|
239430
239430
|
C();
|
|
239431
239431
|
x.push({
|
|
239432
239432
|
primitive: "Effect",
|
|
@@ -239491,7 +239491,7 @@ var require_backend = __commonJS({
|
|
|
239491
239491
|
return [b, function() {
|
|
239492
239492
|
}];
|
|
239493
239493
|
}, "useReducer"),
|
|
239494
|
-
useRef: /* @__PURE__ */ __name(function
|
|
239494
|
+
useRef: /* @__PURE__ */ __name(function useRef23(a) {
|
|
239495
239495
|
var b = C();
|
|
239496
239496
|
a = null !== b ? b.memoizedState : {
|
|
239497
239497
|
current: a
|
|
@@ -294095,7 +294095,7 @@ var measureElement = /* @__PURE__ */ __name((node) => ({
|
|
|
294095
294095
|
var measure_element_default = measureElement;
|
|
294096
294096
|
|
|
294097
294097
|
// packages/cli/src/gemini.tsx
|
|
294098
|
-
var
|
|
294098
|
+
var import_react141 = __toESM(require_react(), 1);
|
|
294099
294099
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
294100
294100
|
import dns from "node:dns";
|
|
294101
294101
|
import os44 from "node:os";
|
|
@@ -309699,7 +309699,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
309699
309699
|
// packages/cli/src/utils/version.ts
|
|
309700
309700
|
async function getCliVersion() {
|
|
309701
309701
|
const pkgJson = await getPackageJson();
|
|
309702
|
-
return "0.1.
|
|
309702
|
+
return "0.1.25";
|
|
309703
309703
|
}
|
|
309704
309704
|
__name(getCliVersion, "getCliVersion");
|
|
309705
309705
|
|
|
@@ -323751,7 +323751,7 @@ __name(runNonInteractiveStreamJson, "runNonInteractiveStreamJson");
|
|
|
323751
323751
|
|
|
323752
323752
|
// packages/cli/src/ui/AppContainer.tsx
|
|
323753
323753
|
init_esbuild_shims();
|
|
323754
|
-
var
|
|
323754
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
323755
323755
|
|
|
323756
323756
|
// packages/cli/src/ui/App.tsx
|
|
323757
323757
|
init_esbuild_shims();
|
|
@@ -361541,17 +361541,143 @@ function useMessageQueue({
|
|
|
361541
361541
|
}
|
|
361542
361542
|
__name(useMessageQueue, "useMessageQueue");
|
|
361543
361543
|
|
|
361544
|
-
// packages/cli/src/ui/hooks/
|
|
361544
|
+
// packages/cli/src/ui/hooks/useConsultationGenerator.ts
|
|
361545
361545
|
init_esbuild_shims();
|
|
361546
361546
|
var import_react127 = __toESM(require_react(), 1);
|
|
361547
|
+
function useConsultationGenerator({
|
|
361548
|
+
streamingState,
|
|
361549
|
+
currentPrompt
|
|
361550
|
+
}) {
|
|
361551
|
+
const { addQuestion, isActive, consultationMode, clearContext } = useConsultation();
|
|
361552
|
+
const lastPromptRef = (0, import_react127.useRef)(void 0);
|
|
361553
|
+
const questionsGeneratedRef = (0, import_react127.useRef)(false);
|
|
361554
|
+
(0, import_react127.useEffect)(() => {
|
|
361555
|
+
if (!isActive || consultationMode === "passive") {
|
|
361556
|
+
return;
|
|
361557
|
+
}
|
|
361558
|
+
if (streamingState === "responding" /* Responding */ && currentPrompt && currentPrompt !== lastPromptRef.current && !questionsGeneratedRef.current) {
|
|
361559
|
+
lastPromptRef.current = currentPrompt;
|
|
361560
|
+
questionsGeneratedRef.current = true;
|
|
361561
|
+
const questions = analyzePromptForQuestions(currentPrompt);
|
|
361562
|
+
clearContext();
|
|
361563
|
+
questions.forEach((q) => addQuestion(q));
|
|
361564
|
+
}
|
|
361565
|
+
if (streamingState === "idle" /* Idle */) {
|
|
361566
|
+
questionsGeneratedRef.current = false;
|
|
361567
|
+
}
|
|
361568
|
+
}, [streamingState, currentPrompt, isActive, consultationMode, addQuestion, clearContext]);
|
|
361569
|
+
}
|
|
361570
|
+
__name(useConsultationGenerator, "useConsultationGenerator");
|
|
361571
|
+
function analyzePromptForQuestions(prompt) {
|
|
361572
|
+
const questions = [];
|
|
361573
|
+
const lowerPrompt = prompt.toLowerCase();
|
|
361574
|
+
if (lowerPrompt.includes("create") || lowerPrompt.includes("build") || lowerPrompt.includes("implement") || lowerPrompt.includes("add")) {
|
|
361575
|
+
if (lowerPrompt.includes("api") || lowerPrompt.includes("endpoint")) {
|
|
361576
|
+
questions.push({
|
|
361577
|
+
question: "Should the API follow REST conventions or use GraphQL?",
|
|
361578
|
+
priority: "high",
|
|
361579
|
+
category: "architecture"
|
|
361580
|
+
});
|
|
361581
|
+
questions.push({
|
|
361582
|
+
question: "What authentication method should be used?",
|
|
361583
|
+
context: "JWT, API keys, OAuth, or none",
|
|
361584
|
+
priority: "medium",
|
|
361585
|
+
category: "requirements"
|
|
361586
|
+
});
|
|
361587
|
+
}
|
|
361588
|
+
if (lowerPrompt.includes("component") || lowerPrompt.includes("ui")) {
|
|
361589
|
+
questions.push({
|
|
361590
|
+
question: "Should this component be reusable/generic?",
|
|
361591
|
+
priority: "medium",
|
|
361592
|
+
category: "architecture"
|
|
361593
|
+
});
|
|
361594
|
+
}
|
|
361595
|
+
if (lowerPrompt.includes("database") || lowerPrompt.includes("data")) {
|
|
361596
|
+
questions.push({
|
|
361597
|
+
question: "What database or storage solution should be used?",
|
|
361598
|
+
priority: "high",
|
|
361599
|
+
category: "architecture"
|
|
361600
|
+
});
|
|
361601
|
+
}
|
|
361602
|
+
if (questions.length === 0) {
|
|
361603
|
+
questions.push({
|
|
361604
|
+
question: "Are there existing patterns in this project I should follow?",
|
|
361605
|
+
priority: "medium",
|
|
361606
|
+
category: "architecture"
|
|
361607
|
+
});
|
|
361608
|
+
}
|
|
361609
|
+
}
|
|
361610
|
+
if (lowerPrompt.includes("fix") || lowerPrompt.includes("bug") || lowerPrompt.includes("error") || lowerPrompt.includes("issue")) {
|
|
361611
|
+
questions.push({
|
|
361612
|
+
question: "Can you describe the expected behavior vs actual behavior?",
|
|
361613
|
+
priority: "high",
|
|
361614
|
+
category: "clarification"
|
|
361615
|
+
});
|
|
361616
|
+
questions.push({
|
|
361617
|
+
question: "Are there any error messages or logs available?",
|
|
361618
|
+
priority: "medium",
|
|
361619
|
+
category: "clarification"
|
|
361620
|
+
});
|
|
361621
|
+
}
|
|
361622
|
+
if (lowerPrompt.includes("refactor") || lowerPrompt.includes("improve") || lowerPrompt.includes("optimize")) {
|
|
361623
|
+
questions.push({
|
|
361624
|
+
question: "What specific aspects need improvement?",
|
|
361625
|
+
context: "Performance, readability, maintainability",
|
|
361626
|
+
priority: "high",
|
|
361627
|
+
category: "requirements"
|
|
361628
|
+
});
|
|
361629
|
+
questions.push({
|
|
361630
|
+
question: "Should backward compatibility be maintained?",
|
|
361631
|
+
priority: "medium",
|
|
361632
|
+
category: "requirements"
|
|
361633
|
+
});
|
|
361634
|
+
}
|
|
361635
|
+
if (lowerPrompt.includes("test") || lowerPrompt.includes("testing")) {
|
|
361636
|
+
questions.push({
|
|
361637
|
+
question: "What testing framework should be used?",
|
|
361638
|
+
priority: "medium",
|
|
361639
|
+
category: "preference"
|
|
361640
|
+
});
|
|
361641
|
+
questions.push({
|
|
361642
|
+
question: "Should tests include edge cases and error scenarios?",
|
|
361643
|
+
priority: "low",
|
|
361644
|
+
category: "requirements"
|
|
361645
|
+
});
|
|
361646
|
+
}
|
|
361647
|
+
if (lowerPrompt.includes("style") || lowerPrompt.includes("design") || lowerPrompt.includes("beautiful") || lowerPrompt.includes("sexy") || lowerPrompt.includes("ui") || lowerPrompt.includes("ux")) {
|
|
361648
|
+
questions.push({
|
|
361649
|
+
question: "Are there brand guidelines or color schemes to follow?",
|
|
361650
|
+
priority: "medium",
|
|
361651
|
+
category: "preference"
|
|
361652
|
+
});
|
|
361653
|
+
questions.push({
|
|
361654
|
+
question: "Should the design be mobile-responsive?",
|
|
361655
|
+
priority: "medium",
|
|
361656
|
+
category: "requirements"
|
|
361657
|
+
});
|
|
361658
|
+
}
|
|
361659
|
+
if (questions.length === 0 && prompt.length > 50) {
|
|
361660
|
+
questions.push({
|
|
361661
|
+
question: "Are there any constraints or preferences I should know about?",
|
|
361662
|
+
priority: "low",
|
|
361663
|
+
category: "clarification"
|
|
361664
|
+
});
|
|
361665
|
+
}
|
|
361666
|
+
return questions.slice(0, 3);
|
|
361667
|
+
}
|
|
361668
|
+
__name(analyzePromptForQuestions, "analyzePromptForQuestions");
|
|
361669
|
+
|
|
361670
|
+
// packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
|
|
361671
|
+
init_esbuild_shims();
|
|
361672
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
361547
361673
|
function useAutoAcceptIndicator({
|
|
361548
361674
|
config,
|
|
361549
361675
|
addItem,
|
|
361550
361676
|
onApprovalModeChange
|
|
361551
361677
|
}) {
|
|
361552
361678
|
const currentConfigValue = config.getApprovalMode();
|
|
361553
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
361554
|
-
(0,
|
|
361679
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react128.useState)(currentConfigValue);
|
|
361680
|
+
(0, import_react128.useEffect)(() => {
|
|
361555
361681
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
361556
361682
|
}, [currentConfigValue]);
|
|
361557
361683
|
useKeypress(
|
|
@@ -361584,14 +361710,14 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
361584
361710
|
|
|
361585
361711
|
// packages/cli/src/ui/hooks/useWorkspaceMigration.ts
|
|
361586
361712
|
init_esbuild_shims();
|
|
361587
|
-
var
|
|
361713
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
361588
361714
|
import process50 from "node:process";
|
|
361589
361715
|
function useWorkspaceMigration(settings) {
|
|
361590
|
-
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0,
|
|
361591
|
-
const [workspaceExtensions, setWorkspaceExtensions] = (0,
|
|
361716
|
+
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0, import_react129.useState)(false);
|
|
361717
|
+
const [workspaceExtensions, setWorkspaceExtensions] = (0, import_react129.useState)(
|
|
361592
361718
|
[]
|
|
361593
361719
|
);
|
|
361594
|
-
(0,
|
|
361720
|
+
(0, import_react129.useEffect)(() => {
|
|
361595
361721
|
if (!(settings.merged.experimental?.extensionManagement ?? true)) {
|
|
361596
361722
|
return;
|
|
361597
361723
|
}
|
|
@@ -361633,13 +361759,13 @@ __name(useWorkspaceMigration, "useWorkspaceMigration");
|
|
|
361633
361759
|
|
|
361634
361760
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
361635
361761
|
init_esbuild_shims();
|
|
361636
|
-
var
|
|
361762
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
361637
361763
|
import fs96 from "node:fs";
|
|
361638
361764
|
import fsPromises7 from "node:fs/promises";
|
|
361639
361765
|
import path111 from "node:path";
|
|
361640
361766
|
function useGitBranchName(cwd7) {
|
|
361641
|
-
const [branchName, setBranchName] = (0,
|
|
361642
|
-
const fetchBranchName = (0,
|
|
361767
|
+
const [branchName, setBranchName] = (0, import_react130.useState)(void 0);
|
|
361768
|
+
const fetchBranchName = (0, import_react130.useCallback)(async () => {
|
|
361643
361769
|
try {
|
|
361644
361770
|
if (!isCommandAvailable("git").available) {
|
|
361645
361771
|
return;
|
|
@@ -361664,7 +361790,7 @@ function useGitBranchName(cwd7) {
|
|
|
361664
361790
|
setBranchName(void 0);
|
|
361665
361791
|
}
|
|
361666
361792
|
}, [cwd7, setBranchName]);
|
|
361667
|
-
(0,
|
|
361793
|
+
(0, import_react130.useEffect)(() => {
|
|
361668
361794
|
fetchBranchName();
|
|
361669
361795
|
const gitLogsHeadPath = path111.join(cwd7, ".git", "logs", "HEAD");
|
|
361670
361796
|
let watcher;
|
|
@@ -361690,7 +361816,7 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
361690
361816
|
|
|
361691
361817
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
361692
361818
|
init_esbuild_shims();
|
|
361693
|
-
var
|
|
361819
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
361694
361820
|
function confirmationRequestsReducer(state, action) {
|
|
361695
361821
|
switch (action.type) {
|
|
361696
361822
|
case "add":
|
|
@@ -361704,15 +361830,15 @@ function confirmationRequestsReducer(state, action) {
|
|
|
361704
361830
|
}
|
|
361705
361831
|
__name(confirmationRequestsReducer, "confirmationRequestsReducer");
|
|
361706
361832
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) => {
|
|
361707
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
361833
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react131.useReducer)(
|
|
361708
361834
|
extensionUpdatesReducer,
|
|
361709
361835
|
initialExtensionUpdatesState
|
|
361710
361836
|
);
|
|
361711
361837
|
const [
|
|
361712
361838
|
confirmUpdateExtensionRequests,
|
|
361713
361839
|
dispatchConfirmUpdateExtensionRequests
|
|
361714
|
-
] = (0,
|
|
361715
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
361840
|
+
] = (0, import_react131.useReducer)(confirmationRequestsReducer, []);
|
|
361841
|
+
const addConfirmUpdateExtensionRequest = (0, import_react131.useCallback)(
|
|
361716
361842
|
(original) => {
|
|
361717
361843
|
const wrappedRequest = {
|
|
361718
361844
|
prompt: original.prompt,
|
|
@@ -361731,7 +361857,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
361731
361857
|
},
|
|
361732
361858
|
[dispatchConfirmUpdateExtensionRequests]
|
|
361733
361859
|
);
|
|
361734
|
-
(0,
|
|
361860
|
+
(0, import_react131.useEffect)(() => {
|
|
361735
361861
|
(async () => {
|
|
361736
361862
|
await checkForAllExtensionUpdates(
|
|
361737
361863
|
extensions,
|
|
@@ -361739,7 +361865,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
361739
361865
|
);
|
|
361740
361866
|
})();
|
|
361741
361867
|
}, [extensions, extensions.length, dispatchExtensionStateUpdate]);
|
|
361742
|
-
(0,
|
|
361868
|
+
(0, import_react131.useEffect)(() => {
|
|
361743
361869
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
361744
361870
|
return;
|
|
361745
361871
|
}
|
|
@@ -361804,7 +361930,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
361804
361930
|
addItem,
|
|
361805
361931
|
cwd7
|
|
361806
361932
|
]);
|
|
361807
|
-
const extensionsUpdateStateComputed = (0,
|
|
361933
|
+
const extensionsUpdateStateComputed = (0, import_react131.useMemo)(() => {
|
|
361808
361934
|
const result = /* @__PURE__ */ new Map();
|
|
361809
361935
|
for (const [
|
|
361810
361936
|
key,
|
|
@@ -361825,13 +361951,13 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
361825
361951
|
|
|
361826
361952
|
// packages/cli/src/ui/hooks/useQuitConfirmation.ts
|
|
361827
361953
|
init_esbuild_shims();
|
|
361828
|
-
var
|
|
361954
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
361829
361955
|
var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
361830
|
-
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0,
|
|
361831
|
-
const showQuitConfirmation = (0,
|
|
361956
|
+
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0, import_react132.useState)(false);
|
|
361957
|
+
const showQuitConfirmation = (0, import_react132.useCallback)(() => {
|
|
361832
361958
|
setIsQuitConfirmationOpen(true);
|
|
361833
361959
|
}, []);
|
|
361834
|
-
const handleQuitConfirmationSelect = (0,
|
|
361960
|
+
const handleQuitConfirmationSelect = (0, import_react132.useCallback)((choice2) => {
|
|
361835
361961
|
setIsQuitConfirmationOpen(false);
|
|
361836
361962
|
if (choice2 === "cancel" /* CANCEL */) {
|
|
361837
361963
|
return { shouldQuit: false, action: "cancel" };
|
|
@@ -361853,14 +361979,14 @@ var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
|
361853
361979
|
|
|
361854
361980
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
361855
361981
|
init_esbuild_shims();
|
|
361856
|
-
var
|
|
361982
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
361857
361983
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
361858
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
361859
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
361860
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
361861
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
361862
|
-
const [inputFillText, setInputFillText] = (0,
|
|
361863
|
-
const checkWelcomeBack = (0,
|
|
361984
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react133.useState)(null);
|
|
361985
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react133.useState)(false);
|
|
361986
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react133.useState)(null);
|
|
361987
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react133.useState)(false);
|
|
361988
|
+
const [inputFillText, setInputFillText] = (0, import_react133.useState)(null);
|
|
361989
|
+
const checkWelcomeBack = (0, import_react133.useCallback)(async () => {
|
|
361864
361990
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
361865
361991
|
return;
|
|
361866
361992
|
}
|
|
@@ -361874,7 +362000,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
361874
362000
|
console.debug("Welcome back check failed:", error);
|
|
361875
362001
|
}
|
|
361876
362002
|
}, [settings.ui?.enableWelcomeBack]);
|
|
361877
|
-
const handleWelcomeBackSelection = (0,
|
|
362003
|
+
const handleWelcomeBackSelection = (0, import_react133.useCallback)(
|
|
361878
362004
|
(choice2) => {
|
|
361879
362005
|
setWelcomeBackChoice(choice2);
|
|
361880
362006
|
setShowWelcomeBackDialog(false);
|
|
@@ -361886,21 +362012,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
361886
362012
|
},
|
|
361887
362013
|
[welcomeBackInfo]
|
|
361888
362014
|
);
|
|
361889
|
-
const handleWelcomeBackClose = (0,
|
|
362015
|
+
const handleWelcomeBackClose = (0, import_react133.useCallback)(() => {
|
|
361890
362016
|
setWelcomeBackChoice("restart");
|
|
361891
362017
|
setShowWelcomeBackDialog(false);
|
|
361892
362018
|
}, []);
|
|
361893
|
-
const clearInputFill = (0,
|
|
362019
|
+
const clearInputFill = (0, import_react133.useCallback)(() => {
|
|
361894
362020
|
setShouldFillInput(false);
|
|
361895
362021
|
setInputFillText(null);
|
|
361896
362022
|
}, []);
|
|
361897
|
-
(0,
|
|
362023
|
+
(0, import_react133.useEffect)(() => {
|
|
361898
362024
|
if (shouldFillInput && inputFillText) {
|
|
361899
362025
|
buffer.setText(inputFillText);
|
|
361900
362026
|
clearInputFill();
|
|
361901
362027
|
}
|
|
361902
362028
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
361903
|
-
(0,
|
|
362029
|
+
(0, import_react133.useEffect)(() => {
|
|
361904
362030
|
checkWelcomeBack();
|
|
361905
362031
|
}, [checkWelcomeBack]);
|
|
361906
362032
|
return {
|
|
@@ -361921,9 +362047,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
361921
362047
|
|
|
361922
362048
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
361923
362049
|
init_esbuild_shims();
|
|
361924
|
-
var
|
|
362050
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
361925
362051
|
function useDialogClose(options2) {
|
|
361926
|
-
const closeAnyOpenDialog = (0,
|
|
362052
|
+
const closeAnyOpenDialog = (0, import_react134.useCallback)(() => {
|
|
361927
362053
|
if (options2.isThemeDialogOpen) {
|
|
361928
362054
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
361929
362055
|
return true;
|
|
@@ -361955,14 +362081,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
361955
362081
|
|
|
361956
362082
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
361957
362083
|
init_esbuild_shims();
|
|
361958
|
-
var
|
|
362084
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
361959
362085
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
361960
|
-
const hasHandled = (0,
|
|
361961
|
-
const authErrorRef = (0,
|
|
361962
|
-
const onAuthErrorRef = (0,
|
|
362086
|
+
const hasHandled = (0, import_react135.useRef)(false);
|
|
362087
|
+
const authErrorRef = (0, import_react135.useRef)(authError);
|
|
362088
|
+
const onAuthErrorRef = (0, import_react135.useRef)(onAuthError);
|
|
361963
362089
|
authErrorRef.current = authError;
|
|
361964
362090
|
onAuthErrorRef.current = onAuthError;
|
|
361965
|
-
(0,
|
|
362091
|
+
(0, import_react135.useEffect)(() => {
|
|
361966
362092
|
if (hasHandled.current) {
|
|
361967
362093
|
return;
|
|
361968
362094
|
}
|
|
@@ -361975,13 +362101,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
361975
362101
|
|
|
361976
362102
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
361977
362103
|
init_esbuild_shims();
|
|
361978
|
-
var
|
|
362104
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
361979
362105
|
function useSubagentCreateDialog() {
|
|
361980
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
361981
|
-
const openSubagentCreateDialog = (0,
|
|
362106
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react136.useState)(false);
|
|
362107
|
+
const openSubagentCreateDialog = (0, import_react136.useCallback)(() => {
|
|
361982
362108
|
setIsSubagentCreateDialogOpen(true);
|
|
361983
362109
|
}, []);
|
|
361984
|
-
const closeSubagentCreateDialog = (0,
|
|
362110
|
+
const closeSubagentCreateDialog = (0, import_react136.useCallback)(() => {
|
|
361985
362111
|
setIsSubagentCreateDialogOpen(false);
|
|
361986
362112
|
}, []);
|
|
361987
362113
|
return {
|
|
@@ -361994,13 +362120,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
361994
362120
|
|
|
361995
362121
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
361996
362122
|
init_esbuild_shims();
|
|
361997
|
-
var
|
|
362123
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
361998
362124
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
361999
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
362000
|
-
const openAgentsManagerDialog = (0,
|
|
362125
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react137.useState)(false);
|
|
362126
|
+
const openAgentsManagerDialog = (0, import_react137.useCallback)(() => {
|
|
362001
362127
|
setIsAgentsManagerDialogOpen(true);
|
|
362002
362128
|
}, []);
|
|
362003
|
-
const closeAgentsManagerDialog = (0,
|
|
362129
|
+
const closeAgentsManagerDialog = (0, import_react137.useCallback)(() => {
|
|
362004
362130
|
setIsAgentsManagerDialogOpen(false);
|
|
362005
362131
|
}, []);
|
|
362006
362132
|
return {
|
|
@@ -362012,7 +362138,7 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
362012
362138
|
|
|
362013
362139
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
362014
362140
|
init_esbuild_shims();
|
|
362015
|
-
var
|
|
362141
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
362016
362142
|
|
|
362017
362143
|
// packages/cli/src/utils/attentionNotification.ts
|
|
362018
362144
|
init_esbuild_shims();
|
|
@@ -362040,9 +362166,9 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
362040
362166
|
streamingState,
|
|
362041
362167
|
elapsedTime
|
|
362042
362168
|
}) => {
|
|
362043
|
-
const awaitingNotificationSentRef = (0,
|
|
362044
|
-
const respondingElapsedRef = (0,
|
|
362045
|
-
(0,
|
|
362169
|
+
const awaitingNotificationSentRef = (0, import_react138.useRef)(false);
|
|
362170
|
+
const respondingElapsedRef = (0, import_react138.useRef)(0);
|
|
362171
|
+
(0, import_react138.useEffect)(() => {
|
|
362046
362172
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
362047
362173
|
notifyTerminalAttention("tool_approval" /* ToolApproval */);
|
|
362048
362174
|
awaitingNotificationSentRef.current = true;
|
|
@@ -362051,7 +362177,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
362051
362177
|
awaitingNotificationSentRef.current = false;
|
|
362052
362178
|
}
|
|
362053
362179
|
}, [isFocused, streamingState]);
|
|
362054
|
-
(0,
|
|
362180
|
+
(0, import_react138.useEffect)(() => {
|
|
362055
362181
|
if (streamingState === "responding" /* Responding */) {
|
|
362056
362182
|
respondingElapsedRef.current = elapsedTime;
|
|
362057
362183
|
return;
|
|
@@ -362087,25 +362213,25 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362087
362213
|
const { settings, config, initializationResult } = props;
|
|
362088
362214
|
const historyManager = useHistory();
|
|
362089
362215
|
useMemoryMonitor(historyManager);
|
|
362090
|
-
const [corgiMode, setCorgiMode] = (0,
|
|
362091
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
362092
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
362093
|
-
const [themeError, setThemeError] = (0,
|
|
362216
|
+
const [corgiMode, setCorgiMode] = (0, import_react139.useState)(false);
|
|
362217
|
+
const [debugMessage, setDebugMessage] = (0, import_react139.useState)("");
|
|
362218
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react139.useState)(null);
|
|
362219
|
+
const [themeError, setThemeError] = (0, import_react139.useState)(
|
|
362094
362220
|
initializationResult.themeError
|
|
362095
362221
|
);
|
|
362096
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
362097
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
362098
|
-
const [OSAMdFileCount, setOSAMdFileCount] = (0,
|
|
362222
|
+
const [isProcessing, setIsProcessing] = (0, import_react139.useState)(false);
|
|
362223
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react139.useState)(false);
|
|
362224
|
+
const [OSAMdFileCount, setOSAMdFileCount] = (0, import_react139.useState)(
|
|
362099
362225
|
initializationResult.OSAMdFileCount
|
|
362100
362226
|
);
|
|
362101
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
362102
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
362103
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
362104
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
362105
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
362227
|
+
const [shellModeActive, setShellModeActive] = (0, import_react139.useState)(false);
|
|
362228
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react139.useState)(false);
|
|
362229
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react139.useState)(0);
|
|
362230
|
+
const [updateInfo, setUpdateInfo] = (0, import_react139.useState)(null);
|
|
362231
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react139.useState)(
|
|
362106
362232
|
config.isTrustedFolder()
|
|
362107
362233
|
);
|
|
362108
|
-
const [systemPromptPreset, setSystemPromptPreset] = (0,
|
|
362234
|
+
const [systemPromptPreset, setSystemPromptPreset] = (0, import_react139.useState)(
|
|
362109
362235
|
null
|
|
362110
362236
|
);
|
|
362111
362237
|
const extensions = config.getExtensions();
|
|
@@ -362120,38 +362246,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362120
362246
|
historyManager.addItem,
|
|
362121
362247
|
config.getWorkingDir()
|
|
362122
362248
|
);
|
|
362123
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
362124
|
-
const openPermissionsDialog = (0,
|
|
362249
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react139.useState)(false);
|
|
362250
|
+
const openPermissionsDialog = (0, import_react139.useCallback)(
|
|
362125
362251
|
() => setPermissionsDialogOpen(true),
|
|
362126
362252
|
[]
|
|
362127
362253
|
);
|
|
362128
|
-
const closePermissionsDialog = (0,
|
|
362254
|
+
const closePermissionsDialog = (0, import_react139.useCallback)(
|
|
362129
362255
|
() => setPermissionsDialogOpen(false),
|
|
362130
362256
|
[]
|
|
362131
362257
|
);
|
|
362132
|
-
const getEffectiveModel2 = (0,
|
|
362258
|
+
const getEffectiveModel2 = (0, import_react139.useCallback)(() => {
|
|
362133
362259
|
if (config.isInFallbackMode()) {
|
|
362134
362260
|
return DEFAULT_OSA_FLASH_MODEL;
|
|
362135
362261
|
}
|
|
362136
362262
|
return config.getModel();
|
|
362137
362263
|
}, [config]);
|
|
362138
|
-
const [currentModel, setCurrentModel] = (0,
|
|
362139
|
-
const [userTier] = (0,
|
|
362140
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
362264
|
+
const [currentModel, setCurrentModel] = (0, import_react139.useState)(getEffectiveModel2());
|
|
362265
|
+
const [userTier] = (0, import_react139.useState)(void 0);
|
|
362266
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react139.useState)(false);
|
|
362141
362267
|
const logger6 = useLogger(config.storage);
|
|
362142
|
-
const [userMessages, setUserMessages] = (0,
|
|
362268
|
+
const [userMessages, setUserMessages] = (0, import_react139.useState)([]);
|
|
362143
362269
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
362144
362270
|
const { stdin, setRawMode } = use_stdin_default();
|
|
362145
362271
|
const { stdout } = use_stdout_default();
|
|
362146
362272
|
const { stats: sessionStats } = useSessionStats();
|
|
362147
362273
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
362148
|
-
const mainControlsRef = (0,
|
|
362149
|
-
const originalTitleRef = (0,
|
|
362274
|
+
const mainControlsRef = (0, import_react139.useRef)(null);
|
|
362275
|
+
const originalTitleRef = (0, import_react139.useRef)(
|
|
362150
362276
|
computeWindowTitle(basename14(config.getTargetDir()))
|
|
362151
362277
|
);
|
|
362152
|
-
const lastTitleRef = (0,
|
|
362278
|
+
const lastTitleRef = (0, import_react139.useRef)(null);
|
|
362153
362279
|
const staticExtraHeight = 3;
|
|
362154
|
-
(0,
|
|
362280
|
+
(0, import_react139.useEffect)(() => {
|
|
362155
362281
|
(async () => {
|
|
362156
362282
|
await config.initialize();
|
|
362157
362283
|
setConfigInitialized(true);
|
|
@@ -362161,11 +362287,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362161
362287
|
await ideClient.disconnect();
|
|
362162
362288
|
});
|
|
362163
362289
|
}, [config]);
|
|
362164
|
-
(0,
|
|
362290
|
+
(0, import_react139.useEffect)(
|
|
362165
362291
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
362166
362292
|
[historyManager.addItem]
|
|
362167
362293
|
);
|
|
362168
|
-
(0,
|
|
362294
|
+
(0, import_react139.useEffect)(() => {
|
|
362169
362295
|
const checkModelChange = /* @__PURE__ */ __name(() => {
|
|
362170
362296
|
const effectiveModel = getEffectiveModel2();
|
|
362171
362297
|
if (effectiveModel !== currentModel) {
|
|
@@ -362181,7 +362307,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362181
362307
|
handleNewMessage,
|
|
362182
362308
|
clearConsoleMessages: clearConsoleMessagesState
|
|
362183
362309
|
} = useConsoleMessages();
|
|
362184
|
-
(0,
|
|
362310
|
+
(0, import_react139.useEffect)(() => {
|
|
362185
362311
|
const consolePatcher = new ConsolePatcher({
|
|
362186
362312
|
onNewMessage: handleNewMessage,
|
|
362187
362313
|
debugMode: config.getDebugMode()
|
|
@@ -362189,13 +362315,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362189
362315
|
consolePatcher.patch();
|
|
362190
362316
|
registerCleanup(consolePatcher.cleanup);
|
|
362191
362317
|
}, [handleNewMessage, config]);
|
|
362192
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
362318
|
+
const { inputWidth, suggestionsWidth } = (0, import_react139.useMemo)(() => {
|
|
362193
362319
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
362194
362320
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
362195
362321
|
}, [terminalWidth]);
|
|
362196
362322
|
const mainAreaWidth = Math.floor(terminalWidth * 0.9);
|
|
362197
362323
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
362198
|
-
const isValidPath = (0,
|
|
362324
|
+
const isValidPath = (0, import_react139.useCallback)((filePath) => {
|
|
362199
362325
|
try {
|
|
362200
362326
|
return fs97.existsSync(filePath) && fs97.statSync(filePath).isFile();
|
|
362201
362327
|
} catch (_e) {
|
|
@@ -362210,7 +362336,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362210
362336
|
isValidPath,
|
|
362211
362337
|
shellModeActive
|
|
362212
362338
|
});
|
|
362213
|
-
(0,
|
|
362339
|
+
(0, import_react139.useEffect)(() => {
|
|
362214
362340
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
362215
362341
|
const pastMessagesRaw = await logger6?.getPreviousUserMessages() || [];
|
|
362216
362342
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -362233,7 +362359,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362233
362359
|
}, "fetchUserMessages");
|
|
362234
362360
|
fetchUserMessages();
|
|
362235
362361
|
}, [historyManager.history, logger6]);
|
|
362236
|
-
const refreshStatic = (0,
|
|
362362
|
+
const refreshStatic = (0, import_react139.useCallback)(() => {
|
|
362237
362363
|
stdout.write(base_exports.clearTerminal);
|
|
362238
362364
|
setHistoryRemountKey((prev) => prev + 1);
|
|
362239
362365
|
}, [setHistoryRemountKey, stdout]);
|
|
@@ -362273,7 +362399,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362273
362399
|
setModelSwitchedFromQuotaError
|
|
362274
362400
|
});
|
|
362275
362401
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
362276
|
-
(0,
|
|
362402
|
+
(0, import_react139.useEffect)(() => {
|
|
362277
362403
|
if (settings.merged.security?.auth?.enforcedType && settings.merged.security?.auth.selectedType && settings.merged.security?.auth.enforcedType !== settings.merged.security?.auth.selectedType) {
|
|
362278
362404
|
onAuthError(
|
|
362279
362405
|
t2(
|
|
@@ -362300,7 +362426,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362300
362426
|
settings.merged.security?.auth?.useExternal,
|
|
362301
362427
|
onAuthError
|
|
362302
362428
|
]);
|
|
362303
|
-
const [editorError, setEditorError] = (0,
|
|
362429
|
+
const [editorError, setEditorError] = (0, import_react139.useState)(null);
|
|
362304
362430
|
const {
|
|
362305
362431
|
isEditorDialogOpen,
|
|
362306
362432
|
openEditorDialog,
|
|
@@ -362327,9 +362453,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362327
362453
|
openAgentsManagerDialog,
|
|
362328
362454
|
closeAgentsManagerDialog
|
|
362329
362455
|
} = useAgentsManagerDialog();
|
|
362330
|
-
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0,
|
|
362331
|
-
const [visionSwitchResolver, setVisionSwitchResolver] = (0,
|
|
362332
|
-
const slashCommandActions = (0,
|
|
362456
|
+
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0, import_react139.useState)(false);
|
|
362457
|
+
const [visionSwitchResolver, setVisionSwitchResolver] = (0, import_react139.useState)(null);
|
|
362458
|
+
const slashCommandActions = (0, import_react139.useMemo)(
|
|
362333
362459
|
() => ({
|
|
362334
362460
|
openAuthDialog,
|
|
362335
362461
|
openThemeDialog,
|
|
@@ -362394,14 +362520,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362394
362520
|
extensionsUpdateStateInternal,
|
|
362395
362521
|
isConfigInitialized
|
|
362396
362522
|
);
|
|
362397
|
-
const handleVisionSwitchRequired = (0,
|
|
362523
|
+
const handleVisionSwitchRequired = (0, import_react139.useCallback)(
|
|
362398
362524
|
async (_query) => new Promise((resolve25, reject) => {
|
|
362399
362525
|
setVisionSwitchResolver({ resolve: resolve25, reject });
|
|
362400
362526
|
setIsVisionSwitchDialogOpen(true);
|
|
362401
362527
|
}),
|
|
362402
362528
|
[]
|
|
362403
362529
|
);
|
|
362404
|
-
const handleVisionSwitchSelect = (0,
|
|
362530
|
+
const handleVisionSwitchSelect = (0, import_react139.useCallback)(
|
|
362405
362531
|
(outcome) => {
|
|
362406
362532
|
setIsVisionSwitchDialogOpen(false);
|
|
362407
362533
|
if (visionSwitchResolver) {
|
|
@@ -362412,10 +362538,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362412
362538
|
},
|
|
362413
362539
|
[visionSwitchResolver]
|
|
362414
362540
|
);
|
|
362415
|
-
const onDebugMessage = (0,
|
|
362541
|
+
const onDebugMessage = (0, import_react139.useCallback)((message2) => {
|
|
362416
362542
|
console.debug(message2);
|
|
362417
362543
|
}, []);
|
|
362418
|
-
const performMemoryRefresh = (0,
|
|
362544
|
+
const performMemoryRefresh = (0, import_react139.useCallback)(async () => {
|
|
362419
362545
|
historyManager.addItem(
|
|
362420
362546
|
{
|
|
362421
362547
|
type: "info" /* INFO */,
|
|
@@ -362466,7 +362592,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362466
362592
|
console.error("Error refreshing memory:", error);
|
|
362467
362593
|
}
|
|
362468
362594
|
}, [config, historyManager, settings.merged]);
|
|
362469
|
-
const cancelHandlerRef = (0,
|
|
362595
|
+
const cancelHandlerRef = (0, import_react139.useRef)(() => {
|
|
362470
362596
|
});
|
|
362471
362597
|
const {
|
|
362472
362598
|
streamingState,
|
|
@@ -362513,8 +362639,16 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362513
362639
|
streamingState,
|
|
362514
362640
|
submitQuery
|
|
362515
362641
|
});
|
|
362516
|
-
const
|
|
362642
|
+
const [currentPrompt, setCurrentPrompt] = (0, import_react139.useState)(
|
|
362643
|
+
void 0
|
|
362644
|
+
);
|
|
362645
|
+
useConsultationGenerator({
|
|
362646
|
+
streamingState,
|
|
362647
|
+
currentPrompt
|
|
362648
|
+
});
|
|
362649
|
+
const handleFinalSubmit = (0, import_react139.useCallback)(
|
|
362517
362650
|
(submittedValue) => {
|
|
362651
|
+
setCurrentPrompt(submittedValue);
|
|
362518
362652
|
addMessage(submittedValue);
|
|
362519
362653
|
},
|
|
362520
362654
|
[addMessage]
|
|
@@ -362526,7 +362660,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362526
362660
|
handleWelcomeBackSelection,
|
|
362527
362661
|
handleWelcomeBackClose
|
|
362528
362662
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
362529
|
-
cancelHandlerRef.current = (0,
|
|
362663
|
+
cancelHandlerRef.current = (0, import_react139.useCallback)(() => {
|
|
362530
362664
|
const pendingHistoryItems2 = [
|
|
362531
362665
|
...pendingSlashCommandHistoryItems,
|
|
362532
362666
|
...pendingOSAHistoryItems
|
|
@@ -362555,7 +362689,7 @@ ${queuedText}` : queuedText;
|
|
|
362555
362689
|
pendingSlashCommandHistoryItems,
|
|
362556
362690
|
pendingOSAHistoryItems
|
|
362557
362691
|
]);
|
|
362558
|
-
const handleClearScreen = (0,
|
|
362692
|
+
const handleClearScreen = (0, import_react139.useCallback)(() => {
|
|
362559
362693
|
historyManager.clearItems();
|
|
362560
362694
|
clearConsoleMessagesState();
|
|
362561
362695
|
console.clear();
|
|
@@ -362563,8 +362697,8 @@ ${queuedText}` : queuedText;
|
|
|
362563
362697
|
}, [historyManager, clearConsoleMessagesState, refreshStatic]);
|
|
362564
362698
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
362565
362699
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */) && !proQuotaRequest;
|
|
362566
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
362567
|
-
(0,
|
|
362700
|
+
const [controlsHeight, setControlsHeight] = (0, import_react139.useState)(0);
|
|
362701
|
+
(0, import_react139.useLayoutEffect)(() => {
|
|
362568
362702
|
if (mainControlsRef.current) {
|
|
362569
362703
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
362570
362704
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -362587,14 +362721,14 @@ ${queuedText}` : queuedText;
|
|
|
362587
362721
|
});
|
|
362588
362722
|
const isFocused = useFocus();
|
|
362589
362723
|
useBracketedPaste();
|
|
362590
|
-
const contextFileNames = (0,
|
|
362724
|
+
const contextFileNames = (0, import_react139.useMemo)(() => {
|
|
362591
362725
|
const fromSettings = settings.merged.context?.fileName;
|
|
362592
362726
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllOSAMdFilenames();
|
|
362593
362727
|
}, [settings.merged.context?.fileName]);
|
|
362594
|
-
const initialPrompt = (0,
|
|
362595
|
-
const initialPromptSubmitted = (0,
|
|
362728
|
+
const initialPrompt = (0, import_react139.useMemo)(() => config.getQuestion(), [config]);
|
|
362729
|
+
const initialPromptSubmitted = (0, import_react139.useRef)(false);
|
|
362596
362730
|
const OSAClient2 = config.getOSAClient();
|
|
362597
|
-
(0,
|
|
362731
|
+
(0, import_react139.useEffect)(() => {
|
|
362598
362732
|
if (activePtyId) {
|
|
362599
362733
|
ShellExecutionService.resizePty(
|
|
362600
362734
|
activePtyId,
|
|
@@ -362603,7 +362737,7 @@ ${queuedText}` : queuedText;
|
|
|
362603
362737
|
);
|
|
362604
362738
|
}
|
|
362605
362739
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
362606
|
-
(0,
|
|
362740
|
+
(0, import_react139.useEffect)(() => {
|
|
362607
362741
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && !isVisionSwitchDialogOpen && welcomeBackChoice !== "restart" && OSAClient2?.isInitialized?.()) {
|
|
362608
362742
|
handleFinalSubmit(initialPrompt);
|
|
362609
362743
|
initialPromptSubmitted.current = true;
|
|
@@ -362621,9 +362755,9 @@ ${queuedText}` : queuedText;
|
|
|
362621
362755
|
welcomeBackChoice,
|
|
362622
362756
|
OSAClient2
|
|
362623
362757
|
]);
|
|
362624
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
362625
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
362626
|
-
(0,
|
|
362758
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react139.useState)(false);
|
|
362759
|
+
const [currentIDE, setCurrentIDE] = (0, import_react139.useState)(null);
|
|
362760
|
+
(0, import_react139.useEffect)(() => {
|
|
362627
362761
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
362628
362762
|
const ideClient = await IdeClient.getInstance();
|
|
362629
362763
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -362634,28 +362768,28 @@ ${queuedText}` : queuedText;
|
|
|
362634
362768
|
const shouldShowIdePrompt = Boolean(
|
|
362635
362769
|
currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
|
|
362636
362770
|
);
|
|
362637
|
-
const [showErrorDetails, setShowErrorDetails] = (0,
|
|
362638
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
362639
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
362640
|
-
const ctrlCTimerRef = (0,
|
|
362641
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
362642
|
-
const ctrlDTimerRef = (0,
|
|
362643
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
362644
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
362645
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
362646
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
362771
|
+
const [showErrorDetails, setShowErrorDetails] = (0, import_react139.useState)(false);
|
|
362772
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react139.useState)(false);
|
|
362773
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react139.useState)(false);
|
|
362774
|
+
const ctrlCTimerRef = (0, import_react139.useRef)(null);
|
|
362775
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react139.useState)(false);
|
|
362776
|
+
const ctrlDTimerRef = (0, import_react139.useRef)(null);
|
|
362777
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react139.useState)(true);
|
|
362778
|
+
const [ideContextState, setIdeContextState] = (0, import_react139.useState)();
|
|
362779
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react139.useState)(false);
|
|
362780
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react139.useState)(false);
|
|
362647
362781
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
362648
362782
|
const {
|
|
362649
362783
|
needsRestart: ideNeedsRestart,
|
|
362650
362784
|
restartReason: ideTrustRestartReason
|
|
362651
362785
|
} = useIdeTrustListener();
|
|
362652
|
-
const isInitialMount = (0,
|
|
362653
|
-
(0,
|
|
362786
|
+
const isInitialMount = (0, import_react139.useRef)(true);
|
|
362787
|
+
(0, import_react139.useEffect)(() => {
|
|
362654
362788
|
if (ideNeedsRestart) {
|
|
362655
362789
|
setShowIdeRestartPrompt(true);
|
|
362656
362790
|
}
|
|
362657
362791
|
}, [ideNeedsRestart]);
|
|
362658
|
-
(0,
|
|
362792
|
+
(0, import_react139.useEffect)(() => {
|
|
362659
362793
|
if (isInitialMount.current) {
|
|
362660
362794
|
isInitialMount.current = false;
|
|
362661
362795
|
return;
|
|
@@ -362667,12 +362801,12 @@ ${queuedText}` : queuedText;
|
|
|
362667
362801
|
clearTimeout(handler);
|
|
362668
362802
|
};
|
|
362669
362803
|
}, [terminalWidth, refreshStatic]);
|
|
362670
|
-
(0,
|
|
362804
|
+
(0, import_react139.useEffect)(() => {
|
|
362671
362805
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
362672
362806
|
setIdeContextState(ideContextStore.get());
|
|
362673
362807
|
return unsubscribe;
|
|
362674
362808
|
}, []);
|
|
362675
|
-
(0,
|
|
362809
|
+
(0, import_react139.useEffect)(() => {
|
|
362676
362810
|
const openDebugConsole = /* @__PURE__ */ __name(() => {
|
|
362677
362811
|
setShowErrorDetails(true);
|
|
362678
362812
|
setConstrainHeight(false);
|
|
@@ -362691,10 +362825,10 @@ ${queuedText}` : queuedText;
|
|
|
362691
362825
|
appEvents.off("log-error" /* LogError */, logErrorHandler);
|
|
362692
362826
|
};
|
|
362693
362827
|
}, [handleNewMessage]);
|
|
362694
|
-
const handleEscapePromptChange = (0,
|
|
362828
|
+
const handleEscapePromptChange = (0, import_react139.useCallback)((showPrompt) => {
|
|
362695
362829
|
setShowEscapePrompt(showPrompt);
|
|
362696
362830
|
}, []);
|
|
362697
|
-
const handleIdePromptComplete = (0,
|
|
362831
|
+
const handleIdePromptComplete = (0, import_react139.useCallback)(
|
|
362698
362832
|
(result) => {
|
|
362699
362833
|
if (result.userSelection === "yes") {
|
|
362700
362834
|
handleSlashCommand2("/ide install");
|
|
@@ -362732,7 +362866,7 @@ ${queuedText}` : queuedText;
|
|
|
362732
362866
|
handleWelcomeBackClose,
|
|
362733
362867
|
quitConfirmationRequest
|
|
362734
362868
|
});
|
|
362735
|
-
const handleExit = (0,
|
|
362869
|
+
const handleExit = (0, import_react139.useCallback)(
|
|
362736
362870
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
362737
362871
|
if (pressedOnce) {
|
|
362738
362872
|
if (timerRef.current) {
|
|
@@ -362775,7 +362909,7 @@ ${queuedText}` : queuedText;
|
|
|
362775
362909
|
buffer
|
|
362776
362910
|
]
|
|
362777
362911
|
);
|
|
362778
|
-
const handleGlobalKeypress = (0,
|
|
362912
|
+
const handleGlobalKeypress = (0, import_react139.useCallback)(
|
|
362779
362913
|
(key) => {
|
|
362780
362914
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
362781
362915
|
console.log("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -362848,7 +362982,7 @@ ${queuedText}` : queuedText;
|
|
|
362848
362982
|
]
|
|
362849
362983
|
);
|
|
362850
362984
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
362851
|
-
(0,
|
|
362985
|
+
(0, import_react139.useEffect)(() => {
|
|
362852
362986
|
if (!settings.merged.ui?.showStatusInTitle || settings.merged.ui?.hideWindowTitle)
|
|
362853
362987
|
return;
|
|
362854
362988
|
let title;
|
|
@@ -362870,23 +363004,23 @@ ${queuedText}` : queuedText;
|
|
|
362870
363004
|
settings.merged.ui?.hideWindowTitle,
|
|
362871
363005
|
stdout
|
|
362872
363006
|
]);
|
|
362873
|
-
const filteredConsoleMessages = (0,
|
|
363007
|
+
const filteredConsoleMessages = (0, import_react139.useMemo)(() => {
|
|
362874
363008
|
if (config.getDebugMode()) {
|
|
362875
363009
|
return consoleMessages;
|
|
362876
363010
|
}
|
|
362877
363011
|
return consoleMessages.filter((msg) => msg.type !== "debug");
|
|
362878
363012
|
}, [consoleMessages, config]);
|
|
362879
|
-
const errorCount = (0,
|
|
363013
|
+
const errorCount = (0, import_react139.useMemo)(
|
|
362880
363014
|
() => filteredConsoleMessages.filter((msg) => msg.type === "error").reduce((total, msg) => total + msg.count, 0),
|
|
362881
363015
|
[filteredConsoleMessages]
|
|
362882
363016
|
);
|
|
362883
363017
|
const nightly = props.version.includes("nightly");
|
|
362884
363018
|
const dialogsVisible = showWelcomeBackDialog || showWorkspaceMigrationDialog || shouldShowIdePrompt || isFolderTrustDialogOpen || !!shellConfirmationRequest || !!confirmationRequest || confirmUpdateExtensionRequests.length > 0 || !!loopDetectionConfirmationRequest || !!quitConfirmationRequest || isThemeDialogOpen || isSettingsDialogOpen || isModelDialogOpen || isVisionSwitchDialogOpen || isPermissionsDialogOpen || isAuthDialogOpen || isAuthenticating || isEditorDialogOpen || showIdeRestartPrompt || !!proQuotaRequest || isSubagentCreateDialogOpen || isAgentsManagerDialogOpen || isApprovalModeDialogOpen;
|
|
362885
|
-
const pendingHistoryItems = (0,
|
|
363019
|
+
const pendingHistoryItems = (0, import_react139.useMemo)(
|
|
362886
363020
|
() => [...pendingSlashCommandHistoryItems, ...pendingOSAHistoryItems],
|
|
362887
363021
|
[pendingSlashCommandHistoryItems, pendingOSAHistoryItems]
|
|
362888
363022
|
);
|
|
362889
|
-
const uiState = (0,
|
|
363023
|
+
const uiState = (0, import_react139.useMemo)(
|
|
362890
363024
|
() => ({
|
|
362891
363025
|
history: historyManager.history,
|
|
362892
363026
|
historyManager,
|
|
@@ -363077,7 +363211,7 @@ ${queuedText}` : queuedText;
|
|
|
363077
363211
|
isAgentsManagerDialogOpen
|
|
363078
363212
|
]
|
|
363079
363213
|
);
|
|
363080
|
-
const uiActions = (0,
|
|
363214
|
+
const uiActions = (0, import_react139.useMemo)(
|
|
363081
363215
|
() => ({
|
|
363082
363216
|
handleThemeSelect,
|
|
363083
363217
|
handleThemeHighlight,
|
|
@@ -363159,9 +363293,9 @@ ${queuedText}` : queuedText;
|
|
|
363159
363293
|
|
|
363160
363294
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
363161
363295
|
init_esbuild_shims();
|
|
363162
|
-
var
|
|
363296
|
+
var import_react140 = __toESM(require_react(), 1);
|
|
363163
363297
|
function useKittyKeyboardProtocol() {
|
|
363164
|
-
const [status] = (0,
|
|
363298
|
+
const [status] = (0, import_react140.useState)({
|
|
363165
363299
|
supported: isKittyProtocolSupported(),
|
|
363166
363300
|
enabled: isKittyProtocolEnabled(),
|
|
363167
363301
|
checking: false
|
|
@@ -365903,7 +366037,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
365903
366037
|
) });
|
|
365904
366038
|
}, "AppWrapper");
|
|
365905
366039
|
const instance = render_default(
|
|
365906
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
366040
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_react141.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(AppWrapper, {}),
|
|
365907
366041
|
{
|
|
365908
366042
|
exitOnCtrlC: false,
|
|
365909
366043
|
isScreenReaderEnabled: config.getScreenReader()
|