- Import conversation service functions and types from inlineWizardConversation.ts
- Add isWaiting and ready state fields for loading and generation readiness tracking
- Add agentType and sessionName state fields for session configuration
- Add conversationSessionRef to track active conversation session across renders
- Add loadDocumentContents() helper to load document content for iterate mode
- Update startWizard() to accept agentType/sessionName and initialize conversation session
- Update sendMessage() to call sendWizardMessage() service and update state with response
- Update endWizard() to be async and properly cleanup conversation session
- Add computed readyToGenerate property (ready=true && confidence >= 80)
- Update InlineWizardContext to expose new state fields
- Update tests with mocks for new conversation service dependencies
When startWizard() is called, the hook now:
- Checks for existing Auto Run documents using hasExistingAutoRunDocs()
- If no input provided and docs exist, sets mode to 'ask' (prompt user)
- If input provided, calls parseWizardIntent() to determine mode
- If mode is 'iterate', loads existing docs using getExistingAutoRunDocs()
Added new state fields:
- isInitializing: true while async init operations are running
- existingDocuments: loaded docs for iterate mode context
- projectPath: stored for document detection
The startWizard function is now async and accepts a projectPath parameter.
Includes 25 unit tests for the hook covering all intent parsing scenarios,
error handling, and state management. Updated InlineWizardContext tests
(31 tests) to account for the async startWizard behavior.
Created InlineWizardContext.tsx that wraps useInlineWizard hook and
exposes all state and actions via React context. This enables components
throughout the app to access inline wizard state without prop drilling.
Changes:
- Created InlineWizardContext.tsx with InlineWizardProvider and
useInlineWizardContext hook
- Added InlineWizardProvider to App.tsx as Phase 7 in provider chain
- Re-exported types for convenience
- Added 31 unit tests covering all functionality