@astrale-os/kernel-protocol 1.0.0-beta.6 → 1.0.0-beta.8
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.
|
@@ -19,6 +19,11 @@ export interface ErrorResponse extends ResponseContext {
|
|
|
19
19
|
/** A durable call's answer: the Execution it started or recovered, never a handler result. */
|
|
20
20
|
export interface ExecutionResponse extends ResponseContext {
|
|
21
21
|
readonly execution: NodeId;
|
|
22
|
+
/**
|
|
23
|
+
* False when this call created the Execution, true when its key already named it; absent when
|
|
24
|
+
* the Host does not say.
|
|
25
|
+
*/
|
|
26
|
+
readonly replayed?: boolean;
|
|
22
27
|
}
|
|
23
28
|
export type Response<Result extends Value = Value> = SuccessResponse<Result> | ErrorResponse | ExecutionResponse | RedirectResponse | Stale | Miss;
|
|
24
29
|
export declare function decodeResponse(input: unknown): Response;
|
|
@@ -5,7 +5,7 @@ import { decodeRedirectResponse } from './redirect.js';
|
|
|
5
5
|
import { decodeStale } from './stale-route.js';
|
|
6
6
|
const SUCCESS_FIELDS = new Set(['result', 'requestId', 'invocation']);
|
|
7
7
|
const ERROR_FIELDS = new Set(['error', 'requestId', 'invocation']);
|
|
8
|
-
const EXECUTION_FIELDS = new Set(['execution', 'requestId', 'invocation']);
|
|
8
|
+
const EXECUTION_FIELDS = new Set(['execution', 'replayed', 'requestId', 'invocation']);
|
|
9
9
|
export function decodeResponse(input) {
|
|
10
10
|
const object = portableObject(input, 'response');
|
|
11
11
|
const outcomes = ['result', 'error', 'execution'].filter((field) => Object.hasOwn(object, field));
|
|
@@ -33,8 +33,11 @@ export function decodeResponse(input) {
|
|
|
33
33
|
required(object, ['requestId', 'execution', 'invocation'], 'response');
|
|
34
34
|
if (!isNodeId(object.execution))
|
|
35
35
|
invalid('response.execution must be a NodeId');
|
|
36
|
+
if (Object.hasOwn(object, 'replayed') && typeof object.replayed !== 'boolean')
|
|
37
|
+
invalid('response.replayed must be a boolean');
|
|
36
38
|
return Object.freeze({
|
|
37
39
|
execution: object.execution,
|
|
40
|
+
...(typeof object.replayed === 'boolean' ? { replayed: object.replayed } : {}),
|
|
38
41
|
requestId: requestId(object.requestId, 'response.requestId'),
|
|
39
42
|
invocation: invocation(object.invocation, 'response.invocation'),
|
|
40
43
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/kernel-protocol",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
4
|
"description": "Portable Astrale invocation, Release, installation, routing, and issuer protocols",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@astrale-os/kernel-core": "1.0.0-beta.
|
|
92
|
+
"@astrale-os/kernel-core": "1.0.0-beta.8",
|
|
93
93
|
"@astrale-os/kernel-dsl": "1.0.0-beta.3",
|
|
94
94
|
"@noble/hashes": "2.3.0"
|
|
95
95
|
},
|