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/dist/cli-commands.js
CHANGED
|
@@ -1,86 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { DELIVERY_COMMANDS, runDelivery } from './cli-delivery.js';
|
|
5
|
-
import { runServiceCommand } from './services-command.js';
|
|
6
|
-
import { inspectApplication } from './project-inspector.js';
|
|
7
|
-
import { integrationStatus, recoverIntegrationResource } from './providers/recovery.js';
|
|
8
|
-
import { INTEGRATION_PROVIDERS } from './providers/config.js';
|
|
9
|
-
import { authenticateProviders } from './provider-auth.js';
|
|
10
|
-
import { setupRepository } from './repository.js';
|
|
11
|
-
import { inspectProviderReadiness } from './provider-readiness.js';
|
|
12
|
-
import { inspectProject } from './readiness.js';
|
|
1
|
+
import { runCapabilityCommand } from './capability-command.js';
|
|
2
|
+
import { runUiCommand } from './ui-command.js';
|
|
3
|
+
import { commandArgumentError } from './cli-arguments.js';
|
|
13
4
|
import { parseStandardOptions, scaffoldStandardProject } from './standard.js';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const options = commandArguments('inspect', args);
|
|
22
|
-
if (options.positional.length > 1)
|
|
23
|
-
throw commandArgumentError('inspect', 'Specify at most one project directory.');
|
|
24
|
-
printResult('inspect', inspectApplication(projectRoot('inspect', options)), output);
|
|
25
|
-
}
|
|
26
|
-
async function runIntegrations(args, output) {
|
|
27
|
-
const options = commandArguments('integrations', args);
|
|
28
|
-
const action = options.positional.shift();
|
|
29
|
-
const root = projectRoot('integrations', options);
|
|
30
|
-
if (action === 'status') {
|
|
31
|
-
if (['--provider', '--operation', '--resource'].some(options.has))
|
|
32
|
-
throw commandArgumentError('integrations', 'Integration status accepts no recovery options.');
|
|
33
|
-
printResult('integrations', integrationStatus(root), output);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
if (action !== 'recover')
|
|
37
|
-
throw commandArgumentError('integrations', 'Use integrations status or integrations recover.');
|
|
38
|
-
const provider = options.value('--provider');
|
|
39
|
-
const operation = options.value('--operation');
|
|
40
|
-
const resourceId = options.value('--resource');
|
|
41
|
-
if (!INTEGRATION_PROVIDERS.includes(provider) || !operation || !resourceId)
|
|
42
|
-
throw commandArgumentError('integrations', 'Recovery requires --provider, --operation and --resource.');
|
|
43
|
-
printResult('integrations', await recoverIntegrationResource(root, { provider, operation, resourceId }), output);
|
|
44
|
-
}
|
|
45
|
-
async function runAuth(args, output) {
|
|
46
|
-
const options = commandArguments('auth', args);
|
|
47
|
-
const result = await authenticateProviders(projectRoot('auth', options), {
|
|
48
|
-
provider: options.value('--provider'),
|
|
49
|
-
status: options.has('--status'),
|
|
50
|
-
interactive: !output.json &&
|
|
51
|
-
!output.quiet &&
|
|
52
|
-
!options.has('--non-interactive') &&
|
|
53
|
-
Boolean(process.stdin.isTTY),
|
|
54
|
-
});
|
|
55
|
-
printResult('auth', result, output);
|
|
56
|
-
if (!result.authenticated)
|
|
57
|
-
process.exitCode = 1;
|
|
58
|
-
}
|
|
59
|
-
async function runRepository(args, output) {
|
|
60
|
-
const options = commandArguments('repository', args);
|
|
61
|
-
const visibility = options.value('--visibility') ?? 'private';
|
|
62
|
-
if (visibility !== 'private' && visibility !== 'public')
|
|
63
|
-
throw commandArgumentError('repository', 'Visibility must be private or public.');
|
|
64
|
-
printResult('repository', await setupRepository(projectRoot('repository', options), {
|
|
65
|
-
owner: options.value('--owner'),
|
|
66
|
-
name: options.value('--name'),
|
|
67
|
-
visibility,
|
|
68
|
-
create: options.has('--create'),
|
|
69
|
-
}), output);
|
|
70
|
-
}
|
|
71
|
-
async function runDoctor(args, output) {
|
|
72
|
-
const options = commandArguments('doctor', args);
|
|
73
|
-
const root = projectRoot('doctor', options);
|
|
74
|
-
const report = options.has('--providers')
|
|
75
|
-
? await inspectProviderReadiness(root)
|
|
76
|
-
: inspectProject(root);
|
|
77
|
-
printResult('doctor', report, output);
|
|
78
|
-
if (!report.localReady ||
|
|
79
|
-
('prerequisitesReady' in report &&
|
|
80
|
-
(!report.prerequisitesReady || report.providerVerification !== 'verified-existing-context')))
|
|
81
|
-
process.exitCode = 1;
|
|
82
|
-
}
|
|
83
|
-
async function runInit(args, output) {
|
|
5
|
+
export async function runCommand(command, args, output) {
|
|
6
|
+
if (command === 'add' || command === 'stack')
|
|
7
|
+
return runCapabilityCommand(command, args, output);
|
|
8
|
+
if (command === 'ui')
|
|
9
|
+
return runUiCommand(args, output);
|
|
10
|
+
if (command !== 'init')
|
|
11
|
+
throw commandArgumentError(command, 'Use init, add, stack or ui. Run anhedral --help.');
|
|
84
12
|
let options;
|
|
85
13
|
try {
|
|
86
14
|
options = parseStandardOptions(args);
|
|
@@ -90,25 +18,3 @@ async function runInit(args, output) {
|
|
|
90
18
|
}
|
|
91
19
|
await scaffoldStandardProject(options, undefined, output);
|
|
92
20
|
}
|
|
93
|
-
const handlers = {
|
|
94
|
-
init: runInit,
|
|
95
|
-
inspect: runInspect,
|
|
96
|
-
integrations: runIntegrations,
|
|
97
|
-
auth: runAuth,
|
|
98
|
-
repository: runRepository,
|
|
99
|
-
doctor: runDoctor,
|
|
100
|
-
services: async (args, output) => printResult('services', await runServiceCommand(process.cwd(), args), output),
|
|
101
|
-
add: runAdd,
|
|
102
|
-
registry: (args, output) => runRegistry(args, Boolean(output.json), output),
|
|
103
|
-
...Object.fromEntries(DELIVERY_COMMANDS.map((command) => [
|
|
104
|
-
command,
|
|
105
|
-
(args, output) => runDelivery(command, args, output),
|
|
106
|
-
])),
|
|
107
|
-
};
|
|
108
|
-
/** Dispatch only after global help, output mode and working-directory handling. */
|
|
109
|
-
export async function runCommand(command, args, output) {
|
|
110
|
-
const handler = Object.hasOwn(handlers, command) ? handlers[command] : undefined;
|
|
111
|
-
if (!handler)
|
|
112
|
-
throw commandArgumentError(command, 'Unknown command. Run anhedral --help.');
|
|
113
|
-
await handler(args, output);
|
|
114
|
-
}
|
package/dist/cli-output.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export interface OutputOptions {
|
|
|
2
2
|
json?: boolean;
|
|
3
3
|
quiet?: boolean;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
export declare function formatResult(command: string, value: unknown): string;
|
|
5
|
+
export declare function formatResult(_command: string, value: unknown): string;
|
|
7
6
|
export declare function printResult(command: string, value: unknown, options?: OutputOptions): void;
|
|
8
7
|
export declare function printProgress(message: string, options?: OutputOptions): void;
|
package/dist/cli-output.js
CHANGED
|
@@ -1,254 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.map(string)
|
|
8
|
-
.join(', ')
|
|
9
|
-
: '';
|
|
10
|
-
function next(lines, action) {
|
|
11
|
-
if (string(action))
|
|
12
|
-
lines.push(`Next: ${string(action)}`);
|
|
13
|
-
}
|
|
14
|
-
function formatInit(data, lines) {
|
|
15
|
-
lines.push(data.generated ? `Created ${string(data.root)}.` : `Stack preview for ${string(data.root)}.`, `Stack: ${names(data.products)}.`, `Hosting: ${string(data.hosting)}.`, '');
|
|
16
|
-
const catalog = record(data.catalog);
|
|
17
|
-
if (catalog.state === 'registered')
|
|
18
|
-
lines.push('Registered in your local Anhedral dashboard.');
|
|
19
|
-
if (catalog.state === 'pending')
|
|
20
|
-
next(lines, catalog.nextAction);
|
|
21
|
-
if (data.generated)
|
|
22
|
-
lines.push('Review the generated source and provider settings in anhedral.json (providers).', 'In the project directory, start development with pnpm dev. Run pnpm check before delivery.', 'Next: anhedral auth, then connect the intended hosting account and preview anhedral ship --dry-run.');
|
|
23
|
-
else
|
|
24
|
-
lines.push('No files, provider resources or deployments were created.');
|
|
25
|
-
}
|
|
26
|
-
function formatServices(data, lines, value) {
|
|
27
|
-
if (Array.isArray(data.services)) {
|
|
28
|
-
lines.push(`${data.services.length} local service entries.`);
|
|
29
|
-
for (const service of entries(data.services))
|
|
30
|
-
lines.push(` ${string(service.key)}${service.state ? ` — ${string(service.state)}` : ''}`);
|
|
31
|
-
}
|
|
32
|
-
else if (Array.isArray(data.points)) {
|
|
33
|
-
lines.push(`Analytics: ${string(data.source)}.`, `Window: ${string(data.start)} to ${string(data.end)} (UTC).`, `${data.points.length} provider data points.`, 'Use --json for the complete aggregate values.');
|
|
34
|
-
}
|
|
35
|
-
else if (Array.isArray(data.rows)) {
|
|
36
|
-
lines.push(`Read ${data.rows.length} rows.`, `Private data${data.masked ? '; sensitive fields are masked' : ''}. Use --json to inspect values.`);
|
|
37
|
-
}
|
|
38
|
-
else if (string(data.token)) {
|
|
39
|
-
lines.push(`Deletion plan: ${string(data.kind)} ${string(data.name)}.`, string(data.impact), `Affected apps: ${names(data.applications) || 'None recorded'}.`, `Expires: ${string(data.expiresAt)}.`, 'Use --json for the single-use confirmation token; deleting requires the exact resource name.');
|
|
40
|
-
}
|
|
41
|
-
else if (Array.isArray(value))
|
|
42
|
-
lines.push(`Tables: ${names(value) || 'None'}.`);
|
|
43
|
-
else
|
|
44
|
-
lines.push(`Service: ${string(data.state) || 'Checked'}.`, string(data.message));
|
|
45
|
-
}
|
|
46
|
-
function formatAdd(data, lines) {
|
|
47
|
-
lines.push(data.dryRun ? 'Addition preview.' : 'Stack parts added.', names(data.items) ? `Parts: ${names(data.items)}.` : 'No new stack parts.', `Project: ${string(data.root)}.`);
|
|
48
|
-
const files = Array.isArray(data.files) ? data.files : [];
|
|
49
|
-
if (files.length)
|
|
50
|
-
lines.push('', ...files.map((file) => ` ${string(file)}`));
|
|
51
|
-
if (data.filesChecked === false)
|
|
52
|
-
lines.push('Source files were not checked: this selection needs the networked web bootstrap.');
|
|
53
|
-
if (names(data.conflicts))
|
|
54
|
-
lines.push(`Conflicts: ${names(data.conflicts)}.`);
|
|
55
|
-
for (const preview of entries(data.previews))
|
|
56
|
-
lines.push('', string(preview.path), string(preview.unavailable ?? preview.diff ?? preview.content));
|
|
57
|
-
if (data.dryRun)
|
|
58
|
-
lines.push('', 'No application files were changed.');
|
|
59
|
-
else
|
|
60
|
-
next(lines, 'Run anhedral doctor and review the selected services’ setup requirements.');
|
|
61
|
-
}
|
|
62
|
-
function formatInspect(data, lines) {
|
|
63
|
-
lines.push(`Project: ${string(data.name) || 'Name unavailable'}.`, 'Local recorded evidence; authentication and live provider status are not checked.');
|
|
64
|
-
const selection = record(record(data.selection).data);
|
|
65
|
-
lines.push(`Stack: ${names(selection.products) || 'Unavailable'}.`);
|
|
66
|
-
for (const target of entries(record(data.targets).data)) {
|
|
67
|
-
const latest = record(target.latestAttempt), successful = record(target.lastSuccessful);
|
|
68
|
-
lines.push(` ${string(target.application)} — ${string(target.provider)} (${string(target.delivery)})`);
|
|
69
|
-
if (string(latest.state))
|
|
70
|
-
lines.push(` Latest recorded target result: ${string(latest.state)}.`);
|
|
71
|
-
if (string(latest.operationState))
|
|
72
|
-
lines.push(` Overall attempt: ${string(latest.operationState)}.`);
|
|
73
|
-
if (string(successful.id))
|
|
74
|
-
lines.push(` Last recorded success: ${string(successful.id)}.`);
|
|
75
|
-
if (string(target.error))
|
|
76
|
-
lines.push(` ${string(target.error)}`);
|
|
77
|
-
}
|
|
78
|
-
for (const check of entries(record(record(data.readiness).data).checks))
|
|
79
|
-
lines.push(` ${check.ok ? 'pass' : 'fail'} ${string(check.id)} — ${string(check.detail)}`);
|
|
80
|
-
for (const key of [
|
|
81
|
-
'selection',
|
|
82
|
-
'workspaces',
|
|
83
|
-
'configuration',
|
|
84
|
-
'targets',
|
|
85
|
-
'setupProviders',
|
|
86
|
-
'integrations',
|
|
87
|
-
'cloudflareResources',
|
|
88
|
-
'readiness',
|
|
89
|
-
'operation',
|
|
90
|
-
]) {
|
|
91
|
-
const section = record(data[key]);
|
|
92
|
-
if (section.state === 'unavailable')
|
|
93
|
-
lines.push(`${key}: ${string(section.error) || 'Unavailable'}.`);
|
|
94
|
-
}
|
|
95
|
-
next(lines, 'Use --json for target-specific records. Review local checks, then explicitly run auth or ship when intended.');
|
|
96
|
-
}
|
|
97
|
-
function formatAuth(data, lines) {
|
|
98
|
-
const checks = entries(data.checks);
|
|
99
|
-
lines.push(checks.length ? 'Provider authentication' : 'This stack requires no provider authentication.');
|
|
100
|
-
for (const check of checks) {
|
|
101
|
-
lines.push(` ${string(check.provider).padEnd(12)}${string(check.state)}${string(check.access) && check.access !== 'none' ? ` (${string(check.access)} access)` : ''}`);
|
|
102
|
-
if (check.state !== 'verified' || check.access === 'runtime')
|
|
103
|
-
next(lines, check.nextAction);
|
|
104
|
-
}
|
|
105
|
-
if (checks.length && string(data.note))
|
|
106
|
-
lines.push(string(data.note));
|
|
107
|
-
if (checks.length)
|
|
108
|
-
next(lines, data.authenticated
|
|
109
|
-
? 'Complete provider settings, connect the intended hosting account, then run anhedral ship --dry-run.'
|
|
110
|
-
: 'Resolve the reported access checks, then repeat anhedral auth --status.');
|
|
111
|
-
}
|
|
112
|
-
function formatIntegrations(data, lines) {
|
|
113
|
-
lines.push(data.recovered
|
|
114
|
-
? 'Integration resource reconciled.'
|
|
115
|
-
: 'Integration receipts (recorded locally).');
|
|
116
|
-
for (const provider of entries(data.providers)) {
|
|
117
|
-
lines.push(` ${string(provider.provider)}`);
|
|
118
|
-
for (const operation of entries(provider.operations))
|
|
119
|
-
lines.push(` ${string(operation.operation)}: ${string(operation.status)}`);
|
|
120
|
-
}
|
|
121
|
-
if (string(data.operation))
|
|
122
|
-
lines.push(`Operation: ${string(data.operation)}`);
|
|
123
|
-
next(lines, data.nextAction ??
|
|
124
|
-
'Use --json to inspect the resource IDs and safe recovery descriptors. Unknown operations must be verified before retrying.');
|
|
125
|
-
}
|
|
126
|
-
function formatRegistry(data, lines) {
|
|
127
|
-
lines.push(`${string(data.name)} (${string(data.type)})`, string(data.description));
|
|
128
|
-
if (names(data.targets))
|
|
129
|
-
lines.push(`Files: ${names(data.targets)}`);
|
|
130
|
-
if (names(data.registryDependencies))
|
|
131
|
-
lines.push(`Requires: ${names(data.registryDependencies)}`);
|
|
132
|
-
const setup = record(data.setup);
|
|
133
|
-
for (const key of ['access', 'credentials', 'resources', 'verify'])
|
|
134
|
-
if (names(setup[key]))
|
|
135
|
-
lines.push(`${key}: ${names(setup[key])}`);
|
|
136
|
-
next(lines, `Inspect anhedral add ${string(data.name)} --dry-run in your project.`);
|
|
137
|
-
}
|
|
138
|
-
function formatDoctor(data, lines) {
|
|
139
|
-
const local = record(data.local);
|
|
140
|
-
const checks = entries(data.checks ?? local.checks);
|
|
141
|
-
lines.push(data.localReady ? 'Local project checks passed.' : 'Local project checks need attention.');
|
|
142
|
-
for (const check of checks) {
|
|
143
|
-
lines.push(` ${check.ok ? 'pass' : 'fail'} ${string(check.id)}${string(check.detail) ? ` — ${string(check.detail)}` : ''}`);
|
|
144
|
-
if (check.ok === false)
|
|
145
|
-
next(lines, check.nextAction);
|
|
146
|
-
}
|
|
147
|
-
if (data.providerVerification)
|
|
148
|
-
lines.push(`Provider evidence: ${string(data.providerVerification)}.`);
|
|
149
|
-
for (const check of entries(data.prerequisiteChecks)) {
|
|
150
|
-
lines.push(` ${check.ok ? 'pass' : 'fail'} ${string(check.id)} — ${string(check.detail)}`);
|
|
151
|
-
if (check.ok === false)
|
|
152
|
-
next(lines, check.nextAction);
|
|
153
|
-
}
|
|
154
|
-
lines.push('Local readiness does not certify production behavior.');
|
|
155
|
-
}
|
|
156
|
-
function formatDeliveryHeader(data, lines, command) {
|
|
157
|
-
const project = record(data.project);
|
|
158
|
-
const release = record(data.release);
|
|
159
|
-
const state = string(data.state ?? release.state);
|
|
160
|
-
lines.push(data.mutation === false
|
|
161
|
-
? `${command}: preview only.`
|
|
162
|
-
: `${command}${state ? `: ${state}` : ': completed'}.`);
|
|
163
|
-
if (string(project.name))
|
|
164
|
-
lines.push(`Project: ${string(project.name)} (${string(project.provider)}).`);
|
|
165
|
-
if (string(release.id))
|
|
166
|
-
lines.push(`Release: ${string(release.id)}`);
|
|
167
|
-
if (string(data.buildId))
|
|
168
|
-
lines.push(`Build: ${string(data.buildId)} (${string(data.platform)}, ${string(data.profile)}).`);
|
|
169
|
-
if (string(data.evidence))
|
|
170
|
-
lines.push(`Evidence: ${string(data.evidence)}.`);
|
|
171
|
-
if (typeof data.activeRecordedVersion === 'boolean')
|
|
172
|
-
lines.push(`Recorded production version: ${data.activeRecordedVersion ? 'active' : 'not confirmed'}.`);
|
|
173
|
-
for (const target of entries(data.provider))
|
|
174
|
-
lines.push(` ${string(target.target)}: ${target.activeRecordedVersion === true ? 'recorded version active' : 'recorded version not confirmed'}`);
|
|
175
|
-
}
|
|
176
|
-
function formatDeliveryResources(data, lines) {
|
|
177
|
-
const release = record(data.release);
|
|
178
|
-
const repository = record(data.repository);
|
|
179
|
-
if (string(repository.nameWithOwner))
|
|
180
|
-
lines.push(`Repository: ${string(repository.nameWithOwner)}`);
|
|
181
|
-
if (string(data.branch))
|
|
182
|
-
lines.push(`Branch: ${string(data.branch)}`);
|
|
183
|
-
for (const resource of entries(record(data.provisioning ?? data).resources))
|
|
184
|
-
lines.push(` ${string(resource.kind)} ${string(resource.name)}${string(resource.target) ? ` (${string(resource.target)})` : ''}`);
|
|
185
|
-
for (const key of ['downloadUrl', 'buildPageUrl', 'managementFile', 'file'])
|
|
186
|
-
if (string(data[key]))
|
|
187
|
-
lines.push(`${key}: ${string(data[key])}`);
|
|
188
|
-
if (string(release.url))
|
|
189
|
-
lines.push(`URL: ${string(release.url)}`);
|
|
190
|
-
}
|
|
191
|
-
function formatDeliveryIntegrations(data, lines) {
|
|
192
|
-
const integration = record(data.integrations);
|
|
193
|
-
for (const provider of entries(integration.providers)) {
|
|
194
|
-
lines.push(` ${string(provider.provider)}${names(provider.missing) ? `: missing ${names(provider.missing)}` : ': configuration selected'}`);
|
|
195
|
-
}
|
|
196
|
-
for (const provider of entries(integration.results)) {
|
|
197
|
-
lines.push(` ${string(provider.provider)}: ${provider.ready ? 'configured' : 'setup pending'}`);
|
|
198
|
-
for (const action of Array.isArray(provider.nextActions) ? provider.nextActions : [])
|
|
199
|
-
next(lines, action);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
function formatDeliveryOperation(data, lines) {
|
|
203
|
-
const operation = record(data.operation);
|
|
204
|
-
if (string(operation.state)) {
|
|
205
|
-
lines.push(`Operation: ${string(operation.state)} (recorded locally).`);
|
|
206
|
-
for (const phase of entries(operation.phases))
|
|
207
|
-
lines.push(` ${string(phase.name)}: ${string(phase.state)}`);
|
|
208
|
-
}
|
|
209
|
-
for (const target of entries(data.targets)) {
|
|
210
|
-
if (string(target.provider)) {
|
|
211
|
-
const result = record(target.result);
|
|
212
|
-
const release = record(result.release);
|
|
213
|
-
lines.push(` ${string(target.provider)}: ${string(target.state ?? result.state ?? release.state) || 'planned'}`);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function formatDelivery(data, lines, _value, command) {
|
|
218
|
-
const project = record(data.project);
|
|
219
|
-
const state = string(data.state ?? record(data.release).state);
|
|
220
|
-
formatDeliveryHeader(data, lines, command);
|
|
221
|
-
formatDeliveryResources(data, lines);
|
|
222
|
-
formatDeliveryIntegrations(data, lines);
|
|
223
|
-
if (data.productVerification)
|
|
224
|
-
lines.push(`Product verification: ${string(data.productVerification)}.`);
|
|
225
|
-
formatDeliveryOperation(data, lines);
|
|
226
|
-
next(lines, data.nextAction);
|
|
227
|
-
if (data.mutation === false)
|
|
228
|
-
lines.push('No provider resources or deployments were changed.');
|
|
229
|
-
else if (!data.nextAction && command === 'ship' && state === 'deployed')
|
|
230
|
-
next(lines, 'Run anhedral verify to exercise the application’s configured acceptance checks.');
|
|
231
|
-
else if (!data.nextAction && command === 'connect')
|
|
232
|
-
next(lines, 'Review and commit the connection manifest, then run anhedral ship --dry-run.');
|
|
233
|
-
if (!state && !data.nextAction && !Object.keys(project).length)
|
|
234
|
-
lines.push('Use --json for the complete recorded evidence.');
|
|
235
|
-
}
|
|
236
|
-
const formatters = {
|
|
237
|
-
init: formatInit,
|
|
238
|
-
services: formatServices,
|
|
239
|
-
add: formatAdd,
|
|
240
|
-
inspect: formatInspect,
|
|
241
|
-
auth: formatAuth,
|
|
242
|
-
integrations: formatIntegrations,
|
|
243
|
-
registry: formatRegistry,
|
|
244
|
-
doctor: formatDoctor,
|
|
245
|
-
};
|
|
246
|
-
/** Human output is an explicit summary, never a recursive dump of provider payloads. */
|
|
247
|
-
export function formatResult(command, value) {
|
|
248
|
-
const lines = [];
|
|
249
|
-
const format = Object.hasOwn(formatters, command) ? formatters[command] : formatDelivery;
|
|
250
|
-
format(record(value), lines, value, command);
|
|
251
|
-
return lines.join('\n').trimEnd();
|
|
1
|
+
export function formatResult(_command, value) {
|
|
2
|
+
const data = value;
|
|
3
|
+
return (`${data.generated ? 'Created' : 'Foundation preview for'} ${data.root}.\nStack: ${data.products.join(', ')}.\n` +
|
|
4
|
+
(data.generated
|
|
5
|
+
? 'Review README.md, then run pnpm dev in the project directory. You own development, integrations and hosting.'
|
|
6
|
+
: 'No files were written or resources provisioned.'));
|
|
252
7
|
}
|
|
253
8
|
export function printResult(command, value, options = {}) {
|
|
254
9
|
if (options.json)
|