@sixb/app 0.1.11 → 0.1.12

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 (583) hide show
  1. package/LICENSE +2 -0
  2. package/README.md +25 -19
  3. package/assets/connector-icons/README.md +29 -0
  4. package/assets/connector-icons/ace-iot.ico +0 -0
  5. package/assets/connector-icons/companycam.png +0 -0
  6. package/assets/connector-icons/exa.png +0 -0
  7. package/assets/connector-icons/github.svg +1 -0
  8. package/assets/connector-icons/google.ico +0 -0
  9. package/assets/connector-icons/googleads.svg +29 -0
  10. package/assets/connector-icons/linkedin.svg +1 -0
  11. package/assets/connector-icons/mercury.svg +1 -0
  12. package/assets/connector-icons/meta.svg +1 -0
  13. package/assets/connector-icons/microsoft.ico +0 -0
  14. package/assets/connector-icons/notion.svg +1 -0
  15. package/assets/connector-icons/pandadoc.png +0 -0
  16. package/assets/connector-icons/pennylane.ico +0 -0
  17. package/assets/connector-icons/pipedrive.png +0 -0
  18. package/assets/connector-icons/plaud.png +0 -0
  19. package/assets/connector-icons/quickbooks.svg +1 -0
  20. package/assets/connector-icons/stripe.svg +1 -0
  21. package/assets/connector-icons/teamleader.ico +0 -0
  22. package/assets/connector-icons/tiktok.svg +1 -0
  23. package/assets/connector-icons/unipile.png +0 -0
  24. package/dist/agent/activity-label.d.ts +5 -0
  25. package/dist/agent/activity-label.d.ts.map +1 -0
  26. package/dist/agent/agent-chat.d.ts +24 -0
  27. package/dist/agent/agent-chat.d.ts.map +1 -0
  28. package/dist/agent/agent-context-provider.d.ts +9 -0
  29. package/dist/agent/agent-context-provider.d.ts.map +1 -0
  30. package/dist/agent/agent-execution-trace.d.ts +9 -0
  31. package/dist/agent/agent-execution-trace.d.ts.map +1 -0
  32. package/dist/agent/agent-panel.d.ts +27 -0
  33. package/dist/agent/agent-panel.d.ts.map +1 -0
  34. package/dist/agent/agent-surface-state.d.ts +22 -0
  35. package/dist/agent/agent-surface-state.d.ts.map +1 -0
  36. package/dist/agent/agent-surface.d.ts +46 -0
  37. package/dist/agent/agent-surface.d.ts.map +1 -0
  38. package/dist/agent/bash/bash-tool-view.d.ts +17 -0
  39. package/dist/agent/bash/bash-tool-view.d.ts.map +1 -0
  40. package/dist/agent/bash/data.d.ts +35 -0
  41. package/dist/agent/bash/data.d.ts.map +1 -0
  42. package/dist/agent/bash/interpret.d.ts +84 -0
  43. package/dist/agent/bash/interpret.d.ts.map +1 -0
  44. package/dist/agent/bash/renderers.d.ts +31 -0
  45. package/dist/agent/bash/renderers.d.ts.map +1 -0
  46. package/dist/agent/bash/shell.d.ts +16 -0
  47. package/dist/agent/bash/shell.d.ts.map +1 -0
  48. package/dist/agent/components/activity-status.d.ts +13 -0
  49. package/dist/agent/components/activity-status.d.ts.map +1 -0
  50. package/dist/agent/components/agent-thread-switcher.d.ts +16 -0
  51. package/dist/agent/components/agent-thread-switcher.d.ts.map +1 -0
  52. package/dist/agent/components/composer.d.ts +47 -0
  53. package/dist/agent/components/composer.d.ts.map +1 -0
  54. package/dist/agent/components/context-chips.d.ts +7 -0
  55. package/dist/agent/components/context-chips.d.ts.map +1 -0
  56. package/dist/agent/components/context-picker.d.ts +16 -0
  57. package/dist/agent/components/context-picker.d.ts.map +1 -0
  58. package/dist/agent/components/conversation-panel.d.ts +82 -0
  59. package/dist/agent/components/conversation-panel.d.ts.map +1 -0
  60. package/dist/agent/components/file-attachment-card.d.ts +8 -0
  61. package/dist/agent/components/file-attachment-card.d.ts.map +1 -0
  62. package/dist/agent/components/message-parts.d.ts +13 -0
  63. package/dist/agent/components/message-parts.d.ts.map +1 -0
  64. package/dist/agent/components/message-view.d.ts +58 -0
  65. package/dist/agent/components/message-view.d.ts.map +1 -0
  66. package/dist/agent/components/model-controls.d.ts +20 -0
  67. package/dist/agent/components/model-controls.d.ts.map +1 -0
  68. package/dist/agent/components/model-picker-row.d.ts +8 -0
  69. package/dist/agent/components/model-picker-row.d.ts.map +1 -0
  70. package/dist/agent/components/provider-logo.d.ts +6 -0
  71. package/dist/agent/components/provider-logo.d.ts.map +1 -0
  72. package/dist/agent/components/provider-logos.d.ts +3 -0
  73. package/dist/agent/components/provider-logos.d.ts.map +1 -0
  74. package/dist/agent/components/reasoning-effort-slider.d.ts +11 -0
  75. package/dist/agent/components/reasoning-effort-slider.d.ts.map +1 -0
  76. package/dist/agent/components/sandbox-recovery.d.ts +6 -0
  77. package/dist/agent/components/sandbox-recovery.d.ts.map +1 -0
  78. package/dist/agent/components/transcript.d.ts +36 -0
  79. package/dist/agent/components/transcript.d.ts.map +1 -0
  80. package/dist/agent/components/web-fetch-tool-view.d.ts +5 -0
  81. package/dist/agent/components/web-fetch-tool-view.d.ts.map +1 -0
  82. package/dist/agent/components/web-search-tool-view.d.ts +5 -0
  83. package/dist/agent/components/web-search-tool-view.d.ts.map +1 -0
  84. package/dist/agent/components/web-sources.d.ts +9 -0
  85. package/dist/agent/components/web-sources.d.ts.map +1 -0
  86. package/dist/agent/document-preview/classify.d.ts +4 -0
  87. package/dist/agent/document-preview/classify.d.ts.map +1 -0
  88. package/dist/agent/document-preview/content-policy.d.ts +10 -0
  89. package/dist/agent/document-preview/content-policy.d.ts.map +1 -0
  90. package/dist/agent/document-preview/content.d.ts +26 -0
  91. package/dist/agent/document-preview/content.d.ts.map +1 -0
  92. package/dist/agent/document-preview/delimited.d.ts +19 -0
  93. package/dist/agent/document-preview/delimited.d.ts.map +1 -0
  94. package/dist/agent/document-preview/document-preview-root.d.ts +24 -0
  95. package/dist/agent/document-preview/document-preview-root.d.ts.map +1 -0
  96. package/dist/agent/document-preview/file-size.d.ts +3 -0
  97. package/dist/agent/document-preview/file-size.d.ts.map +1 -0
  98. package/dist/agent/document-preview/html.d.ts +9 -0
  99. package/dist/agent/document-preview/html.d.ts.map +1 -0
  100. package/dist/agent/document-preview/persistence.d.ts +6 -0
  101. package/dist/agent/document-preview/persistence.d.ts.map +1 -0
  102. package/dist/agent/document-preview/presentation.d.ts +3 -0
  103. package/dist/agent/document-preview/presentation.d.ts.map +1 -0
  104. package/dist/agent/document-preview/rendering.d.ts +14 -0
  105. package/dist/agent/document-preview/rendering.d.ts.map +1 -0
  106. package/dist/agent/document-preview/source.d.ts +13 -0
  107. package/dist/agent/document-preview/source.d.ts.map +1 -0
  108. package/dist/agent/document-preview/state.d.ts +27 -0
  109. package/dist/agent/document-preview/state.d.ts.map +1 -0
  110. package/dist/agent/document-preview/types.d.ts +33 -0
  111. package/dist/agent/document-preview/types.d.ts.map +1 -0
  112. package/dist/agent/format.d.ts +12 -0
  113. package/dist/agent/format.d.ts.map +1 -0
  114. package/dist/agent/hooks/use-agent-conversation.d.ts +338 -0
  115. package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -0
  116. package/dist/agent/hooks/use-thread-stream.d.ts +22 -0
  117. package/dist/agent/hooks/use-thread-stream.d.ts.map +1 -0
  118. package/dist/agent/i18n/en.d.ts +589 -0
  119. package/dist/agent/i18n/en.d.ts.map +1 -0
  120. package/dist/agent/i18n/fr.d.ts +4 -0
  121. package/dist/agent/i18n/fr.d.ts.map +1 -0
  122. package/dist/agent/i18n/index.d.ts +1161 -0
  123. package/dist/agent/i18n/index.d.ts.map +1 -0
  124. package/dist/agent/live-run.d.ts +48 -0
  125. package/dist/agent/live-run.d.ts.map +1 -0
  126. package/dist/agent/model-selection.d.ts +33 -0
  127. package/dist/agent/model-selection.d.ts.map +1 -0
  128. package/dist/agent/object-context-title.d.ts +22 -0
  129. package/dist/agent/object-context-title.d.ts.map +1 -0
  130. package/dist/agent/parts.d.ts +42 -0
  131. package/dist/agent/parts.d.ts.map +1 -0
  132. package/dist/agent/react-router.d.ts +8 -0
  133. package/dist/agent/react-router.d.ts.map +1 -0
  134. package/dist/agent/read/interpret.d.ts +24 -0
  135. package/dist/agent/read/interpret.d.ts.map +1 -0
  136. package/dist/agent/read/read-tool-view.d.ts +5 -0
  137. package/dist/agent/read/read-tool-view.d.ts.map +1 -0
  138. package/dist/agent/requester-settings.d.ts +15 -0
  139. package/dist/agent/requester-settings.d.ts.map +1 -0
  140. package/dist/agent/run-presentation.d.ts +70 -0
  141. package/dist/agent/run-presentation.d.ts.map +1 -0
  142. package/dist/agent/thread-navigation.d.ts +5 -0
  143. package/dist/agent/thread-navigation.d.ts.map +1 -0
  144. package/dist/agent/types.d.ts +22 -0
  145. package/dist/agent/types.d.ts.map +1 -0
  146. package/dist/agent/utils/context-display.d.ts +5 -0
  147. package/dist/agent/utils/context-display.d.ts.map +1 -0
  148. package/dist/agent/utils/context-mention.d.ts +12 -0
  149. package/dist/agent/utils/context-mention.d.ts.map +1 -0
  150. package/dist/agent/utils/web-fetch.d.ts +4 -0
  151. package/dist/agent/utils/web-fetch.d.ts.map +1 -0
  152. package/dist/agent/utils/web-search.d.ts +20 -0
  153. package/dist/agent/utils/web-search.d.ts.map +1 -0
  154. package/dist/agent/view-file/interpret.d.ts +9 -0
  155. package/dist/agent/view-file/interpret.d.ts.map +1 -0
  156. package/dist/agent/view-file/view-file-tool-view.d.ts +9 -0
  157. package/dist/agent/view-file/view-file-tool-view.d.ts.map +1 -0
  158. package/dist/agent/workspace.d.ts +11 -0
  159. package/dist/agent/workspace.d.ts.map +1 -0
  160. package/dist/chunk-3a99tmwg.js +176 -0
  161. package/dist/chunk-3a99tmwg.js.map +10 -0
  162. package/dist/chunk-48pkffj6.js +20 -0
  163. package/dist/chunk-48pkffj6.js.map +10 -0
  164. package/dist/chunk-6n5pdqp0.js +115 -0
  165. package/dist/chunk-6n5pdqp0.js.map +11 -0
  166. package/dist/chunk-j97e06rg.js +10668 -0
  167. package/dist/chunk-j97e06rg.js.map +80 -0
  168. package/dist/chunk-md3p7qdt.js +379 -0
  169. package/dist/chunk-md3p7qdt.js.map +10 -0
  170. package/dist/chunk-shmw3f8t.js +251 -0
  171. package/dist/chunk-shmw3f8t.js.map +10 -0
  172. package/dist/chunk-yvhzn4ye.js +98 -0
  173. package/dist/chunk-yvhzn4ye.js.map +10 -0
  174. package/dist/chunk-zcxrt24m.js +148 -0
  175. package/dist/chunk-zcxrt24m.js.map +10 -0
  176. package/dist/codegen.d.ts +6 -4
  177. package/dist/codegen.d.ts.map +1 -1
  178. package/dist/createCustomApp.d.ts +14 -7
  179. package/dist/createCustomApp.d.ts.map +1 -1
  180. package/dist/index.d.ts +33 -3
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.js +958 -2890
  183. package/dist/index.js.map +14 -13
  184. package/dist/locale-messages.d.ts +72 -6
  185. package/dist/locale-messages.d.ts.map +1 -1
  186. package/dist/locale.d.ts +73 -8
  187. package/dist/locale.d.ts.map +1 -1
  188. package/dist/locale.js +10 -19
  189. package/dist/locale.js.map +3 -4
  190. package/dist/metadata.d.ts.map +1 -1
  191. package/dist/pages/data/connectors.d.ts +5 -0
  192. package/dist/pages/data/connectors.d.ts.map +1 -0
  193. package/dist/pages/data/datasets.d.ts +30 -0
  194. package/dist/pages/data/datasets.d.ts.map +1 -0
  195. package/dist/pages/data/live-updates.d.ts +13 -0
  196. package/dist/pages/data/live-updates.d.ts.map +1 -0
  197. package/dist/pages/data/messages.d.ts +354 -0
  198. package/dist/pages/data/messages.d.ts.map +1 -0
  199. package/dist/pages/data/pipeline-canvas.d.ts +34 -0
  200. package/dist/pages/data/pipeline-canvas.d.ts.map +1 -0
  201. package/dist/pages/data/pipelines.d.ts +9 -0
  202. package/dist/pages/data/pipelines.d.ts.map +1 -0
  203. package/dist/pages/data/projections.d.ts +10 -0
  204. package/dist/pages/data/projections.d.ts.map +1 -0
  205. package/dist/pages/data/schema.d.ts +20 -0
  206. package/dist/pages/data/schema.d.ts.map +1 -0
  207. package/dist/pages/data/shared.d.ts +13 -0
  208. package/dist/pages/data/shared.d.ts.map +1 -0
  209. package/dist/pages/data/sync-button.d.ts +15 -0
  210. package/dist/pages/data/sync-button.d.ts.map +1 -0
  211. package/dist/pages/data/syncs.d.ts +5 -0
  212. package/dist/pages/data/syncs.d.ts.map +1 -0
  213. package/dist/pages/home.d.ts +6 -0
  214. package/dist/pages/home.d.ts.map +1 -0
  215. package/dist/pages/mosaic.d.ts +5 -0
  216. package/dist/pages/mosaic.d.ts.map +1 -0
  217. package/dist/pages/observability/action-run.d.ts +19 -0
  218. package/dist/pages/observability/action-run.d.ts.map +1 -0
  219. package/dist/pages/observability/ai-usage/calls.d.ts +27 -0
  220. package/dist/pages/observability/ai-usage/calls.d.ts.map +1 -0
  221. package/dist/pages/observability/ai-usage/charts.d.ts +23 -0
  222. package/dist/pages/observability/ai-usage/charts.d.ts.map +1 -0
  223. package/dist/pages/observability/ai-usage/format.d.ts +101 -0
  224. package/dist/pages/observability/ai-usage/format.d.ts.map +1 -0
  225. package/dist/pages/observability/ai-usage/limits.d.ts +12 -0
  226. package/dist/pages/observability/ai-usage/limits.d.ts.map +1 -0
  227. package/dist/pages/observability/ai-usage/messages.d.ts +431 -0
  228. package/dist/pages/observability/ai-usage/messages.d.ts.map +1 -0
  229. package/dist/pages/observability/ai-usage/page.d.ts +6 -0
  230. package/dist/pages/observability/ai-usage/page.d.ts.map +1 -0
  231. package/dist/pages/observability/live-updates.d.ts +3 -0
  232. package/dist/pages/observability/live-updates.d.ts.map +1 -0
  233. package/dist/pages/observability/logs.d.ts +11 -0
  234. package/dist/pages/observability/logs.d.ts.map +1 -0
  235. package/dist/pages/observability/messages.d.ts +329 -0
  236. package/dist/pages/observability/messages.d.ts.map +1 -0
  237. package/dist/pages/observability/runs.d.ts +7 -0
  238. package/dist/pages/observability/runs.d.ts.map +1 -0
  239. package/dist/pages/observability/workflow-run.d.ts +6 -0
  240. package/dist/pages/observability/workflow-run.d.ts.map +1 -0
  241. package/dist/pages/ontology/actions.d.ts +3 -0
  242. package/dist/pages/ontology/actions.d.ts.map +1 -0
  243. package/dist/pages/ontology/components/action-button.d.ts +12 -0
  244. package/dist/pages/ontology/components/action-button.d.ts.map +1 -0
  245. package/dist/pages/ontology/components/action-param-null-control.d.ts +7 -0
  246. package/dist/pages/ontology/components/action-param-null-control.d.ts.map +1 -0
  247. package/dist/pages/ontology/components/collection-toolbar.d.ts +21 -0
  248. package/dist/pages/ontology/components/collection-toolbar.d.ts.map +1 -0
  249. package/dist/pages/ontology/components/common.d.ts +16 -0
  250. package/dist/pages/ontology/components/common.d.ts.map +1 -0
  251. package/dist/pages/ontology/components/file-ref-upload-field.d.ts +13 -0
  252. package/dist/pages/ontology/components/file-ref-upload-field.d.ts.map +1 -0
  253. package/dist/pages/ontology/components/object-filter-popover.d.ts +9 -0
  254. package/dist/pages/ontology/components/object-filter-popover.d.ts.map +1 -0
  255. package/dist/pages/ontology/components/object-icon.d.ts +7 -0
  256. package/dist/pages/ontology/components/object-icon.d.ts.map +1 -0
  257. package/dist/pages/ontology/components/object-query-bar.d.ts +21 -0
  258. package/dist/pages/ontology/components/object-query-bar.d.ts.map +1 -0
  259. package/dist/pages/ontology/components/telemetry-chart.d.ts +18 -0
  260. package/dist/pages/ontology/components/telemetry-chart.d.ts.map +1 -0
  261. package/dist/pages/ontology/components/telemetry-grid.d.ts +19 -0
  262. package/dist/pages/ontology/components/telemetry-grid.d.ts.map +1 -0
  263. package/dist/pages/ontology/components/telemetry-tile.d.ts +18 -0
  264. package/dist/pages/ontology/components/telemetry-tile.d.ts.map +1 -0
  265. package/dist/pages/ontology/components/telemetry-value.d.ts +10 -0
  266. package/dist/pages/ontology/components/telemetry-value.d.ts.map +1 -0
  267. package/dist/pages/ontology/components/usage-bar.d.ts +12 -0
  268. package/dist/pages/ontology/components/usage-bar.d.ts.map +1 -0
  269. package/dist/pages/ontology/graph.d.ts +6 -0
  270. package/dist/pages/ontology/graph.d.ts.map +1 -0
  271. package/dist/pages/ontology/hooks/object-live-updates.d.ts +5 -0
  272. package/dist/pages/ontology/hooks/object-live-updates.d.ts.map +1 -0
  273. package/dist/pages/ontology/hooks/object-telemetry-updates.d.ts +8 -0
  274. package/dist/pages/ontology/hooks/object-telemetry-updates.d.ts.map +1 -0
  275. package/dist/pages/ontology/hooks/object-type-counts.d.ts +5 -0
  276. package/dist/pages/ontology/hooks/object-type-counts.d.ts.map +1 -0
  277. package/dist/pages/ontology/hooks/rule-live-updates.d.ts +9 -0
  278. package/dist/pages/ontology/hooks/rule-live-updates.d.ts.map +1 -0
  279. package/dist/pages/ontology/hooks/workflow-live-updates.d.ts +6 -0
  280. package/dist/pages/ontology/hooks/workflow-live-updates.d.ts.map +1 -0
  281. package/dist/pages/ontology/lib/action-params.d.ts +55 -0
  282. package/dist/pages/ontology/lib/action-params.d.ts.map +1 -0
  283. package/dist/pages/ontology/lib/format-value.d.ts +3 -0
  284. package/dist/pages/ontology/lib/format-value.d.ts.map +1 -0
  285. package/dist/pages/ontology/lib/labels.d.ts +3 -0
  286. package/dist/pages/ontology/lib/labels.d.ts.map +1 -0
  287. package/dist/pages/ontology/lib/live-update-keys.d.ts +15 -0
  288. package/dist/pages/ontology/lib/live-update-keys.d.ts.map +1 -0
  289. package/dist/pages/ontology/lib/object-query.d.ts +72 -0
  290. package/dist/pages/ontology/lib/object-query.d.ts.map +1 -0
  291. package/dist/pages/ontology/lib/ontology-graph-layout.d.ts +68 -0
  292. package/dist/pages/ontology/lib/ontology-graph-layout.d.ts.map +1 -0
  293. package/dist/pages/ontology/lib/ontology-graph-links.d.ts +4 -0
  294. package/dist/pages/ontology/lib/ontology-graph-links.d.ts.map +1 -0
  295. package/dist/pages/ontology/lib/telemetry-history.d.ts +10 -0
  296. package/dist/pages/ontology/lib/telemetry-history.d.ts.map +1 -0
  297. package/dist/pages/ontology/lib/time.d.ts +3 -0
  298. package/dist/pages/ontology/lib/time.d.ts.map +1 -0
  299. package/dist/pages/ontology/lib/user-preferences.d.ts +8 -0
  300. package/dist/pages/ontology/lib/user-preferences.d.ts.map +1 -0
  301. package/dist/pages/ontology/object-page.d.ts +7 -0
  302. package/dist/pages/ontology/object-page.d.ts.map +1 -0
  303. package/dist/pages/ontology/object-type.d.ts +3 -0
  304. package/dist/pages/ontology/object-type.d.ts.map +1 -0
  305. package/dist/pages/ontology/object-types.d.ts +7 -0
  306. package/dist/pages/ontology/object-types.d.ts.map +1 -0
  307. package/dist/pages/ontology/objects.d.ts +6 -0
  308. package/dist/pages/ontology/objects.d.ts.map +1 -0
  309. package/dist/pages/ontology/rules.d.ts +32 -0
  310. package/dist/pages/ontology/rules.d.ts.map +1 -0
  311. package/dist/pages/ontology/workflow.d.ts +6 -0
  312. package/dist/pages/ontology/workflow.d.ts.map +1 -0
  313. package/dist/pages/ontology/workflows/agent-execution-panel.d.ts +17 -0
  314. package/dist/pages/ontology/workflows/agent-execution-panel.d.ts.map +1 -0
  315. package/dist/pages/ontology/workflows/intervention-panel.d.ts +5 -0
  316. package/dist/pages/ontology/workflows/intervention-panel.d.ts.map +1 -0
  317. package/dist/pages/ontology/workflows/node-execution-panel.d.ts +11 -0
  318. package/dist/pages/ontology/workflows/node-execution-panel.d.ts.map +1 -0
  319. package/dist/pages/ontology/workflows/request-run-dialog.d.ts +5 -0
  320. package/dist/pages/ontology/workflows/request-run-dialog.d.ts.map +1 -0
  321. package/dist/pages/ontology/workflows/run-debug-section.d.ts +11 -0
  322. package/dist/pages/ontology/workflows/run-debug-section.d.ts.map +1 -0
  323. package/dist/pages/ontology/workflows/run-input-form.d.ts +18 -0
  324. package/dist/pages/ontology/workflows/run-input-form.d.ts.map +1 -0
  325. package/dist/pages/ontology/workflows/run-progress.d.ts +15 -0
  326. package/dist/pages/ontology/workflows/run-progress.d.ts.map +1 -0
  327. package/dist/pages/ontology/workflows/schema-shape.d.ts +10 -0
  328. package/dist/pages/ontology/workflows/schema-shape.d.ts.map +1 -0
  329. package/dist/pages/ontology/workflows/status-badge.d.ts +5 -0
  330. package/dist/pages/ontology/workflows/status-badge.d.ts.map +1 -0
  331. package/dist/pages/ontology/workflows/utils.d.ts +29 -0
  332. package/dist/pages/ontology/workflows/utils.d.ts.map +1 -0
  333. package/dist/pages/ontology/workflows/workflow-card.d.ts +5 -0
  334. package/dist/pages/ontology/workflows/workflow-card.d.ts.map +1 -0
  335. package/dist/pages/ontology/workflows.d.ts +3 -0
  336. package/dist/pages/ontology/workflows.d.ts.map +1 -0
  337. package/dist/pages/routes.d.ts +19 -0
  338. package/dist/pages/routes.d.ts.map +1 -0
  339. package/dist/pages/section-page.d.ts +91 -0
  340. package/dist/pages/section-page.d.ts.map +1 -0
  341. package/dist/pages/section-ui.d.ts +211 -0
  342. package/dist/pages/section-ui.d.ts.map +1 -0
  343. package/dist/pages/settings/controls.d.ts +94 -0
  344. package/dist/pages/settings/controls.d.ts.map +1 -0
  345. package/dist/pages/settings/developers.d.ts +3 -0
  346. package/dist/pages/settings/developers.d.ts.map +1 -0
  347. package/dist/pages/settings/members.d.ts +3 -0
  348. package/dist/pages/settings/members.d.ts.map +1 -0
  349. package/dist/pages/settings/messages.d.ts +538 -0
  350. package/dist/pages/settings/messages.d.ts.map +1 -0
  351. package/dist/pages/settings/personal.d.ts +6 -0
  352. package/dist/pages/settings/personal.d.ts.map +1 -0
  353. package/dist/pages/settings/service-accounts.d.ts +3 -0
  354. package/dist/pages/settings/service-accounts.d.ts.map +1 -0
  355. package/dist/pages/settings/sessions.d.ts +3 -0
  356. package/dist/pages/settings/sessions.d.ts.map +1 -0
  357. package/dist/pages/values.d.ts +77 -0
  358. package/dist/pages/values.d.ts.map +1 -0
  359. package/dist/pages.d.ts +42 -0
  360. package/dist/pages.d.ts.map +1 -0
  361. package/dist/pages.js +23931 -0
  362. package/dist/pages.js.map +85 -0
  363. package/dist/runtime.d.ts +0 -2
  364. package/dist/runtime.d.ts.map +1 -1
  365. package/dist/sections/catalog.d.ts +37 -0
  366. package/dist/sections/catalog.d.ts.map +1 -0
  367. package/dist/sections/counts.d.ts +7 -0
  368. package/dist/sections/counts.d.ts.map +1 -0
  369. package/dist/sections/sections.d.ts +67 -0
  370. package/dist/sections/sections.d.ts.map +1 -0
  371. package/dist/server.d.ts +8 -0
  372. package/dist/server.d.ts.map +1 -0
  373. package/dist/server.js +2983 -0
  374. package/dist/server.js.map +19 -0
  375. package/dist/session.d.ts +18 -0
  376. package/dist/session.d.ts.map +1 -0
  377. package/dist/shell/agent-dock.d.ts +7 -0
  378. package/dist/shell/agent-dock.d.ts.map +1 -0
  379. package/dist/shell/app-shell.d.ts +42 -0
  380. package/dist/shell/app-shell.d.ts.map +1 -0
  381. package/dist/shell/brand.d.ts +15 -0
  382. package/dist/shell/brand.d.ts.map +1 -0
  383. package/dist/shell/nav-items.d.ts +34 -0
  384. package/dist/shell/nav-items.d.ts.map +1 -0
  385. package/dist/shell/search-command.d.ts +12 -0
  386. package/dist/shell/search-command.d.ts.map +1 -0
  387. package/dist/shell/section-nav.d.ts +13 -0
  388. package/dist/shell/section-nav.d.ts.map +1 -0
  389. package/dist/shell/user-menu.d.ts +25 -0
  390. package/dist/shell/user-menu.d.ts.map +1 -0
  391. package/dist/tailwind.d.ts +4 -4
  392. package/dist/tailwind.d.ts.map +1 -1
  393. package/package.json +24 -21
  394. package/src/agent/activity-label.ts +63 -0
  395. package/src/agent/agent-chat.tsx +237 -0
  396. package/src/agent/agent-context-provider.tsx +92 -0
  397. package/src/agent/agent-execution-trace.tsx +316 -0
  398. package/src/agent/agent-panel.tsx +79 -0
  399. package/src/agent/agent-surface-state.ts +113 -0
  400. package/src/agent/agent-surface.tsx +363 -0
  401. package/src/agent/agent.css +231 -0
  402. package/src/agent/bash/bash-tool-view.tsx +288 -0
  403. package/src/agent/bash/data.ts +137 -0
  404. package/src/agent/bash/interpret.ts +769 -0
  405. package/src/agent/bash/renderers.tsx +503 -0
  406. package/src/agent/bash/shell.ts +195 -0
  407. package/src/agent/components/activity-status.tsx +86 -0
  408. package/src/agent/components/agent-thread-switcher.tsx +346 -0
  409. package/src/agent/components/composer.tsx +870 -0
  410. package/src/agent/components/context-chips.tsx +63 -0
  411. package/src/agent/components/context-picker.tsx +88 -0
  412. package/src/agent/components/conversation-panel.tsx +352 -0
  413. package/src/agent/components/file-attachment-card.tsx +137 -0
  414. package/src/agent/components/message-parts.tsx +280 -0
  415. package/src/agent/components/message-view.tsx +428 -0
  416. package/src/agent/components/model-controls.tsx +204 -0
  417. package/src/agent/components/model-picker-row.tsx +136 -0
  418. package/src/agent/components/provider-logo.tsx +31 -0
  419. package/src/agent/components/provider-logos.ts +24 -0
  420. package/src/agent/components/reasoning-effort-slider.tsx +121 -0
  421. package/src/agent/components/sandbox-recovery.tsx +49 -0
  422. package/src/agent/components/transcript.tsx +239 -0
  423. package/src/agent/components/web-fetch-tool-view.tsx +69 -0
  424. package/src/agent/components/web-search-tool-view.tsx +37 -0
  425. package/src/agent/components/web-sources.tsx +159 -0
  426. package/src/agent/document-preview/classify.ts +55 -0
  427. package/src/agent/document-preview/content-policy.ts +37 -0
  428. package/src/agent/document-preview/content.ts +82 -0
  429. package/src/agent/document-preview/delimited.ts +118 -0
  430. package/src/agent/document-preview/document-preview-root.tsx +1017 -0
  431. package/src/agent/document-preview/file-size.ts +26 -0
  432. package/src/agent/document-preview/html.ts +67 -0
  433. package/src/agent/document-preview/persistence.ts +115 -0
  434. package/src/agent/document-preview/presentation.ts +13 -0
  435. package/src/agent/document-preview/rendering.ts +48 -0
  436. package/src/agent/document-preview/source.ts +48 -0
  437. package/src/agent/document-preview/state.ts +77 -0
  438. package/src/agent/document-preview/types.ts +36 -0
  439. package/src/agent/format.ts +60 -0
  440. package/src/agent/hooks/use-agent-conversation.ts +536 -0
  441. package/src/agent/hooks/use-thread-stream.ts +121 -0
  442. package/src/agent/i18n/en.ts +542 -0
  443. package/src/agent/i18n/fr.ts +574 -0
  444. package/src/agent/i18n/index.ts +14 -0
  445. package/src/agent/live-run.ts +257 -0
  446. package/src/agent/model-selection.ts +88 -0
  447. package/src/agent/object-context-title.ts +57 -0
  448. package/src/agent/parts.ts +119 -0
  449. package/src/agent/react-router.tsx +84 -0
  450. package/src/agent/read/interpret.ts +101 -0
  451. package/src/agent/read/read-tool-view.tsx +92 -0
  452. package/src/agent/requester-settings.ts +55 -0
  453. package/src/agent/run-presentation.ts +211 -0
  454. package/src/agent/thread-navigation.ts +11 -0
  455. package/src/agent/types.ts +37 -0
  456. package/src/agent/utils/context-display.ts +72 -0
  457. package/src/agent/utils/context-mention.ts +28 -0
  458. package/src/agent/utils/web-fetch.ts +20 -0
  459. package/src/agent/utils/web-search.ts +106 -0
  460. package/src/agent/view-file/interpret.ts +22 -0
  461. package/src/agent/view-file/view-file-tool-view.tsx +120 -0
  462. package/src/{agents.ts → agent/workspace.ts} +4 -19
  463. package/src/codegen.ts +61 -79
  464. package/src/createCustomApp.ts +155 -67
  465. package/src/index.ts +52 -16
  466. package/src/locale-messages.ts +121 -12
  467. package/src/locale.ts +1 -2
  468. package/src/metadata.ts +35 -1
  469. package/src/pages/canvas.css +43 -0
  470. package/src/pages/data/connectors.tsx +317 -0
  471. package/src/pages/data/datasets.tsx +731 -0
  472. package/src/pages/data/live-updates.ts +71 -0
  473. package/src/pages/data/messages.ts +349 -0
  474. package/src/pages/data/pipeline-canvas.tsx +288 -0
  475. package/src/pages/data/pipelines.tsx +710 -0
  476. package/src/pages/data/projections.tsx +482 -0
  477. package/src/pages/data/schema.tsx +62 -0
  478. package/src/pages/data/shared.tsx +78 -0
  479. package/src/pages/data/sync-button.tsx +103 -0
  480. package/src/pages/data/syncs.tsx +326 -0
  481. package/src/pages/home.tsx +64 -0
  482. package/src/pages/mosaic.tsx +97 -0
  483. package/src/pages/observability/action-run.tsx +229 -0
  484. package/src/pages/observability/ai-usage/calls.tsx +541 -0
  485. package/src/pages/observability/ai-usage/charts.tsx +126 -0
  486. package/src/pages/observability/ai-usage/format.ts +276 -0
  487. package/src/pages/observability/ai-usage/limits.tsx +629 -0
  488. package/src/pages/observability/ai-usage/messages.ts +446 -0
  489. package/src/pages/observability/ai-usage/page.tsx +814 -0
  490. package/src/pages/observability/live-updates.ts +19 -0
  491. package/src/pages/observability/logs.tsx +617 -0
  492. package/src/pages/observability/messages.ts +336 -0
  493. package/src/pages/observability/runs.tsx +732 -0
  494. package/src/pages/observability/workflow-run.tsx +323 -0
  495. package/src/pages/ontology/actions.tsx +749 -0
  496. package/src/pages/ontology/components/action-button.tsx +355 -0
  497. package/src/pages/ontology/components/action-param-null-control.tsx +35 -0
  498. package/src/pages/ontology/components/collection-toolbar.tsx +61 -0
  499. package/src/pages/ontology/components/common.tsx +60 -0
  500. package/src/pages/ontology/components/file-ref-upload-field.tsx +279 -0
  501. package/src/pages/ontology/components/object-filter-popover.tsx +311 -0
  502. package/src/pages/ontology/components/object-icon.tsx +133 -0
  503. package/src/pages/ontology/components/object-query-bar.tsx +217 -0
  504. package/src/pages/ontology/components/telemetry-chart.tsx +392 -0
  505. package/src/pages/ontology/components/telemetry-grid.tsx +137 -0
  506. package/src/pages/ontology/components/telemetry-tile.tsx +164 -0
  507. package/src/pages/ontology/components/telemetry-value.tsx +91 -0
  508. package/src/pages/ontology/components/usage-bar.tsx +64 -0
  509. package/src/pages/ontology/graph.tsx +1283 -0
  510. package/src/pages/ontology/hooks/object-live-updates.ts +53 -0
  511. package/src/pages/ontology/hooks/object-telemetry-updates.ts +45 -0
  512. package/src/pages/ontology/hooks/object-type-counts.ts +27 -0
  513. package/src/pages/ontology/hooks/rule-live-updates.ts +28 -0
  514. package/src/pages/ontology/hooks/workflow-live-updates.ts +20 -0
  515. package/src/pages/ontology/lib/action-params.ts +231 -0
  516. package/src/pages/ontology/lib/format-value.ts +34 -0
  517. package/src/pages/ontology/lib/labels.ts +50 -0
  518. package/src/pages/ontology/lib/live-update-keys.ts +62 -0
  519. package/src/pages/ontology/lib/object-query.ts +372 -0
  520. package/src/pages/ontology/lib/ontology-graph-layout.ts +1004 -0
  521. package/src/pages/ontology/lib/ontology-graph-links.ts +15 -0
  522. package/src/pages/ontology/lib/telemetry-history.ts +56 -0
  523. package/src/pages/ontology/lib/time.ts +23 -0
  524. package/src/pages/ontology/lib/user-preferences.ts +52 -0
  525. package/src/pages/ontology/object-page.tsx +1029 -0
  526. package/src/pages/ontology/object-type.tsx +910 -0
  527. package/src/pages/ontology/object-types.tsx +240 -0
  528. package/src/pages/ontology/objects.tsx +938 -0
  529. package/src/pages/ontology/rules.tsx +805 -0
  530. package/src/pages/ontology/workflow.tsx +1485 -0
  531. package/src/pages/ontology/workflows/agent-execution-panel.tsx +340 -0
  532. package/src/pages/ontology/workflows/intervention-panel.tsx +261 -0
  533. package/src/pages/ontology/workflows/node-execution-panel.tsx +86 -0
  534. package/src/pages/ontology/workflows/request-run-dialog.tsx +197 -0
  535. package/src/pages/ontology/workflows/run-debug-section.tsx +54 -0
  536. package/src/pages/ontology/workflows/run-input-form.tsx +900 -0
  537. package/src/pages/ontology/workflows/run-progress.tsx +83 -0
  538. package/src/pages/ontology/workflows/schema-shape.tsx +206 -0
  539. package/src/pages/ontology/workflows/status-badge.tsx +15 -0
  540. package/src/pages/ontology/workflows/utils.ts +107 -0
  541. package/src/pages/ontology/workflows/workflow-card.tsx +48 -0
  542. package/src/pages/ontology/workflows.tsx +143 -0
  543. package/src/pages/routes.ts +48 -0
  544. package/src/pages/section-page.tsx +272 -0
  545. package/src/pages/section-ui.tsx +771 -0
  546. package/src/pages/settings/controls.tsx +721 -0
  547. package/src/pages/settings/developers.tsx +163 -0
  548. package/src/pages/settings/members.tsx +1018 -0
  549. package/src/pages/settings/messages.ts +551 -0
  550. package/src/pages/settings/personal.tsx +97 -0
  551. package/src/pages/settings/service-accounts.tsx +623 -0
  552. package/src/pages/settings/sessions.tsx +183 -0
  553. package/src/pages/values.tsx +700 -0
  554. package/src/pages.ts +56 -0
  555. package/src/runtime.ts +0 -3
  556. package/src/sections/catalog.ts +181 -0
  557. package/src/sections/counts.ts +33 -0
  558. package/src/sections/sections.tsx +257 -0
  559. package/src/server.ts +19 -0
  560. package/src/session.ts +29 -0
  561. package/src/shell/agent-dock.tsx +32 -0
  562. package/src/shell/app-shell.tsx +142 -0
  563. package/src/shell/brand.tsx +47 -0
  564. package/src/shell/nav-items.tsx +136 -0
  565. package/src/shell/search-command.tsx +158 -0
  566. package/src/shell/section-nav.tsx +61 -0
  567. package/src/shell/user-menu.tsx +206 -0
  568. package/src/tailwind.ts +4 -4
  569. package/dist/agents.d.ts +0 -11
  570. package/dist/agents.d.ts.map +0 -1
  571. package/dist/agents.js +0 -41
  572. package/dist/agents.js.map +0 -10
  573. package/dist/auth.js +0 -3
  574. package/dist/auth.js.map +0 -9
  575. package/dist/browser.d.ts +0 -3
  576. package/dist/browser.d.ts.map +0 -1
  577. package/dist/browser.js +0 -9
  578. package/dist/browser.js.map +0 -9
  579. package/dist/chunk-cftmy40z.js +0 -70
  580. package/dist/chunk-cftmy40z.js.map +0 -10
  581. package/dist/chunk-e1gj8c1a.js +0 -8
  582. package/dist/chunk-e1gj8c1a.js.map +0 -10
  583. package/src/browser.ts +0 -2
package/dist/index.js.map CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/createCustomApp.ts", "../src/build.ts", "../src/codegen.ts", "../src/manifest.ts", "../src/metadata.ts", "../src/runtime.ts", "../src/scanner.ts", "../src/dev-reload.ts", "../src/styles.ts", "../src/tailwind.ts"],
3
+ "sources": ["../src/index.ts", "../src/agent/agent-panel.tsx", "../src/agent/agent-surface.tsx", "../src/agent/agent-surface-state.ts", "../src/public-env.ts", "../src/shell/agent-dock.tsx", "../src/shell/app-shell.tsx", "../src/shell/search-command.tsx", "../src/shell/section-nav.tsx", "../src/sections/counts.ts", "../src/shell/user-menu.tsx"],
4
4
  "sourcesContent": [
5
- "import { randomBytes } from \"node:crypto\"\nimport { 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 type { AuthSessionAudience } from \"@sixb/core\"\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 { collectPublicEnv, renderCustomAppRuntimeScript } from \"./runtime\"\nimport { type PageRoute, routePatternKey, scanAppRoutes } from \"./scanner\"\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 audience?: AuthSessionAudience\n authEnabled?: boolean\n agentRoutes?: 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 audience?: AuthSessionAudience\n authEnabled?: boolean\n}\n\nexport interface CustomAppDevServer {\n host: string\n port: number\n url: string\n stop(): Promise<void>\n}\n\nexport interface CustomAppInstance {\n scanRoutes(): Promise<PageRoute[]>\n hasRoutes(): Promise<boolean>\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<CustomAppDevServer>\n}\n\ntype BunServeRoutes = NonNullable<Parameters<typeof Bun.serve>[0][\"routes\"]>\ntype BunServeRoute = BunServeRoutes[string]\nconst packageRoot = resolve(import.meta.dir, \"..\")\nconst builtInAgentRouteModule = \"@sixb/app/agents\"\nconst builtInAgentRoutePaths = [\"/agents\", \"/agents/new/:agentId\", \"/agents/:threadId\"] as const\nconst builtInAgentRouteSourcePath = join(packageRoot, \"src\", \"agents.ts\")\nconst customAppManifestRoute = \"/app.webmanifest\"\nconst internalAppShellRoute = \"/__sixb/generated/app-shell\"\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 audience = options.audience ?? \"app\"\n const authEnabled = options.authEnabled ?? true\n const agentRoutesEnabled = options.agentRoutes ?? true\n\n async function scanRoutes(): Promise<PageRoute[]> {\n return [...(await scanAppRoutes(appDir)).pages]\n }\n\n let tailwindCompiler: TailwindCssCompiler | null = null\n let tailwindCompilerKey: string | null = null\n let authTailwindCompiler: TailwindCssCompiler | null = null\n let builtInAgentCssCompiler: 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 prepareCombinedBuiltInAgentStylesheet(\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 const agentUiGlobalsPath = Bun.resolveSync(\"@sixb/agent-ui/globals.css\", packageRoot)\n await writeFileIfChanged(\n inputPath,\n [\n `@import ${JSON.stringify(uiGlobalsPath)};`,\n `@source ${JSON.stringify(builtInAgentRouteSourcePath)};`,\n `@import ${JSON.stringify(stylesheet.sourcePath)};`,\n `@import ${JSON.stringify(agentUiGlobalsPath)};`,\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 prepareCombinedBuiltInAgentStylesheet(stylesheet),\n frameworkStylesheetPaths: [],\n }\n }\n\n const preparedStylesheet = await prepareStylesheet(stylesheet)\n const builtInAgentStylesheetPath = await prepareBuiltInAgentStylesheet(builtInRoutes)\n\n return {\n frameworkStylesheetPaths: builtInAgentStylesheetPath ? [builtInAgentStylesheetPath] : [],\n stylesheetPath:\n preparedStylesheet.kind === \"none\"\n ? null\n : preparedStylesheet.kind === \"static\"\n ? preparedStylesheet.path\n : preparedStylesheet.outputPath,\n }\n }\n\n async function prepareBuiltInAgentStylesheet(\n builtInRoutes: readonly BuiltInRouteManifestEntry[]\n ): Promise<string | null> {\n if (builtInRoutes.length === 0) {\n return null\n }\n\n const inputPath = join(generatedDir, \"agent-ui.input.css\")\n const outputPath = join(generatedDir, \"agent-ui.css\")\n const uiGlobalsPath = Bun.resolveSync(\"@sixb/ui/globals.css\", packageRoot)\n const agentUiGlobalsPath = Bun.resolveSync(\"@sixb/agent-ui/globals.css\", packageRoot)\n await writeFileIfChanged(\n inputPath,\n [\n `@import ${JSON.stringify(uiGlobalsPath)};`,\n `@source ${JSON.stringify(builtInAgentRouteSourcePath)};`,\n `@import ${JSON.stringify(agentUiGlobalsPath)};`,\n \"\",\n ].join(\"\\n\")\n )\n\n builtInAgentCssCompiler ??= createTailwindCssCompiler({\n inputPath,\n outputPath,\n cwd: packageRoot,\n resolveFrom: packageRoot,\n label: \"[SixbCustomApp]\",\n })\n await builtInAgentCssCompiler.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 const discovery = await scanAppRoutes(appDir)\n const routes = [...discovery.pages]\n if (routes.length === 0) {\n throw new Error(`[SixbCustomApp] No app routes found in ${appDir}`)\n }\n\n const builtInRoutes = agentRoutesEnabled ? builtInAgentRoutesFor(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 audience,\n authEnabled,\n appDir,\n publicDir,\n frameworkStylesheetPaths: stylesheets.frameworkStylesheetPaths,\n stylesheetPath: stylesheets.stylesheetPath,\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 hasRoutes() {\n const routes = await scanRoutes()\n return routes.length > 0\n },\n\n async prepareAuthExperience(options) {\n return await prepareAuthExperience(options)\n },\n\n async dev(devOptions: CustomAppDevOptions = {}) {\n const publicEnv = collectPublicEnv()\n const withRuntime = (html: string) =>\n injectRuntimeConfig(html, { apiBaseUrl, audience, authEnabled, publicEnv })\n const host = devOptions.host ?? \"0.0.0.0\"\n const port = devOptions.port ?? 3001\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 [customAppManifestRoute]: manifestRoute(manifestPath),\n [privateAppShellRoute]: htmlBundleRoute(bundle),\n ...sharedAppDevRoutes(\n async () =>\n injectRuntimeConfig((await ensureSharedBuild()).html, {\n apiBaseUrl,\n audience: \"app\",\n authEnabled: false,\n publicEnv,\n }),\n apiBaseUrl\n ),\n \"/\": spaHtmlRoute(() => internalOrigin, {\n shellRoute: privateAppShellRoute,\n transformHtml: withRuntime,\n }),\n \"/*\": spaHtmlRoute(() => internalOrigin, {\n shellRoute: privateAppShellRoute,\n transformHtml: withRuntime,\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 internalOrigin = devServerInternalOrigin(host, server.port ?? port)\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 const watcher = 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\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,\n url: `http://${displayHost}:${port}`,\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 builtInAgentCssCompiler?.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 host = startOptions.host ?? \"0.0.0.0\"\n const port = startOptions.port ?? 3001\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 audience: startOptions.audience ?? audience,\n authEnabled: startOptions.authEnabled ?? authEnabled,\n publicEnv,\n })\n const sharedIndexHtml = injectRuntimeConfig(await Bun.file(sharedIndexPath).text(), {\n apiBaseUrl: startOptions.apiBaseUrl ?? apiBaseUrl,\n audience: \"app\",\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 (isSharedAppRoute(url.pathname)) {\n if (isAssetRequest(url.pathname)) {\n return notFoundResponse()\n }\n return sharedHtmlResponse(req, sharedIndexHtml, runtimeApiBaseUrl)\n }\n\n if (isSharedNamespace(url.pathname)) {\n return notFoundResponse()\n }\n\n if (url.pathname === \"/\" || url.pathname === \"\") {\n return htmlResponse(req, indexHtml)\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)\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)\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)\n },\n })\n\n const displayHost = host === \"0.0.0.0\" ? \"localhost\" : host\n\n return {\n host,\n port,\n url: `http://${displayHost}:${port}`,\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\nfunction builtInAgentRoutesFor(routes: readonly PageRoute[]): BuiltInRouteManifestEntry[] {\n const projectRoutePatterns = new Set(routes.map((route) => routePatternKey(route.path)))\n\n return builtInAgentRoutePaths\n .filter((path) => !projectRoutePatterns.has(routePatternKey(path)))\n .map((path) => ({\n path,\n moduleSpecifier: builtInAgentRouteModule,\n }))\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 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): 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)\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 audience: AuthSessionAudience\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: { audience: config.audience, enabled: config.authEnabled },\n ...(existingConfig ? JSON.parse(existingConfig) : {}),\n ...(config.apiBaseUrl\n ? {\n api: { baseUrl: config.apiBaseUrl },\n auth: { audience: config.audience, 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(request: Request, html: string): 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 },\n })\n}\n\nfunction sharedHtmlResponse(\n request: Request,\n html: string,\n apiBaseUrl: string | undefined\n): Response {\n const secured = secureSharedHtml(html, request, { apiBaseUrl })\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\nfunction secureSharedHtml(\n html: string,\n request: Request,\n options: { readonly apiBaseUrl?: string }\n): { readonly html: string; readonly headers: Record<string, string> } {\n const nonce = randomBytes(18).toString(\"base64url\")\n const requestOrigin = new URL(request.url).origin\n let apiOrigin = requestOrigin\n try {\n apiOrigin = new URL(options.apiBaseUrl ?? requestOrigin, requestOrigin).origin\n } catch {\n // The browser client reports an invalid runtime URL. Keep the document policy fail-closed.\n }\n\n const apiSources = apiOrigin === requestOrigin ? [] : [apiOrigin]\n const connectSources = [\"'self'\", ...apiSources]\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 \"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. Their contents can never change\n// under the same URL, so they are safe to cache forever. Files copied from `public/` keep their\n// names across deploys and stay uncached.\nconst IMMUTABLE_ASSET_PATTERN =\n /^(?:(?:app|shared|chunk)-[a-z0-9]+|(?:chunk|asset)-.+-[a-z0-9]+)\\.[a-z0-9]+(?:\\.map)?$/\n\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\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: { readonly shellRoute?: string; readonly transformHtml?: (html: string) => string } = {}\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 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
- "import { 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\"\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\n const outputs = [...result.outputs]\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],\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],\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\nfunction withLoadingShell(html: string): string {\n const styles = `<style data-sixb-loading-shell>\n .sixb-loading-shell{position:fixed;inset:0;display:grid;place-items:center;background:#fff;color:#71717a}\n .sixb-loading-spinner{width:1.25rem;height:1.25rem;border:2px solid currentColor;border-right-color:transparent;border-radius:9999px;animation:sixb-loading-spin .7s linear infinite}\n @media(prefers-color-scheme:dark){.sixb-loading-shell{background:#09090b;color:#a1a1aa}}\n @media(prefers-reduced-motion:reduce){.sixb-loading-spinner{animation-duration:1.5s}}\n @keyframes sixb-loading-spin{to{transform:rotate(360deg)}}\n </style>`\n const root =\n '<div id=\"root\"><div class=\"sixb-loading-shell\" role=\"status\" aria-label=\"Loading application\"><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\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
- "import { access, mkdir, readFile, writeFile } from \"node:fs/promises\"\nimport { join, relative, resolve } from \"node:path\"\nimport type { AuthSessionAudience } from \"@sixb/core\"\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\"\n\nexport interface BuiltInRouteManifestEntry {\n readonly path: string\n readonly moduleSpecifier: string\n readonly exportName?: string\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 — matching how Atlas routes.\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((route, index) => {\n if (route.exportName) {\n return `import { ${route.exportName} as BuiltInPage${index} } from ${JSON.stringify(route.moduleSpecifier)}`\n }\n\n return `import 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 content = `${importEntries}\n\nexport const routePaths = ${JSON.stringify(routePaths, null, 2)} as const\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/auth\"\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() {\n submit(\"confirmSignIn\")\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 audience?: AuthSessionAudience\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 } = {}\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 layoutImport = hasLayout ? `import RootLayout from ${JSON.stringify(layoutRel)}\\n` : \"\"\n const layoutWrapperStart = hasLayout ? \"<RootLayout>\" : \"<>\"\n const layoutWrapperEnd = hasLayout ? \"</RootLayout>\" : \"</>\"\n const runtimeConfigScript = options.apiBaseUrl\n ? renderCustomAppRuntimeScript({\n api: { baseUrl: options.apiBaseUrl },\n auth: { audience: options.audience ?? \"app\", 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 { signOut } from \"@sixb/client\"\nimport {\n BrowserRouter,\n matchPath,\n useLocation,\n useNavigate,\n useRoutes,\n} from \"react-router-dom\"\nimport { QueryClient, QueryClientProvider, useQuery } from \"@tanstack/react-query\"\nimport { isSixbApiError } from \"@sixb/client/browser\"\nimport { getProjectInfoOptions } from \"@sixb/client/hooks\"\nimport { LocaleProvider, useAppMessages } from \"@sixb/app/locale\"\nimport { 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}\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 = [\"/api\", \"/auth\", \"/ws\", \"/docs\", \"/shared\"]\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\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: \"2rem\",\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\nfunction AccessDeniedView() {\n const messages = useAppMessages().accessDenied\n const [isSigningOut, setIsSigningOut] = React.useState(false)\n\n async function handleSignOut() {\n setIsSigningOut(true)\n try {\n await signOut({ throwOnError: true })\n window.location.reload()\n } catch {\n setIsSigningOut(false)\n }\n }\n\n return (\n <AppFallback\n title={messages.title}\n detail={messages.detail}\n showReload={false}\n action={\n <button\n type=\"button\"\n disabled={isSigningOut}\n onClick={handleSignOut}\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: isSigningOut ? \"default\" : \"pointer\",\n }}\n >\n {isSigningOut ? messages.signingOut : messages.signOut}\n </button>\n }\n />\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\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 <ProjectLocale shared={Boolean(basename)}>\n <BrowserRouter basename={basename}>\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 </ProjectLocale>\n </QueryClientProvider>\n )\n}\n\nexport function startApp(options: StartAppOptions = {}) {\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: these speak the browser's language.\nexport function renderAccessDenied() {\n getRoot().render(\n <LocaleProvider>\n <AccessDeniedView />\n </LocaleProvider>\n )\n}\n\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 return (\n <AppFallback\n title={messages.apiUnavailable.title}\n 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 // 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} from \"@sixb/client/browser\"\nimport { renderAccessDenied, renderApiUnavailable, startApp } from \"./app-runtime\"\n\nconst runtimeConfig = readSixbBrowserRuntimeConfig({ audience: \"app\" })\nconst browserClient = configureSixbBrowserClient(runtimeConfig)\n\nif (import.meta.hot) {\n import.meta.hot.accept()\n import.meta.hot.dispose(() => browserClient.dispose())\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 && authSession.applicationAccess.allowed)\n) {\n startApp()\n} else if (authSession?.authenticated === true && !authSession.applicationAccess.allowed) {\n renderAccessDenied()\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 readSixbBrowserRuntimeConfig,\n type SixbSharedBrowserClientController,\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\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 if (!isValidBootstrap(bootstrap)) {\n renderSharedFallback(\"unavailable\")\n return\n }\n const { basename, grantId } = bootstrap\n let loadAppStyles = options.loadAppStyles\n\n activeController?.dispose()\n let controller: SixbSharedBrowserClientController\n try {\n const runtimeConfig = readSixbBrowserRuntimeConfig({\n audience: \"app\",\n authEnabled: false,\n })\n controller = configureSixbSharedBrowserClient(runtimeConfig, {\n grantId,\n })\n activeController = controller\n } catch {\n renderSharedFallback(\"unavailable\")\n return\n }\n\n let secret = bootstrap.secret\n let canonicalDestinationPath: string | null = null\n let appStylesLoaded = 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 // 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 })\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 {\n renderSharedFallback(\"unavailable\")\n }\n } finally {\n pending = false\n }\n }\n\n void open()\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 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: { audience: \"app\", 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\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 ' <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",
8
- "import type { ResolvedAppMetadata, ResolvedManifestIcon } from \"./metadata\"\n\ninterface CustomAppManifest {\n readonly id: \"/\"\n readonly name: string\n readonly description?: string\n readonly start_url: \"/\"\n readonly scope: \"/\"\n readonly display: \"standalone\"\n readonly theme_color: string\n readonly background_color: string\n readonly icons?: readonly ResolvedManifestIcon[]\n}\n\nexport function renderAppManifest(metadata: ResolvedAppMetadata): string {\n const manifest: CustomAppManifest = {\n id: \"/\",\n name: metadata.title,\n ...(metadata.description ? { description: metadata.description } : {}),\n start_url: \"/\",\n scope: \"/\",\n display: \"standalone\",\n theme_color: metadata.themeColor,\n background_color: metadata.backgroundColor,\n ...(metadata.icons.length > 0 ? { icons: metadata.icons } : {}),\n }\n\n return `${JSON.stringify(manifest, null, 2)}\\n`\n}\n",
9
- "import { createHash } from \"node:crypto\"\nimport { readFile, stat } from \"node:fs/promises\"\nimport { createRequire } from \"node:module\"\nimport { extname, join } from \"node:path\"\nimport { pathToFileURL } from \"node:url\"\n\nexport interface AppMetadata {\n title?: string\n description?: string\n favicon?: string\n themeColor?: string\n backgroundColor?: string\n}\n\nexport interface ResolvedManifestIcon {\n readonly src: string\n readonly sizes?: string\n readonly type?: string\n readonly purpose?: \"any\" | \"maskable\"\n}\n\nexport interface ResolvedAppMetadata {\n readonly title: string\n readonly description?: string\n readonly favicon?: string\n readonly themeColor: string\n readonly backgroundColor: string\n readonly appleTouchIcon?: string\n readonly icons: readonly ResolvedManifestIcon[]\n}\n\nexport interface ResolveAppMetadataOptions {\n readonly layoutPath: string\n readonly publicDir: string\n}\n\nconst metadataRequire = createRequire(import.meta.url)\n\nconst metadataFields = [\n \"title\",\n \"description\",\n \"favicon\",\n \"themeColor\",\n \"backgroundColor\",\n] as const satisfies readonly (keyof AppMetadata)[]\n\n/** Loads, validates, defaults, and resolves all custom-app identity in one place. */\nexport async function resolveAppMetadata(\n options: ResolveAppMetadataOptions\n): Promise<ResolvedAppMetadata> {\n const configured = await loadConfiguredMetadata(options.layoutPath)\n validateMetadata(configured, options.layoutPath)\n\n const conventionalFaviconPath = join(options.publicDir, \"favicon.svg\")\n const favicon =\n configured.favicon ?? ((await fileExists(conventionalFaviconPath)) ? \"/favicon.svg\" : undefined)\n const themeColor = configured.themeColor ?? configured.backgroundColor ?? \"#ffffff\"\n const backgroundColor = configured.backgroundColor ?? themeColor\n const icons: ResolvedManifestIcon[] = []\n\n if (await fileExists(join(options.publicDir, \"icon-192.png\"))) {\n icons.push({\n src: \"/icon-192.png\",\n sizes: \"192x192\",\n type: \"image/png\",\n purpose: \"any\",\n })\n }\n if (await fileExists(join(options.publicDir, \"icon-512.png\"))) {\n icons.push({\n src: \"/icon-512.png\",\n sizes: \"512x512\",\n type: \"image/png\",\n purpose: \"any\",\n })\n }\n if (await fileExists(join(options.publicDir, \"icon-maskable-512.png\"))) {\n icons.push({\n src: \"/icon-maskable-512.png\",\n sizes: \"512x512\",\n type: \"image/png\",\n purpose: \"maskable\",\n })\n }\n\n const hasStandardIcon = icons.some((icon) => icon.purpose === \"any\")\n if (!hasStandardIcon && favicon) {\n const type = inferImageMimeType(favicon)\n if (type) {\n icons.push({\n src: favicon,\n ...(type === \"image/svg+xml\" ? { sizes: \"any\" } : {}),\n type,\n purpose: \"any\",\n })\n }\n }\n\n return {\n title: configured.title ?? \"Sixb\",\n ...(configured.description ? { description: configured.description } : {}),\n ...(favicon ? { favicon } : {}),\n themeColor,\n backgroundColor,\n ...((await fileExists(join(options.publicDir, \"apple-touch-icon.png\")))\n ? { appleTouchIcon: \"/apple-touch-icon.png\" }\n : {}),\n icons,\n }\n}\n\nasync function loadConfiguredMetadata(layoutPath: string): Promise<AppMetadata> {\n if (!(await fileExists(layoutPath))) {\n return {}\n }\n\n try {\n const sourceHash = createHash(\"sha256\")\n .update(await readFile(layoutPath))\n .digest(\"hex\")\n const url = pathToFileURL(layoutPath)\n // Bun currently canonicalizes file-URL query strings in its module cache.\n // Explicit invalidation makes the source fingerprint a reliable dev cache\n // buster while retaining a normal file URL and relative import behavior.\n delete metadataRequire.cache[metadataRequire.resolve(layoutPath)]\n url.searchParams.set(\"sixb-metadata\", sourceHash)\n const layoutModule = (await import(url.href)) as { readonly metadata?: unknown }\n\n if (layoutModule.metadata === undefined) {\n return {}\n }\n if (\n typeof layoutModule.metadata !== \"object\" ||\n layoutModule.metadata === null ||\n Array.isArray(layoutModule.metadata)\n ) {\n throw metadataError(layoutPath, \"the named metadata export must be an object\")\n }\n\n return layoutModule.metadata as AppMetadata\n } catch (error) {\n if (error instanceof Error && error.message.startsWith(\"[SixbCustomApp]\")) {\n throw error\n }\n\n const detail = error instanceof Error ? error.message : String(error)\n throw new Error(\n `[SixbCustomApp] Could not load metadata from ${layoutPath}: ${detail}. ` +\n \"App metadata is build-time configuration, so app/layout.tsx must be import-safe in Bun \" +\n \"and must not access window or document at module scope.\"\n )\n }\n}\n\nfunction validateMetadata(metadata: AppMetadata, layoutPath: string): void {\n for (const field of metadataFields) {\n const value = metadata[field]\n if (value !== undefined && (typeof value !== \"string\" || value.trim().length === 0)) {\n throw metadataError(layoutPath, `metadata.${field} must be a non-empty string when provided`)\n }\n }\n}\n\nfunction metadataError(layoutPath: string, detail: string): Error {\n return new Error(`[SixbCustomApp] Invalid app metadata in ${layoutPath}: ${detail}`)\n}\n\nfunction inferImageMimeType(url: string): string | undefined {\n if (url.startsWith(\"data:\")) {\n const match = /^data:(image\\/[a-z0-9.+-]+)/i.exec(url)\n return match?.[1]?.toLowerCase()\n }\n\n let pathname = url\n try {\n pathname = new URL(url, \"https://sixb.invalid\").pathname\n } catch {\n // Fall back to extension parsing on the configured value.\n }\n\n switch (extname(pathname).toLowerCase()) {\n case \".svg\":\n return \"image/svg+xml\"\n case \".png\":\n return \"image/png\"\n case \".ico\":\n return \"image/x-icon\"\n case \".jpg\":\n case \".jpeg\":\n return \"image/jpeg\"\n case \".webp\":\n return \"image/webp\"\n case \".avif\":\n return \"image/avif\"\n default:\n return undefined\n }\n}\n\nasync function fileExists(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isFile()\n } catch {\n return false\n }\n}\n",
10
- "import type { AuthSessionAudience } from \"@sixb/core\"\n\nexport interface CustomAppRuntimeConfig {\n readonly publicEnv?: Readonly<Record<string, string | undefined>>\n readonly api?: {\n readonly baseUrl: string\n }\n readonly auth: {\n readonly audience: AuthSessionAudience\n readonly enabled: boolean\n }\n}\n\nexport function collectPublicEnv(): Record<string, string> {\n return Object.fromEntries(\n Object.entries(process.env).filter(\n (entry): entry is [string, string] =>\n entry[0].startsWith(\"SIXB_PUBLIC_\") && entry[1] !== undefined\n )\n )\n}\n\nexport function renderCustomAppRuntimeScript(config: CustomAppRuntimeConfig): string {\n const safeConfig = JSON.stringify(config).replaceAll(\"<\", \"\\\\u003c\")\n return `<script>window.__SIXB_RUNTIME__ = ${safeConfig};</script>`\n}\n",
11
- "import { readdir } from \"node:fs/promises\"\nimport { join, relative } from \"node:path\"\n\nconst dynamicSegmentPattern = /^\\[([\\w-]+)\\]$/\nconst reservedRoutePrefixes = [\"/api\", \"/auth\", \"/ws\", \"/docs\", \"/__sixb\", \"/shared\"] as const\nconst reservedRoutePaths = new Set([\"/app.webmanifest\"])\n\nexport interface PageRoute {\n /** React Router path, e.g. \"/\" or \"/remote/:id\" */\n path: string\n /** Absolute file path */\n filePath: string\n /** Relative path from the app directory, e.g. \"remote/[id]/page.tsx\" */\n relativePath: string\n}\n\nexport interface AppRouteLayout {\n /** React Router prefix owned by this layout, e.g. \"/remote/:id\". */\n path: string\n /** Absolute file path. */\n filePath: string\n /** Relative path from the app directory, e.g. \"remote/[id]/layout.tsx\". */\n relativePath: string\n}\n\nexport interface AppRouteDiscovery {\n readonly pages: readonly PageRoute[]\n /** Descendant layouts only. The root layout remains the global app wrapper. */\n readonly layouts: readonly AppRouteLayout[]\n}\n\n/**\n * Recursively scans an `app/` directory for page modules and descendant layouts.\n *\n * - `app/page.tsx` -> page `/`\n * - `app/about/page.tsx` -> page `/about`\n * - `app/remote/[id]/page.tsx` -> page `/remote/:id`\n * - `app/remote/[id]/layout.tsx` -> layout `/remote/:id/**`\n * - `app/layout.tsx` remains the global wrapper and is not returned as a route layout.\n * - Files and folders starting with `_` are skipped.\n */\nexport async function scanAppRoutes(appDir: string): Promise<AppRouteDiscovery> {\n const pages: PageRoute[] = []\n const layouts: AppRouteLayout[] = []\n await walkDir(appDir, appDir, pages, layouts)\n pages.sort(compareRouteModules)\n layouts.sort(compareRouteModules)\n return { pages, layouts }\n}\n\n/** Preserve the existing flat inspection contract while route generation uses the richer scan. */\nexport async function scanPages(appDir: string): Promise<PageRoute[]> {\n return [...(await scanAppRoutes(appDir)).pages]\n}\n\n/** Treat parameter names as labels when comparing route ownership and overrides. */\nexport function routePatternKey(path: string): string {\n if (path === \"/\") return \"/\"\n const segments = routeSegments(path).map((segment) =>\n segment.startsWith(\":\") ? \":\" : segment.toLowerCase()\n )\n return `/${segments.join(\"/\")}`\n}\n\nasync function walkDir(\n dir: string,\n appDir: string,\n pages: PageRoute[],\n layouts: AppRouteLayout[]\n): Promise<void> {\n const entries = await readDirectory(dir)\n if (!entries) return\n\n const visibleEntries = entries\n .filter((entry) => !String(entry.name).startsWith(\"_\"))\n .sort((a, b) => compareText(String(a.name), String(b.name)))\n const relativeDir = normalizeRelativePath(relative(appDir, dir))\n\n validateChildDirectories(visibleEntries, relativeDir)\n\n const pageEntries = visibleEntries.filter(\n (entry) => entry.isFile() && (entry.name === \"page.tsx\" || entry.name === \"page.ts\")\n )\n if (pageEntries.length > 1) {\n const modules = pageEntries.map((entry) => displayAppPath(join(relativeDir, entry.name)))\n throw new Error(\n `[SixbCustomApp] Conflicting page modules for route '${directoryRoutePath(relativeDir)}': ${modules.join(\" and \")}. Keep exactly one of page.tsx or page.ts.`\n )\n }\n\n const pageEntry = pageEntries[0]\n if (pageEntry) {\n const relativePath = normalizeRelativePath(join(relativeDir, pageEntry.name))\n const path = directoryRoutePath(relativeDir)\n assertRouteIsAvailable(path, relativePath)\n pages.push({ path, filePath: join(dir, pageEntry.name), relativePath })\n }\n\n if (relativeDir) {\n const layoutEntry = visibleEntries.find(\n (entry) => entry.isFile() && entry.name === \"layout.tsx\"\n )\n if (layoutEntry) {\n layouts.push({\n path: directoryRoutePath(relativeDir),\n filePath: join(dir, layoutEntry.name),\n relativePath: normalizeRelativePath(join(relativeDir, layoutEntry.name)),\n })\n }\n }\n\n for (const entry of visibleEntries) {\n if (!entry.isDirectory()) continue\n // `app/public/` is the static asset root, never part of the file router.\n if (!relativeDir && entry.name === \"public\") continue\n await walkDir(join(dir, entry.name), appDir, pages, layouts)\n }\n}\n\nasync function readDirectory(dir: string): Promise<import(\"node:fs\").Dirent[] | null> {\n try {\n return (await readdir(dir, { withFileTypes: true })) as import(\"node:fs\").Dirent[]\n } catch (error) {\n if (isNotFoundError(error)) return null\n throw error\n }\n}\n\nfunction validateChildDirectories(\n entries: readonly import(\"node:fs\").Dirent[],\n relativeDir: string\n): void {\n const claimedSegments = new Map<string, string>()\n\n for (const entry of entries) {\n if (!entry.isDirectory()) continue\n if (!relativeDir && entry.name.toLowerCase() === \"shared\") {\n throw new Error(\n \"[SixbCustomApp] app/shared is reserved for framework-managed shared links. \" +\n \"Move this page to another route.\"\n )\n }\n const segment = routeSegment(entry.name, join(relativeDir, entry.name))\n const key = segment.startsWith(\":\") ? \":\" : segment.toLowerCase()\n const existing = claimedSegments.get(key)\n if (existing && existing !== entry.name) {\n const parent = relativeDir ? displayAppPath(relativeDir) : \"app/\"\n throw new Error(\n `[SixbCustomApp] Ambiguous route directories '${existing}' and '${entry.name}' under ${parent}. They match the same URL segment.`\n )\n }\n claimedSegments.set(key, entry.name)\n }\n}\n\nfunction directoryRoutePath(relativeDir: string): string {\n if (!relativeDir) return \"/\"\n return `/${relativeDir\n .split(\"/\")\n .map((segment) => routeSegment(segment, relativeDir))\n .join(\"/\")}`\n}\n\nfunction routeSegment(segment: string, relativePath: string): string {\n const dynamic = dynamicSegmentPattern.exec(segment)\n if (dynamic) return `:${dynamic[1]}`\n\n if (segment.includes(\"[\") || segment.includes(\"]\")) {\n throw new Error(\n `[SixbCustomApp] Invalid dynamic route directory ${displayAppPath(relativePath)}. Use one name such as '[id]'; catch-all and partial dynamic segments are not supported.`\n )\n }\n if (segment.includes(\"(\") || segment.includes(\")\")) {\n throw new Error(\n `[SixbCustomApp] Invalid route directory ${displayAppPath(relativePath)}. Route groups are not supported yet; use a normal directory name.`\n )\n }\n if (/[:*?]/.test(segment)) {\n throw new Error(\n `[SixbCustomApp] Invalid route directory ${displayAppPath(relativePath)}. Use '[name]' for a dynamic segment; ':', '*' and '?' are reserved by React Router.`\n )\n }\n\n return segment\n}\n\nfunction assertRouteIsAvailable(path: string, relativePath: string): void {\n const normalizedPath = path.toLowerCase()\n const reserved =\n reservedRoutePaths.has(normalizedPath) ||\n reservedRoutePrefixes.some(\n (prefix) => normalizedPath === prefix || normalizedPath.startsWith(`${prefix}/`)\n )\n if (!reserved) return\n\n throw new Error(\n `[SixbCustomApp] Page ${displayAppPath(relativePath)} resolves to reserved framework path '${path}'. Choose a route outside /api, /auth, /ws, /docs, /__sixb, /shared, and /app.webmanifest.`\n )\n}\n\nfunction routeSegments(path: string): string[] {\n return path === \"/\" ? [] : path.replace(/^\\/+|\\/+$/g, \"\").split(\"/\")\n}\n\nfunction normalizeRelativePath(path: string): string {\n return path\n .split(\"\\\\\")\n .join(\"/\")\n .replace(/^\\.\\/$/, \"\")\n}\n\nfunction displayAppPath(path: string): string {\n const normalized = normalizeRelativePath(path)\n return normalized ? `app/${normalized}` : \"app/\"\n}\n\nfunction compareRouteModules(\n a: Pick<PageRoute, \"path\" | \"relativePath\">,\n b: Pick<PageRoute, \"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\nfunction isNotFoundError(error: unknown): boolean {\n if (!(error instanceof Error)) return false\n const code = (error as NodeJS.ErrnoException).code\n return code === \"ENOENT\" || code === \"ENOTDIR\"\n}\n",
12
- "/** Served only by development browser servers; the CLI marks a generation ready last. */\nexport function devReloadResponse(request: Request): Response {\n const generation = process.env.SIXB_DEV_GENERATION\n const headers = new Headers({\n \"content-type\": \"text/javascript; charset=utf-8\",\n \"cache-control\": \"no-store\",\n })\n if (generation && process.env.SIXB_DEV_READY === \"1\") {\n headers.set(\"x-sixb-dev-generation\", generation)\n }\n if (request.method === \"HEAD\") return new Response(null, { headers })\n const script = generation\n ? `(() => {\n if (window.__sixbDevReload) return;\n window.__sixbDevReload = true;\n const generation = ${JSON.stringify(generation).replaceAll(\"<\", \"\\\\u003c\")};\n let timer;\n let checking = false;\n let finished = false;\n let failures = 0;\n const hidden = () => document.visibilityState === \"hidden\";\n function schedule(delay) {\n clearTimeout(timer);\n timer = setTimeout(poll, delay);\n }\n async function poll() {\n if (checking || finished) return;\n if (hidden()) { schedule(15000); return; }\n checking = true;\n try {\n const response = await fetch(\"/__sixb/dev-reload.js\", {\n method: \"HEAD\", cache: \"no-store\", signal: AbortSignal.timeout(3000)\n });\n const next = response.headers.get(\"x-sixb-dev-generation\");\n if (response.ok && next && next !== generation) {\n finished = true;\n document.removeEventListener(\"visibilitychange\", visible);\n location.reload();\n return;\n }\n failures = response.ok && next ? 0 : Math.min(failures + 1, 4);\n } catch { failures = Math.min(failures + 1, 4); }\n finally { checking = false; }\n schedule(Math.min(1000 * 2 ** failures, 10000));\n }\n function visible() {\n if (!hidden()) { clearTimeout(timer); void poll(); }\n }\n document.addEventListener(\"visibilitychange\", visible);\n void poll();\n })();`\n : \"\"\n return new Response(script, { headers })\n}\n",
13
- "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",
14
- "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. `[SixbAtlas]`. */\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 * Shared Tailwind v4 CSS build pipeline used by the built-in UI (Atlas) and\n * custom apps. Owns CLI resolution, source-detection scoping,\n * debounced/queued rebuilds, error formatting, and watch lifecycle 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"
5
+ "/**\n * Everything `@sixb/app` offers code in a project's `app/` directory.\n *\n * One module for both places that code runs: the browser bundle, and Bun when the build imports\n * `app/layout.tsx` to read its exports. Nothing here may need Node or Bun, and nothing may touch\n * `window` or `document` at module scope. The CLI's tooling lives in `@sixb/app/server`.\n *\n * Components and data stay where they live: `@sixb/ui` for the design system and `@sixb/client`\n * for the API. This entry never re-exports them, so each name has one import path.\n */\n\nexport { agentContext } from \"@sixb/core/agents/context\"\nexport type { ModelReasoningLevel } from \"@sixb/core/models\"\nexport { AgentContextProvider, useAgentContext } from \"./agent/agent-context-provider\"\nexport { AgentPanel, type AgentPanelProps } from \"./agent/agent-panel\"\nexport { AgentSurface, type AgentSurfaceMode, type AgentSurfaceProps } from \"./agent/agent-surface\"\nexport { setAgentSurfaceMode } from \"./agent/agent-surface-state\"\nexport { Composer, type ComposerProps } from \"./agent/components/composer\"\nexport type {\n AgentDocumentPreviewRenderer,\n AgentDocumentPreviewRendererProps,\n} from \"./agent/document-preview/types\"\nexport { AgentChatPage, type AgentChatPageProps } from \"./agent/react-router\"\nexport type { LanguageModel } from \"./agent/types\"\nexport { AgentWorkspaceProvider, type AgentWorkspaceProviderProps } from \"./agent/workspace\"\nexport type { AuthExperienceActions, AuthExperienceProps, AuthExperienceState } from \"./auth\"\nexport type { AppMetadata } from \"./metadata\"\nexport { SyncButton, type SyncButtonProps } from \"./pages/data/sync-button\"\nexport { publicEnv } from \"./public-env\"\nexport type { AppSectionId } from \"./sections/catalog\"\nexport {\n type AppSection,\n type AppVisibility,\n useCurrentSection,\n useSections,\n} from \"./sections/sections\"\nexport { type CurrentUser, useCurrentUser, useSignOut } from \"./session\"\nexport { AgentDock } from \"./shell/agent-dock\"\nexport {\n AppShell,\n type AppShellProps,\n AppShellProvider,\n type AppShellProviderProps,\n} from \"./shell/app-shell\"\nexport { Brand, type BrandProps } from \"./shell/brand\"\nexport {\n type NavEntry,\n type NavGroup,\n type NavItem,\n NavItems,\n type NavItemsProps,\n} from \"./shell/nav-items\"\nexport { SearchCommand, type SearchCommandProps } from \"./shell/search-command\"\nexport { SectionNav, type SectionNavProps } from \"./shell/section-nav\"\nexport { UserMenu, type UserMenuItemProps, type UserMenuProps } from \"./shell/user-menu\"\n",
6
+ "import type { AgentContextInput } from \"@sixb/core/agents/context\"\nimport { cn } from \"@sixb/ui/lib/utils\"\nimport { type ReactNode, useCallback, useState } from \"react\"\nimport { AgentChat } from \"./agent-chat\"\nimport { useRegisteredAgentContext } from \"./agent-context-provider\"\nimport type { AgentDocumentPreviewRenderer } from \"./document-preview/types\"\n\nexport interface AgentPanelProps {\n /** Omitted uses AgentContextProvider; provided is the complete controlled ambient list. */\n readonly context?: readonly AgentContextInput[]\n /** Controlled thread id. Omit to let the panel own its current thread. */\n readonly threadId?: string | null\n readonly defaultThreadId?: string | null\n readonly onThreadChange?: (threadId: string | null) => void\n readonly onNewThread?: () => void\n /** Optional modeless document canvas owned by an enclosing application shell. */\n readonly documentPreviewHost?: HTMLElement | null\n /** Keep documents beside the chat on desktop instead of opening a modal. */\n readonly splitDocumentPreview?: boolean\n readonly conversationHeaderActions?: ReactNode\n readonly composerPlaceholder?: string\n readonly compact?: boolean\n readonly className?: string\n /** Centered content for an empty conversation. Omit for the agent identity; null hides it. */\n readonly welcomeContent?: ReactNode\n /** Additional file viewers supplied by the host application. */\n readonly documentPreviewRenderers?: readonly AgentDocumentPreviewRenderer[]\n}\n\n/** Embeddable chat that never reads or changes the host application's route. */\nexport function AgentPanel({\n context,\n threadId: controlledThreadId,\n defaultThreadId = null,\n onThreadChange,\n onNewThread,\n documentPreviewHost,\n splitDocumentPreview,\n conversationHeaderActions,\n composerPlaceholder,\n compact = true,\n className,\n welcomeContent,\n documentPreviewRenderers,\n}: AgentPanelProps) {\n const registeredContext = useRegisteredAgentContext()\n const ambientContext = context === undefined ? registeredContext : context\n const controlled = controlledThreadId !== undefined\n const [localThreadId, setLocalThreadId] = useState<string | null>(defaultThreadId)\n const threadId = controlled ? controlledThreadId : localThreadId\n\n const changeThread = useCallback(\n (nextThreadId: string | null) => {\n if (!controlled) setLocalThreadId(nextThreadId)\n onThreadChange?.(nextThreadId)\n },\n [controlled, onThreadChange]\n )\n\n return (\n <AgentChat\n threadId={threadId}\n ambientContext={ambientContext}\n compact={compact}\n documentPreviewHost={documentPreviewHost}\n splitDocumentPreview={splitDocumentPreview}\n conversationHeaderActions={conversationHeaderActions}\n composerPlaceholder={composerPlaceholder}\n welcomeContent={welcomeContent}\n onNavigateHome={() => {\n changeThread(null)\n onNewThread?.()\n }}\n onNavigateThread={changeThread}\n documentPreviewRenderers={documentPreviewRenderers}\n className={cn(\"min-h-0 overflow-hidden bg-background\", className)}\n />\n )\n}\n",
7
+ "import type { AgentContextInput } from \"@sixb/core/agents/context\"\nimport { Button } from \"@sixb/ui/components\"\nimport { cn } from \"@sixb/ui/lib/utils\"\nimport { ChevronRight, Maximize2, MessageSquareText, Minimize2 } from \"lucide-react\"\nimport {\n type CSSProperties,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport { AgentPanel } from \"./agent-panel\"\nimport {\n AGENT_SURFACE_STATE_EVENT,\n type AgentSurfaceMode,\n type AgentSurfaceSessionState,\n type AgentSurfaceStateDetail,\n agentSurfaceSessionStorageKey,\n clampAgentSurfaceWidth,\n DEFAULT_AGENT_SURFACE_WIDTH,\n MAX_AGENT_SURFACE_WIDTH,\n MIN_AGENT_SURFACE_WIDTH,\n readAgentSurfaceState,\n writeAgentSurfaceState,\n} from \"./agent-surface-state\"\nimport { useAgentMessages } from \"./i18n\"\n\nexport type { AgentSurfaceMode } from \"./agent-surface-state\"\n\nexport interface AgentSurfaceProps {\n /** Controlled presentation. Omit to persist an independent value in this browser tab. */\n readonly mode?: AgentSurfaceMode\n readonly defaultMode?: AgentSurfaceMode\n readonly onModeChange?: (mode: AgentSurfaceMode) => void\n /** Present this same session as the host route's full-page conversation. */\n readonly fullPage?: boolean\n /** Ask the host to navigate from the dock to its full-page conversation route. */\n readonly onRequestFullPage?: () => void\n /** Ask the host to leave its full-page conversation route while keeping the dock open. */\n readonly onRequestDock?: () => void\n readonly title?: string\n readonly launcherLabel?: string\n readonly composerPlaceholder?: string\n readonly context?: readonly AgentContextInput[]\n /** Controlled thread. The latest value is still remembered for a later dock transition. */\n readonly threadId?: string | null\n readonly defaultThreadId?: string | null\n readonly onThreadChange?: (threadId: string | null) => void\n /** Offer an explicit full-page view for the selected thread. */\n readonly onExpandThread?: (threadId: string) => void\n /** Controlled dock width. Numeric values are pixels. */\n readonly dockWidth?: CSSProperties[\"width\"]\n readonly defaultDockWidth?: number\n readonly onDockWidthChange?: (width: number) => void\n readonly minDockWidth?: number\n readonly maxDockWidth?: number\n readonly resizable?: boolean\n /** sessionStorage key override. Pass false to disable per-tab persistence. */\n readonly persistenceKey?: string | false\n readonly className?: string\n readonly panelClassName?: string\n /** Centered content for an empty conversation. Omit for the agent identity; null hides it. */\n readonly welcomeContent?: ReactNode\n}\n\n/**\n * One continuously mounted agent session that can fill the page, sit beside an app, or collapse.\n * Its uncontrolled mode, width, and selected thread are session-scoped so refreshes preserve them\n * without coupling separate browser tabs or the host application's URL.\n */\nexport function AgentSurface({\n mode,\n defaultMode = \"dock\",\n onModeChange,\n fullPage = false,\n onRequestFullPage,\n onRequestDock,\n title,\n launcherLabel,\n composerPlaceholder,\n context,\n threadId,\n defaultThreadId = null,\n onThreadChange,\n onExpandThread,\n dockWidth,\n defaultDockWidth = DEFAULT_AGENT_SURFACE_WIDTH,\n onDockWidthChange,\n minDockWidth = MIN_AGENT_SURFACE_WIDTH,\n maxDockWidth = MAX_AGENT_SURFACE_WIDTH,\n resizable = true,\n persistenceKey,\n className,\n panelClassName,\n welcomeContent,\n}: AgentSurfaceProps) {\n const messages = useAgentMessages().surface\n const surfaceTitle = title ?? messages.title\n const launcher = launcherLabel ?? messages.open\n const minimumWidth = Math.min(minDockWidth, maxDockWidth)\n const maximumWidth = Math.max(minDockWidth, maxDockWidth)\n const storageKey = agentSurfaceSessionStorageKey(persistenceKey)\n const defaults: AgentSurfaceSessionState = {\n mode: defaultMode,\n dockWidth: clampAgentSurfaceWidth(defaultDockWidth, minimumWidth, maximumWidth),\n threadId: defaultThreadId,\n }\n const [sessionState, setSessionState] = useState(() =>\n readAgentSurfaceState(storageKey, defaults, minimumWidth, maximumWidth)\n )\n const [documentHost, setDocumentHost] = useState<HTMLDivElement | null>(null)\n const [resizing, setResizing] = useState(false)\n const resizeStart = useRef<{\n readonly pointerId: number\n readonly clientX: number\n readonly width: number\n } | null>(null)\n\n useEffect(() => {\n writeAgentSurfaceState(storageKey, sessionState)\n }, [storageKey, sessionState])\n\n useEffect(() => {\n if (!storageKey || typeof window === \"undefined\") return\n\n const receiveState = (event: Event) => {\n const detail = (event as CustomEvent<AgentSurfaceStateDetail>).detail\n if (detail?.storageKey !== storageKey) return\n setSessionState(detail.state)\n }\n\n window.addEventListener(AGENT_SURFACE_STATE_EVENT, receiveState)\n return () => window.removeEventListener(AGENT_SURFACE_STATE_EVENT, receiveState)\n }, [storageKey])\n\n const currentMode = mode ?? sessionState.mode\n const currentThreadId = threadId === undefined ? sessionState.threadId : threadId\n const currentDockWidth = dockWidth ?? sessionState.dockWidth\n const numericDockWidth =\n typeof currentDockWidth === \"number\" ? currentDockWidth : sessionState.dockWidth\n const visible = fullPage || currentMode !== \"collapsed\"\n const presentation = fullPage ? \"full\" : currentMode\n const dockWidthValue =\n typeof currentDockWidth === \"number\" ? `${currentDockWidth}px` : currentDockWidth\n const surfaceStyle = { \"--agent-surface-width\": dockWidthValue } as CSSProperties\n\n const changeMode = useCallback(\n (nextMode: AgentSurfaceMode) => {\n if (mode === undefined) {\n setSessionState((current) => ({ ...current, mode: nextMode }))\n }\n onModeChange?.(nextMode)\n },\n [mode, onModeChange]\n )\n\n const changeThread = useCallback(\n (nextThreadId: string | null) => {\n setSessionState((current) =>\n current.threadId === nextThreadId ? current : { ...current, threadId: nextThreadId }\n )\n onThreadChange?.(nextThreadId)\n },\n [onThreadChange]\n )\n\n useEffect(() => {\n if (threadId === undefined) return\n // Remember route changes without overwriting a local selection while navigation is pending.\n setSessionState((current) =>\n current.threadId === threadId ? current : { ...current, threadId }\n )\n }, [threadId])\n\n useEffect(() => {\n if (!fullPage || sessionState.mode === \"dock\") return\n setSessionState((current) => ({ ...current, mode: \"dock\" }))\n }, [fullPage, sessionState.mode])\n\n const changeDockWidth = useCallback(\n (nextWidth: number) => {\n const viewportMaximum =\n typeof window === \"undefined\"\n ? maximumWidth\n : Math.max(minimumWidth, Math.min(maximumWidth, window.innerWidth - minimumWidth))\n const clamped = clampAgentSurfaceWidth(nextWidth, minimumWidth, viewportMaximum)\n if (dockWidth === undefined) {\n setSessionState((current) => ({ ...current, dockWidth: clamped }))\n }\n onDockWidthChange?.(clamped)\n },\n [dockWidth, maximumWidth, minimumWidth, onDockWidthChange]\n )\n\n function startResize(event: PointerEvent<HTMLDivElement>) {\n if (event.button !== 0) return\n event.preventDefault()\n event.currentTarget.setPointerCapture(event.pointerId)\n resizeStart.current = {\n pointerId: event.pointerId,\n clientX: event.clientX,\n width: numericDockWidth,\n }\n setResizing(true)\n }\n\n function continueResize(event: PointerEvent<HTMLDivElement>) {\n const start = resizeStart.current\n if (!start || start.pointerId !== event.pointerId) return\n changeDockWidth(start.width + start.clientX - event.clientX)\n }\n\n function finishResize(event: PointerEvent<HTMLDivElement>) {\n if (resizeStart.current?.pointerId !== event.pointerId) return\n resizeStart.current = null\n setResizing(false)\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId)\n }\n }\n\n function resizeWithKeyboard(event: KeyboardEvent<HTMLDivElement>) {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n event.preventDefault()\n const step = event.shiftKey ? 32 : 16\n changeDockWidth(numericDockWidth + (event.key === \"ArrowLeft\" ? step : -step))\n }\n\n return (\n <>\n {!visible ? (\n <Button\n type=\"button\"\n size=\"icon\"\n className=\"fixed right-5 bottom-5 z-40 size-11 rounded-full shadow-lg max-sm:right-3 max-sm:bottom-3\"\n aria-label={launcher}\n title={launcher}\n onClick={() => changeMode(\"dock\")}\n >\n <MessageSquareText className=\"size-4\" />\n </Button>\n ) : null}\n\n <div\n ref={setDocumentHost}\n data-agent-document-host=\"\"\n aria-hidden={!visible}\n inert={!visible}\n className={cn(\n \"pointer-events-none fixed inset-y-3 left-3 z-40 max-sm:hidden\",\n (!visible || fullPage) && \"hidden\"\n )}\n style={{ right: `calc(${dockWidthValue} + 0.75rem)` }}\n />\n\n <aside\n data-agent-surface={presentation}\n data-agent-surface-resizing={resizing ? \"\" : undefined}\n aria-label={surfaceTitle}\n aria-hidden={!visible}\n inert={!visible}\n style={surfaceStyle}\n className={cn(\n \"shrink-0 overflow-hidden bg-background\",\n fullPage ? \"absolute inset-0 z-40 h-full min-w-0 w-full\" : \"relative h-full\",\n resizing && \"select-none\",\n !visible && \"w-0 border-l border-transparent\",\n visible &&\n !fullPage &&\n \"w-[var(--agent-surface-width)] border-l border-border max-sm:fixed max-sm:inset-y-0 max-sm:right-0 max-sm:z-50 max-sm:w-screen\",\n className\n )}\n >\n {visible && !fullPage && resizable ? (\n <div\n role=\"separator\"\n aria-label={messages.resize}\n aria-orientation=\"vertical\"\n aria-valuemin={minimumWidth}\n aria-valuemax={maximumWidth}\n aria-valuenow={Math.round(numericDockWidth)}\n tabIndex={0}\n onPointerDown={startResize}\n onPointerMove={continueResize}\n onPointerUp={finishResize}\n onPointerCancel={finishResize}\n onKeyDown={resizeWithKeyboard}\n className=\"absolute inset-y-0 left-0 z-30 w-1 cursor-ew-resize touch-none bg-transparent outline-none transition-colors hover:bg-ring/40 focus-visible:bg-ring/60 max-sm:hidden\"\n />\n ) : null}\n\n <div\n className={cn(\n \"relative flex h-full min-w-0 flex-col\",\n fullPage ? \"w-full\" : \"w-[var(--agent-surface-width)] max-sm:w-screen\"\n )}\n >\n {!fullPage ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-lg\"\n aria-label={messages.collapse}\n onClick={() => changeMode(\"collapsed\")}\n className=\"absolute top-0.5 left-1.5 z-20 bg-background/90 backdrop-blur-sm [&_svg]:size-5\"\n >\n <ChevronRight />\n </Button>\n ) : null}\n\n <AgentPanel\n compact={!fullPage}\n context={context}\n composerPlaceholder={composerPlaceholder}\n threadId={currentThreadId}\n onThreadChange={changeThread}\n welcomeContent={welcomeContent}\n conversationHeaderActions={\n fullPage && onRequestDock ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-lg\"\n aria-label={messages.dock}\n onClick={() => {\n changeMode(\"dock\")\n onRequestDock?.()\n }}\n className=\"[&_svg]:size-5\"\n >\n <Minimize2 />\n </Button>\n ) : !fullPage && (onRequestFullPage || (onExpandThread && currentThreadId)) ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-lg\"\n aria-label={messages.expand}\n onClick={() => {\n if (onExpandThread && currentThreadId) onExpandThread(currentThreadId)\n else onRequestFullPage?.()\n }}\n className=\"[&_svg]:size-5\"\n >\n <Maximize2 />\n </Button>\n ) : null\n }\n documentPreviewHost={fullPage ? null : documentHost}\n className={cn(\n \"min-h-0 flex-1\",\n !fullPage && \"[&_[data-agent-conversation-header]]:pl-12\",\n panelClassName\n )}\n />\n </div>\n </aside>\n </>\n )\n}\n",
8
+ "export type AgentSurfaceMode = \"collapsed\" | \"dock\"\n\nexport const DEFAULT_AGENT_SURFACE_WIDTH = 384\nexport const MIN_AGENT_SURFACE_WIDTH = 320\nexport const MAX_AGENT_SURFACE_WIDTH = 720\nexport const AGENT_SURFACE_STATE_EVENT = \"sixb:agent-surface-state\"\n\nexport interface AgentSurfaceSessionState {\n readonly mode: AgentSurfaceMode\n readonly dockWidth: number\n readonly threadId: string | null\n}\n\nexport interface AgentSurfaceStateDetail {\n readonly storageKey: string\n readonly state: AgentSurfaceSessionState\n}\n\nexport function agentSurfaceSessionStorageKey(override?: string | false) {\n if (override === false) return null\n return override ?? \"sixb.agent-ui.surface.v1:agents\"\n}\n\nexport function parseAgentSurfaceSessionState(\n raw: string | null,\n defaults: AgentSurfaceSessionState,\n minimumWidth = MIN_AGENT_SURFACE_WIDTH,\n maximumWidth = MAX_AGENT_SURFACE_WIDTH\n): AgentSurfaceSessionState {\n if (!raw) return defaults\n\n try {\n const value = JSON.parse(raw) as unknown\n if (!isRecord(value)) return defaults\n return {\n mode: value.mode === \"collapsed\" || value.mode === \"dock\" ? value.mode : defaults.mode,\n dockWidth:\n typeof value.dockWidth === \"number\" && Number.isFinite(value.dockWidth)\n ? clampAgentSurfaceWidth(value.dockWidth, minimumWidth, maximumWidth)\n : defaults.dockWidth,\n threadId:\n value.threadId === null || (typeof value.threadId === \"string\" && value.threadId.length > 0)\n ? value.threadId\n : defaults.threadId,\n }\n } catch {\n return defaults\n }\n}\n\nexport function clampAgentSurfaceWidth(width: number, minimumWidth: number, maximumWidth: number) {\n return Math.min(Math.max(Math.round(width), minimumWidth), maximumWidth)\n}\n\n/** Change this tab's assistant presentation without discarding its selected thread or width. */\nexport function setAgentSurfaceMode(mode: AgentSurfaceMode, override?: string | false): void {\n const storageKey = agentSurfaceSessionStorageKey(override)\n if (!storageKey || typeof window === \"undefined\") return\n\n const defaults: AgentSurfaceSessionState = {\n mode,\n dockWidth: DEFAULT_AGENT_SURFACE_WIDTH,\n threadId: null,\n }\n updateAgentSurfaceState(storageKey, defaults, (current) => ({ ...current, mode }))\n}\n\nfunction updateAgentSurfaceState(\n storageKey: string,\n defaults: AgentSurfaceSessionState,\n update: (current: AgentSurfaceSessionState) => AgentSurfaceSessionState\n) {\n const current = readAgentSurfaceState(storageKey, defaults)\n const state = update(current)\n writeAgentSurfaceState(storageKey, state)\n window.dispatchEvent(\n new CustomEvent<AgentSurfaceStateDetail>(AGENT_SURFACE_STATE_EVENT, {\n detail: { storageKey, state },\n })\n )\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n}\n\nexport function readAgentSurfaceState(\n storageKey: string | null,\n defaults: AgentSurfaceSessionState,\n minimumWidth = MIN_AGENT_SURFACE_WIDTH,\n maximumWidth = MAX_AGENT_SURFACE_WIDTH\n): AgentSurfaceSessionState {\n if (!storageKey || typeof window === \"undefined\") return defaults\n try {\n return parseAgentSurfaceSessionState(\n window.sessionStorage.getItem(storageKey),\n defaults,\n minimumWidth,\n maximumWidth\n )\n } catch {\n return defaults\n }\n}\n\nexport function writeAgentSurfaceState(storageKey: string | null, state: AgentSurfaceSessionState) {\n if (!storageKey || typeof window === \"undefined\") return\n try {\n window.sessionStorage.setItem(storageKey, JSON.stringify(state))\n } catch {\n // Storage may be unavailable in restricted browser contexts; in-memory state still works.\n }\n}\n",
9
+ "const runtime =\n typeof window === \"undefined\"\n ? undefined\n : (window as Window & { __SIXB_RUNTIME__?: { publicEnv?: Record<string, string> } })\n .__SIXB_RUNTIME__\n\n/** Public environment captured at app-server startup. Missing values are undefined. */\nexport const publicEnv: Readonly<Record<string, string | undefined>> = Object.freeze(\n Object.assign(Object.create(null), runtime?.publicEnv)\n)\n",
10
+ "import { getAgentOptions } from \"@sixb/client/hooks\"\nimport { useQuery } from \"@tanstack/react-query\"\nimport { useLocation, useNavigate } from \"react-router-dom\"\nimport { AgentSurface } from \"../agent/agent-surface\"\nimport { useAppMessages } from \"../locale\"\nimport { useSectionsEnabled } from \"../sections/sections\"\n\n/**\n * The project's agent beside every page, collapsed until opened. It stays out of Home and the\n * agent's own pages, which are conversations already, out of shared links, and out of a project\n * with no agent.\n */\nexport function AgentDock() {\n const messages = useAppMessages().agent\n const navigate = useNavigate()\n const { pathname } = useLocation()\n const enabled = useSectionsEnabled()\n const agent = useQuery({ ...getAgentOptions(), enabled, retry: false, staleTime: 5 * 60_000 })\n const conversationPage =\n pathname === \"/\" || pathname === \"/agents\" || pathname.startsWith(\"/agents/\")\n if (!enabled || !agent.data || conversationPage) return null\n\n return (\n <AgentSurface\n title={messages.title}\n launcherLabel={messages.open}\n defaultMode=\"collapsed\"\n onExpandThread={(threadId) => navigate(`/agents/${encodeURIComponent(threadId)}`)}\n persistenceKey=\"sixb.app.agent-dock.v1\"\n />\n )\n}\n",
11
+ "import {\n Sidebar,\n SidebarCollapseToggle,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuItem,\n SidebarProvider,\n SidebarRail,\n SidebarTrigger,\n useSidebar,\n} from \"@sixb/ui/components\"\nimport { ThemeProvider } from \"@sixb/ui/hooks\"\nimport { cn } from \"@sixb/ui/lib/utils\"\nimport type { CSSProperties, ReactNode } from \"react\"\nimport { AgentDock } from \"./agent-dock\"\nimport { Brand } from \"./brand\"\nimport { type NavEntry, NavItems } from \"./nav-items\"\nimport { SearchCommand } from \"./search-command\"\nimport { SectionNav } from \"./section-nav\"\nimport { UserMenu } from \"./user-menu\"\n\nexport interface AppShellProviderProps {\n readonly defaultOpen?: boolean\n readonly open?: boolean\n readonly onOpenChange?: (open: boolean) => void\n readonly className?: string\n /** Such as `--sidebar-width`. */\n readonly style?: CSSProperties\n readonly children: ReactNode\n}\n\n/**\n * What every Sixb shell sits in: the theme, the sidebar's open state and its ⌘B shortcut, and a\n * full-height frame. `AppShell` is made of this, and a shell assembled by hand starts here too.\n */\nexport function AppShellProvider({ className, children, ...sidebarState }: AppShellProviderProps) {\n return (\n <ThemeProvider>\n <SidebarProvider className={cn(\"h-dvh overflow-hidden\", className)} {...sidebarState}>\n {children}\n </SidebarProvider>\n </ThemeProvider>\n )\n}\n\nexport interface AppShellProps {\n /** Links and groups as data, or your own sidebar content. */\n readonly nav?: readonly NavEntry[] | ReactNode\n /** Replaces the app's name and mark. */\n readonly brand?: ReactNode\n /** Shown below the brand; ⌘K search by default, `null` removes it. */\n readonly header?: ReactNode\n /** Shown above the user menu. */\n readonly footer?: ReactNode\n /** Replaces the user menu; `null` removes it. */\n readonly userMenu?: ReactNode\n /** Beside every page; the project's agent, docked, by default. `null` removes it. */\n readonly agent?: ReactNode\n readonly variant?: \"sidebar\" | \"floating\" | \"inset\"\n readonly collapsible?: \"offcanvas\" | \"icon\" | \"none\"\n readonly side?: \"left\" | \"right\"\n readonly defaultOpen?: boolean\n readonly children: ReactNode\n}\n\n/**\n * The default app frame: a sidebar with the app's brand, its nav and the user menu, beside the\n * page. Inside a built-in section the sidebar shows that section's pages. Sidebar props keep the\n * `@sixb/ui` names. Every part is exported for shells built by hand.\n */\nexport function AppShell({\n nav,\n brand,\n header,\n footer,\n userMenu,\n agent,\n variant = \"inset\",\n collapsible = \"icon\",\n side = \"left\",\n defaultOpen,\n children,\n}: AppShellProps) {\n return (\n <AppShellProvider defaultOpen={defaultOpen}>\n <Sidebar variant={variant} collapsible={collapsible} side={side}>\n <SidebarHeader>\n {brand === undefined ? <Brand /> : brand}\n {header === undefined ? <SearchCommand pages={isNavData(nav) ? nav : []} /> : header}\n </SidebarHeader>\n <SidebarContent>\n <SectionNav fallback={isNavData(nav) ? <NavItems items={nav} /> : nav} />\n {collapsible === \"none\" ? null : <CollapseToggle />}\n </SidebarContent>\n <SidebarFooter>\n {footer}\n {userMenu === undefined ? <UserMenu /> : userMenu}\n </SidebarFooter>\n {collapsible === \"none\" ? null : (\n // Beside an inset page the rail's hover line lands in the gap, so it stays invisible there.\n <SidebarRail className={variant === \"inset\" ? \"after:hidden\" : undefined} />\n )}\n </Sidebar>\n <SidebarInset className=\"min-h-0 overflow-hidden\">\n {/* Phones get the sidebar as a sheet; this is the way to open it. */}\n <div className=\"flex h-12 shrink-0 items-center border-b border-border px-3 md:hidden\">\n <SidebarTrigger className=\"-ml-1\" />\n </div>\n <div className=\"relative flex min-h-0 flex-1\">\n <div className=\"min-h-0 min-w-0 flex-1 overflow-y-auto\">{children}</div>\n {agent === undefined ? <AgentDock /> : agent}\n </div>\n </SidebarInset>\n </AppShellProvider>\n )\n}\n\n// On phones the sidebar is a sheet that closes on its own, so it gets no collapse control.\nfunction CollapseToggle() {\n const { isMobile } = useSidebar()\n if (isMobile) return null\n return (\n <SidebarGroup className=\"mt-auto\">\n <SidebarGroupContent>\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarCollapseToggle />\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n )\n}\n\nfunction isNavData(nav: AppShellProps[\"nav\"]): nav is readonly NavEntry[] {\n return Array.isArray(nav)\n}\n",
12
+ "import { searchObjectsOptions } from \"@sixb/client/hooks\"\nimport {\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n Kbd,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n} from \"@sixb/ui/components\"\nimport { keepPreviousData, useQuery } from \"@tanstack/react-query\"\nimport { Box, Search } from \"lucide-react\"\nimport { useDeferredValue, useEffect, useState } from \"react\"\nimport { useNavigate } from \"react-router-dom\"\nimport { useAppMessages } from \"../locale\"\nimport { objectHref } from \"../pages/routes\"\nimport { useSections, useSectionsEnabled } from \"../sections/sections\"\nimport { isExternal, type NavEntry, type NavItem } from \"./nav-items\"\n\nexport interface SearchCommandProps {\n /** The app's own pages, listed before the built-in sections'. `AppShell` passes its nav. */\n readonly pages?: readonly NavEntry[]\n}\n\n/**\n * A Search button for the sidebar, and ⌘K anywhere: the app's pages, every built-in section page\n * this person may open, and the project's objects as they type, each opening its page. Shared\n * links, which open one page, leave it out.\n */\nexport function SearchCommand({ pages = [] }: SearchCommandProps) {\n const messages = useAppMessages().search\n const navigate = useNavigate()\n const sections = useSections()\n const enabled = useSectionsEnabled()\n const [open, setOpen] = useState(false)\n const [query, setQuery] = useState(\"\")\n const term = useDeferredValue(query.trim())\n const searching = term.length > 1\n const objects = useQuery({\n ...searchObjectsOptions({ query: { q: term, limit: \"8\" } }),\n enabled: enabled && open && searching,\n // Results stay while the next ones load, so the list does not jump on every keystroke.\n placeholderData: keepPreviousData,\n retry: false,\n })\n\n useEffect(() => {\n if (!enabled) return\n const toggle = (event: KeyboardEvent) => {\n if (event.key.toLowerCase() === \"k\" && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n setOpen((current) => !current)\n }\n }\n window.addEventListener(\"keydown\", toggle)\n return () => window.removeEventListener(\"keydown\", toggle)\n }, [enabled])\n\n const go = (href: string) => {\n setOpen(false)\n setQuery(\"\")\n if (isExternal(href)) window.location.assign(href)\n else navigate(href)\n }\n if (!enabled) return null\n const appPages = pages.flatMap((entry): readonly NavItem[] =>\n \"group\" in entry ? entry.items : [entry]\n )\n\n return (\n <>\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton\n tooltip={messages.label}\n onClick={() => setOpen(true)}\n className=\"border border-sidebar-border text-sidebar-foreground/80 hover:border-foreground/15\"\n >\n <Search />\n <span>{messages.label}</span>\n <Kbd className=\"ml-auto group-data-[collapsible=icon]:hidden\">⌘K</Kbd>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n <CommandDialog\n open={open}\n onOpenChange={(next) => {\n setOpen(next)\n if (!next) setQuery(\"\")\n }}\n title={messages.label}\n className=\"max-w-xl rounded-xl\"\n >\n <CommandInput value={query} onValueChange={setQuery} placeholder={messages.placeholder} />\n <CommandList className=\"max-h-[min(28rem,70vh)]\">\n <CommandEmpty>{objects.isFetching ? messages.searching : messages.empty}</CommandEmpty>\n {searching && objects.data && objects.data.items.length > 0 ? (\n <CommandGroup heading={messages.objects}>\n {objects.data.items.map((item) => (\n <CommandItem\n key={`${item.ref.objectTypeId}:${item.ref.primaryId}`}\n value={`object:${item.ref.objectTypeId}:${item.ref.primaryId}`}\n // The server matched these; the typed text keeps them through cmdk's own filter.\n keywords={[item.label, query]}\n onSelect={() => go(objectHref(item.ref.objectTypeId, item.ref.primaryId))}\n >\n <Box />\n <span className=\"min-w-0 flex-1 truncate\">{item.label}</span>\n <span className=\"text-xs text-muted-foreground\">{item.ref.objectTypeId}</span>\n </CommandItem>\n ))}\n </CommandGroup>\n ) : null}\n {appPages.length > 0 ? (\n <CommandGroup heading={messages.pages}>\n {appPages.map((page) => (\n <PageItem key={page.href} page={page} onSelect={go} />\n ))}\n </CommandGroup>\n ) : null}\n {sections.map((section) => (\n <CommandGroup key={section.id} heading={section.label}>\n {section.pages\n .flatMap((entry) => (\"group\" in entry ? entry.items : [entry]))\n .map((page) => (\n <PageItem key={page.href} page={page} keywords={[section.label]} onSelect={go} />\n ))}\n </CommandGroup>\n ))}\n </CommandList>\n </CommandDialog>\n </>\n )\n}\n\nfunction PageItem({\n page,\n keywords,\n onSelect,\n}: {\n readonly page: NavItem\n readonly keywords?: string[]\n readonly onSelect: (href: string) => void\n}) {\n return (\n <CommandItem\n value={`page:${page.href}`}\n keywords={[page.label, ...(keywords ?? [])]}\n onSelect={() => onSelect(page.href)}\n >\n {page.icon ? <page.icon /> : null}\n <span>{page.label}</span>\n </CommandItem>\n )\n}\n",
13
+ "import {\n SidebarGroup,\n SidebarGroupContent,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n} from \"@sixb/ui/components\"\nimport { ChevronLeft } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { Link } from \"react-router-dom\"\nimport { useAppMessages } from \"../locale\"\nimport { usePageCounts } from \"../sections/counts\"\nimport { useCurrentSection, useRegisterSectionNav } from \"../sections/sections\"\nimport { type NavEntry, type NavItem, NavItems } from \"./nav-items\"\n\nexport interface SectionNavProps {\n /** What the sidebar shows outside a section, usually the app's nav. */\n readonly fallback?: ReactNode\n /** Where the back link leads. */\n readonly backHref?: string\n}\n\n/**\n * Inside a built-in section, the section's pages with a link back; anywhere else, `fallback`.\n * While it is in the sidebar, section pages leave out their own tabs.\n */\nexport function SectionNav({ fallback = null, backHref = \"/\" }: SectionNavProps) {\n useRegisterSectionNav()\n const messages = useAppMessages().sections\n const section = useCurrentSection()\n const counts = usePageCounts(section?.id)\n\n if (!section) return fallback\n\n const counted = (item: NavItem): NavItem =>\n counts[item.href] === undefined ? item : { ...item, badge: counts[item.href] }\n const pages = section.pages.map(\n (entry): NavEntry =>\n \"group\" in entry ? { ...entry, items: entry.items.map(counted) } : counted(entry)\n )\n\n return (\n <>\n <SidebarGroup>\n <SidebarGroupContent>\n <SidebarMenu>\n <SidebarMenuItem>\n <SidebarMenuButton asChild tooltip={messages.back}>\n <Link to={backHref}>\n <ChevronLeft />\n <span className=\"font-medium\">{section.label}</span>\n </Link>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n <NavItems items={pages} />\n </>\n )\n}\n",
14
+ "import {\n listActionsOptions,\n listObjectTypesOptions,\n listRulesOptions,\n listWorkflowsOptions,\n objectCountOptions,\n} from \"@sixb/client/hooks\"\nimport { useQuery } from \"@tanstack/react-query\"\nimport type { AppSectionId } from \"./catalog\"\n\n/**\n * How many of each thing a section's pages hold, by page path, for the counts beside them in its\n * navigation. Read only while that section is open; a count this person may not read is left out.\n */\nexport function usePageCounts(section: AppSectionId | undefined): Readonly<Record<string, number>> {\n const ontology = { enabled: section === \"ontology\", retry: false, staleTime: 30_000 } as const\n const types = useQuery({ ...listObjectTypesOptions(), ...ontology }).data\n const objects = useQuery({ ...objectCountOptions(), ...ontology }).data\n const actions = useQuery({ ...listActionsOptions(), ...ontology }).data\n const workflows = useQuery({ ...listWorkflowsOptions(), ...ontology }).data\n const rules = useQuery({ ...listRulesOptions(), ...ontology }).data\n if (section !== \"ontology\") return {}\n const counts: Record<string, number | undefined> = {\n \"/ontology/object-types\": types?.length,\n \"/ontology/objects\": objects,\n \"/ontology/actions\": actions?.length,\n \"/ontology/workflows\": workflows?.length,\n \"/ontology/rules\": rules?.length,\n }\n return Object.fromEntries(\n Object.entries(counts).filter((entry): entry is [string, number] => entry[1] !== undefined)\n )\n}\n",
15
+ "import {\n Avatar,\n AvatarFallback,\n AvatarImage,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n nextTheme,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n ThemePicker,\n useSidebar,\n} from \"@sixb/ui/components\"\nimport { useOptionalTheme } from \"@sixb/ui/hooks\"\nimport { cn } from \"@sixb/ui/lib/utils\"\nimport { ChevronsUpDown, CircleUserRound, LogOut, SunMoon } from \"lucide-react\"\nimport type { ComponentType, ReactNode } from \"react\"\nimport { useAppMessages } from \"../locale\"\nimport { useSections } from \"../sections/sections\"\nimport { type CurrentUser, useCurrentUser, useSignOut } from \"../session\"\n\nexport interface UserMenuProps {\n /** Extra items, such as `<UserMenu.Item>`, shown below the built-in sections. */\n readonly children?: ReactNode\n}\n\nexport interface UserMenuItemProps {\n readonly href?: string\n readonly icon?: ComponentType<{ readonly className?: string }>\n readonly onSelect?: () => void\n readonly children: ReactNode\n}\n\n/**\n * The signed-in person, the built-in sections they may open, such as Data and Settings, theme\n * switching and sign-out, at the foot of any sidebar. With sign-in off it is the way into the\n * sections.\n */\nfunction UserMenuRoot({ children }: UserMenuProps) {\n const user = useCurrentUser()\n const signOut = useSignOut()\n const sections = useSections()\n const messages = useAppMessages().userMenu\n // Theme switching appears only where the app provides a theme.\n const themeControls = useOptionalTheme()\n const { isMobile } = useSidebar()\n const items =\n sections.length > 0 || children ? (\n <>\n {sections.map((section) => (\n <UserMenuItem key={section.id} href={section.href} icon={section.icon}>\n {section.label}\n </UserMenuItem>\n ))}\n {children}\n </>\n ) : null\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n {user ? (\n <SidebarMenuButton\n size=\"lg\"\n tooltip={displayName(user)}\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <Identity user={user} emailClassName=\"text-sidebar-foreground/70\" />\n <ChevronsUpDown className=\"ml-auto size-4\" />\n </SidebarMenuButton>\n ) : (\n <SidebarMenuButton\n tooltip={messages.signInOff}\n className=\"text-sidebar-foreground data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <CircleUserRound />\n <span>{messages.signInOff}</span>\n </SidebarMenuButton>\n )}\n </DropdownMenuTrigger>\n <DropdownMenuContent\n side={isMobile ? \"bottom\" : \"top\"}\n align=\"end\"\n sideOffset={4}\n className=\"min-w-56 rounded-lg\"\n onCloseAutoFocus={(event) => event.preventDefault()}\n >\n {user ? (\n <>\n <DropdownMenuLabel className=\"p-0 font-normal\">\n <div className=\"flex items-center gap-2 px-1 py-1.5 text-left text-sm\">\n <Identity user={user} emailClassName=\"text-muted-foreground\" />\n </div>\n </DropdownMenuLabel>\n <DropdownMenuSeparator />\n </>\n ) : null}\n\n {items ? (\n <>\n {items}\n {themeControls ? <DropdownMenuSeparator /> : null}\n </>\n ) : null}\n\n {themeControls ? (\n // One row: a click on an option picks it, and with the row focused the arrow keys\n // step through the themes. Choosing keeps the menu open, so the change shows.\n <DropdownMenuItem\n aria-keyshortcuts=\"ArrowLeft ArrowRight\"\n onSelect={(event) => event.preventDefault()}\n onKeyDown={(event) => {\n if (event.key !== \"ArrowLeft\" && event.key !== \"ArrowRight\") return\n event.preventDefault()\n themeControls.setTheme(\n nextTheme(themeControls.theme, event.key === \"ArrowRight\" ? 1 : -1)\n )\n }}\n >\n <SunMoon />\n <span className=\"flex-1\">{messages.theme}</span>\n <ThemePicker focusable={false} />\n </DropdownMenuItem>\n ) : null}\n\n {user ? (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n signOut().catch((error: unknown) => {\n console.error(\"[SixbApp] Could not sign out:\", error)\n })\n }}\n >\n <LogOut />\n <span>{messages.signOut}</span>\n </DropdownMenuItem>\n </>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n\nfunction displayName(user: CurrentUser): string {\n return user.displayName ?? user.email\n}\n\n/** The person's avatar, name and, when the name is not the address, their email. */\nfunction Identity({\n user,\n emailClassName,\n}: {\n readonly user: CurrentUser\n readonly emailClassName: string\n}) {\n const name = displayName(user)\n return (\n <>\n <Avatar className=\"h-8 w-8 rounded-md\">\n {user.avatarUrl ? <AvatarImage src={user.avatarUrl} alt={name} /> : null}\n <AvatarFallback className=\"rounded-md text-xs\">{initials(name)}</AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-semibold\">{name}</span>\n {user.displayName ? (\n <span className={cn(\"truncate text-xs\", emailClassName)}>{user.email}</span>\n ) : null}\n </div>\n </>\n )\n}\n\nfunction initials(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean)\n if (parts.length === 0) return \"?\"\n if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase()\n return `${parts[0][0]}${parts[parts.length - 1][0]}`.toUpperCase()\n}\n\nfunction UserMenuItem({ href, icon: Icon, onSelect, children }: UserMenuItemProps) {\n const content = (\n <>\n {Icon ? <Icon /> : null}\n <span>{children}</span>\n </>\n )\n return href ? (\n <DropdownMenuItem asChild onSelect={onSelect}>\n <a href={href}>{content}</a>\n </DropdownMenuItem>\n ) : (\n <DropdownMenuItem onSelect={onSelect}>{content}</DropdownMenuItem>\n )\n}\n\nexport const UserMenu = Object.assign(UserMenuRoot, { Item: UserMenuItem })\n"
15
16
  ],
16
- "mappings": ";;;;;;;;;;AAAA;AACA;AACA,mBAAS,sBAAY,oBAAO,iBAAU,kBAAI;AAC1C,oBAAS,8BAAqB,8BAAiB,sBAAU;AACzD,0BAAS;;;ACJT;AACA;AACA;AACA;AACA;AAAA,oBACE;AAAA,UACA;AAAA,eACA;AAAA;AAGF,IAAM,sBAAsB;AAC5B,IAAM,iBAAiB,UAAU,sBAAsB;AACvD,IAAM,OAAO,UAAU,YAAY;AACnC,IAAM,6BAA6B;AAC5B,IAAM,6BAA6B;AAwC1C,eAAsB,QAAQ,CAAC,SAAmD;AAAA,EAChF,MAAM,SAAS,QAAQ,UAAU,KAAK,QAAQ,IAAI,GAAG,SAAS,QAAQ,KAAK;AAAA,EAC3E,IAAI,QAAQ,QAAQ,eAAe,MAAM,QAAQ,QAAQ,qBAAqB,GAAG;AAAA,IAC/E,MAAM,IAAI,MACR,sFACF;AAAA,EACF;AAAA,EAIA,MAAM,GAAG,QAAQ,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC;AAAA,EACjD,MAAM,MAAM,QAAQ,EAAE,WAAW,KAAK,CAAC;AAAA,EAEvC,MAAM,SAAS,MAAM,kBAAkB,QAAQ,iBAAiB,QAAQ,KAAK;AAA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