@raybase/create 0.0.2 → 0.3.4

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 (644) hide show
  1. package/LICENSE +21 -0
  2. package/THIRD_PARTY_NOTICES.md +38 -0
  3. package/assets/apple-touch-icons/0.png +0 -0
  4. package/assets/apple-touch-icons/1.png +0 -0
  5. package/assets/apple-touch-icons/2.png +0 -0
  6. package/assets/apple-touch-icons/3.png +0 -0
  7. package/assets/apple-touch-icons/4.png +0 -0
  8. package/assets/apple-touch-icons/5.png +0 -0
  9. package/assets/apple-touch-icons/6.png +0 -0
  10. package/assets/apple-touch-icons/7.png +0 -0
  11. package/assets/apple-touch-icons/8.png +0 -0
  12. package/assets/apple-touch-icons/9.png +0 -0
  13. package/assets/apple-touch-icons/A.png +0 -0
  14. package/assets/apple-touch-icons/B.png +0 -0
  15. package/assets/apple-touch-icons/C.png +0 -0
  16. package/assets/apple-touch-icons/D.png +0 -0
  17. package/assets/apple-touch-icons/E.png +0 -0
  18. package/assets/apple-touch-icons/F.png +0 -0
  19. package/assets/apple-touch-icons/G.png +0 -0
  20. package/assets/apple-touch-icons/H.png +0 -0
  21. package/assets/apple-touch-icons/I.png +0 -0
  22. package/assets/apple-touch-icons/J.png +0 -0
  23. package/assets/apple-touch-icons/K.png +0 -0
  24. package/assets/apple-touch-icons/L.png +0 -0
  25. package/assets/apple-touch-icons/M.png +0 -0
  26. package/assets/apple-touch-icons/N.png +0 -0
  27. package/assets/apple-touch-icons/O.png +0 -0
  28. package/assets/apple-touch-icons/P.png +0 -0
  29. package/assets/apple-touch-icons/Q.png +0 -0
  30. package/assets/apple-touch-icons/R.png +0 -0
  31. package/assets/apple-touch-icons/S.png +0 -0
  32. package/assets/apple-touch-icons/T.png +0 -0
  33. package/assets/apple-touch-icons/U.png +0 -0
  34. package/assets/apple-touch-icons/V.png +0 -0
  35. package/assets/apple-touch-icons/W.png +0 -0
  36. package/assets/apple-touch-icons/X.png +0 -0
  37. package/assets/apple-touch-icons/Y.png +0 -0
  38. package/assets/apple-touch-icons/Z.png +0 -0
  39. package/assets/apple-touch-icons/default.png +0 -0
  40. package/dist/.source-hash +1 -0
  41. package/dist/index.d.ts +56 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +2353 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/raybase-package-ranges.d.ts +11 -0
  46. package/dist/raybase-package-ranges.d.ts.map +1 -0
  47. package/dist/raybase-package-ranges.js +11 -0
  48. package/dist/raybase-package-ranges.js.map +1 -0
  49. package/dist/source-fetch.d.ts +91 -0
  50. package/dist/source-fetch.d.ts.map +1 -0
  51. package/dist/source-fetch.js +325 -0
  52. package/dist/source-fetch.js.map +1 -0
  53. package/dist/source-hash.d.ts +2 -0
  54. package/dist/source-hash.d.ts.map +1 -0
  55. package/dist/source-hash.js +23 -0
  56. package/dist/source-hash.js.map +1 -0
  57. package/dist/starter-description.d.ts +44 -0
  58. package/dist/starter-description.d.ts.map +1 -0
  59. package/dist/starter-description.js +273 -0
  60. package/dist/starter-description.js.map +1 -0
  61. package/dist/starter-source.d.ts +43 -0
  62. package/dist/starter-source.d.ts.map +1 -0
  63. package/dist/starter-source.js +156 -0
  64. package/dist/starter-source.js.map +1 -0
  65. package/dist/store-app-apply.d.ts +27 -0
  66. package/dist/store-app-apply.d.ts.map +1 -0
  67. package/dist/store-app-apply.js +100 -0
  68. package/dist/store-app-apply.js.map +1 -0
  69. package/dist/store-app-manifest.d.ts +86 -0
  70. package/dist/store-app-manifest.d.ts.map +1 -0
  71. package/dist/store-app-manifest.js +110 -0
  72. package/dist/store-app-manifest.js.map +1 -0
  73. package/dist/store-app-registry.d.ts +30 -0
  74. package/dist/store-app-registry.d.ts.map +1 -0
  75. package/dist/store-app-registry.js +232 -0
  76. package/dist/store-app-registry.js.map +1 -0
  77. package/models/recommended.json +42 -0
  78. package/modules/api/templates/react-router/app/api/operations.ts +8 -0
  79. package/modules/api/templates/tanstack-start/src/api/operations.ts +15 -0
  80. package/modules/docs/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
  81. package/modules/docs/templates/astro-emdash/content/docs/index.mdx +13 -0
  82. package/modules/docs/templates/astro-emdash/content/docs/mcp.mdx +11 -0
  83. package/modules/docs/templates/astro-emdash/content/docs/meta.json +4 -0
  84. package/modules/docs/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
  85. package/modules/docs/templates/astro-emdash/site/content/docs/index.mdx +12 -0
  86. package/modules/docs/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
  87. package/modules/docs/templates/astro-emdash/site/content/docs/meta.json +4 -0
  88. package/modules/docs/templates/astro-emdash/site/source.config.ts +10 -0
  89. package/modules/docs/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
  90. package/modules/docs/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
  91. package/modules/docs/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
  92. package/modules/docs/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
  93. package/modules/docs/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
  94. package/modules/docs/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
  95. package/modules/docs/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
  96. package/modules/docs/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
  97. package/modules/docs/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
  98. package/modules/docs/templates/astro-emdash/site/src/docs/source.ts +7 -0
  99. package/modules/docs/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
  100. package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
  101. package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
  102. package/modules/docs/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
  103. package/modules/docs/templates/astro-emdash/site/src/styles-docs.css +3 -0
  104. package/modules/docs/templates/astro-emdash/source.config.ts +10 -0
  105. package/modules/docs/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
  106. package/modules/docs/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
  107. package/modules/docs/templates/astro-emdash/src/docs/docs-data.ts +24 -0
  108. package/modules/docs/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
  109. package/modules/docs/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
  110. package/modules/docs/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
  111. package/modules/docs/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
  112. package/modules/docs/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
  113. package/modules/docs/templates/astro-emdash/src/docs/llm-text.ts +61 -0
  114. package/modules/docs/templates/astro-emdash/src/docs/source.ts +7 -0
  115. package/modules/docs/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
  116. package/modules/docs/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
  117. package/modules/docs/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
  118. package/modules/docs/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
  119. package/modules/docs/templates/astro-emdash/src/routes/docs.tsx +22 -0
  120. package/modules/docs/templates/astro-emdash/src/styles-docs.css +3 -0
  121. package/modules/docs/templates/react-router/app/components/mdx.tsx +79 -0
  122. package/modules/docs/templates/react-router/app/lib/layout.shared.tsx +54 -0
  123. package/modules/docs/templates/react-router/app/lib/source.ts +7 -0
  124. package/modules/docs/templates/react-router/app/routes/docs.$.tsx +49 -0
  125. package/modules/docs/templates/react-router/app/routes/docs.api.search.ts +10 -0
  126. package/modules/docs/templates/react-router/app/routes/docs.tsx +13 -0
  127. package/modules/docs/templates/react-router/content/docs/getting-started.mdx +8 -0
  128. package/modules/docs/templates/react-router/content/docs/index.mdx +8 -0
  129. package/modules/docs/templates/react-router/content/docs/mcp.mdx +121 -0
  130. package/modules/docs/templates/react-router/content/docs/meta.json +4 -0
  131. package/modules/docs/templates/react-router/source.config.ts +5 -0
  132. package/modules/docs/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
  133. package/modules/docs/templates/tanstack-start/content/docs/index.mdx +8 -0
  134. package/modules/docs/templates/tanstack-start/content/docs/mcp.mdx +121 -0
  135. package/modules/docs/templates/tanstack-start/content/docs/meta.json +4 -0
  136. package/modules/docs/templates/tanstack-start/source.config.ts +10 -0
  137. package/modules/docs/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
  138. package/modules/docs/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
  139. package/modules/docs/templates/tanstack-start/src/docs/docs-data.ts +24 -0
  140. package/modules/docs/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
  141. package/modules/docs/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
  142. package/modules/docs/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
  143. package/modules/docs/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
  144. package/modules/docs/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
  145. package/modules/docs/templates/tanstack-start/src/docs/llm-text.ts +61 -0
  146. package/modules/docs/templates/tanstack-start/src/docs/source.ts +7 -0
  147. package/modules/docs/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
  148. package/modules/docs/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
  149. package/modules/docs/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
  150. package/modules/docs/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
  151. package/modules/docs/templates/tanstack-start/src/routes/docs.tsx +22 -0
  152. package/modules/docs/templates/tanstack-start/src/styles-docs.css +3 -0
  153. package/modules/guide/templates/astro-emdash/content/guide/capability-map.md +17 -0
  154. package/modules/guide/templates/astro-emdash/src/components/guide-widget.tsx +41 -0
  155. package/modules/guide/templates/astro-emdash/src/guide/actions.ts +8 -0
  156. package/modules/guide/templates/astro-emdash/src/guide/config.ts +21 -0
  157. package/modules/guide/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
  158. package/modules/guide/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
  159. package/modules/guide/templates/astro-emdash/src/guide/corpus.ts +4 -0
  160. package/modules/guide/templates/astro-emdash/src/guide/resources.json +4 -0
  161. package/modules/guide/templates/react-router/app/components/guide-widget.tsx +29 -0
  162. package/modules/guide/templates/react-router/app/guide/actions.ts +3 -0
  163. package/modules/guide/templates/react-router/app/guide/config.ts +21 -0
  164. package/modules/guide/templates/react-router/app/guide/corpus.gen.ts +4 -0
  165. package/modules/guide/templates/react-router/app/guide/corpus.manifest.json +22 -0
  166. package/modules/guide/templates/react-router/app/guide/corpus.ts +4 -0
  167. package/modules/guide/templates/react-router/app/guide/resources.json +4 -0
  168. package/modules/guide/templates/react-router/content/guide/capability-map.md +13 -0
  169. package/modules/guide/templates/tanstack-start/content/guide/capability-map.md +17 -0
  170. package/modules/guide/templates/tanstack-start/src/components/guide-widget.tsx +41 -0
  171. package/modules/guide/templates/tanstack-start/src/guide/actions.ts +17 -0
  172. package/modules/guide/templates/tanstack-start/src/guide/config.ts +21 -0
  173. package/modules/guide/templates/tanstack-start/src/guide/corpus.gen.ts +4 -0
  174. package/modules/guide/templates/tanstack-start/src/guide/corpus.manifest.json +22 -0
  175. package/modules/guide/templates/tanstack-start/src/guide/corpus.ts +4 -0
  176. package/modules/guide/templates/tanstack-start/src/guide/resources.json +4 -0
  177. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  178. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  179. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  180. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  181. package/modules/openai-subscription/templates/astro-emdash/src/openai-subscription.ts +11 -0
  182. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  183. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  184. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  185. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  186. package/modules/openai-subscription/templates/react-router/app/openai-subscription.ts +11 -0
  187. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  188. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  189. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  190. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  191. package/modules/openai-subscription/templates/tanstack-start/src/openai-subscription.ts +11 -0
  192. package/package.json +34 -8
  193. package/skills/README.md +122 -0
  194. package/skills/raybase-actions/SKILL.md +223 -0
  195. package/skills/raybase-actions/references/action-patterns.md +190 -0
  196. package/skills/raybase-actions/references/adapting-actions.md +93 -0
  197. package/skills/raybase-actions/references/testing-actions.md +48 -0
  198. package/skills/raybase-agent-debugging/SKILL.md +230 -0
  199. package/skills/raybase-ai/SKILL.md +1310 -0
  200. package/skills/raybase-api/SKILL.md +45 -0
  201. package/skills/raybase-astro-emdash/SKILL.md +143 -0
  202. package/skills/raybase-astro-emdash-content-model/SKILL.md +217 -0
  203. package/skills/raybase-astro-emdash-content-model/references/LICENSE-emdash +9 -0
  204. package/skills/raybase-astro-emdash-content-model/references/emdash-collections.md +265 -0
  205. package/skills/raybase-astro-emdash-design/LICENSE-impeccable +60 -0
  206. package/skills/raybase-astro-emdash-design/SKILL.md +170 -0
  207. package/skills/raybase-astro-emdash-design/reference/color.md +91 -0
  208. package/skills/raybase-astro-emdash-design/reference/copy.md +73 -0
  209. package/skills/raybase-astro-emdash-design/reference/direction.md +115 -0
  210. package/skills/raybase-astro-emdash-design/reference/imagery.md +84 -0
  211. package/skills/raybase-astro-emdash-design/reference/layout.md +69 -0
  212. package/skills/raybase-astro-emdash-design/reference/motion.md +75 -0
  213. package/skills/raybase-astro-emdash-design/reference/polish.md +75 -0
  214. package/skills/raybase-astro-emdash-design/reference/typography.md +72 -0
  215. package/skills/raybase-astro-emdash-galley/SKILL.md +265 -0
  216. package/skills/raybase-astro-emdash-migration/SKILL.md +218 -0
  217. package/skills/raybase-astro-emdash-migration/references/inventory-and-conversion.md +242 -0
  218. package/skills/raybase-astro-emdash-security-review/SKILL.md +68 -0
  219. package/skills/raybase-astro-emdash-theme-selection/SKILL.md +216 -0
  220. package/skills/raybase-auth/SKILL.md +358 -0
  221. package/skills/raybase-background-jobs/SKILL.md +774 -0
  222. package/skills/raybase-building/SKILL.md +409 -0
  223. package/skills/raybase-building/references/interview-and-spec.md +87 -0
  224. package/skills/raybase-building/references/planning-docs.md +26 -0
  225. package/skills/raybase-building/references/schema-and-config.md +70 -0
  226. package/skills/raybase-changing-a-live-app/SKILL.md +119 -0
  227. package/skills/raybase-data-and-policies/SKILL.md +377 -0
  228. package/skills/raybase-deploy/SKILL.md +136 -0
  229. package/skills/raybase-docs-writing/SKILL.md +119 -0
  230. package/skills/raybase-guide/SKILL.md +235 -0
  231. package/skills/raybase-mcp/SKILL.md +309 -0
  232. package/skills/raybase-mcp/agents/openai.yaml +4 -0
  233. package/skills/raybase-notifications/SKILL.md +138 -0
  234. package/skills/raybase-pro-migration/SKILL.md +28 -0
  235. package/skills/raybase-react-router/SKILL.md +241 -0
  236. package/skills/raybase-react-router-design/LICENSE-impeccable +60 -0
  237. package/skills/raybase-react-router-design/SKILL.md +135 -0
  238. package/skills/raybase-react-router-design/reference/color.md +87 -0
  239. package/skills/raybase-react-router-design/reference/copy.md +83 -0
  240. package/skills/raybase-react-router-design/reference/delight.md +48 -0
  241. package/skills/raybase-react-router-design/reference/interaction.md +91 -0
  242. package/skills/raybase-react-router-design/reference/layout.md +82 -0
  243. package/skills/raybase-react-router-design/reference/motion.md +86 -0
  244. package/skills/raybase-react-router-design/reference/polish.md +79 -0
  245. package/skills/raybase-react-router-design/reference/typography.md +71 -0
  246. package/skills/raybase-react-router-security-review/LICENSE +22 -0
  247. package/skills/raybase-react-router-security-review/SKILL.md +190 -0
  248. package/skills/raybase-react-router-security-review/agents/openai.yaml +4 -0
  249. package/skills/raybase-react-router-security-review/references/api-security.md +519 -0
  250. package/skills/raybase-react-router-security-review/references/authentication.md +353 -0
  251. package/skills/raybase-react-router-security-review/references/authorization.md +372 -0
  252. package/skills/raybase-react-router-security-review/references/business-logic.md +443 -0
  253. package/skills/raybase-react-router-security-review/references/cryptography.md +329 -0
  254. package/skills/raybase-react-router-security-review/references/csrf.md +398 -0
  255. package/skills/raybase-react-router-security-review/references/data-protection.md +378 -0
  256. package/skills/raybase-react-router-security-review/references/deserialization.md +410 -0
  257. package/skills/raybase-react-router-security-review/references/error-handling.md +436 -0
  258. package/skills/raybase-react-router-security-review/references/file-security.md +457 -0
  259. package/skills/raybase-react-router-security-review/references/injection.md +259 -0
  260. package/skills/raybase-react-router-security-review/references/logging.md +433 -0
  261. package/skills/raybase-react-router-security-review/references/misconfiguration.md +435 -0
  262. package/skills/raybase-react-router-security-review/references/modern-threats.md +475 -0
  263. package/skills/raybase-react-router-security-review/references/raybase-react-router-security.md +235 -0
  264. package/skills/raybase-react-router-security-review/references/ssrf.md +413 -0
  265. package/skills/raybase-react-router-security-review/references/supply-chain.md +405 -0
  266. package/skills/raybase-react-router-security-review/references/xss.md +336 -0
  267. package/skills/raybase-realtime/SKILL.md +158 -0
  268. package/skills/raybase-realtime/agents/openai.yaml +4 -0
  269. package/skills/raybase-schema/SKILL.md +209 -0
  270. package/skills/raybase-search/SKILL.md +137 -0
  271. package/skills/raybase-search/agents/openai.yaml +4 -0
  272. package/skills/raybase-settings/SKILL.md +139 -0
  273. package/skills/raybase-settings/agents/openai.yaml +4 -0
  274. package/skills/raybase-tanstack-start/SKILL.md +166 -0
  275. package/skills/raybase-tanstack-start-design/LICENSE-impeccable +60 -0
  276. package/skills/raybase-tanstack-start-design/SKILL.md +140 -0
  277. package/skills/raybase-tanstack-start-design/reference/color.md +80 -0
  278. package/skills/raybase-tanstack-start-design/reference/copy.md +83 -0
  279. package/skills/raybase-tanstack-start-design/reference/delight.md +48 -0
  280. package/skills/raybase-tanstack-start-design/reference/interaction.md +91 -0
  281. package/skills/raybase-tanstack-start-design/reference/layout.md +82 -0
  282. package/skills/raybase-tanstack-start-design/reference/motion.md +86 -0
  283. package/skills/raybase-tanstack-start-design/reference/polish.md +79 -0
  284. package/skills/raybase-tanstack-start-design/reference/typography.md +71 -0
  285. package/skills/raybase-tanstack-start-security-review/LICENSE +22 -0
  286. package/skills/raybase-tanstack-start-security-review/SKILL.md +194 -0
  287. package/skills/raybase-tanstack-start-security-review/agents/openai.yaml +4 -0
  288. package/skills/raybase-tanstack-start-security-review/references/api-security.md +519 -0
  289. package/skills/raybase-tanstack-start-security-review/references/authentication.md +353 -0
  290. package/skills/raybase-tanstack-start-security-review/references/authorization.md +372 -0
  291. package/skills/raybase-tanstack-start-security-review/references/business-logic.md +443 -0
  292. package/skills/raybase-tanstack-start-security-review/references/cryptography.md +329 -0
  293. package/skills/raybase-tanstack-start-security-review/references/csrf.md +398 -0
  294. package/skills/raybase-tanstack-start-security-review/references/data-protection.md +378 -0
  295. package/skills/raybase-tanstack-start-security-review/references/deserialization.md +410 -0
  296. package/skills/raybase-tanstack-start-security-review/references/error-handling.md +436 -0
  297. package/skills/raybase-tanstack-start-security-review/references/file-security.md +457 -0
  298. package/skills/raybase-tanstack-start-security-review/references/injection.md +259 -0
  299. package/skills/raybase-tanstack-start-security-review/references/logging.md +433 -0
  300. package/skills/raybase-tanstack-start-security-review/references/misconfiguration.md +435 -0
  301. package/skills/raybase-tanstack-start-security-review/references/modern-threats.md +475 -0
  302. package/skills/raybase-tanstack-start-security-review/references/raybase-tanstack-security.md +208 -0
  303. package/skills/raybase-tanstack-start-security-review/references/ssrf.md +413 -0
  304. package/skills/raybase-tanstack-start-security-review/references/supply-chain.md +405 -0
  305. package/skills/raybase-tanstack-start-security-review/references/xss.md +336 -0
  306. package/skills-manifest.json +41 -0
  307. package/templates/astro-emdash/.dev.vars.example +7 -0
  308. package/templates/astro-emdash/AGENTS.md +122 -0
  309. package/templates/astro-emdash/DESIGN.md +90 -0
  310. package/templates/astro-emdash/components.json +21 -0
  311. package/templates/astro-emdash/content/docs/getting-started.mdx +20 -0
  312. package/templates/astro-emdash/content/docs/index.mdx +13 -0
  313. package/templates/astro-emdash/content/docs/mcp.mdx +11 -0
  314. package/templates/astro-emdash/content/docs/meta.json +4 -0
  315. package/templates/astro-emdash/content/docs/site-templates.mdx +62 -0
  316. package/templates/astro-emdash/dev/CODEBASE-MAP.md +46 -0
  317. package/templates/astro-emdash/dev/SPEC-OVERVIEW.md +15 -0
  318. package/templates/astro-emdash/dev/SPEC.md +84 -0
  319. package/templates/astro-emdash/dev/features/archive/.gitkeep +1 -0
  320. package/templates/astro-emdash/docs/theme-previews/base.svg +24 -0
  321. package/templates/astro-emdash/docs/theme-previews/steel.svg +24 -0
  322. package/templates/astro-emdash/docs/theme-previews/zen.svg +24 -0
  323. package/templates/astro-emdash/docs/themes.md +106 -0
  324. package/templates/astro-emdash/drizzle.config.ts +5 -0
  325. package/templates/astro-emdash/gitignore +11 -0
  326. package/templates/astro-emdash/migrations/app/meta/_journal.json +5 -0
  327. package/templates/astro-emdash/package.json +79 -0
  328. package/templates/astro-emdash/pnpm-workspace.yaml +71 -0
  329. package/templates/astro-emdash/public/_headers +4 -0
  330. package/templates/astro-emdash/site/astro.config.mjs +120 -0
  331. package/templates/astro-emdash/site/demo/README.md +72 -0
  332. package/templates/astro-emdash/site/demo/content/collection.json +43 -0
  333. package/templates/astro-emdash/site/demo/content/entries.json +120 -0
  334. package/templates/astro-emdash/site/demo/templates/demo-article-card/manifest.json +51 -0
  335. package/templates/astro-emdash/site/demo/templates/demo-article-card/sample-content.json +5 -0
  336. package/templates/astro-emdash/site/demo/templates/demo-article-card/template.liquid +48 -0
  337. package/templates/astro-emdash/site/demo/templates/demo-article-page/host.json +9 -0
  338. package/templates/astro-emdash/site/demo/templates/demo-article-page/manifest.json +38 -0
  339. package/templates/astro-emdash/site/demo/templates/demo-article-page/sample-content.json +34 -0
  340. package/templates/astro-emdash/site/demo/templates/demo-article-page/template.liquid +84 -0
  341. package/templates/astro-emdash/site/demo/templates/demo-articles-index/manifest.json +64 -0
  342. package/templates/astro-emdash/site/demo/templates/demo-articles-index/page.json +7 -0
  343. package/templates/astro-emdash/site/demo/templates/demo-articles-index/sample-content.json +24 -0
  344. package/templates/astro-emdash/site/demo/templates/demo-articles-index/template.liquid +100 -0
  345. package/templates/astro-emdash/site/demo/templates/demo-menu-nav/manifest.json +51 -0
  346. package/templates/astro-emdash/site/demo/templates/demo-menu-nav/sample-content.json +5 -0
  347. package/templates/astro-emdash/site/demo/templates/demo-menu-nav/template.liquid +70 -0
  348. package/templates/astro-emdash/site/gitignore +1 -0
  349. package/templates/astro-emdash/site/package.json +56 -0
  350. package/templates/astro-emdash/site/scripts/apply-site-templates.mjs +560 -0
  351. package/templates/astro-emdash/site/scripts/galley-demo.mjs +298 -0
  352. package/templates/astro-emdash/site/scripts/seed-galley-starter.mjs +360 -0
  353. package/templates/astro-emdash/site/scripts/site-origin.mjs +45 -0
  354. package/templates/astro-emdash/site/seed/seed.json +154 -0
  355. package/templates/astro-emdash/site/seed/templates/.gitkeep +1 -0
  356. package/templates/astro-emdash/site/src/components/RaybaseSignedInMenu.astro +163 -0
  357. package/templates/astro-emdash/site/src/components/blocks/RaybaseActionIsland.astro +41 -0
  358. package/templates/astro-emdash/site/src/content-door/raybase-routes.ts +738 -0
  359. package/templates/astro-emdash/site/src/content-door/resolve-page.ts +142 -0
  360. package/templates/astro-emdash/site/src/content-door/seed.ts +85 -0
  361. package/templates/astro-emdash/site/src/env.d.ts +12 -0
  362. package/templates/astro-emdash/site/src/layouts/SiteLayout.astro +68 -0
  363. package/templates/astro-emdash/site/src/lib/palettes.gen.ts +7 -0
  364. package/templates/astro-emdash/site/src/lib/site-motion.ts +169 -0
  365. package/templates/astro-emdash/site/src/lib/site-shell.ts +294 -0
  366. package/templates/astro-emdash/site/src/live.config.ts +8 -0
  367. package/templates/astro-emdash/site/src/middleware.ts +20 -0
  368. package/templates/astro-emdash/site/src/pages/[...slug].astro +113 -0
  369. package/templates/astro-emdash/site/src/pages/_raybase/handoff/consume.ts +6 -0
  370. package/templates/astro-emdash/site/src/pages/_raybase/islands/action.ts +8 -0
  371. package/templates/astro-emdash/site/src/pages/_raybase/sign-out/index.ts +6 -0
  372. package/templates/astro-emdash/site/src/styles/palette-fonts.gen.css +1 -0
  373. package/templates/astro-emdash/site/src/styles/palettes.gen.css +3 -0
  374. package/templates/astro-emdash/site/src/styles.css +607 -0
  375. package/templates/astro-emdash/site/tsconfig.json +12 -0
  376. package/templates/astro-emdash/site/wrangler.jsonc +34 -0
  377. package/templates/astro-emdash/source.config.ts +10 -0
  378. package/templates/astro-emdash/src/actions.ts +58 -0
  379. package/templates/astro-emdash/src/ai/agents.ts +20 -0
  380. package/templates/astro-emdash/src/ai/retrieval.ts +36 -0
  381. package/templates/astro-emdash/src/auth-door.ts +18 -0
  382. package/templates/astro-emdash/src/client.tsx +25 -0
  383. package/templates/astro-emdash/src/components/.gitkeep +1 -0
  384. package/templates/astro-emdash/src/components/account-menu.tsx +91 -0
  385. package/templates/astro-emdash/src/components/auth-shell.tsx +69 -0
  386. package/templates/astro-emdash/src/components/mode-toggle.tsx +32 -0
  387. package/templates/astro-emdash/src/components/search-command-palette.tsx +107 -0
  388. package/templates/astro-emdash/src/components/setup-token-page.tsx +196 -0
  389. package/templates/astro-emdash/src/components/ui/avatar.tsx +107 -0
  390. package/templates/astro-emdash/src/components/ui/badge.tsx +52 -0
  391. package/templates/astro-emdash/src/components/ui/button.tsx +69 -0
  392. package/templates/astro-emdash/src/components/ui/checkbox.tsx +29 -0
  393. package/templates/astro-emdash/src/components/ui/dialog.tsx +158 -0
  394. package/templates/astro-emdash/src/components/ui/dropdown-menu.tsx +303 -0
  395. package/templates/astro-emdash/src/components/ui/input.tsx +20 -0
  396. package/templates/astro-emdash/src/components/ui/label.tsx +20 -0
  397. package/templates/astro-emdash/src/components/ui/scroll-area.tsx +53 -0
  398. package/templates/astro-emdash/src/components/ui/select.tsx +215 -0
  399. package/templates/astro-emdash/src/components/ui/separator.tsx +23 -0
  400. package/templates/astro-emdash/src/components/ui/sheet.tsx +138 -0
  401. package/templates/astro-emdash/src/components/ui/sidebar.tsx +728 -0
  402. package/templates/astro-emdash/src/components/ui/skeleton.tsx +13 -0
  403. package/templates/astro-emdash/src/components/ui/textarea.tsx +18 -0
  404. package/templates/astro-emdash/src/components/ui/tooltip.tsx +66 -0
  405. package/templates/astro-emdash/src/db/migrations.gen.ts +6 -0
  406. package/templates/astro-emdash/src/db/schema.ts +6 -0
  407. package/templates/astro-emdash/src/db/seed.ts +16 -0
  408. package/templates/astro-emdash/src/db/storage.ts +32 -0
  409. package/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
  410. package/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
  411. package/templates/astro-emdash/src/docs/docs-data.ts +24 -0
  412. package/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
  413. package/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
  414. package/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
  415. package/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
  416. package/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
  417. package/templates/astro-emdash/src/docs/llm-text.ts +61 -0
  418. package/templates/astro-emdash/src/docs/source.ts +7 -0
  419. package/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
  420. package/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
  421. package/templates/astro-emdash/src/hooks/use-mobile.ts +19 -0
  422. package/templates/astro-emdash/src/jobs.example.ts +48 -0
  423. package/templates/astro-emdash/src/lib/account.ts +12 -0
  424. package/templates/astro-emdash/src/lib/auth-client.ts +181 -0
  425. package/templates/astro-emdash/src/lib/utils.ts +6 -0
  426. package/templates/astro-emdash/src/mcp-app.ts +57 -0
  427. package/templates/astro-emdash/src/notifications.example.ts +37 -0
  428. package/templates/astro-emdash/src/raybase.auth.ts +70 -0
  429. package/templates/astro-emdash/src/raybase.config.ts +49 -0
  430. package/templates/astro-emdash/src/raybase.server.ts +56 -0
  431. package/templates/astro-emdash/src/realtime.example.ts +18 -0
  432. package/templates/astro-emdash/src/router.tsx +19 -0
  433. package/templates/astro-emdash/src/routes/__root.tsx +56 -0
  434. package/templates/astro-emdash/src/routes/_app/admin.tsx +13 -0
  435. package/templates/astro-emdash/src/routes/_app/forgot-password.tsx +97 -0
  436. package/templates/astro-emdash/src/routes/_app/index.tsx +169 -0
  437. package/templates/astro-emdash/src/routes/_app/invite.$token.tsx +11 -0
  438. package/templates/astro-emdash/src/routes/_app/login.tsx +193 -0
  439. package/templates/astro-emdash/src/routes/_app/profile.tsx +98 -0
  440. package/templates/astro-emdash/src/routes/_app/reset-password.$token.tsx +15 -0
  441. package/templates/astro-emdash/src/routes/_app/reset-password.tsx +115 -0
  442. package/templates/astro-emdash/src/routes/_app/setup.$token.tsx +11 -0
  443. package/templates/astro-emdash/src/routes/_app/signup.tsx +141 -0
  444. package/templates/astro-emdash/src/routes/_app/verify-email.$token.tsx +15 -0
  445. package/templates/astro-emdash/src/routes/_app/verify-email.tsx +154 -0
  446. package/templates/astro-emdash/src/routes/_app.tsx +33 -0
  447. package/templates/astro-emdash/src/routes/admin/$.ts +20 -0
  448. package/templates/astro-emdash/src/routes/api/$.ts +19 -0
  449. package/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
  450. package/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
  451. package/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
  452. package/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
  453. package/templates/astro-emdash/src/routes/docs.tsx +22 -0
  454. package/templates/astro-emdash/src/search.ts +6 -0
  455. package/templates/astro-emdash/src/settings.ts +12 -0
  456. package/templates/astro-emdash/src/styles-docs.css +3 -0
  457. package/templates/astro-emdash/src/styles.css +101 -0
  458. package/templates/astro-emdash/src/themes/base.css +76 -0
  459. package/templates/astro-emdash/src/themes/carbon.css +76 -0
  460. package/templates/astro-emdash/src/themes/fonts.css +25 -0
  461. package/templates/astro-emdash/src/themes/sage.css +76 -0
  462. package/templates/astro-emdash/src/themes/sand.css +76 -0
  463. package/templates/astro-emdash/src/themes/slate.css +81 -0
  464. package/templates/astro-emdash/src/themes/ultra.css +76 -0
  465. package/templates/astro-emdash/src/themes/zen.css +76 -0
  466. package/templates/astro-emdash/src/worker-entry.ts +31 -0
  467. package/templates/astro-emdash/tests/raybase-patterns.test.ts +29 -0
  468. package/templates/astro-emdash/tsconfig.json +36 -0
  469. package/templates/astro-emdash/vite.config.ts +130 -0
  470. package/templates/astro-emdash/vitest.config.ts +8 -0
  471. package/templates/astro-emdash/wrangler.jsonc +112 -0
  472. package/templates/react-router/.dev.vars.example +5 -0
  473. package/templates/react-router/.editorconfig +15 -0
  474. package/templates/react-router/AGENTS.md +54 -0
  475. package/templates/react-router/README.md +52 -0
  476. package/templates/react-router/app/app.css +44 -0
  477. package/templates/react-router/app/components/mdx.tsx +79 -0
  478. package/templates/react-router/app/components/ui/button.tsx +45 -0
  479. package/templates/react-router/app/components/ui/card.tsx +87 -0
  480. package/templates/react-router/app/components/ui/separator.tsx +22 -0
  481. package/templates/react-router/app/db/migrations.gen.ts +6 -0
  482. package/templates/react-router/app/db/schema.ts +56 -0
  483. package/templates/react-router/app/db/seed.ts +14 -0
  484. package/templates/react-router/app/entry.server.tsx +41 -0
  485. package/templates/react-router/app/globals.d.ts +1 -0
  486. package/templates/react-router/app/lib/layout.shared.tsx +52 -0
  487. package/templates/react-router/app/lib/source.ts +7 -0
  488. package/templates/react-router/app/lib/utils.ts +6 -0
  489. package/templates/react-router/app/raybase.server.ts +65 -0
  490. package/templates/react-router/app/root.tsx +23 -0
  491. package/templates/react-router/app/routes/_index.tsx +53 -0
  492. package/templates/react-router/app/routes/docs.$.tsx +49 -0
  493. package/templates/react-router/app/routes/docs.api.search.ts +10 -0
  494. package/templates/react-router/app/routes/docs.tsx +13 -0
  495. package/templates/react-router/app/routes.ts +3 -0
  496. package/templates/react-router/components.json +22 -0
  497. package/templates/react-router/content/docs/getting-started.mdx +15 -0
  498. package/templates/react-router/content/docs/index.mdx +8 -0
  499. package/templates/react-router/content/docs/mcp.mdx +121 -0
  500. package/templates/react-router/content/docs/meta.json +4 -0
  501. package/templates/react-router/dev/CODEBASE-MAP.md +48 -0
  502. package/templates/react-router/dev/SPEC-OVERVIEW.md +35 -0
  503. package/templates/react-router/dev/SPEC.md +93 -0
  504. package/templates/react-router/dev/features/archive/.gitkeep +1 -0
  505. package/templates/react-router/drizzle.config.ts +5 -0
  506. package/templates/react-router/env.d.ts +53 -0
  507. package/templates/react-router/gitignore +23 -0
  508. package/templates/react-router/migrations/app/meta/_journal.json +1 -0
  509. package/templates/react-router/package.json +70 -0
  510. package/templates/react-router/public/_headers +4 -0
  511. package/templates/react-router/public/favicon.ico +0 -0
  512. package/templates/react-router/react-router.config.ts +9 -0
  513. package/templates/react-router/source.config.ts +5 -0
  514. package/templates/react-router/tests/raybase-patterns.test.ts +23 -0
  515. package/templates/react-router/tsconfig.json +27 -0
  516. package/templates/react-router/vite.config.ts +59 -0
  517. package/templates/react-router/vitest.config.ts +8 -0
  518. package/templates/react-router/workers/app.ts +40 -0
  519. package/templates/react-router/wrangler.jsonc +111 -0
  520. package/templates/tanstack-start/.dev.vars.example +5 -0
  521. package/templates/tanstack-start/AGENTS.md +95 -0
  522. package/templates/tanstack-start/DESIGN.md +65 -0
  523. package/templates/tanstack-start/components.json +21 -0
  524. package/templates/tanstack-start/content/docs/getting-started.mdx +65 -0
  525. package/templates/tanstack-start/content/docs/index.mdx +10 -0
  526. package/templates/tanstack-start/content/docs/mcp.mdx +122 -0
  527. package/templates/tanstack-start/content/docs/meta.json +4 -0
  528. package/templates/tanstack-start/dev/CODEBASE-MAP.md +84 -0
  529. package/templates/tanstack-start/dev/SPEC-OVERVIEW.md +46 -0
  530. package/templates/tanstack-start/dev/SPEC.md +213 -0
  531. package/templates/tanstack-start/dev/features/archive/.gitkeep +1 -0
  532. package/templates/tanstack-start/docs/theme-previews/base.svg +24 -0
  533. package/templates/tanstack-start/docs/theme-previews/steel.svg +24 -0
  534. package/templates/tanstack-start/docs/theme-previews/zen.svg +24 -0
  535. package/templates/tanstack-start/docs/themes.md +116 -0
  536. package/templates/tanstack-start/drizzle.config.ts +5 -0
  537. package/templates/tanstack-start/gitignore +11 -0
  538. package/templates/tanstack-start/migrations/app/0000_low_karen_page.sql +26 -0
  539. package/templates/tanstack-start/migrations/app/meta/0000_snapshot.json +196 -0
  540. package/templates/tanstack-start/migrations/app/meta/_journal.json +13 -0
  541. package/templates/tanstack-start/package.json +77 -0
  542. package/templates/tanstack-start/public/_headers +8 -0
  543. package/templates/tanstack-start/public/icons/app-icon-maskable.svg +1 -0
  544. package/templates/tanstack-start/public/icons/app-icon.svg +1 -0
  545. package/templates/tanstack-start/public/icons/apple-touch-icon.png +0 -0
  546. package/templates/tanstack-start/public/manifest.webmanifest +14 -0
  547. package/templates/tanstack-start/public/raybase-push-sw.js +32 -0
  548. package/templates/tanstack-start/source.config.ts +10 -0
  549. package/templates/tanstack-start/src/actions.ts +560 -0
  550. package/templates/tanstack-start/src/ai/agents.ts +78 -0
  551. package/templates/tanstack-start/src/ai/retrieval.ts +36 -0
  552. package/templates/tanstack-start/src/auth-door.ts +18 -0
  553. package/templates/tanstack-start/src/client.tsx +25 -0
  554. package/templates/tanstack-start/src/components/.gitkeep +1 -0
  555. package/templates/tanstack-start/src/components/account-menu.tsx +127 -0
  556. package/templates/tanstack-start/src/components/auth-shell.tsx +69 -0
  557. package/templates/tanstack-start/src/components/install-app.tsx +35 -0
  558. package/templates/tanstack-start/src/components/mode-toggle.tsx +32 -0
  559. package/templates/tanstack-start/src/components/search-command-palette.tsx +107 -0
  560. package/templates/tanstack-start/src/components/setup-token-page.tsx +197 -0
  561. package/templates/tanstack-start/src/components/ui/avatar.tsx +107 -0
  562. package/templates/tanstack-start/src/components/ui/badge.tsx +52 -0
  563. package/templates/tanstack-start/src/components/ui/button.tsx +69 -0
  564. package/templates/tanstack-start/src/components/ui/checkbox.tsx +29 -0
  565. package/templates/tanstack-start/src/components/ui/dialog.tsx +158 -0
  566. package/templates/tanstack-start/src/components/ui/dropdown-menu.tsx +303 -0
  567. package/templates/tanstack-start/src/components/ui/input.tsx +20 -0
  568. package/templates/tanstack-start/src/components/ui/label.tsx +20 -0
  569. package/templates/tanstack-start/src/components/ui/scroll-area.tsx +53 -0
  570. package/templates/tanstack-start/src/components/ui/select.tsx +215 -0
  571. package/templates/tanstack-start/src/components/ui/separator.tsx +23 -0
  572. package/templates/tanstack-start/src/components/ui/sheet.tsx +138 -0
  573. package/templates/tanstack-start/src/components/ui/sidebar.tsx +728 -0
  574. package/templates/tanstack-start/src/components/ui/skeleton.tsx +13 -0
  575. package/templates/tanstack-start/src/components/ui/textarea.tsx +18 -0
  576. package/templates/tanstack-start/src/components/ui/tooltip.tsx +66 -0
  577. package/templates/tanstack-start/src/db/migrations.gen.ts +6 -0
  578. package/templates/tanstack-start/src/db/schema.ts +90 -0
  579. package/templates/tanstack-start/src/db/seed.ts +106 -0
  580. package/templates/tanstack-start/src/db/storage.ts +32 -0
  581. package/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
  582. package/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
  583. package/templates/tanstack-start/src/docs/docs-data.ts +24 -0
  584. package/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
  585. package/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
  586. package/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
  587. package/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
  588. package/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
  589. package/templates/tanstack-start/src/docs/llm-text.ts +61 -0
  590. package/templates/tanstack-start/src/docs/source.ts +7 -0
  591. package/templates/tanstack-start/src/hooks/use-mobile.ts +19 -0
  592. package/templates/tanstack-start/src/hooks/use-pwa-install.ts +77 -0
  593. package/templates/tanstack-start/src/jobs.example.ts +56 -0
  594. package/templates/tanstack-start/src/lib/account.ts +13 -0
  595. package/templates/tanstack-start/src/lib/auth-client.ts +187 -0
  596. package/templates/tanstack-start/src/lib/push-client.ts +98 -0
  597. package/templates/tanstack-start/src/lib/utils.ts +6 -0
  598. package/templates/tanstack-start/src/mcp-app.ts +74 -0
  599. package/templates/tanstack-start/src/notifications.example.ts +37 -0
  600. package/templates/tanstack-start/src/raybase.auth.ts +86 -0
  601. package/templates/tanstack-start/src/raybase.config.ts +86 -0
  602. package/templates/tanstack-start/src/raybase.server.ts +155 -0
  603. package/templates/tanstack-start/src/realtime.example.ts +46 -0
  604. package/templates/tanstack-start/src/router.tsx +19 -0
  605. package/templates/tanstack-start/src/routes/__root.tsx +73 -0
  606. package/templates/tanstack-start/src/routes/_app/admin.tsx +13 -0
  607. package/templates/tanstack-start/src/routes/_app/forgot-password.tsx +97 -0
  608. package/templates/tanstack-start/src/routes/_app/index.tsx +1316 -0
  609. package/templates/tanstack-start/src/routes/_app/invite.$token.tsx +11 -0
  610. package/templates/tanstack-start/src/routes/_app/login.tsx +193 -0
  611. package/templates/tanstack-start/src/routes/_app/profile.tsx +98 -0
  612. package/templates/tanstack-start/src/routes/_app/reset-password.$token.tsx +16 -0
  613. package/templates/tanstack-start/src/routes/_app/reset-password.tsx +115 -0
  614. package/templates/tanstack-start/src/routes/_app/setup.$token.tsx +11 -0
  615. package/templates/tanstack-start/src/routes/_app/signup.tsx +141 -0
  616. package/templates/tanstack-start/src/routes/_app/verify-email.$token.tsx +15 -0
  617. package/templates/tanstack-start/src/routes/_app/verify-email.tsx +154 -0
  618. package/templates/tanstack-start/src/routes/_app.tsx +33 -0
  619. package/templates/tanstack-start/src/routes/admin/$.ts +20 -0
  620. package/templates/tanstack-start/src/routes/api/$.ts +19 -0
  621. package/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
  622. package/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
  623. package/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
  624. package/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
  625. package/templates/tanstack-start/src/routes/docs.tsx +22 -0
  626. package/templates/tanstack-start/src/search.ts +26 -0
  627. package/templates/tanstack-start/src/settings.ts +12 -0
  628. package/templates/tanstack-start/src/styles-docs.css +3 -0
  629. package/templates/tanstack-start/src/styles.css +73 -0
  630. package/templates/tanstack-start/src/themes/base.css +76 -0
  631. package/templates/tanstack-start/src/themes/carbon.css +76 -0
  632. package/templates/tanstack-start/src/themes/fonts.css +18 -0
  633. package/templates/tanstack-start/src/themes/sage.css +76 -0
  634. package/templates/tanstack-start/src/themes/sand.css +76 -0
  635. package/templates/tanstack-start/src/themes/slate.css +76 -0
  636. package/templates/tanstack-start/src/themes/ultra.css +76 -0
  637. package/templates/tanstack-start/src/themes/zen.css +76 -0
  638. package/templates/tanstack-start/src/worker-entry.ts +30 -0
  639. package/templates/tanstack-start/tests/raybase-patterns.test.ts +247 -0
  640. package/templates/tanstack-start/tsconfig.json +33 -0
  641. package/templates/tanstack-start/vite.config.ts +132 -0
  642. package/templates/tanstack-start/vitest.config.ts +8 -0
  643. package/templates/tanstack-start/wrangler.jsonc +112 -0
  644. package/README.md +0 -3
@@ -0,0 +1,273 @@
1
+ // raybase.starter.json: how a starter from outside Raybase describes itself.
2
+ // create-raybase reads it from the starter when creating a project, the file
3
+ // stays at the project root, and the CLI reads it again (`raybase doctor`,
4
+ // `raybase deploy`, `raybase update`). Built-in starters carry none, so every
5
+ // reader treats the file as optional.
6
+ import { existsSync, readFileSync } from "node:fs";
7
+ import { join } from "node:path";
8
+ import { assertSafeSourcePath } from "./source-fetch.js";
9
+ export const STARTER_DESCRIPTION_FILE = "raybase.starter.json";
10
+ export const STARTER_FRAMEWORKS = ["tanstack-start", "react-router", "astro-emdash"];
11
+ const KNOWN_KEYS = new Set([
12
+ "name",
13
+ "framework",
14
+ "raybase",
15
+ "devVars",
16
+ "agentInstructions",
17
+ "spec",
18
+ "nextSteps",
19
+ "skills",
20
+ "requiredFiles",
21
+ "sealedColumns",
22
+ "moduleFiles"
23
+ ]);
24
+ // Raybase writes and owns these .dev.vars names itself (secrets, the local
25
+ // environment, AI and dev-server wiring); a starter may not set them.
26
+ const RESERVED_DEV_VAR_PREFIXES = ["RAYBASE_", "BETTER_AUTH_"];
27
+ // Text from the description reaches line-oriented files (.dev.vars, its
28
+ // comment header) and one-line messages, so none of it may carry control
29
+ // characters: a newline in `name` would otherwise add a .dev.vars line past
30
+ // the reserved-name rule for devVars.
31
+ const CONTROL_CHARACTERS = /[\u0000-\u001f\u007f]/;
32
+ export class StarterDescriptionError extends Error {
33
+ problems;
34
+ constructor(source, problems) {
35
+ super(`${source} is not a valid starter description:\n${problems.map((problem) => ` - ${problem}`).join("\n")}`);
36
+ this.name = "StarterDescriptionError";
37
+ this.problems = problems;
38
+ }
39
+ }
40
+ /** Strict validation: unknown keys, wrong types and unsafe paths are all reported together. */
41
+ export function validateStarterDescription(value, source = STARTER_DESCRIPTION_FILE) {
42
+ const problems = [];
43
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
44
+ throw new StarterDescriptionError(source, ["must be a JSON object."]);
45
+ }
46
+ const input = value;
47
+ for (const key of Object.keys(input)) {
48
+ if (!KNOWN_KEYS.has(key)) {
49
+ problems.push(`unknown key "${key}". Allowed keys: ${[...KNOWN_KEYS].join(", ")}.`);
50
+ }
51
+ }
52
+ if (typeof input.name !== "string" || !input.name.trim())
53
+ problems.push("name must be a non-empty string.");
54
+ else if (CONTROL_CHARACTERS.test(input.name))
55
+ problems.push("name must be a single line with no control characters.");
56
+ if (typeof input.framework !== "string" || !STARTER_FRAMEWORKS.includes(input.framework)) {
57
+ problems.push(`framework must be one of: ${STARTER_FRAMEWORKS.join(", ")}.`);
58
+ }
59
+ if (typeof input.raybase !== "string" || !input.raybase.trim()) {
60
+ problems.push('raybase must be a semver range of the Raybase versions the starter supports, such as ">=0.3.0 <0.4.0".');
61
+ }
62
+ else if (CONTROL_CHARACTERS.test(input.raybase)) {
63
+ problems.push("raybase must be a single line with no control characters.");
64
+ }
65
+ else {
66
+ const rangeProblem = semverRangeProblem(input.raybase);
67
+ if (rangeProblem)
68
+ problems.push(`raybase ${rangeProblem}`);
69
+ }
70
+ if (input.devVars !== undefined) {
71
+ if (!input.devVars || typeof input.devVars !== "object" || Array.isArray(input.devVars)) {
72
+ problems.push("devVars must be an object of NAME: default-value strings.");
73
+ }
74
+ else {
75
+ for (const [name, defaultValue] of Object.entries(input.devVars)) {
76
+ if (!/^[A-Z][A-Z0-9_]*$/.test(name))
77
+ problems.push(`devVars key "${name}" must be an upper-case environment variable name.`);
78
+ else if (RESERVED_DEV_VAR_PREFIXES.some((prefix) => name.startsWith(prefix))) {
79
+ problems.push(`devVars key "${name}" is reserved: Raybase writes ${RESERVED_DEV_VAR_PREFIXES.map((prefix) => `${prefix}*`).join(" and ")} itself.`);
80
+ }
81
+ if (typeof defaultValue !== "string")
82
+ problems.push(`devVars.${name} must be a string (use "" for no default).`);
83
+ else if (CONTROL_CHARACTERS.test(defaultValue))
84
+ problems.push(`devVars.${name} must be a single line with no control characters.`);
85
+ }
86
+ }
87
+ }
88
+ for (const key of ["agentInstructions", "spec"]) {
89
+ if (input[key] === undefined)
90
+ continue;
91
+ if (typeof input[key] !== "string")
92
+ problems.push(`${key} must be a starter-relative file path.`);
93
+ else
94
+ pathProblem(input[key], key, problems);
95
+ }
96
+ if (input.nextSteps !== undefined) {
97
+ if (!Array.isArray(input.nextSteps) || input.nextSteps.some((step) => typeof step !== "string" || !step.trim())) {
98
+ problems.push("nextSteps must be an array of non-empty strings, one per step.");
99
+ }
100
+ else if (input.nextSteps.some((step) => CONTROL_CHARACTERS.test(step))) {
101
+ problems.push("nextSteps entries must each be a single line with no control characters.");
102
+ }
103
+ }
104
+ const skills = stringList(input.skills, "skills", problems);
105
+ const skillNames = new Set();
106
+ for (const skill of skills) {
107
+ if (!pathProblem(skill, "skills entry", problems))
108
+ continue;
109
+ const name = skill.replace(/\/+$/, "").split("/").pop() ?? "";
110
+ if (!/^[a-z0-9][a-z0-9-]*$/.test(name))
111
+ problems.push(`skills entry "${skill}" must end in a folder named in lower-case letters, digits and hyphens.`);
112
+ else if (name.startsWith("raybase"))
113
+ problems.push(`skills entry "${skill}": folder names starting with "raybase" are reserved for Raybase's own skills.`);
114
+ else if (skillNames.has(name))
115
+ problems.push(`skills entries must have distinct folder names; "${name}" appears twice.`);
116
+ skillNames.add(name);
117
+ }
118
+ for (const file of stringList(input.requiredFiles, "requiredFiles", problems))
119
+ pathProblem(file, "requiredFiles entry", problems);
120
+ for (const file of stringList(input.moduleFiles, "moduleFiles", problems)) {
121
+ if (pathProblem(file, "moduleFiles entry", problems) && file.startsWith("./"))
122
+ problems.push(`moduleFiles entry "${file}" must be written without a leading "./".`);
123
+ }
124
+ for (const column of stringList(input.sealedColumns, "sealedColumns", problems)) {
125
+ if (!/^[A-Za-z_][A-Za-z0-9_]*\.[A-Za-z_][A-Za-z0-9_]*$/.test(column)) {
126
+ problems.push(`sealedColumns entry "${column}" must be "table.column".`);
127
+ }
128
+ }
129
+ if (problems.length)
130
+ throw new StarterDescriptionError(source, problems);
131
+ return input;
132
+ }
133
+ function stringList(value, key, problems) {
134
+ if (value === undefined)
135
+ return [];
136
+ if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string" || !entry.trim())) {
137
+ problems.push(`${key} must be an array of non-empty strings.`);
138
+ return [];
139
+ }
140
+ const seen = new Set();
141
+ for (const entry of value) {
142
+ if (seen.has(entry))
143
+ problems.push(`${key} lists "${entry}" twice.`);
144
+ seen.add(entry);
145
+ }
146
+ return value;
147
+ }
148
+ function pathProblem(value, label, problems) {
149
+ if (CONTROL_CHARACTERS.test(value)) {
150
+ problems.push(`${label} ${JSON.stringify(value)} must not contain control characters.`);
151
+ return false;
152
+ }
153
+ try {
154
+ assertSafeSourcePath(value.replace(/^\.\//, ""), `${label} "${value}"`);
155
+ return true;
156
+ }
157
+ catch (error) {
158
+ problems.push(error instanceof Error ? error.message : String(error));
159
+ return false;
160
+ }
161
+ }
162
+ /** Reads `<dir>/raybase.starter.json`; null when the file is absent, throws when it is unreadable or invalid. */
163
+ export function readStarterDescription(dir) {
164
+ const file = join(dir, STARTER_DESCRIPTION_FILE);
165
+ if (!existsSync(file))
166
+ return null;
167
+ let parsed;
168
+ try {
169
+ parsed = JSON.parse(readFileSync(file, "utf8"));
170
+ }
171
+ catch (error) {
172
+ throw new StarterDescriptionError(STARTER_DESCRIPTION_FILE, [`is not valid JSON: ${error instanceof Error ? error.message : String(error)}`]);
173
+ }
174
+ return validateStarterDescription(parsed);
175
+ }
176
+ /** Null when `version` is inside the starter's `raybase` range, otherwise a sentence saying it is not. */
177
+ export function starterRangeProblem(description, version) {
178
+ if (satisfiesSemverRange(version, description.raybase))
179
+ return null;
180
+ return `The starter "${description.name}" supports Raybase ${description.raybase}, and this is Raybase ${version}.`;
181
+ }
182
+ export function satisfiesSemverRange(version, range) {
183
+ const parsed = parseSemverRange(range);
184
+ const target = parseExactVersion(version);
185
+ if (!parsed || !target)
186
+ return false;
187
+ return parsed.some((set) => set.every((comparator) => compare(target, comparator)));
188
+ }
189
+ function semverRangeProblem(range) {
190
+ return parseSemverRange(range) ? null : `"${range}" is not a semver range this tool understands (use comparators such as ">=0.3.0 <0.4.0", "^0.3.0" or "~0.3.1", joined by spaces or "||").`;
191
+ }
192
+ function parseSemverRange(range) {
193
+ const sets = [];
194
+ for (const alternative of range.split("||")) {
195
+ const tokens = alternative.trim().split(/\s+/).filter(Boolean);
196
+ if (!tokens.length)
197
+ return null;
198
+ const set = [];
199
+ for (const token of tokens) {
200
+ const comparators = parseToken(token);
201
+ if (!comparators)
202
+ return null;
203
+ set.push(...comparators);
204
+ }
205
+ sets.push(set);
206
+ }
207
+ return sets;
208
+ }
209
+ function parseToken(token) {
210
+ if (token === "*" || token === "x" || token === "X")
211
+ return [];
212
+ const match = token.match(/^(>=|<=|>|<|=|\^|~)?v?(\d+|[xX*])(?:\.(\d+|[xX*]))?(?:\.(\d+|[xX*]))?$/);
213
+ if (!match)
214
+ return null;
215
+ const [, op = "", majorText, minorText, patchText] = match;
216
+ const wild = (part) => part === undefined || /^[xX*]$/.test(part);
217
+ if (wild(majorText))
218
+ return op === "" || op === "=" ? [] : null;
219
+ const major = Number(majorText);
220
+ const minor = wild(minorText) ? null : Number(minorText);
221
+ const patch = minor === null || wild(patchText) ? null : Number(patchText);
222
+ const floor = [major, minor ?? 0, patch ?? 0];
223
+ // Upper bound of a partial version: 1 → <2.0.0, 1.2 → <1.3.0.
224
+ const partialCeiling = minor === null ? [major + 1, 0, 0] : patch === null ? [major, minor + 1, 0] : null;
225
+ switch (op) {
226
+ case "":
227
+ case "=":
228
+ return partialCeiling ? [{ op: ">=", version: floor }, { op: "<", version: partialCeiling }] : [{ op: "=", version: floor }];
229
+ case ">=":
230
+ return [{ op: ">=", version: floor }];
231
+ case ">":
232
+ return partialCeiling ? [{ op: ">=", version: partialCeiling }] : [{ op: ">", version: floor }];
233
+ case "<":
234
+ return [{ op: "<", version: floor }];
235
+ case "<=":
236
+ return partialCeiling ? [{ op: "<", version: partialCeiling }] : [{ op: "<=", version: floor }];
237
+ case "~":
238
+ return [{ op: ">=", version: floor }, { op: "<", version: minor === null ? [major + 1, 0, 0] : [major, minor + 1, 0] }];
239
+ case "^": {
240
+ const ceiling = major > 0 || minor === null ? [major + 1, 0, 0] : minor > 0 || patch === null ? [0, minor + 1, 0] : [0, 0, patch + 1];
241
+ return [{ op: ">=", version: floor }, { op: "<", version: ceiling }];
242
+ }
243
+ default:
244
+ return null;
245
+ }
246
+ }
247
+ function parseExactVersion(value) {
248
+ const match = value.trim().match(/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/);
249
+ return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;
250
+ }
251
+ function compare(target, comparator) {
252
+ const order = compareVersions(target, comparator.version);
253
+ switch (comparator.op) {
254
+ case ">=":
255
+ return order >= 0;
256
+ case ">":
257
+ return order > 0;
258
+ case "<=":
259
+ return order <= 0;
260
+ case "<":
261
+ return order < 0;
262
+ default:
263
+ return order === 0;
264
+ }
265
+ }
266
+ function compareVersions(left, right) {
267
+ for (let index = 0; index < 3; index += 1) {
268
+ if (left[index] !== right[index])
269
+ return left[index] > right[index] ? 1 : -1;
270
+ }
271
+ return 0;
272
+ }
273
+ //# sourceMappingURL=starter-description.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starter-description.js","sourceRoot":"","sources":["../src/starter-description.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAE/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,CAAU,CAAC;AAiC9F,MAAM,UAAU,GAAG,IAAI,GAAG,CAA2B;IACnD,MAAM;IACN,WAAW;IACX,SAAS;IACT,SAAS;IACT,mBAAmB;IACnB,MAAM;IACN,WAAW;IACX,QAAQ;IACR,eAAe;IACf,eAAe;IACf,aAAa;CACd,CAAC,CAAC;AAEH,2EAA2E;AAC3E,sEAAsE;AACtE,M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AC;IAC/E,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { type StarterDescription } from "./starter-description.js";
2
+ export type StarterSourceKind = "folder" | "github" | "web";
3
+ export type ParsedStarterSource = {
4
+ type: "folder";
5
+ raw: string;
6
+ path: string;
7
+ } | {
8
+ type: "github";
9
+ raw: string;
10
+ owner: string;
11
+ repo: string;
12
+ path: string;
13
+ ref?: string;
14
+ } | {
15
+ type: "web";
16
+ raw: string;
17
+ fileManifestUrl: string;
18
+ integrity?: string;
19
+ };
20
+ export type StarterSourceRecord = {
21
+ type: StarterSourceKind;
22
+ /** The --starter value as given. */
23
+ spec: string;
24
+ /** GitHub: the commit sha the ref resolved to. */
25
+ resolvedRef: string | null;
26
+ /** folder/github: sha256 over the starter tree; web: sha256 of its file-manifest.json. */
27
+ integrity: string;
28
+ /** web: the file-manifest.json fetched. */
29
+ url: string | null;
30
+ };
31
+ export type ResolvedStarter = {
32
+ root: string;
33
+ description: StarterDescription;
34
+ source: StarterSourceRecord;
35
+ cleanup: () => void;
36
+ };
37
+ export declare const STARTER_TREE_SKIP: Set<string>;
38
+ export declare function parseStarterSource(spec: string, cwd?: string): ParsedStarterSource;
39
+ export declare function resolveStarterSource(spec: string, options?: {
40
+ cwd?: string;
41
+ offline?: boolean;
42
+ }): Promise<ResolvedStarter>;
43
+ //# sourceMappingURL=starter-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starter-source.d.ts","sourceRoot":"","sources":["../src/starter-source.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAoD,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAErH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC7C;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACxF;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,iBAAiB,CAAC;IACxB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,0FAA0F;IAC1F,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,kBAAkB,CAAC;IAChC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAGF,eAAO,MAAM,iBAAiB,aAAoC,CAAC;AAInE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAgB,GAAG,mBAAmB,CA+BzF;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAQpI"}
@@ -0,0 +1,156 @@
1
+ // Where a starter from outside Raybase comes from: a folder on disk, a GitHub
2
+ // repository pinned to a commit, or a web address serving direct files. The
3
+ // GitHub and direct-file rules are the Kits resolver's (./source-fetch.ts).
4
+ import { existsSync, lstatSync, rmSync, statSync } from "node:fs";
5
+ import { homedir } from "node:os";
6
+ import { dirname, isAbsolute, join, resolve } from "node:path";
7
+ import { fileURLToPath, pathToFileURL } from "node:url";
8
+ import { directoryIntegrity, downloadGithubRepo, fetchSourceBuffer, materializeDirectFiles, parseGithubSource, rejectSymlinks, sha256SourceIntegrity, siblingHref, validateDirectFileManifest } from "./source-fetch.js";
9
+ import { STARTER_DESCRIPTION_FILE, readStarterDescription } from "./starter-description.js";
10
+ // Never part of a starter's tree, whichever way it arrives.
11
+ export const STARTER_TREE_SKIP = new Set([".git", "node_modules"]);
12
+ const INTEGRITY_FRAGMENT = /^sha256-[A-Za-z0-9+/]{43}=$/;
13
+ export function parseStarterSource(spec, cwd = process.cwd()) {
14
+ const raw = spec.trim();
15
+ if (!raw)
16
+ throw new Error("--starter needs a folder, a GitHub repository (github:<owner>/<repo>[/<path>][#ref]) or a web address.");
17
+ if (raw.startsWith("github:")) {
18
+ return { type: "github", raw, ...parseGithubSource(raw, { subject: "GitHub starters", requirePath: false }) };
19
+ }
20
+ if (/^https?:\/\//i.test(raw)) {
21
+ const url = new URL(raw);
22
+ const localHttp = url.protocol === "http:" && ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
23
+ if (url.protocol === "http:" && !localHttp)
24
+ throw new Error(`Refusing insecure starter address ${raw}. Use https:// (or http://localhost while testing).`);
25
+ const fragment = url.hash.slice(1);
26
+ if (fragment && !INTEGRITY_FRAGMENT.test(fragment)) {
27
+ throw new Error(`The #fragment of a starter web address pins its file-manifest.json and must be sha256-<base64 digest>; got #${fragment}.`);
28
+ }
29
+ url.hash = "";
30
+ if (!url.pathname.endsWith(".json"))
31
+ url.pathname = `${url.pathname.replace(/\/+$/, "")}/file-manifest.json`;
32
+ return { type: "web", raw, fileManifestUrl: url.href, ...(fragment ? { integrity: fragment } : {}) };
33
+ }
34
+ if (raw.startsWith("file:")) {
35
+ try {
36
+ return { type: "folder", raw, path: fileURLToPath(raw) };
37
+ }
38
+ catch (error) {
39
+ throw new Error(`Invalid file URL ${raw}: ${error instanceof Error ? error.message : String(error)}`);
40
+ }
41
+ }
42
+ const expanded = raw === "~" || raw.startsWith("~/") ? join(homedir(), raw.slice(1)) : raw;
43
+ const path = isAbsolute(expanded) ? expanded : resolve(cwd, expanded);
44
+ if (/^(\.{1,2}[\\/]|[\\/]|~)/.test(raw) || existsSync(path))
45
+ return { type: "folder", raw, path };
46
+ throw new Error(`Unknown starter source "${raw}". Use a folder (./my-starter), a GitHub repository (github:<owner>/<repo>[/<path>][#ref]) or a web address (https://…/file-manifest.json).`);
47
+ }
48
+ export async function resolveStarterSource(spec, options = {}) {
49
+ const parsed = parseStarterSource(spec, options.cwd);
50
+ if (parsed.type !== "folder" && options.offline) {
51
+ throw new Error(`--offline cannot fetch the starter ${parsed.raw}. Use a starter folder on disk, or drop --offline.`);
52
+ }
53
+ if (parsed.type === "folder")
54
+ return resolveFolderStarter(parsed);
55
+ if (parsed.type === "github")
56
+ return resolveGithubStarter(parsed);
57
+ return resolveWebStarter(parsed);
58
+ }
59
+ function resolveFolderStarter(parsed) {
60
+ if (!existsSync(parsed.path) || !statSync(parsed.path).isDirectory())
61
+ throw new Error(`Starter folder ${parsed.path} does not exist.`);
62
+ rejectSymlinks(parsed.path, STARTER_TREE_SKIP);
63
+ return {
64
+ root: parsed.path,
65
+ description: describedStarter(parsed.path, parsed.raw),
66
+ source: { type: "folder", spec: parsed.raw, resolvedRef: null, integrity: directoryIntegrity(parsed.path, STARTER_TREE_SKIP), url: null },
67
+ cleanup: () => { }
68
+ };
69
+ }
70
+ async function resolveGithubStarter(parsed) {
71
+ // Links elsewhere in the repository (a monorepo's CLAUDE.md -> AGENTS.md)
72
+ // are no reason to refuse a starter in one of its folders: the archive may
73
+ // hold links that stay inside it, and the starter's own folder may hold none.
74
+ const repo = await downloadGithubRepo(parsed.owner, parsed.repo, parsed.ref, { symlinks: "contained" });
75
+ try {
76
+ const root = parsed.path ? join(repo.root, parsed.path) : repo.root;
77
+ if (!existsSync(root) || lstatSync(root).isSymbolicLink() || !statSync(root).isDirectory()) {
78
+ throw new Error(`GitHub starter ${parsed.raw} has no folder ${parsed.path} at ${repo.resolvedRef}.`);
79
+ }
80
+ rejectSymlinks(root, STARTER_TREE_SKIP);
81
+ return {
82
+ root,
83
+ description: describedStarter(root, `${parsed.raw} at ${repo.resolvedRef}`),
84
+ source: { type: "github", spec: parsed.raw, resolvedRef: repo.resolvedRef, integrity: directoryIntegrity(root, STARTER_TREE_SKIP), url: null },
85
+ cleanup: repo.cleanup
86
+ };
87
+ }
88
+ catch (error) {
89
+ repo.cleanup();
90
+ throw error;
91
+ }
92
+ }
93
+ // A starter on the web is served the way the Kits and Store registries serve
94
+ // theirs: a file-manifest.json listing every file with its size and sha256,
95
+ // and each file under files/ beside it. A #sha256-… fragment pins the
96
+ // manifest itself.
97
+ async function resolveWebStarter(parsed) {
98
+ const manifestBytes = await fetchSourceBuffer(parsed.fileManifestUrl, "starter file manifest");
99
+ const integrity = sha256SourceIntegrity(manifestBytes);
100
+ if (parsed.integrity && parsed.integrity !== integrity) {
101
+ throw new Error(`Starter file manifest integrity mismatch for ${parsed.fileManifestUrl}: expected ${parsed.integrity}, got ${integrity}.`);
102
+ }
103
+ let manifestJson;
104
+ try {
105
+ manifestJson = JSON.parse(manifestBytes.toString("utf8"));
106
+ }
107
+ catch (error) {
108
+ throw new Error(`Starter file manifest ${parsed.fileManifestUrl} is not valid JSON: ${error instanceof Error ? error.message : String(error)}`);
109
+ }
110
+ const fileManifest = validateDirectFileManifest(manifestJson, {
111
+ subject: `Starter file manifest ${parsed.fileManifestUrl}`,
112
+ entry: "Starter",
113
+ upgrade: "this create-raybase. Upgrade @raybase/create"
114
+ });
115
+ const filesBase = siblingHref(parsed.fileManifestUrl, "files/");
116
+ const root = await materializeDirectFiles({
117
+ label: "Starter",
118
+ tempPrefix: "raybase-starter-",
119
+ fileManifest,
120
+ fileManifestBytes: manifestBytes,
121
+ readFile: (path) => fetchSourceBuffer(new URL(path.split("/").map(encodeURIComponent).join("/"), filesBase).href, "starter file")
122
+ });
123
+ const cleanup = () => rmSync(dirname(root), { recursive: true, force: true });
124
+ try {
125
+ return {
126
+ root,
127
+ description: describedStarter(root, parsed.raw),
128
+ source: { type: "web", spec: parsed.raw, resolvedRef: null, integrity, url: parsed.fileManifestUrl },
129
+ cleanup
130
+ };
131
+ }
132
+ catch (error) {
133
+ cleanup();
134
+ throw error;
135
+ }
136
+ }
137
+ function describedStarter(root, label) {
138
+ const description = readStarterDescription(root);
139
+ if (!description) {
140
+ throw new Error(`${label} is not a Raybase starter: it has no ${STARTER_DESCRIPTION_FILE} at its root (${pathToFileURL(root).href}).`);
141
+ }
142
+ if (!existsSync(join(root, "package.json")))
143
+ throw new Error(`Starter "${description.name}" has no package.json at its root.`);
144
+ for (const [key, path] of [["agentInstructions", description.agentInstructions], ["spec", description.spec]]) {
145
+ if (path && !(existsSync(join(root, path)) && statSync(join(root, path)).isFile())) {
146
+ throw new Error(`Starter "${description.name}": ${STARTER_DESCRIPTION_FILE} ${key} names ${path}, which is not a file in the starter.`);
147
+ }
148
+ }
149
+ for (const skill of description.skills ?? []) {
150
+ if (!existsSync(join(root, skill, "SKILL.md"))) {
151
+ throw new Error(`Starter "${description.name}": ${STARTER_DESCRIPTION_FILE} skills names ${skill}, which has no SKILL.md.`);
152
+ }
153
+ }
154
+ return description;
155
+ }
156
+ //# sourceMappingURL=starter-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starter-source.js","sourceRoot":"","sources":["../src/starter-source.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,UAAU,EA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AAC,YAAY,WAAW,CAAC,IAAI,MAAM,wBAAwB,iBAAiB,KAAK,0BAA0B,CAAC,CAAC;QAC9H,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { ResolvedStoreApp } from "./store-app-registry.js";
2
+ export type StoreAppReceipt = {
3
+ schemaVersion: 1;
4
+ id: string;
5
+ name: string;
6
+ version: string;
7
+ createdAt: string;
8
+ baseFramework: string;
9
+ source: {
10
+ type: "verified-store";
11
+ registry: string;
12
+ manifestUrl: string;
13
+ listingUrl: string;
14
+ manifestIntegrity: string;
15
+ fileManifestIntegrity: string;
16
+ };
17
+ raybase: {
18
+ core: string;
19
+ cli: string;
20
+ docs: string;
21
+ guide: string;
22
+ };
23
+ verified: true;
24
+ };
25
+ export declare function applyStoreAppOverlay(projectDir: string, template: ResolvedStoreApp, localRoot: string | null): StoreAppReceipt;
26
+ export declare function assertSafeProjectFiles(projectDir: string): void;
27
+ //# sourceMappingURL=store-app-apply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-app-apply.d.ts","sourceRoot":"","sources":["../src/store-app-apply.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,CAAC,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE;QACN,IAAI,EAAE,gBAAgB,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,qBAAqB,EAAE,MAAM,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,eAAe,CAsD9H;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAO/D"}
@@ -0,0 +1,100 @@
1
+ import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, rmSync, writeFileSync } from "node:fs";
2
+ import { dirname, join, relative, resolve, sep } from "node:path";
3
+ import { RAYBASE_PACKAGE_RANGES } from "./raybase-package-ranges.js";
4
+ import { validateRelativePath } from "./store-app-manifest.js";
5
+ export function applyStoreAppOverlay(projectDir, template, localRoot) {
6
+ for (const file of template.manifest.install.deleteBaseFiles ?? []) {
7
+ validateRelativePath(file, "deleteBaseFiles entry");
8
+ rmSync(join(projectDir, file), { recursive: true, force: true });
9
+ }
10
+ const overlayDir = join(template.frameworkRoot, template.manifest.install.overlay);
11
+ if (!existsSync(overlayDir))
12
+ throw new Error(`Store app overlay ${template.manifest.install.overlay} is missing.`);
13
+ cpSync(overlayDir, projectDir, {
14
+ recursive: true,
15
+ filter: (source) => {
16
+ const stat = lstatSync(source);
17
+ if (stat.isSymbolicLink())
18
+ throw new Error(`Store app overlay contains a symlink: ${source}`);
19
+ return true;
20
+ }
21
+ });
22
+ const packageFile = join(projectDir, "package.json");
23
+ const parsed = JSON.parse(readFileSync(packageFile, "utf8"));
24
+ parsed.raybase = {
25
+ ...(parsed.raybase ?? {}),
26
+ storeApp: {
27
+ id: template.manifest.id,
28
+ version: template.manifest.version,
29
+ source: "verified-store"
30
+ }
31
+ };
32
+ writeFileSync(packageFile, `${JSON.stringify(parsed, null, 2)}\n`);
33
+ const receipt = {
34
+ schemaVersion: 1,
35
+ id: template.manifest.id,
36
+ name: template.manifest.name,
37
+ version: template.manifest.version,
38
+ createdAt: new Date().toISOString(),
39
+ baseFramework: template.manifest.baseFramework,
40
+ source: {
41
+ type: "verified-store",
42
+ registry: template.registrySource,
43
+ manifestUrl: template.manifestUrl,
44
+ listingUrl: template.listingUrl,
45
+ manifestIntegrity: template.manifestIntegrity,
46
+ fileManifestIntegrity: template.fileManifestIntegrity
47
+ },
48
+ raybase: raybaseVersions(localRoot),
49
+ verified: true
50
+ };
51
+ const receiptFile = join(projectDir, ".raybase/store-app.json");
52
+ mkdirSync(dirname(receiptFile), { recursive: true });
53
+ writeFileSync(receiptFile, `${JSON.stringify(receipt, null, 2)}\n`);
54
+ return receipt;
55
+ }
56
+ export function assertSafeProjectFiles(projectDir) {
57
+ for (const file of walk(projectDir)) {
58
+ const stat = lstatSync(file);
59
+ if (stat.isSymbolicLink() && !isExpectedAgentCompatibilitySymlink(projectDir, file)) {
60
+ throw new Error(`Generated project contains unexpected symlink after template apply: ${file}`);
61
+ }
62
+ }
63
+ }
64
+ function isExpectedAgentCompatibilitySymlink(projectDir, file) {
65
+ const relativeFile = relative(projectDir, file).split(sep).join("/");
66
+ return relativeFile === "CLAUDE.md" && readlinkSync(file) === "AGENTS.md";
67
+ }
68
+ function raybaseVersions(localRoot) {
69
+ if (localRoot) {
70
+ return {
71
+ core: readPackageVersion(join(localRoot, "packages/core/package.json")),
72
+ cli: readPackageVersion(join(localRoot, "packages/cli/package.json")),
73
+ docs: readPackageVersion(join(localRoot, "packages/docs/package.json")),
74
+ guide: readPackageVersion(join(localRoot, "packages/guide/package.json"))
75
+ };
76
+ }
77
+ return {
78
+ core: RAYBASE_PACKAGE_RANGES["@raybase/core"],
79
+ cli: RAYBASE_PACKAGE_RANGES["@raybase/cli"],
80
+ docs: RAYBASE_PACKAGE_RANGES["@raybase/docs"],
81
+ guide: RAYBASE_PACKAGE_RANGES["@raybase/guide"]
82
+ };
83
+ }
84
+ function readPackageVersion(file) {
85
+ const parsed = JSON.parse(readFileSync(file, "utf8"));
86
+ return parsed.version ?? "unknown";
87
+ }
88
+ function walk(root) {
89
+ const entries = [];
90
+ for (const item of readdirSync(root)) {
91
+ const path = resolve(root, item);
92
+ const stat = lstatSync(path);
93
+ if (stat.isDirectory())
94
+ entries.push(...walk(path));
95
+ else
96
+ entries.push(path);
97
+ }
98
+ return entries;
99
+ }
100
+ //# sourceMappingURL=store-app-apply.js.map