#!/usr/bin/env node /** * Mock-ups of the Windows installer in Strata's own look: four screens (welcome, where, installing, done), light and dark, drawn with * the app's built CSS (apps/host/dist) and brand files, then photographed with Chrome. Nothing here is built or shipped: it is what * the owner is shown before an installer is chosen. * * node apps/desktop/scripts/installer-mockups.mjs [--out ] */ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'; import { dirname, join, resolve } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; const args = Object.fromEntries(process.argv.slice(2).reduce((acc, a, i, all) => (a.startsWith('--') ? [...acc, [a.slice(2), all[i + 1]]] : acc), [])); const here = dirname(fileURLToPath(import.meta.url)); const host = resolve(here, '../../host'); const out = resolve(args.out ?? join(here, '../installer-mockups')); mkdirSync(out, { recursive: true }); const dist = join(host, 'dist'); const css = readdirSync(join(dist, 'assets')).filter(f => f.endsWith('.css')).map(f => readFileSync(join(dist, 'assets', f), 'utf8')).join('\n'); const logo = theme => readFileSync(join(dist, 'brand', `strata-lockup-${theme}.svg`), 'utf8'); const { chromium } = await import(pathToFileURL(join(host, 'node_modules/playwright-core/index.mjs')).href).catch(() => import('playwright-core')); const CHROME = process.env.CHROME ?? ['C:/Program Files/Google/Chrome/Application/chrome.exe', '/usr/bin/google-chrome'].find(existsSync); const check = ''; const folder = ''; const screens = { welcome: theme => `

State of the art. At home.

Strata runs AI on your own computer.
Setting it up takes a few minutes.

${check}Private${check}Fast${check}Easy to use
`, where: theme => `

Where should Strata go?

This is the right place for most people.

${folder}
Your Strata folderC:\\Users\\Alex\\AppData\\Local\\Strata

About 310 MB. Your models and chats are kept somewhere else and are never removed by an update.

`, installing: theme => `

Installing Strata…

Copying the app and its engine room. You can keep working meanwhile.

62% · 190 / 310 MB
About 1 min left
`, done: theme => `

Strata is ready.

Open it to pick your first model. Strata downloads it for you and gets it ready.

`, }; const page = (name, theme) => `
Strata setup– ☐ ✕
${screens[name](theme)}
`; const browser = await chromium.launch({ executablePath: CHROME, headless: true }); const written = []; for (const theme of ['light', 'dark']) { for (const name of Object.keys(screens)) { const tab = await browser.newPage({ viewport: { width: 860, height: 620 }, deviceScaleFactor: 1 }); await tab.setContent(page(name, theme)); await tab.waitForTimeout(250); const file = join(out, `${name}-${theme}.png`); await tab.screenshot({ path: file }); written.push(file); await tab.close(); } } await browser.close(); console.log(written.join('\n'));