osagent 0.1.15 → 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 +847 -609
- 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";
|
|
@@ -294327,15 +294327,15 @@ var darkTheme = {
|
|
|
294327
294327
|
Foreground: "#ffffff",
|
|
294328
294328
|
LightBlue: "#00cc66",
|
|
294329
294329
|
AccentBlue: "#00cc66",
|
|
294330
|
-
AccentPurple: "#
|
|
294330
|
+
AccentPurple: "#aaaaaa",
|
|
294331
294331
|
AccentCyan: "#00cc66",
|
|
294332
294332
|
AccentGreen: "#00cc66",
|
|
294333
|
-
AccentYellow: "#
|
|
294333
|
+
AccentYellow: "#ffcc00",
|
|
294334
294334
|
AccentRed: "#ff4444",
|
|
294335
294335
|
DiffAdded: "#00cc66",
|
|
294336
294336
|
DiffRemoved: "#ff4444",
|
|
294337
|
-
Comment: "#
|
|
294338
|
-
Gray: "#
|
|
294337
|
+
Comment: "#888888",
|
|
294338
|
+
Gray: "#999999",
|
|
294339
294339
|
GradientColors: ["#00cc66", "#00aa55", "#008844"]
|
|
294340
294340
|
};
|
|
294341
294341
|
var ansiTheme = {
|
|
@@ -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";
|
|
@@ -317113,6 +317225,56 @@ var AVAILABLE_MODELS_OSA = [
|
|
|
317113
317225
|
isVision: true
|
|
317114
317226
|
}
|
|
317115
317227
|
];
|
|
317228
|
+
var AVAILABLE_MODELS_OLLAMA_LOCAL = [
|
|
317229
|
+
{
|
|
317230
|
+
id: "qwen2.5-coder:32b",
|
|
317231
|
+
label: "qwen2.5-coder:32b",
|
|
317232
|
+
get description() {
|
|
317233
|
+
return t2("Qwen2.5-Coder 32B - Best local coding model (requires ~20GB VRAM)");
|
|
317234
|
+
},
|
|
317235
|
+
isLocal: true
|
|
317236
|
+
},
|
|
317237
|
+
{
|
|
317238
|
+
id: "qwen2.5-coder:14b",
|
|
317239
|
+
label: "qwen2.5-coder:14b",
|
|
317240
|
+
get description() {
|
|
317241
|
+
return t2("Qwen2.5-Coder 14B - Great local coding model (requires ~10GB VRAM)");
|
|
317242
|
+
},
|
|
317243
|
+
isLocal: true
|
|
317244
|
+
},
|
|
317245
|
+
{
|
|
317246
|
+
id: "qwen2.5-coder:7b",
|
|
317247
|
+
label: "qwen2.5-coder:7b",
|
|
317248
|
+
get description() {
|
|
317249
|
+
return t2("Qwen2.5-Coder 7B - Good local coding model (requires ~5GB VRAM)");
|
|
317250
|
+
},
|
|
317251
|
+
isLocal: true
|
|
317252
|
+
},
|
|
317253
|
+
{
|
|
317254
|
+
id: "codellama:34b",
|
|
317255
|
+
label: "codellama:34b",
|
|
317256
|
+
get description() {
|
|
317257
|
+
return t2("CodeLlama 34B - Meta coding model (requires ~20GB VRAM)");
|
|
317258
|
+
},
|
|
317259
|
+
isLocal: true
|
|
317260
|
+
},
|
|
317261
|
+
{
|
|
317262
|
+
id: "deepseek-coder-v2:16b",
|
|
317263
|
+
label: "deepseek-coder-v2:16b",
|
|
317264
|
+
get description() {
|
|
317265
|
+
return t2("DeepSeek Coder V2 16B - Efficient MoE coding model");
|
|
317266
|
+
},
|
|
317267
|
+
isLocal: true
|
|
317268
|
+
},
|
|
317269
|
+
{
|
|
317270
|
+
id: "llama3.2:latest",
|
|
317271
|
+
label: "llama3.2:latest",
|
|
317272
|
+
get description() {
|
|
317273
|
+
return t2("Llama 3.2 - General purpose model with coding capabilities");
|
|
317274
|
+
},
|
|
317275
|
+
isLocal: true
|
|
317276
|
+
}
|
|
317277
|
+
];
|
|
317116
317278
|
function getOpenAIAvailableModelFromEnv() {
|
|
317117
317279
|
const id = process.env["OPENAI_MODEL"]?.trim();
|
|
317118
317280
|
return id ? { id, label: id } : null;
|
|
@@ -317121,7 +317283,10 @@ __name(getOpenAIAvailableModelFromEnv, "getOpenAIAvailableModelFromEnv");
|
|
|
317121
317283
|
function getAvailableModelsForAuthType(authType) {
|
|
317122
317284
|
switch (authType) {
|
|
317123
317285
|
case AuthType2.OSA_OAUTH:
|
|
317286
|
+
case AuthType2.OLLAMA_CLOUD:
|
|
317124
317287
|
return AVAILABLE_MODELS_OSA;
|
|
317288
|
+
case AuthType2.OLLAMA_LOCAL:
|
|
317289
|
+
return AVAILABLE_MODELS_OLLAMA_LOCAL;
|
|
317125
317290
|
case AuthType2.USE_OPENAI: {
|
|
317126
317291
|
const openAIModel = getOpenAIAvailableModelFromEnv();
|
|
317127
317292
|
return openAIModel ? [openAIModel] : [];
|
|
@@ -319028,6 +319193,7 @@ var BuiltinCommandLoader = class {
|
|
|
319028
319193
|
chatCommand,
|
|
319029
319194
|
clearCommand,
|
|
319030
319195
|
compressCommand,
|
|
319196
|
+
consultCommand,
|
|
319031
319197
|
continueCommand,
|
|
319032
319198
|
openaiProfileCommand,
|
|
319033
319199
|
copyCommand,
|
|
@@ -322952,7 +323118,7 @@ __name(runNonInteractiveStreamJson, "runNonInteractiveStreamJson");
|
|
|
322952
323118
|
|
|
322953
323119
|
// packages/cli/src/ui/AppContainer.tsx
|
|
322954
323120
|
init_esbuild_shims();
|
|
322955
|
-
var
|
|
323121
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
322956
323122
|
|
|
322957
323123
|
// packages/cli/src/ui/App.tsx
|
|
322958
323124
|
init_esbuild_shims();
|
|
@@ -350312,7 +350478,7 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
350312
350478
|
|
|
350313
350479
|
// packages/cli/src/ui/components/Composer.tsx
|
|
350314
350480
|
init_esbuild_shims();
|
|
350315
|
-
var
|
|
350481
|
+
var import_react101 = __toESM(require_react(), 1);
|
|
350316
350482
|
|
|
350317
350483
|
// packages/cli/src/ui/components/LoadingIndicator.tsx
|
|
350318
350484
|
init_esbuild_shims();
|
|
@@ -350391,9 +350557,75 @@ var LoadingIndicator = /* @__PURE__ */ __name(({
|
|
|
350391
350557
|
] });
|
|
350392
350558
|
}, "LoadingIndicator");
|
|
350393
350559
|
|
|
350394
|
-
// packages/cli/src/ui/components/
|
|
350560
|
+
// packages/cli/src/ui/components/ConsultationDisplay.tsx
|
|
350395
350561
|
init_esbuild_shims();
|
|
350562
|
+
var import_react87 = __toESM(require_react(), 1);
|
|
350396
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);
|
|
350397
350629
|
var ContextSummaryDisplay = /* @__PURE__ */ __name(({
|
|
350398
350630
|
OSAMdFileCount,
|
|
350399
350631
|
contextFileNames,
|
|
@@ -350408,7 +350640,7 @@ var ContextSummaryDisplay = /* @__PURE__ */ __name(({
|
|
|
350408
350640
|
const blockedMcpServerCount = blockedMcpServers?.length || 0;
|
|
350409
350641
|
const openFileCount = ideContext?.workspaceState?.openFiles?.length ?? 0;
|
|
350410
350642
|
if (OSAMdFileCount === 0 && mcpServerCount === 0 && blockedMcpServerCount === 0 && openFileCount === 0) {
|
|
350411
|
-
return /* @__PURE__ */ (0,
|
|
350643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Text3, { children: " " });
|
|
350412
350644
|
}
|
|
350413
350645
|
const openFilesText = (() => {
|
|
350414
350646
|
if (openFileCount === 0) {
|
|
@@ -350466,16 +350698,16 @@ var ContextSummaryDisplay = /* @__PURE__ */ __name(({
|
|
|
350466
350698
|
})();
|
|
350467
350699
|
const summaryParts = [openFilesText, OSAMdText, mcpText].filter(Boolean);
|
|
350468
350700
|
if (isNarrow) {
|
|
350469
|
-
return /* @__PURE__ */ (0,
|
|
350470
|
-
/* @__PURE__ */ (0,
|
|
350471
|
-
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: [
|
|
350472
350704
|
" ",
|
|
350473
350705
|
"- ",
|
|
350474
350706
|
part
|
|
350475
350707
|
] }, index))
|
|
350476
350708
|
] });
|
|
350477
350709
|
}
|
|
350478
|
-
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: [
|
|
350479
350711
|
t2("Using:"),
|
|
350480
350712
|
" ",
|
|
350481
350713
|
summaryParts.join(" | ")
|
|
@@ -350484,7 +350716,7 @@ var ContextSummaryDisplay = /* @__PURE__ */ __name(({
|
|
|
350484
350716
|
|
|
350485
350717
|
// packages/cli/src/ui/components/AutoAcceptIndicator.tsx
|
|
350486
350718
|
init_esbuild_shims();
|
|
350487
|
-
var
|
|
350719
|
+
var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1);
|
|
350488
350720
|
var AutoAcceptIndicator = /* @__PURE__ */ __name(({
|
|
350489
350721
|
approvalMode
|
|
350490
350722
|
}) => {
|
|
@@ -350511,29 +350743,29 @@ var AutoAcceptIndicator = /* @__PURE__ */ __name(({
|
|
|
350511
350743
|
default:
|
|
350512
350744
|
break;
|
|
350513
350745
|
}
|
|
350514
|
-
return /* @__PURE__ */ (0,
|
|
350746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Box_default, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Text3, { color: textColor, children: [
|
|
350515
350747
|
textContent2,
|
|
350516
|
-
subText && /* @__PURE__ */ (0,
|
|
350748
|
+
subText && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Text3, { color: theme.text.secondary, children: subText })
|
|
350517
350749
|
] }) });
|
|
350518
350750
|
}, "AutoAcceptIndicator");
|
|
350519
350751
|
|
|
350520
350752
|
// packages/cli/src/ui/components/ShellModeIndicator.tsx
|
|
350521
350753
|
init_esbuild_shims();
|
|
350522
|
-
var
|
|
350523
|
-
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: [
|
|
350524
350756
|
"shell mode enabled",
|
|
350525
|
-
/* @__PURE__ */ (0,
|
|
350757
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Text3, { color: theme.text.secondary, children: " (esc to disable)" })
|
|
350526
350758
|
] }) }), "ShellModeIndicator");
|
|
350527
350759
|
|
|
350528
350760
|
// packages/cli/src/ui/components/DetailedMessagesDisplay.tsx
|
|
350529
350761
|
init_esbuild_shims();
|
|
350530
|
-
var
|
|
350762
|
+
var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1);
|
|
350531
350763
|
var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, width }) => {
|
|
350532
350764
|
if (messages.length === 0) {
|
|
350533
350765
|
return null;
|
|
350534
350766
|
}
|
|
350535
350767
|
const borderAndPadding = 4;
|
|
350536
|
-
return /* @__PURE__ */ (0,
|
|
350768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
350537
350769
|
Box_default,
|
|
350538
350770
|
{
|
|
350539
350771
|
flexDirection: "column",
|
|
@@ -350543,12 +350775,12 @@ var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, wid
|
|
|
350543
350775
|
paddingX: 1,
|
|
350544
350776
|
width,
|
|
350545
350777
|
children: [
|
|
350546
|
-
/* @__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: [
|
|
350547
350779
|
"Debug Console",
|
|
350548
350780
|
" ",
|
|
350549
|
-
/* @__PURE__ */ (0,
|
|
350781
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Text3, { color: theme.text.secondary, children: "(ctrl+o to close)" })
|
|
350550
350782
|
] }) }),
|
|
350551
|
-
/* @__PURE__ */ (0,
|
|
350783
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(MaxSizedBox, { maxHeight, maxWidth: width - borderAndPadding, children: messages.map((msg, index) => {
|
|
350552
350784
|
let textColor = theme.text.primary;
|
|
350553
350785
|
let icon = "\u2139";
|
|
350554
350786
|
switch (msg.type) {
|
|
@@ -350568,14 +350800,14 @@ var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, wid
|
|
|
350568
350800
|
default:
|
|
350569
350801
|
break;
|
|
350570
350802
|
}
|
|
350571
|
-
return /* @__PURE__ */ (0,
|
|
350572
|
-
/* @__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: [
|
|
350573
350805
|
icon,
|
|
350574
350806
|
" "
|
|
350575
350807
|
] }),
|
|
350576
|
-
/* @__PURE__ */ (0,
|
|
350808
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Text3, { color: textColor, wrap: "wrap", children: [
|
|
350577
350809
|
msg.content,
|
|
350578
|
-
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: [
|
|
350579
350811
|
" (x",
|
|
350580
350812
|
msg.count,
|
|
350581
350813
|
")"
|
|
@@ -350590,15 +350822,15 @@ var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, wid
|
|
|
350590
350822
|
|
|
350591
350823
|
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
350592
350824
|
init_esbuild_shims();
|
|
350593
|
-
var
|
|
350825
|
+
var import_react97 = __toESM(require_react(), 1);
|
|
350594
350826
|
|
|
350595
350827
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
350596
350828
|
init_esbuild_shims();
|
|
350597
350829
|
|
|
350598
350830
|
// packages/cli/src/ui/components/PrepareLabel.tsx
|
|
350599
350831
|
init_esbuild_shims();
|
|
350600
|
-
var
|
|
350601
|
-
var
|
|
350832
|
+
var import_react88 = __toESM(require_react(), 1);
|
|
350833
|
+
var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1);
|
|
350602
350834
|
var MAX_WIDTH = 150;
|
|
350603
350835
|
var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
350604
350836
|
label,
|
|
@@ -350610,7 +350842,7 @@ var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
|
350610
350842
|
const hasMatch = matchedIndex !== void 0 && matchedIndex >= 0 && matchedIndex < label.length && userInput.length > 0;
|
|
350611
350843
|
if (!hasMatch) {
|
|
350612
350844
|
const display = isExpanded ? label : label.length > MAX_WIDTH ? label.slice(0, MAX_WIDTH) + "..." : label;
|
|
350613
|
-
return /* @__PURE__ */ (0,
|
|
350845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Text3, { wrap: "wrap", color: textColor, children: display });
|
|
350614
350846
|
}
|
|
350615
350847
|
const matchLength = userInput.length;
|
|
350616
350848
|
let before = "";
|
|
@@ -350649,9 +350881,9 @@ var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
|
350649
350881
|
after = after.length >= 3 ? after.slice(0, -3) + "..." : "...";
|
|
350650
350882
|
}
|
|
350651
350883
|
}
|
|
350652
|
-
return /* @__PURE__ */ (0,
|
|
350884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Text3, { color: textColor, wrap: "wrap", children: [
|
|
350653
350885
|
before,
|
|
350654
|
-
match2 ? match2.split(/(\s+)/).map((part, index) => /* @__PURE__ */ (0,
|
|
350886
|
+
match2 ? match2.split(/(\s+)/).map((part, index) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
350655
350887
|
Text3,
|
|
350656
350888
|
{
|
|
350657
350889
|
color: theme.background.primary,
|
|
@@ -350663,10 +350895,10 @@ var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
|
350663
350895
|
after
|
|
350664
350896
|
] });
|
|
350665
350897
|
}, "_PrepareLabel");
|
|
350666
|
-
var PrepareLabel =
|
|
350898
|
+
var PrepareLabel = import_react88.default.memo(_PrepareLabel);
|
|
350667
350899
|
|
|
350668
350900
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
350669
|
-
var
|
|
350901
|
+
var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1);
|
|
350670
350902
|
var MAX_SUGGESTIONS_TO_SHOW = 8;
|
|
350671
350903
|
function SuggestionsDisplay({
|
|
350672
350904
|
suggestions,
|
|
@@ -350679,7 +350911,7 @@ function SuggestionsDisplay({
|
|
|
350679
350911
|
expandedIndex
|
|
350680
350912
|
}) {
|
|
350681
350913
|
if (isLoading) {
|
|
350682
|
-
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..." }) });
|
|
350683
350915
|
}
|
|
350684
350916
|
if (suggestions.length === 0) {
|
|
350685
350917
|
return null;
|
|
@@ -350695,15 +350927,15 @@ function SuggestionsDisplay({
|
|
|
350695
350927
|
...suggestions.map((s2) => getFullLabel(s2).length)
|
|
350696
350928
|
);
|
|
350697
350929
|
const commandColumnWidth = mode === "slash" ? Math.min(maxLabelLength, Math.floor(width * 0.5)) : 0;
|
|
350698
|
-
return /* @__PURE__ */ (0,
|
|
350699
|
-
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" }),
|
|
350700
350932
|
visibleSuggestions.map((suggestion, index) => {
|
|
350701
350933
|
const originalIndex = startIndex + index;
|
|
350702
350934
|
const isActive = originalIndex === activeIndex;
|
|
350703
350935
|
const isExpanded = originalIndex === expandedIndex;
|
|
350704
350936
|
const textColor = isActive ? theme.text.accent : theme.text.secondary;
|
|
350705
350937
|
const isLong = suggestion.value.length >= MAX_WIDTH;
|
|
350706
|
-
const labelElement = /* @__PURE__ */ (0,
|
|
350938
|
+
const labelElement = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
350707
350939
|
PrepareLabel,
|
|
350708
350940
|
{
|
|
350709
350941
|
label: suggestion.value,
|
|
@@ -350713,23 +350945,23 @@ function SuggestionsDisplay({
|
|
|
350713
350945
|
isExpanded
|
|
350714
350946
|
}
|
|
350715
350947
|
);
|
|
350716
|
-
return /* @__PURE__ */ (0,
|
|
350717
|
-
/* @__PURE__ */ (0,
|
|
350948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
350949
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
350718
350950
|
Box_default,
|
|
350719
350951
|
{
|
|
350720
350952
|
...mode === "slash" ? { width: commandColumnWidth, flexShrink: 0 } : { flexShrink: 1 },
|
|
350721
|
-
children: /* @__PURE__ */ (0,
|
|
350953
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Box_default, { children: [
|
|
350722
350954
|
labelElement,
|
|
350723
|
-
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]" })
|
|
350724
350956
|
] })
|
|
350725
350957
|
}
|
|
350726
350958
|
),
|
|
350727
|
-
suggestion.description && /* @__PURE__ */ (0,
|
|
350728
|
-
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 " }) })
|
|
350729
350961
|
] }, `${suggestion.value}-${originalIndex}`);
|
|
350730
350962
|
}),
|
|
350731
|
-
endIndex < suggestions.length && /* @__PURE__ */ (0,
|
|
350732
|
-
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: [
|
|
350733
350965
|
"(",
|
|
350734
350966
|
activeIndex + 1,
|
|
350735
350967
|
"/",
|
|
@@ -350742,7 +350974,7 @@ __name(SuggestionsDisplay, "SuggestionsDisplay");
|
|
|
350742
350974
|
|
|
350743
350975
|
// packages/cli/src/ui/hooks/useInputHistory.ts
|
|
350744
350976
|
init_esbuild_shims();
|
|
350745
|
-
var
|
|
350977
|
+
var import_react89 = __toESM(require_react(), 1);
|
|
350746
350978
|
function useInputHistory({
|
|
350747
350979
|
userMessages,
|
|
350748
350980
|
onSubmit,
|
|
@@ -350750,13 +350982,13 @@ function useInputHistory({
|
|
|
350750
350982
|
currentQuery,
|
|
350751
350983
|
onChange
|
|
350752
350984
|
}) {
|
|
350753
|
-
const [historyIndex, setHistoryIndex] = (0,
|
|
350754
|
-
const [originalQueryBeforeNav, setOriginalQueryBeforeNav] = (0,
|
|
350755
|
-
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)(() => {
|
|
350756
350988
|
setHistoryIndex(-1);
|
|
350757
350989
|
setOriginalQueryBeforeNav("");
|
|
350758
350990
|
}, []);
|
|
350759
|
-
const handleSubmit = (0,
|
|
350991
|
+
const handleSubmit = (0, import_react89.useCallback)(
|
|
350760
350992
|
(value) => {
|
|
350761
350993
|
const trimmedValue = value.trim();
|
|
350762
350994
|
if (trimmedValue) {
|
|
@@ -350766,7 +350998,7 @@ function useInputHistory({
|
|
|
350766
350998
|
},
|
|
350767
350999
|
[onSubmit, resetHistoryNav]
|
|
350768
351000
|
);
|
|
350769
|
-
const navigateUp = (0,
|
|
351001
|
+
const navigateUp = (0, import_react89.useCallback)(() => {
|
|
350770
351002
|
if (!isActive) return false;
|
|
350771
351003
|
if (userMessages.length === 0) return false;
|
|
350772
351004
|
let nextIndex = historyIndex;
|
|
@@ -350795,7 +351027,7 @@ function useInputHistory({
|
|
|
350795
351027
|
// Use currentQuery from props
|
|
350796
351028
|
setOriginalQueryBeforeNav
|
|
350797
351029
|
]);
|
|
350798
|
-
const navigateDown = (0,
|
|
351030
|
+
const navigateDown = (0, import_react89.useCallback)(() => {
|
|
350799
351031
|
if (!isActive) return false;
|
|
350800
351032
|
if (historyIndex === -1) return false;
|
|
350801
351033
|
const nextIndex = historyIndex - 1;
|
|
@@ -350825,7 +351057,7 @@ __name(useInputHistory, "useInputHistory");
|
|
|
350825
351057
|
|
|
350826
351058
|
// packages/cli/src/ui/hooks/useShellHistory.ts
|
|
350827
351059
|
init_esbuild_shims();
|
|
350828
|
-
var
|
|
351060
|
+
var import_react90 = __toESM(require_react(), 1);
|
|
350829
351061
|
import * as fs85 from "node:fs/promises";
|
|
350830
351062
|
import * as path95 from "node:path";
|
|
350831
351063
|
var MAX_HISTORY_LENGTH2 = 100;
|
|
@@ -350869,10 +351101,10 @@ async function writeHistoryFile(filePath, history) {
|
|
|
350869
351101
|
}
|
|
350870
351102
|
__name(writeHistoryFile, "writeHistoryFile");
|
|
350871
351103
|
function useShellHistory(projectRoot, storage) {
|
|
350872
|
-
const [history, setHistory] = (0,
|
|
350873
|
-
const [historyIndex, setHistoryIndex] = (0,
|
|
350874
|
-
const [historyFilePath, setHistoryFilePath] = (0,
|
|
350875
|
-
(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)(() => {
|
|
350876
351108
|
async function loadHistory() {
|
|
350877
351109
|
const filePath = await getHistoryFilePath(projectRoot, storage);
|
|
350878
351110
|
setHistoryFilePath(filePath);
|
|
@@ -350882,7 +351114,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
350882
351114
|
__name(loadHistory, "loadHistory");
|
|
350883
351115
|
loadHistory();
|
|
350884
351116
|
}, [projectRoot, storage]);
|
|
350885
|
-
const addCommandToHistory = (0,
|
|
351117
|
+
const addCommandToHistory = (0, import_react90.useCallback)(
|
|
350886
351118
|
(command2) => {
|
|
350887
351119
|
if (!command2.trim() || !historyFilePath) {
|
|
350888
351120
|
return;
|
|
@@ -350894,7 +351126,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
350894
351126
|
},
|
|
350895
351127
|
[history, historyFilePath]
|
|
350896
351128
|
);
|
|
350897
|
-
const getPreviousCommand = (0,
|
|
351129
|
+
const getPreviousCommand = (0, import_react90.useCallback)(() => {
|
|
350898
351130
|
if (history.length === 0) {
|
|
350899
351131
|
return null;
|
|
350900
351132
|
}
|
|
@@ -350902,7 +351134,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
350902
351134
|
setHistoryIndex(newIndex);
|
|
350903
351135
|
return history[newIndex] ?? null;
|
|
350904
351136
|
}, [history, historyIndex]);
|
|
350905
|
-
const getNextCommand = (0,
|
|
351137
|
+
const getNextCommand = (0, import_react90.useCallback)(() => {
|
|
350906
351138
|
if (historyIndex < 0) {
|
|
350907
351139
|
return null;
|
|
350908
351140
|
}
|
|
@@ -350913,7 +351145,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
350913
351145
|
}
|
|
350914
351146
|
return history[newIndex] ?? null;
|
|
350915
351147
|
}, [history, historyIndex]);
|
|
350916
|
-
const resetHistoryPosition = (0,
|
|
351148
|
+
const resetHistoryPosition = (0, import_react90.useCallback)(() => {
|
|
350917
351149
|
setHistoryIndex(-1);
|
|
350918
351150
|
}, []);
|
|
350919
351151
|
return {
|
|
@@ -350928,19 +351160,19 @@ __name(useShellHistory, "useShellHistory");
|
|
|
350928
351160
|
|
|
350929
351161
|
// packages/cli/src/ui/hooks/useReverseSearchCompletion.tsx
|
|
350930
351162
|
init_esbuild_shims();
|
|
350931
|
-
var
|
|
351163
|
+
var import_react92 = __toESM(require_react(), 1);
|
|
350932
351164
|
|
|
350933
351165
|
// packages/cli/src/ui/hooks/useCompletion.ts
|
|
350934
351166
|
init_esbuild_shims();
|
|
350935
|
-
var
|
|
351167
|
+
var import_react91 = __toESM(require_react(), 1);
|
|
350936
351168
|
function useCompletion() {
|
|
350937
|
-
const [suggestions, setSuggestions] = (0,
|
|
350938
|
-
const [activeSuggestionIndex, setActiveSuggestionIndex] = (0,
|
|
350939
|
-
const [visibleStartIndex, setVisibleStartIndex] = (0,
|
|
350940
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
350941
|
-
const [isLoadingSuggestions, setIsLoadingSuggestions] = (0,
|
|
350942
|
-
const [isPerfectMatch, setIsPerfectMatch] = (0,
|
|
350943
|
-
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)(() => {
|
|
350944
351176
|
setSuggestions([]);
|
|
350945
351177
|
setActiveSuggestionIndex(-1);
|
|
350946
351178
|
setVisibleStartIndex(0);
|
|
@@ -350948,7 +351180,7 @@ function useCompletion() {
|
|
|
350948
351180
|
setIsLoadingSuggestions(false);
|
|
350949
351181
|
setIsPerfectMatch(false);
|
|
350950
351182
|
}, []);
|
|
350951
|
-
const navigateUp = (0,
|
|
351183
|
+
const navigateUp = (0, import_react91.useCallback)(() => {
|
|
350952
351184
|
if (suggestions.length === 0) return;
|
|
350953
351185
|
setActiveSuggestionIndex((prevActiveIndex) => {
|
|
350954
351186
|
const newActiveIndex = prevActiveIndex <= 0 ? suggestions.length - 1 : prevActiveIndex - 1;
|
|
@@ -350964,7 +351196,7 @@ function useCompletion() {
|
|
|
350964
351196
|
return newActiveIndex;
|
|
350965
351197
|
});
|
|
350966
351198
|
}, [suggestions.length]);
|
|
350967
|
-
const navigateDown = (0,
|
|
351199
|
+
const navigateDown = (0, import_react91.useCallback)(() => {
|
|
350968
351200
|
if (suggestions.length === 0) return;
|
|
350969
351201
|
setActiveSuggestionIndex((prevActiveIndex) => {
|
|
350970
351202
|
const newActiveIndex = prevActiveIndex >= suggestions.length - 1 ? 0 : prevActiveIndex + 1;
|
|
@@ -351003,8 +351235,8 @@ __name(useCompletion, "useCompletion");
|
|
|
351003
351235
|
|
|
351004
351236
|
// packages/cli/src/ui/hooks/useReverseSearchCompletion.tsx
|
|
351005
351237
|
function useDebouncedValue(value, delay4 = 200) {
|
|
351006
|
-
const [debounced, setDebounced] = (0,
|
|
351007
|
-
(0,
|
|
351238
|
+
const [debounced, setDebounced] = (0, import_react92.useState)(value);
|
|
351239
|
+
(0, import_react92.useEffect)(() => {
|
|
351008
351240
|
const handle = setTimeout(() => setDebounced(value), delay4);
|
|
351009
351241
|
return () => clearTimeout(handle);
|
|
351010
351242
|
}, [value, delay4]);
|
|
@@ -351027,19 +351259,19 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
351027
351259
|
setVisibleStartIndex
|
|
351028
351260
|
} = useCompletion();
|
|
351029
351261
|
const debouncedQuery = useDebouncedValue(buffer.text, 100);
|
|
351030
|
-
const prevQueryRef = (0,
|
|
351031
|
-
const prevMatchesRef = (0,
|
|
351032
|
-
(0,
|
|
351262
|
+
const prevQueryRef = (0, import_react92.useRef)("");
|
|
351263
|
+
const prevMatchesRef = (0, import_react92.useRef)([]);
|
|
351264
|
+
(0, import_react92.useEffect)(() => {
|
|
351033
351265
|
if (reverseSearchActive) {
|
|
351034
351266
|
prevQueryRef.current = "";
|
|
351035
351267
|
prevMatchesRef.current = [];
|
|
351036
351268
|
}
|
|
351037
351269
|
}, [reverseSearchActive]);
|
|
351038
|
-
(0,
|
|
351270
|
+
(0, import_react92.useEffect)(() => {
|
|
351039
351271
|
prevQueryRef.current = "";
|
|
351040
351272
|
prevMatchesRef.current = [];
|
|
351041
351273
|
}, [history]);
|
|
351042
|
-
const searchHistory = (0,
|
|
351274
|
+
const searchHistory = (0, import_react92.useCallback)(
|
|
351043
351275
|
(query, items) => {
|
|
351044
351276
|
const out = [];
|
|
351045
351277
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -351053,7 +351285,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
351053
351285
|
},
|
|
351054
351286
|
[]
|
|
351055
351287
|
);
|
|
351056
|
-
const matches = (0,
|
|
351288
|
+
const matches = (0, import_react92.useMemo)(() => {
|
|
351057
351289
|
if (!reverseSearchActive) return [];
|
|
351058
351290
|
if (debouncedQuery.length === 0)
|
|
351059
351291
|
return history.map((cmd) => ({
|
|
@@ -351066,7 +351298,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
351066
351298
|
const source2 = canUseCache ? prevMatchesRef.current.map((m) => m.value) : history;
|
|
351067
351299
|
return searchHistory(query, source2);
|
|
351068
351300
|
}, [debouncedQuery, history, reverseSearchActive, searchHistory]);
|
|
351069
|
-
(0,
|
|
351301
|
+
(0, import_react92.useEffect)(() => {
|
|
351070
351302
|
if (!reverseSearchActive) {
|
|
351071
351303
|
resetCompletionState();
|
|
351072
351304
|
return;
|
|
@@ -351088,7 +351320,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
351088
351320
|
setVisibleStartIndex,
|
|
351089
351321
|
resetCompletionState
|
|
351090
351322
|
]);
|
|
351091
|
-
const handleAutocomplete = (0,
|
|
351323
|
+
const handleAutocomplete = (0, import_react92.useCallback)(
|
|
351092
351324
|
(i) => {
|
|
351093
351325
|
if (i < 0 || i >= suggestions.length) return;
|
|
351094
351326
|
buffer.setText(suggestions[i].value);
|
|
@@ -351112,11 +351344,11 @@ __name(useReverseSearchCompletion, "useReverseSearchCompletion");
|
|
|
351112
351344
|
|
|
351113
351345
|
// packages/cli/src/ui/hooks/useCommandCompletion.tsx
|
|
351114
351346
|
init_esbuild_shims();
|
|
351115
|
-
var
|
|
351347
|
+
var import_react95 = __toESM(require_react(), 1);
|
|
351116
351348
|
|
|
351117
351349
|
// packages/cli/src/ui/hooks/useAtCompletion.ts
|
|
351118
351350
|
init_esbuild_shims();
|
|
351119
|
-
var
|
|
351351
|
+
var import_react93 = __toESM(require_react(), 1);
|
|
351120
351352
|
var initialState = {
|
|
351121
351353
|
status: "idle" /* IDLE */,
|
|
351122
351354
|
suggestions: [],
|
|
@@ -351174,20 +351406,20 @@ function useAtCompletion(props) {
|
|
|
351174
351406
|
setSuggestions,
|
|
351175
351407
|
setIsLoadingSuggestions
|
|
351176
351408
|
} = props;
|
|
351177
|
-
const [state, dispatch] = (0,
|
|
351178
|
-
const fileSearch = (0,
|
|
351179
|
-
const searchAbortController = (0,
|
|
351180
|
-
const slowSearchTimer = (0,
|
|
351181
|
-
(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)(() => {
|
|
351182
351414
|
setSuggestions(state.suggestions);
|
|
351183
351415
|
}, [state.suggestions, setSuggestions]);
|
|
351184
|
-
(0,
|
|
351416
|
+
(0, import_react93.useEffect)(() => {
|
|
351185
351417
|
setIsLoadingSuggestions(state.isLoading);
|
|
351186
351418
|
}, [state.isLoading, setIsLoadingSuggestions]);
|
|
351187
|
-
(0,
|
|
351419
|
+
(0, import_react93.useEffect)(() => {
|
|
351188
351420
|
dispatch({ type: "RESET" });
|
|
351189
351421
|
}, [cwd7, config]);
|
|
351190
|
-
(0,
|
|
351422
|
+
(0, import_react93.useEffect)(() => {
|
|
351191
351423
|
if (!enabled) {
|
|
351192
351424
|
if (state.status === "ready" /* READY */ || state.status === "error" /* ERROR */) {
|
|
351193
351425
|
dispatch({ type: "RESET" });
|
|
@@ -351204,7 +351436,7 @@ function useAtCompletion(props) {
|
|
|
351204
351436
|
dispatch({ type: "SEARCH", payload: pattern });
|
|
351205
351437
|
}
|
|
351206
351438
|
}, [enabled, pattern, state.status, state.pattern]);
|
|
351207
|
-
(0,
|
|
351439
|
+
(0, import_react93.useEffect)(() => {
|
|
351208
351440
|
const initialize = /* @__PURE__ */ __name(async () => {
|
|
351209
351441
|
try {
|
|
351210
351442
|
const searcher = FileSearchFactory.create({
|
|
@@ -351279,7 +351511,7 @@ __name(useAtCompletion, "useAtCompletion");
|
|
|
351279
351511
|
|
|
351280
351512
|
// packages/cli/src/ui/hooks/useSlashCompletion.ts
|
|
351281
351513
|
init_esbuild_shims();
|
|
351282
|
-
var
|
|
351514
|
+
var import_react94 = __toESM(require_react(), 1);
|
|
351283
351515
|
init_fzf_es();
|
|
351284
351516
|
function logErrorSafely(error, context2) {
|
|
351285
351517
|
if (error instanceof Error) {
|
|
@@ -351294,7 +351526,7 @@ function matchesCommand(cmd, query) {
|
|
|
351294
351526
|
}
|
|
351295
351527
|
__name(matchesCommand, "matchesCommand");
|
|
351296
351528
|
function useCommandParser(query, slashCommands) {
|
|
351297
|
-
return (0,
|
|
351529
|
+
return (0, import_react94.useMemo)(() => {
|
|
351298
351530
|
if (!query) {
|
|
351299
351531
|
return {
|
|
351300
351532
|
hasTrailingSpace: false,
|
|
@@ -351364,9 +351596,9 @@ function useCommandParser(query, slashCommands) {
|
|
|
351364
351596
|
}
|
|
351365
351597
|
__name(useCommandParser, "useCommandParser");
|
|
351366
351598
|
function useCommandSuggestions(parserResult, commandContext, getFzfForCommands, getPrefixSuggestions) {
|
|
351367
|
-
const [suggestions, setSuggestions] = (0,
|
|
351368
|
-
const [isLoading, setIsLoading] = (0,
|
|
351369
|
-
(0,
|
|
351599
|
+
const [suggestions, setSuggestions] = (0, import_react94.useState)([]);
|
|
351600
|
+
const [isLoading, setIsLoading] = (0, import_react94.useState)(false);
|
|
351601
|
+
(0, import_react94.useEffect)(() => {
|
|
351370
351602
|
const abortController = new AbortController();
|
|
351371
351603
|
const { signal } = abortController;
|
|
351372
351604
|
const {
|
|
@@ -351486,7 +351718,7 @@ function useCommandSuggestions(parserResult, commandContext, getFzfForCommands,
|
|
|
351486
351718
|
}
|
|
351487
351719
|
__name(useCommandSuggestions, "useCommandSuggestions");
|
|
351488
351720
|
function useCompletionPositions(query, parserResult) {
|
|
351489
|
-
return (0,
|
|
351721
|
+
return (0, import_react94.useMemo)(() => {
|
|
351490
351722
|
if (!query) {
|
|
351491
351723
|
return { start: -1, end: -1 };
|
|
351492
351724
|
}
|
|
@@ -351508,7 +351740,7 @@ function useCompletionPositions(query, parserResult) {
|
|
|
351508
351740
|
}
|
|
351509
351741
|
__name(useCompletionPositions, "useCompletionPositions");
|
|
351510
351742
|
function usePerfectMatch(parserResult) {
|
|
351511
|
-
return (0,
|
|
351743
|
+
return (0, import_react94.useMemo)(() => {
|
|
351512
351744
|
const { hasTrailingSpace, partial, leafCommand, currentLevel } = parserResult;
|
|
351513
351745
|
if (hasTrailingSpace) {
|
|
351514
351746
|
return { isPerfectMatch: false };
|
|
@@ -351538,13 +351770,13 @@ function useSlashCompletion(props) {
|
|
|
351538
351770
|
setIsLoadingSuggestions,
|
|
351539
351771
|
setIsPerfectMatch
|
|
351540
351772
|
} = props;
|
|
351541
|
-
const [completionStart, setCompletionStart] = (0,
|
|
351542
|
-
const [completionEnd, setCompletionEnd] = (0,
|
|
351543
|
-
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)(
|
|
351544
351776
|
() => /* @__PURE__ */ new WeakMap(),
|
|
351545
351777
|
[]
|
|
351546
351778
|
);
|
|
351547
|
-
const getFzfForCommands = (0,
|
|
351779
|
+
const getFzfForCommands = (0, import_react94.useMemo)(
|
|
351548
351780
|
() => (commands) => {
|
|
351549
351781
|
if (!commands || commands.length === 0) {
|
|
351550
351782
|
return null;
|
|
@@ -351588,7 +351820,7 @@ function useSlashCompletion(props) {
|
|
|
351588
351820
|
},
|
|
351589
351821
|
[fzfInstanceCache]
|
|
351590
351822
|
);
|
|
351591
|
-
const getPrefixSuggestions = (0,
|
|
351823
|
+
const getPrefixSuggestions = (0, import_react94.useMemo)(
|
|
351592
351824
|
() => (commands, partial) => commands.filter(
|
|
351593
351825
|
(cmd) => cmd.description && !cmd.hidden && (cmd.name.toLowerCase().startsWith(partial.toLowerCase()) || cmd.altNames?.some(
|
|
351594
351826
|
(alt) => alt.toLowerCase().startsWith(partial.toLowerCase())
|
|
@@ -351608,7 +351840,7 @@ function useSlashCompletion(props) {
|
|
|
351608
351840
|
parserResult
|
|
351609
351841
|
);
|
|
351610
351842
|
const { isPerfectMatch } = usePerfectMatch(parserResult);
|
|
351611
|
-
(0,
|
|
351843
|
+
(0, import_react94.useEffect)(() => {
|
|
351612
351844
|
if (!enabled) {
|
|
351613
351845
|
setSuggestions([]);
|
|
351614
351846
|
setIsLoadingSuggestions(false);
|
|
@@ -351617,7 +351849,7 @@ function useSlashCompletion(props) {
|
|
|
351617
351849
|
setCompletionEnd(-1);
|
|
351618
351850
|
}
|
|
351619
351851
|
}, [enabled, setSuggestions, setIsLoadingSuggestions, setIsPerfectMatch]);
|
|
351620
|
-
(0,
|
|
351852
|
+
(0, import_react94.useEffect)(() => {
|
|
351621
351853
|
if (!enabled || query === null) {
|
|
351622
351854
|
return;
|
|
351623
351855
|
}
|
|
@@ -351666,7 +351898,7 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
351666
351898
|
} = useCompletion();
|
|
351667
351899
|
const cursorRow = buffer.cursor[0];
|
|
351668
351900
|
const cursorCol = buffer.cursor[1];
|
|
351669
|
-
const { completionMode, query, completionStart, completionEnd } = (0,
|
|
351901
|
+
const { completionMode, query, completionStart, completionEnd } = (0, import_react95.useMemo)(() => {
|
|
351670
351902
|
const currentLine = buffer.lines[cursorRow] || "";
|
|
351671
351903
|
if (cursorRow === 0 && isSlashCommand(currentLine.trim())) {
|
|
351672
351904
|
return {
|
|
@@ -351735,11 +351967,11 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
351735
351967
|
setIsLoadingSuggestions,
|
|
351736
351968
|
setIsPerfectMatch
|
|
351737
351969
|
});
|
|
351738
|
-
(0,
|
|
351970
|
+
(0, import_react95.useEffect)(() => {
|
|
351739
351971
|
setActiveSuggestionIndex(suggestions.length > 0 ? 0 : -1);
|
|
351740
351972
|
setVisibleStartIndex(0);
|
|
351741
351973
|
}, [suggestions, setActiveSuggestionIndex, setVisibleStartIndex]);
|
|
351742
|
-
(0,
|
|
351974
|
+
(0, import_react95.useEffect)(() => {
|
|
351743
351975
|
if (completionMode === "IDLE" /* IDLE */ || reverseSearchActive) {
|
|
351744
351976
|
resetCompletionState();
|
|
351745
351977
|
return;
|
|
@@ -351753,7 +351985,7 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
351753
351985
|
resetCompletionState,
|
|
351754
351986
|
setShowSuggestions
|
|
351755
351987
|
]);
|
|
351756
|
-
const handleAutocomplete = (0,
|
|
351988
|
+
const handleAutocomplete = (0, import_react95.useCallback)(
|
|
351757
351989
|
(indexToUse) => {
|
|
351758
351990
|
if (indexToUse < 0 || indexToUse >= suggestions.length) {
|
|
351759
351991
|
return;
|
|
@@ -351979,12 +352211,12 @@ import * as path97 from "node:path";
|
|
|
351979
352211
|
|
|
351980
352212
|
// packages/cli/src/ui/contexts/ShellFocusContext.tsx
|
|
351981
352213
|
init_esbuild_shims();
|
|
351982
|
-
var
|
|
351983
|
-
var ShellFocusContext = (0,
|
|
351984
|
-
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");
|
|
351985
352217
|
|
|
351986
352218
|
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
351987
|
-
var
|
|
352219
|
+
var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1);
|
|
351988
352220
|
var calculatePromptWidths = /* @__PURE__ */ __name((terminalWidth) => {
|
|
351989
352221
|
const widthFraction = 0.9;
|
|
351990
352222
|
const FRAME_PADDING_AND_BORDER = 4;
|
|
@@ -352021,29 +352253,29 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352021
352253
|
isEmbeddedShellFocused
|
|
352022
352254
|
}) => {
|
|
352023
352255
|
const isShellFocused = useShellFocusState();
|
|
352024
|
-
const [justNavigatedHistory, setJustNavigatedHistory] = (0,
|
|
352025
|
-
const [escPressCount, setEscPressCount] = (0,
|
|
352026
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
352027
|
-
const escapeTimerRef = (0,
|
|
352028
|
-
const [recentPasteTime, setRecentPasteTime] = (0,
|
|
352029
|
-
const pasteTimeoutRef = (0,
|
|
352030
|
-
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)(
|
|
352031
352263
|
config.getWorkspaceContext().getDirectories()
|
|
352032
352264
|
);
|
|
352033
352265
|
const dirsChanged = config.getWorkspaceContext().getDirectories();
|
|
352034
|
-
(0,
|
|
352266
|
+
(0, import_react97.useEffect)(() => {
|
|
352035
352267
|
if (dirs.length !== dirsChanged.length) {
|
|
352036
352268
|
setDirs(dirsChanged);
|
|
352037
352269
|
}
|
|
352038
352270
|
}, [dirs.length, dirsChanged]);
|
|
352039
|
-
const [reverseSearchActive, setReverseSearchActive] = (0,
|
|
352040
|
-
const [commandSearchActive, setCommandSearchActive] = (0,
|
|
352041
|
-
const [textBeforeReverseSearch, setTextBeforeReverseSearch] = (0,
|
|
352042
|
-
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)([
|
|
352043
352275
|
0,
|
|
352044
352276
|
0
|
|
352045
352277
|
]);
|
|
352046
|
-
const [expandedSuggestionIndex, setExpandedSuggestionIndex] = (0,
|
|
352278
|
+
const [expandedSuggestionIndex, setExpandedSuggestionIndex] = (0, import_react97.useState)(-1);
|
|
352047
352279
|
const shellHistory = useShellHistory(config.getProjectRoot());
|
|
352048
352280
|
const shellHistoryData = shellHistory.history;
|
|
352049
352281
|
const completion3 = useCommandCompletion(
|
|
@@ -352069,7 +352301,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352069
352301
|
const resetReverseSearchCompletionState = reverseSearchCompletion.resetCompletionState;
|
|
352070
352302
|
const resetCommandSearchCompletionState = commandSearchCompletion.resetCompletionState;
|
|
352071
352303
|
const showCursor = focus && isShellFocused && !isEmbeddedShellFocused;
|
|
352072
|
-
const resetEscapeState = (0,
|
|
352304
|
+
const resetEscapeState = (0, import_react97.useCallback)(() => {
|
|
352073
352305
|
if (escapeTimerRef.current) {
|
|
352074
352306
|
clearTimeout(escapeTimerRef.current);
|
|
352075
352307
|
escapeTimerRef.current = null;
|
|
@@ -352077,12 +352309,12 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352077
352309
|
setEscPressCount(0);
|
|
352078
352310
|
setShowEscapePrompt(false);
|
|
352079
352311
|
}, []);
|
|
352080
|
-
(0,
|
|
352312
|
+
(0, import_react97.useEffect)(() => {
|
|
352081
352313
|
if (onEscapePromptChange) {
|
|
352082
352314
|
onEscapePromptChange(showEscapePrompt);
|
|
352083
352315
|
}
|
|
352084
352316
|
}, [showEscapePrompt, onEscapePromptChange]);
|
|
352085
|
-
(0,
|
|
352317
|
+
(0, import_react97.useEffect)(
|
|
352086
352318
|
() => () => {
|
|
352087
352319
|
if (escapeTimerRef.current) {
|
|
352088
352320
|
clearTimeout(escapeTimerRef.current);
|
|
@@ -352093,7 +352325,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352093
352325
|
},
|
|
352094
352326
|
[]
|
|
352095
352327
|
);
|
|
352096
|
-
const handleSubmitAndClear = (0,
|
|
352328
|
+
const handleSubmitAndClear = (0, import_react97.useCallback)(
|
|
352097
352329
|
(submittedValue) => {
|
|
352098
352330
|
if (shellModeActive) {
|
|
352099
352331
|
shellHistory.addCommandToHistory(submittedValue);
|
|
@@ -352112,7 +352344,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352112
352344
|
resetReverseSearchCompletionState
|
|
352113
352345
|
]
|
|
352114
352346
|
);
|
|
352115
|
-
const customSetTextAndResetCompletionSignal = (0,
|
|
352347
|
+
const customSetTextAndResetCompletionSignal = (0, import_react97.useCallback)(
|
|
352116
352348
|
(newText) => {
|
|
352117
352349
|
buffer.setText(newText);
|
|
352118
352350
|
setJustNavigatedHistory(true);
|
|
@@ -352126,7 +352358,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352126
352358
|
currentQuery: buffer.text,
|
|
352127
352359
|
onChange: customSetTextAndResetCompletionSignal
|
|
352128
352360
|
});
|
|
352129
|
-
(0,
|
|
352361
|
+
(0, import_react97.useEffect)(() => {
|
|
352130
352362
|
if (justNavigatedHistory) {
|
|
352131
352363
|
resetCompletionState();
|
|
352132
352364
|
resetReverseSearchCompletionState();
|
|
@@ -352142,7 +352374,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352142
352374
|
resetReverseSearchCompletionState,
|
|
352143
352375
|
resetCommandSearchCompletionState
|
|
352144
352376
|
]);
|
|
352145
|
-
const handleClipboardImage = (0,
|
|
352377
|
+
const handleClipboardImage = (0, import_react97.useCallback)(async () => {
|
|
352146
352378
|
try {
|
|
352147
352379
|
if (await clipboardHasImage()) {
|
|
352148
352380
|
const imagePath = await saveClipboardImage(config.getTargetDir());
|
|
@@ -352174,7 +352406,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352174
352406
|
console.error("Error handling clipboard image:", error);
|
|
352175
352407
|
}
|
|
352176
352408
|
}, [buffer, config]);
|
|
352177
|
-
const handleInput = (0,
|
|
352409
|
+
const handleInput = (0, import_react97.useCallback)(
|
|
352178
352410
|
(key) => {
|
|
352179
352411
|
if (!focus && !key.paste) {
|
|
352180
352412
|
return;
|
|
@@ -352493,21 +352725,21 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352493
352725
|
statusColor = theme.status.warning;
|
|
352494
352726
|
statusText = t2("Accepting edits");
|
|
352495
352727
|
}
|
|
352496
|
-
return /* @__PURE__ */ (0,
|
|
352497
|
-
/* @__PURE__ */ (0,
|
|
352728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
|
|
352729
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
352498
352730
|
Box_default,
|
|
352499
352731
|
{
|
|
352500
352732
|
borderStyle: "round",
|
|
352501
352733
|
borderColor: isShellFocused && !isEmbeddedShellFocused ? statusColor ?? theme.border.focused : theme.border.default,
|
|
352502
352734
|
paddingX: 1,
|
|
352503
352735
|
children: [
|
|
352504
|
-
/* @__PURE__ */ (0,
|
|
352736
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
352505
352737
|
Text3,
|
|
352506
352738
|
{
|
|
352507
352739
|
color: statusColor ?? theme.text.accent,
|
|
352508
352740
|
"aria-label": statusText || void 0,
|
|
352509
352741
|
children: [
|
|
352510
|
-
shellModeActive ? reverseSearchActive ? /* @__PURE__ */ (0,
|
|
352742
|
+
shellModeActive ? reverseSearchActive ? /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
|
|
352511
352743
|
Text3,
|
|
352512
352744
|
{
|
|
352513
352745
|
color: theme.text.link,
|
|
@@ -352517,15 +352749,15 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352517
352749
|
" "
|
|
352518
352750
|
]
|
|
352519
352751
|
}
|
|
352520
|
-
) : "!" : commandSearchActive ? /* @__PURE__ */ (0,
|
|
352752
|
+
) : "!" : commandSearchActive ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { color: theme.text.accent, children: "(r:) " }) : showYoloStyling ? "*" : ">",
|
|
352521
352753
|
" "
|
|
352522
352754
|
]
|
|
352523
352755
|
}
|
|
352524
352756
|
),
|
|
352525
|
-
/* @__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: [
|
|
352526
352758
|
source_default2.inverse(placeholder.slice(0, 1)),
|
|
352527
|
-
/* @__PURE__ */ (0,
|
|
352528
|
-
] }) : /* @__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) => {
|
|
352529
352761
|
const absoluteVisualIdx = scrollVisualRow + visualIdxInRenderedSet;
|
|
352530
352762
|
const mapEntry = buffer.visualToLogicalMap[absoluteVisualIdx];
|
|
352531
352763
|
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
|
@@ -352572,20 +352804,20 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
352572
352804
|
}
|
|
352573
352805
|
const color = seg.type === "command" || seg.type === "file" ? theme.text.accent : theme.text.primary;
|
|
352574
352806
|
renderedLine.push(
|
|
352575
|
-
/* @__PURE__ */ (0,
|
|
352807
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { color, children: display }, `token-${segIdx}`)
|
|
352576
352808
|
);
|
|
352577
352809
|
});
|
|
352578
352810
|
if (isOnCursorLine && cursorVisualColAbsolute === cpLen(lineText)) {
|
|
352579
352811
|
renderedLine.push(
|
|
352580
|
-
/* @__PURE__ */ (0,
|
|
352812
|
+
/* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Text3, { children: showCursor ? source_default2.inverse(" ") : " " }, `cursor-end-${cursorVisualColAbsolute}`)
|
|
352581
352813
|
);
|
|
352582
352814
|
}
|
|
352583
|
-
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}`);
|
|
352584
352816
|
}) })
|
|
352585
352817
|
]
|
|
352586
352818
|
}
|
|
352587
352819
|
),
|
|
352588
|
-
shouldShowSuggestions && /* @__PURE__ */ (0,
|
|
352820
|
+
shouldShowSuggestions && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Box_default, { paddingRight: 2, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
352589
352821
|
SuggestionsDisplay,
|
|
352590
352822
|
{
|
|
352591
352823
|
suggestions: activeCompletion.suggestions,
|
|
@@ -352606,7 +352838,7 @@ init_esbuild_shims();
|
|
|
352606
352838
|
|
|
352607
352839
|
// packages/cli/src/ui/components/ConsoleSummaryDisplay.tsx
|
|
352608
352840
|
init_esbuild_shims();
|
|
352609
|
-
var
|
|
352841
|
+
var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
|
|
352610
352842
|
var ConsoleSummaryDisplay = /* @__PURE__ */ __name(({
|
|
352611
352843
|
errorCount
|
|
352612
352844
|
}) => {
|
|
@@ -352614,14 +352846,14 @@ var ConsoleSummaryDisplay = /* @__PURE__ */ __name(({
|
|
|
352614
352846
|
return null;
|
|
352615
352847
|
}
|
|
352616
352848
|
const errorIcon = "\u2716";
|
|
352617
|
-
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: [
|
|
352618
352850
|
errorIcon,
|
|
352619
352851
|
" ",
|
|
352620
352852
|
errorCount,
|
|
352621
352853
|
" error",
|
|
352622
352854
|
errorCount > 1 ? "s" : "",
|
|
352623
352855
|
" ",
|
|
352624
|
-
/* @__PURE__ */ (0,
|
|
352856
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Text3, { color: theme.text.secondary, children: "(ctrl+o for details)" })
|
|
352625
352857
|
] }) });
|
|
352626
352858
|
}, "ConsoleSummaryDisplay");
|
|
352627
352859
|
|
|
@@ -352630,15 +352862,15 @@ import process36 from "node:process";
|
|
|
352630
352862
|
|
|
352631
352863
|
// packages/cli/src/ui/components/MemoryUsageDisplay.tsx
|
|
352632
352864
|
init_esbuild_shims();
|
|
352633
|
-
var
|
|
352865
|
+
var import_react98 = __toESM(require_react(), 1);
|
|
352634
352866
|
import process35 from "node:process";
|
|
352635
|
-
var
|
|
352867
|
+
var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1);
|
|
352636
352868
|
var MemoryUsageDisplay = /* @__PURE__ */ __name(() => {
|
|
352637
|
-
const [memoryUsage, setMemoryUsage] = (0,
|
|
352638
|
-
const [memoryUsageColor, setMemoryUsageColor] = (0,
|
|
352869
|
+
const [memoryUsage, setMemoryUsage] = (0, import_react98.useState)("");
|
|
352870
|
+
const [memoryUsageColor, setMemoryUsageColor] = (0, import_react98.useState)(
|
|
352639
352871
|
theme.text.secondary
|
|
352640
352872
|
);
|
|
352641
|
-
(0,
|
|
352873
|
+
(0, import_react98.useEffect)(() => {
|
|
352642
352874
|
const updateMemory = /* @__PURE__ */ __name(() => {
|
|
352643
352875
|
const usage2 = process35.memoryUsage().rss;
|
|
352644
352876
|
setMemoryUsage(formatMemoryUsage2(usage2));
|
|
@@ -352650,15 +352882,15 @@ var MemoryUsageDisplay = /* @__PURE__ */ __name(() => {
|
|
|
352650
352882
|
updateMemory();
|
|
352651
352883
|
return () => clearInterval(intervalId);
|
|
352652
352884
|
}, []);
|
|
352653
|
-
return /* @__PURE__ */ (0,
|
|
352654
|
-
/* @__PURE__ */ (0,
|
|
352655
|
-
/* @__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 })
|
|
352656
352888
|
] });
|
|
352657
352889
|
}, "MemoryUsageDisplay");
|
|
352658
352890
|
|
|
352659
352891
|
// packages/cli/src/ui/components/ContextUsageDisplay.tsx
|
|
352660
352892
|
init_esbuild_shims();
|
|
352661
|
-
var
|
|
352893
|
+
var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
|
|
352662
352894
|
var formatTokens = /* @__PURE__ */ __name((count) => {
|
|
352663
352895
|
if (count >= 1e6) {
|
|
352664
352896
|
return `${(count / 1e6).toFixed(1)}M`;
|
|
@@ -352688,19 +352920,19 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
352688
352920
|
const percentageUsed = (percentage * 100).toFixed(0);
|
|
352689
352921
|
const usageColor = getUsageColor(percentage);
|
|
352690
352922
|
if (terminalWidth < 80) {
|
|
352691
|
-
return /* @__PURE__ */ (0,
|
|
352923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: usageColor, children: [
|
|
352692
352924
|
"(",
|
|
352693
352925
|
percentageUsed,
|
|
352694
352926
|
"%)"
|
|
352695
352927
|
] });
|
|
352696
352928
|
}
|
|
352697
352929
|
if (terminalWidth < 120) {
|
|
352698
|
-
return /* @__PURE__ */ (0,
|
|
352699
|
-
/* @__PURE__ */ (0,
|
|
352930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { children: [
|
|
352931
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: usageColor, children: [
|
|
352700
352932
|
percentageUsed,
|
|
352701
352933
|
"%"
|
|
352702
352934
|
] }),
|
|
352703
|
-
/* @__PURE__ */ (0,
|
|
352935
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352704
352936
|
" ",
|
|
352705
352937
|
"(",
|
|
352706
352938
|
formatTokens(promptTokenCount),
|
|
@@ -352712,13 +352944,13 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
352712
352944
|
}
|
|
352713
352945
|
const barWidth = 10;
|
|
352714
352946
|
const progressBar = generateProgressBar(percentage, barWidth);
|
|
352715
|
-
return /* @__PURE__ */ (0,
|
|
352716
|
-
/* @__PURE__ */ (0,
|
|
352947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { children: [
|
|
352948
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: usageColor, children: [
|
|
352717
352949
|
"[",
|
|
352718
352950
|
progressBar,
|
|
352719
352951
|
"]"
|
|
352720
352952
|
] }),
|
|
352721
|
-
/* @__PURE__ */ (0,
|
|
352953
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352722
352954
|
" ",
|
|
352723
352955
|
formatTokens(promptTokenCount),
|
|
352724
352956
|
"/",
|
|
@@ -352729,12 +352961,12 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
352729
352961
|
|
|
352730
352962
|
// packages/cli/src/ui/components/DebugProfiler.tsx
|
|
352731
352963
|
init_esbuild_shims();
|
|
352732
|
-
var
|
|
352733
|
-
var
|
|
352964
|
+
var import_react99 = __toESM(require_react(), 1);
|
|
352965
|
+
var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1);
|
|
352734
352966
|
var DebugProfiler = /* @__PURE__ */ __name(() => {
|
|
352735
|
-
const numRenders = (0,
|
|
352736
|
-
const [showNumRenders, setShowNumRenders] = (0,
|
|
352737
|
-
(0,
|
|
352967
|
+
const numRenders = (0, import_react99.useRef)(0);
|
|
352968
|
+
const [showNumRenders, setShowNumRenders] = (0, import_react99.useState)(false);
|
|
352969
|
+
(0, import_react99.useEffect)(() => {
|
|
352738
352970
|
numRenders.current++;
|
|
352739
352971
|
});
|
|
352740
352972
|
useKeypress(
|
|
@@ -352748,7 +352980,7 @@ var DebugProfiler = /* @__PURE__ */ __name(() => {
|
|
|
352748
352980
|
if (!showNumRenders) {
|
|
352749
352981
|
return null;
|
|
352750
352982
|
}
|
|
352751
|
-
return /* @__PURE__ */ (0,
|
|
352983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(Text3, { color: theme.status.warning, children: [
|
|
352752
352984
|
"Renders: ",
|
|
352753
352985
|
numRenders.current,
|
|
352754
352986
|
" "
|
|
@@ -352756,7 +352988,7 @@ var DebugProfiler = /* @__PURE__ */ __name(() => {
|
|
|
352756
352988
|
}, "DebugProfiler");
|
|
352757
352989
|
|
|
352758
352990
|
// packages/cli/src/ui/components/Footer.tsx
|
|
352759
|
-
var
|
|
352991
|
+
var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1);
|
|
352760
352992
|
var Footer = /* @__PURE__ */ __name(() => {
|
|
352761
352993
|
const uiState = useUIState();
|
|
352762
352994
|
const config = useConfig();
|
|
@@ -352798,7 +353030,7 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
352798
353030
|
const displayPath = shortenPath(tildeifyPath(targetDir), pathLength);
|
|
352799
353031
|
const justifyContent = hideCWD && hideModelInfo ? "center" : "space-between";
|
|
352800
353032
|
const displayVimMode = vimEnabled ? vimMode : void 0;
|
|
352801
|
-
return /* @__PURE__ */ (0,
|
|
353033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
352802
353034
|
Box_default,
|
|
352803
353035
|
{
|
|
352804
353036
|
justifyContent,
|
|
@@ -352806,64 +353038,64 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
352806
353038
|
flexDirection: "row",
|
|
352807
353039
|
alignItems: "center",
|
|
352808
353040
|
children: [
|
|
352809
|
-
(debugMode || displayVimMode || !hideCWD) && /* @__PURE__ */ (0,
|
|
352810
|
-
debugMode && /* @__PURE__ */ (0,
|
|
352811
|
-
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: [
|
|
352812
353044
|
"[",
|
|
352813
353045
|
displayVimMode,
|
|
352814
353046
|
"] "
|
|
352815
353047
|
] }),
|
|
352816
|
-
!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: [
|
|
352817
353049
|
displayPath,
|
|
352818
|
-
branchName && /* @__PURE__ */ (0,
|
|
353050
|
+
branchName && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { children: [
|
|
352819
353051
|
" (",
|
|
352820
353052
|
branchName,
|
|
352821
353053
|
"*)"
|
|
352822
353054
|
] })
|
|
352823
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
353055
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.link, children: [
|
|
352824
353056
|
displayPath,
|
|
352825
|
-
branchName && /* @__PURE__ */ (0,
|
|
353057
|
+
branchName && /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352826
353058
|
" (",
|
|
352827
353059
|
branchName,
|
|
352828
353060
|
"*)"
|
|
352829
353061
|
] })
|
|
352830
353062
|
] })),
|
|
352831
|
-
debugMode && /* @__PURE__ */ (0,
|
|
353063
|
+
debugMode && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.status.error, children: " " + (debugMessage || "--debug") })
|
|
352832
353064
|
] }),
|
|
352833
|
-
!hideSandboxStatus && /* @__PURE__ */ (0,
|
|
353065
|
+
!hideSandboxStatus && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
352834
353066
|
Box_default,
|
|
352835
353067
|
{
|
|
352836
353068
|
flexGrow: 1,
|
|
352837
353069
|
alignItems: "center",
|
|
352838
353070
|
justifyContent: "center",
|
|
352839
353071
|
display: "flex",
|
|
352840
|
-
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: [
|
|
352841
353073
|
"macOS Seatbelt",
|
|
352842
353074
|
" ",
|
|
352843
|
-
/* @__PURE__ */ (0,
|
|
353075
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.secondary, children: [
|
|
352844
353076
|
"(",
|
|
352845
353077
|
process36.env["SEATBELT_PROFILE"],
|
|
352846
353078
|
")"
|
|
352847
353079
|
] })
|
|
352848
|
-
] }) : /* @__PURE__ */ (0,
|
|
353080
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.status.error, children: [
|
|
352849
353081
|
"no sandbox",
|
|
352850
|
-
terminalWidth >= 100 && /* @__PURE__ */ (0,
|
|
353082
|
+
terminalWidth >= 100 && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.text.secondary, children: " (see /docs)" })
|
|
352851
353083
|
] })
|
|
352852
353084
|
}
|
|
352853
353085
|
),
|
|
352854
|
-
!hideModelInfo && /* @__PURE__ */ (0,
|
|
352855
|
-
/* @__PURE__ */ (0,
|
|
352856
|
-
/* @__PURE__ */ (0,
|
|
352857
|
-
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: [
|
|
352858
353090
|
"sp (",
|
|
352859
353091
|
systemPromptPreset,
|
|
352860
353092
|
")",
|
|
352861
|
-
/* @__PURE__ */ (0,
|
|
353093
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(Text3, { color: theme.ui.symbol, children: " \xB7 " })
|
|
352862
353094
|
] }),
|
|
352863
|
-
/* @__PURE__ */ (0,
|
|
353095
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(Text3, { color: theme.text.accent, children: [
|
|
352864
353096
|
model,
|
|
352865
353097
|
" ",
|
|
352866
|
-
/* @__PURE__ */ (0,
|
|
353098
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
352867
353099
|
ContextUsageDisplay,
|
|
352868
353100
|
{
|
|
352869
353101
|
promptTokenCount,
|
|
@@ -352873,20 +353105,20 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
352873
353105
|
)
|
|
352874
353106
|
] })
|
|
352875
353107
|
] }),
|
|
352876
|
-
showMemoryUsage && /* @__PURE__ */ (0,
|
|
353108
|
+
showMemoryUsage && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(MemoryUsageDisplay, {})
|
|
352877
353109
|
] }),
|
|
352878
|
-
/* @__PURE__ */ (0,
|
|
352879
|
-
corgiMode && /* @__PURE__ */ (0,
|
|
352880
|
-
/* @__PURE__ */ (0,
|
|
352881
|
-
/* @__PURE__ */ (0,
|
|
352882
|
-
/* @__PURE__ */ (0,
|
|
352883
|
-
/* @__PURE__ */ (0,
|
|
352884
|
-
/* @__PURE__ */ (0,
|
|
352885
|
-
/* @__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 " })
|
|
352886
353118
|
] }),
|
|
352887
|
-
!showErrorDetails && errorCount > 0 && /* @__PURE__ */ (0,
|
|
352888
|
-
/* @__PURE__ */ (0,
|
|
352889
|
-
/* @__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 })
|
|
352890
353122
|
] })
|
|
352891
353123
|
] })
|
|
352892
353124
|
] })
|
|
@@ -352897,7 +353129,7 @@ var Footer = /* @__PURE__ */ __name(() => {
|
|
|
352897
353129
|
|
|
352898
353130
|
// packages/cli/src/ui/components/QueuedMessageDisplay.tsx
|
|
352899
353131
|
init_esbuild_shims();
|
|
352900
|
-
var
|
|
353132
|
+
var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1);
|
|
352901
353133
|
var MAX_DISPLAYED_QUEUED_MESSAGES = 3;
|
|
352902
353134
|
var QueuedMessageDisplay = /* @__PURE__ */ __name(({
|
|
352903
353135
|
messageQueue
|
|
@@ -352905,12 +353137,12 @@ var QueuedMessageDisplay = /* @__PURE__ */ __name(({
|
|
|
352905
353137
|
if (messageQueue.length === 0) {
|
|
352906
353138
|
return null;
|
|
352907
353139
|
}
|
|
352908
|
-
return /* @__PURE__ */ (0,
|
|
353140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(Box_default, { flexDirection: "column", marginTop: 1, children: [
|
|
352909
353141
|
messageQueue.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message2, index) => {
|
|
352910
353142
|
const preview = message2.replace(/\s+/g, " ");
|
|
352911
|
-
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);
|
|
352912
353144
|
}),
|
|
352913
|
-
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: [
|
|
352914
353146
|
"... (+",
|
|
352915
353147
|
messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES,
|
|
352916
353148
|
" more)"
|
|
@@ -352920,12 +353152,12 @@ var QueuedMessageDisplay = /* @__PURE__ */ __name(({
|
|
|
352920
353152
|
|
|
352921
353153
|
// packages/cli/src/ui/components/ConfigInitDisplay.tsx
|
|
352922
353154
|
init_esbuild_shims();
|
|
352923
|
-
var
|
|
352924
|
-
var
|
|
353155
|
+
var import_react100 = __toESM(require_react(), 1);
|
|
353156
|
+
var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1);
|
|
352925
353157
|
var ConfigInitDisplay = /* @__PURE__ */ __name(() => {
|
|
352926
353158
|
const config = useConfig();
|
|
352927
|
-
const [message2, setMessage] = (0,
|
|
352928
|
-
(0,
|
|
353159
|
+
const [message2, setMessage] = (0, import_react100.useState)(t2("Initializing..."));
|
|
353160
|
+
(0, import_react100.useEffect)(() => {
|
|
352929
353161
|
const onChange = /* @__PURE__ */ __name((clients) => {
|
|
352930
353162
|
if (!clients || clients.size === 0) {
|
|
352931
353163
|
setMessage(t2("Initializing..."));
|
|
@@ -352949,15 +353181,15 @@ var ConfigInitDisplay = /* @__PURE__ */ __name(() => {
|
|
|
352949
353181
|
appEvents.off("mcp-client-update", onChange);
|
|
352950
353182
|
};
|
|
352951
353183
|
}, [config]);
|
|
352952
|
-
return /* @__PURE__ */ (0,
|
|
352953
|
-
/* @__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, {}),
|
|
352954
353186
|
" ",
|
|
352955
|
-
/* @__PURE__ */ (0,
|
|
353187
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(Text3, { color: theme.text.primary, children: message2 })
|
|
352956
353188
|
] }) });
|
|
352957
353189
|
}, "ConfigInitDisplay");
|
|
352958
353190
|
|
|
352959
353191
|
// packages/cli/src/ui/components/Composer.tsx
|
|
352960
|
-
var
|
|
353192
|
+
var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1);
|
|
352961
353193
|
var Composer = /* @__PURE__ */ __name(() => {
|
|
352962
353194
|
const config = useConfig();
|
|
352963
353195
|
const settings = useSettings();
|
|
@@ -352969,12 +353201,12 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
352969
353201
|
const isNarrow = isNarrowWidth(terminalWidth);
|
|
352970
353202
|
const debugConsoleMaxHeight = Math.floor(Math.max(terminalWidth * 0.2, 5));
|
|
352971
353203
|
const { contextFileNames, showAutoAcceptIndicator } = uiState;
|
|
352972
|
-
const { containerWidth } = (0,
|
|
353204
|
+
const { containerWidth } = (0, import_react101.useMemo)(
|
|
352973
353205
|
() => calculatePromptWidths(uiState.terminalWidth),
|
|
352974
353206
|
[uiState.terminalWidth]
|
|
352975
353207
|
);
|
|
352976
|
-
return /* @__PURE__ */ (0,
|
|
352977
|
-
!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)(
|
|
352978
353210
|
LoadingIndicator,
|
|
352979
353211
|
{
|
|
352980
353212
|
thought: uiState.streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ || config.getAccessibility()?.disableLoadingPhrases ? void 0 : uiState.thought,
|
|
@@ -352982,9 +353214,15 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
352982
353214
|
elapsedTime: uiState.elapsedTime
|
|
352983
353215
|
}
|
|
352984
353216
|
),
|
|
352985
|
-
!uiState.
|
|
352986
|
-
|
|
352987
|
-
|
|
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)(
|
|
352988
353226
|
Box_default,
|
|
352989
353227
|
{
|
|
352990
353228
|
marginTop: 1,
|
|
@@ -352993,9 +353231,9 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
352993
353231
|
flexDirection: isNarrow ? "column" : "row",
|
|
352994
353232
|
alignItems: isNarrow ? "flex-start" : "center",
|
|
352995
353233
|
children: [
|
|
352996
|
-
/* @__PURE__ */ (0,
|
|
352997
|
-
process.env["OSA_SYSTEM_MD"] && /* @__PURE__ */ (0,
|
|
352998
|
-
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)(
|
|
352999
353237
|
ContextSummaryDisplay,
|
|
353000
353238
|
{
|
|
353001
353239
|
ideContext: uiState.ideContextState,
|
|
@@ -353007,15 +353245,15 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353007
353245
|
}
|
|
353008
353246
|
)
|
|
353009
353247
|
] }),
|
|
353010
|
-
/* @__PURE__ */ (0,
|
|
353011
|
-
showAutoAcceptIndicator !== ApprovalMode.DEFAULT && !uiState.shellModeActive && /* @__PURE__ */ (0,
|
|
353012
|
-
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, {})
|
|
353013
353251
|
] })
|
|
353014
353252
|
]
|
|
353015
353253
|
}
|
|
353016
353254
|
),
|
|
353017
|
-
uiState.showErrorDetails && /* @__PURE__ */ (0,
|
|
353018
|
-
/* @__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)(
|
|
353019
353257
|
DetailedMessagesDisplay,
|
|
353020
353258
|
{
|
|
353021
353259
|
messages: uiState.filteredConsoleMessages,
|
|
@@ -353023,9 +353261,9 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353023
353261
|
width: containerWidth
|
|
353024
353262
|
}
|
|
353025
353263
|
),
|
|
353026
|
-
/* @__PURE__ */ (0,
|
|
353264
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ShowMoreLines, { constrainHeight: uiState.constrainHeight })
|
|
353027
353265
|
] }) }),
|
|
353028
|
-
uiState.isInputActive && /* @__PURE__ */ (0,
|
|
353266
|
+
uiState.isInputActive && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
353029
353267
|
InputPrompt,
|
|
353030
353268
|
{
|
|
353031
353269
|
buffer: uiState.buffer,
|
|
@@ -353047,37 +353285,37 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
353047
353285
|
placeholder: vimEnabled ? " " + t2("Press 'i' for INSERT mode and 'Esc' for NORMAL mode.") : " " + t2("Type your message or @path/to/file")
|
|
353048
353286
|
}
|
|
353049
353287
|
),
|
|
353050
|
-
!settings.merged.ui?.hideFooter && !isScreenReaderEnabled && /* @__PURE__ */ (0,
|
|
353288
|
+
!settings.merged.ui?.hideFooter && !isScreenReaderEnabled && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Footer, {})
|
|
353051
353289
|
] });
|
|
353052
353290
|
}, "Composer");
|
|
353053
353291
|
|
|
353054
353292
|
// packages/cli/src/ui/components/ExitWarning.tsx
|
|
353055
353293
|
init_esbuild_shims();
|
|
353056
|
-
var
|
|
353294
|
+
var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
|
|
353057
353295
|
var ExitWarning = /* @__PURE__ */ __name(() => {
|
|
353058
353296
|
const uiState = useUIState();
|
|
353059
|
-
return /* @__PURE__ */ (0,
|
|
353060
|
-
uiState.dialogsVisible && uiState.ctrlCPressedOnce && /* @__PURE__ */ (0,
|
|
353061
|
-
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." }) })
|
|
353062
353300
|
] });
|
|
353063
353301
|
}, "ExitWarning");
|
|
353064
353302
|
|
|
353065
353303
|
// packages/cli/src/ui/layouts/ScreenReaderAppLayout.tsx
|
|
353066
|
-
var
|
|
353304
|
+
var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1);
|
|
353067
353305
|
var ScreenReaderAppLayout = /* @__PURE__ */ __name(() => {
|
|
353068
353306
|
const uiState = useUIState();
|
|
353069
|
-
return /* @__PURE__ */ (0,
|
|
353070
|
-
/* @__PURE__ */ (0,
|
|
353071
|
-
/* @__PURE__ */ (0,
|
|
353072
|
-
/* @__PURE__ */ (0,
|
|
353073
|
-
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)(
|
|
353074
353312
|
DialogManager,
|
|
353075
353313
|
{
|
|
353076
353314
|
terminalWidth: uiState.terminalWidth,
|
|
353077
353315
|
addItem: uiState.historyManager.addItem
|
|
353078
353316
|
}
|
|
353079
|
-
) : /* @__PURE__ */ (0,
|
|
353080
|
-
/* @__PURE__ */ (0,
|
|
353317
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Composer, {}),
|
|
353318
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ExitWarning, {})
|
|
353081
353319
|
] });
|
|
353082
353320
|
}, "ScreenReaderAppLayout");
|
|
353083
353321
|
|
|
@@ -353086,7 +353324,7 @@ init_esbuild_shims();
|
|
|
353086
353324
|
|
|
353087
353325
|
// packages/cli/src/ui/components/TaskMasterPanel.tsx
|
|
353088
353326
|
init_esbuild_shims();
|
|
353089
|
-
var
|
|
353327
|
+
var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1);
|
|
353090
353328
|
var STATUS_ICONS2 = {
|
|
353091
353329
|
pending: "\u25CB",
|
|
353092
353330
|
in_progress: "\u25D0",
|
|
@@ -353104,13 +353342,13 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353104
353342
|
const totalCount = todos.length;
|
|
353105
353343
|
const progressPercent = Math.round(completedCount / totalCount * 100);
|
|
353106
353344
|
if (compact && activeTodo) {
|
|
353107
|
-
return /* @__PURE__ */ (0,
|
|
353108
|
-
/* @__PURE__ */ (0,
|
|
353109
|
-
/* @__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" }),
|
|
353110
353348
|
" "
|
|
353111
353349
|
] }),
|
|
353112
|
-
/* @__PURE__ */ (0,
|
|
353113
|
-
/* @__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: [
|
|
353114
353352
|
" ",
|
|
353115
353353
|
"(",
|
|
353116
353354
|
completedCount,
|
|
@@ -353120,7 +353358,7 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353120
353358
|
] })
|
|
353121
353359
|
] });
|
|
353122
353360
|
}
|
|
353123
|
-
return /* @__PURE__ */ (0,
|
|
353361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
|
|
353124
353362
|
Box_default,
|
|
353125
353363
|
{
|
|
353126
353364
|
flexDirection: "column",
|
|
@@ -353129,9 +353367,9 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353129
353367
|
paddingX: 1,
|
|
353130
353368
|
marginBottom: 1,
|
|
353131
353369
|
children: [
|
|
353132
|
-
/* @__PURE__ */ (0,
|
|
353133
|
-
/* @__PURE__ */ (0,
|
|
353134
|
-
/* @__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: [
|
|
353135
353373
|
completedCount,
|
|
353136
353374
|
"/",
|
|
353137
353375
|
totalCount,
|
|
@@ -353140,17 +353378,17 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353140
353378
|
"%)"
|
|
353141
353379
|
] })
|
|
353142
353380
|
] }),
|
|
353143
|
-
/* @__PURE__ */ (0,
|
|
353144
|
-
/* @__PURE__ */ (0,
|
|
353145
|
-
/* @__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)) })
|
|
353146
353384
|
] }),
|
|
353147
|
-
/* @__PURE__ */ (0,
|
|
353385
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Box_default, { flexDirection: "column", children: todos.map((todo) => {
|
|
353148
353386
|
const isCompleted = todo.status === "completed";
|
|
353149
353387
|
const isInProgress = todo.status === "in_progress";
|
|
353150
353388
|
const itemColor = isCompleted ? theme.text.secondary : isInProgress ? theme.status.success : theme.text.primary;
|
|
353151
|
-
return /* @__PURE__ */ (0,
|
|
353152
|
-
/* @__PURE__ */ (0,
|
|
353153
|
-
/* @__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)(
|
|
353154
353392
|
Text3,
|
|
353155
353393
|
{
|
|
353156
353394
|
color: itemColor,
|
|
@@ -353167,30 +353405,30 @@ var TaskMasterPanel = /* @__PURE__ */ __name(({
|
|
|
353167
353405
|
}, "TaskMasterPanel");
|
|
353168
353406
|
|
|
353169
353407
|
// packages/cli/src/ui/layouts/DefaultAppLayout.tsx
|
|
353170
|
-
var
|
|
353408
|
+
var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
|
|
353171
353409
|
var DefaultAppLayout = /* @__PURE__ */ __name(({
|
|
353172
353410
|
width = "90%"
|
|
353173
353411
|
}) => {
|
|
353174
353412
|
const uiState = useUIState();
|
|
353175
|
-
return /* @__PURE__ */ (0,
|
|
353176
|
-
/* @__PURE__ */ (0,
|
|
353177
|
-
/* @__PURE__ */ (0,
|
|
353178
|
-
/* @__PURE__ */ (0,
|
|
353179
|
-
/* @__PURE__ */ (0,
|
|
353180
|
-
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)(
|
|
353181
353419
|
DialogManager,
|
|
353182
353420
|
{
|
|
353183
353421
|
terminalWidth: uiState.terminalWidth,
|
|
353184
353422
|
addItem: uiState.historyManager.addItem
|
|
353185
353423
|
}
|
|
353186
|
-
) : /* @__PURE__ */ (0,
|
|
353187
|
-
/* @__PURE__ */ (0,
|
|
353424
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Composer, {}),
|
|
353425
|
+
/* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ExitWarning, {})
|
|
353188
353426
|
] })
|
|
353189
353427
|
] });
|
|
353190
353428
|
}, "DefaultAppLayout");
|
|
353191
353429
|
|
|
353192
353430
|
// packages/cli/src/ui/App.tsx
|
|
353193
|
-
var
|
|
353431
|
+
var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1);
|
|
353194
353432
|
var getContainerWidth = /* @__PURE__ */ __name((terminalWidth) => {
|
|
353195
353433
|
if (terminalWidth <= 80) {
|
|
353196
353434
|
return "98%";
|
|
@@ -353208,9 +353446,9 @@ var App2 = /* @__PURE__ */ __name(() => {
|
|
|
353208
353446
|
const { columns } = useTerminalSize();
|
|
353209
353447
|
const containerWidth = getContainerWidth(columns);
|
|
353210
353448
|
if (uiState.quittingMessages) {
|
|
353211
|
-
return /* @__PURE__ */ (0,
|
|
353449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(QuittingDisplay, {});
|
|
353212
353450
|
}
|
|
353213
|
-
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 }) });
|
|
353214
353452
|
}, "App");
|
|
353215
353453
|
|
|
353216
353454
|
// packages/cli/src/ui/AppContainer.tsx
|
|
@@ -353218,12 +353456,12 @@ import process52 from "node:process";
|
|
|
353218
353456
|
|
|
353219
353457
|
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
353220
353458
|
init_esbuild_shims();
|
|
353221
|
-
var
|
|
353459
|
+
var import_react102 = __toESM(require_react(), 1);
|
|
353222
353460
|
import process37 from "node:process";
|
|
353223
353461
|
var MEMORY_WARNING_THRESHOLD = 7 * 1024 * 1024 * 1024;
|
|
353224
353462
|
var MEMORY_CHECK_INTERVAL = 60 * 1e3;
|
|
353225
353463
|
var useMemoryMonitor = /* @__PURE__ */ __name(({ addItem }) => {
|
|
353226
|
-
(0,
|
|
353464
|
+
(0, import_react102.useEffect)(() => {
|
|
353227
353465
|
const intervalId = setInterval(() => {
|
|
353228
353466
|
const usage2 = process37.memoryUsage().rss;
|
|
353229
353467
|
if (usage2 > MEMORY_WARNING_THRESHOLD) {
|
|
@@ -353243,11 +353481,11 @@ var useMemoryMonitor = /* @__PURE__ */ __name(({ addItem }) => {
|
|
|
353243
353481
|
|
|
353244
353482
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
353245
353483
|
init_esbuild_shims();
|
|
353246
|
-
var
|
|
353484
|
+
var import_react103 = __toESM(require_react(), 1);
|
|
353247
353485
|
import process38 from "node:process";
|
|
353248
353486
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
353249
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
353250
|
-
const openThemeDialog = (0,
|
|
353487
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react103.useState)(!!initialThemeError);
|
|
353488
|
+
const openThemeDialog = (0, import_react103.useCallback)(() => {
|
|
353251
353489
|
if (process38.env["NO_COLOR"]) {
|
|
353252
353490
|
addItem(
|
|
353253
353491
|
{
|
|
@@ -353262,7 +353500,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
353262
353500
|
}
|
|
353263
353501
|
setIsThemeDialogOpen(true);
|
|
353264
353502
|
}, [addItem]);
|
|
353265
|
-
const applyTheme = (0,
|
|
353503
|
+
const applyTheme = (0, import_react103.useCallback)(
|
|
353266
353504
|
(themeName) => {
|
|
353267
353505
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
353268
353506
|
setIsThemeDialogOpen(true);
|
|
@@ -353277,13 +353515,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
353277
353515
|
},
|
|
353278
353516
|
[setThemeError]
|
|
353279
353517
|
);
|
|
353280
|
-
const handleThemeHighlight = (0,
|
|
353518
|
+
const handleThemeHighlight = (0, import_react103.useCallback)(
|
|
353281
353519
|
(themeName) => {
|
|
353282
353520
|
applyTheme(themeName);
|
|
353283
353521
|
},
|
|
353284
353522
|
[applyTheme]
|
|
353285
353523
|
);
|
|
353286
|
-
const handleThemeSelect = (0,
|
|
353524
|
+
const handleThemeSelect = (0, import_react103.useCallback)(
|
|
353287
353525
|
(themeName, scope) => {
|
|
353288
353526
|
try {
|
|
353289
353527
|
const mergedCustomThemes = {
|
|
@@ -353323,19 +353561,19 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
353323
353561
|
|
|
353324
353562
|
// packages/cli/src/ui/auth/useAuth.ts
|
|
353325
353563
|
init_esbuild_shims();
|
|
353326
|
-
var
|
|
353564
|
+
var import_react105 = __toESM(require_react(), 1);
|
|
353327
353565
|
|
|
353328
353566
|
// packages/cli/src/ui/hooks/useQwenAuth.ts
|
|
353329
353567
|
init_esbuild_shims();
|
|
353330
|
-
var
|
|
353568
|
+
var import_react104 = __toESM(require_react(), 1);
|
|
353331
353569
|
var useOSAAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
|
|
353332
|
-
const [OSAAuthState, setOSAAuthState] = (0,
|
|
353570
|
+
const [OSAAuthState, setOSAAuthState] = (0, import_react104.useState)({
|
|
353333
353571
|
deviceAuth: null,
|
|
353334
353572
|
authStatus: "idle",
|
|
353335
353573
|
authMessage: null
|
|
353336
353574
|
});
|
|
353337
353575
|
const isOSAAuth = pendingAuthType === AuthType2.OSA_OAUTH;
|
|
353338
|
-
(0,
|
|
353576
|
+
(0, import_react104.useEffect)(() => {
|
|
353339
353577
|
if (!isOSAAuth || !isAuthenticating) {
|
|
353340
353578
|
setOSAAuthState({
|
|
353341
353579
|
deviceAuth: null,
|
|
@@ -353375,7 +353613,7 @@ var useOSAAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
|
|
|
353375
353613
|
OSAOAuth2Events.off(OSAOAuth2Event.AuthProgress, handleAuthProgress);
|
|
353376
353614
|
};
|
|
353377
353615
|
}, [isOSAAuth, isAuthenticating]);
|
|
353378
|
-
const cancelOSAAuth = (0,
|
|
353616
|
+
const cancelOSAAuth = (0, import_react104.useCallback)(() => {
|
|
353379
353617
|
OSAOAuth2Events.emit(OSAOAuth2Event.AuthCancel);
|
|
353380
353618
|
setOSAAuthState({
|
|
353381
353619
|
deviceAuth: null,
|
|
@@ -353392,20 +353630,20 @@ var useOSAAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
|
|
|
353392
353630
|
// packages/cli/src/ui/auth/useAuth.ts
|
|
353393
353631
|
var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
353394
353632
|
const unAuthenticated = settings.merged.security?.auth?.selectedType === void 0;
|
|
353395
|
-
const [authState, setAuthState] = (0,
|
|
353633
|
+
const [authState, setAuthState] = (0, import_react105.useState)(
|
|
353396
353634
|
unAuthenticated ? "updating" /* Updating */ : "unauthenticated" /* Unauthenticated */
|
|
353397
353635
|
);
|
|
353398
|
-
const [authError, setAuthError] = (0,
|
|
353399
|
-
const [isAuthenticating, setIsAuthenticating] = (0,
|
|
353400
|
-
const [isAuthDialogOpen, setIsAuthDialogOpen] = (0,
|
|
353401
|
-
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)(
|
|
353402
353640
|
void 0
|
|
353403
353641
|
);
|
|
353404
353642
|
const { OSAAuthState, cancelOSAAuth } = useOSAAuth(
|
|
353405
353643
|
pendingAuthType,
|
|
353406
353644
|
isAuthenticating
|
|
353407
353645
|
);
|
|
353408
|
-
const onAuthError = (0,
|
|
353646
|
+
const onAuthError = (0, import_react105.useCallback)(
|
|
353409
353647
|
(error) => {
|
|
353410
353648
|
setAuthError(error);
|
|
353411
353649
|
if (error) {
|
|
@@ -353415,7 +353653,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353415
353653
|
},
|
|
353416
353654
|
[setAuthError, setAuthState]
|
|
353417
353655
|
);
|
|
353418
|
-
const handleAuthFailure = (0,
|
|
353656
|
+
const handleAuthFailure = (0, import_react105.useCallback)(
|
|
353419
353657
|
(error) => {
|
|
353420
353658
|
setIsAuthenticating(false);
|
|
353421
353659
|
const errorMessage = t2("Failed to authenticate. Message: {{message}}", {
|
|
@@ -353434,7 +353672,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353434
353672
|
},
|
|
353435
353673
|
[onAuthError, pendingAuthType, config]
|
|
353436
353674
|
);
|
|
353437
|
-
const handleAuthSuccess = (0,
|
|
353675
|
+
const handleAuthSuccess = (0, import_react105.useCallback)(
|
|
353438
353676
|
async (authType, scope, credentials) => {
|
|
353439
353677
|
try {
|
|
353440
353678
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
@@ -353481,7 +353719,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353481
353719
|
},
|
|
353482
353720
|
[settings, handleAuthFailure, config, addItem]
|
|
353483
353721
|
);
|
|
353484
|
-
const performAuth = (0,
|
|
353722
|
+
const performAuth = (0, import_react105.useCallback)(
|
|
353485
353723
|
async (authType, scope, credentials) => {
|
|
353486
353724
|
try {
|
|
353487
353725
|
await config.refreshAuth(authType);
|
|
@@ -353492,7 +353730,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353492
353730
|
},
|
|
353493
353731
|
[config, handleAuthSuccess, handleAuthFailure]
|
|
353494
353732
|
);
|
|
353495
|
-
const handleAuthSelect = (0,
|
|
353733
|
+
const handleAuthSelect = (0, import_react105.useCallback)(
|
|
353496
353734
|
async (authType, scope, credentials) => {
|
|
353497
353735
|
if (!authType) {
|
|
353498
353736
|
setIsAuthDialogOpen(false);
|
|
@@ -353529,10 +353767,10 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353529
353767
|
},
|
|
353530
353768
|
[config, performAuth]
|
|
353531
353769
|
);
|
|
353532
|
-
const openAuthDialog = (0,
|
|
353770
|
+
const openAuthDialog = (0, import_react105.useCallback)(() => {
|
|
353533
353771
|
setIsAuthDialogOpen(true);
|
|
353534
353772
|
}, []);
|
|
353535
|
-
const cancelAuthentication = (0,
|
|
353773
|
+
const cancelAuthentication = (0, import_react105.useCallback)(() => {
|
|
353536
353774
|
if (isAuthenticating && pendingAuthType === AuthType2.OSA_OAUTH) {
|
|
353537
353775
|
cancelOSAAuth();
|
|
353538
353776
|
}
|
|
@@ -353544,7 +353782,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353544
353782
|
setIsAuthDialogOpen(true);
|
|
353545
353783
|
setAuthError(null);
|
|
353546
353784
|
}, [isAuthenticating, pendingAuthType, cancelOSAAuth, config]);
|
|
353547
|
-
(0,
|
|
353785
|
+
(0, import_react105.useEffect)(() => {
|
|
353548
353786
|
const defaultAuthType = process.env["OSA_DEFAULT_AUTH_TYPE"];
|
|
353549
353787
|
if (defaultAuthType && ![AuthType2.OSA_OAUTH, AuthType2.USE_OPENAI].includes(
|
|
353550
353788
|
defaultAuthType
|
|
@@ -353577,7 +353815,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
353577
353815
|
|
|
353578
353816
|
// packages/cli/src/ui/hooks/useQuotaAndFallback.ts
|
|
353579
353817
|
init_esbuild_shims();
|
|
353580
|
-
var
|
|
353818
|
+
var import_react106 = __toESM(require_react(), 1);
|
|
353581
353819
|
function useQuotaAndFallback({
|
|
353582
353820
|
config,
|
|
353583
353821
|
historyManager,
|
|
@@ -353585,9 +353823,9 @@ function useQuotaAndFallback({
|
|
|
353585
353823
|
setAuthState,
|
|
353586
353824
|
setModelSwitchedFromQuotaError
|
|
353587
353825
|
}) {
|
|
353588
|
-
const [proQuotaRequest, setProQuotaRequest] = (0,
|
|
353589
|
-
const isDialogPending = (0,
|
|
353590
|
-
(0,
|
|
353826
|
+
const [proQuotaRequest, setProQuotaRequest] = (0, import_react106.useState)(null);
|
|
353827
|
+
const isDialogPending = (0, import_react106.useRef)(false);
|
|
353828
|
+
(0, import_react106.useEffect)(() => {
|
|
353591
353829
|
const fallbackHandler = /* @__PURE__ */ __name(async (failedModel, fallbackModel, error) => {
|
|
353592
353830
|
if (config.isInFallbackMode()) {
|
|
353593
353831
|
return null;
|
|
@@ -353665,7 +353903,7 @@ function useQuotaAndFallback({
|
|
|
353665
353903
|
}, "fallbackHandler");
|
|
353666
353904
|
config.setFallbackModelHandler(fallbackHandler);
|
|
353667
353905
|
}, [config, historyManager, userTier, setModelSwitchedFromQuotaError]);
|
|
353668
|
-
const handleProQuotaChoice = (0,
|
|
353906
|
+
const handleProQuotaChoice = (0, import_react106.useCallback)(
|
|
353669
353907
|
(choice2) => {
|
|
353670
353908
|
if (!proQuotaRequest) return;
|
|
353671
353909
|
const intent = choice2 === "auth" ? "auth" : "retry";
|
|
@@ -353695,13 +353933,13 @@ __name(useQuotaAndFallback, "useQuotaAndFallback");
|
|
|
353695
353933
|
|
|
353696
353934
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
353697
353935
|
init_esbuild_shims();
|
|
353698
|
-
var
|
|
353936
|
+
var import_react107 = __toESM(require_react(), 1);
|
|
353699
353937
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
353700
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
353701
|
-
const openEditorDialog = (0,
|
|
353938
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react107.useState)(false);
|
|
353939
|
+
const openEditorDialog = (0, import_react107.useCallback)(() => {
|
|
353702
353940
|
setIsEditorDialogOpen(true);
|
|
353703
353941
|
}, []);
|
|
353704
|
-
const handleEditorSelect = (0,
|
|
353942
|
+
const handleEditorSelect = (0, import_react107.useCallback)(
|
|
353705
353943
|
(editorType, scope) => {
|
|
353706
353944
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
353707
353945
|
return;
|
|
@@ -353723,7 +353961,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
353723
353961
|
},
|
|
353724
353962
|
[loadedSettings, setEditorError, addItem]
|
|
353725
353963
|
);
|
|
353726
|
-
const exitEditorDialog = (0,
|
|
353964
|
+
const exitEditorDialog = (0, import_react107.useCallback)(() => {
|
|
353727
353965
|
setIsEditorDialogOpen(false);
|
|
353728
353966
|
}, []);
|
|
353729
353967
|
return {
|
|
@@ -353736,13 +353974,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
353736
353974
|
|
|
353737
353975
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
353738
353976
|
init_esbuild_shims();
|
|
353739
|
-
var
|
|
353977
|
+
var import_react108 = __toESM(require_react(), 1);
|
|
353740
353978
|
function useSettingsCommand() {
|
|
353741
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
353742
|
-
const openSettingsDialog = (0,
|
|
353979
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react108.useState)(false);
|
|
353980
|
+
const openSettingsDialog = (0, import_react108.useCallback)(() => {
|
|
353743
353981
|
setIsSettingsDialogOpen(true);
|
|
353744
353982
|
}, []);
|
|
353745
|
-
const closeSettingsDialog = (0,
|
|
353983
|
+
const closeSettingsDialog = (0, import_react108.useCallback)(() => {
|
|
353746
353984
|
setIsSettingsDialogOpen(false);
|
|
353747
353985
|
}, []);
|
|
353748
353986
|
return {
|
|
@@ -353755,13 +353993,13 @@ __name(useSettingsCommand, "useSettingsCommand");
|
|
|
353755
353993
|
|
|
353756
353994
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
353757
353995
|
init_esbuild_shims();
|
|
353758
|
-
var
|
|
353996
|
+
var import_react109 = __toESM(require_react(), 1);
|
|
353759
353997
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
353760
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
353761
|
-
const openModelDialog = (0,
|
|
353998
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react109.useState)(false);
|
|
353999
|
+
const openModelDialog = (0, import_react109.useCallback)(() => {
|
|
353762
354000
|
setIsModelDialogOpen(true);
|
|
353763
354001
|
}, []);
|
|
353764
|
-
const closeModelDialog = (0,
|
|
354002
|
+
const closeModelDialog = (0, import_react109.useCallback)(() => {
|
|
353765
354003
|
setIsModelDialogOpen(false);
|
|
353766
354004
|
}, []);
|
|
353767
354005
|
return {
|
|
@@ -353773,13 +354011,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
353773
354011
|
|
|
353774
354012
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
353775
354013
|
init_esbuild_shims();
|
|
353776
|
-
var
|
|
354014
|
+
var import_react110 = __toESM(require_react(), 1);
|
|
353777
354015
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
353778
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
353779
|
-
const openApprovalModeDialog = (0,
|
|
354016
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react110.useState)(false);
|
|
354017
|
+
const openApprovalModeDialog = (0, import_react110.useCallback)(() => {
|
|
353780
354018
|
setIsApprovalModeDialogOpen(true);
|
|
353781
354019
|
}, []);
|
|
353782
|
-
const handleApprovalModeSelect = (0,
|
|
354020
|
+
const handleApprovalModeSelect = (0, import_react110.useCallback)(
|
|
353783
354021
|
(mode, scope) => {
|
|
353784
354022
|
try {
|
|
353785
354023
|
if (!mode) {
|
|
@@ -353805,7 +354043,7 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
353805
354043
|
|
|
353806
354044
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
353807
354045
|
init_esbuild_shims();
|
|
353808
|
-
var
|
|
354046
|
+
var import_react111 = __toESM(require_react(), 1);
|
|
353809
354047
|
init_node();
|
|
353810
354048
|
import process39 from "node:process";
|
|
353811
354049
|
|
|
@@ -354049,41 +354287,41 @@ var McpPromptLoader = class {
|
|
|
354049
354287
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
354050
354288
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, setIsProcessing, setOSAMdFileCount, actions, extensionsUpdateState, isConfigInitialized) => {
|
|
354051
354289
|
const session = useSessionStats();
|
|
354052
|
-
const [commands, setCommands] = (0,
|
|
354053
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
354054
|
-
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)(() => {
|
|
354055
354293
|
setReloadTrigger((v) => v + 1);
|
|
354056
354294
|
}, []);
|
|
354057
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
354058
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
354059
|
-
const [quitConfirmationRequest, setQuitConfirmationRequest] = (0,
|
|
354060
|
-
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)(
|
|
354061
354299
|
/* @__PURE__ */ new Set()
|
|
354062
354300
|
);
|
|
354063
|
-
const gitService = (0,
|
|
354301
|
+
const gitService = (0, import_react111.useMemo)(() => {
|
|
354064
354302
|
if (!config?.getProjectRoot()) {
|
|
354065
354303
|
return;
|
|
354066
354304
|
}
|
|
354067
354305
|
return new GitService(config.getProjectRoot(), config.storage);
|
|
354068
354306
|
}, [config]);
|
|
354069
|
-
const logger6 = (0,
|
|
354307
|
+
const logger6 = (0, import_react111.useMemo)(() => {
|
|
354070
354308
|
const l2 = new Logger(
|
|
354071
354309
|
config?.getSessionId() || "",
|
|
354072
354310
|
config?.storage ?? new Storage(process39.cwd())
|
|
354073
354311
|
);
|
|
354074
354312
|
return l2;
|
|
354075
354313
|
}, [config]);
|
|
354076
|
-
const [pendingItem, setPendingItem] = (0,
|
|
354314
|
+
const [pendingItem, setPendingItem] = (0, import_react111.useState)(
|
|
354077
354315
|
null
|
|
354078
354316
|
);
|
|
354079
|
-
const pendingHistoryItems = (0,
|
|
354317
|
+
const pendingHistoryItems = (0, import_react111.useMemo)(() => {
|
|
354080
354318
|
const items = [];
|
|
354081
354319
|
if (pendingItem != null) {
|
|
354082
354320
|
items.push(pendingItem);
|
|
354083
354321
|
}
|
|
354084
354322
|
return items;
|
|
354085
354323
|
}, [pendingItem]);
|
|
354086
|
-
const addMessage = (0,
|
|
354324
|
+
const addMessage = (0, import_react111.useCallback)(
|
|
354087
354325
|
(message2) => {
|
|
354088
354326
|
let historyItemContent;
|
|
354089
354327
|
if (message2.type === "about" /* ABOUT */) {
|
|
@@ -354139,7 +354377,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
354139
354377
|
},
|
|
354140
354378
|
[addItem]
|
|
354141
354379
|
);
|
|
354142
|
-
const commandContext = (0,
|
|
354380
|
+
const commandContext = (0, import_react111.useMemo)(
|
|
354143
354381
|
() => ({
|
|
354144
354382
|
services: {
|
|
354145
354383
|
config,
|
|
@@ -354192,7 +354430,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
354192
354430
|
extensionsUpdateState
|
|
354193
354431
|
]
|
|
354194
354432
|
);
|
|
354195
|
-
(0,
|
|
354433
|
+
(0, import_react111.useEffect)(() => {
|
|
354196
354434
|
if (!config) {
|
|
354197
354435
|
return;
|
|
354198
354436
|
}
|
|
@@ -354210,7 +354448,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
354210
354448
|
})();
|
|
354211
354449
|
};
|
|
354212
354450
|
}, [config, reloadCommands]);
|
|
354213
|
-
(0,
|
|
354451
|
+
(0, import_react111.useEffect)(() => {
|
|
354214
354452
|
const controller = new AbortController();
|
|
354215
354453
|
const load = /* @__PURE__ */ __name(async () => {
|
|
354216
354454
|
const loaders = [
|
|
@@ -354229,7 +354467,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
354229
354467
|
controller.abort();
|
|
354230
354468
|
};
|
|
354231
354469
|
}, [config, reloadTrigger, isConfigInitialized]);
|
|
354232
|
-
const handleSlashCommand2 = (0,
|
|
354470
|
+
const handleSlashCommand2 = (0, import_react111.useCallback)(
|
|
354233
354471
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed) => {
|
|
354234
354472
|
if (typeof rawQuery !== "string") {
|
|
354235
354473
|
return false;
|
|
@@ -354538,7 +354776,7 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
354538
354776
|
|
|
354539
354777
|
// packages/cli/src/ui/hooks/useConsoleMessages.ts
|
|
354540
354778
|
init_esbuild_shims();
|
|
354541
|
-
var
|
|
354779
|
+
var import_react112 = __toESM(require_react(), 1);
|
|
354542
354780
|
function consoleMessagesReducer(state, action) {
|
|
354543
354781
|
switch (action.type) {
|
|
354544
354782
|
case "ADD_MESSAGES": {
|
|
@@ -354564,11 +354802,11 @@ function consoleMessagesReducer(state, action) {
|
|
|
354564
354802
|
}
|
|
354565
354803
|
__name(consoleMessagesReducer, "consoleMessagesReducer");
|
|
354566
354804
|
function useConsoleMessages() {
|
|
354567
|
-
const [consoleMessages, dispatch] = (0,
|
|
354568
|
-
const messageQueueRef = (0,
|
|
354569
|
-
const timeoutRef = (0,
|
|
354570
|
-
const [, startTransition] = (0,
|
|
354571
|
-
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)(() => {
|
|
354572
354810
|
if (messageQueueRef.current.length > 0) {
|
|
354573
354811
|
const messagesToProcess = messageQueueRef.current;
|
|
354574
354812
|
messageQueueRef.current = [];
|
|
@@ -354578,7 +354816,7 @@ function useConsoleMessages() {
|
|
|
354578
354816
|
}
|
|
354579
354817
|
timeoutRef.current = null;
|
|
354580
354818
|
}, []);
|
|
354581
|
-
const handleNewMessage = (0,
|
|
354819
|
+
const handleNewMessage = (0, import_react112.useCallback)(
|
|
354582
354820
|
(message2) => {
|
|
354583
354821
|
messageQueueRef.current.push(message2);
|
|
354584
354822
|
if (!timeoutRef.current) {
|
|
@@ -354587,7 +354825,7 @@ function useConsoleMessages() {
|
|
|
354587
354825
|
},
|
|
354588
354826
|
[processQueue]
|
|
354589
354827
|
);
|
|
354590
|
-
const clearConsoleMessages = (0,
|
|
354828
|
+
const clearConsoleMessages = (0, import_react112.useCallback)(() => {
|
|
354591
354829
|
if (timeoutRef.current) {
|
|
354592
354830
|
clearTimeout(timeoutRef.current);
|
|
354593
354831
|
timeoutRef.current = null;
|
|
@@ -354597,7 +354835,7 @@ function useConsoleMessages() {
|
|
|
354597
354835
|
dispatch({ type: "CLEAR" });
|
|
354598
354836
|
});
|
|
354599
354837
|
}, []);
|
|
354600
|
-
(0,
|
|
354838
|
+
(0, import_react112.useEffect)(
|
|
354601
354839
|
() => () => {
|
|
354602
354840
|
if (timeoutRef.current) {
|
|
354603
354841
|
clearTimeout(timeoutRef.current);
|
|
@@ -354627,10 +354865,10 @@ __name(computeWindowTitle, "computeWindowTitle");
|
|
|
354627
354865
|
|
|
354628
354866
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
354629
354867
|
init_esbuild_shims();
|
|
354630
|
-
var
|
|
354868
|
+
var import_react113 = __toESM(require_react(), 1);
|
|
354631
354869
|
var useLogger = /* @__PURE__ */ __name((storage) => {
|
|
354632
|
-
const [logger6, setLogger] = (0,
|
|
354633
|
-
(0,
|
|
354870
|
+
const [logger6, setLogger] = (0, import_react113.useState)(null);
|
|
354871
|
+
(0, import_react113.useEffect)(() => {
|
|
354634
354872
|
const newLogger = new Logger(sessionId, storage);
|
|
354635
354873
|
newLogger.initialize().then(() => {
|
|
354636
354874
|
setLogger(newLogger);
|
|
@@ -354642,12 +354880,12 @@ var useLogger = /* @__PURE__ */ __name((storage) => {
|
|
|
354642
354880
|
|
|
354643
354881
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
354644
354882
|
init_esbuild_shims();
|
|
354645
|
-
var
|
|
354883
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
354646
354884
|
init_node();
|
|
354647
354885
|
|
|
354648
354886
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
354649
354887
|
init_esbuild_shims();
|
|
354650
|
-
var
|
|
354888
|
+
var import_react114 = __toESM(require_react(), 1);
|
|
354651
354889
|
init_node();
|
|
354652
354890
|
import crypto17 from "node:crypto";
|
|
354653
354891
|
import path98 from "node:path";
|
|
@@ -354676,8 +354914,8 @@ ${modelContent}
|
|
|
354676
354914
|
}
|
|
354677
354915
|
__name(addShellCommandToOSAHistory, "addShellCommandToOSAHistory");
|
|
354678
354916
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, OSAClient2, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
354679
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
354680
|
-
const handleShellCommand = (0,
|
|
354917
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react114.useState)(null);
|
|
354918
|
+
const handleShellCommand = (0, import_react114.useCallback)(
|
|
354681
354919
|
(rawQuery, abortSignal) => {
|
|
354682
354920
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
354683
354921
|
return false;
|
|
@@ -354926,7 +355164,7 @@ ${finalOutput}`;
|
|
|
354926
355164
|
// packages/cli/src/ui/hooks/useVisionAutoSwitch.ts
|
|
354927
355165
|
init_esbuild_shims();
|
|
354928
355166
|
init_node();
|
|
354929
|
-
var
|
|
355167
|
+
var import_react115 = __toESM(require_react(), 1);
|
|
354930
355168
|
function hasImageParts(parts) {
|
|
354931
355169
|
if (typeof parts === "string") {
|
|
354932
355170
|
return false;
|
|
@@ -355015,8 +355253,8 @@ function processVisionSwitchOutcome(outcome) {
|
|
|
355015
355253
|
}
|
|
355016
355254
|
__name(processVisionSwitchOutcome, "processVisionSwitchOutcome");
|
|
355017
355255
|
function useVisionAutoSwitch(config, addItem, visionModelPreviewEnabled = true, onVisionSwitchRequired) {
|
|
355018
|
-
const originalModelRef = (0,
|
|
355019
|
-
const handleVisionSwitch = (0,
|
|
355256
|
+
const originalModelRef = (0, import_react115.useRef)(null);
|
|
355257
|
+
const handleVisionSwitch = (0, import_react115.useCallback)(
|
|
355020
355258
|
async (query, userMessageTimestamp, isContinuation) => {
|
|
355021
355259
|
if (isContinuation || !onVisionSwitchRequired) {
|
|
355022
355260
|
return { shouldProceed: true };
|
|
@@ -355117,7 +355355,7 @@ function useVisionAutoSwitch(config, addItem, visionModelPreviewEnabled = true,
|
|
|
355117
355355
|
},
|
|
355118
355356
|
[config, addItem, visionModelPreviewEnabled, onVisionSwitchRequired]
|
|
355119
355357
|
);
|
|
355120
|
-
const restoreOriginalModel = (0,
|
|
355358
|
+
const restoreOriginalModel = (0, import_react115.useCallback)(async () => {
|
|
355121
355359
|
if (originalModelRef.current) {
|
|
355122
355360
|
await config.setModel(originalModelRef.current, {
|
|
355123
355361
|
reason: "vision_auto_switch",
|
|
@@ -355194,11 +355432,11 @@ var findLastSafeSplitPoint = /* @__PURE__ */ __name((content) => {
|
|
|
355194
355432
|
|
|
355195
355433
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
355196
355434
|
init_esbuild_shims();
|
|
355197
|
-
var
|
|
355435
|
+
var import_react116 = __toESM(require_react(), 1);
|
|
355198
355436
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
355199
|
-
const [state, setState] =
|
|
355200
|
-
const ref =
|
|
355201
|
-
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(
|
|
355202
355440
|
(newStateOrCallback) => {
|
|
355203
355441
|
let newValue;
|
|
355204
355442
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -355216,10 +355454,10 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
355216
355454
|
|
|
355217
355455
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
355218
355456
|
init_esbuild_shims();
|
|
355219
|
-
var
|
|
355457
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
355220
355458
|
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
355221
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
355222
|
-
const outputUpdateHandler = (0,
|
|
355459
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react117.useState)([]);
|
|
355460
|
+
const outputUpdateHandler = (0, import_react117.useCallback)(
|
|
355223
355461
|
(toolCallId, outputChunk) => {
|
|
355224
355462
|
setToolCallsForDisplay(
|
|
355225
355463
|
(prevCalls) => prevCalls.map((tc) => {
|
|
@@ -355233,13 +355471,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
355233
355471
|
},
|
|
355234
355472
|
[]
|
|
355235
355473
|
);
|
|
355236
|
-
const allToolCallsCompleteHandler = (0,
|
|
355474
|
+
const allToolCallsCompleteHandler = (0, import_react117.useCallback)(
|
|
355237
355475
|
async (completedToolCalls) => {
|
|
355238
355476
|
await onComplete(completedToolCalls);
|
|
355239
355477
|
},
|
|
355240
355478
|
[onComplete]
|
|
355241
355479
|
);
|
|
355242
|
-
const toolCallsUpdateHandler = (0,
|
|
355480
|
+
const toolCallsUpdateHandler = (0, import_react117.useCallback)(
|
|
355243
355481
|
(updatedCoreToolCalls) => {
|
|
355244
355482
|
setToolCallsForDisplay(
|
|
355245
355483
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -355266,7 +355504,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
355266
355504
|
},
|
|
355267
355505
|
[setToolCallsForDisplay]
|
|
355268
355506
|
);
|
|
355269
|
-
const scheduler = (0,
|
|
355507
|
+
const scheduler = (0, import_react117.useMemo)(
|
|
355270
355508
|
() => new CoreToolScheduler({
|
|
355271
355509
|
outputUpdateHandler,
|
|
355272
355510
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
@@ -355285,13 +355523,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
355285
355523
|
onEditorClose
|
|
355286
355524
|
]
|
|
355287
355525
|
);
|
|
355288
|
-
const schedule = (0,
|
|
355526
|
+
const schedule = (0, import_react117.useCallback)(
|
|
355289
355527
|
(request4, signal) => {
|
|
355290
355528
|
void scheduler.schedule(request4, signal);
|
|
355291
355529
|
},
|
|
355292
355530
|
[scheduler]
|
|
355293
355531
|
);
|
|
355294
|
-
const markToolsAsSubmitted = (0,
|
|
355532
|
+
const markToolsAsSubmitted = (0, import_react117.useCallback)(
|
|
355295
355533
|
(callIdsToMark) => {
|
|
355296
355534
|
setToolCallsForDisplay(
|
|
355297
355535
|
(prevCalls) => prevCalls.map(
|
|
@@ -355431,18 +355669,18 @@ function showCitations(settings) {
|
|
|
355431
355669
|
}
|
|
355432
355670
|
__name(showCitations, "showCitations");
|
|
355433
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) => {
|
|
355434
|
-
const [initError, setInitError] = (0,
|
|
355435
|
-
const abortControllerRef = (0,
|
|
355436
|
-
const turnCancelledRef = (0,
|
|
355437
|
-
const isSubmittingQueryRef = (0,
|
|
355438
|
-
const [isResponding, setIsResponding] = (0,
|
|
355439
|
-
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);
|
|
355440
355678
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
355441
|
-
const processedMemoryToolsRef = (0,
|
|
355679
|
+
const processedMemoryToolsRef = (0, import_react118.useRef)(/* @__PURE__ */ new Set());
|
|
355442
355680
|
const { startNewPrompt, getPromptCount } = useSessionStats();
|
|
355443
355681
|
const storage = config.storage;
|
|
355444
355682
|
const logger6 = useLogger(storage);
|
|
355445
|
-
const gitService = (0,
|
|
355683
|
+
const gitService = (0, import_react118.useMemo)(() => {
|
|
355446
355684
|
if (!config.getProjectRoot()) {
|
|
355447
355685
|
return;
|
|
355448
355686
|
}
|
|
@@ -355466,11 +355704,11 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355466
355704
|
getPreferredEditor,
|
|
355467
355705
|
onEditorClose
|
|
355468
355706
|
);
|
|
355469
|
-
const pendingToolCallGroupDisplay = (0,
|
|
355707
|
+
const pendingToolCallGroupDisplay = (0, import_react118.useMemo)(
|
|
355470
355708
|
() => toolCalls.length ? mapToDisplay(toolCalls) : void 0,
|
|
355471
355709
|
[toolCalls]
|
|
355472
355710
|
);
|
|
355473
|
-
const activeToolPtyId = (0,
|
|
355711
|
+
const activeToolPtyId = (0, import_react118.useMemo)(() => {
|
|
355474
355712
|
const executingShellTool = toolCalls?.find(
|
|
355475
355713
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
355476
355714
|
);
|
|
@@ -355479,12 +355717,12 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355479
355717
|
}
|
|
355480
355718
|
return void 0;
|
|
355481
355719
|
}, [toolCalls]);
|
|
355482
|
-
const loopDetectedRef = (0,
|
|
355720
|
+
const loopDetectedRef = (0, import_react118.useRef)(false);
|
|
355483
355721
|
const [
|
|
355484
355722
|
loopDetectionConfirmationRequest,
|
|
355485
355723
|
setLoopDetectionConfirmationRequest
|
|
355486
|
-
] = (0,
|
|
355487
|
-
const onExec = (0,
|
|
355724
|
+
] = (0, import_react118.useState)(null);
|
|
355725
|
+
const onExec = (0, import_react118.useCallback)(async (done) => {
|
|
355488
355726
|
setIsResponding(true);
|
|
355489
355727
|
await done;
|
|
355490
355728
|
setIsResponding(false);
|
|
@@ -355507,12 +355745,12 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355507
355745
|
onVisionSwitchRequired
|
|
355508
355746
|
);
|
|
355509
355747
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
355510
|
-
(0,
|
|
355748
|
+
(0, import_react118.useEffect)(() => {
|
|
355511
355749
|
if (!activePtyId) {
|
|
355512
355750
|
setShellInputFocused(false);
|
|
355513
355751
|
}
|
|
355514
355752
|
}, [activePtyId, setShellInputFocused]);
|
|
355515
|
-
const streamingState = (0,
|
|
355753
|
+
const streamingState = (0, import_react118.useMemo)(() => {
|
|
355516
355754
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
355517
355755
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
355518
355756
|
}
|
|
@@ -355523,7 +355761,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355523
355761
|
}
|
|
355524
355762
|
return "idle" /* Idle */;
|
|
355525
355763
|
}, [isResponding, toolCalls]);
|
|
355526
|
-
(0,
|
|
355764
|
+
(0, import_react118.useEffect)(() => {
|
|
355527
355765
|
if (config.getApprovalMode() === ApprovalMode.YOLO && streamingState === "idle" /* Idle */) {
|
|
355528
355766
|
const lastUserMessageIndex = history.findLastIndex(
|
|
355529
355767
|
(item) => item.type === "user" /* USER */
|
|
@@ -355537,7 +355775,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355537
355775
|
}
|
|
355538
355776
|
}
|
|
355539
355777
|
}, [streamingState, config, history]);
|
|
355540
|
-
const cancelOngoingRequest = (0,
|
|
355778
|
+
const cancelOngoingRequest = (0, import_react118.useCallback)(() => {
|
|
355541
355779
|
if (streamingState !== "responding" /* Responding */) {
|
|
355542
355780
|
return;
|
|
355543
355781
|
}
|
|
@@ -355586,7 +355824,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355586
355824
|
},
|
|
355587
355825
|
{ isActive: streamingState === "responding" /* Responding */ }
|
|
355588
355826
|
);
|
|
355589
|
-
const prepareQueryForOSA = (0,
|
|
355827
|
+
const prepareQueryForOSA = (0, import_react118.useCallback)(
|
|
355590
355828
|
async (query, userMessageTimestamp, abortSignal, prompt_id) => {
|
|
355591
355829
|
if (turnCancelledRef.current) {
|
|
355592
355830
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -355681,7 +355919,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355681
355919
|
scheduleToolCalls
|
|
355682
355920
|
]
|
|
355683
355921
|
);
|
|
355684
|
-
const handleContentEvent = (0,
|
|
355922
|
+
const handleContentEvent = (0, import_react118.useCallback)(
|
|
355685
355923
|
(eventValue, currentOSAMessageBuffer, userMessageTimestamp) => {
|
|
355686
355924
|
if (turnCancelledRef.current) {
|
|
355687
355925
|
return "";
|
|
@@ -355717,7 +355955,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355717
355955
|
},
|
|
355718
355956
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
355719
355957
|
);
|
|
355720
|
-
const handleUserCancelledEvent = (0,
|
|
355958
|
+
const handleUserCancelledEvent = (0, import_react118.useCallback)(
|
|
355721
355959
|
(userMessageTimestamp) => {
|
|
355722
355960
|
if (turnCancelledRef.current) {
|
|
355723
355961
|
return;
|
|
@@ -355746,7 +355984,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355746
355984
|
},
|
|
355747
355985
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, setThought]
|
|
355748
355986
|
);
|
|
355749
|
-
const handleErrorEvent = (0,
|
|
355987
|
+
const handleErrorEvent = (0, import_react118.useCallback)(
|
|
355750
355988
|
(eventValue, userMessageTimestamp) => {
|
|
355751
355989
|
if (pendingHistoryItemRef.current) {
|
|
355752
355990
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -355769,7 +356007,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355769
356007
|
},
|
|
355770
356008
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, config, setThought]
|
|
355771
356009
|
);
|
|
355772
|
-
const handleCitationEvent = (0,
|
|
356010
|
+
const handleCitationEvent = (0, import_react118.useCallback)(
|
|
355773
356011
|
(text, userMessageTimestamp) => {
|
|
355774
356012
|
if (!showCitations(settings)) {
|
|
355775
356013
|
return;
|
|
@@ -355782,7 +356020,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355782
356020
|
},
|
|
355783
356021
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, settings]
|
|
355784
356022
|
);
|
|
355785
|
-
const handleFinishedEvent = (0,
|
|
356023
|
+
const handleFinishedEvent = (0, import_react118.useCallback)(
|
|
355786
356024
|
(event, userMessageTimestamp) => {
|
|
355787
356025
|
const finishReason = event.value.reason;
|
|
355788
356026
|
if (!finishReason) {
|
|
@@ -355816,7 +356054,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355816
356054
|
},
|
|
355817
356055
|
[addItem]
|
|
355818
356056
|
);
|
|
355819
|
-
const handleChatCompressionEvent = (0,
|
|
356057
|
+
const handleChatCompressionEvent = (0, import_react118.useCallback)(
|
|
355820
356058
|
(eventValue, userMessageTimestamp) => {
|
|
355821
356059
|
if (pendingHistoryItemRef.current) {
|
|
355822
356060
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -355832,7 +356070,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355832
356070
|
},
|
|
355833
356071
|
[addItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
355834
356072
|
);
|
|
355835
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
356073
|
+
const handleMaxSessionTurnsEvent = (0, import_react118.useCallback)(
|
|
355836
356074
|
() => addItem(
|
|
355837
356075
|
{
|
|
355838
356076
|
type: "info",
|
|
@@ -355842,7 +356080,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355842
356080
|
),
|
|
355843
356081
|
[addItem, config]
|
|
355844
356082
|
);
|
|
355845
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
356083
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react118.useCallback)(
|
|
355846
356084
|
(value) => addItem(
|
|
355847
356085
|
{
|
|
355848
356086
|
type: "error",
|
|
@@ -355857,7 +356095,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355857
356095
|
),
|
|
355858
356096
|
[addItem]
|
|
355859
356097
|
);
|
|
355860
|
-
const handleLoopDetectionConfirmation = (0,
|
|
356098
|
+
const handleLoopDetectionConfirmation = (0, import_react118.useCallback)(
|
|
355861
356099
|
(result) => {
|
|
355862
356100
|
setLoopDetectionConfirmationRequest(null);
|
|
355863
356101
|
if (result.userSelection === "disable") {
|
|
@@ -355881,12 +356119,12 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355881
356119
|
},
|
|
355882
356120
|
[config, addItem]
|
|
355883
356121
|
);
|
|
355884
|
-
const handleLoopDetectedEvent = (0,
|
|
356122
|
+
const handleLoopDetectedEvent = (0, import_react118.useCallback)(() => {
|
|
355885
356123
|
setLoopDetectionConfirmationRequest({
|
|
355886
356124
|
onComplete: handleLoopDetectionConfirmation
|
|
355887
356125
|
});
|
|
355888
356126
|
}, [handleLoopDetectionConfirmation]);
|
|
355889
|
-
const processOSAStreamEvents = (0,
|
|
356127
|
+
const processOSAStreamEvents = (0, import_react118.useCallback)(
|
|
355890
356128
|
async (stream2, userMessageTimestamp, signal) => {
|
|
355891
356129
|
let OSAMessageBuffer = "";
|
|
355892
356130
|
const toolCallRequests = [];
|
|
@@ -355960,7 +356198,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
355960
356198
|
handleCitationEvent
|
|
355961
356199
|
]
|
|
355962
356200
|
);
|
|
355963
|
-
const submitQuery = (0,
|
|
356201
|
+
const submitQuery = (0, import_react118.useCallback)(
|
|
355964
356202
|
async (query, options2, prompt_id) => {
|
|
355965
356203
|
if (isSubmittingQueryRef.current && !options2?.isContinuation) {
|
|
355966
356204
|
return;
|
|
@@ -356093,7 +356331,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356093
356331
|
restoreOriginalModel
|
|
356094
356332
|
]
|
|
356095
356333
|
);
|
|
356096
|
-
const handleApprovalModeChange = (0,
|
|
356334
|
+
const handleApprovalModeChange = (0, import_react118.useCallback)(
|
|
356097
356335
|
async (newApprovalMode) => {
|
|
356098
356336
|
if (newApprovalMode === ApprovalMode.YOLO || newApprovalMode === ApprovalMode.AUTO_EDIT) {
|
|
356099
356337
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -356122,7 +356360,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356122
356360
|
},
|
|
356123
356361
|
[toolCalls]
|
|
356124
356362
|
);
|
|
356125
|
-
const handleCompletedTools = (0,
|
|
356363
|
+
const handleCompletedTools = (0, import_react118.useCallback)(
|
|
356126
356364
|
async (completedToolCallsFromScheduler) => {
|
|
356127
356365
|
if (isResponding) {
|
|
356128
356366
|
return;
|
|
@@ -356207,13 +356445,13 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356207
356445
|
modelSwitchedFromQuotaError
|
|
356208
356446
|
]
|
|
356209
356447
|
);
|
|
356210
|
-
const pendingHistoryItems = (0,
|
|
356448
|
+
const pendingHistoryItems = (0, import_react118.useMemo)(
|
|
356211
356449
|
() => [pendingHistoryItem, pendingToolCallGroupDisplay].filter(
|
|
356212
356450
|
(i) => i !== void 0 && i !== null
|
|
356213
356451
|
),
|
|
356214
356452
|
[pendingHistoryItem, pendingToolCallGroupDisplay]
|
|
356215
356453
|
);
|
|
356216
|
-
(0,
|
|
356454
|
+
(0, import_react118.useEffect)(() => {
|
|
356217
356455
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
356218
356456
|
if (!config.getCheckpointingEnabled()) {
|
|
356219
356457
|
return;
|
|
@@ -356332,7 +356570,7 @@ var useOSAStream = /* @__PURE__ */ __name((OSAClient2, history, addItem, config,
|
|
|
356332
356570
|
|
|
356333
356571
|
// packages/cli/src/ui/hooks/vim.ts
|
|
356334
356572
|
init_esbuild_shims();
|
|
356335
|
-
var
|
|
356573
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
356336
356574
|
var DIGIT_MULTIPLIER = 10;
|
|
356337
356575
|
var DEFAULT_COUNT = 1;
|
|
356338
356576
|
var DIGIT_1_TO_9 = /^[1-9]$/;
|
|
@@ -356395,22 +356633,22 @@ var vimReducer = /* @__PURE__ */ __name((state, action) => {
|
|
|
356395
356633
|
}, "vimReducer");
|
|
356396
356634
|
function useVim(buffer, onSubmit) {
|
|
356397
356635
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
356398
|
-
const [state, dispatch] = (0,
|
|
356399
|
-
(0,
|
|
356636
|
+
const [state, dispatch] = (0, import_react119.useReducer)(vimReducer, initialVimState);
|
|
356637
|
+
(0, import_react119.useEffect)(() => {
|
|
356400
356638
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
356401
356639
|
}, [vimMode]);
|
|
356402
|
-
const updateMode = (0,
|
|
356640
|
+
const updateMode = (0, import_react119.useCallback)(
|
|
356403
356641
|
(mode) => {
|
|
356404
356642
|
setVimMode(mode);
|
|
356405
356643
|
dispatch({ type: "SET_MODE", mode });
|
|
356406
356644
|
},
|
|
356407
356645
|
[setVimMode]
|
|
356408
356646
|
);
|
|
356409
|
-
const getCurrentCount = (0,
|
|
356647
|
+
const getCurrentCount = (0, import_react119.useCallback)(
|
|
356410
356648
|
() => state.count || DEFAULT_COUNT,
|
|
356411
356649
|
[state.count]
|
|
356412
356650
|
);
|
|
356413
|
-
const executeCommand = (0,
|
|
356651
|
+
const executeCommand = (0, import_react119.useCallback)(
|
|
356414
356652
|
(cmdType, count) => {
|
|
356415
356653
|
switch (cmdType) {
|
|
356416
356654
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -356486,7 +356724,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356486
356724
|
},
|
|
356487
356725
|
[buffer, updateMode]
|
|
356488
356726
|
);
|
|
356489
|
-
const handleInsertModeInput = (0,
|
|
356727
|
+
const handleInsertModeInput = (0, import_react119.useCallback)(
|
|
356490
356728
|
(normalizedKey) => {
|
|
356491
356729
|
if (normalizedKey.name === "escape") {
|
|
356492
356730
|
buffer.vimEscapeInsertMode();
|
|
@@ -356517,7 +356755,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356517
356755
|
},
|
|
356518
356756
|
[buffer, dispatch, updateMode, onSubmit]
|
|
356519
356757
|
);
|
|
356520
|
-
const normalizeKey = (0,
|
|
356758
|
+
const normalizeKey = (0, import_react119.useCallback)(
|
|
356521
356759
|
(key) => ({
|
|
356522
356760
|
name: key.name || "",
|
|
356523
356761
|
sequence: key.sequence || "",
|
|
@@ -356528,7 +356766,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356528
356766
|
}),
|
|
356529
356767
|
[]
|
|
356530
356768
|
);
|
|
356531
|
-
const handleChangeMovement = (0,
|
|
356769
|
+
const handleChangeMovement = (0, import_react119.useCallback)(
|
|
356532
356770
|
(movement) => {
|
|
356533
356771
|
const count = getCurrentCount();
|
|
356534
356772
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -356549,7 +356787,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356549
356787
|
},
|
|
356550
356788
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
356551
356789
|
);
|
|
356552
|
-
const handleOperatorMotion = (0,
|
|
356790
|
+
const handleOperatorMotion = (0, import_react119.useCallback)(
|
|
356553
356791
|
(operator2, motion) => {
|
|
356554
356792
|
const count = getCurrentCount();
|
|
356555
356793
|
const commandMap = {
|
|
@@ -356576,7 +356814,7 @@ function useVim(buffer, onSubmit) {
|
|
|
356576
356814
|
},
|
|
356577
356815
|
[getCurrentCount, executeCommand, dispatch]
|
|
356578
356816
|
);
|
|
356579
|
-
const handleInput = (0,
|
|
356817
|
+
const handleInput = (0, import_react119.useCallback)(
|
|
356580
356818
|
(key) => {
|
|
356581
356819
|
if (!vimEnabled) {
|
|
356582
356820
|
return false;
|
|
@@ -356876,14 +357114,14 @@ __name(useVim, "useVim");
|
|
|
356876
357114
|
|
|
356877
357115
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
356878
357116
|
init_esbuild_shims();
|
|
356879
|
-
var
|
|
357117
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
356880
357118
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
356881
357119
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
356882
357120
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
356883
357121
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
356884
357122
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
356885
357123
|
}, "cleanup");
|
|
356886
|
-
(0,
|
|
357124
|
+
(0, import_react120.useEffect)(() => {
|
|
356887
357125
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
356888
357126
|
process.on("exit", cleanup);
|
|
356889
357127
|
process.on("SIGINT", cleanup);
|
|
@@ -356902,13 +357140,13 @@ init_esbuild_shims();
|
|
|
356902
357140
|
|
|
356903
357141
|
// packages/cli/src/ui/hooks/useTimer.ts
|
|
356904
357142
|
init_esbuild_shims();
|
|
356905
|
-
var
|
|
357143
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
356906
357144
|
var useTimer = /* @__PURE__ */ __name((isActive, resetKey) => {
|
|
356907
|
-
const [elapsedTime, setElapsedTime] = (0,
|
|
356908
|
-
const timerRef = (0,
|
|
356909
|
-
const prevResetKeyRef = (0,
|
|
356910
|
-
const prevIsActiveRef = (0,
|
|
356911
|
-
(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)(() => {
|
|
356912
357150
|
let shouldResetTime = false;
|
|
356913
357151
|
if (prevResetKeyRef.current !== resetKey) {
|
|
356914
357152
|
shouldResetTime = true;
|
|
@@ -356946,7 +357184,7 @@ var useTimer = /* @__PURE__ */ __name((isActive, resetKey) => {
|
|
|
356946
357184
|
|
|
356947
357185
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
356948
357186
|
init_esbuild_shims();
|
|
356949
|
-
var
|
|
357187
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
356950
357188
|
var WITTY_LOADING_PHRASES = [
|
|
356951
357189
|
"I'm Feeling Lucky",
|
|
356952
357190
|
"Shipping awesomeness... ",
|
|
@@ -357080,15 +357318,15 @@ var WITTY_LOADING_PHRASES = [
|
|
|
357080
357318
|
];
|
|
357081
357319
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
357082
357320
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
357083
|
-
const loadingPhrases = (0,
|
|
357321
|
+
const loadingPhrases = (0, import_react122.useMemo)(
|
|
357084
357322
|
() => customPhrases && customPhrases.length > 0 ? customPhrases : WITTY_LOADING_PHRASES.map((phrase) => t2(phrase)),
|
|
357085
357323
|
[customPhrases]
|
|
357086
357324
|
);
|
|
357087
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
357325
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react122.useState)(
|
|
357088
357326
|
loadingPhrases[0]
|
|
357089
357327
|
);
|
|
357090
|
-
const phraseIntervalRef = (0,
|
|
357091
|
-
(0,
|
|
357328
|
+
const phraseIntervalRef = (0, import_react122.useRef)(null);
|
|
357329
|
+
(0, import_react122.useEffect)(() => {
|
|
357092
357330
|
if (isWaiting) {
|
|
357093
357331
|
setCurrentLoadingPhrase(t2("Waiting for user confirmation..."));
|
|
357094
357332
|
if (phraseIntervalRef.current) {
|
|
@@ -357125,9 +357363,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
357125
357363
|
}, "usePhraseCycler");
|
|
357126
357364
|
|
|
357127
357365
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
357128
|
-
var
|
|
357366
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
357129
357367
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases) => {
|
|
357130
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
357368
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react123.useState)(0);
|
|
357131
357369
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
357132
357370
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
357133
357371
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */;
|
|
@@ -357137,9 +357375,9 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
357137
357375
|
isWaiting,
|
|
357138
357376
|
customWittyPhrases
|
|
357139
357377
|
);
|
|
357140
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
357141
|
-
const prevStreamingStateRef = (0,
|
|
357142
|
-
(0,
|
|
357378
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react123.useState)(0);
|
|
357379
|
+
const prevStreamingStateRef = (0, import_react123.useRef)(null);
|
|
357380
|
+
(0, import_react123.useEffect)(() => {
|
|
357143
357381
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
357144
357382
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
357145
357383
|
setRetainedElapsedTime(0);
|
|
@@ -357159,20 +357397,20 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
357159
357397
|
|
|
357160
357398
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
357161
357399
|
init_esbuild_shims();
|
|
357162
|
-
var
|
|
357400
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
357163
357401
|
import * as process40 from "node:process";
|
|
357164
357402
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
357165
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
357166
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
357167
|
-
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);
|
|
357168
357406
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
357169
|
-
(0,
|
|
357407
|
+
(0, import_react124.useEffect)(() => {
|
|
357170
357408
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
357171
357409
|
setIsTrusted(trusted);
|
|
357172
357410
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
357173
357411
|
onTrustChange(trusted);
|
|
357174
357412
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
357175
|
-
const handleFolderTrustSelect = (0,
|
|
357413
|
+
const handleFolderTrustSelect = (0, import_react124.useCallback)(
|
|
357176
357414
|
(choice2) => {
|
|
357177
357415
|
const trustedFolders = loadTrustedFolders();
|
|
357178
357416
|
const cwd7 = process40.cwd();
|
|
@@ -360041,7 +360279,7 @@ async function checkForUpdates() {
|
|
|
360041
360279
|
latestUpdateInfo
|
|
360042
360280
|
);
|
|
360043
360281
|
if (bestUpdate && import_semver3.default.gt(bestUpdate.latest, currentVersion)) {
|
|
360044
|
-
const message2 = `
|
|
360282
|
+
const message2 = `Update available! ${currentVersion} \u2192 ${bestUpdate.latest} | Run /doctor update or: npm i -g osagent@latest`;
|
|
360045
360283
|
return {
|
|
360046
360284
|
message: message2,
|
|
360047
360285
|
update: { ...bestUpdate, current: currentVersion }
|
|
@@ -360050,7 +360288,7 @@ async function checkForUpdates() {
|
|
|
360050
360288
|
} else {
|
|
360051
360289
|
const updateInfo = await createNotifier("latest").fetchInfo();
|
|
360052
360290
|
if (updateInfo && import_semver3.default.gt(updateInfo.latest, currentVersion)) {
|
|
360053
|
-
const message2 = `
|
|
360291
|
+
const message2 = `Update available! ${currentVersion} \u2192 ${updateInfo.latest} | Run /doctor update or: npm i -g osagent@latest`;
|
|
360054
360292
|
return {
|
|
360055
360293
|
message: message2,
|
|
360056
360294
|
update: { ...updateInfo, current: currentVersion }
|
|
@@ -360305,27 +360543,27 @@ __name(setUpdateHandler, "setUpdateHandler");
|
|
|
360305
360543
|
|
|
360306
360544
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
360307
360545
|
init_esbuild_shims();
|
|
360308
|
-
var
|
|
360546
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
360309
360547
|
function useMessageQueue({
|
|
360310
360548
|
isConfigInitialized,
|
|
360311
360549
|
streamingState,
|
|
360312
360550
|
submitQuery
|
|
360313
360551
|
}) {
|
|
360314
|
-
const [messageQueue, setMessageQueue] = (0,
|
|
360315
|
-
const addMessage = (0,
|
|
360552
|
+
const [messageQueue, setMessageQueue] = (0, import_react125.useState)([]);
|
|
360553
|
+
const addMessage = (0, import_react125.useCallback)((message2) => {
|
|
360316
360554
|
const trimmedMessage = message2.trim();
|
|
360317
360555
|
if (trimmedMessage.length > 0) {
|
|
360318
360556
|
setMessageQueue((prev) => [...prev, trimmedMessage]);
|
|
360319
360557
|
}
|
|
360320
360558
|
}, []);
|
|
360321
|
-
const clearQueue = (0,
|
|
360559
|
+
const clearQueue = (0, import_react125.useCallback)(() => {
|
|
360322
360560
|
setMessageQueue([]);
|
|
360323
360561
|
}, []);
|
|
360324
|
-
const getQueuedMessagesText = (0,
|
|
360562
|
+
const getQueuedMessagesText = (0, import_react125.useCallback)(() => {
|
|
360325
360563
|
if (messageQueue.length === 0) return "";
|
|
360326
360564
|
return messageQueue.join("\n\n");
|
|
360327
360565
|
}, [messageQueue]);
|
|
360328
|
-
(0,
|
|
360566
|
+
(0, import_react125.useEffect)(() => {
|
|
360329
360567
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && messageQueue.length > 0) {
|
|
360330
360568
|
const combinedMessage = messageQueue.join("\n\n");
|
|
360331
360569
|
setMessageQueue([]);
|
|
@@ -360343,15 +360581,15 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
360343
360581
|
|
|
360344
360582
|
// packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
|
|
360345
360583
|
init_esbuild_shims();
|
|
360346
|
-
var
|
|
360584
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
360347
360585
|
function useAutoAcceptIndicator({
|
|
360348
360586
|
config,
|
|
360349
360587
|
addItem,
|
|
360350
360588
|
onApprovalModeChange
|
|
360351
360589
|
}) {
|
|
360352
360590
|
const currentConfigValue = config.getApprovalMode();
|
|
360353
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
360354
|
-
(0,
|
|
360591
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react126.useState)(currentConfigValue);
|
|
360592
|
+
(0, import_react126.useEffect)(() => {
|
|
360355
360593
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
360356
360594
|
}, [currentConfigValue]);
|
|
360357
360595
|
useKeypress(
|
|
@@ -360384,14 +360622,14 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
360384
360622
|
|
|
360385
360623
|
// packages/cli/src/ui/hooks/useWorkspaceMigration.ts
|
|
360386
360624
|
init_esbuild_shims();
|
|
360387
|
-
var
|
|
360625
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
360388
360626
|
import process50 from "node:process";
|
|
360389
360627
|
function useWorkspaceMigration(settings) {
|
|
360390
|
-
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0,
|
|
360391
|
-
const [workspaceExtensions, setWorkspaceExtensions] = (0,
|
|
360628
|
+
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0, import_react127.useState)(false);
|
|
360629
|
+
const [workspaceExtensions, setWorkspaceExtensions] = (0, import_react127.useState)(
|
|
360392
360630
|
[]
|
|
360393
360631
|
);
|
|
360394
|
-
(0,
|
|
360632
|
+
(0, import_react127.useEffect)(() => {
|
|
360395
360633
|
if (!(settings.merged.experimental?.extensionManagement ?? true)) {
|
|
360396
360634
|
return;
|
|
360397
360635
|
}
|
|
@@ -360433,13 +360671,13 @@ __name(useWorkspaceMigration, "useWorkspaceMigration");
|
|
|
360433
360671
|
|
|
360434
360672
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
360435
360673
|
init_esbuild_shims();
|
|
360436
|
-
var
|
|
360674
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
360437
360675
|
import fs94 from "node:fs";
|
|
360438
360676
|
import fsPromises7 from "node:fs/promises";
|
|
360439
360677
|
import path109 from "node:path";
|
|
360440
360678
|
function useGitBranchName(cwd7) {
|
|
360441
|
-
const [branchName, setBranchName] = (0,
|
|
360442
|
-
const fetchBranchName = (0,
|
|
360679
|
+
const [branchName, setBranchName] = (0, import_react128.useState)(void 0);
|
|
360680
|
+
const fetchBranchName = (0, import_react128.useCallback)(async () => {
|
|
360443
360681
|
try {
|
|
360444
360682
|
if (!isCommandAvailable("git").available) {
|
|
360445
360683
|
return;
|
|
@@ -360464,7 +360702,7 @@ function useGitBranchName(cwd7) {
|
|
|
360464
360702
|
setBranchName(void 0);
|
|
360465
360703
|
}
|
|
360466
360704
|
}, [cwd7, setBranchName]);
|
|
360467
|
-
(0,
|
|
360705
|
+
(0, import_react128.useEffect)(() => {
|
|
360468
360706
|
fetchBranchName();
|
|
360469
360707
|
const gitLogsHeadPath = path109.join(cwd7, ".git", "logs", "HEAD");
|
|
360470
360708
|
let watcher;
|
|
@@ -360490,7 +360728,7 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
360490
360728
|
|
|
360491
360729
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
360492
360730
|
init_esbuild_shims();
|
|
360493
|
-
var
|
|
360731
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
360494
360732
|
function confirmationRequestsReducer(state, action) {
|
|
360495
360733
|
switch (action.type) {
|
|
360496
360734
|
case "add":
|
|
@@ -360504,15 +360742,15 @@ function confirmationRequestsReducer(state, action) {
|
|
|
360504
360742
|
}
|
|
360505
360743
|
__name(confirmationRequestsReducer, "confirmationRequestsReducer");
|
|
360506
360744
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) => {
|
|
360507
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
360745
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react129.useReducer)(
|
|
360508
360746
|
extensionUpdatesReducer,
|
|
360509
360747
|
initialExtensionUpdatesState
|
|
360510
360748
|
);
|
|
360511
360749
|
const [
|
|
360512
360750
|
confirmUpdateExtensionRequests,
|
|
360513
360751
|
dispatchConfirmUpdateExtensionRequests
|
|
360514
|
-
] = (0,
|
|
360515
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
360752
|
+
] = (0, import_react129.useReducer)(confirmationRequestsReducer, []);
|
|
360753
|
+
const addConfirmUpdateExtensionRequest = (0, import_react129.useCallback)(
|
|
360516
360754
|
(original) => {
|
|
360517
360755
|
const wrappedRequest = {
|
|
360518
360756
|
prompt: original.prompt,
|
|
@@ -360531,7 +360769,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
360531
360769
|
},
|
|
360532
360770
|
[dispatchConfirmUpdateExtensionRequests]
|
|
360533
360771
|
);
|
|
360534
|
-
(0,
|
|
360772
|
+
(0, import_react129.useEffect)(() => {
|
|
360535
360773
|
(async () => {
|
|
360536
360774
|
await checkForAllExtensionUpdates(
|
|
360537
360775
|
extensions,
|
|
@@ -360539,7 +360777,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
360539
360777
|
);
|
|
360540
360778
|
})();
|
|
360541
360779
|
}, [extensions, extensions.length, dispatchExtensionStateUpdate]);
|
|
360542
|
-
(0,
|
|
360780
|
+
(0, import_react129.useEffect)(() => {
|
|
360543
360781
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
360544
360782
|
return;
|
|
360545
360783
|
}
|
|
@@ -360604,7 +360842,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
360604
360842
|
addItem,
|
|
360605
360843
|
cwd7
|
|
360606
360844
|
]);
|
|
360607
|
-
const extensionsUpdateStateComputed = (0,
|
|
360845
|
+
const extensionsUpdateStateComputed = (0, import_react129.useMemo)(() => {
|
|
360608
360846
|
const result = /* @__PURE__ */ new Map();
|
|
360609
360847
|
for (const [
|
|
360610
360848
|
key,
|
|
@@ -360625,13 +360863,13 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
360625
360863
|
|
|
360626
360864
|
// packages/cli/src/ui/hooks/useQuitConfirmation.ts
|
|
360627
360865
|
init_esbuild_shims();
|
|
360628
|
-
var
|
|
360866
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
360629
360867
|
var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
360630
|
-
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0,
|
|
360631
|
-
const showQuitConfirmation = (0,
|
|
360868
|
+
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0, import_react130.useState)(false);
|
|
360869
|
+
const showQuitConfirmation = (0, import_react130.useCallback)(() => {
|
|
360632
360870
|
setIsQuitConfirmationOpen(true);
|
|
360633
360871
|
}, []);
|
|
360634
|
-
const handleQuitConfirmationSelect = (0,
|
|
360872
|
+
const handleQuitConfirmationSelect = (0, import_react130.useCallback)((choice2) => {
|
|
360635
360873
|
setIsQuitConfirmationOpen(false);
|
|
360636
360874
|
if (choice2 === "cancel" /* CANCEL */) {
|
|
360637
360875
|
return { shouldQuit: false, action: "cancel" };
|
|
@@ -360653,14 +360891,14 @@ var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
|
360653
360891
|
|
|
360654
360892
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
360655
360893
|
init_esbuild_shims();
|
|
360656
|
-
var
|
|
360894
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
360657
360895
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
360658
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
360659
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
360660
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
360661
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
360662
|
-
const [inputFillText, setInputFillText] = (0,
|
|
360663
|
-
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 () => {
|
|
360664
360902
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
360665
360903
|
return;
|
|
360666
360904
|
}
|
|
@@ -360674,7 +360912,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
360674
360912
|
console.debug("Welcome back check failed:", error);
|
|
360675
360913
|
}
|
|
360676
360914
|
}, [settings.ui?.enableWelcomeBack]);
|
|
360677
|
-
const handleWelcomeBackSelection = (0,
|
|
360915
|
+
const handleWelcomeBackSelection = (0, import_react131.useCallback)(
|
|
360678
360916
|
(choice2) => {
|
|
360679
360917
|
setWelcomeBackChoice(choice2);
|
|
360680
360918
|
setShowWelcomeBackDialog(false);
|
|
@@ -360686,21 +360924,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
360686
360924
|
},
|
|
360687
360925
|
[welcomeBackInfo]
|
|
360688
360926
|
);
|
|
360689
|
-
const handleWelcomeBackClose = (0,
|
|
360927
|
+
const handleWelcomeBackClose = (0, import_react131.useCallback)(() => {
|
|
360690
360928
|
setWelcomeBackChoice("restart");
|
|
360691
360929
|
setShowWelcomeBackDialog(false);
|
|
360692
360930
|
}, []);
|
|
360693
|
-
const clearInputFill = (0,
|
|
360931
|
+
const clearInputFill = (0, import_react131.useCallback)(() => {
|
|
360694
360932
|
setShouldFillInput(false);
|
|
360695
360933
|
setInputFillText(null);
|
|
360696
360934
|
}, []);
|
|
360697
|
-
(0,
|
|
360935
|
+
(0, import_react131.useEffect)(() => {
|
|
360698
360936
|
if (shouldFillInput && inputFillText) {
|
|
360699
360937
|
buffer.setText(inputFillText);
|
|
360700
360938
|
clearInputFill();
|
|
360701
360939
|
}
|
|
360702
360940
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
360703
|
-
(0,
|
|
360941
|
+
(0, import_react131.useEffect)(() => {
|
|
360704
360942
|
checkWelcomeBack();
|
|
360705
360943
|
}, [checkWelcomeBack]);
|
|
360706
360944
|
return {
|
|
@@ -360721,9 +360959,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
360721
360959
|
|
|
360722
360960
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
360723
360961
|
init_esbuild_shims();
|
|
360724
|
-
var
|
|
360962
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
360725
360963
|
function useDialogClose(options2) {
|
|
360726
|
-
const closeAnyOpenDialog = (0,
|
|
360964
|
+
const closeAnyOpenDialog = (0, import_react132.useCallback)(() => {
|
|
360727
360965
|
if (options2.isThemeDialogOpen) {
|
|
360728
360966
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
360729
360967
|
return true;
|
|
@@ -360755,14 +360993,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
360755
360993
|
|
|
360756
360994
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
360757
360995
|
init_esbuild_shims();
|
|
360758
|
-
var
|
|
360996
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
360759
360997
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
360760
|
-
const hasHandled = (0,
|
|
360761
|
-
const authErrorRef = (0,
|
|
360762
|
-
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);
|
|
360763
361001
|
authErrorRef.current = authError;
|
|
360764
361002
|
onAuthErrorRef.current = onAuthError;
|
|
360765
|
-
(0,
|
|
361003
|
+
(0, import_react133.useEffect)(() => {
|
|
360766
361004
|
if (hasHandled.current) {
|
|
360767
361005
|
return;
|
|
360768
361006
|
}
|
|
@@ -360775,13 +361013,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
360775
361013
|
|
|
360776
361014
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
360777
361015
|
init_esbuild_shims();
|
|
360778
|
-
var
|
|
361016
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
360779
361017
|
function useSubagentCreateDialog() {
|
|
360780
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
360781
|
-
const openSubagentCreateDialog = (0,
|
|
361018
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react134.useState)(false);
|
|
361019
|
+
const openSubagentCreateDialog = (0, import_react134.useCallback)(() => {
|
|
360782
361020
|
setIsSubagentCreateDialogOpen(true);
|
|
360783
361021
|
}, []);
|
|
360784
|
-
const closeSubagentCreateDialog = (0,
|
|
361022
|
+
const closeSubagentCreateDialog = (0, import_react134.useCallback)(() => {
|
|
360785
361023
|
setIsSubagentCreateDialogOpen(false);
|
|
360786
361024
|
}, []);
|
|
360787
361025
|
return {
|
|
@@ -360794,13 +361032,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
360794
361032
|
|
|
360795
361033
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
360796
361034
|
init_esbuild_shims();
|
|
360797
|
-
var
|
|
361035
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
360798
361036
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
360799
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
360800
|
-
const openAgentsManagerDialog = (0,
|
|
361037
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react135.useState)(false);
|
|
361038
|
+
const openAgentsManagerDialog = (0, import_react135.useCallback)(() => {
|
|
360801
361039
|
setIsAgentsManagerDialogOpen(true);
|
|
360802
361040
|
}, []);
|
|
360803
|
-
const closeAgentsManagerDialog = (0,
|
|
361041
|
+
const closeAgentsManagerDialog = (0, import_react135.useCallback)(() => {
|
|
360804
361042
|
setIsAgentsManagerDialogOpen(false);
|
|
360805
361043
|
}, []);
|
|
360806
361044
|
return {
|
|
@@ -360812,7 +361050,7 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
360812
361050
|
|
|
360813
361051
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
360814
361052
|
init_esbuild_shims();
|
|
360815
|
-
var
|
|
361053
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
360816
361054
|
|
|
360817
361055
|
// packages/cli/src/utils/attentionNotification.ts
|
|
360818
361056
|
init_esbuild_shims();
|
|
@@ -360840,9 +361078,9 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
360840
361078
|
streamingState,
|
|
360841
361079
|
elapsedTime
|
|
360842
361080
|
}) => {
|
|
360843
|
-
const awaitingNotificationSentRef = (0,
|
|
360844
|
-
const respondingElapsedRef = (0,
|
|
360845
|
-
(0,
|
|
361081
|
+
const awaitingNotificationSentRef = (0, import_react136.useRef)(false);
|
|
361082
|
+
const respondingElapsedRef = (0, import_react136.useRef)(0);
|
|
361083
|
+
(0, import_react136.useEffect)(() => {
|
|
360846
361084
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
360847
361085
|
notifyTerminalAttention("tool_approval" /* ToolApproval */);
|
|
360848
361086
|
awaitingNotificationSentRef.current = true;
|
|
@@ -360851,7 +361089,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
360851
361089
|
awaitingNotificationSentRef.current = false;
|
|
360852
361090
|
}
|
|
360853
361091
|
}, [isFocused, streamingState]);
|
|
360854
|
-
(0,
|
|
361092
|
+
(0, import_react136.useEffect)(() => {
|
|
360855
361093
|
if (streamingState === "responding" /* Responding */) {
|
|
360856
361094
|
respondingElapsedRef.current = elapsedTime;
|
|
360857
361095
|
return;
|
|
@@ -360868,7 +361106,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
360868
361106
|
}, "useAttentionNotifications");
|
|
360869
361107
|
|
|
360870
361108
|
// packages/cli/src/ui/AppContainer.tsx
|
|
360871
|
-
var
|
|
361109
|
+
var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1);
|
|
360872
361110
|
var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
|
|
360873
361111
|
function isToolExecuting(pendingHistoryItems) {
|
|
360874
361112
|
return pendingHistoryItems.some((item) => {
|
|
@@ -360887,25 +361125,25 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
360887
361125
|
const { settings, config, initializationResult } = props;
|
|
360888
361126
|
const historyManager = useHistory();
|
|
360889
361127
|
useMemoryMonitor(historyManager);
|
|
360890
|
-
const [corgiMode, setCorgiMode] = (0,
|
|
360891
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
360892
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
360893
|
-
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)(
|
|
360894
361132
|
initializationResult.themeError
|
|
360895
361133
|
);
|
|
360896
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
360897
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
360898
|
-
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)(
|
|
360899
361137
|
initializationResult.OSAMdFileCount
|
|
360900
361138
|
);
|
|
360901
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
360902
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
360903
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
360904
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
360905
|
-
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)(
|
|
360906
361144
|
config.isTrustedFolder()
|
|
360907
361145
|
);
|
|
360908
|
-
const [systemPromptPreset, setSystemPromptPreset] = (0,
|
|
361146
|
+
const [systemPromptPreset, setSystemPromptPreset] = (0, import_react137.useState)(
|
|
360909
361147
|
null
|
|
360910
361148
|
);
|
|
360911
361149
|
const extensions = config.getExtensions();
|
|
@@ -360920,38 +361158,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
360920
361158
|
historyManager.addItem,
|
|
360921
361159
|
config.getWorkingDir()
|
|
360922
361160
|
);
|
|
360923
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
360924
|
-
const openPermissionsDialog = (0,
|
|
361161
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react137.useState)(false);
|
|
361162
|
+
const openPermissionsDialog = (0, import_react137.useCallback)(
|
|
360925
361163
|
() => setPermissionsDialogOpen(true),
|
|
360926
361164
|
[]
|
|
360927
361165
|
);
|
|
360928
|
-
const closePermissionsDialog = (0,
|
|
361166
|
+
const closePermissionsDialog = (0, import_react137.useCallback)(
|
|
360929
361167
|
() => setPermissionsDialogOpen(false),
|
|
360930
361168
|
[]
|
|
360931
361169
|
);
|
|
360932
|
-
const getEffectiveModel2 = (0,
|
|
361170
|
+
const getEffectiveModel2 = (0, import_react137.useCallback)(() => {
|
|
360933
361171
|
if (config.isInFallbackMode()) {
|
|
360934
361172
|
return DEFAULT_OSA_FLASH_MODEL;
|
|
360935
361173
|
}
|
|
360936
361174
|
return config.getModel();
|
|
360937
361175
|
}, [config]);
|
|
360938
|
-
const [currentModel, setCurrentModel] = (0,
|
|
360939
|
-
const [userTier] = (0,
|
|
360940
|
-
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);
|
|
360941
361179
|
const logger6 = useLogger(config.storage);
|
|
360942
|
-
const [userMessages, setUserMessages] = (0,
|
|
361180
|
+
const [userMessages, setUserMessages] = (0, import_react137.useState)([]);
|
|
360943
361181
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
360944
361182
|
const { stdin, setRawMode } = use_stdin_default();
|
|
360945
361183
|
const { stdout } = use_stdout_default();
|
|
360946
361184
|
const { stats: sessionStats } = useSessionStats();
|
|
360947
361185
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
360948
|
-
const mainControlsRef = (0,
|
|
360949
|
-
const originalTitleRef = (0,
|
|
361186
|
+
const mainControlsRef = (0, import_react137.useRef)(null);
|
|
361187
|
+
const originalTitleRef = (0, import_react137.useRef)(
|
|
360950
361188
|
computeWindowTitle(basename14(config.getTargetDir()))
|
|
360951
361189
|
);
|
|
360952
|
-
const lastTitleRef = (0,
|
|
361190
|
+
const lastTitleRef = (0, import_react137.useRef)(null);
|
|
360953
361191
|
const staticExtraHeight = 3;
|
|
360954
|
-
(0,
|
|
361192
|
+
(0, import_react137.useEffect)(() => {
|
|
360955
361193
|
(async () => {
|
|
360956
361194
|
await config.initialize();
|
|
360957
361195
|
setConfigInitialized(true);
|
|
@@ -360961,11 +361199,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
360961
361199
|
await ideClient.disconnect();
|
|
360962
361200
|
});
|
|
360963
361201
|
}, [config]);
|
|
360964
|
-
(0,
|
|
361202
|
+
(0, import_react137.useEffect)(
|
|
360965
361203
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
360966
361204
|
[historyManager.addItem]
|
|
360967
361205
|
);
|
|
360968
|
-
(0,
|
|
361206
|
+
(0, import_react137.useEffect)(() => {
|
|
360969
361207
|
const checkModelChange = /* @__PURE__ */ __name(() => {
|
|
360970
361208
|
const effectiveModel = getEffectiveModel2();
|
|
360971
361209
|
if (effectiveModel !== currentModel) {
|
|
@@ -360981,7 +361219,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
360981
361219
|
handleNewMessage,
|
|
360982
361220
|
clearConsoleMessages: clearConsoleMessagesState
|
|
360983
361221
|
} = useConsoleMessages();
|
|
360984
|
-
(0,
|
|
361222
|
+
(0, import_react137.useEffect)(() => {
|
|
360985
361223
|
const consolePatcher = new ConsolePatcher({
|
|
360986
361224
|
onNewMessage: handleNewMessage,
|
|
360987
361225
|
debugMode: config.getDebugMode()
|
|
@@ -360989,13 +361227,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
360989
361227
|
consolePatcher.patch();
|
|
360990
361228
|
registerCleanup(consolePatcher.cleanup);
|
|
360991
361229
|
}, [handleNewMessage, config]);
|
|
360992
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
361230
|
+
const { inputWidth, suggestionsWidth } = (0, import_react137.useMemo)(() => {
|
|
360993
361231
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
360994
361232
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
360995
361233
|
}, [terminalWidth]);
|
|
360996
361234
|
const mainAreaWidth = Math.floor(terminalWidth * 0.9);
|
|
360997
361235
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
360998
|
-
const isValidPath = (0,
|
|
361236
|
+
const isValidPath = (0, import_react137.useCallback)((filePath) => {
|
|
360999
361237
|
try {
|
|
361000
361238
|
return fs95.existsSync(filePath) && fs95.statSync(filePath).isFile();
|
|
361001
361239
|
} catch (_e) {
|
|
@@ -361010,7 +361248,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361010
361248
|
isValidPath,
|
|
361011
361249
|
shellModeActive
|
|
361012
361250
|
});
|
|
361013
|
-
(0,
|
|
361251
|
+
(0, import_react137.useEffect)(() => {
|
|
361014
361252
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
361015
361253
|
const pastMessagesRaw = await logger6?.getPreviousUserMessages() || [];
|
|
361016
361254
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -361033,7 +361271,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361033
361271
|
}, "fetchUserMessages");
|
|
361034
361272
|
fetchUserMessages();
|
|
361035
361273
|
}, [historyManager.history, logger6]);
|
|
361036
|
-
const refreshStatic = (0,
|
|
361274
|
+
const refreshStatic = (0, import_react137.useCallback)(() => {
|
|
361037
361275
|
stdout.write(base_exports.clearTerminal);
|
|
361038
361276
|
setHistoryRemountKey((prev) => prev + 1);
|
|
361039
361277
|
}, [setHistoryRemountKey, stdout]);
|
|
@@ -361073,7 +361311,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361073
361311
|
setModelSwitchedFromQuotaError
|
|
361074
361312
|
});
|
|
361075
361313
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
361076
|
-
(0,
|
|
361314
|
+
(0, import_react137.useEffect)(() => {
|
|
361077
361315
|
if (settings.merged.security?.auth?.enforcedType && settings.merged.security?.auth.selectedType && settings.merged.security?.auth.enforcedType !== settings.merged.security?.auth.selectedType) {
|
|
361078
361316
|
onAuthError(
|
|
361079
361317
|
t2(
|
|
@@ -361098,7 +361336,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361098
361336
|
settings.merged.security?.auth?.useExternal,
|
|
361099
361337
|
onAuthError
|
|
361100
361338
|
]);
|
|
361101
|
-
const [editorError, setEditorError] = (0,
|
|
361339
|
+
const [editorError, setEditorError] = (0, import_react137.useState)(null);
|
|
361102
361340
|
const {
|
|
361103
361341
|
isEditorDialogOpen,
|
|
361104
361342
|
openEditorDialog,
|
|
@@ -361125,9 +361363,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361125
361363
|
openAgentsManagerDialog,
|
|
361126
361364
|
closeAgentsManagerDialog
|
|
361127
361365
|
} = useAgentsManagerDialog();
|
|
361128
|
-
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0,
|
|
361129
|
-
const [visionSwitchResolver, setVisionSwitchResolver] = (0,
|
|
361130
|
-
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)(
|
|
361131
361369
|
() => ({
|
|
361132
361370
|
openAuthDialog,
|
|
361133
361371
|
openThemeDialog,
|
|
@@ -361192,14 +361430,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361192
361430
|
extensionsUpdateStateInternal,
|
|
361193
361431
|
isConfigInitialized
|
|
361194
361432
|
);
|
|
361195
|
-
const handleVisionSwitchRequired = (0,
|
|
361433
|
+
const handleVisionSwitchRequired = (0, import_react137.useCallback)(
|
|
361196
361434
|
async (_query) => new Promise((resolve25, reject) => {
|
|
361197
361435
|
setVisionSwitchResolver({ resolve: resolve25, reject });
|
|
361198
361436
|
setIsVisionSwitchDialogOpen(true);
|
|
361199
361437
|
}),
|
|
361200
361438
|
[]
|
|
361201
361439
|
);
|
|
361202
|
-
const handleVisionSwitchSelect = (0,
|
|
361440
|
+
const handleVisionSwitchSelect = (0, import_react137.useCallback)(
|
|
361203
361441
|
(outcome) => {
|
|
361204
361442
|
setIsVisionSwitchDialogOpen(false);
|
|
361205
361443
|
if (visionSwitchResolver) {
|
|
@@ -361210,10 +361448,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361210
361448
|
},
|
|
361211
361449
|
[visionSwitchResolver]
|
|
361212
361450
|
);
|
|
361213
|
-
const onDebugMessage = (0,
|
|
361451
|
+
const onDebugMessage = (0, import_react137.useCallback)((message2) => {
|
|
361214
361452
|
console.debug(message2);
|
|
361215
361453
|
}, []);
|
|
361216
|
-
const performMemoryRefresh = (0,
|
|
361454
|
+
const performMemoryRefresh = (0, import_react137.useCallback)(async () => {
|
|
361217
361455
|
historyManager.addItem(
|
|
361218
361456
|
{
|
|
361219
361457
|
type: "info" /* INFO */,
|
|
@@ -361264,7 +361502,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361264
361502
|
console.error("Error refreshing memory:", error);
|
|
361265
361503
|
}
|
|
361266
361504
|
}, [config, historyManager, settings.merged]);
|
|
361267
|
-
const cancelHandlerRef = (0,
|
|
361505
|
+
const cancelHandlerRef = (0, import_react137.useRef)(() => {
|
|
361268
361506
|
});
|
|
361269
361507
|
const {
|
|
361270
361508
|
streamingState,
|
|
@@ -361311,7 +361549,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361311
361549
|
streamingState,
|
|
361312
361550
|
submitQuery
|
|
361313
361551
|
});
|
|
361314
|
-
const handleFinalSubmit = (0,
|
|
361552
|
+
const handleFinalSubmit = (0, import_react137.useCallback)(
|
|
361315
361553
|
(submittedValue) => {
|
|
361316
361554
|
addMessage(submittedValue);
|
|
361317
361555
|
},
|
|
@@ -361324,7 +361562,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
361324
361562
|
handleWelcomeBackSelection,
|
|
361325
361563
|
handleWelcomeBackClose
|
|
361326
361564
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
361327
|
-
cancelHandlerRef.current = (0,
|
|
361565
|
+
cancelHandlerRef.current = (0, import_react137.useCallback)(() => {
|
|
361328
361566
|
const pendingHistoryItems2 = [
|
|
361329
361567
|
...pendingSlashCommandHistoryItems,
|
|
361330
361568
|
...pendingOSAHistoryItems
|
|
@@ -361353,7 +361591,7 @@ ${queuedText}` : queuedText;
|
|
|
361353
361591
|
pendingSlashCommandHistoryItems,
|
|
361354
361592
|
pendingOSAHistoryItems
|
|
361355
361593
|
]);
|
|
361356
|
-
const handleClearScreen = (0,
|
|
361594
|
+
const handleClearScreen = (0, import_react137.useCallback)(() => {
|
|
361357
361595
|
historyManager.clearItems();
|
|
361358
361596
|
clearConsoleMessagesState();
|
|
361359
361597
|
console.clear();
|
|
@@ -361361,8 +361599,8 @@ ${queuedText}` : queuedText;
|
|
|
361361
361599
|
}, [historyManager, clearConsoleMessagesState, refreshStatic]);
|
|
361362
361600
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
361363
361601
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */) && !proQuotaRequest;
|
|
361364
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
361365
|
-
(0,
|
|
361602
|
+
const [controlsHeight, setControlsHeight] = (0, import_react137.useState)(0);
|
|
361603
|
+
(0, import_react137.useLayoutEffect)(() => {
|
|
361366
361604
|
if (mainControlsRef.current) {
|
|
361367
361605
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
361368
361606
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -361385,14 +361623,14 @@ ${queuedText}` : queuedText;
|
|
|
361385
361623
|
});
|
|
361386
361624
|
const isFocused = useFocus();
|
|
361387
361625
|
useBracketedPaste();
|
|
361388
|
-
const contextFileNames = (0,
|
|
361626
|
+
const contextFileNames = (0, import_react137.useMemo)(() => {
|
|
361389
361627
|
const fromSettings = settings.merged.context?.fileName;
|
|
361390
361628
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllOSAMdFilenames();
|
|
361391
361629
|
}, [settings.merged.context?.fileName]);
|
|
361392
|
-
const initialPrompt = (0,
|
|
361393
|
-
const initialPromptSubmitted = (0,
|
|
361630
|
+
const initialPrompt = (0, import_react137.useMemo)(() => config.getQuestion(), [config]);
|
|
361631
|
+
const initialPromptSubmitted = (0, import_react137.useRef)(false);
|
|
361394
361632
|
const OSAClient2 = config.getOSAClient();
|
|
361395
|
-
(0,
|
|
361633
|
+
(0, import_react137.useEffect)(() => {
|
|
361396
361634
|
if (activePtyId) {
|
|
361397
361635
|
ShellExecutionService.resizePty(
|
|
361398
361636
|
activePtyId,
|
|
@@ -361401,7 +361639,7 @@ ${queuedText}` : queuedText;
|
|
|
361401
361639
|
);
|
|
361402
361640
|
}
|
|
361403
361641
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
361404
|
-
(0,
|
|
361642
|
+
(0, import_react137.useEffect)(() => {
|
|
361405
361643
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && !isVisionSwitchDialogOpen && welcomeBackChoice !== "restart" && OSAClient2?.isInitialized?.()) {
|
|
361406
361644
|
handleFinalSubmit(initialPrompt);
|
|
361407
361645
|
initialPromptSubmitted.current = true;
|
|
@@ -361419,9 +361657,9 @@ ${queuedText}` : queuedText;
|
|
|
361419
361657
|
welcomeBackChoice,
|
|
361420
361658
|
OSAClient2
|
|
361421
361659
|
]);
|
|
361422
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
361423
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
361424
|
-
(0,
|
|
361660
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react137.useState)(false);
|
|
361661
|
+
const [currentIDE, setCurrentIDE] = (0, import_react137.useState)(null);
|
|
361662
|
+
(0, import_react137.useEffect)(() => {
|
|
361425
361663
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
361426
361664
|
const ideClient = await IdeClient.getInstance();
|
|
361427
361665
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -361432,28 +361670,28 @@ ${queuedText}` : queuedText;
|
|
|
361432
361670
|
const shouldShowIdePrompt = Boolean(
|
|
361433
361671
|
currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
|
|
361434
361672
|
);
|
|
361435
|
-
const [showErrorDetails, setShowErrorDetails] = (0,
|
|
361436
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
361437
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
361438
|
-
const ctrlCTimerRef = (0,
|
|
361439
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
361440
|
-
const ctrlDTimerRef = (0,
|
|
361441
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
361442
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
361443
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
361444
|
-
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);
|
|
361445
361683
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
361446
361684
|
const {
|
|
361447
361685
|
needsRestart: ideNeedsRestart,
|
|
361448
361686
|
restartReason: ideTrustRestartReason
|
|
361449
361687
|
} = useIdeTrustListener();
|
|
361450
|
-
const isInitialMount = (0,
|
|
361451
|
-
(0,
|
|
361688
|
+
const isInitialMount = (0, import_react137.useRef)(true);
|
|
361689
|
+
(0, import_react137.useEffect)(() => {
|
|
361452
361690
|
if (ideNeedsRestart) {
|
|
361453
361691
|
setShowIdeRestartPrompt(true);
|
|
361454
361692
|
}
|
|
361455
361693
|
}, [ideNeedsRestart]);
|
|
361456
|
-
(0,
|
|
361694
|
+
(0, import_react137.useEffect)(() => {
|
|
361457
361695
|
if (isInitialMount.current) {
|
|
361458
361696
|
isInitialMount.current = false;
|
|
361459
361697
|
return;
|
|
@@ -361465,12 +361703,12 @@ ${queuedText}` : queuedText;
|
|
|
361465
361703
|
clearTimeout(handler);
|
|
361466
361704
|
};
|
|
361467
361705
|
}, [terminalWidth, refreshStatic]);
|
|
361468
|
-
(0,
|
|
361706
|
+
(0, import_react137.useEffect)(() => {
|
|
361469
361707
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
361470
361708
|
setIdeContextState(ideContextStore.get());
|
|
361471
361709
|
return unsubscribe;
|
|
361472
361710
|
}, []);
|
|
361473
|
-
(0,
|
|
361711
|
+
(0, import_react137.useEffect)(() => {
|
|
361474
361712
|
const openDebugConsole = /* @__PURE__ */ __name(() => {
|
|
361475
361713
|
setShowErrorDetails(true);
|
|
361476
361714
|
setConstrainHeight(false);
|
|
@@ -361489,10 +361727,10 @@ ${queuedText}` : queuedText;
|
|
|
361489
361727
|
appEvents.off("log-error" /* LogError */, logErrorHandler);
|
|
361490
361728
|
};
|
|
361491
361729
|
}, [handleNewMessage]);
|
|
361492
|
-
const handleEscapePromptChange = (0,
|
|
361730
|
+
const handleEscapePromptChange = (0, import_react137.useCallback)((showPrompt) => {
|
|
361493
361731
|
setShowEscapePrompt(showPrompt);
|
|
361494
361732
|
}, []);
|
|
361495
|
-
const handleIdePromptComplete = (0,
|
|
361733
|
+
const handleIdePromptComplete = (0, import_react137.useCallback)(
|
|
361496
361734
|
(result) => {
|
|
361497
361735
|
if (result.userSelection === "yes") {
|
|
361498
361736
|
handleSlashCommand2("/ide install");
|
|
@@ -361530,7 +361768,7 @@ ${queuedText}` : queuedText;
|
|
|
361530
361768
|
handleWelcomeBackClose,
|
|
361531
361769
|
quitConfirmationRequest
|
|
361532
361770
|
});
|
|
361533
|
-
const handleExit = (0,
|
|
361771
|
+
const handleExit = (0, import_react137.useCallback)(
|
|
361534
361772
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
361535
361773
|
if (pressedOnce) {
|
|
361536
361774
|
if (timerRef.current) {
|
|
@@ -361573,7 +361811,7 @@ ${queuedText}` : queuedText;
|
|
|
361573
361811
|
buffer
|
|
361574
361812
|
]
|
|
361575
361813
|
);
|
|
361576
|
-
const handleGlobalKeypress = (0,
|
|
361814
|
+
const handleGlobalKeypress = (0, import_react137.useCallback)(
|
|
361577
361815
|
(key) => {
|
|
361578
361816
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
361579
361817
|
console.log("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -361646,7 +361884,7 @@ ${queuedText}` : queuedText;
|
|
|
361646
361884
|
]
|
|
361647
361885
|
);
|
|
361648
361886
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
361649
|
-
(0,
|
|
361887
|
+
(0, import_react137.useEffect)(() => {
|
|
361650
361888
|
if (!settings.merged.ui?.showStatusInTitle || settings.merged.ui?.hideWindowTitle)
|
|
361651
361889
|
return;
|
|
361652
361890
|
let title;
|
|
@@ -361668,23 +361906,23 @@ ${queuedText}` : queuedText;
|
|
|
361668
361906
|
settings.merged.ui?.hideWindowTitle,
|
|
361669
361907
|
stdout
|
|
361670
361908
|
]);
|
|
361671
|
-
const filteredConsoleMessages = (0,
|
|
361909
|
+
const filteredConsoleMessages = (0, import_react137.useMemo)(() => {
|
|
361672
361910
|
if (config.getDebugMode()) {
|
|
361673
361911
|
return consoleMessages;
|
|
361674
361912
|
}
|
|
361675
361913
|
return consoleMessages.filter((msg) => msg.type !== "debug");
|
|
361676
361914
|
}, [consoleMessages, config]);
|
|
361677
|
-
const errorCount = (0,
|
|
361915
|
+
const errorCount = (0, import_react137.useMemo)(
|
|
361678
361916
|
() => filteredConsoleMessages.filter((msg) => msg.type === "error").reduce((total, msg) => total + msg.count, 0),
|
|
361679
361917
|
[filteredConsoleMessages]
|
|
361680
361918
|
);
|
|
361681
361919
|
const nightly = props.version.includes("nightly");
|
|
361682
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;
|
|
361683
|
-
const pendingHistoryItems = (0,
|
|
361921
|
+
const pendingHistoryItems = (0, import_react137.useMemo)(
|
|
361684
361922
|
() => [...pendingSlashCommandHistoryItems, ...pendingOSAHistoryItems],
|
|
361685
361923
|
[pendingSlashCommandHistoryItems, pendingOSAHistoryItems]
|
|
361686
361924
|
);
|
|
361687
|
-
const uiState = (0,
|
|
361925
|
+
const uiState = (0, import_react137.useMemo)(
|
|
361688
361926
|
() => ({
|
|
361689
361927
|
history: historyManager.history,
|
|
361690
361928
|
historyManager,
|
|
@@ -361875,7 +362113,7 @@ ${queuedText}` : queuedText;
|
|
|
361875
362113
|
isAgentsManagerDialogOpen
|
|
361876
362114
|
]
|
|
361877
362115
|
);
|
|
361878
|
-
const uiActions = (0,
|
|
362116
|
+
const uiActions = (0, import_react137.useMemo)(
|
|
361879
362117
|
() => ({
|
|
361880
362118
|
handleThemeSelect,
|
|
361881
362119
|
handleThemeHighlight,
|
|
@@ -361943,23 +362181,23 @@ ${queuedText}` : queuedText;
|
|
|
361943
362181
|
closeAgentsManagerDialog
|
|
361944
362182
|
]
|
|
361945
362183
|
);
|
|
361946
|
-
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)(
|
|
361947
362185
|
AppContext2.Provider,
|
|
361948
362186
|
{
|
|
361949
362187
|
value: {
|
|
361950
362188
|
version: props.version,
|
|
361951
362189
|
startupWarnings: props.startupWarnings || []
|
|
361952
362190
|
},
|
|
361953
|
-
children: /* @__PURE__ */ (0,
|
|
362191
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ShellFocusContext.Provider, { value: isFocused, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(App2, {}) })
|
|
361954
362192
|
}
|
|
361955
362193
|
) }) }) });
|
|
361956
362194
|
}, "AppContainer");
|
|
361957
362195
|
|
|
361958
362196
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
361959
362197
|
init_esbuild_shims();
|
|
361960
|
-
var
|
|
362198
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
361961
362199
|
function useKittyKeyboardProtocol() {
|
|
361962
|
-
const [status] = (0,
|
|
362200
|
+
const [status] = (0, import_react138.useState)({
|
|
361963
362201
|
supported: isKittyProtocolSupported(),
|
|
361964
362202
|
enabled: isKittyProtocolEnabled(),
|
|
361965
362203
|
checking: false
|
|
@@ -364615,7 +364853,7 @@ function toPermissionOptions(confirmation) {
|
|
|
364615
364853
|
__name(toPermissionOptions, "toPermissionOptions");
|
|
364616
364854
|
|
|
364617
364855
|
// packages/cli/src/gemini.tsx
|
|
364618
|
-
var
|
|
364856
|
+
var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1);
|
|
364619
364857
|
function validateDnsResolutionOrder(order) {
|
|
364620
364858
|
const defaultValue = "ipv4first";
|
|
364621
364859
|
if (order === void 0) {
|
|
@@ -364680,14 +364918,14 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
364680
364918
|
const AppWrapper = /* @__PURE__ */ __name(() => {
|
|
364681
364919
|
const kittyProtocolStatus = useKittyKeyboardProtocol();
|
|
364682
364920
|
const nodeMajorVersion = parseInt(process.versions.node.split(".")[0], 10);
|
|
364683
|
-
return /* @__PURE__ */ (0,
|
|
364921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(SettingsContext.Provider, { value: settings, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
364684
364922
|
KeypressProvider,
|
|
364685
364923
|
{
|
|
364686
364924
|
kittyProtocolEnabled: kittyProtocolStatus.enabled,
|
|
364687
364925
|
config,
|
|
364688
364926
|
debugKeystrokeLogging: settings.merged.general?.debugKeystrokeLogging,
|
|
364689
364927
|
pasteWorkaround: process.platform === "win32" || nodeMajorVersion < 20,
|
|
364690
|
-
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)(
|
|
364691
364929
|
AppContainer,
|
|
364692
364930
|
{
|
|
364693
364931
|
config,
|
|
@@ -364701,7 +364939,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
364701
364939
|
) });
|
|
364702
364940
|
}, "AppWrapper");
|
|
364703
364941
|
const instance = render_default(
|
|
364704
|
-
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, {}),
|
|
364705
364943
|
{
|
|
364706
364944
|
exitOnCtrlC: false,
|
|
364707
364945
|
isScreenReaderEnabled: config.getScreenReader()
|