@screenreader-speech-capture/bridge 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +1292 -791
- package/dist/ui/adapter-node.js +1 -1
- package/dist/ui/client/ui/_app/immutable/assets/{4.DyY1vjRV.css → 4.DEk4yqpA.css} +1 -1
- package/dist/ui/client/ui/_app/immutable/assets/4.DEk4yqpA.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/4.DEk4yqpA.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BEImj5AP.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BEImj5AP.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BEImj5AP.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BLbj0ykL.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BLbj0ykL.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BLbj0ykL.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B__KpOuX.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B__KpOuX.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B__KpOuX.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BkoDSEOx.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BkoDSEOx.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BkoDSEOx.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BlC5mir6.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BlC5mir6.js.br +2 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BlC5mir6.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BquQTeuV.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BquQTeuV.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BquQTeuV.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BtnuBvK5.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BtnuBvK5.js.br +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BtnuBvK5.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/{BrPqgVT6.js → BuwZGWCm.js} +21 -21
- package/dist/ui/client/ui/_app/immutable/chunks/BuwZGWCm.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BuwZGWCm.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Bxh3K0TK.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Bxh3K0TK.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Bxh3K0TK.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C06IiL6m.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C06IiL6m.js.br +2 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C06IiL6m.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CAZ56n62.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CAZ56n62.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CAZ56n62.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CTnnxqUD.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CTnnxqUD.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CTnnxqUD.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DRNNJMYk.js +5 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DRNNJMYk.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DRNNJMYk.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/JsC3ASJq.js +3 -0
- package/dist/ui/client/ui/_app/immutable/chunks/JsC3ASJq.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/JsC3ASJq.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/{C7D7xLuA.js → OAsMjdHF.js} +13 -13
- package/dist/ui/client/ui/_app/immutable/chunks/OAsMjdHF.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/OAsMjdHF.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/R_4U_-zb.js +33 -0
- package/dist/ui/client/ui/_app/immutable/chunks/R_4U_-zb.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/R_4U_-zb.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/UKukklIc.js +1 -0
- package/dist/ui/client/ui/_app/immutable/chunks/UKukklIc.js.br +2 -0
- package/dist/ui/client/ui/_app/immutable/chunks/UKukklIc.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/{KD5R77Wj.js → VxDST09k.js} +1 -1
- package/dist/ui/client/ui/_app/immutable/chunks/VxDST09k.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/VxDST09k.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/{D9JU-e3z.js → vPs9G1oN.js} +36 -36
- package/dist/ui/client/ui/_app/immutable/chunks/vPs9G1oN.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/vPs9G1oN.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/{Cc902J0D.js → w5i9ZoX_.js} +2 -2
- package/dist/ui/client/ui/_app/immutable/chunks/w5i9ZoX_.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/w5i9ZoX_.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.CHExvln1.js +2 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.CHExvln1.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.CHExvln1.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.4hiWLKwq.js +2 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.4hiWLKwq.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.4hiWLKwq.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.DENUQERM.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.DENUQERM.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.DENUQERM.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.BBl7b45u.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.BBl7b45u.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.BBl7b45u.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.4VpydhMh.js +1 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.4VpydhMh.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.4VpydhMh.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.D9AmPYb5.js +5 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.D9AmPYb5.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.D9AmPYb5.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.DxNIrNp_.js +180 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.DxNIrNp_.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.DxNIrNp_.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.Cm6I95kb.js +6 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.Cm6I95kb.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.Cm6I95kb.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.D9jpgBJB.js +6 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.D9jpgBJB.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.D9jpgBJB.js.gz +0 -0
- package/dist/ui/client/ui/_app/version.json +1 -1
- package/dist/ui/client/ui/_app/version.json.br +0 -0
- package/dist/ui/client/ui/_app/version.json.gz +0 -0
- package/dist/ui/server/.vite/manifest.json +80 -59
- package/dist/ui/server/_app/immutable/assets/{_page.DyY1vjRV.css → _page.DEk4yqpA.css} +1 -1
- package/dist/ui/server/chunks/{composition.js → app-context.js} +50 -958
- package/dist/ui/server/chunks/app-context.js.map +1 -0
- package/dist/ui/server/chunks/config2.js +106 -0
- package/dist/ui/server/chunks/config2.js.map +1 -0
- package/dist/ui/server/chunks/dialog.js +1 -1
- package/dist/ui/server/chunks/instance.js +3 -3
- package/dist/ui/server/chunks/internal.js +1 -1
- package/dist/ui/server/chunks/outlined-button.js +116 -0
- package/dist/ui/server/chunks/outlined-button.js.map +1 -0
- package/dist/ui/server/chunks/outlined-text-field.js +1 -1
- package/dist/ui/server/chunks/redispatch-event.js +1 -1
- package/dist/ui/server/chunks/rolldown-runtime.js +12 -0
- package/dist/ui/server/chunks/rules.js +178 -0
- package/dist/ui/server/chunks/rules.js.map +1 -0
- package/dist/ui/server/chunks/sessions.remote.js +1 -11
- package/dist/ui/server/chunks/sessions.remote.js.map +1 -1
- package/dist/ui/server/chunks/setup.js +86 -0
- package/dist/ui/server/chunks/setup.js.map +1 -0
- package/dist/ui/server/chunks/{icon-button.js → speech.js} +42 -3
- package/dist/ui/server/chunks/speech.js.map +1 -0
- package/dist/ui/server/chunks/src.js +20 -155
- package/dist/ui/server/chunks/src.js.map +1 -1
- package/dist/ui/server/chunks/static-html.js +1 -1
- package/dist/ui/server/chunks/text-button.js +1 -1
- package/dist/ui/server/chunks/vocabulary.js +19 -0
- package/dist/ui/server/chunks/vocabulary.js.map +1 -0
- package/dist/ui/server/entries/endpoints/api/config/_server.ts.js +3 -2
- package/dist/ui/server/entries/endpoints/api/config/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/endpoints/api/input/keys/_server.ts.js +14 -5
- package/dist/ui/server/entries/endpoints/api/input/keys/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/endpoints/api/markers/_server.ts.js +3 -2
- package/dist/ui/server/entries/endpoints/api/markers/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/endpoints/api/sessions/_server.ts.js +2 -1
- package/dist/ui/server/entries/endpoints/api/sessions/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/endpoints/api/speech/_server.ts.js +10 -13
- package/dist/ui/server/entries/endpoints/api/speech/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/endpoints/api/status/_server.ts.js +2 -1
- package/dist/ui/server/entries/endpoints/api/status/_server.ts.js.map +1 -1
- package/dist/ui/server/entries/hooks.server.js +29 -25
- package/dist/ui/server/entries/hooks.server.js.map +1 -1
- package/dist/ui/server/entries/pages/_layout.svelte.js +749 -4
- package/dist/ui/server/entries/pages/_layout.svelte.js.map +1 -1
- package/dist/ui/server/entries/pages/_page.svelte.js +34 -26
- package/dist/ui/server/entries/pages/_page.svelte.js.map +1 -1
- package/dist/ui/server/entries/pages/settings/_page.svelte.js +143 -15
- package/dist/ui/server/entries/pages/settings/_page.svelte.js.map +1 -1
- package/dist/ui/server/entries/pages/setup/_page.svelte.js +3 -3
- package/dist/ui/server/entries/pages/setup/_page.svelte.js.map +1 -1
- package/dist/ui/server/entries/pages/setup/instructions/_page.svelte.js +16 -10
- package/dist/ui/server/entries/pages/setup/instructions/_page.svelte.js.map +1 -1
- package/dist/ui/server/manifest-full.js +1 -1
- package/dist/ui/server/manifest.js +1 -1
- package/dist/ui/server/nodes/0.js +1 -1
- package/dist/ui/server/nodes/1.js +1 -1
- package/dist/ui/server/nodes/2.js +1 -1
- package/dist/ui/server/nodes/3.js +1 -1
- package/dist/ui/server/nodes/4.js +2 -2
- package/dist/ui/server/nodes/5.js +1 -1
- package/dist/ui/server/nodes/6.js +1 -1
- package/dist/ui/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/ui/client/ui/_app/immutable/assets/4.DyY1vjRV.css.br +0 -0
- package/dist/ui/client/ui/_app/immutable/assets/4.DyY1vjRV.css.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/0FroJ-XN.js +0 -3
- package/dist/ui/client/ui/_app/immutable/chunks/0FroJ-XN.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/0FroJ-XN.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B_ZElYu_.js +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/B_ZElYu_.js.br +0 -2
- package/dist/ui/client/ui/_app/immutable/chunks/B_ZElYu_.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BfHif6xP.js +0 -2
- package/dist/ui/client/ui/_app/immutable/chunks/BfHif6xP.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BfHif6xP.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BrPqgVT6.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BrPqgVT6.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C7D7xLuA.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/C7D7xLuA.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CVpgcnu3.js +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/CVpgcnu3.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CVpgcnu3.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Cc902J0D.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Cc902J0D.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D-2Nx62w.js +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/D-2Nx62w.js.br +0 -4
- package/dist/ui/client/ui/_app/immutable/chunks/D-2Nx62w.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D9JU-e3z.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/D9JU-e3z.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DHsTyp2W.js +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/DHsTyp2W.js.br +0 -2
- package/dist/ui/client/ui/_app/immutable/chunks/DHsTyp2W.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dvxhfd7j.js +0 -3
- package/dist/ui/client/ui/_app/immutable/chunks/Dvxhfd7j.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Dvxhfd7j.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DzInmTUe.js +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/DzInmTUe.js.br +0 -1
- package/dist/ui/client/ui/_app/immutable/chunks/DzInmTUe.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/KD5R77Wj.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/KD5R77Wj.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/PzCUpBms.js +0 -3
- package/dist/ui/client/ui/_app/immutable/chunks/PzCUpBms.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/PzCUpBms.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Roub4aju.js +0 -33
- package/dist/ui/client/ui/_app/immutable/chunks/Roub4aju.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/Roub4aju.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/ux9AxWa3.js +0 -4
- package/dist/ui/client/ui/_app/immutable/chunks/ux9AxWa3.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/ux9AxWa3.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.DM2PRoLw.js +0 -2
- package/dist/ui/client/ui/_app/immutable/entry/app.DM2PRoLw.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.DM2PRoLw.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.DqIv9xYX.js +0 -2
- package/dist/ui/client/ui/_app/immutable/entry/start.DqIv9xYX.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/start.DqIv9xYX.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.fKLM0nQo.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/0.fKLM0nQo.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.fKLM0nQo.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.C81neQJL.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/1.C81neQJL.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/1.C81neQJL.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.CmlyeAx_.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/2.CmlyeAx_.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/2.CmlyeAx_.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.CywuMQ0y.js +0 -5
- package/dist/ui/client/ui/_app/immutable/nodes/3.CywuMQ0y.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.CywuMQ0y.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.BYvsTY13.js +0 -160
- package/dist/ui/client/ui/_app/immutable/nodes/4.BYvsTY13.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.BYvsTY13.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.xWNFTFjr.js +0 -6
- package/dist/ui/client/ui/_app/immutable/nodes/5.xWNFTFjr.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.xWNFTFjr.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.Dnf8S10l.js +0 -6
- package/dist/ui/client/ui/_app/immutable/nodes/6.Dnf8S10l.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.Dnf8S10l.js.gz +0 -0
- package/dist/ui/server/chunks/composition.js.map +0 -1
- package/dist/ui/server/chunks/filled-button.js +0 -116
- package/dist/ui/server/chunks/filled-button.js.map +0 -1
- package/dist/ui/server/chunks/icon-button.js.map +0 -1
- package/dist/ui/server/chunks/icon.js +0 -49
- package/dist/ui/server/chunks/icon.js.map +0 -1
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nt as resolve } from "./internal.js";
|
|
3
|
-
import { _ as CONFIG_LIMITS, n as checkDto, u as SpeechEntrySchema, v as EXACT_VERSION_PATTERN } from "./src.js";
|
|
4
|
-
import { l as getContext, u as setContext } from "./server2.js";
|
|
1
|
+
import { l as getContext } from "./server2.js";
|
|
5
2
|
import "./index-server.js";
|
|
6
|
-
import "./paths.js";
|
|
7
3
|
// ../../node_modules/.pnpm/tslib@2.9.1/node_modules/tslib/tslib.es6.mjs
|
|
8
4
|
function __decorate(decorators, target, key, desc) {
|
|
9
5
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1380,6 +1376,51 @@ var i$1 = class extends g$1 {
|
|
|
1380
1376
|
i$1._$litElement$ = !0, i$1["finalized"] = !0, s.litElementHydrateSupport?.({ LitElement: i$1 });
|
|
1381
1377
|
(0, s.litElementPolyfillSupport)?.({ LitElement: i$1 });
|
|
1382
1378
|
(s.litElementVersions ??= []).push("4.2.2");
|
|
1379
|
+
// ../../node_modules/.pnpm/@material+web@2.5.0/node_modules/@material/web/icon/internal/icon.js
|
|
1380
|
+
/**
|
|
1381
|
+
* @license
|
|
1382
|
+
* Copyright 2022 Google LLC
|
|
1383
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
1384
|
+
*/
|
|
1385
|
+
/**
|
|
1386
|
+
* An icon element.
|
|
1387
|
+
*/
|
|
1388
|
+
var Icon = class extends i$1 {
|
|
1389
|
+
render() {
|
|
1390
|
+
return T`<slot></slot>`;
|
|
1391
|
+
}
|
|
1392
|
+
connectedCallback() {
|
|
1393
|
+
super.connectedCallback();
|
|
1394
|
+
if (this.getAttribute("aria-hidden") === "false") {
|
|
1395
|
+
this.removeAttribute("aria-hidden");
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
this.setAttribute("aria-hidden", "true");
|
|
1399
|
+
}
|
|
1400
|
+
};
|
|
1401
|
+
// ../../node_modules/.pnpm/@material+web@2.5.0/node_modules/@material/web/icon/internal/icon-styles.cssresult.js
|
|
1402
|
+
/**
|
|
1403
|
+
* @license
|
|
1404
|
+
* Copyright 2026 Google LLC
|
|
1405
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
1406
|
+
*/
|
|
1407
|
+
var styles$2 = i$3`:host{font-size:var(--md-icon-size, 24px);width:var(--md-icon-size, 24px);height:var(--md-icon-size, 24px);color:inherit;font-variation-settings:inherit;font-weight:400;font-family:var(--md-icon-font, Material Symbols Outlined);display:inline-flex;font-style:normal;place-items:center;place-content:center;line-height:1;overflow:hidden;letter-spacing:normal;text-transform:none;user-select:none;white-space:nowrap;word-wrap:normal;flex-shrink:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}::slotted(svg){fill:currentColor}::slotted(*){height:100%;width:100%}
|
|
1408
|
+
`;
|
|
1409
|
+
styles$2.styleSheet;
|
|
1410
|
+
// ../../node_modules/.pnpm/@material+web@2.5.0/node_modules/@material/web/icon/icon.js
|
|
1411
|
+
/**
|
|
1412
|
+
* @license
|
|
1413
|
+
* Copyright 2022 Google LLC
|
|
1414
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
1415
|
+
*/
|
|
1416
|
+
/**
|
|
1417
|
+
* @final
|
|
1418
|
+
* @suppress {visibility}
|
|
1419
|
+
*/
|
|
1420
|
+
var MdIcon = class MdIcon extends Icon {};
|
|
1421
|
+
/** @nocollapse */
|
|
1422
|
+
MdIcon.styles = [styles$2];
|
|
1423
|
+
MdIcon = __decorate([t$3("md-icon")], MdIcon);
|
|
1383
1424
|
// ../../node_modules/.pnpm/@material+web@2.5.0/node_modules/@material/web/internal/controller/attachable-controller.js
|
|
1384
1425
|
/**
|
|
1385
1426
|
* @license
|
|
@@ -2508,964 +2549,15 @@ function mixinFormSubmitter(base) {
|
|
|
2508
2549
|
__decorate([n$1({ reflect: true })], FormSubmitterElement.prototype, "value", void 0);
|
|
2509
2550
|
return FormSubmitterElement;
|
|
2510
2551
|
}
|
|
2511
|
-
// src/lib/
|
|
2512
|
-
/**
|
|
2513
|
-
* The browser's clipboard. `navigator.clipboard` only exists in a secure context, and the bridge
|
|
2514
|
-
* speaks plain HTTP: opened from another machine, the old selection command has to do it.
|
|
2515
|
-
*/
|
|
2516
|
-
var BrowserClipboard = class {
|
|
2517
|
-
async copy(text) {
|
|
2518
|
-
const modern = navigator.clipboard;
|
|
2519
|
-
if (modern !== void 0) try {
|
|
2520
|
-
await modern.writeText(text);
|
|
2521
|
-
return true;
|
|
2522
|
-
} catch {}
|
|
2523
|
-
return copySelected(text);
|
|
2524
|
-
}
|
|
2525
|
-
};
|
|
2526
|
-
/** Copies through a text area that exists only for this, then gives the focus back. */
|
|
2527
|
-
function copySelected(text) {
|
|
2528
|
-
const focused = document.activeElement;
|
|
2529
|
-
const area = document.createElement("textarea");
|
|
2530
|
-
area.value = text;
|
|
2531
|
-
area.readOnly = true;
|
|
2532
|
-
area.setAttribute("aria-hidden", "true");
|
|
2533
|
-
Object.assign(area.style, {
|
|
2534
|
-
position: "fixed",
|
|
2535
|
-
top: "0",
|
|
2536
|
-
left: "0",
|
|
2537
|
-
opacity: "0"
|
|
2538
|
-
});
|
|
2539
|
-
document.body.append(area);
|
|
2540
|
-
try {
|
|
2541
|
-
area.select();
|
|
2542
|
-
return document.execCommand("copy");
|
|
2543
|
-
} catch {
|
|
2544
|
-
return false;
|
|
2545
|
-
} finally {
|
|
2546
|
-
area.remove();
|
|
2547
|
-
if (focused instanceof HTMLElement) focused.focus({ preventScroll: true });
|
|
2548
|
-
}
|
|
2549
|
-
}
|
|
2550
|
-
// src/lib/core/theme.ts
|
|
2551
|
-
var DEFAULT_THEME = "light";
|
|
2552
|
-
/** The choices in the order the settings page lists them. */
|
|
2553
|
-
var THEMES = [
|
|
2554
|
-
{
|
|
2555
|
-
value: "light",
|
|
2556
|
-
label: "Light",
|
|
2557
|
-
description: "Default light scheme."
|
|
2558
|
-
},
|
|
2559
|
-
{
|
|
2560
|
-
value: "dark",
|
|
2561
|
-
label: "Dark",
|
|
2562
|
-
description: "Default dark scheme."
|
|
2563
|
-
},
|
|
2564
|
-
{
|
|
2565
|
-
value: "high-contrast",
|
|
2566
|
-
label: "High contrast",
|
|
2567
|
-
description: "White surface, black text, 2px outlines."
|
|
2568
|
-
},
|
|
2569
|
-
{
|
|
2570
|
-
value: "dark-high-contrast",
|
|
2571
|
-
label: "Dark high contrast",
|
|
2572
|
-
description: "Black surface, white text, 2px outlines."
|
|
2573
|
-
}
|
|
2574
|
-
];
|
|
2575
|
-
function parseTheme(raw) {
|
|
2576
|
-
return THEMES.find((t) => t.value === raw)?.value ?? null;
|
|
2577
|
-
}
|
|
2578
|
-
// src/lib/adapters/browser-theme-storage.ts
|
|
2579
|
-
var THEME_STORAGE_KEY = "sr-theme";
|
|
2580
|
-
/** Keeps the theme in `localStorage` and applies it as `data-theme` on `<html>`. */
|
|
2581
|
-
var BrowserThemeStorage = class {
|
|
2582
|
-
read() {
|
|
2583
|
-
try {
|
|
2584
|
-
return parseTheme(localStorage.getItem(THEME_STORAGE_KEY));
|
|
2585
|
-
} catch {
|
|
2586
|
-
return null;
|
|
2587
|
-
}
|
|
2588
|
-
}
|
|
2589
|
-
write(theme) {
|
|
2590
|
-
document.documentElement.dataset.theme = theme;
|
|
2591
|
-
try {
|
|
2592
|
-
localStorage.setItem(THEME_STORAGE_KEY, theme);
|
|
2593
|
-
} catch {}
|
|
2594
|
-
}
|
|
2595
|
-
};
|
|
2596
|
-
// src/lib/core/config.ts
|
|
2597
|
-
/** The bridge (or the BFF) refused a setting; `field` is its dotted path when it names one. */
|
|
2598
|
-
var SettingRejected = class extends Error {
|
|
2599
|
-
field;
|
|
2600
|
-
constructor(message, field) {
|
|
2601
|
-
super(message);
|
|
2602
|
-
this.field = field;
|
|
2603
|
-
this.name = "SettingRejected";
|
|
2604
|
-
}
|
|
2605
|
-
};
|
|
2606
|
-
function flatten(value, path, into) {
|
|
2607
|
-
if (typeof value === "object" && value !== null && !Array.isArray(value)) for (const [key, inner] of Object.entries(value)) flatten(inner, path === "" ? key : `${path}.${key}`, into);
|
|
2608
|
-
else into.set(path, JSON.stringify(value));
|
|
2609
|
-
return into;
|
|
2610
|
-
}
|
|
2611
|
-
/**
|
|
2612
|
-
* The dotted paths of the settings whose saved value differs from the one in use: they wait for a
|
|
2613
|
-
* restart of the bridge.
|
|
2614
|
-
*/
|
|
2615
|
-
function pendingFields(active, saved) {
|
|
2616
|
-
const running = flatten(active, "", /* @__PURE__ */ new Map());
|
|
2617
|
-
return [...flatten(saved, "", /* @__PURE__ */ new Map())].filter(([path, value]) => running.get(path) !== value).map(([path]) => path);
|
|
2618
|
-
}
|
|
2619
|
-
var PORT_MESSAGE = "Enter a port from 1 to 65535.";
|
|
2620
|
-
/**
|
|
2621
|
-
* Reads a port as typed. Only whole numbers from 1 to 65535: the API also takes 0 (a random
|
|
2622
|
-
* port), but a voice that has its port built in can't find that one.
|
|
2623
|
-
*/
|
|
2624
|
-
function parsePort(text) {
|
|
2625
|
-
const trimmed = text.trim();
|
|
2626
|
-
if (!/^\d{1,5}$/.test(trimmed)) return {
|
|
2627
|
-
ok: false,
|
|
2628
|
-
message: PORT_MESSAGE
|
|
2629
|
-
};
|
|
2630
|
-
const port = Number(trimmed);
|
|
2631
|
-
return port >= 1 && port <= 65535 ? {
|
|
2632
|
-
ok: true,
|
|
2633
|
-
port
|
|
2634
|
-
} : {
|
|
2635
|
-
ok: false,
|
|
2636
|
-
message: PORT_MESSAGE
|
|
2637
|
-
};
|
|
2638
|
-
}
|
|
2639
|
-
var PLAYWRIGHT_VERSION_MESSAGE = "Enter an exact version like 1.65.0, or leave the field empty.";
|
|
2640
|
-
/** Reads a Playwright version as typed: an exact version, or empty for the bundled one (`null`). */
|
|
2641
|
-
function parsePlaywrightVersion(text) {
|
|
2642
|
-
const trimmed = text.trim();
|
|
2643
|
-
if (trimmed === "") return {
|
|
2644
|
-
ok: true,
|
|
2645
|
-
version: null
|
|
2646
|
-
};
|
|
2647
|
-
return EXACT_VERSION_PATTERN.test(trimmed) ? {
|
|
2648
|
-
ok: true,
|
|
2649
|
-
version: trimmed
|
|
2650
|
-
} : {
|
|
2651
|
-
ok: false,
|
|
2652
|
-
message: PLAYWRIGHT_VERSION_MESSAGE
|
|
2653
|
-
};
|
|
2654
|
-
}
|
|
2655
|
-
var { min: MIN_ENTRIES, max: MAX_ENTRIES } = CONFIG_LIMITS.maxEntries;
|
|
2656
|
-
var MAX_ENTRIES_MESSAGE = `Enter a whole number from ${MIN_ENTRIES} to ${MAX_ENTRIES}.`;
|
|
2657
|
-
/** Reads the size of the speech buffer as typed: a whole number within the API's limits. */
|
|
2658
|
-
function parseMaxEntries(text) {
|
|
2659
|
-
const trimmed = text.trim();
|
|
2660
|
-
const entries = /^\d+$/.test(trimmed) ? Number(trimmed) : NaN;
|
|
2661
|
-
return entries >= MIN_ENTRIES && entries <= MAX_ENTRIES ? {
|
|
2662
|
-
ok: true,
|
|
2663
|
-
entries
|
|
2664
|
-
} : {
|
|
2665
|
-
ok: false,
|
|
2666
|
-
message: MAX_ENTRIES_MESSAGE
|
|
2667
|
-
};
|
|
2668
|
-
}
|
|
2669
|
-
// src/lib/adapters/route-request.ts
|
|
2670
|
-
var defaultRejection = (error, status) => new Error(error?.message ?? `The request answered ${status}`);
|
|
2671
|
-
/** Calls one of the UI's own routes (`url` includes the base path) and rejects unless it is ok. */
|
|
2672
|
-
async function routeRequest(url, { method = "GET", body, signal, rejection = defaultRejection } = {}) {
|
|
2673
|
-
const response = await fetch(url, {
|
|
2674
|
-
method,
|
|
2675
|
-
headers: {
|
|
2676
|
-
accept: "application/json",
|
|
2677
|
-
...body === void 0 ? {} : { "content-type": "application/json" }
|
|
2678
|
-
},
|
|
2679
|
-
body: body === void 0 ? void 0 : JSON.stringify(body),
|
|
2680
|
-
signal
|
|
2681
|
-
});
|
|
2682
|
-
if (!response.ok) throw rejection(await readRouteError(response), response.status);
|
|
2683
|
-
return response;
|
|
2684
|
-
}
|
|
2685
|
-
/**
|
|
2686
|
-
* {@link routeRequest} for a JSON answer. It is not checked again: the BFF already checked the
|
|
2687
|
-
* bridge's answer against the contract (`lib/server/bridge-api.ts`), and only the UI calls its
|
|
2688
|
-
* routes. `T` is what the route answers.
|
|
2689
|
-
*/
|
|
2690
|
-
async function routeJson(url, request) {
|
|
2691
|
-
return await (await routeRequest(url, request)).json();
|
|
2692
|
-
}
|
|
2693
|
-
async function readRouteError(response) {
|
|
2694
|
-
const body = await response.json().catch(() => void 0);
|
|
2695
|
-
if (typeof body !== "object" || body === null || !("message" in body)) return null;
|
|
2696
|
-
const { message } = body;
|
|
2697
|
-
if (typeof message !== "string") return null;
|
|
2698
|
-
return {
|
|
2699
|
-
message,
|
|
2700
|
-
field: "field" in body && typeof body.field === "string" ? body.field : void 0
|
|
2701
|
-
};
|
|
2702
|
-
}
|
|
2703
|
-
// src/lib/adapters/http-config-api.ts
|
|
2704
|
-
/** A refused save names the bridge's reason (and the setting, when it names one). */
|
|
2705
|
-
var rejection = (error, status) => error === null ? /* @__PURE__ */ new Error(`The request answered ${status}`) : new SettingRejected(error.message, error.field);
|
|
2706
|
-
/** Reads and saves the configuration through the UI's own config route (`url` includes the base path). */
|
|
2707
|
-
var HttpConfigApi = class {
|
|
2708
|
-
url;
|
|
2709
|
-
constructor(url) {
|
|
2710
|
-
this.url = url;
|
|
2711
|
-
}
|
|
2712
|
-
/** `GET /ui/api/config` answers `{ active, saved, overrides }` in one go. */
|
|
2713
|
-
fetch() {
|
|
2714
|
-
return routeJson(this.url, { rejection });
|
|
2715
|
-
}
|
|
2716
|
-
update(patch) {
|
|
2717
|
-
return routeJson(this.url, {
|
|
2718
|
-
method: "PUT",
|
|
2719
|
-
body: patch,
|
|
2720
|
-
rejection
|
|
2721
|
-
});
|
|
2722
|
-
}
|
|
2723
|
-
};
|
|
2724
|
-
// src/lib/adapters/http-keys-api.ts
|
|
2725
|
-
/** Sends key presses through the UI's own route (`url` includes the base path). */
|
|
2726
|
-
var HttpKeysApi = class {
|
|
2727
|
-
url;
|
|
2728
|
-
constructor(url) {
|
|
2729
|
-
this.url = url;
|
|
2730
|
-
}
|
|
2731
|
-
async press(keys) {
|
|
2732
|
-
await routeRequest(this.url, {
|
|
2733
|
-
method: "POST",
|
|
2734
|
-
body: { keys }
|
|
2735
|
-
});
|
|
2736
|
-
}
|
|
2737
|
-
};
|
|
2738
|
-
// src/lib/adapters/http-speech-api.ts
|
|
2739
|
-
/** Changes the speech through the UI's own markers and speech routes (the urls include the base path). */
|
|
2740
|
-
var HttpSpeechApi = class {
|
|
2741
|
-
markersUrl;
|
|
2742
|
-
speechUrl;
|
|
2743
|
-
constructor(markersUrl, speechUrl) {
|
|
2744
|
-
this.markersUrl = markersUrl;
|
|
2745
|
-
this.speechUrl = speechUrl;
|
|
2746
|
-
}
|
|
2747
|
-
async addMarker(label) {
|
|
2748
|
-
await routeRequest(this.markersUrl, {
|
|
2749
|
-
method: "POST",
|
|
2750
|
-
body: { label }
|
|
2751
|
-
});
|
|
2752
|
-
}
|
|
2753
|
-
async clear(scope) {
|
|
2754
|
-
await routeRequest(`${this.speechUrl}?session=${scope}`, { method: "DELETE" });
|
|
2755
|
-
}
|
|
2756
|
-
};
|
|
2757
|
-
// src/lib/adapters/http-sessions-api.ts
|
|
2758
|
-
/**
|
|
2759
|
-
* Reads the sessions with the `getSessions` remote query and changes them through the UI's own
|
|
2760
|
-
* sessions routes (`url` includes the base path).
|
|
2761
|
-
*/
|
|
2762
|
-
var HttpSessionsApi = class {
|
|
2763
|
-
url;
|
|
2764
|
-
constructor(url) {
|
|
2765
|
-
this.url = url;
|
|
2766
|
-
}
|
|
2767
|
-
/** Always asks the server again: a query keeps its last answer while anything still uses it. */
|
|
2768
|
-
async list() {
|
|
2769
|
-
const sessions = getSessions();
|
|
2770
|
-
await sessions.refresh();
|
|
2771
|
-
return sessions.current;
|
|
2772
|
-
}
|
|
2773
|
-
start(name, run) {
|
|
2774
|
-
return routeJson(this.url, {
|
|
2775
|
-
method: "POST",
|
|
2776
|
-
body: {
|
|
2777
|
-
name,
|
|
2778
|
-
run
|
|
2779
|
-
}
|
|
2780
|
-
});
|
|
2781
|
-
}
|
|
2782
|
-
async end() {
|
|
2783
|
-
await routeRequest(`${this.url}/end`, { method: "POST" });
|
|
2784
|
-
}
|
|
2785
|
-
async delete(id) {
|
|
2786
|
-
await routeRequest(`${this.url}/${id}`, { method: "DELETE" });
|
|
2787
|
-
}
|
|
2788
|
-
};
|
|
2789
|
-
// src/lib/adapters/sse-speech-feed.ts
|
|
2790
|
-
/** Entries read per request when an ended session is read page by page. */
|
|
2791
|
-
var PAGE_SIZE = 1e3;
|
|
2792
|
-
/**
|
|
2793
|
-
* Reads the speech of a scope through the UI's own routes (`urls` include the base path):
|
|
2794
|
-
* - A live scope is followed on the stream relay with `?since=0`, so the bridge replays the
|
|
2795
|
-
* buffer first. `EventSource` reconnects by itself and sends `Last-Event-ID`, so a drop only
|
|
2796
|
-
* shows as `reconnecting` and the missed entries are replayed. A refused stream shows as
|
|
2797
|
-
* `failed`.
|
|
2798
|
-
* - An ended session never gets new entries: it is read page by page, once, without a stream.
|
|
2799
|
-
*/
|
|
2800
|
-
var SseSpeechFeed = class {
|
|
2801
|
-
streamUrl;
|
|
2802
|
-
speechUrl;
|
|
2803
|
-
constructor(streamUrl, speechUrl) {
|
|
2804
|
-
this.streamUrl = streamUrl;
|
|
2805
|
-
this.speechUrl = speechUrl;
|
|
2806
|
-
}
|
|
2807
|
-
open(scope, live, handlers) {
|
|
2808
|
-
handlers.onState("connecting");
|
|
2809
|
-
return live ? this.follow(scope, handlers) : this.read(scope, handlers);
|
|
2810
|
-
}
|
|
2811
|
-
listen(since, handlers) {
|
|
2812
|
-
const source = this.stream(`since=${since}`, (entry) => handlers.onEntry(entry));
|
|
2813
|
-
this.report(source, (state) => handlers.onState(state));
|
|
2814
|
-
return () => source.close();
|
|
2815
|
-
}
|
|
2816
|
-
follow(scope, handlers) {
|
|
2817
|
-
const source = this.stream(`session=${encodeURIComponent(String(scope))}&since=0`, (entry) => handlers.onEntry(entry));
|
|
2818
|
-
this.report(source, (state) => handlers.onState(state));
|
|
2819
|
-
source.addEventListener("clear", () => handlers.onClear());
|
|
2820
|
-
return () => source.close();
|
|
2821
|
-
}
|
|
2822
|
-
report(source, onState) {
|
|
2823
|
-
source.onopen = () => onState("live");
|
|
2824
|
-
source.onerror = () => onState(source.readyState === EventSource.CLOSED ? "failed" : "reconnecting");
|
|
2825
|
-
}
|
|
2826
|
-
stream(query, onEntry) {
|
|
2827
|
-
const source = new EventSource(`${this.streamUrl}?${query}`);
|
|
2828
|
-
source.addEventListener("entry", (event) => {
|
|
2829
|
-
let data;
|
|
2830
|
-
try {
|
|
2831
|
-
data = JSON.parse(event.data);
|
|
2832
|
-
} catch {
|
|
2833
|
-
return;
|
|
2834
|
-
}
|
|
2835
|
-
const checked = checkDto(SpeechEntrySchema, data);
|
|
2836
|
-
if (checked.ok) onEntry(checked.value);
|
|
2837
|
-
});
|
|
2838
|
-
return source;
|
|
2839
|
-
}
|
|
2840
|
-
read(scope, handlers) {
|
|
2841
|
-
const abort = new AbortController();
|
|
2842
|
-
const load = async () => {
|
|
2843
|
-
let since = 0;
|
|
2844
|
-
for (;;) {
|
|
2845
|
-
const query = new URLSearchParams({
|
|
2846
|
-
session: String(scope),
|
|
2847
|
-
since: String(since),
|
|
2848
|
-
limit: String(PAGE_SIZE)
|
|
2849
|
-
});
|
|
2850
|
-
const { entries, hasMore } = await routeJson(`${this.speechUrl}?${query}`, { signal: abort.signal });
|
|
2851
|
-
handlers.onEntries(entries);
|
|
2852
|
-
const last = entries.at(-1);
|
|
2853
|
-
if (!hasMore || last === void 0) return;
|
|
2854
|
-
since = last.seq;
|
|
2855
|
-
}
|
|
2856
|
-
};
|
|
2857
|
-
load().then(() => handlers.onState("ended"), () => {
|
|
2858
|
-
if (!abort.signal.aborted) handlers.onState("failed");
|
|
2859
|
-
});
|
|
2860
|
-
return () => abort.abort();
|
|
2861
|
-
}
|
|
2862
|
-
};
|
|
2863
|
-
// src/lib/adapters/http-status-api.ts
|
|
2864
|
-
/** Reads the bridge status through the UI's own status route (`url` includes the base path). */
|
|
2865
|
-
var HttpStatusApi = class {
|
|
2866
|
-
url;
|
|
2867
|
-
constructor(url) {
|
|
2868
|
-
this.url = url;
|
|
2869
|
-
}
|
|
2870
|
-
fetch() {
|
|
2871
|
-
return routeJson(this.url);
|
|
2872
|
-
}
|
|
2873
|
-
};
|
|
2874
|
-
// src/lib/core/sessions-pane.ts
|
|
2875
|
-
/** Parses the stored text; anything but `'1'` / `'0'` counts as no choice. */
|
|
2876
|
-
function parseCollapsed(raw) {
|
|
2877
|
-
if (raw === "1") return true;
|
|
2878
|
-
if (raw === "0") return false;
|
|
2879
|
-
return null;
|
|
2880
|
-
}
|
|
2881
|
-
function serializeCollapsed(collapsed) {
|
|
2882
|
-
return collapsed ? "1" : "0";
|
|
2883
|
-
}
|
|
2884
|
-
// src/lib/adapters/browser-sessions-pane-storage.ts
|
|
2885
|
-
var SESSIONS_PANE_STORAGE_KEY = "sr-sessions-collapsed";
|
|
2886
|
-
/** Keeps the sessions pane's collapsed choice in `localStorage`. */
|
|
2887
|
-
var BrowserSessionsPaneStorage = class {
|
|
2888
|
-
read() {
|
|
2889
|
-
try {
|
|
2890
|
-
return parseCollapsed(localStorage.getItem(SESSIONS_PANE_STORAGE_KEY));
|
|
2891
|
-
} catch {
|
|
2892
|
-
return null;
|
|
2893
|
-
}
|
|
2894
|
-
}
|
|
2895
|
-
write(collapsed) {
|
|
2896
|
-
try {
|
|
2897
|
-
localStorage.setItem(SESSIONS_PANE_STORAGE_KEY, serializeCollapsed(collapsed));
|
|
2898
|
-
} catch {}
|
|
2899
|
-
}
|
|
2900
|
-
};
|
|
2901
|
-
// src/lib/stores/config.svelte.ts
|
|
2902
|
-
function createConfigStore(api) {
|
|
2903
|
-
let state = null;
|
|
2904
|
-
let reachable = true;
|
|
2905
|
-
let inFlight = null;
|
|
2906
|
-
function read() {
|
|
2907
|
-
if (inFlight) return inFlight;
|
|
2908
|
-
inFlight = api.fetch().then((next) => {
|
|
2909
|
-
state = next;
|
|
2910
|
-
reachable = true;
|
|
2911
|
-
}).catch(() => {
|
|
2912
|
-
reachable = false;
|
|
2913
|
-
}).finally(() => {
|
|
2914
|
-
inFlight = null;
|
|
2915
|
-
});
|
|
2916
|
-
return inFlight;
|
|
2917
|
-
}
|
|
2918
|
-
return {
|
|
2919
|
-
/** Whether a configuration has been read yet. */
|
|
2920
|
-
get loaded() {
|
|
2921
|
-
return state !== null;
|
|
2922
|
-
},
|
|
2923
|
-
get reachable() {
|
|
2924
|
-
return reachable;
|
|
2925
|
-
},
|
|
2926
|
-
get active() {
|
|
2927
|
-
return state?.active ?? null;
|
|
2928
|
-
},
|
|
2929
|
-
get saved() {
|
|
2930
|
-
return state?.saved ?? null;
|
|
2931
|
-
},
|
|
2932
|
-
/** Settings a flag or variable sets, by dotted path, with what sets them. */
|
|
2933
|
-
get overrides() {
|
|
2934
|
-
return state?.overrides ?? {};
|
|
2935
|
-
},
|
|
2936
|
-
/** Dotted paths of the saved settings that wait for a restart. */
|
|
2937
|
-
get pending() {
|
|
2938
|
-
return state === null ? [] : pendingFields(state.active, state.saved);
|
|
2939
|
-
},
|
|
2940
|
-
/**
|
|
2941
|
-
* Shows the configuration the page's load read, before any request of its own. Call it while
|
|
2942
|
-
* the page renders, on the server too: the stores are per request, so the server's HTML and the
|
|
2943
|
-
* first browser render agree. Unlike a list that is polled, every load's answer replaces what
|
|
2944
|
-
* is shown; `null` (the load failed) changes nothing.
|
|
2945
|
-
*/
|
|
2946
|
-
seed(next) {
|
|
2947
|
-
if (next === null) return;
|
|
2948
|
-
state = next;
|
|
2949
|
-
reachable = true;
|
|
2950
|
-
},
|
|
2951
|
-
/** Reads the configuration now (also after a failed read, to try again). */
|
|
2952
|
-
refresh() {
|
|
2953
|
-
return read();
|
|
2954
|
-
},
|
|
2955
|
-
/** Saves a partial config for the next start. Rejects with the bridge's message. */
|
|
2956
|
-
async save(patch) {
|
|
2957
|
-
await api.update(patch);
|
|
2958
|
-
await inFlight;
|
|
2959
|
-
await read();
|
|
2960
|
-
}
|
|
2961
|
-
};
|
|
2962
|
-
}
|
|
2963
|
-
// src/lib/stores/sessions-pane.svelte.ts
|
|
2964
|
-
function createSessionsPaneStore(storage) {
|
|
2965
|
-
let collapsed = true;
|
|
2966
|
-
return {
|
|
2967
|
-
get collapsed() {
|
|
2968
|
-
return collapsed;
|
|
2969
|
-
},
|
|
2970
|
-
/** Pick up the saved choice. Call it in the browser only, after hydration. */
|
|
2971
|
-
init() {
|
|
2972
|
-
collapsed = storage.read() ?? false;
|
|
2973
|
-
},
|
|
2974
|
-
toggle() {
|
|
2975
|
-
collapsed = !collapsed;
|
|
2976
|
-
storage.write(collapsed);
|
|
2977
|
-
}
|
|
2978
|
-
};
|
|
2979
|
-
}
|
|
2980
|
-
// src/lib/stores/sessions.svelte.ts
|
|
2981
|
-
var REFRESH_MS = 3e3;
|
|
2982
|
-
function createSessionsStore(api) {
|
|
2983
|
-
let sessions = [];
|
|
2984
|
-
let currentId = null;
|
|
2985
|
-
let outsideEntries = 0;
|
|
2986
|
-
let reachable = true;
|
|
2987
|
-
let loaded = false;
|
|
2988
|
-
let now = Date.now();
|
|
2989
|
-
let inFlight = null;
|
|
2990
|
-
function apply(list, at = Date.now()) {
|
|
2991
|
-
sessions = list.sessions;
|
|
2992
|
-
currentId = list.currentId;
|
|
2993
|
-
outsideEntries = list.outsideEntries;
|
|
2994
|
-
now = at;
|
|
2995
|
-
loaded = true;
|
|
2996
|
-
}
|
|
2997
|
-
function read() {
|
|
2998
|
-
if (inFlight) return inFlight;
|
|
2999
|
-
inFlight = api.list().then((list) => {
|
|
3000
|
-
apply(list);
|
|
3001
|
-
reachable = true;
|
|
3002
|
-
}).catch(() => {
|
|
3003
|
-
reachable = false;
|
|
3004
|
-
}).finally(() => {
|
|
3005
|
-
inFlight = null;
|
|
3006
|
-
});
|
|
3007
|
-
return inFlight;
|
|
3008
|
-
}
|
|
3009
|
-
/** A read that started before the change would show the old list, so wait for it and read again. */
|
|
3010
|
-
async function refreshAfterChange() {
|
|
3011
|
-
await inFlight;
|
|
3012
|
-
await read();
|
|
3013
|
-
}
|
|
3014
|
-
return {
|
|
3015
|
-
get sessions() {
|
|
3016
|
-
return sessions;
|
|
3017
|
-
},
|
|
3018
|
-
get currentId() {
|
|
3019
|
-
return currentId;
|
|
3020
|
-
},
|
|
3021
|
-
/** Entries in the buffer recorded outside any session. */
|
|
3022
|
-
get outsideEntries() {
|
|
3023
|
-
return outsideEntries;
|
|
3024
|
-
},
|
|
3025
|
-
/** Whether a list has been applied yet (the seed or a read). */
|
|
3026
|
-
get loaded() {
|
|
3027
|
-
return loaded;
|
|
3028
|
-
},
|
|
3029
|
-
get reachable() {
|
|
3030
|
-
return reachable;
|
|
3031
|
-
},
|
|
3032
|
-
/** Epoch ms, ticking once a second while a session is live (for its duration). */
|
|
3033
|
-
get now() {
|
|
3034
|
-
return now;
|
|
3035
|
-
},
|
|
3036
|
-
/**
|
|
3037
|
-
* Shows the list the page's load read (`now`: when it was read), before any request of its
|
|
3038
|
-
* own. Call it while the page renders, on the server too: the stores are per request, so the
|
|
3039
|
-
* server's HTML and the first browser render agree. Does nothing once a list is shown.
|
|
3040
|
-
*/
|
|
3041
|
-
seed(list, at) {
|
|
3042
|
-
if (list !== null && !loaded) apply(list, at);
|
|
3043
|
-
},
|
|
3044
|
-
/**
|
|
3045
|
-
* Reads the list and keeps it fresh. Call it in the browser only. Returns the function that
|
|
3046
|
-
* stops the timers (call it when the page goes away).
|
|
3047
|
-
*/
|
|
3048
|
-
init() {
|
|
3049
|
-
read();
|
|
3050
|
-
const tick = setInterval(() => {
|
|
3051
|
-
if (currentId !== null) now = Date.now();
|
|
3052
|
-
}, 1e3);
|
|
3053
|
-
const refresh = setInterval(() => void read(), REFRESH_MS);
|
|
3054
|
-
return () => {
|
|
3055
|
-
clearInterval(tick);
|
|
3056
|
-
clearInterval(refresh);
|
|
3057
|
-
};
|
|
3058
|
-
},
|
|
3059
|
-
/** Reads the list now, for a change made elsewhere (the speech of a scope was cleared). */
|
|
3060
|
-
refresh() {
|
|
3061
|
-
return refreshAfterChange();
|
|
3062
|
-
},
|
|
3063
|
-
/** Starts a session, which ends the previous one. Rejects with the bridge's message. */
|
|
3064
|
-
async start(name, run) {
|
|
3065
|
-
const started = await api.start(name, run);
|
|
3066
|
-
await refreshAfterChange();
|
|
3067
|
-
return started;
|
|
3068
|
-
},
|
|
3069
|
-
async end() {
|
|
3070
|
-
await api.end();
|
|
3071
|
-
await refreshAfterChange();
|
|
3072
|
-
},
|
|
3073
|
-
/** Deletes an ended session. Rejects with the bridge's message. */
|
|
3074
|
-
async delete(id) {
|
|
3075
|
-
await api.delete(id);
|
|
3076
|
-
await refreshAfterChange();
|
|
3077
|
-
}
|
|
3078
|
-
};
|
|
3079
|
-
}
|
|
3080
|
-
// src/lib/core/speech.ts
|
|
3081
|
-
/** The table keeps this many rows; the oldest go first (the bridge's own buffer is capped too). */
|
|
3082
|
-
var MAX_ROWS = 5e3;
|
|
3083
|
-
/**
|
|
3084
|
-
* Whether a marker added now shows up in `scope`. The bridge files a marker under the current
|
|
3085
|
-
* session, or outside any session when none is current: it has no way to name another scope.
|
|
3086
|
-
*/
|
|
3087
|
-
function canAddMarker(scope, currentId) {
|
|
3088
|
-
return currentId === null ? scope === "none" : scope === currentId;
|
|
3089
|
-
}
|
|
3090
|
-
/**
|
|
3091
|
-
* Whether the log can clear `scope`: the current session or the speech outside sessions, the scopes
|
|
3092
|
-
* that can still receive speech. An ended session can only be deleted.
|
|
3093
|
-
*/
|
|
3094
|
-
function canClearSpeech(scope, currentId) {
|
|
3095
|
-
return isLiveScope(scope, currentId);
|
|
3096
|
-
}
|
|
3097
|
-
/** Whether the log can delete `scope`: an ended session, never the current one or the outside log. */
|
|
3098
|
-
function canDeleteSession(scope, currentId) {
|
|
3099
|
-
return scope !== "none" && scope !== currentId;
|
|
3100
|
-
}
|
|
3101
|
-
/** Whether new speech can still arrive in `scope`. */
|
|
3102
|
-
function isLiveScope(scope, currentId) {
|
|
3103
|
-
return scope === "none" || scope === currentId;
|
|
3104
|
-
}
|
|
3105
|
-
/** `14:03:07.042` in the browser's time zone. */
|
|
3106
|
-
function formatReceivedTime(iso) {
|
|
3107
|
-
const date = new Date(iso);
|
|
3108
|
-
if (Number.isNaN(date.getTime())) return iso;
|
|
3109
|
-
const two = (value) => String(value).padStart(2, "0");
|
|
3110
|
-
const millis = String(date.getMilliseconds()).padStart(3, "0");
|
|
3111
|
-
return `${two(date.getHours())}:${two(date.getMinutes())}:${two(date.getSeconds())}.${millis}`;
|
|
3112
|
-
}
|
|
3113
|
-
/** `Checkout flow #3`, or what the log shows when no session is selected. */
|
|
3114
|
-
function logHeading(scope, sessions) {
|
|
3115
|
-
if (scope === "none") return "Records outside sessions";
|
|
3116
|
-
const session = sessions.find((candidate) => candidate.id === scope);
|
|
3117
|
-
return session === void 0 ? `#${scope}` : `${session.name} #${session.id}`;
|
|
3118
|
-
}
|
|
3119
|
-
// src/lib/stores/speech.svelte.ts
|
|
3120
|
-
function createSpeechStore(feed, api) {
|
|
3121
|
-
let entries = [];
|
|
3122
|
-
let connection = "connecting";
|
|
3123
|
-
let close = null;
|
|
3124
|
-
function stop() {
|
|
3125
|
-
close?.();
|
|
3126
|
-
close = null;
|
|
3127
|
-
}
|
|
3128
|
-
/** Adds entries newer than the last one shown (a replay after a reconnect repeats some). */
|
|
3129
|
-
function append(added) {
|
|
3130
|
-
let lastSeq = entries.at(-1)?.seq ?? 0;
|
|
3131
|
-
const fresh = [];
|
|
3132
|
-
for (const entry of added) {
|
|
3133
|
-
if (entry.seq <= lastSeq) continue;
|
|
3134
|
-
fresh.push(entry);
|
|
3135
|
-
lastSeq = entry.seq;
|
|
3136
|
-
}
|
|
3137
|
-
if (fresh.length === 0) return;
|
|
3138
|
-
const next = [...entries, ...fresh];
|
|
3139
|
-
entries = next.length > 5e3 ? next.slice(next.length - MAX_ROWS) : next;
|
|
3140
|
-
}
|
|
3141
|
-
return {
|
|
3142
|
-
get entries() {
|
|
3143
|
-
return entries;
|
|
3144
|
-
},
|
|
3145
|
-
get connection() {
|
|
3146
|
-
return connection;
|
|
3147
|
-
},
|
|
3148
|
-
/**
|
|
3149
|
-
* Shows the speech of `scope`, replacing what was shown. A live scope replays the buffer and
|
|
3150
|
-
* follows; an ended session is read once. After a reconnect the stream resumes where it left
|
|
3151
|
-
* off, and an entry seen twice is dropped. Returns the function that stops the stream.
|
|
3152
|
-
*/
|
|
3153
|
-
open(scope, live) {
|
|
3154
|
-
stop();
|
|
3155
|
-
entries = [];
|
|
3156
|
-
connection = "connecting";
|
|
3157
|
-
close = feed.open(scope, live, {
|
|
3158
|
-
onEntry: (entry) => append([entry]),
|
|
3159
|
-
onEntries: append,
|
|
3160
|
-
onClear() {
|
|
3161
|
-
entries = [];
|
|
3162
|
-
},
|
|
3163
|
-
onState(state) {
|
|
3164
|
-
connection = state;
|
|
3165
|
-
}
|
|
3166
|
-
});
|
|
3167
|
-
return stop;
|
|
3168
|
-
},
|
|
3169
|
-
/** Rejects with the reason; the table empties through the feed (the bridge's `clear` event). */
|
|
3170
|
-
clear(scope) {
|
|
3171
|
-
return api.clear(scope);
|
|
3172
|
-
},
|
|
3173
|
-
/** Rejects with the reason; the new entry arrives through the feed, so nothing is added here. */
|
|
3174
|
-
addMarker(label) {
|
|
3175
|
-
return api.addMarker(label);
|
|
3176
|
-
}
|
|
3177
|
-
};
|
|
3178
|
-
}
|
|
3179
|
-
// src/lib/stores/status.svelte.ts
|
|
3180
|
-
function createStatusStore(api) {
|
|
3181
|
-
let status = null;
|
|
3182
|
-
let reachable = true;
|
|
3183
|
-
let loading = false;
|
|
3184
|
-
let inFlight = null;
|
|
3185
|
-
function read() {
|
|
3186
|
-
if (inFlight) return inFlight;
|
|
3187
|
-
loading = true;
|
|
3188
|
-
inFlight = api.fetch().then((next) => {
|
|
3189
|
-
status = next;
|
|
3190
|
-
reachable = true;
|
|
3191
|
-
}).catch(() => {
|
|
3192
|
-
reachable = false;
|
|
3193
|
-
}).finally(() => {
|
|
3194
|
-
loading = false;
|
|
3195
|
-
inFlight = null;
|
|
3196
|
-
});
|
|
3197
|
-
return inFlight;
|
|
3198
|
-
}
|
|
3199
|
-
return {
|
|
3200
|
-
get status() {
|
|
3201
|
-
return status;
|
|
3202
|
-
},
|
|
3203
|
-
get reachable() {
|
|
3204
|
-
return reachable;
|
|
3205
|
-
},
|
|
3206
|
-
get loading() {
|
|
3207
|
-
return loading;
|
|
3208
|
-
},
|
|
3209
|
-
/** Reads the status once; `seed` is the status the server rendered, so there is no flash. */
|
|
3210
|
-
init(seed) {
|
|
3211
|
-
if (seed && status === null) status = seed;
|
|
3212
|
-
read();
|
|
3213
|
-
},
|
|
3214
|
-
/** The refresh button. */
|
|
3215
|
-
retry() {
|
|
3216
|
-
return read();
|
|
3217
|
-
}
|
|
3218
|
-
};
|
|
3219
|
-
}
|
|
3220
|
-
// src/lib/stores/theme.svelte.ts
|
|
3221
|
-
function createThemeStore(storage) {
|
|
3222
|
-
let current = DEFAULT_THEME;
|
|
3223
|
-
return {
|
|
3224
|
-
get current() {
|
|
3225
|
-
return current;
|
|
3226
|
-
},
|
|
3227
|
-
/** Pick up the saved choice. Call it in the browser only, after hydration. */
|
|
3228
|
-
init() {
|
|
3229
|
-
current = storage.read() ?? "light";
|
|
3230
|
-
},
|
|
3231
|
-
/** Apply and remember a choice. */
|
|
3232
|
-
set(theme) {
|
|
3233
|
-
current = theme;
|
|
3234
|
-
storage.write(theme);
|
|
3235
|
-
}
|
|
3236
|
-
};
|
|
3237
|
-
}
|
|
3238
|
-
// src/lib/core/setup.ts
|
|
3239
|
-
/** The keys of the check: "read the window title" in NVDA and JAWS. */
|
|
3240
|
-
var CHECK_CHORD = "Insert+T";
|
|
3241
|
-
/** The marker in front of the check's keys, so the speech they cause is told apart. */
|
|
3242
|
-
var CHECK_MARKER = `ui: ${CHECK_CHORD}`;
|
|
3243
|
-
/** How long the check waits for speech someone makes by hand. */
|
|
3244
|
-
var LISTEN_TIMEOUT_MS = 3e4;
|
|
3245
|
-
/** How long it waits for speech after it sent the keys. */
|
|
3246
|
-
var KEYS_TIMEOUT_MS = 5e3;
|
|
3247
|
-
/** After the first speech, the check collects what follows until nothing came for this long. */
|
|
3248
|
-
var QUIET_MS = 1e3;
|
|
3249
|
-
/** The id of the screen reader heading in the Setup instructions, where the check links to. */
|
|
3250
|
-
var SCREEN_READER_ID = "screen-reader-heading";
|
|
3251
|
-
var DOCS_URL = "https://github.com/TimoSto/screenreader-speech-capture/blob";
|
|
3252
|
-
/**
|
|
3253
|
-
* A page of `docs/` on GitHub, as of the bridge's release. Only stable releases are tagged, so a
|
|
3254
|
-
* preview, a development build and an unknown version read `main`.
|
|
3255
|
-
*/
|
|
3256
|
-
function docsUrl(version, path) {
|
|
3257
|
-
return `${DOCS_URL}/${version !== null && /^\d+\.\d+\.\d+$/.test(version) ? `@screenreader-speech-capture/bridge@${version}` : "main"}/docs/${path}`;
|
|
3258
|
-
}
|
|
3259
|
-
/** Where the libraries behind a feature live, by the `backend` name the bridge reports. */
|
|
3260
|
-
var LIBRARY_REPOS = /* @__PURE__ */ new Map([["robotjs", "https://github.com/jitsi/robotjs"], ["koffi", "https://github.com/Koromix/koffi"]]);
|
|
3261
|
-
/** What the bridge itself knows about the setup, one row each. */
|
|
3262
|
-
function deriveCheckRows(status) {
|
|
3263
|
-
const link = (label, path) => ({
|
|
3264
|
-
label,
|
|
3265
|
-
href: docsUrl(status.bridge.version, path)
|
|
3266
|
-
});
|
|
3267
|
-
const row = (id, label, tone, state, help, library = null) => ({
|
|
3268
|
-
id,
|
|
3269
|
-
label,
|
|
3270
|
-
tone,
|
|
3271
|
-
state,
|
|
3272
|
-
library,
|
|
3273
|
-
help: tone === "ok" ? null : "path" in help ? link(help.label, help.path) : help
|
|
3274
|
-
});
|
|
3275
|
-
const { listening, port, encoding, connections } = status.tcp;
|
|
3276
|
-
const voices = [...new Set(connections.flatMap(({ voice }) => voice === null ? [] : [voice]))];
|
|
3277
|
-
const count = connections.length === 1 ? "1 connection" : `${connections.length} connections`;
|
|
3278
|
-
const input = (id, label, { available, backend, reason }, help) => row(id, label, available ? "ok" : "warning", available ? "Available" : `Not available: ${reason ?? "no reason given"}`, help, backend === null ? null : {
|
|
3279
|
-
name: backend,
|
|
3280
|
-
href: LIBRARY_REPOS.get(backend) ?? null
|
|
3281
|
-
});
|
|
3282
|
-
const service = (id, label, { state, version }) => {
|
|
3283
|
-
const [tone, words] = {
|
|
3284
|
-
running: ["ok", `Running, version ${version}`],
|
|
3285
|
-
starting: ["neutral", `Starting, version ${version}`],
|
|
3286
|
-
stopped: ["neutral", "Off"],
|
|
3287
|
-
crashed: ["warning", `Crashed, version ${version}. It restarts by itself.`],
|
|
3288
|
-
failed: ["warning", `Failed, version ${version}`]
|
|
3289
|
-
}[state];
|
|
3290
|
-
return row(id, label, tone, words, {
|
|
3291
|
-
label: "Child services",
|
|
3292
|
-
path: "usage/operations.md#child-service-crashes"
|
|
3293
|
-
});
|
|
3294
|
-
};
|
|
3295
|
-
return [
|
|
3296
|
-
row("listener", "Speech listener", listening ? "ok" : "warning", listening ? `Listening on port ${port} (${encoding})` : `Not listening on port ${port}`, {
|
|
3297
|
-
label: "Troubleshooting",
|
|
3298
|
-
path: "usage/troubleshooting.md#speech"
|
|
3299
|
-
}),
|
|
3300
|
-
row("voice", "Voice connected", connections.length > 0 ? "ok" : "neutral", connections.length > 0 ? `${count}${voices.length > 0 ? ` (voice ${voices.join(", ")})` : ""}` : "None yet: the voice connects with its first words", {
|
|
3301
|
-
label: "Select the voice",
|
|
3302
|
-
screenReader: true
|
|
3303
|
-
}),
|
|
3304
|
-
input("input", "Native input", status.input.native, {
|
|
3305
|
-
label: "Troubleshooting",
|
|
3306
|
-
path: "usage/troubleshooting.md#browser-and-input"
|
|
3307
|
-
}),
|
|
3308
|
-
input("focus", "Window focus", status.input.focus, {
|
|
3309
|
-
label: "Bringing the browser to the front",
|
|
3310
|
-
path: "usage/native-input.md#bringing-the-browser-to-the-front"
|
|
3311
|
-
}),
|
|
3312
|
-
service("playwright", "Playwright server", status.playwright),
|
|
3313
|
-
service("mcp", "Playwright MCP", status.mcp)
|
|
3314
|
-
];
|
|
3315
|
-
}
|
|
3316
|
-
// src/lib/stores/voice-check.svelte.ts
|
|
3317
|
-
function createVoiceCheckStore(statusApi, probe, keysApi, speechApi) {
|
|
3318
|
-
let phase = "idle";
|
|
3319
|
-
let via = "manual";
|
|
3320
|
-
let entries = [];
|
|
3321
|
-
let reconnecting = false;
|
|
3322
|
-
let failure = "";
|
|
3323
|
-
/** Counts the runs: whatever answers for an earlier one is ignored. */
|
|
3324
|
-
let run = 0;
|
|
3325
|
-
let close = null;
|
|
3326
|
-
let timer;
|
|
3327
|
-
/** Ends the current run: its stream, its timer and every answer still to come. */
|
|
3328
|
-
function finish() {
|
|
3329
|
-
run++;
|
|
3330
|
-
clearTimeout(timer);
|
|
3331
|
-
close?.();
|
|
3332
|
-
close = null;
|
|
3333
|
-
reconnecting = false;
|
|
3334
|
-
}
|
|
3335
|
-
function fail(message) {
|
|
3336
|
-
finish();
|
|
3337
|
-
phase = "failed";
|
|
3338
|
-
failure = message;
|
|
3339
|
-
}
|
|
3340
|
-
/** Gives up after `ms`. A lost connection is a failure, not silence. */
|
|
3341
|
-
function giveUpAfter(ms) {
|
|
3342
|
-
timer = setTimeout(() => {
|
|
3343
|
-
if (reconnecting) {
|
|
3344
|
-
fail("The connection to the bridge was lost.");
|
|
3345
|
-
return;
|
|
3346
|
-
}
|
|
3347
|
-
finish();
|
|
3348
|
-
phase = "silent";
|
|
3349
|
-
}, ms);
|
|
3350
|
-
}
|
|
3351
|
-
return {
|
|
3352
|
-
get phase() {
|
|
3353
|
-
return phase;
|
|
3354
|
-
},
|
|
3355
|
-
get via() {
|
|
3356
|
-
return via;
|
|
3357
|
-
},
|
|
3358
|
-
/** The speech that arrived, oldest first. */
|
|
3359
|
-
get entries() {
|
|
3360
|
-
return entries;
|
|
3361
|
-
},
|
|
3362
|
-
get reconnecting() {
|
|
3363
|
-
return reconnecting;
|
|
3364
|
-
},
|
|
3365
|
-
/** Why the check failed. */
|
|
3366
|
-
get failure() {
|
|
3367
|
-
return failure;
|
|
3368
|
-
},
|
|
3369
|
-
/**
|
|
3370
|
-
* Waits for new speech. With `keys` it also sends {@link CHECK_CHORD}, after a marker, and
|
|
3371
|
-
* only counts the speech after that marker. Replaces a run that is still going.
|
|
3372
|
-
*/
|
|
3373
|
-
async start(how) {
|
|
3374
|
-
finish();
|
|
3375
|
-
const mine = run;
|
|
3376
|
-
via = how;
|
|
3377
|
-
phase = "starting";
|
|
3378
|
-
entries = [];
|
|
3379
|
-
failure = "";
|
|
3380
|
-
let since;
|
|
3381
|
-
try {
|
|
3382
|
-
since = (await statusApi.fetch()).buffer.lastSeq ?? 0;
|
|
3383
|
-
} catch {
|
|
3384
|
-
if (mine === run) fail("The bridge is not reachable.");
|
|
3385
|
-
return;
|
|
3386
|
-
}
|
|
3387
|
-
if (mine !== run) return;
|
|
3388
|
-
let counting = how === "manual";
|
|
3389
|
-
phase = "listening";
|
|
3390
|
-
close = probe.listen(since, {
|
|
3391
|
-
onEntry(entry) {
|
|
3392
|
-
if (mine !== run) return;
|
|
3393
|
-
if (entry.kind === "marker") {
|
|
3394
|
-
if (entry.text === "ui: Insert+T") counting = true;
|
|
3395
|
-
return;
|
|
3396
|
-
}
|
|
3397
|
-
if (!counting) return;
|
|
3398
|
-
entries = [...entries, entry];
|
|
3399
|
-
phase = "heard";
|
|
3400
|
-
clearTimeout(timer);
|
|
3401
|
-
if (entries.length >= 5) finish();
|
|
3402
|
-
else timer = setTimeout(finish, QUIET_MS);
|
|
3403
|
-
},
|
|
3404
|
-
onState(state) {
|
|
3405
|
-
if (mine !== run) return;
|
|
3406
|
-
if (state !== "failed") reconnecting = state === "reconnecting";
|
|
3407
|
-
else if (phase === "heard") finish();
|
|
3408
|
-
else fail("The speech stream is not available.");
|
|
3409
|
-
}
|
|
3410
|
-
});
|
|
3411
|
-
if (how === "manual") {
|
|
3412
|
-
giveUpAfter(LISTEN_TIMEOUT_MS);
|
|
3413
|
-
return;
|
|
3414
|
-
}
|
|
3415
|
-
try {
|
|
3416
|
-
await speechApi.addMarker(CHECK_MARKER);
|
|
3417
|
-
if (mine !== run) return;
|
|
3418
|
-
await keysApi.press(CHECK_CHORD);
|
|
3419
|
-
} catch (cause) {
|
|
3420
|
-
if (mine === run && entries.length === 0) fail(cause instanceof Error ? cause.message : "The keys could not be sent.");
|
|
3421
|
-
return;
|
|
3422
|
-
}
|
|
3423
|
-
if (mine === run && entries.length === 0) giveUpAfter(KEYS_TIMEOUT_MS);
|
|
3424
|
-
},
|
|
3425
|
-
/** Stops listening and forgets the result. */
|
|
3426
|
-
stop() {
|
|
3427
|
-
finish();
|
|
3428
|
-
phase = "idle";
|
|
3429
|
-
entries = [];
|
|
3430
|
-
failure = "";
|
|
3431
|
-
}
|
|
3432
|
-
};
|
|
3433
|
-
}
|
|
3434
|
-
// src/lib/composition.ts
|
|
3435
|
-
/** Wires the adapters into the stores; components get the stores, never the adapters. */
|
|
3436
|
-
function createAppStores() {
|
|
3437
|
-
const statusApi = new HttpStatusApi(resolve("/api/status"));
|
|
3438
|
-
const speechFeed = new SseSpeechFeed(resolve("/api/speech/stream"), resolve("/api/speech"));
|
|
3439
|
-
const speechApi = new HttpSpeechApi(resolve("/api/markers"), resolve("/api/speech"));
|
|
3440
|
-
const clipboard = new BrowserClipboard();
|
|
3441
|
-
return {
|
|
3442
|
-
theme: createThemeStore(new BrowserThemeStorage()),
|
|
3443
|
-
status: createStatusStore(statusApi),
|
|
3444
|
-
config: createConfigStore(new HttpConfigApi(resolve("/api/config"))),
|
|
3445
|
-
sessions: createSessionsStore(new HttpSessionsApi(resolve("/api/sessions"))),
|
|
3446
|
-
speech: createSpeechStore(speechFeed, speechApi),
|
|
3447
|
-
voiceCheck: createVoiceCheckStore(statusApi, speechFeed, new HttpKeysApi(resolve("/api/input/keys")), speechApi),
|
|
3448
|
-
sessionsPane: createSessionsPaneStore(new BrowserSessionsPaneStorage()),
|
|
3449
|
-
/** A port without state, so there is no store around it. */
|
|
3450
|
-
clipboard
|
|
3451
|
-
};
|
|
3452
|
-
}
|
|
2552
|
+
// src/lib/app-context.ts
|
|
3453
2553
|
/** The context key of the stores (component tests pass their own stores under it). */
|
|
3454
2554
|
var APP_STORES = Symbol("app-stores");
|
|
3455
|
-
/**
|
|
3456
|
-
* Creates the stores of one app and hands them to the components below (the root layout calls it).
|
|
3457
|
-
* Not a module-level singleton: on the server every request renders its own app, and a store
|
|
3458
|
-
* shared by all of them would show one viewer's state to another.
|
|
3459
|
-
*/
|
|
3460
|
-
function provideAppStores() {
|
|
3461
|
-
return setContext(APP_STORES, createAppStores());
|
|
3462
|
-
}
|
|
3463
|
-
/** The stores {@link provideAppStores} created. Call it while a component initialises. */
|
|
2555
|
+
/** The stores the root layout provided. Call it while a component initialises. */
|
|
3464
2556
|
function appStores() {
|
|
3465
2557
|
const stores = getContext(APP_STORES);
|
|
3466
2558
|
if (stores === void 0) throw new Error("appStores() needs provideAppStores() in a parent");
|
|
3467
2559
|
return stores;
|
|
3468
2560
|
}
|
|
3469
|
-
export {
|
|
2561
|
+
export { t$3 as A, b as C, r$1 as D, e$4 as E, n$1 as O, Z as S, e$3 as T, i$1 as _, mixinFormAssociated as a, E as b, afterDispatch as c, EASING as d, createAnimationSignal as f, t as g, i as h, getFormValue as i, __decorate as j, i$3 as k, setupDispatchHooks as l, e$1 as m, appStores as n, internals as o, e as p, mixinFormSubmitter as r, mixinElementInternals as s, APP_STORES as t, mixinDelegatesAria as u, A as v, w, T as x, B as y };
|
|
3470
2562
|
|
|
3471
|
-
//# sourceMappingURL=
|
|
2563
|
+
//# sourceMappingURL=app-context.js.map
|