summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/nonInteractiveCli.test.ts12
-rw-r--r--packages/cli/src/ui/App.tsx2
-rw-r--r--packages/cli/src/ui/components/Footer.tsx2
-rw-r--r--packages/cli/src/ui/components/InputPrompt.tsx2
-rw-r--r--packages/cli/src/ui/components/ThemeDialog.tsx22
-rw-r--r--packages/cli/src/ui/hooks/shellCommandProcessor.ts2
-rw-r--r--packages/cli/src/ui/hooks/useHistoryManager.test.ts4
-rw-r--r--packages/cli/src/ui/hooks/useShellHistory.test.ts2
-rw-r--r--packages/cli/src/ui/hooks/useToolScheduler.test.ts4
-rw-r--r--packages/cli/src/ui/themes/shades-of-purple.ts2
-rw-r--r--packages/cli/src/ui/themes/theme-manager.test.ts2
-rw-r--r--packages/cli/src/ui/themes/theme-manager.ts2
-rw-r--r--packages/cli/src/ui/themes/theme.ts2
-rw-r--r--packages/cli/src/ui/utils/CodeColorizer.tsx6
-rw-r--r--packages/cli/src/ui/utils/commandUtils.test.ts2
-rw-r--r--packages/cli/src/ui/utils/markdownUtilities.ts2
-rw-r--r--packages/cli/src/utils/sandbox.ts6
17 files changed, 38 insertions, 38 deletions
diff --git a/packages/cli/src/nonInteractiveCli.test.ts b/packages/cli/src/nonInteractiveCli.test.ts
index 6cbb630d..8b0419f1 100644
--- a/packages/cli/src/nonInteractiveCli.test.ts
+++ b/packages/cli/src/nonInteractiveCli.test.ts
@@ -229,14 +229,14 @@ describe('runNonInteractive', () => {
it('should not exit if a tool is not found, and should send error back to model', async () => {
const functionCall: FunctionCall = {
id: 'fcNotFound',
- name: 'nonExistentTool',
+ name: 'nonexistentTool',
args: {},
};
const errorResponsePart: Part = {
functionResponse: {
- name: 'nonExistentTool',
+ name: 'nonexistentTool',
id: 'fcNotFound',
- response: { error: 'Tool "nonExistentTool" not found in registry.' },
+ response: { error: 'Tool "nonexistentTool" not found in registry.' },
},
};
@@ -246,8 +246,8 @@ describe('runNonInteractive', () => {
vi.mocked(mockCoreExecuteToolCall).mockResolvedValue({
callId: 'fcNotFound',
responseParts: [errorResponsePart],
- resultDisplay: 'Tool "nonExistentTool" not found in registry.',
- error: new Error('Tool "nonExistentTool" not found in registry.'),
+ resultDisplay: 'Tool "nonexistentTool" not found in registry.',
+ error: new Error('Tool "nonexistentTool" not found in registry.'),
});
const stream1 = (async function* () {
@@ -278,7 +278,7 @@ describe('runNonInteractive', () => {
);
expect(consoleErrorSpy).toHaveBeenCalledWith(
- 'Error executing tool nonExistentTool: Tool "nonExistentTool" not found in registry.',
+ 'Error executing tool nonexistentTool: Tool "nonexistentTool" not found in registry.',
);
expect(mockProcessExit).not.toHaveBeenCalled();
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx
index 12838710..baf21395 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -298,7 +298,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
config.getContentGeneratorConfig().authType ===
AuthType.LOGIN_WITH_GOOGLE
) {
- // Use actual user tier if available, otherwise default to FREE tier behavior (safe default)
+ // Use actual user tier if available; otherwise, default to FREE tier behavior (safe default)
const isPaidTier =
userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD;
diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx
index 95904cd9..3b54a989 100644
--- a/packages/cli/src/ui/components/Footer.tsx
+++ b/packages/cli/src/ui/components/Footer.tsx
@@ -79,7 +79,7 @@ export const Footer: React.FC<FooterProps> = ({
</Text>
) : process.env.SANDBOX === 'sandbox-exec' ? (
<Text color={Colors.AccentYellow}>
- MacOS Seatbelt{' '}
+ macOS Seatbelt{' '}
<Text color={Colors.Gray}>({process.env.SEATBELT_PROFILE})</Text>
</Text>
) : (
diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx
index a713c889..6192fb8c 100644
--- a/packages/cli/src/ui/components/InputPrompt.tsx
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -448,7 +448,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
return;
}
- // Fallback to the text buffer's default input handling for all other keys
+ // Fall back to the text buffer's default input handling for all other keys
buffer.handleInput(key);
},
[
diff --git a/packages/cli/src/ui/components/ThemeDialog.tsx b/packages/cli/src/ui/components/ThemeDialog.tsx
index 41c39b63..a6a16b8c 100644
--- a/packages/cli/src/ui/components/ThemeDialog.tsx
+++ b/packages/cli/src/ui/components/ThemeDialog.tsx
@@ -73,7 +73,7 @@ export function ThemeDialog({
const initialThemeIndex = themeItems.findIndex(
(item) => item.value === selectedThemeName,
);
- // If not found, fallback to the first theme
+ // If not found, fall back to the first theme
const safeInitialThemeIndex = initialThemeIndex >= 0 ? initialThemeIndex : 0;
const scopeItems = [
@@ -185,7 +185,7 @@ export function ThemeDialog({
}
// Don't focus the scope selection if it is hidden due to height constraints.
- const currenFocusedSection = !showScopeSelection ? 'theme' : focusedSection;
+ const currentFocusedSection = !showScopeSelection ? 'theme' : focusedSection;
// Vertical space taken by elements other than the two code blocks in the preview pane.
// Includes "Preview" title, borders, and margin between blocks.
@@ -224,8 +224,8 @@ export function ThemeDialog({
<Box flexDirection="row">
{/* Left Column: Selection */}
<Box flexDirection="column" width="45%" paddingRight={2}>
- <Text bold={currenFocusedSection === 'theme'} wrap="truncate">
- {currenFocusedSection === 'theme' ? '> ' : ' '}Select Theme{' '}
+ <Text bold={currentFocusedSection === 'theme'} wrap="truncate">
+ {currentFocusedSection === 'theme' ? '> ' : ' '}Select Theme{' '}
<Text color={Colors.Gray}>{otherScopeModifiedMessage}</Text>
</Text>
<RadioButtonSelect
@@ -234,25 +234,25 @@ export function ThemeDialog({
initialIndex={safeInitialThemeIndex}
onSelect={handleThemeSelect}
onHighlight={handleThemeHighlight}
- isFocused={currenFocusedSection === 'theme'}
+ isFocused={currentFocusedSection === 'theme'}
maxItemsToShow={8}
showScrollArrows={true}
- showNumbers={currenFocusedSection === 'theme'}
+ showNumbers={currentFocusedSection === 'theme'}
/>
{/* Scope Selection */}
{showScopeSelection && (
<Box marginTop={1} flexDirection="column">
- <Text bold={currenFocusedSection === 'scope'} wrap="truncate">
- {currenFocusedSection === 'scope' ? '> ' : ' '}Apply To
+ <Text bold={currentFocusedSection === 'scope'} wrap="truncate">
+ {currentFocusedSection === 'scope' ? '> ' : ' '}Apply To
</Text>
<RadioButtonSelect
items={scopeItems}
initialIndex={0} // Default to User Settings
onSelect={handleScopeSelect}
onHighlight={handleScopeHighlight}
- isFocused={currenFocusedSection === 'scope'}
- showNumbers={currenFocusedSection === 'scope'}
+ isFocused={currentFocusedSection === 'scope'}
+ showNumbers={currentFocusedSection === 'scope'}
/>
</Box>
)}
@@ -261,7 +261,7 @@ export function ThemeDialog({
{/* Right Column: Preview */}
<Box flexDirection="column" width="55%" paddingLeft={2}>
<Text bold>Preview</Text>
- {/* Get the Theme object for the highlighted theme, fallback to default if not found */}
+ {/* Get the Theme object for the highlighted theme, fall back to default if not found */}
{(() => {
const previewTheme =
themeManager.getTheme(
diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.ts
index 6f7aff2d..e04c9f54 100644
--- a/packages/cli/src/ui/hooks/shellCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/shellCommandProcessor.ts
@@ -146,7 +146,7 @@ function executeShellCommand(
process.kill(-child.pid, 'SIGKILL');
}
} catch (_e) {
- // Fallback to killing just the main process if group kill fails.
+ // Fall back to killing just the main process if group kill fails.
if (!exited) child.kill('SIGKILL');
}
}
diff --git a/packages/cli/src/ui/hooks/useHistoryManager.test.ts b/packages/cli/src/ui/hooks/useHistoryManager.test.ts
index c7f925e2..b3245eb0 100644
--- a/packages/cli/src/ui/hooks/useHistoryManager.test.ts
+++ b/packages/cli/src/ui/hooks/useHistoryManager.test.ts
@@ -92,7 +92,7 @@ describe('useHistoryManager', () => {
});
});
- it('should not change history if updateHistoryItem is called with a non-existent ID', () => {
+ it('should not change history if updateHistoryItem is called with a nonexistent ID', () => {
const { result } = renderHook(() => useHistory());
const timestamp = Date.now();
const itemData: Omit<HistoryItem, 'id'> = {
@@ -107,7 +107,7 @@ describe('useHistoryManager', () => {
const originalHistory = [...result.current.history]; // Clone before update attempt
act(() => {
- result.current.updateItem(99999, { text: 'Should not apply' }); // Non-existent ID
+ result.current.updateItem(99999, { text: 'Should not apply' }); // Nonexistent ID
});
expect(result.current.history).toEqual(originalHistory);
diff --git a/packages/cli/src/ui/hooks/useShellHistory.test.ts b/packages/cli/src/ui/hooks/useShellHistory.test.ts
index 8d030497..3e2c2dd8 100644
--- a/packages/cli/src/ui/hooks/useShellHistory.test.ts
+++ b/packages/cli/src/ui/hooks/useShellHistory.test.ts
@@ -67,7 +67,7 @@ describe('useShellHistory', () => {
expect(command).toBe('cmd2');
});
- it('should handle a non-existent history file gracefully', async () => {
+ it('should handle a nonexistent history file gracefully', async () => {
const error = new Error('File not found') as NodeJS.ErrnoException;
error.code = 'ENOENT';
mockedFs.readFile.mockRejectedValue(error);
diff --git a/packages/cli/src/ui/hooks/useToolScheduler.test.ts b/packages/cli/src/ui/hooks/useToolScheduler.test.ts
index 81ea1f77..5395d18a 100644
--- a/packages/cli/src/ui/hooks/useToolScheduler.test.ts
+++ b/packages/cli/src/ui/hooks/useToolScheduler.test.ts
@@ -341,7 +341,7 @@ describe('useReactToolScheduler', () => {
const schedule = result.current[1];
const request: ToolCallRequestInfo = {
callId: 'call1',
- name: 'nonExistentTool',
+ name: 'nonexistentTool',
args: {},
};
@@ -361,7 +361,7 @@ describe('useReactToolScheduler', () => {
request,
response: expect.objectContaining({
error: expect.objectContaining({
- message: 'Tool "nonExistentTool" not found in registry.',
+ message: 'Tool "nonexistentTool" not found in registry.',
}),
}),
}),
diff --git a/packages/cli/src/ui/themes/shades-of-purple.ts b/packages/cli/src/ui/themes/shades-of-purple.ts
index 83eeb786..8b467e75 100644
--- a/packages/cli/src/ui/themes/shades-of-purple.ts
+++ b/packages/cli/src/ui/themes/shades-of-purple.ts
@@ -5,7 +5,7 @@
*/
/**
- * Shades of Purple Theme — for Highlightjs.
+ * Shades of Purple Theme — for Highlight.js.
* @author Ahmad Awais <https://twitter.com/mrahmadawais/>
*/
import { type ColorsTheme, Theme } from './theme.js';
diff --git a/packages/cli/src/ui/themes/theme-manager.test.ts b/packages/cli/src/ui/themes/theme-manager.test.ts
index f218af4b..5bb48167 100644
--- a/packages/cli/src/ui/themes/theme-manager.test.ts
+++ b/packages/cli/src/ui/themes/theme-manager.test.ts
@@ -85,7 +85,7 @@ describe('ThemeManager', () => {
expect(themeManager.getTheme('MyCustomTheme')).toBeDefined();
});
- it('should fallback to default theme if active theme is invalid', () => {
+ it('should fall back to default theme if active theme is invalid', () => {
(themeManager as unknown as { activeTheme: unknown }).activeTheme = {
name: 'NonExistent',
type: 'custom',
diff --git a/packages/cli/src/ui/themes/theme-manager.ts b/packages/cli/src/ui/themes/theme-manager.ts
index f121a9ec..bc5949ad 100644
--- a/packages/cli/src/ui/themes/theme-manager.ts
+++ b/packages/cli/src/ui/themes/theme-manager.ts
@@ -117,7 +117,7 @@ class ThemeManager {
if (process.env.NO_COLOR) {
return NoColorTheme;
}
- // Ensure the active theme is always valid (fallback to default if not)
+ // Ensure the active theme is always valid (fall back to default if not)
if (!this.activeTheme || !this.findThemeByName(this.activeTheme.name)) {
this.activeTheme = DEFAULT_THEME;
}
diff --git a/packages/cli/src/ui/themes/theme.ts b/packages/cli/src/ui/themes/theme.ts
index b5b6e993..9758357b 100644
--- a/packages/cli/src/ui/themes/theme.ts
+++ b/packages/cli/src/ui/themes/theme.ts
@@ -151,7 +151,7 @@ export class Theme {
inkTheme[key] = resolvedColor;
}
// If color is not resolvable, it's omitted from the map,
- // allowing fallback to the default foreground color.
+ // this enables falling back to the default foreground color.
}
// We currently only care about the 'color' property for Ink rendering.
// Other properties like background, fontStyle, etc., are ignored.
diff --git a/packages/cli/src/ui/utils/CodeColorizer.tsx b/packages/cli/src/ui/utils/CodeColorizer.tsx
index 77de9add..38dc49d4 100644
--- a/packages/cli/src/ui/utils/CodeColorizer.tsx
+++ b/packages/cli/src/ui/utils/CodeColorizer.tsx
@@ -50,7 +50,7 @@ function renderHastNode(
}
// Determine the color to pass down: Use this element's specific color
- // if found, otherwise, continue passing down the already inherited color.
+ // if found; otherwise, continue passing down the already inherited color.
const colorToPassDown = elementColor || inheritedColor;
// Recursively render children, passing the determined color down
@@ -70,7 +70,7 @@ function renderHastNode(
// Handle Root Node: Start recursion with initially inherited color
if (node.type === 'root') {
- // Check if children array is empty - this happens when lowlight can't detect language – fallback to plain text
+ // Check if children array is empty - this happens when lowlight can't detect language – fall back to plain text
if (!node.children || node.children.length === 0) {
return null;
}
@@ -161,7 +161,7 @@ export function colorizeCode(
`[colorizeCode] Error highlighting code for language "${language}":`,
error,
);
- // Fallback to plain text with default color on error
+ // Fall back to plain text with default color on error
// Also display line numbers in fallback
const lines = codeToHighlight.split('\n');
const padWidth = String(lines.length).length; // Calculate padding width based on number of lines
diff --git a/packages/cli/src/ui/utils/commandUtils.test.ts b/packages/cli/src/ui/utils/commandUtils.test.ts
index 158a5f7a..4bd48cee 100644
--- a/packages/cli/src/ui/utils/commandUtils.test.ts
+++ b/packages/cli/src/ui/utils/commandUtils.test.ts
@@ -200,7 +200,7 @@ describe('commandUtils', () => {
expect(mockChild.stdin.end).toHaveBeenCalled();
});
- it('should fallback to xsel when xclip fails', async () => {
+ it('should fall back to xsel when xclip fails', async () => {
const testText = 'Hello, world!';
let callCount = 0;
diff --git a/packages/cli/src/ui/utils/markdownUtilities.ts b/packages/cli/src/ui/utils/markdownUtilities.ts
index c328c12a..6a34f138 100644
--- a/packages/cli/src/ui/utils/markdownUtilities.ts
+++ b/packages/cli/src/ui/utils/markdownUtilities.ts
@@ -29,7 +29,7 @@ This function aims to find an *intelligent* or "safe" index within the provided
* **Single Line Breaks:** If no double newline is found in a suitable range, it will look for a single newline (`\n`).
* Any newline chosen as a split point must also not be inside a code block.
-4. **Fallback to `idealMaxLength`:**
+4. **Fall back to `idealMaxLength`:**
* If no "safer" split point (respecting code blocks or finding suitable newlines) is identified before or at `idealMaxLength`, and `idealMaxLength` itself is not determined to be an unsafe split point (e.g., inside a code block), the function may return a length larger than `idealMaxLength`, again it CANNOT break markdown formatting. This could happen with very long lines of text without Markdown block structures or newlines.
**In essence, `findSafeSplitPoint` tries to be a good Markdown citizen when forced to divide content, preferring structural boundaries over arbitrary character limits, with a strong emphasis on not corrupting code blocks.**
diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts
index 670d8930..1c2d7d08 100644
--- a/packages/cli/src/utils/sandbox.ts
+++ b/packages/cli/src/utils/sandbox.ts
@@ -99,7 +99,7 @@ async function shouldUseCurrentUserInSandbox(): Promise<boolean> {
}
// docker does not allow container names to contain ':' or '/', so we
-// parse those out and make the name a little shorter
+// parse those out to shorten the name
function parseImageName(image: string): string {
const [fullName, tag] = image.split(':');
const name = fullName.split('/').at(-1) ?? 'unknown-image';
@@ -187,7 +187,7 @@ export async function start_sandbox(
if (config.command === 'sandbox-exec') {
// disallow BUILD_SANDBOX
if (process.env.BUILD_SANDBOX) {
- console.error('ERROR: cannot BUILD_SANDBOX when using MacOS Seatbelt');
+ console.error('ERROR: cannot BUILD_SANDBOX when using macOS Seatbelt');
process.exit(1);
}
const profile = (process.env.SEATBELT_PROFILE ??= 'permissive-open');
@@ -847,7 +847,7 @@ async function ensureSandboxImageIsPresent(
console.info(`Sandbox image ${image} not found locally.`);
if (image === LOCAL_DEV_SANDBOX_IMAGE_NAME) {
- // user needs to build the image themself
+ // user needs to build the image themselves
return false;
}