@astrale-os/kernel-client 0.6.0-beta.72 → 0.6.0-beta.74
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/auth/credential.d.ts +1 -0
- package/dist/auth/credential.js +2 -2
- package/dist/schema/introspection.js +4 -0
- package/dist/session/admission.d.ts +3 -15
- package/dist/session/admission.js +16 -74
- package/dist/session/credential/index.d.ts +1 -1
- package/dist/session/credential/index.js +1 -1
- package/dist/session/credential/provider.d.ts +5 -0
- package/dist/session/credential/provider.js +8 -1
- package/dist/session/exchange/domain.d.ts +27 -0
- package/dist/session/exchange/domain.js +63 -0
- package/dist/session/exchange/exchange.d.ts +54 -0
- package/dist/session/exchange/exchange.js +58 -0
- package/dist/session/exchange/index.d.ts +5 -0
- package/dist/session/exchange/index.js +5 -0
- package/dist/session/exchange/issuer.d.ts +18 -0
- package/dist/session/exchange/issuer.js +89 -0
- package/dist/session/exchange/limits.d.ts +10 -0
- package/dist/session/exchange/limits.js +10 -0
- package/dist/session/exchange/options.d.ts +29 -0
- package/dist/session/exchange/options.js +57 -0
- package/dist/session/exchange/presentation.d.ts +18 -0
- package/dist/session/exchange/presentation.js +73 -0
- package/dist/session/exchange/source.d.ts +34 -0
- package/dist/session/exchange/source.js +78 -0
- package/dist/session/execution.d.ts +65 -0
- package/dist/session/execution.js +35 -0
- package/dist/session/index.d.ts +2 -0
- package/dist/session/index.js +1 -0
- package/dist/session/reference.d.ts +7 -1
- package/dist/session/routing/auth.d.ts +10 -0
- package/dist/session/routing/auth.js +8 -1
- package/dist/session/routing/dispatch.d.ts +2 -1
- package/dist/session/routing/dispatch.js +5 -2
- package/dist/session/routing/index.d.ts +1 -1
- package/dist/session/session.d.ts +16 -0
- package/dist/session/session.js +24 -4
- package/dist/session/session.typecheck.js +32 -1
- package/dist/transport/http/transport.js +0 -1
- package/package.json +5 -5
|
@@ -4,7 +4,7 @@ import { K, KernelSchema } from '@astrale-os/kernel-core/schema';
|
|
|
4
4
|
import { defineSchema, func, method, nodeClass, schema, valueSchema, } from '@astrale-os/kernel-dsl/v1';
|
|
5
5
|
import { isBinaryInput } from '@astrale-os/kernel-dsl/v1/language';
|
|
6
6
|
import { call } from '../client/index.js';
|
|
7
|
-
import { ClientSession, createSessionCredentialProvider, reference } from './index.js';
|
|
7
|
+
import { ClientSession, createSessionCredentialProvider, execution, reference } from './index.js';
|
|
8
8
|
void new ClientSession(options);
|
|
9
9
|
void auth;
|
|
10
10
|
void control;
|
|
@@ -136,6 +136,37 @@ const abstractDomain = schema.resolve(defineSchema('client.reference.typecheck',
|
|
|
136
136
|
AbstractItem: nodeClass({ abstract: true, methods: { abstractMethod } }),
|
|
137
137
|
},
|
|
138
138
|
}));
|
|
139
|
+
const reminderOutput = valueSchema()({
|
|
140
|
+
type: 'object',
|
|
141
|
+
properties: { reminder: { type: 'string' } },
|
|
142
|
+
required: ['reminder'],
|
|
143
|
+
additionalProperties: false,
|
|
144
|
+
});
|
|
145
|
+
const durableDomain = schema.resolve(defineSchema('client.durable.typecheck', {
|
|
146
|
+
classes: {
|
|
147
|
+
Invoice: nodeClass({
|
|
148
|
+
methods: {
|
|
149
|
+
remind: method({
|
|
150
|
+
auth: 'authenticated',
|
|
151
|
+
input: renameInput,
|
|
152
|
+
output: reminderOutput,
|
|
153
|
+
execution: { durable: true },
|
|
154
|
+
}),
|
|
155
|
+
},
|
|
156
|
+
}),
|
|
157
|
+
},
|
|
158
|
+
}));
|
|
159
|
+
const remindReference = reference(durableDomain, durableDomain.classes.Invoice.methods.remind)(Path.id(NodeId('invoice-1')));
|
|
160
|
+
const durableReturnsExecution = true;
|
|
161
|
+
const outcomeIsTyped = true;
|
|
162
|
+
const statusIsTyped = true;
|
|
163
|
+
void session.invoke(execution.result(run), { waitMs: 1_000 });
|
|
164
|
+
void session.invoke(execution.signal(run), { name: 'approval', value: { by: 'billing' } });
|
|
165
|
+
// @ts-expect-error Force is the only cancellation option.
|
|
166
|
+
void session.invoke(execution.cancel(run), { waitMs: 1_000 });
|
|
167
|
+
void durableReturnsExecution;
|
|
168
|
+
void outcomeIsTyped;
|
|
169
|
+
void statusIsTyped;
|
|
139
170
|
// @ts-expect-error Abstract Methods are declarations and cannot become Client references.
|
|
140
171
|
reference(abstractDomain, abstractDomain.classes.AbstractItem.methods.abstractMethod);
|
|
141
172
|
// @ts-expect-error Exact identity is derived internally, never supplied as a Session option.
|
|
@@ -163,7 +163,6 @@ export class HttpTransport {
|
|
|
163
163
|
method: 'POST',
|
|
164
164
|
redirect: 'manual',
|
|
165
165
|
credentials: 'omit',
|
|
166
|
-
cache: 'no-store',
|
|
167
166
|
referrerPolicy: 'no-referrer',
|
|
168
167
|
// Fetch owns Content-Length; the protocol carries Blob.size across Fetch runtimes.
|
|
169
168
|
headers: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/kernel-client",
|
|
3
|
-
"version": "0.6.0-beta.
|
|
3
|
+
"version": "0.6.0-beta.74",
|
|
4
4
|
"description": "Universal Client — protocol-first, transport-agnostic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@astrale-os/kernel-core": "0.9.0-beta.
|
|
69
|
-
"@astrale-os/kernel-dsl": "0.2.0-beta.
|
|
70
|
-
"@astrale-os/kernel-protocol": "0.5.0-beta.
|
|
68
|
+
"@astrale-os/kernel-core": "0.9.0-beta.56",
|
|
69
|
+
"@astrale-os/kernel-dsl": "0.2.0-beta.41",
|
|
70
|
+
"@astrale-os/kernel-protocol": "0.5.0-beta.62",
|
|
71
71
|
"@tanstack/pacer": "0.20.1",
|
|
72
72
|
"msgpackr": "^2.0.5"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@astrale-os/kernel-server": "0.5.0-beta.
|
|
75
|
+
"@astrale-os/kernel-server": "0.5.0-beta.64",
|
|
76
76
|
"@astrale/typescript-config": "npm:@jsr/astrale__typescript-config@~1.1.0",
|
|
77
77
|
"@types/node": "^22.0.0",
|
|
78
78
|
"typescript": "7.0.2",
|