@astrale-domains/shell 0.1.0-beta.20 → 0.1.0-beta.22

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 (169) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +19 -15
  3. package/dist/application.d.ts +3 -2
  4. package/dist/application.js +53 -18
  5. package/dist/{workflows → functions}/group/assign.d.ts +1 -1
  6. package/dist/{workflows → functions}/group/change.d.ts +1 -1
  7. package/dist/{workflows → functions}/group/unassign.d.ts +1 -1
  8. package/dist/functions/registry/index.d.ts +12 -0
  9. package/dist/functions/registry/index.js +12 -0
  10. package/dist/{workflows → functions}/setup/admin.d.ts +1 -1
  11. package/dist/{workflows → functions}/setup/index.d.ts +0 -1
  12. package/dist/{workflows → functions}/setup/index.js +0 -1
  13. package/dist/{workflows → functions}/setup/member.d.ts +1 -1
  14. package/dist/{workflows → functions}/setup/provision.d.ts +2 -2
  15. package/dist/{workflows → functions}/setup/run.d.ts +2 -2
  16. package/dist/{workflows → functions}/setup/run.js +9 -2
  17. package/dist/{workflows → functions}/space/access.d.ts +1 -1
  18. package/dist/{workflows → functions}/space/add.d.ts +1 -1
  19. package/dist/{workflows → functions}/space/default.d.ts +1 -1
  20. package/dist/{workflows → functions}/space/remove.d.ts +1 -1
  21. package/dist/functions/user/index.d.ts +3 -0
  22. package/dist/functions/user/index.js +3 -0
  23. package/dist/{actions → functions}/user/resolve-home.d.ts +1 -1
  24. package/dist/mutations/group/membership.d.ts +1 -1
  25. package/dist/mutations/space/access.d.ts +1 -1
  26. package/dist/mutations/space/default.d.ts +1 -1
  27. package/dist/mutations/user/repair.d.ts +3 -21
  28. package/dist/queries/space/access.d.ts +1 -1
  29. package/dist/queries/space/admin.d.ts +1 -1
  30. package/dist/queries/space/member.d.ts +1 -1
  31. package/dist/queries/user/groups.d.ts +1 -1
  32. package/dist/queries/user/home.d.ts +1 -1
  33. package/dist/queries/user/owned-spaces.d.ts +1 -1
  34. package/dist/queries/user/profile.d.ts +1 -1
  35. package/dist/queries/user/setup.d.ts +1 -1
  36. package/dist/rules/user/index.d.ts +1 -0
  37. package/dist/rules/user/index.js +1 -0
  38. package/dist/rules/user/setup.d.ts +38 -0
  39. package/dist/{workflows/setup/plan.js → rules/user/setup.js} +0 -5
  40. package/dist/runtime.d.ts +6 -3
  41. package/dist/runtime.js +7 -13
  42. package/dist/schema/index.d.ts +4 -6
  43. package/dist/schema/index.js +4 -6
  44. package/dist/schema/{group/class.d.ts → modules/group/classes/group.d.ts} +4 -2
  45. package/dist/schema/modules/group/classes/group.js +10 -0
  46. package/dist/schema/{group/relationships.js → modules/group/classes/member-of-group.js} +2 -2
  47. package/dist/schema/modules/group/core/admin-group.d.ts +1 -0
  48. package/dist/schema/modules/group/core/admin-group.js +2 -0
  49. package/dist/schema/modules/group/core/core.d.ts +8 -0
  50. package/dist/schema/modules/group/core/core.js +6 -0
  51. package/dist/schema/modules/group/core/identity.d.ts +1 -0
  52. package/dist/schema/modules/group/core/identity.js +10 -0
  53. package/dist/schema/modules/group/core/member-group.d.ts +1 -0
  54. package/dist/schema/modules/group/core/member-group.js +2 -0
  55. package/dist/schema/modules/group/functions/assign-user.d.ts +6 -0
  56. package/dist/schema/modules/group/functions/assign-user.js +2 -0
  57. package/dist/schema/modules/group/functions/membership.d.ts +7 -0
  58. package/dist/schema/{group/methods.js → modules/group/functions/membership.js} +4 -6
  59. package/dist/schema/modules/group/functions/unassign-user.d.ts +6 -0
  60. package/dist/schema/modules/group/functions/unassign-user.js +2 -0
  61. package/dist/schema/modules/group/index.d.ts +9 -0
  62. package/dist/schema/modules/group/index.js +9 -0
  63. package/dist/schema/{group/policies.js → modules/group/policies/may-setup-users.js} +1 -1
  64. package/dist/schema/{group/view.js → modules/group/views/group.js} +1 -1
  65. package/dist/schema/modules/space/classes/administers-space.d.ts +16 -0
  66. package/dist/schema/modules/space/classes/administers-space.js +9 -0
  67. package/dist/schema/modules/space/classes/default-space.d.ts +16 -0
  68. package/dist/schema/modules/space/classes/default-space.js +8 -0
  69. package/dist/schema/modules/space/classes/member-of-space.d.ts +16 -0
  70. package/dist/schema/modules/space/classes/member-of-space.js +9 -0
  71. package/dist/schema/modules/space/classes/owns-space.d.ts +16 -0
  72. package/dist/schema/modules/space/classes/owns-space.js +9 -0
  73. package/dist/schema/{space/class.d.ts → modules/space/classes/space.d.ts} +5 -2
  74. package/dist/schema/modules/space/classes/space.js +15 -0
  75. package/dist/schema/{space → modules/space/core}/core.d.ts +0 -1
  76. package/dist/schema/modules/space/core/core.js +12 -0
  77. package/dist/schema/modules/space/core/default-space.d.ts +1 -0
  78. package/dist/schema/modules/space/core/default-space.js +6 -0
  79. package/dist/schema/modules/space/functions/access.d.ts +10 -0
  80. package/dist/schema/modules/space/functions/access.js +9 -0
  81. package/dist/schema/modules/space/functions/add-user.d.ts +7 -0
  82. package/dist/schema/modules/space/functions/add-user.js +11 -0
  83. package/dist/schema/modules/space/functions/remove-user.d.ts +6 -0
  84. package/dist/schema/modules/space/functions/remove-user.js +9 -0
  85. package/dist/schema/modules/space/functions/set-default.d.ts +4 -0
  86. package/dist/schema/modules/space/functions/set-default.js +9 -0
  87. package/dist/schema/modules/space/index.d.ts +14 -0
  88. package/dist/schema/modules/space/index.js +14 -0
  89. package/dist/schema/modules/space/policies/belongs-to-space.d.ts +1 -0
  90. package/dist/schema/modules/space/policies/belongs-to-space.js +9 -0
  91. package/dist/schema/modules/space/policies/group-space-branch.d.ts +4 -0
  92. package/dist/schema/modules/space/policies/group-space-branch.js +7 -0
  93. package/dist/schema/modules/space/policies/may-administer-space.d.ts +1 -0
  94. package/dist/schema/modules/space/policies/may-administer-space.js +8 -0
  95. package/dist/schema/modules/space/policies/owns-space.d.ts +1 -0
  96. package/dist/schema/modules/space/policies/owns-space.js +7 -0
  97. package/dist/schema/{space/view.js → modules/space/views/space.js} +1 -1
  98. package/dist/schema/{user/class.d.ts → modules/user/classes/user.d.ts} +3 -2
  99. package/dist/schema/modules/user/classes/user.js +12 -0
  100. package/dist/schema/modules/user/functions/setup-admin.d.ts +14 -0
  101. package/dist/schema/modules/user/functions/setup-admin.js +2 -0
  102. package/dist/schema/{setup/functions.d.ts → modules/user/functions/setup-member.d.ts} +0 -14
  103. package/dist/schema/modules/user/functions/setup-member.js +2 -0
  104. package/dist/schema/modules/user/functions/setup-user.d.ts +15 -0
  105. package/dist/schema/{setup/functions.js → modules/user/functions/setup-user.js} +4 -11
  106. package/dist/schema/modules/user/index.d.ts +6 -0
  107. package/dist/schema/modules/user/index.js +6 -0
  108. package/dist/schema/{user/view.js → modules/user/views/user.js} +1 -1
  109. package/dist/schema/{domain/index.d.ts → schema.d.ts} +4 -5
  110. package/dist/schema/{domain/index.js → schema.js} +3 -6
  111. package/package.json +16 -10
  112. package/dist/actions/index.d.ts +0 -1
  113. package/dist/actions/index.js +0 -1
  114. package/dist/actions/user/index.d.ts +0 -1
  115. package/dist/actions/user/index.js +0 -1
  116. package/dist/entrypoints/application.d.ts +0 -1
  117. package/dist/entrypoints/application.js +0 -1
  118. package/dist/entrypoints/runtime.d.ts +0 -1
  119. package/dist/entrypoints/runtime.js +0 -1
  120. package/dist/schema/group/class.js +0 -8
  121. package/dist/schema/group/core.d.ts +0 -10
  122. package/dist/schema/group/core.js +0 -14
  123. package/dist/schema/group/index.d.ts +0 -6
  124. package/dist/schema/group/index.js +0 -6
  125. package/dist/schema/group/methods.d.ts +0 -13
  126. package/dist/schema/home/index.d.ts +0 -1
  127. package/dist/schema/home/index.js +0 -1
  128. package/dist/schema/setup/index.d.ts +0 -1
  129. package/dist/schema/setup/index.js +0 -1
  130. package/dist/schema/space/class.js +0 -12
  131. package/dist/schema/space/core.js +0 -15
  132. package/dist/schema/space/index.d.ts +0 -6
  133. package/dist/schema/space/index.js +0 -6
  134. package/dist/schema/space/methods.d.ts +0 -18
  135. package/dist/schema/space/methods.js +0 -28
  136. package/dist/schema/space/policies.d.ts +0 -4
  137. package/dist/schema/space/policies.js +0 -21
  138. package/dist/schema/space/relationships.d.ts +0 -64
  139. package/dist/schema/space/relationships.js +0 -24
  140. package/dist/schema/user/class.js +0 -11
  141. package/dist/schema/user/index.d.ts +0 -3
  142. package/dist/schema/user/index.js +0 -3
  143. package/dist/workflows/index.d.ts +0 -3
  144. package/dist/workflows/index.js +0 -3
  145. package/dist/workflows/setup/plan.d.ts +0 -18
  146. /package/dist/{workflows → functions}/group/assign.js +0 -0
  147. /package/dist/{workflows → functions}/group/change.js +0 -0
  148. /package/dist/{workflows → functions}/group/index.d.ts +0 -0
  149. /package/dist/{workflows → functions}/group/index.js +0 -0
  150. /package/dist/{workflows → functions}/group/unassign.js +0 -0
  151. /package/dist/{workflows → functions}/setup/admin.js +0 -0
  152. /package/dist/{workflows → functions}/setup/member.js +0 -0
  153. /package/dist/{workflows → functions}/setup/provision.js +0 -0
  154. /package/dist/{workflows → functions}/space/access.js +0 -0
  155. /package/dist/{workflows → functions}/space/add.js +0 -0
  156. /package/dist/{workflows → functions}/space/default.js +0 -0
  157. /package/dist/{workflows → functions}/space/index.d.ts +0 -0
  158. /package/dist/{workflows → functions}/space/index.js +0 -0
  159. /package/dist/{workflows → functions}/space/remove.js +0 -0
  160. /package/dist/{actions → functions}/user/resolve-home.js +0 -0
  161. /package/dist/schema/{group/relationships.d.ts → modules/group/classes/member-of-group.d.ts} +0 -0
  162. /package/dist/schema/{group/policies.d.ts → modules/group/policies/may-setup-users.d.ts} +0 -0
  163. /package/dist/schema/{group/view.d.ts → modules/group/views/group.d.ts} +0 -0
  164. /package/dist/schema/{space/view.d.ts → modules/space/views/space.d.ts} +0 -0
  165. /package/dist/schema/{user/methods.d.ts → modules/user/functions/resolve-home.d.ts} +0 -0
  166. /package/dist/schema/{user/methods.js → modules/user/functions/resolve-home.js} +0 -0
  167. /package/dist/schema/{home/view.d.ts → modules/user/views/home.d.ts} +0 -0
  168. /package/dist/schema/{home/view.js → modules/user/views/home.js} +0 -0
  169. /package/dist/schema/{user/view.d.ts → modules/user/views/user.d.ts} +0 -0
@@ -0,0 +1,12 @@
1
+ import { classIcon, K, nodeClass, property, } from '@astrale-os/sdk/schema';
2
+ import { UserRound } from '@astrale-os/sdk/schema/icons';
3
+ import { z } from 'zod';
4
+ import { resolveHome } from '../functions/resolve-home.js';
5
+ const displayName = property(z.string().min(1).max(160), { required: false });
6
+ export const User = nodeClass({
7
+ description: 'One externally identified person using Shell.',
8
+ extends: [K.classes.Identity],
9
+ icon: classIcon.lucide(UserRound),
10
+ properties: { displayName },
11
+ methods: { resolveHome },
12
+ });
@@ -0,0 +1,14 @@
1
+ export declare const setupAdmin: 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">>;
@@ -0,0 +1,2 @@
1
+ import { defineSetupUser } from './setup-user.js';
2
+ export const setupAdmin = defineSetupUser('Converge one asserted external identity as a Shell administrator.');
@@ -12,17 +12,3 @@ export declare const setupMember: import("@astrale-os/sdk/schema").Function<impo
12
12
  changed: boolean;
13
13
  };
14
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,2 @@
1
+ import { defineSetupUser } from './setup-user.js';
2
+ export const setupMember = defineSetupUser('Converge one asserted external identity as a Shell member.');
@@ -0,0 +1,15 @@
1
+ import { type builder } from '@astrale-os/sdk/schema';
2
+ export declare function defineSetupUser(description: string): builder.Function<builder.CallableProjection<{
3
+ operationId: string;
4
+ issuer: string;
5
+ subject: string;
6
+ displayName: string;
7
+ personalSpaceName: string;
8
+ }, {
9
+ readonly mode: 'value';
10
+ readonly value: {
11
+ userId: string;
12
+ personalSpaceId: string;
13
+ changed: boolean;
14
+ };
15
+ }, "authorized", false, "default">>;
@@ -1,6 +1,6 @@
1
1
  import { func, fullMatch } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
- import { adminGroup, maySetupUsers } from '#schema/group';
3
+ import { adminGroup, maySetupUsers } from '#schema/modules/group';
4
4
  const operationId = z.string().min(1).max(256).check(fullMatch('[A-Za-z0-9][A-Za-z0-9._:-]{0,255}'));
5
5
  const input = z.strictObject({
6
6
  operationId,
@@ -14,14 +14,7 @@ const output = z.strictObject({
14
14
  personalSpaceId: z.string().min(1),
15
15
  changed: z.boolean(),
16
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
- });
17
+ const setupPolicy = ({ check, ref }) => check(maySetupUsers, ref(adminGroup));
18
+ export function defineSetupUser(description) {
19
+ return func({ description, auth: 'authorized', input, output, policy: setupPolicy });
25
20
  }
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,6 @@
1
+ export { User } from './classes/user.js';
2
+ export { resolveHome } from './functions/resolve-home.js';
3
+ export { setupAdmin } from './functions/setup-admin.js';
4
+ export { setupMember } from './functions/setup-member.js';
5
+ export { homeView } from './views/home.js';
6
+ export { userView } from './views/user.js';
@@ -0,0 +1,6 @@
1
+ export { User } from './classes/user.js';
2
+ export { resolveHome } from './functions/resolve-home.js';
3
+ export { setupAdmin } from './functions/setup-admin.js';
4
+ export { setupMember } from './functions/setup-member.js';
5
+ export { homeView } from './views/home.js';
6
+ export { userView } from './views/user.js';
@@ -1,5 +1,5 @@
1
1
  import { view } from '@astrale-os/sdk/schema';
2
- import { User } from './class.js';
2
+ import { User } from '../classes/user.js';
3
3
  export const userView = view({
4
4
  description: 'Shell User profile and relationships.',
5
5
  target: User,
@@ -1,8 +1,7 @@
1
1
  import { defineSchema, KernelSchema, schema, type builder, type CallableInputOf, type CallableResultOf } from '@astrale-os/sdk/schema';
2
- import { Group, groupAssignUser, groupUnassignUser, member_of_group } from '#schema/group';
3
- import { setupAdmin, setupMember } from '#schema/setup';
4
- import { Space, administers_space, default_space, member_of_space, owns_space, spaceAddUser, spaceRemoveUser, spaceSetDefault } from '#schema/space';
5
- import { User, resolveHome } from '#schema/user';
2
+ import { Group, member_of_group } from './modules/group/index.js';
3
+ import { Space, administers_space, default_space, member_of_space, owns_space } from './modules/space/index.js';
4
+ import { User } from './modules/user/index.js';
6
5
  export declare const ORIGIN: 'shell.astrale.ai';
7
6
  export declare const ShellCore: {
8
7
  nodes: {
@@ -91,4 +90,4 @@ export type SpaceUserAccess = SpaceUserAccessInput['access'];
91
90
  export type SpaceUserAccessResult = CallableResultOf<typeof S.classes.Space.self.methods.addUser>;
92
91
  export type SpaceUserInput = CallableInputOf<typeof S.classes.Space.self.methods.removeUser>;
93
92
  export type SpaceUserResult = CallableResultOf<typeof S.classes.Space.self.methods.removeUser>;
94
- export { groupAssignUser, groupUnassignUser, resolveHome, setupAdmin, setupMember, spaceAddUser, spaceRemoveUser, spaceSetDefault, };
93
+ export {};
@@ -1,9 +1,7 @@
1
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';
2
+ import { Group, adminGroup, groupCore, groupView, maySetupUsers, memberGroup, member_of_group, } from '#schema/modules/group';
3
+ import { Space, administers_space, belongsToSpace, default_space, defaultSpace, mayAdministerSpace, member_of_space, owns_space, ownsSpace, spaceCore, spaceView, } from '#schema/modules/space';
4
+ import { User, homeView, setupAdmin, setupMember, userView } from '#schema/modules/user';
7
5
  export const ORIGIN = 'shell.astrale.ai';
8
6
  export const ShellCore = {
9
7
  nodes: {
@@ -37,4 +35,3 @@ const input = {
37
35
  };
38
36
  export const ShellSchema = defineSchema(ORIGIN, input);
39
37
  export const S = schema.resolve(ShellSchema);
40
- export { groupAssignUser, groupUnassignUser, resolveHome, setupAdmin, setupMember, spaceAddUser, spaceRemoveUser, spaceSetDefault, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-domains/shell",
3
- "version": "0.1.0-beta.20",
3
+ "version": "0.1.0-beta.22",
4
4
  "description": "Astrale Shell Domain schema and remote product implementation",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -15,14 +15,16 @@
15
15
  "main": "./dist/index.js",
16
16
  "types": "./dist/index.d.ts",
17
17
  "imports": {
18
+ "#functions": "./dist/functions/index.js",
19
+ "#functions/*": "./dist/functions/*/index.js",
18
20
  "#mutations": "./dist/mutations/index.js",
19
21
  "#mutations/*": "./dist/mutations/*/index.js",
20
22
  "#queries": "./dist/queries/index.js",
21
23
  "#queries/*": "./dist/queries/*/index.js",
24
+ "#rules": "./dist/rules/index.js",
25
+ "#rules/*": "./dist/rules/*/index.js",
22
26
  "#schema": "./dist/schema/index.js",
23
- "#schema/*": "./dist/schema/*/index.js",
24
- "#workflows": "./dist/workflows/index.js",
25
- "#workflows/*": "./dist/workflows/*/index.js"
27
+ "#schema/*": "./dist/schema/*/index.js"
26
28
  },
27
29
  "exports": {
28
30
  ".": {
@@ -30,12 +32,12 @@
30
32
  "import": "./dist/index.js"
31
33
  },
32
34
  "./application": {
33
- "types": "./dist/entrypoints/application.d.ts",
34
- "import": "./dist/entrypoints/application.js"
35
+ "types": "./dist/application.d.ts",
36
+ "import": "./dist/application.js"
35
37
  },
36
38
  "./runtime": {
37
39
  "types": "./dist/runtime.d.ts",
38
- "import": "./dist/entrypoints/runtime.js"
40
+ "import": "./dist/runtime.js"
39
41
  },
40
42
  "./package.json": "./package.json"
41
43
  },
@@ -47,14 +49,16 @@
47
49
  "zod": "4.4.3"
48
50
  },
49
51
  "devDependencies": {
50
- "@astrale-os/sdk": "0.5.0-beta.96",
52
+ "@astrale-os/ox": "0.1.3",
53
+ "@astrale-os/sdk": "0.5.0-beta.106",
51
54
  "@astrale/typescript-config": "npm:@jsr/astrale__typescript-config@~1.1.3",
52
55
  "@types/node": "^22.0.0",
56
+ "oxlint": "1.78.0",
53
57
  "typescript": "7.0.2",
54
58
  "vitest": "4.1.10"
55
59
  },
56
60
  "peerDependencies": {
57
- "@astrale-os/sdk": ">=0.5.0-beta.96 <1.0.0"
61
+ "@astrale-os/sdk": ">=0.5.0-beta.106 <1.0.0"
58
62
  },
59
63
  "devEngines": {
60
64
  "runtime": {
@@ -68,8 +72,10 @@
68
72
  },
69
73
  "scripts": {
70
74
  "prebuild": "pnpm clean",
71
- "build": "tsc --project tsconfig.package.json --paths null && node scripts/verify-platform-package.mjs",
75
+ "build": "tsc --project tsconfig.package.json --paths null && node ../scripts/package/normalize-domain-declarations.mjs && node ../scripts/package/verify-domain-platform.mjs",
72
76
  "clean": "rm -rf dist",
77
+ "lint": "astrale-domain lint",
78
+ "lint:fix": "astrale-domain lint --fix",
73
79
  "typecheck": "tsc --noEmit --paths null && tsc --noEmit -p tsconfig.test.json",
74
80
  "test": "NODE_PATH=$PWD/node_modules vitest run --config vitest.config.ts",
75
81
  "test:file": "NODE_PATH=$PWD/node_modules vitest run --config vitest.config.ts"
@@ -1 +0,0 @@
1
- export * from './user/index.js';
@@ -1 +0,0 @@
1
- export * from './user/index.js';
@@ -1 +0,0 @@
1
- export { resolveHomeAction } from './resolve-home.js';
@@ -1 +0,0 @@
1
- export { resolveHomeAction } from './resolve-home.js';
@@ -1 +0,0 @@
1
- export { application, default } from '../application.js';
@@ -1 +0,0 @@
1
- export { application, default } from '../application.js';
@@ -1 +0,0 @@
1
- export { default } from '../runtime.js';
@@ -1 +0,0 @@
1
- export { default } from '../runtime.js';
@@ -1,8 +0,0 @@
1
- import { K, nodeClass } from '@astrale-os/sdk/schema';
2
- import { groupAssignUser, groupUnassignUser } from './methods.js';
3
- const config = {
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
- };
8
- export const Group = nodeClass(config);
@@ -1,10 +0,0 @@
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
- };
@@ -1,14 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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';
@@ -1,6 +0,0 @@
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';
@@ -1,13 +0,0 @@
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: Record<string, never>;
7
- }, "authorized", false, "default">>;
8
- export declare const groupUnassignUser: builder.Method<builder.CallableProjection<{
9
- user: string;
10
- }, {
11
- readonly mode: 'value';
12
- readonly value: Record<string, never>;
13
- }, "authorized", false, "default">>;
@@ -1 +0,0 @@
1
- export { homeView } from './view.js';
@@ -1 +0,0 @@
1
- export { homeView } from './view.js';
@@ -1 +0,0 @@
1
- export { setupAdmin, setupMember } from './functions.js';
@@ -1 +0,0 @@
1
- export { setupAdmin, setupMember } from './functions.js';
@@ -1,12 +0,0 @@
1
- import { K, nodeClass } from '@astrale-os/sdk/schema';
2
- import { spaceAddUser, spaceRemoveUser, spaceSetDefault } from './methods.js';
3
- const config = {
4
- description: 'A named Shell collaboration boundary.',
5
- extends: [K.classes.Named, K.classes.Descriptable],
6
- methods: {
7
- addUser: spaceAddUser,
8
- removeUser: spaceRemoveUser,
9
- setDefault: spaceSetDefault,
10
- },
11
- };
12
- export const Space = nodeClass(config);
@@ -1,15 +0,0 @@
1
- import { K, core } from '@astrale-os/sdk/schema';
2
- import { adminGroup, memberGroup } from '#schema/group';
3
- import { Space } from './class.js';
4
- import { member_of_space, owns_space } from './relationships.js';
5
- export const defaultSpace = core.node(Space, {
6
- [K.classes.Named.self.properties.name.key]: 'Default Space',
7
- [K.classes.Descriptable.self.properties.description.key]: 'The common Space installed with Shell.',
8
- });
9
- export const spaceCore = {
10
- nodes: { 'default-space': defaultSpace },
11
- edges: [
12
- core.edge(adminGroup, owns_space, defaultSpace, {}),
13
- core.edge(memberGroup, member_of_space, defaultSpace, {}),
14
- ],
15
- };
@@ -1,6 +0,0 @@
1
- export { Space } from './class.js';
2
- export { defaultSpace, spaceCore } from './core.js';
3
- export { spaceAddUser, spaceRemoveUser, spaceSetDefault } from './methods.js';
4
- export { belongsToSpace, mayAdministerSpace, ownsSpace } from './policies.js';
5
- export { administers_space, default_space, member_of_space, owns_space } from './relationships.js';
6
- export { spaceView } from './view.js';
@@ -1,6 +0,0 @@
1
- export { Space } from './class.js';
2
- export { defaultSpace, spaceCore } from './core.js';
3
- export { spaceAddUser, spaceRemoveUser, spaceSetDefault } from './methods.js';
4
- export { belongsToSpace, mayAdministerSpace, ownsSpace } from './policies.js';
5
- export { administers_space, default_space, member_of_space, owns_space } from './relationships.js';
6
- export { spaceView } from './view.js';
@@ -1,18 +0,0 @@
1
- import { type builder } from '@astrale-os/sdk/schema';
2
- export declare const spaceAddUser: builder.Method<builder.CallableProjection<{
3
- user: string;
4
- access: "admin" | "member";
5
- }, {
6
- readonly mode: 'value';
7
- readonly value: Record<string, never>;
8
- }, "authorized", false, "default">>;
9
- export declare const spaceRemoveUser: builder.Method<builder.CallableProjection<{
10
- user: string;
11
- }, {
12
- readonly mode: 'value';
13
- readonly value: Record<string, never>;
14
- }, "authorized", false, "default">>;
15
- export declare const spaceSetDefault: builder.Method<builder.CallableProjection<Record<string, never>, {
16
- readonly mode: 'value';
17
- readonly value: Record<string, never>;
18
- }, "authorized", false, "default">>;
@@ -1,28 +0,0 @@
1
- import { method, path } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { User } from '#schema/user';
4
- import { belongsToSpace, mayAdministerSpace } from './policies.js';
5
- const emptyObject = z.strictObject({});
6
- const administerPolicy = ({ check, self }) => check(mayAdministerSpace, self);
7
- const membershipPolicy = ({ check, self }) => check(belongsToSpace, self);
8
- export const spaceAddUser = method({
9
- description: 'Set one User direct member or admin access.',
10
- input: z.strictObject({ user: path(User), access: z.enum(['member', 'admin']) }),
11
- output: emptyObject,
12
- auth: 'authorized',
13
- policy: administerPolicy,
14
- });
15
- export const spaceRemoveUser = method({
16
- description: 'Remove one User direct access.',
17
- input: z.strictObject({ user: path(User) }),
18
- output: emptyObject,
19
- auth: 'authorized',
20
- policy: administerPolicy,
21
- });
22
- export const spaceSetDefault = method({
23
- description: 'Set this accessible Space as the granted User fallback.',
24
- input: emptyObject,
25
- output: emptyObject,
26
- auth: 'authorized',
27
- policy: membershipPolicy,
28
- });
@@ -1,4 +0,0 @@
1
- import type { builder } from '@astrale-os/sdk/schema';
2
- export declare const ownsSpace: builder.Policy;
3
- export declare const mayAdministerSpace: builder.Policy;
4
- export declare const belongsToSpace: builder.Policy;
@@ -1,21 +0,0 @@
1
- import { policy } from '@astrale-os/sdk/schema';
2
- import { Group, member_of_group } from '#schema/group';
3
- import { administers_space, member_of_space, owns_space } from './relationships.js';
4
- export const ownsSpace = policy({
5
- description: 'The effective User Grant directly or transitively owns this Space.',
6
- match: ({ allOf, anyOf, edge, exists, object, subject }) => anyOf(edge({ source: subject, class: owns_space, target: object }), groupSpaceBranch({ allOf, edge, exists, object, subject }, owns_space)),
7
- });
8
- export const mayAdministerSpace = policy({
9
- description: 'The effective User Grant directly or transitively administers this Space.',
10
- match: ({ allOf, anyOf, edge, exists, object, subject }) => anyOf(edge({ source: subject, class: owns_space, target: object }), edge({ source: subject, class: administers_space, target: object }), groupSpaceBranch({ allOf, edge, exists, object, subject }, owns_space), groupSpaceBranch({ allOf, edge, exists, object, subject }, administers_space)),
11
- });
12
- export const belongsToSpace = policy({
13
- description: 'The effective User Grant has direct or Group-derived access to this Space.',
14
- match: ({ allOf, anyOf, edge, exists, object, subject }) => anyOf(edge({ source: subject, class: owns_space, target: object }), edge({ source: subject, class: administers_space, target: object }), edge({ source: subject, class: member_of_space, target: object }), groupSpaceBranch({ allOf, edge, exists, object, subject }, owns_space), groupSpaceBranch({ allOf, edge, exists, object, subject }, administers_space), groupSpaceBranch({ allOf, edge, exists, object, subject }, member_of_space)),
15
- });
16
- function groupSpaceBranch(context, access) {
17
- return context.exists(({ node }) => {
18
- const group = node(Group);
19
- return context.allOf(context.edge({ source: context.subject, class: member_of_group, target: group }), context.edge({ source: group, class: access, target: context.object }));
20
- });
21
- }
@@ -1,64 +0,0 @@
1
- export declare const owns_space: 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: "owner";
8
- readonly outgoing: "0..*";
9
- };
10
- readonly target: {
11
- readonly as: "space";
12
- readonly incoming: "1";
13
- };
14
- readonly constraints: Record<never, never>;
15
- readonly effectiveProperties: never;
16
- }>;
17
- export declare const administers_space: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
18
- readonly depth: 0;
19
- readonly abstract: false;
20
- readonly extends: readonly [];
21
- readonly properties: never;
22
- readonly source: {
23
- readonly as: "admin";
24
- readonly outgoing: "0..*";
25
- };
26
- readonly target: {
27
- readonly as: "space";
28
- readonly incoming: "0..*";
29
- };
30
- readonly constraints: Record<never, never>;
31
- readonly effectiveProperties: never;
32
- }>;
33
- export declare const member_of_space: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
34
- readonly depth: 0;
35
- readonly abstract: false;
36
- readonly extends: readonly [];
37
- readonly properties: never;
38
- readonly source: {
39
- readonly as: "member";
40
- readonly outgoing: "0..*";
41
- };
42
- readonly target: {
43
- readonly as: "space";
44
- readonly incoming: "0..*";
45
- };
46
- readonly constraints: Record<never, never>;
47
- readonly effectiveProperties: never;
48
- }>;
49
- export declare const default_space: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
50
- readonly depth: 0;
51
- readonly abstract: false;
52
- readonly extends: readonly [];
53
- readonly properties: never;
54
- readonly source: {
55
- readonly as: "user";
56
- readonly outgoing: "0..1";
57
- };
58
- readonly target: {
59
- readonly as: "space";
60
- readonly incoming: "0..*";
61
- };
62
- readonly constraints: Record<never, never>;
63
- readonly effectiveProperties: never;
64
- }>;
@@ -1,24 +0,0 @@
1
- import { edgeClass } from '@astrale-os/sdk/schema';
2
- import { Group } from '#schema/group';
3
- import { User } from '#schema/user';
4
- import { Space } from './class.js';
5
- export const owns_space = edgeClass.directed({
6
- source: { as: 'owner', accepts: [User, Group], outgoing: '0..*' },
7
- target: { as: 'space', accepts: [() => Space], incoming: '1' },
8
- description: 'The unique owner of a Space.',
9
- });
10
- export const administers_space = edgeClass.directed({
11
- source: { as: 'admin', accepts: [User, Group], outgoing: '0..*' },
12
- target: { as: 'space', accepts: [() => Space], incoming: '0..*' },
13
- description: 'Direct Space administration.',
14
- });
15
- export const member_of_space = edgeClass.directed({
16
- source: { as: 'member', accepts: [User, Group], outgoing: '0..*' },
17
- target: { as: 'space', accepts: [() => Space], incoming: '0..*' },
18
- description: 'Direct Space membership.',
19
- });
20
- export const default_space = edgeClass.directed({
21
- source: { as: 'user', accepts: [User], outgoing: '0..1' },
22
- target: { as: 'space', accepts: [() => Space], incoming: '0..*' },
23
- description: 'One User persisted fallback Space.',
24
- });
@@ -1,11 +0,0 @@
1
- import { K, nodeClass, property } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { resolveHome } from './methods.js';
4
- const displayName = property(z.string().min(1).max(160), { required: false });
5
- const config = {
6
- description: 'One externally identified person using Shell.',
7
- extends: [K.classes.Identity],
8
- properties: { displayName },
9
- methods: { resolveHome },
10
- };
11
- export const User = nodeClass(config);
@@ -1,3 +0,0 @@
1
- export { User } from './class.js';
2
- export { resolveHome } from './methods.js';
3
- export { userView } from './view.js';
@@ -1,3 +0,0 @@
1
- export { User } from './class.js';
2
- export { resolveHome } from './methods.js';
3
- export { userView } from './view.js';
@@ -1,3 +0,0 @@
1
- export * from '#workflows/group';
2
- export * from '#workflows/setup';
3
- export * from '#workflows/space';
@@ -1,3 +0,0 @@
1
- export * from '#workflows/group';
2
- export * from '#workflows/setup';
3
- export * from '#workflows/space';
@@ -1,18 +0,0 @@
1
- import type { Node } from '@astrale-os/sdk/graph/node';
2
- import type { UserRepair } from '#mutations/user';
3
- import type { UserSetupObservation } from '#queries/user';
4
- import type { SetupUserInput, Shell } from '#schema';
5
- export type SetupRole = 'member' | 'admin';
6
- export type SetupPlan = {
7
- readonly kind: 'conflict';
8
- readonly reason: SetupConflictReason;
9
- readonly message: string;
10
- } | {
11
- readonly kind: 'unchanged';
12
- readonly personalSpaceId: Node['id'];
13
- } | {
14
- readonly kind: 'repair';
15
- readonly repair: UserRepair;
16
- };
17
- export type SetupConflictReason = 'IDENTITY_CLASS_CONFLICT' | 'IDENTITY_FACT_CONFLICT' | 'MULTIPLE_DEFAULT_SPACES' | 'DEFAULT_SPACE_CLASS_CONFLICT' | 'AMBIGUOUS_PERSONAL_SPACE';
18
- export declare function planUserSetup(domain: Shell, input: SetupUserInput, role: SetupRole, observation: UserSetupObservation): SetupPlan;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes