MCP: shots_check (read-only), shots_capture / render / gallery / record / video (local, dry by default), apple_previews; variant on uploads
This commit is contained in:
parent
5b4902496d
commit
ccd48465a6
2 changed files with 64 additions and 4 deletions
|
|
@ -25,6 +25,9 @@ export interface ToolDef {
|
||||||
}
|
}
|
||||||
|
|
||||||
const only: JsonSchema = { type: 'string', description: 'Comma-separated ids / language codes to limit the run to (optional)' };
|
const only: JsonSchema = { type: 'string', description: 'Comma-separated ids / language codes to limit the run to (optional)' };
|
||||||
|
const lang: JsonSchema = { type: 'string', description: 'Comma-separated language ids from the config (default: all)' };
|
||||||
|
const variant: JsonSchema = { type: 'string', pattern: '^[a-z0-9][a-z0-9-]*$', description: 'A/B variant id from shots.variants (default: the base renders)' };
|
||||||
|
const source: JsonSchema = { type: 'string', enum: ['web', 'ios-sim', 'android-emu', 'folder'], description: 'Default: from the config' };
|
||||||
const opt = (flag: string, v: unknown): string[] => (v === undefined || v === null || v === '' ? [] : [`--${flag}`, String(v)]);
|
const opt = (flag: string, v: unknown): string[] => (v === undefined || v === null || v === '' ? [] : [`--${flag}`, String(v)]);
|
||||||
const flag = (name: string, v: unknown): string[] => (v === true ? [`--${name}`] : []);
|
const flag = (name: string, v: unknown): string[] => (v === true ? [`--${name}`] : []);
|
||||||
|
|
||||||
|
|
@ -47,6 +50,10 @@ export const TOOLS: ToolDef[] = [
|
||||||
description: 'Read-only Play overview: tracks and releases (with rollout fraction), listing languages, one-time products.' },
|
description: 'Read-only Play overview: tracks and releases (with rollout fraction), listing languages, one-time products.' },
|
||||||
{ name: 'play_next_version_code', title: 'Next Play versionCode', command: ['play', 'next-version-code'], write: false, network: true,
|
{ name: 'play_next_version_code', title: 'Next Play versionCode', command: ['play', 'next-version-code'], write: false, network: true,
|
||||||
description: 'Next Play versionCode: one above every uploaded bundle and track release.' },
|
description: 'Next Play versionCode: one above every uploaded bundle and track release.' },
|
||||||
|
{ name: 'shots_check', title: 'Check store renders', command: ['shots', 'check'], write: false, network: false,
|
||||||
|
description: 'Local store checks of the renders folder: pixel sizes per store type, alpha, Play JPEG / 24-bit PNG and 8 MB, counts per set, text overflow flags, app preview videos (H.264, 30 fps, 15-30 s, stereo AAC) and folder frames. Read-only.',
|
||||||
|
props: { lang, variants: { type: 'boolean', default: false, description: 'Also check the A/B variant folders' } },
|
||||||
|
args: i => [...opt('lang', i.lang), ...flag('variants', i.variants)] },
|
||||||
{ name: 'privacy_manifest', title: 'iOS privacy manifest scan', command: ['privacy-manifest'], write: false, network: false,
|
{ name: 'privacy_manifest', title: 'iOS privacy manifest scan', command: ['privacy-manifest'], write: false, network: false,
|
||||||
description: 'Local scan of an iOS project: PrivacyInfo.xcprivacy present, required-reason APIs declared, SDKs without manifests.',
|
description: 'Local scan of an iOS project: PrivacyInfo.xcprivacy present, required-reason APIs declared, SDKs without manifests.',
|
||||||
props: { ios: { type: 'string', description: 'Path of the iOS project folder, e.g. ios/App' }, sdk_dirs: { type: 'string', description: 'Extra plugin / SDK folders, comma-separated' } },
|
props: { ios: { type: 'string', description: 'Path of the iOS project folder, e.g. ios/App' }, sdk_dirs: { type: 'string', description: 'Extra plugin / SDK folders, comma-separated' } },
|
||||||
|
|
@ -60,8 +67,8 @@ export const TOOLS: ToolDef[] = [
|
||||||
description: 'Google Play app details + title / short / full description per language from the listing file. Not public until the next review / publish.',
|
description: 'Google Play app details + title / short / full description per language from the listing file. Not public until the next review / publish.',
|
||||||
props: { only }, args: i => opt('only', i.only) },
|
props: { only }, args: i => opt('only', i.only) },
|
||||||
{ name: 'play_images', title: 'Upload Play graphics', command: ['play', 'images'], write: true, destructive: true, network: true, idempotent: true,
|
{ name: 'play_images', title: 'Upload Play graphics', command: ['play', 'images'], write: true, destructive: true, network: true, idempotent: true,
|
||||||
description: 'Replace icon, feature graphic and screenshots per Play language from the renders folder. Slow (minutes): prefer the terminal with a log for many languages.',
|
description: 'Replace icon, feature graphic and screenshots per Play language from the renders folder (or an A/B variant folder). Slow (minutes): prefer the terminal with a log for many languages.',
|
||||||
props: { only }, args: i => opt('only', i.only) },
|
props: { only, variant }, args: i => [...opt('only', i.only), ...opt('variant', i.variant)] },
|
||||||
{ name: 'play_products', title: 'Sync Play one-time products', command: ['play', 'products'], write: true, network: true, idempotent: true,
|
{ name: 'play_products', title: 'Sync Play one-time products', command: ['play', 'products'], write: true, network: true, idempotent: true,
|
||||||
description: 'Create / update one-time products with regional prices and activate their purchase option.',
|
description: 'Create / update one-time products with regional prices and activate their purchase option.',
|
||||||
props: { only }, args: i => opt('only', i.only) },
|
props: { only }, args: i => opt('only', i.only) },
|
||||||
|
|
@ -84,8 +91,8 @@ export const TOOLS: ToolDef[] = [
|
||||||
props: { version: { type: 'string', pattern: '^\\d+(\\.\\d+){0,2}$' }, build: { type: 'string', description: 'Exact build number to attach (use the number you just uploaded, never "latest")' }, only },
|
props: { version: { type: 'string', pattern: '^\\d+(\\.\\d+){0,2}$' }, build: { type: 'string', description: 'Exact build number to attach (use the number you just uploaded, never "latest")' }, only },
|
||||||
required: ['version'], args: i => [...opt('version', i.version), ...opt('build', i.build), ...opt('only', i.only)] },
|
required: ['version'], args: i => [...opt('version', i.version), ...opt('build', i.build), ...opt('only', i.only)] },
|
||||||
{ name: 'apple_screenshots', title: 'Upload App Store screenshots', command: ['apple', 'screenshots'], write: true, destructive: true, network: true, idempotent: true,
|
{ name: 'apple_screenshots', title: 'Upload App Store screenshots', command: ['apple', 'screenshots'], write: true, destructive: true, network: true, idempotent: true,
|
||||||
description: 'Sync 6.9" and 6.5" screenshots per locale (MD5-idempotent; changed sets are replaced). Slow: prefer the terminal with a log.',
|
description: 'Sync 6.9" and 6.5" (+ 13" iPad with apple.ipad) screenshots per locale from the renders folder (or an A/B variant folder; MD5-idempotent; changed sets are replaced). Slow: prefer the terminal with a log.',
|
||||||
props: { only }, args: i => opt('only', i.only) },
|
props: { only, variant }, args: i => [...opt('only', i.only), ...opt('variant', i.variant)] },
|
||||||
{ name: 'apple_appinfo', title: 'App Store app info', command: ['apple', 'appinfo'], write: true, network: true, idempotent: true,
|
{ name: 'apple_appinfo', title: 'App Store app info', command: ['apple', 'appinfo'], write: true, network: true, idempotent: true,
|
||||||
description: 'Categories, age rating declaration, content rights, Free price and availability (when missing).' },
|
description: 'Categories, age rating declaration, content rights, Free price and availability (when missing).' },
|
||||||
{ name: 'apple_review_details', title: 'App Review information', command: ['apple', 'review-details'], write: true, network: true, idempotent: true,
|
{ name: 'apple_review_details', title: 'App Review information', command: ['apple', 'review-details'], write: true, network: true, idempotent: true,
|
||||||
|
|
@ -97,6 +104,31 @@ export const TOOLS: ToolDef[] = [
|
||||||
description: 'Turn on the 7-day phased release for the upcoming version, or pause an active one (pausing is not a rollback). Resume / complete / release are owner-only terminal commands.',
|
description: 'Turn on the 7-day phased release for the upcoming version, or pause an active one (pausing is not a rollback). Resume / complete / release are owner-only terminal commands.',
|
||||||
props: { action: { type: 'string', enum: ['on', 'pause'] }, version: { type: 'string' } }, required: ['action'],
|
props: { action: { type: 'string', enum: ['on', 'pause'] }, version: { type: 'string' } }, required: ['action'],
|
||||||
args: i => ['--phased', String(i.action), ...opt('version', i.version)] },
|
args: i => ['--phased', String(i.action), ...opt('version', i.version)] },
|
||||||
|
{ name: 'shots_capture', title: 'Capture raw frames', command: ['shots', 'capture'], write: true, network: false, idempotent: true,
|
||||||
|
description: 'Raw game frames per language into shots.frames from a web build (Playwright), the iOS Simulator (simctl), an Android emulator / device (adb) or a folder check. Local files only; a simulator it boots is shut down again, an emulator is never booted. dry_run lists the plan and the simctl / adb commands.',
|
||||||
|
props: { lang, only: { type: 'string', description: 'Comma-separated shot names' }, device: { type: 'string', enum: ['phone', 'tablet'] }, source },
|
||||||
|
args: i => [...opt('lang', i.lang), ...opt('only', i.only), ...opt('device', i.device), ...opt('source', i.source)] },
|
||||||
|
{ name: 'shots_render', title: 'Render store screenshots', command: ['shots', 'render'], write: true, network: false, idempotent: true,
|
||||||
|
description: 'Store screenshots + Play feature graphic in every size and language from the frames and the copy file (local PNGs, needs Playwright + ffmpeg; slow for many languages). dry_run lists what would be rendered.',
|
||||||
|
props: { lang, size: { type: 'string', description: 'Comma-separated size keys: ios69, ios65, ipad13, play, tab7, tab10, feature' },
|
||||||
|
scenes: { type: 'string', description: 'Comma-separated scene ids' }, variant, all_variants: { type: 'boolean', default: false, description: 'Base + every variant' } },
|
||||||
|
args: i => [...opt('lang', i.lang), ...opt('size', i.size), ...opt('scenes', i.scenes), ...(i.all_variants === true ? ['--variants'] : opt('variant', i.variant))] },
|
||||||
|
{ name: 'shots_gallery', title: 'Review gallery', command: ['shots', 'gallery'], write: true, network: false, idempotent: true,
|
||||||
|
description: 'Write <renders>/index.html: one self-contained page with every language, size, scene, variant and app preview, store check issues highlighted. Open it in a browser to review before uploading.',
|
||||||
|
props: { lang }, args: i => opt('lang', i.lang) },
|
||||||
|
{ name: 'shots_record', title: 'Record gameplay clips', command: ['shots', 'record'], write: true, network: false, idempotent: true,
|
||||||
|
description: 'Gameplay clips for app previews from shots.video.record: web build (Chromium screencast), iOS Simulator (simctl recordVideo), Android emulator / device (screenrecord, never booted) or a folder listing. Local files only.',
|
||||||
|
props: { lang, only: { type: 'string', description: 'Comma-separated clip names' }, source },
|
||||||
|
args: i => [...opt('lang', i.lang), ...opt('only', i.only), ...opt('source', i.source)] },
|
||||||
|
{ name: 'shots_video', title: 'Cut app previews', command: ['shots', 'video'], write: true, network: false, idempotent: true,
|
||||||
|
description: 'App Store app previews (886x1920 iPhone, 1200x1600 iPad) and a YouTube promo video (Play) from the clips: captions from the screenshot copy, silent or music track, poster frame, store checks. Local files only; nothing is uploaded.',
|
||||||
|
props: { lang, target: { type: 'string', description: 'Comma-separated: iphone, ipad, youtube, youtube-landscape' },
|
||||||
|
seconds: { type: 'integer', minimum: 15, maximum: 30 }, captions: { type: 'boolean', default: true } },
|
||||||
|
args: i => [...opt('lang', i.lang), ...opt('target', i.target), ...opt('seconds', i.seconds), ...(i.captions === false ? ['--no-captions'] : [])] },
|
||||||
|
{ name: 'apple_previews', title: 'Upload App Store app previews', command: ['apple', 'previews'], write: true, destructive: true, network: true, idempotent: true,
|
||||||
|
description: 'Sync app preview videos per locale to the editable App Store version (checked locally first; MD5-idempotent, changed sets are replaced; poster frame time code). Not public until the version is submitted and released. Slow: prefer the terminal with a log.',
|
||||||
|
props: { only, poster: { type: 'integer', minimum: 0, maximum: 29, description: 'Poster frame second (default shots.video.poster or 5)' } },
|
||||||
|
args: i => [...opt('only', i.only), ...opt('poster', i.poster)] },
|
||||||
{ name: 'icons', title: 'Generate icons', command: ['icons'], write: true, network: false, idempotent: true,
|
{ name: 'icons', title: 'Generate icons', command: ['icons'], write: true, network: false, idempotent: true,
|
||||||
description: 'Write every store / launcher / web icon from the artwork in the config (local files, needs ffmpeg).' },
|
description: 'Write every store / launcher / web icon from the artwork in the config (local files, needs ffmpeg).' },
|
||||||
];
|
];
|
||||||
|
|
@ -140,6 +172,7 @@ export function validateInput(t: ToolDef, input: unknown): string[] {
|
||||||
if (p.enum && !p.enum.includes(v as string)) e.push(`${k}: one of ${p.enum.join(', ')}`);
|
if (p.enum && !p.enum.includes(v as string)) e.push(`${k}: one of ${p.enum.join(', ')}`);
|
||||||
if (p.pattern && typeof v === 'string' && !new RegExp(p.pattern).test(v)) e.push(`${k}: does not match ${p.pattern}`);
|
if (p.pattern && typeof v === 'string' && !new RegExp(p.pattern).test(v)) e.push(`${k}: does not match ${p.pattern}`);
|
||||||
if (p.minimum !== undefined && typeof v === 'number' && v < p.minimum) e.push(`${k}: >= ${p.minimum}`);
|
if (p.minimum !== undefined && typeof v === 'number' && v < p.minimum) e.push(`${k}: >= ${p.minimum}`);
|
||||||
|
if (p.maximum !== undefined && typeof v === 'number' && v > p.maximum) e.push(`${k}: <= ${p.maximum}`);
|
||||||
if (typeof v === 'string' && /^-/.test(v)) e.push(`${k}: must not start with "-"`);
|
if (typeof v === 'string' && /^-/.test(v)) e.push(`${k}: must not start with "-"`);
|
||||||
}
|
}
|
||||||
return e;
|
return e;
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,33 @@ describe('mcp tools', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('mcp: screenshot and video tools', () => {
|
||||||
|
const tool = (n: string) => TOOLS.find(t => t.name === n)!;
|
||||||
|
test('kinds: check is read-only, local writes are dry by default, previews is a network write', () => {
|
||||||
|
expect(tool('shots_check')).toMatchObject({ write: false, network: false });
|
||||||
|
for (const n of ['shots_capture', 'shots_render', 'shots_gallery', 'shots_record', 'shots_video']) {
|
||||||
|
expect(tool(n)).toMatchObject({ write: true, network: false });
|
||||||
|
expect(toArgv(tool(n), {}).argv.at(-1)).toBe('--dry');
|
||||||
|
}
|
||||||
|
expect(tool('apple_previews')).toMatchObject({ write: true, network: true, destructive: true });
|
||||||
|
expect(toArgv(tool('apple_previews'), { only: 'en-US', poster: 3 }).argv).toEqual(['apple', 'previews', '--only', 'en-US', '--poster', '3', '--dry']);
|
||||||
|
});
|
||||||
|
test('argv', () => {
|
||||||
|
expect(toArgv(tool('shots_check'), { lang: 'en,tr', variants: true }).argv).toEqual(['shots', 'check', '--lang', 'en,tr', '--variants']);
|
||||||
|
expect(toArgv(tool('shots_render'), { all_variants: true, variant: 'b', dry_run: false }).argv).toEqual(['shots', 'render', '--variants']);
|
||||||
|
expect(toArgv(tool('shots_render'), { variant: 'b', size: 'ios69' }).argv).toEqual(['shots', 'render', '--size', 'ios69', '--variant', 'b', '--dry']);
|
||||||
|
expect(toArgv(tool('shots_video'), { seconds: 20, captions: false, dry_run: false }).argv).toEqual(['shots', 'video', '--seconds', '20', '--no-captions']);
|
||||||
|
expect(toArgv(tool('shots_capture'), { source: 'ios-sim', device: 'tablet' }).argv).toEqual(['shots', 'capture', '--device', 'tablet', '--source', 'ios-sim', '--dry']);
|
||||||
|
expect(toArgv(tool('play_images'), { variant: 'b' }).argv).toEqual(['play', 'images', '--variant', 'b', '--dry']);
|
||||||
|
});
|
||||||
|
test('input checks', () => {
|
||||||
|
expect(validateInput(tool('apple_screenshots'), { variant: '../x' })[0]).toContain('does not match');
|
||||||
|
expect(validateInput(tool('shots_video'), { seconds: 45 })).toEqual(['seconds: <= 30']);
|
||||||
|
expect(validateInput(tool('shots_video'), { seconds: 10 })).toEqual(['seconds: >= 15']);
|
||||||
|
expect(validateInput(tool('shots_record'), { source: 'camera' })).toEqual(['source: one of web, ios-sim, android-emu, folder']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('aso', () => {
|
describe('aso', () => {
|
||||||
test('keyword field rules', () => {
|
test('keyword field rules', () => {
|
||||||
const f = auditAppleKeywords('en-US', { subtitle: 'Relaxing puzzle', keywords: 'match,puzzle,match,free game' }, 'Tile Match');
|
const f = auditAppleKeywords('en-US', { subtitle: 'Relaxing puzzle', keywords: 'match,puzzle,match,free game' }, 'Tile Match');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue