(
message: string,
)
| 412 | }; |
| 413 | |
| 414 | const handleSlashCommandProcessing = async ( |
| 415 | message: string, |
| 416 | ): Promise<string | null> => { |
| 417 | // Handle slash commands |
| 418 | if (!assistant) { |
| 419 | return message; |
| 420 | } |
| 421 | |
| 422 | const commandResult = await handleSlashCommands(message, assistant); |
| 423 | |
| 424 | if (!commandResult) { |
| 425 | return message; |
| 426 | } |
| 427 | |
| 428 | if (commandResult.compact) { |
| 429 | await handleCompactCommand({ |
| 430 | chatHistory, |
| 431 | model, |
| 432 | llmApi, |
| 433 | setChatHistory, |
| 434 | setCompactionIndex, |
| 435 | currentSession, |
| 436 | setCurrentSession, |
| 437 | setIsCompacting, |
| 438 | setCompactionStartTime, |
| 439 | setCompactionAbortController, |
| 440 | }); |
| 441 | return null; |
| 442 | } |
| 443 | |
| 444 | const newInput = processSlashCommandResult({ |
| 445 | result: commandResult, |
| 446 | chatHistory, |
| 447 | setChatHistory, |
| 448 | onShowConfigSelector, |
| 449 | onShowModelSelector, |
| 450 | onShowMCPSelector, |
| 451 | onShowSessionSelector, |
| 452 | onShowJobsSelector, |
| 453 | onShowUpdateSelector, |
| 454 | onShowExportSelector, |
| 455 | onClear, |
| 456 | }); |
| 457 | |
| 458 | return newInput || null; |
| 459 | }; |
| 460 | |
| 461 | const convertMessageContentToString = (content: any): string => { |
| 462 | if (typeof content === "string") { |
no test coverage detected