mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 19:06:11 +00:00
Give every window a verb, and answer what the terminal asks
The socket carried a bare word and said nothing back, so a script could press the buttons but never learn what was said. A request is JSON now, it can ask to be answered when the run ends rather than when it starts, and the reply carries the transcript, the agent's answer, or why nothing happened. The verbs that do not need the microphone run in the caller's own process, which is what makes transcribing a file or reading a setting work over ssh.
This commit is contained in:
@@ -154,6 +154,16 @@ def clear_session():
|
||||
pass
|
||||
|
||||
|
||||
def stored_provider():
|
||||
"""Whose conversation is on disk, whatever the setting says now."""
|
||||
try:
|
||||
with open(SESSION_FILE, encoding="utf-8") as fh:
|
||||
row = json.load(fh)
|
||||
except (OSError, json.JSONDecodeError, ValueError):
|
||||
return ""
|
||||
return str(row.get("provider", "")) if isinstance(row, dict) else ""
|
||||
|
||||
|
||||
def session_age():
|
||||
"""Seconds since the stored conversation was last used, or None."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user