anhedral 0.12.0 → 0.13.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 (73) hide show
  1. package/README.md +99 -39
  2. package/dist/capabilities.d.ts +3 -3
  3. package/dist/capability-contract.js +12 -1
  4. package/dist/command-schema.js +8 -2
  5. package/dist/command.js +9 -11
  6. package/dist/delivery.js +3 -1
  7. package/dist/dependencies.d.ts +6 -1
  8. package/dist/dependencies.js +13 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +1 -0
  11. package/dist/platforms/mobile.d.ts +1 -1
  12. package/dist/platforms/mobile.js +44 -3
  13. package/dist/project-state.js +4 -1
  14. package/dist/provider-auth.js +6 -0
  15. package/dist/providers/adapters.js +9 -3
  16. package/dist/providers/runtime.js +11 -0
  17. package/dist/readiness.js +4 -2
  18. package/dist/registry/add.js +40 -7
  19. package/dist/registry/options.js +12 -0
  20. package/dist/registry/presets.d.ts +4 -0
  21. package/dist/registry/presets.js +41 -0
  22. package/dist/registry/resolve.d.ts +3 -1
  23. package/dist/registry/resolve.js +40 -14
  24. package/dist/registry/types.d.ts +1 -0
  25. package/dist/registry/usage.js +1 -1
  26. package/dist/runtime-policy.js +4 -1
  27. package/dist/scaffold/api.js +10 -2
  28. package/dist/scaffold/auth.d.ts +1 -1
  29. package/dist/scaffold/auth.js +22 -6
  30. package/dist/scaffold/backend.d.ts +6 -0
  31. package/dist/scaffold/backend.js +224 -0
  32. package/dist/scaffold/billing-config.d.ts +1 -0
  33. package/dist/scaffold/billing-config.js +73 -0
  34. package/dist/scaffold/billing-contracts.d.ts +2 -0
  35. package/dist/scaffold/billing-contracts.js +48 -0
  36. package/dist/scaffold/billing-providers.d.ts +1 -0
  37. package/dist/scaffold/billing-providers.js +249 -0
  38. package/dist/scaffold/billing-schema.d.ts +1 -0
  39. package/dist/scaffold/billing-schema.js +34 -0
  40. package/dist/scaffold/billing-security.d.ts +1 -0
  41. package/dist/scaffold/billing-security.js +46 -0
  42. package/dist/scaffold/billing-server.d.ts +1 -0
  43. package/dist/scaffold/billing-server.js +139 -0
  44. package/dist/scaffold/billing-store.d.ts +1 -0
  45. package/dist/scaffold/billing-store.js +72 -0
  46. package/dist/scaffold/billing.d.ts +2 -0
  47. package/dist/scaffold/billing.js +216 -0
  48. package/dist/scaffold/cloudflare-services.d.ts +8 -0
  49. package/dist/scaffold/cloudflare-services.js +198 -0
  50. package/dist/scaffold/compose.js +2 -0
  51. package/dist/scaffold/database.js +19 -2
  52. package/dist/scaffold/documentation.js +10 -6
  53. package/dist/scaffold/expo-auth.d.ts +3 -0
  54. package/dist/scaffold/expo-auth.js +192 -0
  55. package/dist/scaffold/expo-billing.d.ts +3 -0
  56. package/dist/scaffold/expo-billing.js +292 -0
  57. package/dist/scaffold/expo-runtime.d.ts +3 -0
  58. package/dist/scaffold/expo-runtime.js +134 -0
  59. package/dist/scaffold/integrations.d.ts +2 -1
  60. package/dist/scaffold/integrations.js +7 -2
  61. package/dist/scaffold/void.js +13 -5
  62. package/dist/scaffold/web.js +2 -0
  63. package/dist/scaffold/workspace.js +6 -1
  64. package/dist/ship.js +3 -1
  65. package/dist/stack-registry.d.ts +11 -2
  66. package/dist/stack-registry.js +136 -16
  67. package/dist/version.d.ts +1 -1
  68. package/dist/version.js +1 -1
  69. package/docs/anhedral-stack.md +122 -0
  70. package/docs/software-factory.md +67 -8
  71. package/docs/stack-standard.md +126 -57
  72. package/docs/verification.md +113 -0
  73. package/package.json +7 -4
package/README.md CHANGED
@@ -4,9 +4,11 @@
4
4
  [![npm](https://img.shields.io/npm/v/anhedral)](https://www.npmjs.com/package/anhedral)
5
5
  [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
6
6
 
7
- Anhedral creates TypeScript application workspaces and helps deliver them to your own cloud accounts. Start with a web app, add the interfaces and services your product needs, and keep the source code, infrastructure, data and billing under your control.
7
+ > 🚧 **Under construction.** Anhedral is in active development; features and APIs may change.
8
8
 
9
- The default is **Vinext, React, Tailwind, shadcn/ui and Lucide on Cloudflare Workers**, with pnpm and Turborepo. The CLI generates the foundation and handles supported setup and delivery operations. You or your coding agent implement the product.
9
+ Anhedral creates TypeScript application workspaces and helps deliver them to your own cloud accounts. Start with a minimal universal frontend, add the services your product needs, and keep the source code, infrastructure, data and billing under your control.
10
+
11
+ The default is a **minimal Expo web/iOS/Android app** with React Native Reusables using shadcn conventions, NativeWind, shared styling, TypeScript, pnpm and Turborepo. Cloudflare hosts its static web export. Add API, accounts, data, files, payments or AI when needed; the resolver supplies dependencies. `--preset full-product` selects the complete compatible product foundation without activating services.
10
12
 
11
13
  ## Start locally
12
14
 
@@ -24,39 +26,93 @@ cd my-app
24
26
  pnpm dev
25
27
  ```
26
28
 
27
- Initialization downloads the pinned upstream starter and installs dependencies. It does not provision cloud services or deploy the app. Follow the generated README for local addresses and any setup required by your selection. You can also run the CLI with `pnpm dlx anhedral@latest`; pin a version for repeatable automation.
28
-
29
- ## Defaults
29
+ Initialization creates the selected frontend and API foundations, downloads any required pinned upstream starter and installs dependencies. It does not provision cloud services or deploy the app. Follow the generated README for local addresses and any setup required by your selection. You can also run the CLI with `pnpm dlx anhedral@latest`; pin a version for repeatable automation.
30
+
31
+ ## Progressive stack
32
+
33
+ Plain init creates only the Expo client, styling and tooling. Add capabilities for
34
+ real requirements, or use `--preset full-product` for the complete compatible
35
+ foundation. [See the concise stack page](docs/anhedral-stack.md).
36
+
37
+ ```mermaid
38
+ %%{init: {"flowchart": {"curve": "linear", "nodeSpacing": 35, "rankSpacing": 50, "padding": 18}}}%%
39
+ flowchart TB
40
+ subgraph minimal["1 · Minimal default"]
41
+ client["Expo · web / iOS / Android<br/>React Native Reusables · shadcn conventions<br/>NativeWind · shared tokens"]
42
+ web["Cloudflare static web Worker"]
43
+ client -->|"web export"| web
44
+ end
45
+
46
+ subgraph optional["2 · Optional capabilities · choose independently"]
47
+ backend["Hono API · Cloudflare Workers<br/>Public contracts · authorization"]
48
+ core["Data, accounts and files<br/>Drizzle / D1 · Better Auth · private R2 · KV"]
49
+ compute["AI, analytics and processing<br/>Workers AI · Analytics Engine · Basin<br/>Images · Queues · Cron · Workflows"]
50
+ media["Realtime and video<br/>Durable Object rooms · RealtimeKit<br/>Stream live / uploaded video"]
51
+ payments["Payments<br/>Stripe web · RevenueCat native<br/>Shared entitlements enforced by Hono"]
52
+ clients["Additional client<br/>WXT browser side panel"]
53
+ operations["External operations<br/>Resend email · Sentry monitoring"]
54
+ backend -.-> core
55
+ backend -.-> compute
56
+ backend -.-> media
57
+ backend -.-> payments
58
+ backend -.-> operations
59
+ clients -.->|"when a backend is needed"| backend
60
+ end
61
+
62
+ web ~~~ clients
63
+ web -.->|"add API service binding"| backend
64
+ client -.->|"native HTTPS when selected"| backend
65
+
66
+ subgraph full["3 · Full-product preset · selection summary"]
67
+ preset["Minimal app + all capabilities above<br/>22 selected products · no provider activation"]
68
+ end
69
+ core ~~~ preset
70
+ compute ~~~ preset
71
+ media ~~~ preset
72
+ payments ~~~ preset
73
+ operations ~~~ preset
74
+ ```
30
75
 
31
- Plain `anhedral init my-app` creates a Vinext web application. It includes no database, application identity provider, billing, email or analytics service.
76
+ | Need | Selection | Added automatically |
77
+ | --- | --- | --- |
78
+ | Minimal client | Plain init / `--preset minimal` | Expo, NativeWind, shared tokens and workspace tooling |
79
+ | Server logic | `--expo --hono` | Hono API and public contracts |
80
+ | Persistence | `--d1` | Hono and Drizzle/D1 |
81
+ | Accounts | `--better-auth` | Hono, a database and browser/native auth |
82
+ | AI | `--workers-ai` | Hono and AI binding; no implicit accounts or billing |
83
+ | Full product | `--preset full-product` | All compatible Cloudflare layers, WXT, payments, email and monitoring |
84
+
85
+ The full preset includes Expo, WXT side panel, Hono, Better Auth, D1, R2, KV,
86
+ Stripe, RevenueCat, Workers AI, Analytics Engine, Basin/Pipelines, Images,
87
+ RealtimeKit, Durable Object rooms, uploaded/live Stream video, Queues, Cron,
88
+ Workflows, Resend and Sentry. Bindings and helpers still need product logic,
89
+ provider setup and real acceptance. Init never provisions or activates services.
32
90
 
33
- | Area | Default |
34
- | ------------- | ----------------------------------------------------------------------------------------------- |
35
- | Application | Vinext and React on Cloudflare Workers |
36
- | UI | TypeScript, Tailwind, shadcn/ui conventions and Lucide |
37
- | Workspace | pnpm workspaces and Turborepo, even for one application |
38
- | Tooling | Shared TypeScript and ESLint configuration packages; root checks and dependency audit |
39
- | Delivery | Void for supported Cloudflare selections |
40
- | Source | Deployable code in `apps/*`, reusable code in `packages/*` |
41
- | Configuration | One root `anhedral.json` and `pnpm-lock.yaml`; secrets and local delivery history stay separate |
91
+ ```sh
92
+ anhedral init complete --preset full-product --dry-run --json
93
+ anhedral add better-auth --cwd my-app --dry-run --json
94
+ anhedral add workers-ai images --cwd my-app --dry-run --json
95
+ anhedral add stripe revenuecat --cwd my-app --dry-run --json
96
+ ```
42
97
 
43
- The registry has four foundation entries: `workspace`, `typescript`, `eslint` and `ui`. The first three accompany every project; the shared UI foundation accompanies web applications.
98
+ Additions preserve edited source and reject conflicting regeneration or backend
99
+ relocation. Auth additions expose `/sign-in` and `/account` for product navigation.
44
100
 
45
101
  ## Choose the applications
46
102
 
47
- Combine these flags after `anhedral init my-app`. Vinext and Next.js are alternatives; web, API, mobile, desktop and extension applications can otherwise coexist.
48
-
49
- | Selection | Generates |
50
- | ----------------------------- | ----------------------------------------------------------------------------------- |
51
- | Default, or `--vinext` | Vinext web application on Cloudflare Workers |
52
- | `--next` | Native Next.js web application on Vercel |
53
- | `--next --hosting=cloudflare` | Next.js on Workers through OpenNext |
54
- | `--hono` | Shared Hono API Worker with OpenAPI/Zod contracts |
55
- | `--expo` | Expo/React Native, Expo Router, NativeWind and React Native Reusables configuration |
56
- | `--electron` | Electron/React desktop application, Vite and packaging configuration |
57
- | `--wxt` | WXT/React Chrome side-panel extension |
103
+ Expo on Cloudflare is the minimal universal default. **Next.js on Vercel**
104
+ (`--next`) is the usual explicit web alternative; **Vinext on Cloudflare**
105
+ (`--vinext`) is also available. `--hono`, `--wxt` and `--electron` alone select
106
+ standalone applications; combine them with `--expo` when desired. Explicit Neon
107
+ or Clerk replace the full preset's D1 or Better Auth selections. OpenNext remains
108
+ an explicit compatibility profile (`--next --hosting=cloudflare`).
58
109
 
59
- Explicit application flags replace the default application selection. `--expo` generates mobile alone; `--vinext --expo` selects both. If you select only add-ons, such as `--neon`, the resolver includes a default web application. Use web server routes for a web-only backend, or select Hono for an API shared by several clients.
110
+ Every workspace uses pnpm and Turborepo with shared TypeScript/ESLint configuration
111
+ and one root lockfile. Public contracts appear with Hono; server auth, database
112
+ and billing packages appear only when selected. Root `pnpm dev` serves exported
113
+ Expo web on 3000 and Hono on 8787 when present. Native Metro uses
114
+ `pnpm --dir apps/mobile start`. Browser changes need a re-export; this is not HMR.
115
+ Keep SDK 57 pinned and provide build-time paths for static dynamic routes.
60
116
 
61
117
  ## Choose data and identity
62
118
 
@@ -72,11 +128,15 @@ Database code lives in `packages/db`, including schemas and explicit migration t
72
128
 
73
129
  ## Choose services and integrations
74
130
 
75
- These are optional foundations. The generated scope column distinguishes bindings and Workers from SDK factories and integration guidance.
131
+ Private R2 and every service below are optional; full-product selects the complete compatible set. The generated scope column distinguishes bindings and Workers from SDK factories and integration guidance.
76
132
 
77
133
  | Selection | Purpose | Generated scope |
78
134
  | ----------------- | --------------------------------- | ---------------------------------------------------------------------------------------- |
79
135
  | `--r2` | Private files | R2 Worker binding and authorization guidance |
136
+ | `--analytics-engine` | Custom event analytics | Dataset binding and privacy-safe server event helper |
137
+ | `--images` | Image processing | Images binding and private raw-byte transform helper |
138
+ | `--realtimekit` | Audio/video conferencing | Meeting/participant-token helpers; client SDK/UI remains product work |
139
+ | `--video` | Uploaded video | Private Stream upload helper; implement processing checks and signed playback |
80
140
  | `--kv` | Cache/configuration | Eventually consistent Worker binding |
81
141
  | `--realtime` | WebSocket rooms | Separate Durable Object Worker; implement room authorization |
82
142
  | `--neon-realtime` | Live PostgreSQL query results | Server/client factories and Drizzle adapter; adds Neon; manual branch activation |
@@ -88,8 +148,8 @@ These are optional foundations. The generated scope column distinguishes binding
88
148
  | `--openai` | Direct OpenAI integration | Server SDK factory in `packages/ai` |
89
149
  | `--ai-sdk` | AI streaming/provider abstraction | AI SDK exports with an OpenAI provider; alternative to `--openai` |
90
150
  | `--resend` | Transactional email | Server SDK factory in `packages/email` |
91
- | `--stripe` | Payments/subscriptions | Server SDK factory in `packages/billing` |
92
- | `--revenuecat` | Cross-store entitlements | Integration guidance; explicitly requires `--stripe`; install platform SDKs |
151
+ | `--stripe` | Payments/subscriptions | Hono Checkout/portal/webhooks, DB projection and server entitlement guard |
152
+ | `--revenuecat` | Cross-store entitlements | Native purchase/restore/manage plus Hono webhooks and shared entitlement projection |
93
153
  | `--sentry` | Error/crash monitoring | Integration boundary and redaction fields; initialize platform SDKs |
94
154
  | `--posthog` | Product analytics | Server analytics factory |
95
155
  | `--basin` | Cloudflare analytical events | Private stream binding and event helper |
@@ -99,11 +159,11 @@ Live video (`--stream`), room messaging (`--realtime`) and live SQL (`--neon-rea
99
159
 
100
160
  ### Composition rules
101
161
 
102
- - Choose one web framework, one database and one identity provider. `--openai` and `--ai-sdk` are alternatives.
162
+ - Choose one web framework, one database and one identity provider; D1 and Better Auth are the defaults when data/identity is needed. `--openai` and `--ai-sdk` are alternatives.
103
163
  - Database/auth, Stream and Neon Realtime selections need a compatible server. For mobile with PostgreSQL, use `--expo --hono --neon`.
104
- - Native Next.js/Vercel plus Worker-bound capabilities such as D1 or R2 automatically adds Hono on Cloudflare.
105
- - Explicit OpenNext, Queues or Basin uses Wrangler for the Cloudflare workspace. Other supported Cloudflare selections use Void. `add` rejects changes that switch an existing engine or relocate runtime source.
106
- - Neon Realtime requires Neon and manual Realtime configuration. RevenueCat requires an explicit Stripe selection.
164
+ - New server capabilities introduce Hono on Cloudflare, including for Next.js/Vercel. Existing apps retain runtime ownership during `add`.
165
+ - New Expo workspaces, explicit OpenNext, Queues, Basin, Images and Analytics Engine use Wrangler for the Cloudflare workspace. Other supported Cloudflare selections use Void. `add` rejects changes that switch an existing engine or relocate runtime source.
166
+ - Neon Realtime requires Neon and manual Realtime configuration. Stripe and RevenueCat are independently optional; WXT is an optional browser-extension interface.
107
167
 
108
168
  Examples:
109
169
 
@@ -111,8 +171,8 @@ Examples:
111
171
  # Web with database-backed identity; Better Auth adds D1.
112
172
  anhedral init my-app --better-auth
113
173
 
114
- # Web, shared API, mobile and PostgreSQL.
115
- anhedral init my-app --vinext --hono --expo --neon
174
+ # Universal web/iOS/Android, shared API and PostgreSQL.
175
+ anhedral init my-app --expo --neon
116
176
 
117
177
  # Vercel web with a Cloudflare API and private files.
118
178
  anhedral init my-app --next --r2
@@ -150,7 +210,7 @@ anhedral verify --json
150
210
 
151
211
  Replace the example member with the intended user. Private Cloudflare hosting requires Zero Trust and scoped Access permissions; native Vercel uses its own connect options in the factory. Implement a meaningful `test:live` script before `verify`. Actual shipping can create resources, apply reviewed deployment migrations and publish code. Provider permissions, account eligibility and usage charges still apply. A generated starter or successful deployment does not establish a working product.
152
212
 
153
- Cloudflare and Vercel have automated delivery and provider evidence checks. Mixed delivery runs Cloudflare before Vercel and can partially succeed. Expo shipping returns verified EAS build artifacts; store submission is separate. Electron and extension projects include local build/package tooling, with signing and distribution handled through their platform workflows.
213
+ Cloudflare and Vercel have automated delivery and provider evidence checks. Mixed delivery runs Cloudflare before Vercel and can partially succeed. Expo native shipping with an explicit platform returns verified EAS build artifacts; store submission is separate. Electron and extension projects include local build/package tooling, with signing and distribution handled through their platform workflows.
154
214
 
155
215
  Use the [stack standard](docs/stack-standard.md) for destinations, compatibility, migration ownership, environment files and the remaining implementation requirements for every option. Exact dependency versions live in the [source catalog](https://github.com/anhedral/anhedral-cli/blob/main/src/dependencies.ts).
156
216
 
@@ -165,7 +225,7 @@ Select **Try now**, or start with:
165
225
 
166
226
  > Create a new project using [@Anhedral](plugin://anhedral@anhedral). Start by explaining the stack and asking me what it should be about.
167
227
 
168
- The plugin guides implementation using the same stack and workflow. Its optional inspector shows project structure, setup, recorded delivery evidence and explicit service controls. Opening it does not deploy the app. The CLI works independently.
228
+ The plugin ships six focused skills: Init, Dev, Design, Auth, Billing and Hosting. They guide implementation using the same stack and workflow. Its optional inspector shows project structure, setup, recorded delivery evidence and explicit service controls. Opening it does not deploy the app. The CLI works independently.
169
229
 
170
230
  ## Read next
171
231
 
@@ -6,7 +6,7 @@ export declare const CAPABILITIES: Record<StandardProduct, Capability>;
6
6
  export declare const CAPABILITY_REGISTRY: {
7
7
  schemaVersion: number;
8
8
  cliVersion: string;
9
- capabilities: Record<"next" | "queues" | "basin" | "vinext" | "hono" | "realtime" | "cron" | "workflows" | "electron" | "wxt" | "expo" | "styling" | "neon" | "d1" | "neon-realtime" | "local-data" | "clerk" | "better-auth" | "r2" | "kv" | "stream" | "openai" | "ai-sdk" | "workers-ai" | "resend" | "stripe" | "revenuecat" | "sentry" | "posthog", Capability>;
9
+ capabilities: Record<"next" | "electron" | "wxt" | "expo" | "vinext" | "realtime" | "workflows" | "styling" | "hono" | "neon" | "d1" | "neon-realtime" | "local-data" | "clerk" | "better-auth" | "r2" | "kv" | "stream" | "queues" | "cron" | "analytics-engine" | "images" | "realtimekit" | "video" | "openai" | "ai-sdk" | "workers-ai" | "resend" | "stripe" | "revenuecat" | "sentry" | "basin" | "posthog", Capability>;
10
10
  };
11
11
  export declare function createSetupPlan(options: StandardOptions, registry?: import("./registry/resolve.js").ResolvedStackRegistry): {
12
12
  schemaVersion: number;
@@ -15,7 +15,7 @@ export declare function createSetupPlan(options: StandardOptions, registry?: imp
15
15
  standard: string;
16
16
  root: string;
17
17
  name: string;
18
- products: ("next" | "queues" | "basin" | "vinext" | "hono" | "realtime" | "cron" | "workflows" | "electron" | "wxt" | "expo" | "styling" | "neon" | "d1" | "neon-realtime" | "local-data" | "clerk" | "better-auth" | "r2" | "kv" | "stream" | "openai" | "ai-sdk" | "workers-ai" | "resend" | "stripe" | "revenuecat" | "sentry" | "posthog")[];
18
+ products: ("next" | "electron" | "wxt" | "expo" | "vinext" | "realtime" | "workflows" | "styling" | "hono" | "neon" | "d1" | "neon-realtime" | "local-data" | "clerk" | "better-auth" | "r2" | "kv" | "stream" | "queues" | "cron" | "analytics-engine" | "images" | "realtimekit" | "video" | "openai" | "ai-sdk" | "workers-ai" | "resend" | "stripe" | "revenuecat" | "sentry" | "basin" | "posthog")[];
19
19
  hosting: import("./registry/types.js").Hosting;
20
20
  registry: import("./registry/resolve.js").ResolvedStackRegistry;
21
21
  bootstrap: ("next" | "pnpm" | "shadcn@4.21.4" | "dlx" | "init" | "--monorepo" | "--template")[];
@@ -32,7 +32,7 @@ export declare function createSetupPlan(options: StandardOptions, registry?: imp
32
32
  credentials: readonly string[];
33
33
  resources: readonly string[];
34
34
  verify: readonly string[];
35
- id: "next" | "queues" | "basin" | "vinext" | "hono" | "realtime" | "cron" | "workflows" | "electron" | "wxt" | "expo" | "styling" | "neon" | "d1" | "neon-realtime" | "local-data" | "clerk" | "better-auth" | "r2" | "kv" | "stream" | "openai" | "ai-sdk" | "workers-ai" | "resend" | "stripe" | "revenuecat" | "sentry" | "posthog";
35
+ id: "next" | "electron" | "wxt" | "expo" | "vinext" | "realtime" | "workflows" | "styling" | "hono" | "neon" | "d1" | "neon-realtime" | "local-data" | "clerk" | "better-auth" | "r2" | "kv" | "stream" | "queues" | "cron" | "analytics-engine" | "images" | "realtimekit" | "video" | "openai" | "ai-sdk" | "workers-ai" | "resend" | "stripe" | "revenuecat" | "sentry" | "basin" | "posthog";
36
36
  }[];
37
37
  completion: string[];
38
38
  resourcesProvisioned: boolean;
@@ -4,7 +4,14 @@ import { GENERATOR_VERSION } from './version.js';
4
4
  const stage = (support, scope, evidence = 'local-contract') => ({ support, evidence, scope });
5
5
  const none = (scope) => stage('not-applicable', scope, 'unverified');
6
6
  const cloudflareResources = ['d1', 'r2', 'kv', 'queues', 'basin'];
7
- const deploymentBindings = ['realtime', 'cron', 'workflows', 'workers-ai'];
7
+ const deploymentBindings = [
8
+ 'realtime',
9
+ 'cron',
10
+ 'workflows',
11
+ 'workers-ai',
12
+ 'analytics-engine',
13
+ 'images',
14
+ ];
8
15
  function integration(id) {
9
16
  const provider = id === 'ai-sdk' ? 'openai' : id;
10
17
  return Object.hasOwn(PROVIDER_DEFINITIONS, provider)
@@ -49,6 +56,10 @@ function productCapability(id) {
49
56
  ? 'Signing, notarization, installers, updates, and distribution require a separate delivery workflow.'
50
57
  : 'Extension signing, store submission, review, and distribution require a separate delivery workflow.');
51
58
  }
59
+ if (id === 'realtimekit' || id === 'video') {
60
+ provisioning = stage('scaffold-only', 'Manual account activation and service configuration; no provider activation or credential installation during generation.', 'unverified');
61
+ limits.push('Server-only helper; product authorization routes, client UI and live provider acceptance remain required.');
62
+ }
52
63
  if (id === 'stream') {
53
64
  provisioning = stage('scaffold-only', 'Manual Stream activation and live input setup; no automatic Stream provisioning or runtime credential installation.', 'unverified');
54
65
  limits.push('Server management factory only; creator/player UI, WHIP/WHEP signaling and playback token issuance require application implementation.', 'Keep management tokens server-only and disclose secret WHIP URLs only to authorized creators; verify private media access independently of hosting protection.', 'One-to-many broadcasts; conferencing, recording, HLS/DASH bridging, restreaming and live viewer counts are outside this integration.', 'Usage-based viewer-minute billing, account eligibility and live broadcast/playback acceptance require separate verification.');
@@ -118,6 +118,12 @@ export const COMMANDS = {
118
118
  description: `Include ${name}.`,
119
119
  hidden: true,
120
120
  })),
121
+ {
122
+ flag: '--preset',
123
+ description: 'Start minimal or select the complete compatible product stack.',
124
+ value: 'minimal|full-product',
125
+ arity: 'required',
126
+ },
121
127
  {
122
128
  flag: '--hosting',
123
129
  description: 'Select web hosting.',
@@ -134,10 +140,10 @@ export const COMMANDS = {
134
140
  ],
135
141
  examples: [
136
142
  'init client-app',
137
- 'init mobile-app --expo',
143
+ 'init product --preset full-product --dry-run',
138
144
  'init product --next --hono --neon --clerk --dry-run',
139
145
  ],
140
- note: `Default: Vinext on Cloudflare Workers, using the official shadcn pnpm/Turborepo monorepo.\nProducts: ${STANDARD_PRODUCTS.join(', ')}\nOnly bundled options are supported. --all is intentionally unsupported.`,
146
+ note: `Default: minimal Expo web/iOS/Android app on Cloudflare; no API, auth, database or paid integrations. Add capabilities with resolved dependencies, or use --preset full-product.\nProducts: ${STANDARD_PRODUCTS.join(', ')}\nOnly bundled options are supported. --all is intentionally unsupported.`,
141
147
  },
142
148
  auth: {
143
149
  description: 'Check or guide authentication for the selected providers.',
package/dist/command.js CHANGED
@@ -5,21 +5,19 @@ export function resolveCommand(command, args, platform = process.platform, searc
5
5
  if (platform !== 'win32' || !['pnpm', 'pnpm.cmd'].includes(command))
6
6
  return { command, args: [...args] };
7
7
  const directories = searchPath.split(';').filter(Boolean);
8
- const executable = directories
9
- .map((directory) => path.join(directory, 'pnpm.exe'))
10
- .find(existsSync);
11
- if (executable)
12
- return { command: executable, args: [...args] };
13
8
  const entries = [
14
9
  'node_modules/pnpm/bin/pnpm.cjs',
15
10
  'node_modules/corepack/dist/pnpm.js',
16
11
  'pnpm.cjs',
17
12
  '../pnpm/bin/pnpm.cjs',
18
13
  ];
19
- const entry = directories
20
- .flatMap((directory) => entries.map((file) => path.join(directory, file)))
21
- .find(existsSync);
22
- if (!entry)
23
- throw new Error('Cannot locate a direct pnpm entry point. Install pnpm or enable Corepack.');
24
- return { command: process.execPath, args: [entry, ...args] };
14
+ for (const directory of directories) {
15
+ const executable = path.join(directory, 'pnpm.exe');
16
+ if (existsSync(executable))
17
+ return { command: executable, args: [...args] };
18
+ const entry = entries.map((file) => path.join(directory, file)).find(existsSync);
19
+ if (entry)
20
+ return { command: process.execPath, args: [entry, ...args] };
21
+ }
22
+ throw new Error('Cannot locate a direct pnpm entry point. Install pnpm or enable Corepack.');
25
23
  }
package/dist/delivery.js CHANGED
@@ -287,7 +287,9 @@ export async function verifyApplication(root, run = defaultRunner) {
287
287
  throw new Error('Live verification requires a fully active recorded release.');
288
288
  const project = snapshot.project;
289
289
  const env = environment(project);
290
- const primary = release.targets.find((target) => target.target === 'web') ?? release.targets.at(-1);
290
+ const primary = release.targets.find((target) => target.target === 'web') ??
291
+ release.targets.find((target) => target.target === 'mobile') ??
292
+ release.targets.at(-1);
291
293
  if (!primary?.urls.length)
292
294
  throw new Error('No recorded application URL for live verification.');
293
295
  const pkg = JSON.parse(readFileSync(path.join(root, 'package.json'), 'utf8'));
@@ -15,12 +15,16 @@ export declare const SHADCN_VERSION = "4.21.4";
15
15
  export declare const NEXT_VERCEL_VERSION = "16.4.0";
16
16
  export declare const NEXT_OPENNEXT_VERSION = "16.3.8";
17
17
  export declare const STACK_DEPENDENCIES: {
18
+ readonly zod: "4.6.6";
18
19
  readonly '@typescript-eslint/parser': "8.71.2";
19
20
  readonly '@typescript-eslint/eslint-plugin': "8.71.2";
20
21
  readonly '@next/eslint-plugin-next': "16.4.2";
21
22
  readonly turbo: "2.11.7";
22
23
  readonly tsx: "4.23.15";
23
24
  readonly 'better-auth': "1.7.7";
25
+ readonly '@better-auth/expo': "1.7.7";
26
+ readonly 'expo-secure-store': "57.0.4";
27
+ readonly 'expo-network': "57.0.2";
24
28
  readonly '@better-auth/drizzle-adapter': "1.7.7";
25
29
  readonly '@neondatabase/serverless': "1.2.0";
26
30
  readonly '@neon/realtime': "0.1.0";
@@ -42,7 +46,8 @@ export declare const STACK_DEPENDENCIES: {
42
46
  readonly ai: "6.0.303";
43
47
  readonly '@ai-sdk/openai': "3.0.125";
44
48
  readonly resend: "6.32.1";
45
- readonly stripe: "20.4.1";
49
+ readonly 'react-native-purchases': "10.14.0";
50
+ readonly stripe: "23.0.0";
46
51
  readonly 'posthog-node': "5.55.2";
47
52
  };
48
53
  /** Vinext's RSC/React versions form a separately verified compatibility group. */
@@ -77,6 +77,8 @@ export const MOBILE_APP_DEPENDENCIES = {
77
77
  clsx: '2.1.1',
78
78
  // renovate: datasource=npm depName=expo
79
79
  expo: '57.0.8',
80
+ // renovate: datasource=npm depName=expo-dev-client
81
+ 'expo-dev-client': '57.0.20',
80
82
  // renovate: datasource=npm depName=expo-linking
81
83
  'expo-linking': '57.0.4',
82
84
  // renovate: datasource=npm depName=expo-router
@@ -144,6 +146,8 @@ export const NEXT_VERCEL_VERSION = '16.4.0';
144
146
  // renovate: datasource=npm depName=next
145
147
  export const NEXT_OPENNEXT_VERSION = '16.3.8';
146
148
  export const STACK_DEPENDENCIES = {
149
+ // renovate: datasource=npm depName=zod
150
+ zod: '4.6.6',
147
151
  // renovate: datasource=npm depName=@typescript-eslint/parser
148
152
  '@typescript-eslint/parser': '8.71.2',
149
153
  // renovate: datasource=npm depName=@typescript-eslint/eslint-plugin
@@ -156,6 +160,12 @@ export const STACK_DEPENDENCIES = {
156
160
  tsx: '4.23.15',
157
161
  // renovate: datasource=npm depName=better-auth
158
162
  'better-auth': '1.7.7',
163
+ // renovate: datasource=npm depName=@better-auth/expo
164
+ '@better-auth/expo': '1.7.7',
165
+ // renovate: datasource=npm depName=expo-secure-store
166
+ 'expo-secure-store': '57.0.4',
167
+ // renovate: datasource=npm depName=expo-network
168
+ 'expo-network': '57.0.2',
159
169
  // renovate: datasource=npm depName=@better-auth/drizzle-adapter
160
170
  '@better-auth/drizzle-adapter': '1.7.7',
161
171
  // renovate: datasource=npm depName=@neondatabase/serverless
@@ -198,8 +208,10 @@ export const STACK_DEPENDENCIES = {
198
208
  '@ai-sdk/openai': '3.0.125',
199
209
  // renovate: datasource=npm depName=resend
200
210
  resend: '6.32.1',
211
+ // renovate: datasource=npm depName=react-native-purchases
212
+ 'react-native-purchases': '10.14.0',
201
213
  // renovate: datasource=npm depName=stripe
202
- stripe: '20.4.1',
214
+ stripe: '23.0.0',
203
215
  // renovate: datasource=npm depName=posthog-node
204
216
  'posthog-node': '5.55.2',
205
217
  };
package/dist/index.d.ts CHANGED
@@ -44,3 +44,4 @@ export { inspectApplication } from './project-inspector.js';
44
44
  export type { ProjectInspection } from './inspector-model.js';
45
45
  export { PROJECT_CONFIG_FILE, readProjectConfig, readProjectSection, writeProjectSection, hasProjectSection, } from './project-config.js';
46
46
  export type { ProjectConfig, ProjectSection } from './project-config.js';
47
+ export { FULL_PRODUCT } from './registry/presets.js';
package/dist/index.js CHANGED
@@ -28,3 +28,4 @@ export { CAPABILITY_CONTRACT, formatCapabilityContract } from './capability-cont
28
28
  export { recoverDeliveryLock } from './project-state.js';
29
29
  export { inspectApplication } from './project-inspector.js';
30
30
  export { PROJECT_CONFIG_FILE, readProjectConfig, readProjectSection, writeProjectSection, hasProjectSection, } from './project-config.js';
31
+ export { FULL_PRODUCT } from './registry/presets.js';
@@ -1,2 +1,2 @@
1
1
  import type { RecipeContext } from '../registry/types.js';
2
- export declare function scaffoldExpo({ root, options }: RecipeContext): Promise<void>;
2
+ export declare function scaffoldExpo(context: RecipeContext): Promise<void>;
@@ -4,6 +4,7 @@ import { writeReactLintConfig } from './lint.js';
4
4
  import { appendGitignore, writeFile } from '../util.js';
5
5
  import { childPackageName, jsString } from '../render.js';
6
6
  import { MOBILE_APP_DEPENDENCIES, MOBILE_NATIVEWIND_DEPENDENCIES, EAS_CLI_VERSION, } from '../dependencies.js';
7
+ import { scaffoldExpoRuntime } from '../scaffold/expo-runtime.js';
7
8
  function writeReactNativeReusablesConfig(dir) {
8
9
  writeFile(path.join(dir, 'components.json'), JSON.stringify({
9
10
  $schema: 'https://ui.shadcn.com/schema.json',
@@ -88,7 +89,8 @@ function expoScheme(projectName) {
88
89
  const candidate = normalized || 'app';
89
90
  return /^[a-z]/.test(candidate) ? candidate : `app-${candidate}`;
90
91
  }
91
- export async function scaffoldExpo({ root, options }) {
92
+ export async function scaffoldExpo(context) {
93
+ const { root, options } = context;
92
94
  const dir = path.join(root, 'apps/mobile');
93
95
  const projectName = options.name;
94
96
  const displayName = options.name;
@@ -132,6 +134,7 @@ export async function scaffoldExpo({ root, options }) {
132
134
  slug: projectName.replace(/^@[^/]+\//, ''),
133
135
  version: '1.0.0',
134
136
  orientation: 'portrait',
137
+ userInterfaceStyle: 'automatic',
135
138
  scheme: expoScheme(projectName),
136
139
  web: { bundler: 'metro', output: 'static' },
137
140
  plugins: ['expo-router', 'expo-status-bar'],
@@ -152,9 +155,11 @@ export async function scaffoldExpo({ root, options }) {
152
155
  'expo-env.d.ts',
153
156
  'nativewind-env.d.ts',
154
157
  ],
158
+ exclude: ['node_modules', 'worker', '.output', 'worker-configuration.d.ts'],
155
159
  }, null, 2) + '\n');
156
160
  writeReactNativeReusablesConfig(dir);
157
161
  writeFile(path.join(dir, 'app/_layout.tsx'), `import '@/global.css';
162
+ import '@/lib/development-client';
158
163
 
159
164
  import { PortalHost } from '@rn-primitives/portal';
160
165
  import { Stack } from 'expo-router';
@@ -163,17 +168,43 @@ export default function RootLayout() {
163
168
  return <><Stack /><PortalHost /></>;
164
169
  }
165
170
  `);
166
- writeFile(path.join(dir, 'app/index.tsx'), `import { StatusBar } from 'expo-status-bar';
171
+ writeFile(path.join(dir, 'lib/development-client.ts'), 'export {};\n');
172
+ writeFile(path.join(dir, 'lib/development-client.native.ts'), "import 'expo-dev-client';\n");
173
+ writeFile(path.join(dir, 'app/index.tsx'), `${context.has('hono') ? "import { useEffect, useState } from 'react';\nimport { api } from '@/lib/api-client';\n" : ''}import { StatusBar } from 'expo-status-bar';
167
174
  import { Linking, ScrollView, StyleSheet, Text, View } from 'react-native';
168
175
  import { Button } from '@/components/ui/button';
169
176
 
170
177
  export default function HomeScreen() {
178
+ ${context.has('hono')
179
+ ? `const [connection, setConnection] = useState('Connecting to the API…');
180
+ const [pending, setPending] = useState(true);
181
+ useEffect(() => {
182
+ let active = true;
183
+ void api.health().then(
184
+ () => { if (active) setConnection('API connected'); },
185
+ () => { if (active) setConnection('Unable to reach the API. Check the server and device API origin.'); },
186
+ ).finally(() => { if (active) setPending(false); });
187
+ return () => { active = false; };
188
+ }, []);
189
+ async function checkConnection() {
190
+ setPending(true);
191
+ setConnection('Connecting to the API…');
192
+ try { await api.health(); setConnection('API connected'); }
193
+ catch { setConnection('Unable to reach the API. Check the server and device API origin.'); }
194
+ finally { setPending(false); }
195
+ }
196
+ `
197
+ : ''}
171
198
  return (
172
199
  <ScrollView style={styles.screen} contentInsetAdjustmentBehavior="automatic" contentContainerStyle={styles.container}>
173
200
  <StatusBar style="auto" />
174
201
  <View style={styles.content}>
175
202
  <Text accessibilityRole="header" style={styles.title}>{${nameLiteral}}</Text>
176
203
  <Text selectable style={styles.subtitle}>Expo application scaffold generated by Anhedral.</Text>
204
+ ${context.has('hono')
205
+ ? `<Text accessibilityLiveRegion="polite">{connection}</Text>
206
+ <Button disabled={pending} onPress={() => void checkConnection()}>{pending ? 'Connecting…' : 'Check API connection'}</Button>`
207
+ : ''}
177
208
  <Button onPress={() => void Linking.openURL('https://docs.expo.dev')}>Learn more</Button>
178
209
  </View>
179
210
  </ScrollView>
@@ -202,5 +233,15 @@ const styles = StyleSheet.create({
202
233
  production: { environment: 'production', autoIncrement: true },
203
234
  },
204
235
  }, null, 2) + '\n');
205
- appendGitignore(dir, ['.env', '.env.*', '!.env.example', '.expo', 'dist', 'node_modules']);
236
+ scaffoldExpoRuntime(context);
237
+ appendGitignore(dir, [
238
+ '.env',
239
+ '.env.*',
240
+ '!.env.example',
241
+ '.expo',
242
+ '.wrangler',
243
+ '.output',
244
+ 'dist',
245
+ 'node_modules',
246
+ ]);
206
247
  }
@@ -137,7 +137,10 @@ export function registerApplication(root, extendTargets = false) {
137
137
  throw new Error('Invalid Worker name.');
138
138
  return { id: entry.name, directory: `apps/${entry.name}`, workerName };
139
139
  })
140
- .sort((a, b) => (a.id === 'web' ? 1 : b.id === 'web' ? -1 : a.id.localeCompare(b.id)));
140
+ .sort((a, b) => {
141
+ const rank = (id) => (id === 'web' ? 2 : id === 'mobile' ? 1 : 0);
142
+ return rank(a.id) - rank(b.id) || a.id.localeCompare(b.id);
143
+ });
141
144
  const selectedEngine = targets.length &&
142
145
  targets.every((target) => existsSync(path.join(root, target.directory, 'void.config.ts')))
143
146
  ? 'void'
@@ -12,6 +12,12 @@ export const PROVIDER_AUTH = [
12
12
  {
13
13
  id: 'cloudflare',
14
14
  products: [
15
+ 'expo',
16
+ 'analytics-engine',
17
+ 'images',
18
+ 'realtimekit',
19
+ 'video',
20
+ 'stream',
15
21
  'vinext',
16
22
  'hono',
17
23
  'd1',
@@ -117,7 +117,10 @@ async function stripe(context) {
117
117
  if (!prefix.test(key))
118
118
  throw new Error('Stripe key does not match the selected test/live mode.');
119
119
  const resources = { account: resourceId(account.id) };
120
- const runtime = { STRIPE_SECRET_KEY: key };
120
+ const runtime = {
121
+ STRIPE_SECRET_KEY: key,
122
+ BILLING_ENVIRONMENT: config.mode === 'live' ? 'production' : 'sandbox',
123
+ };
121
124
  if (setting(config, 'webhookUrl')) {
122
125
  const webhook = await create(context, 'webhook', '/v1/webhook_endpoints', {
123
126
  url: config.webhookUrl,
@@ -217,7 +220,7 @@ async function revenuecat(context) {
217
220
  const project = object(await api(`/v2/projects/${id}`));
218
221
  same(project.id, id, 'RevenueCat project');
219
222
  const resources = { project: id };
220
- const runtime = {};
223
+ const runtime = { REVENUECAT_PROJECT_ID: id };
221
224
  if (setting(config, 'webAppId') || setting(config, 'stripeAccountId')) {
222
225
  let appId = setting(config, 'webAppId');
223
226
  if (!appId)
@@ -256,8 +259,11 @@ async function revenuecat(context) {
256
259
  resources[`${platform}App`] = appId;
257
260
  runtime[`EXPO_PUBLIC_REVENUECAT_${platform.toUpperCase()}_API_KEY`] = text(keys[0].key);
258
261
  }
262
+ const appIds = ['iosApp', 'androidApp', 'webApp'].flatMap((name) => resources[name] ? [resources[name]] : []);
263
+ if (appIds.length)
264
+ runtime.REVENUECAT_APP_IDS_JSON = JSON.stringify(appIds);
259
265
  return result(resources, runtime, [
260
- 'Configure store credentials or the Stripe connection, products and offerings and verify purchases before enabling billing. SDK keys alone do not activate subscriptions.',
266
+ 'Configure the dedicated server RevenueCat v1 API key and authenticated webhook integration separately from the v2 management credential. Configure store credentials or the Stripe connection, products and offerings and verify purchases before enabling billing. SDK keys alone do not activate subscriptions.',
261
267
  ]);
262
268
  }
263
269
  export const PROVIDER_ADAPTERS = {
@@ -25,10 +25,21 @@ export const RUNTIME_KEYS = [
25
25
  'RESEND_API_KEY',
26
26
  'STRIPE_SECRET_KEY',
27
27
  'STRIPE_WEBHOOK_SECRET',
28
+ 'BILLING_ORIGIN',
29
+ 'BILLING_ENVIRONMENT',
30
+ 'BILLING_PLANS_JSON',
31
+ 'BILLING_ENTITLEMENTS_JSON',
32
+ 'BILLING_PREMIUM_ENTITLEMENT',
33
+ 'REVENUECAT_SECRET_KEY',
34
+ 'REVENUECAT_WEBHOOK_AUTHORIZATION',
35
+ 'REVENUECAT_WEBHOOK_SIGNING_SECRET',
36
+ 'REVENUECAT_APP_IDS_JSON',
37
+ 'REVENUECAT_PROJECT_ID',
28
38
  'SENTRY_DSN',
29
39
  'POSTHOG_API_KEY',
30
40
  'POSTHOG_HOST',
31
41
  'OPENAI_API_KEY',
42
+ 'EXPO_PUBLIC_API_URL',
32
43
  'EXPO_PUBLIC_REVENUECAT_IOS_API_KEY',
33
44
  'EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY',
34
45
  ];