feat: add slash command autocomplete to HappyComposer

Implements full-stack slash command autocomplete with agent-specific built-in commands and user-defined command discovery. Includes React Strict Mode fix for suggestion handling.
This commit is contained in:
weishu
2025-12-28 15:19:08 +08:00
parent 20c05a06ec
commit fbc0d601f8
12 changed files with 322 additions and 2 deletions
+7
View File
@@ -5,6 +5,7 @@ import type {
GitCommandResponse,
MachinesResponse,
MessagesResponse,
SlashCommandsResponse,
SpawnResponse,
SessionResponse,
SessionsResponse
@@ -240,4 +241,10 @@ export class ApiClient {
body: JSON.stringify({ directory, agent, yolo, sessionType, worktreeName })
})
}
async getSlashCommands(sessionId: string): Promise<SlashCommandsResponse> {
return await this.request<SlashCommandsResponse>(
`/api/sessions/${encodeURIComponent(sessionId)}/slash-commands`
)
}
}