@google/gemini-cli 0.1.9-nightly.250708.a4097ae6 → 0.1.9-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -17
- package/dist/google-gemini-cli-0.1.9-rc.0.tgz +0 -0
- package/dist/index.js +0 -0
- package/dist/package.json +10 -9
- package/dist/src/config/auth.js +2 -3
- package/dist/src/config/auth.js.map +1 -1
- package/dist/src/config/config.d.ts +1 -0
- package/dist/src/config/config.js +39 -23
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +0 -1
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/settings.d.ts +0 -2
- package/dist/src/config/settings.js +1 -63
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.js +18 -17
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/ui/App.js +7 -11
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/App.test.js +0 -1
- package/dist/src/ui/App.test.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.js +2 -21
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/AuthDialog.test.js +3 -20
- package/dist/src/ui/components/AuthDialog.test.js.map +1 -1
- package/dist/src/ui/components/Help.d.ts +1 -1
- package/dist/src/ui/components/Help.js +2 -3
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +1 -2
- package/dist/src/ui/components/InputPrompt.js +157 -106
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.test.js +0 -180
- package/dist/src/ui/components/InputPrompt.test.js.map +1 -1
- package/dist/src/ui/components/messages/CompressionMessage.js +1 -1
- package/dist/src/ui/components/messages/ToolMessage.test.js +2 -2
- package/dist/src/ui/components/messages/ToolMessage.test.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.test.js +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +16 -72
- package/dist/src/ui/components/shared/text-buffer.js +676 -564
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/contexts/SessionContext.d.ts +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +7 -5
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +10 -6
- package/dist/src/ui/hooks/slashCommandProcessor.js +128 -213
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +2 -2
- package/dist/src/ui/hooks/useCompletion.js +56 -106
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.d.ts +2 -2
- package/dist/src/ui/hooks/useGeminiStream.js +18 -12
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.test.js +44 -107
- package/dist/src/ui/hooks/useGeminiStream.test.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +1 -1
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/types.d.ts +0 -10
- package/dist/src/ui/utils/MarkdownDisplay.js +80 -1
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -35
- package/dist/src/ui/utils/MarkdownDisplay.test.js.map +1 -1
- package/dist/src/ui/utils/TableRenderer.js +32 -50
- package/dist/src/ui/utils/TableRenderer.js.map +1 -1
- package/dist/src/utils/sandbox-macos-permissive-proxied.sb +1 -1
- package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -9
- package/dist/google-gemini-cli-0.1.9.tgz +0 -0
- package/dist/src/services/CommandService.d.ts +0 -13
- package/dist/src/services/CommandService.js +0 -30
- package/dist/src/services/CommandService.js.map +0 -1
- package/dist/src/test-utils/mockCommandContext.d.ts +0 -18
- package/dist/src/test-utils/mockCommandContext.js +0 -75
- package/dist/src/test-utils/mockCommandContext.js.map +0 -1
- package/dist/src/ui/commands/clearCommand.d.ts +0 -7
- package/dist/src/ui/commands/clearCommand.js +0 -15
- package/dist/src/ui/commands/clearCommand.js.map +0 -1
- package/dist/src/ui/commands/helpCommand.d.ts +0 -7
- package/dist/src/ui/commands/helpCommand.js +0 -18
- package/dist/src/ui/commands/helpCommand.js.map +0 -1
- package/dist/src/ui/commands/memoryCommand.d.ts +0 -7
- package/dist/src/ui/commands/memoryCommand.js +0 -81
- package/dist/src/ui/commands/memoryCommand.js.map +0 -1
- package/dist/src/ui/commands/types.d.ts +0 -63
- package/dist/src/ui/commands/types.js +0 -7
- package/dist/src/ui/commands/types.js.map +0 -1
- package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +0 -16
- package/dist/src/ui/utils/InlineMarkdownRenderer.js +0 -104
- package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +0 -1
- package/dist/src/utils/userStartupWarnings.d.ts +0 -6
- package/dist/src/utils/userStartupWarnings.js +0 -33
- package/dist/src/utils/userStartupWarnings.js.map +0 -1
|
@@ -7,78 +7,60 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { Text, Box } from 'ink';
|
|
9
9
|
import { Colors } from '../colors.js';
|
|
10
|
-
import { RenderInline, getPlainTextLength } from './InlineMarkdownRenderer.js';
|
|
11
10
|
/**
|
|
12
11
|
* Custom table renderer for markdown tables
|
|
13
12
|
* We implement our own instead of using ink-table due to module compatibility issues
|
|
14
13
|
*/
|
|
15
14
|
export const TableRenderer = ({ headers, rows, terminalWidth, }) => {
|
|
16
|
-
// Calculate column widths
|
|
15
|
+
// Calculate column widths
|
|
17
16
|
const columnWidths = headers.map((header, index) => {
|
|
18
|
-
const headerWidth =
|
|
19
|
-
const maxRowWidth = Math.max(...rows.map((row) =>
|
|
17
|
+
const headerWidth = header.length;
|
|
18
|
+
const maxRowWidth = Math.max(...rows.map((row) => (row[index] || '').length));
|
|
20
19
|
return Math.max(headerWidth, maxRowWidth) + 2; // Add padding
|
|
21
20
|
});
|
|
22
21
|
// Ensure table fits within terminal width
|
|
23
22
|
const totalWidth = columnWidths.reduce((sum, width) => sum + width + 1, 1);
|
|
24
23
|
const scaleFactor = totalWidth > terminalWidth ? terminalWidth / totalWidth : 1;
|
|
25
24
|
const adjustedWidths = columnWidths.map((width) => Math.floor(width * scaleFactor));
|
|
26
|
-
// Helper function to render a cell with proper width
|
|
27
25
|
const renderCell = (content, width, isHeader = false) => {
|
|
26
|
+
// The actual space for content inside the padding
|
|
28
27
|
const contentWidth = Math.max(0, width - 2);
|
|
29
|
-
const displayWidth = getPlainTextLength(content);
|
|
30
28
|
let cellContent = content;
|
|
31
|
-
if (
|
|
29
|
+
if (content.length > contentWidth) {
|
|
32
30
|
if (contentWidth <= 3) {
|
|
33
|
-
//
|
|
34
|
-
cellContent = content.substring(0,
|
|
31
|
+
// Not enough space for '...'
|
|
32
|
+
cellContent = content.substring(0, contentWidth);
|
|
35
33
|
}
|
|
36
34
|
else {
|
|
37
|
-
|
|
38
|
-
let left = 0;
|
|
39
|
-
let right = content.length;
|
|
40
|
-
let bestTruncated = content;
|
|
41
|
-
// Binary search to find the optimal truncation point
|
|
42
|
-
while (left <= right) {
|
|
43
|
-
const mid = Math.floor((left + right) / 2);
|
|
44
|
-
const candidate = content.substring(0, mid);
|
|
45
|
-
const candidateWidth = getPlainTextLength(candidate);
|
|
46
|
-
if (candidateWidth <= contentWidth - 3) {
|
|
47
|
-
bestTruncated = candidate;
|
|
48
|
-
left = mid + 1;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
right = mid - 1;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
cellContent = bestTruncated + '...';
|
|
35
|
+
cellContent = content.substring(0, contentWidth - 3) + '...';
|
|
55
36
|
}
|
|
56
37
|
}
|
|
57
|
-
//
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
// Pad the content to fill the cell
|
|
39
|
+
const padded = cellContent.padEnd(contentWidth, ' ');
|
|
40
|
+
if (isHeader) {
|
|
41
|
+
return (_jsx(Text, { bold: true, color: Colors.AccentCyan, children: padded }));
|
|
42
|
+
}
|
|
43
|
+
return _jsx(Text, { children: padded });
|
|
44
|
+
};
|
|
45
|
+
const renderRow = (cells, isHeader = false) => (_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { children: "\u2502 " }), cells.map((cell, index) => (_jsxs(React.Fragment, { children: [renderCell(cell, adjustedWidths[index] || 0, isHeader), _jsx(Text, { children: " \u2502 " })] }, index)))] }));
|
|
46
|
+
const renderSeparator = () => {
|
|
47
|
+
const separator = adjustedWidths
|
|
48
|
+
.map((width) => '─'.repeat(Math.max(0, (width || 0) - 2)))
|
|
49
|
+
.join('─┼─');
|
|
50
|
+
return _jsxs(Text, { children: ["\u251C\u2500", separator, "\u2500\u2524"] });
|
|
61
51
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
bottom: { left: '└', middle: '┴', right: '┘', horizontal: '─' },
|
|
68
|
-
};
|
|
69
|
-
const char = chars[type];
|
|
70
|
-
const borderParts = adjustedWidths.map((w) => char.horizontal.repeat(w));
|
|
71
|
-
const border = char.left + borderParts.join(char.middle) + char.right;
|
|
72
|
-
return _jsx(Text, { children: border });
|
|
52
|
+
const renderTopBorder = () => {
|
|
53
|
+
const border = adjustedWidths
|
|
54
|
+
.map((width) => '─'.repeat(Math.max(0, (width || 0) - 2)))
|
|
55
|
+
.join('─┬─');
|
|
56
|
+
return _jsxs(Text, { children: ["\u250C\u2500", border, "\u2500\u2510"] });
|
|
73
57
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
80
|
-
return (_jsxs(Text, { children: ["\u2502", ' ', renderedCells.map((cell, index) => (_jsxs(React.Fragment, { children: [cell, index < renderedCells.length - 1 ? ' │ ' : ''] }, index))), ' ', "\u2502"] }));
|
|
58
|
+
const renderBottomBorder = () => {
|
|
59
|
+
const border = adjustedWidths
|
|
60
|
+
.map((width) => '─'.repeat(Math.max(0, (width || 0) - 2)))
|
|
61
|
+
.join('─┴─');
|
|
62
|
+
return _jsxs(Text, { children: ["\u2514\u2500", border, "\u2500\u2518"] });
|
|
81
63
|
};
|
|
82
|
-
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [
|
|
64
|
+
return (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [renderTopBorder(), renderRow(headers, true), renderSeparator(), rows.map((row, index) => (_jsx(React.Fragment, { children: renderRow(row) }, index))), renderBottomBorder()] }));
|
|
83
65
|
};
|
|
84
66
|
//# sourceMappingURL=TableRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRenderer.js","sourceRoot":"","sources":["../../../../src/ui/utils/TableRenderer.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TableRenderer.js","sourceRoot":"","sources":["../../../../src/ui/utils/TableRenderer.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAQt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outbound network traffic EXCEPT through proxy on localhost:8877
|
|
26
26
|
;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
|
|
27
|
-
;; proxy must listen on :::8877 (see
|
|
27
|
+
;; proxy must listen on :::8877 (see scripts/example-proxy.js)
|
|
28
28
|
(deny network-outbound)
|
|
29
29
|
(allow network-outbound (remote tcp "localhost:8877"))
|
|
30
30
|
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
|
|
89
89
|
;; allow outbound network traffic through proxy on localhost:8877
|
|
90
90
|
;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
|
|
91
|
-
;; proxy must listen on :::8877 (see
|
|
91
|
+
;; proxy must listen on :::8877 (see scripts/example-proxy.js)
|
|
92
92
|
(allow network-outbound (remote tcp "localhost:8877"))
|