(message: string)
| 4 | | { type: null }; |
| 5 | |
| 6 | export function parseCodexSpecialCommand(message: string): CodexSpecialCommand { |
| 7 | const trimmed = message.trim(); |
| 8 | if (trimmed === '/clear') { |
| 9 | return { type: 'clear' }; |
| 10 | } |
| 11 | if (trimmed === '/compact') { |
| 12 | return { type: 'compact' }; |
| 13 | } |
| 14 | if (trimmed.startsWith('/clear ')) { |
| 15 | return { |
| 16 | type: 'invalid', |
| 17 | command: 'clear', |
| 18 | message: '/clear does not accept arguments' |
| 19 | }; |
| 20 | } |
| 21 | if (trimmed.startsWith('/compact ')) { |
| 22 | return { |
| 23 | type: 'invalid', |
| 24 | command: 'compact', |
| 25 | message: '/compact does not accept arguments' |
| 26 | }; |
| 27 | } |
| 28 | return { type: null }; |
| 29 | } |
no outgoing calls
no test coverage detected