mirror of
https://github.com/Kynde/dais.git
synced 2026-10-20 08:32:28 +02:00
Durable persistence means a picked target stays picked even after its pane dies — which is right, since dais-driven panes come and go. Release is the missing complement: how you say you are done with one and hand the digit back to the picker. state/daemon: - state/release-slot: refuses an unknown slot and the LAST remaining slot, and moves :active-slot to the next survivor when the active one goes. load-targets only honors the durable overlay while (get targets active-slot) resolves, so a dangling active slot would silently discard every persisted target on the next daemon start. - target action "release"; persists through transition!'s existing :targets watch, so a release sticks across restarts exactly like a pick does. dais-ctl: target release <slot>, plus slot completion in _dais-ctl. dais-top: x then 1-5, sticky footer prompt, ? entry. It takes a digit rather than acting on the picker's highlighted row because the usual reason to release a slot is that its pane is GONE — and a gone pane has no row in the picker, which only lists live tmux panes. Also fixes the startup banner: it printed (:targets cfg) — config, not the durable overlay the daemon actually runs with — so it misreported every picked or released slot on every restart. Now reads the state atom, sorted, with * marking the active slot. config: drop the retired system:claude.0 slot. ai/gotchas.md records two things this turned up: the :active-slot-must-resolve invariant, and tmux pane_index being positional — closing a pane renumbers those after it, so a stored "s:w.2" silently retargets while still reading alive and green.
78 lines
3.8 KiB
Clojure
78 lines
3.8 KiB
Clojure
{;; Router: how an utterance is classified.
|
|
;; :whole-match command iff the WHOLE utterance matches (default)
|
|
;; :prefix commands must start with :prefix word; rest is dictation
|
|
;; :key-armed everything is dictation unless armed via `dais-ctl arm`
|
|
:router {:strategy :whole-match
|
|
:prefix "do"
|
|
;; Extra whole-utterance commands (merged over built-in defaults).
|
|
;; Entries map a phrase to either {:keys [...]} (key sequence) or
|
|
;; {:text "..." :submit true/false} (typed reply).
|
|
;; A command may carry :lang to bind it to a transcription language;
|
|
;; untagged commands belong to :asr :language (the base, "en" here) and
|
|
;; only match while that language is active. A phrase is only matchable
|
|
;; when the model is transcribing in its language, so e.g. "ääni pois"
|
|
;; below is reachable only under :language "fi".
|
|
:commands
|
|
{"send the brief"
|
|
{:text "Voice input notice: parts of my input arrive via speech-to-text and may contain recognition errors or noise. Read /home/k/dais/BRIEF.md for how to cope (verify unclear intent, match dictated identifiers against the repo, ignore noise fragments, prefer numbered options)."
|
|
:submit false}
|
|
"ääni pois" {:control :voice-off :lang "fi"}}}
|
|
|
|
;; Dictation submit behavior: :no-enter | :enter-auto | :enter-always
|
|
:enter-mode :no-enter
|
|
|
|
;; Target slots. :type :tmux needs :pane "session:window.pane";
|
|
;; :type :focus delivers to the focused app via ydotool.
|
|
:targets {1 {:type :focus}
|
|
2 {:type :tmux :pane "app:claude.0"}}
|
|
:active-slot 1
|
|
|
|
:tmux ["tmux"]
|
|
|
|
:focus {:ydotool ["/usr/bin/ydotool"]
|
|
;; nil -> $XDG_RUNTIME_DIR/.ydotool_socket (the client default)
|
|
:ydotool-socket nil
|
|
:key-delay-ms 2}
|
|
|
|
:notifications {:enabled true :timeout-ms 2500}
|
|
|
|
;; Mic hygiene: force voice-off after a VAD session hears nothing for this
|
|
;; many minutes (decimals ok, nil/0 disables). Suspend/lid-close ALWAYS
|
|
;; forces voice-off (both at sleep and re-checked at resume) — waking the
|
|
;; laptop never resumes listening; deliberately not configurable.
|
|
:vad-idle-off-min 5
|
|
|
|
;; Confidence gate: an utterance whose mean avg_logprob is below this floor is
|
|
;; NOT delivered — it's flagged ("Uncertain — say again?") so you just repeat.
|
|
;; Distinct from the :vad avg_logprob_min hard drop (kills hallucinated noise);
|
|
;; this one catches real-but-garbled speech AFTER it routed to typing/keys.
|
|
;; Controls ("voice off", "unmute") always pass. nil disables (deliver as-is).
|
|
;; Speech usually lands well above -0.6; start around -0.8 and tune by feel.
|
|
:confidence-min-logprob nil
|
|
|
|
;; The resident ear worker (capture/VAD/ASR). :cmd is absolute so a
|
|
;; systemd/KDE-launched daemon needs no user PATH.
|
|
:ear {:enabled? true
|
|
:cmd ["/home/k/bin/pixi" "run" "-q" "ear"]
|
|
:dir "ear"}
|
|
;; :source pins a PipeWire input node (`pactl list sources short`);
|
|
;; omit it to follow the system default source (headset plug/unplug works).
|
|
;;
|
|
;; :language is the startup/base language; :languages is the selectable set
|
|
;; (dais-ctl/dais-top cycle these plus "auto" = per-utterance detect). Switching
|
|
;; needs a MULTILINGUAL model — "*.en" checkpoints only do English; for Finnish
|
|
;; use e.g. "small" or (better Finnish, slower) "medium".
|
|
:asr {:model "small.en" :device "cpu" :compute-type "int8"
|
|
:language "en" :languages ["en" "fi"]}
|
|
|
|
;; VAD endpointing + false-trigger gates (JSON-serialized to the ear's
|
|
;; --tuning; underscore keys match the worker's DEFAULT_TUNING).
|
|
:vad {"threshold" 0.5
|
|
"release" 0.35
|
|
"min_speech_ms" 300
|
|
"silence_ms" 700
|
|
"pre_roll_ms" 300
|
|
"max_utterance_s" 30
|
|
"no_speech_prob_max" 0.7
|
|
"avg_logprob_min" -1.2}}
|