{"schemaVersion":1,"slug":"app","kind":"starter","version":"0.1.0","files":[{"path":".env.example","sha256":"824cbbb2de3f4e099a76f8c0e07496b89d223a4c878cf8d03702d3ffee50d552","content":"# Copy to .env.local for the local development walkthrough.\nLAYQ_DEV_LOGIN=1\nLAYQ_DB_PATH=.layq/workspace.sqlite\nLAYQ_OUTBOX_DIR=.layq/outbox\n# Optional server-only test credential, used only by the explicit Stripe test command.\nSTRIPE_TEST_SECRET_KEY=\n"},{"path":".gitignore","sha256":"a7003609559750dfc36e091eee0b364fca1eae172e6a9735763a8df873635bdd","content":"node_modules/\n.next/\n.layq/outbox/\n.env*\n!.env.example\n*.sqlite*\n"},{"path":".layq/create-starter.mjs","sha256":"f89d4e2d70366f8527542b6fe338fd98cdfb8f99423eab434bbac54d1d1d5472","content":"import { cp, lstat, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from 'node:fs/promises';\nimport { basename, dirname, join, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst cli = fileURLToPath(import.meta.url);\nconst embedded = basename(dirname(cli)) === '.layq';\nconst templates = resolve(dirname(cli), embedded ? 'templates' : '../templates');\nconst [kind, destination, ...extra] = process.argv.slice(2);\nif (!(embedded ? ['subapp'] : ['app', 'subapp']).includes(kind) || !destination || extra.length) {\n  console.error(embedded ? 'Usage: npm run subapp -- <new-directory>' : 'Usage: node scripts/create-starter.mjs <app|subapp> <new-directory>');\n  process.exit(2);\n}\nconst target = resolve(destination);\n\n// Only template source belongs in a customer's project, even when a maintainer\n// has built or tested a template in place.\nconst localOnly = new Set(['.git', 'node_modules', '.next', 'dist', '.layq', '.DS_Store', 'coverage'])\nconst sourceCopy = {\n  recursive: true,\n  async filter(source) {\n    const name = basename(source)\n    if (localOnly.has(name) || (name.startsWith('.env') && name !== '.env.example') || /\\.sqlite(?:$|-)/.test(name)) return false\n    if ((await lstat(source)).isSymbolicLink()) throw new Error('Template contains a symbolic link: ' + name)\n    return true\n  }\n}\n\nasync function compose(kind, directory, name) {\n  for (const layer of ['shared', kind]) {\n    await cp(join(templates, layer), directory, sourceCopy);\n  }\n  const manifestPath = join(directory, 'package.json');\n  const manifest = JSON.parse(await readFile(manifestPath, 'utf8'));\n  const slug = name.toLowerCase().replace(/[^a-z0-9-]+/g, '-').replace(/^-+|-+$/g, '') || kind;\n  if (kind === 'subapp') {\n    manifest.name = 'layq-subapp-' + slug;\n    const descriptorPath = join(directory, 'layq-manifest.json');\n    const descriptor = JSON.parse(await readFile(descriptorPath, 'utf8'));\n    descriptor.id = slug;\n    await writeFile(descriptorPath, JSON.stringify(descriptor, null, 2) + '\\n');\n  } else {\n    await compose('subapp', join(directory, 'modules/activity'), 'activity');\n    const kit = join(directory, '.layq');\n    await mkdir(kit, { recursive: true });\n    await cp(cli, join(kit, 'create-starter.mjs'));\n    for (const layer of ['shared', 'subapp']) {\n      await cp(join(templates, layer), join(kit, 'templates', layer), sourceCopy);\n    }\n    manifest.scripts.subapp = 'node .layq/create-starter.mjs subapp';\n  }\n  await writeFile(manifestPath, JSON.stringify(manifest, null, 2) + '\\n');\n}\n\nlet stage;\nlet reserved = false;\ntry {\n  // Safe even when a consumer chooses a nested destination such as extensions/notes.\n  await mkdir(dirname(target), { recursive: true });\n  stage = await mkdtemp(join(dirname(target), '.layq-stage-'));\n  await compose(kind, stage, basename(target));\n  await mkdir(target);\n  reserved = true;\n  for (const entry of await readdir(stage)) {\n    await cp(join(stage, entry), join(target, entry), { recursive: true, force: false, errorOnExist: true });\n  }\n  console.log('Created ' + kind + ' starter at ' + target);\n} catch (error) {\n  if (reserved) console.error('Generation stopped while copying. Inspect the partial destination at ' + target);\n  console.error(error.code === 'EEXIST' ? 'Destination already exists. Choose a new directory.' : error.message);\n  process.exitCode = 1;\n} finally {\n  if (stage) await rm(stage, { recursive: true, force: true });\n}\n"},{"path":".layq/templates/shared/.gitignore","sha256":"17f54081f1f2833beec41a97a779072c85e9ae928cb236d0fd4ddc141a47894d","content":"node_modules/\n.env\n.env.*\n!.env.example\n.DS_Store\ncoverage/\n"},{"path":".layq/templates/shared/design-tokens.css","sha256":"149e171e5d7301b4c4b93b7174952ecb5e152fb53afe940058e8194fc3e5caa6","content":":root {\n  --layq-ink: #182027;\n  --layq-primary: #1b232b;\n  --layq-primary-hover: #37444f;\n  --layq-paper: #f7f9fa;\n  --layq-line: #d6dce1;\n  --layq-accent: #415e75;\n  --layq-accent-hover: #2e4a61;\n  --layq-accent-soft: #e6edf2;\n  --layq-accent-on-dark: #b7cbdc;\n  --layq-muted: #4a5c69;\n  --layq-border-strong: #8294a4;\n  --layq-focus: #426986;\n}\n"},{"path":".layq/templates/shared/engineering/database.md","sha256":"6c7943a97cfcad8bb5f482c3a671f92fa1f0fbb1ec7a8a0f6aa7774017968037","content":"# Database\n\nThe generated SaaS host uses a local SQLite file for its workspace. The standalone child requires no database. External database services and credentials are optional. When a feature needs persistence, document the schema owner, tables, keys, relationships and constraints. Keep ordered migration files in version control with the code that reads them.\n\nUse independent local, preview and production databases and separate credentials. Validate a migration on a disposable database with representative synthetic data. For destructive changes, use an expand/backfill/contract sequence and record the recovery point. Rehearse rollback through a down migration where safe, a corrective migration, or restoration of a verified backup. Record the compatibility window for older application versions.\n"},{"path":".layq/templates/shared/engineering/git.md","sha256":"d4d3ac96ca43d15c99c333925ce7dbcc454dba62dff029bb7a65f91b645ea767","content":"# Git\n\nBranch from the intended base using a descriptive name such as feature/activity-view. Keep a behavior change and its checks together. Use imperative commit subjects and explain compatibility or migration decisions in the body.\n\nFor review, list the user-visible change, the affected host or child entry, checks actually run and any rollout steps. Keep credentials and local environment files out of commits. Record breaking changes in the version's change notes before tagging.\n"},{"path":".layq/templates/shared/engineering/i18n.md","sha256":"72a7142a8ed0e20f1f651e15d77d9b8d0e0cdc43e2f19eeea20bf2c52e3aa983","content":"# Internationalization\n\nEnglish is the fallback. Ship changes to English, Simplified Chinese, Spanish and Japanese in the same change. Translate field labels, validation, status messages, keyboard instructions and accessible names alongside the visible controls. Keep IDs, field names and commands stable across languages.\n\nFor the portable preview and activity component, edit src/locales.mjs. Use named keys and a full sentence with the {productName} placeholder so each language controls word order. Add language names and update the child manifest when the supported set changes. The Next host's page catalog lives in app/messages.mjs. Pass the resolved locale to each child in config.locale.\n\nRun `npm run test:unit` to check locale key coverage, placeholders and the English fallback. Run `npm run test:smoke` to check language links, localized document titles and missing-route responses through HTTP. Then open the host workspace and verify the mounted section follows its language selector.\n\nUse Intl for dates, currencies and numbers. Test a long translation at a 390 CSS-pixel viewport, an unsupported locale and one validation error. In the host, also exercise a sign-in message and a workspace action in the selected language.\n"},{"path":".layq/templates/shared/engineering/README.md","sha256":"fd1eb85bb633d7f372dc0fab5c3255c441ce67942e5da35c834d05922eae636e","content":"# Engineering skills\n\nThese portable project guides can be read by a developer, Codex, or Claude Code. Open the guide that applies to the change. They are ordinary Markdown and require no agent installation.\n\n- [Spec](spec.md) defines scope and acceptance cases.\n- [Git](git.md) records a reviewable change.\n- [Database](database.md) covers optional persistent storage.\n- [Test](test.md) checks behavior at three levels.\n- [Release](release.md) prepares a version and rollback.\n- [Internationalization](i18n.md) keeps the host and its children consistent across four languages.\n"},{"path":".layq/templates/shared/engineering/release.md","sha256":"6ecd46d8d234e2272956df5d7c1866c2d2d5861faafb3b4c2099796ce0ca5c34","content":"# Release\n\nRun `npm test` from the project root. For a SaaS host, use `npm run dev` for the local workspace, then `npm run build` and `npm start` to inspect the production build locally. For a child, use `npm run preview` for the isolated module. The local servers bind to loopback. Set PORT to choose another port. Keep any future secret values outside source control and document each variable's purpose and required environments.\n\nRecord the version in package.json and note user-visible changes and compatibility requirements. Verify the exact candidate with preview-specific configuration. Keep the previous version, its config contract and any migration recovery steps available.\n\nProduction promotion is a separate operator decision. Deploy the reviewed version through the consuming team's hosting process, smoke-test it and record the version. To roll back, restore the last verified version and compatible configuration, then repeat the smoke check. Coordinate database recovery before rolling back across a schema change.\n\n## Verifiable release receipt\n\nKeep a dated receipt in the consuming team's release records. Identify the component, environment, operator and version (`node -p \"require('./package.json').version\"`). Record the full source commit from `git rev-parse HEAD` and check `git status --short` for uncommitted inputs. Run `npm run release:check` from the project root. For the host this runs the suite and builds the Next application. For a child it runs the suite and lists package contents locally. For an actual release artifact, record its checksum and retain the artifact or immutable retrieval reference.\n\n| State | Evidence to collect |\n| --- | --- |\n| Registered | The candidate version and commit appear together in the chosen release ledger. Read the entry back and record its identifier. |\n| Published | The intended destination serves the selected version. Retrieve its immutable artifact or deployment metadata, compare the checksum or source revision and record the destination and timestamp. |\n| Health passed | Request a real route on that published version. Record the environment, URL, timestamp, HTTP status and expected content or behavior observed. For a child, check its mounted section in the host. |\n\nA local dry run supports preflight only. Mark each state pending until its evidence exists. To roll back, record the previous verified receipt, restore its exact artifact and configuration through the operator's normal process, and verify the live revision and route again. Append the outcome and timestamps to the receipt so the superseded version remains traceable.\n"},{"path":".layq/templates/shared/engineering/spec.md","sha256":"92de7b7c08e6fc078d4ad0588af26c43589a937505feaa009d6ee745b81ed355","content":"# Spec\n\nBefore changing behavior, write the user outcome, current limitation and observable goal in the change description. List non-goals so reviewers can identify work outside the change.\n\nExpress each acceptance case as a starting state, an action and an observable result. Include an ordinary path and a failure or empty state. For a configuration change, pass the host a dark theme and verify the mounted entry inherits it. Record the command or manual steps that demonstrate each case.\n"},{"path":".layq/templates/shared/engineering/test.md","sha256":"b15b1c3782403a1be30e411eef2f392e1d969b53e2c2095e8886b5ee23dfd055","content":"# Test\n\nUse the Node version declared by the generated project's package.json. Run npm ci when a lockfile is present or npm install to create one. Commit the resulting lockfile.\n\n| Check | What to verify |\n| --- | --- |\n| Unit | Run `npm run test:unit` for isolated functions and rejected input. |\n| Integration | Run `npm run test:integration` to verify module boundaries and supplied configuration. |\n| Smoke | Run `npm run test:smoke` to exercise the project entry and its expected response. |\n| Local suite | Run `npm test` from the project root. See the entry's README or AGENTS.md for setup. |\n\nFor a host contract change, mount each affected child under the host and check its rendered output. From the generated host, run `npm --prefix modules/activity test` to isolate the bundled child. Run the host checks and verify its workspace also displays that module. For a child-only change, start with its own unit, integration and smoke suites before checking the host preview.\n\nFollow the [internationalization guide](i18n.md) when a change affects user-facing text.\n"},{"path":".layq/templates/shared/preview.mjs","sha256":"2cb15239733b6e3319112e7951936b29399a30772fd62f70880975557fe40a5a","content":"import { createServer } from 'node:http';\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { createElement } from 'react';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport App from './src/index.mjs';\nimport { languageNames, messages, resolveLocale } from './src/locales.mjs';\n\nexport function createPreview(config = {}) {\n  return createServer((request, response) => {\n    const url = new URL(request.url, 'http://localhost');\n    const locale = resolveLocale(url.searchParams.get('lang') ?? config.locale);\n    const t = messages[locale];\n    if (url.pathname !== '/') {\n      response.writeHead(404, { 'content-type': 'text/plain; charset=utf-8', 'content-language': locale }).end(t.missing);\n      return;\n    }\n    const navigation = createElement('nav', { 'aria-label': t.language },\n      Object.entries(languageNames).map(([key, name]) => createElement('a', {\n        key, href: '?lang=' + key, lang: key, 'aria-current': key === locale ? 'page' : undefined\n      }, name + ' '))\n    );\n    const page = createElement('html', { lang: locale },\n      createElement('head', null,\n        createElement('meta', { charSet: 'utf-8' }),\n        createElement('meta', { name: 'viewport', content: 'width=device-width,initial-scale=1' }),\n        createElement('title', null, t.preview)\n      ),\n      createElement('body', null, navigation, createElement(App, { config: { ...config, locale } }))\n    );\n    response.writeHead(200, { 'content-type': 'text/html; charset=utf-8', 'content-language': locale });\n    response.end('<!doctype html>' + renderToStaticMarkup(page));\n  });\n}\nif (process.argv[1] && pathToFileURL(resolve(process.argv[1])).href === import.meta.url) {\n  const server = createPreview();\n  server.listen(Number(process.env.PORT || 4173), '127.0.0.1', () => {\n    console.log('Preview at http://127.0.0.1:' + server.address().port);\n  });\n}\n"},{"path":".layq/templates/shared/src/config.mjs","sha256":"fbb9e32c0286901e90212980db8fb8c659717f1b67e9e39ff8c9ff8187e15c9e","content":"import { messages, resolveLocale } from './locales.mjs';\n\nexport function resolveConfig(config = {}) {\n  const theme = config.theme ?? 'light';\n  if (!['light', 'dark'].includes(theme)) throw new Error('Theme must be light or dark.');\n  const locale = resolveLocale(config.locale);\n  return { theme, locale, productName: config.productName ?? messages[locale].workspace };\n}\n"},{"path":".layq/templates/shared/src/locales.mjs","sha256":"dda2f7dc391015014320052bc6527d6a9783710875ff2b2c8b62167483064119","content":"export const messages = {\n  en: {\n    heading: 'Activity', updates: 'Updates for {productName}', workspace: 'Workspace',\n    preview: 'App preview', missing: 'Page not found', language: 'Language'\n  },\n  'zh-CN': {\n    heading: '动态', updates: '{productName}的最新动态', workspace: '工作区',\n    preview: '应用预览', missing: '找不到页面', language: '语言'\n  },\n  es: {\n    heading: 'Actividad', updates: 'Novedades de {productName}', workspace: 'Espacio de trabajo',\n    preview: 'Vista previa', missing: 'Página no encontrada', language: 'Idioma'\n  },\n  ja: {\n    heading: 'アクティビティ', updates: '{productName}の最新情報', workspace: 'ワークスペース',\n    preview: 'アプリのプレビュー', missing: 'ページが見つかりません', language: '言語'\n  }\n};\n\nexport const languageNames = { en: 'English', 'zh-CN': '简体中文', es: 'Español', ja: '日本語' };\nexport function resolveLocale(value) {\n  return typeof value === 'string' && Object.hasOwn(messages, value) ? value : 'en';\n}\n"},{"path":".layq/templates/shared/test/integration.test.mjs","sha256":"e886ed1af43ade22a6393bd06eece17937c3f96a9e3153b6b747fb379a8ac0cd","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { createElement } from 'react';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport App from '../src/index.mjs';\ntest('renders the local entry using the supplied configuration', () => {\n  const html = renderToStaticMarkup(createElement(App, { config: { productName: 'Research & Design', theme: 'dark' } }));\n  assert.match(html, /Research &amp; Design/);\n  assert.match(html, /data-theme=\"dark\"/);\n});\n"},{"path":".layq/templates/shared/test/smoke.test.mjs","sha256":"7e0fbb4842800b6d7cc6786c4262e6e0b200309727b354fe37a9838788352f3d","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { once } from 'node:events';\nimport { createPreview } from '../preview.mjs';\ntest('serves the application and a missing-route response', async t => {\n  const server = createPreview();\n  t.after(() => new Promise(resolve => server.close(resolve)));\n  server.listen(0, '127.0.0.1');\n  await once(server, 'listening');\n  const url = 'http://127.0.0.1:' + server.address().port;\n  const page = await fetch(url);\n  assert.equal(page.status, 200);\n  assert.match(await page.text(), /Workspace/);\n  assert.equal((await fetch(url + '/missing')).status, 404);\n});\n\ntest('preview links select each supported locale and translate missing routes', async t => {\n  const { messages } = await import('../src/locales.mjs');\n  const server = createPreview();\n  t.after(() => new Promise(resolve => server.close(resolve)));\n  server.listen(0, '127.0.0.1');\n  await once(server, 'listening');\n  const origin = 'http://127.0.0.1:' + server.address().port;\n  for (const [locale, copy] of Object.entries(messages)) {\n    const page = await fetch(origin + '/?lang=' + locale);\n    assert.equal(page.headers.get('content-language'), locale);\n    const html = await page.text();\n    assert.ok(html.includes('<html lang=\"' + locale + '\">'));\n    assert.ok(html.includes('<title>' + copy.preview + '</title>'));\n    assert.ok(html.includes(copy.workspace));\n    for (const key of Object.keys(messages)) assert.ok(html.includes('href=\"?lang=' + key + '\"'));\n    const missing = await fetch(origin + '/missing?lang=' + locale);\n    assert.equal(missing.status, 404);\n    assert.equal(await missing.text(), copy.missing);\n  }\n  const fallback = await fetch(origin + '/?lang=unknown');\n  assert.equal(fallback.headers.get('content-language'), 'en');\n});\n"},{"path":".layq/templates/shared/test/unit.test.mjs","sha256":"09bf88759e8412280650c297332736605d10a52bb0d37003c2bb193037cea861","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { resolveConfig } from '../src/config.mjs';\ntest('validates the theme and fills missing defaults', () => {\n  assert.deepEqual(resolveConfig({ theme: 'dark' }), { theme: 'dark', productName: 'Workspace', locale: 'en' });\n  assert.throws(() => resolveConfig({ theme: 'pink' }), /Theme/);\n});\n\ntest('all locales define each English message and one product-name slot', async () => {\n  const { messages, languageNames, resolveLocale } = await import('../src/locales.mjs');\n  assert.deepEqual(Object.keys(messages).sort(), ['en', 'es', 'ja', 'zh-CN']);\n  for (const [locale, values] of Object.entries(messages)) {\n    assert.equal(resolveLocale(locale), locale);\n    assert.ok(languageNames[locale]);\n    assert.deepEqual(Object.keys(values).sort(), Object.keys(messages.en).sort());\n    assert.ok(Object.values(values).every(value => typeof value === 'string' && value.trim()));\n    assert.equal(values.updates.split('{productName}').length, 2);\n  }\n  for (const unsupported of ['de', undefined, 'constructor']) {\n    assert.equal(resolveLocale(unsupported), 'en');\n  }\n});\n"},{"path":".layq/templates/subapp/AGENTS.md","sha256":"1d591bd02e91bc5e8c0ab722e9328231ec305f8f53fdd5a9ff3f1f347595de9c","content":"# Sub-application\n\nThis entry owns an activity section. The host owns navigation, global styling, routing and production promotion. Read the [shared engineering guides](engineering/README.md) for the relevant change.\n\nMount the default React component in [src/index.mjs](src/index.mjs) through the host's modules array. It receives the host's resolved productName, theme and locale in a config prop and can render alone using local defaults. Keep child-specific options scoped to this entry and coordinate changes to the config contract with host maintainers.\n\nRun npm install, npm test and npm run preview in this directory for isolated checks. Record the child version and its compatible host contract. To release, hand the reviewed child version to the host, update its import or pinned package version and verify the mounted section in host preview. Revert that selection to roll back the child. The local preview does not promote the host.\n\nThe [child manifest](layq-manifest.json) declares the module path relative to this directory, the React export, capabilities, inherited settings and local commands. From the child root, use `npm run release:check` to run the complete suite and inspect the package file list. Review that list before handing the release candidate to the host.\n"},{"path":".layq/templates/subapp/layq-manifest.json","sha256":"b11315df2ab0af11f4f628f229589f0b8d20e86f791b2fe2956a5461a8ba7c20","content":"{\n  \"manifestVersion\": 1,\n  \"id\": \"activity\",\n  \"entry\": \"./src/index.mjs\",\n  \"export\": \"default\",\n  \"capabilities\": [\"render-activity-section\"],\n  \"inherits\": [\"productName\", \"theme\", \"locale\"],\n  \"locales\": [\"en\", \"zh-CN\", \"es\", \"ja\"],\n  \"fallbackLocale\": \"en\",\n  \"commands\": {\n    \"test\": \"npm test\",\n    \"releasePreflight\": \"npm run release:check\"\n  }\n}\n"},{"path":".layq/templates/subapp/package.json","sha256":"66a565067c4e63d7efdfaf9c98ce68f80a293950998c2c778e4fbd71e61a11a3","content":"{\n  \"name\": \"layq-starter\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": \"./src/index.mjs\",\n  \"engines\": { \"node\": \">=20\" },\n  \"scripts\": {\n    \"release:check\": \"npm test && npm pack --dry-run --ignore-scripts\",\n    \"preview\": \"node preview.mjs\",\n    \"test\": \"node --test test/*.test.mjs\",\n    \"test:unit\": \"node --test test/unit.test.mjs\",\n    \"test:integration\": \"node --test test/integration.test.mjs\",\n    \"test:smoke\": \"node --test test/smoke.test.mjs\"\n  },\n  \"dependencies\": { \"react\": \"^19.2.0\", \"react-dom\": \"^19.2.0\" }\n}\n"},{"path":".layq/templates/subapp/README.md","sha256":"fb30b8fe094fa4d07fabe5a2b7153958138dae87ed60a3dbd3f4781cf512d7ca","content":"# Activity module\n\nMount the default React export from src/index.mjs with a config object containing productName, theme and locale. It supports English (en), Simplified Chinese (zh-CN), Spanish (es) and Japanese (ja). Missing or unsupported locales use English. The optional labels prop can override heading and updates. Use the {productName} placeholder in a full translated sentence to preserve word order.\n\nRun `npm install`, `npm test` and `npm run preview` in this directory. Select a language using the links in the preview, or open /?lang=ja directly. See the [engineering guides](engineering/README.md) and [machine-readable contract](layq-manifest.json).\n"},{"path":".layq/templates/subapp/src/index.mjs","sha256":"9b08beccf8150c63d0520c8fb4c2b23b43aeaefcd4ae0e9d2eff6ec3ed8dae64","content":"import { createElement as h } from 'react';\nimport { resolveConfig } from './config.mjs';\nimport { messages } from './locales.mjs';\n\nexport default function SubApp({ config: hostConfig, labels } = {}) {\n  const config = resolveConfig(hostConfig);\n  const heading = labels?.heading ?? messages[config.locale].heading;\n  const template = labels?.updates ?? messages[config.locale].updates;\n  const updates = template.includes('{productName}')\n    ? template.replace('{productName}', () => config.productName)\n    : template + ' ' + config.productName;\n  return h('section', { 'aria-label': heading, lang: config.locale, 'data-theme': config.theme },\n    h('h2', null, heading),\n    h('p', null, updates)\n  );\n}\n"},{"path":"AGENTS.md","sha256":"8979743269a12e5e74ca1ad117091369f04605692b1f7f52fabfe7e95aa1e2df","content":"# Main application\n\nRead engineering/README.md for the specification, Git, database, testing, release and internationalization workflows. Make a first change by adding a brief field, validating it at the API boundary, preserving existing rows, and writing a persistence test. Run npm test and npm run build before delivery.\n\nThe Next.js host owns routing, session checks and data access. The component in modules/activity declares its capabilities in layq-manifest.json and receives explicit host configuration. Keep child-specific behavior and tests in that module. Additional generated modules require an explicit import at the desired mount point.\n\nUse .env.example for a loopback development walkthrough. Production identity is a separate integration. Never publish local demo access, database files, session tokens, outbox data or live integration credentials.\n"},{"path":"app/api/auth/magic/confirm/route.js","sha256":"f3a408a213cbf2826c0e5b89113d53d051f68641c3e339442fd92ac045f295e6","content":"import { handleMagic } from \"../../../../../lib/magic-http.mjs\";\nexport function POST(request) {\n  return handleMagic(request, true);\n}\n"},{"path":"app/api/auth/magic/route.js","sha256":"d3734adf0ecaccdea3baf9092723d0c01729956daf965f66728dd17ecbb34569","content":"import { handleMagic } from \"../../../../lib/magic-http.mjs\";\nexport function POST(request) {\n  return handleMagic(request, false);\n}\n"},{"path":"app/api/briefs/[id]/route.js","sha256":"03fe1e17e928662b82b0f354f24714c1af58478cb34aa8b90bd9898b9a5eeb4b","content":"import { briefs } from \"../../../../lib/http.mjs\";\nexport async function PATCH(request, { params }) {\n  return briefs(request, (await params).id);\n}\nexport async function DELETE(request, { params }) {\n  return briefs(request, (await params).id);\n}\n"},{"path":"app/api/briefs/route.js","sha256":"7b3b5a0cde8f3a4813a5bd55dc599e04084cf97bce3dabaeb5179f563a860e7b","content":"import { briefs } from \"../../../lib/http.mjs\";\nexport function GET(request) {\n  return briefs(request);\n}\nexport function POST(request) {\n  return briefs(request);\n}\n"},{"path":"app/api/health/route.js","sha256":"7a6eb5d09dbc5d5750b30425d5435fdcaf6c126481464d3fe65f7e706a6218b0","content":"export const dynamic = \"force-dynamic\";\nexport function GET() {\n  return Response.json(\n    { status: \"ok\", service: \"layq-starter\" },\n    { headers: { \"Cache-Control\": \"no-store\" } },\n  );\n}\n"},{"path":"app/api/rehearsal/[action]/route.js","sha256":"3e98e99674a598f1aab8cfdc8a08a2ea721793ba55b561a727cf96c0d73ba591","content":"import { cookieName, developmentLoginEnabled } from '../../../../lib/access.mjs'\nimport { openStore } from '../../../../lib/storage.mjs'\nimport { json, fail, validWrite } from '../../../../lib/http.mjs'\n\nasync function handle(request, { params }) {\n  if (!developmentLoginEnabled(request.headers.get('host'))) return fail('local_only', 404)\n  const { action } = await params\n  const methods = { order: 'POST', receipt: 'POST', webhook: 'POST', report: 'GET', status: 'GET' }\n  if (!Object.hasOwn(methods, action)) return fail('unknown_action', 404)\n  if (methods[action] !== request.method) return fail('method_not_allowed', 405)\n  if (action !== 'webhook' && request.method === 'POST') {\n    const denied = validWrite(request)\n    if (denied) return denied\n  }\n  const store = openStore()\n  try {\n    if (action === 'webhook') {\n      if (!request.headers.has('stripe-signature')) return fail('invalid_signature', 400)\n      return json(\n        store.billing().receive(await request.text(), request.headers.get('stripe-signature')),\n      )\n    }\n    const owner = store.session(request.cookies.get(cookieName)?.value)\n    if (!owner) return fail('session_required', 401)\n    const billing = store.billing()\n    if (action === 'status') return json(billing.status(owner))\n    if (action === 'report') return json(billing.report(owner))\n    const data = await request.json()\n    if (action === 'order') return json(billing.begin(owner, data?.attempt), 201)\n    if (typeof data?.id !== 'string') return fail('invalid_request', 400)\n    // The browser receives an already signed immutable LOCAL receipt, never the signing key.\n    return json(billing.receipt(owner, data.id))\n  } catch (error) {\n    const code = error.message\n    if (code === 'order_missing') return fail(code, 404)\n    if (code === 'access_required') return fail(code, 403)\n    if (code === 'signing_configuration') return fail(code, 503)\n    if (\n      [\n        'expired_signature',\n        'invalid_signature',\n        'invalid_event',\n        'order_mismatch',\n        'invalid_attempt',\n        'event_conflict',\n      ].includes(code)\n    )\n      return fail(code, 400)\n    if (error instanceof SyntaxError || error instanceof TypeError)\n      return fail('invalid_request', 400)\n    throw error\n  } finally {\n    store.close()\n  }\n}\nexport { handle as GET, handle as POST }\n"},{"path":"app/api/session/route.js","sha256":"ed2bfb4942025463ede4f644c6a3a93e60c30fd60d1e256600b42e3f67bf557a","content":"import { cookieName, developmentLoginEnabled } from \"../../../lib/access.mjs\";\nimport { openStore, sessionSeconds } from \"../../../lib/storage.mjs\";\nimport { fail, json, validWrite } from \"../../../lib/http.mjs\";\n\nfunction sessionWriteError(request) {\n  const error = validWrite(request);\n  if (error) return error;\n  if (!developmentLoginEnabled(request.headers.get(\"host\")))\n    return fail(\n      \"Local sign-in requires a loopback development server and LAYQ_DEV_LOGIN=1.\",\n      403,\n    );\n  return null;\n}\n\nexport function POST(request) {\n  const error = sessionWriteError(request);\n  if (error) return error;\n  const store = openStore();\n  try {\n    const response = json({ ok: true });\n    response.cookies.set(cookieName, store.login(), {\n      httpOnly: true,\n      sameSite: \"strict\",\n      path: \"/\",\n      maxAge: sessionSeconds,\n    });\n    return response;\n  } finally {\n    store.close();\n  }\n}\nexport function DELETE(request) {\n  const error = sessionWriteError(request);\n  if (error) return error;\n  const token = request.cookies.get(cookieName)?.value;\n  if (!token) return json({ ok: true });\n  const store = openStore();\n  try {\n    store.logout(token);\n    const response = json({ ok: true });\n    response.cookies.delete(cookieName);\n    return response;\n  } finally {\n    store.close();\n  }\n}\n"},{"path":"app/auth/magic/page.jsx","sha256":"528d32ba657f1a2acc14e56efab10cd3f62674664cd0e8da9d62492b585e14ae","content":"import { notFound } from \"next/navigation\";\nimport { canUseDevelopmentLogin } from \"../../../lib/workspace-session.mjs\";\nimport { magicCopy } from \"../../../lib/magic-copy.mjs\";\nimport { getLanguage } from \"../../language.mjs\";\nimport { Brand } from \"../../components/brand\";\nimport { MagicAccess } from \"../../components/magic-access\";\n\nexport const metadata = {robots:{index:false,follow:false},referrer:\"no-referrer\"};\nexport default async function ConfirmSignIn() {\n  if (!(await canUseDevelopmentLogin())) notFound();\n  const t = magicCopy[await getLanguage()];\n  return <main className=\"site\"><header className=\"nav\"><Brand/></header>\n    <section className=\"work-head\"><h1>{t.confirmTitle}</h1><MagicAccess t={t} confirm/><a className=\"text-link\" href=\"/\">{t.retry}</a></section>\n  </main>;\n}\n"},{"path":"app/components/access.jsx","sha256":"43e148e3e8351f4e4ec40e86251b4cf57aa01bf3f509f29bf02839286723869b","content":"\"use client\";\nimport { useState } from \"react\";\nexport function Access({ enabled, t, signOut = false }) {\n  const [busy, setBusy] = useState(false);\n  const [error, setError] = useState(\"\");\n  async function enter() {\n    setBusy(true);\n    setError(\"\");\n    try {\n      const response = await fetch(\"/api/session\", {\n        method: signOut ? \"DELETE\" : \"POST\",\n        headers: { \"Content-Type\": \"application/json\" },\n        body: signOut ? undefined : \"{}\",\n      });\n      if (!response.ok)\n        throw new Error(\n          (await response.json()).error || \"Session unavailable.\",\n        );\n      window.location.assign(signOut ? \"/\" : \"/workspace\");\n    } catch (e) {\n      setError(t.sessionError);\n      setBusy(false);\n    }\n  }\n  return (\n    <div className=\"access\">\n      <button\n        disabled={busy || !enabled}\n        onClick={enter}\n        className={signOut ? \"quiet\" : \"button primary\"}\n      >\n        {busy ? t.wait : signOut ? t.exit : enabled ? t.enter : t.disabled}\n      </button>\n      {error && (\n        <span className=\"error\" role=\"alert\">\n          {error}\n        </span>\n      )}\n    </div>\n  );\n}\n"},{"path":"app/components/billing.jsx","sha256":"d2b40821ada928df92bcd2a0331c2821cd644b278d7b59cde5a7cf4dd4f5855b","content":"'use client'\nimport { useEffect, useState } from 'react'\n\nconst copy = {\n  en: [\n    'Payment rehearsal',\n    'Start a sample order, deliver its signed receipt, then open the report it unlocks. All three steps run on this machine.',\n    'Create test order',\n    'Deliver receipt',\n    'Read my report',\n    'Deliver again',\n    'Order pending',\n    'Receipt recorded',\n    'Duplicate ignored',\n    'Settled test orders',\n    'Could not complete this step. Retry or sign in again.',\n    'Rehearsal amount',\n    'Start another order',\n  ],\n  'zh-CN': [\n    '支付演练',\n    '创建示例订单，投递带签名的回执，再查看解锁的报表。三个步骤均在本机执行。',\n    '创建测试订单',\n    '投递回执',\n    '查看我的报表',\n    '再次投递',\n    '订单待确认',\n    '回执已入账',\n    '已忽略重复回执',\n    '已结算测试订单',\n    '操作未完成，请重试或重新登录。',\n    '演练金额',\n    '新建一笔订单',\n  ],\n  es: [\n    'Ensayo de pago',\n    'Crea un pedido de prueba, entrega el recibo firmado y abre el informe que desbloquea. Todo ocurre en este equipo.',\n    'Crear pedido de prueba',\n    'Entregar recibo',\n    'Ver mi informe',\n    'Volver a entregar',\n    'Pedido pendiente',\n    'Recibo registrado',\n    'Duplicado ignorado',\n    'Pedidos de prueba liquidados',\n    'No se completó el paso. Reintenta o inicia sesión.',\n    'Importe de prueba',\n    'Crear otro pedido',\n  ],\n  ja: [\n    '決済リハーサル',\n    'テスト注文を作成し、署名付きの受領通知を送ってレポートを開きます。すべてこの端末で実行されます。',\n    'テスト注文を作成',\n    '受領通知を送信',\n    'レポートを表示',\n    '再送信',\n    '注文は確認待ちです',\n    '受領通知を記録しました',\n    '重複を除外しました',\n    '処理済みのテスト注文',\n    '操作を完了できませんでした。再試行するか、もう一度ログインしてください。',\n    'テスト金額',\n    '別の注文を作成',\n  ],\n}\nasync function call(action, options = {}) {\n  const response = await fetch('/api/rehearsal/' + action, options)\n  if (!response.ok) throw Error(String(response.status))\n  return response.json()\n}\nconst post = (data) => ({\n  method: 'POST',\n  headers: { 'content-type': 'application/json' },\n  body: JSON.stringify(data),\n})\nexport function Billing({ locale }) {\n  const t = copy[locale] || copy.en\n  const [attempt, setAttempt] = useState('')\n  const [order, setOrder] = useState('')\n  const [settled, setSettled] = useState(false)\n  const [report, setReport] = useState(null)\n  const [entitled, setEntitled] = useState(false)\n  const [busy, setBusy] = useState(true)\n  const [notice, setNotice] = useState('')\n  useEffect(() => {\n    let active = true\n    call('status')\n      .then((data) => {\n        if (!active) return\n        setOrder(data.latest?.id || '')\n        setSettled(!!data.latest?.paid)\n        setEntitled(data.entitled)\n      })\n      .catch(() => {\n        if (active) setNotice(t[10])\n      })\n      .finally(() => {\n        if (active) setBusy(false)\n      })\n    return () => {\n      active = false\n    }\n  }, [t])\n  async function act(step) {\n    setBusy(true)\n    try {\n      if (step === 'order') {\n        const id = attempt || crypto.randomUUID()\n        setAttempt(id)\n        const data = await call('order', post({ attempt: id }))\n        setOrder(data.id)\n        setSettled(data.paid)\n        setReport(null)\n        setNotice(t[6])\n      } else if (step === 'receipt') {\n        const receipt = await call('receipt', post({ id: order }))\n        const data = await call('webhook', {\n          method: 'POST',\n          headers: { 'stripe-signature': receipt.header },\n          body: receipt.raw,\n        })\n        setSettled(true)\n        setEntitled(true)\n        setAttempt('')\n        setNotice(t[data.status === 'duplicate' ? 8 : 7])\n      } else {\n        setReport(await call('report'))\n        setNotice('')\n      }\n    } catch {\n      setNotice(t[10])\n    } finally {\n      setBusy(false)\n    }\n  }\n  return (\n    <section className=\"rehearsal\">\n      <h2>{t[0]}</h2>\n      <p>{t[1]}</p>\n      <div>\n        <button disabled={busy || (!!order && !settled)} onClick={() => act('order')}>\n          {t[settled ? 12 : 2]}\n        </button>\n        <button disabled={busy || !order} onClick={() => act('receipt')}>\n          {t[settled ? 5 : 3]}\n        </button>\n        <button disabled={busy || !entitled} onClick={() => act('report')}>\n          {t[4]}\n        </button>\n      </div>\n      <p role=\"status\">\n        {notice}{' '}\n        {report && (\n          <>\n            {t[9]} · {report.orders}{' '}\n            <strong>\n              {t[11]} ·{' '}\n              {new Intl.NumberFormat(locale, { style: 'currency', currency: 'USD' }).format(\n                report.cents / 100,\n              )}\n            </strong>\n          </>\n        )}\n      </p>\n    </section>\n  )\n}\n"},{"path":"app/components/brand.jsx","sha256":"96f575cdffe99be7f3fde69014c556f43d2baa6868b02b51a28f047832d70eb6","content":"export function Brand() {\n  return (\n    <a href=\"/\" className=\"brand\" aria-label=\"LAYQ\">\n      <svg aria-hidden=\"true\" width=\"34\" height=\"34\" viewBox=\"0 0 32 32\">\n        <path\n          d=\"m3 17 10-12 6 1-10 12 7 1 10-12 5 1-14 17-14-2z\"\n          fill=\"currentColor\"\n        />\n      </svg>\n      LAYQ\n    </a>\n  );\n}\n\nexport function Terrain({ label }) {\n  const layers = Array.from({ length: 43 }, (_, i) => {\n    const points = Array.from({ length: 180 }, (_, j) => {\n      const a = (j * Math.PI) / 90;\n      const r =\n        1 +\n        0.15 * Math.cos(3 * a + 0.45) +\n        0.065 * Math.sin(5 * a - 0.9) +\n        0.09 * Math.sin(a + i * 0.045);\n      const x = Math.cos(a) * r * (179 - i * 2.04);\n      const y = Math.sin(a) * r * (106 - i * 1.17);\n      return [\n        (248 + x + 0.33 * y + i * 0.38).toFixed(2),\n        (241 + y - 0.22 * x - i * 2.62).toFixed(2),\n      ].join(\",\");\n    });\n    return (\n      <polygon\n        key={i}\n        points={points.join(\" \")}\n        fill={`hsl(0 0% ${34 + i * 1.49}%)`}\n        stroke=\"#303030\"\n        strokeWidth=\".92\"\n        strokeLinejoin=\"round\"\n      />\n    );\n  });\n  return (\n    <svg\n      className=\"terrain\"\n      viewBox=\"0 0 500 350\"\n      aria-label={label}\n      role=\"img\"\n    >\n      <defs>\n        <pattern id=\"dots\" width=\"14\" height=\"14\" patternUnits=\"userSpaceOnUse\">\n          <circle cx=\"2\" cy=\"2\" r=\".9\" fill=\"#777777\" opacity=\".42\" />\n        </pattern>\n      </defs>\n      <rect width=\"500\" height=\"350\" fill=\"url(#dots)\" />\n      {layers}\n    </svg>\n  );\n}\n"},{"path":"app/components/briefs.jsx","sha256":"bd8f741b1eb337bf74732a7239678593c2d5e39e8dc1a6d94e0c879a3ee02150","content":"\"use client\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport function Briefs({ t }) {\n  const [list, setList] = useState(null);\n  const [failed, setFailed] = useState(false);\n  const [draft, setDraft] = useState(null);\n  const [busy, setBusy] = useState(false);\n  const [error, setError] = useState(\"\");\n  const [notice, setNotice] = useState(\"\");\n  const dialog = useRef(null);\n  const load = useCallback(async () => {\n    setFailed(false);\n    setList(null);\n    try {\n      const response = await fetch(\"/api/briefs\", { cache: \"no-store\" });\n      if (!response.ok) throw Error();\n      setList((await response.json()).briefs);\n    } catch {\n      setFailed(true);\n    }\n  }, []);\n  useEffect(() => {\n    load();\n  }, [load]);\n  useEffect(() => {\n    if (draft && !dialog.current.open) dialog.current.showModal();\n  }, [draft]);\n  function begin(mode, brief = { title: \"\", body: \"\" }) {\n    setNotice(\"\");\n    setError(\"\");\n    setDraft({ ...brief, mode });\n  }\n  function close() {\n    dialog.current.close();\n    setDraft(null);\n  }\n  async function submit(event) {\n    event.preventDefault();\n    if (busy) return;\n    const deleting = draft.mode === \"delete\";\n    if (!deleting && !draft.title.trim()) {\n      setError(t.required);\n      return;\n    }\n    setBusy(true);\n    setError(\"\");\n    try {\n      const url =\n        \"/api/briefs\" +\n        (draft.id != null ? \"/\" + encodeURIComponent(draft.id) : \"\");\n      const response = await fetch(url, {\n        method: deleting ? \"DELETE\" : draft.mode === \"edit\" ? \"PATCH\" : \"POST\",\n        headers: { \"Content-Type\": \"application/json\" },\n        body: deleting\n          ? undefined\n          : JSON.stringify({ title: draft.title.trim(), body: draft.body }),\n      });\n      if (!response.ok) throw Error();\n      const payload = await response.json();\n      setList((previous) =>\n        deleting\n          ? previous.filter((item) => item.id !== draft.id)\n          : [\n              payload.brief,\n              ...previous.filter((item) => item.id !== payload.brief.id),\n            ],\n      );\n      setNotice(deleting ? t.deleted : t.saved);\n      close();\n    } catch {\n      setError(t.error);\n    } finally {\n      setBusy(false);\n    }\n  }\n  return (\n    <section className=\"briefs\">\n      <div className=\"list-heading\">\n        <h2>\n          {t.briefs} {list && <small>{list.length}</small>}\n        </h2>\n        <button\n          className=\"button primary\"\n          disabled={!list}\n          onClick={() => begin(\"create\")}\n        >\n          ＋ {t.newBrief}\n        </button>\n      </div>\n      <div role=\"status\">{notice}</div>\n      {failed ? (\n        <div className=\"empty\">\n          <p role=\"alert\">{t.error}</p>\n          <button className=\"quiet\" onClick={load}>\n            {t.retry}\n          </button>\n        </div>\n      ) : !list ? (\n        <p className=\"empty\" role=\"status\">\n          {t.loading}\n        </p>\n      ) : list.length === 0 ? (\n        <p className=\"empty\">{t.empty}</p>\n      ) : (\n        <ul className=\"brief-list\">\n          {list.map((item) => (\n            <li key={item.id}>\n              <div>\n                <h3>{item.title}</h3>\n                <p>{item.body}</p>\n              </div>\n              <div className=\"row-actions\">\n                <button\n                  className=\"quiet\"\n                  aria-label={t.edit + \" · \" + item.title}\n                  onClick={() => begin(\"edit\", item)}\n                >\n                  {t.edit}\n                </button>\n                <button\n                  className=\"quiet\"\n                  aria-label={t.remove + \" · \" + item.title}\n                  onClick={() => begin(\"delete\", item)}\n                >\n                  {t.remove}\n                </button>\n              </div>\n            </li>\n          ))}\n        </ul>\n      )}\n      <dialog\n        ref={dialog}\n        aria-labelledby=\"dialog-title\"\n        onCancel={(event) => {\n          if (busy) event.preventDefault();\n        }}\n        onClose={() => setDraft(null)}\n      >\n        {draft && (\n          <form onSubmit={submit}>\n            <h2 id=\"dialog-title\">\n              {draft.mode === \"delete\"\n                ? t.confirm\n                : draft.mode === \"edit\"\n                  ? t.editBrief\n                  : t.create}\n            </h2>\n            {draft.mode === \"delete\" ? (\n              <p>\n                {draft.title} — {t.warning}\n              </p>\n            ) : (\n              <>\n                <label>\n                  {t.title}\n                  <input\n                    autoFocus\n                    required\n                    maxLength={120}\n                    value={draft.title}\n                    onChange={(e) =>\n                      setDraft({ ...draft, title: e.target.value })\n                    }\n                  />\n                </label>\n                <label>\n                  {t.notes}\n                  <textarea\n                    rows=\"5\"\n                    maxLength={5000}\n                    value={draft.body}\n                    onChange={(e) =>\n                      setDraft({ ...draft, body: e.target.value })\n                    }\n                  />\n                </label>\n              </>\n            )}\n            {error && (\n              <p className=\"error\" role=\"alert\">\n                {error}\n              </p>\n            )}\n            <div className=\"actions\">\n              <button\n                type=\"button\"\n                className=\"quiet\"\n                onClick={close}\n                disabled={busy}\n              >\n                {t.cancel}\n              </button>\n              <button className=\"button primary\" disabled={busy}>\n                {busy ? t.wait : draft.mode === \"delete\" ? t.remove : t.save}\n              </button>\n            </div>\n          </form>\n        )}\n      </dialog>\n    </section>\n  );\n}\n"},{"path":"app/components/language.jsx","sha256":"116edc5358bc1d895c41f403a08c342957dc6a59892284781694da7cdccdeee5","content":"\"use client\";\nexport function Language({ lang, label }) {\n  return (\n    <select\n      className=\"language\"\n      aria-label={label}\n      value={lang}\n      onChange={(e) => {\n        document.cookie =\n          \"layq_locale=\" +\n          e.target.value +\n          \"; Path=/; Max-Age=31536000; SameSite=Lax\";\n        window.location.reload();\n      }}\n    >\n      {Object.entries({\n        en: \"English\",\n        \"zh-CN\": \"简体中文\",\n        es: \"Español\",\n        ja: \"日本語\",\n      }).map(([code, name]) => (\n        <option key={code} value={code}>\n          {name}\n        </option>\n      ))}\n    </select>\n  );\n}\n"},{"path":"app/components/magic-access.jsx","sha256":"30f8e80b673087fe802a97e6507ba2d7570c2998184d2579230ec0673307deaa","content":"\"use client\";\nimport { useState } from \"react\";\n\nexport function MagicAccess({ t, confirm = false }) {\n  const [email, setEmail] = useState(\"\");\n  const [status, setStatus] = useState(\"\");\n  async function submit(event) {\n    event.preventDefault();\n    setStatus(\"waiting\");\n    try {\n      const response = await fetch(confirm ? \"/api/auth/magic/confirm\" : \"/api/auth/magic\", {\n        method:\"POST\",\n        headers:{\"Content-Type\":\"application/json\"},\n        body:JSON.stringify(confirm ? {token:window.location.hash.slice(1)} : {email})\n      });\n      if (!response.ok) {\n        setStatus(confirm && response.status === 401 ? \"expired\" : response.status === 400 ? \"invalid\" : confirm ? \"confirmFailed\" : \"failed\");\n        return;\n      }\n      if (confirm) {\n        window.history.replaceState(null, \"\", window.location.pathname);\n        window.location.replace(\"/workspace\");\n      } else setStatus(\"queued\");\n    } catch {\n      setStatus(confirm ? \"confirmFailed\" : \"failed\");\n    }\n  }\n  const form = <form className=\"magic-form\" onSubmit={submit}>\n    {confirm ? <p>{t.detail}</p> : <label>{t.label}<input required type=\"email\" placeholder=\"studio@example.test\" maxLength={77} value={email} onChange={event=>{setEmail(event.target.value);setStatus(\"\")}} /></label>}\n    <button type=\"submit\" className=\"quiet\" disabled={status===\"waiting\"}>{status===\"waiting\" ? t.waiting : confirm ? t.confirm : t.request}</button>\n    <p role=\"status\">{status && status!==\"waiting\" && t[status]} {status===\"queued\" && <code>.layq/outbox/ · LAYQ_OUTBOX_DIR</code>}</p>\n  </form>;\n  return confirm ? form : <details className=\"magic-access\"><summary>{t.title}</summary>{form}</details>;\n}\n"},{"path":"app/globals.css","sha256":"a10f590940da038dac974be35649553949b47822cb5e6430aca4ab7180ae9494","content":"@import \"../design-tokens.css\";\n\n:root {\n  --ink: var(--layq-ink, #182027);\n  --muted: #555555;\n  --paper: var(--layq-paper, #f7f9fa);\n  --line: var(--layq-line, #d6dce1);\n  --graphite: #282828;\n  --silver: #dedede;\n  color-scheme: light;\n}\n* {\n  box-sizing: border-box;\n}\nhtml {\n  scroll-behavior: smooth;\n  scroll-padding-top: 24px;\n}\nbody {\n  margin: 0;\n  background: var(--paper);\n  color: var(--ink);\n  font:\n    16px/1.55 \"Helvetica Neue\",\n    Arial,\n    sans-serif;\n}\na {\n  color: inherit;\n  text-decoration: none;\n  text-underline-offset: 4px;\n}\nbutton,\ninput,\nselect,\ntextarea {\n  font: inherit;\n}\nbutton,\nselect {\n  cursor: pointer;\n}\nbutton:disabled {\n  opacity: 0.6;\n  cursor: wait;\n}\nbutton:focus-visible,\na:focus-visible,\nselect:focus-visible,\ninput:focus-visible,\ntextarea:focus-visible {\n  outline: 3px solid var(--layq-focus);\n  outline-offset: 4px;\n}\n.site {\n  max-width: 1440px;\n  margin: auto;\n  padding: 0 clamp(22px, 5.2vw, 88px);\n}\n.nav,\nfooter {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  gap: 18px;\n  border-bottom: 1px solid var(--line);\n  min-height: 84px;\n}\n.brand {\n  display: inline-flex;\n  align-items: center;\n  gap: 5px;\n  font-size: 28px;\n  font-weight: 850;\n  letter-spacing: -2px;\n  text-decoration: none;\n  line-height: 1;\n}\n.nav nav,\n.actions,\n.row-actions {\n  display: flex;\n  align-items: center;\n  gap: clamp(12px, 2vw, 28px);\n  flex-wrap: wrap;\n}\n.nav nav a,\n.text-link {\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n}\n.nav nav a:hover,\n.text-link:hover {\n  text-decoration: none;\n  color: #575757;\n}\n.language,\n.quiet {\n  background: transparent;\n  border: 1px solid var(--line);\n  border-radius: 6px;\n  padding: 9px 12px;\n  color: var(--ink);\n  font-size: 14px;\n}\n.quiet:hover,\n.language:hover {\n  background: #ededed;\n}\n.hero {\n  display: grid;\n  grid-template-columns: 1.08fr 1fr;\n  gap: clamp(24px, 5vw, 84px);\n  align-items: center;\n  padding: clamp(48px, 6.5vw, 100px) 0;\n}\n.eyebrow,\n.plate-label,\nfigcaption span:last-child {\n  font:\n    600 11px/1.4 ui-monospace,\n    monospace;\n  text-transform: uppercase;\n  letter-spacing: 0.11em;\n}\n.eyebrow {\n  display: flex;\n  gap: 8px;\n  align-items: center;\n  margin: 0 0 22px;\n  color: var(--muted);\n}\n.eyebrow i,\nfigcaption b {\n  width: 8px;\n  height: 8px;\n  border-radius: 100%;\n  background: #555555;\n  display: inline-block;\n}\n.pitch h1,\n.work-head h1 {\n  font-size: clamp(54px, 6.4vw, 101px);\n  font-weight: 540;\n  letter-spacing: -0.079em;\n  line-height: 0.99;\n  margin: 0;\n}\n.pitch h1 em,\n.work-head h1 em {\n  font-family: Georgia, \"Times New Roman\", serif;\n  font-weight: 400;\n  letter-spacing: -0.077em;\n  color: var(--graphite);\n}\n.lede {\n  font-size: clamp(17px, 1.36vw, 21px);\n  line-height: 1.58;\n  color: var(--muted);\n  max-width: 53ch;\n  margin: 25px 0 29px;\n}\n.button {\n  border: 0;\n  border-radius: 7px;\n  padding: 13px 18px;\n  min-height: 46px;\n  font-weight: 650;\n  font-size: 14px;\n}\n.primary {\n  color: white;\n  background: var(--layq-primary, #1b232b);\n  display: inline-flex;\n  align-items: center;\n  gap: 16px;\n}\n.primary:hover {\n  background: var(--layq-primary-hover, #37444f);\n}\n.access {\n  display: grid;\n  gap: 6px;\n}\n.error {\n  color: #222222;\n}\n.plate {\n  margin: 0;\n  background: var(--silver);\n  border: 1px solid #bcbcbc;\n  border-radius: 12px;\n  overflow: hidden;\n  position: relative;\n  min-width: 0;\n}\n.terrain {\n  display: block;\n  width: 100%;\n  height: auto;\n}\n.plate-label,\nfigcaption {\n  display: flex;\n  justify-content: space-between;\n  gap: 10px;\n  align-items: center;\n  padding: 16px 20px;\n  color: #494949;\n}\n.plate-label {\n  border-bottom: 1px solid #b9b9b9;\n}\nfigcaption {\n  border-top: 1px solid #b9b9b9;\n}\nfigcaption span:first-child {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  font:\n    italic 19px Georgia,\n    serif;\n}\nfigcaption b {\n  background: var(--graphite);\n}\n.inside,\n.briefs,\n.child {\n  border-top: 1px solid var(--line);\n  padding: 42px 0;\n}\n.inside .eyebrow,\n.child .eyebrow {\n  margin-bottom: 12px;\n}\nh2,\nh3,\np {\n  overflow-wrap: anywhere;\n}\nh2 {\n  font-size: clamp(32px, 3.3vw, 54px);\n  font-weight: 520;\n  line-height: 1.08;\n  letter-spacing: -0.06em;\n  margin: 0 0 24px;\n}\n.features {\n  display: grid;\n  grid-template-columns: repeat(3, 1fr);\n  border: 1px solid var(--line);\n  border-radius: 9px;\n  overflow: hidden;\n}\n.features article {\n  padding: clamp(18px, 2.4vw, 38px);\n  background: #f3f3f3;\n}\n.features article + article {\n  border-left: 1px solid var(--line);\n}\n.glyph {\n  font: 24px/1 monospace;\n  color: var(--graphite);\n  margin-bottom: 26px;\n}\nh3 {\n  font-size: 23px;\n  line-height: 1.2;\n  letter-spacing: -0.04em;\n  margin: 0;\n}\n.features p,\n.child p,\n.brief-list p {\n  color: var(--muted);\n  margin: 8px 0 0;\n}\nfooter {\n  border-top: 1px solid var(--line);\n  border-bottom: 0;\n  color: var(--muted);\n  font-size: 13px;\n}\n.work-head {\n  padding: 50px 0 20px;\n}\n.list-heading,\n.child,\n.brief-list li {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 18px;\n}\n.list-heading h2 {\n  margin: 0;\n}\n.list-heading small {\n  font:\n    14px ui-monospace,\n    monospace;\n  vertical-align: middle;\n  background: #e8e8e8;\n  border-radius: 4px;\n  padding: 4px 7px;\n}\n.brief-list {\n  padding: 0;\n  list-style: none;\n  margin: 20px 0 0;\n}\n.brief-list li {\n  border-top: 1px solid var(--line);\n  padding: 17px 0;\n}\n.brief-list li > div:first-child {\n  min-width: 0;\n}\n.brief-list p {\n  white-space: pre-wrap;\n}\n.row-actions {\n  flex-wrap: nowrap;\n  gap: 6px;\n}\n.empty {\n  padding: 25px;\n  background: #eeeeee;\n}\n.child h2 {\n  margin: 5px 0;\n  font-size: 28px;\n}\ndialog {\n  border: 1px solid var(--line);\n  border-radius: 12px;\n  background: var(--paper);\n  color: var(--ink);\n  padding: 26px;\n  width: min(460px, calc(100% - 32px));\n  max-height: 90dvh;\n}\ndialog::backdrop {\n  background: #18181888;\n}\ndialog label {\n  display: grid;\n  gap: 6px;\n  margin-bottom: 18px;\n  font-weight: 600;\n}\ndialog input,\ndialog textarea {\n  padding: 10px;\n  border: 1px solid #aaaaaa;\n  border-radius: 5px;\n  min-width: 0;\n  width: 100%;\n  background: white;\n}\ndialog textarea {\n  resize: vertical;\n}\ndialog .actions {\n  justify-content: flex-end;\n}\ndialog h2 {\n  font-size: 30px;\n}\n[role=\"status\"]:not(:empty) {\n  margin-top: 12px;\n}\n@media (max-width: 830px) {\n  .hero {\n    grid-template-columns: 1fr 1fr;\n    gap: 22px;\n  }\n  .pitch h1 {\n    font-size: clamp(44px, 6.2vw, 60px);\n  }\n  .actions {\n    gap: 10px;\n  }\n  .lede {\n    font-size: 16px;\n  }\n}\n@media (max-width: 680px) {\n  .nav {\n    min-height: 66px;\n    align-items: center;\n    gap: 10px;\n  }\n  .nav nav {\n    justify-content: flex-end;\n    gap: 8px;\n  }\n  .nav nav a,\n  .nav .quiet,\n  .language {\n    font-size: 12px;\n  }\n  .nav nav a {\n    padding: 8px 0;\n  }\n  .brand {\n    font-size: 23px;\n  }\n  .brand svg {\n    width: 27px;\n  }\n  .hero {\n    display: flex;\n    flex-direction: column;\n    align-items: stretch;\n    padding: 38px 0 30px;\n    gap: 28px;\n  }\n  .pitch h1,\n  .work-head h1 {\n    font-size: clamp(49px, 11vw, 73px);\n  }\n  .lede {\n    margin: 16px 0 20px;\n  }\n  .plate {\n    max-width: 490px;\n  }\n  .features {\n    grid-template-columns: 1fr;\n  }\n  .features article + article {\n    border-left: 0;\n    border-top: 1px solid var(--line);\n  }\n  .glyph {\n    margin-bottom: 12px;\n  }\n  .brief-list li,\n  .child {\n    align-items: flex-start;\n    flex-direction: column;\n  }\n  .inside,\n  .briefs,\n  .child {\n    padding: 30px 0;\n  }\n  .work-head {\n    padding: 36px 0 14px;\n  }\n  footer {\n    align-items: flex-start;\n    padding: 20px 0;\n  }\n  .eyebrow {\n    margin-bottom: 16px;\n  }\n}\n@media (prefers-reduced-motion: reduce) {\n  html {\n    scroll-behavior: auto;\n  }\n}\n\na:hover {\n  text-decoration: none;\n}\n::selection {\n  background: #2a2a2a;\n  color: #ffffff;\n}\n.error::before,\n[role=\"alert\"]::before {\n  content: \"!\";\n  color: var(--layq-accent);\n  background: var(--layq-accent-soft);\n  display: inline-grid;\n  place-items: center;\n  width: 1.15em;\n  height: 1.15em;\n  border: 1px solid currentColor;\n  border-radius: 50%;\n  margin-inline-end: 0.5em;\n  font-weight: 700;\n}\n.rehearsal { margin-block:32px; padding:24px; background:var(--layq-paper,#f2f5f7); color:var(--layq-ink,#18232d); border:1px solid #c0ccd4; border-radius:8px; }\n.rehearsal h2 { margin:0; letter-spacing:-.035em; }\n.rehearsal p { max-width:70ch; line-height:1.5; }\n.rehearsal>div { display:flex; gap:8px; flex-wrap:wrap; }\n.rehearsal button { border:1px solid #8295a4; color:#18232d; background:#fff; border-radius:5px; padding:8px 12px; cursor:pointer; }\n.rehearsal button:disabled { opacity:.5; cursor:default; }\n.rehearsal strong { display:block; }\n\n.magic-access { margin-block: 18px; max-width:34rem; color:var(--ink); }\n.magic-access summary { cursor:pointer; font-size:.9rem; font-weight:600; }\n.magic-form { display:grid; justify-items:start; gap:10px; max-width:34rem; margin-block:14px; }\n.magic-form label { display:grid; gap:6px; color:var(--ink); font-size:.875rem; }\n.magic-form input { max-width:100%; padding:8px 10px; font:inherit; background:var(--paper); color:var(--ink); border:1px solid var(--rule,#8996a0); border-radius:4px; }\n.magic-form p { margin:0; color:var(--muted); font-size:.875rem; }\n.magic-form p:empty { display:none; }\n"},{"path":"app/language.mjs","sha256":"674e1657145198d7d2211a2fb730924d1e0eb0e9f79d795323fd9751072b1139","content":"import { cookies } from \"next/headers\";\nimport { resolveLanguage } from \"./messages.mjs\";\nexport async function getLanguage() {\n  return resolveLanguage((await cookies()).get(\"layq_locale\")?.value);\n}\n"},{"path":"app/layout.jsx","sha256":"11b4ab202491d98fe2728e5e64889009d644d65691d9af3cf5bafe354b9a5acb","content":"import \"./globals.css\";\nimport { getLanguage } from \"./language.mjs\";\n\nexport const metadata = {\n  title: \"LAYQ — SaaS starter\",\n  description:\n    \"Build your SaaS from a working Next.js starter with an agent-ready workspace.\",\n};\n\nexport default async function RootLayout({ children }) {\n  return (\n    <html lang={await getLanguage()}>\n      <body>{children}</body>\n    </html>\n  );\n}\n"},{"path":"app/messages.mjs","sha256":"3f4b9a7ecf243392a72ea4d9656dd9ae4f44aff279eb3ac13e707302fa099afa","content":"export const messages = {\n  en: {\n    inside: \"Inside the starter\",\n    studio: \"Interaction studio\",\n    kicker: \"Agent-ready SaaS starter\",\n    headline: \"Your next SaaS,\",\n    emphasis: \"layer by layer.\",\n    lede: \"A working Next.js foundation for Codex and Claude Code. Start with a signed-in workspace, persistent data and a clear place to add your next feature.\",\n    explore: \"Explore the starter\",\n    field: \"LAYQ FIELD STUDIES\",\n    fig: \"FIG. 01\",\n    strata: \"Strata\",\n    relief: \"PROCEDURAL RELIEF\",\n    art: \"A graphite and silver relief sculpture made from stacked contour lines\",\n    section: \"Small pieces. Solid ground.\",\n    agent: \"Agent handoff\",\n    agentBody:\n      \"Project instructions and shared guides give your agent a spec, test commands and a release checklist.\",\n    data: \"A working data loop\",\n    dataBody:\n      \"Sign in locally, write a brief and edit it after a refresh. The workspace saves your changes in SQLite.\",\n    extend: \"Room to extend\",\n    extendBody:\n      \"Mount a child app with its own manifest and tests. Its theme and product name come from the host.\",\n    footer: \"Built for developers and their agents.\",\n    enter: \"Open demo workspace\",\n    disabled: \"Demo login unavailable\",\n    wait: \"Please wait…\",\n    exit: \"Sign out\",\n    sessionError: \"The session request failed. Please try again.\",\n    home: \"Home\",\n    workspaceKicker: \"Development workspace\",\n    brief: \"Brief\",\n    room: \"room.\",\n    intro:\n      \"Give your next build a starting point. Briefs are saved in this workspace’s local database.\",\n    child: \"Mounted child application\",\n    openStudio: \"Open interaction studio\",\n    workspaceFooter: \"Local development workspace\",\n    briefs: \"Briefs\",\n    newBrief: \"New brief\",\n    edit: \"Edit\",\n    remove: \"Delete\",\n    create: \"Create brief\",\n    editBrief: \"Edit brief\",\n    title: \"Title\",\n    notes: \"Notes\",\n    save: \"Save brief\",\n    cancel: \"Cancel\",\n    loading: \"Loading briefs…\",\n    empty: \"No briefs yet. Create one to get started.\",\n    retry: \"Retry\",\n    error:\n      \"Unable to complete this request. Check your connection and try again.\",\n    confirm: \"Delete this brief?\",\n    warning: \"This action permanently removes the brief.\",\n    saved: \"Brief saved.\",\n    deleted: \"Brief deleted.\",\n    language: \"Language\",\n    seo: \"Next.js SaaS starter\",\n    workspace: \"Workspace\",\n    nav: \"Navigation\",\n    required: \"Title is required.\",\n  },\n  \"zh-CN\": {\n    inside: \"模板内容\",\n    studio: \"交互工作室\",\n    kicker: \"为编程助手设计的 SaaS 模板\",\n    headline: \"你的下一个 SaaS，\",\n    emphasis: \"从这一层开始。\",\n    lede: \"面向 Codex 和 Claude Code 的 Next.js 工程基础。从带登录的工作台和持久化数据开始，逐步添加新功能。\",\n    explore: \"探索模板\",\n    field: \"LAYQ 地形研究\",\n    fig: \"图 01\",\n    strata: \"岩层\",\n    relief: \"程序化浮雕\",\n    art: \"由层叠等高线构成的银灰色浮雕\",\n    section: \"小组件，稳基础。\",\n    agent: \"交接给助手\",\n    agentBody: \"项目指引和共享文档向助手提供规格、测试命令和发布清单。\",\n    data: \"完整的数据流程\",\n    dataBody:\n      \"在本地登录，写一份简报，刷新后继续编辑。工作台将更改保存在 SQLite 中。\",\n    extend: \"可扩展的结构\",\n    extendBody: \"挂载具有独立清单和测试的子应用，主题和产品名称由主应用提供。\",\n    footer: \"为开发者和编程助手打造。\",\n    enter: \"打开演示工作台\",\n    disabled: \"演示登录不可用\",\n    wait: \"请稍候…\",\n    exit: \"退出登录\",\n    sessionError: \"会话请求失败，请重试。\",\n    home: \"首页\",\n    workspaceKicker: \"开发工作台\",\n    brief: \"简报\",\n    room: \"工作室。\",\n    intro: \"为下次开发写一份简报，数据保存在此工作台的本地数据库中。\",\n    child: \"已挂载的子应用\",\n    openStudio: \"打开交互工作室\",\n    workspaceFooter: \"本地开发工作台\",\n    briefs: \"简报\",\n    newBrief: \"新建简报\",\n    edit: \"编辑\",\n    remove: \"删除\",\n    create: \"创建简报\",\n    editBrief: \"编辑简报\",\n    title: \"标题\",\n    notes: \"备注\",\n    save: \"保存简报\",\n    cancel: \"取消\",\n    loading: \"正在加载简报…\",\n    empty: \"还没有简报。创建第一份简报开始使用。\",\n    retry: \"重试\",\n    error: \"请求失败。请检查连接后重试。\",\n    confirm: \"删除这份简报？\",\n    warning: \"此操作会永久删除这份简报。\",\n    saved: \"已保存简报。\",\n    deleted: \"已删除简报。\",\n    language: \"语言\",\n    seo: \"Next.js SaaS 模板\",\n    workspace: \"工作台\",\n    nav: \"导航\",\n    required: \"请输入标题。\",\n  },\n  es: {\n    inside: \"El kit por dentro\",\n    studio: \"Estudio de interacción\",\n    kicker: \"Kit SaaS para agentes\",\n    headline: \"Tu próximo SaaS,\",\n    emphasis: \"capa a capa.\",\n    lede: \"Una base en Next.js para Codex y Claude Code. Empieza con un espacio con sesión iniciada, datos persistentes y sitio para tu próxima función.\",\n    explore: \"Explorar el kit\",\n    field: \"ESTUDIOS LAYQ\",\n    fig: \"FIG. 01\",\n    strata: \"Estratos\",\n    relief: \"RELIEVE PROCEDURAL\",\n    art: \"Relieve plateado formado por curvas de nivel superpuestas\",\n    section: \"Piezas pequeñas. Base sólida.\",\n    agent: \"Entrega al agente\",\n    agentBody:\n      \"Las guías del proyecto dan a tu agente una especificación, comandos de prueba y una lista de publicación.\",\n    data: \"Datos persistentes\",\n    dataBody:\n      \"Inicia sesión localmente, escribe una ficha y edítala tras recargar. Los cambios se guardan en SQLite.\",\n    extend: \"Espacio para crecer\",\n    extendBody:\n      \"Monta una aplicación hija con manifiesto y pruebas propios. Hereda el tema y el nombre del producto.\",\n    footer: \"Para desarrolladores y sus agentes.\",\n    enter: \"Abrir espacio de prueba\",\n    disabled: \"Acceso de prueba no disponible\",\n    wait: \"Espera…\",\n    exit: \"Cerrar sesión\",\n    sessionError: \"Falló la solicitud de sesión. Vuelve a intentarlo.\",\n    home: \"Inicio\",\n    workspaceKicker: \"Espacio de desarrollo\",\n    brief: \"Sala de\",\n    room: \"fichas.\",\n    intro:\n      \"Prepara tu próximo proyecto. Las fichas se guardan en la base de datos local de este espacio.\",\n    child: \"Aplicación hija montada\",\n    openStudio: \"Abrir estudio de interacción\",\n    workspaceFooter: \"Espacio de desarrollo local\",\n    briefs: \"Fichas\",\n    newBrief: \"Nueva ficha\",\n    edit: \"Editar\",\n    remove: \"Eliminar\",\n    create: \"Crear ficha\",\n    editBrief: \"Editar ficha\",\n    title: \"Título\",\n    notes: \"Notas\",\n    save: \"Guardar ficha\",\n    cancel: \"Cancelar\",\n    loading: \"Cargando fichas…\",\n    empty: \"Aún no hay fichas. Crea una para empezar.\",\n    retry: \"Reintentar\",\n    error:\n      \"No se pudo completar la solicitud. Comprueba la conexión y vuelve a intentarlo.\",\n    confirm: \"¿Eliminar esta ficha?\",\n    warning: \"La ficha se eliminará de forma permanente.\",\n    saved: \"Ficha guardada.\",\n    deleted: \"Ficha eliminada.\",\n    language: \"Idioma\",\n    seo: \"Kit SaaS de Next.js\",\n    workspace: \"Espacio de trabajo\",\n    nav: \"Navegación\",\n    required: \"Escribe un título.\",\n  },\n  ja: {\n    inside: \"スターターの内容\",\n    studio: \"インタラクションスタジオ\",\n    kicker: \"エージェント向け SaaS スターター\",\n    headline: \"次の SaaS を、\",\n    emphasis: \"一層ずつ。\",\n    lede: \"Codex と Claude Code のための Next.js 基盤。ログイン付きワークスペースと永続データを土台に、次の機能を追加できます。\",\n    explore: \"スターターを見る\",\n    field: \"LAYQ 地形研究\",\n    fig: \"図 01\",\n    strata: \"地層\",\n    relief: \"手続き型レリーフ\",\n    art: \"等高線を重ねた銀色の立体地形\",\n    section: \"小さな部品、確かな土台。\",\n    agent: \"エージェントへの引き継ぎ\",\n    agentBody:\n      \"プロジェクトのガイドには仕様、テストコマンド、リリース手順が含まれます。\",\n    data: \"動作するデータフロー\",\n    dataBody:\n      \"ローカルでログインしてブリーフを作成。再読み込みしても SQLite に保存した内容を編集できます。\",\n    extend: \"拡張できる構成\",\n    extendBody:\n      \"独自のマニフェストとテストを持つ子アプリを追加できます。テーマと製品名は親から引き継ぎます。\",\n    footer: \"開発者とエージェントのために。\",\n    enter: \"デモを開く\",\n    disabled: \"デモログインは利用できません\",\n    wait: \"処理中…\",\n    exit: \"ログアウト\",\n    sessionError: \"セッションの処理に失敗しました。もう一度お試しください。\",\n    home: \"ホーム\",\n    workspaceKicker: \"開発ワークスペース\",\n    brief: \"ブリーフ\",\n    room: \"ルーム。\",\n    intro:\n      \"次の開発に向けてブリーフを書きましょう。データはこのワークスペースのローカルデータベースに保存されます。\",\n    child: \"マウント済みの子アプリ\",\n    openStudio: \"スタジオを開く\",\n    workspaceFooter: \"ローカル開発ワークスペース\",\n    briefs: \"ブリーフ\",\n    newBrief: \"新規ブリーフ\",\n    edit: \"編集\",\n    remove: \"削除\",\n    create: \"ブリーフを作成\",\n    editBrief: \"ブリーフを編集\",\n    title: \"タイトル\",\n    notes: \"メモ\",\n    save: \"保存\",\n    cancel: \"キャンセル\",\n    loading: \"読み込み中…\",\n    empty: \"ブリーフはまだありません。最初の一件を作成しましょう。\",\n    retry: \"再試行\",\n    error: \"処理に失敗しました。接続を確認してもう一度お試しください。\",\n    confirm: \"このブリーフを削除しますか？\",\n    warning: \"削除したブリーフは復元できません。\",\n    saved: \"保存しました。\",\n    deleted: \"削除しました。\",\n    language: \"言語\",\n    seo: \"Next.js SaaS スターター\",\n    workspace: \"ワークスペース\",\n    nav: \"ナビゲーション\",\n    required: \"タイトルを入力してください。\",\n  },\n};\nexport const languages = Object.keys(messages);\nexport function resolveLanguage(value) {\n  return languages.includes(value) ? value : \"en\";\n}\n"},{"path":"app/page.jsx","sha256":"4c7b83fc832454b5733cdb333315bb79f1a0a04b0af202f06b423e8be413c6b7","content":"import { canUseDevelopmentLogin } from \"../lib/workspace-session.mjs\";\nimport { Brand, Terrain } from \"./components/brand\";\nimport { Access } from \"./components/access\";\nimport { MagicAccess } from \"./components/magic-access\";\nimport { magicCopy } from \"../lib/magic-copy.mjs\";\nimport { Language } from \"./components/language\";\nimport { getLanguage } from \"./language.mjs\";\nimport { messages } from \"./messages.mjs\";\n\nexport const dynamic = \"force-dynamic\";\nexport async function generateMetadata() {\n  const t = messages[await getLanguage()];\n  return {\n    title: \"LAYQ · \" + t.seo,\n    description: t.lede,\n    openGraph: {\n      title: \"LAYQ · \" + t.seo,\n      description: t.lede,\n      type: \"website\",\n    },\n  };\n}\nexport default async function Home() {\n  const enabled = await canUseDevelopmentLogin();\n  const studio = process.env.LAYQ_STUDIO_ENABLED === \"1\";\n  const lang = await getLanguage();\n  const t = messages[lang];\n  return (\n    <main className=\"site\">\n      <header className=\"nav\">\n        <Brand />\n        <nav aria-label={t.nav}>\n          <a href=\"#starter\">{t.inside}</a>\n          {studio && <a href={\"/\" + lang + \"/studio/\"}>{t.studio}</a>}\n          <Language lang={lang} label={t.language} />\n        </nav>\n      </header>\n      <section className=\"hero\">\n        <div className=\"pitch\">\n          <p className=\"eyebrow\">\n            <i /> {t.kicker}\n          </p>\n          <h1>\n            {t.headline}\n            <br />\n            <em>{t.emphasis}</em>\n          </h1>\n          <p className=\"lede\">{t.lede}</p>\n          <div className=\"actions\">\n            <Access enabled={enabled} t={t} />\n            <a className=\"text-link\" href=\"#starter\">\n              {t.explore}\n            </a>\n          </div>\n          {enabled && <MagicAccess t={magicCopy[lang]} />}\n        </div>\n        <figure className=\"plate\">\n          <div className=\"plate-label\">\n            <span>{t.field}</span>\n            <span>{t.fig}</span>\n          </div>\n          <Terrain label={t.art} />\n          <figcaption>\n            <span>\n              <b /> {t.strata}\n            </span>\n            <span>{t.relief}</span>\n          </figcaption>\n        </figure>\n      </section>\n      <section id=\"starter\" className=\"inside\">\n        <p className=\"eyebrow\">{t.inside}</p>\n        <h2>{t.section}</h2>\n        <div className=\"features\">\n          {[\n            [t.agent, t.agentBody, \"⌘\"],\n            [t.data, t.dataBody, \"▤\"],\n            [t.extend, t.extendBody, \"⊞\"],\n          ].map(([title, body, glyph]) => (\n            <article key={title}>\n              <div aria-hidden=\"true\" className=\"glyph\">\n                {glyph}\n              </div>\n              <h3>{title}</h3>\n              <p>{body}</p>\n            </article>\n          ))}\n        </div>\n      </section>\n      <footer>\n        <Brand />\n        <span>{t.footer}</span>\n      </footer>\n    </main>\n  );\n}\n"},{"path":"app/robots.js","sha256":"0fcd1fc24504eb36c4d692123d78a920f4aa1d9c0f0d062ba54176ac7d2b559e","content":"export default function robots() {\n  return {\n    rules: { userAgent: \"*\", allow: \"/\", disallow: [\"/workspace\", \"/api/\", \"/auth/\"] },\n  };\n}\n"},{"path":"app/workspace/page.jsx","sha256":"dac62e7e730a107b147a2cef04c27a3efaca016a622da619567013ee832658f9","content":"import { requireWorkspaceSession } from \"../../lib/workspace-session.mjs\";\nimport Activity from \"../../modules/activity/src/index.mjs\";\nimport { Brand } from \"../components/brand\";\nimport { Access } from \"../components/access\";\nimport { Billing } from \"../components/billing\";\nimport { Briefs } from \"../components/briefs\";\nimport { Language } from \"../components/language\";\nimport { getLanguage } from \"../language.mjs\";\nimport { messages } from \"../messages.mjs\";\nexport async function generateMetadata() {\n  const t = messages[await getLanguage()];\n  return {\n    title: t.workspace + \" · LAYQ\",\n    description: t.intro,\n    robots: { index: false, follow: false },\n  };\n}\nexport default async function Workspace() {\n  await requireWorkspaceSession();\n  const lang = await getLanguage();\n  const t = messages[lang];\n  return (\n    <main className=\"site\">\n      <header className=\"nav\">\n        <Brand />\n        <nav aria-label={t.nav}>\n          <a href=\"/\">{t.home}</a>\n          <Language lang={lang} label={t.language} />\n          <Access enabled signOut t={t} />\n        </nav>\n      </header>\n      <section className=\"work-head\">\n        <p className=\"eyebrow\">\n          <i /> {t.workspaceKicker}\n        </p>\n        <h1>\n          {t.brief} <em>{t.room}</em>\n        </h1>\n        <p className=\"lede\">{t.intro}</p>\n      </section>\n      <Briefs t={t} />\n      <Billing locale={lang} />\n      <aside className=\"child\">\n        <div>\n          <p className=\"eyebrow\">{t.child}</p>\n          <Activity\n            config={{ productName: \"LAYQ\", theme: \"light\", locale: lang }}\n          />\n        </div>\n        {process.env.LAYQ_STUDIO_ENABLED === \"1\" && (\n          <a className=\"text-link\" href={\"/\" + lang + \"/studio/\"}>\n            {t.openStudio}\n          </a>\n        )}\n      </aside>\n      <footer>\n        <Brand />\n        <span>{t.workspaceFooter}</span>\n      </footer>\n    </main>\n  );\n}\n"},{"path":"design-tokens.css","sha256":"149e171e5d7301b4c4b93b7174952ecb5e152fb53afe940058e8194fc3e5caa6","content":":root {\n  --layq-ink: #182027;\n  --layq-primary: #1b232b;\n  --layq-primary-hover: #37444f;\n  --layq-paper: #f7f9fa;\n  --layq-line: #d6dce1;\n  --layq-accent: #415e75;\n  --layq-accent-hover: #2e4a61;\n  --layq-accent-soft: #e6edf2;\n  --layq-accent-on-dark: #b7cbdc;\n  --layq-muted: #4a5c69;\n  --layq-border-strong: #8294a4;\n  --layq-focus: #426986;\n}\n"},{"path":"engineering/database.md","sha256":"6c7943a97cfcad8bb5f482c3a671f92fa1f0fbb1ec7a8a0f6aa7774017968037","content":"# Database\n\nThe generated SaaS host uses a local SQLite file for its workspace. The standalone child requires no database. External database services and credentials are optional. When a feature needs persistence, document the schema owner, tables, keys, relationships and constraints. Keep ordered migration files in version control with the code that reads them.\n\nUse independent local, preview and production databases and separate credentials. Validate a migration on a disposable database with representative synthetic data. For destructive changes, use an expand/backfill/contract sequence and record the recovery point. Rehearse rollback through a down migration where safe, a corrective migration, or restoration of a verified backup. Record the compatibility window for older application versions.\n"},{"path":"engineering/git.md","sha256":"d4d3ac96ca43d15c99c333925ce7dbcc454dba62dff029bb7a65f91b645ea767","content":"# Git\n\nBranch from the intended base using a descriptive name such as feature/activity-view. Keep a behavior change and its checks together. Use imperative commit subjects and explain compatibility or migration decisions in the body.\n\nFor review, list the user-visible change, the affected host or child entry, checks actually run and any rollout steps. Keep credentials and local environment files out of commits. Record breaking changes in the version's change notes before tagging.\n"},{"path":"engineering/i18n.md","sha256":"72a7142a8ed0e20f1f651e15d77d9b8d0e0cdc43e2f19eeea20bf2c52e3aa983","content":"# Internationalization\n\nEnglish is the fallback. Ship changes to English, Simplified Chinese, Spanish and Japanese in the same change. Translate field labels, validation, status messages, keyboard instructions and accessible names alongside the visible controls. Keep IDs, field names and commands stable across languages.\n\nFor the portable preview and activity component, edit src/locales.mjs. Use named keys and a full sentence with the {productName} placeholder so each language controls word order. Add language names and update the child manifest when the supported set changes. The Next host's page catalog lives in app/messages.mjs. Pass the resolved locale to each child in config.locale.\n\nRun `npm run test:unit` to check locale key coverage, placeholders and the English fallback. Run `npm run test:smoke` to check language links, localized document titles and missing-route responses through HTTP. Then open the host workspace and verify the mounted section follows its language selector.\n\nUse Intl for dates, currencies and numbers. Test a long translation at a 390 CSS-pixel viewport, an unsupported locale and one validation error. In the host, also exercise a sign-in message and a workspace action in the selected language.\n"},{"path":"engineering/README.md","sha256":"fd1eb85bb633d7f372dc0fab5c3255c441ce67942e5da35c834d05922eae636e","content":"# Engineering skills\n\nThese portable project guides can be read by a developer, Codex, or Claude Code. Open the guide that applies to the change. They are ordinary Markdown and require no agent installation.\n\n- [Spec](spec.md) defines scope and acceptance cases.\n- [Git](git.md) records a reviewable change.\n- [Database](database.md) covers optional persistent storage.\n- [Test](test.md) checks behavior at three levels.\n- [Release](release.md) prepares a version and rollback.\n- [Internationalization](i18n.md) keeps the host and its children consistent across four languages.\n"},{"path":"engineering/release.md","sha256":"6ecd46d8d234e2272956df5d7c1866c2d2d5861faafb3b4c2099796ce0ca5c34","content":"# Release\n\nRun `npm test` from the project root. For a SaaS host, use `npm run dev` for the local workspace, then `npm run build` and `npm start` to inspect the production build locally. For a child, use `npm run preview` for the isolated module. The local servers bind to loopback. Set PORT to choose another port. Keep any future secret values outside source control and document each variable's purpose and required environments.\n\nRecord the version in package.json and note user-visible changes and compatibility requirements. Verify the exact candidate with preview-specific configuration. Keep the previous version, its config contract and any migration recovery steps available.\n\nProduction promotion is a separate operator decision. Deploy the reviewed version through the consuming team's hosting process, smoke-test it and record the version. To roll back, restore the last verified version and compatible configuration, then repeat the smoke check. Coordinate database recovery before rolling back across a schema change.\n\n## Verifiable release receipt\n\nKeep a dated receipt in the consuming team's release records. Identify the component, environment, operator and version (`node -p \"require('./package.json').version\"`). Record the full source commit from `git rev-parse HEAD` and check `git status --short` for uncommitted inputs. Run `npm run release:check` from the project root. For the host this runs the suite and builds the Next application. For a child it runs the suite and lists package contents locally. For an actual release artifact, record its checksum and retain the artifact or immutable retrieval reference.\n\n| State | Evidence to collect |\n| --- | --- |\n| Registered | The candidate version and commit appear together in the chosen release ledger. Read the entry back and record its identifier. |\n| Published | The intended destination serves the selected version. Retrieve its immutable artifact or deployment metadata, compare the checksum or source revision and record the destination and timestamp. |\n| Health passed | Request a real route on that published version. Record the environment, URL, timestamp, HTTP status and expected content or behavior observed. For a child, check its mounted section in the host. |\n\nA local dry run supports preflight only. Mark each state pending until its evidence exists. To roll back, record the previous verified receipt, restore its exact artifact and configuration through the operator's normal process, and verify the live revision and route again. Append the outcome and timestamps to the receipt so the superseded version remains traceable.\n"},{"path":"engineering/spec.md","sha256":"92de7b7c08e6fc078d4ad0588af26c43589a937505feaa009d6ee745b81ed355","content":"# Spec\n\nBefore changing behavior, write the user outcome, current limitation and observable goal in the change description. List non-goals so reviewers can identify work outside the change.\n\nExpress each acceptance case as a starting state, an action and an observable result. Include an ordinary path and a failure or empty state. For a configuration change, pass the host a dark theme and verify the mounted entry inherits it. Record the command or manual steps that demonstrate each case.\n"},{"path":"engineering/test.md","sha256":"b15b1c3782403a1be30e411eef2f392e1d969b53e2c2095e8886b5ee23dfd055","content":"# Test\n\nUse the Node version declared by the generated project's package.json. Run npm ci when a lockfile is present or npm install to create one. Commit the resulting lockfile.\n\n| Check | What to verify |\n| --- | --- |\n| Unit | Run `npm run test:unit` for isolated functions and rejected input. |\n| Integration | Run `npm run test:integration` to verify module boundaries and supplied configuration. |\n| Smoke | Run `npm run test:smoke` to exercise the project entry and its expected response. |\n| Local suite | Run `npm test` from the project root. See the entry's README or AGENTS.md for setup. |\n\nFor a host contract change, mount each affected child under the host and check its rendered output. From the generated host, run `npm --prefix modules/activity test` to isolate the bundled child. Run the host checks and verify its workspace also displays that module. For a child-only change, start with its own unit, integration and smoke suites before checking the host preview.\n\nFollow the [internationalization guide](i18n.md) when a change affects user-facing text.\n"},{"path":"integrations.md","sha256":"5b7cfd55fd8afd394f6731ae4dd01f28d7ddaba5fa59c6590dc9c83eef1883b0","content":"# Optional server integrations\n\nRun `node scripts/try-integrations.mjs` from your generated app. It writes a sample email into a local outbox and prints a USD checkout request for inspection. The default run needs no credentials or network. Run `node --test test/integrations.test.mjs` for isolated checks.\n\n## Transactional email\n\nImport `sendTransactionalEmail({ to, subject, text })` from `lib/integrations/index.mjs` in server code. It returns the absolute path of a new JSON message in `.layq/outbox/`. Open that file to review its recipient, timestamp and content. Set `LAYQ_OUTBOX_DIR` to override the directory. Keep message records private and outside version control. Email delivery requires a separately configured provider.\n\n## Checkout sandbox\n\nImport `startTestCheckout({ product, unitAmount, successUrl, requestId })` from the same module. Supply the price in USD cents, choose a trusted return URL and keep the same request ID for retries of the same attempt. The default result contains the form fields that would be sent to Stripe. There is no local checkout URL or payment result.\n\nTo exercise the optional hosted path yourself, set `STRIPE_TEST_SECRET_KEY` in the server process environment, then run `node scripts/try-integrations.mjs --stripe-test`. If you store it in a local .env file, use `node --env-file=.env scripts/try-integrations.mjs --stripe-test`. Each CLI invocation represents a new attempt. The adapter accepts only Stripe test secret keys and returns the actual hosted URL after Stripe confirms a sandbox session. Its request and response handling are covered with a substituted transport. A credentialed provider run is a separate verification step. The trial stops at session creation.\n\nTo integrate with a server action, pass `{ mode: 'stripe-test' }` as the second argument after authenticating the user and looking up the price server-side. Treat checkout completion, webhook verification, fulfillment and production billing as separate work. [Stripe Checkout Sessions API](https://docs.stripe.com/api/checkout/sessions/create)\n\n## Replay a signed payment event locally\n\nSign in to the running loopback app and open **Payment rehearsal** in the workspace. Create a sample reports order, deliver its signed receipt, open your report, then deliver it again. Each event is verified over the raw body and timestamp. A SQLite transaction checks the session, amount and currency, records the event once and grants access to the owner. The report reads settled orders from that owner's database records. The receipt signer and all rehearsal endpoints require an explicitly enabled loopback development environment.\n\nRun `npm run check:billing` against the running local app to reproduce this flow over HTTP, including failure cases. Its sample USD amount describes fixture data. For a hosted test endpoint, replace the local receipt issuer and configure provider credentials, checkout-to-order correlation and the provider's actual webhook secret. Subscription lifecycle, refunds and the customer portal require separate implementation.\n"},{"path":"lib/access.mjs","sha256":"071a9c39dca3414352b86f7fbb4f0246d426d7b7fa700c6dd0adc49cd2660eca","content":"export const cookieName = \"layq_session\";\nexport function developmentLoginEnabled(host, env = process.env) {\n  return (\n    env.NODE_ENV === \"development\" &&\n    env.LAYQ_DEV_LOGIN === \"1\" &&\n    /^(localhost|127\\.0\\.0\\.1|\\[::1\\])(:[0-9]+)?$/i.test(host || \"\")\n  );\n}\nexport function sameOrigin(request) {\n  const origin = request.headers.get(\"origin\");\n  try {\n    return Boolean(\n      origin &&\n        new URL(origin).host === request.headers.get(\"host\") &&\n        new URL(origin).protocol === new URL(request.url).protocol,\n    );\n  } catch {\n    return false;\n  }\n}\n"},{"path":"lib/billing.mjs","sha256":"8949eddfd53d897ad4aa311e9e25a4cf015c315ac736c453d55a52e3bb09576c","content":"// Local fixture service. The signing key is scoped to this development database.\nimport { createHmac, randomBytes, randomUUID, timingSafeEqual } from 'node:crypto'\n\nconst sku = 'reports'\nconst cents = 1200\nconst lifetime = 300\n\nexport function verifyBillingEvent(raw, header, key, now = Date.now()) {\n  if (!key || Buffer.byteLength(key) < 32) throw Error('signing_configuration')\n  if (typeof raw !== 'string' || Buffer.byteLength(raw) > 32768) throw Error('invalid_event')\n  const parts = String(header || '').split(',')\n  const times = parts.filter((p) => /^t=\\d{1,12}$/.test(p))\n  if (times.length !== 1) throw Error('invalid_signature')\n  const timestamp = Number(times[0].slice(2))\n  if (Math.abs(Math.floor(now / 1000) - timestamp) > lifetime) throw Error('expired_signature')\n  const expected = createHmac('sha256', key)\n    .update(timestamp + '.' + raw)\n    .digest()\n  if (\n    !parts.some(\n      (p) =>\n        /^v1=[0-9a-f]{64}$/.test(p) && timingSafeEqual(expected, Buffer.from(p.slice(3), 'hex')),\n    )\n  ) {\n    throw Error('invalid_signature')\n  }\n  const event = JSON.parse(raw)\n  const session = event?.data?.object\n  if (\n    !/^evt_local_[\\w-]{1,64}$/.test(event?.id || '') ||\n    event.type !== 'checkout.session.completed' ||\n    event.livemode !== false ||\n    session?.payment_status !== 'paid' ||\n    session.mode !== 'payment'\n  )\n    throw Error('invalid_event')\n  return { eventId: event.id, session }\n}\n\nexport function billingStore(db) {\n  db.exec(`CREATE TABLE IF NOT EXISTS rehearsal_keys (id INTEGER PRIMARY KEY, secret TEXT NOT NULL);\n    CREATE TABLE IF NOT EXISTS rehearsal_orders (id TEXT PRIMARY KEY, owner TEXT NOT NULL, attempt TEXT NOT NULL, session TEXT UNIQUE NOT NULL,\n    sku TEXT NOT NULL, cents INTEGER NOT NULL, paid INTEGER NOT NULL DEFAULT 0, UNIQUE(owner,attempt));\n    CREATE TABLE IF NOT EXISTS rehearsal_events (id TEXT PRIMARY KEY, order_id TEXT NOT NULL);`)\n  db.prepare('INSERT OR IGNORE INTO rehearsal_keys VALUES (1,?)').run(\n    randomBytes(32).toString('hex'),\n  )\n  const key = db.prepare('SELECT secret FROM rehearsal_keys WHERE id=1').get().secret\n  const find = db.prepare('SELECT * FROM rehearsal_orders WHERE owner=? AND id=?')\n  const view = (row) => ({ id: row.id, paid: Boolean(row.paid), product: row.sku })\n  const entitled = (owner) =>\n    Boolean(\n      db\n        .prepare('SELECT 1 FROM rehearsal_orders WHERE owner=? AND sku=? AND paid=1 LIMIT 1')\n        .get(owner, sku),\n    )\n  return {\n    entitled,\n    status(owner) {\n      const row = db\n        .prepare('SELECT * FROM rehearsal_orders WHERE owner=? ORDER BY rowid DESC LIMIT 1')\n        .get(owner)\n      return { latest: row ? view(row) : null, entitled: entitled(owner) }\n    },\n    begin(owner, attempt) {\n      if (!/^[a-f0-9-]{36}$/.test(attempt || '')) throw Error('invalid_attempt')\n      db.prepare(\n        'INSERT OR IGNORE INTO rehearsal_orders(id,owner,attempt,session,sku,cents) VALUES (?,?,?,?,?,?)',\n      ).run(randomUUID(), owner, attempt, 'cs_test_local_' + randomUUID(), sku, cents)\n      return view(\n        db\n          .prepare('SELECT * FROM rehearsal_orders WHERE owner=? AND attempt=?')\n          .get(owner, attempt),\n      )\n    },\n    receipt(owner, id, now = Date.now()) {\n      const order = find.get(owner, id)\n      if (!order) throw Error('order_missing')\n      const raw = JSON.stringify({\n        id: 'evt_local_' + id,\n        type: 'checkout.session.completed',\n        livemode: false,\n        data: {\n          object: {\n            id: order.session,\n            client_reference_id: id,\n            mode: 'payment',\n            payment_status: 'paid',\n            currency: 'usd',\n            amount_total: order.cents,\n          },\n        },\n      })\n      const timestamp = Math.floor(now / 1000)\n      const signature = createHmac('sha256', key)\n        .update(timestamp + '.' + raw)\n        .digest('hex')\n      return { raw, header: 't=' + timestamp + ',v1=' + signature }\n    },\n    receive(raw, header, now = Date.now()) {\n      const { eventId, session } = verifyBillingEvent(raw, header, key, now)\n      db.exec('BEGIN IMMEDIATE')\n      try {\n        const order = db\n          .prepare('SELECT * FROM rehearsal_orders WHERE id=? AND session=?')\n          .get(session.client_reference_id, session.id)\n        if (!order || order.cents !== session.amount_total || session.currency !== 'usd')\n          throw Error('order_mismatch')\n        const existing = db.prepare('SELECT order_id FROM rehearsal_events WHERE id=?').get(eventId)\n        if (existing && existing.order_id !== order.id) throw Error('event_conflict')\n        if (!existing) {\n          db.prepare('INSERT INTO rehearsal_events VALUES (?,?)').run(eventId, order.id)\n          db.prepare('UPDATE rehearsal_orders SET paid=1 WHERE id=?').run(order.id)\n        }\n        db.exec('COMMIT')\n        return { status: existing ? 'duplicate' : 'recorded' }\n      } catch (error) {\n        db.exec('ROLLBACK')\n        throw error\n      }\n    },\n    report(owner) {\n      if (!entitled(owner)) throw Error('access_required')\n      const result = db\n        .prepare(\n          'SELECT COUNT(*) AS orders,SUM(cents) AS cents FROM rehearsal_orders WHERE owner=? AND paid=1',\n        )\n        .get(owner)\n      return { orders: result.orders, cents: result.cents, currency: 'USD' }\n    },\n  }\n}\n"},{"path":"lib/http.mjs","sha256":"ab633dd67a275b0d5738282d62caac25b094e5699cdf2043bbbf8063ec6f1531","content":"import { NextResponse } from \"next/server\";\nimport { cookieName, developmentLoginEnabled, sameOrigin } from \"./access.mjs\";\nimport { openStore, validatedBrief } from \"./storage.mjs\";\n\nexport const json = (data, status = 200) =>\n  NextResponse.json(data, { status, headers: { \"Cache-Control\": \"no-store\" } });\nexport const fail = (message, status) => json({ error: message }, status);\nexport function validWrite(request) {\n  if (!sameOrigin(request)) return fail(\"Use a same-origin request.\", 403);\n  return null;\n}\nexport async function briefs(request, id) {\n  if (!developmentLoginEnabled(request.headers.get(\"host\")))\n    return fail(\"Sign in to the local workspace.\", 401);\n  if (request.method !== \"GET\") {\n    const error = validWrite(request);\n    if (error) return error;\n  }\n  const token = request.cookies.get(cookieName)?.value;\n  if (!token) return fail(\"Sign in to the workspace.\", 401);\n  const store = openStore();\n  try {\n    const owner = store.session(token);\n    if (!owner) return fail(\"Your session expired. Sign in again.\", 401);\n    if (request.method === \"GET\") return json({ briefs: store.list(owner) });\n    if (request.method === \"DELETE\")\n      return store.remove(owner, id)\n        ? json({ ok: true })\n        : fail(\"Brief not found.\", 404);\n    let data;\n    try {\n      data = validatedBrief(await request.json());\n    } catch (error) {\n      return fail(\n        error instanceof RangeError\n          ? error.message\n          : \"Send a valid JSON brief.\",\n        400,\n      );\n    }\n    const brief = id\n      ? store.update(owner, id, data)\n      : store.create(owner, data);\n    return brief\n      ? json({ brief }, id ? 200 : 201)\n      : fail(\"Brief not found.\", 404);\n  } finally {\n    store.close();\n  }\n}\n"},{"path":"lib/integrations/index.mjs","sha256":"789d175db1566e5d216fb38f8a4ce5d88e79f09f2a091dc813a43a7e7d98f86c","content":"import { randomUUID } from 'node:crypto';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nexport async function sendTransactionalEmail({ to, subject, text }, {\n  directory = process.env.LAYQ_OUTBOX_DIR || '.layq/outbox',\n} = {}) {\n  if (typeof to !== 'string' || !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/u.test(to)) {\n    throw new Error('Provide one recipient email address.');\n  }\n  if (![subject, text].every(value => typeof value === 'string' && value.trim())) {\n    throw new Error('Provide a subject and a plain-text message.');\n  }\n  const id = randomUUID();\n  const file = path.resolve(directory, id + '.json');\n  const message = { id, createdAt: new Date().toISOString(), to, subject, text };\n  await mkdir(path.dirname(file), { recursive: true, mode: 0o700 });\n  await writeFile(file, JSON.stringify(message, null, 2) + '\\n', { flag: 'wx', mode: 0o600 });\n  return { status: 'written-to-local-outbox', file };\n}\n\nexport async function startTestCheckout({ product, unitAmount, successUrl, requestId }, {\n  mode = 'local', testKey = process.env.STRIPE_TEST_SECRET_KEY, fetchImpl = globalThis.fetch,\n} = {}) {\n  if (typeof product !== 'string' || !product.trim() || !Number.isSafeInteger(unitAmount) || unitAmount < 1) {\n    throw new Error('Provide a product name and a positive integer amount in USD cents.');\n  }\n  if (!['https:', 'http:'].includes(new URL(successUrl).protocol)) throw new Error('Provide an HTTP return URL.');\n  if (typeof requestId !== 'string' || !/^[\\w-]{1,128}$/u.test(requestId)) throw new Error('Provide a stable checkout attempt ID.');\n  const request = {\n    mode: 'payment', success_url: successUrl, 'line_items[0][quantity]': '1',\n    'line_items[0][price_data][currency]': 'usd',\n    'line_items[0][price_data][unit_amount]': String(unitAmount),\n    'line_items[0][price_data][product_data][name]': product,\n  };\n  if (mode === 'local') return { status: 'local-request-preview', request };\n  if (mode !== 'stripe-test' || !/^sk_test_[A-Za-z0-9]+$/u.test(testKey || '')) {\n    throw new Error('Stripe sandbox sessions require stripe-test mode and a test secret key.');\n  }\n  const response = await fetchImpl('https://api.stripe.com/v1/checkout/sessions', {\n    method: 'POST', redirect: 'error', signal: AbortSignal.timeout(15000),\n    headers: { Authorization: 'Bearer ' + testKey, 'Idempotency-Key': requestId },\n    body: new URLSearchParams(request),\n  });\n  if (!response.ok) throw new Error('Stripe sandbox rejected the request (HTTP ' + response.status + ').');\n  const { id, url, livemode } = await response.json();\n  if (livemode !== false || !/^cs_test_/.test(id || '') || !url || new URL(url).protocol !== 'https:') {\n    throw new Error('Stripe did not return a hosted test Checkout Session.');\n  }\n  return { status: 'sandbox-session-created', id, url };\n}\n"},{"path":"lib/magic-copy.mjs","sha256":"88539d79b4b486f70e02f61042804b00f3c1356e3611837f3453ac56c01deaf3","content":"export const magicCopy = {\n  en: {\n    title:\"Sign in with a local email link\", label:\"Sample address at example.test\", request:\"Create sign-in link\", waiting:\"Working…\",\n    queued:\"Open the latest message in your local outbox and follow its link.\", invalid:\"Use a sample address ending in @example.test.\", failed:\"Could not create the link. Check the local server and try again.\",\n    confirmFailed:\"Could not complete sign-in. Check the local server and try again.\",\n    subject:\"Your LAYQ local sign-in link\", message:\"Open this link on this computer within 10 minutes. Confirm once to enter your workspace.\",\n    confirmTitle:\"Open your workspace\", detail:\"Confirm to use this one-time sign-in link on this computer.\", confirm:\"Confirm sign-in\", expired:\"This link is missing, invalid or expired. Request a fresh link.\", retry:\"Return to sign-in\"\n  },\n  \"zh-CN\": {\n    title:\"使用本地邮件链接登录\", label:\"example.test 示例邮箱\", request:\"生成登录链接\", waiting:\"处理中…\",\n    queued:\"打开本地发件箱中最新的邮件，点击其中的登录链接。\", invalid:\"请输入以 @example.test 结尾的示例邮箱。\", failed:\"未能生成链接。请检查本地服务器后再试。\",\n    confirmFailed:\"未能完成登录。请检查本地服务器后再试。\",\n    subject:\"你的 LAYQ 本地登录链接\", message:\"请在 10 分钟内用这台电脑打开链接，确认后即可进入工作区。\",\n    confirmTitle:\"进入工作区\", detail:\"确认后，这个一次性链接会让你在这台电脑上登录。\", confirm:\"确认登录\", expired:\"链接缺失、无效或已过期。请重新申请。\", retry:\"返回登录页\"\n  },\n  es: {\n    title:\"Entrar con un enlace de correo local\", label:\"Dirección de ejemplo en example.test\", request:\"Crear enlace de acceso\", waiting:\"Procesando…\",\n    queued:\"Abre el mensaje más reciente de la bandeja de salida local y sigue su enlace.\", invalid:\"Usa una dirección de ejemplo que termine en @example.test.\", failed:\"No se pudo crear el enlace. Comprueba el servidor local e inténtalo de nuevo.\",\n    confirmFailed:\"No se pudo completar el acceso. Comprueba el servidor local e inténtalo de nuevo.\",\n    subject:\"Tu enlace de acceso local a LAYQ\", message:\"Abre este enlace en este equipo en un plazo de 10 minutos y confirma para acceder a tu espacio de trabajo.\",\n    confirmTitle:\"Abre tu espacio de trabajo\", detail:\"Confirma para usar este enlace de un solo uso en este equipo.\", confirm:\"Confirmar acceso\", expired:\"El enlace falta, ha caducado o no es válido. Solicita otro.\", retry:\"Volver al inicio de sesión\"\n  },\n  ja: {\n    title:\"ローカルメールのリンクでログイン\", label:\"example.test のサンプルアドレス\", request:\"ログインリンクを作成\", waiting:\"処理中…\",\n    queued:\"ローカルの送信トレイにある最新のメールを開き、リンクを選んでください。\", invalid:\"末尾が @example.test のサンプルアドレスを入力してください。\", failed:\"リンクを作成できませんでした。ローカルサーバーを確認して、もう一度お試しください。\",\n    confirmFailed:\"ログインを完了できませんでした。ローカルサーバーを確認してから、もう一度お試しください。\",\n    subject:\"LAYQ ローカルログイン用リンク\", message:\"10 分以内にこのコンピュータでリンクを開き、ログインを確認してください。\",\n    confirmTitle:\"ワークスペースを開く\", detail:\"このコンピュータで使い切りのログインリンクを使用します。\", confirm:\"ログインを確定\", expired:\"リンクが見つからないか、無効または期限切れです。新しいリンクを取得してください。\", retry:\"ログインページに戻る\"\n  }\n};\n"},{"path":"lib/magic-http.mjs","sha256":"01f15ed6c9b33a5ee89b6b19d9b615becafc2266fdebbba787447dc0ec784712","content":"import { cookieName, developmentLoginEnabled, sameOrigin } from \"./access.mjs\";\nimport { openStore, sessionSeconds } from \"./storage.mjs\";\nimport { queueMagicLink, sampleAddress } from \"./magic-links.mjs\";\nimport { magicCopy } from \"./magic-copy.mjs\";\nimport { json } from \"./http.mjs\";\nimport { resolveLanguage } from \"../app/messages.mjs\";\n\nexport async function handleMagic(request, confirm) {\n  const host = request.headers.get(\"host\");\n  if (!developmentLoginEnabled(host) || !sameOrigin(request)) return json({error:\"unavailable\"}, 403);\n  const data = await request.json().catch(() => null);\n  const recipient = sampleAddress(data?.email);\n  if (!confirm && !recipient) return json({error:\"invalid-address\"}, 400);\n  const store = openStore();\n  try {\n    if (confirm) {\n      const session = store.magic.redeem(data?.token);\n      if (!session) return json({error:\"invalid-link\"}, 401);\n      const response = json({ok:true});\n      response.cookies.set(cookieName, session, {httpOnly:true, sameSite:\"strict\", path:\"/\", maxAge:sessionSeconds});\n      return response;\n    }\n    const t = magicCopy[resolveLanguage(request.cookies.get(\"layq_locale\")?.value)];\n    try {\n      await queueMagicLink({links:store.magic, recipient, origin:request.headers.get(\"origin\"), subject:t.subject, message:t.message});\n    } catch {\n      return json({error:\"outbox-unavailable\"}, 503);\n    }\n    return json({queued:true}, 202);\n  } finally {\n    store.close();\n  }\n}\n"},{"path":"lib/magic-links.mjs","sha256":"1918318009b2ccbe15c7caf33bf0149872e8b757da7e6b99a64f97b869b6e50c","content":"import { createHash, randomBytes } from \"node:crypto\";\nimport { sendTransactionalEmail } from \"./integrations/index.mjs\";\n\nconst digest = value => createHash(\"sha256\").update(value).digest(\"hex\");\nexport const magicLifetimeMs = 10 * 60 * 1000;\n\nexport function sampleAddress(value) {\n  if (typeof value !== \"string\") return null;\n  const address = value.trim().toLowerCase();\n  return /^[a-z0-9][a-z0-9._+-]{0,62}@example\\.test$/.test(address) ? address : null;\n}\n\nexport function magicLinks(db, issueSession) {\n  db.exec(`CREATE TABLE IF NOT EXISTS local_magic_links(\n    token_hash TEXT PRIMARY KEY, recipient TEXT NOT NULL UNIQUE, expires INTEGER NOT NULL\n  )`);\n  return {\n    issue(address, now = Date.now()) {\n      const recipient = sampleAddress(address);\n      if (!recipient) throw new TypeError(\"Use a sample address at example.test.\");\n      const token = randomBytes(32).toString(\"hex\");\n      db.prepare(\"DELETE FROM local_magic_links WHERE expires<=?\").run(now);\n      db.prepare(\"INSERT INTO local_magic_links VALUES(?,?,?) ON CONFLICT(recipient) DO UPDATE SET token_hash=excluded.token_hash,expires=excluded.expires\")\n        .run(digest(token), recipient, now + magicLifetimeMs);\n      return token;\n    },\n    discard(token) {\n      db.prepare(\"DELETE FROM local_magic_links WHERE token_hash=?\").run(digest(token));\n    },\n    redeem(token, now = Date.now()) {\n      if (typeof token !== \"string\" || !/^[a-f0-9]{64}$/.test(token)) return null;\n      db.exec(\"BEGIN IMMEDIATE\");\n      try {\n        const record = db.prepare(\"DELETE FROM local_magic_links WHERE token_hash=? AND expires>? RETURNING recipient\")\n          .get(digest(token), now);\n        const session = record ? issueSession(\"sample:\" + record.recipient) : null;\n        db.exec(\"COMMIT\");\n        return session;\n      } catch (error) {\n        db.exec(\"ROLLBACK\");\n        throw error;\n      }\n    }\n  };\n}\n\nexport async function queueMagicLink({links, recipient, origin, subject, message}, options = {}) {\n  const token = links.issue(recipient);\n  try {\n    const url = new URL(\"/auth/magic\", origin);\n    url.hash = token;\n    await sendTransactionalEmail({to: recipient, subject, text: message + \"\\n\\n\" + url.href}, options);\n  } catch (error) {\n    links.discard(token);\n    throw error;\n  }\n}\n"},{"path":"lib/storage.mjs","sha256":"c343c3a734483cc81511da90bad5dfe8abc20c6d506b51de42a790ff71b5d4ba","content":"import { magicLinks } from \"./magic-links.mjs\";\nimport { billingStore } from \"./billing.mjs\";\nimport { DatabaseSync } from \"node:sqlite\";\nimport { createHash, randomBytes, randomUUID } from \"node:crypto\";\nimport { mkdirSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\n\nconst hash = (token) => createHash(\"sha256\").update(token).digest(\"hex\");\nexport const sessionSeconds = 60 * 60 * 8;\nexport const localOwner = \"local-developer\";\n\nexport function openStore(\n  filename = process.env.LAYQ_DB_PATH || \".layq/workspace.sqlite\",\n) {\n  if (filename !== \":memory:\")\n    mkdirSync(dirname(resolve(filename)), { recursive: true });\n  const db = new DatabaseSync(filename);\n  db.exec(`PRAGMA busy_timeout=5000;\n    CREATE TABLE IF NOT EXISTS sessions(token_hash TEXT PRIMARY KEY, owner TEXT NOT NULL, expires INTEGER NOT NULL);\n    CREATE TABLE IF NOT EXISTS briefs(id TEXT PRIMARY KEY, owner TEXT NOT NULL, title TEXT NOT NULL, body TEXT NOT NULL, createdAt TEXT NOT NULL, updatedAt TEXT NOT NULL);\n    CREATE INDEX IF NOT EXISTS owner_briefs ON briefs(owner,updatedAt);\n    CREATE TABLE IF NOT EXISTS seeded(owner TEXT PRIMARY KEY);`);\n  const fields = \"id,title,body,createdAt,updatedAt\";\n  function read(owner, id) {\n    return db\n      .prepare(\"SELECT \" + fields + \" FROM briefs WHERE owner=? AND id=?\")\n      .get(owner, id);\n  }\n  function create(owner, { title, body }) {\n    const id = randomUUID(),\n      now = new Date().toISOString();\n    db.prepare(\"INSERT INTO briefs VALUES(?,?,?,?,?,?)\").run(\n      id,\n      owner,\n      title,\n      body,\n      now,\n      now,\n    );\n    return read(owner, id);\n  }\n  function issueSession(owner) {\n    const token = randomBytes(32).toString(\"hex\");\n    db.prepare(\"DELETE FROM sessions WHERE expires<=?\").run(Date.now());\n    if (\n      db.prepare(\"INSERT OR IGNORE INTO seeded VALUES(?)\").run(owner)\n        .changes\n    ) {\n      create(owner, {\n        title: \"Sample · Release checklist\",\n        body: \"An example brief. Replace it with your first release plan.\",\n      });\n    }\n    db.prepare(\"INSERT INTO sessions VALUES(?,?,?)\").run(\n      hash(token),\n      owner,\n      Date.now() + sessionSeconds * 1000,\n    );\n    return token;\n  }\n  return {\n    billing: () => billingStore(db),\n    close: () => db.close(),\n    magic: magicLinks(db, issueSession),\n    login(owner = localOwner) {\n      db.exec(\"BEGIN IMMEDIATE\");\n      try {\n        const token = issueSession(owner);\n        db.exec(\"COMMIT\");\n        return token;\n      } catch (error) {\n        db.exec(\"ROLLBACK\");\n        throw error;\n      }\n    },\n    session: (token) =>\n      token &&\n      db\n        .prepare(\"SELECT owner FROM sessions WHERE token_hash=? AND expires>?\")\n        .get(hash(token), Date.now())?.owner,\n    logout: (token) =>\n      token &&\n      db.prepare(\"DELETE FROM sessions WHERE token_hash=?\").run(hash(token)),\n    list: (owner) =>\n      db\n        .prepare(\n          \"SELECT \" +\n            fields +\n            \" FROM briefs WHERE owner=? ORDER BY updatedAt DESC,id\",\n        )\n        .all(owner),\n    read,\n    create,\n    update(owner, id, { title, body }) {\n      db.prepare(\n        \"UPDATE briefs SET title=?,body=?,updatedAt=? WHERE owner=? AND id=?\",\n      ).run(title, body, new Date().toISOString(), owner, id);\n      return read(owner, id);\n    },\n    remove: (owner, id) =>\n      Boolean(\n        db.prepare(\"DELETE FROM briefs WHERE owner=? AND id=?\").run(owner, id)\n          .changes,\n      ),\n  };\n}\n\nexport function validatedBrief(value) {\n  if (\n    typeof value?.title !== \"string\" ||\n    !value.title.trim() ||\n    value.title.trim().length > 120 ||\n    typeof value.body !== \"string\" ||\n    value.body.length > 5000\n  )\n    throw new RangeError(\n      \"Enter a title of 1–120 characters and a body of up to 5,000 characters.\",\n    );\n  return { title: value.title.trim(), body: value.body };\n}\n"},{"path":"lib/workspace-session.mjs","sha256":"bf7b85d1eb85cd56dfde28025c238e3c9a7150c1536f007f15890d8ab8079987","content":"import { cookies, headers } from \"next/headers\";\nimport { redirect } from \"next/navigation\";\nimport { cookieName, developmentLoginEnabled } from \"./access.mjs\";\nimport { openStore } from \"./storage.mjs\";\n\nexport async function canUseDevelopmentLogin() {\n  return developmentLoginEnabled((await headers()).get(\"host\"));\n}\nexport async function requireWorkspaceSession() {\n  if (!(await canUseDevelopmentLogin())) redirect(\"/\");\n  const token = (await cookies()).get(cookieName)?.value;\n  if (!token) redirect(\"/\");\n  const store = openStore();\n  try {\n    const owner = store.session(token);\n    if (!owner) redirect(\"/\");\n    return owner;\n  } finally {\n    store.close();\n  }\n}\n"},{"path":"modules/activity/.gitignore","sha256":"17f54081f1f2833beec41a97a779072c85e9ae928cb236d0fd4ddc141a47894d","content":"node_modules/\n.env\n.env.*\n!.env.example\n.DS_Store\ncoverage/\n"},{"path":"modules/activity/AGENTS.md","sha256":"1d591bd02e91bc5e8c0ab722e9328231ec305f8f53fdd5a9ff3f1f347595de9c","content":"# Sub-application\n\nThis entry owns an activity section. The host owns navigation, global styling, routing and production promotion. Read the [shared engineering guides](engineering/README.md) for the relevant change.\n\nMount the default React component in [src/index.mjs](src/index.mjs) through the host's modules array. It receives the host's resolved productName, theme and locale in a config prop and can render alone using local defaults. Keep child-specific options scoped to this entry and coordinate changes to the config contract with host maintainers.\n\nRun npm install, npm test and npm run preview in this directory for isolated checks. Record the child version and its compatible host contract. To release, hand the reviewed child version to the host, update its import or pinned package version and verify the mounted section in host preview. Revert that selection to roll back the child. The local preview does not promote the host.\n\nThe [child manifest](layq-manifest.json) declares the module path relative to this directory, the React export, capabilities, inherited settings and local commands. From the child root, use `npm run release:check` to run the complete suite and inspect the package file list. Review that list before handing the release candidate to the host.\n"},{"path":"modules/activity/design-tokens.css","sha256":"149e171e5d7301b4c4b93b7174952ecb5e152fb53afe940058e8194fc3e5caa6","content":":root {\n  --layq-ink: #182027;\n  --layq-primary: #1b232b;\n  --layq-primary-hover: #37444f;\n  --layq-paper: #f7f9fa;\n  --layq-line: #d6dce1;\n  --layq-accent: #415e75;\n  --layq-accent-hover: #2e4a61;\n  --layq-accent-soft: #e6edf2;\n  --layq-accent-on-dark: #b7cbdc;\n  --layq-muted: #4a5c69;\n  --layq-border-strong: #8294a4;\n  --layq-focus: #426986;\n}\n"},{"path":"modules/activity/engineering/database.md","sha256":"6c7943a97cfcad8bb5f482c3a671f92fa1f0fbb1ec7a8a0f6aa7774017968037","content":"# Database\n\nThe generated SaaS host uses a local SQLite file for its workspace. The standalone child requires no database. External database services and credentials are optional. When a feature needs persistence, document the schema owner, tables, keys, relationships and constraints. Keep ordered migration files in version control with the code that reads them.\n\nUse independent local, preview and production databases and separate credentials. Validate a migration on a disposable database with representative synthetic data. For destructive changes, use an expand/backfill/contract sequence and record the recovery point. Rehearse rollback through a down migration where safe, a corrective migration, or restoration of a verified backup. Record the compatibility window for older application versions.\n"},{"path":"modules/activity/engineering/git.md","sha256":"d4d3ac96ca43d15c99c333925ce7dbcc454dba62dff029bb7a65f91b645ea767","content":"# Git\n\nBranch from the intended base using a descriptive name such as feature/activity-view. Keep a behavior change and its checks together. Use imperative commit subjects and explain compatibility or migration decisions in the body.\n\nFor review, list the user-visible change, the affected host or child entry, checks actually run and any rollout steps. Keep credentials and local environment files out of commits. Record breaking changes in the version's change notes before tagging.\n"},{"path":"modules/activity/engineering/i18n.md","sha256":"72a7142a8ed0e20f1f651e15d77d9b8d0e0cdc43e2f19eeea20bf2c52e3aa983","content":"# Internationalization\n\nEnglish is the fallback. Ship changes to English, Simplified Chinese, Spanish and Japanese in the same change. Translate field labels, validation, status messages, keyboard instructions and accessible names alongside the visible controls. Keep IDs, field names and commands stable across languages.\n\nFor the portable preview and activity component, edit src/locales.mjs. Use named keys and a full sentence with the {productName} placeholder so each language controls word order. Add language names and update the child manifest when the supported set changes. The Next host's page catalog lives in app/messages.mjs. Pass the resolved locale to each child in config.locale.\n\nRun `npm run test:unit` to check locale key coverage, placeholders and the English fallback. Run `npm run test:smoke` to check language links, localized document titles and missing-route responses through HTTP. Then open the host workspace and verify the mounted section follows its language selector.\n\nUse Intl for dates, currencies and numbers. Test a long translation at a 390 CSS-pixel viewport, an unsupported locale and one validation error. In the host, also exercise a sign-in message and a workspace action in the selected language.\n"},{"path":"modules/activity/engineering/README.md","sha256":"fd1eb85bb633d7f372dc0fab5c3255c441ce67942e5da35c834d05922eae636e","content":"# Engineering skills\n\nThese portable project guides can be read by a developer, Codex, or Claude Code. Open the guide that applies to the change. They are ordinary Markdown and require no agent installation.\n\n- [Spec](spec.md) defines scope and acceptance cases.\n- [Git](git.md) records a reviewable change.\n- [Database](database.md) covers optional persistent storage.\n- [Test](test.md) checks behavior at three levels.\n- [Release](release.md) prepares a version and rollback.\n- [Internationalization](i18n.md) keeps the host and its children consistent across four languages.\n"},{"path":"modules/activity/engineering/release.md","sha256":"6ecd46d8d234e2272956df5d7c1866c2d2d5861faafb3b4c2099796ce0ca5c34","content":"# Release\n\nRun `npm test` from the project root. For a SaaS host, use `npm run dev` for the local workspace, then `npm run build` and `npm start` to inspect the production build locally. For a child, use `npm run preview` for the isolated module. The local servers bind to loopback. Set PORT to choose another port. Keep any future secret values outside source control and document each variable's purpose and required environments.\n\nRecord the version in package.json and note user-visible changes and compatibility requirements. Verify the exact candidate with preview-specific configuration. Keep the previous version, its config contract and any migration recovery steps available.\n\nProduction promotion is a separate operator decision. Deploy the reviewed version through the consuming team's hosting process, smoke-test it and record the version. To roll back, restore the last verified version and compatible configuration, then repeat the smoke check. Coordinate database recovery before rolling back across a schema change.\n\n## Verifiable release receipt\n\nKeep a dated receipt in the consuming team's release records. Identify the component, environment, operator and version (`node -p \"require('./package.json').version\"`). Record the full source commit from `git rev-parse HEAD` and check `git status --short` for uncommitted inputs. Run `npm run release:check` from the project root. For the host this runs the suite and builds the Next application. For a child it runs the suite and lists package contents locally. For an actual release artifact, record its checksum and retain the artifact or immutable retrieval reference.\n\n| State | Evidence to collect |\n| --- | --- |\n| Registered | The candidate version and commit appear together in the chosen release ledger. Read the entry back and record its identifier. |\n| Published | The intended destination serves the selected version. Retrieve its immutable artifact or deployment metadata, compare the checksum or source revision and record the destination and timestamp. |\n| Health passed | Request a real route on that published version. Record the environment, URL, timestamp, HTTP status and expected content or behavior observed. For a child, check its mounted section in the host. |\n\nA local dry run supports preflight only. Mark each state pending until its evidence exists. To roll back, record the previous verified receipt, restore its exact artifact and configuration through the operator's normal process, and verify the live revision and route again. Append the outcome and timestamps to the receipt so the superseded version remains traceable.\n"},{"path":"modules/activity/engineering/spec.md","sha256":"92de7b7c08e6fc078d4ad0588af26c43589a937505feaa009d6ee745b81ed355","content":"# Spec\n\nBefore changing behavior, write the user outcome, current limitation and observable goal in the change description. List non-goals so reviewers can identify work outside the change.\n\nExpress each acceptance case as a starting state, an action and an observable result. Include an ordinary path and a failure or empty state. For a configuration change, pass the host a dark theme and verify the mounted entry inherits it. Record the command or manual steps that demonstrate each case.\n"},{"path":"modules/activity/engineering/test.md","sha256":"b15b1c3782403a1be30e411eef2f392e1d969b53e2c2095e8886b5ee23dfd055","content":"# Test\n\nUse the Node version declared by the generated project's package.json. Run npm ci when a lockfile is present or npm install to create one. Commit the resulting lockfile.\n\n| Check | What to verify |\n| --- | --- |\n| Unit | Run `npm run test:unit` for isolated functions and rejected input. |\n| Integration | Run `npm run test:integration` to verify module boundaries and supplied configuration. |\n| Smoke | Run `npm run test:smoke` to exercise the project entry and its expected response. |\n| Local suite | Run `npm test` from the project root. See the entry's README or AGENTS.md for setup. |\n\nFor a host contract change, mount each affected child under the host and check its rendered output. From the generated host, run `npm --prefix modules/activity test` to isolate the bundled child. Run the host checks and verify its workspace also displays that module. For a child-only change, start with its own unit, integration and smoke suites before checking the host preview.\n\nFollow the [internationalization guide](i18n.md) when a change affects user-facing text.\n"},{"path":"modules/activity/layq-manifest.json","sha256":"3c8f78a2de9a6b9509a3854b83c56b151d6677e3b8fb491ca61ee9a24d6a2068","content":"{\n  \"manifestVersion\": 1,\n  \"id\": \"activity\",\n  \"entry\": \"./src/index.mjs\",\n  \"export\": \"default\",\n  \"capabilities\": [\n    \"render-activity-section\"\n  ],\n  \"inherits\": [\n    \"productName\",\n    \"theme\",\n    \"locale\"\n  ],\n  \"locales\": [\n    \"en\",\n    \"zh-CN\",\n    \"es\",\n    \"ja\"\n  ],\n  \"fallbackLocale\": \"en\",\n  \"commands\": {\n    \"test\": \"npm test\",\n    \"releasePreflight\": \"npm run release:check\"\n  }\n}\n"},{"path":"modules/activity/package.json","sha256":"599ab6c4d5cff8b2eeaab6bed2000ba7f3369a71cb50b5464e2e1141219a7526","content":"{\n  \"name\": \"layq-subapp-activity\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"exports\": \"./src/index.mjs\",\n  \"engines\": {\n    \"node\": \">=20\"\n  },\n  \"scripts\": {\n    \"release:check\": \"npm test && npm pack --dry-run --ignore-scripts\",\n    \"preview\": \"node preview.mjs\",\n    \"test\": \"node --test test/*.test.mjs\",\n    \"test:unit\": \"node --test test/unit.test.mjs\",\n    \"test:integration\": \"node --test test/integration.test.mjs\",\n    \"test:smoke\": \"node --test test/smoke.test.mjs\"\n  },\n  \"dependencies\": {\n    \"react\": \"^19.2.0\",\n    \"react-dom\": \"^19.2.0\"\n  }\n}\n"},{"path":"modules/activity/preview.mjs","sha256":"2cb15239733b6e3319112e7951936b29399a30772fd62f70880975557fe40a5a","content":"import { createServer } from 'node:http';\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { createElement } from 'react';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport App from './src/index.mjs';\nimport { languageNames, messages, resolveLocale } from './src/locales.mjs';\n\nexport function createPreview(config = {}) {\n  return createServer((request, response) => {\n    const url = new URL(request.url, 'http://localhost');\n    const locale = resolveLocale(url.searchParams.get('lang') ?? config.locale);\n    const t = messages[locale];\n    if (url.pathname !== '/') {\n      response.writeHead(404, { 'content-type': 'text/plain; charset=utf-8', 'content-language': locale }).end(t.missing);\n      return;\n    }\n    const navigation = createElement('nav', { 'aria-label': t.language },\n      Object.entries(languageNames).map(([key, name]) => createElement('a', {\n        key, href: '?lang=' + key, lang: key, 'aria-current': key === locale ? 'page' : undefined\n      }, name + ' '))\n    );\n    const page = createElement('html', { lang: locale },\n      createElement('head', null,\n        createElement('meta', { charSet: 'utf-8' }),\n        createElement('meta', { name: 'viewport', content: 'width=device-width,initial-scale=1' }),\n        createElement('title', null, t.preview)\n      ),\n      createElement('body', null, navigation, createElement(App, { config: { ...config, locale } }))\n    );\n    response.writeHead(200, { 'content-type': 'text/html; charset=utf-8', 'content-language': locale });\n    response.end('<!doctype html>' + renderToStaticMarkup(page));\n  });\n}\nif (process.argv[1] && pathToFileURL(resolve(process.argv[1])).href === import.meta.url) {\n  const server = createPreview();\n  server.listen(Number(process.env.PORT || 4173), '127.0.0.1', () => {\n    console.log('Preview at http://127.0.0.1:' + server.address().port);\n  });\n}\n"},{"path":"modules/activity/README.md","sha256":"fb30b8fe094fa4d07fabe5a2b7153958138dae87ed60a3dbd3f4781cf512d7ca","content":"# Activity module\n\nMount the default React export from src/index.mjs with a config object containing productName, theme and locale. It supports English (en), Simplified Chinese (zh-CN), Spanish (es) and Japanese (ja). Missing or unsupported locales use English. The optional labels prop can override heading and updates. Use the {productName} placeholder in a full translated sentence to preserve word order.\n\nRun `npm install`, `npm test` and `npm run preview` in this directory. Select a language using the links in the preview, or open /?lang=ja directly. See the [engineering guides](engineering/README.md) and [machine-readable contract](layq-manifest.json).\n"},{"path":"modules/activity/src/config.mjs","sha256":"fbb9e32c0286901e90212980db8fb8c659717f1b67e9e39ff8c9ff8187e15c9e","content":"import { messages, resolveLocale } from './locales.mjs';\n\nexport function resolveConfig(config = {}) {\n  const theme = config.theme ?? 'light';\n  if (!['light', 'dark'].includes(theme)) throw new Error('Theme must be light or dark.');\n  const locale = resolveLocale(config.locale);\n  return { theme, locale, productName: config.productName ?? messages[locale].workspace };\n}\n"},{"path":"modules/activity/src/index.mjs","sha256":"9b08beccf8150c63d0520c8fb4c2b23b43aeaefcd4ae0e9d2eff6ec3ed8dae64","content":"import { createElement as h } from 'react';\nimport { resolveConfig } from './config.mjs';\nimport { messages } from './locales.mjs';\n\nexport default function SubApp({ config: hostConfig, labels } = {}) {\n  const config = resolveConfig(hostConfig);\n  const heading = labels?.heading ?? messages[config.locale].heading;\n  const template = labels?.updates ?? messages[config.locale].updates;\n  const updates = template.includes('{productName}')\n    ? template.replace('{productName}', () => config.productName)\n    : template + ' ' + config.productName;\n  return h('section', { 'aria-label': heading, lang: config.locale, 'data-theme': config.theme },\n    h('h2', null, heading),\n    h('p', null, updates)\n  );\n}\n"},{"path":"modules/activity/src/locales.mjs","sha256":"dda2f7dc391015014320052bc6527d6a9783710875ff2b2c8b62167483064119","content":"export const messages = {\n  en: {\n    heading: 'Activity', updates: 'Updates for {productName}', workspace: 'Workspace',\n    preview: 'App preview', missing: 'Page not found', language: 'Language'\n  },\n  'zh-CN': {\n    heading: '动态', updates: '{productName}的最新动态', workspace: '工作区',\n    preview: '应用预览', missing: '找不到页面', language: '语言'\n  },\n  es: {\n    heading: 'Actividad', updates: 'Novedades de {productName}', workspace: 'Espacio de trabajo',\n    preview: 'Vista previa', missing: 'Página no encontrada', language: 'Idioma'\n  },\n  ja: {\n    heading: 'アクティビティ', updates: '{productName}の最新情報', workspace: 'ワークスペース',\n    preview: 'アプリのプレビュー', missing: 'ページが見つかりません', language: '言語'\n  }\n};\n\nexport const languageNames = { en: 'English', 'zh-CN': '简体中文', es: 'Español', ja: '日本語' };\nexport function resolveLocale(value) {\n  return typeof value === 'string' && Object.hasOwn(messages, value) ? value : 'en';\n}\n"},{"path":"modules/activity/test/integration.test.mjs","sha256":"e886ed1af43ade22a6393bd06eece17937c3f96a9e3153b6b747fb379a8ac0cd","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { createElement } from 'react';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport App from '../src/index.mjs';\ntest('renders the local entry using the supplied configuration', () => {\n  const html = renderToStaticMarkup(createElement(App, { config: { productName: 'Research & Design', theme: 'dark' } }));\n  assert.match(html, /Research &amp; Design/);\n  assert.match(html, /data-theme=\"dark\"/);\n});\n"},{"path":"modules/activity/test/smoke.test.mjs","sha256":"7e0fbb4842800b6d7cc6786c4262e6e0b200309727b354fe37a9838788352f3d","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { once } from 'node:events';\nimport { createPreview } from '../preview.mjs';\ntest('serves the application and a missing-route response', async t => {\n  const server = createPreview();\n  t.after(() => new Promise(resolve => server.close(resolve)));\n  server.listen(0, '127.0.0.1');\n  await once(server, 'listening');\n  const url = 'http://127.0.0.1:' + server.address().port;\n  const page = await fetch(url);\n  assert.equal(page.status, 200);\n  assert.match(await page.text(), /Workspace/);\n  assert.equal((await fetch(url + '/missing')).status, 404);\n});\n\ntest('preview links select each supported locale and translate missing routes', async t => {\n  const { messages } = await import('../src/locales.mjs');\n  const server = createPreview();\n  t.after(() => new Promise(resolve => server.close(resolve)));\n  server.listen(0, '127.0.0.1');\n  await once(server, 'listening');\n  const origin = 'http://127.0.0.1:' + server.address().port;\n  for (const [locale, copy] of Object.entries(messages)) {\n    const page = await fetch(origin + '/?lang=' + locale);\n    assert.equal(page.headers.get('content-language'), locale);\n    const html = await page.text();\n    assert.ok(html.includes('<html lang=\"' + locale + '\">'));\n    assert.ok(html.includes('<title>' + copy.preview + '</title>'));\n    assert.ok(html.includes(copy.workspace));\n    for (const key of Object.keys(messages)) assert.ok(html.includes('href=\"?lang=' + key + '\"'));\n    const missing = await fetch(origin + '/missing?lang=' + locale);\n    assert.equal(missing.status, 404);\n    assert.equal(await missing.text(), copy.missing);\n  }\n  const fallback = await fetch(origin + '/?lang=unknown');\n  assert.equal(fallback.headers.get('content-language'), 'en');\n});\n"},{"path":"modules/activity/test/unit.test.mjs","sha256":"09bf88759e8412280650c297332736605d10a52bb0d37003c2bb193037cea861","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { resolveConfig } from '../src/config.mjs';\ntest('validates the theme and fills missing defaults', () => {\n  assert.deepEqual(resolveConfig({ theme: 'dark' }), { theme: 'dark', productName: 'Workspace', locale: 'en' });\n  assert.throws(() => resolveConfig({ theme: 'pink' }), /Theme/);\n});\n\ntest('all locales define each English message and one product-name slot', async () => {\n  const { messages, languageNames, resolveLocale } = await import('../src/locales.mjs');\n  assert.deepEqual(Object.keys(messages).sort(), ['en', 'es', 'ja', 'zh-CN']);\n  for (const [locale, values] of Object.entries(messages)) {\n    assert.equal(resolveLocale(locale), locale);\n    assert.ok(languageNames[locale]);\n    assert.deepEqual(Object.keys(values).sort(), Object.keys(messages.en).sort());\n    assert.ok(Object.values(values).every(value => typeof value === 'string' && value.trim()));\n    assert.equal(values.updates.split('{productName}').length, 2);\n  }\n  for (const unsupported of ['de', undefined, 'constructor']) {\n    assert.equal(resolveLocale(unsupported), 'en');\n  }\n});\n"},{"path":"next.config.mjs","sha256":"40383f85a4873bd2cef9e77839f720827d5d73ce03aa33ec6ba35596c545b5c1","content":"export default { poweredByHeader: false, devIndicators: false, agentRules: false };\n"},{"path":"package-lock.json","sha256":"c9016c5e1b9da8b4b9ed5bd4eedd76ca966e7a2637f9b0a7a9180df9c4dc3020","content":"{\n  \"name\": \"layq-app\",\n  \"version\": \"0.1.0\",\n  \"lockfileVersion\": 3,\n  \"requires\": true,\n  \"packages\": {\n    \"\": {\n      \"name\": \"layq-app\",\n      \"version\": \"0.1.0\",\n      \"dependencies\": {\n        \"next\": \"16.4.6\",\n        \"react\": \"19.3.1\",\n        \"react-dom\": \"19.3.1\"\n      },\n      \"engines\": {\n        \"node\": \">=24.14.0\"\n      }\n    },\n    \"node_modules/@emnapi/runtime\": {\n      \"version\": \"1.11.3\",\n      \"resolved\": \"https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz\",\n      \"integrity\": \"sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==\",\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"dependencies\": {\n        \"tslib\": \"^2.4.0\"\n      }\n    },\n    \"node_modules/@img/colour\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz\",\n      \"integrity\": \"sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==\",\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"engines\": {\n        \"node\": \">=18\"\n      }\n    },\n    \"node_modules/@img/sharp-darwin-arm64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz\",\n      \"integrity\": \"sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"darwin\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-darwin-arm64\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-darwin-x64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz\",\n      \"integrity\": \"sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"darwin\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-darwin-x64\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-freebsd-wasm32\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz\",\n      \"integrity\": \"sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==\",\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"freebsd\"\n      ],\n      \"dependencies\": {\n        \"@img/sharp-wasm32\": \"0.35.5\"\n      },\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-darwin-arm64\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz\",\n      \"integrity\": \"sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"darwin\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-darwin-x64\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz\",\n      \"integrity\": \"sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"darwin\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-linux-arm\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz\",\n      \"integrity\": \"sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==\",\n      \"cpu\": [\n        \"arm\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-linux-arm64\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz\",\n      \"integrity\": \"sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-linux-ppc64\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz\",\n      \"integrity\": \"sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==\",\n      \"cpu\": [\n        \"ppc64\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-linux-riscv64\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz\",\n      \"integrity\": \"sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==\",\n      \"cpu\": [\n        \"riscv64\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-linux-s390x\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz\",\n      \"integrity\": \"sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==\",\n      \"cpu\": [\n        \"s390x\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-linux-x64\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz\",\n      \"integrity\": \"sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-linuxmusl-arm64\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz\",\n      \"integrity\": \"sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-libvips-linuxmusl-x64\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz\",\n      \"integrity\": \"sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-linux-arm\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz\",\n      \"integrity\": \"sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==\",\n      \"cpu\": [\n        \"arm\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-linux-arm\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-linux-arm64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz\",\n      \"integrity\": \"sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-linux-arm64\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-linux-ppc64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz\",\n      \"integrity\": \"sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==\",\n      \"cpu\": [\n        \"ppc64\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-linux-ppc64\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-linux-riscv64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz\",\n      \"integrity\": \"sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==\",\n      \"cpu\": [\n        \"riscv64\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-linux-riscv64\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-linux-s390x\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz\",\n      \"integrity\": \"sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==\",\n      \"cpu\": [\n        \"s390x\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-linux-s390x\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-linux-x64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz\",\n      \"integrity\": \"sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-linux-x64\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-linuxmusl-arm64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz\",\n      \"integrity\": \"sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-linuxmusl-arm64\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-linuxmusl-x64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz\",\n      \"integrity\": \"sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-libvips-linuxmusl-x64\": \"1.3.4\"\n      }\n    },\n    \"node_modules/@img/sharp-wasm32\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz\",\n      \"integrity\": \"sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==\",\n      \"license\": \"Apache-2.0 AND LGPL-3.0-or-later AND MIT\",\n      \"optional\": true,\n      \"dependencies\": {\n        \"@emnapi/runtime\": \"^1.11.3\"\n      },\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-webcontainers-wasm32\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz\",\n      \"integrity\": \"sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==\",\n      \"cpu\": [\n        \"wasm32\"\n      ],\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"dependencies\": {\n        \"@img/sharp-wasm32\": \"0.35.5\"\n      },\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-win32-arm64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz\",\n      \"integrity\": \"sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"Apache-2.0 AND LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"win32\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-win32-ia32\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz\",\n      \"integrity\": \"sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==\",\n      \"cpu\": [\n        \"ia32\"\n      ],\n      \"license\": \"Apache-2.0 AND LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"win32\"\n      ],\n      \"engines\": {\n        \"node\": \"^20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@img/sharp-win32-x64\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz\",\n      \"integrity\": \"sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"Apache-2.0 AND LGPL-3.0-or-later\",\n      \"optional\": true,\n      \"os\": [\n        \"win32\"\n      ],\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      }\n    },\n    \"node_modules/@next/env\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/env/-/env-16.4.6.tgz\",\n      \"integrity\": \"sha512-SunBjJ6t+oBtecS3dTjdVuMhUogP5wD/vrGL5EVuQYM1iS4O5ilL51HkiJ3sPjMzRHiCChvr4dbaSJbR7F3lxA==\",\n      \"license\": \"MIT\"\n    },\n    \"node_modules/@next/swc-darwin-arm64\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.4.6.tgz\",\n      \"integrity\": \"sha512-kJ4VVZkley17xKaJx72QN2IBqjrj7zenCQZaUF0l9ShS/1Mt2kW4+Z5KGG6vgr3L/J562xTOizVyM1iA/u5nlg==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"os\": [\n        \"darwin\"\n      ],\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/@next/swc-darwin-x64\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.4.6.tgz\",\n      \"integrity\": \"sha512-eIPGZIqC+8JKaeZmvnCANJQF4xWkkHqSnAAajtFxgwDMAOnCgxNvP52SeWZ41PyVwoe+Le/NQuZSaQ8j7YshSA==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"os\": [\n        \"darwin\"\n      ],\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/@next/swc-linux-arm64-gnu\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.4.6.tgz\",\n      \"integrity\": \"sha512-9nI6O8vvczH2D9ZNdMGqb/3NuT15T9ksOZnAmx9/gjF2cOi74+xxyf1Hk96uIMfm14c9y6wHeBq6SH8g6udvcA==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/@next/swc-linux-arm64-musl\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.4.6.tgz\",\n      \"integrity\": \"sha512-7/qPhTxDp2ScluOJOhLuhWmlA17o1yZ0SIgpISBCpBxXgtnK4+KGywBpFkfLPiU1rnSM1faFGzYkH6i7JdTrqA==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/@next/swc-linux-x64-gnu\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.4.6.tgz\",\n      \"integrity\": \"sha512-oOpbNa8XOW1qCGd9VvzC4fbkkRxEls7/WI6tz+YHC0xRA7KpV1U7DrAnCPjzVyOk/karzWEepCOcTIDmwK8FwQ==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/@next/swc-linux-x64-musl\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.4.6.tgz\",\n      \"integrity\": \"sha512-aM8CZ+OR2EwXaAYw7KGkW2GDmNDsLBIRe1MMRZCJPTdw/xhTD0IMUVO4sf3KqrzuRouGzwwLZn34+gFeVXiUQA==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"os\": [\n        \"linux\"\n      ],\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/@next/swc-win32-arm64-msvc\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.4.6.tgz\",\n      \"integrity\": \"sha512-U0p7/tEtqvHX2crhd841CDwKtp5CFkKXVjOhmfccR3Pvp64sj8KBwRqsvltqLOwVBbj0NtkxwXSDpEHYGbxeXQ==\",\n      \"cpu\": [\n        \"arm64\"\n      ],\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"os\": [\n        \"win32\"\n      ],\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/@next/swc-win32-x64-msvc\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.4.6.tgz\",\n      \"integrity\": \"sha512-3ZG15/5WIdlTQsIEvc9sPTTSL5XFrlLklIKmfF4fwsDnoAhu6NcBDXsk3mbGxNyo6aVLEGex+fHCv2MahY7a9g==\",\n      \"cpu\": [\n        \"x64\"\n      ],\n      \"license\": \"MIT\",\n      \"optional\": true,\n      \"os\": [\n        \"win32\"\n      ],\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/@swc/helpers\": {\n      \"version\": \"0.5.23\",\n      \"resolved\": \"https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.23.tgz\",\n      \"integrity\": \"sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==\",\n      \"license\": \"Apache-2.0\",\n      \"dependencies\": {\n        \"tslib\": \"^2.8.0\"\n      }\n    },\n    \"node_modules/baseline-browser-mapping\": {\n      \"version\": \"2.11.39\",\n      \"resolved\": \"https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.39.tgz\",\n      \"integrity\": \"sha512-Q9buOYhr2ggrEZpImICecZTJHCCd8yXkRUokFlUEQ8uiD6oP82F4W4jWnhOHZYV+wlvrC51V7Wy0ULyWjil5Wg==\",\n      \"license\": \"Apache-2.0\",\n      \"bin\": {\n        \"baseline-browser-mapping\": \"dist/cli.cjs\"\n      },\n      \"engines\": {\n        \"node\": \">=6.0.0\"\n      }\n    },\n    \"node_modules/caniuse-lite\": {\n      \"version\": \"1.0.30001828\",\n      \"resolved\": \"https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001828.tgz\",\n      \"integrity\": \"sha512-7MWeT+3DlrpuDybTWHl4Zb1Z80Z1fLLnOXuBjDXebzDVcqnEWUlV8JcbASg8B8BhcW8QT2UiR1KAtzYFIZHZYA==\",\n      \"funding\": [\n        {\n          \"type\": \"opencollective\",\n          \"url\": \"https://opencollective.com/browserslist\"\n        },\n        {\n          \"type\": \"tidelift\",\n          \"url\": \"https://tidelift.com/funding/github/npm/caniuse-lite\"\n        },\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/ai\"\n        }\n      ],\n      \"license\": \"CC-BY-4.0\"\n    },\n    \"node_modules/client-only\": {\n      \"version\": \"0.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz\",\n      \"integrity\": \"sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==\",\n      \"license\": \"MIT\"\n    },\n    \"node_modules/detect-libc\": {\n      \"version\": \"2.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz\",\n      \"integrity\": \"sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==\",\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/nanoid\": {\n      \"version\": \"3.3.20\",\n      \"resolved\": \"https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz\",\n      \"integrity\": \"sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==\",\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/ai\"\n        }\n      ],\n      \"license\": \"MIT\",\n      \"bin\": {\n        \"nanoid\": \"bin/nanoid.cjs\"\n      },\n      \"engines\": {\n        \"node\": \"^10 || ^12 || ^13.7 || ^14 || >=15.0.1\"\n      }\n    },\n    \"node_modules/next\": {\n      \"version\": \"16.4.6\",\n      \"resolved\": \"https://registry.npmjs.org/next/-/next-16.4.6.tgz\",\n      \"integrity\": \"sha512-QZJiYhaZLJMo2KpkQGQIwvmd79WVsAWeYIU554a8d7zArS3si/IRy3lBNV/rtYhE70oLwdLYhPAXLPx8HwcwtA==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@next/env\": \"16.4.6\",\n        \"@swc/helpers\": \"0.5.23\",\n        \"baseline-browser-mapping\": \"^2.9.19\",\n        \"caniuse-lite\": \"^1.0.30001579\",\n        \"postcss\": \"8.5.23\",\n        \"styled-jsx\": \"5.1.6\"\n      },\n      \"bin\": {\n        \"next\": \"dist/bin/next\"\n      },\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"optionalDependencies\": {\n        \"@next/swc-darwin-arm64\": \"16.4.6\",\n        \"@next/swc-darwin-x64\": \"16.4.6\",\n        \"@next/swc-linux-arm64-gnu\": \"16.4.6\",\n        \"@next/swc-linux-arm64-musl\": \"16.4.6\",\n        \"@next/swc-linux-x64-gnu\": \"16.4.6\",\n        \"@next/swc-linux-x64-musl\": \"16.4.6\",\n        \"@next/swc-win32-arm64-msvc\": \"16.4.6\",\n        \"@next/swc-win32-x64-msvc\": \"16.4.6\",\n        \"sharp\": \"^0.35.5\"\n      },\n      \"peerDependencies\": {\n        \"@opentelemetry/api\": \"^1.1.0\",\n        \"@playwright/test\": \"^1.51.1\",\n        \"babel-plugin-react-compiler\": \"*\",\n        \"react\": \"^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0\",\n        \"react-dom\": \"^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0\",\n        \"sass\": \"^1.3.0\"\n      },\n      \"peerDependenciesMeta\": {\n        \"@opentelemetry/api\": {\n          \"optional\": true\n        },\n        \"@playwright/test\": {\n          \"optional\": true\n        },\n        \"babel-plugin-react-compiler\": {\n          \"optional\": true\n        },\n        \"sass\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/picocolors\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz\",\n      \"integrity\": \"sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==\",\n      \"license\": \"ISC\"\n    },\n    \"node_modules/postcss\": {\n      \"version\": \"8.5.23\",\n      \"resolved\": \"https://registry.npmjs.org/postcss/-/postcss-8.5.23.tgz\",\n      \"integrity\": \"sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==\",\n      \"funding\": [\n        {\n          \"type\": \"opencollective\",\n          \"url\": \"https://opencollective.com/postcss/\"\n        },\n        {\n          \"type\": \"tidelift\",\n          \"url\": \"https://tidelift.com/funding/github/npm/postcss\"\n        },\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/ai\"\n        }\n      ],\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"nanoid\": \"^3.3.16\",\n        \"picocolors\": \"^1.1.1\",\n        \"source-map-js\": \"^1.2.1\"\n      },\n      \"engines\": {\n        \"node\": \"^10 || ^12 || >=14\"\n      }\n    },\n    \"node_modules/react\": {\n      \"version\": \"19.3.1\",\n      \"resolved\": \"https://registry.npmjs.org/react/-/react-19.3.1.tgz\",\n      \"integrity\": \"sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==\",\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/react-dom\": {\n      \"version\": \"19.3.1\",\n      \"resolved\": \"https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz\",\n      \"integrity\": \"sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"scheduler\": \"^0.28.0\"\n      },\n      \"peerDependencies\": {\n        \"react\": \"^19.3.1\"\n      }\n    },\n    \"node_modules/scheduler\": {\n      \"version\": \"0.28.0\",\n      \"resolved\": \"https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz\",\n      \"integrity\": \"sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==\",\n      \"license\": \"MIT\"\n    },\n    \"node_modules/semver\": {\n      \"version\": \"7.8.6\",\n      \"resolved\": \"https://registry.npmjs.org/semver/-/semver-7.8.6.tgz\",\n      \"integrity\": \"sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==\",\n      \"license\": \"ISC\",\n      \"optional\": true,\n      \"bin\": {\n        \"semver\": \"bin/semver.js\"\n      },\n      \"engines\": {\n        \"node\": \">=10\"\n      }\n    },\n    \"node_modules/sharp\": {\n      \"version\": \"0.35.5\",\n      \"resolved\": \"https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz\",\n      \"integrity\": \"sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==\",\n      \"license\": \"Apache-2.0\",\n      \"optional\": true,\n      \"dependencies\": {\n        \"@img/colour\": \"^1.1.0\",\n        \"detect-libc\": \"^2.1.2\",\n        \"semver\": \"^7.8.5\"\n      },\n      \"engines\": {\n        \"node\": \">=20.9.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://opencollective.com/libvips\"\n      },\n      \"optionalDependencies\": {\n        \"@img/sharp-darwin-arm64\": \"0.35.5\",\n        \"@img/sharp-darwin-x64\": \"0.35.5\",\n        \"@img/sharp-freebsd-wasm32\": \"0.35.5\",\n        \"@img/sharp-libvips-darwin-arm64\": \"1.3.4\",\n        \"@img/sharp-libvips-darwin-x64\": \"1.3.4\",\n        \"@img/sharp-libvips-linux-arm\": \"1.3.4\",\n        \"@img/sharp-libvips-linux-arm64\": \"1.3.4\",\n        \"@img/sharp-libvips-linux-ppc64\": \"1.3.4\",\n        \"@img/sharp-libvips-linux-riscv64\": \"1.3.4\",\n        \"@img/sharp-libvips-linux-s390x\": \"1.3.4\",\n        \"@img/sharp-libvips-linux-x64\": \"1.3.4\",\n        \"@img/sharp-libvips-linuxmusl-arm64\": \"1.3.4\",\n        \"@img/sharp-libvips-linuxmusl-x64\": \"1.3.4\",\n        \"@img/sharp-linux-arm\": \"0.35.5\",\n        \"@img/sharp-linux-arm64\": \"0.35.5\",\n        \"@img/sharp-linux-ppc64\": \"0.35.5\",\n        \"@img/sharp-linux-riscv64\": \"0.35.5\",\n        \"@img/sharp-linux-s390x\": \"0.35.5\",\n        \"@img/sharp-linux-x64\": \"0.35.5\",\n        \"@img/sharp-linuxmusl-arm64\": \"0.35.5\",\n        \"@img/sharp-linuxmusl-x64\": \"0.35.5\",\n        \"@img/sharp-webcontainers-wasm32\": \"0.35.5\",\n        \"@img/sharp-win32-arm64\": \"0.35.5\",\n        \"@img/sharp-win32-ia32\": \"0.35.5\",\n        \"@img/sharp-win32-x64\": \"0.35.5\"\n      },\n      \"peerDependenciesMeta\": {\n        \"@types/node\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/source-map-js\": {\n      \"version\": \"1.2.4\",\n      \"resolved\": \"https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz\",\n      \"integrity\": \"sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==\",\n      \"license\": \"BSD-3-Clause\",\n      \"engines\": {\n        \"node\": \">=6.0.0\"\n      }\n    },\n    \"node_modules/styled-jsx\": {\n      \"version\": \"5.1.6\",\n      \"resolved\": \"https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz\",\n      \"integrity\": \"sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"client-only\": \"0.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 12.0.0\"\n      },\n      \"peerDependencies\": {\n        \"react\": \">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0\"\n      },\n      \"peerDependenciesMeta\": {\n        \"@babel/core\": {\n          \"optional\": true\n        },\n        \"babel-plugin-macros\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/tslib\": {\n      \"version\": \"2.9.1\",\n      \"resolved\": \"https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz\",\n      \"integrity\": \"sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==\",\n      \"license\": \"0BSD\"\n    }\n  }\n}\n"},{"path":"package.json","sha256":"9abb642a2176649a7860e5cf9b7f1092221466a1500a7847ff7d258f0c36cbd2","content":"{\n  \"name\": \"layq-app\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"engines\": {\n    \"node\": \">=24.14.0\"\n  },\n  \"exports\": \"./src/index.mjs\",\n  \"scripts\": {\n    \"dev\": \"next dev --hostname 127.0.0.1\",\n    \"build\": \"next build --webpack\",\n    \"start\": \"next start --hostname 127.0.0.1\",\n    \"preview\": \"node preview.mjs\",\n    \"test\": \"node --test test/*.test.mjs\",\n    \"test:unit\": \"node --test test/unit.test.mjs test/storage.test.mjs\",\n    \"test:integration\": \"node --test test/integration.test.mjs\",\n    \"test:smoke\": \"node --test test/smoke.test.mjs\",\n    \"release:check\": \"npm test && npm run build\",\n    \"integrations:try\": \"node scripts/try-integrations.mjs\",\n    \"check:workspace\": \"node scripts/check-workspace.mjs\",\n    \"check:billing\": \"node scripts/check-billing.mjs\",\n    \"subapp\": \"node .layq/create-starter.mjs subapp\"\n  },\n  \"dependencies\": {\n    \"next\": \"16.4.6\",\n    \"react\": \"19.3.1\",\n    \"react-dom\": \"19.3.1\"\n  }\n}\n"},{"path":"preview.mjs","sha256":"2cb15239733b6e3319112e7951936b29399a30772fd62f70880975557fe40a5a","content":"import { createServer } from 'node:http';\nimport { resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { createElement } from 'react';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport App from './src/index.mjs';\nimport { languageNames, messages, resolveLocale } from './src/locales.mjs';\n\nexport function createPreview(config = {}) {\n  return createServer((request, response) => {\n    const url = new URL(request.url, 'http://localhost');\n    const locale = resolveLocale(url.searchParams.get('lang') ?? config.locale);\n    const t = messages[locale];\n    if (url.pathname !== '/') {\n      response.writeHead(404, { 'content-type': 'text/plain; charset=utf-8', 'content-language': locale }).end(t.missing);\n      return;\n    }\n    const navigation = createElement('nav', { 'aria-label': t.language },\n      Object.entries(languageNames).map(([key, name]) => createElement('a', {\n        key, href: '?lang=' + key, lang: key, 'aria-current': key === locale ? 'page' : undefined\n      }, name + ' '))\n    );\n    const page = createElement('html', { lang: locale },\n      createElement('head', null,\n        createElement('meta', { charSet: 'utf-8' }),\n        createElement('meta', { name: 'viewport', content: 'width=device-width,initial-scale=1' }),\n        createElement('title', null, t.preview)\n      ),\n      createElement('body', null, navigation, createElement(App, { config: { ...config, locale } }))\n    );\n    response.writeHead(200, { 'content-type': 'text/html; charset=utf-8', 'content-language': locale });\n    response.end('<!doctype html>' + renderToStaticMarkup(page));\n  });\n}\nif (process.argv[1] && pathToFileURL(resolve(process.argv[1])).href === import.meta.url) {\n  const server = createPreview();\n  server.listen(Number(process.env.PORT || 4173), '127.0.0.1', () => {\n    console.log('Preview at http://127.0.0.1:' + server.address().port);\n  });\n}\n"},{"path":"README.md","sha256":"da738c4f93e3b077e78429ed17c02c14da900a9622c2896f737abb0f0e4259fb","content":"# Your LAYQ SaaS starter\n\nAn independent Next.js App Router application with a marketing page, a protected development workspace, SQLite-backed project briefs, and a mounted React child module. Requires Node.js 24.14 or later and npm. Use a local filesystem for SQLite.\n\n## First run\n\nFrom the generated root:\n\n```sh\nnpm ci\ncp .env.example .env.local\nnpm run dev\n```\n\nOpen http://127.0.0.1:3000 and use the local sign-in action. The first sign-in creates one visibly labeled example brief. Create another brief, edit it, reload the page and delete it. Log out and visit /workspace to verify the sign-in boundary.\n\nThe local login is one shared demonstration identity. It requires both development mode and LAYQ_DEV_LOGIN=1 on a loopback host. The server binds to loopback by default. Keep the development listener local. A random, expiring HTTP-only session cookie identifies the user. SQLite stores its hash and scopes briefs to the session owner. Sign-out revokes the session. Production login requires implementing your own identity provider. Production start rejects development sign-in even when the flag remains set.\n\n## Commands\n\n```sh\nnpm test\nnpm run integrations:try\nnpm run build\nnpm start\n```\n\nProduction smoke check: open the marketing page, then run `curl -fsS http://127.0.0.1:3000/api/health`. The health response reports application liveness. Production workspace access intentionally stays closed until your identity integration replaces the local adapter. For a private review on a second device, use an SSH tunnel to a trusted machine; keep the Next server bound to loopback.\n\nThe bundled activity module lives under modules/activity. Read its manifest and AGENTS.md before changing its entry. Generate an additional standalone module with `npm run subapp -- modules/reports`; import its exported component explicitly where you want to mount it.\n\n## Data and handoff\n\nThe local database defaults to .layq/workspace.sqlite. Set LAYQ_DB_PATH to select another local database per environment. Opening a fresh database creates the initial schema in lib/storage.mjs. Before introducing a schema change, follow engineering/database.md. Keep real credentials out of version control. Read AGENTS.md and engineering/ for specification, Git, database, testing and release guidance. Each optional integration has its own configuration and execution status in the integrations guide.\n\nWith `npm run dev` running in another terminal, run `npm run check:workspace` against the real HTTP routes. Set a custom origin with `npm run check:workspace -- http://127.0.0.1:3110`. The check creates and deletes its own brief. See [optional integrations](integrations.md) for local outbox and checkout adapter examples. Run `npm run check:billing` against the same dev server, or try Payment rehearsal in the workspace to deliver a signed receipt, replay it and inspect your unlocked report.\n\n### Passwordless sign-in on your computer\n\nStart the generated development server with the example environment enabled. On the marketing page, expand “Sign in with a local email link” and enter a synthetic address such as `studio@example.test`. Open the newest JSON message under `.layq/outbox/` (or your configured `LAYQ_OUTBOX_DIR`), visit the URL in its text and confirm. Each address has a separate workspace. Links expire after ten minutes. Requesting a new link for an address replaces its previous link. The token travels in the URL fragment and is consumed by an explicit same-origin confirmation.\n\nRun `node scripts/check-magic.mjs http://127.0.0.1:3000` from the generated project while the development server is running. Pass your custom outbox path as its second argument if necessary. This exercise uses local SQLite and file delivery. Google OAuth, production identity, sending domains and delivery to real inboxes require separate integration.\n"},{"path":"scripts/check-billing.mjs","sha256":"b82857888e57a1cd632cb3973a4c912d8990fcafc781649d98cf060313168891","content":"// Runs against a generated, running development app with loopback login enabled.\nimport assert from 'node:assert/strict'\nimport { randomUUID } from 'node:crypto'\nconst base = new URL(process.argv[2] || 'http://127.0.0.1:3000').origin\nif (!['localhost', '127.0.0.1', '[::1]'].includes(new URL(base).hostname))\n  throw Error('Use a loopback development URL.')\nlet cookie = ''\nconst post = (path, data) =>\n  fetch(base + path, {\n    method: 'POST',\n    headers: { origin: base, cookie, 'content-type': 'application/json' },\n    body: JSON.stringify(data),\n  })\nconst read = (path) => fetch(base + path, { headers: { cookie } })\nconst api = '/api/rehearsal/'\nconst login = await post('/api/session', {})\nassert.equal(login.status, 200)\ncookie = login.headers.get('set-cookie').split(';')[0]\ntry {\n  const attempt = randomUUID()\n  const before = await read(api + 'report')\n  assert.ok([200, 403].includes(before.status))\n  const original = before.ok ? (await before.json()).orders : 0\n  const first = await post(api + 'order', { attempt })\n  assert.equal(first.status, 201)\n  const { id } = await first.json()\n  assert.equal((await (await post(api + 'order', { attempt })).json()).id, id)\n  const receiptResult = await post(api + 'receipt', { id })\n  assert.equal(receiptResult.status, 200)\n  const { raw, header } = await receiptResult.json()\n  const deliver = (payload) =>\n    fetch(base + api + 'webhook', {\n      method: 'POST',\n      headers: { 'stripe-signature': header },\n      body: payload,\n    })\n  assert.equal((await deliver(raw + ' ')).status, 400)\n  assert.equal((await (await deliver(raw)).json()).status, 'recorded')\n  assert.equal((await (await deliver(raw)).json()).status, 'duplicate')\n  const persisted = await (await read(api + 'status')).json()\n  assert.equal(persisted.latest.id, id)\n  assert.equal(persisted.entitled, true)\n  const report = await read(api + 'report')\n  assert.equal(report.status, 200)\n  assert.equal((await report.json()).orders, original + 1)\n  console.log(\n    'Passed loopback order creation, safe retry, signed webhook, tamper rejection, duplicate delivery and persisted report access.',\n  )\n} finally {\n  const logout = await fetch(base + '/api/session', {\n    method: 'DELETE',\n    headers: { origin: base, cookie },\n  })\n  assert.equal(logout.status, 200)\n  assert.equal((await read(api + 'report')).status, 401)\n}\n"},{"path":"scripts/check-magic.mjs","sha256":"2b4c29d807cf1164568b2d1fb29189b62b07d9f4f3a9d1c235c45147d4f3a886","content":"// Run from the generated app against its loopback development server and private file outbox.\nimport assert from \"node:assert/strict\";\nimport { randomUUID } from \"node:crypto\";\nimport { readdir, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { magicCopy } from \"../lib/magic-copy.mjs\";\n\nconst origin = new URL(process.argv[2] || \"http://127.0.0.1:3000\").origin;\nif (![\"127.0.0.1\",\"localhost\",\"[::1]\"].includes(new URL(origin).hostname)) throw new Error(\"Use a loopback development server.\");\nconst outbox = process.argv[3] || process.env.LAYQ_OUTBOX_DIR || \".layq/outbox\";\nasync function request(path, data, extra = {}) {\n  return fetch(origin + path, {\n    method: data === undefined ? \"GET\" : \"POST\", redirect:\"manual\",\n    headers: {origin, \"Content-Type\":\"application/json\", ...extra}, body: data === undefined ? undefined : JSON.stringify(data)\n  });\n}\nconst base = \"/api/auth/magic\";\nconst confirm = base + \"/confirm\";\nasync function signIn(locale) {\n  const localeCookie = {cookie:\"layq_locale=\"+locale};\n  const email = randomUUID() + \"@example.test\";\n  const created = await request(base, {email}, localeCookie);\n  assert.equal(created.status, 202);\n  assert.deepEqual(await created.json(), {queued:true});\n  const files = await readdir(outbox);\n  let link;\n  for (const name of files.filter(name=>name.endsWith(\".json\"))) {\n    const message = JSON.parse(await readFile(join(outbox,name), \"utf8\"));\n    if (message.to === email) {\n      assert.equal(message.subject, magicCopy[locale].subject);\n      assert.ok(message.text.startsWith(magicCopy[locale].message));\n      link = new URL(message.text.split(\"\\n\").at(-1));\n      break;\n    }\n  }\n  assert.ok(link, \"Expected a synthetic sign-in message in the local outbox.\");\n  assert.equal(link.origin, origin);\n  assert.equal(link.search,\"\");\n  const page = await request(link.pathname, undefined, localeCookie);\n  assert.equal(page.status, 200);\n  assert.ok((await page.text()).includes(magicCopy[locale].confirmTitle));\n  const token = link.hash.slice(1);\n  const results = await Promise.all([request(confirm,{token}),request(confirm,{token})]);\n  assert.deepEqual(results.map(r=>r.status).sort(), [200,401]);\n  const header = results.find(r=>r.ok).headers.get(\"set-cookie\");\n  assert.match(header,/HttpOnly/i);\n  return header.split(\";\")[0];\n}\nassert.equal((await request(base,{email:\"bad@example.com\"})).status,400);\nassert.equal((await request(base,{email:\"sample@example.test\"},{origin:\"https://other.example.test\"})).status,403);\nconst sessions = [];\nfor (const locale of Object.keys(magicCopy)) sessions.push(await signIn(locale));\nconst [first,second] = sessions;\nconst title = \"Local identity check \"+randomUUID();\nconst created = await request(\"/api/briefs\",{title, body:\"Private sample\"},{cookie:first});\nassert.equal(created.status,201);\nconst {brief} = await created.json();\ntry {\n  const list = await request(\"/api/briefs\",undefined,{cookie:second});\n  assert.equal(list.status,200);\n  assert.ok(!(await list.json()).briefs.some(row=>row.id===brief.id));\n  assert.equal((await request(\"/workspace\",undefined,{cookie:first})).status,200);\n} finally {\n  await fetch(origin+\"/api/briefs/\"+brief.id,{method:\"DELETE\",headers:{origin,cookie:first}});\n  for (const cookie of sessions) await fetch(origin+\"/api/session\",{method:\"DELETE\",headers:{origin,cookie}});\n}\nconsole.log(\"Passed four localized outbox messages and confirmation pages, single-use concurrent redemption, session cookies and isolated workspaces.\");\n"},{"path":"scripts/check-production.mjs","sha256":"bc62e536719a343918baa760e3dd093fa5223ed56a4c77bd79c6650ecc9fa3ef","content":"// Run against a new local production server configured with an unused LAYQ_DB_PATH.\nimport assert from 'node:assert/strict';\nimport { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nconst origin = new URL(process.argv[2] || 'http://127.0.0.1:3000').origin;\nassert.ok(['127.0.0.1','localhost','[::1]'].includes(new URL(origin).hostname));\nassert.ok(process.env.LAYQ_DB_PATH,'Set LAYQ_DB_PATH on both server and check.');\nconst db = resolve(process.env.LAYQ_DB_PATH);\nassert.equal(existsSync(db),false,'Use a fresh database path.');\nconst cases = [\n  ['GET','/api/health',200], ['GET','/auth/magic',404], ['GET','/workspace',307],\n  ['POST','/api/auth/magic',403], ['POST','/api/auth/magic/confirm',403],\n  ['POST','/api/session',403], ['DELETE','/api/session',403],\n  ['GET','/api/briefs',401], ['POST','/api/briefs',401],\n  ['PATCH','/api/briefs/test',401], ['DELETE','/api/briefs/test',401]\n];\nfor (const cookie of ['', 'layq_session=untrusted']) {\n  for (const [method,path,status] of cases) {\n    const response = await fetch(origin+path,{method,headers:{origin,cookie},redirect:'manual'});\n    assert.equal(response.status,status,method+' '+path);\n    assert.equal(existsSync(db),false,method+' '+path+' created the DB');\n  }\n}\nconsole.log('Production session and CRUD boundaries passed with and without a cookie. No SQLite file was created.');\n"},{"path":"scripts/check-workspace.mjs","sha256":"a0421981790ec002f324d917198f345401b1703a6f0db129f14bda7003d0ea56","content":"// Exercise an already-running, explicitly enabled loopback development server.\nimport assert from \"node:assert/strict\";\nimport { randomUUID } from \"node:crypto\";\n\nconst origin = new URL(process.argv[2] || \"http://127.0.0.1:3000\").origin;\nif (![\"127.0.0.1\", \"localhost\", \"[::1]\"].includes(new URL(origin).hostname)) {\n  throw new Error(\"Pass the URL of a local development server.\");\n}\nlet cookie;\nlet id;\nasync function call(path, method = \"GET\", data) {\n  const headers = { origin };\n  if (cookie) headers.cookie = cookie;\n  if (data !== undefined) headers[\"content-type\"] = \"application/json\";\n  return fetch(origin + path, {\n    method,\n    headers,\n    body: JSON.stringify(data),\n    redirect: \"manual\",\n  });\n}\ntry {\n  assert.equal((await call(\"/\")).status, 200);\n  assert.equal((await call(\"/api/health\")).status, 200);\n  assert.equal((await call(\"/api/briefs\")).status, 401);\n  assert.equal((await call(\"/workspace\")).status, 307);\n  const login = await call(\"/api/session\", \"POST\", {});\n  assert.equal(login.status, 200, await login.text());\n  const header = login.headers.get(\"set-cookie\");\n  assert.match(header, /HttpOnly/i);\n  cookie = header.split(\";\")[0];\n  const workspace = await call(\"/workspace\");\n  assert.equal(workspace.status, 200);\n  assert.match(await workspace.text(), /aria-label=\"Activity\"/);\n  const bad = await call(\"/api/briefs\", \"POST\", { title: \"\", body: \"\" });\n  assert.equal(bad.status, 400);\n  const title = \"Smoke \" + randomUUID();\n  const created = await call(\"/api/briefs\", \"POST\", {\n    title,\n    body: \"Smoke check\",\n  });\n  assert.equal(created.status, 201);\n  id = (await created.json()).brief.id;\n  const path = \"/api/briefs/\" + id;\n  const edited = await call(path, \"PATCH\", { title, body: \"Edited\" });\n  assert.equal(edited.status, 200);\n  assert.equal((await edited.json()).brief.body, \"Edited\");\n  const list = await (await call(\"/api/briefs\")).json();\n  assert.equal(list.briefs.find((brief) => brief.id === id)?.body, \"Edited\");\n  assert.equal((await call(path, \"DELETE\")).status, 200);\n  assert.equal((await call(path, \"DELETE\")).status, 404);\n  id = undefined;\n  assert.equal((await call(\"/api/session\", \"DELETE\")).status, 200);\n  assert.equal((await call(\"/api/briefs\")).status, 401);\n  console.log(\n    \"Passed marketing, health, workspace protection, sign-in, validation, CRUD and session revocation.\",\n  );\n} finally {\n  if (id) await call(\"/api/briefs/\" + id, \"DELETE\");\n  if (cookie) await call(\"/api/session\", \"DELETE\");\n}\n"},{"path":"scripts/try-integrations.mjs","sha256":"63b3c0d46f647d82df34028846465a550a9c46a23a4b96f4c28df94159a068aa","content":"import { randomUUID } from 'node:crypto';\nimport { sendTransactionalEmail, startTestCheckout } from '../lib/integrations/index.mjs';\n\nconst args = process.argv.slice(2);\nif (args.length > 1 || (args.length && args[0] !== '--stripe-test')) {\n  throw new Error('Usage: node scripts/try-integrations.mjs [--stripe-test]');\n}\nconst email = await sendTransactionalEmail({\n  to: 'developer@example.test', subject: 'Workspace ready', text: 'Your local workspace is ready to review.',\n});\nconsole.log(JSON.stringify(email, null, 2));\nconst checkout = await startTestCheckout({\n  product: 'Sandbox item', unitAmount: 100, successUrl: 'http://localhost:3000/',\n  requestId: randomUUID(),\n}, { mode: args.includes('--stripe-test') ? 'stripe-test' : 'local' });\nconsole.log(JSON.stringify(checkout, null, 2));\n"},{"path":"src/config.mjs","sha256":"fbb9e32c0286901e90212980db8fb8c659717f1b67e9e39ff8c9ff8187e15c9e","content":"import { messages, resolveLocale } from './locales.mjs';\n\nexport function resolveConfig(config = {}) {\n  const theme = config.theme ?? 'light';\n  if (!['light', 'dark'].includes(theme)) throw new Error('Theme must be light or dark.');\n  const locale = resolveLocale(config.locale);\n  return { theme, locale, productName: config.productName ?? messages[locale].workspace };\n}\n"},{"path":"src/index.mjs","sha256":"b299b7f8838fc2400979e14d5ddc9d5a755a1cead2259958dfd31b5067d2ce4f","content":"import { createElement as h } from 'react';\nimport { resolveConfig } from './config.mjs';\n\nexport default function MainApp({ config: overrides, modules } = {}) {\n  const config = resolveConfig(overrides);\n  return h('main', { 'data-theme': config.theme },\n    h('h1', null, config.productName),\n    ...((modules ?? []).map((Child, index) => h(Child, { key: index, config })))\n  );\n}\n"},{"path":"src/locales.mjs","sha256":"dda2f7dc391015014320052bc6527d6a9783710875ff2b2c8b62167483064119","content":"export const messages = {\n  en: {\n    heading: 'Activity', updates: 'Updates for {productName}', workspace: 'Workspace',\n    preview: 'App preview', missing: 'Page not found', language: 'Language'\n  },\n  'zh-CN': {\n    heading: '动态', updates: '{productName}的最新动态', workspace: '工作区',\n    preview: '应用预览', missing: '找不到页面', language: '语言'\n  },\n  es: {\n    heading: 'Actividad', updates: 'Novedades de {productName}', workspace: 'Espacio de trabajo',\n    preview: 'Vista previa', missing: 'Página no encontrada', language: 'Idioma'\n  },\n  ja: {\n    heading: 'アクティビティ', updates: '{productName}の最新情報', workspace: 'ワークスペース',\n    preview: 'アプリのプレビュー', missing: 'ページが見つかりません', language: '言語'\n  }\n};\n\nexport const languageNames = { en: 'English', 'zh-CN': '简体中文', es: 'Español', ja: '日本語' };\nexport function resolveLocale(value) {\n  return typeof value === 'string' && Object.hasOwn(messages, value) ? value : 'en';\n}\n"},{"path":"test/billing.test.mjs","sha256":"328c570ccbca379cfc0141ed82e5f8a9d589719522beef5aa7273ee2a58dc119","content":"import assert from 'node:assert/strict'\nimport { createHmac, randomUUID } from 'node:crypto'\nimport { DatabaseSync } from 'node:sqlite'\nimport { mkdtempSync, rmSync } from 'node:fs'\nimport path from 'node:path'\nimport { tmpdir } from 'node:os'\nimport test from 'node:test'\nimport { billingStore, verifyBillingEvent } from '../lib/billing.mjs'\n\ntest('a signed test receipt pays the matching order exactly once and only opens its owner’s report', () => {\n  const directory = mkdtempSync(path.join(tmpdir(), 'layq-billing-'))\n  const file = path.join(directory, 'test.sqlite')\n  let db = new DatabaseSync(file)\n  try {\n    const b = billingStore(db)\n    const attempt = randomUUID()\n    const order = b.begin('owner-a', attempt)\n    assert.equal(b.begin('owner-a', attempt).id, order.id)\n    assert.notEqual(b.begin('owner-b', attempt).id, order.id)\n    const { raw, header } = b.receipt('owner-a', order.id)\n    assert.throws(() => b.report('owner-a'), /access_required/)\n    assert.throws(() => b.receipt('owner-b', order.id), /order_missing/)\n    assert.throws(() => b.receive(raw + ' ', header), /invalid_signature/)\n    assert.throws(() => b.receive(raw, header, Date.now() + 301000), /expired_signature/)\n    assert.throws(() => verifyBillingEvent(raw, header, ''), /signing_configuration/)\n    const secret = db.prepare('SELECT secret FROM rehearsal_keys').get().secret\n    function send(change) {\n      const event = JSON.parse(raw)\n      change(event)\n      const payload = JSON.stringify(event)\n      const now = Math.floor(Date.now() / 1000)\n      return b.receive(\n        payload,\n        't=' +\n          now +\n          ',v1=' +\n          createHmac('sha256', secret)\n            .update(now + '.' + payload)\n            .digest('hex'),\n      )\n    }\n    assert.throws(\n      () =>\n        send((e) => {\n          e.livemode = true\n        }),\n      /invalid_event/,\n    )\n    assert.throws(\n      () =>\n        send((e) => {\n          e.data.object.payment_status = 'unpaid'\n        }),\n      /invalid_event/,\n    )\n    assert.throws(\n      () =>\n        send((e) => {\n          e.data.object.currency = 'eur'\n        }),\n      /order_mismatch/,\n    )\n    assert.throws(\n      () =>\n        send((e) => {\n          e.data.object.amount_total = 1\n        }),\n      /order_mismatch/,\n    )\n    assert.equal(b.entitled('owner-a'), false)\n    assert.deepEqual(b.receive(raw, header), { status: 'recorded' })\n    assert.equal(b.report('owner-a').orders, 1)\n    assert.throws(() => b.report('owner-b'), /access_required/)\n    db.close()\n    db = new DatabaseSync(file)\n    const reopened = billingStore(db)\n    assert.deepEqual(reopened.receive(raw, header), { status: 'duplicate' })\n    assert.deepEqual(reopened.report('owner-a'), { orders: 1, cents: 1200, currency: 'USD' })\n  } finally {\n    db.close()\n    rmSync(directory, { recursive: true, force: true })\n  }\n})\n"},{"path":"test/integration.test.mjs","sha256":"e886ed1af43ade22a6393bd06eece17937c3f96a9e3153b6b747fb379a8ac0cd","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { createElement } from 'react';\nimport { renderToStaticMarkup } from 'react-dom/server';\nimport App from '../src/index.mjs';\ntest('renders the local entry using the supplied configuration', () => {\n  const html = renderToStaticMarkup(createElement(App, { config: { productName: 'Research & Design', theme: 'dark' } }));\n  assert.match(html, /Research &amp; Design/);\n  assert.match(html, /data-theme=\"dark\"/);\n});\n"},{"path":"test/integrations.test.mjs","sha256":"56ccbef4e7311c82fdeee351d5f7fcc30a9d28b628621021ea0b614f76e8a448","content":"import assert from 'node:assert/strict';\nimport { test } from 'node:test';\nimport { mkdtemp, readFile, rm } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport path from 'node:path';\nimport { sendTransactionalEmail, startTestCheckout } from '../lib/integrations/index.mjs';\n\nconst attempt = { product: 'Test item', unitAmount: 100, successUrl: 'http://localhost:3000/', requestId: 'attempt-1' };\n\ntest('records two separately reviewable local emails', async t => {\n  const directory = await mkdtemp(path.join(tmpdir(), 'starter-email-'));\n  t.after(() => rm(directory, { recursive: true, force: true }));\n  const message = { to: 'dev@example.test', subject: 'Welcome', text: 'Open the app.' };\n  const results = await Promise.all([1, 2].map(() => sendTransactionalEmail(message, { directory })));\n  assert.notEqual(results[0].file, results[1].file);\n  assert.equal(results[0].status, 'written-to-local-outbox');\n  const { id, createdAt, ...record } = JSON.parse(await readFile(results[0].file, 'utf8'));\n  assert.ok(id && createdAt);\n  assert.deepEqual(record, message);\n  await assert.rejects(sendTransactionalEmail({ ...message, to: 'invalid' }, { directory }), /recipient/);\n});\n\ntest('local checkout and rejected live keys never call the transport', async () => {\n  const fetchImpl = () => assert.fail('unexpected network request');\n  const preview = await startTestCheckout(attempt, { testKey: 'sk_test_fixture', fetchImpl });\n  assert.equal(preview.status, 'local-request-preview');\n  assert.equal(preview.request['line_items[0][price_data][unit_amount]'], '100');\n  assert.equal(preview.url, undefined);\n  for (const testKey of ['', 'sk_live_fixture']) {\n    await assert.rejects(startTestCheckout(attempt, { mode: 'stripe-test', testKey, fetchImpl }), /test secret/);\n  }\n});\n\ntest('sandbox adapter sends a form and checks the provider response', async () => {\n  const options = { mode: 'stripe-test', testKey: 'sk_test_fixture' };\n  const result = await startTestCheckout(attempt, { ...options, fetchImpl: async (url, request) => {\n    assert.equal(url, 'https://api.stripe.com/v1/checkout/sessions');\n    assert.equal(request.method, 'POST');\n    assert.equal(request.headers['Idempotency-Key'], attempt.requestId);\n    assert.equal(request.body.get('line_items[0][price_data][product_data][name]'), attempt.product);\n    return Response.json({ id: 'cs_test_fixture', livemode: false, url: 'https://checkout.stripe.com/example' });\n  } });\n  assert.equal(result.status, 'sandbox-session-created');\n  await assert.rejects(startTestCheckout(attempt, { ...options, fetchImpl: async () => new Response(null, { status: 401 }) }), /HTTP 401/);\n  await assert.rejects(startTestCheckout(attempt, { ...options, fetchImpl: async () => Response.json({ livemode: true }) }), /hosted test/);\n});\n"},{"path":"test/language.test.mjs","sha256":"62f58d0003dd6f2fd6a2b2866504d0301782cf99b7793620ae3411b103ff8718","content":"import assert from \"node:assert/strict\";\nimport test from \"node:test\";\nimport { messages, languages, resolveLanguage } from \"../app/messages.mjs\";\n\ntest(\"every supported language supplies the complete interface\", () => {\n  assert.deepEqual(languages, [\"en\", \"zh-CN\", \"es\", \"ja\"]);\n  for (const lang of languages) {\n    assert.deepEqual(Object.keys(messages[lang]), Object.keys(messages.en));\n    assert.ok(\n      Object.values(messages[lang]).every(\n        (value) => typeof value === \"string\" && value.trim().length > 0,\n      ),\n    );\n    assert.equal(resolveLanguage(lang), lang);\n  }\n  for (const invalid of [undefined, \"fr\", \"__proto__\"])\n    assert.equal(resolveLanguage(invalid), \"en\");\n});\n"},{"path":"test/magic-links.test.mjs","sha256":"ce1e1945249cc7cc6dccd4f9c58f3ae042e1205a13541be305526029ac2a002b","content":"import assert from \"node:assert/strict\";\nimport test from \"node:test\";\nimport { mkdtemp, readFile, writeFile, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { DatabaseSync } from \"node:sqlite\";\nimport { openStore } from \"../lib/storage.mjs\";\nimport { magicLinks, magicLifetimeMs, queueMagicLink, sampleAddress } from \"../lib/magic-links.mjs\";\nimport { magicCopy } from \"../lib/magic-copy.mjs\";\nimport { messages } from \"../app/messages.mjs\";\n\ntest(\"only synthetic local identities are accepted and every locale covers the flow\", () => {\n  assert.equal(sampleAddress(\" Studio@Example.Test \"), \"studio@example.test\");\n  for (const value of [null,{},[\"ok@example.test\"],\"a@example.com\",\"@example.test\",\"aa\\nb@example.test\"])\n    assert.equal(sampleAddress(value), null);\n  assert.deepEqual(Object.keys(magicCopy).sort(), Object.keys(messages).sort());\n  for (const labels of Object.values(magicCopy)) assert.deepEqual(Object.keys(labels), Object.keys(magicCopy.en));\n});\n\ntest(\"SQLite persists hashed links, rotates them by recipient and redeems at most once across connections\", async t => {\n  const dir = await mkdtemp(join(tmpdir(), \"layq-identity-\"));\n  t.after(() => rm(dir,{recursive:true,force:true}));\n  const file = join(dir,\"local.sqlite\");\n  let store = openStore(file);\n  const first = store.magic.issue(\"first@example.test\");\n  const replacement = store.magic.issue(\"first@example.test\");\n  const old = store.magic.issue(\"old@example.test\", 100);\n  assert.equal(store.magic.redeem(old,100+magicLifetimeMs), null);\n  assert.equal(store.magic.redeem(first), null);\n  store.close();\n  assert.equal((await readFile(file)).includes(Buffer.from(replacement)), false);\n  store = openStore(file);\n  const session = store.magic.redeem(replacement);\n  const owner = store.session(session);\n  assert.equal(owner, \"sample:first@example.test\");\n  store.create(owner,{title:\"Owned\",body:\"Private sample\"});\n  const otherConnection = openStore(file);\n  assert.equal(otherConnection.magic.redeem(replacement), null);\n  const other = otherConnection.session(otherConnection.magic.redeem(otherConnection.magic.issue(\"other@example.test\")));\n  assert.ok(!otherConnection.list(other).some(item=>item.title===\"Owned\"));\n  store.close();\n  otherConnection.close();\n});\n\ntest(\"outbox write failure invalidates the pending link\", async t => {\n  const dir = await mkdtemp(join(tmpdir(), \"layq-undelivered-\"));\n  t.after(() => rm(dir,{recursive:true,force:true}));\n  const file = join(dir,\"local.sqlite\");\n  const store = openStore(file);\n  const notADirectory = join(dir,\"occupied\");\n  await writeFile(notADirectory,\"sample\");\n  await assert.rejects(queueMagicLink({links:store.magic, recipient:\"mail@example.test\", origin:\"http://localhost:3000\", subject:\"Sample\", message:\"Open locally\"}, {directory:notADirectory}));\n  const db = new DatabaseSync(file);\n  assert.equal(db.prepare(\"SELECT count(*) AS n FROM local_magic_links\").get().n,0);\n  db.close();\n  store.close();\n});\n\ntest(\"a failed session insert rolls token consumption back so the user can retry\", () => {\n  const db = new DatabaseSync(\":memory:\");\n  let fail = true;\n  const links = magicLinks(db, () => {\n    if (fail) throw new Error(\"Temporary session failure\");\n    return \"created\";\n  });\n  try {\n    const link = links.issue(\"retry@example.test\");\n    assert.throws(() => links.redeem(link), /Temporary session failure/);\n    fail = false;\n    assert.equal(links.redeem(link), \"created\");\n    assert.equal(links.redeem(link), null);\n  } finally {\n    db.close();\n  }\n});\n"},{"path":"test/smoke.test.mjs","sha256":"7e0fbb4842800b6d7cc6786c4262e6e0b200309727b354fe37a9838788352f3d","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { once } from 'node:events';\nimport { createPreview } from '../preview.mjs';\ntest('serves the application and a missing-route response', async t => {\n  const server = createPreview();\n  t.after(() => new Promise(resolve => server.close(resolve)));\n  server.listen(0, '127.0.0.1');\n  await once(server, 'listening');\n  const url = 'http://127.0.0.1:' + server.address().port;\n  const page = await fetch(url);\n  assert.equal(page.status, 200);\n  assert.match(await page.text(), /Workspace/);\n  assert.equal((await fetch(url + '/missing')).status, 404);\n});\n\ntest('preview links select each supported locale and translate missing routes', async t => {\n  const { messages } = await import('../src/locales.mjs');\n  const server = createPreview();\n  t.after(() => new Promise(resolve => server.close(resolve)));\n  server.listen(0, '127.0.0.1');\n  await once(server, 'listening');\n  const origin = 'http://127.0.0.1:' + server.address().port;\n  for (const [locale, copy] of Object.entries(messages)) {\n    const page = await fetch(origin + '/?lang=' + locale);\n    assert.equal(page.headers.get('content-language'), locale);\n    const html = await page.text();\n    assert.ok(html.includes('<html lang=\"' + locale + '\">'));\n    assert.ok(html.includes('<title>' + copy.preview + '</title>'));\n    assert.ok(html.includes(copy.workspace));\n    for (const key of Object.keys(messages)) assert.ok(html.includes('href=\"?lang=' + key + '\"'));\n    const missing = await fetch(origin + '/missing?lang=' + locale);\n    assert.equal(missing.status, 404);\n    assert.equal(await missing.text(), copy.missing);\n  }\n  const fallback = await fetch(origin + '/?lang=unknown');\n  assert.equal(fallback.headers.get('content-language'), 'en');\n});\n"},{"path":"test/storage.test.mjs","sha256":"783ea9482efb3fbbbdf00f07aeed32ef2c0c1f0417c5805ef874a40a97fd4d6f","content":"import { test } from \"node:test\";\nimport assert from \"node:assert/strict\";\nimport { mkdtempSync, rmSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { openStore, validatedBrief } from \"../lib/storage.mjs\";\nimport { developmentLoginEnabled, sameOrigin } from \"../lib/access.mjs\";\n\ntest(\"local login requires an explicit development loopback\", () => {\n  const env = { NODE_ENV: \"development\", LAYQ_DEV_LOGIN: \"1\" };\n  assert.equal(developmentLoginEnabled(\"127.0.0.1:3000\", env), true);\n  for (const host of [\"public.example\", \"localhost.fake\", \"0.0.0.0\"])\n    assert.equal(developmentLoginEnabled(host, env), false);\n  assert.equal(\n    developmentLoginEnabled(\"localhost\", { ...env, NODE_ENV: \"production\" }),\n    false,\n  );\n  assert.equal(\n    developmentLoginEnabled(\"localhost\", { ...env, LAYQ_DEV_LOGIN: \"0\" }),\n    false,\n  );\n  const req = (origin) =>\n    new Request(\"http://localhost:3000/api/session\", {\n      headers: { host: \"localhost:3000\", origin },\n    });\n  assert.equal(sameOrigin(req(\"http://localhost:3000\")), true);\n  assert.equal(sameOrigin(req(\"http://example.net\")), false);\n});\ntest(\"validates titles and body before persistence\", () => {\n  assert.deepEqual(validatedBrief({ title: \" A \", body: \"\" }), {\n    title: \"A\",\n    body: \"\",\n  });\n  for (const input of [\n    null,\n    {},\n    { title: \" \", body: \"\" },\n    { title: \"t\", body: 9 },\n    { title: \"x\".repeat(121), body: \"\" },\n    { title: \"t\", body: \"x\".repeat(5001) },\n  ]) {\n    assert.throws(() => validatedBrief(input), RangeError);\n  }\n});\ntest(\"reopens SQLite, isolates owners, revokes sessions and preserves empty workspaces\", (t) => {\n  const dir = mkdtempSync(join(tmpdir(), \"layq-store-\"));\n  t.after(() => rmSync(dir, { recursive: true, force: true }));\n  const filename = join(dir, \"workspace.sqlite\");\n  const initial = openStore(filename);\n  const token = initial.login(\"alice\");\n  const seed = initial.list(\"alice\")[0];\n  const brief = initial.create(\"alice\", { title: \"First\", body: \"One\" });\n  initial.close();\n  const store = openStore(filename);\n  t.after(() => store.close());\n  assert.equal(store.session(token), \"alice\");\n  assert.equal(store.session(\"invalid\"), undefined);\n  assert.equal(store.read(\"alice\", brief.id).body, \"One\");\n  assert.equal(\n    store.update(\"bob\", brief.id, { title: \"Other\", body: \"\" }),\n    undefined,\n  );\n  assert.equal(store.remove(\"bob\", brief.id), false);\n  assert.equal(\n    store.update(\"alice\", brief.id, { title: \"Updated\", body: \"Two\" }).body,\n    \"Two\",\n  );\n  assert.equal(store.remove(\"alice\", brief.id), true);\n  assert.equal(store.remove(\"alice\", seed.id), true);\n  store.logout(token);\n  assert.equal(store.session(token), undefined);\n  store.login(\"alice\");\n  assert.deepEqual(store.list(\"alice\"), []);\n});\n"},{"path":"test/unit.test.mjs","sha256":"09bf88759e8412280650c297332736605d10a52bb0d37003c2bb193037cea861","content":"import test from 'node:test';\nimport assert from 'node:assert/strict';\nimport { resolveConfig } from '../src/config.mjs';\ntest('validates the theme and fills missing defaults', () => {\n  assert.deepEqual(resolveConfig({ theme: 'dark' }), { theme: 'dark', productName: 'Workspace', locale: 'en' });\n  assert.throws(() => resolveConfig({ theme: 'pink' }), /Theme/);\n});\n\ntest('all locales define each English message and one product-name slot', async () => {\n  const { messages, languageNames, resolveLocale } = await import('../src/locales.mjs');\n  assert.deepEqual(Object.keys(messages).sort(), ['en', 'es', 'ja', 'zh-CN']);\n  for (const [locale, values] of Object.entries(messages)) {\n    assert.equal(resolveLocale(locale), locale);\n    assert.ok(languageNames[locale]);\n    assert.deepEqual(Object.keys(values).sort(), Object.keys(messages.en).sort());\n    assert.ok(Object.values(values).every(value => typeof value === 'string' && value.trim()));\n    assert.equal(values.updates.split('{productName}').length, 2);\n  }\n  for (const unsupported of ['de', undefined, 'constructor']) {\n    assert.equal(resolveLocale(unsupported), 'en');\n  }\n});\n"}]}
