@astrale-os/shell-react 0.2.9 → 0.2.10-beta.3

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 (335) hide show
  1. package/dist/application/apps/app-host.d.ts +4 -15
  2. package/dist/application/apps/app-host.d.ts.map +1 -1
  3. package/dist/application/apps/app-host.js +1 -1
  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/astrale.d.ts +14 -0
  39. package/dist/components/astrale.d.ts.map +1 -0
  40. package/dist/components/astrale.js +12 -0
  41. package/dist/components/boundaries.d.ts +47 -0
  42. package/dist/components/boundaries.d.ts.map +1 -0
  43. package/dist/components/boundaries.js +55 -0
  44. package/dist/components/can.d.ts +11 -0
  45. package/dist/components/can.d.ts.map +1 -0
  46. package/dist/components/can.js +5 -0
  47. package/dist/components/index.d.ts +6 -0
  48. package/dist/components/index.d.ts.map +1 -0
  49. package/dist/components/index.js +3 -0
  50. package/dist/graph/call/call.hook.d.ts +8 -18
  51. package/dist/graph/call/call.hook.d.ts.map +1 -1
  52. package/dist/graph/call/call.hook.js +7 -13
  53. package/dist/graph/call/stream.hook.d.ts +12 -20
  54. package/dist/graph/call/stream.hook.d.ts.map +1 -1
  55. package/dist/graph/call/stream.hook.js +55 -111
  56. package/dist/graph/graph.context.d.ts +4 -3
  57. package/dist/graph/graph.context.d.ts.map +1 -1
  58. package/dist/graph/graph.context.js +2 -8
  59. package/dist/graph/guards.error.d.ts +7 -8
  60. package/dist/graph/guards.error.d.ts.map +1 -1
  61. package/dist/graph/guards.error.js +11 -7
  62. package/dist/graph/index.d.ts +8 -16
  63. package/dist/graph/index.d.ts.map +1 -1
  64. package/dist/graph/index.js +3 -7
  65. package/dist/graph/memory/read/envelope.d.ts +22 -54
  66. package/dist/graph/memory/read/envelope.d.ts.map +1 -1
  67. package/dist/graph/memory/read/envelope.js +26 -20
  68. package/dist/graph/memory/read/idle.d.ts +1 -15
  69. package/dist/graph/memory/read/idle.d.ts.map +1 -1
  70. package/dist/graph/memory/read/idle.js +4 -13
  71. package/dist/graph/query-definition.hook.d.ts +11 -0
  72. package/dist/graph/query-definition.hook.d.ts.map +1 -0
  73. package/dist/graph/query-definition.hook.js +205 -0
  74. package/dist/graph/resource.d.ts +34 -0
  75. package/dist/graph/resource.d.ts.map +1 -0
  76. package/dist/graph/resource.js +244 -0
  77. package/dist/graph/store.d.ts +25 -0
  78. package/dist/graph/store.d.ts.map +1 -0
  79. package/dist/graph/store.js +69 -0
  80. package/dist/host/actions.hook.d.ts +34 -0
  81. package/dist/host/actions.hook.d.ts.map +1 -0
  82. package/dist/host/actions.hook.js +125 -0
  83. package/dist/host/components.d.ts +15 -0
  84. package/dist/host/components.d.ts.map +1 -0
  85. package/dist/host/components.js +14 -0
  86. package/dist/host/index.d.ts +5 -0
  87. package/dist/host/index.d.ts.map +1 -0
  88. package/dist/host/index.js +3 -0
  89. package/dist/index.d.ts +26 -37
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +20 -31
  92. package/dist/intents/envelope.d.ts +7 -19
  93. package/dist/intents/envelope.d.ts.map +1 -1
  94. package/dist/intents/envelope.js +2 -3
  95. package/dist/intents/send-intent.hook.d.ts +5 -7
  96. package/dist/intents/send-intent.hook.d.ts.map +1 -1
  97. package/dist/intents/send-intent.hook.js +17 -75
  98. package/dist/navigation/adapters/adapter.d.ts +5 -0
  99. package/dist/navigation/adapters/adapter.d.ts.map +1 -1
  100. package/dist/navigation/adapters/memory.adapter.d.ts.map +1 -1
  101. package/dist/navigation/adapters/memory.adapter.js +4 -0
  102. package/dist/navigation/adapters/url.adapter.d.ts.map +1 -1
  103. package/dist/navigation/adapters/url.adapter.js +57 -10
  104. package/dist/navigation/codec.d.ts +60 -0
  105. package/dist/navigation/codec.d.ts.map +1 -0
  106. package/dist/navigation/codec.js +121 -0
  107. package/dist/navigation/history.d.ts +11 -9
  108. package/dist/navigation/history.d.ts.map +1 -1
  109. package/dist/navigation/history.js +6 -8
  110. package/dist/navigation/hooks/ancestors.hook.d.ts +5 -7
  111. package/dist/navigation/hooks/ancestors.hook.d.ts.map +1 -1
  112. package/dist/navigation/hooks/ancestors.hook.js +7 -51
  113. package/dist/navigation/hooks/location.hook.d.ts.map +1 -1
  114. package/dist/navigation/hooks/location.hook.js +4 -6
  115. package/dist/navigation/hooks/scope.hook.d.ts.map +1 -1
  116. package/dist/navigation/hooks/scope.hook.js +4 -6
  117. package/dist/navigation/index.d.ts +4 -2
  118. package/dist/navigation/index.d.ts.map +1 -1
  119. package/dist/navigation/index.js +2 -1
  120. package/dist/navigation/link.d.ts +12 -0
  121. package/dist/navigation/link.d.ts.map +1 -1
  122. package/dist/navigation/link.js +13 -2
  123. package/dist/navigation/location.d.ts +13 -40
  124. package/dist/navigation/location.d.ts.map +1 -1
  125. package/dist/navigation/location.js +14 -76
  126. package/dist/navigation/scope.context.d.ts +17 -26
  127. package/dist/navigation/scope.context.d.ts.map +1 -1
  128. package/dist/navigation/scope.context.js +140 -108
  129. package/dist/navigation/snapshot.d.ts +14 -19
  130. package/dist/navigation/snapshot.d.ts.map +1 -1
  131. package/dist/navigation/snapshot.js +48 -44
  132. package/dist/schema/action.hook.d.ts +44 -0
  133. package/dist/schema/action.hook.d.ts.map +1 -0
  134. package/dist/schema/action.hook.js +72 -0
  135. package/dist/schema/domain.hook.d.ts +12 -7
  136. package/dist/schema/domain.hook.d.ts.map +1 -1
  137. package/dist/schema/domain.hook.js +101 -4
  138. package/dist/schema/index.d.ts +9 -8
  139. package/dist/schema/index.d.ts.map +1 -1
  140. package/dist/schema/index.js +5 -7
  141. package/dist/schema/kernel.hook.d.ts +4 -9
  142. package/dist/schema/kernel.hook.d.ts.map +1 -1
  143. package/dist/schema/kernel.hook.js +4 -6
  144. package/dist/schema/mutation.hook.d.ts +9 -0
  145. package/dist/schema/mutation.hook.d.ts.map +1 -0
  146. package/dist/schema/mutation.hook.js +41 -0
  147. package/dist/schema/object.hook.d.ts +16 -0
  148. package/dist/schema/object.hook.d.ts.map +1 -0
  149. package/dist/schema/object.hook.js +46 -0
  150. package/dist/schema/relation.hook.d.ts +46 -0
  151. package/dist/schema/relation.hook.d.ts.map +1 -0
  152. package/dist/schema/relation.hook.js +136 -0
  153. package/dist/selection/live.d.ts +9 -17
  154. package/dist/selection/live.d.ts.map +1 -1
  155. package/dist/selection/live.js +65 -112
  156. package/dist/selection/scope.context.js +5 -4
  157. package/dist/session/boot/boot.d.ts +1 -13
  158. package/dist/session/boot/boot.d.ts.map +1 -1
  159. package/dist/session/boot/boot.js +9 -27
  160. package/dist/session/index.d.ts +1 -0
  161. package/dist/session/index.d.ts.map +1 -1
  162. package/dist/session/kernel-instance.hook.d.ts +1 -4
  163. package/dist/session/kernel-instance.hook.d.ts.map +1 -1
  164. package/dist/session/kernel-instance.hook.js +1 -5
  165. package/dist/session/provider.d.ts +9 -23
  166. package/dist/session/provider.d.ts.map +1 -1
  167. package/dist/session/provider.js +29 -75
  168. package/dist/session/session.context.d.ts +5 -0
  169. package/dist/session/session.context.d.ts.map +1 -1
  170. package/dist/window/adopt.d.ts +0 -1
  171. package/dist/window/adopt.d.ts.map +1 -1
  172. package/dist/window/hooks/target-node.hook.d.ts +10 -6
  173. package/dist/window/hooks/target-node.hook.d.ts.map +1 -1
  174. package/dist/window/hooks/target-node.hook.js +14 -72
  175. package/dist/window/hooks/views-for.hook.d.ts +4 -3
  176. package/dist/window/hooks/views-for.hook.d.ts.map +1 -1
  177. package/dist/window/hooks/views-for.hook.js +6 -22
  178. package/dist/window/hooks/windows.hook.d.ts.map +1 -1
  179. package/dist/window/hooks/windows.hook.js +3 -4
  180. package/dist/window/host.d.ts +9 -11
  181. package/dist/window/host.d.ts.map +1 -1
  182. package/dist/window/host.js +26 -62
  183. package/dist/window/hub.d.ts +2 -0
  184. package/dist/window/hub.d.ts.map +1 -1
  185. package/dist/window/hub.js +33 -0
  186. package/dist/window/index.d.ts +2 -2
  187. package/dist/window/index.d.ts.map +1 -1
  188. package/dist/window/index.js +2 -2
  189. package/dist/window/lifecycle/mount.d.ts +5 -44
  190. package/dist/window/lifecycle/mount.d.ts.map +1 -1
  191. package/dist/window/lifecycle/mount.js +14 -120
  192. package/dist/window/lifecycle/states.d.ts +0 -5
  193. package/dist/window/lifecycle/states.d.ts.map +1 -1
  194. package/package.json +20 -8
  195. package/src/application/apps/app-host.tsx +11 -15
  196. package/src/application/apps/apps.hook.ts +13 -6
  197. package/src/application/apps/domains.hook.ts +1 -1
  198. package/src/application/apps/open-app.hook.ts +3 -4
  199. package/src/application/index.ts +4 -6
  200. package/src/application/spaces/space.hook.ts +5 -6
  201. package/src/application/spaces/spaces.hook.ts +14 -9
  202. package/src/auth/act-as.context.tsx +37 -91
  203. package/src/auth/auth.hook.ts +2 -30
  204. package/src/auth/can.hook.ts +44 -135
  205. package/src/auth/index.ts +1 -0
  206. package/src/auth/self.hook.ts +2 -9
  207. package/src/auth/session-kernel.ts +6 -16
  208. package/src/components/astrale.tsx +40 -0
  209. package/src/components/boundaries.tsx +113 -0
  210. package/src/components/can.tsx +16 -0
  211. package/src/components/index.ts +13 -0
  212. package/src/graph/call/call.hook.ts +22 -27
  213. package/src/graph/call/stream.hook.ts +66 -143
  214. package/src/graph/graph.context.ts +6 -11
  215. package/src/graph/guards.error.ts +17 -55
  216. package/src/graph/index.ts +23 -17
  217. package/src/graph/memory/read/envelope.ts +40 -65
  218. package/src/graph/memory/read/idle.ts +5 -18
  219. package/src/graph/query-definition.hook.ts +270 -0
  220. package/src/graph/resource.ts +358 -0
  221. package/src/graph/store.ts +97 -0
  222. package/src/host/actions.hook.ts +165 -0
  223. package/src/host/components.tsx +29 -0
  224. package/src/host/index.ts +17 -0
  225. package/src/index.ts +131 -124
  226. package/src/intents/envelope.ts +7 -23
  227. package/src/intents/send-intent.hook.ts +24 -79
  228. package/src/navigation/adapters/adapter.ts +3 -0
  229. package/src/navigation/adapters/memory.adapter.ts +4 -0
  230. package/src/navigation/adapters/url.adapter.ts +48 -8
  231. package/src/navigation/codec.ts +190 -0
  232. package/src/navigation/history.ts +20 -11
  233. package/src/navigation/hooks/ancestors.hook.ts +10 -60
  234. package/src/navigation/hooks/location.hook.ts +4 -6
  235. package/src/navigation/hooks/scope.hook.ts +4 -6
  236. package/src/navigation/index.ts +18 -2
  237. package/src/navigation/link.tsx +27 -2
  238. package/src/navigation/location.ts +26 -93
  239. package/src/navigation/scope.context.tsx +151 -136
  240. package/src/navigation/snapshot.ts +69 -50
  241. package/src/schema/action.hook.ts +146 -0
  242. package/src/schema/domain.hook.ts +127 -11
  243. package/src/schema/index.ts +9 -30
  244. package/src/schema/kernel.hook.ts +6 -13
  245. package/src/schema/mutation.hook.ts +63 -0
  246. package/src/schema/object.hook.ts +85 -0
  247. package/src/schema/relation.hook.ts +253 -0
  248. package/src/selection/live.ts +75 -125
  249. package/src/selection/scope.context.tsx +4 -4
  250. package/src/session/boot/boot.ts +8 -33
  251. package/src/session/index.ts +1 -0
  252. package/src/session/kernel-instance.hook.ts +2 -11
  253. package/src/session/provider.tsx +34 -103
  254. package/src/session/session.context.ts +6 -0
  255. package/src/window/adopt.ts +0 -1
  256. package/src/window/hooks/target-node.hook.ts +20 -85
  257. package/src/window/hooks/views-for.hook.ts +12 -25
  258. package/src/window/hooks/windows.hook.ts +3 -4
  259. package/src/window/host.tsx +35 -77
  260. package/src/window/hub.ts +33 -0
  261. package/src/window/index.ts +3 -3
  262. package/src/window/lifecycle/mount.ts +15 -160
  263. package/src/window/lifecycle/states.ts +1 -5
  264. package/dist/application/roles.hook.d.ts +0 -7
  265. package/dist/application/roles.hook.d.ts.map +0 -1
  266. package/dist/application/roles.hook.js +0 -23
  267. package/dist/graph/memory/base.d.ts +0 -21
  268. package/dist/graph/memory/base.d.ts.map +0 -1
  269. package/dist/graph/memory/base.js +0 -33
  270. package/dist/graph/memory/read/read.d.ts +0 -9
  271. package/dist/graph/memory/read/read.d.ts.map +0 -1
  272. package/dist/graph/memory/read/read.js +0 -87
  273. package/dist/graph/memory/scope.d.ts +0 -7
  274. package/dist/graph/memory/scope.d.ts.map +0 -1
  275. package/dist/graph/memory/scope.js +0 -25
  276. package/dist/graph/mutate/move.hook.d.ts +0 -7
  277. package/dist/graph/mutate/move.hook.d.ts.map +0 -1
  278. package/dist/graph/mutate/move.hook.js +0 -49
  279. package/dist/graph/mutate/mutate.hook.d.ts +0 -17
  280. package/dist/graph/mutate/mutate.hook.d.ts.map +0 -1
  281. package/dist/graph/mutate/mutate.hook.js +0 -45
  282. package/dist/graph/query/children.hook.d.ts +0 -29
  283. package/dist/graph/query/children.hook.d.ts.map +0 -1
  284. package/dist/graph/query/children.hook.js +0 -64
  285. package/dist/graph/query/graph.hook.d.ts +0 -9
  286. package/dist/graph/query/graph.hook.d.ts.map +0 -1
  287. package/dist/graph/query/graph.hook.js +0 -5
  288. package/dist/graph/query/neighbors.hook.d.ts +0 -7
  289. package/dist/graph/query/neighbors.hook.d.ts.map +0 -1
  290. package/dist/graph/query/neighbors.hook.js +0 -104
  291. package/dist/graph/query/node.hook.d.ts +0 -14
  292. package/dist/graph/query/node.hook.d.ts.map +0 -1
  293. package/dist/graph/query/node.hook.js +0 -43
  294. package/dist/graph/query/query.hook.d.ts +0 -14
  295. package/dist/graph/query/query.hook.d.ts.map +0 -1
  296. package/dist/graph/query/query.hook.js +0 -23
  297. package/dist/schema/bind-read.d.ts +0 -37
  298. package/dist/schema/bind-read.d.ts.map +0 -1
  299. package/dist/schema/bind-read.js +0 -205
  300. package/dist/schema/binding.d.ts +0 -21
  301. package/dist/schema/binding.d.ts.map +0 -1
  302. package/dist/schema/binding.js +0 -99
  303. package/dist/schema/function.hook.d.ts +0 -9
  304. package/dist/schema/function.hook.d.ts.map +0 -1
  305. package/dist/schema/function.hook.js +0 -40
  306. package/dist/schema/method.hook.d.ts +0 -14
  307. package/dist/schema/method.hook.d.ts.map +0 -1
  308. package/dist/schema/method.hook.js +0 -49
  309. package/dist/schema/tag.d.ts +0 -11
  310. package/dist/schema/tag.d.ts.map +0 -1
  311. package/dist/schema/tag.js +0 -11
  312. package/dist/schema/types.d.ts +0 -73
  313. package/dist/schema/types.d.ts.map +0 -1
  314. package/dist/schema/types.js +0 -1
  315. package/dist/schema/write.d.ts +0 -16
  316. package/dist/schema/write.d.ts.map +0 -1
  317. package/dist/schema/write.js +0 -56
  318. package/src/application/roles.hook.ts +0 -41
  319. package/src/graph/memory/base.ts +0 -50
  320. package/src/graph/memory/read/read.ts +0 -103
  321. package/src/graph/memory/scope.ts +0 -29
  322. package/src/graph/mutate/move.hook.ts +0 -70
  323. package/src/graph/mutate/mutate.hook.ts +0 -69
  324. package/src/graph/query/children.hook.ts +0 -136
  325. package/src/graph/query/graph.hook.ts +0 -13
  326. package/src/graph/query/neighbors.hook.ts +0 -159
  327. package/src/graph/query/node.hook.ts +0 -83
  328. package/src/graph/query/query.hook.ts +0 -42
  329. package/src/schema/bind-read.ts +0 -319
  330. package/src/schema/binding.ts +0 -146
  331. package/src/schema/function.hook.ts +0 -68
  332. package/src/schema/method.hook.ts +0 -103
  333. package/src/schema/tag.ts +0 -19
  334. package/src/schema/types.ts +0 -150
  335. package/src/schema/write.ts +0 -96
@@ -1,8 +1,6 @@
1
- import type { NodeRefInput } from '@astrale-os/kernel-client';
2
- import type { ApplicationNode, AppSession, IntentRegistry } from '@astrale-os/shell';
1
+ import type { ApplicationNode, AppSession, HostCapabilities, NodeTarget, ResolvedView } from '@astrale-os/shell';
3
2
  import type { CSSProperties, ReactNode } from 'react';
4
3
  import type { SandboxPolicy, ViewHostHandle } from '../../window/host.js';
5
- import type { ViewDescriptor } from '../../window/lifecycle/mount.js';
6
4
  import type { WindowState } from '../../window/lifecycle/states.js';
7
5
  /** The states `AppHost`'s fallback answers — the frame's, plus the two OS phases. */
8
6
  export type AppHostFallbackState = WindowState | {
@@ -11,19 +9,10 @@ export type AppHostFallbackState = WindowState | {
11
9
  readonly phase: 'no-view';
12
10
  };
13
11
  export interface AppHostProps {
14
- app: ApplicationNode | NodeRefInput;
12
+ app: ApplicationNode | NodeTarget;
15
13
  /** Override the entry View while keeping the application's delegated session alive. */
16
- view?: NodeRefInput | ViewDescriptor;
17
- /**
18
- * Default target node delivered to the app's view as `targetNodeId` (API §12.2).
19
- * Container-anchored apps need one — the dock passes the current space. A deeper
20
- * fix (an install-time app data container + `app::open` returning a default
21
- * target) is a tracked domain-modeling question; until then the host supplies it.
22
- */
23
- node?: NodeRefInput;
24
- capabilities?: {
25
- intents: readonly (keyof IntentRegistry)[];
26
- };
14
+ view?: ResolvedView;
15
+ capabilities?: HostCapabilities;
27
16
  sandbox?: SandboxPolicy;
28
17
  fallback?: (state: AppHostFallbackState) => ReactNode;
29
18
  onSession?: (session: AppSession) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"app-host.d.ts","sourceRoot":"","sources":["../../../src/application/apps/app-host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACpF,OAAO,KAAK,EAAE,aAAa,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAA;AAWnE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAMnE,qFAAqF;AACrF,MAAM,MAAM,oBAAoB,GAC5B,WAAW,GACX;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAA;AAEjC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,eAAe,GAAG,YAAY,CAAA;IACnC,uFAAuF;IACvF,IAAI,CAAC,EAAE,YAAY,GAAG,cAAc,CAAA;IACpC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,YAAY,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC,MAAM,cAAc,CAAC,EAAE,CAAA;KAAE,CAAA;IAC7D,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAA;IACrD,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAA;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAED,eAAO,MAAM,OAAO,yGAqEnB,CAAA"}
1
+ {"version":3,"file":"app-host.d.ts","sourceRoot":"","sources":["../../../src/application/apps/app-host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,YAAY,EACb,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAA;AAWnE,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAMnE,qFAAqF;AACrF,MAAM,MAAM,oBAAoB,GAC5B,WAAW,GACX;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAA;AAEjC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,eAAe,GAAG,UAAU,CAAA;IACjC,uFAAuF;IACvF,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAA;IACrD,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAA;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAED,eAAO,MAAM,OAAO,yGAoEnB,CAAA"}
@@ -56,5 +56,5 @@ export const AppHost = forwardRef(function AppHost(props, ref) {
56
56
  const view = props.view ?? session.view;
57
57
  if (view === null)
58
58
  return box(fallback?.({ phase: 'no-view' }) ?? null);
59
- return (_jsx(ViewHost, { ref: ref, view: view, node: props.node, credential: session.credential, capabilities: props.capabilities ?? { intents: [] }, sandbox: props.sandbox, fallback: fallback ? (s) => fallback(s) : undefined, className: className, style: style }));
59
+ return (_jsx(ViewHost, { ref: ref, view: view, credential: session.credential, capabilities: props.capabilities, sandbox: props.sandbox, fallback: fallback ? (s) => fallback(s) : undefined, className: className, style: style }));
60
60
  });
@@ -1,12 +1,15 @@
1
- import type { NodeRefInput } from '@astrale-os/kernel-client';
2
- import type { ApplicationNode, SpaceNode } from '@astrale-os/shell';
1
+ import type { ApplicationNode, NodeTarget, SpaceNode } from '@astrale-os/shell';
3
2
  import type { ReadState } from '../../graph/memory/read/envelope.js';
4
3
  export interface AppsResult extends ReadState {
5
4
  readonly apps: readonly ApplicationNode[];
6
5
  }
7
- export declare function useApps(space?: SpaceNode | NodeRefInput | null): AppsResult;
6
+ export declare function useApps(space?: SpaceNode | NodeTarget | null): AppsResult;
8
7
  /** An `@id` ref for a bound node, else the normalized ref of a raw subject. */
9
- export declare function toRef(x: NodeRefInput | {
8
+ export declare function toRef(x: NodeTarget | {
9
+ readonly id: string;
10
+ }): NodeTarget;
11
+ /** Stable dependency identity for one Shell node target. */
12
+ export declare function targetKey(x: NodeTarget | {
10
13
  readonly id: string;
11
14
  }): string;
12
15
  //# sourceMappingURL=apps.hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apps.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/apps.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAYnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAWpE,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,CAAA;CAC1C;AAED,wBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,IAAI,GAAG,UAAU,CA0C3E;AAOD,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,CAAC,EAAE,YAAY,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEvE"}
1
+ {"version":3,"file":"apps.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/apps.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAY/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAWpE,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,CAAA;CAC1C;AAED,wBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,GAAG,UAAU,CA0CzE;AAOD,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAEzE;AAED,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAIzE"}
@@ -1,4 +1,4 @@
1
- import { normalizeRef } from '@astrale-os/kernel-client';
1
+ import { Path } from '@astrale-os/sdk/graph/path';
2
2
  /**
3
3
  * useApps(space?) (API §12.2) — the apps installed in a space (`installed_in`
4
4
  * in-edges). No arg targets the CURRENT space (shared store, so a switch anywhere
@@ -47,5 +47,13 @@ function hasId(x) {
47
47
  }
48
48
  /** An `@id` ref for a bound node, else the normalized ref of a raw subject. */
49
49
  export function toRef(x) {
50
- return hasId(x) ? `@${x.id}` : normalizeRef(x);
50
+ return hasId(x) ? x.id : x;
51
+ }
52
+ /** Stable dependency identity for one Shell node target. */
53
+ export function targetKey(x) {
54
+ if (hasId(x))
55
+ return `id:${x.id}`;
56
+ if (typeof x === 'string')
57
+ return `text:${x}`;
58
+ return `path:${Path.from(x).raw}`;
51
59
  }
@@ -3,5 +3,5 @@ import type { ReadState } from '../../graph/memory/read/envelope.js';
3
3
  export interface DomainsResult extends ReadState {
4
4
  readonly domains: readonly DomainSearchResult[];
5
5
  }
6
- export declare function useDomains(): DomainsResult;
6
+ export declare function useInstalledDomains(): DomainsResult;
7
7
  //# sourceMappingURL=domains.hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"domains.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/domains.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAI3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAQpE,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAChD;AAED,wBAAgB,UAAU,IAAI,aAAa,CAoB1C"}
1
+ {"version":3,"file":"domains.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/domains.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAI3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAQpE,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAA;CAChD;AAED,wBAAgB,mBAAmB,IAAI,aAAa,CAoBnD"}
@@ -3,7 +3,7 @@ import { useAsyncResource } from '../../graph/async.js';
3
3
  import { useShell } from '../../session/shell.hook.js';
4
4
  import { isOsPlaneAvailable } from '../user/user.store.js';
5
5
  const NO_DOMAINS = [];
6
- export function useDomains() {
6
+ export function useInstalledDomains() {
7
7
  const shell = useShell();
8
8
  const available = isOsPlaneAvailable(shell);
9
9
  const result = useAsyncResource(available ? () => shell.apps.searchDomains() : null, NO_DOMAINS, [shell, available]);
@@ -3,8 +3,7 @@
3
3
  * app-open protocol lives in the shell package). Resolves to the session; disposal
4
4
  * is the caller's (AppHost disposes it with the window).
5
5
  */
6
- import type { NodeRefInput } from '@astrale-os/kernel-client';
7
- import type { ApplicationNode, AppSession } from '@astrale-os/shell';
6
+ import type { ApplicationNode, AppSession, NodeTarget } from '@astrale-os/shell';
8
7
  import type { Action } from '../../graph/action.js';
9
- export declare function useOpenApp(): Action<[ApplicationNode | NodeRefInput], AppSession>;
8
+ export declare function useOpenApp(): Action<[ApplicationNode | NodeTarget], AppSession>;
10
9
  //# sourceMappingURL=open-app.hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-app.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/open-app.hook.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEpE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAMnD,wBAAgB,UAAU,IAAI,MAAM,CAAC,CAAC,eAAe,GAAG,YAAY,CAAC,EAAE,UAAU,CAAC,CAGjF"}
1
+ {"version":3,"file":"open-app.hook.d.ts","sourceRoot":"","sources":["../../../src/application/apps/open-app.hook.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEhF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAMnD,wBAAgB,UAAU,IAAI,MAAM,CAAC,CAAC,eAAe,GAAG,UAAU,CAAC,EAAE,UAAU,CAAC,CAG/E"}
@@ -7,14 +7,12 @@ export { useSpace } from './spaces/space.hook.js';
7
7
  export type { SpaceResult } from './spaces/space.hook.js';
8
8
  export { useApps } from './apps/apps.hook.js';
9
9
  export type { AppsResult } from './apps/apps.hook.js';
10
- export { useDomains } from './apps/domains.hook.js';
10
+ export { useInstalledDomains } from './apps/domains.hook.js';
11
11
  export type { DomainsResult } from './apps/domains.hook.js';
12
12
  export { useOpenApp } from './apps/open-app.hook.js';
13
13
  export { AppHost } from './apps/app-host.js';
14
14
  export type { AppHostFallbackState, AppHostProps } from './apps/app-host.js';
15
15
  export { AppLogo } from './apps/app-logo.js';
16
16
  export type { AppLogoProps } from './apps/app-logo.js';
17
- export { useRoles } from './roles.hook.js';
18
- export type { RolesResult } from './roles.hook.js';
19
- export type { ApplicationNode, AppSession, DomainSearchResult, RoleNode, SpaceNode, UserNode, } from '@astrale-os/shell';
17
+ export type { ApplicationNode, AppSession, DomainSearchResult, NodeTarget, ResolvedView, SpaceNode, UserNode, } from '@astrale-os/shell';
20
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,YAAY,EACV,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,YAAY,EACV,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,MAAM,mBAAmB,CAAA"}
@@ -1,14 +1,13 @@
1
1
  // application — API §12.2. The OS-plane hooks over the shell package's
2
2
  // `shell.user/spaces/apps` namespaces + the window module: useUser, useSpaces,
3
- // useCurrentSpace, useSpace, useApps, useDomains, useRoles, useOpenApp,
3
+ // useCurrentSpace, useSpace, useApps, useInstalledDomains, useOpenApp,
4
4
  // AppHost, AppLogo.
5
5
  export { useUser } from './user/user.hook.js';
6
6
  export { useSpaces } from './spaces/spaces.hook.js';
7
7
  export { useCurrentSpace } from './spaces/current-space.hook.js';
8
8
  export { useSpace } from './spaces/space.hook.js';
9
9
  export { useApps } from './apps/apps.hook.js';
10
- export { useDomains } from './apps/domains.hook.js';
10
+ export { useInstalledDomains } from './apps/domains.hook.js';
11
11
  export { useOpenApp } from './apps/open-app.hook.js';
12
12
  export { AppHost } from './apps/app-host.js';
13
13
  export { AppLogo } from './apps/app-logo.js';
14
- export { useRoles } from './roles.hook.js';
@@ -1,5 +1,5 @@
1
- import type { NodeRefInput } from '@astrale-os/kernel-client';
1
+ import type { NodeTarget } from '@astrale-os/shell';
2
2
  import type { CurrentSpaceResult } from './current-space.hook.js';
3
3
  export type SpaceResult = CurrentSpaceResult;
4
- export declare function useSpace(ref: NodeRefInput | null | undefined): SpaceResult;
4
+ export declare function useSpace(ref: NodeTarget | null | undefined): SpaceResult;
5
5
  //# sourceMappingURL=space.hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"space.hook.d.ts","sourceRoot":"","sources":["../../../src/application/spaces/space.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAU7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAOjE,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAE5C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAqB1E"}
1
+ {"version":3,"file":"space.hook.d.ts","sourceRoot":"","sources":["../../../src/application/spaces/space.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAA;AAQ9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAQjE,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAE5C,wBAAgB,QAAQ,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAqBxE"}
@@ -1,4 +1,3 @@
1
- import { normalizeRef } from '@astrale-os/kernel-client';
2
1
  /**
3
2
  * useSpace(ref) (API §12.2) — a single space by ref; `null`/`undefined` (or an
4
3
  * unavailable OS plane) is idle (§1.3). One-shot today (§12 flag).
@@ -7,12 +6,13 @@ import { useMemo } from 'react';
7
6
  import { useAsyncResource } from '../../graph/async.js';
8
7
  import { isIdleInput } from '../../graph/memory/read/idle.js';
9
8
  import { useShell } from '../../session/shell.hook.js';
9
+ import { targetKey } from '../apps/apps.hook.js';
10
10
  import { isOsPlaneAvailable } from '../user/user.store.js';
11
11
  export function useSpace(ref) {
12
12
  const shell = useShell();
13
13
  const idle = isIdleInput(ref) || !isOsPlaneAvailable(shell);
14
14
  // The inline guard (not the stored `idle`) narrows `ref` to non-null below.
15
- const key = idle ? null : normalizeRef(ref);
15
+ const key = idle ? null : targetKey(ref);
16
16
  const res = useAsyncResource(idle ? null : () => shell.spaces.get(ref), null, [shell, key]);
17
17
  return useMemo(() => ({
18
18
  space: idle ? null : res.data,
@@ -1,5 +1,4 @@
1
- import type { NodeRefInput } from '@astrale-os/kernel-client';
2
- import type { SpaceNode } from '@astrale-os/shell';
1
+ import type { NodeTarget, SpaceNode } from '@astrale-os/shell';
3
2
  import type { Action } from '../../graph/action.js';
4
3
  import type { ReadState } from '../../graph/memory/read/envelope.js';
5
4
  export interface SpacesResult extends ReadState {
@@ -8,7 +7,7 @@ export interface SpacesResult extends ReadState {
8
7
  /** The `selected_space` target — optimistically ahead during a `switch`. */
9
8
  readonly selected: SpaceNode | null;
10
9
  /** `user::switchSpace` with a manual optimistic overlay (§1.6). */
11
- readonly switch: Action<[NodeRefInput], void>;
10
+ readonly switch: Action<[NodeTarget], void>;
12
11
  }
13
12
  export declare function useSpaces(): SpacesResult;
14
13
  //# sourceMappingURL=spaces.hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spaces.hook.d.ts","sourceRoot":"","sources":["../../../src/application/spaces/spaces.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAYlD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAUpE,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAA;IACrC,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAA;IACnC,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,CAAA;CAC9C;AAED,wBAAgB,SAAS,IAAI,YAAY,CA4DxC"}
1
+ {"version":3,"file":"spaces.hook.d.ts","sourceRoot":"","sources":["../../../src/application/spaces/spaces.hook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAY9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAUpE,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAA;IACrC,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAA;IACnC,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,CAAA;CAC5C;AAED,wBAAgB,SAAS,IAAI,YAAY,CA4DxC"}
@@ -1,4 +1,4 @@
1
- import { normalizeRef } from '@astrale-os/kernel-client';
1
+ import { Path } from '@astrale-os/sdk/graph/path';
2
2
  /**
3
3
  * useSpaces (API §12.2) — the spaces list, the selected space, and a `switch`
4
4
  * Action that repoints the `selected_space` edge. Reads the SAME per-Shell
@@ -77,6 +77,13 @@ function hasId(x) {
77
77
  function refIdOf(x) {
78
78
  if (hasId(x))
79
79
  return x.id;
80
- const raw = normalizeRef(x);
81
- return raw.startsWith('@') ? raw.slice(1) : null;
80
+ if (typeof x === 'string' && !x.startsWith('@') && !x.startsWith('/'))
81
+ return x;
82
+ try {
83
+ const path = Path.from(x);
84
+ return path.ast.anchor.kind === 'id' && path.ast.steps.length === 0 ? path.ast.anchor.id : null;
85
+ }
86
+ catch {
87
+ return null;
88
+ }
82
89
  }
@@ -1,40 +1,23 @@
1
- import type { CredentialInput, FnMap } from '@astrale-os/kernel-client';
2
- import type { BoundClientSessionView } from '@astrale-os/kernel-client/session';
1
+ import type { Identity } from '@astrale-os/kernel-client/auth';
2
+ import type { KernelClient } from '@astrale-os/shell';
3
3
  import type { ReactElement, ReactNode } from 'react';
4
- import type { SelfNode } from '../session/session.context.js';
5
- /** A bound session view — the kernel surface `session.as(cred)` yields. */
6
- export type SessionView = BoundClientSessionView<FnMap>;
7
- /** A whoami-shaped identity/graph node (kernel-client does not yet re-export `Node` — G8). */
8
- export type NodeValue = SelfNode;
9
- /** The root scope key — the memory's own default scope (`createMemory` default). */
10
- export declare const ROOT_SCOPE = "default";
11
- /**
12
- * The principal a subtree acts as (API §4). `scope` is the memory isolation key
13
- * (§5.4): the graph plane scopes its memory by `memory.forScope(scope)` so an
14
- * <ActAs> subtree never shares cached results with another principal.
15
- */
4
+ export type NodeValue = Identity;
5
+ export type SessionView = KernelClient;
16
6
  export interface IdentityBinding {
17
- readonly kernel: SessionView;
18
- readonly self: SelfNode;
19
- readonly scope: string;
7
+ readonly kernel: KernelClient;
8
+ readonly self: Identity;
20
9
  }
21
10
  export declare const IdentityContext: import("react").Context<IdentityBinding | null>;
22
- /**
23
- * The principal this subtree dispatches as. An <ActAs> value wins; otherwise the
24
- * root binding off ShellContext. Throws outside a provider, or when the bound
25
- * kernel resolved no identity (a bare prebuilt Shell with no auth surface).
26
- */
27
11
  export declare function useIdentityBinding(): IdentityBinding;
28
12
  export interface ActAsProps {
29
- /** The principal to act as. A thunk is resolved by the kernel per dispatch. */
30
- credential: CredentialInput | (() => CredentialInput);
31
- children: ReactNode;
13
+ /**
14
+ * A separately authenticated Kernel capability. Raw credentials are deliberately not accepted;
15
+ * construct the delegated Client Session at the trust boundary that owns credential resolution.
16
+ */
17
+ readonly client: KernelClient;
18
+ readonly fallback?: ReactNode;
19
+ readonly children: ReactNode;
32
20
  }
33
- /**
34
- * A subtree that dispatches as another principal: rebinds the kernel (session.as),
35
- * resolves whoami, and provides a fresh identity binding with a DISTINCT memory
36
- * scope (`as:<id>`). Nestable — it rebinds from the current effective principal. A
37
- * brief nested boot holds the subtree (renders null) until whoami resolves.
38
- */
39
- export declare function ActAs({ credential, children }: ActAsProps): ReactElement | null;
21
+ /** Bind a subtree to an explicitly supplied authenticated Kernel capability. */
22
+ export declare function ActAs({ client, fallback, children }: ActAsProps): ReactElement | null;
40
23
  //# sourceMappingURL=act-as.context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"act-as.context.d.ts","sourceRoot":"","sources":["../../src/auth/act-as.context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAI7D,2EAA2E;AAC3E,MAAM,MAAM,WAAW,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;AAEvD,8FAA8F;AAC9F,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAA;AAEhC,oFAAoF;AACpF,eAAO,MAAM,UAAU,YAAY,CAAA;AAEnC;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AACD,eAAO,MAAM,eAAe,iDAA8C,CAAA;AAG1E;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAiBpD;AAED,MAAM,WAAW,UAAU;IACzB,+EAA+E;IAC/E,UAAU,EAAE,eAAe,GAAG,CAAC,MAAM,eAAe,CAAC,CAAA;IACrD,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAkC/E"}
1
+ {"version":3,"file":"act-as.context.d.ts","sourceRoot":"","sources":["../../src/auth/act-as.context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMpD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAA;AAChC,MAAM,MAAM,WAAW,GAAG,YAAY,CAAA;AAEtC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CACxB;AAED,eAAO,MAAM,eAAe,iDAA8C,CAAA;AAG1E,wBAAgB,kBAAkB,IAAI,eAAe,CAOpD;AAED,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B;AAED,gFAAgF;AAChF,wBAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CA8BrF"}
@@ -1,84 +1,40 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * The acting-principal binding (API §4). `IdentityContext` seats the effective
4
- * principal a subtree dispatches as — its bound kernel view + whoami + memory
5
- * scope; `useIdentityBinding` resolves it (an `<ActAs>` override, else the root
6
- * off ShellContext). `<ActAs>` rebinds a subtree to another principal with a
7
- * DISTINCT memory scope so results never leak across principals (§5.4).
8
- */
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
9
2
  import { createContext, useContext, useEffect, useMemo, useState } from 'react';
10
3
  import { ShellContext } from '../session/session.context.js';
11
- /** The root scope key — the memory's own default scope (`createMemory` default). */
12
- export const ROOT_SCOPE = 'default';
13
4
  export const IdentityContext = createContext(null);
14
5
  IdentityContext.displayName = 'AstraleIdentityContext';
15
- /**
16
- * The principal this subtree dispatches as. An <ActAs> value wins; otherwise the
17
- * root binding off ShellContext. Throws outside a provider, or when the bound
18
- * kernel resolved no identity (a bare prebuilt Shell with no auth surface).
19
- */
20
6
  export function useIdentityBinding() {
21
7
  const override = useContext(IdentityContext);
22
8
  if (override !== null)
23
9
  return override;
24
10
  const runtime = useContext(ShellContext);
25
- if (runtime === null) {
11
+ if (runtime === null)
26
12
  throw new Error('identity hooks must be used within a <ShellProvider>');
27
- }
28
- if (runtime.self === null) {
29
- throw new Error('identity hooks require an identity: this shell exposed no auth surface, so whoami ' +
30
- 'resolved nothing at boot');
31
- }
32
- // The root binding reads stable fields (self, shell.kernel), so a fresh object
33
- // per render is inert — consumers key off `kernel`/`self`, both stable.
34
- return { kernel: runtime.shell.kernel, self: runtime.self, scope: ROOT_SCOPE };
13
+ if (runtime.self === null)
14
+ throw new Error('the active Shell has no authenticated identity');
15
+ return { kernel: runtime.shell.kernel, self: runtime.self };
35
16
  }
36
- /**
37
- * A subtree that dispatches as another principal: rebinds the kernel (session.as),
38
- * resolves whoami, and provides a fresh identity binding with a DISTINCT memory
39
- * scope (`as:<id>`). Nestable — it rebinds from the current effective principal. A
40
- * brief nested boot holds the subtree (renders null) until whoami resolves.
41
- */
42
- export function ActAs({ credential, children }) {
43
- const parent = useIdentityBinding();
44
- // Key the rebind on a STABLE credential identity (like `configIdentity` does),
45
- // so an inline object credential (`credential={{ … }}`) does not re-mint the
46
- // session view — and re-run whoami, unmounting the subtree — every parent
47
- // render. A thunk still keys by reference: pass a stable thunk to avoid churn.
48
- const credKey = credentialIdentity(credential);
49
- // eslint-disable-next-line react-hooks/exhaustive-deps
50
- const kernel = useMemo(() => parent.kernel.as(credential), [parent.kernel, credKey]);
51
- const [self, setSelf] = useState(null);
17
+ /** Bind a subtree to an explicitly supplied authenticated Kernel capability. */
18
+ export function ActAs({ client, fallback, children }) {
19
+ const [state, setState] = useState({ status: 'pending' });
52
20
  useEffect(() => {
53
- let alive = true;
54
- setSelf(null);
55
- void kernel.auth.whoami().then((node) => {
56
- if (alive)
57
- setSelf(node);
58
- }, () => {
59
- /* held (null) subtree on resolve failure — transport errors surface via the provider */
21
+ let active = true;
22
+ setState({ status: 'pending' });
23
+ void client.auth.whoami().then((self) => {
24
+ if (active)
25
+ setState({ status: 'ready', self });
26
+ }, (error) => {
27
+ if (active)
28
+ setState({ status: 'failed', error });
60
29
  });
61
30
  return () => {
62
- alive = false;
31
+ active = false;
63
32
  };
64
- }, [kernel]);
65
- const value = useMemo(() => (self === null ? null : { kernel, self, scope: `as:${self.id}` }), [kernel, self]);
33
+ }, [client]);
34
+ const value = useMemo(() => (state.status === 'ready' ? { kernel: client, self: state.self } : null), [client, state]);
35
+ if (state.status === 'failed')
36
+ throw state.error;
66
37
  if (value === null)
67
- return null;
38
+ return fallback === undefined ? null : _jsx(_Fragment, { children: fallback });
68
39
  return _jsx(IdentityContext.Provider, { value: value, children: children });
69
40
  }
70
- /**
71
- * A stable identity for a credential: the thunk by reference, a string as itself,
72
- * and an object by a serialized form — so an equal inline object does not churn
73
- * the memo (worst case a serialize failure falls back to reference identity).
74
- */
75
- function credentialIdentity(credential) {
76
- if (typeof credential === 'function' || typeof credential === 'string')
77
- return credential;
78
- try {
79
- return `cred:${JSON.stringify(credential)}`;
80
- }
81
- catch {
82
- return credential;
83
- }
84
- }
@@ -1,3 +1,4 @@
1
1
  import type { AuthApi } from '@astrale-os/kernel-client/auth';
2
+ /** The exact Client Auth capability for the effective subtree principal. */
2
3
  export declare function useAuth(): AuthApi;
3
4
  //# sourceMappingURL=auth.hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.hook.d.ts","sourceRoot":"","sources":["../../src/auth/auth.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAkB7D,wBAAgB,OAAO,IAAI,OAAO,CAGjC"}
1
+ {"version":3,"file":"auth.hook.d.ts","sourceRoot":"","sources":["../../src/auth/auth.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAI7D,4EAA4E;AAC5E,wBAAgB,OAAO,IAAI,OAAO,CAEjC"}
@@ -1,25 +1,5 @@
1
- /**
2
- * useAuth (API §4) — the imperative AuthApi of the effective principal
3
- * (whoami/credential/mint/delegate/check/grant/revoke/bind/unbind). Grant and
4
- * revoke additionally nudge the principal's useCan ledger on success, delivering
5
- * the Tier-0 local re-check (SPEC §11.3). DEVIATION: API §4 describes a pure
6
- * passthrough; the wrap is the only way to surface a local grant/revoke today,
7
- * since permissions dispatch as identity methods rather than graph patches.
8
- * Cross-client liveness still awaits the watch tiers (G7).
9
- */
10
- import { useMemo } from 'react';
11
1
  import { useIdentityBinding } from './act-as.context.js';
12
- import { ledgerFor } from './can.hook.js';
2
+ /** The exact Client Auth capability for the effective subtree principal. */
13
3
  export function useAuth() {
14
- const { kernel } = useIdentityBinding();
15
- return useMemo(() => withLedgerNudge(kernel), [kernel]);
16
- }
17
- /** Wrap grant/revoke so a successful local change re-checks the principal's cells. */
18
- function withLedgerNudge(kernel) {
19
- const auth = kernel.auth;
20
- const ledger = ledgerFor(kernel);
21
- const invalidate = () => ledger.invalidateAll();
22
- const grant = ((arg) => Promise.resolve(auth.grant(arg)).then(invalidate));
23
- const revoke = ((arg) => Promise.resolve(auth.revoke(arg)).then(invalidate));
24
- return { ...auth, grant, revoke };
4
+ return useIdentityBinding().kernel.auth;
25
5
  }
@@ -1,40 +1,12 @@
1
- import type { AuthApi, Perms } from '@astrale-os/kernel-client/auth';
2
- import type { PathLike, Ref } from '@astrale-os/kernel-client/graph';
3
- import type { NodeValue, SessionView } from './act-as.context.js';
4
- /** A node value carries the id/class/path triple (mirrors the memory's `isNodeValue`). */
5
- export declare function isNodeValue(x: unknown): x is NodeValue;
6
- /** Normalize a `useCan` subject to a dispatchable `Ref` plus a stable dedup key. */
7
- export declare function toRef(on: NodeValue | PathLike): {
8
- ref: Ref;
9
- key: string;
1
+ import type { NodeId } from '@astrale-os/sdk/graph/node';
2
+ import type { PathLike } from '@astrale-os/sdk/graph/path';
3
+ import type { schema } from '@astrale-os/sdk/schema';
4
+ export type PolicyObject = NodeId | {
5
+ readonly id: NodeId;
10
6
  };
11
- /** One deduped check — its last-known value plus the subscribers watching it. */
12
- declare class CheckCell {
13
- private readonly auth;
14
- private readonly perms;
15
- private readonly on;
16
- value: boolean | undefined;
17
- private inFlight;
18
- private readonly listeners;
19
- constructor(auth: AuthApi, perms: Perms, on: Ref);
20
- subscribe: (onChange: () => void) => (() => void);
21
- getSnapshot: () => boolean | undefined;
22
- /** Run the check once when the value is unknown and nothing is in flight. */
23
- ensure(): void;
24
- /** Force a re-check (local grant/revoke on this principal). */
25
- invalidate(): void;
26
- private run;
27
- }
28
- /** Per-principal cell registry — dedup across the whole tree for one kernel handle. */
29
- export declare class CheckLedger {
30
- private readonly auth;
31
- private readonly cells;
32
- constructor(auth: AuthApi);
33
- cell(key: string, perms: Perms, on: Ref): CheckCell;
34
- /** Re-check every observed cell — conservative Tier-0 sweep after a local grant/revoke. */
35
- invalidateAll(): void;
36
- }
37
- export declare function ledgerFor(kernel: SessionView): CheckLedger;
38
- export declare function useCan(perms: Perms, on: NodeValue | PathLike | null | undefined): boolean | undefined;
39
- export {};
7
+ /**
8
+ * Evaluate one declared Kernel policy for one exact graph object. This is a UI affordance; the
9
+ * invoked callable remains the authorization enforcement point.
10
+ */
11
+ export declare function useCan(policy: PathLike | schema.PolicyRef | null | undefined, object: PolicyObject | null | undefined): boolean | undefined;
40
12
  //# sourceMappingURL=can.hook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"can.hook.d.ts","sourceRoot":"","sources":["../../src/auth/can.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAA;AAapE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAOjE,0FAA0F;AAC1F,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,SAAS,CAEtD;AAED,oFAAoF;AACpF,wBAAgB,KAAK,CAAC,EAAE,EAAE,SAAS,GAAG,QAAQ,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAGzE;AAID,iFAAiF;AACjF,cAAM,SAAS;IAMX,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,EAAE;IAPrB,KAAK,EAAE,OAAO,GAAG,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAwB;IAElD,YACmB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,GAAG,EACtB;IAEJ,SAAS,aAAc,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAI/C;IAED,WAAW,QAAO,OAAO,GAAG,SAAS,CAAc;IAEnD,6EAA6E;IAC7E,MAAM,IAAI,IAAI,CAGb;IAED,+DAA+D;IAC/D,UAAU,IAAI,IAAI,CAMjB;IAED,OAAO,CAAC,GAAG;CAkBZ;AAED,uFAAuF;AACvF,qBAAa,WAAW;IAGV,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA+B;IAErD,YAA6B,IAAI,EAAE,OAAO,EAAI;IAE9C,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,GAAG,SAAS,CAOlD;IAED,2FAA2F;IAC3F,aAAa,IAAI,IAAI,CAEpB;CACF;AAMD,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAO1D;AAID,wBAAgB,MAAM,CACpB,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,GAAG,SAAS,CAoBrB"}
1
+ {"version":3,"file":"can.hook.d.ts","sourceRoot":"","sources":["../../src/auth/can.hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAOpD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3D;;;GAGG;AACH,wBAAgB,MAAM,CACpB,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC,SAAS,GAAG,IAAI,GAAG,SAAS,EACtD,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GACtC,OAAO,GAAG,SAAS,CA2BrB"}