@astrale-os/sdk 0.6.0-beta.22 → 0.6.0-beta.24

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 +30 -36
  2. package/dist/application/define.d.ts +3 -1
  3. package/dist/application/define.js +16 -2
  4. package/dist/application/domain.d.ts +3 -1
  5. package/dist/application/index.d.ts +1 -1
  6. package/dist/application/mutation/index.d.ts +1 -1
  7. package/dist/application/query/composite/plan.d.ts +0 -4
  8. package/dist/application/query/composite/plan.js +0 -2
  9. package/dist/application/view/define.js +4 -6
  10. package/dist/application/view/frontend.d.ts +2 -2
  11. package/dist/application/view/index.d.ts +1 -1
  12. package/dist/application/view/route.d.ts +0 -14
  13. package/dist/application/view/route.js +1 -64
  14. package/dist/deployment/adapter/adapter.d.ts +11 -24
  15. package/dist/deployment/adapter/bundle/file.d.ts +1 -1
  16. package/dist/deployment/adapter/define.d.ts +4 -25
  17. package/dist/deployment/adapter/define.js +12 -44
  18. package/dist/deployment/adapter/index.d.ts +0 -2
  19. package/dist/deployment/adapter/release/context.d.ts +3 -4
  20. package/dist/deployment/adapter/release/list.d.ts +1 -2
  21. package/dist/deployment/address/configuration.d.ts +12 -0
  22. package/dist/deployment/address/configuration.js +11 -0
  23. package/dist/deployment/address/index.d.ts +2 -2
  24. package/dist/deployment/address/index.js +2 -2
  25. package/dist/deployment/address/label.d.ts +5 -5
  26. package/dist/deployment/address/label.js +5 -5
  27. package/dist/deployment/address/record.d.ts +21 -0
  28. package/dist/deployment/address/record.js +34 -0
  29. package/dist/deployment/address/summary.d.ts +3 -7
  30. package/dist/deployment/authoring.d.ts +0 -2
  31. package/dist/deployment/authoring.js +0 -1
  32. package/dist/deployment/build/build.d.ts +6 -0
  33. package/dist/deployment/build/compile.js +2 -0
  34. package/dist/deployment/build/frontend/compilation.d.ts +2 -4
  35. package/dist/deployment/build/frontend/compilation.js +0 -5
  36. package/dist/deployment/build/frontend/digest.js +1 -5
  37. package/dist/deployment/build/material.d.ts +2 -2
  38. package/dist/deployment/build/material.js +28 -13
  39. package/dist/deployment/deployment.d.ts +4 -8
  40. package/dist/deployment/index.d.ts +3 -5
  41. package/dist/deployment/index.js +1 -2
  42. package/dist/deployment/release/addressing.d.ts +2 -9
  43. package/dist/deployment/release/addressing.js +2 -3
  44. package/dist/deployment/release/index.d.ts +0 -2
  45. package/dist/deployment/release/index.js +0 -2
  46. package/dist/deployment/release/release.d.ts +1 -1
  47. package/dist/deployment/release/runtime.d.ts +0 -2
  48. package/dist/deployment/release/runtime.js +0 -2
  49. package/dist/deployment/release/served/index.d.ts +1 -2
  50. package/dist/deployment/release/served/index.js +7 -3
  51. package/dist/deployment/release/served/views.js +0 -1
  52. package/dist/deployment/verify/index.d.ts +2 -4
  53. package/dist/deployment/verify/index.js +1 -3
  54. package/dist/deployment/verify/preflight/index.d.ts +0 -12
  55. package/dist/deployment/verify/preflight/index.js +0 -12
  56. package/dist/deployment/verify/readiness/index.d.ts +9 -6
  57. package/dist/deployment/verify/readiness/index.js +20 -12
  58. package/dist/deployment/worker/address.d.ts +26 -0
  59. package/dist/deployment/worker/address.js +43 -0
  60. package/dist/deployment/worker/build.d.ts +60 -0
  61. package/dist/deployment/worker/build.js +172 -0
  62. package/dist/deployment/worker/configuration.d.ts +73 -0
  63. package/dist/deployment/worker/configuration.js +165 -0
  64. package/dist/deployment/worker/content.d.ts +38 -0
  65. package/dist/deployment/worker/content.js +169 -0
  66. package/dist/deployment/worker/index.d.ts +29 -0
  67. package/dist/deployment/worker/index.js +29 -0
  68. package/dist/deployment/worker/limits.d.ts +30 -0
  69. package/dist/deployment/worker/limits.js +30 -0
  70. package/dist/deployment/worker/record.d.ts +29 -0
  71. package/dist/deployment/worker/record.js +69 -0
  72. package/dist/deployment/worker/request.d.ts +118 -0
  73. package/dist/deployment/worker/request.js +280 -0
  74. package/dist/deployment/worker/response.d.ts +101 -0
  75. package/dist/deployment/worker/response.js +207 -0
  76. package/dist/execution/identity/delivery.d.ts +2 -7
  77. package/dist/execution/identity/delivery.js +1 -23
  78. package/dist/execution/identity/identity.d.ts +2 -3
  79. package/dist/execution/index.d.ts +1 -3
  80. package/dist/execution/index.js +1 -2
  81. package/dist/execution/invocation/admission/authority.d.ts +4 -5
  82. package/dist/execution/invocation/admission/authority.js +1 -2
  83. package/dist/execution/invocation/index.d.ts +2 -2
  84. package/dist/execution/invocation/index.js +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 +5 -5
  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 +10 -6
  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
@@ -0,0 +1,207 @@
1
+ import { parseDeploymentLabel } from '../address/label.js';
2
+ import { serviceName } from './address.js';
3
+ import { decodeWorkerRecord } from './record.js';
4
+ export const WORKER_DEPLOYMENT_REJECTIONS = Object.freeze([
5
+ 'invalid-deployment',
6
+ 'address-mismatch',
7
+ 'build-mismatch',
8
+ 'service-owned-elsewhere',
9
+ 'deployment-conflict',
10
+ 'deployment-retired',
11
+ 'hosting-unavailable',
12
+ 'service-unavailable',
13
+ ]);
14
+ const STATES = Object.freeze([
15
+ 'deploying',
16
+ 'active',
17
+ 'retiring',
18
+ 'retired',
19
+ 'failed',
20
+ ]);
21
+ /** Which secret states each deployment state reports. */
22
+ const SECRETS_BY_STATE = Object.freeze({
23
+ created: Object.freeze(['bound']),
24
+ reused: Object.freeze(['updated', 'unchanged']),
25
+ });
26
+ /** Admit the answer of a host's `hosting`: exactly its routing domain. */
27
+ export function decodeWorkerHosting(input) {
28
+ const value = exact(input, ['routingDomain'], [], 'hosting');
29
+ if (typeof value.routingDomain !== 'string' || !isDnsName(value.routingDomain)) {
30
+ invalid('hosting', 'routingDomain');
31
+ }
32
+ return Object.freeze({ routingDomain: value.routingDomain });
33
+ }
34
+ /**
35
+ * Admit the answer of a deploy exactly: a deployment whose state reports the secret state it
36
+ * pairs with, or a refusal a host can give.
37
+ */
38
+ export function decodeWorkerDeploymentResponse(input) {
39
+ const value = exact(input, ['kind'], ['state', 'secrets', 'deployment', 'reason', 'message', 'retryAfter'], 'deploy');
40
+ if (value.kind === 'rejected') {
41
+ exact(value, ['kind', 'reason', 'message'], ['retryAfter'], 'refusal');
42
+ if (!WORKER_DEPLOYMENT_REJECTIONS.includes(value.reason)) {
43
+ invalid('refusal', 'reason');
44
+ }
45
+ if (typeof value.message !== 'string' ||
46
+ value.message.length < 1 ||
47
+ value.message.length > 500) {
48
+ invalid('refusal', 'message');
49
+ }
50
+ if (value.retryAfter !== undefined && !isInstant(value.retryAfter)) {
51
+ invalid('refusal', 'retryAfter');
52
+ }
53
+ return Object.freeze({
54
+ kind: 'rejected',
55
+ reason: value.reason,
56
+ message: value.message,
57
+ ...(value.retryAfter === undefined ? {} : { retryAfter: value.retryAfter }),
58
+ });
59
+ }
60
+ exact(value, ['kind', 'state', 'secrets', 'deployment'], [], 'deploy');
61
+ if (value.kind !== 'deployed')
62
+ invalid('deploy', 'kind');
63
+ if (value.state !== 'created' && value.state !== 'reused')
64
+ invalid('deploy', 'state');
65
+ const secrets = exact(value.secrets, ['state'], [], 'secrets');
66
+ const allowed = SECRETS_BY_STATE[value.state];
67
+ if (typeof secrets.state !== 'string' || !allowed.includes(secrets.state)) {
68
+ invalid('deploy', 'secrets.state');
69
+ }
70
+ return Object.freeze({
71
+ kind: 'deployed',
72
+ state: value.state,
73
+ secrets: Object.freeze({ state: secrets.state }),
74
+ deployment: decodeWorkerDeploymentSummary(value.deployment),
75
+ });
76
+ }
77
+ /** Admit the answer of a host's `list`: the summaries of the caller's deployments, in its order. */
78
+ export function decodeWorkerDeploymentList(input) {
79
+ const value = exact(input, ['deployments'], [], 'list');
80
+ if (!Array.isArray(value.deployments))
81
+ invalid('list', 'deployments');
82
+ return Object.freeze(value.deployments.map((deployment) => decodeWorkerDeploymentSummary(deployment)));
83
+ }
84
+ /**
85
+ * Admit one summary exactly: node ids and names a person can read, a label whose first part is
86
+ * the Service's name, the URL of that label, a known state, instants, digests, and a record that
87
+ * decodes.
88
+ */
89
+ export function decodeWorkerDeploymentSummary(input) {
90
+ const value = exact(input, [
91
+ 'id',
92
+ 'url',
93
+ 'label',
94
+ 'serviceId',
95
+ 'service',
96
+ 'project',
97
+ 'environment',
98
+ 'owner',
99
+ 'state',
100
+ 'current',
101
+ 'createdAt',
102
+ 'buildDigest',
103
+ 'configuration',
104
+ ], ['retiredAt', 'signingKeyId', 'record'], 'deployment');
105
+ for (const key of [
106
+ 'id',
107
+ 'url',
108
+ 'label',
109
+ 'serviceId',
110
+ 'service',
111
+ 'project',
112
+ 'environment',
113
+ 'owner',
114
+ ]) {
115
+ if (typeof value[key] !== 'string' || !isPrintable(value[key]))
116
+ invalid('deployment', key);
117
+ }
118
+ if (value.signingKeyId !== undefined) {
119
+ if (typeof value.signingKeyId !== 'string' || !isPrintable(value.signingKeyId)) {
120
+ invalid('deployment', 'signingKeyId');
121
+ }
122
+ }
123
+ let line;
124
+ try {
125
+ line = parseDeploymentLabel(value.label).line;
126
+ }
127
+ catch {
128
+ invalid('deployment', 'label');
129
+ }
130
+ if (value.service !== line)
131
+ invalid('deployment', 'service');
132
+ let named;
133
+ try {
134
+ named = serviceName(value.project, value.environment);
135
+ }
136
+ catch {
137
+ invalid('deployment', 'project');
138
+ }
139
+ if (named !== line)
140
+ invalid('deployment', 'service');
141
+ if (!isDeploymentUrl(value.url, value.label))
142
+ invalid('deployment', 'url');
143
+ if (!STATES.includes(value.state))
144
+ invalid('deployment', 'state');
145
+ if (typeof value.current !== 'boolean')
146
+ invalid('deployment', 'current');
147
+ if (!isInstant(value.createdAt))
148
+ invalid('deployment', 'createdAt');
149
+ if (value.retiredAt !== undefined && !isInstant(value.retiredAt))
150
+ invalid('deployment', 'retiredAt');
151
+ for (const key of ['buildDigest', 'configuration']) {
152
+ if (typeof value[key] !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(value[key])) {
153
+ invalid('deployment', key);
154
+ }
155
+ }
156
+ let record;
157
+ if (value.record !== undefined) {
158
+ try {
159
+ record = decodeWorkerRecord(value.record);
160
+ }
161
+ catch {
162
+ invalid('deployment', 'record');
163
+ }
164
+ }
165
+ const summary = { ...value };
166
+ delete summary.record;
167
+ return Object.freeze({
168
+ ...summary,
169
+ ...(record === undefined ? {} : { record }),
170
+ });
171
+ }
172
+ /** `https://<label>.<routing domain>`, nothing more. */
173
+ function isDeploymentUrl(url, label) {
174
+ const prefix = `https://${label}.`;
175
+ return url.startsWith(prefix) && isDnsName(url.slice(prefix.length));
176
+ }
177
+ /** Text a person can read in a listing: at most 512 characters, none of them a control character. */
178
+ function isPrintable(value) {
179
+ return value.length > 0 && value.length <= 512 && !/[\p{Cc}]/u.test(value);
180
+ }
181
+ function isInstant(value) {
182
+ return (typeof value === 'string' &&
183
+ value.length > 0 &&
184
+ value.length <= 64 &&
185
+ !Number.isNaN(Date.parse(value)));
186
+ }
187
+ function isDnsName(value) {
188
+ return (value.length <= 253 &&
189
+ value.split('.').every((label) => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/u.test(label)));
190
+ }
191
+ function exact(input, required, optional, label) {
192
+ if (input === null || typeof input !== 'object' || Array.isArray(input))
193
+ invalid(label);
194
+ const value = input;
195
+ for (const key of Reflect.ownKeys(value)) {
196
+ if (typeof key !== 'string' || (!required.includes(key) && !optional.includes(key))) {
197
+ invalid(label, String(key));
198
+ }
199
+ }
200
+ for (const key of required)
201
+ if (!Object.hasOwn(value, key))
202
+ invalid(label, key);
203
+ return value;
204
+ }
205
+ function invalid(label, member) {
206
+ throw new TypeError(`The Worker host returned an invalid ${label} answer${member === undefined ? '' : ` (${member})`}.`);
207
+ }
@@ -2,12 +2,7 @@ import type { release as serverRelease } from '@astrale-os/kernel-server';
2
2
  import * as release from '@astrale-os/kernel-protocol/release';
3
3
  import type { IssuerId } from '../../platform/auth/index.js';
4
4
  import type { SigningMaterial } from './signing.js';
5
- type Served = release.DomainRelease | release.legacy.Publication;
6
5
  /**
7
- * Create one stateless, nonce-bound public Delivery provider for the exact document a deployment
8
- * serves. It answers in the request's version: a Delivery v2 carrying the release for a v2
9
- * request, and a Delivery v1 carrying the Publication (a release's frozen v3 projection) for the
10
- * deprecated v1 request. A stable target's Publication answers v1 only.
6
+ * Create one stateless, nonce-bound public Delivery v2 provider for the exact deployment release.
11
7
  */
12
- export declare function releaseDelivery(signing: SigningMaterial, issuer: IssuerId, subject: string, deployed: Served): serverRelease.delivery.Provider;
13
- export {};
8
+ export declare function releaseDelivery(signing: SigningMaterial, issuer: IssuerId, subject: string, deployed: release.DomainRelease): serverRelease.delivery.Provider;
@@ -2,34 +2,12 @@ import * as release from '@astrale-os/kernel-protocol/release';
2
2
  import { SignJWT } from 'jose';
3
3
  const ATTESTATION_TTL_SECONDS = 60;
4
4
  /**
5
- * Create one stateless, nonce-bound public Delivery provider for the exact document a deployment
6
- * serves. It answers in the request's version: a Delivery v2 carrying the release for a v2
7
- * request, and a Delivery v1 carrying the Publication (a release's frozen v3 projection) for the
8
- * deprecated v1 request. A stable target's Publication answers v1 only.
5
+ * Create one stateless, nonce-bound public Delivery v2 provider for the exact deployment release.
9
6
  */
10
7
  export function releaseDelivery(signing, issuer, subject, deployed) {
11
- const projection = deployed.version === 4 ? release.legacy.publication(deployed) : deployed;
12
8
  return Object.freeze({
13
9
  async create(request, context) {
14
10
  context.signal.throwIfAborted();
15
- if (request.version === 1) {
16
- const attestation = await attest(signing, issuer, subject, request.kernel, {
17
- purpose: release.legacy.delivery.PURPOSE,
18
- nonce: request.nonce,
19
- etag: projection.etag,
20
- schemaRevision: projection.schema.revision,
21
- });
22
- context.signal.throwIfAborted();
23
- return release.legacy.delivery.accept({
24
- format: 'astrale.domain.delivery',
25
- version: 1,
26
- publication: projection,
27
- attestation,
28
- });
29
- }
30
- if (deployed.version !== 4) {
31
- throw new TypeError('A Publication-backed deployment answers Delivery v1 only.');
32
- }
33
11
  const attestation = await attest(signing, issuer, subject, request.kernel, {
34
12
  purpose: release.delivery.PURPOSE,
35
13
  nonce: request.nonce,
@@ -12,10 +12,9 @@ export interface Identity extends Issuer, InvocationAuthority {
12
12
  readonly subject: string;
13
13
  readonly tokenExchange?: exchange.Provider;
14
14
  /**
15
- * Delivery for the exact document this deployment serves: Delivery v2 over its release and v1
16
- * over its frozen v3 projection, or v1 over a stable target's Publication.
15
+ * Delivery v2 for the exact release this deployment serves.
17
16
  */
18
- delivery(served: releaseProtocol.DomainRelease | releaseProtocol.legacy.Publication): release.delivery.Provider;
17
+ delivery(served: releaseProtocol.DomainRelease): release.delivery.Provider;
19
18
  /**
20
19
  * The Domain's own authority toward one Kernel for a step of the durable Execution `executionId`
21
20
  * (`ctx.execution.id`), which no caller credential carries; its credentials name `executionId` in
@@ -1,7 +1,5 @@
1
1
  export { serve } from './serve.js';
2
2
  export type { ExecutionContext, ServedDomain, ServeInput } from './serve.js';
3
3
  export { createIdentity, maximumExchangeTtl, type ExchangeOptions, type Identity, type IdentityInput, } from './identity/index.js';
4
- export { InvocationError } from './invocation/index.js';
5
- export type { InvocationErrorCode } from './invocation/index.js';
6
4
  export type { DurableEngine, DurableServing, DurableServingProvider } from './workflows/index.js';
7
- export { isCanonicalDurableRequest, isLegacyDurableRequest } from './workflows/route.js';
5
+ export { isCanonicalDurableRequest } from './workflows/route.js';
@@ -1,4 +1,3 @@
1
1
  export { serve } from './serve.js';
2
2
  export { createIdentity, maximumExchangeTtl, } from './identity/index.js';
3
- export { InvocationError } from './invocation/index.js';
4
- export { isCanonicalDurableRequest, isLegacyDurableRequest } from './workflows/route.js';
3
+ export { isCanonicalDurableRequest } from './workflows/route.js';
@@ -6,13 +6,13 @@ import type { Domain } from '../../../platform/schema/index.js';
6
6
  export interface InvocationAdmissionInput {
7
7
  readonly call: invocation.Call;
8
8
  readonly credential?: string;
9
- readonly via: invocation.Via | invocation.PublicationVia;
9
+ readonly via: invocation.Via;
10
10
  readonly domain: Domain;
11
11
  readonly context: InvocationContext;
12
12
  }
13
13
  export interface InvocationAuthenticationInput {
14
14
  readonly credential: string;
15
- readonly via: invocation.Via | invocation.PublicationVia;
15
+ readonly via: invocation.Via;
16
16
  readonly domain: Domain;
17
17
  readonly context: InvocationContext;
18
18
  }
@@ -35,7 +35,6 @@ export interface InvocationAuthority {
35
35
  export declare function authority(input: InvocationAuthority): InvocationAuthority;
36
36
  /**
37
37
  * The routed witness of a remote call, already admitted by the Kernel Server against the served
38
- * snapshot: the exact `ReleaseRef` of an immutable deployment, or the `PublicationRef` of a v3 pin
39
- * (a release's exact projection, or a stable target's Publication).
38
+ * snapshot: the exact ReleaseRef of this immutable deployment.
40
39
  */
41
- export declare function requireVia(request: HandlerRequest): invocation.Via | invocation.PublicationVia;
40
+ export declare function requireVia(request: HandlerRequest): invocation.Via;
@@ -14,8 +14,7 @@ export function authority(input) {
14
14
  }
15
15
  /**
16
16
  * The routed witness of a remote call, already admitted by the Kernel Server against the served
17
- * snapshot: the exact `ReleaseRef` of an immutable deployment, or the `PublicationRef` of a v3 pin
18
- * (a release's exact projection, or a stable target's Publication).
17
+ * snapshot: the exact ReleaseRef of this immutable deployment.
19
18
  */
20
19
  export function requireVia(request) {
21
20
  if (request.via === undefined) {
@@ -1,5 +1,5 @@
1
1
  export { createHandler, type HandlerInput } from './handler.js';
2
2
  export { invoke, type InvocationInput } from './invocation.js';
3
3
  export type * from './admission/index.js';
4
- export { InvocationDefect, InvocationError } from './result/index.js';
5
- export type { InvocationDefectCode, InvocationErrorCode } from './result/index.js';
4
+ export { InvocationDefect } from './result/index.js';
5
+ export type { InvocationDefectCode } from './result/index.js';
@@ -1,3 +1,3 @@
1
1
  export { createHandler } from './handler.js';
2
2
  export { invoke } from './invocation.js';
3
- export { InvocationDefect, InvocationError } from './result/index.js';
3
+ export { InvocationDefect } from './result/index.js';
@@ -70,19 +70,10 @@ function refusedAsMiss(cause) {
70
70
  return (cause instanceof errors.ProtocolError &&
71
71
  errors.reasonOf(cause.payload.data)?.code === FUNCTION_MISS);
72
72
  }
73
- /**
74
- * The Kernel Server pins every request to the one snapshot it serves: the release of an immutable
75
- * deployment, or a stable target's Publication. Execution answers only for that exact document.
76
- */
73
+ /** Execution answers only for the exact release pinned by the Kernel Server snapshot. */
77
74
  function pinsRunningRelease(request, running) {
78
- if (running.kind === 'release') {
79
- return (request.publication === undefined &&
80
- request.release !== undefined &&
81
- release.matchesReference(request.release.release, release.reference(running.document)));
82
- }
83
- return (request.release === undefined &&
84
- request.publication !== undefined &&
85
- release.legacy.matchesReference(request.publication.publication, release.legacy.reference(running.publication)));
75
+ return (request.release !== undefined &&
76
+ release.matchesReference(request.release.release, release.reference(running.document)));
86
77
  }
87
78
  function once(operation) {
88
79
  let called = false;
@@ -2,16 +2,6 @@ import * as errors from '@astrale-os/kernel-protocol/errors';
2
2
  import type { ResolvedCallable } from '../../../application/action/index.js';
3
3
  import type { Key } from '../../../platform/schema/index.js';
4
4
  import type { Value } from '../../../platform/value/index.js';
5
- export type InvocationErrorCode = Extract<keyof typeof errors.CODES, 'VALIDATION_ERROR' | 'ACCESS_DENIED' | 'NOT_FOUND' | 'CONFLICT' | 'UNSUPPORTED' | 'LIMIT_EXCEEDED' | 'BACKEND_UNAVAILABLE'>;
6
- /** @deprecated Declare expected failures on defineAction or defineWorkflow instead. */
7
- export declare class InvocationError extends Error {
8
- readonly code: InvocationErrorCode;
9
- readonly name = "InvocationError";
10
- readonly reason?: errors.ErrorReason;
11
- constructor(code: InvocationErrorCode, message: string, options?: ErrorOptions & {
12
- readonly reason?: errors.ErrorReason;
13
- });
14
- }
15
5
  export type InvocationDefectCode = 'INVOCATION_TARGET_INVALID' | 'INVOCATION_HANDLER_INVALID' | 'INVOCATION_OUTPUT_INVALID' | 'INVOCATION_RESULT_CONTRACT_VIOLATION';
16
6
  export declare class InvocationDefect extends Error {
17
7
  readonly code: InvocationDefectCode;
@@ -5,20 +5,6 @@ const PUBLIC_ERROR_CODES = new Set(Object.values(errors.CODES));
5
5
  const PUBLIC_ERROR_NAMES = new Map(Object.entries(errors.CODES).map(([name, code]) => [code, name]));
6
6
  const MAXIMUM_DIAGNOSTICS = 32;
7
7
  const admittedProtocolErrors = new WeakSet();
8
- /** @deprecated Declare expected failures on defineAction or defineWorkflow instead. */
9
- export class InvocationError extends Error {
10
- code;
11
- name = 'InvocationError';
12
- reason;
13
- constructor(code, message, options = {}) {
14
- super(message, options);
15
- this.code = code;
16
- this.reason =
17
- options.reason === undefined
18
- ? undefined
19
- : errors.acceptReason(options.reason, 'InvocationError reason');
20
- }
21
- }
22
8
  export class InvocationDefect extends Error {
23
9
  code;
24
10
  name = 'InvocationDefect';
@@ -62,9 +48,6 @@ export function projectError(input) {
62
48
  ? input
63
49
  : protocolError('INTERNAL_ERROR', 'Internal application error.');
64
50
  }
65
- if (input instanceof InvocationError) {
66
- return protocolError('INTERNAL_ERROR', 'Internal application error.');
67
- }
68
51
  if (input instanceof ResponseError) {
69
52
  if (!PUBLIC_ERROR_CODES.has(input.code)) {
70
53
  return protocolError('BACKEND_UNAVAILABLE', 'Dependency Kernel returned invalid error evidence.');
@@ -1,4 +1,4 @@
1
- export { inputError, InvocationDefect, InvocationError, projectError, protocolError, } from './errors.js';
2
- export type { InvocationDefectCode, InvocationErrorCode } from './errors.js';
1
+ export { inputError, InvocationDefect, projectError, protocolError } from './errors.js';
2
+ export type { InvocationDefectCode } from './errors.js';
3
3
  export { project } from './project.js';
4
4
  export { validateInput, validateOutput } from './validate.js';
@@ -1,3 +1,3 @@
1
- export { inputError, InvocationDefect, InvocationError, projectError, protocolError, } from './errors.js';
1
+ export { inputError, InvocationDefect, projectError, protocolError } from './errors.js';
2
2
  export { project } from './project.js';
3
3
  export { validateInput, validateOutput } from './validate.js';
@@ -1,22 +1,17 @@
1
1
  import type * as release from '@astrale-os/kernel-protocol/release';
2
2
  import type { Build } from '../../deployment/build/build.js';
3
- import type * as legacy from '../../deployment/release/legacy/index.js';
4
3
  import type { Release } from '../../deployment/release/release.js';
5
4
  import type { IssuerId } from '../../platform/auth/index.js';
6
- /**
7
- * What one Service serves: the `DomainRelease` v4 Release of an immutable deployment, or the
8
- * deprecated v3 Release of a stable target (`legacy`, its consumers and removal in
9
- * `deployment/release/legacy/index.ts`, D10).
10
- */
11
- export type ServedRelease<BuildValue extends Build = Build> = Release<BuildValue> | legacy.Release<BuildValue>;
5
+ /** The DomainRelease v4 served by one immutable deployment. */
6
+ export type ServedRelease<BuildValue extends Build = Build> = Release<BuildValue>;
12
7
  /** Where and as whom one served Release answers, and the document it serves. */
13
8
  export interface Serving {
14
- /** Domain identity issuer: a deployment's URL, or a stable target's configured issuer. */
9
+ /** Domain identity issuer: this deployment's URL. */
15
10
  readonly issuer: IssuerId;
16
- /** Public origin the Server answers at: a deployment's URL, or a stable target's route. */
11
+ /** Public origin the Server answers at: this deployment's URL. */
17
12
  readonly publicUrl: IssuerId;
18
- /** The document served at `release.json`, or a stable target's v3 Publication at `domain.json`. */
19
- readonly document: release.DomainRelease | release.legacy.Publication;
13
+ /** The document served at release.json. */
14
+ readonly document: release.DomainRelease;
20
15
  }
21
16
  export declare function isServedRelease(input: unknown): input is ServedRelease;
22
17
  export declare function serving(served: ServedRelease): Serving;
@@ -1,14 +1,7 @@
1
1
  import { isRelease } from '../../deployment/release/admission.js';
2
- import { isRelease as isLegacyRelease } from '../../deployment/release/legacy/admission.js';
3
2
  export function isServedRelease(input) {
4
- return isRelease(input) || isLegacyRelease(input);
3
+ return isRelease(input);
5
4
  }
6
5
  export function serving(served) {
7
- return served.kind === 'release'
8
- ? Object.freeze({ issuer: served.url, publicUrl: served.url, document: served.document })
9
- : Object.freeze({
10
- issuer: served.addressing.issuer,
11
- publicUrl: served.addressing.publicUrl,
12
- document: served.publication,
13
- });
6
+ return Object.freeze({ issuer: served.url, publicUrl: served.url, document: served.document });
14
7
  }
@@ -4,7 +4,7 @@ import { invocationPath } from '../../deployment/release/invocation.js';
4
4
  import { identity as captureIdentity } from '../identity/index.js';
5
5
  import { createHandler } from '../invocation/index.js';
6
6
  import { initialize, load, serving as servedRelease } from '../runtime/index.js';
7
- import { createDurableReceiver, durableServing, isDurableRequest, } from '../workflows/index.js';
7
+ import { createDurableReceiver, durableServing, isCanonicalDurableRequest, isDurableRequest, } from '../workflows/index.js';
8
8
  import { initialization } from './initialization.js';
9
9
  import { lifecycle } from './lifecycle.js';
10
10
  import { loadRelease } from './release.js';
@@ -83,6 +83,8 @@ export function createService(input) {
83
83
  return unavailable();
84
84
  // Without engine configuration only durable calls fail: the engine's discovery is refused.
85
85
  if (isDurableRequest(request)) {
86
+ if (!isCanonicalDurableRequest(request))
87
+ return notServed();
86
88
  const selected = await receiver.get(request);
87
89
  if (!state.accepting)
88
90
  return unavailable();
@@ -6,7 +6,7 @@ import type { Identity } from '../identity/index.js';
6
6
  import type { ServedRelease } from '../runtime/index.js';
7
7
  import type { DurableServing, DurableServingProvider } from '../workflows/index.js';
8
8
  import type { ReleaseLoader } from './release.js';
9
- export type ServiceServerOptions = Omit<ServerOptions, 'path' | 'invocation' | 'issuer' | 'publicOrigin' | 'tokenExchange' | 'release' | 'publication' | 'delivery'>;
9
+ export type ServiceServerOptions = Omit<ServerOptions, 'path' | 'invocation' | 'issuer' | 'publicOrigin' | 'tokenExchange' | 'release' | 'delivery'>;
10
10
  export interface ServiceInput<Environment, RuntimeValue extends Runtime = Runtime> {
11
11
  readonly runtime: RuntimeValue;
12
12
  readonly environment: Environment;
@@ -14,8 +14,7 @@ export interface ServiceInput<Environment, RuntimeValue extends Runtime = Runtim
14
14
  readonly identity: Identity;
15
15
  readonly server: ServiceServerOptions;
16
16
  /**
17
- * Answers Delivery in the request's version: v2 over an immutable deployment's release, v1 over
18
- * the Publication (a release's frozen v3 projection). Defaults to the Identity's own.
17
+ * Answers Delivery v2 over an immutable deployment's Release. Defaults to the Identity's own.
19
18
  */
20
19
  readonly delivery?: release.delivery.Provider;
21
20
  readonly workflows?: WorkflowRunner;
@@ -1,6 +1,5 @@
1
1
  import type { release } from '@astrale-os/kernel-server';
2
2
  /**
3
- * Capture an explicit Delivery Provider. It answers in the request's version: v2 over an immutable
4
- * deployment's release, v1 over the Publication (a release's frozen v3 projection).
3
+ * Capture an explicit Delivery v2 Provider over an immutable deployment's Release.
5
4
  */
6
5
  export declare function delivery(input: release.delivery.Provider | undefined): release.delivery.Provider | undefined;
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Capture an explicit Delivery Provider. It answers in the request's version: v2 over an immutable
3
- * deployment's release, v1 over the Publication (a release's frozen v3 projection).
2
+ * Capture an explicit Delivery v2 Provider over an immutable deployment's Release.
4
3
  */
5
4
  export function delivery(input) {
6
5
  if (input === undefined)
@@ -1,18 +1,11 @@
1
- import type { PublicationSource, ReleaseSource } from '@astrale-os/kernel-server';
1
+ import type { ReleaseSource } from '@astrale-os/kernel-server';
2
2
  import type { LoadedRuntime } from '../../runtime/index.js';
3
3
  /** The one source a Kernel Server serves, as `ServerOptions` takes it. */
4
- export type ServingSource =
5
- /** The release of an immutable deployment: `release.json` and its v3 projection. */
6
- {
4
+ export type ServingSource = {
7
5
  readonly release: ReleaseSource;
8
- }
9
- /** @deprecated A stable target's v3 Publication; see `legacy/index.ts`. */
10
- | {
11
- readonly publication: PublicationSource;
12
6
  };
13
7
  /**
14
8
  * Prepare, once, the exact snapshot the loaded Release serves: an immutable deployment serves its
15
- * `DomainRelease` through `prepareReleaseSnapshot`, which admits only routing naming that exact
16
- * release or its exact v3 projection; a stable target keeps serving its v3 Publication.
9
+ * DomainRelease through prepareReleaseSnapshot, which admits routing naming that exact release.
17
10
  */
18
11
  export declare function source(runtime: LoadedRuntime): ServingSource;
@@ -1,14 +1,10 @@
1
1
  import { prepareReleaseSnapshot } from '@astrale-os/kernel-server';
2
- import { publicationSource } from './legacy/index.js';
3
2
  /**
4
3
  * Prepare, once, the exact snapshot the loaded Release serves: an immutable deployment serves its
5
- * `DomainRelease` through `prepareReleaseSnapshot`, which admits only routing naming that exact
6
- * release or its exact v3 projection; a stable target keeps serving its v3 Publication.
4
+ * DomainRelease through prepareReleaseSnapshot, which admits routing naming that exact release.
7
5
  */
8
6
  export function source(runtime) {
9
7
  const served = runtime.release;
10
- if (served.kind !== 'release')
11
- return publicationSource(runtime, served);
12
8
  const snapshot = prepareReleaseSnapshot({
13
9
  release: served.document,
14
10
  bundle: served.build.schema.bundle.bytes(),
@@ -1,4 +1,4 @@
1
1
  export type { DurableEngine, EngineRetryPolicy, EngineSharedContext, EngineWorkflowContext, EngineWorkflowDefinition, } from './engine.js';
2
2
  export { durableServing, type AdmittedDurableServing, type DurableServing, type DurableServingProvider, } from './options.js';
3
3
  export { createDurableReceiver, type DurableReceiver } from './receiver.js';
4
- export { isDurableRequest, isCanonicalDurableRequest, isLegacyDurableRequest } from './route.js';
4
+ export { isDurableRequest, isCanonicalDurableRequest } from './route.js';
@@ -1,3 +1,3 @@
1
1
  export { durableServing, } from './options.js';
2
2
  export { createDurableReceiver } from './receiver.js';
3
- export { isDurableRequest, isCanonicalDurableRequest, isLegacyDurableRequest } from './route.js';
3
+ export { isDurableRequest, isCanonicalDurableRequest } from './route.js';
@@ -4,11 +4,6 @@ import type { DurableEngine, EngineRetryPolicy } from './engine.js';
4
4
  export interface DurableServing {
5
5
  /** The Restate SDK Fetch build of this platform. */
6
6
  readonly engine: DurableEngine;
7
- /**
8
- * @deprecated Explicit signing authority for retained callbacks registered before issuer-prefixed
9
- * paths. Canonical requests discover their authority from the named Kernel and ignore these keys.
10
- */
11
- readonly identityKeys?: readonly string[];
12
7
  /** Fetch capability used for HTTPS discovery of a canonical request's Kernel engine. */
13
8
  readonly fetch?: Fetch;
14
9
  /**
@@ -30,7 +25,6 @@ export interface DurableServing {
30
25
  export type DurableServingProvider = (request: Request) => DurableServing | undefined | Promise<DurableServing | undefined>;
31
26
  export interface AdmittedDurableServing {
32
27
  readonly engine: DurableEngine;
33
- readonly identityKeys: readonly string[];
34
28
  readonly fetch: Fetch;
35
29
  readonly retentionMs: number;
36
30
  readonly retryPolicy: EngineRetryPolicy;