feat: add environment-based local auth mode for ai-delegate
Summary
- Add
isLocalAuthEnabled()utility function to controlallowLocalModefor ai-delegate initialization - Support explicit override via
NEXT_PUBLIC_AI_DELEGATE_LOCAL_AUTHenvironment variable - Default to development mode (
NODE_ENV === 'development') when no override is set - Add console logging showing local auth mode status on initialization
Environment Variable Behavior
| Condition | Result |
|---|---|
NEXT_PUBLIC_AI_DELEGATE_LOCAL_AUTH=true |
Enabled |
NEXT_PUBLIC_AI_DELEGATE_LOCAL_AUTH=false |
Disabled |
| Env var not set + development | Enabled |
| Env var not set + production | Disabled |
Test Plan
- Logic unit tests pass (6/6)
- Development build passes
- Production build passes
Closes #136 (closed)