Commit Graph

259 Commits

Author SHA1 Message Date
cogwheel0
ada6d40e5e feat(chat): Add worker manager to streaming helper for image processing 2025-11-01 00:57:40 +05:30
cogwheel0
5d33e5fe65 fix: server side tts on ios 2025-10-31 23:20:04 +05:30
cogwheel0
cf87d255d3 feat(settings): Allow unlimited quick pill selections 2025-10-30 22:44:08 +05:30
cogwheel0
a00d64fc26 feat(transport): Improve socket transport mode selection and localization 2025-10-30 22:32:59 +05:30
cogwheel0
44149d5f81 feat(tts): add server default voice retrieval and integrate it into 2025-10-30 16:10:20 +05:30
cogwheel0
0e98f2ab2a refactor(storage): remove remember-credentials and improve error logging and handling 2025-10-30 14:28:00 +05:30
cogwheel0
7fb199b2e4 feat: implement service failure handling in background streaming
- Added a method to send failure notifications to Flutter when the background service fails to enter the foreground.
- Implemented a broadcast receiver to handle service failure notifications and notify Flutter about the failure.
- Enhanced the persistent streaming service to attempt recovery for failed streams.
- Introduced heartbeat monitoring for SSE streams to detect stale connections and trigger recovery actions.
2025-10-28 13:59:17 +05:30
cogwheel0
dded22f1ec feat: enhance error boundary widget with improved error handling and UI updates
- Added a method to ignore specific errors related to RenderFlex overflow.
- Refactored the error display layout to use a centered scrollable view.
- Improved visual presentation with a gradient background for the error icon and updated button styles for retry functionality.
2025-10-26 23:16:34 +05:30
cogwheel0
5ab3b9c4e0 feat(api): pass userSettings respect function_calling preference in 2025-10-26 23:00:01 +05:30
cogwheel0
ae48fcc035 feat(sse): add SSEStreamParser to parse Dio SSE streams and extract 2025-10-26 22:33:53 +05:30
cogwheel0
2b44e38a2e feat(i18n/socket): add WebSocket error messages and show connect errors 2025-10-25 14:24:49 +05:30
cogwheel0
1cb8926e21 feat(chat): regenerate variants and support
Hide archived assistant variants in the linear chat view and track
previous assistant as versions so regenerated responses do not
duplicate or lose history. When regenerating, mark the previous assistant
message with an archivedVariant flag for the UI and keep it in server
history. Add a ChatMessageVersion model and a versions field to
ChatMessage to store prior generated variants. Implement
archiveLastAssistantAsVersion in chat providers to snapshot the last
assistant message into versions and reset the message for a fresh
streamed generation. Finalize flow updates to attach an adjacent archived
assistant as a version when needed so the UI can present a switcher
between current and past variants. These changes prevent duplicate
messages, preserve previous responses, and enable variant switching.
2025-10-23 22:29:28 +05:30
cogwheel0
0df4b4f050 feat(ui): support authenticated image loading with cache manager
Add Riverpod-aware image header and cache manager support for network
images used in avatar and markdown widgets. Convert AvatarImage to a
ConsumerWidget and read a self-signed cache manager and HTTP headers
from Riverpod so CachedNetworkImage can send auth/custom headers and use
the provided cache manager. In Markdown image builder, obtain headers
and cache manager from a ProviderContainer (via ProviderScope.containerOf)
to enable the same authenticated loading in non-consumer contexts.

Introduce image_header_utils.dart to centralize building Authorization
and custom headers from auth/api providers, with helpers for Ref,
WidgetRef, and ProviderContainer. Add dependency adjustments in
pubspec.lock for flutter_cache_manager and http marked as direct main.

These changes ensure protected images (self-signed or auth-required)
load correctly across the app and reuse the configured cache manager.
2025-10-23 17:36:31 +05:30
cogwheel0
561e7dd616 feat(tts): server-backed TTS engine selection
Introduce server TTS support and engine selection while keeping
device TTS as the default.

- Add new persistence keys for storing TTS engine and selected
  server voice (ttsEngine, ttsServerVoiceId, ttsServerVoiceName).
- Extend TextToSpeechService to support two engines:
  TtsEngine.device (FlutterTts) and TtsEngine.server (remote audio).
- Wire in an AudioPlayer and optional ApiService to fetch raw
  audio bytes from the server and play them, with event hooks
  mapped to existing lifecycle callbacks.
- Implement fallback to device TTS on server errors or empty
  responses, and ensure player lifecycle (pause/stop/dispose)
  is handled when using server engine.
- Allow engine and preferred voice to be configured before
  initialization and updated at runtime via updateSettings.

This enables selecting a server-side voice and using a remote
TTS provider while preserving compatibility with the existing
device TTS implementation.
2025-10-23 16:31:15 +05:30
cogwheel0
d00cbe36cf refactor: Replace hardcoded monospace font with AppTypography constant
- Updated multiple instances of the 'monospace' font family to use AppTypography.monospaceFontFamily for consistency across the application.
- This change enhances maintainability and ensures a unified typography approach throughout the app.
2025-10-21 00:09:12 +05:30
cogwheel0
e05a560966 refactor: Enhance markdown processing for text-to-speech conversion
- Introduced new regex patterns to remove thinking and reasoning blocks from markdown input.
- Added functionality to strip emojis from the text, improving clarity for TTS.
- Implemented HTML entity decoding to ensure proper text representation.
- Replaced the existing sanitization method with a more comprehensive markdown-to-text conversion approach, enhancing performance and maintainability.
2025-10-20 23:53:07 +05:30
cogwheel0
27bfde8f95 refactor: Enhance onboarding process in chat and app startup providers
- Integrated autofocus management for the composer in both chat and onboarding contexts to improve user experience.
- Added error handling for focus management to ensure smooth onboarding transitions.
- Updated modal bottom sheet handling to restore autofocus state after onboarding completion, enhancing usability across the app.
2025-10-19 21:10:10 +05:30
cogwheel0
2f8fd97022 refactor: Enhance file attachment handling and UI components
- Updated the file attachment service to utilize a new LocalAttachment class, improving the management of file metadata such as display names.
- Refactored methods for picking and uploading files to accommodate the new LocalAttachment structure, ensuring consistent handling of file attributes.
- Improved the chat page to validate and manage file attachments more effectively, enhancing user experience during file uploads.
- Added functionality for image previews in the file attachment widget, allowing users to see selected images before sending.
- Introduced a remove button for attachments, improving usability by enabling users to easily discard unwanted files.
2025-10-19 13:50:54 +05:30
cogwheel0
60883315a2 refactor: Migrate to Tweakcn themes and enhance UI consistency
- Replaced references to AppColorPalettes with TweakcnThemes across various files to standardize theme usage.
- Updated the AppTheme and AppColorTokens to utilize TweakcnThemeDefinition for improved theme management.
- Adjusted UI components in ChatPage, ChatsDrawer, AppCustomizationPage, and ProfilePage to align with the new theme structure, ensuring consistent styling and color application.
- Removed the deprecated color_palettes.dart file to streamline the theme architecture.
2025-10-18 13:58:15 +05:30
cogwheel0
6c81d68e59 feat: Add Text-to-Speech settings and customization options
- Introduced new preference keys for TTS settings: voice, speech rate, pitch, and volume.
- Updated SettingsService to handle TTS settings and persist them.
- Enhanced AppSettings to include TTS-related properties.
- Implemented TTS settings UI in AppCustomizationPage, allowing users to select voice and adjust speech parameters.
- Added localization support for TTS settings in multiple languages.
2025-10-17 14:40:44 +05:30
cogwheel0
a2ae48f85f chore: update Fastlane configuration and clean up API service
- Updated the Deliverfile to submit for review and skip metadata and screenshots.
- Removed outdated build lane from Fastfile.
- Refactored API service to eliminate fallback to latest assistant message, addressing duplication issues in multi-turn conversations.
2025-10-16 23:51:18 +05:30
cogwheel0
893d8445f2 chore: bump version to 2.1.4 2025-10-16 11:45:55 +05:30
cogwheel0
762155500b feat: Improve offline detection logic
This commit refactors the connectivity service to be more robust and less prone to UI flicker.

Key changes:
- Any successful API response now briefly suppresses the offline warning. This prevents the UI from flashing an offline message between regular connectivity checks.
- The threshold for showing the offline warning is increased from 2 to 3 consecutive failed health checks.
- The timeout for health checks is increased to better handle slow networks.
- The offline warning is now suppressed if there are active data streams to avoid interrupting the user.
- A custom JSON converter is added for conversation metadata to handle potential type mismatches from local storage.
2025-10-16 11:34:28 +05:30
cogwheel0
c07ac6b427 refactor: Improve model tools auto-selection logic
This commit refactors the `modelToolsAutoSelectionProvider` to more robustly handle the automatic selection of tools when the model changes or the list of available tools is updated.

Key changes include:
- Triggering the auto-selection logic not only when the selected model changes, but also when the `toolsListProvider` finishes loading. This ensures tools are correctly applied even if they load after the model is selected.
- Restructuring the logic to handle asynchronous tool loading more gracefully, preventing race conditions.
- Using `Future.microtask` to schedule the tool application, ensuring state updates are handled correctly within the provider lifecycle.
- Clearing selected tools if the new model has no associated tools or if previously selected tools become invalid.
2025-10-13 15:25:20 +05:30
cogwheel0
7d4aca1944 fix: add tls override for websockets incase of self signed certs 2025-10-11 16:17:35 +05:30
cogwheel0
4003941482 feat: implement background task management for improved streaming continuity
- Integrated BackgroundTasks framework in iOS to manage background processing for audio streams.
- Added methods to register, schedule, and handle background tasks, allowing streams to continue for extended periods.
- Enhanced the BackgroundStreamingHandler to support background task notifications and keep-alive signals.
- Updated Info.plist to permit background task identifiers, ensuring compliance with iOS requirements.
- Improved the PersistentStreamingService to handle background task extensions and keep-alive signals effectively, enhancing overall streaming reliability.
2025-10-11 13:53:30 +05:30
cogwheel0
1333b10cd8 feat: enhance model and tools integration with auto-selection functionality
- Added a new `toolIds` field to the `Model` class to support tool identification.
- Implemented `modelToolsAutoSelectionProvider` to automatically apply model-specific tools when the selected model changes.
- Enhanced the logic to filter and set valid tool IDs based on available tools, improving user experience by ensuring relevant tools are automatically selected.
- Updated the default model auto-selection provider to initialize the new tools auto-selection feature, ensuring seamless integration within the app's lifecycle.
2025-10-11 13:27:39 +05:30
cogwheel0
7a8bd54dba refactor: remove self-signed certificate manager and streamline certificate handling
- Deleted the SelfSignedCertificateManager and its associated files to simplify the certificate management process.
- Updated ApiService and ConnectivityService to include self-signed certificate configuration directly, enhancing clarity and maintainability.
- Adjusted comments to reflect the new approach to handling self-signed certificates, ensuring better understanding of security considerations.
- Improved the application startup sequence by deferring unnecessary initializations, contributing to a more efficient first paint performance.
2025-10-11 13:16:31 +05:30
cogwheel0
968c02940f refactor: optimize application startup sequence and migration handling
- Removed the immediate initialization of SelfSignedCertificateManager to improve the app's first paint performance.
- Introduced lazy initialization of the certificate manager after the first frame, enhancing startup efficiency.
- Implemented a fast path for migration checks in PersistenceMigrator to skip unnecessary operations if already completed in the current session, improving overall performance during app startup.
- Updated comments for clarity on the changes made to the startup sequence and migration process.
2025-10-11 12:44:35 +05:30
cogwheel0
8ac71c5718 fix: improve server connection handling during authentication
- Updated AuthStateManager to clear the active server ID upon logout, ensuring a proper return to the server connection page.
- Enhanced RouterNotifier to allow users to stay on the server connection page if authenticated, improving navigation flow.
- Modified AuthenticationPage to navigate back to the server connection page instead of popping the navigation stack, enhancing user experience during server setup.
2025-10-10 22:08:23 +05:30
cogwheel0
4eb1191748 feat: enhance background streaming functionality with improved wake lock management
- Updated the wake lock duration in BackgroundStreamingHandler to 3 hours, ensuring the service remains active for longer periods.
- Modified the keepAlive method to support both iOS and Android, allowing for better background task management across platforms.
- Implemented a periodic keep-alive timer in VoiceCallService to refresh the wake lock every 5 minutes, enhancing service reliability during voice calls.
- Added debug logging for successful keep-alive invocations, improving traceability of background operations.
2025-10-10 19:59:17 +05:30
cogwheel0
778116e258 refactor: optimize socket service event handling and token management
- Updated SocketServiceManager to read the authTokenProvider3 without watching it, preventing unnecessary rebuilds on token changes.
- Enhanced SocketService to manage event listeners more effectively by adding and removing event handlers for 'events' and 'events:channel', improving overall socket management.
2025-10-09 20:51:29 +05:30
cogwheel0
a9030473b0 feat: enhance background streaming handler with microphone support
- Updated BackgroundStreamingHandler to include microphone permission handling for background execution.
- Modified startBackgroundExecution method to accept a requiresMicrophone parameter, allowing dynamic management of streams requiring microphone access.
- Adjusted service intent to pass microphone requirement status, improving service behavior based on app state.
- Enhanced VoiceCallService to utilize the new microphone support during voice call streaming, ensuring proper resource management.
2025-10-09 16:18:14 +05:30
cogwheel0
c073d71363 feat: enhance background streaming service with foreground handling
- Improved BackgroundStreamingService to manage foreground service notifications more effectively, ensuring compliance with Android requirements.
- Implemented dynamic foreground service type resolution based on microphone permission, enhancing service behavior based on app state.
- Added checks for app foreground status in connectivity management, improving responsiveness to network changes.
- Refactored notification handling to streamline service lifecycle management and improve code maintainability.
2025-10-09 15:47:27 +05:30
cogwheel0
162a5e0781 feat: enhance connectivity management and status handling
- Integrated connectivity status monitoring into the RouterNotifier to manage navigation based on network availability.
- Refactored ConnectivityService to streamline connectivity checks and improve state management, ensuring a more reliable online/offline status.
- Updated the connection issue page to directly utilize the connectivity status provider, simplifying the connectivity state handling.
- Improved offline indicator behavior to provide clearer feedback on connectivity changes.
- Enhanced the persistent streaming service to react to connectivity status changes more effectively.
2025-10-09 15:05:34 +05:30
cogwheel0
259fe3f9f0 feat: implement self-signed certificate support in API and UI
- Added support for self-signed TLS certificates in the ApiService, allowing configuration based on server settings.
- Introduced a toggle in the ServerConnectionPage to enable or disable trusting self-signed certificates.
- Updated localization files to include new strings for self-signed certificate settings in multiple languages.
- Enhanced the OptimizedStorageService to manage trusted servers based on user preferences for self-signed certificates.
- Improved error handling and logging throughout the affected services to ensure clarity and maintainability.
2025-10-09 01:49:56 +05:30
cogwheel0
052a68e3b6 chore: update dependencies and enhance connectivity service
- Added `connectivity_plus` dependency to manage network connectivity status.
- Updated `pubspec.yaml` to include the new dependency version.
- Enhanced `ConnectivityService` to utilize `connectivity_plus` for improved connectivity monitoring and handling.
- Refactored connectivity checks and state management for better performance and reliability.
2025-10-09 00:45:00 +05:30
cogwheel0
fabb1df63a feat: enhance text-to-speech functionality with markdown support
- Integrated markdown conversion in TextToSpeechController to clean text before speech synthesis, ensuring only valid content is spoken.
- Updated VoiceCallService to utilize markdown conversion for responses, improving the clarity of spoken content.
- Enhanced VoiceCallPage to display cleaned text from markdown, providing a better user experience during voice interactions.
2025-10-09 00:20:36 +05:30
cogwheel0
c08bfa773d refactor: remove redundant socket handler bindings in SocketService
- Eliminated unnecessary calls to _bindCoreSocketHandlers() in the SocketService class, streamlining the socket event subscription process.
- Improved code clarity and maintainability by reducing redundant method invocations during socket event handling.
2025-10-06 00:15:51 +05:30
cogwheel0
a2e5f46d62 refactor: optimize regex patterns for image and markdown processing
- Introduced pre-compiled regex patterns across various components, including streaming_helper, markdown_stream_formatter, and assistant_message_widget, to enhance performance during image extraction and markdown formatting.
- Updated the AssistantMessageWidget to utilize these optimized patterns for TTS sanitization and image processing, reducing unnecessary regex evaluations.
- Improved overall efficiency in handling markdown content by leveraging pre-compiled patterns for common markdown syntax detection.
2025-10-06 00:09:52 +05:30
cogwheel0
3af46b379b refactor: optimize regex handling in markdown and tool calls parsing
- Improved performance by pre-compiling regex patterns in the ConduitMarkdownPreprocessor for better efficiency during streaming.
- Enhanced the ToolCallsParser to conditionally run cleanup regex only when necessary, ensuring cleaner and more efficient text processing.
- Updated the AssistantMessageWidget to perform quick checks before cleaning raw tags, reducing unnecessary operations and improving overall performance.
2025-10-05 23:51:48 +05:30
cogwheel0
a8ae2644f5 refactor: improve background streaming service and error handling
- Updated BackgroundStreamingService to start in the foreground immediately to prevent timeout issues, with a placeholder notification.
- Enhanced error handling in BackgroundStreamingHandler to catch exceptions when starting the foreground service, ensuring active streams are cleared if the service fails to start.
- Refactored saveStreamStatesForRecovery method to improve logging and clarity in stream state management.
- Added checks to close suspended stream controllers when transitioning to the foreground, enhancing resource management.
2025-10-05 23:16:44 +05:30
cogwheel0
5d37235851 refactor: enhance connectivity service with disposal checks
- Added checks in the ConnectivityService to prevent operations on a closed stream controller, ensuring stability and preventing potential errors.
- Updated the timer creation and stream addition logic to only execute if the service is not disposed, improving resource management.
- Enhanced the dispose method to safely close the connectivity controller, maintaining clean resource handling.
2025-10-05 12:36:56 +05:30
cogwheel0
305d3ffee6 refactor: update connectivity service to use base URI for server health checks
- Refactored the ConnectivityService to replace health URI references with base URI for improved clarity and consistency.
- Updated methods to probe server health and resolve URIs, ensuring a more streamlined approach to connectivity checks.
- Enhanced the provider setup to create a Dio instance with custom headers from the active server configuration, improving flexibility in server communication.
2025-10-05 02:50:50 +05:30
cogwheel0
072453d588 refactor: remove omitProviderInModelName functionality and related localization
- Removed the omitProviderInModelName key from PreferenceKeys and its associated logic throughout the codebase.
- Updated SettingsService and AppSettings to eliminate references to the omitted provider functionality.
- Cleaned up related localization strings in multiple languages to reflect the removal of this feature.
- Enhanced code clarity and maintainability by streamlining settings management.
2025-10-04 23:43:35 +05:30
cogwheel0
758ed411b0 refactor: enhance markdown processing and code structure
- Updated the ConduitMarkdown class to streamline markdown rendering, improving maintainability and clarity.
- Refactored the markdown configuration to utilize new methods for building markdown blocks and handling LaTeX syntax.
- Improved the StreamingMarkdownWidget to leverage the updated markdown processing logic, ensuring a cohesive user experience.
- Enhanced the handling of Mermaid diagrams and LaTeX rendering, providing better support for complex markdown content.
2025-10-04 16:04:49 +05:30
cogwheel0
e04b43949b refactor: migrate to flutter_math_fork and markdown_widget for enhanced markdown capabilities
- Replaced flutter_markdown_plus with flutter_math_fork to improve mathematical rendering within markdown content.
- Integrated markdown_widget for better markdown processing and rendering, enhancing overall user experience.
- Updated the markdown configuration to utilize the new packages, ensuring maintainability and adaptability of markdown features.
- Refactored the streaming markdown widget to accommodate the new markdown processing logic, improving code clarity and performance.
2025-10-04 13:37:47 +05:30
cogwheel0
1ea85d5ed1 refactor: enhance theme and error handling across the application
- Updated error handling in EnhancedErrorService to utilize context for color tokens, improving theme consistency.
- Refactored various components to use context-aware shadow and color properties, enhancing visual coherence.
- Replaced hardcoded color values with dynamic tokens in multiple widgets, ensuring better adaptability to theme changes.
- Improved overall code maintainability by centralizing theme-related logic and reducing direct dependencies on static theme values.
2025-10-03 00:12:25 +05:30
cogwheel0
5138491cfa refactor: optimize app initialization and startup flow
- Delayed heavy provider initialization to improve initial UI responsiveness.
- Introduced a queuing mechanism for provider initialization with staggered delays.
- Updated app startup flow to ensure proper handling of mounted state during asynchronous operations.
- Enhanced socket service management and background model loading to improve app performance and reliability.
2025-10-02 21:33:58 +05:30
cogwheel0
e58a6e533f chore: update splash and launcher images across multiple resolutions
- Replaced splash screen images in various drawable folders (hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi).
- Updated launcher background and icon images in mipmap folders for different resolutions.
- Modified app icon images in iOS asset catalog for various sizes and devices.
- Enhanced launch images for better visual consistency across platforms.
2025-10-02 21:09:01 +05:30