anhedral 0.17.0 → 0.19.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 +33 -68
- package/assets/contracts/LICENSE +201 -0
- package/assets/contracts/LICENSE.environment +201 -0
- package/assets/contracts/LICENSE.operations +201 -0
- package/assets/contracts/deployment-provenance.json +15 -0
- package/assets/contracts/environment-provenance.json +11 -0
- package/assets/contracts/operations-provenance.json +12 -0
- package/assets/launch/application.server.ts.txt +13 -0
- package/assets/launch/auth-client.ts.txt +4 -0
- package/assets/launch/home.tsx.txt +20 -0
- package/assets/launch/minimal-application.server.ts.txt +5 -0
- package/assets/launch/minimal-server.ts.txt +7 -0
- package/assets/launch/oj/OJ.LICENSE +21 -0
- package/assets/launch/oj/run.mjs +82 -0
- package/assets/launch/oj/runtime.json +21 -0
- package/assets/launch/request-context.ts.txt +3 -0
- package/assets/launch/root.tsx.txt +26 -0
- package/assets/launch/router.tsx.txt +21 -0
- package/assets/launch/server.ts.txt +15 -0
- package/assets/launch/sign-in.tsx.txt +53 -0
- package/assets/launch/styles.css.txt +19 -0
- package/assets/security/credential-patterns.d.mts +3 -0
- package/assets/security/credential-patterns.mjs +59 -0
- package/assets/stack/api-index.ts.txt +6 -1
- package/assets/stack/stripe.ts.txt +30 -13
- package/assets/ui/catalog.json +36 -324
- package/dist/{platforms/web.d.ts → api-proxy.d.ts} +1 -3
- package/dist/api-proxy.js +48 -0
- package/dist/bin.js +55 -36
- package/dist/capability-catalog.d.ts +36 -57
- package/dist/capability-catalog.js +65 -67
- package/dist/capability-command.d.ts +3 -3
- package/dist/capability-command.js +146 -59
- package/dist/capability-editor.js +6 -5
- package/dist/capability-recipes.js +9 -296
- package/dist/cli-arguments.d.ts +2 -0
- package/dist/cli-arguments.js +101 -50
- package/dist/cli-commands.d.ts +1 -1
- package/dist/cli-commands.js +31 -5
- package/dist/cli-errors.d.ts +18 -0
- package/dist/cli-errors.js +63 -0
- package/dist/cli-output.d.ts +22 -0
- package/dist/cli-output.js +42 -7
- package/dist/command-runner.js +88 -0
- package/dist/command-schema.d.ts +16 -0
- package/dist/command-schema.js +496 -21
- package/dist/command-types.d.ts +1 -0
- package/dist/command-types.js +1 -0
- package/dist/completion.d.ts +2 -0
- package/dist/completion.js +201 -0
- package/dist/composition.d.ts +25 -0
- package/dist/composition.js +28 -0
- package/dist/contracts/cli-transport.d.ts +316 -0
- package/dist/contracts/cli-transport.js +236 -0
- package/dist/contracts/deployment.d.ts +233 -0
- package/dist/contracts/deployment.js +198 -0
- package/dist/contracts/environment-file.d.ts +7 -0
- package/dist/contracts/environment-file.js +112 -0
- package/dist/contracts/environment-transport.d.ts +79 -0
- package/dist/contracts/environment-transport.js +110 -0
- package/dist/contracts/production-transport.d.ts +71 -0
- package/dist/contracts/production-transport.js +56 -0
- package/dist/contracts/runtime-logs-transport.d.ts +127 -0
- package/dist/contracts/runtime-logs-transport.js +50 -0
- package/dist/contracts/source-bundle.d.ts +11 -0
- package/dist/contracts/source-bundle.js +197 -0
- package/dist/contracts/source-profile.d.ts +4 -0
- package/dist/contracts/source-profile.js +5 -0
- package/dist/contracts/staging-transport.d.ts +79 -0
- package/dist/contracts/staging-transport.js +43 -0
- package/dist/dependencies.d.ts +9 -27
- package/dist/dependencies.js +19 -66
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/launch.d.ts +27 -0
- package/dist/launch.js +262 -0
- package/dist/platform-command.d.ts +9 -0
- package/dist/platform-command.js +787 -0
- package/dist/platform-environment.d.ts +18 -0
- package/dist/platform-environment.js +257 -0
- package/dist/platform-operations.d.ts +26 -0
- package/dist/platform-operations.js +155 -0
- package/dist/platform-production.d.ts +16 -0
- package/dist/platform-production.js +135 -0
- package/dist/platform-source.d.ts +8 -0
- package/dist/platform-source.js +111 -0
- package/dist/platform-state.d.ts +15 -0
- package/dist/platform-state.js +229 -0
- package/dist/platforms/tanstack.d.ts +10 -0
- package/dist/platforms/tanstack.js +248 -0
- package/dist/registry/usage.d.ts +4 -1
- package/dist/registry/usage.js +59 -4
- package/dist/scaffold/bootstrap.d.ts +3 -3
- package/dist/scaffold/styling.d.ts +3 -2
- package/dist/transaction.js +28 -3
- package/dist/ui-catalog.d.ts +3 -5
- package/dist/ui-catalog.js +8 -24
- package/dist/ui-command.d.ts +3 -1
- package/dist/ui-command.js +74 -72
- package/dist/ui-project.d.ts +4 -2
- package/dist/ui-project.js +40 -38
- package/dist/util.js +40 -61
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/capabilities.md +23 -89
- package/docs/software-factory.md +208 -9
- package/docs/stack-standard.md +7 -17
- package/docs/ui.md +9 -22
- package/package.json +26 -22
- package/assets/stack/ai-schema.ts.txt +0 -5
- package/assets/stack/ai.ts.txt +0 -30
- package/assets/stack/desktop.rs.txt +0 -21
- package/assets/stack/events-schema.ts.txt +0 -12
- package/assets/stack/events.ts.txt +0 -59
- package/assets/stack/mobile-auth.ts.txt +0 -25
- package/assets/stack/mobile-billing.tsx.txt +0 -63
- package/assets/stack/mobile-session.tsx.txt +0 -83
- package/assets/stack/native-button.tsx.txt +0 -108
- package/assets/stack/native-global.css.txt +0 -4
- package/assets/stack/native-lib-utils.ts.txt +0 -5
- package/assets/stack/native-metro.config.js.txt +0 -6
- package/assets/stack/native-nativewind-env.d.ts.txt +0 -1
- package/assets/stack/native-tailwind.config.js.txt +0 -73
- package/assets/stack/native-text.tsx.txt +0 -89
- package/assets/stack/purchases.ts.txt +0 -65
- package/assets/stack/revenuecat.ts.txt +0 -88
- package/assets/stack/rtc-schema.ts.txt +0 -10
- package/assets/stack/rtc.ts.txt +0 -122
- package/assets/stack/web-sign-in.tsx.txt +0 -51
- package/dist/capabilities.d.ts +0 -11
- package/dist/capabilities.js +0 -14
- package/dist/dependency-order.d.ts +0 -2
- package/dist/dependency-order.js +0 -24
- package/dist/platforms/lint.d.ts +0 -1
- package/dist/platforms/lint.js +0 -5
- package/dist/platforms/web.js +0 -251
- package/dist/project-config.d.ts +0 -3
- package/dist/project-config.js +0 -16
- package/dist/registry/context.d.ts +0 -3
- package/dist/registry/context.js +0 -20
- package/dist/registry/options.d.ts +0 -2
- package/dist/registry/options.js +0 -44
- package/dist/registry/resolve.d.ts +0 -11
- package/dist/registry/resolve.js +0 -46
- package/dist/registry/types.d.ts +0 -60
- package/dist/scaffold/api.d.ts +0 -2
- package/dist/scaffold/api.js +0 -38
- package/dist/scaffold/backend.d.ts +0 -2
- package/dist/scaffold/backend.js +0 -36
- package/dist/scaffold/compose.d.ts +0 -4
- package/dist/scaffold/compose.js +0 -30
- package/dist/scaffold/database.d.ts +0 -2
- package/dist/scaffold/database.js +0 -41
- package/dist/scaffold/documentation.d.ts +0 -2
- package/dist/scaffold/documentation.js +0 -71
- package/dist/scaffold/environment.d.ts +0 -4
- package/dist/scaffold/environment.js +0 -22
- package/dist/scaffold/stack-documentation.d.ts +0 -2
- package/dist/scaffold/stack-documentation.js +0 -6
- package/dist/scaffold/storage.d.ts +0 -2
- package/dist/scaffold/storage.js +0 -21
- package/dist/scaffold/workspace.d.ts +0 -3
- package/dist/scaffold/workspace.js +0 -131
- package/dist/stack-registry.d.ts +0 -35
- package/dist/stack-registry.js +0 -189
- package/dist/standard.d.ts +0 -8
- package/dist/standard.js +0 -94
- package/dist/workspace-graph.d.ts +0 -7
- package/dist/workspace-graph.js +0 -74
- package/docs/anhedral-stack.md +0 -12
- package/docs/assets/anhedral-stack-light.png +0 -0
- package/docs/assets/anhedral-stack.png +0 -0
- package/docs/native-ui.md +0 -47
- /package/dist/{registry/types.js → command-runner.d.ts} +0 -0
package/dist/command-schema.js
CHANGED
|
@@ -3,10 +3,13 @@ export const GLOBAL_OPTIONS = [
|
|
|
3
3
|
flag: '--cwd',
|
|
4
4
|
aliases: ['-c'],
|
|
5
5
|
value: 'directory',
|
|
6
|
+
kind: 'directory',
|
|
6
7
|
arity: 'required',
|
|
7
8
|
description: 'Run from a selected working directory.',
|
|
8
9
|
},
|
|
9
10
|
{ flag: '--json', description: 'Return machine-readable output.' },
|
|
11
|
+
{ flag: '--human', description: 'Explicitly format Platform output for people.' },
|
|
12
|
+
{ flag: '--non-interactive', description: 'Never prompt or start interactive approval polling.' },
|
|
10
13
|
{
|
|
11
14
|
flag: '--quiet',
|
|
12
15
|
aliases: ['-q'],
|
|
@@ -25,11 +28,426 @@ export function optionHelp(option) {
|
|
|
25
28
|
return `${flags}${argument} ${option.description}`;
|
|
26
29
|
}
|
|
27
30
|
export function commandDefinition(command) {
|
|
28
|
-
return COMMANDS[command
|
|
31
|
+
return command && Object.hasOwn(COMMANDS, command) ? COMMANDS[command] : undefined;
|
|
29
32
|
}
|
|
33
|
+
const PLATFORM_OPTIONS = [
|
|
34
|
+
{
|
|
35
|
+
flag: '--api-url',
|
|
36
|
+
value: 'origin',
|
|
37
|
+
arity: 'required',
|
|
38
|
+
description: 'Explicit Platform API origin; defaults to https://platform.anhedral.com.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
flag: '--credential-file',
|
|
42
|
+
value: 'file',
|
|
43
|
+
kind: 'file',
|
|
44
|
+
arity: 'required',
|
|
45
|
+
description: 'Explicit owner-only credential file instead of the OS secret store.',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
const ENVIRONMENT_OPTIONS = [
|
|
49
|
+
...PLATFORM_OPTIONS,
|
|
50
|
+
{
|
|
51
|
+
flag: '--environment',
|
|
52
|
+
value: 'staging|production',
|
|
53
|
+
arity: 'required',
|
|
54
|
+
choices: ['staging', 'production'],
|
|
55
|
+
description: 'Select the target environment explicitly.',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
flag: '--file',
|
|
59
|
+
value: 'file',
|
|
60
|
+
kind: 'file',
|
|
61
|
+
arity: 'required',
|
|
62
|
+
description: 'Read an owner-only UTF-8 file (up to64KiB); never put values in arguments.',
|
|
63
|
+
},
|
|
64
|
+
{ flag: '--stdin', description: 'Read private UTF-8 input from a pipe.' },
|
|
65
|
+
{
|
|
66
|
+
flag: '--type',
|
|
67
|
+
value: 'secret|config',
|
|
68
|
+
arity: 'required',
|
|
69
|
+
choices: ['secret', 'config'],
|
|
70
|
+
description: 'Set the variable type; public prefixes default to config, others to secret.',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
flag: '--replace',
|
|
74
|
+
description: 'Explicitly allow replacing existing variables with version checks.',
|
|
75
|
+
},
|
|
76
|
+
{ flag: '--new', description: 'Start another import instead of resuming saved identity.' },
|
|
77
|
+
{ flag: '--dry-run', description: 'Validate input locally and print names and types only.' },
|
|
78
|
+
];
|
|
79
|
+
const STAGING_OPTIONS = [
|
|
80
|
+
...PLATFORM_OPTIONS,
|
|
81
|
+
{
|
|
82
|
+
flag: '--candidate',
|
|
83
|
+
value: 'uuid',
|
|
84
|
+
arity: 'required',
|
|
85
|
+
description: 'Select a ready, runtime-verified deployment candidate.',
|
|
86
|
+
},
|
|
87
|
+
{ flag: '--new', description: 'Start a new staging deployment using the current generation.' },
|
|
88
|
+
];
|
|
89
|
+
const PRODUCTION_OPTIONS = [
|
|
90
|
+
...PLATFORM_OPTIONS,
|
|
91
|
+
{
|
|
92
|
+
flag: '--candidate',
|
|
93
|
+
value: 'uuid',
|
|
94
|
+
arity: 'required',
|
|
95
|
+
description: 'Select a ready, runtime-verified deployment candidate.',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
flag: '--name',
|
|
99
|
+
value: 'slug',
|
|
100
|
+
arity: 'required',
|
|
101
|
+
description: 'Select the public application name for production.',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
flag: '--new',
|
|
105
|
+
description: 'Start another production deployment using the current generation.',
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
const PROJECT_OPTIONS = [
|
|
109
|
+
...PLATFORM_OPTIONS,
|
|
110
|
+
{
|
|
111
|
+
flag: '--team',
|
|
112
|
+
value: 'uuid',
|
|
113
|
+
arity: 'required',
|
|
114
|
+
description: 'Team ID; defaults to your selected team.',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
flag: '--limit',
|
|
118
|
+
value: 'count',
|
|
119
|
+
arity: 'required',
|
|
120
|
+
description: 'List 1–100 projects (default 50).',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
flag: '--cursor',
|
|
124
|
+
value: 'uuid',
|
|
125
|
+
arity: 'required',
|
|
126
|
+
description: 'Resume listing after this project ID.',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
flag: '--name',
|
|
130
|
+
value: 'text',
|
|
131
|
+
arity: 'required',
|
|
132
|
+
description: 'New project name (1–160 characters).',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
flag: '--summary',
|
|
136
|
+
value: 'text',
|
|
137
|
+
arity: 'required',
|
|
138
|
+
description: 'Optional project summary (up to 2000 characters).',
|
|
139
|
+
},
|
|
140
|
+
{ flag: '--link', description: 'Verify build access and save a local link after creation.' },
|
|
141
|
+
{ flag: '--dry-run', description: 'Validate creation locally without authentication or writes.' },
|
|
142
|
+
{
|
|
143
|
+
flag: '--new',
|
|
144
|
+
description: 'Start a new creation request instead of retrying the saved request.',
|
|
145
|
+
},
|
|
146
|
+
];
|
|
30
147
|
export const COMMANDS = {
|
|
148
|
+
completion: {
|
|
149
|
+
description: 'Print an offline shell completion script.',
|
|
150
|
+
usage: 'completion <bash|zsh>',
|
|
151
|
+
options: [],
|
|
152
|
+
positional: { name: 'shell', min: 1, max: 1, kind: 'value', choices: ['bash', 'zsh'] },
|
|
153
|
+
examples: ['completion bash', 'completion zsh'],
|
|
154
|
+
note: 'Prints the script only; never edits your shell profile or contacts Platform.',
|
|
155
|
+
},
|
|
156
|
+
login: {
|
|
157
|
+
description: 'Approve a short-lived CLI session in your browser.',
|
|
158
|
+
usage: 'login [--start|--resume]',
|
|
159
|
+
options: [
|
|
160
|
+
...PLATFORM_OPTIONS,
|
|
161
|
+
{ flag: '--start', description: 'Start approval and return without polling.' },
|
|
162
|
+
{ flag: '--resume', description: 'Resume saved browser approval.' },
|
|
163
|
+
],
|
|
164
|
+
conflicts: [['--start', '--resume']],
|
|
165
|
+
examples: ['login', 'login --start --json', 'login --resume'],
|
|
166
|
+
note: 'Device secrets and API tokens stay in your credential store. Server CLI access must be configured.',
|
|
167
|
+
},
|
|
168
|
+
logout: {
|
|
169
|
+
description: 'Revoke this CLI session.',
|
|
170
|
+
usage: 'logout',
|
|
171
|
+
options: PLATFORM_OPTIONS,
|
|
172
|
+
examples: ['logout'],
|
|
173
|
+
note: 'Revokes server access before clearing local credentials.',
|
|
174
|
+
},
|
|
175
|
+
whoami: {
|
|
176
|
+
description: 'Show the current CLI identity.',
|
|
177
|
+
usage: 'whoami',
|
|
178
|
+
options: [
|
|
179
|
+
...PLATFORM_OPTIONS,
|
|
180
|
+
{
|
|
181
|
+
flag: '--context',
|
|
182
|
+
description: 'Include local project and credential provenance without exposing secrets.',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
examples: ['whoami --json', 'whoami --context --human'],
|
|
186
|
+
},
|
|
187
|
+
projects: {
|
|
188
|
+
description: 'List or create Platform projects.',
|
|
189
|
+
usage: 'projects <list|create> [options]',
|
|
190
|
+
options: PROJECT_OPTIONS,
|
|
191
|
+
children: {
|
|
192
|
+
list: {
|
|
193
|
+
description: 'List accessible projects and available teams.',
|
|
194
|
+
usage: 'projects list [--team <uuid>] [--limit <count>] [--cursor <uuid>]',
|
|
195
|
+
options: PROJECT_OPTIONS.filter((option) => ['--api-url', '--credential-file', '--team', '--limit', '--cursor'].includes(option.flag)),
|
|
196
|
+
examples: ['projects list --human'],
|
|
197
|
+
},
|
|
198
|
+
create: {
|
|
199
|
+
description: 'Create a source-upload project with a durable retry identity.',
|
|
200
|
+
usage: 'projects create --name <text> [--summary <text>] [--team <uuid>] [--link] [--dry-run] [--new]',
|
|
201
|
+
options: PROJECT_OPTIONS.filter((option) => !['--limit', '--cursor'].includes(option.flag)),
|
|
202
|
+
examples: [
|
|
203
|
+
'projects create --name "My app" --dry-run',
|
|
204
|
+
'projects create --name "My app" --link',
|
|
205
|
+
],
|
|
206
|
+
note: 'Retries reuse the saved request. Changed input or context requires --new. Creation does not generate source or deploy.',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
examples: ['projects list', 'projects create --name "My app"'],
|
|
210
|
+
},
|
|
211
|
+
link: {
|
|
212
|
+
description: 'Link this workspace to an existing project.',
|
|
213
|
+
usage: 'link --project <uuid> --team <uuid>',
|
|
214
|
+
options: [
|
|
215
|
+
...PLATFORM_OPTIONS,
|
|
216
|
+
{ flag: '--project', value: 'uuid', arity: 'required', description: 'Existing project ID.' },
|
|
217
|
+
{ flag: '--team', value: 'uuid', arity: 'required', description: 'Owning team ID.' },
|
|
218
|
+
],
|
|
219
|
+
examples: ['link --project <uuid> --team <uuid>'],
|
|
220
|
+
note: 'Requires current project build access. Existing application identities are preserved.',
|
|
221
|
+
},
|
|
222
|
+
unlink: {
|
|
223
|
+
description: 'Remove the local project link.',
|
|
224
|
+
usage: 'unlink',
|
|
225
|
+
options: PLATFORM_OPTIONS,
|
|
226
|
+
examples: ['unlink'],
|
|
227
|
+
},
|
|
228
|
+
deploy: {
|
|
229
|
+
description: 'Plan deployment and reserve a candidate from sealed source.',
|
|
230
|
+
usage: 'deploy <plan|prepare|status> [options]',
|
|
231
|
+
options: [
|
|
232
|
+
...PLATFORM_OPTIONS,
|
|
233
|
+
{
|
|
234
|
+
flag: '--manifest',
|
|
235
|
+
value: 'file',
|
|
236
|
+
kind: 'file',
|
|
237
|
+
arity: 'required',
|
|
238
|
+
description: 'Explicit deployment manifest matching sealed source.',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
flag: '--new',
|
|
242
|
+
description: 'Explicitly create a new plan request after inputs or routing change.',
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
children: {
|
|
246
|
+
plan: {
|
|
247
|
+
description: 'Plan a candidate from the saved sealed source.',
|
|
248
|
+
usage: 'deploy plan --manifest <file> [--new]',
|
|
249
|
+
options: [
|
|
250
|
+
...PLATFORM_OPTIONS,
|
|
251
|
+
{
|
|
252
|
+
flag: '--manifest',
|
|
253
|
+
value: 'file',
|
|
254
|
+
kind: 'file',
|
|
255
|
+
arity: 'required',
|
|
256
|
+
description: 'Deployment manifest matching sealed source.',
|
|
257
|
+
},
|
|
258
|
+
{ flag: '--new', description: 'Explicitly create a new plan request.' },
|
|
259
|
+
],
|
|
260
|
+
examples: [
|
|
261
|
+
'deploy plan --manifest deployment.json',
|
|
262
|
+
'deploy plan --manifest deployment.json --json',
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
prepare: {
|
|
266
|
+
description: 'Reserve an immutable candidate from the saved plan.',
|
|
267
|
+
usage: 'deploy prepare',
|
|
268
|
+
options: PLATFORM_OPTIONS,
|
|
269
|
+
examples: ['deploy prepare', 'deploy prepare --json'],
|
|
270
|
+
},
|
|
271
|
+
status: {
|
|
272
|
+
description: 'Inspect the saved deployment plan or candidate.',
|
|
273
|
+
usage: 'deploy status',
|
|
274
|
+
options: PLATFORM_OPTIONS,
|
|
275
|
+
examples: ['deploy status', 'deploy status --json'],
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
examples: ['deploy plan --manifest deployment.json', 'deploy prepare', 'deploy status'],
|
|
279
|
+
note: 'Preparation reserves a candidate; server policy controls build admission. No preview or deployment is activated.',
|
|
280
|
+
},
|
|
281
|
+
env: {
|
|
282
|
+
description: 'Manage project configuration and write-only secrets through Platform.',
|
|
283
|
+
usage: 'env <list|import|set> [options]',
|
|
284
|
+
options: ENVIRONMENT_OPTIONS,
|
|
285
|
+
children: {
|
|
286
|
+
list: {
|
|
287
|
+
description: 'List names, types and versions; values are never returned.',
|
|
288
|
+
usage: 'env list [--environment staging|production]',
|
|
289
|
+
options: ENVIRONMENT_OPTIONS.filter((option) => ['--api-url', '--credential-file', '--environment'].includes(option.flag)),
|
|
290
|
+
examples: ['env list --json'],
|
|
291
|
+
},
|
|
292
|
+
import: {
|
|
293
|
+
description: 'Import a private dotenv file atomically.',
|
|
294
|
+
usage: 'env import --environment staging|production --file <file> [--replace] [--new]',
|
|
295
|
+
options: ENVIRONMENT_OPTIONS,
|
|
296
|
+
examples: [
|
|
297
|
+
'env import --environment staging --file .env.local --dry-run',
|
|
298
|
+
'env import --environment production --stdin --replace --new',
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
set: {
|
|
302
|
+
description: 'Set one variable from a private file or stdin.',
|
|
303
|
+
usage: 'env set <NAME> --environment staging|production --stdin [--replace] [--new]',
|
|
304
|
+
options: ENVIRONMENT_OPTIONS,
|
|
305
|
+
positional: { name: 'NAME', min: 1, max: 1 },
|
|
306
|
+
examples: ['env set SERVICE_API_KEY --environment staging --stdin'],
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
conflicts: [['--file', '--stdin']],
|
|
310
|
+
examples: ['env list', 'env import --environment staging --file .env.local --dry-run'],
|
|
311
|
+
note: 'Values never appear in output or retry state. Platform enforces project roles and production approvals; saving configuration does not change an existing deployment.',
|
|
312
|
+
},
|
|
313
|
+
staging: {
|
|
314
|
+
description: 'Manage persistent staging deployments for the linked project.',
|
|
315
|
+
usage: 'staging <status|deploy> [options]',
|
|
316
|
+
options: STAGING_OPTIONS,
|
|
317
|
+
positional: { name: 'operation', min: 1, max: 1, choices: ['status', 'deploy'] },
|
|
318
|
+
children: {
|
|
319
|
+
status: {
|
|
320
|
+
description: 'Read staging history and active deployment.',
|
|
321
|
+
usage: 'staging status',
|
|
322
|
+
options: PLATFORM_OPTIONS,
|
|
323
|
+
positional: { name: 'operation', min: 0, max: 0 },
|
|
324
|
+
examples: ['staging status --json'],
|
|
325
|
+
},
|
|
326
|
+
deploy: {
|
|
327
|
+
description: 'Deploy a ready candidate to staging.',
|
|
328
|
+
usage: 'staging deploy --candidate <uuid> [--new]',
|
|
329
|
+
options: STAGING_OPTIONS,
|
|
330
|
+
positional: { name: 'operation', min: 0, max: 0 },
|
|
331
|
+
examples: ['staging deploy --candidate <uuid>'],
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
examples: ['staging status', 'staging deploy --candidate <uuid>'],
|
|
335
|
+
note: 'Retried requests retain the same identity and generation. Configuration is frozen for each new staging deployment; production approval stays in Platform.',
|
|
336
|
+
},
|
|
337
|
+
production: {
|
|
338
|
+
description: 'Deploy a ready candidate with your current production permissions.',
|
|
339
|
+
usage: 'production <status|deploy> [options]',
|
|
340
|
+
options: PRODUCTION_OPTIONS,
|
|
341
|
+
positional: { name: 'operation', min: 1, max: 1, choices: ['status', 'deploy'] },
|
|
342
|
+
children: {
|
|
343
|
+
status: {
|
|
344
|
+
description: 'Read production history and active deployment.',
|
|
345
|
+
usage: 'production status',
|
|
346
|
+
options: PLATFORM_OPTIONS,
|
|
347
|
+
positional: { name: 'operation', min: 0, max: 0 },
|
|
348
|
+
examples: ['production status --json'],
|
|
349
|
+
},
|
|
350
|
+
deploy: {
|
|
351
|
+
description: 'Request production publication of a ready candidate.',
|
|
352
|
+
usage: 'production deploy --candidate <uuid> --name <slug> [--new]',
|
|
353
|
+
options: PRODUCTION_OPTIONS,
|
|
354
|
+
positional: { name: 'operation', min: 0, max: 0 },
|
|
355
|
+
examples: ['production deploy --candidate <uuid> --name my-app'],
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
examples: ['production status', 'production deploy --candidate <uuid> --name my-app'],
|
|
359
|
+
note: 'Platform checks current production permissions and freezes configuration. Self-service teams need no second approver; an explicitly required independent review remains enforced.',
|
|
360
|
+
},
|
|
361
|
+
logs: {
|
|
362
|
+
description: 'Read redacted runtime logs for the linked project.',
|
|
363
|
+
usage: 'logs [options]',
|
|
364
|
+
positional: { name: 'arguments', min: 0, max: 0 },
|
|
365
|
+
options: [
|
|
366
|
+
...PLATFORM_OPTIONS,
|
|
367
|
+
{
|
|
368
|
+
flag: '--environment',
|
|
369
|
+
value: 'staging|production',
|
|
370
|
+
arity: 'required',
|
|
371
|
+
choices: ['staging', 'production'],
|
|
372
|
+
description: 'Choose the environment (default: staging).',
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
flag: '--deployment',
|
|
376
|
+
value: 'uuid',
|
|
377
|
+
arity: 'required',
|
|
378
|
+
description: 'Filter one deployment.',
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
flag: '--level',
|
|
382
|
+
value: 'level',
|
|
383
|
+
arity: 'required',
|
|
384
|
+
choices: ['debug', 'info', 'warn', 'error'],
|
|
385
|
+
description: 'Filter the event level.',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
flag: '--source',
|
|
389
|
+
value: 'source',
|
|
390
|
+
arity: 'required',
|
|
391
|
+
choices: ['request', 'console', 'exception'],
|
|
392
|
+
description: 'Filter request, console or exception events.',
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
flag: '--range',
|
|
396
|
+
value: 'range',
|
|
397
|
+
arity: 'required',
|
|
398
|
+
choices: ['1h', '24h', '7d'],
|
|
399
|
+
description: 'Choose a time range (default: 24h).',
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
flag: '--search',
|
|
403
|
+
value: 'text',
|
|
404
|
+
arity: 'required',
|
|
405
|
+
description: 'Search redacted message text.',
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
flag: '--cursor',
|
|
409
|
+
value: 'cursor',
|
|
410
|
+
arity: 'required',
|
|
411
|
+
description: 'Read the next page using a returned cursor.',
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
examples: [
|
|
415
|
+
'logs --environment staging --level error --json',
|
|
416
|
+
'logs --environment production --range 1h',
|
|
417
|
+
],
|
|
418
|
+
note: 'Runtime collection is best effort and reports unavailable coverage and dropped events. Retention is seven days; source/build logs remain separate.',
|
|
419
|
+
},
|
|
420
|
+
source: {
|
|
421
|
+
description: 'Upload an immutable source checkpoint with resumable chunks.',
|
|
422
|
+
usage: 'source <upload|status> [options]',
|
|
423
|
+
options: [
|
|
424
|
+
...PLATFORM_OPTIONS,
|
|
425
|
+
{ flag: '--dry-run', description: 'Package and inspect source without upload.' },
|
|
426
|
+
{ flag: '--new', description: 'Explicitly start a new request after changing source.' },
|
|
427
|
+
],
|
|
428
|
+
children: {
|
|
429
|
+
upload: {
|
|
430
|
+
description: 'Upload immutable source, resuming the saved request.',
|
|
431
|
+
usage: 'source upload [--dry-run] [--new]',
|
|
432
|
+
options: [
|
|
433
|
+
...PLATFORM_OPTIONS,
|
|
434
|
+
{ flag: '--dry-run', description: 'Inspect source locally without upload.' },
|
|
435
|
+
{ flag: '--new', description: 'Explicitly begin a new immutable request.' },
|
|
436
|
+
],
|
|
437
|
+
examples: ['source upload --dry-run --json', 'source upload'],
|
|
438
|
+
},
|
|
439
|
+
status: {
|
|
440
|
+
description: 'Read the saved upload receipt.',
|
|
441
|
+
usage: 'source status',
|
|
442
|
+
options: PLATFORM_OPTIONS,
|
|
443
|
+
examples: ['source status', 'source status --json'],
|
|
444
|
+
},
|
|
445
|
+
},
|
|
446
|
+
examples: ['source upload --dry-run', 'source upload', 'source status'],
|
|
447
|
+
note: 'Honors .gitignore, excludes secrets and generated files, rejects symlinks and credential material. Sealing source does not enable hosted admission or deploy.',
|
|
448
|
+
},
|
|
31
449
|
add: {
|
|
32
|
-
description: 'Add
|
|
450
|
+
description: 'Add backend, private storage or payments to the Anhedral Stack.',
|
|
33
451
|
usage: 'add <capabilities...> [options]',
|
|
34
452
|
options: [
|
|
35
453
|
{ flag: '--with-dependencies', description: 'Explicitly include missing prerequisites.' },
|
|
@@ -39,40 +457,76 @@ export const COMMANDS = {
|
|
|
39
457
|
description: 'Preview every file and prerequisite without writes or network.',
|
|
40
458
|
},
|
|
41
459
|
],
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'add database-auth',
|
|
45
|
-
'add expo native-ui stripe revenuecat --with-dependencies --dry-run --json',
|
|
46
|
-
],
|
|
460
|
+
positional: { name: 'capabilities', min: 1, max: 50, kind: 'capability' },
|
|
461
|
+
examples: ['add backend', 'add r2', 'add r2 stripe --with-dependencies --dry-run --json'],
|
|
47
462
|
note: 'Adds source and local configuration only. Existing edits are preserved. No provisioning, credential installation, migration or deployment.',
|
|
48
463
|
},
|
|
49
464
|
stack: {
|
|
50
|
-
description: '
|
|
465
|
+
description: 'Inspect the Anhedral Stack and its three optional additions.',
|
|
51
466
|
usage: 'stack <list|status|doctor>',
|
|
52
467
|
options: [],
|
|
468
|
+
children: {
|
|
469
|
+
list: {
|
|
470
|
+
description: 'Show the Anhedral Stack foundation and optional additions.',
|
|
471
|
+
usage: 'stack list',
|
|
472
|
+
options: [],
|
|
473
|
+
examples: ['stack list', 'stack list --json'],
|
|
474
|
+
},
|
|
475
|
+
status: {
|
|
476
|
+
description: 'Inspect installed Anhedral Stack additions.',
|
|
477
|
+
usage: 'stack status',
|
|
478
|
+
options: [],
|
|
479
|
+
examples: ['stack status --json'],
|
|
480
|
+
},
|
|
481
|
+
doctor: {
|
|
482
|
+
description: 'Check source completeness and prerequisites.',
|
|
483
|
+
usage: 'stack doctor',
|
|
484
|
+
options: [],
|
|
485
|
+
examples: ['stack doctor', 'stack doctor --json'],
|
|
486
|
+
},
|
|
487
|
+
},
|
|
53
488
|
examples: ['stack list', 'stack status --json', 'stack doctor'],
|
|
54
489
|
note: 'Installed source is not proof of live provider activation.',
|
|
55
490
|
},
|
|
56
491
|
ui: {
|
|
57
|
-
description: '
|
|
492
|
+
description: 'Source-owned web UI for the Anhedral Stack.',
|
|
58
493
|
usage: 'ui <init|add|list|diff|doctor> [components...] [options]',
|
|
59
494
|
options: [
|
|
60
|
-
{ flag: '--web', description: 'Select the
|
|
61
|
-
{ flag: '--native', description: 'Select the Expo/NativeWind 4 application.' },
|
|
62
|
-
{ flag: '--all', description: 'Explicitly select every web/native application.' },
|
|
495
|
+
{ flag: '--web', description: 'Select the Anhedral Stack web application.' },
|
|
63
496
|
{ flag: '--dry-run', description: 'Show the installer plan without writes or network.' },
|
|
64
497
|
],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
498
|
+
children: Object.fromEntries(['init', 'add', 'list', 'diff', 'doctor'].map((action) => [
|
|
499
|
+
action,
|
|
500
|
+
{
|
|
501
|
+
description: {
|
|
502
|
+
init: 'Initialize Anhedral UI configuration.',
|
|
503
|
+
add: 'Install selected UI components.',
|
|
504
|
+
list: 'List available Anhedral Stack web components.',
|
|
505
|
+
diff: 'Inspect differences for selected UI components.',
|
|
506
|
+
doctor: 'Check UI configuration.',
|
|
507
|
+
}[action],
|
|
508
|
+
usage: `ui ${action}${['add', 'diff'].includes(action) ? ' <components...>' : ''} [options]`,
|
|
509
|
+
options: [
|
|
510
|
+
{ flag: '--web', description: 'Select the Anhedral Stack web application.' },
|
|
511
|
+
{ flag: '--dry-run', description: 'Preview without writes or network.' },
|
|
512
|
+
],
|
|
513
|
+
positional: {
|
|
514
|
+
name: 'components',
|
|
515
|
+
min: ['add', 'diff'].includes(action) ? 1 : 0,
|
|
516
|
+
max: ['add', 'diff'].includes(action) ? 50 : 0,
|
|
517
|
+
kind: 'component',
|
|
518
|
+
},
|
|
519
|
+
examples: [
|
|
520
|
+
`ui ${action}${['add', 'diff'].includes(action) ? ' button --web' : ''}`,
|
|
521
|
+
`ui ${action}${['add', 'diff'].includes(action) ? ' button --web' : ''} --json`,
|
|
522
|
+
],
|
|
523
|
+
},
|
|
524
|
+
])),
|
|
525
|
+
examples: ['ui list', 'ui add button --web', 'ui diff button', 'ui doctor'],
|
|
526
|
+
note: 'Web component installation uses the pinned official shadcn CLI. No automatic overwrite or provider operations.',
|
|
73
527
|
},
|
|
74
528
|
init: {
|
|
75
|
-
description: '
|
|
529
|
+
description: 'Create the Anhedral Stack: web UI first, then add backend, storage and payments.',
|
|
76
530
|
usage: 'init [directory] [options]',
|
|
77
531
|
options: [
|
|
78
532
|
{ flag: '--skip-install', description: 'Write source without installing dependencies.' },
|
|
@@ -80,6 +534,8 @@ export const COMMANDS = {
|
|
|
80
534
|
{ flag: '--no-git', description: 'Skip Git initialization.' },
|
|
81
535
|
{ flag: '--dry-run', description: 'Preview the foundation without writes or network.' },
|
|
82
536
|
],
|
|
537
|
+
positional: { name: 'directory', min: 0, max: 1, kind: 'directory' },
|
|
538
|
+
conflicts: [['--git', '--no-git']],
|
|
83
539
|
examples: [
|
|
84
540
|
'init my-app',
|
|
85
541
|
'init my-app --dry-run --json',
|
|
@@ -88,3 +544,22 @@ export const COMMANDS = {
|
|
|
88
544
|
note: 'Generated source belongs to you. Application features, authentication, payments and hosting are your responsibility. Init never provisions or deploys resources.',
|
|
89
545
|
},
|
|
90
546
|
};
|
|
547
|
+
/** Complete topic lookup; leaf options are contextual while parser acceptance stays compatible. */
|
|
548
|
+
export function commandTopic(topic) {
|
|
549
|
+
let definition = commandDefinition(topic[0]);
|
|
550
|
+
for (const part of topic.slice(1)) {
|
|
551
|
+
if (!definition?.children || !Object.hasOwn(definition.children, part))
|
|
552
|
+
return undefined;
|
|
553
|
+
const child = definition.children[part];
|
|
554
|
+
definition = {
|
|
555
|
+
...child,
|
|
556
|
+
note: child.note ?? definition.note,
|
|
557
|
+
conflicts: child.conflicts ?? definition.conflicts,
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
return definition;
|
|
561
|
+
}
|
|
562
|
+
/** Family options remain accepted before/after a child for existing scripts. */
|
|
563
|
+
export function commandOptions(command) {
|
|
564
|
+
return [...(commandDefinition(command)?.options ?? []), ...GLOBAL_OPTIONS];
|
|
565
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type CommandRunner = (command: string, args: string[], cwd: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|