fss-link 1.1.2 → 1.1.3
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/bundle/fss-link.js +1376 -1056
- package/package.json +1 -1
package/bundle/fss-link.js
CHANGED
|
@@ -22084,7 +22084,7 @@ async function createContentGeneratorConfig(config, authType) {
|
|
|
22084
22084
|
async function createContentGenerator(config, gcConfig, sessionId2) {
|
|
22085
22085
|
if (DEBUG_CONTENT)
|
|
22086
22086
|
console.log(`\u{1F41B} DEBUG createContentGenerator: authType=${config.authType}, apiKey=${config.apiKey}, baseUrl=${config.baseUrl}`);
|
|
22087
|
-
const version = "1.1.
|
|
22087
|
+
const version = "1.1.3";
|
|
22088
22088
|
const userAgent = `FSS-Link/${version} (${process.platform}; ${process.arch})`;
|
|
22089
22089
|
const baseHeaders = {
|
|
22090
22090
|
"User-Agent": userAgent
|
|
@@ -24635,231 +24635,24 @@ Signal: Signal number or \`(none)\` if no signal was received.
|
|
|
24635
24635
|
}
|
|
24636
24636
|
});
|
|
24637
24637
|
|
|
24638
|
-
// packages/core/dist/src/tools/ls.js
|
|
24639
|
-
import fs8 from "fs";
|
|
24640
|
-
import path10 from "path";
|
|
24641
|
-
var LSToolInvocation, LSTool;
|
|
24642
|
-
var init_ls = __esm({
|
|
24643
|
-
"packages/core/dist/src/tools/ls.js"() {
|
|
24644
|
-
"use strict";
|
|
24645
|
-
init_tools();
|
|
24646
|
-
init_paths();
|
|
24647
|
-
init_config();
|
|
24648
|
-
LSToolInvocation = class extends BaseToolInvocation {
|
|
24649
|
-
config;
|
|
24650
|
-
constructor(config, params) {
|
|
24651
|
-
super(params);
|
|
24652
|
-
this.config = config;
|
|
24653
|
-
}
|
|
24654
|
-
/**
|
|
24655
|
-
* Checks if a filename matches any of the ignore patterns
|
|
24656
|
-
* @param filename Filename to check
|
|
24657
|
-
* @param patterns Array of glob patterns to check against
|
|
24658
|
-
* @returns True if the filename should be ignored
|
|
24659
|
-
*/
|
|
24660
|
-
shouldIgnore(filename, patterns) {
|
|
24661
|
-
if (!patterns || patterns.length === 0) {
|
|
24662
|
-
return false;
|
|
24663
|
-
}
|
|
24664
|
-
for (const pattern of patterns) {
|
|
24665
|
-
const regexPattern = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
24666
|
-
const regex2 = new RegExp(`^${regexPattern}$`);
|
|
24667
|
-
if (regex2.test(filename)) {
|
|
24668
|
-
return true;
|
|
24669
|
-
}
|
|
24670
|
-
}
|
|
24671
|
-
return false;
|
|
24672
|
-
}
|
|
24673
|
-
/**
|
|
24674
|
-
* Gets a description of the file reading operation
|
|
24675
|
-
* @returns A string describing the file being read
|
|
24676
|
-
*/
|
|
24677
|
-
getDescription() {
|
|
24678
|
-
const relativePath = makeRelative(this.params.path, this.config.getTargetDir());
|
|
24679
|
-
return shortenPath(relativePath);
|
|
24680
|
-
}
|
|
24681
|
-
// Helper for consistent error formatting
|
|
24682
|
-
errorResult(llmContent, returnDisplay) {
|
|
24683
|
-
return {
|
|
24684
|
-
llmContent,
|
|
24685
|
-
// Keep returnDisplay simpler in core logic
|
|
24686
|
-
returnDisplay: `Error: ${returnDisplay}`
|
|
24687
|
-
};
|
|
24688
|
-
}
|
|
24689
|
-
/**
|
|
24690
|
-
* Executes the LS operation with the given parameters
|
|
24691
|
-
* @returns Result of the LS operation
|
|
24692
|
-
*/
|
|
24693
|
-
async execute(_signal) {
|
|
24694
|
-
try {
|
|
24695
|
-
const stats = fs8.statSync(this.params.path);
|
|
24696
|
-
if (!stats) {
|
|
24697
|
-
return this.errorResult(`Error: Directory not found or inaccessible: ${this.params.path}`, `Directory not found or inaccessible.`);
|
|
24698
|
-
}
|
|
24699
|
-
if (!stats.isDirectory()) {
|
|
24700
|
-
return this.errorResult(`Error: Path is not a directory: ${this.params.path}`, `Path is not a directory.`);
|
|
24701
|
-
}
|
|
24702
|
-
const files = fs8.readdirSync(this.params.path);
|
|
24703
|
-
const defaultFileIgnores = this.config.getFileFilteringOptions() ?? DEFAULT_FILE_FILTERING_OPTIONS;
|
|
24704
|
-
const fileFilteringOptions = {
|
|
24705
|
-
respectGitIgnore: this.params.file_filtering_options?.respect_git_ignore ?? defaultFileIgnores.respectGitIgnore,
|
|
24706
|
-
respectFssLinkIgnore: this.params.file_filtering_options?.respect_gemini_ignore ?? defaultFileIgnores.respectFssLinkIgnore
|
|
24707
|
-
};
|
|
24708
|
-
const fileDiscovery = this.config.getFileService();
|
|
24709
|
-
const entries = [];
|
|
24710
|
-
let gitIgnoredCount = 0;
|
|
24711
|
-
let fssLinkIgnoredCount = 0;
|
|
24712
|
-
if (files.length === 0) {
|
|
24713
|
-
return {
|
|
24714
|
-
llmContent: `Directory ${this.params.path} is empty.`,
|
|
24715
|
-
returnDisplay: `Directory is empty.`
|
|
24716
|
-
};
|
|
24717
|
-
}
|
|
24718
|
-
for (const file of files) {
|
|
24719
|
-
if (this.shouldIgnore(file, this.params.ignore)) {
|
|
24720
|
-
continue;
|
|
24721
|
-
}
|
|
24722
|
-
const fullPath = path10.join(this.params.path, file);
|
|
24723
|
-
const relativePath = path10.relative(this.config.getTargetDir(), fullPath);
|
|
24724
|
-
if (fileFilteringOptions.respectGitIgnore && fileDiscovery.shouldGitIgnoreFile(relativePath)) {
|
|
24725
|
-
gitIgnoredCount++;
|
|
24726
|
-
continue;
|
|
24727
|
-
}
|
|
24728
|
-
if (fileFilteringOptions.respectFssLinkIgnore && fileDiscovery.shouldFssLinkIgnoreFile(relativePath)) {
|
|
24729
|
-
fssLinkIgnoredCount++;
|
|
24730
|
-
continue;
|
|
24731
|
-
}
|
|
24732
|
-
try {
|
|
24733
|
-
const stats2 = fs8.statSync(fullPath);
|
|
24734
|
-
const isDir = stats2.isDirectory();
|
|
24735
|
-
entries.push({
|
|
24736
|
-
name: file,
|
|
24737
|
-
path: fullPath,
|
|
24738
|
-
isDirectory: isDir,
|
|
24739
|
-
size: isDir ? 0 : stats2.size,
|
|
24740
|
-
modifiedTime: stats2.mtime
|
|
24741
|
-
});
|
|
24742
|
-
} catch (error) {
|
|
24743
|
-
console.error(`Error accessing ${fullPath}: ${error}`);
|
|
24744
|
-
}
|
|
24745
|
-
}
|
|
24746
|
-
entries.sort((a, b) => {
|
|
24747
|
-
if (a.isDirectory && !b.isDirectory)
|
|
24748
|
-
return -1;
|
|
24749
|
-
if (!a.isDirectory && b.isDirectory)
|
|
24750
|
-
return 1;
|
|
24751
|
-
return a.name.localeCompare(b.name);
|
|
24752
|
-
});
|
|
24753
|
-
const directoryContent = entries.map((entry) => `${entry.isDirectory ? "[DIR] " : ""}${entry.name}`).join("\n");
|
|
24754
|
-
let resultMessage = `Directory listing for ${this.params.path}:
|
|
24755
|
-
${directoryContent}`;
|
|
24756
|
-
const ignoredMessages = [];
|
|
24757
|
-
if (gitIgnoredCount > 0) {
|
|
24758
|
-
ignoredMessages.push(`${gitIgnoredCount} git-ignored`);
|
|
24759
|
-
}
|
|
24760
|
-
if (fssLinkIgnoredCount > 0) {
|
|
24761
|
-
ignoredMessages.push(`${fssLinkIgnoredCount} fss-link-ignored`);
|
|
24762
|
-
}
|
|
24763
|
-
if (ignoredMessages.length > 0) {
|
|
24764
|
-
resultMessage += `
|
|
24765
|
-
|
|
24766
|
-
(${ignoredMessages.join(", ")})`;
|
|
24767
|
-
}
|
|
24768
|
-
let displayMessage = `Listed ${entries.length} item(s).`;
|
|
24769
|
-
if (ignoredMessages.length > 0) {
|
|
24770
|
-
displayMessage += ` (${ignoredMessages.join(", ")})`;
|
|
24771
|
-
if (entries.length === 0 && gitIgnoredCount > 0 && this.params.path.includes("scraped_content")) {
|
|
24772
|
-
displayMessage += ` - Use 'ls scraped_content' or 'bash ls scraped_content/' to view web scraper output files`;
|
|
24773
|
-
}
|
|
24774
|
-
}
|
|
24775
|
-
return {
|
|
24776
|
-
llmContent: resultMessage,
|
|
24777
|
-
returnDisplay: displayMessage
|
|
24778
|
-
};
|
|
24779
|
-
} catch (error) {
|
|
24780
|
-
const errorMsg = `Error listing directory: ${error instanceof Error ? error.message : String(error)}`;
|
|
24781
|
-
return this.errorResult(errorMsg, "Failed to list directory.");
|
|
24782
|
-
}
|
|
24783
|
-
}
|
|
24784
|
-
};
|
|
24785
|
-
LSTool = class _LSTool extends BaseDeclarativeTool {
|
|
24786
|
-
config;
|
|
24787
|
-
static Name = "list_directory";
|
|
24788
|
-
constructor(config) {
|
|
24789
|
-
super(_LSTool.Name, "ReadFolder", "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", Kind.Search, {
|
|
24790
|
-
properties: {
|
|
24791
|
-
path: {
|
|
24792
|
-
description: "The absolute path to the directory to list (must be absolute, not relative)",
|
|
24793
|
-
type: "string"
|
|
24794
|
-
},
|
|
24795
|
-
ignore: {
|
|
24796
|
-
description: "List of glob patterns to ignore",
|
|
24797
|
-
items: {
|
|
24798
|
-
type: "string"
|
|
24799
|
-
},
|
|
24800
|
-
type: "array"
|
|
24801
|
-
},
|
|
24802
|
-
file_filtering_options: {
|
|
24803
|
-
description: "Optional: Whether to respect ignore patterns from .gitignore or .fss-linkignore",
|
|
24804
|
-
type: "object",
|
|
24805
|
-
properties: {
|
|
24806
|
-
respect_git_ignore: {
|
|
24807
|
-
description: "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.",
|
|
24808
|
-
type: "boolean"
|
|
24809
|
-
},
|
|
24810
|
-
respect_gemini_ignore: {
|
|
24811
|
-
description: "Optional: Whether to respect .fss-linkignore patterns when listing files. Defaults to true.",
|
|
24812
|
-
type: "boolean"
|
|
24813
|
-
}
|
|
24814
|
-
}
|
|
24815
|
-
}
|
|
24816
|
-
},
|
|
24817
|
-
required: ["path"],
|
|
24818
|
-
type: "object"
|
|
24819
|
-
});
|
|
24820
|
-
this.config = config;
|
|
24821
|
-
}
|
|
24822
|
-
/**
|
|
24823
|
-
* Validates the parameters for the tool
|
|
24824
|
-
* @param params Parameters to validate
|
|
24825
|
-
* @returns An error message string if invalid, null otherwise
|
|
24826
|
-
*/
|
|
24827
|
-
validateToolParamValues(params) {
|
|
24828
|
-
if (!path10.isAbsolute(params.path)) {
|
|
24829
|
-
return `Path must be absolute: ${params.path}`;
|
|
24830
|
-
}
|
|
24831
|
-
const workspaceContext = this.config.getWorkspaceContext();
|
|
24832
|
-
if (!workspaceContext.isPathWithinWorkspace(params.path)) {
|
|
24833
|
-
const directories = workspaceContext.getDirectories();
|
|
24834
|
-
return `Path must be within one of the workspace directories: ${directories.join(", ")}`;
|
|
24835
|
-
}
|
|
24836
|
-
return null;
|
|
24837
|
-
}
|
|
24838
|
-
createInvocation(params) {
|
|
24839
|
-
return new LSToolInvocation(this.config, params);
|
|
24840
|
-
}
|
|
24841
|
-
};
|
|
24842
|
-
}
|
|
24843
|
-
});
|
|
24844
|
-
|
|
24845
24638
|
// packages/core/dist/src/utils/fileUtils.js
|
|
24846
|
-
import
|
|
24847
|
-
import
|
|
24639
|
+
import fs8 from "node:fs";
|
|
24640
|
+
import path10 from "node:path";
|
|
24848
24641
|
import mime from "mime-types";
|
|
24849
24642
|
function getSpecificMimeType(filePath) {
|
|
24850
24643
|
const lookedUpMime = mime.lookup(filePath);
|
|
24851
24644
|
return typeof lookedUpMime === "string" ? lookedUpMime : void 0;
|
|
24852
24645
|
}
|
|
24853
24646
|
function isWithinRoot(pathToCheck, rootDirectory) {
|
|
24854
|
-
const normalizedPathToCheck =
|
|
24855
|
-
const normalizedRootDirectory =
|
|
24856
|
-
const rootWithSeparator = normalizedRootDirectory ===
|
|
24647
|
+
const normalizedPathToCheck = path10.resolve(pathToCheck);
|
|
24648
|
+
const normalizedRootDirectory = path10.resolve(rootDirectory);
|
|
24649
|
+
const rootWithSeparator = normalizedRootDirectory === path10.sep || normalizedRootDirectory.endsWith(path10.sep) ? normalizedRootDirectory : normalizedRootDirectory + path10.sep;
|
|
24857
24650
|
return normalizedPathToCheck === normalizedRootDirectory || normalizedPathToCheck.startsWith(rootWithSeparator);
|
|
24858
24651
|
}
|
|
24859
24652
|
async function isBinaryFile(filePath) {
|
|
24860
24653
|
let fileHandle;
|
|
24861
24654
|
try {
|
|
24862
|
-
fileHandle = await
|
|
24655
|
+
fileHandle = await fs8.promises.open(filePath, "r");
|
|
24863
24656
|
const stats = await fileHandle.stat();
|
|
24864
24657
|
const fileSize = stats.size;
|
|
24865
24658
|
if (fileSize === 0) {
|
|
@@ -24894,7 +24687,7 @@ async function isBinaryFile(filePath) {
|
|
|
24894
24687
|
}
|
|
24895
24688
|
}
|
|
24896
24689
|
async function detectFileType(filePath) {
|
|
24897
|
-
const ext2 =
|
|
24690
|
+
const ext2 = path10.extname(filePath).toLowerCase();
|
|
24898
24691
|
if ([".ts", ".mts", ".cts"].includes(ext2)) {
|
|
24899
24692
|
return "text";
|
|
24900
24693
|
}
|
|
@@ -24955,7 +24748,7 @@ async function detectFileType(filePath) {
|
|
|
24955
24748
|
}
|
|
24956
24749
|
async function processSingleFileContent(filePath, rootDirectory, fileSystemService, offset, limit2) {
|
|
24957
24750
|
try {
|
|
24958
|
-
if (!
|
|
24751
|
+
if (!fs8.existsSync(filePath)) {
|
|
24959
24752
|
return {
|
|
24960
24753
|
llmContent: "",
|
|
24961
24754
|
returnDisplay: "File not found.",
|
|
@@ -24963,7 +24756,7 @@ async function processSingleFileContent(filePath, rootDirectory, fileSystemServi
|
|
|
24963
24756
|
errorType: FileErrorType.FILE_NOT_FOUND
|
|
24964
24757
|
};
|
|
24965
24758
|
}
|
|
24966
|
-
const stats = await
|
|
24759
|
+
const stats = await fs8.promises.stat(filePath);
|
|
24967
24760
|
if (stats.isDirectory()) {
|
|
24968
24761
|
return {
|
|
24969
24762
|
llmContent: "",
|
|
@@ -24978,7 +24771,7 @@ async function processSingleFileContent(filePath, rootDirectory, fileSystemServi
|
|
|
24978
24771
|
throw new Error(`File size exceeds the 20MB limit: ${filePath} (${(fileSizeInBytes / (1024 * 1024)).toFixed(2)}MB)`);
|
|
24979
24772
|
}
|
|
24980
24773
|
const fileType = await detectFileType(filePath);
|
|
24981
|
-
const relativePathForDisplay =
|
|
24774
|
+
const relativePathForDisplay = path10.relative(rootDirectory, filePath).replace(/\\/g, "/");
|
|
24982
24775
|
switch (fileType) {
|
|
24983
24776
|
case "binary": {
|
|
24984
24777
|
return {
|
|
@@ -25041,7 +24834,7 @@ async function processSingleFileContent(filePath, rootDirectory, fileSystemServi
|
|
|
25041
24834
|
case "pdf":
|
|
25042
24835
|
case "audio":
|
|
25043
24836
|
case "video": {
|
|
25044
|
-
const contentBuffer = await
|
|
24837
|
+
const contentBuffer = await fs8.promises.readFile(filePath);
|
|
25045
24838
|
const base64Data = contentBuffer.toString("base64");
|
|
25046
24839
|
return {
|
|
25047
24840
|
llmContent: {
|
|
@@ -25064,7 +24857,7 @@ async function processSingleFileContent(filePath, rootDirectory, fileSystemServi
|
|
|
25064
24857
|
}
|
|
25065
24858
|
} catch (error) {
|
|
25066
24859
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
25067
|
-
const displayPath =
|
|
24860
|
+
const displayPath = path10.relative(rootDirectory, filePath).replace(/\\/g, "/");
|
|
25068
24861
|
return {
|
|
25069
24862
|
llmContent: `Error reading file ${displayPath}: ${errorMessage}`,
|
|
25070
24863
|
returnDisplay: `Error reading file ${displayPath}: ${errorMessage}`,
|
|
@@ -25096,7 +24889,7 @@ function formatRelativeTime(date) {
|
|
|
25096
24889
|
return `${Math.floor(diffDays / 30)}mo ago`;
|
|
25097
24890
|
}
|
|
25098
24891
|
function getFileTypeIcon(filePath, fileType) {
|
|
25099
|
-
const ext2 =
|
|
24892
|
+
const ext2 = path10.extname(filePath).toLowerCase();
|
|
25100
24893
|
if (fileType === "image")
|
|
25101
24894
|
return "\u{1F5BC}\uFE0F";
|
|
25102
24895
|
if (fileType === "pdf")
|
|
@@ -25111,14 +24904,43 @@ function getFileTypeIcon(filePath, fileType) {
|
|
|
25111
24904
|
return "\u{1F9EA}";
|
|
25112
24905
|
return "\u{1F4C4}";
|
|
25113
24906
|
}
|
|
24907
|
+
async function countLinesEfficiently(filePath, maxLines = 1e4) {
|
|
24908
|
+
return new Promise((resolve19) => {
|
|
24909
|
+
let lineCount = 0;
|
|
24910
|
+
const stream2 = fs8.createReadStream(filePath, { encoding: "utf-8" });
|
|
24911
|
+
let remainder = "";
|
|
24912
|
+
stream2.on("data", (chunk) => {
|
|
24913
|
+
const text = Buffer.isBuffer(chunk) ? chunk.toString("utf-8") : chunk;
|
|
24914
|
+
const lines = (remainder + text).split("\n");
|
|
24915
|
+
remainder = lines.pop() || "";
|
|
24916
|
+
lineCount += lines.length;
|
|
24917
|
+
if (lineCount > maxLines) {
|
|
24918
|
+
stream2.destroy();
|
|
24919
|
+
resolve19(void 0);
|
|
24920
|
+
}
|
|
24921
|
+
});
|
|
24922
|
+
stream2.on("end", () => {
|
|
24923
|
+
if (remainder)
|
|
24924
|
+
lineCount++;
|
|
24925
|
+
resolve19(lineCount);
|
|
24926
|
+
});
|
|
24927
|
+
stream2.on("error", () => {
|
|
24928
|
+
resolve19(void 0);
|
|
24929
|
+
});
|
|
24930
|
+
});
|
|
24931
|
+
}
|
|
25114
24932
|
async function collectFileMetadata(filePath) {
|
|
25115
|
-
const stats = await
|
|
24933
|
+
const stats = await fs8.promises.stat(filePath);
|
|
25116
24934
|
const fileType = await detectFileType(filePath);
|
|
25117
24935
|
let totalLines;
|
|
25118
24936
|
if (fileType === "text") {
|
|
25119
24937
|
try {
|
|
25120
|
-
|
|
25121
|
-
|
|
24938
|
+
if (stats.size < 100 * 1024) {
|
|
24939
|
+
const content = await fs8.promises.readFile(filePath, "utf-8");
|
|
24940
|
+
totalLines = content.split("\n").length;
|
|
24941
|
+
} else {
|
|
24942
|
+
totalLines = await countLinesEfficiently(filePath, 1e4);
|
|
24943
|
+
}
|
|
25122
24944
|
} catch (error) {
|
|
25123
24945
|
console.warn(`Could not count lines for ${filePath}:`, error instanceof Error ? error.message : String(error));
|
|
25124
24946
|
}
|
|
@@ -25147,6 +24969,245 @@ var init_fileUtils = __esm({
|
|
|
25147
24969
|
}
|
|
25148
24970
|
});
|
|
25149
24971
|
|
|
24972
|
+
// packages/core/dist/src/tools/ls.js
|
|
24973
|
+
import fs9 from "fs";
|
|
24974
|
+
import path11 from "path";
|
|
24975
|
+
var LSToolInvocation, LSTool;
|
|
24976
|
+
var init_ls = __esm({
|
|
24977
|
+
"packages/core/dist/src/tools/ls.js"() {
|
|
24978
|
+
"use strict";
|
|
24979
|
+
init_tools();
|
|
24980
|
+
init_paths();
|
|
24981
|
+
init_config();
|
|
24982
|
+
init_fileUtils();
|
|
24983
|
+
LSToolInvocation = class extends BaseToolInvocation {
|
|
24984
|
+
config;
|
|
24985
|
+
constructor(config, params) {
|
|
24986
|
+
super(params);
|
|
24987
|
+
this.config = config;
|
|
24988
|
+
}
|
|
24989
|
+
/**
|
|
24990
|
+
* Checks if a filename matches any of the ignore patterns
|
|
24991
|
+
* @param filename Filename to check
|
|
24992
|
+
* @param patterns Array of glob patterns to check against
|
|
24993
|
+
* @returns True if the filename should be ignored
|
|
24994
|
+
*/
|
|
24995
|
+
shouldIgnore(filename, patterns) {
|
|
24996
|
+
if (!patterns || patterns.length === 0) {
|
|
24997
|
+
return false;
|
|
24998
|
+
}
|
|
24999
|
+
for (const pattern of patterns) {
|
|
25000
|
+
const regexPattern = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
25001
|
+
const regex2 = new RegExp(`^${regexPattern}$`);
|
|
25002
|
+
if (regex2.test(filename)) {
|
|
25003
|
+
return true;
|
|
25004
|
+
}
|
|
25005
|
+
}
|
|
25006
|
+
return false;
|
|
25007
|
+
}
|
|
25008
|
+
/**
|
|
25009
|
+
* Gets a description of the file reading operation
|
|
25010
|
+
* @returns A string describing the file being read
|
|
25011
|
+
*/
|
|
25012
|
+
getDescription() {
|
|
25013
|
+
const relativePath = makeRelative(this.params.path, this.config.getTargetDir());
|
|
25014
|
+
return shortenPath(relativePath);
|
|
25015
|
+
}
|
|
25016
|
+
// Helper for consistent error formatting
|
|
25017
|
+
errorResult(llmContent, returnDisplay) {
|
|
25018
|
+
return {
|
|
25019
|
+
llmContent,
|
|
25020
|
+
// Keep returnDisplay simpler in core logic
|
|
25021
|
+
returnDisplay: `Error: ${returnDisplay}`
|
|
25022
|
+
};
|
|
25023
|
+
}
|
|
25024
|
+
/**
|
|
25025
|
+
* Executes the LS operation with the given parameters
|
|
25026
|
+
* @returns Result of the LS operation
|
|
25027
|
+
*/
|
|
25028
|
+
async execute(_signal) {
|
|
25029
|
+
try {
|
|
25030
|
+
const stats = fs9.statSync(this.params.path);
|
|
25031
|
+
if (!stats) {
|
|
25032
|
+
return this.errorResult(`Error: Directory not found or inaccessible: ${this.params.path}`, `Directory not found or inaccessible.`);
|
|
25033
|
+
}
|
|
25034
|
+
if (!stats.isDirectory()) {
|
|
25035
|
+
return this.errorResult(`Error: Path is not a directory: ${this.params.path}`, `Path is not a directory.`);
|
|
25036
|
+
}
|
|
25037
|
+
const files = fs9.readdirSync(this.params.path);
|
|
25038
|
+
const defaultFileIgnores = this.config.getFileFilteringOptions() ?? DEFAULT_FILE_FILTERING_OPTIONS;
|
|
25039
|
+
const fileFilteringOptions = {
|
|
25040
|
+
respectGitIgnore: this.params.file_filtering_options?.respect_git_ignore ?? defaultFileIgnores.respectGitIgnore,
|
|
25041
|
+
respectFssLinkIgnore: this.params.file_filtering_options?.respect_gemini_ignore ?? defaultFileIgnores.respectFssLinkIgnore
|
|
25042
|
+
};
|
|
25043
|
+
const fileDiscovery = this.config.getFileService();
|
|
25044
|
+
const entries = [];
|
|
25045
|
+
let gitIgnoredCount = 0;
|
|
25046
|
+
let fssLinkIgnoredCount = 0;
|
|
25047
|
+
if (files.length === 0) {
|
|
25048
|
+
return {
|
|
25049
|
+
llmContent: `Directory ${this.params.path} is empty.`,
|
|
25050
|
+
returnDisplay: `Directory is empty.`
|
|
25051
|
+
};
|
|
25052
|
+
}
|
|
25053
|
+
for (const file of files) {
|
|
25054
|
+
if (this.shouldIgnore(file, this.params.ignore)) {
|
|
25055
|
+
continue;
|
|
25056
|
+
}
|
|
25057
|
+
const fullPath = path11.join(this.params.path, file);
|
|
25058
|
+
const relativePath = path11.relative(this.config.getTargetDir(), fullPath);
|
|
25059
|
+
if (fileFilteringOptions.respectGitIgnore && fileDiscovery.shouldGitIgnoreFile(relativePath)) {
|
|
25060
|
+
gitIgnoredCount++;
|
|
25061
|
+
continue;
|
|
25062
|
+
}
|
|
25063
|
+
if (fileFilteringOptions.respectFssLinkIgnore && fileDiscovery.shouldFssLinkIgnoreFile(relativePath)) {
|
|
25064
|
+
fssLinkIgnoredCount++;
|
|
25065
|
+
continue;
|
|
25066
|
+
}
|
|
25067
|
+
try {
|
|
25068
|
+
const stats2 = fs9.statSync(fullPath);
|
|
25069
|
+
const isDir = stats2.isDirectory();
|
|
25070
|
+
entries.push({
|
|
25071
|
+
name: file,
|
|
25072
|
+
path: fullPath,
|
|
25073
|
+
isDirectory: isDir,
|
|
25074
|
+
size: isDir ? 0 : stats2.size,
|
|
25075
|
+
modifiedTime: stats2.mtime
|
|
25076
|
+
});
|
|
25077
|
+
} catch (error) {
|
|
25078
|
+
console.error(`Error accessing ${fullPath}: ${error}`);
|
|
25079
|
+
}
|
|
25080
|
+
}
|
|
25081
|
+
entries.sort((a, b) => {
|
|
25082
|
+
if (a.isDirectory && !b.isDirectory)
|
|
25083
|
+
return -1;
|
|
25084
|
+
if (!a.isDirectory && b.isDirectory)
|
|
25085
|
+
return 1;
|
|
25086
|
+
return a.name.localeCompare(b.name);
|
|
25087
|
+
});
|
|
25088
|
+
const showMetadata = this.params.show_metadata ?? true;
|
|
25089
|
+
const showIcons = this.params.show_file_icons ?? true;
|
|
25090
|
+
const directoryContent = entries.map((entry) => {
|
|
25091
|
+
let line = "";
|
|
25092
|
+
if (showIcons) {
|
|
25093
|
+
const icon = entry.isDirectory ? "\u{1F4C1}" : getFileTypeIcon(entry.path, entry.isDirectory ? "directory" : "text");
|
|
25094
|
+
line += `${icon} `;
|
|
25095
|
+
}
|
|
25096
|
+
if (!showIcons && entry.isDirectory) {
|
|
25097
|
+
line += "[DIR] ";
|
|
25098
|
+
}
|
|
25099
|
+
line += entry.name;
|
|
25100
|
+
if (showMetadata && !entry.isDirectory) {
|
|
25101
|
+
const size = formatFileSize(entry.size);
|
|
25102
|
+
const time = formatRelativeTime(entry.modifiedTime);
|
|
25103
|
+
line += ` (${size}, ${time})`;
|
|
25104
|
+
} else if (showMetadata && entry.isDirectory) {
|
|
25105
|
+
const time = formatRelativeTime(entry.modifiedTime);
|
|
25106
|
+
line += ` (${time})`;
|
|
25107
|
+
}
|
|
25108
|
+
return line;
|
|
25109
|
+
}).join("\n");
|
|
25110
|
+
let resultMessage = `Directory listing for ${this.params.path}:
|
|
25111
|
+
${directoryContent}`;
|
|
25112
|
+
const ignoredMessages = [];
|
|
25113
|
+
if (gitIgnoredCount > 0) {
|
|
25114
|
+
ignoredMessages.push(`${gitIgnoredCount} git-ignored`);
|
|
25115
|
+
}
|
|
25116
|
+
if (fssLinkIgnoredCount > 0) {
|
|
25117
|
+
ignoredMessages.push(`${fssLinkIgnoredCount} fss-link-ignored`);
|
|
25118
|
+
}
|
|
25119
|
+
if (ignoredMessages.length > 0) {
|
|
25120
|
+
resultMessage += `
|
|
25121
|
+
|
|
25122
|
+
(${ignoredMessages.join(", ")})`;
|
|
25123
|
+
}
|
|
25124
|
+
let displayMessage = `Listed ${entries.length} item(s).`;
|
|
25125
|
+
if (ignoredMessages.length > 0) {
|
|
25126
|
+
displayMessage += ` (${ignoredMessages.join(", ")})`;
|
|
25127
|
+
if (entries.length === 0 && gitIgnoredCount > 0 && this.params.path.includes("scraped_content")) {
|
|
25128
|
+
displayMessage += ` - Use 'ls scraped_content' or 'bash ls scraped_content/' to view web scraper output files`;
|
|
25129
|
+
}
|
|
25130
|
+
}
|
|
25131
|
+
return {
|
|
25132
|
+
llmContent: resultMessage,
|
|
25133
|
+
returnDisplay: displayMessage
|
|
25134
|
+
};
|
|
25135
|
+
} catch (error) {
|
|
25136
|
+
const errorMsg = `Error listing directory: ${error instanceof Error ? error.message : String(error)}`;
|
|
25137
|
+
return this.errorResult(errorMsg, "Failed to list directory.");
|
|
25138
|
+
}
|
|
25139
|
+
}
|
|
25140
|
+
};
|
|
25141
|
+
LSTool = class _LSTool extends BaseDeclarativeTool {
|
|
25142
|
+
config;
|
|
25143
|
+
static Name = "list_directory";
|
|
25144
|
+
constructor(config) {
|
|
25145
|
+
super(_LSTool.Name, "ReadFolder", "Lists the names of files and subdirectories directly within a specified directory path. Can optionally ignore entries matching provided glob patterns.", Kind.Search, {
|
|
25146
|
+
properties: {
|
|
25147
|
+
path: {
|
|
25148
|
+
description: "The absolute path to the directory to list (must be absolute, not relative)",
|
|
25149
|
+
type: "string"
|
|
25150
|
+
},
|
|
25151
|
+
ignore: {
|
|
25152
|
+
description: "List of glob patterns to ignore",
|
|
25153
|
+
items: {
|
|
25154
|
+
type: "string"
|
|
25155
|
+
},
|
|
25156
|
+
type: "array"
|
|
25157
|
+
},
|
|
25158
|
+
file_filtering_options: {
|
|
25159
|
+
description: "Optional: Whether to respect ignore patterns from .gitignore or .fss-linkignore",
|
|
25160
|
+
type: "object",
|
|
25161
|
+
properties: {
|
|
25162
|
+
respect_git_ignore: {
|
|
25163
|
+
description: "Optional: Whether to respect .gitignore patterns when listing files. Only available in git repositories. Defaults to true.",
|
|
25164
|
+
type: "boolean"
|
|
25165
|
+
},
|
|
25166
|
+
respect_gemini_ignore: {
|
|
25167
|
+
description: "Optional: Whether to respect .fss-linkignore patterns when listing files. Defaults to true.",
|
|
25168
|
+
type: "boolean"
|
|
25169
|
+
}
|
|
25170
|
+
}
|
|
25171
|
+
},
|
|
25172
|
+
show_metadata: {
|
|
25173
|
+
description: "Optional: Show file metadata including size and last modified time. Displays file sizes (e.g., 4.2 KB) and relative timestamps (e.g., 2h ago) for better file identification and context.",
|
|
25174
|
+
type: "boolean",
|
|
25175
|
+
default: true
|
|
25176
|
+
},
|
|
25177
|
+
show_file_icons: {
|
|
25178
|
+
description: "Optional: Show file type icons (\u{1F4C1} \u{1F4C4} \u{1F4CB} \u{1F5BC}\uFE0F \u2699\uFE0F) for visual file type identification. Makes directory listings more visually scannable and helps quickly identify file types.",
|
|
25179
|
+
type: "boolean",
|
|
25180
|
+
default: true
|
|
25181
|
+
}
|
|
25182
|
+
},
|
|
25183
|
+
required: ["path"],
|
|
25184
|
+
type: "object"
|
|
25185
|
+
});
|
|
25186
|
+
this.config = config;
|
|
25187
|
+
}
|
|
25188
|
+
/**
|
|
25189
|
+
* Validates the parameters for the tool
|
|
25190
|
+
* @param params Parameters to validate
|
|
25191
|
+
* @returns An error message string if invalid, null otherwise
|
|
25192
|
+
*/
|
|
25193
|
+
validateToolParamValues(params) {
|
|
25194
|
+
if (!path11.isAbsolute(params.path)) {
|
|
25195
|
+
return `Path must be absolute: ${params.path}`;
|
|
25196
|
+
}
|
|
25197
|
+
const workspaceContext = this.config.getWorkspaceContext();
|
|
25198
|
+
if (!workspaceContext.isPathWithinWorkspace(params.path)) {
|
|
25199
|
+
const directories = workspaceContext.getDirectories();
|
|
25200
|
+
return `Path must be within one of the workspace directories: ${directories.join(", ")}`;
|
|
25201
|
+
}
|
|
25202
|
+
return null;
|
|
25203
|
+
}
|
|
25204
|
+
createInvocation(params) {
|
|
25205
|
+
return new LSToolInvocation(this.config, params);
|
|
25206
|
+
}
|
|
25207
|
+
};
|
|
25208
|
+
}
|
|
25209
|
+
});
|
|
25210
|
+
|
|
25150
25211
|
// packages/core/dist/src/tools/read-file.js
|
|
25151
25212
|
import path12 from "path";
|
|
25152
25213
|
import fs10 from "node:fs/promises";
|
|
@@ -25219,7 +25280,7 @@ var init_read_file = __esm({
|
|
|
25219
25280
|
};
|
|
25220
25281
|
}
|
|
25221
25282
|
let llmContent;
|
|
25222
|
-
const useEnhancedFormat = false;
|
|
25283
|
+
const useEnhancedFormat = this.params.enhanced_format ?? false;
|
|
25223
25284
|
const isTextContent = typeof result.llmContent === "string";
|
|
25224
25285
|
if (useEnhancedFormat && isTextContent) {
|
|
25225
25286
|
const relativePath = makeRelative(this.params.absolute_path, this.config.getTargetDir());
|
|
@@ -25232,7 +25293,7 @@ var init_read_file = __esm({
|
|
|
25232
25293
|
const stats = await fs10.stat(this.params.absolute_path);
|
|
25233
25294
|
const fileSize = formatFileSize(stats.size);
|
|
25234
25295
|
fileStatsInfo = ` (${total} lines, ${fileSize}, UTF-8)`;
|
|
25235
|
-
} catch (
|
|
25296
|
+
} catch (_error) {
|
|
25236
25297
|
fileStatsInfo = ` (${total} lines)`;
|
|
25237
25298
|
}
|
|
25238
25299
|
const progress = Math.round(end / total * 100);
|
|
@@ -25252,7 +25313,7 @@ Next: Use offset: ${nextOffset} to continue reading`;
|
|
|
25252
25313
|
const stats = await fs10.stat(this.params.absolute_path);
|
|
25253
25314
|
const fileSize = formatFileSize(stats.size);
|
|
25254
25315
|
fileStatsInfo = ` (${totalLines} lines, ${fileSize}, UTF-8)`;
|
|
25255
|
-
} catch (
|
|
25316
|
+
} catch (_error) {
|
|
25256
25317
|
fileStatsInfo = totalLines > 0 ? ` (${totalLines} lines)` : "";
|
|
25257
25318
|
}
|
|
25258
25319
|
llmContent = `File: ${relativePath}${fileStatsInfo}
|
|
@@ -32607,7 +32668,7 @@ WARNING: Results truncated to prevent context overflow. To see more results:
|
|
|
32607
32668
|
});
|
|
32608
32669
|
|
|
32609
32670
|
// packages/core/dist/src/tools/glob.js
|
|
32610
|
-
import fs13 from "fs";
|
|
32671
|
+
import fs13 from "node:fs";
|
|
32611
32672
|
import path16 from "path";
|
|
32612
32673
|
function sortFileEntries(entries, nowTimestamp, recencyThresholdMs) {
|
|
32613
32674
|
const sortedEntries = [...entries];
|
|
@@ -32764,13 +32825,35 @@ ${fileListDescription}`;
|
|
|
32764
32825
|
}
|
|
32765
32826
|
}
|
|
32766
32827
|
async processFilesWithMetadata(filePaths) {
|
|
32828
|
+
const BATCH_SIZE = 10;
|
|
32829
|
+
const TIMEOUT_MS = 5e3;
|
|
32830
|
+
const MAX_FILE_SIZE_FOR_METADATA = 1024 * 1024;
|
|
32767
32831
|
const results = [];
|
|
32768
|
-
|
|
32832
|
+
const processFileWithTimeout = async (filePath) => {
|
|
32833
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error("Metadata collection timeout")), TIMEOUT_MS));
|
|
32769
32834
|
try {
|
|
32770
|
-
const
|
|
32771
|
-
|
|
32772
|
-
|
|
32773
|
-
|
|
32835
|
+
const stats = await fs13.promises.stat(filePath);
|
|
32836
|
+
if (stats.size > MAX_FILE_SIZE_FOR_METADATA) {
|
|
32837
|
+
const fileType = await detectFileType(filePath);
|
|
32838
|
+
return {
|
|
32839
|
+
path: filePath,
|
|
32840
|
+
metadata: {
|
|
32841
|
+
size: stats.size,
|
|
32842
|
+
lastModified: stats.mtime,
|
|
32843
|
+
totalLines: void 0,
|
|
32844
|
+
// Skip for large files
|
|
32845
|
+
fileType,
|
|
32846
|
+
icon: getFileTypeIcon(filePath, fileType)
|
|
32847
|
+
}
|
|
32848
|
+
};
|
|
32849
|
+
}
|
|
32850
|
+
const metadata = await Promise.race([
|
|
32851
|
+
collectFileMetadata(filePath),
|
|
32852
|
+
timeoutPromise
|
|
32853
|
+
]);
|
|
32854
|
+
return { path: filePath, metadata };
|
|
32855
|
+
} catch (_error) {
|
|
32856
|
+
return {
|
|
32774
32857
|
path: filePath,
|
|
32775
32858
|
metadata: {
|
|
32776
32859
|
size: 0,
|
|
@@ -32778,8 +32861,13 @@ ${fileListDescription}`;
|
|
|
32778
32861
|
fileType: "text",
|
|
32779
32862
|
icon: getFileTypeIcon(filePath, "text")
|
|
32780
32863
|
}
|
|
32781
|
-
}
|
|
32864
|
+
};
|
|
32782
32865
|
}
|
|
32866
|
+
};
|
|
32867
|
+
for (let i = 0; i < filePaths.length; i += BATCH_SIZE) {
|
|
32868
|
+
const batch = filePaths.slice(i, i + BATCH_SIZE);
|
|
32869
|
+
const batchResults = await Promise.all(batch.map((filePath) => processFileWithTimeout(filePath)));
|
|
32870
|
+
results.push(...batchResults);
|
|
32783
32871
|
}
|
|
32784
32872
|
return results;
|
|
32785
32873
|
}
|
|
@@ -70955,7 +71043,7 @@ var init_config = __esm({
|
|
|
70955
71043
|
respectFssLinkIgnore: true
|
|
70956
71044
|
};
|
|
70957
71045
|
DEFAULT_FILE_FILTERING_OPTIONS = {
|
|
70958
|
-
respectGitIgnore:
|
|
71046
|
+
respectGitIgnore: false,
|
|
70959
71047
|
respectGeminiIgnore: true,
|
|
70960
71048
|
respectFssLinkIgnore: true
|
|
70961
71049
|
};
|
|
@@ -81593,6 +81681,7 @@ var init_databaseMigrations = __esm({
|
|
|
81593
81681
|
last_used DATETIME,
|
|
81594
81682
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
81595
81683
|
source TEXT DEFAULT 'db',
|
|
81684
|
+
endpoint_id INTEGER,
|
|
81596
81685
|
UNIQUE(auth_type, model_name, endpoint_url)
|
|
81597
81686
|
)
|
|
81598
81687
|
`);
|
|
@@ -81606,7 +81695,7 @@ var init_databaseMigrations = __esm({
|
|
|
81606
81695
|
db.exec(`
|
|
81607
81696
|
CREATE TABLE IF NOT EXISTS custom_endpoints (
|
|
81608
81697
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
81609
|
-
provider_id INTEGER
|
|
81698
|
+
provider_id INTEGER,
|
|
81610
81699
|
name TEXT NOT NULL,
|
|
81611
81700
|
url TEXT NOT NULL,
|
|
81612
81701
|
description TEXT,
|
|
@@ -81657,8 +81746,17 @@ var init_databaseMigrations = __esm({
|
|
|
81657
81746
|
ON provider_settings(provider_id, setting_key)
|
|
81658
81747
|
`);
|
|
81659
81748
|
db.exec(`
|
|
81660
|
-
CREATE INDEX IF NOT EXISTS idx_provider_usage_stats_aggregation
|
|
81749
|
+
CREATE INDEX IF NOT EXISTS idx_provider_usage_stats_aggregation
|
|
81661
81750
|
ON provider_usage_stats(provider_id, created_at DESC)
|
|
81751
|
+
`);
|
|
81752
|
+
db.exec(`
|
|
81753
|
+
CREATE INDEX IF NOT EXISTS idx_model_configs_endpoint
|
|
81754
|
+
ON model_configs(endpoint_id)
|
|
81755
|
+
WHERE endpoint_id IS NOT NULL
|
|
81756
|
+
`);
|
|
81757
|
+
db.exec(`
|
|
81758
|
+
CREATE INDEX IF NOT EXISTS idx_custom_endpoints_url
|
|
81759
|
+
ON custom_endpoints(url)
|
|
81662
81760
|
`);
|
|
81663
81761
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
81664
81762
|
db.exec(`
|
|
@@ -83342,9 +83440,15 @@ var init_provider_database = __esm({
|
|
|
83342
83440
|
throw new Error("Database not initialized");
|
|
83343
83441
|
}
|
|
83344
83442
|
if (isDefault) {
|
|
83345
|
-
|
|
83346
|
-
|
|
83347
|
-
|
|
83443
|
+
if (providerId !== null) {
|
|
83444
|
+
await safeExecWithLocking(this.db, `
|
|
83445
|
+
UPDATE custom_endpoints SET is_default = 0 WHERE provider_id = ?
|
|
83446
|
+
`, [providerId]);
|
|
83447
|
+
} else {
|
|
83448
|
+
await safeExecWithLocking(this.db, `
|
|
83449
|
+
UPDATE custom_endpoints SET is_default = 0
|
|
83450
|
+
`);
|
|
83451
|
+
}
|
|
83348
83452
|
}
|
|
83349
83453
|
await safeExecWithLocking(this.db, `
|
|
83350
83454
|
INSERT INTO custom_endpoints (provider_id, name, url, description, is_default, created_at)
|
|
@@ -83427,6 +83531,71 @@ var init_provider_database = __esm({
|
|
|
83427
83531
|
]);
|
|
83428
83532
|
return { settings, endpoints, defaultEndpoint };
|
|
83429
83533
|
}
|
|
83534
|
+
/**
|
|
83535
|
+
* Get all custom endpoints (not filtered by provider)
|
|
83536
|
+
*/
|
|
83537
|
+
async getAllCustomEndpoints() {
|
|
83538
|
+
if (!this.db) return [];
|
|
83539
|
+
return await safeQueryWithLocking(this.db, `
|
|
83540
|
+
SELECT id, provider_id, name, url, description, is_default, created_at
|
|
83541
|
+
FROM custom_endpoints
|
|
83542
|
+
ORDER BY created_at DESC
|
|
83543
|
+
`);
|
|
83544
|
+
}
|
|
83545
|
+
/**
|
|
83546
|
+
* Link a model to a custom endpoint
|
|
83547
|
+
*/
|
|
83548
|
+
async linkModelToEndpoint(modelId, endpointId) {
|
|
83549
|
+
if (!this.db) {
|
|
83550
|
+
throw new Error("Database not initialized");
|
|
83551
|
+
}
|
|
83552
|
+
await safeExecWithLocking(this.db, `
|
|
83553
|
+
UPDATE model_configs SET endpoint_id = ? WHERE id = ?
|
|
83554
|
+
`, [endpointId, modelId]);
|
|
83555
|
+
}
|
|
83556
|
+
/**
|
|
83557
|
+
* Get the custom endpoint for a model (if any)
|
|
83558
|
+
*/
|
|
83559
|
+
async getEndpointForModel(modelId) {
|
|
83560
|
+
if (!this.db) return null;
|
|
83561
|
+
const model = await safeQueryFirstWithLocking(
|
|
83562
|
+
this.db,
|
|
83563
|
+
`SELECT endpoint_id FROM model_configs WHERE id = ?`,
|
|
83564
|
+
[modelId]
|
|
83565
|
+
);
|
|
83566
|
+
if (!model || !model.endpoint_id) {
|
|
83567
|
+
return null;
|
|
83568
|
+
}
|
|
83569
|
+
return await safeQueryFirstWithLocking(
|
|
83570
|
+
this.db,
|
|
83571
|
+
`SELECT * FROM custom_endpoints WHERE id = ?`,
|
|
83572
|
+
[model.endpoint_id]
|
|
83573
|
+
);
|
|
83574
|
+
}
|
|
83575
|
+
/**
|
|
83576
|
+
* Get or create a custom endpoint by URL
|
|
83577
|
+
*/
|
|
83578
|
+
async getOrCreateEndpointByUrl(url2, name2, description) {
|
|
83579
|
+
if (!this.db) {
|
|
83580
|
+
throw new Error("Database not initialized");
|
|
83581
|
+
}
|
|
83582
|
+
const existing = await safeQueryFirstWithLocking(
|
|
83583
|
+
this.db,
|
|
83584
|
+
`SELECT id FROM custom_endpoints WHERE url = ?`,
|
|
83585
|
+
[url2]
|
|
83586
|
+
);
|
|
83587
|
+
if (existing) {
|
|
83588
|
+
return existing.id;
|
|
83589
|
+
}
|
|
83590
|
+
const endpointName = name2 || `Endpoint (${url2.substring(0, 50)})`;
|
|
83591
|
+
return await this.saveCustomEndpoint(
|
|
83592
|
+
null,
|
|
83593
|
+
endpointName,
|
|
83594
|
+
url2,
|
|
83595
|
+
description,
|
|
83596
|
+
false
|
|
83597
|
+
);
|
|
83598
|
+
}
|
|
83430
83599
|
};
|
|
83431
83600
|
}
|
|
83432
83601
|
});
|
|
@@ -83936,6 +84105,34 @@ var init_unified_database = __esm({
|
|
|
83936
84105
|
await this.ensureInitialized();
|
|
83937
84106
|
return await this.providerDb.getProviderConfiguration(providerId);
|
|
83938
84107
|
}
|
|
84108
|
+
/**
|
|
84109
|
+
* Get all custom endpoints (no provider filter)
|
|
84110
|
+
*/
|
|
84111
|
+
async getAllCustomEndpoints() {
|
|
84112
|
+
await this.ensureInitialized();
|
|
84113
|
+
return await this.providerDb.getAllCustomEndpoints();
|
|
84114
|
+
}
|
|
84115
|
+
/**
|
|
84116
|
+
* Link model to custom endpoint
|
|
84117
|
+
*/
|
|
84118
|
+
async linkModelToEndpoint(modelId, endpointId) {
|
|
84119
|
+
await this.ensureInitialized();
|
|
84120
|
+
await this.providerDb.linkModelToEndpoint(modelId, endpointId);
|
|
84121
|
+
}
|
|
84122
|
+
/**
|
|
84123
|
+
* Get custom endpoint for a model
|
|
84124
|
+
*/
|
|
84125
|
+
async getEndpointForModel(modelId) {
|
|
84126
|
+
await this.ensureInitialized();
|
|
84127
|
+
return await this.providerDb.getEndpointForModel(modelId);
|
|
84128
|
+
}
|
|
84129
|
+
/**
|
|
84130
|
+
* Get or create custom endpoint by URL
|
|
84131
|
+
*/
|
|
84132
|
+
async getOrCreateEndpointByUrl(url2, name2, description) {
|
|
84133
|
+
await this.ensureInitialized();
|
|
84134
|
+
return await this.providerDb.getOrCreateEndpointByUrl(url2, name2, description);
|
|
84135
|
+
}
|
|
83939
84136
|
// ==================== PREFERENCES DATABASE DELEGATION ====================
|
|
83940
84137
|
/**
|
|
83941
84138
|
* Set user preference
|
|
@@ -84423,6 +84620,18 @@ var init_database = __esm({
|
|
|
84423
84620
|
async getProviderConfiguration(providerId) {
|
|
84424
84621
|
return await this.unifiedDb.getProviderConfiguration(providerId);
|
|
84425
84622
|
}
|
|
84623
|
+
async getAllCustomEndpoints() {
|
|
84624
|
+
return await this.unifiedDb.getAllCustomEndpoints();
|
|
84625
|
+
}
|
|
84626
|
+
async linkModelToEndpoint(modelId, endpointId) {
|
|
84627
|
+
await this.unifiedDb.linkModelToEndpoint(modelId, endpointId);
|
|
84628
|
+
}
|
|
84629
|
+
async getEndpointForModel(modelId) {
|
|
84630
|
+
return await this.unifiedDb.getEndpointForModel(modelId);
|
|
84631
|
+
}
|
|
84632
|
+
async getOrCreateEndpointByUrl(url2, name2, description) {
|
|
84633
|
+
return await this.unifiedDb.getOrCreateEndpointByUrl(url2, name2, description);
|
|
84634
|
+
}
|
|
84426
84635
|
// ==================== USER PREFERENCES DELEGATION ====================
|
|
84427
84636
|
async setUserPreference(key, value) {
|
|
84428
84637
|
await this.unifiedDb.setUserPreference(key, value);
|
|
@@ -87863,12 +88072,12 @@ import React28 from "react";
|
|
|
87863
88072
|
import { render as render2 } from "ink";
|
|
87864
88073
|
|
|
87865
88074
|
// packages/cli/src/ui/App.tsx
|
|
87866
|
-
import { useCallback as useCallback28, useEffect as
|
|
88075
|
+
import { useCallback as useCallback28, useEffect as useEffect41, useMemo as useMemo9, useState as useState44, useRef as useRef12 } from "react";
|
|
87867
88076
|
import {
|
|
87868
|
-
Box as
|
|
88077
|
+
Box as Box56,
|
|
87869
88078
|
measureElement,
|
|
87870
88079
|
Static,
|
|
87871
|
-
Text as
|
|
88080
|
+
Text as Text60,
|
|
87872
88081
|
useStdin as useStdin3,
|
|
87873
88082
|
useStdout as useStdout2
|
|
87874
88083
|
} from "ink";
|
|
@@ -93928,7 +94137,7 @@ async function getPackageJson() {
|
|
|
93928
94137
|
// packages/cli/src/utils/version.ts
|
|
93929
94138
|
async function getCliVersion() {
|
|
93930
94139
|
const pkgJson = await getPackageJson();
|
|
93931
|
-
return "1.1.
|
|
94140
|
+
return "1.1.3";
|
|
93932
94141
|
}
|
|
93933
94142
|
|
|
93934
94143
|
// packages/cli/src/ui/commands/aboutCommand.ts
|
|
@@ -93980,7 +94189,7 @@ import open4 from "open";
|
|
|
93980
94189
|
import process11 from "node:process";
|
|
93981
94190
|
|
|
93982
94191
|
// packages/cli/src/generated/git-commit.ts
|
|
93983
|
-
var GIT_COMMIT_INFO = "
|
|
94192
|
+
var GIT_COMMIT_INFO = "99b118f2";
|
|
93984
94193
|
|
|
93985
94194
|
// packages/cli/src/ui/commands/bugCommand.ts
|
|
93986
94195
|
init_dist2();
|
|
@@ -117761,8 +117970,8 @@ def fibonacci(n):
|
|
|
117761
117970
|
|
|
117762
117971
|
// packages/cli/src/ui/components/AuthDialog.tsx
|
|
117763
117972
|
init_dist2();
|
|
117764
|
-
import { Box as
|
|
117765
|
-
import { useState as
|
|
117973
|
+
import { Box as Box20, Text as Text27 } from "ink";
|
|
117974
|
+
import { useState as useState33 } from "react";
|
|
117766
117975
|
|
|
117767
117976
|
// packages/cli/src/config/auth.ts
|
|
117768
117977
|
init_dist2();
|
|
@@ -117839,10 +118048,11 @@ import { Box as Box16, Text as Text23, useInput } from "ink";
|
|
|
117839
118048
|
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
117840
118049
|
function OpenAIKeyPrompt({
|
|
117841
118050
|
onSubmit,
|
|
117842
|
-
onCancel
|
|
118051
|
+
onCancel,
|
|
118052
|
+
prefilledEndpointUrl
|
|
117843
118053
|
}) {
|
|
117844
118054
|
const [apiKey, setApiKey] = useState29("");
|
|
117845
|
-
const [baseUrl, setBaseUrl] = useState29("");
|
|
118055
|
+
const [baseUrl, setBaseUrl] = useState29(prefilledEndpointUrl || "");
|
|
117846
118056
|
const [model, setModel] = useState29("");
|
|
117847
118057
|
const [currentField, setCurrentField] = useState29("apiKey");
|
|
117848
118058
|
useInput((input, key) => {
|
|
@@ -118255,7 +118465,91 @@ function LMStudioModelPrompt({
|
|
|
118255
118465
|
|
|
118256
118466
|
// packages/cli/src/ui/components/AuthDialog.tsx
|
|
118257
118467
|
init_modelManager();
|
|
118468
|
+
|
|
118469
|
+
// packages/cli/src/ui/components/OpenAIEndpointDialog.tsx
|
|
118470
|
+
import { useState as useState32, useEffect as useEffect32 } from "react";
|
|
118471
|
+
import { Box as Box19, Text as Text26 } from "ink";
|
|
118472
|
+
init_database();
|
|
118258
118473
|
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
118474
|
+
var COMMON_ENDPOINTS = [
|
|
118475
|
+
{
|
|
118476
|
+
name: "OpenAI Official",
|
|
118477
|
+
url: "https://api.openai.com/v1",
|
|
118478
|
+
description: "Official OpenAI API endpoint",
|
|
118479
|
+
isDefault: true
|
|
118480
|
+
},
|
|
118481
|
+
{
|
|
118482
|
+
name: "Azure OpenAI",
|
|
118483
|
+
url: "https://your-resource.openai.azure.com",
|
|
118484
|
+
description: "Azure OpenAI Service endpoint",
|
|
118485
|
+
isDefault: false
|
|
118486
|
+
},
|
|
118487
|
+
{
|
|
118488
|
+
name: "Custom Local",
|
|
118489
|
+
url: "http://localhost:8000/v1",
|
|
118490
|
+
description: "Local OpenAI-compatible server",
|
|
118491
|
+
isDefault: false
|
|
118492
|
+
}
|
|
118493
|
+
];
|
|
118494
|
+
function OpenAIEndpointDialog({
|
|
118495
|
+
onSelect,
|
|
118496
|
+
onCancel
|
|
118497
|
+
}) {
|
|
118498
|
+
const [savedEndpoints, setSavedEndpoints] = useState32([]);
|
|
118499
|
+
const [isLoading, setIsLoading] = useState32(true);
|
|
118500
|
+
useEffect32(() => {
|
|
118501
|
+
const loadEndpoints = async () => {
|
|
118502
|
+
try {
|
|
118503
|
+
const db = await getFSSLinkDatabase();
|
|
118504
|
+
const saved = await db.getAllCustomEndpoints();
|
|
118505
|
+
setSavedEndpoints(saved.map((e2) => ({
|
|
118506
|
+
id: e2.id,
|
|
118507
|
+
name: e2.name,
|
|
118508
|
+
url: e2.url,
|
|
118509
|
+
description: e2.description || void 0,
|
|
118510
|
+
isDefault: Boolean(e2.is_default)
|
|
118511
|
+
})));
|
|
118512
|
+
} catch (error) {
|
|
118513
|
+
console.error("Failed to load endpoints:", error);
|
|
118514
|
+
} finally {
|
|
118515
|
+
setIsLoading(false);
|
|
118516
|
+
}
|
|
118517
|
+
};
|
|
118518
|
+
loadEndpoints();
|
|
118519
|
+
}, []);
|
|
118520
|
+
const allEndpoints = [...savedEndpoints, ...COMMON_ENDPOINTS];
|
|
118521
|
+
const handleSelect = (endpoint) => {
|
|
118522
|
+
onSelect(endpoint);
|
|
118523
|
+
};
|
|
118524
|
+
useKeypress((key) => {
|
|
118525
|
+
if (key.name === "escape") {
|
|
118526
|
+
onCancel();
|
|
118527
|
+
}
|
|
118528
|
+
}, { isActive: true });
|
|
118529
|
+
if (isLoading) {
|
|
118530
|
+
return /* @__PURE__ */ jsx24(Box19, { flexDirection: "column", padding: 1, children: /* @__PURE__ */ jsx24(Text26, { children: "Loading endpoints..." }) });
|
|
118531
|
+
}
|
|
118532
|
+
return /* @__PURE__ */ jsxs22(Box19, { flexDirection: "column", padding: 1, children: [
|
|
118533
|
+
/* @__PURE__ */ jsx24(Text26, { bold: true, color: Colors.AccentBlue, children: "Select OpenAI Endpoint" }),
|
|
118534
|
+
/* @__PURE__ */ jsx24(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text26, { children: "Choose an OpenAI API endpoint:" }) }),
|
|
118535
|
+
/* @__PURE__ */ jsx24(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx24(
|
|
118536
|
+
RadioButtonSelect,
|
|
118537
|
+
{
|
|
118538
|
+
items: allEndpoints.map((e2) => ({
|
|
118539
|
+
label: e2.name,
|
|
118540
|
+
value: e2
|
|
118541
|
+
})),
|
|
118542
|
+
initialIndex: 0,
|
|
118543
|
+
onSelect: handleSelect
|
|
118544
|
+
}
|
|
118545
|
+
) }),
|
|
118546
|
+
/* @__PURE__ */ jsx24(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx24(Text26, { color: Colors.Gray, children: "(Press Escape to cancel)" }) })
|
|
118547
|
+
] });
|
|
118548
|
+
}
|
|
118549
|
+
|
|
118550
|
+
// packages/cli/src/ui/components/AuthDialog.tsx
|
|
118551
|
+
init_database();
|
|
118552
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
118259
118553
|
function parseDefaultAuthType(defaultAuthType) {
|
|
118260
118554
|
if (defaultAuthType && Object.values(AuthType).includes(defaultAuthType)) {
|
|
118261
118555
|
return defaultAuthType;
|
|
@@ -118267,12 +118561,14 @@ function AuthDialog({
|
|
|
118267
118561
|
settings,
|
|
118268
118562
|
initialErrorMessage
|
|
118269
118563
|
}) {
|
|
118270
|
-
const [errorMessage, setErrorMessage] =
|
|
118564
|
+
const [errorMessage, setErrorMessage] = useState33(
|
|
118271
118565
|
initialErrorMessage || null
|
|
118272
118566
|
);
|
|
118273
|
-
const [showOpenAIKeyPrompt, setShowOpenAIKeyPrompt] =
|
|
118274
|
-
const [showOllamaModelPrompt, setShowOllamaModelPrompt] =
|
|
118275
|
-
const [showLMStudioModelPrompt, setShowLMStudioModelPrompt] =
|
|
118567
|
+
const [showOpenAIKeyPrompt, setShowOpenAIKeyPrompt] = useState33(false);
|
|
118568
|
+
const [showOllamaModelPrompt, setShowOllamaModelPrompt] = useState33(false);
|
|
118569
|
+
const [showLMStudioModelPrompt, setShowLMStudioModelPrompt] = useState33(false);
|
|
118570
|
+
const [showOpenAIEndpointDialog, setShowOpenAIEndpointDialog] = useState33(false);
|
|
118571
|
+
const [selectedEndpoint, setSelectedEndpoint] = useState33(null);
|
|
118276
118572
|
const items = [
|
|
118277
118573
|
{ label: "FSS Link OAuth", value: AuthType.QWEN_OAUTH },
|
|
118278
118574
|
{ label: "OpenAI", value: AuthType.USE_OPENAI },
|
|
@@ -118301,7 +118597,7 @@ function AuthDialog({
|
|
|
118301
118597
|
const error = validateAuthMethod(authMethod);
|
|
118302
118598
|
if (error) {
|
|
118303
118599
|
if (authMethod === AuthType.USE_OPENAI && !process.env["OPENAI_API_KEY"]) {
|
|
118304
|
-
|
|
118600
|
+
setShowOpenAIEndpointDialog(true);
|
|
118305
118601
|
setErrorMessage(null);
|
|
118306
118602
|
} else {
|
|
118307
118603
|
setErrorMessage(error);
|
|
@@ -118317,18 +118613,22 @@ function AuthDialog({
|
|
|
118317
118613
|
onSelect(authMethod, "User" /* User */);
|
|
118318
118614
|
}
|
|
118319
118615
|
};
|
|
118320
|
-
const handleOpenAIKeySubmit = (apiKey, baseUrl, model) => {
|
|
118616
|
+
const handleOpenAIKeySubmit = async (apiKey, baseUrl, model) => {
|
|
118321
118617
|
setOpenAIApiKey(apiKey);
|
|
118322
118618
|
setOpenAIBaseUrl(baseUrl);
|
|
118323
118619
|
setOpenAIModel(model);
|
|
118324
118620
|
const modelManager = getModelManager();
|
|
118325
|
-
modelManager.configureModel(
|
|
118621
|
+
const modelId = await modelManager.configureModel(
|
|
118326
118622
|
AuthType.USE_OPENAI,
|
|
118327
118623
|
model,
|
|
118328
118624
|
baseUrl,
|
|
118329
118625
|
apiKey,
|
|
118330
118626
|
`OpenAI: ${model}`
|
|
118331
118627
|
);
|
|
118628
|
+
if (selectedEndpoint && selectedEndpoint.id && modelId) {
|
|
118629
|
+
const db = await getFSSLinkDatabase();
|
|
118630
|
+
await db.linkModelToEndpoint(modelId, selectedEndpoint.id);
|
|
118631
|
+
}
|
|
118332
118632
|
setShowOpenAIKeyPrompt(false);
|
|
118333
118633
|
onSelect(AuthType.USE_OPENAI, "User" /* User */);
|
|
118334
118634
|
};
|
|
@@ -118374,6 +118674,16 @@ function AuthDialog({
|
|
|
118374
118674
|
setShowLMStudioModelPrompt(false);
|
|
118375
118675
|
setErrorMessage(null);
|
|
118376
118676
|
};
|
|
118677
|
+
const handleEndpointSelect = (endpoint) => {
|
|
118678
|
+
setSelectedEndpoint(endpoint);
|
|
118679
|
+
setShowOpenAIEndpointDialog(false);
|
|
118680
|
+
setShowOpenAIKeyPrompt(true);
|
|
118681
|
+
};
|
|
118682
|
+
const handleEndpointCancel = () => {
|
|
118683
|
+
setShowOpenAIEndpointDialog(false);
|
|
118684
|
+
setSelectedEndpoint(null);
|
|
118685
|
+
setErrorMessage("OpenAI endpoint selection is required.");
|
|
118686
|
+
};
|
|
118377
118687
|
useKeypress(
|
|
118378
118688
|
(key) => {
|
|
118379
118689
|
if (showOpenAIKeyPrompt || showOllamaModelPrompt || showLMStudioModelPrompt) {
|
|
@@ -118394,17 +118704,27 @@ function AuthDialog({
|
|
|
118394
118704
|
},
|
|
118395
118705
|
{ isActive: true }
|
|
118396
118706
|
);
|
|
118707
|
+
if (showOpenAIEndpointDialog) {
|
|
118708
|
+
return /* @__PURE__ */ jsx25(
|
|
118709
|
+
OpenAIEndpointDialog,
|
|
118710
|
+
{
|
|
118711
|
+
onSelect: handleEndpointSelect,
|
|
118712
|
+
onCancel: handleEndpointCancel
|
|
118713
|
+
}
|
|
118714
|
+
);
|
|
118715
|
+
}
|
|
118397
118716
|
if (showOpenAIKeyPrompt) {
|
|
118398
|
-
return /* @__PURE__ */
|
|
118717
|
+
return /* @__PURE__ */ jsx25(
|
|
118399
118718
|
OpenAIKeyPrompt,
|
|
118400
118719
|
{
|
|
118401
118720
|
onSubmit: handleOpenAIKeySubmit,
|
|
118402
|
-
onCancel: handleOpenAIKeyCancel
|
|
118721
|
+
onCancel: handleOpenAIKeyCancel,
|
|
118722
|
+
prefilledEndpointUrl: selectedEndpoint?.url
|
|
118403
118723
|
}
|
|
118404
118724
|
);
|
|
118405
118725
|
}
|
|
118406
118726
|
if (showOllamaModelPrompt) {
|
|
118407
|
-
return /* @__PURE__ */
|
|
118727
|
+
return /* @__PURE__ */ jsx25(
|
|
118408
118728
|
OllamaModelPrompt,
|
|
118409
118729
|
{
|
|
118410
118730
|
onSubmit: handleOllamaModelSubmit,
|
|
@@ -118413,7 +118733,7 @@ function AuthDialog({
|
|
|
118413
118733
|
);
|
|
118414
118734
|
}
|
|
118415
118735
|
if (showLMStudioModelPrompt) {
|
|
118416
|
-
return /* @__PURE__ */
|
|
118736
|
+
return /* @__PURE__ */ jsx25(
|
|
118417
118737
|
LMStudioModelPrompt,
|
|
118418
118738
|
{
|
|
118419
118739
|
onSubmit: handleLMStudioModelSubmit,
|
|
@@ -118421,8 +118741,8 @@ function AuthDialog({
|
|
|
118421
118741
|
}
|
|
118422
118742
|
);
|
|
118423
118743
|
}
|
|
118424
|
-
return /* @__PURE__ */
|
|
118425
|
-
|
|
118744
|
+
return /* @__PURE__ */ jsxs23(
|
|
118745
|
+
Box20,
|
|
118426
118746
|
{
|
|
118427
118747
|
borderStyle: "round",
|
|
118428
118748
|
borderColor: Colors.Gray,
|
|
@@ -118430,9 +118750,9 @@ function AuthDialog({
|
|
|
118430
118750
|
padding: 1,
|
|
118431
118751
|
width: "100%",
|
|
118432
118752
|
children: [
|
|
118433
|
-
/* @__PURE__ */
|
|
118434
|
-
/* @__PURE__ */
|
|
118435
|
-
/* @__PURE__ */
|
|
118753
|
+
/* @__PURE__ */ jsx25(Text27, { bold: true, children: "Get started" }),
|
|
118754
|
+
/* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(Text27, { children: "How would you like to authenticate for this project?" }) }),
|
|
118755
|
+
/* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(
|
|
118436
118756
|
RadioButtonSelect,
|
|
118437
118757
|
{
|
|
118438
118758
|
items,
|
|
@@ -118440,18 +118760,18 @@ function AuthDialog({
|
|
|
118440
118760
|
onSelect: handleAuthSelect
|
|
118441
118761
|
}
|
|
118442
118762
|
) }),
|
|
118443
|
-
errorMessage && /* @__PURE__ */
|
|
118444
|
-
/* @__PURE__ */
|
|
118445
|
-
/* @__PURE__ */
|
|
118446
|
-
/* @__PURE__ */
|
|
118763
|
+
errorMessage && /* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(Text27, { color: Colors.AccentRed, children: errorMessage }) }),
|
|
118764
|
+
/* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(Text27, { color: Colors.AccentPurple, children: "(Use Enter to Set Auth)" }) }),
|
|
118765
|
+
/* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(Text27, { children: "Terms of Services and Privacy Notice for FSS Link" }) }),
|
|
118766
|
+
/* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(Text27, { color: Colors.AccentBlue, children: "https://github.com/FSSCoding/fss-link/blob/main/README.md" }) })
|
|
118447
118767
|
]
|
|
118448
118768
|
}
|
|
118449
118769
|
);
|
|
118450
118770
|
}
|
|
118451
118771
|
|
|
118452
118772
|
// packages/cli/src/ui/components/WelcomeBackDialog.tsx
|
|
118453
|
-
import { Box as
|
|
118454
|
-
import { Fragment as Fragment4, jsx as
|
|
118773
|
+
import { Box as Box21, Text as Text28 } from "ink";
|
|
118774
|
+
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
118455
118775
|
var WelcomeBackDialog = ({
|
|
118456
118776
|
projectSummary,
|
|
118457
118777
|
onContinue,
|
|
@@ -118550,43 +118870,43 @@ var WelcomeBackDialog = ({
|
|
|
118550
118870
|
break;
|
|
118551
118871
|
}
|
|
118552
118872
|
};
|
|
118553
|
-
return /* @__PURE__ */
|
|
118554
|
-
/* @__PURE__ */
|
|
118555
|
-
/* @__PURE__ */
|
|
118556
|
-
projectSummary.projectGoal && /* @__PURE__ */
|
|
118557
|
-
/* @__PURE__ */
|
|
118873
|
+
return /* @__PURE__ */ jsxs24(Box21, { flexDirection: "column", padding: 1, children: [
|
|
118874
|
+
/* @__PURE__ */ jsx26(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsx26(Text28, { bold: true, color: Colors.AccentPurple, children: "Welcome Back to FSS Link" }) }),
|
|
118875
|
+
/* @__PURE__ */ jsxs24(Box21, { flexDirection: "column", marginBottom: 2, paddingX: 1, children: [
|
|
118876
|
+
projectSummary.projectGoal && /* @__PURE__ */ jsx26(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsxs24(Text28, { color: Colors.Foreground, children: [
|
|
118877
|
+
/* @__PURE__ */ jsx26(Text28, { bold: true, children: "Project:" }),
|
|
118558
118878
|
" ",
|
|
118559
118879
|
projectSummary.projectGoal
|
|
118560
118880
|
] }) }),
|
|
118561
|
-
/* @__PURE__ */
|
|
118562
|
-
/* @__PURE__ */
|
|
118563
|
-
/* @__PURE__ */
|
|
118881
|
+
/* @__PURE__ */ jsxs24(Box21, { flexDirection: "row", marginBottom: 1, children: [
|
|
118882
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: "Last worked: " }),
|
|
118883
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Foreground, children: projectSummary.timeAgo })
|
|
118564
118884
|
] }),
|
|
118565
|
-
/* @__PURE__ */
|
|
118566
|
-
/* @__PURE__ */
|
|
118567
|
-
/* @__PURE__ */
|
|
118568
|
-
projectSummary.activeSessions > 0 && /* @__PURE__ */
|
|
118569
|
-
/* @__PURE__ */
|
|
118570
|
-
/* @__PURE__ */
|
|
118885
|
+
/* @__PURE__ */ jsxs24(Box21, { flexDirection: "row", marginBottom: 1, children: [
|
|
118886
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: "Sessions: " }),
|
|
118887
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Foreground, children: projectSummary.totalSessions }),
|
|
118888
|
+
projectSummary.activeSessions > 0 && /* @__PURE__ */ jsxs24(Fragment4, { children: [
|
|
118889
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: " (" }),
|
|
118890
|
+
/* @__PURE__ */ jsxs24(Text28, { color: Colors.AccentGreen, children: [
|
|
118571
118891
|
projectSummary.activeSessions,
|
|
118572
118892
|
" active"
|
|
118573
118893
|
] }),
|
|
118574
|
-
/* @__PURE__ */
|
|
118894
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: ")" })
|
|
118575
118895
|
] })
|
|
118576
118896
|
] }),
|
|
118577
|
-
/* @__PURE__ */
|
|
118578
|
-
/* @__PURE__ */
|
|
118579
|
-
/* @__PURE__ */
|
|
118897
|
+
/* @__PURE__ */ jsxs24(Box21, { flexDirection: "row", marginBottom: 1, children: [
|
|
118898
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: "Momentum: " }),
|
|
118899
|
+
/* @__PURE__ */ jsxs24(Text28, { color: getMomentumColor(projectSummary.momentum), children: [
|
|
118580
118900
|
getMomentumEmoji(projectSummary.momentum),
|
|
118581
118901
|
" ",
|
|
118582
118902
|
projectSummary.momentum
|
|
118583
118903
|
] })
|
|
118584
118904
|
] }),
|
|
118585
|
-
projectSummary.gitStatus && /* @__PURE__ */
|
|
118586
|
-
/* @__PURE__ */
|
|
118587
|
-
/* @__PURE__ */
|
|
118588
|
-
/* @__PURE__ */
|
|
118589
|
-
(projectSummary.gitStatus.ahead || projectSummary.gitStatus.behind) && /* @__PURE__ */
|
|
118905
|
+
projectSummary.gitStatus && /* @__PURE__ */ jsxs24(Box21, { flexDirection: "column", marginBottom: 1, children: [
|
|
118906
|
+
/* @__PURE__ */ jsxs24(Box21, { flexDirection: "row", marginBottom: 1, children: [
|
|
118907
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: "Branch: " }),
|
|
118908
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.AccentBlue, children: projectSummary.gitStatus.branch }),
|
|
118909
|
+
(projectSummary.gitStatus.ahead || projectSummary.gitStatus.behind) && /* @__PURE__ */ jsxs24(Text28, { color: Colors.Gray, children: [
|
|
118590
118910
|
" ",
|
|
118591
118911
|
"[",
|
|
118592
118912
|
projectSummary.gitStatus.ahead && `\u2191${projectSummary.gitStatus.ahead}`,
|
|
@@ -118595,21 +118915,21 @@ var WelcomeBackDialog = ({
|
|
|
118595
118915
|
"]"
|
|
118596
118916
|
] })
|
|
118597
118917
|
] }),
|
|
118598
|
-
projectSummary.gitStatus.hasChanges && /* @__PURE__ */
|
|
118599
|
-
/* @__PURE__ */
|
|
118600
|
-
projectSummary.gitStatus.stagedFiles > 0 && /* @__PURE__ */
|
|
118918
|
+
projectSummary.gitStatus.hasChanges && /* @__PURE__ */ jsxs24(Box21, { flexDirection: "row", marginBottom: 1, children: [
|
|
118919
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: "Changes: " }),
|
|
118920
|
+
projectSummary.gitStatus.stagedFiles > 0 && /* @__PURE__ */ jsxs24(Text28, { color: Colors.AccentGreen, children: [
|
|
118601
118921
|
projectSummary.gitStatus.stagedFiles,
|
|
118602
118922
|
" staged"
|
|
118603
118923
|
] }),
|
|
118604
|
-
projectSummary.gitStatus.stagedFiles > 0 && projectSummary.gitStatus.unstagedFiles > 0 && /* @__PURE__ */
|
|
118605
|
-
projectSummary.gitStatus.unstagedFiles > 0 && /* @__PURE__ */
|
|
118924
|
+
projectSummary.gitStatus.stagedFiles > 0 && projectSummary.gitStatus.unstagedFiles > 0 && /* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: ", " }),
|
|
118925
|
+
projectSummary.gitStatus.unstagedFiles > 0 && /* @__PURE__ */ jsxs24(Text28, { color: Colors.AccentYellow, children: [
|
|
118606
118926
|
projectSummary.gitStatus.unstagedFiles,
|
|
118607
118927
|
" unstaged"
|
|
118608
118928
|
] })
|
|
118609
118929
|
] }),
|
|
118610
|
-
projectSummary.gitStatus.lastCommitMessage && /* @__PURE__ */
|
|
118611
|
-
/* @__PURE__ */
|
|
118612
|
-
/* @__PURE__ */
|
|
118930
|
+
projectSummary.gitStatus.lastCommitMessage && /* @__PURE__ */ jsxs24(Box21, { flexDirection: "row", marginBottom: 1, children: [
|
|
118931
|
+
/* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: "Last commit: " }),
|
|
118932
|
+
/* @__PURE__ */ jsxs24(Text28, { color: Colors.Foreground, children: [
|
|
118613
118933
|
projectSummary.gitStatus.lastCommitHash,
|
|
118614
118934
|
' "',
|
|
118615
118935
|
projectSummary.gitStatus.lastCommitMessage,
|
|
@@ -118617,52 +118937,52 @@ var WelcomeBackDialog = ({
|
|
|
118617
118937
|
] })
|
|
118618
118938
|
] })
|
|
118619
118939
|
] }),
|
|
118620
|
-
(projectSummary.efficiency || projectSummary.recentActivity || projectSummary.tokenEfficiency) && /* @__PURE__ */
|
|
118621
|
-
/* @__PURE__ */
|
|
118622
|
-
projectSummary.efficiency && /* @__PURE__ */
|
|
118940
|
+
(projectSummary.efficiency || projectSummary.recentActivity || projectSummary.tokenEfficiency) && /* @__PURE__ */ jsxs24(Box21, { flexDirection: "column", marginBottom: 1, paddingY: 1, borderStyle: "single", borderColor: Colors.Gray, children: [
|
|
118941
|
+
/* @__PURE__ */ jsx26(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsx26(Text28, { bold: true, color: Colors.AccentPurple, children: "Quick Status" }) }),
|
|
118942
|
+
projectSummary.efficiency && /* @__PURE__ */ jsx26(Box21, { flexDirection: "row", marginBottom: 1, children: /* @__PURE__ */ jsxs24(Text28, { color: getEfficiencyColor(projectSummary.efficiency), children: [
|
|
118623
118943
|
getEfficiencyEmoji(projectSummary.efficiency),
|
|
118624
118944
|
" ",
|
|
118625
118945
|
projectSummary.efficiency,
|
|
118626
118946
|
" efficiency"
|
|
118627
118947
|
] }) }),
|
|
118628
|
-
projectSummary.recentActivity && /* @__PURE__ */
|
|
118629
|
-
projectSummary.tokenEfficiency && /* @__PURE__ */
|
|
118948
|
+
projectSummary.recentActivity && /* @__PURE__ */ jsx26(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsx26(Text28, { color: Colors.Foreground, children: projectSummary.recentActivity }) }),
|
|
118949
|
+
projectSummary.tokenEfficiency && /* @__PURE__ */ jsx26(Box21, { children: /* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: projectSummary.tokenEfficiency }) })
|
|
118630
118950
|
] }),
|
|
118631
|
-
projectSummary.nextSuggestion && /* @__PURE__ */
|
|
118951
|
+
projectSummary.nextSuggestion && /* @__PURE__ */ jsx26(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsxs24(Text28, { color: Colors.AccentPurple, children: [
|
|
118632
118952
|
"\u{1F4A1} ",
|
|
118633
118953
|
projectSummary.nextSuggestion
|
|
118634
118954
|
] }) }),
|
|
118635
|
-
projectSummary.lastContent && /* @__PURE__ */
|
|
118955
|
+
projectSummary.lastContent && /* @__PURE__ */ jsx26(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsxs24(Text28, { color: Colors.Gray, children: [
|
|
118636
118956
|
'Last message: "',
|
|
118637
118957
|
projectSummary.lastContent,
|
|
118638
118958
|
'"'
|
|
118639
118959
|
] }) })
|
|
118640
118960
|
] }),
|
|
118641
|
-
/* @__PURE__ */
|
|
118961
|
+
/* @__PURE__ */ jsx26(
|
|
118642
118962
|
RadioButtonSelect,
|
|
118643
118963
|
{
|
|
118644
118964
|
items,
|
|
118645
118965
|
onSelect: handleSelection
|
|
118646
118966
|
}
|
|
118647
118967
|
),
|
|
118648
|
-
/* @__PURE__ */
|
|
118968
|
+
/* @__PURE__ */ jsx26(Box21, { marginTop: 1, paddingX: 1, children: /* @__PURE__ */ jsx26(Text28, { color: Colors.Gray, children: "Press C to continue, R to restart, Q to cancel, or use \u2191\u2193 arrows" }) })
|
|
118649
118969
|
] });
|
|
118650
118970
|
};
|
|
118651
118971
|
|
|
118652
118972
|
// packages/cli/src/ui/components/SearchEngineConfigDialog.tsx
|
|
118653
|
-
import { useState as
|
|
118654
|
-
import { Box as
|
|
118973
|
+
import { useState as useState34, useEffect as useEffect33 } from "react";
|
|
118974
|
+
import { Box as Box22, Text as Text29, useInput as useInput4 } from "ink";
|
|
118655
118975
|
init_database();
|
|
118656
|
-
import { jsx as
|
|
118976
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
118657
118977
|
function SearchEngineConfigDialog({
|
|
118658
118978
|
onSubmit,
|
|
118659
118979
|
onCancel
|
|
118660
118980
|
}) {
|
|
118661
|
-
const [braveApiKey, setBraveApiKey] =
|
|
118662
|
-
const [tavilyApiKey, setTavilyApiKey] =
|
|
118663
|
-
const [currentField, setCurrentField] =
|
|
118664
|
-
const [isLoading, setIsLoading] =
|
|
118665
|
-
|
|
118981
|
+
const [braveApiKey, setBraveApiKey] = useState34("");
|
|
118982
|
+
const [tavilyApiKey, setTavilyApiKey] = useState34("");
|
|
118983
|
+
const [currentField, setCurrentField] = useState34("braveApiKey");
|
|
118984
|
+
const [isLoading, setIsLoading] = useState34(true);
|
|
118985
|
+
useEffect33(() => {
|
|
118666
118986
|
const loadConfig = async () => {
|
|
118667
118987
|
console.log("[WEBSCRAPER-DEBUG] Loading existing API keys from database...");
|
|
118668
118988
|
const db = await getFSSLinkDatabase();
|
|
@@ -118790,20 +119110,20 @@ function SearchEngineConfigDialog({
|
|
|
118790
119110
|
}
|
|
118791
119111
|
});
|
|
118792
119112
|
if (isLoading) {
|
|
118793
|
-
return /* @__PURE__ */
|
|
118794
|
-
|
|
119113
|
+
return /* @__PURE__ */ jsx27(
|
|
119114
|
+
Box22,
|
|
118795
119115
|
{
|
|
118796
119116
|
borderStyle: "round",
|
|
118797
119117
|
borderColor: Colors.AccentBlue,
|
|
118798
119118
|
flexDirection: "column",
|
|
118799
119119
|
padding: 1,
|
|
118800
119120
|
width: "100%",
|
|
118801
|
-
children: /* @__PURE__ */
|
|
119121
|
+
children: /* @__PURE__ */ jsx27(Text29, { children: "Loading search engine configuration..." })
|
|
118802
119122
|
}
|
|
118803
119123
|
);
|
|
118804
119124
|
}
|
|
118805
|
-
return /* @__PURE__ */
|
|
118806
|
-
|
|
119125
|
+
return /* @__PURE__ */ jsxs25(
|
|
119126
|
+
Box22,
|
|
118807
119127
|
{
|
|
118808
119128
|
borderStyle: "round",
|
|
118809
119129
|
borderColor: Colors.AccentPurple,
|
|
@@ -118811,73 +119131,73 @@ function SearchEngineConfigDialog({
|
|
|
118811
119131
|
padding: 1,
|
|
118812
119132
|
width: "100%",
|
|
118813
119133
|
children: [
|
|
118814
|
-
/* @__PURE__ */
|
|
118815
|
-
/* @__PURE__ */
|
|
118816
|
-
/* @__PURE__ */
|
|
118817
|
-
/* @__PURE__ */
|
|
119134
|
+
/* @__PURE__ */ jsx27(Text29, { bold: true, color: Colors.AccentPurple, children: "Search Engine Configuration" }),
|
|
119135
|
+
/* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx27(Text29, { children: "Configure search engine APIs for web research. You need at least one API key." }) }),
|
|
119136
|
+
/* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx27(Text29, { bold: true, color: Colors.AccentBlue, children: "Brave Search (General Web Search)" }) }),
|
|
119137
|
+
/* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsxs25(Text29, { color: Colors.Gray, children: [
|
|
118818
119138
|
"Get API key: ",
|
|
118819
|
-
/* @__PURE__ */
|
|
119139
|
+
/* @__PURE__ */ jsx27(Text29, { color: Colors.AccentBlue, children: "https://api.search.brave.com/" })
|
|
118820
119140
|
] }) }),
|
|
118821
|
-
/* @__PURE__ */
|
|
118822
|
-
/* @__PURE__ */
|
|
118823
|
-
|
|
119141
|
+
/* @__PURE__ */ jsxs25(Box22, { marginTop: 1, flexDirection: "row", children: [
|
|
119142
|
+
/* @__PURE__ */ jsx27(Box22, { width: 14, children: /* @__PURE__ */ jsx27(
|
|
119143
|
+
Text29,
|
|
118824
119144
|
{
|
|
118825
119145
|
color: currentField === "braveApiKey" ? Colors.AccentPurple : Colors.Gray,
|
|
118826
119146
|
children: "Brave API Key:"
|
|
118827
119147
|
}
|
|
118828
119148
|
) }),
|
|
118829
|
-
/* @__PURE__ */
|
|
119149
|
+
/* @__PURE__ */ jsx27(Box22, { flexGrow: 1, children: /* @__PURE__ */ jsxs25(Text29, { children: [
|
|
118830
119150
|
currentField === "braveApiKey" ? "> " : " ",
|
|
118831
119151
|
braveApiKey ? "\u2022".repeat(Math.min(braveApiKey.length, 20)) + (braveApiKey.length > 20 ? "..." : "") : "optional"
|
|
118832
119152
|
] }) })
|
|
118833
119153
|
] }),
|
|
118834
|
-
/* @__PURE__ */
|
|
118835
|
-
/* @__PURE__ */
|
|
119154
|
+
/* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx27(Text29, { bold: true, color: Colors.AccentBlue, children: "Tavily Search (Research Focus)" }) }),
|
|
119155
|
+
/* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsxs25(Text29, { color: Colors.Gray, children: [
|
|
118836
119156
|
"Get API key: ",
|
|
118837
|
-
/* @__PURE__ */
|
|
119157
|
+
/* @__PURE__ */ jsx27(Text29, { color: Colors.AccentBlue, children: "https://tavily.com/" })
|
|
118838
119158
|
] }) }),
|
|
118839
|
-
/* @__PURE__ */
|
|
118840
|
-
/* @__PURE__ */
|
|
118841
|
-
|
|
119159
|
+
/* @__PURE__ */ jsxs25(Box22, { marginTop: 1, flexDirection: "row", children: [
|
|
119160
|
+
/* @__PURE__ */ jsx27(Box22, { width: 14, children: /* @__PURE__ */ jsx27(
|
|
119161
|
+
Text29,
|
|
118842
119162
|
{
|
|
118843
119163
|
color: currentField === "tavilyApiKey" ? Colors.AccentPurple : Colors.Gray,
|
|
118844
119164
|
children: "Tavily API Key:"
|
|
118845
119165
|
}
|
|
118846
119166
|
) }),
|
|
118847
|
-
/* @__PURE__ */
|
|
119167
|
+
/* @__PURE__ */ jsx27(Box22, { flexGrow: 1, children: /* @__PURE__ */ jsxs25(Text29, { children: [
|
|
118848
119168
|
currentField === "tavilyApiKey" ? "> " : " ",
|
|
118849
119169
|
tavilyApiKey ? "\u2022".repeat(Math.min(tavilyApiKey.length, 20)) + (tavilyApiKey.length > 20 ? "..." : "") : "optional"
|
|
118850
119170
|
] }) })
|
|
118851
119171
|
] }),
|
|
118852
|
-
/* @__PURE__ */
|
|
118853
|
-
/* @__PURE__ */
|
|
118854
|
-
|
|
119172
|
+
/* @__PURE__ */ jsxs25(Box22, { marginTop: 1, flexDirection: "row", children: [
|
|
119173
|
+
/* @__PURE__ */ jsx27(Box22, { width: 14, children: /* @__PURE__ */ jsx27(
|
|
119174
|
+
Text29,
|
|
118855
119175
|
{
|
|
118856
119176
|
color: currentField === "submit" ? Colors.AccentGreen : Colors.Gray,
|
|
118857
119177
|
children: "Ready:"
|
|
118858
119178
|
}
|
|
118859
119179
|
) }),
|
|
118860
|
-
/* @__PURE__ */
|
|
119180
|
+
/* @__PURE__ */ jsx27(Box22, { flexGrow: 1, children: /* @__PURE__ */ jsxs25(Text29, { color: currentField === "submit" ? Colors.AccentGreen : Colors.Gray, children: [
|
|
118861
119181
|
currentField === "submit" ? "> " : " ",
|
|
118862
119182
|
"Save & Continue"
|
|
118863
119183
|
] }) })
|
|
118864
119184
|
] }),
|
|
118865
|
-
/* @__PURE__ */
|
|
118866
|
-
!braveApiKey && !tavilyApiKey && /* @__PURE__ */
|
|
119185
|
+
/* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx27(Text29, { color: Colors.Gray, children: "Press Enter to continue, Tab/\u2191\u2193 to navigate, Esc to cancel" }) }),
|
|
119186
|
+
!braveApiKey && !tavilyApiKey && /* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx27(Text29, { color: Colors.AccentYellow, children: "\u26A0\uFE0F At least one API key is required for search functionality" }) })
|
|
118867
119187
|
]
|
|
118868
119188
|
}
|
|
118869
119189
|
);
|
|
118870
119190
|
}
|
|
118871
119191
|
|
|
118872
119192
|
// packages/cli/src/ui/components/AuthInProgress.tsx
|
|
118873
|
-
import { useState as
|
|
118874
|
-
import { Box as
|
|
119193
|
+
import { useState as useState35, useEffect as useEffect34 } from "react";
|
|
119194
|
+
import { Box as Box23, Text as Text30 } from "ink";
|
|
118875
119195
|
import Spinner2 from "ink-spinner";
|
|
118876
|
-
import { jsx as
|
|
119196
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
118877
119197
|
function AuthInProgress({
|
|
118878
119198
|
onTimeout
|
|
118879
119199
|
}) {
|
|
118880
|
-
const [timedOut, setTimedOut] =
|
|
119200
|
+
const [timedOut, setTimedOut] = useState35(false);
|
|
118881
119201
|
useKeypress(
|
|
118882
119202
|
(key) => {
|
|
118883
119203
|
if (key.name === "escape" || key.ctrl && key.name === "c") {
|
|
@@ -118886,23 +119206,23 @@ function AuthInProgress({
|
|
|
118886
119206
|
},
|
|
118887
119207
|
{ isActive: true }
|
|
118888
119208
|
);
|
|
118889
|
-
|
|
119209
|
+
useEffect34(() => {
|
|
118890
119210
|
const timer = setTimeout(() => {
|
|
118891
119211
|
setTimedOut(true);
|
|
118892
119212
|
onTimeout();
|
|
118893
119213
|
}, 18e4);
|
|
118894
119214
|
return () => clearTimeout(timer);
|
|
118895
119215
|
}, [onTimeout]);
|
|
118896
|
-
return /* @__PURE__ */
|
|
118897
|
-
|
|
119216
|
+
return /* @__PURE__ */ jsx28(
|
|
119217
|
+
Box23,
|
|
118898
119218
|
{
|
|
118899
119219
|
borderStyle: "round",
|
|
118900
119220
|
borderColor: Colors.Gray,
|
|
118901
119221
|
flexDirection: "column",
|
|
118902
119222
|
padding: 1,
|
|
118903
119223
|
width: "100%",
|
|
118904
|
-
children: timedOut ? /* @__PURE__ */
|
|
118905
|
-
/* @__PURE__ */
|
|
119224
|
+
children: timedOut ? /* @__PURE__ */ jsx28(Text30, { color: Colors.AccentRed, children: "Authentication timed out. Please try again." }) : /* @__PURE__ */ jsx28(Box23, { children: /* @__PURE__ */ jsxs26(Text30, { children: [
|
|
119225
|
+
/* @__PURE__ */ jsx28(Spinner2, { type: "dots" }),
|
|
118906
119226
|
" Waiting for auth... (Press ESC or CTRL+C to cancel)"
|
|
118907
119227
|
] }) })
|
|
118908
119228
|
}
|
|
@@ -118910,8 +119230,8 @@ function AuthInProgress({
|
|
|
118910
119230
|
}
|
|
118911
119231
|
|
|
118912
119232
|
// packages/cli/src/ui/components/EditorSettingsDialog.tsx
|
|
118913
|
-
import { useState as
|
|
118914
|
-
import { Box as
|
|
119233
|
+
import { useState as useState36 } from "react";
|
|
119234
|
+
import { Box as Box24, Text as Text31 } from "ink";
|
|
118915
119235
|
|
|
118916
119236
|
// packages/cli/src/ui/editors/editorSettingsManager.ts
|
|
118917
119237
|
init_dist2();
|
|
@@ -118959,16 +119279,16 @@ var editorSettingsManager = new EditorSettingsManager();
|
|
|
118959
119279
|
// packages/cli/src/ui/components/EditorSettingsDialog.tsx
|
|
118960
119280
|
init_settings();
|
|
118961
119281
|
init_dist2();
|
|
118962
|
-
import { jsx as
|
|
119282
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
118963
119283
|
function EditorSettingsDialog({
|
|
118964
119284
|
onSelect,
|
|
118965
119285
|
settings,
|
|
118966
119286
|
onExit
|
|
118967
119287
|
}) {
|
|
118968
|
-
const [selectedScope, setSelectedScope] =
|
|
119288
|
+
const [selectedScope, setSelectedScope] = useState36(
|
|
118969
119289
|
"User" /* User */
|
|
118970
119290
|
);
|
|
118971
|
-
const [focusedSection, setFocusedSection] =
|
|
119291
|
+
const [focusedSection, setFocusedSection] = useState36(
|
|
118972
119292
|
"editor"
|
|
118973
119293
|
);
|
|
118974
119294
|
useKeypress(
|
|
@@ -119015,8 +119335,8 @@ function EditorSettingsDialog({
|
|
|
119015
119335
|
if (settings.merged.preferredEditor && isEditorAvailable(settings.merged.preferredEditor)) {
|
|
119016
119336
|
mergedEditorName = EDITOR_DISPLAY_NAMES[settings.merged.preferredEditor];
|
|
119017
119337
|
}
|
|
119018
|
-
return /* @__PURE__ */
|
|
119019
|
-
|
|
119338
|
+
return /* @__PURE__ */ jsxs27(
|
|
119339
|
+
Box24,
|
|
119020
119340
|
{
|
|
119021
119341
|
borderStyle: "round",
|
|
119022
119342
|
borderColor: Colors.Gray,
|
|
@@ -119024,14 +119344,14 @@ function EditorSettingsDialog({
|
|
|
119024
119344
|
padding: 1,
|
|
119025
119345
|
width: "100%",
|
|
119026
119346
|
children: [
|
|
119027
|
-
/* @__PURE__ */
|
|
119028
|
-
/* @__PURE__ */
|
|
119347
|
+
/* @__PURE__ */ jsxs27(Box24, { flexDirection: "column", width: "45%", paddingRight: 2, children: [
|
|
119348
|
+
/* @__PURE__ */ jsxs27(Text31, { bold: focusedSection === "editor", children: [
|
|
119029
119349
|
focusedSection === "editor" ? "> " : " ",
|
|
119030
119350
|
"Select Editor",
|
|
119031
119351
|
" ",
|
|
119032
|
-
/* @__PURE__ */
|
|
119352
|
+
/* @__PURE__ */ jsx29(Text31, { color: Colors.Gray, children: otherScopeModifiedMessage })
|
|
119033
119353
|
] }),
|
|
119034
|
-
/* @__PURE__ */
|
|
119354
|
+
/* @__PURE__ */ jsx29(
|
|
119035
119355
|
RadioButtonSelect,
|
|
119036
119356
|
{
|
|
119037
119357
|
items: editorItems.map((item) => ({
|
|
@@ -119045,12 +119365,12 @@ function EditorSettingsDialog({
|
|
|
119045
119365
|
},
|
|
119046
119366
|
selectedScope
|
|
119047
119367
|
),
|
|
119048
|
-
/* @__PURE__ */
|
|
119049
|
-
/* @__PURE__ */
|
|
119368
|
+
/* @__PURE__ */ jsxs27(Box24, { marginTop: 1, flexDirection: "column", children: [
|
|
119369
|
+
/* @__PURE__ */ jsxs27(Text31, { bold: focusedSection === "scope", children: [
|
|
119050
119370
|
focusedSection === "scope" ? "> " : " ",
|
|
119051
119371
|
"Apply To"
|
|
119052
119372
|
] }),
|
|
119053
|
-
/* @__PURE__ */
|
|
119373
|
+
/* @__PURE__ */ jsx29(
|
|
119054
119374
|
RadioButtonSelect,
|
|
119055
119375
|
{
|
|
119056
119376
|
items: scopeItems,
|
|
@@ -119060,17 +119380,17 @@ function EditorSettingsDialog({
|
|
|
119060
119380
|
}
|
|
119061
119381
|
)
|
|
119062
119382
|
] }),
|
|
119063
|
-
/* @__PURE__ */
|
|
119383
|
+
/* @__PURE__ */ jsx29(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx29(Text31, { color: Colors.Gray, children: "(Use Enter to select, Tab to change focus)" }) })
|
|
119064
119384
|
] }),
|
|
119065
|
-
/* @__PURE__ */
|
|
119066
|
-
/* @__PURE__ */
|
|
119067
|
-
/* @__PURE__ */
|
|
119068
|
-
/* @__PURE__ */
|
|
119069
|
-
/* @__PURE__ */
|
|
119385
|
+
/* @__PURE__ */ jsxs27(Box24, { flexDirection: "column", width: "55%", paddingLeft: 2, children: [
|
|
119386
|
+
/* @__PURE__ */ jsx29(Text31, { bold: true, children: "Editor Preference" }),
|
|
119387
|
+
/* @__PURE__ */ jsxs27(Box24, { flexDirection: "column", gap: 1, marginTop: 1, children: [
|
|
119388
|
+
/* @__PURE__ */ jsx29(Text31, { color: Colors.Gray, children: "These editors are currently supported. Please note that some editors cannot be used in sandbox mode." }),
|
|
119389
|
+
/* @__PURE__ */ jsxs27(Text31, { color: Colors.Gray, children: [
|
|
119070
119390
|
"Your preferred editor is:",
|
|
119071
119391
|
" ",
|
|
119072
|
-
/* @__PURE__ */
|
|
119073
|
-
|
|
119392
|
+
/* @__PURE__ */ jsx29(
|
|
119393
|
+
Text31,
|
|
119074
119394
|
{
|
|
119075
119395
|
color: mergedEditorName === "None" ? Colors.AccentRed : Colors.AccentCyan,
|
|
119076
119396
|
bold: true,
|
|
@@ -119088,12 +119408,12 @@ function EditorSettingsDialog({
|
|
|
119088
119408
|
|
|
119089
119409
|
// packages/cli/src/ui/components/ShellConfirmationDialog.tsx
|
|
119090
119410
|
init_dist2();
|
|
119091
|
-
import { Box as
|
|
119411
|
+
import { Box as Box25, Text as Text33 } from "ink";
|
|
119092
119412
|
|
|
119093
119413
|
// packages/cli/src/ui/utils/InlineMarkdownRenderer.tsx
|
|
119094
119414
|
import React21 from "react";
|
|
119095
|
-
import { Text as
|
|
119096
|
-
import { Fragment as Fragment5, jsx as
|
|
119415
|
+
import { Text as Text32 } from "ink";
|
|
119416
|
+
import { Fragment as Fragment5, jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
119097
119417
|
var BOLD_MARKER_LENGTH = 2;
|
|
119098
119418
|
var ITALIC_MARKER_LENGTH = 1;
|
|
119099
119419
|
var STRIKETHROUGH_MARKER_LENGTH = 2;
|
|
@@ -119102,7 +119422,7 @@ var UNDERLINE_TAG_START_LENGTH = 3;
|
|
|
119102
119422
|
var UNDERLINE_TAG_END_LENGTH = 4;
|
|
119103
119423
|
var RenderInlineInternal = ({ text }) => {
|
|
119104
119424
|
if (!/[*_~`<[https?:]/.test(text)) {
|
|
119105
|
-
return /* @__PURE__ */
|
|
119425
|
+
return /* @__PURE__ */ jsx30(Text32, { children: text });
|
|
119106
119426
|
}
|
|
119107
119427
|
const nodes = [];
|
|
119108
119428
|
let lastIndex = 0;
|
|
@@ -119111,7 +119431,7 @@ var RenderInlineInternal = ({ text }) => {
|
|
|
119111
119431
|
while ((match2 = inlineRegex.exec(text)) !== null) {
|
|
119112
119432
|
if (match2.index > lastIndex) {
|
|
119113
119433
|
nodes.push(
|
|
119114
|
-
/* @__PURE__ */
|
|
119434
|
+
/* @__PURE__ */ jsx30(Text32, { children: text.slice(lastIndex, match2.index) }, `t-${lastIndex}`)
|
|
119115
119435
|
);
|
|
119116
119436
|
}
|
|
119117
119437
|
const fullMatch = match2[0];
|
|
@@ -119119,31 +119439,31 @@ var RenderInlineInternal = ({ text }) => {
|
|
|
119119
119439
|
const key = `m-${match2.index}`;
|
|
119120
119440
|
try {
|
|
119121
119441
|
if (fullMatch.startsWith("**") && fullMatch.endsWith("**") && fullMatch.length > BOLD_MARKER_LENGTH * 2) {
|
|
119122
|
-
renderedNode = /* @__PURE__ */
|
|
119442
|
+
renderedNode = /* @__PURE__ */ jsx30(Text32, { bold: true, children: fullMatch.slice(BOLD_MARKER_LENGTH, -BOLD_MARKER_LENGTH) }, key);
|
|
119123
119443
|
} else if (fullMatch.length > ITALIC_MARKER_LENGTH * 2 && (fullMatch.startsWith("*") && fullMatch.endsWith("*") || fullMatch.startsWith("_") && fullMatch.endsWith("_")) && !/\w/.test(text.substring(match2.index - 1, match2.index)) && !/\w/.test(
|
|
119124
119444
|
text.substring(inlineRegex.lastIndex, inlineRegex.lastIndex + 1)
|
|
119125
119445
|
) && !/\S[./\\]/.test(text.substring(match2.index - 2, match2.index)) && !/[./\\]\S/.test(
|
|
119126
119446
|
text.substring(inlineRegex.lastIndex, inlineRegex.lastIndex + 2)
|
|
119127
119447
|
)) {
|
|
119128
|
-
renderedNode = /* @__PURE__ */
|
|
119448
|
+
renderedNode = /* @__PURE__ */ jsx30(Text32, { italic: true, children: fullMatch.slice(ITALIC_MARKER_LENGTH, -ITALIC_MARKER_LENGTH) }, key);
|
|
119129
119449
|
} else if (fullMatch.startsWith("~~") && fullMatch.endsWith("~~") && fullMatch.length > STRIKETHROUGH_MARKER_LENGTH * 2) {
|
|
119130
|
-
renderedNode = /* @__PURE__ */
|
|
119450
|
+
renderedNode = /* @__PURE__ */ jsx30(Text32, { strikethrough: true, children: fullMatch.slice(
|
|
119131
119451
|
STRIKETHROUGH_MARKER_LENGTH,
|
|
119132
119452
|
-STRIKETHROUGH_MARKER_LENGTH
|
|
119133
119453
|
) }, key);
|
|
119134
119454
|
} else if (fullMatch.startsWith("`") && fullMatch.endsWith("`") && fullMatch.length > INLINE_CODE_MARKER_LENGTH) {
|
|
119135
119455
|
const codeMatch = fullMatch.match(/^(`+)(.+?)\1$/s);
|
|
119136
119456
|
if (codeMatch && codeMatch[2]) {
|
|
119137
|
-
renderedNode = /* @__PURE__ */
|
|
119457
|
+
renderedNode = /* @__PURE__ */ jsx30(Text32, { color: Colors.AccentPurple, children: codeMatch[2] }, key);
|
|
119138
119458
|
}
|
|
119139
119459
|
} else if (fullMatch.startsWith("[") && fullMatch.includes("](") && fullMatch.endsWith(")")) {
|
|
119140
119460
|
const linkMatch = fullMatch.match(/\[(.*?)\]\((.*?)\)/);
|
|
119141
119461
|
if (linkMatch) {
|
|
119142
119462
|
const linkText = linkMatch[1];
|
|
119143
119463
|
const url2 = linkMatch[2];
|
|
119144
|
-
renderedNode = /* @__PURE__ */
|
|
119464
|
+
renderedNode = /* @__PURE__ */ jsxs28(Text32, { children: [
|
|
119145
119465
|
linkText,
|
|
119146
|
-
/* @__PURE__ */
|
|
119466
|
+
/* @__PURE__ */ jsxs28(Text32, { color: Colors.AccentBlue, children: [
|
|
119147
119467
|
" (",
|
|
119148
119468
|
url2,
|
|
119149
119469
|
")"
|
|
@@ -119151,24 +119471,24 @@ var RenderInlineInternal = ({ text }) => {
|
|
|
119151
119471
|
] }, key);
|
|
119152
119472
|
}
|
|
119153
119473
|
} else if (fullMatch.startsWith("<u>") && fullMatch.endsWith("</u>") && fullMatch.length > UNDERLINE_TAG_START_LENGTH + UNDERLINE_TAG_END_LENGTH - 1) {
|
|
119154
|
-
renderedNode = /* @__PURE__ */
|
|
119474
|
+
renderedNode = /* @__PURE__ */ jsx30(Text32, { underline: true, children: fullMatch.slice(
|
|
119155
119475
|
UNDERLINE_TAG_START_LENGTH,
|
|
119156
119476
|
-UNDERLINE_TAG_END_LENGTH
|
|
119157
119477
|
) }, key);
|
|
119158
119478
|
} else if (fullMatch.match(/^https?:\/\//)) {
|
|
119159
|
-
renderedNode = /* @__PURE__ */
|
|
119479
|
+
renderedNode = /* @__PURE__ */ jsx30(Text32, { color: Colors.AccentBlue, children: fullMatch }, key);
|
|
119160
119480
|
}
|
|
119161
119481
|
} catch (e2) {
|
|
119162
119482
|
console.error("Error parsing inline markdown part:", fullMatch, e2);
|
|
119163
119483
|
renderedNode = null;
|
|
119164
119484
|
}
|
|
119165
|
-
nodes.push(renderedNode ?? /* @__PURE__ */
|
|
119485
|
+
nodes.push(renderedNode ?? /* @__PURE__ */ jsx30(Text32, { children: fullMatch }, key));
|
|
119166
119486
|
lastIndex = inlineRegex.lastIndex;
|
|
119167
119487
|
}
|
|
119168
119488
|
if (lastIndex < text.length) {
|
|
119169
|
-
nodes.push(/* @__PURE__ */
|
|
119489
|
+
nodes.push(/* @__PURE__ */ jsx30(Text32, { children: text.slice(lastIndex) }, `t-${lastIndex}`));
|
|
119170
119490
|
}
|
|
119171
|
-
return /* @__PURE__ */
|
|
119491
|
+
return /* @__PURE__ */ jsx30(Fragment5, { children: nodes.filter((node) => node !== null) });
|
|
119172
119492
|
};
|
|
119173
119493
|
var RenderInline = React21.memo(RenderInlineInternal);
|
|
119174
119494
|
var getPlainTextLength = (text) => {
|
|
@@ -119177,7 +119497,7 @@ var getPlainTextLength = (text) => {
|
|
|
119177
119497
|
};
|
|
119178
119498
|
|
|
119179
119499
|
// packages/cli/src/ui/components/ShellConfirmationDialog.tsx
|
|
119180
|
-
import { jsx as
|
|
119500
|
+
import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
119181
119501
|
var ShellConfirmationDialog = ({ request: request2 }) => {
|
|
119182
119502
|
const { commands, onConfirm } = request2;
|
|
119183
119503
|
useKeypress(
|
|
@@ -119209,8 +119529,8 @@ var ShellConfirmationDialog = ({ request: request2 }) => {
|
|
|
119209
119529
|
value: ToolConfirmationOutcome.Cancel
|
|
119210
119530
|
}
|
|
119211
119531
|
];
|
|
119212
|
-
return /* @__PURE__ */
|
|
119213
|
-
|
|
119532
|
+
return /* @__PURE__ */ jsxs29(
|
|
119533
|
+
Box25,
|
|
119214
119534
|
{
|
|
119215
119535
|
flexDirection: "column",
|
|
119216
119536
|
borderStyle: "round",
|
|
@@ -119219,23 +119539,23 @@ var ShellConfirmationDialog = ({ request: request2 }) => {
|
|
|
119219
119539
|
width: "100%",
|
|
119220
119540
|
marginLeft: 1,
|
|
119221
119541
|
children: [
|
|
119222
|
-
/* @__PURE__ */
|
|
119223
|
-
/* @__PURE__ */
|
|
119224
|
-
/* @__PURE__ */
|
|
119225
|
-
/* @__PURE__ */
|
|
119226
|
-
|
|
119542
|
+
/* @__PURE__ */ jsxs29(Box25, { flexDirection: "column", marginBottom: 1, children: [
|
|
119543
|
+
/* @__PURE__ */ jsx31(Text33, { bold: true, children: "Shell Command Execution" }),
|
|
119544
|
+
/* @__PURE__ */ jsx31(Text33, { children: "A custom command wants to run the following shell commands:" }),
|
|
119545
|
+
/* @__PURE__ */ jsx31(
|
|
119546
|
+
Box25,
|
|
119227
119547
|
{
|
|
119228
119548
|
flexDirection: "column",
|
|
119229
119549
|
borderStyle: "round",
|
|
119230
119550
|
borderColor: Colors.Gray,
|
|
119231
119551
|
paddingX: 1,
|
|
119232
119552
|
marginTop: 1,
|
|
119233
|
-
children: commands.map((cmd) => /* @__PURE__ */
|
|
119553
|
+
children: commands.map((cmd) => /* @__PURE__ */ jsx31(Text33, { color: Colors.AccentCyan, children: /* @__PURE__ */ jsx31(RenderInline, { text: cmd }) }, cmd))
|
|
119234
119554
|
}
|
|
119235
119555
|
)
|
|
119236
119556
|
] }),
|
|
119237
|
-
/* @__PURE__ */
|
|
119238
|
-
/* @__PURE__ */
|
|
119557
|
+
/* @__PURE__ */ jsx31(Box25, { marginBottom: 1, children: /* @__PURE__ */ jsx31(Text33, { children: "Do you want to proceed?" }) }),
|
|
119558
|
+
/* @__PURE__ */ jsx31(RadioButtonSelect, { items: options2, onSelect: handleSelect, isFocused: true })
|
|
119239
119559
|
]
|
|
119240
119560
|
}
|
|
119241
119561
|
);
|
|
@@ -120270,25 +120590,25 @@ function mergeExcludeTools(settings, extensions, extraExcludes) {
|
|
|
120270
120590
|
init_settings();
|
|
120271
120591
|
|
|
120272
120592
|
// packages/cli/src/ui/components/Tips.tsx
|
|
120273
|
-
import { Box as
|
|
120274
|
-
import { jsx as
|
|
120593
|
+
import { Box as Box26, Text as Text34 } from "ink";
|
|
120594
|
+
import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
120275
120595
|
var Tips = ({ config }) => {
|
|
120276
120596
|
const geminiMdFileCount = config.getGeminiMdFileCount();
|
|
120277
|
-
return /* @__PURE__ */
|
|
120278
|
-
/* @__PURE__ */
|
|
120279
|
-
/* @__PURE__ */
|
|
120280
|
-
/* @__PURE__ */
|
|
120281
|
-
geminiMdFileCount === 0 && /* @__PURE__ */
|
|
120597
|
+
return /* @__PURE__ */ jsxs30(Box26, { flexDirection: "column", children: [
|
|
120598
|
+
/* @__PURE__ */ jsx32(Text34, { color: Colors.Foreground, children: "Tips for getting started:" }),
|
|
120599
|
+
/* @__PURE__ */ jsx32(Text34, { color: Colors.Foreground, children: "1. Ask questions, edit files, or run commands." }),
|
|
120600
|
+
/* @__PURE__ */ jsx32(Text34, { color: Colors.Foreground, children: "2. Be specific for the best results." }),
|
|
120601
|
+
geminiMdFileCount === 0 && /* @__PURE__ */ jsxs30(Text34, { color: Colors.Foreground, children: [
|
|
120282
120602
|
"3. Create",
|
|
120283
120603
|
" ",
|
|
120284
|
-
/* @__PURE__ */
|
|
120604
|
+
/* @__PURE__ */ jsx32(Text34, { bold: true, color: Colors.AccentPurple, children: "LINK.md" }),
|
|
120285
120605
|
" ",
|
|
120286
120606
|
"files to customize your interactions with FSS Link."
|
|
120287
120607
|
] }),
|
|
120288
|
-
/* @__PURE__ */
|
|
120608
|
+
/* @__PURE__ */ jsxs30(Text34, { color: Colors.Foreground, children: [
|
|
120289
120609
|
geminiMdFileCount === 0 ? "4." : "3.",
|
|
120290
120610
|
" ",
|
|
120291
|
-
/* @__PURE__ */
|
|
120611
|
+
/* @__PURE__ */ jsx32(Text34, { bold: true, color: Colors.AccentPurple, children: "/help" }),
|
|
120292
120612
|
" ",
|
|
120293
120613
|
"for more information."
|
|
120294
120614
|
] })
|
|
@@ -120343,15 +120663,15 @@ var ConsolePatcher = class {
|
|
|
120343
120663
|
};
|
|
120344
120664
|
|
|
120345
120665
|
// packages/cli/src/ui/components/DetailedMessagesDisplay.tsx
|
|
120346
|
-
import { Box as
|
|
120347
|
-
import { jsx as
|
|
120666
|
+
import { Box as Box27, Text as Text35 } from "ink";
|
|
120667
|
+
import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
120348
120668
|
var DetailedMessagesDisplay = ({ messages, maxHeight, width }) => {
|
|
120349
120669
|
if (messages.length === 0) {
|
|
120350
120670
|
return null;
|
|
120351
120671
|
}
|
|
120352
120672
|
const borderAndPadding = 4;
|
|
120353
|
-
return /* @__PURE__ */
|
|
120354
|
-
|
|
120673
|
+
return /* @__PURE__ */ jsxs31(
|
|
120674
|
+
Box27,
|
|
120355
120675
|
{
|
|
120356
120676
|
flexDirection: "column",
|
|
120357
120677
|
marginTop: 1,
|
|
@@ -120360,11 +120680,11 @@ var DetailedMessagesDisplay = ({ messages, maxHeight, width }) => {
|
|
|
120360
120680
|
paddingX: 1,
|
|
120361
120681
|
width,
|
|
120362
120682
|
children: [
|
|
120363
|
-
/* @__PURE__ */
|
|
120683
|
+
/* @__PURE__ */ jsx33(Box27, { marginBottom: 1, children: /* @__PURE__ */ jsxs31(Text35, { bold: true, color: Colors.Foreground, children: [
|
|
120364
120684
|
"Debug Console ",
|
|
120365
|
-
/* @__PURE__ */
|
|
120685
|
+
/* @__PURE__ */ jsx33(Text35, { color: Colors.Gray, children: "(ctrl+o to close)" })
|
|
120366
120686
|
] }) }),
|
|
120367
|
-
/* @__PURE__ */
|
|
120687
|
+
/* @__PURE__ */ jsx33(MaxSizedBox, { maxHeight, maxWidth: width - borderAndPadding, children: messages.map((msg, index) => {
|
|
120368
120688
|
let textColor = Colors.Foreground;
|
|
120369
120689
|
let icon = "\u2139";
|
|
120370
120690
|
switch (msg.type) {
|
|
@@ -120384,14 +120704,14 @@ var DetailedMessagesDisplay = ({ messages, maxHeight, width }) => {
|
|
|
120384
120704
|
default:
|
|
120385
120705
|
break;
|
|
120386
120706
|
}
|
|
120387
|
-
return /* @__PURE__ */
|
|
120388
|
-
/* @__PURE__ */
|
|
120707
|
+
return /* @__PURE__ */ jsxs31(Box27, { flexDirection: "row", children: [
|
|
120708
|
+
/* @__PURE__ */ jsxs31(Text35, { color: textColor, children: [
|
|
120389
120709
|
icon,
|
|
120390
120710
|
" "
|
|
120391
120711
|
] }),
|
|
120392
|
-
/* @__PURE__ */
|
|
120712
|
+
/* @__PURE__ */ jsxs31(Text35, { color: textColor, wrap: "wrap", children: [
|
|
120393
120713
|
msg.content,
|
|
120394
|
-
msg.count && msg.count > 1 && /* @__PURE__ */
|
|
120714
|
+
msg.count && msg.count > 1 && /* @__PURE__ */ jsxs31(Text35, { color: Colors.Gray, children: [
|
|
120395
120715
|
" (x",
|
|
120396
120716
|
msg.count,
|
|
120397
120717
|
")"
|
|
@@ -120405,16 +120725,16 @@ var DetailedMessagesDisplay = ({ messages, maxHeight, width }) => {
|
|
|
120405
120725
|
};
|
|
120406
120726
|
|
|
120407
120727
|
// packages/cli/src/ui/components/messages/UserMessage.tsx
|
|
120408
|
-
import { Text as
|
|
120409
|
-
import { jsx as
|
|
120728
|
+
import { Text as Text36, Box as Box28 } from "ink";
|
|
120729
|
+
import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
120410
120730
|
var UserMessage = ({ text }) => {
|
|
120411
120731
|
const prefix = "> ";
|
|
120412
120732
|
const prefixWidth = prefix.length;
|
|
120413
120733
|
const isSlashCommand2 = text.startsWith("/");
|
|
120414
120734
|
const textColor = isSlashCommand2 ? Colors.AccentPurple : Colors.Gray;
|
|
120415
120735
|
const borderColor = isSlashCommand2 ? Colors.AccentPurple : Colors.Gray;
|
|
120416
|
-
return /* @__PURE__ */
|
|
120417
|
-
|
|
120736
|
+
return /* @__PURE__ */ jsxs32(
|
|
120737
|
+
Box28,
|
|
120418
120738
|
{
|
|
120419
120739
|
borderStyle: "round",
|
|
120420
120740
|
borderColor,
|
|
@@ -120424,35 +120744,35 @@ var UserMessage = ({ text }) => {
|
|
|
120424
120744
|
marginY: 1,
|
|
120425
120745
|
alignSelf: "flex-start",
|
|
120426
120746
|
children: [
|
|
120427
|
-
/* @__PURE__ */
|
|
120428
|
-
/* @__PURE__ */
|
|
120747
|
+
/* @__PURE__ */ jsx34(Box28, { width: prefixWidth, children: /* @__PURE__ */ jsx34(Text36, { color: textColor, children: prefix }) }),
|
|
120748
|
+
/* @__PURE__ */ jsx34(Box28, { flexGrow: 1, children: /* @__PURE__ */ jsx34(Text36, { wrap: "wrap", color: textColor, children: text }) })
|
|
120429
120749
|
]
|
|
120430
120750
|
}
|
|
120431
120751
|
);
|
|
120432
120752
|
};
|
|
120433
120753
|
|
|
120434
120754
|
// packages/cli/src/ui/components/messages/UserShellMessage.tsx
|
|
120435
|
-
import { Box as
|
|
120436
|
-
import { jsx as
|
|
120755
|
+
import { Box as Box29, Text as Text37 } from "ink";
|
|
120756
|
+
import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
120437
120757
|
var UserShellMessage = ({ text }) => {
|
|
120438
120758
|
const commandToDisplay = text.startsWith("!") ? text.substring(1) : text;
|
|
120439
|
-
return /* @__PURE__ */
|
|
120440
|
-
/* @__PURE__ */
|
|
120441
|
-
/* @__PURE__ */
|
|
120759
|
+
return /* @__PURE__ */ jsxs33(Box29, { children: [
|
|
120760
|
+
/* @__PURE__ */ jsx35(Text37, { color: Colors.AccentCyan, children: "$ " }),
|
|
120761
|
+
/* @__PURE__ */ jsx35(Text37, { children: commandToDisplay })
|
|
120442
120762
|
] });
|
|
120443
120763
|
};
|
|
120444
120764
|
|
|
120445
120765
|
// packages/cli/src/ui/components/messages/GeminiMessage.tsx
|
|
120446
|
-
import { Text as
|
|
120766
|
+
import { Text as Text40, Box as Box32 } from "ink";
|
|
120447
120767
|
|
|
120448
120768
|
// packages/cli/src/ui/utils/MarkdownDisplay.tsx
|
|
120449
120769
|
import React24 from "react";
|
|
120450
|
-
import { Text as
|
|
120770
|
+
import { Text as Text39, Box as Box31 } from "ink";
|
|
120451
120771
|
|
|
120452
120772
|
// packages/cli/src/ui/utils/TableRenderer.tsx
|
|
120453
120773
|
import React22 from "react";
|
|
120454
|
-
import { Text as
|
|
120455
|
-
import { jsx as
|
|
120774
|
+
import { Text as Text38, Box as Box30 } from "ink";
|
|
120775
|
+
import { jsx as jsx36, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
120456
120776
|
var TableRenderer = ({
|
|
120457
120777
|
headers,
|
|
120458
120778
|
rows,
|
|
@@ -120500,8 +120820,8 @@ var TableRenderer = ({
|
|
|
120500
120820
|
}
|
|
120501
120821
|
const actualDisplayWidth = getPlainTextLength(cellContent);
|
|
120502
120822
|
const paddingNeeded = Math.max(0, contentWidth - actualDisplayWidth);
|
|
120503
|
-
return /* @__PURE__ */
|
|
120504
|
-
isHeader ? /* @__PURE__ */
|
|
120823
|
+
return /* @__PURE__ */ jsxs34(Text38, { children: [
|
|
120824
|
+
isHeader ? /* @__PURE__ */ jsx36(Text38, { bold: true, color: Colors.AccentCyan, children: /* @__PURE__ */ jsx36(RenderInline, { text: cellContent }) }) : /* @__PURE__ */ jsx36(RenderInline, { text: cellContent }),
|
|
120505
120825
|
" ".repeat(paddingNeeded)
|
|
120506
120826
|
] });
|
|
120507
120827
|
};
|
|
@@ -120514,17 +120834,17 @@ var TableRenderer = ({
|
|
|
120514
120834
|
const char = chars[type2];
|
|
120515
120835
|
const borderParts = adjustedWidths.map((w) => char.horizontal.repeat(w));
|
|
120516
120836
|
const border = char.left + borderParts.join(char.middle) + char.right;
|
|
120517
|
-
return /* @__PURE__ */
|
|
120837
|
+
return /* @__PURE__ */ jsx36(Text38, { children: border });
|
|
120518
120838
|
};
|
|
120519
120839
|
const renderRow = (cells, isHeader = false) => {
|
|
120520
120840
|
const renderedCells = cells.map((cell, index) => {
|
|
120521
120841
|
const width = adjustedWidths[index] || 0;
|
|
120522
120842
|
return renderCell(cell || "", width, isHeader);
|
|
120523
120843
|
});
|
|
120524
|
-
return /* @__PURE__ */
|
|
120844
|
+
return /* @__PURE__ */ jsxs34(Text38, { children: [
|
|
120525
120845
|
"\u2502",
|
|
120526
120846
|
" ",
|
|
120527
|
-
renderedCells.map((cell, index) => /* @__PURE__ */
|
|
120847
|
+
renderedCells.map((cell, index) => /* @__PURE__ */ jsxs34(React22.Fragment, { children: [
|
|
120528
120848
|
cell,
|
|
120529
120849
|
index < renderedCells.length - 1 ? " \u2502 " : ""
|
|
120530
120850
|
] }, index)),
|
|
@@ -120532,11 +120852,11 @@ var TableRenderer = ({
|
|
|
120532
120852
|
"\u2502"
|
|
120533
120853
|
] });
|
|
120534
120854
|
};
|
|
120535
|
-
return /* @__PURE__ */
|
|
120855
|
+
return /* @__PURE__ */ jsxs34(Box30, { flexDirection: "column", marginY: 1, children: [
|
|
120536
120856
|
renderBorder("top"),
|
|
120537
120857
|
renderRow(headers, true),
|
|
120538
120858
|
renderBorder("middle"),
|
|
120539
|
-
rows.map((row, index) => /* @__PURE__ */
|
|
120859
|
+
rows.map((row, index) => /* @__PURE__ */ jsx36(React22.Fragment, { children: renderRow(row) }, index)),
|
|
120540
120860
|
renderBorder("bottom")
|
|
120541
120861
|
] });
|
|
120542
120862
|
};
|
|
@@ -120555,7 +120875,7 @@ var useSettings = () => {
|
|
|
120555
120875
|
};
|
|
120556
120876
|
|
|
120557
120877
|
// packages/cli/src/ui/utils/MarkdownDisplay.tsx
|
|
120558
|
-
import { Fragment as Fragment6, jsx as
|
|
120878
|
+
import { Fragment as Fragment6, jsx as jsx37, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
120559
120879
|
var EMPTY_LINE_HEIGHT = 1;
|
|
120560
120880
|
var CODE_BLOCK_PREFIX_PADDING = 1;
|
|
120561
120881
|
var LIST_ITEM_PREFIX_PADDING = 1;
|
|
@@ -120566,7 +120886,7 @@ var MarkdownDisplayInternal = ({
|
|
|
120566
120886
|
availableTerminalHeight,
|
|
120567
120887
|
terminalWidth
|
|
120568
120888
|
}) => {
|
|
120569
|
-
if (!text) return /* @__PURE__ */
|
|
120889
|
+
if (!text) return /* @__PURE__ */ jsx37(Fragment6, {});
|
|
120570
120890
|
const lines = text.split("\n");
|
|
120571
120891
|
const headerRegex = /^ *(#{1,4}) +(.*)/;
|
|
120572
120892
|
const codeFenceRegex = /^ *(`{3,}|~{3,}) *(\w*?) *$/;
|
|
@@ -120596,7 +120916,7 @@ var MarkdownDisplayInternal = ({
|
|
|
120596
120916
|
const fenceMatch = line.match(codeFenceRegex);
|
|
120597
120917
|
if (fenceMatch && fenceMatch[1].startsWith(codeBlockFence[0]) && fenceMatch[1].length >= codeBlockFence.length) {
|
|
120598
120918
|
addContentBlock(
|
|
120599
|
-
/* @__PURE__ */
|
|
120919
|
+
/* @__PURE__ */ jsx37(
|
|
120600
120920
|
RenderCodeBlock,
|
|
120601
120921
|
{
|
|
120602
120922
|
content: codeBlockContent,
|
|
@@ -120635,7 +120955,7 @@ var MarkdownDisplayInternal = ({
|
|
|
120635
120955
|
tableRows = [];
|
|
120636
120956
|
} else {
|
|
120637
120957
|
addContentBlock(
|
|
120638
|
-
/* @__PURE__ */
|
|
120958
|
+
/* @__PURE__ */ jsx37(Box31, { children: /* @__PURE__ */ jsx37(Text39, { wrap: "wrap", children: /* @__PURE__ */ jsx37(RenderInline, { text: line }) }) }, key)
|
|
120639
120959
|
);
|
|
120640
120960
|
}
|
|
120641
120961
|
} else if (inTable && tableSeparatorMatch) {
|
|
@@ -120651,7 +120971,7 @@ var MarkdownDisplayInternal = ({
|
|
|
120651
120971
|
} else if (inTable && !tableRowMatch) {
|
|
120652
120972
|
if (tableHeaders.length > 0 && tableRows.length > 0) {
|
|
120653
120973
|
addContentBlock(
|
|
120654
|
-
/* @__PURE__ */
|
|
120974
|
+
/* @__PURE__ */ jsx37(
|
|
120655
120975
|
RenderTable,
|
|
120656
120976
|
{
|
|
120657
120977
|
headers: tableHeaders,
|
|
@@ -120667,12 +120987,12 @@ var MarkdownDisplayInternal = ({
|
|
|
120667
120987
|
tableHeaders = [];
|
|
120668
120988
|
if (line.trim().length > 0) {
|
|
120669
120989
|
addContentBlock(
|
|
120670
|
-
/* @__PURE__ */
|
|
120990
|
+
/* @__PURE__ */ jsx37(Box31, { children: /* @__PURE__ */ jsx37(Text39, { wrap: "wrap", children: /* @__PURE__ */ jsx37(RenderInline, { text: line }) }) }, key)
|
|
120671
120991
|
);
|
|
120672
120992
|
}
|
|
120673
120993
|
} else if (hrMatch) {
|
|
120674
120994
|
addContentBlock(
|
|
120675
|
-
/* @__PURE__ */
|
|
120995
|
+
/* @__PURE__ */ jsx37(Box31, { children: /* @__PURE__ */ jsx37(Text39, { dimColor: true, children: "---" }) }, key)
|
|
120676
120996
|
);
|
|
120677
120997
|
} else if (headerMatch) {
|
|
120678
120998
|
const level = headerMatch[1].length;
|
|
@@ -120680,28 +121000,28 @@ var MarkdownDisplayInternal = ({
|
|
|
120680
121000
|
let headerNode = null;
|
|
120681
121001
|
switch (level) {
|
|
120682
121002
|
case 1:
|
|
120683
|
-
headerNode = /* @__PURE__ */
|
|
121003
|
+
headerNode = /* @__PURE__ */ jsx37(Text39, { bold: true, color: Colors.AccentCyan, children: /* @__PURE__ */ jsx37(RenderInline, { text: headerText }) });
|
|
120684
121004
|
break;
|
|
120685
121005
|
case 2:
|
|
120686
|
-
headerNode = /* @__PURE__ */
|
|
121006
|
+
headerNode = /* @__PURE__ */ jsx37(Text39, { bold: true, color: Colors.AccentBlue, children: /* @__PURE__ */ jsx37(RenderInline, { text: headerText }) });
|
|
120687
121007
|
break;
|
|
120688
121008
|
case 3:
|
|
120689
|
-
headerNode = /* @__PURE__ */
|
|
121009
|
+
headerNode = /* @__PURE__ */ jsx37(Text39, { bold: true, children: /* @__PURE__ */ jsx37(RenderInline, { text: headerText }) });
|
|
120690
121010
|
break;
|
|
120691
121011
|
case 4:
|
|
120692
|
-
headerNode = /* @__PURE__ */
|
|
121012
|
+
headerNode = /* @__PURE__ */ jsx37(Text39, { italic: true, color: Colors.Gray, children: /* @__PURE__ */ jsx37(RenderInline, { text: headerText }) });
|
|
120693
121013
|
break;
|
|
120694
121014
|
default:
|
|
120695
|
-
headerNode = /* @__PURE__ */
|
|
121015
|
+
headerNode = /* @__PURE__ */ jsx37(Text39, { children: /* @__PURE__ */ jsx37(RenderInline, { text: headerText }) });
|
|
120696
121016
|
break;
|
|
120697
121017
|
}
|
|
120698
|
-
if (headerNode) addContentBlock(/* @__PURE__ */
|
|
121018
|
+
if (headerNode) addContentBlock(/* @__PURE__ */ jsx37(Box31, { children: headerNode }, key));
|
|
120699
121019
|
} else if (ulMatch) {
|
|
120700
121020
|
const leadingWhitespace = ulMatch[1];
|
|
120701
121021
|
const marker = ulMatch[2];
|
|
120702
121022
|
const itemText = ulMatch[3];
|
|
120703
121023
|
addContentBlock(
|
|
120704
|
-
/* @__PURE__ */
|
|
121024
|
+
/* @__PURE__ */ jsx37(
|
|
120705
121025
|
RenderListItem,
|
|
120706
121026
|
{
|
|
120707
121027
|
itemText,
|
|
@@ -120717,7 +121037,7 @@ var MarkdownDisplayInternal = ({
|
|
|
120717
121037
|
const marker = olMatch[2];
|
|
120718
121038
|
const itemText = olMatch[3];
|
|
120719
121039
|
addContentBlock(
|
|
120720
|
-
/* @__PURE__ */
|
|
121040
|
+
/* @__PURE__ */ jsx37(
|
|
120721
121041
|
RenderListItem,
|
|
120722
121042
|
{
|
|
120723
121043
|
itemText,
|
|
@@ -120732,20 +121052,20 @@ var MarkdownDisplayInternal = ({
|
|
|
120732
121052
|
if (line.trim().length === 0 && !inCodeBlock) {
|
|
120733
121053
|
if (!lastLineEmpty) {
|
|
120734
121054
|
contentBlocks.push(
|
|
120735
|
-
/* @__PURE__ */
|
|
121055
|
+
/* @__PURE__ */ jsx37(Box31, { height: EMPTY_LINE_HEIGHT }, `spacer-${index}`)
|
|
120736
121056
|
);
|
|
120737
121057
|
lastLineEmpty = true;
|
|
120738
121058
|
}
|
|
120739
121059
|
} else {
|
|
120740
121060
|
addContentBlock(
|
|
120741
|
-
/* @__PURE__ */
|
|
121061
|
+
/* @__PURE__ */ jsx37(Box31, { children: /* @__PURE__ */ jsx37(Text39, { wrap: "wrap", children: /* @__PURE__ */ jsx37(RenderInline, { text: line }) }) }, key)
|
|
120742
121062
|
);
|
|
120743
121063
|
}
|
|
120744
121064
|
}
|
|
120745
121065
|
});
|
|
120746
121066
|
if (inCodeBlock) {
|
|
120747
121067
|
addContentBlock(
|
|
120748
|
-
/* @__PURE__ */
|
|
121068
|
+
/* @__PURE__ */ jsx37(
|
|
120749
121069
|
RenderCodeBlock,
|
|
120750
121070
|
{
|
|
120751
121071
|
content: codeBlockContent,
|
|
@@ -120760,7 +121080,7 @@ var MarkdownDisplayInternal = ({
|
|
|
120760
121080
|
}
|
|
120761
121081
|
if (inTable && tableHeaders.length > 0 && tableRows.length > 0) {
|
|
120762
121082
|
addContentBlock(
|
|
120763
|
-
/* @__PURE__ */
|
|
121083
|
+
/* @__PURE__ */ jsx37(
|
|
120764
121084
|
RenderTable,
|
|
120765
121085
|
{
|
|
120766
121086
|
headers: tableHeaders,
|
|
@@ -120771,7 +121091,7 @@ var MarkdownDisplayInternal = ({
|
|
|
120771
121091
|
)
|
|
120772
121092
|
);
|
|
120773
121093
|
}
|
|
120774
|
-
return /* @__PURE__ */
|
|
121094
|
+
return /* @__PURE__ */ jsx37(Fragment6, { children: contentBlocks });
|
|
120775
121095
|
};
|
|
120776
121096
|
var RenderCodeBlockInternal = ({
|
|
120777
121097
|
content,
|
|
@@ -120790,7 +121110,7 @@ var RenderCodeBlockInternal = ({
|
|
|
120790
121110
|
);
|
|
120791
121111
|
if (content.length > MAX_CODE_LINES_WHEN_PENDING) {
|
|
120792
121112
|
if (MAX_CODE_LINES_WHEN_PENDING < MIN_LINES_FOR_MESSAGE) {
|
|
120793
|
-
return /* @__PURE__ */
|
|
121113
|
+
return /* @__PURE__ */ jsx37(Box31, { paddingLeft: CODE_BLOCK_PREFIX_PADDING, children: /* @__PURE__ */ jsx37(Text39, { color: Colors.Gray, children: "... code is being written ..." }) });
|
|
120794
121114
|
}
|
|
120795
121115
|
const truncatedContent = content.slice(0, MAX_CODE_LINES_WHEN_PENDING);
|
|
120796
121116
|
const colorizedTruncatedCode = colorizeCode(
|
|
@@ -120801,9 +121121,9 @@ var RenderCodeBlockInternal = ({
|
|
|
120801
121121
|
void 0,
|
|
120802
121122
|
settings
|
|
120803
121123
|
);
|
|
120804
|
-
return /* @__PURE__ */
|
|
121124
|
+
return /* @__PURE__ */ jsxs35(Box31, { paddingLeft: CODE_BLOCK_PREFIX_PADDING, flexDirection: "column", children: [
|
|
120805
121125
|
colorizedTruncatedCode,
|
|
120806
|
-
/* @__PURE__ */
|
|
121126
|
+
/* @__PURE__ */ jsx37(Text39, { color: Colors.Gray, children: "... generating more ..." })
|
|
120807
121127
|
] });
|
|
120808
121128
|
}
|
|
120809
121129
|
}
|
|
@@ -120816,8 +121136,8 @@ var RenderCodeBlockInternal = ({
|
|
|
120816
121136
|
void 0,
|
|
120817
121137
|
settings
|
|
120818
121138
|
);
|
|
120819
|
-
return /* @__PURE__ */
|
|
120820
|
-
|
|
121139
|
+
return /* @__PURE__ */ jsx37(
|
|
121140
|
+
Box31,
|
|
120821
121141
|
{
|
|
120822
121142
|
paddingLeft: CODE_BLOCK_PREFIX_PADDING,
|
|
120823
121143
|
flexDirection: "column",
|
|
@@ -120837,14 +121157,14 @@ var RenderListItemInternal = ({
|
|
|
120837
121157
|
const prefix = type2 === "ol" ? `${marker}. ` : `${marker} `;
|
|
120838
121158
|
const prefixWidth = prefix.length;
|
|
120839
121159
|
const indentation = leadingWhitespace.length;
|
|
120840
|
-
return /* @__PURE__ */
|
|
120841
|
-
|
|
121160
|
+
return /* @__PURE__ */ jsxs35(
|
|
121161
|
+
Box31,
|
|
120842
121162
|
{
|
|
120843
121163
|
paddingLeft: indentation + LIST_ITEM_PREFIX_PADDING,
|
|
120844
121164
|
flexDirection: "row",
|
|
120845
121165
|
children: [
|
|
120846
|
-
/* @__PURE__ */
|
|
120847
|
-
/* @__PURE__ */
|
|
121166
|
+
/* @__PURE__ */ jsx37(Box31, { width: prefixWidth, children: /* @__PURE__ */ jsx37(Text39, { children: prefix }) }),
|
|
121167
|
+
/* @__PURE__ */ jsx37(Box31, { flexGrow: LIST_ITEM_TEXT_FLEX_GROW, children: /* @__PURE__ */ jsx37(Text39, { wrap: "wrap", children: /* @__PURE__ */ jsx37(RenderInline, { text: itemText }) }) })
|
|
120848
121168
|
]
|
|
120849
121169
|
}
|
|
120850
121170
|
);
|
|
@@ -120854,12 +121174,12 @@ var RenderTableInternal = ({
|
|
|
120854
121174
|
headers,
|
|
120855
121175
|
rows,
|
|
120856
121176
|
terminalWidth
|
|
120857
|
-
}) => /* @__PURE__ */
|
|
121177
|
+
}) => /* @__PURE__ */ jsx37(TableRenderer, { headers, rows, terminalWidth });
|
|
120858
121178
|
var RenderTable = React24.memo(RenderTableInternal);
|
|
120859
121179
|
var MarkdownDisplay = React24.memo(MarkdownDisplayInternal);
|
|
120860
121180
|
|
|
120861
121181
|
// packages/cli/src/ui/components/messages/GeminiMessage.tsx
|
|
120862
|
-
import { jsx as
|
|
121182
|
+
import { jsx as jsx38, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
120863
121183
|
var GeminiMessage = ({
|
|
120864
121184
|
text,
|
|
120865
121185
|
isPending,
|
|
@@ -120868,9 +121188,9 @@ var GeminiMessage = ({
|
|
|
120868
121188
|
}) => {
|
|
120869
121189
|
const prefix = "\u2726 ";
|
|
120870
121190
|
const prefixWidth = prefix.length;
|
|
120871
|
-
return /* @__PURE__ */
|
|
120872
|
-
/* @__PURE__ */
|
|
120873
|
-
/* @__PURE__ */
|
|
121191
|
+
return /* @__PURE__ */ jsxs36(Box32, { flexDirection: "row", children: [
|
|
121192
|
+
/* @__PURE__ */ jsx38(Box32, { width: prefixWidth, children: /* @__PURE__ */ jsx38(Text40, { color: Colors.AccentPurple, children: prefix }) }),
|
|
121193
|
+
/* @__PURE__ */ jsx38(Box32, { flexGrow: 1, flexDirection: "column", children: /* @__PURE__ */ jsx38(
|
|
120874
121194
|
MarkdownDisplay,
|
|
120875
121195
|
{
|
|
120876
121196
|
text,
|
|
@@ -120883,40 +121203,40 @@ var GeminiMessage = ({
|
|
|
120883
121203
|
};
|
|
120884
121204
|
|
|
120885
121205
|
// packages/cli/src/ui/components/messages/InfoMessage.tsx
|
|
120886
|
-
import { Text as
|
|
120887
|
-
import { jsx as
|
|
121206
|
+
import { Text as Text41, Box as Box33 } from "ink";
|
|
121207
|
+
import { jsx as jsx39, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
120888
121208
|
var InfoMessage = ({ text }) => {
|
|
120889
121209
|
const prefix = "\u2139 ";
|
|
120890
121210
|
const prefixWidth = prefix.length;
|
|
120891
|
-
return /* @__PURE__ */
|
|
120892
|
-
/* @__PURE__ */
|
|
120893
|
-
/* @__PURE__ */
|
|
121211
|
+
return /* @__PURE__ */ jsxs37(Box33, { flexDirection: "row", marginTop: 1, children: [
|
|
121212
|
+
/* @__PURE__ */ jsx39(Box33, { width: prefixWidth, children: /* @__PURE__ */ jsx39(Text41, { color: Colors.AccentYellow, children: prefix }) }),
|
|
121213
|
+
/* @__PURE__ */ jsx39(Box33, { flexGrow: 1, children: /* @__PURE__ */ jsx39(Text41, { wrap: "wrap", color: Colors.AccentYellow, children: /* @__PURE__ */ jsx39(RenderInline, { text }) }) })
|
|
120894
121214
|
] });
|
|
120895
121215
|
};
|
|
120896
121216
|
|
|
120897
121217
|
// packages/cli/src/ui/components/messages/ErrorMessage.tsx
|
|
120898
|
-
import { Text as
|
|
120899
|
-
import { jsx as
|
|
121218
|
+
import { Text as Text42, Box as Box34 } from "ink";
|
|
121219
|
+
import { jsx as jsx40, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
120900
121220
|
var ErrorMessage = ({ text }) => {
|
|
120901
121221
|
const prefix = "\u2715 ";
|
|
120902
121222
|
const prefixWidth = prefix.length;
|
|
120903
|
-
return /* @__PURE__ */
|
|
120904
|
-
/* @__PURE__ */
|
|
120905
|
-
/* @__PURE__ */
|
|
121223
|
+
return /* @__PURE__ */ jsxs38(Box34, { flexDirection: "row", marginBottom: 1, children: [
|
|
121224
|
+
/* @__PURE__ */ jsx40(Box34, { width: prefixWidth, children: /* @__PURE__ */ jsx40(Text42, { color: Colors.AccentRed, children: prefix }) }),
|
|
121225
|
+
/* @__PURE__ */ jsx40(Box34, { flexGrow: 1, children: /* @__PURE__ */ jsx40(Text42, { wrap: "wrap", color: Colors.AccentRed, children: text }) })
|
|
120906
121226
|
] });
|
|
120907
121227
|
};
|
|
120908
121228
|
|
|
120909
121229
|
// packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
|
|
120910
121230
|
import { useMemo as useMemo8 } from "react";
|
|
120911
|
-
import { Box as
|
|
121231
|
+
import { Box as Box38 } from "ink";
|
|
120912
121232
|
|
|
120913
121233
|
// packages/cli/src/ui/components/messages/ToolMessage.tsx
|
|
120914
121234
|
import React25 from "react";
|
|
120915
|
-
import { Box as
|
|
121235
|
+
import { Box as Box36, Text as Text44 } from "ink";
|
|
120916
121236
|
|
|
120917
121237
|
// packages/cli/src/ui/components/TodoDisplay.tsx
|
|
120918
|
-
import { Box as
|
|
120919
|
-
import { jsx as
|
|
121238
|
+
import { Box as Box35, Text as Text43 } from "ink";
|
|
121239
|
+
import { jsx as jsx41, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
120920
121240
|
var STATUS_ICONS = {
|
|
120921
121241
|
pending: "\u25CB",
|
|
120922
121242
|
in_progress: "\u25D0",
|
|
@@ -120926,21 +121246,21 @@ var TodoDisplay = ({ todos }) => {
|
|
|
120926
121246
|
if (!todos || todos.length === 0) {
|
|
120927
121247
|
return null;
|
|
120928
121248
|
}
|
|
120929
|
-
return /* @__PURE__ */
|
|
121249
|
+
return /* @__PURE__ */ jsx41(Box35, { flexDirection: "column", children: todos.map((todo) => /* @__PURE__ */ jsx41(TodoItemRow, { todo }, todo.id)) });
|
|
120930
121250
|
};
|
|
120931
121251
|
var TodoItemRow = ({ todo }) => {
|
|
120932
121252
|
const statusIcon = STATUS_ICONS[todo.status];
|
|
120933
121253
|
const isCompleted = todo.status === "completed";
|
|
120934
121254
|
const isInProgress = todo.status === "in_progress";
|
|
120935
121255
|
const itemColor = isCompleted ? Colors.Foreground : isInProgress ? Colors.AccentGreen : Colors.Foreground;
|
|
120936
|
-
return /* @__PURE__ */
|
|
120937
|
-
/* @__PURE__ */
|
|
120938
|
-
/* @__PURE__ */
|
|
121256
|
+
return /* @__PURE__ */ jsxs39(Box35, { flexDirection: "row", minHeight: 1, children: [
|
|
121257
|
+
/* @__PURE__ */ jsx41(Box35, { width: 3, children: /* @__PURE__ */ jsx41(Text43, { color: itemColor, children: statusIcon }) }),
|
|
121258
|
+
/* @__PURE__ */ jsx41(Box35, { flexGrow: 1, children: /* @__PURE__ */ jsx41(Text43, { color: itemColor, strikethrough: isCompleted, wrap: "wrap", children: todo.content }) })
|
|
120939
121259
|
] });
|
|
120940
121260
|
};
|
|
120941
121261
|
|
|
120942
121262
|
// packages/cli/src/ui/components/messages/ToolMessage.tsx
|
|
120943
|
-
import { jsx as
|
|
121263
|
+
import { jsx as jsx42, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
120944
121264
|
var STATIC_HEIGHT = 1;
|
|
120945
121265
|
var RESERVED_LINE_COUNT = 5;
|
|
120946
121266
|
var STATUS_INDICATOR_WIDTH = 3;
|
|
@@ -120969,14 +121289,14 @@ var useResultDisplayRenderer = (resultDisplay) => React25.useMemo(() => {
|
|
|
120969
121289
|
}, [resultDisplay]);
|
|
120970
121290
|
var TodoResultRenderer = ({
|
|
120971
121291
|
data
|
|
120972
|
-
}) => /* @__PURE__ */
|
|
121292
|
+
}) => /* @__PURE__ */ jsx42(TodoDisplay, { todos: data.todos });
|
|
120973
121293
|
var StringResultRenderer = ({ data, renderAsMarkdown, availableHeight, childWidth }) => {
|
|
120974
121294
|
let displayData = data;
|
|
120975
121295
|
if (displayData.length > MAXIMUM_RESULT_DISPLAY_CHARACTERS) {
|
|
120976
121296
|
displayData = "..." + displayData.slice(-MAXIMUM_RESULT_DISPLAY_CHARACTERS);
|
|
120977
121297
|
}
|
|
120978
121298
|
if (renderAsMarkdown) {
|
|
120979
|
-
return /* @__PURE__ */
|
|
121299
|
+
return /* @__PURE__ */ jsx42(Box36, { flexDirection: "column", children: /* @__PURE__ */ jsx42(
|
|
120980
121300
|
MarkdownDisplay,
|
|
120981
121301
|
{
|
|
120982
121302
|
text: displayData,
|
|
@@ -120986,9 +121306,9 @@ var StringResultRenderer = ({ data, renderAsMarkdown, availableHeight, childWidt
|
|
|
120986
121306
|
}
|
|
120987
121307
|
) });
|
|
120988
121308
|
}
|
|
120989
|
-
return /* @__PURE__ */
|
|
121309
|
+
return /* @__PURE__ */ jsx42(MaxSizedBox, { maxHeight: availableHeight, maxWidth: childWidth, children: /* @__PURE__ */ jsx42(Box36, { children: /* @__PURE__ */ jsx42(Text44, { wrap: "wrap", children: displayData }) }) });
|
|
120990
121310
|
};
|
|
120991
|
-
var DiffResultRenderer = ({ data, availableHeight, childWidth }) => /* @__PURE__ */
|
|
121311
|
+
var DiffResultRenderer = ({ data, availableHeight, childWidth }) => /* @__PURE__ */ jsx42(
|
|
120992
121312
|
DiffRenderer,
|
|
120993
121313
|
{
|
|
120994
121314
|
diffContent: data.fileDiff,
|
|
@@ -121017,10 +121337,10 @@ var ToolMessage = ({
|
|
|
121017
121337
|
}
|
|
121018
121338
|
const childWidth = terminalWidth - 3;
|
|
121019
121339
|
const displayRenderer = useResultDisplayRenderer(resultDisplay);
|
|
121020
|
-
return /* @__PURE__ */
|
|
121021
|
-
/* @__PURE__ */
|
|
121022
|
-
/* @__PURE__ */
|
|
121023
|
-
/* @__PURE__ */
|
|
121340
|
+
return /* @__PURE__ */ jsxs40(Box36, { paddingX: 1, paddingY: 0, flexDirection: "column", children: [
|
|
121341
|
+
/* @__PURE__ */ jsxs40(Box36, { minHeight: 1, children: [
|
|
121342
|
+
/* @__PURE__ */ jsx42(ToolStatusIndicator, { status }),
|
|
121343
|
+
/* @__PURE__ */ jsx42(
|
|
121024
121344
|
ToolInfo,
|
|
121025
121345
|
{
|
|
121026
121346
|
name: name2,
|
|
@@ -121029,11 +121349,11 @@ var ToolMessage = ({
|
|
|
121029
121349
|
emphasis
|
|
121030
121350
|
}
|
|
121031
121351
|
),
|
|
121032
|
-
emphasis === "high" && /* @__PURE__ */
|
|
121352
|
+
emphasis === "high" && /* @__PURE__ */ jsx42(TrailingIndicator, {})
|
|
121033
121353
|
] }),
|
|
121034
|
-
displayRenderer.type !== "none" && /* @__PURE__ */
|
|
121035
|
-
displayRenderer.type === "todo" && /* @__PURE__ */
|
|
121036
|
-
displayRenderer.type === "string" && /* @__PURE__ */
|
|
121354
|
+
displayRenderer.type !== "none" && /* @__PURE__ */ jsx42(Box36, { paddingLeft: STATUS_INDICATOR_WIDTH, width: "100%", marginTop: 1, children: /* @__PURE__ */ jsxs40(Box36, { flexDirection: "column", children: [
|
|
121355
|
+
displayRenderer.type === "todo" && /* @__PURE__ */ jsx42(TodoResultRenderer, { data: displayRenderer.data }),
|
|
121356
|
+
displayRenderer.type === "string" && /* @__PURE__ */ jsx42(
|
|
121037
121357
|
StringResultRenderer,
|
|
121038
121358
|
{
|
|
121039
121359
|
data: displayRenderer.data,
|
|
@@ -121042,7 +121362,7 @@ var ToolMessage = ({
|
|
|
121042
121362
|
childWidth
|
|
121043
121363
|
}
|
|
121044
121364
|
),
|
|
121045
|
-
displayRenderer.type === "diff" && /* @__PURE__ */
|
|
121365
|
+
displayRenderer.type === "diff" && /* @__PURE__ */ jsx42(
|
|
121046
121366
|
DiffResultRenderer,
|
|
121047
121367
|
{
|
|
121048
121368
|
data: displayRenderer.data,
|
|
@@ -121055,19 +121375,19 @@ var ToolMessage = ({
|
|
|
121055
121375
|
};
|
|
121056
121376
|
var ToolStatusIndicator = ({
|
|
121057
121377
|
status
|
|
121058
|
-
}) => /* @__PURE__ */
|
|
121059
|
-
status === "Pending" /* Pending */ && /* @__PURE__ */
|
|
121060
|
-
status === "Executing" /* Executing */ && /* @__PURE__ */
|
|
121378
|
+
}) => /* @__PURE__ */ jsxs40(Box36, { minWidth: STATUS_INDICATOR_WIDTH, children: [
|
|
121379
|
+
status === "Pending" /* Pending */ && /* @__PURE__ */ jsx42(Text44, { color: Colors.AccentGreen, children: "o" }),
|
|
121380
|
+
status === "Executing" /* Executing */ && /* @__PURE__ */ jsx42(
|
|
121061
121381
|
GeminiRespondingSpinner,
|
|
121062
121382
|
{
|
|
121063
121383
|
spinnerType: "toggle",
|
|
121064
121384
|
nonRespondingDisplay: "\u22B7"
|
|
121065
121385
|
}
|
|
121066
121386
|
),
|
|
121067
|
-
status === "Success" /* Success */ && /* @__PURE__ */
|
|
121068
|
-
status === "Confirming" /* Confirming */ && /* @__PURE__ */
|
|
121069
|
-
status === "Canceled" /* Canceled */ && /* @__PURE__ */
|
|
121070
|
-
status === "Error" /* Error */ && /* @__PURE__ */
|
|
121387
|
+
status === "Success" /* Success */ && /* @__PURE__ */ jsx42(Text44, { color: Colors.AccentGreen, children: "\u2714" }),
|
|
121388
|
+
status === "Confirming" /* Confirming */ && /* @__PURE__ */ jsx42(Text44, { color: Colors.AccentYellow, children: "?" }),
|
|
121389
|
+
status === "Canceled" /* Canceled */ && /* @__PURE__ */ jsx42(Text44, { color: Colors.AccentYellow, bold: true, children: "-" }),
|
|
121390
|
+
status === "Error" /* Error */ && /* @__PURE__ */ jsx42(Text44, { color: Colors.AccentRed, bold: true, children: "x" })
|
|
121071
121391
|
] });
|
|
121072
121392
|
var ToolInfo = ({
|
|
121073
121393
|
name: name2,
|
|
@@ -121089,28 +121409,28 @@ var ToolInfo = ({
|
|
|
121089
121409
|
}
|
|
121090
121410
|
}
|
|
121091
121411
|
}, [emphasis]);
|
|
121092
|
-
return /* @__PURE__ */
|
|
121093
|
-
|
|
121412
|
+
return /* @__PURE__ */ jsx42(Box36, { children: /* @__PURE__ */ jsxs40(
|
|
121413
|
+
Text44,
|
|
121094
121414
|
{
|
|
121095
121415
|
wrap: "truncate-end",
|
|
121096
121416
|
strikethrough: status === "Canceled" /* Canceled */,
|
|
121097
121417
|
children: [
|
|
121098
|
-
/* @__PURE__ */
|
|
121418
|
+
/* @__PURE__ */ jsx42(Text44, { color: nameColor, bold: true, children: name2 }),
|
|
121099
121419
|
" ",
|
|
121100
|
-
/* @__PURE__ */
|
|
121420
|
+
/* @__PURE__ */ jsx42(Text44, { color: Colors.Gray, children: description })
|
|
121101
121421
|
]
|
|
121102
121422
|
}
|
|
121103
121423
|
) });
|
|
121104
121424
|
};
|
|
121105
|
-
var TrailingIndicator = () => /* @__PURE__ */
|
|
121425
|
+
var TrailingIndicator = () => /* @__PURE__ */ jsxs40(Text44, { color: Colors.Foreground, wrap: "truncate", children: [
|
|
121106
121426
|
" ",
|
|
121107
121427
|
"\u2190"
|
|
121108
121428
|
] });
|
|
121109
121429
|
|
|
121110
121430
|
// packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx
|
|
121111
|
-
import { Box as
|
|
121431
|
+
import { Box as Box37, Text as Text45 } from "ink";
|
|
121112
121432
|
init_dist2();
|
|
121113
|
-
import { jsx as
|
|
121433
|
+
import { jsx as jsx43, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
121114
121434
|
var ToolConfirmationMessage = ({
|
|
121115
121435
|
confirmationDetails,
|
|
121116
121436
|
config,
|
|
@@ -121163,8 +121483,8 @@ var ToolConfirmationMessage = ({
|
|
|
121163
121483
|
}
|
|
121164
121484
|
if (confirmationDetails.type === "edit") {
|
|
121165
121485
|
if (confirmationDetails.isModifying) {
|
|
121166
|
-
return /* @__PURE__ */
|
|
121167
|
-
|
|
121486
|
+
return /* @__PURE__ */ jsxs41(
|
|
121487
|
+
Box37,
|
|
121168
121488
|
{
|
|
121169
121489
|
minWidth: "90%",
|
|
121170
121490
|
borderStyle: "round",
|
|
@@ -121173,8 +121493,8 @@ var ToolConfirmationMessage = ({
|
|
|
121173
121493
|
padding: 1,
|
|
121174
121494
|
overflow: "hidden",
|
|
121175
121495
|
children: [
|
|
121176
|
-
/* @__PURE__ */
|
|
121177
|
-
/* @__PURE__ */
|
|
121496
|
+
/* @__PURE__ */ jsx43(Text45, { children: "Modify in progress: " }),
|
|
121497
|
+
/* @__PURE__ */ jsx43(Text45, { color: Colors.AccentGreen, children: "Save and close external editor to continue" })
|
|
121178
121498
|
]
|
|
121179
121499
|
}
|
|
121180
121500
|
);
|
|
@@ -121205,7 +121525,7 @@ var ToolConfirmationMessage = ({
|
|
|
121205
121525
|
value: ToolConfirmationOutcome.Cancel
|
|
121206
121526
|
});
|
|
121207
121527
|
}
|
|
121208
|
-
bodyContent = /* @__PURE__ */
|
|
121528
|
+
bodyContent = /* @__PURE__ */ jsx43(
|
|
121209
121529
|
DiffRenderer,
|
|
121210
121530
|
{
|
|
121211
121531
|
diffContent: confirmationDetails.fileDiff,
|
|
@@ -121235,12 +121555,12 @@ var ToolConfirmationMessage = ({
|
|
|
121235
121555
|
if (bodyContentHeight !== void 0) {
|
|
121236
121556
|
bodyContentHeight -= 2;
|
|
121237
121557
|
}
|
|
121238
|
-
bodyContent = /* @__PURE__ */
|
|
121558
|
+
bodyContent = /* @__PURE__ */ jsx43(Box37, { flexDirection: "column", children: /* @__PURE__ */ jsx43(Box37, { paddingX: 1, marginLeft: 1, children: /* @__PURE__ */ jsx43(
|
|
121239
121559
|
MaxSizedBox,
|
|
121240
121560
|
{
|
|
121241
121561
|
maxHeight: bodyContentHeight,
|
|
121242
121562
|
maxWidth: Math.max(childWidth - 4, 1),
|
|
121243
|
-
children: /* @__PURE__ */
|
|
121563
|
+
children: /* @__PURE__ */ jsx43(Box37, { children: /* @__PURE__ */ jsx43(Text45, { color: Colors.AccentCyan, children: executionProps.command }) })
|
|
121244
121564
|
}
|
|
121245
121565
|
) }) });
|
|
121246
121566
|
} else if (confirmationDetails.type === "info") {
|
|
@@ -121261,25 +121581,25 @@ var ToolConfirmationMessage = ({
|
|
|
121261
121581
|
value: ToolConfirmationOutcome.Cancel
|
|
121262
121582
|
}
|
|
121263
121583
|
);
|
|
121264
|
-
bodyContent = /* @__PURE__ */
|
|
121265
|
-
/* @__PURE__ */
|
|
121266
|
-
displayUrls && infoProps.urls && infoProps.urls.length > 0 && /* @__PURE__ */
|
|
121267
|
-
/* @__PURE__ */
|
|
121268
|
-
infoProps.urls.map((url2) => /* @__PURE__ */
|
|
121584
|
+
bodyContent = /* @__PURE__ */ jsxs41(Box37, { flexDirection: "column", paddingX: 1, marginLeft: 1, children: [
|
|
121585
|
+
/* @__PURE__ */ jsx43(Text45, { color: Colors.AccentCyan, children: /* @__PURE__ */ jsx43(RenderInline, { text: infoProps.prompt }) }),
|
|
121586
|
+
displayUrls && infoProps.urls && infoProps.urls.length > 0 && /* @__PURE__ */ jsxs41(Box37, { flexDirection: "column", marginTop: 1, children: [
|
|
121587
|
+
/* @__PURE__ */ jsx43(Text45, { children: "URLs to fetch:" }),
|
|
121588
|
+
infoProps.urls.map((url2) => /* @__PURE__ */ jsxs41(Text45, { children: [
|
|
121269
121589
|
" ",
|
|
121270
121590
|
"- ",
|
|
121271
|
-
/* @__PURE__ */
|
|
121591
|
+
/* @__PURE__ */ jsx43(RenderInline, { text: url2 })
|
|
121272
121592
|
] }, url2))
|
|
121273
121593
|
] })
|
|
121274
121594
|
] });
|
|
121275
121595
|
} else {
|
|
121276
121596
|
const mcpProps = confirmationDetails;
|
|
121277
|
-
bodyContent = /* @__PURE__ */
|
|
121278
|
-
/* @__PURE__ */
|
|
121597
|
+
bodyContent = /* @__PURE__ */ jsxs41(Box37, { flexDirection: "column", paddingX: 1, marginLeft: 1, children: [
|
|
121598
|
+
/* @__PURE__ */ jsxs41(Text45, { color: Colors.AccentCyan, children: [
|
|
121279
121599
|
"MCP Server: ",
|
|
121280
121600
|
mcpProps.serverName
|
|
121281
121601
|
] }),
|
|
121282
|
-
/* @__PURE__ */
|
|
121602
|
+
/* @__PURE__ */ jsxs41(Text45, { color: Colors.AccentCyan, children: [
|
|
121283
121603
|
"Tool: ",
|
|
121284
121604
|
mcpProps.toolName
|
|
121285
121605
|
] })
|
|
@@ -121305,10 +121625,10 @@ var ToolConfirmationMessage = ({
|
|
|
121305
121625
|
}
|
|
121306
121626
|
);
|
|
121307
121627
|
}
|
|
121308
|
-
return /* @__PURE__ */
|
|
121309
|
-
/* @__PURE__ */
|
|
121310
|
-
/* @__PURE__ */
|
|
121311
|
-
/* @__PURE__ */
|
|
121628
|
+
return /* @__PURE__ */ jsxs41(Box37, { flexDirection: "column", padding: 1, width: childWidth, children: [
|
|
121629
|
+
/* @__PURE__ */ jsx43(Box37, { flexGrow: 1, flexShrink: 1, overflow: "hidden", marginBottom: 1, children: bodyContent }),
|
|
121630
|
+
/* @__PURE__ */ jsx43(Box37, { marginBottom: 1, flexShrink: 0, children: /* @__PURE__ */ jsx43(Text45, { wrap: "truncate", children: question }) }),
|
|
121631
|
+
/* @__PURE__ */ jsx43(Box37, { flexShrink: 0, children: /* @__PURE__ */ jsx43(
|
|
121312
121632
|
RadioButtonSelect,
|
|
121313
121633
|
{
|
|
121314
121634
|
items: options2,
|
|
@@ -121320,7 +121640,7 @@ var ToolConfirmationMessage = ({
|
|
|
121320
121640
|
};
|
|
121321
121641
|
|
|
121322
121642
|
// packages/cli/src/ui/components/messages/ToolGroupMessage.tsx
|
|
121323
|
-
import { jsx as
|
|
121643
|
+
import { jsx as jsx44, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
121324
121644
|
var ToolGroupMessage = ({
|
|
121325
121645
|
toolCalls,
|
|
121326
121646
|
availableTerminalHeight,
|
|
@@ -121356,8 +121676,8 @@ var ToolGroupMessage = ({
|
|
|
121356
121676
|
),
|
|
121357
121677
|
1
|
|
121358
121678
|
) : void 0;
|
|
121359
|
-
return /* @__PURE__ */
|
|
121360
|
-
|
|
121679
|
+
return /* @__PURE__ */ jsx44(
|
|
121680
|
+
Box38,
|
|
121361
121681
|
{
|
|
121362
121682
|
flexDirection: "column",
|
|
121363
121683
|
borderStyle: "round",
|
|
@@ -121367,8 +121687,8 @@ var ToolGroupMessage = ({
|
|
|
121367
121687
|
borderColor,
|
|
121368
121688
|
children: toolCalls.map((tool) => {
|
|
121369
121689
|
const isConfirming = toolAwaitingApproval?.callId === tool.callId;
|
|
121370
|
-
return /* @__PURE__ */
|
|
121371
|
-
/* @__PURE__ */
|
|
121690
|
+
return /* @__PURE__ */ jsxs42(Box38, { flexDirection: "column", minHeight: 1, children: [
|
|
121691
|
+
/* @__PURE__ */ jsx44(Box38, { flexDirection: "row", alignItems: "center", children: /* @__PURE__ */ jsx44(
|
|
121372
121692
|
ToolMessage,
|
|
121373
121693
|
{
|
|
121374
121694
|
callId: tool.callId,
|
|
@@ -121383,7 +121703,7 @@ var ToolGroupMessage = ({
|
|
|
121383
121703
|
renderOutputAsMarkdown: tool.renderOutputAsMarkdown
|
|
121384
121704
|
}
|
|
121385
121705
|
) }),
|
|
121386
|
-
tool.status === "Confirming" /* Confirming */ && isConfirming && tool.confirmationDetails && /* @__PURE__ */
|
|
121706
|
+
tool.status === "Confirming" /* Confirming */ && isConfirming && tool.confirmationDetails && /* @__PURE__ */ jsx44(
|
|
121387
121707
|
ToolConfirmationMessage,
|
|
121388
121708
|
{
|
|
121389
121709
|
confirmationDetails: tool.confirmationDetails,
|
|
@@ -121400,8 +121720,8 @@ var ToolGroupMessage = ({
|
|
|
121400
121720
|
};
|
|
121401
121721
|
|
|
121402
121722
|
// packages/cli/src/ui/components/messages/GeminiMessageContent.tsx
|
|
121403
|
-
import { Box as
|
|
121404
|
-
import { jsx as
|
|
121723
|
+
import { Box as Box39 } from "ink";
|
|
121724
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
121405
121725
|
var GeminiMessageContent = ({
|
|
121406
121726
|
text,
|
|
121407
121727
|
isPending,
|
|
@@ -121410,7 +121730,7 @@ var GeminiMessageContent = ({
|
|
|
121410
121730
|
}) => {
|
|
121411
121731
|
const originalPrefix = "\u2726 ";
|
|
121412
121732
|
const prefixWidth = originalPrefix.length;
|
|
121413
|
-
return /* @__PURE__ */
|
|
121733
|
+
return /* @__PURE__ */ jsx45(Box39, { flexDirection: "column", paddingLeft: prefixWidth, children: /* @__PURE__ */ jsx45(
|
|
121414
121734
|
MarkdownDisplay,
|
|
121415
121735
|
{
|
|
121416
121736
|
text,
|
|
@@ -121422,17 +121742,17 @@ var GeminiMessageContent = ({
|
|
|
121422
121742
|
};
|
|
121423
121743
|
|
|
121424
121744
|
// packages/cli/src/ui/components/messages/CompressionMessage.tsx
|
|
121425
|
-
import { Box as
|
|
121745
|
+
import { Box as Box40, Text as Text46 } from "ink";
|
|
121426
121746
|
import Spinner3 from "ink-spinner";
|
|
121427
|
-
import { jsx as
|
|
121747
|
+
import { jsx as jsx46, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
121428
121748
|
var CompressionMessage = ({
|
|
121429
121749
|
compression
|
|
121430
121750
|
}) => {
|
|
121431
121751
|
const text = compression.isPending ? "Compressing chat history" : `Chat history compressed from ${compression.originalTokenCount ?? "unknown"} to ${compression.newTokenCount ?? "unknown"} tokens.`;
|
|
121432
|
-
return /* @__PURE__ */
|
|
121433
|
-
/* @__PURE__ */
|
|
121434
|
-
/* @__PURE__ */
|
|
121435
|
-
|
|
121752
|
+
return /* @__PURE__ */ jsxs43(Box40, { flexDirection: "row", children: [
|
|
121753
|
+
/* @__PURE__ */ jsx46(Box40, { marginRight: 1, children: compression.isPending ? /* @__PURE__ */ jsx46(Spinner3, { type: "dots" }) : /* @__PURE__ */ jsx46(Text46, { color: Colors.AccentPurple, children: "\u2726" }) }),
|
|
121754
|
+
/* @__PURE__ */ jsx46(Box40, { children: /* @__PURE__ */ jsx46(
|
|
121755
|
+
Text46,
|
|
121436
121756
|
{
|
|
121437
121757
|
color: compression.isPending ? Colors.AccentPurple : Colors.AccentGreen,
|
|
121438
121758
|
children: text
|
|
@@ -121442,11 +121762,11 @@ var CompressionMessage = ({
|
|
|
121442
121762
|
};
|
|
121443
121763
|
|
|
121444
121764
|
// packages/cli/src/ui/components/HistoryItemDisplay.tsx
|
|
121445
|
-
import { Box as
|
|
121765
|
+
import { Box as Box46 } from "ink";
|
|
121446
121766
|
|
|
121447
121767
|
// packages/cli/src/ui/components/AboutBox.tsx
|
|
121448
|
-
import { Box as
|
|
121449
|
-
import { jsx as
|
|
121768
|
+
import { Box as Box41, Text as Text47 } from "ink";
|
|
121769
|
+
import { jsx as jsx47, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
121450
121770
|
var AboutBox = ({
|
|
121451
121771
|
cliVersion,
|
|
121452
121772
|
osVersion,
|
|
@@ -121455,8 +121775,8 @@ var AboutBox = ({
|
|
|
121455
121775
|
selectedAuthType,
|
|
121456
121776
|
gcpProject,
|
|
121457
121777
|
ideClient
|
|
121458
|
-
}) => /* @__PURE__ */
|
|
121459
|
-
|
|
121778
|
+
}) => /* @__PURE__ */ jsxs44(
|
|
121779
|
+
Box41,
|
|
121460
121780
|
{
|
|
121461
121781
|
borderStyle: "round",
|
|
121462
121782
|
borderColor: Colors.Gray,
|
|
@@ -121465,45 +121785,45 @@ var AboutBox = ({
|
|
|
121465
121785
|
marginY: 1,
|
|
121466
121786
|
width: "100%",
|
|
121467
121787
|
children: [
|
|
121468
|
-
/* @__PURE__ */
|
|
121469
|
-
/* @__PURE__ */
|
|
121470
|
-
/* @__PURE__ */
|
|
121471
|
-
/* @__PURE__ */
|
|
121788
|
+
/* @__PURE__ */ jsx47(Box41, { marginBottom: 1, children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.AccentPurple, children: "About FSS Link" }) }),
|
|
121789
|
+
/* @__PURE__ */ jsxs44(Box41, { flexDirection: "row", children: [
|
|
121790
|
+
/* @__PURE__ */ jsx47(Box41, { width: "35%", children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.LightBlue, children: "CLI Version" }) }),
|
|
121791
|
+
/* @__PURE__ */ jsx47(Box41, { children: /* @__PURE__ */ jsx47(Text47, { children: cliVersion }) })
|
|
121472
121792
|
] }),
|
|
121473
|
-
GIT_COMMIT_INFO && !["N/A"].includes(GIT_COMMIT_INFO) && /* @__PURE__ */
|
|
121474
|
-
/* @__PURE__ */
|
|
121475
|
-
/* @__PURE__ */
|
|
121793
|
+
GIT_COMMIT_INFO && !["N/A"].includes(GIT_COMMIT_INFO) && /* @__PURE__ */ jsxs44(Box41, { flexDirection: "row", children: [
|
|
121794
|
+
/* @__PURE__ */ jsx47(Box41, { width: "35%", children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.LightBlue, children: "Git Commit" }) }),
|
|
121795
|
+
/* @__PURE__ */ jsx47(Box41, { children: /* @__PURE__ */ jsx47(Text47, { children: GIT_COMMIT_INFO }) })
|
|
121476
121796
|
] }),
|
|
121477
|
-
/* @__PURE__ */
|
|
121478
|
-
/* @__PURE__ */
|
|
121479
|
-
/* @__PURE__ */
|
|
121797
|
+
/* @__PURE__ */ jsxs44(Box41, { flexDirection: "row", children: [
|
|
121798
|
+
/* @__PURE__ */ jsx47(Box41, { width: "35%", children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.LightBlue, children: "Model" }) }),
|
|
121799
|
+
/* @__PURE__ */ jsx47(Box41, { children: /* @__PURE__ */ jsx47(Text47, { children: modelVersion }) })
|
|
121480
121800
|
] }),
|
|
121481
|
-
/* @__PURE__ */
|
|
121482
|
-
/* @__PURE__ */
|
|
121483
|
-
/* @__PURE__ */
|
|
121801
|
+
/* @__PURE__ */ jsxs44(Box41, { flexDirection: "row", children: [
|
|
121802
|
+
/* @__PURE__ */ jsx47(Box41, { width: "35%", children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.LightBlue, children: "Sandbox" }) }),
|
|
121803
|
+
/* @__PURE__ */ jsx47(Box41, { children: /* @__PURE__ */ jsx47(Text47, { children: sandboxEnv }) })
|
|
121484
121804
|
] }),
|
|
121485
|
-
/* @__PURE__ */
|
|
121486
|
-
/* @__PURE__ */
|
|
121487
|
-
/* @__PURE__ */
|
|
121805
|
+
/* @__PURE__ */ jsxs44(Box41, { flexDirection: "row", children: [
|
|
121806
|
+
/* @__PURE__ */ jsx47(Box41, { width: "35%", children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.LightBlue, children: "OS" }) }),
|
|
121807
|
+
/* @__PURE__ */ jsx47(Box41, { children: /* @__PURE__ */ jsx47(Text47, { children: osVersion }) })
|
|
121488
121808
|
] }),
|
|
121489
|
-
/* @__PURE__ */
|
|
121490
|
-
/* @__PURE__ */
|
|
121491
|
-
/* @__PURE__ */
|
|
121809
|
+
/* @__PURE__ */ jsxs44(Box41, { flexDirection: "row", children: [
|
|
121810
|
+
/* @__PURE__ */ jsx47(Box41, { width: "35%", children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.LightBlue, children: "Auth Method" }) }),
|
|
121811
|
+
/* @__PURE__ */ jsx47(Box41, { children: /* @__PURE__ */ jsx47(Text47, { children: selectedAuthType.startsWith("oauth") ? "OAuth" : selectedAuthType }) })
|
|
121492
121812
|
] }),
|
|
121493
|
-
gcpProject && /* @__PURE__ */
|
|
121494
|
-
/* @__PURE__ */
|
|
121495
|
-
/* @__PURE__ */
|
|
121813
|
+
gcpProject && /* @__PURE__ */ jsxs44(Box41, { flexDirection: "row", children: [
|
|
121814
|
+
/* @__PURE__ */ jsx47(Box41, { width: "35%", children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.LightBlue, children: "GCP Project" }) }),
|
|
121815
|
+
/* @__PURE__ */ jsx47(Box41, { children: /* @__PURE__ */ jsx47(Text47, { children: gcpProject }) })
|
|
121496
121816
|
] }),
|
|
121497
|
-
ideClient && /* @__PURE__ */
|
|
121498
|
-
/* @__PURE__ */
|
|
121499
|
-
/* @__PURE__ */
|
|
121817
|
+
ideClient && /* @__PURE__ */ jsxs44(Box41, { flexDirection: "row", children: [
|
|
121818
|
+
/* @__PURE__ */ jsx47(Box41, { width: "35%", children: /* @__PURE__ */ jsx47(Text47, { bold: true, color: Colors.LightBlue, children: "IDE Client" }) }),
|
|
121819
|
+
/* @__PURE__ */ jsx47(Box41, { children: /* @__PURE__ */ jsx47(Text47, { children: ideClient }) })
|
|
121500
121820
|
] })
|
|
121501
121821
|
]
|
|
121502
121822
|
}
|
|
121503
121823
|
);
|
|
121504
121824
|
|
|
121505
121825
|
// packages/cli/src/ui/components/StatsDisplay.tsx
|
|
121506
|
-
import { Box as
|
|
121826
|
+
import { Box as Box42, Text as Text48 } from "ink";
|
|
121507
121827
|
import Gradient3 from "ink-gradient";
|
|
121508
121828
|
|
|
121509
121829
|
// packages/cli/src/ui/utils/displayUtils.ts
|
|
@@ -121580,20 +121900,20 @@ var computeSessionStats = (metrics2) => {
|
|
|
121580
121900
|
};
|
|
121581
121901
|
|
|
121582
121902
|
// packages/cli/src/ui/components/StatsDisplay.tsx
|
|
121583
|
-
import { jsx as
|
|
121584
|
-
var StatRow = ({ title, children }) => /* @__PURE__ */
|
|
121585
|
-
/* @__PURE__ */
|
|
121903
|
+
import { jsx as jsx48, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
121904
|
+
var StatRow = ({ title, children }) => /* @__PURE__ */ jsxs45(Box42, { children: [
|
|
121905
|
+
/* @__PURE__ */ jsx48(Box42, { width: 28, children: /* @__PURE__ */ jsx48(Text48, { color: theme.text.link, children: title }) }),
|
|
121586
121906
|
children
|
|
121587
121907
|
] });
|
|
121588
|
-
var SubStatRow = ({ title, children }) => /* @__PURE__ */
|
|
121589
|
-
/* @__PURE__ */
|
|
121908
|
+
var SubStatRow = ({ title, children }) => /* @__PURE__ */ jsxs45(Box42, { paddingLeft: 2, children: [
|
|
121909
|
+
/* @__PURE__ */ jsx48(Box42, { width: 26, children: /* @__PURE__ */ jsxs45(Text48, { children: [
|
|
121590
121910
|
"\xBB ",
|
|
121591
121911
|
title
|
|
121592
121912
|
] }) }),
|
|
121593
121913
|
children
|
|
121594
121914
|
] });
|
|
121595
|
-
var Section = ({ title, children }) => /* @__PURE__ */
|
|
121596
|
-
/* @__PURE__ */
|
|
121915
|
+
var Section = ({ title, children }) => /* @__PURE__ */ jsxs45(Box42, { flexDirection: "column", width: "100%", marginBottom: 1, children: [
|
|
121916
|
+
/* @__PURE__ */ jsx48(Text48, { bold: true, children: title }),
|
|
121597
121917
|
children
|
|
121598
121918
|
] });
|
|
121599
121919
|
var ModelUsageTable = ({ models, totalCachedTokens, cacheEfficiency }) => {
|
|
@@ -121601,15 +121921,15 @@ var ModelUsageTable = ({ models, totalCachedTokens, cacheEfficiency }) => {
|
|
|
121601
121921
|
const requestsWidth = 8;
|
|
121602
121922
|
const inputTokensWidth = 15;
|
|
121603
121923
|
const outputTokensWidth = 15;
|
|
121604
|
-
return /* @__PURE__ */
|
|
121605
|
-
/* @__PURE__ */
|
|
121606
|
-
/* @__PURE__ */
|
|
121607
|
-
/* @__PURE__ */
|
|
121608
|
-
/* @__PURE__ */
|
|
121609
|
-
/* @__PURE__ */
|
|
121924
|
+
return /* @__PURE__ */ jsxs45(Box42, { flexDirection: "column", marginTop: 1, children: [
|
|
121925
|
+
/* @__PURE__ */ jsxs45(Box42, { children: [
|
|
121926
|
+
/* @__PURE__ */ jsx48(Box42, { width: nameWidth, children: /* @__PURE__ */ jsx48(Text48, { bold: true, children: "Model Usage" }) }),
|
|
121927
|
+
/* @__PURE__ */ jsx48(Box42, { width: requestsWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx48(Text48, { bold: true, children: "Reqs" }) }),
|
|
121928
|
+
/* @__PURE__ */ jsx48(Box42, { width: inputTokensWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx48(Text48, { bold: true, children: "Input Tokens" }) }),
|
|
121929
|
+
/* @__PURE__ */ jsx48(Box42, { width: outputTokensWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx48(Text48, { bold: true, children: "Output Tokens" }) })
|
|
121610
121930
|
] }),
|
|
121611
|
-
/* @__PURE__ */
|
|
121612
|
-
|
|
121931
|
+
/* @__PURE__ */ jsx48(
|
|
121932
|
+
Box42,
|
|
121613
121933
|
{
|
|
121614
121934
|
borderStyle: "round",
|
|
121615
121935
|
borderBottom: true,
|
|
@@ -121619,23 +121939,23 @@ var ModelUsageTable = ({ models, totalCachedTokens, cacheEfficiency }) => {
|
|
|
121619
121939
|
width: nameWidth + requestsWidth + inputTokensWidth + outputTokensWidth
|
|
121620
121940
|
}
|
|
121621
121941
|
),
|
|
121622
|
-
Object.entries(models).map(([name2, modelMetrics]) => /* @__PURE__ */
|
|
121623
|
-
/* @__PURE__ */
|
|
121624
|
-
/* @__PURE__ */
|
|
121625
|
-
/* @__PURE__ */
|
|
121626
|
-
/* @__PURE__ */
|
|
121942
|
+
Object.entries(models).map(([name2, modelMetrics]) => /* @__PURE__ */ jsxs45(Box42, { children: [
|
|
121943
|
+
/* @__PURE__ */ jsx48(Box42, { width: nameWidth, children: /* @__PURE__ */ jsx48(Text48, { children: name2.replace("-001", "") }) }),
|
|
121944
|
+
/* @__PURE__ */ jsx48(Box42, { width: requestsWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx48(Text48, { children: modelMetrics.api.totalRequests }) }),
|
|
121945
|
+
/* @__PURE__ */ jsx48(Box42, { width: inputTokensWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx48(Text48, { color: theme.status.warning, children: modelMetrics.tokens.prompt.toLocaleString() }) }),
|
|
121946
|
+
/* @__PURE__ */ jsx48(Box42, { width: outputTokensWidth, justifyContent: "flex-end", children: /* @__PURE__ */ jsx48(Text48, { color: theme.status.warning, children: modelMetrics.tokens.candidates.toLocaleString() }) })
|
|
121627
121947
|
] }, name2)),
|
|
121628
|
-
cacheEfficiency > 0 && /* @__PURE__ */
|
|
121629
|
-
/* @__PURE__ */
|
|
121630
|
-
/* @__PURE__ */
|
|
121948
|
+
cacheEfficiency > 0 && /* @__PURE__ */ jsxs45(Box42, { flexDirection: "column", marginTop: 1, children: [
|
|
121949
|
+
/* @__PURE__ */ jsxs45(Text48, { children: [
|
|
121950
|
+
/* @__PURE__ */ jsx48(Text48, { color: theme.status.success, children: "Savings Highlight:" }),
|
|
121631
121951
|
" ",
|
|
121632
121952
|
totalCachedTokens.toLocaleString(),
|
|
121633
121953
|
" (",
|
|
121634
121954
|
cacheEfficiency.toFixed(1),
|
|
121635
121955
|
"%) of input tokens were served from the cache, reducing costs."
|
|
121636
121956
|
] }),
|
|
121637
|
-
/* @__PURE__ */
|
|
121638
|
-
/* @__PURE__ */
|
|
121957
|
+
/* @__PURE__ */ jsx48(Box42, { height: 1 }),
|
|
121958
|
+
/* @__PURE__ */ jsx48(Text48, { color: theme.text.secondary, children: "\xBB Tip: For a full token breakdown, run `/stats model`." })
|
|
121639
121959
|
] })
|
|
121640
121960
|
] });
|
|
121641
121961
|
};
|
|
@@ -121662,12 +121982,12 @@ var StatsDisplay = ({
|
|
|
121662
121982
|
);
|
|
121663
121983
|
const renderTitle = () => {
|
|
121664
121984
|
if (title) {
|
|
121665
|
-
return theme.ui.gradient && theme.ui.gradient.length > 0 ? /* @__PURE__ */
|
|
121985
|
+
return theme.ui.gradient && theme.ui.gradient.length > 0 ? /* @__PURE__ */ jsx48(Gradient3, { colors: theme.ui.gradient, children: /* @__PURE__ */ jsx48(Text48, { bold: true, children: title }) }) : /* @__PURE__ */ jsx48(Text48, { bold: true, color: theme.text.accent, children: title });
|
|
121666
121986
|
}
|
|
121667
|
-
return /* @__PURE__ */
|
|
121987
|
+
return /* @__PURE__ */ jsx48(Text48, { bold: true, color: theme.text.accent, children: "Session Stats" });
|
|
121668
121988
|
};
|
|
121669
|
-
return /* @__PURE__ */
|
|
121670
|
-
|
|
121989
|
+
return /* @__PURE__ */ jsxs45(
|
|
121990
|
+
Box42,
|
|
121671
121991
|
{
|
|
121672
121992
|
borderStyle: "round",
|
|
121673
121993
|
borderColor: theme.border.default,
|
|
@@ -121676,73 +121996,73 @@ var StatsDisplay = ({
|
|
|
121676
121996
|
paddingX: 2,
|
|
121677
121997
|
children: [
|
|
121678
121998
|
renderTitle(),
|
|
121679
|
-
/* @__PURE__ */
|
|
121680
|
-
/* @__PURE__ */
|
|
121681
|
-
/* @__PURE__ */
|
|
121682
|
-
/* @__PURE__ */
|
|
121999
|
+
/* @__PURE__ */ jsx48(Box42, { height: 1 }),
|
|
122000
|
+
/* @__PURE__ */ jsxs45(Section, { title: "Interaction Summary", children: [
|
|
122001
|
+
/* @__PURE__ */ jsx48(StatRow, { title: "Session ID:", children: /* @__PURE__ */ jsx48(Text48, { children: stats.sessionId }) }),
|
|
122002
|
+
/* @__PURE__ */ jsx48(StatRow, { title: "Tool Calls:", children: /* @__PURE__ */ jsxs45(Text48, { children: [
|
|
121683
122003
|
tools.totalCalls,
|
|
121684
122004
|
" (",
|
|
121685
122005
|
" ",
|
|
121686
|
-
/* @__PURE__ */
|
|
122006
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.status.success, children: [
|
|
121687
122007
|
"\u2714 ",
|
|
121688
122008
|
tools.totalSuccess
|
|
121689
122009
|
] }),
|
|
121690
122010
|
" ",
|
|
121691
|
-
/* @__PURE__ */
|
|
122011
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.status.error, children: [
|
|
121692
122012
|
"\u2716 ",
|
|
121693
122013
|
tools.totalFail
|
|
121694
122014
|
] }),
|
|
121695
122015
|
" )"
|
|
121696
122016
|
] }) }),
|
|
121697
|
-
/* @__PURE__ */
|
|
122017
|
+
/* @__PURE__ */ jsx48(StatRow, { title: "Success Rate:", children: /* @__PURE__ */ jsxs45(Text48, { color: successColor, children: [
|
|
121698
122018
|
computed.successRate.toFixed(1),
|
|
121699
122019
|
"%"
|
|
121700
122020
|
] }) }),
|
|
121701
|
-
computed.totalDecisions > 0 && /* @__PURE__ */
|
|
122021
|
+
computed.totalDecisions > 0 && /* @__PURE__ */ jsx48(StatRow, { title: "User Agreement:", children: /* @__PURE__ */ jsxs45(Text48, { color: agreementColor, children: [
|
|
121702
122022
|
computed.agreementRate.toFixed(1),
|
|
121703
122023
|
"%",
|
|
121704
122024
|
" ",
|
|
121705
|
-
/* @__PURE__ */
|
|
122025
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
121706
122026
|
"(",
|
|
121707
122027
|
computed.totalDecisions,
|
|
121708
122028
|
" reviewed)"
|
|
121709
122029
|
] })
|
|
121710
122030
|
] }) }),
|
|
121711
|
-
files && (files.totalLinesAdded > 0 || files.totalLinesRemoved > 0) && /* @__PURE__ */
|
|
121712
|
-
/* @__PURE__ */
|
|
122031
|
+
files && (files.totalLinesAdded > 0 || files.totalLinesRemoved > 0) && /* @__PURE__ */ jsx48(StatRow, { title: "Code Changes:", children: /* @__PURE__ */ jsxs45(Text48, { children: [
|
|
122032
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.status.success, children: [
|
|
121713
122033
|
"+",
|
|
121714
122034
|
files.totalLinesAdded
|
|
121715
122035
|
] }),
|
|
121716
122036
|
" ",
|
|
121717
|
-
/* @__PURE__ */
|
|
122037
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.status.error, children: [
|
|
121718
122038
|
"-",
|
|
121719
122039
|
files.totalLinesRemoved
|
|
121720
122040
|
] })
|
|
121721
122041
|
] }) })
|
|
121722
122042
|
] }),
|
|
121723
|
-
/* @__PURE__ */
|
|
121724
|
-
/* @__PURE__ */
|
|
121725
|
-
/* @__PURE__ */
|
|
121726
|
-
/* @__PURE__ */
|
|
122043
|
+
/* @__PURE__ */ jsxs45(Section, { title: "Performance", children: [
|
|
122044
|
+
/* @__PURE__ */ jsx48(StatRow, { title: "Wall Time:", children: /* @__PURE__ */ jsx48(Text48, { children: duration }) }),
|
|
122045
|
+
/* @__PURE__ */ jsx48(StatRow, { title: "Agent Active:", children: /* @__PURE__ */ jsx48(Text48, { children: formatDuration(computed.agentActiveTime) }) }),
|
|
122046
|
+
/* @__PURE__ */ jsx48(SubStatRow, { title: "API Time:", children: /* @__PURE__ */ jsxs45(Text48, { children: [
|
|
121727
122047
|
formatDuration(computed.totalApiTime),
|
|
121728
122048
|
" ",
|
|
121729
|
-
/* @__PURE__ */
|
|
122049
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
121730
122050
|
"(",
|
|
121731
122051
|
computed.apiTimePercent.toFixed(1),
|
|
121732
122052
|
"%)"
|
|
121733
122053
|
] })
|
|
121734
122054
|
] }) }),
|
|
121735
|
-
/* @__PURE__ */
|
|
122055
|
+
/* @__PURE__ */ jsx48(SubStatRow, { title: "Tool Time:", children: /* @__PURE__ */ jsxs45(Text48, { children: [
|
|
121736
122056
|
formatDuration(computed.totalToolTime),
|
|
121737
122057
|
" ",
|
|
121738
|
-
/* @__PURE__ */
|
|
122058
|
+
/* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, children: [
|
|
121739
122059
|
"(",
|
|
121740
122060
|
computed.toolTimePercent.toFixed(1),
|
|
121741
122061
|
"%)"
|
|
121742
122062
|
] })
|
|
121743
122063
|
] }) })
|
|
121744
122064
|
] }),
|
|
121745
|
-
Object.keys(models).length > 0 && /* @__PURE__ */
|
|
122065
|
+
Object.keys(models).length > 0 && /* @__PURE__ */ jsx48(
|
|
121746
122066
|
ModelUsageTable,
|
|
121747
122067
|
{
|
|
121748
122068
|
models,
|
|
@@ -121756,8 +122076,8 @@ var StatsDisplay = ({
|
|
|
121756
122076
|
};
|
|
121757
122077
|
|
|
121758
122078
|
// packages/cli/src/ui/components/ModelStatsDisplay.tsx
|
|
121759
|
-
import { Box as
|
|
121760
|
-
import { jsx as
|
|
122079
|
+
import { Box as Box43, Text as Text49 } from "ink";
|
|
122080
|
+
import { jsx as jsx49, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
121761
122081
|
var METRIC_COL_WIDTH = 28;
|
|
121762
122082
|
var MODEL_COL_WIDTH = 22;
|
|
121763
122083
|
var StatRow2 = ({
|
|
@@ -121765,9 +122085,9 @@ var StatRow2 = ({
|
|
|
121765
122085
|
values,
|
|
121766
122086
|
isSubtle = false,
|
|
121767
122087
|
isSection = false
|
|
121768
|
-
}) => /* @__PURE__ */
|
|
121769
|
-
/* @__PURE__ */
|
|
121770
|
-
values.map((value, index) => /* @__PURE__ */
|
|
122088
|
+
}) => /* @__PURE__ */ jsxs46(Box43, { children: [
|
|
122089
|
+
/* @__PURE__ */ jsx49(Box43, { width: METRIC_COL_WIDTH, children: /* @__PURE__ */ jsx49(Text49, { bold: isSection, color: isSection ? void 0 : Colors.LightBlue, children: isSubtle ? ` \u21B3 ${title}` : title }) }),
|
|
122090
|
+
values.map((value, index) => /* @__PURE__ */ jsx49(Box43, { width: MODEL_COL_WIDTH, children: /* @__PURE__ */ jsx49(Text49, { children: value }) }, index))
|
|
121771
122091
|
] });
|
|
121772
122092
|
var ModelStatsDisplay = () => {
|
|
121773
122093
|
const { stats } = useSessionStats();
|
|
@@ -121776,14 +122096,14 @@ var ModelStatsDisplay = () => {
|
|
|
121776
122096
|
([, metrics2]) => metrics2.api.totalRequests > 0
|
|
121777
122097
|
);
|
|
121778
122098
|
if (activeModels.length === 0) {
|
|
121779
|
-
return /* @__PURE__ */
|
|
121780
|
-
|
|
122099
|
+
return /* @__PURE__ */ jsx49(
|
|
122100
|
+
Box43,
|
|
121781
122101
|
{
|
|
121782
122102
|
borderStyle: "round",
|
|
121783
122103
|
borderColor: Colors.Gray,
|
|
121784
122104
|
paddingY: 1,
|
|
121785
122105
|
paddingX: 2,
|
|
121786
|
-
children: /* @__PURE__ */
|
|
122106
|
+
children: /* @__PURE__ */ jsx49(Text49, { children: "No API calls have been made in this session." })
|
|
121787
122107
|
}
|
|
121788
122108
|
);
|
|
121789
122109
|
}
|
|
@@ -121796,8 +122116,8 @@ var ModelStatsDisplay = () => {
|
|
|
121796
122116
|
const hasCached = activeModels.some(
|
|
121797
122117
|
([, metrics2]) => metrics2.tokens.cached > 0
|
|
121798
122118
|
);
|
|
121799
|
-
return /* @__PURE__ */
|
|
121800
|
-
|
|
122119
|
+
return /* @__PURE__ */ jsxs46(
|
|
122120
|
+
Box43,
|
|
121801
122121
|
{
|
|
121802
122122
|
borderStyle: "round",
|
|
121803
122123
|
borderColor: Colors.Gray,
|
|
@@ -121805,14 +122125,14 @@ var ModelStatsDisplay = () => {
|
|
|
121805
122125
|
paddingY: 1,
|
|
121806
122126
|
paddingX: 2,
|
|
121807
122127
|
children: [
|
|
121808
|
-
/* @__PURE__ */
|
|
121809
|
-
/* @__PURE__ */
|
|
121810
|
-
/* @__PURE__ */
|
|
121811
|
-
/* @__PURE__ */
|
|
121812
|
-
modelNames.map((name2) => /* @__PURE__ */
|
|
122128
|
+
/* @__PURE__ */ jsx49(Text49, { bold: true, color: Colors.AccentPurple, children: "Model Stats For Nerds" }),
|
|
122129
|
+
/* @__PURE__ */ jsx49(Box43, { height: 1 }),
|
|
122130
|
+
/* @__PURE__ */ jsxs46(Box43, { children: [
|
|
122131
|
+
/* @__PURE__ */ jsx49(Box43, { width: METRIC_COL_WIDTH, children: /* @__PURE__ */ jsx49(Text49, { bold: true, children: "Metric" }) }),
|
|
122132
|
+
modelNames.map((name2) => /* @__PURE__ */ jsx49(Box43, { width: MODEL_COL_WIDTH, children: /* @__PURE__ */ jsx49(Text49, { bold: true, children: name2 }) }, name2))
|
|
121813
122133
|
] }),
|
|
121814
|
-
/* @__PURE__ */
|
|
121815
|
-
|
|
122134
|
+
/* @__PURE__ */ jsx49(
|
|
122135
|
+
Box43,
|
|
121816
122136
|
{
|
|
121817
122137
|
borderStyle: "single",
|
|
121818
122138
|
borderBottom: true,
|
|
@@ -121821,22 +122141,22 @@ var ModelStatsDisplay = () => {
|
|
|
121821
122141
|
borderRight: false
|
|
121822
122142
|
}
|
|
121823
122143
|
),
|
|
121824
|
-
/* @__PURE__ */
|
|
121825
|
-
/* @__PURE__ */
|
|
122144
|
+
/* @__PURE__ */ jsx49(StatRow2, { title: "API", values: [], isSection: true }),
|
|
122145
|
+
/* @__PURE__ */ jsx49(
|
|
121826
122146
|
StatRow2,
|
|
121827
122147
|
{
|
|
121828
122148
|
title: "Requests",
|
|
121829
122149
|
values: getModelValues((m) => m.api.totalRequests.toLocaleString())
|
|
121830
122150
|
}
|
|
121831
122151
|
),
|
|
121832
|
-
/* @__PURE__ */
|
|
122152
|
+
/* @__PURE__ */ jsx49(
|
|
121833
122153
|
StatRow2,
|
|
121834
122154
|
{
|
|
121835
122155
|
title: "Errors",
|
|
121836
122156
|
values: getModelValues((m) => {
|
|
121837
122157
|
const errorRate = calculateErrorRate(m);
|
|
121838
|
-
return /* @__PURE__ */
|
|
121839
|
-
|
|
122158
|
+
return /* @__PURE__ */ jsxs46(
|
|
122159
|
+
Text49,
|
|
121840
122160
|
{
|
|
121841
122161
|
color: m.api.totalErrors > 0 ? Colors.AccentRed : Colors.Foreground,
|
|
121842
122162
|
children: [
|
|
@@ -121850,7 +122170,7 @@ var ModelStatsDisplay = () => {
|
|
|
121850
122170
|
})
|
|
121851
122171
|
}
|
|
121852
122172
|
),
|
|
121853
|
-
/* @__PURE__ */
|
|
122173
|
+
/* @__PURE__ */ jsx49(
|
|
121854
122174
|
StatRow2,
|
|
121855
122175
|
{
|
|
121856
122176
|
title: "Avg Latency",
|
|
@@ -121860,16 +122180,16 @@ var ModelStatsDisplay = () => {
|
|
|
121860
122180
|
})
|
|
121861
122181
|
}
|
|
121862
122182
|
),
|
|
121863
|
-
/* @__PURE__ */
|
|
121864
|
-
/* @__PURE__ */
|
|
121865
|
-
/* @__PURE__ */
|
|
122183
|
+
/* @__PURE__ */ jsx49(Box43, { height: 1 }),
|
|
122184
|
+
/* @__PURE__ */ jsx49(StatRow2, { title: "Tokens", values: [], isSection: true }),
|
|
122185
|
+
/* @__PURE__ */ jsx49(
|
|
121866
122186
|
StatRow2,
|
|
121867
122187
|
{
|
|
121868
122188
|
title: "Total",
|
|
121869
|
-
values: getModelValues((m) => /* @__PURE__ */
|
|
122189
|
+
values: getModelValues((m) => /* @__PURE__ */ jsx49(Text49, { color: Colors.AccentYellow, children: m.tokens.total.toLocaleString() }))
|
|
121870
122190
|
}
|
|
121871
122191
|
),
|
|
121872
|
-
/* @__PURE__ */
|
|
122192
|
+
/* @__PURE__ */ jsx49(
|
|
121873
122193
|
StatRow2,
|
|
121874
122194
|
{
|
|
121875
122195
|
title: "Prompt",
|
|
@@ -121877,14 +122197,14 @@ var ModelStatsDisplay = () => {
|
|
|
121877
122197
|
values: getModelValues((m) => m.tokens.prompt.toLocaleString())
|
|
121878
122198
|
}
|
|
121879
122199
|
),
|
|
121880
|
-
hasCached && /* @__PURE__ */
|
|
122200
|
+
hasCached && /* @__PURE__ */ jsx49(
|
|
121881
122201
|
StatRow2,
|
|
121882
122202
|
{
|
|
121883
122203
|
title: "Cached",
|
|
121884
122204
|
isSubtle: true,
|
|
121885
122205
|
values: getModelValues((m) => {
|
|
121886
122206
|
const cacheHitRate = calculateCacheHitRate(m);
|
|
121887
|
-
return /* @__PURE__ */
|
|
122207
|
+
return /* @__PURE__ */ jsxs46(Text49, { color: Colors.AccentGreen, children: [
|
|
121888
122208
|
m.tokens.cached.toLocaleString(),
|
|
121889
122209
|
" (",
|
|
121890
122210
|
cacheHitRate.toFixed(1),
|
|
@@ -121893,7 +122213,7 @@ var ModelStatsDisplay = () => {
|
|
|
121893
122213
|
})
|
|
121894
122214
|
}
|
|
121895
122215
|
),
|
|
121896
|
-
hasThoughts && /* @__PURE__ */
|
|
122216
|
+
hasThoughts && /* @__PURE__ */ jsx49(
|
|
121897
122217
|
StatRow2,
|
|
121898
122218
|
{
|
|
121899
122219
|
title: "Thoughts",
|
|
@@ -121901,7 +122221,7 @@ var ModelStatsDisplay = () => {
|
|
|
121901
122221
|
values: getModelValues((m) => m.tokens.thoughts.toLocaleString())
|
|
121902
122222
|
}
|
|
121903
122223
|
),
|
|
121904
|
-
hasTool && /* @__PURE__ */
|
|
122224
|
+
hasTool && /* @__PURE__ */ jsx49(
|
|
121905
122225
|
StatRow2,
|
|
121906
122226
|
{
|
|
121907
122227
|
title: "Tool",
|
|
@@ -121909,7 +122229,7 @@ var ModelStatsDisplay = () => {
|
|
|
121909
122229
|
values: getModelValues((m) => m.tokens.tool.toLocaleString())
|
|
121910
122230
|
}
|
|
121911
122231
|
),
|
|
121912
|
-
/* @__PURE__ */
|
|
122232
|
+
/* @__PURE__ */ jsx49(
|
|
121913
122233
|
StatRow2,
|
|
121914
122234
|
{
|
|
121915
122235
|
title: "Output",
|
|
@@ -121923,8 +122243,8 @@ var ModelStatsDisplay = () => {
|
|
|
121923
122243
|
};
|
|
121924
122244
|
|
|
121925
122245
|
// packages/cli/src/ui/components/ToolStatsDisplay.tsx
|
|
121926
|
-
import { Box as
|
|
121927
|
-
import { jsx as
|
|
122246
|
+
import { Box as Box44, Text as Text50 } from "ink";
|
|
122247
|
+
import { jsx as jsx50, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
121928
122248
|
var TOOL_NAME_COL_WIDTH = 25;
|
|
121929
122249
|
var CALLS_COL_WIDTH = 8;
|
|
121930
122250
|
var SUCCESS_RATE_COL_WIDTH = 15;
|
|
@@ -121936,14 +122256,14 @@ var StatRow3 = ({ name: name2, stats }) => {
|
|
|
121936
122256
|
green: TOOL_SUCCESS_RATE_HIGH,
|
|
121937
122257
|
yellow: TOOL_SUCCESS_RATE_MEDIUM
|
|
121938
122258
|
});
|
|
121939
|
-
return /* @__PURE__ */
|
|
121940
|
-
/* @__PURE__ */
|
|
121941
|
-
/* @__PURE__ */
|
|
121942
|
-
/* @__PURE__ */
|
|
122259
|
+
return /* @__PURE__ */ jsxs47(Box44, { children: [
|
|
122260
|
+
/* @__PURE__ */ jsx50(Box44, { width: TOOL_NAME_COL_WIDTH, children: /* @__PURE__ */ jsx50(Text50, { color: Colors.LightBlue, children: name2 }) }),
|
|
122261
|
+
/* @__PURE__ */ jsx50(Box44, { width: CALLS_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { children: stats.count }) }),
|
|
122262
|
+
/* @__PURE__ */ jsx50(Box44, { width: SUCCESS_RATE_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs47(Text50, { color: successColor, children: [
|
|
121943
122263
|
successRate.toFixed(1),
|
|
121944
122264
|
"%"
|
|
121945
122265
|
] }) }),
|
|
121946
|
-
/* @__PURE__ */
|
|
122266
|
+
/* @__PURE__ */ jsx50(Box44, { width: AVG_DURATION_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { children: formatDuration(avgDuration) }) })
|
|
121947
122267
|
] });
|
|
121948
122268
|
};
|
|
121949
122269
|
var ToolStatsDisplay = () => {
|
|
@@ -121953,14 +122273,14 @@ var ToolStatsDisplay = () => {
|
|
|
121953
122273
|
([, metrics2]) => metrics2.count > 0
|
|
121954
122274
|
);
|
|
121955
122275
|
if (activeTools.length === 0) {
|
|
121956
|
-
return /* @__PURE__ */
|
|
121957
|
-
|
|
122276
|
+
return /* @__PURE__ */ jsx50(
|
|
122277
|
+
Box44,
|
|
121958
122278
|
{
|
|
121959
122279
|
borderStyle: "round",
|
|
121960
122280
|
borderColor: Colors.Gray,
|
|
121961
122281
|
paddingY: 1,
|
|
121962
122282
|
paddingX: 2,
|
|
121963
|
-
children: /* @__PURE__ */
|
|
122283
|
+
children: /* @__PURE__ */ jsx50(Text50, { children: "No tool calls have been made in this session." })
|
|
121964
122284
|
}
|
|
121965
122285
|
);
|
|
121966
122286
|
}
|
|
@@ -121979,8 +122299,8 @@ var ToolStatsDisplay = () => {
|
|
|
121979
122299
|
green: USER_AGREEMENT_RATE_HIGH,
|
|
121980
122300
|
yellow: USER_AGREEMENT_RATE_MEDIUM
|
|
121981
122301
|
});
|
|
121982
|
-
return /* @__PURE__ */
|
|
121983
|
-
|
|
122302
|
+
return /* @__PURE__ */ jsxs47(
|
|
122303
|
+
Box44,
|
|
121984
122304
|
{
|
|
121985
122305
|
borderStyle: "round",
|
|
121986
122306
|
borderColor: Colors.Gray,
|
|
@@ -121989,16 +122309,16 @@ var ToolStatsDisplay = () => {
|
|
|
121989
122309
|
paddingX: 2,
|
|
121990
122310
|
width: 70,
|
|
121991
122311
|
children: [
|
|
121992
|
-
/* @__PURE__ */
|
|
121993
|
-
/* @__PURE__ */
|
|
121994
|
-
/* @__PURE__ */
|
|
121995
|
-
/* @__PURE__ */
|
|
121996
|
-
/* @__PURE__ */
|
|
121997
|
-
/* @__PURE__ */
|
|
121998
|
-
/* @__PURE__ */
|
|
122312
|
+
/* @__PURE__ */ jsx50(Text50, { bold: true, color: Colors.AccentPurple, children: "Tool Stats For Nerds" }),
|
|
122313
|
+
/* @__PURE__ */ jsx50(Box44, { height: 1 }),
|
|
122314
|
+
/* @__PURE__ */ jsxs47(Box44, { children: [
|
|
122315
|
+
/* @__PURE__ */ jsx50(Box44, { width: TOOL_NAME_COL_WIDTH, children: /* @__PURE__ */ jsx50(Text50, { bold: true, children: "Tool Name" }) }),
|
|
122316
|
+
/* @__PURE__ */ jsx50(Box44, { width: CALLS_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { bold: true, children: "Calls" }) }),
|
|
122317
|
+
/* @__PURE__ */ jsx50(Box44, { width: SUCCESS_RATE_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { bold: true, children: "Success Rate" }) }),
|
|
122318
|
+
/* @__PURE__ */ jsx50(Box44, { width: AVG_DURATION_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { bold: true, children: "Avg Duration" }) })
|
|
121999
122319
|
] }),
|
|
122000
|
-
/* @__PURE__ */
|
|
122001
|
-
|
|
122320
|
+
/* @__PURE__ */ jsx50(
|
|
122321
|
+
Box44,
|
|
122002
122322
|
{
|
|
122003
122323
|
borderStyle: "single",
|
|
122004
122324
|
borderBottom: true,
|
|
@@ -122008,51 +122328,51 @@ var ToolStatsDisplay = () => {
|
|
|
122008
122328
|
width: "100%"
|
|
122009
122329
|
}
|
|
122010
122330
|
),
|
|
122011
|
-
activeTools.map(([name2, stats2]) => /* @__PURE__ */
|
|
122012
|
-
/* @__PURE__ */
|
|
122013
|
-
/* @__PURE__ */
|
|
122014
|
-
/* @__PURE__ */
|
|
122015
|
-
/* @__PURE__ */
|
|
122016
|
-
|
|
122331
|
+
activeTools.map(([name2, stats2]) => /* @__PURE__ */ jsx50(StatRow3, { name: name2, stats: stats2 }, name2)),
|
|
122332
|
+
/* @__PURE__ */ jsx50(Box44, { height: 1 }),
|
|
122333
|
+
/* @__PURE__ */ jsx50(Text50, { bold: true, children: "User Decision Summary" }),
|
|
122334
|
+
/* @__PURE__ */ jsxs47(Box44, { children: [
|
|
122335
|
+
/* @__PURE__ */ jsx50(
|
|
122336
|
+
Box44,
|
|
122017
122337
|
{
|
|
122018
122338
|
width: TOOL_NAME_COL_WIDTH + CALLS_COL_WIDTH + SUCCESS_RATE_COL_WIDTH,
|
|
122019
|
-
children: /* @__PURE__ */
|
|
122339
|
+
children: /* @__PURE__ */ jsx50(Text50, { color: Colors.LightBlue, children: "Total Reviewed Suggestions:" })
|
|
122020
122340
|
}
|
|
122021
122341
|
),
|
|
122022
|
-
/* @__PURE__ */
|
|
122342
|
+
/* @__PURE__ */ jsx50(Box44, { width: AVG_DURATION_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { children: totalReviewed }) })
|
|
122023
122343
|
] }),
|
|
122024
|
-
/* @__PURE__ */
|
|
122025
|
-
/* @__PURE__ */
|
|
122026
|
-
|
|
122344
|
+
/* @__PURE__ */ jsxs47(Box44, { children: [
|
|
122345
|
+
/* @__PURE__ */ jsx50(
|
|
122346
|
+
Box44,
|
|
122027
122347
|
{
|
|
122028
122348
|
width: TOOL_NAME_COL_WIDTH + CALLS_COL_WIDTH + SUCCESS_RATE_COL_WIDTH,
|
|
122029
|
-
children: /* @__PURE__ */
|
|
122349
|
+
children: /* @__PURE__ */ jsx50(Text50, { children: " \xBB Accepted:" })
|
|
122030
122350
|
}
|
|
122031
122351
|
),
|
|
122032
|
-
/* @__PURE__ */
|
|
122352
|
+
/* @__PURE__ */ jsx50(Box44, { width: AVG_DURATION_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { color: Colors.AccentGreen, children: totalDecisions.accept }) })
|
|
122033
122353
|
] }),
|
|
122034
|
-
/* @__PURE__ */
|
|
122035
|
-
/* @__PURE__ */
|
|
122036
|
-
|
|
122354
|
+
/* @__PURE__ */ jsxs47(Box44, { children: [
|
|
122355
|
+
/* @__PURE__ */ jsx50(
|
|
122356
|
+
Box44,
|
|
122037
122357
|
{
|
|
122038
122358
|
width: TOOL_NAME_COL_WIDTH + CALLS_COL_WIDTH + SUCCESS_RATE_COL_WIDTH,
|
|
122039
|
-
children: /* @__PURE__ */
|
|
122359
|
+
children: /* @__PURE__ */ jsx50(Text50, { children: " \xBB Rejected:" })
|
|
122040
122360
|
}
|
|
122041
122361
|
),
|
|
122042
|
-
/* @__PURE__ */
|
|
122362
|
+
/* @__PURE__ */ jsx50(Box44, { width: AVG_DURATION_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { color: Colors.AccentRed, children: totalDecisions.reject }) })
|
|
122043
122363
|
] }),
|
|
122044
|
-
/* @__PURE__ */
|
|
122045
|
-
/* @__PURE__ */
|
|
122046
|
-
|
|
122364
|
+
/* @__PURE__ */ jsxs47(Box44, { children: [
|
|
122365
|
+
/* @__PURE__ */ jsx50(
|
|
122366
|
+
Box44,
|
|
122047
122367
|
{
|
|
122048
122368
|
width: TOOL_NAME_COL_WIDTH + CALLS_COL_WIDTH + SUCCESS_RATE_COL_WIDTH,
|
|
122049
|
-
children: /* @__PURE__ */
|
|
122369
|
+
children: /* @__PURE__ */ jsx50(Text50, { children: " \xBB Modified:" })
|
|
122050
122370
|
}
|
|
122051
122371
|
),
|
|
122052
|
-
/* @__PURE__ */
|
|
122372
|
+
/* @__PURE__ */ jsx50(Box44, { width: AVG_DURATION_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { color: Colors.AccentYellow, children: totalDecisions.modify }) })
|
|
122053
122373
|
] }),
|
|
122054
|
-
/* @__PURE__ */
|
|
122055
|
-
|
|
122374
|
+
/* @__PURE__ */ jsx50(
|
|
122375
|
+
Box44,
|
|
122056
122376
|
{
|
|
122057
122377
|
borderStyle: "single",
|
|
122058
122378
|
borderBottom: true,
|
|
@@ -122062,15 +122382,15 @@ var ToolStatsDisplay = () => {
|
|
|
122062
122382
|
width: "100%"
|
|
122063
122383
|
}
|
|
122064
122384
|
),
|
|
122065
|
-
/* @__PURE__ */
|
|
122066
|
-
/* @__PURE__ */
|
|
122067
|
-
|
|
122385
|
+
/* @__PURE__ */ jsxs47(Box44, { children: [
|
|
122386
|
+
/* @__PURE__ */ jsx50(
|
|
122387
|
+
Box44,
|
|
122068
122388
|
{
|
|
122069
122389
|
width: TOOL_NAME_COL_WIDTH + CALLS_COL_WIDTH + SUCCESS_RATE_COL_WIDTH,
|
|
122070
|
-
children: /* @__PURE__ */
|
|
122390
|
+
children: /* @__PURE__ */ jsx50(Text50, { children: " Overall Agreement Rate:" })
|
|
122071
122391
|
}
|
|
122072
122392
|
),
|
|
122073
|
-
/* @__PURE__ */
|
|
122393
|
+
/* @__PURE__ */ jsx50(Box44, { width: AVG_DURATION_COL_WIDTH, justifyContent: "flex-end", children: /* @__PURE__ */ jsx50(Text50, { bold: true, color: totalReviewed > 0 ? agreementColor : void 0, children: totalReviewed > 0 ? `${agreementRate.toFixed(1)}%` : "--" }) })
|
|
122074
122394
|
] })
|
|
122075
122395
|
]
|
|
122076
122396
|
}
|
|
@@ -122078,16 +122398,16 @@ var ToolStatsDisplay = () => {
|
|
|
122078
122398
|
};
|
|
122079
122399
|
|
|
122080
122400
|
// packages/cli/src/ui/components/SessionSummaryDisplay.tsx
|
|
122081
|
-
import { jsx as
|
|
122401
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
122082
122402
|
var SessionSummaryDisplay = ({
|
|
122083
122403
|
duration
|
|
122084
|
-
}) => /* @__PURE__ */
|
|
122404
|
+
}) => /* @__PURE__ */ jsx51(StatsDisplay, { title: "Agent powering down. Goodbye!", duration });
|
|
122085
122405
|
|
|
122086
122406
|
// packages/cli/src/ui/components/Help.tsx
|
|
122087
|
-
import { Box as
|
|
122088
|
-
import { jsx as
|
|
122089
|
-
var Help = ({ commands }) => /* @__PURE__ */
|
|
122090
|
-
|
|
122407
|
+
import { Box as Box45, Text as Text51 } from "ink";
|
|
122408
|
+
import { jsx as jsx52, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
122409
|
+
var Help = ({ commands }) => /* @__PURE__ */ jsxs48(
|
|
122410
|
+
Box45,
|
|
122091
122411
|
{
|
|
122092
122412
|
flexDirection: "column",
|
|
122093
122413
|
marginBottom: 1,
|
|
@@ -122095,123 +122415,123 @@ var Help = ({ commands }) => /* @__PURE__ */ jsxs47(
|
|
|
122095
122415
|
borderStyle: "round",
|
|
122096
122416
|
padding: 1,
|
|
122097
122417
|
children: [
|
|
122098
|
-
/* @__PURE__ */
|
|
122099
|
-
/* @__PURE__ */
|
|
122100
|
-
/* @__PURE__ */
|
|
122418
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.Foreground, children: "Basics:" }),
|
|
122419
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122420
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Add context" }),
|
|
122101
122421
|
": Use",
|
|
122102
122422
|
" ",
|
|
122103
|
-
/* @__PURE__ */
|
|
122423
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "@" }),
|
|
122104
122424
|
" ",
|
|
122105
122425
|
"to specify files for context (e.g.,",
|
|
122106
122426
|
" ",
|
|
122107
|
-
/* @__PURE__ */
|
|
122427
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "@src/myFile.ts" }),
|
|
122108
122428
|
") to target specific files or folders."
|
|
122109
122429
|
] }),
|
|
122110
|
-
/* @__PURE__ */
|
|
122111
|
-
/* @__PURE__ */
|
|
122430
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122431
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Shell mode" }),
|
|
122112
122432
|
": Execute shell commands via",
|
|
122113
122433
|
" ",
|
|
122114
|
-
/* @__PURE__ */
|
|
122434
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "!" }),
|
|
122115
122435
|
" ",
|
|
122116
122436
|
"(e.g.,",
|
|
122117
122437
|
" ",
|
|
122118
|
-
/* @__PURE__ */
|
|
122438
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "!npm run start" }),
|
|
122119
122439
|
") or use natural language (e.g.",
|
|
122120
122440
|
" ",
|
|
122121
|
-
/* @__PURE__ */
|
|
122441
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "start server" }),
|
|
122122
122442
|
")."
|
|
122123
122443
|
] }),
|
|
122124
|
-
/* @__PURE__ */
|
|
122125
|
-
/* @__PURE__ */
|
|
122126
|
-
commands.filter((command) => command.description).map((command) => /* @__PURE__ */
|
|
122127
|
-
/* @__PURE__ */
|
|
122128
|
-
/* @__PURE__ */
|
|
122444
|
+
/* @__PURE__ */ jsx52(Box45, { height: 1 }),
|
|
122445
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.Foreground, children: "Commands:" }),
|
|
122446
|
+
commands.filter((command) => command.description).map((command) => /* @__PURE__ */ jsxs48(Box45, { flexDirection: "column", children: [
|
|
122447
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122448
|
+
/* @__PURE__ */ jsxs48(Text51, { bold: true, color: Colors.AccentPurple, children: [
|
|
122129
122449
|
" ",
|
|
122130
122450
|
"/",
|
|
122131
122451
|
command.name
|
|
122132
122452
|
] }),
|
|
122133
122453
|
command.description && " - " + command.description
|
|
122134
122454
|
] }),
|
|
122135
|
-
command.subCommands && command.subCommands.map((subCommand) => /* @__PURE__ */
|
|
122136
|
-
/* @__PURE__ */
|
|
122455
|
+
command.subCommands && command.subCommands.map((subCommand) => /* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122456
|
+
/* @__PURE__ */ jsxs48(Text51, { bold: true, color: Colors.AccentPurple, children: [
|
|
122137
122457
|
" ",
|
|
122138
122458
|
subCommand.name
|
|
122139
122459
|
] }),
|
|
122140
122460
|
subCommand.description && " - " + subCommand.description
|
|
122141
122461
|
] }, subCommand.name))
|
|
122142
122462
|
] }, command.name)),
|
|
122143
|
-
/* @__PURE__ */
|
|
122144
|
-
/* @__PURE__ */
|
|
122463
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122464
|
+
/* @__PURE__ */ jsxs48(Text51, { bold: true, color: Colors.AccentPurple, children: [
|
|
122145
122465
|
" ",
|
|
122146
122466
|
"!",
|
|
122147
122467
|
" "
|
|
122148
122468
|
] }),
|
|
122149
122469
|
"- shell command"
|
|
122150
122470
|
] }),
|
|
122151
|
-
/* @__PURE__ */
|
|
122152
|
-
/* @__PURE__ */
|
|
122153
|
-
/* @__PURE__ */
|
|
122154
|
-
/* @__PURE__ */
|
|
122471
|
+
/* @__PURE__ */ jsx52(Box45, { height: 1 }),
|
|
122472
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.Foreground, children: "Keyboard Shortcuts:" }),
|
|
122473
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122474
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Alt+Left/Right" }),
|
|
122155
122475
|
" ",
|
|
122156
122476
|
"- Jump through words in the input"
|
|
122157
122477
|
] }),
|
|
122158
|
-
/* @__PURE__ */
|
|
122159
|
-
/* @__PURE__ */
|
|
122478
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122479
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Ctrl+C" }),
|
|
122160
122480
|
" ",
|
|
122161
122481
|
"- Quit application"
|
|
122162
122482
|
] }),
|
|
122163
|
-
/* @__PURE__ */
|
|
122164
|
-
/* @__PURE__ */
|
|
122483
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122484
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: process.platform === "win32" ? "Ctrl+Enter" : "Ctrl+J" }),
|
|
122165
122485
|
" ",
|
|
122166
122486
|
process.platform === "linux" ? "- New line (Alt+Enter works for certain linux distros)" : "- New line"
|
|
122167
122487
|
] }),
|
|
122168
|
-
/* @__PURE__ */
|
|
122169
|
-
/* @__PURE__ */
|
|
122488
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122489
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Ctrl+L" }),
|
|
122170
122490
|
" ",
|
|
122171
122491
|
"- Clear the screen"
|
|
122172
122492
|
] }),
|
|
122173
|
-
/* @__PURE__ */
|
|
122174
|
-
/* @__PURE__ */
|
|
122493
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122494
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: process.platform === "darwin" ? "Ctrl+X / Meta+Enter" : "Ctrl+X" }),
|
|
122175
122495
|
" ",
|
|
122176
122496
|
"- Open input in external editor"
|
|
122177
122497
|
] }),
|
|
122178
|
-
/* @__PURE__ */
|
|
122179
|
-
/* @__PURE__ */
|
|
122498
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122499
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Ctrl+Y" }),
|
|
122180
122500
|
" ",
|
|
122181
122501
|
"- Toggle YOLO mode"
|
|
122182
122502
|
] }),
|
|
122183
|
-
/* @__PURE__ */
|
|
122184
|
-
/* @__PURE__ */
|
|
122503
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122504
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Enter" }),
|
|
122185
122505
|
" ",
|
|
122186
122506
|
"- Send message"
|
|
122187
122507
|
] }),
|
|
122188
|
-
/* @__PURE__ */
|
|
122189
|
-
/* @__PURE__ */
|
|
122508
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122509
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Esc" }),
|
|
122190
122510
|
" ",
|
|
122191
122511
|
"- Cancel operation"
|
|
122192
122512
|
] }),
|
|
122193
|
-
/* @__PURE__ */
|
|
122194
|
-
/* @__PURE__ */
|
|
122513
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122514
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Shift+Tab" }),
|
|
122195
122515
|
" ",
|
|
122196
122516
|
"- Toggle auto-accepting edits"
|
|
122197
122517
|
] }),
|
|
122198
|
-
/* @__PURE__ */
|
|
122199
|
-
/* @__PURE__ */
|
|
122518
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122519
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "Up/Down" }),
|
|
122200
122520
|
" ",
|
|
122201
122521
|
"- Cycle through your prompt history"
|
|
122202
122522
|
] }),
|
|
122203
|
-
/* @__PURE__ */
|
|
122204
|
-
/* @__PURE__ */
|
|
122523
|
+
/* @__PURE__ */ jsx52(Box45, { height: 1 }),
|
|
122524
|
+
/* @__PURE__ */ jsxs48(Text51, { color: Colors.Foreground, children: [
|
|
122205
122525
|
"For a full list of shortcuts, see",
|
|
122206
122526
|
" ",
|
|
122207
|
-
/* @__PURE__ */
|
|
122527
|
+
/* @__PURE__ */ jsx52(Text51, { bold: true, color: Colors.AccentPurple, children: "docs/keyboard-shortcuts.md" })
|
|
122208
122528
|
] })
|
|
122209
122529
|
]
|
|
122210
122530
|
}
|
|
122211
122531
|
);
|
|
122212
122532
|
|
|
122213
122533
|
// packages/cli/src/ui/components/HistoryItemDisplay.tsx
|
|
122214
|
-
import { jsx as
|
|
122534
|
+
import { jsx as jsx53, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
122215
122535
|
var HistoryItemDisplay = ({
|
|
122216
122536
|
item,
|
|
122217
122537
|
availableTerminalHeight,
|
|
@@ -122220,10 +122540,10 @@ var HistoryItemDisplay = ({
|
|
|
122220
122540
|
config,
|
|
122221
122541
|
commands,
|
|
122222
122542
|
isFocused = true
|
|
122223
|
-
}) => /* @__PURE__ */
|
|
122224
|
-
item.type === "user" && /* @__PURE__ */
|
|
122225
|
-
item.type === "user_shell" && /* @__PURE__ */
|
|
122226
|
-
item.type === "gemini" && /* @__PURE__ */
|
|
122543
|
+
}) => /* @__PURE__ */ jsxs49(Box46, { flexDirection: "column", children: [
|
|
122544
|
+
item.type === "user" && /* @__PURE__ */ jsx53(UserMessage, { text: item.text }),
|
|
122545
|
+
item.type === "user_shell" && /* @__PURE__ */ jsx53(UserShellMessage, { text: item.text }),
|
|
122546
|
+
item.type === "gemini" && /* @__PURE__ */ jsx53(
|
|
122227
122547
|
GeminiMessage,
|
|
122228
122548
|
{
|
|
122229
122549
|
text: item.text,
|
|
@@ -122232,7 +122552,7 @@ var HistoryItemDisplay = ({
|
|
|
122232
122552
|
terminalWidth
|
|
122233
122553
|
}
|
|
122234
122554
|
),
|
|
122235
|
-
item.type === "gemini_content" && /* @__PURE__ */
|
|
122555
|
+
item.type === "gemini_content" && /* @__PURE__ */ jsx53(
|
|
122236
122556
|
GeminiMessageContent,
|
|
122237
122557
|
{
|
|
122238
122558
|
text: item.text,
|
|
@@ -122241,9 +122561,9 @@ var HistoryItemDisplay = ({
|
|
|
122241
122561
|
terminalWidth
|
|
122242
122562
|
}
|
|
122243
122563
|
),
|
|
122244
|
-
item.type === "info" && /* @__PURE__ */
|
|
122245
|
-
item.type === "error" && /* @__PURE__ */
|
|
122246
|
-
item.type === "about" && /* @__PURE__ */
|
|
122564
|
+
item.type === "info" && /* @__PURE__ */ jsx53(InfoMessage, { text: item.text }),
|
|
122565
|
+
item.type === "error" && /* @__PURE__ */ jsx53(ErrorMessage, { text: item.text }),
|
|
122566
|
+
item.type === "about" && /* @__PURE__ */ jsx53(
|
|
122247
122567
|
AboutBox,
|
|
122248
122568
|
{
|
|
122249
122569
|
cliVersion: item.cliVersion,
|
|
@@ -122255,12 +122575,12 @@ var HistoryItemDisplay = ({
|
|
|
122255
122575
|
ideClient: item.ideClient
|
|
122256
122576
|
}
|
|
122257
122577
|
),
|
|
122258
|
-
item.type === "help" && commands && /* @__PURE__ */
|
|
122259
|
-
item.type === "stats" && /* @__PURE__ */
|
|
122260
|
-
item.type === "model_stats" && /* @__PURE__ */
|
|
122261
|
-
item.type === "tool_stats" && /* @__PURE__ */
|
|
122262
|
-
item.type === "quit" && /* @__PURE__ */
|
|
122263
|
-
item.type === "tool_group" && /* @__PURE__ */
|
|
122578
|
+
item.type === "help" && commands && /* @__PURE__ */ jsx53(Help, { commands }),
|
|
122579
|
+
item.type === "stats" && /* @__PURE__ */ jsx53(StatsDisplay, { duration: item.duration }),
|
|
122580
|
+
item.type === "model_stats" && /* @__PURE__ */ jsx53(ModelStatsDisplay, {}),
|
|
122581
|
+
item.type === "tool_stats" && /* @__PURE__ */ jsx53(ToolStatsDisplay, {}),
|
|
122582
|
+
item.type === "quit" && /* @__PURE__ */ jsx53(SessionSummaryDisplay, { duration: item.duration }),
|
|
122583
|
+
item.type === "tool_group" && /* @__PURE__ */ jsx53(
|
|
122264
122584
|
ToolGroupMessage,
|
|
122265
122585
|
{
|
|
122266
122586
|
toolCalls: item.tools,
|
|
@@ -122271,12 +122591,12 @@ var HistoryItemDisplay = ({
|
|
|
122271
122591
|
isFocused
|
|
122272
122592
|
}
|
|
122273
122593
|
),
|
|
122274
|
-
item.type === "compression" && /* @__PURE__ */
|
|
122594
|
+
item.type === "compression" && /* @__PURE__ */ jsx53(CompressionMessage, { compression: item.compression })
|
|
122275
122595
|
] }, item.id);
|
|
122276
122596
|
|
|
122277
122597
|
// packages/cli/src/ui/components/ContextSummaryDisplay.tsx
|
|
122278
|
-
import { Box as
|
|
122279
|
-
import { jsx as
|
|
122598
|
+
import { Box as Box47, Text as Text52 } from "ink";
|
|
122599
|
+
import { jsx as jsx54, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
122280
122600
|
var ContextSummaryDisplay = ({
|
|
122281
122601
|
geminiMdFileCount,
|
|
122282
122602
|
contextFileNames,
|
|
@@ -122291,7 +122611,7 @@ var ContextSummaryDisplay = ({
|
|
|
122291
122611
|
const blockedMcpServerCount = blockedMcpServers?.length || 0;
|
|
122292
122612
|
const openFileCount = ideContext2?.workspaceState?.openFiles?.length ?? 0;
|
|
122293
122613
|
if (geminiMdFileCount === 0 && mcpServerCount === 0 && blockedMcpServerCount === 0 && openFileCount === 0) {
|
|
122294
|
-
return /* @__PURE__ */
|
|
122614
|
+
return /* @__PURE__ */ jsx54(Text52, { children: " " });
|
|
122295
122615
|
}
|
|
122296
122616
|
const openFilesText = (() => {
|
|
122297
122617
|
if (openFileCount === 0) {
|
|
@@ -122336,25 +122656,25 @@ var ContextSummaryDisplay = ({
|
|
|
122336
122656
|
})();
|
|
122337
122657
|
const summaryParts = [openFilesText, geminiMdText, mcpText].filter(Boolean);
|
|
122338
122658
|
if (isNarrow) {
|
|
122339
|
-
return /* @__PURE__ */
|
|
122340
|
-
/* @__PURE__ */
|
|
122341
|
-
summaryParts.map((part, index) => /* @__PURE__ */
|
|
122659
|
+
return /* @__PURE__ */ jsxs50(Box47, { flexDirection: "column", children: [
|
|
122660
|
+
/* @__PURE__ */ jsx54(Text52, { color: Colors.Gray, children: "Using:" }),
|
|
122661
|
+
summaryParts.map((part, index) => /* @__PURE__ */ jsxs50(Text52, { color: Colors.Gray, children: [
|
|
122342
122662
|
" ",
|
|
122343
122663
|
"- ",
|
|
122344
122664
|
part
|
|
122345
122665
|
] }, index))
|
|
122346
122666
|
] });
|
|
122347
122667
|
}
|
|
122348
|
-
return /* @__PURE__ */
|
|
122668
|
+
return /* @__PURE__ */ jsx54(Box47, { children: /* @__PURE__ */ jsxs50(Text52, { color: Colors.Gray, children: [
|
|
122349
122669
|
"Using: ",
|
|
122350
122670
|
summaryParts.join(" | ")
|
|
122351
122671
|
] }) });
|
|
122352
122672
|
};
|
|
122353
122673
|
|
|
122354
122674
|
// packages/cli/src/ui/hooks/useHistoryManager.ts
|
|
122355
|
-
import { useState as
|
|
122675
|
+
import { useState as useState37, useRef as useRef11, useCallback as useCallback22 } from "react";
|
|
122356
122676
|
function useHistory() {
|
|
122357
|
-
const [history, setHistory] =
|
|
122677
|
+
const [history, setHistory] = useState37([]);
|
|
122358
122678
|
const messageIdCounterRef = useRef11(0);
|
|
122359
122679
|
const getNextMessageId = useCallback22((baseTimestamp) => {
|
|
122360
122680
|
messageIdCounterRef.current += 1;
|
|
@@ -122413,8 +122733,8 @@ import process18 from "node:process";
|
|
|
122413
122733
|
|
|
122414
122734
|
// packages/cli/src/ui/IdeIntegrationNudge.tsx
|
|
122415
122735
|
init_dist2();
|
|
122416
|
-
import { Box as
|
|
122417
|
-
import { jsx as
|
|
122736
|
+
import { Box as Box48, Text as Text53 } from "ink";
|
|
122737
|
+
import { jsx as jsx55, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
122418
122738
|
function IdeIntegrationNudge({
|
|
122419
122739
|
ide,
|
|
122420
122740
|
onComplete
|
|
@@ -122456,8 +122776,8 @@ function IdeIntegrationNudge({
|
|
|
122456
122776
|
}
|
|
122457
122777
|
];
|
|
122458
122778
|
const installText = isExtensionPreInstalled ? `If you select Yes, the CLI will have access to your open files and display diffs directly in ${ideName ?? "your editor"}.` : `If you select Yes, we'll install an extension that allows the CLI to access your open files and display diffs directly in ${ideName ?? "your editor"}.`;
|
|
122459
|
-
return /* @__PURE__ */
|
|
122460
|
-
|
|
122779
|
+
return /* @__PURE__ */ jsxs51(
|
|
122780
|
+
Box48,
|
|
122461
122781
|
{
|
|
122462
122782
|
flexDirection: "column",
|
|
122463
122783
|
borderStyle: "round",
|
|
@@ -122466,27 +122786,27 @@ function IdeIntegrationNudge({
|
|
|
122466
122786
|
width: "100%",
|
|
122467
122787
|
marginLeft: 1,
|
|
122468
122788
|
children: [
|
|
122469
|
-
/* @__PURE__ */
|
|
122470
|
-
/* @__PURE__ */
|
|
122471
|
-
/* @__PURE__ */
|
|
122789
|
+
/* @__PURE__ */ jsxs51(Box48, { marginBottom: 1, flexDirection: "column", children: [
|
|
122790
|
+
/* @__PURE__ */ jsxs51(Text53, { children: [
|
|
122791
|
+
/* @__PURE__ */ jsx55(Text53, { color: "yellow", children: "> " }),
|
|
122472
122792
|
`Do you want to connect ${ideName ?? "your"} editor to FSS Link?`
|
|
122473
122793
|
] }),
|
|
122474
|
-
/* @__PURE__ */
|
|
122794
|
+
/* @__PURE__ */ jsx55(Text53, { dimColor: true, children: installText })
|
|
122475
122795
|
] }),
|
|
122476
|
-
/* @__PURE__ */
|
|
122796
|
+
/* @__PURE__ */ jsx55(RadioButtonSelect, { items: OPTIONS, onSelect: onComplete })
|
|
122477
122797
|
]
|
|
122478
122798
|
}
|
|
122479
122799
|
);
|
|
122480
122800
|
}
|
|
122481
122801
|
|
|
122482
122802
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
122483
|
-
import { useState as
|
|
122803
|
+
import { useState as useState38, useEffect as useEffect35, useCallback as useCallback23 } from "react";
|
|
122484
122804
|
import { exec as exec6 } from "node:child_process";
|
|
122485
122805
|
import fs64 from "node:fs";
|
|
122486
122806
|
import fsPromises3 from "node:fs/promises";
|
|
122487
122807
|
import path76 from "path";
|
|
122488
122808
|
function useGitBranchName(cwd3) {
|
|
122489
|
-
const [branchName, setBranchName] =
|
|
122809
|
+
const [branchName, setBranchName] = useState38(void 0);
|
|
122490
122810
|
const fetchBranchName = useCallback23(
|
|
122491
122811
|
() => exec6(
|
|
122492
122812
|
"git rev-parse --abbrev-ref HEAD",
|
|
@@ -122516,7 +122836,7 @@ function useGitBranchName(cwd3) {
|
|
|
122516
122836
|
),
|
|
122517
122837
|
[cwd3, setBranchName]
|
|
122518
122838
|
);
|
|
122519
|
-
|
|
122839
|
+
useEffect35(() => {
|
|
122520
122840
|
fetchBranchName();
|
|
122521
122841
|
const gitLogsHeadPath = path76.join(cwd3, ".git", "logs", "HEAD");
|
|
122522
122842
|
let watcher;
|
|
@@ -122540,14 +122860,14 @@ function useGitBranchName(cwd3) {
|
|
|
122540
122860
|
}
|
|
122541
122861
|
|
|
122542
122862
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
122543
|
-
import { useEffect as
|
|
122863
|
+
import { useEffect as useEffect36 } from "react";
|
|
122544
122864
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
122545
122865
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
122546
122866
|
var useBracketedPaste = () => {
|
|
122547
122867
|
const cleanup = () => {
|
|
122548
122868
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
122549
122869
|
};
|
|
122550
|
-
|
|
122870
|
+
useEffect36(() => {
|
|
122551
122871
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
122552
122872
|
process.on("exit", cleanup);
|
|
122553
122873
|
process.on("SIGINT", cleanup);
|
|
@@ -122567,21 +122887,21 @@ import {
|
|
|
122567
122887
|
createContext as createContext5,
|
|
122568
122888
|
useCallback as useCallback24,
|
|
122569
122889
|
useContext as useContext5,
|
|
122570
|
-
useEffect as
|
|
122571
|
-
useState as
|
|
122890
|
+
useEffect as useEffect37,
|
|
122891
|
+
useState as useState39
|
|
122572
122892
|
} from "react";
|
|
122573
|
-
import { jsx as
|
|
122893
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
122574
122894
|
var VimModeContext = createContext5(void 0);
|
|
122575
122895
|
var VimModeProvider = ({
|
|
122576
122896
|
children,
|
|
122577
122897
|
settings
|
|
122578
122898
|
}) => {
|
|
122579
122899
|
const initialVimEnabled = settings.merged.vimMode ?? false;
|
|
122580
|
-
const [vimEnabled, setVimEnabled] =
|
|
122581
|
-
const [vimMode, setVimMode] =
|
|
122900
|
+
const [vimEnabled, setVimEnabled] = useState39(initialVimEnabled);
|
|
122901
|
+
const [vimMode, setVimMode] = useState39(
|
|
122582
122902
|
initialVimEnabled ? "NORMAL" : "INSERT"
|
|
122583
122903
|
);
|
|
122584
|
-
|
|
122904
|
+
useEffect37(() => {
|
|
122585
122905
|
const enabled = settings.merged.vimMode ?? false;
|
|
122586
122906
|
setVimEnabled(enabled);
|
|
122587
122907
|
if (enabled) {
|
|
@@ -122603,7 +122923,7 @@ var VimModeProvider = ({
|
|
|
122603
122923
|
toggleVimEnabled,
|
|
122604
122924
|
setVimMode
|
|
122605
122925
|
};
|
|
122606
|
-
return /* @__PURE__ */
|
|
122926
|
+
return /* @__PURE__ */ jsx56(VimModeContext.Provider, { value, children });
|
|
122607
122927
|
};
|
|
122608
122928
|
var useVimMode = () => {
|
|
122609
122929
|
const context = useContext5(VimModeContext);
|
|
@@ -122614,7 +122934,7 @@ var useVimMode = () => {
|
|
|
122614
122934
|
};
|
|
122615
122935
|
|
|
122616
122936
|
// packages/cli/src/ui/hooks/vim.ts
|
|
122617
|
-
import { useCallback as useCallback25, useReducer as useReducer4, useEffect as
|
|
122937
|
+
import { useCallback as useCallback25, useReducer as useReducer4, useEffect as useEffect38 } from "react";
|
|
122618
122938
|
var DIGIT_MULTIPLIER = 10;
|
|
122619
122939
|
var DEFAULT_COUNT = 1;
|
|
122620
122940
|
var DIGIT_1_TO_9 = /^[1-9]$/;
|
|
@@ -122678,7 +122998,7 @@ var vimReducer = (state, action) => {
|
|
|
122678
122998
|
function useVim(buffer, onSubmit) {
|
|
122679
122999
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
122680
123000
|
const [state, dispatch] = useReducer4(vimReducer, initialVimState);
|
|
122681
|
-
|
|
123001
|
+
useEffect38(() => {
|
|
122682
123002
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
122683
123003
|
}, [vimMode]);
|
|
122684
123004
|
const updateMode = useCallback25(
|
|
@@ -123156,9 +123476,9 @@ function useVim(buffer, onSubmit) {
|
|
|
123156
123476
|
}
|
|
123157
123477
|
|
|
123158
123478
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
123159
|
-
import { useState as
|
|
123479
|
+
import { useState as useState40 } from "react";
|
|
123160
123480
|
function useKittyKeyboardProtocol() {
|
|
123161
|
-
const [status] =
|
|
123481
|
+
const [status] = useState40({
|
|
123162
123482
|
supported: isKittyProtocolSupported(),
|
|
123163
123483
|
enabled: isKittyProtocolEnabled(),
|
|
123164
123484
|
checking: false
|
|
@@ -123170,16 +123490,16 @@ function useKittyKeyboardProtocol() {
|
|
|
123170
123490
|
import * as fs66 from "fs";
|
|
123171
123491
|
|
|
123172
123492
|
// packages/cli/src/ui/components/UpdateNotification.tsx
|
|
123173
|
-
import { Box as
|
|
123174
|
-
import { jsx as
|
|
123175
|
-
var UpdateNotification = ({ message }) => /* @__PURE__ */
|
|
123176
|
-
|
|
123493
|
+
import { Box as Box49, Text as Text54 } from "ink";
|
|
123494
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
123495
|
+
var UpdateNotification = ({ message }) => /* @__PURE__ */ jsx57(
|
|
123496
|
+
Box49,
|
|
123177
123497
|
{
|
|
123178
123498
|
borderStyle: "round",
|
|
123179
123499
|
borderColor: Colors.AccentYellow,
|
|
123180
123500
|
paddingX: 1,
|
|
123181
123501
|
marginY: 1,
|
|
123182
|
-
children: /* @__PURE__ */
|
|
123502
|
+
children: /* @__PURE__ */ jsx57(Text54, { color: Colors.AccentYellow, children: message })
|
|
123183
123503
|
}
|
|
123184
123504
|
);
|
|
123185
123505
|
|
|
@@ -123363,24 +123683,24 @@ var iTerm = {
|
|
|
123363
123683
|
init_SearchEngineConfigProvider();
|
|
123364
123684
|
|
|
123365
123685
|
// packages/cli/src/ui/components/ShowMoreLines.tsx
|
|
123366
|
-
import { Box as
|
|
123367
|
-
import { jsx as
|
|
123686
|
+
import { Box as Box50, Text as Text55 } from "ink";
|
|
123687
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
123368
123688
|
var ShowMoreLines = ({ constrainHeight }) => {
|
|
123369
123689
|
const overflowState = useOverflowState();
|
|
123370
123690
|
const streamingState = useStreamingContext();
|
|
123371
123691
|
if (overflowState === void 0 || overflowState.overflowingIds.size === 0 || !constrainHeight || !(streamingState === "idle" /* Idle */ || streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */)) {
|
|
123372
123692
|
return null;
|
|
123373
123693
|
}
|
|
123374
|
-
return /* @__PURE__ */
|
|
123694
|
+
return /* @__PURE__ */ jsx58(Box50, { children: /* @__PURE__ */ jsx58(Text55, { color: Colors.Gray, wrap: "truncate", children: "Press ctrl-s to show more lines" }) });
|
|
123375
123695
|
};
|
|
123376
123696
|
|
|
123377
123697
|
// packages/cli/src/ui/privacy/PrivacyNotice.tsx
|
|
123378
123698
|
init_dist2();
|
|
123379
|
-
import { Box as
|
|
123699
|
+
import { Box as Box54 } from "ink";
|
|
123380
123700
|
|
|
123381
123701
|
// packages/cli/src/ui/privacy/GeminiPrivacyNotice.tsx
|
|
123382
|
-
import { Box as
|
|
123383
|
-
import { jsx as
|
|
123702
|
+
import { Box as Box51, Newline, Text as Text56 } from "ink";
|
|
123703
|
+
import { jsx as jsx59, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
123384
123704
|
var GeminiPrivacyNotice = ({ onExit }) => {
|
|
123385
123705
|
useKeypress(
|
|
123386
123706
|
(key) => {
|
|
@@ -123390,48 +123710,48 @@ var GeminiPrivacyNotice = ({ onExit }) => {
|
|
|
123390
123710
|
},
|
|
123391
123711
|
{ isActive: true }
|
|
123392
123712
|
);
|
|
123393
|
-
return /* @__PURE__ */
|
|
123394
|
-
/* @__PURE__ */
|
|
123395
|
-
/* @__PURE__ */
|
|
123396
|
-
/* @__PURE__ */
|
|
123713
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", marginBottom: 1, children: [
|
|
123714
|
+
/* @__PURE__ */ jsx59(Text56, { bold: true, color: Colors.AccentPurple, children: "Gemini API Key Notice" }),
|
|
123715
|
+
/* @__PURE__ */ jsx59(Newline, {}),
|
|
123716
|
+
/* @__PURE__ */ jsxs52(Text56, { children: [
|
|
123397
123717
|
"By using the Gemini API",
|
|
123398
|
-
/* @__PURE__ */
|
|
123718
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.AccentBlue, children: "[1]" }),
|
|
123399
123719
|
", Google AI Studio",
|
|
123400
|
-
/* @__PURE__ */
|
|
123720
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.AccentRed, children: "[2]" }),
|
|
123401
123721
|
', and the other Google developer services that reference these terms (collectively, the "APIs" or "Services"), you are agreeing to Google APIs Terms of Service (the "API Terms")',
|
|
123402
|
-
/* @__PURE__ */
|
|
123722
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.AccentGreen, children: "[3]" }),
|
|
123403
123723
|
', and the Gemini API Additional Terms of Service (the "Additional Terms")',
|
|
123404
|
-
/* @__PURE__ */
|
|
123724
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.AccentPurple, children: "[4]" }),
|
|
123405
123725
|
"."
|
|
123406
123726
|
] }),
|
|
123407
|
-
/* @__PURE__ */
|
|
123408
|
-
/* @__PURE__ */
|
|
123409
|
-
/* @__PURE__ */
|
|
123727
|
+
/* @__PURE__ */ jsx59(Newline, {}),
|
|
123728
|
+
/* @__PURE__ */ jsxs52(Text56, { children: [
|
|
123729
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.AccentBlue, children: "[1]" }),
|
|
123410
123730
|
" ",
|
|
123411
123731
|
"https://ai.google.dev/docs/gemini_api_overview"
|
|
123412
123732
|
] }),
|
|
123413
|
-
/* @__PURE__ */
|
|
123414
|
-
/* @__PURE__ */
|
|
123733
|
+
/* @__PURE__ */ jsxs52(Text56, { children: [
|
|
123734
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.AccentRed, children: "[2]" }),
|
|
123415
123735
|
" https://aistudio.google.com/"
|
|
123416
123736
|
] }),
|
|
123417
|
-
/* @__PURE__ */
|
|
123418
|
-
/* @__PURE__ */
|
|
123737
|
+
/* @__PURE__ */ jsxs52(Text56, { children: [
|
|
123738
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.AccentGreen, children: "[3]" }),
|
|
123419
123739
|
" ",
|
|
123420
123740
|
"https://developers.google.com/terms"
|
|
123421
123741
|
] }),
|
|
123422
|
-
/* @__PURE__ */
|
|
123423
|
-
/* @__PURE__ */
|
|
123742
|
+
/* @__PURE__ */ jsxs52(Text56, { children: [
|
|
123743
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.AccentPurple, children: "[4]" }),
|
|
123424
123744
|
" ",
|
|
123425
123745
|
"https://ai.google.dev/gemini-api/terms"
|
|
123426
123746
|
] }),
|
|
123427
|
-
/* @__PURE__ */
|
|
123428
|
-
/* @__PURE__ */
|
|
123747
|
+
/* @__PURE__ */ jsx59(Newline, {}),
|
|
123748
|
+
/* @__PURE__ */ jsx59(Text56, { color: Colors.Gray, children: "Press Esc to exit." })
|
|
123429
123749
|
] });
|
|
123430
123750
|
};
|
|
123431
123751
|
|
|
123432
123752
|
// packages/cli/src/ui/privacy/CloudPaidPrivacyNotice.tsx
|
|
123433
|
-
import { Box as
|
|
123434
|
-
import { jsx as
|
|
123753
|
+
import { Box as Box52, Newline as Newline2, Text as Text57 } from "ink";
|
|
123754
|
+
import { jsx as jsx60, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
123435
123755
|
var CloudPaidPrivacyNotice = ({
|
|
123436
123756
|
onExit
|
|
123437
123757
|
}) => {
|
|
@@ -123443,43 +123763,43 @@ var CloudPaidPrivacyNotice = ({
|
|
|
123443
123763
|
},
|
|
123444
123764
|
{ isActive: true }
|
|
123445
123765
|
);
|
|
123446
|
-
return /* @__PURE__ */
|
|
123447
|
-
/* @__PURE__ */
|
|
123448
|
-
/* @__PURE__ */
|
|
123449
|
-
/* @__PURE__ */
|
|
123766
|
+
return /* @__PURE__ */ jsxs53(Box52, { flexDirection: "column", marginBottom: 1, children: [
|
|
123767
|
+
/* @__PURE__ */ jsx60(Text57, { bold: true, color: Colors.AccentPurple, children: "Vertex AI Notice" }),
|
|
123768
|
+
/* @__PURE__ */ jsx60(Newline2, {}),
|
|
123769
|
+
/* @__PURE__ */ jsxs53(Text57, { children: [
|
|
123450
123770
|
"Service Specific Terms",
|
|
123451
|
-
/* @__PURE__ */
|
|
123771
|
+
/* @__PURE__ */ jsx60(Text57, { color: Colors.AccentBlue, children: "[1]" }),
|
|
123452
123772
|
" are incorporated into the agreement under which Google has agreed to provide Google Cloud Platform",
|
|
123453
|
-
/* @__PURE__ */
|
|
123773
|
+
/* @__PURE__ */ jsx60(Text57, { color: Colors.AccentGreen, children: "[2]" }),
|
|
123454
123774
|
" to Customer (the \u201CAgreement\u201D). If the Agreement authorizes the resale or supply of Google Cloud Platform under a Google Cloud partner or reseller program, then except for in the section entitled \u201CPartner-Specific Terms\u201D, all references to Customer in the Service Specific Terms mean Partner or Reseller (as applicable), and all references to Customer Data in the Service Specific Terms mean Partner Data. Capitalized terms used but not defined in the Service Specific Terms have the meaning given to them in the Agreement."
|
|
123455
123775
|
] }),
|
|
123456
|
-
/* @__PURE__ */
|
|
123457
|
-
/* @__PURE__ */
|
|
123458
|
-
/* @__PURE__ */
|
|
123776
|
+
/* @__PURE__ */ jsx60(Newline2, {}),
|
|
123777
|
+
/* @__PURE__ */ jsxs53(Text57, { children: [
|
|
123778
|
+
/* @__PURE__ */ jsx60(Text57, { color: Colors.AccentBlue, children: "[1]" }),
|
|
123459
123779
|
" ",
|
|
123460
123780
|
"https://cloud.google.com/terms/service-terms"
|
|
123461
123781
|
] }),
|
|
123462
|
-
/* @__PURE__ */
|
|
123463
|
-
/* @__PURE__ */
|
|
123782
|
+
/* @__PURE__ */ jsxs53(Text57, { children: [
|
|
123783
|
+
/* @__PURE__ */ jsx60(Text57, { color: Colors.AccentGreen, children: "[2]" }),
|
|
123464
123784
|
" ",
|
|
123465
123785
|
"https://cloud.google.com/terms/services"
|
|
123466
123786
|
] }),
|
|
123467
|
-
/* @__PURE__ */
|
|
123468
|
-
/* @__PURE__ */
|
|
123787
|
+
/* @__PURE__ */ jsx60(Newline2, {}),
|
|
123788
|
+
/* @__PURE__ */ jsx60(Text57, { color: Colors.Gray, children: "Press Esc to exit." })
|
|
123469
123789
|
] });
|
|
123470
123790
|
};
|
|
123471
123791
|
|
|
123472
123792
|
// packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx
|
|
123473
|
-
import { Box as
|
|
123793
|
+
import { Box as Box53, Newline as Newline3, Text as Text58 } from "ink";
|
|
123474
123794
|
|
|
123475
123795
|
// packages/cli/src/ui/hooks/usePrivacySettings.ts
|
|
123476
123796
|
init_dist2();
|
|
123477
|
-
import { useState as
|
|
123797
|
+
import { useState as useState41, useEffect as useEffect39, useCallback as useCallback26 } from "react";
|
|
123478
123798
|
var usePrivacySettings = (config) => {
|
|
123479
|
-
const [privacyState, setPrivacyState] =
|
|
123799
|
+
const [privacyState, setPrivacyState] = useState41({
|
|
123480
123800
|
isLoading: true
|
|
123481
123801
|
});
|
|
123482
|
-
|
|
123802
|
+
useEffect39(() => {
|
|
123483
123803
|
const fetchInitialState = async () => {
|
|
123484
123804
|
setPrivacyState({
|
|
123485
123805
|
isLoading: true
|
|
@@ -123583,7 +123903,7 @@ async function setRemoteDataCollectionOptIn(server, optIn) {
|
|
|
123583
123903
|
}
|
|
123584
123904
|
|
|
123585
123905
|
// packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx
|
|
123586
|
-
import { jsx as
|
|
123906
|
+
import { jsx as jsx61, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
123587
123907
|
var CloudFreePrivacyNotice = ({
|
|
123588
123908
|
config,
|
|
123589
123909
|
onExit
|
|
@@ -123598,40 +123918,40 @@ var CloudFreePrivacyNotice = ({
|
|
|
123598
123918
|
{ isActive: true }
|
|
123599
123919
|
);
|
|
123600
123920
|
if (privacyState.isLoading) {
|
|
123601
|
-
return /* @__PURE__ */
|
|
123921
|
+
return /* @__PURE__ */ jsx61(Text58, { color: Colors.Gray, children: "Loading..." });
|
|
123602
123922
|
}
|
|
123603
123923
|
if (privacyState.error) {
|
|
123604
|
-
return /* @__PURE__ */
|
|
123605
|
-
/* @__PURE__ */
|
|
123924
|
+
return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", marginY: 1, children: [
|
|
123925
|
+
/* @__PURE__ */ jsxs54(Text58, { color: Colors.AccentRed, children: [
|
|
123606
123926
|
"Error loading Opt-in settings: ",
|
|
123607
123927
|
privacyState.error
|
|
123608
123928
|
] }),
|
|
123609
|
-
/* @__PURE__ */
|
|
123929
|
+
/* @__PURE__ */ jsx61(Text58, { color: Colors.Gray, children: "Press Esc to exit." })
|
|
123610
123930
|
] });
|
|
123611
123931
|
}
|
|
123612
123932
|
if (privacyState.isFreeTier === false) {
|
|
123613
|
-
return /* @__PURE__ */
|
|
123933
|
+
return /* @__PURE__ */ jsx61(CloudPaidPrivacyNotice, { onExit });
|
|
123614
123934
|
}
|
|
123615
123935
|
const items = [
|
|
123616
123936
|
{ label: "Yes", value: true },
|
|
123617
123937
|
{ label: "No", value: false }
|
|
123618
123938
|
];
|
|
123619
|
-
return /* @__PURE__ */
|
|
123620
|
-
/* @__PURE__ */
|
|
123621
|
-
/* @__PURE__ */
|
|
123622
|
-
/* @__PURE__ */
|
|
123939
|
+
return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", marginY: 1, children: [
|
|
123940
|
+
/* @__PURE__ */ jsx61(Text58, { bold: true, color: Colors.AccentPurple, children: "Gemini Code Assist for Individuals Privacy Notice" }),
|
|
123941
|
+
/* @__PURE__ */ jsx61(Newline3, {}),
|
|
123942
|
+
/* @__PURE__ */ jsxs54(Text58, { children: [
|
|
123623
123943
|
"This notice and our Privacy Policy",
|
|
123624
|
-
/* @__PURE__ */
|
|
123944
|
+
/* @__PURE__ */ jsx61(Text58, { color: Colors.AccentBlue, children: "[1]" }),
|
|
123625
123945
|
" describe how Gemini Code Assist handles your data. Please read them carefully."
|
|
123626
123946
|
] }),
|
|
123627
|
-
/* @__PURE__ */
|
|
123628
|
-
/* @__PURE__ */
|
|
123629
|
-
/* @__PURE__ */
|
|
123630
|
-
/* @__PURE__ */
|
|
123631
|
-
/* @__PURE__ */
|
|
123632
|
-
/* @__PURE__ */
|
|
123633
|
-
/* @__PURE__ */
|
|
123634
|
-
/* @__PURE__ */
|
|
123947
|
+
/* @__PURE__ */ jsx61(Newline3, {}),
|
|
123948
|
+
/* @__PURE__ */ jsx61(Text58, { children: "When you use Gemini Code Assist for individuals with Gemini CLI, Google collects your prompts, related code, generated output, code edits, related feature usage information, and your feedback to provide, improve, and develop Google products and services and machine learning technologies." }),
|
|
123949
|
+
/* @__PURE__ */ jsx61(Newline3, {}),
|
|
123950
|
+
/* @__PURE__ */ jsx61(Text58, { children: "To help with quality and improve our products (such as generative machine-learning models), human reviewers may read, annotate, and process the data collected above. We take steps to protect your privacy as part of this process. This includes disconnecting the data from your Google Account before reviewers see or annotate it, and storing those disconnected copies for up to 18 months. Please don't submit confidential information or any data you wouldn't want a reviewer to see or Google to use to improve our products, services and machine-learning technologies." }),
|
|
123951
|
+
/* @__PURE__ */ jsx61(Newline3, {}),
|
|
123952
|
+
/* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", children: [
|
|
123953
|
+
/* @__PURE__ */ jsx61(Text58, { children: "Allow Google to use this data to develop and improve our products?" }),
|
|
123954
|
+
/* @__PURE__ */ jsx61(
|
|
123635
123955
|
RadioButtonSelect,
|
|
123636
123956
|
{
|
|
123637
123957
|
items,
|
|
@@ -123645,19 +123965,19 @@ var CloudFreePrivacyNotice = ({
|
|
|
123645
123965
|
}
|
|
123646
123966
|
)
|
|
123647
123967
|
] }),
|
|
123648
|
-
/* @__PURE__ */
|
|
123649
|
-
/* @__PURE__ */
|
|
123650
|
-
/* @__PURE__ */
|
|
123968
|
+
/* @__PURE__ */ jsx61(Newline3, {}),
|
|
123969
|
+
/* @__PURE__ */ jsxs54(Text58, { children: [
|
|
123970
|
+
/* @__PURE__ */ jsx61(Text58, { color: Colors.AccentBlue, children: "[1]" }),
|
|
123651
123971
|
" ",
|
|
123652
123972
|
"https://policies.google.com/privacy"
|
|
123653
123973
|
] }),
|
|
123654
|
-
/* @__PURE__ */
|
|
123655
|
-
/* @__PURE__ */
|
|
123974
|
+
/* @__PURE__ */ jsx61(Newline3, {}),
|
|
123975
|
+
/* @__PURE__ */ jsx61(Text58, { color: Colors.Gray, children: "Press Enter to choose an option and exit." })
|
|
123656
123976
|
] });
|
|
123657
123977
|
};
|
|
123658
123978
|
|
|
123659
123979
|
// packages/cli/src/ui/privacy/PrivacyNotice.tsx
|
|
123660
|
-
import { jsx as
|
|
123980
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
123661
123981
|
var PrivacyNoticeText = ({
|
|
123662
123982
|
config,
|
|
123663
123983
|
onExit
|
|
@@ -123665,20 +123985,20 @@ var PrivacyNoticeText = ({
|
|
|
123665
123985
|
const authType = config.getContentGeneratorConfig()?.authType;
|
|
123666
123986
|
switch (authType) {
|
|
123667
123987
|
case AuthType.USE_GEMINI:
|
|
123668
|
-
return /* @__PURE__ */
|
|
123988
|
+
return /* @__PURE__ */ jsx62(GeminiPrivacyNotice, { onExit });
|
|
123669
123989
|
case AuthType.USE_VERTEX_AI:
|
|
123670
|
-
return /* @__PURE__ */
|
|
123990
|
+
return /* @__PURE__ */ jsx62(CloudPaidPrivacyNotice, { onExit });
|
|
123671
123991
|
case AuthType.LOGIN_WITH_GOOGLE:
|
|
123672
123992
|
default:
|
|
123673
|
-
return /* @__PURE__ */
|
|
123993
|
+
return /* @__PURE__ */ jsx62(CloudFreePrivacyNotice, { config, onExit });
|
|
123674
123994
|
}
|
|
123675
123995
|
};
|
|
123676
|
-
var PrivacyNotice = ({ onExit, config }) => /* @__PURE__ */
|
|
123996
|
+
var PrivacyNotice = ({ onExit, config }) => /* @__PURE__ */ jsx62(Box54, { borderStyle: "round", padding: 1, flexDirection: "column", children: /* @__PURE__ */ jsx62(PrivacyNoticeText, { config, onExit }) });
|
|
123677
123997
|
|
|
123678
123998
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
123679
|
-
import { useState as
|
|
123999
|
+
import { useState as useState42, useCallback as useCallback27 } from "react";
|
|
123680
124000
|
function useSettingsCommand() {
|
|
123681
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] =
|
|
124001
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = useState42(false);
|
|
123682
124002
|
const openSettingsDialog = useCallback27(() => {
|
|
123683
124003
|
setIsSettingsDialogOpen(true);
|
|
123684
124004
|
}, []);
|
|
@@ -123693,11 +124013,11 @@ function useSettingsCommand() {
|
|
|
123693
124013
|
}
|
|
123694
124014
|
|
|
123695
124015
|
// packages/cli/src/ui/components/SettingsDialog.tsx
|
|
123696
|
-
import React27, { useState as
|
|
123697
|
-
import { Box as
|
|
124016
|
+
import React27, { useState as useState43, useEffect as useEffect40 } from "react";
|
|
124017
|
+
import { Box as Box55, Text as Text59 } from "ink";
|
|
123698
124018
|
init_settings();
|
|
123699
124019
|
import chalk2 from "chalk";
|
|
123700
|
-
import { jsx as
|
|
124020
|
+
import { jsx as jsx63, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
123701
124021
|
var maxItemsToShow = 8;
|
|
123702
124022
|
function SettingsDialog({
|
|
123703
124023
|
settings,
|
|
@@ -123705,27 +124025,27 @@ function SettingsDialog({
|
|
|
123705
124025
|
onRestartRequest
|
|
123706
124026
|
}) {
|
|
123707
124027
|
const { vimEnabled, toggleVimEnabled } = useVimMode();
|
|
123708
|
-
const [focusSection, setFocusSection] =
|
|
124028
|
+
const [focusSection, setFocusSection] = useState43(
|
|
123709
124029
|
"settings"
|
|
123710
124030
|
);
|
|
123711
|
-
const [selectedScope, setSelectedScope] =
|
|
124031
|
+
const [selectedScope, setSelectedScope] = useState43(
|
|
123712
124032
|
"User" /* User */
|
|
123713
124033
|
);
|
|
123714
|
-
const [activeSettingIndex, setActiveSettingIndex] =
|
|
123715
|
-
const [scrollOffset, setScrollOffset] =
|
|
123716
|
-
const [showRestartPrompt, setShowRestartPrompt] =
|
|
123717
|
-
const [pendingSettings, setPendingSettings] =
|
|
124034
|
+
const [activeSettingIndex, setActiveSettingIndex] = useState43(0);
|
|
124035
|
+
const [scrollOffset, setScrollOffset] = useState43(0);
|
|
124036
|
+
const [showRestartPrompt, setShowRestartPrompt] = useState43(false);
|
|
124037
|
+
const [pendingSettings, setPendingSettings] = useState43(
|
|
123718
124038
|
() => (
|
|
123719
124039
|
// Deep clone to avoid mutation
|
|
123720
124040
|
structuredClone(settings.forScope(selectedScope).settings)
|
|
123721
124041
|
)
|
|
123722
124042
|
);
|
|
123723
|
-
const [modifiedSettings, setModifiedSettings] =
|
|
124043
|
+
const [modifiedSettings, setModifiedSettings] = useState43(
|
|
123724
124044
|
/* @__PURE__ */ new Set()
|
|
123725
124045
|
);
|
|
123726
|
-
const [globalPendingChanges, setGlobalPendingChanges] =
|
|
123727
|
-
const [_restartRequiredSettings, setRestartRequiredSettings] =
|
|
123728
|
-
|
|
124046
|
+
const [globalPendingChanges, setGlobalPendingChanges] = useState43(/* @__PURE__ */ new Map());
|
|
124047
|
+
const [_restartRequiredSettings, setRestartRequiredSettings] = useState43(/* @__PURE__ */ new Set());
|
|
124048
|
+
useEffect40(() => {
|
|
123729
124049
|
let updated = structuredClone(settings.forScope(selectedScope).settings);
|
|
123730
124050
|
const newModified = /* @__PURE__ */ new Set();
|
|
123731
124051
|
const newRestartRequired = /* @__PURE__ */ new Set();
|
|
@@ -123831,11 +124151,11 @@ function SettingsDialog({
|
|
|
123831
124151
|
});
|
|
123832
124152
|
};
|
|
123833
124153
|
const items = generateSettingsItems();
|
|
123834
|
-
const [editingKey, setEditingKey] =
|
|
123835
|
-
const [editBuffer, setEditBuffer] =
|
|
123836
|
-
const [editCursorPos, setEditCursorPos] =
|
|
123837
|
-
const [cursorVisible, setCursorVisible] =
|
|
123838
|
-
|
|
124154
|
+
const [editingKey, setEditingKey] = useState43(null);
|
|
124155
|
+
const [editBuffer, setEditBuffer] = useState43("");
|
|
124156
|
+
const [editCursorPos, setEditCursorPos] = useState43(0);
|
|
124157
|
+
const [cursorVisible, setCursorVisible] = useState43(true);
|
|
124158
|
+
useEffect40(() => {
|
|
123839
124159
|
if (!editingKey) {
|
|
123840
124160
|
setCursorVisible(true);
|
|
123841
124161
|
return;
|
|
@@ -124133,8 +124453,8 @@ function SettingsDialog({
|
|
|
124133
124453
|
},
|
|
124134
124454
|
{ isActive: true }
|
|
124135
124455
|
);
|
|
124136
|
-
return /* @__PURE__ */
|
|
124137
|
-
|
|
124456
|
+
return /* @__PURE__ */ jsx63(
|
|
124457
|
+
Box55,
|
|
124138
124458
|
{
|
|
124139
124459
|
borderStyle: "round",
|
|
124140
124460
|
borderColor: Colors.Gray,
|
|
@@ -124142,10 +124462,10 @@ function SettingsDialog({
|
|
|
124142
124462
|
padding: 1,
|
|
124143
124463
|
width: "100%",
|
|
124144
124464
|
height: "100%",
|
|
124145
|
-
children: /* @__PURE__ */
|
|
124146
|
-
/* @__PURE__ */
|
|
124147
|
-
/* @__PURE__ */
|
|
124148
|
-
showScrollUp && /* @__PURE__ */
|
|
124465
|
+
children: /* @__PURE__ */ jsxs55(Box55, { flexDirection: "column", flexGrow: 1, children: [
|
|
124466
|
+
/* @__PURE__ */ jsx63(Text59, { bold: true, color: Colors.AccentBlue, children: "Settings" }),
|
|
124467
|
+
/* @__PURE__ */ jsx63(Box55, { height: 1 }),
|
|
124468
|
+
showScrollUp && /* @__PURE__ */ jsx63(Text59, { color: Colors.Gray, children: "\u25B2" }),
|
|
124149
124469
|
visibleItems.map((item, idx) => {
|
|
124150
124470
|
const isActive = focusSection === "settings" && activeSettingIndex === idx + scrollOffset;
|
|
124151
124471
|
const scopeSettings = settings.forScope(selectedScope).settings;
|
|
@@ -124196,42 +124516,42 @@ function SettingsDialog({
|
|
|
124196
124516
|
selectedScope,
|
|
124197
124517
|
settings
|
|
124198
124518
|
);
|
|
124199
|
-
return /* @__PURE__ */
|
|
124200
|
-
/* @__PURE__ */
|
|
124201
|
-
/* @__PURE__ */
|
|
124202
|
-
/* @__PURE__ */
|
|
124203
|
-
|
|
124519
|
+
return /* @__PURE__ */ jsxs55(React27.Fragment, { children: [
|
|
124520
|
+
/* @__PURE__ */ jsxs55(Box55, { flexDirection: "row", alignItems: "center", children: [
|
|
124521
|
+
/* @__PURE__ */ jsx63(Box55, { minWidth: 2, flexShrink: 0, children: /* @__PURE__ */ jsx63(Text59, { color: isActive ? Colors.AccentGreen : Colors.Gray, children: isActive ? "\u25CF" : "" }) }),
|
|
124522
|
+
/* @__PURE__ */ jsx63(Box55, { minWidth: 50, children: /* @__PURE__ */ jsxs55(
|
|
124523
|
+
Text59,
|
|
124204
124524
|
{
|
|
124205
124525
|
color: isActive ? Colors.AccentGreen : Colors.Foreground,
|
|
124206
124526
|
children: [
|
|
124207
124527
|
item.label,
|
|
124208
|
-
scopeMessage && /* @__PURE__ */
|
|
124528
|
+
scopeMessage && /* @__PURE__ */ jsxs55(Text59, { color: Colors.Gray, children: [
|
|
124209
124529
|
" ",
|
|
124210
124530
|
scopeMessage
|
|
124211
124531
|
] })
|
|
124212
124532
|
]
|
|
124213
124533
|
}
|
|
124214
124534
|
) }),
|
|
124215
|
-
/* @__PURE__ */
|
|
124216
|
-
/* @__PURE__ */
|
|
124217
|
-
|
|
124535
|
+
/* @__PURE__ */ jsx63(Box55, { minWidth: 3 }),
|
|
124536
|
+
/* @__PURE__ */ jsx63(
|
|
124537
|
+
Text59,
|
|
124218
124538
|
{
|
|
124219
124539
|
color: isActive ? Colors.AccentGreen : shouldBeGreyedOut ? Colors.Gray : Colors.Foreground,
|
|
124220
124540
|
children: displayValue
|
|
124221
124541
|
}
|
|
124222
124542
|
)
|
|
124223
124543
|
] }),
|
|
124224
|
-
/* @__PURE__ */
|
|
124544
|
+
/* @__PURE__ */ jsx63(Box55, { height: 1 })
|
|
124225
124545
|
] }, item.value);
|
|
124226
124546
|
}),
|
|
124227
|
-
showScrollDown && /* @__PURE__ */
|
|
124228
|
-
/* @__PURE__ */
|
|
124229
|
-
/* @__PURE__ */
|
|
124230
|
-
/* @__PURE__ */
|
|
124547
|
+
showScrollDown && /* @__PURE__ */ jsx63(Text59, { color: Colors.Gray, children: "\u25BC" }),
|
|
124548
|
+
/* @__PURE__ */ jsx63(Box55, { height: 1 }),
|
|
124549
|
+
/* @__PURE__ */ jsxs55(Box55, { marginTop: 1, flexDirection: "column", children: [
|
|
124550
|
+
/* @__PURE__ */ jsxs55(Text59, { bold: focusSection === "scope", wrap: "truncate", children: [
|
|
124231
124551
|
focusSection === "scope" ? "> " : " ",
|
|
124232
124552
|
"Apply To"
|
|
124233
124553
|
] }),
|
|
124234
|
-
/* @__PURE__ */
|
|
124554
|
+
/* @__PURE__ */ jsx63(
|
|
124235
124555
|
RadioButtonSelect,
|
|
124236
124556
|
{
|
|
124237
124557
|
items: scopeItems,
|
|
@@ -124243,9 +124563,9 @@ function SettingsDialog({
|
|
|
124243
124563
|
}
|
|
124244
124564
|
)
|
|
124245
124565
|
] }),
|
|
124246
|
-
/* @__PURE__ */
|
|
124247
|
-
/* @__PURE__ */
|
|
124248
|
-
showRestartPrompt && /* @__PURE__ */
|
|
124566
|
+
/* @__PURE__ */ jsx63(Box55, { height: 1 }),
|
|
124567
|
+
/* @__PURE__ */ jsx63(Text59, { color: Colors.Gray, children: "(Use Enter to select, Tab to change focus)" }),
|
|
124568
|
+
showRestartPrompt && /* @__PURE__ */ jsx63(Text59, { color: Colors.AccentYellow, children: "To see changes, Gemini CLI must be restarted. Press r to exit and apply changes now." })
|
|
124249
124569
|
] })
|
|
124250
124570
|
}
|
|
124251
124571
|
);
|
|
@@ -124497,34 +124817,34 @@ import { EventEmitter as EventEmitter5 } from "events";
|
|
|
124497
124817
|
var appEvents = new EventEmitter5();
|
|
124498
124818
|
|
|
124499
124819
|
// packages/cli/src/ui/App.tsx
|
|
124500
|
-
import { Fragment as Fragment7, jsx as
|
|
124820
|
+
import { Fragment as Fragment7, jsx as jsx64, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
124501
124821
|
var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
|
|
124502
124822
|
var MAX_DISPLAYED_QUEUED_MESSAGES = 3;
|
|
124503
124823
|
var AppWrapper = (props) => {
|
|
124504
124824
|
const kittyProtocolStatus = useKittyKeyboardProtocol();
|
|
124505
|
-
return /* @__PURE__ */
|
|
124825
|
+
return /* @__PURE__ */ jsx64(
|
|
124506
124826
|
KeypressProvider,
|
|
124507
124827
|
{
|
|
124508
124828
|
kittyProtocolEnabled: kittyProtocolStatus.enabled,
|
|
124509
124829
|
config: props.config,
|
|
124510
|
-
children: /* @__PURE__ */
|
|
124830
|
+
children: /* @__PURE__ */ jsx64(SessionStatsProvider, { children: /* @__PURE__ */ jsx64(VimModeProvider, { settings: props.settings, children: /* @__PURE__ */ jsx64(App, { ...props }) }) })
|
|
124511
124831
|
}
|
|
124512
124832
|
);
|
|
124513
124833
|
};
|
|
124514
124834
|
var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
124515
124835
|
const isFocused = useFocus();
|
|
124516
124836
|
useBracketedPaste();
|
|
124517
|
-
const [updateInfo, setUpdateInfo] =
|
|
124837
|
+
const [updateInfo, setUpdateInfo] = useState44(null);
|
|
124518
124838
|
const { stdout } = useStdout2();
|
|
124519
124839
|
const nightly = version.includes("nightly");
|
|
124520
124840
|
const { history, addItem, clearItems, loadHistory } = useHistory();
|
|
124521
|
-
const [idePromptAnswered, setIdePromptAnswered] =
|
|
124841
|
+
const [idePromptAnswered, setIdePromptAnswered] = useState44(false);
|
|
124522
124842
|
const currentIDE = config.getIdeClient().getCurrentIde();
|
|
124523
|
-
|
|
124843
|
+
useEffect41(() => {
|
|
124524
124844
|
registerCleanup(() => config.getIdeClient().disconnect());
|
|
124525
124845
|
}, [config]);
|
|
124526
124846
|
const shouldShowIdePrompt = currentIDE && !config.getIdeMode() && !settings.merged.hasSeenIdeIntegrationNudge && !idePromptAnswered;
|
|
124527
|
-
|
|
124847
|
+
useEffect41(() => {
|
|
124528
124848
|
const cleanup = setUpdateHandler(addItem, setUpdateInfo);
|
|
124529
124849
|
return cleanup;
|
|
124530
124850
|
}, [addItem]);
|
|
@@ -124533,7 +124853,7 @@ var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
|
124533
124853
|
handleNewMessage,
|
|
124534
124854
|
clearConsoleMessages: clearConsoleMessagesState
|
|
124535
124855
|
} = useConsoleMessages();
|
|
124536
|
-
|
|
124856
|
+
useEffect41(() => {
|
|
124537
124857
|
const consolePatcher = new ConsolePatcher({
|
|
124538
124858
|
onNewMessage: handleNewMessage,
|
|
124539
124859
|
debugMode: config.getDebugMode()
|
|
@@ -124542,52 +124862,52 @@ var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
|
124542
124862
|
registerCleanup(consolePatcher.cleanup);
|
|
124543
124863
|
}, [handleNewMessage, config]);
|
|
124544
124864
|
const { stats: sessionStats } = useSessionStats();
|
|
124545
|
-
const [staticNeedsRefresh, setStaticNeedsRefresh] =
|
|
124546
|
-
const [staticKey, setStaticKey] =
|
|
124865
|
+
const [staticNeedsRefresh, setStaticNeedsRefresh] = useState44(false);
|
|
124866
|
+
const [staticKey, setStaticKey] = useState44(0);
|
|
124547
124867
|
const refreshStatic = useCallback28(() => {
|
|
124548
124868
|
stdout.write(base_exports.clearTerminal);
|
|
124549
124869
|
setStaticKey((prev) => prev + 1);
|
|
124550
124870
|
}, [setStaticKey, stdout]);
|
|
124551
|
-
const [geminiMdFileCount, setGeminiMdFileCount] =
|
|
124552
|
-
const [debugMessage, setDebugMessage] =
|
|
124553
|
-
const [themeError, setThemeError] =
|
|
124554
|
-
const [authError, setAuthError] =
|
|
124555
|
-
const [editorError, setEditorError] =
|
|
124556
|
-
const [isSearchDialogOpen, setIsSearchDialogOpen] =
|
|
124557
|
-
const [footerHeight, setFooterHeight] =
|
|
124558
|
-
|
|
124871
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = useState44(0);
|
|
124872
|
+
const [debugMessage, setDebugMessage] = useState44("");
|
|
124873
|
+
const [themeError, setThemeError] = useState44(null);
|
|
124874
|
+
const [authError, setAuthError] = useState44(null);
|
|
124875
|
+
const [editorError, setEditorError] = useState44(null);
|
|
124876
|
+
const [isSearchDialogOpen, setIsSearchDialogOpen] = useState44(false);
|
|
124877
|
+
const [footerHeight, setFooterHeight] = useState44(0);
|
|
124878
|
+
useEffect41(() => {
|
|
124559
124879
|
const initializeSearchEngineConfig = async () => {
|
|
124560
124880
|
const configProvider = SearchEngineConfigProvider.getInstance();
|
|
124561
124881
|
await configProvider.loadConfiguration();
|
|
124562
124882
|
};
|
|
124563
124883
|
initializeSearchEngineConfig();
|
|
124564
124884
|
}, []);
|
|
124565
|
-
const [corgiMode, setCorgiMode] =
|
|
124566
|
-
const [isTrustedFolderState, setIsTrustedFolder] =
|
|
124885
|
+
const [corgiMode, setCorgiMode] = useState44(false);
|
|
124886
|
+
const [isTrustedFolderState, setIsTrustedFolder] = useState44(
|
|
124567
124887
|
config.isTrustedFolder()
|
|
124568
124888
|
);
|
|
124569
|
-
const [currentModel, setCurrentModel] =
|
|
124570
|
-
const [shellModeActive, setShellModeActive] =
|
|
124571
|
-
const [showErrorDetails, setShowErrorDetails] =
|
|
124572
|
-
const [showToolDescriptions, setShowToolDescriptions] =
|
|
124573
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] =
|
|
124574
|
-
const [quittingMessages, setQuittingMessages] =
|
|
124889
|
+
const [currentModel, setCurrentModel] = useState44(config.getModel());
|
|
124890
|
+
const [shellModeActive, setShellModeActive] = useState44(false);
|
|
124891
|
+
const [showErrorDetails, setShowErrorDetails] = useState44(false);
|
|
124892
|
+
const [showToolDescriptions, setShowToolDescriptions] = useState44(false);
|
|
124893
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = useState44(false);
|
|
124894
|
+
const [quittingMessages, setQuittingMessages] = useState44(null);
|
|
124575
124895
|
const ctrlCTimerRef = useRef12(null);
|
|
124576
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] =
|
|
124896
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = useState44(false);
|
|
124577
124897
|
const ctrlDTimerRef = useRef12(null);
|
|
124578
|
-
const [constrainHeight, setConstrainHeight] =
|
|
124579
|
-
const [showPrivacyNotice, setShowPrivacyNotice] =
|
|
124580
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] =
|
|
124581
|
-
const [userTier, setUserTier] =
|
|
124582
|
-
const [ideContextState, setIdeContextState] =
|
|
124583
|
-
const [showEscapePrompt, setShowEscapePrompt] =
|
|
124584
|
-
const [isProcessing, setIsProcessing] =
|
|
124585
|
-
|
|
124898
|
+
const [constrainHeight, setConstrainHeight] = useState44(true);
|
|
124899
|
+
const [showPrivacyNotice, setShowPrivacyNotice] = useState44(false);
|
|
124900
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = useState44(false);
|
|
124901
|
+
const [userTier, setUserTier] = useState44(void 0);
|
|
124902
|
+
const [ideContextState, setIdeContextState] = useState44();
|
|
124903
|
+
const [showEscapePrompt, setShowEscapePrompt] = useState44(false);
|
|
124904
|
+
const [isProcessing, setIsProcessing] = useState44(false);
|
|
124905
|
+
useEffect41(() => {
|
|
124586
124906
|
const unsubscribe = ideContext.subscribeToIdeContext(setIdeContextState);
|
|
124587
124907
|
setIdeContextState(ideContext.getIdeContext());
|
|
124588
124908
|
return unsubscribe;
|
|
124589
124909
|
}, []);
|
|
124590
|
-
|
|
124910
|
+
useEffect41(() => {
|
|
124591
124911
|
const openDebugConsole = () => {
|
|
124592
124912
|
setShowErrorDetails(true);
|
|
124593
124913
|
setConstrainHeight(false);
|
|
@@ -124643,7 +124963,7 @@ var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
|
124643
124963
|
handleRestart: handleWelcomeBackRestart,
|
|
124644
124964
|
handleCancel: handleWelcomeBackCancel
|
|
124645
124965
|
} = useWelcomeBack(settings);
|
|
124646
|
-
|
|
124966
|
+
useEffect41(() => {
|
|
124647
124967
|
if (settings.merged.selectedAuthType && !settings.merged.useExternalAuth) {
|
|
124648
124968
|
const error = validateAuthMethod(settings.merged.selectedAuthType);
|
|
124649
124969
|
if (error) {
|
|
@@ -124657,7 +124977,7 @@ var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
|
124657
124977
|
openAuthDialog,
|
|
124658
124978
|
setAuthError
|
|
124659
124979
|
]);
|
|
124660
|
-
|
|
124980
|
+
useEffect41(() => {
|
|
124661
124981
|
if (!isAuthenticating) {
|
|
124662
124982
|
setUserTier(config.getGeminiClient()?.getUserTier());
|
|
124663
124983
|
}
|
|
@@ -124721,7 +125041,7 @@ var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
|
124721
125041
|
console.error("Error refreshing memory:", error);
|
|
124722
125042
|
}
|
|
124723
125043
|
}, [config, addItem, settings.merged]);
|
|
124724
|
-
|
|
125044
|
+
useEffect41(() => {
|
|
124725
125045
|
const checkModelChange = () => {
|
|
124726
125046
|
const configModel = config.getModel();
|
|
124727
125047
|
if (configModel !== currentModel) {
|
|
@@ -124732,7 +125052,7 @@ var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
|
124732
125052
|
const interval = setInterval(checkModelChange, 1e3);
|
|
124733
125053
|
return () => clearInterval(interval);
|
|
124734
125054
|
}, [config, currentModel]);
|
|
124735
|
-
|
|
125055
|
+
useEffect41(() => {
|
|
124736
125056
|
const flashFallbackHandler = async (currentModel2, fallbackModel, error) => {
|
|
124737
125057
|
let message;
|
|
124738
125058
|
if (config.getContentGeneratorConfig().authType === AuthType.LOGIN_WITH_GOOGLE) {
|
|
@@ -124864,7 +125184,7 @@ var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
|
124864
125184
|
isValidPath,
|
|
124865
125185
|
shellModeActive
|
|
124866
125186
|
});
|
|
124867
|
-
const [userMessages, setUserMessages] =
|
|
125187
|
+
const [userMessages, setUserMessages] = useState44([]);
|
|
124868
125188
|
const cancelHandlerRef = useRef12(() => {
|
|
124869
125189
|
});
|
|
124870
125190
|
const {
|
|
@@ -124890,7 +125210,7 @@ var App = ({ config, settings, startupWarnings = [], version }) => {
|
|
|
124890
125210
|
refreshStatic,
|
|
124891
125211
|
() => cancelHandlerRef.current()
|
|
124892
125212
|
);
|
|
124893
|
-
|
|
125213
|
+
useEffect41(() => {
|
|
124894
125214
|
if (contextToPopulate && !initialPromptSubmitted.current) {
|
|
124895
125215
|
submitQuery(contextToPopulate);
|
|
124896
125216
|
initialPromptSubmitted.current = true;
|
|
@@ -125025,13 +125345,13 @@ ${queuedText}` : queuedText;
|
|
|
125025
125345
|
useKeypress(handleGlobalKeypress, {
|
|
125026
125346
|
isActive: true
|
|
125027
125347
|
});
|
|
125028
|
-
|
|
125348
|
+
useEffect41(() => {
|
|
125029
125349
|
if (config) {
|
|
125030
125350
|
setGeminiMdFileCount(config.getGeminiMdFileCount());
|
|
125031
125351
|
}
|
|
125032
125352
|
}, [config, config.getGeminiMdFileCount]);
|
|
125033
125353
|
const logger6 = useLogger();
|
|
125034
|
-
|
|
125354
|
+
useEffect41(() => {
|
|
125035
125355
|
const fetchUserMessages = async () => {
|
|
125036
125356
|
const pastMessagesRaw = await logger6?.getPreviousUserMessages() || [];
|
|
125037
125357
|
const currentSessionUserMessages = history.filter(
|
|
@@ -125063,7 +125383,7 @@ ${queuedText}` : queuedText;
|
|
|
125063
125383
|
}, [clearItems, clearConsoleMessagesState, refreshStatic]);
|
|
125064
125384
|
const mainControlsRef = useRef12(null);
|
|
125065
125385
|
const pendingHistoryItemRef = useRef12(null);
|
|
125066
|
-
|
|
125386
|
+
useEffect41(() => {
|
|
125067
125387
|
if (mainControlsRef.current) {
|
|
125068
125388
|
const fullFooterMeasurement = measureElement(mainControlsRef.current);
|
|
125069
125389
|
setFooterHeight(fullFooterMeasurement.height);
|
|
@@ -125077,7 +125397,7 @@ ${queuedText}` : queuedText;
|
|
|
125077
125397
|
() => terminalHeight - footerHeight - staticExtraHeight,
|
|
125078
125398
|
[terminalHeight, footerHeight]
|
|
125079
125399
|
);
|
|
125080
|
-
|
|
125400
|
+
useEffect41(() => {
|
|
125081
125401
|
if (isInitialMount.current) {
|
|
125082
125402
|
isInitialMount.current = false;
|
|
125083
125403
|
return;
|
|
@@ -125090,7 +125410,7 @@ ${queuedText}` : queuedText;
|
|
|
125090
125410
|
clearTimeout(handler);
|
|
125091
125411
|
};
|
|
125092
125412
|
}, [terminalWidth, terminalHeight, refreshStatic]);
|
|
125093
|
-
|
|
125413
|
+
useEffect41(() => {
|
|
125094
125414
|
if (streamingState === "idle" /* Idle */ && staticNeedsRefresh) {
|
|
125095
125415
|
setStaticNeedsRefresh(false);
|
|
125096
125416
|
refreshStatic();
|
|
@@ -125112,7 +125432,7 @@ ${queuedText}` : queuedText;
|
|
|
125112
125432
|
}, [settings.merged.contextFileName]);
|
|
125113
125433
|
const initialPrompt = useMemo9(() => config.getQuestion(), [config]);
|
|
125114
125434
|
const geminiClient = config.getGeminiClient();
|
|
125115
|
-
|
|
125435
|
+
useEffect41(() => {
|
|
125116
125436
|
if (initialPrompt && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !shouldShowWelcomeBack && !isThemeDialogOpen && !isEditorDialogOpen && !isSearchDialogOpen && !showPrivacyNotice && geminiClient?.isInitialized?.()) {
|
|
125117
125437
|
submitQuery(initialPrompt);
|
|
125118
125438
|
initialPromptSubmitted.current = true;
|
|
@@ -125130,7 +125450,7 @@ ${queuedText}` : queuedText;
|
|
|
125130
125450
|
geminiClient
|
|
125131
125451
|
]);
|
|
125132
125452
|
if (quittingMessages) {
|
|
125133
|
-
return /* @__PURE__ */
|
|
125453
|
+
return /* @__PURE__ */ jsx64(Box56, { flexDirection: "column", marginBottom: 1, children: quittingMessages.map((item) => /* @__PURE__ */ jsx64(
|
|
125134
125454
|
HistoryItemDisplay,
|
|
125135
125455
|
{
|
|
125136
125456
|
availableTerminalHeight: constrainHeight ? availableTerminalHeight : void 0,
|
|
@@ -125146,16 +125466,16 @@ ${queuedText}` : queuedText;
|
|
|
125146
125466
|
const debugConsoleMaxHeight = Math.floor(Math.max(terminalHeight * 0.2, 5));
|
|
125147
125467
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
125148
125468
|
const placeholder = vimModeEnabled ? " Press 'i' for INSERT mode and 'Esc' for NORMAL mode." : " Type your message or @path/to/file";
|
|
125149
|
-
return /* @__PURE__ */
|
|
125150
|
-
/* @__PURE__ */
|
|
125469
|
+
return /* @__PURE__ */ jsx64(StreamingContext.Provider, { value: streamingState, children: /* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", width: "90%", children: [
|
|
125470
|
+
/* @__PURE__ */ jsx64(
|
|
125151
125471
|
Static,
|
|
125152
125472
|
{
|
|
125153
125473
|
items: [
|
|
125154
|
-
/* @__PURE__ */
|
|
125155
|
-
!settings.merged.hideBanner && /* @__PURE__ */
|
|
125156
|
-
!settings.merged.hideTips && /* @__PURE__ */
|
|
125474
|
+
/* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", children: [
|
|
125475
|
+
!settings.merged.hideBanner && /* @__PURE__ */ jsx64(Header, { version, nightly }),
|
|
125476
|
+
!settings.merged.hideTips && /* @__PURE__ */ jsx64(Tips, { config })
|
|
125157
125477
|
] }, "header"),
|
|
125158
|
-
...history.map((h) => /* @__PURE__ */
|
|
125478
|
+
...history.map((h) => /* @__PURE__ */ jsx64(
|
|
125159
125479
|
HistoryItemDisplay,
|
|
125160
125480
|
{
|
|
125161
125481
|
terminalWidth: mainAreaWidth,
|
|
@@ -125172,8 +125492,8 @@ ${queuedText}` : queuedText;
|
|
|
125172
125492
|
},
|
|
125173
125493
|
staticKey
|
|
125174
125494
|
),
|
|
125175
|
-
/* @__PURE__ */
|
|
125176
|
-
pendingHistoryItems.map((item, i) => /* @__PURE__ */
|
|
125495
|
+
/* @__PURE__ */ jsx64(OverflowProvider, { children: /* @__PURE__ */ jsxs56(Box56, { ref: pendingHistoryItemRef, flexDirection: "column", children: [
|
|
125496
|
+
pendingHistoryItems.map((item, i) => /* @__PURE__ */ jsx64(
|
|
125177
125497
|
HistoryItemDisplay,
|
|
125178
125498
|
{
|
|
125179
125499
|
availableTerminalHeight: constrainHeight ? availableTerminalHeight : void 0,
|
|
@@ -125185,30 +125505,30 @@ ${queuedText}` : queuedText;
|
|
|
125185
125505
|
},
|
|
125186
125506
|
i
|
|
125187
125507
|
)),
|
|
125188
|
-
/* @__PURE__ */
|
|
125508
|
+
/* @__PURE__ */ jsx64(ShowMoreLines, { constrainHeight })
|
|
125189
125509
|
] }) }),
|
|
125190
|
-
/* @__PURE__ */
|
|
125191
|
-
updateInfo && /* @__PURE__ */
|
|
125192
|
-
startupWarnings.length > 0 && /* @__PURE__ */
|
|
125193
|
-
|
|
125510
|
+
/* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", ref: mainControlsRef, children: [
|
|
125511
|
+
updateInfo && /* @__PURE__ */ jsx64(UpdateNotification, { message: updateInfo.message }),
|
|
125512
|
+
startupWarnings.length > 0 && /* @__PURE__ */ jsx64(
|
|
125513
|
+
Box56,
|
|
125194
125514
|
{
|
|
125195
125515
|
borderStyle: "round",
|
|
125196
125516
|
borderColor: Colors.AccentYellow,
|
|
125197
125517
|
paddingX: 1,
|
|
125198
125518
|
marginY: 1,
|
|
125199
125519
|
flexDirection: "column",
|
|
125200
|
-
children: startupWarnings.map((warning, index) => /* @__PURE__ */
|
|
125520
|
+
children: startupWarnings.map((warning, index) => /* @__PURE__ */ jsx64(Text60, { color: Colors.AccentYellow, children: warning }, index))
|
|
125201
125521
|
}
|
|
125202
125522
|
),
|
|
125203
|
-
shouldShowIdePrompt && currentIDE ? /* @__PURE__ */
|
|
125523
|
+
shouldShowIdePrompt && currentIDE ? /* @__PURE__ */ jsx64(
|
|
125204
125524
|
IdeIntegrationNudge,
|
|
125205
125525
|
{
|
|
125206
125526
|
ide: currentIDE,
|
|
125207
125527
|
onComplete: handleIdePromptComplete
|
|
125208
125528
|
}
|
|
125209
|
-
) : isFolderTrustDialogOpen ? /* @__PURE__ */
|
|
125529
|
+
) : isFolderTrustDialogOpen ? /* @__PURE__ */ jsx64(FolderTrustDialog, { onSelect: handleFolderTrustSelect }) : shellConfirmationRequest ? /* @__PURE__ */ jsx64(ShellConfirmationDialog, { request: shellConfirmationRequest }) : confirmationRequest ? /* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", children: [
|
|
125210
125530
|
confirmationRequest.prompt,
|
|
125211
|
-
/* @__PURE__ */
|
|
125531
|
+
/* @__PURE__ */ jsx64(Box56, { paddingY: 1, children: /* @__PURE__ */ jsx64(
|
|
125212
125532
|
RadioButtonSelect,
|
|
125213
125533
|
{
|
|
125214
125534
|
isFocused: !!confirmationRequest,
|
|
@@ -125221,9 +125541,9 @@ ${queuedText}` : queuedText;
|
|
|
125221
125541
|
}
|
|
125222
125542
|
}
|
|
125223
125543
|
) })
|
|
125224
|
-
] }) : isThemeDialogOpen ? /* @__PURE__ */
|
|
125225
|
-
themeError && /* @__PURE__ */
|
|
125226
|
-
/* @__PURE__ */
|
|
125544
|
+
] }) : isThemeDialogOpen ? /* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", children: [
|
|
125545
|
+
themeError && /* @__PURE__ */ jsx64(Box56, { marginBottom: 1, children: /* @__PURE__ */ jsx64(Text60, { color: Colors.AccentRed, children: themeError }) }),
|
|
125546
|
+
/* @__PURE__ */ jsx64(
|
|
125227
125547
|
ThemeDialog,
|
|
125228
125548
|
{
|
|
125229
125549
|
onSelect: handleThemeSelect,
|
|
@@ -125233,15 +125553,15 @@ ${queuedText}` : queuedText;
|
|
|
125233
125553
|
terminalWidth: mainAreaWidth
|
|
125234
125554
|
}
|
|
125235
125555
|
)
|
|
125236
|
-
] }) : isSettingsDialogOpen ? /* @__PURE__ */
|
|
125556
|
+
] }) : isSettingsDialogOpen ? /* @__PURE__ */ jsx64(Box56, { flexDirection: "column", children: /* @__PURE__ */ jsx64(
|
|
125237
125557
|
SettingsDialog,
|
|
125238
125558
|
{
|
|
125239
125559
|
settings,
|
|
125240
125560
|
onSelect: () => closeSettingsDialog(),
|
|
125241
125561
|
onRestartRequest: () => process18.exit(0)
|
|
125242
125562
|
}
|
|
125243
|
-
) }) : isAuthenticating ? /* @__PURE__ */
|
|
125244
|
-
/* @__PURE__ */
|
|
125563
|
+
) }) : isAuthenticating ? /* @__PURE__ */ jsxs56(Fragment7, { children: [
|
|
125564
|
+
/* @__PURE__ */ jsx64(
|
|
125245
125565
|
AuthInProgress,
|
|
125246
125566
|
{
|
|
125247
125567
|
onTimeout: () => {
|
|
@@ -125251,8 +125571,8 @@ ${queuedText}` : queuedText;
|
|
|
125251
125571
|
}
|
|
125252
125572
|
}
|
|
125253
125573
|
),
|
|
125254
|
-
showErrorDetails && /* @__PURE__ */
|
|
125255
|
-
/* @__PURE__ */
|
|
125574
|
+
showErrorDetails && /* @__PURE__ */ jsx64(OverflowProvider, { children: /* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", children: [
|
|
125575
|
+
/* @__PURE__ */ jsx64(
|
|
125256
125576
|
DetailedMessagesDisplay,
|
|
125257
125577
|
{
|
|
125258
125578
|
messages: filteredConsoleMessages,
|
|
@@ -125260,16 +125580,16 @@ ${queuedText}` : queuedText;
|
|
|
125260
125580
|
width: inputWidth
|
|
125261
125581
|
}
|
|
125262
125582
|
),
|
|
125263
|
-
/* @__PURE__ */
|
|
125583
|
+
/* @__PURE__ */ jsx64(ShowMoreLines, { constrainHeight })
|
|
125264
125584
|
] }) })
|
|
125265
|
-
] }) : isAuthDialogOpen ? /* @__PURE__ */
|
|
125585
|
+
] }) : isAuthDialogOpen ? /* @__PURE__ */ jsx64(Box56, { flexDirection: "column", children: /* @__PURE__ */ jsx64(
|
|
125266
125586
|
AuthDialog,
|
|
125267
125587
|
{
|
|
125268
125588
|
onSelect: handleAuthSelect,
|
|
125269
125589
|
settings,
|
|
125270
125590
|
initialErrorMessage: authError
|
|
125271
125591
|
}
|
|
125272
|
-
) }) : shouldShowWelcomeBack && projectSummary ? /* @__PURE__ */
|
|
125592
|
+
) }) : shouldShowWelcomeBack && projectSummary ? /* @__PURE__ */ jsx64(Box56, { flexDirection: "column", children: /* @__PURE__ */ jsx64(
|
|
125273
125593
|
WelcomeBackDialog,
|
|
125274
125594
|
{
|
|
125275
125595
|
projectSummary,
|
|
@@ -125277,9 +125597,9 @@ ${queuedText}` : queuedText;
|
|
|
125277
125597
|
onRestart: handleWelcomeBackRestart,
|
|
125278
125598
|
onCancel: handleWelcomeBackCancel
|
|
125279
125599
|
}
|
|
125280
|
-
) }) : isEditorDialogOpen ? /* @__PURE__ */
|
|
125281
|
-
editorError && /* @__PURE__ */
|
|
125282
|
-
/* @__PURE__ */
|
|
125600
|
+
) }) : isEditorDialogOpen ? /* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", children: [
|
|
125601
|
+
editorError && /* @__PURE__ */ jsx64(Box56, { marginBottom: 1, children: /* @__PURE__ */ jsx64(Text60, { color: Colors.AccentRed, children: editorError }) }),
|
|
125602
|
+
/* @__PURE__ */ jsx64(
|
|
125283
125603
|
EditorSettingsDialog,
|
|
125284
125604
|
{
|
|
125285
125605
|
onSelect: handleEditorSelect,
|
|
@@ -125287,7 +125607,7 @@ ${queuedText}` : queuedText;
|
|
|
125287
125607
|
onExit: exitEditorDialog
|
|
125288
125608
|
}
|
|
125289
125609
|
)
|
|
125290
|
-
] }) : isSearchDialogOpen ? /* @__PURE__ */
|
|
125610
|
+
] }) : isSearchDialogOpen ? /* @__PURE__ */ jsx64(Box56, { flexDirection: "column", children: /* @__PURE__ */ jsx64(
|
|
125291
125611
|
SearchEngineConfigDialog,
|
|
125292
125612
|
{
|
|
125293
125613
|
onSubmit: (result) => {
|
|
@@ -125304,14 +125624,14 @@ ${queuedText}` : queuedText;
|
|
|
125304
125624
|
setIsSearchDialogOpen(false);
|
|
125305
125625
|
}
|
|
125306
125626
|
}
|
|
125307
|
-
) }) : showPrivacyNotice ? /* @__PURE__ */
|
|
125627
|
+
) }) : showPrivacyNotice ? /* @__PURE__ */ jsx64(
|
|
125308
125628
|
PrivacyNotice,
|
|
125309
125629
|
{
|
|
125310
125630
|
onExit: () => setShowPrivacyNotice(false),
|
|
125311
125631
|
config
|
|
125312
125632
|
}
|
|
125313
|
-
) : /* @__PURE__ */
|
|
125314
|
-
/* @__PURE__ */
|
|
125633
|
+
) : /* @__PURE__ */ jsxs56(Fragment7, { children: [
|
|
125634
|
+
/* @__PURE__ */ jsx64(
|
|
125315
125635
|
LoadingIndicator,
|
|
125316
125636
|
{
|
|
125317
125637
|
thought: streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ || config.getAccessibility()?.disableLoadingPhrases ? void 0 : thought,
|
|
@@ -125319,23 +125639,23 @@ ${queuedText}` : queuedText;
|
|
|
125319
125639
|
elapsedTime
|
|
125320
125640
|
}
|
|
125321
125641
|
),
|
|
125322
|
-
messageQueue.length > 0 && /* @__PURE__ */
|
|
125642
|
+
messageQueue.length > 0 && /* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", marginTop: 1, children: [
|
|
125323
125643
|
messageQueue.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message, index) => {
|
|
125324
125644
|
const preview = message.replace(/\s+/g, " ");
|
|
125325
125645
|
return (
|
|
125326
125646
|
// Ensure the Box takes full width so truncation calculates correctly
|
|
125327
|
-
/* @__PURE__ */
|
|
125647
|
+
/* @__PURE__ */ jsx64(Box56, { paddingLeft: 2, width: "100%", children: /* @__PURE__ */ jsx64(Text60, { dimColor: true, wrap: "truncate", children: preview }) }, index)
|
|
125328
125648
|
);
|
|
125329
125649
|
}),
|
|
125330
|
-
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */
|
|
125650
|
+
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ jsx64(Box56, { paddingLeft: 2, children: /* @__PURE__ */ jsxs56(Text60, { dimColor: true, children: [
|
|
125331
125651
|
"... (+",
|
|
125332
125652
|
messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES,
|
|
125333
125653
|
" ",
|
|
125334
125654
|
"more)"
|
|
125335
125655
|
] }) })
|
|
125336
125656
|
] }),
|
|
125337
|
-
/* @__PURE__ */
|
|
125338
|
-
|
|
125657
|
+
/* @__PURE__ */ jsxs56(
|
|
125658
|
+
Box56,
|
|
125339
125659
|
{
|
|
125340
125660
|
marginTop: 1,
|
|
125341
125661
|
justifyContent: "space-between",
|
|
@@ -125343,9 +125663,9 @@ ${queuedText}` : queuedText;
|
|
|
125343
125663
|
flexDirection: isNarrow ? "column" : "row",
|
|
125344
125664
|
alignItems: isNarrow ? "flex-start" : "center",
|
|
125345
125665
|
children: [
|
|
125346
|
-
/* @__PURE__ */
|
|
125347
|
-
process18.env["GEMINI_SYSTEM_MD"] && /* @__PURE__ */
|
|
125348
|
-
ctrlCPressedOnce ? /* @__PURE__ */
|
|
125666
|
+
/* @__PURE__ */ jsxs56(Box56, { children: [
|
|
125667
|
+
process18.env["GEMINI_SYSTEM_MD"] && /* @__PURE__ */ jsx64(Text60, { color: Colors.AccentRed, children: "|\u2310\u25A0_\u25A0| " }),
|
|
125668
|
+
ctrlCPressedOnce ? /* @__PURE__ */ jsx64(Text60, { color: Colors.AccentYellow, children: "Press Ctrl+C again to exit." }) : ctrlDPressedOnce ? /* @__PURE__ */ jsx64(Text60, { color: Colors.AccentYellow, children: "Press Ctrl+D again to exit." }) : showEscapePrompt ? /* @__PURE__ */ jsx64(Text60, { color: Colors.Gray, children: "Press Esc again to clear." }) : /* @__PURE__ */ jsx64(
|
|
125349
125669
|
ContextSummaryDisplay,
|
|
125350
125670
|
{
|
|
125351
125671
|
ideContext: ideContextState,
|
|
@@ -125357,20 +125677,20 @@ ${queuedText}` : queuedText;
|
|
|
125357
125677
|
}
|
|
125358
125678
|
)
|
|
125359
125679
|
] }),
|
|
125360
|
-
/* @__PURE__ */
|
|
125361
|
-
showAutoAcceptIndicator !== ApprovalMode.DEFAULT && !shellModeActive && /* @__PURE__ */
|
|
125680
|
+
/* @__PURE__ */ jsxs56(Box56, { paddingTop: isNarrow ? 1 : 0, children: [
|
|
125681
|
+
showAutoAcceptIndicator !== ApprovalMode.DEFAULT && !shellModeActive && /* @__PURE__ */ jsx64(
|
|
125362
125682
|
AutoAcceptIndicator,
|
|
125363
125683
|
{
|
|
125364
125684
|
approvalMode: showAutoAcceptIndicator
|
|
125365
125685
|
}
|
|
125366
125686
|
),
|
|
125367
|
-
shellModeActive && /* @__PURE__ */
|
|
125687
|
+
shellModeActive && /* @__PURE__ */ jsx64(ShellModeIndicator, {})
|
|
125368
125688
|
] })
|
|
125369
125689
|
]
|
|
125370
125690
|
}
|
|
125371
125691
|
),
|
|
125372
|
-
showErrorDetails && /* @__PURE__ */
|
|
125373
|
-
/* @__PURE__ */
|
|
125692
|
+
showErrorDetails && /* @__PURE__ */ jsx64(OverflowProvider, { children: /* @__PURE__ */ jsxs56(Box56, { flexDirection: "column", children: [
|
|
125693
|
+
/* @__PURE__ */ jsx64(
|
|
125374
125694
|
DetailedMessagesDisplay,
|
|
125375
125695
|
{
|
|
125376
125696
|
messages: filteredConsoleMessages,
|
|
@@ -125378,9 +125698,9 @@ ${queuedText}` : queuedText;
|
|
|
125378
125698
|
width: inputWidth
|
|
125379
125699
|
}
|
|
125380
125700
|
),
|
|
125381
|
-
/* @__PURE__ */
|
|
125701
|
+
/* @__PURE__ */ jsx64(ShowMoreLines, { constrainHeight })
|
|
125382
125702
|
] }) }),
|
|
125383
|
-
isInputActive && /* @__PURE__ */
|
|
125703
|
+
isInputActive && /* @__PURE__ */ jsx64(
|
|
125384
125704
|
InputPrompt,
|
|
125385
125705
|
{
|
|
125386
125706
|
buffer,
|
|
@@ -125401,8 +125721,8 @@ ${queuedText}` : queuedText;
|
|
|
125401
125721
|
}
|
|
125402
125722
|
)
|
|
125403
125723
|
] }),
|
|
125404
|
-
initError && streamingState !== "responding" /* Responding */ && /* @__PURE__ */
|
|
125405
|
-
|
|
125724
|
+
initError && streamingState !== "responding" /* Responding */ && /* @__PURE__ */ jsx64(
|
|
125725
|
+
Box56,
|
|
125406
125726
|
{
|
|
125407
125727
|
borderStyle: "round",
|
|
125408
125728
|
borderColor: Colors.AccentRed,
|
|
@@ -125410,21 +125730,21 @@ ${queuedText}` : queuedText;
|
|
|
125410
125730
|
marginBottom: 1,
|
|
125411
125731
|
children: history.find(
|
|
125412
125732
|
(item) => item.type === "error" && item.text?.includes(initError)
|
|
125413
|
-
)?.text ? /* @__PURE__ */
|
|
125733
|
+
)?.text ? /* @__PURE__ */ jsx64(Text60, { color: Colors.AccentRed, children: history.find(
|
|
125414
125734
|
(item) => item.type === "error" && item.text?.includes(initError)
|
|
125415
|
-
)?.text }) : /* @__PURE__ */
|
|
125416
|
-
/* @__PURE__ */
|
|
125735
|
+
)?.text }) : /* @__PURE__ */ jsxs56(Fragment7, { children: [
|
|
125736
|
+
/* @__PURE__ */ jsxs56(Text60, { color: Colors.AccentRed, children: [
|
|
125417
125737
|
"Initialization Error: ",
|
|
125418
125738
|
initError
|
|
125419
125739
|
] }),
|
|
125420
|
-
/* @__PURE__ */
|
|
125740
|
+
/* @__PURE__ */ jsxs56(Text60, { color: Colors.AccentRed, children: [
|
|
125421
125741
|
" ",
|
|
125422
125742
|
"Please check API key and configuration."
|
|
125423
125743
|
] })
|
|
125424
125744
|
] })
|
|
125425
125745
|
}
|
|
125426
125746
|
),
|
|
125427
|
-
!settings.merged.hideFooter && /* @__PURE__ */
|
|
125747
|
+
!settings.merged.hideFooter && /* @__PURE__ */ jsx64(
|
|
125428
125748
|
Footer,
|
|
125429
125749
|
{
|
|
125430
125750
|
model: currentModel,
|
|
@@ -127785,7 +128105,7 @@ function toPermissionOptions(confirmation) {
|
|
|
127785
128105
|
}
|
|
127786
128106
|
|
|
127787
128107
|
// packages/cli/src/gemini.tsx
|
|
127788
|
-
import { jsx as
|
|
128108
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
127789
128109
|
var DEBUG_CLI = process.env["FSS_DEBUG"] === "true" || process.env["NODE_ENV"] === "development";
|
|
127790
128110
|
function validateDnsResolutionOrder(order) {
|
|
127791
128111
|
const defaultValue = "ipv4first";
|
|
@@ -127986,7 +128306,7 @@ async function main() {
|
|
|
127986
128306
|
await detectAndEnableKittyProtocol();
|
|
127987
128307
|
setWindowTitle(basename15(workspaceRoot), settings);
|
|
127988
128308
|
const instance = render2(
|
|
127989
|
-
/* @__PURE__ */
|
|
128309
|
+
/* @__PURE__ */ jsx65(React28.StrictMode, { children: /* @__PURE__ */ jsx65(SettingsContext.Provider, { value: settings, children: /* @__PURE__ */ jsx65(
|
|
127990
128310
|
AppWrapper,
|
|
127991
128311
|
{
|
|
127992
128312
|
config,
|