@astrale-domains/shell 0.1.0-beta.10

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 (95) hide show
  1. package/README.md +71 -0
  2. package/dist/actions/index.js +1 -0
  3. package/dist/actions/user/index.js +1 -0
  4. package/dist/actions/user/resolve-home.js +19 -0
  5. package/dist/application.d.ts +9809 -0
  6. package/dist/application.js +29 -0
  7. package/dist/entrypoints/application.d.ts +1 -0
  8. package/dist/entrypoints/application.js +1 -0
  9. package/dist/entrypoints/runtime.js +1 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +3 -0
  12. package/dist/mutations/group/index.js +1 -0
  13. package/dist/mutations/group/membership.js +19 -0
  14. package/dist/mutations/space/access.js +23 -0
  15. package/dist/mutations/space/default.js +23 -0
  16. package/dist/mutations/space/index.js +2 -0
  17. package/dist/mutations/user/index.js +1 -0
  18. package/dist/mutations/user/repair.js +83 -0
  19. package/dist/queries/space/access.js +12 -0
  20. package/dist/queries/space/admin.js +20 -0
  21. package/dist/queries/space/index.js +3 -0
  22. package/dist/queries/space/member.js +17 -0
  23. package/dist/queries/user/groups.js +17 -0
  24. package/dist/queries/user/home.js +21 -0
  25. package/dist/queries/user/index.js +5 -0
  26. package/dist/queries/user/owned-spaces.js +17 -0
  27. package/dist/queries/user/profile.js +14 -0
  28. package/dist/queries/user/setup.js +16 -0
  29. package/dist/runtime.d.ts +4 -0
  30. package/dist/runtime.js +18 -0
  31. package/dist/schema/domain/index.d.ts +1665 -0
  32. package/dist/schema/domain/index.js +39 -0
  33. package/dist/schema/group/class.d.ts +323 -0
  34. package/dist/schema/group/class.js +7 -0
  35. package/dist/schema/group/core.d.ts +10 -0
  36. package/dist/schema/group/core.js +14 -0
  37. package/dist/schema/group/index.d.ts +6 -0
  38. package/dist/schema/group/index.js +6 -0
  39. package/dist/schema/group/methods.d.ts +13 -0
  40. package/dist/schema/group/methods.js +22 -0
  41. package/dist/schema/group/policies.d.ts +1 -0
  42. package/dist/schema/group/policies.js +6 -0
  43. package/dist/schema/group/relationships.d.ts +16 -0
  44. package/dist/schema/group/relationships.js +8 -0
  45. package/dist/schema/group/view.d.ts +1 -0
  46. package/dist/schema/group/view.js +6 -0
  47. package/dist/schema/home/index.d.ts +1 -0
  48. package/dist/schema/home/index.js +1 -0
  49. package/dist/schema/home/view.d.ts +1 -0
  50. package/dist/schema/home/view.js +4 -0
  51. package/dist/schema/index.d.ts +6 -0
  52. package/dist/schema/index.js +6 -0
  53. package/dist/schema/setup/functions.d.ts +28 -0
  54. package/dist/schema/setup/functions.js +27 -0
  55. package/dist/schema/setup/index.d.ts +1 -0
  56. package/dist/schema/setup/index.js +1 -0
  57. package/dist/schema/space/class.d.ts +80 -0
  58. package/dist/schema/space/class.js +11 -0
  59. package/dist/schema/space/core.d.ts +8 -0
  60. package/dist/schema/space/core.js +15 -0
  61. package/dist/schema/space/index.d.ts +6 -0
  62. package/dist/schema/space/index.js +6 -0
  63. package/dist/schema/space/methods.d.ts +18 -0
  64. package/dist/schema/space/methods.js +32 -0
  65. package/dist/schema/space/policies.d.ts +4 -0
  66. package/dist/schema/space/policies.js +21 -0
  67. package/dist/schema/space/relationships.d.ts +64 -0
  68. package/dist/schema/space/relationships.js +24 -0
  69. package/dist/schema/space/view.d.ts +1 -0
  70. package/dist/schema/space/view.js +6 -0
  71. package/dist/schema/user/class.d.ts +278 -0
  72. package/dist/schema/user/class.js +11 -0
  73. package/dist/schema/user/index.d.ts +3 -0
  74. package/dist/schema/user/index.js +3 -0
  75. package/dist/schema/user/methods.d.ts +7 -0
  76. package/dist/schema/user/methods.js +11 -0
  77. package/dist/schema/user/view.d.ts +1 -0
  78. package/dist/schema/user/view.js +6 -0
  79. package/dist/workflows/group/assign.js +3 -0
  80. package/dist/workflows/group/change.js +31 -0
  81. package/dist/workflows/group/index.js +3 -0
  82. package/dist/workflows/group/unassign.js +3 -0
  83. package/dist/workflows/index.js +3 -0
  84. package/dist/workflows/setup/admin.js +3 -0
  85. package/dist/workflows/setup/index.js +5 -0
  86. package/dist/workflows/setup/member.js +3 -0
  87. package/dist/workflows/setup/plan.js +88 -0
  88. package/dist/workflows/setup/provision.js +57 -0
  89. package/dist/workflows/setup/run.js +74 -0
  90. package/dist/workflows/space/access.js +41 -0
  91. package/dist/workflows/space/add.js +3 -0
  92. package/dist/workflows/space/default.js +37 -0
  93. package/dist/workflows/space/index.js +4 -0
  94. package/dist/workflows/space/remove.js +3 -0
  95. package/package.json +69 -0
@@ -0,0 +1,39 @@
1
+ import { defineSchema, KernelSchema, schema, } from '@astrale-os/sdk/schema';
2
+ import { Group, adminGroup, groupAssignUser, groupCore, groupUnassignUser, groupView, maySetupUsers, memberGroup, member_of_group, } from '#schema/group';
3
+ import { homeView } from '#schema/home';
4
+ import { setupAdmin, setupMember } from '#schema/setup';
5
+ import { Space, administers_space, belongsToSpace, default_space, defaultSpace, mayAdministerSpace, member_of_space, owns_space, ownsSpace, spaceAddUser, spaceCore, spaceRemoveUser, spaceSetDefault, spaceView, } from '#schema/space';
6
+ import { User, resolveHome, userView } from '#schema/user';
7
+ export const ORIGIN = 'shell.astrale.ai';
8
+ export const ShellCore = {
9
+ nodes: {
10
+ admin: adminGroup,
11
+ member: memberGroup,
12
+ 'default-space': defaultSpace,
13
+ },
14
+ edges: [...(groupCore.edges ?? []), ...(spaceCore.edges ?? [])],
15
+ };
16
+ const dependencies = { kernel: KernelSchema };
17
+ const functions = { setupAdmin, setupMember };
18
+ const classes = {
19
+ Group,
20
+ Space,
21
+ User,
22
+ administers_space,
23
+ default_space,
24
+ member_of_group,
25
+ member_of_space,
26
+ owns_space,
27
+ };
28
+ const policies = { belongsToSpace, mayAdministerSpace, maySetupUsers, ownsSpace };
29
+ const views = { group: groupView, home: homeView, space: spaceView, user: userView };
30
+ export const ShellSchema = defineSchema(ORIGIN, {
31
+ dependencies,
32
+ functions,
33
+ classes,
34
+ policies,
35
+ views,
36
+ core: ShellCore,
37
+ });
38
+ export const S = schema.resolve(ShellSchema);
39
+ export { groupAssignUser, groupUnassignUser, resolveHome, setupAdmin, setupMember, spaceAddUser, spaceRemoveUser, spaceSetDefault, };
@@ -0,0 +1,323 @@
1
+ export declare const Group: import("@astrale-os/sdk/schema").NodeClass<{
2
+ readonly depth: 1;
3
+ readonly abstract: false;
4
+ readonly extends: readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
5
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
6
+ readonly origin: "kernel.astrale.ai";
7
+ };
8
+ readonly kind: 'node';
9
+ readonly abstract: true;
10
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Identity"> & {
11
+ readonly origin: "kernel.astrale.ai";
12
+ }, "kernel.astrale.ai:class.Identity", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
13
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
14
+ readonly origin: "kernel.astrale.ai";
15
+ };
16
+ readonly kind: 'node';
17
+ readonly abstract: true;
18
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
19
+ readonly origin: "kernel.astrale.ai";
20
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<({
21
+ claim: string;
22
+ op: "contains";
23
+ value: unknown;
24
+ } | {
25
+ claim: string;
26
+ op: "eq";
27
+ value: unknown;
28
+ } | {
29
+ claim: string;
30
+ op: "exists";
31
+ })[], false, "requiredClaims", "kernel.astrale.ai:class.Identity.property.requiredClaims"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "frozen", "kernel.astrale.ai:class.Identity.property.frozen"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "iss", "kernel.astrale.ai:class.Identity.property.iss"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "sub", "kernel.astrale.ai:class.Identity.property.sub">, import("@astrale-os/sdk/schema").MethodProjection<{
32
+ audience: string;
33
+ ttlSeconds: number;
34
+ attenuation: unknown;
35
+ }, {
36
+ readonly mode: 'value';
37
+ readonly value: string;
38
+ }, false, "default", "authenticated", "delegate", "kernel.astrale.ai:class.Identity.method.delegate">, import("@astrale-os/sdk/schema").MethodProjection<Record<string, never>, {
39
+ readonly mode: 'value';
40
+ readonly value: {
41
+ id: string;
42
+ issuer: string;
43
+ subject: string;
44
+ frozen: boolean;
45
+ requiredClaims: ({
46
+ claim: string;
47
+ op: "contains";
48
+ value: unknown;
49
+ } | {
50
+ claim: string;
51
+ op: "eq";
52
+ value: unknown;
53
+ } | {
54
+ claim: string;
55
+ op: "exists";
56
+ })[];
57
+ };
58
+ }, true, "default", "authenticated", "whoami", "kernel.astrale.ai:class.Identity.method.whoami"> | import("@astrale-os/sdk/schema").MethodProjection<{
59
+ policy: string;
60
+ object: string;
61
+ }, {
62
+ readonly mode: 'value';
63
+ readonly value: {
64
+ allowed: boolean;
65
+ };
66
+ }, true, "default", "authenticated", "can", "kernel.astrale.ai:class.Identity.method.can"> | import("@astrale-os/sdk/schema").MethodProjection<{
67
+ issuer: string;
68
+ subject: string;
69
+ }, {
70
+ readonly mode: 'value';
71
+ readonly value: {
72
+ id: string;
73
+ issuer: string;
74
+ subject: string;
75
+ frozen: boolean;
76
+ requiredClaims: ({
77
+ claim: string;
78
+ op: "contains";
79
+ value: unknown;
80
+ } | {
81
+ claim: string;
82
+ op: "eq";
83
+ value: unknown;
84
+ } | {
85
+ claim: string;
86
+ op: "exists";
87
+ })[];
88
+ } | null;
89
+ }, true, "default", "authorized", "whois", "kernel.astrale.ai:class.Identity.method.whois"> | import("@astrale-os/sdk/schema").MethodProjection<{
90
+ audience?: string | undefined;
91
+ ttlSeconds: number;
92
+ grant?: unknown;
93
+ }, {
94
+ readonly mode: 'value';
95
+ readonly value: string;
96
+ }, true, "default", "authorized", "mint", "kernel.astrale.ai:class.Identity.method.mint">, import("@astrale-os/sdk/schema").PropertyProjection<({
97
+ claim: string;
98
+ op: "contains";
99
+ value: unknown;
100
+ } | {
101
+ claim: string;
102
+ op: "eq";
103
+ value: unknown;
104
+ } | {
105
+ claim: string;
106
+ op: "exists";
107
+ })[], false, "requiredClaims", "kernel.astrale.ai:class.Identity.property.requiredClaims"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "frozen", "kernel.astrale.ai:class.Identity.property.frozen"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "iss", "kernel.astrale.ai:class.Identity.property.iss"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "sub", "kernel.astrale.ai:class.Identity.property.sub">, import("@astrale-os/sdk/schema").MethodProjection<{
108
+ audience: string;
109
+ ttlSeconds: number;
110
+ attenuation: unknown;
111
+ }, {
112
+ readonly mode: 'value';
113
+ readonly value: string;
114
+ }, false, "default", "authenticated", "delegate", "kernel.astrale.ai:class.Identity.method.delegate">, import("@astrale-os/sdk/schema").MethodProjection<Record<string, never>, {
115
+ readonly mode: 'value';
116
+ readonly value: {
117
+ id: string;
118
+ issuer: string;
119
+ subject: string;
120
+ frozen: boolean;
121
+ requiredClaims: ({
122
+ claim: string;
123
+ op: "contains";
124
+ value: unknown;
125
+ } | {
126
+ claim: string;
127
+ op: "eq";
128
+ value: unknown;
129
+ } | {
130
+ claim: string;
131
+ op: "exists";
132
+ })[];
133
+ };
134
+ }, true, "default", "authenticated", "whoami", "kernel.astrale.ai:class.Identity.method.whoami"> | import("@astrale-os/sdk/schema").MethodProjection<{
135
+ policy: string;
136
+ object: string;
137
+ }, {
138
+ readonly mode: 'value';
139
+ readonly value: {
140
+ allowed: boolean;
141
+ };
142
+ }, true, "default", "authenticated", "can", "kernel.astrale.ai:class.Identity.method.can"> | import("@astrale-os/sdk/schema").MethodProjection<{
143
+ issuer: string;
144
+ subject: string;
145
+ }, {
146
+ readonly mode: 'value';
147
+ readonly value: {
148
+ id: string;
149
+ issuer: string;
150
+ subject: string;
151
+ frozen: boolean;
152
+ requiredClaims: ({
153
+ claim: string;
154
+ op: "contains";
155
+ value: unknown;
156
+ } | {
157
+ claim: string;
158
+ op: "eq";
159
+ value: unknown;
160
+ } | {
161
+ claim: string;
162
+ op: "exists";
163
+ })[];
164
+ } | null;
165
+ }, true, "default", "authorized", "whois", "kernel.astrale.ai:class.Identity.method.whois"> | import("@astrale-os/sdk/schema").MethodProjection<{
166
+ audience?: string | undefined;
167
+ ttlSeconds: number;
168
+ grant?: unknown;
169
+ }, {
170
+ readonly mode: 'value';
171
+ readonly value: string;
172
+ }, true, "default", "authorized", "mint", "kernel.astrale.ai:class.Identity.method.mint">>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
173
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Named"> & {
174
+ readonly origin: "kernel.astrale.ai";
175
+ };
176
+ readonly kind: 'node';
177
+ readonly abstract: true;
178
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Named"> & {
179
+ readonly origin: "kernel.astrale.ai";
180
+ }, "kernel.astrale.ai:class.Named", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
181
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
182
+ readonly origin: "kernel.astrale.ai";
183
+ };
184
+ readonly kind: 'node';
185
+ readonly abstract: true;
186
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
187
+ readonly origin: "kernel.astrale.ai";
188
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name">, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
189
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Descriptable"> & {
190
+ readonly origin: "kernel.astrale.ai";
191
+ };
192
+ readonly kind: 'node';
193
+ readonly abstract: true;
194
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Descriptable"> & {
195
+ readonly origin: "kernel.astrale.ai";
196
+ }, "kernel.astrale.ai:class.Descriptable", readonly [import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
197
+ readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
198
+ readonly origin: "kernel.astrale.ai";
199
+ };
200
+ readonly kind: 'node';
201
+ readonly abstract: true;
202
+ }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
203
+ readonly origin: "kernel.astrale.ai";
204
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description">, never, never>];
205
+ readonly properties: never;
206
+ readonly methods: {
207
+ readonly assignUser: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
208
+ user: string;
209
+ }, {
210
+ readonly mode: 'value';
211
+ readonly value: import("@astrale-os/sdk/schema").Value;
212
+ }, "authorized", false, "default">>;
213
+ readonly unassignUser: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
214
+ user: string;
215
+ }, {
216
+ readonly mode: 'value';
217
+ readonly value: import("@astrale-os/sdk/schema").Value;
218
+ }, "authorized", false, "default">>;
219
+ };
220
+ readonly effectiveProperties: (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, false> & {
221
+ readonly name: "description";
222
+ readonly key: "kernel.astrale.ai:class.Descriptable.property.description";
223
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, false> & {
224
+ readonly name: "frozen";
225
+ readonly key: "kernel.astrale.ai:class.Identity.property.frozen";
226
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
227
+ readonly name: "iss";
228
+ readonly key: "kernel.astrale.ai:class.Identity.property.iss";
229
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
230
+ readonly name: "name";
231
+ readonly key: "kernel.astrale.ai:class.Named.property.name";
232
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
233
+ readonly name: "sub";
234
+ readonly key: "kernel.astrale.ai:class.Identity.property.sub";
235
+ });
236
+ readonly effectiveInstanceMethods: (import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
237
+ user: string;
238
+ }, {
239
+ readonly mode: 'value';
240
+ readonly value: import("@astrale-os/sdk/schema").Value;
241
+ }, "authorized", false, "default">>, "assignUser", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
242
+ user: string;
243
+ }, {
244
+ readonly mode: 'value';
245
+ readonly value: import("@astrale-os/sdk/schema").Value;
246
+ }, "authorized", false, "default">>, "unassignUser", "self">) | (import("@astrale-os/sdk/schema").ResolvedMethod<{
247
+ audience: string;
248
+ ttlSeconds: number;
249
+ attenuation: unknown;
250
+ }, {
251
+ readonly mode: 'value';
252
+ readonly value: string;
253
+ }, false, "default", "authenticated", import("@astrale-os/sdk/schema").PolicyCheckExpression<import("@astrale-os/sdk/schema").PolicyRef, import("@astrale-os/sdk/schema").PolicyCheckObject>, "kernel.astrale.ai:class.Identity.method.delegate"> & {
254
+ readonly name: "delegate";
255
+ });
256
+ readonly effectiveStaticMethods: (import("@astrale-os/sdk/schema").ResolvedMethod<Record<string, never>, {
257
+ readonly mode: 'value';
258
+ readonly value: {
259
+ id: string;
260
+ issuer: string;
261
+ subject: string;
262
+ frozen: boolean;
263
+ requiredClaims: ({
264
+ claim: string;
265
+ op: "contains";
266
+ value: unknown;
267
+ } | {
268
+ claim: string;
269
+ op: "eq";
270
+ value: unknown;
271
+ } | {
272
+ claim: string;
273
+ op: "exists";
274
+ })[];
275
+ };
276
+ }, true, "default", "authenticated", import("@astrale-os/sdk/schema").PolicyCheckExpression<import("@astrale-os/sdk/schema").PolicyRef, import("@astrale-os/sdk/schema").PolicyCheckObject>, "kernel.astrale.ai:class.Identity.method.whoami"> & {
277
+ readonly name: "whoami";
278
+ }) | (import("@astrale-os/sdk/schema").ResolvedMethod<{
279
+ policy: string;
280
+ object: string;
281
+ }, {
282
+ readonly mode: 'value';
283
+ readonly value: {
284
+ allowed: boolean;
285
+ };
286
+ }, true, "default", "authenticated", import("@astrale-os/sdk/schema").PolicyCheckExpression<import("@astrale-os/sdk/schema").PolicyRef, import("@astrale-os/sdk/schema").PolicyCheckObject>, "kernel.astrale.ai:class.Identity.method.can"> & {
287
+ readonly name: "can";
288
+ }) | (import("@astrale-os/sdk/schema").ResolvedMethod<{
289
+ issuer: string;
290
+ subject: string;
291
+ }, {
292
+ readonly mode: 'value';
293
+ readonly value: {
294
+ id: string;
295
+ issuer: string;
296
+ subject: string;
297
+ frozen: boolean;
298
+ requiredClaims: ({
299
+ claim: string;
300
+ op: "contains";
301
+ value: unknown;
302
+ } | {
303
+ claim: string;
304
+ op: "eq";
305
+ value: unknown;
306
+ } | {
307
+ claim: string;
308
+ op: "exists";
309
+ })[];
310
+ } | null;
311
+ }, true, "default", "authorized", import("@astrale-os/sdk/schema").PolicyCheckExpression<import("@astrale-os/sdk/schema").PolicyRef, import("@astrale-os/sdk/schema").PolicyCheckObject>, "kernel.astrale.ai:class.Identity.method.whois"> & {
312
+ readonly name: "whois";
313
+ }) | (import("@astrale-os/sdk/schema").ResolvedMethod<{
314
+ audience?: string | undefined;
315
+ ttlSeconds: number;
316
+ grant?: unknown;
317
+ }, {
318
+ readonly mode: 'value';
319
+ readonly value: string;
320
+ }, true, "default", "authorized", import("@astrale-os/sdk/schema").PolicyCheckExpression<import("@astrale-os/sdk/schema").PolicyRef, import("@astrale-os/sdk/schema").PolicyCheckObject>, "kernel.astrale.ai:class.Identity.method.mint"> & {
321
+ readonly name: "mint";
322
+ });
323
+ }>;
@@ -0,0 +1,7 @@
1
+ import { K, nodeClass } from '@astrale-os/sdk/schema';
2
+ import { groupAssignUser, groupUnassignUser } from './methods.js';
3
+ export const Group = nodeClass({
4
+ description: 'A named compositional Shell Identity.',
5
+ extends: [K.classes.Identity, K.classes.Named, K.classes.Descriptable],
6
+ methods: { assignUser: groupAssignUser, unassignUser: groupUnassignUser },
7
+ });
@@ -0,0 +1,10 @@
1
+ import { type builder } from '@astrale-os/sdk/schema';
2
+ export declare const adminGroup: builder.CoreNode;
3
+ export declare const memberGroup: builder.CoreNode;
4
+ export declare const groupCore: {
5
+ nodes: {
6
+ admin: builder.CoreNode;
7
+ member: builder.CoreNode;
8
+ };
9
+ edges: never[];
10
+ };
@@ -0,0 +1,14 @@
1
+ import { K, core } from '@astrale-os/sdk/schema';
2
+ import { Group } from './class.js';
3
+ const identity = (subject, name, description) => core.node(() => Group, {
4
+ [K.classes.Identity.self.properties.iss.key]: 'shell.astrale.ai',
5
+ [K.classes.Identity.self.properties.sub.key]: subject,
6
+ [K.classes.Named.self.properties.name.key]: name,
7
+ [K.classes.Descriptable.self.properties.description.key]: description,
8
+ });
9
+ export const adminGroup = identity('core.admin', 'Administrators', 'Users entrusted with Shell application-plane administration.');
10
+ export const memberGroup = identity('core.member', 'Members', 'Users admitted to the common Shell application plane.');
11
+ export const groupCore = {
12
+ nodes: { admin: adminGroup, member: memberGroup },
13
+ edges: [],
14
+ };
@@ -0,0 +1,6 @@
1
+ export { Group } from './class.js';
2
+ export { adminGroup, groupCore, memberGroup } from './core.js';
3
+ export { groupAssignUser, groupUnassignUser } from './methods.js';
4
+ export { maySetupUsers } from './policies.js';
5
+ export { member_of_group } from './relationships.js';
6
+ export { groupView } from './view.js';
@@ -0,0 +1,6 @@
1
+ export { Group } from './class.js';
2
+ export { adminGroup, groupCore, memberGroup } from './core.js';
3
+ export { groupAssignUser, groupUnassignUser } from './methods.js';
4
+ export { maySetupUsers } from './policies.js';
5
+ export { member_of_group } from './relationships.js';
6
+ export { groupView } from './view.js';
@@ -0,0 +1,13 @@
1
+ import { type builder } from '@astrale-os/sdk/schema';
2
+ export declare const groupAssignUser: builder.Method<builder.CallableProjection<{
3
+ user: string;
4
+ }, {
5
+ readonly mode: 'value';
6
+ readonly value: import("@astrale-os/sdk/schema").Value;
7
+ }, "authorized", false, "default">>;
8
+ export declare const groupUnassignUser: builder.Method<builder.CallableProjection<{
9
+ user: string;
10
+ }, {
11
+ readonly mode: 'value';
12
+ readonly value: import("@astrale-os/sdk/schema").Value;
13
+ }, "authorized", false, "default">>;
@@ -0,0 +1,22 @@
1
+ import { method, path } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { User } from '#schema/user';
4
+ import { adminGroup } from './core.js';
5
+ import { maySetupUsers } from './policies.js';
6
+ const emptyObject = {
7
+ type: 'object',
8
+ properties: {},
9
+ additionalProperties: false,
10
+ };
11
+ const setupPolicy = ({ check, ref }) => check(maySetupUsers, ref(adminGroup));
12
+ function membershipMethod(description) {
13
+ return method({
14
+ description,
15
+ input: z.strictObject({ user: path(User) }),
16
+ output: emptyObject,
17
+ auth: 'authorized',
18
+ policy: setupPolicy,
19
+ });
20
+ }
21
+ export const groupAssignUser = membershipMethod('Assign one User to this Group.');
22
+ export const groupUnassignUser = membershipMethod('Remove one User from this Group.');
@@ -0,0 +1 @@
1
+ export declare const maySetupUsers: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,6 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { member_of_group } from './relationships.js';
3
+ export const maySetupUsers = policy({
4
+ description: 'The effective User Grant belongs to the selected Administrators Group.',
5
+ match: ({ edge, object, subject }) => edge({ source: subject, class: member_of_group, target: object }),
6
+ });
@@ -0,0 +1,16 @@
1
+ export declare const member_of_group: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
2
+ readonly depth: 0;
3
+ readonly abstract: false;
4
+ readonly extends: readonly [];
5
+ readonly properties: never;
6
+ readonly source: {
7
+ readonly as: "user";
8
+ readonly outgoing: "0..*";
9
+ };
10
+ readonly target: {
11
+ readonly as: "group";
12
+ readonly incoming: "0..*";
13
+ };
14
+ readonly constraints: Record<never, never>;
15
+ readonly effectiveProperties: never;
16
+ }>;
@@ -0,0 +1,8 @@
1
+ import { edgeClass } from '@astrale-os/sdk/schema';
2
+ import { User } from '#schema/user';
3
+ import { Group } from './class.js';
4
+ export const member_of_group = edgeClass.directed({
5
+ source: { as: 'user', accepts: [User], outgoing: '0..*' },
6
+ target: { as: 'group', accepts: [() => Group], incoming: '0..*' },
7
+ description: 'Shell product membership.',
8
+ });
@@ -0,0 +1 @@
1
+ export declare const groupView: import("@astrale-os/sdk/schema").View;
@@ -0,0 +1,6 @@
1
+ import { view } from '@astrale-os/sdk/schema';
2
+ import { Group } from './class.js';
3
+ export const groupView = view({
4
+ description: 'Shell Group membership and administration.',
5
+ target: Group,
6
+ });
@@ -0,0 +1 @@
1
+ export { homeView } from './view.js';
@@ -0,0 +1 @@
1
+ export { homeView } from './view.js';
@@ -0,0 +1 @@
1
+ export declare const homeView: import("@astrale-os/sdk/schema").View;
@@ -0,0 +1,4 @@
1
+ import { view } from '@astrale-os/sdk/schema';
2
+ export const homeView = view({
3
+ description: 'Shell home and browser-local Space navigation.',
4
+ });
@@ -0,0 +1,6 @@
1
+ export { ORIGIN, S, ShellCore, ShellSchema, type GroupMembershipInput, type GroupMembershipResult, type ResolveHomeResult, type SetDefaultSpaceInput, type SetDefaultSpaceResult, type SetupUserInput, type SetupUserResult, type Shell, type SpaceUserAccess, type SpaceUserAccessInput, type SpaceUserAccessResult, type SpaceUserInput, type SpaceUserResult, } from '#schema/domain';
2
+ export { Group, adminGroup, groupAssignUser, groupCore, groupUnassignUser, groupView, maySetupUsers, memberGroup, member_of_group, } from '#schema/group';
3
+ export { homeView } from '#schema/home';
4
+ export { setupAdmin, setupMember } from '#schema/setup';
5
+ export { Space, administers_space, belongsToSpace, default_space, defaultSpace, mayAdministerSpace, member_of_space, owns_space, ownsSpace, spaceAddUser, spaceCore, spaceRemoveUser, spaceSetDefault, spaceView, } from '#schema/space';
6
+ export { User, resolveHome, userView } from '#schema/user';
@@ -0,0 +1,6 @@
1
+ export { ORIGIN, S, ShellCore, ShellSchema, } from '#schema/domain';
2
+ export { Group, adminGroup, groupAssignUser, groupCore, groupUnassignUser, groupView, maySetupUsers, memberGroup, member_of_group, } from '#schema/group';
3
+ export { homeView } from '#schema/home';
4
+ export { setupAdmin, setupMember } from '#schema/setup';
5
+ export { Space, administers_space, belongsToSpace, default_space, defaultSpace, mayAdministerSpace, member_of_space, owns_space, ownsSpace, spaceAddUser, spaceCore, spaceRemoveUser, spaceSetDefault, spaceView, } from '#schema/space';
6
+ export { User, resolveHome, userView } from '#schema/user';
@@ -0,0 +1,28 @@
1
+ export declare const setupMember: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
2
+ operationId: string;
3
+ issuer: string;
4
+ subject: string;
5
+ displayName: string;
6
+ personalSpaceName: string;
7
+ }, {
8
+ readonly mode: 'value';
9
+ readonly value: {
10
+ userId: string;
11
+ personalSpaceId: string;
12
+ changed: boolean;
13
+ };
14
+ }, "authorized", false, "default">>;
15
+ export declare const setupAdmin: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<{
16
+ operationId: string;
17
+ issuer: string;
18
+ subject: string;
19
+ displayName: string;
20
+ personalSpaceName: string;
21
+ }, {
22
+ readonly mode: 'value';
23
+ readonly value: {
24
+ userId: string;
25
+ personalSpaceId: string;
26
+ changed: boolean;
27
+ };
28
+ }, "authorized", false, "default">>;
@@ -0,0 +1,27 @@
1
+ import { func, fullMatch } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { adminGroup, maySetupUsers } from '#schema/group';
4
+ const operationId = z.string().min(1).max(256).check(fullMatch('[A-Za-z0-9][A-Za-z0-9._:-]{0,255}'));
5
+ const input = z.strictObject({
6
+ operationId,
7
+ issuer: z.string().min(1).max(2_048),
8
+ subject: z.string().min(1).max(2_048),
9
+ displayName: z.string().min(1).max(160),
10
+ personalSpaceName: z.string().min(1).max(160),
11
+ });
12
+ const output = z.strictObject({
13
+ userId: z.string().min(1),
14
+ personalSpaceId: z.string().min(1),
15
+ changed: z.boolean(),
16
+ });
17
+ function setup(description) {
18
+ return func({
19
+ description,
20
+ auth: 'authorized',
21
+ input,
22
+ output,
23
+ policy: ({ check, ref }) => check(maySetupUsers, ref(adminGroup)),
24
+ });
25
+ }
26
+ export const setupMember = setup('Converge one asserted external identity as a Shell member.');
27
+ export const setupAdmin = setup('Converge one asserted external identity as a Shell administrator.');
@@ -0,0 +1 @@
1
+ export { setupAdmin, setupMember } from './functions.js';
@@ -0,0 +1 @@
1
+ export { setupAdmin, setupMember } from './functions.js';