Watch
1
0
Fork
You've already forked souveraine
0
souveraine/surfaces/quickshell/modules/settings/SpeechConfig.qml
Fimeg 8f42fc953d publish: the public projection begins here
This is a projection, not a development branch. The tree above was constructed
from the internal source named below under a manifest that decides which paths
may leave, then scanned as a whole tree rather than as a series of patches, and
only then published.

Public history starts here because the history before it was not admissible,
and neither was the tree. What used to stand in this repository included a
rescue copy of another machine, a directory of phone handoffs, deployment
wired to one house, and a submodule pointing at a forge no stranger can reach.
None of that was ever the product. It stays in the private forge, which is
allowed to hold the whole working organism, and this is what was deliberately
sent out instead.

Three mechanisms produced this tree, in decreasing order of trust. A top-level
path the manifest does not name never arrives at all, which is the one that
catches directories nobody has thought of yet. Named internal files inside
admitted roots are dropped. A short, reviewed table replaces deployment
defaults that a public build must not carry -- an endpoint aimed at one LAN, a
VPN profile belonging to one phone, packaging built from one checkout path.

Everything after this commit is an ordinary publication with the same three
trailers, so a force push stops being routine and starts meaning that
something deliberate happened. The trailers bind the projection to its source
without pretending the public SHA is the private one: same lineage, different
tree, and the record says so.

Source-Sha: 8f27b1e76a8fef560a336aba18e6990713ff1047
Policy-Sha: 6b261d2f3e6e1fb19874846ba4bb1dfe15565d25b8618c1c1afba0419c101d27
Tree-Digest: 18ec3563c5e5ef9a414993a9f6734b251ff9ed3cd56eebdd6cac01e45c6e3067
2026-09-04 15:55:48 -04:00

135 lines
4.7 KiB
QML

import QtQuick
import QtQuick.Layouts
import Quickshell.Io
import qs.services
import qs.modules.common
import qs.modules.common.widgets
// Speech services — dictation (STT) and speech synthesis (TTS).
// The endpoints live in Config so the souveraine-stt CLI (and the
// keyboard's mic key that shells out to it) read exactly what's set
// here. The probe hits the STT /health route so "it's configured" and
// "it's answering" are visibly different states.
ContentPage {
forceWidth: true
ContentSection {
icon: "mic"
title: Translation.tr("Dictation (speech to text)")
ConfigSwitch {
buttonIcon: "record_voice_over"
text: Translation.tr("Enable dictation")
checked: Config.options.speech.stt.enable
onCheckedChanged: {
Config.options.speech.stt.enable = checked;
}
StyledToolTip {
text: Translation.tr("Voice input through the transcription server. The keyboard's mic key and the souveraine-stt command both use this.")
}
}
MaterialTextField {
Layout.fillWidth: true
text: Config.options.speech.stt.endpoint
placeholderText: Translation.tr("Transcription endpoint (http://host:port/transcribe)")
onEditingFinished: {
if (text !== Config.options.speech.stt.endpoint) {
Config.options.speech.stt.endpoint = text;
healthProbe.refresh();
}
}
}
RowLayout {
spacing: 8
StyledText {
text: healthProbe.statusText
color: healthProbe.healthy ? Appearance.colors.colOnLayer1
: Appearance.colors.colSubtext
font.pixelSize: Appearance.font.pixelSize.smaller
}
RippleButton {
implicitWidth: 32
implicitHeight: 32
buttonRadius: Appearance.rounding.full
onClicked: healthProbe.refresh()
contentItem: MaterialSymbol {
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
text: "refresh"
iconSize: 18
}
StyledToolTip {
text: Translation.tr("Check the server")
}
}
}
}
ContentSection {
icon: "text_to_speech"
title: Translation.tr("Speech synthesis (text to speech)")
ConfigSwitch {
buttonIcon: "campaign"
text: Translation.tr("Enable speech output")
checked: Config.options.speech.tts.enable
onCheckedChanged: {
Config.options.speech.tts.enable = checked;
}
StyledToolTip {
text: Translation.tr("Spoken responses through the synthesis server. Off until a TTS endpoint exists.")
}
}
MaterialTextField {
Layout.fillWidth: true
text: Config.options.speech.tts.endpoint
placeholderText: Translation.tr("Synthesis endpoint (empty = none yet)")
onEditingFinished: {
if (text !== Config.options.speech.tts.endpoint)
Config.options.speech.tts.endpoint = text;
}
}
}
// STT /health probe. Derives the health URL from the transcribe
// endpoint (…/transcribe -> …/health) rather than storing a second URL.
QtObject {
id: healthProbe
property bool healthy: false
property string statusText: Translation.tr("Checking server…")
function refresh() {
statusText = Translation.tr("Checking server…");
healthy = false;
probeProc.running = false;
probeProc.running = true;
}
}
Process {
id: probeProc
running: true
command: ["curl", "-s", "--max-time", "5",
Config.options.speech.stt.endpoint.replace(/\/[^\/]*$/, "/health")]
stdout: StdioCollector {
onStreamFinished: {
try {
const h = JSON.parse(text);
healthProbe.healthy = h.status === "ok";
healthProbe.statusText = healthProbe.healthy
? Translation.tr("Server up · %1 on %2").arg(h.model ?? "?").arg(h.device ?? "?")
: Translation.tr("Server answered but not ok");
} catch (e) {
healthProbe.healthy = false;
healthProbe.statusText = Translation.tr("Server unreachable");
}
}
}
}
}