@astrale-os/kernel-protocol 0.5.0-beta.70 → 0.5.0-beta.72

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 (115) hide show
  1. package/dist/index.d.ts +0 -2
  2. package/dist/index.js +0 -2
  3. package/dist/invocation/binding-codecs.d.ts +3 -2
  4. package/dist/invocation/delegate.d.ts +0 -11
  5. package/dist/invocation/delegate.js +2 -20
  6. package/dist/invocation/http/index.d.ts +1 -1
  7. package/dist/invocation/http/index.js +1 -1
  8. package/dist/invocation/http/request.d.ts +2 -0
  9. package/dist/invocation/http/request.js +8 -0
  10. package/dist/invocation/index.d.ts +0 -3
  11. package/dist/invocation/index.js +0 -2
  12. package/dist/invocation/redirect.d.ts +3 -8
  13. package/dist/invocation/redirect.js +4 -4
  14. package/dist/invocation/routing.d.ts +8 -12
  15. package/dist/invocation/routing.js +7 -22
  16. package/dist/invocation/stale-route.d.ts +3 -3
  17. package/dist/release/bindings/index.d.ts +1 -1
  18. package/dist/release/bindings/view.d.ts +0 -5
  19. package/dist/release/bindings/view.js +2 -96
  20. package/dist/release/bundle-admission.js +0 -6
  21. package/dist/release/delivery/index.d.ts +1 -2
  22. package/dist/release/delivery/index.js +1 -2
  23. package/dist/release/delivery/request.d.ts +2 -7
  24. package/dist/release/delivery/request.js +1 -10
  25. package/dist/release/index.d.ts +1 -5
  26. package/dist/release/index.js +0 -4
  27. package/dist/release/manifest.d.ts +2 -2
  28. package/dist/release/manifest.js +12 -20
  29. package/dist/release/release.js +2 -0
  30. package/dist/release/requirements.d.ts +1 -1
  31. package/dist/release/requirements.js +1 -1
  32. package/dist/release/served.d.ts +2 -1
  33. package/dist/release/served.js +1 -10
  34. package/dist/routes/compiler.js +1 -2
  35. package/dist/routes/credential.d.ts +0 -1
  36. package/dist/routes/credential.js +0 -3
  37. package/dist/routes/index.d.ts +0 -3
  38. package/dist/routes/index.js +0 -3
  39. package/dist/routes/request.d.ts +2 -2
  40. package/dist/routes/reservation.d.ts +2 -2
  41. package/dist/routes/reservation.js +8 -9
  42. package/dist/routes/routing.d.ts +4 -16
  43. package/dist/routes/routing.js +5 -11
  44. package/dist/routes/template.d.ts +0 -1
  45. package/dist/routes/template.js +0 -3
  46. package/dist/runtime/artifact.d.ts +2 -3
  47. package/dist/runtime/artifact.js +7 -17
  48. package/dist/runtime/index.d.ts +1 -1
  49. package/dist/runtime/index.js +1 -1
  50. package/dist/schema/installation/codec.d.ts +1 -6
  51. package/dist/schema/installation/codec.js +2 -6
  52. package/dist/schema/installation/introspection/codec.d.ts +2 -11
  53. package/dist/schema/installation/introspection/codec.js +20 -38
  54. package/dist/schema/installation/introspection/result.d.ts +9 -36
  55. package/package.json +4 -88
  56. package/dist/invocation/legacy/index.d.ts +0 -29
  57. package/dist/invocation/legacy/index.js +0 -28
  58. package/dist/invocation/legacy/route.d.ts +0 -14
  59. package/dist/invocation/legacy/route.js +0 -25
  60. package/dist/invocation/legacy/via.d.ts +0 -30
  61. package/dist/invocation/legacy/via.js +0 -15
  62. package/dist/release/legacy/bindings.d.ts +0 -14
  63. package/dist/release/legacy/bindings.js +0 -11
  64. package/dist/release/legacy/bundle-admission.d.ts +0 -6
  65. package/dist/release/legacy/bundle-admission.js +0 -10
  66. package/dist/release/legacy/bundle-evidence.d.ts +0 -8
  67. package/dist/release/legacy/bundle-evidence.js +0 -11
  68. package/dist/release/legacy/bundle.d.ts +0 -24
  69. package/dist/release/legacy/bundle.js +0 -31
  70. package/dist/release/legacy/delivery/attestation.d.ts +0 -6
  71. package/dist/release/legacy/delivery/attestation.js +0 -1
  72. package/dist/release/legacy/delivery/claims.d.ts +0 -25
  73. package/dist/release/legacy/delivery/claims.js +0 -66
  74. package/dist/release/legacy/delivery/delivery.d.ts +0 -18
  75. package/dist/release/legacy/delivery/delivery.js +0 -33
  76. package/dist/release/legacy/delivery/error.d.ts +0 -16
  77. package/dist/release/legacy/delivery/error.js +0 -6
  78. package/dist/release/legacy/delivery/index.d.ts +0 -13
  79. package/dist/release/legacy/delivery/index.js +0 -13
  80. package/dist/release/legacy/delivery/limits.d.ts +0 -21
  81. package/dist/release/legacy/delivery/limits.js +0 -22
  82. package/dist/release/legacy/delivery/request.d.ts +0 -26
  83. package/dist/release/legacy/delivery/request.js +0 -57
  84. package/dist/release/legacy/delivery-declaration.d.ts +0 -9
  85. package/dist/release/legacy/delivery-declaration.js +0 -11
  86. package/dist/release/legacy/error.d.ts +0 -26
  87. package/dist/release/legacy/error.js +0 -114
  88. package/dist/release/legacy/etag.d.ts +0 -12
  89. package/dist/release/legacy/etag.js +0 -14
  90. package/dist/release/legacy/index.d.ts +0 -75
  91. package/dist/release/legacy/index.js +0 -15
  92. package/dist/release/legacy/profiles.d.ts +0 -23
  93. package/dist/release/legacy/profiles.js +0 -36
  94. package/dist/release/legacy/projection.d.ts +0 -13
  95. package/dist/release/legacy/projection.js +0 -25
  96. package/dist/release/legacy/publication.d.ts +0 -90
  97. package/dist/release/legacy/publication.js +0 -124
  98. package/dist/release/legacy/reference.d.ts +0 -47
  99. package/dist/release/legacy/reference.js +0 -92
  100. package/dist/release/legacy/requirements.d.ts +0 -30
  101. package/dist/release/legacy/requirements.js +0 -20
  102. package/dist/routes/legacy/index.d.ts +0 -29
  103. package/dist/routes/legacy/index.js +0 -29
  104. package/dist/routes/legacy/routing.d.ts +0 -24
  105. package/dist/routes/legacy/routing.js +0 -45
  106. package/dist/routes/legacy/table.d.ts +0 -34
  107. package/dist/routes/legacy/table.js +0 -50
  108. package/dist/schema/installation/legacy/index.d.ts +0 -39
  109. package/dist/schema/installation/legacy/index.js +0 -39
  110. package/dist/schema/installation/legacy/installation.d.ts +0 -9
  111. package/dist/schema/installation/legacy/installation.js +0 -28
  112. package/dist/schema/installation/legacy/introspection.d.ts +0 -10
  113. package/dist/schema/installation/legacy/introspection.js +0 -70
  114. package/dist/schema/installation/legacy/msgpack.d.ts +0 -1
  115. package/dist/schema/installation/legacy/msgpack.js +0 -143
package/dist/index.d.ts CHANGED
@@ -2,8 +2,6 @@ export * as artifact from './artifact/index.js';
2
2
  export * as invocation from './invocation/index.js';
3
3
  export * as codecs from './codecs/index.js';
4
4
  export * as errors from './errors/index.js';
5
- /** @deprecated Use `release`; Publication v2/v3 remains available under `release.legacy`. */
6
- export * as publication from './release/legacy/index.js';
7
5
  export * as release from './release/index.js';
8
6
  export * as schema from './schema/index.js';
9
7
  export * as routes from './routes/index.js';
package/dist/index.js CHANGED
@@ -2,8 +2,6 @@ export * as artifact from './artifact/index.js';
2
2
  export * as invocation from './invocation/index.js';
3
3
  export * as codecs from './codecs/index.js';
4
4
  export * as errors from './errors/index.js';
5
- /** @deprecated Use `release`; Publication v2/v3 remains available under `release.legacy`. */
6
- export * as publication from './release/legacy/index.js';
7
5
  export * as release from './release/index.js';
8
6
  export * as schema from './schema/index.js';
9
7
  export * as routes from './routes/index.js';
@@ -1,8 +1,9 @@
1
1
  import type { Codec } from '../codecs/codec.js';
2
- export type CodecProfile = 'json';
3
- export interface SupportedCodec {
2
+ type CodecProfile = 'json';
3
+ interface SupportedCodec {
4
4
  readonly codec: Codec;
5
5
  readonly profile: CodecProfile;
6
6
  }
7
7
  export declare function codecProfile(codec: Codec): CodecProfile | undefined;
8
8
  export declare function admitSupportedCodecs(supported: readonly Codec[]): readonly SupportedCodec[];
9
+ export {};
@@ -1,15 +1,4 @@
1
- export declare namespace Delegate {
2
- /** One wire leaf; Identity set algebra is not supported. */
3
- type Expr = {
4
- readonly kind: 'identity';
5
- readonly self: true;
6
- } | {
7
- readonly kind: 'identity';
8
- readonly credential: string;
9
- };
10
- }
11
1
  export interface Delegate {
12
2
  readonly ttlSeconds: number;
13
- readonly attenuation?: Delegate.Expr;
14
3
  }
15
4
  export declare function acceptDelegate(input: unknown): Delegate;
@@ -1,6 +1,5 @@
1
- import { AuthValueError, grant } from '@astrale-os/kernel-core/auth';
2
1
  import { exactDataObject, exactFields, invalid, required } from './admission.js';
3
- const FIELDS = new Set(['ttlSeconds', 'attenuation']);
2
+ const FIELDS = new Set(['ttlSeconds']);
4
3
  export function acceptDelegate(input) {
5
4
  const object = exactDataObject(input, 'delegate');
6
5
  exactFields(object, FIELDS, 'delegate');
@@ -8,22 +7,5 @@ export function acceptDelegate(input) {
8
7
  if (!Number.isSafeInteger(object.ttlSeconds) || object.ttlSeconds < 1) {
9
8
  invalid('delegate.ttlSeconds must be a positive safe integer');
10
9
  }
11
- // Omission and `self` both carry the authenticated caller unchanged; nothing else is admitted.
12
- let attenuation;
13
- if (object.attenuation !== undefined) {
14
- try {
15
- attenuation = grant.acceptUnresolved({ v: 1, expr: object.attenuation }).expr;
16
- }
17
- catch (cause) {
18
- if (cause instanceof AuthValueError)
19
- invalid('delegate.attenuation must be self');
20
- throw cause;
21
- }
22
- if (!('self' in attenuation))
23
- invalid('delegate.attenuation must be self');
24
- }
25
- return Object.freeze({
26
- ttlSeconds: object.ttlSeconds,
27
- ...(attenuation === undefined ? {} : { attenuation: attenuation }),
28
- });
10
+ return Object.freeze({ ttlSeconds: object.ttlSeconds });
29
11
  }
@@ -1,5 +1,5 @@
1
1
  export { BINARY_DELIVERY_FIELD, BINARY_HEADERS_FIELD, decodeBinaryHeaderNames, decodeInvocationId, encodeBinaryHeaderNames, encodeInvocationId, isApplicationBinaryHeader, MAXIMUM_INVOCATION_FIELD_BYTES, INVOCATION_FIELD, REQUEST_ID_FIELD, STREAMING_BINARY_DELIVERY, } from './binary.js';
2
2
  export { codecForContentType, negotiateResponseCodec } from './negotiation.js';
3
- export { BINARY_LENGTH_FIELD, BINARY_REQUEST_CONTENT_TYPE, decodeBinaryRequestEnvelope, encodeBinaryRequestEnvelope, MAXIMUM_REQUEST_ENVELOPE_BYTES, REQUEST_ENVELOPE_FIELD, } from './request.js';
3
+ export { BINARY_LENGTH_FIELD, BINARY_REQUEST_CONTENT_TYPE, decodeBinaryLength, decodeBinaryRequestEnvelope, encodeBinaryRequestEnvelope, MAXIMUM_REQUEST_ENVELOPE_BYTES, REQUEST_ENVELOPE_FIELD, } from './request.js';
4
4
  export { encodeStreamFrame, LENGTH_PREFIX_V1, STREAM_FRAMING_FIELD } from './stream.js';
5
5
  export { BAGGAGE_FIELD, decodeTraceHeaders, encodeTraceHeaders, TRACEPARENT_FIELD, TRACESTATE_FIELD, } from './trace.js';
@@ -1,5 +1,5 @@
1
1
  export { BINARY_DELIVERY_FIELD, BINARY_HEADERS_FIELD, decodeBinaryHeaderNames, decodeInvocationId, encodeBinaryHeaderNames, encodeInvocationId, isApplicationBinaryHeader, MAXIMUM_INVOCATION_FIELD_BYTES, INVOCATION_FIELD, REQUEST_ID_FIELD, STREAMING_BINARY_DELIVERY, } from './binary.js';
2
2
  export { codecForContentType, negotiateResponseCodec } from './negotiation.js';
3
- export { BINARY_LENGTH_FIELD, BINARY_REQUEST_CONTENT_TYPE, decodeBinaryRequestEnvelope, encodeBinaryRequestEnvelope, MAXIMUM_REQUEST_ENVELOPE_BYTES, REQUEST_ENVELOPE_FIELD, } from './request.js';
3
+ export { BINARY_LENGTH_FIELD, BINARY_REQUEST_CONTENT_TYPE, decodeBinaryLength, decodeBinaryRequestEnvelope, encodeBinaryRequestEnvelope, MAXIMUM_REQUEST_ENVELOPE_BYTES, REQUEST_ENVELOPE_FIELD, } from './request.js';
4
4
  export { encodeStreamFrame, LENGTH_PREFIX_V1, STREAM_FRAMING_FIELD } from './stream.js';
5
5
  export { BAGGAGE_FIELD, decodeTraceHeaders, encodeTraceHeaders, TRACEPARENT_FIELD, TRACESTATE_FIELD, } from './trace.js';
@@ -3,6 +3,8 @@ export declare const REQUEST_ENVELOPE_FIELD: 'x-astrale-request';
3
3
  export declare const BINARY_LENGTH_FIELD: 'x-astrale-binary-length';
4
4
  export declare const BINARY_REQUEST_CONTENT_TYPE: 'application/octet-stream';
5
5
  export declare const MAXIMUM_REQUEST_ENVELOPE_BYTES = 8192;
6
+ /** Decode one declared byte count: a canonical unsigned decimal within the safe integer range. */
7
+ export declare function decodeBinaryLength(input: string): number | undefined;
6
8
  /** Encode one canonical V2 Request into the binary-request HTTP field. */
7
9
  export declare function encodeBinaryRequestEnvelope(input: Request): string;
8
10
  /** Decode one bounded base64url JSON V2 Request from the binary-request HTTP field. */
@@ -7,6 +7,14 @@ export const BINARY_REQUEST_CONTENT_TYPE = 'application/octet-stream';
7
7
  export const MAXIMUM_REQUEST_ENVELOPE_BYTES = 8_192;
8
8
  const BASE64URL = /^[A-Za-z0-9_-]+$/u;
9
9
  const MAXIMUM_ENCODED_BYTES = Math.ceil(MAXIMUM_REQUEST_ENVELOPE_BYTES / 3) * 4;
10
+ const DECIMAL = /^(?:0|[1-9][0-9]*)$/u;
11
+ /** Decode one declared byte count: a canonical unsigned decimal within the safe integer range. */
12
+ export function decodeBinaryLength(input) {
13
+ if (!DECIMAL.test(input))
14
+ return undefined;
15
+ const length = Number(input);
16
+ return Number.isSafeInteger(length) ? length : undefined;
17
+ }
10
18
  /** Encode one canonical V2 Request into the binary-request HTTP field. */
11
19
  export function encodeBinaryRequestEnvelope(input) {
12
20
  const request = decodeRequest(input);
@@ -5,9 +5,6 @@ export { acceptIdempotencyKey, HTTP_IDEMPOTENCY_KEY, MAXIMUM_IDEMPOTENCY_KEY_LEN
5
5
  export { acceptInvocationId, InvocationError, MAXIMUM_INVOCATION_ID_LENGTH, sameInvocationId, type InvocationId, } from './identity.js';
6
6
  export * as http from './http/index.js';
7
7
  export { acceptDelegate, type Delegate } from './delegate.js';
8
- export type { PublicationBindingInput, PublicationVia } from './legacy/index.js';
9
- /** @deprecated The legacy routed witness every Kernel emits until the breaking release (AM-1). */
10
- export * as legacy from './legacy/index.js';
11
8
  export { decodeMiss, miss, type Miss } from './miss.js';
12
9
  export { acceptRoute, acceptRedirection, decodeRedirectResponse, remoteRoute, type RemoteBindingInput, type Redirection, type RedirectResponse, type Route, } from './redirect.js';
13
10
  export { decodeRequest, type Request } from './request.js';
@@ -5,8 +5,6 @@ export { acceptIdempotencyKey, HTTP_IDEMPOTENCY_KEY, MAXIMUM_IDEMPOTENCY_KEY_LEN
5
5
  export { acceptInvocationId, InvocationError, MAXIMUM_INVOCATION_ID_LENGTH, sameInvocationId, } from './identity.js';
6
6
  export * as http from './http/index.js';
7
7
  export { acceptDelegate } from './delegate.js';
8
- /** @deprecated The legacy routed witness every Kernel emits until the breaking release (AM-1). */
9
- export * as legacy from './legacy/index.js';
10
8
  export { decodeMiss, miss } from './miss.js';
11
9
  export { acceptRoute, acceptRedirection, decodeRedirectResponse, remoteRoute, } from './redirect.js';
12
10
  export { decodeRequest } from './request.js';
@@ -4,17 +4,12 @@ import type { InvocationEndpoints } from '../release/bindings/invocation.js';
4
4
  import type { ReleaseDigest } from '../release/digest.js';
5
5
  import type { RequestId } from './correlation.js';
6
6
  import type { InvocationId } from './identity.js';
7
- import type { PublicationVia } from './legacy/via.js';
8
7
  import type { Via } from './routing.js';
9
8
  import type { Trace } from './trace.js';
10
9
  export interface Route {
11
10
  readonly endpoint: InvocationEndpoints;
12
- /**
13
- * Routed witness of the installed release. Its `PublicationVia` shape is deprecated (legacy
14
- * pins and the v3 projection of v4 pins); successor: `Via`, emitted by the breaking release
15
- * (AM-1).
16
- */
17
- readonly via: Via | PublicationVia;
11
+ /** Routed witness of the exact installed release. */
12
+ readonly via: Via;
18
13
  }
19
14
  export interface Redirection {
20
15
  readonly route: Route;
@@ -37,7 +32,7 @@ export interface RemoteBindingInput {
37
32
  readonly release: ReleaseDigest;
38
33
  }
39
34
  export declare function acceptRoute(input: unknown): Route;
40
- /** Project an installed release binding into a release `Via`; legacy emitters use `legacy.remoteRoute`. */
35
+ /** Project one installed release binding into its routed witness. */
41
36
  export declare function remoteRoute(origin: Key.Origin, binding: RemoteBindingInput, issuer: IssuerId): Route;
42
37
  export declare function acceptRedirection(input: unknown): Redirection;
43
38
  export declare function decodeRedirectResponse(input: unknown): RedirectResponse;
@@ -1,5 +1,5 @@
1
- import { acceptInvocationEndpoints } from '../release/legacy/bindings.js';
2
- import { PublicationError } from '../release/legacy/error.js';
1
+ import { acceptInvocationEndpoints } from '../release/bindings/index.js';
2
+ import { ReleaseError } from '../release/error.js';
3
3
  import { exactFields, invalid, invocation, portableObject, requestId, required, string, } from './admission.js';
4
4
  import { acceptVia } from './routing.js';
5
5
  import { admitTrace } from './trace.js';
@@ -15,13 +15,13 @@ export function acceptRoute(input) {
15
15
  return Object.freeze({ endpoint: acceptInvocationEndpoints(object.endpoint), via });
16
16
  }
17
17
  catch (cause) {
18
- if (cause instanceof PublicationError) {
18
+ if (cause instanceof ReleaseError) {
19
19
  return invalid(`route is invalid: ${cause.message}`);
20
20
  }
21
21
  throw cause;
22
22
  }
23
23
  }
24
- /** Project an installed release binding into a release `Via`; legacy emitters use `legacy.remoteRoute`. */
24
+ /** Project one installed release binding into its routed witness. */
25
25
  export function remoteRoute(origin, binding, issuer) {
26
26
  return acceptRoute({
27
27
  endpoint: binding.endpoint,
@@ -3,7 +3,6 @@ import type { Revision } from '@astrale-os/kernel-dsl/v1/addressing';
3
3
  import type { Object as ValueObject } from '@astrale-os/kernel-dsl/value';
4
4
  import type { Sha256Digest } from '../release/digest.js';
5
5
  import type { ReleaseRef } from '../release/reference.js';
6
- import type { PublicationVia } from './legacy/via.js';
7
6
  /** Routed witness of one installed release: the Kernel routed this call to that exact release. */
8
7
  export interface Via {
9
8
  readonly kind: 'via';
@@ -14,15 +13,12 @@ export interface Refresh {
14
13
  readonly kind: 'refresh';
15
14
  readonly stale: Sha256Digest;
16
15
  }
17
- /** A received `Via` names exactly one of a `ReleaseRef` or a legacy `PublicationRef`. */
18
- export type Routing = Via | PublicationVia | Refresh;
16
+ /** A received `Via` names one exact `ReleaseRef`. */
17
+ export type Routing = Via | Refresh;
19
18
  export declare function acceptRouting(input: unknown): Routing;
20
- /** Admit one routed witness carrying exactly one of `release` or legacy `publication`. */
21
- export declare function acceptVia(object: ValueObject, label: string): Via | PublicationVia;
22
- /** Schema revision of the release or Publication the witness routed the call to. */
23
- export declare function routedRevision(via: Via | PublicationVia): Revision;
24
- /**
25
- * Digest designating what the witness routed the call to: the release digest of a `Via`, the
26
- * Publication ETag of a legacy `PublicationVia`.
27
- */
28
- export declare function routedDigest(via: Via | PublicationVia): Sha256Digest;
19
+ /** Admit one routed witness carrying one exact `release`. */
20
+ export declare function acceptVia(object: ValueObject, label: string): Via;
21
+ /** Schema revision of the release the witness routed the call to. */
22
+ export declare function routedRevision(via: Via): Revision;
23
+ /** Digest of the release the witness routed this call to. */
24
+ export declare function routedDigest(via: Via): Sha256Digest;
@@ -1,8 +1,7 @@
1
1
  import { ReleaseError } from '../release/error.js';
2
2
  import { acceptReference } from '../release/reference.js';
3
3
  import { digest, exactFields, invalid, issuerId, portableObject, required } from './admission.js';
4
- import { acceptPublicationReference } from './legacy/via.js';
5
- const VIA_FIELDS = new Set(['kind', 'release', 'publication', 'issuer']);
4
+ const VIA_FIELDS = new Set(['kind', 'release', 'issuer']);
6
5
  const REFRESH_FIELDS = new Set(['kind', 'stale']);
7
6
  export function acceptRouting(input) {
8
7
  const object = portableObject(input, 'routing');
@@ -18,39 +17,25 @@ export function acceptRouting(input) {
18
17
  }
19
18
  return invalid('routing.kind must be "via" or "refresh"');
20
19
  }
21
- /** Admit one routed witness carrying exactly one of `release` or legacy `publication`. */
20
+ /** Admit one routed witness carrying one exact `release`. */
22
21
  export function acceptVia(object, label) {
23
22
  exactFields(object, VIA_FIELDS, label);
24
23
  if (object.kind !== 'via')
25
24
  invalid(`${label}.kind must be "via"`);
26
- const hasRelease = Object.hasOwn(object, 'release');
27
- if (hasRelease === Object.hasOwn(object, 'publication')) {
28
- invalid(`${label} must contain exactly one of release or publication`);
29
- }
30
- required(object, ['issuer'], label);
31
- if (!hasRelease) {
32
- return Object.freeze({
33
- kind: 'via',
34
- publication: acceptPublicationReference(object.publication, `${label}.publication`),
35
- issuer: issuerId(object.issuer, `${label}.issuer`),
36
- });
37
- }
25
+ required(object, ['release', 'issuer'], label);
38
26
  return Object.freeze({
39
27
  kind: 'via',
40
28
  release: acceptReleaseReference(object.release, `${label}.release`),
41
29
  issuer: issuerId(object.issuer, `${label}.issuer`),
42
30
  });
43
31
  }
44
- /** Schema revision of the release or Publication the witness routed the call to. */
32
+ /** Schema revision of the release the witness routed the call to. */
45
33
  export function routedRevision(via) {
46
- return 'release' in via ? via.release.revision : via.publication.revision;
34
+ return via.release.revision;
47
35
  }
48
- /**
49
- * Digest designating what the witness routed the call to: the release digest of a `Via`, the
50
- * Publication ETag of a legacy `PublicationVia`.
51
- */
36
+ /** Digest of the release the witness routed this call to. */
52
37
  export function routedDigest(via) {
53
- return 'release' in via ? via.release.digest : via.publication.etag;
38
+ return via.release.digest;
54
39
  }
55
40
  function acceptReleaseReference(input, label) {
56
41
  try {
@@ -1,4 +1,4 @@
1
- import type { Etag } from '../release/legacy/etag.js';
1
+ import type { ReleaseDigest } from '../release/digest.js';
2
2
  import type { RequestId } from './correlation.js';
3
3
  import type { InvocationId } from './identity.js';
4
4
  /** Reserved pre-handler routing control; never an application ErrorResponse. */
@@ -6,7 +6,7 @@ export interface Stale {
6
6
  readonly kind: 'stale';
7
7
  readonly requestId: RequestId;
8
8
  readonly invocation: InvocationId;
9
- readonly current: Etag;
9
+ readonly current: ReleaseDigest;
10
10
  }
11
11
  export declare function decodeStale(input: unknown): Stale;
12
- export declare function stale(requestId: RequestId, assigned: InvocationId, current: Etag): Stale;
12
+ export declare function stale(requestId: RequestId, assigned: InvocationId, current: ReleaseDigest): Stale;
@@ -1,3 +1,3 @@
1
1
  export { admitCallableBinding, admitCallableKey, type CallableBinding } from './callable.js';
2
2
  export { acceptInvocationEndpoints, type InvocationEndpoints } from './invocation.js';
3
- export { admitViewBinding, type IframeRequirements, type ViewBinding } from './view.js';
3
+ export { admitViewBinding, type ViewBinding } from './view.js';
@@ -4,13 +4,8 @@ export interface ViewBinding {
4
4
  readonly view: Key.View;
5
5
  readonly href: string;
6
6
  readonly handshake: 'shell' | 'none';
7
- readonly iframe?: IframeRequirements;
8
7
  readonly host?: ViewHostRequirements;
9
8
  }
10
- export interface IframeRequirements {
11
- readonly sandbox?: readonly string[];
12
- readonly allow?: readonly string[];
13
- }
14
9
  export declare function admitViewBinding(input: unknown, origin: string): ViewBinding;
15
10
  /** Authoring-only normalization used before a release document is sealed. */
16
11
  export declare function canonicalizeViewBinding(input: unknown, origin: string): ViewBinding;
@@ -2,7 +2,6 @@ import { acceptViewHostRequirements, } from '@astrale-os/kernel-core/schema/kern
2
2
  import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
3
3
  import { fail } from '../error.js';
4
4
  import { absoluteHttpUrl, exact, record } from '../shape.js';
5
- const TOKEN = /^[a-z][a-z0-9-]*$/u;
6
5
  export function admitViewBinding(input, origin) {
7
6
  return readViewBinding(input, origin, false);
8
7
  }
@@ -12,7 +11,7 @@ export function canonicalizeViewBinding(input, origin) {
12
11
  }
13
12
  function readViewBinding(input, origin, canonicalize) {
14
13
  const value = record(input, 'RELEASE_VIEW_INVALID', 'Release View binding is invalid.');
15
- exact(value, ['view', 'href', 'handshake', 'iframe', 'host'], 'RELEASE_VIEW_INVALID');
14
+ exact(value, ['view', 'href', 'handshake', 'host'], 'RELEASE_VIEW_INVALID');
16
15
  let view;
17
16
  try {
18
17
  view = Key(String(value.view));
@@ -29,7 +28,6 @@ function readViewBinding(input, origin, canonicalize) {
29
28
  if (value.handshake !== 'shell' && value.handshake !== 'none') {
30
29
  fail('RELEASE_VIEW_INVALID', 'View handshake is invalid.');
31
30
  }
32
- const iframe = admitIframeRequirements(dataValue(value, 'iframe'), value.handshake, canonicalize);
33
31
  let host;
34
32
  try {
35
33
  host = acceptViewHostRequirements(dataValue(value, 'host'), value.handshake, canonicalize);
@@ -43,106 +41,14 @@ function readViewBinding(input, origin, canonicalize) {
43
41
  view,
44
42
  href: absoluteHttpUrl(value.href, true, 'RELEASE_VIEW_INVALID'),
45
43
  handshake: value.handshake,
46
- ...(iframe === undefined ? {} : { iframe }),
47
44
  ...(host === undefined ? {} : { host }),
48
45
  });
49
46
  }
50
- function admitIframeRequirements(input, handshake, canonicalize) {
51
- if (input === undefined)
52
- return undefined;
53
- const value = plainRecord(input);
54
- exactOwnKeys(value, ['sandbox', 'allow']);
55
- if (!canonicalize && (!Object.hasOwn(value, 'sandbox') || !Object.hasOwn(value, 'allow'))) {
56
- invalid();
57
- }
58
- const sandbox = tokens(dataValue(value, 'sandbox'), canonicalize);
59
- const allow = tokens(dataValue(value, 'allow'), canonicalize);
60
- assertRelationships(sandbox);
61
- const baselineSandbox = handshake === 'shell' ? ['allow-same-origin', 'allow-scripts'] : ['allow-scripts'];
62
- const baselineAllow = handshake === 'shell' ? ['clipboard-write'] : [];
63
- if (!canonicalize &&
64
- (sandbox.some((token) => baselineSandbox.includes(token)) ||
65
- allow.some((feature) => baselineAllow.includes(feature)))) {
66
- invalid();
67
- }
68
- const canonicalSandbox = canonicalize
69
- ? sandbox.filter((token) => !baselineSandbox.includes(token))
70
- : sandbox;
71
- const canonicalAllow = canonicalize
72
- ? allow.filter((feature) => !baselineAllow.includes(feature))
73
- : allow;
74
- if (!canonicalize && canonicalSandbox.length === 0 && canonicalAllow.length === 0)
75
- invalid();
76
- if (canonicalSandbox.length === 0 && canonicalAllow.length === 0)
77
- return undefined;
78
- return Object.freeze({
79
- sandbox: Object.freeze(canonicalSandbox),
80
- allow: Object.freeze(canonicalAllow),
81
- });
82
- }
83
- function plainRecord(input) {
84
- if (input === null || typeof input !== 'object' || Array.isArray(input))
85
- invalid();
86
- const prototype = Object.getPrototypeOf(input);
87
- if (prototype !== Object.prototype && prototype !== null)
88
- invalid();
89
- return input;
90
- }
91
- function exactOwnKeys(input, allowed) {
92
- const keys = new Set(allowed);
93
- if (Reflect.ownKeys(input).some((key) => typeof key !== 'string' || !keys.has(key)))
94
- invalid();
95
- }
96
47
  function dataValue(input, key) {
97
48
  const descriptor = Object.getOwnPropertyDescriptor(input, key);
98
49
  if (descriptor === undefined)
99
50
  return undefined;
100
51
  if (!('value' in descriptor))
101
- invalid();
52
+ fail('RELEASE_VIEW_INVALID', 'View requirements must be data fields.');
102
53
  return descriptor.value;
103
54
  }
104
- function tokens(input, canonicalize) {
105
- if (input === undefined)
106
- return [];
107
- if (!Array.isArray(input))
108
- invalid();
109
- const descriptors = Object.getOwnPropertyDescriptors(input);
110
- const values = [];
111
- for (let index = 0; index < input.length; index += 1) {
112
- const descriptor = descriptors[String(index)];
113
- if (descriptor === undefined || !('value' in descriptor))
114
- invalid();
115
- if (typeof descriptor.value !== 'string' || !TOKEN.test(descriptor.value))
116
- invalid();
117
- values.push(descriptor.value);
118
- }
119
- for (const key of Reflect.ownKeys(descriptors)) {
120
- if (key === 'length')
121
- continue;
122
- if (typeof key !== 'string' || !/^(0|[1-9][0-9]*)$/u.test(key) || Number(key) >= input.length) {
123
- invalid();
124
- }
125
- }
126
- if (canonicalize)
127
- return [...new Set(values)].sort();
128
- for (let index = 1; index < values.length; index += 1) {
129
- if (values[index - 1] >= values[index])
130
- invalid();
131
- }
132
- return values;
133
- }
134
- function assertRelationships(sandbox) {
135
- const tokens = new Set(sandbox);
136
- if (tokens.has('allow-popups-to-escape-sandbox') && !tokens.has('allow-popups'))
137
- invalid();
138
- if (tokens.has('allow-top-navigation') && tokens.has('allow-top-navigation-by-user-activation')) {
139
- invalid();
140
- }
141
- if (tokens.has('allow-top-navigation-to-custom-protocols') &&
142
- (tokens.has('allow-top-navigation') || tokens.has('allow-popups'))) {
143
- invalid();
144
- }
145
- }
146
- function invalid() {
147
- return fail('RELEASE_VIEW_INVALID', 'View iframe requirements are invalid.');
148
- }
@@ -33,12 +33,6 @@ function validateInventory(release, bundle) {
33
33
  if (boundViews.size !== views.size || [...views].some((key) => !boundViews.has(key))) {
34
34
  fail('RELEASE_VIEW_INVALID', 'View bindings must exhaust the root Domain.');
35
35
  }
36
- if (release.manifest?.entrypoint !== undefined &&
37
- (release.manifest.entrypoint.origin !== root.origin ||
38
- release.manifest.entrypoint.kind !== 'view' ||
39
- root.views[release.manifest.entrypoint.name] === undefined)) {
40
- fail('RELEASE_INVALID', 'Manifest entrypoint does not exist in the root schema.');
41
- }
42
36
  for (const route of release.routes) {
43
37
  if (!callables.has(route.callable)) {
44
38
  fail('RELEASE_ROUTE_INVALID', `Route ${route.name} names an unknown callable.`);
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Delivery v2: the challenge-bound envelope carrying the exact `DomainRelease` a Kernel fetched at
3
- * `release.json`, bound to its release digest. `acceptRequest` also admits the deprecated v1 request,
4
- * discriminated by its `version`.
3
+ * `release.json`, bound to its release digest. Only the version 2 request is admitted.
5
4
  */
6
5
  export { type Attestation } from './attestation.js';
7
6
  export { acceptClaims, type Claims } from './claims.js';
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Delivery v2: the challenge-bound envelope carrying the exact `DomainRelease` a Kernel fetched at
3
- * `release.json`, bound to its release digest. `acceptRequest` also admits the deprecated v1 request,
4
- * discriminated by its `version`.
3
+ * `release.json`, bound to its release digest. Only the version 2 request is admitted.
5
4
  */
6
5
  export {} from './attestation.js';
7
6
  export { acceptClaims } from './claims.js';
@@ -1,6 +1,5 @@
1
1
  import { type IssuerId } from '@astrale-os/kernel-core/auth/issuer';
2
2
  import type { ReleaseDigest } from '../digest.js';
3
- import { type Request as PublicationRequest } from '../legacy/delivery/request.js';
4
3
  /** Exact bearer credential admitted by a Delivery transport boundary; never inside a document. */
5
4
  export interface Token {
6
5
  readonly kind: 'bearer';
@@ -13,9 +12,5 @@ export interface Request {
13
12
  readonly nonce: string;
14
13
  readonly release: ReleaseDigest;
15
14
  }
16
- /**
17
- * Admit the exact request representation accepted by a Delivery transport boundary. The request's
18
- * own `version` selects the Delivery version: 2 names a release digest, and the deprecated 1 names
19
- * the ETag of a v2/v3 Publication fetched at `domain.json`.
20
- */
21
- export declare function acceptRequest(input: unknown): Request | PublicationRequest;
15
+ /** Admit the exact version-two challenge at a Delivery transport boundary. */
16
+ export declare function acceptRequest(input: unknown): Request;
@@ -1,22 +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 { acceptRequest as acceptPublicationRequest, } from '../legacy/delivery/request.js';
4
3
  import { fail } from './error.js';
5
4
  import { NONCE_MAX_LENGTH, NONCE_MIN_LENGTH } from './limits.js';
6
5
  const FIELDS = ['version', 'kernel', 'nonce', 'release'];
7
- /**
8
- * Admit the exact request representation accepted by a Delivery transport boundary. The request's
9
- * own `version` selects the Delivery version: 2 names a release digest, and the deprecated 1 names
10
- * the ETag of a v2/v3 Publication fetched at `domain.json`.
11
- */
6
+ /** Admit the exact version-two challenge at a Delivery transport boundary. */
12
7
  export function acceptRequest(input) {
13
8
  if (input === null || typeof input !== 'object' || Array.isArray(input)) {
14
9
  fail('DELIVERY_REQUEST_INVALID', 'Expected a Delivery request.');
15
10
  }
16
- const version = Object.getOwnPropertyDescriptor(input, 'version');
17
- if (version !== undefined && 'value' in version && version.value === 1) {
18
- return acceptPublicationRequest(input);
19
- }
20
11
  const value = {};
21
12
  const fields = Reflect.ownKeys(input);
22
13
  if (fields.length !== FIELDS.length) {
@@ -13,9 +13,5 @@ export type { Manifest } from './manifest.js';
13
13
  export { ClassOperationOrder, admitRequirements, capabilityKeys, validateRequirements, type CapabilityAuthorityRequirements, type CoreCapabilityRequirement, type CapabilityRequirements, type ClassCapabilityRequirement, type ClassOperation, type NonEmpty, type Requirements, } from './requirements.js';
14
14
  export type { BodyPick, CredentialSource, HttpMethod, HttpRoute, HttpRouteDeclaration, RouteBody, RouteHeaders, SingleCredentialSource, } from './route.js';
15
15
  export type { Schema } from './schema.js';
16
- export { acceptInvocationEndpoints, type CallableBinding, type IframeRequirements, type InvocationEndpoints, type ViewBinding, } from './bindings/index.js';
16
+ export { acceptInvocationEndpoints, type CallableBinding, type InvocationEndpoints, type ViewBinding, } from './bindings/index.js';
17
17
  export * as delivery from './delivery/index.js';
18
- /**
19
- * @deprecated Publication v2/v3 compatibility surface; use `DomainRelease` v4 from this module.
20
- */
21
- export * as legacy from './legacy/index.js';
@@ -8,7 +8,3 @@ export { ReleaseError } from './error.js';
8
8
  export { ClassOperationOrder, admitRequirements, capabilityKeys, validateRequirements, } from './requirements.js';
9
9
  export { acceptInvocationEndpoints, } from './bindings/index.js';
10
10
  export * as delivery from './delivery/index.js';
11
- /**
12
- * @deprecated Publication v2/v3 compatibility surface; use `DomainRelease` v4 from this module.
13
- */
14
- export * as legacy from './legacy/index.js';
@@ -1,6 +1,6 @@
1
- import { type ViewRef } from '@astrale-os/kernel-dsl/v1/addressing';
2
1
  export interface Manifest {
3
2
  readonly logo?: string;
4
- readonly entrypoint?: ViewRef;
5
3
  }
4
+ /** The root Schema owns the Domain name and entrypoint in every release. */
5
+ export declare function assertAuthoredManifest(input: unknown): void;
6
6
  export declare function admitManifest(input: unknown): Manifest | undefined;
@@ -1,30 +1,22 @@
1
- import { acceptDefinitionRef } from '@astrale-os/kernel-dsl/v1/addressing';
2
1
  import { fail } from './error.js';
3
2
  import { exact, record } from './shape.js';
3
+ /** The root Schema owns the Domain name and entrypoint in every release. */
4
+ export function assertAuthoredManifest(input) {
5
+ if (input === null || typeof input !== 'object')
6
+ return;
7
+ for (const removed of ['title', 'entrypoint']) {
8
+ if (Object.hasOwn(input, removed)) {
9
+ fail('RELEASE_INVALID', `Manifest ${removed} is removed: the root schema declares the Domain name and entrypoint.`);
10
+ }
11
+ }
12
+ }
4
13
  export function admitManifest(input) {
5
14
  if (input === undefined)
6
15
  return undefined;
7
16
  const value = record(input, 'RELEASE_INVALID', 'Manifest is invalid.');
8
- exact(value, ['logo', 'entrypoint'], 'RELEASE_INVALID');
17
+ exact(value, ['logo'], 'RELEASE_INVALID');
9
18
  if (value.logo !== undefined && typeof value.logo !== 'string') {
10
19
  fail('RELEASE_INVALID', 'Manifest logo must be a string.');
11
20
  }
12
- let entrypoint;
13
- if (value.entrypoint !== undefined) {
14
- let ref;
15
- try {
16
- ref = acceptDefinitionRef(value.entrypoint);
17
- }
18
- catch (cause) {
19
- return fail('RELEASE_INVALID', 'Manifest entrypoint must be a root View reference.', cause);
20
- }
21
- if (ref.kind !== 'view') {
22
- fail('RELEASE_INVALID', 'Manifest entrypoint must be a root View reference.');
23
- }
24
- entrypoint = ref;
25
- }
26
- return Object.freeze({
27
- ...(value.logo === undefined ? {} : { logo: value.logo }),
28
- ...(entrypoint === undefined ? {} : { entrypoint }),
29
- });
21
+ return Object.freeze(value.logo === undefined ? {} : { logo: value.logo });
30
22
  }
@@ -3,6 +3,7 @@ import { admitBuild } from './build.js';
3
3
  import { admitDigest, sha256Hex } from './digest.js';
4
4
  import { fail } from './error.js';
5
5
  import { servedUrl } from './issuer.js';
6
+ import { assertAuthoredManifest } from './manifest.js';
6
7
  import { admitServedContent } from './served.js';
7
8
  import { deepFreeze, exact, record } from './shape.js';
8
9
  /** Path of the release a deployment serves beneath its serving issuer. */
@@ -41,6 +42,7 @@ export function digestOf(input) {
41
42
  export function seal(input) {
42
43
  const authored = record(input, 'RELEASE_INVALID', 'Expected release content.');
43
44
  exact(authored, CONTENT_FIELDS, 'RELEASE_INVALID');
45
+ assertAuthoredManifest(authored.manifest);
44
46
  const canonical = admitContent(admitContent(authored, 'canonicalize'), 'admit');
45
47
  return release(canonical, hash(canonical));
46
48
  }