feat: highlight wake phrases in magenta (startup banner + wake note)
add a magenta color; paint wake phrases magenta in the startup 'wake:' list and in the loose-match '(wake: <phrase>)' note (the rest of that green heard line stays green around the magenta phrase). makes the wake vocabulary visually distinct from green heard-text and brightblue command words. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
parent
97591eb24d
commit
252385fb67
@ -20,6 +20,7 @@ _COLORS = {
|
|||||||
"cyan": "\033[36m",
|
"cyan": "\033[36m",
|
||||||
"blue": "\033[34m",
|
"blue": "\033[34m",
|
||||||
"brightblue": "\033[94m",
|
"brightblue": "\033[94m",
|
||||||
|
"magenta": "\033[35m",
|
||||||
"dim": "\033[2m",
|
"dim": "\033[2m",
|
||||||
"bold": "\033[1m",
|
"bold": "\033[1m",
|
||||||
}
|
}
|
||||||
|
|||||||
@ -175,13 +175,16 @@ class Daemon:
|
|||||||
action = parsed.action
|
action = parsed.action
|
||||||
|
|
||||||
# a command was recognized — echo what we heard (green) before acting. note the
|
# a command was recognized — echo what we heard (green) before acting. note the
|
||||||
# matched wake phrase when the transcript didn't literally contain it (so a
|
# matched wake phrase (magenta) when the transcript didn't literally contain it
|
||||||
# loose match like "okay clouds" -> "okay claude" is visible).
|
# (so a loose match like "okay clouds" -> "okay claude" is visible).
|
||||||
wake_note = ""
|
head = self._console.paint(f'heard "{transcript}" -> {self._describe(action)}', "green")
|
||||||
|
note = ""
|
||||||
if parsed.wake and parsed.wake.replace(" ", "") not in transcript.lower().replace(" ", ""):
|
if parsed.wake and parsed.wake.replace(" ", "") not in transcript.lower().replace(" ", ""):
|
||||||
wake_note = f" (wake: {parsed.wake})"
|
note = (self._console.paint(" (wake: ", "green")
|
||||||
self._console.emit(VOICE, f'heard "{transcript}" -> {self._describe(action)}'
|
+ self._console.paint(parsed.wake, "magenta")
|
||||||
f'{wake_note} {self._timing()}', "green")
|
+ self._console.paint(")", "green"))
|
||||||
|
tail = self._console.paint(f" {self._timing()}", "green")
|
||||||
|
self._console.emit(VOICE, f"{head}{note}{tail}")
|
||||||
|
|
||||||
def blue(s):
|
def blue(s):
|
||||||
return self._console.paint(s, "brightblue")
|
return self._console.paint(s, "brightblue")
|
||||||
@ -302,7 +305,8 @@ class Daemon:
|
|||||||
self._console.emit(SYSTEM, f"claudedo {self.mode} mode — Ctrl-C to stop", "bold")
|
self._console.emit(SYSTEM, f"claudedo {self.mode} mode — Ctrl-C to stop", "bold")
|
||||||
self._console.emit(SYSTEM, f"model {cfg.stt_model} ({cfg.stt_language}) · mic {dev} · "
|
self._console.emit(SYSTEM, f"model {cfg.stt_model} ({cfg.stt_language}) · mic {dev} · "
|
||||||
f"target {target_now}")
|
f"target {target_now}")
|
||||||
self._console.emit(SYSTEM, "wake: " + ", ".join(cfg.wake_phrases))
|
wakes = ", ".join(self._console.paint(p, "magenta") for p in cfg.wake_phrases)
|
||||||
|
self._console.emit(SYSTEM, f"wake: {wakes}")
|
||||||
|
|
||||||
def _refresh_state(self) -> None:
|
def _refresh_state(self) -> None:
|
||||||
write_state(os.getpid(), self.mode, target.read_active())
|
write_state(os.getpid(), self.mode, target.read_active())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user