@astrale-os/kernel-core 0.9.0-beta.43 → 0.9.0-beta.44

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.
Files changed (61) hide show
  1. package/dist/callable/index.d.ts +1 -1
  2. package/dist/callable/index.js +1 -1
  3. package/dist/callable/invocation/call.d.ts +13 -2
  4. package/dist/callable/invocation/call.js +40 -1
  5. package/dist/callable/invocation/index.d.ts +1 -1
  6. package/dist/callable/invocation/index.js +1 -1
  7. package/dist/graph/path/authoring/path.d.ts +2 -1
  8. package/dist/graph/path/authoring/path.js +7 -2
  9. package/dist/graph/path/language/model.d.ts +8 -3
  10. package/dist/graph/path/language/syntax.js +23 -8
  11. package/dist/schema/authority/operation-node.d.ts +2 -0
  12. package/dist/schema/authority/policy.d.ts +2 -0
  13. package/dist/schema/callables/function.d.ts +16 -6
  14. package/dist/schema/callables/function.js +1 -1
  15. package/dist/schema/callables/view.d.ts +4 -2
  16. package/dist/schema/definitions/class.d.ts +2 -0
  17. package/dist/schema/domain/domain.d.ts +283 -1268
  18. package/dist/schema/identity/identity.d.ts +21 -17
  19. package/dist/schema/kernel/projection/callables.js +2 -3
  20. package/dist/schema/kernel/projection/keys.js +1 -2
  21. package/dist/schema/kernel/projection/path.js +2 -29
  22. package/dist/schema/kernel/projection/project.js +2 -3
  23. package/dist/schema/kernel/schema.d.ts +362 -1311
  24. package/dist/schema/kernel/syscalls/contracts/admit.d.ts +5 -1
  25. package/dist/schema/kernel/syscalls/contracts/admit.js +9 -2
  26. package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +1 -0
  27. package/dist/schema/kernel/syscalls/contracts/delegate.js +1 -0
  28. package/dist/schema/kernel/syscalls/declarations/admit.d.ts +6 -2
  29. package/dist/schema/kernel/syscalls/declarations/admit.js +1 -1
  30. package/dist/schema/kernel/syscalls/declarations/can.d.ts +1 -1
  31. package/dist/schema/kernel/syscalls/declarations/can.js +1 -1
  32. package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +2 -1
  33. package/dist/schema/kernel/syscalls/declarations/delegate.js +2 -2
  34. package/dist/schema/kernel/syscalls/declarations/index.d.ts +20 -15
  35. package/dist/schema/kernel/syscalls/declarations/install.d.ts +1 -1
  36. package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +1 -1
  37. package/dist/schema/kernel/syscalls/declarations/journal.d.ts +1 -1
  38. package/dist/schema/kernel/syscalls/declarations/mint.d.ts +1 -1
  39. package/dist/schema/kernel/syscalls/declarations/mint.js +1 -1
  40. package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +1 -1
  41. package/dist/schema/kernel/syscalls/declarations/query.d.ts +1 -1
  42. package/dist/schema/kernel/syscalls/declarations/register.d.ts +1 -1
  43. package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +1 -1
  44. package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +1 -1
  45. package/dist/schema/kernel/syscalls/declarations/view-resolve.js +1 -1
  46. package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +1 -1
  47. package/dist/schema/kernel/syscalls/declarations/whoami.js +1 -1
  48. package/dist/schema/kernel/syscalls/declarations/whois.d.ts +1 -1
  49. package/dist/schema/kernel/syscalls/declarations/whois.js +1 -1
  50. package/dist/schema/kernel/syscalls/descriptors/function.d.ts +6 -2
  51. package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +6 -5
  52. package/dist/schema/kernel/syscalls/descriptors/identity.js +1 -1
  53. package/dist/schema/kernel/syscalls/descriptors/view.d.ts +1 -1
  54. package/dist/schema/meta/descriptable.d.ts +2 -0
  55. package/dist/schema/meta/iconable.d.ts +2 -0
  56. package/dist/schema/meta/named.d.ts +2 -0
  57. package/dist/schema/meta/node.d.ts +2 -0
  58. package/dist/schema/meta/remotable.d.ts +2 -0
  59. package/dist/schema/meta/statused.d.ts +2 -0
  60. package/dist/schema/meta/timestamped.d.ts +2 -0
  61. package/package.json +2 -2
@@ -38,13 +38,14 @@ export declare const Identity: builder.NodeClass<{
38
38
  };
39
39
  readonly methods: Readonly<{
40
40
  delegate: builder.Method<builder.CallableProjection<{
41
+ principal: string;
41
42
  audience: string;
42
43
  ttlSeconds: number;
43
44
  attenuation: unknown;
44
45
  }, {
45
46
  readonly mode: 'value';
46
47
  readonly value: string;
47
- }, "authenticated", false, "default">>;
48
+ }, "authenticated", true, false>>;
48
49
  can: builder.Method<builder.CallableProjection<{
49
50
  policy: string;
50
51
  object: string;
@@ -53,7 +54,7 @@ export declare const Identity: builder.NodeClass<{
53
54
  readonly value: {
54
55
  allowed: boolean;
55
56
  };
56
- }, "authenticated", true, "default">>;
57
+ }, "authenticated", true, false>>;
57
58
  whoami: builder.Method<builder.CallableProjection<Record<string, never>, {
58
59
  readonly mode: 'value';
59
60
  readonly value: {
@@ -74,7 +75,7 @@ export declare const Identity: builder.NodeClass<{
74
75
  op: "exists";
75
76
  })[];
76
77
  };
77
- }, "authenticated", true, "default">>;
78
+ }, "authenticated", true, false>>;
78
79
  whois: builder.Method<builder.CallableProjection<{
79
80
  iss: string;
80
81
  sub: string;
@@ -98,7 +99,7 @@ export declare const Identity: builder.NodeClass<{
98
99
  op: "exists";
99
100
  })[];
100
101
  } | null;
101
- }, "authorized", true, "default">>;
102
+ }, "authorized", true, false>>;
102
103
  mint: builder.Method<builder.CallableProjection<{
103
104
  audience?: string | undefined;
104
105
  ttlSeconds: number;
@@ -106,7 +107,7 @@ export declare const Identity: builder.NodeClass<{
106
107
  }, {
107
108
  readonly mode: 'value';
108
109
  readonly value: string;
109
- }, "authenticated", true, "default">>;
110
+ }, "authenticated", true, false>>;
110
111
  }>;
111
112
  readonly effectiveProperties: builder.AuthoredPropertyProjection<import("@astrale-os/kernel-dsl/value").Value, import("@astrale-os/kernel-dsl/value").Value, false, "frozen", "self", never> | builder.AuthoredPropertyProjection<import("@astrale-os/kernel-dsl/value").Value, import("@astrale-os/kernel-dsl/value").Value, false, "iss", "self", never> | builder.AuthoredPropertyProjection<({
112
113
  claim: string;
@@ -131,14 +132,9 @@ export declare const Identity: builder.NodeClass<{
131
132
  claim: string;
132
133
  op: "exists";
133
134
  })[], false, "requiredClaims", "self", never> | builder.AuthoredPropertyProjection<import("@astrale-os/kernel-dsl/value").Value, import("@astrale-os/kernel-dsl/value").Value, false, "sub", "self", never>;
134
- readonly effectiveInstanceMethods: builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
135
- audience: string;
136
- ttlSeconds: number;
137
- attenuation: unknown;
138
- }, {
139
- readonly mode: 'value';
140
- readonly value: string;
141
- }, "authenticated", false, "default">>, "delegate", "self">;
135
+ readonly abstractInstanceMethods: never;
136
+ readonly abstractStaticMethods: never;
137
+ readonly effectiveInstanceMethods: never;
142
138
  readonly effectiveStaticMethods: builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<Record<string, never>, {
143
139
  readonly mode: 'value';
144
140
  readonly value: {
@@ -159,14 +155,22 @@ export declare const Identity: builder.NodeClass<{
159
155
  op: "exists";
160
156
  })[];
161
157
  };
162
- }, "authenticated", true, "default">>, "whoami", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
158
+ }, "authenticated", true, false>>, "whoami", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
163
159
  audience?: string | undefined;
164
160
  ttlSeconds: number;
165
161
  grant?: unknown;
166
162
  }, {
167
163
  readonly mode: 'value';
168
164
  readonly value: string;
169
- }, "authenticated", true, "default">>, "mint", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
165
+ }, "authenticated", true, false>>, "mint", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
166
+ principal: string;
167
+ audience: string;
168
+ ttlSeconds: number;
169
+ attenuation: unknown;
170
+ }, {
171
+ readonly mode: 'value';
172
+ readonly value: string;
173
+ }, "authenticated", true, false>>, "delegate", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
170
174
  policy: string;
171
175
  object: string;
172
176
  }, {
@@ -174,7 +178,7 @@ export declare const Identity: builder.NodeClass<{
174
178
  readonly value: {
175
179
  allowed: boolean;
176
180
  };
177
- }, "authenticated", true, "default">>, "can", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
181
+ }, "authenticated", true, false>>, "can", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
178
182
  iss: string;
179
183
  sub: string;
180
184
  }, {
@@ -197,5 +201,5 @@ export declare const Identity: builder.NodeClass<{
197
201
  op: "exists";
198
202
  })[];
199
203
  } | null;
200
- }, "authorized", true, "default">>, "whois", "self">;
204
+ }, "authorized", true, false>>, "whois", "self">;
201
205
  }>;
@@ -12,8 +12,7 @@ export function projectedCallables(domain) {
12
12
  if (!('methods' in definition) || definition.kind !== 'node')
13
13
  continue;
14
14
  for (const method of [...definition.methods, ...definition.static.methods]) {
15
- if (method.owner.ref.origin !== domain.origin ||
16
- method.definition.inheritance === 'abstract') {
15
+ if (method.owner.ref.origin !== domain.origin || method.definition.abstract === true) {
17
16
  continue;
18
17
  }
19
18
  result.set(projectedMethodPath(domain, method), method.key);
@@ -29,5 +28,5 @@ export function projectedMethodPath(domain, method) {
29
28
  const owner = Path.project(method.owner.ref);
30
29
  return (method.definition.static
31
30
  ? Path.staticMethod(owner, method.name)
32
- : Path.instanceMethod(owner, method.name)).raw;
31
+ : Path.instanceMethod(owner, method.key)).raw;
33
32
  }
@@ -11,8 +11,7 @@ export function managedKeys(domain) {
11
11
  if (!('methods' in definition) || definition.kind !== 'node')
12
12
  continue;
13
13
  for (const method of [...definition.methods, ...definition.static.methods]) {
14
- if (method.owner.ref.origin !== domain.origin ||
15
- method.definition.inheritance === 'abstract') {
14
+ if (method.owner.ref.origin !== domain.origin || method.definition.abstract === true) {
16
15
  continue;
17
16
  }
18
17
  add(keys, projectedMethodPath(domain, method));
@@ -32,7 +32,7 @@ function applyStep(current, step, context) {
32
32
  case 'method':
33
33
  return step.dispatch === 'static'
34
34
  ? directMethods(current, step.name, true, context)
35
- : instanceMethods(current, step.name, context);
35
+ : instanceMethods(current.filter((node) => node.class === step.class), step.name, context);
36
36
  case 'traverse':
37
37
  return traverse(current, step, context);
38
38
  }
@@ -63,7 +63,7 @@ function directMethods(owners, name, isStatic, context) {
63
63
  function instanceMethods(instances, name, context) {
64
64
  return distinctNodes(instances.flatMap((instance) => {
65
65
  const owner = resolveClassProjection(instance.class, context);
66
- return owner.length === 0 ? [] : effectiveMethods(owner, name, context);
66
+ return owner.length === 0 ? [] : directMethods(owner, name, false, context);
67
67
  }));
68
68
  }
69
69
  function resolveClassProjection(key, context) {
@@ -73,33 +73,6 @@ function resolveClassProjection(key, context) {
73
73
  .filter((node) => node.props[K.classes.Domain.properties.origin.key] === ClassKey.ref(key).origin);
74
74
  return domainMembers(domains, `class.${ClassKey.ref(key).name}`, context);
75
75
  }
76
- /** Select the nearest declared Method in the valid Definition inheritance graph. */
77
- function effectiveMethods(roots, name, context) {
78
- let level = distinctNodes(roots);
79
- const visited = new Set();
80
- while (level.length > 0) {
81
- const fresh = level.filter((node) => !visited.has(node.id));
82
- for (const node of fresh)
83
- visited.add(node.id);
84
- if (fresh.length === 0)
85
- return [];
86
- const methods = directMethods(fresh, name, false, context);
87
- if (methods.length > 0)
88
- return methods;
89
- level = parentDefinitions(fresh, context);
90
- }
91
- return [];
92
- }
93
- function parentDefinitions(definitions, context) {
94
- const ids = new Set(definitions.map((node) => node.id));
95
- const relations = [K.classes.extends];
96
- return distinctNodes(relations.flatMap((relation) => edgesOf(relation, context).flatMap((edge) => {
97
- if (!ids.has(edge.source))
98
- return [];
99
- const parent = context.nodes.byId(edge.target);
100
- return parent === undefined ? [] : [parent];
101
- })));
102
- }
103
76
  function traverse(current, step, context) {
104
77
  const currentIds = new Set(current.map((node) => node.id));
105
78
  const edgeClass = step.class;
@@ -45,8 +45,7 @@ export function project(domain) {
45
45
  const methods = new Map();
46
46
  for (const definition of Object.values(domain.classes)) {
47
47
  for (const method of [...definition.methods, ...definition.static.methods]) {
48
- if (method.owner.ref.origin === domain.origin &&
49
- method.definition.inheritance !== 'abstract') {
48
+ if (method.owner.ref.origin === domain.origin && method.definition.abstract !== true) {
50
49
  methods.set(method.key, method);
51
50
  }
52
51
  }
@@ -233,7 +232,7 @@ function callablePropertiesFor(declaration) {
233
232
  ...(method
234
233
  ? {
235
234
  [K.classes.Function.self.properties.static.key]: declaration.static,
236
- [K.classes.Function.self.properties.inheritance.key]: declaration.inheritance,
235
+ [K.classes.Function.self.properties.abstract.key]: declaration.abstract,
237
236
  }
238
237
  : {}),
239
238
  });