anhedral 0.13.0 → 0.16.0

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 (360) hide show
  1. package/README.md +23 -229
  2. package/assets/patches/audit-deps.mjs +12 -2
  3. package/assets/stack/ai-schema.ts.txt +5 -0
  4. package/assets/stack/ai.ts.txt +30 -0
  5. package/assets/stack/api-index.ts.txt +15 -0
  6. package/assets/stack/auth-features.ts.txt +4 -0
  7. package/assets/stack/auth-journal.json.txt +13 -0
  8. package/assets/stack/auth-migration.sql.txt +53 -0
  9. package/assets/stack/auth-routes.ts.txt +11 -0
  10. package/assets/stack/auth-schema.ts.txt +64 -0
  11. package/assets/stack/auth-snapshot.json.txt +346 -0
  12. package/assets/stack/auth.ts.txt +32 -0
  13. package/assets/stack/billing-mode.ts.txt +8 -0
  14. package/assets/stack/billing-schema.ts.txt +11 -0
  15. package/assets/stack/desktop.rs.txt +21 -0
  16. package/assets/stack/entitlement-guard.ts.txt +32 -0
  17. package/assets/stack/entitlements.ts.txt +8 -0
  18. package/assets/stack/events-schema.ts.txt +12 -0
  19. package/assets/stack/events.ts.txt +59 -0
  20. package/assets/stack/mobile-auth.ts.txt +25 -0
  21. package/assets/stack/mobile-billing.tsx.txt +63 -0
  22. package/assets/stack/mobile-session.tsx.txt +83 -0
  23. package/assets/stack/native-button.tsx.txt +108 -0
  24. package/assets/stack/native-global.css.txt +4 -0
  25. package/assets/stack/native-lib-utils.ts.txt +5 -0
  26. package/assets/stack/native-metro.config.js.txt +6 -0
  27. package/assets/stack/native-nativewind-env.d.ts.txt +1 -0
  28. package/assets/stack/native-tailwind.config.js.txt +73 -0
  29. package/assets/stack/native-text.tsx.txt +89 -0
  30. package/assets/stack/purchases.ts.txt +65 -0
  31. package/assets/stack/revenuecat.ts.txt +88 -0
  32. package/assets/stack/rtc-schema.ts.txt +10 -0
  33. package/assets/stack/rtc.ts.txt +122 -0
  34. package/assets/stack/security.ts.txt +31 -0
  35. package/assets/stack/storage.ts.txt +36 -0
  36. package/assets/stack/stripe.ts.txt +126 -0
  37. package/assets/stack/web-sign-in.tsx.txt +51 -0
  38. package/assets/ui/LICENSE.react-native-reusables +21 -0
  39. package/assets/ui/LICENSE.shadcn +21 -0
  40. package/assets/ui/UPSTREAM.json +39 -0
  41. package/assets/ui/catalog.json +891 -0
  42. package/assets/ui/extensions/registry.json +6 -0
  43. package/assets/ui/native/_controls.tsx +521 -0
  44. package/assets/ui/native/_core.tsx +118 -0
  45. package/assets/ui/native/_data.tsx +200 -0
  46. package/assets/ui/native/_display.tsx +453 -0
  47. package/assets/ui/native/_feedback.tsx +242 -0
  48. package/assets/ui/native/_legacy-dialog.tsx +38 -0
  49. package/assets/ui/native/_motion.tsx +520 -0
  50. package/assets/ui/native/_overlay.tsx +402 -0
  51. package/assets/ui/native/_selection.tsx +366 -0
  52. package/assets/ui/native/accordion.tsx +1 -0
  53. package/assets/ui/native/alert-dialog.tsx +11 -0
  54. package/assets/ui/native/alert.tsx +1 -0
  55. package/assets/ui/native/aspect-ratio.tsx +1 -0
  56. package/assets/ui/native/attachment.tsx +8 -0
  57. package/assets/ui/native/avatar.tsx +8 -0
  58. package/assets/ui/native/badge.tsx +1 -0
  59. package/assets/ui/native/breadcrumb.tsx +9 -0
  60. package/assets/ui/native/bubble.tsx +1 -0
  61. package/assets/ui/native/button-group.tsx +1 -0
  62. package/assets/ui/native/button.tsx +86 -0
  63. package/assets/ui/native/calendar.tsx +170 -0
  64. package/assets/ui/native/card.tsx +44 -0
  65. package/assets/ui/native/carousel.tsx +1 -0
  66. package/assets/ui/native/chart.tsx +193 -0
  67. package/assets/ui/native/checkbox.tsx +1 -0
  68. package/assets/ui/native/code-block.tsx +137 -0
  69. package/assets/ui/native/collapsible.tsx +1 -0
  70. package/assets/ui/native/combobox.tsx +1 -0
  71. package/assets/ui/native/command.tsx +11 -0
  72. package/assets/ui/native/context-menu.tsx +16 -0
  73. package/assets/ui/native/data-table.tsx +1 -0
  74. package/assets/ui/native/date-picker.tsx +43 -0
  75. package/assets/ui/native/dialog.tsx +15 -0
  76. package/assets/ui/native/direction.tsx +1 -0
  77. package/assets/ui/native/drawer.tsx +10 -0
  78. package/assets/ui/native/dropdown-menu.tsx +16 -0
  79. package/assets/ui/native/empty.tsx +8 -0
  80. package/assets/ui/native/field.tsx +13 -0
  81. package/assets/ui/native/hover-card.tsx +1 -0
  82. package/assets/ui/native/input-group.tsx +8 -0
  83. package/assets/ui/native/input-otp.tsx +1 -0
  84. package/assets/ui/native/input.tsx +28 -0
  85. package/assets/ui/native/item.tsx +12 -0
  86. package/assets/ui/native/kbd.tsx +1 -0
  87. package/assets/ui/native/label.tsx +4 -0
  88. package/assets/ui/native/layout.tsx +26 -0
  89. package/assets/ui/native/marker.tsx +1 -0
  90. package/assets/ui/native/menubar.tsx +17 -0
  91. package/assets/ui/native/message-scroller.tsx +6 -0
  92. package/assets/ui/native/message.tsx +10 -0
  93. package/assets/ui/native/native-select.tsx +1 -0
  94. package/assets/ui/native/navigation-menu.tsx +10 -0
  95. package/assets/ui/native/pagination.tsx +9 -0
  96. package/assets/ui/native/popover.tsx +1 -0
  97. package/assets/ui/native/progress.tsx +1 -0
  98. package/assets/ui/native/questionnaire.tsx +130 -0
  99. package/assets/ui/native/radio-group.tsx +1 -0
  100. package/assets/ui/native/registry.json +1103 -0
  101. package/assets/ui/native/resizable.tsx +1 -0
  102. package/assets/ui/native/scroll-area.tsx +1 -0
  103. package/assets/ui/native/select.tsx +11 -0
  104. package/assets/ui/native/separator.tsx +1 -0
  105. package/assets/ui/native/sheet.tsx +10 -0
  106. package/assets/ui/native/sidebar.tsx +22 -0
  107. package/assets/ui/native/skeleton.tsx +1 -0
  108. package/assets/ui/native/slider.tsx +1 -0
  109. package/assets/ui/native/spinner.tsx +1 -0
  110. package/assets/ui/native/switch.tsx +1 -0
  111. package/assets/ui/native/table.tsx +10 -0
  112. package/assets/ui/native/tabs.tsx +1 -0
  113. package/assets/ui/native/text.tsx +20 -0
  114. package/assets/ui/native/textarea.tsx +1 -0
  115. package/assets/ui/native/theme-switcher.tsx +22 -0
  116. package/assets/ui/native/toast.tsx +11 -0
  117. package/assets/ui/native/toggle-group.tsx +1 -0
  118. package/assets/ui/native/toggle.tsx +1 -0
  119. package/assets/ui/native/tooltip.tsx +1 -0
  120. package/assets/ui/native/trace.tsx +20 -0
  121. package/assets/ui/native/typography.tsx +15 -0
  122. package/assets/ui/theme-storage.ts +25 -0
  123. package/assets/ui/theme.tsx +66 -0
  124. package/assets/ui/web/button.tsx +59 -0
  125. package/assets/ui/web/input.tsx +21 -0
  126. package/assets/ui/web/label.tsx +19 -0
  127. package/dist/bin.js +7 -12
  128. package/dist/capabilities.d.ts +4 -33
  129. package/dist/capabilities.js +2 -84
  130. package/dist/capability-catalog.d.ts +83 -0
  131. package/dist/capability-catalog.js +121 -0
  132. package/dist/capability-command.d.ts +3 -0
  133. package/dist/capability-command.js +188 -0
  134. package/dist/capability-editor.d.ts +17 -0
  135. package/dist/capability-editor.js +97 -0
  136. package/dist/capability-recipes.d.ts +4 -0
  137. package/dist/capability-recipes.js +520 -0
  138. package/dist/capability-references.d.ts +4 -0
  139. package/dist/capability-references.js +7 -0
  140. package/dist/cli-commands.d.ts +1 -2
  141. package/dist/cli-commands.js +10 -104
  142. package/dist/cli-output.d.ts +1 -2
  143. package/dist/cli-output.js +6 -251
  144. package/dist/command-schema.js +40 -374
  145. package/dist/dependencies.d.ts +34 -62
  146. package/dist/dependencies.js +112 -199
  147. package/dist/index.d.ts +1 -45
  148. package/dist/index.js +1 -30
  149. package/dist/platforms/mobile.js +29 -139
  150. package/dist/platforms/web.d.ts +3 -0
  151. package/dist/platforms/web.js +251 -0
  152. package/dist/project-config.d.ts +2 -13
  153. package/dist/project-config.js +10 -83
  154. package/dist/registry/context.js +0 -1
  155. package/dist/registry/options.js +6 -40
  156. package/dist/registry/resolve.d.ts +3 -4
  157. package/dist/registry/resolve.js +18 -108
  158. package/dist/registry/types.d.ts +1 -7
  159. package/dist/registry/usage.js +3 -9
  160. package/dist/runtime-policy.d.ts +0 -2
  161. package/dist/runtime-policy.js +0 -16
  162. package/dist/scaffold/backend.d.ts +0 -4
  163. package/dist/scaffold/backend.js +1 -189
  164. package/dist/scaffold/bootstrap.d.ts +2 -3
  165. package/dist/scaffold/bootstrap.js +37 -43
  166. package/dist/scaffold/compose.js +2 -14
  167. package/dist/scaffold/database.d.ts +1 -1
  168. package/dist/scaffold/database.js +19 -126
  169. package/dist/scaffold/documentation.d.ts +0 -1
  170. package/dist/scaffold/documentation.js +82 -84
  171. package/dist/scaffold/expo-runtime.d.ts +2 -2
  172. package/dist/scaffold/expo-runtime.js +9 -101
  173. package/dist/scaffold/native-ui.d.ts +2 -0
  174. package/dist/scaffold/native-ui.js +74 -0
  175. package/dist/scaffold/stack-documentation.d.ts +0 -1
  176. package/dist/scaffold/stack-documentation.js +3 -49
  177. package/dist/scaffold/storage.d.ts +2 -0
  178. package/dist/scaffold/storage.js +21 -0
  179. package/dist/scaffold/styling.d.ts +1 -1
  180. package/dist/scaffold/styling.js +20 -28
  181. package/dist/scaffold/workspace.js +63 -199
  182. package/dist/stack-registry.d.ts +2 -58
  183. package/dist/stack-registry.js +22 -446
  184. package/dist/standard.js +7 -24
  185. package/dist/ui-catalog.d.ts +26 -0
  186. package/dist/ui-catalog.js +31 -0
  187. package/dist/ui-command.d.ts +3 -0
  188. package/dist/ui-command.js +219 -0
  189. package/dist/ui-project.d.ts +22 -0
  190. package/dist/ui-project.js +110 -0
  191. package/dist/version.d.ts +1 -1
  192. package/dist/version.js +1 -1
  193. package/docs/anhedral-stack.md +4 -119
  194. package/docs/capabilities.md +110 -0
  195. package/docs/native-ui.md +102 -0
  196. package/docs/software-factory.md +16 -577
  197. package/docs/stack-standard.md +11 -307
  198. package/docs/ui.md +33 -0
  199. package/docs/verification.md +511 -0
  200. package/package.json +26 -27
  201. package/dist/access.d.ts +0 -10
  202. package/dist/access.js +0 -93
  203. package/dist/auth-schema-snapshot.d.ts +0 -346
  204. package/dist/auth-schema-snapshot.js +0 -347
  205. package/dist/auth-schema.d.ts +0 -1
  206. package/dist/auth-schema.js +0 -57
  207. package/dist/capability-contract.d.ts +0 -47
  208. package/dist/capability-contract.js +0 -168
  209. package/dist/catalog-model.d.ts +0 -24
  210. package/dist/catalog-model.js +0 -1
  211. package/dist/catalog-registration.d.ts +0 -16
  212. package/dist/catalog-registration.js +0 -22
  213. package/dist/catalog-snapshot.d.ts +0 -5
  214. package/dist/catalog-snapshot.js +0 -97
  215. package/dist/cli-delivery.d.ts +0 -3
  216. package/dist/cli-delivery.js +0 -172
  217. package/dist/cloudflare.d.ts +0 -25
  218. package/dist/cloudflare.js +0 -226
  219. package/dist/delivery-evidence.d.ts +0 -62
  220. package/dist/delivery-evidence.js +0 -186
  221. package/dist/delivery.d.ts +0 -88
  222. package/dist/delivery.js +0 -570
  223. package/dist/inspector-model.d.ts +0 -123
  224. package/dist/inspector-model.js +0 -1
  225. package/dist/integration-service-readers.d.ts +0 -13
  226. package/dist/integration-service-readers.js +0 -173
  227. package/dist/lifecycle-model.d.ts +0 -15
  228. package/dist/lifecycle-model.js +0 -20
  229. package/dist/lifecycle.d.ts +0 -11
  230. package/dist/lifecycle.js +0 -91
  231. package/dist/management.d.ts +0 -3
  232. package/dist/management.js +0 -47
  233. package/dist/mobile-delivery.d.ts +0 -77
  234. package/dist/mobile-delivery.js +0 -366
  235. package/dist/neon-service-data.d.ts +0 -8
  236. package/dist/neon-service-data.js +0 -117
  237. package/dist/platforms/desktop.d.ts +0 -2
  238. package/dist/platforms/desktop.js +0 -415
  239. package/dist/platforms/extension.d.ts +0 -2
  240. package/dist/platforms/extension.js +0 -328
  241. package/dist/project-catalog.d.ts +0 -41
  242. package/dist/project-catalog.js +0 -288
  243. package/dist/project-inspector.d.ts +0 -4
  244. package/dist/project-inspector.js +0 -702
  245. package/dist/project-lifecycle.d.ts +0 -25
  246. package/dist/project-lifecycle.js +0 -57
  247. package/dist/project-state.d.ts +0 -49
  248. package/dist/project-state.js +0 -563
  249. package/dist/provider-auth.d.ts +0 -41
  250. package/dist/provider-auth.js +0 -215
  251. package/dist/provider-readiness.d.ts +0 -30
  252. package/dist/provider-readiness.js +0 -104
  253. package/dist/providers/adapters.d.ts +0 -17
  254. package/dist/providers/adapters.js +0 -278
  255. package/dist/providers/api.d.ts +0 -29
  256. package/dist/providers/api.js +0 -253
  257. package/dist/providers/config.d.ts +0 -15
  258. package/dist/providers/config.js +0 -182
  259. package/dist/providers/definitions.d.ts +0 -318
  260. package/dist/providers/definitions.js +0 -127
  261. package/dist/providers/provision.d.ts +0 -24
  262. package/dist/providers/provision.js +0 -76
  263. package/dist/providers/receipts.d.ts +0 -20
  264. package/dist/providers/receipts.js +0 -66
  265. package/dist/providers/recovery-verification.d.ts +0 -7
  266. package/dist/providers/recovery-verification.js +0 -112
  267. package/dist/providers/recovery.d.ts +0 -30
  268. package/dist/providers/recovery.js +0 -34
  269. package/dist/providers/runtime.d.ts +0 -10
  270. package/dist/providers/runtime.js +0 -265
  271. package/dist/providers/schema.d.ts +0 -28
  272. package/dist/providers/schema.js +0 -49
  273. package/dist/providers/state.d.ts +0 -55
  274. package/dist/providers/state.js +0 -289
  275. package/dist/provision.d.ts +0 -55
  276. package/dist/provision.js +0 -284
  277. package/dist/r2-service-data.d.ts +0 -2
  278. package/dist/r2-service-data.js +0 -136
  279. package/dist/readiness.d.ts +0 -23
  280. package/dist/readiness.js +0 -122
  281. package/dist/registry/add.d.ts +0 -24
  282. package/dist/registry/add.js +0 -270
  283. package/dist/registry/bootstrap.d.ts +0 -2
  284. package/dist/registry/bootstrap.js +0 -14
  285. package/dist/registry/commands.d.ts +0 -3
  286. package/dist/registry/commands.js +0 -85
  287. package/dist/registry/presets.d.ts +0 -4
  288. package/dist/registry/presets.js +0 -41
  289. package/dist/registry/preview.d.ts +0 -11
  290. package/dist/registry/preview.js +0 -91
  291. package/dist/registry/receipt.d.ts +0 -3
  292. package/dist/registry/receipt.js +0 -68
  293. package/dist/repository.d.ts +0 -24
  294. package/dist/repository.js +0 -96
  295. package/dist/scaffold/auth.d.ts +0 -3
  296. package/dist/scaffold/auth.js +0 -151
  297. package/dist/scaffold/billing-config.d.ts +0 -1
  298. package/dist/scaffold/billing-config.js +0 -73
  299. package/dist/scaffold/billing-contracts.d.ts +0 -2
  300. package/dist/scaffold/billing-contracts.js +0 -48
  301. package/dist/scaffold/billing-providers.d.ts +0 -1
  302. package/dist/scaffold/billing-providers.js +0 -249
  303. package/dist/scaffold/billing-schema.d.ts +0 -1
  304. package/dist/scaffold/billing-schema.js +0 -34
  305. package/dist/scaffold/billing-security.d.ts +0 -1
  306. package/dist/scaffold/billing-security.js +0 -46
  307. package/dist/scaffold/billing-server.d.ts +0 -1
  308. package/dist/scaffold/billing-server.js +0 -139
  309. package/dist/scaffold/billing-store.d.ts +0 -1
  310. package/dist/scaffold/billing-store.js +0 -72
  311. package/dist/scaffold/billing.d.ts +0 -2
  312. package/dist/scaffold/billing.js +0 -216
  313. package/dist/scaffold/cloudflare-services.d.ts +0 -8
  314. package/dist/scaffold/cloudflare-services.js +0 -198
  315. package/dist/scaffold/expo-auth.d.ts +0 -3
  316. package/dist/scaffold/expo-auth.js +0 -192
  317. package/dist/scaffold/expo-billing.d.ts +0 -3
  318. package/dist/scaffold/expo-billing.js +0 -292
  319. package/dist/scaffold/integrations.d.ts +0 -4
  320. package/dist/scaffold/integrations.js +0 -12
  321. package/dist/scaffold/lint.d.ts +0 -4
  322. package/dist/scaffold/lint.js +0 -56
  323. package/dist/scaffold/neon-realtime.d.ts +0 -2
  324. package/dist/scaffold/neon-realtime.js +0 -97
  325. package/dist/scaffold/services.d.ts +0 -5
  326. package/dist/scaffold/services.js +0 -108
  327. package/dist/scaffold/stream.d.ts +0 -2
  328. package/dist/scaffold/stream.js +0 -114
  329. package/dist/scaffold/void.d.ts +0 -4
  330. package/dist/scaffold/void.js +0 -264
  331. package/dist/scaffold/web.d.ts +0 -2
  332. package/dist/scaffold/web.js +0 -130
  333. package/dist/service-deletion.d.ts +0 -29
  334. package/dist/service-deletion.js +0 -195
  335. package/dist/service-descriptor.d.ts +0 -10
  336. package/dist/service-descriptor.js +0 -78
  337. package/dist/service-model.d.ts +0 -49
  338. package/dist/service-model.js +0 -8
  339. package/dist/service-operations.d.ts +0 -29
  340. package/dist/service-operations.js +0 -78
  341. package/dist/service-readers.d.ts +0 -8
  342. package/dist/service-readers.js +0 -247
  343. package/dist/services-command.d.ts +0 -39
  344. package/dist/services-command.js +0 -102
  345. package/dist/ship.d.ts +0 -348
  346. package/dist/ship.js +0 -239
  347. package/dist/vercel-project.d.ts +0 -101
  348. package/dist/vercel-project.js +0 -305
  349. package/dist/vercel.d.ts +0 -67
  350. package/dist/vercel.js +0 -581
  351. package/dist/vinext.d.ts +0 -2
  352. package/dist/vinext.js +0 -86
  353. package/dist/void-execution.d.ts +0 -10
  354. package/dist/void-execution.js +0 -94
  355. package/dist/void-migrations.d.ts +0 -6
  356. package/dist/void-migrations.js +0 -110
  357. package/dist/void-state.d.ts +0 -16
  358. package/dist/void-state.js +0 -65
  359. package/dist/void.d.ts +0 -3
  360. package/dist/void.js +0 -5
@@ -1,47 +1,19 @@
1
- import { scaffoldCloudflareTransport, scaffoldAnalyticsEngine, scaffoldImages, scaffoldRealtimeKit, scaffoldVideo, } from './scaffold/cloudflare-services.js';
2
- import { usesVoidSelection } from './runtime-policy.js';
3
1
  import { scaffoldStyling } from './scaffold/styling.js';
4
2
  import { resourceName } from './render.js';
5
- import { STACK_DEPENDENCIES } from './dependencies.js';
6
3
  import { dependencyOrder } from './dependency-order.js';
7
4
  import { GENERATOR_VERSION } from './version.js';
8
- import { scaffoldWeb } from './scaffold/web.js';
9
5
  import { scaffoldApi } from './scaffold/api.js';
10
6
  import { scaffoldDatabase } from './scaffold/database.js';
11
- import { scaffoldStream } from './scaffold/stream.js';
12
- import { scaffoldNeonRealtime } from './scaffold/neon-realtime.js';
13
- import { scaffoldBetterAuth, scaffoldClerk } from './scaffold/auth.js';
14
- import { scaffoldRealtime, scaffoldQueues, scaffoldCron, scaffoldWorkflows, } from './scaffold/services.js';
7
+ import { scaffoldWeb } from './platforms/web.js';
15
8
  import { scaffoldExpo } from './platforms/mobile.js';
16
- import { scaffoldElectron } from './platforms/desktop.js';
17
- import { scaffoldWxt } from './platforms/extension.js';
18
- import { scaffoldPrivateFiles, scaffoldStripe, scaffoldRevenueCat, } from './scaffold/integrations.js';
9
+ import { scaffoldPrivateStorage } from './scaffold/storage.js';
19
10
  import { sharedPackage } from './scaffold/files.js';
20
11
  function requirements(purpose, tools, access, credentials, resources, verify) {
21
12
  return { purpose, tools, access, credentials, resources, verify };
22
13
  }
23
- function billingDependencies({ has }) {
24
- return [
25
- 'hono',
26
- has('neon') ? 'neon' : 'd1',
27
- has('clerk') ? 'clerk' : 'better-auth',
28
- ...(has('expo') ? ['expo'] : []),
29
- ];
30
- }
31
- const BILLING_ENVIRONMENT_KEYS = [
32
- 'BILLING_ORIGIN',
33
- 'BILLING_ENVIRONMENT',
34
- 'BILLING_PLANS_JSON',
35
- 'BILLING_ENTITLEMENTS_JSON',
36
- 'BILLING_PREMIUM_ENTITLEMENT',
37
- ];
38
14
  function packageSource(name, source, dependencies) {
39
15
  return { name, source, dependencies };
40
16
  }
41
- function runtimeConfiguration({ runtimeApp, options }) {
42
- const legacy = !usesVoidSelection(options.products, options.hosting);
43
- return `apps/${runtimeApp}/${legacy ? 'wrangler.jsonc' : 'anhedral.cloudflare.json'}`;
44
- }
45
17
  function defineItems(configurations) {
46
18
  return Object.fromEntries(Object.entries(configurations).map(([name, configuration]) => [
47
19
  name,
@@ -58,100 +30,38 @@ function defineItems(configurations) {
58
30
  }
59
31
  /** Every product owns its source recipe, setup requirements and composition policy here. */
60
32
  const PRODUCT_ITEMS = defineItems({
61
- vinext: {
62
- type: 'application',
63
- description: 'Vinext web application on Cloudflare Workers',
64
- targets: ['apps/web'],
65
- selection: { conflicts: ['next'] },
66
- registryDependencies: ['ui'],
67
- setup: requirements('Web application on Cloudflare', ['Browser control', 'Wrangler'], [], [], ['Vinext React application and Cloudflare Worker'], ['Web flows, accessibility, production Worker build and deployed preview']),
68
- install: scaffoldWeb,
69
- },
70
33
  next: {
71
34
  type: 'application',
72
- description: 'Next.js web application on Vercel or OpenNext on Workers',
35
+ description: 'Full Next.js App Router web application on Cloudflare OpenNext',
73
36
  targets: ['apps/web'],
74
- selection: { conflicts: ['vinext'] },
75
- registryDependencies: ['ui'],
76
- setup: requirements('Web application', ['Browser control'], [], [], ['Next.js app; configure the selected hosting provider'], ['Web flows, accessibility, production hosting build and deployed preview']),
37
+ registryDependencies: ['workspace', 'typescript', 'eslint', 'styling'],
38
+ setup: requirements('Server-rendered web application', ['Browser control', 'Wrangler'], ['Cloudflare Workers deployment access'], [], ['Next.js Worker and assets; no backend or database provisioned'], ['Request-rendered HTML, RSC and editable Anhedral UI source']),
77
39
  install: scaffoldWeb,
40
+ environment: ['ANHEDRAL_PREVIEW_ORIGIN'],
78
41
  },
79
42
  expo: {
80
43
  type: 'application',
81
- description: 'Universal Expo web, iOS and Android client with a Cloudflare asset/API gateway',
82
- targets: ['apps/mobile'],
44
+ description: 'Native Expo iOS and Android application with Anhedral native shadcn UI',
45
+ targets: ['apps/mobile', 'packages/native-ui'],
83
46
  registryDependencies: ['workspace', 'typescript', 'eslint', 'styling'],
84
- setup: requirements('Universal web, iOS and Android application', ['Browser control', 'Wrangler'], ['For requested native distribution only: client-owned Apple/Google developer accounts'], ['For requested native builds only: platform signing credentials and EAS access when used'], [
85
- 'Expo universal client, Cloudflare web assets/API gateway; native adapters, signing and store configuration',
86
- ], [
87
- 'Static web export/runtime; requested native delivery additionally needs simulator/device and signed-build acceptance',
88
- ]),
47
+ setup: requirements('Native iOS and Android application', ['Simulator or device'], ['For requested native distribution only: client-owned Apple/Google developer accounts'], ['For requested native builds only: platform signing credentials and EAS access when used'], ['Expo native client; signing and store configuration'], ['Simulator/device and signed-build acceptance']),
89
48
  install: scaffoldExpo,
90
- environment: [],
91
- resolveEnvironment: ({ has }) => (has('hono') ? ['EXPO_PUBLIC_API_URL'] : []),
92
- },
93
- electron: {
94
- type: 'application',
95
- description: 'Electron desktop application with its own web UI',
96
- targets: ['apps/desktop'],
97
- registryDependencies: ['workspace', 'typescript', 'eslint'],
98
- setup: requirements('Desktop application', ['Electron tooling', 'Platform packaging tools'], ['Signing/notarization account for the target platform'], ['Signing credentials; notarization credentials when required'], ['Electron app; packaging and distribution configuration'], ['Packaged desktop app, permissions, update/recovery behavior']),
99
- install: scaffoldElectron,
100
- },
101
- wxt: {
102
- type: 'application',
103
- description: 'WXT browser side-panel extension',
104
- targets: ['apps/extension'],
105
- registryDependencies: ['workspace', 'typescript', 'eslint', 'styling'],
106
- setup: requirements('Chrome side-panel extension', ['Chrome', 'WXT'], ['Extension store publisher access for distribution'], ['Store publishing credentials when required'], ['Extension app; minimal browser permissions and store package'], ['Installed side panel, background/content messaging and permission behavior']),
107
- install: scaffoldWxt,
49
+ environment: ['EXPO_PUBLIC_API_URL'],
108
50
  },
109
51
  hono: {
110
52
  type: 'application',
111
53
  description: 'Shared Hono OpenAPI Worker',
112
54
  targets: ['apps/api'],
113
55
  registryDependencies: ['workspace', 'typescript', 'eslint'],
114
- setup: requirements('Shared OpenAPI backend', ['Wrangler'], ['Cloudflare Workers deployment access'], [], ['API Worker; application routes and authorization'], ['Contract validation, unauthenticated rejection and resource ownership']),
56
+ setup: requirements('Shared OpenAPI backend', ['Wrangler'], ['Cloudflare Workers deployment access'], [], ['API Worker; application routes and authorization'], ['Health contract and application-owned authorization']),
115
57
  install: scaffoldApi,
116
58
  },
117
- neon: {
118
- type: 'package',
119
- description: 'Reusable server database package with Neon HTTP, Drizzle and explicit migrations',
120
- targets: ['packages/db'],
121
- selection: { conflicts: ['d1'] },
122
- registryDependencies: ['workspace', 'typescript', 'eslint'],
123
- setup: requirements('PostgreSQL persistence through direct Neon HTTP and Drizzle', ['Neon integration or API'], ['Client-owned Neon project/branch access'], [
124
- 'Server-side DATABASE_URL; direct DATABASE_URL_UNPOOLED for migrations; separate environment roles',
125
- ], ['Neon project/branches, database roles and reviewed migrations'], ['Migration, runtime connectivity and authorization; HTTP has no interactive transactions']),
126
- install: scaffoldDatabase,
127
- environment: ['DATABASE_URL', 'DATABASE_URL_UNPOOLED'],
128
- runtime: 'server',
129
- resolveTargets: ({ runtimeApp }) => ['packages/db', `apps/${runtimeApp}`],
130
- },
131
- 'neon-realtime': {
132
- type: 'integration',
133
- description: 'Neon live SQL with server-sealed Drizzle queries and a browser-safe subscription client (beta)',
134
- targets: ['packages/neon-realtime'],
135
- selection: { requiresAny: ['neon'] },
136
- registryDependencies: ['workspace', 'typescript', 'eslint', 'neon'],
137
- fallbackDependency: 'neon',
138
- runtime: 'server',
139
- environment: ['NEON_REALTIME_SECRET', 'NEON_REALTIME_URL'],
140
- setup: requirements('Live PostgreSQL query results on the selected Neon branch', ['Neon Console or Neon CLI', 'Browser control'], ['Client-owned Neon project and branch with Realtime beta availability'], ['Server-only NEON_REALTIME_SECRET; public NEON_REALTIME_URL; existing server DATABASE_URL'], [
141
- 'Manually enable Realtime and logical replication on the selected branch; configure allowed browser origins',
142
- 'Tables with stable replica identity; authorized deterministic SELECT queries sealed on the server',
143
- ], [
144
- 'Authorized row isolation, access revocation, capability renewal, disconnect/reconnect and subscription cleanup',
145
- 'Beta has no RLS or performance guarantees; database compute and egress remain billable',
146
- ]),
147
- install: scaffoldNeonRealtime,
148
- },
149
59
  d1: {
150
60
  type: 'package',
151
61
  description: 'Reusable Drizzle D1 database package and explicit migration tooling',
152
- targets: ['packages/db'],
153
- selection: { conflicts: ['neon'] },
154
- registryDependencies: ['workspace', 'typescript', 'eslint'],
62
+ targets: ['packages/db', 'apps/api'],
63
+ selection: {},
64
+ registryDependencies: ['workspace', 'typescript', 'eslint', 'hono'],
155
65
  setup: requirements('SQLite-compatible hosted persistence', ['Wrangler'], ['Cloudflare D1 access'], [], ['D1 database, DB binding and reviewed migrations'], ['Migration, constraints, transactional behavior and runtime queries']),
156
66
  install: scaffoldDatabase,
157
67
  configure: ({ options }) => ({
@@ -165,347 +75,27 @@ const PRODUCT_ITEMS = defineItems({
165
75
  ],
166
76
  }),
167
77
  runtime: 'worker',
168
- resolveTargets: ({ runtimeApp }) => ['packages/db', `apps/${runtimeApp}`],
169
- },
170
- 'local-data': {
171
- type: 'package',
172
- description: 'Interface for platform-specific local persistence adapters',
173
- targets: ['packages/local-data'],
174
- registryDependencies: ['workspace', 'typescript', 'eslint'],
175
- setup: requirements('Device-local SQLite and files', ['Selected platform database/filesystem tooling'], [], [], ['Integration boundary; implement platform adapters and explicit synchronization if needed'], ['Persistence, offline writes and recovery on the selected device']),
176
- package: packageSource('local-data', `// Device-local SQLite and filesystem need platform-specific adapters.
177
- export interface LocalDataStore {
178
- read(key: string): Promise<string | null>;
179
- write(key: string, value: string): Promise<void>;
180
- }
181
- `, {}),
182
- },
183
- clerk: {
184
- type: 'integration',
185
- description: 'Managed identity starter and runtime integration',
186
- targets: ['apps/web', 'packages/auth'],
187
- selection: { conflicts: ['better-auth'], requiresAny: ['vinext', 'next', 'hono'] },
188
- registryDependencies: ['workspace', 'typescript', 'eslint'],
189
- setup: requirements('Managed identity', ['Clerk integration or dashboard'], ['Client-owned Clerk project access'], ['Clerk publishable key; server secret key; webhook secret when used'], ['Identity project, allowed URLs, SDK setup and protected routes'], ['Sign-in/out, session expiry, resource authorization and selected native client flows']),
190
- install: scaffoldClerk,
191
- environment: [
192
- 'NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY',
193
- 'EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY',
194
- 'CLERK_PUBLISHABLE_KEY',
195
- 'CLERK_SECRET_KEY',
196
- ],
197
- resolveEnvironment: ({ has }) => [
198
- 'CLERK_SECRET_KEY',
199
- ...(has('vinext') || has('next') ? ['NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY'] : []),
200
- ...(has('hono') ? ['CLERK_PUBLISHABLE_KEY'] : []),
201
- ],
202
- runtime: 'server',
203
- resolveDependencies: ({ has }) => ['vinext', 'next', 'hono'].filter((id) => has(id)),
204
- resolveTargets: ({ has }) => [
205
- ...(has('vinext') || has('next') ? ['apps/web'] : []),
206
- ...(has('hono') ? ['packages/auth'] : []),
207
- ],
208
- },
209
- 'better-auth': {
210
- type: 'integration',
211
- description: 'Database-backed identity schema and runtime routes',
212
- targets: ['packages/auth', 'packages/db', 'apps/web', 'apps/api'],
213
- selection: { conflicts: ['clerk'], requiresAny: ['neon', 'd1'] },
214
- registryDependencies: ['workspace', 'typescript', 'eslint'],
215
- setup: requirements('Application-managed identity', ['Selected database tooling'], ['Selected database migration/runtime access'], ['BETTER_AUTH_SECRET; BETTER_AUTH_URL'], ['Selected Neon or D1 database, auth schema, trusted origins and application routes'], ['Sign-in/out, session expiry, sign-up policy and resource authorization']),
216
- install: scaffoldBetterAuth,
217
- fallbackDependency: 'd1',
218
- environment: ['BETTER_AUTH_SECRET', 'BETTER_AUTH_URL'],
219
- runtime: 'server',
220
- resolveDependencies: ({ has }) => [
221
- has('neon') ? 'neon' : 'd1',
222
- ...(has('expo') ? ['expo'] : []),
223
- ],
224
- resolveTargets: ({ runtimeApp, has }) => [
225
- 'packages/auth',
226
- 'packages/db',
227
- `apps/${runtimeApp}`,
228
- ...(has('expo') ? ['apps/mobile'] : []),
229
- ],
230
78
  },
231
79
  r2: {
232
80
  type: 'integration',
233
- description: 'Private file binding and authorization guidance',
234
- targets: ['apps/web', 'apps/api'],
235
- registryDependencies: ['workspace', 'typescript', 'eslint'],
236
- setup: requirements('Private remote files', ['Wrangler'], ['Cloudflare R2 bucket/binding access'], [], ['Private R2 bucket and FILES binding; authorized upload/download endpoints'], [
237
- 'Public bucket access disabled; file ownership enforced; clients receive no storage credentials',
81
+ description: 'Server-only private R2 storage foundation',
82
+ targets: ['apps/api/src/private-storage.ts'],
83
+ registryDependencies: ['workspace', 'typescript', 'eslint', 'hono'],
84
+ setup: requirements('Private remote files', ['Wrangler'], ['Cloudflare R2 bucket/binding access'], [], ['Private R2 bucket and FILES binding; no public object routes'], [
85
+ 'Keep public access disabled; implement application authorization before adding object routes',
238
86
  ]),
239
- install: scaffoldPrivateFiles,
87
+ install: scaffoldPrivateStorage,
240
88
  configure: ({ options }) => ({
241
89
  r2_buckets: [{ binding: 'FILES', bucket_name: resourceName(options.name, 'private-files') }],
242
90
  }),
243
91
  runtime: 'worker',
244
- resolveTargets: ({ runtimeApp }) => [`apps/${runtimeApp}/private-files.md`],
245
- },
246
- kv: {
247
- type: 'integration',
248
- description: 'Eventually consistent cache binding',
249
- targets: ['apps/web', 'apps/api'],
250
- registryDependencies: ['workspace', 'typescript', 'eslint'],
251
- setup: requirements('Eventually consistent cache/configuration', ['Wrangler'], ['Cloudflare KV namespace access'], [], ['KV namespace and CONFIG binding'], ['TTL and propagation behavior; never use KV as transactional authority']),
252
- configure: () => ({ kv_namespaces: [{ binding: 'CONFIG', id: 'REPLACE_WITH_KV_ID' }] }),
253
- installer: 'configuration',
254
- runtime: 'worker',
255
- resolveTargets: (context) => [runtimeConfiguration(context)],
256
- },
257
- realtime: {
258
- type: 'service',
259
- description: 'Durable Object room Worker with authorization boundary',
260
- targets: ['apps/realtime'],
261
- registryDependencies: ['workspace', 'typescript', 'eslint'],
262
- setup: requirements('Rooms and collaboration', ['Wrangler', 'Browser control'], ['Cloudflare Durable Objects deployment access'], [], ['Realtime Worker, Durable Object namespace/migration and WebSocket authorization'], ['Authorized room isolation, disconnect/reconnect and deployed WebSockets']),
263
- install: scaffoldRealtime,
264
- },
265
- stream: {
266
- type: 'integration',
267
- description: 'Cloudflare Stream one-to-many live video with WHIP ingest and WHEP playback (GA)',
268
- targets: ['packages/stream'],
269
- runtime: 'server',
270
- environment: ['STREAM_ACCOUNT_ID', 'STREAM_API_TOKEN'],
271
- setup: requirements('Ultra-low latency one-to-many live video', ['Cloudflare Stream API or dashboard', 'Browser control'], ['Client-owned Cloudflare account with Stream enabled; usage-based delivery billing'], [
272
- 'Server-only STREAM_ACCOUNT_ID and account-scoped STREAM_API_TOKEN with Stream Write permission',
273
- ], [
274
- 'Manual Stream activation and live input setup; server management factory with secret WHIP and WHEP endpoints',
275
- ], [
276
- 'Creator/input ownership, viewer authorization and signed playback when private, browser media/ICE, reconnect and session cleanup; live behavior unverified',
277
- ]),
278
- install: scaffoldStream,
279
- },
280
- queues: {
281
- type: 'service',
282
- description: 'Queue producer binding, consumer and dead-letter handling',
283
- targets: ['apps/jobs', 'apps/web', 'apps/api'],
284
- registryDependencies: ['workspace', 'typescript', 'eslint'],
285
- setup: requirements('Deferred jobs', ['Wrangler'], ['Cloudflare Queues configuration access'], [], ['Queue, producer/consumer bindings and failure handling'], ['Retries, idempotency, concurrency and dead-letter recovery']),
286
- install: scaffoldQueues,
287
- configure: ({ options }) => ({
288
- queues: { producers: [{ binding: 'JOBS', queue: resourceName(options.name, 'jobs') }] },
289
- }),
290
- runtime: 'optional-worker',
291
- resolveTargets: (context) => [
292
- 'apps/jobs',
293
- ...(context.has('hono') || context.has('vinext') || context.has('next')
294
- ? [runtimeConfiguration(context)]
295
- : []),
296
- ],
297
- },
298
- cron: {
299
- type: 'service',
300
- description: 'Scheduled Worker',
301
- targets: ['apps/scheduled'],
302
- registryDependencies: ['workspace', 'typescript', 'eslint'],
303
- setup: requirements('Scheduled work', ['Wrangler'], ['Cloudflare Worker deployment access'], [], ['Scheduled Worker and environment-specific Cron Triggers'], ['Schedule, idempotency, failure visibility and overlapping runs']),
304
- install: scaffoldCron,
305
- },
306
- workflows: {
307
- type: 'service',
308
- description: 'Durable multi-step Worker',
309
- targets: ['apps/workflows'],
310
- registryDependencies: ['workspace', 'typescript', 'eslint'],
311
- setup: requirements('Durable multi-step processing', ['Wrangler'], ['Cloudflare Workflows deployment access'], [], ['Workflow Worker/binding and resumable steps'], ['Retry/resume, idempotency, cancellation and failure recovery']),
312
- install: scaffoldWorkflows,
313
- },
314
- 'analytics-engine': {
315
- selection: { requiresAll: ['hono'] },
316
- type: 'integration',
317
- description: 'Workers Analytics Engine dataset binding and server event helper',
318
- targets: ['packages/analytics-engine'],
319
- runtime: 'worker',
320
- install: scaffoldAnalyticsEngine,
321
- configure: ({ options }) => ({
322
- analytics_engine_datasets: [
323
- { binding: 'EVENTS', dataset: resourceName(options.name, 'events').replaceAll('-', '_') },
324
- ],
325
- }),
326
- setup: requirements('Custom server-side analytics', ['Wrangler'], ['Cloudflare Analytics Engine access'], [], ['EVENTS dataset binding; define event semantics and privacy policy'], [
327
- 'Dataset ingestion, sampled query semantics and privacy filtering; not transactional billing state',
328
- ]),
329
- },
330
- images: {
331
- selection: { requiresAll: ['hono'] },
332
- type: 'integration',
333
- description: 'Cloudflare Images binding and private image transform helper',
334
- targets: ['packages/images'],
335
- runtime: 'worker',
336
- install: scaffoldImages,
337
- configure: () => ({ images: { binding: 'IMAGES' } }),
338
- setup: requirements('Image optimization', ['Wrangler'], ['Cloudflare Images account eligibility'], [], ['IMAGES binding; authorize source objects and define transform/usage limits'], ['Real transforms, source ownership and cache isolation']),
339
- },
340
- realtimekit: {
341
- registryDependencies: ['workspace', 'typescript', 'eslint', 'cloudflare-api'],
342
- selection: { requiresAll: ['hono'] },
343
- type: 'integration',
344
- description: 'Cloudflare RealtimeKit server meeting and participant-token helpers',
345
- targets: ['packages/realtimekit'],
346
- runtime: 'worker',
347
- install: scaffoldRealtimeKit,
348
- environment: ['REALTIMEKIT_ACCOUNT_ID', 'REALTIMEKIT_APP_ID', 'REALTIMEKIT_API_TOKEN'],
349
- setup: requirements('Audio/video conferencing', ['Cloudflare RealtimeKit API or dashboard'], ['Cloudflare RealtimeKit app and scoped Realtime permissions'], ['Server-only account/app ID and API token'], [
350
- 'Manual app activation and presets; implement authorized token routes and platform client SDK',
351
- ], ['Meeting isolation, permissions, reconnect and actual device media/teardown']),
352
- },
353
- video: {
354
- registryDependencies: ['workspace', 'typescript', 'eslint', 'cloudflare-api'],
355
- selection: { requiresAll: ['hono'] },
356
- type: 'integration',
357
- description: 'Cloudflare Stream private on-demand direct video upload helper',
358
- targets: ['packages/video'],
359
- runtime: 'worker',
360
- install: scaffoldVideo,
361
- environment: ['STREAM_ACCOUNT_ID', 'STREAM_API_TOKEN'],
362
- setup: requirements('Uploaded video processing and delivery', ['Cloudflare Stream API or dashboard'], ['Cloudflare Stream activation and scoped Stream Write access'], ['Server-only Stream account ID and API token'], [
363
- 'Authorized one-time upload issuance; implement processing checks, signed playback and retention',
364
- ], ['Creator ownership, upload/processing limits and private playback on selected devices']),
365
- },
366
- openai: {
367
- type: 'package',
368
- runtime: 'server',
369
- description: 'Server-side OpenAI SDK factory',
370
- targets: ['packages/ai'],
371
- selection: { conflicts: ['ai-sdk'] },
372
- registryDependencies: ['workspace', 'typescript', 'eslint'],
373
- setup: requirements('Direct OpenAI integration', ['OpenAI integration or API'], ['Client-owned OpenAI project and model access'], ['OPENAI_API_KEY'], ['Server SDK factory; implement application behavior and spending limits'], ['Selected model, failure handling, private inputs and cost controls']),
374
- package: packageSource('ai', "import OpenAI from 'openai';\nexport function createAI(apiKey: string) { return new OpenAI({ apiKey }); }\n", { openai: STACK_DEPENDENCIES['openai'] }),
375
- environment: ['OPENAI_API_KEY'],
376
- },
377
- 'ai-sdk': {
378
- type: 'package',
379
- runtime: 'server',
380
- description: 'Server-side AI SDK and provider exports',
381
- targets: ['packages/ai'],
382
- selection: { conflicts: ['openai'] },
383
- registryDependencies: ['workspace', 'typescript', 'eslint'],
384
- setup: requirements('Streaming AI and provider abstraction', ['Selected AI provider integration or API'], ['Selected provider project/model access'], ['OPENAI_API_KEY for the generated default; selected provider credentials otherwise'], ['Server SDK factory; implement streaming, tools and application behavior'], ['Streaming, tool authorization, interruption and spending limits']),
385
- package: packageSource('ai', "export { generateText, streamText } from 'ai';\nexport { createOpenAI } from '@ai-sdk/openai';\n", { ai: STACK_DEPENDENCIES['ai'], '@ai-sdk/openai': STACK_DEPENDENCIES['@ai-sdk/openai'] }),
386
- environment: ['OPENAI_API_KEY'],
387
- },
388
- 'workers-ai': {
389
- type: 'integration',
390
- description: 'Workers AI runtime binding',
391
- targets: ['apps/web', 'apps/api'],
392
- registryDependencies: ['workspace', 'typescript', 'eslint'],
393
- setup: requirements('Cloudflare-hosted inference', ['Wrangler'], ['Cloudflare Workers AI model access'], [], ['AI binding and selected model invocation'], ['Supported model behavior, authorization and usage limits']),
394
- configure: () => ({ ai: { binding: 'AI' } }),
395
- installer: 'configuration',
396
- runtime: 'worker',
397
- resolveTargets: (context) => [runtimeConfiguration(context)],
398
- },
399
- resend: {
400
- type: 'package',
401
- runtime: 'server',
402
- description: 'Server-side email SDK factory',
403
- targets: ['packages/email'],
404
- registryDependencies: ['workspace', 'typescript', 'eslint'],
405
- setup: requirements('Outbound application email', ['Resend integration or API'], ['Client-owned Resend project; sending-domain DNS access'], ['RESEND_API_KEY; webhook secret when used'], ['Verified sending domain, sender and server integration'], [
406
- 'Delivery, suppression/bounce handling and webhook verification; inbound routing is separate',
407
- ]),
408
- package: packageSource('email', "import { Resend } from 'resend';\nexport function createEmail(apiKey: string) { return new Resend(apiKey); }\n", { resend: STACK_DEPENDENCIES['resend'] }),
409
- environment: ['RESEND_API_KEY'],
410
- },
411
- stripe: {
412
- type: 'integration',
413
- description: 'Authenticated Stripe checkout, portal and server entitlement projection',
414
- targets: ['packages/billing', 'packages/contracts', 'apps/api'],
415
- selection: { requiresAll: ['hono'], requiresAny: ['better-auth', 'clerk'] },
416
- registryDependencies: ['workspace', 'typescript', 'eslint'],
417
- resolveDependencies: billingDependencies,
418
- resolveTargets: ({ has }) => [
419
- 'packages/billing',
420
- 'packages/contracts',
421
- 'apps/api',
422
- ...(has('expo') ? ['apps/mobile'] : []),
423
- ],
424
- setup: requirements('Web payments and subscriptions', ['Stripe integration or CLI'], ['Client-owned Stripe account; test/live access as required'], ['STRIPE_SECRET_KEY; STRIPE_WEBHOOK_SECRET'], ['Products/prices, signed webhooks and entitlement implementation'], ['Test purchase/cancellation, webhook replay and transactional idempotency']),
425
- install: scaffoldStripe,
426
- environment: [...BILLING_ENVIRONMENT_KEYS, 'STRIPE_SECRET_KEY', 'STRIPE_WEBHOOK_SECRET'],
427
- },
428
- revenuecat: {
429
- type: 'integration',
430
- description: 'Native purchases, restore and server-enforced cross-store entitlements',
431
- targets: ['packages/billing', 'packages/contracts', 'apps/api'],
432
- selection: { requiresAll: ['hono'], requiresAny: ['better-auth', 'clerk'] },
433
- registryDependencies: ['workspace', 'typescript', 'eslint'],
434
- resolveDependencies: billingDependencies,
435
- resolveTargets: ({ has }) => [
436
- 'packages/billing',
437
- 'packages/contracts',
438
- 'apps/api',
439
- ...(has('expo') ? ['apps/mobile'] : []),
440
- ],
441
- setup: requirements('Cross-store subscription entitlements; Stripe is optional', ['RevenueCat integration or API', 'Selected mobile store tooling'], ['RevenueCat project; App Store/Play Store product access'], ['Platform public SDK keys; server API/webhook credentials as required'], [
442
- 'Native purchase SDK and authenticated entitlement APIs; configure offerings/store products before acceptance',
443
- ], ['Sandbox purchase/restore, verified webhooks and entitlement reconciliation']),
444
- install: scaffoldRevenueCat,
445
- environment: [
446
- ...BILLING_ENVIRONMENT_KEYS,
447
- 'REVENUECAT_SECRET_KEY',
448
- 'REVENUECAT_WEBHOOK_AUTHORIZATION',
449
- 'REVENUECAT_WEBHOOK_SIGNING_SECRET',
450
- 'REVENUECAT_APP_IDS_JSON',
451
- 'REVENUECAT_PROJECT_ID',
452
- 'EXPO_PUBLIC_REVENUECAT_IOS_API_KEY',
453
- 'EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY',
454
- ],
455
- },
456
- sentry: {
457
- type: 'package',
458
- description: 'Platform-specific monitoring integration boundary',
459
- targets: ['packages/observability'],
460
- registryDependencies: ['workspace', 'typescript', 'eslint'],
461
- setup: requirements('Additional runtime/crash diagnostics', ['Sentry integration or API'], ['Client-owned Sentry project access'], ['SENTRY_DSN; source-map upload token when required'], ['Integration boundary; install/init runtime SDKs and configure private source-map uploads'], ['Captured runtime errors, source maps, privacy filtering and alert delivery']),
462
- package: packageSource('observability', "// Initialize the platform-specific Sentry SDK in each application's runtime entrypoint.\nexport const redactFields = ['authorization', 'cookie', 'password', 'token'];\n", {}),
463
- environment: ['SENTRY_DSN'],
464
- },
465
- basin: {
466
- type: 'package',
467
- description: 'Cloudflare analytical stream binding and event helper',
468
- targets: ['packages/analytics', 'packages/basin'],
469
- registryDependencies: ['workspace', 'typescript', 'eslint'],
470
- setup: requirements('Cloudflare analytical events', ['Wrangler', 'Cloudflare integration or API'], [
471
- 'Cloudflare analytics/Pipelines access; plan supporting selected services; Pipelines Setup grant for managed R2 sink setup',
472
- ], [], [
473
- 'Basin dataset/stream, ANALYTICS binding, optional private R2 sink and authorized sink writes',
474
- ], ['Private ingestion, event delivery, query results and archive retrieval when selected']),
475
- package: packageSource('analytics', `export interface EventStream { send(events: Record<string, unknown>[]): Promise<void> }
476
- export async function recordEvents(stream: EventStream, events: Record<string, unknown>[]) {
477
- await stream.send(events);
478
- }
479
- `, {}),
480
- resolvePackage: ({ has }, recipe) => ({
481
- ...recipe,
482
- name: has('posthog') ? 'basin' : 'analytics',
483
- }),
484
- resolveDependencies: ({ has }) => (has('posthog') ? ['posthog'] : []),
485
- resolveTargets: ({ has }) => [has('posthog') ? 'packages/basin' : 'packages/analytics'],
486
- configure: () => ({
487
- pipelines: [{ binding: 'ANALYTICS', stream: 'REPLACE_WITH_BASIN_STREAM_ID' }],
488
- }),
489
- runtime: 'worker',
490
- },
491
- posthog: {
492
- type: 'package',
493
- runtime: 'server',
494
- description: 'Server-side product analytics factory',
495
- targets: ['packages/analytics'],
496
- registryDependencies: ['workspace', 'typescript', 'eslint'],
497
- setup: requirements('Specialized product analytics', ['PostHog integration or API'], ['Client-owned PostHog project access'], ['POSTHOG_API_KEY; POSTHOG_HOST; separate privileged key if needed'], ['Analytics client factory; implement consent, event schema and privacy filtering'], ['Event receipt, consent behavior and redaction of private data']),
498
- package: packageSource('analytics', "import { PostHog } from 'posthog-node';\nexport function createAnalytics(apiKey: string, host: string) { return new PostHog(apiKey, { host }); }\n", { 'posthog-node': STACK_DEPENDENCIES['posthog-node'] }),
499
- environment: ['POSTHOG_API_KEY', 'POSTHOG_HOST'],
500
92
  },
501
93
  styling: {
502
94
  type: 'package',
503
95
  description: 'Shared platform-independent styling tokens',
504
96
  targets: ['packages/styling'],
505
97
  registryDependencies: ['workspace', 'typescript', 'eslint'],
506
- setup: requirements('Shared styling definitions', [], [], [], [
507
- 'Shared light/dark tokens and Tailwind v3 preset for Expo/WXT; adapt platform typography and components',
508
- ], ['Consistency across selected interfaces; preserve platform-specific components']),
98
+ setup: requirements('Shared styling definitions', [], [], [], ['Shared light/dark tokens, web CSS and Anhedral native shadcn port'], ['Consistency across selected interfaces; preserve platform-specific components']),
509
99
  package: packageSource('styling', `import { light, dark, spacing } from './tokens.cjs';
510
100
 
511
101
  export const styling = {
@@ -540,20 +130,6 @@ const FOUNDATION_ITEMS = defineItems({
540
130
  targets: ['packages/eslint-config'],
541
131
  registryDependencies: ['workspace'],
542
132
  },
543
- 'cloudflare-api': {
544
- type: 'foundation',
545
- installer: 'recipe',
546
- description: 'Shared server-only Cloudflare media management transport',
547
- targets: ['packages/cloudflare-api'],
548
- registryDependencies: ['workspace', 'typescript', 'eslint'],
549
- install: scaffoldCloudflareTransport,
550
- },
551
- ui: {
552
- type: 'foundation',
553
- description: 'Shared shadcn/ui, React, Tailwind and Lucide foundation for web apps',
554
- targets: ['packages/ui'],
555
- registryDependencies: ['workspace', 'typescript', 'eslint'],
556
- },
557
133
  });
558
134
  function freeze(value) {
559
135
  if (value && typeof value === 'object') {
@@ -565,7 +141,7 @@ function freeze(value) {
565
141
  }
566
142
  const DEFINITIONS = freeze({ ...FOUNDATION_ITEMS, ...PRODUCT_ITEMS });
567
143
  function describe(definition) {
568
- const { install: _install, configure: _configure, resolveTargets: _targets, resolveEnvironment: _environment, resolveDependencies: _dependencies, resolvePackage: _package, fallbackDependency: _fallback, ...metadata } = definition;
144
+ const { install: _install, configure: _configure, ...metadata } = definition;
569
145
  return structuredClone(metadata);
570
146
  }
571
147
  export function getStackDefinition(name) {
package/dist/standard.js CHANGED
@@ -1,19 +1,13 @@
1
1
  import { writeProjectSection } from './project-config.js';
2
- import { usesVoidSelection } from './runtime-policy.js';
3
2
  import { configureDependencyPatches } from './dependency-patches.js';
4
3
  import { randomUUID } from 'node:crypto';
5
- import { registerGeneratedProject } from './catalog-registration.js';
6
- import { recordScaffoldFiles } from './registry/receipt.js';
7
4
  import { existsSync, lstatSync, mkdirSync, readdirSync, realpathSync, rmdirSync } from 'node:fs';
8
5
  import path from 'node:path';
9
6
  import { spawnSync } from 'node:child_process';
10
7
  import { execFile } from './util.js';
11
- import { supportsVoidRuntime } from './void.js';
12
- import { registerVercelApplication } from './vercel.js';
13
- import { registerApplication } from './delivery.js';
14
8
  import { runStagedTransaction } from './transaction.js';
15
9
  import { createSetupPlan } from './capabilities.js';
16
- import { bootstrapWorkspace, assertBootstrapPlatform, assertWorkspaceRuntime, } from './scaffold/bootstrap.js';
10
+ import { bootstrapWorkspace, assertWorkspaceRuntime } from './scaffold/bootstrap.js';
17
11
  import { composeStack } from './scaffold/compose.js';
18
12
  import { parseStandardOptions } from './registry/options.js';
19
13
  import { STANDARD_USAGE } from './registry/usage.js';
@@ -27,11 +21,7 @@ export async function scaffoldStandardProject(options, run = execFile, output =
27
21
  printResult('init', plan, { ...output, json: options.json });
28
22
  return;
29
23
  }
30
- assertBootstrapPlatform(run);
31
24
  assertWorkspaceRuntime(run);
32
- const voidWorkspace = usesVoidSelection(options.products, options.hosting);
33
- if (voidWorkspace && run === execFile && !supportsVoidRuntime(process.versions.node))
34
- throw new Error('New Cloudflare workspaces use Void and require Node.js 24.21.0 or newer. Planning remains available on older CLI-supported versions.');
35
25
  const root = options.root;
36
26
  const previousQuiet = process.env.ANHEDRAL_QUIET;
37
27
  if (options.json)
@@ -57,7 +47,7 @@ export async function scaffoldStandardProject(options, run = execFile, output =
57
47
  throw new Error('Destination changed before generation.');
58
48
  },
59
49
  build: async (stageRoot) => {
60
- printProgress('Creating the shadcn/Turborepo workspace…', display);
50
+ printProgress('Creating the Next.js and Anhedral UI workspace…', display);
61
51
  bootstrapWorkspace(stageRoot, options.name, run);
62
52
  printProgress('Composing the selected stack…', display);
63
53
  await composeStack(stageRoot, options, plan.registry);
@@ -65,16 +55,12 @@ export async function scaffoldStandardProject(options, run = execFile, output =
65
55
  schemaVersion: 1,
66
56
  id: randomUUID(),
67
57
  });
68
- if (options.products.includes('next') && options.hosting === 'vercel')
69
- registerVercelApplication(stageRoot);
70
- if (readdirSync(path.join(stageRoot, 'apps')).some((app) => existsSync(path.join(stageRoot, 'apps', app, 'wrangler.jsonc')) ||
71
- existsSync(path.join(stageRoot, 'apps', app, 'anhedral.cloudflare.json'))))
72
- registerApplication(stageRoot);
73
- printProgress('Resolving pinned dependencies…', display);
74
- run('pnpm', ['install', '--lockfile-only', '--no-frozen-lockfile'], stageRoot);
75
- if (configureDependencyPatches(stageRoot))
58
+ if (!options.skipInstall) {
59
+ printProgress('Resolving pinned dependencies…', display);
76
60
  run('pnpm', ['install', '--lockfile-only', '--no-frozen-lockfile'], stageRoot);
77
- recordScaffoldFiles(stageRoot);
61
+ if (configureDependencyPatches(stageRoot))
62
+ run('pnpm', ['install', '--lockfile-only', '--no-frozen-lockfile'], stageRoot);
63
+ }
78
64
  commitPaths.push(...readdirSync(stageRoot).filter((name) => name !== 'node_modules'));
79
65
  },
80
66
  afterCommit: () => {
@@ -95,9 +81,6 @@ export async function scaffoldStandardProject(options, run = execFile, output =
95
81
  printResult('init', {
96
82
  ...plan,
97
83
  generated: true,
98
- catalog: run === execFile || process.env.ANHEDRAL_PLUGIN_DATA || process.env.PLUGIN_DATA
99
- ? registerGeneratedProject(root)
100
- : { state: 'not-enabled' },
101
84
  }, { ...output, json: options.json });
102
85
  }
103
86
  finally {