Commit Graph
28 Commits
Author SHA1 Message Date
Chris Scott 82d3a109ac Import existing OpenCode config on initialization and fix schema types 2025-12-20 10:11:30 -05:00
Chris ScottandChris Scott a9ebee72c4 Fix compact command validation flow (#28)
* feat: Implement /compact command with processing feedback

- Add 'compact' status type to session status store
- Update SessionStatusIndicator to show purple pulsing animation for compaction
- Add summarizeSession() API method to OpenCode client
- Modify command handler for /compact to:
  - Get current model from state
  - Show compaction toast
  - Set session to compacting status
  - Call summarize endpoint with provider/model
- Update SSE handler to clear compact status on session.compacted event

The user sees a purple animated indicator and 'Compacting' text during the operation, matching the TUI experience.

* Fix compact command to use break instead of return for model validation

---------

Co-authored-by: Chris Scott <chris@cstech.dev>
2025-12-19 00:10:12 -05:00
OpenCode Agent 6c4daaeae7 Add message undo/refresh functionality with editable user prompts
- Add revertMessage and unrevertSession methods to OpenCode API client
- Create useRemoveMessage and useRefreshMessage hooks for message operations
- Add MessageActionButtons component with X (remove) and refresh buttons
- Add EditableUserMessage component for editing prompts before resend
- Update MessageThread to integrate action buttons and editable messages
- Update AGENTS.md with improved guidelines and pnpm preference
2025-12-16 18:53:31 +00:00
Chris Scott 507d33577c Refactor TTS API to use axios and follow existing patterns 2025-12-15 15:22:59 -05:00
Chris Scott 67cb729ca7 Merge main into feature/TTS and resolve conflicts 2025-12-15 14:50:04 -05:00
Chris Scott c7de65290a Add GitHub token validation and improve TTS configuration
- Add git token validation endpoint and UI validation
- Improve TTS endpoint normalization and discovery
- Move shared types to workspace package
- Add better error handling for TTS API calls
- Support composite voices for Kokoro-style TTS
- Auto-fetch TTS models and voices on config change
2025-12-15 14:43:03 -05:00
OpenCode 406ff8fd4a Add TTS model and voice discovery with caching 2025-12-15 17:43:05 +00:00
Chris Scott 99ed632355 Add branch creation endpoint and improve git auth fallback handling 2025-12-14 19:11:27 -05:00
Chris Scott 433c2da50d Add global AGENTS.md editor and expose dev server ports 5100-5103 2025-12-12 23:38:14 -05:00
Chris Scott af9f645f30 Add ZIP download feature for repositories
- Add archive service to create ZIP files excluding gitignored files
- Add download endpoint to backend repo routes
- Add download button to repo cards with loading state
- Update README with new ZIP download feature
2025-12-12 20:48:38 -05:00
Chris Scott 4eec4e5c27 Add comprehensive JSONC support for opencode.jsonc files
- Store raw JSONC content in database, parse on-the-fly for validation
- Return rawContent field in API response for editing with comments preserved
- Update frontend to use rawContent for config editing
- Accept string or object content in create/update requests
- Download configs as .jsonc when they contain comments
- Add strip-json-comments dependency for JSONC parsing
- Add .jsonc MIME type support in backend file service

This preserves comments in opencode.jsonc files when editing through the UI
2025-12-12 15:29:53 -05:00
Chris Scott b739c5266f Switch MCP management to use OpenCode server API with version requirement >=1.0.137 2025-12-09 00:13:27 -05:00
Chris Scott bc99c96021 Add OAuth provider authentication support (#14)
* feat: Implement OAuth support for provider authentication

- Add OAuth routes and API endpoints for authorize/callback flows
- Create OAuthAuthorizeDialog and OAuthCallbackDialog components
- Extend ProviderSettings to support both OAuth and API key auth
- Add OAuth credential support to auth service
- Update shared schemas with OAuth request/response types
- Support both 'auto' and 'code' OAuth flows
- Maintain backward compatibility with existing API key authentication

Backend:
- backend/src/routes/oauth.ts (new)
- backend/src/services/auth.ts (extended)
- backend/src/index.ts (route registration)

Frontend:
- frontend/src/api/oauth.ts (new)
- frontend/src/components/settings/OAuthAuthorizeDialog.tsx (new)
- frontend/src/components/settings/OAuthCallbackDialog.tsx (new)
- frontend/src/components/settings/ProviderSettings.tsx (enhanced)

Shared:
- shared/src/schemas/auth.ts (OAuth schemas)

* feat: Complete OAuth implementation with comprehensive features

- Add comprehensive error handling for OAuth failures with specific error messages
- Implement OAuth token status checking and expiration monitoring
- Add token refresh preparation with 5-minute expiration buffer
- Enhance OAuth API client with detailed error reporting
- Update OAuth routes to include database parameter and token status endpoint
- Add complete OAuth documentation to README with setup guide
- Improve user experience with clear error messages and troubleshooting steps
- Support both auto and code OAuth flows for different providers
- Maintain backward compatibility with existing API key authentication

Error Handling:
- Specific error messages for invalid codes, expiration, access denied
- Graceful fallback for server errors and network issues
- User-friendly error display in OAuth dialogs

Token Management:
- Token status endpoint for checking credential validity
- Expiration monitoring with automatic refresh preparation
- Secure storage of OAuth credentials alongside API keys

Documentation:
- Complete OAuth setup guide in README
- Comparison table for OAuth vs API keys
- Troubleshooting section for common OAuth issues

* fix: Resolve OAuth button opening API key dialog instead

- Add isOAuthMode state to track authentication mode
- Update API key dialog to only open when not in OAuth mode
- Modify OAuth and API key button handlers to set proper mode
- Add proper cleanup handlers to reset OAuth mode on close
- Ensure dialog state management prevents conflicting dialogs

This fixes the issue where clicking 'Add OAuth' would incorrectly
open the API key dialog instead of the OAuth authorization dialog.

* refactor: Address audit findings for OAuth implementation

Critical fixes:
- Remove unused db parameter from createOAuthRoutes()
- Add query invalidation in handleOAuthSuccess to update UI after OAuth
- Remove unused setOAuth and getOAuthWithRefreshCheck methods
- Fix file permission in delete method (add mode: 0o600)

DRY improvements:
- Extract duplicated error handling to shared oauthErrors.ts utility
- Add OAuthMethod constants to replace magic numbers 0/1
- Use centralized OPENCODE_SERVER_URL constant via ENV config
- Remove unused ProviderAuthMethodsResponseSchema import

Code quality:
- Add documentation comment noting types should match shared schemas
- Consolidate error mapping logic into single mapOAuthError function
- Improve code maintainability and reduce duplication

Files changed:
- backend/src/routes/oauth.ts
- backend/src/services/auth.ts
- backend/src/index.ts
- frontend/src/lib/oauthErrors.ts (new)
- frontend/src/api/oauth.ts
- frontend/src/components/settings/OAuthAuthorizeDialog.tsx
- frontend/src/components/settings/OAuthCallbackDialog.tsx
- frontend/src/components/settings/ProviderSettings.tsx

* Store model selection client-side with recent models display

* Limit provider settings to OAuth-capable providers only

* Remove unused code and consolidate model initialization into useModelSelection hook
2025-12-07 23:01:05 -05:00
Chris Scott 8aabb79328 Handle session.idle event to fix resumed sessions showing as active 2025-12-06 12:23:33 -08:00
Chris Scott dc7964021d Add @ mention support for agents and files, extract CopyButton component 2025-12-06 11:21:06 -08:00
Chris Scott e2e6ca07ae Update provider management and model selection UI 2025-12-05 12:30:05 -08:00
Chris Scott af0dcac7c8 Add GitHub token environment variable support and improve git operations 2025-11-30 21:05:30 -05:00
Chris Scott 37b00e27ea feat: add global toast system with installation event notifications
- Add SSE event types for installation updates
- Implement global toast system using Sonner
- Add restart functionality directly in toast actions
- Update .gitignore to exclude temp directory
2025-11-29 09:48:40 -05:00
Chris Scott fb91b4d3a3 Add TTS support with OpenAI-compatible endpoint configuration
- Add TTS settings schema and configuration UI with validation
- Create backend TTS proxy with 24hr file-based caching
- Add frontend useTTS hook with Cache API caching
- Add TTS playback button on assistant messages (step-finish)
- Include test button to verify TTS configuration
2025-11-28 19:52:35 -05:00
Chris Scott 83834e7ed7 Add local repository support and permission request handling 2025-11-28 10:26:03 -05:00
Chris Scott 07d78450be Remove redundant API_BASE constants and improve mobile UI layout 2025-11-27 11:42:37 -05:00
Chris Scott ed82b99236 Add git changes viewer with diff display
- Add backend git-operations service for git status and file diffs
- Add git/status and git/diff API routes to repos
- Add GitChangesPanel component to list changed files with status
- Add FileDiffView component with unified diff rendering
- Add GitChangesSheet as full-screen dialog wrapper
- Integrate View Changes option into BranchSwitcher dropdown
- Support both mobile (stacked) and desktop (split) layouts
2025-11-27 10:10:49 -05:00
Chris Scott 12b7ab54b2 Add file virtualization and patch editing for large files 2025-11-27 09:23:10 -05:00
Chris Scott fea3c214af Add MCP server management with auto-restart functionality 2025-11-26 23:43:19 -05:00
Chris Scott 349c130311 Fix Docker build: use pnpm workspaces and route frontend API calls through backend proxy 2025-11-25 14:17:17 -05:00
Chris Scott 8a56bc208d refactor: consolidate environment config and API handling
- Update database paths and port configuration
- Remove backend config.ts and sessions route
- Add mobile file preview and files API
- Clean up shared constants and provider hooks
2025-11-25 09:39:56 -05:00
Chris Scott 1555a6d641 fix: centralize API URL configuration in constants
- Move API base URL to single constant in @/constants/api
- Update all API modules to import from centralized location
- Ensure consistent port 8080 usage across frontend
- Support VITE_API_URL environment variable for flexible deployment
2025-11-24 00:17:05 -05:00
Chris Scott bbf66c259b Initial release v0.2.5 2025-11-23 23:25:27 -05:00