fix(design): connect video preparation and playable history
This commit is contained in:
@@ -22,7 +22,30 @@ test.describe('AI Design V2 workspace', () => {
|
||||
return respond({
|
||||
success: true,
|
||||
data: {
|
||||
capabilities: { conversation: true, generation: true, image: true, video: true },
|
||||
capabilities: {
|
||||
conversation: true,
|
||||
generation: true,
|
||||
image: true,
|
||||
video: true,
|
||||
generationOptions: {
|
||||
image: {
|
||||
available: true,
|
||||
supportedAspectRatios: ['1:1', '3:4', '9:16', '4:3', '16:9'],
|
||||
supportedDurationSeconds: [],
|
||||
maxOutputCount: 4,
|
||||
requiresFirstFrame: false,
|
||||
supportedReferenceRoles: ['inspiration'],
|
||||
},
|
||||
video: {
|
||||
available: true,
|
||||
supportedAspectRatios: ['1:1', '3:4', '9:16', '4:3', '16:9'],
|
||||
supportedDurationSeconds: [1, 6, 12],
|
||||
maxOutputCount: 1,
|
||||
requiresFirstFrame: true,
|
||||
supportedReferenceRoles: ['first_frame'],
|
||||
},
|
||||
},
|
||||
},
|
||||
workspaces: [],
|
||||
},
|
||||
});
|
||||
@@ -227,7 +250,30 @@ test.describe('AI Design V2 workspace', () => {
|
||||
}
|
||||
if (path === '/api/works/image-workspace') {
|
||||
return envelope({
|
||||
capabilities: { conversation: true, generation: true, image: true, video: true },
|
||||
capabilities: {
|
||||
conversation: true,
|
||||
generation: true,
|
||||
image: true,
|
||||
video: true,
|
||||
generationOptions: {
|
||||
image: {
|
||||
available: true,
|
||||
supportedAspectRatios: ['1:1', '3:4', '9:16', '4:3', '16:9'],
|
||||
supportedDurationSeconds: [],
|
||||
maxOutputCount: 4,
|
||||
requiresFirstFrame: false,
|
||||
supportedReferenceRoles: ['inspiration'],
|
||||
},
|
||||
video: {
|
||||
available: true,
|
||||
supportedAspectRatios: ['1:1', '3:4', '9:16', '4:3', '16:9'],
|
||||
supportedDurationSeconds: [1, 6, 12],
|
||||
maxOutputCount: 1,
|
||||
requiresFirstFrame: true,
|
||||
supportedReferenceRoles: ['first_frame'],
|
||||
},
|
||||
},
|
||||
},
|
||||
workspaces: [workspace.workspace],
|
||||
});
|
||||
}
|
||||
@@ -246,6 +292,9 @@ test.describe('AI Design V2 workspace', () => {
|
||||
};
|
||||
|
||||
if (command.kind === 'apply_input') {
|
||||
if (command.input?.kind === 'prepare_generation') {
|
||||
(globalThis as typeof globalThis & { __designPreparedRevision?: number }).__designPreparedRevision = workspace.form.specificationRevision + 1;
|
||||
}
|
||||
if (command.input?.kind === 'direct_edit') {
|
||||
for (const operation of command.input.operations ?? []) {
|
||||
if (operation.kind === 'set' && operation.path === 'output.aspect_ratio') {
|
||||
@@ -275,6 +324,9 @@ test.describe('AI Design V2 workspace', () => {
|
||||
}
|
||||
|
||||
if (command.kind === 'request_quote') {
|
||||
if ((globalThis as typeof globalThis & { __designPreparedRevision?: number }).__designPreparedRevision !== workspace.form.specificationRevision) {
|
||||
throw new Error('Quote must use the latest prepared revision');
|
||||
}
|
||||
workspace.form.activeQuotes = [{
|
||||
quoteId: 'quote-1',
|
||||
status: 'offered',
|
||||
|
||||
Reference in New Issue
Block a user