diff options
| author | Adam Malczewski <[email protected]> | 2026-06-05 21:20:12 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-05 21:20:12 +0900 |
| commit | 7fb3269c698ae583ea7997ce206c4ae252fd3218 (patch) | |
| tree | 247d03408ecccd633290ea56b1b08811ebe460ec /packages/transport-http/src/logic.ts | |
| parent | 4283d1f8a0bc3953e65962a2364c903d0015f047 (diff) | |
| download | dispatch-7fb3269c698ae583ea7997ce206c4ae252fd3218.tar.gz dispatch-7fb3269c698ae583ea7997ce206c4ae252fd3218.zip | |
feat(backend): credential-store + model selection/catalog (GET /models) + per-turn cwd through orchestrator/transport/host-bin
Diffstat (limited to 'packages/transport-http/src/logic.ts')
| -rw-r--r-- | packages/transport-http/src/logic.ts | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/transport-http/src/logic.ts b/packages/transport-http/src/logic.ts index a1a1638..11133a5 100644 --- a/packages/transport-http/src/logic.ts +++ b/packages/transport-http/src/logic.ts @@ -3,6 +3,8 @@ import type { AgentEvent } from "@dispatch/kernel"; export interface ChatCommand { readonly conversationId: string; readonly message: string; + readonly model?: string; + readonly cwd?: string; } export interface ParseError { @@ -28,7 +30,23 @@ export function parseChatBody(body: unknown, generateId: () => string): ParseRes ? obj.conversationId : generateId(); - return { conversationId, message: message.trim() }; + const result: ChatCommand = { conversationId, message: message.trim() }; + + if (obj.model !== undefined) { + if (typeof obj.model !== "string") { + return { error: "Field 'model' must be a string" }; + } + (result as { model?: string }).model = obj.model; + } + + if (obj.cwd !== undefined) { + if (typeof obj.cwd !== "string") { + return { error: "Field 'cwd' must be a string" }; + } + (result as { cwd?: string }).cwd = obj.cwd; + } + + return result; } export function isParseError(result: ParseResult): result is ParseError { |
