@astrale-os/kernel-core 0.9.0-beta.59 → 0.9.0-beta.60

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.
@@ -5,6 +5,7 @@ export declare const limits: {
5
5
  readonly operandsPerExpression: 512;
6
6
  readonly localsPerExpression: 64;
7
7
  readonly classesPerLocal: 1024;
8
+ readonly classesPerRelation: 1024;
8
9
  readonly repeatMaximum: 16;
9
10
  };
10
11
  export declare const MAX_BOOLEAN_OPERANDS: 512;
@@ -8,6 +8,7 @@ export const limits = Object.freeze({
8
8
  operandsPerExpression: 512,
9
9
  localsPerExpression: 64,
10
10
  classesPerLocal: 1024,
11
+ classesPerRelation: 1024,
11
12
  repeatMaximum: 16,
12
13
  });
13
14
  export const MAX_BOOLEAN_OPERANDS = limits.operandsPerExpression;
@@ -61,12 +62,12 @@ function admit(input, path, locals, subjectBound, depth) {
61
62
  case 'related': {
62
63
  const hasRepeat = Object.hasOwn(value, 'repeat');
63
64
  exact(value, hasRepeat
64
- ? ['class', 'op', 'repeat', 'source', 'target']
65
- : ['class', 'op', 'source', 'target'], path);
65
+ ? ['classes', 'op', 'repeat', 'source', 'target']
66
+ : ['classes', 'op', 'source', 'target'], path);
66
67
  return {
67
68
  op: 'related',
68
69
  source: term(value.source, `${path}/source`, locals, subjectBound),
69
- class: edgeClassRef(value.class, `${path}/class`),
70
+ classes: array(value.classes, `${path}/classes`, 1, limits.classesPerRelation).map((entry, index) => edgeClassRef(entry, `${path}/classes/${index}`)),
70
71
  target: term(value.target, `${path}/target`, locals, subjectBound),
71
72
  ...(hasRepeat ? { repeat: repeat(value.repeat, `${path}/repeat`) } : {}),
72
73
  };
@@ -1,7 +1,7 @@
1
1
  import type { ClassRef, CoreRef, FunctionRef, PolicyRef, ViewRef, Key } from '@astrale-os/kernel-dsl/v1/addressing';
2
2
  import type { NodeId } from '../../../graph/node/index.js';
3
3
  import type { Grant } from '../../grant/index.js';
4
- export declare const AUTHORITY_PREDICATE_VERSION: 8;
4
+ export declare const AUTHORITY_PREDICATE_VERSION: 9;
5
5
  export type Operation = 'create' | 'read' | 'traverse' | 'update' | 'delete';
6
6
  export type Input = 'object' | 'source' | 'target';
7
7
  export type { ClassRef } from '@astrale-os/kernel-dsl/v1/addressing';
@@ -70,9 +70,10 @@ export type AuthorityExpr = {
70
70
  readonly grant: Grant;
71
71
  readonly where: AuthorityExpr;
72
72
  } | {
73
+ /** One concrete Class relation extent, reused at every bounded hop. */
73
74
  readonly op: 'related';
74
75
  readonly source: Term;
75
- readonly class: ClassRef;
76
+ readonly classes: readonly [ClassRef, ...ClassRef[]];
76
77
  readonly target: Term;
77
78
  readonly repeat?: Repeat;
78
79
  } | {
@@ -1 +1 @@
1
- export const AUTHORITY_PREDICATE_VERSION = 8;
1
+ export const AUTHORITY_PREDICATE_VERSION = 9;
@@ -60,7 +60,7 @@ function normalize(expr, path, locals, subjectBound) {
60
60
  return Object.freeze({
61
61
  op: 'related',
62
62
  source: normalizeTerm(expr.source),
63
- class: Object.freeze({ ...expr.class }),
63
+ classes: normalizeClasses(expr.classes),
64
64
  target: normalizeTerm(expr.target),
65
65
  ...(expr.repeat === undefined ? {} : { repeat: Object.freeze({ ...expr.repeat }) }),
66
66
  });
@@ -144,12 +144,11 @@ function normalizeTerm(term) {
144
144
  function normalizeLocal(local) {
145
145
  if (local.kind === 'any')
146
146
  return Object.freeze({ id: local.id, kind: 'any' });
147
- const classes = new Map(local.classes.map((ref) => [classKey(ref), Object.freeze({ ...ref })]));
148
- return Object.freeze({
149
- id: local.id,
150
- kind: 'classes',
151
- classes: Object.freeze([...classes.entries()].sort(([left], [right]) => compare(left, right)).map(([, ref]) => ref)),
152
- });
147
+ return Object.freeze({ id: local.id, kind: 'classes', classes: normalizeClasses(local.classes) });
148
+ }
149
+ function normalizeClasses(input) {
150
+ const classes = new Map(input.map((ref) => [classKey(ref), Object.freeze({ ...ref })]));
151
+ return Object.freeze([...classes.entries()].sort(([left], [right]) => compare(left, right)).map(([, ref]) => ref));
153
152
  }
154
153
  function classKey(ref) {
155
154
  return `${ref.origin}:${ref.kind}.${ref.name}`;
@@ -8944,24 +8944,16 @@ export declare const AuthorityRelations: Readonly<{
8944
8944
  };
8945
8945
  }>;
8946
8946
  /** Exact authorized Kernel Functions for which pristine Root receives direct can_use authority. */
8947
- export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-dsl/v1").ResolvedFunction<import("@astrale-os/kernel-dsl/v1").BinaryInputProjection<{
8948
- mediaType: string;
8949
- }>, {
8950
- readonly mode: 'value';
8951
- readonly value: {
8952
- receipt: string;
8953
- ref: {
8954
- digest: string;
8955
- mediaType: string;
8956
- size: number;
8957
- };
8958
- expiresAt: string;
8959
- };
8947
+ export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
8948
+ node: string;
8949
+ property: string;
8950
+ }, {
8951
+ readonly mode: 'binary';
8960
8952
  }, "authorized", import("@astrale-os/kernel-dsl/v1").PolicyCheckExpression<import("@astrale-os/kernel-dsl/v1").PolicyRef, import("@astrale-os/kernel-dsl/v1/language").PolicyCheckObject>> & {
8961
- readonly ref: import("@astrale-os/kernel-dsl/v1").FunctionRef<"upload"> & {
8953
+ readonly ref: import("@astrale-os/kernel-dsl/v1").FunctionRef<"download"> & {
8962
8954
  readonly origin: "kernel.astrale.ai";
8963
8955
  };
8964
- readonly key: "kernel.astrale.ai:function.upload";
8956
+ readonly key: "kernel.astrale.ai:function.download";
8965
8957
  readonly execution: undefined;
8966
8958
  }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
8967
8959
  operation: string;
@@ -8989,6 +8981,39 @@ export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-
8989
8981
  };
8990
8982
  readonly key: "kernel.astrale.ai:function.install";
8991
8983
  readonly execution: undefined;
8984
+ }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
8985
+ invocation?: {
8986
+ source: string;
8987
+ id: string;
8988
+ } | undefined;
8989
+ topics?: {
8990
+ exact?: string[] | undefined;
8991
+ prefixes?: string[] | undefined;
8992
+ } | undefined;
8993
+ principal?: string | undefined;
8994
+ since?: string | undefined;
8995
+ until?: string | undefined;
8996
+ cursor?: string | undefined;
8997
+ limit?: number | undefined;
8998
+ }, {
8999
+ readonly mode: 'value';
9000
+ readonly value: {
9001
+ records: unknown[];
9002
+ frontier: {
9003
+ id: string;
9004
+ first?: number | undefined;
9005
+ committed: number;
9006
+ durable: number;
9007
+ };
9008
+ cursor?: string | undefined;
9009
+ gap?: unknown;
9010
+ };
9011
+ }, "authorized", import("@astrale-os/kernel-dsl/v1").PolicyCheckExpression<import("@astrale-os/kernel-dsl/v1").PolicyRef, import("@astrale-os/kernel-dsl/v1/language").PolicyCheckObject>> & {
9012
+ readonly ref: import("@astrale-os/kernel-dsl/v1").FunctionRef<"journal"> & {
9013
+ readonly origin: "kernel.astrale.ai";
9014
+ };
9015
+ readonly key: "kernel.astrale.ai:function.journal";
9016
+ readonly execution: undefined;
8992
9017
  }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
8993
9018
  ast: {
8994
9019
  format: "astrale.graph.mutation";
@@ -9447,17 +9472,6 @@ export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-
9447
9472
  };
9448
9473
  readonly key: "kernel.astrale.ai:function.query";
9449
9474
  readonly execution: undefined;
9450
- }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
9451
- node: string;
9452
- property: string;
9453
- }, {
9454
- readonly mode: 'binary';
9455
- }, "authorized", import("@astrale-os/kernel-dsl/v1").PolicyCheckExpression<import("@astrale-os/kernel-dsl/v1").PolicyRef, import("@astrale-os/kernel-dsl/v1/language").PolicyCheckObject>> & {
9456
- readonly ref: import("@astrale-os/kernel-dsl/v1").FunctionRef<"download"> & {
9457
- readonly origin: "kernel.astrale.ai";
9458
- };
9459
- readonly key: "kernel.astrale.ai:function.download";
9460
- readonly execution: undefined;
9461
9475
  }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
9462
9476
  idempotencyKey: string;
9463
9477
  identities: ({
@@ -9531,38 +9545,36 @@ export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-
9531
9545
  };
9532
9546
  readonly key: "kernel.astrale.ai:function.uninstall";
9533
9547
  readonly execution: undefined;
9534
- }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
9535
- invocation?: {
9536
- source: string;
9537
- id: string;
9538
- } | undefined;
9539
- topics?: {
9540
- exact?: string[] | undefined;
9541
- prefixes?: string[] | undefined;
9542
- } | undefined;
9543
- principal?: string | undefined;
9544
- since?: string | undefined;
9545
- until?: string | undefined;
9546
- cursor?: string | undefined;
9547
- limit?: number | undefined;
9548
- }, {
9548
+ }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<import("@astrale-os/kernel-dsl/v1").BinaryInputProjection<{
9549
+ mediaType: string;
9550
+ }>, {
9549
9551
  readonly mode: 'value';
9550
9552
  readonly value: {
9551
- records: unknown[];
9552
- frontier: {
9553
- id: string;
9554
- first?: number | undefined;
9555
- committed: number;
9556
- durable: number;
9553
+ receipt: string;
9554
+ ref: {
9555
+ digest: string;
9556
+ mediaType: string;
9557
+ size: number;
9557
9558
  };
9558
- cursor?: string | undefined;
9559
- gap?: unknown;
9559
+ expiresAt: string;
9560
9560
  };
9561
9561
  }, "authorized", import("@astrale-os/kernel-dsl/v1").PolicyCheckExpression<import("@astrale-os/kernel-dsl/v1").PolicyRef, import("@astrale-os/kernel-dsl/v1/language").PolicyCheckObject>> & {
9562
- readonly ref: import("@astrale-os/kernel-dsl/v1").FunctionRef<"journal"> & {
9562
+ readonly ref: import("@astrale-os/kernel-dsl/v1").FunctionRef<"upload"> & {
9563
9563
  readonly origin: "kernel.astrale.ai";
9564
9564
  };
9565
- readonly key: "kernel.astrale.ai:function.journal";
9565
+ readonly key: "kernel.astrale.ai:function.upload";
9566
+ readonly execution: undefined;
9567
+ }) | (import("@astrale-os/kernel-dsl/v1").ResolvedMethod<{
9568
+ audience?: string | undefined;
9569
+ ttlSeconds: number;
9570
+ grant?: unknown;
9571
+ identity: string;
9572
+ }, {
9573
+ readonly mode: 'value';
9574
+ readonly value: string;
9575
+ }, true, false, "authorized", 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.impersonate"> & {
9576
+ readonly name: "impersonate";
9577
+ readonly executable: true;
9566
9578
  readonly execution: undefined;
9567
9579
  }) | (import("@astrale-os/kernel-dsl/v1").ResolvedMethod<{
9568
9580
  iss: string;
@@ -9591,18 +9603,6 @@ export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-
9591
9603
  readonly name: "whois";
9592
9604
  readonly executable: true;
9593
9605
  readonly execution: undefined;
9594
- }) | (import("@astrale-os/kernel-dsl/v1").ResolvedMethod<{
9595
- audience?: string | undefined;
9596
- ttlSeconds: number;
9597
- grant?: unknown;
9598
- identity: string;
9599
- }, {
9600
- readonly mode: 'value';
9601
- readonly value: string;
9602
- }, true, false, "authorized", 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.impersonate"> & {
9603
- readonly name: "impersonate";
9604
- readonly executable: true;
9605
- readonly execution: undefined;
9606
9606
  }) | (import("@astrale-os/kernel-dsl/v1").ResolvedMethod<{
9607
9607
  target: string;
9608
9608
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/kernel-core",
3
- "version": "0.9.0-beta.59",
3
+ "version": "0.9.0-beta.60",
4
4
  "description": "Astrale Kernel Core - Types, Invariants, and Pure Logic",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {