@astrale-domains/shell 0.1.0-beta.48 → 0.1.0-beta.50

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 (49) hide show
  1. package/README.md +56 -9
  2. package/dist/domain.d.ts +37 -0
  3. package/dist/domain.js +6 -0
  4. package/dist/functions/user/index.js +1 -0
  5. package/dist/functions/user/record-profile.js +18 -0
  6. package/dist/functions/view-access/assign-views.js +86 -0
  7. package/dist/functions/view-access/index.js +1 -0
  8. package/dist/functions/view-access/view-access-errors.js +28 -0
  9. package/dist/mutations/user/index.js +1 -0
  10. package/dist/mutations/user/record-user-profile.js +13 -0
  11. package/dist/mutations/view-access/index.js +1 -0
  12. package/dist/mutations/view-access/set-view-access.js +29 -0
  13. package/dist/queries/user/index.js +1 -0
  14. package/dist/queries/user/read-user-profile.js +24 -0
  15. package/dist/queries/view-access/index.js +1 -0
  16. package/dist/queries/view-access/read-view-access.js +35 -0
  17. package/dist/runtime.d.ts +655 -1
  18. package/dist/runtime.js +4 -1
  19. package/dist/schema/index.d.ts +1 -0
  20. package/dist/schema/index.js +1 -0
  21. package/dist/schema/modules/user/classes/user.d.ts +9 -0
  22. package/dist/schema/modules/user/classes/user.js +9 -3
  23. package/dist/schema/modules/user/functions/index.js +1 -0
  24. package/dist/schema/modules/user/functions/record-profile.js +14 -0
  25. package/dist/schema/modules/user/types/index.d.ts +1 -0
  26. package/dist/schema/modules/user/types/index.js +1 -0
  27. package/dist/schema/modules/user/types/user-profile.d.ts +7 -0
  28. package/dist/schema/modules/user/types/user-profile.js +7 -0
  29. package/dist/schema/modules/view-access/classes/index.d.ts +1 -0
  30. package/dist/schema/modules/view-access/classes/index.js +1 -0
  31. package/dist/schema/modules/view-access/classes/view-access.d.ts +22 -0
  32. package/dist/schema/modules/view-access/classes/view-access.js +18 -0
  33. package/dist/schema/modules/view-access/core/index.d.ts +1 -0
  34. package/dist/schema/modules/view-access/core/index.js +1 -0
  35. package/dist/schema/modules/view-access/core/view-only-group.d.ts +5 -0
  36. package/dist/schema/modules/view-access/core/view-only-group.js +10 -0
  37. package/dist/schema/modules/view-access/functions/assign-views.d.ts +16 -0
  38. package/dist/schema/modules/view-access/functions/assign-views.js +17 -0
  39. package/dist/schema/modules/view-access/functions/index.d.ts +1 -0
  40. package/dist/schema/modules/view-access/functions/index.js +1 -0
  41. package/dist/schema/modules/view-access/index.d.ts +3 -0
  42. package/dist/schema/modules/view-access/index.js +3 -0
  43. package/dist/schema/modules/view-access/types/index.js +1 -0
  44. package/dist/schema/modules/view-access/types/view-assignment.js +16 -0
  45. package/dist/schema/policies/index.js +1 -0
  46. package/dist/schema/policies/is-self.js +5 -0
  47. package/dist/schema/schema.d.ts +136 -0
  48. package/dist/schema/schema.js +6 -4
  49. package/package.json +3 -3
package/dist/runtime.js CHANGED
@@ -2,7 +2,8 @@ import { defineRuntime } from '@astrale-os/sdk/runtime';
2
2
  import { listEntrypoints } from './functions/application/index.js';
3
3
  import { assignMember, unassignMember } from './functions/group/index.js';
4
4
  import { link, rename, unlink } from './functions/namespace/index.js';
5
- import { invite } from './functions/user/index.js';
5
+ import { invite, recordProfile } from './functions/user/index.js';
6
+ import { assignViews } from './functions/view-access/index.js';
6
7
  import { integrations } from './integrations/index.js';
7
8
  import { enrollmentProvider } from './providers/admin-enrollment/index.js';
8
9
  const initialize = (environment) => ({
@@ -16,6 +17,8 @@ const functions = [
16
17
  link,
17
18
  unlink,
18
19
  rename,
20
+ assignViews,
21
+ recordProfile,
19
22
  ];
20
23
  const runtime = defineRuntime()({
21
24
  integrations,
@@ -4,3 +4,4 @@ export type { InvitationSummary } from './modules/user/index.js';
4
4
  export { Group, member_of_group, adminGroup, applicationsGroup, memberGroup, } from './modules/group/index.js';
5
5
  export { listEntrypoints, type EntrypointEntry } from './modules/application/index.js';
6
6
  export { Namespace, alias, viewsNamespace } from './modules/namespace/index.js';
7
+ export { view_access, viewOnlyGroup, assignViews } from './modules/view-access/index.js';
@@ -3,3 +3,4 @@ export { User } from './modules/user/index.js';
3
3
  export { Group, member_of_group, adminGroup, applicationsGroup, memberGroup, } from './modules/group/index.js';
4
4
  export { listEntrypoints } from './modules/application/index.js';
5
5
  export { Namespace, alias, viewsNamespace } from './modules/namespace/index.js';
6
+ export { view_access, viewOnlyGroup, assignViews } from './modules/view-access/index.js';
@@ -8,6 +8,8 @@ export declare const User: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
8
8
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Identity">];
9
9
  readonly properties: {
10
10
  readonly creationKey: z.ZodOptional<z.ZodString>;
11
+ readonly claimedEmail: z.ZodOptional<z.ZodString>;
12
+ readonly claimedName: z.ZodOptional<z.ZodString>;
11
13
  };
12
14
  readonly methods: {
13
15
  readonly invite: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -21,5 +23,12 @@ export declare const User: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
21
23
  state: "accepted" | "cancelled" | "completed" | "expired" | "failed" | "pending" | "registered" | "registering";
22
24
  };
23
25
  }, "authorized", true, false, undefined, undefined>>;
26
+ readonly recordProfile: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
27
+ email?: string | undefined;
28
+ displayName?: string | undefined;
29
+ }, {
30
+ readonly mode: 'value';
31
+ readonly value: Record<string, never>;
32
+ }, "authorized", false, false, undefined, undefined>>;
24
33
  };
25
34
  }>;
@@ -1,7 +1,8 @@
1
1
  import { K, classIcon, nodeClass } from '@astrale-os/sdk/schema';
2
2
  import { UserRound } from '@astrale-os/sdk/schema/icons';
3
3
  import { z } from 'zod';
4
- import { invite } from '../functions/index.js';
4
+ import { invite, recordProfile } from '../functions/index.js';
5
+ import { userDisplayName, userEmail } from '../types/index.js';
5
6
  // Correlation for Admin-owned creation; never an authentication credential.
6
7
  const creationKey = z.string().min(1).max(512).optional();
7
8
  export const User = nodeClass({
@@ -10,6 +11,11 @@ export const User = nodeClass({
10
11
  inheritance: 'open',
11
12
  policies: { read: true },
12
13
  extends: [K.classes.Identity],
13
- properties: { creationKey },
14
- methods: { invite },
14
+ properties: {
15
+ creationKey,
16
+ // Named apart from any profile a Domain extending User declares (`email`, `displayName`…).
17
+ claimedEmail: userEmail.optional(),
18
+ claimedName: userDisplayName.optional(),
19
+ },
20
+ methods: { invite, recordProfile },
15
21
  });
@@ -1 +1,2 @@
1
1
  export { invite } from './invite-user.js';
2
+ export { recordProfile } from './record-profile.js';
@@ -0,0 +1,14 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { isSelf } from '../../../policies/index.js';
4
+ import { userDisplayName, userEmail } from '../types/index.js';
5
+ export const recordProfile = method({
6
+ description: 'Record the email and display name this account signs in with; only the account itself may.',
7
+ auth: 'authorized',
8
+ input: z.strictObject({
9
+ email: userEmail.optional(),
10
+ displayName: userDisplayName.optional(),
11
+ }),
12
+ output: z.object({}),
13
+ policy: ({ check, self }) => check(isSelf, self),
14
+ });
@@ -1 +1,2 @@
1
1
  export { invitationSummary, type InvitationSummary } from './invitation-summary.js';
2
+ export { userEmail, userDisplayName } from './user-profile.js';
@@ -1 +1,2 @@
1
1
  export { invitationSummary } from './invitation-summary.js';
2
+ export { userEmail, userDisplayName } from './user-profile.js';
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * What an account says about itself, to be recognised in the directory: its sign-in email and its
4
+ * name. The account writes them, so they name it for display and decide nothing.
5
+ */
6
+ export declare const userEmail: z.ZodString;
7
+ export declare const userDisplayName: z.ZodString;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * What an account says about itself, to be recognised in the directory: its sign-in email and its
4
+ * name. The account writes them, so they name it for display and decide nothing.
5
+ */
6
+ export const userEmail = z.string().min(3).max(320);
7
+ export const userDisplayName = z.string().min(1).max(200);
@@ -0,0 +1 @@
1
+ export { view_access } from './view-access.js';
@@ -0,0 +1 @@
1
+ export { view_access } from './view-access.js';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * One View given to an account or a group: the holder, and each member of a holding group, has this
3
+ * View among the ones it opens. It decides navigation, never data: the View's own Domain still
4
+ * guards everything it shows. Only instance administrators create or delete it. The target is a
5
+ * Class Shell does not own, so the Edge detaches with its View.
6
+ */
7
+ export declare const view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
8
+ readonly depth: 0;
9
+ readonly abstract: false;
10
+ readonly extends: readonly [];
11
+ readonly properties: never;
12
+ readonly source: {
13
+ readonly as: "holder";
14
+ readonly outgoing: "0..*";
15
+ };
16
+ readonly target: {
17
+ readonly as: "view";
18
+ readonly incoming: "0..*";
19
+ };
20
+ readonly constraints: Record<never, never>;
21
+ readonly effectiveProperties: never;
22
+ }>;
@@ -0,0 +1,18 @@
1
+ import { K, edgeClass } from '@astrale-os/sdk/schema';
2
+ import { Group } from '../../group/index.js';
3
+ import { User } from '../../user/index.js';
4
+ /**
5
+ * One View given to an account or a group: the holder, and each member of a holding group, has this
6
+ * View among the ones it opens. It decides navigation, never data: the View's own Domain still
7
+ * guards everything it shows. Only instance administrators create or delete it. The target is a
8
+ * Class Shell does not own, so the Edge detaches with its View.
9
+ */
10
+ export const view_access = edgeClass.directed({
11
+ policies: { read: true, traverse: true },
12
+ source: {
13
+ as: 'holder',
14
+ accepts: [() => User, () => Group],
15
+ outgoing: '0..*',
16
+ },
17
+ target: { as: 'view', accepts: [K.classes.View], incoming: '0..*' },
18
+ });
@@ -0,0 +1 @@
1
+ export { viewOnlyGroup } from './view-only-group.js';
@@ -0,0 +1 @@
1
+ export { viewOnlyGroup } from './view-only-group.js';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Its members open only the Views given to them, never the workspace. Administrators keep the
3
+ * workspace even when they are members.
4
+ */
5
+ export declare const viewOnlyGroup: import("@astrale-os/sdk/schema").CoreNode;
@@ -0,0 +1,10 @@
1
+ import { K, core } from '@astrale-os/sdk/schema';
2
+ import { Group } from '../../group/index.js';
3
+ /**
4
+ * Its members open only the Views given to them, never the workspace. Administrators keep the
5
+ * workspace even when they are members.
6
+ */
7
+ export const viewOnlyGroup = core.node(() => Group, {
8
+ [K.classes.Named.properties.name.key]: 'View only',
9
+ [K.classes.Descriptable.properties.description.key]: 'Open only the Views given to them, never the workspace.',
10
+ });
@@ -0,0 +1,16 @@
1
+ import { type Function as SchemaFunction } from '@astrale-os/sdk/schema';
2
+ /**
3
+ * Give Views to identities and withdraw others, in one write. Each identity is a User or a Group;
4
+ * a View already given, or already withdrawn, stays as it is. Whether an identity opens the
5
+ * workspace is its `view-only` membership, which `Group.assignMember` changes.
6
+ */
7
+ export declare const assignViews: SchemaFunction<import("@astrale-os/sdk/schema").CallableProjection<{
8
+ assignments: {
9
+ identity: string;
10
+ set?: string[] | undefined;
11
+ unset?: string[] | undefined;
12
+ }[];
13
+ }, {
14
+ readonly mode: 'value';
15
+ readonly value: Record<string, never>;
16
+ }, "authorized", false, false, undefined, undefined>>;
@@ -0,0 +1,17 @@
1
+ import { func } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { usesFunction } from '../../../policies/index.js';
4
+ import { MAX_ASSIGNMENTS, viewAssignment } from '../types/index.js';
5
+ /**
6
+ * Give Views to identities and withdraw others, in one write. Each identity is a User or a Group;
7
+ * a View already given, or already withdrawn, stays as it is. Whether an identity opens the
8
+ * workspace is its `view-only` membership, which `Group.assignMember` changes.
9
+ */
10
+ export const assignViews = func({
11
+ description: 'Give and withdraw Views for each identity, in one write.',
12
+ auth: 'authorized',
13
+ input: z.strictObject({ assignments: z.array(viewAssignment).min(1).max(MAX_ASSIGNMENTS) }),
14
+ output: z.object({}),
15
+ // Holding can_use is enough: Core admin holds it, and may share it.
16
+ policy: ({ check, ref }) => check(usesFunction, ref(() => assignViews)),
17
+ });
@@ -0,0 +1 @@
1
+ export { assignViews } from './assign-views.js';
@@ -0,0 +1 @@
1
+ export { assignViews } from './assign-views.js';
@@ -0,0 +1,3 @@
1
+ export { view_access } from './classes/index.js';
2
+ export { viewOnlyGroup } from './core/index.js';
3
+ export { assignViews } from './functions/index.js';
@@ -0,0 +1,3 @@
1
+ export { view_access } from './classes/index.js';
2
+ export { viewOnlyGroup } from './core/index.js';
3
+ export { assignViews } from './functions/index.js';
@@ -0,0 +1 @@
1
+ export { viewAssignment, MAX_ASSIGNED_VIEWS, MAX_ASSIGNMENTS } from './view-assignment.js';
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Bounds that keep one call within the Kernel's Mutation limits: at most 1,600 Edge operations
4
+ * and 1,640 locators, under 2,048 each.
5
+ */
6
+ export const MAX_ASSIGNED_VIEWS = 20;
7
+ export const MAX_ASSIGNMENTS = 40;
8
+ // A Path inside a list is not a callable Path input: each is an exact @NodeId the Action checks.
9
+ const nodeId = z.string().min(2).max(512);
10
+ const views = z.array(nodeId).max(MAX_ASSIGNED_VIEWS);
11
+ /** The Views given to one User or Group (`set`) and withdrawn from it (`unset`), by @NodeId. */
12
+ export const viewAssignment = z.strictObject({
13
+ identity: nodeId,
14
+ set: views.optional(),
15
+ unset: views.optional(),
16
+ });
@@ -1,3 +1,4 @@
1
1
  export { ownsClass } from './owns-class.js';
2
2
  export { administersShellClass } from './administers-shell-class.js';
3
3
  export { usesFunction } from './uses-function.js';
4
+ export { isSelf } from './is-self.js';
@@ -0,0 +1,5 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ /** The subject is the object itself: an account acting on its own Node. */
3
+ export const isSelf = policy({
4
+ match: ({ sameNode, subject, object }) => sameNode(subject, object),
5
+ });
@@ -10,6 +10,8 @@ declare const classes: {
10
10
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Identity">];
11
11
  readonly properties: {
12
12
  readonly creationKey: import("zod").ZodOptional<import("zod").ZodString>;
13
+ readonly claimedEmail: import("zod").ZodOptional<import("zod").ZodString>;
14
+ readonly claimedName: import("zod").ZodOptional<import("zod").ZodString>;
13
15
  };
14
16
  readonly methods: {
15
17
  readonly invite: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -23,6 +25,13 @@ declare const classes: {
23
25
  state: "accepted" | "cancelled" | "completed" | "expired" | "failed" | "pending" | "registered" | "registering";
24
26
  };
25
27
  }, "authorized", true, false, undefined, undefined>>;
28
+ readonly recordProfile: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
29
+ email?: string | undefined;
30
+ displayName?: string | undefined;
31
+ }, {
32
+ readonly mode: 'value';
33
+ readonly value: Record<string, never>;
34
+ }, "authorized", false, false, undefined, undefined>>;
26
35
  };
27
36
  }>;
28
37
  readonly Group: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
@@ -111,6 +120,22 @@ declare const classes: {
111
120
  readonly constraints: Record<never, never>;
112
121
  readonly effectiveProperties: never;
113
122
  }>;
123
+ readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
124
+ readonly depth: 0;
125
+ readonly abstract: false;
126
+ readonly extends: readonly [];
127
+ readonly properties: never;
128
+ readonly source: {
129
+ readonly as: "holder";
130
+ readonly outgoing: "0..*";
131
+ };
132
+ readonly target: {
133
+ readonly as: "view";
134
+ readonly incoming: "0..*";
135
+ };
136
+ readonly constraints: Record<never, never>;
137
+ readonly effectiveProperties: never;
138
+ }>;
114
139
  };
115
140
  export type ShellClasses = typeof classes;
116
141
  declare const input: {
@@ -129,6 +154,8 @@ declare const input: {
129
154
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Identity">];
130
155
  readonly properties: {
131
156
  readonly creationKey: import("zod").ZodOptional<import("zod").ZodString>;
157
+ readonly claimedEmail: import("zod").ZodOptional<import("zod").ZodString>;
158
+ readonly claimedName: import("zod").ZodOptional<import("zod").ZodString>;
132
159
  };
133
160
  readonly methods: {
134
161
  readonly invite: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -142,6 +169,13 @@ declare const input: {
142
169
  state: "accepted" | "cancelled" | "completed" | "expired" | "failed" | "pending" | "registered" | "registering";
143
170
  };
144
171
  }, "authorized", true, false, undefined, undefined>>;
172
+ readonly recordProfile: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
173
+ email?: string | undefined;
174
+ displayName?: string | undefined;
175
+ }, {
176
+ readonly mode: 'value';
177
+ readonly value: Record<string, never>;
178
+ }, "authorized", false, false, undefined, undefined>>;
145
179
  };
146
180
  }>;
147
181
  readonly Group: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
@@ -230,6 +264,22 @@ declare const input: {
230
264
  readonly constraints: Record<never, never>;
231
265
  readonly effectiveProperties: never;
232
266
  }>;
267
+ readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
268
+ readonly depth: 0;
269
+ readonly abstract: false;
270
+ readonly extends: readonly [];
271
+ readonly properties: never;
272
+ readonly source: {
273
+ readonly as: "holder";
274
+ readonly outgoing: "0..*";
275
+ };
276
+ readonly target: {
277
+ readonly as: "view";
278
+ readonly incoming: "0..*";
279
+ };
280
+ readonly constraints: Record<never, never>;
281
+ readonly effectiveProperties: never;
282
+ }>;
233
283
  };
234
284
  readonly functions: {
235
285
  readonly listEntrypoints: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
@@ -242,12 +292,23 @@ declare const input: {
242
292
  }[];
243
293
  };
244
294
  }, "authorized", false, false, undefined, undefined>>;
295
+ readonly assignViews: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
296
+ assignments: {
297
+ identity: string;
298
+ set?: string[] | undefined;
299
+ unset?: string[] | undefined;
300
+ }[];
301
+ }, {
302
+ readonly mode: 'value';
303
+ readonly value: Record<string, never>;
304
+ }, "authorized", false, false, undefined, undefined>>;
245
305
  };
246
306
  readonly policies: {
247
307
  readonly belongsToGroup: import("@astrale-os/sdk/schema").Policy;
248
308
  readonly ownsClass: import("@astrale-os/sdk/schema").Policy;
249
309
  readonly administersShellClass: import("@astrale-os/sdk/schema").Policy;
250
310
  readonly usesFunction: import("@astrale-os/sdk/schema").Policy;
311
+ readonly isSelf: import("@astrale-os/sdk/schema").Policy;
251
312
  };
252
313
  readonly views: {
253
314
  readonly application: import("@astrale-os/sdk/schema").View;
@@ -258,6 +319,7 @@ declare const input: {
258
319
  readonly applications: import("@astrale-os/sdk/schema").CoreNode;
259
320
  readonly member: import("@astrale-os/sdk/schema").CoreNode;
260
321
  readonly views: import("@astrale-os/sdk/schema").CoreNode;
322
+ readonly 'view-only': import("@astrale-os/sdk/schema").CoreNode;
261
323
  };
262
324
  };
263
325
  };
@@ -275,6 +337,8 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
275
337
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Identity">];
276
338
  readonly properties: {
277
339
  readonly creationKey: import("zod").ZodOptional<import("zod").ZodString>;
340
+ readonly claimedEmail: import("zod").ZodOptional<import("zod").ZodString>;
341
+ readonly claimedName: import("zod").ZodOptional<import("zod").ZodString>;
278
342
  };
279
343
  readonly methods: {
280
344
  readonly invite: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -288,6 +352,13 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
288
352
  state: "accepted" | "cancelled" | "completed" | "expired" | "failed" | "pending" | "registered" | "registering";
289
353
  };
290
354
  }, "authorized", true, false, undefined, undefined>>;
355
+ readonly recordProfile: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
356
+ email?: string | undefined;
357
+ displayName?: string | undefined;
358
+ }, {
359
+ readonly mode: 'value';
360
+ readonly value: Record<string, never>;
361
+ }, "authorized", false, false, undefined, undefined>>;
291
362
  };
292
363
  }>;
293
364
  readonly Group: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
@@ -376,6 +447,22 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
376
447
  readonly constraints: Record<never, never>;
377
448
  readonly effectiveProperties: never;
378
449
  }>;
450
+ readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
451
+ readonly depth: 0;
452
+ readonly abstract: false;
453
+ readonly extends: readonly [];
454
+ readonly properties: never;
455
+ readonly source: {
456
+ readonly as: "holder";
457
+ readonly outgoing: "0..*";
458
+ };
459
+ readonly target: {
460
+ readonly as: "view";
461
+ readonly incoming: "0..*";
462
+ };
463
+ readonly constraints: Record<never, never>;
464
+ readonly effectiveProperties: never;
465
+ }>;
379
466
  };
380
467
  readonly functions: {
381
468
  readonly listEntrypoints: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
@@ -388,12 +475,23 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
388
475
  }[];
389
476
  };
390
477
  }, "authorized", false, false, undefined, undefined>>;
478
+ readonly assignViews: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
479
+ assignments: {
480
+ identity: string;
481
+ set?: string[] | undefined;
482
+ unset?: string[] | undefined;
483
+ }[];
484
+ }, {
485
+ readonly mode: 'value';
486
+ readonly value: Record<string, never>;
487
+ }, "authorized", false, false, undefined, undefined>>;
391
488
  };
392
489
  readonly policies: {
393
490
  readonly belongsToGroup: import("@astrale-os/sdk/schema").Policy;
394
491
  readonly ownsClass: import("@astrale-os/sdk/schema").Policy;
395
492
  readonly administersShellClass: import("@astrale-os/sdk/schema").Policy;
396
493
  readonly usesFunction: import("@astrale-os/sdk/schema").Policy;
494
+ readonly isSelf: import("@astrale-os/sdk/schema").Policy;
397
495
  };
398
496
  readonly views: {
399
497
  readonly application: import("@astrale-os/sdk/schema").View;
@@ -404,6 +502,7 @@ export declare const ShellSchema: import("@astrale-os/sdk/schema").AuthoredSchem
404
502
  readonly applications: import("@astrale-os/sdk/schema").CoreNode;
405
503
  readonly member: import("@astrale-os/sdk/schema").CoreNode;
406
504
  readonly views: import("@astrale-os/sdk/schema").CoreNode;
505
+ readonly 'view-only': import("@astrale-os/sdk/schema").CoreNode;
407
506
  };
408
507
  };
409
508
  }, {
@@ -423,6 +522,8 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
423
522
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Identity">];
424
523
  readonly properties: {
425
524
  readonly creationKey: import("zod").ZodOptional<import("zod").ZodString>;
525
+ readonly claimedEmail: import("zod").ZodOptional<import("zod").ZodString>;
526
+ readonly claimedName: import("zod").ZodOptional<import("zod").ZodString>;
426
527
  };
427
528
  readonly methods: {
428
529
  readonly invite: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -436,6 +537,13 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
436
537
  state: "accepted" | "cancelled" | "completed" | "expired" | "failed" | "pending" | "registered" | "registering";
437
538
  };
438
539
  }, "authorized", true, false, undefined, undefined>>;
540
+ readonly recordProfile: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
541
+ email?: string | undefined;
542
+ displayName?: string | undefined;
543
+ }, {
544
+ readonly mode: 'value';
545
+ readonly value: Record<string, never>;
546
+ }, "authorized", false, false, undefined, undefined>>;
439
547
  };
440
548
  }>;
441
549
  readonly Group: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
@@ -524,6 +632,22 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
524
632
  readonly constraints: Record<never, never>;
525
633
  readonly effectiveProperties: never;
526
634
  }>;
635
+ readonly view_access: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
636
+ readonly depth: 0;
637
+ readonly abstract: false;
638
+ readonly extends: readonly [];
639
+ readonly properties: never;
640
+ readonly source: {
641
+ readonly as: "holder";
642
+ readonly outgoing: "0..*";
643
+ };
644
+ readonly target: {
645
+ readonly as: "view";
646
+ readonly incoming: "0..*";
647
+ };
648
+ readonly constraints: Record<never, never>;
649
+ readonly effectiveProperties: never;
650
+ }>;
527
651
  };
528
652
  readonly functions: {
529
653
  readonly listEntrypoints: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
@@ -536,12 +660,23 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
536
660
  }[];
537
661
  };
538
662
  }, "authorized", false, false, undefined, undefined>>;
663
+ readonly assignViews: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
664
+ assignments: {
665
+ identity: string;
666
+ set?: string[] | undefined;
667
+ unset?: string[] | undefined;
668
+ }[];
669
+ }, {
670
+ readonly mode: 'value';
671
+ readonly value: Record<string, never>;
672
+ }, "authorized", false, false, undefined, undefined>>;
539
673
  };
540
674
  readonly policies: {
541
675
  readonly belongsToGroup: import("@astrale-os/sdk/schema").Policy;
542
676
  readonly ownsClass: import("@astrale-os/sdk/schema").Policy;
543
677
  readonly administersShellClass: import("@astrale-os/sdk/schema").Policy;
544
678
  readonly usesFunction: import("@astrale-os/sdk/schema").Policy;
679
+ readonly isSelf: import("@astrale-os/sdk/schema").Policy;
545
680
  };
546
681
  readonly views: {
547
682
  readonly application: import("@astrale-os/sdk/schema").View;
@@ -552,6 +687,7 @@ export declare const S: schema.ResolvedDomainOf<import("@astrale-os/sdk/schema")
552
687
  readonly applications: import("@astrale-os/sdk/schema").CoreNode;
553
688
  readonly member: import("@astrale-os/sdk/schema").CoreNode;
554
689
  readonly views: import("@astrale-os/sdk/schema").CoreNode;
690
+ readonly 'view-only': import("@astrale-os/sdk/schema").CoreNode;
555
691
  };
556
692
  };
557
693
  }, {
@@ -3,13 +3,14 @@ import { listEntrypoints } from './modules/application/index.js';
3
3
  import { Group, member_of_group, adminGroup, applicationsGroup, memberGroup, belongsToGroup, } from './modules/group/index.js';
4
4
  import { Namespace, alias, viewsNamespace } from './modules/namespace/index.js';
5
5
  import { User } from './modules/user/index.js';
6
- import { ownsClass, administersShellClass, usesFunction } from './policies/index.js';
6
+ import { assignViews, view_access, viewOnlyGroup } from './modules/view-access/index.js';
7
+ import { ownsClass, administersShellClass, usesFunction, isSelf } from './policies/index.js';
7
8
  import { applicationView } from './views/index.js';
8
9
  export const ORIGIN = 'shell.astrale.ai';
9
10
  const dependencies = { kernel: KernelSchema };
10
- const classes = { User, Group, member_of_group, Namespace, alias };
11
- const functions = { listEntrypoints };
12
- const policies = { belongsToGroup, ownsClass, administersShellClass, usesFunction };
11
+ const classes = { User, Group, member_of_group, Namespace, alias, view_access };
12
+ const functions = { listEntrypoints, assignViews };
13
+ const policies = { belongsToGroup, ownsClass, administersShellClass, usesFunction, isSelf };
13
14
  const views = { application: applicationView };
14
15
  const core = {
15
16
  nodes: {
@@ -17,6 +18,7 @@ const core = {
17
18
  applications: applicationsGroup,
18
19
  member: memberGroup,
19
20
  views: viewsNamespace,
21
+ 'view-only': viewOnlyGroup,
20
22
  },
21
23
  };
22
24
  const input = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-domains/shell",
3
- "version": "0.1.0-beta.48",
3
+ "version": "0.1.0-beta.50",
4
4
  "description": "Astrale Shell Domain schema and remote product implementation",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -58,8 +58,8 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@astrale-os/ox": "0.1.4",
61
- "@astrale-os/sdk": "0.6.0-beta.37",
62
- "@astrale-os/shell-react": "0.6.0-beta.4",
61
+ "@astrale-os/sdk": "0.6.0-beta.38",
62
+ "@astrale-os/shell-react": "0.6.0-beta.8",
63
63
  "@astrale-os/ui": "1.0.0-beta.37",
64
64
  "@astrale/typescript-config": "npm:@jsr/astrale__typescript-config@~2.0.0",
65
65
  "@testing-library/dom": "10.4.1",