@astrale-os/kernel-server 0.5.0-beta.5 → 0.5.0-beta.50

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 (185) hide show
  1. package/dist/capture.d.ts +0 -1
  2. package/dist/capture.js +0 -1
  3. package/dist/cors/cors.d.ts +0 -1
  4. package/dist/cors/cors.js +2 -1
  5. package/dist/cors/index.d.ts +0 -1
  6. package/dist/cors/index.js +0 -1
  7. package/dist/cors/types.d.ts +0 -1
  8. package/dist/cors/types.js +0 -1
  9. package/dist/errors/availability.d.ts +0 -1
  10. package/dist/errors/availability.js +0 -1
  11. package/dist/errors/classify.d.ts +0 -1
  12. package/dist/errors/classify.js +0 -1
  13. package/dist/errors/index.d.ts +0 -1
  14. package/dist/errors/index.js +0 -1
  15. package/dist/errors/request-body.d.ts +0 -1
  16. package/dist/errors/request-body.js +0 -1
  17. package/dist/errors/response-body.d.ts +0 -1
  18. package/dist/errors/response-body.js +0 -1
  19. package/dist/index.d.ts +0 -1
  20. package/dist/index.js +0 -1
  21. package/dist/invocation/context.d.ts +1 -2
  22. package/dist/invocation/context.js +0 -1
  23. package/dist/invocation/identity.d.ts +1 -2
  24. package/dist/invocation/identity.js +1 -2
  25. package/dist/invocation/index.d.ts +0 -1
  26. package/dist/invocation/index.js +0 -1
  27. package/dist/invocation/publication-route.d.ts +1 -4
  28. package/dist/invocation/publication-route.js +2 -12
  29. package/dist/invocation/types.d.ts +3 -4
  30. package/dist/invocation/types.js +0 -1
  31. package/dist/issuer/exchange.d.ts +0 -1
  32. package/dist/issuer/exchange.js +9 -1
  33. package/dist/issuer/index.d.ts +0 -1
  34. package/dist/issuer/index.js +0 -1
  35. package/dist/issuer/routes.d.ts +0 -1
  36. package/dist/issuer/routes.js +0 -1
  37. package/dist/issuer/types.d.ts +0 -1
  38. package/dist/issuer/types.js +0 -1
  39. package/dist/lifecycle/active.d.ts +2 -1
  40. package/dist/lifecycle/active.js +5 -3
  41. package/dist/lifecycle/index.d.ts +0 -1
  42. package/dist/lifecycle/index.js +0 -1
  43. package/dist/publication/delivery/handler.d.ts +0 -1
  44. package/dist/publication/delivery/handler.js +2 -2
  45. package/dist/publication/delivery/index.d.ts +0 -1
  46. package/dist/publication/delivery/index.js +0 -1
  47. package/dist/publication/delivery/types.d.ts +1 -2
  48. package/dist/publication/delivery/types.js +0 -1
  49. package/dist/publication/index.d.ts +0 -1
  50. package/dist/publication/index.js +0 -1
  51. package/dist/publication/snapshot.d.ts +4 -4
  52. package/dist/publication/snapshot.js +6 -8
  53. package/dist/publication/table.d.ts +4 -4
  54. package/dist/publication/table.js +3 -4
  55. package/dist/publication/types.d.ts +4 -5
  56. package/dist/publication/types.js +0 -1
  57. package/dist/routes/index.d.ts +0 -1
  58. package/dist/routes/index.js +0 -1
  59. package/dist/routes/routes.d.ts +0 -1
  60. package/dist/routes/routes.js +68 -4
  61. package/dist/server.d.ts +0 -1
  62. package/dist/server.js +1 -2
  63. package/dist/transport/body.d.ts +0 -1
  64. package/dist/transport/body.js +0 -1
  65. package/dist/transport/codecs.d.ts +0 -1
  66. package/dist/transport/codecs.js +0 -1
  67. package/dist/transport/credential.d.ts +0 -1
  68. package/dist/transport/credential.js +0 -1
  69. package/dist/transport/http/handler.d.ts +0 -1
  70. package/dist/transport/http/handler.js +0 -1
  71. package/dist/transport/http/index.d.ts +0 -1
  72. package/dist/transport/http/index.js +0 -1
  73. package/dist/transport/http/render.d.ts +5 -4
  74. package/dist/transport/http/render.js +70 -2
  75. package/dist/transport/index.d.ts +0 -1
  76. package/dist/transport/index.js +0 -1
  77. package/dist/transport/router.d.ts +0 -1
  78. package/dist/transport/router.js +0 -1
  79. package/dist/transport/stream-error.d.ts +0 -1
  80. package/dist/transport/stream-error.js +0 -1
  81. package/dist/transport/types.d.ts +1 -2
  82. package/dist/transport/types.js +0 -1
  83. package/dist/transport/websocket/index.d.ts +0 -1
  84. package/dist/transport/websocket/index.js +0 -1
  85. package/dist/transport/websocket/session.d.ts +0 -1
  86. package/dist/transport/websocket/session.js +12 -2
  87. package/dist/transport/websocket/upgrade.d.ts +0 -1
  88. package/dist/transport/websocket/upgrade.js +0 -1
  89. package/dist/types.d.ts +1 -2
  90. package/dist/types.js +0 -1
  91. package/package.json +10 -12
  92. package/dist/capture.d.ts.map +0 -1
  93. package/dist/capture.js.map +0 -1
  94. package/dist/cors/cors.d.ts.map +0 -1
  95. package/dist/cors/cors.js.map +0 -1
  96. package/dist/cors/index.d.ts.map +0 -1
  97. package/dist/cors/index.js.map +0 -1
  98. package/dist/cors/types.d.ts.map +0 -1
  99. package/dist/cors/types.js.map +0 -1
  100. package/dist/errors/availability.d.ts.map +0 -1
  101. package/dist/errors/availability.js.map +0 -1
  102. package/dist/errors/classify.d.ts.map +0 -1
  103. package/dist/errors/classify.js.map +0 -1
  104. package/dist/errors/index.d.ts.map +0 -1
  105. package/dist/errors/index.js.map +0 -1
  106. package/dist/errors/request-body.d.ts.map +0 -1
  107. package/dist/errors/request-body.js.map +0 -1
  108. package/dist/errors/response-body.d.ts.map +0 -1
  109. package/dist/errors/response-body.js.map +0 -1
  110. package/dist/index.d.ts.map +0 -1
  111. package/dist/index.js.map +0 -1
  112. package/dist/invocation/context.d.ts.map +0 -1
  113. package/dist/invocation/context.js.map +0 -1
  114. package/dist/invocation/identity.d.ts.map +0 -1
  115. package/dist/invocation/identity.js.map +0 -1
  116. package/dist/invocation/index.d.ts.map +0 -1
  117. package/dist/invocation/index.js.map +0 -1
  118. package/dist/invocation/publication-route.d.ts.map +0 -1
  119. package/dist/invocation/publication-route.js.map +0 -1
  120. package/dist/invocation/types.d.ts.map +0 -1
  121. package/dist/invocation/types.js.map +0 -1
  122. package/dist/issuer/exchange.d.ts.map +0 -1
  123. package/dist/issuer/exchange.js.map +0 -1
  124. package/dist/issuer/index.d.ts.map +0 -1
  125. package/dist/issuer/index.js.map +0 -1
  126. package/dist/issuer/routes.d.ts.map +0 -1
  127. package/dist/issuer/routes.js.map +0 -1
  128. package/dist/issuer/types.d.ts.map +0 -1
  129. package/dist/issuer/types.js.map +0 -1
  130. package/dist/lifecycle/active.d.ts.map +0 -1
  131. package/dist/lifecycle/active.js.map +0 -1
  132. package/dist/lifecycle/index.d.ts.map +0 -1
  133. package/dist/lifecycle/index.js.map +0 -1
  134. package/dist/publication/delivery/handler.d.ts.map +0 -1
  135. package/dist/publication/delivery/handler.js.map +0 -1
  136. package/dist/publication/delivery/index.d.ts.map +0 -1
  137. package/dist/publication/delivery/index.js.map +0 -1
  138. package/dist/publication/delivery/types.d.ts.map +0 -1
  139. package/dist/publication/delivery/types.js.map +0 -1
  140. package/dist/publication/index.d.ts.map +0 -1
  141. package/dist/publication/index.js.map +0 -1
  142. package/dist/publication/snapshot.d.ts.map +0 -1
  143. package/dist/publication/snapshot.js.map +0 -1
  144. package/dist/publication/table.d.ts.map +0 -1
  145. package/dist/publication/table.js.map +0 -1
  146. package/dist/publication/types.d.ts.map +0 -1
  147. package/dist/publication/types.js.map +0 -1
  148. package/dist/publication/validator.d.ts +0 -4
  149. package/dist/publication/validator.d.ts.map +0 -1
  150. package/dist/publication/validator.js +0 -17
  151. package/dist/publication/validator.js.map +0 -1
  152. package/dist/routes/index.d.ts.map +0 -1
  153. package/dist/routes/index.js.map +0 -1
  154. package/dist/routes/routes.d.ts.map +0 -1
  155. package/dist/routes/routes.js.map +0 -1
  156. package/dist/server.d.ts.map +0 -1
  157. package/dist/server.js.map +0 -1
  158. package/dist/transport/body.d.ts.map +0 -1
  159. package/dist/transport/body.js.map +0 -1
  160. package/dist/transport/codecs.d.ts.map +0 -1
  161. package/dist/transport/codecs.js.map +0 -1
  162. package/dist/transport/credential.d.ts.map +0 -1
  163. package/dist/transport/credential.js.map +0 -1
  164. package/dist/transport/http/handler.d.ts.map +0 -1
  165. package/dist/transport/http/handler.js.map +0 -1
  166. package/dist/transport/http/index.d.ts.map +0 -1
  167. package/dist/transport/http/index.js.map +0 -1
  168. package/dist/transport/http/render.d.ts.map +0 -1
  169. package/dist/transport/http/render.js.map +0 -1
  170. package/dist/transport/index.d.ts.map +0 -1
  171. package/dist/transport/index.js.map +0 -1
  172. package/dist/transport/router.d.ts.map +0 -1
  173. package/dist/transport/router.js.map +0 -1
  174. package/dist/transport/stream-error.d.ts.map +0 -1
  175. package/dist/transport/stream-error.js.map +0 -1
  176. package/dist/transport/types.d.ts.map +0 -1
  177. package/dist/transport/types.js.map +0 -1
  178. package/dist/transport/websocket/index.d.ts.map +0 -1
  179. package/dist/transport/websocket/index.js.map +0 -1
  180. package/dist/transport/websocket/session.d.ts.map +0 -1
  181. package/dist/transport/websocket/session.js.map +0 -1
  182. package/dist/transport/websocket/upgrade.d.ts.map +0 -1
  183. package/dist/transport/websocket/upgrade.js.map +0 -1
  184. package/dist/types.d.ts.map +0 -1
  185. package/dist/types.js.map +0 -1
package/dist/capture.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  /** Capture one receiver-bound method while preserving the capability's exact method type. */
2
2
  export declare function captureMethod<Receiver extends object, Name extends keyof Receiver>(input: Receiver, name: Name, invalidMessage: string): Receiver[Name];
3
- //# sourceMappingURL=capture.d.ts.map
package/dist/capture.js CHANGED
@@ -7,4 +7,3 @@ export function captureMethod(input, name, invalidMessage) {
7
7
  throw new TypeError(invalidMessage);
8
8
  return method.bind(input);
9
9
  }
10
- //# sourceMappingURL=capture.js.map
@@ -19,4 +19,3 @@ export interface CorsPolicy {
19
19
  }
20
20
  /** Admit one immutable policy. `false` delegates the complete concern to an outer application. */
21
21
  export declare function prepareCors(input: CorsConfig | false | undefined): CorsPolicy;
22
- //# sourceMappingURL=cors.d.ts.map
package/dist/cors/cors.js CHANGED
@@ -1,5 +1,6 @@
1
1
  /** Request-aware CORS admission shared by every Server-owned HTTP surface. */
2
2
  const TOKEN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u;
3
+ const PREFLIGHT_MAX_AGE_SECONDS = 24 * 60 * 60;
3
4
  /** Admit one immutable policy. `false` delegates the complete concern to an outer application. */
4
5
  export function prepareCors(input) {
5
6
  if (input === false)
@@ -64,6 +65,7 @@ export function prepareCors(input) {
64
65
  const allowedHeaders = requestedHeaders.length > 0 ? requestedHeaders : [...routeHeaders];
65
66
  const output = new Headers(response(request));
66
67
  output.set('access-control-allow-methods', [...allowedMethods, 'OPTIONS'].join(', '));
68
+ output.set('access-control-max-age', String(PREFLIGHT_MAX_AGE_SECONDS));
67
69
  if (allowedHeaders.length > 0) {
68
70
  output.set('access-control-allow-headers', allowedHeaders.join(', '));
69
71
  }
@@ -133,4 +135,3 @@ function appendVary(headers, value) {
133
135
  names.add(value);
134
136
  headers.set('vary', [...names].join(', '));
135
137
  }
136
- //# sourceMappingURL=cors.js.map
@@ -1,3 +1,2 @@
1
1
  export { prepareCors, type CorsPolicy, type CorsRoute } from './cors.js';
2
2
  export type { CorsConfig } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { prepareCors } from './cors.js';
2
- //# sourceMappingURL=index.js.map
@@ -9,4 +9,3 @@ export interface CorsConfig {
9
9
  /** Emit Access-Control-Allow-Credentials; requires one explicit origin rather than `*`. */
10
10
  readonly credentials?: boolean;
11
11
  }
12
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -8,4 +8,3 @@ export declare class IssuerKeysUnavailableError extends Error {
8
8
  readonly name = "IssuerKeysUnavailableError";
9
9
  constructor(message?: string, options?: ErrorOptions);
10
10
  }
11
- //# sourceMappingURL=availability.d.ts.map
@@ -12,4 +12,3 @@ export class IssuerKeysUnavailableError extends Error {
12
12
  super(message, options);
13
13
  }
14
14
  }
15
- //# sourceMappingURL=availability.js.map
@@ -1,4 +1,3 @@
1
1
  import * as errors from '@astrale-os/kernel-protocol/errors';
2
2
  /** Convert only errors owned by an admitted Server or Protocol boundary into safe public data. */
3
3
  export declare function classifyError(input: unknown): errors.ErrorPayload;
4
- //# sourceMappingURL=classify.d.ts.map
@@ -39,4 +39,3 @@ function reportInternal(input) {
39
39
  code: stableCode(input),
40
40
  });
41
41
  }
42
- //# sourceMappingURL=classify.js.map
@@ -2,4 +2,3 @@ export { DeliveryUnavailableError, IssuerKeysUnavailableError } from './availabi
2
2
  export { classifyError } from './classify.js';
3
3
  export { RequestBodyInvalidError, RequestBodyTooLargeError } from './request-body.js';
4
4
  export { ResponseBodyTooLargeError } from './response-body.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@ export { DeliveryUnavailableError, IssuerKeysUnavailableError } from './availabi
2
2
  export { classifyError } from './classify.js';
3
3
  export { RequestBodyInvalidError, RequestBodyTooLargeError } from './request-body.js';
4
4
  export { ResponseBodyTooLargeError } from './response-body.js';
5
- //# sourceMappingURL=index.js.map
@@ -5,4 +5,3 @@ export declare class RequestBodyTooLargeError extends Error {
5
5
  export declare class RequestBodyInvalidError extends Error {
6
6
  constructor(message: string);
7
7
  }
8
- //# sourceMappingURL=request-body.d.ts.map
@@ -12,4 +12,3 @@ export class RequestBodyInvalidError extends Error {
12
12
  this.name = 'RequestBodyInvalidError';
13
13
  }
14
14
  }
15
- //# sourceMappingURL=request-body.js.map
@@ -2,4 +2,3 @@ export declare class ResponseBodyTooLargeError extends Error {
2
2
  readonly maximumBytes: number;
3
3
  constructor(maximumBytes: number);
4
4
  }
5
- //# sourceMappingURL=response-body.d.ts.map
@@ -6,4 +6,3 @@ export class ResponseBodyTooLargeError extends Error {
6
6
  this.name = 'ResponseBodyTooLargeError';
7
7
  }
8
8
  }
9
- //# sourceMappingURL=response-body.js.map
package/dist/index.d.ts CHANGED
@@ -3,4 +3,3 @@ export { DeliveryUnavailableError, IssuerKeysUnavailableError } from './errors/i
3
3
  export { preparePublicationSnapshot } from './publication/index.js';
4
4
  export * as publication from './publication/index.js';
5
5
  export type { Application, ApplicationHost, CorsConfig, ExecutionControl, Handler, HandlerRequest, HandlerResult, HandlerStream, HealthProbe, InvocationContext, InvocationSource, RequestBackground, RequestEvidence, RequestSleep, Issuer, exchange, PreparedServer, PublicationSnapshot, PublicationSnapshotInput, PublicationSource, Server, ServerCloseOptions, ServerConfig, ServerLimits, ServerOptions, WebSocketAdapter, WebSocketHandlers, WebSocketLike, WebSocketUpgradeOptions, } from './types.js';
6
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -2,4 +2,3 @@ export { createServer, prepareServer } from './server.js';
2
2
  export { DeliveryUnavailableError, IssuerKeysUnavailableError } from './errors/index.js';
3
3
  export { preparePublicationSnapshot } from './publication/index.js';
4
4
  export * as publication from './publication/index.js';
5
- //# sourceMappingURL=index.js.map
@@ -1,7 +1,6 @@
1
- import type { invocation as protocol } from '@astrale-os/kernel-protocol';
1
+ import type * as protocol from '@astrale-os/kernel-protocol/invocation';
2
2
  import type { ActiveOperation, ActiveOperations } from '../lifecycle/index.js';
3
3
  import type { ApplicationHost, InvocationContext } from './types.js';
4
4
  export declare function invocationContext(assigned: protocol.InvocationId, operation: ActiveOperation, active: ActiveOperations, host?: ApplicationHost, requestBody?: Uint8Array, idempotencyKey?: protocol.IdempotencyKey): InvocationContext;
5
5
  /** Default non-durable timer used when the application host supplies no timer capability. */
6
6
  export declare function defaultSleep(durationMs: number): Promise<void>;
7
- //# sourceMappingURL=context.d.ts.map
@@ -58,4 +58,3 @@ function sleepDuration(input) {
58
58
  }
59
59
  return input;
60
60
  }
61
- //# sourceMappingURL=context.js.map
@@ -1,5 +1,5 @@
1
1
  import type { IssuerId } from '@astrale-os/kernel-core/auth';
2
- import type { invocation as protocol } from '@astrale-os/kernel-protocol';
2
+ import type * as protocol from '@astrale-os/kernel-protocol/invocation';
3
3
  /** Injected source-owned identity allocator captured before Server readiness. */
4
4
  export interface InvocationSource {
5
5
  readonly source: IssuerId;
@@ -7,4 +7,3 @@ export interface InvocationSource {
7
7
  }
8
8
  export type NextInvocationId = () => protocol.InvocationId;
9
9
  export declare function captureInvocationSource(input: InvocationSource): NextInvocationId;
10
- //# sourceMappingURL=identity.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { issuer } from '@astrale-os/kernel-core/auth';
2
- import { invocation as protocolInvocation } from '@astrale-os/kernel-protocol';
2
+ import * as protocolInvocation from '@astrale-os/kernel-protocol/invocation';
3
3
  import { captureMethod } from '../capture.js';
4
4
  export function captureInvocationSource(input) {
5
5
  if (input === null || typeof input !== 'object') {
@@ -9,4 +9,3 @@ export function captureInvocationSource(input) {
9
9
  const next = captureMethod(input, 'next', 'Server Invocation source is invalid.');
10
10
  return () => protocolInvocation.acceptInvocationId({ source, id: next() });
11
11
  }
12
- //# sourceMappingURL=identity.js.map
@@ -2,4 +2,3 @@ export { defaultSleep, invocationContext } from './context.js';
2
2
  export { captureInvocationSource, type InvocationSource, type NextInvocationId, } from './identity.js';
3
3
  export { publicationRouteDecision, type PublicationRouteDecision } from './publication-route.js';
4
4
  export type { ApplicationHost, ExecutionControl, Handler, HandlerRequest, HandlerResult, HandlerStream, InvocationContext, RequestBackground, RequestEvidence, RequestSleep, } from './types.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export { defaultSleep, invocationContext } from './context.js';
2
2
  export { captureInvocationSource, } from './identity.js';
3
3
  export { publicationRouteDecision } from './publication-route.js';
4
- //# sourceMappingURL=index.js.map
@@ -2,13 +2,10 @@ import type { ErrorPayload } from '@astrale-os/kernel-protocol/errors';
2
2
  import type { Publication } from '@astrale-os/kernel-protocol/publication/publication';
3
3
  import type { PublicationRef } from '@astrale-os/kernel-protocol/publication/reference';
4
4
  export type PublicationRouteDecision = {
5
- readonly kind: 'exact';
6
- } | {
7
- readonly kind: 'same-schema';
5
+ readonly kind: 'admitted';
8
6
  } | {
9
7
  readonly kind: 'rejected';
10
8
  readonly error: ErrorPayload;
11
9
  };
12
10
  /** Compare untrusted installed routing evidence with the one captured serving Publication. */
13
11
  export declare function publicationRouteDecision(current: Publication, installed: PublicationRef): PublicationRouteDecision;
14
- //# sourceMappingURL=publication-route.d.ts.map
@@ -1,22 +1,13 @@
1
1
  import { CODES } from '@astrale-os/kernel-protocol/errors';
2
- import { SCHEMA_UPGRADE_REQUIRED, SERVICE_TRUST_REQUIRED, } from '@astrale-os/kernel-protocol/invocation/service-reason';
2
+ import { SERVICE_TRUST_REQUIRED } from '@astrale-os/kernel-protocol/invocation/service-reason';
3
3
  import { compareReference } from '@astrale-os/kernel-protocol/publication/reference';
4
4
  /** Compare untrusted installed routing evidence with the one captured serving Publication. */
5
5
  export function publicationRouteDecision(current, installed) {
6
6
  switch (compareReference(current, installed)) {
7
7
  case 'exact':
8
- return Object.freeze({ kind: 'exact' });
9
8
  case 'same-schema':
10
- return Object.freeze({ kind: 'same-schema' });
11
9
  case 'schema-drift':
12
- return rejected('Installed Domain schema requires an explicit upgrade.', Object.freeze({
13
- code: SCHEMA_UPGRADE_REQUIRED,
14
- details: Object.freeze({
15
- origin: installed.origin,
16
- installedRevision: installed.revision,
17
- candidateRevision: current.schema.revision,
18
- }),
19
- }));
10
+ return Object.freeze({ kind: 'admitted' });
20
11
  case 'identity-drift':
21
12
  return rejected('Installed Domain Service identity requires explicit trust.', Object.freeze({
22
13
  code: SERVICE_TRUST_REQUIRED,
@@ -42,4 +33,3 @@ function rejected(message, data) {
42
33
  error: Object.freeze({ code: CODES.CONFLICT, message, data }),
43
34
  });
44
35
  }
45
- //# sourceMappingURL=publication-route.js.map
@@ -1,7 +1,7 @@
1
1
  import type { CredentialInput } from '@astrale-os/kernel-core/auth';
2
- import type { CallableResult } from '@astrale-os/kernel-core/domain';
2
+ import type { CallableResult } from '@astrale-os/kernel-core/callable';
3
3
  import type { Value } from '@astrale-os/kernel-dsl/value';
4
- import type { invocation as protocol } from '@astrale-os/kernel-protocol';
4
+ import type * as protocol from '@astrale-os/kernel-protocol/invocation';
5
5
  import type { PublicationSnapshot } from '../publication/index.js';
6
6
  /** Optional platform retention and timer adaptation for one Fetch invocation. */
7
7
  export interface ApplicationHost {
@@ -49,7 +49,7 @@ export interface HandlerRequest {
49
49
  readonly credential?: CredentialInput;
50
50
  /** Source-only effective delegation forwarded unchanged to Runtime. */
51
51
  readonly delegate?: protocol.Delegate;
52
- /** Destination routing witness forwarded after exact or same-schema Server admission. */
52
+ /** Destination routing witness forwarded after same-origin, same-identity Server admission. */
53
53
  readonly via?: protocol.Via;
54
54
  /** Source-only local-target or remote-revision Schema Registration precondition. */
55
55
  readonly schema?: protocol.SchemaTarget;
@@ -60,4 +60,3 @@ export interface HandlerRequest {
60
60
  export interface Handler {
61
61
  dispatch(request: HandlerRequest): Promise<HandlerResult>;
62
62
  }
63
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -10,4 +10,3 @@ export interface Provider {
10
10
  }
11
11
  export declare function capture(input: Provider): Provider;
12
12
  export declare function mount(app: ServerRouter, issuer: string, provider: Provider, cors: CorsPolicy, active: ActiveOperations, timeoutMs: number): void;
13
- //# sourceMappingURL=exchange.d.ts.map
@@ -60,6 +60,11 @@ export function mount(app, issuer, provider, cors, active, timeoutMs) {
60
60
  }
61
61
  throw cause;
62
62
  }
63
+ if (operation.timedOut) {
64
+ return respond(error('DEADLINE_EXCEEDED', 'Token-exchange deadline elapsed.'));
65
+ }
66
+ if (operation.signal.aborted)
67
+ throw operation.signal.reason;
63
68
  let output;
64
69
  try {
65
70
  output = await provider.exchange(admitted, { signal: operation.signal });
@@ -68,6 +73,8 @@ export function mount(app, issuer, provider, cors, active, timeoutMs) {
68
73
  if (operation.timedOut) {
69
74
  return respond(error('DEADLINE_EXCEEDED', 'Token-exchange deadline elapsed.'));
70
75
  }
76
+ if (operation.signal.aborted)
77
+ throw operation.signal.reason;
71
78
  if (cause instanceof errors.ProtocolError && PROVIDER_CODES.has(cause.payload.code)) {
72
79
  return respond(exchangeProtocol.acceptErrorResponse({ error: cause.payload }));
73
80
  }
@@ -76,6 +83,8 @@ export function mount(app, issuer, provider, cors, active, timeoutMs) {
76
83
  if (operation.timedOut) {
77
84
  return respond(error('DEADLINE_EXCEEDED', 'Token-exchange deadline elapsed.'));
78
85
  }
86
+ if (operation.signal.aborted)
87
+ throw operation.signal.reason;
79
88
  const response = exchangeProtocol.acceptResponse(output);
80
89
  if (inspectCredential(response.token).claims.exp !== response.expiresAt) {
81
90
  throw new TypeError('Token-exchange provider returned inconsistent expiry evidence.');
@@ -134,4 +143,3 @@ function json(value, status, request, cors, extra) {
134
143
  }
135
144
  return new Response(JSON.stringify(value), { status, headers });
136
145
  }
137
- //# sourceMappingURL=exchange.js.map
@@ -1,4 +1,3 @@
1
1
  export { admitIssuer, issuerRouteReservations, mountIssuer, type IssuerRouteReservation, } from './routes.js';
2
2
  export type * as exchange from './exchange.js';
3
3
  export type { Issuer } from './types.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { admitIssuer, issuerRouteReservations, mountIssuer, } from './routes.js';
2
- //# sourceMappingURL=index.js.map
@@ -11,4 +11,3 @@ export declare function issuerRouteReservations(input: Issuer, tokenExchange?: b
11
11
  export declare function mountIssuer(app: ServerRouter, input: Issuer, cors: CorsPolicy, active: ActiveOperations, timeoutMs: number, tokenExchange?: Provider): void;
12
12
  /** Admit static discovery configuration before Runtime Boot performs any durable work. */
13
13
  export declare function admitIssuer(input: Issuer): Issuer;
14
- //# sourceMappingURL=routes.d.ts.map
@@ -147,4 +147,3 @@ export function admitIssuer(input) {
147
147
  }),
148
148
  });
149
149
  }
150
- //# sourceMappingURL=routes.js.map
@@ -9,4 +9,3 @@ export interface Issuer {
9
9
  /** Optional hosted-key discovery for issuers below `<issuer>/iss/:thumbprint`. */
10
10
  readonly loadIssuerPublicKeys?: (issuer: IssuerId, signal: AbortSignal) => Promise<readonly JsonWebKey[]>;
11
11
  }
12
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -26,6 +26,8 @@ export declare class ActiveOperations {
26
26
  private changed;
27
27
  constructor(maximumConcurrentOperations: number);
28
28
  get isAccepting(): boolean;
29
+ /** Whether a newly arriving operation can be admitted without semantic dispatch. */
30
+ get isAvailable(): boolean;
29
31
  begin(timeoutMs: number, externalSignal?: AbortSignal): ActiveOperation | undefined;
30
32
  attachSocket(socket: ActiveSocket): boolean;
31
33
  detachSocket(socket: ActiveSocket): void;
@@ -37,4 +39,3 @@ export declare class ActiveOperations {
37
39
  private closeSockets;
38
40
  }
39
41
  export {};
40
- //# sourceMappingURL=active.d.ts.map
@@ -13,10 +13,13 @@ export class ActiveOperations {
13
13
  get isAccepting() {
14
14
  return this.accepting;
15
15
  }
16
+ /** Whether a newly arriving operation can be admitted without semantic dispatch. */
17
+ get isAvailable() {
18
+ return this.accepting && this.operations.size < this.maximumConcurrentOperations;
19
+ }
16
20
  begin(timeoutMs, externalSignal) {
17
- if (!this.accepting || this.operations.size >= this.maximumConcurrentOperations) {
21
+ if (!this.isAvailable)
18
22
  return undefined;
19
- }
20
23
  const operation = new Operation(Date.now() + timeoutMs, () => {
21
24
  this.operations.delete(operation);
22
25
  this.changed?.();
@@ -197,4 +200,3 @@ async function settleCancellation(cancel, reason) {
197
200
  function abortReason(signal) {
198
201
  return signal.reason instanceof Error ? signal.reason.message : 'operation cancelled';
199
202
  }
200
- //# sourceMappingURL=active.js.map
@@ -1,2 +1 @@
1
1
  export { ActiveOperations, type ActiveOperation, type ActiveSocket } from './active.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { ActiveOperations } from './active.js';
2
- //# sourceMappingURL=index.js.map
@@ -7,4 +7,3 @@ export interface Limits {
7
7
  }
8
8
  /** Serve one delivery request against the exact Publication snapshot that selected its URL. */
9
9
  export declare function handleDelivery(request: Request, snapshot: PreparedPublicationSnapshot, provider: Provider | undefined, active: ActiveOperations, limits: Limits, cors: Readonly<Record<string, string>>): Promise<Response>;
10
- //# sourceMappingURL=handler.d.ts.map
@@ -1,4 +1,5 @@
1
- import { codecs, publication as protocolPublication } from '@astrale-os/kernel-protocol';
1
+ import * as codecs from '@astrale-os/kernel-protocol/codecs';
2
+ import * as protocolPublication from '@astrale-os/kernel-protocol/publication';
2
3
  import { DeliveryUnavailableError } from '../../errors/index.js';
3
4
  import { RequestBodyInvalidError, RequestBodyTooLargeError } from '../../errors/index.js';
4
5
  import { readBoundedBody } from '../../transport/index.js';
@@ -124,4 +125,3 @@ function encodedSize(input) {
124
125
  function toBody(input) {
125
126
  return input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);
126
127
  }
127
- //# sourceMappingURL=handler.js.map
@@ -1,3 +1,2 @@
1
1
  export { handleDelivery, type Limits } from './handler.js';
2
2
  export type { Context, Provider } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { handleDelivery } from './handler.js';
2
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { publication } from '@astrale-os/kernel-protocol';
1
+ import type * as publication from '@astrale-os/kernel-protocol/publication';
2
2
  export interface Context {
3
3
  /** Omitted for a public endpoint; otherwise the exact admitted retrieval credential. */
4
4
  readonly token?: publication.delivery.Token;
@@ -9,4 +9,3 @@ export interface Provider {
9
9
  /** Throw DeliveryUnavailableError only for an expected dependency outage. */
10
10
  create(request: publication.delivery.Request, context: Context): Promise<publication.delivery.Delivery>;
11
11
  }
12
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,4 +1,3 @@
1
1
  export { preparePublicationSnapshot, readPreparedPublicationSnapshot, type PreparedPublicationSnapshot, } from './snapshot.js';
2
2
  export type { PublicationSnapshot, PublicationSnapshotInput, PublicationSource } from './types.js';
3
3
  export * as delivery from './delivery/index.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { preparePublicationSnapshot, readPreparedPublicationSnapshot, } from './snapshot.js';
2
2
  export * as delivery from './delivery/index.js';
3
- //# sourceMappingURL=index.js.map
@@ -1,5 +1,6 @@
1
- import type { schema } from '@astrale-os/kernel-dsl/v1';
2
- import type { publication, routes } from '@astrale-os/kernel-protocol';
1
+ import type { Domain } from '@astrale-os/kernel-dsl/v1';
2
+ import type * as publication from '@astrale-os/kernel-protocol/publication';
3
+ import type * as routes from '@astrale-os/kernel-protocol/routes';
3
4
  import type { PublicationSnapshot, PublicationSnapshotInput } from './types.js';
4
5
  export interface PreparedPublicationSnapshot {
5
6
  readonly snapshot: PublicationSnapshot;
@@ -7,10 +8,9 @@ export interface PreparedPublicationSnapshot {
7
8
  readonly publicationBytes: Uint8Array;
8
9
  readonly bundle: Uint8Array;
9
10
  readonly table: routes.Table;
10
- readonly validator: schema.Validator;
11
+ readonly domain: Domain;
11
12
  }
12
13
  /** Admit and detach one revision-coherent serving snapshot before publication. */
13
14
  export declare function preparePublicationSnapshot(input: PublicationSnapshotInput): PublicationSnapshot;
14
15
  /** Internal proof that a PublicationSource returned a Server-prepared snapshot without cloning it. */
15
16
  export declare function readPreparedPublicationSnapshot(input: unknown): PreparedPublicationSnapshot | undefined;
16
- //# sourceMappingURL=snapshot.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { verifyBundleBytes } from '@astrale-os/kernel-protocol/publication/bundle-evidence';
2
2
  import { accept as acceptPublication, encode as encodePublication, } from '@astrale-os/kernel-protocol/publication/publication';
3
3
  import { admitTable } from './table.js';
4
- import { captureValidator } from './validator.js';
5
4
  const snapshots = new WeakMap();
6
5
  /** Admit and detach one revision-coherent serving snapshot before publication. */
7
6
  export function preparePublicationSnapshot(input) {
@@ -11,12 +10,12 @@ export function preparePublicationSnapshot(input) {
11
10
  const admittedPublication = acceptPublication(input.publication);
12
11
  const bundleBytes = new Uint8Array(input.bundle);
13
12
  verifyBundleBytes(admittedPublication, bundleBytes);
14
- const validator = captureValidator(input.validator);
15
- if (validator.origin !== admittedPublication.origin ||
16
- validator.revision !== admittedPublication.schema.revision) {
17
- throw new TypeError('Publication snapshot Validator identity differs from its Publication.');
13
+ const domain = input.domain;
14
+ if (domain.origin !== admittedPublication.origin ||
15
+ domain.revision !== admittedPublication.schema.revision) {
16
+ throw new TypeError('Publication snapshot Domain identity differs from its Publication.');
18
17
  }
19
- const table = admitTable(admittedPublication, input.table, validator);
18
+ const table = admitTable(admittedPublication, input.table, domain);
20
19
  const publicationBytes = encodePublication(admittedPublication);
21
20
  const snapshot = Object.freeze({ publication: admittedPublication });
22
21
  const prepared = Object.freeze({
@@ -25,7 +24,7 @@ export function preparePublicationSnapshot(input) {
25
24
  publicationBytes,
26
25
  bundle: bundleBytes,
27
26
  table,
28
- validator,
27
+ domain,
29
28
  });
30
29
  snapshots.set(snapshot, prepared);
31
30
  return snapshot;
@@ -36,4 +35,3 @@ export function readPreparedPublicationSnapshot(input) {
36
35
  return undefined;
37
36
  return snapshots.get(input);
38
37
  }
39
- //# sourceMappingURL=snapshot.js.map
@@ -1,4 +1,4 @@
1
- import type { schema } from '@astrale-os/kernel-dsl/v1';
2
- import type { publication, routes } from '@astrale-os/kernel-protocol';
3
- export declare function admitTable(deployed: publication.Publication, input: routes.Table | undefined, validator: schema.Validator): routes.Table;
4
- //# sourceMappingURL=table.d.ts.map
1
+ import type { Domain } from '@astrale-os/kernel-dsl/v1';
2
+ import type * as publication from '@astrale-os/kernel-protocol/publication';
3
+ import type * as routes from '@astrale-os/kernel-protocol/routes';
4
+ export declare function admitTable(deployed: publication.Publication, input: routes.Table | undefined, domain: Domain): routes.Table;
@@ -1,7 +1,7 @@
1
1
  import { reference } from '@astrale-os/kernel-protocol/publication/reference';
2
2
  import { acceptTable } from '@astrale-os/kernel-protocol/routes/admission';
3
3
  import { verifyTable } from '@astrale-os/kernel-protocol/routes/evidence';
4
- export function admitTable(deployed, input, validator) {
4
+ export function admitTable(deployed, input, domain) {
5
5
  if (input === undefined) {
6
6
  if (deployed.routes.length !== 0) {
7
7
  throw new TypeError('A Publication with native routes requires a Route Table.');
@@ -9,9 +9,8 @@ export function admitTable(deployed, input, validator) {
9
9
  return verifyTable(Object.freeze({
10
10
  publication: reference(deployed),
11
11
  entries: Object.freeze([]),
12
- }), deployed, validator);
12
+ }), deployed, domain);
13
13
  }
14
14
  const table = acceptTable(input);
15
- return verifyTable(table, deployed, validator);
15
+ return verifyTable(table, deployed, domain);
16
16
  }
17
- //# sourceMappingURL=table.js.map
@@ -1,13 +1,13 @@
1
- import type { schema } from '@astrale-os/kernel-dsl/v1';
2
- import type { publication } from '@astrale-os/kernel-protocol';
3
- import type { routes } from '@astrale-os/kernel-protocol';
1
+ import type { Domain } from '@astrale-os/kernel-dsl/v1';
2
+ import type * as publication from '@astrale-os/kernel-protocol/publication';
3
+ import type * as routes from '@astrale-os/kernel-protocol/routes';
4
4
  declare const PUBLICATION_SNAPSHOT: unique symbol;
5
5
  export interface PublicationSnapshotInput {
6
6
  readonly publication: publication.Publication;
7
7
  /** Exact artifact served at Publication.schema.bundle.href. */
8
8
  readonly bundle: Uint8Array;
9
9
  readonly table?: routes.Table;
10
- readonly validator: schema.Validator;
10
+ readonly domain: Domain;
11
11
  }
12
12
  /** Immutable admitted serving identity; bundle and compiled routes remain Server-private. */
13
13
  export interface PublicationSnapshot {
@@ -20,4 +20,3 @@ export interface PublicationSource {
20
20
  current(): PublicationSnapshot | undefined;
21
21
  }
22
22
  export {};
23
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,2 +1 @@
1
1
  export { currentPublicationSnapshot, mountRoutes, type RouteLimits, type RouteReservation, } from './routes.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export { currentPublicationSnapshot, mountRoutes, } from './routes.js';
2
- //# sourceMappingURL=index.js.map
@@ -23,4 +23,3 @@ export declare function currentPublicationSnapshot(source: PublicationSource, li
23
23
  readonly issuer?: string;
24
24
  readonly reservations: readonly RouteReservation[];
25
25
  }): PreparedPublicationSnapshot | undefined;
26
- //# sourceMappingURL=routes.d.ts.map