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.
- package/README.md +23 -229
- package/assets/patches/audit-deps.mjs +12 -2
- package/assets/stack/ai-schema.ts.txt +5 -0
- package/assets/stack/ai.ts.txt +30 -0
- package/assets/stack/api-index.ts.txt +15 -0
- package/assets/stack/auth-features.ts.txt +4 -0
- package/assets/stack/auth-journal.json.txt +13 -0
- package/assets/stack/auth-migration.sql.txt +53 -0
- package/assets/stack/auth-routes.ts.txt +11 -0
- package/assets/stack/auth-schema.ts.txt +64 -0
- package/assets/stack/auth-snapshot.json.txt +346 -0
- package/assets/stack/auth.ts.txt +32 -0
- package/assets/stack/billing-mode.ts.txt +8 -0
- package/assets/stack/billing-schema.ts.txt +11 -0
- package/assets/stack/desktop.rs.txt +21 -0
- package/assets/stack/entitlement-guard.ts.txt +32 -0
- package/assets/stack/entitlements.ts.txt +8 -0
- package/assets/stack/events-schema.ts.txt +12 -0
- package/assets/stack/events.ts.txt +59 -0
- package/assets/stack/mobile-auth.ts.txt +25 -0
- package/assets/stack/mobile-billing.tsx.txt +63 -0
- package/assets/stack/mobile-session.tsx.txt +83 -0
- package/assets/stack/native-button.tsx.txt +108 -0
- package/assets/stack/native-global.css.txt +4 -0
- package/assets/stack/native-lib-utils.ts.txt +5 -0
- package/assets/stack/native-metro.config.js.txt +6 -0
- package/assets/stack/native-nativewind-env.d.ts.txt +1 -0
- package/assets/stack/native-tailwind.config.js.txt +73 -0
- package/assets/stack/native-text.tsx.txt +89 -0
- package/assets/stack/purchases.ts.txt +65 -0
- package/assets/stack/revenuecat.ts.txt +88 -0
- package/assets/stack/rtc-schema.ts.txt +10 -0
- package/assets/stack/rtc.ts.txt +122 -0
- package/assets/stack/security.ts.txt +31 -0
- package/assets/stack/storage.ts.txt +36 -0
- package/assets/stack/stripe.ts.txt +126 -0
- package/assets/stack/web-sign-in.tsx.txt +51 -0
- package/assets/ui/LICENSE.react-native-reusables +21 -0
- package/assets/ui/LICENSE.shadcn +21 -0
- package/assets/ui/UPSTREAM.json +39 -0
- package/assets/ui/catalog.json +891 -0
- package/assets/ui/extensions/registry.json +6 -0
- package/assets/ui/native/_controls.tsx +521 -0
- package/assets/ui/native/_core.tsx +118 -0
- package/assets/ui/native/_data.tsx +200 -0
- package/assets/ui/native/_display.tsx +453 -0
- package/assets/ui/native/_feedback.tsx +242 -0
- package/assets/ui/native/_legacy-dialog.tsx +38 -0
- package/assets/ui/native/_motion.tsx +520 -0
- package/assets/ui/native/_overlay.tsx +402 -0
- package/assets/ui/native/_selection.tsx +366 -0
- package/assets/ui/native/accordion.tsx +1 -0
- package/assets/ui/native/alert-dialog.tsx +11 -0
- package/assets/ui/native/alert.tsx +1 -0
- package/assets/ui/native/aspect-ratio.tsx +1 -0
- package/assets/ui/native/attachment.tsx +8 -0
- package/assets/ui/native/avatar.tsx +8 -0
- package/assets/ui/native/badge.tsx +1 -0
- package/assets/ui/native/breadcrumb.tsx +9 -0
- package/assets/ui/native/bubble.tsx +1 -0
- package/assets/ui/native/button-group.tsx +1 -0
- package/assets/ui/native/button.tsx +86 -0
- package/assets/ui/native/calendar.tsx +170 -0
- package/assets/ui/native/card.tsx +44 -0
- package/assets/ui/native/carousel.tsx +1 -0
- package/assets/ui/native/chart.tsx +193 -0
- package/assets/ui/native/checkbox.tsx +1 -0
- package/assets/ui/native/code-block.tsx +137 -0
- package/assets/ui/native/collapsible.tsx +1 -0
- package/assets/ui/native/combobox.tsx +1 -0
- package/assets/ui/native/command.tsx +11 -0
- package/assets/ui/native/context-menu.tsx +16 -0
- package/assets/ui/native/data-table.tsx +1 -0
- package/assets/ui/native/date-picker.tsx +43 -0
- package/assets/ui/native/dialog.tsx +15 -0
- package/assets/ui/native/direction.tsx +1 -0
- package/assets/ui/native/drawer.tsx +10 -0
- package/assets/ui/native/dropdown-menu.tsx +16 -0
- package/assets/ui/native/empty.tsx +8 -0
- package/assets/ui/native/field.tsx +13 -0
- package/assets/ui/native/hover-card.tsx +1 -0
- package/assets/ui/native/input-group.tsx +8 -0
- package/assets/ui/native/input-otp.tsx +1 -0
- package/assets/ui/native/input.tsx +28 -0
- package/assets/ui/native/item.tsx +12 -0
- package/assets/ui/native/kbd.tsx +1 -0
- package/assets/ui/native/label.tsx +4 -0
- package/assets/ui/native/layout.tsx +26 -0
- package/assets/ui/native/marker.tsx +1 -0
- package/assets/ui/native/menubar.tsx +17 -0
- package/assets/ui/native/message-scroller.tsx +6 -0
- package/assets/ui/native/message.tsx +10 -0
- package/assets/ui/native/native-select.tsx +1 -0
- package/assets/ui/native/navigation-menu.tsx +10 -0
- package/assets/ui/native/pagination.tsx +9 -0
- package/assets/ui/native/popover.tsx +1 -0
- package/assets/ui/native/progress.tsx +1 -0
- package/assets/ui/native/questionnaire.tsx +130 -0
- package/assets/ui/native/radio-group.tsx +1 -0
- package/assets/ui/native/registry.json +1103 -0
- package/assets/ui/native/resizable.tsx +1 -0
- package/assets/ui/native/scroll-area.tsx +1 -0
- package/assets/ui/native/select.tsx +11 -0
- package/assets/ui/native/separator.tsx +1 -0
- package/assets/ui/native/sheet.tsx +10 -0
- package/assets/ui/native/sidebar.tsx +22 -0
- package/assets/ui/native/skeleton.tsx +1 -0
- package/assets/ui/native/slider.tsx +1 -0
- package/assets/ui/native/spinner.tsx +1 -0
- package/assets/ui/native/switch.tsx +1 -0
- package/assets/ui/native/table.tsx +10 -0
- package/assets/ui/native/tabs.tsx +1 -0
- package/assets/ui/native/text.tsx +20 -0
- package/assets/ui/native/textarea.tsx +1 -0
- package/assets/ui/native/theme-switcher.tsx +22 -0
- package/assets/ui/native/toast.tsx +11 -0
- package/assets/ui/native/toggle-group.tsx +1 -0
- package/assets/ui/native/toggle.tsx +1 -0
- package/assets/ui/native/tooltip.tsx +1 -0
- package/assets/ui/native/trace.tsx +20 -0
- package/assets/ui/native/typography.tsx +15 -0
- package/assets/ui/theme-storage.ts +25 -0
- package/assets/ui/theme.tsx +66 -0
- package/assets/ui/web/button.tsx +59 -0
- package/assets/ui/web/input.tsx +21 -0
- package/assets/ui/web/label.tsx +19 -0
- package/dist/bin.js +7 -12
- package/dist/capabilities.d.ts +4 -33
- package/dist/capabilities.js +2 -84
- package/dist/capability-catalog.d.ts +83 -0
- package/dist/capability-catalog.js +121 -0
- package/dist/capability-command.d.ts +3 -0
- package/dist/capability-command.js +188 -0
- package/dist/capability-editor.d.ts +17 -0
- package/dist/capability-editor.js +97 -0
- package/dist/capability-recipes.d.ts +4 -0
- package/dist/capability-recipes.js +520 -0
- package/dist/capability-references.d.ts +4 -0
- package/dist/capability-references.js +7 -0
- package/dist/cli-commands.d.ts +1 -2
- package/dist/cli-commands.js +10 -104
- package/dist/cli-output.d.ts +1 -2
- package/dist/cli-output.js +6 -251
- package/dist/command-schema.js +40 -374
- package/dist/dependencies.d.ts +34 -62
- package/dist/dependencies.js +112 -199
- package/dist/index.d.ts +1 -45
- package/dist/index.js +1 -30
- package/dist/platforms/mobile.js +29 -139
- package/dist/platforms/web.d.ts +3 -0
- package/dist/platforms/web.js +251 -0
- package/dist/project-config.d.ts +2 -13
- package/dist/project-config.js +10 -83
- package/dist/registry/context.js +0 -1
- package/dist/registry/options.js +6 -40
- package/dist/registry/resolve.d.ts +3 -4
- package/dist/registry/resolve.js +18 -108
- package/dist/registry/types.d.ts +1 -7
- package/dist/registry/usage.js +3 -9
- package/dist/runtime-policy.d.ts +0 -2
- package/dist/runtime-policy.js +0 -16
- package/dist/scaffold/backend.d.ts +0 -4
- package/dist/scaffold/backend.js +1 -189
- package/dist/scaffold/bootstrap.d.ts +2 -3
- package/dist/scaffold/bootstrap.js +37 -43
- package/dist/scaffold/compose.js +2 -14
- package/dist/scaffold/database.d.ts +1 -1
- package/dist/scaffold/database.js +19 -126
- package/dist/scaffold/documentation.d.ts +0 -1
- package/dist/scaffold/documentation.js +82 -84
- package/dist/scaffold/expo-runtime.d.ts +2 -2
- package/dist/scaffold/expo-runtime.js +9 -101
- package/dist/scaffold/native-ui.d.ts +2 -0
- package/dist/scaffold/native-ui.js +74 -0
- package/dist/scaffold/stack-documentation.d.ts +0 -1
- package/dist/scaffold/stack-documentation.js +3 -49
- package/dist/scaffold/storage.d.ts +2 -0
- package/dist/scaffold/storage.js +21 -0
- package/dist/scaffold/styling.d.ts +1 -1
- package/dist/scaffold/styling.js +20 -28
- package/dist/scaffold/workspace.js +63 -199
- package/dist/stack-registry.d.ts +2 -58
- package/dist/stack-registry.js +22 -446
- package/dist/standard.js +7 -24
- package/dist/ui-catalog.d.ts +26 -0
- package/dist/ui-catalog.js +31 -0
- package/dist/ui-command.d.ts +3 -0
- package/dist/ui-command.js +219 -0
- package/dist/ui-project.d.ts +22 -0
- package/dist/ui-project.js +110 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/anhedral-stack.md +4 -119
- package/docs/capabilities.md +110 -0
- package/docs/native-ui.md +102 -0
- package/docs/software-factory.md +16 -577
- package/docs/stack-standard.md +11 -307
- package/docs/ui.md +33 -0
- package/docs/verification.md +511 -0
- package/package.json +26 -27
- package/dist/access.d.ts +0 -10
- package/dist/access.js +0 -93
- package/dist/auth-schema-snapshot.d.ts +0 -346
- package/dist/auth-schema-snapshot.js +0 -347
- package/dist/auth-schema.d.ts +0 -1
- package/dist/auth-schema.js +0 -57
- package/dist/capability-contract.d.ts +0 -47
- package/dist/capability-contract.js +0 -168
- package/dist/catalog-model.d.ts +0 -24
- package/dist/catalog-model.js +0 -1
- package/dist/catalog-registration.d.ts +0 -16
- package/dist/catalog-registration.js +0 -22
- package/dist/catalog-snapshot.d.ts +0 -5
- package/dist/catalog-snapshot.js +0 -97
- package/dist/cli-delivery.d.ts +0 -3
- package/dist/cli-delivery.js +0 -172
- package/dist/cloudflare.d.ts +0 -25
- package/dist/cloudflare.js +0 -226
- package/dist/delivery-evidence.d.ts +0 -62
- package/dist/delivery-evidence.js +0 -186
- package/dist/delivery.d.ts +0 -88
- package/dist/delivery.js +0 -570
- package/dist/inspector-model.d.ts +0 -123
- package/dist/inspector-model.js +0 -1
- package/dist/integration-service-readers.d.ts +0 -13
- package/dist/integration-service-readers.js +0 -173
- package/dist/lifecycle-model.d.ts +0 -15
- package/dist/lifecycle-model.js +0 -20
- package/dist/lifecycle.d.ts +0 -11
- package/dist/lifecycle.js +0 -91
- package/dist/management.d.ts +0 -3
- package/dist/management.js +0 -47
- package/dist/mobile-delivery.d.ts +0 -77
- package/dist/mobile-delivery.js +0 -366
- package/dist/neon-service-data.d.ts +0 -8
- package/dist/neon-service-data.js +0 -117
- package/dist/platforms/desktop.d.ts +0 -2
- package/dist/platforms/desktop.js +0 -415
- package/dist/platforms/extension.d.ts +0 -2
- package/dist/platforms/extension.js +0 -328
- package/dist/project-catalog.d.ts +0 -41
- package/dist/project-catalog.js +0 -288
- package/dist/project-inspector.d.ts +0 -4
- package/dist/project-inspector.js +0 -702
- package/dist/project-lifecycle.d.ts +0 -25
- package/dist/project-lifecycle.js +0 -57
- package/dist/project-state.d.ts +0 -49
- package/dist/project-state.js +0 -563
- package/dist/provider-auth.d.ts +0 -41
- package/dist/provider-auth.js +0 -215
- package/dist/provider-readiness.d.ts +0 -30
- package/dist/provider-readiness.js +0 -104
- package/dist/providers/adapters.d.ts +0 -17
- package/dist/providers/adapters.js +0 -278
- package/dist/providers/api.d.ts +0 -29
- package/dist/providers/api.js +0 -253
- package/dist/providers/config.d.ts +0 -15
- package/dist/providers/config.js +0 -182
- package/dist/providers/definitions.d.ts +0 -318
- package/dist/providers/definitions.js +0 -127
- package/dist/providers/provision.d.ts +0 -24
- package/dist/providers/provision.js +0 -76
- package/dist/providers/receipts.d.ts +0 -20
- package/dist/providers/receipts.js +0 -66
- package/dist/providers/recovery-verification.d.ts +0 -7
- package/dist/providers/recovery-verification.js +0 -112
- package/dist/providers/recovery.d.ts +0 -30
- package/dist/providers/recovery.js +0 -34
- package/dist/providers/runtime.d.ts +0 -10
- package/dist/providers/runtime.js +0 -265
- package/dist/providers/schema.d.ts +0 -28
- package/dist/providers/schema.js +0 -49
- package/dist/providers/state.d.ts +0 -55
- package/dist/providers/state.js +0 -289
- package/dist/provision.d.ts +0 -55
- package/dist/provision.js +0 -284
- package/dist/r2-service-data.d.ts +0 -2
- package/dist/r2-service-data.js +0 -136
- package/dist/readiness.d.ts +0 -23
- package/dist/readiness.js +0 -122
- package/dist/registry/add.d.ts +0 -24
- package/dist/registry/add.js +0 -270
- package/dist/registry/bootstrap.d.ts +0 -2
- package/dist/registry/bootstrap.js +0 -14
- package/dist/registry/commands.d.ts +0 -3
- package/dist/registry/commands.js +0 -85
- package/dist/registry/presets.d.ts +0 -4
- package/dist/registry/presets.js +0 -41
- package/dist/registry/preview.d.ts +0 -11
- package/dist/registry/preview.js +0 -91
- package/dist/registry/receipt.d.ts +0 -3
- package/dist/registry/receipt.js +0 -68
- package/dist/repository.d.ts +0 -24
- package/dist/repository.js +0 -96
- package/dist/scaffold/auth.d.ts +0 -3
- package/dist/scaffold/auth.js +0 -151
- package/dist/scaffold/billing-config.d.ts +0 -1
- package/dist/scaffold/billing-config.js +0 -73
- package/dist/scaffold/billing-contracts.d.ts +0 -2
- package/dist/scaffold/billing-contracts.js +0 -48
- package/dist/scaffold/billing-providers.d.ts +0 -1
- package/dist/scaffold/billing-providers.js +0 -249
- package/dist/scaffold/billing-schema.d.ts +0 -1
- package/dist/scaffold/billing-schema.js +0 -34
- package/dist/scaffold/billing-security.d.ts +0 -1
- package/dist/scaffold/billing-security.js +0 -46
- package/dist/scaffold/billing-server.d.ts +0 -1
- package/dist/scaffold/billing-server.js +0 -139
- package/dist/scaffold/billing-store.d.ts +0 -1
- package/dist/scaffold/billing-store.js +0 -72
- package/dist/scaffold/billing.d.ts +0 -2
- package/dist/scaffold/billing.js +0 -216
- package/dist/scaffold/cloudflare-services.d.ts +0 -8
- package/dist/scaffold/cloudflare-services.js +0 -198
- package/dist/scaffold/expo-auth.d.ts +0 -3
- package/dist/scaffold/expo-auth.js +0 -192
- package/dist/scaffold/expo-billing.d.ts +0 -3
- package/dist/scaffold/expo-billing.js +0 -292
- package/dist/scaffold/integrations.d.ts +0 -4
- package/dist/scaffold/integrations.js +0 -12
- package/dist/scaffold/lint.d.ts +0 -4
- package/dist/scaffold/lint.js +0 -56
- package/dist/scaffold/neon-realtime.d.ts +0 -2
- package/dist/scaffold/neon-realtime.js +0 -97
- package/dist/scaffold/services.d.ts +0 -5
- package/dist/scaffold/services.js +0 -108
- package/dist/scaffold/stream.d.ts +0 -2
- package/dist/scaffold/stream.js +0 -114
- package/dist/scaffold/void.d.ts +0 -4
- package/dist/scaffold/void.js +0 -264
- package/dist/scaffold/web.d.ts +0 -2
- package/dist/scaffold/web.js +0 -130
- package/dist/service-deletion.d.ts +0 -29
- package/dist/service-deletion.js +0 -195
- package/dist/service-descriptor.d.ts +0 -10
- package/dist/service-descriptor.js +0 -78
- package/dist/service-model.d.ts +0 -49
- package/dist/service-model.js +0 -8
- package/dist/service-operations.d.ts +0 -29
- package/dist/service-operations.js +0 -78
- package/dist/service-readers.d.ts +0 -8
- package/dist/service-readers.js +0 -247
- package/dist/services-command.d.ts +0 -39
- package/dist/services-command.js +0 -102
- package/dist/ship.d.ts +0 -348
- package/dist/ship.js +0 -239
- package/dist/vercel-project.d.ts +0 -101
- package/dist/vercel-project.js +0 -305
- package/dist/vercel.d.ts +0 -67
- package/dist/vercel.js +0 -581
- package/dist/vinext.d.ts +0 -2
- package/dist/vinext.js +0 -86
- package/dist/void-execution.d.ts +0 -10
- package/dist/void-execution.js +0 -94
- package/dist/void-migrations.d.ts +0 -6
- package/dist/void-migrations.js +0 -110
- package/dist/void-state.d.ts +0 -16
- package/dist/void-state.js +0 -65
- package/dist/void.d.ts +0 -3
- package/dist/void.js +0 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anhedral",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Start with
|
|
3
|
+
"version": "0.16.0",
|
|
4
|
+
"description": "Start with Next.js and Anhedral UI, then progressively add APIs, data, clients, payments, realtime and AI as editable source.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -26,7 +26,12 @@
|
|
|
26
26
|
"docs/stack-standard.md",
|
|
27
27
|
"docs/software-factory.md",
|
|
28
28
|
"docs/verification.md",
|
|
29
|
-
"docs/anhedral-stack.md"
|
|
29
|
+
"docs/anhedral-stack.md",
|
|
30
|
+
"assets/ui",
|
|
31
|
+
"docs/native-ui.md",
|
|
32
|
+
"docs/ui.md",
|
|
33
|
+
"assets/stack",
|
|
34
|
+
"docs/capabilities.md"
|
|
30
35
|
],
|
|
31
36
|
"homepage": "https://github.com/anhedral/anhedral-cli#readme",
|
|
32
37
|
"repository": {
|
|
@@ -59,6 +64,7 @@
|
|
|
59
64
|
"pretest": "pnpm build",
|
|
60
65
|
"prepublishOnly": "pnpm test:all",
|
|
61
66
|
"test:cli:validation": "node --test tests/test-cli-validation.test.mjs",
|
|
67
|
+
"test:contracts:types": "node tests/test-generated-contracts-types.mjs",
|
|
62
68
|
"test:pack": "pnpm build && node tests/test-packed-cli.js",
|
|
63
69
|
"test:pack:exact": "node tests/test-packed-cli.js .artifacts/release/metadata.json",
|
|
64
70
|
"test:packlist": "pnpm build && node tests/test-packlist.js",
|
|
@@ -69,50 +75,43 @@
|
|
|
69
75
|
"release:artifact:verify": "node scripts/verify-release-artifact.mjs .artifacts/release/metadata.json && node scripts/check-release-secrets.mjs .artifacts/release/metadata.json",
|
|
70
76
|
"release:artifact:smoke": "node tests/test-packed-cli.js .artifacts/release/metadata.json",
|
|
71
77
|
"test:standard": "pnpm build && node --test tests/test-standard.test.mjs",
|
|
72
|
-
"test:unit": "node
|
|
78
|
+
"test:unit": "node --test --test-concurrency=4 --test-reporter=spec tests/*.test.mjs",
|
|
73
79
|
"test:integration": "pnpm build && node tests/test-generated-apps.mjs",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"test:live:vercel:git": "pnpm build && node tests/test-live-vercel-git.mjs",
|
|
79
|
-
"format": "prettier --write src scripts tests plugins/codex/inspector \"assets/patches/*.mjs\"",
|
|
80
|
-
"format:check": "prettier --check src scripts tests plugins/codex/inspector \"assets/patches/*.mjs\"",
|
|
81
|
-
"plugin:build": "pnpm --dir plugins/codex/inspector build",
|
|
82
|
-
"plugin:check": "pnpm --dir plugins/codex/inspector check",
|
|
83
|
-
"plugin:preview": "pnpm --dir plugins/codex/inspector start",
|
|
80
|
+
"format": "prettier --write src scripts tests \"assets/patches/*.mjs\" assets/ui && node scripts/stack-template-format.mjs --write",
|
|
81
|
+
"format:check": "prettier --check src scripts tests \"assets/patches/*.mjs\" assets/ui && node scripts/stack-template-format.mjs",
|
|
82
|
+
"plugin:build": "node scripts/check-plugin.mjs",
|
|
83
|
+
"plugin:check": "node scripts/check-plugin.mjs",
|
|
84
84
|
"test:patch": "node tests/test-braces-install.mjs && node tests/test-forge-install.mjs",
|
|
85
|
-
"test:
|
|
86
|
-
"
|
|
85
|
+
"test:native-ui": "pnpm build && pnpm --dir tests/native-ui typecheck && pnpm --dir tests/native-ui test",
|
|
86
|
+
"native-ui:docs": "node scripts/native-ui-catalog.mjs --write",
|
|
87
|
+
"native-ui:upstream": "node scripts/native-ui-catalog.mjs --upstream",
|
|
88
|
+
"test:next-runtime": "pnpm build && node scripts/next-runtime-smoke.mjs"
|
|
87
89
|
},
|
|
88
90
|
"keywords": [
|
|
89
91
|
"cli",
|
|
90
92
|
"scaffold",
|
|
91
93
|
"typescript",
|
|
92
|
-
"
|
|
94
|
+
"expo",
|
|
93
95
|
"hono",
|
|
94
96
|
"cloudflare",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"electron",
|
|
98
|
-
"wxt",
|
|
99
|
-
"neon",
|
|
97
|
+
"d1",
|
|
98
|
+
"r2",
|
|
100
99
|
"drizzle",
|
|
101
|
-
"shadcn",
|
|
102
100
|
"turborepo",
|
|
103
|
-
"
|
|
101
|
+
"nextjs",
|
|
102
|
+
"opennext"
|
|
104
103
|
],
|
|
105
104
|
"license": "Apache-2.0",
|
|
106
105
|
"packageManager": "pnpm@10.34.5",
|
|
107
106
|
"devDependencies": {
|
|
108
107
|
"@types/node": "20.19.43",
|
|
108
|
+
"hono": "4.13.13",
|
|
109
109
|
"prettier": "3.9.10",
|
|
110
|
-
"typescript": "5.9.3"
|
|
110
|
+
"typescript": "5.9.3",
|
|
111
|
+
"zod": "4.6.6"
|
|
111
112
|
},
|
|
112
113
|
"dependencies": {
|
|
113
|
-
"@neondatabase/serverless": "1.2.0",
|
|
114
114
|
"jsonc-parser": "3.3.1",
|
|
115
|
-
"zod": "4.6.6",
|
|
116
115
|
"yaml": "2.9.1"
|
|
117
116
|
}
|
|
118
117
|
}
|
package/dist/access.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ApplicationProject } from './project-state.js';
|
|
2
|
-
import { type CloudflareRequest } from './cloudflare.js';
|
|
3
|
-
export interface AccessReceipt {
|
|
4
|
-
target: string;
|
|
5
|
-
workerId: string;
|
|
6
|
-
applicationId: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function validatePrivateAudience(project: ApplicationProject, root: string): void;
|
|
9
|
-
/** Protect the entire Worker, including every route and preview, before product code is deployed. */
|
|
10
|
-
export declare function reconcileAccess(root: string, project: ApplicationProject, request: CloudflareRequest, create: boolean): Promise<AccessReceipt[]>;
|
package/dist/access.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { atomicJson, readConfig, targetDirectory, } from './project-state.js';
|
|
3
|
-
import { listCloudflare } from './cloudflare.js';
|
|
4
|
-
export function validatePrivateAudience(project, root) {
|
|
5
|
-
if (!project.access?.emails.length ||
|
|
6
|
-
project.access.emails.some((email) => !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)))
|
|
7
|
-
throw new Error('Private delivery requires explicit allowed email addresses.');
|
|
8
|
-
for (const target of project.targets) {
|
|
9
|
-
const config = readConfig(targetDirectory(root, target));
|
|
10
|
-
if (target.id === 'realtime' ||
|
|
11
|
-
config.durable_objects?.bindings?.some((item) => item.class_name === 'Rooms'))
|
|
12
|
-
throw new Error('Worker-level Access does not support WebSockets. Use a reviewed hostname Access workflow or application identity for realtime products.');
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function policiesMatch(policies, emails) {
|
|
16
|
-
if (policies.length !== 1 || policies[0].decision !== 'allow')
|
|
17
|
-
return false;
|
|
18
|
-
const policy = policies[0];
|
|
19
|
-
if (!Array.isArray(policy.include) ||
|
|
20
|
-
!policy.include.length ||
|
|
21
|
-
policy.exclude?.length ||
|
|
22
|
-
policy.require?.length)
|
|
23
|
-
return false;
|
|
24
|
-
const actual = [];
|
|
25
|
-
for (const rule of policy.include) {
|
|
26
|
-
if (!rule || Object.keys(rule).length !== 1 || typeof rule.email?.email !== 'string')
|
|
27
|
-
return false;
|
|
28
|
-
actual.push(rule.email.email.toLowerCase());
|
|
29
|
-
}
|
|
30
|
-
return (JSON.stringify([...new Set(actual)].sort()) === JSON.stringify([...new Set(emails)].sort()));
|
|
31
|
-
}
|
|
32
|
-
/** Protect the entire Worker, including every route and preview, before product code is deployed. */
|
|
33
|
-
export async function reconcileAccess(root, project, request, create) {
|
|
34
|
-
validatePrivateAudience(project, root);
|
|
35
|
-
const receipts = [];
|
|
36
|
-
const workers = await listCloudflare(request, '/workers/workers');
|
|
37
|
-
const apps = await listCloudflare(request, '/access/apps');
|
|
38
|
-
for (const target of project.targets) {
|
|
39
|
-
const matches = workers.filter((item) => item.name === target.workerName);
|
|
40
|
-
if (matches.length > 1)
|
|
41
|
-
throw new Error('Ambiguous Worker identity.');
|
|
42
|
-
let worker = matches[0];
|
|
43
|
-
if (!worker && create)
|
|
44
|
-
worker = (await request('POST', '/workers/workers', { name: target.workerName }))
|
|
45
|
-
.result;
|
|
46
|
-
if (!worker || typeof worker.id !== 'string' || !/^[a-f0-9]{32}$/i.test(worker.id))
|
|
47
|
-
throw new Error('Provider did not return an immutable Worker ID.');
|
|
48
|
-
const destinations = [{ type: 'worker', worker_id: worker.id }];
|
|
49
|
-
const candidates = apps.filter((app) => Array.isArray(app.destinations) &&
|
|
50
|
-
app.destinations.some((destination) => destination.worker_id === worker.id));
|
|
51
|
-
if (candidates.length > 1)
|
|
52
|
-
throw new Error('Multiple Access applications target this Worker; reconcile policies explicitly.');
|
|
53
|
-
let app = candidates[0];
|
|
54
|
-
if (!app && create) {
|
|
55
|
-
app = (await request('POST', '/access/apps', {
|
|
56
|
-
name: `Anhedral ${project.id} ${target.id}`,
|
|
57
|
-
type: 'self_hosted',
|
|
58
|
-
session_duration: '24h',
|
|
59
|
-
destinations,
|
|
60
|
-
policies: [
|
|
61
|
-
{
|
|
62
|
-
name: 'Application members',
|
|
63
|
-
decision: 'allow',
|
|
64
|
-
include: project.access.emails.map((email) => ({ email: { email } })),
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
})).result;
|
|
68
|
-
apps.push(app);
|
|
69
|
-
}
|
|
70
|
-
if (!app ||
|
|
71
|
-
typeof app.id !== 'string' ||
|
|
72
|
-
!/^[a-f0-9-]{36}$/i.test(app.id) ||
|
|
73
|
-
app.type !== 'self_hosted' ||
|
|
74
|
-
!Array.isArray(app.destinations) ||
|
|
75
|
-
app.destinations.length !== 1 ||
|
|
76
|
-
app.destinations[0].type !== 'worker' ||
|
|
77
|
-
app.destinations[0].worker_id !== worker.id)
|
|
78
|
-
throw new Error('Whole-Worker private Access protection is missing or differs from the requested policy.');
|
|
79
|
-
const policies = await listCloudflare(request, `/access/apps/${app.id}/policies`);
|
|
80
|
-
if (!policiesMatch(policies, project.access.emails))
|
|
81
|
-
throw new Error('Access policies differ from the explicit application members; no unrelated policy was overwritten.');
|
|
82
|
-
receipts.push({ target: target.id, workerId: worker.id, applicationId: app.id });
|
|
83
|
-
if (create)
|
|
84
|
-
atomicJson(path.join(root, '.anhedral/access.json'), {
|
|
85
|
-
schemaVersion: 1,
|
|
86
|
-
projectId: project.id,
|
|
87
|
-
accountId: project.accountId,
|
|
88
|
-
checkedAt: new Date().toISOString(),
|
|
89
|
-
receipts,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
return receipts;
|
|
93
|
-
}
|
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
export declare const betterAuthSqliteSnapshot: {
|
|
2
|
-
version: string;
|
|
3
|
-
dialect: string;
|
|
4
|
-
id: string;
|
|
5
|
-
prevId: string;
|
|
6
|
-
tables: {
|
|
7
|
-
account: {
|
|
8
|
-
name: string;
|
|
9
|
-
columns: {
|
|
10
|
-
id: {
|
|
11
|
-
name: string;
|
|
12
|
-
type: string;
|
|
13
|
-
primaryKey: boolean;
|
|
14
|
-
notNull: boolean;
|
|
15
|
-
autoincrement: boolean;
|
|
16
|
-
};
|
|
17
|
-
account_id: {
|
|
18
|
-
name: string;
|
|
19
|
-
type: string;
|
|
20
|
-
primaryKey: boolean;
|
|
21
|
-
notNull: boolean;
|
|
22
|
-
autoincrement: boolean;
|
|
23
|
-
};
|
|
24
|
-
provider_id: {
|
|
25
|
-
name: string;
|
|
26
|
-
type: string;
|
|
27
|
-
primaryKey: boolean;
|
|
28
|
-
notNull: boolean;
|
|
29
|
-
autoincrement: boolean;
|
|
30
|
-
};
|
|
31
|
-
user_id: {
|
|
32
|
-
name: string;
|
|
33
|
-
type: string;
|
|
34
|
-
primaryKey: boolean;
|
|
35
|
-
notNull: boolean;
|
|
36
|
-
autoincrement: boolean;
|
|
37
|
-
};
|
|
38
|
-
access_token: {
|
|
39
|
-
name: string;
|
|
40
|
-
type: string;
|
|
41
|
-
primaryKey: boolean;
|
|
42
|
-
notNull: boolean;
|
|
43
|
-
autoincrement: boolean;
|
|
44
|
-
};
|
|
45
|
-
refresh_token: {
|
|
46
|
-
name: string;
|
|
47
|
-
type: string;
|
|
48
|
-
primaryKey: boolean;
|
|
49
|
-
notNull: boolean;
|
|
50
|
-
autoincrement: boolean;
|
|
51
|
-
};
|
|
52
|
-
id_token: {
|
|
53
|
-
name: string;
|
|
54
|
-
type: string;
|
|
55
|
-
primaryKey: boolean;
|
|
56
|
-
notNull: boolean;
|
|
57
|
-
autoincrement: boolean;
|
|
58
|
-
};
|
|
59
|
-
access_token_expires_at: {
|
|
60
|
-
name: string;
|
|
61
|
-
type: string;
|
|
62
|
-
primaryKey: boolean;
|
|
63
|
-
notNull: boolean;
|
|
64
|
-
autoincrement: boolean;
|
|
65
|
-
};
|
|
66
|
-
refresh_token_expires_at: {
|
|
67
|
-
name: string;
|
|
68
|
-
type: string;
|
|
69
|
-
primaryKey: boolean;
|
|
70
|
-
notNull: boolean;
|
|
71
|
-
autoincrement: boolean;
|
|
72
|
-
};
|
|
73
|
-
scope: {
|
|
74
|
-
name: string;
|
|
75
|
-
type: string;
|
|
76
|
-
primaryKey: boolean;
|
|
77
|
-
notNull: boolean;
|
|
78
|
-
autoincrement: boolean;
|
|
79
|
-
};
|
|
80
|
-
password: {
|
|
81
|
-
name: string;
|
|
82
|
-
type: string;
|
|
83
|
-
primaryKey: boolean;
|
|
84
|
-
notNull: boolean;
|
|
85
|
-
autoincrement: boolean;
|
|
86
|
-
};
|
|
87
|
-
created_at: {
|
|
88
|
-
name: string;
|
|
89
|
-
type: string;
|
|
90
|
-
primaryKey: boolean;
|
|
91
|
-
notNull: boolean;
|
|
92
|
-
autoincrement: boolean;
|
|
93
|
-
};
|
|
94
|
-
updated_at: {
|
|
95
|
-
name: string;
|
|
96
|
-
type: string;
|
|
97
|
-
primaryKey: boolean;
|
|
98
|
-
notNull: boolean;
|
|
99
|
-
autoincrement: boolean;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
indexes: {
|
|
103
|
-
account_user_id_idx: {
|
|
104
|
-
name: string;
|
|
105
|
-
columns: string[];
|
|
106
|
-
isUnique: boolean;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
foreignKeys: {
|
|
110
|
-
account_user_id_user_id_fk: {
|
|
111
|
-
name: string;
|
|
112
|
-
tableFrom: string;
|
|
113
|
-
tableTo: string;
|
|
114
|
-
columnsFrom: string[];
|
|
115
|
-
columnsTo: string[];
|
|
116
|
-
onDelete: string;
|
|
117
|
-
onUpdate: string;
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
compositePrimaryKeys: {};
|
|
121
|
-
uniqueConstraints: {};
|
|
122
|
-
checkConstraints: {};
|
|
123
|
-
};
|
|
124
|
-
session: {
|
|
125
|
-
name: string;
|
|
126
|
-
columns: {
|
|
127
|
-
id: {
|
|
128
|
-
name: string;
|
|
129
|
-
type: string;
|
|
130
|
-
primaryKey: boolean;
|
|
131
|
-
notNull: boolean;
|
|
132
|
-
autoincrement: boolean;
|
|
133
|
-
};
|
|
134
|
-
expires_at: {
|
|
135
|
-
name: string;
|
|
136
|
-
type: string;
|
|
137
|
-
primaryKey: boolean;
|
|
138
|
-
notNull: boolean;
|
|
139
|
-
autoincrement: boolean;
|
|
140
|
-
};
|
|
141
|
-
token: {
|
|
142
|
-
name: string;
|
|
143
|
-
type: string;
|
|
144
|
-
primaryKey: boolean;
|
|
145
|
-
notNull: boolean;
|
|
146
|
-
autoincrement: boolean;
|
|
147
|
-
};
|
|
148
|
-
created_at: {
|
|
149
|
-
name: string;
|
|
150
|
-
type: string;
|
|
151
|
-
primaryKey: boolean;
|
|
152
|
-
notNull: boolean;
|
|
153
|
-
autoincrement: boolean;
|
|
154
|
-
};
|
|
155
|
-
updated_at: {
|
|
156
|
-
name: string;
|
|
157
|
-
type: string;
|
|
158
|
-
primaryKey: boolean;
|
|
159
|
-
notNull: boolean;
|
|
160
|
-
autoincrement: boolean;
|
|
161
|
-
};
|
|
162
|
-
ip_address: {
|
|
163
|
-
name: string;
|
|
164
|
-
type: string;
|
|
165
|
-
primaryKey: boolean;
|
|
166
|
-
notNull: boolean;
|
|
167
|
-
autoincrement: boolean;
|
|
168
|
-
};
|
|
169
|
-
user_agent: {
|
|
170
|
-
name: string;
|
|
171
|
-
type: string;
|
|
172
|
-
primaryKey: boolean;
|
|
173
|
-
notNull: boolean;
|
|
174
|
-
autoincrement: boolean;
|
|
175
|
-
};
|
|
176
|
-
user_id: {
|
|
177
|
-
name: string;
|
|
178
|
-
type: string;
|
|
179
|
-
primaryKey: boolean;
|
|
180
|
-
notNull: boolean;
|
|
181
|
-
autoincrement: boolean;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
indexes: {
|
|
185
|
-
session_token_unique: {
|
|
186
|
-
name: string;
|
|
187
|
-
columns: string[];
|
|
188
|
-
isUnique: boolean;
|
|
189
|
-
};
|
|
190
|
-
session_user_id_idx: {
|
|
191
|
-
name: string;
|
|
192
|
-
columns: string[];
|
|
193
|
-
isUnique: boolean;
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
foreignKeys: {
|
|
197
|
-
session_user_id_user_id_fk: {
|
|
198
|
-
name: string;
|
|
199
|
-
tableFrom: string;
|
|
200
|
-
tableTo: string;
|
|
201
|
-
columnsFrom: string[];
|
|
202
|
-
columnsTo: string[];
|
|
203
|
-
onDelete: string;
|
|
204
|
-
onUpdate: string;
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
compositePrimaryKeys: {};
|
|
208
|
-
uniqueConstraints: {};
|
|
209
|
-
checkConstraints: {};
|
|
210
|
-
};
|
|
211
|
-
user: {
|
|
212
|
-
name: string;
|
|
213
|
-
columns: {
|
|
214
|
-
id: {
|
|
215
|
-
name: string;
|
|
216
|
-
type: string;
|
|
217
|
-
primaryKey: boolean;
|
|
218
|
-
notNull: boolean;
|
|
219
|
-
autoincrement: boolean;
|
|
220
|
-
};
|
|
221
|
-
name: {
|
|
222
|
-
name: string;
|
|
223
|
-
type: string;
|
|
224
|
-
primaryKey: boolean;
|
|
225
|
-
notNull: boolean;
|
|
226
|
-
autoincrement: boolean;
|
|
227
|
-
};
|
|
228
|
-
email: {
|
|
229
|
-
name: string;
|
|
230
|
-
type: string;
|
|
231
|
-
primaryKey: boolean;
|
|
232
|
-
notNull: boolean;
|
|
233
|
-
autoincrement: boolean;
|
|
234
|
-
};
|
|
235
|
-
email_verified: {
|
|
236
|
-
name: string;
|
|
237
|
-
type: string;
|
|
238
|
-
primaryKey: boolean;
|
|
239
|
-
notNull: boolean;
|
|
240
|
-
autoincrement: boolean;
|
|
241
|
-
default: boolean;
|
|
242
|
-
};
|
|
243
|
-
image: {
|
|
244
|
-
name: string;
|
|
245
|
-
type: string;
|
|
246
|
-
primaryKey: boolean;
|
|
247
|
-
notNull: boolean;
|
|
248
|
-
autoincrement: boolean;
|
|
249
|
-
};
|
|
250
|
-
created_at: {
|
|
251
|
-
name: string;
|
|
252
|
-
type: string;
|
|
253
|
-
primaryKey: boolean;
|
|
254
|
-
notNull: boolean;
|
|
255
|
-
autoincrement: boolean;
|
|
256
|
-
};
|
|
257
|
-
updated_at: {
|
|
258
|
-
name: string;
|
|
259
|
-
type: string;
|
|
260
|
-
primaryKey: boolean;
|
|
261
|
-
notNull: boolean;
|
|
262
|
-
autoincrement: boolean;
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
|
-
indexes: {
|
|
266
|
-
user_email_unique: {
|
|
267
|
-
name: string;
|
|
268
|
-
columns: string[];
|
|
269
|
-
isUnique: boolean;
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
foreignKeys: {};
|
|
273
|
-
compositePrimaryKeys: {};
|
|
274
|
-
uniqueConstraints: {};
|
|
275
|
-
checkConstraints: {};
|
|
276
|
-
};
|
|
277
|
-
verification: {
|
|
278
|
-
name: string;
|
|
279
|
-
columns: {
|
|
280
|
-
id: {
|
|
281
|
-
name: string;
|
|
282
|
-
type: string;
|
|
283
|
-
primaryKey: boolean;
|
|
284
|
-
notNull: boolean;
|
|
285
|
-
autoincrement: boolean;
|
|
286
|
-
};
|
|
287
|
-
identifier: {
|
|
288
|
-
name: string;
|
|
289
|
-
type: string;
|
|
290
|
-
primaryKey: boolean;
|
|
291
|
-
notNull: boolean;
|
|
292
|
-
autoincrement: boolean;
|
|
293
|
-
};
|
|
294
|
-
value: {
|
|
295
|
-
name: string;
|
|
296
|
-
type: string;
|
|
297
|
-
primaryKey: boolean;
|
|
298
|
-
notNull: boolean;
|
|
299
|
-
autoincrement: boolean;
|
|
300
|
-
};
|
|
301
|
-
expires_at: {
|
|
302
|
-
name: string;
|
|
303
|
-
type: string;
|
|
304
|
-
primaryKey: boolean;
|
|
305
|
-
notNull: boolean;
|
|
306
|
-
autoincrement: boolean;
|
|
307
|
-
};
|
|
308
|
-
created_at: {
|
|
309
|
-
name: string;
|
|
310
|
-
type: string;
|
|
311
|
-
primaryKey: boolean;
|
|
312
|
-
notNull: boolean;
|
|
313
|
-
autoincrement: boolean;
|
|
314
|
-
};
|
|
315
|
-
updated_at: {
|
|
316
|
-
name: string;
|
|
317
|
-
type: string;
|
|
318
|
-
primaryKey: boolean;
|
|
319
|
-
notNull: boolean;
|
|
320
|
-
autoincrement: boolean;
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
|
-
indexes: {
|
|
324
|
-
verification_identifier_idx: {
|
|
325
|
-
name: string;
|
|
326
|
-
columns: string[];
|
|
327
|
-
isUnique: boolean;
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
foreignKeys: {};
|
|
331
|
-
compositePrimaryKeys: {};
|
|
332
|
-
uniqueConstraints: {};
|
|
333
|
-
checkConstraints: {};
|
|
334
|
-
};
|
|
335
|
-
};
|
|
336
|
-
views: {};
|
|
337
|
-
enums: {};
|
|
338
|
-
_meta: {
|
|
339
|
-
schemas: {};
|
|
340
|
-
tables: {};
|
|
341
|
-
columns: {};
|
|
342
|
-
};
|
|
343
|
-
internal: {
|
|
344
|
-
indexes: {};
|
|
345
|
-
};
|
|
346
|
-
};
|