import type { Shell } from '@astrale-os/shell' /** * useShell (API §3) — the live shell for this subtree, read from ShellContext. * Throws outside a ``. The imperative floor every other session * hook builds on. */ import { useContext } from 'react' import { ShellContext } from './session.context.js' /** The live shell for this subtree. Throws outside a ``. */ export function useShell(): Shell { const runtime = useContext(ShellContext) if (runtime === null) { throw new Error('useShell must be used within a ') } return runtime.shell }