anhedral 0.13.0 → 0.15.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 (170) hide show
  1. package/README.md +35 -232
  2. package/assets/patches/audit-deps.mjs +12 -2
  3. package/assets/ui/LICENSE.shadcn +21 -0
  4. package/assets/ui/UPSTREAM.json +33 -0
  5. package/assets/ui/native/button.tsx +85 -0
  6. package/assets/ui/native/card.tsx +33 -0
  7. package/assets/ui/native/dialog.tsx +75 -0
  8. package/assets/ui/native/input.tsx +27 -0
  9. package/assets/ui/native/label.tsx +4 -0
  10. package/assets/ui/native/layout.tsx +26 -0
  11. package/assets/ui/native/text.tsx +20 -0
  12. package/assets/ui/native/theme-switcher.tsx +22 -0
  13. package/assets/ui/theme-storage.ts +25 -0
  14. package/assets/ui/theme.tsx +66 -0
  15. package/assets/ui/web/button.tsx +59 -0
  16. package/assets/ui/web/input.tsx +21 -0
  17. package/assets/ui/web/label.tsx +19 -0
  18. package/dist/capabilities.d.ts +5 -5
  19. package/dist/capabilities.js +3 -21
  20. package/dist/capability-contract.d.ts +3 -3
  21. package/dist/capability-contract.js +11 -50
  22. package/dist/cli-delivery.d.ts +1 -1
  23. package/dist/cli-delivery.js +5 -65
  24. package/dist/cli-output.js +3 -3
  25. package/dist/command-schema.js +35 -86
  26. package/dist/delivery-evidence.d.ts +1 -1
  27. package/dist/delivery-evidence.js +7 -36
  28. package/dist/delivery.d.ts +2 -8
  29. package/dist/delivery.js +20 -101
  30. package/dist/dependencies.d.ts +6 -57
  31. package/dist/dependencies.js +54 -188
  32. package/dist/index.d.ts +1 -4
  33. package/dist/index.js +1 -4
  34. package/dist/inspector-model.d.ts +2 -2
  35. package/dist/integration-service-readers.d.ts +1 -2
  36. package/dist/integration-service-readers.js +3 -84
  37. package/dist/lifecycle-model.d.ts +1 -1
  38. package/dist/lifecycle-model.js +1 -1
  39. package/dist/mobile-delivery.d.ts +1 -1
  40. package/dist/mobile-delivery.js +4 -0
  41. package/dist/platforms/mobile.js +30 -121
  42. package/dist/platforms/web.d.ts +3 -0
  43. package/dist/platforms/web.js +299 -0
  44. package/dist/project-config.d.ts +1 -1
  45. package/dist/project-config.js +0 -1
  46. package/dist/project-inspector.js +5 -36
  47. package/dist/project-state.d.ts +1 -3
  48. package/dist/project-state.js +2 -85
  49. package/dist/provider-auth.js +3 -38
  50. package/dist/provider-readiness.d.ts +1 -1
  51. package/dist/provider-readiness.js +5 -24
  52. package/dist/providers/adapters.js +0 -175
  53. package/dist/providers/api.d.ts +1 -1
  54. package/dist/providers/api.js +3 -3
  55. package/dist/providers/config.js +2 -48
  56. package/dist/providers/definitions.d.ts +1 -204
  57. package/dist/providers/definitions.js +0 -85
  58. package/dist/providers/provision.d.ts +1 -1
  59. package/dist/providers/receipts.js +1 -11
  60. package/dist/providers/recovery-verification.js +1 -61
  61. package/dist/providers/runtime.js +4 -35
  62. package/dist/providers/state.js +1 -7
  63. package/dist/provision.d.ts +5 -13
  64. package/dist/provision.js +4 -80
  65. package/dist/readiness.d.ts +1 -1
  66. package/dist/readiness.js +3 -8
  67. package/dist/registry/add.js +10 -70
  68. package/dist/registry/bootstrap.d.ts +3 -2
  69. package/dist/registry/bootstrap.js +4 -13
  70. package/dist/registry/commands.js +8 -10
  71. package/dist/registry/context.js +0 -1
  72. package/dist/registry/options.js +8 -38
  73. package/dist/registry/resolve.d.ts +3 -4
  74. package/dist/registry/resolve.js +26 -108
  75. package/dist/registry/types.d.ts +1 -7
  76. package/dist/registry/usage.js +2 -2
  77. package/dist/runtime-policy.d.ts +0 -2
  78. package/dist/runtime-policy.js +0 -16
  79. package/dist/scaffold/auth.d.ts +1 -2
  80. package/dist/scaffold/auth.js +55 -130
  81. package/dist/scaffold/backend.d.ts +0 -4
  82. package/dist/scaffold/backend.js +1 -186
  83. package/dist/scaffold/billing-schema.d.ts +1 -1
  84. package/dist/scaffold/billing-schema.js +4 -4
  85. package/dist/scaffold/billing.js +11 -19
  86. package/dist/scaffold/bootstrap.d.ts +2 -3
  87. package/dist/scaffold/bootstrap.js +37 -43
  88. package/dist/scaffold/compose.js +2 -14
  89. package/dist/scaffold/database.d.ts +1 -1
  90. package/dist/scaffold/database.js +18 -126
  91. package/dist/scaffold/documentation.d.ts +0 -1
  92. package/dist/scaffold/documentation.js +22 -86
  93. package/dist/scaffold/expo-auth.js +33 -22
  94. package/dist/scaffold/expo-billing.js +17 -52
  95. package/dist/scaffold/expo-runtime.d.ts +2 -2
  96. package/dist/scaffold/expo-runtime.js +6 -97
  97. package/dist/scaffold/integrations.d.ts +1 -3
  98. package/dist/scaffold/integrations.js +9 -10
  99. package/dist/scaffold/managed-email.d.ts +3 -0
  100. package/dist/scaffold/managed-email.js +47 -0
  101. package/dist/scaffold/native-ui.d.ts +2 -0
  102. package/dist/scaffold/native-ui.js +69 -0
  103. package/dist/scaffold/password-reset.d.ts +1 -0
  104. package/dist/scaffold/password-reset.js +99 -0
  105. package/dist/scaffold/private-files.d.ts +2 -0
  106. package/dist/scaffold/private-files.js +78 -0
  107. package/dist/scaffold/stack-documentation.d.ts +0 -1
  108. package/dist/scaffold/stack-documentation.js +3 -49
  109. package/dist/scaffold/styling.d.ts +1 -1
  110. package/dist/scaffold/styling.js +20 -28
  111. package/dist/scaffold/web-billing.d.ts +2 -0
  112. package/dist/scaffold/web-billing.js +48 -0
  113. package/dist/scaffold/workspace.js +53 -194
  114. package/dist/service-deletion.js +1 -1
  115. package/dist/service-descriptor.js +5 -12
  116. package/dist/service-model.d.ts +1 -1
  117. package/dist/service-operations.js +2 -32
  118. package/dist/service-readers.js +1 -32
  119. package/dist/services-command.d.ts +1 -1
  120. package/dist/services-command.js +3 -9
  121. package/dist/ship.d.ts +3 -316
  122. package/dist/ship.js +10 -142
  123. package/dist/stack-registry.d.ts +2 -52
  124. package/dist/stack-registry.js +55 -403
  125. package/dist/standard.js +7 -14
  126. package/dist/version.d.ts +1 -1
  127. package/dist/version.js +1 -1
  128. package/docs/anhedral-stack.md +23 -122
  129. package/docs/assets/anhedral-stack-light.png +0 -0
  130. package/docs/assets/anhedral-stack.png +0 -0
  131. package/docs/software-factory.md +24 -557
  132. package/docs/stack-standard.md +47 -294
  133. package/docs/verification.md +320 -0
  134. package/package.json +20 -22
  135. package/dist/neon-service-data.d.ts +0 -8
  136. package/dist/neon-service-data.js +0 -117
  137. package/dist/platforms/desktop.d.ts +0 -2
  138. package/dist/platforms/desktop.js +0 -415
  139. package/dist/platforms/extension.d.ts +0 -2
  140. package/dist/platforms/extension.js +0 -328
  141. package/dist/registry/presets.d.ts +0 -4
  142. package/dist/registry/presets.js +0 -41
  143. package/dist/scaffold/cloudflare-services.d.ts +0 -8
  144. package/dist/scaffold/cloudflare-services.js +0 -198
  145. package/dist/scaffold/lint.d.ts +0 -4
  146. package/dist/scaffold/lint.js +0 -56
  147. package/dist/scaffold/neon-realtime.d.ts +0 -2
  148. package/dist/scaffold/neon-realtime.js +0 -97
  149. package/dist/scaffold/services.d.ts +0 -5
  150. package/dist/scaffold/services.js +0 -108
  151. package/dist/scaffold/stream.d.ts +0 -2
  152. package/dist/scaffold/stream.js +0 -114
  153. package/dist/scaffold/void.d.ts +0 -4
  154. package/dist/scaffold/void.js +0 -264
  155. package/dist/scaffold/web.d.ts +0 -2
  156. package/dist/scaffold/web.js +0 -130
  157. package/dist/vercel-project.d.ts +0 -101
  158. package/dist/vercel-project.js +0 -305
  159. package/dist/vercel.d.ts +0 -67
  160. package/dist/vercel.js +0 -581
  161. package/dist/vinext.d.ts +0 -2
  162. package/dist/vinext.js +0 -86
  163. package/dist/void-execution.d.ts +0 -10
  164. package/dist/void-execution.js +0 -94
  165. package/dist/void-migrations.d.ts +0 -6
  166. package/dist/void-migrations.js +0 -110
  167. package/dist/void-state.d.ts +0 -16
  168. package/dist/void-state.js +0 -65
  169. package/dist/void.d.ts +0 -3
  170. package/dist/void.js +0 -5
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const GENERATOR_VERSION = '0.13.0';
1
+ export const GENERATOR_VERSION = '0.15.0';
@@ -1,122 +1,23 @@
1
- # Anhedral progressive stack
2
-
3
- **Start minimal. Add capabilities for real needs. Select `--preset full-product`
4
- when the complete foundation is appropriate.**
5
-
6
- ```mermaid
7
- %%{init: {"flowchart": {"curve": "linear", "nodeSpacing": 35, "rankSpacing": 50, "padding": 18}}}%%
8
- flowchart TB
9
- subgraph minimal["1 · Minimal default"]
10
- client["Expo · web / iOS / Android<br/>React Native Reusables · shadcn conventions<br/>NativeWind · shared tokens"]
11
- web["Cloudflare static web Worker"]
12
- client -->|"web export"| web
13
- end
14
-
15
- subgraph optional["2 · Optional capabilities · choose independently"]
16
- backend["Hono API · Cloudflare Workers<br/>Public contracts · authorization"]
17
- core["Data, accounts and files<br/>Drizzle / D1 · Better Auth · private R2 · KV"]
18
- compute["AI, analytics and processing<br/>Workers AI · Analytics Engine · Basin<br/>Images · Queues · Cron · Workflows"]
19
- media["Realtime and video<br/>Durable Object rooms · RealtimeKit<br/>Stream live / uploaded video"]
20
- payments["Payments<br/>Stripe web · RevenueCat native<br/>Shared entitlements enforced by Hono"]
21
- clients["Additional client<br/>WXT browser side panel"]
22
- operations["External operations<br/>Resend email · Sentry monitoring"]
23
- backend -.-> core
24
- backend -.-> compute
25
- backend -.-> media
26
- backend -.-> payments
27
- backend -.-> operations
28
- clients -.->|"when a backend is needed"| backend
29
- end
30
-
31
- web ~~~ clients
32
- web -.->|"add API service binding"| backend
33
- client -.->|"native HTTPS when selected"| backend
34
-
35
- subgraph full["3 · Full-product preset · selection summary"]
36
- preset["Minimal app + all capabilities above<br/>22 selected products · no provider activation"]
37
- end
38
- core ~~~ preset
39
- compute ~~~ preset
40
- media ~~~ preset
41
- payments ~~~ preset
42
- operations ~~~ preset
43
- ```
44
-
45
- Solid lines show the minimal delivery path. Dashed lines summarize optional
46
- integrations, not every network request or deployment. The full-product group is a
47
- selection summary, not another runtime. Grouped capabilities remain separate
48
- services; their exact connections depend on the implemented product.
49
-
50
- ## Minimal default
51
-
52
- | Part | Default |
53
- | --- | --- |
54
- | Client | Expo + React Native + Expo Router |
55
- | Components | React Native Reusables with **shadcn conventions** |
56
- | Styling | NativeWind + shared design tokens |
57
- | Workspace | TypeScript + pnpm + Turborepo; shared TypeScript/ESLint configuration |
58
- | Web hosting | Static Expo export on a Cloudflare asset Worker |
59
- | Native delivery | Local development; EAS and app stores when requested |
60
-
61
- Plain `anhedral init my-app` creates no API, auth, database, storage binding or
62
- billing package. Static dynamic routes need build-time paths; SSR is a deliberate
63
- alternative.
64
-
65
- **Growth is additive.** `hono` adds the API and contracts. `d1` adds Hono and SQL.
66
- `better-auth` adds Hono and a database. `r2` adds private server-side file storage.
67
- Dependencies resolve automatically: an AI tool can have an API without accounts,
68
- and an anonymous app can use SQL. Additions preserve edited source; backend or
69
- hosting-engine migrations require explicit review.
70
-
71
- ## Payments and AI
72
-
73
- | Add | What it supplies |
74
- | --- | --- |
75
- | `stripe` | Web Checkout/customer portal; Hono, identity and durable billing state |
76
- | `revenuecat` | Native purchase/restore/manage flows; shared identity and entitlements |
77
- | `workers-ai` | Hono + AI binding; no implicit accounts, database or subscriptions |
78
-
79
- Stripe and RevenueCat are independent. Hono verifies webhooks, reconciles provider
80
- state and enforces paid access. Native purchases use Apple/Google billing;
81
- RevenueCat synchronizes subscription state. Client purchase results never authorize
82
- server operations. AI routes still need models, validation and usage limits.
83
-
84
- ## Services, add-ons and alternatives
85
-
86
- | Capability | Selection | Scope |
87
- | --- | --- | --- |
88
- | Analytics | `analytics-engine`, `basin` | Event dataset/helper; private Pipelines stream |
89
- | Images | `images` | Binding and private raw-byte transform helper |
90
- | Video | `video`, `stream` | Private uploaded-video helper; WHIP/WHEP live input helper |
91
- | Conferencing | `realtimekit` | Server meeting and participant-token helpers |
92
- | App messaging | `realtime` | Durable Object room Worker |
93
- | Jobs | `queues`, `cron`, `workflows` | Queue/DLQ, scheduled and durable Worker foundations |
94
- | Cache | `kv` | Eventually consistent configuration/cache |
95
- | Extension | `wxt` | Browser side panel API, entrypoints and permissions |
96
- | Operations | `resend`, `sentry` | Email factory and monitoring integration boundary |
97
- | **Next.js on Vercel** | `next` | Usual explicit web frontend alternative |
98
- | **Vinext on Cloudflare** | `vinext` | Additional explicit web frontend alternative |
99
- | Data / identity alternatives | `neon`, `clerk` | Replace D1 / Better Auth |
100
- | Specialized additions | `neon-realtime`, `openai` / `ai-sdk`, `posthog`, `electron`, `local-data` | Live SQL, alternative AI, product analytics, desktop or local persistence |
101
-
102
- **Full-product includes:** Expo, WXT, Hono, Better Auth, D1, R2, KV, Stripe,
103
- RevenueCat, Workers AI, Analytics Engine, Basin, Images, RealtimeKit, Durable Object
104
- rooms, uploaded video, live Stream video, Queues, Cron, Workflows, Resend and Sentry.
105
- Explicit Next.js/Vinext, Neon and Clerk replace their corresponding preset defaults.
106
-
107
- Cloudflare hosts selected web/API, data, storage, AI and media services. Payment
108
- providers, app stores, Resend, Sentry and Vercel remain external. Media travels
109
- directly between clients and media services; Hono handles authorization and token
110
- issuance. Provider activation, product routes/UI and real acceptance remain work
111
- after scaffolding—especially room authorization, media clients and job processing.
112
-
113
- ```sh
114
- anhedral init my-app
115
- anhedral add better-auth --cwd my-app --dry-run --json
116
- anhedral init complete --preset full-product --dry-run --json
117
- ```
118
-
119
- Deployable code lives in `apps/*`; shared code lives in `packages/*`. Contracts,
120
- database, auth, billing and service packages appear when selected. Small apps avoid
121
- unneeded infrastructure; complex products use the same boundaries with more
122
- capabilities.
1
+ # Anhedral application stack
2
+
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="assets/anhedral-stack.png">
5
+ <source media="(prefers-color-scheme: light)" srcset="assets/anhedral-stack-light.png">
6
+ <img alt="Next.js web and Expo iOS/Android connect to Hono, Drizzle/D1 and private R2. Stripe and RevenueCat are optional payment additions." src="assets/anhedral-stack-light.png" width="1200">
7
+ </picture>
8
+
9
+ Every application starts with **Next.js web + Expo native + Hono + Drizzle/D1 + private R2**. Better Auth,
10
+ shared contracts and design tokens support the foundation. Stripe and RevenueCat are
11
+ the only optional additions; either can be selected independently.
12
+
13
+ Hono owns authentication, authorization, data and private files. The Next.js App Router supports SSR and React Server Components through Cloudflare
14
+ OpenNext. Web uses DOM shadcn UI; Expo iOS/Android uses the Anhedral native shadcn
15
+ port. UI implementations share contracts and tokens, not browser/native primitives.
16
+ Web API transport uses the `ANHEDRAL_API` service binding; native clients use the
17
+ configured HTTPS API. Stripe checkout and RevenueCat purchases reconcile to
18
+ shared server-enforced entitlements.
19
+
20
+ Source generation is separate from resource provisioning, migrations and deployment.
21
+ See the [stack standard](stack-standard.md) and [development workflow](software-factory.md).
22
+ The editable [diagram source](https://github.com/anhedral/anhedral-cli/blob/main/docs/assets/render-stack.mjs)
23
+ produces both themes from the same layout.
Binary file