@astrale-os/kernel-server 1.0.0-beta.5 → 1.0.0-beta.7

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.
@@ -67,6 +67,16 @@ export async function nativeResponse(request, snapshot, options, responseCors) {
67
67
  },
68
68
  });
69
69
  }
70
+ if (result.kind === 'execution') {
71
+ // The call has started its Execution: accept it with the reference, never a failure.
72
+ return new Response(encodedBody(codecs.json.encode({ id: result.execution })), {
73
+ status: 202,
74
+ headers: {
75
+ ...responseCors,
76
+ 'content-type': 'application/json',
77
+ },
78
+ });
79
+ }
70
80
  if (result.kind === 'binary') {
71
81
  if (isStreamingBinary(result.value)) {
72
82
  // Hand the operation off only once the streaming response is built. A refused render
@@ -15,6 +15,13 @@ export function renderHttpResult(result, context) {
15
15
  invocation: context.invocation,
16
16
  };
17
17
  break;
18
+ case 'execution':
19
+ envelope = {
20
+ execution: result.execution,
21
+ requestId: context.requestId,
22
+ invocation: context.invocation,
23
+ };
24
+ break;
18
25
  case 'redirect':
19
26
  envelope = renderRedirect(context.requestId, context.invocation, result.redirect);
20
27
  break;
@@ -195,6 +195,13 @@ async function sendResult(socket, codec, requestId, assigned, result, operation,
195
195
  invocation: assigned,
196
196
  }, sendOutput);
197
197
  return;
198
+ case 'execution':
199
+ await send(socket, codec, {
200
+ execution: result.execution,
201
+ requestId,
202
+ invocation: assigned,
203
+ }, sendOutput);
204
+ return;
198
205
  case 'redirect':
199
206
  await send(socket, codec, renderRedirect(requestId, assigned, result.redirect), sendOutput);
200
207
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/kernel-server",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.7",
4
4
  "description": "Portable HTTP and WebSocket boundary for Astrale invocation, Release, installation, and issuer protocols",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -25,9 +25,9 @@
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
- "@astrale-os/kernel-core": "1.0.0-beta.5",
28
+ "@astrale-os/kernel-core": "1.0.0-beta.7",
29
29
  "@astrale-os/kernel-dsl": "1.0.0-beta.3",
30
- "@astrale-os/kernel-protocol": "1.0.0-beta.5",
30
+ "@astrale-os/kernel-protocol": "1.0.0-beta.7",
31
31
  "hono": "^4.6.20"
32
32
  },
33
33
  "devDependencies": {