Files
Lumotia/src-tauri/Cargo.toml
Jake eebea8cb9a
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled
feat(nudges): Phase 6 — Margot soft-touch nudges via frontend nudge bus
Frontend-owned nudge bus that consumes in-app signals Corbie already
produces, applies suppression, and fans out to OS notification + an
optional TTS read-aloud. OS-wide keyboard/window activity detection
stays deferred per the revised roadmap — the plan before rewrite
would have been brittle on Wayland, permission-heavy on macOS, and
low-quality everywhere.

Triggers (v1, all in-app signals):
- inactivity_with_active_timer — timer running, window blurred ≥ 90 s,
  at least 60 s into the timer.
- pending_morning_triage — ritual enabled, past 10:00 local, last
  shown ≠ today. Polls every 5 min while focused.
- micro_step_idle — micro-step decomposition created, no child step
  or parent task completed within 15 min.

Suppression:
- Respects nudgesEnabled + nudgesMuted.
- No nudge while the app has focus (document.hasFocus).
- Hard cap 3 per rolling hour.
- Permission requested via @tauri-apps/plugin-notification on first
  delivery; denial is silently respected.

Rust side:
- tauri-plugin-notification registered + ACL entries on the main-
  window capability only (secondary windows can't fire nudges).
- commands::nudges::deliver_nudge — thin wrapper, security-guarded
  via ensure_main_window, delegates to the plugin. No DB writes —
  the roadmap's nudges-audit table is deferred until a concrete need
  emerges.

Frontend glue:
- nudgeBus.svelte.ts — subscribes to window events, applies
  suppression, calls deliver_nudge (+ tts_speak when speakAloud is
  on).
- kon:task-completed now dispatched on complete_task_cmd success.
- kon:microstep-generated + kon:step-completed dispatched from
  MicroSteps so the idle trigger can clear itself on any engagement.
- kon:focus-timer-cancelled added to focusTimer so the bus can reset
  its inactivity state on cancel, not only on natural completion.
- nudgeBus started from +layout.svelte onMount, stopped on destroy.

Settings:
- New "Nudges" section with three toggles: Enable nudges, Mute for
  now (separate so a hard mute doesn't lose preferences),
  Speak nudges aloud (reuses Phase 4 TTS).
- All default OFF. No first-run prompt — nudges are a Settings-found
  feature rather than a walkthrough step.

Out of scope per the revised Phase 6 spec: OS-wide keyboard/window
hooks, biometric signals, custom trigger editor (Phase 7), notification
sound (platform variance too high for Layer-1 — revisit in Phase 9
polish with a bundled .wav).

Gates: fmt clean, clippy -D warnings clean, cargo test 262/0 (4
existing + 262 current), npm run check 0/0, npm run build green.
2026-04-24 19:05:21 +01:00

93 lines
3.6 KiB
TOML

[package]
name = "kon"
version = "0.1.0"
description = "Kon — Think out loud"
authors = ["CORBEL Ltd"]
edition = "2021"
[lib]
name = "kon_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[features]
# Default build includes the Whisper backend. Disabling this feature
# also drops it from kon-transcription (see Cargo.toml in that crate)
# so a --no-default-features workspace build does not pull whisper-rs-sys.
# load_model_from_disk returns a runtime error for Engine::Whisper when
# this feature is off; Parakeet continues to work.
default = ["whisper"]
whisper = ["kon-transcription/whisper"]
[build-dependencies]
tauri-build = { version = "2", features = [] }
# Used by the CSP regression guard in build.rs to parse tauri.conf.json
# and pull out app.security.csp rather than substring-matching the raw
# file. Keeps the guard robust against unrelated JSON values that
# happen to mention a localhost URL.
serde_json = "1"
[dependencies]
# Workspace crates
kon-core = { path = "../crates/core" }
kon-audio = { path = "../crates/audio" }
kon-transcription = { path = "../crates/transcription", default-features = false }
kon-ai-formatting = { path = "../crates/ai-formatting" }
kon-storage = { path = "../crates/storage" }
kon-cloud-providers = { path = "../crates/cloud-providers" }
kon-hotkey = { path = "../crates/hotkey" }
kon-llm = { path = "../crates/llm" }
# Tauri
tauri = { version = "2", features = ["tray-icon"] }
tauri-plugin-opener = "2"
tauri-plugin-dialog = "2"
tauri-plugin-global-shortcut = "2"
tauri-plugin-window-state = "2"
# Phase 5 rituals: register Corbie as a login-time autostart entry.
# Handles platform differences (.desktop file on Linux, LaunchAgents plist
# on macOS, registry Run key on Windows) behind a single API.
tauri-plugin-autostart = "2"
# Phase 6 nudges: OS-native notifications via the frontend-owned nudge
# bus. Permission-request flow happens on the JS side before the first
# deliver_nudge call; Windows only delivers for installed apps.
tauri-plugin-notification = "2"
# Serialisation
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Async runtime (spawn_blocking for inference)
tokio = { version = "1", features = ["rt", "sync"] }
arboard = "3.6.1"
# Runtime shared-library probe for the Vulkan loader (active compute
# device detection, brief item #1). We do not call any vulkan symbols
# — we only need to answer "is libvulkan resolvable from the loader's
# default search path right now?".
libloading = "0.8"
# SqlitePool is named directly from src-tauri/src/lib.rs (the AppState
# stores it). Must be unconditional, not Linux-only — naming a type from
# a transitive dep requires the dep be listed here too.
# See crates/storage/Cargo.toml — default-features = false drops macros /
# migrate / any / json which this crate doesn't use. Only names SqlitePool.
sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio", "sqlite"] }
uuid = { version = "1", features = ["v4"] }
[target.'cfg(target_os = "linux")'.dependencies]
webkit2gtk = "2.0"
# Needed for setting the preview overlay's WindowTypeHint to Utility via
# the Tauri gtk_window() escape hatch. Versions track what webkit2gtk 2.0
# transitively depends on (GTK 3).
gtk = "0.18"
gdk = "0.18"
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6.4"
objc2-foundation = { version = "0.3.2", default-features = false, features = ["std", "NSString", "NSProcessInfo"] }
[target.'cfg(target_os = "windows")'.dependencies]
# Phase 4 TTS: PowerShell -EncodedCommand expects UTF-16-LE base64.
# Windows-only because the other platforms' TTS paths pass text via argv.
base64 = "0.22"