@astrale-os/kernel-core 0.9.0-beta.41 → 0.9.0-beta.43
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/authority/language/predicate.d.ts +2 -3
- package/dist/schema/kernel/projection/index.d.ts +1 -1
- package/dist/schema/kernel/projection/index.js +1 -1
- package/dist/schema/kernel/schema.d.ts +520 -539
- package/dist/schema/kernel/schema.js +2 -4
- package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +0 -1
- package/dist/schema/kernel/syscalls/contracts/mutate.js +1 -2
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +24 -24
- package/dist/schema/kernel/syscalls/declarations/index.js +1 -0
- package/dist/schema/kernel/syscalls/declarations/install.js +2 -0
- package/dist/schema/kernel/syscalls/declarations/journal.js +2 -0
- package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +23 -24
- package/dist/schema/kernel/syscalls/declarations/mutate.js +2 -0
- package/dist/schema/kernel/syscalls/declarations/query.js +2 -0
- package/dist/schema/kernel/syscalls/declarations/register.js +2 -0
- package/dist/schema/kernel/syscalls/declarations/uninstall.js +2 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.d.ts +4 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.js +9 -0
- package/dist/schema/kernel/syscalls/declarations/view-resolve.js +2 -0
- package/dist/schema/kernel/syscalls/declarations/whois.js +2 -0
- package/package.json +2 -2
|
@@ -6,7 +6,7 @@ import { Class, Extends, InstanceOf } from '../definitions/index.js';
|
|
|
6
6
|
import { Domain as DomainClass, OfDomain } from '../domain/index.js';
|
|
7
7
|
import { ConstrainedBy, ExcludedFrom, ExtendsWith, Identity } from '../identity/index.js';
|
|
8
8
|
import { Descriptable, Edge, Iconable, Named, Node, Remotable, Statused, Timestamped, } from '../meta/index.js';
|
|
9
|
-
import { Functions } from './syscalls/declarations/index.js';
|
|
9
|
+
import { Functions, CanUseSyscall } from './syscalls/declarations/index.js';
|
|
10
10
|
const KernelDefinitions = {
|
|
11
11
|
classes: {
|
|
12
12
|
Descriptable,
|
|
@@ -42,7 +42,7 @@ const KernelDefinitions = {
|
|
|
42
42
|
of_domain: OfDomain,
|
|
43
43
|
view_for: ViewFor,
|
|
44
44
|
},
|
|
45
|
-
policies: {},
|
|
45
|
+
policies: { canUseSyscall: CanUseSyscall },
|
|
46
46
|
functions: Functions,
|
|
47
47
|
};
|
|
48
48
|
const KernelCore = Object.freeze({
|
|
@@ -73,11 +73,9 @@ export const KernelRootFunctions = Object.freeze([
|
|
|
73
73
|
K.functions.mutate,
|
|
74
74
|
K.functions.register,
|
|
75
75
|
K.functions.install,
|
|
76
|
-
K.functions.introspect,
|
|
77
76
|
K.functions.uninstall,
|
|
78
77
|
K.functions.journal,
|
|
79
78
|
K.classes.Identity.static.methods.whois,
|
|
80
|
-
K.classes.Identity.static.methods.mint,
|
|
81
79
|
K.classes.View.static.methods.resolve,
|
|
82
80
|
].sort((left, right) => (left.key < right.key ? -1 : left.key > right.key ? 1 : 0)));
|
|
83
81
|
export { AuthorityOperationOrder, AuthorityOperations, operationOf } from '../authority/index.js';
|
|
@@ -251,7 +251,6 @@ export declare const mutateInput: import("zod").ZodObject<{
|
|
|
251
251
|
origin: import("zod").ZodString;
|
|
252
252
|
revision: import("zod").ZodString;
|
|
253
253
|
}, import("zod/v4/core").$strict>>>;
|
|
254
|
-
idempotencyKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
255
254
|
}, import("zod/v4/core").$strict>;
|
|
256
255
|
export declare const mutateOutput: import("zod").ZodObject<{
|
|
257
256
|
createdNodes: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { strictObject
|
|
1
|
+
import { strictObject } from 'zod';
|
|
2
2
|
import { mutationAstSchema, mutationResultSchema } from '#graph/mutate/wire';
|
|
3
3
|
import { domainExpectations } from './expected.js';
|
|
4
4
|
export const mutateInput = strictObject({
|
|
5
5
|
ast: mutationAstSchema,
|
|
6
6
|
expected: domainExpectations.optional(),
|
|
7
|
-
idempotencyKey: string().min(1).max(256).optional(),
|
|
8
7
|
});
|
|
9
8
|
export const mutateOutput = mutationResultSchema;
|
|
@@ -379,6 +379,29 @@ export declare const Functions: Readonly<{
|
|
|
379
379
|
};
|
|
380
380
|
})[];
|
|
381
381
|
operations: ({
|
|
382
|
+
op: "edge.update";
|
|
383
|
+
edge: {
|
|
384
|
+
source: string;
|
|
385
|
+
target: string;
|
|
386
|
+
class: string;
|
|
387
|
+
};
|
|
388
|
+
slug: unknown;
|
|
389
|
+
props?: {
|
|
390
|
+
set: Record<string, unknown>;
|
|
391
|
+
unset: string[];
|
|
392
|
+
} | undefined;
|
|
393
|
+
} | {
|
|
394
|
+
op: "edge.update";
|
|
395
|
+
edge: {
|
|
396
|
+
source: string;
|
|
397
|
+
target: string;
|
|
398
|
+
class: string;
|
|
399
|
+
};
|
|
400
|
+
props: {
|
|
401
|
+
set: Record<string, unknown>;
|
|
402
|
+
unset: string[];
|
|
403
|
+
};
|
|
404
|
+
} | {
|
|
382
405
|
op: "node.create";
|
|
383
406
|
as: string;
|
|
384
407
|
class: string;
|
|
@@ -406,29 +429,6 @@ export declare const Functions: Readonly<{
|
|
|
406
429
|
};
|
|
407
430
|
slug?: unknown;
|
|
408
431
|
props: Record<string, unknown>;
|
|
409
|
-
} | {
|
|
410
|
-
op: "edge.update";
|
|
411
|
-
edge: {
|
|
412
|
-
source: string;
|
|
413
|
-
target: string;
|
|
414
|
-
class: string;
|
|
415
|
-
};
|
|
416
|
-
slug: unknown;
|
|
417
|
-
props?: {
|
|
418
|
-
set: Record<string, unknown>;
|
|
419
|
-
unset: string[];
|
|
420
|
-
} | undefined;
|
|
421
|
-
} | {
|
|
422
|
-
op: "edge.update";
|
|
423
|
-
edge: {
|
|
424
|
-
source: string;
|
|
425
|
-
target: string;
|
|
426
|
-
class: string;
|
|
427
|
-
};
|
|
428
|
-
props: {
|
|
429
|
-
set: Record<string, unknown>;
|
|
430
|
-
unset: string[];
|
|
431
|
-
};
|
|
432
432
|
} | {
|
|
433
433
|
op: "edge.delete";
|
|
434
434
|
edge: {
|
|
@@ -442,7 +442,6 @@ export declare const Functions: Readonly<{
|
|
|
442
442
|
origin: string;
|
|
443
443
|
revision: string;
|
|
444
444
|
}[] | undefined;
|
|
445
|
-
idempotencyKey?: string | undefined;
|
|
446
445
|
}, {
|
|
447
446
|
readonly mode: 'value';
|
|
448
447
|
readonly value: {
|
|
@@ -690,3 +689,4 @@ export declare const ViewMethods: Readonly<{
|
|
|
690
689
|
};
|
|
691
690
|
}, "authorized", true, "sealed">>;
|
|
692
691
|
}>;
|
|
692
|
+
export { CanUseSyscall } from './use-policy.js';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { func, output } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { installInput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
3
4
|
export const Install = func({
|
|
4
5
|
description: 'Authorize and atomically converge a non-empty set of exact ready Domain generations.',
|
|
5
6
|
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => Install),
|
|
6
8
|
input: installInput,
|
|
7
9
|
output: output.binary(),
|
|
8
10
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { func } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { journalInput, journalOutput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
3
4
|
export const Journal = func({
|
|
4
5
|
description: 'Read one authorized page of semantic operations from the kernel journal.',
|
|
5
6
|
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => Journal),
|
|
6
8
|
input: journalInput,
|
|
7
9
|
output: journalOutput,
|
|
8
10
|
});
|
|
@@ -155,29 +155,6 @@ export declare const Mutate: builder.Function<builder.CallableProjection<{
|
|
|
155
155
|
};
|
|
156
156
|
})[];
|
|
157
157
|
operations: ({
|
|
158
|
-
op: "edge.update";
|
|
159
|
-
edge: {
|
|
160
|
-
source: string;
|
|
161
|
-
target: string;
|
|
162
|
-
class: string;
|
|
163
|
-
};
|
|
164
|
-
slug: unknown;
|
|
165
|
-
props?: {
|
|
166
|
-
set: Record<string, unknown>;
|
|
167
|
-
unset: string[];
|
|
168
|
-
} | undefined;
|
|
169
|
-
} | {
|
|
170
|
-
op: "edge.update";
|
|
171
|
-
edge: {
|
|
172
|
-
source: string;
|
|
173
|
-
target: string;
|
|
174
|
-
class: string;
|
|
175
|
-
};
|
|
176
|
-
props: {
|
|
177
|
-
set: Record<string, unknown>;
|
|
178
|
-
unset: string[];
|
|
179
|
-
};
|
|
180
|
-
} | {
|
|
181
158
|
op: "node.create";
|
|
182
159
|
as: string;
|
|
183
160
|
class: string;
|
|
@@ -205,6 +182,29 @@ export declare const Mutate: builder.Function<builder.CallableProjection<{
|
|
|
205
182
|
};
|
|
206
183
|
slug?: unknown;
|
|
207
184
|
props: Record<string, unknown>;
|
|
185
|
+
} | {
|
|
186
|
+
op: "edge.update";
|
|
187
|
+
edge: {
|
|
188
|
+
source: string;
|
|
189
|
+
target: string;
|
|
190
|
+
class: string;
|
|
191
|
+
};
|
|
192
|
+
slug: unknown;
|
|
193
|
+
props?: {
|
|
194
|
+
set: Record<string, unknown>;
|
|
195
|
+
unset: string[];
|
|
196
|
+
} | undefined;
|
|
197
|
+
} | {
|
|
198
|
+
op: "edge.update";
|
|
199
|
+
edge: {
|
|
200
|
+
source: string;
|
|
201
|
+
target: string;
|
|
202
|
+
class: string;
|
|
203
|
+
};
|
|
204
|
+
props: {
|
|
205
|
+
set: Record<string, unknown>;
|
|
206
|
+
unset: string[];
|
|
207
|
+
};
|
|
208
208
|
} | {
|
|
209
209
|
op: "edge.delete";
|
|
210
210
|
edge: {
|
|
@@ -218,7 +218,6 @@ export declare const Mutate: builder.Function<builder.CallableProjection<{
|
|
|
218
218
|
origin: string;
|
|
219
219
|
revision: string;
|
|
220
220
|
}[] | undefined;
|
|
221
|
-
idempotencyKey?: string | undefined;
|
|
222
221
|
}, {
|
|
223
222
|
readonly mode: 'value';
|
|
224
223
|
readonly value: {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { func } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { mutateInput, mutateOutput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
3
4
|
export const Mutate = func({
|
|
4
5
|
description: 'Validate, authorize, and commit one atomic graph mutation.',
|
|
5
6
|
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => Mutate),
|
|
6
8
|
input: mutateInput,
|
|
7
9
|
output: mutateOutput,
|
|
8
10
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { func } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { queryInput, queryOutput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
3
4
|
export const Query = func({
|
|
4
5
|
description: 'Execute one finite authorized graph query.',
|
|
5
6
|
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => Query),
|
|
6
8
|
input: queryInput,
|
|
7
9
|
output: queryOutput,
|
|
8
10
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { func } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { registerInput, registerOutput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
3
4
|
export const Register = func({
|
|
4
5
|
description: 'Atomically establish credential-evidenced, write-once Authentication on existing Identity-bearing Nodes.',
|
|
5
6
|
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => Register),
|
|
6
8
|
input: registerInput,
|
|
7
9
|
output: registerOutput,
|
|
8
10
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { func } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { uninstallInput, uninstallOutput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
3
4
|
export const Uninstall = func({
|
|
4
5
|
description: 'Durably uninstall one Domain installation epoch and return its terminal receipt.',
|
|
5
6
|
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => Uninstall),
|
|
6
8
|
input: uninstallInput,
|
|
7
9
|
output: uninstallOutput,
|
|
8
10
|
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type builder } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
/** Explicit capability admission chosen by protected Kernel callables. */
|
|
3
|
+
export declare const CanUseSyscall: builder.Policy;
|
|
4
|
+
export declare function usePolicy(callable: () => builder.Function | builder.Method): builder.CallablePolicyBuilder;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { policy } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
import { CanUse } from '../../../authority/index.js';
|
|
3
|
+
/** Explicit capability admission chosen by protected Kernel callables. */
|
|
4
|
+
export const CanUseSyscall = policy({
|
|
5
|
+
match: ({ edge, subject, object }) => edge({ source: subject, class: () => CanUse, target: object }),
|
|
6
|
+
});
|
|
7
|
+
export function usePolicy(callable) {
|
|
8
|
+
return ({ check, ref }) => check(CanUseSyscall, ref(callable));
|
|
9
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { method } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { viewResolveInput, viewResolveOutput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
3
4
|
export const ViewResolve = method({
|
|
4
5
|
description: 'Resolve the installed View declarations applicable to one authorized graph target.',
|
|
5
6
|
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => ViewResolve),
|
|
6
8
|
input: viewResolveInput,
|
|
7
9
|
output: viewResolveOutput,
|
|
8
10
|
static: true,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { method } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { whoisInput, whoisOutput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
3
4
|
export const Whois = method({
|
|
4
5
|
description: 'Resolve one issuer-and-subject Identity.',
|
|
5
6
|
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => Whois),
|
|
6
8
|
input: whoisInput,
|
|
7
9
|
output: whoisOutput,
|
|
8
10
|
static: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/kernel-core",
|
|
3
|
-
"version": "0.9.0-beta.
|
|
3
|
+
"version": "0.9.0-beta.43",
|
|
4
4
|
"description": "Astrale Kernel Core - Types, Invariants, and Pure Logic",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"access": "public"
|
|
161
161
|
},
|
|
162
162
|
"dependencies": {
|
|
163
|
-
"@astrale-os/kernel-dsl": "0.2.0-beta.
|
|
163
|
+
"@astrale-os/kernel-dsl": "0.2.0-beta.31",
|
|
164
164
|
"@noble/hashes": "2.3.0",
|
|
165
165
|
"@types/json-schema": "^7.0.15",
|
|
166
166
|
"dequal": "2.0.3"
|