Commit Graph
289 Commits
Author SHA1 Message Date
Steven EnamakelandGitHub ef9c117e9e test: expand agent harness coverage (#513)
* feat(tests): add comprehensive unit tests for hooks and memory context

- Introduced a suite of tests for the `fire_hooks` function, ensuring that all hooks are dispatched even if one fails, enhancing reliability in the hook execution flow.
- Added tests for the `sanitize_tool_output` function to validate the correct mapping of success and failure messages for various tool outputs.
- Implemented a mock memory structure to facilitate testing of memory context building, ensuring that working memory is prioritized and deduplication occurs correctly.
- Enhanced the `build_memory_context` function tests to verify filtering and truncation of memory entries, improving the robustness of memory management in the system.
- Overall, these tests aim to strengthen the codebase by ensuring that critical functionalities related to hooks and memory context are thoroughly validated.

* feat(tests): enhance unit tests for provider alias resolution and prompt options

- Updated the `provider_alias_and_route_selection_round_trip` test to dynamically resolve the first provider from the registry, ensuring accurate alias resolution.
- Added new tests for `DumpPromptOptions` and `ComposioStubTools`, validating default settings and expected tool names.
- Introduced tests for rendering main agent dumps, ensuring tool instructions and skill counts are correctly included in the output.
- Enhanced prompt handling tests to cover cache boundary extraction and subagent render options, improving overall test coverage and reliability.

* feat(tests): enhance error handling and formatting in unit tests

- Added new tests for `AgentError` variants to validate string formatting and error recovery from `anyhow`.
- Improved formatting consistency in existing tests for better readability.
- Enhanced the `sanitize_tool_output` test to ensure accurate mapping of success and failure messages.
- Updated memory loader tests to enforce minimum limits and budget constraints, ensuring robust memory management.
- Overall, these changes aim to strengthen the test suite by improving coverage and clarity in error handling scenarios.

* feat(tests): add unit tests for tool filtering and subagent dump rendering

- Introduced new tests to validate the filtering of tools based on named scopes and disallowed tools, ensuring correct tool selection in debug dumps.
- Added tests for rendering subagent dumps, including handling file prompt fallbacks and missing files without panicking.
- Enhanced the workspace prompt handling to prefer custom prompt locations, improving the flexibility and reliability of agent prompt rendering.
- Overall, these additions strengthen the test suite by covering critical functionalities related to tool filtering and prompt rendering.

* feat(tests): add comprehensive unit tests for memory loader and multimodal helpers

- Introduced new tests for the memory loader to validate behavior when the header exceeds budget and when recall fails, ensuring robust memory management.
- Added tests for multimodal helpers, covering image marker counting, payload extraction, and MIME type normalization, enhancing the reliability of multimodal interactions.
- Overall, these additions strengthen the test suite by improving coverage and ensuring correct functionality in memory handling and multimodal processing.

* feat(tests): add unit tests for tool execution and agent behavior

- Introduced new tests for the `run_tool_call_loop` function, validating the rejection of vision markers for non-vision providers and ensuring correct streaming of final text chunks.
- Added tests to verify that CLI-only tools are blocked in prompt mode and that native tool results are persisted as tool messages.
- Enhanced the `Agent` class with tests for error handling and event publishing during single runs, ensuring robust agent behavior in various scenarios.
- Overall, these additions strengthen the test suite by improving coverage and reliability in tool execution and agent interactions.

* feat(tests): enhance tool execution and agent behavior tests

- Added new tests for the `run_tool_call_loop` function, including scenarios for auto-approving supervised tools on non-CLI channels and handling unknown tools with default max iterations.
- Introduced `ErrorResultTool` and `FailingTool` to simulate error conditions during tool execution, improving coverage of error handling in the agent.
- Updated the `ScriptedProvider` to return results wrapped in `anyhow::Result`, ensuring consistent error handling across test cases.
- Overall, these enhancements strengthen the test suite by validating tool execution paths and agent behavior under various conditions.

* refactor(tests): improve test readability and structure

- Enhanced formatting in various test cases for better clarity and consistency, including the use of line breaks and indentation.
- Updated assertions to improve readability by aligning them with Rust's idiomatic style.
- Overall, these changes aim to strengthen the test suite by making it more maintainable and easier to understand.

* docs(agent): enhance module documentation for agent domain

- Added comprehensive documentation to the `mod.rs` file, detailing the agent domain's purpose, key components, and their functionalities.
- Improved clarity on how LLMs interact with the system, manage conversation history, and handle autonomous behaviors.
- This update aims to enhance understanding and maintainability of the agent domain within the OpenHuman project.

* docs(agent): improve documentation and formatting across multiple files

- Enhanced comments and documentation in `dispatcher.rs`, `error.rs`, `hooks.rs`, and `harness/mod.rs` for better clarity and consistency.
- Adjusted formatting in the `TurnContext` and `ToolCallRecord` structs to improve readability and understanding of their purpose and functionality.
- Overall, these changes aim to strengthen the documentation and maintainability of the agent domain within the OpenHuman project.

* feat(tests): add comprehensive tests for memory loader and agent behavior

- Introduced new tests for the `DefaultMemoryLoader`, validating error propagation during primary recall failures and ensuring correct context emission when working memory is present.
- Added tests to verify behavior when the working memory section exceeds budget constraints, enhancing memory management robustness.
- Overall, these additions strengthen the test suite by improving coverage and reliability in memory handling and agent interactions.

* refactor(tests): improve formatting and readability in memory loader tests

- Reformatted the `load_context` calls in memory loader tests for better readability by chaining method calls.
- Enhanced documentation comments in the `pformat.rs` file to clarify the purpose and functionality of functions.
- Improved consistency in spacing and formatting across various sections of the codebase, including the `interrupt.rs` and `builder.rs` files.
- Overall, these changes aim to enhance code clarity and maintainability within the test suite and related modules.

* feat(tests): add new tests for self-healing interceptor and local AI provider

- Introduced tests to validate the detection of missing commands in the `SelfHealingInterceptor`, ensuring proper handling of recognized and unrecognized patterns.
- Added tests for the `ensure_polyfill_dir` method to confirm directory creation and path exposure.
- Enhanced local AI provider tests to verify correct behavior when the service is ready and the appropriate tier is set, as well as ensuring local metadata is utilized during provider resolution.
- Overall, these additions strengthen the test suite by improving coverage and reliability in self-healing and local AI functionalities.

* refactor(tests): enhance test structure and external ID handling in escalation tests

- Updated the `envelope` function to accept an `external_id` parameter, improving flexibility in test scenarios.
- Modified various test cases to utilize specific external IDs, enhancing clarity and ensuring accurate event assertions.
- Introduced a mutex lock in local AI tests to prevent race conditions, ensuring reliable test execution.
- Overall, these changes improve the robustness and maintainability of the test suite for escalation and local AI functionalities.

* refactor(tests): remove redundant test modules and improve test organization

- Eliminated unused test modules from `hooks.rs`, `memory_loader.rs`, `fork_context.rs`, `interrupt.rs`, and `parse.rs` to streamline the codebase.
- Enhanced overall test organization by consolidating relevant tests into appropriate files, improving maintainability and readability.
- These changes aim to simplify the test structure and focus on active test cases, ensuring a cleaner and more efficient testing environment.

* refactor(tests): improve test formatting and readability

- Reformatted assertions in multiple test cases for better readability by aligning them with Rust's idiomatic style.
- Enhanced the structure of test cases by using line breaks and consistent indentation, improving overall clarity.
- These changes aim to strengthen the test suite by making it more maintainable and easier to understand.

* refactor(api): improve string containment check and formatting in transcript handling

- Updated the `key_bytes_from_string` function to use a more concise containment check for special characters.
- Changed the message writing in the `write_transcript` function to utilize `writeln!` for better formatting.
- Enhanced the condition in `latest_in_dir` to use `is_none_or` for improved readability and clarity.
- These changes aim to streamline code and enhance maintainability across the API and transcript handling modules.

* refactor(code): streamline function implementations and improve readability

- Removed unnecessary whitespace in `run_voice_server_command` for cleaner code.
- Simplified directory search logic in `bundled_openclaw_prompts_dir` by using `find` instead of a loop.
- Updated `request_accessibility_access` to use direct references for keys and values, enhancing clarity.
- Improved documentation formatting in `mod.rs` and `types.rs` for better consistency.
- Refactored `Config` initialization in `load.rs` to use struct update syntax for clarity.
- Added `#[allow(clippy::too_many_arguments)]` annotations in multiple functions to address linter warnings.
- Enhanced type definitions and function signatures for better type safety and readability in various modules.
- Overall, these changes aim to improve code maintainability and readability across the project.

* chore(ci): update typecheck workflow and pre-push hooks to include clippy checks

- Modified the GitHub Actions workflow to run clippy with warnings treated as errors for the `openhuman` package.
- Enhanced the pre-push hook to include clippy checks, ensuring code quality before pushing changes.
- Updated package.json to define a new script for running clippy, integrating it into the format check process.
- These changes aim to improve code quality and maintainability by enforcing stricter linting rules.

* refactor(api): simplify condition in key_bytes_from_string function

- Streamlined the condition in the `key_bytes_from_string` function to improve readability by consolidating the if statement into a single line.
- This change enhances code clarity while maintaining the original functionality of the key validation process.

* chore(package): update format:check script to remove clippy integration

- Modified the `format:check` script in `package.json` to exclude the clippy check, streamlining the formatting process.
- This change simplifies the formatting workflow while maintaining the integrity of Rust formatting checks.

* refactor(core): enhance documentation and structure in core modules

- Improved documentation across various core functions, including `build_registered_controllers`, `run_from_cli_args`, and `dispatch`, to clarify their purpose and usage.
- Streamlined comments to provide clearer guidance on the flow of operations and error handling.
- Enhanced the structure of the `EventBus` and `NativeRegistry` to improve readability and maintainability.
- Overall, these changes aim to improve code clarity and facilitate easier navigation and understanding of the core components.

* refactor(core): reorganize imports in engine.rs for clarity

- Adjusted the import statements in `engine.rs` to improve organization and readability.
- Moved the macOS-specific import of `validate_focused_target` to a more appropriate location and ensured consistent ordering of imports.
- These changes aim to enhance code clarity and maintainability within the core module.

* refactor(core): enhance WebChannelEvent structure and documentation

- Introduced a new `WebChannelEvent` struct to standardize event payloads for chat-related activities, including fields for event name, client ID, thread ID, request ID, and optional response details.
- Improved documentation for the `attach_socketio` function, clarifying its role in setting up Socket.IO event handlers and the associated chat logic.
- Removed unused structs and streamlined the event handling process to improve code clarity and maintainability across the core module.

* refactor(core): streamline Socket.IO event handlers for clarity and consistency

- Refactored the Socket.IO event handlers in `attach_socketio` to improve readability by standardizing the formatting and structure of the code.
- Enhanced the organization of the event handling logic for `rpc:request`, `chat:start`, and `chat:cancel` events, making it easier to follow the flow of operations.
- These changes aim to improve code maintainability and facilitate easier navigation within the Socket.IO integration.

* feat(core): add new structs for Socket RPC and chat events

- Introduced `SocketRpcRequest`, `ChatStartPayload`, and `ChatCancelPayload` structs to facilitate handling of Socket.IO events related to chat functionality.
- These additions enhance the structure and clarity of the event payloads, improving the maintainability of the Socket.IO integration.

* refactor(core): remove unused json_type_name function from socketio.rs

- Eliminated the `json_type_name` function from `socketio.rs` as it was not utilized in the current codebase.
- This change helps to clean up the code and improve maintainability by removing unnecessary functions.

* chore(ci): update clippy command in typecheck workflow

- Modified the clippy command in the GitHub Actions workflow to remove the `-D warnings` flag for the `openhuman` package, allowing warnings to be displayed without failing the build.
- This change aims to improve the development experience by providing more flexibility during code analysis while still encouraging code quality.

* chore(husky): remove clippy check from pre-push hook

- Eliminated the clippy command from the pre-push hook to streamline the pre-push checks.
- Updated the failure message to reflect the removal of clippy, focusing on format, lint, TypeScript, and Rust errors only.
- This change simplifies the pre-push process while maintaining essential checks for code quality.

* refactor(tests): add macOS-specific imports for enhanced test coverage

- Introduced conditional imports for macOS in the tests module of `engine.rs` to support platform-specific functionality.
- This change improves the test setup for macOS environments, ensuring compatibility and enhancing overall test coverage.

* refactor(tests): update tool call execution in test cases

- Modified the `execute_tool_call` method calls in multiple test cases to include a second parameter, improving the accuracy of the tests.
- This change ensures that the tests reflect the latest method signature and enhances the reliability of the test outcomes.
2026-04-12 13:30:24 -07:00
Steven EnamakelandGitHub 8635ac16c5 feat: real-time inference progress events for web channel (#514)
* feat(conversations): implement real-time inference status tracking

- Added new event listeners for inference start, iteration start, subagent spawning, and completion to track the live state of chat interactions.
- Introduced an `InferenceStatus` interface to manage the current phase and active tools/subagents for each thread.
- Updated the UI to display inference status indicators, enhancing user experience during chat interactions.
- Created a new `progress` module in the Rust backend to emit real-time progress events, allowing for better integration with the web channel.
- Refactored the `subscribeChatEvents` function to include new event handlers for managing inference and subagent events, improving clarity and maintainability of the event handling logic.

* style: fix formatting from pre-push hook

* fix(test): read SSE events until chat_done instead of first event

The e2e test expected `chat_done` as the first SSE event, but now
real-time progress events (inference_start, iteration_start) are
emitted before it. Use `read_sse_event_by_type` to skip progress
events and wait for the terminal `chat_done` event.
2026-04-12 11:58:36 -07:00
Steven EnamakelandGitHub 403f239ca5 refactor: remove QuickJS skills runtime (#508)
* refactor: remove quickjs skills runtime

* style: apply repo formatting

* refactor: clean up error reporting and connection handling

- Removed the 'skill' source option from the error report structure to streamline error reporting.
- Refactored the ConnectionsPanel component to simplify connection status badge rendering and improve clarity.
- Updated the CronJobsPanel to enhance logging for cron job loading processes.
- Adjusted SkillCard component to use a more consistent type for icons.
- Deleted outdated end-to-end tests for Gmail and Notion skills, improving test suite maintainability.

* fix: remove unnecessary ESLint disable comment in Conversations component

- Cleaned up the Conversations component by removing the ESLint disable comment for exhaustive dependencies in the useEffect hook, improving code clarity and maintainability.

* fix: remove unnecessary whitespace in Conversations component

- Eliminated an extra line of whitespace in the Conversations component, enhancing code readability and maintainability.

* refactor: streamline SkillCard imports for improved clarity

- Combined import statements in the SkillCard component to enhance code readability and maintainability.
2026-04-11 14:57:35 -07:00
Steven EnamakelandGitHub 73f8d1287a refactor: remove hardware-related components and streamline service management (#502)
* feat(config): introduce pre-login user directory structure

- Added support for a pre-login user directory to encapsulate configuration, memory, and state before any user logs in. This ensures that all initial data is scoped under a dedicated user directory (`users/local`), preventing direct writes to the root `.openhuman` path.
- Implemented the `pre_login_user_dir` function to return the appropriate path for the pre-login user.
- Updated configuration loading logic to defer disk state creation until the first successful login, enhancing user data management and isolation.
- Added tests to verify the correct behavior of the pre-login directory structure.

* refactor: remove hardware-related components and streamline service management

- Deleted hardware configuration and related tools from the codebase, including `HardwareConfig`, `HardwareTransport`, and associated memory management tools.
- Introduced a new `service.ts` module for managing service and daemon commands, consolidating service-related functionalities.
- Updated import paths across the application to reflect the removal of hardware references and the addition of the new service management module.
- Refactored the `build_system_prompt` function to remove hardware access instructions, focusing on action instructions instead.
- Cleaned up the Cargo.toml and Cargo.lock files by removing unused dependencies related to hardware management.

* chore: apply formatting and tauri lockfile sync

* refactor(tests): extract config file writing logic into a reusable function

- Introduced a `write_config_file` function to encapsulate the logic for creating directories and writing configuration files, improving code reuse and readability.
- Updated test cases to utilize the new function for writing configuration files, ensuring consistency and reducing duplication.
- Added handling for pre-login user directory structure to ensure configuration is correctly written to the appropriate paths.
2026-04-10 22:55:47 -07:00
Steven EnamakelandGitHub 31297ad19d refactor(memory): remove GLiNER/GLiREL ingestion phase (#499)
* refactor(memory): replace GLiNER model with heuristic extraction

- Removed GLiNER-related code and dependencies from the memory ingestion pipeline, transitioning to a heuristic-only extraction approach.
- Updated documentation and comments to reflect changes in extraction methods.
- Adjusted tests to ensure compatibility with the new heuristic extraction configuration.
- Bumped version of the tokenizers dependency and updated Cargo.lock accordingly.

* chore: apply formatting and tauri lockfile sync
2026-04-10 20:52:36 -07:00
Mega MindandGitHub 9118bfb5d6 Fix/skill start issue (#498)
* chore: update .gitignore and bump openhuman version to 0.52.2

- Added `overlay/src-tauri/target/` to .gitignore to prevent tracking of build artifacts.
- Updated the openhuman package version from 0.52.0 to 0.52.2 in Cargo.lock files for both the main and app/src-tauri directories.
- Enhanced entitlements for macOS Hardened Runtime to allow outbound HTTPS calls and server connections.
- Refactored registry operations to use rustls explicitly, improving network reliability on macOS.

* refactor(logging): improve debug message formatting in fetch_url_bytes function

- Updated the logging statement in the fetch_url_bytes function to enhance readability by formatting the debug message across multiple lines. This change improves clarity in log outputs, making it easier to track the number of bytes fetched from URLs.

* feat(skill-setup): enhance OAuth handling and skill status synchronization

- Introduced a managed OAuth auto-advance mechanism to ensure it runs only once per login attempt, improving user experience during authentication.
- Updated the SkillSetupWizard to handle skill runtime checks more effectively, ensuring that the skill starts correctly and transitions to the setup phase seamlessly.
- Enhanced the useSkillSnapshot hook to provide a synthesized offline snapshot when the skill is not yet running, preventing UI stalls during loading.
- Implemented background synchronization after OAuth completion to ensure users see fresh data immediately without blocking the UI.
- Added tests to validate the new behavior for skills setup completion and status retrieval without requiring the skill to be started first.

* refactor(skills): streamline setup_complete retrieval in handle_skills_status function

- Simplified the retrieval of the `setup_complete` variable by removing unnecessary line breaks, enhancing code readability and maintainability.
- This change improves the clarity of the function's logic without altering its functionality.

* refactor(skills): simplify success message and remove initial sync from OAuth flow

- Updated the success message in the SkillSetupWizard to remove references to background syncing, streamlining user communication.
- Removed the initial sync trigger from the SkillManager after OAuth completion, shifting the responsibility for data synchronization to the user interface or cron jobs.
- Adjusted comments in the desktopDeepLinkListener to reflect the new sync behavior, clarifying that initial data sync is no longer automatic.

* fix(pr-498): address CodeRabbit review and CI failures

- SkillSetupWizard: only show complete after startSetup succeeds; error on failures
- hooks: merge prior snapshot into offline fallback; use const arrow for helper
- E2E: reset skills_set_setup_complete in finally for isolation
- json_rpc_e2e: assert oauth/complete returns start() result; add minimal start()
- Skills page tests: mock screen-intelligence/autocomplete/voice hooks (CoreStateProvider)

Made-with: Cursor

* fix: address follow-up CodeRabbit (readiness poll, shared test mocks)

- SkillSetupWizard: waitForSkillRunning after startSkill before startSetup/auth RPC
- json_rpc_e2e: poll skills_status until running instead of fixed 400ms sleep
- Consolidate Skills page vi.mocks in test/mockDefaultSkillStatusHooks.ts

Made-with: Cursor

* fix: CodeRabbit — legacy OAuth awaits setSetupComplete, const waitForSkillRunning, mock base

- Legacy OAuth: await persistence before complete; error on failure; guard ref + reset on skillId
- waitForSkillRunning: const arrow per TS style
- mockDefaultSkillStatusHooks: offlineStatusBase spread for shared literals

Made-with: Cursor
2026-04-11 04:16:15 +05:30
Steven EnamakelandGitHub acc6246e59 Refactor core-polled app state and screen intelligence status (#464)
* refactor(accessibility): remove device control and predictive input features from accessibility settings

- Updated accessibility-related components and tests to eliminate device control and predictive input features.
- Adjusted AccessibilityPanel and ScreenIntelligencePanel to reflect the removal of these features.
- Modified related tests to ensure consistency with the updated accessibility status structure.
- Cleaned up accessibility session parameters and state management to focus solely on screen monitoring.

* refactor(accessibility): streamline featureOverrides state initialization

- Simplified the initialization of featureOverrides state in AccessibilityPanel and ScreenIntelligencePanel components for better readability.
- Consolidated parameter definitions in startAccessibilitySession to enhance clarity and maintainability.
- Removed unnecessary re-exports in the screen_intelligence engine module to clean up the codebase.

* chore(dependencies): update OpenHuman to version 0.51.19 in Cargo.lock

* chore(dependencies): update OpenHuman version to 0.51.19 in Cargo.lock

* feat(restart): implement core process restart functionality

- Added a new `SystemRestartRequested` event to the `DomainEvent` enum to handle restart requests.
- Introduced a `RestartSubscriber` that listens for restart events and manages the process respawn.
- Created a `service_restart` function to publish restart requests via the event bus.
- Updated service schemas to include a new `restart` controller with parameters for source and reason.
- Enhanced documentation to reflect changes in behavior and added necessary code comments.

* feat(accessibility): add last restart summary to Screen Intelligence Panel

- Introduced `lastRestartSummary` to the accessibility state and updated relevant components to display the last successful core restart information.
- Modified `PermissionsSection` and `ScreenIntelligencePanel` to include the new summary.
- Updated tests to validate the display of the last restart summary and ensure proper state management during core restarts.
- Refactored accessibility slice to handle the new restart summary in state updates.

* feat(core): enhance startup process with restart delay and subscriber registration

- Added a call to apply startup restart delay from environment variables in `run_core_from_args`.
- Updated the `bootstrap_skill_runtime` function to register a `RestartSubscriber` for handling restart requests, ensuring consistent respawn logic across triggers.
- Introduced a new `core_process` field in the `AccessibilityEngine` to track the core process status, including its PID and start time.
- Implemented a helper function to capture the core process start time using `OnceLock` for efficient initialization.

* feat(screen-intelligence): refactor accessibility state management and UI components

- Replaced direct Redux state access with a new `useScreenIntelligenceState` hook across multiple components, including `AccessibilityPanel`, `ScreenIntelligencePanel`, and their respective subcomponents.
- Streamlined permission and session handling by consolidating related functions and removing unnecessary dispatch calls.
- Updated tests to mock the new state management approach, ensuring consistent behavior and validation of UI elements.
- Removed the `SessionAndVisionSection` component to simplify the structure and improve maintainability.
- Introduced a new API file for screen intelligence to encapsulate related functionality and improve code organization.

* refactor(tests): clean up and optimize test files for accessibility and screen intelligence panels

- Removed redundant imports and streamlined the structure of test files for `AccessibilityPanel` and `ScreenIntelligencePanel`.
- Consolidated core process state initialization in test mocks for better readability.
- Updated dependency imports and ensured consistent mocking of state management hooks across tests.
- Enhanced the `ScreenPermissionsStep` component by improving the dependency array in the useEffect hook for better performance.

* refactor(store): remove unused authentication and user management code

- Deleted the `UserProvider`, `authSlice`, `authSelectors`, `userSlice`, `teamSlice`, and related test files to streamline the codebase.
- This cleanup enhances maintainability by removing legacy code that is no longer in use.
- Updated the store configuration to reflect the removal of these slices and ensure proper state management.

* refactor(webhooks): reorganize types and remove legacy state management

- Moved `TunnelRegistration` and `WebhookActivityEntry` types to a new `types.ts` file for better organization.
- Updated imports in `TunnelList` and `WebhookActivity` components to reference the new types location.
- Refactored `useWebhooks` hook to eliminate Redux state management in favor of local state, enhancing performance and reducing complexity.
- Removed unused `aiSlice`, `inviteSlice`, and `webhooksSlice` along with their associated tests to streamline the codebase.

* refactor(daemon): migrate state management from Redux to a custom store

- Introduced a new `store.ts` file to manage daemon state, replacing the previous Redux slice.
- Updated components and hooks to utilize the new state management approach, enhancing performance and reducing complexity.
- Removed the legacy `daemonSlice` and associated Redux logic, streamlining the codebase.
- Adjusted imports in various components and hooks to reference the new store structure.

* refactor(screen-intelligence): integrate core state management and enhance status handling

- Replaced direct state management in `useScreenIntelligenceState` with a new core state approach, utilizing `useCoreState` for improved performance and consistency.
- Updated status fetching and permission handling to leverage the core state snapshot, streamlining the logic and reducing redundant API calls.
- Introduced a new `CoreRuntimeSnapshot` interface to encapsulate runtime statuses, including screen intelligence, local AI, autocomplete, and service states.
- Adjusted related components and hooks to align with the new state management structure, enhancing maintainability and readability.
- Updated tests to validate the new runtime state structure and ensure proper functionality across the application.

* refactor(components): reorganize imports and streamline function formatting

- Moved the import of `Tunnel` and `tunnelsApi` in `TunnelList.tsx` for better organization.
- Reformatted function definitions in `store.ts`, `useDaemonHealth.ts`, `useDaemonLifecycle.ts`, `useWebhooks.ts` for improved readability.
- Cleaned up the structure of test files in `coreRpcClient.test.ts` by consolidating object properties for clarity.
- These changes enhance code maintainability and readability across the application.

* test(screen-intelligence): fix duplicate hook imports

* fix(tests): update ScreenIntelligenceDebugPanel test to use baseState for refresh status and vision calls

* refactor(invites): simplify error message rendering in Invites component

- Consolidated the conditional rendering of the load error message in the Invites component for improved readability.
- This change enhances the clarity of the code without altering functionality.

* refactor(daemon): streamline state management and function definitions

- Removed the `healthTimeoutId` from the `DaemonUserState` interface and related functions to simplify state management.
- Converted several functions in `store.ts` to arrow function syntax for consistency and improved readability.
- Updated the `Invites` component to handle asynchronous loading and error states more effectively, ensuring that in-flight requests are properly managed.
- Refactored the `CoreStateProvider` to enhance the refresh logic and prevent multiple simultaneous refreshes.
- Introduced a new `register_domain_subscribers` function in `jsonrpc.rs` to centralize event bus subscriber registration, improving code organization and maintainability.

* fix: add debug logging, atomic restart guard, and idempotent subscriber registration

- CoreStateProvider: add namespaced debug logger for polling failure diagnostics
- service/bus.rs: add AtomicBool gate to prevent duplicate restart spawns
- service/bus.rs: use OnceLock for idempotent RestartSubscriber registration
- Invites.tsx: add debug log in loadInviteCodes catch block

* style: apply prettier formatting to CoreStateProvider

* fix: sanitize error logging, serialize refresh, and demote restart logs

- CoreStateProvider: sanitize error objects in poll failure logs to avoid
  leaking tokens/headers
- CoreStateProvider: move in-flight guard into refresh() via shared promise
  so all callers (poll, updateLocalState, storeSessionToken) are serialized
- CoreStateProvider: log refreshTeams errors instead of swallowing them
- service/bus.rs: demote duplicate-restart log to debug, omit reason from
  log output to avoid free-form text emission

* style: apply cargo fmt to service/bus.rs
2026-04-09 15:51:27 -07:00
fa5f822f95 feat(subconscious): stabilize heartbeat + subconscious loop (#392) (#437)
* feat(subconscious): stabilize heartbeat + subconscious loop (#392)

- Enable heartbeat by default (enabled=true, inference_enabled=true, 5min interval)
- Seed system tasks on engine init, not first tick
- SQLite-backed task/log/escalation persistence
- Overlap guard with generation counter — stale ticks are cancelled
- Single log entry per task per tick, updated in place (in_progress → act/noop/escalate/failed/cancelled)
- Rate-limit retry (429 only) for agentic-v1 cloud model calls
- Approval gate: unsolicited write actions on read-only tasks require user approval
- Analysis-only mode for agentic-v1 on read-only escalations
- Non-blocking status RPC — reads from DB, never blocks on engine mutex
- Frontend: system vs user task distinction, toggle switches, expandable activity log
- Frontend: 3s auto-poll on Subconscious tab, skill-related escalation navigation
- Consecutive failure counter in status (resets on success)
- last_tick_at only advances on successful evaluation
- Missing LLM evaluation fallback — unevaluated tasks default to noop
- Docs: subconscious.md architecture guide, memory-sync-functions.md reference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix Prettier formatting for subconscious frontend files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ci: retrigger checks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(heartbeat): use disabled config in run_returns_immediately_when_disabled test

HeartbeatConfig::default() has enabled: true, so run() entered the infinite
loop and never returned — hanging the test (and CI) indefinitely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(subconscious): remove HEARTBEAT.md task import, use SQLite as sole task source

Tasks are now managed exclusively in SQLite via the Subconscious UI.
HEARTBEAT.md is retained for instructions/context only, not as a task list.
Situation report now reads pending tasks from SQLite instead of HEARTBEAT.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: cargo fmt on subconscious engine

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 15:03:05 -07:00
0f578382d1 fix(autocomplete): auto-start engine when config enabled (#412) (#442)
* fix(autocomplete): add start_if_enabled for engine auto-start at boot (#412)

The autocomplete engine was never started automatically when
config had autocomplete.enabled = true. Add start_if_enabled()
that checks config and starts the global engine singleton during
core process startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(autocomplete): wire engine startup into core server init (#412)

Call start_if_enabled() after config load in the JSON-RPC server
so the autocomplete engine runs automatically when the core process
boots with autocomplete enabled. Remove stale E2E test assertions
that conflicted with the new startup path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(autocomplete): auto-start engine when enabled via set_style RPC (#412)

When the frontend enables autocomplete through set_style(enabled=true),
automatically start the engine so suggestions begin immediately without
requiring a separate start call or app restart.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 02:56:58 +05:30
Mega MindandGitHub 371bcd34ea Feat/chat issue (#441)
* feat: display app version in settings panel

* fix(onboarding): auto-refresh accessibility state after grant (#351)

* style(onboarding): apply formatter for issue #351 fix

* fix(onboarding): ESLint + typed mock for ScreenPermissionsStep; clear flag in handler

Consolidate tauriCommands imports and drop redundant mock cast.

Handle granted accessibility in focus/visibility callback instead of a follow-up effect.

Made-with: Cursor

* feat(env): add support for custom dotenv path and update dependencies

- Introduced an optional environment variable `OPENHUMAN_DOTENV_PATH` to specify a custom path for dotenv files, enhancing configuration flexibility.
- Updated `Cargo.toml` to include the `dotenvy` dependency for improved dotenv file handling.
- Enhanced the `.env.example` file with a new comment for the custom dotenv path.
- Added data-testid attributes and button types in `SkillDebugModal` and `Skills` components for better testability.
- Created new tests for Gmail and Notion third-party skills to ensure proper functionality of sync and debug tools.
- Added documentation for memory sync functions to clarify usage patterns and function details.

* fix: address CodeRabbit review on PR #441

- Dotenv: treat empty OPENHUMAN_DOTENV_PATH as unset; propagate from_path errors
- Document OPENHUMAN_DOTENV_PATH parent-env requirement in .env.example
- Memory docs: MD040 fence language; clarify skill namespace vs integration id
- QuickJS bootstrap: modern helpers, generic platform.notify log, template URLs
- Skills UI: type=button on close/settings; async waitFor in sync tests
- Gmail OAuth e2e: workspace env matches MemoryClient; env/engine drop guards;
  redact secrets from logs
- Add replace_global_engine for test teardown

Made-with: Cursor
2026-04-09 01:51:30 +05:30
Steven EnamakelandGitHub 0609493e1a Add RAM-tiered local AI presets (#425) 2026-04-08 01:35:35 -07:00
200db04fc7 feat: scope user data to per-user directories (#370)
* feat(config): add user ID retrieval and workspace scoping for authenticated users

- Implemented `read_authenticated_user_id` to extract the user's ID from `auth-profiles.json`, avoiding a dependency cycle with the credentials module.
- Introduced `maybe_scope_workspace_to_user` to create user-specific workspace directories based on the authenticated user ID, ensuring isolated workspace data.
- Updated the configuration loading process to call `maybe_scope_workspace_to_user`, enhancing user data management.
- Added unit tests for the new functionality, ensuring correct behavior in various scenarios.

This change improves user experience by providing personalized workspace management based on authentication status.

* feat(config): enhance user management with active user state handling

- Added functions to manage the active user state, including `read_active_user_id`, `write_active_user_id`, and `clear_active_user`, allowing for user-specific configuration and workspace isolation.
- Introduced `default_root_openhuman_dir` to standardize the retrieval of the root directory for user data.
- Updated configuration loading to support user-scoped directories, improving the overall user experience by ensuring personalized settings and workspace management.

This change enhances the OpenHuman platform by enabling better user data management and isolation.

* feat(credentials): enhance user directory management during session storage

- Added logic to create and activate user-scoped directories based on the resolved user ID when storing session data, ensuring credentials are saved in the correct location.
- Implemented error handling for directory creation and active user ID writing, with appropriate logging for failures.
- Updated the configuration loading process to reflect the newly activated user directory, improving user-specific settings management.
- Enhanced the `get_data_dir` function to return user-scoped directories if an active user is set, streamlining data access.

This change improves user experience by ensuring that session data is correctly organized and accessible based on user context.

* refactor(tests): update user ID handling and improve test coverage

- Renamed and refactored tests to better reflect functionality, focusing on active user ID management.
- Removed the `write_auth_profiles` helper function and replaced it with direct calls to `write_active_user_id` for clarity.
- Enhanced tests to cover scenarios for reading and clearing active user IDs, ensuring accurate behavior in user-specific configurations.
- Added a new test for building user directory paths, improving overall test coverage for user management features.

This change streamlines the testing process and enhances the clarity of user ID handling in the configuration schema.

* refactor(paths): streamline model and binary path resolution

- Introduced a new `shared_root_dir` function to centralize the logic for determining the shared root openhuman directory, improving code clarity and reducing duplication.
- Updated `workspace_ollama_dir` and `workspace_local_models_dir` functions to utilize the new shared root directory, ensuring consistent path resolution for user-specific and shared resources.
- Enhanced the `model_artifact_path` function to leverage the new directory structure, improving the organization of model artifacts.

This refactor enhances maintainability and clarity in the path management for local AI resources.

* style: apply cargo fmt formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(paths): streamline directory management for model artifacts

- Updated the `model_artifact_path` function to utilize a new `shared_root_dir` function, which centralizes the logic for determining the root openhuman directory.
- Enhanced the `config_root_dir` function to improve clarity and maintainability.
- Adjusted the `workspace_ollama_dir` and `workspace_local_models_dir` functions to leverage the new shared directory logic, ensuring consistent path resolution across the application.

These changes improve the organization of directory management and enhance the overall clarity of the codebase.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 13:51:17 -07:00
faa881c5f1 Feat/343 screen intelligence e2e tests (#359)
* test(screen_intelligence): add E2E pipeline proof tests for #343

Add layered test coverage proving the full capture → vision → memory
pipeline: screenshot save/cleanup disk paths, VisionSummary serde
roundtrip, JSON-RPC shape tests for status and vision_recent endpoints.

- tests/screen_intelligence_vision_e2e.rs: save_screenshot_to_disk
  creates a PNG and keep_screenshots=false cleanup removes it;
  VisionSummary struct serializes/persists/is queryable end-to-end;
  platform support table + macOS checklist added to module doc
- tests/json_rpc_e2e.rs: screen_intelligence_status shape test
  (platform_supported, session.active, permissions.screen_recording);
  vision_recent returns empty summaries without an active session
- src/openhuman/screen_intelligence/tests.rs: save_screenshot_to_disk
  unit tests for the write path and the no-image-ref error path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(screen_intelligence): enhance vision summary persistence and error handling

- Added new fields to track vision persistence count, last persisted key, and last persist error in SessionRuntime and SessionStatus.
- Implemented error handling for vision summary persistence, ensuring errors are logged and state is updated accordingly.
- Introduced a new method  to analyze a frame and persist the summary, improving the vision processing pipeline.
- Updated tests to validate the new functionality and ensure proper behavior with mocked vision outputs.

This commit improves the robustness of the screen intelligence pipeline by enhancing the tracking and handling of vision summary persistence.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 22:04:50 +05:30
YellowSnnowmannandGitHub 1acc916244 feat: extract and load user working memory from skill sync payloads (#357)
* feat: implement user working memory extraction from skill sync payloads

- Added functionality to enable the extraction of user working memory from successful skill syncs, allowing for persistent storage of user preferences, goals, constraints, and entities.
- Introduced a new configuration option in  to toggle working memory extraction.
- Created comprehensive documentation on the working memory extraction process, detailing its implementation and privacy considerations.
- Updated memory loading logic to include working memory entries in the context provided to agents, enhancing personalization capabilities.
- Enhanced logging for memory extraction processes to improve observability and debugging.

This feature enhances the user experience by allowing skills to maintain context across interactions, improving the overall effectiveness of the OpenHuman platform.

* docs: update architecture documentation to include user working memory integration

* refactor: centralize working memory constants and enhance extraction logic

- Moved `WORKING_MEMORY_KEY_PREFIX` and `WORKING_MEMORY_LIMIT` constants to `memory_context.rs` for better organization and accessibility.
- Updated `MemoryLoader` to utilize these constants, improving code clarity.
- Enhanced working memory extraction logic in `MemoryWriteJob` to conditionally persist user working-memory documents based on the job type.
- Improved logging for memory extraction processes to provide clearer insights during execution.
- Adjusted tests to ensure consistent behavior with the new working memory extraction logic.

* chore: update OpenHuman version to 0.51.8 and refactor JSON-RPC test for clarity

- Bumped the OpenHuman version in Cargo.lock from 0.51.6 to 0.51.8.
- Refactored the JSON-RPC end-to-end test to improve readability by encapsulating the result assertion logic within a block, enhancing clarity in the flow of data handling.
2026-04-06 22:04:31 +05:30
b8ae9674b3 fix(memory): graph query returns namespace data and add sync e2e tests (#344) (#363)
* fix(memory): graph query returns namespace data and add sync e2e tests (#344)

The knowledge graph UI showed empty because graph_query(None) only queried
the graph_global table, while ingestion writes to graph_namespace. Now
graph_query(None) queries both tables via graph_query_all(), merging results.

Changes:
- Added graph_query_all() in unified graph store to query across all namespaces
- MemoryClient::graph_query(None) now uses graph_query_all() instead of
  graph_query_global()
- MemoryWorkspace passes selectedNamespace to the RPC call
- Added diagnostic logging in ingestion pipeline (RelEx model availability,
  extraction counts)
- Added debug logging in tauriCommands for unexpected response shapes
- Added 2 integration tests proving document sync populates the graph
  (ignored by default for CI, run with --ignored)

Closes #344

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: remove trailing comma for Prettier compliance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:03:32 +05:30
YellowSnnowmannandGitHub 0c14aea96a Improve autocomplete observability and runtime controls in settings + JSON-RPC (#308)
* Enhance AutocompletePanel logging and functionality

- Introduced MAX_LOG_ENTRIES constant to limit log entries to 200.
- Updated log formatting to include timestamps with milliseconds for better precision.
- Added UI logging for various actions (e.g., saving settings, starting/stopping autocomplete) to improve traceability.
- Enhanced error handling in refreshStatus, acceptSuggestion, and other functions to log specific failure messages.
- Added unit tests for AutocompletePanel to ensure functionality and logging behavior.

This update improves the overall user experience by providing clearer logs and better error handling in the Autocomplete feature.

* Refactor accessibility and autocomplete components for improved error handling and logging

- Updated  to log role changes as debug information instead of returning an error, allowing for more flexible handling of role fluctuations.
- Increased the timeout for autocomplete refresh operations from 15 seconds to 120 seconds to accommodate longer processing times, enhancing reliability.
- Improved error handling in the autocomplete engine to preserve previous suggestions and provide clearer error messages when operations are aborted.

These changes enhance the user experience by providing better logging and more robust handling of focus and autocomplete functionalities.

* Enhance AutocompletePanel functionality and improve error handling

- Refactored loadHistory to return an empty array when Tauri is not available, improving error handling.
- Introduced waitForAcceptedHistoryEntry to ensure the history is loaded before accepting suggestions, enhancing user experience.
- Updated the accept suggestion logic to use the new waitForAcceptedHistoryEntry function, ensuring the correct suggestion is applied.
- Modified tests to reflect changes in the accept suggestion API, ensuring accurate functionality.

These changes improve the reliability and responsiveness of the autocomplete feature.
2026-04-06 18:14:02 +05:30
b589a29e77 Extract socket controller into dedicated domain module (#340)
* refactor: remove global_engine usage in tests and instantiate AccessibilityEngine directly

- Updated the test suite to eliminate the use of global_engine, replacing it with a direct instantiation of AccessibilityEngine.
- This change enhances test isolation and clarity by ensuring that each test operates with its own instance of the engine, improving reliability and maintainability.

* feat: add socket module for skill communication

- Introduced a new `socket` module to facilitate communication between skills, enhancing the modularity and organization of the codebase.
- Updated imports in `qjs_engine.rs` to reference the new `SocketManager` from the `socket` module, streamlining socket management for skill interactions.
- Removed the deprecated `socket_manager` module from the skills module, improving clarity and reducing redundancy in the code structure.

* feat: integrate socket controllers and schemas into core functionality

- Added socket-related registered controllers and schemas to the core build functions, enhancing the communication capabilities within the OpenHuman framework.
- Updated the `build_registered_controllers` and `build_declared_controller_schemas` functions to include socket components, ensuring comprehensive integration of the new socket module.

* feat: enhance QuickJS skill runtime with socket manager integration

- Updated the `bootstrap_skill_runtime` function to initialize and register the `SocketManager` globally, allowing RPC handlers to access socket functionalities.
- Improved documentation to reflect the addition of socket management capabilities alongside the QuickJS skill runtime.
- Cleaned up imports in `event_handlers.rs` to streamline the codebase.

* refactor: remove socket manager integration from skill runtime

- Removed the `SocketManager` integration from the `bootstrap_skill_runtime` function, simplifying the socket management process.
- Eliminated the `socket_manager` field and related methods from the `RuntimeEngine` struct, streamlining the codebase.
- Cleaned up unused MCP handlers and socket-related imports in the event handlers, enhancing code clarity and maintainability.

* refactor: remove sync_tools calls from skill status handling

- Eliminated unnecessary calls to `sync_tools()` in the `RuntimeEngine` during skill status changes, simplifying the skill lifecycle management.
- This change enhances performance by reducing redundant synchronization operations during skill execution and shutdown processes.

* feat: enhance socket event handling with improved logging

- Added logging for incoming socket events to improve observability, including event name and data size.
- Implemented detailed debug logging for event payloads, ensuring clarity on the data being processed.
- Updated event handling logic to streamline routing for webhook requests and inbound channel messages, enhancing the overall responsiveness of the system.
- Introduced logging for unhandled events to aid in debugging and monitoring.

* feat: enhance socket management and auto-connect functionality

- Updated the `bootstrap_skill_runtime` function to clone the `SocketManager` instance for global registration, ensuring proper socket management.
- Introduced background tasks for auto-starting skills and auto-connecting to the backend using stored session tokens, improving startup efficiency and user experience.
- Added detailed logging for session token checks and connection attempts, enhancing observability and debugging capabilities during socket operations.

* feat: enhance skill selection and tool management in tests

- Introduced a new `manifests_in_dir` function to retrieve skill manifests from a specified directory, improving skill discovery.
- Added `select_skill_id` function to prioritize skill selection based on environment variables and preferred candidates, enhancing flexibility in test configurations.
- Updated the test suite to utilize the new skill selection logic, ensuring more robust and configurable test scenarios.
- Improved handling of tool selection with enhanced logging and fallback mechanisms for better debugging and usability.

* format code:wq

* feat: add Rust checks and formatting commands to package.json

- Introduced new scripts for Rust checks and formatting in both the main and app package.json files.
- Updated pre-push hook to include Rust compile checks, enhancing pre-push validation.
- Modified existing format commands to integrate Rust formatting, ensuring consistency across codebases.

* fix: improve formatting of the "Keep Screenshots" label description

- Adjusted the formatting of the description text for better readability by breaking it into multiple lines within the `ScreenIntelligencePanel` component.

* fix: install rustls crypto provider before WebSocket TLS connect

The socket auto-connect was panicking with "Could not automatically
determine the process-level CryptoProvider" because tokio-tungstenite
uses rustls for wss:// but no crypto provider was installed. Install
the ring provider before each connect attempt.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use dynamically selected skill in sync memory tests

The tests hardcoded 'example-skill' which no longer exists in the
skills directory. Now dynamically picks the first available skill
(preferring server-ping) so tests work regardless of which skills
are present.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 22:53:58 -07:00
Steven EnamakelandGitHub e925e8a319 Fix local reset flow and Accessibility permission handling (#324)
* refactor: clean up imports and improve code structure in skills_cli and registry_ops

- Removed unused imports in `skills_cli.rs` and `registry_ops.rs` to enhance code clarity.
- Streamlined import statements for better organization and readability.
- Minor adjustments in `engine.rs` to maintain consistency in import usage.

* fix: update UI text and styles for MemoryWorkspace and SkillSetupWizard components

- Changed the title in MemoryWorkspace to "Memory (EverMind)" for clarity.
- Updated text colors in SkillSetupWizard for better visibility and consistency.
- Enhanced button styles and loading indicators for improved user experience.

* feat: implement reset functionality for OpenHuman data and enhance app data clearing process

- Added a new utility function `resetOpenHumanDataAndRestartCore` to reset local OpenHuman data and restart the core process.
- Updated `clearAllAppData` in `SettingsHome` to utilize the new reset function, improving the app's data clearing process.
- Enhanced error handling during the data reset and session clearing operations to ensure robustness.
- Introduced tests for the new reset functionality to validate its behavior and integration.

* refactor: remove screen recording permission from AccessibilityPanel

- Eliminated the screen recording permission check and associated UI elements from the AccessibilityPanel component.
- Updated tests to ensure the screen recording option is no longer present in the rendered output, improving clarity and focus on relevant permissions.

* chore: update package.json files to integrate Husky for Git hooks

- Added Husky as a dev dependency in both package.json files to manage Git hooks.
- Included "prepare" and "postinstall" scripts in the main package.json to ensure Husky is set up correctly.
- Cleaned up the app's package.json by removing the "prepare" script, as it is now handled in the main package.json.
- Enhanced logging in tauriCommands.ts for better debugging during the reset process.

* fix: update variable name for clarity in ops.rs test assertions

- Changed the variable name from `data` to `value` in the test assertions to enhance clarity and better reflect its purpose.
- Ensured that the assertions remain functional and maintain the integrity of the test logic.

* feat: enhance skill selection logic in skills_debug_e2e.rs

- Introduced a new function `select_skill_id` to improve skill selection based on environment variables and preferred skills.
- Updated the skill ID retrieval process to prioritize user-defined skills while maintaining a fallback to the default skill.
- Enhanced documentation to clarify the usage of environment variables for skill testing.

* format
2026-04-04 20:26:08 -07:00
Steven EnamakelandGitHub ef708bdd20 refactor(core): move app state ownership into the Rust core (#320)
* refactor(core): integrate CoreStateProvider and streamline state management

- Replaced UserProvider with CoreStateProvider in App component to centralize state management.
- Updated various components to utilize the new CoreStateProvider for accessing session tokens and user data.
- Refactored hooks and components to eliminate direct Redux store dependencies, enhancing modularity and maintainability.
- Introduced a new core state management structure to improve the handling of user authentication and onboarding states.

This refactor aims to simplify state access across the application and improve overall code clarity.

* fix: restore polyfills import and clean up component imports

- Reintroduced the import of polyfills in main.tsx to ensure compatibility.
- Adjusted import statements in PrivacyPanel and SocketProvider for consistency.
- Simplified conditional expressions in TeamInvitesPanel and TeamMembersPanel for better readability.
- Refactored CoreStateProvider and store.ts to streamline state initialization.
- Enhanced formatting in various files for improved code clarity and maintainability.

* refactor(tests): streamline onboarding and protected route tests

- Updated OnboardingOverlay tests to utilize mock state management and simplify assertions.
- Refactored ProtectedRoute tests to improve readability and ensure consistent use of mock state.
- Enhanced teamApi tests to replace direct API calls with core RPC method calls, improving test isolation and clarity.
- Adjusted socketSelectors tests to utilize a centralized core state snapshot for better state management during tests.

* refactor(onboarding): simplify onboarding state management and improve loading logic

- Removed unnecessary local state for onboarding completion in OnboardingOverlay, directly utilizing snapshot data.
- Enhanced loading logic to prevent unnecessary renders and improve user experience during onboarding.
- Updated PrivacyPanel to handle analytics consent persistence with error handling.
- Refactored TeamManagementPanel and TeamPanel to improve team data fetching logic and loading states.
- Streamlined CoreStateProvider to manage session token synchronization and state updates more effectively.

* chore(deps): update tempfile dependency and refactor app state management

- Added `tempfile` dependency to Cargo.toml for improved temporary file handling.
- Refactored app state loading and saving functions to enhance error handling and ensure data integrity.
- Introduced quarantine mechanism for corrupted app state files to prevent application crashes.
- Updated URL parsing logic to ensure proper formatting of API URLs.
- Adjusted type definitions in schemas for better clarity and consistency.

* refactor(tests): simplify mock state usage in onboarding and protected route tests

- Consolidated mock state management in OnboardingOverlay and ProtectedRoute tests for improved readability.
- Streamlined assertions by reducing unnecessary lines in test setups.
- Enhanced consistency in mock return values across tests to ensure clarity and maintainability.

* refactor(tests): enhance PublicRoute tests with mock state and routing

- Updated PublicRoute tests to utilize MemoryRouter for improved routing simulation.
- Simplified mock state management by integrating `useCoreState` for user authentication scenarios.
- Streamlined test assertions and removed redundant preloaded state configurations for clarity and maintainability.

* refactor(tests): streamline mock state usage in PublicRoute and Mnemonic tests

- Simplified mock state management in PublicRoute and Mnemonic tests for improved readability.
- Consolidated mock return values to reduce redundancy and enhance clarity in test setups.
- Improved consistency in the usage of `useCoreState` across test files.

* Refactor billing components for improved readability

- Cleaned up import statements in BillingPanel.tsx for better organization.
- Enhanced formatting of billing plan descriptions in billingHelpers.ts for consistency.
- Improved readability of conditional checks in BillingPanel component.

* Refactor API endpoint handling for clarity and consistency

- Updated references from `/settings` to `/auth/me` in various modules to standardize user authentication flows.
- Renamed `parse_settings_response_json` to `parse_api_response_json` for improved clarity in response handling.
- Adjusted user ID extraction functions to reflect the new endpoint structure, enhancing maintainability across the codebase.
- Updated test cases to align with the new endpoint naming conventions, ensuring consistency in API interactions.
2026-04-04 03:20:18 -07:00
8381283c52 Fix/update api (#319)
* feat(webhooks): refactor webhook URL handling and enhance API endpoints

- Introduced a new utility function `buildWebhookIngressUrl` to standardize the construction of webhook URLs across components.
- Updated `WebhooksDebugPanel` and `TunnelList` components to utilize the new URL builder for improved consistency and maintainability.
- Refactored API endpoints in `tunnelsApi` to reflect changes in webhook routing, ensuring all references to tunnel management are aligned with the new structure.
- Adjusted user API calls to replace `/telegram/me` with `/auth/me` for better clarity and consistency in authentication flows.
- Enhanced socket service to normalize channel connection update payloads, improving error handling and data integrity.

These changes streamline webhook management and enhance the overall developer experience when working with webhooks.

* feat(messaging): enhance Telegram and Discord channel linking functionality

- Added support for managed DM linking with Telegram and OAuth flow for Discord.
- Introduced `createChannelLinkToken` API to generate short-lived link tokens for messaging channels.
- Updated `MessagingPanel` to handle managed linking flows, including building launch URLs and user instructions.
- Enhanced configuration to include a Telegram bot username for fallback linking.
- Updated tests to mock new configuration values for consistent testing.

These changes improve the user experience for linking messaging channels and streamline the authentication process.

* feat(api): introduce core command client and refactor API calls

- Added a new `coreCommandClient` to facilitate RPC calls to core services.
- Refactored existing API endpoints in `authApi`, `billingApi`, `creditsApi`, `tunnelsApi`, and `userApi` to utilize the new command client for improved consistency and maintainability.
- Updated the billing API to include new endpoints for fetching balance, transactions, and managing auto-recharge settings.
- Enhanced the user API to streamline user data retrieval.
- Improved error handling and logging across the refactored API calls.

These changes enhance the overall architecture of the API services, making them more modular and easier to maintain.

* refactor(api): streamline API calls and enhance error handling

- Refactored `creditsApi` and `tunnelsApi` to ensure consistent use of the new core command client.
- Updated API methods to improve error handling and response parsing.
- Introduced a new `authed_json` method in `BackendOAuthClient` for standardized authenticated requests.
- Cleaned up unused imports and optimized code structure across various modules.

These changes enhance the maintainability and reliability of the API services.

* refactor(api): streamline API calls and improve code readability

- Reorganized API calls in `authApi`, `billingApi`, `creditsApi`, and `tunnelsApi` to enhance consistency and maintainability.
- Updated function formatting for better readability, ensuring parameters are clearly defined.
- Cleaned up import statements and removed unnecessary line breaks to improve code clarity.

These changes contribute to a more maintainable codebase and enhance the overall developer experience.

* refactor(MessagingPanel): clean up imports and remove unused constants

- Reorganized import statements for clarity and consistency.
- Removed unused constants related to channel definitions and status styles to streamline the component.
- Simplified the `updateField` function call in the rendering logic for better readability.

These changes enhance the maintainability of the MessagingPanel component.

* fix: restore helper functions removed during merge cleanup

buildManagedChannelLaunchUrl and buildManagedChannelInstruction were
stripped by the linter after merge resolution, breaking the build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(messaging): enhance MessagingPanel with pending instruction handling

- Introduced a new state for pending instructions to improve user feedback during channel connection processes.
- Updated error handling to ensure users receive clear instructions, including URLs for manual access if automatic opening fails.
- Refactored connection status updates to streamline the dispatch process and improve code readability.
- Enhanced the rendering logic to display pending instructions in the UI, providing better context for users during authentication flows.

* fix(api): encode channel and ID parameters in webhook and OAuth URLs

- Updated the URL construction in the BackendOAuthClient to encode the channel parameter, ensuring proper formatting for requests.
- Modified the get_tunnel, update_tunnel, and delete_tunnel functions to encode the ID parameter in webhook URLs, enhancing security and compatibility with special characters.

* fix(auth): validate channel input for link token creation

- Added validation to ensure the channel is not empty and is one of the supported types (telegram, discord).
- Converted the channel string to lowercase for consistent matching.
- Updated the call to create_channel_link_token to use a reference to the channel variable.

* chore(todos): update TODO list with completed tasks and new feature requests

- Marked several tasks as completed, including integration of the custom memory engine and skills registry into the core.
- Added new items to the TODO list, including improvements for voiceover functionalities, screen intelligence, and Gmail skill enhancements.
- Included tasks for debugging skills from the UI and improving prompts to reduce hallucinations.

* refactor(webhooks): improve formatting of get_tunnel function for readability

- Reformatted the get_tunnel function to enhance code clarity by adjusting the indentation and line breaks in the call to get_authed_value.
- This change improves the maintainability of the code and aligns with the overall code style.

* test(userApi): enhance userApi tests with improved mocking and error handling

- Added a mock function for core command calls to streamline test setup.
- Introduced a helper function to generate mock user data for consistent test cases.
- Updated tests to use the mock function for simulating API responses, improving clarity and maintainability.
- Enhanced error handling in tests to cover various API error scenarios, ensuring robustness in userApi.getMe functionality.

* refactor(billingApi): update tests to use core command mocking and improve error handling

- Replaced apiClient mocks with core command mocks for better alignment with the new API structure.
- Updated test cases to reflect changes in API call expectations, enhancing clarity and maintainability.
- Improved error handling in tests to ensure proper propagation of errors from core command calls.

* refactor(billingApi): simplify test cases by consolidating mock function calls

- Streamlined mock function calls in billingApi tests for improved readability and consistency.
- Removed unnecessary line breaks in mock responses, enhancing clarity in test definitions.
- Ensured that error handling and API call expectations are clearly represented in the tests.

* refactor(api): rename settings endpoint to current_user for clarity

- Updated the endpoint handling authenticated profile fetches to improve clarity in the codebase.
- Adjusted the routing to reflect the new function name, enhancing maintainability and understanding of the API's purpose.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 02:59:31 -07:00
Mega MindandGitHub 04146bf0bf Fix/191 skills reliability upstream (#282)
* feat(skills): core RPC data stats, tool timeout env, ping state merge (#191)

- Add openhuman.skills_data_stats and SkillDataDirectoryStats (disk usage).
- Centralize tool execution timeout via OPENHUMAN_TOOL_TIMEOUT_SECS (tool_timeout).
- Apply timeout to skill event loop, agent tool loop, harness default, delegate.
- Ping scheduler: merge connection_error into published_state via registry.
- JSON-RPC e2e: assert skills_data_stats.

Closes #214
Closes #218
Part of #213 (backend)

Made-with: Cursor

* feat(app): skills sync stats UI, reconnect resync, FE timeouts, chat errors (#191)

- useSkillDataDirectoryStats + Skills.tsx merge disk stats with skill state.
- resyncRunningSkillsAfterReconnect on socket connect; disconnectSkill OAuth cleanup in finally.
- withTimeout for callTool/triggerSync; VITE_TOOL_TIMEOUT_SECS in app .env.example.
- Structured ChatSendError in Conversations (data-chat-send-error-code).

Closes #213
Closes #215
Closes #216
Closes #217
Closes #219

Made-with: Cursor

* test(e2e): onboarding helpers and skills smoke specs (#191)

- shared-flows: 5-step onboarding, completeOnboardingIfVisible.
- auth-access-control + voice-mode use shared helpers.
- skills-registry: named skill assertion; new skill-oauth, multi-round, reconnect, lifecycle specs.

Closes #220
Closes #221
Closes #222
Closes #223
Closes #224
Part of #189 (E2E helpers)

Made-with: Cursor

* style: rustfmt + Prettier for CI (PR #282)

Fix Type Check workflow: prettier --check and cargo fmt --check.

Made-with: Cursor

* fix: PR #282 review — tool timeout config, tool_timeout module, CI diagnostics

- Centralize VITE_TOOL_TIMEOUT_SECS in config.ts (TOOL_TIMEOUT_SECS)
- Move tool_timeout to folder module; merge_published_state broadcasts SKILL_STATE_CHANGED
- Resync guard after socket reconnect; qjs_engine logs data dir stat errors
- E2E: registry/lifecycle/multi-round failure diagnostics; onboarding label constant
- chatSendError arrow export; rustfmt/import grouping in event_loop

Made-with: Cursor

* test(e2e): add Gmail skill end-to-end tests

- Introduced a comprehensive end-to-end test suite for the Gmail skill, covering the full lifecycle from discovery to OAuth completion and email management.
- Implemented two modes: a lifecycle-only mode that validates the skill's event loop without real credentials, and a live mode that interacts with the Gmail API using actual credentials.
- Added detailed environment variable requirements and usage instructions for both testing modes.

Closes #XXX (replace with relevant issue number if applicable)
2026-04-02 15:25:31 -07:00
sanil-23andGitHub 945a5c4a02 feat: subconscious loop — local-model background awareness via heartbeat (#268)
* feat: subconscious loop — local-model background awareness via heartbeat

Add a subconscious inference layer to the heartbeat engine. On each
tick, the engine reads HEARTBEAT.md tasks, builds a delta-based
situation report (memory docs, graph relations, skills health,
environment), and evaluates them with the local Ollama model.

Architecture:
- HeartbeatEngine (scheduler) delegates to SubconsciousEngine (brain)
- HeartbeatConfig extended with inference_enabled, context_budget_tokens
- No separate SubconsciousConfig — all config lives under [heartbeat]
- Default HEARTBEAT.md ships with 3 active tasks (email, deadlines, skills)

Subconscious module (src/openhuman/subconscious/):
- engine.rs: tick logic, local model inference, escalation to cloud model
- situation_report.rs: delta assembler (memory, graph, skills, env, tasks)
- prompt.rs: task-driven system prompt for local model
- decision_log.rs: dedup tracking with 24h TTL and acknowledgment
- types.rs: Decision (noop/act/escalate), TickOutput, RecommendedAction
- schemas.rs: RPC controllers (subconscious_status, subconscious_trigger)
- integration_test.rs: two-tick lifecycle test with fixtures

Decision flow:
- noop: no changes, skip — no LLM call wasted
- act: local model recommends actions → stored in memory KV
- escalate: calls cloud model to resolve → concrete actions stored

Verified with real Ollama inference (gemma3:4b):
- Tick 1: ingested gmail+notion → "act: deadline needs attention" (high)
- Tick 2: ingested state changes → "act: deadline moved" (high)
- Skills health section populated from live skill registry

Closes #145

* feat: add subconscious_actions RPC endpoint

New endpoint openhuman.subconscious_actions returns stored action
entries from the subconscious KV namespace, sorted by most recent
first, with configurable limit (default 20).

Response format:
{
  "entries": [
    { "tick_at": 1775117975.58, "actions": [...] }
  ],
  "count": 1
}

The upcoming subconscious page will call this to display
notifications and recommended actions to the user.

* fix: budget underflow and UTF-8 panic in situation report truncation

- Use saturating_add for newline byte to prevent underflow when
  section exactly fills the remaining budget
- Truncate at valid UTF-8 char boundary using char_indices instead
  of raw byte slicing, which panicked on multibyte characters
- Add tests for exact-fit and multibyte truncation

* fix: address CodeRabbit review — shared engine, dedup, consistent schema

Fixes from CodeRabbit review on PR #268:

- #8 Two engine instances: Add global.rs singleton shared between
  HeartbeatEngine::run() and RPC handlers. Both use get_or_init_engine()
  so decision log, counters, and last_tick_at are always in sync.

- #3 Dedup disabled: tick() now extracts actual document IDs from
  memory via build_situation_report_with_doc_ids() and passes them
  to decision_log.record(). filter_unsurfaced() actually filters now.

- #5 Decision log not loaded on trigger: tick() loads persisted log
  from KV on first execution (total_ticks == 0), not only from run().

- #4 Inconsistent action schema: handle_escalation() normalizes agent
  response into RecommendedAction[] via normalize_escalation_response().
  Both act and escalate paths store the same schema.

- #7 Key collision: store_actions() uses millisecond timestamp + random
  suffix instead of second-precision truncation.

- #10 No-changes unreachable: tick() checks has_new_data (unsurfaced
  doc IDs) OR has_memory_changes (report text) instead of naive string
  matching on environment section.

* fix: include document content in situation report, not just titles

The local model needs actual content to evaluate HEARTBEAT.md tasks
meaningfully. Previously it only saw titles like "Deadline reminder"
with no way to know if it's urgent.

Now recalls content per namespace (up to 500 chars each, max 10
namespaces) via client.recall_namespace(). The model sees actual
email text and page content alongside the task checklist.

* fix: timestamp parsing, byte-boundary slicing, and truncation overshoot

- schemas.rs: split on first ':' after 'actions:' prefix before parsing
  timestamp, so keys like 'actions:123456:xyz' parse correctly
- situation_report.rs: use truncate_at_char_boundary() for error strings
  instead of raw byte slice which panics on multibyte characters
- situation_report.rs: fix append_section and truncate_at_char_boundary
  to use char END offset (i + len_utf8) in take_while condition, so
  multibyte chars that start before but end after the budget are excluded
2026-04-02 21:51:09 +05:30
YellowSnnowmannandGitHub 79fe36b41d fix: remove the deadlock when re-enabling an already-active session and add unit tests for ScreenIntelligenceDebugPanel and ScreenIntelligencePanel (#275) 2026-04-02 20:07:15 +05:30
YellowSnnowmannandGitHub c09983b49b feat(about_app): add a runtime capability catalog for app discovery (#267)
* feat(about_app): introduce user-facing capability catalog

- Added a new module for the capability catalog, providing a single source of truth for user-facing features in the OpenHuman app.
- Implemented functions for listing, looking up, and searching capabilities, enhancing user interaction with the app's features.
- Created a structured schema for capabilities, including categories and statuses, to improve organization and accessibility.
- Added comprehensive end-to-end tests to validate the functionality of the new capability catalog, ensuring robust performance and reliability.

This update significantly enhances the app's ability to expose its features to users, improving overall usability and experience.

* feat(about_app): update capability catalog with new features and improved instructions

- Revised existing capability instructions for clarity and accuracy, enhancing user guidance on accessing features.
- Introduced several new capabilities related to skills and authentication, including connections to Google, Notion, and Web3 wallets, expanding the app's functionality.
- Added new settings management capabilities, allowing users to manage desktop services and clear app data, improving user control over the application.

These updates significantly enhance the capability catalog, providing users with more options and clearer instructions for utilizing the app's features.
2026-04-02 16:45:00 +05:30
c134d96056 fix(skills): route sync RPC to onSync handler and persist state to memory (#183)
* feat(debug): add script for Notion sync memory verification and enhance memory persistence

- Introduced `debug-notion-sync-memory.sh` to facilitate live testing of the Notion skill with memory verification.
- The script validates the full flow from skill start to memory persistence, ensuring required environment variables are set.
- Updated `handle_skills_sync` to change the RPC method from `skill/tick` to `skill/sync` for better clarity in the sync process.
- Implemented `persist_state_to_memory` function to ensure published ops state is saved to memory after sync, cron, and tick events.
- Enhanced end-to-end tests to validate memory persistence during skill sync and tick operations, ensuring robust functionality.

This update improves the debugging process for the Notion skill and enhances the overall reliability of memory operations.

* style: apply cargo fmt formatting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(memory): implement background memory-write worker for skill state persistence

- Introduced a `MemoryWriteJob` struct to encapsulate the details of memory write operations.
- Added a bounded background worker using `tokio::spawn` to handle memory writes asynchronously, improving performance and responsiveness.
- Updated `persist_state_to_memory` to queue memory write jobs instead of executing them directly, allowing for better flow control and error handling.
- Enhanced logging for memory persistence operations to provide clearer insights into success and failure cases.
- Modified event handling in `handle_message` to ensure state persistence occurs only after successful operations, reducing the risk of data loss.

This update significantly enhances the memory management capabilities of the skill instance, ensuring more reliable state persistence.

* feat(skills): enhance skills synchronization and memory persistence

- Added detailed debug logging in `handle_skills_sync` to track skill synchronization events, improving observability during skill operations.
- Updated `persist_state_to_memory` to include a memory write transaction, ensuring state persistence is handled more robustly and efficiently.
- Enhanced event handling in `handle_message` to ensure memory writes are queued correctly, improving the reliability of state persistence during skill operations.

These changes improve the overall functionality and reliability of skills synchronization and memory management.

* feat(skills): enhance skills synchronization and memory persistence

- Added detailed debug logging in `handle_skills_sync` to track skill synchronization events, improving observability during skill operations.
- Updated `persist_state_to_memory` to include a `memory_write_tx` parameter, allowing for more efficient state persistence in the event loop.
- Enhanced tests for skills synchronization to ensure robust memory handling and state persistence during skill operations.

This update improves the reliability and traceability of skills synchronization processes, ensuring better memory management and debugging capabilities.

* refactor(tests): update JSON-RPC sync handling in end-to-end tests

- Enhanced comments in `json_rpc_skills_runtime_start_tools_call_stop` to clarify the sync process routing through the `skill/sync` RPC.
- Updated assertions in `skills_sync_rpc_calls_on_sync_not_on_tick` to ensure proper handling of the new sync flow, verifying that the `skills_sync` method routes correctly to `onSync`.
- Improved logging for better observability during skill synchronization tests, ensuring that the expected behavior aligns with the updated RPC structure.

These changes improve the clarity and reliability of the end-to-end tests related to skills synchronization.

* feat(env): enhance environment configuration for skills development

- Updated `.env.example` to include `SKILLS_LOCAL_DIR` for local skills source directory, allowing developers to specify a path for skill discovery and installation.
- Improved comments in the environment file to clarify the usage of `SKILLS_REGISTRY_URL` for both remote and local paths, enhancing the development experience.
- Refactored `qjs_engine.rs` to prioritize the `SKILLS_LOCAL_DIR` for skill source directory resolution, improving local development workflows.
- Added utility functions in `registry_ops.rs` to support local file path handling for skill registries, enhancing flexibility in skill management.

These changes streamline the development process for skills by providing clearer configuration options and improving local development capabilities.

* feat(tests): enhance skills directory discovery in test files

- Updated `try_find_skills_dir` function across multiple test files to include support for the `SKILLS_LOCAL_DIR` environment variable, improving the flexibility of skills directory resolution.
- Enhanced comments to clarify the order of directory search priorities, ensuring better understanding for developers.
- Improved error handling and logging for cases where the specified directory does not exist, aiding in debugging and test reliability.

These changes streamline the skills directory discovery process in tests, enhancing the overall development experience.

* feat(tests): enhance skills directory discovery in test files

- Updated `try_find_skills_dir` function to include support for the `SKILLS_LOCAL_DIR` environment variable, allowing for more flexible skills directory resolution.
- Improved documentation to clarify the priority order for skills directory discovery.
- Refactored multiple test files to utilize the updated skills directory discovery logic, enhancing consistency and maintainability across tests.

These changes streamline the skills directory discovery process in tests, improving the overall testing framework.

* refactor(tests): streamline memory client verification in Notion live tests

- Updated the memory client verification process in `notion_live_with_real_data` to utilize `MemoryClient::new_local()` for improved clarity and consistency.
- Enhanced comments to clarify the memory store check location and removed redundant error handling for workspace directory creation.
- Simplified the error logging to focus on the memory client creation failure, improving readability and maintainability of the test code.

These changes enhance the reliability of memory verification in the Notion live tests, ensuring a clearer understanding of the memory client initialization process.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 22:00:57 -07:00
2545ae374a refactor: extract accessibility middleware module (#184)
* feat(autocomplete): add target_role to EngineState for improved context validation

- Introduced a new field `target_role` in `EngineState` to store the AXRole of the text element when suggestions are generated.
- Updated the `AutocompleteEngine` to validate the focused element against the expected app and role before applying suggestions.
- Enhanced the `apply_text_to_focused_field` function to include role validation, ensuring better accuracy in text insertion.
- Improved the handling of suggestion context and error states during autocomplete operations.

This update enhances the reliability of the autocomplete feature by ensuring that suggestions are applied only when the correct context is maintained.

* fix(package): update dev:app script to include core staging step

- Modified the `dev:app` script in `package.json` to run `yarn core:stage` before executing `tauri dev`, ensuring that the core sidecar is properly staged during development.
- This change enhances the development workflow by automating the staging process, reducing manual steps for developers.

This update improves the reliability of the development environment setup.

* feat(autocomplete): implement core autocomplete engine and supporting modules

- Introduced a new `AutocompleteEngine` struct to manage the state and operations of the autocomplete feature, including starting, stopping, and refreshing suggestions.
- Added `EngineState` to track the current status, phase, and context of the autocomplete process.
- Implemented helper functions for managing focus and overlay notifications, enhancing user interaction with suggestions.
- Created utility functions for terminal context extraction and text sanitization, improving the accuracy of suggestions.
- Developed a comprehensive set of types and structures to support autocomplete operations, including suggestion handling and status reporting.

This update lays the foundation for a robust autocomplete feature, enhancing user experience through improved context awareness and interaction.

* refactor(autocomplete): remove unused functions and improve clipboard handling

- Deleted the `normalize_ax_value` and `parse_ax_number` functions as they were not utilized in the codebase, streamlining the autocomplete module.
- Enhanced the `clipboard_save` function to improve readability by formatting the string conversion of clipboard output, ensuring better handling of empty or "missing value" cases.

This update simplifies the code and improves the overall maintainability of the autocomplete functionality.

* refactor(autocomplete): remove unused functions and improve clipboard handling

- Deleted the `normalize_ax_value` and `parse_ax_number` functions as they were not utilized in the codebase, streamlining the autocomplete module.
- Enhanced the `clipboard_save` function to improve readability by formatting the string conversion of clipboard output, ensuring better handling of empty or "missing value" cases.

This update cleans up the code and optimizes the clipboard handling logic for the autocomplete feature.

* feat(autocomplete): enhance focus handling and text insertion methods

- Implemented a unified Swift helper for querying focused text elements, improving performance and reliability on macOS.
- Added fallback mechanisms to use osascript for focus queries when the helper is unavailable, ensuring consistent functionality.
- Refactored text insertion logic to prioritize the unified helper, with osascript and AXValue as fallback options, enhancing user experience during text application.
- Cleaned up and organized focus-related functions, improving code readability and maintainability.

This update significantly enhances the autocomplete feature's ability to interact with focused text elements, providing a more robust and responsive user experience.

* feat(accessibility): introduce comprehensive accessibility module for macOS

- Added a new `accessibility` module that centralizes focus queries, screen capture, key state detection, and permission management for macOS.
- Implemented a unified Swift helper process to enhance performance and reliability in querying focused text elements and managing overlays.
- Introduced various functionalities including screen capture, text insertion into focused fields, and permission detection for accessibility features.
- Enhanced user experience by providing robust methods for interacting with accessibility APIs, ensuring consistent behavior across different contexts.

This update significantly improves the accessibility capabilities of the application, providing a more responsive and user-friendly interface for macOS users.

* feat(accessibility): introduce screen capture and focus query modules

- Added a new `accessibility` module to centralize platform-specific accessibility functionalities, including screen capture and focus queries.
- Implemented `capture.rs` for screen capture using platform-native tools, supporting both windowed and fullscreen modes.
- Developed `focus.rs` to handle accessibility focus queries, utilizing a unified Swift helper for improved performance on macOS.
- Introduced helper functions for managing overlays and permissions, enhancing user interaction and accessibility features.

This update significantly enhances the application's accessibility capabilities, providing robust tools for screen capture and focus management.

* refactor(accessibility): remove unused accessibility functions and streamline modules

- Deleted unused functions from the accessibility module, including `focused_text_context`, `is_text_role`, `normalize_ax_value`, and `parse_ax_number`, to enhance code clarity and maintainability.
- Updated module documentation to reflect the current structure and purpose, ensuring consistency across the accessibility and screen intelligence modules.

This update simplifies the codebase and improves the overall organization of accessibility-related functionalities.

* feat(image-processing): implement image compression and resizing for vision LLM

- Added a new module `image_processing` to handle the compression and resizing of screenshots before sending them to the vision LLM.
- Implemented the `compress_screenshot` function, which decodes PNG data-URIs, resizes images to fit within a specified maximum dimension, and re-encodes them as JPEGs.
- Updated the `AccessibilityEngine` to utilize the new image processing functionality, ensuring that images sent for analysis are optimized for size and quality.
- Introduced new dependencies in `Cargo.toml` for image handling and compression.

This update enhances the efficiency of image processing in the application, reducing token usage and improving inference speed.

* feat(tests): add end-to-end tests for screen intelligence vision pipeline

- Introduced a new test file `screen_intelligence_vision_e2e.rs` to validate the complete flow of the screen intelligence vision pipeline.
- Implemented tests that cover generating images, compressing and resizing them, simulating LLM responses, and persisting results to memory.
- Utilized temporary directories and environment variable management to ensure test isolation and reliability.
- Enhanced the testing framework by including helper functions for image creation and mock responses, improving the overall test coverage and robustness.

This update significantly strengthens the testing capabilities of the screen intelligence module, ensuring that the entire pipeline functions correctly under various scenarios.

* style: apply cargo fmt and import ordering fixes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(accessibility): add non-macOS stub for validate_focused_target

The function was gated with #[cfg(target_os = "macos")] but exported
unconditionally from mod.rs, causing compilation failure on non-macOS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(accessibility): enhance screen capture and error handling

- Updated the screen capture functionality to include a timestamp helper in the documentation.
- Improved error handling when reading resized screenshots, ensuring temporary files are removed on failure.
- Added logging for raw errors returned by the helper in the focus context, providing better debugging information.
- Refactored clipboard handling in the paste functionality to preserve multi-line text, enhancing usability.
- Introduced a constant for terminal application names to simplify terminal detection logic.

This update improves the robustness and clarity of the accessibility module, enhancing both screen capture and focus handling capabilities.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 21:58:45 -07:00
cf344facf9 feat(voice): dedicated voice assistance module for STT/TTS (#178)
* feat(voice): add dedicated voice assistance module for STT/TTS

Extracts speech-to-text (whisper.cpp) and text-to-speech (piper) into a
dedicated `src/openhuman/voice/` domain module with its own RPC namespace
(`openhuman.voice_*`). Adds proactive availability checking via
`voice_status` so the UI can show clear errors when binaries/models are
missing instead of failing silently at transcription time.

- New module: voice/types.rs, voice/ops.rs, voice/schemas.rs, voice/mod.rs
- 4 RPC endpoints: voice_status, voice_transcribe, voice_transcribe_bytes, voice_tts
- 21 unit tests + 1 integration test (json_rpc_e2e)
- Frontend updated to use voice_* endpoints with status check on mode switch

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: fix cargo fmt in voice/ops.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(e2e): add voice mode integration spec

Tests switching to voice input mode, verifying status check fires,
recording button renders, and switching back to text mode restores
text input. Also checks reply mode toggle visibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: remove unused waitForText import in voice-mode e2e spec

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(voice): in-process whisper engine and LLM post-processing

- Add whisper-rs (0.16) for in-process whisper.cpp inference, eliminating
  cold-start latency from subprocess-per-call (~1-3s) to warm inference
  (~50ms). Model is loaded once during bootstrap and reused across calls.
  Falls back to whisper-cli subprocess if in-process loading fails.

- Add LLM post-processing layer that passes raw transcription through
  Ollama to fix grammar, punctuation, and filler words. Accepts optional
  conversation context to disambiguate names and technical terms.
  Gracefully degrades to raw whisper output if Ollama is unavailable.

- Update voice RPC endpoints with new optional params (context,
  skip_cleanup) and return both cleaned text and raw_text.

- Update frontend to pass conversation history as context for voice
  transcription cleanup, and update TypeScript interfaces to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt formatting fixes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(build): make whisper-rs optional behind `whisper` feature flag

The whisper-rs crate requires cmake to compile whisper.cpp from source,
which is not available in the CI environment. Move it behind an optional
cargo feature so CI builds succeed without cmake.

The whisper_engine module now compiles as a no-op stub when the feature
is disabled, returning "whisper feature not compiled in" errors. Desktop
builds can opt in with `--features whisper`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: cargo fmt whisper_engine.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): make whisper-rs mandatory and install cmake in CI

Revert whisper-rs from optional to mandatory dependency. Add cmake
installation to all CI workflows (build, typecheck, test, release) and
the CI Docker image so whisper-rs can compile whisper.cpp from source.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: cargo fmt whisper_engine.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address code review findings across voice module

- whisper_engine: validate WAV sample rate (must be 16kHz) and channel
  count (1 or 2) before feeding audio to whisper
- speech: offload load_engine and transcribe_in_process to
  tokio::task::spawn_blocking to avoid blocking the Tokio runtime
- ops: use RAII guard for WHISPER_BIN env var in test to prevent races
  and ensure restore on panic; log temp file cleanup failures instead
  of silently ignoring; sanitize paths in debug logs to basenames only
- postprocess: add test for disabled cleanup config returning raw text
- voice-mode.spec: assert failure when neither voice CTA nor
  unavailable message appears; make reply mode test runnable in
  isolation with auth/nav setup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 15:52:52 -07:00
YellowSnnowmannandGitHub 64eb513071 feat(billing, team): add billing and team management RPC functionality (#159)
* feat(billing, team): add billing and team management RPC functionality

- Introduced billing module with methods for fetching current plans, purchasing plans, creating portal sessions, and topping up credits.
- Added team management module with methods for listing team members, creating invites, listing invites, removing members, and changing member roles.
- Updated core registry to include new billing and team controllers and schemas, enhancing the overall functionality of the application.
- Implemented comprehensive tests for billing and team RPC methods to ensure reliability and correctness.

These additions improve the application's capabilities in managing billing and team functionalities, providing a more robust user experience.

* refactor(billing, team): improve code readability and structure

* fix(billing, team): enhance error handling and response structure

- Improved error handling in  to provide clearer error messages when reading response bodies.
- Updated validation in  to ensure  is a finite number greater than zero.
- Refined output schemas for billing and team functions to include more descriptive fields, enhancing API clarity.
- Introduced a new  function to standardize URL path construction, improving code maintainability.
- Added tests to verify the correctness of new output structures and API path building.

These changes enhance the robustness and usability of the billing and team management functionalities.

* feat(billing, team): add gateway normalization and route redaction functionality

- Introduced  function to standardize payment gateway inputs, ensuring only valid options (stripe, coinbase) are accepted, with defaults and error handling.
- Enhanced  function to utilize the new gateway normalization logic, improving input validation.
- Added  function to obscure sensitive identifiers in API route paths, enhancing security in logging.
- Implemented unit tests for both  and  to ensure correctness and reliability of the new features.

These changes improve the robustness of billing operations and enhance security in route handling.
2026-04-01 19:29:05 +05:30
00c7b01280 fix(skills): debug infrastructure + disconnect credential cleanup (#154)
* feat(debug): add skills debug script and E2E tests

- Introduced a new script `debug-skill.sh` for running end-to-end tests on skills, allowing users to easily test specific skills with customizable parameters.
- Added comprehensive integration tests in `skills_debug_e2e.rs` to validate the full lifecycle of skills, including discovery, starting, tool listing, and execution.
- Enhanced logging and error handling in the tests to improve observability and debugging capabilities.

These additions facilitate better testing and debugging of skills, improving the overall development workflow.

* feat(tests): add end-to-end tests for Skills RPC over HTTP JSON-RPC

- Introduced a new test file `skills_rpc_e2e.rs` to validate the full stack of skill operations via HTTP JSON-RPC.
- Implemented comprehensive tests covering skill discovery, starting, tool listing, and execution, ensuring robust functionality.
- Enhanced logging for better observability during test execution, facilitating easier debugging and validation of skill interactions.

These tests improve the reliability and maintainability of the skills framework by ensuring all critical operations are thoroughly validated.

* refactor(tests): update RPC method names in end-to-end tests for skills

- Changed RPC method names in `skills_rpc_e2e.rs` to use the new `openhuman` prefix, reflecting the updated API structure.
- Updated corresponding test assertions to ensure consistency with the new method names.
- Enhanced logging messages to align with the new method naming conventions, improving clarity during test execution.

These changes ensure that the end-to-end tests accurately reflect the current API and improve maintainability.

* feat(debug): add live debugging script and corresponding tests for Notion skill

- Introduced `debug-notion-live.sh` script to facilitate debugging of the Notion skill with a live backend, including health checks and OAuth proxy testing.
- Added `skills_notion_live.rs` test file to validate the Notion skill's functionality using real data and backend interactions.
- Enhanced logging and error handling in both the script and tests to improve observability and debugging capabilities.

These additions streamline the debugging process and ensure the Notion skill operates correctly with live data.

* feat(env): enhance environment configuration for debugging scripts

- Updated `.env.example` to include a new `JWT_TOKEN` variable for session management in debugging scripts.
- Modified `debug-notion-live.sh` and `debug-skill.sh` scripts to load environment variables from `.env`, improving flexibility and usability.
- Enhanced error handling in the scripts to ensure required variables are set, providing clearer feedback during execution.

These changes streamline the debugging process for skills by ensuring necessary configurations are easily managed and accessible.

* feat(tests): add disconnect flow test for skills

- Introduced a new end-to-end test `skill_disconnect_flow` to validate the disconnect process for skills, mirroring the expected frontend behavior.
- The test covers the stopping of a skill, handling OAuth credentials, and verifying cleanup after a disconnect.
- Enhanced logging throughout the test to improve observability and debugging capabilities.

These additions ensure that the disconnect flow is properly validated, improving the reliability of skill interactions.

* fix(skills): revoke OAuth credentials on skill disconnect

disconnectSkill() was only stopping the skill and resetting setup_complete,
leaving oauth_credential.json on disk. On restart the stale credential would
be restored, causing confusing auth state. Now sends oauth/revoked RPC before
stopping so the event loop deletes the credential file and clears memory.

Also adds revokeOAuth() and disableSkill() to the skills RPC API layer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt to skill debug tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(tests): improve skills directory discovery and error handling

- Renamed `find_skills_dir` to `try_find_skills_dir`, returning an `Option<PathBuf>` to handle cases where the skills directory is not found.
- Introduced a macro `require_skills_dir!` to simplify the usage of skills directory discovery in tests, providing clearer error messages when the directory is unavailable.
- Updated multiple test functions to utilize the new macro, enhancing readability and maintainability of the test code.

These changes improve the robustness of the skills directory discovery process and streamline the test setup.

* refactor(tests): enhance skills directory discovery with improved error handling

- Renamed `find_skills_dir` to `try_find_skills_dir`, returning an `Option<PathBuf>` to better handle cases where the skills directory is not found.
- Introduced a new macro `require_skills_dir!` to streamline the usage of skills directory discovery in tests, providing clearer error messages when the directory is unavailable.
- Updated test functions to utilize the new macro, improving code readability and maintainability.

These changes enhance the robustness of the skills directory discovery process and simplify test setup.

* fix(tests): skip skill tests gracefully when skills dir unavailable

Tests that require the openhuman-skills repo now return early with a
SKIPPED message instead of panicking when the directory is not found.
Fixes CI failures where the skills repo is not checked out.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(skills): harden disconnect flow, test assertions, and secret redaction

- disconnectSkill: read stored credentialId from snapshot and pass it to
  oauth/revoked for correct memory bucket cleanup; add host-side fallback
  to delete oauth_credential.json when the runtime is already stopped.
- revokeOAuth: make integrationId required (no more "default" fabrication);
  add removePersistedOAuthCredential helper for host-side cleanup.
- skills_debug_e2e: hard-assert oauth_credential.json is deleted after
  oauth/revoked instead of soft logging.
- skills_notion_live: gate behind RUN_LIVE_NOTION=1; require all env vars
  (BACKEND_URL, JWT_TOKEN, CREDENTIAL_ID, SKILLS_DATA_DIR); redact JWT and
  credential file contents from logs.
- skills_rpc_e2e: check_result renamed to assert_rpc_ok and now panics on
  JSON-RPC errors so protocol regressions fail fast.
- debug-notion-live.sh: capture cargo exit code separately from grep/head
  to avoid spurious failures under set -euo pipefail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* style: apply cargo fmt to skills_notion_live.rs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 23:44:07 -07:00
Mega MindandGitHub 52b59f62d7 test: add cross-stack coverage for core and tauri flows (#130)
* Add unit tests for Mnemonic page

- Introduced comprehensive tests for the Mnemonic page, covering initial render, copy to clipboard functionality, confirmation checkbox behavior, and mode switching between generate and import.
- Validated user interactions, including input handling and button states, ensuring robust functionality and user experience.
- Enhanced test coverage for various scenarios, including validation of mnemonic phrases and loading states during operations.

* test: add cross-stack test coverage for core and tauri flows

Add focused Rust and frontend tests for core process startup behavior, CLI argument parsing, JSON-RPC error handling, and Tauri command/RPC mapping paths to improve confidence for issue #57.

Closes #57

Made-with: Cursor

* refactor(tests): streamline test code and improve readability

Consolidate mock imports and simplify function calls in coreRpcClient tests. Adjust formatting in Rust core_process and CLI tests for better clarity. Update mnemonic test assertions for improved accuracy.

Made-with: Cursor
2026-04-01 00:25:04 +05:30
oxoxDevandGitHub 5481c9266e feat(autocomplete): persist accepted completions in memory and reuse them for suggestions (#108) (#119) 2026-03-31 08:08:41 -07:00
Al629176andGitHub e7a7f90fb6 Merge pull request #113 from sanil-23/issue-60-ingestion-relex
Add GLiNER relex ingestion pipeline (#60)
2026-03-31 19:23:25 +05:30
cyrus@tinyhumans.ai 2570195604 feat(local-ai): add guided model tier selection by device capability
Add tiered model presets (Low/Medium/High) with device-aware recommendations
so users can pick a local AI model that fits their machine without editing
raw JSON config. Detect RAM, CPU, GPU via sysinfo crate and recommend a tier.
Persist selection to config.toml, with env var override and graceful
degradation hints on bootstrap failure.

- Rust: presets.rs (tier definitions, recommendation logic), device.rs
  (hardware detection), 3 new RPC methods, env var override, bootstrap hints
- Frontend: tier selector UI in Settings > Local AI Model with device info,
  loading/error states, and "Advanced" toggle for existing controls
- Tests: 7 Rust unit tests + comprehensive JSON-RPC E2E test
- Also fixes pre-existing lint warning in SkillSetupWizard.tsx

Closes #80
2026-03-31 18:43:50 +05:30
sanil jain b7835eb843 Add GLiNER relex ingestion pipeline 2026-03-31 14:11:26 +05:30
Steven EnamakelandGitHub 14dc860a21 Skills runtime, onboarding, deep links, and core RPC refinements (#95)
* feat(telegram): implement Telegram channel and attachment handling

- Added `TelegramChannel` struct for managing Telegram Bot API interactions, including user management and message handling.
- Introduced attachment parsing with `TelegramAttachment` and `TelegramAttachmentKind` to support various media types.
- Implemented functions for parsing attachment markers and validating URLs, enhancing message processing capabilities.
- Created a new module structure for Telegram, including `attachments`, `channel`, and `text` for better organization and maintainability.

* feat(skills): implement skills registry management and E2E testing

- Added functionality for fetching, searching, installing, and uninstalling skills from a remote registry.
- Introduced new modules for registry operations and types, enhancing the skills management system.
- Implemented E2E tests for skills registry interactions, ensuring robust functionality and integration.
- Updated documentation to reflect new skills registry features and usage instructions.

* refactor(coreRpcClient): remove socket RPC handling and streamline HTTP request logging

- Eliminated socket-based RPC handling to simplify the core RPC client logic.
- Updated logging to use a unified debug logger for both HTTP requests and errors.
- Improved error handling for HTTP responses to ensure clarity in error reporting.

* feat(skills): enhance skill setup handling and improve error management

- Updated SkillActionButton to directly open the setup modal for skills requiring OAuth, bypassing the QuickJS runtime.
- Enhanced SkillSetupWizard to handle OAuth configuration more effectively, ensuring smoother transitions during skill setup.
- Improved error handling during skill startup and setup processes, providing clearer logging for failures.
- Refactored skills loading logic in the Skills page to prioritize registry-based skill fetching, with fallback to runtime discovery.
- Added skill installation handling in the Skills page, allowing for better user feedback during installation processes.

* feat(deep-link): enhance OAuth handling and streamline token management

- Updated desktopDeepLinkListener to improve skill connection handling after OAuth completion.
- Introduced setSkillSetupComplete action to mark skills as connected immediately post-OAuth.
- Refactored token fetching logic to ensure encrypted tokens are stored correctly, enhancing error handling and reducing redundant checks.
- Added new permissions in default.json for improved window management capabilities.

* feat(skills): enhance skill management with global engine and runtime controllers

- Added global engine management for skill runtime access, allowing RPC handlers to interact with the runtime engine.
- Introduced new runtime controllers for skills, including start, stop, status, setup_start, list_tools, sync, and call_tool, enhancing skill lifecycle management.
- Updated schemas to include new skill controller functionalities, improving the overall skills management system.
- Enhanced documentation and comments for clarity on new features and usage.

* refactor(skills): update global engine management and enhance documentation

- Replaced OnceLock with RwLock for the global RuntimeEngine, allowing for better testability and flexibility in engine management.
- Updated the global_engine and require_engine functions to return cloned Arc references, improving usability.
- Enhanced documentation comments for clarity on the global engine's usage and behavior in production and testing scenarios.

* chore(todos): update TODO list with removal of Tauri from Rust core

- Added a new item to the TODO list indicating the need to remove Tauri from the OpenHuman Rust core, streamlining the project structure.

* feat(onboarding): revamp onboarding steps and introduce local AI model consent

- Replaced the PrivacyStep with a new ScreenPermissionsStep to handle accessibility permissions.
- Added LocalAIStep for user consent on local AI model usage and download initiation.
- Introduced SkillsStep and ToolsStep for selecting skills and enabling tools during onboarding.
- Updated onboarding state management to include local model consent, download status, and enabled tools.
- Enhanced the overall onboarding flow with new components and improved user experience.

* feat(onboarding): enhance onboarding flow with new WelcomeStep and updated LocalAIStep

- Introduced a new WelcomeStep to guide users through the onboarding process.
- Updated LocalAIStep to clarify local AI model usage and consent, including improved messaging on privacy and resource impact.
- Enhanced ScreenPermissionsStep to emphasize local processing of accessibility data.
- Adjusted total steps in onboarding to reflect the addition of the WelcomeStep, improving user experience.

* refactor(tray): remove tray integration and related functionalities

- Deleted the tray module and its associated operations, streamlining the project structure.
- Removed references to Tauri app handle in various components, transitioning to a memory client for skill data persistence.
- Updated skill instances and event loops to eliminate dependencies on tray functionalities, enhancing modularity.
- Improved documentation to reflect the removal of tray-related features and clarify the new architecture.

* feat(onboarding): introduce OnboardingOverlay and enhance onboarding flow

- Added OnboardingOverlay component to display the onboarding process as a full-screen overlay when the user is not onboarded.
- Updated the Onboarding component to include a new MnemonicStep for recovery phrase management.
- Enhanced onboarding state management to track workspace onboarding flags and user onboarding status.
- Refactored AppRoutes to streamline routing and integrate the new onboarding flow.
- Removed deprecated onboarding logic from previous steps, improving overall user experience.

* refactor(sidebar): simplify hidden paths and update ProtectedRoute tests

- Removed '/onboarding' from the hiddenPaths in MiniSidebar to streamline route visibility.
- Updated ProtectedRoute tests to reflect changes in onboarding handling, ensuring children render correctly when authenticated.

* chore: format, fix E2E lint, and onboarding step polish

Made-with: Cursor

* style(onboarding): update background color for onboarding steps

- Changed background color from black/30 to stone-900 for improved visual consistency across LocalAIStep, MnemonicStep, ScreenPermissionsStep, SkillsStep, ToolsStep, and WelcomeStep components.
- Enhanced overall aesthetics of the onboarding flow.

* fix(tests): update variable naming and comment out unused JavaScript content

- Renamed workspace variable to `_ws` to indicate it is unused in the `test_registry_cache_ttl_expired` test.
- Commented out the `js_content` variable to prevent unused variable warnings in the test setup.

* refactor(tests): streamline JSON-RPC test setup and remove unused backend URL handling

- Updated the JSON-RPC end-to-end test to always use the in-process Axum mock for backend settings, ensuring consistent test behavior.
- Removed the conditional logic for external backend URLs, simplifying the test setup.
- Ensured proper cleanup of mock join handles after test execution.

* refactor(runtime): update skill startup process to use core RPC

- Replaced the direct call to `runtimeStartSkill` with a `callCoreRpc` method for starting skills, enhancing the integration with the core RPC system.
- Updated comments to reflect the new implementation details.
- Made minor adjustments to the schema organization in Rust for better clarity on runtime controllers.
2026-03-30 14:32:18 -07:00
Steven EnamakelandGitHub 7ad3c73ac3 Refactor UI auth/bootstrap and remove legacy UI runtime layers (#63)
* Enhance E2E build process and backend URL handling

- Updated `e2e-build.sh` to set CI environment variable correctly for compatibility with various CI runners.
- Refactored `backendUrl.ts` to support dynamic backend URL resolution from Vite environment variables, improving flexibility in different deployment contexts.

* Implement web channel functionality and enhance chat features

- Introduced new web channel commands for sending and canceling chat messages, improving user interaction with the chat system.
- Added support for server-sent events (SSE) to handle real-time updates for chat interactions, enhancing responsiveness.
- Refactored existing code to improve readability and maintainability, including updates to the core HTTP router and JSON-RPC handling.
- Implemented comprehensive end-to-end tests for the web channel flow, ensuring robust functionality and user experience.
- Enhanced the overall structure of the web channel module, including event publishing and subscription mechanisms for better scalability.

* Refactor socket handling to unify communication across environments

- Removed Tauri-specific socket handling from various components, streamlining the codebase to use a single Socket.IO client for both web and desktop environments.
- Updated the `useIntelligenceSocket` hook to eliminate Tauri checks and directly utilize the socket service for message sending and chat initialization.
- Refactored metadata synchronization in Gmail and Notion services to use the unified socket service, enhancing consistency in socket communication.
- Improved error handling and logging across socket interactions to provide clearer feedback during connection issues.
- Enhanced the Conversations component to manage socket connection status, ensuring a more robust user experience during chat interactions.

* Refactor socket service and enhance core URL resolution

- Replaced the deprecated `getBackendUrl` function with `resolveCoreSocketBaseUrl` to improve backend URL resolution for socket connections, accommodating both Tauri and non-Tauri environments.
- Introduced `coreSocketBaseFromRpcUrl` to streamline the processing of RPC URLs.
- Removed the `tauriSocket.ts` file, consolidating socket handling into a unified service for better maintainability and clarity.
- Updated the socket connection logging to provide more informative messages during connection attempts.

* Add engineioxide and socketioxide packages to Cargo.lock and update Cargo.toml

- Introduced new packages: `engineioxide` and `socketioxide`, both at version 0.15.2, enhancing the project's capabilities.
- Updated `Cargo.toml` to include `socketioxide` with the "extensions" feature, ensuring proper integration with the existing codebase.
- Added dependencies for both packages, improving modularity and functionality across the application.

* Refactor Conversations component and streamline chat handling

- Removed unused imports and functions related to Notion context and socket handling, simplifying the Conversations component.
- Enhanced error handling during chat interactions, ensuring clearer feedback for users.
- Updated chatSend function parameters to eliminate unnecessary context, improving the clarity of the API call.
- Consolidated logic for managing chat message history and context, enhancing maintainability and readability of the code.

* Enhance core RPC client with improved logging and error handling

- Introduced debug logging for socket RPC requests and responses, providing better visibility into the communication process.
- Enhanced error handling in the core RPC client to log detailed error messages, improving debugging capabilities.
- Updated socket service to log inbound events, ensuring comprehensive tracking of socket interactions.
- Removed deprecated MCP handlers from the socket service, streamlining the codebase and improving maintainability.

* Refactor apiClient and socketService for improved maintainability

- Changed the declaration of `_getToken` from `let` to `var` in `apiClient.ts` to enhance variable scoping.
- Removed unused imports in `socketService.ts`, streamlining the code and improving readability.

* Refactor deep link handling and enhance E2E testing capabilities

- Updated the deep link configuration in `lib.rs` to use a more generalized `#[cfg(desktop)]` directive, improving compatibility across desktop platforms.
- Enhanced the `triggerDeepLink` function in `deep-link-helpers.ts` to include macOS-specific app activation and launching logic, ensuring better integration with the macOS environment.
- Introduced a new `buildBypassJwt` function to generate bypass JWT tokens for E2E testing, improving the flexibility of authentication flows in tests.
- Updated E2E tests in `conversations-web-channel-flow.spec.ts` to utilize the new `triggerAuthDeepLinkBypass` function, enhancing the testing of authentication scenarios.

* Enhance deep link handling and E2E test configuration

- Updated `triggerAuthDeepLink` in `deep-link-helpers.ts` to support environment-based bypass tokens, improving flexibility in authentication flows during E2E tests.
- Modified the `serve_on_ephemeral` function call in `json_rpc_e2e.rs` to disable the core HTTP router's default behavior, enhancing test isolation and control over the testing environment.

* Refactor deep link handling and enhance E2E test utilities

- Updated `authFlow.e2e.test.tsx` to utilize `window.__simulateDeepLink` for simulating deep links, improving test accuracy and alignment with real-world scenarios.
- Modified `lib.rs` to restrict deep link registration to Windows and Linux platforms, clarifying platform-specific behavior.
- Enhanced `deep-link-helpers.ts` with a new function to simulate deep links in the WebView, providing a fallback mechanism for E2E tests.
- Updated `conversations-web-channel-flow.spec.ts` to reflect changes in deep link triggering, improving logging and test clarity.

* Update dependencies in Cargo.lock and Cargo.toml for improved project stability

- Removed several unused dependencies from `Cargo.lock` and `Cargo.toml`, including `aes-gcm`, `argon2`, and `async-imap`, streamlining the project and reducing potential security vulnerabilities.
- Updated existing dependencies to their latest versions, ensuring compatibility and leveraging improvements in performance and security.
- Simplified the dependency structure by consolidating features and removing unnecessary comments, enhancing clarity and maintainability of the configuration files.

* Refactor App component and remove unused providers

- Removed `AIProvider` and `SkillProvider` from the `App` component, streamlining the component structure and improving readability.
- Updated the `UserProvider` to focus solely on bootstrapping the authentication token, enhancing its clarity and purpose.
- Adjusted the layout within the `App` component to maintain functionality without the removed providers, ensuring a smooth user experience.

* Remove deprecated AI components and types

- Deleted the `index.ts`, `loader.ts`, `types.ts`, and related test files from the AI module, streamlining the codebase by removing unused and outdated components.
- Eliminated the `default-constitution.md` and associated constitution files, which were no longer relevant to the current architecture.
- This cleanup enhances maintainability and reduces complexity within the AI system.

* Refactor user data fetching logic and remove legacy tools cache watcher

- Enhanced the `useUser` hook to prevent infinite retry loops by implementing a token check with a reference to track the last auto-fetch token.
- Removed the legacy file watcher for `TOOLS.md`, transitioning to a core RPC and socket event-based refresh mechanism for tool/config updates.
- Updated test state structure to include `isAuthBootstrapComplete` and `channelConnections`, improving test coverage and state management.

* Refactor channel module structure and add new providers

- Consolidated channel modules under a new `providers` directory, improving organization and clarity.
- Introduced new channel providers for DingTalk, Discord, Email, iMessage, IRC, and Lark, expanding the messaging capabilities of the application.
- Updated the `mod.rs` file to reflect the new structure and ensure proper module exports, enhancing maintainability and ease of use.

* refactor(ui): remove legacy providers/lib logic and stabilize auth bootstrap

* chore: apply pre-push auto-fixes
2026-03-29 20:22:38 -07:00
Steven EnamakelandGitHub 7bcf43314a Improve service lifecycle E2E coverage and align CI workflows (#62)
* Add JSON-RPC schema definition and HTTP schema endpoint

- Introduced a new `schema.json` file containing detailed definitions for various JSON-RPC methods, including their inputs, outputs, and descriptions.
- Implemented a new HTTP endpoint `/schema` in the core server to serve the JSON-RPC schema, enhancing API documentation and accessibility.
- Updated the core HTTP router to include the new schema route, improving the overall structure and usability of the API.
- Enhanced error handling and response formatting in the server to ensure consistent feedback for schema requests.

* Update TypeScript configuration and refactor core RPC client

- Changed TypeScript target from ES2020 to ESNext and updated library references in `tsconfig.json` for improved compatibility with modern features.
- Refactored `coreRpcClient.ts` to enhance JSON-RPC request handling, including the introduction of legacy method aliases and improved error handling.
- Updated API service methods in `authApi.ts` and `channelConnectionsApi.ts` to utilize the new core RPC client structure, streamlining authentication and channel connection processes.
- Added new utility functions for managing JSON-RPC requests and responses, improving code organization and maintainability.
- Enhanced test coverage for the new RPC client methods and refactored existing tests to align with the updated structure.

* Enhance Tauri configuration and refactor daemon program arguments

- Updated `tauri.conf.json` to include additional macOS infoPlist settings for better application identification and icon management.
- Refactored the `daemon_program_args` function in `common.rs` to improve clarity by renaming the parameter to `_exe`, indicating it is unused. This change enhances code readability and maintainability.

* Refactor Tauri configuration by removing unused macOS infoPlist settings

- Updated `tauri.conf.json` to streamline macOS configuration by removing unnecessary infoPlist entries while retaining essential settings for the application.
- This change enhances clarity and maintainability of the Tauri configuration file.

* Enhance authentication flow and testing documentation

- Introduced a new `isAuthBootstrapComplete` state in the authentication slice to manage the completion of the authentication bootstrap process.
- Updated the `UserProvider` to set the `isAuthBootstrapComplete` state based on the authentication status, improving session restoration logic.
- Modified route components (`DefaultRedirect`, `ProtectedRoute`, `PublicRoute`) to conditionally render based on the `isAuthBootstrapComplete` state, enhancing user experience during the authentication process.
- Added a comprehensive testing guide in `CLAUDE.md`, detailing unit and E2E testing practices, including setup, authoring rules, and a checklist for test coverage.
- Updated the `SettingsHome` component to redirect to the home page instead of the login page upon logout, streamlining user navigation.
- Enhanced the `LocalModelPanel` to track download progress and manage local AI assets more effectively, improving overall functionality.

* Add resolutions for @tauri-apps/api dependency in package.json

- Introduced a resolutions field in package.json to enforce the use of @tauri-apps/api version 2.10.1, ensuring compatibility across workspaces.
- Updated dependencies in app/package.json to include @tauri-apps/api version 2.10.1, aligning with the new resolution.
- Adjusted yarn.lock to reflect the updated version of @tauri-apps/api, enhancing dependency management and consistency.

* Refactor Tauri configuration and enhance E2E build process

- Updated `tauri.conf.json` to remove unused resource paths, streamlining the configuration for better maintainability.
- Modified `wdio.conf.ts` to improve application path resolution for macOS, allowing for multiple bundle base checks to enhance compatibility.
- Refactored `e2e-build.sh` to disable updater artifacts for E2E builds and introduced a conditional cargo clean mechanism, improving build efficiency and clarity.

* Enhance E2E testing setup and documentation

- Updated `CLAUDE.md` to clarify the default behavior of `OPENHUMAN_WORKSPACE` in `e2e-run-spec.sh`, emphasizing automatic creation and cleanup for reproducible E2E runs.
- Modified `e2e-run-spec.sh` to implement automatic temporary workspace creation when `OPENHUMAN_WORKSPACE` is not set, improving usability for debugging and testing.
- Enhanced cleanup logic in `e2e-run-spec.sh` to ensure proper removal of temporary workspaces after tests, contributing to a cleaner testing environment.

* Implement shared mock backend for testing and enhance documentation

- Introduced a shared mock backend for unit and integration tests, allowing for deterministic API behavior across app and Rust tests.
- Updated `CLAUDE.md` to include detailed instructions on using the shared mock backend, including key admin endpoints and manual run commands.
- Modified `package.json` to add scripts for running the mock API server and Rust tests with the mock backend.
- Refactored test setup to utilize the new mock backend, improving test reliability and isolation.
- Removed obsolete MSW handlers and server setup, streamlining the testing framework.

* Enhance authentication state management and testing coverage

- Introduced `isAuthBootstrapComplete` state in the authentication slice to track the completion of the authentication process.
- Updated `ProtectedRoute` and `PublicRoute` components to utilize the new state, improving user experience during authentication.
- Enhanced test cases for `ProtectedRoute` and `PublicRoute` to reflect the updated authentication state structure.
- Added a new end-to-end test for the authentication flow, ensuring proper handling of OAuth tokens and session management.
- Improved mock setup in tests to better simulate authentication scenarios, enhancing test reliability and coverage.

* Enhance README.md with architecture overview and component roles

- Added detailed descriptions of the OpenHuman architecture, highlighting the separation of business logic and UI components.
- Explained the roles of Rust and the UI in the monorepo, including the use of JSON-RPC, QuickJS, Vite, React, and Tauri.
- Documented the structure of controllers and the RPC surface, emphasizing the shared contract for automation and testing.
- Provided links to further documentation for architecture, frontend structure, and Tauri commands.

* Integrate ServiceBlockingGate component and enhance loading states

- Added the `ServiceBlockingGate` component to manage service availability and display appropriate loading screens.
- Updated `DefaultRedirect`, `ProtectedRoute`, and `PublicRoute` components to show a loading indicator while authentication bootstrap is in progress.
- Implemented timeout handling in `UserProvider` for improved authentication state management.
- Introduced tests for `ServiceBlockingGate` to ensure proper rendering and functionality under various service states.

* Implement core RPC URL resolution and default hash route handling

- Added a function to resolve the core RPC URL based on the environment, improving flexibility for Tauri and non-Tauri contexts.
- Introduced a default hash route handler in the main application entry point to ensure proper navigation behavior.
- Updated the core RPC command to expose the resolved RPC URL, enhancing the integration with the frontend.
- Refactored the core RPC client to utilize the new URL resolution logic, ensuring consistent API calls.

* Refactor backend URL usage to API_BASE_URL

- Replaced all instances of BACKEND_URL with API_BASE_URL across various components and services to standardize API endpoint references.
- Updated OAuth provider configurations, settings panels, hooks, and services to ensure consistent API calls.
- Enhanced test setups to reflect the new API_BASE_URL, improving test reliability and alignment with the updated configuration.

* Implement RouteLoadingScreen for improved loading states

- Introduced a new `RouteLoadingScreen` component to provide a consistent loading experience across various routes.
- Updated `DefaultRedirect`, `ProtectedRoute`, and `PublicRoute` components to utilize `RouteLoadingScreen` while waiting for authentication bootstrap completion.
- Enhanced `MiniSidebar` to hide on additional public/setup routes, improving user navigation experience.
- Refactored `UserProvider` to streamline authentication state management by removing unnecessary references.

* Add feature design workflow section to CLAUDE.md

- Introduced a comprehensive workflow for feature design, outlining steps from specification to UI implementation and testing.
- Emphasized the importance of grounding designs in existing codebases and defined planning rules for E2E scenarios.
- Provided detailed instructions for implementing features in Rust, conducting JSON-RPC tests, and building UI components in the Tauri app.

* Refactor backend URL handling and improve OAuth flow

- Replaced static API_BASE_URL references with dynamic backend URL resolution across various components and services, enhancing flexibility for Tauri and non-Tauri environments.
- Updated OAuth provider configurations to utilize the new backend URL logic, ensuring consistent login URL generation.
- Refactored API client and socket service to fetch the backend URL dynamically, improving reliability in different deployment contexts.
- Introduced a new service for resolving the backend URL, streamlining the configuration and enhancing test setups.

* Add debug logging guidelines to CLAUDE.md

- Introduced comprehensive guidelines for implementing development-oriented debug logging in both Rust and the app.
- Emphasized the importance of logging at appropriate levels (`debug`/`trace`) and following existing patterns for consistency.
- Provided instructions on avoiding sensitive information in logs and ensuring terminal output is grep-friendly for easier debugging during development.

* Enhance service management with new mock functionality and E2E tests

- Added a mock service manager to facilitate deterministic service behavior during end-to-end tests, enabling better simulation of service states.
- Introduced new buttons in the `ServiceBlockingGate` component for restarting and uninstalling services, improving user control over service management.
- Implemented a comprehensive E2E test suite for the service connectivity flow, covering installation, starting, stopping, restarting, and uninstalling services.
- Updated package scripts to include a new E2E test for service connectivity, enhancing testing coverage and reliability.
- Refactored service operations to support mock functionality, ensuring consistent behavior across testing and production environments.

* Enhance ServiceBlockingGate with improved logging and periodic health polling

- Introduced periodic health polling in the `ServiceBlockingGate` component to refresh service status every 3 seconds, enhancing responsiveness to service state changes.
- Added detailed logging for various operations, including service status checks and error handling, to improve traceability and debugging.
- Updated E2E tests to include logging steps for better visibility during service connectivity flow tests.
- Refactored error handling to ensure consistent logging of error messages across service operations.

* Refactor E2E testing scripts and enhance CLAUDE.md documentation

- Updated paths in CLAUDE.md to reflect the new location of the E2E run script, ensuring accurate instructions for running tests.
- Removed outdated E2E test scripts from package.json and migrated relevant functionality to app/package.json for better organization.
- Introduced new E2E testing scripts for specific flows (auth, login, payment, etc.) to streamline testing processes and improve modularity.
- Added a script to run all E2E flows sequentially, enhancing test coverage and simplifying execution.
- Improved documentation for E2E testing procedures in CLAUDE.md, providing clearer guidance for developers.

* Refactor imports and enhance code readability

- Removed duplicate import of `ServiceBlockingGate` in `App.tsx` for cleaner code.
- Improved readability in `MiniSidebar.tsx` by formatting conditional statements.
- Reordered imports in `PublicRoute.tsx` for consistency.
- Enhanced formatting in `ServiceBlockingGate.tsx` for better clarity in asynchronous operations.
- Streamlined import statements in various test files and components for improved organization.
- Updated `LocalModelPanel.tsx` to enhance button disable logic readability.
- Refactored CORS headers in `jsonrpc.rs` for better formatting.

* ci: align build and test workflows with app workspace e2e

* ci: align release and typecheck workflows with current workspace

* Enhance ServiceBlockingGate functionality with improved refresh options

- Introduced a new `RefreshOptions` type to customize the behavior of the `refreshStatus` function, allowing for conditional error clearing and status checking.
- Updated the `refreshStatus` function to utilize the new options, enhancing control over service state updates.
- Modified the button click handler to pass the new options, improving user experience during service refresh operations.
- Adjusted state updates to prevent unnecessary re-renders and maintain consistency in service state management.

* Refactor RefreshOptions type for improved clarity in ServiceBlockingGate

- Consolidated the definition of the `RefreshOptions` type into a single line for better readability.
- Maintained existing functionality while enhancing code clarity in the `ServiceBlockingGate` component.
2026-03-29 18:14:13 -07:00
Steven EnamakelandGitHub c1a3ae1cfe Refactor controller registration into domain schemas and generic registry (#53)
* Refactor core server helpers and enhance REPL dotenv loading

- Removed unused functions for extracting namespaces and filtering documents by namespace from `helpers.rs`, streamlining the codebase.
- Introduced dotenv loading functionality in `repl.rs`, allowing for environment variable management from a specified `.env` file.
- Added utility functions for parsing dotenv values and resolving the dotenv file path, improving configuration handling in the REPL.
- Enhanced logging for dotenv loading to provide better visibility into the process and any issues encountered.

* Add AI RPC module and enhance core server dispatch functionality

- Introduced a new `rpc` module within the `ai` namespace to handle various AI-related commands, including memory file operations and session management.
- Updated the core server's dispatch logic to integrate the new AI RPC functionality, improving modularity and maintainability.
- Removed outdated memory dispatch implementation and streamlined the overall dispatch structure for better performance and clarity.
- Enhanced error handling and logging throughout the new functionalities to improve maintainability and user feedback.

* Refactor project structure and enhance RPC functionality

- Introduced a new `rpc` module to streamline JSON-RPC handling across various domains, improving code organization and maintainability.
- Updated the core server and API modules to utilize the new `rpc` structure, enhancing modularity and reducing code duplication.
- Added new models for authentication and socket management, improving the overall functionality of the API.
- Removed outdated references to the previous `openhuman` RPC structure, ensuring a cleaner and more efficient codebase.

* Update architecture documentation and refactor AI prompt paths

- Updated references in architecture documentation to reflect the new directory structure for AI prompts, changing paths from `src/ai/prompts` to `src/openhuman/agent/prompts`.
- Enhanced clarity in command documentation by aligning AI-related commands with the updated prompt paths.
- Removed obsolete AI module and streamlined memory management references to improve code organization and maintainability.
- Introduced new markdown files for agent prompts, establishing a foundation for OpenHuman's AI capabilities.

* Update AI prompt paths and configuration references

- Changed all references from `src/ai/prompts` to `src/openhuman/agent/prompts` in documentation and code files to reflect the new directory structure.
- Updated Tauri configuration to include the new resource paths for AI prompts, ensuring proper access and functionality.
- Enhanced the AI configuration commands to align with the updated paths, improving clarity and maintainability across the project.

* Enhance core structure and introduce new RPC functionality

- Added a new `core` module to centralize shared schemas and contracts for controllers, improving code organization and maintainability.
- Introduced `jsonrpc` and `cli` modules within the `core` structure to handle JSON-RPC requests and command-line interactions, enhancing modularity.
- Defined a `ControllerSchema` for transport-agnostic function contracts, allowing for consistent handling across RPC and CLI layers.
- Established a new `all` module to manage registered controllers and their schemas, streamlining the invocation process.
- Updated documentation in `CLAUDE.md` to reflect new controller schema contracts and module organization, improving clarity for developers.

* Refactor core server structure and enhance RPC functionality

- Removed the `core_server` module and integrated its functionalities into the `core` module, improving code organization and maintainability.
- Introduced a new `dispatch` module to handle RPC requests, streamlining the invocation process for various commands.
- Updated the CLI to utilize the new core structure, enhancing command handling and modularity.
- Added comprehensive logging for RPC interactions, improving visibility and debugging capabilities.
- Enhanced error handling across the core server, ensuring consistent feedback for users and developers.

* Refactor CLI command handling and enhance JSON-RPC integration

- Consolidated CLI command structure by removing the `CoreCli` and directly implementing command functions for `run`, `call`, and `namespace`.
- Improved argument parsing for server commands, including port specification and help options, enhancing user experience.
- Streamlined the invocation of JSON-RPC methods, ensuring consistent error handling and response formatting across commands.
- Introduced a new `run_namespace_command` function to manage namespace-specific operations, improving modularity and clarity in command execution.

* Refactor SkillsPanel and TauriCommandsPanel for improved integration handling

- Removed unused integration-related functions and state management from SkillsPanel, simplifying the component's logic.
- Updated TauriCommandsPanel to eliminate integration name input and associated commands, streamlining the user interface.
- Introduced a new local AI memory management module to handle session and memory operations, enhancing overall functionality.
- Refactored core RPC client to integrate local AI method dispatching, improving command handling consistency across the application.
- Cleaned up tauriCommands utility functions to align with the new command structure, enhancing maintainability.

* Refactor TauriCommandsPanel to streamline command handling

- Removed the `openhumanModelsRefresh` function and replaced its usage with `openhumanDoctorReport`, simplifying the command logic.
- Eliminated unused model refresh buttons from the UI, enhancing the user interface and reducing clutter.
- Updated related utility functions in `tauriCommands.ts` to reflect the removal of model refresh functionality, improving maintainability.

* Refactor JSON-RPC server integration and remove legacy server module

- Updated the CLI to invoke the JSON-RPC server directly, enhancing command execution flow.
- Introduced a new HTTP router in the `jsonrpc` module, consolidating route handling for health checks and RPC requests.
- Removed the deprecated `server` module, streamlining the codebase and improving maintainability.
- Adjusted tests to reflect the new routing structure, ensuring continued functionality and integration.

* Remove submodule and update CLAUDE.md documentation

- Deleted the `.gitmodules` file and removed the `skills` submodule, simplifying the project structure.
- Updated the description in `CLAUDE.md` to reflect a broader focus on community assistance rather than just crypto, enhancing clarity.
- Added sections on coding philosophy and controller migration checklist to improve developer guidance and maintainability.

* Refactor controller registration and enhance schema management

- Introduced a centralized registry for registered controllers, improving the organization and validation of controller schemas.
- Updated the `all_registered_controllers` and `all_controller_schemas` functions across various modules to streamline controller management.
- Added comprehensive validation for controller registration to ensure consistency and prevent duplicate entries.
- Enhanced the CLI and JSON-RPC integration to utilize the new registry structure, improving command handling and modularity.
- Updated documentation in `CLAUDE.md` to reflect changes in the skills registry and controller management processes, enhancing clarity for contributors.

* Enhance autocomplete, config, and credentials modules with new schemas and controller registrations

- Added support for autocomplete, config, and credentials functionalities by introducing new schemas and registered controllers.
- Updated the `build_registered_controllers` and `build_declared_controller_schemas` functions to include new entries for autocomplete, config, and credentials.
- Implemented new JSON-RPC tests for autocomplete and config methods, ensuring proper validation and error handling.
- Refactored CLI tests to include checks for new commands related to autocomplete and configuration management, improving test coverage and reliability.
- Introduced new modules for schemas in autocomplete, config, and credentials, enhancing code organization and maintainability.

* Add local AI and migration modules with schemas and controller registrations

- Introduced local AI and migration functionalities by adding new schemas and registered controllers.
- Updated the `build_registered_controllers` and `build_declared_controller_schemas` functions to include entries for local AI and migration.
- Implemented JSON-RPC tests for local AI and migration methods, ensuring proper validation and error handling.
- Enhanced CLI tests to verify new commands related to local AI and migration, improving test coverage and reliability.
- Organized code by creating dedicated modules for schemas in local AI and migration, enhancing maintainability.

* Refactor controller schemas for config and auth modules

- Updated controller schemas for config and auth functionalities, aligning namespaces and function names for consistency.
- Changed function names in the JSON-RPC tests to reflect the new schema structure, ensuring proper invocation.
- Enhanced CLI tests to verify updated commands related to config and auth, improving test coverage and reliability.
- Organized code by consolidating related functionalities under appropriate namespaces, enhancing maintainability.

* Add agent and screen intelligence modules with schemas and controller registrations

- Introduced agent and screen intelligence functionalities by adding new schemas and registered controllers.
- Updated the `build_registered_controllers` and `build_declared_controller_schemas` functions to include entries for agent and screen intelligence.
- Created dedicated modules for schemas in agent, screen intelligence, skills, tools, tray, and workspace, enhancing code organization and maintainability.
- Implemented initial controller schemas for agent and screen intelligence, providing a foundation for future functionality.
- Enhanced the overall structure of the core module to accommodate new integrations, improving modularity and clarity.

* Enhance autocomplete and namespace descriptions in core modules

- Added a new function `namespace_description` to provide descriptions for various namespaces, improving user guidance in CLI commands.
- Updated the CLI help output to include namespace descriptions, enhancing clarity for users.
- Introduced a new `core` module for autocomplete functionalities, including various operations and structures related to inline autocomplete.
- Refactored the `autocomplete` module to improve organization and maintainability, consolidating related functionalities under appropriate namespaces.
- Implemented initial JSON-RPC operations for autocomplete, ensuring a robust interface for managing autocomplete features.

* Refactor and clean up code across multiple modules

- Removed unnecessary whitespace in `TauriCommandsPanel.tsx`, improving code readability.
- Cleaned up imports and reorganized code structure in `localCoreAiMemory.ts`, enhancing maintainability.
- Streamlined module imports in `mod.rs` files across various directories, ensuring consistency and clarity.
- Deleted the obsolete `rpc.rs` file in the `cron` module, consolidating functionality and reducing clutter.
- Updated function definitions in `ops.rs` to improve formatting and readability, enhancing overall code quality.

* Refactor session management and enhance module organization

- Changed `sessionIndex` from a mutable variable to a constant in `localCoreAiMemory.ts`, improving code clarity and immutability.
- Introduced new `ops.rs` files in the `approval`, `providers`, `skills`, and `quickjs_libs` modules, consolidating related functionalities and enhancing code organization.
- Streamlined module imports in `mod.rs` files across various directories, ensuring consistency and clarity in module structure.
- Removed obsolete code and unnecessary comments, improving overall code readability and maintainability.

* Refactor configuration schema organization and module structure

- Moved the configuration schema definitions from `mod.rs` to a new `types.rs` file, enhancing modularity and clarity.
- Updated module imports across various files to reflect the new structure, ensuring consistency in the codebase.
- Cleaned up obsolete code and comments, improving overall readability and maintainability.

* Remove obsolete configuration schema file and its associated modules

- Deleted the `types.rs` file from the configuration schema, consolidating the codebase and removing unused components.
- This change enhances maintainability by eliminating redundant code and streamlining the overall structure of the configuration management.

* Fix config schema module exports

* Add configuration schema types and enhance module exports

- Introduced a new `types.rs` file to define the top-level configuration structure for `config.toml`, improving modularity and clarity.
- Updated `mod.rs` to re-export all public types and configurations, ensuring a streamlined interface for the configuration schema.
- Enhanced the organization of configuration components, making it easier to manage and extend in the future.

* Update import path for AuthProfile and AuthProfileKind in tests module

- Changed the import statement for `AuthProfile` and `AuthProfileKind` to use the correct path, ensuring proper module resolution and consistency in the codebase.

* Refactor import statements in test files for consistency

- Cleaned up import statements across multiple test files by removing unnecessary components and ensuring uniformity in module imports.
- This change enhances code readability and maintainability by streamlining the import structure.

* Add agent chat and REPL session handling with schemas

- Introduced new schemas for agent chat and REPL session management, enhancing the functionality of the agent module.
- Implemented handlers for chat and REPL session operations, allowing for more interactive and persistent user sessions.
- Updated the memory store to include category handling for memory entries, improving data organization and retrieval.
- Refactored memory query methods to support ranked results and category storage, enhancing the memory management capabilities.
- Improved error handling in memory recall tools to ensure non-empty parameters, increasing robustness and user feedback.

* Refactor JSON-RPC method names for consistency and clarity

- Updated JSON-RPC method names in tests to follow a consistent naming convention, improving readability and maintainability.
- Adjusted parameter names in the JSON payload to align with the updated method names, ensuring proper functionality and clarity in the API interactions.
- Enhanced overall code organization by streamlining method calls in the test suite.
2026-03-29 15:59:34 -07:00
Steven EnamakelandGitHub 244702d349 Feat/refactor UI code (#52)
* Enhance autocomplete functionality and settings panel

- Added a new AutocompletePanel component for managing inline autocomplete settings, including options for enabling/disabling, debounce timing, and style configurations.
- Integrated autocomplete status tracking and logging within the panel to provide real-time feedback on the autocomplete engine's state.
- Updated settings navigation to include the new autocomplete settings route, improving user accessibility to autocomplete features.
- Introduced new Tauri commands for managing autocomplete operations, including start, stop, and current status retrieval, enhancing interaction with the autocomplete engine.
- Refactored existing code to streamline autocomplete-related functionalities and improve overall maintainability.

* Update TypeScript configuration and add new assets

- Modified `tsconfig.json` to adjust path aliases and include directories for improved module resolution.
- Added new SVG and image assets to the public directory, enhancing the application's visual resources.
- Introduced multiple Lottie animation JSON files for dynamic UI elements, expanding the application's animation capabilities.

* Update project structure and paths for Tauri integration

- Adjusted paths in the pull request template and various workflow files to reflect the new project structure, moving Tauri-related files under the `app` directory.
- Updated commands in the build and release workflows to ensure compatibility with the new file locations.
- Enhanced the test workflow to create the necessary `.env` file in the correct directory for end-to-end testing.
- Added new markdown files for agent prompts and configuration, establishing a foundation for OpenHuman's AI capabilities.

* Refactor project paths and update configurations for Tauri integration

- Adjusted script paths in package.json to reflect the new project structure, ensuring compatibility with the updated directory layout.
- Modified tsconfig.json to correct path aliases and include directories for improved module resolution.
- Introduced a new utility for resolving development paths, enhancing the ability to locate the `rust-core/ai` directory across different project structures.
- Updated Cargo.toml and tauri.conf.json to align with the new directory structure, ensuring proper resource and dependency management.
- Added a new dev_paths module to streamline path resolution logic, improving maintainability and clarity in the codebase.

* Refactor project structure and update configurations for Tauri integration

- Adjusted paths in .gitignore, Cargo.toml, and various scripts to reflect the new directory layout, moving Tauri-related files under the `app` directory.
- Introduced a new package.json file to manage workspace scripts and dependencies effectively.
- Updated end-to-end build and run scripts to ensure compatibility with the new project structure.
- Enhanced documentation in CONTRIBUTING.md to guide contributors on the updated project organization and Tauri command usage.

* Refactor Tauri command invocations to use dedicated utility functions

- Replaced direct `invoke` calls with utility functions from `tauriCommands` for improved readability and maintainability across multiple components.
- Updated `SkillsGrid`, `Skills`, `SkillProvider`, and `SkillManager` to utilize the new command structure, enhancing consistency in Tauri command handling.
- Introduced a new `coreRpcClient` for managing core RPC relay requests, streamlining error handling and request processing.
- Added a new `core_rpc_relay` command in the Tauri backend to facilitate communication with the core service, ensuring better service management and error reporting.

* Refactor Tauri command invocations in intelligence stats and memory manager

- Replaced direct `invoke` calls with utility functions from `tauriCommands` in `useIntelligenceStats` and `MemoryManager` for improved readability and maintainability.
- Updated the `aiListMemoryFiles`, `aiReadMemoryFile`, and `aiWriteMemoryFile` functions to utilize the new command structure, enhancing consistency in Tauri command handling.
- Introduced new command handling in the Rust backend for `ai.list_memory_files`, `ai.read_memory_file`, and `ai.write_memory_file`, streamlining communication with the core service.

* Refactor SkillsGrid and remove SelfEvolveModal component

- Removed the SelfEvolveModal component to streamline the SkillsGrid functionality.
- Updated the SkillsGrid to utilize the runtimeDiscoverSkills function for loading skills, replacing the previous invoke method.
- Simplified the skill entry normalization process by integrating it directly into the skills loading logic.
- Enhanced error handling during skill loading to improve robustness and user feedback.

* Refactor Tauri command invocations to use coreRpcClient

- Replaced direct `invoke` calls with `callCoreRpc` in various components, including `useIntelligenceStats`, `MemoryManager`, `SessionManager`, and `transcript` functions, enhancing code readability and maintainability.
- Updated the Rust backend to handle new command structures for memory and session management, streamlining communication with the core service.
- Improved consistency in handling Tauri commands across the application.

* Refactor Tauri command invocations to utilize coreRpcClient

- Replaced direct `invoke` calls with `callCoreRpc` in `tauriCommands.ts` and `tauriSocket.ts`, enhancing code readability and maintainability.
- Updated the Rust backend to support new command structures for authentication and session management, streamlining communication with the core service.
- Removed legacy socket reporting methods in `tauriSocket.ts`, reflecting a shift towards event-driven socket state management.
- Improved consistency in handling Tauri commands across the application, aligning with recent refactoring efforts.

* Remove pre-commit hook and update TODO list with completed tasks and new objectives. This includes separating the binary from the Tauri codebase, integrating accessibility service installation, and removing Android/iOS support from the codebase.

* Add core server functionality with dispatch and RPC handling

- Introduced new modules for core server operations, including dispatching RPC requests and handling various AI and memory-related commands.
- Implemented a robust structure for managing authentication, configuration, and session states through the `openhuman` namespace.
- Added helper functions for loading configurations, managing memory files, and processing authentication profiles.
- Established a new routing system using Axum for handling HTTP requests, including health checks and RPC endpoints.
- Enhanced error handling and logging throughout the new functionalities to improve maintainability and user feedback.

* Implement core server CLI and modular structure

- Introduced a new CLI module for the core server, enabling various commands for server management, health checks, and configuration settings.
- Established a modular structure for core server functionalities, including dispatching RPC requests and managing settings for models, memory, and runtime.
- Added comprehensive tests to validate the functionality of accessibility and autocomplete commands, ensuring robust error handling and schema compliance.
- Enhanced the overall organization of the core server codebase, improving maintainability and readability.

* Implement AI RPC dispatch functionality

- Introduced a new `ai_rpc` module for handling various AI-related commands, including memory file operations and session management.
- Enhanced the `try_dispatch` function to support commands such as listing, reading, writing memory files, and managing session states.
- Updated the core server dispatch module to integrate the new AI RPC functionality, improving modularity and maintainability.
- Refactored existing code to ensure consistent parameter parsing and error handling across AI commands.

* Update TODO list and refactor Rust core server files

- Added new tasks to the TODO list for documentation updates and feature flag cleanup.
- Introduced `Arc` import in `cli.rs` for improved concurrency handling.
- Cleaned up imports in `helpers.rs` and added conditional compilation for `tauri-host`.
- Removed unused `value_only` function in `types.rs` and added `#[allow(dead_code)]` to `SocketConnectParams` and `SocketEmitParams`.
- Enhanced `try_dispatch` function in `dispatch/mod.rs` for non-tauri-host scenarios.
- Updated `try_dispatch` in `openhuman/platform.rs` to correctly handle session parameters.
- Modified `screen_intelligence` configuration in tests to include new properties for better session management.

* Refactor import statements and enhance code readability

- Cleaned up import statements across multiple files for improved organization and consistency.
- Reformatted code in `cli.rs`, `helpers.rs`, and various dispatch modules to enhance readability.
- Ensured consistent parameter handling in `try_dispatch` functions, improving maintainability.
- Removed unnecessary whitespace and adjusted formatting for better code clarity.

* Refactor project structure and enhance AI memory management

- Consolidated the `openhuman-core` package into a single `Cargo.toml` file, removing the previous `rust-core` directory.
- Introduced new modules for AI memory management, including filesystem-based storage and encryption functionalities.
- Added Tauri commands for initializing memory and session management, enhancing user interaction with memory files.
- Implemented JSON-based storage for memory chunks and session transcripts, improving data accessibility and organization.
- Updated dependencies and features in `Cargo.toml` to support new functionalities and ensure compatibility.

* Update build and release workflows to reflect project structure changes

- Adjusted paths in GitHub Actions workflows to accommodate the consolidation of the `openhuman-core` package into a single `Cargo.toml`.
- Updated import statements in various files to point to the new locations of markdown resources.
- Modified the Tauri configuration to reflect the new resource paths, ensuring proper access to AI prompts.
- Enhanced the staging script to build the standalone binary from the updated project structure.

* Refactor AI directory resolution and update documentation

- Updated the logic for resolving AI directory paths to reflect the new project structure, replacing references to `rust-core/ai` with `src/ai/prompts`.
- Enhanced the `find_ai_directory` function across multiple modules to utilize the new path resolution methods.
- Updated documentation comments to clarify the new directory structure and fallback mechanisms for loading AI prompts.

* Rename `openhuman-core` to `openhuman` across the project

- Updated package names in `Cargo.toml` and `Cargo.lock` to reflect the new naming convention.
- Adjusted references in GitHub Actions workflows and scripts to use the new package name.
- Modified CLI command names and error messages to align with the updated naming.
- Ensured consistency in executable file names and paths throughout the codebase.

* Refactor project commands and update package scripts

- Updated package.json to change workspace references from `openhuman` to `app` for build, compile, dev, format, lint, and test scripts.
- Removed outdated memory and chat command files to streamline the codebase and improve maintainability.
- Adjusted the `lib.rs` file to reflect changes in memory command handling, transitioning to use `callCoreRpc` for Neocortex memory operations.
- Cleaned up the commands module by removing unused imports and consolidating functionality.

* Add Tauri host support and new daemon configuration

- Introduced new modules for Tauri host functionality, including `desktop` and `daemon_host`.
- Added static variables and initialization functions for managing the desktop app handle and resource directory.
- Updated import paths for `HeartbeatEngine` to improve clarity and organization.
- Implemented configuration loading and saving for daemon UI preferences, enhancing user experience.

* Update package names in project configuration

- Changed workspace references in package.json from `app` to `openhuman-app` for consistency.
- Updated the name field in the app's package.json to reflect the new naming convention.

* Remove Tauri host feature flags from core server modules

- Eliminated conditional compilation for Tauri host in `lib.rs`, `helpers.rs`, and `dispatch` modules.
- Streamlined socket management functions and dispatch logic by removing unused code related to Tauri host.
- Improved code clarity and maintainability by consolidating socket-related functionality.

* Enhance Tauri host feature integration and update dependencies

- Added `tauri-host` as a default feature in `Cargo.toml` to streamline feature management.
- Removed explicit feature flag from `openhuman` dependency in `app/src-tauri/Cargo.toml` for cleaner configuration.
- Updated Tauri command attributes in various modules to conditionally compile with the `tauri-host` feature, improving modularity.
- Expanded TODO list to include migration support from OpenClaw, indicating future development focus.

* Refactor authentication and credential management in OpenHuman

- Introduced new modules for handling authentication profiles and tokens, including `anthropic_token`, `openai_oauth`, and `profiles`.
- Removed unused Tauri host-related code from core server modules, enhancing clarity and maintainability.
- Updated `Cargo.toml` and `Cargo.lock` to reflect the removal of the `rquickjs` dependency and other package adjustments.
- Streamlined memory client initialization in dispatch logic to utilize the new `local_memory` module.
- Enhanced code organization by consolidating credential management functionalities and improving the overall structure of the OpenHuman module.

* Enhance Rust core RPC structure and streamline helper functions

- Introduced a dedicated `rpc.rs` file for each domain in the Rust core to manage JSON-RPC and CLI behavior, improving code organization and clarity.
- Refactored helper functions to utilize `rpc_invocation_from_outcome` for consistent handling of RPC responses across various modules.
- Removed unused authentication and credential management functions from `helpers.rs`, consolidating relevant logic into the new RPC structure.
- Updated dispatch logic in multiple modules to leverage the new RPC functions, enhancing maintainability and reducing code duplication.

* Enhance Rust core RPC structure and streamline helper functions

- Introduced a dedicated `rpc.rs` file for each domain in the Rust core to manage JSON-RPC and CLI behavior, improving code organization and clarity.
- Refactored helper functions to utilize `rpc_invocation_from_outcome` for consistent handling of RPC responses across various modules.
- Removed unused authentication and credential management functions from `helpers.rs`, consolidating relevant logic into the new RPC structure.
- Updated dispatch logic in multiple modules to leverage the new RPC functions, enhancing maintainability and reducing code duplication.

* Refactor OpenHuman configuration loading and enhance onboarding RPC

- Replaced the `load_openhuman_config` function with a new `load_config_with_timeout` method to improve timeout handling during configuration loading.
- Consolidated configuration loading logic across various modules, reducing redundancy and enhancing maintainability.
- Introduced new RPC functions for applying settings related to models, memory, screen intelligence, gateway, tunnel, runtime, and browser, streamlining the update process.
- Added onboarding helpers in a new `onboard` module, including a JSON-RPC controller for model refresh operations, improving onboarding flow management.

* Refactor CLI and configuration management in OpenHuman

- Consolidated CLI-related functionality by introducing new modules for settings and credentials management, enhancing code organization.
- Removed redundant functions and streamlined the configuration loading process, improving maintainability.
- Added new CLI helpers for screenshot tools and workspace initialization, facilitating better user experience and onboarding.
- Enhanced JSON-RPC responses to be more compatible with CLI requirements, ensuring consistent output across various commands.

* Remove gateway settings and related functionality from OpenHuman

- Eliminated the GatewaySettingsUpdate interface and associated functions from the codebase, streamlining configuration management.
- Removed references to gateway settings in the CLI and configuration modules, enhancing clarity and maintainability.
- Deleted the gateway module and its related components, including rate limiting and client handling, to simplify the architecture.
- Updated Cargo.toml and Cargo.lock to reflect the removal of dependencies related to gateway functionality.

* Update documentation and improve clarity in OpenHuman

- Revised comments in the `mod.rs`, `traits.rs`, and `pairing.rs` files to enhance clarity and accuracy.
- Updated descriptions related to security policy, long-running processes, and pairing functionality for better understanding.

* Refactor loading prop in TauriCommandsPanel for cleaner code

- Simplified the loading prop assignment in the TauriCommandsPanel component by removing unnecessary line breaks, enhancing readability and maintainability.

* Add OpenSSL dependency and implement OAuth authentication features

- Added OpenSSL as a dependency in `Cargo.toml` to support cryptographic operations.
- Introduced new OAuth-related structures and parameters in `types.rs` for handling authentication flows.
- Implemented OAuth connection and integration token fetching in `auth_socket.rs`, enhancing the authentication capabilities of the OpenHuman module.
- Created new modules for managing authentication profiles and responses, improving the organization of authentication-related code.
- Removed deprecated `anthropic_token` and `openai_oauth` modules to streamline credential management.
- Updated `Cargo.lock` to reflect the addition of the OpenSSL dependency.

* Refactor OpenHuman module and update dependencies

- Added OpenHuman integration entry in the registry for improved backend inference handling.
- Updated various files to enhance code clarity and organization, including adjustments to OAuth client methods and integration tests.
- Refactored import statements and removed unnecessary line breaks for better readability.
- Updated `Cargo.lock` to reflect changes in dependencies and ensure consistency across the project.

* Implement desktop host features and refactor runtime handling

- Introduced new modules for memory management, socket handling, and command definitions to support desktop host functionality.
- Refactored QuickJS runtime initialization to log errors when the engine is not linked, improving clarity on runtime status.
- Added placeholder commands for chat and model interactions, indicating unavailability in the desktop build while maintaining structure for future integration.
- Enhanced organization of the codebase by creating dedicated files for runtime and utility functions, streamlining the development process.
- Updated documentation to reflect new modules and their purposes, ensuring better understanding for future contributors.

* Add CLI banner and print function to enhance user experience

- Introduced a new CLI banner with branding and GitHub link for user engagement.
- Implemented a `print_cli_banner` function to display the banner when running the CLI, improving visibility and user interaction.
- Updated the CLI entry point to call the new banner function, ensuring it appears at startup.

* Add API integration and update dependencies

- Introduced new API modules for handling HTTP requests and WebSocket connections to the TinyHumans backend.
- Added `ureq` dependency for simplified HTTP client functionality, updating `Cargo.toml` and `Cargo.lock` accordingly.
- Implemented configuration and JWT handling in the new `api` module, enhancing session management and API interactions.
- Refactored existing code to utilize the new API helpers, improving code organization and maintainability.
- Updated documentation to reflect new API functionalities and usage guidelines.

* Refactor settings fetching and update dependencies

- Removed the `ureq` dependency and associated functions for fetching settings, streamlining the codebase.
- Updated the `fetch_settings` method to utilize `reqwest` for HTTP requests, enhancing consistency and reliability in API interactions.
- Adjusted the `Cargo.toml` to reflect the removal of `ureq`, ensuring dependencies are up to date.

* Update `ureq` dependency to version 3.3.0 in `Cargo.lock`

- Removed the specific version constraint for `ureq`, allowing for more flexibility in dependency resolution.
- Updated the `Cargo.lock` to reflect the new version of `ureq`, ensuring compatibility with recent changes in the codebase.

* Enhance JSON-RPC logging and CLI initialization

- Introduced a new `rpc_log` module for structured logging of JSON-RPC requests and responses, including redaction of sensitive parameters.
- Updated `execute_core_cli` to initialize logging with a default level and timestamp format.
- Enhanced logging in `rpc_handler` and `dispatch` functions to provide detailed insights into method calls and their execution times.
- Improved error handling logging to capture method failures with context, aiding in debugging and monitoring.

* Refactor HTTP server setup and add integration tests

- Introduced a new `build_core_http_router` function to encapsulate the HTTP routing logic, improving code organization and readability.
- Updated the `run_server` function to utilize the new router function, streamlining server initialization.
- Added comprehensive integration tests for the JSON-RPC API, ensuring robust functionality and error handling in real-world scenarios.

* Enhance OpenHuman backend integration and refactor provider handling

- Added support for the OpenHuman backend in the TauriCommandsPanel, including default configurations and validation for API keys.
- Introduced a new REPL command in the CLI for interactive RPC communication, allowing for dynamic mode switching and message handling.
- Refactored provider creation logic to streamline the integration of the OpenHuman backend, removing deprecated provider overrides and ensuring consistent usage across the codebase.
- Updated various components to improve error handling and user feedback related to provider selection and API interactions.

* Refactor provider handling and update default model settings

- Removed provider override states from the AgentChatPanel and TauriCommandsPanel components, simplifying state management.
- Updated local storage handling to exclude provider overrides, ensuring cleaner data storage.
- Changed default model settings across various components and backend configurations to use "neocortex-mk1" as the new default model.
- Enhanced error handling and validation logic in the TauriCommandsPanel, focusing on model and temperature settings.
- Streamlined integration tests and removed deprecated provider validation logic to improve code clarity and maintainability.

* Refactor code for improved readability and consistency

- Adjusted formatting in several files to enhance code clarity, including consistent parameter passing and alignment.
- Simplified match statement syntax in the `run_models` function for better readability.
- Streamlined assertions in tests to maintain consistency in error handling checks.
- Updated default model name handling in the `AgentBuilder` for cleaner initialization.

* Refactor API URL handling and enhance error reporting

- Updated the `effective_api_url` function to improve clarity in resolving the API base URL, incorporating environment variable checks.
- Enhanced diagnostics in the configuration check to provide clearer messages regarding the API URL status.
- Introduced new error formatting functions to improve the clarity of error messages related to API transport issues.
- Refactored error handling in the OpenAiCompatibleProvider to utilize the new error formatting, ensuring consistent and informative error reporting.

* Refactor API client initialization for consistency

- Updated the instantiation of `BackendOAuthClient` to consistently pass the API URL by reference across multiple functions.
- Simplified the match statement in the `run_models_refresh` function for improved readability.

* Enhance REPL command handling and add fallback mechanisms

- Improved error handling in the REPL command processing, providing clearer feedback for command execution failures.
- Introduced a fallback mechanism for the `agent_chat` RPC call, allowing for graceful degradation to a simpler chat method or a direct backend curl transport if the primary call fails.
- Added a new `backend_chat_via_curl` function to handle chat requests using curl as a last resort, ensuring continued functionality in case of RPC issues.
- Updated the `agent_chat_simple` function to support model overrides and temperature settings, enhancing flexibility in chat interactions.

* Update default Ollama model settings for consistency

- Changed the default Ollama model and vision model to "gemma3:4b-it-qat" for improved alignment across configurations.
- Ensured consistent model naming to enhance clarity in model usage within the local AI module.

* Implement login token consumption and enhance error handling

- Added functionality to consume login tokens via a new API endpoint, returning a JWT for authenticated sessions.
- Improved error handling in the Conversations component, introducing a fallback mechanism for chat interactions when the primary method is unavailable.
- Updated UserProvider to restore session tokens automatically, enhancing user experience during authentication.
- Refactored thread API to support the new login token consumption logic, ensuring seamless integration with the backend.

* Update HTTP client configuration to use Rustls TLS

- Replaced the HTTP/1.1 only setting with Rustls TLS in the OpenAiCompatibleProvider's client builder for enhanced security.
- Ensured consistent application of the new TLS setting across multiple client instances.

* Add Local AI command support and enhance error handling

- Introduced a new `LocalAi` command in the CLI for managing local AI runtime operations, including status checks, asset downloads, and prompt handling.
- Added detailed argument structures for various local AI functionalities, improving command usability.
- Enhanced error reporting in the `LocalAiService` by including response details in error messages for better debugging and user feedback.
- Refactored existing error handling to provide clearer context on failures during API interactions.

* Add local AI module with Ollama integration and model management

- Introduced a new local AI module that includes functionality for automatic installation of the Ollama runtime across different operating systems (Windows, macOS, Linux).
- Implemented model ID resolution and management, providing default settings for various AI models and ensuring compatibility with user configurations.
- Added HTTP API structures and request handling for Ollama, enabling interaction with the local AI service for generating responses and managing assets.
- Developed utility functions for parsing model outputs and managing workspace paths, enhancing the overall structure and usability of the local AI service.
- Established a comprehensive service layer for managing local AI operations, including status tracking and error handling for improved user experience.

* Refactor local AI service structure and enhance asset management

- Simplified the local AI module by reorganizing the service structure, introducing new modules for model IDs, paths, and asset management.
- Added comprehensive asset status tracking for various AI models, including chat, vision, embedding, STT, and TTS, with improved error handling.
- Implemented methods for downloading models and assets, ensuring better management of local AI resources.
- Updated visibility of service methods to enhance encapsulation and maintainability within the local AI service.

* Enhance local AI module with new download progress tracking and unit tests

- Added new structures for tracking download progress of various AI models, including detailed status and metrics.
- Implemented unit tests for model ID resolution, parsing suggestions, and asset path resolution to ensure robust functionality.
- Refactored service methods to improve encapsulation and maintainability, enhancing the overall structure of the local AI service.
- Updated existing tests to cover new functionalities and ensure consistent behavior across the module.

* Implement new local AI download functionalities and refactor model management

- Added support for downloading all local AI assets and tracking download progress, enhancing user experience and resource management.
- Introduced new RPC methods for fetching download progress and managing asset states, improving the overall functionality of the local AI module.
- Refactored existing model management code to utilize the new model catalog, ensuring better organization and maintainability.
- Updated relevant tests to cover new functionalities and ensure consistent behavior across the local AI service.

* Add new interfaces and functions for local AI download progress tracking

- Introduced `LocalAiDownloadProgressItem` and `LocalAiDownloadsProgress` interfaces to structure download progress data for various AI models.
- Implemented `openhumanLocalAiDownloadAllAssets` and `openhumanLocalAiDownloadsProgress` functions to facilitate downloading all assets and tracking their progress.
- Enhanced error handling for Tauri environment checks in new functions, ensuring robust operation within the local AI module.

* Refactor agent loop structure and introduce modular components

- Deleted the `loop_.rs` file and reorganized the agent loop into multiple modules for better maintainability and clarity.
- Introduced new files for handling credentials, history management, tool instructions, memory context, and parsing logic.
- Implemented functions for scrubbing sensitive credentials, managing conversation history, and building tool instructions.
- Enhanced the overall structure of the agent loop to facilitate easier testing and future development.

* Refactor authentication structure and migrate to credentials module

- Moved authentication-related functionality from `auth_profiles` to a new `credentials` module for better organization and clarity.
- Updated references in the API and core server to reflect the new module structure.
- Introduced new data structures and methods for managing authentication profiles, including session support and response handling.
- Removed the obsolete `auth_profiles` module to streamline the codebase and enhance maintainability.

* Add screen intelligence module with capture and context management

- Introduced new modules for screen capture and context management, specifically targeting macOS.
- Implemented functionality to capture screen images and retrieve foreground application context.
- Added data structures for managing application context and window bounds.
- Established limits for screenshot sizes and context character counts to ensure efficient resource management.
- Enhanced helper functions for input action validation and vision summary processing.
- Set up a modular structure for better maintainability and future enhancements.

* Refactor screen intelligence module and remove obsolete components

- Deleted unused files related to screen intelligence, including context and permissions management, to streamline the codebase.
- Refactored the capture functionality to improve organization and maintainability.
- Updated function signatures for better clarity and consistency.
- Enhanced the overall structure of the screen intelligence module for future development and testing.

* Enhance autocomplete CLI functionality and refactor related code

- Added new options for the autocomplete command in the CLI, allowing users to run the autocomplete loop in the current process or spawn a detached process.
- Introduced `AutocompleteStartCliOptions` struct to encapsulate the new command-line arguments.
- Refactored the `autocomplete_start_cli` function to handle the new options and improve process management for the autocomplete service.
- Updated documentation in `CLAUDE.md` to clarify the separation of concerns between routing and controller logic in the codebase.

* Enhance autocomplete error handling and improve focused text context retrieval

- Added a new function to identify "no text candidate" errors, improving error management in the autocomplete engine.
- Refactored the `focused_text_context` and `focused_text_context_verbose` functions to enhance clarity and reliability in retrieving application context.
- Updated the return format of the `focused_text_context_verbose` function to use a separator for better data parsing.
- Added a new TODO item for allowing users to select LLM model versions based on their CPU capabilities.

* Remove Docker, Native, and WASM runtime implementations along with related traits and tests

- Deleted the DockerRuntime, NativeRuntime, and WasmRuntime implementations to streamline the codebase.
- Removed associated traits and factory functions for runtime creation.
- Eliminated all related tests to ensure a clean removal of unused components.
- This refactor aims to simplify the runtime management and prepare for future enhancements.

* Add quickjs-runtime feature and introduce runtime module

- Added a new feature flag for `quickjs-runtime` in `Cargo.toml` to enable its usage.
- Created a new `runtime.rs` module to implement `NativeRuntime` and `DockerRuntime` with associated traits for runtime management.
- Updated the `skills` module to reference the correct path for `SkillConfig`.
- Removed the obsolete `skillforge` module from the `openhuman` namespace to streamline the codebase.
- Enhanced the `skills` module with new structures and functions for managing skills, including initialization and loading logic.

* Refactor autocomplete configuration to remove legacy disabled apps

- Updated the default configuration for `AutocompleteConfig` to remove the legacy disabled apps ('terminal' and 'code'), allowing for broader usage of Codex/CLI.
- Introduced a migration function to handle legacy disabled apps during configuration loading, ensuring custom user preferences remain intact.
- This change enhances the flexibility of the autocomplete feature by preventing unnecessary restrictions on application usage.

* Update rquickjs dependencies in Cargo.lock

- Updated the rquickjs and rquickjs-core dependencies to versions 0.11.0 and 0.9.0 respectively, ensuring compatibility with the latest features and fixes.
- Added new entries for rquickjs-sys and its corresponding version 0.9.0 to the dependency list, enhancing the project's runtime capabilities.
- This update improves the overall stability and performance of the application by leveraging the latest improvements in the rquickjs ecosystem.

* Add terminal application detection to autocomplete logic

- Introduced a new function `is_terminal_app` to identify terminal applications based on their names, enhancing the autocomplete feature's context awareness.
- Updated the `focused_text_context_verbose` function to allow terminal applications to bypass text role checks when the input value is not empty, improving user experience in terminal environments.
- This change aims to provide better support for terminal-based applications in the autocomplete system.

* Add terminal input context extraction and noise line detection

- Introduced functions to identify terminal-like buffers and filter out noise lines in terminal input, enhancing the autocomplete engine's context awareness.
- Updated the `focused_text_context` logic to utilize the new terminal context extraction, improving the handling of text in terminal applications.
- Enhanced the `focused_text_context_verbose` function to better retrieve static text values from UI elements, ensuring accurate context representation in terminal environments.
- These changes aim to improve user experience and functionality for terminal-based applications in the autocomplete system.

* Enhance autocomplete engine state management and error handling

- Added new fields `last_escape_down` and `last_overlay_signature` to `EngineState` for improved state tracking.
- Implemented `try_reject_via_escape` method to handle escape key interactions, allowing users to reject suggestions more intuitively.
- Updated error handling to display notifications for different states (ready, accepted, rejected, error) using `show_overflow_badge`.
- Refactored state updates to ensure consistent management of suggestion and phase transitions, enhancing overall user experience in the autocomplete system.

* Implement periodic status logging in autocomplete service

- Added a polling mechanism to log the status of the autocomplete engine at regular intervals.
- Enhanced logging to capture changes in phase, application name, suggestions, and errors, improving visibility during service execution.
- Refactored the `autocomplete_start_cli` function to integrate the new logging functionality, ensuring a more informative user experience while the service is running.

* Refactor memory dispatch logic and remove local memory implementation

- Updated the memory dispatch functions to utilize the new `memory_rpc` module, enhancing the handling of memory operations such as document management and namespace queries.
- Removed the local memory implementation, including database interactions and related functions, to streamline the codebase and improve maintainability.
- Introduced new RPC calls for document operations (put, list, delete) and context queries, ensuring a more efficient and consistent approach to memory management.
- This refactor aims to enhance the overall architecture and performance of the memory handling system.

* Remove macOS-specific overflow badge functionality and related helper functions

- Deleted the `show_overflow_badge` and `escape_applescript_string` functions, which were specific to macOS, to streamline the codebase.
- Refactored the `show_overflow_badge` function to provide a no-op implementation for non-macOS platforms, enhancing cross-platform compatibility.
- This change simplifies the autocomplete module by removing platform-dependent code, improving maintainability and clarity.

* Enhance text application logic in autocomplete module

- Updated the `apply_text_to_focused_field` function to improve interaction with focused UI elements on macOS.
- The new implementation retrieves the current value of the focused element and appends the provided text, ensuring better handling of text input.
- Enhanced error reporting to include stderr output when applying suggestions fails, improving debugging capabilities.
- These changes aim to provide a more robust and user-friendly experience in the autocomplete functionality.

* Refactor Landlock feature configuration for Linux support

- Moved the `landlock` and `rppal` dependencies under a conditional target configuration for Linux in both `Cargo.toml` files, ensuring they are only included when building for Linux.
- Updated the `landlock.rs` module to check for both the `sandbox-landlock` feature and the Linux target OS, improving the conditional compilation logic.
- This change enhances cross-platform compatibility and ensures that Landlock functionality is only available on supported systems.

* Update dependencies and enhance Tauri integration

- Updated the Tauri dependency in `Cargo.toml` to include the `tray-icon` feature, enabling system tray support.
- Introduced a new `rust-toolchain.toml` file to pin the Rust version to 1.93.0, ensuring compatibility with the matrix-sdk.
- Modified GitHub workflows to use the specified Rust version from `rust-toolchain.toml` instead of the stable version, improving build consistency.
- Refactored Tauri commands to utilize a new `wrapCommandResult` function for better response handling.
- Added a new `tray` module in `openhuman` for managing system tray functionality, enhancing the desktop experience.
- Updated various command implementations to streamline service management and improve error handling.

* Refactor core process handling and enhance encryption features

- Removed the `openhuman` dependency from `Cargo.lock` and `Cargo.toml`, streamlining the project structure.
- Updated the core process handling to fall back to a child process when in-process execution is unavailable, improving error handling and logging.
- Introduced new encryption commands (`ai_init_encryption`, `ai_encrypt`, `ai_decrypt`) to enhance security features, utilizing AES-GCM for data protection.
- Added a new `tray` module for managing system tray functionality, improving user experience on desktop platforms.
- Refactored various command implementations to improve service management and error handling, ensuring a more robust application architecture.

* Remove unused modules and refactor daemon host configuration

- Deleted the `daemon_host_config`, `memory`, `models`, `openhuman_daemon`, `tray`, `chat`, `conscious_loop`, and `runtime` modules to streamline the codebase.
- Refactored the daemon host configuration logic into the `openhuman` module, consolidating related functionality.
- Updated command implementations to utilize the new configuration methods, ensuring consistent handling of daemon host settings.
- This cleanup enhances maintainability and reduces complexity in the project structure.

* Refactor memory management and update Tauri dependencies

- Removed the `tray-icon` feature from the Tauri dependency in `Cargo.toml` to streamline the configuration.
- Deleted the `core:tray:default` capability from the default capabilities JSON, simplifying the capabilities structure.
- Refactored memory handling in tests to utilize `UnifiedMemory` instead of `SqliteMemory`, enhancing consistency across memory operations.
- Updated memory store, recall, and forget functionalities to support a global namespace, improving memory management and retrieval processes.
- Enhanced error handling and logging in memory operations to provide clearer feedback during execution.

* Remove AI encryption commands and related functionality

- Deleted the `ai_init_encryption`, `ai_encrypt`, and `ai_decrypt` functions to streamline the codebase and remove unused features.
- Updated the command registration in the `run` function to reflect the removal of these encryption commands, enhancing maintainability and reducing complexity.

* Add OAuth integration token handling and channel connection management

- Introduced functions to fetch and encrypt integration tokens using OAuth, enhancing security for token management.
- Updated the channel connections API to support OAuth integration, including listing, connecting, and disconnecting channels.
- Implemented checks for supported channels and authentication modes, improving the robustness of channel connection handling.
- Enhanced error handling for integration token retrieval to ensure required fields are present before proceeding.

* Refactor project structure and update documentation

- Renamed the project from "Outsourced" to "OpenHuman" and revised the project summary to reflect its focus on AI-powered assistance for crypto communities.
- Restructured the repository layout, detailing the purpose of each directory and its contents.
- Updated runtime scope to clarify platform support and Tauri's desktop-only focus.
- Enhanced documentation across various files, including architecture, services, and routing, to improve clarity and usability for contributors.
- Removed outdated sections and streamlined commands for development and production builds, ensuring consistency in the documentation.

* Implement REPL session management and multimodal support

- Introduced a new REPL session management system, allowing for session-specific interactions with agents.
- Added functions for starting, chatting, resetting, and ending REPL sessions, enhancing user experience and control.
- Implemented multimodal message handling, enabling the processing of images alongside text in user messages.
- Updated the project structure to include new modules for identity and multimodal functionalities, improving organization and maintainability.
- Enhanced error handling and logging for session operations, providing clearer feedback during execution.

* Refactor memory store implementation and introduce unified memory management

- Removed the legacy memory store implementation and replaced it with a new unified memory management system.
- Introduced a `MemoryClient` for handling document storage, retrieval, and namespace management.
- Added support for key-value storage and graph data structures within the unified memory framework.
- Enhanced the `UnifiedMemory` struct with methods for document upsertion, querying, and namespace operations.
- Updated the project structure to include new modules for memory types, factories, and traits, improving organization and maintainability.
- Improved error handling and logging across memory operations for clearer feedback during execution.

* Implement QuickJS skill instance management

- Removed the previous QjsSkillInstance implementation and replaced it with a new modular structure.
- Introduced separate modules for event loop management, instance handling, JavaScript handlers, and utility functions.
- Enhanced the event loop to efficiently manage QuickJS runtime tasks, including timer callbacks and message processing.
- Added support for asynchronous tool calls and lifecycle management within the QuickJS context.
- Improved error handling and logging throughout the new implementation for better debugging and user feedback.
- Updated documentation to reflect the new structure and functionality of the QuickJS skill instance.
2026-03-29 10:30:18 -07:00