@astrale-os/kernel-protocol 0.5.0-beta.67 → 0.5.0-beta.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codecs/index.d.ts +1 -2
- package/dist/codecs/index.js +1 -2
- package/dist/codecs/media-types.d.ts +0 -1
- package/dist/codecs/media-types.js +0 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/invocation/admission.d.ts +2 -2
- package/dist/invocation/admission.js +5 -5
- package/dist/invocation/binding-codecs.d.ts +1 -1
- package/dist/invocation/binding-codecs.js +1 -6
- package/dist/invocation/http/negotiation.js +3 -10
- package/dist/invocation/index.d.ts +5 -2
- package/dist/invocation/index.js +4 -2
- package/dist/invocation/legacy/index.d.ts +29 -0
- package/dist/invocation/legacy/index.js +28 -0
- package/dist/invocation/legacy/route.d.ts +14 -0
- package/dist/invocation/legacy/route.js +25 -0
- package/dist/invocation/legacy/via.d.ts +30 -0
- package/dist/invocation/legacy/via.js +15 -0
- package/dist/invocation/redirect.d.ts +15 -12
- package/dist/invocation/redirect.js +9 -21
- package/dist/invocation/request.js +2 -2
- package/dist/invocation/routing.d.ts +19 -5
- package/dist/invocation/routing.js +50 -20
- package/dist/invocation/schema.d.ts +3 -8
- package/dist/invocation/schema.js +3 -10
- package/dist/invocation/service-reason.d.ts +13 -13
- package/dist/invocation/service-reason.js +13 -12
- package/dist/invocation/stale-route.d.ts +1 -1
- package/dist/invocation/target.d.ts +3 -0
- package/dist/invocation/target.js +8 -1
- package/dist/invocation/websocket/index.d.ts +1 -1
- package/dist/invocation/websocket/index.js +1 -1
- package/dist/invocation/websocket/subprotocol.d.ts +1 -2
- package/dist/invocation/websocket/subprotocol.js +3 -4
- package/dist/issuer/index.d.ts +1 -0
- package/dist/issuer/index.js +1 -0
- package/dist/issuer/paths.d.ts +2 -0
- package/dist/issuer/paths.js +1 -0
- package/dist/issuer/workflow-engine.d.ts +18 -0
- package/dist/issuer/workflow-engine.js +59 -0
- package/dist/{publication → release}/bindings/callable.js +6 -6
- package/dist/release/bindings/invocation.js +13 -0
- package/dist/{publication → release}/bindings/view.d.ts +1 -1
- package/dist/{publication → release}/bindings/view.js +10 -10
- package/dist/release/build.d.ts +6 -0
- package/dist/release/build.js +7 -0
- package/dist/release/bundle-admission.d.ts +21 -0
- package/dist/{publication → release}/bundle-admission.js +18 -18
- package/dist/{publication → release}/bundle-descriptor.js +6 -6
- package/dist/release/bundle-evidence.d.ts +3 -0
- package/dist/release/bundle-evidence.js +13 -0
- package/dist/{publication → release}/bundle.d.ts +2 -2
- package/dist/{publication → release}/bundle.js +9 -9
- package/dist/{publication → release}/delivery/attestation.d.ts +1 -0
- package/dist/release/delivery/claims.d.ts +21 -0
- package/dist/release/delivery/claims.js +68 -0
- package/dist/release/delivery/delivery.d.ts +11 -0
- package/dist/release/delivery/delivery.js +24 -0
- package/dist/{publication → release}/delivery/error.d.ts +2 -0
- package/dist/{publication → release}/delivery/error.js +1 -0
- package/dist/{publication → release}/delivery/index.d.ts +6 -1
- package/dist/{publication → release}/delivery/index.js +5 -0
- package/dist/{publication → release}/delivery/limits.d.ts +2 -1
- package/dist/release/delivery/limits.js +5 -0
- package/dist/release/delivery/request.d.ts +21 -0
- package/dist/release/delivery/request.js +60 -0
- package/dist/{publication → release}/delivery-declaration.js +4 -4
- package/dist/release/delivery-endpoint.js +22 -0
- package/dist/release/digest.d.ts +13 -0
- package/dist/{publication/etag.js → release/digest.js} +1 -10
- package/dist/release/error.d.ts +7 -0
- package/dist/release/error.js +11 -0
- package/dist/release/index.d.ts +21 -0
- package/dist/release/index.js +14 -0
- package/dist/release/issuer.d.ts +5 -0
- package/dist/release/issuer.js +34 -0
- package/dist/release/legacy/bindings.d.ts +14 -0
- package/dist/release/legacy/bindings.js +11 -0
- package/dist/release/legacy/bundle-admission.d.ts +6 -0
- package/dist/release/legacy/bundle-admission.js +10 -0
- package/dist/release/legacy/bundle-evidence.d.ts +8 -0
- package/dist/release/legacy/bundle-evidence.js +11 -0
- package/dist/release/legacy/bundle.d.ts +24 -0
- package/dist/release/legacy/bundle.js +31 -0
- package/dist/release/legacy/delivery/attestation.d.ts +6 -0
- package/dist/release/legacy/delivery/attestation.js +1 -0
- package/dist/{publication → release/legacy}/delivery/claims.d.ts +9 -0
- package/dist/{publication → release/legacy}/delivery/claims.js +7 -2
- package/dist/release/legacy/delivery/delivery.d.ts +18 -0
- package/dist/{publication → release/legacy}/delivery/delivery.js +6 -2
- package/dist/release/legacy/delivery/error.d.ts +16 -0
- package/dist/release/legacy/delivery/error.js +6 -0
- package/dist/release/legacy/delivery/index.d.ts +13 -0
- package/dist/release/legacy/delivery/index.js +13 -0
- package/dist/release/legacy/delivery/limits.d.ts +21 -0
- package/dist/release/legacy/delivery/limits.js +22 -0
- package/dist/release/legacy/delivery/request.d.ts +26 -0
- package/dist/{publication → release/legacy}/delivery/request.js +8 -3
- package/dist/release/legacy/delivery-declaration.d.ts +9 -0
- package/dist/release/legacy/delivery-declaration.js +11 -0
- package/dist/release/legacy/error.d.ts +26 -0
- package/dist/release/legacy/error.js +114 -0
- package/dist/release/legacy/etag.d.ts +12 -0
- package/dist/release/legacy/etag.js +14 -0
- package/dist/release/legacy/index.d.ts +72 -0
- package/dist/{publication → release/legacy}/index.js +7 -2
- package/dist/release/legacy/profiles.d.ts +23 -0
- package/dist/release/legacy/profiles.js +36 -0
- package/dist/release/legacy/projection.d.ts +13 -0
- package/dist/release/legacy/projection.js +25 -0
- package/dist/release/legacy/publication.d.ts +90 -0
- package/dist/release/legacy/publication.js +124 -0
- package/dist/release/legacy/reference.d.ts +47 -0
- package/dist/{publication → release/legacy}/reference.js +27 -3
- package/dist/release/legacy/requirements.d.ts +30 -0
- package/dist/release/legacy/requirements.js +20 -0
- package/dist/{publication → release}/manifest.js +6 -6
- package/dist/release/reference.d.ts +26 -0
- package/dist/release/reference.js +70 -0
- package/dist/release/release.d.ts +60 -0
- package/dist/release/release.js +123 -0
- package/dist/{publication → release}/requirements.d.ts +11 -4
- package/dist/{publication → release}/requirements.js +58 -39
- package/dist/{publication → release}/route.js +24 -24
- package/dist/{publication → release}/schema.js +4 -4
- package/dist/release/served.d.ts +26 -0
- package/dist/release/served.js +65 -0
- package/dist/release/shape.d.ts +8 -0
- package/dist/routes/admission.d.ts +1 -1
- package/dist/routes/admission.js +7 -85
- package/dist/routes/binding.d.ts +3 -3
- package/dist/routes/binding.js +10 -19
- package/dist/routes/compiler.d.ts +2 -2
- package/dist/routes/compiler.js +3 -2
- package/dist/routes/credential.d.ts +1 -1
- package/dist/routes/decode.d.ts +5 -2
- package/dist/routes/decode.js +15 -4
- package/dist/routes/deployment-retired.d.ts +30 -0
- package/dist/routes/deployment-retired.js +96 -0
- package/dist/routes/encode.js +7 -6
- package/dist/routes/entries.d.ts +23 -0
- package/dist/routes/entries.js +150 -0
- package/dist/routes/evidence.d.ts +3 -3
- package/dist/routes/evidence.js +7 -34
- package/dist/routes/header.d.ts +9 -0
- package/dist/routes/header.js +34 -0
- package/dist/routes/index.d.ts +5 -2
- package/dist/routes/index.js +5 -2
- package/dist/routes/legacy/index.d.ts +29 -0
- package/dist/routes/legacy/index.js +29 -0
- package/dist/routes/legacy/routing.d.ts +24 -0
- package/dist/routes/legacy/routing.js +45 -0
- package/dist/routes/legacy/table.d.ts +34 -0
- package/dist/routes/legacy/table.js +50 -0
- package/dist/routes/mapping.d.ts +1 -1
- package/dist/routes/mapping.js +4 -4
- package/dist/routes/match.d.ts +1 -1
- package/dist/routes/placement.d.ts +2 -2
- package/dist/routes/plan.d.ts +1 -1
- package/dist/routes/request.d.ts +3 -3
- package/dist/routes/reservation.d.ts +4 -2
- package/dist/routes/reservation.js +4 -3
- package/dist/routes/routing.d.ts +30 -6
- package/dist/routes/routing.js +34 -49
- package/dist/routes/select.d.ts +1 -1
- package/dist/routes/table.d.ts +3 -2
- package/dist/routes/target.d.ts +5 -0
- package/dist/routes/target.js +16 -0
- package/dist/runtime/artifact.d.ts +2 -2
- package/dist/runtime/artifact.js +2 -2
- package/dist/schema/installation/codec.d.ts +6 -1
- package/dist/schema/installation/codec.js +10 -7
- package/dist/schema/installation/introspection/codec.d.ts +11 -2
- package/dist/schema/installation/introspection/codec.js +59 -41
- package/dist/schema/installation/introspection/result.d.ts +8 -1
- package/dist/schema/installation/legacy/index.d.ts +39 -0
- package/dist/schema/installation/legacy/index.js +39 -0
- package/dist/schema/installation/legacy/installation.d.ts +9 -0
- package/dist/schema/installation/legacy/installation.js +28 -0
- package/dist/schema/installation/legacy/introspection.d.ts +10 -0
- package/dist/schema/installation/legacy/introspection.js +70 -0
- package/dist/schema/installation/legacy/msgpack.d.ts +1 -0
- package/dist/schema/installation/legacy/msgpack.js +143 -0
- package/package.json +59 -36
- package/dist/codecs/msgpack.d.ts +0 -4
- package/dist/codecs/msgpack.js +0 -53
- package/dist/publication/bindings/invocation.js +0 -13
- package/dist/publication/bundle-admission.d.ts +0 -4
- package/dist/publication/bundle-evidence.d.ts +0 -3
- package/dist/publication/bundle-evidence.js +0 -13
- package/dist/publication/content.d.ts +0 -10
- package/dist/publication/delivery/delivery.d.ts +0 -9
- package/dist/publication/delivery/limits.js +0 -4
- package/dist/publication/delivery/request.d.ts +0 -15
- package/dist/publication/delivery-endpoint.js +0 -22
- package/dist/publication/error.d.ts +0 -7
- package/dist/publication/error.js +0 -11
- package/dist/publication/etag.d.ts +0 -6
- package/dist/publication/index.d.ts +0 -17
- package/dist/publication/legacy-requirements.d.ts +0 -12
- package/dist/publication/legacy-requirements.js +0 -23
- package/dist/publication/publication.d.ts +0 -38
- package/dist/publication/publication.js +0 -146
- package/dist/publication/reference.d.ts +0 -17
- package/dist/routes/release-unavailable.d.ts +0 -8
- package/dist/routes/release-unavailable.js +0 -32
- /package/dist/{publication → release}/bindings/callable.d.ts +0 -0
- /package/dist/{publication → release}/bindings/index.d.ts +0 -0
- /package/dist/{publication → release}/bindings/index.js +0 -0
- /package/dist/{publication → release}/bindings/invocation.d.ts +0 -0
- /package/dist/{publication → release}/bundle-descriptor.d.ts +0 -0
- /package/dist/{publication → release}/declaration.d.ts +0 -0
- /package/dist/{publication → release}/declaration.js +0 -0
- /package/dist/{publication → release}/delivery/attestation.js +0 -0
- /package/dist/{publication → release}/delivery-declaration.d.ts +0 -0
- /package/dist/{publication → release}/delivery-endpoint.d.ts +0 -0
- /package/dist/{publication → release}/manifest.d.ts +0 -0
- /package/dist/{publication → release}/route.d.ts +0 -0
- /package/dist/{publication → release}/schema.d.ts +0 -0
- /package/dist/{publication/content.js → release/shape.js} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as descriptor from '../bundle-descriptor.js';
|
|
2
|
+
import * as bundle from '../bundle.js';
|
|
3
|
+
import { withPublicationError } from './error.js';
|
|
4
|
+
export { verifyBundleBytes } from './bundle-evidence.js';
|
|
5
|
+
/** @deprecated Use `BUNDLE_MEDIA_TYPE` from `@astrale-os/kernel-protocol/release/bundle`. */
|
|
6
|
+
export const BUNDLE_MEDIA_TYPE = descriptor.BUNDLE_MEDIA_TYPE;
|
|
7
|
+
/**
|
|
8
|
+
* Resolve immutable bundle bytes beneath the exact serving issuer.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Use `bundleUrl` from `@astrale-os/kernel-protocol/release/bundle`, which reports
|
|
11
|
+
* `ReleaseError`.
|
|
12
|
+
*/
|
|
13
|
+
export function bundleUrl(issuer, ref) {
|
|
14
|
+
return withPublicationError(() => bundle.bundleUrl(issuer, ref));
|
|
15
|
+
}
|
|
16
|
+
/** @deprecated Use `describeBundle` from `@astrale-os/kernel-protocol/release/bundle`. */
|
|
17
|
+
export function describeBundle(input, href) {
|
|
18
|
+
return withPublicationError(() => bundle.describeBundle(input, href));
|
|
19
|
+
}
|
|
20
|
+
/** @deprecated Use `acceptBundleValue` from `@astrale-os/kernel-protocol/release/bundle`. */
|
|
21
|
+
export function acceptBundleValue(input) {
|
|
22
|
+
return withPublicationError(() => bundle.acceptBundleValue(input));
|
|
23
|
+
}
|
|
24
|
+
/** @deprecated Use `decodeBundleValue` from `@astrale-os/kernel-protocol/release/bundle`. */
|
|
25
|
+
export function decodeBundleValue(publication, bytes) {
|
|
26
|
+
return withPublicationError(() => bundle.decodeBundleValue(publication, bytes));
|
|
27
|
+
}
|
|
28
|
+
/** @deprecated Use `admitBundleDescriptor` from `@astrale-os/kernel-protocol/release/bundle`. */
|
|
29
|
+
export function admitBundleDescriptor(input) {
|
|
30
|
+
return withPublicationError(() => bundle.admitBundleDescriptor(input));
|
|
31
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Attestation as ReleaseAttestation } from '../../delivery/attestation.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Delivery v1 attestation, the one Delivery v2 carries; use `Attestation` of
|
|
4
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
5
|
+
*/
|
|
6
|
+
export type Attestation = ReleaseAttestation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,11 @@ import type { Revision } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
|
3
3
|
import { type IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
4
4
|
import type { Etag } from '../etag.js';
|
|
5
5
|
import { PURPOSE } from './limits.js';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Delivery v1 claims bind a Publication ETag; use the Delivery v2 `Claims` of
|
|
8
|
+
* `@astrale-os/kernel-protocol/release/delivery` (added with `DomainRelease` v4), which bind a
|
|
9
|
+
* release digest.
|
|
10
|
+
*/
|
|
6
11
|
export interface Claims {
|
|
7
12
|
readonly purpose: typeof PURPOSE;
|
|
8
13
|
readonly iss: IssuerId;
|
|
@@ -13,4 +18,8 @@ export interface Claims {
|
|
|
13
18
|
readonly schemaRevision: Revision;
|
|
14
19
|
readonly exp: number;
|
|
15
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Admits Delivery v1 claims; use `acceptClaims` from
|
|
23
|
+
* `@astrale-os/kernel-protocol/release/delivery` (Delivery v2, added with `DomainRelease` v4).
|
|
24
|
+
*/
|
|
16
25
|
export declare function acceptClaims(input: unknown): Claims;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { AuthValueError } from '@astrale-os/kernel-core/auth/error';
|
|
2
2
|
import { accept as acceptIssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
3
3
|
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
4
|
-
import { fail } from '
|
|
5
|
-
import { NONCE_MAX_LENGTH, NONCE_MIN_LENGTH
|
|
4
|
+
import { fail } from '../../delivery/error.js';
|
|
5
|
+
import { NONCE_MAX_LENGTH, NONCE_MIN_LENGTH } from '../../delivery/limits.js';
|
|
6
|
+
import { PURPOSE } from './limits.js';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Admits Delivery v1 claims; use `acceptClaims` from
|
|
9
|
+
* `@astrale-os/kernel-protocol/release/delivery` (Delivery v2, added with `DomainRelease` v4).
|
|
10
|
+
*/
|
|
6
11
|
export function acceptClaims(input) {
|
|
7
12
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
8
13
|
fail('DELIVERY_CLAIMS_INVALID', 'Expected delivery claims.');
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Attestation } from '../../delivery/attestation.js';
|
|
2
|
+
import type { Publication } from '../publication.js';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Delivery v1 carries a v2/v3 Publication; use the Delivery v2 `Delivery` of
|
|
5
|
+
* `@astrale-os/kernel-protocol/release/delivery` (added with `DomainRelease` v4), which carries a
|
|
6
|
+
* `DomainRelease`.
|
|
7
|
+
*/
|
|
8
|
+
export interface Delivery {
|
|
9
|
+
readonly format: 'astrale.domain.delivery';
|
|
10
|
+
readonly version: 1;
|
|
11
|
+
readonly publication: Publication;
|
|
12
|
+
readonly attestation: Attestation;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Admits Delivery v1; use `accept` from `@astrale-os/kernel-protocol/release/delivery`
|
|
16
|
+
* (Delivery v2, added with `DomainRelease` v4).
|
|
17
|
+
*/
|
|
18
|
+
export declare function accept(input: unknown): Delivery;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import { acceptAttestation } from '../../delivery/attestation.js';
|
|
2
|
+
import { fail } from '../../delivery/error.js';
|
|
1
3
|
import { accept as acceptPublication } from '../publication.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Admits Delivery v1; use `accept` from `@astrale-os/kernel-protocol/release/delivery`
|
|
6
|
+
* (Delivery v2, added with `DomainRelease` v4).
|
|
7
|
+
*/
|
|
4
8
|
export function accept(input) {
|
|
5
9
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
6
10
|
fail('DELIVERY_INVALID', 'Expected a Delivery object.');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DeliveryError as ReleaseDeliveryError, type DeliveryErrorCode as ReleaseDeliveryErrorCode } from '../../delivery/error.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Delivery v1 failure code, the one Delivery v2 reports; use `ErrorCode` of
|
|
4
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
5
|
+
*/
|
|
6
|
+
export type DeliveryErrorCode = ReleaseDeliveryErrorCode;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Delivery v1 failure, the class Delivery v2 reports; use `Error` of
|
|
9
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DeliveryError: typeof ReleaseDeliveryError;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Delivery v1 failure, the class Delivery v2 reports; use `Error` of
|
|
14
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
15
|
+
*/
|
|
16
|
+
export type DeliveryError = ReleaseDeliveryError;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DeliveryError as ReleaseDeliveryError, } from '../../delivery/error.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Delivery v1 failure, the class Delivery v2 reports; use `Error` of
|
|
4
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
5
|
+
*/
|
|
6
|
+
export const DeliveryError = ReleaseDeliveryError;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delivery v1: the challenge-bound envelope carrying the v2/v3 Publication a Kernel fetched at
|
|
3
|
+
* `domain.json`, bound to its ETag. Every v1 export is deprecated and replaced by Delivery v2
|
|
4
|
+
* (`@astrale-os/kernel-protocol/release/delivery`). The attestation, failure, bearer token, and
|
|
5
|
+
* limits are version-neutral: each name here is a deprecated alias of the Delivery v2 one, so
|
|
6
|
+
* `Error` is the very class Delivery v2 reports.
|
|
7
|
+
*/
|
|
8
|
+
export { type Attestation } from './attestation.js';
|
|
9
|
+
export { acceptClaims, type Claims } from './claims.js';
|
|
10
|
+
export { DeliveryError as Error, type DeliveryErrorCode as ErrorCode } from './error.js';
|
|
11
|
+
export { accept, type Delivery } from './delivery.js';
|
|
12
|
+
export { ATTESTATION_MAX_BYTES, NONCE_MAX_LENGTH, NONCE_MIN_LENGTH, PURPOSE } from './limits.js';
|
|
13
|
+
export { acceptRequest, type Request, type Token } from './request.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delivery v1: the challenge-bound envelope carrying the v2/v3 Publication a Kernel fetched at
|
|
3
|
+
* `domain.json`, bound to its ETag. Every v1 export is deprecated and replaced by Delivery v2
|
|
4
|
+
* (`@astrale-os/kernel-protocol/release/delivery`). The attestation, failure, bearer token, and
|
|
5
|
+
* limits are version-neutral: each name here is a deprecated alias of the Delivery v2 one, so
|
|
6
|
+
* `Error` is the very class Delivery v2 reports.
|
|
7
|
+
*/
|
|
8
|
+
export {} from './attestation.js';
|
|
9
|
+
export { acceptClaims } from './claims.js';
|
|
10
|
+
export { DeliveryError as Error } from './error.js';
|
|
11
|
+
export { accept } from './delivery.js';
|
|
12
|
+
export { ATTESTATION_MAX_BYTES, NONCE_MAX_LENGTH, NONCE_MIN_LENGTH, PURPOSE } from './limits.js';
|
|
13
|
+
export { acceptRequest } from './request.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Purpose of Delivery v1 attestations; Delivery v2
|
|
3
|
+
* (`@astrale-os/kernel-protocol/release/delivery`, added with `DomainRelease` v4) has its own
|
|
4
|
+
* purpose.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PURPOSE: 'astrale.domain.delivery.v1';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `NONCE_MIN_LENGTH` of
|
|
9
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const NONCE_MIN_LENGTH = 16;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `NONCE_MAX_LENGTH` of
|
|
14
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NONCE_MAX_LENGTH = 256;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `ATTESTATION_MAX_BYTES` of
|
|
19
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ATTESTATION_MAX_BYTES = 16384;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as release from '../../delivery/limits.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Purpose of Delivery v1 attestations; Delivery v2
|
|
4
|
+
* (`@astrale-os/kernel-protocol/release/delivery`, added with `DomainRelease` v4) has its own
|
|
5
|
+
* purpose.
|
|
6
|
+
*/
|
|
7
|
+
export const PURPOSE = 'astrale.domain.delivery.v1';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `NONCE_MIN_LENGTH` of
|
|
10
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
11
|
+
*/
|
|
12
|
+
export const NONCE_MIN_LENGTH = release.NONCE_MIN_LENGTH;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `NONCE_MAX_LENGTH` of
|
|
15
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
16
|
+
*/
|
|
17
|
+
export const NONCE_MAX_LENGTH = release.NONCE_MAX_LENGTH;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Delivery v1 limit, the one Delivery v2 applies; use `ATTESTATION_MAX_BYTES` of
|
|
20
|
+
* `@astrale-os/kernel-protocol/release/delivery`.
|
|
21
|
+
*/
|
|
22
|
+
export const ATTESTATION_MAX_BYTES = release.ATTESTATION_MAX_BYTES;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
+
import type { Token as ReleaseToken } from '../../delivery/request.js';
|
|
3
|
+
import type { Etag } from '../etag.js';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Delivery v1 request names a Publication ETag; use the Delivery v2 `Request` of
|
|
6
|
+
* `@astrale-os/kernel-protocol/release/delivery` (added with `DomainRelease` v4), which names a
|
|
7
|
+
* release digest.
|
|
8
|
+
*/
|
|
9
|
+
export interface Request {
|
|
10
|
+
readonly version: 1;
|
|
11
|
+
readonly kernel: IssuerId;
|
|
12
|
+
readonly nonce: string;
|
|
13
|
+
readonly etag: Etag;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Bearer credential of a Delivery transport boundary, the one Delivery v2 admits; use
|
|
17
|
+
* `Token` of `@astrale-os/kernel-protocol/release/delivery`.
|
|
18
|
+
*/
|
|
19
|
+
export type Token = ReleaseToken;
|
|
20
|
+
/**
|
|
21
|
+
* Admit the exact request representation accepted by a Delivery transport boundary.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated Admits Delivery v1 requests; use `acceptRequest` from
|
|
24
|
+
* `@astrale-os/kernel-protocol/release/delivery` (Delivery v2, added with `DomainRelease` v4).
|
|
25
|
+
*/
|
|
26
|
+
export declare function acceptRequest(input: unknown): Request;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { AuthValueError } from '@astrale-os/kernel-core/auth/error';
|
|
2
2
|
import { accept as acceptIssuer } from '@astrale-os/kernel-core/auth/issuer';
|
|
3
|
-
import { fail } from '
|
|
4
|
-
import { NONCE_MAX_LENGTH, NONCE_MIN_LENGTH } from '
|
|
5
|
-
/**
|
|
3
|
+
import { fail } from '../../delivery/error.js';
|
|
4
|
+
import { NONCE_MAX_LENGTH, NONCE_MIN_LENGTH } from '../../delivery/limits.js';
|
|
5
|
+
/**
|
|
6
|
+
* Admit the exact request representation accepted by a Delivery transport boundary.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Admits Delivery v1 requests; use `acceptRequest` from
|
|
9
|
+
* `@astrale-os/kernel-protocol/release/delivery` (Delivery v2, added with `DomainRelease` v4).
|
|
10
|
+
*/
|
|
6
11
|
export function acceptRequest(input) {
|
|
7
12
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
8
13
|
fail('DELIVERY_REQUEST_INVALID', 'Expected a Delivery request.');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DeliveryDeclaration } from '../declaration.js';
|
|
2
|
+
import type { Endpoint } from '../delivery-endpoint.js';
|
|
3
|
+
/**
|
|
4
|
+
* Place one provider-neutral Delivery declaration beneath an exact serving issuer.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Use `placeDelivery` from
|
|
7
|
+
* `@astrale-os/kernel-protocol/release/delivery-declaration`, which reports `ReleaseError`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function placeDelivery(input: DeliveryDeclaration, issuer: string, bundleHref: string): Endpoint;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as declaration from '../delivery-declaration.js';
|
|
2
|
+
import { withPublicationError } from './error.js';
|
|
3
|
+
/**
|
|
4
|
+
* Place one provider-neutral Delivery declaration beneath an exact serving issuer.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Use `placeDelivery` from
|
|
7
|
+
* `@astrale-os/kernel-protocol/release/delivery-declaration`, which reports `ReleaseError`.
|
|
8
|
+
*/
|
|
9
|
+
export function placeDelivery(input, issuer, bundleHref) {
|
|
10
|
+
return withPublicationError(() => declaration.placeDelivery(input, issuer, bundleHref));
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `ReleaseErrorCode` from `@astrale-os/kernel-protocol/release`; only the legacy
|
|
3
|
+
* Publication surface reports these codes.
|
|
4
|
+
*/
|
|
5
|
+
export type PublicationErrorCode = 'PUBLICATION_INVALID' | 'PUBLICATION_ETAG_MISMATCH' | 'PUBLICATION_BINDING_INVALID' | 'PUBLICATION_ROUTE_INVALID' | 'PUBLICATION_VIEW_INVALID';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `ReleaseError` from `@astrale-os/kernel-protocol/release`; only the legacy
|
|
8
|
+
* Publication surface throws it.
|
|
9
|
+
*/
|
|
10
|
+
export declare class PublicationError extends Error {
|
|
11
|
+
readonly code: PublicationErrorCode;
|
|
12
|
+
readonly name = "PublicationError";
|
|
13
|
+
constructor(code: PublicationErrorCode, message: string, options?: ErrorOptions);
|
|
14
|
+
}
|
|
15
|
+
/** Report a failure of a check only Publication v2/v3 performs. */
|
|
16
|
+
export declare function fail(code: PublicationErrorCode, message: string, cause?: unknown): never;
|
|
17
|
+
export declare function record(input: unknown, code: PublicationErrorCode, message: string): Record<string, unknown>;
|
|
18
|
+
export declare function exact(value: Record<string, unknown>, allowed: readonly string[], code: PublicationErrorCode): void;
|
|
19
|
+
export declare function array(input: unknown, code: PublicationErrorCode): readonly unknown[];
|
|
20
|
+
export declare function unique(values: readonly string[], code: PublicationErrorCode, label: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Run release validation and report its failure as the legacy surface always has:
|
|
23
|
+
* `PublicationError` with the corresponding `PUBLICATION_*` code, the historical message, and a
|
|
24
|
+
* translated cause chain. A `PublicationError` or any other failure passes through unchanged.
|
|
25
|
+
*/
|
|
26
|
+
export declare function withPublicationError<Result>(operation: () => Result): Result;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { ReleaseError } from '../error.js';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `ReleaseError` from `@astrale-os/kernel-protocol/release`; only the legacy
|
|
4
|
+
* Publication surface throws it.
|
|
5
|
+
*/
|
|
6
|
+
export class PublicationError extends Error {
|
|
7
|
+
code;
|
|
8
|
+
name = 'PublicationError';
|
|
9
|
+
constructor(code, message, options) {
|
|
10
|
+
super(message, options);
|
|
11
|
+
this.code = code;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/** Report a failure of a check only Publication v2/v3 performs. */
|
|
15
|
+
export function fail(code, message, cause) {
|
|
16
|
+
throw new PublicationError(code, message, cause === undefined ? undefined : { cause });
|
|
17
|
+
}
|
|
18
|
+
/*
|
|
19
|
+
* Structural checks only Publication v2/v3 performs, reported as `PublicationError` directly. They
|
|
20
|
+
* are frozen copies of the release checks in `../shape.ts` and leave with this folder.
|
|
21
|
+
*/
|
|
22
|
+
export function record(input, code, message) {
|
|
23
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input))
|
|
24
|
+
fail(code, message);
|
|
25
|
+
return input;
|
|
26
|
+
}
|
|
27
|
+
export function exact(value, allowed, code) {
|
|
28
|
+
const admitted = new Set(allowed);
|
|
29
|
+
if (Object.keys(value).some((key) => !admitted.has(key))) {
|
|
30
|
+
fail(code, 'Object contains unknown fields.');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function array(input, code) {
|
|
34
|
+
if (!Array.isArray(input))
|
|
35
|
+
fail(code, 'Expected an array.');
|
|
36
|
+
return input;
|
|
37
|
+
}
|
|
38
|
+
export function unique(values, code, label) {
|
|
39
|
+
if (new Set(values).size !== values.length)
|
|
40
|
+
fail(code, `Duplicate ${label}.`);
|
|
41
|
+
}
|
|
42
|
+
const CODES = Object.freeze({
|
|
43
|
+
RELEASE_INVALID: 'PUBLICATION_INVALID',
|
|
44
|
+
RELEASE_DIGEST_MISMATCH: 'PUBLICATION_ETAG_MISMATCH',
|
|
45
|
+
RELEASE_BINDING_INVALID: 'PUBLICATION_BINDING_INVALID',
|
|
46
|
+
RELEASE_ROUTE_INVALID: 'PUBLICATION_ROUTE_INVALID',
|
|
47
|
+
RELEASE_VIEW_INVALID: 'PUBLICATION_VIEW_INVALID',
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Frozen text the legacy surface reported for each release validator message that names the served
|
|
51
|
+
* document. Every other release message is reported unchanged.
|
|
52
|
+
*/
|
|
53
|
+
const MESSAGES = new Map([
|
|
54
|
+
['Release schema is invalid.', 'Published schema is invalid.'],
|
|
55
|
+
['Release schema revision is invalid.', 'Published schema revision is invalid.'],
|
|
56
|
+
['Release HTTP route is invalid.', 'Published HTTP route is invalid.'],
|
|
57
|
+
['Release View binding is invalid.', 'Published View binding is invalid.'],
|
|
58
|
+
['Release issuer is invalid.', 'Publication issuer is invalid.'],
|
|
59
|
+
['Release issuer is not an HTTP(S) URL.', 'Publication issuer is not an HTTP(S) URL.'],
|
|
60
|
+
['Release bundle is invalid.', 'Publication bundle is invalid.'],
|
|
61
|
+
['Release requirements are invalid.', 'Publication requirements are invalid.'],
|
|
62
|
+
[
|
|
63
|
+
'Release capability requirements are invalid.',
|
|
64
|
+
'Publication capability requirements are invalid.',
|
|
65
|
+
],
|
|
66
|
+
['Release bundle omits an exact dependency.', 'Publication Bundle omits an exact dependency.'],
|
|
67
|
+
[
|
|
68
|
+
'Bundle root does not match the release schema.',
|
|
69
|
+
'Bundle root does not match the Publication schema.',
|
|
70
|
+
],
|
|
71
|
+
['Release origin is invalid.', 'Publication origin is invalid.'],
|
|
72
|
+
['Release identity is invalid.', 'Publication identity is invalid.'],
|
|
73
|
+
[
|
|
74
|
+
'Release identity subject must equal its root origin.',
|
|
75
|
+
'Publication identity subject must equal its root origin.',
|
|
76
|
+
],
|
|
77
|
+
['Release bindings are invalid.', 'Publication bindings are invalid.'],
|
|
78
|
+
]);
|
|
79
|
+
/**
|
|
80
|
+
* Run release validation and report its failure as the legacy surface always has:
|
|
81
|
+
* `PublicationError` with the corresponding `PUBLICATION_*` code, the historical message, and a
|
|
82
|
+
* translated cause chain. A `PublicationError` or any other failure passes through unchanged.
|
|
83
|
+
*/
|
|
84
|
+
export function withPublicationError(operation) {
|
|
85
|
+
try {
|
|
86
|
+
return operation();
|
|
87
|
+
}
|
|
88
|
+
catch (cause) {
|
|
89
|
+
if (cause instanceof ReleaseError)
|
|
90
|
+
throw publicationError(cause);
|
|
91
|
+
throw cause;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function publicationError(error) {
|
|
95
|
+
const cause = error.cause instanceof ReleaseError ? publicationError(error.cause) : error.cause;
|
|
96
|
+
const translated = new PublicationError(CODES[error.code], MESSAGES.get(error.message) ?? error.message, cause === undefined ? undefined : { cause });
|
|
97
|
+
const stack = validatorStack(error, translated);
|
|
98
|
+
if (stack !== undefined)
|
|
99
|
+
translated.stack = stack;
|
|
100
|
+
return translated;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Keep the frames of the release check that failed, under the translated header, so the legacy
|
|
104
|
+
* failure still points at the validator rather than at this translation.
|
|
105
|
+
*/
|
|
106
|
+
function validatorStack(error, translated) {
|
|
107
|
+
const stack = error.stack;
|
|
108
|
+
if (stack === undefined)
|
|
109
|
+
return undefined;
|
|
110
|
+
const header = `${error.name}: ${error.message}`;
|
|
111
|
+
return stack.startsWith(header)
|
|
112
|
+
? `${translated.name}: ${translated.message}${stack.slice(header.length)}`
|
|
113
|
+
: stack;
|
|
114
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Sha256Digest } from '../digest.js';
|
|
2
|
+
import type { EtagContent } from './publication.js';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Digest of one v2/v3 Publication; use `ReleaseDigest` from
|
|
5
|
+
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
6
|
+
*/
|
|
7
|
+
export type Etag = Sha256Digest;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Computes a v2/v3 Publication ETag; use the release `digestOf` from
|
|
10
|
+
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
11
|
+
*/
|
|
12
|
+
export declare function computeEtag(input: EtagContent): Etag;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { sha256Hex } from '../digest.js';
|
|
3
|
+
import { encodeLegacyRequirements } from './profiles.js';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Computes a v2/v3 Publication ETag; use the release `digestOf` from
|
|
6
|
+
* `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
|
|
7
|
+
*/
|
|
8
|
+
export function computeEtag(input) {
|
|
9
|
+
const wire = input.version === 2
|
|
10
|
+
? { ...input, requirements: encodeLegacyRequirements(input.requirements) }
|
|
11
|
+
: input;
|
|
12
|
+
const bytes = portable.json.encode(wire);
|
|
13
|
+
return `sha256:${sha256Hex(bytes)}`;
|
|
14
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publication v2/v3 and Delivery v1 compatibility surface. Shared validators report failures as
|
|
3
|
+
* `PublicationError`, preserving historical codes, messages and cause chains.
|
|
4
|
+
*
|
|
5
|
+
* @deprecated Use `@astrale-os/kernel-protocol/release`, the version-neutral contracts to which
|
|
6
|
+
* `DomainRelease` v4 (`release.json`), `ReleaseRef` and Delivery v2 are added.
|
|
7
|
+
*
|
|
8
|
+
* Historical Publication subpaths resolve here. Persisted Runtime artifacts and installation
|
|
9
|
+
* fingerprints depend on the v2 `profiles` encoding.
|
|
10
|
+
*
|
|
11
|
+
* Short-term consumers:
|
|
12
|
+
* - the `./publication*` subpaths and the root `publication` namespace: the SDK, which seals,
|
|
13
|
+
* serves and admits v3 through them until it adopts the release names, and the CLI, Admin and
|
|
14
|
+
* the Issues Domain tests through `@astrale-os/sdk/publication`;
|
|
15
|
+
* - this folder: the astrale Host's existing v3 installations until their Domains are republished
|
|
16
|
+
* as releases, and the 1Pact path, where the client in GUI and Admin reads v3 documents for the
|
|
17
|
+
* Kernel .117 Host, whose instances pin the shell-v2 and services-v2 deployments.
|
|
18
|
+
*
|
|
19
|
+
* Removal, each in a separate breaking release: the subpaths and the namespace once no repository
|
|
20
|
+
* imports them; this folder once no supported Kernel predates v4, no installation pins a v2/v3
|
|
21
|
+
* document, no stable Worker serves one, and the Runtime artifact codec and the installation target
|
|
22
|
+
* digest own a frozen copy of the v2 `profiles` encoding. With the folder go the
|
|
23
|
+
* `withPublicationError` call sites outside it (`protocol/routes/compiler.ts`,
|
|
24
|
+
* `protocol/schema/installation/introspection/codec.ts`; `protocol/routes/legacy/table.ts` goes
|
|
25
|
+
* with `protocol/routes/legacy/`), whose callers then report `ReleaseError`, once
|
|
26
|
+
* `protocol/invocation`, `protocol/routes` and `protocol/schema/installation/introspection` no
|
|
27
|
+
* longer import this folder (`protocol/invocation/legacy/` and `protocol/routes/legacy/` go under
|
|
28
|
+
* their own headers), and the version-1 branch of the Delivery v2 `acceptRequest`, which then
|
|
29
|
+
* returns only its own `Request`.
|
|
30
|
+
*
|
|
31
|
+
* The frozen v3 projection of a `DomainRelease` (`projection.ts`, served at `domain.json` by v4
|
|
32
|
+
* deployments) and its golden vectors have their own, later deletion condition: no pre-v4 Kernel
|
|
33
|
+
* remains, 1Pact `install-domains.mjs` is gone, and the CLI and Admin read `release.json`.
|
|
34
|
+
*/
|
|
35
|
+
import type * as deliveryEndpoint from '../delivery-endpoint.js';
|
|
36
|
+
import type * as digest from '../digest.js';
|
|
37
|
+
import type * as manifest from '../manifest.js';
|
|
38
|
+
import type * as route from '../route.js';
|
|
39
|
+
export { MEDIA_TYPE, LEGACY_MEDIA_TYPE, mediaType, PATH, url, seal, accept, encode, type Content, type Publication, } from './publication.js';
|
|
40
|
+
export { publication } from './projection.js';
|
|
41
|
+
export { acceptBundle, decodeBundle } from './bundle-admission.js';
|
|
42
|
+
export { BUNDLE_MEDIA_TYPE, bundleUrl, describeBundle, type BundleDescriptor } from './bundle.js';
|
|
43
|
+
export { verifyBundleBytes } from './bundle-evidence.js';
|
|
44
|
+
export { placeDelivery } from './delivery-declaration.js';
|
|
45
|
+
/** @deprecated Use `Sha256Digest` from `@astrale-os/kernel-protocol/release`. */
|
|
46
|
+
export type Sha256Digest = digest.Sha256Digest;
|
|
47
|
+
export type { Etag } from './etag.js';
|
|
48
|
+
export { PublicationError, type PublicationErrorCode } from './error.js';
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Delivery v1; use Delivery v2 (`@astrale-os/kernel-protocol/release/delivery`, added
|
|
51
|
+
* with `DomainRelease` v4).
|
|
52
|
+
*/
|
|
53
|
+
export * as delivery from './delivery/index.js';
|
|
54
|
+
/** @deprecated Use `DeliveryEndpoint` from `@astrale-os/kernel-protocol/release`. */
|
|
55
|
+
export type DeliveryEndpoint = deliveryEndpoint.Endpoint;
|
|
56
|
+
/** @deprecated Use `Manifest` from `@astrale-os/kernel-protocol/release`. */
|
|
57
|
+
export type Manifest = manifest.Manifest;
|
|
58
|
+
export { admitRequirements, validateRequirements, type CapabilityAuthorityRequirements, type CoreCapabilityRequirement, type CapabilityRequirements, type ClassCapabilityRequirement, type ClassOperation, type NonEmpty, type PublicationRequirements, } from './requirements.js';
|
|
59
|
+
export { acceptReference, compareReference, compareReferences, matchesReference, reference, type PublicationRef, type PublicationReferenceRelation, } from './reference.js';
|
|
60
|
+
/** @deprecated Use `HttpRoute` from `@astrale-os/kernel-protocol/release`. */
|
|
61
|
+
export type HttpRoute = route.HttpRoute;
|
|
62
|
+
/** @deprecated Use `HttpRouteDeclaration` from `@astrale-os/kernel-protocol/release`. */
|
|
63
|
+
export type HttpRouteDeclaration = route.HttpRouteDeclaration;
|
|
64
|
+
/** @deprecated Use `HttpMethod` from `@astrale-os/kernel-protocol/release`. */
|
|
65
|
+
export type HttpMethod = route.HttpMethod;
|
|
66
|
+
/** @deprecated Use `RouteBody` from `@astrale-os/kernel-protocol/release`. */
|
|
67
|
+
export type RouteBody = route.RouteBody;
|
|
68
|
+
/** @deprecated Use `RouteHeaders` from `@astrale-os/kernel-protocol/release`. */
|
|
69
|
+
export type RouteHeaders = route.RouteHeaders;
|
|
70
|
+
/** @deprecated Use `CredentialSource` from `@astrale-os/kernel-protocol/release`. */
|
|
71
|
+
export type CredentialSource = route.CredentialSource;
|
|
72
|
+
export { acceptInvocationEndpoints, type CallableBinding, type InvocationEndpoints, type ViewBinding, } from './bindings.js';
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export { MEDIA_TYPE, LEGACY_MEDIA_TYPE, mediaType, PATH, url, seal, accept, encode, } from './publication.js';
|
|
2
|
+
export { publication } from './projection.js';
|
|
2
3
|
export { acceptBundle, decodeBundle } from './bundle-admission.js';
|
|
3
4
|
export { BUNDLE_MEDIA_TYPE, bundleUrl, describeBundle } from './bundle.js';
|
|
4
5
|
export { verifyBundleBytes } from './bundle-evidence.js';
|
|
5
6
|
export { placeDelivery } from './delivery-declaration.js';
|
|
6
7
|
export { PublicationError } from './error.js';
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Delivery v1; use Delivery v2 (`@astrale-os/kernel-protocol/release/delivery`, added
|
|
10
|
+
* with `DomainRelease` v4).
|
|
11
|
+
*/
|
|
7
12
|
export * as delivery from './delivery/index.js';
|
|
8
|
-
export {
|
|
13
|
+
export { admitRequirements, validateRequirements, } from './requirements.js';
|
|
9
14
|
export { acceptReference, compareReference, compareReferences, matchesReference, reference, } from './reference.js';
|
|
10
|
-
export { acceptInvocationEndpoints, } from './bindings
|
|
15
|
+
export { acceptInvocationEndpoints, } from './bindings.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Requirements } from '../requirements.js';
|
|
2
|
+
/**
|
|
3
|
+
* Read the retired v2 wire coordinate without exposing it in canonical requirements.
|
|
4
|
+
*
|
|
5
|
+
* @deprecated Only Publication v2 and Runtime artifact v2 carry `profiles`; use `admitRequirements`
|
|
6
|
+
* from `@astrale-os/kernel-protocol/release`, whose canonical requirements carry `core`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function decodeLegacyRequirements(input: unknown): Requirements;
|
|
9
|
+
/**
|
|
10
|
+
* Preserve immutable v2 bytes and the historical installation-target digest vocabulary.
|
|
11
|
+
*
|
|
12
|
+
* @deprecated Only Publication v2 and Runtime artifact v2 carry `profiles`; use the canonical
|
|
13
|
+
* `Requirements` from `@astrale-os/kernel-protocol/release`, which carry `core` and are encoded as
|
|
14
|
+
* they are.
|
|
15
|
+
*/
|
|
16
|
+
export declare function encodeLegacyRequirements(input: Requirements): Readonly<{
|
|
17
|
+
capabilities: Readonly<{
|
|
18
|
+
functions?: import("../requirements.js").NonEmpty<import("@astrale-os/kernel-dsl/v1").Key.Callable>;
|
|
19
|
+
classes?: import("../requirements.js").NonEmpty<import("../requirements.js").ClassCapabilityRequirement>;
|
|
20
|
+
authority?: import("../requirements.js").CapabilityAuthorityRequirements;
|
|
21
|
+
profiles?: import("../requirements.js").NonEmpty<import("../requirements.js").CoreCapabilityRequirement> | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { admitRequirements } from '../requirements.js';
|
|
2
|
+
import { exact, record, withPublicationError } from './error.js';
|
|
3
|
+
/**
|
|
4
|
+
* Read the retired v2 wire coordinate without exposing it in canonical requirements.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Only Publication v2 and Runtime artifact v2 carry `profiles`; use `admitRequirements`
|
|
7
|
+
* from `@astrale-os/kernel-protocol/release`, whose canonical requirements carry `core`.
|
|
8
|
+
*/
|
|
9
|
+
export function decodeLegacyRequirements(input) {
|
|
10
|
+
return withPublicationError(() => {
|
|
11
|
+
const requirements = record(input, 'PUBLICATION_INVALID', 'Publication requirements are invalid.');
|
|
12
|
+
exact(requirements, ['capabilities'], 'PUBLICATION_INVALID');
|
|
13
|
+
const capabilities = record(requirements.capabilities, 'PUBLICATION_INVALID', 'Publication capability requirements are invalid.');
|
|
14
|
+
exact(capabilities, ['authority', 'classes', 'functions', 'profiles'], 'PUBLICATION_INVALID');
|
|
15
|
+
const { profiles, ...principal } = capabilities;
|
|
16
|
+
return admitRequirements({
|
|
17
|
+
capabilities: { ...principal, ...(profiles === undefined ? {} : { core: profiles }) },
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Preserve immutable v2 bytes and the historical installation-target digest vocabulary.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Only Publication v2 and Runtime artifact v2 carry `profiles`; use the canonical
|
|
25
|
+
* `Requirements` from `@astrale-os/kernel-protocol/release`, which carry `core` and are encoded as
|
|
26
|
+
* they are.
|
|
27
|
+
*/
|
|
28
|
+
export function encodeLegacyRequirements(input) {
|
|
29
|
+
const { core, ...principal } = input.capabilities;
|
|
30
|
+
return Object.freeze({
|
|
31
|
+
capabilities: Object.freeze({
|
|
32
|
+
...principal,
|
|
33
|
+
...(core === undefined ? {} : { profiles: core }),
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DomainRelease } from '../release.js';
|
|
2
|
+
import type { Publication } from './publication.js';
|
|
3
|
+
/**
|
|
4
|
+
* The v3 Publication a v4 deployment serves at `domain.json`, for the Kernels, Workers and tools
|
|
5
|
+
* that predate `DomainRelease` v4: the release's served content sealed as Publication v3. It drops
|
|
6
|
+
* `format`, `version`, `digest` and `build`, so its ETag covers what a v3 ETag always covered and
|
|
7
|
+
* never the code. Frozen forever: every party that projects a release (Kernel, Worker, tooling at
|
|
8
|
+
* any package version) must compute the same bytes, which the golden vectors pin.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Serves pre-v4 readers only; a v4 reader fetches the `DomainRelease` at `release.json`.
|
|
11
|
+
* Deleted with the projection row of `legacy/index.ts`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function publication(release: DomainRelease): Publication;
|