summaryrefslogtreecommitdiffhomepage
path: root/packages/transport-http/src/logic.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-05 21:20:12 +0900
committerAdam Malczewski <[email protected]>2026-06-05 21:20:12 +0900
commit7fb3269c698ae583ea7997ce206c4ae252fd3218 (patch)
tree247d03408ecccd633290ea56b1b08811ebe460ec /packages/transport-http/src/logic.ts
parent4283d1f8a0bc3953e65962a2364c903d0015f047 (diff)
downloaddispatch-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.ts20
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 {