anhedral 0.11.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -69
- package/dist/bin.js +48 -493
- package/dist/capabilities.d.ts +3 -3
- package/dist/capability-contract.js +4 -0
- package/dist/cli-arguments.d.ts +8 -0
- package/dist/cli-arguments.js +32 -0
- package/dist/cli-commands.d.ts +3 -0
- package/dist/cli-commands.js +114 -0
- package/dist/cli-delivery.d.ts +3 -0
- package/dist/cli-delivery.js +172 -0
- package/dist/cli-output.js +231 -205
- package/dist/delivery-evidence.d.ts +62 -0
- package/dist/delivery-evidence.js +186 -0
- package/dist/delivery.d.ts +3 -40
- package/dist/delivery.js +4 -181
- package/dist/dependencies.d.ts +1 -0
- package/dist/dependencies.js +2 -0
- package/dist/mobile-delivery.d.ts +21 -44
- package/dist/mobile-delivery.js +127 -80
- package/dist/provider-auth.js +3 -3
- package/dist/scaffold/documentation.js +1 -0
- package/dist/scaffold/stream.d.ts +2 -0
- package/dist/scaffold/stream.js +114 -0
- package/dist/service-readers.js +1 -1
- package/dist/services-command.js +8 -6
- package/dist/ship.d.ts +15 -15
- package/dist/stack-registry.d.ts +4 -2
- package/dist/stack-registry.js +16 -0
- package/dist/transaction-lock.d.ts +15 -0
- package/dist/transaction-lock.js +227 -0
- package/dist/transaction.js +2 -208
- package/dist/vercel-project.d.ts +101 -0
- package/dist/vercel-project.js +305 -0
- package/dist/vercel.d.ts +3 -36
- package/dist/vercel.js +3 -300
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/software-factory.md +528 -0
- package/docs/stack-standard.md +196 -121
- package/docs/verification.md +444 -0
- package/package.json +3 -6
- package/docs/cli-design.md +0 -67
- package/docs/delivery-workflow.md +0 -98
- package/docs/plugin-ui.md +0 -102
- package/docs/provider-configuration.md +0 -116
- package/docs/void-verification.md +0 -185
package/dist/cli-output.js
CHANGED
|
@@ -7,221 +7,247 @@ const names = (value) => Array.isArray(value)
|
|
|
7
7
|
.map(string)
|
|
8
8
|
.join(', ')
|
|
9
9
|
: '';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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)}` : ''}`);
|
|
29
31
|
}
|
|
30
|
-
else if (
|
|
31
|
-
|
|
32
|
-
lines.push(`${data.services.length} local service entries.`);
|
|
33
|
-
for (const service of entries(data.services))
|
|
34
|
-
lines.push(` ${string(service.key)}${service.state ? ` — ${string(service.state)}` : ''}`);
|
|
35
|
-
}
|
|
36
|
-
else if (Array.isArray(data.points)) {
|
|
37
|
-
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.');
|
|
38
|
-
}
|
|
39
|
-
else if (Array.isArray(data.rows)) {
|
|
40
|
-
lines.push(`Read ${data.rows.length} rows.`, `Private data${data.masked ? '; sensitive fields are masked' : ''}. Use --json to inspect values.`);
|
|
41
|
-
}
|
|
42
|
-
else if (string(data.token)) {
|
|
43
|
-
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.');
|
|
44
|
-
}
|
|
45
|
-
else if (Array.isArray(value))
|
|
46
|
-
lines.push(`Tables: ${names(value) || 'None'}.`);
|
|
47
|
-
else
|
|
48
|
-
lines.push(`Service: ${string(data.state) || 'Checked'}.`, string(data.message));
|
|
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.');
|
|
49
34
|
}
|
|
50
|
-
else if (
|
|
51
|
-
lines.push(data.
|
|
52
|
-
const files = Array.isArray(data.files) ? data.files : [];
|
|
53
|
-
if (files.length)
|
|
54
|
-
lines.push('', ...files.map((file) => ` ${string(file)}`));
|
|
55
|
-
if (data.filesChecked === false)
|
|
56
|
-
lines.push('Source files were not checked: this selection needs the networked web bootstrap.');
|
|
57
|
-
if (names(data.conflicts))
|
|
58
|
-
lines.push(`Conflicts: ${names(data.conflicts)}.`);
|
|
59
|
-
for (const preview of entries(data.previews))
|
|
60
|
-
lines.push('', string(preview.path), string(preview.unavailable ?? preview.diff ?? preview.content));
|
|
61
|
-
if (data.dryRun)
|
|
62
|
-
lines.push('', 'No application files were changed.');
|
|
63
|
-
else
|
|
64
|
-
next('Run anhedral doctor and review the selected services’ setup requirements.');
|
|
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.`);
|
|
65
37
|
}
|
|
66
|
-
else if (
|
|
67
|
-
lines.push(`
|
|
68
|
-
const selection = record(record(data.selection).data);
|
|
69
|
-
lines.push(`Stack: ${names(selection.products) || 'Unavailable'}.`);
|
|
70
|
-
for (const target of entries(record(data.targets).data)) {
|
|
71
|
-
const latest = record(target.latestAttempt), successful = record(target.lastSuccessful);
|
|
72
|
-
lines.push(` ${string(target.application)} — ${string(target.provider)} (${string(target.delivery)})`);
|
|
73
|
-
if (string(latest.state))
|
|
74
|
-
lines.push(` Latest recorded target result: ${string(latest.state)}.`);
|
|
75
|
-
if (string(latest.operationState))
|
|
76
|
-
lines.push(` Overall attempt: ${string(latest.operationState)}.`);
|
|
77
|
-
if (string(successful.id))
|
|
78
|
-
lines.push(` Last recorded success: ${string(successful.id)}.`);
|
|
79
|
-
if (string(target.error))
|
|
80
|
-
lines.push(` ${string(target.error)}`);
|
|
81
|
-
}
|
|
82
|
-
for (const check of entries(record(record(data.readiness).data).checks))
|
|
83
|
-
lines.push(` ${check.ok ? 'pass' : 'fail'} ${string(check.id)} — ${string(check.detail)}`);
|
|
84
|
-
for (const key of [
|
|
85
|
-
'selection',
|
|
86
|
-
'workspaces',
|
|
87
|
-
'configuration',
|
|
88
|
-
'targets',
|
|
89
|
-
'setupProviders',
|
|
90
|
-
'integrations',
|
|
91
|
-
'cloudflareResources',
|
|
92
|
-
'readiness',
|
|
93
|
-
'operation',
|
|
94
|
-
]) {
|
|
95
|
-
const section = record(data[key]);
|
|
96
|
-
if (section.state === 'unavailable')
|
|
97
|
-
lines.push(`${key}: ${string(section.error) || 'Unavailable'}.`);
|
|
98
|
-
}
|
|
99
|
-
next('Use --json for target-specific records. Review local checks, then explicitly run auth or ship when intended.');
|
|
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.');
|
|
100
40
|
}
|
|
101
|
-
else if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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)}`);
|
|
115
77
|
}
|
|
116
|
-
|
|
117
|
-
lines.push(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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'}.`);
|
|
129
94
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
lines.push(`${key}: ${names(setup[key])}`);
|
|
140
|
-
next(`Inspect anhedral add ${string(data.name)} --dry-run in your project.`);
|
|
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);
|
|
141
104
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
lines
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
lines.push('Local readiness does not certify production behavior.');
|
|
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)}`);
|
|
159
120
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
lines.push(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
214
|
}
|
|
215
|
-
next(data.nextAction);
|
|
216
|
-
if (data.mutation === false)
|
|
217
|
-
lines.push('No provider resources or deployments were changed.');
|
|
218
|
-
else if (!data.nextAction && command === 'ship' && state === 'deployed')
|
|
219
|
-
next('Run anhedral verify to exercise the application’s configured acceptance checks.');
|
|
220
|
-
else if (!data.nextAction && command === 'connect')
|
|
221
|
-
next('Review and commit the connection manifest, then run anhedral ship --dry-run.');
|
|
222
|
-
if (!state && !data.nextAction && !Object.keys(project).length)
|
|
223
|
-
lines.push('Use --json for the complete recorded evidence.');
|
|
224
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);
|
|
225
251
|
return lines.join('\n').trimEnd();
|
|
226
252
|
}
|
|
227
253
|
export function printResult(command, value, options = {}) {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type CloudflareRequest } from './cloudflare.js';
|
|
2
|
+
import { defaultRunner, type ApplicationProject, type DeploymentTarget } from './project-state.js';
|
|
3
|
+
export interface TargetRelease {
|
|
4
|
+
target: string;
|
|
5
|
+
versionId: string;
|
|
6
|
+
urls: string[];
|
|
7
|
+
providerConfirmed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface Release {
|
|
10
|
+
id: string;
|
|
11
|
+
commit: string;
|
|
12
|
+
startedAt: string;
|
|
13
|
+
finishedAt?: string;
|
|
14
|
+
state: 'running' | 'checked' | 'deployed' | 'configuration-required' | 'failed';
|
|
15
|
+
targets: TargetRelease[];
|
|
16
|
+
failure?: string;
|
|
17
|
+
configurationChanges?: string[];
|
|
18
|
+
operation?: 'ship' | 'rollback';
|
|
19
|
+
restoredReleaseId?: string;
|
|
20
|
+
verification?: {
|
|
21
|
+
state: 'passed' | 'failed';
|
|
22
|
+
checkedAt: string;
|
|
23
|
+
command: 'pnpm run test:live';
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface ReleaseHistory {
|
|
27
|
+
schemaVersion: 1;
|
|
28
|
+
projectId: string;
|
|
29
|
+
releases: Release[];
|
|
30
|
+
}
|
|
31
|
+
export declare function history(root: string, project: ApplicationProject): ReleaseHistory;
|
|
32
|
+
export declare function checkTargets(root: string, project: ApplicationProject, allowResourcePlaceholders?: boolean): void;
|
|
33
|
+
export declare function configurationFingerprint(root: string, project: ApplicationProject): string;
|
|
34
|
+
export declare function planDelivery(root: string, allowResourcePlaceholders?: boolean): {
|
|
35
|
+
project: ApplicationProject;
|
|
36
|
+
checks: string[][];
|
|
37
|
+
deployments: {
|
|
38
|
+
target: string;
|
|
39
|
+
directory: string;
|
|
40
|
+
command: string[];
|
|
41
|
+
}[];
|
|
42
|
+
resourcesProvisioned: boolean;
|
|
43
|
+
audience: "unconfigured" | "public" | "private";
|
|
44
|
+
};
|
|
45
|
+
export declare function parseDeploymentOutput(source: string, target: DeploymentTarget): TargetRelease;
|
|
46
|
+
export interface ActiveVersion {
|
|
47
|
+
versionId: string;
|
|
48
|
+
percentage: number;
|
|
49
|
+
}
|
|
50
|
+
export declare function activeVersions(value: unknown): ActiveVersion[];
|
|
51
|
+
export declare function providerStatus(root: string, project: ApplicationProject, target: DeploymentTarget, run: typeof defaultRunner, request?: CloudflareRequest): Promise<unknown>;
|
|
52
|
+
export declare function fullyActive(versions: ActiveVersion[], versionId: string): boolean;
|
|
53
|
+
export declare function describeArchitecture(root: string, project: ApplicationProject): {
|
|
54
|
+
target: string;
|
|
55
|
+
workerName: string;
|
|
56
|
+
directory: string;
|
|
57
|
+
bindings: {
|
|
58
|
+
kind: string;
|
|
59
|
+
binding: string;
|
|
60
|
+
}[];
|
|
61
|
+
scheduled: string[];
|
|
62
|
+
}[];
|