@astrale-os/sdk 0.6.0-beta.10 → 0.6.0-beta.12

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 (198) hide show
  1. package/README.md +59 -11
  2. package/dist/application/define.d.ts +5 -5
  3. package/dist/application/define.js +13 -13
  4. package/dist/application/domain.d.ts +28 -0
  5. package/dist/application/index.d.ts +3 -3
  6. package/dist/application/index.js +1 -1
  7. package/dist/application/routes/admission.d.ts +2 -2
  8. package/dist/application/routes/admission.js +1 -1
  9. package/dist/application/routes/route.d.ts +2 -2
  10. package/dist/deployment/adapter/adapter.d.ts +59 -10
  11. package/dist/deployment/adapter/bundle/bundle.d.ts +36 -0
  12. package/dist/deployment/adapter/bundle/file.d.ts +10 -0
  13. package/dist/deployment/adapter/bundle/index.d.ts +2 -0
  14. package/dist/deployment/adapter/define.d.ts +25 -3
  15. package/dist/deployment/adapter/define.js +101 -24
  16. package/dist/deployment/adapter/index.d.ts +5 -3
  17. package/dist/deployment/adapter/legacy/adapter.d.ts +50 -0
  18. package/dist/deployment/adapter/{deploy → legacy/deploy}/context.d.ts +6 -0
  19. package/dist/deployment/adapter/legacy/deploy/index.d.ts +2 -0
  20. package/dist/deployment/adapter/legacy/deploy/result.d.ts +90 -0
  21. package/dist/deployment/adapter/legacy/deploy/result.js +1 -0
  22. package/dist/deployment/adapter/legacy/index.d.ts +24 -0
  23. package/dist/deployment/adapter/legacy/index.js +1 -0
  24. package/dist/deployment/adapter/legacy/prepare/artifact.d.ts +43 -0
  25. package/dist/deployment/adapter/legacy/prepare/artifact.js +1 -0
  26. package/dist/deployment/adapter/legacy/prepare/context.d.ts +36 -0
  27. package/dist/deployment/adapter/legacy/prepare/context.js +1 -0
  28. package/dist/deployment/adapter/legacy/prepare/index.d.ts +2 -0
  29. package/dist/deployment/adapter/legacy/prepare/index.js +1 -0
  30. package/dist/deployment/adapter/release/context.d.ts +75 -0
  31. package/dist/deployment/adapter/release/context.js +1 -0
  32. package/dist/deployment/adapter/release/index.d.ts +2 -0
  33. package/dist/deployment/adapter/release/index.js +1 -0
  34. package/dist/deployment/adapter/release/result.d.ts +56 -0
  35. package/dist/deployment/adapter/release/result.js +1 -0
  36. package/dist/deployment/address/configuration.d.ts +83 -0
  37. package/dist/deployment/address/configuration.js +262 -0
  38. package/dist/deployment/address/fingerprint.d.ts +5 -0
  39. package/dist/deployment/address/fingerprint.js +27 -0
  40. package/dist/deployment/address/index.d.ts +5 -0
  41. package/dist/deployment/address/index.js +4 -0
  42. package/dist/deployment/address/label.d.ts +42 -0
  43. package/dist/deployment/address/label.js +80 -0
  44. package/dist/deployment/address/line.d.ts +29 -0
  45. package/dist/deployment/address/line.js +53 -0
  46. package/dist/deployment/address/record.d.ts +52 -0
  47. package/dist/deployment/address/record.js +104 -0
  48. package/dist/deployment/address/summary.d.ts +26 -0
  49. package/dist/deployment/address/summary.js +1 -0
  50. package/dist/deployment/address/vectors.d.ts +60 -0
  51. package/dist/deployment/address/vectors.js +517 -0
  52. package/dist/deployment/build/build.d.ts +2 -2
  53. package/dist/deployment/build/compile.d.ts +4 -4
  54. package/dist/deployment/build/compile.js +17 -17
  55. package/dist/deployment/build/index.d.ts +1 -0
  56. package/dist/deployment/build/index.js +1 -0
  57. package/dist/deployment/build/manifest.d.ts +54 -0
  58. package/dist/deployment/build/manifest.js +108 -0
  59. package/dist/deployment/build/material.js +2 -2
  60. package/dist/deployment/build/schema.d.ts +2 -2
  61. package/dist/deployment/deploy.d.ts +10 -10
  62. package/dist/deployment/deploy.js +3 -3
  63. package/dist/deployment/deployment.d.ts +9 -4
  64. package/dist/deployment/index.d.ts +4 -4
  65. package/dist/deployment/index.js +1 -1
  66. package/dist/deployment/release/addressing.d.ts +9 -1
  67. package/dist/deployment/release/assemble.d.ts +6 -3
  68. package/dist/deployment/release/assemble.js +12 -10
  69. package/dist/deployment/release/index.d.ts +2 -0
  70. package/dist/deployment/release/index.js +2 -0
  71. package/dist/deployment/release/legacy/admission.d.ts +3 -0
  72. package/dist/deployment/release/legacy/admission.js +8 -0
  73. package/dist/deployment/release/legacy/assemble.d.ts +5 -0
  74. package/dist/deployment/release/legacy/assemble.js +20 -0
  75. package/dist/deployment/release/legacy/index.d.ts +30 -0
  76. package/dist/deployment/release/legacy/index.js +29 -0
  77. package/dist/deployment/release/legacy/release.d.ts +12 -0
  78. package/dist/deployment/release/legacy/release.js +1 -0
  79. package/dist/deployment/release/{publication → legacy}/seal.d.ts +4 -4
  80. package/dist/deployment/release/legacy/seal.js +17 -0
  81. package/dist/deployment/release/release.d.ts +17 -6
  82. package/dist/deployment/release/runtime.d.ts +2 -0
  83. package/dist/deployment/release/runtime.js +2 -0
  84. package/dist/deployment/release/seal.d.ts +14 -0
  85. package/dist/deployment/release/seal.js +22 -0
  86. package/dist/deployment/release/{publication → served}/callables.d.ts +2 -2
  87. package/dist/deployment/release/{publication → served}/callables.js +2 -2
  88. package/dist/deployment/release/served/index.d.ts +12 -0
  89. package/dist/deployment/release/served/index.js +22 -0
  90. package/dist/deployment/release/{publication → served}/views.d.ts +2 -2
  91. package/dist/deployment/runtime/admission.d.ts +2 -2
  92. package/dist/deployment/runtime/admission.js +5 -5
  93. package/dist/deployment/verify/index.d.ts +2 -1
  94. package/dist/deployment/verify/index.js +1 -0
  95. package/dist/deployment/verify/preflight/artifact.d.ts +1 -1
  96. package/dist/deployment/verify/preflight/bundle.d.ts +18 -0
  97. package/dist/deployment/verify/preflight/bundle.js +71 -0
  98. package/dist/deployment/verify/preflight/index.d.ts +2 -1
  99. package/dist/deployment/verify/preflight/index.js +1 -0
  100. package/dist/deployment/verify/preflight/publication.d.ts +2 -2
  101. package/dist/deployment/verify/preflight/publication.js +4 -4
  102. package/dist/deployment/verify/readiness/deployment.js +4 -2
  103. package/dist/deployment/verify/readiness/index.d.ts +1 -1
  104. package/dist/deployment/verify/readiness/publication.d.ts +2 -2
  105. package/dist/deployment/verify/readiness/publication.js +1 -1
  106. package/dist/execution/identity/delivery.d.ts +1 -1
  107. package/dist/execution/identity/delivery.js +1 -1
  108. package/dist/execution/identity/identity.d.ts +1 -1
  109. package/dist/execution/index.d.ts +1 -1
  110. package/dist/execution/invocation/admission/authentication.d.ts +1 -1
  111. package/dist/execution/invocation/admission/authority.d.ts +2 -1
  112. package/dist/execution/invocation/admission/authority.js +1 -0
  113. package/dist/execution/invocation/invocation.js +1 -1
  114. package/dist/execution/invocation/result/project.js +41 -1
  115. package/dist/execution/node/serve.d.ts +2 -2
  116. package/dist/execution/node/serve.js +1 -1
  117. package/dist/execution/runtime/load.d.ts +1 -1
  118. package/dist/execution/runtime/load.js +1 -1
  119. package/dist/execution/serve.d.ts +2 -2
  120. package/dist/execution/service/publication/installation.d.ts +1 -1
  121. package/dist/execution/service/release.d.ts +1 -1
  122. package/dist/execution/service/release.js +1 -1
  123. package/dist/execution/service/service.d.ts +1 -1
  124. package/dist/index.d.ts +3 -3
  125. package/dist/index.js +1 -1
  126. package/dist/platform/release/index.d.ts +27 -0
  127. package/dist/platform/release/index.js +27 -0
  128. package/dist/project/admit.js +2 -2
  129. package/dist/project/define.d.ts +4 -4
  130. package/dist/project/define.js +9 -6
  131. package/dist/project/index.d.ts +1 -1
  132. package/dist/project/project.d.ts +6 -6
  133. package/dist/testing/dataset/define.d.ts +1 -1
  134. package/dist/testing/load.js +1 -1
  135. package/dist/tooling/cli/arguments.d.ts +1 -0
  136. package/dist/tooling/cli/arguments.js +7 -2
  137. package/dist/tooling/cli/build.d.ts +55 -0
  138. package/dist/tooling/cli/build.js +77 -0
  139. package/dist/tooling/cli/deploy-mode.d.ts +67 -0
  140. package/dist/tooling/cli/deploy-mode.js +124 -0
  141. package/dist/tooling/cli/deploy-result.d.ts +82 -0
  142. package/dist/tooling/cli/deploy-result.js +63 -0
  143. package/dist/tooling/cli/development/candidate.d.ts +3 -2
  144. package/dist/tooling/cli/development/candidate.js +5 -4
  145. package/dist/tooling/cli/development/report.d.ts +5 -2
  146. package/dist/tooling/cli/development/view.d.ts +1 -1
  147. package/dist/tooling/cli/environment-release.d.ts +5 -2
  148. package/dist/tooling/cli/evidence.d.ts +5 -2
  149. package/dist/tooling/cli/help.js +20 -10
  150. package/dist/tooling/cli/index.d.ts +2 -0
  151. package/dist/tooling/cli/installation/reconcile.d.ts +1 -1
  152. package/dist/tooling/cli/legacy/deploy-result.d.ts +26 -0
  153. package/dist/tooling/cli/legacy/deploy-result.js +35 -0
  154. package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +19 -0
  155. package/dist/tooling/cli/legacy/stable-target-adapter.js +14 -0
  156. package/dist/tooling/cli/legacy/uploaded-build.d.ts +11 -0
  157. package/dist/tooling/cli/legacy/uploaded-build.js +22 -0
  158. package/dist/tooling/cli/log.d.ts +5 -0
  159. package/dist/tooling/cli/log.js +9 -0
  160. package/dist/tooling/cli/orchestrate.js +75 -15
  161. package/dist/tooling/cli/project.d.ts +3 -3
  162. package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +1 -1
  163. package/dist/tooling/linter/implementations/source/callable-requirements.js +10 -10
  164. package/dist/tooling/linter/implementations/source/dependencies.js +4 -4
  165. package/dist/tooling/linter/implementations/source/global.js +1 -1
  166. package/dist/tooling/linter/implementations/source/mutations.js +17 -17
  167. package/dist/tooling/linter/implementations/source/providers.js +5 -5
  168. package/dist/tooling/linter/implementations/source/views.js +2 -2
  169. package/dist/tooling/linter/policy/generated.js +16 -16
  170. package/dist/tooling/packaging/declarations/ownership.js +1 -1
  171. package/dist/tooling/packaging/finalize.d.ts +1 -1
  172. package/dist/tooling/packaging/finalize.js +1 -1
  173. package/package.json +17 -5
  174. package/dist/application/application.d.ts +0 -28
  175. package/dist/deployment/adapter/deploy/index.d.ts +0 -2
  176. package/dist/deployment/adapter/deploy/result.d.ts +0 -50
  177. package/dist/deployment/adapter/prepare/artifact.d.ts +0 -33
  178. package/dist/deployment/adapter/prepare/context.d.ts +0 -23
  179. package/dist/deployment/adapter/prepare/index.d.ts +0 -2
  180. package/dist/deployment/release/publication/index.d.ts +0 -6
  181. package/dist/deployment/release/publication/index.js +0 -6
  182. package/dist/deployment/release/publication/manifest.d.ts +0 -3
  183. package/dist/deployment/release/publication/manifest.js +0 -5
  184. package/dist/deployment/release/publication/requirements.d.ts +0 -3
  185. package/dist/deployment/release/publication/requirements.js +0 -3
  186. package/dist/deployment/release/publication/seal.js +0 -39
  187. package/dist/platform/publication/index.d.ts +0 -2
  188. package/dist/platform/publication/index.js +0 -2
  189. /package/dist/application/{application.js → domain.js} +0 -0
  190. /package/dist/deployment/adapter/{deploy/context.js → bundle/bundle.js} +0 -0
  191. /package/dist/deployment/adapter/{deploy/index.js → bundle/file.js} +0 -0
  192. /package/dist/deployment/adapter/{prepare → bundle}/index.js +0 -0
  193. /package/dist/deployment/adapter/{deploy/result.js → legacy/adapter.js} +0 -0
  194. /package/dist/deployment/adapter/{prepare → legacy/deploy}/context.js +0 -0
  195. /package/dist/deployment/adapter/{prepare/artifact.js → legacy/deploy/index.js} +0 -0
  196. /package/dist/deployment/release/{publication → served}/routes.d.ts +0 -0
  197. /package/dist/deployment/release/{publication → served}/routes.js +0 -0
  198. /package/dist/deployment/release/{publication → served}/views.js +0 -0
@@ -1,4 +1,6 @@
1
- export type { Adapter, AdapterEnvironmentContext, AdapterInput, InstallationTarget, } from './adapter.js';
1
+ export type { Adapter, AdapterEnvironmentContext, AdapterInput } from './adapter.js';
2
2
  export { defineAdapter, defineDeployment, isAdapter } from './define.js';
3
- export type * from './prepare/index.js';
4
- export type * from './deploy/index.js';
3
+ export type * from './bundle/index.js';
4
+ export type * from './release/index.js';
5
+ /** @deprecated The contract before adapter interface v2; see `./legacy/index.ts`. */
6
+ export type * from './legacy/index.js';
@@ -0,0 +1,50 @@
1
+ import type { AdapterEnvironmentContext } from '../adapter.js';
2
+ import type { Bundler } from '../bundle/index.js';
3
+ import type { DeployContext, DeployResult } from './deploy/index.js';
4
+ import type { ArtifactSource, PrepareContext } from './prepare/index.js';
5
+ /**
6
+ * The instance an Environment's `installation` installs on after each deploy.
7
+ *
8
+ * @deprecated Deploy-time installation. Replacement: `astrale domain install <url> -i <instance>`
9
+ * after `astrale-domain deploy <environment>`, which never installs.
10
+ */
11
+ export interface InstallationTarget {
12
+ readonly instance: string;
13
+ readonly identity?: string;
14
+ }
15
+ /**
16
+ * A provider adapter on the contract before adapter interface v2: `prepare` places a build at one
17
+ * stable target per Environment and `deploy` replaces that target's code in place. It declares no
18
+ * `deployRelease`, so every Environment it deploys is on the legacy direct-mode path (CT33). Like
19
+ * every adapter, it declares its `bundler`: `astrale-domain deploy` bundles first and `prepare`
20
+ * only places that Bundle.
21
+ *
22
+ * @deprecated Replacement: `Adapter` (adapter interface v2), whose `deployRelease` deploys one
23
+ * sealed release as one immutable deployment. See `./index.ts` for its consumers and removal.
24
+ */
25
+ export interface LegacyAdapter<Parameters extends object = object> {
26
+ readonly kind: 'adapter';
27
+ readonly name: string;
28
+ readonly version: string;
29
+ /** Environment-free bytes `astrale-domain build` identifies by their build digest. */
30
+ readonly bundler: Bundler;
31
+ admit?(parameters: Parameters, context: AdapterEnvironmentContext): void;
32
+ prepare(parameters: Parameters, context: PrepareContext): Promise<ArtifactSource>;
33
+ deploy(parameters: Parameters, context: DeployContext): Promise<DeployResult>;
34
+ readonly secretsFile?: (parameters: Parameters) => string | undefined;
35
+ }
36
+ /**
37
+ * What `defineAdapter` admits for a `LegacyAdapter`.
38
+ *
39
+ * @deprecated Replacement: `AdapterInput` (adapter interface v2). See `./index.ts`.
40
+ */
41
+ export interface LegacyAdapterInput<Parameters extends object> {
42
+ readonly name: string;
43
+ readonly version: string;
44
+ /** Environment-free bytes `astrale-domain build` identifies by their build digest. */
45
+ readonly bundler: Bundler;
46
+ admit?(parameters: Parameters, context: AdapterEnvironmentContext): void;
47
+ prepare(parameters: Parameters, context: PrepareContext): Promise<ArtifactSource>;
48
+ deploy(parameters: Parameters, context: DeployContext): Promise<DeployResult>;
49
+ readonly secretsFile?: (parameters: Parameters) => string | undefined;
50
+ }
@@ -1,5 +1,11 @@
1
1
  import type { InstallationTarget } from '../adapter.js';
2
2
  import type { PreparedArtifact } from '../prepare/index.js';
3
+ /**
4
+ * What a legacy `deploy` receives to replace one Environment's stable target in place.
5
+ *
6
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement:
7
+ * `ReleaseDeployContext`, which `deployRelease` receives.
8
+ */
3
9
  export interface DeployContext {
4
10
  readonly projectDir: string;
5
11
  readonly environment: string;
@@ -0,0 +1,2 @@
1
+ export type { DeployContext } from './context.js';
2
+ export type { AppliedProviderDeployment, DeploymentPhase, DeploymentProgress, DeployResult, FailedDeployResult, ProviderDeploymentEvidence, ReadyDeployResult, } from './result.js';
@@ -0,0 +1,90 @@
1
+ import type { Digest } from '@astrale-os/kernel-protocol/artifact';
2
+ import type { BuildDigest } from '../../../build/index.js';
3
+ import type { Addressing } from '../../../release/index.js';
4
+ import type { Release } from '../../../release/legacy/index.js';
5
+ import type { MutationKnowledge } from '../../release/index.js';
6
+ /**
7
+ * Where a legacy `deploy` stopped.
8
+ *
9
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement:
10
+ * `ReleaseDeploymentPhase`; an immutable deployment is neither addressed nor installed by its deploy.
11
+ */
12
+ export type DeploymentPhase = 'prerequisite' | 'provider' | 'addressing' | 'release' | 'configuration' | 'installation' | 'readiness';
13
+ /**
14
+ * What a provider reports for the stable target it replaced.
15
+ *
16
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement: the
17
+ * `DeploymentRecordV1` of `ReadyReleaseDeployResult`; a provider deployment or version id never
18
+ * identifies an immutable deployment.
19
+ */
20
+ export interface ProviderDeploymentEvidence {
21
+ readonly provider: string;
22
+ readonly deployment: string;
23
+ readonly artifact: Digest;
24
+ /**
25
+ * Build digest of the portable upload (modules and assets) this deployment was made from, which
26
+ * `astrale-domain deploy` compares with the Bundle it passed as `PrepareContext.bundle`. Present
27
+ * only when preparation placed that Bundle. A provider that bundles the upload again (Wrangler in
28
+ * direct mode) runs other bytes than these. Legacy prepare/deploy surface: deleted with it.
29
+ */
30
+ readonly build?: BuildDigest;
31
+ readonly issuer?: Addressing['issuer'];
32
+ /** Optional provider-side check before promotion; distinct from public readiness. */
33
+ readonly preflight?: 'passed' | 'unavailable';
34
+ }
35
+ /** @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). */
36
+ export type AppliedProviderDeployment = {
37
+ readonly kind: 'applied';
38
+ readonly evidence: ProviderDeploymentEvidence & {
39
+ readonly issuer: Addressing['issuer'];
40
+ };
41
+ };
42
+ /**
43
+ * What a legacy `deploy` changed, effect by effect.
44
+ *
45
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement:
46
+ * `FailedReleaseDeployResult.provider`; an immutable deployment's deploy installs nothing.
47
+ */
48
+ export interface DeploymentProgress {
49
+ readonly prerequisite: MutationKnowledge;
50
+ readonly provider: MutationKnowledge<ProviderDeploymentEvidence>;
51
+ readonly configuration: MutationKnowledge;
52
+ readonly installation: MutationKnowledge;
53
+ }
54
+ /**
55
+ * A stable target replaced in place and ready.
56
+ *
57
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement:
58
+ * `ReadyReleaseDeployResult`, the immutable deployment `deployRelease` created or reused.
59
+ */
60
+ export interface ReadyDeployResult {
61
+ readonly status: 'ready';
62
+ readonly phase: 'complete';
63
+ readonly progress: DeploymentProgress & {
64
+ readonly provider: AppliedProviderDeployment;
65
+ };
66
+ /**
67
+ * The stable-target Release (v3 Publication) of the legacy `deploy` operation. A canonical deploy
68
+ * reaches its adapter through `deployRelease` with the v4 Release (CT23); D10 deletes `deploy`
69
+ * and this result with the direct-mode path.
70
+ */
71
+ readonly release: Release;
72
+ }
73
+ /**
74
+ * A legacy `deploy` that did not reach a ready stable target.
75
+ *
76
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement:
77
+ * `FailedReleaseDeployResult`.
78
+ */
79
+ export interface FailedDeployResult {
80
+ readonly status: 'failed';
81
+ readonly phase: DeploymentPhase;
82
+ readonly progress: DeploymentProgress;
83
+ readonly error: Error;
84
+ readonly release?: Release;
85
+ }
86
+ /**
87
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement:
88
+ * `ReleaseDeployResult`.
89
+ */
90
+ export type DeployResult = ReadyDeployResult | FailedDeployResult;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The adapter contract before adapter interface v2: `prepare` places a build at one stable target
3
+ * per Environment, `deploy` replaces that target's code in place and may install it, and the
4
+ * stable target serves a v3 Publication under an issuer bound to it for life.
5
+ *
6
+ * @deprecated Replacement: `Adapter` (adapter interface v2): beside the same `bundler`, `configure`,
7
+ * `placement` and `deployRelease`, which deploys one sealed release as one immutable deployment,
8
+ * created or reused, and installs nothing.
9
+ *
10
+ * Short-term consumers: the legacy direct-mode path (CT33), which `astrale-domain deploy` and
11
+ * `astrale-domain dev` run through these operations:
12
+ * - adapter-cloudflare direct mode (`route`, `workerName`, `identityIssuer`, `addressing`,
13
+ * `signingIdentity`, or no `namespace`), which serves the configurations of domains ai-gateway,
14
+ * closing, grc, integrations and issues (until SV15), shell (until SH2), the Services
15
+ * `development` environment (until SV9) and ui:domain (until UI1);
16
+ * - adapter-astrale, until S8 gives it `deployRelease`.
17
+ *
18
+ * Removal: D10, once no supported configuration selects the direct-mode path (CT33); it deletes
19
+ * these types with `prepare`/`deploy`, `src/deployment/release/legacy` and the stable-target CLI
20
+ * path.
21
+ */
22
+ export type { InstallationTarget, LegacyAdapter, LegacyAdapterInput } from './adapter.js';
23
+ export type * from './prepare/index.js';
24
+ export type * from './deploy/index.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,43 @@
1
+ import type { Digest } from '@astrale-os/kernel-protocol/artifact';
2
+ import type { Build } from '../../../build/index.js';
3
+ import type { Addressing } from '../../../release/index.js';
4
+ import type { ArtifactFile, PreparedArtifactFile } from '../../bundle/index.js';
5
+ /**
6
+ * Where the stable target of one Environment answers: configured by the author or assigned by the
7
+ * provider.
8
+ *
9
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement: `Placement`,
10
+ * from which `deploymentUrl(label, placement.routingDomain)` derives an immutable deployment's URL.
11
+ */
12
+ export type AddressingPlan = {
13
+ readonly kind: 'configured';
14
+ readonly addressing: Addressing;
15
+ } | {
16
+ readonly kind: 'provider-assigned';
17
+ readonly claim: string;
18
+ };
19
+ /**
20
+ * Untrusted provider-specific preparation output admitted by verify/preflight.
21
+ *
22
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement: the `Bundle`
23
+ * the adapter's `bundler` produces, which `deployRelease` receives.
24
+ */
25
+ export interface ArtifactSource {
26
+ readonly entrypoint: string;
27
+ readonly files: readonly ArtifactFile[];
28
+ readonly addressing: AddressingPlan;
29
+ }
30
+ /**
31
+ * Exact detached input supplied to every provider deployment effect.
32
+ *
33
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement: the `Bundle`
34
+ * and `FrozenConfigurationV1` that `deployRelease` receives.
35
+ */
36
+ export interface PreparedArtifact<BuildValue extends Build = Build> {
37
+ readonly kind: 'prepared-artifact';
38
+ readonly build: BuildValue;
39
+ readonly digest: Digest;
40
+ readonly entrypoint: string;
41
+ readonly files: readonly PreparedArtifactFile[];
42
+ readonly addressing: AddressingPlan;
43
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ import type { Build } from '../../../build/index.js';
2
+ import type { ResolvedRuntimeReference } from '../../../runtime/index.js';
3
+ import type { Bundle } from '../../bundle/index.js';
4
+ import type { InstallationTarget } from '../adapter.js';
5
+ /**
6
+ * What `prepare` receives to produce the artifact of one Environment's stable target.
7
+ *
8
+ * @deprecated Legacy `prepare`/`deploy` contract (see `../index.ts`). Replacement: `configure`,
9
+ * `placement` and the Bundle of the adapter's `bundler`, which `deployRelease` receives.
10
+ */
11
+ export interface PrepareContext<BuildValue extends Build = Build> {
12
+ readonly projectDir: string;
13
+ readonly environment: string;
14
+ readonly installation?: InstallationTarget;
15
+ /**
16
+ * Preparation purpose. Remote development and one-shot deployment both
17
+ * prepare complete release artifacts. Omitted by older custom callers means
18
+ * release for compatibility during the beta migration.
19
+ */
20
+ readonly mode?: 'release';
21
+ /**
22
+ * Optional preparation-input observer used by tooling that must rebuild when
23
+ * an adapter reads authored paths outside the Domain/Runtime module graph.
24
+ */
25
+ readonly recordSource?: (path: string) => void;
26
+ /** Parent-owned lifecycle cancellation shared by every preparation process/effect. */
27
+ readonly signal: AbortSignal;
28
+ readonly build: BuildValue;
29
+ readonly runtime: ResolvedRuntimeReference;
30
+ /**
31
+ * The environment-free Bundle of the adapter's own `bundler`, which `astrale-domain deploy`
32
+ * always produces first so that preparation only places it. Absent (an `astrale-domain dev`
33
+ * rebuild), the adapter bundles by itself. Legacy prepare/deploy surface: deleted with it.
34
+ */
35
+ readonly bundle?: Bundle<BuildValue>;
36
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { PrepareContext } from './context.js';
2
+ export type { AddressingPlan, ArtifactSource, PreparedArtifact } from './artifact.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,75 @@
1
+ import type { DeploymentCommitV1, FrozenConfigurationV1, LineAddressing } from '../../address/index.js';
2
+ import type { Release } from '../../release/index.js';
3
+ import type { Bundle } from '../bundle/index.js';
4
+ /** What `configure` receives: the Environment whose configuration it freezes, nothing else. */
5
+ export interface ConfigureContext {
6
+ readonly environment: string;
7
+ }
8
+ /**
9
+ * Where the host places the deployments of one Environment. `routingDomain` is the DNS name every
10
+ * deployment URL ends with, `https://<label>.<routingDomain>`; `addressing` is how its line reads:
11
+ * `readable` for platform lines, `opaque` (the fingerprint alone) for tenant lines.
12
+ */
13
+ export interface Placement {
14
+ readonly addressing: LineAddressing;
15
+ readonly routingDomain: string;
16
+ }
17
+ /** What `placement` receives. It answers without any effect at the host. */
18
+ export interface PlacementContext {
19
+ readonly environment: string;
20
+ /** Parent-owned lifecycle cancellation. */
21
+ readonly signal: AbortSignal;
22
+ /** Optional command-scoped identity override (`--as`). */
23
+ readonly identity?: string;
24
+ }
25
+ /**
26
+ * Everything `deployRelease` deploys: one sealed release as one immutable deployment at
27
+ * `release.url`, which is `deploymentUrl(label, placement.routingDomain)` and the release's issuer.
28
+ * The SDK computes each value before the call, from the Build, `configure` and `placement`, so the
29
+ * adapter never derives an address or seals anything itself.
30
+ */
31
+ export interface ReleaseDeployContext {
32
+ readonly projectDir: string;
33
+ readonly environment: string;
34
+ /** Optional command-scoped identity override (`--as`). */
35
+ readonly identity?: string;
36
+ /** Optional command-scoped credential; trusted adapters must neither retain nor disclose it. */
37
+ readonly credential?: string;
38
+ /**
39
+ * The Environment's current secrets. A new deployment binds them; a reused deployment has its
40
+ * own declared secrets rewritten in place. A deploy never writes another deployment's secrets.
41
+ */
42
+ readonly secrets: Readonly<Record<string, string>>;
43
+ /** The environment-free bytes of the adapter's `bundler`, identified by `bundle.digest`. */
44
+ readonly bundle: Bundle;
45
+ /** What `configure` froze for this Environment. */
46
+ readonly configuration: FrozenConfigurationV1;
47
+ /** Where `placement` said the host places the deployment. */
48
+ readonly placement: Placement;
49
+ /**
50
+ * `<line>-<content>`: the DNS label of the deployment, which is also its provider script. Its
51
+ * content covers `bundle.digest` and `configuration`, so one label serves one release.
52
+ */
53
+ readonly label: string;
54
+ /**
55
+ * The release the SDK sealed for this deployment before the call: its `document` is the
56
+ * `DomainRelease` v4 the deployment serves at `release.json`, its `url` the deployment URL.
57
+ */
58
+ readonly release: Release;
59
+ /** The commit the deployment is built from, as its deployment record declares it. */
60
+ readonly commit: DeploymentCommitV1 | null;
61
+ /** Parent-owned lifecycle cancellation shared by every provider effect. */
62
+ readonly signal: AbortSignal;
63
+ }
64
+ /** What `list` receives: the origin whose deployments the host lists for the caller. */
65
+ export interface ListContext {
66
+ readonly origin: string;
67
+ readonly signal: AbortSignal;
68
+ readonly identity?: string;
69
+ }
70
+ /** What `retain` receives: the label of the published deployment to keep. */
71
+ export interface RetainContext {
72
+ readonly label: string;
73
+ readonly signal: AbortSignal;
74
+ readonly identity?: string;
75
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { ConfigureContext, ListContext, Placement, PlacementContext, ReleaseDeployContext, RetainContext, } from './context.js';
2
+ export type { DeploymentSecretsState, FailedReleaseDeployResult, MutationKnowledge, ReadyReleaseDeployResult, ReleaseDeploymentPhase, ReleaseDeployResult, } from './result.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,56 @@
1
+ import type { DeploymentRecordV1 } from '../../address/index.js';
2
+ /** What one operation knows it changed at a provider. */
3
+ export type MutationKnowledge<Evidence = unknown> = {
4
+ readonly kind: 'none';
5
+ } | {
6
+ readonly kind: 'partial';
7
+ readonly evidence?: Evidence;
8
+ } | {
9
+ readonly kind: 'applied';
10
+ readonly evidence: Evidence;
11
+ } | {
12
+ readonly kind: 'unknown';
13
+ };
14
+ /**
15
+ * How a deploy left the Environment's secrets on the deployment it made or reused: `bound` to a
16
+ * new deployment, or `updated` or left `unchanged` in place on the reused one.
17
+ */
18
+ export type DeploymentSecretsState = 'bound' | 'updated' | 'unchanged';
19
+ /**
20
+ * The immutable deployment of one release, ready at its URL.
21
+ *
22
+ * - `created`: a new deployment now serves the release, and the Environment's secrets are `bound`
23
+ * to it.
24
+ * - `reused`: the deployment of this exact release (same label, build and configuration) already
25
+ * existed; its own declared secrets were `updated` or left `unchanged` in place.
26
+ */
27
+ export interface ReadyReleaseDeployResult {
28
+ readonly status: 'ready';
29
+ readonly state: 'created' | 'reused';
30
+ /** The record the deployment declares, as the host stored it. */
31
+ readonly record: DeploymentRecordV1;
32
+ /** The deployment URL, which is also the issuer of the release it serves. */
33
+ readonly url: string;
34
+ readonly secrets: {
35
+ readonly state: DeploymentSecretsState;
36
+ };
37
+ }
38
+ /**
39
+ * Where a deploy of one release stopped:
40
+ * - `prerequisite`: before any effect at the host (a missing tool, credential or hosting answer);
41
+ * - `provider`: at the host, while it created or reused the deployment;
42
+ * - `readiness`: the deployment exists but did not serve its release before the deadline.
43
+ */
44
+ export type ReleaseDeploymentPhase = 'prerequisite' | 'provider' | 'readiness';
45
+ /**
46
+ * A deploy of one release that did not reach a ready deployment. Rerunning the same deploy
47
+ * converges: the deployment's label is its content, so a partial or applied deployment is reused.
48
+ */
49
+ export interface FailedReleaseDeployResult {
50
+ readonly status: 'failed';
51
+ readonly phase: ReleaseDeploymentPhase;
52
+ /** What the host may now hold of the deployment. */
53
+ readonly provider: MutationKnowledge;
54
+ readonly error: Error;
55
+ }
56
+ export type ReleaseDeployResult = ReadyReleaseDeployResult | FailedReleaseDeployResult;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,83 @@
1
+ import type { Digest } from '@astrale-os/kernel-protocol/artifact';
2
+ export declare const FROZEN_CONFIGURATION_FORMAT = "astrale.deployment.configuration";
3
+ export declare const FROZEN_CONFIGURATION_VERSION = 1;
4
+ /**
5
+ * What a deploy freezes into one deployment beside its build: the author's plain variables and the
6
+ * execution settings, defaults resolved, the durable Workflow options it declares, and the services
7
+ * and dispatch namespaces it binds. It names the secrets a deployment binds, never their values,
8
+ * and leaves out what the host derives (the deployment URL, the build digest, the signing key). A
9
+ * changed variable, setting or binding is another configuration, so another address; a rotated
10
+ * secret is not.
11
+ *
12
+ * Its admission is canonical form only. Whether a Worker can run under it stays with the host that
13
+ * binds it: `encodeWorkerSettings` (`@astrale-os/adapter-cloudflare/worker`) refuses settings past
14
+ * the Worker bounds when the host writes `ASTRALE_SETTINGS`, before anything is uploaded, and the
15
+ * host's binding namespace admits the binding names.
16
+ */
17
+ export interface FrozenConfigurationV1 {
18
+ readonly format: typeof FROZEN_CONFIGURATION_FORMAT;
19
+ readonly version: typeof FROZEN_CONFIGURATION_VERSION;
20
+ /** The author's plain variables, never secrets. */
21
+ readonly vars: Readonly<Record<string, string>>;
22
+ readonly settings: {
23
+ readonly maximumRequestBytes: number;
24
+ readonly invocationTimeoutMs: number;
25
+ readonly tokenExchange: false | {
26
+ readonly maximumLifetimeSeconds: number;
27
+ };
28
+ /** The durable Workflow options the Environment declares; absent when it declares none. */
29
+ readonly durableOptions?: FrozenDurableOptions;
30
+ };
31
+ readonly runtime: {
32
+ readonly compatibilityDate: string;
33
+ /** Sorted, unique. */
34
+ readonly compatibilityFlags: readonly string[];
35
+ };
36
+ readonly bindings: {
37
+ /** Sorted by name, unique; never the `ROUTER` binding, which `router` describes. */
38
+ readonly services: readonly {
39
+ readonly name: string;
40
+ readonly service: string;
41
+ }[];
42
+ /**
43
+ * Dispatch namespaces the deployment binds, sorted by binding name, unique; empty when it binds
44
+ * none. A binding name is a Worker binding name other than `ROUTER`, a namespace a Cloudflare
45
+ * dispatch namespace name. Which namespaces a deployment may bind is the host's to decide.
46
+ */
47
+ readonly dispatchNamespaces: readonly {
48
+ readonly name: string;
49
+ readonly namespace: string;
50
+ }[];
51
+ /** Names of the secrets the deployment binds, sorted, unique. */
52
+ readonly secrets: readonly string[];
53
+ };
54
+ readonly router: false | {
55
+ readonly service: string;
56
+ readonly hostSuffix: string;
57
+ readonly minLabels: number;
58
+ };
59
+ }
60
+ /**
61
+ * The durable Workflow options of one deployment, as declared: every field optional, each a
62
+ * positive integer. The SDK's durable serving bounds and defaults them when the Worker runs.
63
+ */
64
+ export interface FrozenDurableOptions {
65
+ readonly retentionMs?: number;
66
+ readonly retry?: {
67
+ readonly initialIntervalMs?: number;
68
+ readonly maxAttempts?: number;
69
+ readonly maxIntervalMs?: number;
70
+ };
71
+ readonly stepTimeoutMs?: number;
72
+ }
73
+ /** A configuration before its canonical order: lists in any order, no format header. */
74
+ export type FrozenConfigurationInput = Omit<FrozenConfigurationV1, 'format' | 'version'>;
75
+ /** Freeze one deployment configuration in the one canonical order its digest is taken in. */
76
+ export declare function frozenConfiguration(input: FrozenConfigurationInput): FrozenConfigurationV1;
77
+ /**
78
+ * `sha256` of the canonical JSON (RFC 8785) of one exact, canonical frozen configuration. A
79
+ * deployment record keeps it whole; the deployment address keeps 80 bits of it with the build.
80
+ * It refuses a configuration that is not canonical, and checks nothing past that: a configuration
81
+ * it digests may still be one no Worker runs under (see `FrozenConfigurationV1`).
82
+ */
83
+ export declare function configurationDigest(configuration: FrozenConfigurationV1): Digest;