anhedral 0.22.0 → 0.22.1
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 +4 -2
- package/assets/contracts/deployment-provenance.json +4 -4
- package/dist/cli-commands.js +5 -17
- package/dist/cli-errors.js +1 -1
- package/dist/command-schema.d.ts +1 -0
- package/dist/command-schema.js +14 -0
- package/dist/completion.js +1 -1
- package/dist/{capability-command.d.ts → composition/command.d.ts} +3 -3
- package/dist/{capability-command.js → composition/command.js} +12 -12
- package/dist/{composition.d.ts → composition/composition.d.ts} +1 -1
- package/dist/{composition.js → composition/composition.js} +2 -2
- package/dist/{capability-editor.js → composition/editor.js} +1 -1
- package/dist/{capability-recipes.d.ts → composition/recipes.d.ts} +2 -2
- package/dist/{capability-recipes.js → composition/recipes.js} +7 -7
- package/dist/{capability-references.js → composition/references.js} +2 -2
- package/dist/{stack-update.d.ts → composition/update.d.ts} +3 -3
- package/dist/{stack-update.js → composition/update.js} +11 -11
- package/dist/contracts/cli-transport.d.ts +1 -1
- package/dist/contracts/deployment.d.ts +4 -65
- package/dist/contracts/deployment.js +0 -29
- package/dist/contracts/production-transport.d.ts +2 -2
- package/dist/contracts/staging-transport.d.ts +2 -2
- package/dist/launch.js +5 -5
- package/dist/platform/auth.d.ts +14 -0
- package/dist/platform/auth.js +62 -0
- package/dist/{platform-command.d.ts → platform/command.d.ts} +2 -2
- package/dist/platform/command.js +279 -0
- package/dist/{credential-helper.js → platform/credential-helper.js} +1 -1
- package/dist/platform/deploy.d.ts +2 -0
- package/dist/platform/deploy.js +158 -0
- package/dist/{platform-environment.d.ts → platform/environment.d.ts} +1 -1
- package/dist/{platform-environment.js → platform/environment.js} +7 -7
- package/dist/platform/http.d.ts +7 -0
- package/dist/platform/http.js +105 -0
- package/dist/{platform-operations.d.ts → platform/operations.d.ts} +1 -1
- package/dist/{platform-operations.js → platform/operations.js} +5 -5
- package/dist/platform/output.d.ts +2 -0
- package/dist/platform/output.js +79 -0
- package/dist/{platform-production.d.ts → platform/production.d.ts} +1 -1
- package/dist/{platform-production.js → platform/production.js} +4 -4
- package/dist/platform/projects.d.ts +12 -0
- package/dist/platform/projects.js +125 -0
- package/dist/{platform-source.js → platform/source.js} +7 -7
- package/dist/platform/state-schema.d.ts +25 -0
- package/dist/platform/state-schema.js +11 -0
- package/dist/{platform-state.d.ts → platform/state.d.ts} +1 -1
- package/dist/{platform-state.js → platform/state.js} +3 -4
- package/dist/platform/types.d.ts +26 -0
- package/dist/platform/upload.d.ts +2 -0
- package/dist/platform/upload.js +60 -0
- package/dist/process/runner.d.ts +1 -0
- package/dist/{command-runner.js → process/runner.js} +1 -1
- package/dist/registry/usage.d.ts +1 -0
- package/dist/{platforms → scaffold}/tanstack.d.ts +2 -2
- package/dist/{platforms → scaffold}/tanstack.js +2 -2
- package/dist/transactions/durable-files.d.ts +8 -0
- package/dist/transactions/durable-files.js +132 -0
- package/dist/transactions/journal.d.ts +4 -0
- package/dist/transactions/journal.js +141 -0
- package/dist/{transaction-lock.js → transactions/lock.js} +2 -2
- package/dist/transactions/model.d.ts +18 -0
- package/dist/transactions/model.js +4 -0
- package/dist/transactions/paths.d.ts +12 -0
- package/dist/transactions/paths.js +155 -0
- package/dist/transactions/recovery.d.ts +7 -0
- package/dist/transactions/recovery.js +132 -0
- package/dist/{transaction.d.ts → transactions/transaction.d.ts} +1 -2
- package/dist/transactions/transaction.js +179 -0
- package/dist/util.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/software-factory.md +32 -6
- package/package.json +18 -18
- package/dist/platform-command.js +0 -787
- package/dist/transaction.js +0 -716
- /package/dist/{capability-catalog.d.ts → composition/catalog.d.ts} +0 -0
- /package/dist/{capability-catalog.js → composition/catalog.js} +0 -0
- /package/dist/{capability-editor.d.ts → composition/editor.d.ts} +0 -0
- /package/dist/{capability-references.d.ts → composition/references.d.ts} +0 -0
- /package/dist/{credential-helper.d.ts → platform/credential-helper.d.ts} +0 -0
- /package/dist/{platform-source.d.ts → platform/source.d.ts} +0 -0
- /package/dist/{command-runner.d.ts → platform/types.js} +0 -0
- /package/dist/{command.d.ts → process/resolve-command.d.ts} +0 -0
- /package/dist/{command.js → process/resolve-command.js} +0 -0
- /package/dist/{transaction-lock.d.ts → transactions/lock.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
> [!WARNING]
|
|
4
4
|
> Under construction. Commands, generated source and managed integration are evolving.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
The open-source CLI for building and managing apps through the **Anhedral API**. Use it directly or through the Codex and Claude Code plugin to create projects, upload source, configure environments, deploy apps and read runtime logs.
|
|
7
|
+
|
|
8
|
+
The plugin guides an agent through CLI commands so you can describe what you want to build in conversation. Platform enforces account, project and deployment permissions. The CLI also generates the **Anhedral Stack** as editable source, starting with web UI and adding backend, storage and payments when needed. Local source generation requires no account.
|
|
7
9
|
|
|
8
10
|
## Start
|
|
9
11
|
|
|
@@ -45,7 +47,7 @@ pnpm dlx shadcn@4.22.1 add card
|
|
|
45
47
|
|
|
46
48
|
Review diffs and preserve local edits and required upstream notices. The generated `LICENSE.shadcn` accompanies the bundled starter source. See [web UI](docs/ui.md).
|
|
47
49
|
|
|
48
|
-
##
|
|
50
|
+
## Connect to Anhedral
|
|
49
51
|
|
|
50
52
|
Local generation requires no account. After browser-approved `login`, use `projects list --human` to discover projects and team IDs. Register your generated application with `projects create --name <name> --link --human`, or connect an existing project with `link --project <uuid> --team <uuid>`. `source upload --dry-run` inspects packaging without uploading; `source upload` sends a resumable immutable checkpoint.
|
|
51
53
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"contractVersion": 1,
|
|
3
3
|
"owner": "anhedral/platform-contracts/deployment",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"sourceRevision": "
|
|
5
|
+
"sourceRevision": "2049016a3ec30720d5bc284b6d06cd8c60ce662b",
|
|
6
6
|
"files": {
|
|
7
7
|
"cli-transport.ts": "8bd4063d358b755e72fec637d88b3587c69a6dd3f94f0583c4d676e181386064",
|
|
8
8
|
"source-profile.ts": "1426caa2675db95d249ca36bb06c039ce8382379fd33cf9cdae48d7aad2faded",
|
|
9
9
|
"source-bundle.ts": "99df4874f9337a604da544093215de24f19f136182017be15629f78b5180a52b",
|
|
10
|
-
"deployment.ts": "
|
|
11
|
-
"fixtures.json": "
|
|
12
|
-
"acceptance.mjs": "
|
|
10
|
+
"deployment.ts": "e11e5ae4b8f2f8ca71c4930cf4dab8ae33e3d66c2d86827890f8207a8268147f",
|
|
11
|
+
"fixtures.json": "9b127ee73ec726b63ae772fc0b071a8612e92219f54a84073becd8a2fa078bf3",
|
|
12
|
+
"acceptance.mjs": "f0abb2ff918fe7a448a20b43b96fb299114e7cc8b0d2debbad40ab7ff63a0d07",
|
|
13
13
|
"LICENSE": "6d89bce3e7760469015287d1b6a45d31ef7924475c9b54eabe974bcce373980b"
|
|
14
14
|
}
|
|
15
15
|
}
|
package/dist/cli-commands.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { commandDefinition } from './command-schema.js';
|
|
2
|
+
import { runPlatformCommand } from './platform/command.js';
|
|
3
|
+
import { runStackUpdate } from './composition/update.js';
|
|
4
|
+
import { runCapabilityCommand } from './composition/command.js';
|
|
4
5
|
import { commandArgumentError } from './cli-arguments.js';
|
|
5
6
|
import { createReporter } from './cli-output.js';
|
|
6
7
|
import { scaffoldLaunchProject, parseAnhedralStackOptions } from './launch.js';
|
|
@@ -14,20 +15,7 @@ export async function runCommand(command, args, output) {
|
|
|
14
15
|
createReporter(output, () => script.trimEnd()).result({ shell, script });
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
|
-
if (
|
|
18
|
-
'login',
|
|
19
|
-
'logout',
|
|
20
|
-
'whoami',
|
|
21
|
-
'projects',
|
|
22
|
-
'link',
|
|
23
|
-
'unlink',
|
|
24
|
-
'source',
|
|
25
|
-
'deploy',
|
|
26
|
-
'env',
|
|
27
|
-
'staging',
|
|
28
|
-
'production',
|
|
29
|
-
'logs',
|
|
30
|
-
].includes(command))
|
|
18
|
+
if (commandDefinition(command)?.owner === 'platform')
|
|
31
19
|
return runPlatformCommand(command, args, output);
|
|
32
20
|
if (command === 'stack' && commandArguments('stack', args).positional[0] === 'update')
|
|
33
21
|
return runStackUpdate(args, output);
|
package/dist/cli-errors.js
CHANGED
package/dist/command-schema.d.ts
CHANGED
package/dist/command-schema.js
CHANGED
|
@@ -154,6 +154,7 @@ export const COMMANDS = {
|
|
|
154
154
|
note: 'Prints the script only; never edits your shell profile or contacts Platform.',
|
|
155
155
|
},
|
|
156
156
|
login: {
|
|
157
|
+
owner: 'platform',
|
|
157
158
|
description: 'Approve a short-lived CLI session in your browser.',
|
|
158
159
|
usage: 'login [--start|--resume]',
|
|
159
160
|
options: [
|
|
@@ -166,6 +167,7 @@ export const COMMANDS = {
|
|
|
166
167
|
note: 'Device secrets and API tokens stay in your credential store. Server CLI access must be configured.',
|
|
167
168
|
},
|
|
168
169
|
logout: {
|
|
170
|
+
owner: 'platform',
|
|
169
171
|
description: 'Revoke this CLI session.',
|
|
170
172
|
usage: 'logout',
|
|
171
173
|
options: PLATFORM_OPTIONS,
|
|
@@ -173,6 +175,7 @@ export const COMMANDS = {
|
|
|
173
175
|
note: 'Revokes server access before clearing local credentials.',
|
|
174
176
|
},
|
|
175
177
|
whoami: {
|
|
178
|
+
owner: 'platform',
|
|
176
179
|
description: 'Show the current CLI identity.',
|
|
177
180
|
usage: 'whoami',
|
|
178
181
|
options: [
|
|
@@ -185,6 +188,7 @@ export const COMMANDS = {
|
|
|
185
188
|
examples: ['whoami --json', 'whoami --context --human'],
|
|
186
189
|
},
|
|
187
190
|
projects: {
|
|
191
|
+
owner: 'platform',
|
|
188
192
|
description: 'List or create Platform projects.',
|
|
189
193
|
usage: 'projects <list|create> [options]',
|
|
190
194
|
options: PROJECT_OPTIONS,
|
|
@@ -209,6 +213,7 @@ export const COMMANDS = {
|
|
|
209
213
|
examples: ['projects list', 'projects create --name "My app"'],
|
|
210
214
|
},
|
|
211
215
|
link: {
|
|
216
|
+
owner: 'platform',
|
|
212
217
|
description: 'Link this workspace to an existing project.',
|
|
213
218
|
usage: 'link --project <uuid> --team <uuid>',
|
|
214
219
|
options: [
|
|
@@ -220,12 +225,14 @@ export const COMMANDS = {
|
|
|
220
225
|
note: 'Requires current project build access. Existing application identities are preserved.',
|
|
221
226
|
},
|
|
222
227
|
unlink: {
|
|
228
|
+
owner: 'platform',
|
|
223
229
|
description: 'Remove the local project link.',
|
|
224
230
|
usage: 'unlink',
|
|
225
231
|
options: PLATFORM_OPTIONS,
|
|
226
232
|
examples: ['unlink'],
|
|
227
233
|
},
|
|
228
234
|
deploy: {
|
|
235
|
+
owner: 'platform',
|
|
229
236
|
description: 'Plan deployment and reserve a candidate from sealed source.',
|
|
230
237
|
usage: 'deploy <plan|prepare|status> [options]',
|
|
231
238
|
options: [
|
|
@@ -279,6 +286,7 @@ export const COMMANDS = {
|
|
|
279
286
|
note: 'Preparation reserves a candidate; server policy controls build admission. No preview or deployment is activated.',
|
|
280
287
|
},
|
|
281
288
|
env: {
|
|
289
|
+
owner: 'platform',
|
|
282
290
|
description: 'Manage project configuration and write-only secrets through Platform.',
|
|
283
291
|
usage: 'env <list|import|set> [options]',
|
|
284
292
|
options: ENVIRONMENT_OPTIONS,
|
|
@@ -311,6 +319,7 @@ export const COMMANDS = {
|
|
|
311
319
|
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
320
|
},
|
|
313
321
|
staging: {
|
|
322
|
+
owner: 'platform',
|
|
314
323
|
description: 'Manage persistent staging deployments for the linked project.',
|
|
315
324
|
usage: 'staging <status|deploy> [options]',
|
|
316
325
|
options: STAGING_OPTIONS,
|
|
@@ -324,6 +333,7 @@ export const COMMANDS = {
|
|
|
324
333
|
examples: ['staging status --json'],
|
|
325
334
|
},
|
|
326
335
|
deploy: {
|
|
336
|
+
owner: 'platform',
|
|
327
337
|
description: 'Deploy a ready candidate to staging.',
|
|
328
338
|
usage: 'staging deploy --candidate <uuid> [--new]',
|
|
329
339
|
options: STAGING_OPTIONS,
|
|
@@ -335,6 +345,7 @@ export const COMMANDS = {
|
|
|
335
345
|
note: 'Retried requests retain the same identity and generation. Configuration is frozen for each new staging deployment; production approval stays in Platform.',
|
|
336
346
|
},
|
|
337
347
|
production: {
|
|
348
|
+
owner: 'platform',
|
|
338
349
|
description: 'Deploy a ready candidate with your current production permissions.',
|
|
339
350
|
usage: 'production <status|deploy> [options]',
|
|
340
351
|
options: PRODUCTION_OPTIONS,
|
|
@@ -348,6 +359,7 @@ export const COMMANDS = {
|
|
|
348
359
|
examples: ['production status --json'],
|
|
349
360
|
},
|
|
350
361
|
deploy: {
|
|
362
|
+
owner: 'platform',
|
|
351
363
|
description: 'Request production publication of a ready candidate.',
|
|
352
364
|
usage: 'production deploy --candidate <uuid> --name <slug> [--new]',
|
|
353
365
|
options: PRODUCTION_OPTIONS,
|
|
@@ -359,6 +371,7 @@ export const COMMANDS = {
|
|
|
359
371
|
note: 'Platform checks current production permissions and freezes configuration. Self-service teams need no second approver; an explicitly required independent review remains enforced.',
|
|
360
372
|
},
|
|
361
373
|
logs: {
|
|
374
|
+
owner: 'platform',
|
|
362
375
|
description: 'Read redacted runtime logs for the linked project.',
|
|
363
376
|
usage: 'logs [options]',
|
|
364
377
|
positional: { name: 'arguments', min: 0, max: 0 },
|
|
@@ -418,6 +431,7 @@ export const COMMANDS = {
|
|
|
418
431
|
note: 'Runtime collection is best effort and reports unavailable coverage and dropped events. Retention is seven days; source/build logs remain separate.',
|
|
419
432
|
},
|
|
420
433
|
source: {
|
|
434
|
+
owner: 'platform',
|
|
421
435
|
description: 'Upload an immutable source checkpoint with resumable chunks.',
|
|
422
436
|
usage: 'source <upload|status> [options]',
|
|
423
437
|
options: [
|
package/dist/completion.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { COMMANDS, GLOBAL_OPTIONS, commandOptions, commandTopic, } from './command-schema.js';
|
|
2
|
-
import { PUBLIC_STACK_ADDITIONS } from './
|
|
2
|
+
import { PUBLIC_STACK_ADDITIONS } from './composition/catalog.js';
|
|
3
3
|
/** Quote data for shell source. Completion never evaluates user input. */
|
|
4
4
|
function quote(value) {
|
|
5
5
|
return "'" + value.replaceAll("'", "'\"'\"'") + "'";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type OutputOptions } from '
|
|
2
|
-
import { CapabilityEditor } from './
|
|
3
|
-
import type { CommandRunner } from '
|
|
1
|
+
import { type OutputOptions } from '../cli-output.js';
|
|
2
|
+
import { CapabilityEditor } from './editor.js';
|
|
3
|
+
import type { CommandRunner } from '../command-types.js';
|
|
4
4
|
export declare function projectRoot(cwd: string, allowRecovery?: boolean): string;
|
|
5
5
|
export declare function readState(e: CapabilityEditor): {
|
|
6
6
|
installed: ("hono" | "database-auth" | "r2" | "stripe")[];
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { existsSync, realpathSync, statSync, chmodSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { commandArguments, commandArgumentError } from '
|
|
4
|
-
import { createReporter } from '
|
|
5
|
-
import { ANHEDRAL_STACK, PUBLIC_STACK_ADDITIONS, CAPABILITIES, CAPABILITY_IDS, capabilityOrder, } from './
|
|
6
|
-
import { CapabilityEditor } from './
|
|
7
|
-
import { addCapabilityRecipe, composeCapabilities } from './
|
|
8
|
-
import { normalizeOjFoundation } from '
|
|
9
|
-
import { GENERATOR_VERSION } from '
|
|
10
|
-
import { PostCommitError, runStagedTransaction, recoverInterruptedTransaction, } from '
|
|
11
|
-
import { put } from '
|
|
12
|
-
import { execFile } from '
|
|
13
|
-
import { capabilityReferences } from './
|
|
14
|
-
import { configureDependencyPatches } from '
|
|
3
|
+
import { commandArguments, commandArgumentError } from '../cli-arguments.js';
|
|
4
|
+
import { createReporter } from '../cli-output.js';
|
|
5
|
+
import { ANHEDRAL_STACK, PUBLIC_STACK_ADDITIONS, CAPABILITIES, CAPABILITY_IDS, capabilityOrder, } from './catalog.js';
|
|
6
|
+
import { CapabilityEditor } from './editor.js';
|
|
7
|
+
import { addCapabilityRecipe, composeCapabilities } from './recipes.js';
|
|
8
|
+
import { normalizeOjFoundation } from '../scaffold/tanstack.js';
|
|
9
|
+
import { GENERATOR_VERSION } from '../version.js';
|
|
10
|
+
import { PostCommitError, runStagedTransaction, recoverInterruptedTransaction, } from '../transactions/transaction.js';
|
|
11
|
+
import { put } from '../scaffold/files.js';
|
|
12
|
+
import { execFile } from '../util.js';
|
|
13
|
+
import { capabilityReferences } from './references.js';
|
|
14
|
+
import { configureDependencyPatches } from '../dependency-patches.js';
|
|
15
15
|
import { composeSourceProvenance } from './composition.js';
|
|
16
16
|
export function projectRoot(cwd, allowRecovery = false) {
|
|
17
17
|
let root = realpathSync(cwd);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { sourceCompositionSchema } from '
|
|
1
|
+
import { sourceCompositionSchema } from '../contracts/deployment.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { GENERATOR_VERSION } from '
|
|
3
|
+
import { GENERATOR_VERSION } from '../version.js';
|
|
4
4
|
// Narrow the shared source contract for the launch generator; runtime admission remains server-owned.
|
|
5
5
|
export const launchCompositionSchema = sourceCompositionSchema.safeExtend({
|
|
6
6
|
contractVersion: z.literal(2),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readBoundedFile, MAX_PROJECT_JSON_BYTES } from '
|
|
1
|
+
import { readBoundedFile, MAX_PROJECT_JSON_BYTES } from '../bounded-file.js';
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
3
|
import { existsSync, lstatSync } from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CapabilityEditor } from './
|
|
2
|
-
import type { Capability } from './
|
|
1
|
+
import { CapabilityEditor } from './editor.js';
|
|
2
|
+
import type { Capability } from './catalog.js';
|
|
3
3
|
export declare function addCapabilityRecipe(e: CapabilityEditor, id: Capability, name: string): void;
|
|
4
4
|
export declare function composeCapabilities(e: CapabilityEditor, installed: Capability[]): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { CapabilityEditor } from './
|
|
3
|
-
import { CAPABILITY_DEPENDENCIES as P } from '
|
|
4
|
-
import { STACK_DEPENDENCIES as D } from '
|
|
5
|
-
import { resourceName } from '
|
|
6
|
-
import { composeTanstack, addTanstackAuth } from '
|
|
7
|
-
import { WEB_API_PROXY } from '
|
|
8
|
-
const template = (name) => readFileSync(new URL(
|
|
2
|
+
import { CapabilityEditor } from './editor.js';
|
|
3
|
+
import { CAPABILITY_DEPENDENCIES as P } from '../dependencies.js';
|
|
4
|
+
import { STACK_DEPENDENCIES as D } from '../dependencies.js';
|
|
5
|
+
import { resourceName } from '../render.js';
|
|
6
|
+
import { composeTanstack, addTanstackAuth } from '../scaffold/tanstack.js';
|
|
7
|
+
import { WEB_API_PROXY } from '../api-proxy.js';
|
|
8
|
+
const template = (name) => readFileSync(new URL(`../../assets/stack/${name}`, import.meta.url), 'utf8');
|
|
9
9
|
const json = (value) => JSON.stringify(value, null, 2) + '\n';
|
|
10
10
|
function dependency(e, app, dependencies) {
|
|
11
11
|
e.merge(`${app}/package.json`, 'dependencies', dependencies);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
export function capabilityReferences() {
|
|
3
3
|
return {
|
|
4
|
-
'docs/anhedral/capabilities.md': readFileSync(new URL('
|
|
5
|
-
'docs/anhedral/ui.md': readFileSync(new URL('
|
|
4
|
+
'docs/anhedral/capabilities.md': readFileSync(new URL('../../docs/capabilities.md', import.meta.url), 'utf8'),
|
|
5
|
+
'docs/anhedral/ui.md': readFileSync(new URL('../../docs/ui.md', import.meta.url), 'utf8'),
|
|
6
6
|
};
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolvePublishedCliArtifact, type PublishedCliArtifact } from '
|
|
2
|
-
import { type OutputOptions } from '
|
|
3
|
-
import { CapabilityEditor } from './
|
|
1
|
+
import { resolvePublishedCliArtifact, type PublishedCliArtifact } from '../release-artifact.js';
|
|
2
|
+
import { type OutputOptions } from '../cli-output.js';
|
|
3
|
+
import { CapabilityEditor } from './editor.js';
|
|
4
4
|
/** One exact replacement hunk without unchanged project configuration context. */
|
|
5
5
|
export declare function updateDiff(file: string, before: string | null, after: string): string;
|
|
6
6
|
export declare function planStackUpdate(root: string, artifact?: PublishedCliArtifact): {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { chmodSync, existsSync, statSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { isDeepStrictEqual, stripVTControlCharacters } from 'node:util';
|
|
4
|
-
import { deploymentManifestSchema } from '
|
|
5
|
-
import { ArtifactUnavailableError, resolvePublishedCliArtifact, isPublishedCliArtifact, } from '
|
|
4
|
+
import { deploymentManifestSchema } from '../contracts/deployment.js';
|
|
5
|
+
import { ArtifactUnavailableError, resolvePublishedCliArtifact, isPublishedCliArtifact, } from '../release-artifact.js';
|
|
6
6
|
import { isMap, parseDocument } from 'yaml';
|
|
7
|
-
import { commandArgumentError, commandArguments } from '
|
|
8
|
-
import { CliFailure } from '
|
|
9
|
-
import { createReporter } from '
|
|
10
|
-
import { assertPublicWorkspace, projectRoot, readState } from './
|
|
11
|
-
import { CapabilityEditor, fingerprint } from './
|
|
12
|
-
import { normalizeOjFoundation } from '
|
|
7
|
+
import { commandArgumentError, commandArguments } from '../cli-arguments.js';
|
|
8
|
+
import { CliFailure } from '../cli-errors.js';
|
|
9
|
+
import { createReporter } from '../cli-output.js';
|
|
10
|
+
import { assertPublicWorkspace, projectRoot, readState } from './command.js';
|
|
11
|
+
import { CapabilityEditor, fingerprint } from './editor.js';
|
|
12
|
+
import { normalizeOjFoundation } from '../scaffold/tanstack.js';
|
|
13
13
|
import { composeSourceProvenance } from './composition.js';
|
|
14
|
-
import { GENERATOR_VERSION } from '
|
|
15
|
-
import { runStagedTransaction } from '
|
|
16
|
-
import { put } from '
|
|
14
|
+
import { GENERATOR_VERSION } from '../version.js';
|
|
15
|
+
import { runStagedTransaction } from '../transactions/transaction.js';
|
|
16
|
+
import { put } from '../scaffold/files.js';
|
|
17
17
|
const MAX_UPDATE_BYTES = 256 * 1024;
|
|
18
18
|
const MAX_UPDATE_FILES = 32;
|
|
19
19
|
/** One exact replacement hunk without unchanged project configuration context. */
|
|
@@ -294,9 +294,9 @@ export declare const cliPreparationSchema: z.ZodObject<{
|
|
|
294
294
|
candidateId: z.ZodUUID;
|
|
295
295
|
sourceRevision: z.ZodString;
|
|
296
296
|
state: z.ZodEnum<{
|
|
297
|
+
building: "building";
|
|
297
298
|
ready: "ready";
|
|
298
299
|
failed: "failed";
|
|
299
|
-
building: "building";
|
|
300
300
|
"awaiting-runtime": "awaiting-runtime";
|
|
301
301
|
built: "built";
|
|
302
302
|
}>;
|
|
@@ -76,65 +76,6 @@ export declare const deploymentManifestSchema: z.ZodObject<{
|
|
|
76
76
|
}>;
|
|
77
77
|
}, z.core.$strict>;
|
|
78
78
|
}, z.core.$strict>;
|
|
79
|
-
export declare const deploymentSourceSchema: z.ZodObject<{
|
|
80
|
-
inventoryVersion: z.ZodLiteral<2>;
|
|
81
|
-
inventoryProfile: z.ZodString;
|
|
82
|
-
sourceDigest: z.ZodString;
|
|
83
|
-
lockfileDigest: z.ZodString;
|
|
84
|
-
manifestDigest: z.ZodString;
|
|
85
|
-
}, z.core.$strict>;
|
|
86
|
-
export declare const deploymentPlanSchema: z.ZodObject<{
|
|
87
|
-
contractVersion: z.ZodLiteral<1>;
|
|
88
|
-
requestId: z.ZodUUID;
|
|
89
|
-
projectId: z.ZodUUID;
|
|
90
|
-
manifest: z.ZodObject<{
|
|
91
|
-
contractVersion: z.ZodLiteral<1>;
|
|
92
|
-
foundation: z.ZodLiteral<"tanstack-start">;
|
|
93
|
-
capabilities: z.ZodArray<z.ZodEnum<{
|
|
94
|
-
hono: "hono";
|
|
95
|
-
"database-auth": "database-auth";
|
|
96
|
-
r2: "r2";
|
|
97
|
-
stripe: "stripe";
|
|
98
|
-
}>>;
|
|
99
|
-
identity: z.ZodEnum<{
|
|
100
|
-
none: "none";
|
|
101
|
-
"better-auth-d1-v1": "better-auth-d1-v1";
|
|
102
|
-
}>;
|
|
103
|
-
cliArtifact: z.ZodObject<{
|
|
104
|
-
version: z.ZodString;
|
|
105
|
-
sourceRevision: z.ZodString;
|
|
106
|
-
packageIntegrity: z.ZodString;
|
|
107
|
-
}, z.core.$strict>;
|
|
108
|
-
intent: z.ZodObject<{
|
|
109
|
-
contractVersion: z.ZodLiteral<1>;
|
|
110
|
-
runtimeProfile: z.ZodLiteral<"anhedral-stack">;
|
|
111
|
-
environment: z.ZodEnum<{
|
|
112
|
-
production: "production";
|
|
113
|
-
preview: "preview";
|
|
114
|
-
}>;
|
|
115
|
-
visibility: z.ZodEnum<{
|
|
116
|
-
protected: "protected";
|
|
117
|
-
public: "public";
|
|
118
|
-
}>;
|
|
119
|
-
}, z.core.$strict>;
|
|
120
|
-
}, z.core.$strict>;
|
|
121
|
-
source: z.ZodObject<{
|
|
122
|
-
inventoryVersion: z.ZodLiteral<2>;
|
|
123
|
-
inventoryProfile: z.ZodString;
|
|
124
|
-
sourceDigest: z.ZodString;
|
|
125
|
-
lockfileDigest: z.ZodString;
|
|
126
|
-
manifestDigest: z.ZodString;
|
|
127
|
-
}, z.core.$strict>;
|
|
128
|
-
policyDigest: z.ZodString;
|
|
129
|
-
runtimeImage: z.ZodString;
|
|
130
|
-
configurationRevision: z.ZodString;
|
|
131
|
-
expectedGeneration: z.ZodNumber;
|
|
132
|
-
migrationDigests: z.ZodArray<z.ZodString>;
|
|
133
|
-
requiredAuthority: z.ZodEnum<{
|
|
134
|
-
preview: "preview";
|
|
135
|
-
"production-approval": "production-approval";
|
|
136
|
-
}>;
|
|
137
|
-
}, z.core.$strict>;
|
|
138
79
|
export declare const deploymentErrorSchema: z.ZodObject<{
|
|
139
80
|
code: z.ZodEnum<{
|
|
140
81
|
INVALID_MANIFEST: "INVALID_MANIFEST";
|
|
@@ -156,13 +97,13 @@ export declare const deploymentEventSchema: z.ZodObject<{
|
|
|
156
97
|
sequence: z.ZodNumber;
|
|
157
98
|
state: z.ZodEnum<{
|
|
158
99
|
queued: "queued";
|
|
159
|
-
preparing: "preparing";
|
|
160
|
-
ready: "ready";
|
|
161
|
-
failed: "failed";
|
|
162
100
|
uploading: "uploading";
|
|
163
101
|
building: "building";
|
|
102
|
+
preparing: "preparing";
|
|
164
103
|
verifying: "verifying";
|
|
165
104
|
"awaiting-approval": "awaiting-approval";
|
|
105
|
+
ready: "ready";
|
|
106
|
+
failed: "failed";
|
|
166
107
|
cancelled: "cancelled";
|
|
167
108
|
}>;
|
|
168
109
|
occurredAt: z.ZodISODateTime;
|
|
@@ -174,9 +115,9 @@ export declare const deploymentResultSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
174
115
|
status: z.ZodLiteral<"pending">;
|
|
175
116
|
state: z.ZodEnum<{
|
|
176
117
|
queued: "queued";
|
|
177
|
-
preparing: "preparing";
|
|
178
118
|
uploading: "uploading";
|
|
179
119
|
building: "building";
|
|
120
|
+
preparing: "preparing";
|
|
180
121
|
verifying: "verifying";
|
|
181
122
|
"awaiting-approval": "awaiting-approval";
|
|
182
123
|
}>;
|
|
@@ -223,8 +164,6 @@ export declare const deploymentResultSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
223
164
|
requestId: z.ZodUUID;
|
|
224
165
|
}, z.core.$strict>], "status">;
|
|
225
166
|
export type DeploymentManifest = z.infer<typeof deploymentManifestSchema>;
|
|
226
|
-
export type DeploymentPlan = z.infer<typeof deploymentPlanSchema>;
|
|
227
|
-
export type DeploymentSource = z.infer<typeof deploymentSourceSchema>;
|
|
228
167
|
export type DeploymentIntent = z.infer<typeof deploymentIntentSchema>;
|
|
229
168
|
export type DeploymentEvent = z.infer<typeof deploymentEventSchema>;
|
|
230
169
|
export type DeploymentResult = z.infer<typeof deploymentResultSchema>;
|
|
@@ -73,35 +73,6 @@ export const deploymentManifestSchema = z
|
|
|
73
73
|
message: `${id} requires ${parent}.`,
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
|
-
export const deploymentSourceSchema = z
|
|
77
|
-
.object({
|
|
78
|
-
inventoryVersion: z.literal(2),
|
|
79
|
-
inventoryProfile: z.string().min(1).max(100),
|
|
80
|
-
sourceDigest: deploymentDigestSchema,
|
|
81
|
-
lockfileDigest: deploymentDigestSchema,
|
|
82
|
-
manifestDigest: deploymentDigestSchema,
|
|
83
|
-
})
|
|
84
|
-
.strict();
|
|
85
|
-
const runtimeImageSchema = z
|
|
86
|
-
.string()
|
|
87
|
-
.regex(/^registry\.[a-z0-9.-]+\/[a-zA-Z0-9/_.-]+@sha256:[a-f0-9]{64}$/);
|
|
88
|
-
export const deploymentPlanSchema = z
|
|
89
|
-
.object({
|
|
90
|
-
contractVersion: z.literal(1),
|
|
91
|
-
requestId: z.uuid(),
|
|
92
|
-
projectId: z.uuid(),
|
|
93
|
-
manifest: deploymentManifestSchema,
|
|
94
|
-
source: deploymentSourceSchema,
|
|
95
|
-
policyDigest: deploymentDigestSchema,
|
|
96
|
-
runtimeImage: runtimeImageSchema,
|
|
97
|
-
configurationRevision: deploymentDigestSchema,
|
|
98
|
-
expectedGeneration: z.number().int().nonnegative(),
|
|
99
|
-
migrationDigests: z.array(deploymentDigestSchema).max(100),
|
|
100
|
-
requiredAuthority: z.enum(["preview", "production-approval"]),
|
|
101
|
-
})
|
|
102
|
-
.strict()
|
|
103
|
-
.refine((plan) => plan.requiredAuthority ===
|
|
104
|
-
(plan.manifest.intent.environment === "production" ? "production-approval" : "preview"), "Production requires exact-candidate approval.");
|
|
105
76
|
export const deploymentErrorSchema = z
|
|
106
77
|
.object({
|
|
107
78
|
code: z.enum([
|
|
@@ -32,9 +32,9 @@ export declare const productionDeploymentSchema: z.ZodObject<{
|
|
|
32
32
|
queued: "queued";
|
|
33
33
|
preparing: "preparing";
|
|
34
34
|
ready: "ready";
|
|
35
|
-
published: "published";
|
|
36
35
|
failed: "failed";
|
|
37
36
|
superseded: "superseded";
|
|
37
|
+
published: "published";
|
|
38
38
|
}>;
|
|
39
39
|
sourceRevision: z.ZodString;
|
|
40
40
|
createdAt: z.ZodString;
|
|
@@ -57,9 +57,9 @@ export declare const productionStateSchema: z.ZodObject<{
|
|
|
57
57
|
queued: "queued";
|
|
58
58
|
preparing: "preparing";
|
|
59
59
|
ready: "ready";
|
|
60
|
-
published: "published";
|
|
61
60
|
failed: "failed";
|
|
62
61
|
superseded: "superseded";
|
|
62
|
+
published: "published";
|
|
63
63
|
}>;
|
|
64
64
|
sourceRevision: z.ZodString;
|
|
65
65
|
createdAt: z.ZodString;
|
|
@@ -19,8 +19,8 @@ export declare const stagingDeploymentSchema: z.ZodObject<{
|
|
|
19
19
|
preparing: "preparing";
|
|
20
20
|
ready: "ready";
|
|
21
21
|
failed: "failed";
|
|
22
|
-
superseded: "superseded";
|
|
23
22
|
deployed: "deployed";
|
|
23
|
+
superseded: "superseded";
|
|
24
24
|
}>;
|
|
25
25
|
summary: z.ZodNullable<z.ZodString>;
|
|
26
26
|
sourceRevision: z.ZodString;
|
|
@@ -48,8 +48,8 @@ export declare const stagingStateSchema: z.ZodObject<{
|
|
|
48
48
|
preparing: "preparing";
|
|
49
49
|
ready: "ready";
|
|
50
50
|
failed: "failed";
|
|
51
|
-
superseded: "superseded";
|
|
52
51
|
deployed: "deployed";
|
|
52
|
+
superseded: "superseded";
|
|
53
53
|
}>;
|
|
54
54
|
summary: z.ZodNullable<z.ZodString>;
|
|
55
55
|
sourceRevision: z.ZodString;
|
package/dist/launch.js
CHANGED
|
@@ -2,14 +2,14 @@ import { existsSync, lstatSync, mkdirSync, readdirSync, realpathSync, rmdirSync
|
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { spawnSync } from 'node:child_process';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { scaffoldTanstack } from './
|
|
5
|
+
import { scaffoldTanstack } from './scaffold/tanstack.js';
|
|
6
6
|
import { bootstrapWorkspace, assertWorkspaceRuntime } from './scaffold/bootstrap.js';
|
|
7
7
|
import { scaffoldStyling } from './scaffold/styling.js';
|
|
8
8
|
import { json, put, sharedPackage } from './scaffold/files.js';
|
|
9
|
-
import { CapabilityEditor } from './
|
|
10
|
-
import { addCapabilityRecipe, composeCapabilities } from './
|
|
11
|
-
import { launchCompositionSchema } from './composition.js';
|
|
12
|
-
import { runStagedTransaction } from './transaction.js';
|
|
9
|
+
import { CapabilityEditor } from './composition/editor.js';
|
|
10
|
+
import { addCapabilityRecipe, composeCapabilities } from './composition/recipes.js';
|
|
11
|
+
import { launchCompositionSchema } from './composition/composition.js';
|
|
12
|
+
import { runStagedTransaction } from './transactions/transaction.js';
|
|
13
13
|
import { configureDependencyPatches, writeDependencyAudit } from './dependency-patches.js';
|
|
14
14
|
import { setPnpmPolicy } from './pnpm-policy.js';
|
|
15
15
|
import { GENERATOR_VERSION } from './version.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { commandArguments } from '../cli-arguments.js';
|
|
2
|
+
import { createReporter } from '../cli-output.js';
|
|
3
|
+
import { type SecretStore } from './state.js';
|
|
4
|
+
type Request = (path: string, method: string, body?: unknown) => Promise<unknown>;
|
|
5
|
+
export declare function runLogin({ options, origin, reporter, store, readCredential, request, sleep, }: {
|
|
6
|
+
options: ReturnType<typeof commandArguments>;
|
|
7
|
+
origin: string;
|
|
8
|
+
reporter: ReturnType<typeof createReporter>;
|
|
9
|
+
store: SecretStore;
|
|
10
|
+
readCredential: () => Promise<unknown>;
|
|
11
|
+
request: Request;
|
|
12
|
+
sleep?: (ms: number) => Promise<void>;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
export {};
|