Commit Graph
18 Commits
Author SHA1 Message Date
yusufipk 22edd2f247 Merge master into feature/groq-transcription 2026-08-01 22:09:01 +07:00
yusufipk 3d4c29c853 Merge branch 'test-suite' into feature/ubuntu-x11-gnome 2026-08-01 20:15:22 +07:00
yusufipk bb3b0bcb94 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.
2026-08-01 18:58:57 +07:00
Muzaffer Emre dd73735617 Add Groq transcription support 2026-07-31 18:48:21 +03:00
Muzaffer Emre d64ed8968a Add GNOME X11 and PulseAudio support 2026-07-31 18:47:49 +03:00
yusufipk da3dc3c908 Give an audio file its own cleanup rules, written for subtitles
Cleaning up a dictation and cleaning up a file are not the same job, and until
now they shared one prompt. A dictation is read afterwards, so dropping a
filler and tightening a sentence is a favour. A file becomes an SRT, and there
the same favour is damage: the viewer hears the words while the line is on
screen, so a word that was said and is not written is noticed, and a phrase
pulled onto the line above is on screen before it is spoken.

So the file path gets its own system prompt. It says what the text is and what
it is for, and it spends its room on the one repair only context can make: the
word the transcriber misheard. Speech models fail phonetically on names, and
somebody talking about Anthropic said "Claude", not "cloud". The lines stay
where they are, nothing is shortened, nothing is turned into an abbreviation,
and the filler words stay because they were said out loud.

The glossary and the timestamp rule are appended as before, so a name listed
under Cleanup rules still reaches this prompt, and a timestamped run still gets
told to leave the stamps alone. The dictation prompt is untouched, and so are
the meeting and agent paths.

Cleanup rules now has a tab each. An untouched prompt is still stored empty, so
switching the interface language keeps switching the prompt language with it.
2026-07-30 23:06:40 +07:00
yusufipk e2551343e4 Run a dictation and a command to the agent at the same time
The two shared one state machine, which meant an agent thinking for a minute
was a minute in which nothing could be dictated. That is the wrong trade: the
work has nothing in common past the microphone, and the microphone is busy for
the seconds you are speaking, not the minute afterwards.

So they are two flows now, each with its own state, its own pipeline and its own
indicator. Either can be working while the other records. Only the recorder is
taken in turns, because there is one of it: whichever asks second is refused
while the first holds it, and the menu entry greys out to say so rather than
failing quietly. "Am I recording" is read off the two states rather than off the
recorder's owner, which outlives the recording by the moment it takes the audio
to arrive, and would otherwise report a microphone as busy after it was free.

Two indicators in one corner would sit on top of each other, so an indicator can
be told what it stacks on: it offsets by that one's height while it is showing
and drops back into the corner when it goes, which the animation timer notices
without anything having to tell it.

Pasting is now under a lock. It is three steps rather than one, read the
clipboard, write ours, press the key, and two runs finishing together would
paste one answer and restore the other's clipboard over it.

Calling off the agent is its own menu entry and its own command, instead of a
cancel that meant different things depending on what was running. The tray icon
still ends whichever recording is going.
2026-07-28 18:29:48 +07:00
yusufipk 590c6cbe1a Call the tab Agent, pick shortcuts from a list, and stop answering from memory
Four things the first use of it turned up.

The tab was called Claude while the setting inside it chooses between three
providers, two of which are not Claude. It is Agent now, and the messages that
pointed at it by name point at the new one.

The three global shortcuts were the only fields in the window you had to know
the syntax of to fill in, next to a paste key that has been a dropdown all
along. They are editable combo boxes now, sharing one shortlist of combinations
that are usually free. Typing your own still works; it is just no longer the
only way.

The instruction was read as discouraging the tools, which is the opposite of the
point. "Keep it short" is about the answer, and a model that reads it as "answer
off the top of your head" hands back a caveat about its training data instead of
the thing it was asked. Asked who won the 2026 World Cup it answered, twice, that
the tournament had not been played, on the 28th of July. So shortness is now
stated as being about the answer rather than the work, and writing a caveat is
named as the moment to go and look instead. Same question, same model, only the
prompt changed: no tool calls and a wrong answer before, a web search and the
right one after. It also appended its sources, which a reply being pasted into
someone's text field has no use for, so that is ruled out alongside the headings
and the bullet lists.

Clicking the tray icon during a Claude recording did nothing, because the icon
was wired to the dictation toggle and that one leaves the other mode's recording
alone on purpose. The shortcuts should stay tied to their own mode; the icon is
one button and now ends whichever recording is running.
2026-07-28 17:20:41 +07:00
yusufipk 01eea7a363 Let the command go to Codex or OpenRouter, not only Claude Code
Everything the last commit built assumed one agent was installed, which is a
poor assumption to bake into a dictation tool. So the provider is a setting, and
what it selects is one of three quite different things.

Claude Code and Codex are the same shape: a CLI, streaming JSONL, a session id
to resume, tools that reach the machine and whatever is connected to it. They
share the runner. What differs is spelled out where it differs, which is more
than the flag names: Codex has no system prompt to append, so the instruction
rides in front of the command with a rule between them; it confines its commands
in a sandbox rather than asking about them, so the permission setting is a
sandbox mode; and `-s` is not accepted by `exec resume`, so both settings go
through `-c` overrides, which are.

OpenRouter is the odd one and is meant to be. No tools, no files, no calendar:
it can say what the capital of Peru is and not what is in your diary, and the
settings box says so rather than letting it be discovered. It also has no
session to resume, so the conversation is kept here and resent, capped at 24
messages.

A stored conversation names the provider that made it, and is ignored by any
other: none of them can pick up another's thread, and a stale id would otherwise
fail every command until the timeout cleared it.

The interface calls the thing by its name, which in Turkish means the suffix has
to agree with it: Claude'a but Codex'e, Claude'u but Codex'i. A name dropped
into a sentence through t() cannot be inflected by that sentence, so it arrives
inflected, from a small table in i18n. English takes the name as it is and keeps
the preposition in the sentence.
2026-07-28 17:08:14 +07:00
yusufipk 0206303751 Let a dictation be a command for Claude Code, not only text
Dictation ends the same way every time: the words you said land in the window
you were in. But half of what you say to a machine is not text to place, it is
something to do, and the answer to "what is on my calendar today" is not that
sentence written out.

`claude -p` is that session run without a window: the same skills, the same
connected services, the same account. So a second shortcut records exactly as
the first one does and sends the transcript there instead, and what comes back
is pasted where the transcript would have been. Which is what puts "save that
to my calendar on Thursday at three" inside a text field that has nothing to do
with Claude.

Permissions are the part worth being deliberate about, because nothing here can
answer a prompt: a mode that would have asked denies instead. It runs in `auto`,
which decides for itself with the prompt-injection checks left on, and the other
two modes are one setting away. What Claude was not allowed to touch is reported
rather than swallowed, since a reply that reads perfectly normal is otherwise
the only sign that the job did not happen.

Commands close together stay in one conversation, so "and move that to Thursday"
knows what "that" is; half an hour of silence ends it, as does the tray. The
answer is written to be read where it lands: no headings, no lists, and a
sentence naming what was done when something was done.

Its output is read as it streams rather than waited out, so the corner names the
tool it is on. A calendar lookup took 29 s in testing, which a still indicator
would have made indistinguishable from a hang. The clock and the stop button are
watched from a thread of their own, because the stream blocks between lines and
a model that thinks for a minute sends none: they end the run by killing the
process, which closes the stream and unwinds everything else on its own.

Transcript cleanup is off on this path. Claude reads through "erm" and "hani"
without help, and skipping it saves an API call and a second or two in front of
a screen you are standing at.
2026-07-28 16:57:10 +07:00
yusufipk 352f7b6c22 Record a meeting from both sides, and write its minutes
Who said what is the hard part of a meeting transcript, and the usual answer
is to hand one mixed recording to a model and ask it to tell the voices apart.
That guess is wrong often enough to be worse than useless in minutes, where a
decision attributed to the wrong person is a decision nobody made.

So the question never reaches a model. ffmpeg records the microphone and the
default sink's monitor as one stereo stream, you on the left and everyone else
on the right, and one process reading both is what keeps them aligned over an
hour. Each channel is transcribed on its own and the two are interleaved on a
single timeline, so attribution is settled by the wire a voice arrived on.
What a microphone picks up from the speakers lands on both channels; our copy
is dropped when it overlaps theirs in time and says nearly the same thing.

The stream is written to disk as it arrives rather than held in memory, so
length costs nothing and a crash costs the tail instead of the whole meeting.
Every stage the run reaches is recorded in meetings.jsonl, so a failure while
summarising does not throw away the transcription of an hour of audio: the
retry reads the transcript back out of the document and picks up from there.
A run that dies keeps its recording whether or not audio is being kept.

The minutes model is configured on its own, under Settings, with its own
prompt, and it is told who was expected in the room so the names come out
spelled right. It is told outright that the transcript is a record of other
people talking, not instructions addressed to it.

The built-in listener now holds several bindings rather than one, and the KDE
side is parameterised by desktop id, so the meeting toggle gets a shortcut of
its own on the same footing as the dictation one.
2026-07-28 16:32:31 +07:00
yusufipk 32e0fb061d Let the cleanup model be told how hard to think 2026-07-26 23:14:06 +07:00
yusufipk 37e360743d Save the transcript as subtitles too, not just as text
whisper-1's verbose response carries a start and an end for every segment,
and the file tab was reading only the start, to build the [mm:ss] prefix.
Keeping the end as well is all an SRT needs.

The text stays the authority on wording and the segments on timing; they
meet at that prefix, which the cleanup model is already told to leave alone.
So a transcript that went through cleanup still turns into properly timed
subtitles. A line whose stamp matches no segment runs until the next line
starts, a line with no stamp at all joins the cue above it, and an end that
would run into the next cue is trimmed back.

The button is dead until a timestamped run finishes, because without
timestamps there are no segments to time anything with.
2026-07-26 22:33:32 +07:00
yusufipk 761245a305 Transcribe on OpenRouter too, not just OpenAI
OpenRouter mirrors OpenAI's /audio/transcriptions field for field, so one
multipart request serves both providers and only the key, the base URL and
the model id change. That puts a dozen speech models behind the key that was
already there for the cleanup, and makes a single OpenRouter key enough for
the whole chain.

Its transcription endpoint takes no hint field, so the words from Cleanup
rules are not sent there; they still reach the cleanup model as a glossary.
Timestamps switch to openai/whisper-1, the namespaced id of the only model
that returns segment times.

The API tab is now grouped by role rather than by service, because a key no
longer belongs to a single job: both keys sit at the top, the two jobs below.
Each provider keeps its own model, so switching back and forth does not
overwrite the other one's.
2026-07-25 23:01:21 +07:00
yusufipk f901c995c4 Trim both READMEs, and fix what they claimed about shortcuts
"Shortcut presses during Transcribing… are ignored" read as though Dikte
blocked the session's shortcuts while it worked. It only ignores its own:
pressing Ctrl+Space with a transcript in flight does nothing and queues
nothing, while the rest of KDE keeps working normally. That is now said
where it belongs, next to the indicator.

The rest is shorter. Silence detection, misheard words and file
transcription became bullets under one heading, the settings table is gone
because the window already says what each setting does, and Known limits
folded into a line under the file map. The numbers worth knowing stayed: the
10 dB over each recording's own noise floor, the 0.3 s, the -55 dBFS, and
the one logout KWin needs before the global shortcut fires.
2026-07-25 20:12:21 +07:00
yusufipk 60c8006725 Repair misheard words, surface cleanup failures, add a restart action
The cleanup prompt now asks the model to fix words the transcriber misheard
when the context makes the intended one clear, and to leave them alone when
it does not. Speech models fail phonetically on proper nouns, and that is
exactly what context can recover.

The names you enter for the transcription hint are handed to the cleanup
model as a glossary too. Knowing the spelling is what lets it recognise
"kuber netis" as Kubernetes.

A failed cleanup used to be almost invisible: the raw transcript was pasted
and a progress line flashed by, so a rejected key looked exactly like
working dictation for days. It now leaves the indicator amber with the
reason, sends a notification, and records the error in the history. HTTP
401, 402 and 429 are reported as what they are, naming the service.

Also:
- Settings can test the OpenRouter key, not just the OpenAI one
- Tray menu and CLI gained Restart, which re-execs in place
- Defaults saved into the config by older versions are recognised by their
  fingerprint and dropped, so an untouched prompt keeps getting improvements
- The IPC socket is user-only; Qt puts it in /tmp
2026-07-25 19:51:32 +07:00
yusufipk 011493a9bc Ship full-resolution WebP screenshots, drop em dashes everywhere
The screenshots were downscaled to 430 px wide, which made the UI text
blurry. Restore them at native 1292 px as lossless WebP, which is also
half the size of the original PNGs (72 KB against 155 KB for the largest).

Rewrite every em dash in prose, comments, docstrings and interface strings
as ordinary punctuation.
2026-07-25 19:31:10 +07:00
yusufipk efa8687b23 Voice dictation for KDE Wayland: record, transcribe, clean up, paste
Ctrl+Space starts and stops a recording. The audio goes to OpenAI for
transcription, a model on OpenRouter strips the fillers and restores
punctuation, and the result is copied and pasted into the focused window.

Only the Python standard library and PyQt6 — HTTP, multipart uploads and
WAV writing are all hand-rolled.

- pw-record captures raw 16 kHz mono PCM with a live level meter
- the corner indicator is drawn through XWayland, since a Wayland client
  cannot position its own window
- silence is caught before it costs an API call, relative to each
  recording's own noise floor, plus a filter for the stock phrases models
  invent when handed silence
- audio and video files can be transcribed too, optionally with [mm:ss]
  timestamps, chunked through ffmpeg for long inputs
- global shortcut installs as a KDE custom shortcut, with an evdev
  listener as a fallback until the session is restarted
- Turkish and English interface, following the system locale by default
2026-07-25 19:24:46 +07:00