2025-04-29 23:17:36 +00:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React from 'react';
|
2025-04-30 00:26:07 +00:00
|
|
|
import { Box, Text } from 'ink';
|
2025-04-29 23:17:36 +00:00
|
|
|
import { Colors } from '../colors.js';
|
2025-04-29 23:38:26 +00:00
|
|
|
import { SlashCommand } from '../hooks/slashCommandProcessor.js';
|
2025-04-29 23:17:36 +00:00
|
|
|
|
2025-05-05 20:48:34 +00:00
|
|
|
interface Help {
|
2025-04-29 23:38:26 +00:00
|
|
|
commands: SlashCommand[];
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-05 20:48:34 +00:00
|
|
|
export const Help: React.FC<Help> = ({ commands }) => (
|
2025-04-29 23:17:36 +00:00
|
|
|
<Box flexDirection="column" marginBottom={1}>
|
2025-04-29 23:38:26 +00:00
|
|
|
<Text bold color={Colors.Foreground}>
|
|
|
|
|
Abilities:
|
2025-04-29 23:17:36 +00:00
|
|
|
</Text>
|
2025-04-29 23:38:26 +00:00
|
|
|
<Text color={Colors.Foreground}> * Use tools to read and write files</Text>
|
|
|
|
|
<Text color={Colors.Foreground}>
|
|
|
|
|
{' '}
|
|
|
|
|
* Semantically search and explain code
|
2025-04-29 23:17:36 +00:00
|
|
|
</Text>
|
2025-04-29 23:38:26 +00:00
|
|
|
<Text color={Colors.Foreground}> * Execute bash commands</Text>
|
2025-04-30 00:26:07 +00:00
|
|
|
<Box height={1} />
|
2025-04-29 23:38:26 +00:00
|
|
|
<Text bold color={Colors.Foreground}>
|
|
|
|
|
Commands:
|
2025-04-29 23:17:36 +00:00
|
|
|
</Text>
|
2025-05-17 21:57:27 -07:00
|
|
|
{commands
|
|
|
|
|
.filter((command) => command.description)
|
|
|
|
|
.map((command: SlashCommand) => (
|
|
|
|
|
<Text key={command.name} color={Colors.SubtleComment}>
|
|
|
|
|
<Text bold color={Colors.AccentPurple}>
|
|
|
|
|
{' '}
|
|
|
|
|
/{command.name}
|
|
|
|
|
</Text>
|
|
|
|
|
{command.description && ' - ' + command.description}
|
2025-04-29 23:38:26 +00:00
|
|
|
</Text>
|
2025-05-17 21:57:27 -07:00
|
|
|
))}
|
2025-04-30 00:26:07 +00:00
|
|
|
<Text color={Colors.SubtleComment}>
|
|
|
|
|
<Text bold color={Colors.AccentPurple}>
|
|
|
|
|
{' '}
|
|
|
|
|
!{' '}
|
|
|
|
|
</Text>
|
|
|
|
|
shell command
|
|
|
|
|
</Text>
|
2025-04-29 23:17:36 +00:00
|
|
|
</Box>
|
|
|
|
|
);
|