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
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export declare const CAPABILITIES: {
|
|
2
|
+
readonly hono: {
|
|
3
|
+
readonly name: "Hono backend API";
|
|
4
|
+
readonly requires: readonly [];
|
|
5
|
+
readonly targets: readonly ["apps/api"];
|
|
6
|
+
readonly configuration: readonly ["ANHEDRAL_API service binding"];
|
|
7
|
+
};
|
|
8
|
+
readonly 'database-auth': {
|
|
9
|
+
readonly name: "Drizzle / D1 / Better Auth";
|
|
10
|
+
readonly requires: readonly ["hono"];
|
|
11
|
+
readonly targets: readonly ["packages/db", "apps/api/src/auth.ts"];
|
|
12
|
+
readonly configuration: readonly ["D1 resource ID", "BETTER_AUTH_SECRET", "PUBLIC_APP_URL", "explicit auth methods", "reviewed migrations"];
|
|
13
|
+
};
|
|
14
|
+
readonly r2: {
|
|
15
|
+
readonly name: "Private R2 storage";
|
|
16
|
+
readonly requires: readonly ["database-auth"];
|
|
17
|
+
readonly targets: readonly ["apps/api/src/features/storage.ts"];
|
|
18
|
+
readonly configuration: readonly ["private R2 bucket and FILES binding"];
|
|
19
|
+
};
|
|
20
|
+
readonly stripe: {
|
|
21
|
+
readonly name: "Stripe payments";
|
|
22
|
+
readonly requires: readonly ["database-auth"];
|
|
23
|
+
readonly targets: readonly ["apps/api/src/features/stripe.ts"];
|
|
24
|
+
readonly configuration: readonly ["Stripe test credentials", "allowed prices", "webhook endpoint", "billing schema migration"];
|
|
25
|
+
};
|
|
26
|
+
readonly realtime: {
|
|
27
|
+
readonly name: "Realtime events";
|
|
28
|
+
readonly requires: readonly ["database-auth"];
|
|
29
|
+
readonly targets: readonly ["apps/api/src/features/events.ts"];
|
|
30
|
+
readonly configuration: readonly ["event schema migration"];
|
|
31
|
+
};
|
|
32
|
+
readonly rtc: {
|
|
33
|
+
readonly name: "Realtime RTC";
|
|
34
|
+
readonly requires: readonly ["database-auth"];
|
|
35
|
+
readonly targets: readonly ["apps/api/src/features/rtc.ts"];
|
|
36
|
+
readonly configuration: readonly ["Cloudflare Realtime SFU app ID and secret"];
|
|
37
|
+
};
|
|
38
|
+
readonly ai: {
|
|
39
|
+
readonly name: "Workers AI";
|
|
40
|
+
readonly requires: readonly ["database-auth"];
|
|
41
|
+
readonly targets: readonly ["apps/api/src/features/ai.ts"];
|
|
42
|
+
readonly configuration: readonly ["Workers AI binding", "explicit model selection and daily quota"];
|
|
43
|
+
};
|
|
44
|
+
readonly expo: {
|
|
45
|
+
readonly name: "Expo mobile app";
|
|
46
|
+
readonly requires: readonly ["database-auth"];
|
|
47
|
+
readonly targets: readonly ["apps/mobile"];
|
|
48
|
+
readonly configuration: readonly ["device-reachable API URL", "trusted native origin", "native development build"];
|
|
49
|
+
};
|
|
50
|
+
readonly 'native-ui': {
|
|
51
|
+
readonly name: "Anhedral UI for Expo";
|
|
52
|
+
readonly requires: readonly ["expo"];
|
|
53
|
+
readonly targets: readonly ["apps/mobile/components.json"];
|
|
54
|
+
readonly configuration: readonly ["Android/iOS interaction validation"];
|
|
55
|
+
};
|
|
56
|
+
readonly revenuecat: {
|
|
57
|
+
readonly name: "RevenueCat mobile subscriptions";
|
|
58
|
+
readonly requires: readonly ["expo", "stripe"];
|
|
59
|
+
readonly targets: readonly ["apps/mobile/lib/purchases.ts", "apps/api/src/features/revenuecat.ts"];
|
|
60
|
+
readonly configuration: readonly ["RevenueCat app/project, public SDK keys and server credentials", "store sandbox validation"];
|
|
61
|
+
};
|
|
62
|
+
readonly wxt: {
|
|
63
|
+
readonly name: "WXT browser extension";
|
|
64
|
+
readonly requires: readonly ["database-auth"];
|
|
65
|
+
readonly targets: readonly ["apps/extension"];
|
|
66
|
+
readonly configuration: readonly ["API origin and host permissions", "extension authentication flow"];
|
|
67
|
+
};
|
|
68
|
+
readonly 'side-panel': {
|
|
69
|
+
readonly name: "Side Panel API";
|
|
70
|
+
readonly requires: readonly ["wxt"];
|
|
71
|
+
readonly targets: readonly ["apps/extension/entrypoints/sidepanel"];
|
|
72
|
+
readonly configuration: readonly ["Chromium side panel validation"];
|
|
73
|
+
};
|
|
74
|
+
readonly gpui: {
|
|
75
|
+
readonly name: "GPUI native desktop app";
|
|
76
|
+
readonly requires: readonly ["database-auth"];
|
|
77
|
+
readonly targets: readonly ["apps/desktop"];
|
|
78
|
+
readonly configuration: readonly ["Rust toolchain and native platform libraries", "native account flow and distribution"];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export type Capability = keyof typeof CAPABILITIES;
|
|
82
|
+
export declare const CAPABILITY_IDS: Capability[];
|
|
83
|
+
export declare function capabilityOrder(requested: readonly string[], installed: readonly Capability[], includeDependencies: boolean): Capability[];
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export const CAPABILITIES = {
|
|
2
|
+
hono: {
|
|
3
|
+
name: 'Hono backend API',
|
|
4
|
+
requires: [],
|
|
5
|
+
targets: ['apps/api'],
|
|
6
|
+
configuration: ['ANHEDRAL_API service binding'],
|
|
7
|
+
},
|
|
8
|
+
'database-auth': {
|
|
9
|
+
name: 'Drizzle / D1 / Better Auth',
|
|
10
|
+
requires: ['hono'],
|
|
11
|
+
targets: ['packages/db', 'apps/api/src/auth.ts'],
|
|
12
|
+
configuration: [
|
|
13
|
+
'D1 resource ID',
|
|
14
|
+
'BETTER_AUTH_SECRET',
|
|
15
|
+
'PUBLIC_APP_URL',
|
|
16
|
+
'explicit auth methods',
|
|
17
|
+
'reviewed migrations',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
r2: {
|
|
21
|
+
name: 'Private R2 storage',
|
|
22
|
+
requires: ['database-auth'],
|
|
23
|
+
targets: ['apps/api/src/features/storage.ts'],
|
|
24
|
+
configuration: ['private R2 bucket and FILES binding'],
|
|
25
|
+
},
|
|
26
|
+
stripe: {
|
|
27
|
+
name: 'Stripe payments',
|
|
28
|
+
requires: ['database-auth'],
|
|
29
|
+
targets: ['apps/api/src/features/stripe.ts'],
|
|
30
|
+
configuration: [
|
|
31
|
+
'Stripe test credentials',
|
|
32
|
+
'allowed prices',
|
|
33
|
+
'webhook endpoint',
|
|
34
|
+
'billing schema migration',
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
realtime: {
|
|
38
|
+
name: 'Realtime events',
|
|
39
|
+
requires: ['database-auth'],
|
|
40
|
+
targets: ['apps/api/src/features/events.ts'],
|
|
41
|
+
configuration: ['event schema migration'],
|
|
42
|
+
},
|
|
43
|
+
rtc: {
|
|
44
|
+
name: 'Realtime RTC',
|
|
45
|
+
requires: ['database-auth'],
|
|
46
|
+
targets: ['apps/api/src/features/rtc.ts'],
|
|
47
|
+
configuration: ['Cloudflare Realtime SFU app ID and secret'],
|
|
48
|
+
},
|
|
49
|
+
ai: {
|
|
50
|
+
name: 'Workers AI',
|
|
51
|
+
requires: ['database-auth'],
|
|
52
|
+
targets: ['apps/api/src/features/ai.ts'],
|
|
53
|
+
configuration: ['Workers AI binding', 'explicit model selection and daily quota'],
|
|
54
|
+
},
|
|
55
|
+
expo: {
|
|
56
|
+
name: 'Expo mobile app',
|
|
57
|
+
requires: ['database-auth'],
|
|
58
|
+
targets: ['apps/mobile'],
|
|
59
|
+
configuration: [
|
|
60
|
+
'device-reachable API URL',
|
|
61
|
+
'trusted native origin',
|
|
62
|
+
'native development build',
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
'native-ui': {
|
|
66
|
+
name: 'Anhedral UI for Expo',
|
|
67
|
+
requires: ['expo'],
|
|
68
|
+
targets: ['apps/mobile/components.json'],
|
|
69
|
+
configuration: ['Android/iOS interaction validation'],
|
|
70
|
+
},
|
|
71
|
+
revenuecat: {
|
|
72
|
+
name: 'RevenueCat mobile subscriptions',
|
|
73
|
+
requires: ['expo', 'stripe'],
|
|
74
|
+
targets: ['apps/mobile/lib/purchases.ts', 'apps/api/src/features/revenuecat.ts'],
|
|
75
|
+
configuration: [
|
|
76
|
+
'RevenueCat app/project, public SDK keys and server credentials',
|
|
77
|
+
'store sandbox validation',
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
wxt: {
|
|
81
|
+
name: 'WXT browser extension',
|
|
82
|
+
requires: ['database-auth'],
|
|
83
|
+
targets: ['apps/extension'],
|
|
84
|
+
configuration: ['API origin and host permissions', 'extension authentication flow'],
|
|
85
|
+
},
|
|
86
|
+
'side-panel': {
|
|
87
|
+
name: 'Side Panel API',
|
|
88
|
+
requires: ['wxt'],
|
|
89
|
+
targets: ['apps/extension/entrypoints/sidepanel'],
|
|
90
|
+
configuration: ['Chromium side panel validation'],
|
|
91
|
+
},
|
|
92
|
+
gpui: {
|
|
93
|
+
name: 'GPUI native desktop app',
|
|
94
|
+
requires: ['database-auth'],
|
|
95
|
+
targets: ['apps/desktop'],
|
|
96
|
+
configuration: [
|
|
97
|
+
'Rust toolchain and native platform libraries',
|
|
98
|
+
'native account flow and distribution',
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
export const CAPABILITY_IDS = Object.keys(CAPABILITIES);
|
|
103
|
+
export function capabilityOrder(requested, installed, includeDependencies) {
|
|
104
|
+
const selected = new Set();
|
|
105
|
+
function visit(name) {
|
|
106
|
+
if (!Object.hasOwn(CAPABILITIES, name))
|
|
107
|
+
throw Error(`Unknown capability: ${name}. Run anhedral stack list.`);
|
|
108
|
+
const id = name;
|
|
109
|
+
if (installed.includes(id) || selected.has(id))
|
|
110
|
+
return;
|
|
111
|
+
for (const parent of CAPABILITIES[id].requires) {
|
|
112
|
+
if (!installed.includes(parent) && !requested.includes(parent) && !includeDependencies)
|
|
113
|
+
throw Error(`${id} requires ${parent}. Add it first or explicitly use --with-dependencies.`);
|
|
114
|
+
visit(parent);
|
|
115
|
+
}
|
|
116
|
+
selected.add(id);
|
|
117
|
+
}
|
|
118
|
+
for (const id of requested)
|
|
119
|
+
visit(id);
|
|
120
|
+
return [...selected];
|
|
121
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { existsSync, realpathSync, statSync, chmodSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { commandArguments, commandArgumentError } from './cli-arguments.js';
|
|
4
|
+
import { CAPABILITIES, CAPABILITY_IDS, capabilityOrder, } from './capability-catalog.js';
|
|
5
|
+
import { CapabilityEditor } from './capability-editor.js';
|
|
6
|
+
import { addCapabilityRecipe, composeCapabilities } from './capability-recipes.js';
|
|
7
|
+
import { PostCommitError, runStagedTransaction } from './transaction.js';
|
|
8
|
+
import { put } from './scaffold/files.js';
|
|
9
|
+
import { execFile } from './util.js';
|
|
10
|
+
import { capabilityReferences } from './capability-references.js';
|
|
11
|
+
import { configureDependencyPatches } from './dependency-patches.js';
|
|
12
|
+
function projectRoot(cwd) {
|
|
13
|
+
let root = realpathSync(cwd);
|
|
14
|
+
for (;;) {
|
|
15
|
+
if (existsSync(path.join(root, 'anhedral.json')))
|
|
16
|
+
return root;
|
|
17
|
+
if (existsSync(path.join(root, '.git')))
|
|
18
|
+
break;
|
|
19
|
+
const parent = path.dirname(root);
|
|
20
|
+
if (parent === root)
|
|
21
|
+
break;
|
|
22
|
+
root = parent;
|
|
23
|
+
}
|
|
24
|
+
throw Error('No Anhedral workspace found. Select a generated project with --cwd.');
|
|
25
|
+
}
|
|
26
|
+
function readState(e) {
|
|
27
|
+
const project = e.json('anhedral.json');
|
|
28
|
+
const state = project.capabilities ?? { schemaVersion: 1, installed: [], managedFiles: {} };
|
|
29
|
+
if (state.schemaVersion !== 1 ||
|
|
30
|
+
!Array.isArray(state.installed) ||
|
|
31
|
+
state.installed.some((id) => typeof id !== 'string' || !Object.hasOwn(CAPABILITIES, id)) ||
|
|
32
|
+
!state.managedFiles ||
|
|
33
|
+
typeof state.managedFiles !== 'object' ||
|
|
34
|
+
Array.isArray(state.managedFiles))
|
|
35
|
+
throw Error('Invalid capability state; preserve and reconcile anhedral.json.');
|
|
36
|
+
const installed = [...new Set(state.installed)];
|
|
37
|
+
for (const id of installed)
|
|
38
|
+
for (const parent of CAPABILITIES[id].requires)
|
|
39
|
+
if (!installed.includes(parent))
|
|
40
|
+
throw Error(`Invalid capability state: ${id} requires ${parent}.`);
|
|
41
|
+
return { installed, managedFiles: state.managedFiles };
|
|
42
|
+
}
|
|
43
|
+
export async function runCapabilityCommand(command, args, output, run = execFile) {
|
|
44
|
+
const parsed = commandArguments(command, args);
|
|
45
|
+
let result;
|
|
46
|
+
if (command === 'stack') {
|
|
47
|
+
const [action, ...extra] = parsed.positional;
|
|
48
|
+
if (extra.length || !['list', 'status', 'doctor'].includes(action))
|
|
49
|
+
throw commandArgumentError('stack', 'Use stack list, status or doctor.');
|
|
50
|
+
if (action === 'list')
|
|
51
|
+
result = {
|
|
52
|
+
capabilities: CAPABILITY_IDS.map((id) => ({ id, ...CAPABILITIES[id] })),
|
|
53
|
+
provisioning: 'Separate from source installation',
|
|
54
|
+
};
|
|
55
|
+
else {
|
|
56
|
+
const root = projectRoot(process.cwd());
|
|
57
|
+
const e = new CapabilityEditor(root, {});
|
|
58
|
+
const state = readState(e);
|
|
59
|
+
const capabilities = CAPABILITY_IDS.map((id) => {
|
|
60
|
+
const missing = CAPABILITIES[id].requires.filter((parent) => !state.installed.includes(parent));
|
|
61
|
+
const installed = state.installed.includes(id);
|
|
62
|
+
const missingFiles = installed
|
|
63
|
+
? CAPABILITIES[id].targets.filter((target) => !existsSync(path.join(root, target)))
|
|
64
|
+
: [];
|
|
65
|
+
return {
|
|
66
|
+
id,
|
|
67
|
+
name: CAPABILITIES[id].name,
|
|
68
|
+
sourceState: installed
|
|
69
|
+
? missingFiles.length
|
|
70
|
+
? 'incomplete'
|
|
71
|
+
: 'installed'
|
|
72
|
+
: missing.length
|
|
73
|
+
? 'locked'
|
|
74
|
+
: 'available',
|
|
75
|
+
missingPrerequisites: missing,
|
|
76
|
+
missingFiles,
|
|
77
|
+
configuration: installed ? CAPABILITIES[id].configuration : [],
|
|
78
|
+
activation: 'not verified',
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
const foundationReady = existsSync(path.join(root, 'apps/web/package.json')) &&
|
|
82
|
+
!!e.json('apps/web/package.json').dependencies?.next;
|
|
83
|
+
const sourceReady = foundationReady && capabilities.every((c) => c.sourceState !== 'incomplete');
|
|
84
|
+
result = {
|
|
85
|
+
root,
|
|
86
|
+
foundationReady,
|
|
87
|
+
sourceReady,
|
|
88
|
+
capabilities,
|
|
89
|
+
runtimeAcceptance: 'not evaluated',
|
|
90
|
+
resourcesProvisionedByCli: false,
|
|
91
|
+
};
|
|
92
|
+
if (action === 'doctor' && !sourceReady)
|
|
93
|
+
process.exitCode = 1;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
if (!parsed.positional.length || parsed.positional.length > CAPABILITY_IDS.length)
|
|
98
|
+
throw commandArgumentError('add', 'Choose one or more capabilities from anhedral stack list.');
|
|
99
|
+
const root = projectRoot(process.cwd());
|
|
100
|
+
const e = new CapabilityEditor(root, {});
|
|
101
|
+
const state = readState(e);
|
|
102
|
+
Object.assign(e.managed, state.managedFiles);
|
|
103
|
+
const manifest = e.json('package.json');
|
|
104
|
+
if (typeof manifest.name !== 'string' || !manifest.name)
|
|
105
|
+
throw Error('The workspace needs a package name.');
|
|
106
|
+
if (!e.json('apps/web/package.json').dependencies?.next)
|
|
107
|
+
throw Error('A Next.js foundation is required.');
|
|
108
|
+
for (const id of state.installed)
|
|
109
|
+
for (const target of CAPABILITIES[id].targets)
|
|
110
|
+
if (!existsSync(path.join(root, target)))
|
|
111
|
+
throw Error(`Installed capability is incomplete: ${id} (${target}). Reconcile its source first.`);
|
|
112
|
+
const additions = capabilityOrder(parsed.positional, state.installed, parsed.has('--with-dependencies'));
|
|
113
|
+
const installed = [...state.installed, ...additions];
|
|
114
|
+
for (const id of additions)
|
|
115
|
+
addCapabilityRecipe(e, id, manifest.name);
|
|
116
|
+
if (additions.length) {
|
|
117
|
+
for (const [file, source] of Object.entries(capabilityReferences()))
|
|
118
|
+
if (e.read(file) === null)
|
|
119
|
+
e.create(file, source);
|
|
120
|
+
composeCapabilities(e, installed);
|
|
121
|
+
e.set('anhedral.json', ['capabilities'], {
|
|
122
|
+
schemaVersion: 1,
|
|
123
|
+
installed,
|
|
124
|
+
managedFiles: e.managed,
|
|
125
|
+
resourcesProvisionedByCli: false,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const files = [...e.writes.keys()];
|
|
129
|
+
const plan = {
|
|
130
|
+
root,
|
|
131
|
+
added: additions,
|
|
132
|
+
alreadyInstalled: parsed.positional.filter((id) => state.installed.includes(id)),
|
|
133
|
+
installed,
|
|
134
|
+
files,
|
|
135
|
+
configuration: additions.map((id) => ({ id, requirements: CAPABILITIES[id].configuration })),
|
|
136
|
+
dryRun: parsed.has('--dry-run'),
|
|
137
|
+
resourcesProvisionedByCli: false,
|
|
138
|
+
activation: 'not verified',
|
|
139
|
+
};
|
|
140
|
+
const installDependencies = () => {
|
|
141
|
+
if (parsed.has('--skip-install'))
|
|
142
|
+
return;
|
|
143
|
+
run('pnpm', ['install', '--lockfile-only', '--no-frozen-lockfile'], root);
|
|
144
|
+
if (configureDependencyPatches(root))
|
|
145
|
+
run('pnpm', ['install', '--lockfile-only', '--no-frozen-lockfile'], root);
|
|
146
|
+
run('pnpm', ['install', '--frozen-lockfile'], root);
|
|
147
|
+
};
|
|
148
|
+
if (!parsed.has('--dry-run') && files.length) {
|
|
149
|
+
await runStagedTransaction(root, {
|
|
150
|
+
commitPaths: files,
|
|
151
|
+
prepare: () => e.verify(),
|
|
152
|
+
build: async (stage) => {
|
|
153
|
+
for (const [file, source] of e.writes) {
|
|
154
|
+
put(stage, file, source);
|
|
155
|
+
if (e.before.get(file) !== null)
|
|
156
|
+
chmodSync(path.join(stage, file), statSync(path.join(root, file)).mode & 0o777);
|
|
157
|
+
}
|
|
158
|
+
e.verify();
|
|
159
|
+
},
|
|
160
|
+
afterCommit: installDependencies,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (!parsed.has('--dry-run') && !files.length) {
|
|
164
|
+
e.verify();
|
|
165
|
+
try {
|
|
166
|
+
installDependencies();
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
throw new PostCommitError([], error);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
result = {
|
|
173
|
+
...plan,
|
|
174
|
+
sourceInstalled: !parsed.has('--dry-run'),
|
|
175
|
+
dependenciesInstalled: !parsed.has('--dry-run') && !parsed.has('--skip-install'),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (output.json)
|
|
179
|
+
console.log(JSON.stringify(result, null, 2));
|
|
180
|
+
else if (!output.quiet) {
|
|
181
|
+
if (command === 'add')
|
|
182
|
+
console.log(`${parsed.has('--dry-run') ? 'Plan' : 'Source additions'}: ${result.added.join(', ') || 'already installed'}\n${result.files.map((file) => ' ' + file).join('\n')}\nReview capability configuration and migrations before deployment. No resources were provisioned.`);
|
|
183
|
+
else
|
|
184
|
+
console.log(result.capabilities
|
|
185
|
+
.map((item) => `${item.id}\t${item.sourceState ?? item.name}\t${item.requires?.join(', ') ?? ''}`)
|
|
186
|
+
.join('\n') + '\nSource state is not live provider activation.');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const fingerprint: (source: string | Buffer) => string;
|
|
2
|
+
/** A bounded, read-only overlay until every capability has passed preflight. */
|
|
3
|
+
export declare class CapabilityEditor {
|
|
4
|
+
readonly root: string;
|
|
5
|
+
readonly managed: Record<string, string>;
|
|
6
|
+
readonly writes: Map<string, string>;
|
|
7
|
+
readonly before: Map<string, string | null>;
|
|
8
|
+
constructor(root: string, managed: Record<string, string>);
|
|
9
|
+
private file;
|
|
10
|
+
read(relative: string): string | null;
|
|
11
|
+
json(relative: string): Record<string, any>;
|
|
12
|
+
create(relative: string, source: string): void;
|
|
13
|
+
owned(relative: string, source: string): void;
|
|
14
|
+
set(relative: string, keys: (string | number)[], value: unknown): void;
|
|
15
|
+
merge(relative: string, section: string, values: Record<string, unknown>): void;
|
|
16
|
+
verify(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { existsSync, lstatSync, readFileSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { parse, modify, applyEdits } from 'jsonc-parser';
|
|
5
|
+
export const fingerprint = (source) => createHash('sha256').update(source).digest('hex');
|
|
6
|
+
/** A bounded, read-only overlay until every capability has passed preflight. */
|
|
7
|
+
export class CapabilityEditor {
|
|
8
|
+
root;
|
|
9
|
+
managed;
|
|
10
|
+
writes = new Map();
|
|
11
|
+
before = new Map();
|
|
12
|
+
constructor(root, managed) {
|
|
13
|
+
this.root = root;
|
|
14
|
+
this.managed = managed;
|
|
15
|
+
}
|
|
16
|
+
file(relative) {
|
|
17
|
+
if (!relative ||
|
|
18
|
+
path.isAbsolute(relative) ||
|
|
19
|
+
relative.includes('\\') ||
|
|
20
|
+
relative.split('/').some((p) => !p || p === '.' || p === '..'))
|
|
21
|
+
throw Error(`Unsafe addition path: ${relative}`);
|
|
22
|
+
let current = this.root;
|
|
23
|
+
for (const part of relative.split('/')) {
|
|
24
|
+
current = path.join(current, part);
|
|
25
|
+
try {
|
|
26
|
+
if (lstatSync(current).isSymbolicLink())
|
|
27
|
+
throw Error(`Refusing a symlink in ${relative}.`);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error.code !== 'ENOENT')
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return current;
|
|
35
|
+
}
|
|
36
|
+
read(relative) {
|
|
37
|
+
const file = this.file(relative);
|
|
38
|
+
if (this.writes.has(relative))
|
|
39
|
+
return this.writes.get(relative);
|
|
40
|
+
if (!this.before.has(relative)) {
|
|
41
|
+
const value = existsSync(file) ? readFileSync(file) : null;
|
|
42
|
+
if (value && value.length > 2 * 1024 * 1024)
|
|
43
|
+
throw Error(`Configuration exceeds its bound: ${relative}`);
|
|
44
|
+
this.before.set(relative, value?.toString('utf8') ?? null);
|
|
45
|
+
}
|
|
46
|
+
return this.before.get(relative);
|
|
47
|
+
}
|
|
48
|
+
json(relative) {
|
|
49
|
+
const source = this.read(relative);
|
|
50
|
+
if (source === null)
|
|
51
|
+
throw Error(`Missing ${relative}.`);
|
|
52
|
+
const errors = [];
|
|
53
|
+
const value = parse(source, errors, { allowTrailingComma: true });
|
|
54
|
+
if (errors.length || !value || typeof value !== 'object' || Array.isArray(value))
|
|
55
|
+
throw Error(`Invalid JSON/JSONC in ${relative}.`);
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
create(relative, source) {
|
|
59
|
+
if (this.read(relative) !== null)
|
|
60
|
+
throw Error(`Addition conflicts with existing source: ${relative}. No files were changed.`);
|
|
61
|
+
this.writes.set(relative, source);
|
|
62
|
+
}
|
|
63
|
+
owned(relative, source) {
|
|
64
|
+
const current = this.read(relative);
|
|
65
|
+
if (current !== null &&
|
|
66
|
+
!this.writes.has(relative) &&
|
|
67
|
+
this.managed[relative] !== fingerprint(current))
|
|
68
|
+
throw Error(`Preserve edited generated source: ${relative}. Reconcile it before adding capabilities. No files were changed.`);
|
|
69
|
+
this.writes.set(relative, source);
|
|
70
|
+
this.managed[relative] = fingerprint(source);
|
|
71
|
+
}
|
|
72
|
+
set(relative, keys, value) {
|
|
73
|
+
const source = this.read(relative);
|
|
74
|
+
if (source === null)
|
|
75
|
+
throw Error(`Missing configuration: ${relative}`);
|
|
76
|
+
this.json(relative);
|
|
77
|
+
this.writes.set(relative, applyEdits(source, modify(source, keys, value, { formattingOptions: { insertSpaces: true, tabSize: 2 } })));
|
|
78
|
+
}
|
|
79
|
+
merge(relative, section, values) {
|
|
80
|
+
const current = this.json(relative)[section] ?? {};
|
|
81
|
+
if (!current || typeof current !== 'object' || Array.isArray(current))
|
|
82
|
+
throw Error(`Expected ${section} object in ${relative}.`);
|
|
83
|
+
for (const [key, value] of Object.entries(values)) {
|
|
84
|
+
if (Object.hasOwn(current, key) && JSON.stringify(current[key]) !== JSON.stringify(value))
|
|
85
|
+
throw Error(`Configuration conflict: ${relative} ${section}.${key}. Preserve and reconcile the existing value.`);
|
|
86
|
+
this.set(relative, [section, key], value);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
verify() {
|
|
90
|
+
for (const [relative, before] of this.before) {
|
|
91
|
+
const file = this.file(relative);
|
|
92
|
+
const current = existsSync(file) ? readFileSync(file, 'utf8') : null;
|
|
93
|
+
if (before !== current)
|
|
94
|
+
throw Error(`Source changed during addition: ${relative}. Retry after reviewing it.`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CapabilityEditor } from './capability-editor.js';
|
|
2
|
+
import type { Capability } from './capability-catalog.js';
|
|
3
|
+
export declare function addCapabilityRecipe(e: CapabilityEditor, id: Capability, name: string): void;
|
|
4
|
+
export declare function composeCapabilities(e: CapabilityEditor, installed: Capability[]): void;
|