@astrale-os/kernel-client 1.0.0-beta.33 → 1.0.0-beta.35
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EdgeKey } from '@astrale-os/kernel-core/graph/edge';
|
|
1
|
+
import type { EdgeKey, EdgeSlug } from '@astrale-os/kernel-core/graph/edge';
|
|
2
2
|
import type { FactId } from '@astrale-os/kernel-core/graph/formula';
|
|
3
3
|
import type { Answer, QueryResult, Undecided, wire } from '@astrale-os/kernel-core/graph/query';
|
|
4
4
|
import type { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
@@ -48,15 +48,17 @@ export interface QueryItem {
|
|
|
48
48
|
}>>>;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
|
-
* What a Query answers, by its family: a list's Page, the table of the facts it
|
|
52
|
-
* renders
|
|
53
|
-
* an `exists`; or a `count`.
|
|
51
|
+
* What a Query answers, by its family: a list's Page, the table of the facts it renders as values,
|
|
52
|
+
* with an Edge's slug where an item asking it renders the Edge, the revision it was read at and
|
|
53
|
+
* whether its cursor came from another (W6); an `exists`; or a `count`.
|
|
54
54
|
*/
|
|
55
55
|
export type QueryAnswer = {
|
|
56
56
|
readonly list: QueryPage;
|
|
57
|
-
readonly facts: Extract<Answer, {
|
|
57
|
+
readonly facts: readonly (Extract<Answer, {
|
|
58
58
|
readonly list: unknown;
|
|
59
|
-
}>['facts']
|
|
59
|
+
}>['facts'][number] & {
|
|
60
|
+
readonly slug?: EdgeSlug;
|
|
61
|
+
})[];
|
|
60
62
|
readonly revision: string;
|
|
61
63
|
readonly revised?: true;
|
|
62
64
|
} | Exclude<Answer, {
|
package/dist/graph/query.js
CHANGED
|
@@ -122,7 +122,11 @@ function decodeAnswer(input, family) {
|
|
|
122
122
|
return refuse();
|
|
123
123
|
}
|
|
124
124
|
const answer = value;
|
|
125
|
-
|
|
125
|
+
if (!('list' in answer))
|
|
126
|
+
return answer;
|
|
127
|
+
// Only an Edge carries a slug.
|
|
128
|
+
const slugs = answer.facts.every(({ fact, slug }) => slug === undefined || typeof fact !== 'string');
|
|
129
|
+
return slugs && pagesClosed(answer.list) ? answer : refuse();
|
|
126
130
|
}
|
|
127
131
|
/**
|
|
128
132
|
* Every Page, its Branches' included, carries a cursor exactly when an item follows it (W3), and
|
|
@@ -43,9 +43,11 @@ declare function overloads(): Promise<readonly [QueryResponse<import("@astrale-o
|
|
|
43
43
|
kind: "value";
|
|
44
44
|
}>>, {
|
|
45
45
|
readonly list: import("./page-contract.js").QueryPage;
|
|
46
|
-
readonly facts: Extract<import("@astrale-os/kernel-core/graph/query").Answer, {
|
|
46
|
+
readonly facts: readonly (Extract<import("@astrale-os/kernel-core/graph/query").Answer, {
|
|
47
47
|
readonly list: unknown;
|
|
48
|
-
}>['facts']
|
|
48
|
+
}>['facts'][number] & {
|
|
49
|
+
readonly slug?: import("@astrale-os/kernel-core/graph/edge").EdgeSlug;
|
|
50
|
+
})[];
|
|
49
51
|
readonly revision: string;
|
|
50
52
|
readonly revised?: true;
|
|
51
53
|
}, {
|
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.35",
|
|
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.
|
|
69
|
-
"@astrale-os/kernel-dsl": "1.0.0-beta.
|
|
70
|
-
"@astrale-os/kernel-protocol": "1.0.0-beta.
|
|
68
|
+
"@astrale-os/kernel-core": "1.0.0-beta.32",
|
|
69
|
+
"@astrale-os/kernel-dsl": "1.0.0-beta.21",
|
|
70
|
+
"@astrale-os/kernel-protocol": "1.0.0-beta.32",
|
|
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.32",
|
|
75
75
|
"@astrale/typescript-config": "npm:@jsr/astrale__typescript-config@~1.1.0",
|
|
76
76
|
"@types/node": "^22.0.0",
|
|
77
77
|
"esbuild": "0.28.1",
|