import type { GraphStore } from '@astrale-os/sdk/client/store' import type { KernelClient, Shell } from '@astrale-os/shell' /** * ShellContext — the shell session seat. Holds ONLY the stable `Shell` for a * provider subtree (plus the whoami resolved once at boot). Connection state is * NOT here: it is a provider-owned store read via `useConnection` (rule 3). */ import { createContext } from 'react' import type { GraphStoreScope } from '../graph/store.js' /** * whoami's node type, derived from the SDK auth surface so this package does * not duplicate the canonical Client node projection. */ export type SelfNode = Awaited> /** The live shell for a provider subtree (and, later, an `` subtree). */ export interface ShellRuntime { readonly shell: Shell /** * whoami resolved at boot; the auth module (`useSelf`) reads it. Null when the * bound kernel exposes no auth surface (a bare prebuilt Shell in tests). */ readonly self: SelfNode | null readonly storeScope: GraphStoreScope readonly store: GraphStore readonly ownsStore: boolean } export const ShellContext = createContext(null) ShellContext.displayName = 'AstraleShellContext'