fix(design): connect video preparation and playable history

This commit is contained in:
brother7 committed 2026-09-16 15:42:39 +08:00
1 parent 4321c77613
commit 1acca836fe
21 files changed
+900 -115

No files matched your search

@@ -94,7 +94,30 @@ describe('Works Square V2 Design Workspace adapter', () => {
const fetchMock = vi.fn(async (input: string | URL) => {
const url = String(input);
if (url.endsWith('/api/design/capabilities')) {
return jsonResponse({ conversation: true, generation: true, image: true, video: true });
return jsonResponse({
conversation: true,
generation: true,
image: true,
video: true,
generation_options: {
image: {
available: true,
supported_aspect_ratios: ['1:1', '3:4', '9:16', '4:3', '16:9'],
supported_duration_seconds: [],
max_output_count: 4,
requires_first_frame: false,
supported_reference_roles: ['inspiration'],
},
video: {
available: true,
supported_aspect_ratios: ['1:1', '3:4', '9:16', '4:3', '16:9'],
supported_duration_seconds: [1, 6, 12],
max_output_count: 1,
requires_first_frame: true,
supported_reference_roles: ['first_frame'],
},
},
});
}
if (url.includes('/api/design/workspaces?')) return jsonResponse([serverSummary]);
if (url.endsWith('/api/design/workspaces/workspace-1')) return jsonResponse(serverWorkspace);
@@ -168,6 +191,33 @@ describe('Works Square V2 Design Workspace adapter', () => {
},
},
},
{
command: {
kind: 'apply_input' as const,
workspaceId: 'workspace-1',
sessionId: 'session-1',
expectedDirectionRevision: 4,
clientOperationId: 'operation-prepare-1',
input: {
kind: 'prepare_generation' as const,
operations: [
{ kind: 'set' as const, path: 'intent.media', value: 'video' },
],
},
},
expected: {
client_command_id: 'operation-prepare-1',
name: 'design.input.apply',
input: {
expected_direction_revision: 4,
client_operation_id: 'operation-prepare-1',
input: {
kind: 'prepare_generation',
operations: [{ kind: 'set', path: 'intent.media', value: 'video' }],
},
},
},
},
{
command: {
kind: 'confirm_generation' as const,