@astrale-os/shell-react 0.2.8 → 0.2.10-beta.2

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 (342) hide show
  1. package/dist/application/apps/app-host.d.ts +7 -15
  2. package/dist/application/apps/app-host.d.ts.map +1 -1
  3. package/dist/application/apps/app-host.js +3 -2
  4. package/dist/application/apps/apps.hook.d.ts +7 -4
  5. package/dist/application/apps/apps.hook.d.ts.map +1 -1
  6. package/dist/application/apps/apps.hook.js +10 -2
  7. package/dist/application/apps/domains.hook.d.ts +1 -1
  8. package/dist/application/apps/domains.hook.d.ts.map +1 -1
  9. package/dist/application/apps/domains.hook.js +1 -1
  10. package/dist/application/apps/open-app.hook.d.ts +2 -3
  11. package/dist/application/apps/open-app.hook.d.ts.map +1 -1
  12. package/dist/application/index.d.ts +2 -4
  13. package/dist/application/index.d.ts.map +1 -1
  14. package/dist/application/index.js +2 -3
  15. package/dist/application/spaces/space.hook.d.ts +2 -2
  16. package/dist/application/spaces/space.hook.d.ts.map +1 -1
  17. package/dist/application/spaces/space.hook.js +2 -2
  18. package/dist/application/spaces/spaces.hook.d.ts +2 -3
  19. package/dist/application/spaces/spaces.hook.d.ts.map +1 -1
  20. package/dist/application/spaces/spaces.hook.js +10 -3
  21. package/dist/auth/act-as.context.d.ts +15 -32
  22. package/dist/auth/act-as.context.d.ts.map +1 -1
  23. package/dist/auth/act-as.context.js +22 -66
  24. package/dist/auth/auth.hook.d.ts +1 -0
  25. package/dist/auth/auth.hook.d.ts.map +1 -1
  26. package/dist/auth/auth.hook.js +2 -22
  27. package/dist/auth/can.hook.d.ts +10 -38
  28. package/dist/auth/can.hook.d.ts.map +1 -1
  29. package/dist/auth/can.hook.js +35 -110
  30. package/dist/auth/index.d.ts +1 -0
  31. package/dist/auth/index.d.ts.map +1 -1
  32. package/dist/auth/self.hook.d.ts +2 -2
  33. package/dist/auth/self.hook.d.ts.map +1 -1
  34. package/dist/auth/self.hook.js +0 -7
  35. package/dist/auth/session-kernel.d.ts +2 -3
  36. package/dist/auth/session-kernel.d.ts.map +1 -1
  37. package/dist/auth/session-kernel.js +4 -13
  38. package/dist/components/boundaries.d.ts +47 -0
  39. package/dist/components/boundaries.d.ts.map +1 -0
  40. package/dist/components/boundaries.js +55 -0
  41. package/dist/components/can.d.ts +11 -0
  42. package/dist/components/can.d.ts.map +1 -0
  43. package/dist/components/can.js +5 -0
  44. package/dist/components/index.d.ts +7 -0
  45. package/dist/components/index.d.ts.map +1 -0
  46. package/dist/components/index.js +4 -0
  47. package/dist/components/mount-domain-frontend.d.ts +22 -0
  48. package/dist/components/mount-domain-frontend.d.ts.map +1 -0
  49. package/dist/components/mount-domain-frontend.js +85 -0
  50. package/dist/components/view-app.d.ts +16 -0
  51. package/dist/components/view-app.d.ts.map +1 -0
  52. package/dist/components/view-app.js +16 -0
  53. package/dist/graph/call/call.hook.d.ts +8 -18
  54. package/dist/graph/call/call.hook.d.ts.map +1 -1
  55. package/dist/graph/call/call.hook.js +7 -13
  56. package/dist/graph/call/stream.hook.d.ts +12 -20
  57. package/dist/graph/call/stream.hook.d.ts.map +1 -1
  58. package/dist/graph/call/stream.hook.js +55 -111
  59. package/dist/graph/graph.context.d.ts +4 -3
  60. package/dist/graph/graph.context.d.ts.map +1 -1
  61. package/dist/graph/graph.context.js +2 -8
  62. package/dist/graph/guards.error.d.ts +7 -8
  63. package/dist/graph/guards.error.d.ts.map +1 -1
  64. package/dist/graph/guards.error.js +11 -7
  65. package/dist/graph/index.d.ts +8 -16
  66. package/dist/graph/index.d.ts.map +1 -1
  67. package/dist/graph/index.js +3 -7
  68. package/dist/graph/memory/read/envelope.d.ts +22 -54
  69. package/dist/graph/memory/read/envelope.d.ts.map +1 -1
  70. package/dist/graph/memory/read/envelope.js +26 -20
  71. package/dist/graph/memory/read/idle.d.ts +1 -15
  72. package/dist/graph/memory/read/idle.d.ts.map +1 -1
  73. package/dist/graph/memory/read/idle.js +4 -13
  74. package/dist/graph/query-definition.hook.d.ts +11 -0
  75. package/dist/graph/query-definition.hook.d.ts.map +1 -0
  76. package/dist/graph/query-definition.hook.js +205 -0
  77. package/dist/graph/resource.d.ts +34 -0
  78. package/dist/graph/resource.d.ts.map +1 -0
  79. package/dist/graph/resource.js +244 -0
  80. package/dist/graph/store.d.ts +25 -0
  81. package/dist/graph/store.d.ts.map +1 -0
  82. package/dist/graph/store.js +69 -0
  83. package/dist/host/actions.hook.d.ts +34 -0
  84. package/dist/host/actions.hook.d.ts.map +1 -0
  85. package/dist/host/actions.hook.js +125 -0
  86. package/dist/host/components.d.ts +15 -0
  87. package/dist/host/components.d.ts.map +1 -0
  88. package/dist/host/components.js +14 -0
  89. package/dist/host/index.d.ts +5 -0
  90. package/dist/host/index.d.ts.map +1 -0
  91. package/dist/host/index.js +3 -0
  92. package/dist/index.d.ts +26 -37
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js +20 -31
  95. package/dist/intents/envelope.d.ts +7 -19
  96. package/dist/intents/envelope.d.ts.map +1 -1
  97. package/dist/intents/envelope.js +2 -3
  98. package/dist/intents/send-intent.hook.d.ts +5 -7
  99. package/dist/intents/send-intent.hook.d.ts.map +1 -1
  100. package/dist/intents/send-intent.hook.js +17 -75
  101. package/dist/navigation/adapters/adapter.d.ts +5 -0
  102. package/dist/navigation/adapters/adapter.d.ts.map +1 -1
  103. package/dist/navigation/adapters/memory.adapter.d.ts.map +1 -1
  104. package/dist/navigation/adapters/memory.adapter.js +4 -0
  105. package/dist/navigation/adapters/url.adapter.d.ts.map +1 -1
  106. package/dist/navigation/adapters/url.adapter.js +57 -10
  107. package/dist/navigation/codec.d.ts +60 -0
  108. package/dist/navigation/codec.d.ts.map +1 -0
  109. package/dist/navigation/codec.js +121 -0
  110. package/dist/navigation/history.d.ts +11 -9
  111. package/dist/navigation/history.d.ts.map +1 -1
  112. package/dist/navigation/history.js +6 -8
  113. package/dist/navigation/hooks/ancestors.hook.d.ts +5 -7
  114. package/dist/navigation/hooks/ancestors.hook.d.ts.map +1 -1
  115. package/dist/navigation/hooks/ancestors.hook.js +7 -51
  116. package/dist/navigation/hooks/location.hook.d.ts.map +1 -1
  117. package/dist/navigation/hooks/location.hook.js +4 -6
  118. package/dist/navigation/hooks/scope.hook.d.ts.map +1 -1
  119. package/dist/navigation/hooks/scope.hook.js +4 -6
  120. package/dist/navigation/index.d.ts +4 -2
  121. package/dist/navigation/index.d.ts.map +1 -1
  122. package/dist/navigation/index.js +2 -1
  123. package/dist/navigation/link.d.ts +12 -0
  124. package/dist/navigation/link.d.ts.map +1 -1
  125. package/dist/navigation/link.js +13 -2
  126. package/dist/navigation/location.d.ts +13 -40
  127. package/dist/navigation/location.d.ts.map +1 -1
  128. package/dist/navigation/location.js +14 -76
  129. package/dist/navigation/scope.context.d.ts +17 -26
  130. package/dist/navigation/scope.context.d.ts.map +1 -1
  131. package/dist/navigation/scope.context.js +140 -108
  132. package/dist/navigation/snapshot.d.ts +14 -19
  133. package/dist/navigation/snapshot.d.ts.map +1 -1
  134. package/dist/navigation/snapshot.js +48 -44
  135. package/dist/schema/action.hook.d.ts +44 -0
  136. package/dist/schema/action.hook.d.ts.map +1 -0
  137. package/dist/schema/action.hook.js +72 -0
  138. package/dist/schema/domain.hook.d.ts +12 -7
  139. package/dist/schema/domain.hook.d.ts.map +1 -1
  140. package/dist/schema/domain.hook.js +101 -4
  141. package/dist/schema/index.d.ts +9 -8
  142. package/dist/schema/index.d.ts.map +1 -1
  143. package/dist/schema/index.js +5 -7
  144. package/dist/schema/kernel.hook.d.ts +4 -9
  145. package/dist/schema/kernel.hook.d.ts.map +1 -1
  146. package/dist/schema/kernel.hook.js +4 -6
  147. package/dist/schema/mutation.hook.d.ts +9 -0
  148. package/dist/schema/mutation.hook.d.ts.map +1 -0
  149. package/dist/schema/mutation.hook.js +41 -0
  150. package/dist/schema/object.hook.d.ts +16 -0
  151. package/dist/schema/object.hook.d.ts.map +1 -0
  152. package/dist/schema/object.hook.js +46 -0
  153. package/dist/schema/relation.hook.d.ts +46 -0
  154. package/dist/schema/relation.hook.d.ts.map +1 -0
  155. package/dist/schema/relation.hook.js +136 -0
  156. package/dist/selection/live.d.ts +9 -17
  157. package/dist/selection/live.d.ts.map +1 -1
  158. package/dist/selection/live.js +65 -112
  159. package/dist/selection/scope.context.js +5 -4
  160. package/dist/session/boot/boot.d.ts +1 -13
  161. package/dist/session/boot/boot.d.ts.map +1 -1
  162. package/dist/session/boot/boot.js +9 -27
  163. package/dist/session/index.d.ts +1 -0
  164. package/dist/session/index.d.ts.map +1 -1
  165. package/dist/session/kernel-instance.hook.d.ts +1 -4
  166. package/dist/session/kernel-instance.hook.d.ts.map +1 -1
  167. package/dist/session/kernel-instance.hook.js +1 -5
  168. package/dist/session/provider.d.ts +9 -23
  169. package/dist/session/provider.d.ts.map +1 -1
  170. package/dist/session/provider.js +29 -75
  171. package/dist/session/session.context.d.ts +5 -0
  172. package/dist/session/session.context.d.ts.map +1 -1
  173. package/dist/window/adopt.d.ts +0 -1
  174. package/dist/window/adopt.d.ts.map +1 -1
  175. package/dist/window/hooks/target-node.hook.d.ts +10 -6
  176. package/dist/window/hooks/target-node.hook.d.ts.map +1 -1
  177. package/dist/window/hooks/target-node.hook.js +14 -72
  178. package/dist/window/hooks/views-for.hook.d.ts +4 -3
  179. package/dist/window/hooks/views-for.hook.d.ts.map +1 -1
  180. package/dist/window/hooks/views-for.hook.js +6 -22
  181. package/dist/window/hooks/windows.hook.d.ts.map +1 -1
  182. package/dist/window/hooks/windows.hook.js +3 -4
  183. package/dist/window/host.d.ts +11 -11
  184. package/dist/window/host.d.ts.map +1 -1
  185. package/dist/window/host.js +38 -54
  186. package/dist/window/hub.d.ts +2 -0
  187. package/dist/window/hub.d.ts.map +1 -1
  188. package/dist/window/hub.js +33 -0
  189. package/dist/window/index.d.ts +3 -3
  190. package/dist/window/index.d.ts.map +1 -1
  191. package/dist/window/index.js +2 -2
  192. package/dist/window/lifecycle/mount.d.ts +5 -44
  193. package/dist/window/lifecycle/mount.d.ts.map +1 -1
  194. package/dist/window/lifecycle/mount.js +14 -120
  195. package/dist/window/lifecycle/states.d.ts +0 -5
  196. package/dist/window/lifecycle/states.d.ts.map +1 -1
  197. package/dist/window/stage.d.ts.map +1 -1
  198. package/dist/window/stage.js +1 -0
  199. package/package.json +9 -8
  200. package/src/application/apps/app-host.tsx +17 -18
  201. package/src/application/apps/apps.hook.ts +13 -6
  202. package/src/application/apps/domains.hook.ts +1 -1
  203. package/src/application/apps/open-app.hook.ts +3 -4
  204. package/src/application/index.ts +4 -6
  205. package/src/application/spaces/space.hook.ts +5 -6
  206. package/src/application/spaces/spaces.hook.ts +14 -9
  207. package/src/auth/act-as.context.tsx +37 -91
  208. package/src/auth/auth.hook.ts +2 -30
  209. package/src/auth/can.hook.ts +44 -135
  210. package/src/auth/index.ts +1 -0
  211. package/src/auth/self.hook.ts +2 -9
  212. package/src/auth/session-kernel.ts +6 -16
  213. package/src/components/boundaries.tsx +113 -0
  214. package/src/components/can.tsx +16 -0
  215. package/src/components/index.ts +14 -0
  216. package/src/components/mount-domain-frontend.tsx +158 -0
  217. package/src/components/view-app.tsx +49 -0
  218. package/src/graph/call/call.hook.ts +22 -27
  219. package/src/graph/call/stream.hook.ts +66 -143
  220. package/src/graph/graph.context.ts +6 -11
  221. package/src/graph/guards.error.ts +17 -55
  222. package/src/graph/index.ts +23 -17
  223. package/src/graph/memory/read/envelope.ts +40 -65
  224. package/src/graph/memory/read/idle.ts +5 -18
  225. package/src/graph/query-definition.hook.ts +270 -0
  226. package/src/graph/resource.ts +358 -0
  227. package/src/graph/store.ts +97 -0
  228. package/src/host/actions.hook.ts +165 -0
  229. package/src/host/components.tsx +29 -0
  230. package/src/host/index.ts +17 -0
  231. package/src/index.ts +137 -123
  232. package/src/intents/envelope.ts +7 -23
  233. package/src/intents/send-intent.hook.ts +24 -79
  234. package/src/navigation/adapters/adapter.ts +3 -0
  235. package/src/navigation/adapters/memory.adapter.ts +4 -0
  236. package/src/navigation/adapters/url.adapter.ts +48 -8
  237. package/src/navigation/codec.ts +190 -0
  238. package/src/navigation/history.ts +20 -11
  239. package/src/navigation/hooks/ancestors.hook.ts +10 -60
  240. package/src/navigation/hooks/location.hook.ts +4 -6
  241. package/src/navigation/hooks/scope.hook.ts +4 -6
  242. package/src/navigation/index.ts +18 -2
  243. package/src/navigation/link.tsx +27 -2
  244. package/src/navigation/location.ts +26 -93
  245. package/src/navigation/scope.context.tsx +151 -136
  246. package/src/navigation/snapshot.ts +69 -50
  247. package/src/schema/action.hook.ts +146 -0
  248. package/src/schema/domain.hook.ts +127 -11
  249. package/src/schema/index.ts +9 -30
  250. package/src/schema/kernel.hook.ts +6 -13
  251. package/src/schema/mutation.hook.ts +63 -0
  252. package/src/schema/object.hook.ts +85 -0
  253. package/src/schema/relation.hook.ts +253 -0
  254. package/src/selection/live.ts +75 -125
  255. package/src/selection/scope.context.tsx +4 -4
  256. package/src/session/boot/boot.ts +8 -33
  257. package/src/session/index.ts +1 -0
  258. package/src/session/kernel-instance.hook.ts +2 -11
  259. package/src/session/provider.tsx +34 -103
  260. package/src/session/session.context.ts +6 -0
  261. package/src/window/adopt.ts +0 -1
  262. package/src/window/hooks/target-node.hook.ts +20 -85
  263. package/src/window/hooks/views-for.hook.ts +12 -25
  264. package/src/window/hooks/windows.hook.ts +3 -4
  265. package/src/window/host.tsx +51 -68
  266. package/src/window/hub.ts +33 -0
  267. package/src/window/index.ts +4 -4
  268. package/src/window/lifecycle/mount.ts +15 -160
  269. package/src/window/lifecycle/states.ts +1 -5
  270. package/src/window/stage.tsx +1 -0
  271. package/dist/application/roles.hook.d.ts +0 -7
  272. package/dist/application/roles.hook.d.ts.map +0 -1
  273. package/dist/application/roles.hook.js +0 -23
  274. package/dist/graph/memory/base.d.ts +0 -21
  275. package/dist/graph/memory/base.d.ts.map +0 -1
  276. package/dist/graph/memory/base.js +0 -33
  277. package/dist/graph/memory/read/read.d.ts +0 -9
  278. package/dist/graph/memory/read/read.d.ts.map +0 -1
  279. package/dist/graph/memory/read/read.js +0 -87
  280. package/dist/graph/memory/scope.d.ts +0 -7
  281. package/dist/graph/memory/scope.d.ts.map +0 -1
  282. package/dist/graph/memory/scope.js +0 -25
  283. package/dist/graph/mutate/move.hook.d.ts +0 -7
  284. package/dist/graph/mutate/move.hook.d.ts.map +0 -1
  285. package/dist/graph/mutate/move.hook.js +0 -49
  286. package/dist/graph/mutate/mutate.hook.d.ts +0 -17
  287. package/dist/graph/mutate/mutate.hook.d.ts.map +0 -1
  288. package/dist/graph/mutate/mutate.hook.js +0 -45
  289. package/dist/graph/query/children.hook.d.ts +0 -29
  290. package/dist/graph/query/children.hook.d.ts.map +0 -1
  291. package/dist/graph/query/children.hook.js +0 -64
  292. package/dist/graph/query/graph.hook.d.ts +0 -9
  293. package/dist/graph/query/graph.hook.d.ts.map +0 -1
  294. package/dist/graph/query/graph.hook.js +0 -5
  295. package/dist/graph/query/neighbors.hook.d.ts +0 -7
  296. package/dist/graph/query/neighbors.hook.d.ts.map +0 -1
  297. package/dist/graph/query/neighbors.hook.js +0 -104
  298. package/dist/graph/query/node.hook.d.ts +0 -14
  299. package/dist/graph/query/node.hook.d.ts.map +0 -1
  300. package/dist/graph/query/node.hook.js +0 -43
  301. package/dist/graph/query/query.hook.d.ts +0 -14
  302. package/dist/graph/query/query.hook.d.ts.map +0 -1
  303. package/dist/graph/query/query.hook.js +0 -23
  304. package/dist/schema/bind-read.d.ts +0 -37
  305. package/dist/schema/bind-read.d.ts.map +0 -1
  306. package/dist/schema/bind-read.js +0 -205
  307. package/dist/schema/binding.d.ts +0 -21
  308. package/dist/schema/binding.d.ts.map +0 -1
  309. package/dist/schema/binding.js +0 -99
  310. package/dist/schema/function.hook.d.ts +0 -9
  311. package/dist/schema/function.hook.d.ts.map +0 -1
  312. package/dist/schema/function.hook.js +0 -40
  313. package/dist/schema/method.hook.d.ts +0 -14
  314. package/dist/schema/method.hook.d.ts.map +0 -1
  315. package/dist/schema/method.hook.js +0 -49
  316. package/dist/schema/tag.d.ts +0 -11
  317. package/dist/schema/tag.d.ts.map +0 -1
  318. package/dist/schema/tag.js +0 -11
  319. package/dist/schema/types.d.ts +0 -73
  320. package/dist/schema/types.d.ts.map +0 -1
  321. package/dist/schema/types.js +0 -1
  322. package/dist/schema/write.d.ts +0 -16
  323. package/dist/schema/write.d.ts.map +0 -1
  324. package/dist/schema/write.js +0 -56
  325. package/src/application/roles.hook.ts +0 -41
  326. package/src/graph/memory/base.ts +0 -50
  327. package/src/graph/memory/read/read.ts +0 -103
  328. package/src/graph/memory/scope.ts +0 -29
  329. package/src/graph/mutate/move.hook.ts +0 -70
  330. package/src/graph/mutate/mutate.hook.ts +0 -69
  331. package/src/graph/query/children.hook.ts +0 -136
  332. package/src/graph/query/graph.hook.ts +0 -13
  333. package/src/graph/query/neighbors.hook.ts +0 -159
  334. package/src/graph/query/node.hook.ts +0 -83
  335. package/src/graph/query/query.hook.ts +0 -42
  336. package/src/schema/bind-read.ts +0 -319
  337. package/src/schema/binding.ts +0 -146
  338. package/src/schema/function.hook.ts +0 -68
  339. package/src/schema/method.hook.ts +0 -103
  340. package/src/schema/tag.ts +0 -19
  341. package/src/schema/types.ts +0 -150
  342. package/src/schema/write.ts +0 -96
@@ -0,0 +1,125 @@
1
+ import { useMemo } from 'react';
2
+ import { useSendIntent } from '../intents/send-intent.hook.js';
3
+ import { useShell } from '../session/shell.hook.js';
4
+ export function useHostCapabilities() {
5
+ return useShell().hostCapabilities;
6
+ }
7
+ export class HostCapabilityUnavailableError extends Error {
8
+ capability;
9
+ code = 'SHELL_REACT_HOST_CAPABILITY_UNAVAILABLE';
10
+ constructor(capability) {
11
+ super(`Host capability '${capability}' is unavailable.`);
12
+ this.capability = capability;
13
+ this.name = 'HostCapabilityUnavailableError';
14
+ }
15
+ }
16
+ export function useHostDialog() {
17
+ const capabilities = useHostCapabilities();
18
+ const send = useSendIntent();
19
+ return useMemo(() => ({
20
+ supported: capabilities.actions.modal !== undefined,
21
+ open: (request) => {
22
+ if (capabilities.actions.modal === undefined)
23
+ return unsupported('actions.modal');
24
+ portable(request);
25
+ return send('actions.modal', request);
26
+ },
27
+ confirm: async (request) => {
28
+ if (capabilities.actions.modal === undefined)
29
+ return unsupported('actions.modal');
30
+ portable(request);
31
+ return (await send('actions.modal', request)).outcome === 'confirmed';
32
+ },
33
+ }), [capabilities, send]);
34
+ }
35
+ export function useNotify() {
36
+ const capabilities = useHostCapabilities();
37
+ const send = useSendIntent();
38
+ return useMemo(() => {
39
+ const notify = ((request) => {
40
+ if (capabilities.actions.notify === undefined)
41
+ return unsupported('actions.notify');
42
+ portable(request);
43
+ return send('actions.notify', request);
44
+ });
45
+ Object.defineProperty(notify, 'supported', {
46
+ enumerable: true,
47
+ value: capabilities.actions.notify !== undefined,
48
+ });
49
+ return notify;
50
+ }, [capabilities, send]);
51
+ }
52
+ export function useOpenView() {
53
+ const capabilities = useHostCapabilities();
54
+ const send = useSendIntent();
55
+ return useMemo(() => {
56
+ const open = ((request) => {
57
+ if (capabilities.navigation.openView === undefined)
58
+ return unsupported('view.open');
59
+ portable(request);
60
+ return send('view.open', request);
61
+ });
62
+ Object.defineProperty(open, 'supported', {
63
+ enumerable: true,
64
+ value: capabilities.navigation.openView !== undefined,
65
+ });
66
+ return open;
67
+ }, [capabilities, send]);
68
+ }
69
+ export function useExternalOpen() {
70
+ const capabilities = useHostCapabilities();
71
+ const send = useSendIntent();
72
+ return useMemo(() => {
73
+ const open = ((request) => {
74
+ if (capabilities.navigation.external === undefined)
75
+ return unsupported('browser.openExternal');
76
+ portable(request);
77
+ return send('browser.openExternal', request);
78
+ });
79
+ Object.defineProperty(open, 'supported', {
80
+ enumerable: true,
81
+ value: capabilities.navigation.external !== undefined,
82
+ });
83
+ return open;
84
+ }, [capabilities, send]);
85
+ }
86
+ export function useRequestAccess() {
87
+ const capabilities = useHostCapabilities();
88
+ const send = useSendIntent();
89
+ return useMemo(() => {
90
+ const request = ((input) => {
91
+ if (capabilities.access.request === undefined)
92
+ return unsupported('access.request');
93
+ portable(input);
94
+ return send('access.request', input);
95
+ });
96
+ Object.defineProperty(request, 'supported', {
97
+ enumerable: true,
98
+ value: capabilities.access.request !== undefined,
99
+ });
100
+ return request;
101
+ }, [capabilities, send]);
102
+ }
103
+ function unsupported(capability) {
104
+ return Promise.reject(new HostCapabilityUnavailableError(capability));
105
+ }
106
+ function portable(input) {
107
+ const seen = new WeakSet();
108
+ const visit = (value) => {
109
+ if (value === null || typeof value === 'string' || typeof value === 'boolean')
110
+ return;
111
+ if (typeof value === 'number' && Number.isFinite(value))
112
+ return;
113
+ if (typeof value !== 'object' || ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {
114
+ throw new TypeError('Host action payload must be serializable data.');
115
+ }
116
+ if (seen.has(value))
117
+ throw new TypeError('Host action payload cannot contain cycles.');
118
+ seen.add(value);
119
+ if (Array.isArray(value))
120
+ value.forEach(visit);
121
+ else
122
+ Object.values(value).forEach(visit);
123
+ };
124
+ visit(input);
125
+ }
@@ -0,0 +1,15 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ import type { HostDialogApi, NotifyApi, OpenViewApi, RequestAccessApi } from './actions.hook.js';
3
+ export declare function HostDialog(props: {
4
+ readonly children: (dialog: HostDialogApi) => ReactNode;
5
+ }): ReactElement;
6
+ export declare function Notify(props: {
7
+ readonly children: (notify: NotifyApi) => ReactNode;
8
+ }): ReactElement;
9
+ export declare function NestedView(props: {
10
+ readonly children: (open: OpenViewApi) => ReactNode;
11
+ }): ReactElement;
12
+ export declare function RequestAccess(props: {
13
+ readonly children: (request: RequestAccessApi) => ReactNode;
14
+ }): ReactElement;
15
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/host/components.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAIhG,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,SAAS,CAAA;CACxD,GAAG,YAAY,CAEf;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE;IAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,SAAS,CAAA;CACpD,GAAG,YAAY,CAEf;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,SAAS,CAAA;CACpD,GAAG,YAAY,CAEf;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,SAAS,CAAA;CAC5D,GAAG,YAAY,CAEf"}
@@ -0,0 +1,14 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useHostDialog, useNotify, useOpenView, useRequestAccess } from './actions.hook.js';
3
+ export function HostDialog(props) {
4
+ return _jsx(_Fragment, { children: props.children(useHostDialog()) });
5
+ }
6
+ export function Notify(props) {
7
+ return _jsx(_Fragment, { children: props.children(useNotify()) });
8
+ }
9
+ export function NestedView(props) {
10
+ return _jsx(_Fragment, { children: props.children(useOpenView()) });
11
+ }
12
+ export function RequestAccess(props) {
13
+ return _jsx(_Fragment, { children: props.children(useRequestAccess()) });
14
+ }
@@ -0,0 +1,5 @@
1
+ export { useExternalOpen, useHostCapabilities, useHostDialog, useNotify, useOpenView, useRequestAccess, } from './actions.hook.js';
2
+ export type { ExternalOpenApi, HostDialogApi, NotifyApi, OpenViewApi, RequestAccessApi, } from './actions.hook.js';
3
+ export { HostDialog, NestedView, Notify, RequestAccess } from './components.js';
4
+ export { HostCapabilityUnavailableError } from './actions.hook.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/host/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,WAAW,EACX,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { useExternalOpen, useHostCapabilities, useHostDialog, useNotify, useOpenView, useRequestAccess, } from './actions.hook.js';
2
+ export { HostDialog, NestedView, Notify, RequestAccess } from './components.js';
3
+ export { HostCapabilityUnavailableError } from './actions.hook.js';
package/dist/index.d.ts CHANGED
@@ -1,43 +1,32 @@
1
- /**
2
- * @astrale-os/shell-react — the React face of the shell (SHELL_REACT_API.md §0).
3
- * One package, one import surface (SPEC §4.2); the bounded-context directories are
4
- * the module structure, not subpaths. This public barrel composes the context
5
- * barrels. Settled naming (§0): useKernelClient = the raw handle (session);
6
- * useKernel() = the TYPED kernel (schema, no arg); useDomain(schema) = a typed
7
- * domain binding. `useNode`/`useChildren` are single overloaded symbols (untyped
8
- * floor + typed overloads) exported from the graph plane.
9
- */
10
- export { ShellProvider } from './session/index.js';
11
- export type { ShellError, ShellProviderProps } from './session/index.js';
12
- export { useConnection, useKernelClient, useKernelInstance, useShell } from './session/index.js';
13
- export type { KernelInstance } from './session/index.js';
1
+ /** @astrale-os/shell-react — curated React runtime over Shell and Kernel Client Store. */
2
+ export { ShellProvider, useConnection, useKernelClient, useKernelInstance, useShell, } from './session/index.js';
3
+ export type { KernelInstance, ShellError, ShellProviderProps } from './session/index.js';
14
4
  export { ActAs, useAuth, useCan, useSelf } from './auth/index.js';
15
- export type { ActAsProps } from './auth/index.js';
16
- export { useCall, useChildren, useGraph, useMove, useMutate, useNode, useQuery, useStream, } from './graph/index.js';
17
- export type { ChildrenOptions, ChildrenResult, GraphMemory, MoveAction, Node, NodeResult, QueryResult, ShapeInput, UseMutateOptions, } from './graph/index.js';
18
- export type { CallOptions, StreamHandle, StreamOptions } from './graph/index.js';
19
- export { useDomain, useFunction, useIn, useKernel, useMethod, useOut } from './schema/index.js';
20
- export type { FunctionOptions } from './schema/index.js';
21
- export type { MethodOptions } from './schema/index.js';
22
- export type { AutoMethodAction, BoundMethodAction, EndpointResult, FunctionNames, FunctionParams, FunctionResult, MethodIsStatic, MethodNames, MethodParams, MethodResult, TargetedMethodAction, TypedChildrenResult, TypedNodeResult, } from './schema/index.js';
23
- export { Link, NavScope, memoryAdapter, urlAdapter, useAncestors, useLocation, useNavScope, useNavigate, } from './navigation/index.js';
24
- export type { LinkProps, MissingPolicy, NavAdapter, NavLocation, NavScopeHandle, NavScopeProps, NavSnapshot, NavTarget, Navigate, SerializedLocation, } from './navigation/index.js';
5
+ export type { ActAsProps, PolicyObject } from './auth/index.js';
6
+ export { ClientError, NodeUnavailableError, ProtocolError, ResponseError, StaleRouteError, TransportError, isClientError, isNodeUnavailableError, useCall, useGraphStore, useQuery, useStream, } from './graph/index.js';
7
+ export type { CallOptions, GraphResource, GraphResourceState, GraphStore, QueryResourceOptions, StreamHandle, StreamOptions, } from './graph/index.js';
8
+ export { RelationUnavailableError, queryRefresh, useAction, useDomain, useDomains, useDynamicDomain, useDynamicObject, useKernel, useMutation, useObject, useRelation, } from './schema/index.js';
9
+ export type { ActionOptions, ActionRefresh, DomainAction, MutationOptions, QueryRefresh, RelationOptions, RelationResource, RelationUnavailable, RichReadOptions, } from './schema/index.js';
10
+ export { Link, NavigationScope, NavScope, NodeLink, pathParam, ViewLink, defineNavigation, enumParam, location, memoryAdapter, urlAdapter, useAncestors, useLocation, useNavigate, useNavigation, useNavScope, } from './navigation/index.js';
11
+ export type { LinkProps, LocationDefinition, MissingPolicy, NavAdapter, NavLocation, NavScopeHandle, NavScopeProps, NavSnapshot, NavTarget, NavigationDefinition, NavigationParam, NavigationParams, NavigationRoutes, NavigationTarget, NodeLinkProps, Navigate, SerializedLocation, ViewLinkProps, } from './navigation/index.js';
25
12
  export { SelectionScope, useSelection } from './selection/index.js';
26
13
  export type { Selection, SelectionScopeProps } from './selection/index.js';
27
- export { useCloseGuard, useTargetNode, useViewsFor, useWindow, useWindowList, useWindows, ViewHost, ViewStage, } from './window/index.js';
28
- export type { CloseGuard, CloseVerdict, ViewDescriptor, ViewHostProps, ViewSource, ViewHostHandle, ViewsForResult, WindowListEntry, WindowState, WindowView, } from './window/index.js';
14
+ export { ViewHost, ViewStage, useCloseGuard, useTargetNode, useTargetPath, useViewsFor, useWindow, useWindowList, useWindows, } from './window/index.js';
15
+ export type { CloseGuard, CloseVerdict, ResolvedView, SandboxPolicy, ViewHostHandle, ViewHostProps, ViewsForResult, WindowListEntry, WindowState, WindowView, } from './window/index.js';
16
+ export { HostDialog, NestedView, Notify, RequestAccess, useExternalOpen, useHostCapabilities, useHostDialog, useNotify, useOpenView, useRequestAccess, } from './host/index.js';
17
+ export type { ExternalOpenApi, HostDialogApi, NotifyApi, OpenViewApi, RequestAccessApi, } from './host/index.js';
18
+ export { HostCapabilityUnavailableError } from './host/index.js';
29
19
  export { useEmitIntent, useIntent, useSendIntent } from './intents/index.js';
30
20
  export type { EmitIntent, IntentCtx, IntentPayload, IntentReply, SendIntent, } from './intents/index.js';
31
- export { AppHost, AppLogo, useApps, useCurrentSpace, useOpenApp, useRoles, useDomains, useSpace, useSpaces, useUser, } from './application/index.js';
32
- export type { AppHostFallbackState, AppHostProps, AppLogoProps, AppsResult, CurrentSpaceResult, RolesResult, DomainsResult, SpaceResult, SpacesResult, } from './application/index.js';
33
- export type { ApplicationNode, AppSession, DomainSearchResult, RoleNode, SpaceNode, UserNode, } from '@astrale-os/shell';
34
- export type { Action, ReadState, ReadOptions, Windowed } from './graph/index.js';
35
- export * from './graph/guards.error.js';
36
- export { DESCRIPTION_KEY, NAME_KEY, STATUS_KEY, descriptionOf, nameOf, normalizeRef, statusOf, } from '@astrale-os/kernel-client';
37
- export type { AnyBoundNode, BoundNode, CreatableClassNames, CreateProps, CredentialInput, DefOf, EdgeNames, EndpointsOf, FnMap, NamedNodeLike, NodeRefInput, SchemaBoundView, TypeNames, } from '@astrale-os/kernel-client';
38
- export type { EdgeIdentity, GatherBuilder, OrderInput, PatchBuilder, PatchInput, PathLike, Properties, QueryASTInput, QuerySource, } from '@astrale-os/kernel-client/graph';
39
- export type { AuthApi, Perms } from '@astrale-os/kernel-client/auth';
40
- export type { Schema } from '@astrale-os/kernel-dsl';
41
- export type { CloseResult, KernelClient, MountCredential, Shell, ShellConfig, Window, } from '@astrale-os/shell';
42
- export type { IntentRegistry } from '@astrale-os/shell';
21
+ export { Can, ConnectionBoundary, CredentialBoundary, defaultViewError, defaultViewLoading, GraphBoundary, mountDomainFrontend, ViewApp, ViewBoundary, ViewErrorBoundary, } from './components/index.js';
22
+ export type { MountedDomainFrontend, MountDomainFrontendOptions, ViewErrorBoundaryProps, } from './components/index.js';
23
+ export { AppHost, AppLogo, useApps, useCurrentSpace, useInstalledDomains, useOpenApp, useSpace, useSpaces, useUser, } from './application/index.js';
24
+ export type { AppHostFallbackState, AppHostProps, AppLogoProps, AppsResult, CurrentSpaceResult, DomainsResult, SpaceResult, SpacesResult, } from './application/index.js';
25
+ export { NodeId } from '@astrale-os/sdk/graph/node';
26
+ export { NodePath, Path } from '@astrale-os/sdk/graph/path';
27
+ export type { Node } from '@astrale-os/sdk/graph/node';
28
+ export type { PathLike } from '@astrale-os/sdk/graph/path';
29
+ export type { AuthApi, Identity, PolicyDecisionInput } from '@astrale-os/kernel-client/auth';
30
+ export type { DomainBinding, DomainInvokeOptions } from '@astrale-os/shell';
31
+ export type { ApplicationNode, AppSession, CloseResult, CredentialSnapshot, DomainSearchResult, HostCapabilities, IntentRegistry, KernelClient, MountCredential, NodeTarget, Shell, ShellConfig, SpaceNode, UserNode, ViewLocation, ViewPresentation, ViewPresentationRequest, Window, } from '@astrale-os/shell';
43
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAChG,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGxD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAKjD,OAAO,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,GACV,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,UAAU,EACV,IAAI,EACJ,UAAU,EACV,WAAW,EACX,UAAU,EACV,gBAAgB,GACjB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAGhF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/F,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,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,CAAA;AAG9B,OAAO,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,OAAO,GACR,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EACV,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAC3D,YAAY,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AACtD,YAAY,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAC5F,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAG3E,YAAY,EACV,eAAe,EACf,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,UAAU,EACV,KAAK,EACL,WAAW,EACX,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,MAAM,GACP,MAAM,mBAAmB,CAAA"}
package/dist/index.js CHANGED
@@ -1,34 +1,23 @@
1
- /**
2
- * @astrale-os/shell-react — the React face of the shell (SHELL_REACT_API.md §0).
3
- * One package, one import surface (SPEC §4.2); the bounded-context directories are
4
- * the module structure, not subpaths. This public barrel composes the context
5
- * barrels. Settled naming (§0): useKernelClient = the raw handle (session);
6
- * useKernel() = the TYPED kernel (schema, no arg); useDomain(schema) = a typed
7
- * domain binding. `useNode`/`useChildren` are single overloaded symbols (untyped
8
- * floor + typed overloads) exported from the graph plane.
9
- */
10
- // ─── session (§2 provider + §3) ──────────────────────────────────────────────
11
- export { ShellProvider } from './session/index.js';
12
- export { useConnection, useKernelClient, useKernelInstance, useShell } from './session/index.js';
13
- // ─── auth (§4) ───────────────────────────────────────────────────────────────
1
+ /** @astrale-os/shell-react — curated React runtime over Shell and Kernel Client Store. */
2
+ // Root/provider and authenticated caller.
3
+ export { ShellProvider, useConnection, useKernelClient, useKernelInstance, useShell, } from './session/index.js';
14
4
  export { ActAs, useAuth, useCan, useSelf } from './auth/index.js';
15
- // ─── graph — the untyped floor + writes + dispatch (§5, §7) ──────────────────
16
- // `useNode`/`useChildren` are single symbols merging the untyped floor + typed
17
- // overloads.
18
- export { useCall, useChildren, useGraph, useMove, useMutate, useNode, useQuery, useStream, } from './graph/index.js';
19
- // ─── schema — the typed substrate (§6) ───────────────────────────────────────
20
- export { useDomain, useFunction, useIn, useKernel, useMethod, useOut } from './schema/index.js';
21
- // ─── navigation (§8) ─────────────────────────────────────────────────────────
22
- export { Link, NavScope, memoryAdapter, urlAdapter, useAncestors, useLocation, useNavScope, useNavigate, } from './navigation/index.js';
23
- // ─── selection (§9) ──────────────────────────────────────────────────────────
5
+ // One Store path and named SDK definitions. Raw Query/Mutation builders are intentionally absent.
6
+ export { ClientError, NodeUnavailableError, ProtocolError, ResponseError, StaleRouteError, TransportError, isClientError, isNodeUnavailableError, useCall, useGraphStore, useQuery, useStream, } from './graph/index.js';
7
+ // Rich exact Domain bindings.
8
+ export { RelationUnavailableError, queryRefresh, useAction, useDomain, useDomains, useDynamicDomain, useDynamicObject, useKernel, useMutation, useObject, useRelation, } from './schema/index.js';
9
+ // Typed navigation and selection.
10
+ export { Link, NavigationScope, NavScope, NodeLink, pathParam, ViewLink, defineNavigation, enumParam, location, memoryAdapter, urlAdapter, useAncestors, useLocation, useNavigate, useNavigation, useNavScope, } from './navigation/index.js';
24
11
  export { SelectionScope, useSelection } from './selection/index.js';
25
- // ─── window (§10) ────────────────────────────────────────────────────────────
26
- export { useCloseGuard, useTargetNode, useViewsFor, useWindow, useWindowList, useWindows, ViewHost, ViewStage, } from './window/index.js';
27
- // ─── intents (§11) ───────────────────────────────────────────────────────────
12
+ // View/window lifecycle and host effects.
13
+ export { ViewHost, ViewStage, useCloseGuard, useTargetNode, useTargetPath, useViewsFor, useWindow, useWindowList, useWindows, } from './window/index.js';
14
+ export { HostDialog, NestedView, Notify, RequestAccess, useExternalOpen, useHostCapabilities, useHostDialog, useNotify, useOpenView, useRequestAccess, } from './host/index.js';
15
+ export { HostCapabilityUnavailableError } from './host/index.js';
28
16
  export { useEmitIntent, useIntent, useSendIntent } from './intents/index.js';
29
- // ─── application — the OS plane (§12) ────────────────────────────────────────
30
- export { AppHost, AppLogo, useApps, useCurrentSpace, useOpenApp, useRoles, useDomains, useSpace, useSpaces, useUser, } from './application/index.js';
31
- // ─── error taxonomy (§1.4) — guards + classes, re-exported from kernel-client ─
32
- export * from './graph/guards.error.js';
33
- // ─── re-exported kernel-client types (one import surface, §0 preamble) ───────
34
- export { DESCRIPTION_KEY, NAME_KEY, STATUS_KEY, descriptionOf, nameOf, normalizeRef, statusOf, } from '@astrale-os/kernel-client';
17
+ // Headless composition kit.
18
+ export { Can, ConnectionBoundary, CredentialBoundary, defaultViewError, defaultViewLoading, GraphBoundary, mountDomainFrontend, ViewApp, ViewBoundary, ViewErrorBoundary, } from './components/index.js';
19
+ // Shell application conveniences.
20
+ export { AppHost, AppLogo, useApps, useCurrentSpace, useInstalledDomains, useOpenApp, useSpace, useSpaces, useUser, } from './application/index.js';
21
+ // Canonical identity carriers used by View props and rich hooks.
22
+ export { NodeId } from '@astrale-os/sdk/graph/node';
23
+ export { NodePath, Path } from '@astrale-os/sdk/graph/path';
@@ -3,31 +3,19 @@
3
3
  * a registry entry, the wire constants, and `intentMessage` — the single builder
4
4
  * both directions (send + reply) share.
5
5
  */
6
- import type { IntentMessage, IntentRegistry } from '@astrale-os/shell';
7
- /**
8
- * Payload of a registry entry: the `{ payload }` field for the wrapped shape,
9
- * else the whole entry (a legacy bare-payload augmentation). Robust to both, so
10
- * bare augmentations keep compiling unchanged.
11
- */
12
- export type IntentPayload<K extends keyof IntentRegistry> = IntentRegistry[K] extends {
13
- payload: infer P;
14
- } ? P : IntentRegistry[K];
15
- /**
16
- * Reply of a registry entry: the `{ reply }` field when declared, else `void`
17
- * (bare-payload and today's reply-less entries — forward-compatible with G4).
18
- */
19
- export type IntentReply<K extends keyof IntentRegistry> = IntentRegistry[K] extends {
20
- reply: infer R;
21
- } ? R : void;
6
+ import type { IntentMessage, IntentRegistry, PayloadOf, ReplyOf } from '@astrale-os/shell';
7
+ /** Payload declared by the canonical Shell intent registry entry. */
8
+ export type IntentPayload<K extends keyof IntentRegistry> = PayloadOf<K>;
9
+ /** Reply declared by the canonical Shell intent registry entry. */
10
+ export type IntentReply<K extends keyof IntentRegistry> = ReplyOf<K>;
22
11
  /** Sentinel `ctx.sender` carries for a parent-delivered intent (the shell stamps it). */
23
12
  export declare const PARENT_SENDER = "<parent>";
24
13
  /** Correlated-reply channel name (the shell's fire-and-forget reply protocol). */
25
14
  export declare const INTENT_REPLY = "intentReply";
26
15
  export declare const NOOP: () => void;
27
16
  /**
28
- * Build an intent wire message. Bare-vs-wrapped payload variance (§11 pin) is
29
- * erased on the wire — the receiver reads `envelope.payload` verbatim; the cast
30
- * bridges the correlated name↔payload the union type cannot express.
17
+ * Build an intent wire message. The cast bridges the correlated name↔payload
18
+ * relation that the generic union type cannot express.
31
19
  */
32
20
  export declare function intentMessage(name: string, payload: unknown, correlationId?: string): IntentMessage;
33
21
  //# sourceMappingURL=envelope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/intents/envelope.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEtE;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,cAAc,IAA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aAAa,CAMf"}
@@ -6,9 +6,8 @@ const SELF_SENDER = 'self';
6
6
  export const INTENT_REPLY = 'intentReply';
7
7
  export const NOOP = () => { };
8
8
  /**
9
- * Build an intent wire message. Bare-vs-wrapped payload variance (§11 pin) is
10
- * erased on the wire — the receiver reads `envelope.payload` verbatim; the cast
11
- * bridges the correlated name↔payload the union type cannot express.
9
+ * Build an intent wire message. The cast bridges the correlated name↔payload
10
+ * relation that the generic union type cannot express.
12
11
  */
13
12
  export function intentMessage(name, payload, correlationId) {
14
13
  return {
@@ -1,12 +1,10 @@
1
- import type { IntentRegistry } from '@astrale-os/shell';
1
+ import type { IntentRegistry, RequestIntentOptions } from '@astrale-os/shell';
2
2
  import type { IntentPayload, IntentReply } from './envelope.js';
3
- /** The typed sender returned by {@link useSendIntent}. */
3
+ /** Typed request sender backed exclusively by Shell's core correlation implementation. */
4
4
  export interface SendIntent {
5
- <K extends keyof IntentRegistry>(name: K, payload: IntentPayload<K>,
6
- /** `to`: `'parent'` (reserved) or a child windowId. Default: the parent, if any. */
7
- opts?: {
8
- to?: 'parent' | string;
9
- }): Promise<IntentReply<K> | void>;
5
+ <K extends keyof IntentRegistry>(name: K, payload: IntentPayload<K>, options?: RequestIntentOptions & {
6
+ readonly to?: 'parent' | string;
7
+ }): Promise<IntentReply<K>>;
10
8
  }
11
9
  export declare function useSendIntent(): SendIntent;
12
10
  //# sourceMappingURL=send-intent.hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"send-intent.hook.d.ts","sourceRoot":"","sources":["../../src/intents/send-intent.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAWtE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAM/D,0DAA0D;AAC1D,MAAM,WAAW,UAAU;IACzB,CAAC,CAAC,SAAS,MAAM,cAAc,EAC7B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IACzB,oFAAoF;IACpF,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;KAAE,GAChC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;CAClC;AAED,wBAAgB,aAAa,IAAI,UAAU,CAiF1C"}
1
+ {"version":3,"file":"send-intent.hook.d.ts","sourceRoot":"","sources":["../../src/intents/send-intent.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAK7E,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAK/D,0FAA0F;AAC1F,MAAM,WAAW,UAAU;IACzB,CAAC,CAAC,SAAS,MAAM,cAAc,EAC7B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EACzB,OAAO,CAAC,EAAE,oBAAoB,GAAG;QAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;KAAE,GACnE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;CAC3B;AAED,wBAAgB,aAAa,IAAI,UAAU,CAkC1C"}
@@ -1,87 +1,29 @@
1
- /**
2
- * useSendIntent (API §11) — a stable typed sender. Each call attaches a
3
- * `correlationId`, subscribes for the matching `intentReply` on the origin channel
4
- * BEFORE sending, then resolves with the reply's result. The promise also resolves
5
- * (`void`) if the target window closes or this hook unmounts — a pending reply
6
- * never strands.
7
- */
1
+ import { requestChildIntent, requestIntent } from '@astrale-os/shell';
8
2
  import { useCallback, useEffect, useRef } from 'react';
9
3
  import { useShell } from '../session/shell.hook.js';
10
- import { INTENT_REPLY, NOOP, intentMessage } from './envelope.js';
11
4
  import { resolveIntentTarget } from './resolve-intent-target.js';
12
5
  export function useSendIntent() {
13
6
  const shell = useShell();
14
- // Unmount settlers for in-flight sends, so a pending reply resolves on teardown.
15
- const pendingRef = useRef(new Set());
7
+ const lifetime = useRef(new AbortController());
16
8
  useEffect(() => {
17
- const pending = pendingRef.current;
18
- return () => {
19
- for (const settle of pending)
20
- settle();
21
- pending.clear();
22
- };
9
+ const controller = lifetime.current.signal.aborted ? new AbortController() : lifetime.current;
10
+ lifetime.current = controller;
11
+ return () => controller.abort(new Error('Intent requester unmounted'));
23
12
  }, []);
24
- return useCallback((name, payload, opts) => {
25
- const target = resolveIntentTarget(shell, opts?.to);
13
+ return useCallback((name, payload, options) => {
14
+ const target = resolveIntentTarget(shell, options?.to);
26
15
  if (target.kind === 'invalid') {
27
16
  return Promise.reject(new Error(`useSendIntent: ${target.reason}`));
28
17
  }
29
- const correlationId = crypto.randomUUID();
30
- const message = intentMessage(name, payload, correlationId);
31
- const pending = pendingRef.current;
32
- return new Promise((resolve, reject) => {
33
- let done = false;
34
- let offReply = NOOP;
35
- let offClose = NOOP;
36
- const onUnmount = () => settle(undefined);
37
- function settle(value) {
38
- if (done)
39
- return;
40
- done = true;
41
- offReply();
42
- offClose();
43
- pending.delete(onUnmount);
44
- resolve(value);
45
- }
46
- function fail(error) {
47
- if (done)
48
- return;
49
- done = true;
50
- offReply();
51
- offClose();
52
- pending.delete(onUnmount);
53
- reject(error);
54
- }
55
- const onReply = (m) => {
56
- if (m.envelope.name !== INTENT_REPLY)
57
- return;
58
- const reply = m.envelope.payload;
59
- if (reply.correlationId !== correlationId)
60
- return;
61
- if (reply.error) {
62
- fail(new Error(reply.error.message));
63
- return;
64
- }
65
- settle(reply.result);
66
- };
67
- pending.add(onUnmount);
68
- if (target.kind === 'parent') {
69
- const parent = shell.parent;
70
- offReply = parent.on('intent', onReply);
71
- parent.send(message);
72
- }
73
- else {
74
- const { windowId } = target;
75
- offReply = shell.children.on('intent', (wid, m) => {
76
- if (wid === windowId)
77
- onReply(m);
78
- });
79
- offClose = shell.children.onClose((wid) => {
80
- if (wid === windowId)
81
- settle(undefined);
82
- });
83
- shell.children.send(windowId, message);
84
- }
85
- });
18
+ const signal = options?.signal === undefined
19
+ ? lifetime.current.signal
20
+ : AbortSignal.any([lifetime.current.signal, options.signal]);
21
+ const requestOptions = {
22
+ signal,
23
+ ...(options?.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs }),
24
+ };
25
+ return target.kind === 'parent'
26
+ ? requestIntent(shell.parent, name, payload, requestOptions)
27
+ : requestChildIntent(shell.children, target.windowId, name, payload, requestOptions);
86
28
  }, [shell]);
87
29
  }
@@ -5,10 +5,15 @@
5
5
  */
6
6
  import type { SerializedLocation } from '../history.js';
7
7
  export interface NavAdapter {
8
+ readonly kind: 'memory' | 'browser';
8
9
  read(): SerializedLocation | null;
9
10
  write(loc: SerializedLocation, opts: {
10
11
  replace: boolean;
11
12
  }): void;
13
+ /** Remove only this adapter's owned projection when no history entry survives. */
14
+ clear(opts: {
15
+ replace: boolean;
16
+ }): void;
12
17
  subscribe(onExternalChange: () => void): () => void;
13
18
  href?(loc: SerializedLocation): string;
14
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/navigation/adapters/adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,IAAI,IAAI,kBAAkB,GAAG,IAAI,CAAA;IACjC,KAAK,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;IAChE,SAAS,CAAC,gBAAgB,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;IACnD,IAAI,CAAC,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAAA;CACvC"}
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/navigation/adapters/adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAA;IACnC,IAAI,IAAI,kBAAkB,GAAG,IAAI,CAAA;IACjC,KAAK,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;IAChE,kFAAkF;IAClF,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;IACvC,SAAS,CAAC,gBAAgB,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;IACnD,IAAI,CAAC,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAAA;CACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"memory.adapter.d.ts","sourceRoot":"","sources":["../../../src/navigation/adapters/memory.adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAatE"}
1
+ {"version":3,"file":"memory.adapter.d.ts","sourceRoot":"","sources":["../../../src/navigation/adapters/memory.adapter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,UAAU,CAiBtE"}
@@ -3,10 +3,14 @@ export function memoryAdapter(initial) {
3
3
  let current = initial ?? null;
4
4
  const listeners = new Set();
5
5
  return {
6
+ kind: 'memory',
6
7
  read: () => current,
7
8
  write: (loc) => {
8
9
  current = loc;
9
10
  },
11
+ clear: () => {
12
+ current = null;
13
+ },
10
14
  subscribe: (cb) => {
11
15
  listeners.add(cb);
12
16
  return () => listeners.delete(cb);
@@ -1 +1 @@
1
- {"version":3,"file":"url.adapter.d.ts","sourceRoot":"","sources":["../../../src/navigation/adapters/url.adapter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAI9C,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAiDhE"}
1
+ {"version":3,"file":"url.adapter.d.ts","sourceRoot":"","sources":["../../../src/navigation/adapters/url.adapter.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAK9C,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAiFhE"}