fix(cli): address audit issues in /btw command

- Add ACP mode support with stream_messages async generator
- Add non-interactive mode support with simple message return
- Add wrap="wrap" to Text components for long text handling
- Extract askBtw helper to reduce duplication across execution modes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Shaojin Wen 2026-03-14 15:56:39 +08:00
parent 8dc34c385d
commit 8b90b145b3
2 changed files with 101 additions and 37 deletions

View file

@ -25,7 +25,9 @@ export const BtwMessage: React.FC<BtwDisplayProps> = ({ btw }) => (
<Text color={Colors.Gray} dimColor>
{'btw> '}
</Text>
<Text color={Colors.Gray}>{btw.question}</Text>
<Text wrap="wrap" color={Colors.Gray}>
{btw.question}
</Text>
</Box>
<Box flexDirection="row" marginTop={0}>
{btw.isPending ? (
@ -37,7 +39,9 @@ export const BtwMessage: React.FC<BtwDisplayProps> = ({ btw }) => (
</Box>
) : (
<Box flexDirection="column">
<Text color={Colors.AccentCyan}>{btw.answer}</Text>
<Text wrap="wrap" color={Colors.AccentCyan}>
{btw.answer}
</Text>
</Box>
)}
</Box>