@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,10 +0,0 @@
1
- import type { introspection } from '@astrale-os/kernel-core/schema';
2
- import type { Limits, ResultFor } from '../introspection/result.js';
3
- /** @deprecated Read-only: Hosts older than beta.127 serve this; current Hosts serve `introspection.MEDIA_TYPE`. */
4
- export declare const MEDIA_TYPE: 'application/vnd.astrale.schema-introspection.v2+msgpack';
5
- /**
6
- * Decode version-two (MessagePack) introspection evidence into the canonical result.
7
- *
8
- * @deprecated Read-only; use `introspection.decode` with `introspection.MEDIA_TYPE`.
9
- */
10
- export declare function decode<Input extends introspection.Introspection>(input: Input, bytes: Uint8Array, limits: Limits): Promise<ResultFor<Input>>;
@@ -1,70 +0,0 @@
1
- import { accept as acceptValue, defaultLimits } from '@astrale-os/kernel-dsl/value';
2
- import { acceptEvidence, admitLimits, admitRequest } from '../introspection/codec.js';
3
- import { decode as decodeMessagePack } from './msgpack.js';
4
- /** @deprecated Read-only: Hosts older than beta.127 serve this; current Hosts serve `introspection.MEDIA_TYPE`. */
5
- export const MEDIA_TYPE = 'application/vnd.astrale.schema-introspection.v2+msgpack';
6
- const utf8 = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
7
- /**
8
- * Decode version-two (MessagePack) introspection evidence into the canonical result.
9
- *
10
- * @deprecated Read-only; use `introspection.decode` with `introspection.MEDIA_TYPE`.
11
- */
12
- export async function decode(input, bytes, limits) {
13
- const request = admitRequest(input);
14
- if (!(bytes instanceof Uint8Array))
15
- invalid('Schema introspection evidence must be binary.');
16
- admitLimits(request, limits);
17
- // Version two carried the Bundle as raw bytes: no escaping allowance.
18
- const maximumEvidenceBytes = limits.maximumPublicationBytes +
19
- (request.kind === 'bundle' ? limits.maximumBundleBytes : 0) +
20
- 4_096;
21
- if (bytes.byteLength > maximumEvidenceBytes) {
22
- invalid('Schema introspection evidence exceeds its declared bounds.');
23
- }
24
- let wire;
25
- try {
26
- wire = decodeMessagePack(bytes, defaultLimits.maxDepth);
27
- }
28
- catch (cause) {
29
- throw new TypeError('Schema introspection evidence is malformed.', { cause });
30
- }
31
- if (request.kind === 'bundle')
32
- wire = bundleAsText(wire);
33
- let decoded;
34
- try {
35
- decoded = acceptValue(wire, {
36
- limits: {
37
- maxBytes: maximumEvidenceBytes,
38
- ...(request.kind === 'bundle' ? { maxStringBytes: limits.maximumBundleBytes } : {}),
39
- },
40
- });
41
- }
42
- catch (cause) {
43
- throw new TypeError('Schema introspection evidence is malformed.', { cause });
44
- }
45
- return acceptEvidence(request, decoded, limits);
46
- }
47
- /**
48
- * Version two carried the Bundle as the UTF-8 bytes of its canonical JSON; the current wire value
49
- * carries that JSON as text. Translate only that field; every other check stays canonical.
50
- */
51
- function bundleAsText(wire) {
52
- if (wire === null || typeof wire !== 'object' || Array.isArray(wire))
53
- return wire;
54
- if (!Object.hasOwn(wire, 'bundle'))
55
- return wire;
56
- const { bundle } = wire;
57
- if (!(bundle instanceof Uint8Array))
58
- invalid('Bundle evidence is invalid or exceeds its bound.');
59
- let text;
60
- try {
61
- text = utf8.decode(bundle);
62
- }
63
- catch (cause) {
64
- throw new TypeError('Installed Domain Bundle is invalid.', { cause });
65
- }
66
- return { ...wire, bundle: text };
67
- }
68
- function invalid(message) {
69
- throw new TypeError(message);
70
- }
@@ -1 +0,0 @@
1
- export declare function decode(bytes: Uint8Array, maximumDepth: number): unknown;
@@ -1,143 +0,0 @@
1
- /**
2
- * Frozen, read-only MessagePack decoder for the schema evidence of Hosts older than beta.127.
3
- *
4
- * It reads the families that msgpackr 2.0.5 `pack` (`useRecords: false`) wrote for that evidence:
5
- * nil, booleans, integers, floats, strings, binary, arrays and string-keyed maps. Extension types
6
- * (msgpackr records and `undefined`, timestamps, structured clones) never occur in it and are
7
- * rejected, as are truncated input, trailing bytes, invalid UTF-8, non-string or duplicate map keys,
8
- * integers outside the safe range, and nesting deeper than `maximumDepth`. It never encodes.
9
- */
10
- const utf8 = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
11
- export function decode(bytes, maximumDepth) {
12
- const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
13
- let position = 0;
14
- const take = (length) => {
15
- if (length > bytes.byteLength - position)
16
- malformed('is truncated');
17
- const start = position;
18
- position += length;
19
- return start;
20
- };
21
- const u8 = () => bytes[take(1)];
22
- const u16 = () => view.getUint16(take(2));
23
- const u32 = () => view.getUint32(take(4));
24
- const text = (length) => {
25
- const start = take(length);
26
- return utf8.decode(bytes.subarray(start, start + length));
27
- };
28
- const binary = (length) => {
29
- const start = take(length);
30
- return bytes.slice(start, start + length);
31
- };
32
- const entries = (count, width) => {
33
- // Every entry occupies at least one byte per item: refuse counts the input cannot hold.
34
- if (count * width > bytes.byteLength - position)
35
- malformed('declares more entries than it holds');
36
- };
37
- const nested = (depth) => {
38
- if (depth >= maximumDepth)
39
- malformed(`nests deeper than ${maximumDepth} containers`);
40
- return depth + 1;
41
- };
42
- const array = (count, depth) => {
43
- entries(count, 1);
44
- const output = [];
45
- for (let index = 0; index < count; index += 1)
46
- output.push(value(depth));
47
- return output;
48
- };
49
- const map = (count, depth) => {
50
- entries(count, 2);
51
- const output = {};
52
- for (let index = 0; index < count; index += 1) {
53
- const key = value(depth);
54
- if (typeof key !== 'string')
55
- malformed('has a non-string map key');
56
- if (Object.hasOwn(output, key))
57
- malformed('has a duplicate map key');
58
- Object.defineProperty(output, key, {
59
- value: value(depth),
60
- enumerable: true,
61
- writable: true,
62
- configurable: true,
63
- });
64
- }
65
- return output;
66
- };
67
- const integer = (input) => {
68
- const output = Number(input);
69
- if (!Number.isSafeInteger(output))
70
- malformed('holds an integer outside the safe range');
71
- return output;
72
- };
73
- function value(depth) {
74
- const head = u8();
75
- if (head <= 0x7f)
76
- return head;
77
- if (head >= 0xe0)
78
- return head - 0x100;
79
- if (head <= 0x8f)
80
- return map(head & 0x0f, nested(depth));
81
- if (head <= 0x9f)
82
- return array(head & 0x0f, nested(depth));
83
- if (head <= 0xbf)
84
- return text(head & 0x1f);
85
- switch (head) {
86
- case 0xc0:
87
- return null;
88
- case 0xc2:
89
- return false;
90
- case 0xc3:
91
- return true;
92
- case 0xc4:
93
- return binary(u8());
94
- case 0xc5:
95
- return binary(u16());
96
- case 0xc6:
97
- return binary(u32());
98
- case 0xca:
99
- return view.getFloat32(take(4));
100
- case 0xcb:
101
- return view.getFloat64(take(8));
102
- case 0xcc:
103
- return u8();
104
- case 0xcd:
105
- return u16();
106
- case 0xce:
107
- return u32();
108
- case 0xcf:
109
- return integer(view.getBigUint64(take(8)));
110
- case 0xd0:
111
- return view.getInt8(take(1));
112
- case 0xd1:
113
- return view.getInt16(take(2));
114
- case 0xd2:
115
- return view.getInt32(take(4));
116
- case 0xd3:
117
- return integer(view.getBigInt64(take(8)));
118
- case 0xd9:
119
- return text(u8());
120
- case 0xda:
121
- return text(u16());
122
- case 0xdb:
123
- return text(u32());
124
- case 0xdc:
125
- return array(u16(), nested(depth));
126
- case 0xdd:
127
- return array(u32(), nested(depth));
128
- case 0xde:
129
- return map(u16(), nested(depth));
130
- case 0xdf:
131
- return map(u32(), nested(depth));
132
- default:
133
- return malformed(`uses the unsupported type 0x${head.toString(16)}`);
134
- }
135
- }
136
- const output = value(0);
137
- if (position !== bytes.byteLength)
138
- malformed('has trailing bytes');
139
- return output;
140
- }
141
- function malformed(reason) {
142
- throw new TypeError(`MessagePack evidence ${reason}.`);
143
- }