From b6ec716b7c8d399fd06dcca518a7a0cffdd6196b Mon Sep 17 00:00:00 2001 From: Steven Enamakel <31011319+senamakel@users.noreply.github.com> Date: Sat, 28 Mar 2026 11:52:50 -0700 Subject: [PATCH] feat(cli): integrate clap_complete for shell command completions (#49) * feat(daemon): introduce daemon host configuration management - Updated the daemon service to support a new configuration structure for managing tray visibility. - Added functions to load and save daemon host configuration from a JSON file. - Implemented Tauri commands to retrieve and update the daemon host configuration. - Enhanced the service management logic to account for legacy application labels and improve compatibility on macOS. - Refactored executable resolution logic to streamline the process of locating the daemon executable across platforms. * feat(daemon): enhance daemon host configuration with tray visibility settings - Added functionality to load and save daemon host configuration, specifically for managing the visibility of the daemon tray icon. - Implemented UI components in both DaemonHealthPanel and TauriCommandsPanel to toggle the tray visibility setting. - Integrated Tauri commands to retrieve and update the daemon host configuration, improving user control over the daemon's display options. - Enhanced loading states and error handling for better user feedback during configuration updates. * fix(local-ai): update default model IDs for local AI configuration - Changed default model IDs from `qwen2.5:1.5b` and `qwen3-vl:2b` to `gemma3:4b-it-qat` for chat and vision models, ensuring consistency in local AI settings. * feat(core): enhance macOS service management and CLI thread stack size - Added dynamic configuration for thread stack size in the CLI, allowing customization via the `OPENHUMAN_CORE_THREAD_STACK_SIZE` environment variable. - Improved macOS service management by validating the LaunchAgent plist and ensuring it is installed before starting the service. - Enhanced error handling and logging for service loading and plist validation, improving user feedback and reliability. * feat(app): initialize Tauri + React + TypeScript project structure - Added essential project files including package.json, tsconfig.json, and Vite configuration for a Tauri application using React and TypeScript. - Created initial HTML template and CSS styles for the application interface. - Included .gitignore to exclude build artifacts and environment-specific files. - Established basic README documentation to guide setup and development. * feat(cli): refactor command structure for core CLI - Replaced the existing CLI command structure with a new design using `clap` for better organization and extensibility. - Introduced a `CoreCli` struct with subcommands for various operations including server management, health checks, and configuration settings. - Updated command handling to support new subcommands for settings and accessibility operations, enhancing the CLI's functionality. - Modified the core process handling to reflect the new command structure, ensuring compatibility with the updated CLI design. * chore(eslint): add 'app/**' to ignored paths in ESLint configuration - Updated the ESLint configuration to include the 'app/**' directory in the list of ignored paths, ensuring that files in this directory are not linted during the development process. * chore(prettier): add 'app' directory to .prettierignore - Updated the .prettierignore file to include the 'app' directory, preventing formatting checks on files within this path during development. * feat(cli): integrate clap_complete for shell command completions - Added support for generating shell completion scripts using `clap_complete`, enhancing the CLI's usability. - Introduced new subcommands for generating completions and updated command structures to accommodate this feature. - Implemented a new `capture_image_ref` command in the accessibility module for direct image reference capture. - Enhanced the `Tools` command structure to include screenshot functionalities, improving CLI tool management. --- .prettierignore | 1 + Cargo.lock | 10 + app/.gitignore | 24 + app/README.md | 7 + app/index.html | 14 + app/package.json | 26 + app/public/tauri.svg | 6 + app/public/vite.svg | 1 + app/src-tauri/.gitignore | 7 + app/src-tauri/Cargo.toml | 25 + app/src-tauri/build.rs | 3 + app/src-tauri/capabilities/default.json | 10 + app/src-tauri/icons/128x128.png | Bin 0 -> 3512 bytes app/src-tauri/icons/128x128@2x.png | Bin 0 -> 7012 bytes app/src-tauri/icons/32x32.png | Bin 0 -> 974 bytes app/src-tauri/icons/Square107x107Logo.png | Bin 0 -> 2863 bytes app/src-tauri/icons/Square142x142Logo.png | Bin 0 -> 3858 bytes app/src-tauri/icons/Square150x150Logo.png | Bin 0 -> 3966 bytes app/src-tauri/icons/Square284x284Logo.png | Bin 0 -> 7737 bytes app/src-tauri/icons/Square30x30Logo.png | Bin 0 -> 903 bytes app/src-tauri/icons/Square310x310Logo.png | Bin 0 -> 8591 bytes app/src-tauri/icons/Square44x44Logo.png | Bin 0 -> 1299 bytes app/src-tauri/icons/Square71x71Logo.png | Bin 0 -> 2011 bytes app/src-tauri/icons/Square89x89Logo.png | Bin 0 -> 2468 bytes app/src-tauri/icons/StoreLogo.png | Bin 0 -> 1523 bytes app/src-tauri/icons/icon.icns | Bin 0 -> 98451 bytes app/src-tauri/icons/icon.ico | Bin 0 -> 86642 bytes app/src-tauri/icons/icon.png | Bin 0 -> 14183 bytes app/src-tauri/src/lib.rs | 14 + app/src-tauri/src/main.rs | 6 + app/src-tauri/tauri.conf.json | 35 + app/src/App.css | 116 +++ app/src/App.tsx | 51 + app/src/assets/react.svg | 1 + app/src/main.tsx | 9 + app/src/vite-env.d.ts | 1 + app/tsconfig.json | 25 + app/tsconfig.node.json | 10 + app/vite.config.ts | 32 + eslint.config.js | 1 + rust-core/Cargo.toml | 1 + rust-core/src/bin/openhuman.rs | 337 +------ rust-core/src/core_server.rs | 931 +++++++++++++++++- rust-core/src/openhuman/accessibility/mod.rs | 33 + .../src/openhuman/config/schema/local_ai.rs | 6 +- rust-core/src/openhuman/service/mod.rs | 153 ++- src-tauri/src/commands/openhuman.rs | 110 ++- src-tauri/src/core_process.rs | 8 +- src-tauri/src/daemon_host_config.rs | 50 + src-tauri/src/lib.rs | 20 +- src/components/daemon/DaemonHealthPanel.tsx | 62 +- .../settings/panels/TauriCommandsPanel.tsx | 74 ++ src/pages/Home.tsx | 4 +- src/utils/tauriCommands.ts | 20 + 54 files changed, 1833 insertions(+), 411 deletions(-) create mode 100644 app/.gitignore create mode 100644 app/README.md create mode 100644 app/index.html create mode 100644 app/package.json create mode 100644 app/public/tauri.svg create mode 100644 app/public/vite.svg create mode 100644 app/src-tauri/.gitignore create mode 100644 app/src-tauri/Cargo.toml create mode 100644 app/src-tauri/build.rs create mode 100644 app/src-tauri/capabilities/default.json create mode 100644 app/src-tauri/icons/128x128.png create mode 100644 app/src-tauri/icons/128x128@2x.png create mode 100644 app/src-tauri/icons/32x32.png create mode 100644 app/src-tauri/icons/Square107x107Logo.png create mode 100644 app/src-tauri/icons/Square142x142Logo.png create mode 100644 app/src-tauri/icons/Square150x150Logo.png create mode 100644 app/src-tauri/icons/Square284x284Logo.png create mode 100644 app/src-tauri/icons/Square30x30Logo.png create mode 100644 app/src-tauri/icons/Square310x310Logo.png create mode 100644 app/src-tauri/icons/Square44x44Logo.png create mode 100644 app/src-tauri/icons/Square71x71Logo.png create mode 100644 app/src-tauri/icons/Square89x89Logo.png create mode 100644 app/src-tauri/icons/StoreLogo.png create mode 100644 app/src-tauri/icons/icon.icns create mode 100644 app/src-tauri/icons/icon.ico create mode 100644 app/src-tauri/icons/icon.png create mode 100644 app/src-tauri/src/lib.rs create mode 100644 app/src-tauri/src/main.rs create mode 100644 app/src-tauri/tauri.conf.json create mode 100644 app/src/App.css create mode 100644 app/src/App.tsx create mode 100644 app/src/assets/react.svg create mode 100644 app/src/main.tsx create mode 100644 app/src/vite-env.d.ts create mode 100644 app/tsconfig.json create mode 100644 app/tsconfig.node.json create mode 100644 app/vite.config.ts create mode 100644 src-tauri/src/daemon_host_config.rs diff --git a/.prettierignore b/.prettierignore index 13cc3e2a9..a4d17617d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,7 @@ node_modules dist coverage +app src-tauri rust-core skills diff --git a/Cargo.lock b/Cargo.lock index b487bf3da..abc1d3409 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1169,6 +1169,15 @@ dependencies = [ "strsim", ] +[[package]] +name = "clap_complete" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c9f1dde76b736e3681f28cec9d5a61299cbaae0fce80a68e43724ad56031eb" +dependencies = [ + "clap", +] + [[package]] name = "clap_derive" version = "4.6.0" @@ -5441,6 +5450,7 @@ dependencies = [ "chrono", "chrono-tz", "clap", + "clap_complete", "console", "cron", "dialoguer", diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 000000000..a547bf36d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/app/README.md b/app/README.md new file mode 100644 index 000000000..102e36689 --- /dev/null +++ b/app/README.md @@ -0,0 +1,7 @@ +# Tauri + React + Typescript + +This template should help get you started developing with Tauri, React and Typescript in Vite. + +## Recommended IDE Setup + +- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) diff --git a/app/index.html b/app/index.html new file mode 100644 index 000000000..ff93803bb --- /dev/null +++ b/app/index.html @@ -0,0 +1,14 @@ + + +
+ + + +7!d%Q?D!monnG
zpGGcD6A8>TFlCIFBLr gwQm1=f`O8uWV(6K6+6<(aGJh)K>m;@ jU?lMi@tgxr7CqX_r3uw^y4tVU3Pm0s