@astrale-os/sdk 0.6.0-beta.13 → 0.6.0-beta.15

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.
Files changed (175) hide show
  1. package/README.md +4 -0
  2. package/dist/deployment/adapter/adapter.d.ts +9 -11
  3. package/dist/deployment/adapter/legacy/adapter.d.ts +0 -10
  4. package/dist/deployment/adapter/legacy/deploy/context.d.ts +0 -2
  5. package/dist/deployment/adapter/legacy/deploy/result.d.ts +2 -3
  6. package/dist/deployment/adapter/legacy/index.d.ts +12 -12
  7. package/dist/deployment/adapter/legacy/prepare/context.d.ts +0 -2
  8. package/dist/deployment/adapter/release/context.d.ts +23 -3
  9. package/dist/deployment/adapter/release/index.d.ts +1 -0
  10. package/dist/deployment/adapter/release/list.d.ts +41 -0
  11. package/dist/deployment/adapter/release/list.js +1 -0
  12. package/dist/deployment/address/index.d.ts +1 -1
  13. package/dist/deployment/address/index.js +1 -0
  14. package/dist/deployment/address/summary.d.ts +31 -1
  15. package/dist/deployment/address/summary.js +117 -1
  16. package/dist/deployment/build/index.d.ts +1 -1
  17. package/dist/deployment/build/index.js +1 -1
  18. package/dist/deployment/build/manifest.d.ts +5 -0
  19. package/dist/deployment/build/manifest.js +10 -0
  20. package/dist/deployment/index.d.ts +1 -1
  21. package/dist/deployment/release/legacy/index.d.ts +17 -12
  22. package/dist/deployment/release/legacy/index.js +17 -12
  23. package/dist/deployment/verify/readiness/deployment.js +3 -13
  24. package/dist/deployment/verify/readiness/fetch.d.ts +13 -0
  25. package/dist/deployment/verify/readiness/fetch.js +26 -0
  26. package/dist/deployment/verify/readiness/identity.d.ts +3 -6
  27. package/dist/deployment/verify/readiness/identity.js +3 -3
  28. package/dist/deployment/verify/readiness/index.d.ts +12 -8
  29. package/dist/deployment/verify/readiness/index.js +15 -4
  30. package/dist/deployment/verify/readiness/legacy/index.d.ts +2 -0
  31. package/dist/deployment/verify/readiness/legacy/index.js +2 -0
  32. package/dist/deployment/verify/readiness/legacy/publication.d.ts +12 -0
  33. package/dist/deployment/verify/readiness/legacy/publication.js +23 -0
  34. package/dist/deployment/verify/readiness/release.d.ts +8 -0
  35. package/dist/deployment/verify/readiness/release.js +22 -0
  36. package/dist/execution/identity/authentication.d.ts +14 -3
  37. package/dist/execution/identity/authentication.js +16 -7
  38. package/dist/execution/identity/callback.d.ts +5 -2
  39. package/dist/execution/identity/callback.js +11 -5
  40. package/dist/execution/identity/delivery.d.ts +11 -4
  41. package/dist/execution/identity/delivery.js +47 -20
  42. package/dist/execution/identity/identity.d.ts +12 -6
  43. package/dist/execution/identity/identity.js +3 -3
  44. package/dist/execution/invocation/admission/authentication.d.ts +1 -2
  45. package/dist/execution/invocation/admission/authentication.js +1 -2
  46. package/dist/execution/invocation/admission/authority.d.ts +10 -4
  47. package/dist/execution/invocation/admission/authority.js +5 -1
  48. package/dist/execution/invocation/invocation.js +51 -14
  49. package/dist/execution/runtime/index.d.ts +1 -0
  50. package/dist/execution/runtime/index.js +1 -0
  51. package/dist/execution/runtime/load.d.ts +3 -3
  52. package/dist/execution/runtime/load.js +3 -2
  53. package/dist/execution/runtime/release.d.ts +22 -0
  54. package/dist/execution/runtime/release.js +14 -0
  55. package/dist/execution/serve.d.ts +2 -2
  56. package/dist/execution/service/create.js +9 -7
  57. package/dist/execution/service/release.d.ts +2 -2
  58. package/dist/execution/service/release.js +3 -2
  59. package/dist/execution/service/service.d.ts +9 -5
  60. package/dist/execution/service/serving/delivery.d.ts +6 -0
  61. package/dist/execution/service/{publication → serving}/delivery.js +5 -1
  62. package/dist/execution/service/{publication → serving}/index.d.ts +1 -1
  63. package/dist/execution/service/serving/installation.d.ts +4 -0
  64. package/dist/execution/service/serving/installation.js +9 -0
  65. package/dist/execution/service/serving/legacy/index.d.ts +15 -0
  66. package/dist/execution/service/serving/legacy/index.js +19 -0
  67. package/dist/execution/service/serving/source.d.ts +18 -0
  68. package/dist/execution/service/serving/source.js +19 -0
  69. package/dist/execution/workflows/run.js +1 -1
  70. package/dist/platform/versioning/name.d.ts +4 -3
  71. package/dist/platform/versioning/name.js +4 -3
  72. package/dist/project/define.js +58 -28
  73. package/dist/project/install-command.d.ts +10 -0
  74. package/dist/project/install-command.js +13 -0
  75. package/dist/project/project.d.ts +4 -2
  76. package/dist/tooling/cli/arguments.d.ts +1 -3
  77. package/dist/tooling/cli/arguments.js +51 -22
  78. package/dist/tooling/cli/commit.d.ts +23 -0
  79. package/dist/tooling/cli/commit.js +216 -0
  80. package/dist/tooling/cli/deploy-mode.d.ts +16 -13
  81. package/dist/tooling/cli/deploy-mode.js +45 -36
  82. package/dist/tooling/cli/deploy-result.d.ts +10 -7
  83. package/dist/tooling/cli/deploy-result.js +4 -3
  84. package/dist/tooling/cli/dotenv.d.ts +2 -2
  85. package/dist/tooling/cli/dotenv.js +3 -33
  86. package/dist/tooling/cli/help.js +73 -29
  87. package/dist/tooling/cli/immutable-deployment.d.ts +27 -0
  88. package/dist/tooling/cli/immutable-deployment.js +95 -0
  89. package/dist/tooling/cli/index.d.ts +3 -4
  90. package/dist/tooling/cli/index.js +2 -3
  91. package/dist/tooling/cli/legacy/deploy-result.d.ts +5 -3
  92. package/dist/tooling/cli/legacy/deploy-result.js +5 -3
  93. package/dist/tooling/cli/{development → legacy/development}/candidate.d.ts +3 -4
  94. package/dist/tooling/cli/{development → legacy/development}/candidate.js +7 -14
  95. package/dist/tooling/cli/legacy/development/deployment.d.ts +10 -0
  96. package/dist/tooling/cli/legacy/development/deployment.js +20 -0
  97. package/dist/tooling/cli/legacy/development/deprecation.d.ts +11 -0
  98. package/dist/tooling/cli/legacy/development/deprecation.js +13 -0
  99. package/dist/tooling/cli/legacy/development/develop.d.ts +15 -0
  100. package/dist/tooling/cli/legacy/development/develop.js +142 -0
  101. package/dist/tooling/cli/legacy/development/index.d.ts +21 -0
  102. package/dist/tooling/cli/legacy/development/index.js +21 -0
  103. package/dist/tooling/cli/legacy/development/report.d.ts +7 -0
  104. package/dist/tooling/cli/{development → legacy/development}/report.js +2 -5
  105. package/dist/tooling/cli/legacy/development/secrets-file.d.ts +2 -0
  106. package/dist/tooling/cli/legacy/development/secrets-file.js +33 -0
  107. package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +5 -3
  108. package/dist/tooling/cli/legacy/stable-target-deploy.d.ts +40 -0
  109. package/dist/tooling/cli/legacy/stable-target-deploy.js +102 -0
  110. package/dist/tooling/cli/list.d.ts +114 -0
  111. package/dist/tooling/cli/list.js +297 -0
  112. package/dist/tooling/cli/orchestrate.d.ts +1 -1
  113. package/dist/tooling/cli/orchestrate.js +91 -95
  114. package/dist/tooling/cli/secrets.d.ts +9 -0
  115. package/dist/tooling/cli/secrets.js +19 -0
  116. package/package.json +7 -7
  117. package/dist/deployment/verify/readiness/publication.d.ts +0 -11
  118. package/dist/deployment/verify/readiness/publication.js +0 -41
  119. package/dist/execution/service/publication/delivery.d.ts +0 -2
  120. package/dist/execution/service/publication/installation.d.ts +0 -3
  121. package/dist/execution/service/publication/installation.js +0 -8
  122. package/dist/execution/service/publication/source.d.ts +0 -3
  123. package/dist/execution/service/publication/source.js +0 -11
  124. package/dist/tooling/cli/astrale/authority.d.ts +0 -5
  125. package/dist/tooling/cli/astrale/authority.js +0 -11
  126. package/dist/tooling/cli/astrale/executable.d.ts +0 -2
  127. package/dist/tooling/cli/astrale/executable.js +0 -47
  128. package/dist/tooling/cli/astrale/failure.d.ts +0 -6
  129. package/dist/tooling/cli/astrale/failure.js +0 -48
  130. package/dist/tooling/cli/astrale/instance.d.ts +0 -11
  131. package/dist/tooling/cli/astrale/instance.js +0 -52
  132. package/dist/tooling/cli/astrale/process.d.ts +0 -13
  133. package/dist/tooling/cli/astrale/process.js +0 -94
  134. package/dist/tooling/cli/astrale/version.d.ts +0 -18
  135. package/dist/tooling/cli/astrale/version.js +0 -55
  136. package/dist/tooling/cli/development/deployment.d.ts +0 -16
  137. package/dist/tooling/cli/development/deployment.js +0 -39
  138. package/dist/tooling/cli/development/develop.d.ts +0 -11
  139. package/dist/tooling/cli/development/develop.js +0 -243
  140. package/dist/tooling/cli/development/release-evidence.d.ts +0 -4
  141. package/dist/tooling/cli/development/release-evidence.js +0 -10
  142. package/dist/tooling/cli/development/report.d.ts +0 -9
  143. package/dist/tooling/cli/development/session-file.d.ts +0 -53
  144. package/dist/tooling/cli/development/session-file.js +0 -337
  145. package/dist/tooling/cli/development/target-lock.d.ts +0 -16
  146. package/dist/tooling/cli/development/target-lock.js +0 -68
  147. package/dist/tooling/cli/development/view.d.ts +0 -28
  148. package/dist/tooling/cli/development/view.js +0 -151
  149. package/dist/tooling/cli/environment-release.d.ts +0 -24
  150. package/dist/tooling/cli/environment-release.js +0 -46
  151. package/dist/tooling/cli/evidence.d.ts +0 -14
  152. package/dist/tooling/cli/evidence.js +0 -53
  153. package/dist/tooling/cli/installation/index.d.ts +0 -2
  154. package/dist/tooling/cli/installation/index.js +0 -1
  155. package/dist/tooling/cli/installation/observation.d.ts +0 -10
  156. package/dist/tooling/cli/installation/observation.js +0 -44
  157. package/dist/tooling/cli/installation/reconcile.d.ts +0 -32
  158. package/dist/tooling/cli/installation/reconcile.js +0 -122
  159. /package/dist/execution/service/{publication → serving}/index.js +0 -0
  160. /package/dist/tooling/cli/{credential.d.ts → legacy/development/credential.d.ts} +0 -0
  161. /package/dist/tooling/cli/{credential.js → legacy/development/credential.js} +0 -0
  162. /package/dist/tooling/cli/{development → legacy/development}/lease.d.ts +0 -0
  163. /package/dist/tooling/cli/{development → legacy/development}/lease.js +0 -0
  164. /package/dist/tooling/cli/{development → legacy/development}/lifecycle.d.ts +0 -0
  165. /package/dist/tooling/cli/{development → legacy/development}/lifecycle.js +0 -0
  166. /package/dist/tooling/cli/{development → legacy/development}/project-imports.d.ts +0 -0
  167. /package/dist/tooling/cli/{development → legacy/development}/project-imports.js +0 -0
  168. /package/dist/tooling/cli/{development → legacy/development}/project-lock.d.ts +0 -0
  169. /package/dist/tooling/cli/{development → legacy/development}/project-lock.js +0 -0
  170. /package/dist/tooling/cli/{development → legacy/development}/rebuild.d.ts +0 -0
  171. /package/dist/tooling/cli/{development → legacy/development}/rebuild.js +0 -0
  172. /package/dist/tooling/cli/{development → legacy/development}/source-watch.d.ts +0 -0
  173. /package/dist/tooling/cli/{development → legacy/development}/source-watch.js +0 -0
  174. /package/dist/tooling/cli/{development → legacy/development}/sources.d.ts +0 -0
  175. /package/dist/tooling/cli/{development → legacy/development}/sources.js +0 -0
@@ -6,9 +6,7 @@ export type { DeploymentSecretsState } from '../../deployment/index.js';
6
6
  /**
7
7
  * `astrale-domain deploy <environment> --json` on stdout: the one deployment the deploy made or
8
8
  * reused, which CI installs by its URL. Progress and warnings go to stderr. It names no instance
9
- * and no version: a deploy numbers nothing, and the deploy of an immutable deployment installs
10
- * nothing. A legacy environment that declares `installation` still installs while it deploys and
11
- * reports that outcome on stderr only.
9
+ * and no version: a deploy numbers nothing and installs nothing.
12
10
  */
13
11
  export interface DeployResultV1 {
14
12
  readonly format: 'astrale.deploy-result';
@@ -62,14 +60,19 @@ export interface DeployResultV1 {
62
60
  readonly secrets?: {
63
61
  readonly state: DeploymentSecretsState;
64
62
  };
65
- /** The commit the deployment was built from, as its deployment record declares it. */
63
+ /**
64
+ * The commit the deployment was built from, as its deployment record declares it: the commit of
65
+ * the deploy that created it. A reused deployment keeps its record, so this can be an earlier
66
+ * commit than the one the deploy ran from; the label covers the release, never the commit.
67
+ */
66
68
  readonly commit: DeploymentCommitV1 | null;
67
69
  }
68
70
  /**
69
71
  * The deploy result of one immutable deployment, from the ready result of the adapter's
70
- * `deployRelease`. Its release, build, Schema revision and URL are those of the release the SDK
71
- * sealed before deploying; the deployment record the adapter returned must declare exactly that
72
- * release at that URL, so the result never names a release the deployment does not serve.
72
+ * `deployRelease`. Its release, build, Schema revision and URL are those the SDK sealed before
73
+ * deploying; the deployment record the adapter returned must declare exactly that release at that
74
+ * URL, so the result never names a release the deployment does not serve. Its commit is the
75
+ * record's, which a reused deployment kept from the deploy that created it.
73
76
  */
74
77
  export declare function deployResult(input: {
75
78
  readonly environment: string;
@@ -6,9 +6,10 @@ const SECRETS_BY_STATE = Object.freeze({
6
6
  });
7
7
  /**
8
8
  * The deploy result of one immutable deployment, from the ready result of the adapter's
9
- * `deployRelease`. Its release, build, Schema revision and URL are those of the release the SDK
10
- * sealed before deploying; the deployment record the adapter returned must declare exactly that
11
- * release at that URL, so the result never names a release the deployment does not serve.
9
+ * `deployRelease`. Its release, build, Schema revision and URL are those the SDK sealed before
10
+ * deploying; the deployment record the adapter returned must declare exactly that release at that
11
+ * URL, so the result never names a release the deployment does not serve. Its commit is the
12
+ * record's, which a reused deployment kept from the deploy that created it.
12
13
  */
13
14
  export function deployResult(input) {
14
15
  const { release, deployment } = input;
@@ -7,6 +7,8 @@
7
7
  * runtime in dev, pushed to a secret store in prod). No `process.env` mutation,
8
8
  * no interpolation magic beyond `${VAR}` against earlier keys in the same file.
9
9
  */
10
+ /** Parse one dotenv document into a flat record; `${VAR}` reads only earlier keys. */
11
+ export declare function parseDotenv(contents: string): Record<string, string>;
10
12
  /**
11
13
  * Read + parse a dotenv file the preset explicitly DECLARED (`secrets:`).
12
14
  * Declared-but-absent is a wiring error (the gitignored file was never created
@@ -15,5 +17,3 @@
15
17
  * that exists but holds no keys is legitimate (a domain with no secrets yet).
16
18
  */
17
19
  export declare function loadDeclaredSecrets(path: string, declaration: string): Record<string, string>;
18
- /** Load one explicit development-session secret snapshot without following a leaf symlink. */
19
- export declare function loadPrivateSecretsFile(path: string, platform?: NodeJS.Platform): Record<string, string>;
@@ -7,8 +7,9 @@
7
7
  * runtime in dev, pushed to a secret store in prod). No `process.env` mutation,
8
8
  * no interpolation magic beyond `${VAR}` against earlier keys in the same file.
9
9
  */
10
- import { closeSync, constants, fstatSync, openSync, readFileSync } from 'node:fs';
11
- function parseDotenv(contents) {
10
+ import { readFileSync } from 'node:fs';
11
+ /** Parse one dotenv document into a flat record; `${VAR}` reads only earlier keys. */
12
+ export function parseDotenv(contents) {
12
13
  const out = {};
13
14
  for (const raw of contents.split('\n')) {
14
15
  const line = raw.trim();
@@ -52,34 +53,3 @@ export function loadDeclaredSecrets(path, declaration) {
52
53
  }
53
54
  return parseDotenv(contents);
54
55
  }
55
- /** Load one explicit development-session secret snapshot without following a leaf symlink. */
56
- export function loadPrivateSecretsFile(path, platform = process.platform) {
57
- if (platform === 'win32') {
58
- throw new Error('--secrets-file is unavailable on Windows until private no-reparse file admission is supported.');
59
- }
60
- let descriptor;
61
- try {
62
- descriptor = openSync(path, constants.O_RDONLY | constants.O_NOFOLLOW);
63
- }
64
- catch (cause) {
65
- if (cause instanceof Error && 'code' in cause && cause.code === 'ENOENT') {
66
- throw new Error(`Secrets file '${path}' is missing.`, { cause });
67
- }
68
- if (cause instanceof Error && 'code' in cause && cause.code === 'ELOOP') {
69
- throw new Error(`Secrets file '${path}' must be a regular file and not a symlink.`, { cause });
70
- }
71
- throw cause;
72
- }
73
- try {
74
- const info = fstatSync(descriptor);
75
- if (!info.isFile())
76
- throw new Error(`Secrets file '${path}' must be a regular file.`);
77
- if ((info.mode & 0o077) !== 0) {
78
- throw new Error(`Secrets file '${path}' must not be accessible by group or other users.`);
79
- }
80
- return parseDotenv(readFileSync(descriptor, 'utf8'));
81
- }
82
- finally {
83
- closeSync(descriptor);
84
- }
85
- }
@@ -1,3 +1,4 @@
1
+ import { installCommand } from '../../project/install-command.js';
1
2
  import { COMMANDS } from './arguments.js';
2
3
  /** Resolve help without parsing a project or performing any command effects. */
3
4
  export function helpRequest(argv) {
@@ -12,15 +13,16 @@ export function helpText(command) {
12
13
  export const ERROR_USAGE = `Usage: astrale-domain <command> [options]
13
14
  Run "astrale-domain --help" for available commands.
14
15
  `;
15
- const GLOBAL_HELP = `Build, develop, deploy, test, lint, and package Astrale Domains.
16
+ const GLOBAL_HELP = `Build, develop, deploy, list, test, lint, and package Astrale Domains.
16
17
 
17
18
  Usage:
18
19
  astrale-domain <command> [options]
19
20
 
20
21
  Commands:
21
- dev [environment] Remotely deploy and watch one Project Environment.
22
+ dev [environment] Deprecated: use deploy, then astrale domain install.
22
23
  build Build, verify and print the build digest.
23
- deploy <environment> Deploy and optionally install one Environment.
24
+ deploy <environment> Deploy one Environment; never installs.
25
+ list List the deployments of the Project's Environments.
24
26
  test Run Project tests, optionally against one Environment.
25
27
  lint Check Domain source and architecture.
26
28
  package Prepare public declarations for publication.
@@ -55,22 +57,25 @@ Behavior:
55
57
  checks afterwards. Failed installations leave local changes available for repair.
56
58
  For an older SDK without this command: pnpm dlx @astrale-os/sdk@beta upgrade.
57
59
  `,
58
- dev: `Build, verify, remotely deploy, and watch one Project Environment.
60
+ dev: `Build, verify, remotely deploy, and watch one Project Environment (deprecated).
59
61
 
60
62
  Usage:
61
63
  astrale-domain dev [environment] [options]
62
64
 
65
+ Deprecated:
66
+ Development is not a command of the deployment model. Deploy the Environment with
67
+ astrale-domain deploy <environment>, then install the URL it prints with
68
+ astrale domain install <url> --direct -i <instance>. dev keeps its behavior until
69
+ it is removed and warns on every run.
70
+
63
71
  Arguments:
64
72
  environment Project Environment name; defaults to development.
65
73
 
66
74
  Options:
67
75
  --environment <name> Select the environment without a positional argument.
68
- --deploy-only Suppress this run's configured Kernel installation.
69
- --as <identity> Select the Astrale identity for Services and installation calls.
70
- --session-file <path> Write one retained DevelopmentSessionFileV1 snapshot at an
71
- absolute path in a caller-owned private directory.
76
+ --as <identity> Select the Astrale identity for the adapter's provider calls.
72
77
  --credential-file <path>
73
- Use one private operator credential for provider and Kernel
78
+ Use one private operator credential for the adapter's provider
74
79
  calls without exposing it in Project configuration.
75
80
  --secrets-file <path> Load one private, absolute secrets file for this development
76
81
  session instead of the adapter-declared secrets file.
@@ -80,25 +85,23 @@ Behavior:
80
85
  The selected Environment must exist; no other Environment is chosen as a fallback.
81
86
  Builds and verifies the Domain, Runtime, frontend, and adapter artifact, then
82
87
  deploys it through the selected Environment. It never starts a local Worker,
83
- Vite server, or tunnel. Imported source changes produce serialized remote updates;
84
- configuration changes require restarting the command.
88
+ Vite server, or tunnel, and never installs the Domain: install the URL it prints with
89
+ ${installCommand()}. Imported source changes
90
+ produce serialized remote updates; configuration changes require restarting the
91
+ command. It serves only legacy direct-mode Environments; an Environment that
92
+ deploys immutable deployments is refused.
85
93
  A shared direct-provider target additionally requires an external single-writer
86
94
  boundary such as a CI/CD concurrency group.
87
- The session file is machine-readable and authoritative when requested; human
88
- stdout/stderr remains diagnostic. It requires an adapter that reports exact
89
- installed Release evidence, so it is rejected for an Environment without an
90
- installation and when --deploy-only suppresses installation.
91
95
  A credential file is admitted and read once. Its value is passed only to the
92
- deployment adapter, configured Kernel installation, and default View; it never
93
- enters Domain Runtime secrets, diagnostics, deployment evidence, or the session
94
- file. It is currently unavailable on Windows because private no-reparse file
95
- admission is absent.
96
+ deployment adapter; it never enters Domain Runtime secrets or diagnostics. It is
97
+ currently unavailable on Windows because private no-reparse file admission is
98
+ absent.
96
99
  A secrets-file override is read once, passed to the Domain runtime as secrets,
97
100
  never mutates the authored project, and is not watched for later changes. It is
98
101
  also unavailable on Windows because private no-reparse admission is absent.
99
102
 
100
103
  Stopping the watcher stops only local build orchestration. The remote deployment
101
- and optional Kernel installation remain available.
104
+ remains available.
102
105
  `,
103
106
  build: `Build and verify a Domain without deploying it, and print its build digest.
104
107
 
@@ -129,20 +132,61 @@ Arguments:
129
132
  Options:
130
133
  --environment <name> Select the environment without a positional argument.
131
134
  --json Print one DeployResultV1 on stdout; progress goes to stderr.
132
- --deploy-only Suppress this run's configured Kernel installation.
133
- --as <identity> Select the Astrale identity for Services and installation calls.
135
+ --as <identity> Select the Astrale identity for the adapter's provider calls.
134
136
  -h, --help Show help for deploy.
135
137
 
136
138
  Behavior:
137
- Builds and verifies the Domain, Runtime, and provider artifact, loads declared
138
- secrets, and invokes the selected adapter. It then verifies the resulting Release.
139
- When the adapter has a bundler, deploy rebuilds the Bundle exactly as build does and
140
- warns when the uploaded code has another build digest.
141
- When the Environment declares installation, reconciles it after provider readiness.
142
- An Environment without installation performs zero Kernel calls.
139
+ Builds and verifies the Domain and Runtime, rebuilds the Bundle exactly as build
140
+ does, loads declared secrets, and deploys through the selected adapter. It never
141
+ installs the Domain: install the URL it prints with
142
+ ${installCommand()}.
143
+ The Environment's configuration selects how it deploys. An adapter that implements
144
+ deployRelease makes one immutable deployment per release and calls no instance: the
145
+ SDK seals the release for the deployment's URL, records the commit it was built
146
+ from, and the adapter creates that deployment or reuses it (adapter-astrale on
147
+ Admin's Services, through astrale call --admin). A new deployment binds the
148
+ Environment's current secrets; a reused one has its own secrets updated in place,
149
+ served once propagated; no other deployment's secrets change. Any other Environment
150
+ replaces its stable target in place (legacy direct mode, deprecated), warns on
151
+ stderr, serves a v3 Publication only, and warns when the uploaded code has another
152
+ build digest than the Bundle.
143
153
  With --json, stdout holds only one DeployResultV1: the deployment's URL, which
144
154
  astrale domain install takes, its digests, adapter and state. Exit status: 0 deployed,
145
- 1 failed, 2 usage error; a failed run prints nothing on stdout.
155
+ 1 failed or refused, 2 usage error; a failed run prints nothing on stdout.
156
+ `,
157
+ list: `List the deployments of the Project's Environments that their hosts keep.
158
+
159
+ Usage:
160
+ astrale-domain list [--environment <name>] [--json]
161
+
162
+ Options:
163
+ --environment <name> List one Environment instead of every Environment.
164
+ --json Print one ListResultV1 on stdout; notices go to stderr.
165
+ --as <identity> Select the Astrale identity whose deployments the hosts list.
166
+ -h, --help Show help for list.
167
+
168
+ Behavior:
169
+ Asks the adapter of each Environment that deploys immutable deployments for the
170
+ deployments its host keeps for the caller, and prints each one's release, its name,
171
+ Environment and state, its last call and its expiry, and the URL
172
+ ${installCommand()} takes. A name is computed
173
+ from the deployment's record and never stored, such as 1.4.2 + 7 commits · a1b2c3d ·
174
+ staging.
175
+ A preview expires 30 days after its activation or its last call, whichever is
176
+ later; a published deployment never does. Last calls are read from the host as it
177
+ counts them, so a host whose last calls cannot be read is not listed. A platform
178
+ dispatch namespace reads them from its calls dataset, and without Account Analytics
179
+ Read lists its deployments without last calls or expiries.
180
+ Listing changes nothing, at any host or instance.
181
+ An Environment in legacy direct mode, refused by deploy, or whose adapter lists no
182
+ deployments is reported on stderr and, with --json, under unlisted. A deployment
183
+ whose record this SDK does not admit is still listed, from what its host knows.
184
+ With --json, each deployment carries its call target: the path of its node on
185
+ Admin's Services, for astrale call "<path>.method.setSecret" --admin, or the
186
+ namespace and script of a platform dispatch namespace, which its operator tooling
187
+ takes.
188
+ Exit status: 0 listed, 1 a host could not be listed (with --json, nothing on
189
+ stdout), 2 usage error.
146
190
  `,
147
191
  test: `Run Project tests locally or against one selected Environment.
148
192
 
@@ -0,0 +1,27 @@
1
+ import type { Adapter, Build, LegacyAdapter, ResolvedRuntimeReference } from '../../deployment/index.js';
2
+ import type { DeployResultV1 } from './deploy-result.js';
3
+ /**
4
+ * Deploy one canonical Environment (CT33) as the immutable deployment of one sealed release.
5
+ *
6
+ * The SDK derives everything before the adapter's only effectful call: it bundles exactly as
7
+ * `astrale-domain build` does, asks the adapter to freeze the Environment's configuration and say
8
+ * where its host places deployments, derives the deployment label and URL from them (S3), seals
9
+ * the `DomainRelease` v4 the deployment serves at that URL (S4a), and reads the commit it is built
10
+ * from. `deployRelease` then creates that deployment or reuses it. The SDK makes no Kernel call,
11
+ * the deploy calls no instance and installs nothing: `astrale domain install <url>` installs the
12
+ * URL it prints.
13
+ *
14
+ * Returns the deploy result, or nothing once a failure is reported on stderr.
15
+ */
16
+ export declare function deployImmutable(input: {
17
+ readonly projectDir: string;
18
+ readonly environment: string;
19
+ /** A canonical Environment's adapter (CT33), which implements adapter interface v2. */
20
+ readonly adapter: Adapter<object> | LegacyAdapter<object>;
21
+ readonly parameters: object;
22
+ readonly build: Build;
23
+ readonly runtime: ResolvedRuntimeReference;
24
+ readonly identity?: string;
25
+ readonly signal: AbortSignal;
26
+ readonly report: (line: string) => void;
27
+ }): Promise<DeployResultV1 | undefined>;
@@ -0,0 +1,95 @@
1
+ import { resolve } from 'node:path';
2
+ import { deploymentContent, deploymentLabel, deploymentLine, deploymentUrl, } from '../../deployment/address/index.js';
3
+ import { assemble } from '../../deployment/index.js';
4
+ import { bundleBuild } from './build.js';
5
+ import { deploymentCommit } from './commit.js';
6
+ import { deployResult } from './deploy-result.js';
7
+ import { error } from './log.js';
8
+ import { environmentSecrets } from './secrets.js';
9
+ /**
10
+ * Deploy one canonical Environment (CT33) as the immutable deployment of one sealed release.
11
+ *
12
+ * The SDK derives everything before the adapter's only effectful call: it bundles exactly as
13
+ * `astrale-domain build` does, asks the adapter to freeze the Environment's configuration and say
14
+ * where its host places deployments, derives the deployment label and URL from them (S3), seals
15
+ * the `DomainRelease` v4 the deployment serves at that URL (S4a), and reads the commit it is built
16
+ * from. `deployRelease` then creates that deployment or reuses it. The SDK makes no Kernel call,
17
+ * the deploy calls no instance and installs nothing: `astrale domain install <url>` installs the
18
+ * URL it prints.
19
+ *
20
+ * Returns the deploy result, or nothing once a failure is reported on stderr.
21
+ */
22
+ export async function deployImmutable(input) {
23
+ const { parameters, environment, build, signal } = input;
24
+ const adapter = releaseAdapter(input.adapter);
25
+ const identity = input.identity === undefined ? {} : { identity: input.identity };
26
+ const bundle = await bundleBuild({
27
+ bundler: adapter.bundler,
28
+ projectDir: input.projectDir,
29
+ build,
30
+ runtime: input.runtime,
31
+ signal,
32
+ });
33
+ const secrets = environmentSecrets(adapter, parameters, input.projectDir, input.runtime.runtime);
34
+ const configuration = adapter.configure(parameters, {
35
+ environment,
36
+ secrets: Object.freeze(Object.keys(secrets).sort()),
37
+ });
38
+ const placement = await adapter.placement(parameters, { environment, signal, ...identity });
39
+ const origin = build.schema.compiled.root.origin;
40
+ const label = deploymentLabel(deploymentLine({ origin, environment, addressing: placement.addressing }), deploymentContent(bundle.digest, configuration));
41
+ const release = assemble(build, bundle.digest, deploymentUrl(label, placement.routingDomain));
42
+ const commit = await deploymentCommit({
43
+ projectDir: input.projectDir,
44
+ // The configuration sits in the Project directory, and names its runtime relative to it.
45
+ runtimeModule: resolve(input.projectDir, input.runtime.reference.path),
46
+ signal,
47
+ });
48
+ const deployed = await adapter.deployRelease(parameters, {
49
+ projectDir: input.projectDir,
50
+ environment,
51
+ ...identity,
52
+ secrets,
53
+ bundle,
54
+ configuration,
55
+ placement,
56
+ label,
57
+ release,
58
+ commit,
59
+ signal,
60
+ });
61
+ if (deployed.status !== 'ready') {
62
+ error(`Deployment failed during ${deployed.phase}: ${deployed.error.message}`);
63
+ return undefined;
64
+ }
65
+ const result = deployResult({ environment, adapter, release, deployment: deployed });
66
+ input.report(`Domain: ${result.origin}`);
67
+ input.report(`Environment: ${environment}`);
68
+ input.report(`Adapter: ${result.deployment.adapter}`);
69
+ input.report(`Deployment: ${label} · ${result.deployment.state}`);
70
+ input.report(`URL: ${result.url}`);
71
+ input.report(`Release: ${release.document.digest}`);
72
+ input.report(`Build: ${release.buildDigest}`);
73
+ input.report(secretsLine(label, result.secrets.state));
74
+ input.report('Ready: deployment verified');
75
+ return result;
76
+ }
77
+ /**
78
+ * What the deploy did to the secrets of the one deployment it made or reused: `bound` to the new
79
+ * deployment, or `updated` or left `unchanged` in place on the reused one. No other deployment's
80
+ * secrets are ever written. A value rewritten in place is served once the host propagated it,
81
+ * which is eventually consistent (about 4 s on Workers for Platforms, AM-114).
82
+ */
83
+ function secretsLine(label, state) {
84
+ return state === 'updated'
85
+ ? `Secrets: updated in place on ${label}; the new values are served once propagated ` +
86
+ '(eventually consistent, about 4 s)'
87
+ : `Secrets: ${state}`;
88
+ }
89
+ /** The adapter of a canonical Environment: CT33 selects canonical only beside `deployRelease`. */
90
+ function releaseAdapter(adapter) {
91
+ if (!('deployRelease' in adapter) || typeof adapter.deployRelease !== 'function') {
92
+ throw new TypeError(`Adapter ${adapter.name}@${adapter.version} implements no deployRelease and deploys no immutable deployment.`);
93
+ }
94
+ return adapter;
95
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `@astrale-os/sdk/cli` — the `astrale-domain` CLI
3
- * (dev | build | deploy | test | lint | package), explicit dotenv boundary, and admitted
4
- * development-session file representation.
3
+ * (dev | build | deploy | list | test | lint | package), its JSON results, and the explicit dotenv
4
+ * boundary. `dev` is deprecated and lives in `legacy/development/`.
5
5
  *
6
6
  * Node-only: the CLI imports `node:fs`/`node:module`/`node:url` and runs under
7
7
  * Bun (it imports the project's `astrale.config.ts` directly). This subpath is
@@ -13,6 +13,5 @@
13
13
  export { run } from './run.js';
14
14
  export type { BuildResultV1 } from './build.js';
15
15
  export type { DeployResultV1, DeploymentSecretsState } from './deploy-result.js';
16
+ export type { ListedDeploymentV1, ListResultV1, UnlistedEnvironmentV1 } from './list.js';
16
17
  export { loadDeclaredSecrets } from './dotenv.js';
17
- export { DEVELOPMENT_SESSION_FILE_VERSION, acceptDevelopmentSessionFileV1, } from './development/session-file.js';
18
- export type { DevelopmentSessionFileV1, DevelopmentSessionPhaseV1, DevelopmentSessionProjectV1, DevelopmentSessionReleaseV1, } from './development/session-file.js';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `@astrale-os/sdk/cli` — the `astrale-domain` CLI
3
- * (dev | build | deploy | test | lint | package), explicit dotenv boundary, and admitted
4
- * development-session file representation.
3
+ * (dev | build | deploy | list | test | lint | package), its JSON results, and the explicit dotenv
4
+ * boundary. `dev` is deprecated and lives in `legacy/development/`.
5
5
  *
6
6
  * Node-only: the CLI imports `node:fs`/`node:module`/`node:url` and runs under
7
7
  * Bun (it imports the project's `astrale.config.ts` directly). This subpath is
@@ -12,4 +12,3 @@
12
12
  */
13
13
  export { run } from './run.js';
14
14
  export { loadDeclaredSecrets } from './dotenv.js';
15
- export { DEVELOPMENT_SESSION_FILE_VERSION, acceptDevelopmentSessionFileV1, } from './development/session-file.js';
@@ -12,9 +12,11 @@ import type { DeployResultV1 } from '../deploy-result.js';
12
12
  *
13
13
  * @deprecated Stable-target deploy path only. Replacement: `deployResult`, the result of an
14
14
  * immutable deployment. Consumers: the direct-mode configurations of domains ai-gateway, closing,
15
- * grc, integrations and issues (until SV15), shell (until SH2), the Services `development`
16
- * environment (until SV9) and ui:domain (until UI1). Deleted with the legacy deploy path (D10),
17
- * once no supported configuration selects it (CT33).
15
+ * grc, integrations and issues (until SV15), domains organization (until it leaves direct mode,
16
+ * AM-147), the Services `beta` and `prod` (until SV12), `development` (until SV9) and frozen
17
+ * `admin-beta` (until D19) environments, shell (until SH2) and its frozen `legacy-v3` (until D22),
18
+ * and ui:domain (until UI1). Deleted with the legacy deploy path (D10), once no configuration on
19
+ * any repository's main selects it (CT33, AM-147).
18
20
  */
19
21
  export declare function stableTargetDeployResult(input: {
20
22
  readonly environment: string;
@@ -10,9 +10,11 @@
10
10
  *
11
11
  * @deprecated Stable-target deploy path only. Replacement: `deployResult`, the result of an
12
12
  * immutable deployment. Consumers: the direct-mode configurations of domains ai-gateway, closing,
13
- * grc, integrations and issues (until SV15), shell (until SH2), the Services `development`
14
- * environment (until SV9) and ui:domain (until UI1). Deleted with the legacy deploy path (D10),
15
- * once no supported configuration selects it (CT33).
13
+ * grc, integrations and issues (until SV15), domains organization (until it leaves direct mode,
14
+ * AM-147), the Services `beta` and `prod` (until SV12), `development` (until SV9) and frozen
15
+ * `admin-beta` (until D19) environments, shell (until SH2) and its frozen `legacy-v3` (until D22),
16
+ * and ui:domain (until UI1). Deleted with the legacy deploy path (D10), once no configuration on
17
+ * any repository's main selects it (CT33, AM-147).
16
18
  */
17
19
  export function stableTargetDeployResult(input) {
18
20
  const { publication, addressing } = input.deployment.release;
@@ -1,9 +1,8 @@
1
- import type { InstallationTarget, PreparedArtifact } from '../../../deployment/adapter/index.js';
2
- import type { StableTargetAdapter } from '../legacy/stable-target-adapter.js';
1
+ import type { PreparedArtifact } from '../../../../deployment/adapter/index.js';
2
+ import type { StableTargetAdapter } from '../stable-target-adapter.js';
3
3
  export interface DevelopmentCandidate {
4
4
  readonly adapter: StableTargetAdapter<object>;
5
5
  readonly parameters: object;
6
- readonly installation?: InstallationTarget;
7
6
  readonly artifact: PreparedArtifact;
8
7
  readonly secrets: Readonly<Record<string, string>>;
9
8
  readonly sources: ReadonlySet<string>;
@@ -22,5 +21,5 @@ export declare class DevelopmentCandidateBuilder {
22
21
  }
23
22
  export declare function discoverRuntimePath(configPath: string): Promise<string>;
24
23
  export declare function sameEnvironment(current: DevelopmentCandidate, candidate: DevelopmentCandidate): boolean;
25
- /** Identify a rebuilt candidate that cannot change provider or installation state. */
24
+ /** Identify a rebuilt candidate that cannot change provider state. */
26
25
  export declare function sameDeploymentCandidate(current: DevelopmentCandidate, candidate: DevelopmentCandidate): boolean;
@@ -2,11 +2,11 @@ import { existsSync } from 'node:fs';
2
2
  import { mkdir, rm, writeFile } from 'node:fs/promises';
3
3
  import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
4
4
  import { pathToFileURL } from 'node:url';
5
- import { admitRuntime, compile, resolveRuntime, runtime, verifyPreflight, } from '../../../deployment/index.js';
6
- import { admitProjectModule } from '../../../project/index.js';
7
- import { loadDeclaredSecrets } from '../dotenv.js';
8
- import { stableTargetAdapter } from '../legacy/stable-target-adapter.js';
9
- import { selectEnvironment } from '../project.js';
5
+ import { admitRuntime, compile, resolveRuntime, runtime, verifyPreflight, } from '../../../../deployment/index.js';
6
+ import { admitProjectModule } from '../../../../project/index.js';
7
+ import { loadDeclaredSecrets } from '../../dotenv.js';
8
+ import { selectEnvironment } from '../../project.js';
9
+ import { stableTargetAdapter } from '../stable-target-adapter.js';
10
10
  import { projectImportPlugin } from './project-imports.js';
11
11
  import { DevelopmentSources } from './sources.js';
12
12
  /** Rebuild one complete, isolated Environment candidate from authored sources. */
@@ -84,9 +84,6 @@ export class DevelopmentCandidateBuilder {
84
84
  const source = await adapter.prepare(parameters, {
85
85
  projectDir: this.#projectDir,
86
86
  environment: this.#environment,
87
- ...(environment.installation === undefined
88
- ? {}
89
- : { installation: environment.installation }),
90
87
  mode: 'release',
91
88
  recordSource: sources.record,
92
89
  signal,
@@ -102,9 +99,6 @@ export class DevelopmentCandidateBuilder {
102
99
  return Object.freeze({
103
100
  adapter,
104
101
  parameters,
105
- ...(environment.installation === undefined
106
- ? {}
107
- : { installation: environment.installation }),
108
102
  artifact,
109
103
  secrets: declared.values,
110
104
  sources: sources.snapshot(),
@@ -125,10 +119,9 @@ export function sameEnvironment(current, candidate) {
125
119
  candidate.adapter.version === current.adapter.version &&
126
120
  candidate.artifact.build.schema.compiled.root.origin ===
127
121
  current.artifact.build.schema.compiled.root.origin &&
128
- stable(candidate.parameters) === stable(current.parameters) &&
129
- stable(candidate.installation) === stable(current.installation));
122
+ stable(candidate.parameters) === stable(current.parameters));
130
123
  }
131
- /** Identify a rebuilt candidate that cannot change provider or installation state. */
124
+ /** Identify a rebuilt candidate that cannot change provider state. */
132
125
  export function sameDeploymentCandidate(current, candidate) {
133
126
  return (sameEnvironment(current, candidate) &&
134
127
  candidate.artifact.build.schema.compiled.root.revision ===
@@ -0,0 +1,10 @@
1
+ import type { ReadyDeployResult } from '../../../../deployment/adapter/index.js';
2
+ import type { DevelopmentCandidate } from './candidate.js';
3
+ export interface DevelopmentDeploymentInput {
4
+ readonly projectDir: string;
5
+ readonly environment: string;
6
+ readonly identity?: string;
7
+ readonly credential?: string;
8
+ }
9
+ /** Commit and verify one complete remote candidate. A development deployment installs nothing. */
10
+ export declare function deployDevelopmentCandidate(candidate: DevelopmentCandidate, input: DevelopmentDeploymentInput, signal: AbortSignal): Promise<ReadyDeployResult>;
@@ -0,0 +1,20 @@
1
+ import { verifyDeployment } from '../../../../deployment/index.js';
2
+ /** Commit and verify one complete remote candidate. A development deployment installs nothing. */
3
+ export async function deployDevelopmentCandidate(candidate, input, signal) {
4
+ const deployed = await candidate.adapter.deploy(candidate.parameters, {
5
+ projectDir: input.projectDir,
6
+ environment: input.environment,
7
+ ...(input.identity === undefined ? {} : { identity: input.identity }),
8
+ ...(input.credential === undefined ? {} : { credential: input.credential }),
9
+ secrets: candidate.secrets,
10
+ artifact: candidate.artifact,
11
+ signal,
12
+ });
13
+ const verified = verifyDeployment(candidate.artifact, deployed);
14
+ if (verified.status === 'failed') {
15
+ throw new Error(`Deployment failed during ${verified.phase}: ${verified.error.message}`, {
16
+ cause: verified.error,
17
+ });
18
+ }
19
+ return verified;
20
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * What replaces `astrale-domain dev`, for its author: development is not a command of the
3
+ * deployment model. A developer, or an agent, deploys the Environment and installs the URL that
4
+ * deploy prints on their own instance.
5
+ *
6
+ * `--direct` sends that URL to the instance's Kernel. Without it, the CLI releases published so
7
+ * far route a bare URL through the Admin catalog, which only knows published entries, so a fresh
8
+ * deployment URL fails to install. The CLI keeps accepting `--direct` after it starts sending
9
+ * every URL to the Kernel, and drops the flag only after this command is removed.
10
+ */
11
+ export declare function developmentDeprecation(environment: string): string;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * What replaces `astrale-domain dev`, for its author: development is not a command of the
3
+ * deployment model. A developer, or an agent, deploys the Environment and installs the URL that
4
+ * deploy prints on their own instance.
5
+ *
6
+ * `--direct` sends that URL to the instance's Kernel. Without it, the CLI releases published so
7
+ * far route a bare URL through the Admin catalog, which only knows published entries, so a fresh
8
+ * deployment URL fails to install. The CLI keeps accepting `--direct` after it starts sending
9
+ * every URL to the Kernel, and drops the flag only after this command is removed.
10
+ */
11
+ export function developmentDeprecation(environment) {
12
+ return `astrale-domain dev is deprecated and will be removed: run \`astrale-domain deploy ${environment}\`, then \`astrale domain install <url> --direct -i <instance>\` with the URL it prints.`;
13
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Watch one Project Environment and serialize complete remote deployment generations. Each
3
+ * generation replaces the Environment's stable target in place; none installs anything.
4
+ *
5
+ * @deprecated Deploy the Environment with `astrale-domain deploy`, then install the printed URL
6
+ * with `astrale domain install <url> --direct -i <instance>`.
7
+ */
8
+ export declare function develop(input: {
9
+ readonly configPath: string;
10
+ readonly projectDir: string;
11
+ readonly environment: string;
12
+ readonly identity?: string;
13
+ readonly credentialFile?: string;
14
+ readonly secretsFile?: string;
15
+ }): Promise<number>;