test: 覆盖 Workbench CLI 双模式 smoke
This commit is contained in:
@@ -21,7 +21,11 @@ export function createWorkbenchHttpApp(options: { dispatch: (command: WorkbenchC
|
||||
const turnMatch = /^\/v1\/workbench\/turns\/([^/]+)$/u.exec(url.pathname);
|
||||
if (turnMatch && request.method === "GET") return nativeTurn(options, decodeURIComponent(turnMatch[1]));
|
||||
}
|
||||
if (url.pathname === "/v1/workbench/commands" && request.method === "POST") { requireAuthorization(request, options); return resultResponse(await options.dispatch(await bodyObject(request) as WorkbenchCommand), 202); }
|
||||
if (url.pathname === "/v1/workbench/commands" && request.method === "POST") {
|
||||
requireAuthorization(request, options);
|
||||
const command = await bodyObject(request) as WorkbenchCommand;
|
||||
return resultResponse(await options.dispatch(command), command.operation === "health" ? 200 : 202);
|
||||
}
|
||||
const actor = actorFrom(request, Boolean(options.snapshot));
|
||||
if (url.pathname === "/v1/agent/sessions" && request.method === "POST") { requireAuthorization(request, options); return legacyResponse(await options.dispatch({ operation: "session.create", actor, params: await bodyObject(request) }), 201); }
|
||||
if (url.pathname === "/v1/agent/chat" && request.method === "POST") {
|
||||
|
||||
Reference in New Issue
Block a user