@astrale-os/shell-react 0.2.0 → 0.2.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 (266) hide show
  1. package/dist/application/apps/app-host.d.ts +2 -2
  2. package/dist/application/apps/app-host.d.ts.map +1 -1
  3. package/dist/application/apps/app-host.js +3 -3
  4. package/dist/application/apps/apps.hook.d.ts +1 -1
  5. package/dist/application/apps/apps.hook.d.ts.map +1 -1
  6. package/dist/application/apps/apps.hook.js +4 -4
  7. package/dist/application/apps/open-app.hook.d.ts +1 -1
  8. package/dist/application/apps/open-app.hook.d.ts.map +1 -1
  9. package/dist/application/apps/open-app.hook.js +3 -3
  10. package/dist/application/index.d.ts +16 -16
  11. package/dist/application/index.d.ts.map +1 -1
  12. package/dist/application/index.js +9 -9
  13. package/dist/application/roles.hook.d.ts +1 -1
  14. package/dist/application/roles.hook.d.ts.map +1 -1
  15. package/dist/application/roles.hook.js +3 -3
  16. package/dist/application/spaces/current-space.hook.d.ts +1 -1
  17. package/dist/application/spaces/current-space.hook.d.ts.map +1 -1
  18. package/dist/application/spaces/current-space.hook.js +3 -3
  19. package/dist/application/spaces/space.hook.d.ts +1 -1
  20. package/dist/application/spaces/space.hook.d.ts.map +1 -1
  21. package/dist/application/spaces/space.hook.js +4 -4
  22. package/dist/application/spaces/spaces.hook.d.ts +2 -2
  23. package/dist/application/spaces/spaces.hook.d.ts.map +1 -1
  24. package/dist/application/spaces/spaces.hook.js +5 -5
  25. package/dist/application/user/user.hook.js +2 -2
  26. package/dist/auth/act-as.context.d.ts +1 -1
  27. package/dist/auth/act-as.context.d.ts.map +1 -1
  28. package/dist/auth/act-as.context.js +1 -1
  29. package/dist/auth/auth.hook.js +2 -2
  30. package/dist/auth/can.hook.d.ts +1 -1
  31. package/dist/auth/can.hook.d.ts.map +1 -1
  32. package/dist/auth/can.hook.js +2 -2
  33. package/dist/auth/index.d.ts +5 -5
  34. package/dist/auth/index.d.ts.map +1 -1
  35. package/dist/auth/index.js +4 -4
  36. package/dist/auth/self.hook.d.ts +1 -1
  37. package/dist/auth/self.hook.d.ts.map +1 -1
  38. package/dist/auth/self.hook.js +1 -1
  39. package/dist/auth/session-kernel.d.ts +1 -1
  40. package/dist/auth/session-kernel.d.ts.map +1 -1
  41. package/dist/auth/session-kernel.js +2 -2
  42. package/dist/graph/async.d.ts +1 -1
  43. package/dist/graph/async.d.ts.map +1 -1
  44. package/dist/graph/call/call.hook.d.ts +1 -1
  45. package/dist/graph/call/call.hook.d.ts.map +1 -1
  46. package/dist/graph/call/call.hook.js +2 -2
  47. package/dist/graph/call/stream.hook.js +1 -1
  48. package/dist/graph/index.d.ts +18 -18
  49. package/dist/graph/index.d.ts.map +1 -1
  50. package/dist/graph/index.js +8 -8
  51. package/dist/graph/memory/read/idle.d.ts +1 -1
  52. package/dist/graph/memory/read/idle.d.ts.map +1 -1
  53. package/dist/graph/memory/read/read.d.ts +1 -1
  54. package/dist/graph/memory/read/read.d.ts.map +1 -1
  55. package/dist/graph/memory/read/read.js +3 -3
  56. package/dist/graph/memory/scope.js +3 -3
  57. package/dist/graph/mutate/move.hook.d.ts +2 -2
  58. package/dist/graph/mutate/move.hook.d.ts.map +1 -1
  59. package/dist/graph/mutate/move.hook.js +3 -3
  60. package/dist/graph/mutate/mutate.hook.d.ts +1 -1
  61. package/dist/graph/mutate/mutate.hook.d.ts.map +1 -1
  62. package/dist/graph/mutate/mutate.hook.js +2 -2
  63. package/dist/graph/query/children.hook.d.ts +2 -2
  64. package/dist/graph/query/children.hook.d.ts.map +1 -1
  65. package/dist/graph/query/children.hook.js +2 -2
  66. package/dist/graph/query/graph.hook.js +1 -1
  67. package/dist/graph/query/neighbors.hook.d.ts +2 -2
  68. package/dist/graph/query/neighbors.hook.d.ts.map +1 -1
  69. package/dist/graph/query/neighbors.hook.js +4 -7
  70. package/dist/graph/query/node.hook.d.ts +2 -2
  71. package/dist/graph/query/node.hook.d.ts.map +1 -1
  72. package/dist/graph/query/node.hook.js +2 -2
  73. package/dist/graph/query/query.hook.d.ts +1 -1
  74. package/dist/graph/query/query.hook.d.ts.map +1 -1
  75. package/dist/graph/query/query.hook.js +1 -1
  76. package/dist/index.d.ts +25 -25
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +11 -11
  79. package/dist/intents/index.d.ts +5 -5
  80. package/dist/intents/index.d.ts.map +1 -1
  81. package/dist/intents/index.js +2 -2
  82. package/dist/intents/listen-intent.hook.d.ts +1 -1
  83. package/dist/intents/listen-intent.hook.d.ts.map +1 -1
  84. package/dist/intents/listen-intent.hook.js +3 -3
  85. package/dist/intents/reply.js +1 -1
  86. package/dist/intents/send-intent.hook.d.ts +1 -1
  87. package/dist/intents/send-intent.hook.d.ts.map +1 -1
  88. package/dist/intents/send-intent.hook.js +2 -2
  89. package/dist/navigation/adapters/adapter.d.ts +1 -1
  90. package/dist/navigation/adapters/adapter.d.ts.map +1 -1
  91. package/dist/navigation/adapters/memory.adapter.d.ts +2 -2
  92. package/dist/navigation/adapters/memory.adapter.d.ts.map +1 -1
  93. package/dist/navigation/adapters/url.adapter.d.ts +1 -1
  94. package/dist/navigation/adapters/url.adapter.d.ts.map +1 -1
  95. package/dist/navigation/hooks/ancestors.hook.d.ts +2 -2
  96. package/dist/navigation/hooks/ancestors.hook.d.ts.map +1 -1
  97. package/dist/navigation/hooks/ancestors.hook.js +5 -5
  98. package/dist/navigation/hooks/location.hook.d.ts +1 -1
  99. package/dist/navigation/hooks/location.hook.d.ts.map +1 -1
  100. package/dist/navigation/hooks/location.hook.js +2 -2
  101. package/dist/navigation/hooks/navigate.hook.d.ts +1 -1
  102. package/dist/navigation/hooks/navigate.hook.d.ts.map +1 -1
  103. package/dist/navigation/hooks/navigate.hook.js +1 -1
  104. package/dist/navigation/hooks/scope.hook.d.ts +3 -3
  105. package/dist/navigation/hooks/scope.hook.d.ts.map +1 -1
  106. package/dist/navigation/hooks/scope.hook.js +3 -3
  107. package/dist/navigation/index.d.ts +15 -15
  108. package/dist/navigation/index.d.ts.map +1 -1
  109. package/dist/navigation/index.js +8 -8
  110. package/dist/navigation/link.d.ts +1 -1
  111. package/dist/navigation/link.d.ts.map +1 -1
  112. package/dist/navigation/link.js +2 -2
  113. package/dist/navigation/location.d.ts +1 -1
  114. package/dist/navigation/location.d.ts.map +1 -1
  115. package/dist/navigation/scope.context.d.ts +5 -5
  116. package/dist/navigation/scope.context.d.ts.map +1 -1
  117. package/dist/navigation/scope.context.js +5 -5
  118. package/dist/navigation/snapshot.d.ts +3 -3
  119. package/dist/navigation/snapshot.d.ts.map +1 -1
  120. package/dist/schema/bind-read.d.ts +2 -2
  121. package/dist/schema/bind-read.d.ts.map +1 -1
  122. package/dist/schema/bind-read.js +5 -5
  123. package/dist/schema/binding.d.ts +1 -1
  124. package/dist/schema/binding.d.ts.map +1 -1
  125. package/dist/schema/binding.js +11 -11
  126. package/dist/schema/domain.hook.js +3 -3
  127. package/dist/schema/function.hook.d.ts +2 -2
  128. package/dist/schema/function.hook.d.ts.map +1 -1
  129. package/dist/schema/function.hook.js +2 -2
  130. package/dist/schema/index.d.ts +9 -9
  131. package/dist/schema/index.d.ts.map +1 -1
  132. package/dist/schema/index.js +6 -6
  133. package/dist/schema/kernel.hook.js +3 -3
  134. package/dist/schema/method.hook.d.ts +1 -1
  135. package/dist/schema/method.hook.d.ts.map +1 -1
  136. package/dist/schema/method.hook.js +4 -4
  137. package/dist/schema/types.d.ts +2 -2
  138. package/dist/schema/types.d.ts.map +1 -1
  139. package/dist/schema/write.d.ts +1 -1
  140. package/dist/schema/write.d.ts.map +1 -1
  141. package/dist/schema/write.js +9 -3
  142. package/dist/selection/index.d.ts +3 -3
  143. package/dist/selection/index.d.ts.map +1 -1
  144. package/dist/selection/index.js +2 -2
  145. package/dist/selection/live.js +1 -1
  146. package/dist/selection/scope.context.d.ts +1 -1
  147. package/dist/selection/scope.context.d.ts.map +1 -1
  148. package/dist/selection/scope.context.js +1 -1
  149. package/dist/selection/selection.hook.d.ts +1 -1
  150. package/dist/selection/selection.hook.d.ts.map +1 -1
  151. package/dist/selection/selection.hook.js +1 -1
  152. package/dist/session/boot/boot.d.ts +1 -1
  153. package/dist/session/boot/boot.d.ts.map +1 -1
  154. package/dist/session/boot/status.d.ts +1 -1
  155. package/dist/session/boot/status.d.ts.map +1 -1
  156. package/dist/session/connection/connection.hook.d.ts +1 -1
  157. package/dist/session/connection/connection.hook.d.ts.map +1 -1
  158. package/dist/session/connection/connection.hook.js +2 -2
  159. package/dist/session/index.d.ts +7 -7
  160. package/dist/session/index.d.ts.map +1 -1
  161. package/dist/session/index.js +5 -5
  162. package/dist/session/kernel-client.hook.js +1 -1
  163. package/dist/session/kernel-instance.hook.js +1 -1
  164. package/dist/session/provider.js +8 -8
  165. package/dist/session/shell.hook.js +1 -1
  166. package/dist/window/adopt.d.ts +2 -2
  167. package/dist/window/adopt.d.ts.map +1 -1
  168. package/dist/window/hooks/close-guard.hook.js +1 -1
  169. package/dist/window/hooks/target-node.hook.d.ts +2 -2
  170. package/dist/window/hooks/target-node.hook.d.ts.map +1 -1
  171. package/dist/window/hooks/target-node.hook.js +2 -2
  172. package/dist/window/hooks/views-for.hook.d.ts +2 -2
  173. package/dist/window/hooks/views-for.hook.d.ts.map +1 -1
  174. package/dist/window/hooks/views-for.hook.js +2 -2
  175. package/dist/window/hooks/window.hook.d.ts +1 -1
  176. package/dist/window/hooks/window.hook.d.ts.map +1 -1
  177. package/dist/window/hooks/window.hook.js +2 -2
  178. package/dist/window/hooks/windows.hook.js +2 -2
  179. package/dist/window/host.d.ts +2 -2
  180. package/dist/window/host.d.ts.map +1 -1
  181. package/dist/window/host.js +4 -4
  182. package/dist/window/hub.d.ts +3 -3
  183. package/dist/window/hub.d.ts.map +1 -1
  184. package/dist/window/hub.js +1 -1
  185. package/dist/window/index.d.ts +14 -14
  186. package/dist/window/index.d.ts.map +1 -1
  187. package/dist/window/index.js +7 -7
  188. package/dist/window/stage.js +3 -3
  189. package/package.json +7 -7
  190. package/src/application/apps/app-host.tsx +6 -6
  191. package/src/application/apps/apps.hook.ts +6 -6
  192. package/src/application/apps/open-app.hook.ts +4 -4
  193. package/src/application/index.ts +16 -16
  194. package/src/application/roles.hook.ts +4 -4
  195. package/src/application/spaces/current-space.hook.ts +4 -4
  196. package/src/application/spaces/space.hook.ts +5 -5
  197. package/src/application/spaces/spaces.hook.ts +7 -7
  198. package/src/application/user/user.hook.ts +2 -2
  199. package/src/auth/act-as.context.tsx +2 -2
  200. package/src/auth/auth.hook.ts +3 -3
  201. package/src/auth/can.hook.ts +3 -3
  202. package/src/auth/index.ts +5 -5
  203. package/src/auth/self.hook.ts +2 -2
  204. package/src/auth/session-kernel.ts +3 -3
  205. package/src/graph/async.ts +1 -1
  206. package/src/graph/call/call.hook.ts +3 -3
  207. package/src/graph/call/stream.hook.ts +1 -1
  208. package/src/graph/index.ts +18 -18
  209. package/src/graph/memory/read/idle.ts +1 -1
  210. package/src/graph/memory/read/read.ts +4 -4
  211. package/src/graph/memory/scope.ts +3 -3
  212. package/src/graph/mutate/move.hook.ts +5 -5
  213. package/src/graph/mutate/mutate.hook.ts +3 -3
  214. package/src/graph/query/children.hook.ts +4 -4
  215. package/src/graph/query/graph.hook.ts +1 -1
  216. package/src/graph/query/neighbors.hook.ts +7 -15
  217. package/src/graph/query/node.hook.ts +4 -4
  218. package/src/graph/query/query.hook.ts +2 -2
  219. package/src/index.ts +25 -25
  220. package/src/intents/index.ts +5 -5
  221. package/src/intents/listen-intent.hook.ts +4 -4
  222. package/src/intents/reply.ts +1 -1
  223. package/src/intents/send-intent.hook.ts +3 -3
  224. package/src/navigation/adapters/adapter.ts +1 -1
  225. package/src/navigation/adapters/memory.adapter.ts +2 -2
  226. package/src/navigation/adapters/url.adapter.ts +2 -2
  227. package/src/navigation/hooks/ancestors.hook.ts +7 -7
  228. package/src/navigation/hooks/location.hook.ts +3 -3
  229. package/src/navigation/hooks/navigate.hook.ts +2 -2
  230. package/src/navigation/hooks/scope.hook.ts +6 -6
  231. package/src/navigation/index.ts +15 -15
  232. package/src/navigation/link.tsx +3 -3
  233. package/src/navigation/location.ts +1 -1
  234. package/src/navigation/scope.context.tsx +9 -9
  235. package/src/navigation/snapshot.ts +3 -3
  236. package/src/schema/bind-read.ts +7 -7
  237. package/src/schema/binding.ts +20 -23
  238. package/src/schema/domain.hook.ts +3 -3
  239. package/src/schema/function.hook.ts +4 -4
  240. package/src/schema/index.ts +15 -9
  241. package/src/schema/kernel.hook.ts +3 -3
  242. package/src/schema/method.hook.ts +11 -11
  243. package/src/schema/types.ts +2 -2
  244. package/src/schema/write.ts +14 -4
  245. package/src/selection/index.ts +3 -3
  246. package/src/selection/live.ts +1 -1
  247. package/src/selection/scope.context.tsx +2 -2
  248. package/src/selection/selection.hook.ts +2 -2
  249. package/src/session/boot/boot.ts +1 -1
  250. package/src/session/boot/status.ts +1 -1
  251. package/src/session/connection/connection.hook.ts +3 -3
  252. package/src/session/index.ts +7 -7
  253. package/src/session/kernel-client.hook.ts +1 -1
  254. package/src/session/kernel-instance.hook.ts +1 -1
  255. package/src/session/provider.tsx +12 -12
  256. package/src/session/shell.hook.ts +1 -1
  257. package/src/window/adopt.ts +2 -2
  258. package/src/window/hooks/close-guard.hook.ts +1 -1
  259. package/src/window/hooks/target-node.hook.ts +4 -4
  260. package/src/window/hooks/views-for.hook.ts +4 -4
  261. package/src/window/hooks/window.hook.ts +3 -3
  262. package/src/window/hooks/windows.hook.ts +2 -2
  263. package/src/window/host.tsx +8 -8
  264. package/src/window/hub.ts +4 -4
  265. package/src/window/index.ts +14 -14
  266. package/src/window/stage.tsx +3 -3
@@ -3,8 +3,8 @@
3
3
  * query string (URL form → `<a href>`), owning the nav query keys (`param`,
4
4
  * `view`, the location's `params`).
5
5
  */
6
- import type { SerializedLocation } from '../history'
7
- import type { NavAdapter } from './adapter'
6
+ import type { SerializedLocation } from '../history.js'
7
+ import type { NavAdapter } from './adapter.js'
8
8
 
9
9
  const VIEW_KEY = 'view'
10
10
 
@@ -8,14 +8,14 @@ import type { LiveResult, ShapeInput } from '@astrale-os/kernel-client/store'
8
8
  */
9
9
  import { useMemo } from 'react'
10
10
 
11
- import type { ReadState } from '../../graph/memory/read/envelope'
12
- import type { Node } from '../location'
11
+ import type { ReadState } from '../../graph/memory/read/envelope.js'
12
+ import type { Node } from '../location.js'
13
13
 
14
- import { idleReadState } from '../../graph/memory/read/idle'
15
- import { useMemory } from '../../graph/memory/scope'
16
- import { chainPaths, pathHint, pathOf } from '../location'
17
- import { useHistoryVersion, useOptionalNavCtx, useMemoryShape } from '../scope.context'
18
- import { serializeTarget } from '../snapshot'
14
+ import { idleReadState } from '../../graph/memory/read/idle.js'
15
+ import { useMemory } from '../../graph/memory/scope.js'
16
+ import { chainPaths, pathHint, pathOf } from '../location.js'
17
+ import { useHistoryVersion, useOptionalNavCtx, useMemoryShape } from '../scope.context.js'
18
+ import { serializeTarget } from '../snapshot.js'
19
19
 
20
20
  /**
21
21
  * The root-first ancestor chain (inclusive of the node itself), live: a move
@@ -4,10 +4,10 @@
4
4
  */
5
5
  import { useMemo } from 'react'
6
6
 
7
- import type { NavLocation } from '../location'
7
+ import type { NavLocation } from '../location.js'
8
8
 
9
- import { buildLocation, useSettled } from '../location'
10
- import { useHistoryVersion, useNavCtx, useMemoryShape } from '../scope.context'
9
+ import { buildLocation, useSettled } from '../location.js'
10
+ import { useHistoryVersion, useNavCtx, useMemoryShape } from '../scope.context.js'
11
11
 
12
12
  /** The nearest scope's live location. Throws outside any {@link NavScope}. */
13
13
  export function useLocation(): NavLocation {
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import { useMemo } from 'react'
7
7
 
8
- import type { MutableNavigate, NavCtx, Navigate } from '../scope.context'
8
+ import type { MutableNavigate, NavCtx, Navigate } from '../scope.context.js'
9
9
 
10
- import { useHistoryVersion, useNavCtx } from '../scope.context'
10
+ import { useHistoryVersion, useNavCtx } from '../scope.context.js'
11
11
 
12
12
  /** The nearest scope's imperative navigation surface. Throws outside a scope. */
13
13
  export function useNavigate(): Navigate {
@@ -5,13 +5,13 @@
5
5
  */
6
6
  import { useCallback, useMemo } from 'react'
7
7
 
8
- import type { NavSnapshot } from '../history'
9
- import type { NavLocation } from '../location'
10
- import type { Navigate } from '../scope.context'
8
+ import type { NavSnapshot } from '../history.js'
9
+ import type { NavLocation } from '../location.js'
10
+ import type { Navigate } from '../scope.context.js'
11
11
 
12
- import { buildLocation, useSettled } from '../location'
13
- import { useNavCtx, useMemoryShape } from '../scope.context'
14
- import { useNavigateHandle } from './navigate.hook'
12
+ import { buildLocation, useSettled } from '../location.js'
13
+ import { useNavCtx, useMemoryShape } from '../scope.context.js'
14
+ import { useNavigateHandle } from './navigate.hook.js'
15
15
 
16
16
  /** The nearest scope, for chrome/persistence (API §8.2). */
17
17
  export interface NavScopeHandle {
@@ -1,17 +1,17 @@
1
1
  // navigation — API §8 (NavScope, useLocation, useNavigate, Link, useAncestors,
2
2
  // useNavScope, adapters). See SHELL_REACT_API.md.
3
- export { NavScope } from './scope.context'
4
- export type { MissingPolicy, NavScopeProps, Navigate } from './scope.context'
5
- export { useLocation } from './hooks/location.hook'
6
- export { useNavigate } from './hooks/navigate.hook'
7
- export { useAncestors } from './hooks/ancestors.hook'
8
- export { useNavScope } from './hooks/scope.hook'
9
- export type { NavScopeHandle } from './hooks/scope.hook'
10
- export { Link } from './link'
11
- export type { LinkProps } from './link'
12
- export { memoryAdapter } from './adapters/memory.adapter'
13
- export { urlAdapter } from './adapters/url.adapter'
14
- export type { NavAdapter } from './adapters/adapter'
15
- export type { NavLocation } from './location'
16
- export type { NavSnapshot, SerializedLocation } from './history'
17
- export type { NavTarget } from './snapshot'
3
+ export { NavScope } from './scope.context.js'
4
+ export type { MissingPolicy, NavScopeProps, Navigate } from './scope.context.js'
5
+ export { useLocation } from './hooks/location.hook.js'
6
+ export { useNavigate } from './hooks/navigate.hook.js'
7
+ export { useAncestors } from './hooks/ancestors.hook.js'
8
+ export { useNavScope } from './hooks/scope.hook.js'
9
+ export type { NavScopeHandle } from './hooks/scope.hook.js'
10
+ export { Link } from './link.js'
11
+ export type { LinkProps } from './link.js'
12
+ export { memoryAdapter } from './adapters/memory.adapter.js'
13
+ export { urlAdapter } from './adapters/url.adapter.js'
14
+ export type { NavAdapter } from './adapters/adapter.js'
15
+ export type { NavLocation } from './location.js'
16
+ export type { NavSnapshot, SerializedLocation } from './history.js'
17
+ export type { NavTarget } from './snapshot.js'
@@ -16,10 +16,10 @@ import type {
16
16
  */
17
17
  import { useCallback, useEffect } from 'react'
18
18
 
19
- import type { NavTarget } from './snapshot'
19
+ import type { NavTarget } from './snapshot.js'
20
20
 
21
- import { useNavCtx } from './scope.context'
22
- import { serializeTarget } from './snapshot'
21
+ import { useNavCtx } from './scope.context.js'
22
+ import { serializeTarget } from './snapshot.js'
23
23
 
24
24
  export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
25
25
  to: NavTarget
@@ -9,7 +9,7 @@ import { rawOf } from '@astrale-os/kernel-client/graph'
9
9
  */
10
10
  import { useEffect, useRef } from 'react'
11
11
 
12
- import type { SerializedLocation } from './history'
12
+ import type { SerializedLocation } from './history.js'
13
13
 
14
14
  /**
15
15
  * The rich graph `Node`, derived from the memory's read envelope — kernel-client
@@ -20,16 +20,16 @@ import {
20
20
  useSyncExternalStore,
21
21
  } from 'react'
22
22
 
23
- import type { NavAdapter } from './adapters/adapter'
24
- import type { NavSnapshot, SerializedLocation } from './history'
25
- import type { NavLocation } from './location'
26
- import type { NavTarget } from './snapshot'
23
+ import type { NavAdapter } from './adapters/adapter.js'
24
+ import type { NavSnapshot, SerializedLocation } from './history.js'
25
+ import type { NavLocation } from './location.js'
26
+ import type { NavTarget } from './snapshot.js'
27
27
 
28
- import { useMemory } from '../graph/memory/scope'
29
- import { memoryAdapter } from './adapters/memory.adapter'
30
- import { NavHistory, seedEntries } from './history'
31
- import { buildLocation, parentPath, pathHint, pathOf, useSettled } from './location'
32
- import { revalidateAndPrune, serializeTarget } from './snapshot'
28
+ import { useMemory } from '../graph/memory/scope.js'
29
+ import { memoryAdapter } from './adapters/memory.adapter.js'
30
+ import { NavHistory, seedEntries } from './history.js'
31
+ import { buildLocation, parentPath, pathHint, pathOf, useSettled } from './location.js'
32
+ import { revalidateAndPrune, serializeTarget } from './snapshot.js'
33
33
 
34
34
  /** The imperative navigation surface (API §8.2). */
35
35
  export interface Navigate {
@@ -9,9 +9,9 @@ import type { GraphMemory } from '@astrale-os/kernel-client/store'
9
9
  */
10
10
  import { normalizeRef } from '@astrale-os/kernel-client'
11
11
 
12
- import type { NavHistory } from './history'
13
- import type { SerializedLocation } from './history'
14
- import type { Node, NodeId } from './location'
12
+ import type { NavHistory } from './history.js'
13
+ import type { SerializedLocation } from './history.js'
14
+ import type { Node, NodeId } from './location.js'
15
15
 
16
16
  /** Everything `navigate()` / `Link` / `initial` accept (API §8.1). */
17
17
  export type NavTarget =
@@ -29,14 +29,14 @@ import { compileDomain } from '@astrale-os/kernel-core/domain'
29
29
  */
30
30
  import { useCallback, useMemo, useRef, useSyncExternalStore } from 'react'
31
31
 
32
- import type { ReadState, ReadOptions } from '../graph/memory/read/envelope'
33
- import type { TypedChildrenResult, TypedNodeResult } from './types'
32
+ import type { ReadState, ReadOptions } from '../graph/memory/read/envelope.js'
33
+ import type { TypedChildrenResult, TypedNodeResult } from './types.js'
34
34
 
35
- import { useSessionKernel } from '../auth/session-kernel'
36
- import { idleReadState, isIdleInput } from '../graph/memory/read/idle'
37
- import { useMemory } from '../graph/memory/scope'
38
- import { bindingFor } from './binding'
39
- import { schemaOf, tagSchema } from './tag'
35
+ import { useSessionKernel } from '../auth/session-kernel.js'
36
+ import { idleReadState, isIdleInput } from '../graph/memory/read/idle.js'
37
+ import { useMemory } from '../graph/memory/scope.js'
38
+ import { bindingFor } from './binding.js'
39
+ import { schemaOf, tagSchema } from './tag.js'
40
40
 
41
41
  // ── binder hooks ────────────────────────────────────────────────────────────────
42
42
 
@@ -13,15 +13,13 @@ import type { Schema } from '@astrale-os/kernel-dsl'
13
13
 
14
14
  import { createSchemaBoundView } from '@astrale-os/kernel-client'
15
15
 
16
- import type { SessionView } from '../auth/act-as.context'
16
+ import type { SessionView } from '../auth/act-as.context.js'
17
17
 
18
- import { tagSchema } from './tag'
19
- import { recordPath, writableFor } from './write'
20
-
21
- type AnyBinding = SchemaBoundView<Schema, FnMap>
18
+ import { tagSchema } from './tag.js'
19
+ import { recordPath, writableFor } from './write.js'
22
20
 
23
21
  /** One tagged binding per (kernel, schema) — shared across the whole tree. */
24
- const bindingCache = new WeakMap<object, WeakMap<Schema, AnyBinding>>()
22
+ const bindingCache = new WeakMap<object, WeakMap<Schema, unknown>>()
25
23
 
26
24
  /**
27
25
  * Resolve (and memoize) the tagged schema-bound handle for `schema` on `kernel`.
@@ -39,28 +37,26 @@ export function bindingFor<S extends Schema>(
39
37
  bySchema = new WeakMap()
40
38
  bindingCache.set(kernel, bySchema)
41
39
  }
42
- let binding = bySchema.get(schema)
43
- if (binding === undefined) {
44
- const { writable, pathIndex } = writableFor(kernel, memory)
45
- binding = tagBinding(createSchemaBoundView(writable, schema) as AnyBinding, schema, pathIndex)
46
- bySchema.set(schema, binding)
47
- }
48
- return binding as SchemaBoundView<S, FnMap>
40
+ const cached = bySchema.get(schema)
41
+ if (cached !== undefined) return cached as SchemaBoundView<S, FnMap>
42
+
43
+ const { writable, pathIndex } = writableFor(kernel, memory)
44
+ const binding = tagBinding(createSchemaBoundView(writable, schema), schema, pathIndex)
45
+ bySchema.set(schema, binding)
46
+ return binding
49
47
  }
50
48
 
51
49
  /**
52
50
  * Wrap a binding so `bind`/`bindAny`/`as` outputs carry a schema tag, and every
53
51
  * bound wire node's `id → tree path` is recorded (the write cap's index); the
54
- * bare-call dispatch and every other member pass straight through.
52
+ * class handles and every other member pass straight through.
55
53
  */
56
- function tagBinding(
57
- binding: AnyBinding,
58
- schema: Schema,
54
+ function tagBinding<S extends Schema>(
55
+ binding: SchemaBoundView<S, FnMap>,
56
+ schema: S,
59
57
  pathIndex: Map<string, string>,
60
- ): AnyBinding {
61
- const handler: ProxyHandler<AnyBinding> = {
62
- apply: (target, _thisArg, args) =>
63
- (target as unknown as (...a: unknown[]) => unknown)(...(args as unknown[])),
58
+ ): SchemaBoundView<S, FnMap> {
59
+ const handler: ProxyHandler<SchemaBoundView<S, FnMap>> = {
64
60
  get: (target, prop, receiver) => {
65
61
  const value = Reflect.get(target, prop, receiver) as unknown
66
62
  if (prop === 'bind') {
@@ -79,8 +75,9 @@ function tagBinding(
79
75
  }
80
76
  }
81
77
  if (prop === 'as') {
82
- return (credential: unknown) =>
83
- tagBinding((value as (c: unknown) => AnyBinding)(credential), schema, pathIndex)
78
+ const as = value as SchemaBoundView<S, FnMap>['as']
79
+ return (credential: Parameters<typeof as>[0]) =>
80
+ tagBinding(as(credential), schema, pathIndex)
84
81
  }
85
82
  return value
86
83
  },
@@ -6,9 +6,9 @@
6
6
  import type { FnMap, SchemaBoundView } from '@astrale-os/kernel-client'
7
7
  import type { Schema } from '@astrale-os/kernel-dsl'
8
8
 
9
- import { useSessionKernel } from '../auth/session-kernel'
10
- import { useMemory } from '../graph/memory/scope'
11
- import { bindingFor } from './binding'
9
+ import { useSessionKernel } from '../auth/session-kernel.js'
10
+ import { useMemory } from '../graph/memory/scope.js'
11
+ import { bindingFor } from './binding.js'
12
12
 
13
13
  /** The typed domain binding — `kernel.withSchema(schema)`, memoized per (session, schema). */
14
14
  export function useDomain<S extends Schema>(schema: S): SchemaBoundView<S, FnMap> {
@@ -9,11 +9,11 @@ import { compileDomain } from '@astrale-os/kernel-core/domain'
9
9
  */
10
10
  import { useCallback, useMemo, useRef } from 'react'
11
11
 
12
- import type { Action } from '../graph/action'
13
- import type { FunctionNames, FunctionParams, FunctionResult } from './types'
12
+ import type { Action } from '../graph/action.js'
13
+ import type { FunctionNames, FunctionParams, FunctionResult } from './types.js'
14
14
 
15
- import { useAction } from '../graph/action'
16
- import { useDomain } from './domain.hook'
15
+ import { useAction } from '../graph/action.js'
16
+ import { useDomain } from './domain.hook.js'
17
17
 
18
18
  export interface FunctionOptions {
19
19
  /** Extra failure channel; the action still rejects and records `.error`. */
@@ -1,13 +1,19 @@
1
1
  // schema — the typing substrate (API §6). Typed kernel/domain bindings, typed
2
2
  // reads, method/function dispatch. See SHELL_REACT_API.md.
3
- export { useKernel } from './kernel.hook'
4
- export { useDomain } from './domain.hook'
5
- export { useNode, useChildren, useBoundNode, useBoundNodes, useBoundEndpoints } from './bind-read'
6
- export { useOut, useIn } from '../graph/query/neighbors.hook'
7
- export { useMethod } from './method.hook'
8
- export type { MethodOptions } from './method.hook'
9
- export { useFunction } from './function.hook'
10
- export type { FunctionOptions } from './function.hook'
3
+ export { useKernel } from './kernel.hook.js'
4
+ export { useDomain } from './domain.hook.js'
5
+ export {
6
+ useNode,
7
+ useChildren,
8
+ useBoundNode,
9
+ useBoundNodes,
10
+ useBoundEndpoints,
11
+ } from './bind-read.js'
12
+ export { useOut, useIn } from '../graph/query/neighbors.hook.js'
13
+ export { useMethod } from './method.hook.js'
14
+ export type { MethodOptions } from './method.hook.js'
15
+ export { useFunction } from './function.hook.js'
16
+ export type { FunctionOptions } from './function.hook.js'
11
17
  export type {
12
18
  AutoMethodAction,
13
19
  BoundMethodAction,
@@ -22,4 +28,4 @@ export type {
22
28
  TargetedMethodAction,
23
29
  TypedChildrenResult,
24
30
  TypedNodeResult,
25
- } from './types'
31
+ } from './types.js'
@@ -7,9 +7,9 @@ import type { FnMap, SchemaBoundView } from '@astrale-os/kernel-client'
7
7
 
8
8
  import { KernelSchema } from '@astrale-os/kernel-core'
9
9
 
10
- import { useSessionKernel } from '../auth/session-kernel'
11
- import { useMemory } from '../graph/memory/scope'
12
- import { bindingFor } from './binding'
10
+ import { useSessionKernel } from '../auth/session-kernel.js'
11
+ import { useMemory } from '../graph/memory/scope.js'
12
+ import { bindingFor } from './binding.js'
13
13
 
14
14
  /** The typed kernel — `kernel.withSchema(KernelSchema)`, memoized (§4-scoped). */
15
15
  export function useKernel(): SchemaBoundView<typeof KernelSchema, FnMap> {
@@ -12,11 +12,11 @@ import { resolveAllMethods } from '@astrale-os/kernel-dsl'
12
12
  */
13
13
  import { useCallback, useMemo, useRef } from 'react'
14
14
 
15
- import type { Action } from '../graph/action'
16
- import type { AutoMethodAction, BoundMethodAction, MethodNames } from './types'
15
+ import type { Action } from '../graph/action.js'
16
+ import type { AutoMethodAction, BoundMethodAction, MethodNames } from './types.js'
17
17
 
18
- import { useAction } from '../graph/action'
19
- import { useDomain } from './domain.hook'
18
+ import { useAction } from '../graph/action.js'
19
+ import { useDomain } from './domain.hook.js'
20
20
 
21
21
  export interface MethodOptions {
22
22
  /** Bind the action to this node — dispatch as `action(params)`. */
@@ -45,7 +45,7 @@ export function useMethod<S extends Schema, T extends TypeNames<S>, M extends Me
45
45
  method: M,
46
46
  opts?: MethodOptions,
47
47
  ): Action<never[], unknown> {
48
- const binding = useDomain(schema) as unknown as Dispatcher
48
+ const binding = useDomain(schema) as unknown as DynamicBinding
49
49
  const on = opts?.on
50
50
  const isStatic = useMemo(() => detectStatic(schema, type, String(method)), [schema, type, method])
51
51
 
@@ -70,26 +70,26 @@ export function useMethod<S extends Schema, T extends TypeNames<S>, M extends Me
70
70
  return useAction(call)
71
71
  }
72
72
 
73
- /** The bare-call dispatch signature of a `SchemaBoundView`, address-only. */
74
- type Dispatcher = (type: string, ref?: NodeRefInput) => unknown
73
+ type DynamicClassHandle = Dispatch & ((ref: NodeRefInput) => Dispatch)
74
+ type DynamicBinding = { classes: Record<string, DynamicClassHandle> }
75
75
 
76
76
  function staticCall(
77
- binding: Dispatcher,
77
+ binding: DynamicBinding,
78
78
  type: string,
79
79
  method: string,
80
80
  params: unknown,
81
81
  ): Promise<unknown> {
82
- return (binding(type) as unknown as Dispatch)[method]!(params)
82
+ return binding.classes[type]![method]!(params)
83
83
  }
84
84
 
85
85
  function instance(
86
- binding: Dispatcher,
86
+ binding: DynamicBinding,
87
87
  type: string,
88
88
  ref: NodeRefInput,
89
89
  method: string,
90
90
  params: unknown,
91
91
  ): Promise<unknown> {
92
- return (binding(type, ref) as unknown as Dispatch)[method]!(params)
92
+ return binding.classes[type]!(ref)[method]!(params)
93
93
  }
94
94
 
95
95
  /** Read the method's `static` flag from the schema (own + inherited). */
@@ -23,8 +23,8 @@ import type {
23
23
  Schema,
24
24
  } from '@astrale-os/kernel-dsl'
25
25
 
26
- import type { Action } from '../graph/action'
27
- import type { ReadState, Windowed } from '../graph/memory/read/envelope'
26
+ import type { Action } from '../graph/action.js'
27
+ import type { ReadState, Windowed } from '../graph/memory/read/envelope.js'
28
28
 
29
29
  // ── Read envelopes ──────────────────────────────────────────────────────────────
30
30
 
@@ -10,7 +10,7 @@ import type { CredentialInput } from '@astrale-os/kernel-client'
10
10
  import type { PathLike, Properties } from '@astrale-os/kernel-client/graph'
11
11
  import type { GraphMemory } from '@astrale-os/kernel-client/store'
12
12
 
13
- import type { SessionView } from '../auth/act-as.context'
13
+ import type { SessionView } from '../auth/act-as.context.js'
14
14
 
15
15
  /**
16
16
  * One memory-backed writable kernel per (effective) session view, plus the
@@ -52,8 +52,7 @@ function withMemoryWrites(
52
52
  as(cred: CredentialInput | (() => CredentialInput)): SessionView
53
53
  }
54
54
  const rawUpdate = base.updateNode.bind(base)
55
- return {
56
- ...(kernel as object),
55
+ return extendCapabilities(kernel, {
57
56
  updateNode: (cls: PathLike, ref: PathLike, props: Properties): Promise<void> => {
58
57
  const path = treePathFor(pathIndex, ref)
59
58
  return path !== null ? memory.update(path, props) : rawUpdate(cls, ref, props)
@@ -62,7 +61,18 @@ function withMemoryWrites(
62
61
  memory.create(cls, at, props),
63
62
  // Credential rebind stays on the raw kernel-client floor (§6 note).
64
63
  as: (cred: CredentialInput | (() => CredentialInput)): SessionView => base.as(cred),
65
- } as unknown as SessionView
64
+ })
65
+ }
66
+
67
+ /** Clone the complete session capability object before overlaying memory writes. */
68
+ function extendCapabilities<Base extends object, Extension extends object>(
69
+ base: Base,
70
+ extension: Extension,
71
+ ): Base & Extension {
72
+ const result = Object.create(Object.getPrototypeOf(base)) as Base & Extension
73
+ Object.defineProperties(result, Object.getOwnPropertyDescriptors(base))
74
+ Object.defineProperties(result, Object.getOwnPropertyDescriptors(extension))
75
+ return result
66
76
  }
67
77
 
68
78
  /** The tree path an `@<id>` write ref maps to, via the bind-time index; else null. */
@@ -1,5 +1,5 @@
1
1
  // selection — API §9. SelectionScope + useSelection: an insertion-ordered id set
2
2
  // with an anchor, projected to LIVE memory nodes.
3
- export { SelectionScope } from './scope.context'
4
- export type { Selection, SelectionScopeProps } from './scope.context'
5
- export { useSelection } from './selection.hook'
3
+ export { SelectionScope } from './scope.context.js'
4
+ export type { Selection, SelectionScopeProps } from './scope.context.js'
5
+ export { useSelection } from './selection.hook.js'
@@ -10,7 +10,7 @@ import type { GraphMemory, ReadOptions, ShapeInput } from '@astrale-os/kernel-cl
10
10
  */
11
11
  import { useCallback, useContext, useRef, useSyncExternalStore } from 'react'
12
12
 
13
- import { GraphContext } from '../graph/graph.context'
13
+ import { GraphContext } from '../graph/graph.context.js'
14
14
 
15
15
  /** A live memory node — the non-null projection of a point read. */
16
16
  export type SelectionNode = NonNullable<ReturnType<GraphMemory['getSnapshot']>['node']>
@@ -8,9 +8,9 @@ import type { ReactElement, ReactNode } from 'react'
8
8
  */
9
9
  import { createContext, useCallback, useEffect, useMemo, useReducer, useRef } from 'react'
10
10
 
11
- import type { NodeId, SelectionNode } from './live'
11
+ import type { NodeId, SelectionNode } from './live.js'
12
12
 
13
- import { useLiveNodes, useMemory } from './live'
13
+ import { useLiveNodes, useMemory } from './live.js'
14
14
 
15
15
  /** The value `useSelection()` returns (API §9). */
16
16
  export interface Selection {
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import { useContext } from 'react'
6
6
 
7
- import type { Selection } from './scope.context'
7
+ import type { Selection } from './scope.context.js'
8
8
 
9
- import { SelectionContext } from './scope.context'
9
+ import { SelectionContext } from './scope.context.js'
10
10
 
11
11
  /** The nearest selection scope. Throws outside a `<SelectionScope>`. */
12
12
  export function useSelection(): Selection {
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import type { Shell, ShellConfig } from '@astrale-os/shell'
7
7
 
8
- import type { SelfNode } from '../session.context'
8
+ import type { SelfNode } from '../session.context.js'
9
9
 
10
10
  export function isShellConfig(config: ShellConfig | Shell): config is ShellConfig {
11
11
  return 'mode' in config
@@ -3,7 +3,7 @@
3
3
  * `connecting → ready` (with the resolved runtime) or `connecting → error`. The
4
4
  * reducer is the single transition table children render behind.
5
5
  */
6
- import type { ShellRuntime } from '../session.context'
6
+ import type { ShellRuntime } from '../session.context.js'
7
7
 
8
8
  export type BootStatus = 'connecting' | 'ready' | 'error'
9
9
 
@@ -5,10 +5,10 @@
5
5
  */
6
6
  import { useSyncExternalStore } from 'react'
7
7
 
8
- import type { ConnectionValue } from './connection.store'
8
+ import type { ConnectionValue } from './connection.store.js'
9
9
 
10
- import { useShell } from '../shell.hook'
11
- import { connectionStore } from './connection.store'
10
+ import { useShell } from '../shell.hook.js'
11
+ import { connectionStore } from './connection.store.js'
12
12
 
13
13
  export function useConnection(): ConnectionValue {
14
14
  const store = connectionStore(useShell())
@@ -1,8 +1,8 @@
1
1
  // session — API §2 (provider) + §3 (session hooks). See SHELL_REACT_API.md.
2
- export { ShellProvider } from './provider'
3
- export type { ShellError, ShellProviderProps } from './provider'
4
- export { useShell } from './shell.hook'
5
- export { useKernelClient } from './kernel-client.hook'
6
- export { useKernelInstance } from './kernel-instance.hook'
7
- export type { KernelInstance } from './kernel-instance.hook'
8
- export { useConnection } from './connection/connection.hook'
2
+ export { ShellProvider } from './provider.js'
3
+ export type { ShellError, ShellProviderProps } from './provider.js'
4
+ export { useShell } from './shell.hook.js'
5
+ export { useKernelClient } from './kernel-client.hook.js'
6
+ export { useKernelInstance } from './kernel-instance.hook.js'
7
+ export type { KernelInstance } from './kernel-instance.hook.js'
8
+ export { useConnection } from './connection/connection.hook.js'
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import type { KernelClient } from '@astrale-os/shell'
7
7
 
8
- import { useShell } from './shell.hook'
8
+ import { useShell } from './shell.hook.js'
9
9
 
10
10
  /** `shell.kernel` — the raw bound kernel view, untouched (untyped floor). */
11
11
  export function useKernelClient(): KernelClient {
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from 'react'
2
2
 
3
- import { useKernelClient } from './kernel-client.hook'
3
+ import { useKernelClient } from './kernel-client.hook.js'
4
4
 
5
5
  export interface KernelInstance {
6
6
  /** Kernel envelope endpoint this shell is bound to. */
@@ -13,18 +13,18 @@ import { createShell } from '@astrale-os/shell'
13
13
  */
14
14
  import { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react'
15
15
 
16
- import type { GraphMemory } from '../graph/graph.context'
17
- import type { BootRef } from './boot/ownership'
18
- import type { SelfNode } from './session.context'
19
-
20
- import { primeUser } from '../application/user/user.store'
21
- import { GraphContext } from '../graph/graph.context'
22
- import { baseMemoryFor, setMemoryErrorSink } from '../graph/memory/base'
23
- import { configIdentity, isShellConfig, resolveSelf } from './boot/boot'
24
- import { cancelTeardown, disposeShell, scheduleTeardown } from './boot/ownership'
25
- import { bootReducer, INITIAL_BOOT } from './boot/status'
26
- import { connectionStore } from './connection/connection.store'
27
- import { ShellContext } from './session.context'
16
+ import type { GraphMemory } from '../graph/graph.context.js'
17
+ import type { BootRef } from './boot/ownership.js'
18
+ import type { SelfNode } from './session.context.js'
19
+
20
+ import { primeUser } from '../application/user/user.store.js'
21
+ import { GraphContext } from '../graph/graph.context.js'
22
+ import { baseMemoryFor, setMemoryErrorSink } from '../graph/memory/base.js'
23
+ import { configIdentity, isShellConfig, resolveSelf } from './boot/boot.js'
24
+ import { cancelTeardown, disposeShell, scheduleTeardown } from './boot/ownership.js'
25
+ import { bootReducer, INITIAL_BOOT } from './boot/status.js'
26
+ import { connectionStore } from './connection/connection.store.js'
27
+ import { ShellContext } from './session.context.js'
28
28
 
29
29
  /** Global error channel payload (API §2). */
30
30
  export type ShellError =