@astrale-os/kernel-client 1.0.0-beta.4 → 1.0.0-beta.6
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.
- package/dist/client/index.d.ts +1 -1
- package/dist/client/request.d.ts +1 -0
- package/dist/client/request.js +17 -0
- package/dist/client/result.d.ts +4 -1
- package/dist/client/result.js +10 -4
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.js +1 -0
- package/dist/errors/refusal.d.ts +12 -0
- package/dist/errors/refusal.js +40 -0
- package/dist/graph/domain/binding.js +4 -0
- package/dist/graph/page-contract.d.ts +6 -0
- package/dist/graph/query.js +10 -2
- package/dist/pacer/index.d.ts +1 -1
- package/dist/pacer/index.js +1 -1
- package/dist/pacer/retry/index.d.ts +1 -0
- package/dist/pacer/retry/index.js +1 -0
- package/dist/pacer/retry/refusals.d.ts +7 -0
- package/dist/pacer/retry/refusals.js +10 -0
- package/dist/pacer/retry/retry.d.ts +2 -0
- package/dist/pacer/retry/retry.js +33 -1
- package/dist/schema/admission.d.ts +1 -1
- package/dist/schema/admission.js +2 -2
- package/dist/schema/contracts.d.ts +95 -2
- package/dist/schema/index.d.ts +2 -1
- package/dist/schema/installation.d.ts +104 -0
- package/dist/schema/installation.js +144 -0
- package/dist/schema/schema.d.ts +18 -3
- package/dist/schema/schema.js +31 -35
- package/dist/session/bound.js +42 -0
- package/dist/session/execution.d.ts +24 -1
- package/dist/session/index.d.ts +1 -1
- package/dist/session/reference.d.ts +8 -4
- package/dist/session/reference.js +7 -2
- package/dist/session/routing/dispatch.js +2 -0
- package/dist/session/routing/request.d.ts +4 -0
- package/dist/session/routing/request.js +11 -1
- package/dist/session/routing/result.d.ts +1 -1
- package/dist/session/routing/result.js +5 -1
- package/dist/session/session.js +10 -7
- package/dist/store/memory.js +20 -1
- package/dist/transport/http/admission.js +3 -0
- package/dist/transport/transport.d.ts +10 -0
- package/dist/transport/websocket/exchange.js +8 -0
- package/package.json +4 -4
|
@@ -90,6 +90,9 @@ export async function admitResponse(response, requestId, context) {
|
|
|
90
90
|
throw new ResponseError(envelope.error.code, envelope.error.message, envelope.invocation, envelope.error.data);
|
|
91
91
|
}
|
|
92
92
|
requireLive(control);
|
|
93
|
+
if ('execution' in envelope) {
|
|
94
|
+
return { kind: 'execution', execution: envelope.execution, invocation: envelope.invocation };
|
|
95
|
+
}
|
|
93
96
|
return { kind: 'value', value: envelope.result, invocation: envelope.invocation };
|
|
94
97
|
}
|
|
95
98
|
function redirectResult(response) {
|
|
@@ -4,6 +4,14 @@ export interface RequestOptions {
|
|
|
4
4
|
readonly signal?: AbortSignal;
|
|
5
5
|
readonly timeoutMs?: number;
|
|
6
6
|
readonly idempotencyKey?: protocol.IdempotencyKey;
|
|
7
|
+
/**
|
|
8
|
+
* The maintenance session a root request expects to act within, by its install execution id. It
|
|
9
|
+
* grants nothing: the Kernel refuses the request `MAINTENANCE_SESSION_STALE` unless that session
|
|
10
|
+
* is the Instance's live one. The Client carries it in the source request, never to a destination.
|
|
11
|
+
*/
|
|
12
|
+
readonly maintenance?: {
|
|
13
|
+
readonly session: string;
|
|
14
|
+
};
|
|
7
15
|
}
|
|
8
16
|
export interface TransportRequest {
|
|
9
17
|
readonly call: protocol.Call;
|
|
@@ -14,6 +22,8 @@ export interface TransportRequest {
|
|
|
14
22
|
readonly routing?: protocol.Routing;
|
|
15
23
|
/** Source-Kernel Schema Registration precondition; omitted after routing. */
|
|
16
24
|
readonly schema?: protocol.SchemaTarget;
|
|
25
|
+
/** Source-Kernel maintenance session guard; omitted after routing. */
|
|
26
|
+
readonly maintenance?: protocol.Maintenance;
|
|
17
27
|
}
|
|
18
28
|
/** Correlated reserved control decoded independently from application results and errors. */
|
|
19
29
|
export interface StaleControl {
|
|
@@ -153,6 +153,14 @@ export class WebSocketExchange {
|
|
|
153
153
|
this.reject(new ResponseError(response.error.code, response.error.message, response.invocation, response.error.data));
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
+
if ('execution' in response) {
|
|
157
|
+
this.complete({
|
|
158
|
+
kind: 'execution',
|
|
159
|
+
execution: response.execution,
|
|
160
|
+
invocation: response.invocation,
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
156
164
|
this.complete({ kind: 'value', value: response.result, invocation: response.invocation });
|
|
157
165
|
}
|
|
158
166
|
receiveStreamFrame(frame) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/kernel-client",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.6",
|
|
4
4
|
"description": "Universal Client — protocol-first, transport-agnostic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@astrale-os/kernel-core": "1.0.0-beta.
|
|
68
|
+
"@astrale-os/kernel-core": "1.0.0-beta.6",
|
|
69
69
|
"@astrale-os/kernel-dsl": "1.0.0-beta.3",
|
|
70
|
-
"@astrale-os/kernel-protocol": "1.0.0-beta.
|
|
70
|
+
"@astrale-os/kernel-protocol": "1.0.0-beta.6",
|
|
71
71
|
"@tanstack/pacer": "0.20.1"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@astrale-os/kernel-server": "1.0.0-beta.
|
|
74
|
+
"@astrale-os/kernel-server": "1.0.0-beta.6",
|
|
75
75
|
"@astrale/typescript-config": "npm:@jsr/astrale__typescript-config@~1.1.0",
|
|
76
76
|
"@types/node": "^22.0.0",
|
|
77
77
|
"typescript": "7.0.2",
|