osagent 0.1.22 → 0.1.24
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 +797 -400
- 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.24";
|
|
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.24";
|
|
309703
309703
|
}
|
|
309704
309704
|
__name(getCliVersion, "getCliVersion");
|
|
309705
309705
|
|
|
@@ -313868,7 +313868,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
313868
313868
|
|
|
313869
313869
|
// packages/cli/src/generated/git-commit.ts
|
|
313870
313870
|
init_esbuild_shims();
|
|
313871
|
-
var GIT_COMMIT_INFO2 = "
|
|
313871
|
+
var GIT_COMMIT_INFO2 = "4703098";
|
|
313872
313872
|
|
|
313873
313873
|
// packages/cli/src/utils/systemInfo.ts
|
|
313874
313874
|
async function getNpmVersion() {
|
|
@@ -314710,11 +314710,14 @@ var consultCommand = {
|
|
|
314710
314710
|
return t2("Enable active consultation mode");
|
|
314711
314711
|
},
|
|
314712
314712
|
kind: "built-in" /* BUILT_IN */,
|
|
314713
|
-
action: /* @__PURE__ */ __name(async () =>
|
|
314714
|
-
|
|
314715
|
-
|
|
314716
|
-
|
|
314717
|
-
|
|
314713
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
314714
|
+
context2.services.consultation?.setConsultationMode("active");
|
|
314715
|
+
return {
|
|
314716
|
+
type: "message",
|
|
314717
|
+
messageType: "info",
|
|
314718
|
+
content: t2("Consultation mode: ACTIVE\nThe agent will ask clarifying questions as you work.\nQuestions appear below the status bar.")
|
|
314719
|
+
};
|
|
314720
|
+
}, "action")
|
|
314718
314721
|
},
|
|
314719
314722
|
{
|
|
314720
314723
|
name: "off",
|
|
@@ -314722,11 +314725,14 @@ var consultCommand = {
|
|
|
314722
314725
|
return t2("Disable consultation mode");
|
|
314723
314726
|
},
|
|
314724
314727
|
kind: "built-in" /* BUILT_IN */,
|
|
314725
|
-
action: /* @__PURE__ */ __name(async () =>
|
|
314726
|
-
|
|
314727
|
-
|
|
314728
|
-
|
|
314729
|
-
|
|
314728
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
314729
|
+
context2.services.consultation?.setConsultationMode("passive");
|
|
314730
|
+
return {
|
|
314731
|
+
type: "message",
|
|
314732
|
+
messageType: "info",
|
|
314733
|
+
content: t2("Consultation mode: OFF\nNo questions will be asked.")
|
|
314734
|
+
};
|
|
314735
|
+
}, "action")
|
|
314730
314736
|
},
|
|
314731
314737
|
{
|
|
314732
314738
|
name: "blocking",
|
|
@@ -314734,11 +314740,14 @@ var consultCommand = {
|
|
|
314734
314740
|
return t2("Enable blocking mode - high priority questions pause the agent");
|
|
314735
314741
|
},
|
|
314736
314742
|
kind: "built-in" /* BUILT_IN */,
|
|
314737
|
-
action: /* @__PURE__ */ __name(async () =>
|
|
314738
|
-
|
|
314739
|
-
|
|
314740
|
-
|
|
314741
|
-
|
|
314743
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
314744
|
+
context2.services.consultation?.setConsultationMode("blocking");
|
|
314745
|
+
return {
|
|
314746
|
+
type: "message",
|
|
314747
|
+
messageType: "info",
|
|
314748
|
+
content: t2("Consultation mode: BLOCKING\nHigh priority questions will pause the agent until answered.\nThis ensures critical decisions get your input.")
|
|
314749
|
+
};
|
|
314750
|
+
}, "action")
|
|
314742
314751
|
},
|
|
314743
314752
|
{
|
|
314744
314753
|
name: "context",
|
|
@@ -314746,11 +314755,23 @@ var consultCommand = {
|
|
|
314746
314755
|
return t2("Show collected context from consultation");
|
|
314747
314756
|
},
|
|
314748
314757
|
kind: "built-in" /* BUILT_IN */,
|
|
314749
|
-
action: /* @__PURE__ */ __name(async () =>
|
|
314750
|
-
|
|
314751
|
-
|
|
314752
|
-
|
|
314753
|
-
|
|
314758
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
314759
|
+
const contextStr = context2.services.consultation?.getContextForAgent() || "";
|
|
314760
|
+
if (!contextStr) {
|
|
314761
|
+
return {
|
|
314762
|
+
type: "message",
|
|
314763
|
+
messageType: "info",
|
|
314764
|
+
content: t2("No consultation context collected yet.\nAnswer questions as they appear to build context.")
|
|
314765
|
+
};
|
|
314766
|
+
}
|
|
314767
|
+
return {
|
|
314768
|
+
type: "message",
|
|
314769
|
+
messageType: "info",
|
|
314770
|
+
content: t2(`Collected Context:
|
|
314771
|
+
|
|
314772
|
+
${contextStr}`)
|
|
314773
|
+
};
|
|
314774
|
+
}, "action")
|
|
314754
314775
|
},
|
|
314755
314776
|
{
|
|
314756
314777
|
name: "clear",
|
|
@@ -314758,15 +314779,49 @@ var consultCommand = {
|
|
|
314758
314779
|
return t2("Clear all collected consultation context");
|
|
314759
314780
|
},
|
|
314760
314781
|
kind: "built-in" /* BUILT_IN */,
|
|
314761
|
-
action: /* @__PURE__ */ __name(async () =>
|
|
314762
|
-
|
|
314763
|
-
|
|
314764
|
-
|
|
314765
|
-
|
|
314782
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
314783
|
+
context2.services.consultation?.clearContext();
|
|
314784
|
+
return {
|
|
314785
|
+
type: "message",
|
|
314786
|
+
messageType: "info",
|
|
314787
|
+
content: t2("Consultation context cleared.")
|
|
314788
|
+
};
|
|
314789
|
+
}, "action")
|
|
314790
|
+
},
|
|
314791
|
+
{
|
|
314792
|
+
name: "demo",
|
|
314793
|
+
get description() {
|
|
314794
|
+
return t2("Add demo consultation questions for testing");
|
|
314795
|
+
},
|
|
314796
|
+
kind: "built-in" /* BUILT_IN */,
|
|
314797
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
314798
|
+
context2.services.consultation?.addQuestion({
|
|
314799
|
+
question: "What programming language should we use?",
|
|
314800
|
+
context: "Based on your project structure",
|
|
314801
|
+
priority: "high",
|
|
314802
|
+
category: "architecture"
|
|
314803
|
+
});
|
|
314804
|
+
context2.services.consultation?.addQuestion({
|
|
314805
|
+
question: "Should we include unit tests?",
|
|
314806
|
+
priority: "medium",
|
|
314807
|
+
category: "requirements"
|
|
314808
|
+
});
|
|
314809
|
+
context2.services.consultation?.addQuestion({
|
|
314810
|
+
question: "Preferred code style (tabs vs spaces)?",
|
|
314811
|
+
priority: "low",
|
|
314812
|
+
category: "preference"
|
|
314813
|
+
});
|
|
314814
|
+
return {
|
|
314815
|
+
type: "message",
|
|
314816
|
+
messageType: "info",
|
|
314817
|
+
content: t2("Added 3 demo consultation questions. Check the consultation panel below the status bar.")
|
|
314818
|
+
};
|
|
314819
|
+
}, "action")
|
|
314766
314820
|
}
|
|
314767
314821
|
],
|
|
314768
|
-
action: /* @__PURE__ */ __name(async (
|
|
314822
|
+
action: /* @__PURE__ */ __name(async (context2, args) => {
|
|
314769
314823
|
const argTrimmed = args.trim().toLowerCase();
|
|
314824
|
+
const currentMode = context2.services.consultation?.consultationMode || "active";
|
|
314770
314825
|
if (!argTrimmed) {
|
|
314771
314826
|
return {
|
|
314772
314827
|
type: "message",
|
|
@@ -314774,9 +314829,9 @@ var consultCommand = {
|
|
|
314774
314829
|
content: t2(`Consultation Mode
|
|
314775
314830
|
|
|
314776
314831
|
The consultation system gathers context from you as you work:
|
|
314777
|
-
- Questions appear below the
|
|
314778
|
-
-
|
|
314779
|
-
- Context is used
|
|
314832
|
+
- Questions appear below the status bar
|
|
314833
|
+
- Answer questions to improve agent responses
|
|
314834
|
+
- Context is used across your session
|
|
314780
314835
|
|
|
314781
314836
|
Commands:
|
|
314782
314837
|
/consult on - Active mode (questions shown, agent continues)
|
|
@@ -314784,8 +314839,9 @@ Commands:
|
|
|
314784
314839
|
/consult off - Disable consultation
|
|
314785
314840
|
/consult context - View collected context
|
|
314786
314841
|
/consult clear - Clear all context
|
|
314842
|
+
/consult demo - Add demo questions for testing
|
|
314787
314843
|
|
|
314788
|
-
Current:
|
|
314844
|
+
Current mode: ${currentMode}`)
|
|
314789
314845
|
};
|
|
314790
314846
|
}
|
|
314791
314847
|
return {
|
|
@@ -318722,6 +318778,173 @@ var spCommand = {
|
|
|
318722
318778
|
}, "completion")
|
|
318723
318779
|
};
|
|
318724
318780
|
|
|
318781
|
+
// packages/cli/src/ui/commands/taskmasterCommand.ts
|
|
318782
|
+
init_esbuild_shims();
|
|
318783
|
+
var taskmasterCommand = {
|
|
318784
|
+
name: "taskmaster",
|
|
318785
|
+
altNames: ["tm", "tasks"],
|
|
318786
|
+
get description() {
|
|
318787
|
+
return t2("Manage the Taskmaster orchestration system");
|
|
318788
|
+
},
|
|
318789
|
+
kind: "built-in" /* BUILT_IN */,
|
|
318790
|
+
subCommands: [
|
|
318791
|
+
{
|
|
318792
|
+
name: "status",
|
|
318793
|
+
get description() {
|
|
318794
|
+
return t2("Show current Taskmaster status");
|
|
318795
|
+
},
|
|
318796
|
+
kind: "built-in" /* BUILT_IN */,
|
|
318797
|
+
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
318798
|
+
type: "message",
|
|
318799
|
+
messageType: "info",
|
|
318800
|
+
content: t2(`Taskmaster Status
|
|
318801
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
318802
|
+
|
|
318803
|
+
Status: Active
|
|
318804
|
+
Mode: Autonomous
|
|
318805
|
+
|
|
318806
|
+
The Taskmaster is currently managing tasks and coordinating agents.
|
|
318807
|
+
Use /taskmaster view to see all tasks.`)
|
|
318808
|
+
}), "action")
|
|
318809
|
+
},
|
|
318810
|
+
{
|
|
318811
|
+
name: "view",
|
|
318812
|
+
get description() {
|
|
318813
|
+
return t2("View all current tasks");
|
|
318814
|
+
},
|
|
318815
|
+
kind: "built-in" /* BUILT_IN */,
|
|
318816
|
+
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
318817
|
+
type: "message",
|
|
318818
|
+
messageType: "info",
|
|
318819
|
+
content: t2(`Current Tasks
|
|
318820
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
318821
|
+
|
|
318822
|
+
No tasks currently queued.
|
|
318823
|
+
Tasks will appear here when the agent is working.
|
|
318824
|
+
|
|
318825
|
+
Tip: Use /taskmaster add "task description" to manually add a task.`)
|
|
318826
|
+
}), "action")
|
|
318827
|
+
},
|
|
318828
|
+
{
|
|
318829
|
+
name: "add",
|
|
318830
|
+
get description() {
|
|
318831
|
+
return t2("Add a task to the queue");
|
|
318832
|
+
},
|
|
318833
|
+
kind: "built-in" /* BUILT_IN */,
|
|
318834
|
+
action: /* @__PURE__ */ __name(async (_context, args) => {
|
|
318835
|
+
const taskDescription = args.trim();
|
|
318836
|
+
if (!taskDescription) {
|
|
318837
|
+
return {
|
|
318838
|
+
type: "message",
|
|
318839
|
+
messageType: "error",
|
|
318840
|
+
content: t2('Please provide a task description: /taskmaster add "task description"')
|
|
318841
|
+
};
|
|
318842
|
+
}
|
|
318843
|
+
return {
|
|
318844
|
+
type: "message",
|
|
318845
|
+
messageType: "info",
|
|
318846
|
+
content: t2(`Task Added
|
|
318847
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
318848
|
+
|
|
318849
|
+
"${taskDescription}"
|
|
318850
|
+
|
|
318851
|
+
The task has been added to the queue and will be processed.`)
|
|
318852
|
+
};
|
|
318853
|
+
}, "action")
|
|
318854
|
+
},
|
|
318855
|
+
{
|
|
318856
|
+
name: "clear",
|
|
318857
|
+
get description() {
|
|
318858
|
+
return t2("Clear all tasks from the queue");
|
|
318859
|
+
},
|
|
318860
|
+
kind: "built-in" /* BUILT_IN */,
|
|
318861
|
+
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
318862
|
+
type: "message",
|
|
318863
|
+
messageType: "info",
|
|
318864
|
+
content: t2("All tasks cleared from the queue.")
|
|
318865
|
+
}), "action")
|
|
318866
|
+
},
|
|
318867
|
+
{
|
|
318868
|
+
name: "pause",
|
|
318869
|
+
get description() {
|
|
318870
|
+
return t2("Pause task processing");
|
|
318871
|
+
},
|
|
318872
|
+
kind: "built-in" /* BUILT_IN */,
|
|
318873
|
+
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
318874
|
+
type: "message",
|
|
318875
|
+
messageType: "info",
|
|
318876
|
+
content: t2("Task processing paused. Use /taskmaster resume to continue.")
|
|
318877
|
+
}), "action")
|
|
318878
|
+
},
|
|
318879
|
+
{
|
|
318880
|
+
name: "resume",
|
|
318881
|
+
get description() {
|
|
318882
|
+
return t2("Resume task processing");
|
|
318883
|
+
},
|
|
318884
|
+
kind: "built-in" /* BUILT_IN */,
|
|
318885
|
+
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
318886
|
+
type: "message",
|
|
318887
|
+
messageType: "info",
|
|
318888
|
+
content: t2("Task processing resumed.")
|
|
318889
|
+
}), "action")
|
|
318890
|
+
},
|
|
318891
|
+
{
|
|
318892
|
+
name: "agents",
|
|
318893
|
+
get description() {
|
|
318894
|
+
return t2("Show agent status and activity");
|
|
318895
|
+
},
|
|
318896
|
+
kind: "built-in" /* BUILT_IN */,
|
|
318897
|
+
action: /* @__PURE__ */ __name(async (_context) => ({
|
|
318898
|
+
type: "message",
|
|
318899
|
+
messageType: "info",
|
|
318900
|
+
content: t2(`Agent Status
|
|
318901
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
318902
|
+
|
|
318903
|
+
\u{1F3AF} Orchestrator: Ready
|
|
318904
|
+
\u{1F4BB} Coder: Idle
|
|
318905
|
+
\u{1F441}\uFE0F Reviewer: Idle
|
|
318906
|
+
\u{1F9EA} Tester: Idle
|
|
318907
|
+
\u{1F4CA} Analyst: Idle
|
|
318908
|
+
|
|
318909
|
+
All agents are standing by for task assignment.`)
|
|
318910
|
+
}), "action")
|
|
318911
|
+
}
|
|
318912
|
+
],
|
|
318913
|
+
action: /* @__PURE__ */ __name(async (_context, args) => {
|
|
318914
|
+
if (args.trim()) {
|
|
318915
|
+
return {
|
|
318916
|
+
type: "message",
|
|
318917
|
+
messageType: "error",
|
|
318918
|
+
content: t2(`Unknown subcommand: ${args.trim()}
|
|
318919
|
+
Use /taskmaster for help.`)
|
|
318920
|
+
};
|
|
318921
|
+
}
|
|
318922
|
+
return {
|
|
318923
|
+
type: "message",
|
|
318924
|
+
messageType: "info",
|
|
318925
|
+
content: t2(`Taskmaster - Orchestration System
|
|
318926
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
318927
|
+
|
|
318928
|
+
The Taskmaster coordinates all agent activity:
|
|
318929
|
+
\u2022 Queues and prioritizes incoming prompts
|
|
318930
|
+
\u2022 Delegates tasks to specialized agents
|
|
318931
|
+
\u2022 Tracks progress and manages dependencies
|
|
318932
|
+
\u2022 Collects context from user consultation
|
|
318933
|
+
|
|
318934
|
+
Commands:
|
|
318935
|
+
/taskmaster status - Show current status
|
|
318936
|
+
/taskmaster view - View all tasks
|
|
318937
|
+
/taskmaster add - Add a task manually
|
|
318938
|
+
/taskmaster clear - Clear all tasks
|
|
318939
|
+
/taskmaster pause - Pause processing
|
|
318940
|
+
/taskmaster resume - Resume processing
|
|
318941
|
+
/taskmaster agents - Show agent status
|
|
318942
|
+
|
|
318943
|
+
Shortcuts: /tm, /tasks`)
|
|
318944
|
+
};
|
|
318945
|
+
}, "action")
|
|
318946
|
+
};
|
|
318947
|
+
|
|
318725
318948
|
// packages/cli/src/ui/commands/terminalSetupCommand.ts
|
|
318726
318949
|
init_esbuild_shims();
|
|
318727
318950
|
|
|
@@ -319627,6 +319850,7 @@ var BuiltinCommandLoader = class {
|
|
|
319627
319850
|
restoreCommand(this.config),
|
|
319628
319851
|
statsCommand,
|
|
319629
319852
|
summaryCommand,
|
|
319853
|
+
taskmasterCommand,
|
|
319630
319854
|
themeCommand,
|
|
319631
319855
|
toolsCommand,
|
|
319632
319856
|
settingsCommand,
|
|
@@ -323527,7 +323751,7 @@ __name(runNonInteractiveStreamJson, "runNonInteractiveStreamJson");
|
|
|
323527
323751
|
|
|
323528
323752
|
// packages/cli/src/ui/AppContainer.tsx
|
|
323529
323753
|
init_esbuild_shims();
|
|
323530
|
-
var
|
|
323754
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
323531
323755
|
|
|
323532
323756
|
// packages/cli/src/ui/App.tsx
|
|
323533
323757
|
init_esbuild_shims();
|
|
@@ -353748,150 +353972,17 @@ var ScreenReaderAppLayout = /* @__PURE__ */ __name(() => {
|
|
|
353748
353972
|
// packages/cli/src/ui/layouts/DefaultAppLayout.tsx
|
|
353749
353973
|
init_esbuild_shims();
|
|
353750
353974
|
|
|
353751
|
-
// packages/cli/src/ui/components/
|
|
353752
|
-
init_esbuild_shims();
|
|
353753
|
-
var import_react101 = __toESM(require_react(), 1);
|
|
353754
|
-
var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1);
|
|
353755
|
-
var STATUS_ICONS2 = {
|
|
353756
|
-
pending: "\u25CB",
|
|
353757
|
-
in_progress: "\u25D0",
|
|
353758
|
-
completed: "\u25CF"
|
|
353759
|
-
};
|
|
353760
|
-
function formatTokenCount(count) {
|
|
353761
|
-
if (count >= 1e6) {
|
|
353762
|
-
return `${(count / 1e6).toFixed(1)}M`;
|
|
353763
|
-
}
|
|
353764
|
-
if (count >= 1e3) {
|
|
353765
|
-
return `${(count / 1e3).toFixed(1)}k`;
|
|
353766
|
-
}
|
|
353767
|
-
return String(count);
|
|
353768
|
-
}
|
|
353769
|
-
__name(formatTokenCount, "formatTokenCount");
|
|
353770
|
-
var StatusBar = /* @__PURE__ */ __name(() => {
|
|
353771
|
-
const { todos, getActiveTodo } = useTodos();
|
|
353772
|
-
const { stats } = useSessionStats();
|
|
353773
|
-
const streamingState = useStreamingContext();
|
|
353774
|
-
const [elapsedMs, setElapsedMs] = (0, import_react101.useState)(0);
|
|
353775
|
-
(0, import_react101.useEffect)(() => {
|
|
353776
|
-
const interval = setInterval(() => {
|
|
353777
|
-
setElapsedMs(Date.now() - stats.sessionStartTime.getTime());
|
|
353778
|
-
}, 1e3);
|
|
353779
|
-
return () => clearInterval(interval);
|
|
353780
|
-
}, [stats.sessionStartTime]);
|
|
353781
|
-
const activeTodo = getActiveTodo();
|
|
353782
|
-
const computed = computeSessionStats(stats.metrics);
|
|
353783
|
-
const isResponding = streamingState === "responding" /* Responding */;
|
|
353784
|
-
let totalInputTokens = 0;
|
|
353785
|
-
let totalOutputTokens = 0;
|
|
353786
|
-
for (const model of Object.values(stats.metrics.models)) {
|
|
353787
|
-
totalInputTokens += model.tokens.prompt;
|
|
353788
|
-
totalOutputTokens += model.tokens.candidates;
|
|
353789
|
-
}
|
|
353790
|
-
const totalTokens = totalInputTokens + totalOutputTokens;
|
|
353791
|
-
let statusText = "Ready";
|
|
353792
|
-
if (isResponding) {
|
|
353793
|
-
statusText = activeTodo?.activeForm || "Thinking...";
|
|
353794
|
-
} else if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */) {
|
|
353795
|
-
statusText = "Waiting for confirmation";
|
|
353796
|
-
} else if (activeTodo) {
|
|
353797
|
-
statusText = activeTodo.activeForm || activeTodo.content;
|
|
353798
|
-
}
|
|
353799
|
-
const completedCount = todos.filter((t3) => t3.status === "completed").length;
|
|
353800
|
-
const totalCount = todos.length;
|
|
353801
|
-
if (!isResponding && (!todos || todos.length === 0)) {
|
|
353802
|
-
return null;
|
|
353803
|
-
}
|
|
353804
|
-
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
353805
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
|
|
353806
|
-
Box_default,
|
|
353807
|
-
{
|
|
353808
|
-
borderStyle: "round",
|
|
353809
|
-
borderColor: isResponding ? Colors.AccentCyan : theme.border.default,
|
|
353810
|
-
paddingX: 1,
|
|
353811
|
-
flexDirection: "column",
|
|
353812
|
-
children: [
|
|
353813
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { justifyContent: "space-between", children: [
|
|
353814
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { children: [
|
|
353815
|
-
isResponding ? /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: Colors.AccentCyan, children: [
|
|
353816
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(build_default, { type: "dots" }),
|
|
353817
|
-
" "
|
|
353818
|
-
] }) : activeTodo ? /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.status.success, children: [
|
|
353819
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(build_default, { type: "dots" }),
|
|
353820
|
-
" "
|
|
353821
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: theme.text.secondary, children: "\u25CF " }),
|
|
353822
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: isResponding ? Colors.AccentCyan : theme.text.primary, bold: true, children: statusText }),
|
|
353823
|
-
totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
353824
|
-
" ",
|
|
353825
|
-
"(",
|
|
353826
|
-
completedCount,
|
|
353827
|
-
"/",
|
|
353828
|
-
totalCount,
|
|
353829
|
-
")"
|
|
353830
|
-
] })
|
|
353831
|
-
] }),
|
|
353832
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { gap: 2, children: [
|
|
353833
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
353834
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: Colors.AccentPurple, children: "\u2191" }),
|
|
353835
|
-
" ",
|
|
353836
|
-
formatTokenCount(totalInputTokens)
|
|
353837
|
-
] }),
|
|
353838
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
353839
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: Colors.AccentGreen, children: "\u2193" }),
|
|
353840
|
-
" ",
|
|
353841
|
-
formatTokenCount(totalOutputTokens)
|
|
353842
|
-
] }),
|
|
353843
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: theme.text.secondary, children: formatDuration(elapsedMs) })
|
|
353844
|
-
] })
|
|
353845
|
-
] }),
|
|
353846
|
-
todos.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { flexDirection: "column", marginTop: 0, paddingLeft: 1, children: [
|
|
353847
|
-
todos.slice(0, 5).map((todo) => {
|
|
353848
|
-
const isCompleted = todo.status === "completed";
|
|
353849
|
-
const isInProgress = todo.status === "in_progress";
|
|
353850
|
-
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { children: [
|
|
353851
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: isCompleted ? theme.text.secondary : isInProgress ? theme.status.success : theme.text.primary, children: [
|
|
353852
|
-
isInProgress ? "\u251C\u2500" : isCompleted ? "\u2514\u2500" : "\u2502 ",
|
|
353853
|
-
" ",
|
|
353854
|
-
isInProgress ? "\u25D0" : STATUS_ICONS2[todo.status],
|
|
353855
|
-
" "
|
|
353856
|
-
] }),
|
|
353857
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
353858
|
-
Text3,
|
|
353859
|
-
{
|
|
353860
|
-
color: isCompleted ? theme.text.secondary : isInProgress ? theme.status.success : theme.text.primary,
|
|
353861
|
-
dimColor: isCompleted,
|
|
353862
|
-
strikethrough: isCompleted,
|
|
353863
|
-
children: isInProgress && todo.activeForm ? todo.activeForm : todo.content
|
|
353864
|
-
}
|
|
353865
|
-
)
|
|
353866
|
-
] }, todo.id);
|
|
353867
|
-
}),
|
|
353868
|
-
todos.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
353869
|
-
"\u2514\u2500 ... and ",
|
|
353870
|
-
todos.length - 5,
|
|
353871
|
-
" more"
|
|
353872
|
-
] })
|
|
353873
|
-
] })
|
|
353874
|
-
]
|
|
353875
|
-
}
|
|
353876
|
-
),
|
|
353877
|
-
computed.cacheEfficiency > 0 && totalTokens > 1e4 && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Box_default, { paddingLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.text.secondary, dimColor: true, children: [
|
|
353878
|
-
"\u{1F4BE} ",
|
|
353879
|
-
computed.cacheEfficiency.toFixed(0),
|
|
353880
|
-
"% cache efficiency"
|
|
353881
|
-
] }) })
|
|
353882
|
-
] });
|
|
353883
|
-
}, "StatusBar");
|
|
353884
|
-
|
|
353885
|
-
// packages/cli/src/ui/components/ConsultationPanel.tsx
|
|
353975
|
+
// packages/cli/src/ui/components/TaskMasterPanel.tsx
|
|
353886
353976
|
init_esbuild_shims();
|
|
353977
|
+
var import_react102 = __toESM(require_react(), 1);
|
|
353887
353978
|
|
|
353888
353979
|
// packages/cli/src/ui/contexts/ConsultationContext.tsx
|
|
353889
353980
|
init_esbuild_shims();
|
|
353890
|
-
var
|
|
353891
|
-
var
|
|
353892
|
-
var ConsultationContext = (0,
|
|
353981
|
+
var import_react101 = __toESM(require_react(), 1);
|
|
353982
|
+
var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1);
|
|
353983
|
+
var ConsultationContext = (0, import_react101.createContext)(null);
|
|
353893
353984
|
function useConsultation() {
|
|
353894
|
-
const context2 = (0,
|
|
353985
|
+
const context2 = (0, import_react101.useContext)(ConsultationContext);
|
|
353895
353986
|
if (!context2) {
|
|
353896
353987
|
throw new Error("useConsultation must be used within ConsultationProvider");
|
|
353897
353988
|
}
|
|
@@ -353899,19 +353990,19 @@ function useConsultation() {
|
|
|
353899
353990
|
}
|
|
353900
353991
|
__name(useConsultation, "useConsultation");
|
|
353901
353992
|
function ConsultationProvider({ children }) {
|
|
353902
|
-
const [isActive, setIsActive] = (0,
|
|
353903
|
-
const [currentQuestion, setCurrentQuestion] = (0,
|
|
353904
|
-
const [questionQueue, setQuestionQueue] = (0,
|
|
353905
|
-
const [isBlocking, setIsBlocking] = (0,
|
|
353906
|
-
const [consultationMode, setConsultationModeState] = (0,
|
|
353907
|
-
const [collectedContext, setCollectedContext] = (0,
|
|
353993
|
+
const [isActive, setIsActive] = (0, import_react101.useState)(true);
|
|
353994
|
+
const [currentQuestion, setCurrentQuestion] = (0, import_react101.useState)(null);
|
|
353995
|
+
const [questionQueue, setQuestionQueue] = (0, import_react101.useState)([]);
|
|
353996
|
+
const [isBlocking, setIsBlocking] = (0, import_react101.useState)(false);
|
|
353997
|
+
const [consultationMode, setConsultationModeState] = (0, import_react101.useState)("active");
|
|
353998
|
+
const [collectedContext, setCollectedContext] = (0, import_react101.useState)({
|
|
353908
353999
|
questions: [],
|
|
353909
354000
|
answers: /* @__PURE__ */ new Map(),
|
|
353910
354001
|
projectContext: [],
|
|
353911
354002
|
userPreferences: {}
|
|
353912
354003
|
});
|
|
353913
354004
|
const generateId = /* @__PURE__ */ __name(() => `q_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`, "generateId");
|
|
353914
|
-
const addQuestion = (0,
|
|
354005
|
+
const addQuestion = (0, import_react101.useCallback)((question) => {
|
|
353915
354006
|
const newQuestion = {
|
|
353916
354007
|
...question,
|
|
353917
354008
|
id: generateId(),
|
|
@@ -353936,7 +354027,7 @@ function ConsultationProvider({ children }) {
|
|
|
353936
354027
|
}
|
|
353937
354028
|
}
|
|
353938
354029
|
}, [currentQuestion, consultationMode]);
|
|
353939
|
-
const answerQuestion = (0,
|
|
354030
|
+
const answerQuestion = (0, import_react101.useCallback)((questionId, answer) => {
|
|
353940
354031
|
setCollectedContext((prev) => {
|
|
353941
354032
|
const newAnswers = new Map(prev.answers);
|
|
353942
354033
|
newAnswers.set(questionId, answer);
|
|
@@ -353961,7 +354052,7 @@ A: ${answer}`]
|
|
|
353961
354052
|
return prev.slice(1);
|
|
353962
354053
|
});
|
|
353963
354054
|
}, []);
|
|
353964
|
-
const skipQuestion = (0,
|
|
354055
|
+
const skipQuestion = (0, import_react101.useCallback)((questionId) => {
|
|
353965
354056
|
setQuestionQueue((prev) => {
|
|
353966
354057
|
const filtered = prev.filter((q) => q.id !== questionId);
|
|
353967
354058
|
const next = filtered[0] || null;
|
|
@@ -353972,14 +354063,14 @@ A: ${answer}`]
|
|
|
353972
354063
|
return filtered.slice(1);
|
|
353973
354064
|
});
|
|
353974
354065
|
}, []);
|
|
353975
|
-
const setConsultationMode = (0,
|
|
354066
|
+
const setConsultationMode = (0, import_react101.useCallback)((mode) => {
|
|
353976
354067
|
setConsultationModeState(mode);
|
|
353977
354068
|
setIsActive(mode !== "passive");
|
|
353978
354069
|
if (mode !== "blocking") {
|
|
353979
354070
|
setIsBlocking(false);
|
|
353980
354071
|
}
|
|
353981
354072
|
}, []);
|
|
353982
|
-
const getContextForAgent = (0,
|
|
354073
|
+
const getContextForAgent = (0, import_react101.useCallback)(() => {
|
|
353983
354074
|
const contextParts = [];
|
|
353984
354075
|
if (collectedContext.projectContext.length > 0) {
|
|
353985
354076
|
contextParts.push("## User-Provided Context\n");
|
|
@@ -353993,7 +354084,7 @@ A: ${answer}`]
|
|
|
353993
354084
|
}
|
|
353994
354085
|
return contextParts.join("\n");
|
|
353995
354086
|
}, [collectedContext]);
|
|
353996
|
-
const clearContext = (0,
|
|
354087
|
+
const clearContext = (0, import_react101.useCallback)(() => {
|
|
353997
354088
|
setCollectedContext({
|
|
353998
354089
|
questions: [],
|
|
353999
354090
|
answers: /* @__PURE__ */ new Map(),
|
|
@@ -354004,7 +354095,7 @@ A: ${answer}`]
|
|
|
354004
354095
|
setCurrentQuestion(null);
|
|
354005
354096
|
setIsBlocking(false);
|
|
354006
354097
|
}, []);
|
|
354007
|
-
const setBlocking2 = (0,
|
|
354098
|
+
const setBlocking2 = (0, import_react101.useCallback)((blocking) => {
|
|
354008
354099
|
setIsBlocking(blocking);
|
|
354009
354100
|
}, []);
|
|
354010
354101
|
const value = {
|
|
@@ -354022,99 +354113,271 @@ A: ${answer}`]
|
|
|
354022
354113
|
clearContext,
|
|
354023
354114
|
setBlocking: setBlocking2
|
|
354024
354115
|
};
|
|
354025
|
-
return /* @__PURE__ */ (0,
|
|
354116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(ConsultationContext.Provider, { value, children });
|
|
354026
354117
|
}
|
|
354027
354118
|
__name(ConsultationProvider, "ConsultationProvider");
|
|
354028
354119
|
|
|
354029
|
-
// packages/cli/src/ui/components/
|
|
354030
|
-
var
|
|
354031
|
-
var
|
|
354032
|
-
|
|
354033
|
-
|
|
354034
|
-
|
|
354035
|
-
};
|
|
354036
|
-
var CATEGORY_LABELS = {
|
|
354037
|
-
architecture: "\u{1F3D7}\uFE0F",
|
|
354038
|
-
requirements: "\u{1F4CB}",
|
|
354039
|
-
clarification: "\u2753",
|
|
354040
|
-
preference: "\u2699\uFE0F"
|
|
354120
|
+
// packages/cli/src/ui/components/TaskMasterPanel.tsx
|
|
354121
|
+
var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
|
|
354122
|
+
var STATUS_ICONS2 = {
|
|
354123
|
+
pending: "\u25CB",
|
|
354124
|
+
in_progress: "\u25D0",
|
|
354125
|
+
completed: "\u25CF"
|
|
354041
354126
|
};
|
|
354042
|
-
|
|
354043
|
-
|
|
354044
|
-
|
|
354045
|
-
|
|
354127
|
+
function formatTokenCount(count) {
|
|
354128
|
+
if (count >= 1e6) {
|
|
354129
|
+
return `${(count / 1e6).toFixed(1)}M`;
|
|
354130
|
+
}
|
|
354131
|
+
if (count >= 1e3) {
|
|
354132
|
+
return `${(count / 1e3).toFixed(1)}k`;
|
|
354046
354133
|
}
|
|
354134
|
+
return String(count);
|
|
354135
|
+
}
|
|
354136
|
+
__name(formatTokenCount, "formatTokenCount");
|
|
354137
|
+
var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
354138
|
+
compact = false
|
|
354139
|
+
}) => {
|
|
354140
|
+
const { todos, getActiveTodo } = useTodos();
|
|
354141
|
+
const { stats } = useSessionStats();
|
|
354142
|
+
const streamingState = useStreamingContext();
|
|
354143
|
+
const { questionQueue, currentQuestion, isActive: consultationActive } = useConsultation();
|
|
354144
|
+
const [elapsedMs, setElapsedMs] = (0, import_react102.useState)(0);
|
|
354145
|
+
const [subagentComments, setSubagentComments] = (0, import_react102.useState)([]);
|
|
354146
|
+
const [stuckWarning, setStuckWarning] = (0, import_react102.useState)(false);
|
|
354147
|
+
const respondingStartRef = (0, import_react102.useRef)(null);
|
|
354148
|
+
const lastStateRef = (0, import_react102.useRef)(streamingState);
|
|
354149
|
+
(0, import_react102.useEffect)(() => {
|
|
354150
|
+
if (streamingState !== lastStateRef.current) {
|
|
354151
|
+
lastStateRef.current = streamingState;
|
|
354152
|
+
setStuckWarning(false);
|
|
354153
|
+
if (streamingState === "responding" /* Responding */) {
|
|
354154
|
+
respondingStartRef.current = Date.now();
|
|
354155
|
+
} else {
|
|
354156
|
+
respondingStartRef.current = null;
|
|
354157
|
+
}
|
|
354158
|
+
}
|
|
354159
|
+
}, [streamingState]);
|
|
354160
|
+
(0, import_react102.useEffect)(() => {
|
|
354161
|
+
const interval = setInterval(() => {
|
|
354162
|
+
setElapsedMs(Date.now() - stats.sessionStartTime.getTime());
|
|
354163
|
+
if (streamingState === "responding" /* Responding */ && respondingStartRef.current) {
|
|
354164
|
+
if (Date.now() - respondingStartRef.current > 5 * 60 * 1e3) {
|
|
354165
|
+
setStuckWarning(true);
|
|
354166
|
+
}
|
|
354167
|
+
}
|
|
354168
|
+
}, 1e3);
|
|
354169
|
+
return () => clearInterval(interval);
|
|
354170
|
+
}, [stats.sessionStartTime, streamingState]);
|
|
354171
|
+
(0, import_react102.useEffect)(() => {
|
|
354172
|
+
const activeTodo2 = getActiveTodo();
|
|
354173
|
+
if (activeTodo2 && streamingState === "responding" /* Responding */) {
|
|
354174
|
+
const existingComment = subagentComments.find((c3) => c3.id === activeTodo2.id);
|
|
354175
|
+
if (!existingComment) {
|
|
354176
|
+
setSubagentComments((prev) => [
|
|
354177
|
+
...prev.slice(-4),
|
|
354178
|
+
// Keep last 4 comments
|
|
354179
|
+
{
|
|
354180
|
+
id: activeTodo2.id,
|
|
354181
|
+
agent: "coder",
|
|
354182
|
+
message: `Working on: ${activeTodo2.activeForm || activeTodo2.content}`,
|
|
354183
|
+
timestamp: Date.now(),
|
|
354184
|
+
type: "info"
|
|
354185
|
+
}
|
|
354186
|
+
]);
|
|
354187
|
+
}
|
|
354188
|
+
}
|
|
354189
|
+
}, [todos, streamingState, getActiveTodo, subagentComments]);
|
|
354190
|
+
const activeTodo = getActiveTodo();
|
|
354191
|
+
const computed = computeSessionStats(stats.metrics);
|
|
354192
|
+
const isResponding = streamingState === "responding" /* Responding */;
|
|
354193
|
+
let totalInputTokens = 0;
|
|
354194
|
+
let totalOutputTokens = 0;
|
|
354195
|
+
for (const model of Object.values(stats.metrics.models)) {
|
|
354196
|
+
totalInputTokens += model.tokens.prompt;
|
|
354197
|
+
totalOutputTokens += model.tokens.candidates;
|
|
354198
|
+
}
|
|
354199
|
+
const completedCount = todos.filter((t3) => t3.status === "completed").length;
|
|
354200
|
+
const totalCount = todos.length;
|
|
354201
|
+
const progressPercent = totalCount > 0 ? Math.round(completedCount / totalCount * 100) : 0;
|
|
354047
354202
|
const allQuestions = currentQuestion ? [currentQuestion, ...questionQueue.filter((q) => q.id !== currentQuestion.id)] : questionQueue;
|
|
354048
|
-
if (
|
|
354203
|
+
if (!isResponding && todos.length === 0 && subagentComments.length === 0) {
|
|
354049
354204
|
return null;
|
|
354050
354205
|
}
|
|
354051
|
-
return /* @__PURE__ */ (0,
|
|
354052
|
-
|
|
354053
|
-
|
|
354054
|
-
|
|
354055
|
-
|
|
354056
|
-
|
|
354057
|
-
|
|
354058
|
-
|
|
354059
|
-
|
|
354060
|
-
|
|
354061
|
-
/* @__PURE__ */ (0,
|
|
354062
|
-
/* @__PURE__ */ (0,
|
|
354063
|
-
|
|
354064
|
-
|
|
354065
|
-
|
|
354066
|
-
|
|
354067
|
-
] })
|
|
354068
|
-
]
|
|
354069
|
-
|
|
354070
|
-
|
|
354071
|
-
|
|
354072
|
-
|
|
354073
|
-
|
|
354206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
354207
|
+
isResponding && subagentComments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
|
|
354208
|
+
Box_default,
|
|
354209
|
+
{
|
|
354210
|
+
flexDirection: "column",
|
|
354211
|
+
borderStyle: "single",
|
|
354212
|
+
borderColor: theme.border.default,
|
|
354213
|
+
paddingX: 1,
|
|
354214
|
+
marginBottom: 1,
|
|
354215
|
+
children: [
|
|
354216
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: theme.text.secondary, dimColor: true, children: "\u{1F4E1} Agent Activity" }),
|
|
354217
|
+
subagentComments.slice(-3).map((comment) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: getCommentColor(comment.type), children: [
|
|
354218
|
+
"[",
|
|
354219
|
+
comment.agent,
|
|
354220
|
+
"] ",
|
|
354221
|
+
comment.message
|
|
354222
|
+
] }) }, comment.id))
|
|
354223
|
+
]
|
|
354224
|
+
}
|
|
354225
|
+
),
|
|
354226
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
|
|
354227
|
+
Box_default,
|
|
354228
|
+
{
|
|
354229
|
+
borderStyle: "round",
|
|
354230
|
+
borderColor: isResponding ? Colors.AccentCyan : theme.border.default,
|
|
354231
|
+
paddingX: 1,
|
|
354232
|
+
flexDirection: "column",
|
|
354233
|
+
children: [
|
|
354234
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { justifyContent: "space-between", children: [
|
|
354235
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { children: [
|
|
354236
|
+
isResponding ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: Colors.AccentCyan, children: [
|
|
354237
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(build_default, { type: "dots" }),
|
|
354074
354238
|
" "
|
|
354075
|
-
] }),
|
|
354076
|
-
|
|
354239
|
+
] }) : activeTodo ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.status.success, children: [
|
|
354240
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(build_default, { type: "dots" }),
|
|
354241
|
+
" "
|
|
354242
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: theme.text.secondary, children: "\u25CF " }),
|
|
354243
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: isResponding ? Colors.AccentCyan : theme.text.primary, bold: true, children: "Taskmaster" }),
|
|
354244
|
+
totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
354245
|
+
" ",
|
|
354246
|
+
"(",
|
|
354247
|
+
completedCount,
|
|
354248
|
+
"/",
|
|
354249
|
+
totalCount,
|
|
354250
|
+
")"
|
|
354251
|
+
] })
|
|
354077
354252
|
] }),
|
|
354078
|
-
|
|
354079
|
-
|
|
354080
|
-
|
|
354081
|
-
|
|
354082
|
-
|
|
354083
|
-
|
|
354253
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { gap: 2, children: [
|
|
354254
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
354255
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: Colors.AccentPurple, children: "\u2191" }),
|
|
354256
|
+
" ",
|
|
354257
|
+
formatTokenCount(totalInputTokens)
|
|
354258
|
+
] }),
|
|
354259
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
354260
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: Colors.AccentGreen, children: "\u2193" }),
|
|
354261
|
+
" ",
|
|
354262
|
+
formatTokenCount(totalOutputTokens)
|
|
354263
|
+
] }),
|
|
354264
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: theme.text.secondary, children: formatDuration(elapsedMs) })
|
|
354265
|
+
] })
|
|
354266
|
+
] }),
|
|
354267
|
+
activeTodo && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Box_default, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: Colors.AccentCyan, children: activeTodo.activeForm || activeTodo.content }) }),
|
|
354268
|
+
totalCount > 0 && !compact && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { marginTop: 1, children: [
|
|
354269
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: theme.status.success, children: "\u2588".repeat(Math.round(progressPercent / 100 * 20)) }),
|
|
354270
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: theme.text.secondary, children: "\u2591".repeat(20 - Math.round(progressPercent / 100 * 20)) }),
|
|
354271
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
354272
|
+
" ",
|
|
354273
|
+
progressPercent,
|
|
354274
|
+
"%"
|
|
354275
|
+
] })
|
|
354276
|
+
] }),
|
|
354277
|
+
todos.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, paddingLeft: 1, children: [
|
|
354278
|
+
todos.slice(0, compact ? 3 : 5).map((todo, idx) => {
|
|
354279
|
+
const isCompleted = todo.status === "completed";
|
|
354280
|
+
const isInProgress = todo.status === "in_progress";
|
|
354281
|
+
const isLast = idx === Math.min(todos.length, compact ? 3 : 5) - 1;
|
|
354282
|
+
const color = isCompleted ? theme.text.secondary : isInProgress ? theme.status.success : theme.text.primary;
|
|
354283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { children: [
|
|
354284
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color, children: [
|
|
354285
|
+
isLast ? "\u2514\u2500" : "\u251C\u2500",
|
|
354286
|
+
" ",
|
|
354287
|
+
isInProgress ? "\u25D0" : STATUS_ICONS2[todo.status],
|
|
354288
|
+
" "
|
|
354289
|
+
] }),
|
|
354290
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
354291
|
+
Text3,
|
|
354292
|
+
{
|
|
354293
|
+
color,
|
|
354294
|
+
dimColor: isCompleted,
|
|
354295
|
+
strikethrough: isCompleted,
|
|
354296
|
+
children: isInProgress && todo.activeForm ? todo.activeForm : todo.content
|
|
354297
|
+
}
|
|
354298
|
+
)
|
|
354299
|
+
] }, todo.id);
|
|
354300
|
+
}),
|
|
354301
|
+
todos.length > (compact ? 3 : 5) && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
354302
|
+
"\u2514\u2500 ... and ",
|
|
354303
|
+
todos.length - (compact ? 3 : 5),
|
|
354304
|
+
" more"
|
|
354305
|
+
] })
|
|
354084
354306
|
] })
|
|
354085
|
-
]
|
|
354086
|
-
|
|
354087
|
-
|
|
354088
|
-
|
|
354089
|
-
|
|
354090
|
-
|
|
354307
|
+
]
|
|
354308
|
+
}
|
|
354309
|
+
),
|
|
354310
|
+
consultationActive && allQuestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
|
|
354311
|
+
Box_default,
|
|
354312
|
+
{
|
|
354313
|
+
flexDirection: "column",
|
|
354314
|
+
borderStyle: "round",
|
|
354315
|
+
borderColor: Colors.AccentYellow,
|
|
354316
|
+
paddingX: 1,
|
|
354317
|
+
marginTop: 1,
|
|
354318
|
+
children: [
|
|
354319
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { justifyContent: "space-between", children: [
|
|
354320
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: Colors.AccentYellow, bold: true, children: "\u{1F4DD} Questions for You" }),
|
|
354321
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
354322
|
+
allQuestions.length,
|
|
354323
|
+
" pending"
|
|
354324
|
+
] })
|
|
354325
|
+
] }),
|
|
354326
|
+
allQuestions.slice(0, 2).map((q) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Box_default, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: Colors.AccentYellow, children: [
|
|
354327
|
+
"\u2022 ",
|
|
354328
|
+
q.question
|
|
354329
|
+
] }) }, q.id)),
|
|
354330
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: theme.text.secondary, dimColor: true, children: "Answer in the chat to provide context" })
|
|
354331
|
+
]
|
|
354332
|
+
}
|
|
354333
|
+
),
|
|
354334
|
+
stuckWarning && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Box_default, { paddingLeft: 1, marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Text3, { color: Colors.AccentYellow, children: "\u26A0\uFE0F Operation seems stuck. Press ESC to cancel." }) }),
|
|
354335
|
+
computed.cacheEfficiency > 0 && totalInputTokens + totalOutputTokens > 1e4 && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Box_default, { paddingLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Text3, { color: theme.text.secondary, dimColor: true, children: [
|
|
354336
|
+
"\u{1F4BE} ",
|
|
354337
|
+
computed.cacheEfficiency.toFixed(0),
|
|
354338
|
+
"% cache efficiency"
|
|
354339
|
+
] }) })
|
|
354340
|
+
] });
|
|
354341
|
+
}, "TaskMasterPanel");
|
|
354342
|
+
function getCommentColor(type) {
|
|
354343
|
+
switch (type) {
|
|
354344
|
+
case "success":
|
|
354345
|
+
return Colors.AccentGreen;
|
|
354346
|
+
case "warning":
|
|
354347
|
+
return Colors.AccentYellow;
|
|
354348
|
+
case "error":
|
|
354349
|
+
return Colors.AccentRed;
|
|
354350
|
+
default:
|
|
354351
|
+
return theme.text.secondary;
|
|
354352
|
+
}
|
|
354353
|
+
}
|
|
354354
|
+
__name(getCommentColor, "getCommentColor");
|
|
354091
354355
|
|
|
354092
354356
|
// packages/cli/src/ui/layouts/DefaultAppLayout.tsx
|
|
354093
|
-
var
|
|
354357
|
+
var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1);
|
|
354094
354358
|
var DefaultAppLayout = /* @__PURE__ */ __name(({
|
|
354095
354359
|
width = "90%"
|
|
354096
354360
|
}) => {
|
|
354097
354361
|
const uiState = useUIState();
|
|
354098
|
-
return /* @__PURE__ */ (0,
|
|
354099
|
-
/* @__PURE__ */ (0,
|
|
354100
|
-
/* @__PURE__ */ (0,
|
|
354101
|
-
/* @__PURE__ */ (0,
|
|
354102
|
-
/* @__PURE__ */ (0,
|
|
354103
|
-
/* @__PURE__ */ (0,
|
|
354104
|
-
uiState.dialogsVisible ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
354362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Box_default, { flexDirection: "column", width, children: [
|
|
354363
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(MainContent, {}),
|
|
354364
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Box_default, { flexDirection: "column", ref: uiState.mainControlsRef, children: [
|
|
354365
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Notifications, {}),
|
|
354366
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(TaskMasterPanel, { compact: true }),
|
|
354367
|
+
uiState.dialogsVisible ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
|
|
354105
354368
|
DialogManager,
|
|
354106
354369
|
{
|
|
354107
354370
|
terminalWidth: uiState.terminalWidth,
|
|
354108
354371
|
addItem: uiState.historyManager.addItem
|
|
354109
354372
|
}
|
|
354110
|
-
) : /* @__PURE__ */ (0,
|
|
354111
|
-
/* @__PURE__ */ (0,
|
|
354373
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Composer, {}),
|
|
354374
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ExitWarning, {})
|
|
354112
354375
|
] })
|
|
354113
354376
|
] });
|
|
354114
354377
|
}, "DefaultAppLayout");
|
|
354115
354378
|
|
|
354116
354379
|
// packages/cli/src/ui/App.tsx
|
|
354117
|
-
var
|
|
354380
|
+
var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1);
|
|
354118
354381
|
var getContainerWidth = /* @__PURE__ */ __name((terminalWidth) => {
|
|
354119
354382
|
if (terminalWidth <= 80) {
|
|
354120
354383
|
return "98%";
|
|
@@ -354132,9 +354395,9 @@ var App2 = /* @__PURE__ */ __name(() => {
|
|
|
354132
354395
|
const { columns } = useTerminalSize();
|
|
354133
354396
|
const containerWidth = getContainerWidth(columns);
|
|
354134
354397
|
if (uiState.quittingMessages) {
|
|
354135
|
-
return /* @__PURE__ */ (0,
|
|
354398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(QuittingDisplay, {});
|
|
354136
354399
|
}
|
|
354137
|
-
return /* @__PURE__ */ (0,
|
|
354400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(StreamingContext.Provider, { value: uiState.streamingState, children: isScreenReaderEnabled ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ScreenReaderAppLayout, {}) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(DefaultAppLayout, { width: containerWidth }) });
|
|
354138
354401
|
}, "App");
|
|
354139
354402
|
|
|
354140
354403
|
// packages/cli/src/ui/AppContainer.tsx
|
|
@@ -361278,17 +361541,143 @@ function useMessageQueue({
|
|
|
361278
361541
|
}
|
|
361279
361542
|
__name(useMessageQueue, "useMessageQueue");
|
|
361280
361543
|
|
|
361281
|
-
// packages/cli/src/ui/hooks/
|
|
361544
|
+
// packages/cli/src/ui/hooks/useConsultationGenerator.ts
|
|
361282
361545
|
init_esbuild_shims();
|
|
361283
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);
|
|
361284
361673
|
function useAutoAcceptIndicator({
|
|
361285
361674
|
config,
|
|
361286
361675
|
addItem,
|
|
361287
361676
|
onApprovalModeChange
|
|
361288
361677
|
}) {
|
|
361289
361678
|
const currentConfigValue = config.getApprovalMode();
|
|
361290
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
361291
|
-
(0,
|
|
361679
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react128.useState)(currentConfigValue);
|
|
361680
|
+
(0, import_react128.useEffect)(() => {
|
|
361292
361681
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
361293
361682
|
}, [currentConfigValue]);
|
|
361294
361683
|
useKeypress(
|
|
@@ -361321,14 +361710,14 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
361321
361710
|
|
|
361322
361711
|
// packages/cli/src/ui/hooks/useWorkspaceMigration.ts
|
|
361323
361712
|
init_esbuild_shims();
|
|
361324
|
-
var
|
|
361713
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
361325
361714
|
import process50 from "node:process";
|
|
361326
361715
|
function useWorkspaceMigration(settings) {
|
|
361327
|
-
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0,
|
|
361328
|
-
const [workspaceExtensions, setWorkspaceExtensions] = (0,
|
|
361716
|
+
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0, import_react129.useState)(false);
|
|
361717
|
+
const [workspaceExtensions, setWorkspaceExtensions] = (0, import_react129.useState)(
|
|
361329
361718
|
[]
|
|
361330
361719
|
);
|
|
361331
|
-
(0,
|
|
361720
|
+
(0, import_react129.useEffect)(() => {
|
|
361332
361721
|
if (!(settings.merged.experimental?.extensionManagement ?? true)) {
|
|
361333
361722
|
return;
|
|
361334
361723
|
}
|
|
@@ -361370,13 +361759,13 @@ __name(useWorkspaceMigration, "useWorkspaceMigration");
|
|
|
361370
361759
|
|
|
361371
361760
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
361372
361761
|
init_esbuild_shims();
|
|
361373
|
-
var
|
|
361762
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
361374
361763
|
import fs96 from "node:fs";
|
|
361375
361764
|
import fsPromises7 from "node:fs/promises";
|
|
361376
361765
|
import path111 from "node:path";
|
|
361377
361766
|
function useGitBranchName(cwd7) {
|
|
361378
|
-
const [branchName, setBranchName] = (0,
|
|
361379
|
-
const fetchBranchName = (0,
|
|
361767
|
+
const [branchName, setBranchName] = (0, import_react130.useState)(void 0);
|
|
361768
|
+
const fetchBranchName = (0, import_react130.useCallback)(async () => {
|
|
361380
361769
|
try {
|
|
361381
361770
|
if (!isCommandAvailable("git").available) {
|
|
361382
361771
|
return;
|
|
@@ -361401,7 +361790,7 @@ function useGitBranchName(cwd7) {
|
|
|
361401
361790
|
setBranchName(void 0);
|
|
361402
361791
|
}
|
|
361403
361792
|
}, [cwd7, setBranchName]);
|
|
361404
|
-
(0,
|
|
361793
|
+
(0, import_react130.useEffect)(() => {
|
|
361405
361794
|
fetchBranchName();
|
|
361406
361795
|
const gitLogsHeadPath = path111.join(cwd7, ".git", "logs", "HEAD");
|
|
361407
361796
|
let watcher;
|
|
@@ -361427,7 +361816,7 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
361427
361816
|
|
|
361428
361817
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
361429
361818
|
init_esbuild_shims();
|
|
361430
|
-
var
|
|
361819
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
361431
361820
|
function confirmationRequestsReducer(state, action) {
|
|
361432
361821
|
switch (action.type) {
|
|
361433
361822
|
case "add":
|
|
@@ -361441,15 +361830,15 @@ function confirmationRequestsReducer(state, action) {
|
|
|
361441
361830
|
}
|
|
361442
361831
|
__name(confirmationRequestsReducer, "confirmationRequestsReducer");
|
|
361443
361832
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) => {
|
|
361444
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
361833
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react131.useReducer)(
|
|
361445
361834
|
extensionUpdatesReducer,
|
|
361446
361835
|
initialExtensionUpdatesState
|
|
361447
361836
|
);
|
|
361448
361837
|
const [
|
|
361449
361838
|
confirmUpdateExtensionRequests,
|
|
361450
361839
|
dispatchConfirmUpdateExtensionRequests
|
|
361451
|
-
] = (0,
|
|
361452
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
361840
|
+
] = (0, import_react131.useReducer)(confirmationRequestsReducer, []);
|
|
361841
|
+
const addConfirmUpdateExtensionRequest = (0, import_react131.useCallback)(
|
|
361453
361842
|
(original) => {
|
|
361454
361843
|
const wrappedRequest = {
|
|
361455
361844
|
prompt: original.prompt,
|
|
@@ -361468,7 +361857,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
361468
361857
|
},
|
|
361469
361858
|
[dispatchConfirmUpdateExtensionRequests]
|
|
361470
361859
|
);
|
|
361471
|
-
(0,
|
|
361860
|
+
(0, import_react131.useEffect)(() => {
|
|
361472
361861
|
(async () => {
|
|
361473
361862
|
await checkForAllExtensionUpdates(
|
|
361474
361863
|
extensions,
|
|
@@ -361476,7 +361865,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
361476
361865
|
);
|
|
361477
361866
|
})();
|
|
361478
361867
|
}, [extensions, extensions.length, dispatchExtensionStateUpdate]);
|
|
361479
|
-
(0,
|
|
361868
|
+
(0, import_react131.useEffect)(() => {
|
|
361480
361869
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
361481
361870
|
return;
|
|
361482
361871
|
}
|
|
@@ -361541,7 +361930,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
361541
361930
|
addItem,
|
|
361542
361931
|
cwd7
|
|
361543
361932
|
]);
|
|
361544
|
-
const extensionsUpdateStateComputed = (0,
|
|
361933
|
+
const extensionsUpdateStateComputed = (0, import_react131.useMemo)(() => {
|
|
361545
361934
|
const result = /* @__PURE__ */ new Map();
|
|
361546
361935
|
for (const [
|
|
361547
361936
|
key,
|
|
@@ -361562,13 +361951,13 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
361562
361951
|
|
|
361563
361952
|
// packages/cli/src/ui/hooks/useQuitConfirmation.ts
|
|
361564
361953
|
init_esbuild_shims();
|
|
361565
|
-
var
|
|
361954
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
361566
361955
|
var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
361567
|
-
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0,
|
|
361568
|
-
const showQuitConfirmation = (0,
|
|
361956
|
+
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0, import_react132.useState)(false);
|
|
361957
|
+
const showQuitConfirmation = (0, import_react132.useCallback)(() => {
|
|
361569
361958
|
setIsQuitConfirmationOpen(true);
|
|
361570
361959
|
}, []);
|
|
361571
|
-
const handleQuitConfirmationSelect = (0,
|
|
361960
|
+
const handleQuitConfirmationSelect = (0, import_react132.useCallback)((choice2) => {
|
|
361572
361961
|
setIsQuitConfirmationOpen(false);
|
|
361573
361962
|
if (choice2 === "cancel" /* CANCEL */) {
|
|
361574
361963
|
return { shouldQuit: false, action: "cancel" };
|
|
@@ -361590,14 +361979,14 @@ var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
|
361590
361979
|
|
|
361591
361980
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
361592
361981
|
init_esbuild_shims();
|
|
361593
|
-
var
|
|
361982
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
361594
361983
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
361595
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
361596
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
361597
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
361598
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
361599
|
-
const [inputFillText, setInputFillText] = (0,
|
|
361600
|
-
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 () => {
|
|
361601
361990
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
361602
361991
|
return;
|
|
361603
361992
|
}
|
|
@@ -361611,7 +362000,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
361611
362000
|
console.debug("Welcome back check failed:", error);
|
|
361612
362001
|
}
|
|
361613
362002
|
}, [settings.ui?.enableWelcomeBack]);
|
|
361614
|
-
const handleWelcomeBackSelection = (0,
|
|
362003
|
+
const handleWelcomeBackSelection = (0, import_react133.useCallback)(
|
|
361615
362004
|
(choice2) => {
|
|
361616
362005
|
setWelcomeBackChoice(choice2);
|
|
361617
362006
|
setShowWelcomeBackDialog(false);
|
|
@@ -361623,21 +362012,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
361623
362012
|
},
|
|
361624
362013
|
[welcomeBackInfo]
|
|
361625
362014
|
);
|
|
361626
|
-
const handleWelcomeBackClose = (0,
|
|
362015
|
+
const handleWelcomeBackClose = (0, import_react133.useCallback)(() => {
|
|
361627
362016
|
setWelcomeBackChoice("restart");
|
|
361628
362017
|
setShowWelcomeBackDialog(false);
|
|
361629
362018
|
}, []);
|
|
361630
|
-
const clearInputFill = (0,
|
|
362019
|
+
const clearInputFill = (0, import_react133.useCallback)(() => {
|
|
361631
362020
|
setShouldFillInput(false);
|
|
361632
362021
|
setInputFillText(null);
|
|
361633
362022
|
}, []);
|
|
361634
|
-
(0,
|
|
362023
|
+
(0, import_react133.useEffect)(() => {
|
|
361635
362024
|
if (shouldFillInput && inputFillText) {
|
|
361636
362025
|
buffer.setText(inputFillText);
|
|
361637
362026
|
clearInputFill();
|
|
361638
362027
|
}
|
|
361639
362028
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
361640
|
-
(0,
|
|
362029
|
+
(0, import_react133.useEffect)(() => {
|
|
361641
362030
|
checkWelcomeBack();
|
|
361642
362031
|
}, [checkWelcomeBack]);
|
|
361643
362032
|
return {
|
|
@@ -361658,9 +362047,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
361658
362047
|
|
|
361659
362048
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
361660
362049
|
init_esbuild_shims();
|
|
361661
|
-
var
|
|
362050
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
361662
362051
|
function useDialogClose(options2) {
|
|
361663
|
-
const closeAnyOpenDialog = (0,
|
|
362052
|
+
const closeAnyOpenDialog = (0, import_react134.useCallback)(() => {
|
|
361664
362053
|
if (options2.isThemeDialogOpen) {
|
|
361665
362054
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
361666
362055
|
return true;
|
|
@@ -361692,14 +362081,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
361692
362081
|
|
|
361693
362082
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
361694
362083
|
init_esbuild_shims();
|
|
361695
|
-
var
|
|
362084
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
361696
362085
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
361697
|
-
const hasHandled = (0,
|
|
361698
|
-
const authErrorRef = (0,
|
|
361699
|
-
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);
|
|
361700
362089
|
authErrorRef.current = authError;
|
|
361701
362090
|
onAuthErrorRef.current = onAuthError;
|
|
361702
|
-
(0,
|
|
362091
|
+
(0, import_react135.useEffect)(() => {
|
|
361703
362092
|
if (hasHandled.current) {
|
|
361704
362093
|
return;
|
|
361705
362094
|
}
|
|
@@ -361712,13 +362101,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
361712
362101
|
|
|
361713
362102
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
361714
362103
|
init_esbuild_shims();
|
|
361715
|
-
var
|
|
362104
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
361716
362105
|
function useSubagentCreateDialog() {
|
|
361717
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
361718
|
-
const openSubagentCreateDialog = (0,
|
|
362106
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react136.useState)(false);
|
|
362107
|
+
const openSubagentCreateDialog = (0, import_react136.useCallback)(() => {
|
|
361719
362108
|
setIsSubagentCreateDialogOpen(true);
|
|
361720
362109
|
}, []);
|
|
361721
|
-
const closeSubagentCreateDialog = (0,
|
|
362110
|
+
const closeSubagentCreateDialog = (0, import_react136.useCallback)(() => {
|
|
361722
362111
|
setIsSubagentCreateDialogOpen(false);
|
|
361723
362112
|
}, []);
|
|
361724
362113
|
return {
|
|
@@ -361731,13 +362120,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
361731
362120
|
|
|
361732
362121
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
361733
362122
|
init_esbuild_shims();
|
|
361734
|
-
var
|
|
362123
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
361735
362124
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
361736
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
361737
|
-
const openAgentsManagerDialog = (0,
|
|
362125
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react137.useState)(false);
|
|
362126
|
+
const openAgentsManagerDialog = (0, import_react137.useCallback)(() => {
|
|
361738
362127
|
setIsAgentsManagerDialogOpen(true);
|
|
361739
362128
|
}, []);
|
|
361740
|
-
const closeAgentsManagerDialog = (0,
|
|
362129
|
+
const closeAgentsManagerDialog = (0, import_react137.useCallback)(() => {
|
|
361741
362130
|
setIsAgentsManagerDialogOpen(false);
|
|
361742
362131
|
}, []);
|
|
361743
362132
|
return {
|
|
@@ -361749,7 +362138,7 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
361749
362138
|
|
|
361750
362139
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
361751
362140
|
init_esbuild_shims();
|
|
361752
|
-
var
|
|
362141
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
361753
362142
|
|
|
361754
362143
|
// packages/cli/src/utils/attentionNotification.ts
|
|
361755
362144
|
init_esbuild_shims();
|
|
@@ -361777,9 +362166,9 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
361777
362166
|
streamingState,
|
|
361778
362167
|
elapsedTime
|
|
361779
362168
|
}) => {
|
|
361780
|
-
const awaitingNotificationSentRef = (0,
|
|
361781
|
-
const respondingElapsedRef = (0,
|
|
361782
|
-
(0,
|
|
362169
|
+
const awaitingNotificationSentRef = (0, import_react138.useRef)(false);
|
|
362170
|
+
const respondingElapsedRef = (0, import_react138.useRef)(0);
|
|
362171
|
+
(0, import_react138.useEffect)(() => {
|
|
361783
362172
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
361784
362173
|
notifyTerminalAttention("tool_approval" /* ToolApproval */);
|
|
361785
362174
|
awaitingNotificationSentRef.current = true;
|
|
@@ -361788,7 +362177,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
361788
362177
|
awaitingNotificationSentRef.current = false;
|
|
361789
362178
|
}
|
|
361790
362179
|
}, [isFocused, streamingState]);
|
|
361791
|
-
(0,
|
|
362180
|
+
(0, import_react138.useEffect)(() => {
|
|
361792
362181
|
if (streamingState === "responding" /* Responding */) {
|
|
361793
362182
|
respondingElapsedRef.current = elapsedTime;
|
|
361794
362183
|
return;
|
|
@@ -361805,7 +362194,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
361805
362194
|
}, "useAttentionNotifications");
|
|
361806
362195
|
|
|
361807
362196
|
// packages/cli/src/ui/AppContainer.tsx
|
|
361808
|
-
var
|
|
362197
|
+
var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1);
|
|
361809
362198
|
var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
|
|
361810
362199
|
function isToolExecuting(pendingHistoryItems) {
|
|
361811
362200
|
return pendingHistoryItems.some((item) => {
|
|
@@ -361824,25 +362213,25 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361824
362213
|
const { settings, config, initializationResult } = props;
|
|
361825
362214
|
const historyManager = useHistory();
|
|
361826
362215
|
useMemoryMonitor(historyManager);
|
|
361827
|
-
const [corgiMode, setCorgiMode] = (0,
|
|
361828
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
361829
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
361830
|
-
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)(
|
|
361831
362220
|
initializationResult.themeError
|
|
361832
362221
|
);
|
|
361833
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
361834
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
361835
|
-
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)(
|
|
361836
362225
|
initializationResult.OSAMdFileCount
|
|
361837
362226
|
);
|
|
361838
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
361839
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
361840
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
361841
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
361842
|
-
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)(
|
|
361843
362232
|
config.isTrustedFolder()
|
|
361844
362233
|
);
|
|
361845
|
-
const [systemPromptPreset, setSystemPromptPreset] = (0,
|
|
362234
|
+
const [systemPromptPreset, setSystemPromptPreset] = (0, import_react139.useState)(
|
|
361846
362235
|
null
|
|
361847
362236
|
);
|
|
361848
362237
|
const extensions = config.getExtensions();
|
|
@@ -361857,38 +362246,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361857
362246
|
historyManager.addItem,
|
|
361858
362247
|
config.getWorkingDir()
|
|
361859
362248
|
);
|
|
361860
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
361861
|
-
const openPermissionsDialog = (0,
|
|
362249
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react139.useState)(false);
|
|
362250
|
+
const openPermissionsDialog = (0, import_react139.useCallback)(
|
|
361862
362251
|
() => setPermissionsDialogOpen(true),
|
|
361863
362252
|
[]
|
|
361864
362253
|
);
|
|
361865
|
-
const closePermissionsDialog = (0,
|
|
362254
|
+
const closePermissionsDialog = (0, import_react139.useCallback)(
|
|
361866
362255
|
() => setPermissionsDialogOpen(false),
|
|
361867
362256
|
[]
|
|
361868
362257
|
);
|
|
361869
|
-
const getEffectiveModel2 = (0,
|
|
362258
|
+
const getEffectiveModel2 = (0, import_react139.useCallback)(() => {
|
|
361870
362259
|
if (config.isInFallbackMode()) {
|
|
361871
362260
|
return DEFAULT_OSA_FLASH_MODEL;
|
|
361872
362261
|
}
|
|
361873
362262
|
return config.getModel();
|
|
361874
362263
|
}, [config]);
|
|
361875
|
-
const [currentModel, setCurrentModel] = (0,
|
|
361876
|
-
const [userTier] = (0,
|
|
361877
|
-
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);
|
|
361878
362267
|
const logger6 = useLogger(config.storage);
|
|
361879
|
-
const [userMessages, setUserMessages] = (0,
|
|
362268
|
+
const [userMessages, setUserMessages] = (0, import_react139.useState)([]);
|
|
361880
362269
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
361881
362270
|
const { stdin, setRawMode } = use_stdin_default();
|
|
361882
362271
|
const { stdout } = use_stdout_default();
|
|
361883
362272
|
const { stats: sessionStats } = useSessionStats();
|
|
361884
362273
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
361885
|
-
const mainControlsRef = (0,
|
|
361886
|
-
const originalTitleRef = (0,
|
|
362274
|
+
const mainControlsRef = (0, import_react139.useRef)(null);
|
|
362275
|
+
const originalTitleRef = (0, import_react139.useRef)(
|
|
361887
362276
|
computeWindowTitle(basename14(config.getTargetDir()))
|
|
361888
362277
|
);
|
|
361889
|
-
const lastTitleRef = (0,
|
|
362278
|
+
const lastTitleRef = (0, import_react139.useRef)(null);
|
|
361890
362279
|
const staticExtraHeight = 3;
|
|
361891
|
-
(0,
|
|
362280
|
+
(0, import_react139.useEffect)(() => {
|
|
361892
362281
|
(async () => {
|
|
361893
362282
|
await config.initialize();
|
|
361894
362283
|
setConfigInitialized(true);
|
|
@@ -361898,11 +362287,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361898
362287
|
await ideClient.disconnect();
|
|
361899
362288
|
});
|
|
361900
362289
|
}, [config]);
|
|
361901
|
-
(0,
|
|
362290
|
+
(0, import_react139.useEffect)(
|
|
361902
362291
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
361903
362292
|
[historyManager.addItem]
|
|
361904
362293
|
);
|
|
361905
|
-
(0,
|
|
362294
|
+
(0, import_react139.useEffect)(() => {
|
|
361906
362295
|
const checkModelChange = /* @__PURE__ */ __name(() => {
|
|
361907
362296
|
const effectiveModel = getEffectiveModel2();
|
|
361908
362297
|
if (effectiveModel !== currentModel) {
|
|
@@ -361918,7 +362307,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361918
362307
|
handleNewMessage,
|
|
361919
362308
|
clearConsoleMessages: clearConsoleMessagesState
|
|
361920
362309
|
} = useConsoleMessages();
|
|
361921
|
-
(0,
|
|
362310
|
+
(0, import_react139.useEffect)(() => {
|
|
361922
362311
|
const consolePatcher = new ConsolePatcher({
|
|
361923
362312
|
onNewMessage: handleNewMessage,
|
|
361924
362313
|
debugMode: config.getDebugMode()
|
|
@@ -361926,13 +362315,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361926
362315
|
consolePatcher.patch();
|
|
361927
362316
|
registerCleanup(consolePatcher.cleanup);
|
|
361928
362317
|
}, [handleNewMessage, config]);
|
|
361929
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
362318
|
+
const { inputWidth, suggestionsWidth } = (0, import_react139.useMemo)(() => {
|
|
361930
362319
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
361931
362320
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
361932
362321
|
}, [terminalWidth]);
|
|
361933
362322
|
const mainAreaWidth = Math.floor(terminalWidth * 0.9);
|
|
361934
362323
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
361935
|
-
const isValidPath = (0,
|
|
362324
|
+
const isValidPath = (0, import_react139.useCallback)((filePath) => {
|
|
361936
362325
|
try {
|
|
361937
362326
|
return fs97.existsSync(filePath) && fs97.statSync(filePath).isFile();
|
|
361938
362327
|
} catch (_e) {
|
|
@@ -361947,7 +362336,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361947
362336
|
isValidPath,
|
|
361948
362337
|
shellModeActive
|
|
361949
362338
|
});
|
|
361950
|
-
(0,
|
|
362339
|
+
(0, import_react139.useEffect)(() => {
|
|
361951
362340
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
361952
362341
|
const pastMessagesRaw = await logger6?.getPreviousUserMessages() || [];
|
|
361953
362342
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -361970,7 +362359,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361970
362359
|
}, "fetchUserMessages");
|
|
361971
362360
|
fetchUserMessages();
|
|
361972
362361
|
}, [historyManager.history, logger6]);
|
|
361973
|
-
const refreshStatic = (0,
|
|
362362
|
+
const refreshStatic = (0, import_react139.useCallback)(() => {
|
|
361974
362363
|
stdout.write(base_exports.clearTerminal);
|
|
361975
362364
|
setHistoryRemountKey((prev) => prev + 1);
|
|
361976
362365
|
}, [setHistoryRemountKey, stdout]);
|
|
@@ -362010,7 +362399,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362010
362399
|
setModelSwitchedFromQuotaError
|
|
362011
362400
|
});
|
|
362012
362401
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
362013
|
-
(0,
|
|
362402
|
+
(0, import_react139.useEffect)(() => {
|
|
362014
362403
|
if (settings.merged.security?.auth?.enforcedType && settings.merged.security?.auth.selectedType && settings.merged.security?.auth.enforcedType !== settings.merged.security?.auth.selectedType) {
|
|
362015
362404
|
onAuthError(
|
|
362016
362405
|
t2(
|
|
@@ -362037,7 +362426,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362037
362426
|
settings.merged.security?.auth?.useExternal,
|
|
362038
362427
|
onAuthError
|
|
362039
362428
|
]);
|
|
362040
|
-
const [editorError, setEditorError] = (0,
|
|
362429
|
+
const [editorError, setEditorError] = (0, import_react139.useState)(null);
|
|
362041
362430
|
const {
|
|
362042
362431
|
isEditorDialogOpen,
|
|
362043
362432
|
openEditorDialog,
|
|
@@ -362064,9 +362453,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362064
362453
|
openAgentsManagerDialog,
|
|
362065
362454
|
closeAgentsManagerDialog
|
|
362066
362455
|
} = useAgentsManagerDialog();
|
|
362067
|
-
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0,
|
|
362068
|
-
const [visionSwitchResolver, setVisionSwitchResolver] = (0,
|
|
362069
|
-
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)(
|
|
362070
362459
|
() => ({
|
|
362071
362460
|
openAuthDialog,
|
|
362072
362461
|
openThemeDialog,
|
|
@@ -362131,14 +362520,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362131
362520
|
extensionsUpdateStateInternal,
|
|
362132
362521
|
isConfigInitialized
|
|
362133
362522
|
);
|
|
362134
|
-
const handleVisionSwitchRequired = (0,
|
|
362523
|
+
const handleVisionSwitchRequired = (0, import_react139.useCallback)(
|
|
362135
362524
|
async (_query) => new Promise((resolve25, reject) => {
|
|
362136
362525
|
setVisionSwitchResolver({ resolve: resolve25, reject });
|
|
362137
362526
|
setIsVisionSwitchDialogOpen(true);
|
|
362138
362527
|
}),
|
|
362139
362528
|
[]
|
|
362140
362529
|
);
|
|
362141
|
-
const handleVisionSwitchSelect = (0,
|
|
362530
|
+
const handleVisionSwitchSelect = (0, import_react139.useCallback)(
|
|
362142
362531
|
(outcome) => {
|
|
362143
362532
|
setIsVisionSwitchDialogOpen(false);
|
|
362144
362533
|
if (visionSwitchResolver) {
|
|
@@ -362149,10 +362538,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362149
362538
|
},
|
|
362150
362539
|
[visionSwitchResolver]
|
|
362151
362540
|
);
|
|
362152
|
-
const onDebugMessage = (0,
|
|
362541
|
+
const onDebugMessage = (0, import_react139.useCallback)((message2) => {
|
|
362153
362542
|
console.debug(message2);
|
|
362154
362543
|
}, []);
|
|
362155
|
-
const performMemoryRefresh = (0,
|
|
362544
|
+
const performMemoryRefresh = (0, import_react139.useCallback)(async () => {
|
|
362156
362545
|
historyManager.addItem(
|
|
362157
362546
|
{
|
|
362158
362547
|
type: "info" /* INFO */,
|
|
@@ -362203,7 +362592,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362203
362592
|
console.error("Error refreshing memory:", error);
|
|
362204
362593
|
}
|
|
362205
362594
|
}, [config, historyManager, settings.merged]);
|
|
362206
|
-
const cancelHandlerRef = (0,
|
|
362595
|
+
const cancelHandlerRef = (0, import_react139.useRef)(() => {
|
|
362207
362596
|
});
|
|
362208
362597
|
const {
|
|
362209
362598
|
streamingState,
|
|
@@ -362250,8 +362639,16 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362250
362639
|
streamingState,
|
|
362251
362640
|
submitQuery
|
|
362252
362641
|
});
|
|
362253
|
-
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)(
|
|
362254
362650
|
(submittedValue) => {
|
|
362651
|
+
setCurrentPrompt(submittedValue);
|
|
362255
362652
|
addMessage(submittedValue);
|
|
362256
362653
|
},
|
|
362257
362654
|
[addMessage]
|
|
@@ -362263,7 +362660,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
362263
362660
|
handleWelcomeBackSelection,
|
|
362264
362661
|
handleWelcomeBackClose
|
|
362265
362662
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
362266
|
-
cancelHandlerRef.current = (0,
|
|
362663
|
+
cancelHandlerRef.current = (0, import_react139.useCallback)(() => {
|
|
362267
362664
|
const pendingHistoryItems2 = [
|
|
362268
362665
|
...pendingSlashCommandHistoryItems,
|
|
362269
362666
|
...pendingOSAHistoryItems
|
|
@@ -362292,7 +362689,7 @@ ${queuedText}` : queuedText;
|
|
|
362292
362689
|
pendingSlashCommandHistoryItems,
|
|
362293
362690
|
pendingOSAHistoryItems
|
|
362294
362691
|
]);
|
|
362295
|
-
const handleClearScreen = (0,
|
|
362692
|
+
const handleClearScreen = (0, import_react139.useCallback)(() => {
|
|
362296
362693
|
historyManager.clearItems();
|
|
362297
362694
|
clearConsoleMessagesState();
|
|
362298
362695
|
console.clear();
|
|
@@ -362300,8 +362697,8 @@ ${queuedText}` : queuedText;
|
|
|
362300
362697
|
}, [historyManager, clearConsoleMessagesState, refreshStatic]);
|
|
362301
362698
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
362302
362699
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */) && !proQuotaRequest;
|
|
362303
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
362304
|
-
(0,
|
|
362700
|
+
const [controlsHeight, setControlsHeight] = (0, import_react139.useState)(0);
|
|
362701
|
+
(0, import_react139.useLayoutEffect)(() => {
|
|
362305
362702
|
if (mainControlsRef.current) {
|
|
362306
362703
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
362307
362704
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -362324,14 +362721,14 @@ ${queuedText}` : queuedText;
|
|
|
362324
362721
|
});
|
|
362325
362722
|
const isFocused = useFocus();
|
|
362326
362723
|
useBracketedPaste();
|
|
362327
|
-
const contextFileNames = (0,
|
|
362724
|
+
const contextFileNames = (0, import_react139.useMemo)(() => {
|
|
362328
362725
|
const fromSettings = settings.merged.context?.fileName;
|
|
362329
362726
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllOSAMdFilenames();
|
|
362330
362727
|
}, [settings.merged.context?.fileName]);
|
|
362331
|
-
const initialPrompt = (0,
|
|
362332
|
-
const initialPromptSubmitted = (0,
|
|
362728
|
+
const initialPrompt = (0, import_react139.useMemo)(() => config.getQuestion(), [config]);
|
|
362729
|
+
const initialPromptSubmitted = (0, import_react139.useRef)(false);
|
|
362333
362730
|
const OSAClient2 = config.getOSAClient();
|
|
362334
|
-
(0,
|
|
362731
|
+
(0, import_react139.useEffect)(() => {
|
|
362335
362732
|
if (activePtyId) {
|
|
362336
362733
|
ShellExecutionService.resizePty(
|
|
362337
362734
|
activePtyId,
|
|
@@ -362340,7 +362737,7 @@ ${queuedText}` : queuedText;
|
|
|
362340
362737
|
);
|
|
362341
362738
|
}
|
|
362342
362739
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
362343
|
-
(0,
|
|
362740
|
+
(0, import_react139.useEffect)(() => {
|
|
362344
362741
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && !isVisionSwitchDialogOpen && welcomeBackChoice !== "restart" && OSAClient2?.isInitialized?.()) {
|
|
362345
362742
|
handleFinalSubmit(initialPrompt);
|
|
362346
362743
|
initialPromptSubmitted.current = true;
|
|
@@ -362358,9 +362755,9 @@ ${queuedText}` : queuedText;
|
|
|
362358
362755
|
welcomeBackChoice,
|
|
362359
362756
|
OSAClient2
|
|
362360
362757
|
]);
|
|
362361
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
362362
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
362363
|
-
(0,
|
|
362758
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react139.useState)(false);
|
|
362759
|
+
const [currentIDE, setCurrentIDE] = (0, import_react139.useState)(null);
|
|
362760
|
+
(0, import_react139.useEffect)(() => {
|
|
362364
362761
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
362365
362762
|
const ideClient = await IdeClient.getInstance();
|
|
362366
362763
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -362371,28 +362768,28 @@ ${queuedText}` : queuedText;
|
|
|
362371
362768
|
const shouldShowIdePrompt = Boolean(
|
|
362372
362769
|
currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
|
|
362373
362770
|
);
|
|
362374
|
-
const [showErrorDetails, setShowErrorDetails] = (0,
|
|
362375
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
362376
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
362377
|
-
const ctrlCTimerRef = (0,
|
|
362378
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
362379
|
-
const ctrlDTimerRef = (0,
|
|
362380
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
362381
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
362382
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
362383
|
-
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);
|
|
362384
362781
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
362385
362782
|
const {
|
|
362386
362783
|
needsRestart: ideNeedsRestart,
|
|
362387
362784
|
restartReason: ideTrustRestartReason
|
|
362388
362785
|
} = useIdeTrustListener();
|
|
362389
|
-
const isInitialMount = (0,
|
|
362390
|
-
(0,
|
|
362786
|
+
const isInitialMount = (0, import_react139.useRef)(true);
|
|
362787
|
+
(0, import_react139.useEffect)(() => {
|
|
362391
362788
|
if (ideNeedsRestart) {
|
|
362392
362789
|
setShowIdeRestartPrompt(true);
|
|
362393
362790
|
}
|
|
362394
362791
|
}, [ideNeedsRestart]);
|
|
362395
|
-
(0,
|
|
362792
|
+
(0, import_react139.useEffect)(() => {
|
|
362396
362793
|
if (isInitialMount.current) {
|
|
362397
362794
|
isInitialMount.current = false;
|
|
362398
362795
|
return;
|
|
@@ -362404,12 +362801,12 @@ ${queuedText}` : queuedText;
|
|
|
362404
362801
|
clearTimeout(handler);
|
|
362405
362802
|
};
|
|
362406
362803
|
}, [terminalWidth, refreshStatic]);
|
|
362407
|
-
(0,
|
|
362804
|
+
(0, import_react139.useEffect)(() => {
|
|
362408
362805
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
362409
362806
|
setIdeContextState(ideContextStore.get());
|
|
362410
362807
|
return unsubscribe;
|
|
362411
362808
|
}, []);
|
|
362412
|
-
(0,
|
|
362809
|
+
(0, import_react139.useEffect)(() => {
|
|
362413
362810
|
const openDebugConsole = /* @__PURE__ */ __name(() => {
|
|
362414
362811
|
setShowErrorDetails(true);
|
|
362415
362812
|
setConstrainHeight(false);
|
|
@@ -362428,10 +362825,10 @@ ${queuedText}` : queuedText;
|
|
|
362428
362825
|
appEvents.off("log-error" /* LogError */, logErrorHandler);
|
|
362429
362826
|
};
|
|
362430
362827
|
}, [handleNewMessage]);
|
|
362431
|
-
const handleEscapePromptChange = (0,
|
|
362828
|
+
const handleEscapePromptChange = (0, import_react139.useCallback)((showPrompt) => {
|
|
362432
362829
|
setShowEscapePrompt(showPrompt);
|
|
362433
362830
|
}, []);
|
|
362434
|
-
const handleIdePromptComplete = (0,
|
|
362831
|
+
const handleIdePromptComplete = (0, import_react139.useCallback)(
|
|
362435
362832
|
(result) => {
|
|
362436
362833
|
if (result.userSelection === "yes") {
|
|
362437
362834
|
handleSlashCommand2("/ide install");
|
|
@@ -362469,7 +362866,7 @@ ${queuedText}` : queuedText;
|
|
|
362469
362866
|
handleWelcomeBackClose,
|
|
362470
362867
|
quitConfirmationRequest
|
|
362471
362868
|
});
|
|
362472
|
-
const handleExit = (0,
|
|
362869
|
+
const handleExit = (0, import_react139.useCallback)(
|
|
362473
362870
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
362474
362871
|
if (pressedOnce) {
|
|
362475
362872
|
if (timerRef.current) {
|
|
@@ -362512,7 +362909,7 @@ ${queuedText}` : queuedText;
|
|
|
362512
362909
|
buffer
|
|
362513
362910
|
]
|
|
362514
362911
|
);
|
|
362515
|
-
const handleGlobalKeypress = (0,
|
|
362912
|
+
const handleGlobalKeypress = (0, import_react139.useCallback)(
|
|
362516
362913
|
(key) => {
|
|
362517
362914
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
362518
362915
|
console.log("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -362585,7 +362982,7 @@ ${queuedText}` : queuedText;
|
|
|
362585
362982
|
]
|
|
362586
362983
|
);
|
|
362587
362984
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
362588
|
-
(0,
|
|
362985
|
+
(0, import_react139.useEffect)(() => {
|
|
362589
362986
|
if (!settings.merged.ui?.showStatusInTitle || settings.merged.ui?.hideWindowTitle)
|
|
362590
362987
|
return;
|
|
362591
362988
|
let title;
|
|
@@ -362607,23 +363004,23 @@ ${queuedText}` : queuedText;
|
|
|
362607
363004
|
settings.merged.ui?.hideWindowTitle,
|
|
362608
363005
|
stdout
|
|
362609
363006
|
]);
|
|
362610
|
-
const filteredConsoleMessages = (0,
|
|
363007
|
+
const filteredConsoleMessages = (0, import_react139.useMemo)(() => {
|
|
362611
363008
|
if (config.getDebugMode()) {
|
|
362612
363009
|
return consoleMessages;
|
|
362613
363010
|
}
|
|
362614
363011
|
return consoleMessages.filter((msg) => msg.type !== "debug");
|
|
362615
363012
|
}, [consoleMessages, config]);
|
|
362616
|
-
const errorCount = (0,
|
|
363013
|
+
const errorCount = (0, import_react139.useMemo)(
|
|
362617
363014
|
() => filteredConsoleMessages.filter((msg) => msg.type === "error").reduce((total, msg) => total + msg.count, 0),
|
|
362618
363015
|
[filteredConsoleMessages]
|
|
362619
363016
|
);
|
|
362620
363017
|
const nightly = props.version.includes("nightly");
|
|
362621
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;
|
|
362622
|
-
const pendingHistoryItems = (0,
|
|
363019
|
+
const pendingHistoryItems = (0, import_react139.useMemo)(
|
|
362623
363020
|
() => [...pendingSlashCommandHistoryItems, ...pendingOSAHistoryItems],
|
|
362624
363021
|
[pendingSlashCommandHistoryItems, pendingOSAHistoryItems]
|
|
362625
363022
|
);
|
|
362626
|
-
const uiState = (0,
|
|
363023
|
+
const uiState = (0, import_react139.useMemo)(
|
|
362627
363024
|
() => ({
|
|
362628
363025
|
history: historyManager.history,
|
|
362629
363026
|
historyManager,
|
|
@@ -362814,7 +363211,7 @@ ${queuedText}` : queuedText;
|
|
|
362814
363211
|
isAgentsManagerDialogOpen
|
|
362815
363212
|
]
|
|
362816
363213
|
);
|
|
362817
|
-
const uiActions = (0,
|
|
363214
|
+
const uiActions = (0, import_react139.useMemo)(
|
|
362818
363215
|
() => ({
|
|
362819
363216
|
handleThemeSelect,
|
|
362820
363217
|
handleThemeHighlight,
|
|
@@ -362882,23 +363279,23 @@ ${queuedText}` : queuedText;
|
|
|
362882
363279
|
closeAgentsManagerDialog
|
|
362883
363280
|
]
|
|
362884
363281
|
);
|
|
362885
|
-
return /* @__PURE__ */ (0,
|
|
363282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
362886
363283
|
AppContext2.Provider,
|
|
362887
363284
|
{
|
|
362888
363285
|
value: {
|
|
362889
363286
|
version: props.version,
|
|
362890
363287
|
startupWarnings: props.startupWarnings || []
|
|
362891
363288
|
},
|
|
362892
|
-
children: /* @__PURE__ */ (0,
|
|
363289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(ShellFocusContext.Provider, { value: isFocused, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(App2, {}) })
|
|
362893
363290
|
}
|
|
362894
363291
|
) }) }) });
|
|
362895
363292
|
}, "AppContainer");
|
|
362896
363293
|
|
|
362897
363294
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
362898
363295
|
init_esbuild_shims();
|
|
362899
|
-
var
|
|
363296
|
+
var import_react140 = __toESM(require_react(), 1);
|
|
362900
363297
|
function useKittyKeyboardProtocol() {
|
|
362901
|
-
const [status] = (0,
|
|
363298
|
+
const [status] = (0, import_react140.useState)({
|
|
362902
363299
|
supported: isKittyProtocolSupported(),
|
|
362903
363300
|
enabled: isKittyProtocolEnabled(),
|
|
362904
363301
|
checking: false
|
|
@@ -365554,7 +365951,7 @@ function toPermissionOptions(confirmation) {
|
|
|
365554
365951
|
__name(toPermissionOptions, "toPermissionOptions");
|
|
365555
365952
|
|
|
365556
365953
|
// packages/cli/src/gemini.tsx
|
|
365557
|
-
var
|
|
365954
|
+
var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1);
|
|
365558
365955
|
function validateDnsResolutionOrder(order) {
|
|
365559
365956
|
const defaultValue = "ipv4first";
|
|
365560
365957
|
if (order === void 0) {
|
|
@@ -365619,14 +366016,14 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
365619
366016
|
const AppWrapper = /* @__PURE__ */ __name(() => {
|
|
365620
366017
|
const kittyProtocolStatus = useKittyKeyboardProtocol();
|
|
365621
366018
|
const nodeMajorVersion = parseInt(process.versions.node.split(".")[0], 10);
|
|
365622
|
-
return /* @__PURE__ */ (0,
|
|
366019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(SettingsContext.Provider, { value: settings, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
365623
366020
|
KeypressProvider,
|
|
365624
366021
|
{
|
|
365625
366022
|
kittyProtocolEnabled: kittyProtocolStatus.enabled,
|
|
365626
366023
|
config,
|
|
365627
366024
|
debugKeystrokeLogging: settings.merged.general?.debugKeystrokeLogging,
|
|
365628
366025
|
pasteWorkaround: process.platform === "win32" || nodeMajorVersion < 20,
|
|
365629
|
-
children: /* @__PURE__ */ (0,
|
|
366026
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(SessionStatsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ConsultationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(TodoProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(VimModeProvider, { settings, children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
365630
366027
|
AppContainer,
|
|
365631
366028
|
{
|
|
365632
366029
|
config,
|
|
@@ -365640,7 +366037,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
365640
366037
|
) });
|
|
365641
366038
|
}, "AppWrapper");
|
|
365642
366039
|
const instance = render_default(
|
|
365643
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0,
|
|
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, {}),
|
|
365644
366041
|
{
|
|
365645
366042
|
exitOnCtrlC: false,
|
|
365646
366043
|
isScreenReaderEnabled: config.getScreenReader()
|