Problem
Current Ink TUI calls Instance.directory without first calling Instance.provide() to set up AsyncLocalStorage context. This causes 'No context found for instance' errors.
Root Cause (from research)
cli/ink/App.tsx line 26 calls Session.createNext({ directory: Instance.directory }) without bootstrapping- Backend depends on
Instance.provide() establishing context before any Instance.directory access
Solution
Update cli/ink/entry.ts to bootstrap properly (following cli/cmd/tui/worker.ts pattern):
import{Global}from'@/global'import{Log}from'@/util/log'import{Instance,InstanceBootstrap}from'@/project/instance'import{render}from'ink'importAppfrom'./App'asyncfunctionmain(){awaitGlobal.init()awaitLog.init({print: false,dev: false,level: 'INFO'})awaitInstance.provide({directory: process.cwd(),init: InstanceBootstrap,fn: async()=>{render(<App/>)}})}main()What InstanceBootstrap Initializes
- Plugin system
- Share/ShareNext (collaboration)
- Format (code formatting)
- LSP (language servers)
- FileWatcher
- File operations
- Vcs (version control)
- Snapshot
- Truncate
Acceptance Criteria
Problem
Current Ink TUI calls
Instance.directorywithout first callingInstance.provide()to set up AsyncLocalStorage context. This causes 'No context found for instance' errors.Root Cause (from research)
cli/ink/App.tsxline 26 callsSession.createNext({ directory: Instance.directory })without bootstrappingInstance.provide()establishing context before anyInstance.directoryaccessSolution
Update
cli/ink/entry.tsto bootstrap properly (followingcli/cmd/tui/worker.tspattern):What InstanceBootstrap Initializes
Acceptance Criteria
~/bin/ocliteworks without separate server