@astrale-os/kernel-core 0.9.0-beta.51 → 0.9.0-beta.53
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/accept.js +4 -0
- package/dist/auth/authority/ownership.optimization.js +12 -0
- package/dist/graph/graph/model/codec.js +1 -1
- package/dist/graph/query/result/index.js +1 -1
- package/dist/schema/domain/domain.d.ts +424 -154
- package/dist/schema/identity/identity.d.ts +27 -9
- package/dist/schema/kernel/projection/index.d.ts +2 -2
- package/dist/schema/kernel/projection/index.js +1 -1
- package/dist/schema/kernel/projection/project.d.ts +3 -1
- package/dist/schema/kernel/projection/project.js +64 -36
- package/dist/schema/kernel/projection/types.d.ts +27 -1
- package/dist/schema/kernel/schema.d.ts +772 -484
- package/dist/schema/kernel/syscalls/contracts/can.d.ts +16 -4
- package/dist/schema/kernel/syscalls/contracts/can.js +11 -3
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/contracts/index.js +1 -1
- package/dist/schema/kernel/syscalls/declarations/can.d.ts +9 -0
- package/dist/schema/kernel/syscalls/declarations/can.js +1 -1
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +9 -0
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +9 -0
- package/package.json +2 -2
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/** Upper bound of one Identity.can batch; a client splits larger check sets. */
|
|
2
|
+
export declare const MAXIMUM_CHECKS = 256;
|
|
3
|
+
/** One check, the original contract, or an ordered batch answered check by check. */
|
|
4
|
+
export declare const canInput: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
2
5
|
policy: import("zod").ZodString;
|
|
3
6
|
object: import("zod").ZodString;
|
|
4
|
-
}, import("zod/v4/core").$strict
|
|
5
|
-
|
|
7
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
8
|
+
checks: import("zod").ZodArray<import("zod").ZodObject<{
|
|
9
|
+
policy: import("zod").ZodString;
|
|
10
|
+
object: import("zod").ZodString;
|
|
11
|
+
}, import("zod/v4/core").$strict>>;
|
|
12
|
+
}, import("zod/v4/core").$strict>]>;
|
|
13
|
+
export declare const canOutput: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
6
14
|
allowed: import("zod").ZodBoolean;
|
|
7
|
-
}, import("zod/v4/core").$strict
|
|
15
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
16
|
+
decisions: import("zod").ZodArray<import("zod").ZodObject<{
|
|
17
|
+
allowed: import("zod").ZodBoolean;
|
|
18
|
+
}, import("zod/v4/core").$strict>>;
|
|
19
|
+
}, import("zod/v4/core").$strict>]>;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import { boolean, strictObject, string } from 'zod';
|
|
1
|
+
import { array, boolean, strictObject, string, union } from 'zod';
|
|
2
|
+
/** Upper bound of one Identity.can batch; a client splits larger check sets. */
|
|
3
|
+
export const MAXIMUM_CHECKS = 256;
|
|
2
4
|
const text = string().min(1);
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
const check = strictObject({ policy: text, object: text });
|
|
6
|
+
const decision = strictObject({ allowed: boolean() });
|
|
7
|
+
/** One check, the original contract, or an ordered batch answered check by check. */
|
|
8
|
+
export const canInput = union([
|
|
9
|
+
check,
|
|
10
|
+
strictObject({ checks: array(check).min(1).max(MAXIMUM_CHECKS) }),
|
|
11
|
+
]);
|
|
12
|
+
export const canOutput = union([decision, strictObject({ decisions: array(decision) })]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { admitInput, admitOutput } from './admit.js';
|
|
2
|
-
export { canInput, canOutput } from './can.js';
|
|
2
|
+
export { MAXIMUM_CHECKS, canInput, canOutput } from './can.js';
|
|
3
3
|
export { delegateInput, delegateOutput } from './delegate.js';
|
|
4
4
|
export { installInput, installReceipt, type DomainRequest, type InstallInput, type InstallReceipt, } from './install.js';
|
|
5
5
|
export { introspectInput } from './introspect.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { admitInput, admitOutput } from './admit.js';
|
|
2
|
-
export { canInput, canOutput } from './can.js';
|
|
2
|
+
export { MAXIMUM_CHECKS, canInput, canOutput } from './can.js';
|
|
3
3
|
export { delegateInput, delegateOutput } from './delegate.js';
|
|
4
4
|
export { installInput, installReceipt, } from './install.js';
|
|
5
5
|
export { introspectInput } from './introspect.js';
|
|
@@ -2,9 +2,18 @@ import { type builder } from '@astrale-os/kernel-dsl/v1';
|
|
|
2
2
|
export declare const Can: builder.Method<builder.CallableProjection<{
|
|
3
3
|
policy: string;
|
|
4
4
|
object: string;
|
|
5
|
+
} | {
|
|
6
|
+
checks: {
|
|
7
|
+
policy: string;
|
|
8
|
+
object: string;
|
|
9
|
+
}[];
|
|
5
10
|
}, {
|
|
6
11
|
readonly mode: 'value';
|
|
7
12
|
readonly value: {
|
|
8
13
|
allowed: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
decisions: {
|
|
16
|
+
allowed: boolean;
|
|
17
|
+
}[];
|
|
9
18
|
};
|
|
10
19
|
}, "authenticated", true, false>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { method } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { canInput, canOutput } from '../contracts/index.js';
|
|
3
3
|
export const Can = method({
|
|
4
|
-
description: 'Determine whether the current authenticated Identity satisfies one installed Policy for one object.',
|
|
4
|
+
description: 'Determine whether the current authenticated Identity satisfies one installed Policy for one object, or each of an ordered batch of at most 256 Policy and object checks.',
|
|
5
5
|
auth: 'authenticated',
|
|
6
6
|
input: canInput,
|
|
7
7
|
output: canOutput,
|
|
@@ -580,10 +580,19 @@ export declare const IdentityMethods: Readonly<{
|
|
|
580
580
|
can: builder.Method<builder.CallableProjection<{
|
|
581
581
|
policy: string;
|
|
582
582
|
object: string;
|
|
583
|
+
} | {
|
|
584
|
+
checks: {
|
|
585
|
+
policy: string;
|
|
586
|
+
object: string;
|
|
587
|
+
}[];
|
|
583
588
|
}, {
|
|
584
589
|
readonly mode: 'value';
|
|
585
590
|
readonly value: {
|
|
586
591
|
allowed: boolean;
|
|
592
|
+
} | {
|
|
593
|
+
decisions: {
|
|
594
|
+
allowed: boolean;
|
|
595
|
+
}[];
|
|
587
596
|
};
|
|
588
597
|
}, "authenticated", true, false>>;
|
|
589
598
|
whoami: builder.Method<builder.CallableProjection<Record<string, never>, {
|
|
@@ -21,10 +21,19 @@ export declare const can: import("./model.js").MethodSyscall<Readonly<{
|
|
|
21
21
|
}>, "can", import("@astrale-os/kernel-dsl/v1").ResolvedMethod<{
|
|
22
22
|
policy: string;
|
|
23
23
|
object: string;
|
|
24
|
+
} | {
|
|
25
|
+
checks: {
|
|
26
|
+
policy: string;
|
|
27
|
+
object: string;
|
|
28
|
+
}[];
|
|
24
29
|
}, {
|
|
25
30
|
readonly mode: 'value';
|
|
26
31
|
readonly value: {
|
|
27
32
|
allowed: boolean;
|
|
33
|
+
} | {
|
|
34
|
+
decisions: {
|
|
35
|
+
allowed: boolean;
|
|
36
|
+
}[];
|
|
28
37
|
};
|
|
29
38
|
}, true, false, "authenticated", import("@astrale-os/kernel-dsl/v1").PolicyCheckExpression<import("@astrale-os/kernel-dsl/v1").PolicyRef, import("@astrale-os/kernel-dsl/v1/language").PolicyCheckObject>, "kernel.astrale.ai:class.Identity.method.can"> & {
|
|
30
39
|
readonly name: "can";
|
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.53",
|
|
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.38",
|
|
164
164
|
"@noble/hashes": "2.3.0",
|
|
165
165
|
"@types/json-schema": "^7.0.15",
|
|
166
166
|
"dequal": "2.0.3"
|