feat: debug/echo command — print the spoken phrase to the console
'<wake> debug <text>' (alias echo) echoes what you said to the console as [VOICE] debug: "..." and injects nothing — a no-target test command for checking wake + STT transcription. added to the STT vocab so it's biased for. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
parent
5064f912a4
commit
e6dadab143
@ -118,6 +118,7 @@ the wake phrase is optional.
|
|||||||
| `space [<n>]` (also `add [a] space`, `insert <n> spaces`) | insert n spaces (default 1) |
|
| `space [<n>]` (also `add [a] space`, `insert <n> spaces`) | insert n spaces (default 1) |
|
||||||
| `backspace [<n>]` (alias `delete`) | delete n chars (default 1), capped at the last submit boundary |
|
| `backspace [<n>]` (alias `delete`) | delete n chars (default 1), capped at the last submit boundary |
|
||||||
| `erase` (alias `clear`/`wipe`) | delete everything typed since the last submit/boundary |
|
| `erase` (alias `clear`/`wipe`) | delete everything typed since the last submit/boundary |
|
||||||
|
| `debug <text>` (alias `echo`) | just print what you said to the console (test wake/STT; injects nothing) |
|
||||||
| `mode ptt` / `mode listen` | switch input mode |
|
| `mode ptt` / `mode listen` | switch input mode |
|
||||||
| `set <name>` (alias `sticky`/`switch`) | set the **sticky** target → `claude-<name>` (persists) |
|
| `set <name>` (alias `sticky`/`switch`) | set the **sticky** target → `claude-<name>` (persists) |
|
||||||
| `target <name> <command>` | **one-shot** override: run that command on `claude-<name>` for this utterance only; sticky default unchanged |
|
| `target <name> <command>` | **one-shot** override: run that command on `claude-<name>` for this utterance only; sticky default unchanged |
|
||||||
|
|||||||
@ -193,6 +193,9 @@ class Daemon:
|
|||||||
sessions = target.list_sessions()
|
sessions = target.list_sessions()
|
||||||
self._console.emit(SYSTEM, "list -> " + (", ".join(sessions) if sessions else "(none running)"))
|
self._console.emit(SYSTEM, "list -> " + (", ".join(sessions) if sessions else "(none running)"))
|
||||||
return
|
return
|
||||||
|
if action.name == "debug":
|
||||||
|
self._console.emit(VOICE, f'debug: "{action.arg}"', "yellow")
|
||||||
|
return
|
||||||
|
|
||||||
session, reason = target.resolve(parsed.one_shot, auto_target=cfg.auto_target)
|
session, reason = target.resolve(parsed.one_shot, auto_target=cfg.auto_target)
|
||||||
if session is None:
|
if session is None:
|
||||||
|
|||||||
@ -44,6 +44,7 @@ _BACKSPACE_VERBS = ("backspace", "delete")
|
|||||||
_SPACE_VERBS = ("space", "spacebar")
|
_SPACE_VERBS = ("space", "spacebar")
|
||||||
_ADD_VERBS = ("add", "insert")
|
_ADD_VERBS = ("add", "insert")
|
||||||
_ERASE_VERBS = ("erase", "clear", "wipe")
|
_ERASE_VERBS = ("erase", "clear", "wipe")
|
||||||
|
_DEBUG_VERBS = ("debug", "echo")
|
||||||
_MODE_VERBS = ("mode",)
|
_MODE_VERBS = ("mode",)
|
||||||
_STICKY_VERBS = ("set", "sticky", "switch")
|
_STICKY_VERBS = ("set", "sticky", "switch")
|
||||||
_ONESHOT_VERBS = ("target",)
|
_ONESHOT_VERBS = ("target",)
|
||||||
@ -55,7 +56,7 @@ _SELECT_VERBS = ("select", "option", "choose", "number")
|
|||||||
_COMMAND_WORDS = (
|
_COMMAND_WORDS = (
|
||||||
_YES_VERBS + _NO_VERBS + _APPROVE_VERBS + _DENY_VERBS + _SUBMIT_VERBS
|
_YES_VERBS + _NO_VERBS + _APPROVE_VERBS + _DENY_VERBS + _SUBMIT_VERBS
|
||||||
+ _CANCEL_VERBS + _TYPE_VERBS + _BACKSPACE_VERBS + _SPACE_VERBS + _ADD_VERBS
|
+ _CANCEL_VERBS + _TYPE_VERBS + _BACKSPACE_VERBS + _SPACE_VERBS + _ADD_VERBS
|
||||||
+ _ERASE_VERBS + _MODE_VERBS + _STICKY_VERBS + _ONESHOT_VERBS + _UNSET_VERBS
|
+ _ERASE_VERBS + _DEBUG_VERBS + _MODE_VERBS + _STICKY_VERBS + _ONESHOT_VERBS + _UNSET_VERBS
|
||||||
+ _LIST_VERBS + _SELECT_VERBS + ("ptt", "listen")
|
+ _LIST_VERBS + _SELECT_VERBS + ("ptt", "listen")
|
||||||
+ ("one", "two", "three", "four")
|
+ ("one", "two", "three", "four")
|
||||||
)
|
)
|
||||||
@ -236,6 +237,8 @@ def match_command(remainder: str, threshold: float) -> Action | None:
|
|||||||
return Action("space", count)
|
return Action("space", count)
|
||||||
if _fuzzy_in(head, _ERASE_VERBS, threshold):
|
if _fuzzy_in(head, _ERASE_VERBS, threshold):
|
||||||
return Action("erase")
|
return Action("erase")
|
||||||
|
if _fuzzy_in(head, _DEBUG_VERBS, threshold):
|
||||||
|
return Action("debug", " ".join(rest).strip())
|
||||||
|
|
||||||
if _fuzzy_in(head, _MODE_VERBS, threshold) and rest:
|
if _fuzzy_in(head, _MODE_VERBS, threshold) and rest:
|
||||||
if _fuzzy_in(rest[0], ("ptt",), threshold) or "push" in rest[0]:
|
if _fuzzy_in(rest[0], ("ptt",), threshold) or "push" in rest[0]:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user