@astrale-domains/shell-schema 0.3.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAcvB,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBjB,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,MAAM,CAAyB,CAAA;AAE7D,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Schema assembly — the one place the domain's contexts come together, and the
3
+ * single source of the domain's stable identity. `schema.domain` (the first arg
4
+ * to `defineSchema`) IS the origin: `astrale.config.ts` defaults `origin` to it,
5
+ * and the worker signs JWTs under it. Change it here to rename the domain's
6
+ * identity.
7
+ *
8
+ * The shell domain owns the platform's identity/workspace concern — Users,
9
+ * Groups, Spaces, Apps, Roles, and the root OS registries. Sandbox compute
10
+ * lives in the separate `agents` domain.
11
+ *
12
+ * Add a context: author `schema/<context>.ts`, then import its members and list
13
+ * them in the `interfaces` / `classes` maps below. EDGE classes register under
14
+ * `classes` too. Standalone functions (the `seed` bootstrap) declare their
15
+ * CONTRACT here (`functions`, via `func()`); the handler lives in `functions/`.
16
+ */
17
+ import { defineSchema, KernelSchema } from '@astrale-os/kernel-core';
18
+ import { compileDomain } from '@astrale-os/kernel-core/domain';
19
+ import { func } from '@astrale-os/kernel-dsl';
20
+ import { z } from 'zod';
21
+ import { Application, entrypoint, has_role, installed_in, iRole, of_domain, Role, } from './application';
22
+ import { belongs_to, Group, iGroup, iUser, User } from './identity';
23
+ import { default_location, iSpace, owned_by, selected_space, Space } from './space';
24
+ export const schema = defineSchema('shell.astrale.ai', {
25
+ interfaces: { User: iUser, Group: iGroup, Space: iSpace, Role: iRole },
26
+ classes: {
27
+ User,
28
+ Group,
29
+ Space,
30
+ Application,
31
+ Role,
32
+ belongs_to,
33
+ installed_in,
34
+ of_domain,
35
+ entrypoint,
36
+ has_role,
37
+ default_location,
38
+ owned_by,
39
+ selected_space,
40
+ },
41
+ functions: {
42
+ /** The post-install bootstrap (see `functions/index.ts` for the handler). */
43
+ seed: func({ input: z.object({}), output: z.object({ seeded: z.boolean() }) }),
44
+ },
45
+ imports: [KernelSchema],
46
+ });
47
+ /**
48
+ * The compiled domain — resolved class/interface paths + qualified prop keys.
49
+ * `compileDomain` is pure (no env), so this is safe to import from the worker
50
+ * and from build tooling alike. `core/shell/keys.ts` re-exports it as the
51
+ * single source of graph-facing strings — never hand-write those.
52
+ */
53
+ export const D = compileDomain(schema);
54
+ export * from './application';
55
+ export * from './identity';
56
+ export * from './space';
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBA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Ac,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,458 @@
1
+ import { z } from 'zod';
2
+ /** `Space` (interface) — a shareable workspace container. */
3
+ export declare const iSpace: import("@astrale-os/kernel-dsl").NodeInterfaceDef<Omit<Omit<import("@astrale-os/kernel-dsl").NodeInterfaceConfig, "inherits" | "properties"> & {
4
+ readonly props?: import("@astrale-os/kernel-dsl").PropertyShape;
5
+ }, "props"> & {
6
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
7
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
8
+ readonly properties: {
9
+ createdAt: z.ZodISODateTime;
10
+ updatedAt: z.ZodISODateTime;
11
+ };
12
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
13
+ readonly properties: {
14
+ externalId: z.ZodOptional<z.ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
15
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
16
+ onConflict: z.ZodOptional<z.ZodEnum<{
17
+ defaults: "defaults";
18
+ error: "error";
19
+ merge: "merge";
20
+ replace: "replace";
21
+ skip: "skip";
22
+ }>>;
23
+ };
24
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
25
+ readonly properties: {
26
+ name: z.ZodString;
27
+ };
28
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
29
+ readonly properties: {
30
+ description: z.ZodOptional<z.ZodString>;
31
+ };
32
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
33
+ readonly properties: {
34
+ status: z.ZodEnum<{
35
+ active: "active";
36
+ creating: "creating";
37
+ deleting: "deleting";
38
+ error: "error";
39
+ updating: "updating";
40
+ }>;
41
+ };
42
+ }>];
43
+ readonly methods: {
44
+ move: import("@astrale-os/kernel-dsl").FnDef<{
45
+ readonly to: z.ZodType<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath, z.core.$ZodTypeInternals<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath>>;
46
+ }, z.ZodVoid, "sealed", boolean>;
47
+ };
48
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<Omit<{
49
+ readonly methods: {};
50
+ }, "props"> & {
51
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
52
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
53
+ readonly properties: {
54
+ createdAt: import("zod").ZodISODateTime;
55
+ updatedAt: import("zod").ZodISODateTime;
56
+ };
57
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
58
+ readonly properties: {
59
+ externalId: import("zod").ZodOptional<import("zod").ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
60
+ updatedAt: import("zod").ZodOptional<import("zod").ZodISODateTime>;
61
+ onConflict: import("zod").ZodOptional<import("zod").ZodEnum<{
62
+ defaults: "defaults";
63
+ error: "error";
64
+ merge: "merge";
65
+ replace: "replace";
66
+ skip: "skip";
67
+ }>>;
68
+ };
69
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
70
+ readonly properties: {
71
+ name: import("zod").ZodString;
72
+ };
73
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
74
+ readonly properties: {
75
+ description: import("zod").ZodOptional<import("zod").ZodString>;
76
+ };
77
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
78
+ readonly properties: {
79
+ status: import("zod").ZodEnum<{
80
+ active: "active";
81
+ creating: "creating";
82
+ deleting: "deleting";
83
+ error: "error";
84
+ updating: "updating";
85
+ }>;
86
+ };
87
+ }>];
88
+ readonly methods: {
89
+ move: import("@astrale-os/kernel-dsl").FnDef<{
90
+ readonly to: import("zod").ZodType<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath, import("zod/v4/core").$ZodTypeInternals<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath>>;
91
+ }, import("zod").ZodVoid, "sealed", boolean>;
92
+ };
93
+ }>];
94
+ }>];
95
+ }>;
96
+ /** The DEFAULT `Space` — implements the `Space` interface (a Container). */
97
+ export declare const Space: import("@astrale-os/kernel-dsl").NodeClassDef<Omit<{
98
+ readonly implements: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<Omit<Omit<import("@astrale-os/kernel-dsl").NodeInterfaceConfig, "inherits" | "properties"> & {
99
+ readonly props?: import("@astrale-os/kernel-dsl").PropertyShape;
100
+ }, "props"> & {
101
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
102
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
103
+ readonly properties: {
104
+ createdAt: z.ZodISODateTime;
105
+ updatedAt: z.ZodISODateTime;
106
+ };
107
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
108
+ readonly properties: {
109
+ externalId: z.ZodOptional<z.ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
110
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
111
+ onConflict: z.ZodOptional<z.ZodEnum<{
112
+ defaults: "defaults";
113
+ error: "error";
114
+ merge: "merge";
115
+ replace: "replace";
116
+ skip: "skip";
117
+ }>>;
118
+ };
119
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
120
+ readonly properties: {
121
+ name: z.ZodString;
122
+ };
123
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
124
+ readonly properties: {
125
+ description: z.ZodOptional<z.ZodString>;
126
+ };
127
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
128
+ readonly properties: {
129
+ status: z.ZodEnum<{
130
+ active: "active";
131
+ creating: "creating";
132
+ deleting: "deleting";
133
+ error: "error";
134
+ updating: "updating";
135
+ }>;
136
+ };
137
+ }>];
138
+ readonly methods: {
139
+ move: import("@astrale-os/kernel-dsl").FnDef<{
140
+ readonly to: z.ZodType<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath, z.core.$ZodTypeInternals<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath>>;
141
+ }, z.ZodVoid, "sealed", boolean>;
142
+ };
143
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<Omit<{
144
+ readonly methods: {};
145
+ }, "props"> & {
146
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
147
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
148
+ readonly properties: {
149
+ createdAt: import("zod").ZodISODateTime;
150
+ updatedAt: import("zod").ZodISODateTime;
151
+ };
152
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
153
+ readonly properties: {
154
+ externalId: import("zod").ZodOptional<import("zod").ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
155
+ updatedAt: import("zod").ZodOptional<import("zod").ZodISODateTime>;
156
+ onConflict: import("zod").ZodOptional<import("zod").ZodEnum<{
157
+ defaults: "defaults";
158
+ error: "error";
159
+ merge: "merge";
160
+ replace: "replace";
161
+ skip: "skip";
162
+ }>>;
163
+ };
164
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
165
+ readonly properties: {
166
+ name: import("zod").ZodString;
167
+ };
168
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
169
+ readonly properties: {
170
+ description: import("zod").ZodOptional<import("zod").ZodString>;
171
+ };
172
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
173
+ readonly properties: {
174
+ status: import("zod").ZodEnum<{
175
+ active: "active";
176
+ creating: "creating";
177
+ deleting: "deleting";
178
+ error: "error";
179
+ updating: "updating";
180
+ }>;
181
+ };
182
+ }>];
183
+ readonly methods: {
184
+ move: import("@astrale-os/kernel-dsl").FnDef<{
185
+ readonly to: import("zod").ZodType<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath, import("zod/v4/core").$ZodTypeInternals<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath>>;
186
+ }, import("zod").ZodVoid, "sealed", boolean>;
187
+ };
188
+ }>];
189
+ }>];
190
+ }>];
191
+ readonly icon: string;
192
+ readonly methods: {
193
+ /**
194
+ * `Space.create(name?, owner?)` — the single space-creation entry, used by
195
+ * `User.init` (the personal space) and dispatched directly (additional
196
+ * spaces). Creates the Space node under the spaces directory, ensures the
197
+ * default folder structure (an `apps` Folder pinned by the
198
+ * `default_location` edge, slug `apps`), grants the OWNER full permissions
199
+ * on the space (which propagate to everything inside), and installs the
200
+ * DEFAULT APPLICATIONS — every installed domain whose manifest declares an
201
+ * `entrypoint` — assigning the owner each domain's default roles.
202
+ *
203
+ * `owner` (a user path or `@id`) defaults to the CALLER. Only a system /
204
+ * elevated caller may create a space for someone else. Idempotent per
205
+ * resulting slug: re-creating converges on the existing space.
206
+ *
207
+ * SELECTS the resulting space for the owner — repoints their
208
+ * `selected_space` edge to it (a fresh space becomes the active one), on the
209
+ * converge path too.
210
+ */
211
+ create: import("@astrale-os/kernel-dsl").FnDef<{
212
+ readonly name: z.ZodOptional<z.ZodString>;
213
+ readonly owner: z.ZodOptional<z.ZodString>;
214
+ }, z.ZodObject<{
215
+ id: z.ZodString;
216
+ path: z.ZodString;
217
+ skipped: z.ZodOptional<z.ZodArray<z.ZodString>>;
218
+ }, z.core.$strip>, import("@astrale-os/kernel-dsl").MethodInheritance, true>;
219
+ };
220
+ }, "props"> & {
221
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
222
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
223
+ readonly properties: {
224
+ createdAt: z.ZodISODateTime;
225
+ updatedAt: z.ZodISODateTime;
226
+ };
227
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
228
+ readonly properties: {
229
+ externalId: z.ZodOptional<z.ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
230
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
231
+ onConflict: z.ZodOptional<z.ZodEnum<{
232
+ defaults: "defaults";
233
+ error: "error";
234
+ merge: "merge";
235
+ replace: "replace";
236
+ skip: "skip";
237
+ }>>;
238
+ };
239
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
240
+ readonly properties: {
241
+ name: z.ZodString;
242
+ };
243
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
244
+ readonly properties: {
245
+ description: z.ZodOptional<z.ZodString>;
246
+ };
247
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
248
+ readonly properties: {
249
+ status: z.ZodEnum<{
250
+ active: "active";
251
+ creating: "creating";
252
+ deleting: "deleting";
253
+ error: "error";
254
+ updating: "updating";
255
+ }>;
256
+ };
257
+ }>];
258
+ readonly methods: {
259
+ move: import("@astrale-os/kernel-dsl").FnDef<{
260
+ readonly to: z.ZodType<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath, z.core.$ZodTypeInternals<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath>>;
261
+ }, z.ZodVoid, "sealed", boolean>;
262
+ };
263
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<Omit<Omit<import("@astrale-os/kernel-dsl").NodeInterfaceConfig, "inherits" | "properties"> & {
264
+ readonly props?: import("@astrale-os/kernel-dsl").PropertyShape;
265
+ }, "props"> & {
266
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
267
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
268
+ readonly properties: {
269
+ createdAt: z.ZodISODateTime;
270
+ updatedAt: z.ZodISODateTime;
271
+ };
272
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
273
+ readonly properties: {
274
+ externalId: z.ZodOptional<z.ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
275
+ updatedAt: z.ZodOptional<z.ZodISODateTime>;
276
+ onConflict: z.ZodOptional<z.ZodEnum<{
277
+ defaults: "defaults";
278
+ error: "error";
279
+ merge: "merge";
280
+ replace: "replace";
281
+ skip: "skip";
282
+ }>>;
283
+ };
284
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
285
+ readonly properties: {
286
+ name: z.ZodString;
287
+ };
288
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
289
+ readonly properties: {
290
+ description: z.ZodOptional<z.ZodString>;
291
+ };
292
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
293
+ readonly properties: {
294
+ status: z.ZodEnum<{
295
+ active: "active";
296
+ creating: "creating";
297
+ deleting: "deleting";
298
+ error: "error";
299
+ updating: "updating";
300
+ }>;
301
+ };
302
+ }>];
303
+ readonly methods: {
304
+ move: import("@astrale-os/kernel-dsl").FnDef<{
305
+ readonly to: z.ZodType<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath, z.core.$ZodTypeInternals<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath>>;
306
+ }, z.ZodVoid, "sealed", boolean>;
307
+ };
308
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<Omit<{
309
+ readonly methods: {};
310
+ }, "props"> & {
311
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
312
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
313
+ readonly properties: {
314
+ createdAt: import("zod").ZodISODateTime;
315
+ updatedAt: import("zod").ZodISODateTime;
316
+ };
317
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
318
+ readonly properties: {
319
+ externalId: import("zod").ZodOptional<import("zod").ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
320
+ updatedAt: import("zod").ZodOptional<import("zod").ZodISODateTime>;
321
+ onConflict: import("zod").ZodOptional<import("zod").ZodEnum<{
322
+ defaults: "defaults";
323
+ error: "error";
324
+ merge: "merge";
325
+ replace: "replace";
326
+ skip: "skip";
327
+ }>>;
328
+ };
329
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
330
+ readonly properties: {
331
+ name: import("zod").ZodString;
332
+ };
333
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
334
+ readonly properties: {
335
+ description: import("zod").ZodOptional<import("zod").ZodString>;
336
+ };
337
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
338
+ readonly properties: {
339
+ status: import("zod").ZodEnum<{
340
+ active: "active";
341
+ creating: "creating";
342
+ deleting: "deleting";
343
+ error: "error";
344
+ updating: "updating";
345
+ }>;
346
+ };
347
+ }>];
348
+ readonly methods: {
349
+ move: import("@astrale-os/kernel-dsl").FnDef<{
350
+ readonly to: import("zod").ZodType<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath, import("zod/v4/core").$ZodTypeInternals<import("@astrale-os/kernel-core").AbsolutePath, string | import("@astrale-os/kernel-core").AbsolutePath>>;
351
+ }, import("zod").ZodVoid, "sealed", boolean>;
352
+ };
353
+ }>];
354
+ }>];
355
+ }>];
356
+ }>;
357
+ /**
358
+ * A space's named default location — `Space → Container`, the edge slug naming
359
+ * which kind (`apps` today; `files`/`desktop` later). This is a RELATION, not a
360
+ * convention: `Application.install` resolves the target folder by walking it, so
361
+ * repointing the edge (a user reorganizing their space) moves where new apps
362
+ * land without touching any install logic. One edge per slug by contract —
363
+ * repointing = remove + recreate (edge identity includes the target).
364
+ */
365
+ export declare const default_location: import("@astrale-os/kernel-dsl").EdgeClassDef<import("@astrale-os/kernel-dsl").EndpointConfig<string, readonly any[], import("@astrale-os/kernel-dsl").Cardinality>, import("@astrale-os/kernel-dsl").EndpointConfig<string, readonly any[], import("@astrale-os/kernel-dsl").Cardinality>, Omit<Record<never, never>, "props"> & {
366
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
367
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
368
+ readonly properties: {
369
+ slug: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@astrale-os/kernel-core").Slug, string>>>;
370
+ };
371
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
372
+ readonly properties: {
373
+ createdAt: import("zod").ZodISODateTime;
374
+ updatedAt: import("zod").ZodISODateTime;
375
+ };
376
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
377
+ readonly properties: {
378
+ externalId: import("zod").ZodOptional<import("zod").ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
379
+ updatedAt: import("zod").ZodOptional<import("zod").ZodISODateTime>;
380
+ onConflict: import("zod").ZodOptional<import("zod").ZodEnum<{
381
+ defaults: "defaults";
382
+ error: "error";
383
+ merge: "merge";
384
+ replace: "replace";
385
+ skip: "skip";
386
+ }>>;
387
+ };
388
+ }>];
389
+ }>];
390
+ }>;
391
+ /**
392
+ * A space's owner — `Space → User`, written at `Space.create`. The semantic,
393
+ * queryable side of ownership; permissions on the space are separate (`grantPerm`
394
+ * at create). NOT needed for discovery: listing the spaces directory's children
395
+ * already returns exactly the caller-READABLE spaces — kernel visibility is a
396
+ * per-node mask, and an unreadable root's record is omitted while its visible
397
+ * descendants are returned (soft-root; adapters get/result/assemble.ts).
398
+ */
399
+ export declare const owned_by: import("@astrale-os/kernel-dsl").EdgeClassDef<import("@astrale-os/kernel-dsl").EndpointConfig<string, readonly any[], import("@astrale-os/kernel-dsl").Cardinality>, import("@astrale-os/kernel-dsl").EndpointConfig<string, readonly any[], import("@astrale-os/kernel-dsl").Cardinality>, Omit<Record<never, never>, "props"> & {
400
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
401
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
402
+ readonly properties: {
403
+ slug: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@astrale-os/kernel-core").Slug, string>>>;
404
+ };
405
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
406
+ readonly properties: {
407
+ createdAt: import("zod").ZodISODateTime;
408
+ updatedAt: import("zod").ZodISODateTime;
409
+ };
410
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
411
+ readonly properties: {
412
+ externalId: import("zod").ZodOptional<import("zod").ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
413
+ updatedAt: import("zod").ZodOptional<import("zod").ZodISODateTime>;
414
+ onConflict: import("zod").ZodOptional<import("zod").ZodEnum<{
415
+ defaults: "defaults";
416
+ error: "error";
417
+ merge: "merge";
418
+ replace: "replace";
419
+ skip: "skip";
420
+ }>>;
421
+ };
422
+ }>];
423
+ }>];
424
+ }>;
425
+ /**
426
+ * The space a user currently has active — `User → Space`. UI state kept AS graph
427
+ * state: which space the shell should restore on load, rather than tracked out of
428
+ * band by a client. At most one per user (`0..1` on the user end): repointing =
429
+ * remove + recreate, since edge identity includes the target. Written by
430
+ * `Space.create` (a new space becomes active) and `user::switchSpace`.
431
+ */
432
+ export declare const selected_space: import("@astrale-os/kernel-dsl").EdgeClassDef<import("@astrale-os/kernel-dsl").EndpointConfig<string, readonly any[], import("@astrale-os/kernel-dsl").Cardinality>, import("@astrale-os/kernel-dsl").EndpointConfig<string, readonly any[], import("@astrale-os/kernel-dsl").Cardinality>, Omit<Record<never, never>, "props"> & {
433
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
434
+ readonly inherits: readonly [import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
435
+ readonly properties: {
436
+ slug: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<import("@astrale-os/kernel-core").Slug, string>>>;
437
+ };
438
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
439
+ readonly properties: {
440
+ createdAt: import("zod").ZodISODateTime;
441
+ updatedAt: import("zod").ZodISODateTime;
442
+ };
443
+ }>, import("@astrale-os/kernel-dsl").NodeInterfaceDef<{
444
+ readonly properties: {
445
+ externalId: import("zod").ZodOptional<import("zod").ZodCustom<import("@astrale-os/kernel-core").ExternalId, import("@astrale-os/kernel-core").ExternalId>>;
446
+ updatedAt: import("zod").ZodOptional<import("zod").ZodISODateTime>;
447
+ onConflict: import("zod").ZodOptional<import("zod").ZodEnum<{
448
+ defaults: "defaults";
449
+ error: "error";
450
+ merge: "merge";
451
+ replace: "replace";
452
+ skip: "skip";
453
+ }>>;
454
+ };
455
+ }>];
456
+ }>];
457
+ }>;
458
+ //# sourceMappingURL=space.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../space.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,6DAA6D;AAC7D,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjB,CAAA;AAEF,4EAA4E;AAC5E,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAId;;;;;;;;;;;;;;;;;WAiBG;QACH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcR,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;EAG5B,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;EAGpB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;EAG1B,CAAA"}
package/dist/space.js ADDED
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Space context — a shareable container of workspace material (apps, files,
3
+ * app state). Access to a space IS access to what it holds: the creator gets
4
+ * full permissions on the space node and the kernel propagates `has_perm`
5
+ * grants down `has_parent`, so every app installed inside is reachable by
6
+ * exactly whoever can reach the space — there are no per-user app grants.
7
+ *
8
+ * - `iSpace` / `Space` the space INTERFACE (a Container) + its default
9
+ * class. `create` (static) is the single entry:
10
+ * space node + default folder structure + creator
11
+ * perms + the default applications.
12
+ * - Edge `default_location` Space → Container: the space's named default
13
+ * folders (the edge slug names the kind, e.g.
14
+ * `apps`). Application installs resolve the target folder
15
+ * through THIS edge, never a hardcoded path — the
16
+ * user can repoint it later.
17
+ *
18
+ * A user's personal Space is materialized by `User.init` (via `Space.create`);
19
+ * users can create more (team/project spaces) — the caller needs EDIT on the
20
+ * spaces directory, granted to the `users` group at seed.
21
+ */
22
+ import { edgeClass, KernelSchema, nodeClass, nodeInterface } from '@astrale-os/kernel-core';
23
+ import { fn } from '@astrale-os/kernel-dsl';
24
+ import { z } from 'zod';
25
+ import { SPACE_ICON } from './icons';
26
+ import { iUser } from './identity';
27
+ /** `Space` (interface) — a shareable workspace container. */
28
+ export const iSpace = nodeInterface({
29
+ extends: [KernelSchema.interfaces.Container],
30
+ });
31
+ /** The DEFAULT `Space` — implements the `Space` interface (a Container). */
32
+ export const Space = nodeClass({
33
+ implements: [iSpace],
34
+ icon: SPACE_ICON,
35
+ methods: {
36
+ /**
37
+ * `Space.create(name?, owner?)` — the single space-creation entry, used by
38
+ * `User.init` (the personal space) and dispatched directly (additional
39
+ * spaces). Creates the Space node under the spaces directory, ensures the
40
+ * default folder structure (an `apps` Folder pinned by the
41
+ * `default_location` edge, slug `apps`), grants the OWNER full permissions
42
+ * on the space (which propagate to everything inside), and installs the
43
+ * DEFAULT APPLICATIONS — every installed domain whose manifest declares an
44
+ * `entrypoint` — assigning the owner each domain's default roles.
45
+ *
46
+ * `owner` (a user path or `@id`) defaults to the CALLER. Only a system /
47
+ * elevated caller may create a space for someone else. Idempotent per
48
+ * resulting slug: re-creating converges on the existing space.
49
+ *
50
+ * SELECTS the resulting space for the owner — repoints their
51
+ * `selected_space` edge to it (a fresh space becomes the active one), on the
52
+ * converge path too.
53
+ */
54
+ create: fn({
55
+ static: true,
56
+ params: {
57
+ name: z.string().min(1).optional(),
58
+ owner: z.string().min(1).optional(),
59
+ },
60
+ returns: z.object({
61
+ id: z.string(),
62
+ path: z.string(),
63
+ /** Default applications that failed to install (best-effort), by origin. */
64
+ skipped: z.array(z.string()).optional(),
65
+ }),
66
+ }),
67
+ },
68
+ });
69
+ /**
70
+ * A space's named default location — `Space → Container`, the edge slug naming
71
+ * which kind (`apps` today; `files`/`desktop` later). This is a RELATION, not a
72
+ * convention: `Application.install` resolves the target folder by walking it, so
73
+ * repointing the edge (a user reorganizing their space) moves where new apps
74
+ * land without touching any install logic. One edge per slug by contract —
75
+ * repointing = remove + recreate (edge identity includes the target).
76
+ */
77
+ export const default_location = edgeClass({ as: 'space', types: [iSpace] }, { as: 'location', types: [KernelSchema.interfaces.Container] });
78
+ /**
79
+ * A space's owner — `Space → User`, written at `Space.create`. The semantic,
80
+ * queryable side of ownership; permissions on the space are separate (`grantPerm`
81
+ * at create). NOT needed for discovery: listing the spaces directory's children
82
+ * already returns exactly the caller-READABLE spaces — kernel visibility is a
83
+ * per-node mask, and an unreadable root's record is omitted while its visible
84
+ * descendants are returned (soft-root; adapters get/result/assemble.ts).
85
+ */
86
+ export const owned_by = edgeClass({ as: 'space', types: [iSpace], cardinality: '0..1' }, { as: 'owner', types: [iUser] });
87
+ /**
88
+ * The space a user currently has active — `User → Space`. UI state kept AS graph
89
+ * state: which space the shell should restore on load, rather than tracked out of
90
+ * band by a client. At most one per user (`0..1` on the user end): repointing =
91
+ * remove + recreate, since edge identity includes the target. Written by
92
+ * `Space.create` (a new space becomes active) and `user::switchSpace`.
93
+ */
94
+ export const selected_space = edgeClass({ as: 'user', types: [iUser], cardinality: '0..1' }, { as: 'space', types: [iSpace] });
95
+ //# sourceMappingURL=space.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"space.js","sourceRoot":"","sources":["../space.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC3F,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAA;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC;IAClC,OAAO,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC;CAC7C,CAAC,CAAA;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE;QACP;;;;;;;;;;;;;;;;;WAiBG;QACH,MAAM,EAAE,EA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