mirror of
https://github.com/hanzoai/extension.git
synced 2026-10-31 21:57:06 +00:00
A cross-platform (macOS/Windows/Linux) menubar/tray app with a global hotkey (Cmd/Ctrl+Shift+Space) that pops a Hanzo assistant over any app. Ask, summarize the clipboard, rewrite, explain, translate, fix grammar — streamed over api.hanzo.ai via the published @hanzo/ai. Built on Tauri v2 (Rust shell + web frontend), not Electron. Reuses the raycast/office design one-to-one: pure host-agnostic action catalog (actions.ts — prompts, clipboard-context assembly/truncation, message shaping, reply parsing), a thin @hanzo/ai wrapper (hanzo.ts — run/stream/list), a local settings store (store.ts — hk- key + model, parse/merge/serialize), and the only Tauri-touching module (clipboard.ts). app.ts is glue with one run path serving the panel, the tray quick actions, and the hotkey. Rust shell (src-tauri): tray + menu, global-shortcut toggle, spotlight window (small, always-on-top, hidden-on-blur), and hide_window/paste commands (enigo synthesizes Cmd/Ctrl+V so rewrite/translate/fix land over the frontmost app). The hk- key lives only in the webview's local store and is validated before use; CSP allows connecting only to api.hanzo.ai. Frontend builds with esbuild + tsc clean; 66 vitest tests green. Native installers (.dmg/.msi/.AppImage) are a per-OS CI job (tauri build) — never built locally. Registers packages/desktop in pnpm-workspace.yaml.
42 lines
1.3 KiB
TOML
42 lines
1.3 KiB
TOML
[package]
|
|
name = "hanzo-desktop"
|
|
version = "0.1.0"
|
|
description = "Hanzo AI desktop assistant — the ambient omnipresence layer (tray + global hotkey)"
|
|
authors = ["Hanzo AI"]
|
|
license = "MIT"
|
|
repository = "https://github.com/hanzoai/extension"
|
|
edition = "2021"
|
|
rust-version = "1.77.2"
|
|
|
|
# The binary is a one-liner (main.rs); all shell logic lives in the library
|
|
# (lib.rs) per the Tauri v2 convention, so the crate is reusable and the mobile
|
|
# entrypoint (if ever added) shares one run().
|
|
[lib]
|
|
name = "hanzo_desktop_lib"
|
|
crate-type = ["lib", "cdylib", "staticlib"]
|
|
|
|
[[bin]]
|
|
name = "hanzo-desktop"
|
|
path = "src/main.rs"
|
|
|
|
[build-dependencies]
|
|
tauri-build = { version = "2.6.3", features = [] }
|
|
|
|
[dependencies]
|
|
tauri = { version = "2.11.5", features = ["tray-icon"] }
|
|
tauri-plugin-clipboard-manager = "2.3.2"
|
|
# Synthetic paste keystroke into the frontmost app (rewrite/fix/translate outcome).
|
|
enigo = "0.6.1"
|
|
|
|
# The global-shortcut plugin is desktop-only (no mobile target for this app).
|
|
[target.'cfg(any(target_os = "macos", windows, target_os = "linux"))'.dependencies]
|
|
tauri-plugin-global-shortcut = "2.3.2"
|
|
|
|
# Release profile tuned for a small, fast native shell — the installers CI ships.
|
|
[profile.release]
|
|
codegen-units = 1
|
|
lto = true
|
|
opt-level = "s"
|
|
panic = "abort"
|
|
strip = true
|