@astrale-os/kernel-protocol 0.5.0-beta.71 → 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 (112) 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.js +1 -2
  5. package/dist/invocation/index.d.ts +0 -3
  6. package/dist/invocation/index.js +0 -2
  7. package/dist/invocation/redirect.d.ts +3 -8
  8. package/dist/invocation/redirect.js +4 -4
  9. package/dist/invocation/routing.d.ts +8 -12
  10. package/dist/invocation/routing.js +7 -22
  11. package/dist/invocation/stale-route.d.ts +3 -3
  12. package/dist/release/bindings/index.d.ts +1 -1
  13. package/dist/release/bindings/view.d.ts +0 -5
  14. package/dist/release/bindings/view.js +2 -96
  15. package/dist/release/bundle-admission.js +0 -6
  16. package/dist/release/delivery/index.d.ts +1 -2
  17. package/dist/release/delivery/index.js +1 -2
  18. package/dist/release/delivery/request.d.ts +2 -7
  19. package/dist/release/delivery/request.js +1 -10
  20. package/dist/release/index.d.ts +2 -6
  21. package/dist/release/index.js +0 -4
  22. package/dist/release/manifest.d.ts +2 -6
  23. package/dist/release/manifest.js +12 -56
  24. package/dist/release/release.js +2 -0
  25. package/dist/release/requirements.d.ts +1 -1
  26. package/dist/release/requirements.js +1 -1
  27. package/dist/release/served.d.ts +2 -1
  28. package/dist/release/served.js +1 -10
  29. package/dist/routes/compiler.js +1 -2
  30. package/dist/routes/credential.d.ts +0 -1
  31. package/dist/routes/credential.js +0 -3
  32. package/dist/routes/index.d.ts +0 -3
  33. package/dist/routes/index.js +0 -3
  34. package/dist/routes/request.d.ts +2 -2
  35. package/dist/routes/reservation.d.ts +2 -2
  36. package/dist/routes/reservation.js +8 -9
  37. package/dist/routes/routing.d.ts +4 -16
  38. package/dist/routes/routing.js +5 -11
  39. package/dist/routes/template.d.ts +0 -1
  40. package/dist/routes/template.js +0 -3
  41. package/dist/runtime/artifact.d.ts +2 -3
  42. package/dist/runtime/artifact.js +7 -17
  43. package/dist/runtime/index.d.ts +1 -1
  44. package/dist/runtime/index.js +1 -1
  45. package/dist/schema/installation/codec.d.ts +1 -6
  46. package/dist/schema/installation/codec.js +2 -6
  47. package/dist/schema/installation/introspection/codec.d.ts +2 -11
  48. package/dist/schema/installation/introspection/codec.js +20 -38
  49. package/dist/schema/installation/introspection/result.d.ts +9 -36
  50. package/package.json +4 -88
  51. package/dist/invocation/legacy/delegate.d.ts +0 -17
  52. package/dist/invocation/legacy/delegate.js +0 -37
  53. package/dist/invocation/legacy/index.d.ts +0 -29
  54. package/dist/invocation/legacy/index.js +0 -28
  55. package/dist/invocation/legacy/route.d.ts +0 -14
  56. package/dist/invocation/legacy/route.js +0 -25
  57. package/dist/invocation/legacy/via.d.ts +0 -30
  58. package/dist/invocation/legacy/via.js +0 -15
  59. package/dist/release/legacy/bindings.d.ts +0 -14
  60. package/dist/release/legacy/bindings.js +0 -11
  61. package/dist/release/legacy/bundle-admission.d.ts +0 -6
  62. package/dist/release/legacy/bundle-admission.js +0 -10
  63. package/dist/release/legacy/bundle-evidence.d.ts +0 -8
  64. package/dist/release/legacy/bundle-evidence.js +0 -11
  65. package/dist/release/legacy/bundle.d.ts +0 -24
  66. package/dist/release/legacy/bundle.js +0 -31
  67. package/dist/release/legacy/delivery/attestation.d.ts +0 -6
  68. package/dist/release/legacy/delivery/attestation.js +0 -1
  69. package/dist/release/legacy/delivery/claims.d.ts +0 -25
  70. package/dist/release/legacy/delivery/claims.js +0 -66
  71. package/dist/release/legacy/delivery/delivery.d.ts +0 -18
  72. package/dist/release/legacy/delivery/delivery.js +0 -33
  73. package/dist/release/legacy/delivery/error.d.ts +0 -16
  74. package/dist/release/legacy/delivery/error.js +0 -6
  75. package/dist/release/legacy/delivery/index.d.ts +0 -13
  76. package/dist/release/legacy/delivery/index.js +0 -13
  77. package/dist/release/legacy/delivery/limits.d.ts +0 -21
  78. package/dist/release/legacy/delivery/limits.js +0 -22
  79. package/dist/release/legacy/delivery/request.d.ts +0 -26
  80. package/dist/release/legacy/delivery/request.js +0 -57
  81. package/dist/release/legacy/delivery-declaration.d.ts +0 -9
  82. package/dist/release/legacy/delivery-declaration.js +0 -11
  83. package/dist/release/legacy/error.d.ts +0 -26
  84. package/dist/release/legacy/error.js +0 -114
  85. package/dist/release/legacy/etag.d.ts +0 -12
  86. package/dist/release/legacy/etag.js +0 -14
  87. package/dist/release/legacy/index.d.ts +0 -75
  88. package/dist/release/legacy/index.js +0 -15
  89. package/dist/release/legacy/profiles.d.ts +0 -23
  90. package/dist/release/legacy/profiles.js +0 -36
  91. package/dist/release/legacy/projection.d.ts +0 -13
  92. package/dist/release/legacy/projection.js +0 -25
  93. package/dist/release/legacy/publication.d.ts +0 -90
  94. package/dist/release/legacy/publication.js +0 -124
  95. package/dist/release/legacy/reference.d.ts +0 -47
  96. package/dist/release/legacy/reference.js +0 -92
  97. package/dist/release/legacy/requirements.d.ts +0 -30
  98. package/dist/release/legacy/requirements.js +0 -20
  99. package/dist/routes/legacy/index.d.ts +0 -29
  100. package/dist/routes/legacy/index.js +0 -29
  101. package/dist/routes/legacy/routing.d.ts +0 -24
  102. package/dist/routes/legacy/routing.js +0 -45
  103. package/dist/routes/legacy/table.d.ts +0 -34
  104. package/dist/routes/legacy/table.js +0 -50
  105. package/dist/schema/installation/legacy/index.d.ts +0 -39
  106. package/dist/schema/installation/legacy/index.js +0 -39
  107. package/dist/schema/installation/legacy/installation.d.ts +0 -9
  108. package/dist/schema/installation/legacy/installation.js +0 -28
  109. package/dist/schema/installation/legacy/introspection.d.ts +0 -10
  110. package/dist/schema/installation/legacy/introspection.js +0 -70
  111. package/dist/schema/installation/legacy/msgpack.d.ts +0 -1
  112. package/dist/schema/installation/legacy/msgpack.js +0 -143
@@ -1,124 +0,0 @@
1
- import * as portable from '@astrale-os/kernel-dsl/value';
2
- import { admitDigest } from '../digest.js';
3
- import { servedUrl } from '../issuer.js';
4
- import { admitServedContent } from '../served.js';
5
- import { deepFreeze } from '../shape.js';
6
- import { exact, fail, record, withPublicationError } from './error.js';
7
- import { computeEtag } from './etag.js';
8
- import { decodeLegacyRequirements, encodeLegacyRequirements } from './profiles.js';
9
- /**
10
- * @deprecated Path of the v2/v3 Publication; use the release `PATH` (`release.json`) from
11
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
12
- */
13
- export const PATH = '/.well-known/astrale/domain.json';
14
- /**
15
- * @deprecated Media type of Publication v3; use the release `MEDIA_TYPE` from
16
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
17
- */
18
- export const MEDIA_TYPE = 'application/vnd.astrale.domain-publication+json;v=3';
19
- /**
20
- * @deprecated Media type of Publication v2; use the release `MEDIA_TYPE` from
21
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
22
- */
23
- export const LEGACY_MEDIA_TYPE = 'application/vnd.astrale.domain-publication+json;v=2';
24
- /**
25
- * Select the media type of one v2 or v3 Publication.
26
- *
27
- * @deprecated Serves and retains v2/v3 Publications only; use the release `MEDIA_TYPE` from
28
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4), the one media type of a
29
- * release.
30
- */
31
- export function mediaType(input) {
32
- return input.version === 2 ? LEGACY_MEDIA_TYPE : MEDIA_TYPE;
33
- }
34
- /**
35
- * Resolve the canonical Publication URL beneath one exact HTTP(S) serving issuer.
36
- *
37
- * @deprecated Locates the v2/v3 Publication; use the release `url` (`release.json`) from
38
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
39
- */
40
- export function url(input) {
41
- return withPublicationError(() => servedUrl(input, PATH));
42
- }
43
- /**
44
- * @deprecated Seals a v2/v3 Publication; use the release `seal` from
45
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
46
- */
47
- export function seal(input) {
48
- return withPublicationError(() => {
49
- const canonical = withoutEtag(acceptPublication({ ...input, etag: 'canonicalizing' }, 'seal'));
50
- return acceptPublication({ ...canonical, etag: computeEtag(canonical) }, 'canonical');
51
- });
52
- }
53
- /**
54
- * @deprecated Admits a v2/v3 Publication; use the release `accept` from
55
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
56
- */
57
- export function accept(input) {
58
- return withPublicationError(() => {
59
- const publication = acceptPublication(input, 'wire');
60
- if (publication.etag !== computeEtag(withoutEtag(publication))) {
61
- fail('PUBLICATION_ETAG_MISMATCH', 'Publication ETag does not match its canonical content.');
62
- }
63
- return publication;
64
- });
65
- }
66
- /**
67
- * @deprecated Encodes a v2/v3 Publication byte-identically to its accepted wire form; use the
68
- * release `encode` from `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
69
- */
70
- export function encode(input) {
71
- const wire = input.version === 2
72
- ? { ...input, requirements: encodeLegacyRequirements(input.requirements) }
73
- : input;
74
- return portable.json.encode(wire);
75
- }
76
- function acceptPublication(input, mode) {
77
- const value = record(input, 'PUBLICATION_INVALID', 'Expected a Publication object.');
78
- exact(value, [
79
- 'format',
80
- 'version',
81
- 'origin',
82
- 'identity',
83
- 'etag',
84
- 'schema',
85
- 'requirements',
86
- 'manifest',
87
- 'bindings',
88
- 'routes',
89
- 'delivery',
90
- ], 'PUBLICATION_INVALID');
91
- if (value.format !== 'astrale.domain.publication' ||
92
- (value.version !== 2 && value.version !== 3)) {
93
- fail('PUBLICATION_INVALID', 'Unsupported Publication format or version.');
94
- }
95
- // Version 2 is read-only: retained Publications keep their exact bytes and ETag, but no new one
96
- // is sealed.
97
- if (value.version !== 3 && mode === 'seal') {
98
- fail('PUBLICATION_INVALID', 'Only Publication version 3 can be sealed.');
99
- }
100
- const served = admitServedContent(value, {
101
- views: mode === 'seal' ? 'canonicalize' : 'admit',
102
- ...(value.version === 2 && mode === 'wire' ? { requirements: decodeLegacyRequirements } : {}),
103
- });
104
- const admittedEtag = mode === 'wire' ? admitDigest(value.etag) : value.etag;
105
- if (typeof admittedEtag !== 'string')
106
- fail('PUBLICATION_INVALID', 'Publication ETag is missing.');
107
- return deepFreeze({
108
- format: 'astrale.domain.publication',
109
- version: value.version,
110
- origin: served.origin,
111
- identity: served.identity,
112
- etag: admittedEtag,
113
- schema: served.schema,
114
- requirements: served.requirements,
115
- ...(served.manifest === undefined ? {} : { manifest: served.manifest }),
116
- bindings: served.bindings,
117
- routes: served.routes,
118
- ...(served.delivery === undefined ? {} : { delivery: served.delivery }),
119
- });
120
- }
121
- function withoutEtag(input) {
122
- const { etag: _etag, ...content } = input;
123
- return content;
124
- }
@@ -1,47 +0,0 @@
1
- import type { Revision } from '@astrale-os/kernel-dsl/v1/addressing';
2
- import { type Key } from '@astrale-os/kernel-dsl/v1/addressing';
3
- import type { Etag } from './etag.js';
4
- import type { Publication } from './publication.js';
5
- /**
6
- * Compact untrusted projection that witnesses one exact Publication.
7
- *
8
- * @deprecated Witnesses a v2/v3 Publication; use `ReleaseRef` from
9
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
10
- */
11
- export interface PublicationRef {
12
- readonly origin: Key.Origin;
13
- readonly identity: Publication['identity'];
14
- readonly revision: Revision;
15
- readonly etag: Etag;
16
- }
17
- /**
18
- * @deprecated Relation between two `PublicationRef`s; use `ReleaseReferenceRelation` from
19
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
20
- */
21
- export type PublicationReferenceRelation = 'exact' | 'same-schema' | 'schema-drift' | 'identity-drift' | 'origin-drift';
22
- /**
23
- * @deprecated Projects a v2/v3 Publication; use the release `reference` from
24
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
25
- */
26
- export declare function reference(input: Publication): PublicationRef;
27
- /**
28
- * @deprecated Admits a v2/v3 Publication reference; use the release `acceptReference` from
29
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
30
- */
31
- export declare function acceptReference(input: unknown): PublicationRef;
32
- /**
33
- * @deprecated Classifies two `PublicationRef`s; use the release `compareReferences` from
34
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
35
- */
36
- export declare function compareReferences(input: PublicationRef, expected: PublicationRef): PublicationReferenceRelation;
37
- /**
38
- * @deprecated Compares a v2/v3 Publication with a `PublicationRef`; use
39
- * `compareReferences(reference(release), expected)` from `@astrale-os/kernel-protocol/release`
40
- * (added with `DomainRelease` v4).
41
- */
42
- export declare function compareReference(input: Publication, expected: PublicationRef): PublicationReferenceRelation;
43
- /**
44
- * @deprecated Matches a v2/v3 Publication with a `PublicationRef`; use the release
45
- * `matchesReference` from `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
46
- */
47
- export declare function matchesReference(input: Publication, expected: PublicationRef): boolean;
@@ -1,92 +0,0 @@
1
- import { AuthValueError } from '@astrale-os/kernel-core/auth/error';
2
- import { accept as acceptIssuerId } from '@astrale-os/kernel-core/auth/issuer';
3
- import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
4
- import { admitDigest } from '../digest.js';
5
- import { deepFreeze } from '../shape.js';
6
- import { exact, fail, record, withPublicationError } from './error.js';
7
- /**
8
- * @deprecated Projects a v2/v3 Publication; use the release `reference` from
9
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
10
- */
11
- export function reference(input) {
12
- return deepFreeze({
13
- origin: input.origin,
14
- identity: { ...input.identity },
15
- revision: input.schema.revision,
16
- etag: input.etag,
17
- });
18
- }
19
- /**
20
- * @deprecated Admits a v2/v3 Publication reference; use the release `acceptReference` from
21
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
22
- */
23
- export function acceptReference(input) {
24
- return withPublicationError(() => admitReference(input));
25
- }
26
- function admitReference(input) {
27
- const value = record(input, 'PUBLICATION_INVALID', 'Publication reference is invalid.');
28
- exact(value, ['origin', 'identity', 'revision', 'etag'], 'PUBLICATION_INVALID');
29
- if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
30
- fail('PUBLICATION_INVALID', 'Publication reference origin is invalid.');
31
- }
32
- const origin = value.origin;
33
- const identity = record(value.identity, 'PUBLICATION_INVALID', 'Publication reference identity is invalid.');
34
- exact(identity, ['issuer', 'subject'], 'PUBLICATION_INVALID');
35
- const issuer = acceptIssuer(identity.issuer);
36
- if (identity.subject !== origin) {
37
- fail('PUBLICATION_INVALID', 'Publication reference subject must equal its root origin.');
38
- }
39
- if (typeof value.revision !== 'string' || !patterns.revision.test(value.revision)) {
40
- fail('PUBLICATION_INVALID', 'Publication reference revision is invalid.');
41
- }
42
- return deepFreeze({
43
- origin,
44
- identity: { issuer, subject: origin },
45
- revision: value.revision,
46
- etag: admitDigest(value.etag),
47
- });
48
- }
49
- /**
50
- * @deprecated Classifies two `PublicationRef`s; use the release `compareReferences` from
51
- * `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
52
- */
53
- export function compareReferences(input, expected) {
54
- if (input.origin !== expected.origin)
55
- return 'origin-drift';
56
- if (input.identity.issuer !== expected.identity.issuer ||
57
- input.identity.subject !== expected.identity.subject) {
58
- return 'identity-drift';
59
- }
60
- if (input.revision !== expected.revision)
61
- return 'schema-drift';
62
- return input.etag === expected.etag ? 'exact' : 'same-schema';
63
- }
64
- /**
65
- * @deprecated Compares a v2/v3 Publication with a `PublicationRef`; use
66
- * `compareReferences(reference(release), expected)` from `@astrale-os/kernel-protocol/release`
67
- * (added with `DomainRelease` v4).
68
- */
69
- export function compareReference(input, expected) {
70
- return compareReferences(reference(input), expected);
71
- }
72
- /**
73
- * @deprecated Matches a v2/v3 Publication with a `PublicationRef`; use the release
74
- * `matchesReference` from `@astrale-os/kernel-protocol/release` (added with `DomainRelease` v4).
75
- */
76
- export function matchesReference(input, expected) {
77
- return compareReference(input, expected) === 'exact';
78
- }
79
- function acceptIssuer(input) {
80
- if (typeof input !== 'string') {
81
- fail('PUBLICATION_INVALID', 'Publication reference issuer is invalid.');
82
- }
83
- try {
84
- return acceptIssuerId(input);
85
- }
86
- catch (cause) {
87
- if (cause instanceof AuthValueError) {
88
- return fail('PUBLICATION_INVALID', 'Publication reference issuer is invalid.', cause);
89
- }
90
- throw cause;
91
- }
92
- }
@@ -1,30 +0,0 @@
1
- import type { schema } from '@astrale-os/kernel-dsl/v1';
2
- import * as requirements from '../requirements.js';
3
- /** @deprecated Use `NonEmpty` from `@astrale-os/kernel-protocol/release`. */
4
- export type NonEmpty<Value> = requirements.NonEmpty<Value>;
5
- /** @deprecated Use `ClassOperation` from `@astrale-os/kernel-protocol/release`. */
6
- export type ClassOperation = requirements.ClassOperation;
7
- /** @deprecated Use `ClassCapabilityRequirement` from `@astrale-os/kernel-protocol/release`. */
8
- export type ClassCapabilityRequirement = requirements.ClassCapabilityRequirement;
9
- /** @deprecated Use `CapabilityAuthorityRequirements` from `@astrale-os/kernel-protocol/release`. */
10
- export type CapabilityAuthorityRequirements = requirements.CapabilityAuthorityRequirements;
11
- /** @deprecated Use `CapabilityRequirements` from `@astrale-os/kernel-protocol/release`. */
12
- export type CapabilityRequirements = requirements.CapabilityRequirements;
13
- /** @deprecated Use `CoreCapabilityRequirement` from `@astrale-os/kernel-protocol/release`. */
14
- export type CoreCapabilityRequirement = requirements.CoreCapabilityRequirement;
15
- /** @deprecated Use `Requirements` from `@astrale-os/kernel-protocol/release`. */
16
- export type PublicationRequirements = requirements.Requirements;
17
- /**
18
- * Admit the exact closed canonical requirements object used by Publication v3.
19
- *
20
- * @deprecated Use `admitRequirements` from `@astrale-os/kernel-protocol/release`, which reports
21
- * `ReleaseError`.
22
- */
23
- export declare function admitRequirements(input: unknown): PublicationRequirements;
24
- /**
25
- * Bind explicit capability targets to exact functional dependencies in the bundle closure.
26
- *
27
- * @deprecated Use `validateRequirements` from `@astrale-os/kernel-protocol/release`, which reports
28
- * `ReleaseError`.
29
- */
30
- export declare function validateRequirements(root: schema.DomainSchema, closure: readonly schema.DomainSchema[], input: PublicationRequirements): void;
@@ -1,20 +0,0 @@
1
- import * as requirements from '../requirements.js';
2
- import { withPublicationError } from './error.js';
3
- /**
4
- * Admit the exact closed canonical requirements object used by Publication v3.
5
- *
6
- * @deprecated Use `admitRequirements` from `@astrale-os/kernel-protocol/release`, which reports
7
- * `ReleaseError`.
8
- */
9
- export function admitRequirements(input) {
10
- return withPublicationError(() => requirements.admitRequirements(input));
11
- }
12
- /**
13
- * Bind explicit capability targets to exact functional dependencies in the bundle closure.
14
- *
15
- * @deprecated Use `validateRequirements` from `@astrale-os/kernel-protocol/release`, which reports
16
- * `ReleaseError`.
17
- */
18
- export function validateRequirements(root, closure, input) {
19
- withPublicationError(() => requirements.validateRequirements(root, closure, input));
20
- }
@@ -1,29 +0,0 @@
1
- /**
2
- * Native routes bound to a v2/v3 Publication and its ETag. Binding also reserves `release.json`
3
- * to prevent routes from shadowing the release document.
4
- * Superseded by release-based Tables and routing from `@astrale-os/kernel-protocol/routes`.
5
- *
6
- * Short-term consumers: every destination sealed from a v2/v3 Publication, the legacy stable
7
- * Workers and the SDK's v3 seal and preflight (`legacy.bind`, `legacy.verifyTable`,
8
- * `legacy.Table`, adopted at its Kernel pin bump), and the Server's Publication-backed native
9
- * routes (`server/routes/routes.ts`, `server/release/legacy/`) that serve them.
10
- *
11
- * Removal, in a separate breaking release: the conditions of `protocol/release/legacy/index.ts`
12
- * hold (no stable Worker serves a v2/v3 document, no installation pins one) and every supported
13
- * client relays `Via`. Then delete, in the same PR:
14
- * - this folder with its tests and laws, the `legacy` namespace and `HTTP_ROUTE_PUBLICATION`
15
- * re-export of `routes/index.ts`, and the `./routes/legacy` subpaths (source and `dist`) of
16
- * `protocol/package.json`;
17
- * - the projection branch of the canonical `decodeRouting` (`routing.ts`) with
18
- * `ServedReferences.projection`, so stale reports the release digest as `current`, and the
19
- * projection vectors of TEST-DECODES-ROUTING-BY-SERVED-REFERENCE;
20
- * - the Publication-backed native routes of the Server (`server/routes/routes.ts`,
21
- * `server/release/legacy/`, and #508 in `server/invocation/legacy/`), which read this module;
22
- * - rebase `protocol/__tests__/publication-routes.test.ts`, which exercises the shared compile,
23
- * placement and reservation laws through this Table, on the release Table;
24
- * - `ServedReferences.projection` from law PROTOCOL-LEGACY-WIRE-FIELDS and its test.
25
- * The shared entry mechanics (`entries.ts`, `header.ts`) and `reservation.ts` stay: they carry no
26
- * document label.
27
- */
28
- export { acceptTable, bind, verifyTable, type Table } from './table.js';
29
- export { decode, decodeRouting, HTTP_ROUTE_PUBLICATION } from './routing.js';
@@ -1,29 +0,0 @@
1
- /**
2
- * Native routes bound to a v2/v3 Publication and its ETag. Binding also reserves `release.json`
3
- * to prevent routes from shadowing the release document.
4
- * Superseded by release-based Tables and routing from `@astrale-os/kernel-protocol/routes`.
5
- *
6
- * Short-term consumers: every destination sealed from a v2/v3 Publication, the legacy stable
7
- * Workers and the SDK's v3 seal and preflight (`legacy.bind`, `legacy.verifyTable`,
8
- * `legacy.Table`, adopted at its Kernel pin bump), and the Server's Publication-backed native
9
- * routes (`server/routes/routes.ts`, `server/release/legacy/`) that serve them.
10
- *
11
- * Removal, in a separate breaking release: the conditions of `protocol/release/legacy/index.ts`
12
- * hold (no stable Worker serves a v2/v3 document, no installation pins one) and every supported
13
- * client relays `Via`. Then delete, in the same PR:
14
- * - this folder with its tests and laws, the `legacy` namespace and `HTTP_ROUTE_PUBLICATION`
15
- * re-export of `routes/index.ts`, and the `./routes/legacy` subpaths (source and `dist`) of
16
- * `protocol/package.json`;
17
- * - the projection branch of the canonical `decodeRouting` (`routing.ts`) with
18
- * `ServedReferences.projection`, so stale reports the release digest as `current`, and the
19
- * projection vectors of TEST-DECODES-ROUTING-BY-SERVED-REFERENCE;
20
- * - the Publication-backed native routes of the Server (`server/routes/routes.ts`,
21
- * `server/release/legacy/`, and #508 in `server/invocation/legacy/`), which read this module;
22
- * - rebase `protocol/__tests__/publication-routes.test.ts`, which exercises the shared compile,
23
- * placement and reservation laws through this Table, on the release Table;
24
- * - `ServedReferences.projection` from law PROTOCOL-LEGACY-WIRE-FIELDS and its test.
25
- * The shared entry mechanics (`entries.ts`, `header.ts`) and `reservation.ts` stay: they carry no
26
- * document label.
27
- */
28
- export { acceptTable, bind, verifyTable } from './table.js';
29
- export { decode, decodeRouting, HTTP_ROUTE_PUBLICATION } from './routing.js';
@@ -1,24 +0,0 @@
1
- import type { Domain } from '@astrale-os/kernel-dsl/v1';
2
- import type { PublicationVia } from '../../invocation/index.js';
3
- import type { PublicationRef } from '../../release/legacy/reference.js';
4
- import type { HttpRequest, Invocation } from '../request.js';
5
- import type { Route } from '../table.js';
6
- /**
7
- * The If-Match header native routing reads, named for the Publication ETag it carried.
8
- *
9
- * @deprecated Successor: `HTTP_ROUTE_DIGEST`, the same header named for the routed digest.
10
- */
11
- export declare const HTTP_ROUTE_PUBLICATION: "if-match";
12
- /**
13
- * Decode only the native strong If-Match representation of Publication routing, served by a
14
- * v3-input destination; a mismatched ETag is invalid here because the Server answers stale first.
15
- *
16
- * @deprecated Successor: `decodeRouting`, which serves a release and its v3 projection.
17
- */
18
- export declare function decodeRouting(input: Pick<HttpRequest, 'headers'>, publication: PublicationRef): PublicationVia | undefined;
19
- /**
20
- * Decode one native route request served by a v3-input destination.
21
- *
22
- * @deprecated Successor: `decode`, which serves a release and its v3 projection.
23
- */
24
- export declare function decode(entry: Route, request: HttpRequest, domain: Domain, served: PublicationRef): Invocation;
@@ -1,45 +0,0 @@
1
- import { decodeInvocation } from '../decode.js';
2
- import { fail } from '../error.js';
3
- import { acceptIssuerHeader, reservedHeader, strongDigest } from '../header.js';
4
- import { HTTP_ROUTE_DIGEST, HTTP_ROUTE_ISSUER } from '../routing.js';
5
- /**
6
- * The If-Match header native routing reads, named for the Publication ETag it carried.
7
- *
8
- * @deprecated Successor: `HTTP_ROUTE_DIGEST`, the same header named for the routed digest.
9
- */
10
- export const HTTP_ROUTE_PUBLICATION = HTTP_ROUTE_DIGEST;
11
- /**
12
- * Decode only the native strong If-Match representation of Publication routing, served by a
13
- * v3-input destination; a mismatched ETag is invalid here because the Server answers stale first.
14
- *
15
- * @deprecated Successor: `decodeRouting`, which serves a release and its v3 projection.
16
- */
17
- export function decodeRouting(input, publication) {
18
- const encodedEtag = reservedHeader(input.headers, HTTP_ROUTE_DIGEST);
19
- const encodedIssuer = reservedHeader(input.headers, HTTP_ROUTE_ISSUER);
20
- if (encodedEtag === undefined && encodedIssuer === undefined)
21
- return undefined;
22
- if (encodedEtag === undefined || encodedIssuer === undefined) {
23
- fail('NATIVE_ROUTE_ROUTING_INVALID', `${HTTP_ROUTE_DIGEST} and ${HTTP_ROUTE_ISSUER} must occur together.`);
24
- }
25
- const etag = strongDigest(encodedEtag);
26
- if (etag === undefined) {
27
- fail('NATIVE_ROUTE_ROUTING_INVALID', 'If-Match must contain exactly one strong quoted Publication ETag.');
28
- }
29
- if (etag !== publication.etag) {
30
- fail('NATIVE_ROUTE_ROUTING_INVALID', 'If-Match does not name the compiled Publication.');
31
- }
32
- return Object.freeze({
33
- kind: 'via',
34
- publication,
35
- issuer: acceptIssuerHeader(encodedIssuer, HTTP_ROUTE_ISSUER),
36
- });
37
- }
38
- /**
39
- * Decode one native route request served by a v3-input destination.
40
- *
41
- * @deprecated Successor: `decode`, which serves a release and its v3 projection.
42
- */
43
- export function decode(entry, request, domain, served) {
44
- return decodeInvocation(entry, request, domain, (input) => decodeRouting(input, served));
45
- }
@@ -1,34 +0,0 @@
1
- import type { Domain } from '@astrale-os/kernel-dsl/v1';
2
- import type { Publication } from '../../release/legacy/publication.js';
3
- import type { PublicationRef } from '../../release/legacy/reference.js';
4
- import type { Plan } from '../plan.js';
5
- import type { Route } from '../table.js';
6
- /**
7
- * Serving proof tied to one exact v2/v3 Publication and its resolved Domain.
8
- *
9
- * @deprecated Successor: `Table`, bound to the `ReleaseRef` of a `DomainRelease`.
10
- */
11
- export interface Table {
12
- readonly publication: PublicationRef;
13
- readonly entries: readonly Route[];
14
- }
15
- /**
16
- * Bind one Plan to an exact placed Publication and matching resolved Domain. Like the release
17
- * Table, it also reserves `release.json`, so a v3 Domain cannot claim the document a v4 Kernel
18
- * reads first.
19
- *
20
- * @deprecated Successor: `bind`, which binds a `DomainRelease`.
21
- */
22
- export declare function bind(plan: Plan, deployed: Publication, domain: Domain, publicUrl?: string): Table;
23
- /**
24
- * Admit one emitted portable Publication Table before Server composition.
25
- *
26
- * @deprecated Successor: `acceptTable`, which admits a release Table.
27
- */
28
- export declare function acceptTable(input: unknown): Table;
29
- /**
30
- * Verify exact Publication bytes and callable meaning before Server trusts one Table.
31
- *
32
- * @deprecated Successor: `verifyTable`, which verifies a release Table.
33
- */
34
- export declare function verifyTable(table: Table, deployed: Publication, domain: Pick<Domain, 'origin' | 'revision' | 'callable'>): Table;
@@ -1,50 +0,0 @@
1
- import { withPublicationError } from '../../release/legacy/error.js';
2
- import { acceptReference, compareReferences, reference } from '../../release/legacy/reference.js';
3
- import { acceptEntries, placedEntries, placementMismatch, sameServedWire, tableObject, verifyMeaning, } from '../entries.js';
4
- import { fail } from '../error.js';
5
- import { rejectReserved } from '../reservation.js';
6
- /**
7
- * Bind one Plan to an exact placed Publication and matching resolved Domain. Like the release
8
- * Table, it also reserves `release.json`, so a v3 Domain cannot claim the document a v4 Kernel
9
- * reads first.
10
- *
11
- * @deprecated Successor: `bind`, which binds a `DomainRelease`.
12
- */
13
- export function bind(plan, deployed, domain, publicUrl = deployed.identity.issuer) {
14
- const mismatch = placementMismatch(plan, deployed, domain, publicUrl);
15
- if (mismatch === 'identity') {
16
- fail('NATIVE_ROUTE_BINDING_INVALID', 'Route Plan, Publication, and Domain identity differ.');
17
- }
18
- if (mismatch === 'routes') {
19
- fail('NATIVE_ROUTE_BINDING_INVALID', 'Publication routes differ from the placed Route Plan.');
20
- }
21
- const entries = placedEntries(plan, deployed);
22
- withPublicationError(() => rejectReserved(deployed, entries));
23
- return Object.freeze({ publication: reference(deployed), entries });
24
- }
25
- /**
26
- * Admit one emitted portable Publication Table before Server composition.
27
- *
28
- * @deprecated Successor: `acceptTable`, which admits a release Table.
29
- */
30
- export function acceptTable(input) {
31
- const value = tableObject(input, ['publication', 'entries']);
32
- const publication = acceptReference(value.publication);
33
- return Object.freeze({
34
- publication,
35
- entries: withPublicationError(() => acceptEntries(value.entries, publication.origin)),
36
- });
37
- }
38
- /**
39
- * Verify exact Publication bytes and callable meaning before Server trusts one Table.
40
- *
41
- * @deprecated Successor: `verifyTable`, which verifies a release Table.
42
- */
43
- export function verifyTable(table, deployed, domain) {
44
- if (compareReferences(table.publication, reference(deployed)) !== 'exact' ||
45
- !sameServedWire(table.entries, deployed, domain)) {
46
- fail('NATIVE_ROUTE_BINDING_INVALID', 'Route Table evidence differs from its Publication.');
47
- }
48
- verifyMeaning(table.entries, domain);
49
- return table;
50
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * Read-only decoders for the schema evidence of Hosts older than beta.127: MessagePack
3
- * installation v1 (`application/vnd.astrale.schema-installation.v1+msgpack`) and introspection v2
4
- * (`application/vnd.astrale.schema-introspection.v2+msgpack`). Each decodes its bytes into the same
5
- * wire value as the canonical JSON evidence and admits it with the canonical checks, so it returns
6
- * exactly the canonical `InstallResult` and introspection results. Nothing here encodes: Servers
7
- * emit only the canonical JSON evidence.
8
- *
9
- * @deprecated Use `installation.decode` / `installation.introspection.decode` with their
10
- * `MEDIA_TYPE`, the JSON evidence every Host from beta.127 serves.
11
- *
12
- * Short-term consumers, all through `@astrale-os/kernel-client` `SchemaApi`, which selects these
13
- * decoders by the received media type:
14
- * - Admin managing the 1Pact Host (Kernel beta.117) and the astrale Hosts on beta.121 and beta.126
15
- * (`schema.inspect` before every Manager call, child `install`/`inspect`, `bundle` reads);
16
- * - the CLI used by 1Pact developers, and `adapter-astrale` 0.5.0-beta.148, which runs
17
- * `astrale introspect` before every 1Pact deploy (`introspect`, `view`,
18
- * `domain install --direct`, cold-cache `call`);
19
- * - the Console back-office (`schema.bundle` of every installed Domain);
20
- * - SDK Project tooling (`pnpm dev`, the Environment installation reconcile), which runs
21
- * `astrale introspect` and `astrale domain install --direct` through that same CLI against our
22
- * beta.121 and beta.126 Hosts.
23
- *
24
- * Removal, in a separate breaking release: once no supported Host is older than beta.127 (the
25
- * 1Pact Host upgraded; astrale-01, shared-01 and admin-users replaced or upgraded). Then delete, in
26
- * the same PR:
27
- * - this folder with its tests, golden evidence and laws, its `legacy/` entry in
28
- * `../.spec/layout.ts`, and the `./schema/installation/legacy` subpaths (source and `dist`) of
29
- * `protocol/package.json` with the `schema/installation/legacy/**` include of
30
- * `protocol/tsconfig.json`;
31
- * - the legacy media-type branches of `client/schema/schema.ts` and
32
- * `client/schema/introspection.ts`, and `client/schema/__tests__/legacy-evidence.test.ts`;
33
- * - the legacy paragraphs of `client/schema/.spec/architecture.md` and
34
- * `../.spec/architecture.md`;
35
- * - the package-private exports of `../codec.ts` (`accept`) and `../introspection/codec.ts`
36
- * (`acceptEvidence`, `admitLimits`, `admitRequest`), which return to module scope.
37
- */
38
- export { MEDIA_TYPE, decode } from './installation.js';
39
- export * as introspection from './introspection.js';
@@ -1,39 +0,0 @@
1
- /**
2
- * Read-only decoders for the schema evidence of Hosts older than beta.127: MessagePack
3
- * installation v1 (`application/vnd.astrale.schema-installation.v1+msgpack`) and introspection v2
4
- * (`application/vnd.astrale.schema-introspection.v2+msgpack`). Each decodes its bytes into the same
5
- * wire value as the canonical JSON evidence and admits it with the canonical checks, so it returns
6
- * exactly the canonical `InstallResult` and introspection results. Nothing here encodes: Servers
7
- * emit only the canonical JSON evidence.
8
- *
9
- * @deprecated Use `installation.decode` / `installation.introspection.decode` with their
10
- * `MEDIA_TYPE`, the JSON evidence every Host from beta.127 serves.
11
- *
12
- * Short-term consumers, all through `@astrale-os/kernel-client` `SchemaApi`, which selects these
13
- * decoders by the received media type:
14
- * - Admin managing the 1Pact Host (Kernel beta.117) and the astrale Hosts on beta.121 and beta.126
15
- * (`schema.inspect` before every Manager call, child `install`/`inspect`, `bundle` reads);
16
- * - the CLI used by 1Pact developers, and `adapter-astrale` 0.5.0-beta.148, which runs
17
- * `astrale introspect` before every 1Pact deploy (`introspect`, `view`,
18
- * `domain install --direct`, cold-cache `call`);
19
- * - the Console back-office (`schema.bundle` of every installed Domain);
20
- * - SDK Project tooling (`pnpm dev`, the Environment installation reconcile), which runs
21
- * `astrale introspect` and `astrale domain install --direct` through that same CLI against our
22
- * beta.121 and beta.126 Hosts.
23
- *
24
- * Removal, in a separate breaking release: once no supported Host is older than beta.127 (the
25
- * 1Pact Host upgraded; astrale-01, shared-01 and admin-users replaced or upgraded). Then delete, in
26
- * the same PR:
27
- * - this folder with its tests, golden evidence and laws, its `legacy/` entry in
28
- * `../.spec/layout.ts`, and the `./schema/installation/legacy` subpaths (source and `dist`) of
29
- * `protocol/package.json` with the `schema/installation/legacy/**` include of
30
- * `protocol/tsconfig.json`;
31
- * - the legacy media-type branches of `client/schema/schema.ts` and
32
- * `client/schema/introspection.ts`, and `client/schema/__tests__/legacy-evidence.test.ts`;
33
- * - the legacy paragraphs of `client/schema/.spec/architecture.md` and
34
- * `../.spec/architecture.md`;
35
- * - the package-private exports of `../codec.ts` (`accept`) and `../introspection/codec.ts`
36
- * (`acceptEvidence`, `admitLimits`, `admitRequest`), which return to module scope.
37
- */
38
- export { MEDIA_TYPE, decode } from './installation.js';
39
- export * as introspection from './introspection.js';
@@ -1,9 +0,0 @@
1
- import type { InstallResult } from '../result.js';
2
- /** @deprecated Read-only: Hosts older than beta.127 serve this; current Hosts serve `installation.MEDIA_TYPE`. */
3
- export declare const MEDIA_TYPE: 'application/vnd.astrale.schema-installation.v1+msgpack';
4
- /**
5
- * Decode version-one (MessagePack) installation evidence into the canonical result.
6
- *
7
- * @deprecated Read-only; use `installation.decode` with `installation.MEDIA_TYPE`.
8
- */
9
- export declare function decode(bytes: Uint8Array, maximumBytes: number): Promise<InstallResult>;
@@ -1,28 +0,0 @@
1
- import { accept as acceptValue, defaultLimits } from '@astrale-os/kernel-dsl/value';
2
- import { accept } from '../codec.js';
3
- import { decode as decodeMessagePack } from './msgpack.js';
4
- /** @deprecated Read-only: Hosts older than beta.127 serve this; current Hosts serve `installation.MEDIA_TYPE`. */
5
- export const MEDIA_TYPE = 'application/vnd.astrale.schema-installation.v1+msgpack';
6
- /**
7
- * Decode version-one (MessagePack) installation evidence into the canonical result.
8
- *
9
- * @deprecated Read-only; use `installation.decode` with `installation.MEDIA_TYPE`.
10
- */
11
- export async function decode(bytes, maximumBytes) {
12
- if (!(bytes instanceof Uint8Array) ||
13
- !Number.isSafeInteger(maximumBytes) ||
14
- maximumBytes < 1 ||
15
- bytes.byteLength > maximumBytes) {
16
- throw new TypeError('Schema installation evidence is invalid or exceeds its bound.');
17
- }
18
- let value;
19
- try {
20
- value = acceptValue(decodeMessagePack(bytes, defaultLimits.maxDepth), {
21
- limits: { maxBytes: maximumBytes },
22
- });
23
- }
24
- catch (cause) {
25
- throw new TypeError('Schema installation evidence is malformed.', { cause });
26
- }
27
- return accept(value);
28
- }