( value: string, )
| 64 | }; |
| 65 | |
| 66 | export const parseCommand = ( |
| 67 | value: string, |
| 68 | ): { command: AgentCommand; args: string } | undefined => { |
| 69 | const match = /^\/([a-z-]+)(?:\s+([\s\S]*))?$/.exec(value.trim()); |
| 70 | const command = match ? findCommand(match[1]) : undefined; |
| 71 | |
| 72 | return command ? { command, args: (match?.[2] ?? '').trim() } : undefined; |
| 73 | }; |
no test coverage detected