@sixb/app 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/agent/components/agent-threads.d.ts.map +1 -1
  2. package/dist/agent/components/composer-place.d.ts.map +1 -1
  3. package/dist/agent/components/computer-place.d.ts +24 -6
  4. package/dist/agent/components/computer-place.d.ts.map +1 -1
  5. package/dist/agent/components/conversation-panel.d.ts.map +1 -1
  6. package/dist/agent/components/message-view.d.ts +13 -3
  7. package/dist/agent/components/message-view.d.ts.map +1 -1
  8. package/dist/agent/components/pending-messages.d.ts.map +1 -1
  9. package/dist/agent/components/sandbox-recovery.d.ts +8 -2
  10. package/dist/agent/components/sandbox-recovery.d.ts.map +1 -1
  11. package/dist/agent/components/transcript.d.ts +13 -0
  12. package/dist/agent/components/transcript.d.ts.map +1 -1
  13. package/dist/agent/conversation.d.ts +4 -0
  14. package/dist/agent/conversation.d.ts.map +1 -1
  15. package/dist/agent/delegation/use-children.d.ts +5 -5
  16. package/dist/agent/delegation/use-children.d.ts.map +1 -1
  17. package/dist/agent/format.d.ts +7 -0
  18. package/dist/agent/format.d.ts.map +1 -1
  19. package/dist/agent/hooks/thread-queries.d.ts +1548 -0
  20. package/dist/agent/hooks/thread-queries.d.ts.map +1 -0
  21. package/dist/agent/hooks/use-agent-conversation.d.ts +41 -2
  22. package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
  23. package/dist/agent/hooks/use-thread-lists.d.ts +80 -3
  24. package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
  25. package/dist/agent/hooks/use-thread-place.d.ts +49 -0
  26. package/dist/agent/hooks/use-thread-place.d.ts.map +1 -0
  27. package/dist/agent/i18n/en.d.ts +44 -6
  28. package/dist/agent/i18n/en.d.ts.map +1 -1
  29. package/dist/agent/i18n/fr.d.ts.map +1 -1
  30. package/dist/agent/i18n/index.d.ts +76 -12
  31. package/dist/agent/i18n/index.d.ts.map +1 -1
  32. package/dist/agent/live-run.d.ts.map +1 -1
  33. package/dist/agent/model-selection.d.ts +3 -2
  34. package/dist/agent/model-selection.d.ts.map +1 -1
  35. package/dist/agent/moves.d.ts +40 -0
  36. package/dist/agent/moves.d.ts.map +1 -0
  37. package/dist/agent/thread-reader-state.d.ts +30 -0
  38. package/dist/agent/thread-reader-state.d.ts.map +1 -0
  39. package/dist/agent/types.d.ts +4 -0
  40. package/dist/agent/types.d.ts.map +1 -1
  41. package/dist/artifacts/live/session.d.ts.map +1 -1
  42. package/dist/artifacts/queries.d.ts.map +1 -1
  43. package/dist/artifacts/renderers/live-frame.d.ts.map +1 -1
  44. package/dist/{chunk-69qgh20f.js → chunk-1f4h75n3.js} +1 -1
  45. package/dist/{chunk-4fex83k2.js → chunk-7v9622qb.js} +2254 -739
  46. package/dist/{chunk-4fex83k2.js.map → chunk-7v9622qb.js.map} +29 -26
  47. package/dist/{chunk-5sgac68y.js → chunk-dntecmwb.js} +1 -1
  48. package/dist/{chunk-4wm09prf.js → chunk-qmka6aea.js} +1 -1
  49. package/dist/createCustomApp.d.ts +8 -1
  50. package/dist/createCustomApp.d.ts.map +1 -1
  51. package/dist/index.d.ts +3 -2
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +4 -2
  54. package/dist/index.js.map +3 -3
  55. package/dist/pages/console/data/accounts.d.ts +94 -0
  56. package/dist/pages/console/data/accounts.d.ts.map +1 -0
  57. package/dist/pages/console/data/connectors.d.ts.map +1 -1
  58. package/dist/pages/console/data/datasets.d.ts.map +1 -1
  59. package/dist/pages/console/data/live-updates.d.ts.map +1 -1
  60. package/dist/pages/console/data/messages.d.ts +46 -0
  61. package/dist/pages/console/data/messages.d.ts.map +1 -1
  62. package/dist/pages/console/data/pipelines.d.ts.map +1 -1
  63. package/dist/pages/console/data/projections.d.ts.map +1 -1
  64. package/dist/pages/console/data/sync-button.d.ts.map +1 -1
  65. package/dist/pages/console/data/syncs.d.ts.map +1 -1
  66. package/dist/pages/console/ontology/actions.d.ts.map +1 -1
  67. package/dist/pages/console/ontology/object-type.d.ts.map +1 -1
  68. package/dist/pages/console/ontology/object-types.d.ts.map +1 -1
  69. package/dist/pages/console/ontology/rules.d.ts.map +1 -1
  70. package/dist/pages/console/ontology/workflow.d.ts.map +1 -1
  71. package/dist/pages/console/ontology/workflows.d.ts.map +1 -1
  72. package/dist/pages/folders.d.ts +106 -0
  73. package/dist/pages/folders.d.ts.map +1 -0
  74. package/dist/pages/settings/usage/breakdown.d.ts.map +1 -1
  75. package/dist/pages/settings/usage/page.d.ts +4 -1
  76. package/dist/pages/settings/usage/page.d.ts.map +1 -1
  77. package/dist/pages/settings/usage/spend-model.d.ts +43 -19
  78. package/dist/pages/settings/usage/spend-model.d.ts.map +1 -1
  79. package/dist/pages.js +23453 -22656
  80. package/dist/pages.js.map +23 -21
  81. package/dist/server.d.ts +1 -1
  82. package/dist/server.d.ts.map +1 -1
  83. package/dist/server.js +40 -3
  84. package/dist/server.js.map +3 -3
  85. package/package.json +3 -3
  86. package/src/agent/agent-chat.tsx +2 -2
  87. package/src/agent/components/agent-threads.tsx +42 -2
  88. package/src/agent/components/composer-place.tsx +2 -7
  89. package/src/agent/components/computer-place.tsx +415 -70
  90. package/src/agent/components/conversation-panel.tsx +31 -26
  91. package/src/agent/components/message-view.tsx +418 -9
  92. package/src/agent/components/pending-messages.tsx +5 -1
  93. package/src/agent/components/sandbox-recovery.tsx +24 -6
  94. package/src/agent/components/transcript.tsx +136 -5
  95. package/src/agent/conversation.ts +16 -1
  96. package/src/agent/format.ts +52 -0
  97. package/src/agent/hooks/thread-queries.ts +75 -0
  98. package/src/agent/hooks/use-agent-conversation.ts +461 -112
  99. package/src/agent/hooks/use-thread-lists.ts +72 -7
  100. package/src/agent/hooks/use-thread-place.ts +239 -0
  101. package/src/agent/i18n/en.ts +69 -16
  102. package/src/agent/i18n/fr.ts +71 -19
  103. package/src/agent/live-run.ts +38 -0
  104. package/src/agent/model-selection.ts +3 -2
  105. package/src/agent/moves.ts +174 -0
  106. package/src/agent/thread-reader-state.ts +75 -0
  107. package/src/agent/types.ts +6 -0
  108. package/src/artifacts/live/session.ts +5 -0
  109. package/src/createCustomApp.ts +57 -3
  110. package/src/index.ts +4 -0
  111. package/src/pages/console/data/accounts.tsx +509 -0
  112. package/src/pages/console/data/connectors.tsx +67 -64
  113. package/src/pages/console/data/datasets.tsx +79 -68
  114. package/src/pages/console/data/live-updates.ts +2 -0
  115. package/src/pages/console/data/messages.ts +73 -0
  116. package/src/pages/console/data/pipelines.tsx +80 -69
  117. package/src/pages/console/data/projections.tsx +111 -82
  118. package/src/pages/console/data/sync-button.tsx +56 -16
  119. package/src/pages/console/data/syncs.tsx +121 -86
  120. package/src/pages/console/ontology/actions.tsx +51 -24
  121. package/src/pages/console/ontology/object-type.tsx +5 -1
  122. package/src/pages/console/ontology/object-types.tsx +41 -32
  123. package/src/pages/console/ontology/rules.tsx +48 -38
  124. package/src/pages/console/ontology/workflow.tsx +9 -3
  125. package/src/pages/console/ontology/workflows.tsx +55 -67
  126. package/src/pages/folders.tsx +335 -0
  127. package/src/pages/section-ui.tsx +1 -1
  128. package/src/pages/settings/usage/breakdown.tsx +5 -2
  129. package/src/pages/settings/usage/filter-menu.tsx +1 -1
  130. package/src/pages/settings/usage/page.tsx +32 -13
  131. package/src/pages/settings/usage/spend-chart.tsx +2 -2
  132. package/src/pages/settings/usage/spend-model.ts +118 -50
  133. package/src/server.ts +1 -0
  134. /package/dist/{chunk-69qgh20f.js.map → chunk-1f4h75n3.js.map} +0 -0
  135. /package/dist/{chunk-5sgac68y.js.map → chunk-dntecmwb.js.map} +0 -0
  136. /package/dist/{chunk-4wm09prf.js.map → chunk-qmka6aea.js.map} +0 -0
@@ -2,7 +2,7 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/createCustomApp.ts", "../src/build.ts", "../src/service-worker.ts", "../src/codegen.ts", "../src/manifest.ts", "../src/metadata.ts", "../src/runtime.ts", "../src/scanner.ts", "../src/dev-reload.ts", "../src/frame-origins.ts", "../src/styles.ts", "../src/tailwind.ts"],
4
4
  "sourcesContent": [
5
- "import { randomBytes } from \"node:crypto\"\nimport { existsSync, watch } from \"node:fs\"\nimport { access, cp, mkdir, readFile, rm, writeFile } from \"node:fs/promises\"\nimport { dirname, isAbsolute, join, normalize, relative, resolve } from \"node:path\"\nimport { pathToFileURL } from \"node:url\"\nimport {\n type BuildAppResult,\n type BuildSharedAppDevResult,\n buildApp,\n buildAuthExperience,\n buildSharedAppDev,\n prepareAppHtmlBundleEntry,\n restoreAppStaticUrls,\n SHARED_APP_SHELL_FILE_NAME,\n} from \"./build\"\nimport {\n type BuiltInRouteManifestEntry,\n generateAppEntry,\n generateAuthExperienceEntry,\n generateRouteManifest,\n} from \"./codegen\"\nimport { devReloadResponse } from \"./dev-reload\"\nimport { readAppFrameOrigins } from \"./frame-origins\"\nimport { collectPublicEnv, renderCustomAppRuntimeScript } from \"./runtime\"\nimport { type PageRoute, routePatternKey, scanAppRoutes } from \"./scanner\"\nimport { sectionCatalog } from \"./sections/catalog\"\nimport { IMMUTABLE_ASSET_PATTERN, SERVICE_WORKER_PATH } from \"./service-worker\"\nimport { type CustomAppStylesheet, resolveCustomAppStylesheet } from \"./styles\"\nimport { createTailwindCssCompiler, type TailwindCssCompiler } from \"./tailwind\"\n\nexport interface CreateCustomAppOptions {\n rootDir: string\n appDir?: string\n generatedDir?: string\n publicDir?: string\n apiBaseUrl?: string\n authEnabled?: boolean\n /** Home, the agent, object pages and the sections. On unless a test turns them off. */\n builtInPages?: boolean\n}\n\nexport interface CustomAppDevOptions {\n host?: string\n port?: number\n}\n\nexport interface CustomAppBuildOptions {\n outdir?: string\n}\n\nexport interface CustomAuthExperienceBuildOptions {\n outdir?: string\n}\n\nexport interface CustomAuthExperienceBuildResult {\n readonly outdir: string\n}\n\nexport interface CustomAppStartOptions {\n host?: string\n port?: number\n outdir?: string\n apiBaseUrl?: string\n authEnabled?: boolean\n}\n\nexport interface CustomAppServer {\n host: string\n /** The port it listens on: the one it bound when asked for port 0. */\n port: number\n url: string\n stop(): Promise<void>\n}\n\nexport interface CustomAppDevServer extends CustomAppServer {\n /** Whether it reloads the app's sources itself: not while the project has no `app/` folder. */\n watchesSources: boolean\n}\n\nexport interface CustomAppInstance {\n scanRoutes(): Promise<PageRoute[]>\n prepareAuthExperience(\n options?: CustomAuthExperienceBuildOptions\n ): Promise<CustomAuthExperienceBuildResult | null>\n dev(options?: CustomAppDevOptions): Promise<CustomAppDevServer>\n build(options?: CustomAppBuildOptions): Promise<BuildAppResult>\n start(options?: CustomAppStartOptions): Promise<CustomAppServer>\n}\n\ntype BunServeRoutes = NonNullable<Parameters<typeof Bun.serve>[0][\"routes\"]>\ntype BunServeRoute = BunServeRoutes[string]\nconst packageRoot = resolve(import.meta.dir, \"..\")\n// The shell parts a layout imports from `@sixb/app` style themselves with the same Tailwind build.\nconst shellSourcePath = join(packageRoot, \"src\", \"shell\")\nconst builtInPageModule = \"@sixb/app/pages\"\nconst builtInPageSourcePath = join(packageRoot, \"src\", \"pages\")\n// Styles built-in pages need beyond utilities: the pipeline canvas.\nconst builtInPageStylesheetPath = join(packageRoot, \"src\", \"pages\", \"canvas.css\")\n// The agent's styles beyond utilities, and the `@source` for its components.\nconst agentStylesheetPath = join(packageRoot, \"src\", \"agent\", \"agent.css\")\n// The artifact viewer's: the document page and the `@source` for its components.\nconst artifactsStylesheetPath = join(packageRoot, \"src\", \"artifacts\", \"artifacts.css\")\n// Phone navigation: screen motion and pull to refresh.\nconst phoneStylesheetPath = join(packageRoot, \"src\", \"shell\", \"phone\", \"phone.css\")\nconst customAppManifestRoute = \"/app.webmanifest\"\nconst internalAppShellRoute = \"/__sixb/generated/app-shell\"\n// Files the built-in pages show, such as connector logos, served from the package itself so they\n// need no build step of the project's.\nconst frameworkAssetsRoute = \"/__sixb/assets\"\nconst frameworkAssetsDir = join(packageRoot, \"assets\")\nconst internalSharedAppShellRoute = \"/__sixb/generated/shared-app-shell\"\n\nexport async function createCustomApp(options: CreateCustomAppOptions): Promise<CustomAppInstance> {\n const rootDir = resolve(options.rootDir)\n const appDir = options.appDir ? resolve(rootDir, options.appDir) : resolve(rootDir, \"app\")\n const generatedDir = resolve(rootDir, options.generatedDir ?? join(\".sixb\", \"generated\"))\n const publicDir = options.publicDir\n ? resolve(rootDir, options.publicDir)\n : resolve(appDir, \"public\")\n const apiBaseUrl = options.apiBaseUrl\n const authEnabled = options.authEnabled ?? true\n const builtInPagesEnabled = options.builtInPages ?? true\n\n async function scanRoutes(): Promise<PageRoute[]> {\n return [...(await scanAppRoutes(appDir)).pages]\n }\n\n // With the built-in pages on, every project is an app, even without an `app/` folder: they fill\n // its routes, Home included.\n function servesApp(routes: readonly PageRoute[]): boolean {\n return routes.length > 0 || builtInPagesEnabled\n }\n\n let tailwindCompiler: TailwindCssCompiler | null = null\n let tailwindCompilerKey: string | null = null\n let authTailwindCompiler: TailwindCssCompiler | null = null\n let frameworkCssCompiler: TailwindCssCompiler | null = null\n\n // `app/globals.css` is source. When it uses Tailwind, compile it to\n // `.sixb/generated/app.css` and bundle that; plain CSS bundles as-is. This\n // runs in both dev and build, so `sixb build` alone always produces fresh CSS.\n async function prepareStylesheet(stylesheet?: CustomAppStylesheet): Promise<CustomAppStylesheet> {\n stylesheet ??= await resolveCustomAppStylesheet({ appDir, generatedDir, rootDir })\n if (stylesheet.kind !== \"tailwind\") {\n return stylesheet\n }\n\n await compileAppTailwindStylesheet(stylesheet.sourcePath, stylesheet.outputPath)\n return stylesheet\n }\n\n async function compileAppTailwindStylesheet(\n inputPath: string,\n outputPath: string\n ): Promise<void> {\n const key = `${inputPath}\\0${outputPath}`\n if (tailwindCompilerKey !== key) {\n await tailwindCompiler?.stop()\n tailwindCompiler = createTailwindCssCompiler({\n inputPath,\n outputPath,\n // Scope Tailwind's automatic source detection to app/ so it never walks\n // vendor/ or unrelated trees; resolve the CLI from the project's deps.\n cwd: appDir,\n resolveFrom: rootDir,\n label: \"[SixbCustomApp]\",\n })\n tailwindCompilerKey = key\n }\n\n const compiler = tailwindCompiler\n if (!compiler) {\n throw new Error(\"[SixbCustomApp] Tailwind CSS compiler was not initialized\")\n }\n\n await compiler.compile()\n }\n\n async function prepareCombinedStylesheet(\n stylesheet: Extract<CustomAppStylesheet, { kind: \"tailwind\" }>\n ): Promise<string> {\n const inputPath = join(generatedDir, \"app.input.css\")\n const uiGlobalsPath = Bun.resolveSync(\"@sixb/ui/globals.css\", packageRoot)\n await writeFileIfChanged(\n inputPath,\n [\n `@import ${JSON.stringify(uiGlobalsPath)};`,\n `@source ${JSON.stringify(shellSourcePath)};`,\n `@source ${JSON.stringify(builtInPageSourcePath)};`,\n `@import ${JSON.stringify(builtInPageStylesheetPath)};`,\n `@import ${JSON.stringify(stylesheet.sourcePath)};`,\n `@import ${JSON.stringify(agentStylesheetPath)};`,\n `@import ${JSON.stringify(artifactsStylesheetPath)};`,\n `@import ${JSON.stringify(phoneStylesheetPath)};`,\n \"\",\n ].join(\"\\n\")\n )\n\n await compileAppTailwindStylesheet(inputPath, stylesheet.outputPath)\n return stylesheet.outputPath\n }\n\n async function prepareStylesheets(builtInRoutes: readonly BuiltInRouteManifestEntry[]): Promise<{\n stylesheetPath: string | null\n frameworkStylesheetPaths: readonly string[]\n }> {\n const stylesheet = await resolveCustomAppStylesheet({ appDir, generatedDir, rootDir })\n\n if (stylesheet.kind === \"tailwind\" && builtInRoutes.length > 0) {\n return {\n stylesheetPath: await prepareCombinedStylesheet(stylesheet),\n frameworkStylesheetPaths: [],\n }\n }\n\n const preparedStylesheet = await prepareStylesheet(stylesheet)\n const frameworkStylesheetPath = await prepareFrameworkStylesheet(builtInRoutes)\n\n return {\n frameworkStylesheetPaths: frameworkStylesheetPath ? [frameworkStylesheetPath] : [],\n stylesheetPath:\n preparedStylesheet.kind === \"none\"\n ? null\n : preparedStylesheet.kind === \"static\"\n ? preparedStylesheet.path\n : preparedStylesheet.outputPath,\n }\n }\n\n async function prepareFrameworkStylesheet(\n builtInRoutes: readonly BuiltInRouteManifestEntry[]\n ): Promise<string | null> {\n if (builtInRoutes.length === 0) {\n return null\n }\n\n const inputPath = join(generatedDir, \"framework.input.css\")\n const outputPath = join(generatedDir, \"framework.css\")\n const uiGlobalsPath = Bun.resolveSync(\"@sixb/ui/globals.css\", packageRoot)\n await writeFileIfChanged(\n inputPath,\n [\n `@import ${JSON.stringify(uiGlobalsPath)};`,\n `@source ${JSON.stringify(shellSourcePath)};`,\n `@source ${JSON.stringify(builtInPageSourcePath)};`,\n `@import ${JSON.stringify(builtInPageStylesheetPath)};`,\n `@import ${JSON.stringify(agentStylesheetPath)};`,\n `@import ${JSON.stringify(artifactsStylesheetPath)};`,\n `@import ${JSON.stringify(phoneStylesheetPath)};`,\n \"\",\n ].join(\"\\n\")\n )\n\n frameworkCssCompiler ??= createTailwindCssCompiler({\n inputPath,\n outputPath,\n cwd: packageRoot,\n resolveFrom: packageRoot,\n label: \"[SixbCustomApp]\",\n })\n await frameworkCssCompiler.compile()\n return outputPath\n }\n\n async function prepareGeneratedApp(): Promise<{\n htmlPath: string\n mainPath: string\n manifestPath: string\n runtimePath: string\n sharedHtmlPath: string\n sharedMainPath: string\n routes: PageRoute[]\n }> {\n assertAppPackagesInstalled(rootDir)\n const discovery = await scanAppRoutes(appDir)\n const routes = [...discovery.pages]\n if (!servesApp(routes)) {\n throw new Error(`[SixbCustomApp] No app routes found in ${appDir}`)\n }\n\n const builtInRoutes = builtInPagesEnabled ? builtInRoutesFor(routes) : []\n const stylesheets = await prepareStylesheets(builtInRoutes)\n await generateRouteManifest(routes, generatedDir, {\n builtInRoutes,\n layouts: discovery.layouts,\n })\n const entry = await generateAppEntry(rootDir, generatedDir, {\n apiBaseUrl,\n authEnabled,\n appDir,\n publicDir,\n frameworkStylesheetPaths: stylesheets.frameworkStylesheetPaths,\n stylesheetPath: stylesheets.stylesheetPath,\n sections: builtInPagesEnabled,\n projectPages: routes.length > 0,\n })\n return { ...entry, routes }\n }\n\n async function prepareAuthExperience(\n authOptions: CustomAuthExperienceBuildOptions = {}\n ): Promise<CustomAuthExperienceBuildResult | null> {\n const outdir = authOptions.outdir\n ? resolve(rootDir, authOptions.outdir)\n : join(generatedDir, \"auth\")\n if (!(await pathExists(join(appDir, \"auth.tsx\")))) {\n await rm(outdir, { recursive: true, force: true })\n return null\n }\n\n const stylesheet = await resolveCustomAppStylesheet({ appDir, generatedDir, rootDir })\n let stylesheetPath: string | null\n if (stylesheet.kind === \"none\") {\n stylesheetPath = null\n } else if (stylesheet.kind === \"static\") {\n stylesheetPath = stylesheet.path\n } else {\n const outputPath = join(generatedDir, \"auth.css\")\n authTailwindCompiler ??= createTailwindCssCompiler({\n inputPath: stylesheet.sourcePath,\n outputPath,\n cwd: appDir,\n resolveFrom: rootDir,\n label: \"[SixbCustomApp]\",\n })\n await authTailwindCompiler.compile()\n stylesheetPath = outputPath\n }\n\n const entry = await generateAuthExperienceEntry(rootDir, generatedDir, {\n appDir,\n publicDir,\n stylesheetPath,\n })\n if (!entry) {\n return null\n }\n\n const result = await buildAuthExperience({\n entryPath: entry.htmlPath,\n scriptEntryPath: entry.mainPath,\n outdir,\n })\n if (!result.success) {\n throw new Error(\n `[SixbCustomApp] Failed to build the auth experience: ${(result.logs ?? []).join(\"\\n\")}`\n )\n }\n return { outdir: result.outdir }\n }\n\n return {\n async scanRoutes() {\n return await scanRoutes()\n },\n\n async prepareAuthExperience(options) {\n return await prepareAuthExperience(options)\n },\n\n async dev(devOptions: CustomAppDevOptions = {}) {\n const publicEnv = collectPublicEnv()\n const frameOrigins = readAppFrameOrigins(process.env)\n const withRuntime = (html: string) =>\n injectRuntimeConfig(html, { apiBaseUrl, authEnabled, publicEnv })\n const host = devOptions.host ?? \"0.0.0.0\"\n const port = devOptions.port ?? 3000\n const { htmlPath, manifestPath, sharedHtmlPath, sharedMainPath } = await prepareGeneratedApp()\n await prepareAuthExperience()\n let htmlImportVersion = 0\n let htmlBundle = await importHtmlBundle(htmlPath, htmlImportVersion)\n const sharedDevRoot = join(generatedDir, \"shared-dev\")\n await rm(sharedDevRoot, { recursive: true, force: true })\n let sharedBuildVersion = 0\n let sharedSourceVersion = 0\n let sharedBuiltSourceVersion = -1\n let sharedBuild: BuildSharedAppDevResult | null = null\n let sharedBuildPromise: Promise<BuildSharedAppDevResult> | null = null\n let sharedAssetRoutes: BunServeRoutes = {}\n let stopping = false\n const privateAppShellRoute = `${internalAppShellRoute}-${randomBytes(18).toString(\"base64url\")}`\n const publicRoutes = (await pathExists(publicDir)) ? await createPublicRoutes(publicDir) : {}\n let internalOrigin = \"\"\n let server: ReturnType<typeof Bun.serve> | null = null\n const serveOptions = (bundle: Bun.HTMLBundle) =>\n ({\n port,\n hostname: host,\n development: true,\n routes: {\n ...publicRoutes,\n ...sharedAssetRoutes,\n ...reservedSixbRoutes(),\n \"/__sixb/dev-reload.js\": getHeadRoute(devReloadResponse),\n [`${frameworkAssetsRoute}/*`]: getHeadRoute((request) =>\n frameworkAssetResponse(request, new URL(request.url).pathname)\n ),\n [customAppManifestRoute]: manifestRoute(manifestPath),\n [privateAppShellRoute]: htmlBundleRoute(bundle),\n ...sharedAppDevRoutes(\n async () =>\n injectRuntimeConfig((await ensureSharedBuild()).html, {\n apiBaseUrl,\n authEnabled: false,\n publicEnv,\n }),\n apiBaseUrl,\n frameOrigins\n ),\n \"/\": spaHtmlRoute(() => internalOrigin, {\n shellRoute: privateAppShellRoute,\n transformHtml: withRuntime,\n apiBaseUrl,\n frameOrigins,\n }),\n \"/*\": spaHtmlRoute(() => internalOrigin, {\n shellRoute: privateAppShellRoute,\n transformHtml: withRuntime,\n apiBaseUrl,\n frameOrigins,\n }),\n },\n }) as Parameters<typeof Bun.serve>[0]\n\n // Bun 1.3's programmatic bundler shares native state with HTMLBundle imports. Starting a\n // second browser build for every ordinary dev server can corrupt later builds in the same\n // process (EISDIR/Unseekable reads). A shared page is uncommon, so build it only on its first\n // request and deduplicate concurrent GET/HEAD requests. Watch rebuilds invalidate this cache;\n // the next shared request gets the new graph while old hashed assets remain reachable.\n async function ensureSharedBuild(): Promise<BuildSharedAppDevResult> {\n if (stopping) {\n throw new Error(\"[SixbCustomApp] Shared development build requested while stopping.\")\n }\n if (sharedBuild && sharedBuiltSourceVersion === sharedSourceVersion) {\n return sharedBuild\n }\n if (sharedBuildPromise) {\n await sharedBuildPromise\n return await ensureSharedBuild()\n }\n\n const sourceVersion = sharedSourceVersion\n const outdir = join(sharedDevRoot, String(sharedBuildVersion++))\n const build = buildSharedAppDev({\n entryPath: sharedHtmlPath,\n outdir,\n scriptEntryPath: sharedMainPath,\n })\n .then((result) => {\n sharedAssetRoutes = {\n ...sharedAssetRoutes,\n ...createGeneratedAssetRoutes(outdir, result.assetPaths),\n }\n sharedBuild = result\n sharedBuiltSourceVersion = sourceVersion\n server?.reload(serveOptions(htmlBundle))\n return result\n })\n .finally(() => {\n sharedBuildPromise = null\n })\n sharedBuildPromise = build\n const result = await build\n if (!stopping && sourceVersion !== sharedSourceVersion) {\n return await ensureSharedBuild()\n }\n return result\n }\n\n server = Bun.serve(serveOptions(htmlBundle))\n const boundPort = server.port ?? port\n internalOrigin = devServerInternalOrigin(host, boundPort)\n\n // .ts/.tsx edits can change Tailwind's scanned classes and .css edits\n // change the stylesheet source, so both regenerate the entry and\n // recompile CSS. Debounced so a burst of saves builds once.\n let rebuildTimer: ReturnType<typeof setTimeout> | null = null\n let rebuildChain: Promise<void> = Promise.resolve()\n const enqueueRebuild = () => {\n rebuildChain = rebuildChain\n .then(async () => {\n const { htmlPath: nextHtmlPath } = await prepareGeneratedApp()\n await prepareAuthExperience()\n htmlImportVersion++\n htmlBundle = await importHtmlBundle(nextHtmlPath, htmlImportVersion)\n // prepareGeneratedApp refreshed the stable shared entry paths; invalidate the lazy\n // browser graph only after the normal HTML bundle also rebuilt successfully.\n sharedSourceVersion++\n server?.reload(serveOptions(htmlBundle))\n })\n .catch((error) => {\n // Keep serving the last good build, but tell the user why styles\n // or routes are stale instead of failing silently.\n const message = error instanceof Error ? error.message : String(error)\n console.error(`[SixbCustomApp] Rebuild failed: ${message}`)\n })\n }\n // A project without an `app/` folder serves the built-in pages alone. Nothing here can\n // watch a folder that does not exist yet, so `sixb dev` restarts when one is created.\n const watcher = (await pathExists(appDir))\n ? watch(appDir, { recursive: true }, (_eventType, filename) => {\n if (!filename) return\n if (!/\\.(ts|tsx|css)$/.test(String(filename))) return\n\n if (rebuildTimer) {\n clearTimeout(rebuildTimer)\n }\n rebuildTimer = setTimeout(() => {\n rebuildTimer = null\n enqueueRebuild()\n }, 80)\n })\n : null\n\n // An FSWatcher emits `error` as an event, and an unhandled one takes the whole dev process\n // down — the `.catch()` above only covers a failed rebuild. Losing file watching should cost\n // hot reload, not the server: keep serving the last good build and say so.\n watcher?.on(\"error\", (error: unknown) => {\n const message = error instanceof Error ? error.message : String(error)\n console.error(\n `[SixbCustomApp] Stopped watching ${appDir}: ${message}. ` +\n \"Serving the last build; restart to resume hot reload.\"\n )\n })\n\n const displayHost = host === \"0.0.0.0\" ? \"localhost\" : host\n\n return {\n host,\n port: boundPort,\n url: `http://${displayHost}:${boundPort}`,\n watchesSources: watcher !== null,\n async stop() {\n stopping = true\n if (rebuildTimer) {\n clearTimeout(rebuildTimer)\n rebuildTimer = null\n }\n watcher?.close()\n await rebuildChain\n await tailwindCompiler?.stop()\n await authTailwindCompiler?.stop()\n await frameworkCssCompiler?.stop()\n const activeServer = server\n server = null\n activeServer?.stop(true)\n await sharedBuildPromise?.catch(() => {})\n await rm(sharedDevRoot, { recursive: true, force: true })\n },\n }\n },\n\n async build(buildOptions: CustomAppBuildOptions = {}) {\n const outdir = resolve(rootDir, buildOptions.outdir ?? join(\".sixb\", \"dist\", \"app\"))\n const { htmlPath, mainPath, manifestPath, sharedHtmlPath, sharedMainPath } =\n await prepareGeneratedApp()\n const result = await buildApp({\n entryPath: htmlPath,\n scriptEntryPath: mainPath,\n sharedEntryPath: sharedHtmlPath,\n sharedScriptEntryPath: sharedMainPath,\n manifestPath,\n outdir,\n })\n\n if (result.success) {\n await prepareAuthExperience({ outdir: join(outdir, \"auth\") })\n }\n\n if (result.success && (await pathExists(publicDir))) {\n await cp(publicDir, outdir, {\n recursive: true,\n force: true,\n filter: (source) => {\n const resolvedSource = resolve(source)\n return (\n resolvedSource !== join(publicDir, \"app.webmanifest\") &&\n resolvedSource !== join(publicDir, SHARED_APP_SHELL_FILE_NAME) &&\n resolvedSource !== join(publicDir, \"auth\")\n )\n },\n })\n }\n\n return result\n },\n\n async start(startOptions: CustomAppStartOptions = {}) {\n const publicEnv = collectPublicEnv()\n const frameOrigins = readAppFrameOrigins(process.env)\n const host = startOptions.host ?? \"0.0.0.0\"\n const port = startOptions.port ?? 3000\n const outdir = resolve(rootDir, startOptions.outdir ?? join(\".sixb\", \"dist\", \"app\"))\n const indexPath = join(outdir, \"index.html\")\n const sharedIndexPath = join(outdir, SHARED_APP_SHELL_FILE_NAME)\n\n if (!(await pathExists(indexPath))) {\n throw new Error(`[SixbCustomApp] No built app found in ${outdir}`)\n }\n if (!(await pathExists(sharedIndexPath))) {\n throw new Error(\n `[SixbCustomApp] Built app in ${outdir} is missing ${SHARED_APP_SHELL_FILE_NAME}; rebuild required.`\n )\n }\n\n const indexHtml = injectRuntimeConfig(await Bun.file(indexPath).text(), {\n apiBaseUrl: startOptions.apiBaseUrl ?? apiBaseUrl,\n authEnabled: startOptions.authEnabled ?? authEnabled,\n publicEnv,\n })\n const sharedIndexHtml = injectRuntimeConfig(await Bun.file(sharedIndexPath).text(), {\n apiBaseUrl: startOptions.apiBaseUrl ?? apiBaseUrl,\n authEnabled: false,\n publicEnv,\n })\n const runtimeApiBaseUrl = startOptions.apiBaseUrl ?? apiBaseUrl\n const server = Bun.serve({\n port,\n hostname: host,\n development: false,\n async fetch(req) {\n const url = new URL(req.url)\n if (isReservedSixbRoute(url.pathname)) {\n return notFoundResponse()\n }\n\n if (isFrameworkPrivateRoute(url.pathname)) {\n return notFoundResponse()\n }\n\n if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n return notFoundResponse()\n }\n\n if (url.pathname.startsWith(`${frameworkAssetsRoute}/`)) {\n return frameworkAssetResponse(req, url.pathname)\n }\n\n if (isSharedAppRoute(url.pathname)) {\n if (isAssetRequest(url.pathname)) {\n return notFoundResponse()\n }\n return sharedHtmlResponse(req, sharedIndexHtml, runtimeApiBaseUrl, frameOrigins)\n }\n\n if (isSharedNamespace(url.pathname)) {\n return notFoundResponse()\n }\n\n if (url.pathname === \"/\" || url.pathname === \"\") {\n return htmlResponse(req, indexHtml, runtimeApiBaseUrl, frameOrigins)\n }\n\n const resolvedPath = resolveStaticPath(outdir, url.pathname)\n if (!resolvedPath) {\n return notFoundResponse()\n }\n\n const directFile = Bun.file(resolvedPath)\n if (await directFile.exists()) {\n if (resolvedPath === indexPath) {\n return htmlResponse(req, indexHtml, runtimeApiBaseUrl, frameOrigins)\n }\n return staticFileResponse(req, resolvedPath, staticAssetHeaders(url.pathname))\n }\n\n if (isAssetRequest(url.pathname)) {\n return notFoundResponse()\n }\n\n const htmlFile = Bun.file(`${resolvedPath}.html`)\n if (await htmlFile.exists()) {\n if (`${resolvedPath}.html` === indexPath) {\n return htmlResponse(req, indexHtml, runtimeApiBaseUrl, frameOrigins)\n }\n return fileResponse(req, htmlFile)\n }\n\n const nestedIndexFile = Bun.file(join(resolvedPath, \"index.html\"))\n if (await nestedIndexFile.exists()) {\n return fileResponse(req, nestedIndexFile)\n }\n\n return htmlResponse(req, indexHtml, runtimeApiBaseUrl, frameOrigins)\n },\n })\n\n const displayHost = host === \"0.0.0.0\" ? \"localhost\" : host\n const boundPort = server.port ?? port\n\n return {\n host,\n port: boundPort,\n url: `http://${displayHost}:${boundPort}`,\n async stop() {\n server.stop(true)\n },\n }\n },\n }\n}\n\nasync function pathExists(path: string): Promise<boolean> {\n try {\n await access(path)\n return true\n } catch {\n return false\n }\n}\n\n// The generated app imports these from the project, so the page code and the framework share one\n// copy of React. `@sixb/app` only names them as peers.\nconst appPeerPackages = [\"react\", \"react-dom\", \"react-router-dom\", \"@tanstack/react-query\"] as const\n\n// Looks for `node_modules` as the bundler does. `Bun.resolveSync` would also find Bun's global\n// install cache, which the bundler never reads.\nfunction assertAppPackagesInstalled(rootDir: string): void {\n const missing = appPeerPackages.filter((name) => {\n for (let dir = rootDir; ; dir = dirname(dir)) {\n if (existsSync(join(dir, \"node_modules\", name, \"package.json\"))) return false\n if (dirname(dir) === dir) return true\n }\n })\n if (missing.length > 0) throw new AppPackagesMissingError(missing)\n}\n\n/** The project lacks packages the app is bundled from. `sixb dev` keeps the API running. */\nexport class AppPackagesMissingError extends Error {\n readonly name = \"AppPackagesMissingError\"\n\n constructor(readonly missing: readonly string[]) {\n super(\n `[SixbCustomApp] The app needs ${missing.join(\", \")} in this project. Install them with: ` +\n `bun add ${missing.join(\" \")}`\n )\n }\n}\n\nfunction builtInRoutesFor(routes: readonly PageRoute[]): BuiltInRouteManifestEntry[] {\n const projectRoutePatterns = new Set(routes.map((route) => routePatternKey(route.path)))\n const builtInRoutes: BuiltInRouteManifestEntry[] = [\n { path: \"/threads\", moduleSpecifier: builtInPageModule, exportName: \"ThreadsPage\" },\n {\n path: \"/threads/:threadId\",\n moduleSpecifier: builtInPageModule,\n exportName: \"ThreadPage\",\n },\n {\n path: \"/agents/:threadId\",\n moduleSpecifier: builtInPageModule,\n exportName: \"AgentThreadRedirect\",\n // It only sends the reader on; the conversation it opens records the view.\n recordsActivity: false,\n },\n // Home starts threads that continue under /threads, so it ships with them.\n { path: \"/\", moduleSpecifier: builtInPageModule, exportName: \"HomePage\" },\n // Every object has a page, outside any section: grants decide who reads it.\n {\n path: \"/objects/:objectTypeId/:primaryId\",\n moduleSpecifier: builtInPageModule,\n exportName: \"ObjectPage\",\n },\n // So does every artifact: its owner reads it wherever a link to it leads, and finds it among\n // the rest in the gallery.\n { path: \"/artifacts\", moduleSpecifier: builtInPageModule, exportName: \"ArtifactsPage\" },\n {\n path: \"/artifacts/:artifactId\",\n moduleSpecifier: builtInPageModule,\n exportName: \"ArtifactPage\",\n },\n // The sections are developer tooling: opening one is not using the app.\n ...sectionCatalog.flatMap((section) => [\n {\n path: section.path,\n moduleSpecifier: builtInPageModule,\n exportName: section.indexExportName,\n recordsActivity: false,\n },\n ...section.pages.flatMap((page) => [\n {\n path: page.path,\n moduleSpecifier: builtInPageModule,\n exportName: page.exportName,\n recordsActivity: false,\n },\n ...(page.details ?? []).map((detail) => ({\n path: detail.path,\n moduleSpecifier: builtInPageModule,\n exportName: detail.exportName,\n recordsActivity: false,\n })),\n ]),\n ]),\n ]\n\n return builtInRoutes.filter((route) => !projectRoutePatterns.has(routePatternKey(route.path)))\n}\n\nasync function writeFileIfChanged(path: string, content: string): Promise<void> {\n try {\n if ((await readFile(path, \"utf-8\")) === content) {\n return\n }\n } catch (error) {\n if (!isFileNotFoundError(error)) {\n throw error\n }\n }\n\n await mkdir(dirname(path), { recursive: true })\n await writeFile(path, content, \"utf-8\")\n}\n\nfunction isFileNotFoundError(error: unknown): boolean {\n return (\n error instanceof Error &&\n \"code\" in error &&\n (error as Error & { readonly code?: unknown }).code === \"ENOENT\"\n )\n}\n\nasync function frameworkAssetResponse(request: Request, pathname: string): Promise<Response> {\n const resolvedPath = resolveStaticPath(\n frameworkAssetsDir,\n pathname.slice(frameworkAssetsRoute.length)\n )\n if (!resolvedPath || !(await Bun.file(resolvedPath).exists())) return notFoundResponse()\n // A release replaces the package, and with it every asset, so a day of caching is safe.\n return staticFileResponse(request, resolvedPath, { \"cache-control\": \"public, max-age=86400\" })\n}\n\nasync function createPublicRoutes(publicDir: string): Promise<BunServeRoutes> {\n const files = new Bun.Glob(\"**/*\").scan({\n cwd: publicDir,\n absolute: true,\n onlyFiles: true,\n })\n const routes: BunServeRoutes = {}\n\n for await (const filePath of files) {\n const routePath = `/${filePath\n .slice(publicDir.length + 1)\n .split(\"\\\\\")\n .join(\"/\")}`\n if (\n isReservedSixbRoute(routePath) ||\n isSharedNamespace(routePath) ||\n isFrameworkPrivateRoute(routePath) ||\n routePath === customAppManifestRoute\n ) {\n continue\n }\n routes[routePath] = getHeadRoute((request) => filePathResponse(request, filePath))\n }\n\n return routes\n}\n\nfunction createGeneratedAssetRoutes(\n outputRoot: string,\n assetPaths: readonly string[]\n): BunServeRoutes {\n const routes: BunServeRoutes = {}\n for (const assetPath of assetPaths) {\n const relativePath = relative(outputRoot, assetPath)\n if (relativePath.startsWith(\"..\") || isAbsolute(relativePath)) {\n throw new Error(`[SixbCustomApp] Shared development asset escaped its output directory.`)\n }\n const routePath = `/${relativePath.split(\"\\\\\").join(\"/\")}`\n routes[routePath] = getHeadRoute((request) =>\n fileResponse(request, Bun.file(assetPath), { \"cache-control\": \"no-store\" })\n )\n }\n return routes\n}\n\nfunction reservedSixbRoutes(): BunServeRoutes {\n const handler = () => notFoundResponse()\n return {\n [internalAppShellRoute]: allMethodsRoute(handler),\n [`${internalAppShellRoute}/*`]: allMethodsRoute(handler),\n [internalSharedAppShellRoute]: allMethodsRoute(handler),\n [`${internalSharedAppShellRoute}/*`]: allMethodsRoute(handler),\n [`/${SHARED_APP_SHELL_FILE_NAME}`]: allMethodsRoute(handler),\n \"/api\": allMethodsRoute(handler),\n \"/api/*\": allMethodsRoute(handler),\n \"/auth\": allMethodsRoute(handler),\n \"/auth/*\": allMethodsRoute(handler),\n \"/ws\": allMethodsRoute(handler),\n \"/ws/*\": allMethodsRoute(handler),\n \"/docs\": allMethodsRoute(handler),\n \"/docs/*\": allMethodsRoute(handler),\n }\n}\n\nfunction sharedAppDevRoutes(\n html: () => string | Promise<string>,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): BunServeRoutes {\n const reject = () => notFoundResponse()\n const guardedHandler = async (request: Request) => {\n const pathname = new URL(request.url).pathname\n if (!isSharedAppRoute(pathname) || isAssetRequest(pathname)) {\n return notFoundResponse()\n }\n return sharedHtmlResponse(request, await html(), apiBaseUrl, frameOrigins)\n }\n\n return {\n \"/shared\": allMethodsRoute(reject),\n \"/shared/*\": {\n GET: guardedHandler,\n HEAD: guardedHandler,\n POST: reject,\n PUT: reject,\n PATCH: reject,\n DELETE: reject,\n OPTIONS: reject,\n } as unknown as BunServeRoute,\n }\n}\n\nfunction isSharedAppRoute(pathname: string): boolean {\n return /^\\/shared\\/[^/]+(?:\\/.*)?$/.test(pathname)\n}\n\nfunction isSharedNamespace(pathname: string): boolean {\n const decoded = decodeRoutePathname(pathname)\n return decoded === \"/shared\" || decoded?.startsWith(\"/shared/\") === true\n}\n\nfunction isFrameworkPrivateRoute(pathname: string): boolean {\n const decoded = decodeRoutePathname(pathname)?.toLowerCase()\n if (!decoded) return false\n const sharedShellRoute = `/${SHARED_APP_SHELL_FILE_NAME}`\n return (\n decoded === sharedShellRoute ||\n decoded.startsWith(`${sharedShellRoute}/`) ||\n decoded === internalAppShellRoute ||\n decoded.startsWith(`${internalAppShellRoute}/`) ||\n decoded === internalSharedAppShellRoute ||\n decoded.startsWith(`${internalSharedAppShellRoute}/`)\n )\n}\n\nfunction decodeRoutePathname(pathname: string): string | null {\n try {\n return decodeURIComponent(pathname).replaceAll(\"\\\\\", \"/\")\n } catch {\n return null\n }\n}\n\nfunction isReservedSixbRoute(pathname: string): boolean {\n const decoded = decodeRoutePathname(pathname)\n if (!decoded) return false\n return (\n decoded === \"/api\" ||\n decoded.startsWith(\"/api/\") ||\n decoded === \"/auth\" ||\n decoded.startsWith(\"/auth/\") ||\n decoded === \"/ws\" ||\n decoded.startsWith(\"/ws/\") ||\n decoded === \"/docs\" ||\n decoded.startsWith(\"/docs/\")\n )\n}\n\n// Static-asset extensions whose absence should 404 rather than fall back to the\n// SPA shell — otherwise the browser would receive HTML for a missing\n// script/style/image and fail with a confusing content-type error.\nconst ASSET_EXTENSIONS = new Set([\n \"js\",\n \"mjs\",\n \"cjs\",\n \"css\",\n \"map\",\n \"json\",\n \"wasm\",\n \"ico\",\n \"png\",\n \"jpg\",\n \"jpeg\",\n \"gif\",\n \"svg\",\n \"webp\",\n \"avif\",\n \"bmp\",\n \"woff\",\n \"woff2\",\n \"ttf\",\n \"otf\",\n \"eot\",\n \"mp4\",\n \"webm\",\n \"ogg\",\n \"mp3\",\n \"wav\",\n \"txt\",\n \"xml\",\n \"webmanifest\",\n \"pdf\",\n])\n\nfunction isAssetRequest(pathname: string): boolean {\n // Decode first: client routes can carry percent-encoded slashes (`%2F`) inside a\n // single path segment (e.g. an object id), so the raw pathname's \"last segment\"\n // is unreliable. Falling back to the SPA shell for these is the whole point.\n let decoded = pathname\n try {\n decoded = decodeURIComponent(pathname)\n } catch {\n // Keep the raw pathname when it isn't valid percent-encoding.\n }\n const lastSegment = decoded.split(/[\\\\/]+/).pop() ?? \"\"\n const dot = lastSegment.lastIndexOf(\".\")\n // No extension, a leading-dot file, or a trailing dot → not an asset request.\n if (dot <= 0 || dot === lastSegment.length - 1) return false\n return ASSET_EXTENSIONS.has(lastSegment.slice(dot + 1).toLowerCase())\n}\n\nfunction resolveStaticPath(appRoot: string, pathname: string): string | null {\n let decodedPath: string\n try {\n decodedPath = decodeURIComponent(pathname)\n } catch {\n return null\n }\n\n if (decodedPath.includes(\"\\0\")) return null\n const segments = decodedPath.split(/[\\\\/]+/)\n if (segments.includes(\"..\")) return null\n\n const normalizedPath = normalize(decodedPath).replace(/^[\\\\/]+/, \"\")\n const resolvedPath = resolve(appRoot, normalizedPath)\n const rel = relative(appRoot, resolvedPath)\n\n if (rel.startsWith(\"..\") || isAbsolute(rel)) return null\n return resolvedPath\n}\n\nfunction injectRuntimeConfig(\n html: string,\n config: {\n readonly apiBaseUrl?: string\n readonly authEnabled: boolean\n readonly publicEnv: Record<string, string>\n }\n): string {\n const existingRuntimeScript = /<script>window\\.__SIXB_RUNTIME__ = (.*?);<\\/script>/\n const existingConfig = html.match(existingRuntimeScript)?.[1]\n const script = renderCustomAppRuntimeScript({\n auth: { enabled: config.authEnabled },\n ...(existingConfig ? JSON.parse(existingConfig) : {}),\n ...(config.apiBaseUrl\n ? {\n api: { baseUrl: config.apiBaseUrl },\n auth: { enabled: config.authEnabled },\n }\n : {}),\n publicEnv: config.publicEnv,\n })\n if (existingRuntimeScript.test(html)) {\n return html.replace(existingRuntimeScript, () => script)\n }\n\n if (/<head\\b[^>]*>/i.test(html)) {\n return html.replace(/<head\\b[^>]*>/i, (head) => `${head}\\n ${script}`)\n }\n\n return `${script}\\n${html}`\n}\n\nfunction htmlResponse(\n request: Request,\n html: string,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): Response {\n return new Response(request.method === \"HEAD\" ? null : html, {\n headers: {\n \"content-type\": \"text/html; charset=utf-8\",\n \"cache-control\": \"no-store\",\n \"content-security-policy\": appContentSecurityPolicy(request, apiBaseUrl, frameOrigins),\n },\n })\n}\n\n/**\n * The policy of the app's own page: it frames what the API serves, its artifacts' frames, and the\n * sites `SIXB_APP_FRAME_ORIGINS` lists. A page in an artifact frame reads its queries' rows as the\n * reader; its frame opens no window, and the frame's policy keeps what it loads to its files and a\n * few CDNs. This keeps the frame's navigations on those origins too, so a page's code cannot send\n * what it reads to any other site in an address.\n *\n * It is the only directive: what a project's own pages load is theirs, but a frame they embed from\n * a site the list leaves out is refused too.\n */\nfunction appContentSecurityPolicy(\n request: Request,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): string {\n return `frame-src ${frameSources(request, apiBaseUrl, frameOrigins)}`\n}\n\n/**\n * Where the page's frames may come from: the API's origin, `'self'` when it is the page's own, then\n * the listed sites.\n */\nfunction frameSources(\n request: Request,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): string {\n const { requestOrigin, apiOrigin } = resolveOrigins(request, apiBaseUrl)\n const api = apiOrigin === requestOrigin ? \"'self'\" : apiOrigin\n return [api, ...frameOrigins.filter((origin) => origin !== apiOrigin)].join(\" \")\n}\n\nfunction resolveOrigins(\n request: Request,\n apiBaseUrl: string | undefined\n): { readonly requestOrigin: string; readonly apiOrigin: string } {\n const requestOrigin = new URL(request.url).origin\n try {\n return { requestOrigin, apiOrigin: new URL(apiBaseUrl ?? requestOrigin, requestOrigin).origin }\n } catch {\n // The browser client reports an invalid runtime URL. Keep the document policy fail-closed.\n return { requestOrigin, apiOrigin: requestOrigin }\n }\n}\n\nfunction sharedHtmlResponse(\n request: Request,\n html: string,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): Response {\n const secured = secureSharedHtml(html, request, { apiBaseUrl, frameOrigins })\n return new Response(request.method === \"HEAD\" ? null : secured.html, {\n headers: {\n \"content-type\": \"text/html; charset=utf-8\",\n ...secured.headers,\n },\n })\n}\n\n/** The origin of an API's WebSockets: `wss:` beside `https:`, `ws:` beside `http:`. */\nfunction socketOrigin(apiOrigin: string): string {\n const url = new URL(apiOrigin)\n return `${url.protocol === \"https:\" ? \"wss:\" : \"ws:\"}//${url.host}`\n}\n\nfunction secureSharedHtml(\n html: string,\n request: Request,\n options: { readonly apiBaseUrl?: string; readonly frameOrigins: readonly string[] }\n): { readonly html: string; readonly headers: Record<string, string> } {\n const nonce = randomBytes(18).toString(\"base64url\")\n const { requestOrigin, apiOrigin } = resolveOrigins(request, options.apiBaseUrl)\n\n const apiSources = apiOrigin === requestOrigin ? [] : [apiOrigin]\n // The artifacts a link reaches are followed live, over the API's sockets.\n const connectSources = [\"'self'\", ...apiSources, socketOrigin(apiOrigin)]\n // Files are fetched or embedded from the API, which a split deployment serves from its own\n // origin; `https:` alone misses it in plain-HTTP development.\n const fileSources = [\"'self'\", ...apiSources, \"data:\", \"blob:\", \"https:\"]\n const scriptSources = [`'nonce-${nonce}'`, \"'strict-dynamic'\", \"'self'\"]\n const contentSecurityPolicy = [\n \"default-src 'none'\",\n \"base-uri 'none'\",\n \"object-src 'none'\",\n \"frame-ancestors 'none'\",\n \"form-action 'none'\",\n `script-src ${scriptSources.join(\" \")}`,\n \"style-src 'self' 'unsafe-inline'\",\n `img-src ${fileSources.join(\" \")}`,\n `media-src ${fileSources.join(\" \")}`,\n \"font-src 'self' data: https:\",\n `connect-src ${connectSources.join(\" \")}`,\n `frame-src ${frameSources(request, options.apiBaseUrl, options.frameOrigins)}`,\n \"manifest-src 'none'\",\n ].join(\"; \")\n\n return {\n html: html.replace(/<script(?![^>]*\\snonce=)/g, `<script nonce=\"${nonce}\"`),\n headers: {\n \"cache-control\": \"no-store\",\n \"content-security-policy\": contentSecurityPolicy,\n \"permissions-policy\":\n \"camera=(), geolocation=(), microphone=(), payment=(), usb=(), browsing-topics=()\",\n \"referrer-policy\": \"no-referrer\",\n \"x-content-type-options\": \"nosniff\",\n \"x-frame-options\": \"DENY\",\n \"x-robots-tag\": \"noindex, nofollow, noarchive\",\n },\n }\n}\n\n// buildApp emits content-hashed entry, chunk, and asset names (IMMUTABLE_ASSET_PATTERN). Their\n// contents can never change under the same URL, so they are safe to cache forever. Files copied\n// from `public/` keep their names across deploys and stay uncached.\nfunction staticAssetHeaders(pathname: string): Record<string, string> {\n if (pathname === customAppManifestRoute) {\n return {\n \"content-type\": \"application/manifest+json; charset=utf-8\",\n \"cache-control\": \"no-cache\",\n }\n }\n // Checked on every launch, so a deploy reaches installed apps at once.\n if (pathname === SERVICE_WORKER_PATH) {\n return { \"content-type\": \"text/javascript; charset=utf-8\", \"cache-control\": \"no-cache\" }\n }\n\n const lastSegment = pathname.split(\"/\").pop() ?? \"\"\n if (!IMMUTABLE_ASSET_PATTERN.test(lastSegment)) {\n return {}\n }\n\n return { \"cache-control\": \"public, max-age=31536000, immutable\" }\n}\n\nasync function staticFileResponse(\n request: Request,\n path: string,\n headers: Record<string, string>\n): Promise<Response> {\n const responseHeaders = new Headers(headers)\n const originalFile = Bun.file(path)\n let responseFile = originalFile\n\n if (isPrecompressedAsset(path)) {\n responseHeaders.append(\"vary\", \"Accept-Encoding\")\n if (!request.headers.has(\"range\")) {\n for (const encoding of acceptedPrecompressedEncodings(request)) {\n const candidate = Bun.file(`${path}.${encoding === \"br\" ? \"br\" : \"gz\"}`)\n if (!(await candidate.exists())) continue\n\n responseFile = candidate\n responseHeaders.set(\"content-encoding\", encoding)\n responseHeaders.set(\"content-type\", originalFile.type)\n break\n }\n }\n }\n\n return new Response(request.method === \"HEAD\" ? null : responseFile, {\n headers: responseHeaders,\n })\n}\n\nfunction isPrecompressedAsset(path: string): boolean {\n return path.endsWith(\".js\") || path.endsWith(\".css\")\n}\n\nfunction acceptedPrecompressedEncodings(request: Request): (\"br\" | \"gzip\")[] {\n const header = request.headers.get(\"accept-encoding\")\n if (!header) return []\n\n const qualities = new Map<string, number>()\n for (const item of header.split(\",\")) {\n const [rawName, ...parameters] = item.trim().split(\";\")\n const name = rawName.toLowerCase()\n let quality = 1\n for (const parameter of parameters) {\n const match = parameter.trim().match(/^q=(0(?:\\.\\d+)?|1(?:\\.0+)?)$/)\n if (match) quality = Number(match[1])\n }\n qualities.set(name, quality)\n }\n\n const wildcard = qualities.get(\"*\") ?? 0\n return ([\"br\", \"gzip\"] as const)\n .map((encoding, preference) => ({\n encoding,\n preference,\n quality: qualities.get(encoding) ?? wildcard,\n }))\n .filter((candidate) => candidate.quality > 0)\n .sort((left, right) => right.quality - left.quality || left.preference - right.preference)\n .map((candidate) => candidate.encoding)\n}\n\nfunction fileResponse(\n request: Request,\n file: Bun.BunFile,\n headers: Record<string, string> = {}\n): Response {\n return new Response(request.method === \"HEAD\" ? null : file, { headers })\n}\n\nfunction filePathResponse(request: Request, path: string): Response {\n return fileResponse(request, Bun.file(path))\n}\n\nfunction notFoundResponse(): Response {\n return new Response(\"Not Found\", {\n status: 404,\n headers: {\n \"cache-control\": \"no-store\",\n },\n })\n}\n\nfunction getHeadRoute(handler: (request: Request) => Response | Promise<Response>): BunServeRoute {\n return {\n GET: handler,\n HEAD: handler,\n } as unknown as BunServeRoute\n}\n\nfunction allMethodsRoute(handler: (request: Request) => Response): BunServeRoute {\n return {\n GET: handler,\n HEAD: handler,\n POST: handler,\n PUT: handler,\n PATCH: handler,\n DELETE: handler,\n OPTIONS: handler,\n } as unknown as BunServeRoute\n}\n\nasync function importHtmlBundle(htmlPath: string, version: number): Promise<Bun.HTMLBundle> {\n const bundleEntryPath = await prepareAppHtmlBundleEntry(htmlPath)\n const url = pathToFileURL(bundleEntryPath)\n url.searchParams.set(\"v\", String(version))\n const htmlModule = (await import(url.href)) as { default: Bun.HTMLBundle }\n return htmlModule.default\n}\n\nfunction htmlBundleRoute(bundle: Bun.HTMLBundle): BunServeRoute {\n return {\n GET: bundle,\n HEAD: bundle,\n } as unknown as BunServeRoute\n}\n\nfunction manifestRoute(manifestPath: string): BunServeRoute {\n return getHeadRoute((request) =>\n fileResponse(request, Bun.file(manifestPath), staticAssetHeaders(customAppManifestRoute))\n )\n}\n\nfunction devServerInternalOrigin(host: string, port: number): string {\n if (host === \"0.0.0.0\") {\n return `http://127.0.0.1:${port}`\n }\n if (host === \"::\" || host === \"[::]\") {\n return `http://[::1]:${port}`\n }\n\n const urlHost = host.includes(\":\") && !host.startsWith(\"[\") ? `[${host}]` : host\n return `http://${urlHost}:${port}`\n}\n\nfunction spaHtmlRoute(\n internalOrigin: () => string,\n options: {\n readonly shellRoute?: string\n readonly transformHtml?: (html: string) => string\n readonly apiBaseUrl?: string\n readonly frameOrigins: readonly string[]\n }\n): BunServeRoute {\n return getHeadRoute(async (request) => {\n const publicUrl = new URL(request.url)\n if (\n isReservedSixbRoute(publicUrl.pathname) ||\n isSharedNamespace(publicUrl.pathname) ||\n isFrameworkPrivateRoute(publicUrl.pathname)\n ) {\n return notFoundResponse()\n }\n if (publicUrl.pathname !== \"/\" && isAssetRequest(publicUrl.pathname)) {\n return notFoundResponse()\n }\n\n const url = new URL(options.shellRoute ?? internalAppShellRoute, internalOrigin())\n url.search = publicUrl.search\n const requestHeaders = new Headers(request.headers)\n for (const header of [\n \"forwarded\",\n \"host\",\n \"x-forwarded-host\",\n \"x-forwarded-port\",\n \"x-forwarded-proto\",\n ]) {\n requestHeaders.delete(header)\n }\n const bundleResponse = await fetch(\n new Request(url, { method: request.method, headers: requestHeaders })\n )\n const responseHeaders = new Headers(bundleResponse.headers)\n responseHeaders.delete(\"content-length\")\n responseHeaders.delete(\"etag\")\n responseHeaders.set(\n \"content-security-policy\",\n appContentSecurityPolicy(request, options.apiBaseUrl, options.frameOrigins)\n )\n if (request.method === \"HEAD\") {\n return new Response(null, {\n status: bundleResponse.status,\n statusText: bundleResponse.statusText,\n headers: responseHeaders,\n })\n }\n\n const html = restoreAppStaticUrls(await bundleResponse.text()).replace(\n \"</head>\",\n '<script src=\"/__sixb/dev-reload.js\"></script></head>'\n )\n return new Response(options.transformHtml?.(html) ?? html, {\n status: bundleResponse.status,\n statusText: bundleResponse.statusText,\n headers: responseHeaders,\n })\n })\n}\n",
5
+ "import { randomBytes } from \"node:crypto\"\nimport { existsSync, watch } from \"node:fs\"\nimport { access, cp, mkdir, readFile, rm, writeFile } from \"node:fs/promises\"\nimport { dirname, isAbsolute, join, normalize, relative, resolve } from \"node:path\"\nimport { pathToFileURL } from \"node:url\"\nimport {\n type BuildAppResult,\n type BuildSharedAppDevResult,\n buildApp,\n buildAuthExperience,\n buildSharedAppDev,\n prepareAppHtmlBundleEntry,\n restoreAppStaticUrls,\n SHARED_APP_SHELL_FILE_NAME,\n} from \"./build\"\nimport {\n type BuiltInRouteManifestEntry,\n generateAppEntry,\n generateAuthExperienceEntry,\n generateRouteManifest,\n} from \"./codegen\"\nimport { devReloadResponse } from \"./dev-reload\"\nimport { readAppFrameOrigins } from \"./frame-origins\"\nimport { collectPublicEnv, renderCustomAppRuntimeScript } from \"./runtime\"\nimport { type PageRoute, routePatternKey, scanAppRoutes } from \"./scanner\"\nimport { sectionCatalog } from \"./sections/catalog\"\nimport { IMMUTABLE_ASSET_PATTERN, SERVICE_WORKER_PATH } from \"./service-worker\"\nimport { type CustomAppStylesheet, resolveCustomAppStylesheet } from \"./styles\"\nimport { createTailwindCssCompiler, type TailwindCssCompiler } from \"./tailwind\"\n\nexport interface CreateCustomAppOptions {\n rootDir: string\n appDir?: string\n generatedDir?: string\n publicDir?: string\n apiBaseUrl?: string\n authEnabled?: boolean\n /** Home, the agent, object pages and the sections. On unless a test turns them off. */\n builtInPages?: boolean\n}\n\nexport interface CustomAppDevOptions {\n host?: string\n port?: number\n}\n\nexport interface CustomAppBuildOptions {\n outdir?: string\n}\n\nexport interface CustomAuthExperienceBuildOptions {\n outdir?: string\n}\n\nexport interface CustomAuthExperienceBuildResult {\n readonly outdir: string\n}\n\nexport interface CustomAppStartOptions {\n host?: string\n port?: number\n outdir?: string\n apiBaseUrl?: string\n authEnabled?: boolean\n}\n\nexport interface CustomAppStopOptions {\n /**\n * How long in-flight requests may take to finish before remaining connections are closed.\n * Defaults to 5 seconds; `0` closes them at once.\n */\n readonly timeoutMs?: number\n}\n\nexport interface CustomAppServer {\n host: string\n /** The port it listens on: the one it bound when asked for port 0. */\n port: number\n url: string\n stop(options?: CustomAppStopOptions): Promise<void>\n}\n\nexport interface CustomAppDevServer extends CustomAppServer {\n /** Whether it reloads the app's sources itself: not while the project has no `app/` folder. */\n watchesSources: boolean\n}\n\nexport interface CustomAppInstance {\n scanRoutes(): Promise<PageRoute[]>\n prepareAuthExperience(\n options?: CustomAuthExperienceBuildOptions\n ): Promise<CustomAuthExperienceBuildResult | null>\n dev(options?: CustomAppDevOptions): Promise<CustomAppDevServer>\n build(options?: CustomAppBuildOptions): Promise<BuildAppResult>\n start(options?: CustomAppStartOptions): Promise<CustomAppServer>\n}\n\ntype BunServeRoutes = NonNullable<Parameters<typeof Bun.serve>[0][\"routes\"]>\ntype BunServeRoute = BunServeRoutes[string]\nconst packageRoot = resolve(import.meta.dir, \"..\")\n// The shell parts a layout imports from `@sixb/app` style themselves with the same Tailwind build.\nconst shellSourcePath = join(packageRoot, \"src\", \"shell\")\nconst builtInPageModule = \"@sixb/app/pages\"\nconst builtInPageSourcePath = join(packageRoot, \"src\", \"pages\")\n// Styles built-in pages need beyond utilities: the pipeline canvas.\nconst builtInPageStylesheetPath = join(packageRoot, \"src\", \"pages\", \"canvas.css\")\n// The agent's styles beyond utilities, and the `@source` for its components.\nconst agentStylesheetPath = join(packageRoot, \"src\", \"agent\", \"agent.css\")\n// The artifact viewer's: the document page and the `@source` for its components.\nconst artifactsStylesheetPath = join(packageRoot, \"src\", \"artifacts\", \"artifacts.css\")\n// Phone navigation: screen motion and pull to refresh.\nconst phoneStylesheetPath = join(packageRoot, \"src\", \"shell\", \"phone\", \"phone.css\")\nconst customAppManifestRoute = \"/app.webmanifest\"\nconst internalAppShellRoute = \"/__sixb/generated/app-shell\"\n// Files the built-in pages show, such as connector logos, served from the package itself so they\n// need no build step of the project's.\nconst frameworkAssetsRoute = \"/__sixb/assets\"\nconst frameworkAssetsDir = join(packageRoot, \"assets\")\nconst internalSharedAppShellRoute = \"/__sixb/generated/shared-app-shell\"\n\nexport async function createCustomApp(options: CreateCustomAppOptions): Promise<CustomAppInstance> {\n const rootDir = resolve(options.rootDir)\n const appDir = options.appDir ? resolve(rootDir, options.appDir) : resolve(rootDir, \"app\")\n const generatedDir = resolve(rootDir, options.generatedDir ?? join(\".sixb\", \"generated\"))\n const publicDir = options.publicDir\n ? resolve(rootDir, options.publicDir)\n : resolve(appDir, \"public\")\n const apiBaseUrl = options.apiBaseUrl\n const authEnabled = options.authEnabled ?? true\n const builtInPagesEnabled = options.builtInPages ?? true\n\n async function scanRoutes(): Promise<PageRoute[]> {\n return [...(await scanAppRoutes(appDir)).pages]\n }\n\n // With the built-in pages on, every project is an app, even without an `app/` folder: they fill\n // its routes, Home included.\n function servesApp(routes: readonly PageRoute[]): boolean {\n return routes.length > 0 || builtInPagesEnabled\n }\n\n let tailwindCompiler: TailwindCssCompiler | null = null\n let tailwindCompilerKey: string | null = null\n let authTailwindCompiler: TailwindCssCompiler | null = null\n let frameworkCssCompiler: TailwindCssCompiler | null = null\n\n // `app/globals.css` is source. When it uses Tailwind, compile it to\n // `.sixb/generated/app.css` and bundle that; plain CSS bundles as-is. This\n // runs in both dev and build, so `sixb build` alone always produces fresh CSS.\n async function prepareStylesheet(stylesheet?: CustomAppStylesheet): Promise<CustomAppStylesheet> {\n stylesheet ??= await resolveCustomAppStylesheet({ appDir, generatedDir, rootDir })\n if (stylesheet.kind !== \"tailwind\") {\n return stylesheet\n }\n\n await compileAppTailwindStylesheet(stylesheet.sourcePath, stylesheet.outputPath)\n return stylesheet\n }\n\n async function compileAppTailwindStylesheet(\n inputPath: string,\n outputPath: string\n ): Promise<void> {\n const key = `${inputPath}\\0${outputPath}`\n if (tailwindCompilerKey !== key) {\n await tailwindCompiler?.stop()\n tailwindCompiler = createTailwindCssCompiler({\n inputPath,\n outputPath,\n // Scope Tailwind's automatic source detection to app/ so it never walks\n // vendor/ or unrelated trees; resolve the CLI from the project's deps.\n cwd: appDir,\n resolveFrom: rootDir,\n label: \"[SixbCustomApp]\",\n })\n tailwindCompilerKey = key\n }\n\n const compiler = tailwindCompiler\n if (!compiler) {\n throw new Error(\"[SixbCustomApp] Tailwind CSS compiler was not initialized\")\n }\n\n await compiler.compile()\n }\n\n async function prepareCombinedStylesheet(\n stylesheet: Extract<CustomAppStylesheet, { kind: \"tailwind\" }>\n ): Promise<string> {\n const inputPath = join(generatedDir, \"app.input.css\")\n const uiGlobalsPath = Bun.resolveSync(\"@sixb/ui/globals.css\", packageRoot)\n await writeFileIfChanged(\n inputPath,\n [\n `@import ${JSON.stringify(uiGlobalsPath)};`,\n `@source ${JSON.stringify(shellSourcePath)};`,\n `@source ${JSON.stringify(builtInPageSourcePath)};`,\n `@import ${JSON.stringify(builtInPageStylesheetPath)};`,\n `@import ${JSON.stringify(stylesheet.sourcePath)};`,\n `@import ${JSON.stringify(agentStylesheetPath)};`,\n `@import ${JSON.stringify(artifactsStylesheetPath)};`,\n `@import ${JSON.stringify(phoneStylesheetPath)};`,\n \"\",\n ].join(\"\\n\")\n )\n\n await compileAppTailwindStylesheet(inputPath, stylesheet.outputPath)\n return stylesheet.outputPath\n }\n\n async function prepareStylesheets(builtInRoutes: readonly BuiltInRouteManifestEntry[]): Promise<{\n stylesheetPath: string | null\n frameworkStylesheetPaths: readonly string[]\n }> {\n const stylesheet = await resolveCustomAppStylesheet({ appDir, generatedDir, rootDir })\n\n if (stylesheet.kind === \"tailwind\" && builtInRoutes.length > 0) {\n return {\n stylesheetPath: await prepareCombinedStylesheet(stylesheet),\n frameworkStylesheetPaths: [],\n }\n }\n\n const preparedStylesheet = await prepareStylesheet(stylesheet)\n const frameworkStylesheetPath = await prepareFrameworkStylesheet(builtInRoutes)\n\n return {\n frameworkStylesheetPaths: frameworkStylesheetPath ? [frameworkStylesheetPath] : [],\n stylesheetPath:\n preparedStylesheet.kind === \"none\"\n ? null\n : preparedStylesheet.kind === \"static\"\n ? preparedStylesheet.path\n : preparedStylesheet.outputPath,\n }\n }\n\n async function prepareFrameworkStylesheet(\n builtInRoutes: readonly BuiltInRouteManifestEntry[]\n ): Promise<string | null> {\n if (builtInRoutes.length === 0) {\n return null\n }\n\n const inputPath = join(generatedDir, \"framework.input.css\")\n const outputPath = join(generatedDir, \"framework.css\")\n const uiGlobalsPath = Bun.resolveSync(\"@sixb/ui/globals.css\", packageRoot)\n await writeFileIfChanged(\n inputPath,\n [\n `@import ${JSON.stringify(uiGlobalsPath)};`,\n `@source ${JSON.stringify(shellSourcePath)};`,\n `@source ${JSON.stringify(builtInPageSourcePath)};`,\n `@import ${JSON.stringify(builtInPageStylesheetPath)};`,\n `@import ${JSON.stringify(agentStylesheetPath)};`,\n `@import ${JSON.stringify(artifactsStylesheetPath)};`,\n `@import ${JSON.stringify(phoneStylesheetPath)};`,\n \"\",\n ].join(\"\\n\")\n )\n\n frameworkCssCompiler ??= createTailwindCssCompiler({\n inputPath,\n outputPath,\n cwd: packageRoot,\n resolveFrom: packageRoot,\n label: \"[SixbCustomApp]\",\n })\n await frameworkCssCompiler.compile()\n return outputPath\n }\n\n async function prepareGeneratedApp(): Promise<{\n htmlPath: string\n mainPath: string\n manifestPath: string\n runtimePath: string\n sharedHtmlPath: string\n sharedMainPath: string\n routes: PageRoute[]\n }> {\n assertAppPackagesInstalled(rootDir)\n const discovery = await scanAppRoutes(appDir)\n const routes = [...discovery.pages]\n if (!servesApp(routes)) {\n throw new Error(`[SixbCustomApp] No app routes found in ${appDir}`)\n }\n\n const builtInRoutes = builtInPagesEnabled ? builtInRoutesFor(routes) : []\n const stylesheets = await prepareStylesheets(builtInRoutes)\n await generateRouteManifest(routes, generatedDir, {\n builtInRoutes,\n layouts: discovery.layouts,\n })\n const entry = await generateAppEntry(rootDir, generatedDir, {\n apiBaseUrl,\n authEnabled,\n appDir,\n publicDir,\n frameworkStylesheetPaths: stylesheets.frameworkStylesheetPaths,\n stylesheetPath: stylesheets.stylesheetPath,\n sections: builtInPagesEnabled,\n projectPages: routes.length > 0,\n })\n return { ...entry, routes }\n }\n\n async function prepareAuthExperience(\n authOptions: CustomAuthExperienceBuildOptions = {}\n ): Promise<CustomAuthExperienceBuildResult | null> {\n const outdir = authOptions.outdir\n ? resolve(rootDir, authOptions.outdir)\n : join(generatedDir, \"auth\")\n if (!(await pathExists(join(appDir, \"auth.tsx\")))) {\n await rm(outdir, { recursive: true, force: true })\n return null\n }\n\n const stylesheet = await resolveCustomAppStylesheet({ appDir, generatedDir, rootDir })\n let stylesheetPath: string | null\n if (stylesheet.kind === \"none\") {\n stylesheetPath = null\n } else if (stylesheet.kind === \"static\") {\n stylesheetPath = stylesheet.path\n } else {\n const outputPath = join(generatedDir, \"auth.css\")\n authTailwindCompiler ??= createTailwindCssCompiler({\n inputPath: stylesheet.sourcePath,\n outputPath,\n cwd: appDir,\n resolveFrom: rootDir,\n label: \"[SixbCustomApp]\",\n })\n await authTailwindCompiler.compile()\n stylesheetPath = outputPath\n }\n\n const entry = await generateAuthExperienceEntry(rootDir, generatedDir, {\n appDir,\n publicDir,\n stylesheetPath,\n })\n if (!entry) {\n return null\n }\n\n const result = await buildAuthExperience({\n entryPath: entry.htmlPath,\n scriptEntryPath: entry.mainPath,\n outdir,\n })\n if (!result.success) {\n throw new Error(\n `[SixbCustomApp] Failed to build the auth experience: ${(result.logs ?? []).join(\"\\n\")}`\n )\n }\n return { outdir: result.outdir }\n }\n\n return {\n async scanRoutes() {\n return await scanRoutes()\n },\n\n async prepareAuthExperience(options) {\n return await prepareAuthExperience(options)\n },\n\n async dev(devOptions: CustomAppDevOptions = {}) {\n const publicEnv = collectPublicEnv()\n const frameOrigins = readAppFrameOrigins(process.env)\n const withRuntime = (html: string) =>\n injectRuntimeConfig(html, { apiBaseUrl, authEnabled, publicEnv })\n const host = devOptions.host ?? \"0.0.0.0\"\n const port = devOptions.port ?? 3000\n const { htmlPath, manifestPath, sharedHtmlPath, sharedMainPath } = await prepareGeneratedApp()\n await prepareAuthExperience()\n let htmlImportVersion = 0\n let htmlBundle = await importHtmlBundle(htmlPath, htmlImportVersion)\n const sharedDevRoot = join(generatedDir, \"shared-dev\")\n await rm(sharedDevRoot, { recursive: true, force: true })\n let sharedBuildVersion = 0\n let sharedSourceVersion = 0\n let sharedBuiltSourceVersion = -1\n let sharedBuild: BuildSharedAppDevResult | null = null\n let sharedBuildPromise: Promise<BuildSharedAppDevResult> | null = null\n let sharedAssetRoutes: BunServeRoutes = {}\n let stopping = false\n const privateAppShellRoute = `${internalAppShellRoute}-${randomBytes(18).toString(\"base64url\")}`\n const publicRoutes = (await pathExists(publicDir)) ? await createPublicRoutes(publicDir) : {}\n let internalOrigin = \"\"\n let server: ReturnType<typeof Bun.serve> | null = null\n const serveOptions = (bundle: Bun.HTMLBundle) =>\n ({\n port,\n hostname: host,\n development: true,\n routes: {\n ...publicRoutes,\n ...sharedAssetRoutes,\n ...reservedSixbRoutes(),\n \"/__sixb/dev-reload.js\": getHeadRoute(devReloadResponse),\n [`${frameworkAssetsRoute}/*`]: getHeadRoute((request) =>\n frameworkAssetResponse(request, new URL(request.url).pathname)\n ),\n [customAppManifestRoute]: manifestRoute(manifestPath),\n [privateAppShellRoute]: htmlBundleRoute(bundle),\n ...sharedAppDevRoutes(\n async () =>\n injectRuntimeConfig((await ensureSharedBuild()).html, {\n apiBaseUrl,\n authEnabled: false,\n publicEnv,\n }),\n apiBaseUrl,\n frameOrigins\n ),\n \"/\": spaHtmlRoute(() => internalOrigin, {\n shellRoute: privateAppShellRoute,\n transformHtml: withRuntime,\n apiBaseUrl,\n frameOrigins,\n }),\n \"/*\": spaHtmlRoute(() => internalOrigin, {\n shellRoute: privateAppShellRoute,\n transformHtml: withRuntime,\n apiBaseUrl,\n frameOrigins,\n }),\n },\n }) as Parameters<typeof Bun.serve>[0]\n\n // Bun 1.3's programmatic bundler shares native state with HTMLBundle imports. Starting a\n // second browser build for every ordinary dev server can corrupt later builds in the same\n // process (EISDIR/Unseekable reads). A shared page is uncommon, so build it only on its first\n // request and deduplicate concurrent GET/HEAD requests. Watch rebuilds invalidate this cache;\n // the next shared request gets the new graph while old hashed assets remain reachable.\n async function ensureSharedBuild(): Promise<BuildSharedAppDevResult> {\n if (stopping) {\n throw new Error(\"[SixbCustomApp] Shared development build requested while stopping.\")\n }\n if (sharedBuild && sharedBuiltSourceVersion === sharedSourceVersion) {\n return sharedBuild\n }\n if (sharedBuildPromise) {\n await sharedBuildPromise\n return await ensureSharedBuild()\n }\n\n const sourceVersion = sharedSourceVersion\n const outdir = join(sharedDevRoot, String(sharedBuildVersion++))\n const build = buildSharedAppDev({\n entryPath: sharedHtmlPath,\n outdir,\n scriptEntryPath: sharedMainPath,\n })\n .then((result) => {\n sharedAssetRoutes = {\n ...sharedAssetRoutes,\n ...createGeneratedAssetRoutes(outdir, result.assetPaths),\n }\n sharedBuild = result\n sharedBuiltSourceVersion = sourceVersion\n server?.reload(serveOptions(htmlBundle))\n return result\n })\n .finally(() => {\n sharedBuildPromise = null\n })\n sharedBuildPromise = build\n const result = await build\n if (!stopping && sourceVersion !== sharedSourceVersion) {\n return await ensureSharedBuild()\n }\n return result\n }\n\n server = Bun.serve(serveOptions(htmlBundle))\n const boundPort = server.port ?? port\n internalOrigin = devServerInternalOrigin(host, boundPort)\n\n // .ts/.tsx edits can change Tailwind's scanned classes and .css edits\n // change the stylesheet source, so both regenerate the entry and\n // recompile CSS. Debounced so a burst of saves builds once.\n let rebuildTimer: ReturnType<typeof setTimeout> | null = null\n let rebuildChain: Promise<void> = Promise.resolve()\n const enqueueRebuild = () => {\n rebuildChain = rebuildChain\n .then(async () => {\n const { htmlPath: nextHtmlPath } = await prepareGeneratedApp()\n await prepareAuthExperience()\n htmlImportVersion++\n htmlBundle = await importHtmlBundle(nextHtmlPath, htmlImportVersion)\n // prepareGeneratedApp refreshed the stable shared entry paths; invalidate the lazy\n // browser graph only after the normal HTML bundle also rebuilt successfully.\n sharedSourceVersion++\n server?.reload(serveOptions(htmlBundle))\n })\n .catch((error) => {\n // Keep serving the last good build, but tell the user why styles\n // or routes are stale instead of failing silently.\n const message = error instanceof Error ? error.message : String(error)\n console.error(`[SixbCustomApp] Rebuild failed: ${message}`)\n })\n }\n // A project without an `app/` folder serves the built-in pages alone. Nothing here can\n // watch a folder that does not exist yet, so `sixb dev` restarts when one is created.\n const watcher = (await pathExists(appDir))\n ? watch(appDir, { recursive: true }, (_eventType, filename) => {\n if (!filename) return\n if (!/\\.(ts|tsx|css)$/.test(String(filename))) return\n\n if (rebuildTimer) {\n clearTimeout(rebuildTimer)\n }\n rebuildTimer = setTimeout(() => {\n rebuildTimer = null\n enqueueRebuild()\n }, 80)\n })\n : null\n\n // An FSWatcher emits `error` as an event, and an unhandled one takes the whole dev process\n // down — the `.catch()` above only covers a failed rebuild. Losing file watching should cost\n // hot reload, not the server: keep serving the last good build and say so.\n watcher?.on(\"error\", (error: unknown) => {\n const message = error instanceof Error ? error.message : String(error)\n console.error(\n `[SixbCustomApp] Stopped watching ${appDir}: ${message}. ` +\n \"Serving the last build; restart to resume hot reload.\"\n )\n })\n\n const displayHost = host === \"0.0.0.0\" ? \"localhost\" : host\n\n return {\n host,\n port: boundPort,\n url: `http://${displayHost}:${boundPort}`,\n watchesSources: watcher !== null,\n async stop() {\n stopping = true\n if (rebuildTimer) {\n clearTimeout(rebuildTimer)\n rebuildTimer = null\n }\n watcher?.close()\n await rebuildChain\n await tailwindCompiler?.stop()\n await authTailwindCompiler?.stop()\n await frameworkCssCompiler?.stop()\n const activeServer = server\n server = null\n activeServer?.stop(true)\n await sharedBuildPromise?.catch(() => {})\n await rm(sharedDevRoot, { recursive: true, force: true })\n },\n }\n },\n\n async build(buildOptions: CustomAppBuildOptions = {}) {\n const outdir = resolve(rootDir, buildOptions.outdir ?? join(\".sixb\", \"dist\", \"app\"))\n const { htmlPath, mainPath, manifestPath, sharedHtmlPath, sharedMainPath } =\n await prepareGeneratedApp()\n const result = await buildApp({\n entryPath: htmlPath,\n scriptEntryPath: mainPath,\n sharedEntryPath: sharedHtmlPath,\n sharedScriptEntryPath: sharedMainPath,\n manifestPath,\n outdir,\n })\n\n if (result.success) {\n await prepareAuthExperience({ outdir: join(outdir, \"auth\") })\n }\n\n if (result.success && (await pathExists(publicDir))) {\n await cp(publicDir, outdir, {\n recursive: true,\n force: true,\n filter: (source) => {\n const resolvedSource = resolve(source)\n return (\n resolvedSource !== join(publicDir, \"app.webmanifest\") &&\n resolvedSource !== join(publicDir, SHARED_APP_SHELL_FILE_NAME) &&\n resolvedSource !== join(publicDir, \"auth\")\n )\n },\n })\n }\n\n return result\n },\n\n async start(startOptions: CustomAppStartOptions = {}) {\n const publicEnv = collectPublicEnv()\n const frameOrigins = readAppFrameOrigins(process.env)\n const host = startOptions.host ?? \"0.0.0.0\"\n const port = startOptions.port ?? 3000\n const outdir = resolve(rootDir, startOptions.outdir ?? join(\".sixb\", \"dist\", \"app\"))\n const indexPath = join(outdir, \"index.html\")\n const sharedIndexPath = join(outdir, SHARED_APP_SHELL_FILE_NAME)\n\n if (!(await pathExists(indexPath))) {\n throw new Error(`[SixbCustomApp] No built app found in ${outdir}`)\n }\n if (!(await pathExists(sharedIndexPath))) {\n throw new Error(\n `[SixbCustomApp] Built app in ${outdir} is missing ${SHARED_APP_SHELL_FILE_NAME}; rebuild required.`\n )\n }\n\n const indexHtml = injectRuntimeConfig(await Bun.file(indexPath).text(), {\n apiBaseUrl: startOptions.apiBaseUrl ?? apiBaseUrl,\n authEnabled: startOptions.authEnabled ?? authEnabled,\n publicEnv,\n })\n const sharedIndexHtml = injectRuntimeConfig(await Bun.file(sharedIndexPath).text(), {\n apiBaseUrl: startOptions.apiBaseUrl ?? apiBaseUrl,\n authEnabled: false,\n publicEnv,\n })\n const runtimeApiBaseUrl = startOptions.apiBaseUrl ?? apiBaseUrl\n const server = Bun.serve({\n port,\n hostname: host,\n development: false,\n async fetch(req) {\n const url = new URL(req.url)\n if (isReservedSixbRoute(url.pathname)) {\n return notFoundResponse()\n }\n\n if (isFrameworkPrivateRoute(url.pathname)) {\n return notFoundResponse()\n }\n\n if (req.method !== \"GET\" && req.method !== \"HEAD\") {\n return notFoundResponse()\n }\n\n if (url.pathname.startsWith(`${frameworkAssetsRoute}/`)) {\n return frameworkAssetResponse(req, url.pathname)\n }\n\n if (isSharedAppRoute(url.pathname)) {\n if (isAssetRequest(url.pathname)) {\n return notFoundResponse()\n }\n return sharedHtmlResponse(req, sharedIndexHtml, runtimeApiBaseUrl, frameOrigins)\n }\n\n if (isSharedNamespace(url.pathname)) {\n return notFoundResponse()\n }\n\n if (url.pathname === \"/\" || url.pathname === \"\") {\n return htmlResponse(req, indexHtml, runtimeApiBaseUrl, frameOrigins)\n }\n\n const resolvedPath = resolveStaticPath(outdir, url.pathname)\n if (!resolvedPath) {\n return notFoundResponse()\n }\n\n const directFile = Bun.file(resolvedPath)\n if (await directFile.exists()) {\n if (resolvedPath === indexPath) {\n return htmlResponse(req, indexHtml, runtimeApiBaseUrl, frameOrigins)\n }\n return staticFileResponse(req, resolvedPath, staticAssetHeaders(url.pathname))\n }\n\n if (isAssetRequest(url.pathname)) {\n return notFoundResponse()\n }\n\n const htmlFile = Bun.file(`${resolvedPath}.html`)\n if (await htmlFile.exists()) {\n if (`${resolvedPath}.html` === indexPath) {\n return htmlResponse(req, indexHtml, runtimeApiBaseUrl, frameOrigins)\n }\n return fileResponse(req, htmlFile)\n }\n\n const nestedIndexFile = Bun.file(join(resolvedPath, \"index.html\"))\n if (await nestedIndexFile.exists()) {\n return fileResponse(req, nestedIndexFile)\n }\n\n return htmlResponse(req, indexHtml, runtimeApiBaseUrl, frameOrigins)\n },\n })\n\n const displayHost = host === \"0.0.0.0\" ? \"localhost\" : host\n const boundPort = server.port ?? port\n\n return {\n host,\n port: boundPort,\n url: `http://${displayHost}:${boundPort}`,\n async stop(stopOptions: CustomAppStopOptions = {}) {\n await stopBunAppServer(server, stopOptions.timeoutMs)\n },\n }\n },\n }\n}\n\nconst DEFAULT_APP_STOP_TIMEOUT_MS = 5_000\n\nasync function stopBunAppServer(\n server: ReturnType<typeof Bun.serve>,\n timeoutMs: number = DEFAULT_APP_STOP_TIMEOUT_MS\n): Promise<void> {\n if (!Number.isFinite(timeoutMs) || timeoutMs < 0) {\n throw new Error(\"[SixbCustomApp] Stop timeout must be a non-negative finite number.\")\n }\n if (timeoutMs <= 0) {\n await server.stop(true)\n return\n }\n\n const draining = server.stop(false)\n const deadline = Date.now() + timeoutMs\n let settled = false\n void draining.then(\n () => {\n settled = true\n },\n () => {\n settled = true\n }\n )\n\n while (!settled && (server.pendingRequests > 0 || server.pendingWebSockets > 0)) {\n const remaining = deadline - Date.now()\n if (remaining <= 0) break\n let timer: ReturnType<typeof setTimeout> | undefined\n try {\n await Promise.race([\n draining,\n new Promise<void>((resolve) => {\n timer = setTimeout(resolve, Math.min(remaining, 25))\n }),\n ])\n } finally {\n if (timer !== undefined) clearTimeout(timer)\n }\n }\n\n await server.stop(true)\n await draining\n}\n\nasync function pathExists(path: string): Promise<boolean> {\n try {\n await access(path)\n return true\n } catch {\n return false\n }\n}\n\n// The generated app imports these from the project, so the page code and the framework share one\n// copy of React. `@sixb/app` only names them as peers.\nconst appPeerPackages = [\"react\", \"react-dom\", \"react-router-dom\", \"@tanstack/react-query\"] as const\n\n// Looks for `node_modules` as the bundler does. `Bun.resolveSync` would also find Bun's global\n// install cache, which the bundler never reads.\nfunction assertAppPackagesInstalled(rootDir: string): void {\n const missing = appPeerPackages.filter((name) => {\n for (let dir = rootDir; ; dir = dirname(dir)) {\n if (existsSync(join(dir, \"node_modules\", name, \"package.json\"))) return false\n if (dirname(dir) === dir) return true\n }\n })\n if (missing.length > 0) throw new AppPackagesMissingError(missing)\n}\n\n/** The project lacks packages the app is bundled from. `sixb dev` keeps the API running. */\nexport class AppPackagesMissingError extends Error {\n readonly name = \"AppPackagesMissingError\"\n\n constructor(readonly missing: readonly string[]) {\n super(\n `[SixbCustomApp] The app needs ${missing.join(\", \")} in this project. Install them with: ` +\n `bun add ${missing.join(\" \")}`\n )\n }\n}\n\nfunction builtInRoutesFor(routes: readonly PageRoute[]): BuiltInRouteManifestEntry[] {\n const projectRoutePatterns = new Set(routes.map((route) => routePatternKey(route.path)))\n const builtInRoutes: BuiltInRouteManifestEntry[] = [\n { path: \"/threads\", moduleSpecifier: builtInPageModule, exportName: \"ThreadsPage\" },\n {\n path: \"/threads/:threadId\",\n moduleSpecifier: builtInPageModule,\n exportName: \"ThreadPage\",\n },\n {\n path: \"/agents/:threadId\",\n moduleSpecifier: builtInPageModule,\n exportName: \"AgentThreadRedirect\",\n // It only sends the reader on; the conversation it opens records the view.\n recordsActivity: false,\n },\n // Home starts threads that continue under /threads, so it ships with them.\n { path: \"/\", moduleSpecifier: builtInPageModule, exportName: \"HomePage\" },\n // Every object has a page, outside any section: grants decide who reads it.\n {\n path: \"/objects/:objectTypeId/:primaryId\",\n moduleSpecifier: builtInPageModule,\n exportName: \"ObjectPage\",\n },\n // So does every artifact: its owner reads it wherever a link to it leads, and finds it among\n // the rest in the gallery.\n { path: \"/artifacts\", moduleSpecifier: builtInPageModule, exportName: \"ArtifactsPage\" },\n {\n path: \"/artifacts/:artifactId\",\n moduleSpecifier: builtInPageModule,\n exportName: \"ArtifactPage\",\n },\n // The sections are developer tooling: opening one is not using the app.\n ...sectionCatalog.flatMap((section) => [\n {\n path: section.path,\n moduleSpecifier: builtInPageModule,\n exportName: section.indexExportName,\n recordsActivity: false,\n },\n ...section.pages.flatMap((page) => [\n {\n path: page.path,\n moduleSpecifier: builtInPageModule,\n exportName: page.exportName,\n recordsActivity: false,\n },\n ...(page.details ?? []).map((detail) => ({\n path: detail.path,\n moduleSpecifier: builtInPageModule,\n exportName: detail.exportName,\n recordsActivity: false,\n })),\n ]),\n ]),\n ]\n\n return builtInRoutes.filter((route) => !projectRoutePatterns.has(routePatternKey(route.path)))\n}\n\nasync function writeFileIfChanged(path: string, content: string): Promise<void> {\n try {\n if ((await readFile(path, \"utf-8\")) === content) {\n return\n }\n } catch (error) {\n if (!isFileNotFoundError(error)) {\n throw error\n }\n }\n\n await mkdir(dirname(path), { recursive: true })\n await writeFile(path, content, \"utf-8\")\n}\n\nfunction isFileNotFoundError(error: unknown): boolean {\n return (\n error instanceof Error &&\n \"code\" in error &&\n (error as Error & { readonly code?: unknown }).code === \"ENOENT\"\n )\n}\n\nasync function frameworkAssetResponse(request: Request, pathname: string): Promise<Response> {\n const resolvedPath = resolveStaticPath(\n frameworkAssetsDir,\n pathname.slice(frameworkAssetsRoute.length)\n )\n if (!resolvedPath || !(await Bun.file(resolvedPath).exists())) return notFoundResponse()\n // A release replaces the package, and with it every asset, so a day of caching is safe.\n return staticFileResponse(request, resolvedPath, { \"cache-control\": \"public, max-age=86400\" })\n}\n\nasync function createPublicRoutes(publicDir: string): Promise<BunServeRoutes> {\n const files = new Bun.Glob(\"**/*\").scan({\n cwd: publicDir,\n absolute: true,\n onlyFiles: true,\n })\n const routes: BunServeRoutes = {}\n\n for await (const filePath of files) {\n const routePath = `/${filePath\n .slice(publicDir.length + 1)\n .split(\"\\\\\")\n .join(\"/\")}`\n if (\n isReservedSixbRoute(routePath) ||\n isSharedNamespace(routePath) ||\n isFrameworkPrivateRoute(routePath) ||\n routePath === customAppManifestRoute\n ) {\n continue\n }\n routes[routePath] = getHeadRoute((request) => filePathResponse(request, filePath))\n }\n\n return routes\n}\n\nfunction createGeneratedAssetRoutes(\n outputRoot: string,\n assetPaths: readonly string[]\n): BunServeRoutes {\n const routes: BunServeRoutes = {}\n for (const assetPath of assetPaths) {\n const relativePath = relative(outputRoot, assetPath)\n if (relativePath.startsWith(\"..\") || isAbsolute(relativePath)) {\n throw new Error(`[SixbCustomApp] Shared development asset escaped its output directory.`)\n }\n const routePath = `/${relativePath.split(\"\\\\\").join(\"/\")}`\n routes[routePath] = getHeadRoute((request) =>\n fileResponse(request, Bun.file(assetPath), { \"cache-control\": \"no-store\" })\n )\n }\n return routes\n}\n\nfunction reservedSixbRoutes(): BunServeRoutes {\n const handler = () => notFoundResponse()\n return {\n [internalAppShellRoute]: allMethodsRoute(handler),\n [`${internalAppShellRoute}/*`]: allMethodsRoute(handler),\n [internalSharedAppShellRoute]: allMethodsRoute(handler),\n [`${internalSharedAppShellRoute}/*`]: allMethodsRoute(handler),\n [`/${SHARED_APP_SHELL_FILE_NAME}`]: allMethodsRoute(handler),\n \"/api\": allMethodsRoute(handler),\n \"/api/*\": allMethodsRoute(handler),\n \"/auth\": allMethodsRoute(handler),\n \"/auth/*\": allMethodsRoute(handler),\n \"/ws\": allMethodsRoute(handler),\n \"/ws/*\": allMethodsRoute(handler),\n \"/docs\": allMethodsRoute(handler),\n \"/docs/*\": allMethodsRoute(handler),\n }\n}\n\nfunction sharedAppDevRoutes(\n html: () => string | Promise<string>,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): BunServeRoutes {\n const reject = () => notFoundResponse()\n const guardedHandler = async (request: Request) => {\n const pathname = new URL(request.url).pathname\n if (!isSharedAppRoute(pathname) || isAssetRequest(pathname)) {\n return notFoundResponse()\n }\n return sharedHtmlResponse(request, await html(), apiBaseUrl, frameOrigins)\n }\n\n return {\n \"/shared\": allMethodsRoute(reject),\n \"/shared/*\": {\n GET: guardedHandler,\n HEAD: guardedHandler,\n POST: reject,\n PUT: reject,\n PATCH: reject,\n DELETE: reject,\n OPTIONS: reject,\n } as unknown as BunServeRoute,\n }\n}\n\nfunction isSharedAppRoute(pathname: string): boolean {\n return /^\\/shared\\/[^/]+(?:\\/.*)?$/.test(pathname)\n}\n\nfunction isSharedNamespace(pathname: string): boolean {\n const decoded = decodeRoutePathname(pathname)\n return decoded === \"/shared\" || decoded?.startsWith(\"/shared/\") === true\n}\n\nfunction isFrameworkPrivateRoute(pathname: string): boolean {\n const decoded = decodeRoutePathname(pathname)?.toLowerCase()\n if (!decoded) return false\n const sharedShellRoute = `/${SHARED_APP_SHELL_FILE_NAME}`\n return (\n decoded === sharedShellRoute ||\n decoded.startsWith(`${sharedShellRoute}/`) ||\n decoded === internalAppShellRoute ||\n decoded.startsWith(`${internalAppShellRoute}/`) ||\n decoded === internalSharedAppShellRoute ||\n decoded.startsWith(`${internalSharedAppShellRoute}/`)\n )\n}\n\nfunction decodeRoutePathname(pathname: string): string | null {\n try {\n return decodeURIComponent(pathname).replaceAll(\"\\\\\", \"/\")\n } catch {\n return null\n }\n}\n\nfunction isReservedSixbRoute(pathname: string): boolean {\n const decoded = decodeRoutePathname(pathname)\n if (!decoded) return false\n return (\n decoded === \"/api\" ||\n decoded.startsWith(\"/api/\") ||\n decoded === \"/auth\" ||\n decoded.startsWith(\"/auth/\") ||\n decoded === \"/ws\" ||\n decoded.startsWith(\"/ws/\") ||\n decoded === \"/docs\" ||\n decoded.startsWith(\"/docs/\")\n )\n}\n\n// Static-asset extensions whose absence should 404 rather than fall back to the\n// SPA shell — otherwise the browser would receive HTML for a missing\n// script/style/image and fail with a confusing content-type error.\nconst ASSET_EXTENSIONS = new Set([\n \"js\",\n \"mjs\",\n \"cjs\",\n \"css\",\n \"map\",\n \"json\",\n \"wasm\",\n \"ico\",\n \"png\",\n \"jpg\",\n \"jpeg\",\n \"gif\",\n \"svg\",\n \"webp\",\n \"avif\",\n \"bmp\",\n \"woff\",\n \"woff2\",\n \"ttf\",\n \"otf\",\n \"eot\",\n \"mp4\",\n \"webm\",\n \"ogg\",\n \"mp3\",\n \"wav\",\n \"txt\",\n \"xml\",\n \"webmanifest\",\n \"pdf\",\n])\n\nfunction isAssetRequest(pathname: string): boolean {\n // Decode first: client routes can carry percent-encoded slashes (`%2F`) inside a\n // single path segment (e.g. an object id), so the raw pathname's \"last segment\"\n // is unreliable. Falling back to the SPA shell for these is the whole point.\n let decoded = pathname\n try {\n decoded = decodeURIComponent(pathname)\n } catch {\n // Keep the raw pathname when it isn't valid percent-encoding.\n }\n const lastSegment = decoded.split(/[\\\\/]+/).pop() ?? \"\"\n const dot = lastSegment.lastIndexOf(\".\")\n // No extension, a leading-dot file, or a trailing dot → not an asset request.\n if (dot <= 0 || dot === lastSegment.length - 1) return false\n return ASSET_EXTENSIONS.has(lastSegment.slice(dot + 1).toLowerCase())\n}\n\nfunction resolveStaticPath(appRoot: string, pathname: string): string | null {\n let decodedPath: string\n try {\n decodedPath = decodeURIComponent(pathname)\n } catch {\n return null\n }\n\n if (decodedPath.includes(\"\\0\")) return null\n const segments = decodedPath.split(/[\\\\/]+/)\n if (segments.includes(\"..\")) return null\n\n const normalizedPath = normalize(decodedPath).replace(/^[\\\\/]+/, \"\")\n const resolvedPath = resolve(appRoot, normalizedPath)\n const rel = relative(appRoot, resolvedPath)\n\n if (rel.startsWith(\"..\") || isAbsolute(rel)) return null\n return resolvedPath\n}\n\nfunction injectRuntimeConfig(\n html: string,\n config: {\n readonly apiBaseUrl?: string\n readonly authEnabled: boolean\n readonly publicEnv: Record<string, string>\n }\n): string {\n const existingRuntimeScript = /<script>window\\.__SIXB_RUNTIME__ = (.*?);<\\/script>/\n const existingConfig = html.match(existingRuntimeScript)?.[1]\n const script = renderCustomAppRuntimeScript({\n auth: { enabled: config.authEnabled },\n ...(existingConfig ? JSON.parse(existingConfig) : {}),\n ...(config.apiBaseUrl\n ? {\n api: { baseUrl: config.apiBaseUrl },\n auth: { enabled: config.authEnabled },\n }\n : {}),\n publicEnv: config.publicEnv,\n })\n if (existingRuntimeScript.test(html)) {\n return html.replace(existingRuntimeScript, () => script)\n }\n\n if (/<head\\b[^>]*>/i.test(html)) {\n return html.replace(/<head\\b[^>]*>/i, (head) => `${head}\\n ${script}`)\n }\n\n return `${script}\\n${html}`\n}\n\nfunction htmlResponse(\n request: Request,\n html: string,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): Response {\n return new Response(request.method === \"HEAD\" ? null : html, {\n headers: {\n \"content-type\": \"text/html; charset=utf-8\",\n \"cache-control\": \"no-store\",\n \"content-security-policy\": appContentSecurityPolicy(request, apiBaseUrl, frameOrigins),\n },\n })\n}\n\n/**\n * The policy of the app's own page: it frames what the API serves, its artifacts' frames, and the\n * sites `SIXB_APP_FRAME_ORIGINS` lists. A page in an artifact frame reads its queries' rows as the\n * reader; its frame opens no window, and the frame's policy keeps what it loads to its files and a\n * few CDNs. This keeps the frame's navigations on those origins too, so a page's code cannot send\n * what it reads to any other site in an address.\n *\n * It is the only directive: what a project's own pages load is theirs, but a frame they embed from\n * a site the list leaves out is refused too.\n */\nfunction appContentSecurityPolicy(\n request: Request,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): string {\n return `frame-src ${frameSources(request, apiBaseUrl, frameOrigins)}`\n}\n\n/**\n * Where the page's frames may come from: the API's origin, `'self'` when it is the page's own, then\n * the listed sites.\n */\nfunction frameSources(\n request: Request,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): string {\n const { requestOrigin, apiOrigin } = resolveOrigins(request, apiBaseUrl)\n const api = apiOrigin === requestOrigin ? \"'self'\" : apiOrigin\n return [api, ...frameOrigins.filter((origin) => origin !== apiOrigin)].join(\" \")\n}\n\nfunction resolveOrigins(\n request: Request,\n apiBaseUrl: string | undefined\n): { readonly requestOrigin: string; readonly apiOrigin: string } {\n const requestOrigin = new URL(request.url).origin\n try {\n return { requestOrigin, apiOrigin: new URL(apiBaseUrl ?? requestOrigin, requestOrigin).origin }\n } catch {\n // The browser client reports an invalid runtime URL. Keep the document policy fail-closed.\n return { requestOrigin, apiOrigin: requestOrigin }\n }\n}\n\nfunction sharedHtmlResponse(\n request: Request,\n html: string,\n apiBaseUrl: string | undefined,\n frameOrigins: readonly string[]\n): Response {\n const secured = secureSharedHtml(html, request, { apiBaseUrl, frameOrigins })\n return new Response(request.method === \"HEAD\" ? null : secured.html, {\n headers: {\n \"content-type\": \"text/html; charset=utf-8\",\n ...secured.headers,\n },\n })\n}\n\n/** The origin of an API's WebSockets: `wss:` beside `https:`, `ws:` beside `http:`. */\nfunction socketOrigin(apiOrigin: string): string {\n const url = new URL(apiOrigin)\n return `${url.protocol === \"https:\" ? \"wss:\" : \"ws:\"}//${url.host}`\n}\n\nfunction secureSharedHtml(\n html: string,\n request: Request,\n options: { readonly apiBaseUrl?: string; readonly frameOrigins: readonly string[] }\n): { readonly html: string; readonly headers: Record<string, string> } {\n const nonce = randomBytes(18).toString(\"base64url\")\n const { requestOrigin, apiOrigin } = resolveOrigins(request, options.apiBaseUrl)\n\n const apiSources = apiOrigin === requestOrigin ? [] : [apiOrigin]\n // The artifacts a link reaches are followed live, over the API's sockets.\n const connectSources = [\"'self'\", ...apiSources, socketOrigin(apiOrigin)]\n // Files are fetched or embedded from the API, which a split deployment serves from its own\n // origin; `https:` alone misses it in plain-HTTP development.\n const fileSources = [\"'self'\", ...apiSources, \"data:\", \"blob:\", \"https:\"]\n const scriptSources = [`'nonce-${nonce}'`, \"'strict-dynamic'\", \"'self'\"]\n const contentSecurityPolicy = [\n \"default-src 'none'\",\n \"base-uri 'none'\",\n \"object-src 'none'\",\n \"frame-ancestors 'none'\",\n \"form-action 'none'\",\n `script-src ${scriptSources.join(\" \")}`,\n \"style-src 'self' 'unsafe-inline'\",\n `img-src ${fileSources.join(\" \")}`,\n `media-src ${fileSources.join(\" \")}`,\n \"font-src 'self' data: https:\",\n `connect-src ${connectSources.join(\" \")}`,\n `frame-src ${frameSources(request, options.apiBaseUrl, options.frameOrigins)}`,\n \"manifest-src 'none'\",\n ].join(\"; \")\n\n return {\n html: html.replace(/<script(?![^>]*\\snonce=)/g, `<script nonce=\"${nonce}\"`),\n headers: {\n \"cache-control\": \"no-store\",\n \"content-security-policy\": contentSecurityPolicy,\n \"permissions-policy\":\n \"camera=(), geolocation=(), microphone=(), payment=(), usb=(), browsing-topics=()\",\n \"referrer-policy\": \"no-referrer\",\n \"x-content-type-options\": \"nosniff\",\n \"x-frame-options\": \"DENY\",\n \"x-robots-tag\": \"noindex, nofollow, noarchive\",\n },\n }\n}\n\n// buildApp emits content-hashed entry, chunk, and asset names (IMMUTABLE_ASSET_PATTERN). Their\n// contents can never change under the same URL, so they are safe to cache forever. Files copied\n// from `public/` keep their names across deploys and stay uncached.\nfunction staticAssetHeaders(pathname: string): Record<string, string> {\n if (pathname === customAppManifestRoute) {\n return {\n \"content-type\": \"application/manifest+json; charset=utf-8\",\n \"cache-control\": \"no-cache\",\n }\n }\n // Checked on every launch, so a deploy reaches installed apps at once.\n if (pathname === SERVICE_WORKER_PATH) {\n return { \"content-type\": \"text/javascript; charset=utf-8\", \"cache-control\": \"no-cache\" }\n }\n\n const lastSegment = pathname.split(\"/\").pop() ?? \"\"\n if (!IMMUTABLE_ASSET_PATTERN.test(lastSegment)) {\n return {}\n }\n\n return { \"cache-control\": \"public, max-age=31536000, immutable\" }\n}\n\nasync function staticFileResponse(\n request: Request,\n path: string,\n headers: Record<string, string>\n): Promise<Response> {\n const responseHeaders = new Headers(headers)\n const originalFile = Bun.file(path)\n let responseFile = originalFile\n\n if (isPrecompressedAsset(path)) {\n responseHeaders.append(\"vary\", \"Accept-Encoding\")\n if (!request.headers.has(\"range\")) {\n for (const encoding of acceptedPrecompressedEncodings(request)) {\n const candidate = Bun.file(`${path}.${encoding === \"br\" ? \"br\" : \"gz\"}`)\n if (!(await candidate.exists())) continue\n\n responseFile = candidate\n responseHeaders.set(\"content-encoding\", encoding)\n responseHeaders.set(\"content-type\", originalFile.type)\n break\n }\n }\n }\n\n return new Response(request.method === \"HEAD\" ? null : responseFile, {\n headers: responseHeaders,\n })\n}\n\nfunction isPrecompressedAsset(path: string): boolean {\n return path.endsWith(\".js\") || path.endsWith(\".css\")\n}\n\nfunction acceptedPrecompressedEncodings(request: Request): (\"br\" | \"gzip\")[] {\n const header = request.headers.get(\"accept-encoding\")\n if (!header) return []\n\n const qualities = new Map<string, number>()\n for (const item of header.split(\",\")) {\n const [rawName, ...parameters] = item.trim().split(\";\")\n const name = rawName.toLowerCase()\n let quality = 1\n for (const parameter of parameters) {\n const match = parameter.trim().match(/^q=(0(?:\\.\\d+)?|1(?:\\.0+)?)$/)\n if (match) quality = Number(match[1])\n }\n qualities.set(name, quality)\n }\n\n const wildcard = qualities.get(\"*\") ?? 0\n return ([\"br\", \"gzip\"] as const)\n .map((encoding, preference) => ({\n encoding,\n preference,\n quality: qualities.get(encoding) ?? wildcard,\n }))\n .filter((candidate) => candidate.quality > 0)\n .sort((left, right) => right.quality - left.quality || left.preference - right.preference)\n .map((candidate) => candidate.encoding)\n}\n\nfunction fileResponse(\n request: Request,\n file: Bun.BunFile,\n headers: Record<string, string> = {}\n): Response {\n return new Response(request.method === \"HEAD\" ? null : file, { headers })\n}\n\nfunction filePathResponse(request: Request, path: string): Response {\n return fileResponse(request, Bun.file(path))\n}\n\nfunction notFoundResponse(): Response {\n return new Response(\"Not Found\", {\n status: 404,\n headers: {\n \"cache-control\": \"no-store\",\n },\n })\n}\n\nfunction getHeadRoute(handler: (request: Request) => Response | Promise<Response>): BunServeRoute {\n return {\n GET: handler,\n HEAD: handler,\n } as unknown as BunServeRoute\n}\n\nfunction allMethodsRoute(handler: (request: Request) => Response): BunServeRoute {\n return {\n GET: handler,\n HEAD: handler,\n POST: handler,\n PUT: handler,\n PATCH: handler,\n DELETE: handler,\n OPTIONS: handler,\n } as unknown as BunServeRoute\n}\n\nasync function importHtmlBundle(htmlPath: string, version: number): Promise<Bun.HTMLBundle> {\n const bundleEntryPath = await prepareAppHtmlBundleEntry(htmlPath)\n const url = pathToFileURL(bundleEntryPath)\n url.searchParams.set(\"v\", String(version))\n const htmlModule = (await import(url.href)) as { default: Bun.HTMLBundle }\n return htmlModule.default\n}\n\nfunction htmlBundleRoute(bundle: Bun.HTMLBundle): BunServeRoute {\n return {\n GET: bundle,\n HEAD: bundle,\n } as unknown as BunServeRoute\n}\n\nfunction manifestRoute(manifestPath: string): BunServeRoute {\n return getHeadRoute((request) =>\n fileResponse(request, Bun.file(manifestPath), staticAssetHeaders(customAppManifestRoute))\n )\n}\n\nfunction devServerInternalOrigin(host: string, port: number): string {\n if (host === \"0.0.0.0\") {\n return `http://127.0.0.1:${port}`\n }\n if (host === \"::\" || host === \"[::]\") {\n return `http://[::1]:${port}`\n }\n\n const urlHost = host.includes(\":\") && !host.startsWith(\"[\") ? `[${host}]` : host\n return `http://${urlHost}:${port}`\n}\n\nfunction spaHtmlRoute(\n internalOrigin: () => string,\n options: {\n readonly shellRoute?: string\n readonly transformHtml?: (html: string) => string\n readonly apiBaseUrl?: string\n readonly frameOrigins: readonly string[]\n }\n): BunServeRoute {\n return getHeadRoute(async (request) => {\n const publicUrl = new URL(request.url)\n if (\n isReservedSixbRoute(publicUrl.pathname) ||\n isSharedNamespace(publicUrl.pathname) ||\n isFrameworkPrivateRoute(publicUrl.pathname)\n ) {\n return notFoundResponse()\n }\n if (publicUrl.pathname !== \"/\" && isAssetRequest(publicUrl.pathname)) {\n return notFoundResponse()\n }\n\n const url = new URL(options.shellRoute ?? internalAppShellRoute, internalOrigin())\n url.search = publicUrl.search\n const requestHeaders = new Headers(request.headers)\n for (const header of [\n \"forwarded\",\n \"host\",\n \"x-forwarded-host\",\n \"x-forwarded-port\",\n \"x-forwarded-proto\",\n ]) {\n requestHeaders.delete(header)\n }\n const bundleResponse = await fetch(\n new Request(url, { method: request.method, headers: requestHeaders })\n )\n const responseHeaders = new Headers(bundleResponse.headers)\n responseHeaders.delete(\"content-length\")\n responseHeaders.delete(\"etag\")\n responseHeaders.set(\n \"content-security-policy\",\n appContentSecurityPolicy(request, options.apiBaseUrl, options.frameOrigins)\n )\n if (request.method === \"HEAD\") {\n return new Response(null, {\n status: bundleResponse.status,\n statusText: bundleResponse.statusText,\n headers: responseHeaders,\n })\n }\n\n const html = restoreAppStaticUrls(await bundleResponse.text()).replace(\n \"</head>\",\n '<script src=\"/__sixb/dev-reload.js\"></script></head>'\n )\n return new Response(options.transformHtml?.(html) ?? html, {\n status: bundleResponse.status,\n statusText: bundleResponse.statusText,\n headers: responseHeaders,\n })\n })\n}\n",
6
6
  "import { createHash } from \"node:crypto\"\nimport { existsSync } from \"node:fs\"\nimport { copyFile, mkdir, readFile, rm, writeFile } from \"node:fs/promises\"\nimport { basename, dirname, join, resolve } from \"node:path\"\nimport { promisify } from \"node:util\"\nimport {\n brotliCompress as brotliCompressCallback,\n gzip as gzipCallback,\n constants as zlibConstants,\n} from \"node:zlib\"\nimport { renderServiceWorker, SERVICE_WORKER_PATH } from \"./service-worker\"\nimport { LAUNCH_ICON_SIZE } from \"./shell/phone/launch\"\n\nconst STATIC_ASSET_ORIGIN = \"https://sixb-static.invalid\"\nconst brotliCompress = promisify(brotliCompressCallback)\nconst gzip = promisify(gzipCallback)\nconst PRECOMPRESSION_CONCURRENCY = 4\nexport const SHARED_APP_SHELL_FILE_NAME = \"shared-index.html\"\n\nexport interface BuildAppOptions {\n /** Path to the generated index.html entry point */\n entryPath: string\n /** Browser TypeScript entry generated alongside `entryPath`. */\n scriptEntryPath: string\n /** Isolated shared-link HTML shell. Must be paired with `sharedScriptEntryPath`. */\n sharedEntryPath?: string\n /** Browser TypeScript entry loaded by the shared-link shell. */\n sharedScriptEntryPath?: string\n /** Generated manifest copied to the stable `/app.webmanifest` output path. */\n manifestPath?: string\n /** Output directory, defaults to `.sixb/dist/app` */\n outdir?: string\n}\n\nexport interface BuildAppResult {\n success: boolean\n outdir: string\n logs?: string[]\n}\n\nexport interface BuildSharedAppDevResult {\n readonly assetPaths: readonly string[]\n readonly html: string\n}\n\nexport interface BuildAuthExperienceOptions {\n /** Generated HTML shell containing the auth bootstrap placeholder. */\n entryPath: string\n /** Browser TypeScript entry generated alongside `entryPath`. */\n scriptEntryPath: string\n /** Directory written for the API server to mount under `/auth`. */\n outdir: string\n}\n\n/**\n * Builds the generated browser entry and writes a production-ready static shell and bundle.\n */\nexport async function buildApp(options: BuildAppOptions): Promise<BuildAppResult> {\n const outdir = options.outdir ?? join(process.cwd(), \".sixb\", \"dist\", \"app\")\n if (Boolean(options.sharedEntryPath) !== Boolean(options.sharedScriptEntryPath)) {\n throw new Error(\n \"[SixbCustomApp] sharedEntryPath and sharedScriptEntryPath must be provided together.\"\n )\n }\n\n // The outdir is build-owned. Clear it so hashed chunks from previous builds\n // don't accumulate (and get served) forever.\n await rm(outdir, { recursive: true, force: true })\n await mkdir(outdir, { recursive: true })\n\n const result = await buildBrowserEntry(options.scriptEntryPath, outdir, \"app\")\n\n if (!result.success) {\n return {\n success: false,\n outdir,\n logs: result.logs.map(String),\n }\n }\n\n const normalEntry = resolveBrowserEntry(result.outputs, \"browser\")\n const sourceHtml = restoreAppStaticUrls(await readFile(options.entryPath, \"utf-8\"))\n const sourceEntryPattern =\n /\\s*<script\\s+type=[\"']module[\"']\\s+src=[\"']\\.\\/main\\.tsx[\"']><\\/script>/\n if (!sourceEntryPattern.test(sourceHtml)) {\n throw new Error(\"[SixbCustomApp] Generated app shell is missing its ./main.tsx entry.\")\n }\n\n const assetTags = [\n ...normalEntry.stylesheets.map(\n (stylesheet) => `<link rel=\"stylesheet\" crossorigin href=\"/${basename(stylesheet.path)}\">`\n ),\n `<script type=\"module\" crossorigin src=\"/${basename(normalEntry.script.path)}\"></script>`,\n ].join(\"\")\n const html = withLoadingShell(sourceHtml)\n .replace(sourceEntryPattern, \"\")\n .replace(\"</head>\", ` ${assetTags}</head>`)\n await writeFile(join(outdir, \"index.html\"), html, \"utf-8\")\n const serviceWorkerPath = await writeServiceWorker(\n outdir,\n html,\n `/${basename(normalEntry.script.path)}`\n )\n\n // The worker is compressed with the bundles, so the server can send it as it sends them.\n const outputs = [...result.outputs, { path: serviceWorkerPath, type: \"text/javascript\" }]\n if (options.sharedEntryPath && options.sharedScriptEntryPath) {\n // Keep these builds sequential. Bun can mis-resolve package-relative imports when two large\n // browser entry graphs are built together, while content hashes safely deduplicate their\n // shared chunks in one output directory.\n const sharedResult = await buildBrowserEntry(options.sharedScriptEntryPath, outdir, \"shared\")\n if (!sharedResult.success) {\n return {\n success: false,\n outdir,\n logs: sharedResult.logs.map(String),\n }\n }\n\n const sharedEntry = resolveBrowserEntry(sharedResult.outputs, \"shared browser\")\n const sharedHtml = await renderSharedAppHtml(options.sharedEntryPath, sharedEntry)\n await writeFile(join(outdir, SHARED_APP_SHELL_FILE_NAME), sharedHtml, \"utf-8\")\n outputs.push(...sharedResult.outputs)\n }\n\n if (options.manifestPath) {\n await copyFile(options.manifestPath, join(outdir, \"app.webmanifest\"))\n }\n await precompressBuildAssets(outputs)\n\n return { success: true, outdir }\n}\n\n/**\n * Builds the shared shell like production for development, without Bun's HTML/HMR transform.\n * Bun 1.3 injects a script before an inline loader, which would execute application code while the\n * share secret is still in the document URL. The ordinary app keeps HTML-bundle HMR.\n */\nexport async function buildSharedAppDev(options: {\n readonly entryPath: string\n readonly outdir: string\n readonly scriptEntryPath: string\n}): Promise<BuildSharedAppDevResult> {\n await rm(options.outdir, { recursive: true, force: true })\n await mkdir(options.outdir, { recursive: true })\n\n let result: Bun.BuildOutput\n try {\n result = await buildBrowserEntry(options.scriptEntryPath, options.outdir, \"shared-dev\", true)\n } catch (error) {\n await rm(options.outdir, { recursive: true, force: true })\n throw error\n }\n if (!result.success) {\n await rm(options.outdir, { recursive: true, force: true })\n throw new Error(\n `[SixbCustomApp] Failed to build the shared development shell: ${result.logs.map(String).join(\"\\n\")}`\n )\n }\n\n const entry = resolveBrowserEntry(result.outputs, \"shared development browser\")\n return {\n assetPaths: result.outputs.map((output) => output.path),\n html: await renderSharedAppHtml(options.entryPath, entry),\n }\n}\n\nasync function buildBrowserEntry(\n entrypoint: string,\n outdir: string,\n entryName: \"app\" | \"shared\" | \"shared-dev\",\n development = false\n): Promise<Bun.BuildOutput> {\n return await Bun.build({\n // Build the script entry directly rather than Bun's HTML entry. Bun cannot currently preserve\n // a large dynamic-import graph reliably when splitting an HTML entry: one of the lazy chunks\n // can be written into the shell's script tag. Building TypeScript directly also lets Shiki's\n // hundreds of grammars remain off the initial custom-app path.\n entrypoints: [entrypoint],\n outdir,\n target: \"browser\",\n conditions: [\"bun\"],\n publicPath: \"/\",\n minify: !development,\n splitting: true,\n naming: {\n entry: `${entryName}-[hash].[ext]`,\n chunk: \"chunk-[name]-[hash].[ext]\",\n asset: \"asset-[name]-[hash].[ext]\",\n },\n plugins: [extensionlessSourceImportPlugin, publicRootUrlPlugin],\n // Report a failed build through `result.logs` instead of throwing Bun's bare \"Bundle failed\".\n throw: false,\n // React is bundled into this browser output, so without pinning NODE_ENV the production build\n // of a user's app ships React's development build: dev-only checks on every render, and the\n // warnings that go with them. This is also the only knob that selects the production JSX\n // runtime — an ambient NODE_ENV does not.\n define: { \"process.env.NODE_ENV\": development ? '\"development\"' : '\"production\"' },\n sourcemap: development ? \"inline\" : \"external\",\n })\n}\n\nasync function renderSharedAppHtml(\n entryPath: string,\n entry: {\n readonly script: Bun.BuildArtifact\n readonly stylesheets: readonly Bun.BuildArtifact[]\n }\n): Promise<string> {\n const sourceHtml = restoreAppStaticUrls(await readFile(entryPath, \"utf-8\"))\n const sourceEntryPattern =\n /const \\{ startSharedApp \\} = await import\\(([\"'])\\.\\/shared-main\\.tsx\\1\\)\\s+startSharedApp\\(bootstrap\\)/\n if (!sourceEntryPattern.test(sourceHtml)) {\n throw new Error(\n \"[SixbCustomApp] Generated shared app shell is missing its ./shared-main.tsx import.\"\n )\n }\n\n // The share secret initially lives in location.hash. Static scripts, stylesheets, and preloads\n // are forbidden. The inline loader removes the fragment, imports the authority bootstrap, then\n // that bootstrap invokes loadAppStyles only after session establishment and canonicalization.\n const stylesheetUrls = entry.stylesheets.map((stylesheet) => `/${basename(stylesheet.path)}`)\n const bootstrap = [\n `const { startSharedApp } = await import(${JSON.stringify(`/${basename(entry.script.path)}`)})`,\n ...(stylesheetUrls.length > 0\n ? [\n \" startSharedApp(bootstrap, {\",\n \" async loadAppStyles() {\",\n \" await Promise.all(\",\n ` ${JSON.stringify(stylesheetUrls)}.map((href) => new Promise((resolve) => {`,\n ' const link = document.createElement(\"link\")',\n ' link.rel = \"stylesheet\"',\n ' link.crossOrigin = \"anonymous\"',\n ' link.addEventListener(\"load\", resolve, { once: true })',\n ' link.addEventListener(\"error\", resolve, { once: true })',\n \" link.href = href\",\n \" document.head.append(link)\",\n \" }))\",\n \" )\",\n \" },\",\n \" })\",\n ]\n : [\" startSharedApp(bootstrap)\"]),\n ].join(\"\\n\")\n\n return withLoadingShell(sourceHtml).replace(sourceEntryPattern, bootstrap)\n}\n\nfunction resolveBrowserEntry(\n outputs: readonly Bun.BuildArtifact[],\n label: string\n): {\n readonly script: Bun.BuildArtifact\n readonly stylesheets: readonly Bun.BuildArtifact[]\n} {\n const script = outputs.find(\n (output) => output.kind === \"entry-point\" && output.type.startsWith(\"text/javascript\")\n )\n const stylesheets = outputs.filter((output) => output.type.startsWith(\"text/css\"))\n if (!script || stylesheets.length > 1) {\n throw new Error(\n `[SixbCustomApp] Expected one ${label} entry and at most one stylesheet, found ${script ? 1 : 0} entries and ${stylesheets.length} stylesheets.`\n )\n }\n return { script, stylesheets }\n}\n\n/** Builds the optional custom auth entry as API-served static assets. */\nexport async function buildAuthExperience(\n options: BuildAuthExperienceOptions\n): Promise<BuildAppResult> {\n const outdir = resolve(options.outdir)\n const assetsDir = join(outdir, \"assets\")\n await rm(outdir, { recursive: true, force: true })\n await mkdir(assetsDir, { recursive: true })\n\n const result = await Bun.build({\n entrypoints: [options.scriptEntryPath],\n outdir: assetsDir,\n target: \"browser\",\n conditions: [\"bun\"],\n publicPath: \"/auth/assets/\",\n minify: true,\n splitting: true,\n naming: {\n entry: \"auth-[hash].[ext]\",\n chunk: \"chunk-[name]-[hash].[ext]\",\n asset: \"asset-[name]-[hash].[ext]\",\n },\n plugins: [extensionlessSourceImportPlugin, publicRootUrlPlugin],\n throw: false,\n define: { \"process.env.NODE_ENV\": '\"production\"' },\n sourcemap: \"external\",\n })\n\n if (!result.success) {\n return {\n success: false,\n outdir,\n logs: result.logs.map(String),\n }\n }\n\n const script = result.outputs.find(\n (output) => output.kind === \"entry-point\" && output.type.startsWith(\"text/javascript\")\n )\n const stylesheets = result.outputs.filter((output) => output.type.startsWith(\"text/css\"))\n if (!script || stylesheets.length > 1) {\n throw new Error(\n `[SixbCustomApp] Expected one auth entry and at most one stylesheet, found ${script ? 1 : 0} entries and ${stylesheets.length} stylesheets.`\n )\n }\n\n const sourceHtml = await readFile(options.entryPath, \"utf-8\")\n const sourceEntryPattern =\n /\\s*<script\\s+type=[\"']module[\"']\\s+src=[\"']\\.\\/auth-main\\.tsx[\"']><\\/script>/\n if (!sourceEntryPattern.test(sourceHtml)) {\n throw new Error(\"[SixbCustomApp] Generated auth shell is missing its ./auth-main.tsx entry.\")\n }\n\n const assetTags = [\n ...stylesheets.map(\n (stylesheet) =>\n `<link rel=\"stylesheet\" crossorigin href=\"/auth/assets/${basename(stylesheet.path)}\">`\n ),\n `<script type=\"module\" crossorigin src=\"/auth/assets/${basename(script.path)}\"></script>`,\n ].join(\"\")\n const html = sourceHtml\n .replace(sourceEntryPattern, \"\")\n .replace(\"</head>\", ` ${assetTags}</head>`)\n await writeFile(join(outdir, \"index.html\"), html, \"utf-8\")\n await precompressBuildAssets(result.outputs)\n\n return { success: true, outdir }\n}\n\n// Bun's HTML bundler currently tries to resolve root-relative link assets from\n// the filesystem root. A temporary external origin keeps these stable URLs out\n// of the asset graph; dev responses and production output restore the originals.\nexport async function prepareAppHtmlBundleEntry(entryPath: string): Promise<string> {\n const html = await readFile(entryPath, \"utf-8\")\n const bundleHtml = html.replace(\n /(<link\\s+rel=[\"'](?:manifest|icon|apple-touch-icon)[\"']\\s+href=[\"'])(\\/[^\"']*)([\"'][^>]*>)/g,\n `$1${STATIC_ASSET_ORIGIN}$2$3`\n )\n const entryName = basename(entryPath, \".html\")\n const bundleEntryPath = join(dirname(entryPath), `${entryName}.sixb-bundle.html`)\n await writeFile(bundleEntryPath, bundleHtml, \"utf-8\")\n return bundleEntryPath\n}\n\nexport function restoreAppStaticUrls(html: string): string {\n return html.replaceAll(STATIC_ASSET_ORIGIN, \"\")\n}\n\n/**\n * Applies the theme chosen in the app (`ThemeProvider` stores it under `sixb-theme`) before the\n * first paint, so a page loaded in dark mode never paints its light shell first. Only a stored\n * choice applies: an app without a `ThemeProvider` has none and stays light, and with no choice\n * made the shell follows the system through its own media query until the provider mounts.\n */\nconst THEME_BOOTSTRAP =\n 'try{var t=localStorage.getItem(\"sixb-theme\");if(t===\"dark\"||t===\"light\")document.documentElement.classList.add(t)}catch(e){}'\n\n/**\n * What shows while the app loads: the app's own background with its icon in the middle, as a\n * native app's launch screen does, so opening the installed app runs from iOS's launch image\n * (drawn to match, see `startup-image.ts`) to this to the app without a flash. The app's\n * stylesheet loads before the body paints, so `--background` is the app's colour in either theme.\n * On a cold start iOS can report the viewport a status bar short, so the shell takes the corrected\n * `--viewport-height` to centre its icon where the launch image has it, and the page behind it takes\n * its colour. A spinner joins the icon only once loading takes long enough to notice.\n */\nfunction withLoadingShell(html: string): string {\n const icon = html.match(/<link\\s+rel=[\"']icon[\"']\\s+href=[\"']([^\"']+)[\"']/)?.[1]\n const styles = `<style data-sixb-loading-shell>\n .sixb-loading-shell{position:fixed;top:0;left:0;width:100%;height:var(--viewport-height,100vh);display:grid;place-items:center;background:var(--background,#fff);color:var(--muted-foreground,#71717a)}\n html:has(.sixb-loading-shell){background:var(--background,#fff)}\n .sixb-loading-icon{width:${LAUNCH_ICON_SIZE}px;height:${LAUNCH_ICON_SIZE}px;object-fit:contain}\n .sixb-loading-spinner{width:1.25rem;height:1.25rem;border:2px solid currentColor;border-right-color:transparent;border-radius:9999px;opacity:0;animation:sixb-loading-spin .7s linear infinite,sixb-loading-show .2s ease-out .8s forwards}\n .sixb-loading-icon+.sixb-loading-spinner{position:absolute;top:calc(50% + ${LAUNCH_ICON_SIZE / 2 + 24}px);left:calc(50% - .625rem)}\n @media(prefers-color-scheme:dark){html:not(.light):not(.dark):has(.sixb-loading-shell),html:not(.light):not(.dark) .sixb-loading-shell{background:#09090b;color:#a1a1aa}}\n @media(prefers-reduced-motion:reduce){.sixb-loading-spinner{animation-duration:1.5s,.2s}}\n @keyframes sixb-loading-spin{to{transform:rotate(360deg)}}\n @keyframes sixb-loading-show{to{opacity:1}}\n </style>\n <script data-sixb-theme>${THEME_BOOTSTRAP}</script>${\n // Decoded by the first paint, so the icon is there as iOS fades from its launch image.\n icon ? `\\n <link rel=\"preload\" as=\"image\" href=\"${icon}\">` : \"\"\n }`\n const iconTag = icon\n ? `<img class=\"sixb-loading-icon\" src=\"${icon}\" alt=\"\" width=\"${LAUNCH_ICON_SIZE}\" height=\"${LAUNCH_ICON_SIZE}\">`\n : \"\"\n const root = `<div id=\"root\"><div class=\"sixb-loading-shell\" role=\"status\" aria-label=\"Loading application\">${iconTag}<span class=\"sixb-loading-spinner\" aria-hidden=\"true\"></span></div></div>`\n\n if (!html.includes('<div id=\"root\"></div>') || !html.includes(\"</head>\")) {\n throw new Error(\"[SixbCustomApp] Generated app shell is missing its root or head element.\")\n }\n\n return html.replace(\"</head>\", `${styles}\\n </head>`).replace('<div id=\"root\"></div>', root)\n}\n\n/**\n * Writes the service worker for this build. Its version is the shell's own hash, which names every\n * entry file, so any change to the app replaces what devices keep. It saves the shell's stylesheet,\n * script and icons up front; the rest is saved as the app loads it.\n */\nasync function writeServiceWorker(outdir: string, html: string, entry: string): Promise<string> {\n const version = createHash(\"sha256\").update(html).digest(\"hex\").slice(0, 16)\n const precache = [\n ...new Set([\n ...[...html.matchAll(/<(?:script|link)\\b[^>]*\\s(?:src|href)=[\"'](\\/[^\"'/][^\"']*)[\"']/g)]\n .map((match) => match[1])\n .filter((path): path is string => path !== undefined && path !== \"/app.webmanifest\"),\n // The page registers the worker after it has loaded these, so it never saves them itself.\n ...(await startupChunks(outdir, entry)),\n ]),\n ]\n const path = join(outdir, SERVICE_WORKER_PATH.slice(1))\n await writeFile(path, renderServiceWorker({ version, entry, precache }), \"utf-8\")\n return path\n}\n\n/** A static `import … from \"/chunk-…\"` or `import \"/chunk-…\"` in a bundle; `import(` is left out. */\nconst STATIC_CHUNK_IMPORT = /\\b(?:from|import)\\s*[\"'](\\/chunk-[^\"']+\\.js)[\"']/g\n\n/**\n * The chunks the entry imports as it loads, and the chunks those import: everything the app runs\n * before its first screen. Chunks loaded on demand, such as a chart, are saved when first used.\n */\nexport async function startupChunks(outdir: string, entry: string): Promise<string[]> {\n const found = new Set<string>()\n const pending = [entry]\n for (let path = pending.pop(); path !== undefined; path = pending.pop()) {\n const source = await readFile(join(outdir, path.slice(1)), \"utf-8\").catch(() => \"\")\n for (const [, chunk] of source.matchAll(STATIC_CHUNK_IMPORT)) {\n if (chunk === undefined || found.has(chunk)) continue\n found.add(chunk)\n pending.push(chunk)\n }\n }\n return [...found]\n}\n\n// A root-relative `url()` in CSS, such as a font at `/fonts/x.woff2`, names a file in `app/public`.\n// That folder is copied into the output as-is, so the URL has to stay as written instead of being\n// resolved against the filesystem root, where Bun fails the build.\nconst publicRootUrlPlugin: Bun.BunPlugin = {\n name: \"sixb-public-root-urls\",\n setup(build) {\n // Bun reports a CSS `url()` as kind \"internal\", so the importer is what says it came from CSS.\n build.onResolve({ filter: /^\\/(?!\\/)/ }, (args) =>\n args.importer.endsWith(\".css\") ? { path: args.path, external: true } : undefined\n )\n },\n}\n\nconst extensionlessSourceImportPlugin: Bun.BunPlugin = {\n name: \"sixb-extensionless-source-imports\",\n setup(build) {\n // A direct TypeScript entry with splitting exposes a Bun 1.3 resolver edge in linked workspace\n // packages: extensionless relative imports such as `../json` can fail even though `json.ts`\n // exists. HTML entries masked it, but HTML splitting can point at the wrong dynamic chunk.\n // Let Bun resolve already-explicit imports without entering this hook. On affected Bun\n // releases (including 1.3.14 and 1.4.0), merely intercepting a package's explicit `.js`\n // imports and returning `undefined` can corrupt DCE: subclass wrappers remain in the bundle\n // while their imported superclass is removed.\n build.onResolve({ filter: /^\\.\\.?\\/(?:.*\\/)?[^/.]+$/ }, (args) => {\n const base = resolve(dirname(args.importer), args.path)\n for (const candidate of [\n `${base}.ts`,\n `${base}.tsx`,\n `${base}.js`,\n `${base}.jsx`,\n join(base, \"index.ts\"),\n join(base, \"index.tsx\"),\n join(base, \"index.js\"),\n join(base, \"index.jsx\"),\n ]) {\n if (existsSync(candidate)) return { path: candidate }\n }\n\n return undefined\n })\n },\n}\n\nasync function precompressBuildAssets(\n outputs: readonly { readonly path: string; readonly type: string }[]\n): Promise<void> {\n const paths = [\n ...new Set(\n outputs\n .filter(\n (output) =>\n output.type.startsWith(\"text/javascript\") || output.type.startsWith(\"text/css\")\n )\n .map((output) => output.path)\n ),\n ]\n let cursor = 0\n\n const worker = async () => {\n while (cursor < paths.length) {\n const path = paths[cursor++]\n const bytes = await Bun.file(path).arrayBuffer()\n const [brotli, gzipped] = await Promise.all([\n brotliCompress(bytes, {\n params: {\n [zlibConstants.BROTLI_PARAM_QUALITY]: 5,\n },\n }),\n gzip(bytes, { level: 9 }),\n ])\n await Promise.all([writeFile(`${path}.br`, brotli), writeFile(`${path}.gz`, gzipped)])\n }\n }\n\n await Promise.all(\n Array.from({ length: Math.min(PRECOMPRESSION_CONCURRENCY, paths.length) }, worker)\n )\n}\n",
7
7
  "/** Where the service worker is served: a Sixb name, so a project's own `public/sw.js` keeps its. */\nexport const SERVICE_WORKER_PATH = \"/sixb-service-worker.js\"\n\n/**\n * Paths the app's origin keeps for the API, sign-in, docs and shared links. The worker leaves them\n * to the network, as the app's link handling does.\n */\nexport const RESERVED_PATH_PREFIXES = [\"/api\", \"/auth\", \"/ws\", \"/docs\", \"/shared\"] as const\n\n/**\n * Names `buildApp` gives entries, chunks and assets: a content hash keeps each one's contents fixed\n * under its URL, so the server caches them forever and the worker can serve them without asking.\n */\nexport const IMMUTABLE_ASSET_PATTERN =\n /^(?:(?:app|shared|chunk)-[a-z0-9]+|(?:chunk|asset)-.+-[a-z0-9]+)\\.[a-z0-9]+(?:\\.map)?$/\n\n/** How long a page waits for the network before opening from the device instead. */\nconst NAVIGATION_TIMEOUT_MS = 3000\n\nexport interface ServiceWorkerOptions {\n /** Changes with every build, so a deploy replaces what the device keeps. */\n readonly version: string\n /** The shell's entry script: a shell that doesn't name it belongs to another deploy. */\n readonly entry: string\n /** Same-origin files the app needs to open: its entry script and stylesheet, and its icons. */\n readonly precache: readonly string[]\n}\n\n/**\n * The service worker a production build ships. It keeps the app on the device, so the installed\n * app opens on a slow connection or none:\n *\n * - A page goes to the network first, and opens from the device when the network fails or takes\n * longer than three seconds. Every page is the same app shell, saved from `/` once per version.\n * - A hashed file comes from the device once saved; any other file of the app's comes from the\n * network, and from the device when the network fails. Each is saved as it loads.\n * - Other origins, such as a separately served API, and the reserved paths pass through untouched.\n *\n * Installing saves the shell and the files it opens with; a new version takes over at once. The last\n * version's files stay one more round, for a page still running it, and older ones go. The page's\n * data still comes from the API.\n *\n * With navigation preload, the browser asks for a page while the worker starts rather than after, so\n * the worker adds no wait to a launch online.\n */\nexport function renderServiceWorker(options: ServiceWorkerOptions): string {\n return `// Generated by Sixb: the app's service worker. See @sixb/app's service-worker.ts.\nconst CACHE_PREFIX = \"sixb-app-\"\nconst CACHE = CACHE_PREFIX + ${JSON.stringify(options.version)}\nconst SHELL = \"/\"\nconst ENTRY = ${JSON.stringify(options.entry)}\nconst PRECACHE = ${JSON.stringify(options.precache)}\nconst RESERVED = ${JSON.stringify(RESERVED_PATH_PREFIXES)}\nconst IMMUTABLE = ${IMMUTABLE_ASSET_PATTERN.toString()}\nconst NAVIGATION_TIMEOUT_MS = ${NAVIGATION_TIMEOUT_MS}\n\nself.addEventListener(\"install\", (event) => {\n // Best effort: a file that fails to save is saved when the app next loads it.\n event.waitUntil(\n caches\n .open(CACHE)\n .then((cache) =>\n Promise.allSettled([\n fetch(new Request(SHELL, { cache: \"reload\" })).then((response) => saveShell(cache, response)),\n // The page has just loaded these, so most come from the browser's cache.\n ...PRECACHE.map((path) => cache.add(path)),\n ])\n )\n .then(() => self.skipWaiting())\n )\n})\n\nself.addEventListener(\"activate\", (event) => {\n event.waitUntil(\n caches\n .keys()\n .then((keys) =>\n Promise.all(\n keys\n .filter((key) => key.startsWith(CACHE_PREFIX) && key !== CACHE)\n // Oldest first: all but the last version go.\n .slice(0, -1)\n .map((key) => caches.delete(key))\n )\n )\n // The browser asks for a page while it starts the worker, rather than after.\n .then(() => self.registration.navigationPreload?.enable())\n .then(() => self.clients.claim())\n )\n})\n\nself.addEventListener(\"fetch\", (event) => {\n const request = event.request\n if (request.method !== \"GET\" || request.headers.has(\"range\")) return\n const url = new URL(request.url)\n if (url.origin !== self.location.origin || isReserved(url.pathname)) return\n\n if (request.mode === \"navigate\") {\n event.respondWith(page(event, url))\n } else {\n event.respondWith(file(event, url))\n }\n})\n\nfunction page(event, url) {\n let saving = Promise.resolve()\n const network = Promise.resolve(event.preloadResponse)\n .then((preloaded) => preloaded ?? fetch(event.request))\n .then((response) => {\n // Only \"/\" refreshes the shell: another address may be a page of the project's own.\n if (url.pathname === SHELL) {\n const copy = response.clone()\n saving = caches.open(CACHE).then((cache) => saveShell(cache, copy))\n }\n return response\n })\n event.waitUntil(network.then(() => saving, () => undefined))\n\n const offline = network.catch(() => savedShell().then((saved) => saved ?? Response.error()))\n const slow = delay(NAVIGATION_TIMEOUT_MS)\n .then(savedShell)\n .then((saved) => saved ?? offline)\n return Promise.race([offline, slow])\n}\n\nasync function file(event, url) {\n // Any version's copy will do for a hashed file, so a page the last version runs still finds its own.\n const immutable = IMMUTABLE.test(url.pathname.split(\"/\").pop() ?? \"\")\n if (immutable) {\n const saved = await caches.match(event.request)\n if (saved) return saved\n }\n try {\n const response = await fetch(event.request)\n if (response.ok && response.type === \"basic\") {\n const copy = response.clone()\n event.waitUntil(caches.open(CACHE).then((cache) => cache.put(event.request, copy)))\n }\n return response\n } catch (error) {\n const saved = await caches.match(event.request)\n if (saved) return saved\n throw error\n }\n}\n\nasync function saveShell(cache, response) {\n if (!isShell(response)) return\n // Mid-rollout another server can answer with the other deploy's shell, whose files aren't kept.\n if (!(await response.clone().text()).includes(ENTRY)) return\n await cache.put(SHELL, response)\n}\n\nfunction isShell(response) {\n return (\n response.ok &&\n !response.redirected &&\n response.type === \"basic\" &&\n (response.headers.get(\"content-type\") ?? \"\").includes(\"text/html\")\n )\n}\n\n// This version's shell, else the last version's, whose files are still kept.\nasync function savedShell() {\n return (await (await caches.open(CACHE)).match(SHELL)) ?? (await caches.match(SHELL))\n}\n\nfunction isReserved(pathname) {\n return RESERVED.some((prefix) => pathname === prefix || pathname.startsWith(prefix + \"/\"))\n}\n\nfunction delay(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n`\n}\n",
8
8
  "import { access, mkdir, readFile, rm, writeFile } from \"node:fs/promises\"\nimport { join, relative, resolve } from \"node:path\"\nimport { en, fr } from \"./locale-messages\"\nimport { renderAppManifest } from \"./manifest\"\nimport { resolveAppMetadata } from \"./metadata\"\nimport { renderCustomAppRuntimeScript } from \"./runtime\"\nimport { type AppRouteLayout, type PageRoute, routePatternKey } from \"./scanner\"\nimport { RESERVED_PATH_PREFIXES, SERVICE_WORKER_PATH } from \"./service-worker\"\n\nexport interface BuiltInRouteManifestEntry {\n readonly path: string\n readonly moduleSpecifier: string\n readonly exportName: string\n /** False for developer tooling, whose views are not app activity. Default: true. */\n readonly recordsActivity?: boolean\n}\n\nexport interface GenerateRouteManifestOptions {\n readonly builtInRoutes?: readonly BuiltInRouteManifestEntry[]\n readonly layouts?: readonly AppRouteLayout[]\n}\n\n/** The shared shell's unavailable message per language, inlined before any module loads. */\nfunction sharedUnavailableTranslations(): Record<string, string> {\n return { en: en.shared.unavailableDetail, fr: fr.shared.unavailableDetail }\n}\n\nexport const AUTH_EXPERIENCE_BOOTSTRAP_PLACEHOLDER = \"__SIXB_AUTH_BOOTSTRAP__\"\n\nfunction assertNoReservedSharedRoutes(routes: readonly PageRoute[]): void {\n const reservedRoute = routes.find(\n (route) => route.path === \"/shared\" || route.path.startsWith(\"/shared/\")\n )\n if (!reservedRoute) return\n\n throw new Error(\n `[SixbCustomApp] ${reservedRoute.relativePath} maps to the reserved ${JSON.stringify(reservedRoute.path)} route. Shared links reuse ordinary app pages; move this page outside app/shared/.`\n )\n}\n\n/**\n * Generates `.sixb/generated/routes.ts` with static page/layout imports. Modules are\n * eager on purpose: project-specific apps bundle small, and a single bundle\n * (one JS file, one render-blocking CSS file) means no Suspense gap or\n * late-arriving styles when navigating.\n */\nexport async function generateRouteManifest(\n routes: readonly PageRoute[],\n generatedDir: string,\n options: GenerateRouteManifestOptions = {}\n): Promise<string> {\n assertNoReservedSharedRoutes(routes)\n await mkdir(generatedDir, { recursive: true })\n\n const pages = [...routes].sort(compareRouteModules)\n const pageImports = pages\n .map((route, index) => {\n const rel = relativeTo(generatedDir, route.filePath)\n return `import Page${index} from ${JSON.stringify(rel)}`\n })\n .join(\"\\n\")\n const projectRoutePatterns = new Set(pages.map((route) => routePatternKey(route.path)))\n const builtInRoutes = (options.builtInRoutes ?? []).filter(\n (route) => !projectRoutePatterns.has(routePatternKey(route.path))\n )\n const builtInImports = builtInRoutes\n .map(\n (route, index) =>\n `import { ${route.exportName} as BuiltInPage${index} } from ${JSON.stringify(route.moduleSpecifier)}`\n )\n .join(\"\\n\")\n const routePatterns = [...pages, ...builtInRoutes].map((route) => routePatternKey(route.path))\n const layouts = [...(options.layouts ?? [])]\n .filter((layout) => {\n const layoutPattern = routePatternKey(layout.path)\n return routePatterns.some(\n (routePattern) =>\n routePattern === layoutPattern || routePattern.startsWith(`${layoutPattern}/`)\n )\n })\n .sort(compareRouteModules)\n const layoutImports = layouts\n .map((layout, index) => {\n const rel = relativeTo(generatedDir, layout.filePath)\n return `import Layout${index} from ${JSON.stringify(rel)}`\n })\n .join(\"\\n\")\n\n const tree = createRouteTree()\n for (const [index, layout] of layouts.entries()) {\n insertRouteLayout(tree, layout, `Layout${index}`)\n }\n for (const [index, route] of pages.entries()) {\n insertRoutePage(tree, route.path, `Page${index}`, route.relativePath)\n }\n for (const [index, route] of builtInRoutes.entries()) {\n insertRoutePage(\n tree,\n route.path,\n `BuiltInPage${index}`,\n `${route.moduleSpecifier} (${route.path})`\n )\n }\n\n const importEntries = [\n 'import { createElement } from \"react\"',\n layouts.length > 0\n ? 'import { Outlet, type RouteObject } from \"react-router-dom\"'\n : 'import type { RouteObject } from \"react-router-dom\"',\n pageImports,\n builtInImports,\n layoutImports,\n ]\n .filter(Boolean)\n .join(\"\\n\")\n const routePaths = [\n ...pages.map((route) => route.path),\n ...builtInRoutes.map((route) => route.path),\n ]\n const activityRoutePaths = [\n ...pages.map((route) => route.path),\n ...builtInRoutes.filter((route) => route.recordsActivity !== false).map((route) => route.path),\n ]\n const content = `${importEntries}\n\nexport const routePaths = ${JSON.stringify(routePaths, null, 2)} as const\n\n/** The pages whose views count as app activity: all but the built-in sections. */\nexport const activityRoutePaths: readonly string[] = ${JSON.stringify(activityRoutePaths, null, 2)}\n\nexport const routes = [\n${renderRootRouteObjects(tree)}\n] satisfies RouteObject[]\n`\n\n const outPath = join(generatedDir, \"routes.ts\")\n await writeFileIfChanged(outPath, content)\n return outPath\n}\n\ninterface RouteTreePage {\n readonly componentName: string\n readonly source: string\n}\n\ninterface RouteTreeLayout {\n readonly componentName: string\n readonly source: string\n}\n\ninterface RouteTreeNode {\n readonly segment: string\n readonly children: Map<string, RouteTreeNode>\n page?: RouteTreePage\n layout?: RouteTreeLayout\n}\n\nfunction createRouteTree(segment = \"\"): RouteTreeNode {\n return { segment, children: new Map() }\n}\n\nfunction insertRouteLayout(\n root: RouteTreeNode,\n layout: AppRouteLayout,\n componentName: string\n): void {\n if (layout.path === \"/\") {\n throw new Error(\n `[SixbCustomApp] Root layout ${layout.relativePath} must remain the global app wrapper.`\n )\n }\n const node = resolveRouteNode(root, layout.path, layout.relativePath)\n if (node.layout) {\n throw new Error(\n `[SixbCustomApp] Conflicting layouts '${node.layout.source}' and '${layout.relativePath}' own route '${layout.path}'.`\n )\n }\n node.layout = { componentName, source: layout.relativePath }\n}\n\nfunction insertRoutePage(\n root: RouteTreeNode,\n path: string,\n componentName: string,\n source: string\n): void {\n const node = resolveRouteNode(root, path, source)\n if (node.page) {\n throw new Error(\n `[SixbCustomApp] Conflicting pages '${node.page.source}' and '${source}' match route '${path}'.`\n )\n }\n node.page = { componentName, source }\n}\n\nfunction resolveRouteNode(root: RouteTreeNode, path: string, source: string): RouteTreeNode {\n let node = root\n for (const segment of splitRoutePath(path)) {\n const key = segment.startsWith(\":\") ? \":\" : segment.toLowerCase()\n const existing = node.children.get(key)\n if (existing) {\n if (\n existing.segment.startsWith(\":\") &&\n segment.startsWith(\":\") &&\n existing.segment !== segment\n ) {\n throw new Error(\n `[SixbCustomApp] Route '${source}' uses dynamic segment '${segment}', but '${existing.segment}' already owns the same route position. Use one parameter name consistently.`\n )\n }\n node = existing\n continue\n }\n\n const child = createRouteTree(segment)\n node.children.set(key, child)\n node = child\n }\n return node\n}\n\nfunction renderRootRouteObjects(root: RouteTreeNode): string {\n const lines: string[] = []\n if (root.page) {\n lines.push(` { path: \"/\", element: createElement(${root.page.componentName}) },`)\n }\n for (const child of sortedRenderableChildren(root)) {\n lines.push(...renderRouteNode(child, 1))\n }\n return lines.join(\"\\n\")\n}\n\nfunction renderRouteNode(node: RouteTreeNode, depth: number): string[] {\n const indent = \" \".repeat(depth)\n const children = sortedRenderableChildren(node)\n if (!node.layout && node.page && children.length === 0) {\n return [\n `${indent}{ path: ${JSON.stringify(node.segment)}, element: createElement(${node.page.componentName}) },`,\n ]\n }\n\n const lines = [`${indent}{`, `${indent} path: ${JSON.stringify(node.segment)},`]\n if (node.layout) {\n lines.push(\n `${indent} element: createElement(${node.layout.componentName}, { children: createElement(Outlet) }),`\n )\n }\n lines.push(`${indent} children: [`)\n if (node.page) {\n lines.push(`${indent} { index: true, element: createElement(${node.page.componentName}) },`)\n }\n for (const child of children) {\n lines.push(...renderRouteNode(child, depth + 2))\n }\n lines.push(`${indent} ],`, `${indent}},`)\n return lines\n}\n\nfunction sortedRenderableChildren(node: RouteTreeNode): RouteTreeNode[] {\n return [...node.children.values()].filter(hasPageDescendant).sort((a, b) => {\n const aDynamic = a.segment.startsWith(\":\")\n const bDynamic = b.segment.startsWith(\":\")\n if (aDynamic !== bDynamic) return aDynamic ? 1 : -1\n return compareText(a.segment, b.segment)\n })\n}\n\nfunction hasPageDescendant(node: RouteTreeNode): boolean {\n if (node.page) return true\n for (const child of node.children.values()) {\n if (hasPageDescendant(child)) return true\n }\n return false\n}\n\nfunction splitRoutePath(path: string): string[] {\n if (path === \"/\") return []\n if (!path.startsWith(\"/\")) {\n throw new Error(`[SixbCustomApp] Route path '${path}' must start with '/'.`)\n }\n const segments = path.slice(1).split(\"/\")\n if (segments.some((segment) => !segment)) {\n throw new Error(`[SixbCustomApp] Route path '${path}' contains an empty segment.`)\n }\n return segments\n}\n\nfunction compareRouteModules(\n a: Pick<AppRouteLayout, \"path\" | \"relativePath\">,\n b: Pick<AppRouteLayout, \"path\" | \"relativePath\">\n): number {\n return compareText(a.path, b.path) || compareText(a.relativePath, b.relativePath)\n}\n\nfunction compareText(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0\n}\n\n/** Generates the optional browser entry served by the API for `/auth/*`. */\nexport async function generateAuthExperienceEntry(\n projectRoot: string,\n generatedDir: string,\n options: {\n readonly appDir?: string\n readonly publicDir?: string\n readonly stylesheetPath?: string | null\n } = {}\n): Promise<{ readonly htmlPath: string; readonly mainPath: string } | null> {\n await mkdir(generatedDir, { recursive: true })\n\n const appDir = options.appDir ? resolve(projectRoot, options.appDir) : join(projectRoot, \"app\")\n const authPath = join(appDir, \"auth.tsx\")\n if (!(await fileExists(authPath))) {\n return null\n }\n\n const publicDir = options.publicDir\n ? resolve(projectRoot, options.publicDir)\n : join(appDir, \"public\")\n const layoutPath = join(appDir, \"layout.tsx\")\n const globalsCssPath = join(appDir, \"globals.css\")\n const metadata = await resolveAppMetadata({ layoutPath, publicDir })\n const stylesheetPath =\n options.stylesheetPath !== undefined\n ? options.stylesheetPath\n : (await fileExists(globalsCssPath))\n ? globalsCssPath\n : null\n const stylesheetImport = stylesheetPath\n ? `import ${JSON.stringify(relativeTo(generatedDir, stylesheetPath))}`\n : \"\"\n const authRel = relativeTo(generatedDir, authPath)\n\n const mainContent = `import React from \"react\"\nimport { createRoot } from \"react-dom/client\"\nimport type {\n AuthExperienceActions,\n AuthExperienceState,\n} from \"@sixb/app\"\nimport AuthExperience from ${JSON.stringify(authRel)}\n${stylesheetImport}\n\ninterface AuthExperienceBootstrap {\n readonly state: AuthExperienceState\n readonly signInUrl: string\n readonly submission?: {\n readonly kind: \"requestMagicLink\" | \"confirmSignIn\"\n readonly action: string\n readonly fields: Readonly<Record<string, string>>\n }\n}\n\nconst root = document.getElementById(\"root\")\nif (!root) {\n throw new Error(\"[SixbApp] Could not find the auth experience root element.\")\n}\n\nconst encodedBootstrap = root.dataset.sixbAuth\nif (!encodedBootstrap) {\n throw new Error(\"[SixbApp] Auth experience bootstrap is missing.\")\n}\n\nconst bootstrap = decodeBootstrap(encodedBootstrap)\nconst actions: AuthExperienceActions = {\n requestMagicLink(email) {\n submit(\"requestMagicLink\", { email })\n },\n confirmSignIn(input) {\n // Pages often pass this straight to onClick, which hands over the click event, not a name.\n const displayName = typeof input?.displayName === \"string\" ? input.displayName : undefined\n submit(\"confirmSignIn\", displayName === undefined ? {} : { displayName })\n },\n restartSignIn() {\n window.location.assign(bootstrap.signInUrl)\n },\n}\n\nfunction submit(\n kind: NonNullable<AuthExperienceBootstrap[\"submission\"]>[\"kind\"],\n additionalFields: Readonly<Record<string, string>> = {}\n): void {\n const submission = bootstrap.submission\n if (!submission || submission.kind !== kind) {\n throw new Error(\"[SixbApp] Auth action '\" + kind + \"' is not available in this state.\")\n }\n\n const form = document.createElement(\"form\")\n form.method = \"post\"\n form.action = submission.action\n form.hidden = true\n for (const [name, value] of Object.entries({ ...submission.fields, ...additionalFields })) {\n const input = document.createElement(\"input\")\n input.type = \"hidden\"\n input.name = name\n input.value = value\n form.append(input)\n }\n document.body.append(form)\n form.submit()\n}\n\nfunction decodeBootstrap(value: string): AuthExperienceBootstrap {\n const base64 = value.replaceAll(\"-\", \"+\").replaceAll(\"_\", \"/\")\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\")\n const bytes = Uint8Array.from(atob(padded), (character) => character.charCodeAt(0))\n return JSON.parse(new TextDecoder().decode(bytes)) as AuthExperienceBootstrap\n}\n\ncreateRoot(root).render(<AuthExperience state={bootstrap.state} actions={actions} />)\n`\n\n const mainPath = join(generatedDir, \"auth-main.tsx\")\n await writeFileIfChanged(mainPath, mainContent)\n\n const htmlContent = `<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, viewport-fit=cover\" />\n${renderAuthMetadataHead(metadata)}\n <style>\n * { box-sizing: border-box; }\n html, body, #root { margin: 0; min-height: 100%; }\n body, #root { min-height: 100vh; min-height: 100dvh; }\n </style>\n </head>\n <body>\n <div id=\"root\" data-sixb-auth=\"${AUTH_EXPERIENCE_BOOTSTRAP_PLACEHOLDER}\"></div>\n <script type=\"module\" src=\"./auth-main.tsx\"></script>\n </body>\n</html>\n`\n const htmlPath = join(generatedDir, \"auth-index.html\")\n await writeFileIfChanged(htmlPath, htmlContent)\n return { htmlPath, mainPath }\n}\n\n/**\n * Generates the app entry files:\n * - `.sixb/generated/index.html` — ordinary authenticated HTML shell\n * - `.sixb/generated/main.tsx` — ordinary authentication bootstrap\n * - `.sixb/generated/app-runtime.tsx` — shared route, layout, and query runtime\n * - `.sixb/generated/shared-index.html` — isolated shared-link HTML shell\n * - `.sixb/generated/shared-main.tsx` — delegated-session bootstrap\n * - `.sixb/generated/app.webmanifest` — installable app identity\n */\nexport async function generateAppEntry(\n projectRoot: string,\n generatedDir: string,\n options: {\n apiBaseUrl?: string\n authEnabled?: boolean\n appDir?: string\n publicDir?: string\n /**\n * Stylesheet to import from the generated entry. `undefined` auto-detects\n * `app/globals.css` and imports it when it exists; `null` skips the import;\n * a path imports that file (e.g. compiled Tailwind output).\n */\n stylesheetPath?: string | null\n /** Framework-owned stylesheets imported before the app stylesheet. */\n frameworkStylesheetPaths?: readonly string[]\n /** The built-in section pages are routed, so the app draws their navigation. */\n sections?: boolean\n /** The project has pages of its own in `app/`. */\n projectPages?: boolean\n } = {}\n): Promise<{\n htmlPath: string\n mainPath: string\n manifestPath: string\n runtimePath: string\n sharedHtmlPath: string\n sharedMainPath: string\n}> {\n await mkdir(generatedDir, { recursive: true })\n\n const appDir = options.appDir ? resolve(projectRoot, options.appDir) : join(projectRoot, \"app\")\n const publicDir = options.publicDir\n ? resolve(projectRoot, options.publicDir)\n : join(appDir, \"public\")\n const globalsCssPath = join(appDir, \"globals.css\")\n const layoutPath = join(appDir, \"layout.tsx\")\n const metadata = await resolveAppMetadata({ layoutPath, publicDir })\n const manifestPath = join(generatedDir, \"app.webmanifest\")\n await writeFileIfChanged(manifestPath, renderAppManifest(metadata))\n const layoutRel = relativeTo(generatedDir, layoutPath)\n const hasLayout = await fileExists(layoutPath)\n const stylesheetPath =\n options.stylesheetPath !== undefined\n ? options.stylesheetPath\n : (await fileExists(globalsCssPath))\n ? globalsCssPath\n : null\n const stylesheetPaths = [\n ...(options.frameworkStylesheetPaths ?? []),\n ...(stylesheetPath ? [stylesheetPath] : []),\n ]\n const globalsCssImport = stylesheetPaths\n .map((path) => `import ${JSON.stringify(relativeTo(generatedDir, path))}`)\n .join(\"\\n\")\n const sections = options.sections ?? false\n // The namespace import reads the optional `toolViews` export without naming it, so a layout that\n // leaves it out still bundles without a missing-export warning.\n const layoutImport = hasLayout\n ? `import RootLayout, * as rootLayoutModule from ${JSON.stringify(layoutRel)}\\n`\n : \"\"\n // How every chat in the app shows the project's tools, from the same layout. Shared links too:\n // they render the same layout, and any chat in it.\n const toolViewsImport = hasLayout\n ? `import { AgentToolViewsProvider } from \"@sixb/app/pages\"\\n`\n : \"\"\n const toolViewsSetup = hasLayout\n ? `const toolViews = Reflect.get(rootLayoutModule, \"toolViews\")`\n : \"\"\n // A project with no `app/` of its own gets the default shell: its user menu is the way into every\n // section. Pages without a layout keep rendering bare, as they did before the built-in pages.\n const defaultShell = sections && !hasLayout && !options.projectPages\n const sectionsImport = sections\n ? `${defaultShell ? 'import { AppShell } from \"@sixb/app\"\\n' : \"\"}import { SectionsProvider } from \"@sixb/app/pages\"\\n`\n : \"\"\n const sectionsStart = sections ? \"<SectionsProvider enabled={!basename}>\" : \"\"\n const sectionsEnd = sections ? \"</SectionsProvider>\" : \"\"\n const layoutWrapperStart = hasLayout\n ? \"<AgentToolViewsProvider views={toolViews}><RootLayout>\"\n : defaultShell\n ? \"<AppShell>\"\n : \"<>\"\n const layoutWrapperEnd = hasLayout\n ? \"</RootLayout></AgentToolViewsProvider>\"\n : defaultShell\n ? \"</AppShell>\"\n : \"</>\"\n const runtimeConfigScript = options.apiBaseUrl\n ? renderCustomAppRuntimeScript({\n api: { baseUrl: options.apiBaseUrl },\n auth: { enabled: options.authEnabled ?? true },\n })\n : \"\"\n\n // Keep the authored route tree in one runtime. The normal entry imports it directly; the\n // shared entry imports it only after establishing a grant-bound session.\n const runtimeContent = `import React from \"react\"\nimport { createRoot, type Root } from \"react-dom/client\"\nimport type { GetAuthSessionResponse } from \"@sixb/client\"\nimport type { SixbSharedAccessSession } from \"@sixb/client/browser\"\nimport {\n BrowserRouter,\n matchPath,\n matchRoutes,\n useLocation,\n useNavigate,\n useRoutes,\n} from \"react-router-dom\"\nimport { QueryClient, QueryClientProvider, useQuery } from \"@tanstack/react-query\"\nimport { isSixbApiError, recordSixbPageView } from \"@sixb/client/browser\"\nimport {\n getAuthSessionQueryKey,\n getProjectInfoOptions,\n SixbEventsProvider,\n} from \"@sixb/client/hooks\"\nimport { LocaleProvider, useAppMessages } from \"@sixb/app/locale\"\nimport {\n keepSharedSession,\n PhoneFoundations,\n refreshOnReturn,\n restoreLastScreen,\n} from \"@sixb/app/pages\"\n${sectionsImport}${toolViewsImport}import { activityRoutePaths, routePaths, routes } from \"./routes\"\n${globalsCssImport}\n${layoutImport}\n\ninterface CustomAppHotData {\n root?: Root\n queryClient?: QueryClient\n}\n\nexport interface StartAppOptions {\n readonly basename?: string\n /** The session the bootstrap already loaded, so useCurrentUser does not fetch it again. */\n readonly session?: GetAuthSessionResponse\n /** A shared link's session, which the bootstrap opened for its visitor. */\n readonly sharedSession?: SixbSharedAccessSession\n}\n\nif (import.meta.hot) import.meta.hot.accept()\n\nconst queryClient = getQueryClient()\n\nfunction getRoot(): Root {\n const element = document.getElementById(\"root\")\n if (!element) {\n throw new Error(\"[SixbApp] Could not find the root element.\")\n }\n\n if (import.meta.hot) {\n const data = import.meta.hot.data as CustomAppHotData\n data.root ??= createRoot(element)\n return data.root\n }\n\n return createRoot(element)\n}\n\nfunction getQueryClient(): QueryClient {\n if (import.meta.hot) {\n const data = import.meta.hot.data as CustomAppHotData\n data.queryClient ??= createQueryClient()\n return data.queryClient\n }\n\n return createQueryClient()\n}\n\nfunction createQueryClient(): QueryClient {\n return new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n retry: 1,\n },\n },\n })\n}\n\nconst RESERVED_PATH_PREFIXES = [${RESERVED_PATH_PREFIXES.map((prefix) => JSON.stringify(prefix)).join(\", \")}]\n\nfunction isReservedPath(pathname: string) {\n return RESERVED_PATH_PREFIXES.some(\n (prefix) => pathname === prefix || pathname.startsWith(prefix + \"/\")\n )\n}\n\nfunction isSharedTransportPath(pathname: string): boolean {\n return pathname === \"/shared\" || pathname.startsWith(\"/shared/\")\n}\n\nfunction primaryNavigationAnchor(event: MouseEvent): HTMLAnchorElement | null {\n if (event.defaultPrevented) return null\n if (event.button !== 0) return null\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return null\n\n const target = event.target\n if (!(target instanceof Element)) return null\n const anchor = target.closest(\"a\")\n if (!(anchor instanceof HTMLAnchorElement)) return null\n if (anchor.target && anchor.target !== \"_self\") return null\n if (anchor.hasAttribute(\"download\")) return null\n if (anchor.relList.contains(\"external\")) return null\n if (!anchor.getAttribute(\"href\")) return null\n return anchor\n}\n\n// A React Router <Link> mutates the current document before effects can reload it. Capture shared\n// transport clicks first so an OIDC document never acquires a bearer fragment.\nfunction SharedDocumentLinkInterceptor({ basename }: { readonly basename?: string }) {\n React.useLayoutEffect(() => {\n function onClick(event: MouseEvent) {\n const anchor = primaryNavigationAnchor(event)\n if (!anchor) return\n\n const url = new URL(anchor.href, window.location.href)\n if (url.origin !== window.location.origin) return\n const appPath = pathInsideApp(url.pathname, basename)\n if (!isSharedTransportPath(appPath)) return\n\n // React Router prefixes an absolute <Link to=\"/shared/...\"> with the current basename.\n // Rebuild the transport URL from the path inside the app so switching grants does not nest\n // the new link beneath /shared/:currentGrantId.\n const documentUrl = new URL(appPath + url.search + url.hash, url.origin)\n\n event.preventDefault()\n event.stopImmediatePropagation()\n window.location.assign(documentUrl.href)\n }\n\n document.addEventListener(\"click\", onClick, true)\n return () => document.removeEventListener(\"click\", onClick, true)\n }, [basename])\n\n return null\n}\n\n// Makes plain same-origin <a href=\"/...\"> clicks navigate client-side, so app\n// authors get SPA navigation without remembering react-router's <Link>.\n// Deliberately conservative: anything unusual falls through to the browser.\nfunction InternalLinkInterceptor({ basename }: { readonly basename?: string }) {\n const navigate = useNavigate()\n\n React.useEffect(() => {\n function onClick(event: MouseEvent) {\n const anchor = primaryNavigationAnchor(event)\n if (!anchor) return\n\n const url = new URL(anchor.href, window.location.href)\n if (url.origin !== window.location.origin) return\n const appPath = pathInsideApp(url.pathname, basename)\n if (isReservedPath(appPath)) return\n // Only intercept destinations the app actually routes; anything else may\n // be a real server resource and keeps native navigation.\n if (!routePaths.some((path) => matchPath(path, appPath))) return\n // Same-document hash links keep native scroll behavior.\n if (\n url.hash &&\n url.pathname === window.location.pathname &&\n url.search === window.location.search\n ) {\n return\n }\n\n event.preventDefault()\n navigate(appPath + url.search + url.hash)\n }\n\n document.addEventListener(\"click\", onClick)\n return () => document.removeEventListener(\"click\", onClick)\n }, [basename, navigate])\n\n return null\n}\n\n// The page frames only the API and the sites SIXB_APP_FRAME_ORIGINS lists. The browser logs a\n// refused <iframe> without saying where that list lives: name it, once per site. A site counts\n// only when an <iframe> asked for it: an artifact frame that navigates elsewhere keeps the API's\n// address as its src, and the list is no place for wherever its code tried to go.\nfunction RefusedFrameReporter() {\n // Subscribed before the browser can report a frame rendered in the same commit.\n React.useLayoutEffect(() => {\n const reported = new Set<string>()\n\n function onViolation(event: SecurityPolicyViolationEvent) {\n if (event.effectiveDirective !== \"frame-src\") return\n\n const origin = originOf(event.blockedURI)\n if (!origin || reported.has(origin)) return\n\n const frames = Array.from(document.querySelectorAll(\"iframe\"))\n if (!frames.some((frame) => originOf(frame.src) === origin)) return\n\n reported.add(origin)\n console.warn(\n \"[SixbApp] The app refused to frame \" +\n origin +\n \". Add each site a frame loads, redirects included, to SIXB_APP_FRAME_ORIGINS on the \" +\n \"app server.\"\n )\n }\n\n document.addEventListener(\"securitypolicyviolation\", onViolation)\n return () => document.removeEventListener(\"securitypolicyviolation\", onViolation)\n }, [])\n\n return null\n}\n\nfunction originOf(url: string): string | null {\n try {\n const { origin } = new URL(url)\n return origin === \"null\" ? null : origin\n } catch {\n return null\n }\n}\n\nfunction pathInsideApp(pathname: string, basename: string | undefined): string {\n if (\n basename &&\n (pathname === basename || pathname.startsWith(basename.endsWith(\"/\") ? basename : basename + \"/\"))\n ) {\n return pathname.slice(basename.length) || \"/\"\n }\n return pathname\n}\n\n// Programmatic React Router navigation cannot be blocked by BrowserRouter. Gate the ordinary page\n// tree while forcing the new document so no route can run under the previous OIDC authority.\nfunction SharedDocumentBoundary({ children }: { readonly children: React.ReactNode }) {\n const location = useLocation()\n const crossingBoundary = isSharedTransportPath(location.pathname)\n\n React.useLayoutEffect(() => {\n if (crossingBoundary) window.location.reload()\n }, [crossingBoundary])\n\n return crossingBoundary ? null : children\n}\n\n// Shared presentational fallback used by the not-found view and the error\n// boundary. Styled with @sixb/ui design tokens (var(--token)) so it adopts the\n// app's theme when those tokens are loaded, but every token has a hardcoded\n// fallback so it stays self-contained and readable when they are not. The\n// background/foreground pair is always set together so text stays legible\n// regardless of the surrounding app's background.\nfunction AppFallback({\n title,\n detail,\n showReload = true,\n action,\n}: {\n title: string\n detail: string\n showReload?: boolean\n action?: React.ReactNode\n}) {\n const messages = useAppMessages()\n return (\n <div\n role=\"alert\"\n style={{\n minHeight: \"100dvh\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"1rem\",\n padding:\n \"calc(2rem + env(safe-area-inset-top, 0px)) 2rem calc(2rem + env(safe-area-inset-bottom, 0px))\",\n textAlign: \"center\",\n fontFamily:\n \"var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)\",\n background: \"var(--background, #ffffff)\",\n color: \"var(--foreground, #1f2933)\",\n }}\n >\n <h1 style={{ margin: 0, fontSize: \"1.5rem\", fontWeight: 600 }}>{title}</h1>\n <p style={{ margin: 0, maxWidth: \"32rem\", color: \"var(--muted-foreground, #52606d)\" }}>\n {detail}\n </p>\n <div style={{ display: \"flex\", gap: \"0.75rem\" }}>\n {action ?? (\n <>\n <a\n href=\"/\"\n style={{\n padding: \"0.5rem 1rem\",\n borderRadius: \"var(--radius, 0.5rem)\",\n background: \"var(--primary, #1f2933)\",\n color: \"var(--primary-foreground, #ffffff)\",\n textDecoration: \"none\",\n }}\n >\n {messages.goHome}\n </a>\n {showReload ? (\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n style={{\n padding: \"0.5rem 1rem\",\n borderRadius: \"var(--radius, 0.5rem)\",\n border: \"1px solid var(--border, #cbd2d9)\",\n background: \"transparent\",\n color: \"inherit\",\n cursor: \"pointer\",\n }}\n >\n {messages.reload}\n </button>\n ) : null}\n </>\n )}\n </div>\n </div>\n )\n}\n\n// The not-found view. Rendered both for unmatched client routes (the catch-all\n// route below) and for an expected 404 surfaced through a query. Apps will be\n// able to override this via app/not-found.tsx.\nfunction NotFoundView() {\n const messages = useAppMessages().notFound\n return (\n <AppFallback\n title={messages.title}\n detail={messages.detail}\n showReload={false}\n />\n )\n}\n\n// Last-resort safety net so an uncaught render throw (a 404 surfaced through a\n// suspense/throwOnError query, a bug, a failed import) shows a fallback instead\n// of a blank page and a console error. A missing object is an expected state,\n// so a 404 reuses the not-found view rather than the generic crash screen.\n// Apps will be able to override this via app/error.tsx.\nfunction AppErrorFallback({\n error,\n hideErrorDetails,\n}: {\n error: unknown\n hideErrorDetails: boolean\n}) {\n const messages = useAppMessages().error\n if (isSixbApiError(error) && error.status === 404) {\n return <NotFoundView />\n }\n return (\n <AppFallback\n title={messages.title}\n detail={\n hideErrorDetails\n ? messages.sharedDetail\n : error instanceof Error\n ? error.message\n : String(error)\n }\n />\n )\n}\n\nclass AppErrorBoundary extends React.Component<\n { resetKey: string; hideErrorDetails: boolean; children: React.ReactNode },\n { error: unknown }\n> {\n state: { error: unknown } = { error: null }\n\n static getDerivedStateFromError(error: unknown) {\n return { error }\n }\n\n componentDidCatch(error: unknown) {\n if (this.props.hideErrorDetails) {\n console.error(\"[SixbApp] A shared page failed to render.\")\n } else {\n console.error(\"[SixbApp] Uncaught render error:\", error)\n }\n }\n\n // Clear the error when the route changes so navigating away (or an in-app\n // link) recovers without a full reload.\n componentDidUpdate(prevProps: { resetKey: string }) {\n if (this.state.error !== null && prevProps.resetKey !== this.props.resetKey) {\n this.setState({ error: null })\n }\n }\n\n render() {\n if (this.state.error !== null) {\n return (\n <AppErrorFallback\n error={this.state.error}\n hideErrorDetails={this.props.hideErrorDetails}\n />\n )\n }\n return this.props.children\n }\n}\n\nfunction RoutedErrorBoundary({\n children,\n hideErrorDetails,\n}: {\n children: React.ReactNode\n hideErrorDetails: boolean\n}) {\n const location = useLocation()\n return (\n <AppErrorBoundary\n resetKey={location.pathname + location.search}\n hideErrorDetails={hideErrorDetails}\n >\n {children}\n </AppErrorBoundary>\n )\n}\n\nconst appRoutes = [...routes, { path: \"*\", element: <NotFoundView /> }]\n${toolViewsSetup}\n\nconst routePatterns = routePaths.map((path) => ({ path }))\nconst recordedRoutePaths = new Set(activityRoutePaths)\n\n// Reports the pattern of the page shown, never its URL. A page that is not recorded, such as a\n// built-in section or an unknown path, reports null, which pauses activity until the next one.\n// Only a new path is a new view: a changed search or hash, or the same path again, is not.\nfunction ActivityPageView() {\n const { pathname } = useLocation()\n\n React.useEffect(() => {\n const path = matchRoutes(routePatterns, pathname)?.at(-1)?.route.path\n recordSixbPageView(path !== undefined && recordedRoutePaths.has(path) ? path : null)\n }, [pathname])\n\n return null\n}\n\nfunction AppRoutes() {\n return useRoutes(appRoutes)\n}\n\nfunction RoutedApp({ hideErrorDetails }: { readonly hideErrorDetails: boolean }) {\n return (\n <RoutedErrorBoundary hideErrorDetails={hideErrorDetails}>\n ${layoutWrapperStart}\n <AppRoutes />\n ${layoutWrapperEnd}\n </RoutedErrorBoundary>\n )\n}\n\n// Project settings do not change while the app runs: never refetch or collect them. Built on use:\n// the query key captures the API base URL, which the bootstrap configures after this module loads.\nfunction projectInfoQuery() {\n return {\n ...getProjectInfoOptions(),\n staleTime: Number.POSITIVE_INFINITY,\n gcTime: Number.POSITIVE_INFINITY,\n retry: false,\n }\n}\n\n// Framework text follows the reader's browser languages and falls back to the project's. A shared\n// link's grant cannot read project settings, so it keeps the browser's languages alone.\nfunction ProjectLocale({\n shared,\n children,\n}: {\n readonly shared: boolean\n readonly children: React.ReactNode\n}) {\n const { data: project } = useQuery({ ...projectInfoQuery(), enabled: !shared })\n return <LocaleProvider fallbackLocale={project?.locale}>{children}</LocaleProvider>\n}\n\nfunction App({ basename }: StartAppOptions) {\n return (\n <QueryClientProvider client={queryClient}>\n {/* One event socket for every live page, opened only once something subscribes. */}\n <SixbEventsProvider>\n <ProjectLocale shared={Boolean(basename)}>\n ${sectionsStart}\n <BrowserRouter basename={basename}>\n <PhoneFoundations />\n <ActivityPageView />\n <RefusedFrameReporter />\n <SharedDocumentLinkInterceptor basename={basename} />\n <InternalLinkInterceptor basename={basename} />\n {basename ? (\n <RoutedApp hideErrorDetails />\n ) : (\n <SharedDocumentBoundary>\n <RoutedApp hideErrorDetails={false} />\n </SharedDocumentBoundary>\n )}\n </BrowserRouter>\n ${sectionsEnd}\n </ProjectLocale>\n </SixbEventsProvider>\n </QueryClientProvider>\n )\n}\n\nexport function startApp(options: StartAppOptions = {}) {\n if (options.session) queryClient.setQueryData(getAuthSessionQueryKey(), options.session)\n if (options.sharedSession) keepSharedSession(queryClient, options.sharedSession)\n // The installed app reopens where it was left, and shows what changed while it was away.\n if (!options.basename) restoreLastScreen()\n refreshOnReturn(queryClient)\n // The HTML is built without loading the project: declare the project's language on the document\n // as soon as the API answers, without waiting for the page tree to render.\n if (!options.basename) {\n void queryClient.fetchQuery(projectInfoQuery()).then(\n (project) => {\n document.documentElement.lang = project.locale\n },\n () => undefined\n )\n }\n getRoot().render(<App basename={options.basename} />)\n}\n\n// Without a session the project's locale is unknown: this speaks the browser's language.\nexport function renderApiUnavailable(apiBaseUrl: string) {\n getRoot().render(\n <LocaleProvider>\n <ApiUnavailableView apiBaseUrl={apiBaseUrl} />\n </LocaleProvider>\n )\n}\n\nfunction ApiUnavailableView({ apiBaseUrl }: { readonly apiBaseUrl: string }) {\n const messages = useAppMessages()\n // Opened offline, from the device: say so, and open by itself once the connection is back. A\n // phone can report itself online with no way out, so the app's own server out of reach as well\n // as the API means offline too; the API alone is the API.\n const [offline, setOffline] = React.useState<boolean | null>(() => (navigator.onLine ? null : true))\n React.useEffect(() => {\n if (offline === null) {\n // A request that hangs for want of a route out is offline too.\n fetch(\"/\", { method: \"HEAD\", cache: \"no-store\", signal: AbortSignal.timeout(3000) }).then(\n () => setOffline(false),\n () => setOffline(true)\n )\n }\n const retry = () => window.location.reload()\n window.addEventListener(\"online\", retry)\n return () => window.removeEventListener(\"online\", retry)\n }, [offline])\n if (offline === null) return null\n return (\n <AppFallback\n title={offline ? messages.offline.title : messages.apiUnavailable.title}\n detail={offline ? messages.offline.detail : messages.apiUnavailable.detail(apiBaseUrl)}\n action={\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n style={{\n padding: \"0.5rem 1rem\",\n borderRadius: \"var(--radius, 0.5rem)\",\n border: \"1px solid var(--border, #cbd2d9)\",\n background: \"transparent\",\n color: \"inherit\",\n cursor: \"pointer\",\n }}\n >\n {messages.retry}\n </button>\n }\n />\n )\n}\n`\n\n const runtimePath = join(generatedDir, \"app-runtime.tsx\")\n await writeFileIfChanged(runtimePath, runtimeContent)\n\n // A project can draw the screen a dead shared link shows. Only the shared bootstrap imports this\n // module, and only once the link has failed to open a session.\n const sharedUnavailablePath = join(appDir, \"shared-unavailable.tsx\")\n const hasSharedUnavailable = await fileExists(sharedUnavailablePath)\n const sharedUnavailableModulePath = join(generatedDir, \"shared-unavailable.tsx\")\n if (hasSharedUnavailable) {\n await writeFileIfChanged(\n sharedUnavailableModulePath,\n renderSharedUnavailableModule(\n relativeTo(generatedDir, sharedUnavailablePath),\n globalsCssImport\n )\n )\n } else {\n await rm(sharedUnavailableModulePath, { force: true })\n }\n\n // The normal entry owns only ambient application authentication. Its imported runtime is the\n // exact same module the shared bootstrap loads after establishing delegated authority.\n const mainContent = `import {\n configureSixbBrowserClient,\n readSixbBrowserRuntimeConfig,\n requireSixbBrowserAuthSession,\n startSixbActivityCapture,\n} from \"@sixb/client/browser\"\nimport { renderApiUnavailable, startApp } from \"./app-runtime\"\n\nconst runtimeConfig = readSixbBrowserRuntimeConfig()\nconst browserClient = configureSixbBrowserClient(runtimeConfig)\n\nif (import.meta.hot) {\n import.meta.hot.accept()\n import.meta.hot.dispose(() => browserClient.dispose())\n}\n\n// A production build keeps the app on the device, so the installed app opens without the network.\n// A browser gives the root one worker: a project that registers its own there keeps it. The\n// development server has no worker, and removes Sixb's if an earlier build left it on its address.\nif (\"serviceWorker\" in navigator) {\n const isSixbWorker = (registration: ServiceWorkerRegistration) =>\n [registration.installing, registration.waiting, registration.active].some((worker) =>\n worker?.scriptURL.endsWith(${JSON.stringify(SERVICE_WORKER_PATH)})\n )\n if (import.meta.hot) {\n void navigator.serviceWorker.getRegistrations().then((registrations) => {\n for (const registration of registrations) {\n if (isSixbWorker(registration)) void registration.unregister()\n }\n })\n } else {\n // Once the page has loaded, so installing never competes with opening the app.\n const register = () => {\n navigator.serviceWorker\n .getRegistration(\"/\")\n .then((existing) =>\n existing && !isSixbWorker(existing)\n ? undefined\n : navigator.serviceWorker.register(${JSON.stringify(SERVICE_WORKER_PATH)})\n )\n .catch((error: unknown) => {\n console.warn(\"[SixbCustomApp] Could not register the service worker:\", error)\n })\n }\n if (document.readyState === \"complete\") register()\n else window.addEventListener(\"load\", register, { once: true })\n }\n}\n\n// Without the API's answer the app can neither render nor send the user to sign in.\nconst authSession = runtimeConfig.auth.enabled\n ? await requireSixbBrowserAuthSession(runtimeConfig, browserClient).catch((error: unknown) => {\n console.error(\"[SixbCustomApp] Could not load the session from the API:\", error)\n return \"unavailable\" as const\n })\n : null\n\nif (authSession === \"unavailable\") {\n renderApiUnavailable(runtimeConfig.api.baseUrl)\n} else if (\n !runtimeConfig.auth.enabled ||\n (authSession?.authenticated === false && authSession.authEnabled === false) ||\n authSession?.authenticated === true\n) {\n // Only a signed-in person's visits are recorded; without auth there is nobody to attribute.\n if (authSession?.authenticated === true) startSixbActivityCapture()\n startApp({ session: authSession ?? undefined })\n}\n`\n\n const mainPath = join(generatedDir, \"main.tsx\")\n await writeFileIfChanged(mainPath, mainContent)\n\n // This module contains framework bootstrap only. It must never statically import routes, the\n // authored layout, or any page: that graph is imported after the session is accepted.\n const sharedMainContent = `import { browserAppLocale, browserAppMessages } from \"@sixb/app/locale\"\nimport {\n configureSixbSharedBrowserClient,\n isSixbApiError,\n preserveSixbActivityArrival,\n readSixbBrowserRuntimeConfig,\n type SixbSharedBrowserClientController,\n startSixbActivityCapture,\n} from \"@sixb/client/browser\"\n\nexport interface SharedAppBootstrap {\n readonly basename: string\n readonly grantId: string\n readonly requestedPath: string\n readonly secret: string | null\n}\n\nexport interface SharedAppStartOptions {\n readonly loadAppStyles?: () => Promise<void>\n}\n\nlet activeController: SixbSharedBrowserClientController | null = null\n\ninterface UnavailableScreenModule {\n renderSharedUnavailable(\n container: HTMLElement,\n props: { readonly locale: string; readonly title: string; readonly description: string },\n onError: () => void\n ): void\n}\n\n// The project's own screen for a link that opens nothing, from app/shared-unavailable.tsx.\nconst loadUnavailableScreen: (() => Promise<UnavailableScreenModule>) | null = ${\n hasSharedUnavailable ? '() => import(\"./shared-unavailable\")' : \"null\"\n }\n\nif (import.meta.hot) {\n import.meta.hot.accept()\n import.meta.hot.dispose(() => {\n activeController?.dispose()\n activeController = null\n })\n}\n\nexport function startSharedApp(\n bootstrap: SharedAppBootstrap,\n options: SharedAppStartOptions = {}\n): void {\n // A shared link speaks the reader's language: the grant cannot read the project's.\n document.documentElement.lang = browserAppLocale()\n let loadAppStyles = options.loadAppStyles\n if (!isValidBootstrap(bootstrap)) {\n renderUnavailable(loadAppStyles)\n return\n }\n const { basename, grantId } = bootstrap\n\n activeController?.dispose()\n let controller: SixbSharedBrowserClientController\n try {\n const runtimeConfig = readSixbBrowserRuntimeConfig({ authEnabled: false })\n controller = configureSixbSharedBrowserClient(runtimeConfig, {\n grantId,\n // A link revoked or a session expired while the page is open: loading it again finds no\n // session, and shows the unavailable screen.\n onEnded: () => {\n if (established) window.location.reload()\n },\n })\n activeController = controller\n } catch {\n renderUnavailable(loadAppStyles)\n return\n }\n\n let secret = bootstrap.secret\n let canonicalDestinationPath: string | null = null\n let appStylesLoaded = false\n let established = false\n let pending = false\n\n const open = async () => {\n if (pending) return\n pending = true\n renderSharedFallback(\"loading\")\n\n try {\n const exchangedSecret = secret !== null\n const session = await controller.establish(secret)\n established = true\n // Once a server session exists the one-time link credential must not survive a retry.\n secret = null\n if (exchangedSecret) canonicalDestinationPath = session.destinationPath\n // Keep the trusted destination pending until this document is canonical or a hard\n // navigation to it has started. Application code never imports under the caller's path.\n if (canonicalDestinationPath !== null) {\n try {\n if (!canonicalizeInitialDestination(basename, canonicalDestinationPath)) return\n } catch (error) {\n // Both same-document canonicalization and the hard-navigation fallback failed. Retire\n // the newly established session before showing a terminal error so a reload cannot\n // restore it under the caller-controlled path.\n await controller.signOut().catch(() => undefined)\n controller.dispose()\n if (activeController === controller) activeController = null\n throw error\n }\n canonicalDestinationPath = null\n }\n if (!appStylesLoaded) {\n await loadAppStyles?.()\n loadAppStyles = undefined\n appStylesLoaded = true\n }\n\n const { startApp } = await import(\"./app-runtime\")\n startApp({ basename, sharedSession: session })\n // After a start that held: a failed one is retried, and must still find the arrival.\n startSixbActivityCapture()\n } catch (error) {\n if (isRetryableSharedFailure(error)) {\n console.error(\"[SixbSharedApp] Shared access could not be opened; retry is available.\")\n renderSharedFallback(\"retryable\", () => void open())\n } else if (established) {\n // The link opened a session that is still live: project code does not run beside it.\n renderSharedFallback(\"unavailable\")\n } else {\n controller.dispose()\n if (activeController === controller) activeController = null\n renderUnavailable(loadAppStyles)\n }\n } finally {\n pending = false\n }\n }\n\n void open()\n}\n\n/**\n * Show that the link opens nothing: the project's screen when it has one, Sixb's otherwise, and\n * Sixb's again if the project's cannot load or render.\n */\nfunction renderUnavailable(loadAppStyles?: () => Promise<void>): void {\n const load = loadUnavailableScreen\n if (!load) {\n renderSharedFallback(\"unavailable\")\n return\n }\n\n const messages = browserAppMessages().shared\n const fallBack = () => renderSharedFallback(\"unavailable\")\n void (async () => {\n await loadAppStyles?.()\n const { renderSharedUnavailable } = await load()\n const root = document.getElementById(\"root\")\n if (!root) return\n root.replaceChildren()\n renderSharedUnavailable(\n root,\n {\n locale: browserAppLocale(),\n title: messages.unavailableTitle,\n description: messages.unavailableDetail,\n },\n fallBack\n )\n })().catch(() => {\n console.error(\"[SixbSharedApp] The project's unavailable screen could not be shown.\")\n fallBack()\n })\n}\n\nfunction isValidBootstrap(value: SharedAppBootstrap): boolean {\n return (\n typeof value.grantId === \"string\" &&\n value.basename === \"/shared/\" + encodeURIComponent(value.grantId) &&\n value.requestedPath.startsWith(\"/\") &&\n (value.secret === null || typeof value.secret === \"string\")\n )\n}\n\nfunction canonicalizeInitialDestination(basename: string, destinationPath: string): boolean {\n const canonicalPath = basename + destinationPath\n if (\n window.location.pathname !== canonicalPath ||\n window.location.search !== \"\" ||\n window.location.hash !== \"\"\n ) {\n try {\n window.history.replaceState(window.history.state, \"\", canonicalPath)\n } catch {\n // Preserve the authority boundary even when a browser or embedding policy denies History\n // mutation: a fresh document at the trusted server destination is still safe.\n preserveSixbActivityArrival()\n window.location.replace(canonicalPath)\n return false\n }\n }\n return true\n}\n\nfunction isRetryableSharedFailure(error: unknown): boolean {\n if (error instanceof TypeError) return true\n return (\n isSixbApiError(error) &&\n (error.status === 408 || error.status === 429 || error.status >= 500)\n )\n}\n\nfunction renderSharedFallback(\n state: \"loading\" | \"retryable\" | \"unavailable\",\n retry?: () => void\n): void {\n const root = document.getElementById(\"root\")\n if (!root) return\n\n const main = document.createElement(\"main\")\n main.setAttribute(\"role\", state === \"loading\" ? \"status\" : \"alert\")\n main.style.cssText =\n \"min-height:100dvh;display:flex;flex-direction:column;align-items:center;\" +\n \"justify-content:center;gap:.75rem;padding:2rem;text-align:center;\" +\n \"font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif\"\n\n const messages = browserAppMessages().shared\n const title = document.createElement(\"h1\")\n title.style.cssText = \"margin:0;font-size:1.5rem\"\n title.textContent =\n state === \"loading\"\n ? messages.opening\n : state === \"retryable\"\n ? messages.retryableTitle\n : messages.unavailableTitle\n const detail = document.createElement(\"p\")\n detail.style.cssText = \"margin:0;max-width:32rem\"\n detail.textContent =\n state === \"loading\"\n ? messages.verifying\n : state === \"retryable\"\n ? messages.retryableDetail\n : messages.unavailableDetail\n main.append(title, detail)\n\n if (retry) {\n const button = document.createElement(\"button\")\n button.type = \"button\"\n button.textContent = messages.tryAgain\n button.style.cssText =\n \"margin-top:.25rem;padding:.625rem 1rem;border:1px solid currentColor;\" +\n \"border-radius:.375rem;background:transparent;color:inherit;cursor:pointer;font:inherit\"\n button.addEventListener(\"click\", retry, { once: true })\n main.append(button)\n }\n\n root.replaceChildren(main)\n}\n`\n\n const sharedMainPath = join(generatedDir, \"shared-main.tsx\")\n await writeFileIfChanged(sharedMainPath, sharedMainContent)\n\n // Generate index.html with static identity and only structural reset rules.\n // Apps own visual styling through app/globals.css.\n const metadataHead = renderMetadataHead(metadata)\n const htmlContent = `<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, viewport-fit=cover\" />\n${metadataHead}\n ${runtimeConfigScript}\n <style>\n * {\n box-sizing: border-box;\n }\n html,\n body,\n #root {\n margin: 0;\n min-height: 100%;\n }\n body,\n #root {\n min-height: 100vh;\n min-height: 100dvh;\n }\n @media (display-mode: standalone) {\n html,\n body {\n overscroll-behavior: none;\n }\n }\n </style>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"./main.tsx\"></script>\n </body>\n</html>\n`\n\n const htmlPath = join(generatedDir, \"index.html\")\n await writeFileIfChanged(htmlPath, htmlContent)\n\n const sharedRuntimeConfigScript = options.apiBaseUrl\n ? renderCustomAppRuntimeScript({\n api: { baseUrl: options.apiBaseUrl },\n auth: { enabled: false },\n })\n : \"\"\n const sharedHtmlContent = `<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, viewport-fit=cover\" />\n <meta name=\"robots\" content=\"noindex, nofollow, noarchive\" />\n <meta name=\"referrer\" content=\"no-referrer\" />\n${renderSharedMetadataHead(metadata)}\n ${sharedRuntimeConfigScript}\n <style>\n * { box-sizing: border-box; }\n html, body, #root { margin: 0; min-height: 100%; }\n body, #root { min-height: 100vh; min-height: 100dvh; }\n </style>\n </head>\n <body>\n <div id=\"root\"></div>\n <script>\n function renderUnavailable() {\n const root = document.getElementById(\"root\")\n if (!root) return\n const main = document.createElement(\"main\")\n main.setAttribute(\"role\", \"alert\")\n main.style.cssText =\n \"min-height:100dvh;display:grid;place-items:center;padding:2rem;text-align:center;\" +\n \"font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif\"\n const message = document.createElement(\"p\")\n // Inline and dependency-free: the translations travel with the page.\n const translations = ${JSON.stringify(sharedUnavailableTranslations())}\n const language = (navigator.languages || [navigator.language])\n .map((tag) => String(tag).split(\"-\")[0].toLowerCase())\n .find((tag) => tag in translations)\n document.documentElement.lang = language || \"en\"\n message.textContent = translations[language || \"en\"]\n main.append(message)\n root.replaceChildren(main)\n }\n\n function consumeBootstrap() {\n const rawFragment = window.location.hash.startsWith(\"#\")\n ? window.location.hash.slice(1)\n : window.location.hash\n // Only the canonical 32-byte bearer belongs to the transport. Ordinary page anchors must\n // remain intact when an established shared session is reloaded.\n const secret = /^[A-Za-z0-9_-]{43}$/.test(rawFragment) ? rawFragment : null\n if (secret !== null) {\n try {\n window.history.replaceState(\n window.history.state,\n \"\",\n window.location.pathname + window.location.search\n )\n } catch {\n return null\n }\n }\n\n const match = /^\\\\/shared\\\\/([^/]+)(\\\\/.*)?$/.exec(window.location.pathname)\n if (!match) return null\n let grantId\n try {\n grantId = decodeURIComponent(match[1])\n } catch {\n return null\n }\n if (encodeURIComponent(grantId) !== match[1]) return null\n return {\n basename: \"/shared/\" + match[1],\n grantId,\n requestedPath: match[2] ?? \"/\",\n secret,\n }\n }\n\n async function bootstrapSharedApp() {\n const bootstrap = consumeBootstrap()\n if (!bootstrap) {\n renderUnavailable()\n return\n }\n\n try {\n const { startSharedApp } = await import(\"./shared-main.tsx\")\n startSharedApp(bootstrap)\n } catch {\n console.error(\"[SixbSharedApp] Shared application bootstrap failed.\")\n renderUnavailable()\n }\n }\n\n void bootstrapSharedApp()\n </script>\n </body>\n</html>\n`\n const sharedHtmlPath = join(generatedDir, \"shared-index.html\")\n await writeFileIfChanged(sharedHtmlPath, sharedHtmlContent)\n\n return {\n htmlPath,\n mainPath,\n manifestPath,\n runtimePath,\n sharedHtmlPath,\n sharedMainPath,\n }\n}\n\n/** The module that renders `app/shared-unavailable.tsx` into a session-less React root. */\nfunction renderSharedUnavailableModule(componentPath: string, stylesheetImports: string): string {\n return `import React from \"react\"\nimport { createRoot, type Root } from \"react-dom/client\"\nimport type { SharedUnavailableProps } from \"@sixb/app\"\nimport SharedUnavailable from ${JSON.stringify(componentPath)}\n${stylesheetImports}\n\ninterface BoundaryProps {\n readonly onError: () => void\n readonly children: React.ReactNode\n}\n\n// A screen that throws gives way to Sixb's own, so a dead link always says what it is.\nclass Boundary extends React.Component<BoundaryProps, { readonly failed: boolean }> {\n state = { failed: false }\n\n static getDerivedStateFromError() {\n return { failed: true }\n }\n\n componentDidCatch() {\n this.props.onError()\n }\n\n render() {\n return this.state.failed ? null : this.props.children\n }\n}\n\n// No provider wraps the screen: it has no session, router, or data client to read the project with.\nexport function renderSharedUnavailable(\n container: HTMLElement,\n props: SharedUnavailableProps,\n onError: () => void\n): void {\n let root: Root | null = null\n const fail = () => {\n setTimeout(() => {\n root?.unmount()\n root = null\n onError()\n })\n }\n root = createRoot(container)\n root.render(\n <Boundary onError={fail}>\n <SharedUnavailable {...props} />\n </Boundary>\n )\n}\n`\n}\n\nfunction renderSharedMetadataHead(\n metadata: Awaited<ReturnType<typeof resolveAppMetadata>>\n): string {\n return [\n ` <title>${escapeHtmlText(metadata.title)}</title>`,\n ...(metadata.description\n ? [` <meta name=\"description\" content=\"${escapeHtmlAttribute(metadata.description)}\" />`]\n : []),\n ` <meta name=\"theme-color\" content=\"${escapeHtmlAttribute(metadata.themeColor)}\" />`,\n ].join(\"\\n\")\n}\n\nfunction renderMetadataHead(metadata: Awaited<ReturnType<typeof resolveAppMetadata>>): string {\n const tags = [\n ` <title>${escapeHtmlText(metadata.title)}</title>`,\n ...(metadata.description\n ? [` <meta name=\"description\" content=\"${escapeHtmlAttribute(metadata.description)}\" />`]\n : []),\n ` <meta name=\"theme-color\" content=\"${escapeHtmlAttribute(metadata.themeColor)}\" />`,\n // iOS shows a Home Screen app's launch image only with the first; Chrome asks for the second.\n ' <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />',\n ' <meta name=\"mobile-web-app-capable\" content=\"yes\" />',\n // iOS reads this when the app is added to the Home Screen.\n ...(metadata.statusBar === \"under\"\n ? [' <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />']\n : []),\n ' <link rel=\"manifest\" href=\"/app.webmanifest\" />',\n ...(metadata.favicon\n ? [` <link rel=\"icon\" href=\"${escapeHtmlAttribute(metadata.favicon)}\" />`]\n : []),\n ...(metadata.appleTouchIcon\n ? [` <link rel=\"apple-touch-icon\" href=\"${metadata.appleTouchIcon}\" />`]\n : []),\n ]\n return tags.join(\"\\n\")\n}\n\nfunction renderAuthMetadataHead(metadata: Awaited<ReturnType<typeof resolveAppMetadata>>): string {\n const tags = [\n ` <title>${escapeHtmlText(metadata.title)}</title>`,\n ...(metadata.description\n ? [` <meta name=\"description\" content=\"${escapeHtmlAttribute(metadata.description)}\" />`]\n : []),\n ` <meta name=\"theme-color\" content=\"${escapeHtmlAttribute(metadata.themeColor)}\" />`,\n ...(metadata.favicon && /^(?:https?:|data:)/.test(metadata.favicon)\n ? [` <link rel=\"icon\" href=\"${escapeHtmlAttribute(metadata.favicon)}\" />`]\n : []),\n ]\n return tags.join(\"\\n\")\n}\n\nfunction escapeHtmlText(value: string): string {\n return value.replaceAll(\"&\", \"&amp;\").replaceAll(\"<\", \"&lt;\").replaceAll(\">\", \"&gt;\")\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n return escapeHtmlText(value).replaceAll('\"', \"&quot;\").replaceAll(\"'\", \"&#39;\")\n}\n\nasync function writeFileIfChanged(path: string, content: string): Promise<void> {\n try {\n if ((await readFile(path, \"utf-8\")) === content) {\n return\n }\n } catch (error) {\n if (!isFileNotFoundError(error)) {\n throw error\n }\n }\n\n await writeFile(path, content, \"utf-8\")\n}\n\nfunction isFileNotFoundError(error: unknown): boolean {\n return (\n error instanceof Error &&\n \"code\" in error &&\n (error as Error & { readonly code?: unknown }).code === \"ENOENT\"\n )\n}\n\nfunction relativeTo(from: string, to: string): string {\n let rel = relative(from, to)\n // Ensure it starts with ./ or ../\n if (!rel.startsWith(\".\")) rel = `./${rel}`\n return rel\n}\n\nasync function fileExists(path: string): Promise<boolean> {\n try {\n await access(path)\n return true\n } catch {\n return false\n }\n}\n",
@@ -15,7 +15,7 @@
15
15
  "import { readFile } from \"node:fs/promises\"\nimport { join } from \"node:path\"\nimport { resolveTailwindCliEntry } from \"./tailwind\"\n\nexport type CustomAppStylesheet =\n /** No `app/globals.css` — the app ships no framework-managed stylesheet. */\n | { readonly kind: \"none\" }\n /** Plain handwritten CSS — bundled as-is, exactly as before. */\n | { readonly kind: \"static\"; readonly path: string }\n /** Tailwind source — compiled to `outputPath` before bundling. */\n | { readonly kind: \"tailwind\"; readonly sourcePath: string; readonly outputPath: string }\n\nexport interface ResolveCustomAppStylesheetInput {\n readonly appDir: string\n readonly generatedDir: string\n readonly rootDir: string\n}\n\n/**\n * Decides how `app/globals.css` participates in the build.\n *\n * `globals.css` is treated as Tailwind *source* when it uses Tailwind at-rules\n * (`@source`, `@theme`, ...) or imports a package stylesheet such as\n * `@sixb/ui/globals.css` — those need the Tailwind pipeline before they are\n * shippable. Plain CSS keeps the existing pass-through behavior, so apps that\n * never opted into Tailwind are unaffected.\n */\nexport async function resolveCustomAppStylesheet(\n input: ResolveCustomAppStylesheetInput\n): Promise<CustomAppStylesheet> {\n const sourcePath = join(input.appDir, \"globals.css\")\n\n let css: string\n try {\n css = await readFile(sourcePath, \"utf-8\")\n } catch {\n return { kind: \"none\" }\n }\n\n if (!usesTailwind(css)) {\n return { kind: \"static\", path: sourcePath }\n }\n\n if (!resolveTailwindCliEntry(input.rootDir)) {\n throw new Error(\n \"[SixbCustomApp] app/globals.css uses Tailwind features but '@tailwindcss/cli' is not installed. Install it with: bun add tailwindcss @tailwindcss/cli\"\n )\n }\n\n return {\n kind: \"tailwind\",\n sourcePath,\n outputPath: join(input.generatedDir, \"app.css\"),\n }\n}\n\nconst TAILWIND_AT_RULES =\n /@(?:tailwind|source|theme|plugin|config|utility|custom-variant|variant|apply)\\b/\n\nexport function usesTailwind(css: string): boolean {\n const stripped = css.replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\")\n\n if (TAILWIND_AT_RULES.test(stripped)) {\n return true\n }\n\n // A bare-specifier @import (e.g. `@import \"tailwindcss\"` or\n // `@import \"@sixb/ui/globals.css\"`) pulls in package CSS that the browser\n // bundler would inline without processing its Tailwind directives.\n for (const match of stripped.matchAll(/@import\\s+(?:url\\(\\s*)?[\"']([^\"']+)[\"']/g)) {\n const specifier = match[1]\n if (\n !specifier.startsWith(\".\") &&\n !specifier.startsWith(\"/\") &&\n !specifier.startsWith(\"#\") &&\n !/^(?:https?:|data:)/.test(specifier)\n ) {\n return true\n }\n }\n\n return false\n}\n",
16
16
  "import { mkdir } from \"node:fs/promises\"\nimport { dirname, join } from \"node:path\"\n\nexport interface TailwindCssCompilerOptions {\n /** Tailwind source stylesheet. */\n inputPath: string\n /** Compiled CSS output path. */\n outputPath: string\n /**\n * Working directory for the Tailwind CLI. Tailwind v4's automatic source\n * detection scans from here, so keep it scoped to the directory that owns the\n * styles (e.g. `app/`) — never a repo root that may contain `vendor/` or\n * `node_modules/` siblings.\n */\n cwd?: string\n /**\n * Directory whose dependency tree is used to resolve `@tailwindcss/cli`.\n * Defaults to `cwd`. Pass the project root so the project's own Tailwind\n * version wins.\n */\n resolveFrom?: string\n /** Prefix for error messages, e.g. `[SixbCustomApp]`. */\n label?: string\n /** Minify the compiled CSS. Off by default; bundlers usually minify later. */\n minify?: boolean\n /** Debounce for `schedule()` rebuilds, in milliseconds. */\n debounceMs?: number\n /**\n * Upper bound on one Tailwind build, in milliseconds. Defaults to 60s.\n *\n * A bound on a hang, not a performance budget: a wedged CLI otherwise held `sixb dev` open\n * forever, and `stop()` waited on it.\n */\n timeoutMs?: number\n /** Called when a `schedule()`d rebuild fails. Defaults to `console.error`. */\n onError?: (error: Error) => void\n}\n\nexport interface TailwindCssCompiler {\n /**\n * Compiles the stylesheet. Builds are serialized: a call made while another\n * build is running starts a fresh build after it, so the output always\n * reflects the sources as of the call. Throws with a labeled, actionable\n * error when the CLI is missing or compilation fails.\n */\n compile(): Promise<void>\n /**\n * Debounced `compile()` for watch flows. Coalesces bursts of file events;\n * errors go to `onError` instead of throwing.\n */\n schedule(): void\n /** Cancels pending rebuilds and waits for any in-flight build to settle. */\n stop(): Promise<void>\n}\n\n/**\n * Resolves the Tailwind v4 CLI entry point from a directory's dependency tree.\n * Returns null when `@tailwindcss/cli` is not installed there.\n */\nexport function resolveTailwindCliEntry(resolveFrom: string): string | null {\n try {\n const packageJsonPath = Bun.resolveSync(\"@tailwindcss/cli/package.json\", resolveFrom)\n return join(dirname(packageJsonPath), \"dist\", \"index.mjs\")\n } catch {\n return null\n }\n}\n\n/**\n * The Tailwind v4 CSS build pipeline for the app and its built-in pages. Owns CLI resolution,\n * source-detection scoping, debounced/queued rebuilds, error formatting, and watch lifecycle\n * cleanup.\n */\nexport function createTailwindCssCompiler(\n options: TailwindCssCompilerOptions\n): TailwindCssCompiler {\n const cwd = options.cwd ?? dirname(options.inputPath)\n const resolveFrom = options.resolveFrom ?? cwd\n const label = options.label ?? \"[SixbTailwind]\"\n const debounceMs = options.debounceMs ?? 50\n const timeoutMs = options.timeoutMs ?? 60_000\n const onError = options.onError ?? ((error: Error) => console.error(`${label} ${error.message}`))\n\n let chain: Promise<void> = Promise.resolve()\n let timer: ReturnType<typeof setTimeout> | null = null\n let stopped = false\n let activeProcess: { kill: (signal?: number | NodeJS.Signals) => void } | null = null\n\n async function runCompile(): Promise<void> {\n // `compile()` queues this behind the current chain, so a `stop()` can land before the\n // child is ever spawned. Without this the build started anyway and there was nothing\n // for `stop()` to kill, so shutdown waited out the full timeout.\n if (stopped) return\n\n const cliEntry = resolveTailwindCliEntry(resolveFrom)\n if (!cliEntry) {\n throw new Error(\n `${label} Tailwind CSS build requires '@tailwindcss/cli'. Install it with: bun add tailwindcss @tailwindcss/cli`\n )\n }\n\n await mkdir(dirname(options.outputPath), { recursive: true })\n // The only await before the spawn, so the only other window a `stop()` can land in.\n if (stopped) return\n\n const args = [process.execPath, cliEntry, \"-i\", options.inputPath, \"-o\", options.outputPath]\n if (options.minify) {\n args.push(\"--minify\")\n }\n\n const proc = Bun.spawn(args, {\n cwd,\n stdout: \"ignore\",\n stderr: \"pipe\",\n })\n activeProcess = proc\n\n // Start draining stderr while the child runs rather than after it exits. Bun buffers\n // this pipe today, so reading afterwards does not block the child — measured, not\n // assumed — but that is Bun's choice and not something this code should depend on. The\n // catch keeps a stream torn down by `kill()` from surfacing as an unhandled rejection.\n const stderr = new Response(proc.stderr).text().catch(() => \"\")\n\n let timeout: ReturnType<typeof setTimeout> | undefined\n const timedOut = new Promise<\"timeout\">((resolve) => {\n timeout = setTimeout(() => resolve(\"timeout\"), timeoutMs)\n })\n\n try {\n const outcome = await Promise.race([proc.exited, timedOut])\n\n // `stop()` kills the child on purpose. Reporting that as a build failure would put\n // an error in the log for every shutdown that happened to catch a rebuild.\n if (stopped) return\n\n if (outcome === \"timeout\") {\n proc.kill(\"SIGKILL\")\n await proc.exited\n throw new Error(\n `${label} Tailwind CSS build did not finish within ${timeoutMs}ms and was killed. ` +\n `Check ${options.inputPath} and the sources Tailwind scans from ${cwd}.`\n )\n }\n\n if (outcome !== 0) {\n throw new Error(`${label} Tailwind CSS build failed: ${(await stderr).trim()}`)\n }\n } finally {\n clearTimeout(timeout)\n activeProcess = null\n }\n }\n\n function compile(): Promise<void> {\n stopped = false\n const build = chain.then(() => runCompile())\n // The chain itself swallows failures so one bad build doesn't poison every\n // later compile; callers still observe their own build's error.\n chain = build.then(\n () => {},\n () => {}\n )\n return build\n }\n\n return {\n compile,\n\n schedule() {\n if (stopped) return\n if (timer) {\n clearTimeout(timer)\n }\n\n timer = setTimeout(() => {\n timer = null\n compile().catch((error) => {\n onError(error instanceof Error ? error : new Error(String(error)))\n })\n }, debounceMs)\n },\n\n async stop() {\n stopped = true\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n // Kill rather than wait. A build in flight would otherwise hold shutdown for up to\n // the whole timeout, and the output it is writing is about to be discarded anyway.\n activeProcess?.kill(\"SIGKILL\")\n await chain\n },\n }\n}\n"
17
17
  ],
18
- "mappings": ";;;;;;;;;;;;;;AAAA;AACA,uBAAS;AACT,mBAAS,sBAAY,oBAAO,iBAAU,kBAAI;AAC1C,oBAAS,8BAAqB,8BAAiB,sBAAU;AACzD,0BAAS;;;ACJT;AACA;AACA;AACA;AACA;AACA;AAAA,oBACE;AAAA,UACA;AAAA,eACA;AAAA;;;ACPK,IAAM,sBAAsB;AAM5B,IAAM,yBAAyB,CAAC,QAAQ,SAAS,OAAO,SAAS,SAAS;AAM1E,IAAM,0BACX;AAGF,IAAM,wBAAwB;AA4BvB,SAAS,mBAAmB,CAAC,SAAuC;AAAA,EACzE,OAAO;AAAA;AAAA,+BAEsB,KAAK,UAAU,QAAQ,OAAO;AAAA;AAAA,gBAE7C,KAAK,UAAU,QAAQ,KAAK;AAAA,mBACzB,KAAK,UAAU,QAAQ,QAAQ;AAAA,mBAC/B,KAAK,UAAU,sBAAsB;AAAA,oBACpC,wBAAwB,SAAS;AAAA,gCACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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