@astrale-os/sdk 0.6.0-beta.23 → 0.6.0-beta.25

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 (206) hide show
  1. package/README.md +32 -38
  2. package/dist/application/action/context.d.ts +29 -25
  3. package/dist/application/action/index.d.ts +1 -1
  4. package/dist/application/define.d.ts +3 -1
  5. package/dist/application/define.js +16 -2
  6. package/dist/application/dependency/invoker.d.ts +5 -5
  7. package/dist/application/domain.d.ts +3 -1
  8. package/dist/application/index.d.ts +1 -1
  9. package/dist/application/integration/operation.d.ts +2 -2
  10. package/dist/application/mutation/index.d.ts +1 -1
  11. package/dist/application/query/composite/plan.d.ts +0 -4
  12. package/dist/application/query/composite/plan.js +0 -2
  13. package/dist/application/runtime/workflows.d.ts +1 -1
  14. package/dist/application/runtime/workflows.js +1 -4
  15. package/dist/application/view/define.js +4 -6
  16. package/dist/application/view/frontend.d.ts +2 -2
  17. package/dist/application/view/index.d.ts +1 -1
  18. package/dist/application/view/route.d.ts +0 -14
  19. package/dist/application/view/route.js +1 -64
  20. package/dist/application/workflow/context.d.ts +1 -1
  21. package/dist/application/workflow/define.d.ts +1 -1
  22. package/dist/application/workflow/define.js +1 -1
  23. package/dist/application/workflow/workflow.d.ts +1 -3
  24. package/dist/deployment/adapter/adapter.d.ts +3 -20
  25. package/dist/deployment/adapter/bundle/file.d.ts +1 -1
  26. package/dist/deployment/adapter/define.d.ts +4 -25
  27. package/dist/deployment/adapter/define.js +12 -44
  28. package/dist/deployment/adapter/index.d.ts +0 -2
  29. package/dist/deployment/adapter/release/list.d.ts +1 -2
  30. package/dist/deployment/address/summary.d.ts +3 -7
  31. package/dist/deployment/authoring.d.ts +0 -2
  32. package/dist/deployment/authoring.js +0 -1
  33. package/dist/deployment/build/build.d.ts +6 -0
  34. package/dist/deployment/build/compile.js +2 -0
  35. package/dist/deployment/build/frontend/compilation.d.ts +2 -4
  36. package/dist/deployment/build/frontend/compilation.js +0 -5
  37. package/dist/deployment/build/frontend/digest.js +1 -5
  38. package/dist/deployment/build/material.d.ts +2 -2
  39. package/dist/deployment/build/material.js +28 -13
  40. package/dist/deployment/deployment.d.ts +4 -8
  41. package/dist/deployment/index.d.ts +3 -5
  42. package/dist/deployment/index.js +1 -2
  43. package/dist/deployment/release/addressing.d.ts +2 -9
  44. package/dist/deployment/release/addressing.js +2 -3
  45. package/dist/deployment/release/index.d.ts +0 -2
  46. package/dist/deployment/release/index.js +0 -2
  47. package/dist/deployment/release/release.d.ts +1 -1
  48. package/dist/deployment/release/runtime.d.ts +0 -2
  49. package/dist/deployment/release/runtime.js +0 -2
  50. package/dist/deployment/release/served/index.d.ts +1 -2
  51. package/dist/deployment/release/served/index.js +7 -3
  52. package/dist/deployment/release/served/views.js +0 -1
  53. package/dist/deployment/verify/index.d.ts +2 -4
  54. package/dist/deployment/verify/index.js +1 -3
  55. package/dist/deployment/verify/preflight/index.d.ts +0 -12
  56. package/dist/deployment/verify/preflight/index.js +0 -12
  57. package/dist/deployment/verify/readiness/index.d.ts +2 -6
  58. package/dist/deployment/verify/readiness/index.js +3 -12
  59. package/dist/deployment/worker/response.d.ts +1 -4
  60. package/dist/deployment/worker/response.js +2 -8
  61. package/dist/execution/identity/authentication.d.ts +10 -1
  62. package/dist/execution/identity/authentication.js +21 -0
  63. package/dist/execution/identity/delivery.d.ts +2 -7
  64. package/dist/execution/identity/delivery.js +1 -23
  65. package/dist/execution/identity/identity.d.ts +2 -3
  66. package/dist/execution/identity/identity.js +5 -1
  67. package/dist/execution/index.d.ts +1 -3
  68. package/dist/execution/index.js +1 -2
  69. package/dist/execution/invocation/admission/authentication.d.ts +8 -5
  70. package/dist/execution/invocation/admission/authentication.js +39 -21
  71. package/dist/execution/invocation/admission/authority.d.ts +21 -6
  72. package/dist/execution/invocation/admission/authority.js +6 -4
  73. package/dist/execution/invocation/admission/index.d.ts +2 -2
  74. package/dist/execution/invocation/admission/index.js +1 -1
  75. package/dist/execution/invocation/dependency/bind.d.ts +2 -0
  76. package/dist/execution/invocation/dependency/bind.js +1 -2
  77. package/dist/execution/invocation/dispatch/context.d.ts +5 -5
  78. package/dist/execution/invocation/dispatch/context.js +16 -30
  79. package/dist/execution/invocation/dispatch/workflow.js +0 -4
  80. package/dist/execution/invocation/index.d.ts +2 -2
  81. package/dist/execution/invocation/index.js +1 -1
  82. package/dist/execution/invocation/integration/call.d.ts +2 -1
  83. package/dist/execution/invocation/integration/call.js +1 -1
  84. package/dist/execution/invocation/integration/clients.d.ts +1 -1
  85. package/dist/execution/invocation/invocation.js +3 -12
  86. package/dist/execution/invocation/result/errors.d.ts +0 -10
  87. package/dist/execution/invocation/result/errors.js +0 -17
  88. package/dist/execution/invocation/result/index.d.ts +2 -2
  89. package/dist/execution/invocation/result/index.js +1 -1
  90. package/dist/execution/runtime/release.d.ts +6 -11
  91. package/dist/execution/runtime/release.js +2 -9
  92. package/dist/execution/service/create.js +3 -1
  93. package/dist/execution/service/service.d.ts +2 -3
  94. package/dist/execution/service/serving/delivery.d.ts +1 -2
  95. package/dist/execution/service/serving/delivery.js +1 -2
  96. package/dist/execution/service/serving/source.d.ts +3 -10
  97. package/dist/execution/service/serving/source.js +1 -5
  98. package/dist/execution/workflows/index.d.ts +1 -1
  99. package/dist/execution/workflows/index.js +1 -1
  100. package/dist/execution/workflows/options.d.ts +0 -6
  101. package/dist/execution/workflows/options.js +0 -18
  102. package/dist/execution/workflows/receiver.d.ts +1 -2
  103. package/dist/execution/workflows/receiver.js +13 -20
  104. package/dist/execution/workflows/route.d.ts +1 -3
  105. package/dist/execution/workflows/route.js +4 -9
  106. package/dist/execution/workflows/run.d.ts +1 -1
  107. package/dist/execution/workflows/run.js +1 -1
  108. package/dist/index.d.ts +1 -1
  109. package/dist/index.js +1 -1
  110. package/dist/platform/graph/alias.d.ts +1 -5
  111. package/dist/platform/graph/alias.js +1 -5
  112. package/dist/platform/graph/document/index.d.ts +1 -1
  113. package/dist/platform/graph/document/index.js +1 -1
  114. package/dist/platform/graph/index.d.ts +1 -1
  115. package/dist/platform/graph/index.js +1 -1
  116. package/dist/platform/release/index.d.ts +1 -26
  117. package/dist/platform/release/index.js +1 -26
  118. package/dist/platform/schema/class-icon-svg.d.ts +9 -0
  119. package/dist/platform/schema/class-icon-svg.js +29 -0
  120. package/dist/platform/schema/class-icon.d.ts +3 -8
  121. package/dist/platform/schema/class-icon.js +2 -29
  122. package/dist/platform/schema/index.d.ts +1 -1
  123. package/dist/platform/schema/schema-authoring.d.ts +14 -7
  124. package/dist/platform/schema/schema-authoring.js +5 -1
  125. package/dist/project/admit.js +0 -4
  126. package/dist/project/install-command.d.ts +0 -4
  127. package/dist/project/install-command.js +1 -5
  128. package/dist/tooling/cli/deploy-mode.d.ts +3 -59
  129. package/dist/tooling/cli/deploy-mode.js +46 -122
  130. package/dist/tooling/cli/deploy-result.d.ts +10 -15
  131. package/dist/tooling/cli/help.js +9 -16
  132. package/dist/tooling/cli/immutable-deployment.d.ts +3 -3
  133. package/dist/tooling/cli/index.d.ts +1 -1
  134. package/dist/tooling/cli/list.d.ts +5 -7
  135. package/dist/tooling/cli/list.js +9 -61
  136. package/dist/tooling/cli/orchestrate.js +6 -16
  137. package/dist/tooling/cli/publish/index.d.ts +2 -2
  138. package/dist/tooling/cli/registry/client.js +1 -1
  139. package/dist/tooling/cli/secrets.d.ts +2 -2
  140. package/dist/tooling/linter/implementations/source/global.js +0 -1
  141. package/dist/tooling/linter/implementations/source/verifiers.js +0 -2
  142. package/dist/tooling/linter/policy/generated.js +2 -51
  143. package/dist/tooling/linter/requirements/registry.js +0 -6
  144. package/package.json +9 -8
  145. package/dist/application/query/execution/projection.d.ts +0 -3
  146. package/dist/application/query/execution/projection.js +0 -3
  147. package/dist/deployment/adapter/legacy/adapter.d.ts +0 -40
  148. package/dist/deployment/adapter/legacy/adapter.js +0 -1
  149. package/dist/deployment/adapter/legacy/deploy/context.d.ts +0 -19
  150. package/dist/deployment/adapter/legacy/deploy/context.js +0 -1
  151. package/dist/deployment/adapter/legacy/deploy/index.d.ts +0 -2
  152. package/dist/deployment/adapter/legacy/deploy/index.js +0 -1
  153. package/dist/deployment/adapter/legacy/deploy/result.d.ts +0 -89
  154. package/dist/deployment/adapter/legacy/deploy/result.js +0 -1
  155. package/dist/deployment/adapter/legacy/index.d.ts +0 -24
  156. package/dist/deployment/adapter/legacy/index.js +0 -1
  157. package/dist/deployment/adapter/legacy/prepare/artifact.d.ts +0 -43
  158. package/dist/deployment/adapter/legacy/prepare/artifact.js +0 -1
  159. package/dist/deployment/adapter/legacy/prepare/context.d.ts +0 -33
  160. package/dist/deployment/adapter/legacy/prepare/context.js +0 -1
  161. package/dist/deployment/adapter/legacy/prepare/index.d.ts +0 -2
  162. package/dist/deployment/adapter/legacy/prepare/index.js +0 -1
  163. package/dist/deployment/deploy.d.ts +0 -20
  164. package/dist/deployment/deploy.js +0 -31
  165. package/dist/deployment/release/legacy/admission.d.ts +0 -3
  166. package/dist/deployment/release/legacy/admission.js +0 -8
  167. package/dist/deployment/release/legacy/assemble.d.ts +0 -5
  168. package/dist/deployment/release/legacy/assemble.js +0 -20
  169. package/dist/deployment/release/legacy/index.d.ts +0 -35
  170. package/dist/deployment/release/legacy/index.js +0 -34
  171. package/dist/deployment/release/legacy/release.d.ts +0 -12
  172. package/dist/deployment/release/legacy/release.js +0 -1
  173. package/dist/deployment/release/legacy/seal.d.ts +0 -10
  174. package/dist/deployment/release/legacy/seal.js +0 -17
  175. package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
  176. package/dist/deployment/verify/preflight/artifact.js +0 -122
  177. package/dist/deployment/verify/preflight/publication.d.ts +0 -4
  178. package/dist/deployment/verify/preflight/publication.js +0 -15
  179. package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
  180. package/dist/deployment/verify/readiness/deployment.js +0 -143
  181. package/dist/deployment/verify/readiness/legacy/index.d.ts +0 -2
  182. package/dist/deployment/verify/readiness/legacy/index.js +0 -2
  183. package/dist/deployment/verify/readiness/legacy/publication.d.ts +0 -12
  184. package/dist/deployment/verify/readiness/legacy/publication.js +0 -23
  185. package/dist/execution/service/errors.d.ts +0 -3
  186. package/dist/execution/service/errors.js +0 -3
  187. package/dist/execution/service/serving/legacy/index.d.ts +0 -15
  188. package/dist/execution/service/serving/legacy/index.js +0 -19
  189. package/dist/tooling/cli/deprecations.d.ts +0 -9
  190. package/dist/tooling/cli/deprecations.js +0 -15
  191. package/dist/tooling/cli/legacy/deploy-result.d.ts +0 -28
  192. package/dist/tooling/cli/legacy/deploy-result.js +0 -37
  193. package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +0 -21
  194. package/dist/tooling/cli/legacy/stable-target-adapter.js +0 -14
  195. package/dist/tooling/cli/legacy/stable-target-deploy.d.ts +0 -40
  196. package/dist/tooling/cli/legacy/stable-target-deploy.js +0 -102
  197. package/dist/tooling/cli/legacy/uploaded-build.d.ts +0 -11
  198. package/dist/tooling/cli/legacy/uploaded-build.js +0 -22
  199. package/dist/tooling/linter/implementations/source/migrations.d.ts +0 -2
  200. package/dist/tooling/linter/implementations/source/migrations.js +0 -113
  201. package/dist/tooling/linter/qualification/index.d.ts +0 -10
  202. package/dist/tooling/linter/qualification/index.js +0 -2
  203. package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
  204. package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
  205. package/dist/tooling/linter/qualification/runner.d.ts +0 -3
  206. package/dist/tooling/linter/qualification/runner.js +0 -6
@@ -1,122 +0,0 @@
1
- import { identify } from '@astrale-os/kernel-protocol/artifact';
2
- import { isAddressing } from '../../release/index.js';
3
- import { admit as admitRuntime } from '../../runtime/index.js';
4
- const MEDIA_TYPE = 'application/vnd.astrale.prepared-artifact+octet-stream;v=1';
5
- const admittedArtifacts = new WeakSet();
6
- /** Detach preparation output and bind it to the exact Build and resolved Runtime identity. */
7
- export function artifact(build, runtime, source) {
8
- admitRuntime({ runtime: build.runtime }, runtime);
9
- const admitted = admitSource(source);
10
- const digest = identify(evidenceBytes(build, admitted), MEDIA_TYPE).digest;
11
- const files = Object.freeze(admitted.files.map(prepareFile));
12
- const prepared = Object.freeze({
13
- kind: 'prepared-artifact',
14
- build,
15
- digest,
16
- entrypoint: admitted.entrypoint,
17
- files,
18
- addressing: admitted.addressing,
19
- });
20
- admittedArtifacts.add(prepared);
21
- return prepared;
22
- }
23
- function prepareFile(file) {
24
- const content = new Uint8Array(file.content);
25
- return Object.freeze({ path: file.path, bytes: () => new Uint8Array(content) });
26
- }
27
- export function isPreparedArtifact(input) {
28
- return input !== null && typeof input === 'object' && admittedArtifacts.has(input);
29
- }
30
- function admitSource(source) {
31
- if (source === null || typeof source !== 'object' || Array.isArray(source))
32
- invalid();
33
- if (Reflect.ownKeys(source).some((key) => key !== 'entrypoint' && key !== 'files' && key !== 'addressing')) {
34
- invalid();
35
- }
36
- const entrypoint = path(source.entrypoint, 'Artifact entrypoint');
37
- if (!Array.isArray(source.files) || source.files.length === 0) {
38
- throw new TypeError('Artifact files must be a non-empty array.');
39
- }
40
- const paths = new Set();
41
- const files = source.files.map((file, index) => {
42
- if (file === null || typeof file !== 'object' || Array.isArray(file))
43
- invalid();
44
- if (Reflect.ownKeys(file).some((key) => key !== 'path' && key !== 'content') ||
45
- !(file.content instanceof Uint8Array)) {
46
- invalid();
47
- }
48
- const selected = path(file.path, `Artifact file ${index}`);
49
- if (paths.has(selected))
50
- throw new TypeError(`Artifact file ${selected} is duplicated.`);
51
- paths.add(selected);
52
- return Object.freeze({ path: selected, content: new Uint8Array(file.content) });
53
- });
54
- files.sort((left, right) => compare(left.path, right.path));
55
- if (!paths.has(entrypoint))
56
- throw new TypeError('Artifact entrypoint file is absent.');
57
- const addressing = admitPlan(source.addressing);
58
- return Object.freeze({ entrypoint, files: Object.freeze(files), addressing });
59
- }
60
- function admitPlan(input) {
61
- if (input === null || typeof input !== 'object' || Array.isArray(input))
62
- invalid();
63
- if (input.kind === 'configured') {
64
- if (Reflect.ownKeys(input).some((key) => key !== 'kind' && key !== 'addressing'))
65
- invalid();
66
- if (!isAddressing(input.addressing)) {
67
- throw new TypeError('Configured artifact Addressing is not admitted.');
68
- }
69
- return Object.freeze({ kind: 'configured', addressing: input.addressing });
70
- }
71
- if (input.kind === 'provider-assigned') {
72
- if (Reflect.ownKeys(input).some((key) => key !== 'kind' && key !== 'claim'))
73
- invalid();
74
- if (typeof input.claim !== 'string' ||
75
- input.claim.length === 0 ||
76
- input.claim.trim() !== input.claim) {
77
- throw new TypeError('Provider-assigned Addressing claim must be a non-empty stable string.');
78
- }
79
- return Object.freeze({ kind: 'provider-assigned', claim: input.claim });
80
- }
81
- return invalid();
82
- }
83
- function evidenceBytes(build, source) {
84
- const encoder = new TextEncoder();
85
- const chunks = [
86
- encoder.encode(JSON.stringify({
87
- origin: build.schema.compiled.root.origin,
88
- revision: build.schema.compiled.root.revision,
89
- bundle: build.schema.bundle.ref.digest,
90
- entrypoint: source.entrypoint,
91
- addressing: source.addressing.kind === 'configured'
92
- ? { kind: 'configured', ...source.addressing.addressing }
93
- : source.addressing,
94
- })),
95
- ];
96
- for (const file of source.files) {
97
- chunks.push(encoder.encode(`\0${file.path}\0${file.content.byteLength}\0`), file.content);
98
- }
99
- const bytes = new Uint8Array(chunks.reduce((size, chunk) => size + chunk.byteLength, 0));
100
- let offset = 0;
101
- for (const chunk of chunks) {
102
- bytes.set(chunk, offset);
103
- offset += chunk.byteLength;
104
- }
105
- return bytes;
106
- }
107
- function path(input, label) {
108
- if (typeof input !== 'string' ||
109
- input.length === 0 ||
110
- input.startsWith('/') ||
111
- input.includes('\\') ||
112
- input.split('/').some((segment) => segment === '' || segment === '.' || segment === '..')) {
113
- throw new TypeError(`${label} must be a contained relative POSIX path.`);
114
- }
115
- return input;
116
- }
117
- function compare(left, right) {
118
- return left < right ? -1 : left > right ? 1 : 0;
119
- }
120
- function invalid() {
121
- throw new TypeError('Artifact source is invalid.');
122
- }
@@ -1,4 +0,0 @@
1
- import type { PreparedArtifact } from '../../adapter/legacy/index.js';
2
- import type { Release } from '../../release/legacy/index.js';
3
- /** Verify locally assemblable Publication evidence before any provider mutation. */
4
- export declare function publication(artifact: PreparedArtifact): Release | undefined;
@@ -1,15 +0,0 @@
1
- import * as protocolPublication from '@astrale-os/kernel-protocol/release/legacy';
2
- import * as routes from '@astrale-os/kernel-protocol/routes';
3
- import { evidenceOf } from '../../build/admission.js';
4
- import { assemble } from '../../release/legacy/index.js';
5
- /** Verify locally assemblable Publication evidence before any provider mutation. */
6
- export function publication(artifact) {
7
- if (artifact.addressing.kind !== 'configured')
8
- return undefined;
9
- const release = assemble(artifact.build, artifact.addressing.addressing);
10
- const admitted = protocolPublication.accept(release.publication);
11
- protocolPublication.verifyBundleBytes(admitted, artifact.build.schema.bundle.bytes());
12
- const { domain } = evidenceOf(artifact.build);
13
- routes.legacy.verifyTable(release.routes, admitted, domain);
14
- return release;
15
- }
@@ -1,3 +0,0 @@
1
- import type { DeployResult, PreparedArtifact } from '../../adapter/index.js';
2
- /** Admit adapter-reported progress without changing its mutation knowledge. */
3
- export declare function verifyDeployment(artifact: PreparedArtifact, input: DeployResult): DeployResult;
@@ -1,143 +0,0 @@
1
- import { isRelease } from '../../release/legacy/index.js';
2
- import { isPreparedArtifact } from '../preflight/artifact.js';
3
- /** Admit adapter-reported progress without changing its mutation knowledge. */
4
- export function verifyDeployment(artifact, input) {
5
- if (!isPreparedArtifact(artifact))
6
- throw new TypeError('PreparedArtifact is not admitted.');
7
- if (input === null || typeof input !== 'object' || Array.isArray(input))
8
- invalid();
9
- const release = input.release === undefined ? undefined : verifyRelease(artifact, input.release);
10
- const progress = verifyProgress(artifact, input.progress, release);
11
- if (input.status === 'ready') {
12
- exact(input, ['status', 'phase', 'progress', 'release']);
13
- if (input.phase !== 'complete' ||
14
- release === undefined ||
15
- progress.provider.kind !== 'applied' ||
16
- progress.provider.evidence.issuer === undefined ||
17
- !terminal(progress.prerequisite) ||
18
- !terminal(progress.configuration)) {
19
- invalid();
20
- }
21
- return Object.freeze({ status: 'ready', phase: 'complete', progress, release });
22
- }
23
- if (input.status === 'failed') {
24
- exact(input, ['status', 'phase', 'progress', 'error'], ['release']);
25
- if (!['prerequisite', 'provider', 'addressing', 'release', 'configuration', 'readiness'].includes(input.phase) ||
26
- !(input.error instanceof Error)) {
27
- invalid();
28
- }
29
- return Object.freeze({
30
- status: 'failed',
31
- phase: input.phase,
32
- progress,
33
- error: input.error,
34
- ...(release === undefined ? {} : { release }),
35
- });
36
- }
37
- return invalid();
38
- }
39
- function verifyRelease(artifact, release) {
40
- if (!isRelease(release) || release.build !== artifact.build) {
41
- throw new TypeError('DeployResult Release differs from the PreparedArtifact Build.');
42
- }
43
- if (artifact.addressing.kind === 'configured' &&
44
- (release.addressing.issuer !== artifact.addressing.addressing.issuer ||
45
- release.addressing.publicUrl !== artifact.addressing.addressing.publicUrl)) {
46
- throw new TypeError('DeployResult Release differs from configured Addressing.');
47
- }
48
- return release;
49
- }
50
- function verifyProgress(artifact, input, release) {
51
- if (input === null || typeof input !== 'object' || Array.isArray(input))
52
- invalid();
53
- exact(input, ['prerequisite', 'provider', 'configuration']);
54
- return Object.freeze({
55
- prerequisite: knowledge(input.prerequisite),
56
- provider: providerKnowledge(artifact, input.provider, release),
57
- configuration: knowledge(input.configuration),
58
- });
59
- }
60
- function providerKnowledge(artifact, input, release) {
61
- if (input?.kind === 'partial') {
62
- exact(input, ['kind'], ['evidence']);
63
- if (input.evidence === undefined)
64
- return Object.freeze({ kind: 'partial' });
65
- const evidence = providerEvidence(input.evidence);
66
- if (evidence.artifact !== artifact.digest) {
67
- throw new TypeError('Provider deployment evidence differs from the PreparedArtifact digest.');
68
- }
69
- if (release !== undefined &&
70
- evidence.issuer !== undefined &&
71
- evidence.issuer !== release.addressing.issuer) {
72
- throw new TypeError('Provider deployment evidence differs from the Release issuer.');
73
- }
74
- return Object.freeze({ kind: 'partial', evidence });
75
- }
76
- if (input?.kind !== 'applied')
77
- return knowledge(input);
78
- exact(input, ['kind', 'evidence']);
79
- const evidence = providerEvidence(input.evidence);
80
- if (evidence.artifact !== artifact.digest) {
81
- throw new TypeError('Provider deployment evidence differs from the PreparedArtifact digest.');
82
- }
83
- if (release !== undefined &&
84
- evidence.issuer !== undefined &&
85
- evidence.issuer !== release.addressing.issuer) {
86
- throw new TypeError('Provider deployment evidence differs from the Release issuer.');
87
- }
88
- return Object.freeze({ kind: 'applied', evidence });
89
- }
90
- function terminal(input) {
91
- return input.kind === 'none' || input.kind === 'applied';
92
- }
93
- function providerEvidence(input) {
94
- if (input === null || typeof input !== 'object' || Array.isArray(input))
95
- invalid();
96
- exact(input, ['provider', 'deployment', 'artifact'], ['build', 'issuer', 'preflight']);
97
- if (typeof input.provider !== 'string' ||
98
- input.provider.length === 0 ||
99
- input.provider.trim() !== input.provider ||
100
- typeof input.deployment !== 'string' ||
101
- input.deployment.length === 0 ||
102
- input.deployment.trim() !== input.deployment ||
103
- typeof input.artifact !== 'string' ||
104
- (input.build !== undefined &&
105
- (typeof input.build !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(input.build))) ||
106
- (input.issuer !== undefined && typeof input.issuer !== 'string') ||
107
- (input.preflight !== undefined &&
108
- input.preflight !== 'passed' &&
109
- input.preflight !== 'unavailable')) {
110
- invalid();
111
- }
112
- return Object.freeze({ ...input });
113
- }
114
- function knowledge(input) {
115
- if (input === null || typeof input !== 'object' || Array.isArray(input))
116
- invalid();
117
- if (input.kind === 'applied') {
118
- exact(input, ['kind', 'evidence']);
119
- return Object.freeze({ kind: 'applied', evidence: input.evidence });
120
- }
121
- if (input.kind === 'partial') {
122
- exact(input, ['kind'], ['evidence']);
123
- return Object.freeze({
124
- kind: 'partial',
125
- ...(input.evidence === undefined ? {} : { evidence: input.evidence }),
126
- });
127
- }
128
- if (input.kind === 'none' || input.kind === 'unknown') {
129
- exact(input, ['kind']);
130
- return Object.freeze({ kind: input.kind });
131
- }
132
- return invalid();
133
- }
134
- function exact(input, required, optional = []) {
135
- const allowed = new Set([...required, ...optional]);
136
- if (required.some((key) => !Object.hasOwn(input, key)) ||
137
- Reflect.ownKeys(input).some((key) => typeof key !== 'string' || !allowed.has(key))) {
138
- invalid();
139
- }
140
- }
141
- function invalid() {
142
- throw new TypeError('DeployResult is invalid.');
143
- }
@@ -1,2 +0,0 @@
1
- /** @deprecated Stable-target readiness at `domain.json`; see `publication.ts` (removal D10). */
2
- export { verifyPublication } from './publication.js';
@@ -1,2 +0,0 @@
1
- /** @deprecated Stable-target readiness at `domain.json`; see `publication.ts` (removal D10). */
2
- export { verifyPublication } from './publication.js';
@@ -1,12 +0,0 @@
1
- import * as publication from '@astrale-os/kernel-protocol/release/legacy';
2
- import type * as legacy from '../../../release/legacy/index.js';
3
- import type { ReadinessOptions } from '../fetch.js';
4
- /**
5
- * Fetch and verify the exact live Publication and Bundle a stable target serves at `domain.json`.
6
- *
7
- * @deprecated Replacement: `verifyRelease`, the readiness of an immutable deployment at
8
- * `release.json` (release digest and build digest). Consumer: the direct-mode deploy path of
9
- * adapter-cloudflare (the consumers of `deployment/release/legacy/index.ts`).
10
- * Removal: D10, with that path.
11
- */
12
- export declare function verifyPublication(release: legacy.Release, options?: ReadinessOptions): Promise<publication.Publication>;
@@ -1,23 +0,0 @@
1
- import * as publication from '@astrale-os/kernel-protocol/release/legacy';
2
- import { bounded, fetchRequired, MAXIMUM_BUNDLE_BYTES, MAXIMUM_DOCUMENT_BYTES, text, } from '../fetch.js';
3
- /**
4
- * Fetch and verify the exact live Publication and Bundle a stable target serves at `domain.json`.
5
- *
6
- * @deprecated Replacement: `verifyRelease`, the readiness of an immutable deployment at
7
- * `release.json` (release digest and build digest). Consumer: the direct-mode deploy path of
8
- * adapter-cloudflare (the consumers of `deployment/release/legacy/index.ts`).
9
- * Removal: D10, with that path.
10
- */
11
- export async function verifyPublication(release, options = {}) {
12
- const fetcher = options.fetch ?? globalThis.fetch;
13
- const publicationUrl = publication.url(release.addressing.publicUrl);
14
- const response = await fetchRequired(fetcher, publicationUrl, options.signal);
15
- const deployed = publication.accept(JSON.parse(await text(response, publicationUrl, MAXIMUM_DOCUMENT_BYTES)));
16
- if (!publication.matchesReference(deployed, publication.reference(release.publication))) {
17
- throw new Error('Live Publication differs from the expected Release.');
18
- }
19
- const bundleResponse = await fetchRequired(fetcher, deployed.schema.bundle.href, options.signal);
20
- const bytes = new Uint8Array(await bounded(bundleResponse, deployed.schema.bundle.href, MAXIMUM_BUNDLE_BYTES));
21
- publication.decodeBundle(deployed, bytes);
22
- return deployed;
23
- }
@@ -1,3 +0,0 @@
1
- export declare class ServiceUnavailableError extends Error {
2
- readonly name = "ServiceUnavailableError";
3
- }
@@ -1,3 +0,0 @@
1
- export class ServiceUnavailableError extends Error {
2
- name = 'ServiceUnavailableError';
3
- }
@@ -1,15 +0,0 @@
1
- import type { PublicationSource } from '@astrale-os/kernel-server';
2
- import type * as legacy from '../../../../deployment/release/legacy/index.js';
3
- import type { LoadedRuntime } from '../../../runtime/index.js';
4
- /**
5
- * Serve a stable target's v3 Publication through the Kernel Server's v3-input source: `domain.json`
6
- * only (404 at `release.json`), with the same-schema continuity of a stable Worker.
7
- *
8
- * @deprecated Replacement: the release source of `../source.ts`, which serves an immutable
9
- * deployment's `DomainRelease` v4. Consumer: the stable Worker of the direct-mode path (the
10
- * consumers of `deployment/release/legacy/index.ts`), whose host binds no build digest. Removal:
11
- * D10, with `deployment/release/legacy/` and Kernel Server's `publication` source.
12
- */
13
- export declare function publicationSource(runtime: LoadedRuntime, served: legacy.Release): {
14
- readonly publication: PublicationSource;
15
- };
@@ -1,19 +0,0 @@
1
- import { preparePublicationSnapshot } from '@astrale-os/kernel-server';
2
- /**
3
- * Serve a stable target's v3 Publication through the Kernel Server's v3-input source: `domain.json`
4
- * only (404 at `release.json`), with the same-schema continuity of a stable Worker.
5
- *
6
- * @deprecated Replacement: the release source of `../source.ts`, which serves an immutable
7
- * deployment's `DomainRelease` v4. Consumer: the stable Worker of the direct-mode path (the
8
- * consumers of `deployment/release/legacy/index.ts`), whose host binds no build digest. Removal:
9
- * D10, with `deployment/release/legacy/` and Kernel Server's `publication` source.
10
- */
11
- export function publicationSource(runtime, served) {
12
- const snapshot = preparePublicationSnapshot({
13
- publication: served.publication,
14
- bundle: served.build.schema.bundle.bytes(),
15
- table: served.routes,
16
- domain: runtime.domain,
17
- });
18
- return Object.freeze({ publication: Object.freeze({ current: () => snapshot }) });
19
- }
@@ -1,9 +0,0 @@
1
- import type { FrontendCompilation } from '../../deployment/build/frontend/index.js';
2
- /**
3
- * What a build still declares that the SDK has deprecated, one line each for its author. A View's
4
- * iframe requirements change nothing it receives: every trusted View gets the Shell's shared browser
5
- * profile, and Astrale hosts refuse requirements beyond it.
6
- */
7
- export declare function deprecationWarnings(build: {
8
- readonly frontend?: FrontendCompilation;
9
- }): readonly string[];
@@ -1,15 +0,0 @@
1
- /**
2
- * What a build still declares that the SDK has deprecated, one line each for its author. A View's
3
- * iframe requirements change nothing it receives: every trusted View gets the Shell's shared browser
4
- * profile, and Astrale hosts refuse requirements beyond it.
5
- */
6
- export function deprecationWarnings(build) {
7
- return (build.frontend?.routes ?? []).flatMap(({ view, iframe }) => {
8
- if (iframe === undefined)
9
- return [];
10
- const declared = [...(iframe.sandbox ?? []), ...(iframe.allow ?? [])].join(', ');
11
- return [
12
- `View ${view} declares iframe requirements (${declared}), which are deprecated: every trusted View receives the Shell's shared browser profile, and Astrale hosts refuse requirements beyond it. Remove its \`iframe\` field.`,
13
- ];
14
- });
15
- }
@@ -1,28 +0,0 @@
1
- import type { ReadyDeployResult } from '../../../deployment/index.js';
2
- import type { DeployResultV1 } from '../deploy-result.js';
3
- /**
4
- * The deploy result of a stable target: the legacy direct-mode path (`prepare`/`deploy` adapter
5
- * operations) replaces the code its stable target runs in place and serves a v3 Publication, so
6
- * the result names no release, no build digest, no provider script, no secrets state and no commit.
7
- * Those operations report a provider deployment identifier (a Worker version id, a Services
8
- * deployment digest), never the script they replace; that identifier stays on the stderr
9
- * `Deployment:` progress line and never fills `deployment.script`. Its URL is the public URL
10
- * `astrale domain install` fetches, which differs from the issuer only under adapter-cloudflare
11
- * `identityIssuer`.
12
- *
13
- * @deprecated Stable-target deploy path only. Replacement: `deployResult`, the result of an
14
- * immutable deployment. Consumers: the direct-mode configurations of domains ai-gateway, closing,
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).
20
- */
21
- export declare function stableTargetDeployResult(input: {
22
- readonly environment: string;
23
- readonly adapter: {
24
- readonly name: string;
25
- readonly version: string;
26
- };
27
- readonly deployment: ReadyDeployResult;
28
- }): DeployResultV1;
@@ -1,37 +0,0 @@
1
- /**
2
- * The deploy result of a stable target: the legacy direct-mode path (`prepare`/`deploy` adapter
3
- * operations) replaces the code its stable target runs in place and serves a v3 Publication, so
4
- * the result names no release, no build digest, no provider script, no secrets state and no commit.
5
- * Those operations report a provider deployment identifier (a Worker version id, a Services
6
- * deployment digest), never the script they replace; that identifier stays on the stderr
7
- * `Deployment:` progress line and never fills `deployment.script`. Its URL is the public URL
8
- * `astrale domain install` fetches, which differs from the issuer only under adapter-cloudflare
9
- * `identityIssuer`.
10
- *
11
- * @deprecated Stable-target deploy path only. Replacement: `deployResult`, the result of an
12
- * immutable deployment. Consumers: the direct-mode configurations of domains ai-gateway, closing,
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).
18
- */
19
- export function stableTargetDeployResult(input) {
20
- const { publication, addressing } = input.deployment.release;
21
- return Object.freeze({
22
- format: 'astrale.deploy-result',
23
- version: 1,
24
- origin: publication.origin,
25
- environment: input.environment,
26
- url: addressing.publicUrl,
27
- release: null,
28
- build: null,
29
- schema: Object.freeze({ revision: publication.schema.revision }),
30
- deployment: Object.freeze({
31
- adapter: `${input.adapter.name}@${input.adapter.version}`,
32
- script: null,
33
- state: 'replaced',
34
- }),
35
- commit: null,
36
- });
37
- }
@@ -1,21 +0,0 @@
1
- import type { Adapter, LegacyAdapter } from '../../../deployment/adapter/index.js';
2
- /**
3
- * An adapter that serves the legacy direct-mode path: a `LegacyAdapter`, or an adapter interface
4
- * v2 that keeps `prepare` and `deploy` for its direct-mode Environments.
5
- *
6
- * @deprecated Stable-target deploy path only. Replacement: `deployRelease` of adapter interface
7
- * v2. Consumers: `astrale-domain deploy` on the direct-mode
8
- * configurations of domains ai-gateway, closing, grc, integrations and issues (until SV15), domains
9
- * organization (until it leaves direct mode, AM-147), the Services `beta` and `prod` (until SV12),
10
- * `development` (until SV9) and frozen `admin-beta` (until D19) environments, shell (until SH2)
11
- * and its frozen `legacy-v3` (until D22), and ui:domain (until UI1). Deleted with the legacy
12
- * deploy path (D10), once no configuration on any repository's main selects it (CT33, AM-147).
13
- */
14
- export type StableTargetAdapter<Parameters extends object = object> = (Adapter<Parameters> | LegacyAdapter<Parameters>) & Pick<LegacyAdapter<Parameters>, 'prepare' | 'deploy'>;
15
- /**
16
- * The adapter of an Environment the stable-target path deploys, with its `prepare` and `deploy`.
17
- * An adapter that implements only adapter interface v2 has neither, and this path cannot deploy it.
18
- *
19
- * @deprecated Stable-target deploy path only; see `StableTargetAdapter`.
20
- */
21
- export declare function stableTargetAdapter<Parameters extends object>(adapter: Adapter<Parameters> | LegacyAdapter<Parameters>): StableTargetAdapter<Parameters>;
@@ -1,14 +0,0 @@
1
- /**
2
- * The adapter of an Environment the stable-target path deploys, with its `prepare` and `deploy`.
3
- * An adapter that implements only adapter interface v2 has neither, and this path cannot deploy it.
4
- *
5
- * @deprecated Stable-target deploy path only; see `StableTargetAdapter`.
6
- */
7
- export function stableTargetAdapter(adapter) {
8
- if (typeof adapter.prepare !== 'function' || typeof adapter.deploy !== 'function') {
9
- throw new TypeError(`Adapter ${adapter.name}@${adapter.version} implements only adapter interface v2 ` +
10
- '(deployRelease); this astrale-domain deploys through prepare and deploy, the legacy ' +
11
- 'direct-mode path, and never calls deployRelease.');
12
- }
13
- return adapter;
14
- }
@@ -1,40 +0,0 @@
1
- import type { Build, ResolvedRuntimeReference } from '../../../deployment/index.js';
2
- import type { LegacyDirectReason } from '../deploy-mode.js';
3
- import type { DeployResultV1 } from '../deploy-result.js';
4
- import type { LoadedEnvironment } from '../project.js';
5
- /**
6
- * What a direct-mode deploy prints on stderr before any effect (AM-59): its Environment replaces
7
- * one stable target in place and serves a v3 Publication only, which the deployment model
8
- * replaces with one immutable deployment per release.
9
- *
10
- * @deprecated Stable-target deploy path only; see `deployStableTarget`.
11
- */
12
- export declare function directModeDeprecation(environment: string, reasons: readonly LegacyDirectReason[]): string;
13
- /**
14
- * Deploy one Environment on the legacy direct-mode path (CT33): bundle exactly as
15
- * `astrale-domain build` does, let `prepare` place that Bundle at the Environment's stable target
16
- * and `deploy` replace the code it runs, then verify the v3 Publication it serves. It warns first,
17
- * then behaves exactly as before. The SDK never installs the deployed Domain here and makes no
18
- * Kernel call of its own.
19
- *
20
- * Returns the deploy result, or nothing once a failure is reported on stderr.
21
- *
22
- * @deprecated Stable-target deploy path only. Replacement: `deployImmutable`, the immutable
23
- * deployment of one sealed release through `deployRelease`. Consumers: the direct-mode
24
- * configurations of domains ai-gateway, closing, grc, integrations and issues (until SV15), domains
25
- * organization (until it leaves direct mode, AM-147), the Services `beta` and `prod` (until SV12),
26
- * `development` (until SV9) and frozen `admin-beta` (until D19) environments, shell (until SH2)
27
- * and its frozen `legacy-v3` (until D22), and ui:domain (until UI1). Deleted with the legacy deploy
28
- * path (D10), once no configuration on any repository's main selects it (CT33, AM-147).
29
- */
30
- export declare function deployStableTarget(input: {
31
- readonly projectDir: string;
32
- readonly environment: string;
33
- readonly definition: LoadedEnvironment;
34
- readonly reasons: readonly LegacyDirectReason[];
35
- readonly build: Build;
36
- readonly runtime: ResolvedRuntimeReference;
37
- readonly identity?: string;
38
- readonly signal: AbortSignal;
39
- readonly report: (line: string) => void;
40
- }): Promise<DeployResultV1 | undefined>;