@astrale-os/sdk 0.6.0-beta.23 → 0.6.0-beta.25

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 (206) hide show
  1. package/README.md +32 -38
  2. package/dist/application/action/context.d.ts +29 -25
  3. package/dist/application/action/index.d.ts +1 -1
  4. package/dist/application/define.d.ts +3 -1
  5. package/dist/application/define.js +16 -2
  6. package/dist/application/dependency/invoker.d.ts +5 -5
  7. package/dist/application/domain.d.ts +3 -1
  8. package/dist/application/index.d.ts +1 -1
  9. package/dist/application/integration/operation.d.ts +2 -2
  10. package/dist/application/mutation/index.d.ts +1 -1
  11. package/dist/application/query/composite/plan.d.ts +0 -4
  12. package/dist/application/query/composite/plan.js +0 -2
  13. package/dist/application/runtime/workflows.d.ts +1 -1
  14. package/dist/application/runtime/workflows.js +1 -4
  15. package/dist/application/view/define.js +4 -6
  16. package/dist/application/view/frontend.d.ts +2 -2
  17. package/dist/application/view/index.d.ts +1 -1
  18. package/dist/application/view/route.d.ts +0 -14
  19. package/dist/application/view/route.js +1 -64
  20. package/dist/application/workflow/context.d.ts +1 -1
  21. package/dist/application/workflow/define.d.ts +1 -1
  22. package/dist/application/workflow/define.js +1 -1
  23. package/dist/application/workflow/workflow.d.ts +1 -3
  24. package/dist/deployment/adapter/adapter.d.ts +3 -20
  25. package/dist/deployment/adapter/bundle/file.d.ts +1 -1
  26. package/dist/deployment/adapter/define.d.ts +4 -25
  27. package/dist/deployment/adapter/define.js +12 -44
  28. package/dist/deployment/adapter/index.d.ts +0 -2
  29. package/dist/deployment/adapter/release/list.d.ts +1 -2
  30. package/dist/deployment/address/summary.d.ts +3 -7
  31. package/dist/deployment/authoring.d.ts +0 -2
  32. package/dist/deployment/authoring.js +0 -1
  33. package/dist/deployment/build/build.d.ts +6 -0
  34. package/dist/deployment/build/compile.js +2 -0
  35. package/dist/deployment/build/frontend/compilation.d.ts +2 -4
  36. package/dist/deployment/build/frontend/compilation.js +0 -5
  37. package/dist/deployment/build/frontend/digest.js +1 -5
  38. package/dist/deployment/build/material.d.ts +2 -2
  39. package/dist/deployment/build/material.js +28 -13
  40. package/dist/deployment/deployment.d.ts +4 -8
  41. package/dist/deployment/index.d.ts +3 -5
  42. package/dist/deployment/index.js +1 -2
  43. package/dist/deployment/release/addressing.d.ts +2 -9
  44. package/dist/deployment/release/addressing.js +2 -3
  45. package/dist/deployment/release/index.d.ts +0 -2
  46. package/dist/deployment/release/index.js +0 -2
  47. package/dist/deployment/release/release.d.ts +1 -1
  48. package/dist/deployment/release/runtime.d.ts +0 -2
  49. package/dist/deployment/release/runtime.js +0 -2
  50. package/dist/deployment/release/served/index.d.ts +1 -2
  51. package/dist/deployment/release/served/index.js +7 -3
  52. package/dist/deployment/release/served/views.js +0 -1
  53. package/dist/deployment/verify/index.d.ts +2 -4
  54. package/dist/deployment/verify/index.js +1 -3
  55. package/dist/deployment/verify/preflight/index.d.ts +0 -12
  56. package/dist/deployment/verify/preflight/index.js +0 -12
  57. package/dist/deployment/verify/readiness/index.d.ts +2 -6
  58. package/dist/deployment/verify/readiness/index.js +3 -12
  59. package/dist/deployment/worker/response.d.ts +1 -4
  60. package/dist/deployment/worker/response.js +2 -8
  61. package/dist/execution/identity/authentication.d.ts +10 -1
  62. package/dist/execution/identity/authentication.js +21 -0
  63. package/dist/execution/identity/delivery.d.ts +2 -7
  64. package/dist/execution/identity/delivery.js +1 -23
  65. package/dist/execution/identity/identity.d.ts +2 -3
  66. package/dist/execution/identity/identity.js +5 -1
  67. package/dist/execution/index.d.ts +1 -3
  68. package/dist/execution/index.js +1 -2
  69. package/dist/execution/invocation/admission/authentication.d.ts +8 -5
  70. package/dist/execution/invocation/admission/authentication.js +39 -21
  71. package/dist/execution/invocation/admission/authority.d.ts +21 -6
  72. package/dist/execution/invocation/admission/authority.js +6 -4
  73. package/dist/execution/invocation/admission/index.d.ts +2 -2
  74. package/dist/execution/invocation/admission/index.js +1 -1
  75. package/dist/execution/invocation/dependency/bind.d.ts +2 -0
  76. package/dist/execution/invocation/dependency/bind.js +1 -2
  77. package/dist/execution/invocation/dispatch/context.d.ts +5 -5
  78. package/dist/execution/invocation/dispatch/context.js +16 -30
  79. package/dist/execution/invocation/dispatch/workflow.js +0 -4
  80. package/dist/execution/invocation/index.d.ts +2 -2
  81. package/dist/execution/invocation/index.js +1 -1
  82. package/dist/execution/invocation/integration/call.d.ts +2 -1
  83. package/dist/execution/invocation/integration/call.js +1 -1
  84. package/dist/execution/invocation/integration/clients.d.ts +1 -1
  85. package/dist/execution/invocation/invocation.js +3 -12
  86. package/dist/execution/invocation/result/errors.d.ts +0 -10
  87. package/dist/execution/invocation/result/errors.js +0 -17
  88. package/dist/execution/invocation/result/index.d.ts +2 -2
  89. package/dist/execution/invocation/result/index.js +1 -1
  90. package/dist/execution/runtime/release.d.ts +6 -11
  91. package/dist/execution/runtime/release.js +2 -9
  92. package/dist/execution/service/create.js +3 -1
  93. package/dist/execution/service/service.d.ts +2 -3
  94. package/dist/execution/service/serving/delivery.d.ts +1 -2
  95. package/dist/execution/service/serving/delivery.js +1 -2
  96. package/dist/execution/service/serving/source.d.ts +3 -10
  97. package/dist/execution/service/serving/source.js +1 -5
  98. package/dist/execution/workflows/index.d.ts +1 -1
  99. package/dist/execution/workflows/index.js +1 -1
  100. package/dist/execution/workflows/options.d.ts +0 -6
  101. package/dist/execution/workflows/options.js +0 -18
  102. package/dist/execution/workflows/receiver.d.ts +1 -2
  103. package/dist/execution/workflows/receiver.js +13 -20
  104. package/dist/execution/workflows/route.d.ts +1 -3
  105. package/dist/execution/workflows/route.js +4 -9
  106. package/dist/execution/workflows/run.d.ts +1 -1
  107. package/dist/execution/workflows/run.js +1 -1
  108. package/dist/index.d.ts +1 -1
  109. package/dist/index.js +1 -1
  110. package/dist/platform/graph/alias.d.ts +1 -5
  111. package/dist/platform/graph/alias.js +1 -5
  112. package/dist/platform/graph/document/index.d.ts +1 -1
  113. package/dist/platform/graph/document/index.js +1 -1
  114. package/dist/platform/graph/index.d.ts +1 -1
  115. package/dist/platform/graph/index.js +1 -1
  116. package/dist/platform/release/index.d.ts +1 -26
  117. package/dist/platform/release/index.js +1 -26
  118. package/dist/platform/schema/class-icon-svg.d.ts +9 -0
  119. package/dist/platform/schema/class-icon-svg.js +29 -0
  120. package/dist/platform/schema/class-icon.d.ts +3 -8
  121. package/dist/platform/schema/class-icon.js +2 -29
  122. package/dist/platform/schema/index.d.ts +1 -1
  123. package/dist/platform/schema/schema-authoring.d.ts +14 -7
  124. package/dist/platform/schema/schema-authoring.js +5 -1
  125. package/dist/project/admit.js +0 -4
  126. package/dist/project/install-command.d.ts +0 -4
  127. package/dist/project/install-command.js +1 -5
  128. package/dist/tooling/cli/deploy-mode.d.ts +3 -59
  129. package/dist/tooling/cli/deploy-mode.js +46 -122
  130. package/dist/tooling/cli/deploy-result.d.ts +10 -15
  131. package/dist/tooling/cli/help.js +9 -16
  132. package/dist/tooling/cli/immutable-deployment.d.ts +3 -3
  133. package/dist/tooling/cli/index.d.ts +1 -1
  134. package/dist/tooling/cli/list.d.ts +5 -7
  135. package/dist/tooling/cli/list.js +9 -61
  136. package/dist/tooling/cli/orchestrate.js +6 -16
  137. package/dist/tooling/cli/publish/index.d.ts +2 -2
  138. package/dist/tooling/cli/registry/client.js +1 -1
  139. package/dist/tooling/cli/secrets.d.ts +2 -2
  140. package/dist/tooling/linter/implementations/source/global.js +0 -1
  141. package/dist/tooling/linter/implementations/source/verifiers.js +0 -2
  142. package/dist/tooling/linter/policy/generated.js +2 -51
  143. package/dist/tooling/linter/requirements/registry.js +0 -6
  144. package/package.json +9 -8
  145. package/dist/application/query/execution/projection.d.ts +0 -3
  146. package/dist/application/query/execution/projection.js +0 -3
  147. package/dist/deployment/adapter/legacy/adapter.d.ts +0 -40
  148. package/dist/deployment/adapter/legacy/adapter.js +0 -1
  149. package/dist/deployment/adapter/legacy/deploy/context.d.ts +0 -19
  150. package/dist/deployment/adapter/legacy/deploy/context.js +0 -1
  151. package/dist/deployment/adapter/legacy/deploy/index.d.ts +0 -2
  152. package/dist/deployment/adapter/legacy/deploy/index.js +0 -1
  153. package/dist/deployment/adapter/legacy/deploy/result.d.ts +0 -89
  154. package/dist/deployment/adapter/legacy/deploy/result.js +0 -1
  155. package/dist/deployment/adapter/legacy/index.d.ts +0 -24
  156. package/dist/deployment/adapter/legacy/index.js +0 -1
  157. package/dist/deployment/adapter/legacy/prepare/artifact.d.ts +0 -43
  158. package/dist/deployment/adapter/legacy/prepare/artifact.js +0 -1
  159. package/dist/deployment/adapter/legacy/prepare/context.d.ts +0 -33
  160. package/dist/deployment/adapter/legacy/prepare/context.js +0 -1
  161. package/dist/deployment/adapter/legacy/prepare/index.d.ts +0 -2
  162. package/dist/deployment/adapter/legacy/prepare/index.js +0 -1
  163. package/dist/deployment/deploy.d.ts +0 -20
  164. package/dist/deployment/deploy.js +0 -31
  165. package/dist/deployment/release/legacy/admission.d.ts +0 -3
  166. package/dist/deployment/release/legacy/admission.js +0 -8
  167. package/dist/deployment/release/legacy/assemble.d.ts +0 -5
  168. package/dist/deployment/release/legacy/assemble.js +0 -20
  169. package/dist/deployment/release/legacy/index.d.ts +0 -35
  170. package/dist/deployment/release/legacy/index.js +0 -34
  171. package/dist/deployment/release/legacy/release.d.ts +0 -12
  172. package/dist/deployment/release/legacy/release.js +0 -1
  173. package/dist/deployment/release/legacy/seal.d.ts +0 -10
  174. package/dist/deployment/release/legacy/seal.js +0 -17
  175. package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
  176. package/dist/deployment/verify/preflight/artifact.js +0 -122
  177. package/dist/deployment/verify/preflight/publication.d.ts +0 -4
  178. package/dist/deployment/verify/preflight/publication.js +0 -15
  179. package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
  180. package/dist/deployment/verify/readiness/deployment.js +0 -143
  181. package/dist/deployment/verify/readiness/legacy/index.d.ts +0 -2
  182. package/dist/deployment/verify/readiness/legacy/index.js +0 -2
  183. package/dist/deployment/verify/readiness/legacy/publication.d.ts +0 -12
  184. package/dist/deployment/verify/readiness/legacy/publication.js +0 -23
  185. package/dist/execution/service/errors.d.ts +0 -3
  186. package/dist/execution/service/errors.js +0 -3
  187. package/dist/execution/service/serving/legacy/index.d.ts +0 -15
  188. package/dist/execution/service/serving/legacy/index.js +0 -19
  189. package/dist/tooling/cli/deprecations.d.ts +0 -9
  190. package/dist/tooling/cli/deprecations.js +0 -15
  191. package/dist/tooling/cli/legacy/deploy-result.d.ts +0 -28
  192. package/dist/tooling/cli/legacy/deploy-result.js +0 -37
  193. package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +0 -21
  194. package/dist/tooling/cli/legacy/stable-target-adapter.js +0 -14
  195. package/dist/tooling/cli/legacy/stable-target-deploy.d.ts +0 -40
  196. package/dist/tooling/cli/legacy/stable-target-deploy.js +0 -102
  197. package/dist/tooling/cli/legacy/uploaded-build.d.ts +0 -11
  198. package/dist/tooling/cli/legacy/uploaded-build.js +0 -22
  199. package/dist/tooling/linter/implementations/source/migrations.d.ts +0 -2
  200. package/dist/tooling/linter/implementations/source/migrations.js +0 -113
  201. package/dist/tooling/linter/qualification/index.d.ts +0 -10
  202. package/dist/tooling/linter/qualification/index.js +0 -2
  203. package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
  204. package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
  205. package/dist/tooling/linter/qualification/runner.d.ts +0 -3
  206. package/dist/tooling/linter/qualification/runner.js +0 -6
@@ -3,7 +3,8 @@ import { bindQuery } from '../../../application/query/execution/executor.js';
3
3
  import { bindDependencies } from '../dependency/index.js';
4
4
  import { clients } from '../integration/index.js';
5
5
  export function context(request, runtime, authentication, self) {
6
- const graph = authentication.graph === null ? null : bindGraph(authentication.graph, runtime.loaded.domain);
6
+ const sessions = authentication.graph;
7
+ const graph = bindGraph(sessions, runtime.loaded.domain);
7
8
  const execution = Object.freeze({
8
9
  signal: request.context.execution.signal,
9
10
  deadline: request.context.execution.deadline,
@@ -19,46 +20,31 @@ export function context(request, runtime, authentication, self) {
19
20
  input: request.call.input,
20
21
  ...(request.context.binary === undefined ? {} : { body: request.context.binary }),
21
22
  caller: authentication.caller,
22
- kernel: authentication.graph === null
23
- ? null
24
- : Object.freeze({
25
- ...authentication.graph.self,
26
- ...authentication.graph,
27
- }),
28
- dependencies: authentication.graph === null
29
- ? null
30
- : bindDependencies(runtime.loaded.domain, authentication.graph),
23
+ kernel: Object.freeze({ ...sessions.self, ...sessions }),
24
+ dependencies: bindDependencies(runtime.loaded.domain, sessions),
31
25
  graph,
32
- ...(graph === null
33
- ? {}
34
- : {
35
- query: graph.self.query,
36
- mutate: graph.self.mutate,
37
- }),
38
- integrations: clients(runtime, request.context, authentication.graph === null
39
- ? null
40
- : {
41
- caller: authentication.graph.caller,
42
- self: authentication.graph.self,
43
- ...(authentication.caller.authentication.expiresAt === undefined
44
- ? {}
45
- : {
46
- expiresAt: authentication.caller.authentication.expiresAt,
47
- }),
48
- }),
26
+ query: graph.self.query,
27
+ mutate: graph.self.mutate,
28
+ integrations: clients(runtime, request.context, {
29
+ ...sessions,
30
+ ...(authentication.caller.kind !== 'authenticated' ||
31
+ authentication.caller.authentication.expiresAt === undefined
32
+ ? {}
33
+ : { expiresAt: authentication.caller.authentication.expiresAt }),
34
+ }),
49
35
  execution,
50
36
  ...(self === undefined ? {} : { self }),
51
37
  });
52
38
  }
53
- function bindGraph(clients, domain) {
39
+ function bindGraph(sessions, domain) {
54
40
  const bind = (client) => Object.freeze({
55
41
  query: bindQuery(client, domain),
56
42
  mutate: bindMutation(client, domain),
57
43
  });
58
- const self = bind(clients.self);
44
+ const self = bind(sessions.self);
59
45
  return Object.freeze({
60
46
  ...self,
61
- caller: bind(clients.caller),
47
+ ...('caller' in sessions ? { caller: bind(sessions.caller) } : {}),
62
48
  self,
63
49
  });
64
50
  }
@@ -1,12 +1,8 @@
1
1
  import { declaredErrorFactory, declaredErrorOf } from '../../../application/error/index.js';
2
2
  import { protocolError } from '../result/index.js';
3
3
  export async function workflow(selected, context, runner) {
4
- if (context.caller.kind !== 'authenticated' || context.kernel === null) {
5
- throw protocolError('AUTH_MISSING', 'Workflow authentication is required.');
6
- }
7
4
  const complete = Object.freeze({
8
5
  ...context,
9
- caller: context.caller,
10
6
  error: declaredErrorFactory(selected.definition),
11
7
  });
12
8
  try {
@@ -1,5 +1,5 @@
1
1
  export { createHandler, type HandlerInput } from './handler.js';
2
2
  export { invoke, type InvocationInput } from './invocation.js';
3
3
  export type * from './admission/index.js';
4
- export { InvocationDefect, InvocationError } from './result/index.js';
5
- export type { InvocationDefectCode, InvocationErrorCode } from './result/index.js';
4
+ export { InvocationDefect } from './result/index.js';
5
+ export type { InvocationDefectCode } from './result/index.js';
@@ -1,3 +1,3 @@
1
1
  export { createHandler } from './handler.js';
2
2
  export { invoke } from './invocation.js';
3
- export { InvocationDefect, InvocationError } from './result/index.js';
3
+ export { InvocationDefect } from './result/index.js';
@@ -2,7 +2,8 @@ import type { InvocationContext } from '@astrale-os/kernel-server';
2
2
  import type { IntegrationInvocationOwner } from '../../../application/integration/index.js';
3
3
  import type { BoundClientSession } from '../../../platform/client/session/index.js';
4
4
  export interface IntegrationInvocationSessions {
5
- readonly caller: BoundClientSession;
5
+ /** Absent when the call carried no credential: there is no caller to invoke for. */
6
+ readonly caller?: BoundClientSession;
6
7
  readonly self: BoundClientSession;
7
8
  /** Verified incoming carrier expiry, in Unix seconds. */
8
9
  readonly expiresAt?: number;
@@ -3,7 +3,7 @@ import { bindIntegrationAuthentication } from './authentication.js';
3
3
  /** One invocation-owned logical Integration call sequence. */
4
4
  export function calls(context, sessions = null) {
5
5
  const prefix = context.idempotencyKey ?? JSON.stringify([context.invocation.source, context.invocation.id]);
6
- const invoke = sessions?.caller.invoke.bind(sessions.caller);
6
+ const invoke = sessions?.caller?.invoke.bind(sessions.caller);
7
7
  const auth = sessions === null
8
8
  ? undefined
9
9
  : bindIntegrationAuthentication(context, sessions.self, sessions.expiresAt);
@@ -2,4 +2,4 @@ import type { InvocationContext } from '@astrale-os/kernel-server';
2
2
  import type { IntegrationClients, Integrations } from '../../../application/integration/index.js';
3
3
  import type { InitializedRuntime } from '../../runtime/index.js';
4
4
  import type { IntegrationInvocationSessions } from './call.js';
5
- export declare function clients(runtime: InitializedRuntime, context: InvocationContext, sessions: IntegrationInvocationSessions | null): IntegrationClients<Integrations>;
5
+ export declare function clients(runtime: InitializedRuntime, context: InvocationContext, sessions: IntegrationInvocationSessions): IntegrationClients<Integrations>;
@@ -70,19 +70,10 @@ function refusedAsMiss(cause) {
70
70
  return (cause instanceof errors.ProtocolError &&
71
71
  errors.reasonOf(cause.payload.data)?.code === FUNCTION_MISS);
72
72
  }
73
- /**
74
- * The Kernel Server pins every request to the one snapshot it serves: the release of an immutable
75
- * deployment, or a stable target's Publication. Execution answers only for that exact document.
76
- */
73
+ /** Execution answers only for the exact release pinned by the Kernel Server snapshot. */
77
74
  function pinsRunningRelease(request, running) {
78
- if (running.kind === 'release') {
79
- return (request.publication === undefined &&
80
- request.release !== undefined &&
81
- release.matchesReference(request.release.release, release.reference(running.document)));
82
- }
83
- return (request.release === undefined &&
84
- request.publication !== undefined &&
85
- release.legacy.matchesReference(request.publication.publication, release.legacy.reference(running.publication)));
75
+ return (request.release !== undefined &&
76
+ release.matchesReference(request.release.release, release.reference(running.document)));
86
77
  }
87
78
  function once(operation) {
88
79
  let called = false;
@@ -2,16 +2,6 @@ import * as errors from '@astrale-os/kernel-protocol/errors';
2
2
  import type { ResolvedCallable } from '../../../application/action/index.js';
3
3
  import type { Key } from '../../../platform/schema/index.js';
4
4
  import type { Value } from '../../../platform/value/index.js';
5
- export type InvocationErrorCode = Extract<keyof typeof errors.CODES, 'VALIDATION_ERROR' | 'ACCESS_DENIED' | 'NOT_FOUND' | 'CONFLICT' | 'UNSUPPORTED' | 'LIMIT_EXCEEDED' | 'BACKEND_UNAVAILABLE'>;
6
- /** @deprecated Declare expected failures on defineAction or defineWorkflow instead. */
7
- export declare class InvocationError extends Error {
8
- readonly code: InvocationErrorCode;
9
- readonly name = "InvocationError";
10
- readonly reason?: errors.ErrorReason;
11
- constructor(code: InvocationErrorCode, message: string, options?: ErrorOptions & {
12
- readonly reason?: errors.ErrorReason;
13
- });
14
- }
15
5
  export type InvocationDefectCode = 'INVOCATION_TARGET_INVALID' | 'INVOCATION_HANDLER_INVALID' | 'INVOCATION_OUTPUT_INVALID' | 'INVOCATION_RESULT_CONTRACT_VIOLATION';
16
6
  export declare class InvocationDefect extends Error {
17
7
  readonly code: InvocationDefectCode;
@@ -5,20 +5,6 @@ const PUBLIC_ERROR_CODES = new Set(Object.values(errors.CODES));
5
5
  const PUBLIC_ERROR_NAMES = new Map(Object.entries(errors.CODES).map(([name, code]) => [code, name]));
6
6
  const MAXIMUM_DIAGNOSTICS = 32;
7
7
  const admittedProtocolErrors = new WeakSet();
8
- /** @deprecated Declare expected failures on defineAction or defineWorkflow instead. */
9
- export class InvocationError extends Error {
10
- code;
11
- name = 'InvocationError';
12
- reason;
13
- constructor(code, message, options = {}) {
14
- super(message, options);
15
- this.code = code;
16
- this.reason =
17
- options.reason === undefined
18
- ? undefined
19
- : errors.acceptReason(options.reason, 'InvocationError reason');
20
- }
21
- }
22
8
  export class InvocationDefect extends Error {
23
9
  code;
24
10
  name = 'InvocationDefect';
@@ -62,9 +48,6 @@ export function projectError(input) {
62
48
  ? input
63
49
  : protocolError('INTERNAL_ERROR', 'Internal application error.');
64
50
  }
65
- if (input instanceof InvocationError) {
66
- return protocolError('INTERNAL_ERROR', 'Internal application error.');
67
- }
68
51
  if (input instanceof ResponseError) {
69
52
  if (!PUBLIC_ERROR_CODES.has(input.code)) {
70
53
  return protocolError('BACKEND_UNAVAILABLE', 'Dependency Kernel returned invalid error evidence.');
@@ -1,4 +1,4 @@
1
- export { inputError, InvocationDefect, InvocationError, projectError, protocolError, } from './errors.js';
2
- export type { InvocationDefectCode, InvocationErrorCode } from './errors.js';
1
+ export { inputError, InvocationDefect, projectError, protocolError } from './errors.js';
2
+ export type { InvocationDefectCode } from './errors.js';
3
3
  export { project } from './project.js';
4
4
  export { validateInput, validateOutput } from './validate.js';
@@ -1,3 +1,3 @@
1
- export { inputError, InvocationDefect, InvocationError, projectError, protocolError, } from './errors.js';
1
+ export { inputError, InvocationDefect, projectError, protocolError } from './errors.js';
2
2
  export { project } from './project.js';
3
3
  export { validateInput, validateOutput } from './validate.js';
@@ -1,22 +1,17 @@
1
1
  import type * as release from '@astrale-os/kernel-protocol/release';
2
2
  import type { Build } from '../../deployment/build/build.js';
3
- import type * as legacy from '../../deployment/release/legacy/index.js';
4
3
  import type { Release } from '../../deployment/release/release.js';
5
4
  import type { IssuerId } from '../../platform/auth/index.js';
6
- /**
7
- * What one Service serves: the `DomainRelease` v4 Release of an immutable deployment, or the
8
- * deprecated v3 Release of a stable target (`legacy`, its consumers and removal in
9
- * `deployment/release/legacy/index.ts`, D10).
10
- */
11
- export type ServedRelease<BuildValue extends Build = Build> = Release<BuildValue> | legacy.Release<BuildValue>;
5
+ /** The DomainRelease v4 served by one immutable deployment. */
6
+ export type ServedRelease<BuildValue extends Build = Build> = Release<BuildValue>;
12
7
  /** Where and as whom one served Release answers, and the document it serves. */
13
8
  export interface Serving {
14
- /** Domain identity issuer: a deployment's URL, or a stable target's configured issuer. */
9
+ /** Domain identity issuer: this deployment's URL. */
15
10
  readonly issuer: IssuerId;
16
- /** Public origin the Server answers at: a deployment's URL, or a stable target's route. */
11
+ /** Public origin the Server answers at: this deployment's URL. */
17
12
  readonly publicUrl: IssuerId;
18
- /** The document served at `release.json`, or a stable target's v3 Publication at `domain.json`. */
19
- readonly document: release.DomainRelease | release.legacy.Publication;
13
+ /** The document served at release.json. */
14
+ readonly document: release.DomainRelease;
20
15
  }
21
16
  export declare function isServedRelease(input: unknown): input is ServedRelease;
22
17
  export declare function serving(served: ServedRelease): Serving;
@@ -1,14 +1,7 @@
1
1
  import { isRelease } from '../../deployment/release/admission.js';
2
- import { isRelease as isLegacyRelease } from '../../deployment/release/legacy/admission.js';
3
2
  export function isServedRelease(input) {
4
- return isRelease(input) || isLegacyRelease(input);
3
+ return isRelease(input);
5
4
  }
6
5
  export function serving(served) {
7
- return served.kind === 'release'
8
- ? Object.freeze({ issuer: served.url, publicUrl: served.url, document: served.document })
9
- : Object.freeze({
10
- issuer: served.addressing.issuer,
11
- publicUrl: served.addressing.publicUrl,
12
- document: served.publication,
13
- });
6
+ return Object.freeze({ issuer: served.url, publicUrl: served.url, document: served.document });
14
7
  }
@@ -4,7 +4,7 @@ import { invocationPath } from '../../deployment/release/invocation.js';
4
4
  import { identity as captureIdentity } from '../identity/index.js';
5
5
  import { createHandler } from '../invocation/index.js';
6
6
  import { initialize, load, serving as servedRelease } from '../runtime/index.js';
7
- import { createDurableReceiver, durableServing, isDurableRequest, } from '../workflows/index.js';
7
+ import { createDurableReceiver, durableServing, isCanonicalDurableRequest, isDurableRequest, } from '../workflows/index.js';
8
8
  import { initialization } from './initialization.js';
9
9
  import { lifecycle } from './lifecycle.js';
10
10
  import { loadRelease } from './release.js';
@@ -83,6 +83,8 @@ export function createService(input) {
83
83
  return unavailable();
84
84
  // Without engine configuration only durable calls fail: the engine's discovery is refused.
85
85
  if (isDurableRequest(request)) {
86
+ if (!isCanonicalDurableRequest(request))
87
+ return notServed();
86
88
  const selected = await receiver.get(request);
87
89
  if (!state.accepting)
88
90
  return unavailable();
@@ -6,7 +6,7 @@ import type { Identity } from '../identity/index.js';
6
6
  import type { ServedRelease } from '../runtime/index.js';
7
7
  import type { DurableServing, DurableServingProvider } from '../workflows/index.js';
8
8
  import type { ReleaseLoader } from './release.js';
9
- export type ServiceServerOptions = Omit<ServerOptions, 'path' | 'invocation' | 'issuer' | 'publicOrigin' | 'tokenExchange' | 'release' | 'publication' | 'delivery'>;
9
+ export type ServiceServerOptions = Omit<ServerOptions, 'path' | 'invocation' | 'issuer' | 'publicOrigin' | 'tokenExchange' | 'release' | 'delivery'>;
10
10
  export interface ServiceInput<Environment, RuntimeValue extends Runtime = Runtime> {
11
11
  readonly runtime: RuntimeValue;
12
12
  readonly environment: Environment;
@@ -14,8 +14,7 @@ export interface ServiceInput<Environment, RuntimeValue extends Runtime = Runtim
14
14
  readonly identity: Identity;
15
15
  readonly server: ServiceServerOptions;
16
16
  /**
17
- * Answers Delivery in the request's version: v2 over an immutable deployment's release, v1 over
18
- * the Publication (a release's frozen v3 projection). Defaults to the Identity's own.
17
+ * Answers Delivery v2 over an immutable deployment's Release. Defaults to the Identity's own.
19
18
  */
20
19
  readonly delivery?: release.delivery.Provider;
21
20
  readonly workflows?: WorkflowRunner;
@@ -1,6 +1,5 @@
1
1
  import type { release } from '@astrale-os/kernel-server';
2
2
  /**
3
- * Capture an explicit Delivery Provider. It answers in the request's version: v2 over an immutable
4
- * deployment's release, v1 over the Publication (a release's frozen v3 projection).
3
+ * Capture an explicit Delivery v2 Provider over an immutable deployment's Release.
5
4
  */
6
5
  export declare function delivery(input: release.delivery.Provider | undefined): release.delivery.Provider | undefined;
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Capture an explicit Delivery Provider. It answers in the request's version: v2 over an immutable
3
- * deployment's release, v1 over the Publication (a release's frozen v3 projection).
2
+ * Capture an explicit Delivery v2 Provider over an immutable deployment's Release.
4
3
  */
5
4
  export function delivery(input) {
6
5
  if (input === undefined)
@@ -1,18 +1,11 @@
1
- import type { PublicationSource, ReleaseSource } from '@astrale-os/kernel-server';
1
+ import type { ReleaseSource } from '@astrale-os/kernel-server';
2
2
  import type { LoadedRuntime } from '../../runtime/index.js';
3
3
  /** The one source a Kernel Server serves, as `ServerOptions` takes it. */
4
- export type ServingSource =
5
- /** The release of an immutable deployment: `release.json` and its v3 projection. */
6
- {
4
+ export type ServingSource = {
7
5
  readonly release: ReleaseSource;
8
- }
9
- /** @deprecated A stable target's v3 Publication; see `legacy/index.ts`. */
10
- | {
11
- readonly publication: PublicationSource;
12
6
  };
13
7
  /**
14
8
  * Prepare, once, the exact snapshot the loaded Release serves: an immutable deployment serves its
15
- * `DomainRelease` through `prepareReleaseSnapshot`, which admits only routing naming that exact
16
- * release or its exact v3 projection; a stable target keeps serving its v3 Publication.
9
+ * DomainRelease through prepareReleaseSnapshot, which admits routing naming that exact release.
17
10
  */
18
11
  export declare function source(runtime: LoadedRuntime): ServingSource;
@@ -1,14 +1,10 @@
1
1
  import { prepareReleaseSnapshot } from '@astrale-os/kernel-server';
2
- import { publicationSource } from './legacy/index.js';
3
2
  /**
4
3
  * Prepare, once, the exact snapshot the loaded Release serves: an immutable deployment serves its
5
- * `DomainRelease` through `prepareReleaseSnapshot`, which admits only routing naming that exact
6
- * release or its exact v3 projection; a stable target keeps serving its v3 Publication.
4
+ * DomainRelease through prepareReleaseSnapshot, which admits routing naming that exact release.
7
5
  */
8
6
  export function source(runtime) {
9
7
  const served = runtime.release;
10
- if (served.kind !== 'release')
11
- return publicationSource(runtime, served);
12
8
  const snapshot = prepareReleaseSnapshot({
13
9
  release: served.document,
14
10
  bundle: served.build.schema.bundle.bytes(),
@@ -1,4 +1,4 @@
1
1
  export type { DurableEngine, EngineRetryPolicy, EngineSharedContext, EngineWorkflowContext, EngineWorkflowDefinition, } from './engine.js';
2
2
  export { durableServing, type AdmittedDurableServing, type DurableServing, type DurableServingProvider, } from './options.js';
3
3
  export { createDurableReceiver, type DurableReceiver } from './receiver.js';
4
- export { isDurableRequest, isCanonicalDurableRequest, isLegacyDurableRequest } from './route.js';
4
+ export { isDurableRequest, isCanonicalDurableRequest } from './route.js';
@@ -1,3 +1,3 @@
1
1
  export { durableServing, } from './options.js';
2
2
  export { createDurableReceiver } from './receiver.js';
3
- export { isDurableRequest, isCanonicalDurableRequest, isLegacyDurableRequest } from './route.js';
3
+ export { isDurableRequest, isCanonicalDurableRequest } from './route.js';
@@ -4,11 +4,6 @@ import type { DurableEngine, EngineRetryPolicy } from './engine.js';
4
4
  export interface DurableServing {
5
5
  /** The Restate SDK Fetch build of this platform. */
6
6
  readonly engine: DurableEngine;
7
- /**
8
- * @deprecated Explicit signing authority for retained callbacks registered before issuer-prefixed
9
- * paths. Canonical requests discover their authority from the named Kernel and ignore these keys.
10
- */
11
- readonly identityKeys?: readonly string[];
12
7
  /** Fetch capability used for HTTPS discovery of a canonical request's Kernel engine. */
13
8
  readonly fetch?: Fetch;
14
9
  /**
@@ -30,7 +25,6 @@ export interface DurableServing {
30
25
  export type DurableServingProvider = (request: Request) => DurableServing | undefined | Promise<DurableServing | undefined>;
31
26
  export interface AdmittedDurableServing {
32
27
  readonly engine: DurableEngine;
33
- readonly identityKeys: readonly string[];
34
28
  readonly fetch: Fetch;
35
29
  readonly retentionMs: number;
36
30
  readonly retryPolicy: EngineRetryPolicy;
@@ -1,14 +1,11 @@
1
- import { acceptWorkflowEngineIdentityKey } from '@astrale-os/kernel-protocol/issuer/workflow-engine';
2
1
  const HOUR_MS = 60 * 60_000;
3
2
  const DAY_MS = 24 * HOUR_MS;
4
- const MAXIMUM_IDENTITY_KEYS = 16;
5
3
  /** Capture one durable serving configuration, failing closed on any gap. */
6
4
  export function durableServing(input) {
7
5
  if (input === null ||
8
6
  typeof input !== 'object' ||
9
7
  Array.isArray(input) ||
10
8
  Reflect.ownKeys(input).some((key) => key !== 'engine' &&
11
- key !== 'identityKeys' &&
12
9
  key !== 'fetch' &&
13
10
  key !== 'retentionMs' &&
14
11
  key !== 'retry' &&
@@ -24,20 +21,6 @@ export function durableServing(input) {
24
21
  typeof engine.CancelledError !== 'function') {
25
22
  invalid('Durable serving requires the Restate SDK Fetch entrypoint of this platform.');
26
23
  }
27
- const keys = input.identityKeys;
28
- let identityKeys = Object.freeze([]);
29
- if (keys !== undefined) {
30
- if (!Array.isArray(keys) || keys.length === 0 || keys.length > MAXIMUM_IDENTITY_KEYS) {
31
- invalid('Durable serving requires engine request identity keys (publickeyv1_…).');
32
- }
33
- // Legacy callbacks retain their original sixteen-key input budget and duplicate policy.
34
- try {
35
- identityKeys = Object.freeze(Array.from(keys, acceptWorkflowEngineIdentityKey));
36
- }
37
- catch (cause) {
38
- throw new TypeError('Durable serving requires engine request identity keys (publickeyv1_…).', { cause });
39
- }
40
- }
41
24
  const fetch = input.fetch ?? globalThis.fetch.bind(globalThis);
42
25
  if (typeof fetch !== 'function')
43
26
  invalid('Durable serving requires Fetch for engine discovery.');
@@ -57,7 +40,6 @@ export function durableServing(input) {
57
40
  TerminalError: engine.TerminalError,
58
41
  CancelledError: engine.CancelledError,
59
42
  }),
60
- identityKeys,
61
43
  fetch,
62
44
  retentionMs: bounded(input.retentionMs, 7 * DAY_MS, HOUR_MS, 365 * DAY_MS, 'retentionMs'),
63
45
  retryPolicy: Object.freeze({
@@ -8,8 +8,7 @@ export interface DurableReceiver {
8
8
  }
9
9
  /**
10
10
  * Route `…/invoke/restate/<Kernel issuer>/<declaration key>/<service>/{discover,invoke/…}` to one
11
- * engine endpoint. Retained services registered before issuer-prefixed paths keep their old
12
- * `<declaration key>/<service>` route with explicit legacy signing keys. Canonical routes discover
11
+ * engine endpoint. Routes discover
13
12
  * their signing authority at the named Kernel; that issuer also binds the run envelope. Each
14
13
  * endpoint serves exactly that service with the declared Workflow. A declaration this Release does not
15
14
  * serve durably is refused, so an endpoint never runs code it does not declare.
@@ -4,8 +4,7 @@ import { durableHandlers } from './run.js';
4
4
  const MAXIMUM_ENDPOINTS = 256;
5
5
  /**
6
6
  * Route `…/invoke/restate/<Kernel issuer>/<declaration key>/<service>/{discover,invoke/…}` to one
7
- * engine endpoint. Retained services registered before issuer-prefixed paths keep their old
8
- * `<declaration key>/<service>` route with explicit legacy signing keys. Canonical routes discover
7
+ * engine endpoint. Routes discover
9
8
  * their signing authority at the named Kernel; that issuer also binds the run envelope. Each
10
9
  * endpoint serves exactly that service with the declared Workflow. A declaration this Release does not
11
10
  * serve durably is refused, so an endpoint never runs code it does not declare.
@@ -31,21 +30,17 @@ export function createDurableReceiver(input) {
31
30
  const workflow = declared.get(declaration);
32
31
  if (workflow === undefined)
33
32
  return refused();
34
- let identityKeys = input.serving.identityKeys;
35
- if (kernel !== undefined) {
36
- try {
37
- identityKeys = (await discovery.resolve(kernel)).identity_keys;
38
- }
39
- catch (cause) {
40
- if (!(cause instanceof WorkflowEngineUnavailable))
41
- throw cause;
42
- return unavailable();
43
- }
33
+ let identityKeys;
34
+ try {
35
+ identityKeys = (await discovery.resolve(kernel)).identity_keys;
36
+ }
37
+ catch (cause) {
38
+ if (!(cause instanceof WorkflowEngineUnavailable))
39
+ throw cause;
40
+ return unavailable();
44
41
  }
45
- else if (identityKeys.length === 0)
46
- return refused();
47
42
  request.signal.throwIfAborted();
48
- const cacheKey = JSON.stringify([kernel ?? null, declaration, service, identityKeys]);
43
+ const cacheKey = JSON.stringify([kernel, declaration, service, identityKeys]);
49
44
  let endpoint = endpoints.get(cacheKey);
50
45
  if (endpoint === undefined) {
51
46
  const definition = engine.workflow({
@@ -55,7 +50,7 @@ export function createDurableReceiver(input) {
55
50
  domain: input.domain,
56
51
  executor: bound,
57
52
  serving: input.serving,
58
- ...(kernel === undefined ? {} : { kernel }),
53
+ kernel,
59
54
  }),
60
55
  options: {
61
56
  workflowRetention: input.serving.retentionMs,
@@ -68,9 +63,7 @@ export function createDurableReceiver(input) {
68
63
  services: [definition],
69
64
  });
70
65
  }
71
- catch (cause) {
72
- if (kernel === undefined)
73
- throw cause;
66
+ catch {
74
67
  discovery.forget(kernel, identityKeys);
75
68
  return unavailable();
76
69
  }
@@ -79,7 +72,7 @@ export function createDurableReceiver(input) {
79
72
  endpoints.set(cacheKey, endpoint);
80
73
  }
81
74
  const response = await endpoint(request);
82
- if (kernel !== undefined && response.status === 401)
75
+ if (response.status === 401)
83
76
  discovery.invalidate(kernel, identityKeys);
84
77
  return response;
85
78
  },
@@ -1,6 +1,6 @@
1
1
  import type { IssuerId } from '../../platform/auth/index.js';
2
2
  export interface DurableRoute {
3
- readonly kernel?: IssuerId;
3
+ readonly kernel: IssuerId;
4
4
  readonly declaration: string;
5
5
  readonly service: string;
6
6
  }
@@ -8,7 +8,5 @@ export interface DurableRoute {
8
8
  export declare function isDurableRequest(request: Request): boolean;
9
9
  /** Canonical requests discover authority at the HTTPS Kernel named by this admitted route. */
10
10
  export declare function isCanonicalDurableRequest(request: Request): boolean;
11
- /** Retained callbacks need explicit legacy signing authority before an engine module is loaded. */
12
- export declare function isLegacyDurableRequest(request: Request): boolean;
13
11
  /** One wire decoder shared by the receiver and platform lazy-load eligibility. */
14
12
  export declare function durableRoute(request: Request): DurableRoute | undefined;
@@ -12,11 +12,6 @@ export function isDurableRequest(request) {
12
12
  export function isCanonicalDurableRequest(request) {
13
13
  return durableRoute(request)?.kernel !== undefined;
14
14
  }
15
- /** Retained callbacks need explicit legacy signing authority before an engine module is loaded. */
16
- export function isLegacyDurableRequest(request) {
17
- const route = durableRoute(request);
18
- return route !== undefined && route.kernel === undefined;
19
- }
20
15
  /** One wire decoder shared by the receiver and platform lazy-load eligibility. */
21
16
  export function durableRoute(request) {
22
17
  const pathname = new URL(request.url).pathname;
@@ -25,12 +20,12 @@ export function durableRoute(request) {
25
20
  const parts = pathname.slice(PREFIX.length).split('/');
26
21
  try {
27
22
  const first = decodeURIComponent(parts[0] ?? '');
28
- const kernel = Key.is(first) ? undefined : httpIssuer(first, false);
29
- const declaration = kernel === undefined ? first : decodeURIComponent(parts[1] ?? '');
30
- const service = parts[kernel === undefined ? 1 : 2] ?? '';
23
+ const kernel = httpIssuer(first, false);
24
+ const declaration = decodeURIComponent(parts[1] ?? '');
25
+ const service = parts[2] ?? '';
31
26
  if (!Key.is(declaration) || !SERVICE.test(service))
32
27
  return undefined;
33
- return Object.freeze({ ...(kernel === undefined ? {} : { kernel }), declaration, service });
28
+ return Object.freeze({ kernel, declaration, service });
34
29
  }
35
30
  catch (cause) {
36
31
  if (cause instanceof URIError || cause instanceof AuthValueError || cause instanceof TypeError)
@@ -6,7 +6,7 @@ import type { EngineSharedContext, EngineWorkflowContext } from './engine.js';
6
6
  import type { AdmittedDurableServing } from './options.js';
7
7
  type Executor = NonNullable<Identity['executor']>;
8
8
  export interface DurableRun {
9
- readonly kernel?: IssuerId;
9
+ readonly kernel: IssuerId;
10
10
  readonly workflow: RuntimeWorkflow;
11
11
  readonly domain: Domain;
12
12
  readonly executor: Executor;
@@ -61,7 +61,7 @@ async function run(input, context, raw) {
61
61
  }
62
62
  function admitted(workflow, raw, kernel) {
63
63
  const envelope = decodeEnvelope(raw);
64
- if (kernel !== undefined && envelope.execution.kernel !== kernel) {
64
+ if (envelope.execution.kernel !== kernel) {
65
65
  throw new TypeError('Durable envelope Kernel differs from its authenticated endpoint.');
66
66
  }
67
67
  const diagnostics = workflow.callable.validateInput(envelope.input);
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { defineRuntime } from './application/runtime/index.js';
13
13
  export type { Runtime } from './application/runtime/index.js';
14
14
  export { defineWorkflow } from './application/workflow/index.js';
15
15
  export type { Workflow, WorkflowContext } from './application/workflow/index.js';
16
- export { compile, deploy, runtime } from './deployment/index.js';
16
+ export { compile, runtime } from './deployment/index.js';
17
17
  export type { Build, Deployment, Release } from './deployment/index.js';
18
18
  export { defineProject } from './project/index.js';
19
19
  export type { Project } from './project/index.js';
package/dist/index.js CHANGED
@@ -6,6 +6,6 @@ export { defineMutation, executeMutation } from './application/mutation/index.js
6
6
  export { defineCollectionQuery, defineCompositeQuery, defineQuery, executeQuery, } from './application/query/index.js';
7
7
  export { defineRuntime } from './application/runtime/index.js';
8
8
  export { defineWorkflow } from './application/workflow/index.js';
9
- export { compile, deploy, runtime } from './deployment/index.js';
9
+ export { compile, runtime } from './deployment/index.js';
10
10
  export { defineProject } from './project/index.js';
11
11
  export { serve } from './execution/index.js';
@@ -1,6 +1,2 @@
1
1
  /** Graph-local names retain the canonical Kernel type and constructor identity. */
2
- export { LocalBinding as LocalAlias, isLocalBinding as isLocalAlias, } from '@astrale-os/kernel-core/graph/graph';
3
- /** @deprecated Use LocalAlias. */
4
- export { LocalBinding } from '@astrale-os/kernel-core/graph/graph';
5
- /** @deprecated Use isLocalAlias. */
6
- export { isLocalBinding } from '@astrale-os/kernel-core/graph/graph';
2
+ export { LocalAlias, isLocalAlias } from '@astrale-os/kernel-core/graph/graph';
@@ -1,6 +1,2 @@
1
1
  /** Graph-local names retain the canonical Kernel type and constructor identity. */
2
- export { LocalBinding as LocalAlias, isLocalBinding as isLocalAlias, } from '@astrale-os/kernel-core/graph/graph';
3
- /** @deprecated Use LocalAlias. */
4
- export { LocalBinding } from '@astrale-os/kernel-core/graph/graph';
5
- /** @deprecated Use isLocalAlias. */
6
- export { isLocalBinding } from '@astrale-os/kernel-core/graph/graph';
2
+ export { LocalAlias, isLocalAlias } from '@astrale-os/kernel-core/graph/graph';