anhedral 0.11.2 → 0.12.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 (45) hide show
  1. package/README.md +107 -14
  2. package/dist/bin.js +48 -493
  3. package/dist/capabilities.d.ts +3 -3
  4. package/dist/capability-contract.js +4 -0
  5. package/dist/cli-arguments.d.ts +8 -0
  6. package/dist/cli-arguments.js +32 -0
  7. package/dist/cli-commands.d.ts +3 -0
  8. package/dist/cli-commands.js +114 -0
  9. package/dist/cli-delivery.d.ts +3 -0
  10. package/dist/cli-delivery.js +172 -0
  11. package/dist/cli-output.js +231 -205
  12. package/dist/delivery-evidence.d.ts +62 -0
  13. package/dist/delivery-evidence.js +186 -0
  14. package/dist/delivery.d.ts +3 -40
  15. package/dist/delivery.js +4 -181
  16. package/dist/dependencies.d.ts +1 -0
  17. package/dist/dependencies.js +2 -0
  18. package/dist/mobile-delivery.d.ts +21 -44
  19. package/dist/mobile-delivery.js +127 -80
  20. package/dist/provider-auth.js +3 -3
  21. package/dist/scaffold/documentation.js +1 -0
  22. package/dist/scaffold/stream.d.ts +2 -0
  23. package/dist/scaffold/stream.js +114 -0
  24. package/dist/service-readers.js +1 -1
  25. package/dist/services-command.js +8 -6
  26. package/dist/ship.d.ts +15 -15
  27. package/dist/stack-registry.d.ts +4 -2
  28. package/dist/stack-registry.js +16 -0
  29. package/dist/transaction-lock.d.ts +15 -0
  30. package/dist/transaction-lock.js +227 -0
  31. package/dist/transaction.js +2 -208
  32. package/dist/vercel-project.d.ts +101 -0
  33. package/dist/vercel-project.js +305 -0
  34. package/dist/vercel.d.ts +3 -36
  35. package/dist/vercel.js +3 -300
  36. package/dist/version.d.ts +1 -1
  37. package/dist/version.js +1 -1
  38. package/docs/software-factory.md +339 -3
  39. package/docs/stack-standard.md +138 -30
  40. package/docs/verification.md +444 -0
  41. package/package.json +2 -5
  42. package/docs/cli-design.md +0 -67
  43. package/docs/plugin-ui.md +0 -102
  44. package/docs/provider-configuration.md +0 -116
  45. package/docs/void-verification.md +0 -185
package/README.md CHANGED
@@ -26,21 +26,102 @@ pnpm dev
26
26
 
27
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
28
 
29
- ## Choose what to generate
29
+ ## Defaults
30
+
31
+ Plain `anhedral init my-app` creates a Vinext web application. It includes no database, application identity provider, billing, email or analytics service.
32
+
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 |
42
+
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.
44
+
45
+ ## Choose the applications
46
+
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 |
58
+
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.
60
+
61
+ ## Choose data and identity
62
+
63
+ | Selection | Generates | Selection rule |
64
+ | --------------- | --------------------------------------------------------------------- | ----------------------------------------------------- |
65
+ | `--d1` | Shared Drizzle/SQLite database package and migrations | Cloudflare runtime; alternative to Neon |
66
+ | `--neon` | Shared Drizzle/PostgreSQL package using Neon HTTP | Server required; separate direct migration connection |
67
+ | `--better-auth` | Auth factory, database schema and server auth routes | Adds D1 when no database is selected; can use Neon |
68
+ | `--clerk` | Managed web identity integration and/or backend authentication helper | Alternative to Better Auth; server required |
69
+ | `--local-data` | Device-local persistence interface | Implement platform adapters and synchronization |
70
+
71
+ Database code lives in `packages/db`, including schemas and explicit migration tooling. Browser and device clients call server endpoints. Hosting audience protection and application resource authorization are separate from selecting an identity provider.
72
+
73
+ ## Choose services and integrations
74
+
75
+ These are optional foundations. The generated scope column distinguishes bindings and Workers from SDK factories and integration guidance.
76
+
77
+ | Selection | Purpose | Generated scope |
78
+ | ----------------- | --------------------------------- | ---------------------------------------------------------------------------------------- |
79
+ | `--r2` | Private files | R2 Worker binding and authorization guidance |
80
+ | `--kv` | Cache/configuration | Eventually consistent Worker binding |
81
+ | `--realtime` | WebSocket rooms | Separate Durable Object Worker; implement room authorization |
82
+ | `--neon-realtime` | Live PostgreSQL query results | Server/client factories and Drizzle adapter; adds Neon; manual branch activation |
83
+ | `--stream` | One-to-many live video | Cloudflare Stream WHIP/WHEP; server management factory; manual activation and product UI |
84
+ | `--queues` | Background jobs | Producer, consumer and dead-letter configuration; implement processing/idempotency |
85
+ | `--cron` | Scheduled work | Separate Worker with an hourly starter schedule |
86
+ | `--workflows` | Durable multi-step work | Separate Worker with a starter validation step |
87
+ | `--workers-ai` | Cloudflare inference | Worker AI binding; implement model calls |
88
+ | `--openai` | Direct OpenAI integration | Server SDK factory in `packages/ai` |
89
+ | `--ai-sdk` | AI streaming/provider abstraction | AI SDK exports with an OpenAI provider; alternative to `--openai` |
90
+ | `--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 |
93
+ | `--sentry` | Error/crash monitoring | Integration boundary and redaction fields; initialize platform SDKs |
94
+ | `--posthog` | Product analytics | Server analytics factory |
95
+ | `--basin` | Cloudflare analytical events | Private stream binding and event helper |
96
+ | `--styling` | Shared design tokens | Light/dark tokens and Tailwind preset; automatically included with Expo/WXT |
97
+
98
+ Live video (`--stream`), room messaging (`--realtime`) and live SQL (`--neon-realtime`) can coexist. See [live video setup and limits](docs/stack-standard.md#live-video-with-cloudflare-stream). PostHog and Basin can coexist with separate packages. Workers AI can accompany either AI SDK choice. Provider setup supports selected resources for Neon, Clerk, Resend, Stripe, RevenueCat, Sentry, PostHog and OpenAI; credentials, permissions and remaining owner steps are described in the [provider reference](docs/software-factory.md#provider-configuration).
99
+
100
+ ### Composition rules
101
+
102
+ - Choose one web framework, one database and one identity provider. `--openai` and `--ai-sdk` are alternatives.
103
+ - 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.
107
+
108
+ Examples:
30
109
 
31
- An explicit selection chooses the requested applications; include the web option when you want web alongside another interface.
110
+ ```sh
111
+ # Web with database-backed identity; Better Auth adds D1.
112
+ anhedral init my-app --better-auth
113
+
114
+ # Web, shared API, mobile and PostgreSQL.
115
+ anhedral init my-app --vinext --hono --expo --neon
32
116
 
33
- | Project | Command |
34
- | ---------------------------------- | -------------------------------------------------- |
35
- | Default web app | `anhedral init my-app` |
36
- | Web with D1 and Better Auth | `anhedral init my-app --vinext --d1 --better-auth` |
37
- | Web and shared API with PostgreSQL | `anhedral init my-app --vinext --hono --neon` |
38
- | Native Next.js on Vercel | `anhedral init my-app --next` |
39
- | Expo mobile app | `anhedral init my-app --expo` |
40
- | Electron desktop app | `anhedral init my-app --electron` |
41
- | WXT browser extension | `anhedral init my-app --wxt` |
117
+ # Vercel web with a Cloudflare API and private files.
118
+ anhedral init my-app --next --r2
119
+
120
+ # Live broadcasts with independent room messaging and SQL subscriptions.
121
+ anhedral init my-app --stream --neon-realtime --realtime
122
+ ```
42
123
 
43
- Inspect available services and preview additions:
124
+ Inspect the full catalog and preview later additions:
44
125
 
45
126
  ```sh
46
127
  anhedral registry list
@@ -58,10 +139,20 @@ Implement the product, configure selected integrations and review database migra
58
139
  ```sh
59
140
  anhedral auth --status --json
60
141
  anhedral doctor --providers --json
142
+ # Select the intended account and audience, then commit source/configuration.
143
+ anhedral connect --audience private --allow-email owner@example.com
144
+ git add .
145
+ git commit -m "Implement application and delivery configuration"
61
146
  anhedral ship --dry-run --json
147
+ anhedral ship --json
148
+ anhedral verify --json
62
149
  ```
63
150
 
64
- These commands help inspect readiness; 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.
151
+ 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
+
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.
154
+
155
+ 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).
65
156
 
66
157
  ## Use with Codex
67
158
 
@@ -83,7 +174,9 @@ The plugin guides implementation using the same stack and workflow. Its optional
83
174
  | [Stack standard](docs/stack-standard.md) | What should the application contain, and how should it fit together? |
84
175
  | [Software factory](docs/software-factory.md) | How do I turn a brief into a tested, delivered and maintainable product? |
85
176
 
86
- Use `anhedral --help` and `anhedral help <command>` for command options. `--cwd` selects the project; `--json` produces structured output. Detailed references cover [provider configuration](docs/provider-configuration.md), [CLI behavior](docs/cli-design.md) and the [Codex inspector](docs/plugin-ui.md).
177
+ The [verification record](docs/verification.md) keeps dated code reviews, provider evidence and remaining acceptance gaps together. Provider setup, CLI behavior, dashboard development and the release process are sections of the software factory.
178
+
179
+ Use `anhedral --help` and `anhedral help <command>` for command options. `--cwd` selects the project; `--json` produces structured output. Use its [provider configuration](docs/software-factory.md#provider-configuration), [CLI behavior](docs/software-factory.md#cli-behavior), [Codex dashboard](docs/software-factory.md#project-dashboard) and [release process](docs/software-factory.md#maintain-and-release-the-cli) sections for details.
87
180
 
88
181
  ## Work on the CLI
89
182