@raybase/cli 0.0.1 → 0.3.3

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 (321) hide show
  1. package/LICENSE +21 -0
  2. package/dist/admin-assets.d.ts +22 -0
  3. package/dist/admin-assets.d.ts.map +1 -0
  4. package/dist/admin-assets.js +285 -0
  5. package/dist/admin-assets.js.map +1 -0
  6. package/dist/agent-remote-mcp-cli.d.ts +71 -0
  7. package/dist/agent-remote-mcp-cli.d.ts.map +1 -0
  8. package/dist/agent-remote-mcp-cli.js +466 -0
  9. package/dist/agent-remote-mcp-cli.js.map +1 -0
  10. package/dist/agent-skills-cli.d.ts +4 -0
  11. package/dist/agent-skills-cli.d.ts.map +1 -0
  12. package/dist/agent-skills-cli.js +144 -0
  13. package/dist/agent-skills-cli.js.map +1 -0
  14. package/dist/agent.d.ts +169 -0
  15. package/dist/agent.d.ts.map +1 -0
  16. package/dist/agent.js +531 -0
  17. package/dist/agent.js.map +1 -0
  18. package/dist/app-manifest.d.ts +41 -0
  19. package/dist/app-manifest.d.ts.map +1 -0
  20. package/dist/app-manifest.js +294 -0
  21. package/dist/app-manifest.js.map +1 -0
  22. package/dist/dev-cron-backstop.d.ts +53 -0
  23. package/dist/dev-cron-backstop.d.ts.map +1 -0
  24. package/dist/dev-cron-backstop.js +364 -0
  25. package/dist/dev-cron-backstop.js.map +1 -0
  26. package/dist/dev-do-watchdog.d.ts +37 -0
  27. package/dist/dev-do-watchdog.d.ts.map +1 -0
  28. package/dist/dev-do-watchdog.js +75 -0
  29. package/dist/dev-do-watchdog.js.map +1 -0
  30. package/dist/dev-inference-tape.d.ts +35 -0
  31. package/dist/dev-inference-tape.d.ts.map +1 -0
  32. package/dist/dev-inference-tape.js +502 -0
  33. package/dist/dev-inference-tape.js.map +1 -0
  34. package/dist/dev-ports.d.ts +25 -0
  35. package/dist/dev-ports.d.ts.map +1 -0
  36. package/dist/dev-ports.js +84 -0
  37. package/dist/dev-ports.js.map +1 -0
  38. package/dist/dev-project-lock.d.ts +24 -0
  39. package/dist/dev-project-lock.d.ts.map +1 -0
  40. package/dist/dev-project-lock.js +307 -0
  41. package/dist/dev-project-lock.js.map +1 -0
  42. package/dist/env-files.d.ts +10 -0
  43. package/dist/env-files.d.ts.map +1 -0
  44. package/dist/env-files.js +108 -0
  45. package/dist/env-files.js.map +1 -0
  46. package/dist/external-json.d.ts +3 -0
  47. package/dist/external-json.d.ts.map +1 -0
  48. package/dist/external-json.js +21 -0
  49. package/dist/external-json.js.map +1 -0
  50. package/dist/frameworks.d.ts +67 -0
  51. package/dist/frameworks.d.ts.map +1 -0
  52. package/dist/frameworks.js +210 -0
  53. package/dist/frameworks.js.map +1 -0
  54. package/dist/guide-corpus-doctor.d.ts +24 -0
  55. package/dist/guide-corpus-doctor.d.ts.map +1 -0
  56. package/dist/guide-corpus-doctor.js +111 -0
  57. package/dist/guide-corpus-doctor.js.map +1 -0
  58. package/dist/hosting.d.ts +85 -0
  59. package/dist/hosting.d.ts.map +1 -0
  60. package/dist/hosting.js +136 -0
  61. package/dist/hosting.js.map +1 -0
  62. package/dist/index.d.ts +253 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +11475 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/kit-doctor.d.ts +19 -0
  67. package/dist/kit-doctor.d.ts.map +1 -0
  68. package/dist/kit-doctor.js +255 -0
  69. package/dist/kit-doctor.js.map +1 -0
  70. package/dist/kit-install.d.ts +67 -0
  71. package/dist/kit-install.d.ts.map +1 -0
  72. package/dist/kit-install.js +409 -0
  73. package/dist/kit-install.js.map +1 -0
  74. package/dist/kit-manifest.d.ts +154 -0
  75. package/dist/kit-manifest.d.ts.map +1 -0
  76. package/dist/kit-manifest.js +252 -0
  77. package/dist/kit-manifest.js.map +1 -0
  78. package/dist/kit-registry.d.ts +42 -0
  79. package/dist/kit-registry.d.ts.map +1 -0
  80. package/dist/kit-registry.js +231 -0
  81. package/dist/kit-registry.js.map +1 -0
  82. package/dist/kit-spec.d.ts +37 -0
  83. package/dist/kit-spec.d.ts.map +1 -0
  84. package/dist/kit-spec.js +48 -0
  85. package/dist/kit-spec.js.map +1 -0
  86. package/dist/kit-state.d.ts +57 -0
  87. package/dist/kit-state.d.ts.map +1 -0
  88. package/dist/kit-state.js +31 -0
  89. package/dist/kit-state.js.map +1 -0
  90. package/dist/kits.d.ts +82 -0
  91. package/dist/kits.d.ts.map +1 -0
  92. package/dist/kits.js +255 -0
  93. package/dist/kits.js.map +1 -0
  94. package/dist/license-keys.d.ts +3 -0
  95. package/dist/license-keys.d.ts.map +1 -0
  96. package/dist/license-keys.js +10 -0
  97. package/dist/license-keys.js.map +1 -0
  98. package/dist/licensing.d.ts +269 -0
  99. package/dist/licensing.d.ts.map +1 -0
  100. package/dist/licensing.js +474 -0
  101. package/dist/licensing.js.map +1 -0
  102. package/dist/local-codex-relay.d.ts +19 -0
  103. package/dist/local-codex-relay.d.ts.map +1 -0
  104. package/dist/local-codex-relay.js +203 -0
  105. package/dist/local-codex-relay.js.map +1 -0
  106. package/dist/module-doctor.d.ts +35 -0
  107. package/dist/module-doctor.d.ts.map +1 -0
  108. package/dist/module-doctor.js +966 -0
  109. package/dist/module-doctor.js.map +1 -0
  110. package/dist/module-install.d.ts +71 -0
  111. package/dist/module-install.d.ts.map +1 -0
  112. package/dist/module-install.js +1133 -0
  113. package/dist/module-install.js.map +1 -0
  114. package/dist/module-manifest.d.ts +33 -0
  115. package/dist/module-manifest.d.ts.map +1 -0
  116. package/dist/module-manifest.js +301 -0
  117. package/dist/module-manifest.js.map +1 -0
  118. package/dist/module-state.d.ts +76 -0
  119. package/dist/module-state.d.ts.map +1 -0
  120. package/dist/module-state.js +162 -0
  121. package/dist/module-state.js.map +1 -0
  122. package/dist/modules.d.ts +52 -0
  123. package/dist/modules.d.ts.map +1 -0
  124. package/dist/modules.js +110 -0
  125. package/dist/modules.js.map +1 -0
  126. package/dist/palette-check.d.ts +42 -0
  127. package/dist/palette-check.d.ts.map +1 -0
  128. package/dist/palette-check.js +217 -0
  129. package/dist/palette-check.js.map +1 -0
  130. package/dist/palette-compile.d.ts +30 -0
  131. package/dist/palette-compile.d.ts.map +1 -0
  132. package/dist/palette-compile.js +149 -0
  133. package/dist/palette-compile.js.map +1 -0
  134. package/dist/pm.d.ts +11 -0
  135. package/dist/pm.d.ts.map +1 -0
  136. package/dist/pm.js +30 -0
  137. package/dist/pm.js.map +1 -0
  138. package/dist/project-local-codex-relay.d.ts +11 -0
  139. package/dist/project-local-codex-relay.d.ts.map +1 -0
  140. package/dist/project-local-codex-relay.js +95 -0
  141. package/dist/project-local-codex-relay.js.map +1 -0
  142. package/dist/shared.d.ts +4 -0
  143. package/dist/shared.d.ts.map +1 -0
  144. package/dist/shared.js +38 -0
  145. package/dist/shared.js.map +1 -0
  146. package/dist/shell-match.d.ts +29 -0
  147. package/dist/shell-match.d.ts.map +1 -0
  148. package/dist/shell-match.js +160 -0
  149. package/dist/shell-match.js.map +1 -0
  150. package/dist/template-doctor.d.ts +40 -0
  151. package/dist/template-doctor.d.ts.map +1 -0
  152. package/dist/template-doctor.js +722 -0
  153. package/dist/template-doctor.js.map +1 -0
  154. package/dist/template-install.d.ts +135 -0
  155. package/dist/template-install.d.ts.map +1 -0
  156. package/dist/template-install.js +1311 -0
  157. package/dist/template-install.js.map +1 -0
  158. package/dist/template-manifest.d.ts +328 -0
  159. package/dist/template-manifest.d.ts.map +1 -0
  160. package/dist/template-manifest.js +533 -0
  161. package/dist/template-manifest.js.map +1 -0
  162. package/dist/template-registry.d.ts +76 -0
  163. package/dist/template-registry.d.ts.map +1 -0
  164. package/dist/template-registry.js +365 -0
  165. package/dist/template-registry.js.map +1 -0
  166. package/dist/template-spec.d.ts +24 -0
  167. package/dist/template-spec.d.ts.map +1 -0
  168. package/dist/template-spec.js +38 -0
  169. package/dist/template-spec.js.map +1 -0
  170. package/dist/template-state.d.ts +108 -0
  171. package/dist/template-state.d.ts.map +1 -0
  172. package/dist/template-state.js +93 -0
  173. package/dist/template-state.js.map +1 -0
  174. package/dist/templates.d.ts +123 -0
  175. package/dist/templates.d.ts.map +1 -0
  176. package/dist/templates.js +541 -0
  177. package/dist/templates.js.map +1 -0
  178. package/dist/theme-match.d.ts +41 -0
  179. package/dist/theme-match.d.ts.map +1 -0
  180. package/dist/theme-match.js +92 -0
  181. package/dist/theme-match.js.map +1 -0
  182. package/dist/wrangler-secrets.d.ts +15 -0
  183. package/dist/wrangler-secrets.d.ts.map +1 -0
  184. package/dist/wrangler-secrets.js +97 -0
  185. package/dist/wrangler-secrets.js.map +1 -0
  186. package/kits/datasheet-grid/file-manifest.json +65 -0
  187. package/kits/datasheet-grid/files/AGENTS.md +6 -0
  188. package/kits/datasheet-grid/files/docs/datasheet-grid.md +15 -0
  189. package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/DatasheetGridRoute.tsx +35 -0
  190. package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/README.md +10 -0
  191. package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-adapter.ts +30 -0
  192. package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-metadata.ts +19 -0
  193. package/kits/datasheet-grid/files/files/src/kits/datasheet-grid/grid-state.ts +24 -0
  194. package/kits/datasheet-grid/files/kit.json +119 -0
  195. package/kits/datasheet-grid/files/skills/datasheet-grid/SKILL.md +16 -0
  196. package/kits/datasheet-grid/files/tests/datasheet-grid.test.ts +15 -0
  197. package/kits/datasheet-grid/kit.json +146 -0
  198. package/kits/index.json +71 -0
  199. package/kits/resend-email/file-manifest.json +47 -0
  200. package/kits/resend-email/files/AGENTS.md +7 -0
  201. package/kits/resend-email/files/docs/resend-email.md +13 -0
  202. package/kits/resend-email/files/files/src/kits/resend-email/README.md +17 -0
  203. package/kits/resend-email/files/files/src/kits/resend-email/send-email.ts +44 -0
  204. package/kits/resend-email/files/kit.json +128 -0
  205. package/kits/resend-email/files/skills/resend-email/SKILL.md +20 -0
  206. package/kits/resend-email/files/tests/resend-email.test.ts +54 -0
  207. package/kits/resend-email/kit.json +159 -0
  208. package/modules/docs/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
  209. package/modules/docs/templates/astro-emdash/content/docs/index.mdx +13 -0
  210. package/modules/docs/templates/astro-emdash/content/docs/mcp.mdx +11 -0
  211. package/modules/docs/templates/astro-emdash/content/docs/meta.json +4 -0
  212. package/modules/docs/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
  213. package/modules/docs/templates/astro-emdash/site/content/docs/index.mdx +12 -0
  214. package/modules/docs/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
  215. package/modules/docs/templates/astro-emdash/site/content/docs/meta.json +4 -0
  216. package/modules/docs/templates/astro-emdash/site/source.config.ts +10 -0
  217. package/modules/docs/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
  218. package/modules/docs/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
  219. package/modules/docs/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
  220. package/modules/docs/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
  221. package/modules/docs/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
  222. package/modules/docs/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
  223. package/modules/docs/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
  224. package/modules/docs/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
  225. package/modules/docs/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
  226. package/modules/docs/templates/astro-emdash/site/src/docs/source.ts +7 -0
  227. package/modules/docs/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
  228. package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
  229. package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
  230. package/modules/docs/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
  231. package/modules/docs/templates/astro-emdash/site/src/styles-docs.css +3 -0
  232. package/modules/docs/templates/astro-emdash/source.config.ts +10 -0
  233. package/modules/docs/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
  234. package/modules/docs/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
  235. package/modules/docs/templates/astro-emdash/src/docs/docs-data.ts +24 -0
  236. package/modules/docs/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
  237. package/modules/docs/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
  238. package/modules/docs/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
  239. package/modules/docs/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
  240. package/modules/docs/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
  241. package/modules/docs/templates/astro-emdash/src/docs/llm-text.ts +61 -0
  242. package/modules/docs/templates/astro-emdash/src/docs/source.ts +7 -0
  243. package/modules/docs/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
  244. package/modules/docs/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
  245. package/modules/docs/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
  246. package/modules/docs/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
  247. package/modules/docs/templates/astro-emdash/src/routes/docs.tsx +22 -0
  248. package/modules/docs/templates/astro-emdash/src/styles-docs.css +3 -0
  249. package/modules/docs/templates/react-router/app/components/mdx.tsx +79 -0
  250. package/modules/docs/templates/react-router/app/lib/layout.shared.tsx +54 -0
  251. package/modules/docs/templates/react-router/app/lib/source.ts +7 -0
  252. package/modules/docs/templates/react-router/app/routes/docs.$.tsx +49 -0
  253. package/modules/docs/templates/react-router/app/routes/docs.api.search.ts +10 -0
  254. package/modules/docs/templates/react-router/app/routes/docs.tsx +13 -0
  255. package/modules/docs/templates/react-router/content/docs/getting-started.mdx +8 -0
  256. package/modules/docs/templates/react-router/content/docs/index.mdx +8 -0
  257. package/modules/docs/templates/react-router/content/docs/mcp.mdx +121 -0
  258. package/modules/docs/templates/react-router/content/docs/meta.json +4 -0
  259. package/modules/docs/templates/react-router/source.config.ts +5 -0
  260. package/modules/docs/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
  261. package/modules/docs/templates/tanstack-start/content/docs/index.mdx +8 -0
  262. package/modules/docs/templates/tanstack-start/content/docs/mcp.mdx +121 -0
  263. package/modules/docs/templates/tanstack-start/content/docs/meta.json +4 -0
  264. package/modules/docs/templates/tanstack-start/source.config.ts +10 -0
  265. package/modules/docs/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
  266. package/modules/docs/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
  267. package/modules/docs/templates/tanstack-start/src/docs/docs-data.ts +24 -0
  268. package/modules/docs/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
  269. package/modules/docs/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
  270. package/modules/docs/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
  271. package/modules/docs/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
  272. package/modules/docs/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
  273. package/modules/docs/templates/tanstack-start/src/docs/llm-text.ts +61 -0
  274. package/modules/docs/templates/tanstack-start/src/docs/source.ts +7 -0
  275. package/modules/docs/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
  276. package/modules/docs/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
  277. package/modules/docs/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
  278. package/modules/docs/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
  279. package/modules/docs/templates/tanstack-start/src/routes/docs.tsx +22 -0
  280. package/modules/docs/templates/tanstack-start/src/styles-docs.css +3 -0
  281. package/modules/guide/templates/astro-emdash/content/guide/capability-map.md +17 -0
  282. package/modules/guide/templates/astro-emdash/src/components/guide-widget.tsx +41 -0
  283. package/modules/guide/templates/astro-emdash/src/guide/actions.ts +8 -0
  284. package/modules/guide/templates/astro-emdash/src/guide/config.ts +21 -0
  285. package/modules/guide/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
  286. package/modules/guide/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
  287. package/modules/guide/templates/astro-emdash/src/guide/corpus.ts +4 -0
  288. package/modules/guide/templates/astro-emdash/src/guide/resources.json +4 -0
  289. package/modules/guide/templates/react-router/app/components/guide-widget.tsx +29 -0
  290. package/modules/guide/templates/react-router/app/guide/actions.ts +3 -0
  291. package/modules/guide/templates/react-router/app/guide/config.ts +21 -0
  292. package/modules/guide/templates/react-router/app/guide/corpus.gen.ts +4 -0
  293. package/modules/guide/templates/react-router/app/guide/corpus.manifest.json +22 -0
  294. package/modules/guide/templates/react-router/app/guide/corpus.ts +4 -0
  295. package/modules/guide/templates/react-router/app/guide/resources.json +4 -0
  296. package/modules/guide/templates/react-router/content/guide/capability-map.md +13 -0
  297. package/modules/guide/templates/tanstack-start/content/guide/capability-map.md +17 -0
  298. package/modules/guide/templates/tanstack-start/src/components/guide-widget.tsx +41 -0
  299. package/modules/guide/templates/tanstack-start/src/guide/actions.ts +17 -0
  300. package/modules/guide/templates/tanstack-start/src/guide/config.ts +21 -0
  301. package/modules/guide/templates/tanstack-start/src/guide/corpus.gen.ts +4 -0
  302. package/modules/guide/templates/tanstack-start/src/guide/corpus.manifest.json +22 -0
  303. package/modules/guide/templates/tanstack-start/src/guide/corpus.ts +4 -0
  304. package/modules/guide/templates/tanstack-start/src/guide/resources.json +4 -0
  305. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  306. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  307. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  308. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  309. package/modules/openai-subscription/templates/astro-emdash/src/openai-subscription.ts +11 -0
  310. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  311. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  312. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  313. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  314. package/modules/openai-subscription/templates/react-router/app/openai-subscription.ts +11 -0
  315. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  316. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  317. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  318. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  319. package/modules/openai-subscription/templates/tanstack-start/src/openai-subscription.ts +11 -0
  320. package/package.json +34 -8
  321. package/README.md +0 -3
@@ -0,0 +1,210 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ const profiles = {
4
+ "tanstack-start": {
5
+ kind: "tanstack-start",
6
+ schemaModule: "src/db/schema.ts",
7
+ appConfigModule: "src/raybase.config.ts",
8
+ storageModule: "src/db/storage.ts",
9
+ migrationsModulePath: "src/db/migrations.gen.ts",
10
+ serverFile: "src/raybase.server.ts",
11
+ wranglerMain: ["src/worker-entry.ts"],
12
+ workerEntryFile: "src/worker-entry.ts",
13
+ appSourceDirs: ["src/"],
14
+ routeInventory: { kind: "tanstack", directory: "src/routes" },
15
+ requiredFiles: ["src/routes/__root.tsx", "src/routes/_app.tsx", "src/routes/_app/index.tsx"],
16
+ docsRequiredFiles: [
17
+ "source.config.ts",
18
+ "content/docs/index.mdx",
19
+ "content/docs/getting-started.mdx",
20
+ "content/docs/mcp.mdx",
21
+ "content/docs/meta.json",
22
+ "src/docs/docs-assets.ts",
23
+ "src/docs/docs-client.tsx",
24
+ "src/docs/docs-data.ts",
25
+ "src/docs/docs-handler.tsx",
26
+ "src/docs/docs-layout.tsx",
27
+ "src/docs/docs-mdx.tsx",
28
+ "src/docs/docs-page-actions.tsx",
29
+ "src/docs/docs-page.tsx",
30
+ "src/docs/llm-text.ts",
31
+ "src/docs/source.ts",
32
+ "src/styles-docs.css",
33
+ "src/routes/docs.index.tsx",
34
+ "src/routes/docs.tsx",
35
+ "src/routes/docs/$.tsx",
36
+ "src/routes/docs/api/markdown.ts",
37
+ "src/routes/docs/api/search.ts"
38
+ ],
39
+ docsRouteFiles: ["src/routes/docs.index.tsx", "src/routes/docs.tsx", "src/routes/docs/$.tsx", "src/routes/docs/api/markdown.ts", "src/routes/docs/api/search.ts"],
40
+ guideRequiredFiles: [
41
+ "src/components/guide-widget.tsx",
42
+ "src/guide/corpus.ts",
43
+ "src/guide/corpus.gen.ts",
44
+ "src/guide/corpus.manifest.json",
45
+ "src/guide/resources.json",
46
+ "content/guide/capability-map.md"
47
+ ],
48
+ apiRequiredFiles: ["src/api/operations.ts"],
49
+ guideGeneratedCorpusFile: "src/guide/corpus.gen.ts",
50
+ guideCorpusManifestFile: "src/guide/corpus.manifest.json",
51
+ guideResourceConfigFile: "src/guide/resources.json",
52
+ patternTestFiles: ["tests/raybase-patterns.test.ts"]
53
+ },
54
+ "react-router": {
55
+ kind: "react-router",
56
+ schemaModule: "app/db/schema.ts",
57
+ appConfigModule: "app/db/schema.ts",
58
+ storageModule: "app/db/storage.ts",
59
+ migrationsModulePath: "app/db/migrations.gen.ts",
60
+ serverFile: "app/raybase.server.ts",
61
+ wranglerMain: ["workers/app.ts", "./workers/app.ts"],
62
+ workerEntryFile: "workers/app.ts",
63
+ appSourceDirs: ["app/", "workers/"],
64
+ routeInventory: { kind: "react-router", directory: "app/routes" },
65
+ requiredFiles: ["app/root.tsx", "workers/app.ts"],
66
+ docsRequiredFiles: [
67
+ "source.config.ts",
68
+ "content/docs/index.mdx",
69
+ "content/docs/getting-started.mdx",
70
+ "content/docs/meta.json",
71
+ "app/components/mdx.tsx",
72
+ "app/lib/source.ts",
73
+ "app/lib/layout.shared.tsx",
74
+ "app/routes/docs.tsx",
75
+ "app/routes/docs.$.tsx",
76
+ "app/routes/docs.api.search.ts"
77
+ ],
78
+ docsRouteFiles: ["app/routes/docs.tsx", "app/routes/docs.$.tsx", "app/routes/docs.api.search.ts"],
79
+ guideRequiredFiles: [
80
+ "app/components/guide-widget.tsx",
81
+ "app/guide/corpus.ts",
82
+ "app/guide/corpus.gen.ts",
83
+ "app/guide/corpus.manifest.json",
84
+ "app/guide/resources.json",
85
+ "content/guide/capability-map.md"
86
+ ],
87
+ apiRequiredFiles: ["app/api/operations.ts"],
88
+ guideGeneratedCorpusFile: "app/guide/corpus.gen.ts",
89
+ guideCorpusManifestFile: "app/guide/corpus.manifest.json",
90
+ guideResourceConfigFile: "app/guide/resources.json",
91
+ patternTestFiles: ["tests/raybase-patterns.test.ts"]
92
+ },
93
+ "astro-emdash": {
94
+ kind: "astro-emdash",
95
+ schemaModule: "src/db/schema.ts",
96
+ appConfigModule: "src/raybase.config.ts",
97
+ storageModule: "src/db/storage.ts",
98
+ migrationsModulePath: "src/db/migrations.gen.ts",
99
+ serverFile: "src/raybase.server.ts",
100
+ wranglerMain: ["src/worker-entry.ts"],
101
+ workerEntryFile: "src/worker-entry.ts",
102
+ appSourceDirs: ["src/"],
103
+ routeInventory: { kind: "tanstack", directory: "src/routes" },
104
+ requiredFiles: [
105
+ "src/routes/__root.tsx",
106
+ "src/routes/_app.tsx",
107
+ "src/routes/_app/index.tsx",
108
+ "site/package.json",
109
+ "site/astro.config.mjs",
110
+ "site/wrangler.jsonc",
111
+ "site/src/middleware.ts",
112
+ "site/src/pages/[...slug].astro",
113
+ "site/src/pages/_raybase/handoff/consume.ts",
114
+ "site/src/pages/_raybase/islands/action.ts",
115
+ "site/src/content-door/resolve-page.ts",
116
+ "site/src/content-door/raybase-routes.ts",
117
+ "site/src/content-door/seed.ts"
118
+ ],
119
+ docsRequiredFiles: [
120
+ "source.config.ts",
121
+ "content/docs/index.mdx",
122
+ "content/docs/getting-started.mdx",
123
+ "content/docs/mcp.mdx",
124
+ "content/docs/meta.json",
125
+ "src/docs/docs-assets.ts",
126
+ "src/docs/docs-client.tsx",
127
+ "src/docs/docs-data.ts",
128
+ "src/docs/docs-handler.tsx",
129
+ "src/docs/docs-layout.tsx",
130
+ "src/docs/docs-mdx.tsx",
131
+ "src/docs/docs-page-actions.tsx",
132
+ "src/docs/docs-page.tsx",
133
+ "src/docs/llm-text.ts",
134
+ "src/docs/source.ts",
135
+ "src/styles-docs.css",
136
+ "src/routes/docs.index.tsx",
137
+ "src/routes/docs.tsx",
138
+ "src/routes/docs/$.tsx",
139
+ "src/routes/docs/api/markdown.ts",
140
+ "src/routes/docs/api/search.ts"
141
+ ],
142
+ docsRouteFiles: ["src/routes/docs.index.tsx", "src/routes/docs.tsx", "src/routes/docs/$.tsx", "src/routes/docs/api/markdown.ts", "src/routes/docs/api/search.ts"],
143
+ guideRequiredFiles: [
144
+ "src/components/guide-widget.tsx",
145
+ "src/guide/corpus.ts",
146
+ "src/guide/corpus.gen.ts",
147
+ "src/guide/corpus.manifest.json",
148
+ "src/guide/resources.json",
149
+ "content/guide/capability-map.md"
150
+ ],
151
+ apiRequiredFiles: ["src/api/operations.ts"],
152
+ guideGeneratedCorpusFile: "src/guide/corpus.gen.ts",
153
+ guideCorpusManifestFile: "src/guide/corpus.manifest.json",
154
+ guideResourceConfigFile: "src/guide/resources.json",
155
+ patternTestFiles: ["tests/raybase-patterns.test.ts"],
156
+ contentSite: {
157
+ directory: "site",
158
+ wranglerConfig: "site/wrangler.jsonc",
159
+ packageJson: "site/package.json",
160
+ localPort: 4321,
161
+ d1Binding: "EMDASH_DB",
162
+ r2Binding: "EMDASH_MEDIA"
163
+ }
164
+ }
165
+ };
166
+ export const FRAMEWORK_KINDS = Object.keys(profiles);
167
+ export function isFrameworkKind(value) {
168
+ return typeof value === "string" && Object.prototype.hasOwnProperty.call(profiles, value);
169
+ }
170
+ /**
171
+ * Thrown when a project's package.json does not name a known framework in
172
+ * `raybase.framework`. Every project created by create-raybase carries the
173
+ * marker; there is no default.
174
+ */
175
+ export class FrameworkResolutionError extends Error {
176
+ constructor(message) {
177
+ super(message);
178
+ this.name = "FrameworkResolutionError";
179
+ }
180
+ }
181
+ const VALID_FRAMEWORKS = FRAMEWORK_KINDS.join(", ");
182
+ /** Reads `raybase.framework` from `<cwd>/package.json`; throws FrameworkResolutionError when it is missing or unknown. */
183
+ export function readFrameworkKind(cwd) {
184
+ const file = join(cwd, "package.json");
185
+ if (!existsSync(file)) {
186
+ throw new FrameworkResolutionError(`No package.json in ${cwd}. Run this from a Raybase project root.`);
187
+ }
188
+ let parsed;
189
+ try {
190
+ parsed = JSON.parse(readFileSync(file, "utf8"));
191
+ }
192
+ catch (error) {
193
+ throw new FrameworkResolutionError(`package.json in ${cwd} could not be parsed: ${error instanceof Error ? error.message : String(error)}`);
194
+ }
195
+ const value = parsed?.raybase?.framework;
196
+ if (value === undefined || value === null || value === "") {
197
+ throw new FrameworkResolutionError(`package.json has no raybase.framework. Set it to one of: ${VALID_FRAMEWORKS}.`);
198
+ }
199
+ if (!isFrameworkKind(value)) {
200
+ throw new FrameworkResolutionError(`package.json raybase.framework is ${JSON.stringify(value)}, which is not a Raybase framework. Use one of: ${VALID_FRAMEWORKS}.`);
201
+ }
202
+ return value;
203
+ }
204
+ export function frameworkProfile(kind) {
205
+ return profiles[kind];
206
+ }
207
+ export function resolveFrameworkProfile(cwd) {
208
+ return profiles[readFrameworkKind(cwd)];
209
+ }
210
+ //# sourceMappingURL=frameworks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameworks.js","sourceRoot":"","sources":["../src/frameworks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,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,GAAG,CAAC,CAAC;IACtH,CAAC;IACD,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,wBAAwB,CAAC,qCAAqC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,mDAAmD,gBAAgB,GAAG,CAAC,CAAC;IACvK,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAmB;IAClD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,GAAW;IACjD,OAAO,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { FrameworkProfile } from "./frameworks.js";
2
+ export declare const guideAppCapabilityMapContext = "app-capability-map";
3
+ export type GuideCorpusInspection = {
4
+ manifestFile: string;
5
+ exists: boolean;
6
+ parseError: string | null;
7
+ schemaErrors: string[];
8
+ documentCount: number;
9
+ hasAnyDocuments: boolean;
10
+ hasPublicDocuments: boolean;
11
+ hasDocs: boolean;
12
+ hasPublicDocs: boolean;
13
+ hasAppCapabilityMap: boolean;
14
+ };
15
+ export type GuideDocsAudience = "signed-in" | "public";
16
+ export type GuideCorpusDoctorIssue = {
17
+ level: "error" | "warning";
18
+ check: "guide-corpus";
19
+ message: string;
20
+ fix: string;
21
+ };
22
+ export declare function inspectGuideCorpus(cwd: string, profile: FrameworkProfile): GuideCorpusInspection;
23
+ export declare function guideDocsSurfaceCorpusIssue(inspection: GuideCorpusInspection, audience: GuideDocsAudience, docsRoot: string): GuideCorpusDoctorIssue | null;
24
+ //# sourceMappingURL=guide-corpus-doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guide-corpus-doctor.d.ts","sourceRoot":"","sources":["../src/guide-corpus-doctor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AAEjE,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAIF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,qBAAqB,CA4BhG;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,qBAAqB,EACjC,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,MAAM,GACf,sBAAsB,GAAG,IAAI,CAa/B"}
@@ -0,0 +1,111 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ export const guideAppCapabilityMapContext = "app-capability-map";
4
+ const guideSources = new Set(["docs", "faq", "spec", "route", "schema", "policy", "support"]);
5
+ export function inspectGuideCorpus(cwd, profile) {
6
+ const manifestFile = profile.guideCorpusManifestFile;
7
+ const file = join(cwd, manifestFile);
8
+ if (!existsSync(file)) {
9
+ return emptyInspection(manifestFile, false, null, []);
10
+ }
11
+ let parsed;
12
+ try {
13
+ parsed = JSON.parse(readFileSync(file, "utf8"));
14
+ }
15
+ catch (error) {
16
+ return emptyInspection(manifestFile, true, error instanceof Error ? error.message : String(error), []);
17
+ }
18
+ const schemaErrors = validateManifest(parsed);
19
+ const documents = schemaErrors.length ? [] : (parsed.documents);
20
+ return {
21
+ manifestFile,
22
+ exists: true,
23
+ parseError: null,
24
+ schemaErrors,
25
+ documentCount: documents.length,
26
+ hasAnyDocuments: documents.length > 0,
27
+ hasPublicDocuments: documents.some((document) => document.public === true),
28
+ hasDocs: documents.some((document) => document.source === "docs"),
29
+ hasPublicDocs: documents.some((document) => document.source === "docs" && document.public === true),
30
+ hasAppCapabilityMap: documents.some((document) => document.guideContext === guideAppCapabilityMapContext)
31
+ };
32
+ }
33
+ export function guideDocsSurfaceCorpusIssue(inspection, audience, docsRoot) {
34
+ if (!inspection.hasAnyDocuments || inspection.schemaErrors.length)
35
+ return null;
36
+ const publicDocsSurface = audience === "public";
37
+ const missingDocsDocuments = publicDocsSurface ? !inspection.hasPublicDocs : !inspection.hasDocs;
38
+ if (!missingDocsDocuments)
39
+ return null;
40
+ return {
41
+ level: publicDocsSurface ? "error" : "warning",
42
+ check: "guide-corpus",
43
+ message: publicDocsSurface
44
+ ? "Public Guide docs surface is enabled but the generated corpus has no public docs documents."
45
+ : "Guide signed-in docs surface is enabled but the generated corpus has no docs documents.",
46
+ fix: `Add app help docs in ${docsRoot}, then run raybase guide index.`
47
+ };
48
+ }
49
+ function emptyInspection(manifestFile, exists, parseError, schemaErrors) {
50
+ return {
51
+ manifestFile,
52
+ exists,
53
+ parseError,
54
+ schemaErrors,
55
+ documentCount: 0,
56
+ hasAnyDocuments: false,
57
+ hasPublicDocuments: false,
58
+ hasDocs: false,
59
+ hasPublicDocs: false,
60
+ hasAppCapabilityMap: false
61
+ };
62
+ }
63
+ function validateManifest(value) {
64
+ const errors = [];
65
+ if (!isRecord(value))
66
+ return ["Guide corpus manifest must be a JSON object."];
67
+ if (value.schemaVersion !== 1)
68
+ errors.push("Guide corpus manifest schemaVersion must be 1.");
69
+ if (!Array.isArray(value.sources))
70
+ errors.push("Guide corpus manifest sources must be an array.");
71
+ if (!Array.isArray(value.documents)) {
72
+ errors.push("Guide corpus manifest documents must be an array.");
73
+ return errors;
74
+ }
75
+ value.documents.forEach((document, index) => {
76
+ const prefix = `documents[${index}]`;
77
+ if (!isRecord(document)) {
78
+ errors.push(`${prefix} must be an object.`);
79
+ return;
80
+ }
81
+ for (const field of ["id", "title", "source", "text"]) {
82
+ if (typeof document[field] !== "string" || !document[field])
83
+ errors.push(`${prefix}.${field} must be a non-empty string.`);
84
+ }
85
+ if (typeof document.source === "string" && !guideSources.has(document.source)) {
86
+ errors.push(`${prefix}.source must be one of ${Array.from(guideSources).join(", ")}.`);
87
+ }
88
+ if ("public" in document && typeof document.public !== "boolean")
89
+ errors.push(`${prefix}.public must be a boolean when present.`);
90
+ if ("guideContext" in document && document.guideContext !== null && typeof document.guideContext !== "string") {
91
+ errors.push(`${prefix}.guideContext must be a string or null when present.`);
92
+ }
93
+ if ("routePatterns" in document && !stringArray(document.routePatterns)) {
94
+ errors.push(`${prefix}.routePatterns must be an array of strings when present.`);
95
+ }
96
+ if ("url" in document && typeof document.url !== "string")
97
+ errors.push(`${prefix}.url must be a string when present.`);
98
+ if ("updatedAt" in document && typeof document.updatedAt !== "string")
99
+ errors.push(`${prefix}.updatedAt must be a string when present.`);
100
+ if ("hash" in document && typeof document.hash !== "string")
101
+ errors.push(`${prefix}.hash must be a string when present.`);
102
+ });
103
+ return errors;
104
+ }
105
+ function isRecord(value) {
106
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
107
+ }
108
+ function stringArray(value) {
109
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
110
+ }
111
+ //# sourceMappingURL=guide-corpus-doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guide-corpus-doctor.js","sourceRoot":"","sources":["../src/guide-corpus-doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,E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,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,sCAAsC,CAAC,CAAC;IAC5H,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;AACjF,CAAC"}
@@ -0,0 +1,85 @@
1
+ export type RaybaseSecretRequirement = {
2
+ name: string;
3
+ required: boolean;
4
+ /** What a value looks like. */
5
+ form: string;
6
+ /** What it is for, and what changing it does. */
7
+ purpose: string;
8
+ };
9
+ export type RaybaseSecretInputs = {
10
+ backupsEnabled: boolean;
11
+ sealsData: boolean;
12
+ handoff: boolean;
13
+ aiGatewaySecretName?: string | null;
14
+ /** Names the app's own wrangler.jsonc declares in its top-level secrets.required. */
15
+ declared?: readonly string[];
16
+ };
17
+ export declare function raybaseProductionSecrets(input: RaybaseSecretInputs): RaybaseSecretRequirement[];
18
+ /** Fresh values for the required secrets that Raybase knows how to make. Writes nothing. */
19
+ export declare function freshSecretValues(secrets: readonly RaybaseSecretRequirement[], generateHandoffPrivateJwk: () => string): Record<string, string>;
20
+ type BuiltConfig = {
21
+ file: string;
22
+ config: Record<string, unknown>;
23
+ auxiliary: string[];
24
+ };
25
+ /** The Wrangler config the framework build wrote, as `.wrangler/deploy/config.json` points to it. */
26
+ export declare function readBuiltWranglerConfig(cwd: string): BuiltConfig | null;
27
+ export type RaybaseBuildRequirements = {
28
+ schemaVersion: 1;
29
+ generatedBy: string;
30
+ app: {
31
+ name: string | null;
32
+ appId: string | null;
33
+ framework: string;
34
+ };
35
+ worker: {
36
+ name: string | null;
37
+ /** The built Wrangler config, relative to the project. Deploy it with `wrangler deploy --config <this>`, or from the project root. */
38
+ config: string;
39
+ main: string | null;
40
+ compatibilityDate: string | null;
41
+ compatibilityFlags: string[];
42
+ assets: Record<string, unknown> | null;
43
+ };
44
+ durableObjects: Array<Record<string, unknown>>;
45
+ /** Durable Object migration tags, an append-only ledger: never rewrite or drop one. */
46
+ migrations: Array<Record<string, unknown>>;
47
+ r2Buckets: Array<Record<string, unknown>>;
48
+ d1Databases: Array<Record<string, unknown>>;
49
+ kvNamespaces: Array<Record<string, unknown>>;
50
+ queues: {
51
+ producers: Array<Record<string, unknown>>;
52
+ consumers: Array<Record<string, unknown>>;
53
+ };
54
+ vectorize: Array<Record<string, unknown>>;
55
+ ai: Record<string, unknown> | null;
56
+ services: Array<Record<string, unknown>>;
57
+ sendEmail: Array<Record<string, unknown>>;
58
+ triggers: {
59
+ crons: string[];
60
+ };
61
+ /** Plain-text settings the build carries; not secret. */
62
+ vars: Record<string, unknown>;
63
+ secrets: RaybaseSecretRequirement[];
64
+ /** Further Workers the build produced (a content site's), by built config. */
65
+ additionalWorkers: string[];
66
+ /** What the app does for itself when it starts, so a host need not. */
67
+ atStartup: string[];
68
+ };
69
+ export declare function buildRequirements(cwd: string, input: {
70
+ built: BuiltConfig;
71
+ framework: string;
72
+ appName: string | null;
73
+ appId: string | null;
74
+ secrets: RaybaseSecretRequirement[];
75
+ generatedBy: string;
76
+ }): RaybaseBuildRequirements;
77
+ /**
78
+ * Declares the required secrets in the built config (secrets.required), so
79
+ * `wrangler deploy` of the build refuses to create a Worker that lacks them
80
+ * and `wrangler deploy --secrets-file` can supply them, and writes the
81
+ * requirements beside it. Returns the requirements file's path.
82
+ */
83
+ export declare function writeBuildRequirements(built: BuiltConfig, requirements: RaybaseBuildRequirements): string;
84
+ export {};
85
+ //# sourceMappingURL=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AE,OAAO,CAAC,CAAC,CAAC;IAC1C,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACpC,8EAA8E;IAC9E,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,uEAAuE;IACvE,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE;IACpD,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,wBAAwB,CAwC3B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,wBAAwB,GAAG,MAAM,CAOzG"}
@@ -0,0 +1,136 @@
1
+ // What a built Raybase app needs from whoever runs it: the deployed Worker's
2
+ // bindings, triggers and vars, read from the framework build's own Wrangler
3
+ // config, and the secrets it must be given. `raybase build` writes this as
4
+ // raybase.requirements.json beside the built config and declares the required
5
+ // secrets there (secrets.required), so Cloudflare's own `wrangler deploy` of
6
+ // the build refuses to create the Worker without them. A host's builder reads
7
+ // the same file to supply them. Nothing here signs in or deploys.
8
+ import { randomBytes } from "node:crypto";
9
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
10
+ import { dirname, join, relative, resolve } from "node:path";
11
+ const base64urlKey = "base64url of at least 32 random bytes (`raybase secrets new` makes one)";
12
+ export function raybaseProductionSecrets(input) {
13
+ const secrets = [
14
+ {
15
+ name: "BETTER_AUTH_SECRET",
16
+ required: true,
17
+ form: base64urlKey,
18
+ purpose: "Signs sessions, sign-in links and owner-setup tokens. Changing it signs everyone out."
19
+ }
20
+ ];
21
+ if (input.backupsEnabled) {
22
+ secrets.push({ name: "RAYBASE_BACKUPS_KEY", required: true, form: base64urlKey, purpose: "Encrypts every backup. Without it, backups are not written and cannot be opened." }, { name: "RAYBASE_BACKUPS_KEY_RETAINED", required: false, form: "comma-separated earlier RAYBASE_BACKUPS_KEY values", purpose: "Keeps backups sealed with a rotated-out key readable." });
23
+ }
24
+ if (input.sealsData) {
25
+ secrets.push({ name: "RAYBASE_DATA_SECRETS_KEY", required: true, form: base64urlKey, purpose: "Seals secret() columns at rest. Values sealed with a key cannot be opened without it." }, { name: "RAYBASE_DATA_SECRETS_KEY_RETAINED", required: false, form: "comma-separated earlier RAYBASE_DATA_SECRETS_KEY values", purpose: "Keeps values sealed with a rotated-out key readable until they are resealed." });
26
+ }
27
+ if (input.handoff) {
28
+ secrets.push({
29
+ name: "RAYBASE_HANDOFF_PRIVATE_JWK",
30
+ required: true,
31
+ form: "an EC P-256 private key as a JWK (JSON), `raybase secrets new` makes one",
32
+ purpose: "Signs the handoff tokens other apps and the content site accept. Changing it invalidates outstanding ones."
33
+ });
34
+ }
35
+ if (input.aiGatewaySecretName) {
36
+ secrets.push({ name: input.aiGatewaySecretName, required: false, form: "the provider's API key", purpose: "Authenticates AI Gateway requests to the configured provider." });
37
+ }
38
+ for (const name of input.declared ?? []) {
39
+ if (!secrets.some((secret) => secret.name === name)) {
40
+ secrets.push({ name, required: true, form: "as the app documents", purpose: "Declared by the app in wrangler.jsonc secrets.required." });
41
+ }
42
+ }
43
+ return secrets;
44
+ }
45
+ /** Fresh values for the required secrets that Raybase knows how to make. Writes nothing. */
46
+ export function freshSecretValues(secrets, generateHandoffPrivateJwk) {
47
+ const values = {};
48
+ for (const secret of secrets) {
49
+ if (!secret.required)
50
+ continue;
51
+ if (secret.name === "RAYBASE_HANDOFF_PRIVATE_JWK")
52
+ values[secret.name] = generateHandoffPrivateJwk();
53
+ else if (secret.form === base64urlKey)
54
+ values[secret.name] = randomBytes(32).toString("base64url");
55
+ }
56
+ return values;
57
+ }
58
+ /** The Wrangler config the framework build wrote, as `.wrangler/deploy/config.json` points to it. */
59
+ export function readBuiltWranglerConfig(cwd) {
60
+ const pointer = join(cwd, ".wrangler/deploy/config.json");
61
+ if (!existsSync(pointer))
62
+ return null;
63
+ const redirect = JSON.parse(readFileSync(pointer, "utf8"));
64
+ if (!redirect.configPath)
65
+ return null;
66
+ const file = resolve(dirname(pointer), redirect.configPath);
67
+ if (!existsSync(file))
68
+ return null;
69
+ return {
70
+ file,
71
+ config: JSON.parse(readFileSync(file, "utf8")),
72
+ auxiliary: (redirect.auxiliaryWorkers ?? []).map((worker) => worker.configPath).filter((path) => Boolean(path)).map((path) => resolve(dirname(pointer), path))
73
+ };
74
+ }
75
+ function list(value) {
76
+ return Array.isArray(value) ? value.filter((entry) => Boolean(entry) && typeof entry === "object") : [];
77
+ }
78
+ function pick(entry, keys) {
79
+ return Object.fromEntries(keys.filter((key) => entry[key] !== undefined && entry[key] !== null).map((key) => [key, entry[key]]));
80
+ }
81
+ export function buildRequirements(cwd, input) {
82
+ const config = input.built.config;
83
+ const queues = (config.queues && typeof config.queues === "object" ? config.queues : {});
84
+ const triggers = (config.triggers && typeof config.triggers === "object" ? config.triggers : {});
85
+ const durable = (config.durable_objects && typeof config.durable_objects === "object" ? config.durable_objects : {});
86
+ const assets = config.assets && typeof config.assets === "object" ? config.assets : null;
87
+ return {
88
+ schemaVersion: 1,
89
+ generatedBy: input.generatedBy,
90
+ app: { name: input.appName, appId: input.appId, framework: input.framework },
91
+ worker: {
92
+ name: typeof config.name === "string" ? config.name : null,
93
+ config: relative(cwd, input.built.file),
94
+ main: typeof config.main === "string" ? config.main : null,
95
+ compatibilityDate: typeof config.compatibility_date === "string" ? config.compatibility_date : null,
96
+ compatibilityFlags: Array.isArray(config.compatibility_flags) ? config.compatibility_flags.map(String) : [],
97
+ assets: assets ? pick(assets, ["directory", "binding", "not_found_handling", "html_handling", "run_worker_first"]) : null
98
+ },
99
+ durableObjects: list(durable.bindings).map((entry) => pick(entry, ["name", "class_name", "script_name"])),
100
+ migrations: list(config.migrations).map((entry) => pick(entry, ["tag", "new_sqlite_classes", "new_classes", "renamed_classes", "deleted_classes"])),
101
+ r2Buckets: list(config.r2_buckets).map((entry) => pick(entry, ["binding", "bucket_name", "jurisdiction"])),
102
+ d1Databases: list(config.d1_databases).map((entry) => pick(entry, ["binding", "database_name", "database_id"])),
103
+ kvNamespaces: list(config.kv_namespaces).map((entry) => pick(entry, ["binding", "id"])),
104
+ queues: {
105
+ producers: list(queues.producers).map((entry) => pick(entry, ["binding", "queue"])),
106
+ consumers: list(queues.consumers).map((entry) => pick(entry, ["queue", "max_batch_size", "max_batch_timeout", "max_retries", "dead_letter_queue"]))
107
+ },
108
+ vectorize: list(config.vectorize).map((entry) => pick(entry, ["binding", "index_name"])),
109
+ ai: config.ai && typeof config.ai === "object" ? pick(config.ai, ["binding"]) : null,
110
+ services: list(config.services).map((entry) => pick(entry, ["binding", "service", "entrypoint"])),
111
+ sendEmail: list(config.send_email).map((entry) => pick(entry, ["name", "destination_address", "allowed_destination_addresses"])),
112
+ triggers: { crons: Array.isArray(triggers.crons) ? triggers.crons.map(String) : [] },
113
+ vars: config.vars && typeof config.vars === "object" ? { ...config.vars } : {},
114
+ secrets: input.secrets,
115
+ additionalWorkers: input.built.auxiliary.map((file) => relative(cwd, file)),
116
+ atStartup: [
117
+ "Applies its own database changes (tables and app migrations) to each Durable Object on first use; nothing needs running before the first request.",
118
+ "Creates no Cloudflare resources: the buckets, queues, D1 databases and indexes above must exist, as Wrangler's resource provisioning or the host creates them."
119
+ ]
120
+ };
121
+ }
122
+ /**
123
+ * Declares the required secrets in the built config (secrets.required), so
124
+ * `wrangler deploy` of the build refuses to create a Worker that lacks them
125
+ * and `wrangler deploy --secrets-file` can supply them, and writes the
126
+ * requirements beside it. Returns the requirements file's path.
127
+ */
128
+ export function writeBuildRequirements(built, requirements) {
129
+ const required = requirements.secrets.filter((secret) => secret.required).map((secret) => secret.name);
130
+ const config = { ...built.config, secrets: { ...(built.config.secrets && typeof built.config.secrets === "object" ? built.config.secrets : {}), required } };
131
+ writeFileSync(built.file, `${JSON.stringify(config)}\n`);
132
+ const file = join(dirname(built.file), "raybase.requirements.json");
133
+ writeFileSync(file, `${JSON.stringify(requirements, null, 2)}\n`);
134
+ return file;
135
+ }
136
+ //# sourceMappingURL=hosting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosting.js","sourceRoot":"","sources":["../src/hosting.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,2EAA2E;AAC3E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,kEAAkE;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoB7D,MAAM,YAAY,GAAG,yEAAyE,CAAC;AAE/F,MAAM,UAAU,wBAAwB,CAAC,KAA0B;IACjE,MAAM,OAAO,GAA+B;QAC1C;YACE,IAAI,EAAE,oBAAoB;YAC1B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,uFAAuF;SACjG;KACF,CAAC;IACF,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CACV,EAAE,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,kFAAkF,EAAE,EAChK,EAAE,IAAI,EAAE,8BAA8B,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,oDAAoD,EAAE,O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