#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const { pathToFileURL } = require('url'); const ROOT = path.resolve(__dirname, '..'); const SKILL_DIR = path.join(ROOT, 'skills', 'fmode-vision'); function fail(msg) { console.error('SMOKE FAIL: ' + msg); process.exit(1); } const required = [ 'SKILL.md', 'scripts/vision-client.mjs', 'scripts/prompts/room-measurement.mjs' ]; for (const rel of required) { if (!fs.existsSync(path.join(SKILL_DIR, rel))) fail('missing ' + rel); } (async () => { const mod = await import(pathToFileURL(path.join(SKILL_DIR, 'scripts', 'vision-client.mjs')).href); for (const fn of ['resolveApiToken', 'callVisionAPI', 'callMultiPass', 'extractJSON']) { if (typeof mod[fn] !== 'function') fail('export ' + fn + ' is not a function'); } const { parsed } = mod.extractJSON('text {"a":1} tail'); if (!parsed || parsed.a !== 1) fail('extractJSON did not parse JSON'); console.log('SMOKE OK: fmode-vision package structure + module exports verified'); })().catch(e => fail(e.message));