import { test } from 'node:test';
import assert from 'node:assert/strict';
import { getModel, parseSettings } from '../src/generation/catalog/index';
import { toPlatform } from '../src/generation/to-platform';
import type { GenerationPlane } from '../src/generation/catalog/types';

const plane = (): GenerationPlane => ({model: 'genjutsu-object-swap', prompt: {text: ''}, media: {video: [{id:'v',role:'video',url:'https://example.com/video.mp4'}],reference: [{id:'i',role:'reference',url:'https://example.com/car.jpg'}]},settings:{}});
test('Genjutsu exposes its input slots and maps the documented request exactly', () => {
 const model = getModel('genjutsu-object-swap');
 assert.equal(model.surface, 'video');
 assert.deepEqual(model.roles, {video:1, reference:8});
 const input = plane(); input.settings = parseSettings(model, {});
 assert.deepEqual(toPlatform(input), {path:'higgsfiled/genjutsu/object-swap/v1.0', body:{prompt:'',video_url:'https://example.com/video.mp4',image_urls:['https://example.com/car.jpg'],resolution:'720p'}});
 input.settings = parseSettings(model, {resolution:'480p'});
 assert.equal(toPlatform(input).body.resolution,'480p');
});
