@astrale-os/kernel-core 0.9.0-beta.50 → 0.9.0-beta.52

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,7 +1,19 @@
1
- export declare const canInput: import("zod").ZodObject<{
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
- export declare const canOutput: import("zod").ZodObject<{
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
- export const canInput = strictObject({ policy: text, object: text });
4
- export const canOutput = strictObject({ allowed: boolean() });
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.50",
3
+ "version": "0.9.0-beta.52",
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.35",
163
+ "@astrale-os/kernel-dsl": "0.2.0-beta.37",
164
164
  "@noble/hashes": "2.3.0",
165
165
  "@types/json-schema": "^7.0.15",
166
166
  "dequal": "2.0.3"