osagent 0.1.16 → 0.1.17
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/README.md +120 -27
- package/dist/cli.js +788 -603
- 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.17";
|
|
146112
146112
|
const userAgent2 = `OSAgent/${version2} (${process.platform}; ${process.arch})`;
|
|
146113
146113
|
const baseHeaders = {
|
|
146114
146114
|
"User-Agent": userAgent2
|
|
@@ -226107,14 +226107,14 @@ var require_react_reconciler_production = __commonJS({
|
|
|
226107
226107
|
__name(markRetryLaneIfNotHydrated, "markRetryLaneIfNotHydrated");
|
|
226108
226108
|
var exports3 = {};
|
|
226109
226109
|
"use strict";
|
|
226110
|
-
var
|
|
226110
|
+
var React30 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
226111
226111
|
Symbol.for("react.scope");
|
|
226112
226112
|
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
226113
226113
|
Symbol.for("react.legacy_hidden");
|
|
226114
226114
|
Symbol.for("react.tracing_marker");
|
|
226115
226115
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
226116
226116
|
Symbol.for("react.view_transition");
|
|
226117
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals =
|
|
226117
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React30.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance2 = $$$config.createInstance;
|
|
226118
226118
|
$$$config.cloneMutableInstance;
|
|
226119
226119
|
var appendInitialChild = $$$config.appendInitialChild, finalizeInitialChildren = $$$config.finalizeInitialChildren, shouldSetTextContent = $$$config.shouldSetTextContent, createTextInstance = $$$config.createTextInstance;
|
|
226120
226120
|
$$$config.cloneMutableTextInstance;
|
|
@@ -237330,14 +237330,14 @@ var require_react_reconciler_development = __commonJS({
|
|
|
237330
237330
|
__name(getLaneLabelMap, "getLaneLabelMap");
|
|
237331
237331
|
var exports3 = {};
|
|
237332
237332
|
"use strict";
|
|
237333
|
-
var
|
|
237333
|
+
var React30 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
237334
237334
|
Symbol.for("react.scope");
|
|
237335
237335
|
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
237336
237336
|
Symbol.for("react.legacy_hidden");
|
|
237337
237337
|
Symbol.for("react.tracing_marker");
|
|
237338
237338
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
237339
237339
|
Symbol.for("react.view_transition");
|
|
237340
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals =
|
|
237340
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React30.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance2 = $$$config.createInstance;
|
|
237341
237341
|
$$$config.cloneMutableInstance;
|
|
237342
237342
|
var appendInitialChild = $$$config.appendInitialChild, finalizeInitialChildren = $$$config.finalizeInitialChildren, shouldSetTextContent = $$$config.shouldSetTextContent, createTextInstance = $$$config.createTextInstance;
|
|
237343
237343
|
$$$config.cloneMutableTextInstance;
|
|
@@ -272878,20 +272878,20 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
272878
272878
|
"object" === typeof node && null !== node && node.$$typeof === REACT_ELEMENT_TYPE && node._store && (node._store.validated = 1);
|
|
272879
272879
|
}
|
|
272880
272880
|
__name(validateChildKeys, "validateChildKeys");
|
|
272881
|
-
var
|
|
272881
|
+
var React30 = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
272882
272882
|
Symbol.for("react.provider");
|
|
272883
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals =
|
|
272883
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React30.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty2 = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
272884
272884
|
return null;
|
|
272885
272885
|
};
|
|
272886
|
-
|
|
272886
|
+
React30 = {
|
|
272887
272887
|
"react-stack-bottom-frame": /* @__PURE__ */ __name(function(callStackForError) {
|
|
272888
272888
|
return callStackForError();
|
|
272889
272889
|
}, "react-stack-bottom-frame")
|
|
272890
272890
|
};
|
|
272891
272891
|
var specialPropKeyWarningShown;
|
|
272892
272892
|
var didWarnAboutElementRef = {};
|
|
272893
|
-
var unknownOwnerDebugStack =
|
|
272894
|
-
|
|
272893
|
+
var unknownOwnerDebugStack = React30["react-stack-bottom-frame"].bind(
|
|
272894
|
+
React30,
|
|
272895
272895
|
UnknownOwner
|
|
272896
272896
|
)();
|
|
272897
272897
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
@@ -294096,7 +294096,7 @@ var measureElement = /* @__PURE__ */ __name((node) => ({
|
|
|
294096
294096
|
var measure_element_default = measureElement;
|
|
294097
294097
|
|
|
294098
294098
|
// packages/cli/src/gemini.tsx
|
|
294099
|
-
var
|
|
294099
|
+
var import_react139 = __toESM(require_react(), 1);
|
|
294100
294100
|
import { randomUUID as randomUUID11 } from "node:crypto";
|
|
294101
294101
|
import dns from "node:dns";
|
|
294102
294102
|
import os44 from "node:os";
|
|
@@ -309690,7 +309690,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
309690
309690
|
// packages/cli/src/utils/version.ts
|
|
309691
309691
|
async function getCliVersion() {
|
|
309692
309692
|
const pkgJson = await getPackageJson();
|
|
309693
|
-
return "0.1.
|
|
309693
|
+
return "0.1.17";
|
|
309694
309694
|
}
|
|
309695
309695
|
__name(getCliVersion, "getCliVersion");
|
|
309696
309696
|
|
|
@@ -313695,7 +313695,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
313695
313695
|
|
|
313696
313696
|
// packages/cli/src/generated/git-commit.ts
|
|
313697
313697
|
init_esbuild_shims();
|
|
313698
|
-
var GIT_COMMIT_INFO2 = "
|
|
313698
|
+
var GIT_COMMIT_INFO2 = "706b93e";
|
|
313699
313699
|
|
|
313700
313700
|
// packages/cli/src/utils/systemInfo.ts
|
|
313701
313701
|
async function getNpmVersion() {
|
|
@@ -314524,6 +314524,118 @@ var compressCommand = {
|
|
|
314524
314524
|
}, "action")
|
|
314525
314525
|
};
|
|
314526
314526
|
|
|
314527
|
+
// packages/cli/src/ui/commands/consultCommand.ts
|
|
314528
|
+
init_esbuild_shims();
|
|
314529
|
+
var consultCommand = {
|
|
314530
|
+
name: "consult",
|
|
314531
|
+
get description() {
|
|
314532
|
+
return t2("Manage consultation mode - gather context through questions");
|
|
314533
|
+
},
|
|
314534
|
+
kind: "built-in" /* BUILT_IN */,
|
|
314535
|
+
subCommands: [
|
|
314536
|
+
{
|
|
314537
|
+
name: "on",
|
|
314538
|
+
get description() {
|
|
314539
|
+
return t2("Enable active consultation mode");
|
|
314540
|
+
},
|
|
314541
|
+
kind: "built-in" /* BUILT_IN */,
|
|
314542
|
+
action: /* @__PURE__ */ __name(async () => {
|
|
314543
|
+
return {
|
|
314544
|
+
type: "message",
|
|
314545
|
+
messageType: "info",
|
|
314546
|
+
content: t2("Consultation mode: ACTIVE\nThe agent will ask clarifying questions as you work.\nPress [a] to answer, [s] to skip questions.")
|
|
314547
|
+
};
|
|
314548
|
+
}, "action")
|
|
314549
|
+
},
|
|
314550
|
+
{
|
|
314551
|
+
name: "off",
|
|
314552
|
+
get description() {
|
|
314553
|
+
return t2("Disable consultation mode");
|
|
314554
|
+
},
|
|
314555
|
+
kind: "built-in" /* BUILT_IN */,
|
|
314556
|
+
action: /* @__PURE__ */ __name(async () => {
|
|
314557
|
+
return {
|
|
314558
|
+
type: "message",
|
|
314559
|
+
messageType: "info",
|
|
314560
|
+
content: t2("Consultation mode: OFF\nNo questions will be asked.")
|
|
314561
|
+
};
|
|
314562
|
+
}, "action")
|
|
314563
|
+
},
|
|
314564
|
+
{
|
|
314565
|
+
name: "blocking",
|
|
314566
|
+
get description() {
|
|
314567
|
+
return t2("Enable blocking mode - high priority questions pause the agent");
|
|
314568
|
+
},
|
|
314569
|
+
kind: "built-in" /* BUILT_IN */,
|
|
314570
|
+
action: /* @__PURE__ */ __name(async () => {
|
|
314571
|
+
return {
|
|
314572
|
+
type: "message",
|
|
314573
|
+
messageType: "info",
|
|
314574
|
+
content: t2("Consultation mode: BLOCKING\nHigh priority questions will pause the agent until answered.\nThis ensures critical decisions get your input.")
|
|
314575
|
+
};
|
|
314576
|
+
}, "action")
|
|
314577
|
+
},
|
|
314578
|
+
{
|
|
314579
|
+
name: "context",
|
|
314580
|
+
get description() {
|
|
314581
|
+
return t2("Show collected context from consultation");
|
|
314582
|
+
},
|
|
314583
|
+
kind: "built-in" /* BUILT_IN */,
|
|
314584
|
+
action: /* @__PURE__ */ __name(async () => {
|
|
314585
|
+
return {
|
|
314586
|
+
type: "message",
|
|
314587
|
+
messageType: "info",
|
|
314588
|
+
content: t2("Use this to view all context gathered through consultation.\n(Context will appear here when questions are answered)")
|
|
314589
|
+
};
|
|
314590
|
+
}, "action")
|
|
314591
|
+
},
|
|
314592
|
+
{
|
|
314593
|
+
name: "clear",
|
|
314594
|
+
get description() {
|
|
314595
|
+
return t2("Clear all collected consultation context");
|
|
314596
|
+
},
|
|
314597
|
+
kind: "built-in" /* BUILT_IN */,
|
|
314598
|
+
action: /* @__PURE__ */ __name(async () => {
|
|
314599
|
+
return {
|
|
314600
|
+
type: "message",
|
|
314601
|
+
messageType: "info",
|
|
314602
|
+
content: t2("Consultation context cleared.")
|
|
314603
|
+
};
|
|
314604
|
+
}, "action")
|
|
314605
|
+
}
|
|
314606
|
+
],
|
|
314607
|
+
action: /* @__PURE__ */ __name(async (_context, args) => {
|
|
314608
|
+
const argTrimmed = args.trim().toLowerCase();
|
|
314609
|
+
if (!argTrimmed) {
|
|
314610
|
+
return {
|
|
314611
|
+
type: "message",
|
|
314612
|
+
messageType: "info",
|
|
314613
|
+
content: t2(`Consultation Mode
|
|
314614
|
+
|
|
314615
|
+
The consultation system gathers context from you as you work:
|
|
314616
|
+
- Questions appear below the loading indicator
|
|
314617
|
+
- Press [a] to answer, [s] to skip
|
|
314618
|
+
- Context is used to improve agent responses
|
|
314619
|
+
|
|
314620
|
+
Commands:
|
|
314621
|
+
/consult on - Active mode (questions shown, agent continues)
|
|
314622
|
+
/consult blocking - Blocking mode (high-priority questions pause agent)
|
|
314623
|
+
/consult off - Disable consultation
|
|
314624
|
+
/consult context - View collected context
|
|
314625
|
+
/consult clear - Clear all context
|
|
314626
|
+
|
|
314627
|
+
Current: Active mode`)
|
|
314628
|
+
};
|
|
314629
|
+
}
|
|
314630
|
+
return {
|
|
314631
|
+
type: "message",
|
|
314632
|
+
messageType: "error",
|
|
314633
|
+
content: t2(`Unknown option: ${argTrimmed}
|
|
314634
|
+
Use /consult for help.`)
|
|
314635
|
+
};
|
|
314636
|
+
}, "action")
|
|
314637
|
+
};
|
|
314638
|
+
|
|
314527
314639
|
// packages/cli/src/ui/commands/continueCommand.ts
|
|
314528
314640
|
init_esbuild_shims();
|
|
314529
314641
|
import * as fs72 from "node:fs/promises";
|
|
@@ -319081,6 +319193,7 @@ var BuiltinCommandLoader = class {
|
|
|
319081
319193
|
chatCommand,
|
|
319082
319194
|
clearCommand,
|
|
319083
319195
|
compressCommand,
|
|
319196
|
+
consultCommand,
|
|
319084
319197
|
continueCommand,
|
|
319085
319198
|
openaiProfileCommand,
|
|
319086
319199
|
copyCommand,
|
|
@@ -323005,7 +323118,7 @@ __name(runNonInteractiveStreamJson, "runNonInteractiveStreamJson");
|
|
|
323005
323118
|
|
|
323006
323119
|
// packages/cli/src/ui/AppContainer.tsx
|
|
323007
323120
|
init_esbuild_shims();
|
|
323008
|
-
var
|
|
323121
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
323009
323122
|
|
|
323010
323123
|
// packages/cli/src/ui/App.tsx
|
|
323011
323124
|
init_esbuild_shims();
|
|
@@ -350365,7 +350478,7 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
350365
350478
|
|
|
350366
350479
|
// packages/cli/src/ui/components/Composer.tsx
|
|
350367
350480
|
init_esbuild_shims();
|
|
350368
|
-
var
|
|
350481
|
+
var import_react101 = __toESM(require_react(), 1);
|
|
350369
350482
|
|
|
350370
350483
|
// packages/cli/src/ui/components/LoadingIndicator.tsx
|
|
350371
350484
|
init_esbuild_shims();
|
|
@@ -350444,9 +350557,75 @@ var LoadingIndicator = /* @__PURE__ */ __name(({
|
|
|
350444
350557
|
] });
|
|
350445
350558
|
}, "LoadingIndicator");
|
|
350446
350559
|
|
|
350447
|
-
// packages/cli/src/ui/components/
|
|
350560
|
+
// packages/cli/src/ui/components/ConsultationDisplay.tsx
|
|
350448
350561
|
init_esbuild_shims();
|
|
350562
|
+
var import_react87 = __toESM(require_react(), 1);
|
|
350449
350563
|
var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1);
|
|
350564
|
+
var ConsultationDisplay = /* @__PURE__ */ __name(({
|
|
350565
|
+
isStreamingActive = false,
|
|
350566
|
+
currentQuestion = null,
|
|
350567
|
+
queueCount = 0,
|
|
350568
|
+
isBlocking = false,
|
|
350569
|
+
consultationMode = "active"
|
|
350570
|
+
}) => {
|
|
350571
|
+
if (!currentQuestion) {
|
|
350572
|
+
return null;
|
|
350573
|
+
}
|
|
350574
|
+
const priorityColors = {
|
|
350575
|
+
high: theme.status.error,
|
|
350576
|
+
medium: theme.status.warning,
|
|
350577
|
+
low: theme.text.secondary
|
|
350578
|
+
};
|
|
350579
|
+
const categoryIcons = {
|
|
350580
|
+
architecture: "[arch]",
|
|
350581
|
+
requirements: "[req]",
|
|
350582
|
+
clarification: "[?]",
|
|
350583
|
+
preference: "[pref]"
|
|
350584
|
+
};
|
|
350585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, paddingX: 1, children: [
|
|
350586
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Box_default, { marginBottom: 0, children: [
|
|
350587
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text3, { color: theme.text.accent, bold: true, children: isBlocking ? "! " : "? " }),
|
|
350588
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
350589
|
+
t2("Consultation"),
|
|
350590
|
+
queueCount > 0 && ` (+${queueCount} more)`
|
|
350591
|
+
] }),
|
|
350592
|
+
isBlocking && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Text3, { color: theme.status.warning, children: [
|
|
350593
|
+
" ",
|
|
350594
|
+
t2("[Waiting for answer]")
|
|
350595
|
+
] })
|
|
350596
|
+
] }),
|
|
350597
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
350598
|
+
Box_default,
|
|
350599
|
+
{
|
|
350600
|
+
flexDirection: "column",
|
|
350601
|
+
borderStyle: "single",
|
|
350602
|
+
borderColor: isBlocking ? theme.status.warning : theme.border.default,
|
|
350603
|
+
paddingX: 1,
|
|
350604
|
+
marginTop: 0,
|
|
350605
|
+
children: [
|
|
350606
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Box_default, { children: [
|
|
350607
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text3, { color: priorityColors[currentQuestion.priority], children: categoryIcons[currentQuestion.category] }),
|
|
350608
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text3, { color: theme.text.secondary, children: " " }),
|
|
350609
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text3, { color: theme.text.primary, wrap: "wrap", children: currentQuestion.question })
|
|
350610
|
+
] }),
|
|
350611
|
+
currentQuestion.context && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Box_default, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Text3, { color: theme.text.secondary, dimColor: true, wrap: "wrap", children: currentQuestion.context }) }),
|
|
350612
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
350613
|
+
t2("Reply with your answer in the input below"),
|
|
350614
|
+
isStreamingActive && t2(" (agent continues in background)")
|
|
350615
|
+
] }) })
|
|
350616
|
+
]
|
|
350617
|
+
}
|
|
350618
|
+
),
|
|
350619
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Box_default, { marginTop: 0, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Text3, { color: theme.text.secondary, dimColor: true, children: [
|
|
350620
|
+
t2("Mode: {{mode}}", { mode: consultationMode }),
|
|
350621
|
+
consultationMode === "blocking" && currentQuestion.priority === "high" ? t2(" - High priority questions block agent") : ""
|
|
350622
|
+
] }) })
|
|
350623
|
+
] });
|
|
350624
|
+
}, "ConsultationDisplay");
|
|
350625
|
+
|
|
350626
|
+
// packages/cli/src/ui/components/ContextSummaryDisplay.tsx
|
|
350627
|
+
init_esbuild_shims();
|
|
350628
|
+
var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1);
|
|
350450
350629
|
var ContextSummaryDisplay = /* @__PURE__ */ __name(({
|
|
350451
350630
|
OSAMdFileCount,
|
|
350452
350631
|
contextFileNames,
|
|
@@ -350461,7 +350640,7 @@ var ContextSummaryDisplay = /* @__PURE__ */ __name(({
|
|
|
350461
350640
|
const blockedMcpServerCount = blockedMcpServers?.length || 0;
|
|
350462
350641
|
const openFileCount = ideContext?.workspaceState?.openFiles?.length ?? 0;
|
|
350463
350642
|
if (OSAMdFileCount === 0 && mcpServerCount === 0 && blockedMcpServerCount === 0 && openFileCount === 0) {
|
|
350464
|
-
return /* @__PURE__ */ (0,
|
|
350643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Text3, { children: " " });
|
|
350465
350644
|
}
|
|
350466
350645
|
const openFilesText = (() => {
|
|
350467
350646
|
if (openFileCount === 0) {
|
|
@@ -350519,16 +350698,16 @@ var ContextSummaryDisplay = /* @__PURE__ */ __name(({
|
|
|
350519
350698
|
})();
|
|
350520
350699
|
const summaryParts = [openFilesText, OSAMdText, mcpText].filter(Boolean);
|
|
350521
350700
|
if (isNarrow) {
|
|
350522
|
-
return /* @__PURE__ */ (0,
|
|
350523
|
-
/* @__PURE__ */ (0,
|
|
350524
|
-
summaryParts.map((part, index) => /* @__PURE__ */ (0,
|
|
350701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
350702
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Text3, { color: theme.text.secondary, children: t2("Using:") }),
|
|
350703
|
+
summaryParts.map((part, index) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
350525
350704
|
" ",
|
|
350526
350705
|
"- ",
|
|
350527
350706
|
part
|
|
350528
350707
|
] }, index))
|
|
350529
350708
|
] });
|
|
350530
350709
|
}
|
|
350531
|
-
return /* @__PURE__ */ (0,
|
|
350710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
350532
350711
|
t2("Using:"),
|
|
350533
350712
|
" ",
|
|
350534
350713
|
summaryParts.join(" | ")
|
|
@@ -350537,7 +350716,7 @@ var ContextSummaryDisplay = /* @__PURE__ */ __name(({
|
|
|
350537
350716
|
|
|
350538
350717
|
// packages/cli/src/ui/components/AutoAcceptIndicator.tsx
|
|
350539
350718
|
init_esbuild_shims();
|
|
350540
|
-
var
|
|
350719
|
+
var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1);
|
|
350541
350720
|
var AutoAcceptIndicator = /* @__PURE__ */ __name(({
|
|
350542
350721
|
approvalMode
|
|
350543
350722
|
}) => {
|
|
@@ -350564,29 +350743,29 @@ var AutoAcceptIndicator = /* @__PURE__ */ __name(({
|
|
|
350564
350743
|
default:
|
|
350565
350744
|
break;
|
|
350566
350745
|
}
|
|
350567
|
-
return /* @__PURE__ */ (0,
|
|
350746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Text3, { color: textColor, children: [
|
|
350568
350747
|
textContent2,
|
|
350569
|
-
subText && /* @__PURE__ */ (0,
|
|
350748
|
+
subText && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Text3, { color: theme.text.secondary, children: subText })
|
|
350570
350749
|
] }) });
|
|
350571
350750
|
}, "AutoAcceptIndicator");
|
|
350572
350751
|
|
|
350573
350752
|
// packages/cli/src/ui/components/ShellModeIndicator.tsx
|
|
350574
350753
|
init_esbuild_shims();
|
|
350575
|
-
var
|
|
350576
|
-
var ShellModeIndicator = /* @__PURE__ */ __name(() => /* @__PURE__ */ (0,
|
|
350754
|
+
var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1);
|
|
350755
|
+
var ShellModeIndicator = /* @__PURE__ */ __name(() => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Text3, { color: theme.ui.symbol, children: [
|
|
350577
350756
|
"shell mode enabled",
|
|
350578
|
-
/* @__PURE__ */ (0,
|
|
350757
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Text3, { color: theme.text.secondary, children: " (esc to disable)" })
|
|
350579
350758
|
] }) }), "ShellModeIndicator");
|
|
350580
350759
|
|
|
350581
350760
|
// packages/cli/src/ui/components/DetailedMessagesDisplay.tsx
|
|
350582
350761
|
init_esbuild_shims();
|
|
350583
|
-
var
|
|
350762
|
+
var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1);
|
|
350584
350763
|
var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, width }) => {
|
|
350585
350764
|
if (messages.length === 0) {
|
|
350586
350765
|
return null;
|
|
350587
350766
|
}
|
|
350588
350767
|
const borderAndPadding = 4;
|
|
350589
|
-
return /* @__PURE__ */ (0,
|
|
350768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
350590
350769
|
Box_default,
|
|
350591
350770
|
{
|
|
350592
350771
|
flexDirection: "column",
|
|
@@ -350596,12 +350775,12 @@ var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, wid
|
|
|
350596
350775
|
paddingX: 1,
|
|
350597
350776
|
width,
|
|
350598
350777
|
children: [
|
|
350599
|
-
/* @__PURE__ */ (0,
|
|
350778
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Text3, { bold: true, color: theme.text.primary, children: [
|
|
350600
350779
|
"Debug Console",
|
|
350601
350780
|
" ",
|
|
350602
|
-
/* @__PURE__ */ (0,
|
|
350781
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Text3, { color: theme.text.secondary, children: "(ctrl+o to close)" })
|
|
350603
350782
|
] }) }),
|
|
350604
|
-
/* @__PURE__ */ (0,
|
|
350783
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(MaxSizedBox, { maxHeight, maxWidth: width - borderAndPadding, children: messages.map((msg, index) => {
|
|
350605
350784
|
let textColor = theme.text.primary;
|
|
350606
350785
|
let icon = "\u2139";
|
|
350607
350786
|
switch (msg.type) {
|
|
@@ -350621,14 +350800,14 @@ var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, wid
|
|
|
350621
350800
|
default:
|
|
350622
350801
|
break;
|
|
350623
350802
|
}
|
|
350624
|
-
return /* @__PURE__ */ (0,
|
|
350625
|
-
/* @__PURE__ */ (0,
|
|
350803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
350804
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Text3, { color: textColor, children: [
|
|
350626
350805
|
icon,
|
|
350627
350806
|
" "
|
|
350628
350807
|
] }),
|
|
350629
|
-
/* @__PURE__ */ (0,
|
|
350808
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Text3, { color: textColor, wrap: "wrap", children: [
|
|
350630
350809
|
msg.content,
|
|
350631
|
-
msg.count && msg.count > 1 && /* @__PURE__ */ (0,
|
|
350810
|
+
msg.count && msg.count > 1 && /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
350632
350811
|
" (x",
|
|
350633
350812
|
msg.count,
|
|
350634
350813
|
")"
|
|
@@ -350643,15 +350822,15 @@ var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, wid
|
|
|
350643
350822
|
|
|
350644
350823
|
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
350645
350824
|
init_esbuild_shims();
|
|
350646
|
-
var
|
|
350825
|
+
var import_react97 = __toESM(require_react(), 1);
|
|
350647
350826
|
|
|
350648
350827
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
350649
350828
|
init_esbuild_shims();
|
|
350650
350829
|
|
|
350651
350830
|
// packages/cli/src/ui/components/PrepareLabel.tsx
|
|
350652
350831
|
init_esbuild_shims();
|
|
350653
|
-
var
|
|
350654
|
-
var
|
|
350832
|
+
var import_react88 = __toESM(require_react(), 1);
|
|
350833
|
+
var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1);
|
|
350655
350834
|
var MAX_WIDTH = 150;
|
|
350656
350835
|
var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
350657
350836
|
label,
|
|
@@ -350663,7 +350842,7 @@ var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
|
350663
350842
|
const hasMatch = matchedIndex !== void 0 && matchedIndex >= 0 && matchedIndex < label.length && userInput.length > 0;
|
|
350664
350843
|
if (!hasMatch) {
|
|
350665
350844
|
const display = isExpanded ? label : label.length > MAX_WIDTH ? label.slice(0, MAX_WIDTH) + "..." : label;
|
|
350666
|
-
return /* @__PURE__ */ (0,
|
|
350845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text3, { wrap: "wrap", color: textColor, children: display });
|
|
350667
350846
|
}
|
|
350668
350847
|
const matchLength = userInput.length;
|
|
350669
350848
|
let before = "";
|
|
@@ -350702,9 +350881,9 @@ var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
|
350702
350881
|
after = after.length >= 3 ? after.slice(0, -3) + "..." : "...";
|
|
350703
350882
|
}
|
|
350704
350883
|
}
|
|
350705
|
-
return /* @__PURE__ */ (0,
|
|
350884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text3, { color: textColor, wrap: "wrap", children: [
|
|
350706
350885
|
before,
|
|
350707
|
-
match2 ? match2.split(/(\s+)/).map((part, index) => /* @__PURE__ */ (0,
|
|
350886
|
+
match2 ? match2.split(/(\s+)/).map((part, index) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
350708
350887
|
Text3,
|
|
350709
350888
|
{
|
|
350710
350889
|
color: theme.background.primary,
|
|
@@ -350716,10 +350895,10 @@ var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
|
350716
350895
|
after
|
|
350717
350896
|
] });
|
|
350718
350897
|
}, "_PrepareLabel");
|
|
350719
|
-
var PrepareLabel =
|
|
350898
|
+
var PrepareLabel = import_react88.default.memo(_PrepareLabel);
|
|
350720
350899
|
|
|
350721
350900
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
350722
|
-
var
|
|
350901
|
+
var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1);
|
|
350723
350902
|
var MAX_SUGGESTIONS_TO_SHOW = 8;
|
|
350724
350903
|
function SuggestionsDisplay({
|
|
350725
350904
|
suggestions,
|
|
@@ -350732,7 +350911,7 @@ function SuggestionsDisplay({
|
|
|
350732
350911
|
expandedIndex
|
|
350733
350912
|
}) {
|
|
350734
350913
|
if (isLoading) {
|
|
350735
|
-
return /* @__PURE__ */ (0,
|
|
350914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Box_default, { paddingX: 1, width, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text3, { color: "gray", children: "Loading suggestions..." }) });
|
|
350736
350915
|
}
|
|
350737
350916
|
if (suggestions.length === 0) {
|
|
350738
350917
|
return null;
|
|
@@ -350748,15 +350927,15 @@ function SuggestionsDisplay({
|
|
|
350748
350927
|
...suggestions.map((s2) => getFullLabel(s2).length)
|
|
350749
350928
|
);
|
|
350750
350929
|
const commandColumnWidth = mode === "slash" ? Math.min(maxLabelLength, Math.floor(width * 0.5)) : 0;
|
|
350751
|
-
return /* @__PURE__ */ (0,
|
|
350752
|
-
scrollOffset > 0 && /* @__PURE__ */ (0,
|
|
350930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, width, children: [
|
|
350931
|
+
scrollOffset > 0 && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text3, { color: theme.text.primary, children: "\u25B2" }),
|
|
350753
350932
|
visibleSuggestions.map((suggestion, index) => {
|
|
350754
350933
|
const originalIndex = startIndex + index;
|
|
350755
350934
|
const isActive = originalIndex === activeIndex;
|
|
350756
350935
|
const isExpanded = originalIndex === expandedIndex;
|
|
350757
350936
|
const textColor = isActive ? theme.text.accent : theme.text.secondary;
|
|
350758
350937
|
const isLong = suggestion.value.length >= MAX_WIDTH;
|
|
350759
|
-
const labelElement = /* @__PURE__ */ (0,
|
|
350938
|
+
const labelElement = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
350760
350939
|
PrepareLabel,
|
|
350761
350940
|
{
|
|
350762
350941
|
label: suggestion.value,
|
|
@@ -350766,23 +350945,23 @@ function SuggestionsDisplay({
|
|
|
350766
350945
|
isExpanded
|
|
350767
350946
|
}
|
|
350768
350947
|
);
|
|
350769
|
-
return /* @__PURE__ */ (0,
|
|
350770
|
-
/* @__PURE__ */ (0,
|
|
350948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
350949
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
350771
350950
|
Box_default,
|
|
350772
350951
|
{
|
|
350773
350952
|
...mode === "slash" ? { width: commandColumnWidth, flexShrink: 0 } : { flexShrink: 1 },
|
|
350774
|
-
children: /* @__PURE__ */ (0,
|
|
350953
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Box_default, { children: [
|
|
350775
350954
|
labelElement,
|
|
350776
|
-
suggestion.commandKind === "mcp-prompt" /* MCP_PROMPT */ && /* @__PURE__ */ (0,
|
|
350955
|
+
suggestion.commandKind === "mcp-prompt" /* MCP_PROMPT */ && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text3, { color: textColor, children: " [MCP]" })
|
|
350777
350956
|
] })
|
|
350778
350957
|
}
|
|
350779
350958
|
),
|
|
350780
|
-
suggestion.description && /* @__PURE__ */ (0,
|
|
350781
|
-
isActive && isLong && /* @__PURE__ */ (0,
|
|
350959
|
+
suggestion.description && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Box_default, { flexGrow: 1, paddingLeft: 3, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text3, { color: textColor, wrap: "truncate", children: suggestion.description }) }),
|
|
350960
|
+
isActive && isLong && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text3, { color: Colors.Gray, children: isExpanded ? " \u2190 " : " \u2192 " }) })
|
|
350782
350961
|
] }, `${suggestion.value}-${originalIndex}`);
|
|
350783
350962
|
}),
|
|
350784
|
-
endIndex < suggestions.length && /* @__PURE__ */ (0,
|
|
350785
|
-
suggestions.length > MAX_SUGGESTIONS_TO_SHOW && /* @__PURE__ */ (0,
|
|
350963
|
+
endIndex < suggestions.length && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Text3, { color: "gray", children: "\u25BC" }),
|
|
350964
|
+
suggestions.length > MAX_SUGGESTIONS_TO_SHOW && /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Text3, { color: "gray", children: [
|
|
350786
350965
|
"(",
|
|
350787
350966
|
activeIndex + 1,
|
|
350788
350967
|
"/",
|
|
@@ -350795,7 +350974,7 @@ __name(SuggestionsDisplay, "SuggestionsDisplay");
|
|
|
350795
350974
|
|
|
350796
350975
|
// packages/cli/src/ui/hooks/useInputHistory.ts
|
|
350797
350976
|
init_esbuild_shims();
|
|
350798
|
-
var
|
|
350977
|
+
var import_react89 = __toESM(require_react(), 1);
|
|
350799
350978
|
function useInputHistory({
|
|
350800
350979
|
userMessages,
|
|
350801
350980
|
onSubmit,
|
|
@@ -350803,13 +350982,13 @@ function useInputHistory({
|
|
|
350803
350982
|
currentQuery,
|
|
350804
350983
|
onChange
|
|
350805
350984
|
}) {
|
|
350806
|
-
const [historyIndex, setHistoryIndex] = (0,
|
|
350807
|
-
const [originalQueryBeforeNav, setOriginalQueryBeforeNav] = (0,
|
|
350808
|
-
const resetHistoryNav = (0,
|
|
350985
|
+
const [historyIndex, setHistoryIndex] = (0, import_react89.useState)(-1);
|
|
350986
|
+
const [originalQueryBeforeNav, setOriginalQueryBeforeNav] = (0, import_react89.useState)("");
|
|
350987
|
+
const resetHistoryNav = (0, import_react89.useCallback)(() => {
|
|
350809
350988
|
setHistoryIndex(-1);
|
|
350810
350989
|
setOriginalQueryBeforeNav("");
|
|
350811
350990
|
}, []);
|
|
350812
|
-
const handleSubmit = (0,
|
|
350991
|
+
const handleSubmit = (0, import_react89.useCallback)(
|
|
350813
350992
|
(value) => {
|
|
350814
350993
|
const trimmedValue = value.trim();
|
|
350815
350994
|
if (trimmedValue) {
|
|
@@ -350819,7 +350998,7 @@ function useInputHistory({
|
|
|
350819
350998
|
},
|
|
350820
350999
|
[onSubmit, resetHistoryNav]
|
|
350821
351000
|
);
|
|
350822
|
-
const navigateUp = (0,
|
|
351001
|
+
const navigateUp = (0, import_react89.useCallback)(() => {
|
|
350823
351002
|
if (!isActive) return false;
|
|
350824
351003
|
if (userMessages.length === 0) return false;
|
|
350825
351004
|
let nextIndex = historyIndex;
|
|
@@ -350848,7 +351027,7 @@ function useInputHistory({
|
|
|
350848
351027
|
// Use currentQuery from props
|
|
350849
351028
|
setOriginalQueryBeforeNav
|
|
350850
351029
|
]);
|
|
350851
|
-
const navigateDown = (0,
|
|
351030
|
+
const navigateDown = (0, import_react89.useCallback)(() => {
|
|
350852
351031
|
if (!isActive) return false;
|
|
350853
351032
|
if (historyIndex === -1) return false;
|
|
350854
351033
|
const nextIndex = historyIndex - 1;
|
|
@@ -350878,7 +351057,7 @@ __name(useInputHistory, "useInputHistory");
|
|
|
350878
351057
|
|
|
350879
351058
|
// packages/cli/src/ui/hooks/useShellHistory.ts
|
|
350880
351059
|
init_esbuild_shims();
|
|
350881
|
-
var
|
|
351060
|
+
var import_react90 = __toESM(require_react(), 1);
|
|
350882
351061
|
import * as fs85 from "node:fs/promises";
|
|
350883
351062
|
import * as path95 from "node:path";
|
|
350884
351063
|
var MAX_HISTORY_LENGTH2 = 100;
|
|
@@ -350922,10 +351101,10 @@ async function writeHistoryFile(filePath, history) {
|
|
|
350922
351101
|
}
|
|
350923
351102
|
__name(writeHistoryFile, "writeHistoryFile");
|
|
350924
351103
|
function useShellHistory(projectRoot, storage) {
|
|
350925
|
-
const [history, setHistory] = (0,
|
|
350926
|
-
const [historyIndex, setHistoryIndex] = (0,
|
|
350927
|
-
const [historyFilePath, setHistoryFilePath] = (0,
|
|
350928
|
-
(0,
|
|
351104
|
+
const [history, setHistory] = (0, import_react90.useState)([]);
|
|
351105
|
+
const [historyIndex, setHistoryIndex] = (0, import_react90.useState)(-1);
|
|
351106
|
+
const [historyFilePath, setHistoryFilePath] = (0, import_react90.useState)(null);
|
|
351107
|
+
(0, import_react90.useEffect)(() => {
|
|
350929
351108
|
async function loadHistory() {
|
|
350930
351109
|
const filePath = await getHistoryFilePath(projectRoot, storage);
|
|
350931
351110
|
setHistoryFilePath(filePath);
|
|
@@ -350935,7 +351114,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
350935
351114
|
__name(loadHistory, "loadHistory");
|
|
350936
351115
|
loadHistory();
|
|
350937
351116
|
}, [projectRoot, storage]);
|
|
350938
|
-
const addCommandToHistory = (0,
|
|
351117
|
+
const addCommandToHistory = (0, import_react90.useCallback)(
|
|
350939
351118
|
(command2) => {
|
|
350940
351119
|
if (!command2.trim() || !historyFilePath) {
|
|
350941
351120
|
return;
|
|
@@ -350947,7 +351126,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
350947
351126
|
},
|
|
350948
351127
|
[history, historyFilePath]
|
|
350949
351128
|
);
|
|
350950
|
-
const getPreviousCommand = (0,
|
|
351129
|
+
const getPreviousCommand = (0, import_react90.useCallback)(() => {
|
|
350951
351130
|
if (history.length === 0) {
|
|
350952
351131
|
return null;
|
|
350953
351132
|
}
|
|
@@ -350955,7 +351134,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
350955
351134
|
setHistoryIndex(newIndex);
|
|
350956
351135
|
return history[newIndex] ?? null;
|
|
350957
351136
|
}, [history, historyIndex]);
|
|
350958
|
-
const getNextCommand = (0,
|
|
351137
|
+
const getNextCommand = (0, import_react90.useCallback)(() => {
|
|
350959
351138
|
if (historyIndex < 0) {
|
|
350960
351139
|
return null;
|
|
350961
351140
|
}
|
|
@@ -350966,7 +351145,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
350966
351145
|
}
|
|
350967
351146
|
return history[newIndex] ?? null;
|
|
350968
351147
|
}, [history, historyIndex]);
|
|
350969
|
-
const resetHistoryPosition = (0,
|
|
351148
|
+
const resetHistoryPosition = (0, import_react90.useCallback)(() => {
|
|
350970
351149
|
setHistoryIndex(-1);
|
|
350971
351150
|
}, []);
|
|
350972
351151
|
return {
|
|
@@ -350981,19 +351160,19 @@ __name(useShellHistory, "useShellHistory");
|
|
|
350981
351160
|
|
|
350982
351161
|
// packages/cli/src/ui/hooks/useReverseSearchCompletion.tsx
|
|
350983
351162
|
init_esbuild_shims();
|
|
350984
|
-
var
|
|
351163
|
+
var import_react92 = __toESM(require_react(), 1);
|
|
350985
351164
|
|
|
350986
351165
|
// packages/cli/src/ui/hooks/useCompletion.ts
|
|
350987
351166
|
init_esbuild_shims();
|
|
350988
|
-
var
|
|
351167
|
+
var import_react91 = __toESM(require_react(), 1);
|
|
350989
351168
|
function useCompletion() {
|
|
350990
|
-
const [suggestions, setSuggestions] = (0,
|
|
350991
|
-
const [activeSuggestionIndex, setActiveSuggestionIndex] = (0,
|
|
350992
|
-
const [visibleStartIndex, setVisibleStartIndex] = (0,
|
|
350993
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
350994
|
-
const [isLoadingSuggestions, setIsLoadingSuggestions] = (0,
|
|
350995
|
-
const [isPerfectMatch, setIsPerfectMatch] = (0,
|
|
350996
|
-
const resetCompletionState = (0,
|
|
351169
|
+
const [suggestions, setSuggestions] = (0, import_react91.useState)([]);
|
|
351170
|
+
const [activeSuggestionIndex, setActiveSuggestionIndex] = (0, import_react91.useState)(-1);
|
|
351171
|
+
const [visibleStartIndex, setVisibleStartIndex] = (0, import_react91.useState)(0);
|
|
351172
|
+
const [showSuggestions, setShowSuggestions] = (0, import_react91.useState)(false);
|
|
351173
|
+
const [isLoadingSuggestions, setIsLoadingSuggestions] = (0, import_react91.useState)(false);
|
|
351174
|
+
const [isPerfectMatch, setIsPerfectMatch] = (0, import_react91.useState)(false);
|
|
351175
|
+
const resetCompletionState = (0, import_react91.useCallback)(() => {
|
|
350997
351176
|
setSuggestions([]);
|
|
350998
351177
|
setActiveSuggestionIndex(-1);
|
|
350999
351178
|
setVisibleStartIndex(0);
|
|
@@ -351001,7 +351180,7 @@ function useCompletion() {
|
|
|
351001
351180
|
setIsLoadingSuggestions(false);
|
|
351002
351181
|
setIsPerfectMatch(false);
|
|
351003
351182
|
}, []);
|
|
351004
|
-
const navigateUp = (0,
|
|
351183
|
+
const navigateUp = (0, import_react91.useCallback)(() => {
|
|
351005
351184
|
if (suggestions.length === 0) return;
|
|
351006
351185
|
setActiveSuggestionIndex((prevActiveIndex) => {
|
|
351007
351186
|
const newActiveIndex = prevActiveIndex <= 0 ? suggestions.length - 1 : prevActiveIndex - 1;
|
|
@@ -351017,7 +351196,7 @@ function useCompletion() {
|
|
|
351017
351196
|
return newActiveIndex;
|
|
351018
351197
|
});
|
|
351019
351198
|
}, [suggestions.length]);
|
|
351020
|
-
const navigateDown = (0,
|
|
351199
|
+
const navigateDown = (0, import_react91.useCallback)(() => {
|
|
351021
351200
|
if (suggestions.length === 0) return;
|
|
351022
351201
|
setActiveSuggestionIndex((prevActiveIndex) => {
|
|
351023
351202
|
const newActiveIndex = prevActiveIndex >= suggestions.length - 1 ? 0 : prevActiveIndex + 1;
|
|
@@ -351056,8 +351235,8 @@ __name(useCompletion, "useCompletion");
|
|
|
351056
351235
|
|
|
351057
351236
|
// packages/cli/src/ui/hooks/useReverseSearchCompletion.tsx
|
|
351058
351237
|
function useDebouncedValue(value, delay4 = 200) {
|
|
351059
|
-
const [debounced, setDebounced] = (0,
|
|
351060
|
-
(0,
|
|
351238
|
+
const [debounced, setDebounced] = (0, import_react92.useState)(value);
|
|
351239
|
+
(0, import_react92.useEffect)(() => {
|
|
351061
351240
|
const handle = setTimeout(() => setDebounced(value), delay4);
|
|
351062
351241
|
return () => clearTimeout(handle);
|
|
351063
351242
|
}, [value, delay4]);
|
|
@@ -351080,19 +351259,19 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
351080
351259
|
setVisibleStartIndex
|
|
351081
351260
|
} = useCompletion();
|
|
351082
351261
|
const debouncedQuery = useDebouncedValue(buffer.text, 100);
|
|
351083
|
-
const prevQueryRef = (0,
|
|
351084
|
-
const prevMatchesRef = (0,
|
|
351085
|
-
(0,
|
|
351262
|
+
const prevQueryRef = (0, import_react92.useRef)("");
|
|
351263
|
+
const prevMatchesRef = (0, import_react92.useRef)([]);
|
|
351264
|
+
(0, import_react92.useEffect)(() => {
|
|
351086
351265
|
if (reverseSearchActive) {
|
|
351087
351266
|
prevQueryRef.current = "";
|
|
351088
351267
|
prevMatchesRef.current = [];
|
|
351089
351268
|
}
|
|
351090
351269
|
}, [reverseSearchActive]);
|
|
351091
|
-
(0,
|
|
351270
|
+
(0, import_react92.useEffect)(() => {
|
|
351092
351271
|
prevQueryRef.current = "";
|
|
351093
351272
|
prevMatchesRef.current = [];
|
|
351094
351273
|
}, [history]);
|
|
351095
|
-
const searchHistory = (0,
|
|
351274
|
+
const searchHistory = (0, import_react92.useCallback)(
|
|
351096
351275
|
(query, items) => {
|
|
351097
351276
|
const out = [];
|
|
351098
351277
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -351106,7 +351285,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
351106
351285
|
},
|
|
351107
351286
|
[]
|
|
351108
351287
|
);
|
|
351109
|
-
const matches = (0,
|
|
351288
|
+
const matches = (0, import_react92.useMemo)(() => {
|
|
351110
351289
|
if (!reverseSearchActive) return [];
|
|
351111
351290
|
if (debouncedQuery.length === 0)
|
|
351112
351291
|
return history.map((cmd) => ({
|
|
@@ -351119,7 +351298,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
351119
351298
|
const source2 = canUseCache ? prevMatchesRef.current.map((m) => m.value) : history;
|
|
351120
351299
|
return searchHistory(query, source2);
|
|
351121
351300
|
}, [debouncedQuery, history, reverseSearchActive, searchHistory]);
|
|
351122
|
-
(0,
|
|
351301
|
+
(0, import_react92.useEffect)(() => {
|
|
351123
351302
|
if (!reverseSearchActive) {
|
|
351124
351303
|
resetCompletionState();
|
|
351125
351304
|
return;
|
|
@@ -351141,7 +351320,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
351141
351320
|
setVisibleStartIndex,
|
|
351142
351321
|
resetCompletionState
|
|
351143
351322
|
]);
|
|
351144
|
-
const handleAutocomplete = (0,
|
|
351323
|
+
const handleAutocomplete = (0, import_react92.useCallback)(
|
|
351145
351324
|
(i) => {
|
|
351146
351325
|
if (i < 0 || i >= suggestions.length) return;
|
|
351147
351326
|
buffer.setText(suggestions[i].value);
|
|
@@ -351165,11 +351344,11 @@ __name(useReverseSearchCompletion, "useReverseSearchCompletion");
|
|
|
351165
351344
|
|
|
351166
351345
|
// packages/cli/src/ui/hooks/useCommandCompletion.tsx
|
|
351167
351346
|
init_esbuild_shims();
|
|
351168
|
-
var
|
|
351347
|
+
var import_react95 = __toESM(require_react(), 1);
|
|
351169
351348
|
|
|
351170
351349
|
// packages/cli/src/ui/hooks/useAtCompletion.ts
|
|
351171
351350
|
init_esbuild_shims();
|
|
351172
|
-
var
|
|
351351
|
+
var import_react93 = __toESM(require_react(), 1);
|
|
351173
351352
|
var initialState = {
|
|
351174
351353
|
status: "idle" /* IDLE */,
|
|
351175
351354
|
suggestions: [],
|
|
@@ -351227,20 +351406,20 @@ function useAtCompletion(props) {
|
|
|
351227
351406
|
setSuggestions,
|
|
351228
351407
|
setIsLoadingSuggestions
|
|
351229
351408
|
} = props;
|
|
351230
|
-
const [state, dispatch] = (0,
|
|
351231
|
-
const fileSearch = (0,
|
|
351232
|
-
const searchAbortController = (0,
|
|
351233
|
-
const slowSearchTimer = (0,
|
|
351234
|
-
(0,
|
|
351409
|
+
const [state, dispatch] = (0, import_react93.useReducer)(atCompletionReducer, initialState);
|
|
351410
|
+
const fileSearch = (0, import_react93.useRef)(null);
|
|
351411
|
+
const searchAbortController = (0, import_react93.useRef)(null);
|
|
351412
|
+
const slowSearchTimer = (0, import_react93.useRef)(null);
|
|
351413
|
+
(0, import_react93.useEffect)(() => {
|
|
351235
351414
|
setSuggestions(state.suggestions);
|
|
351236
351415
|
}, [state.suggestions, setSuggestions]);
|
|
351237
|
-
(0,
|
|
351416
|
+
(0, import_react93.useEffect)(() => {
|
|
351238
351417
|
setIsLoadingSuggestions(state.isLoading);
|
|
351239
351418
|
}, [state.isLoading, setIsLoadingSuggestions]);
|
|
351240
|
-
(0,
|
|
351419
|
+
(0, import_react93.useEffect)(() => {
|
|
351241
351420
|
dispatch({ type: "RESET" });
|
|
351242
351421
|
}, [cwd7, config]);
|
|
351243
|
-
(0,
|
|
351422
|
+
(0, import_react93.useEffect)(() => {
|
|
351244
351423
|
if (!enabled) {
|
|
351245
351424
|
if (state.status === "ready" /* READY */ || state.status === "error" /* ERROR */) {
|
|
351246
351425
|
dispatch({ type: "RESET" });
|
|
@@ -351257,7 +351436,7 @@ function useAtCompletion(props) {
|
|
|
351257
351436
|
dispatch({ type: "SEARCH", payload: pattern });
|
|
351258
351437
|
}
|
|
351259
351438
|
}, [enabled, pattern, state.status, state.pattern]);
|
|
351260
|
-
(0,
|
|
351439
|
+
(0, import_react93.useEffect)(() => {
|
|
351261
351440
|
const initialize = /* @__PURE__ */ __name(async () => {
|
|
351262
351441
|
try {
|
|
351263
351442
|
const searcher = FileSearchFactory.create({
|
|
@@ -351332,7 +351511,7 @@ __name(useAtCompletion, "useAtCompletion");
|
|
|
351332
351511
|
|
|
351333
351512
|
// packages/cli/src/ui/hooks/useSlashCompletion.ts
|
|
351334
351513
|
init_esbuild_shims();
|
|
351335
|
-
var
|
|
351514
|
+
var import_react94 = __toESM(require_react(), 1);
|
|
351336
351515
|
init_fzf_es();
|
|
351337
351516
|
function logErrorSafely(error, context2) {
|
|
351338
351517
|
if (error instanceof Error) {
|
|
@@ -351347,7 +351526,7 @@ function matchesCommand(cmd, query) {
|
|
|
351347
351526
|
}
|
|
351348
351527
|
__name(matchesCommand, "matchesCommand");
|
|
351349
351528
|
function useCommandParser(query, slashCommands) {
|
|
351350
|
-
return (0,
|
|
351529
|
+
return (0, import_react94.useMemo)(() => {
|
|
351351
351530
|
if (!query) {
|
|
351352
351531
|
return {
|
|
351353
351532
|
hasTrailingSpace: false,
|
|
@@ -351417,9 +351596,9 @@ function useCommandParser(query, slashCommands) {
|
|
|
351417
351596
|
}
|
|
351418
351597
|
__name(useCommandParser, "useCommandParser");
|
|
351419
351598
|
function useCommandSuggestions(parserResult, commandContext, getFzfForCommands, getPrefixSuggestions) {
|
|
351420
|
-
const [suggestions, setSuggestions] = (0,
|
|
351421
|
-
const [isLoading, setIsLoading] = (0,
|
|
351422
|
-
(0,
|
|
351599
|
+
const [suggestions, setSuggestions] = (0, import_react94.useState)([]);
|
|
351600
|
+
const [isLoading, setIsLoading] = (0, import_react94.useState)(false);
|
|
351601
|
+
(0, import_react94.useEffect)(() => {
|
|
351423
351602
|
const abortController = new AbortController();
|
|
351424
351603
|
const { signal } = abortController;
|
|
351425
351604
|
const {
|
|
@@ -351539,7 +351718,7 @@ function useCommandSuggestions(parserResult, commandContext, getFzfForCommands,
|
|
|
351539
351718
|
}
|
|
351540
351719
|
__name(useCommandSuggestions, "useCommandSuggestions");
|
|
351541
351720
|
function useCompletionPositions(query, parserResult) {
|
|
351542
|
-
return (0,
|
|
351721
|
+
return (0, import_react94.useMemo)(() => {
|
|
351543
351722
|
if (!query) {
|
|
351544
351723
|
return { start: -1, end: -1 };
|
|
351545
351724
|
}
|
|
@@ -351561,7 +351740,7 @@ function useCompletionPositions(query, parserResult) {
|
|
|
351561
351740
|
}
|
|
351562
351741
|
__name(useCompletionPositions, "useCompletionPositions");
|
|
351563
351742
|
function usePerfectMatch(parserResult) {
|
|
351564
|
-
return (0,
|
|
351743
|
+
return (0, import_react94.useMemo)(() => {
|
|
351565
351744
|
const { hasTrailingSpace, partial, leafCommand, currentLevel } = parserResult;
|
|
351566
351745
|
if (hasTrailingSpace) {
|
|
351567
351746
|
return { isPerfectMatch: false };
|
|
@@ -351591,13 +351770,13 @@ function useSlashCompletion(props) {
|
|
|
351591
351770
|
setIsLoadingSuggestions,
|
|
351592
351771
|
setIsPerfectMatch
|
|
351593
351772
|
} = props;
|
|
351594
|
-
const [completionStart, setCompletionStart] = (0,
|
|
351595
|
-
const [completionEnd, setCompletionEnd] = (0,
|
|
351596
|
-
const fzfInstanceCache = (0,
|
|
351773
|
+
const [completionStart, setCompletionStart] = (0, import_react94.useState)(-1);
|
|
351774
|
+
const [completionEnd, setCompletionEnd] = (0, import_react94.useState)(-1);
|
|
351775
|
+
const fzfInstanceCache = (0, import_react94.useMemo)(
|
|
351597
351776
|
() => /* @__PURE__ */ new WeakMap(),
|
|
351598
351777
|
[]
|
|
351599
351778
|
);
|
|
351600
|
-
const getFzfForCommands = (0,
|
|
351779
|
+
const getFzfForCommands = (0, import_react94.useMemo)(
|
|
351601
351780
|
() => (commands) => {
|
|
351602
351781
|
if (!commands || commands.length === 0) {
|
|
351603
351782
|
return null;
|
|
@@ -351641,7 +351820,7 @@ function useSlashCompletion(props) {
|
|
|
351641
351820
|
},
|
|
351642
351821
|
[fzfInstanceCache]
|
|
351643
351822
|
);
|
|
351644
|
-
const getPrefixSuggestions = (0,
|
|
351823
|
+
const getPrefixSuggestions = (0, import_react94.useMemo)(
|
|
351645
351824
|
() => (commands, partial) => commands.filter(
|
|
351646
351825
|
(cmd) => cmd.description && !cmd.hidden && (cmd.name.toLowerCase().startsWith(partial.toLowerCase()) || cmd.altNames?.some(
|
|
351647
351826
|
(alt) => alt.toLowerCase().startsWith(partial.toLowerCase())
|
|
@@ -351661,7 +351840,7 @@ function useSlashCompletion(props) {
|
|
|
351661
351840
|
parserResult
|
|
351662
351841
|
);
|
|
351663
351842
|
const { isPerfectMatch } = usePerfectMatch(parserResult);
|
|
351664
|
-
(0,
|
|
351843
|
+
(0, import_react94.useEffect)(() => {
|
|
351665
351844
|
if (!enabled) {
|
|
351666
351845
|
setSuggestions([]);
|
|
351667
351846
|
setIsLoadingSuggestions(false);
|
|
@@ -351670,7 +351849,7 @@ function useSlashCompletion(props) {
|
|
|
351670
351849
|
setCompletionEnd(-1);
|
|
351671
351850
|
}
|
|
351672
351851
|
}, [enabled, setSuggestions, setIsLoadingSuggestions, setIsPerfectMatch]);
|
|
351673
|
-
(0,
|
|
351852
|
+
(0, import_react94.useEffect)(() => {
|
|
351674
351853
|
if (!enabled || query === null) {
|
|
351675
351854
|
return;
|
|
351676
351855
|
}
|
|
@@ -351719,7 +351898,7 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
351719
351898
|
} = useCompletion();
|
|
351720
351899
|
const cursorRow = buffer.cursor[0];
|
|
351721
351900
|
const cursorCol = buffer.cursor[1];
|
|
351722
|
-
const { completionMode, query, completionStart, completionEnd } = (0,
|
|
351901
|
+
const { completionMode, query, completionStart, completionEnd } = (0, import_react95.useMemo)(() => {
|
|
351723
351902
|
const currentLine = buffer.lines[cursorRow] || "";
|
|
351724
351903
|
if (cursorRow === 0 && isSlashCommand(currentLine.trim())) {
|
|
351725
351904
|
return {
|
|
@@ -351788,11 +351967,11 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
351788
351967
|
setIsLoadingSuggestions,
|
|
351789
351968
|
setIsPerfectMatch
|
|
351790
351969
|
});
|
|
351791
|
-
(0,
|
|
351970
|
+
(0, import_react95.useEffect)(() => {
|
|
351792
351971
|
setActiveSuggestionIndex(suggestions.length > 0 ? 0 : -1);
|
|
351793
351972
|
setVisibleStartIndex(0);
|
|
351794
351973
|
}, [suggestions, setActiveSuggestionIndex, setVisibleStartIndex]);
|
|
351795
|
-
(0,
|
|
351974
|
+
(0, import_react95.useEffect)(() => {
|
|
351796
351975
|
if (completionMode === "IDLE" /* IDLE */ || reverseSearchActive) {
|
|
351797
351976
|
resetCompletionState();
|
|
351798
351977
|
return;
|
|
@@ -351806,7 +351985,7 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
351806
351985
|
resetCompletionState,
|
|
351807
351986
|
setShowSuggestions
|
|
351808
351987
|
]);
|
|
351809
|
-
const handleAutocomplete = (0,
|
|
351988
|
+
const handleAutocomplete = (0, import_react95.useCallback)(
|
|
351810
351989
|
(indexToUse) => {
|
|
351811
351990
|
if (indexToUse < 0 || indexToUse >= suggestions.length) {
|
|
351812
351991
|
return;
|
|
@@ -352032,12 +352211,12 @@ import * as path97 from "node:path";
|
|
|
352032
352211
|
|
|
352033
352212
|
// packages/cli/src/ui/contexts/ShellFocusContext.tsx
|
|
352034
352213
|
init_esbuild_shims();
|
|
352035
|
-
var
|
|
352036
|
-
var ShellFocusContext = (0,
|
|
352037
|
-
var useShellFocusState = /* @__PURE__ */ __name(() => (0,
|
|
352214
|
+
var import_react96 = __toESM(require_react(), 1);
|
|
352215
|
+
var ShellFocusContext = (0, import_react96.createContext)(true);
|
|
352216
|
+
var useShellFocusState = /* @__PURE__ */ __name(() => (0, import_react96.useContext)(ShellFocusContext), "useShellFocusState");
|
|
352038
352217
|
|
|
352039
352218
|
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
352040
|
-
var
|
|
352219
|
+
var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1);
|
|
352041
352220
|
var calculatePromptWidths = /* @__PURE__ */ __name((terminalWidth) => {
|
|
352042
352221
|
const widthFraction = 0.9;
|
|
352043
352222
|
const FRAME_PADDING_AND_BORDER = 4;
|
|
@@ -352074,29 +352253,29 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352074
352253
|
isEmbeddedShellFocused
|
|
352075
352254
|
}) => {
|
|
352076
352255
|
const isShellFocused = useShellFocusState();
|
|
352077
|
-
const [justNavigatedHistory, setJustNavigatedHistory] = (0,
|
|
352078
|
-
const [escPressCount, setEscPressCount] = (0,
|
|
352079
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
352080
|
-
const escapeTimerRef = (0,
|
|
352081
|
-
const [recentPasteTime, setRecentPasteTime] = (0,
|
|
352082
|
-
const pasteTimeoutRef = (0,
|
|
352083
|
-
const [dirs, setDirs] = (0,
|
|
352256
|
+
const [justNavigatedHistory, setJustNavigatedHistory] = (0, import_react97.useState)(false);
|
|
352257
|
+
const [escPressCount, setEscPressCount] = (0, import_react97.useState)(0);
|
|
352258
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react97.useState)(false);
|
|
352259
|
+
const escapeTimerRef = (0, import_react97.useRef)(null);
|
|
352260
|
+
const [recentPasteTime, setRecentPasteTime] = (0, import_react97.useState)(null);
|
|
352261
|
+
const pasteTimeoutRef = (0, import_react97.useRef)(null);
|
|
352262
|
+
const [dirs, setDirs] = (0, import_react97.useState)(
|
|
352084
352263
|
config.getWorkspaceContext().getDirectories()
|
|
352085
352264
|
);
|
|
352086
352265
|
const dirsChanged = config.getWorkspaceContext().getDirectories();
|
|
352087
|
-
(0,
|
|
352266
|
+
(0, import_react97.useEffect)(() => {
|
|
352088
352267
|
if (dirs.length !== dirsChanged.length) {
|
|
352089
352268
|
setDirs(dirsChanged);
|
|
352090
352269
|
}
|
|
352091
352270
|
}, [dirs.length, dirsChanged]);
|
|
352092
|
-
const [reverseSearchActive, setReverseSearchActive] = (0,
|
|
352093
|
-
const [commandSearchActive, setCommandSearchActive] = (0,
|
|
352094
|
-
const [textBeforeReverseSearch, setTextBeforeReverseSearch] = (0,
|
|
352095
|
-
const [cursorPosition, setCursorPosition] = (0,
|
|
352271
|
+
const [reverseSearchActive, setReverseSearchActive] = (0, import_react97.useState)(false);
|
|
352272
|
+
const [commandSearchActive, setCommandSearchActive] = (0, import_react97.useState)(false);
|
|
352273
|
+
const [textBeforeReverseSearch, setTextBeforeReverseSearch] = (0, import_react97.useState)("");
|
|
352274
|
+
const [cursorPosition, setCursorPosition] = (0, import_react97.useState)([
|
|
352096
352275
|
0,
|
|
352097
352276
|
0
|
|
352098
352277
|
]);
|
|
352099
|
-
const [expandedSuggestionIndex, setExpandedSuggestionIndex] = (0,
|
|
352278
|
+
const [expandedSuggestionIndex, setExpandedSuggestionIndex] = (0, import_react97.useState)(-1);
|
|
352100
352279
|
const shellHistory = useShellHistory(config.getProjectRoot());
|
|
352101
352280
|
const shellHistoryData = shellHistory.history;
|
|
352102
352281
|
const completion3 = useCommandCompletion(
|
|
@@ -352122,7 +352301,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352122
352301
|
const resetReverseSearchCompletionState = reverseSearchCompletion.resetCompletionState;
|
|
352123
352302
|
const resetCommandSearchCompletionState = commandSearchCompletion.resetCompletionState;
|
|
352124
352303
|
const showCursor = focus && isShellFocused && !isEmbeddedShellFocused;
|
|
352125
|
-
const resetEscapeState = (0,
|
|
352304
|
+
const resetEscapeState = (0, import_react97.useCallback)(() => {
|
|
352126
352305
|
if (escapeTimerRef.current) {
|
|
352127
352306
|
clearTimeout(escapeTimerRef.current);
|
|
352128
352307
|
escapeTimerRef.current = null;
|
|
@@ -352130,12 +352309,12 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352130
352309
|
setEscPressCount(0);
|
|
352131
352310
|
setShowEscapePrompt(false);
|
|
352132
352311
|
}, []);
|
|
352133
|
-
(0,
|
|
352312
|
+
(0, import_react97.useEffect)(() => {
|
|
352134
352313
|
if (onEscapePromptChange) {
|
|
352135
352314
|
onEscapePromptChange(showEscapePrompt);
|
|
352136
352315
|
}
|
|
352137
352316
|
}, [showEscapePrompt, onEscapePromptChange]);
|
|
352138
|
-
(0,
|
|
352317
|
+
(0, import_react97.useEffect)(
|
|
352139
352318
|
() => () => {
|
|
352140
352319
|
if (escapeTimerRef.current) {
|
|
352141
352320
|
clearTimeout(escapeTimerRef.current);
|
|
@@ -352146,7 +352325,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352146
352325
|
},
|
|
352147
352326
|
[]
|
|
352148
352327
|
);
|
|
352149
|
-
const handleSubmitAndClear = (0,
|
|
352328
|
+
const handleSubmitAndClear = (0, import_react97.useCallback)(
|
|
352150
352329
|
(submittedValue) => {
|
|
352151
352330
|
if (shellModeActive) {
|
|
352152
352331
|
shellHistory.addCommandToHistory(submittedValue);
|
|
@@ -352165,7 +352344,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352165
352344
|
resetReverseSearchCompletionState
|
|
352166
352345
|
]
|
|
352167
352346
|
);
|
|
352168
|
-
const customSetTextAndResetCompletionSignal = (0,
|
|
352347
|
+
const customSetTextAndResetCompletionSignal = (0, import_react97.useCallback)(
|
|
352169
352348
|
(newText) => {
|
|
352170
352349
|
buffer.setText(newText);
|
|
352171
352350
|
setJustNavigatedHistory(true);
|
|
@@ -352179,7 +352358,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352179
352358
|
currentQuery: buffer.text,
|
|
352180
352359
|
onChange: customSetTextAndResetCompletionSignal
|
|
352181
352360
|
});
|
|
352182
|
-
(0,
|
|
352361
|
+
(0, import_react97.useEffect)(() => {
|
|
352183
352362
|
if (justNavigatedHistory) {
|
|
352184
352363
|
resetCompletionState();
|
|
352185
352364
|
resetReverseSearchCompletionState();
|
|
@@ -352195,7 +352374,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352195
352374
|
resetReverseSearchCompletionState,
|
|
352196
352375
|
resetCommandSearchCompletionState
|
|
352197
352376
|
]);
|
|
352198
|
-
const handleClipboardImage = (0,
|
|
352377
|
+
const handleClipboardImage = (0, import_react97.useCallback)(async () => {
|
|
352199
352378
|
try {
|
|
352200
352379
|
if (await clipboardHasImage()) {
|
|
352201
352380
|
const imagePath = await saveClipboardImage(config.getTargetDir());
|
|
@@ -352227,7 +352406,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352227
352406
|
console.error("Error handling clipboard image:", error);
|
|
352228
352407
|
}
|
|
352229
352408
|
}, [buffer, config]);
|
|
352230
|
-
const handleInput = (0,
|
|
352409
|
+
const handleInput = (0, import_react97.useCallback)(
|
|
352231
352410
|
(key) => {
|
|
352232
352411
|
if (!focus && !key.paste) {
|
|
352233
352412
|
return;
|
|
@@ -352546,21 +352725,21 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352546
352725
|
statusColor = theme.status.warning;
|
|
352547
352726
|
statusText = t2("Accepting edits");
|
|
352548
352727
|
}
|
|
352549
|
-
return /* @__PURE__ */ (0,
|
|
352550
|
-
/* @__PURE__ */ (0,
|
|
352728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
352729
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
352551
352730
|
Box_default,
|
|
352552
352731
|
{
|
|
352553
352732
|
borderStyle: "round",
|
|
352554
352733
|
borderColor: isShellFocused && !isEmbeddedShellFocused ? statusColor ?? theme.border.focused : theme.border.default,
|
|
352555
352734
|
paddingX: 1,
|
|
352556
352735
|
children: [
|
|
352557
|
-
/* @__PURE__ */ (0,
|
|
352736
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
352558
352737
|
Text3,
|
|
352559
352738
|
{
|
|
352560
352739
|
color: statusColor ?? theme.text.accent,
|
|
352561
352740
|
"aria-label": statusText || void 0,
|
|
352562
352741
|
children: [
|
|
352563
|
-
shellModeActive ? reverseSearchActive ? /* @__PURE__ */ (0,
|
|
352742
|
+
shellModeActive ? reverseSearchActive ? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
352564
352743
|
Text3,
|
|
352565
352744
|
{
|
|
352566
352745
|
color: theme.text.link,
|
|
@@ -352570,15 +352749,15 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352570
352749
|
" "
|
|
352571
352750
|
]
|
|
352572
352751
|
}
|
|
352573
|
-
) : "!" : commandSearchActive ? /* @__PURE__ */ (0,
|
|
352752
|
+
) : "!" : commandSearchActive ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { color: theme.text.accent, children: "(r:) " }) : showYoloStyling ? "*" : ">",
|
|
352574
352753
|
" "
|
|
352575
352754
|
]
|
|
352576
352755
|
}
|
|
352577
352756
|
),
|
|
352578
|
-
/* @__PURE__ */ (0,
|
|
352757
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Box_default, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? showCursor ? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Text3, { children: [
|
|
352579
352758
|
source_default2.inverse(placeholder.slice(0, 1)),
|
|
352580
|
-
/* @__PURE__ */ (0,
|
|
352581
|
-
] }) : /* @__PURE__ */ (0,
|
|
352759
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { color: theme.text.secondary, children: placeholder.slice(1) })
|
|
352760
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { color: theme.text.secondary, children: placeholder }) : linesToRender.map((lineText, visualIdxInRenderedSet) => {
|
|
352582
352761
|
const absoluteVisualIdx = scrollVisualRow + visualIdxInRenderedSet;
|
|
352583
352762
|
const mapEntry = buffer.visualToLogicalMap[absoluteVisualIdx];
|
|
352584
352763
|
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
|
@@ -352625,20 +352804,20 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352625
352804
|
}
|
|
352626
352805
|
const color = seg.type === "command" || seg.type === "file" ? theme.text.accent : theme.text.primary;
|
|
352627
352806
|
renderedLine.push(
|
|
352628
|
-
/* @__PURE__ */ (0,
|
|
352807
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { color, children: display }, `token-${segIdx}`)
|
|
352629
352808
|
);
|
|
352630
352809
|
});
|
|
352631
352810
|
if (isOnCursorLine && cursorVisualColAbsolute === cpLen(lineText)) {
|
|
352632
352811
|
renderedLine.push(
|
|
352633
|
-
/* @__PURE__ */ (0,
|
|
352812
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { children: showCursor ? source_default2.inverse(" ") : " " }, `cursor-end-${cursorVisualColAbsolute}`)
|
|
352634
352813
|
);
|
|
352635
352814
|
}
|
|
352636
|
-
return /* @__PURE__ */ (0,
|
|
352815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Box_default, { height: 1, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { children: renderedLine }) }, `line-${visualIdxInRenderedSet}`);
|
|
352637
352816
|
}) })
|
|
352638
352817
|
]
|
|
352639
352818
|
}
|
|
352640
352819
|
),
|
|
352641
|
-
shouldShowSuggestions && /* @__PURE__ */ (0,
|
|
352820
|
+
shouldShowSuggestions && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Box_default, { paddingRight: 2, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
352642
352821
|
SuggestionsDisplay,
|
|
352643
352822
|
{
|
|
352644
352823
|
suggestions: activeCompletion.suggestions,
|
|
@@ -352659,7 +352838,7 @@ init_esbuild_shims();
|
|
|
352659
352838
|
|
|
352660
352839
|
// packages/cli/src/ui/components/ConsoleSummaryDisplay.tsx
|
|
352661
352840
|
init_esbuild_shims();
|
|
352662
|
-
var
|
|
352841
|
+
var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
|
|
352663
352842
|
var ConsoleSummaryDisplay = /* @__PURE__ */ __name(({
|
|
352664
352843
|
errorCount
|
|
352665
352844
|
}) => {
|
|
@@ -352667,14 +352846,14 @@ var ConsoleSummaryDisplay = /* @__PURE__ */ __name(({
|
|
|
352667
352846
|
return null;
|
|
352668
352847
|
}
|
|
352669
352848
|
const errorIcon = "\u2716";
|
|
352670
|
-
return /* @__PURE__ */ (0,
|
|
352849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Box_default, { children: errorCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Text3, { color: theme.status.error, children: [
|
|
352671
352850
|
errorIcon,
|
|
352672
352851
|
" ",
|
|
352673
352852
|
errorCount,
|
|
352674
352853
|
" error",
|
|
352675
352854
|
errorCount > 1 ? "s" : "",
|
|
352676
352855
|
" ",
|
|
352677
|
-
/* @__PURE__ */ (0,
|
|
352856
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text3, { color: theme.text.secondary, children: "(ctrl+o for details)" })
|
|
352678
352857
|
] }) });
|
|
352679
352858
|
}, "ConsoleSummaryDisplay");
|
|
352680
352859
|
|
|
@@ -352683,15 +352862,15 @@ import process36 from "node:process";
|
|
|
352683
352862
|
|
|
352684
352863
|
// packages/cli/src/ui/components/MemoryUsageDisplay.tsx
|
|
352685
352864
|
init_esbuild_shims();
|
|
352686
|
-
var
|
|
352865
|
+
var import_react98 = __toESM(require_react(), 1);
|
|
352687
352866
|
import process35 from "node:process";
|
|
352688
|
-
var
|
|
352867
|
+
var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1);
|
|
352689
352868
|
var MemoryUsageDisplay = /* @__PURE__ */ __name(() => {
|
|
352690
|
-
const [memoryUsage, setMemoryUsage] = (0,
|
|
352691
|
-
const [memoryUsageColor, setMemoryUsageColor] = (0,
|
|
352869
|
+
const [memoryUsage, setMemoryUsage] = (0, import_react98.useState)("");
|
|
352870
|
+
const [memoryUsageColor, setMemoryUsageColor] = (0, import_react98.useState)(
|
|
352692
352871
|
theme.text.secondary
|
|
352693
352872
|
);
|
|
352694
|
-
(0,
|
|
352873
|
+
(0, import_react98.useEffect)(() => {
|
|
352695
352874
|
const updateMemory = /* @__PURE__ */ __name(() => {
|
|
352696
352875
|
const usage2 = process35.memoryUsage().rss;
|
|
352697
352876
|
setMemoryUsage(formatMemoryUsage2(usage2));
|
|
@@ -352703,15 +352882,15 @@ var MemoryUsageDisplay = /* @__PURE__ */ __name(() => {
|
|
|
352703
352882
|
updateMemory();
|
|
352704
352883
|
return () => clearInterval(intervalId);
|
|
352705
352884
|
}, []);
|
|
352706
|
-
return /* @__PURE__ */ (0,
|
|
352707
|
-
/* @__PURE__ */ (0,
|
|
352708
|
-
/* @__PURE__ */ (0,
|
|
352885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(Box_default, { children: [
|
|
352886
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text3, { color: theme.text.secondary, children: " | " }),
|
|
352887
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Text3, { color: memoryUsageColor, children: memoryUsage })
|
|
352709
352888
|
] });
|
|
352710
352889
|
}, "MemoryUsageDisplay");
|
|
352711
352890
|
|
|
352712
352891
|
// packages/cli/src/ui/components/ContextUsageDisplay.tsx
|
|
352713
352892
|
init_esbuild_shims();
|
|
352714
|
-
var
|
|
352893
|
+
var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
|
|
352715
352894
|
var formatTokens = /* @__PURE__ */ __name((count) => {
|
|
352716
352895
|
if (count >= 1e6) {
|
|
352717
352896
|
return `${(count / 1e6).toFixed(1)}M`;
|
|
@@ -352741,19 +352920,19 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
352741
352920
|
const percentageUsed = (percentage * 100).toFixed(0);
|
|
352742
352921
|
const usageColor = getUsageColor(percentage);
|
|
352743
352922
|
if (terminalWidth < 80) {
|
|
352744
|
-
return /* @__PURE__ */ (0,
|
|
352923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: usageColor, children: [
|
|
352745
352924
|
"(",
|
|
352746
352925
|
percentageUsed,
|
|
352747
352926
|
"%)"
|
|
352748
352927
|
] });
|
|
352749
352928
|
}
|
|
352750
352929
|
if (terminalWidth < 120) {
|
|
352751
|
-
return /* @__PURE__ */ (0,
|
|
352752
|
-
/* @__PURE__ */ (0,
|
|
352930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { children: [
|
|
352931
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: usageColor, children: [
|
|
352753
352932
|
percentageUsed,
|
|
352754
352933
|
"%"
|
|
352755
352934
|
] }),
|
|
352756
|
-
/* @__PURE__ */ (0,
|
|
352935
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352757
352936
|
" ",
|
|
352758
352937
|
"(",
|
|
352759
352938
|
formatTokens(promptTokenCount),
|
|
@@ -352765,13 +352944,13 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
352765
352944
|
}
|
|
352766
352945
|
const barWidth = 10;
|
|
352767
352946
|
const progressBar = generateProgressBar(percentage, barWidth);
|
|
352768
|
-
return /* @__PURE__ */ (0,
|
|
352769
|
-
/* @__PURE__ */ (0,
|
|
352947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { children: [
|
|
352948
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: usageColor, children: [
|
|
352770
352949
|
"[",
|
|
352771
352950
|
progressBar,
|
|
352772
352951
|
"]"
|
|
352773
352952
|
] }),
|
|
352774
|
-
/* @__PURE__ */ (0,
|
|
352953
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352775
352954
|
" ",
|
|
352776
352955
|
formatTokens(promptTokenCount),
|
|
352777
352956
|
"/",
|
|
@@ -352782,12 +352961,12 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
352782
352961
|
|
|
352783
352962
|
// packages/cli/src/ui/components/DebugProfiler.tsx
|
|
352784
352963
|
init_esbuild_shims();
|
|
352785
|
-
var
|
|
352786
|
-
var
|
|
352964
|
+
var import_react99 = __toESM(require_react(), 1);
|
|
352965
|
+
var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1);
|
|
352787
352966
|
var DebugProfiler = /* @__PURE__ */ __name(() => {
|
|
352788
|
-
const numRenders = (0,
|
|
352789
|
-
const [showNumRenders, setShowNumRenders] = (0,
|
|
352790
|
-
(0,
|
|
352967
|
+
const numRenders = (0, import_react99.useRef)(0);
|
|
352968
|
+
const [showNumRenders, setShowNumRenders] = (0, import_react99.useState)(false);
|
|
352969
|
+
(0, import_react99.useEffect)(() => {
|
|
352791
352970
|
numRenders.current++;
|
|
352792
352971
|
});
|
|
352793
352972
|
useKeypress(
|
|
@@ -352801,7 +352980,7 @@ var DebugProfiler = /* @__PURE__ */ __name(() => {
|
|
|
352801
352980
|
if (!showNumRenders) {
|
|
352802
352981
|
return null;
|
|
352803
352982
|
}
|
|
352804
|
-
return /* @__PURE__ */ (0,
|
|
352983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Text3, { color: theme.status.warning, children: [
|
|
352805
352984
|
"Renders: ",
|
|
352806
352985
|
numRenders.current,
|
|
352807
352986
|
" "
|
|
@@ -352809,7 +352988,7 @@ var DebugProfiler = /* @__PURE__ */ __name(() => {
|
|
|
352809
352988
|
}, "DebugProfiler");
|
|
352810
352989
|
|
|
352811
352990
|
// packages/cli/src/ui/components/Footer.tsx
|
|
352812
|
-
var
|
|
352991
|
+
var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1);
|
|
352813
352992
|
var Footer = /* @__PURE__ */ __name(() => {
|
|
352814
352993
|
const uiState = useUIState();
|
|
352815
352994
|
const config = useConfig();
|
|
@@ -352851,7 +353030,7 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
352851
353030
|
const displayPath = shortenPath(tildeifyPath(targetDir), pathLength);
|
|
352852
353031
|
const justifyContent = hideCWD && hideModelInfo ? "center" : "space-between";
|
|
352853
353032
|
const displayVimMode = vimEnabled ? vimMode : void 0;
|
|
352854
|
-
return /* @__PURE__ */ (0,
|
|
353033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
352855
353034
|
Box_default,
|
|
352856
353035
|
{
|
|
352857
353036
|
justifyContent,
|
|
@@ -352859,64 +353038,64 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
352859
353038
|
flexDirection: "row",
|
|
352860
353039
|
alignItems: "center",
|
|
352861
353040
|
children: [
|
|
352862
|
-
(debugMode || displayVimMode || !hideCWD) && /* @__PURE__ */ (0,
|
|
352863
|
-
debugMode && /* @__PURE__ */ (0,
|
|
352864
|
-
displayVimMode && /* @__PURE__ */ (0,
|
|
353041
|
+
(debugMode || displayVimMode || !hideCWD) && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Box_default, { children: [
|
|
353042
|
+
debugMode && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(DebugProfiler, {}),
|
|
353043
|
+
displayVimMode && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352865
353044
|
"[",
|
|
352866
353045
|
displayVimMode,
|
|
352867
353046
|
"] "
|
|
352868
353047
|
] }),
|
|
352869
|
-
!hideCWD && (nightly ? /* @__PURE__ */ (0,
|
|
353048
|
+
!hideCWD && (nightly ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(dist_default4, { colors: theme.ui.gradient, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { children: [
|
|
352870
353049
|
displayPath,
|
|
352871
|
-
branchName && /* @__PURE__ */ (0,
|
|
353050
|
+
branchName && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { children: [
|
|
352872
353051
|
" (",
|
|
352873
353052
|
branchName,
|
|
352874
353053
|
"*)"
|
|
352875
353054
|
] })
|
|
352876
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
353055
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.link, children: [
|
|
352877
353056
|
displayPath,
|
|
352878
|
-
branchName && /* @__PURE__ */ (0,
|
|
353057
|
+
branchName && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352879
353058
|
" (",
|
|
352880
353059
|
branchName,
|
|
352881
353060
|
"*)"
|
|
352882
353061
|
] })
|
|
352883
353062
|
] })),
|
|
352884
|
-
debugMode && /* @__PURE__ */ (0,
|
|
353063
|
+
debugMode && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.status.error, children: " " + (debugMessage || "--debug") })
|
|
352885
353064
|
] }),
|
|
352886
|
-
!hideSandboxStatus && /* @__PURE__ */ (0,
|
|
353065
|
+
!hideSandboxStatus && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
352887
353066
|
Box_default,
|
|
352888
353067
|
{
|
|
352889
353068
|
flexGrow: 1,
|
|
352890
353069
|
alignItems: "center",
|
|
352891
353070
|
justifyContent: "center",
|
|
352892
353071
|
display: "flex",
|
|
352893
|
-
children: isTrustedFolder === false ? /* @__PURE__ */ (0,
|
|
353072
|
+
children: isTrustedFolder === false ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.status.warning, children: "untrusted" }) : process36.env["SANDBOX"] && process36.env["SANDBOX"] !== "sandbox-exec" ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: "green", children: process36.env["SANDBOX"].replace(/^OSA-(?:cli-)?/, "") }) : process36.env["SANDBOX"] === "sandbox-exec" ? /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.status.warning, children: [
|
|
352894
353073
|
"macOS Seatbelt",
|
|
352895
353074
|
" ",
|
|
352896
|
-
/* @__PURE__ */ (0,
|
|
353075
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352897
353076
|
"(",
|
|
352898
353077
|
process36.env["SEATBELT_PROFILE"],
|
|
352899
353078
|
")"
|
|
352900
353079
|
] })
|
|
352901
|
-
] }) : /* @__PURE__ */ (0,
|
|
353080
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.status.error, children: [
|
|
352902
353081
|
"no sandbox",
|
|
352903
|
-
terminalWidth >= 100 && /* @__PURE__ */ (0,
|
|
353082
|
+
terminalWidth >= 100 && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.text.secondary, children: " (see /docs)" })
|
|
352904
353083
|
] })
|
|
352905
353084
|
}
|
|
352906
353085
|
),
|
|
352907
|
-
!hideModelInfo && /* @__PURE__ */ (0,
|
|
352908
|
-
/* @__PURE__ */ (0,
|
|
352909
|
-
/* @__PURE__ */ (0,
|
|
352910
|
-
systemPromptPreset && /* @__PURE__ */ (0,
|
|
353086
|
+
!hideModelInfo && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Box_default, { alignItems: "center", justifyContent: "flex-end", children: [
|
|
353087
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Box_default, { alignItems: "center", children: [
|
|
353088
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Box_default, { flexDirection: "row", alignItems: "center", children: [
|
|
353089
|
+
systemPromptPreset && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352911
353090
|
"sp (",
|
|
352912
353091
|
systemPromptPreset,
|
|
352913
353092
|
")",
|
|
352914
|
-
/* @__PURE__ */ (0,
|
|
353093
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.ui.symbol, children: " \xB7 " })
|
|
352915
353094
|
] }),
|
|
352916
|
-
/* @__PURE__ */ (0,
|
|
353095
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.accent, children: [
|
|
352917
353096
|
model,
|
|
352918
353097
|
" ",
|
|
352919
|
-
/* @__PURE__ */ (0,
|
|
353098
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
352920
353099
|
ContextUsageDisplay,
|
|
352921
353100
|
{
|
|
352922
353101
|
promptTokenCount,
|
|
@@ -352926,20 +353105,20 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
352926
353105
|
)
|
|
352927
353106
|
] })
|
|
352928
353107
|
] }),
|
|
352929
|
-
showMemoryUsage && /* @__PURE__ */ (0,
|
|
353108
|
+
showMemoryUsage && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(MemoryUsageDisplay, {})
|
|
352930
353109
|
] }),
|
|
352931
|
-
/* @__PURE__ */ (0,
|
|
352932
|
-
corgiMode && /* @__PURE__ */ (0,
|
|
352933
|
-
/* @__PURE__ */ (0,
|
|
352934
|
-
/* @__PURE__ */ (0,
|
|
352935
|
-
/* @__PURE__ */ (0,
|
|
352936
|
-
/* @__PURE__ */ (0,
|
|
352937
|
-
/* @__PURE__ */ (0,
|
|
352938
|
-
/* @__PURE__ */ (0,
|
|
353110
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Box_default, { alignItems: "center", paddingLeft: 2, children: [
|
|
353111
|
+
corgiMode && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { children: [
|
|
353112
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.ui.symbol, children: "| " }),
|
|
353113
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.status.error, children: "\u25BC" }),
|
|
353114
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.text.primary, children: "(\xB4" }),
|
|
353115
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.status.error, children: "\u1D25" }),
|
|
353116
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.text.primary, children: "`)" }),
|
|
353117
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.status.error, children: "\u25BC " })
|
|
352939
353118
|
] }),
|
|
352940
|
-
!showErrorDetails && errorCount > 0 && /* @__PURE__ */ (0,
|
|
352941
|
-
/* @__PURE__ */ (0,
|
|
352942
|
-
/* @__PURE__ */ (0,
|
|
353119
|
+
!showErrorDetails && errorCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Box_default, { children: [
|
|
353120
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.ui.symbol, children: "| " }),
|
|
353121
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(ConsoleSummaryDisplay, { errorCount })
|
|
352943
353122
|
] })
|
|
352944
353123
|
] })
|
|
352945
353124
|
] })
|
|
@@ -352950,7 +353129,7 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
352950
353129
|
|
|
352951
353130
|
// packages/cli/src/ui/components/QueuedMessageDisplay.tsx
|
|
352952
353131
|
init_esbuild_shims();
|
|
352953
|
-
var
|
|
353132
|
+
var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1);
|
|
352954
353133
|
var MAX_DISPLAYED_QUEUED_MESSAGES = 3;
|
|
352955
353134
|
var QueuedMessageDisplay = /* @__PURE__ */ __name(({
|
|
352956
353135
|
messageQueue
|
|
@@ -352958,12 +353137,12 @@ var QueuedMessageDisplay = /* @__PURE__ */ __name(({
|
|
|
352958
353137
|
if (messageQueue.length === 0) {
|
|
352959
353138
|
return null;
|
|
352960
353139
|
}
|
|
352961
|
-
return /* @__PURE__ */ (0,
|
|
353140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
352962
353141
|
messageQueue.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message2, index) => {
|
|
352963
353142
|
const preview = message2.replace(/\s+/g, " ");
|
|
352964
|
-
return /* @__PURE__ */ (0,
|
|
353143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Box_default, { paddingLeft: 2, width: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Text3, { dimColor: true, wrap: "truncate", children: preview }) }, index);
|
|
352965
353144
|
}),
|
|
352966
|
-
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ (0,
|
|
353145
|
+
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Text3, { dimColor: true, children: [
|
|
352967
353146
|
"... (+",
|
|
352968
353147
|
messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES,
|
|
352969
353148
|
" more)"
|
|
@@ -352973,12 +353152,12 @@ var QueuedMessageDisplay = /* @__PURE__ */ __name(({
|
|
|
352973
353152
|
|
|
352974
353153
|
// packages/cli/src/ui/components/ConfigInitDisplay.tsx
|
|
352975
353154
|
init_esbuild_shims();
|
|
352976
|
-
var
|
|
352977
|
-
var
|
|
353155
|
+
var import_react100 = __toESM(require_react(), 1);
|
|
353156
|
+
var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1);
|
|
352978
353157
|
var ConfigInitDisplay = /* @__PURE__ */ __name(() => {
|
|
352979
353158
|
const config = useConfig();
|
|
352980
|
-
const [message2, setMessage] = (0,
|
|
352981
|
-
(0,
|
|
353159
|
+
const [message2, setMessage] = (0, import_react100.useState)(t2("Initializing..."));
|
|
353160
|
+
(0, import_react100.useEffect)(() => {
|
|
352982
353161
|
const onChange = /* @__PURE__ */ __name((clients) => {
|
|
352983
353162
|
if (!clients || clients.size === 0) {
|
|
352984
353163
|
setMessage(t2("Initializing..."));
|
|
@@ -353002,15 +353181,15 @@ var ConfigInitDisplay = /* @__PURE__ */ __name(() => {
|
|
|
353002
353181
|
appEvents.off("mcp-client-update", onChange);
|
|
353003
353182
|
};
|
|
353004
353183
|
}, [config]);
|
|
353005
|
-
return /* @__PURE__ */ (0,
|
|
353006
|
-
/* @__PURE__ */ (0,
|
|
353184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(Text3, { children: [
|
|
353185
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(OSASpinner, {}),
|
|
353007
353186
|
" ",
|
|
353008
|
-
/* @__PURE__ */ (0,
|
|
353187
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Text3, { color: theme.text.primary, children: message2 })
|
|
353009
353188
|
] }) });
|
|
353010
353189
|
}, "ConfigInitDisplay");
|
|
353011
353190
|
|
|
353012
353191
|
// packages/cli/src/ui/components/Composer.tsx
|
|
353013
|
-
var
|
|
353192
|
+
var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1);
|
|
353014
353193
|
var Composer = /* @__PURE__ */ __name(() => {
|
|
353015
353194
|
const config = useConfig();
|
|
353016
353195
|
const settings = useSettings();
|
|
@@ -353022,12 +353201,12 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353022
353201
|
const isNarrow = isNarrowWidth(terminalWidth);
|
|
353023
353202
|
const debugConsoleMaxHeight = Math.floor(Math.max(terminalWidth * 0.2, 5));
|
|
353024
353203
|
const { contextFileNames, showAutoAcceptIndicator } = uiState;
|
|
353025
|
-
const { containerWidth } = (0,
|
|
353204
|
+
const { containerWidth } = (0, import_react101.useMemo)(
|
|
353026
353205
|
() => calculatePromptWidths(uiState.terminalWidth),
|
|
353027
353206
|
[uiState.terminalWidth]
|
|
353028
353207
|
);
|
|
353029
|
-
return /* @__PURE__ */ (0,
|
|
353030
|
-
!uiState.embeddedShellFocused && /* @__PURE__ */ (0,
|
|
353208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
353209
|
+
!uiState.embeddedShellFocused && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
353031
353210
|
LoadingIndicator,
|
|
353032
353211
|
{
|
|
353033
353212
|
thought: uiState.streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ || config.getAccessibility()?.disableLoadingPhrases ? void 0 : uiState.thought,
|
|
@@ -353035,9 +353214,15 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353035
353214
|
elapsedTime: uiState.elapsedTime
|
|
353036
353215
|
}
|
|
353037
353216
|
),
|
|
353038
|
-
!uiState.
|
|
353039
|
-
|
|
353040
|
-
|
|
353217
|
+
!uiState.embeddedShellFocused && uiState.streamingState !== "idle" /* Idle */ && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
353218
|
+
ConsultationDisplay,
|
|
353219
|
+
{
|
|
353220
|
+
isStreamingActive: uiState.streamingState === "responding" /* Responding */
|
|
353221
|
+
}
|
|
353222
|
+
),
|
|
353223
|
+
!uiState.isConfigInitialized && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ConfigInitDisplay, {}),
|
|
353224
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(QueuedMessageDisplay, { messageQueue: uiState.messageQueue }),
|
|
353225
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
353041
353226
|
Box_default,
|
|
353042
353227
|
{
|
|
353043
353228
|
marginTop: 1,
|
|
@@ -353046,9 +353231,9 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353046
353231
|
flexDirection: isNarrow ? "column" : "row",
|
|
353047
353232
|
alignItems: isNarrow ? "flex-start" : "center",
|
|
353048
353233
|
children: [
|
|
353049
|
-
/* @__PURE__ */ (0,
|
|
353050
|
-
process.env["OSA_SYSTEM_MD"] && /* @__PURE__ */ (0,
|
|
353051
|
-
uiState.ctrlCPressedOnce ? /* @__PURE__ */ (0,
|
|
353234
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Box_default, { marginRight: 1, children: [
|
|
353235
|
+
process.env["OSA_SYSTEM_MD"] && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Text3, { color: theme.status.error, children: "|\u2310\u25A0_\u25A0| " }),
|
|
353236
|
+
uiState.ctrlCPressedOnce ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Text3, { color: theme.status.warning, children: t2("Press Ctrl+C again to exit.") }) : uiState.ctrlDPressedOnce ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Text3, { color: theme.status.warning, children: t2("Press Ctrl+D again to exit.") }) : uiState.showEscapePrompt ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Text3, { color: theme.text.secondary, children: t2("Press Esc again to clear.") }) : !settings.merged.ui?.hideContextSummary && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
353052
353237
|
ContextSummaryDisplay,
|
|
353053
353238
|
{
|
|
353054
353239
|
ideContext: uiState.ideContextState,
|
|
@@ -353060,15 +353245,15 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353060
353245
|
}
|
|
353061
353246
|
)
|
|
353062
353247
|
] }),
|
|
353063
|
-
/* @__PURE__ */ (0,
|
|
353064
|
-
showAutoAcceptIndicator !== ApprovalMode.DEFAULT && !uiState.shellModeActive && /* @__PURE__ */ (0,
|
|
353065
|
-
uiState.shellModeActive && /* @__PURE__ */ (0,
|
|
353248
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Box_default, { paddingTop: isNarrow ? 1 : 0, children: [
|
|
353249
|
+
showAutoAcceptIndicator !== ApprovalMode.DEFAULT && !uiState.shellModeActive && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator }),
|
|
353250
|
+
uiState.shellModeActive && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ShellModeIndicator, {})
|
|
353066
353251
|
] })
|
|
353067
353252
|
]
|
|
353068
353253
|
}
|
|
353069
353254
|
),
|
|
353070
|
-
uiState.showErrorDetails && /* @__PURE__ */ (0,
|
|
353071
|
-
/* @__PURE__ */ (0,
|
|
353255
|
+
uiState.showErrorDetails && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(OverflowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
353256
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
353072
353257
|
DetailedMessagesDisplay,
|
|
353073
353258
|
{
|
|
353074
353259
|
messages: uiState.filteredConsoleMessages,
|
|
@@ -353076,9 +353261,9 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353076
353261
|
width: containerWidth
|
|
353077
353262
|
}
|
|
353078
353263
|
),
|
|
353079
|
-
/* @__PURE__ */ (0,
|
|
353264
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ShowMoreLines, { constrainHeight: uiState.constrainHeight })
|
|
353080
353265
|
] }) }),
|
|
353081
|
-
uiState.isInputActive && /* @__PURE__ */ (0,
|
|
353266
|
+
uiState.isInputActive && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
353082
353267
|
InputPrompt,
|
|
353083
353268
|
{
|
|
353084
353269
|
buffer: uiState.buffer,
|
|
@@ -353100,37 +353285,37 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353100
353285
|
placeholder: vimEnabled ? " " + t2("Press 'i' for INSERT mode and 'Esc' for NORMAL mode.") : " " + t2("Type your message or @path/to/file")
|
|
353101
353286
|
}
|
|
353102
353287
|
),
|
|
353103
|
-
!settings.merged.ui?.hideFooter && !isScreenReaderEnabled && /* @__PURE__ */ (0,
|
|
353288
|
+
!settings.merged.ui?.hideFooter && !isScreenReaderEnabled && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Footer, {})
|
|
353104
353289
|
] });
|
|
353105
353290
|
}, "Composer");
|
|
353106
353291
|
|
|
353107
353292
|
// packages/cli/src/ui/components/ExitWarning.tsx
|
|
353108
353293
|
init_esbuild_shims();
|
|
353109
|
-
var
|
|
353294
|
+
var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
|
|
353110
353295
|
var ExitWarning = /* @__PURE__ */ __name(() => {
|
|
353111
353296
|
const uiState = useUIState();
|
|
353112
|
-
return /* @__PURE__ */ (0,
|
|
353113
|
-
uiState.dialogsVisible && uiState.ctrlCPressedOnce && /* @__PURE__ */ (0,
|
|
353114
|
-
uiState.dialogsVisible && uiState.ctrlDPressedOnce && /* @__PURE__ */ (0,
|
|
353297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_jsx_runtime104.Fragment, { children: [
|
|
353298
|
+
uiState.dialogsVisible && uiState.ctrlCPressedOnce && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Text3, { color: theme.status.warning, children: "Press Ctrl+C again to exit." }) }),
|
|
353299
|
+
uiState.dialogsVisible && uiState.ctrlDPressedOnce && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Text3, { color: theme.status.warning, children: "Press Ctrl+D again to exit." }) })
|
|
353115
353300
|
] });
|
|
353116
353301
|
}, "ExitWarning");
|
|
353117
353302
|
|
|
353118
353303
|
// packages/cli/src/ui/layouts/ScreenReaderAppLayout.tsx
|
|
353119
|
-
var
|
|
353304
|
+
var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1);
|
|
353120
353305
|
var ScreenReaderAppLayout = /* @__PURE__ */ __name(() => {
|
|
353121
353306
|
const uiState = useUIState();
|
|
353122
|
-
return /* @__PURE__ */ (0,
|
|
353123
|
-
/* @__PURE__ */ (0,
|
|
353124
|
-
/* @__PURE__ */ (0,
|
|
353125
|
-
/* @__PURE__ */ (0,
|
|
353126
|
-
uiState.dialogsVisible ? /* @__PURE__ */ (0,
|
|
353307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(Box_default, { flexDirection: "column", width: "90%", height: "100%", children: [
|
|
353308
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Notifications, {}),
|
|
353309
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Footer, {}),
|
|
353310
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Box_default, { flexGrow: 1, overflow: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(MainContent, {}) }),
|
|
353311
|
+
uiState.dialogsVisible ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
353127
353312
|
DialogManager,
|
|
353128
353313
|
{
|
|
353129
353314
|
terminalWidth: uiState.terminalWidth,
|
|
353130
353315
|
addItem: uiState.historyManager.addItem
|
|
353131
353316
|
}
|
|
353132
|
-
) : /* @__PURE__ */ (0,
|
|
353133
|
-
/* @__PURE__ */ (0,
|
|
353317
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Composer, {}),
|
|
353318
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ExitWarning, {})
|
|
353134
353319
|
] });
|
|
353135
353320
|
}, "ScreenReaderAppLayout");
|
|
353136
353321
|
|
|
@@ -353139,7 +353324,7 @@ init_esbuild_shims();
|
|
|
353139
353324
|
|
|
353140
353325
|
// packages/cli/src/ui/components/TaskMasterPanel.tsx
|
|
353141
353326
|
init_esbuild_shims();
|
|
353142
|
-
var
|
|
353327
|
+
var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1);
|
|
353143
353328
|
var STATUS_ICONS2 = {
|
|
353144
353329
|
pending: "\u25CB",
|
|
353145
353330
|
in_progress: "\u25D0",
|
|
@@ -353157,13 +353342,13 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353157
353342
|
const totalCount = todos.length;
|
|
353158
353343
|
const progressPercent = Math.round(completedCount / totalCount * 100);
|
|
353159
353344
|
if (compact && activeTodo) {
|
|
353160
|
-
return /* @__PURE__ */ (0,
|
|
353161
|
-
/* @__PURE__ */ (0,
|
|
353162
|
-
/* @__PURE__ */ (0,
|
|
353345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { marginBottom: 1, children: [
|
|
353346
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
353347
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(build_default, { type: "dots" }),
|
|
353163
353348
|
" "
|
|
353164
353349
|
] }),
|
|
353165
|
-
/* @__PURE__ */ (0,
|
|
353166
|
-
/* @__PURE__ */ (0,
|
|
353350
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: theme.status.success, children: activeTodo.activeForm || activeTodo.content }),
|
|
353351
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
353167
353352
|
" ",
|
|
353168
353353
|
"(",
|
|
353169
353354
|
completedCount,
|
|
@@ -353173,7 +353358,7 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353173
353358
|
] })
|
|
353174
353359
|
] });
|
|
353175
353360
|
}
|
|
353176
|
-
return /* @__PURE__ */ (0,
|
|
353361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
|
|
353177
353362
|
Box_default,
|
|
353178
353363
|
{
|
|
353179
353364
|
flexDirection: "column",
|
|
@@ -353182,9 +353367,9 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353182
353367
|
paddingX: 1,
|
|
353183
353368
|
marginBottom: 1,
|
|
353184
353369
|
children: [
|
|
353185
|
-
/* @__PURE__ */ (0,
|
|
353186
|
-
/* @__PURE__ */ (0,
|
|
353187
|
-
/* @__PURE__ */ (0,
|
|
353370
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { justifyContent: "space-between", children: [
|
|
353371
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: theme.text.accent, bold: true, children: "Tasks" }),
|
|
353372
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
353188
353373
|
completedCount,
|
|
353189
353374
|
"/",
|
|
353190
353375
|
totalCount,
|
|
@@ -353193,17 +353378,17 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353193
353378
|
"%)"
|
|
353194
353379
|
] })
|
|
353195
353380
|
] }),
|
|
353196
|
-
/* @__PURE__ */ (0,
|
|
353197
|
-
/* @__PURE__ */ (0,
|
|
353198
|
-
/* @__PURE__ */ (0,
|
|
353381
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { marginY: 0, children: [
|
|
353382
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: theme.status.success, children: "\u2588".repeat(Math.round(progressPercent / 100 * 20)) }),
|
|
353383
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: theme.text.secondary, children: "\u2591".repeat(20 - Math.round(progressPercent / 100 * 20)) })
|
|
353199
353384
|
] }),
|
|
353200
|
-
/* @__PURE__ */ (0,
|
|
353385
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Box_default, { flexDirection: "column", children: todos.map((todo) => {
|
|
353201
353386
|
const isCompleted = todo.status === "completed";
|
|
353202
353387
|
const isInProgress = todo.status === "in_progress";
|
|
353203
353388
|
const itemColor = isCompleted ? theme.text.secondary : isInProgress ? theme.status.success : theme.text.primary;
|
|
353204
|
-
return /* @__PURE__ */ (0,
|
|
353205
|
-
/* @__PURE__ */ (0,
|
|
353206
|
-
/* @__PURE__ */ (0,
|
|
353389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(Box_default, { flexDirection: "row", minHeight: 1, children: [
|
|
353390
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Box_default, { width: 3, children: isInProgress ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: itemColor, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(build_default, { type: "dots" }) }) : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Text3, { color: itemColor, children: STATUS_ICONS2[todo.status] }) }),
|
|
353391
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
353207
353392
|
Text3,
|
|
353208
353393
|
{
|
|
353209
353394
|
color: itemColor,
|
|
@@ -353220,30 +353405,30 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353220
353405
|
}, "TaskMasterPanel");
|
|
353221
353406
|
|
|
353222
353407
|
// packages/cli/src/ui/layouts/DefaultAppLayout.tsx
|
|
353223
|
-
var
|
|
353408
|
+
var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
|
|
353224
353409
|
var DefaultAppLayout = /* @__PURE__ */ __name(({
|
|
353225
353410
|
width = "90%"
|
|
353226
353411
|
}) => {
|
|
353227
353412
|
const uiState = useUIState();
|
|
353228
|
-
return /* @__PURE__ */ (0,
|
|
353229
|
-
/* @__PURE__ */ (0,
|
|
353230
|
-
/* @__PURE__ */ (0,
|
|
353231
|
-
/* @__PURE__ */ (0,
|
|
353232
|
-
/* @__PURE__ */ (0,
|
|
353233
|
-
uiState.dialogsVisible ? /* @__PURE__ */ (0,
|
|
353413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { flexDirection: "column", width, children: [
|
|
353414
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(MainContent, {}),
|
|
353415
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Box_default, { flexDirection: "column", ref: uiState.mainControlsRef, children: [
|
|
353416
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Notifications, {}),
|
|
353417
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(TaskMasterPanel, { compact: true }),
|
|
353418
|
+
uiState.dialogsVisible ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
|
|
353234
353419
|
DialogManager,
|
|
353235
353420
|
{
|
|
353236
353421
|
terminalWidth: uiState.terminalWidth,
|
|
353237
353422
|
addItem: uiState.historyManager.addItem
|
|
353238
353423
|
}
|
|
353239
|
-
) : /* @__PURE__ */ (0,
|
|
353240
|
-
/* @__PURE__ */ (0,
|
|
353424
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Composer, {}),
|
|
353425
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ExitWarning, {})
|
|
353241
353426
|
] })
|
|
353242
353427
|
] });
|
|
353243
353428
|
}, "DefaultAppLayout");
|
|
353244
353429
|
|
|
353245
353430
|
// packages/cli/src/ui/App.tsx
|
|
353246
|
-
var
|
|
353431
|
+
var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1);
|
|
353247
353432
|
var getContainerWidth = /* @__PURE__ */ __name((terminalWidth) => {
|
|
353248
353433
|
if (terminalWidth <= 80) {
|
|
353249
353434
|
return "98%";
|
|
@@ -353261,9 +353446,9 @@ var App2 = /* @__PURE__ */ __name(() => {
|
|
|
353261
353446
|
const { columns } = useTerminalSize();
|
|
353262
353447
|
const containerWidth = getContainerWidth(columns);
|
|
353263
353448
|
if (uiState.quittingMessages) {
|
|
353264
|
-
return /* @__PURE__ */ (0,
|
|
353449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(QuittingDisplay, {});
|
|
353265
353450
|
}
|
|
353266
|
-
return /* @__PURE__ */ (0,
|
|
353451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(StreamingContext.Provider, { value: uiState.streamingState, children: isScreenReaderEnabled ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ScreenReaderAppLayout, {}) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(DefaultAppLayout, { width: containerWidth }) });
|
|
353267
353452
|
}, "App");
|
|
353268
353453
|
|
|
353269
353454
|
// packages/cli/src/ui/AppContainer.tsx
|
|
@@ -353271,12 +353456,12 @@ import process52 from "node:process";
|
|
|
353271
353456
|
|
|
353272
353457
|
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
353273
353458
|
init_esbuild_shims();
|
|
353274
|
-
var
|
|
353459
|
+
var import_react102 = __toESM(require_react(), 1);
|
|
353275
353460
|
import process37 from "node:process";
|
|
353276
353461
|
var MEMORY_WARNING_THRESHOLD = 7 * 1024 * 1024 * 1024;
|
|
353277
353462
|
var MEMORY_CHECK_INTERVAL = 60 * 1e3;
|
|
353278
353463
|
var useMemoryMonitor = /* @__PURE__ */ __name(({ addItem }) => {
|
|
353279
|
-
(0,
|
|
353464
|
+
(0, import_react102.useEffect)(() => {
|
|
353280
353465
|
const intervalId = setInterval(() => {
|
|
353281
353466
|
const usage2 = process37.memoryUsage().rss;
|
|
353282
353467
|
if (usage2 > MEMORY_WARNING_THRESHOLD) {
|
|
@@ -353296,11 +353481,11 @@ var useMemoryMonitor = /* @__PURE__ */ __name(({ addItem }) => {
|
|
|
353296
353481
|
|
|
353297
353482
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
353298
353483
|
init_esbuild_shims();
|
|
353299
|
-
var
|
|
353484
|
+
var import_react103 = __toESM(require_react(), 1);
|
|
353300
353485
|
import process38 from "node:process";
|
|
353301
353486
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
353302
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
353303
|
-
const openThemeDialog = (0,
|
|
353487
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react103.useState)(!!initialThemeError);
|
|
353488
|
+
const openThemeDialog = (0, import_react103.useCallback)(() => {
|
|
353304
353489
|
if (process38.env["NO_COLOR"]) {
|
|
353305
353490
|
addItem(
|
|
353306
353491
|
{
|
|
@@ -353315,7 +353500,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
353315
353500
|
}
|
|
353316
353501
|
setIsThemeDialogOpen(true);
|
|
353317
353502
|
}, [addItem]);
|
|
353318
|
-
const applyTheme = (0,
|
|
353503
|
+
const applyTheme = (0, import_react103.useCallback)(
|
|
353319
353504
|
(themeName) => {
|
|
353320
353505
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
353321
353506
|
setIsThemeDialogOpen(true);
|
|
@@ -353330,13 +353515,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
353330
353515
|
},
|
|
353331
353516
|
[setThemeError]
|
|
353332
353517
|
);
|
|
353333
|
-
const handleThemeHighlight = (0,
|
|
353518
|
+
const handleThemeHighlight = (0, import_react103.useCallback)(
|
|
353334
353519
|
(themeName) => {
|
|
353335
353520
|
applyTheme(themeName);
|
|
353336
353521
|
},
|
|
353337
353522
|
[applyTheme]
|
|
353338
353523
|
);
|
|
353339
|
-
const handleThemeSelect = (0,
|
|
353524
|
+
const handleThemeSelect = (0, import_react103.useCallback)(
|
|
353340
353525
|
(themeName, scope) => {
|
|
353341
353526
|
try {
|
|
353342
353527
|
const mergedCustomThemes = {
|
|
@@ -353376,19 +353561,19 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
353376
353561
|
|
|
353377
353562
|
// packages/cli/src/ui/auth/useAuth.ts
|
|
353378
353563
|
init_esbuild_shims();
|
|
353379
|
-
var
|
|
353564
|
+
var import_react105 = __toESM(require_react(), 1);
|
|
353380
353565
|
|
|
353381
353566
|
// packages/cli/src/ui/hooks/useQwenAuth.ts
|
|
353382
353567
|
init_esbuild_shims();
|
|
353383
|
-
var
|
|
353568
|
+
var import_react104 = __toESM(require_react(), 1);
|
|
353384
353569
|
var useOSAAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
|
|
353385
|
-
const [OSAAuthState, setOSAAuthState] = (0,
|
|
353570
|
+
const [OSAAuthState, setOSAAuthState] = (0, import_react104.useState)({
|
|
353386
353571
|
deviceAuth: null,
|
|
353387
353572
|
authStatus: "idle",
|
|
353388
353573
|
authMessage: null
|
|
353389
353574
|
});
|
|
353390
353575
|
const isOSAAuth = pendingAuthType === AuthType2.OSA_OAUTH;
|
|
353391
|
-
(0,
|
|
353576
|
+
(0, import_react104.useEffect)(() => {
|
|
353392
353577
|
if (!isOSAAuth || !isAuthenticating) {
|
|
353393
353578
|
setOSAAuthState({
|
|
353394
353579
|
deviceAuth: null,
|
|
@@ -353428,7 +353613,7 @@ var useOSAAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
|
|
|
353428
353613
|
OSAOAuth2Events.off(OSAOAuth2Event.AuthProgress, handleAuthProgress);
|
|
353429
353614
|
};
|
|
353430
353615
|
}, [isOSAAuth, isAuthenticating]);
|
|
353431
|
-
const cancelOSAAuth = (0,
|
|
353616
|
+
const cancelOSAAuth = (0, import_react104.useCallback)(() => {
|
|
353432
353617
|
OSAOAuth2Events.emit(OSAOAuth2Event.AuthCancel);
|
|
353433
353618
|
setOSAAuthState({
|
|
353434
353619
|
deviceAuth: null,
|
|
@@ -353445,20 +353630,20 @@ var useOSAAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
|
|
|
353445
353630
|
// packages/cli/src/ui/auth/useAuth.ts
|
|
353446
353631
|
var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
353447
353632
|
const unAuthenticated = settings.merged.security?.auth?.selectedType === void 0;
|
|
353448
|
-
const [authState, setAuthState] = (0,
|
|
353633
|
+
const [authState, setAuthState] = (0, import_react105.useState)(
|
|
353449
353634
|
unAuthenticated ? "updating" /* Updating */ : "unauthenticated" /* Unauthenticated */
|
|
353450
353635
|
);
|
|
353451
|
-
const [authError, setAuthError] = (0,
|
|
353452
|
-
const [isAuthenticating, setIsAuthenticating] = (0,
|
|
353453
|
-
const [isAuthDialogOpen, setIsAuthDialogOpen] = (0,
|
|
353454
|
-
const [pendingAuthType, setPendingAuthType] = (0,
|
|
353636
|
+
const [authError, setAuthError] = (0, import_react105.useState)(null);
|
|
353637
|
+
const [isAuthenticating, setIsAuthenticating] = (0, import_react105.useState)(false);
|
|
353638
|
+
const [isAuthDialogOpen, setIsAuthDialogOpen] = (0, import_react105.useState)(unAuthenticated);
|
|
353639
|
+
const [pendingAuthType, setPendingAuthType] = (0, import_react105.useState)(
|
|
353455
353640
|
void 0
|
|
353456
353641
|
);
|
|
353457
353642
|
const { OSAAuthState, cancelOSAAuth } = useOSAAuth(
|
|
353458
353643
|
pendingAuthType,
|
|
353459
353644
|
isAuthenticating
|
|
353460
353645
|
);
|
|
353461
|
-
const onAuthError = (0,
|
|
353646
|
+
const onAuthError = (0, import_react105.useCallback)(
|
|
353462
353647
|
(error) => {
|
|
353463
353648
|
setAuthError(error);
|
|
353464
353649
|
if (error) {
|
|
@@ -353468,7 +353653,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353468
353653
|
},
|
|
353469
353654
|
[setAuthError, setAuthState]
|
|
353470
353655
|
);
|
|
353471
|
-
const handleAuthFailure = (0,
|
|
353656
|
+
const handleAuthFailure = (0, import_react105.useCallback)(
|
|
353472
353657
|
(error) => {
|
|
353473
353658
|
setIsAuthenticating(false);
|
|
353474
353659
|
const errorMessage = t2("Failed to authenticate. Message: {{message}}", {
|
|
@@ -353487,7 +353672,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353487
353672
|
},
|
|
353488
353673
|
[onAuthError, pendingAuthType, config]
|
|
353489
353674
|
);
|
|
353490
|
-
const handleAuthSuccess = (0,
|
|
353675
|
+
const handleAuthSuccess = (0, import_react105.useCallback)(
|
|
353491
353676
|
async (authType, scope, credentials) => {
|
|
353492
353677
|
try {
|
|
353493
353678
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
@@ -353534,7 +353719,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353534
353719
|
},
|
|
353535
353720
|
[settings, handleAuthFailure, config, addItem]
|
|
353536
353721
|
);
|
|
353537
|
-
const performAuth = (0,
|
|
353722
|
+
const performAuth = (0, import_react105.useCallback)(
|
|
353538
353723
|
async (authType, scope, credentials) => {
|
|
353539
353724
|
try {
|
|
353540
353725
|
await config.refreshAuth(authType);
|
|
@@ -353545,7 +353730,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353545
353730
|
},
|
|
353546
353731
|
[config, handleAuthSuccess, handleAuthFailure]
|
|
353547
353732
|
);
|
|
353548
|
-
const handleAuthSelect = (0,
|
|
353733
|
+
const handleAuthSelect = (0, import_react105.useCallback)(
|
|
353549
353734
|
async (authType, scope, credentials) => {
|
|
353550
353735
|
if (!authType) {
|
|
353551
353736
|
setIsAuthDialogOpen(false);
|
|
@@ -353582,10 +353767,10 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353582
353767
|
},
|
|
353583
353768
|
[config, performAuth]
|
|
353584
353769
|
);
|
|
353585
|
-
const openAuthDialog = (0,
|
|
353770
|
+
const openAuthDialog = (0, import_react105.useCallback)(() => {
|
|
353586
353771
|
setIsAuthDialogOpen(true);
|
|
353587
353772
|
}, []);
|
|
353588
|
-
const cancelAuthentication = (0,
|
|
353773
|
+
const cancelAuthentication = (0, import_react105.useCallback)(() => {
|
|
353589
353774
|
if (isAuthenticating && pendingAuthType === AuthType2.OSA_OAUTH) {
|
|
353590
353775
|
cancelOSAAuth();
|
|
353591
353776
|
}
|
|
@@ -353597,7 +353782,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353597
353782
|
setIsAuthDialogOpen(true);
|
|
353598
353783
|
setAuthError(null);
|
|
353599
353784
|
}, [isAuthenticating, pendingAuthType, cancelOSAAuth, config]);
|
|
353600
|
-
(0,
|
|
353785
|
+
(0, import_react105.useEffect)(() => {
|
|
353601
353786
|
const defaultAuthType = process.env["OSA_DEFAULT_AUTH_TYPE"];
|
|
353602
353787
|
if (defaultAuthType && ![AuthType2.OSA_OAUTH, AuthType2.USE_OPENAI].includes(
|
|
353603
353788
|
defaultAuthType
|
|
@@ -353630,7 +353815,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353630
353815
|
|
|
353631
353816
|
// packages/cli/src/ui/hooks/useQuotaAndFallback.ts
|
|
353632
353817
|
init_esbuild_shims();
|
|
353633
|
-
var
|
|
353818
|
+
var import_react106 = __toESM(require_react(), 1);
|
|
353634
353819
|
function useQuotaAndFallback({
|
|
353635
353820
|
config,
|
|
353636
353821
|
historyManager,
|
|
@@ -353638,9 +353823,9 @@ function useQuotaAndFallback({
|
|
|
353638
353823
|
setAuthState,
|
|
353639
353824
|
setModelSwitchedFromQuotaError
|
|
353640
353825
|
}) {
|
|
353641
|
-
const [proQuotaRequest, setProQuotaRequest] = (0,
|
|
353642
|
-
const isDialogPending = (0,
|
|
353643
|
-
(0,
|
|
353826
|
+
const [proQuotaRequest, setProQuotaRequest] = (0, import_react106.useState)(null);
|
|
353827
|
+
const isDialogPending = (0, import_react106.useRef)(false);
|
|
353828
|
+
(0, import_react106.useEffect)(() => {
|
|
353644
353829
|
const fallbackHandler = /* @__PURE__ */ __name(async (failedModel, fallbackModel, error) => {
|
|
353645
353830
|
if (config.isInFallbackMode()) {
|
|
353646
353831
|
return null;
|
|
@@ -353718,7 +353903,7 @@ function useQuotaAndFallback({
|
|
|
353718
353903
|
}, "fallbackHandler");
|
|
353719
353904
|
config.setFallbackModelHandler(fallbackHandler);
|
|
353720
353905
|
}, [config, historyManager, userTier, setModelSwitchedFromQuotaError]);
|
|
353721
|
-
const handleProQuotaChoice = (0,
|
|
353906
|
+
const handleProQuotaChoice = (0, import_react106.useCallback)(
|
|
353722
353907
|
(choice2) => {
|
|
353723
353908
|
if (!proQuotaRequest) return;
|
|
353724
353909
|
const intent = choice2 === "auth" ? "auth" : "retry";
|
|
@@ -353748,13 +353933,13 @@ __name(useQuotaAndFallback, "useQuotaAndFallback");
|
|
|
353748
353933
|
|
|
353749
353934
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
353750
353935
|
init_esbuild_shims();
|
|
353751
|
-
var
|
|
353936
|
+
var import_react107 = __toESM(require_react(), 1);
|
|
353752
353937
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
353753
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
353754
|
-
const openEditorDialog = (0,
|
|
353938
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react107.useState)(false);
|
|
353939
|
+
const openEditorDialog = (0, import_react107.useCallback)(() => {
|
|
353755
353940
|
setIsEditorDialogOpen(true);
|
|
353756
353941
|
}, []);
|
|
353757
|
-
const handleEditorSelect = (0,
|
|
353942
|
+
const handleEditorSelect = (0, import_react107.useCallback)(
|
|
353758
353943
|
(editorType, scope) => {
|
|
353759
353944
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
353760
353945
|
return;
|
|
@@ -353776,7 +353961,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
353776
353961
|
},
|
|
353777
353962
|
[loadedSettings, setEditorError, addItem]
|
|
353778
353963
|
);
|
|
353779
|
-
const exitEditorDialog = (0,
|
|
353964
|
+
const exitEditorDialog = (0, import_react107.useCallback)(() => {
|
|
353780
353965
|
setIsEditorDialogOpen(false);
|
|
353781
353966
|
}, []);
|
|
353782
353967
|
return {
|
|
@@ -353789,13 +353974,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
353789
353974
|
|
|
353790
353975
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
353791
353976
|
init_esbuild_shims();
|
|
353792
|
-
var
|
|
353977
|
+
var import_react108 = __toESM(require_react(), 1);
|
|
353793
353978
|
function useSettingsCommand() {
|
|
353794
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
353795
|
-
const openSettingsDialog = (0,
|
|
353979
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react108.useState)(false);
|
|
353980
|
+
const openSettingsDialog = (0, import_react108.useCallback)(() => {
|
|
353796
353981
|
setIsSettingsDialogOpen(true);
|
|
353797
353982
|
}, []);
|
|
353798
|
-
const closeSettingsDialog = (0,
|
|
353983
|
+
const closeSettingsDialog = (0, import_react108.useCallback)(() => {
|
|
353799
353984
|
setIsSettingsDialogOpen(false);
|
|
353800
353985
|
}, []);
|
|
353801
353986
|
return {
|
|
@@ -353808,13 +353993,13 @@ __name(useSettingsCommand, "useSettingsCommand");
|
|
|
353808
353993
|
|
|
353809
353994
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
353810
353995
|
init_esbuild_shims();
|
|
353811
|
-
var
|
|
353996
|
+
var import_react109 = __toESM(require_react(), 1);
|
|
353812
353997
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
353813
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
353814
|
-
const openModelDialog = (0,
|
|
353998
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react109.useState)(false);
|
|
353999
|
+
const openModelDialog = (0, import_react109.useCallback)(() => {
|
|
353815
354000
|
setIsModelDialogOpen(true);
|
|
353816
354001
|
}, []);
|
|
353817
|
-
const closeModelDialog = (0,
|
|
354002
|
+
const closeModelDialog = (0, import_react109.useCallback)(() => {
|
|
353818
354003
|
setIsModelDialogOpen(false);
|
|
353819
354004
|
}, []);
|
|
353820
354005
|
return {
|
|
@@ -353826,13 +354011,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
353826
354011
|
|
|
353827
354012
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
353828
354013
|
init_esbuild_shims();
|
|
353829
|
-
var
|
|
354014
|
+
var import_react110 = __toESM(require_react(), 1);
|
|
353830
354015
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
353831
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
353832
|
-
const openApprovalModeDialog = (0,
|
|
354016
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react110.useState)(false);
|
|
354017
|
+
const openApprovalModeDialog = (0, import_react110.useCallback)(() => {
|
|
353833
354018
|
setIsApprovalModeDialogOpen(true);
|
|
353834
354019
|
}, []);
|
|
353835
|
-
const handleApprovalModeSelect = (0,
|
|
354020
|
+
const handleApprovalModeSelect = (0, import_react110.useCallback)(
|
|
353836
354021
|
(mode, scope) => {
|
|
353837
354022
|
try {
|
|
353838
354023
|
if (!mode) {
|
|
@@ -353858,7 +354043,7 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
353858
354043
|
|
|
353859
354044
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
353860
354045
|
init_esbuild_shims();
|
|
353861
|
-
var
|
|
354046
|
+
var import_react111 = __toESM(require_react(), 1);
|
|
353862
354047
|
init_node();
|
|
353863
354048
|
import process39 from "node:process";
|
|
353864
354049
|
|
|
@@ -354102,41 +354287,41 @@ var McpPromptLoader = class {
|
|
|
354102
354287
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
354103
354288
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, setIsProcessing, setOSAMdFileCount, actions, extensionsUpdateState, isConfigInitialized) => {
|
|
354104
354289
|
const session = useSessionStats();
|
|
354105
|
-
const [commands, setCommands] = (0,
|
|
354106
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
354107
|
-
const reloadCommands = (0,
|
|
354290
|
+
const [commands, setCommands] = (0, import_react111.useState)([]);
|
|
354291
|
+
const [reloadTrigger, setReloadTrigger] = (0, import_react111.useState)(0);
|
|
354292
|
+
const reloadCommands = (0, import_react111.useCallback)(() => {
|
|
354108
354293
|
setReloadTrigger((v) => v + 1);
|
|
354109
354294
|
}, []);
|
|
354110
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
354111
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
354112
|
-
const [quitConfirmationRequest, setQuitConfirmationRequest] = (0,
|
|
354113
|
-
const [sessionShellAllowlist, setSessionShellAllowlist] = (0,
|
|
354295
|
+
const [shellConfirmationRequest, setShellConfirmationRequest] = (0, import_react111.useState)(null);
|
|
354296
|
+
const [confirmationRequest, setConfirmationRequest] = (0, import_react111.useState)(null);
|
|
354297
|
+
const [quitConfirmationRequest, setQuitConfirmationRequest] = (0, import_react111.useState)(null);
|
|
354298
|
+
const [sessionShellAllowlist, setSessionShellAllowlist] = (0, import_react111.useState)(
|
|
354114
354299
|
/* @__PURE__ */ new Set()
|
|
354115
354300
|
);
|
|
354116
|
-
const gitService = (0,
|
|
354301
|
+
const gitService = (0, import_react111.useMemo)(() => {
|
|
354117
354302
|
if (!config?.getProjectRoot()) {
|
|
354118
354303
|
return;
|
|
354119
354304
|
}
|
|
354120
354305
|
return new GitService(config.getProjectRoot(), config.storage);
|
|
354121
354306
|
}, [config]);
|
|
354122
|
-
const logger6 = (0,
|
|
354307
|
+
const logger6 = (0, import_react111.useMemo)(() => {
|
|
354123
354308
|
const l2 = new Logger(
|
|
354124
354309
|
config?.getSessionId() || "",
|
|
354125
354310
|
config?.storage ?? new Storage(process39.cwd())
|
|
354126
354311
|
);
|
|
354127
354312
|
return l2;
|
|
354128
354313
|
}, [config]);
|
|
354129
|
-
const [pendingItem, setPendingItem] = (0,
|
|
354314
|
+
const [pendingItem, setPendingItem] = (0, import_react111.useState)(
|
|
354130
354315
|
null
|
|
354131
354316
|
);
|
|
354132
|
-
const pendingHistoryItems = (0,
|
|
354317
|
+
const pendingHistoryItems = (0, import_react111.useMemo)(() => {
|
|
354133
354318
|
const items = [];
|
|
354134
354319
|
if (pendingItem != null) {
|
|
354135
354320
|
items.push(pendingItem);
|
|
354136
354321
|
}
|
|
354137
354322
|
return items;
|
|
354138
354323
|
}, [pendingItem]);
|
|
354139
|
-
const addMessage = (0,
|
|
354324
|
+
const addMessage = (0, import_react111.useCallback)(
|
|
354140
354325
|
(message2) => {
|
|
354141
354326
|
let historyItemContent;
|
|
354142
354327
|
if (message2.type === "about" /* ABOUT */) {
|
|
@@ -354192,7 +354377,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
354192
354377
|
},
|
|
354193
354378
|
[addItem]
|
|
354194
354379
|
);
|
|
354195
|
-
const commandContext = (0,
|
|
354380
|
+
const commandContext = (0, import_react111.useMemo)(
|
|
354196
354381
|
() => ({
|
|
354197
354382
|
services: {
|
|
354198
354383
|
config,
|
|
@@ -354245,7 +354430,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
354245
354430
|
extensionsUpdateState
|
|
354246
354431
|
]
|
|
354247
354432
|
);
|
|
354248
|
-
(0,
|
|
354433
|
+
(0, import_react111.useEffect)(() => {
|
|
354249
354434
|
if (!config) {
|
|
354250
354435
|
return;
|
|
354251
354436
|
}
|
|
@@ -354263,7 +354448,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
354263
354448
|
})();
|
|
354264
354449
|
};
|
|
354265
354450
|
}, [config, reloadCommands]);
|
|
354266
|
-
(0,
|
|
354451
|
+
(0, import_react111.useEffect)(() => {
|
|
354267
354452
|
const controller = new AbortController();
|
|
354268
354453
|
const load = /* @__PURE__ */ __name(async () => {
|
|
354269
354454
|
const loaders = [
|
|
@@ -354282,7 +354467,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
354282
354467
|
controller.abort();
|
|
354283
354468
|
};
|
|
354284
354469
|
}, [config, reloadTrigger, isConfigInitialized]);
|
|
354285
|
-
const handleSlashCommand2 = (0,
|
|
354470
|
+
const handleSlashCommand2 = (0, import_react111.useCallback)(
|
|
354286
354471
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed) => {
|
|
354287
354472
|
if (typeof rawQuery !== "string") {
|
|
354288
354473
|
return false;
|
|
@@ -354591,7 +354776,7 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
354591
354776
|
|
|
354592
354777
|
// packages/cli/src/ui/hooks/useConsoleMessages.ts
|
|
354593
354778
|
init_esbuild_shims();
|
|
354594
|
-
var
|
|
354779
|
+
var import_react112 = __toESM(require_react(), 1);
|
|
354595
354780
|
function consoleMessagesReducer(state, action) {
|
|
354596
354781
|
switch (action.type) {
|
|
354597
354782
|
case "ADD_MESSAGES": {
|
|
@@ -354617,11 +354802,11 @@ function consoleMessagesReducer(state, action) {
|
|
|
354617
354802
|
}
|
|
354618
354803
|
__name(consoleMessagesReducer, "consoleMessagesReducer");
|
|
354619
354804
|
function useConsoleMessages() {
|
|
354620
|
-
const [consoleMessages, dispatch] = (0,
|
|
354621
|
-
const messageQueueRef = (0,
|
|
354622
|
-
const timeoutRef = (0,
|
|
354623
|
-
const [, startTransition] = (0,
|
|
354624
|
-
const processQueue = (0,
|
|
354805
|
+
const [consoleMessages, dispatch] = (0, import_react112.useReducer)(consoleMessagesReducer, []);
|
|
354806
|
+
const messageQueueRef = (0, import_react112.useRef)([]);
|
|
354807
|
+
const timeoutRef = (0, import_react112.useRef)(null);
|
|
354808
|
+
const [, startTransition] = (0, import_react112.useTransition)();
|
|
354809
|
+
const processQueue = (0, import_react112.useCallback)(() => {
|
|
354625
354810
|
if (messageQueueRef.current.length > 0) {
|
|
354626
354811
|
const messagesToProcess = messageQueueRef.current;
|
|
354627
354812
|
messageQueueRef.current = [];
|
|
@@ -354631,7 +354816,7 @@ function useConsoleMessages() {
|
|
|
354631
354816
|
}
|
|
354632
354817
|
timeoutRef.current = null;
|
|
354633
354818
|
}, []);
|
|
354634
|
-
const handleNewMessage = (0,
|
|
354819
|
+
const handleNewMessage = (0, import_react112.useCallback)(
|
|
354635
354820
|
(message2) => {
|
|
354636
354821
|
messageQueueRef.current.push(message2);
|
|
354637
354822
|
if (!timeoutRef.current) {
|
|
@@ -354640,7 +354825,7 @@ function useConsoleMessages() {
|
|
|
354640
354825
|
},
|
|
354641
354826
|
[processQueue]
|
|
354642
354827
|
);
|
|
354643
|
-
const clearConsoleMessages = (0,
|
|
354828
|
+
const clearConsoleMessages = (0, import_react112.useCallback)(() => {
|
|
354644
354829
|
if (timeoutRef.current) {
|
|
354645
354830
|
clearTimeout(timeoutRef.current);
|
|
354646
354831
|
timeoutRef.current = null;
|
|
@@ -354650,7 +354835,7 @@ function useConsoleMessages() {
|
|
|
354650
354835
|
dispatch({ type: "CLEAR" });
|
|
354651
354836
|
});
|
|
354652
354837
|
}, []);
|
|
354653
|
-
(0,
|
|
354838
|
+
(0, import_react112.useEffect)(
|
|
354654
354839
|
() => () => {
|
|
354655
354840
|
if (timeoutRef.current) {
|
|
354656
354841
|
clearTimeout(timeoutRef.current);
|
|
@@ -354680,10 +354865,10 @@ __name(computeWindowTitle, "computeWindowTitle");
|
|
|
354680
354865
|
|
|
354681
354866
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
354682
354867
|
init_esbuild_shims();
|
|
354683
|
-
var
|
|
354868
|
+
var import_react113 = __toESM(require_react(), 1);
|
|
354684
354869
|
var useLogger = /* @__PURE__ */ __name((storage) => {
|
|
354685
|
-
const [logger6, setLogger] = (0,
|
|
354686
|
-
(0,
|
|
354870
|
+
const [logger6, setLogger] = (0, import_react113.useState)(null);
|
|
354871
|
+
(0, import_react113.useEffect)(() => {
|
|
354687
354872
|
const newLogger = new Logger(sessionId, storage);
|
|
354688
354873
|
newLogger.initialize().then(() => {
|
|
354689
354874
|
setLogger(newLogger);
|
|
@@ -354695,12 +354880,12 @@ var useLogger = /* @__PURE__ */ __name((storage) => {
|
|
|
354695
354880
|
|
|
354696
354881
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
354697
354882
|
init_esbuild_shims();
|
|
354698
|
-
var
|
|
354883
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
354699
354884
|
init_node();
|
|
354700
354885
|
|
|
354701
354886
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
354702
354887
|
init_esbuild_shims();
|
|
354703
|
-
var
|
|
354888
|
+
var import_react114 = __toESM(require_react(), 1);
|
|
354704
354889
|
init_node();
|
|
354705
354890
|
import crypto17 from "node:crypto";
|
|
354706
354891
|
import path98 from "node:path";
|
|
@@ -354729,8 +354914,8 @@ ${modelContent}
|
|
|
354729
354914
|
}
|
|
354730
354915
|
__name(addShellCommandToOSAHistory, "addShellCommandToOSAHistory");
|
|
354731
354916
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, OSAClient2, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
354732
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
354733
|
-
const handleShellCommand = (0,
|
|
354917
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react114.useState)(null);
|
|
354918
|
+
const handleShellCommand = (0, import_react114.useCallback)(
|
|
354734
354919
|
(rawQuery, abortSignal) => {
|
|
354735
354920
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
354736
354921
|
return false;
|
|
@@ -354979,7 +355164,7 @@ ${finalOutput}`;
|
|
|
354979
355164
|
// packages/cli/src/ui/hooks/useVisionAutoSwitch.ts
|
|
354980
355165
|
init_esbuild_shims();
|
|
354981
355166
|
init_node();
|
|
354982
|
-
var
|
|
355167
|
+
var import_react115 = __toESM(require_react(), 1);
|
|
354983
355168
|
function hasImageParts(parts) {
|
|
354984
355169
|
if (typeof parts === "string") {
|
|
354985
355170
|
return false;
|
|
@@ -355068,8 +355253,8 @@ function processVisionSwitchOutcome(outcome) {
|
|
|
355068
355253
|
}
|
|
355069
355254
|
__name(processVisionSwitchOutcome, "processVisionSwitchOutcome");
|
|
355070
355255
|
function useVisionAutoSwitch(config, addItem, visionModelPreviewEnabled = true, onVisionSwitchRequired) {
|
|
355071
|
-
const originalModelRef = (0,
|
|
355072
|
-
const handleVisionSwitch = (0,
|
|
355256
|
+
const originalModelRef = (0, import_react115.useRef)(null);
|
|
355257
|
+
const handleVisionSwitch = (0, import_react115.useCallback)(
|
|
355073
355258
|
async (query, userMessageTimestamp, isContinuation) => {
|
|
355074
355259
|
if (isContinuation || !onVisionSwitchRequired) {
|
|
355075
355260
|
return { shouldProceed: true };
|
|
@@ -355170,7 +355355,7 @@ function useVisionAutoSwitch(config, addItem, visionModelPreviewEnabled = true,
|
|
|
355170
355355
|
},
|
|
355171
355356
|
[config, addItem, visionModelPreviewEnabled, onVisionSwitchRequired]
|
|
355172
355357
|
);
|
|
355173
|
-
const restoreOriginalModel = (0,
|
|
355358
|
+
const restoreOriginalModel = (0, import_react115.useCallback)(async () => {
|
|
355174
355359
|
if (originalModelRef.current) {
|
|
355175
355360
|
await config.setModel(originalModelRef.current, {
|
|
355176
355361
|
reason: "vision_auto_switch",
|
|
@@ -355247,11 +355432,11 @@ var findLastSafeSplitPoint = /* @__PURE__ */ __name((content) => {
|
|
|
355247
355432
|
|
|
355248
355433
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
355249
355434
|
init_esbuild_shims();
|
|
355250
|
-
var
|
|
355435
|
+
var import_react116 = __toESM(require_react(), 1);
|
|
355251
355436
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
355252
|
-
const [state, setState] =
|
|
355253
|
-
const ref =
|
|
355254
|
-
const setStateInternal =
|
|
355437
|
+
const [state, setState] = import_react116.default.useState(initialValue);
|
|
355438
|
+
const ref = import_react116.default.useRef(initialValue);
|
|
355439
|
+
const setStateInternal = import_react116.default.useCallback(
|
|
355255
355440
|
(newStateOrCallback) => {
|
|
355256
355441
|
let newValue;
|
|
355257
355442
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -355269,10 +355454,10 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
355269
355454
|
|
|
355270
355455
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
355271
355456
|
init_esbuild_shims();
|
|
355272
|
-
var
|
|
355457
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
355273
355458
|
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
355274
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
355275
|
-
const outputUpdateHandler = (0,
|
|
355459
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react117.useState)([]);
|
|
355460
|
+
const outputUpdateHandler = (0, import_react117.useCallback)(
|
|
355276
355461
|
(toolCallId, outputChunk) => {
|
|
355277
355462
|
setToolCallsForDisplay(
|
|
355278
355463
|
(prevCalls) => prevCalls.map((tc) => {
|
|
@@ -355286,13 +355471,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
355286
355471
|
},
|
|
355287
355472
|
[]
|
|
355288
355473
|
);
|
|
355289
|
-
const allToolCallsCompleteHandler = (0,
|
|
355474
|
+
const allToolCallsCompleteHandler = (0, import_react117.useCallback)(
|
|
355290
355475
|
async (completedToolCalls) => {
|
|
355291
355476
|
await onComplete(completedToolCalls);
|
|
355292
355477
|
},
|
|
355293
355478
|
[onComplete]
|
|
355294
355479
|
);
|
|
355295
|
-
const toolCallsUpdateHandler = (0,
|
|
355480
|
+
const toolCallsUpdateHandler = (0, import_react117.useCallback)(
|
|
355296
355481
|
(updatedCoreToolCalls) => {
|
|
355297
355482
|
setToolCallsForDisplay(
|
|
355298
355483
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -355319,7 +355504,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
355319
355504
|
},
|
|
355320
355505
|
[setToolCallsForDisplay]
|
|
355321
355506
|
);
|
|
355322
|
-
const scheduler = (0,
|
|
355507
|
+
const scheduler = (0, import_react117.useMemo)(
|
|
355323
355508
|
() => new CoreToolScheduler({
|
|
355324
355509
|
outputUpdateHandler,
|
|
355325
355510
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
@@ -355338,13 +355523,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
355338
355523
|
onEditorClose
|
|
355339
355524
|
]
|
|
355340
355525
|
);
|
|
355341
|
-
const schedule = (0,
|
|
355526
|
+
const schedule = (0, import_react117.useCallback)(
|
|
355342
355527
|
(request4, signal) => {
|
|
355343
355528
|
void scheduler.schedule(request4, signal);
|
|
355344
355529
|
},
|
|
355345
355530
|
[scheduler]
|
|
355346
355531
|
);
|
|
355347
|
-
const markToolsAsSubmitted = (0,
|
|
355532
|
+
const markToolsAsSubmitted = (0, import_react117.useCallback)(
|
|
355348
355533
|
(callIdsToMark) => {
|
|
355349
355534
|
setToolCallsForDisplay(
|
|
355350
355535
|
(prevCalls) => prevCalls.map(
|
|
@@ -355484,18 +355669,18 @@ function showCitations(settings) {
|
|
|
355484
355669
|
}
|
|
355485
355670
|
__name(showCitations, "showCitations");
|
|
355486
355671
|
var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config, settings, onDebugMessage, handleSlashCommand2, shellModeActive, getPreferredEditor, onAuthError, performMemoryRefresh, modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError, onEditorClose, onCancelSubmit, visionModelPreviewEnabled, setShellInputFocused, terminalWidth, terminalHeight, onVisionSwitchRequired, isShellFocused) => {
|
|
355487
|
-
const [initError, setInitError] = (0,
|
|
355488
|
-
const abortControllerRef = (0,
|
|
355489
|
-
const turnCancelledRef = (0,
|
|
355490
|
-
const isSubmittingQueryRef = (0,
|
|
355491
|
-
const [isResponding, setIsResponding] = (0,
|
|
355492
|
-
const [thought, setThought] = (0,
|
|
355672
|
+
const [initError, setInitError] = (0, import_react118.useState)(null);
|
|
355673
|
+
const abortControllerRef = (0, import_react118.useRef)(null);
|
|
355674
|
+
const turnCancelledRef = (0, import_react118.useRef)(false);
|
|
355675
|
+
const isSubmittingQueryRef = (0, import_react118.useRef)(false);
|
|
355676
|
+
const [isResponding, setIsResponding] = (0, import_react118.useState)(false);
|
|
355677
|
+
const [thought, setThought] = (0, import_react118.useState)(null);
|
|
355493
355678
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
355494
|
-
const processedMemoryToolsRef = (0,
|
|
355679
|
+
const processedMemoryToolsRef = (0, import_react118.useRef)(/* @__PURE__ */ new Set());
|
|
355495
355680
|
const { startNewPrompt, getPromptCount } = useSessionStats();
|
|
355496
355681
|
const storage = config.storage;
|
|
355497
355682
|
const logger6 = useLogger(storage);
|
|
355498
|
-
const gitService = (0,
|
|
355683
|
+
const gitService = (0, import_react118.useMemo)(() => {
|
|
355499
355684
|
if (!config.getProjectRoot()) {
|
|
355500
355685
|
return;
|
|
355501
355686
|
}
|
|
@@ -355519,11 +355704,11 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355519
355704
|
getPreferredEditor,
|
|
355520
355705
|
onEditorClose
|
|
355521
355706
|
);
|
|
355522
|
-
const pendingToolCallGroupDisplay = (0,
|
|
355707
|
+
const pendingToolCallGroupDisplay = (0, import_react118.useMemo)(
|
|
355523
355708
|
() => toolCalls.length ? mapToDisplay(toolCalls) : void 0,
|
|
355524
355709
|
[toolCalls]
|
|
355525
355710
|
);
|
|
355526
|
-
const activeToolPtyId = (0,
|
|
355711
|
+
const activeToolPtyId = (0, import_react118.useMemo)(() => {
|
|
355527
355712
|
const executingShellTool = toolCalls?.find(
|
|
355528
355713
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
355529
355714
|
);
|
|
@@ -355532,12 +355717,12 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355532
355717
|
}
|
|
355533
355718
|
return void 0;
|
|
355534
355719
|
}, [toolCalls]);
|
|
355535
|
-
const loopDetectedRef = (0,
|
|
355720
|
+
const loopDetectedRef = (0, import_react118.useRef)(false);
|
|
355536
355721
|
const [
|
|
355537
355722
|
loopDetectionConfirmationRequest,
|
|
355538
355723
|
setLoopDetectionConfirmationRequest
|
|
355539
|
-
] = (0,
|
|
355540
|
-
const onExec = (0,
|
|
355724
|
+
] = (0, import_react118.useState)(null);
|
|
355725
|
+
const onExec = (0, import_react118.useCallback)(async (done) => {
|
|
355541
355726
|
setIsResponding(true);
|
|
355542
355727
|
await done;
|
|
355543
355728
|
setIsResponding(false);
|
|
@@ -355560,12 +355745,12 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355560
355745
|
onVisionSwitchRequired
|
|
355561
355746
|
);
|
|
355562
355747
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
355563
|
-
(0,
|
|
355748
|
+
(0, import_react118.useEffect)(() => {
|
|
355564
355749
|
if (!activePtyId) {
|
|
355565
355750
|
setShellInputFocused(false);
|
|
355566
355751
|
}
|
|
355567
355752
|
}, [activePtyId, setShellInputFocused]);
|
|
355568
|
-
const streamingState = (0,
|
|
355753
|
+
const streamingState = (0, import_react118.useMemo)(() => {
|
|
355569
355754
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
355570
355755
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
355571
355756
|
}
|
|
@@ -355576,7 +355761,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355576
355761
|
}
|
|
355577
355762
|
return "idle" /* Idle */;
|
|
355578
355763
|
}, [isResponding, toolCalls]);
|
|
355579
|
-
(0,
|
|
355764
|
+
(0, import_react118.useEffect)(() => {
|
|
355580
355765
|
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
355581
355766
|
const lastUserMessageIndex = history.findLastIndex(
|
|
355582
355767
|
(item) => item.type === "user" /* USER */
|
|
@@ -355590,7 +355775,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355590
355775
|
}
|
|
355591
355776
|
}
|
|
355592
355777
|
}, [streamingState, config, history]);
|
|
355593
|
-
const cancelOngoingRequest = (0,
|
|
355778
|
+
const cancelOngoingRequest = (0, import_react118.useCallback)(() => {
|
|
355594
355779
|
if (streamingState !== "responding" /* Responding */) {
|
|
355595
355780
|
return;
|
|
355596
355781
|
}
|
|
@@ -355639,7 +355824,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355639
355824
|
},
|
|
355640
355825
|
{ isActive: streamingState === "responding" /* Responding */ }
|
|
355641
355826
|
);
|
|
355642
|
-
const prepareQueryForOSA = (0,
|
|
355827
|
+
const prepareQueryForOSA = (0, import_react118.useCallback)(
|
|
355643
355828
|
async (query, userMessageTimestamp, abortSignal, prompt_id) => {
|
|
355644
355829
|
if (turnCancelledRef.current) {
|
|
355645
355830
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -355734,7 +355919,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355734
355919
|
scheduleToolCalls
|
|
355735
355920
|
]
|
|
355736
355921
|
);
|
|
355737
|
-
const handleContentEvent = (0,
|
|
355922
|
+
const handleContentEvent = (0, import_react118.useCallback)(
|
|
355738
355923
|
(eventValue, currentOSAMessageBuffer, userMessageTimestamp) => {
|
|
355739
355924
|
if (turnCancelledRef.current) {
|
|
355740
355925
|
return "";
|
|
@@ -355770,7 +355955,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355770
355955
|
},
|
|
355771
355956
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
355772
355957
|
);
|
|
355773
|
-
const handleUserCancelledEvent = (0,
|
|
355958
|
+
const handleUserCancelledEvent = (0, import_react118.useCallback)(
|
|
355774
355959
|
(userMessageTimestamp) => {
|
|
355775
355960
|
if (turnCancelledRef.current) {
|
|
355776
355961
|
return;
|
|
@@ -355799,7 +355984,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355799
355984
|
},
|
|
355800
355985
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, setThought]
|
|
355801
355986
|
);
|
|
355802
|
-
const handleErrorEvent = (0,
|
|
355987
|
+
const handleErrorEvent = (0, import_react118.useCallback)(
|
|
355803
355988
|
(eventValue, userMessageTimestamp) => {
|
|
355804
355989
|
if (pendingHistoryItemRef.current) {
|
|
355805
355990
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -355822,7 +356007,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355822
356007
|
},
|
|
355823
356008
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, config, setThought]
|
|
355824
356009
|
);
|
|
355825
|
-
const handleCitationEvent = (0,
|
|
356010
|
+
const handleCitationEvent = (0, import_react118.useCallback)(
|
|
355826
356011
|
(text, userMessageTimestamp) => {
|
|
355827
356012
|
if (!showCitations(settings)) {
|
|
355828
356013
|
return;
|
|
@@ -355835,7 +356020,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355835
356020
|
},
|
|
355836
356021
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, settings]
|
|
355837
356022
|
);
|
|
355838
|
-
const handleFinishedEvent = (0,
|
|
356023
|
+
const handleFinishedEvent = (0, import_react118.useCallback)(
|
|
355839
356024
|
(event, userMessageTimestamp) => {
|
|
355840
356025
|
const finishReason = event.value.reason;
|
|
355841
356026
|
if (!finishReason) {
|
|
@@ -355869,7 +356054,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355869
356054
|
},
|
|
355870
356055
|
[addItem]
|
|
355871
356056
|
);
|
|
355872
|
-
const handleChatCompressionEvent = (0,
|
|
356057
|
+
const handleChatCompressionEvent = (0, import_react118.useCallback)(
|
|
355873
356058
|
(eventValue, userMessageTimestamp) => {
|
|
355874
356059
|
if (pendingHistoryItemRef.current) {
|
|
355875
356060
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -355885,7 +356070,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355885
356070
|
},
|
|
355886
356071
|
[addItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
355887
356072
|
);
|
|
355888
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
356073
|
+
const handleMaxSessionTurnsEvent = (0, import_react118.useCallback)(
|
|
355889
356074
|
() => addItem(
|
|
355890
356075
|
{
|
|
355891
356076
|
type: "info",
|
|
@@ -355895,7 +356080,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355895
356080
|
),
|
|
355896
356081
|
[addItem, config]
|
|
355897
356082
|
);
|
|
355898
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
356083
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react118.useCallback)(
|
|
355899
356084
|
(value) => addItem(
|
|
355900
356085
|
{
|
|
355901
356086
|
type: "error",
|
|
@@ -355910,7 +356095,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355910
356095
|
),
|
|
355911
356096
|
[addItem]
|
|
355912
356097
|
);
|
|
355913
|
-
const handleLoopDetectionConfirmation = (0,
|
|
356098
|
+
const handleLoopDetectionConfirmation = (0, import_react118.useCallback)(
|
|
355914
356099
|
(result) => {
|
|
355915
356100
|
setLoopDetectionConfirmationRequest(null);
|
|
355916
356101
|
if (result.userSelection === "disable") {
|
|
@@ -355934,12 +356119,12 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355934
356119
|
},
|
|
355935
356120
|
[config, addItem]
|
|
355936
356121
|
);
|
|
355937
|
-
const handleLoopDetectedEvent = (0,
|
|
356122
|
+
const handleLoopDetectedEvent = (0, import_react118.useCallback)(() => {
|
|
355938
356123
|
setLoopDetectionConfirmationRequest({
|
|
355939
356124
|
onComplete: handleLoopDetectionConfirmation
|
|
355940
356125
|
});
|
|
355941
356126
|
}, [handleLoopDetectionConfirmation]);
|
|
355942
|
-
const processOSAStreamEvents = (0,
|
|
356127
|
+
const processOSAStreamEvents = (0, import_react118.useCallback)(
|
|
355943
356128
|
async (stream2, userMessageTimestamp, signal) => {
|
|
355944
356129
|
let OSAMessageBuffer = "";
|
|
355945
356130
|
const toolCallRequests = [];
|
|
@@ -356013,7 +356198,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356013
356198
|
handleCitationEvent
|
|
356014
356199
|
]
|
|
356015
356200
|
);
|
|
356016
|
-
const submitQuery = (0,
|
|
356201
|
+
const submitQuery = (0, import_react118.useCallback)(
|
|
356017
356202
|
async (query, options2, prompt_id) => {
|
|
356018
356203
|
if (isSubmittingQueryRef.current && !options2?.isContinuation) {
|
|
356019
356204
|
return;
|
|
@@ -356146,7 +356331,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356146
356331
|
restoreOriginalModel
|
|
356147
356332
|
]
|
|
356148
356333
|
);
|
|
356149
|
-
const handleApprovalModeChange = (0,
|
|
356334
|
+
const handleApprovalModeChange = (0, import_react118.useCallback)(
|
|
356150
356335
|
async (newApprovalMode) => {
|
|
356151
356336
|
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
356152
356337
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -356175,7 +356360,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356175
356360
|
},
|
|
356176
356361
|
[toolCalls]
|
|
356177
356362
|
);
|
|
356178
|
-
const handleCompletedTools = (0,
|
|
356363
|
+
const handleCompletedTools = (0, import_react118.useCallback)(
|
|
356179
356364
|
async (completedToolCallsFromScheduler) => {
|
|
356180
356365
|
if (isResponding) {
|
|
356181
356366
|
return;
|
|
@@ -356260,13 +356445,13 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356260
356445
|
modelSwitchedFromQuotaError
|
|
356261
356446
|
]
|
|
356262
356447
|
);
|
|
356263
|
-
const pendingHistoryItems = (0,
|
|
356448
|
+
const pendingHistoryItems = (0, import_react118.useMemo)(
|
|
356264
356449
|
() => [pendingHistoryItem, pendingToolCallGroupDisplay].filter(
|
|
356265
356450
|
(i) => i !== void 0 && i !== null
|
|
356266
356451
|
),
|
|
356267
356452
|
[pendingHistoryItem, pendingToolCallGroupDisplay]
|
|
356268
356453
|
);
|
|
356269
|
-
(0,
|
|
356454
|
+
(0, import_react118.useEffect)(() => {
|
|
356270
356455
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
356271
356456
|
if (!config.getCheckpointingEnabled()) {
|
|
356272
356457
|
return;
|
|
@@ -356385,7 +356570,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356385
356570
|
|
|
356386
356571
|
// packages/cli/src/ui/hooks/vim.ts
|
|
356387
356572
|
init_esbuild_shims();
|
|
356388
|
-
var
|
|
356573
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
356389
356574
|
var DIGIT_MULTIPLIER = 10;
|
|
356390
356575
|
var DEFAULT_COUNT = 1;
|
|
356391
356576
|
var DIGIT_1_TO_9 = /^[1-9]$/;
|
|
@@ -356448,22 +356633,22 @@ var vimReducer = /* @__PURE__ */ __name((state, action) => {
|
|
|
356448
356633
|
}, "vimReducer");
|
|
356449
356634
|
function useVim(buffer, onSubmit) {
|
|
356450
356635
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
356451
|
-
const [state, dispatch] = (0,
|
|
356452
|
-
(0,
|
|
356636
|
+
const [state, dispatch] = (0, import_react119.useReducer)(vimReducer, initialVimState);
|
|
356637
|
+
(0, import_react119.useEffect)(() => {
|
|
356453
356638
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
356454
356639
|
}, [vimMode]);
|
|
356455
|
-
const updateMode = (0,
|
|
356640
|
+
const updateMode = (0, import_react119.useCallback)(
|
|
356456
356641
|
(mode) => {
|
|
356457
356642
|
setVimMode(mode);
|
|
356458
356643
|
dispatch({ type: "SET_MODE", mode });
|
|
356459
356644
|
},
|
|
356460
356645
|
[setVimMode]
|
|
356461
356646
|
);
|
|
356462
|
-
const getCurrentCount = (0,
|
|
356647
|
+
const getCurrentCount = (0, import_react119.useCallback)(
|
|
356463
356648
|
() => state.count || DEFAULT_COUNT,
|
|
356464
356649
|
[state.count]
|
|
356465
356650
|
);
|
|
356466
|
-
const executeCommand = (0,
|
|
356651
|
+
const executeCommand = (0, import_react119.useCallback)(
|
|
356467
356652
|
(cmdType, count) => {
|
|
356468
356653
|
switch (cmdType) {
|
|
356469
356654
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -356539,7 +356724,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356539
356724
|
},
|
|
356540
356725
|
[buffer, updateMode]
|
|
356541
356726
|
);
|
|
356542
|
-
const handleInsertModeInput = (0,
|
|
356727
|
+
const handleInsertModeInput = (0, import_react119.useCallback)(
|
|
356543
356728
|
(normalizedKey) => {
|
|
356544
356729
|
if (normalizedKey.name === "escape") {
|
|
356545
356730
|
buffer.vimEscapeInsertMode();
|
|
@@ -356570,7 +356755,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356570
356755
|
},
|
|
356571
356756
|
[buffer, dispatch, updateMode, onSubmit]
|
|
356572
356757
|
);
|
|
356573
|
-
const normalizeKey = (0,
|
|
356758
|
+
const normalizeKey = (0, import_react119.useCallback)(
|
|
356574
356759
|
(key) => ({
|
|
356575
356760
|
name: key.name || "",
|
|
356576
356761
|
sequence: key.sequence || "",
|
|
@@ -356581,7 +356766,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356581
356766
|
}),
|
|
356582
356767
|
[]
|
|
356583
356768
|
);
|
|
356584
|
-
const handleChangeMovement = (0,
|
|
356769
|
+
const handleChangeMovement = (0, import_react119.useCallback)(
|
|
356585
356770
|
(movement) => {
|
|
356586
356771
|
const count = getCurrentCount();
|
|
356587
356772
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -356602,7 +356787,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356602
356787
|
},
|
|
356603
356788
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
356604
356789
|
);
|
|
356605
|
-
const handleOperatorMotion = (0,
|
|
356790
|
+
const handleOperatorMotion = (0, import_react119.useCallback)(
|
|
356606
356791
|
(operator2, motion) => {
|
|
356607
356792
|
const count = getCurrentCount();
|
|
356608
356793
|
const commandMap = {
|
|
@@ -356629,7 +356814,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356629
356814
|
},
|
|
356630
356815
|
[getCurrentCount, executeCommand, dispatch]
|
|
356631
356816
|
);
|
|
356632
|
-
const handleInput = (0,
|
|
356817
|
+
const handleInput = (0, import_react119.useCallback)(
|
|
356633
356818
|
(key) => {
|
|
356634
356819
|
if (!vimEnabled) {
|
|
356635
356820
|
return false;
|
|
@@ -356929,14 +357114,14 @@ __name(useVim, "useVim");
|
|
|
356929
357114
|
|
|
356930
357115
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
356931
357116
|
init_esbuild_shims();
|
|
356932
|
-
var
|
|
357117
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
356933
357118
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
356934
357119
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
356935
357120
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
356936
357121
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
356937
357122
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
356938
357123
|
}, "cleanup");
|
|
356939
|
-
(0,
|
|
357124
|
+
(0, import_react120.useEffect)(() => {
|
|
356940
357125
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
356941
357126
|
process.on("exit", cleanup);
|
|
356942
357127
|
process.on("SIGINT", cleanup);
|
|
@@ -356955,13 +357140,13 @@ init_esbuild_shims();
|
|
|
356955
357140
|
|
|
356956
357141
|
// packages/cli/src/ui/hooks/useTimer.ts
|
|
356957
357142
|
init_esbuild_shims();
|
|
356958
|
-
var
|
|
357143
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
356959
357144
|
var useTimer = /* @__PURE__ */ __name((isActive, resetKey) => {
|
|
356960
|
-
const [elapsedTime, setElapsedTime] = (0,
|
|
356961
|
-
const timerRef = (0,
|
|
356962
|
-
const prevResetKeyRef = (0,
|
|
356963
|
-
const prevIsActiveRef = (0,
|
|
356964
|
-
(0,
|
|
357145
|
+
const [elapsedTime, setElapsedTime] = (0, import_react121.useState)(0);
|
|
357146
|
+
const timerRef = (0, import_react121.useRef)(null);
|
|
357147
|
+
const prevResetKeyRef = (0, import_react121.useRef)(resetKey);
|
|
357148
|
+
const prevIsActiveRef = (0, import_react121.useRef)(isActive);
|
|
357149
|
+
(0, import_react121.useEffect)(() => {
|
|
356965
357150
|
let shouldResetTime = false;
|
|
356966
357151
|
if (prevResetKeyRef.current !== resetKey) {
|
|
356967
357152
|
shouldResetTime = true;
|
|
@@ -356999,7 +357184,7 @@ var useTimer = /* @__PURE__ */ __name((isActive, resetKey) => {
|
|
|
356999
357184
|
|
|
357000
357185
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
357001
357186
|
init_esbuild_shims();
|
|
357002
|
-
var
|
|
357187
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
357003
357188
|
var WITTY_LOADING_PHRASES = [
|
|
357004
357189
|
"I'm Feeling Lucky",
|
|
357005
357190
|
"Shipping awesomeness... ",
|
|
@@ -357133,15 +357318,15 @@ var WITTY_LOADING_PHRASES = [
|
|
|
357133
357318
|
];
|
|
357134
357319
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
357135
357320
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
357136
|
-
const loadingPhrases = (0,
|
|
357321
|
+
const loadingPhrases = (0, import_react122.useMemo)(
|
|
357137
357322
|
() => customPhrases && customPhrases.length > 0 ? customPhrases : WITTY_LOADING_PHRASES.map((phrase) => t2(phrase)),
|
|
357138
357323
|
[customPhrases]
|
|
357139
357324
|
);
|
|
357140
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
357325
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react122.useState)(
|
|
357141
357326
|
loadingPhrases[0]
|
|
357142
357327
|
);
|
|
357143
|
-
const phraseIntervalRef = (0,
|
|
357144
|
-
(0,
|
|
357328
|
+
const phraseIntervalRef = (0, import_react122.useRef)(null);
|
|
357329
|
+
(0, import_react122.useEffect)(() => {
|
|
357145
357330
|
if (isWaiting) {
|
|
357146
357331
|
setCurrentLoadingPhrase(t2("Waiting for user confirmation..."));
|
|
357147
357332
|
if (phraseIntervalRef.current) {
|
|
@@ -357178,9 +357363,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
357178
357363
|
}, "usePhraseCycler");
|
|
357179
357364
|
|
|
357180
357365
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
357181
|
-
var
|
|
357366
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
357182
357367
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases) => {
|
|
357183
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
357368
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react123.useState)(0);
|
|
357184
357369
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
357185
357370
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
357186
357371
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */;
|
|
@@ -357190,9 +357375,9 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
357190
357375
|
isWaiting,
|
|
357191
357376
|
customWittyPhrases
|
|
357192
357377
|
);
|
|
357193
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
357194
|
-
const prevStreamingStateRef = (0,
|
|
357195
|
-
(0,
|
|
357378
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react123.useState)(0);
|
|
357379
|
+
const prevStreamingStateRef = (0, import_react123.useRef)(null);
|
|
357380
|
+
(0, import_react123.useEffect)(() => {
|
|
357196
357381
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
357197
357382
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
357198
357383
|
setRetainedElapsedTime(0);
|
|
@@ -357212,20 +357397,20 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
357212
357397
|
|
|
357213
357398
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
357214
357399
|
init_esbuild_shims();
|
|
357215
|
-
var
|
|
357400
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
357216
357401
|
import * as process40 from "node:process";
|
|
357217
357402
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
357218
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
357219
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
357220
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
357403
|
+
const [isTrusted, setIsTrusted] = (0, import_react124.useState)(void 0);
|
|
357404
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react124.useState)(false);
|
|
357405
|
+
const [isRestarting, setIsRestarting] = (0, import_react124.useState)(false);
|
|
357221
357406
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
357222
|
-
(0,
|
|
357407
|
+
(0, import_react124.useEffect)(() => {
|
|
357223
357408
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
357224
357409
|
setIsTrusted(trusted);
|
|
357225
357410
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
357226
357411
|
onTrustChange(trusted);
|
|
357227
357412
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
357228
|
-
const handleFolderTrustSelect = (0,
|
|
357413
|
+
const handleFolderTrustSelect = (0, import_react124.useCallback)(
|
|
357229
357414
|
(choice2) => {
|
|
357230
357415
|
const trustedFolders = loadTrustedFolders();
|
|
357231
357416
|
const cwd7 = process40.cwd();
|
|
@@ -360358,27 +360543,27 @@ __name(setUpdateHandler, "setUpdateHandler");
|
|
|
360358
360543
|
|
|
360359
360544
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
360360
360545
|
init_esbuild_shims();
|
|
360361
|
-
var
|
|
360546
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
360362
360547
|
function useMessageQueue({
|
|
360363
360548
|
isConfigInitialized,
|
|
360364
360549
|
streamingState,
|
|
360365
360550
|
submitQuery
|
|
360366
360551
|
}) {
|
|
360367
|
-
const [messageQueue, setMessageQueue] = (0,
|
|
360368
|
-
const addMessage = (0,
|
|
360552
|
+
const [messageQueue, setMessageQueue] = (0, import_react125.useState)([]);
|
|
360553
|
+
const addMessage = (0, import_react125.useCallback)((message2) => {
|
|
360369
360554
|
const trimmedMessage = message2.trim();
|
|
360370
360555
|
if (trimmedMessage.length > 0) {
|
|
360371
360556
|
setMessageQueue((prev) => [...prev, trimmedMessage]);
|
|
360372
360557
|
}
|
|
360373
360558
|
}, []);
|
|
360374
|
-
const clearQueue = (0,
|
|
360559
|
+
const clearQueue = (0, import_react125.useCallback)(() => {
|
|
360375
360560
|
setMessageQueue([]);
|
|
360376
360561
|
}, []);
|
|
360377
|
-
const getQueuedMessagesText = (0,
|
|
360562
|
+
const getQueuedMessagesText = (0, import_react125.useCallback)(() => {
|
|
360378
360563
|
if (messageQueue.length === 0) return "";
|
|
360379
360564
|
return messageQueue.join("\n\n");
|
|
360380
360565
|
}, [messageQueue]);
|
|
360381
|
-
(0,
|
|
360566
|
+
(0, import_react125.useEffect)(() => {
|
|
360382
360567
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && messageQueue.length > 0) {
|
|
360383
360568
|
const combinedMessage = messageQueue.join("\n\n");
|
|
360384
360569
|
setMessageQueue([]);
|
|
@@ -360396,15 +360581,15 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
360396
360581
|
|
|
360397
360582
|
// packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
|
|
360398
360583
|
init_esbuild_shims();
|
|
360399
|
-
var
|
|
360584
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
360400
360585
|
function useAutoAcceptIndicator({
|
|
360401
360586
|
config,
|
|
360402
360587
|
addItem,
|
|
360403
360588
|
onApprovalModeChange
|
|
360404
360589
|
}) {
|
|
360405
360590
|
const currentConfigValue = config.getApprovalMode();
|
|
360406
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
360407
|
-
(0,
|
|
360591
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react126.useState)(currentConfigValue);
|
|
360592
|
+
(0, import_react126.useEffect)(() => {
|
|
360408
360593
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
360409
360594
|
}, [currentConfigValue]);
|
|
360410
360595
|
useKeypress(
|
|
@@ -360437,14 +360622,14 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
360437
360622
|
|
|
360438
360623
|
// packages/cli/src/ui/hooks/useWorkspaceMigration.ts
|
|
360439
360624
|
init_esbuild_shims();
|
|
360440
|
-
var
|
|
360625
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
360441
360626
|
import process50 from "node:process";
|
|
360442
360627
|
function useWorkspaceMigration(settings) {
|
|
360443
|
-
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0,
|
|
360444
|
-
const [workspaceExtensions, setWorkspaceExtensions] = (0,
|
|
360628
|
+
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0, import_react127.useState)(false);
|
|
360629
|
+
const [workspaceExtensions, setWorkspaceExtensions] = (0, import_react127.useState)(
|
|
360445
360630
|
[]
|
|
360446
360631
|
);
|
|
360447
|
-
(0,
|
|
360632
|
+
(0, import_react127.useEffect)(() => {
|
|
360448
360633
|
if (!(settings.merged.experimental?.extensionManagement ?? true)) {
|
|
360449
360634
|
return;
|
|
360450
360635
|
}
|
|
@@ -360486,13 +360671,13 @@ __name(useWorkspaceMigration, "useWorkspaceMigration");
|
|
|
360486
360671
|
|
|
360487
360672
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
360488
360673
|
init_esbuild_shims();
|
|
360489
|
-
var
|
|
360674
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
360490
360675
|
import fs94 from "node:fs";
|
|
360491
360676
|
import fsPromises7 from "node:fs/promises";
|
|
360492
360677
|
import path109 from "node:path";
|
|
360493
360678
|
function useGitBranchName(cwd7) {
|
|
360494
|
-
const [branchName, setBranchName] = (0,
|
|
360495
|
-
const fetchBranchName = (0,
|
|
360679
|
+
const [branchName, setBranchName] = (0, import_react128.useState)(void 0);
|
|
360680
|
+
const fetchBranchName = (0, import_react128.useCallback)(async () => {
|
|
360496
360681
|
try {
|
|
360497
360682
|
if (!isCommandAvailable("git").available) {
|
|
360498
360683
|
return;
|
|
@@ -360517,7 +360702,7 @@ function useGitBranchName(cwd7) {
|
|
|
360517
360702
|
setBranchName(void 0);
|
|
360518
360703
|
}
|
|
360519
360704
|
}, [cwd7, setBranchName]);
|
|
360520
|
-
(0,
|
|
360705
|
+
(0, import_react128.useEffect)(() => {
|
|
360521
360706
|
fetchBranchName();
|
|
360522
360707
|
const gitLogsHeadPath = path109.join(cwd7, ".git", "logs", "HEAD");
|
|
360523
360708
|
let watcher;
|
|
@@ -360543,7 +360728,7 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
360543
360728
|
|
|
360544
360729
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
360545
360730
|
init_esbuild_shims();
|
|
360546
|
-
var
|
|
360731
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
360547
360732
|
function confirmationRequestsReducer(state, action) {
|
|
360548
360733
|
switch (action.type) {
|
|
360549
360734
|
case "add":
|
|
@@ -360557,15 +360742,15 @@ function confirmationRequestsReducer(state, action) {
|
|
|
360557
360742
|
}
|
|
360558
360743
|
__name(confirmationRequestsReducer, "confirmationRequestsReducer");
|
|
360559
360744
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) => {
|
|
360560
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
360745
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react129.useReducer)(
|
|
360561
360746
|
extensionUpdatesReducer,
|
|
360562
360747
|
initialExtensionUpdatesState
|
|
360563
360748
|
);
|
|
360564
360749
|
const [
|
|
360565
360750
|
confirmUpdateExtensionRequests,
|
|
360566
360751
|
dispatchConfirmUpdateExtensionRequests
|
|
360567
|
-
] = (0,
|
|
360568
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
360752
|
+
] = (0, import_react129.useReducer)(confirmationRequestsReducer, []);
|
|
360753
|
+
const addConfirmUpdateExtensionRequest = (0, import_react129.useCallback)(
|
|
360569
360754
|
(original) => {
|
|
360570
360755
|
const wrappedRequest = {
|
|
360571
360756
|
prompt: original.prompt,
|
|
@@ -360584,7 +360769,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
360584
360769
|
},
|
|
360585
360770
|
[dispatchConfirmUpdateExtensionRequests]
|
|
360586
360771
|
);
|
|
360587
|
-
(0,
|
|
360772
|
+
(0, import_react129.useEffect)(() => {
|
|
360588
360773
|
(async () => {
|
|
360589
360774
|
await checkForAllExtensionUpdates(
|
|
360590
360775
|
extensions,
|
|
@@ -360592,7 +360777,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
360592
360777
|
);
|
|
360593
360778
|
})();
|
|
360594
360779
|
}, [extensions, extensions.length, dispatchExtensionStateUpdate]);
|
|
360595
|
-
(0,
|
|
360780
|
+
(0, import_react129.useEffect)(() => {
|
|
360596
360781
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
360597
360782
|
return;
|
|
360598
360783
|
}
|
|
@@ -360657,7 +360842,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
360657
360842
|
addItem,
|
|
360658
360843
|
cwd7
|
|
360659
360844
|
]);
|
|
360660
|
-
const extensionsUpdateStateComputed = (0,
|
|
360845
|
+
const extensionsUpdateStateComputed = (0, import_react129.useMemo)(() => {
|
|
360661
360846
|
const result = /* @__PURE__ */ new Map();
|
|
360662
360847
|
for (const [
|
|
360663
360848
|
key,
|
|
@@ -360678,13 +360863,13 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
360678
360863
|
|
|
360679
360864
|
// packages/cli/src/ui/hooks/useQuitConfirmation.ts
|
|
360680
360865
|
init_esbuild_shims();
|
|
360681
|
-
var
|
|
360866
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
360682
360867
|
var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
360683
|
-
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0,
|
|
360684
|
-
const showQuitConfirmation = (0,
|
|
360868
|
+
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0, import_react130.useState)(false);
|
|
360869
|
+
const showQuitConfirmation = (0, import_react130.useCallback)(() => {
|
|
360685
360870
|
setIsQuitConfirmationOpen(true);
|
|
360686
360871
|
}, []);
|
|
360687
|
-
const handleQuitConfirmationSelect = (0,
|
|
360872
|
+
const handleQuitConfirmationSelect = (0, import_react130.useCallback)((choice2) => {
|
|
360688
360873
|
setIsQuitConfirmationOpen(false);
|
|
360689
360874
|
if (choice2 === "cancel" /* CANCEL */) {
|
|
360690
360875
|
return { shouldQuit: false, action: "cancel" };
|
|
@@ -360706,14 +360891,14 @@ var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
|
360706
360891
|
|
|
360707
360892
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
360708
360893
|
init_esbuild_shims();
|
|
360709
|
-
var
|
|
360894
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
360710
360895
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
360711
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
360712
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
360713
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
360714
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
360715
|
-
const [inputFillText, setInputFillText] = (0,
|
|
360716
|
-
const checkWelcomeBack = (0,
|
|
360896
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react131.useState)(null);
|
|
360897
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react131.useState)(false);
|
|
360898
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react131.useState)(null);
|
|
360899
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react131.useState)(false);
|
|
360900
|
+
const [inputFillText, setInputFillText] = (0, import_react131.useState)(null);
|
|
360901
|
+
const checkWelcomeBack = (0, import_react131.useCallback)(async () => {
|
|
360717
360902
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
360718
360903
|
return;
|
|
360719
360904
|
}
|
|
@@ -360727,7 +360912,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
360727
360912
|
console.debug("Welcome back check failed:", error);
|
|
360728
360913
|
}
|
|
360729
360914
|
}, [settings.ui?.enableWelcomeBack]);
|
|
360730
|
-
const handleWelcomeBackSelection = (0,
|
|
360915
|
+
const handleWelcomeBackSelection = (0, import_react131.useCallback)(
|
|
360731
360916
|
(choice2) => {
|
|
360732
360917
|
setWelcomeBackChoice(choice2);
|
|
360733
360918
|
setShowWelcomeBackDialog(false);
|
|
@@ -360739,21 +360924,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
360739
360924
|
},
|
|
360740
360925
|
[welcomeBackInfo]
|
|
360741
360926
|
);
|
|
360742
|
-
const handleWelcomeBackClose = (0,
|
|
360927
|
+
const handleWelcomeBackClose = (0, import_react131.useCallback)(() => {
|
|
360743
360928
|
setWelcomeBackChoice("restart");
|
|
360744
360929
|
setShowWelcomeBackDialog(false);
|
|
360745
360930
|
}, []);
|
|
360746
|
-
const clearInputFill = (0,
|
|
360931
|
+
const clearInputFill = (0, import_react131.useCallback)(() => {
|
|
360747
360932
|
setShouldFillInput(false);
|
|
360748
360933
|
setInputFillText(null);
|
|
360749
360934
|
}, []);
|
|
360750
|
-
(0,
|
|
360935
|
+
(0, import_react131.useEffect)(() => {
|
|
360751
360936
|
if (shouldFillInput && inputFillText) {
|
|
360752
360937
|
buffer.setText(inputFillText);
|
|
360753
360938
|
clearInputFill();
|
|
360754
360939
|
}
|
|
360755
360940
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
360756
|
-
(0,
|
|
360941
|
+
(0, import_react131.useEffect)(() => {
|
|
360757
360942
|
checkWelcomeBack();
|
|
360758
360943
|
}, [checkWelcomeBack]);
|
|
360759
360944
|
return {
|
|
@@ -360774,9 +360959,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
360774
360959
|
|
|
360775
360960
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
360776
360961
|
init_esbuild_shims();
|
|
360777
|
-
var
|
|
360962
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
360778
360963
|
function useDialogClose(options2) {
|
|
360779
|
-
const closeAnyOpenDialog = (0,
|
|
360964
|
+
const closeAnyOpenDialog = (0, import_react132.useCallback)(() => {
|
|
360780
360965
|
if (options2.isThemeDialogOpen) {
|
|
360781
360966
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
360782
360967
|
return true;
|
|
@@ -360808,14 +360993,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
360808
360993
|
|
|
360809
360994
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
360810
360995
|
init_esbuild_shims();
|
|
360811
|
-
var
|
|
360996
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
360812
360997
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
360813
|
-
const hasHandled = (0,
|
|
360814
|
-
const authErrorRef = (0,
|
|
360815
|
-
const onAuthErrorRef = (0,
|
|
360998
|
+
const hasHandled = (0, import_react133.useRef)(false);
|
|
360999
|
+
const authErrorRef = (0, import_react133.useRef)(authError);
|
|
361000
|
+
const onAuthErrorRef = (0, import_react133.useRef)(onAuthError);
|
|
360816
361001
|
authErrorRef.current = authError;
|
|
360817
361002
|
onAuthErrorRef.current = onAuthError;
|
|
360818
|
-
(0,
|
|
361003
|
+
(0, import_react133.useEffect)(() => {
|
|
360819
361004
|
if (hasHandled.current) {
|
|
360820
361005
|
return;
|
|
360821
361006
|
}
|
|
@@ -360828,13 +361013,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
360828
361013
|
|
|
360829
361014
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
360830
361015
|
init_esbuild_shims();
|
|
360831
|
-
var
|
|
361016
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
360832
361017
|
function useSubagentCreateDialog() {
|
|
360833
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
360834
|
-
const openSubagentCreateDialog = (0,
|
|
361018
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react134.useState)(false);
|
|
361019
|
+
const openSubagentCreateDialog = (0, import_react134.useCallback)(() => {
|
|
360835
361020
|
setIsSubagentCreateDialogOpen(true);
|
|
360836
361021
|
}, []);
|
|
360837
|
-
const closeSubagentCreateDialog = (0,
|
|
361022
|
+
const closeSubagentCreateDialog = (0, import_react134.useCallback)(() => {
|
|
360838
361023
|
setIsSubagentCreateDialogOpen(false);
|
|
360839
361024
|
}, []);
|
|
360840
361025
|
return {
|
|
@@ -360847,13 +361032,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
360847
361032
|
|
|
360848
361033
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
360849
361034
|
init_esbuild_shims();
|
|
360850
|
-
var
|
|
361035
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
360851
361036
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
360852
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
360853
|
-
const openAgentsManagerDialog = (0,
|
|
361037
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react135.useState)(false);
|
|
361038
|
+
const openAgentsManagerDialog = (0, import_react135.useCallback)(() => {
|
|
360854
361039
|
setIsAgentsManagerDialogOpen(true);
|
|
360855
361040
|
}, []);
|
|
360856
|
-
const closeAgentsManagerDialog = (0,
|
|
361041
|
+
const closeAgentsManagerDialog = (0, import_react135.useCallback)(() => {
|
|
360857
361042
|
setIsAgentsManagerDialogOpen(false);
|
|
360858
361043
|
}, []);
|
|
360859
361044
|
return {
|
|
@@ -360865,7 +361050,7 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
360865
361050
|
|
|
360866
361051
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
360867
361052
|
init_esbuild_shims();
|
|
360868
|
-
var
|
|
361053
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
360869
361054
|
|
|
360870
361055
|
// packages/cli/src/utils/attentionNotification.ts
|
|
360871
361056
|
init_esbuild_shims();
|
|
@@ -360893,9 +361078,9 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
360893
361078
|
streamingState,
|
|
360894
361079
|
elapsedTime
|
|
360895
361080
|
}) => {
|
|
360896
|
-
const awaitingNotificationSentRef = (0,
|
|
360897
|
-
const respondingElapsedRef = (0,
|
|
360898
|
-
(0,
|
|
361081
|
+
const awaitingNotificationSentRef = (0, import_react136.useRef)(false);
|
|
361082
|
+
const respondingElapsedRef = (0, import_react136.useRef)(0);
|
|
361083
|
+
(0, import_react136.useEffect)(() => {
|
|
360899
361084
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
360900
361085
|
notifyTerminalAttention("tool_approval" /* ToolApproval */);
|
|
360901
361086
|
awaitingNotificationSentRef.current = true;
|
|
@@ -360904,7 +361089,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
360904
361089
|
awaitingNotificationSentRef.current = false;
|
|
360905
361090
|
}
|
|
360906
361091
|
}, [isFocused, streamingState]);
|
|
360907
|
-
(0,
|
|
361092
|
+
(0, import_react136.useEffect)(() => {
|
|
360908
361093
|
if (streamingState === "responding" /* Responding */) {
|
|
360909
361094
|
respondingElapsedRef.current = elapsedTime;
|
|
360910
361095
|
return;
|
|
@@ -360921,7 +361106,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
360921
361106
|
}, "useAttentionNotifications");
|
|
360922
361107
|
|
|
360923
361108
|
// packages/cli/src/ui/AppContainer.tsx
|
|
360924
|
-
var
|
|
361109
|
+
var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1);
|
|
360925
361110
|
var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
|
|
360926
361111
|
function isToolExecuting(pendingHistoryItems) {
|
|
360927
361112
|
return pendingHistoryItems.some((item) => {
|
|
@@ -360940,25 +361125,25 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
360940
361125
|
const { settings, config, initializationResult } = props;
|
|
360941
361126
|
const historyManager = useHistory();
|
|
360942
361127
|
useMemoryMonitor(historyManager);
|
|
360943
|
-
const [corgiMode, setCorgiMode] = (0,
|
|
360944
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
360945
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
360946
|
-
const [themeError, setThemeError] = (0,
|
|
361128
|
+
const [corgiMode, setCorgiMode] = (0, import_react137.useState)(false);
|
|
361129
|
+
const [debugMessage, setDebugMessage] = (0, import_react137.useState)("");
|
|
361130
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react137.useState)(null);
|
|
361131
|
+
const [themeError, setThemeError] = (0, import_react137.useState)(
|
|
360947
361132
|
initializationResult.themeError
|
|
360948
361133
|
);
|
|
360949
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
360950
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
360951
|
-
const [OSAMdFileCount, setOSAMdFileCount] = (0,
|
|
361134
|
+
const [isProcessing, setIsProcessing] = (0, import_react137.useState)(false);
|
|
361135
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react137.useState)(false);
|
|
361136
|
+
const [OSAMdFileCount, setOSAMdFileCount] = (0, import_react137.useState)(
|
|
360952
361137
|
initializationResult.OSAMdFileCount
|
|
360953
361138
|
);
|
|
360954
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
360955
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
360956
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
360957
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
360958
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
361139
|
+
const [shellModeActive, setShellModeActive] = (0, import_react137.useState)(false);
|
|
361140
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react137.useState)(false);
|
|
361141
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react137.useState)(0);
|
|
361142
|
+
const [updateInfo, setUpdateInfo] = (0, import_react137.useState)(null);
|
|
361143
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react137.useState)(
|
|
360959
361144
|
config.isTrustedFolder()
|
|
360960
361145
|
);
|
|
360961
|
-
const [systemPromptPreset, setSystemPromptPreset] = (0,
|
|
361146
|
+
const [systemPromptPreset, setSystemPromptPreset] = (0, import_react137.useState)(
|
|
360962
361147
|
null
|
|
360963
361148
|
);
|
|
360964
361149
|
const extensions = config.getExtensions();
|
|
@@ -360973,38 +361158,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
360973
361158
|
historyManager.addItem,
|
|
360974
361159
|
config.getWorkingDir()
|
|
360975
361160
|
);
|
|
360976
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
360977
|
-
const openPermissionsDialog = (0,
|
|
361161
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react137.useState)(false);
|
|
361162
|
+
const openPermissionsDialog = (0, import_react137.useCallback)(
|
|
360978
361163
|
() => setPermissionsDialogOpen(true),
|
|
360979
361164
|
[]
|
|
360980
361165
|
);
|
|
360981
|
-
const closePermissionsDialog = (0,
|
|
361166
|
+
const closePermissionsDialog = (0, import_react137.useCallback)(
|
|
360982
361167
|
() => setPermissionsDialogOpen(false),
|
|
360983
361168
|
[]
|
|
360984
361169
|
);
|
|
360985
|
-
const getEffectiveModel2 = (0,
|
|
361170
|
+
const getEffectiveModel2 = (0, import_react137.useCallback)(() => {
|
|
360986
361171
|
if (config.isInFallbackMode()) {
|
|
360987
361172
|
return DEFAULT_OSA_FLASH_MODEL;
|
|
360988
361173
|
}
|
|
360989
361174
|
return config.getModel();
|
|
360990
361175
|
}, [config]);
|
|
360991
|
-
const [currentModel, setCurrentModel] = (0,
|
|
360992
|
-
const [userTier] = (0,
|
|
360993
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
361176
|
+
const [currentModel, setCurrentModel] = (0, import_react137.useState)(getEffectiveModel2());
|
|
361177
|
+
const [userTier] = (0, import_react137.useState)(void 0);
|
|
361178
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react137.useState)(false);
|
|
360994
361179
|
const logger6 = useLogger(config.storage);
|
|
360995
|
-
const [userMessages, setUserMessages] = (0,
|
|
361180
|
+
const [userMessages, setUserMessages] = (0, import_react137.useState)([]);
|
|
360996
361181
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
360997
361182
|
const { stdin, setRawMode } = use_stdin_default();
|
|
360998
361183
|
const { stdout } = use_stdout_default();
|
|
360999
361184
|
const { stats: sessionStats } = useSessionStats();
|
|
361000
361185
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
361001
|
-
const mainControlsRef = (0,
|
|
361002
|
-
const originalTitleRef = (0,
|
|
361186
|
+
const mainControlsRef = (0, import_react137.useRef)(null);
|
|
361187
|
+
const originalTitleRef = (0, import_react137.useRef)(
|
|
361003
361188
|
computeWindowTitle(basename14(config.getTargetDir()))
|
|
361004
361189
|
);
|
|
361005
|
-
const lastTitleRef = (0,
|
|
361190
|
+
const lastTitleRef = (0, import_react137.useRef)(null);
|
|
361006
361191
|
const staticExtraHeight = 3;
|
|
361007
|
-
(0,
|
|
361192
|
+
(0, import_react137.useEffect)(() => {
|
|
361008
361193
|
(async () => {
|
|
361009
361194
|
await config.initialize();
|
|
361010
361195
|
setConfigInitialized(true);
|
|
@@ -361014,11 +361199,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361014
361199
|
await ideClient.disconnect();
|
|
361015
361200
|
});
|
|
361016
361201
|
}, [config]);
|
|
361017
|
-
(0,
|
|
361202
|
+
(0, import_react137.useEffect)(
|
|
361018
361203
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
361019
361204
|
[historyManager.addItem]
|
|
361020
361205
|
);
|
|
361021
|
-
(0,
|
|
361206
|
+
(0, import_react137.useEffect)(() => {
|
|
361022
361207
|
const checkModelChange = /* @__PURE__ */ __name(() => {
|
|
361023
361208
|
const effectiveModel = getEffectiveModel2();
|
|
361024
361209
|
if (effectiveModel !== currentModel) {
|
|
@@ -361034,7 +361219,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361034
361219
|
handleNewMessage,
|
|
361035
361220
|
clearConsoleMessages: clearConsoleMessagesState
|
|
361036
361221
|
} = useConsoleMessages();
|
|
361037
|
-
(0,
|
|
361222
|
+
(0, import_react137.useEffect)(() => {
|
|
361038
361223
|
const consolePatcher = new ConsolePatcher({
|
|
361039
361224
|
onNewMessage: handleNewMessage,
|
|
361040
361225
|
debugMode: config.getDebugMode()
|
|
@@ -361042,13 +361227,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361042
361227
|
consolePatcher.patch();
|
|
361043
361228
|
registerCleanup(consolePatcher.cleanup);
|
|
361044
361229
|
}, [handleNewMessage, config]);
|
|
361045
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
361230
|
+
const { inputWidth, suggestionsWidth } = (0, import_react137.useMemo)(() => {
|
|
361046
361231
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
361047
361232
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
361048
361233
|
}, [terminalWidth]);
|
|
361049
361234
|
const mainAreaWidth = Math.floor(terminalWidth * 0.9);
|
|
361050
361235
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
361051
|
-
const isValidPath = (0,
|
|
361236
|
+
const isValidPath = (0, import_react137.useCallback)((filePath) => {
|
|
361052
361237
|
try {
|
|
361053
361238
|
return fs95.existsSync(filePath) && fs95.statSync(filePath).isFile();
|
|
361054
361239
|
} catch (_e) {
|
|
@@ -361063,7 +361248,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361063
361248
|
isValidPath,
|
|
361064
361249
|
shellModeActive
|
|
361065
361250
|
});
|
|
361066
|
-
(0,
|
|
361251
|
+
(0, import_react137.useEffect)(() => {
|
|
361067
361252
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
361068
361253
|
const pastMessagesRaw = await logger6?.getPreviousUserMessages() || [];
|
|
361069
361254
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -361086,7 +361271,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361086
361271
|
}, "fetchUserMessages");
|
|
361087
361272
|
fetchUserMessages();
|
|
361088
361273
|
}, [historyManager.history, logger6]);
|
|
361089
|
-
const refreshStatic = (0,
|
|
361274
|
+
const refreshStatic = (0, import_react137.useCallback)(() => {
|
|
361090
361275
|
stdout.write(base_exports.clearTerminal);
|
|
361091
361276
|
setHistoryRemountKey((prev) => prev + 1);
|
|
361092
361277
|
}, [setHistoryRemountKey, stdout]);
|
|
@@ -361126,7 +361311,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361126
361311
|
setModelSwitchedFromQuotaError
|
|
361127
361312
|
});
|
|
361128
361313
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
361129
|
-
(0,
|
|
361314
|
+
(0, import_react137.useEffect)(() => {
|
|
361130
361315
|
if (settings.merged.security?.auth?.enforcedType && settings.merged.security?.auth.selectedType && settings.merged.security?.auth.enforcedType !== settings.merged.security?.auth.selectedType) {
|
|
361131
361316
|
onAuthError(
|
|
361132
361317
|
t2(
|
|
@@ -361151,7 +361336,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361151
361336
|
settings.merged.security?.auth?.useExternal,
|
|
361152
361337
|
onAuthError
|
|
361153
361338
|
]);
|
|
361154
|
-
const [editorError, setEditorError] = (0,
|
|
361339
|
+
const [editorError, setEditorError] = (0, import_react137.useState)(null);
|
|
361155
361340
|
const {
|
|
361156
361341
|
isEditorDialogOpen,
|
|
361157
361342
|
openEditorDialog,
|
|
@@ -361178,9 +361363,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361178
361363
|
openAgentsManagerDialog,
|
|
361179
361364
|
closeAgentsManagerDialog
|
|
361180
361365
|
} = useAgentsManagerDialog();
|
|
361181
|
-
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0,
|
|
361182
|
-
const [visionSwitchResolver, setVisionSwitchResolver] = (0,
|
|
361183
|
-
const slashCommandActions = (0,
|
|
361366
|
+
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0, import_react137.useState)(false);
|
|
361367
|
+
const [visionSwitchResolver, setVisionSwitchResolver] = (0, import_react137.useState)(null);
|
|
361368
|
+
const slashCommandActions = (0, import_react137.useMemo)(
|
|
361184
361369
|
() => ({
|
|
361185
361370
|
openAuthDialog,
|
|
361186
361371
|
openThemeDialog,
|
|
@@ -361245,14 +361430,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361245
361430
|
extensionsUpdateStateInternal,
|
|
361246
361431
|
isConfigInitialized
|
|
361247
361432
|
);
|
|
361248
|
-
const handleVisionSwitchRequired = (0,
|
|
361433
|
+
const handleVisionSwitchRequired = (0, import_react137.useCallback)(
|
|
361249
361434
|
async (_query) => new Promise((resolve25, reject) => {
|
|
361250
361435
|
setVisionSwitchResolver({ resolve: resolve25, reject });
|
|
361251
361436
|
setIsVisionSwitchDialogOpen(true);
|
|
361252
361437
|
}),
|
|
361253
361438
|
[]
|
|
361254
361439
|
);
|
|
361255
|
-
const handleVisionSwitchSelect = (0,
|
|
361440
|
+
const handleVisionSwitchSelect = (0, import_react137.useCallback)(
|
|
361256
361441
|
(outcome) => {
|
|
361257
361442
|
setIsVisionSwitchDialogOpen(false);
|
|
361258
361443
|
if (visionSwitchResolver) {
|
|
@@ -361263,10 +361448,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361263
361448
|
},
|
|
361264
361449
|
[visionSwitchResolver]
|
|
361265
361450
|
);
|
|
361266
|
-
const onDebugMessage = (0,
|
|
361451
|
+
const onDebugMessage = (0, import_react137.useCallback)((message2) => {
|
|
361267
361452
|
console.debug(message2);
|
|
361268
361453
|
}, []);
|
|
361269
|
-
const performMemoryRefresh = (0,
|
|
361454
|
+
const performMemoryRefresh = (0, import_react137.useCallback)(async () => {
|
|
361270
361455
|
historyManager.addItem(
|
|
361271
361456
|
{
|
|
361272
361457
|
type: "info" /* INFO */,
|
|
@@ -361317,7 +361502,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361317
361502
|
console.error("Error refreshing memory:", error);
|
|
361318
361503
|
}
|
|
361319
361504
|
}, [config, historyManager, settings.merged]);
|
|
361320
|
-
const cancelHandlerRef = (0,
|
|
361505
|
+
const cancelHandlerRef = (0, import_react137.useRef)(() => {
|
|
361321
361506
|
});
|
|
361322
361507
|
const {
|
|
361323
361508
|
streamingState,
|
|
@@ -361364,7 +361549,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361364
361549
|
streamingState,
|
|
361365
361550
|
submitQuery
|
|
361366
361551
|
});
|
|
361367
|
-
const handleFinalSubmit = (0,
|
|
361552
|
+
const handleFinalSubmit = (0, import_react137.useCallback)(
|
|
361368
361553
|
(submittedValue) => {
|
|
361369
361554
|
addMessage(submittedValue);
|
|
361370
361555
|
},
|
|
@@ -361377,7 +361562,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361377
361562
|
handleWelcomeBackSelection,
|
|
361378
361563
|
handleWelcomeBackClose
|
|
361379
361564
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
361380
|
-
cancelHandlerRef.current = (0,
|
|
361565
|
+
cancelHandlerRef.current = (0, import_react137.useCallback)(() => {
|
|
361381
361566
|
const pendingHistoryItems2 = [
|
|
361382
361567
|
...pendingSlashCommandHistoryItems,
|
|
361383
361568
|
...pendingOSAHistoryItems
|
|
@@ -361406,7 +361591,7 @@ ${queuedText}` : queuedText;
|
|
|
361406
361591
|
pendingSlashCommandHistoryItems,
|
|
361407
361592
|
pendingOSAHistoryItems
|
|
361408
361593
|
]);
|
|
361409
|
-
const handleClearScreen = (0,
|
|
361594
|
+
const handleClearScreen = (0, import_react137.useCallback)(() => {
|
|
361410
361595
|
historyManager.clearItems();
|
|
361411
361596
|
clearConsoleMessagesState();
|
|
361412
361597
|
console.clear();
|
|
@@ -361414,8 +361599,8 @@ ${queuedText}` : queuedText;
|
|
|
361414
361599
|
}, [historyManager, clearConsoleMessagesState, refreshStatic]);
|
|
361415
361600
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
361416
361601
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */) && !proQuotaRequest;
|
|
361417
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
361418
|
-
(0,
|
|
361602
|
+
const [controlsHeight, setControlsHeight] = (0, import_react137.useState)(0);
|
|
361603
|
+
(0, import_react137.useLayoutEffect)(() => {
|
|
361419
361604
|
if (mainControlsRef.current) {
|
|
361420
361605
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
361421
361606
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -361438,14 +361623,14 @@ ${queuedText}` : queuedText;
|
|
|
361438
361623
|
});
|
|
361439
361624
|
const isFocused = useFocus();
|
|
361440
361625
|
useBracketedPaste();
|
|
361441
|
-
const contextFileNames = (0,
|
|
361626
|
+
const contextFileNames = (0, import_react137.useMemo)(() => {
|
|
361442
361627
|
const fromSettings = settings.merged.context?.fileName;
|
|
361443
361628
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllOSAMdFilenames();
|
|
361444
361629
|
}, [settings.merged.context?.fileName]);
|
|
361445
|
-
const initialPrompt = (0,
|
|
361446
|
-
const initialPromptSubmitted = (0,
|
|
361630
|
+
const initialPrompt = (0, import_react137.useMemo)(() => config.getQuestion(), [config]);
|
|
361631
|
+
const initialPromptSubmitted = (0, import_react137.useRef)(false);
|
|
361447
361632
|
const OSAClient2 = config.getOSAClient();
|
|
361448
|
-
(0,
|
|
361633
|
+
(0, import_react137.useEffect)(() => {
|
|
361449
361634
|
if (activePtyId) {
|
|
361450
361635
|
ShellExecutionService.resizePty(
|
|
361451
361636
|
activePtyId,
|
|
@@ -361454,7 +361639,7 @@ ${queuedText}` : queuedText;
|
|
|
361454
361639
|
);
|
|
361455
361640
|
}
|
|
361456
361641
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
361457
|
-
(0,
|
|
361642
|
+
(0, import_react137.useEffect)(() => {
|
|
361458
361643
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && !isVisionSwitchDialogOpen && welcomeBackChoice !== "restart" && OSAClient2?.isInitialized?.()) {
|
|
361459
361644
|
handleFinalSubmit(initialPrompt);
|
|
361460
361645
|
initialPromptSubmitted.current = true;
|
|
@@ -361472,9 +361657,9 @@ ${queuedText}` : queuedText;
|
|
|
361472
361657
|
welcomeBackChoice,
|
|
361473
361658
|
OSAClient2
|
|
361474
361659
|
]);
|
|
361475
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
361476
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
361477
|
-
(0,
|
|
361660
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react137.useState)(false);
|
|
361661
|
+
const [currentIDE, setCurrentIDE] = (0, import_react137.useState)(null);
|
|
361662
|
+
(0, import_react137.useEffect)(() => {
|
|
361478
361663
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
361479
361664
|
const ideClient = await IdeClient.getInstance();
|
|
361480
361665
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -361485,28 +361670,28 @@ ${queuedText}` : queuedText;
|
|
|
361485
361670
|
const shouldShowIdePrompt = Boolean(
|
|
361486
361671
|
currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
|
|
361487
361672
|
);
|
|
361488
|
-
const [showErrorDetails, setShowErrorDetails] = (0,
|
|
361489
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
361490
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
361491
|
-
const ctrlCTimerRef = (0,
|
|
361492
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
361493
|
-
const ctrlDTimerRef = (0,
|
|
361494
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
361495
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
361496
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
361497
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
361673
|
+
const [showErrorDetails, setShowErrorDetails] = (0, import_react137.useState)(false);
|
|
361674
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react137.useState)(false);
|
|
361675
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react137.useState)(false);
|
|
361676
|
+
const ctrlCTimerRef = (0, import_react137.useRef)(null);
|
|
361677
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react137.useState)(false);
|
|
361678
|
+
const ctrlDTimerRef = (0, import_react137.useRef)(null);
|
|
361679
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react137.useState)(true);
|
|
361680
|
+
const [ideContextState, setIdeContextState] = (0, import_react137.useState)();
|
|
361681
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react137.useState)(false);
|
|
361682
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react137.useState)(false);
|
|
361498
361683
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
361499
361684
|
const {
|
|
361500
361685
|
needsRestart: ideNeedsRestart,
|
|
361501
361686
|
restartReason: ideTrustRestartReason
|
|
361502
361687
|
} = useIdeTrustListener();
|
|
361503
|
-
const isInitialMount = (0,
|
|
361504
|
-
(0,
|
|
361688
|
+
const isInitialMount = (0, import_react137.useRef)(true);
|
|
361689
|
+
(0, import_react137.useEffect)(() => {
|
|
361505
361690
|
if (ideNeedsRestart) {
|
|
361506
361691
|
setShowIdeRestartPrompt(true);
|
|
361507
361692
|
}
|
|
361508
361693
|
}, [ideNeedsRestart]);
|
|
361509
|
-
(0,
|
|
361694
|
+
(0, import_react137.useEffect)(() => {
|
|
361510
361695
|
if (isInitialMount.current) {
|
|
361511
361696
|
isInitialMount.current = false;
|
|
361512
361697
|
return;
|
|
@@ -361518,12 +361703,12 @@ ${queuedText}` : queuedText;
|
|
|
361518
361703
|
clearTimeout(handler);
|
|
361519
361704
|
};
|
|
361520
361705
|
}, [terminalWidth, refreshStatic]);
|
|
361521
|
-
(0,
|
|
361706
|
+
(0, import_react137.useEffect)(() => {
|
|
361522
361707
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
361523
361708
|
setIdeContextState(ideContextStore.get());
|
|
361524
361709
|
return unsubscribe;
|
|
361525
361710
|
}, []);
|
|
361526
|
-
(0,
|
|
361711
|
+
(0, import_react137.useEffect)(() => {
|
|
361527
361712
|
const openDebugConsole = /* @__PURE__ */ __name(() => {
|
|
361528
361713
|
setShowErrorDetails(true);
|
|
361529
361714
|
setConstrainHeight(false);
|
|
@@ -361542,10 +361727,10 @@ ${queuedText}` : queuedText;
|
|
|
361542
361727
|
appEvents.off("log-error" /* LogError */, logErrorHandler);
|
|
361543
361728
|
};
|
|
361544
361729
|
}, [handleNewMessage]);
|
|
361545
|
-
const handleEscapePromptChange = (0,
|
|
361730
|
+
const handleEscapePromptChange = (0, import_react137.useCallback)((showPrompt) => {
|
|
361546
361731
|
setShowEscapePrompt(showPrompt);
|
|
361547
361732
|
}, []);
|
|
361548
|
-
const handleIdePromptComplete = (0,
|
|
361733
|
+
const handleIdePromptComplete = (0, import_react137.useCallback)(
|
|
361549
361734
|
(result) => {
|
|
361550
361735
|
if (result.userSelection === "yes") {
|
|
361551
361736
|
handleSlashCommand2("/ide install");
|
|
@@ -361583,7 +361768,7 @@ ${queuedText}` : queuedText;
|
|
|
361583
361768
|
handleWelcomeBackClose,
|
|
361584
361769
|
quitConfirmationRequest
|
|
361585
361770
|
});
|
|
361586
|
-
const handleExit = (0,
|
|
361771
|
+
const handleExit = (0, import_react137.useCallback)(
|
|
361587
361772
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
361588
361773
|
if (pressedOnce) {
|
|
361589
361774
|
if (timerRef.current) {
|
|
@@ -361626,7 +361811,7 @@ ${queuedText}` : queuedText;
|
|
|
361626
361811
|
buffer
|
|
361627
361812
|
]
|
|
361628
361813
|
);
|
|
361629
|
-
const handleGlobalKeypress = (0,
|
|
361814
|
+
const handleGlobalKeypress = (0, import_react137.useCallback)(
|
|
361630
361815
|
(key) => {
|
|
361631
361816
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
361632
361817
|
console.log("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -361699,7 +361884,7 @@ ${queuedText}` : queuedText;
|
|
|
361699
361884
|
]
|
|
361700
361885
|
);
|
|
361701
361886
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
361702
|
-
(0,
|
|
361887
|
+
(0, import_react137.useEffect)(() => {
|
|
361703
361888
|
if (!settings.merged.ui?.showStatusInTitle || settings.merged.ui?.hideWindowTitle)
|
|
361704
361889
|
return;
|
|
361705
361890
|
let title;
|
|
@@ -361721,23 +361906,23 @@ ${queuedText}` : queuedText;
|
|
|
361721
361906
|
settings.merged.ui?.hideWindowTitle,
|
|
361722
361907
|
stdout
|
|
361723
361908
|
]);
|
|
361724
|
-
const filteredConsoleMessages = (0,
|
|
361909
|
+
const filteredConsoleMessages = (0, import_react137.useMemo)(() => {
|
|
361725
361910
|
if (config.getDebugMode()) {
|
|
361726
361911
|
return consoleMessages;
|
|
361727
361912
|
}
|
|
361728
361913
|
return consoleMessages.filter((msg) => msg.type !== "debug");
|
|
361729
361914
|
}, [consoleMessages, config]);
|
|
361730
|
-
const errorCount = (0,
|
|
361915
|
+
const errorCount = (0, import_react137.useMemo)(
|
|
361731
361916
|
() => filteredConsoleMessages.filter((msg) => msg.type === "error").reduce((total, msg) => total + msg.count, 0),
|
|
361732
361917
|
[filteredConsoleMessages]
|
|
361733
361918
|
);
|
|
361734
361919
|
const nightly = props.version.includes("nightly");
|
|
361735
361920
|
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;
|
|
361736
|
-
const pendingHistoryItems = (0,
|
|
361921
|
+
const pendingHistoryItems = (0, import_react137.useMemo)(
|
|
361737
361922
|
() => [...pendingSlashCommandHistoryItems, ...pendingOSAHistoryItems],
|
|
361738
361923
|
[pendingSlashCommandHistoryItems, pendingOSAHistoryItems]
|
|
361739
361924
|
);
|
|
361740
|
-
const uiState = (0,
|
|
361925
|
+
const uiState = (0, import_react137.useMemo)(
|
|
361741
361926
|
() => ({
|
|
361742
361927
|
history: historyManager.history,
|
|
361743
361928
|
historyManager,
|
|
@@ -361928,7 +362113,7 @@ ${queuedText}` : queuedText;
|
|
|
361928
362113
|
isAgentsManagerDialogOpen
|
|
361929
362114
|
]
|
|
361930
362115
|
);
|
|
361931
|
-
const uiActions = (0,
|
|
362116
|
+
const uiActions = (0, import_react137.useMemo)(
|
|
361932
362117
|
() => ({
|
|
361933
362118
|
handleThemeSelect,
|
|
361934
362119
|
handleThemeHighlight,
|
|
@@ -361996,23 +362181,23 @@ ${queuedText}` : queuedText;
|
|
|
361996
362181
|
closeAgentsManagerDialog
|
|
361997
362182
|
]
|
|
361998
362183
|
);
|
|
361999
|
-
return /* @__PURE__ */ (0,
|
|
362184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
362000
362185
|
AppContext2.Provider,
|
|
362001
362186
|
{
|
|
362002
362187
|
value: {
|
|
362003
362188
|
version: props.version,
|
|
362004
362189
|
startupWarnings: props.startupWarnings || []
|
|
362005
362190
|
},
|
|
362006
|
-
children: /* @__PURE__ */ (0,
|
|
362191
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ShellFocusContext.Provider, { value: isFocused, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(App2, {}) })
|
|
362007
362192
|
}
|
|
362008
362193
|
) }) }) });
|
|
362009
362194
|
}, "AppContainer");
|
|
362010
362195
|
|
|
362011
362196
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
362012
362197
|
init_esbuild_shims();
|
|
362013
|
-
var
|
|
362198
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
362014
362199
|
function useKittyKeyboardProtocol() {
|
|
362015
|
-
const [status] = (0,
|
|
362200
|
+
const [status] = (0, import_react138.useState)({
|
|
362016
362201
|
supported: isKittyProtocolSupported(),
|
|
362017
362202
|
enabled: isKittyProtocolEnabled(),
|
|
362018
362203
|
checking: false
|
|
@@ -364668,7 +364853,7 @@ function toPermissionOptions(confirmation) {
|
|
|
364668
364853
|
__name(toPermissionOptions, "toPermissionOptions");
|
|
364669
364854
|
|
|
364670
364855
|
// packages/cli/src/gemini.tsx
|
|
364671
|
-
var
|
|
364856
|
+
var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1);
|
|
364672
364857
|
function validateDnsResolutionOrder(order) {
|
|
364673
364858
|
const defaultValue = "ipv4first";
|
|
364674
364859
|
if (order === void 0) {
|
|
@@ -364733,14 +364918,14 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
364733
364918
|
const AppWrapper = /* @__PURE__ */ __name(() => {
|
|
364734
364919
|
const kittyProtocolStatus = useKittyKeyboardProtocol();
|
|
364735
364920
|
const nodeMajorVersion = parseInt(process.versions.node.split(".")[0], 10);
|
|
364736
|
-
return /* @__PURE__ */ (0,
|
|
364921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(SettingsContext.Provider, { value: settings, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
364737
364922
|
KeypressProvider,
|
|
364738
364923
|
{
|
|
364739
364924
|
kittyProtocolEnabled: kittyProtocolStatus.enabled,
|
|
364740
364925
|
config,
|
|
364741
364926
|
debugKeystrokeLogging: settings.merged.general?.debugKeystrokeLogging,
|
|
364742
364927
|
pasteWorkaround: process.platform === "win32" || nodeMajorVersion < 20,
|
|
364743
|
-
children: /* @__PURE__ */ (0,
|
|
364928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(SessionStatsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(TodoProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(VimModeProvider, { settings, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
364744
364929
|
AppContainer,
|
|
364745
364930
|
{
|
|
364746
364931
|
config,
|
|
@@ -364754,7 +364939,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
364754
364939
|
) });
|
|
364755
364940
|
}, "AppWrapper");
|
|
364756
364941
|
const instance = render_default(
|
|
364757
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0,
|
|
364942
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_react139.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(AppWrapper, {}),
|
|
364758
364943
|
{
|
|
364759
364944
|
exitOnCtrlC: false,
|
|
364760
364945
|
isScreenReaderEnabled: config.getScreenReader()
|