@astrale-domains/shell 0.1.5 → 0.1.7

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 (301) hide show
  1. package/README.md +73 -173
  2. package/dist/domain.d.ts +477 -31
  3. package/dist/domain.js +87 -78
  4. package/dist/functions/application/index.js +2 -1
  5. package/dist/functions/application/legacy/index.js +1 -0
  6. package/dist/functions/application/legacy/list-entrypoints.js +8 -0
  7. package/dist/functions/authority/capabilities.js +1 -0
  8. package/dist/functions/authority/composition.js +47 -0
  9. package/dist/functions/authority/index.js +2 -0
  10. package/dist/functions/authority/roles.js +98 -0
  11. package/dist/functions/directory/disconnect-directory.js +35 -0
  12. package/dist/functions/directory/index.js +1 -0
  13. package/dist/functions/group/change-group-membership.js +43 -9
  14. package/dist/functions/group/create-group.js +23 -0
  15. package/dist/functions/group/delete-group.js +33 -0
  16. package/dist/functions/group/deprovision-group.js +27 -0
  17. package/dist/functions/group/group-errors.js +43 -0
  18. package/dist/functions/group/group-membership-errors.js +2 -0
  19. package/dist/functions/group/group.js +51 -0
  20. package/dist/functions/group/index.js +8 -2
  21. package/dist/functions/group/legacy/index.js +1 -0
  22. package/dist/functions/group/legacy/membership.js +60 -0
  23. package/dist/functions/group/membership-laws.js +40 -0
  24. package/dist/functions/group/provision-group.js +33 -0
  25. package/dist/functions/group/update-group.js +55 -0
  26. package/dist/functions/invitation/index.js +2 -0
  27. package/dist/functions/invitation/invitation-errors.js +13 -0
  28. package/dist/functions/invitation/invitation-methods.js +41 -0
  29. package/dist/functions/invitation/send-invitation.js +81 -0
  30. package/dist/functions/user/account.js +35 -0
  31. package/dist/functions/user/create-user.js +45 -0
  32. package/dist/functions/user/deactivate-user.js +19 -0
  33. package/dist/functions/user/delete-user.js +34 -0
  34. package/dist/functions/user/deprovision-user.js +21 -0
  35. package/dist/functions/user/index.js +15 -1
  36. package/dist/functions/user/invite-errors.js +18 -0
  37. package/dist/functions/user/invite-user.js +42 -34
  38. package/dist/functions/user/legacy/claimed-account.js +11 -0
  39. package/dist/functions/user/legacy/index.js +4 -0
  40. package/dist/functions/user/legacy/invite.js +20 -0
  41. package/dist/functions/user/legacy/migrate-accounts.js +98 -0
  42. package/dist/functions/user/legacy/record-profile.js +19 -0
  43. package/dist/functions/user/protect-administrators.js +16 -0
  44. package/dist/functions/user/provision-user.js +70 -0
  45. package/dist/functions/user/reactivate-user.js +19 -0
  46. package/dist/functions/user/read-account.js +12 -0
  47. package/dist/functions/user/request-invitation.js +17 -0
  48. package/dist/functions/user/update-profile.js +22 -0
  49. package/dist/functions/user/update-user.js +68 -0
  50. package/dist/functions/user/user-errors.js +69 -0
  51. package/dist/functions/user/write-account.js +57 -0
  52. package/dist/functions/view-access/index.js +2 -1
  53. package/dist/functions/view-access/{assign-views.js → legacy/assign-views.js} +11 -7
  54. package/dist/functions/view-access/legacy/index.js +1 -0
  55. package/dist/functions/view-access/{view-access-errors.js → legacy/view-access-errors.js} +5 -1
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index.js +3 -1
  58. package/dist/integrations/user-invitation/invite-user-request.d.ts +6 -0
  59. package/dist/legacy/index.js +1 -0
  60. package/dist/legacy/release.js +33 -0
  61. package/dist/mutations/composition/grant-role.js +13 -0
  62. package/dist/mutations/composition/index.js +1 -0
  63. package/dist/mutations/group/legacy/index.js +1 -0
  64. package/dist/mutations/group/legacy/membership-class.js +7 -0
  65. package/dist/mutations/group/set-group-membership.js +23 -14
  66. package/dist/mutations/identity/create-profile.js +37 -0
  67. package/dist/mutations/identity/delete-identity.js +28 -0
  68. package/dist/mutations/identity/index.js +4 -0
  69. package/dist/mutations/identity/write-account.js +109 -0
  70. package/dist/mutations/identity/write-group.js +72 -0
  71. package/dist/mutations/invitation/index.js +1 -0
  72. package/dist/mutations/invitation/write-invitation.js +62 -0
  73. package/dist/mutations/user/legacy/index.js +1 -0
  74. package/dist/mutations/user/{record-user-profile.js → legacy/record-user-profile.js} +5 -2
  75. package/dist/providers/admin-enrollment/create-admin-enrollment-provider.js +6 -3
  76. package/dist/providers/admin-enrollment/legacy/index.js +1 -0
  77. package/dist/providers/admin-enrollment/legacy/send-without-profile.js +16 -0
  78. package/dist/queries/application/legacy/index.js +1 -0
  79. package/dist/queries/application/legacy/read-installed-entrypoints.js +47 -0
  80. package/dist/queries/composition/index.js +2 -0
  81. package/dist/queries/composition/read-extensions.js +34 -0
  82. package/dist/queries/composition/read-role-nodes.js +41 -0
  83. package/dist/queries/group/index.js +1 -1
  84. package/dist/queries/group/legacy/index.js +2 -0
  85. package/dist/queries/group/legacy/read-core-groups.js +46 -0
  86. package/dist/queries/group/legacy/read-member-of-group.js +24 -0
  87. package/dist/queries/group/read-group-membership-endpoints.js +11 -0
  88. package/dist/queries/group/read-group-membership.js +6 -21
  89. package/dist/queries/identity/index.js +1 -0
  90. package/dist/queries/identity/read-identities.js +29 -0
  91. package/dist/queries/invitation/index.js +1 -0
  92. package/dist/queries/invitation/read-invitation.js +25 -0
  93. package/dist/queries/profile/index.js +1 -0
  94. package/dist/queries/profile/read-profile.js +15 -0
  95. package/dist/queries/role/index.js +1 -0
  96. package/dist/queries/role/read-role-node.js +13 -0
  97. package/dist/queries/user/legacy/index.js +1 -0
  98. package/dist/queries/user/legacy/read-user-profile.js +27 -0
  99. package/dist/runtime.d.ts +18203 -630
  100. package/dist/runtime.js +32 -7
  101. package/dist/schema/index.d.ts +7 -4
  102. package/dist/schema/index.js +8 -4
  103. package/dist/schema/legacy/index.js +1 -0
  104. package/dist/schema/legacy/schema.js +32 -0
  105. package/dist/schema/modules/application/legacy/entrypoint-entry.js +11 -0
  106. package/dist/schema/modules/application/legacy/functions/index.js +1 -0
  107. package/dist/schema/modules/application/legacy/functions/list-entrypoints.js +21 -0
  108. package/dist/schema/modules/application/legacy/index.js +2 -0
  109. package/dist/schema/modules/directory/functions/disconnect-directory.d.ts +13 -0
  110. package/dist/schema/modules/directory/functions/disconnect-directory.js +15 -0
  111. package/dist/schema/modules/directory/functions/index.d.ts +1 -0
  112. package/dist/schema/modules/directory/functions/index.js +1 -0
  113. package/dist/schema/modules/directory/index.d.ts +1 -0
  114. package/dist/schema/modules/directory/index.js +1 -0
  115. package/dist/schema/modules/group/classes/group-profile-link.d.ts +34 -0
  116. package/dist/schema/modules/group/classes/group-profile-link.js +21 -0
  117. package/dist/schema/modules/group/classes/group-profile.d.ts +15 -0
  118. package/dist/schema/modules/group/classes/group-profile.js +20 -0
  119. package/dist/schema/modules/group/classes/group.d.ts +73 -1
  120. package/dist/schema/modules/group/classes/group.js +28 -7
  121. package/dist/schema/modules/group/classes/index.d.ts +2 -1
  122. package/dist/schema/modules/group/classes/index.js +3 -1
  123. package/dist/schema/modules/group/functions/assign-member.js +17 -0
  124. package/dist/schema/modules/group/functions/create-group.js +20 -0
  125. package/dist/schema/modules/group/functions/delete-group.js +12 -0
  126. package/dist/schema/modules/group/functions/deprovision-group.js +14 -0
  127. package/dist/schema/modules/group/functions/index.js +7 -2
  128. package/dist/schema/modules/group/functions/provision-group.js +14 -0
  129. package/dist/schema/modules/group/functions/unassign-member.js +17 -0
  130. package/dist/schema/modules/group/functions/update-group.js +20 -0
  131. package/dist/schema/modules/group/index.d.ts +3 -3
  132. package/dist/schema/modules/group/index.js +4 -3
  133. package/dist/schema/modules/group/legacy/admission.d.ts +9 -0
  134. package/dist/schema/modules/group/legacy/admission.js +9 -0
  135. package/dist/schema/modules/group/legacy/classes/index.d.ts +1 -0
  136. package/dist/schema/modules/group/legacy/classes/index.js +1 -0
  137. package/dist/schema/modules/group/{classes → legacy/classes}/member-of-group.d.ts +10 -1
  138. package/dist/schema/modules/group/legacy/classes/member-of-group.js +32 -0
  139. package/dist/schema/modules/group/legacy/core-groups.d.ts +22 -0
  140. package/dist/schema/modules/group/legacy/core-groups.js +28 -0
  141. package/dist/schema/modules/group/legacy/index.d.ts +5 -0
  142. package/dist/schema/modules/group/legacy/index.js +6 -0
  143. package/dist/schema/modules/group/legacy/policies/belongs-to-group.d.ts +5 -0
  144. package/dist/schema/modules/group/legacy/policies/belongs-to-group.js +9 -0
  145. package/dist/schema/modules/group/legacy/policies/index.d.ts +2 -0
  146. package/dist/schema/modules/group/legacy/policies/index.js +2 -0
  147. package/dist/schema/modules/group/legacy/policies/owns-membership-group.d.ts +6 -0
  148. package/dist/schema/modules/group/legacy/policies/owns-membership-group.js +12 -0
  149. package/dist/schema/modules/group/legacy/relaxations.d.ts +21 -0
  150. package/dist/schema/modules/group/legacy/relaxations.js +27 -0
  151. package/dist/schema/modules/group/policies/describes-group-of-subject.d.ts +2 -0
  152. package/dist/schema/modules/group/policies/describes-group-of-subject.js +7 -0
  153. package/dist/schema/modules/group/policies/index.d.ts +2 -1
  154. package/dist/schema/modules/group/policies/index.js +2 -1
  155. package/dist/schema/modules/group/policies/is-group-profile-source.d.ts +2 -0
  156. package/dist/schema/modules/group/policies/is-group-profile-source.js +6 -0
  157. package/dist/schema/modules/group/types/group.js +10 -0
  158. package/dist/schema/modules/group/types/index.js +1 -0
  159. package/dist/schema/modules/invitation/classes/index.js +2 -0
  160. package/dist/schema/modules/invitation/classes/invitation-user.js +17 -0
  161. package/dist/schema/modules/invitation/classes/invitation.js +30 -0
  162. package/dist/schema/modules/invitation/functions/accept.js +16 -0
  163. package/dist/schema/modules/invitation/functions/cancel.js +12 -0
  164. package/dist/schema/modules/invitation/functions/index.js +4 -0
  165. package/dist/schema/modules/invitation/functions/resend.js +12 -0
  166. package/dist/schema/modules/invitation/functions/send.js +20 -0
  167. package/dist/schema/modules/invitation/index.js +2 -0
  168. package/dist/schema/modules/invitation/types/index.js +1 -0
  169. package/dist/schema/modules/invitation/types/invitation-status.js +5 -0
  170. package/dist/schema/modules/namespace/classes/alias.d.ts +2 -1
  171. package/dist/schema/modules/namespace/classes/alias.js +11 -2
  172. package/dist/schema/modules/namespace/functions/link.js +3 -2
  173. package/dist/schema/modules/namespace/functions/rename.js +3 -2
  174. package/dist/schema/modules/namespace/functions/unlink.js +3 -2
  175. package/dist/schema/modules/role/classes/index.d.ts +1 -0
  176. package/dist/schema/modules/role/classes/index.js +1 -0
  177. package/dist/schema/modules/role/classes/role.d.ts +16 -0
  178. package/dist/schema/modules/role/classes/role.js +19 -0
  179. package/dist/schema/modules/role/core/index.d.ts +1 -0
  180. package/dist/schema/modules/role/core/index.js +1 -0
  181. package/dist/schema/modules/role/core/roles.d.ts +37 -0
  182. package/dist/schema/modules/role/core/roles.js +30 -0
  183. package/dist/schema/modules/role/index.d.ts +2 -0
  184. package/dist/schema/modules/role/index.js +2 -0
  185. package/dist/schema/modules/user/classes/index.d.ts +2 -0
  186. package/dist/schema/modules/user/classes/index.js +3 -0
  187. package/dist/schema/modules/user/classes/user-profile-link.d.ts +35 -0
  188. package/dist/schema/modules/user/classes/user-profile-link.js +22 -0
  189. package/dist/schema/modules/user/classes/user-profile.d.ts +41 -0
  190. package/dist/schema/modules/user/classes/user-profile.js +30 -0
  191. package/dist/schema/modules/user/classes/user.d.ts +133 -8
  192. package/dist/schema/modules/user/classes/user.js +46 -15
  193. package/dist/schema/modules/user/functions/create-user.js +21 -0
  194. package/dist/schema/modules/user/functions/deactivate-user.js +12 -0
  195. package/dist/schema/modules/user/functions/delete-user.js +12 -0
  196. package/dist/schema/modules/user/functions/deprovision-user.js +14 -0
  197. package/dist/schema/modules/user/functions/index.js +8 -1
  198. package/dist/schema/modules/user/functions/invite-user.js +23 -4
  199. package/dist/schema/modules/user/functions/provision-user.js +25 -0
  200. package/dist/schema/modules/user/functions/reactivate-user.js +12 -0
  201. package/dist/schema/modules/user/functions/update-profile.js +16 -0
  202. package/dist/schema/modules/user/functions/update-user.js +22 -0
  203. package/dist/schema/modules/user/index.d.ts +2 -1
  204. package/dist/schema/modules/user/index.js +2 -1
  205. package/dist/schema/modules/user/legacy/account-properties.js +24 -0
  206. package/dist/schema/modules/user/legacy/functions/index.js +2 -0
  207. package/dist/schema/modules/user/legacy/functions/migrate-accounts.js +23 -0
  208. package/dist/schema/modules/user/legacy/functions/record-profile.js +18 -0
  209. package/dist/schema/modules/user/legacy/index.js +5 -0
  210. package/dist/schema/modules/user/legacy/invite.js +15 -0
  211. package/dist/schema/modules/user/legacy/relaxations.js +37 -0
  212. package/dist/schema/modules/user/policies/describes-subject.d.ts +2 -0
  213. package/dist/schema/modules/user/policies/describes-subject.js +7 -0
  214. package/dist/schema/modules/user/policies/index.d.ts +2 -0
  215. package/dist/schema/modules/user/policies/index.js +2 -0
  216. package/dist/schema/modules/user/policies/is-profile-source.d.ts +2 -0
  217. package/dist/schema/modules/user/policies/is-profile-source.js +6 -0
  218. package/dist/schema/modules/user/types/account.d.ts +12 -0
  219. package/dist/schema/modules/user/types/account.js +12 -0
  220. package/dist/schema/modules/user/types/index.d.ts +1 -1
  221. package/dist/schema/modules/user/types/index.js +1 -1
  222. package/dist/schema/modules/view-access/classes/view-access.d.ts +7 -11
  223. package/dist/schema/modules/view-access/classes/view-access.js +17 -12
  224. package/dist/schema/modules/view-access/index.d.ts +1 -2
  225. package/dist/schema/modules/view-access/index.js +1 -2
  226. package/dist/schema/modules/view-access/legacy/functions/assign-views.js +22 -0
  227. package/dist/schema/modules/view-access/legacy/functions/index.js +1 -0
  228. package/dist/schema/modules/view-access/legacy/index.js +2 -0
  229. package/dist/schema/modules/view-access/legacy/view-assignment.js +24 -0
  230. package/dist/schema/modules/view-access/policies/holds-view-access.d.ts +2 -0
  231. package/dist/schema/modules/view-access/policies/holds-view-access.js +5 -0
  232. package/dist/schema/modules/view-access/policies/index.d.ts +1 -0
  233. package/dist/schema/modules/view-access/policies/index.js +1 -0
  234. package/dist/schema/policies/has-role.d.ts +6 -0
  235. package/dist/schema/policies/has-role.js +9 -0
  236. package/dist/schema/policies/index.d.ts +1 -0
  237. package/dist/schema/policies/index.js +1 -4
  238. package/dist/schema/policies/legacy/administers-shell-class.js +21 -0
  239. package/dist/schema/policies/legacy/index.js +4 -0
  240. package/dist/schema/policies/legacy/is-self.js +9 -0
  241. package/dist/schema/policies/legacy/owns-class.js +12 -0
  242. package/dist/schema/policies/legacy/uses-function.js +9 -0
  243. package/dist/schema/schema.d.ts +1849 -118
  244. package/dist/schema/schema.js +35 -15
  245. package/dist/schema/types/attributes.js +15 -0
  246. package/dist/schema/types/index.js +1 -0
  247. package/dist/utils/attributes/attributes.js +12 -0
  248. package/dist/utils/attributes/index.js +1 -0
  249. package/dist/utils/index.js +3 -0
  250. package/dist/utils/same-json/index.js +1 -0
  251. package/dist/utils/same-json/same-json.js +9 -0
  252. package/package.json +4 -4
  253. package/dist/functions/application/list-entrypoints.js +0 -6
  254. package/dist/functions/user/record-profile.js +0 -18
  255. package/dist/mutations/user/index.js +0 -1
  256. package/dist/queries/application/index.js +0 -1
  257. package/dist/queries/application/read-installed-entrypoints.js +0 -28
  258. package/dist/queries/user/index.js +0 -1
  259. package/dist/queries/user/read-user-profile.js +0 -9
  260. package/dist/schema/modules/application/functions/index.d.ts +0 -1
  261. package/dist/schema/modules/application/functions/index.js +0 -1
  262. package/dist/schema/modules/application/functions/list-entrypoints.d.ts +0 -15
  263. package/dist/schema/modules/application/functions/list-entrypoints.js +0 -16
  264. package/dist/schema/modules/application/index.d.ts +0 -2
  265. package/dist/schema/modules/application/index.js +0 -2
  266. package/dist/schema/modules/application/types/entrypoint-entry.d.ts +0 -8
  267. package/dist/schema/modules/application/types/entrypoint-entry.js +0 -7
  268. package/dist/schema/modules/application/types/index.d.ts +0 -1
  269. package/dist/schema/modules/application/types/index.js +0 -1
  270. package/dist/schema/modules/group/classes/member-of-group.js +0 -12
  271. package/dist/schema/modules/group/core/administrators-group.d.ts +0 -1
  272. package/dist/schema/modules/group/core/administrators-group.js +0 -6
  273. package/dist/schema/modules/group/core/applications-group.d.ts +0 -1
  274. package/dist/schema/modules/group/core/applications-group.js +0 -6
  275. package/dist/schema/modules/group/core/index.d.ts +0 -3
  276. package/dist/schema/modules/group/core/index.js +0 -3
  277. package/dist/schema/modules/group/core/members-group.d.ts +0 -1
  278. package/dist/schema/modules/group/core/members-group.js +0 -6
  279. package/dist/schema/modules/group/functions/assign-member-to-group.js +0 -11
  280. package/dist/schema/modules/group/functions/unassign-member-from-group.js +0 -11
  281. package/dist/schema/modules/group/policies/belongs-to-group.d.ts +0 -1
  282. package/dist/schema/modules/group/policies/belongs-to-group.js +0 -5
  283. package/dist/schema/modules/user/functions/record-profile.js +0 -14
  284. package/dist/schema/modules/user/types/user-profile.d.ts +0 -7
  285. package/dist/schema/modules/user/types/user-profile.js +0 -7
  286. package/dist/schema/modules/view-access/core/index.d.ts +0 -1
  287. package/dist/schema/modules/view-access/core/index.js +0 -1
  288. package/dist/schema/modules/view-access/core/view-only-group.d.ts +0 -5
  289. package/dist/schema/modules/view-access/core/view-only-group.js +0 -10
  290. package/dist/schema/modules/view-access/functions/assign-views.d.ts +0 -16
  291. package/dist/schema/modules/view-access/functions/assign-views.js +0 -17
  292. package/dist/schema/modules/view-access/functions/index.d.ts +0 -1
  293. package/dist/schema/modules/view-access/functions/index.js +0 -1
  294. package/dist/schema/modules/view-access/types/index.js +0 -1
  295. package/dist/schema/modules/view-access/types/view-assignment.js +0 -16
  296. package/dist/schema/policies/administers-shell-class.js +0 -11
  297. package/dist/schema/policies/is-self.js +0 -5
  298. package/dist/schema/policies/owns-class.js +0 -7
  299. package/dist/schema/policies/uses-function.js +0 -5
  300. /package/dist/functions/group/{assign-member-to-group.js → assign-member.js} +0 -0
  301. /package/dist/functions/group/{unassign-member-from-group.js → unassign-member.js} +0 -0
@@ -0,0 +1,9 @@
1
+ import { legacyOwnsClass } from '../../../policies/legacy/index.js';
2
+ /**
3
+ * @deprecated The owner of a Group subclass changes the members of its own groups (L-SHELL-9).
4
+ * Replaced by `group.writer`, or by the Domain's own Identity and Roles (P5, P6). Removal: Shell
5
+ * major (delivery step 5) after 1Pact step 4.
6
+ */
7
+ export function legacyMembershipOwnerAdmission(context, group) {
8
+ return context.check(legacyOwnsClass, group);
9
+ }
@@ -0,0 +1 @@
1
+ export { legacyMemberOfGroup } from './member-of-group.js';
@@ -0,0 +1 @@
1
+ export { legacyMemberOfGroup } from './member-of-group.js';
@@ -1,4 +1,13 @@
1
- export declare const member_of_group: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
1
+ /**
2
+ * @deprecated The direct membership fact legacy readers check beside Kernel `extends_with`
3
+ * (L-SHELL-8). Replaced by `extends_with`, the only composition. Removal: Shell major (delivery
4
+ * step 5) after 1Pact step 4.
5
+ *
6
+ * Shell writes it; the owner of a foreign Group subclass writes it too, under its own authority,
7
+ * when Shell acts for it (AM5). Each end detaches with its Node, so deleting an account or a group
8
+ * takes its legacy memberships with it.
9
+ */
10
+ export declare const legacyMemberOfGroup: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
2
11
  readonly depth: 0;
3
12
  readonly abstract: false;
4
13
  readonly extends: readonly [];
@@ -0,0 +1,32 @@
1
+ import { edgeClass } from '@astrale-os/sdk/schema';
2
+ import { User } from '../../../user/index.js';
3
+ import { Group } from '../../classes/group.js';
4
+ import { legacyOwnsMembershipGroup } from '../policies/owns-membership-group.js';
5
+ /**
6
+ * @deprecated The direct membership fact legacy readers check beside Kernel `extends_with`
7
+ * (L-SHELL-8). Replaced by `extends_with`, the only composition. Removal: Shell major (delivery
8
+ * step 5) after 1Pact step 4.
9
+ *
10
+ * Shell writes it; the owner of a foreign Group subclass writes it too, under its own authority,
11
+ * when Shell acts for it (AM5). Each end detaches with its Node, so deleting an account or a group
12
+ * takes its legacy memberships with it.
13
+ */
14
+ export const legacyMemberOfGroup = edgeClass.directed({
15
+ policies: {
16
+ read: true,
17
+ create: () => legacyOwnsMembershipGroup,
18
+ delete: () => legacyOwnsMembershipGroup,
19
+ },
20
+ source: {
21
+ as: 'member',
22
+ accepts: [() => User, () => Group],
23
+ outgoing: '0..*',
24
+ onDelete: 'detach',
25
+ },
26
+ target: {
27
+ as: 'group',
28
+ accepts: [() => Group],
29
+ incoming: '0..*',
30
+ onDelete: 'detach',
31
+ },
32
+ });
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @deprecated Core group `admin` "Administrators" (L-SHELL-7); its Core key and properties stay so
3
+ * stored members keep it, and the release makes it a member of `workspace.admin` (AM3). Replaced by
4
+ * `S.core.nodes['workspace.admin']`. Removal: Shell major (delivery step 5) after 1Pact step 4.
5
+ */
6
+ export declare const legacyAdministratorsGroup: import("@astrale-os/sdk/schema").CoreNode;
7
+ /**
8
+ * @deprecated Core group `member` "Members" (L-SHELL-7), member of `workspace.member` (AM3). Replaced
9
+ * by `S.core.nodes['workspace.member']`. Removal: Shell major (delivery step 5) after 1Pact step 4.
10
+ */
11
+ export declare const legacyMembersGroup: import("@astrale-os/sdk/schema").CoreNode;
12
+ /**
13
+ * @deprecated Core group `applications` (L-SHELL-7), member of Kernel `reader` (AM3) and admitted by
14
+ * `listEntrypoints`. Replaced by the Roles each Domain's release grants. Removal: Shell major (delivery step 5) after 1Pact step 4.
15
+ */
16
+ export declare const legacyApplicationsGroup: import("@astrale-os/sdk/schema").CoreNode;
17
+ /**
18
+ * @deprecated Core group `view-only` (L-SHELL-7), member of Kernel `reader` (AM3); its non-admin
19
+ * members keep landing on their Views only. Replaced by Kernel `reader` held directly and
20
+ * `view_access`. Removal: Shell major (delivery step 5) after 1Pact step 4.
21
+ */
22
+ export declare const legacyViewOnlyGroup: import("@astrale-os/sdk/schema").CoreNode;
@@ -0,0 +1,28 @@
1
+ import { K, core } from '@astrale-os/sdk/schema';
2
+ import { Group } from '../classes/group.js';
3
+ const group = (name, description) => core.node(() => Group, {
4
+ [K.classes.Named.properties.name.key]: name,
5
+ [K.classes.Descriptable.properties.description.key]: description,
6
+ });
7
+ /**
8
+ * @deprecated Core group `admin` "Administrators" (L-SHELL-7); its Core key and properties stay so
9
+ * stored members keep it, and the release makes it a member of `workspace.admin` (AM3). Replaced by
10
+ * `S.core.nodes['workspace.admin']`. Removal: Shell major (delivery step 5) after 1Pact step 4.
11
+ */
12
+ export const legacyAdministratorsGroup = group('Administrators', 'Instance administrators.');
13
+ /**
14
+ * @deprecated Core group `member` "Members" (L-SHELL-7), member of `workspace.member` (AM3). Replaced
15
+ * by `S.core.nodes['workspace.member']`. Removal: Shell major (delivery step 5) after 1Pact step 4.
16
+ */
17
+ export const legacyMembersGroup = group('Members', 'Instance members.');
18
+ /**
19
+ * @deprecated Core group `applications` (L-SHELL-7), member of Kernel `reader` (AM3) and admitted by
20
+ * `listEntrypoints`. Replaced by the Roles each Domain's release grants. Removal: Shell major (delivery step 5) after 1Pact step 4.
21
+ */
22
+ export const legacyApplicationsGroup = group('Applications', 'May list the installed applications they can open.');
23
+ /**
24
+ * @deprecated Core group `view-only` (L-SHELL-7), member of Kernel `reader` (AM3); its non-admin
25
+ * members keep landing on their Views only. Replaced by Kernel `reader` held directly and
26
+ * `view_access`. Removal: Shell major (delivery step 5) after 1Pact step 4.
27
+ */
28
+ export const legacyViewOnlyGroup = group('View only', 'Open only the Views given to them, never the workspace.');
@@ -0,0 +1,5 @@
1
+ export { LEGACY_GROUP_EXTENDS, LEGACY_GROUP_INHERITANCE, LEGACY_GROUP_READ } from './relaxations.js';
2
+ export { legacyMembershipOwnerAdmission } from './admission.js';
3
+ export { legacyAdministratorsGroup, legacyApplicationsGroup, legacyMembersGroup, legacyViewOnlyGroup, } from './core-groups.js';
4
+ export { legacyMemberOfGroup } from './classes/index.js';
5
+ export { legacyBelongsToGroup, legacyOwnsMembershipGroup } from './policies/index.js';
@@ -0,0 +1,6 @@
1
+ // Relaxations first: Group reads them while the rest of this folder may still be loading.
2
+ export { LEGACY_GROUP_EXTENDS, LEGACY_GROUP_INHERITANCE, LEGACY_GROUP_READ } from './relaxations.js';
3
+ export { legacyMembershipOwnerAdmission } from './admission.js';
4
+ export { legacyAdministratorsGroup, legacyApplicationsGroup, legacyMembersGroup, legacyViewOnlyGroup, } from './core-groups.js';
5
+ export { legacyMemberOfGroup } from './classes/index.js';
6
+ export { legacyBelongsToGroup, legacyOwnsMembershipGroup } from './policies/index.js';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @deprecated The subject is a direct legacy member of the object group (L-SHELL-10). Replaced by
3
+ * `check(hasRole, …)` on a Role. Removal: Shell major (delivery step 5) after 1Pact step 4.
4
+ */
5
+ export declare const legacyBelongsToGroup: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,9 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { legacyMemberOfGroup } from '../classes/member-of-group.js';
3
+ /**
4
+ * @deprecated The subject is a direct legacy member of the object group (L-SHELL-10). Replaced by
5
+ * `check(hasRole, …)` on a Role. Removal: Shell major (delivery step 5) after 1Pact step 4.
6
+ */
7
+ export const legacyBelongsToGroup = policy({
8
+ match: ({ edge, subject, object }) => edge({ source: subject, class: () => legacyMemberOfGroup, target: object }),
9
+ });
@@ -0,0 +1,2 @@
1
+ export { legacyBelongsToGroup } from './belongs-to-group.js';
2
+ export { legacyOwnsMembershipGroup } from './owns-membership-group.js';
@@ -0,0 +1,2 @@
1
+ export { legacyBelongsToGroup } from './belongs-to-group.js';
2
+ export { legacyOwnsMembershipGroup } from './owns-membership-group.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @deprecated The subject owns the concrete Class of a legacy membership's group: the Domain that
3
+ * extends Group writes `member_of_group` into its own groups, under AM5 (L-SHELL-9). Replaced by
4
+ * `extends_with` alone. Removal: Shell major (delivery step 5) after 1Pact step 4.
5
+ */
6
+ export declare const legacyOwnsMembershipGroup: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,12 @@
1
+ import { K, policy } from '@astrale-os/sdk/schema';
2
+ /**
3
+ * @deprecated The subject owns the concrete Class of a legacy membership's group: the Domain that
4
+ * extends Group writes `member_of_group` into its own groups, under AM5 (L-SHELL-9). Replaced by
5
+ * `extends_with` alone. Removal: Shell major (delivery step 5) after 1Pact step 4.
6
+ */
7
+ export const legacyOwnsMembershipGroup = policy({
8
+ match: ({ exists, subject, target, allOf }) => exists(({ node }) => {
9
+ const concrete = node();
10
+ return allOf({ source: target, class: K.classes.instance_of.ref, target: concrete }, { source: concrete, class: K.classes.of_domain.ref, target: subject });
11
+ }),
12
+ });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @deprecated Domains still extend Group (L-SHELL-1). Replaced by `'final'`. Removal: Shell major
3
+ * (delivery step 5) after 1Pact step 4.
4
+ */
5
+ export declare const LEGACY_GROUP_INHERITANCE: 'open';
6
+ /**
7
+ * @deprecated Group omits Kernel Timestamped while stored groups lack its required `createdAt` and
8
+ * `updatedAt`, which the Kernel refuses to add over existing data (DATA_MIGRATION_REQUIRED)
9
+ * (L-SHELL-2). Replaced by `[K.classes.Identity, K.classes.Named, K.classes.Descriptable,
10
+ * K.classes.Iconable, K.classes.Timestamped]`. Removal: Shell major (delivery step 5) after 1Pact
11
+ * step 4, in the Kernel repair session that writes those values.
12
+ */
13
+ export declare const LEGACY_GROUP_EXTENDS: readonly [import("@astrale-os/sdk/schema").KernelClass<"Identity">, import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Descriptable">, import("@astrale-os/sdk/schema").KernelClass<"Iconable">];
14
+ /**
15
+ * @deprecated Group keeps the read rule and the absence of unique constraints of the Shell that
16
+ * released Domains embed (L-SHELL-19), as User does. A directory group stays unique through the
17
+ * lookup of `Group.provision`. Replaced by `read: anyOf(group.reader, self)` and
18
+ * `unique: [['directory', 'externalId']]`. Removal: Shell major (delivery step 5), once immogrc,
19
+ * 1Pact and organization are rebuilt against this Shell.
20
+ */
21
+ export declare const LEGACY_GROUP_READ: true;
@@ -0,0 +1,27 @@
1
+ import { K } from '@astrale-os/sdk/schema';
2
+ /**
3
+ * @deprecated Domains still extend Group (L-SHELL-1). Replaced by `'final'`. Removal: Shell major
4
+ * (delivery step 5) after 1Pact step 4.
5
+ */
6
+ export const LEGACY_GROUP_INHERITANCE = 'open';
7
+ /**
8
+ * @deprecated Group omits Kernel Timestamped while stored groups lack its required `createdAt` and
9
+ * `updatedAt`, which the Kernel refuses to add over existing data (DATA_MIGRATION_REQUIRED)
10
+ * (L-SHELL-2). Replaced by `[K.classes.Identity, K.classes.Named, K.classes.Descriptable,
11
+ * K.classes.Iconable, K.classes.Timestamped]`. Removal: Shell major (delivery step 5) after 1Pact
12
+ * step 4, in the Kernel repair session that writes those values.
13
+ */
14
+ export const LEGACY_GROUP_EXTENDS = [
15
+ K.classes.Identity,
16
+ K.classes.Named,
17
+ K.classes.Descriptable,
18
+ K.classes.Iconable,
19
+ ];
20
+ /**
21
+ * @deprecated Group keeps the read rule and the absence of unique constraints of the Shell that
22
+ * released Domains embed (L-SHELL-19), as User does. A directory group stays unique through the
23
+ * lookup of `Group.provision`. Replaced by `read: anyOf(group.reader, self)` and
24
+ * `unique: [['directory', 'externalId']]`. Removal: Shell major (delivery step 5), once immogrc,
25
+ * 1Pact and organization are rebuilt against this Shell.
26
+ */
27
+ export const LEGACY_GROUP_READ = true;
@@ -0,0 +1,2 @@
1
+ /** The subject is the group this profile describes, or one of its members (its composition). */
2
+ export declare const describesGroupOfSubject: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,7 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { group_profile } from '../classes/group-profile-link.js';
3
+ /** The subject is the group this profile describes, or one of its members (its composition). */
4
+ export const describesGroupOfSubject = policy({
5
+ description: 'The caller is the group this profile describes, or a member of it.',
6
+ match: ({ edge, object, subject }) => edge({ source: subject, class: group_profile, target: object }),
7
+ });
@@ -1 +1,2 @@
1
- export { belongsToGroup } from './belongs-to-group.js';
1
+ export { describesGroupOfSubject } from './describes-group-of-subject.js';
2
+ export { isGroupProfileSource } from './is-group-profile-source.js';
@@ -1 +1,2 @@
1
- export { belongsToGroup } from './belongs-to-group.js';
1
+ export { describesGroupOfSubject } from './describes-group-of-subject.js';
2
+ export { isGroupProfileSource } from './is-group-profile-source.js';
@@ -0,0 +1,2 @@
1
+ /** The subject is the group at the source of this Edge, or one of its members. */
2
+ export declare const isGroupProfileSource: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,6 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ /** The subject is the group at the source of this Edge, or one of its members. */
3
+ export const isGroupProfileSource = policy({
4
+ description: 'The caller is the group this Edge leaves, or a member of it.',
5
+ match: ({ sameNode, subject, source }) => sameNode(subject, source),
6
+ });
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ /** A group's name and description, as Kernel Named and Descriptable bound them. */
3
+ export const groupName = z.string().min(1).max(100);
4
+ export const groupDescription = z.string().min(1).max(2_000);
5
+ /** A Kernel Iconable icon; `null` removes it. */
6
+ export const groupIcon = z.string().min(1).max(8_000).nullable();
7
+ export const directoryId = z.string().min(1).max(200);
8
+ export const externalId = z.string().min(1).max(200);
9
+ /** A Node as a method returns it: its canonical `@<NodeId>` path. */
10
+ export const nodeReference = z.string().min(2).max(512);
@@ -1 +1,2 @@
1
1
  export { groupMembershipInput } from './group-membership-input.js';
2
+ export { directoryId, externalId, groupDescription, groupIcon, groupName, nodeReference, } from './group.js';
@@ -0,0 +1,2 @@
1
+ export { Invitation } from './invitation.js';
2
+ export { invitation_user } from './invitation-user.js';
@@ -0,0 +1,17 @@
1
+ import { edgeClass } from '@astrale-os/sdk/schema';
2
+ import { atomicRoles } from '../../role/index.js';
3
+ import { User } from '../../user/index.js';
4
+ import { hasRole } from '../../../policies/index.js';
5
+ import { Invitation } from './invitation.js';
6
+ /** The account an invitation is for. */
7
+ export const invitation_user = edgeClass.directed({
8
+ inheritance: 'final',
9
+ abstract: false,
10
+ description: 'The account this invitation is for.',
11
+ source: { as: 'invitation', accepts: [Invitation], outgoing: '0..1', onDelete: 'detach' },
12
+ target: { as: 'user', accepts: [User], incoming: '0..*', onDelete: 'detach' },
13
+ policies: {
14
+ read: ({ check, ref }) => check(hasRole, ref(atomicRoles['user.writer'])),
15
+ traverse: true,
16
+ },
17
+ });
@@ -0,0 +1,30 @@
1
+ import { classIcon, nodeClass, property } from '@astrale-os/sdk/schema';
2
+ import { Mail } from '@astrale-os/sdk/schema/icons';
3
+ import { atomicRoles } from '../../role/index.js';
4
+ import { hasRole } from '../../../policies/index.js';
5
+ import { accept, cancel, resend, send } from '../functions/index.js';
6
+ import { INVITATION_STATUSES } from '../types/index.js';
7
+ /**
8
+ * One invitation of an account, kept by the durable run of `Invitation.send` that it names. The
9
+ * email stays on the account's profile. Only Shell writes it; `user.writer` reads it, so the pending
10
+ * invitations are one Query on `status`.
11
+ */
12
+ export const Invitation = nodeClass({
13
+ icon: classIcon.lucide(Mail),
14
+ inheritance: 'final',
15
+ abstract: false,
16
+ description: 'One invitation of an account, until it is accepted, cancelled or expired.',
17
+ properties: {
18
+ status: property({ type: 'string', enum: [...INVITATION_STATUSES] }),
19
+ // ISO 8601 instant the invitation expires at.
20
+ expiresAt: property({ type: 'string', minLength: 20, maxLength: 40 }),
21
+ // The durable run that keeps it, and the number of events it has received (resends).
22
+ execution: property({ type: 'string', minLength: 1, maxLength: 200 }),
23
+ round: property({ type: 'integer', minimum: 0 }),
24
+ },
25
+ policies: {
26
+ read: ({ check, ref }) => check(hasRole, ref(atomicRoles['user.writer'])),
27
+ traverse: true,
28
+ },
29
+ methods: { send, resend, cancel, accept },
30
+ });
@@ -0,0 +1,16 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { atomicRoles } from '../../role/index.js';
4
+ import { hasRole } from '../../../policies/index.js';
5
+ /**
6
+ * The invited person signed in for the first time, with the email the invitation was sent to: the
7
+ * run binds the account to that sign-in (`iss`, `sub`) and accepts the invitation. Admin calls it
8
+ * once it checked the provider's verified email.
9
+ */
10
+ export const accept = method({
11
+ description: 'Accept a pending invitation at the first sign-in.',
12
+ auth: 'authorized',
13
+ input: z.strictObject({ iss: z.string().min(1).max(512), sub: z.string().min(1).max(512) }),
14
+ output: z.object({}),
15
+ policy: ({ check, ref }) => check(hasRole, ref(atomicRoles['user.writer'])),
16
+ });
@@ -0,0 +1,12 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { atomicRoles } from '../../role/index.js';
4
+ import { hasRole } from '../../../policies/index.js';
5
+ /** Cancel a pending invitation. */
6
+ export const cancel = method({
7
+ description: 'Cancel a pending invitation.',
8
+ auth: 'authorized',
9
+ input: z.strictObject({}),
10
+ output: z.object({}),
11
+ policy: ({ check, ref }) => check(hasRole, ref(atomicRoles['user.writer'])),
12
+ });
@@ -0,0 +1,4 @@
1
+ export { accept } from './accept.js';
2
+ export { cancel } from './cancel.js';
3
+ export { resend } from './resend.js';
4
+ export { send } from './send.js';
@@ -0,0 +1,12 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { atomicRoles } from '../../role/index.js';
4
+ import { hasRole } from '../../../policies/index.js';
5
+ /** Send the email of a pending invitation again: same invitation, same link, same run. */
6
+ export const resend = method({
7
+ description: 'Send the email of a pending invitation again.',
8
+ auth: 'authorized',
9
+ input: z.strictObject({}),
10
+ output: z.object({}),
11
+ policy: ({ check, ref }) => check(hasRole, ref(atomicRoles['user.writer'])),
12
+ });
@@ -0,0 +1,20 @@
1
+ import { method, path } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { atomicRoles } from '../../role/index.js';
4
+ import { User } from '../../user/index.js';
5
+ import { hasRole } from '../../../policies/index.js';
6
+ import { invitationStatus } from '../types/index.js';
7
+ /**
8
+ * Invite an account: a durable run that records the invitation, has Admin send the email, then
9
+ * waits for the first sign-in, a resend, a cancel or the expiry. It grants nothing. The caller
10
+ * follows the run; the invitation reads at once by its account.
11
+ */
12
+ export const send = method({
13
+ static: true,
14
+ description: 'Invite an account and follow the invitation until it ends.',
15
+ auth: 'authorized',
16
+ execution: { durable: true },
17
+ input: z.strictObject({ user: path(() => User) }),
18
+ output: z.object({ status: invitationStatus }),
19
+ policy: ({ check, ref }) => check(hasRole, ref(atomicRoles['user.writer'])),
20
+ });
@@ -0,0 +1,2 @@
1
+ export { Invitation, invitation_user } from './classes/index.js';
2
+ export { INVITATION_STATUSES, invitationStatus } from './types/index.js';
@@ -0,0 +1 @@
1
+ export { INVITATION_STATUSES, invitationStatus } from './invitation-status.js';
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ /** The states of an invitation. */
3
+ export const INVITATION_STATUSES = ['pending', 'accepted', 'cancelled', 'expired'];
4
+ /** One state of an invitation. */
5
+ export const invitationStatus = z.enum(INVITATION_STATUSES);
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * One name in a Namespace: the Edge slug is the name, the target any Node. The Kernel key keeps a
3
3
  * name to one Node for every author; Edge identity keeps a Node to one alias per Namespace. The
4
- * target accepts a Class Shell does not own, so the alias detaches with its Node.
4
+ * target accepts a Class Shell does not own, so the alias detaches with its Node. An admin names
5
+ * Nodes through the Namespace methods or a Mutation of its own.
5
6
  */
6
7
  export declare const alias: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
7
8
  readonly depth: 0;
@@ -1,12 +1,21 @@
1
1
  import { K, edgeClass } from '@astrale-os/sdk/schema';
2
+ import { profileRoles } from '../../role/index.js';
3
+ import { hasRole } from '../../../policies/index.js';
2
4
  import { Namespace } from './namespace.js';
3
5
  /**
4
6
  * One name in a Namespace: the Edge slug is the name, the target any Node. The Kernel key keeps a
5
7
  * name to one Node for every author; Edge identity keeps a Node to one alias per Namespace. The
6
- * target accepts a Class Shell does not own, so the alias detaches with its Node.
8
+ * target accepts a Class Shell does not own, so the alias detaches with its Node. An admin names
9
+ * Nodes through the Namespace methods or a Mutation of its own.
7
10
  */
8
11
  export const alias = edgeClass.directed({
9
- policies: { read: true, traverse: true },
12
+ policies: {
13
+ read: true,
14
+ traverse: true,
15
+ create: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
16
+ update: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
17
+ delete: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
18
+ },
10
19
  source: { as: 'namespace', accepts: [() => Namespace], outgoing: '0..*' },
11
20
  target: { as: 'node', accepts: [K.classes.Node], incoming: '0..*' },
12
21
  unique: [['source', 'slug']],
@@ -1,11 +1,12 @@
1
1
  import { K, method, path } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
- import { ownsClass, administersShellClass } from '../../../policies/index.js';
3
+ import { profileRoles } from '../../role/index.js';
4
+ import { hasRole } from '../../../policies/index.js';
4
5
  import { namespaceName } from '../types/index.js';
5
6
  export const link = method({
6
7
  description: 'Give one Node an alias in this Namespace.',
7
8
  auth: 'authorized',
8
9
  input: z.strictObject({ name: namespaceName, target: path(K.classes.Node) }),
9
10
  output: z.object({}),
10
- policy: ({ anyOf, check, self }) => anyOf(check(administersShellClass, self), check(ownsClass, self)),
11
+ policy: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
11
12
  });
@@ -1,11 +1,12 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
- import { ownsClass, administersShellClass } from '../../../policies/index.js';
3
+ import { profileRoles } from '../../role/index.js';
4
+ import { hasRole } from '../../../policies/index.js';
4
5
  import { namespaceName } from '../types/index.js';
5
6
  export const rename = method({
6
7
  description: 'Rename one alias of this Namespace; the Node it names stays the same.',
7
8
  auth: 'authorized',
8
9
  input: z.strictObject({ name: namespaceName, to: namespaceName }),
9
10
  output: z.object({}),
10
- policy: ({ anyOf, check, self }) => anyOf(check(administersShellClass, self), check(ownsClass, self)),
11
+ policy: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
11
12
  });
@@ -1,11 +1,12 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
- import { ownsClass, administersShellClass } from '../../../policies/index.js';
3
+ import { profileRoles } from '../../role/index.js';
4
+ import { hasRole } from '../../../policies/index.js';
4
5
  import { namespaceName } from '../types/index.js';
5
6
  export const unlink = method({
6
7
  description: 'Remove one alias from this Namespace.',
7
8
  auth: 'authorized',
8
9
  input: z.strictObject({ name: namespaceName }),
9
10
  output: z.object({}),
10
- policy: ({ anyOf, check, self }) => anyOf(check(administersShellClass, self), check(ownsClass, self)),
11
+ policy: ({ check, ref }) => check(hasRole, ref(profileRoles['workspace.admin'])),
11
12
  });
@@ -0,0 +1 @@
1
+ export { Role } from './role.js';
@@ -0,0 +1 @@
1
+ export { Role } from './role.js';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * A Role the Shell declares: its members hold what it holds, at any depth (Kernel `extends_with`).
3
+ * Owning this final Class gives Shell the grant and withdrawal of its Roles; a Role reads by Kernel
4
+ * `authority.reader` and by its holders (R7), and any Path walks through it.
5
+ */
6
+ export declare const Role: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
7
+ readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
8
+ readonly inheritance: "final";
9
+ readonly abstract: false;
10
+ readonly description: "A Role the Shell declares.";
11
+ readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Role">];
12
+ readonly policies: {
13
+ readonly read: ({ anyOf, check, ref, self }: import("@astrale-os/sdk/schema").ClassRuleContext) => import("@astrale-os/sdk/schema").PolicyCheckExpression<import("@astrale-os/sdk/schema").PolicyRef, import("@astrale-os/sdk/schema").ClassRuleObject>;
14
+ readonly traverse: true;
15
+ };
16
+ }>;
@@ -0,0 +1,19 @@
1
+ import { K, classIcon, nodeClass } from '@astrale-os/sdk/schema';
2
+ import { ShieldCheck } from '@astrale-os/sdk/schema/icons';
3
+ import { hasRole } from '../../../policies/index.js';
4
+ /**
5
+ * A Role the Shell declares: its members hold what it holds, at any depth (Kernel `extends_with`).
6
+ * Owning this final Class gives Shell the grant and withdrawal of its Roles; a Role reads by Kernel
7
+ * `authority.reader` and by its holders (R7), and any Path walks through it.
8
+ */
9
+ export const Role = nodeClass({
10
+ icon: classIcon.lucide(ShieldCheck),
11
+ inheritance: 'final',
12
+ abstract: false,
13
+ description: 'A Role the Shell declares.',
14
+ extends: [K.classes.Role],
15
+ policies: {
16
+ read: ({ anyOf, check, ref, self }) => anyOf(check(hasRole, ref(K.core.nodes['authority.reader'].ref)), check(hasRole, self)),
17
+ traverse: true,
18
+ },
19
+ });
@@ -0,0 +1 @@
1
+ export { atomicRoles, profileRoles, shellRoles, PROFILE_NAMES, type ProfileName } from './roles.js';
@@ -0,0 +1 @@
1
+ export { atomicRoles, profileRoles, shellRoles, PROFILE_NAMES } from './roles.js';
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The two profiles a person is given. Their Core keys carry `workspace.` because the keys `admin` and
3
+ * `member` already name the legacy Administrators and Members groups, and the Kernel recreates a
4
+ * Core Node whose Class changes (AM3). Their bundle, member ⊂ admin, is a release binding (AM1): see
5
+ * `domain.ts`. There is no guest profile (AM10): whoever only opens the Views it is given holds
6
+ * Kernel `reader` and its `view_access`.
7
+ */
8
+ export declare const profileRoles: {
9
+ readonly 'workspace.member': import("@astrale-os/sdk/schema").CoreNode;
10
+ readonly 'workspace.admin': import("@astrale-os/sdk/schema").CoreNode;
11
+ };
12
+ /** The atomic Shell Roles: what a Domain asks for in its release. */
13
+ export declare const atomicRoles: {
14
+ readonly 'user.reader': import("@astrale-os/sdk/schema").CoreNode;
15
+ readonly 'user.writer': import("@astrale-os/sdk/schema").CoreNode;
16
+ readonly 'group.reader': import("@astrale-os/sdk/schema").CoreNode;
17
+ readonly 'group.writer': import("@astrale-os/sdk/schema").CoreNode;
18
+ readonly 'directory.provisioner': import("@astrale-os/sdk/schema").CoreNode;
19
+ readonly 'user-profile.reader': import("@astrale-os/sdk/schema").CoreNode;
20
+ readonly 'user-profile.self-writer': import("@astrale-os/sdk/schema").CoreNode;
21
+ readonly 'group-profile.reader': import("@astrale-os/sdk/schema").CoreNode;
22
+ };
23
+ export declare const shellRoles: {
24
+ readonly 'workspace.member': import("@astrale-os/sdk/schema").CoreNode;
25
+ readonly 'workspace.admin': import("@astrale-os/sdk/schema").CoreNode;
26
+ readonly 'user.reader': import("@astrale-os/sdk/schema").CoreNode;
27
+ readonly 'user.writer': import("@astrale-os/sdk/schema").CoreNode;
28
+ readonly 'group.reader': import("@astrale-os/sdk/schema").CoreNode;
29
+ readonly 'group.writer': import("@astrale-os/sdk/schema").CoreNode;
30
+ readonly 'directory.provisioner': import("@astrale-os/sdk/schema").CoreNode;
31
+ readonly 'user-profile.reader': import("@astrale-os/sdk/schema").CoreNode;
32
+ readonly 'user-profile.self-writer': import("@astrale-os/sdk/schema").CoreNode;
33
+ readonly 'group-profile.reader': import("@astrale-os/sdk/schema").CoreNode;
34
+ };
35
+ /** The profile a person is given, by its name. */
36
+ export type ProfileName = 'member' | 'admin';
37
+ export declare const PROFILE_NAMES: readonly ["member", "admin"];