feat: add directory autocomplete with validation for new session form

This commit is contained in:
weishu
2025-12-28 16:31:53 +08:00
parent ce40de900f
commit 05deb6fff8
9 changed files with 292 additions and 37 deletions
+14
View File
@@ -3,6 +3,7 @@ import type {
FileReadResponse,
FileSearchResponse,
GitCommandResponse,
MachinePathsExistsResponse,
MachinesResponse,
MessagesResponse,
SlashCommandsResponse,
@@ -228,6 +229,19 @@ export class ApiClient {
return await this.request<MachinesResponse>('/api/machines')
}
async checkMachinePathsExists(
machineId: string,
paths: string[]
): Promise<MachinePathsExistsResponse> {
return await this.request<MachinePathsExistsResponse>(
`/api/machines/${encodeURIComponent(machineId)}/paths/exists`,
{
method: 'POST',
body: JSON.stringify({ paths })
}
)
}
async spawnSession(
machineId: string,
directory: string,