@astrale-domains/shell 0.1.0-beta.4 → 0.1.0-beta.40

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 (513) hide show
  1. package/README.md +143 -64
  2. package/dist/domain.d.ts +99 -0
  3. package/dist/domain.js +77 -0
  4. package/dist/functions/application/index.js +1 -3
  5. package/dist/functions/application/list-entrypoints.js +4 -0
  6. package/dist/functions/group/assign-member-to-group.js +4 -0
  7. package/dist/functions/group/change-group-membership.js +34 -0
  8. package/dist/functions/group/group-membership-errors.js +23 -0
  9. package/dist/functions/group/index.js +2 -3
  10. package/dist/functions/group/unassign-member-from-group.js +4 -0
  11. package/dist/functions/user/index.js +1 -3
  12. package/dist/functions/user/invite-user.js +39 -0
  13. package/dist/index.d.ts +1 -4
  14. package/dist/index.js +1 -4
  15. package/dist/integrations/index.d.ts +1 -0
  16. package/dist/integrations/index.js +1 -0
  17. package/dist/integrations/integrations.d.ts +9 -0
  18. package/dist/integrations/integrations.js +2 -0
  19. package/dist/integrations/user-invitation/index.d.ts +4 -0
  20. package/dist/integrations/user-invitation/index.js +3 -0
  21. package/dist/integrations/user-invitation/invitation-request-failure.d.ts +5 -0
  22. package/dist/integrations/user-invitation/invitation-request-failure.js +9 -0
  23. package/dist/integrations/user-invitation/invite-user-request.d.ts +6 -0
  24. package/dist/integrations/user-invitation/invite-user-request.js +1 -0
  25. package/dist/integrations/user-invitation/request-user-invitation.d.ts +8 -0
  26. package/dist/integrations/user-invitation/request-user-invitation.js +9 -0
  27. package/dist/mutations/group/index.js +1 -2
  28. package/dist/mutations/group/set-group-membership.js +29 -0
  29. package/dist/providers/admin-enrollment/create-admin-enrollment-provider.js +78 -0
  30. package/dist/providers/admin-enrollment/decode-admin-invitation-response.js +20 -0
  31. package/dist/providers/admin-enrollment/index.js +1 -0
  32. package/dist/providers/admin-enrollment/read-enrollment-response.js +34 -0
  33. package/dist/queries/application/index.js +1 -3
  34. package/dist/queries/application/read-installed-entrypoints.js +44 -0
  35. package/dist/queries/group/index.js +2 -3
  36. package/dist/queries/group/read-group-membership-endpoints.js +18 -0
  37. package/dist/queries/group/read-group-membership.js +35 -0
  38. package/dist/runtime.d.ts +462 -0
  39. package/dist/runtime.js +16 -0
  40. package/dist/schema/index.d.ts +5 -7
  41. package/dist/schema/index.js +4 -7
  42. package/dist/schema/modules/application/functions/index.d.ts +1 -0
  43. package/dist/schema/modules/application/functions/index.js +1 -0
  44. package/dist/schema/modules/application/functions/list-entrypoints.d.ts +15 -0
  45. package/dist/schema/modules/application/functions/list-entrypoints.js +16 -0
  46. package/dist/schema/modules/application/index.d.ts +2 -0
  47. package/dist/schema/modules/application/index.js +2 -0
  48. package/dist/schema/modules/application/types/entrypoint-entry.d.ts +8 -0
  49. package/dist/schema/modules/application/types/entrypoint-entry.js +7 -0
  50. package/dist/schema/modules/application/types/index.d.ts +1 -0
  51. package/dist/schema/modules/application/types/index.js +1 -0
  52. package/dist/schema/modules/group/classes/group.d.ts +20 -0
  53. package/dist/schema/modules/group/classes/group.js +8 -0
  54. package/dist/schema/modules/group/classes/index.d.ts +2 -0
  55. package/dist/schema/modules/group/classes/index.js +2 -0
  56. package/dist/schema/modules/group/classes/member-of-group.d.ts +16 -0
  57. package/dist/schema/modules/group/classes/member-of-group.js +11 -0
  58. package/dist/schema/modules/group/core/administrators-group.d.ts +1 -0
  59. package/dist/schema/modules/group/core/administrators-group.js +6 -0
  60. package/dist/schema/modules/group/core/applications-group.d.ts +1 -0
  61. package/dist/schema/modules/group/core/applications-group.js +6 -0
  62. package/dist/schema/modules/group/core/index.d.ts +3 -0
  63. package/dist/schema/modules/group/core/index.js +3 -0
  64. package/dist/schema/modules/group/core/members-group.d.ts +1 -0
  65. package/dist/schema/modules/group/core/members-group.js +6 -0
  66. package/dist/schema/modules/group/functions/assign-member-to-group.js +11 -0
  67. package/dist/schema/modules/group/functions/index.js +2 -0
  68. package/dist/schema/modules/group/functions/unassign-member-from-group.js +11 -0
  69. package/dist/schema/modules/group/index.d.ts +3 -0
  70. package/dist/schema/modules/group/index.js +3 -0
  71. package/dist/schema/modules/group/policies/belongs-to-group.d.ts +1 -0
  72. package/dist/schema/modules/group/policies/belongs-to-group.js +5 -0
  73. package/dist/schema/modules/group/policies/index.d.ts +1 -0
  74. package/dist/schema/modules/group/policies/index.js +1 -0
  75. package/dist/schema/modules/group/types/group-membership-input.js +8 -0
  76. package/dist/schema/modules/group/types/index.js +1 -0
  77. package/dist/schema/modules/user/classes/index.d.ts +1 -0
  78. package/dist/schema/modules/user/classes/index.js +1 -0
  79. package/dist/schema/modules/user/classes/user.d.ts +21 -0
  80. package/dist/schema/modules/user/classes/user.js +12 -0
  81. package/dist/schema/modules/user/functions/index.js +1 -0
  82. package/dist/schema/modules/user/functions/invite-user.js +12 -0
  83. package/dist/schema/modules/user/index.d.ts +2 -0
  84. package/dist/schema/modules/user/index.js +2 -0
  85. package/dist/schema/modules/user/types/index.d.ts +1 -0
  86. package/dist/schema/modules/user/types/index.js +1 -0
  87. package/dist/schema/modules/user/types/invitation-summary.d.ts +16 -0
  88. package/dist/schema/modules/user/types/invitation-summary.js +15 -0
  89. package/dist/schema/policies/administers-shell-class.js +11 -0
  90. package/dist/schema/policies/index.js +3 -0
  91. package/dist/schema/policies/owns-class.js +7 -0
  92. package/dist/schema/policies/uses-function.js +5 -0
  93. package/dist/schema/schema.d.ts +342 -0
  94. package/dist/schema/schema.js +27 -0
  95. package/dist/schema/views/application-view.js +4 -0
  96. package/dist/schema/views/index.js +1 -0
  97. package/dist/utils/canonical-node-path/index.js +1 -0
  98. package/dist/utils/canonical-node-path/parse-canonical-node-path.js +8 -0
  99. package/package.json +51 -30
  100. package/dist/functions/application/index.d.ts +0 -3
  101. package/dist/functions/application/index.d.ts.map +0 -1
  102. package/dist/functions/application/index.js.map +0 -1
  103. package/dist/functions/application/install.d.ts +0 -4
  104. package/dist/functions/application/install.d.ts.map +0 -1
  105. package/dist/functions/application/install.js +0 -11
  106. package/dist/functions/application/install.js.map +0 -1
  107. package/dist/functions/application/uninstall.d.ts +0 -5
  108. package/dist/functions/application/uninstall.d.ts.map +0 -1
  109. package/dist/functions/application/uninstall.js +0 -11
  110. package/dist/functions/application/uninstall.js.map +0 -1
  111. package/dist/functions/execution/index.d.ts +0 -15
  112. package/dist/functions/execution/index.d.ts.map +0 -1
  113. package/dist/functions/execution/index.js +0 -2
  114. package/dist/functions/execution/index.js.map +0 -1
  115. package/dist/functions/group/assign-user.d.ts +0 -5
  116. package/dist/functions/group/assign-user.d.ts.map +0 -1
  117. package/dist/functions/group/assign-user.js +0 -11
  118. package/dist/functions/group/assign-user.js.map +0 -1
  119. package/dist/functions/group/index.d.ts +0 -3
  120. package/dist/functions/group/index.d.ts.map +0 -1
  121. package/dist/functions/group/index.js.map +0 -1
  122. package/dist/functions/group/unassign-user.d.ts +0 -5
  123. package/dist/functions/group/unassign-user.d.ts.map +0 -1
  124. package/dist/functions/group/unassign-user.js +0 -11
  125. package/dist/functions/group/unassign-user.js.map +0 -1
  126. package/dist/functions/index.d.ts +0 -6
  127. package/dist/functions/index.d.ts.map +0 -1
  128. package/dist/functions/index.js +0 -6
  129. package/dist/functions/index.js.map +0 -1
  130. package/dist/functions/space/add-user.d.ts +0 -5
  131. package/dist/functions/space/add-user.d.ts.map +0 -1
  132. package/dist/functions/space/add-user.js +0 -11
  133. package/dist/functions/space/add-user.js.map +0 -1
  134. package/dist/functions/space/index.d.ts +0 -4
  135. package/dist/functions/space/index.d.ts.map +0 -1
  136. package/dist/functions/space/index.js +0 -4
  137. package/dist/functions/space/index.js.map +0 -1
  138. package/dist/functions/space/remove-user.d.ts +0 -5
  139. package/dist/functions/space/remove-user.d.ts.map +0 -1
  140. package/dist/functions/space/remove-user.js +0 -11
  141. package/dist/functions/space/remove-user.js.map +0 -1
  142. package/dist/functions/space/set-default.d.ts +0 -6
  143. package/dist/functions/space/set-default.d.ts.map +0 -1
  144. package/dist/functions/space/set-default.js +0 -11
  145. package/dist/functions/space/set-default.js.map +0 -1
  146. package/dist/functions/user/administrator.d.ts +0 -4
  147. package/dist/functions/user/administrator.d.ts.map +0 -1
  148. package/dist/functions/user/administrator.js +0 -39
  149. package/dist/functions/user/administrator.js.map +0 -1
  150. package/dist/functions/user/ensure.d.ts +0 -18
  151. package/dist/functions/user/ensure.d.ts.map +0 -1
  152. package/dist/functions/user/ensure.js +0 -49
  153. package/dist/functions/user/ensure.js.map +0 -1
  154. package/dist/functions/user/index.d.ts +0 -3
  155. package/dist/functions/user/index.d.ts.map +0 -1
  156. package/dist/functions/user/index.js.map +0 -1
  157. package/dist/index.d.ts.map +0 -1
  158. package/dist/index.js.map +0 -1
  159. package/dist/mutations/application/association.d.ts +0 -14
  160. package/dist/mutations/application/association.d.ts.map +0 -1
  161. package/dist/mutations/application/association.js +0 -46
  162. package/dist/mutations/application/association.js.map +0 -1
  163. package/dist/mutations/application/errors.d.ts +0 -5
  164. package/dist/mutations/application/errors.d.ts.map +0 -1
  165. package/dist/mutations/application/errors.js +0 -2
  166. package/dist/mutations/application/errors.js.map +0 -1
  167. package/dist/mutations/application/index.d.ts +0 -4
  168. package/dist/mutations/application/index.d.ts.map +0 -1
  169. package/dist/mutations/application/index.js +0 -3
  170. package/dist/mutations/application/index.js.map +0 -1
  171. package/dist/mutations/application/removal.d.ts +0 -6
  172. package/dist/mutations/application/removal.d.ts.map +0 -1
  173. package/dist/mutations/application/removal.js +0 -17
  174. package/dist/mutations/application/removal.js.map +0 -1
  175. package/dist/mutations/group/errors.d.ts +0 -5
  176. package/dist/mutations/group/errors.d.ts.map +0 -1
  177. package/dist/mutations/group/errors.js +0 -2
  178. package/dist/mutations/group/errors.js.map +0 -1
  179. package/dist/mutations/group/index.d.ts +0 -3
  180. package/dist/mutations/group/index.d.ts.map +0 -1
  181. package/dist/mutations/group/index.js.map +0 -1
  182. package/dist/mutations/group/membership.d.ts +0 -26
  183. package/dist/mutations/group/membership.d.ts.map +0 -1
  184. package/dist/mutations/group/membership.js +0 -71
  185. package/dist/mutations/group/membership.js.map +0 -1
  186. package/dist/mutations/index.d.ts +0 -4
  187. package/dist/mutations/index.d.ts.map +0 -1
  188. package/dist/mutations/index.js +0 -4
  189. package/dist/mutations/index.js.map +0 -1
  190. package/dist/mutations/space/access.d.ts +0 -30
  191. package/dist/mutations/space/access.d.ts.map +0 -1
  192. package/dist/mutations/space/access.js +0 -54
  193. package/dist/mutations/space/access.js.map +0 -1
  194. package/dist/mutations/space/default.d.ts +0 -26
  195. package/dist/mutations/space/default.d.ts.map +0 -1
  196. package/dist/mutations/space/default.js +0 -46
  197. package/dist/mutations/space/default.js.map +0 -1
  198. package/dist/mutations/space/errors.d.ts +0 -5
  199. package/dist/mutations/space/errors.d.ts.map +0 -1
  200. package/dist/mutations/space/errors.js +0 -2
  201. package/dist/mutations/space/errors.js.map +0 -1
  202. package/dist/mutations/space/index.d.ts +0 -4
  203. package/dist/mutations/space/index.d.ts.map +0 -1
  204. package/dist/mutations/space/index.js +0 -3
  205. package/dist/mutations/space/index.js.map +0 -1
  206. package/dist/mutations/user/index.d.ts +0 -1
  207. package/dist/mutations/user/index.d.ts.map +0 -1
  208. package/dist/mutations/user/index.js +0 -2
  209. package/dist/mutations/user/index.js.map +0 -1
  210. package/dist/public.d.ts +0 -5
  211. package/dist/public.d.ts.map +0 -1
  212. package/dist/public.js +0 -154
  213. package/dist/public.js.map +0 -1
  214. package/dist/queries/application/association.d.ts +0 -18
  215. package/dist/queries/application/association.d.ts.map +0 -1
  216. package/dist/queries/application/association.js +0 -82
  217. package/dist/queries/application/association.js.map +0 -1
  218. package/dist/queries/application/identity.d.ts +0 -4
  219. package/dist/queries/application/identity.d.ts.map +0 -1
  220. package/dist/queries/application/identity.js +0 -41
  221. package/dist/queries/application/identity.js.map +0 -1
  222. package/dist/queries/application/index.d.ts +0 -3
  223. package/dist/queries/application/index.d.ts.map +0 -1
  224. package/dist/queries/application/index.js.map +0 -1
  225. package/dist/queries/group/identity.d.ts +0 -3
  226. package/dist/queries/group/identity.d.ts.map +0 -1
  227. package/dist/queries/group/identity.js +0 -29
  228. package/dist/queries/group/identity.js.map +0 -1
  229. package/dist/queries/group/index.d.ts +0 -3
  230. package/dist/queries/group/index.d.ts.map +0 -1
  231. package/dist/queries/group/index.js.map +0 -1
  232. package/dist/queries/group/membership.d.ts +0 -17
  233. package/dist/queries/group/membership.d.ts.map +0 -1
  234. package/dist/queries/group/membership.js +0 -47
  235. package/dist/queries/group/membership.js.map +0 -1
  236. package/dist/queries/index.d.ts +0 -4
  237. package/dist/queries/index.d.ts.map +0 -1
  238. package/dist/queries/index.js +0 -4
  239. package/dist/queries/index.js.map +0 -1
  240. package/dist/queries/space/access.d.ts +0 -24
  241. package/dist/queries/space/access.d.ts.map +0 -1
  242. package/dist/queries/space/access.js +0 -93
  243. package/dist/queries/space/access.js.map +0 -1
  244. package/dist/queries/space/default.d.ts +0 -10
  245. package/dist/queries/space/default.d.ts.map +0 -1
  246. package/dist/queries/space/default.js +0 -25
  247. package/dist/queries/space/default.js.map +0 -1
  248. package/dist/queries/space/index.d.ts +0 -3
  249. package/dist/queries/space/index.d.ts.map +0 -1
  250. package/dist/queries/space/index.js +0 -3
  251. package/dist/queries/space/index.js.map +0 -1
  252. package/dist/rules/application/association.d.ts +0 -13
  253. package/dist/rules/application/association.d.ts.map +0 -1
  254. package/dist/rules/application/association.js +0 -10
  255. package/dist/rules/application/association.js.map +0 -1
  256. package/dist/rules/application/index.d.ts +0 -4
  257. package/dist/rules/application/index.d.ts.map +0 -1
  258. package/dist/rules/application/index.js +0 -4
  259. package/dist/rules/application/index.js.map +0 -1
  260. package/dist/rules/application/removal.d.ts +0 -11
  261. package/dist/rules/application/removal.d.ts.map +0 -1
  262. package/dist/rules/application/removal.js +0 -6
  263. package/dist/rules/application/removal.js.map +0 -1
  264. package/dist/rules/application/result.d.ts +0 -8
  265. package/dist/rules/application/result.d.ts.map +0 -1
  266. package/dist/rules/application/result.js +0 -17
  267. package/dist/rules/application/result.js.map +0 -1
  268. package/dist/rules/group/index.d.ts +0 -2
  269. package/dist/rules/group/index.d.ts.map +0 -1
  270. package/dist/rules/group/index.js +0 -2
  271. package/dist/rules/group/index.js.map +0 -1
  272. package/dist/rules/group/membership.d.ts +0 -5
  273. package/dist/rules/group/membership.d.ts.map +0 -1
  274. package/dist/rules/group/membership.js +0 -12
  275. package/dist/rules/group/membership.js.map +0 -1
  276. package/dist/rules/index.d.ts +0 -5
  277. package/dist/rules/index.d.ts.map +0 -1
  278. package/dist/rules/index.js +0 -5
  279. package/dist/rules/index.js.map +0 -1
  280. package/dist/rules/space/access.d.ts +0 -8
  281. package/dist/rules/space/access.d.ts.map +0 -1
  282. package/dist/rules/space/access.js +0 -18
  283. package/dist/rules/space/access.js.map +0 -1
  284. package/dist/rules/space/default.d.ts +0 -4
  285. package/dist/rules/space/default.d.ts.map +0 -1
  286. package/dist/rules/space/default.js +0 -7
  287. package/dist/rules/space/default.js.map +0 -1
  288. package/dist/rules/space/index.d.ts +0 -3
  289. package/dist/rules/space/index.d.ts.map +0 -1
  290. package/dist/rules/space/index.js +0 -3
  291. package/dist/rules/space/index.js.map +0 -1
  292. package/dist/rules/user/ensure.d.ts +0 -21
  293. package/dist/rules/user/ensure.d.ts.map +0 -1
  294. package/dist/rules/user/ensure.js +0 -61
  295. package/dist/rules/user/ensure.js.map +0 -1
  296. package/dist/rules/user/grant.d.ts +0 -13
  297. package/dist/rules/user/grant.d.ts.map +0 -1
  298. package/dist/rules/user/grant.js +0 -12
  299. package/dist/rules/user/grant.js.map +0 -1
  300. package/dist/rules/user/index.d.ts +0 -3
  301. package/dist/rules/user/index.d.ts.map +0 -1
  302. package/dist/rules/user/index.js +0 -3
  303. package/dist/rules/user/index.js.map +0 -1
  304. package/dist/schema/application/class.d.ts +0 -152
  305. package/dist/schema/application/class.d.ts.map +0 -1
  306. package/dist/schema/application/class.js +0 -10
  307. package/dist/schema/application/class.js.map +0 -1
  308. package/dist/schema/application/core.d.ts +0 -159
  309. package/dist/schema/application/core.d.ts.map +0 -1
  310. package/dist/schema/application/core.js +0 -13
  311. package/dist/schema/application/core.js.map +0 -1
  312. package/dist/schema/application/index.d.ts +0 -7
  313. package/dist/schema/application/index.d.ts.map +0 -1
  314. package/dist/schema/application/index.js +0 -7
  315. package/dist/schema/application/index.js.map +0 -1
  316. package/dist/schema/application/methods.d.ts +0 -171
  317. package/dist/schema/application/methods.d.ts.map +0 -1
  318. package/dist/schema/application/methods.js +0 -48
  319. package/dist/schema/application/methods.js.map +0 -1
  320. package/dist/schema/application/policies.d.ts +0 -3
  321. package/dist/schema/application/policies.d.ts.map +0 -1
  322. package/dist/schema/application/policies.js +0 -11
  323. package/dist/schema/application/policies.js.map +0 -1
  324. package/dist/schema/application/relationships.d.ts +0 -795
  325. package/dist/schema/application/relationships.d.ts.map +0 -1
  326. package/dist/schema/application/relationships.js +0 -20
  327. package/dist/schema/application/relationships.js.map +0 -1
  328. package/dist/schema/application/view.d.ts +0 -155
  329. package/dist/schema/application/view.d.ts.map +0 -1
  330. package/dist/schema/application/view.js +0 -7
  331. package/dist/schema/application/view.js.map +0 -1
  332. package/dist/schema/domain/index.d.ts +0 -9363
  333. package/dist/schema/domain/index.d.ts.map +0 -1
  334. package/dist/schema/domain/index.js +0 -56
  335. package/dist/schema/domain/index.js.map +0 -1
  336. package/dist/schema/group/class.d.ts +0 -59
  337. package/dist/schema/group/class.d.ts.map +0 -1
  338. package/dist/schema/group/class.js +0 -11
  339. package/dist/schema/group/class.js.map +0 -1
  340. package/dist/schema/group/core.d.ts +0 -495
  341. package/dist/schema/group/core.d.ts.map +0 -1
  342. package/dist/schema/group/core.js +0 -20
  343. package/dist/schema/group/core.js.map +0 -1
  344. package/dist/schema/group/index.d.ts +0 -7
  345. package/dist/schema/group/index.d.ts.map +0 -1
  346. package/dist/schema/group/index.js +0 -7
  347. package/dist/schema/group/index.js.map +0 -1
  348. package/dist/schema/group/methods.d.ts +0 -48
  349. package/dist/schema/group/methods.d.ts.map +0 -1
  350. package/dist/schema/group/methods.js +0 -21
  351. package/dist/schema/group/methods.js.map +0 -1
  352. package/dist/schema/group/policies.d.ts +0 -3
  353. package/dist/schema/group/policies.d.ts.map +0 -1
  354. package/dist/schema/group/policies.js +0 -7
  355. package/dist/schema/group/policies.js.map +0 -1
  356. package/dist/schema/group/relationships.d.ts +0 -293
  357. package/dist/schema/group/relationships.d.ts.map +0 -1
  358. package/dist/schema/group/relationships.js +0 -20
  359. package/dist/schema/group/relationships.js.map +0 -1
  360. package/dist/schema/group/view.d.ts +0 -62
  361. package/dist/schema/group/view.d.ts.map +0 -1
  362. package/dist/schema/group/view.js +0 -7
  363. package/dist/schema/group/view.js.map +0 -1
  364. package/dist/schema/home/index.d.ts +0 -2
  365. package/dist/schema/home/index.d.ts.map +0 -1
  366. package/dist/schema/home/index.js +0 -2
  367. package/dist/schema/home/index.js.map +0 -1
  368. package/dist/schema/home/view.d.ts +0 -4
  369. package/dist/schema/home/view.d.ts.map +0 -1
  370. package/dist/schema/home/view.js +0 -5
  371. package/dist/schema/home/view.js.map +0 -1
  372. package/dist/schema/index.d.ts.map +0 -1
  373. package/dist/schema/index.js.map +0 -1
  374. package/dist/schema/space/class.d.ts +0 -74
  375. package/dist/schema/space/class.d.ts.map +0 -1
  376. package/dist/schema/space/class.js +0 -15
  377. package/dist/schema/space/class.js.map +0 -1
  378. package/dist/schema/space/core.d.ts +0 -995
  379. package/dist/schema/space/core.d.ts.map +0 -1
  380. package/dist/schema/space/core.js +0 -17
  381. package/dist/schema/space/core.js.map +0 -1
  382. package/dist/schema/space/index.d.ts +0 -7
  383. package/dist/schema/space/index.d.ts.map +0 -1
  384. package/dist/schema/space/index.js +0 -7
  385. package/dist/schema/space/index.js.map +0 -1
  386. package/dist/schema/space/methods.d.ts +0 -78
  387. package/dist/schema/space/methods.d.ts.map +0 -1
  388. package/dist/schema/space/methods.js +0 -31
  389. package/dist/schema/space/methods.js.map +0 -1
  390. package/dist/schema/space/policies.d.ts +0 -5
  391. package/dist/schema/space/policies.d.ts.map +0 -1
  392. package/dist/schema/space/policies.js +0 -15
  393. package/dist/schema/space/policies.js.map +0 -1
  394. package/dist/schema/space/relationships.d.ts +0 -1059
  395. package/dist/schema/space/relationships.d.ts.map +0 -1
  396. package/dist/schema/space/relationships.js +0 -25
  397. package/dist/schema/space/relationships.js.map +0 -1
  398. package/dist/schema/space/view.d.ts +0 -77
  399. package/dist/schema/space/view.d.ts.map +0 -1
  400. package/dist/schema/space/view.js +0 -7
  401. package/dist/schema/space/view.js.map +0 -1
  402. package/dist/schema/user/administrator.d.ts +0 -30
  403. package/dist/schema/user/administrator.d.ts.map +0 -1
  404. package/dist/schema/user/administrator.js +0 -19
  405. package/dist/schema/user/administrator.js.map +0 -1
  406. package/dist/schema/user/class.d.ts +0 -12
  407. package/dist/schema/user/class.d.ts.map +0 -1
  408. package/dist/schema/user/class.js +0 -7
  409. package/dist/schema/user/class.js.map +0 -1
  410. package/dist/schema/user/ensure.d.ts +0 -37
  411. package/dist/schema/user/ensure.d.ts.map +0 -1
  412. package/dist/schema/user/ensure.js +0 -28
  413. package/dist/schema/user/ensure.js.map +0 -1
  414. package/dist/schema/user/index.d.ts +0 -6
  415. package/dist/schema/user/index.d.ts.map +0 -1
  416. package/dist/schema/user/index.js +0 -6
  417. package/dist/schema/user/index.js.map +0 -1
  418. package/dist/schema/user/interface.d.ts +0 -10
  419. package/dist/schema/user/interface.d.ts.map +0 -1
  420. package/dist/schema/user/interface.js +0 -12
  421. package/dist/schema/user/interface.js.map +0 -1
  422. package/dist/schema/user/view.d.ts +0 -15
  423. package/dist/schema/user/view.d.ts.map +0 -1
  424. package/dist/schema/user/view.js +0 -7
  425. package/dist/schema/user/view.js.map +0 -1
  426. package/dist/tests/cross-layer/public.test.d.ts +0 -2
  427. package/dist/tests/cross-layer/public.test.d.ts.map +0 -1
  428. package/dist/tests/cross-layer/public.test.js +0 -70
  429. package/dist/tests/cross-layer/public.test.js.map +0 -1
  430. package/dist/tests/cross-layer/workflows.test.d.ts +0 -2
  431. package/dist/tests/cross-layer/workflows.test.d.ts.map +0 -1
  432. package/dist/tests/cross-layer/workflows.test.js +0 -290
  433. package/dist/tests/cross-layer/workflows.test.js.map +0 -1
  434. package/dist/tests/index.d.ts +0 -3
  435. package/dist/tests/index.d.ts.map +0 -1
  436. package/dist/tests/index.js +0 -3
  437. package/dist/tests/index.js.map +0 -1
  438. package/dist/utils/graph-endpoint/index.d.ts +0 -13
  439. package/dist/utils/graph-endpoint/index.d.ts.map +0 -1
  440. package/dist/utils/graph-endpoint/index.js +0 -6
  441. package/dist/utils/graph-endpoint/index.js.map +0 -1
  442. package/dist/utils/index.d.ts +0 -3
  443. package/dist/utils/index.d.ts.map +0 -1
  444. package/dist/utils/index.js +0 -3
  445. package/dist/utils/index.js.map +0 -1
  446. package/dist/utils/query-page/index.d.ts +0 -3
  447. package/dist/utils/query-page/index.d.ts.map +0 -1
  448. package/dist/utils/query-page/index.js +0 -2
  449. package/dist/utils/query-page/index.js.map +0 -1
  450. package/dist/utils/query-page/nodes.d.ts +0 -16
  451. package/dist/utils/query-page/nodes.d.ts.map +0 -1
  452. package/dist/utils/query-page/nodes.js +0 -22
  453. package/dist/utils/query-page/nodes.js.map +0 -1
  454. package/dist/workflows/application/errors.d.ts +0 -5
  455. package/dist/workflows/application/errors.d.ts.map +0 -1
  456. package/dist/workflows/application/errors.js +0 -25
  457. package/dist/workflows/application/errors.js.map +0 -1
  458. package/dist/workflows/application/index.d.ts +0 -3
  459. package/dist/workflows/application/index.d.ts.map +0 -1
  460. package/dist/workflows/application/index.js +0 -3
  461. package/dist/workflows/application/index.js.map +0 -1
  462. package/dist/workflows/application/install.d.ts +0 -3
  463. package/dist/workflows/application/install.d.ts.map +0 -1
  464. package/dist/workflows/application/install.js +0 -37
  465. package/dist/workflows/application/install.js.map +0 -1
  466. package/dist/workflows/application/uninstall.d.ts +0 -4
  467. package/dist/workflows/application/uninstall.d.ts.map +0 -1
  468. package/dist/workflows/application/uninstall.js +0 -25
  469. package/dist/workflows/application/uninstall.js.map +0 -1
  470. package/dist/workflows/group/assign-user.d.ts +0 -8
  471. package/dist/workflows/group/assign-user.d.ts.map +0 -1
  472. package/dist/workflows/group/assign-user.js +0 -32
  473. package/dist/workflows/group/assign-user.js.map +0 -1
  474. package/dist/workflows/group/ensure-administrator.d.ts +0 -4
  475. package/dist/workflows/group/ensure-administrator.d.ts.map +0 -1
  476. package/dist/workflows/group/ensure-administrator.js +0 -26
  477. package/dist/workflows/group/ensure-administrator.js.map +0 -1
  478. package/dist/workflows/group/errors.d.ts +0 -2
  479. package/dist/workflows/group/errors.d.ts.map +0 -1
  480. package/dist/workflows/group/errors.js +0 -7
  481. package/dist/workflows/group/errors.js.map +0 -1
  482. package/dist/workflows/group/index.d.ts +0 -4
  483. package/dist/workflows/group/index.d.ts.map +0 -1
  484. package/dist/workflows/group/index.js +0 -4
  485. package/dist/workflows/group/index.js.map +0 -1
  486. package/dist/workflows/group/unassign-user.d.ts +0 -8
  487. package/dist/workflows/group/unassign-user.d.ts.map +0 -1
  488. package/dist/workflows/group/unassign-user.js +0 -32
  489. package/dist/workflows/group/unassign-user.js.map +0 -1
  490. package/dist/workflows/index.d.ts +0 -4
  491. package/dist/workflows/index.d.ts.map +0 -1
  492. package/dist/workflows/index.js +0 -4
  493. package/dist/workflows/index.js.map +0 -1
  494. package/dist/workflows/space/add-user.d.ts +0 -8
  495. package/dist/workflows/space/add-user.d.ts.map +0 -1
  496. package/dist/workflows/space/add-user.js +0 -34
  497. package/dist/workflows/space/add-user.js.map +0 -1
  498. package/dist/workflows/space/errors.d.ts +0 -3
  499. package/dist/workflows/space/errors.d.ts.map +0 -1
  500. package/dist/workflows/space/errors.js +0 -10
  501. package/dist/workflows/space/errors.js.map +0 -1
  502. package/dist/workflows/space/index.d.ts +0 -4
  503. package/dist/workflows/space/index.d.ts.map +0 -1
  504. package/dist/workflows/space/index.js +0 -4
  505. package/dist/workflows/space/index.js.map +0 -1
  506. package/dist/workflows/space/remove-user.d.ts +0 -8
  507. package/dist/workflows/space/remove-user.d.ts.map +0 -1
  508. package/dist/workflows/space/remove-user.js +0 -62
  509. package/dist/workflows/space/remove-user.js.map +0 -1
  510. package/dist/workflows/space/set-default.d.ts +0 -9
  511. package/dist/workflows/space/set-default.d.ts.map +0 -1
  512. package/dist/workflows/space/set-default.js +0 -43
  513. package/dist/workflows/space/set-default.js.map +0 -1
package/README.md CHANGED
@@ -1,66 +1,145 @@
1
1
  # Shell Domain
2
2
 
3
- Shell is the minimal Kernel-native application plane. Its durable model is one `User` interface,
4
- the concrete `User`, `Group`, `Space`, and `Application` Node Classes, eight relationships, five
5
- Policies, two Functions, seven Methods, five Kernel View declarations, and four deterministic Core
6
- nodes.
7
-
8
- The `ensureUser` Function is the Shell-owned identity genesis boundary. It idempotently provisions an
9
- externally identified `User`, their personal `Space`, and both ownership/default relationships under
10
- the installed Shell Domain's authority. `ensureAdministrator` idempotently assigns one existing User
11
- to Shell's administrator Group. Both keep product mutation under Shell authority while allowing an
12
- authenticated genesis operator to request the transition.
13
-
14
- The Methods are:
15
-
16
- - Group: `assignUser`, `unassignUser`;
17
- - Space: `addUser`, `removeUser`, `setDefault`; and
18
- - Application: `install`, `uninstall`.
19
-
20
- Installation authors the `admin`, `member`, `default-space`, and `shell` Core. An authenticated genesis
21
- operator may invoke `ensureUser`, but cannot mutate Shell Classes directly. The remote handler performs
22
- the atomic identity provisioning as Shell, then callers assign the User explicitly to a Group. Shell
23
- infers no authority from email, claims, path spelling, or creation order.
24
-
25
- ## Source ownership
26
-
27
- - `schema/` owns the complete Domain contract, public Method values, Policies, relationships, DSL
28
- Views, and Core graph;
29
- - `rules/` owns synchronous classifications, decisions, normalization, and result projection;
30
- - `queries/` owns canonical single and composite graph observations plus explicit bounded continuation
31
- pagination when a business observation requires the complete set;
32
- - `mutations/` owns canonical atomic graph changes and their expected rejection evidence;
33
- - `workflows/` owns replay-shaped multi-step business journeys and unknown-outcome recovery;
34
- - `functions/` binds the Function and each Method to a rule, workflow, or direct operation;
35
- - `utils/` owns only the shared graph-endpoint and bounded-query mechanics used by independent
36
- submodules; and
37
- - root `tests/` owns cross-layer and system evidence, while each semantic submodule owns focused
38
- evidence in `__tests__/`.
39
-
40
- No current responsibility earns a `states/`, `capabilities/`, `integrations/`, `migrations/`,
41
- `views/`, `ui/`, or root `scripts/` source layer. DSL View declarations remain in Schema; a future
42
- frontend projection or UI must establish its own concrete responsibility before adding those layers.
43
-
44
- Shell never re-declares shared metadata properties. `Group` and `Space` currently name `K.Named`
45
- and `K.Descriptable` in their `implements` lists because the current DSL makes only `K.Node`
46
- intrinsic and Core-property admission otherwise rejects `name` and `description`. Removing those
47
- interface references awaits the recorded Kernel authoring-default decision; no timestamps are
48
- authored by Shell.
49
-
50
- ## Execution and evidence
51
-
52
- `ShellDomain` is the complete remote product implementation. Its exact handler map proves that the
53
- genesis Functions and all seven Methods are served from the same immutable publication. The handlers use
54
- the SDK's canonical Auth, Query, Mutation, Result, Workflow, and Step contracts. `ensureUser` relies on
55
- the Kernel provision operation's stable idempotency key; the SDK's current inline Step runner does not
56
- claim process-restart replay on its own.
57
-
58
- The executable contract lives in Shell's semantic source, public facades, and tests. Product
59
- decisions, journeys, legacy disposition, dependency gates, and qualification evidence live in
60
- [`.history/`](.history/). Product Domains intentionally have no `.spec/` tree; Kernel authoring
61
- values come through semantic `@astrale-os/sdk/*` facades.
62
-
63
- The source, deterministic Knowledge linter, TypeScript package, unit/cross-layer tests, and remote Shell
64
- contract are qualified locally. Installed-instance, released-package, browser, and live
65
- credential journeys are separate evidence levels and are not claimed here. Shell does not broker
66
- authentication tokens; standard Domain token exchange is owned by Protocol, Server, and SDK.
3
+ Shell owns two concrete Identity classes, User and Group, the member_of_group relation,
4
+ the admin/member/applications Core groups, three static methods, one Domain function, and one
5
+ application View, which is its entrypoint. The Schema names the Domain `Shell`. There is no Space, setup function, personal home, or public repair method.
6
+
7
+ ## Contracts
8
+
9
+ | Static method | Input | Output |
10
+ | --- | --- | --- |
11
+ | User.invite | `{ user: UserPath, email: string }` | `{ invitationId, user, state }` |
12
+ | Group.assignMember | `{ member: UserPath \| GroupPath, group: GroupPath }` | `{}` |
13
+ | Group.unassignMember | Same | `{}` |
14
+
15
+ | Domain function | Input | Output |
16
+ | --- | --- | --- |
17
+ | listEntrypoints | `{}` | `{ entrypoints: { origin, name, view }[] }` |
18
+
19
+ listEntrypoints reads, with Shell's own authority, every Kernel `of_domain` locator whose View has
20
+ an outgoing `entrypoint` Edge, and returns one entry per Domain in origin order: its origin, the
21
+ `name` of its Domain Node, and the key of its entrypoint View. A Domain without an entrypoint is
22
+ not listed. Shell requires `read` on Kernel `Domain` and `of_domain`, and `traverse` on `entrypoint`
23
+ and `View`. Its `usesFunction` Policy admits any caller whose composed profile holds `can_use`
24
+ on the Function, so holding the capability is enough.
25
+
26
+ The Core `applications` Group carries `can_use` on listEntrypoints and View.resolve. Administrators
27
+ hold both directly (a Core Edge cannot author Kernel `extends_with`); members do not.
28
+ Share them dynamically with `Group.assignMember({ member: user, group: applications })`, which
29
+ composes the profile through `extends_with`; `unassignMember` withdraws it.
30
+
31
+ User extends Kernel.Identity and owns only optional creationKey correlation.
32
+ Concrete business classes may declare their own displayName/email; Shell never reads or writes them.
33
+ Group extends Kernel.Identity, Named and Descriptable. Authentication remains the
34
+ Kernel-owned, write-once iss/sub binding. Invitation email is explicit input, not a User property.
35
+
36
+ | Operation | Schema Policy alternatives, in addition to Kernel admission |
37
+ | --- | --- |
38
+ | invite | Core admin membership AND Shell-owned concrete User class; or ownership of the User's concrete class |
39
+ | assignMember / unassignMember | Core admin membership AND Shell-owned concrete Group class; or ownership of the Group's concrete class |
40
+
41
+ ownsClass follows instance_of → concrete class → of_domain → caller. It does not
42
+ infer ownership from an email, a subclass name, or ownership of an ancestor class.
43
+ A Domain cannot assign its Employee to Core member merely by owning Employee. Admin's invitation
44
+ orchestration retains that responsibility. A Group's owner may manage any admitted User or Group in that Group.
45
+ administersShellClass connects Core admin membership and concrete ownership in one Policy pattern;
46
+ it does not treat inheritance from Shell as ownership. These are callable restrictions, not an
47
+ isolation boundary against Root/Manager or the existing broad administrator Kernel profile.
48
+ With Kernel Host beta94 or newer, an external caller needs callable authority through its own
49
+ identity composition AND a passing callable Policy. Declare exact foreign methods in the calling
50
+ Domain's requirements; can_use no longer bypasses the Policy. Root and exact owner exceptions remain.
51
+
52
+ ## Flows
53
+
54
+ ```text
55
+ Domain creates Employee extending User → unregistered, no group
56
+ Direct credential-evidenced Register → same node authenticates, still no group
57
+ User.invite → provider authentication → Admin ingress → WorkOS/login
58
+ → Admin Register on that same node → member assignment → completed
59
+ Group.assignMember → member_of_group + Kernel.extends_with in one atomic mutation
60
+ Group.unassignMember → remove both edges in one atomic mutation
61
+ ```
62
+
63
+ The invitation flow is coordinated by Admin, not by an Employee callback. Shell's Integration
64
+ carries only user/email/requestId/requestedBy. Its Provider mints an invocation-bound Shell
65
+ proof for its configured HTTPS ingress audience; target/sourceProof are not business inputs.
66
+ A returned pending invitation does not prove email delivery or completed registration.
67
+
68
+ `assignMember({ member: A, group: B })` adds A to B. A and its current and future members inherit
69
+ B's authority. Groups can have several parents; Kernel rejects self-membership and cycles in the
70
+ same transaction as both membership edges. The target Group's manager authorizes this delegation;
71
+ the child Group's managers can subsequently change the population that inherits it.
72
+
73
+ `unassignMember` removes only that direct pair. Another membership path can preserve effective
74
+ access. Queries of `member_of_group` continue to return direct facts; Grant evaluation expands
75
+ identity composition for Policies. Shell must be able to traverse both concrete endpoint Classes,
76
+ including a foreign Group used as the member.
77
+
78
+ Membership methods converge both edges, including an observed partial membership.
79
+ After an uncertain mutation response they re-read the pair; an unconfirmed outcome remains
80
+ explicitly unconfirmed. This is not a global repair scan or an exactly-once guarantee.
81
+
82
+ A Team class extending Group can carry a business permission edge to Project. Membership
83
+ composition lets an Employee's expanded grant include Team; the protected Project Policy is
84
+ still evaluated by Kernel. Removing composition removes that authority path. Installed
85
+ Kernel E2E evidence, not a handler test, qualifies this behavior.
86
+
87
+ ## Installation and View
88
+
89
+ The Shell principal requests all Kernel root functions, the required extends_with operations,
90
+ and the declared grant/revoke authority. Core admin receives the full declared Shell profile,
91
+ including invite, assignMember and unassignMember so humans inheriting admin can call those methods.
92
+ Core member receives Introspect, Query, Mutate and View.resolve, not blanket class-read grants.
93
+ The Domain definition's requirements, including Core Identity capabilities in requirements.core, are owned by domain.ts and materialized by installation,
94
+ never by invitation handlers.
95
+
96
+ The sole application entrypoint uses the Vite React frontend at /, composed with
97
+ `@astrale-os/shell-react` and `@astrale-os/ui`. It lists visible User/Group families in two tabs
98
+ under the caller's session, with loading/empty/error states and independent refresh.
99
+ Users display their concrete class and Node ID, not a guessed foreign profile.
100
+ It does not proxy privileged directory reads or enumerate installed applications.
101
+
102
+ ## Source and qualification
103
+
104
+ Each declaration, Query and Mutation has its own semantic file. Layer roots are facades;
105
+ functions own orchestration, integrations/providers own external effects, views/ui own the
106
+ directory surface. Runtime has one default export and binds the three static Workflows.
107
+ The Dataset is referenced lazily by the root astrale.config.ts.
108
+
109
+ Domain authors import Schema from @astrale-domains/shell; platform workers use the explicit
110
+ /domain and /runtime exports. Creation/registration, installation authority, invitation
111
+ delivery, runtime replay and browser rendering are separate qualification boundaries.
112
+ The redesigned Admin composition, published Register cohort and real invitation/instance-create
113
+ journeys remain release gates; this source README is not evidence that those gates passed.
114
+
115
+ ### Publication boundary
116
+
117
+ `@astrale-domains/shell` is an executable platform package and a deliberate exception to the normal
118
+ Domain publication product. It publishes the remote Shell Domain definition and runtime needed by platform
119
+ Worker deployments through the explicit `./domain` and `./runtime` subpaths, while its root remains
120
+ Schema-only. Its build therefore compiles the explicit roots in `tsconfig.package.json` and applies
121
+ Shell-owned normalization and checks to the emitted platform closure. Source-only `#` aliases are
122
+ rewritten to relative JS and declaration references so consumer path mappings cannot capture private Shell
123
+ types. Tarball qualification then verifies the exact exports, isolated subpaths, absence of source
124
+ maps, and an install using only public npm dependencies.
125
+
126
+ The generic `astrale-domain package` command remains Schema-only and exposes only the Domain root plus
127
+ package metadata. This Shell exception must not be copied to ordinary product Domains or used to
128
+ weaken that SDK contract. Deployment consumers must use the explicit executable subpaths so a linked
129
+ schema import cannot traverse Shell's private application or runtime implementation.
130
+
131
+ Source, package, and deterministic test qualification remain distinct from installed-instance,
132
+ released-package, browser, and live-credential evidence. Shell does not broker authentication
133
+ tokens; standard Domain token exchange is owned by Protocol, Server, and SDK.
134
+
135
+ ### Breaking membership API migration
136
+
137
+ `Group.assignMember` / `Group.unassignMember` replace `assignUser` / `unassignUser` without aliases.
138
+ Callers must change `{ user, group }` to `{ member, group }` and declare the new exact callable
139
+ requirements. The `member_of_group` Class key is preserved; its source role is now `member` and
140
+ accepts User or Group families. Existing User memberships remain valid.
141
+
142
+ Rebuild and install all affected Schema dependents as one coherent revision closure. Admin bootstrap
143
+ and invitation completion must use the new API when this Shell revision is installed. A downgrade
144
+ to the User-only contract requires handling any Group-to-Group facts first. Validate public admission,
145
+ foreign endpoint traversal, and deployed revisions during the coordinated release.
@@ -0,0 +1,99 @@
1
+ import { type DomainDefinition } from '@astrale-os/sdk/domain';
2
+ import { ShellSchema } from './schema/index.js';
3
+ import { type ShellRuntime } from './runtime.js';
4
+ declare const frontend: import("@astrale-os/sdk/view").Frontend<import("@astrale-os/sdk/schema").AuthoredSchema<"shell.astrale.ai", readonly ["kernel.astrale.ai", import("@astrale-os/sdk/schema").KernelSchema] | readonly ["shell.astrale.ai", {
5
+ readonly name: 'Shell';
6
+ readonly entrypoint: 'application';
7
+ readonly classes: {
8
+ readonly User: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
9
+ readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
10
+ readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Identity">];
11
+ readonly properties: {
12
+ readonly creationKey: import("zod").ZodOptional<import("zod").ZodString>;
13
+ };
14
+ readonly methods: {
15
+ readonly invite: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
16
+ user: string;
17
+ email: string;
18
+ }, {
19
+ readonly mode: 'value';
20
+ readonly value: {
21
+ invitationId: string;
22
+ user: string;
23
+ state: "accepted" | "cancelled" | "completed" | "expired" | "failed" | "pending" | "registered" | "registering";
24
+ };
25
+ }, "authorized", true, false, undefined>>;
26
+ };
27
+ }>;
28
+ readonly Group: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
29
+ readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
30
+ readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Identity">, import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Descriptable">];
31
+ readonly methods: {
32
+ readonly assignMember: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
33
+ member: string;
34
+ group: string;
35
+ }, {
36
+ readonly mode: 'value';
37
+ readonly value: Record<string, never>;
38
+ }, "authorized", true, false, undefined>>;
39
+ readonly unassignMember: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
40
+ member: string;
41
+ group: string;
42
+ }, {
43
+ readonly mode: 'value';
44
+ readonly value: Record<string, never>;
45
+ }, "authorized", true, false, undefined>>;
46
+ };
47
+ }>;
48
+ readonly member_of_group: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
49
+ readonly depth: 0;
50
+ readonly abstract: false;
51
+ readonly extends: readonly [];
52
+ readonly properties: never;
53
+ readonly source: {
54
+ readonly as: "member";
55
+ readonly outgoing: "0..*";
56
+ };
57
+ readonly target: {
58
+ readonly as: "group";
59
+ readonly incoming: "0..*";
60
+ };
61
+ readonly constraints: Record<never, never>;
62
+ readonly effectiveProperties: never;
63
+ }>;
64
+ };
65
+ readonly functions: {
66
+ readonly listEntrypoints: import("@astrale-os/sdk/schema").Function<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
67
+ readonly mode: 'value';
68
+ readonly value: {
69
+ entrypoints: {
70
+ origin: string;
71
+ name: string;
72
+ view: string;
73
+ }[];
74
+ };
75
+ }, "authorized", false, false, undefined>>;
76
+ };
77
+ readonly policies: {
78
+ readonly belongsToGroup: import("@astrale-os/sdk/schema").Policy;
79
+ readonly ownsClass: import("@astrale-os/sdk/schema").Policy;
80
+ readonly administersShellClass: import("@astrale-os/sdk/schema").Policy;
81
+ readonly usesFunction: import("@astrale-os/sdk/schema").Policy;
82
+ };
83
+ readonly views: {
84
+ readonly application: import("@astrale-os/sdk/schema").View;
85
+ };
86
+ readonly core: {
87
+ readonly nodes: {
88
+ readonly admin: import("@astrale-os/sdk/schema").CoreNode;
89
+ readonly applications: import("@astrale-os/sdk/schema").CoreNode;
90
+ readonly member: import("@astrale-os/sdk/schema").CoreNode;
91
+ };
92
+ };
93
+ }, {
94
+ readonly kernel: "kernel.astrale.ai";
95
+ }]>>;
96
+ declare const domainRequirements: import("@astrale-os/sdk/domain").Requirements;
97
+ export type ShellDomain = DomainDefinition<typeof ShellSchema, ShellRuntime, typeof frontend, undefined, typeof domainRequirements>;
98
+ export declare const domain: ShellDomain;
99
+ export {};
package/dist/domain.js ADDED
@@ -0,0 +1,77 @@
1
+ import { defineDomain, defineFrontend, vite, requirements, } from '@astrale-os/sdk/domain';
2
+ import { K, KernelRootFunctions } from '@astrale-os/sdk/schema';
3
+ import { ShellSchema, S } from './schema/index.js';
4
+ import runtime, {} from './runtime.js';
5
+ const frontend = defineFrontend({
6
+ schema: ShellSchema,
7
+ source: vite({ config: './frontend/vite.config.ts' }),
8
+ routes: { application: { path: '/', handshake: 'shell' } },
9
+ });
10
+ const domainRequirements = requirements({
11
+ // Sujet implicite : le principal installé Shell, utilisé par kernel.self.
12
+ functions: KernelRootFunctions,
13
+ classes: [
14
+ { class: K.classes.extends_with, operations: ['create', 'read', 'traverse', 'delete'] },
15
+ // listEntrypoints reads every entrypoint View locator and its Domain as Shell.
16
+ { class: K.classes.Domain, operations: ['read'] },
17
+ { class: K.classes.of_domain, operations: ['read'] },
18
+ { class: K.classes.entrypoint, operations: ['traverse'] },
19
+ { class: K.classes.View, operations: ['traverse'] },
20
+ ],
21
+ authority: {
22
+ grant: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'revoke'],
23
+ revoke: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'grant'],
24
+ },
25
+ // Ces profils sont matérialisés par l'installeur, pas par un handler Shell.
26
+ core: [
27
+ {
28
+ subject: S.core.nodes.admin,
29
+ functions: [
30
+ ...KernelRootFunctions,
31
+ S.classes.User.static.methods.invite,
32
+ S.classes.Group.static.methods.assignMember,
33
+ S.classes.Group.static.methods.unassignMember,
34
+ // Core Edges cannot author Kernel extends_with, so administrators hold it directly.
35
+ S.functions.listEntrypoints,
36
+ ],
37
+ classes: [
38
+ { class: S.classes.User, operations: ['create', 'read', 'traverse', 'update', 'delete'] },
39
+ {
40
+ class: S.classes.Group,
41
+ operations: ['create', 'read', 'traverse', 'update', 'delete'],
42
+ },
43
+ {
44
+ class: S.classes.member_of_group,
45
+ operations: ['create', 'read', 'traverse', 'update', 'delete'],
46
+ },
47
+ { class: K.classes.extends_with, operations: ['create', 'read', 'traverse', 'delete'] },
48
+ ],
49
+ authority: {
50
+ grant: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'revoke'],
51
+ revoke: ['create', 'read', 'update', 'delete', 'traverse', 'use', 'grant'],
52
+ },
53
+ },
54
+ {
55
+ subject: S.core.nodes.member,
56
+ functions: [
57
+ // Download re-reads the holder Node with the caller's authority: no new data exposure.
58
+ K.functions.download,
59
+ K.functions.introspect,
60
+ K.functions.query,
61
+ K.functions.mutate,
62
+ K.classes.View.static.methods.resolve,
63
+ ],
64
+ },
65
+ {
66
+ // Shared dynamically: Group.assignMember(user, applications) composes this profile.
67
+ subject: S.core.nodes.applications,
68
+ functions: [S.functions.listEntrypoints, K.classes.View.static.methods.resolve],
69
+ },
70
+ ],
71
+ });
72
+ export const domain = defineDomain({
73
+ schema: ShellSchema,
74
+ runtime,
75
+ frontend,
76
+ requirements: domainRequirements,
77
+ });
@@ -1,3 +1 @@
1
- export { installApplication } from './install.js';
2
- export { uninstallApplication } from './uninstall.js';
3
- //# sourceMappingURL=index.js.map
1
+ export { listEntrypoints } from './list-entrypoints.js';
@@ -0,0 +1,4 @@
1
+ import { defineAction } from '@astrale-os/sdk/action';
2
+ import { readInstalledEntrypoints } from '../../queries/application/index.js';
3
+ /** One graph read: every Domain with an `entrypoint` Edge, its name and its entrypoint View. */
4
+ export const listEntrypoints = defineAction()('listEntrypoints', async ({ query }) => ({ entrypoints: [...(await query(readInstalledEntrypoints, {}))] }));
@@ -0,0 +1,4 @@
1
+ import { defineWorkflow } from '@astrale-os/sdk/workflow';
2
+ import { changeGroupMembership } from './change-group-membership.js';
3
+ import { groupMembershipErrors } from './group-membership-errors.js';
4
+ export const assignMember = defineWorkflow()('Group.assignMember', { errors: groupMembershipErrors }, (context) => changeGroupMembership(context, true));
@@ -0,0 +1,34 @@
1
+ import { setGroupMembership } from '../../mutations/group/index.js';
2
+ import { readGroupMembership, readGroupMembershipEndpoints, } from '../../queries/group/index.js';
3
+ import { canonicalNodeId } from '../../utils/canonical-node-path/index.js';
4
+ const matches = (state, present) => state.membership === present && state.authority === present;
5
+ export async function changeGroupMembership(context, present) {
6
+ const invalid = () => context.error('INVALID_GROUP_MEMBERSHIP_REFERENCE', {});
7
+ const membership = {
8
+ member: canonicalNodeId(context.input.member, invalid),
9
+ group: canonicalNodeId(context.input.group, invalid),
10
+ };
11
+ const observe = async () => {
12
+ const endpoints = await context.query(readGroupMembershipEndpoints, membership);
13
+ if (!endpoints.visible)
14
+ throw context.error('GROUP_MEMBERSHIP_ENDPOINTS_UNAVAILABLE', {});
15
+ const current = await context.query(readGroupMembership, membership);
16
+ return { ...current, endpoints: endpoints.guard };
17
+ };
18
+ const current = await context.step.run('observe-membership', observe);
19
+ if (matches(current, present))
20
+ return {};
21
+ const result = await context.step.run('mutate-membership', () => context.mutate(setGroupMembership, { ...membership, current, present }));
22
+ if (result.ok)
23
+ return {};
24
+ if (result.outcomeKnown) {
25
+ throw context.error('GROUP_MEMBERSHIP_CONFLICT', { cause: result.code });
26
+ }
27
+ const recovered = await context.step.run('recover-membership', observe);
28
+ if (matches(recovered, present))
29
+ return {};
30
+ throw context.error('GROUP_MEMBERSHIP_UNCONFIRMED', {
31
+ cause: result.code,
32
+ outcomeKnown: false,
33
+ });
34
+ }
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ export const groupMembershipErrors = {
3
+ GROUP_MEMBERSHIP_ENDPOINTS_UNAVAILABLE: {
4
+ family: 'CONFLICT',
5
+ message: 'Shell must be able to traverse both membership endpoints before confirming membership.',
6
+ details: z.strictObject({}),
7
+ },
8
+ INVALID_GROUP_MEMBERSHIP_REFERENCE: {
9
+ family: 'VALIDATION_ERROR',
10
+ message: 'Member and group must be exact canonical @NodeId paths.',
11
+ details: z.strictObject({}),
12
+ },
13
+ GROUP_MEMBERSHIP_CONFLICT: {
14
+ family: 'CONFLICT',
15
+ message: 'Membership changed concurrently; retry the operation.',
16
+ details: z.strictObject({ cause: z.string() }),
17
+ },
18
+ GROUP_MEMBERSHIP_UNCONFIRMED: {
19
+ family: 'CONFLICT',
20
+ message: 'The requested membership could not be confirmed; retry the operation.',
21
+ details: z.strictObject({ cause: z.string(), outcomeKnown: z.literal(false) }),
22
+ },
23
+ };
@@ -1,3 +1,2 @@
1
- export { assignGroupUser } from './assign-user.js';
2
- export { unassignGroupUser } from './unassign-user.js';
3
- //# sourceMappingURL=index.js.map
1
+ export { assignMember } from './assign-member-to-group.js';
2
+ export { unassignMember } from './unassign-member-from-group.js';
@@ -0,0 +1,4 @@
1
+ import { defineWorkflow } from '@astrale-os/sdk/workflow';
2
+ import { changeGroupMembership } from './change-group-membership.js';
3
+ import { groupMembershipErrors } from './group-membership-errors.js';
4
+ export const unassignMember = defineWorkflow()('Group.unassignMember', { errors: groupMembershipErrors }, (context) => changeGroupMembership(context, false));
@@ -1,3 +1 @@
1
- export { ensureAdministrator } from './administrator.js';
2
- export { ensureShellUser, ensureUser, lookupShellUser, } from './ensure.js';
3
- //# sourceMappingURL=index.js.map
1
+ export { invite } from './invite-user.js';
@@ -0,0 +1,39 @@
1
+ import { defineWorkflow } from '@astrale-os/sdk/workflow';
2
+ import { z } from 'zod';
3
+ import { InvitationRequestFailure } from '../../integrations/user-invitation/index.js';
4
+ import { canonicalNodeId } from '../../utils/canonical-node-path/index.js';
5
+ export const invite = defineWorkflow()('User.invite', {
6
+ errors: {
7
+ INVALID_INVITATION_REFERENCE: {
8
+ family: 'VALIDATION_ERROR',
9
+ message: 'User must be an exact canonical @NodeId path.',
10
+ details: z.strictObject({}),
11
+ },
12
+ INVITATION_CONFLICT: {
13
+ family: 'CONFLICT',
14
+ message: 'The invitation conflicts with an existing request.',
15
+ details: z.strictObject({ requestId: z.string() }),
16
+ },
17
+ INVITATION_REJECTED: {
18
+ family: 'VALIDATION_ERROR',
19
+ message: 'Admin rejected the invitation request.',
20
+ details: z.strictObject({ requestId: z.string() }),
21
+ },
22
+ },
23
+ }, async (context) => {
24
+ const user = canonicalNodeId(context.input.user, () => context.error('INVALID_INVITATION_REFERENCE', {}));
25
+ const requestId = context.execution.idempotencyKey ?? crypto.randomUUID();
26
+ try {
27
+ return await context.step.run('request-invitation', () => context.integrations.enrollment.invite({
28
+ user,
29
+ email: context.input.email,
30
+ requestId,
31
+ requestedBy: context.caller.identity,
32
+ }));
33
+ }
34
+ catch (cause) {
35
+ if (cause instanceof InvitationRequestFailure)
36
+ throw context.error(cause.code, { requestId });
37
+ throw cause;
38
+ }
39
+ });
package/dist/index.d.ts CHANGED
@@ -1,4 +1 @@
1
- export { Application, Group, ORIGIN, S, ShellCore, ShellSchema, Space, User, adminGroup, administers_group, administers_space, applicationCore, applicationInstall, applicationUninstall, applicationView, application_of, belongsToSpace, default_space, defaultSpace, ensureAdministrator, ensureUser, groupAssignUser, groupCore, groupUnassignUser, groupView, homeView, iUser, installed_in, mayAdministerApplication, mayAdministerGroup, mayAdministerSpace, memberGroup, member_of_group, member_of_space, owns_space, ownsSpace, shellApplication, spaceAddUser, spaceCore, spaceRemoveUser, spaceSetDefault, spaceView, userView, type GroupMembershipInput, type GroupMembershipResult, type EnsureShellAdministratorInput, type EnsureShellAdministratorResult, type EnsureShellUserResult, type InstallApplicationInput, type InstallApplicationResult, type SetDefaultSpaceInput, type SetDefaultSpaceResult, type Shell, type ShellCoreName, type ShellDomainOperations, type ShellEdgeName, type ShellNodeName, type ShellSchemaInput, type SpaceUserAccess, type SpaceUserAccessInput, type SpaceUserAccessResult, type SpaceUserInput, type SpaceUserResult, type UninstallApplicationInput, type UninstallApplicationResult, } from '#schema';
2
- export { ShellDomain } from './public.js';
3
- export { buildShellUserProvisioning, projectShellUserProvisioning, type EnsureShellUserInput, type ShellUserProvisioning, } from './rules/user/index.js';
4
- //# sourceMappingURL=index.d.ts.map
1
+ export { ShellSchema, S, type Shell, type ShellClasses, type ShellSchemaInput, type InvitationSummary, User, Group, member_of_group, adminGroup, memberGroup, } from './schema/index.js';
package/dist/index.js CHANGED
@@ -1,4 +1 @@
1
- export { Application, Group, ORIGIN, S, ShellCore, ShellSchema, Space, User, adminGroup, administers_group, administers_space, applicationCore, applicationInstall, applicationUninstall, applicationView, application_of, belongsToSpace, default_space, defaultSpace, ensureAdministrator, ensureUser, groupAssignUser, groupCore, groupUnassignUser, groupView, homeView, iUser, installed_in, mayAdministerApplication, mayAdministerGroup, mayAdministerSpace, memberGroup, member_of_group, member_of_space, owns_space, ownsSpace, shellApplication, spaceAddUser, spaceCore, spaceRemoveUser, spaceSetDefault, spaceView, userView, } from '#schema';
2
- export { ShellDomain } from './public.js';
3
- export { buildShellUserProvisioning, projectShellUserProvisioning, } from './rules/user/index.js';
4
- //# sourceMappingURL=index.js.map
1
+ export { ShellSchema, S, User, Group, member_of_group, adminGroup, memberGroup, } from './schema/index.js';
@@ -0,0 +1 @@
1
+ export { integrations } from './integrations.js';
@@ -0,0 +1 @@
1
+ export { integrations } from './integrations.js';
@@ -0,0 +1,9 @@
1
+ export declare const integrations: {
2
+ enrollment: import("@astrale-os/sdk/integration").IntegrationDefinition<"shell.enrollment", {
3
+ invite: import("@astrale-os/sdk/integration").IntegrationOperation<import("./user-invitation/index.js").InviteRequest, {
4
+ invitationId: string;
5
+ user: string;
6
+ state: "accepted" | "cancelled" | "completed" | "expired" | "failed" | "pending" | "registered" | "registering";
7
+ }>;
8
+ }>;
9
+ };
@@ -0,0 +1,2 @@
1
+ import { enrollment } from './user-invitation/index.js';
2
+ export const integrations = { enrollment };
@@ -0,0 +1,4 @@
1
+ export { enrollment } from './request-user-invitation.js';
2
+ export { InvitationRequestFailure } from './invitation-request-failure.js';
3
+ export { type InviteRequest } from './invite-user-request.js';
4
+ export type { InvitationSummary } from '../../schema/modules/user/index.js';
@@ -0,0 +1,3 @@
1
+ export { enrollment } from './request-user-invitation.js';
2
+ export { InvitationRequestFailure } from './invitation-request-failure.js';
3
+ export {} from './invite-user-request.js';
@@ -0,0 +1,5 @@
1
+ /** Expected business refusal from the invitation service, without its response body. */
2
+ export declare class InvitationRequestFailure extends Error {
3
+ readonly code: 'INVITATION_CONFLICT' | 'INVITATION_REJECTED';
4
+ constructor(code: 'INVITATION_CONFLICT' | 'INVITATION_REJECTED');
5
+ }
@@ -0,0 +1,9 @@
1
+ /** Expected business refusal from the invitation service, without its response body. */
2
+ export class InvitationRequestFailure extends Error {
3
+ code;
4
+ constructor(code) {
5
+ super(code);
6
+ this.code = code;
7
+ this.name = 'InvitationRequestFailure';
8
+ }
9
+ }
@@ -0,0 +1,6 @@
1
+ export interface InviteRequest {
2
+ readonly requestId: string;
3
+ readonly user: string;
4
+ readonly email: string;
5
+ readonly requestedBy: string;
6
+ }