@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.
- package/dist/application/apps/app-host.d.ts +2 -2
- package/dist/application/apps/app-host.d.ts.map +1 -1
- package/dist/application/apps/app-host.js +3 -3
- package/dist/application/apps/apps.hook.d.ts +1 -1
- package/dist/application/apps/apps.hook.d.ts.map +1 -1
- package/dist/application/apps/apps.hook.js +4 -4
- package/dist/application/apps/open-app.hook.d.ts +1 -1
- package/dist/application/apps/open-app.hook.d.ts.map +1 -1
- package/dist/application/apps/open-app.hook.js +3 -3
- package/dist/application/index.d.ts +16 -16
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +9 -9
- package/dist/application/roles.hook.d.ts +1 -1
- package/dist/application/roles.hook.d.ts.map +1 -1
- package/dist/application/roles.hook.js +3 -3
- package/dist/application/spaces/current-space.hook.d.ts +1 -1
- package/dist/application/spaces/current-space.hook.d.ts.map +1 -1
- package/dist/application/spaces/current-space.hook.js +3 -3
- package/dist/application/spaces/space.hook.d.ts +1 -1
- package/dist/application/spaces/space.hook.d.ts.map +1 -1
- package/dist/application/spaces/space.hook.js +4 -4
- package/dist/application/spaces/spaces.hook.d.ts +2 -2
- package/dist/application/spaces/spaces.hook.d.ts.map +1 -1
- package/dist/application/spaces/spaces.hook.js +5 -5
- package/dist/application/user/user.hook.js +2 -2
- package/dist/auth/act-as.context.d.ts +1 -1
- package/dist/auth/act-as.context.d.ts.map +1 -1
- package/dist/auth/act-as.context.js +1 -1
- package/dist/auth/auth.hook.js +2 -2
- package/dist/auth/can.hook.d.ts +1 -1
- package/dist/auth/can.hook.d.ts.map +1 -1
- package/dist/auth/can.hook.js +2 -2
- package/dist/auth/index.d.ts +5 -5
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +4 -4
- package/dist/auth/self.hook.d.ts +1 -1
- package/dist/auth/self.hook.d.ts.map +1 -1
- package/dist/auth/self.hook.js +1 -1
- package/dist/auth/session-kernel.d.ts +1 -1
- package/dist/auth/session-kernel.d.ts.map +1 -1
- package/dist/auth/session-kernel.js +2 -2
- package/dist/graph/async.d.ts +1 -1
- package/dist/graph/async.d.ts.map +1 -1
- package/dist/graph/call/call.hook.d.ts +1 -1
- package/dist/graph/call/call.hook.d.ts.map +1 -1
- package/dist/graph/call/call.hook.js +2 -2
- package/dist/graph/call/stream.hook.js +1 -1
- package/dist/graph/index.d.ts +18 -18
- package/dist/graph/index.d.ts.map +1 -1
- package/dist/graph/index.js +8 -8
- package/dist/graph/memory/read/idle.d.ts +1 -1
- package/dist/graph/memory/read/idle.d.ts.map +1 -1
- package/dist/graph/memory/read/read.d.ts +1 -1
- package/dist/graph/memory/read/read.d.ts.map +1 -1
- package/dist/graph/memory/read/read.js +3 -3
- package/dist/graph/memory/scope.js +3 -3
- package/dist/graph/mutate/move.hook.d.ts +2 -2
- package/dist/graph/mutate/move.hook.d.ts.map +1 -1
- package/dist/graph/mutate/move.hook.js +3 -3
- package/dist/graph/mutate/mutate.hook.d.ts +1 -1
- package/dist/graph/mutate/mutate.hook.d.ts.map +1 -1
- package/dist/graph/mutate/mutate.hook.js +2 -2
- package/dist/graph/query/children.hook.d.ts +2 -2
- package/dist/graph/query/children.hook.d.ts.map +1 -1
- package/dist/graph/query/children.hook.js +2 -2
- package/dist/graph/query/graph.hook.js +1 -1
- package/dist/graph/query/neighbors.hook.d.ts +2 -2
- package/dist/graph/query/neighbors.hook.d.ts.map +1 -1
- package/dist/graph/query/neighbors.hook.js +4 -7
- package/dist/graph/query/node.hook.d.ts +2 -2
- package/dist/graph/query/node.hook.d.ts.map +1 -1
- package/dist/graph/query/node.hook.js +2 -2
- package/dist/graph/query/query.hook.d.ts +1 -1
- package/dist/graph/query/query.hook.d.ts.map +1 -1
- package/dist/graph/query/query.hook.js +1 -1
- package/dist/index.d.ts +25 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/intents/index.d.ts +5 -5
- package/dist/intents/index.d.ts.map +1 -1
- package/dist/intents/index.js +2 -2
- package/dist/intents/listen-intent.hook.d.ts +1 -1
- package/dist/intents/listen-intent.hook.d.ts.map +1 -1
- package/dist/intents/listen-intent.hook.js +3 -3
- package/dist/intents/reply.js +1 -1
- package/dist/intents/send-intent.hook.d.ts +1 -1
- package/dist/intents/send-intent.hook.d.ts.map +1 -1
- package/dist/intents/send-intent.hook.js +2 -2
- package/dist/navigation/adapters/adapter.d.ts +1 -1
- package/dist/navigation/adapters/adapter.d.ts.map +1 -1
- package/dist/navigation/adapters/memory.adapter.d.ts +2 -2
- package/dist/navigation/adapters/memory.adapter.d.ts.map +1 -1
- package/dist/navigation/adapters/url.adapter.d.ts +1 -1
- package/dist/navigation/adapters/url.adapter.d.ts.map +1 -1
- package/dist/navigation/hooks/ancestors.hook.d.ts +2 -2
- package/dist/navigation/hooks/ancestors.hook.d.ts.map +1 -1
- package/dist/navigation/hooks/ancestors.hook.js +5 -5
- package/dist/navigation/hooks/location.hook.d.ts +1 -1
- package/dist/navigation/hooks/location.hook.d.ts.map +1 -1
- package/dist/navigation/hooks/location.hook.js +2 -2
- package/dist/navigation/hooks/navigate.hook.d.ts +1 -1
- package/dist/navigation/hooks/navigate.hook.d.ts.map +1 -1
- package/dist/navigation/hooks/navigate.hook.js +1 -1
- package/dist/navigation/hooks/scope.hook.d.ts +3 -3
- package/dist/navigation/hooks/scope.hook.d.ts.map +1 -1
- package/dist/navigation/hooks/scope.hook.js +3 -3
- package/dist/navigation/index.d.ts +15 -15
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +8 -8
- package/dist/navigation/link.d.ts +1 -1
- package/dist/navigation/link.d.ts.map +1 -1
- package/dist/navigation/link.js +2 -2
- package/dist/navigation/location.d.ts +1 -1
- package/dist/navigation/location.d.ts.map +1 -1
- package/dist/navigation/scope.context.d.ts +5 -5
- package/dist/navigation/scope.context.d.ts.map +1 -1
- package/dist/navigation/scope.context.js +5 -5
- package/dist/navigation/snapshot.d.ts +3 -3
- package/dist/navigation/snapshot.d.ts.map +1 -1
- package/dist/schema/bind-read.d.ts +2 -2
- package/dist/schema/bind-read.d.ts.map +1 -1
- package/dist/schema/bind-read.js +5 -5
- package/dist/schema/binding.d.ts +1 -1
- package/dist/schema/binding.d.ts.map +1 -1
- package/dist/schema/binding.js +11 -11
- package/dist/schema/domain.hook.js +3 -3
- package/dist/schema/function.hook.d.ts +2 -2
- package/dist/schema/function.hook.d.ts.map +1 -1
- package/dist/schema/function.hook.js +2 -2
- package/dist/schema/index.d.ts +9 -9
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +6 -6
- package/dist/schema/kernel.hook.js +3 -3
- package/dist/schema/method.hook.d.ts +1 -1
- package/dist/schema/method.hook.d.ts.map +1 -1
- package/dist/schema/method.hook.js +4 -4
- package/dist/schema/types.d.ts +2 -2
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/write.d.ts +1 -1
- package/dist/schema/write.d.ts.map +1 -1
- package/dist/schema/write.js +9 -3
- package/dist/selection/index.d.ts +3 -3
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +2 -2
- package/dist/selection/live.js +1 -1
- package/dist/selection/scope.context.d.ts +1 -1
- package/dist/selection/scope.context.d.ts.map +1 -1
- package/dist/selection/scope.context.js +1 -1
- package/dist/selection/selection.hook.d.ts +1 -1
- package/dist/selection/selection.hook.d.ts.map +1 -1
- package/dist/selection/selection.hook.js +1 -1
- package/dist/session/boot/boot.d.ts +1 -1
- package/dist/session/boot/boot.d.ts.map +1 -1
- package/dist/session/boot/status.d.ts +1 -1
- package/dist/session/boot/status.d.ts.map +1 -1
- package/dist/session/connection/connection.hook.d.ts +1 -1
- package/dist/session/connection/connection.hook.d.ts.map +1 -1
- package/dist/session/connection/connection.hook.js +2 -2
- package/dist/session/index.d.ts +7 -7
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +5 -5
- package/dist/session/kernel-client.hook.js +1 -1
- package/dist/session/kernel-instance.hook.js +1 -1
- package/dist/session/provider.js +8 -8
- package/dist/session/shell.hook.js +1 -1
- package/dist/window/adopt.d.ts +2 -2
- package/dist/window/adopt.d.ts.map +1 -1
- package/dist/window/hooks/close-guard.hook.js +1 -1
- package/dist/window/hooks/target-node.hook.d.ts +2 -2
- package/dist/window/hooks/target-node.hook.d.ts.map +1 -1
- package/dist/window/hooks/target-node.hook.js +2 -2
- package/dist/window/hooks/views-for.hook.d.ts +2 -2
- package/dist/window/hooks/views-for.hook.d.ts.map +1 -1
- package/dist/window/hooks/views-for.hook.js +2 -2
- package/dist/window/hooks/window.hook.d.ts +1 -1
- package/dist/window/hooks/window.hook.d.ts.map +1 -1
- package/dist/window/hooks/window.hook.js +2 -2
- package/dist/window/hooks/windows.hook.js +2 -2
- package/dist/window/host.d.ts +2 -2
- package/dist/window/host.d.ts.map +1 -1
- package/dist/window/host.js +4 -4
- package/dist/window/hub.d.ts +3 -3
- package/dist/window/hub.d.ts.map +1 -1
- package/dist/window/hub.js +1 -1
- package/dist/window/index.d.ts +14 -14
- package/dist/window/index.d.ts.map +1 -1
- package/dist/window/index.js +7 -7
- package/dist/window/stage.js +3 -3
- package/package.json +7 -7
- package/src/application/apps/app-host.tsx +6 -6
- package/src/application/apps/apps.hook.ts +6 -6
- package/src/application/apps/open-app.hook.ts +4 -4
- package/src/application/index.ts +16 -16
- package/src/application/roles.hook.ts +4 -4
- package/src/application/spaces/current-space.hook.ts +4 -4
- package/src/application/spaces/space.hook.ts +5 -5
- package/src/application/spaces/spaces.hook.ts +7 -7
- package/src/application/user/user.hook.ts +2 -2
- package/src/auth/act-as.context.tsx +2 -2
- package/src/auth/auth.hook.ts +3 -3
- package/src/auth/can.hook.ts +3 -3
- package/src/auth/index.ts +5 -5
- package/src/auth/self.hook.ts +2 -2
- package/src/auth/session-kernel.ts +3 -3
- package/src/graph/async.ts +1 -1
- package/src/graph/call/call.hook.ts +3 -3
- package/src/graph/call/stream.hook.ts +1 -1
- package/src/graph/index.ts +18 -18
- package/src/graph/memory/read/idle.ts +1 -1
- package/src/graph/memory/read/read.ts +4 -4
- package/src/graph/memory/scope.ts +3 -3
- package/src/graph/mutate/move.hook.ts +5 -5
- package/src/graph/mutate/mutate.hook.ts +3 -3
- package/src/graph/query/children.hook.ts +4 -4
- package/src/graph/query/graph.hook.ts +1 -1
- package/src/graph/query/neighbors.hook.ts +7 -15
- package/src/graph/query/node.hook.ts +4 -4
- package/src/graph/query/query.hook.ts +2 -2
- package/src/index.ts +25 -25
- package/src/intents/index.ts +5 -5
- package/src/intents/listen-intent.hook.ts +4 -4
- package/src/intents/reply.ts +1 -1
- package/src/intents/send-intent.hook.ts +3 -3
- package/src/navigation/adapters/adapter.ts +1 -1
- package/src/navigation/adapters/memory.adapter.ts +2 -2
- package/src/navigation/adapters/url.adapter.ts +2 -2
- package/src/navigation/hooks/ancestors.hook.ts +7 -7
- package/src/navigation/hooks/location.hook.ts +3 -3
- package/src/navigation/hooks/navigate.hook.ts +2 -2
- package/src/navigation/hooks/scope.hook.ts +6 -6
- package/src/navigation/index.ts +15 -15
- package/src/navigation/link.tsx +3 -3
- package/src/navigation/location.ts +1 -1
- package/src/navigation/scope.context.tsx +9 -9
- package/src/navigation/snapshot.ts +3 -3
- package/src/schema/bind-read.ts +7 -7
- package/src/schema/binding.ts +20 -23
- package/src/schema/domain.hook.ts +3 -3
- package/src/schema/function.hook.ts +4 -4
- package/src/schema/index.ts +15 -9
- package/src/schema/kernel.hook.ts +3 -3
- package/src/schema/method.hook.ts +11 -11
- package/src/schema/types.ts +2 -2
- package/src/schema/write.ts +14 -4
- package/src/selection/index.ts +3 -3
- package/src/selection/live.ts +1 -1
- package/src/selection/scope.context.tsx +2 -2
- package/src/selection/selection.hook.ts +2 -2
- package/src/session/boot/boot.ts +1 -1
- package/src/session/boot/status.ts +1 -1
- package/src/session/connection/connection.hook.ts +3 -3
- package/src/session/index.ts +7 -7
- package/src/session/kernel-client.hook.ts +1 -1
- package/src/session/kernel-instance.hook.ts +1 -1
- package/src/session/provider.tsx +12 -12
- package/src/session/shell.hook.ts +1 -1
- package/src/window/adopt.ts +2 -2
- package/src/window/hooks/close-guard.hook.ts +1 -1
- package/src/window/hooks/target-node.hook.ts +4 -4
- package/src/window/hooks/views-for.hook.ts +4 -4
- package/src/window/hooks/window.hook.ts +3 -3
- package/src/window/hooks/windows.hook.ts +2 -2
- package/src/window/host.tsx +8 -8
- package/src/window/hub.ts +4 -4
- package/src/window/index.ts +14 -14
- 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 {
|
package/src/navigation/index.ts
CHANGED
|
@@ -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'
|
package/src/navigation/link.tsx
CHANGED
|
@@ -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 =
|
package/src/schema/bind-read.ts
CHANGED
|
@@ -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
|
|
package/src/schema/binding.ts
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return binding
|
|
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
|
-
*
|
|
52
|
+
* class handles and every other member pass straight through.
|
|
55
53
|
*/
|
|
56
|
-
function tagBinding(
|
|
57
|
-
binding:
|
|
58
|
-
schema:
|
|
54
|
+
function tagBinding<S extends Schema>(
|
|
55
|
+
binding: SchemaBoundView<S, FnMap>,
|
|
56
|
+
schema: S,
|
|
59
57
|
pathIndex: Map<string, string>,
|
|
60
|
-
):
|
|
61
|
-
const handler: ProxyHandler<
|
|
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
|
-
|
|
83
|
-
|
|
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`. */
|
package/src/schema/index.ts
CHANGED
|
@@ -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 {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
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
|
-
|
|
74
|
-
type
|
|
73
|
+
type DynamicClassHandle = Dispatch & ((ref: NodeRefInput) => Dispatch)
|
|
74
|
+
type DynamicBinding = { classes: Record<string, DynamicClassHandle> }
|
|
75
75
|
|
|
76
76
|
function staticCall(
|
|
77
|
-
binding:
|
|
77
|
+
binding: DynamicBinding,
|
|
78
78
|
type: string,
|
|
79
79
|
method: string,
|
|
80
80
|
params: unknown,
|
|
81
81
|
): Promise<unknown> {
|
|
82
|
-
return
|
|
82
|
+
return binding.classes[type]![method]!(params)
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
function instance(
|
|
86
|
-
binding:
|
|
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
|
|
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). */
|
package/src/schema/types.ts
CHANGED
|
@@ -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
|
|
package/src/schema/write.ts
CHANGED
|
@@ -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
|
-
}
|
|
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. */
|
package/src/selection/index.ts
CHANGED
|
@@ -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'
|
package/src/selection/live.ts
CHANGED
|
@@ -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 {
|
package/src/session/boot/boot.ts
CHANGED
|
@@ -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())
|
package/src/session/index.ts
CHANGED
|
@@ -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 {
|
package/src/session/provider.tsx
CHANGED
|
@@ -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 =
|