@screenreader-speech-capture/bridge 0.1.0-feat-expected-target-window.34 → 0.1.0
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 +1002 -934
- package/dist/ui/adapter-node.js +1 -1
- package/dist/ui/client/ui/_app/immutable/chunks/{BnU72Mow.js → BfHif6xP.js} +1 -1
- 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/{BS7n1gMj.js → BrPqgVT6.js} +1 -1
- 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/{CK3uUd4t.js → C7D7xLuA.js} +1 -1
- 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/{B1Ryegye.js → Cc902J0D.js} +1 -1
- 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/{CMWEX9XL.js → D9JU-e3z.js} +1 -1
- 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/{DOY87jO2.js → KD5R77Wj.js} +1 -1
- 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/{B1vArRqi.js → PzCUpBms.js} +1 -1
- 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/{4wvZDMeR.js → Roub4aju.js} +1 -1
- 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/{tKonUL5Y.js → ux9AxWa3.js} +1 -1
- 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.C8tsut3X.js → app.DM2PRoLw.js} +2 -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/nodes/0.fKLM0nQo.js +1 -0
- 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/{3.WT26F_BF.js → 3.CywuMQ0y.js} +1 -1
- 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.tiDJxi6M.js → 4.BYvsTY13.js} +1 -1
- 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.MzfJoePg.js → 5.xWNFTFjr.js} +1 -1
- 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.bNZhqiRK.js → 6.Dnf8S10l.js} +1 -1
- 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/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/chunks/composition.js +8 -5
- package/dist/ui/server/chunks/composition.js.map +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/src.js +19 -13
- package/dist/ui/server/chunks/src.js.map +1 -1
- package/dist/ui/server/entries/hooks.server.js +3 -2
- package/dist/ui/server/entries/hooks.server.js.map +1 -1
- package/dist/ui/server/entries/pages/_layout.svelte.js +1 -1
- package/dist/ui/server/entries/pages/_layout.svelte.js.map +1 -1
- package/dist/ui/server/entries/pages/setup/instructions/_page.svelte.js +1 -1
- 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/3.js +1 -1
- package/dist/ui/server/nodes/4.js +1 -1
- 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/chunks/4wvZDMeR.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/4wvZDMeR.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1Ryegye.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1Ryegye.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1vArRqi.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/B1vArRqi.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BS7n1gMj.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BS7n1gMj.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BnU72Mow.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/BnU72Mow.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CK3uUd4t.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CK3uUd4t.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CMWEX9XL.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/CMWEX9XL.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DOY87jO2.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/DOY87jO2.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/tKonUL5Y.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/chunks/tKonUL5Y.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.C8tsut3X.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/entry/app.C8tsut3X.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.3bVKqGbx.js +0 -1
- package/dist/ui/client/ui/_app/immutable/nodes/0.3bVKqGbx.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/0.3bVKqGbx.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.WT26F_BF.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/3.WT26F_BF.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.tiDJxi6M.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/4.tiDJxi6M.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.MzfJoePg.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/5.MzfJoePg.js.gz +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.bNZhqiRK.js.br +0 -0
- package/dist/ui/client/ui/_app/immutable/nodes/6.bNZhqiRK.js.gz +0 -0
|
@@ -114,7 +114,8 @@ function bridgeApiFromEnv(fetchFn) {
|
|
|
114
114
|
// src/lib/server/log.ts
|
|
115
115
|
/**
|
|
116
116
|
* Where the bridge puts its `[web-ui]` logger before it loads the UI (`UI_LOGGER_KEY` in
|
|
117
|
-
* `packages/bridge/src/
|
|
117
|
+
* `packages/bridge/src/adapters/in/http/ui-mount.ts`; the bridge and the UI don't import each
|
|
118
|
+
* other).
|
|
118
119
|
*/
|
|
119
120
|
var BRIDGE_LOGGER_KEY = Symbol.for("screenreader-speech-capture.ui-logger");
|
|
120
121
|
function isServerLog(value) {
|
|
@@ -135,7 +136,7 @@ function serverLog() {
|
|
|
135
136
|
}
|
|
136
137
|
// src/hooks.server.ts
|
|
137
138
|
/**
|
|
138
|
-
* Set by the bridge (`LOCAL_HEADER` in `packages/bridge/src/
|
|
139
|
+
* Set by the bridge (`LOCAL_HEADER` in `packages/bridge/src/adapters/in/http/ui-mount.ts`) on a request that
|
|
139
140
|
* comes from the bridge's own machine, and removed from every other one. The UI can't import it:
|
|
140
141
|
* the bridge and the UI don't depend on each other.
|
|
141
142
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.server.js","names":["env"],"sources":["../../../../shared/src/api-version.ts","../../../.svelte-kit/generated/build/env/private/server.js","../../../src/lib/server/bridge-api.ts","../../../src/lib/server/bridge-from-env.ts","../../../src/lib/server/log.ts","../../../src/hooks.server.ts"],"sourcesContent":["/**\n * `<major>.<minor>` of the HTTP API. Minor versions only add things, with the exceptions in\n * docs/usage/http-api.md#versioning. Within a major version the enums of the answers never grow\n * (`openapi/freeze.test.ts`).\n */\nexport const API_VERSION = '1.32';\n\n/** Path prefix of every API route. */\nexport const API_PREFIX = '/api/v1';\n\n/**\n * Response header with {@link API_VERSION} on every answer under {@link API_PREFIX} (since 1.22),\n * so a client checks the version on each answer instead of asking `GET /status` first.\n */\nexport const API_VERSION_HEADER = 'X-SR-Speech-Api-Version';\n","import { dynamic_private_env as env } from '../config.js';\n\nexport const SR_BRIDGE_API_URL = env.SR_BRIDGE_API_URL;\n","import { error } from '@sveltejs/kit';\nimport {\n AnyErrorBodySchema,\n API_PREFIX,\n CLIENT_HEADER,\n checkDto,\n ConfigOverridesSchema,\n ConfigSchema,\n SessionListSchema,\n SpeechEntrySchema,\n SpeechListSchema,\n StartSessionResponseSchema,\n StatusSchema,\n type ConfigDto,\n type ConfigOverridesDto,\n type ConfigPatchDto,\n type DtoOf,\n type DtoSchema,\n type KeysRequestDto,\n type SessionListDto,\n type SpeechEntryDto,\n type SpeechListDto,\n type StartSessionRequestDto,\n type StartSessionResponseDto,\n type StatusDto,\n} from '@screenreader-speech-capture/shared';\nimport type { SessionScope } from '#lib/core/sessions.js';\n\ntype Fetch = typeof fetch;\n\n/** The bridge's HTTP API as the BFF uses it: the only place the UI server talks to the bridge. */\nexport interface BridgeApi {\n status(): Promise<StatusDto>;\n sessions(): Promise<SessionListDto>;\n startSession(request: StartSessionRequestDto): Promise<StartSessionResponseDto>;\n /** Ends the current session; does nothing if none is current. */\n endSession(): Promise<void>;\n /** Deletes an ended session and its speech (the bridge refuses the current one). */\n deleteSession(id: number): Promise<void>;\n /** Clears the speech of the current session or of `none` (`session`: an id or `none`); it keeps running. */\n clearSpeech(session: SessionScope): Promise<void>;\n /** The configuration in use (`active`) or the one the next start will use (`saved`). */\n config(view: 'active' | 'saved'): Promise<ConfigDto>;\n /** The settings a flag or environment variable sets: the config file can't change them. */\n configOverrides(): Promise<ConfigOverridesDto>;\n /**\n * Saves a partial config for the next start and answers with the saved config. Rejects with the\n * bridge's status and message, plus `field` (`tcp.port`) when the bridge names one.\n */\n updateConfig(patch: ConfigPatchDto): Promise<ConfigDto>;\n /** Presses keys in the foreground window of the bridge's machine. */\n pressKeys(keys: KeysRequestDto['keys']): Promise<void>;\n /** Inserts a marker; the bridge files it under the current session (or outside any). */\n addMarker(label: string): Promise<SpeechEntryDto>;\n /** One page of a scope's entries with `seq > since`, oldest first (`session`: an id or `none`). */\n speech(session: SessionScope | null, since: number, limit: number): Promise<SpeechListDto>;\n /**\n * Opens the bridge's SSE stream (`session`: an id or `none`). The body is passed on as it is,\n * so `Last-Event-ID` replays and every event name reach the browser untouched.\n */\n openSpeechStream(\n session: SessionScope | null,\n lastEventId: string | null,\n signal: AbortSignal,\n ): Promise<Response>;\n}\n\n/** Named in the bridge's logs when this UI ends or replaces another client's session. */\nconst UI_CLIENT = 'web-ui';\n\n/**\n * `baseUrl` is the bridge's origin (no path). `fetchFn` is SvelteKit's `event.fetch` in\n * routes and a fake in tests.\n */\nexport function createBridgeApi(baseUrl: string, fetchFn: Fetch): BridgeApi {\n const root = baseUrl.replace(/\\/+$/, '') + API_PREFIX;\n // SvelteKit's `event.fetch` adds `Origin: <the UI's own origin>` to every call to another origin\n // (`pnpm dev:ui`: http://localhost:5173). The bridge refuses a POST from any origin but its own\n // (docs/usage/security.md#host-and-origin), so name the bridge itself: this is a server-side\n // call, not a page of another site.\n const origin = new URL(root).origin;\n\n async function call(\n method: 'GET' | 'POST' | 'PUT' | 'DELETE',\n path: string,\n body?: unknown,\n ): Promise<unknown> {\n let response: Response;\n try {\n response = await fetchFn(`${root}${path}`, {\n method,\n headers: {\n accept: 'application/json',\n origin,\n [CLIENT_HEADER]: UI_CLIENT,\n ...(body === undefined ? {} : { 'content-type': 'application/json' }),\n },\n body: body === undefined ? undefined : JSON.stringify(body),\n });\n } catch (cause) {\n error(502, `The bridge is not reachable: ${describe(cause)}`);\n }\n const answer: unknown = await response.json().catch(() => undefined);\n if (!response.ok) {\n const apiError = checkDto(AnyErrorBodySchema, answer);\n if (!apiError.ok) error(response.status, `The bridge answered ${response.status}`);\n const { message, details } = apiError.value.error;\n const field = details?.field;\n if (typeof field === 'string') error(response.status, { message, field });\n error(response.status, message);\n }\n return answer;\n }\n\n async function read<S extends DtoSchema>(\n method: 'GET' | 'POST' | 'PUT',\n path: string,\n schema: S,\n body?: unknown,\n ): Promise<DtoOf<S>> {\n const checked = checkDto(schema, await call(method, path, body));\n if (!checked.ok) {\n error(502, `Unexpected answer from the bridge at ${checked.field}: ${checked.message}`);\n }\n return checked.value;\n }\n\n return {\n status: () => read('GET', '/status', StatusSchema),\n sessions: () => read('GET', '/sessions', SessionListSchema),\n startSession: (request) => read('POST', '/sessions', StartSessionResponseSchema, request),\n endSession: async () => {\n await call('POST', '/sessions/end');\n },\n deleteSession: async (id) => {\n await call('DELETE', `/sessions?session=${id}`);\n },\n clearSpeech: async (session) => {\n await call('DELETE', `/speech?session=${session}`);\n },\n config: (view) => read('GET', `/config?view=${view}`, ConfigSchema),\n configOverrides: () => read('GET', '/config/overrides', ConfigOverridesSchema),\n updateConfig: (patch) => read('PUT', '/config', ConfigSchema, patch),\n pressKeys: async (keys) => {\n await call('POST', '/input/keys', { keys });\n },\n addMarker: (label) => read('POST', '/markers', SpeechEntrySchema, { label }),\n speech: (session, since, limit) => {\n const query = new URLSearchParams({ since: String(since), limit: String(limit) });\n if (session !== null) query.set('session', String(session));\n return read('GET', `/speech?${query}`, SpeechListSchema);\n },\n openSpeechStream: async (session, lastEventId, signal) => {\n const query = session === null ? '' : `?session=${session}`;\n let response: Response;\n try {\n response = await fetchFn(`${root}/speech/stream${query}`, {\n headers: {\n accept: 'text/event-stream',\n origin,\n [CLIENT_HEADER]: UI_CLIENT,\n ...(lastEventId === null ? {} : { 'last-event-id': lastEventId }),\n },\n signal,\n });\n } catch (cause) {\n error(502, `The bridge is not reachable: ${describe(cause)}`);\n }\n if (!response.ok || response.body === null) {\n // Unread, the body would hold the bridge connection until it is garbage collected, and\n // `EventSource` retries every few seconds while the bridge refuses.\n await response.body?.cancel().catch(() => undefined);\n error(\n response.status === 200 ? 502 : response.status,\n 'The speech stream is not available',\n );\n }\n return response;\n },\n };\n}\n\nfunction describe(cause: unknown): string {\n return cause instanceof Error ? cause.message : String(cause);\n}\n","import { SR_BRIDGE_API_URL } from '$app/env/private';\nimport { createBridgeApi, type BridgeApi } from './bridge-api.js';\n\n/** The bridge API of this deployment, at `SR_BRIDGE_API_URL` (`src/env.ts`). */\nexport function bridgeApiFromEnv(fetchFn: typeof fetch): BridgeApi {\n return createBridgeApi(SR_BRIDGE_API_URL, fetchFn);\n}\n","/** What the BFF logs through: the bridge's `Logger` port, as far as the UI uses it. */\nexport interface ServerLog {\n error(message: string): void;\n warn(message: string): void;\n}\n\n/**\n * Where the bridge puts its `[web-ui]` logger before it loads the UI (`UI_LOGGER_KEY` in\n * `packages/bridge/src/composition/ui.ts`; the bridge and the UI don't import each other).\n */\nconst BRIDGE_LOGGER_KEY = Symbol.for('screenreader-speech-capture.ui-logger');\n\nfunction isServerLog(value: unknown): value is ServerLog {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as ServerLog).error === 'function' &&\n typeof (value as ServerLog).warn === 'function'\n );\n}\n\n/** `pnpm dev:ui` has no bridge in its process: the Vite dev server's console stands in. */\nconst consoleLog: ServerLog = {\n error: (message) => console.error(`[web-ui] ${message}`),\n warn: (message) => console.warn(`[web-ui] ${message}`),\n};\n\n/**\n * The bridge log inside the bridge, the console otherwise. Read per call, so it doesn't matter\n * whether this module loads before or after the bridge sets it.\n */\nexport function serverLog(): ServerLog {\n const bridge = (globalThis as Record<symbol, unknown>)[BRIDGE_LOGGER_KEY];\n return isServerLog(bridge) ? bridge : consoleLog;\n}\n","import type { Handle, HandleServerError } from '@sveltejs/kit/hooks';\nimport { bridgeApiFromEnv } from '#lib/server/bridge-from-env.js';\nimport { serverLog } from '#lib/server/log.js';\n\n/**\n * Set by the bridge (`LOCAL_HEADER` in `packages/bridge/src/composition/ui.ts`) on a request that\n * comes from the bridge's own machine, and removed from every other one. The UI can't import it:\n * the bridge and the UI don't depend on each other.\n */\nconst LOCAL_HEADER = 'x-sr-bridge-local';\n\nexport const handle: Handle = ({ event, resolve }) => {\n event.locals.local = event.request.headers.get(LOCAL_HEADER) === '1';\n // Built once per request and with its `fetch`, so routes and loads share one way to the bridge.\n event.locals.bridge = bridgeApiFromEnv(event.fetch);\n return resolve(event);\n};\n\n/**\n * An unexpected error (`kind: 'unknown'`: not one thrown with `error()`, not SvelteKit's own such\n * as a 404) is one line in the bridge log; the browser keeps SvelteKit's generic answer. The line\n * names the path but never the query, which can hold speech text that must stay off the console\n * (docs/usage/operations.md#speech-text-stays-off-the-console).\n */\nexport const handleError: HandleServerError = ({ kind, error, event }) => {\n if (kind !== 'unknown') return;\n const reason = error instanceof Error ? `${error.name}: ${error.message}` : String(error);\n serverLog().error(`${event.request.method} ${event.url.pathname}: ${reason}`);\n};\n"],"mappings":";;;;;AAQA,IAAa,aAAa;;ACN1B,IAAa,oBAAoBA,oBAAI;;;ACkErC,IAAM,YAAY;;;;;AAMlB,SAAgB,gBAAgB,SAAiB,SAA2B;CAC1E,MAAM,OAAO,QAAQ,QAAQ,QAAQ,EAAE,IAAI;CAK3C,MAAM,SAAS,IAAI,IAAI,IAAI,CAAC,CAAC;CAE7B,eAAe,KACb,QACA,MACA,MACkB;EAClB,IAAI;EACJ,IAAI;GACF,WAAW,MAAM,QAAQ,GAAG,OAAO,QAAQ;IACzC;IACA,SAAS;KACP,QAAQ;KACR;MACC,gBAAgB;KACjB,GAAI,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,gBAAgB,mBAAmB;IACrE;IACA,MAAM,SAAS,KAAA,IAAY,KAAA,IAAY,KAAK,UAAU,IAAI;GAC5D,CAAC;EACH,SAAS,OAAO;GACd,MAAM,KAAK,gCAAgC,SAAS,KAAK,GAAG;EAC9D;EACA,MAAM,SAAkB,MAAM,SAAS,KAAK,CAAC,CAAC,YAAY,KAAA,CAAS;EACnE,IAAI,CAAC,SAAS,IAAI;GAChB,MAAM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ErB,IAAa,UAAkB,EAAE,OAAO,cAAc;CACpD,MAAM,OAAO,QAAQ,MAAM,QAAQ,QAAQ,IAAI,YAAY,MAAM;CAEjE,MAAM,OAAO,SAAS,iBAAiB,MAAM,KAAK;CAClD,OAAO,QAAQ,KAAK;AACtB;;;;;;;AAQA,IAAa,eAAkC,EAAE,MAAM,OAAO,YAAY;CACxE,IAAI,SAAS,WAAW;CACxB,MAAM,SAAS,iBAAiB,QAAQ,GAAG,MAAM,KAAK,IAAI,MAAM,YAAY,OAAO,KAAK;CACxF,UAAU,CAAC,CAAC,MAAM,GAAG,MAAM,QAAQ,OAAO,GAAG,MAAM,IAAI,SAAS,IAAI,QAAQ;AAC9E"}
|
|
1
|
+
{"version":3,"file":"hooks.server.js","names":["env"],"sources":["../../../../shared/src/api-version.ts","../../../.svelte-kit/generated/build/env/private/server.js","../../../src/lib/server/bridge-api.ts","../../../src/lib/server/bridge-from-env.ts","../../../src/lib/server/log.ts","../../../src/hooks.server.ts"],"sourcesContent":["/**\n * `<major>.<minor>` of the HTTP API. Minor versions only add things, with the exceptions in\n * docs/usage/http-api.md#versioning. Within a major version the enums of the answers never grow\n * (`openapi/freeze.test.ts`).\n */\nexport const API_VERSION = '1.33';\n\n/** Path prefix of every API route. */\nexport const API_PREFIX = '/api/v1';\n\n/**\n * Response header with {@link API_VERSION} on every answer under {@link API_PREFIX} (since 1.22),\n * so a client checks the version on each answer instead of asking `GET /status` first.\n */\nexport const API_VERSION_HEADER = 'X-SR-Speech-Api-Version';\n","import { dynamic_private_env as env } from '../config.js';\n\nexport const SR_BRIDGE_API_URL = env.SR_BRIDGE_API_URL;\n","import { error } from '@sveltejs/kit';\nimport {\n AnyErrorBodySchema,\n API_PREFIX,\n CLIENT_HEADER,\n checkDto,\n ConfigOverridesSchema,\n ConfigSchema,\n SessionListSchema,\n SpeechEntrySchema,\n SpeechListSchema,\n StartSessionResponseSchema,\n StatusSchema,\n type ConfigDto,\n type ConfigOverridesDto,\n type ConfigPatchDto,\n type DtoOf,\n type DtoSchema,\n type KeysRequestDto,\n type SessionListDto,\n type SpeechEntryDto,\n type SpeechListDto,\n type StartSessionRequestDto,\n type StartSessionResponseDto,\n type StatusDto,\n} from '@screenreader-speech-capture/shared';\nimport type { SessionScope } from '#lib/core/sessions.js';\n\ntype Fetch = typeof fetch;\n\n/** The bridge's HTTP API as the BFF uses it: the only place the UI server talks to the bridge. */\nexport interface BridgeApi {\n status(): Promise<StatusDto>;\n sessions(): Promise<SessionListDto>;\n startSession(request: StartSessionRequestDto): Promise<StartSessionResponseDto>;\n /** Ends the current session; does nothing if none is current. */\n endSession(): Promise<void>;\n /** Deletes an ended session and its speech (the bridge refuses the current one). */\n deleteSession(id: number): Promise<void>;\n /** Clears the speech of the current session or of `none` (`session`: an id or `none`); it keeps running. */\n clearSpeech(session: SessionScope): Promise<void>;\n /** The configuration in use (`active`) or the one the next start will use (`saved`). */\n config(view: 'active' | 'saved'): Promise<ConfigDto>;\n /** The settings a flag or environment variable sets: the config file can't change them. */\n configOverrides(): Promise<ConfigOverridesDto>;\n /**\n * Saves a partial config for the next start and answers with the saved config. Rejects with the\n * bridge's status and message, plus `field` (`tcp.port`) when the bridge names one.\n */\n updateConfig(patch: ConfigPatchDto): Promise<ConfigDto>;\n /** Presses keys in the foreground window of the bridge's machine. */\n pressKeys(keys: KeysRequestDto['keys']): Promise<void>;\n /** Inserts a marker; the bridge files it under the current session (or outside any). */\n addMarker(label: string): Promise<SpeechEntryDto>;\n /** One page of a scope's entries with `seq > since`, oldest first (`session`: an id or `none`). */\n speech(session: SessionScope | null, since: number, limit: number): Promise<SpeechListDto>;\n /**\n * Opens the bridge's SSE stream (`session`: an id or `none`). The body is passed on as it is,\n * so `Last-Event-ID` replays and every event name reach the browser untouched.\n */\n openSpeechStream(\n session: SessionScope | null,\n lastEventId: string | null,\n signal: AbortSignal,\n ): Promise<Response>;\n}\n\n/** Named in the bridge's logs when this UI ends or replaces another client's session. */\nconst UI_CLIENT = 'web-ui';\n\n/**\n * `baseUrl` is the bridge's origin (no path). `fetchFn` is SvelteKit's `event.fetch` in\n * routes and a fake in tests.\n */\nexport function createBridgeApi(baseUrl: string, fetchFn: Fetch): BridgeApi {\n const root = baseUrl.replace(/\\/+$/, '') + API_PREFIX;\n // SvelteKit's `event.fetch` adds `Origin: <the UI's own origin>` to every call to another origin\n // (`pnpm dev:ui`: http://localhost:5173). The bridge refuses a POST from any origin but its own\n // (docs/usage/security.md#host-and-origin), so name the bridge itself: this is a server-side\n // call, not a page of another site.\n const origin = new URL(root).origin;\n\n async function call(\n method: 'GET' | 'POST' | 'PUT' | 'DELETE',\n path: string,\n body?: unknown,\n ): Promise<unknown> {\n let response: Response;\n try {\n response = await fetchFn(`${root}${path}`, {\n method,\n headers: {\n accept: 'application/json',\n origin,\n [CLIENT_HEADER]: UI_CLIENT,\n ...(body === undefined ? {} : { 'content-type': 'application/json' }),\n },\n body: body === undefined ? undefined : JSON.stringify(body),\n });\n } catch (cause) {\n error(502, `The bridge is not reachable: ${describe(cause)}`);\n }\n const answer: unknown = await response.json().catch(() => undefined);\n if (!response.ok) {\n const apiError = checkDto(AnyErrorBodySchema, answer);\n if (!apiError.ok) error(response.status, `The bridge answered ${response.status}`);\n const { message, details } = apiError.value.error;\n const field = details?.field;\n if (typeof field === 'string') error(response.status, { message, field });\n error(response.status, message);\n }\n return answer;\n }\n\n async function read<S extends DtoSchema>(\n method: 'GET' | 'POST' | 'PUT',\n path: string,\n schema: S,\n body?: unknown,\n ): Promise<DtoOf<S>> {\n const checked = checkDto(schema, await call(method, path, body));\n if (!checked.ok) {\n error(502, `Unexpected answer from the bridge at ${checked.field}: ${checked.message}`);\n }\n return checked.value;\n }\n\n return {\n status: () => read('GET', '/status', StatusSchema),\n sessions: () => read('GET', '/sessions', SessionListSchema),\n startSession: (request) => read('POST', '/sessions', StartSessionResponseSchema, request),\n endSession: async () => {\n await call('POST', '/sessions/end');\n },\n deleteSession: async (id) => {\n await call('DELETE', `/sessions?session=${id}`);\n },\n clearSpeech: async (session) => {\n await call('DELETE', `/speech?session=${session}`);\n },\n config: (view) => read('GET', `/config?view=${view}`, ConfigSchema),\n configOverrides: () => read('GET', '/config/overrides', ConfigOverridesSchema),\n updateConfig: (patch) => read('PUT', '/config', ConfigSchema, patch),\n pressKeys: async (keys) => {\n await call('POST', '/input/keys', { keys });\n },\n addMarker: (label) => read('POST', '/markers', SpeechEntrySchema, { label }),\n speech: (session, since, limit) => {\n const query = new URLSearchParams({ since: String(since), limit: String(limit) });\n if (session !== null) query.set('session', String(session));\n return read('GET', `/speech?${query}`, SpeechListSchema);\n },\n openSpeechStream: async (session, lastEventId, signal) => {\n const query = session === null ? '' : `?session=${session}`;\n let response: Response;\n try {\n response = await fetchFn(`${root}/speech/stream${query}`, {\n headers: {\n accept: 'text/event-stream',\n origin,\n [CLIENT_HEADER]: UI_CLIENT,\n ...(lastEventId === null ? {} : { 'last-event-id': lastEventId }),\n },\n signal,\n });\n } catch (cause) {\n error(502, `The bridge is not reachable: ${describe(cause)}`);\n }\n if (!response.ok || response.body === null) {\n // Unread, the body would hold the bridge connection until it is garbage collected, and\n // `EventSource` retries every few seconds while the bridge refuses.\n await response.body?.cancel().catch(() => undefined);\n error(\n response.status === 200 ? 502 : response.status,\n 'The speech stream is not available',\n );\n }\n return response;\n },\n };\n}\n\nfunction describe(cause: unknown): string {\n return cause instanceof Error ? cause.message : String(cause);\n}\n","import { SR_BRIDGE_API_URL } from '$app/env/private';\nimport { createBridgeApi, type BridgeApi } from './bridge-api.js';\n\n/** The bridge API of this deployment, at `SR_BRIDGE_API_URL` (`src/env.ts`). */\nexport function bridgeApiFromEnv(fetchFn: typeof fetch): BridgeApi {\n return createBridgeApi(SR_BRIDGE_API_URL, fetchFn);\n}\n","/** What the BFF logs through: the bridge's `Logger` port, as far as the UI uses it. */\nexport interface ServerLog {\n error(message: string): void;\n warn(message: string): void;\n}\n\n/**\n * Where the bridge puts its `[web-ui]` logger before it loads the UI (`UI_LOGGER_KEY` in\n * `packages/bridge/src/adapters/in/http/ui-mount.ts`; the bridge and the UI don't import each\n * other).\n */\nconst BRIDGE_LOGGER_KEY = Symbol.for('screenreader-speech-capture.ui-logger');\n\nfunction isServerLog(value: unknown): value is ServerLog {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as ServerLog).error === 'function' &&\n typeof (value as ServerLog).warn === 'function'\n );\n}\n\n/** `pnpm dev:ui` has no bridge in its process: the Vite dev server's console stands in. */\nconst consoleLog: ServerLog = {\n error: (message) => console.error(`[web-ui] ${message}`),\n warn: (message) => console.warn(`[web-ui] ${message}`),\n};\n\n/**\n * The bridge log inside the bridge, the console otherwise. Read per call, so it doesn't matter\n * whether this module loads before or after the bridge sets it.\n */\nexport function serverLog(): ServerLog {\n const bridge = (globalThis as Record<symbol, unknown>)[BRIDGE_LOGGER_KEY];\n return isServerLog(bridge) ? bridge : consoleLog;\n}\n","import type { Handle, HandleServerError } from '@sveltejs/kit/hooks';\nimport { bridgeApiFromEnv } from '#lib/server/bridge-from-env.js';\nimport { serverLog } from '#lib/server/log.js';\n\n/**\n * Set by the bridge (`LOCAL_HEADER` in `packages/bridge/src/adapters/in/http/ui-mount.ts`) on a request that\n * comes from the bridge's own machine, and removed from every other one. The UI can't import it:\n * the bridge and the UI don't depend on each other.\n */\nconst LOCAL_HEADER = 'x-sr-bridge-local';\n\nexport const handle: Handle = ({ event, resolve }) => {\n event.locals.local = event.request.headers.get(LOCAL_HEADER) === '1';\n // Built once per request and with its `fetch`, so routes and loads share one way to the bridge.\n event.locals.bridge = bridgeApiFromEnv(event.fetch);\n return resolve(event);\n};\n\n/**\n * An unexpected error (`kind: 'unknown'`: not one thrown with `error()`, not SvelteKit's own such\n * as a 404) is one line in the bridge log; the browser keeps SvelteKit's generic answer. The line\n * names the path but never the query, which can hold speech text that must stay off the console\n * (docs/usage/operations.md#speech-text-stays-off-the-console).\n */\nexport const handleError: HandleServerError = ({ kind, error, event }) => {\n if (kind !== 'unknown') return;\n const reason = error instanceof Error ? `${error.name}: ${error.message}` : String(error);\n serverLog().error(`${event.request.method} ${event.url.pathname}: ${reason}`);\n};\n"],"mappings":";;;;;AAQA,IAAa,aAAa;;ACN1B,IAAa,oBAAoBA,oBAAI;;;ACkErC,IAAM,YAAY;;;;;AAMlB,SAAgB,gBAAgB,SAAiB,SAA2B;CAC1E,MAAM,OAAO,QAAQ,QAAQ,QAAQ,EAAE,IAAI;CAK3C,MAAM,SAAS,IAAI,IAAI,IAAI,CAAC,CAAC;CAE7B,eAAe,KACb,QACA,MACA,MACkB;EAClB,IAAI;EACJ,IAAI;GACF,WAAW,MAAM,QAAQ,GAAG,OAAO,QAAQ;IACzC;IACA,SAAS;KACP,QAAQ;KACR;MACC,gBAAgB;KACjB,GAAI,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,gBAAgB,mBAAmB;IACrE;IACA,MAAM,SAAS,KAAA,IAAY,KAAA,IAAY,KAAK,UAAU,IAAI;GAC5D,CAAC;EACH,SAAS,OAAO;GACd,MAAM,KAAK,gCAAgC,SAAS,KAAK,GAAG;EAC9D;EACA,MAAM,SAAkB,MAAM,SAAS,KAAK,CAAC,CAAC,YAAY,KAAA,CAAS;EACnE,IAAI,CAAC,SAAS,IAAI;GAChB,MAAM,WAAW,SAAS,oBAAoB,MAAM;GACpD,IAAI,CAAC,SAAS,IAAI,MAAM,SAAS,QAAQ,uBAAuB,SAAS,QAAQ;GACjF,MAAM,EAAE,SAAS,YAAY,SAAS,MAAM;GAC5C,MAAM,QAAQ,SAAS;GACvB,IAAI,OAAO,UAAU,UAAU,MAAM,SAAS,QAAQ;IAAE;IAAS;GAAM,CAAC;GACxE,MAAM,SAAS,QAAQ,OAAO;EAChC;EACA,OAAO;CACT;CAEA,eAAe,KACb,QACA,MACA,QACA,MACmB;EACnB,MAAM,UAAU,SAAS,QAAQ,MAAM,KAAK,QAAQ,MAAM,IAAI,CAAC;EAC/D,IAAI,CAAC,QAAQ,IACX,MAAM,KAAK,wCAAwC,QAAQ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@@ function StatusChips($$renderer, $$props) {
|
|
|
30
30
|
// src/lib/components/StatusRefresh/StatusRefresh.svelte
|
|
31
31
|
function StatusRefresh($$renderer, $$props) {
|
|
32
32
|
let { loading, onRetry } = $$props;
|
|
33
|
-
$$renderer.push(`<md-icon-button title="Refresh status" class="svelte-5q7qd7"><md-icon${attr_class("svelte-5q7qd7", void 0, { "spin": loading })}>refresh</md-icon></md-icon-button>`);
|
|
33
|
+
$$renderer.push(`<md-icon-button title="Refresh status" aria-label="Refresh status" class="svelte-5q7qd7"><md-icon aria-hidden="true"${attr_class("svelte-5q7qd7", void 0, { "spin": loading })}>refresh</md-icon></md-icon-button>`);
|
|
34
34
|
}
|
|
35
35
|
// src/lib/core/status.ts
|
|
36
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_layout.svelte.js","names":["$.ensure_array_like","$.attr_class","$.clsx","$.attr","$.stringify","$.escape","$.attr_class","$.derived","onMount","$.escape","$.props_id","$.ensure_array_like","$.attr","$.attr_class","$.escape","onMount","$.attr","favicon","iconFont"],"sources":["../../../../src/lib/assets/favicon.svg","../../../../../../node_modules/.pnpm/@fontsource+material-symbols-outlined@5.3.9/node_modules/@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url","../../../../src/lib/components/StatusChips/StatusChips.svelte","../../../../src/lib/components/StatusRefresh/StatusRefresh.svelte","../../../../src/lib/adapters/icon-font.ts","../../../../src/lib/core/status.ts","../../../../src/lib/components/BridgeStatus/BridgeStatus.svelte","../../../../src/lib/components/AppHeader/AppHeader.svelte","../../../../src/lib/components/NavRail/NavRail.svelte","../../../../src/routes/+layout.svelte"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%3e%3ctitle%3eSpeech%20Capture%3c/title%3e%3crect%20width='44'%20height='44'%20rx='14'%20fill='%23415f91'/%3e%3cpath%20d='M4%2010v4M8%206v12M12%203v18M16%208v8M20%2011v2'%20transform='translate(10%2010)'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_l8JNr3EuSZUlWjWYrZY85w","<script lang=\"ts\">\n import type { Chip } from '#lib/core/status.js';\n\n type Props = { chips: Chip[]; announcement: string };\n\n let { chips, announcement }: Props = $props();\n</script>\n\n{#if chips.length > 0}\n <ul aria-label=\"Bridge status\">\n {#each chips as chip (chip.id)}\n <li class={chip.tone} class:down={chip.down}>\n <!-- The tooltip sits on the hidden part, so it is never read next to the description. -->\n <span class=\"face\" title={chip.text} aria-hidden=\"true\">\n <span class=\"dot {chip.dot}\"></span>\n <span class=\"chip-label\">{chip.text}</span>\n </span>\n <!-- As text: screen readers can skip an `aria-label` on a list item. -->\n <span class=\"visually-hidden\">{chip.description}</span>\n </li>\n {/each}\n </ul>\n{/if}\n<!-- Only changes of a problem state speak; a refresh leaves this text as it is. -->\n<span class=\"visually-hidden\" role=\"status\">{announcement}</span>\n\n<style>\n ul {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n li {\n position: relative;\n display: inline-flex;\n height: 32px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-width: max(1px, var(--app-border-width));\n border-radius: 8px;\n background: var(--md-sys-color-surface-container-lowest, transparent);\n color: var(--md-sys-color-on-surface);\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n white-space: nowrap;\n }\n\n li.ok {\n --dot: var(--app-success);\n }\n li.warning {\n --dot: var(--app-warning);\n background: var(--app-warning-container);\n color: var(--app-on-warning-container);\n border-color: var(--app-warning);\n }\n li.error {\n --dot: var(--md-sys-color-error);\n background: var(--md-sys-color-error-container);\n color: var(--md-sys-color-on-error-container);\n border-color: var(--md-sys-color-error);\n }\n li.neutral {\n --dot: var(--md-sys-color-outline);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n li.down {\n --dot: var(--md-sys-color-error);\n }\n\n /* Fills the chip, so the tooltip shows wherever the pointer is on it. */\n .face {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 12px;\n }\n\n .dot {\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--dot);\n border: 2px solid var(--dot);\n }\n .dot.hollow {\n background: transparent;\n }\n\n /* On a narrow screen only the dot stays; the hidden description still says what it is. */\n @media (width < 800px) {\n .chip-label {\n display: none;\n }\n }\n</style>\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/iconbutton/icon-button.js';\n\n type Props = { loading: boolean; onRetry: () => void };\n\n let { loading, onRetry }: Props = $props();\n</script>\n\n<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->\n<!-- md-icon-button wraps a real <button> in its shadow DOM, which handles keys and role. -->\n<md-icon-button title=\"Refresh status\" onclick={onRetry}>\n <md-icon class:spin={loading}>refresh</md-icon>\n</md-icon-button>\n\n<style>\n md-icon-button {\n --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);\n --md-icon-button-hover-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-focus-icon-color: var(--md-sys-color-on-surface);\n }\n\n .spin {\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .spin {\n animation: none;\n }\n }\n</style>\n","const ICON_FONT = '24px \"Material Symbols Outlined\"';\n\n/**\n * Loads the icon font and then sets `data-icons-ready` on `<html>`, which ends the placeholder\n * shimmer in `global.css`. If loading fails the icons show anyway rather than shimmer forever.\n */\nexport async function markIconFontReady(): Promise<void> {\n try {\n await document.fonts.load(ICON_FONT);\n } catch {\n // fall through: show the icons\n }\n document.documentElement.setAttribute('data-icons-ready', '');\n}\n","import type { ServiceStatusDto, StatusDto } from '@screenreader-speech-capture/shared';\n\n/** Where the status comes from (the HTTP adapter asks the BFF, which asks the bridge). */\nexport interface StatusApi {\n fetch(): Promise<StatusDto>;\n}\n\nexport type ChipId = 'playwright' | 'mcp' | 'bridge';\nexport type ChipTone = 'ok' | 'error' | 'warning' | 'neutral';\n\nexport type Chip = {\n id: ChipId;\n /** What the chip shows. */\n text: string;\n tone: ChipTone;\n /** A hollow dot means \"nothing there yet\"; a filled one means \"there is state\". */\n dot: 'filled' | 'hollow';\n /** Spoken name of the state, so it is never colour alone. */\n description: string;\n /** Not connected or not ready: the dot is red while the chip itself stays neutral. */\n down?: boolean;\n};\n\n/**\n * Only what needs a look: a service that is not running (not enabled) has no chip, and the session\n * is the sessions pane's business. An unreachable bridge is a chip of its own.\n */\nexport function deriveChips(status: StatusDto | null, reachable: boolean): Chip[] {\n if (!reachable) {\n return [\n {\n id: 'bridge',\n text: 'Bridge unreachable',\n tone: 'error',\n dot: 'filled',\n description: 'Bridge unreachable',\n },\n ];\n }\n if (status === null) return [];\n return [\n serviceChip('playwright', 'Playwright', status.playwright),\n serviceChip('mcp', 'MCP', status.mcp),\n ].filter((chip): chip is Chip => chip !== null);\n}\n\nfunction serviceChip(id: ChipId, name: string, service: ServiceStatusDto): Chip | null {\n const base = `${name} ${service.version}`;\n switch (service.state) {\n case 'running':\n return { id, text: base, tone: 'ok', dot: 'filled', description: `${base}, running` };\n case 'crashed':\n case 'failed':\n return {\n id,\n text: `${base} · ${service.state}`,\n tone: 'warning',\n dot: 'filled',\n description: `${base}, ${service.state}`,\n };\n case 'starting':\n return {\n id,\n text: base,\n tone: 'neutral',\n dot: 'hollow',\n description: `${base}, starting`,\n down: true,\n };\n case 'stopped':\n return null;\n }\n}\n\n/**\n * The words a screen reader gets when the state changes. Empty while everything is fine, so the\n * regular refresh never speaks.\n */\nexport function announcement(chips: Chip[], reachable: boolean): string {\n if (!reachable) return 'Bridge unreachable.';\n return chips\n .filter((chip) => chip.tone === 'error' || chip.tone === 'warning')\n .map((chip) => `${chip.description}.`)\n .join(' ');\n}\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { page } from '$app/state';\n import StatusChips from '#lib/components/StatusChips/StatusChips.svelte';\n import StatusRefresh from '#lib/components/StatusRefresh/StatusRefresh.svelte';\n import { appStores } from '#lib/composition.js';\n import { announcement, deriveChips } from '#lib/core/status.js';\n import type { StatusDto } from '@screenreader-speech-capture/shared';\n\n const statusStore = appStores().status;\n\n // The status the server rendered (`+layout.server.ts`); it fills in until the store has its own.\n const seed = $derived(page.data.status as StatusDto | null);\n const status = $derived(statusStore.status ?? seed);\n const chips = $derived(deriveChips(status, statusStore.reachable));\n\n onMount(() => statusStore.init(seed));\n</script>\n\n<StatusChips {chips} announcement={announcement(chips, statusStore.reachable)} />\n<!-- Status is read once, so the retry only shows when there is something to recover from. -->\n{#if !statusStore.reachable}\n <StatusRefresh loading={statusStore.loading} onRetry={() => void statusStore.retry()} />\n{/if}\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/iconbutton/icon-button.js';\n import BridgeStatus from '#lib/components/BridgeStatus/BridgeStatus.svelte';\n\n type Props = {\n host: string;\n };\n\n let { host }: Props = $props();\n</script>\n\n<header>\n <div class=\"logo-slot\">\n <div class=\"logo\">\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M4 10v4M8 6v12M12 3v18M16 8v8M20 11v2\" />\n </svg>\n </div>\n </div>\n <div class=\"title\">\n <span class=\"name\">Speech Capture</span>\n <span class=\"meta\">{host}</span>\n </div>\n <BridgeStatus />\n</header>\n\n<style>\n header {\n display: flex;\n align-items: center;\n gap: 12px 16px;\n min-height: 68px;\n padding: 10px 16px 10px 0;\n background: var(--md-sys-color-surface-container);\n color: var(--md-sys-color-on-surface);\n }\n\n /* As wide as the navigation rail, so the logo sits centered over it. */\n .logo-slot {\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: var(--app-rail-width);\n }\n\n .logo {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 14px;\n background: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n .title {\n display: flex;\n flex-direction: column;\n min-width: 0;\n margin-right: auto;\n }\n\n header {\n flex-wrap: wrap;\n }\n\n .name {\n font-family: var(--md-sys-typescale-title-large-font);\n font-size: var(--md-sys-typescale-title-large-size);\n line-height: var(--md-sys-typescale-title-large-line-height);\n font-weight: var(--md-ref-typeface-weight-medium);\n }\n\n .meta {\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n line-height: var(--app-mono-line-height);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n md-icon-button {\n --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);\n --md-icon-button-hover-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-focus-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-pressed-icon-color: var(--md-sys-color-on-surface);\n }\n</style>\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/ripple/ripple.js';\n import { arrowNavigation } from '#lib/components/arrow-navigation.js';\n import { isCurrent, type NavItem } from '#lib/core/navigation.js';\n\n type Props = { items: NavItem[]; currentPath: string };\n\n let { items, currentPath }: Props = $props();\n\n const id = $props.id();\n\n /** Long enough for a screen reader to notice the emptied region before the next text. */\n const ANNOUNCE_DELAY_MS = 100;\n\n let announcement = $state('');\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n // What was said belongs to the page it was said on.\n $effect(() => {\n void currentPath;\n return () => {\n clearTimeout(timer);\n announcement = '';\n };\n });\n\n /**\n * The link to the page already shown: navigating would change nothing, say nothing and send the\n * focus back to the start of the page. Stay, and say that this is the current page.\n */\n function onclick(event: MouseEvent & { currentTarget: HTMLAnchorElement }, label: string) {\n // With a modifier the browser opens the link somewhere else.\n if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;\n // The whole URL: `/ui/` still leads away from `/ui/?session=7`.\n const link = event.currentTarget;\n if (link.href !== link.ownerDocument.URL) return;\n event.preventDefault();\n clearTimeout(timer);\n announcement = '';\n // Emptied first, so the same words are spoken again.\n timer = setTimeout(() => (announcement = `${label}, current page`), ANNOUNCE_DELAY_MS);\n }\n\n /** Links only react to Enter by themselves; a navigation rail's items also take Space. */\n function onkeydown(event: KeyboardEvent & { currentTarget: HTMLAnchorElement }) {\n if (event.key !== ' ') return;\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n event.preventDefault(); // no scrolling\n if (!event.repeat) event.currentTarget.click();\n }\n</script>\n\n<nav aria-label=\"Pages\">\n <ul {@attach arrowNavigation('a')}>\n {#each items as item, index (item.href)}\n {@const current = isCurrent(item, currentPath)}\n {@const linkId = `${id}-link-${index}`}\n {@const labelId = `${linkId}-label`}\n <li>\n <!-- Named by the label alone: from the content, Chromium also reads the icon's\n ligature text (\"settings Settings\"), despite its aria-hidden. -->\n <!-- No reset: SvelteKit would move the focus to the body after changing pages. Its\n announcer still says the new page's title. -->\n <!-- The layout passes hrefs it built with resolve(). -->\n <!-- eslint-disable svelte/no-navigation-without-resolve -->\n <a\n id={linkId}\n href={item.href}\n aria-labelledby={labelId}\n aria-current={current ? 'page' : undefined}\n data-sveltekit-reset=\"false\"\n onclick={(event) => onclick(event, item.label)}\n {onkeydown}\n >\n <!-- eslint-enable svelte/no-navigation-without-resolve -->\n <span class=\"indicator\" class:current>\n <!-- Hover and press on the whole link show in the indicator. -->\n <md-ripple for={linkId} aria-hidden=\"true\"></md-ripple>\n <md-icon aria-hidden=\"true\">{item.icon}</md-icon>\n </span>\n <span id={labelId} class=\"label\">{item.label}</span>\n </a>\n </li>\n {/each}\n </ul>\n</nav>\n<!-- Outside the navigation, so reading through it doesn't run into this. -->\n<span class=\"visually-hidden\" role=\"status\">{announcement}</span>\n\n<style>\n nav {\n flex: none;\n width: var(--app-rail-width);\n /* With the links' own 4px, the first icon sits one gutter below the top. */\n padding: calc(var(--app-gutter) - 4px) 0;\n /* Large text in a low window. */\n overflow-y: auto;\n background: var(--md-sys-color-surface);\n }\n\n ul {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n a {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n min-height: 48px;\n /* Room for the focus ring around the icon and the label. */\n padding: 4px 0;\n color: var(--md-sys-color-on-surface-variant);\n text-decoration: none;\n }\n\n /* Inside the link: the rail is at the window's edge and clips what sticks out. */\n a:focus-visible {\n outline-offset: calc(-1 * var(--md-sys-state-focus-indicator-thickness));\n }\n\n .indicator {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 32px;\n border: var(--app-border-width) solid transparent;\n box-sizing: border-box;\n border-radius: 16px;\n --md-ripple-hover-color: currentColor;\n --md-ripple-pressed-color: currentColor;\n }\n\n .indicator.current {\n border-color: var(--md-sys-color-outline);\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n\n a[aria-current='page'] {\n color: var(--md-sys-color-on-surface);\n }\n\n /* The whole label stays visible at large text sizes: it wraps and the item grows. */\n .label {\n max-width: 100%;\n text-align: center;\n hyphens: auto;\n overflow-wrap: anywhere;\n font-family: var(--md-sys-typescale-label-medium-font);\n font-size: var(--md-sys-typescale-label-medium-size);\n line-height: var(--md-sys-typescale-label-medium-line-height);\n font-weight: var(--md-ref-typeface-weight-medium);\n }\n</style>\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { resolve } from '$app/paths';\n import { page } from '$app/state';\n import favicon from '#lib/assets/favicon.svg';\n import iconFont from '@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url';\n import AppHeader from '#lib/components/AppHeader/AppHeader.svelte';\n import NavRail from '#lib/components/NavRail/NavRail.svelte';\n import { markIconFontReady, provideAppStores } from '#lib/composition.js';\n import type { NavItem } from '#lib/core/navigation.js';\n import '#lib/styles/fonts.css';\n import '#lib/styles/tokens.css';\n import '#lib/styles/global.css';\n import type { LayoutProps } from './$types';\n\n let { children }: LayoutProps = $props();\n\n // One set of stores per app: per request on the server, once in the browser.\n const { theme: themeStore } = provideAppStores();\n\n const navItems: NavItem[] = [\n { href: resolve('/'), label: 'Monitor', icon: 'monitor', exact: true },\n { href: resolve('/settings'), label: 'Settings', icon: 'settings' },\n { href: resolve('/setup'), label: 'Setup', icon: 'build' },\n ];\n\n onMount(() => {\n themeStore.init();\n void markIconFontReady();\n });\n</script>\n\n<svelte:head>\n <link rel=\"icon\" href={favicon} />\n <link rel=\"preload\" as=\"font\" type=\"font/woff2\" href={iconFont} crossorigin=\"anonymous\" />\n <meta name=\"color-scheme\" content=\"light dark\" />\n</svelte:head>\n\n<div class=\"app\">\n <AppHeader host={page.url.host} />\n\n <div class=\"body\">\n <NavRail items={navItems} currentPath={page.url.pathname} />\n <main>\n {@render children()}\n </main>\n </div>\n</div>\n\n<style>\n /* The window height is fixed, so a page can fill what is left below the header (which grows\n when its chips wrap). */\n .app {\n display: flex;\n flex-direction: column;\n height: 100dvh;\n }\n\n .body {\n display: flex;\n flex: 1;\n align-items: stretch;\n min-height: 0;\n }\n\n main {\n flex: 1;\n min-width: 0;\n min-height: 0;\n padding: 0 16px;\n overflow: auto;\n }\n</style>\n"],"ignoreList":[1],"mappings":";;;;;;;;;;AAAA,IAAA,kBAAe;;ACAf,IAAA,qDAAe;;;CCAf,WAAA,WAAA,eAAA;EAKE,IAAI,EAAE,OAAO,iBAAqB;EAG/B,IAAA,MAAM,SAAS,GAAC;;GAEV,MAAA,aAAAA,kBAAA,KAAK;;IAAI,IAAA,OAAI,WAAA;IACP,WAAA,KAAA,MAAAC,WAAAC,KAAA,KAAK,IAAI,GAAA,kBAAA,EAAA,QAAc,KAAK,KAAI,CAAA,EAAA,oCAAAC,KAAA,SAEf,KAAK,IAAI,EAAA,2BAAAF,WAAA,OAAAG,UACf,KAA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,mEAAAA,YAAA,YAAY,EAAA,QAAA;CArCjD,CAAA;;;;CCnDR,WAAA,WAAA,eAAA;EAeE,IAAI,EAAE,aAAuB;EAG7B,MAAM,EAAE,OAAO,eAAe,iBAAgB;EAE9C,MAAM,WAAsB;GAC1B;IAAE,MAAM,QAAQ,GAAG;IAAG,OAAO;IAAW,MAAM;IAAW,OAAO;GAAM;GACtE;IAAE,MAAM,QAAQ,WAAW;IAAG,OAAO;IAAY,MAAM;GAAY;GACnE;IAAE,MAAM,QAAQ,QAAQ;IAAG,OAAO;IAAS,MAAM;GAAO;EACzD;;GASsB,WAAA,KAAA,mBAAAE,KAAA,QAAAC,eAAO,EAAA,oDAAAD,KAAA,QACwBE,kDAAQ,EAAA,4EAAA;;;EAK7C,UAAA,YAAA,EAAA,MAAA,KAAK,IAAI,KAAI,CAAA;;EAGZ,QAAA,YAAA;GAAA,OAAA;GAAQ,aAAe,KAAK,IAAI;EAAQ,CAAA;;EAE7C,SAAQ,UAAA;;CAdf,CAAA"}
|
|
1
|
+
{"version":3,"file":"_layout.svelte.js","names":["$.ensure_array_like","$.attr_class","$.clsx","$.attr","$.stringify","$.escape","$.attr_class","$.derived","onMount","$.escape","$.props_id","$.ensure_array_like","$.attr","$.attr_class","$.escape","onMount","$.attr","favicon","iconFont"],"sources":["../../../../src/lib/assets/favicon.svg","../../../../../../node_modules/.pnpm/@fontsource+material-symbols-outlined@5.3.9/node_modules/@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url","../../../../src/lib/components/StatusChips/StatusChips.svelte","../../../../src/lib/components/StatusRefresh/StatusRefresh.svelte","../../../../src/lib/adapters/icon-font.ts","../../../../src/lib/core/status.ts","../../../../src/lib/components/BridgeStatus/BridgeStatus.svelte","../../../../src/lib/components/AppHeader/AppHeader.svelte","../../../../src/lib/components/NavRail/NavRail.svelte","../../../../src/routes/+layout.svelte"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%3e%3ctitle%3eSpeech%20Capture%3c/title%3e%3crect%20width='44'%20height='44'%20rx='14'%20fill='%23415f91'/%3e%3cpath%20d='M4%2010v4M8%206v12M12%203v18M16%208v8M20%2011v2'%20transform='translate(10%2010)'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e\"","export default import.meta.ROLLDOWN_FILE_URL_l8JNr3EuSZUlWjWYrZY85w","<script lang=\"ts\">\n import type { Chip } from '#lib/core/status.js';\n\n type Props = { chips: Chip[]; announcement: string };\n\n let { chips, announcement }: Props = $props();\n</script>\n\n{#if chips.length > 0}\n <ul aria-label=\"Bridge status\">\n {#each chips as chip (chip.id)}\n <li class={chip.tone} class:down={chip.down}>\n <!-- The tooltip sits on the hidden part, so it is never read next to the description. -->\n <span class=\"face\" title={chip.text} aria-hidden=\"true\">\n <span class=\"dot {chip.dot}\"></span>\n <span class=\"chip-label\">{chip.text}</span>\n </span>\n <!-- As text: screen readers can skip an `aria-label` on a list item. -->\n <span class=\"visually-hidden\">{chip.description}</span>\n </li>\n {/each}\n </ul>\n{/if}\n<!-- Only changes of a problem state speak; a refresh leaves this text as it is. -->\n<span class=\"visually-hidden\" role=\"status\">{announcement}</span>\n\n<style>\n ul {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n li {\n position: relative;\n display: inline-flex;\n height: 32px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-width: max(1px, var(--app-border-width));\n border-radius: 8px;\n background: var(--md-sys-color-surface-container-lowest, transparent);\n color: var(--md-sys-color-on-surface);\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n white-space: nowrap;\n }\n\n li.ok {\n --dot: var(--app-success);\n }\n li.warning {\n --dot: var(--app-warning);\n background: var(--app-warning-container);\n color: var(--app-on-warning-container);\n border-color: var(--app-warning);\n }\n li.error {\n --dot: var(--md-sys-color-error);\n background: var(--md-sys-color-error-container);\n color: var(--md-sys-color-on-error-container);\n border-color: var(--md-sys-color-error);\n }\n li.neutral {\n --dot: var(--md-sys-color-outline);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n li.down {\n --dot: var(--md-sys-color-error);\n }\n\n /* Fills the chip, so the tooltip shows wherever the pointer is on it. */\n .face {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 12px;\n }\n\n .dot {\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--dot);\n border: 2px solid var(--dot);\n }\n .dot.hollow {\n background: transparent;\n }\n\n /* On a narrow screen only the dot stays; the hidden description still says what it is. */\n @media (width < 800px) {\n .chip-label {\n display: none;\n }\n }\n</style>\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/iconbutton/icon-button.js';\n\n type Props = { loading: boolean; onRetry: () => void };\n\n let { loading, onRetry }: Props = $props();\n</script>\n\n<!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->\n<!-- md-icon-button wraps a real <button> in its shadow DOM, which handles keys and role. -->\n<md-icon-button title=\"Refresh status\" aria-label=\"Refresh status\" onclick={onRetry}>\n <md-icon class:spin={loading} aria-hidden=\"true\">refresh</md-icon>\n</md-icon-button>\n\n<style>\n md-icon-button {\n --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);\n --md-icon-button-hover-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-focus-icon-color: var(--md-sys-color-on-surface);\n }\n\n .spin {\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .spin {\n animation: none;\n }\n }\n</style>\n","const ICON_FONT = '24px \"Material Symbols Outlined\"';\n\n/**\n * Loads the icon font and then sets `data-icons-ready` on `<html>`, which ends the placeholder\n * shimmer in `global.css`. If loading fails the icons show anyway rather than shimmer forever.\n */\nexport async function markIconFontReady(): Promise<void> {\n try {\n await document.fonts.load(ICON_FONT);\n } catch {\n // fall through: show the icons\n }\n document.documentElement.setAttribute('data-icons-ready', '');\n}\n","import type { ServiceStatusDto, StatusDto } from '@screenreader-speech-capture/shared';\n\n/** Where the status comes from (the HTTP adapter asks the BFF, which asks the bridge). */\nexport interface StatusApi {\n fetch(): Promise<StatusDto>;\n}\n\nexport type ChipId = 'playwright' | 'mcp' | 'bridge';\nexport type ChipTone = 'ok' | 'error' | 'warning' | 'neutral';\n\nexport type Chip = {\n id: ChipId;\n /** What the chip shows. */\n text: string;\n tone: ChipTone;\n /** A hollow dot means \"nothing there yet\"; a filled one means \"there is state\". */\n dot: 'filled' | 'hollow';\n /** Spoken name of the state, so it is never colour alone. */\n description: string;\n /** Not connected or not ready: the dot is red while the chip itself stays neutral. */\n down?: boolean;\n};\n\n/**\n * Only what needs a look: a service that is not running (not enabled) has no chip, and the session\n * is the sessions pane's business. An unreachable bridge is a chip of its own.\n */\nexport function deriveChips(status: StatusDto | null, reachable: boolean): Chip[] {\n if (!reachable) {\n return [\n {\n id: 'bridge',\n text: 'Bridge unreachable',\n tone: 'error',\n dot: 'filled',\n description: 'Bridge unreachable',\n },\n ];\n }\n if (status === null) return [];\n return [\n serviceChip('playwright', 'Playwright', status.playwright),\n serviceChip('mcp', 'MCP', status.mcp),\n ].filter((chip): chip is Chip => chip !== null);\n}\n\nfunction serviceChip(id: ChipId, name: string, service: ServiceStatusDto): Chip | null {\n const base = `${name} ${service.version}`;\n switch (service.state) {\n case 'running':\n return { id, text: base, tone: 'ok', dot: 'filled', description: `${base}, running` };\n case 'crashed':\n case 'failed':\n return {\n id,\n text: `${base} · ${service.state}`,\n tone: 'warning',\n dot: 'filled',\n description: `${base}, ${service.state}`,\n };\n case 'starting':\n return {\n id,\n text: base,\n tone: 'neutral',\n dot: 'hollow',\n description: `${base}, starting`,\n down: true,\n };\n case 'stopped':\n return null;\n }\n}\n\n/**\n * The words a screen reader gets when the state changes. Empty while everything is fine, so the\n * regular refresh never speaks.\n */\nexport function announcement(chips: Chip[], reachable: boolean): string {\n if (!reachable) return 'Bridge unreachable.';\n return chips\n .filter((chip) => chip.tone === 'error' || chip.tone === 'warning')\n .map((chip) => `${chip.description}.`)\n .join(' ');\n}\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { page } from '$app/state';\n import StatusChips from '#lib/components/StatusChips/StatusChips.svelte';\n import StatusRefresh from '#lib/components/StatusRefresh/StatusRefresh.svelte';\n import { appStores } from '#lib/composition.js';\n import { announcement, deriveChips } from '#lib/core/status.js';\n import type { StatusDto } from '@screenreader-speech-capture/shared';\n\n const statusStore = appStores().status;\n\n // The status the server rendered (`+layout.server.ts`); it fills in until the store has its own.\n const seed = $derived(page.data.status as StatusDto | null);\n const status = $derived(statusStore.status ?? seed);\n const chips = $derived(deriveChips(status, statusStore.reachable));\n\n onMount(() => statusStore.init(seed));\n</script>\n\n<StatusChips {chips} announcement={announcement(chips, statusStore.reachable)} />\n<!-- Status is read once, so the retry only shows when there is something to recover from. -->\n{#if !statusStore.reachable}\n <StatusRefresh loading={statusStore.loading} onRetry={() => void statusStore.retry()} />\n{/if}\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/iconbutton/icon-button.js';\n import BridgeStatus from '#lib/components/BridgeStatus/BridgeStatus.svelte';\n\n type Props = {\n host: string;\n };\n\n let { host }: Props = $props();\n</script>\n\n<header>\n <div class=\"logo-slot\">\n <div class=\"logo\">\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M4 10v4M8 6v12M12 3v18M16 8v8M20 11v2\" />\n </svg>\n </div>\n </div>\n <div class=\"title\">\n <span class=\"name\">Speech Capture</span>\n <span class=\"meta\">{host}</span>\n </div>\n <BridgeStatus />\n</header>\n\n<style>\n header {\n display: flex;\n align-items: center;\n gap: 12px 16px;\n min-height: 68px;\n padding: 10px 16px 10px 0;\n background: var(--md-sys-color-surface-container);\n color: var(--md-sys-color-on-surface);\n }\n\n /* As wide as the navigation rail, so the logo sits centered over it. */\n .logo-slot {\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: var(--app-rail-width);\n }\n\n .logo {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 14px;\n background: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n .title {\n display: flex;\n flex-direction: column;\n min-width: 0;\n margin-right: auto;\n }\n\n header {\n flex-wrap: wrap;\n }\n\n .name {\n font-family: var(--md-sys-typescale-title-large-font);\n font-size: var(--md-sys-typescale-title-large-size);\n line-height: var(--md-sys-typescale-title-large-line-height);\n font-weight: var(--md-ref-typeface-weight-medium);\n }\n\n .meta {\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n line-height: var(--app-mono-line-height);\n color: var(--md-sys-color-on-surface-variant);\n }\n\n md-icon-button {\n --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);\n --md-icon-button-hover-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-focus-icon-color: var(--md-sys-color-on-surface);\n --md-icon-button-pressed-icon-color: var(--md-sys-color-on-surface);\n }\n</style>\n","<script lang=\"ts\">\n import '@material/web/icon/icon.js';\n import '@material/web/ripple/ripple.js';\n import { arrowNavigation } from '#lib/components/arrow-navigation.js';\n import { isCurrent, type NavItem } from '#lib/core/navigation.js';\n\n type Props = { items: NavItem[]; currentPath: string };\n\n let { items, currentPath }: Props = $props();\n\n const id = $props.id();\n\n /** Long enough for a screen reader to notice the emptied region before the next text. */\n const ANNOUNCE_DELAY_MS = 100;\n\n let announcement = $state('');\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n // What was said belongs to the page it was said on.\n $effect(() => {\n void currentPath;\n return () => {\n clearTimeout(timer);\n announcement = '';\n };\n });\n\n /**\n * The link to the page already shown: navigating would change nothing, say nothing and send the\n * focus back to the start of the page. Stay, and say that this is the current page.\n */\n function onclick(event: MouseEvent & { currentTarget: HTMLAnchorElement }, label: string) {\n // With a modifier the browser opens the link somewhere else.\n if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;\n // The whole URL: `/ui/` still leads away from `/ui/?session=7`.\n const link = event.currentTarget;\n if (link.href !== link.ownerDocument.URL) return;\n event.preventDefault();\n clearTimeout(timer);\n announcement = '';\n // Emptied first, so the same words are spoken again.\n timer = setTimeout(() => (announcement = `${label}, current page`), ANNOUNCE_DELAY_MS);\n }\n\n /** Links only react to Enter by themselves; a navigation rail's items also take Space. */\n function onkeydown(event: KeyboardEvent & { currentTarget: HTMLAnchorElement }) {\n if (event.key !== ' ') return;\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n event.preventDefault(); // no scrolling\n if (!event.repeat) event.currentTarget.click();\n }\n</script>\n\n<nav aria-label=\"Pages\">\n <ul {@attach arrowNavigation('a')}>\n {#each items as item, index (item.href)}\n {@const current = isCurrent(item, currentPath)}\n {@const linkId = `${id}-link-${index}`}\n {@const labelId = `${linkId}-label`}\n <li>\n <!-- Named by the label alone: from the content, Chromium also reads the icon's\n ligature text (\"settings Settings\"), despite its aria-hidden. -->\n <!-- No reset: SvelteKit would move the focus to the body after changing pages. Its\n announcer still says the new page's title. -->\n <!-- The layout passes hrefs it built with resolve(). -->\n <!-- eslint-disable svelte/no-navigation-without-resolve -->\n <a\n id={linkId}\n href={item.href}\n aria-labelledby={labelId}\n aria-current={current ? 'page' : undefined}\n data-sveltekit-reset=\"false\"\n onclick={(event) => onclick(event, item.label)}\n {onkeydown}\n >\n <!-- eslint-enable svelte/no-navigation-without-resolve -->\n <span class=\"indicator\" class:current>\n <!-- Hover and press on the whole link show in the indicator. -->\n <md-ripple for={linkId} aria-hidden=\"true\"></md-ripple>\n <md-icon aria-hidden=\"true\">{item.icon}</md-icon>\n </span>\n <span id={labelId} class=\"label\">{item.label}</span>\n </a>\n </li>\n {/each}\n </ul>\n</nav>\n<!-- Outside the navigation, so reading through it doesn't run into this. -->\n<span class=\"visually-hidden\" role=\"status\">{announcement}</span>\n\n<style>\n nav {\n flex: none;\n width: var(--app-rail-width);\n /* With the links' own 4px, the first icon sits one gutter below the top. */\n padding: calc(var(--app-gutter) - 4px) 0;\n /* Large text in a low window. */\n overflow-y: auto;\n background: var(--md-sys-color-surface);\n }\n\n ul {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 0;\n padding: 0;\n list-style: none;\n }\n\n a {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n min-height: 48px;\n /* Room for the focus ring around the icon and the label. */\n padding: 4px 0;\n color: var(--md-sys-color-on-surface-variant);\n text-decoration: none;\n }\n\n /* Inside the link: the rail is at the window's edge and clips what sticks out. */\n a:focus-visible {\n outline-offset: calc(-1 * var(--md-sys-state-focus-indicator-thickness));\n }\n\n .indicator {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 32px;\n border: var(--app-border-width) solid transparent;\n box-sizing: border-box;\n border-radius: 16px;\n --md-ripple-hover-color: currentColor;\n --md-ripple-pressed-color: currentColor;\n }\n\n .indicator.current {\n border-color: var(--md-sys-color-outline);\n background: var(--md-sys-color-secondary-container);\n color: var(--md-sys-color-on-secondary-container);\n }\n\n a[aria-current='page'] {\n color: var(--md-sys-color-on-surface);\n }\n\n /* The whole label stays visible at large text sizes: it wraps and the item grows. */\n .label {\n max-width: 100%;\n text-align: center;\n hyphens: auto;\n overflow-wrap: anywhere;\n font-family: var(--md-sys-typescale-label-medium-font);\n font-size: var(--md-sys-typescale-label-medium-size);\n line-height: var(--md-sys-typescale-label-medium-line-height);\n font-weight: var(--md-ref-typeface-weight-medium);\n }\n</style>\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { resolve } from '$app/paths';\n import { page } from '$app/state';\n import favicon from '#lib/assets/favicon.svg';\n import iconFont from '@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2?url';\n import AppHeader from '#lib/components/AppHeader/AppHeader.svelte';\n import NavRail from '#lib/components/NavRail/NavRail.svelte';\n import { markIconFontReady, provideAppStores } from '#lib/composition.js';\n import type { NavItem } from '#lib/core/navigation.js';\n import '#lib/styles/fonts.css';\n import '#lib/styles/tokens.css';\n import '#lib/styles/global.css';\n import type { LayoutProps } from './$types';\n\n let { children }: LayoutProps = $props();\n\n // One set of stores per app: per request on the server, once in the browser.\n const { theme: themeStore } = provideAppStores();\n\n const navItems: NavItem[] = [\n { href: resolve('/'), label: 'Monitor', icon: 'monitor', exact: true },\n { href: resolve('/settings'), label: 'Settings', icon: 'settings' },\n { href: resolve('/setup'), label: 'Setup', icon: 'build' },\n ];\n\n onMount(() => {\n themeStore.init();\n void markIconFontReady();\n });\n</script>\n\n<svelte:head>\n <link rel=\"icon\" href={favicon} />\n <link rel=\"preload\" as=\"font\" type=\"font/woff2\" href={iconFont} crossorigin=\"anonymous\" />\n <meta name=\"color-scheme\" content=\"light dark\" />\n</svelte:head>\n\n<div class=\"app\">\n <AppHeader host={page.url.host} />\n\n <div class=\"body\">\n <NavRail items={navItems} currentPath={page.url.pathname} />\n <main>\n {@render children()}\n </main>\n </div>\n</div>\n\n<style>\n /* The window height is fixed, so a page can fill what is left below the header (which grows\n when its chips wrap). */\n .app {\n display: flex;\n flex-direction: column;\n height: 100dvh;\n }\n\n .body {\n display: flex;\n flex: 1;\n align-items: stretch;\n min-height: 0;\n }\n\n main {\n flex: 1;\n min-width: 0;\n min-height: 0;\n padding: 0 16px;\n overflow: auto;\n }\n</style>\n"],"ignoreList":[1],"mappings":";;;;;;;;;;AAAA,IAAA,kBAAe;;ACAf,IAAA,qDAAe;;;CCAf,WAAA,WAAA,eAAA;EAKE,IAAI,EAAE,OAAO,iBAAqB;EAG/B,IAAA,MAAM,SAAS,GAAC;;GAEV,MAAA,aAAAA,kBAAA,KAAK;;IAAI,IAAA,OAAI,WAAA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CAAA,EAAA,aAAAD,KAAA,OAQxB,MAAM,EAAA,+DAAAE,YACO,KAAK,IAAI,EAAA,yBAAAF,KAAA,MAE9B,OAAO,EAAA,+BAAAE,YAAiB,KAAK,KAAK,EAAA,iBAAA;;EAOT,WAAA,KAAA,mEAAAA,YAAA,YAAY,EAAA,QAAA;CArCjD,CAAA;;;;CCnDR,WAAA,WAAA,eAAA;EAeE,IAAI,EAAE,aAAuB;EAG7B,MAAM,EAAE,OAAO,eAAe,iBAAgB;EAE9C,MAAM,WAAsB;GAC1B;IAAE,MAAM,QAAQ,GAAG;IAAG,OAAO;IAAW,MAAM;IAAW,OAAO;GAAM;GACtE;IAAE,MAAM,QAAQ,WAAW;IAAG,OAAO;IAAY,MAAM;GAAY;GACnE;IAAE,MAAM,QAAQ,QAAQ;IAAG,OAAO;IAAS,MAAM;GAAO;EACzD;;GASsB,WAAA,KAAA,mBAAAE,KAAA,QAAAC,eAAO,EAAA,oDAAAD,KAAA,QACwBE,kDAAQ,EAAA,4EAAA;;;EAK7C,UAAA,YAAA,EAAA,MAAA,KAAK,IAAI,KAAI,CAAA;;EAGZ,QAAA,YAAA;GAAA,OAAA;GAAQ,aAAe,KAAK,IAAI;EAAQ,CAAA;;EAE7C,SAAQ,UAAA;;CAdf,CAAA"}
|
|
@@ -8,7 +8,7 @@ import "../../../../chunks/icon.js";
|
|
|
8
8
|
import { t as ExternalLink } from "../../../../chunks/ExternalLink.js";
|
|
9
9
|
import { y as HOST_NAME_PATTERN } from "../../../../chunks/src.js";
|
|
10
10
|
import { i as SCREEN_READER_ID, o as docsUrl, t as appStores } from "../../../../chunks/composition.js";
|
|
11
|
-
// ../shared/src/
|
|
11
|
+
// ../shared/src/rules/service-paths.ts
|
|
12
12
|
/** Playwright MCP (streamable HTTP): `http://<bridge>:5151/playwright-mcp`. */
|
|
13
13
|
var PLAYWRIGHT_MCP_PATH = "/playwright-mcp";
|
|
14
14
|
// src/lib/components/CommandBlock/CommandBlock.svelte
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_page.svelte.js","names":["$.derived","$.escape","$.attr","$.stringify","$.attr","$.derived","$.attr","$.escape","$.derived","onMount"],"sources":["../../../../../../../shared/src/services.ts","../../../../../../src/lib/components/CommandBlock/CommandBlock.svelte","../../../../../../src/lib/core/instructions.ts","../../../../../../src/lib/components/TestMachineInstructions/TestMachineInstructions.svelte","../../../../../../src/lib/components/VoiceInstructions/VoiceInstructions.svelte","../../../../../../src/routes/setup/instructions/+page.svelte"],"sourcesContent":["// Paths on the bridge's HTTP port that lead to the child services it runs\n// (docs/usage/playwright-mcp.md). They are outside `API_PREFIX`: the bridge passes them through.\n\n/** The Playwright server (`connectOptions.wsEndpoint`): `ws://<bridge>:5151/playwright`. */\nexport const PLAYWRIGHT_PATH = '/playwright';\n\n/** Playwright MCP (streamable HTTP): `http://<bridge>:5151/playwright-mcp`. */\nexport const PLAYWRIGHT_MCP_PATH = '/playwright-mcp';\n","<script lang=\"ts\">\n import '@material/web/button/text-button.js';\n import '@material/web/icon/icon.js';\n\n type Props = {\n /** What the block holds, for the button's name: `Copy <label>`. */\n label: string;\n text: string;\n /** Resolves `false` when the browser didn't take it. */\n onCopy: (text: string) => Promise<boolean>;\n };\n\n let { label, text, onCopy }: Props = $props();\n\n /** What the last copy did, and of which text: a changed command has not been copied. */\n let copied = $state<{ text: string; ok: boolean } | null>(null);\n const result = $derived(\n copied === null || copied.text !== text\n ? ''\n : copied.ok\n ? 'Copied.'\n : 'Copying failed: select the text and copy it.',\n );\n\n async function copy(): Promise<void> {\n const wanted = text;\n copied = null; // so a second copy is announced again\n copied = { text: wanted, ok: await onCopy(wanted) };\n }\n</script>\n\n<div class=\"command\">\n <pre><code>{text}</code></pre>\n <!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->\n <md-text-button type=\"button\" aria-label=\"Copy {label}\" onclick={() => void copy()}>\n <md-icon slot=\"icon\" aria-hidden=\"true\">content_copy</md-icon>\n Copy\n </md-text-button>\n</div>\n<p role=\"status\">{result}</p>\n\n<style>\n .command {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: flex-end;\n gap: 4px 8px;\n margin: 0 0 4px;\n padding: 8px 8px 8px 12px;\n border-radius: 12px;\n background: var(--md-sys-color-surface-container-low);\n }\n\n pre {\n flex: 1 1 320px;\n min-width: 0;\n margin: 0;\n align-self: center;\n color: var(--md-sys-color-on-surface);\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n line-height: var(--app-mono-line-height);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n\n code {\n font-family: inherit;\n }\n\n p {\n margin: 0 0 8px;\n color: var(--md-sys-color-on-surface-variant);\n font-size: 13px;\n line-height: 18px;\n }\n\n p:empty {\n margin: 0 0 4px;\n }\n</style>\n","import { HOST_NAME_PATTERN, PLAYWRIGHT_MCP_PATH } from '@screenreader-speech-capture/shared';\n\n// The short setup steps of the Setup page, filled with the bridge's live values. Their home is\n// docs/usage/vm-setup.md (a test checks the commands against it).\n\n/** The port the default socket voice sends to, and the one the bridge listens on by default. */\nexport const DEFAULT_TCP_PORT = 4449;\nexport const DEFAULT_HTTP_PORT = 5151;\nconst DEFAULT_VOICE_HOST = '127.0.0.1';\n\n/** Installs the socket voice and registers the default one. */\nexport const INSTALL_VOICE = 'npm install -g text-to-socket-engine\\ntext-to-socket-engine-register';\n\nexport type VoiceSetup = {\n /** What the screen reader lists the voice as. */\n name: string;\n /** Adds a voice that sends to the bridge; `null` when the default voice already does. */\n addVoice: string | null;\n};\n\n/** The socket voice for a bridge that listens on `host` and `port` (`tcp` of the status). */\nexport function voiceSetup({ host, port }: { host: string; port: number }): VoiceSetup {\n // The voice runs on the bridge's machine, so it reaches a wildcard listener over loopback.\n const target = ['0.0.0.0', '::', 'localhost'].includes(host) ? DEFAULT_VOICE_HOST : host;\n const name = `Text To Socket ${target}:${port}`;\n if (target === DEFAULT_VOICE_HOST && port === DEFAULT_TCP_PORT) return { name, addVoice: null };\n const id = `ssc${port}`;\n return {\n name,\n addVoice: `text-to-socket-engine-add-voice ${id} \"${name}\" ${target} ${port} voice=${id}`,\n };\n}\n\nexport type BridgeAddress = {\n /** The bridge's URL as another machine reaches it. */\n url: string;\n /** The URL holds `<vm-ip>`: the page's own address wouldn't work from another machine. */\n placeholder: boolean;\n};\n\nconst isLoopback = (host: string): boolean =>\n ['localhost', '::1', '[::1]'].includes(host) || /^127(\\.\\d+){3}$/.test(host);\n\n/**\n * The address for the test machine: the one the page was opened with, which evidently reaches the\n * bridge. Opened over loopback (or by a name that doesn't belong in a command), the address is left\n * open and only the bridge's HTTP port is filled in.\n */\nexport function bridgeAddress(\n page: { hostname: string; origin: string },\n httpPort: number,\n): BridgeAddress {\n const { hostname, origin } = page;\n const plain =\n /^\\[[0-9a-fA-F:.]+\\]$/.test(hostname) || (hostname !== '*' && HOST_NAME_PATTERN.test(hostname));\n return plain && !isLoopback(hostname) && hostname !== '0.0.0.0'\n ? { url: origin, placeholder: false }\n : { url: `http://<vm-ip>:${httpPort}`, placeholder: true };\n}\n\n/** Whether `http.host` keeps other machines out. */\nexport function listensOnLoopbackOnly(httpHost: string): boolean {\n return isLoopback(httpHost);\n}\n\n/** Opens the bridge's HTTP port in the Windows firewall (administrator PowerShell). */\nexport function firewallCommand(httpPort: number): string {\n return (\n 'New-NetFirewallRule -DisplayName \"screenreader-speech-capture\" `\\n' +\n ` -Direction Inbound -Protocol TCP -LocalPort ${httpPort} -Action Allow -Profile Any`\n );\n}\n\n/** Stores the bridge's address for the client, and checks it. */\nexport function clientCommands(url: string): string {\n return [\n `npx @screenreader-speech-capture/client config set url ${url}`,\n 'npx @screenreader-speech-capture/client status',\n ].join('\\n');\n}\n\n/** The test project's packages; Playwright must match the bridge's version exactly. */\nexport function playwrightInstall(version: string): string {\n return `npm i -D @screenreader-speech-capture/client @playwright/test@${version} @types/node`;\n}\n\n/** The entry of an MCP client's configuration for the bridge's Playwright MCP. */\nexport function mcpClientConfig(url: string): string {\n const server = { url: `${url}${PLAYWRIGHT_MCP_PATH}` };\n return JSON.stringify({ mcpServers: { 'screenreader-vm': server } }, null, 2);\n}\n\n/** Puts text on the viewer's clipboard. */\nexport interface Clipboard {\n /** `false` when the browser didn't take it. */\n copy(text: string): Promise<boolean>;\n}\n","<script lang=\"ts\">\n import { resolve } from '$app/paths';\n import type { ServiceStatusDto } from '@screenreader-speech-capture/shared';\n import CommandBlock from '#lib/components/CommandBlock/CommandBlock.svelte';\n import ExternalLink from '#lib/components/ExternalLink/ExternalLink.svelte';\n import {\n clientCommands,\n firewallCommand,\n mcpClientConfig,\n playwrightInstall,\n type BridgeAddress,\n } from '#lib/core/instructions.js';\n import { docsUrl } from '#lib/core/setup.js';\n\n type Props = {\n address: BridgeAddress;\n /** The page is opened on the bridge's machine: nothing shows yet that others reach it. */\n local: boolean;\n /** `http.host` keeps other machines out. */\n loopbackOnly: boolean;\n httpPort: number;\n /** The services as the status has them; `null` until known. */\n playwright: ServiceStatusDto | null;\n mcp: ServiceStatusDto | null;\n version: string | null;\n onCopy: (text: string) => Promise<boolean>;\n };\n\n let { address, local, loopbackOnly, httpPort, playwright, mcp, version, onCopy }: Props =\n $props();\n\n const docs = (path: string) => docsUrl(version, path);\n</script>\n\n<section class=\"part\" aria-labelledby=\"machine-heading\">\n <h2 id=\"machine-heading\">Test machine</h2>\n\n {#if loopbackOnly}\n <p class=\"warning\">\n The bridge only listens on its own machine, so other machines can't connect. Start it without\n <code>--http-host</code>, or with an address they reach.\n </p>\n {/if}\n\n {#if local}\n <p>\n Windows can block the port without asking. On the bridge's machine, in an\n <strong>administrator</strong> PowerShell (<ExternalLink\n href={docs('usage/vm-setup.md#firewall')}\n >\n firewall\n </ExternalLink>):\n </p>\n <CommandBlock label=\"the firewall command\" text={firewallCommand(httpPort)} {onCopy} />\n {:else}\n <p>This machine already reaches the bridge, so the firewall lets it through.</p>\n {/if}\n\n <p>On the test machine (Node 20 or newer), store the bridge's address and check it:</p>\n <CommandBlock label=\"the client commands\" text={clientCommands(address.url)} {onCopy} />\n {#if address.placeholder}\n <p>\n Replace <code><vm-ip></code> with the VM's address: one from the\n <code>HTTP API</code> row of the bridge's start output, or from <code>ipconfig</code> on the VM.\n </p>\n {/if}\n\n <h3>Playwright tests</h3>\n {#if playwright?.state === 'stopped'}\n <p>The Playwright server is off. <a href={resolve('/settings')}>Turn it on in Settings.</a></p>\n {:else if playwright !== null}\n <p>The test project needs exactly the bridge's Playwright version:</p>\n <CommandBlock\n label=\"the test packages command\"\n text={playwrightInstall(playwright.version)}\n {onCopy}\n />\n {/if}\n <p>\n <ExternalLink href={docs('usage/client.md')}>\n Set up the tests with the test client\n </ExternalLink>\n </p>\n\n <h3>AI agents</h3>\n {#if mcp?.state === 'stopped'}\n <p>Playwright MCP is off. <a href={resolve('/settings')}>Turn it on in Settings.</a></p>\n {:else}\n <p>Point the agent's MCP client at the bridge:</p>\n <CommandBlock label=\"the MCP configuration\" text={mcpClientConfig(address.url)} {onCopy} />\n {/if}\n <p>\n <ExternalLink href={docs('usage/agents.md')}>How agents use the bridge</ExternalLink>\n </p>\n</section>\n\n<style>\n p {\n margin: 0 0 8px;\n color: var(--md-sys-color-on-surface);\n font-size: 14px;\n line-height: 20px;\n overflow-wrap: anywhere;\n }\n\n .warning {\n padding: 12px 16px;\n border-radius: 12px;\n background: var(--app-warning-container);\n color: var(--app-on-warning-container);\n }\n\n h3 {\n margin: 16px 0 4px;\n color: var(--md-sys-color-on-surface);\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n }\n\n code {\n font-family: var(--app-font-mono);\n font-size: 0.95em;\n }\n\n /* The links to the settings; the doc links style themselves. */\n p a {\n color: var(--md-sys-color-primary);\n }\n</style>\n","<script lang=\"ts\">\n import CommandBlock from '#lib/components/CommandBlock/CommandBlock.svelte';\n import ExternalLink from '#lib/components/ExternalLink/ExternalLink.svelte';\n import { DEFAULT_TCP_PORT, INSTALL_VOICE, voiceSetup } from '#lib/core/instructions.js';\n import { docsUrl, SCREEN_READER_ID } from '#lib/core/setup.js';\n\n type Props = {\n /** Where the bridge listens for speech; `null` until known (the defaults are shown). */\n tcp: { host: string; port: number } | null;\n version: string | null;\n onCopy: (text: string) => Promise<boolean>;\n };\n\n let { tcp, version, onCopy }: Props = $props();\n\n const voice = $derived(voiceSetup(tcp ?? { host: '127.0.0.1', port: DEFAULT_TCP_PORT }));\n const docs = (path: string) => docsUrl(version, path);\n</script>\n\n<section class=\"part\" aria-labelledby=\"voice-heading\">\n <h2 id=\"voice-heading\">Socket voice</h2>\n <p>On the bridge's machine, in an <strong>administrator</strong> prompt:</p>\n <CommandBlock label=\"the install commands\" text={INSTALL_VOICE} {onCopy} />\n {#if voice.addVoice !== null}\n <p>\n The default voice doesn't send to where this bridge listens. Add a voice that does, in the\n same prompt:\n </p>\n <CommandBlock label=\"the add-voice command\" text={voice.addVoice} {onCopy} />\n {/if}\n <ul class=\"more\">\n <li>\n <ExternalLink href={docs('usage/troubleshooting.md#speech')}>\n The voice is not listed\n </ExternalLink>\n </li>\n <li>\n <ExternalLink href={docs('usage/vm-setup.md#more-voices--other-ports')}>\n More voices, and removing them\n </ExternalLink>\n </li>\n </ul>\n</section>\n\n<section class=\"part\" aria-labelledby={SCREEN_READER_ID}>\n <!-- Focusable: the check's links jump here. -->\n <h2 id={SCREEN_READER_ID} tabindex=\"-1\">Screen reader</h2>\n <p>Select the voice <strong>{voice.name}</strong>.</p>\n\n <h3>NVDA</h3>\n <ol>\n <li>Open the NVDA menu (NVDA+N) → Preferences → Settings… → Speech.</li>\n <li>Under Synthesizer, choose Change… → Microsoft Speech API version 5 → OK.</li>\n <li>Under Voice, select {voice.name}.</li>\n </ol>\n\n <h3>JAWS</h3>\n <ol>\n <li>Open JAWS → Options → Voices → Voice Adjustment….</li>\n <li>\n Create or select a voice profile and set its Synthesizer to SAPI 5 (the label can differ\n between JAWS versions).\n </li>\n <li>Select {voice.name} as the Voice, apply it to all contexts and save the profile.</li>\n <li>\n In Settings Center (Insert+F2), turn off <em>Detect Language Changes</em> (German:\n <em lang=\"de\">Sprachwechsel erkennen</em>), or web pages are read by another voice.\n </li>\n </ol>\n\n <ul class=\"more\">\n <li>\n <ExternalLink href={docs('usage/vm-setup.md#a-german-voice')}>\n JAWS in German or another language doesn't list the voice\n </ExternalLink>\n </li>\n <li>\n <ExternalLink href={docs('usage/vm-setup.md#prepare-the-vm')}>\n Prepare the VM for CI\n </ExternalLink>\n </li>\n <li>\n <ExternalLink href={docs('usage/vm-setup.md#screen-reader-licensing')}>\n Screen reader licensing\n </ExternalLink>\n </li>\n </ul>\n</section>\n\n<style>\n p,\n ol,\n .more {\n margin: 0 0 8px;\n color: var(--md-sys-color-on-surface);\n font-size: 14px;\n line-height: 20px;\n overflow-wrap: anywhere;\n }\n\n h3 {\n margin: 16px 0 4px;\n color: var(--md-sys-color-on-surface);\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n }\n\n ol,\n .more {\n padding-left: 20px;\n }\n\n li + li {\n margin-top: 4px;\n }\n\n .more {\n margin: 16px 0 0;\n }\n</style>\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { page } from '$app/state';\n import TestMachineInstructions from '#lib/components/TestMachineInstructions/TestMachineInstructions.svelte';\n import VoiceInstructions from '#lib/components/VoiceInstructions/VoiceInstructions.svelte';\n import { appStores } from '#lib/composition.js';\n import {\n bridgeAddress,\n DEFAULT_HTTP_PORT,\n listensOnLoopbackOnly,\n } from '#lib/core/instructions.js';\n import type { PageProps } from './$types';\n\n let { data }: PageProps = $props();\n\n const { status: statusStore, clipboard } = appStores();\n\n // On the server the status store is still empty, the layout's load has the status.\n const status = $derived(statusStore.status ?? data.status);\n const httpPort = $derived(data.http?.port ?? DEFAULT_HTTP_PORT);\n const copy = (text: string) => clipboard.copy(text);\n\n // The layout's status is as old as the app's first page; the steps use the current values.\n onMount(() => void statusStore.retry());\n</script>\n\n<svelte:head>\n <title>Setup instructions · Speech Capture</title>\n</svelte:head>\n\n<VoiceInstructions\n tcp={status?.tcp ?? null}\n version={status?.bridge.version ?? null}\n onCopy={copy}\n/>\n\n<TestMachineInstructions\n address={bridgeAddress(page.url, httpPort)}\n local={data.local}\n loopbackOnly={data.http !== null && listensOnLoopbackOnly(data.http.host)}\n {httpPort}\n playwright={status?.playwright ?? null}\n mcp={status?.mcp ?? null}\n version={status?.bridge.version ?? null}\n onCopy={copy}\n/>\n"],"mappings":";;;;;;;;;;;;AAOA,IAAa,sBAAsB;;;CCPnC,WAAA,WAAA,eAAA;;;EAYE,IAAI,EAAE,OAAO,MAAM,WAAe;EAIlC,MAAM,SAAMA,cAEN,EAGgD;EAW1C,WAAA,KAAA,gGAAAC,YAAA,IAAI,EAAA,6CAAAC,KAAA,cAAA,QAAAC,UAEgC,KAAK,GAAA,EAAA,sIAAAF,YAKrC,OAAM,CAAA,EAAA,KAAA;CAVhB,CAAA;;ACrBR,IAAM,qBAAqB;;AAG3B,IAAa,gBAAgB;;AAU7B,SAAgB,WAAW,EAAE,MAAM,QAAoD;CAErF,MAAM,SAAS;EAAC;EAAW;EAAM;CAAW,CAAC,CAAC,SAAS,IAAI,IAAI,qBAAqB;CACpF,MAAM,OAAO,kBAAkB,OAAO,GAAG;CACzC,IAAI,WAAW,sBAAsB,SAAA,MAA2B,OAAO;EAAE;EAAM,UAAU;CAAK;CAC9F,MAAM,KAAK,MAAM;CACjB,OAAO;EACL;EACA,UAAU,mCAAmC,GAAG,IAAI,KAAK,IAAI,OAAO,GAAG,KAAK,SAAS;CACvF;AACF;AASA,IAAM,cAAc,SAClB;CAAC;CAAa;CAAO;AAAO,CAAC,CAAC,SAAS,IAAI,KAAK,kBAAkB,KAAK,IAAI;;;;;;AAO7E,SAAgB,cACd,MACA,UACe;CACf,MAAM,EAAE,UAAU,WAAW;CAG7B,QADE,uBAAuB,KAAK,QAAQ,KAAM,aAAa,OAAO,kBAAkB,KAAK,QAAQ,MAC/E,CAAC,WAAW,QAAQ,KAAK,aAAa,YAClD;EAAE,KAAK;EAAQ,a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AK,IAAI;GACvE,UAAA,SAAQ;GACG,YAAA,OAAM,CAAA,EAAE,cAAc;GAC7B,KAAA,OAAM,CAAA,EAAE,OAAO;GACX,SAAA,OAAM,CAAA,EAAE,OAAO,WAAW;GAC3B,QAAA;;;CApBF,CAAA"}
|
|
1
|
+
{"version":3,"file":"_page.svelte.js","names":["$.derived","$.escape","$.attr","$.stringify","$.attr","$.derived","$.attr","$.escape","$.derived","onMount"],"sources":["../../../../../../../shared/src/rules/service-paths.ts","../../../../../../src/lib/components/CommandBlock/CommandBlock.svelte","../../../../../../src/lib/core/instructions.ts","../../../../../../src/lib/components/TestMachineInstructions/TestMachineInstructions.svelte","../../../../../../src/lib/components/VoiceInstructions/VoiceInstructions.svelte","../../../../../../src/routes/setup/instructions/+page.svelte"],"sourcesContent":["// Paths on the bridge's HTTP port that lead to the child services it runs\n// (docs/usage/playwright-mcp.md). They are outside `API_PREFIX`: the bridge passes them through.\n\n/** The Playwright server (`connectOptions.wsEndpoint`): `ws://<bridge>:5151/playwright`. */\nexport const PLAYWRIGHT_PATH = '/playwright';\n\n/** Playwright MCP (streamable HTTP): `http://<bridge>:5151/playwright-mcp`. */\nexport const PLAYWRIGHT_MCP_PATH = '/playwright-mcp';\n","<script lang=\"ts\">\n import '@material/web/button/text-button.js';\n import '@material/web/icon/icon.js';\n\n type Props = {\n /** What the block holds, for the button's name: `Copy <label>`. */\n label: string;\n text: string;\n /** Resolves `false` when the browser didn't take it. */\n onCopy: (text: string) => Promise<boolean>;\n };\n\n let { label, text, onCopy }: Props = $props();\n\n /** What the last copy did, and of which text: a changed command has not been copied. */\n let copied = $state<{ text: string; ok: boolean } | null>(null);\n const result = $derived(\n copied === null || copied.text !== text\n ? ''\n : copied.ok\n ? 'Copied.'\n : 'Copying failed: select the text and copy it.',\n );\n\n async function copy(): Promise<void> {\n const wanted = text;\n copied = null; // so a second copy is announced again\n copied = { text: wanted, ok: await onCopy(wanted) };\n }\n</script>\n\n<div class=\"command\">\n <pre><code>{text}</code></pre>\n <!-- svelte-ignore a11y_click_events_have_key_events, a11y_no_static_element_interactions -->\n <md-text-button type=\"button\" aria-label=\"Copy {label}\" onclick={() => void copy()}>\n <md-icon slot=\"icon\" aria-hidden=\"true\">content_copy</md-icon>\n Copy\n </md-text-button>\n</div>\n<p role=\"status\">{result}</p>\n\n<style>\n .command {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: flex-end;\n gap: 4px 8px;\n margin: 0 0 4px;\n padding: 8px 8px 8px 12px;\n border-radius: 12px;\n background: var(--md-sys-color-surface-container-low);\n }\n\n pre {\n flex: 1 1 320px;\n min-width: 0;\n margin: 0;\n align-self: center;\n color: var(--md-sys-color-on-surface);\n font-family: var(--app-font-mono);\n font-size: var(--app-mono-size);\n line-height: var(--app-mono-line-height);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n\n code {\n font-family: inherit;\n }\n\n p {\n margin: 0 0 8px;\n color: var(--md-sys-color-on-surface-variant);\n font-size: 13px;\n line-height: 18px;\n }\n\n p:empty {\n margin: 0 0 4px;\n }\n</style>\n","import { HOST_NAME_PATTERN, PLAYWRIGHT_MCP_PATH } from '@screenreader-speech-capture/shared';\n\n// The short setup steps of the Setup page, filled with the bridge's live values. Their home is\n// docs/usage/vm-setup.md (a test checks the commands against it).\n\n/** The port the default socket voice sends to, and the one the bridge listens on by default. */\nexport const DEFAULT_TCP_PORT = 4449;\nexport const DEFAULT_HTTP_PORT = 5151;\nconst DEFAULT_VOICE_HOST = '127.0.0.1';\n\n/** Installs the socket voice and registers the default one. */\nexport const INSTALL_VOICE = 'npm install -g text-to-socket-engine\\ntext-to-socket-engine-register';\n\nexport type VoiceSetup = {\n /** What the screen reader lists the voice as. */\n name: string;\n /** Adds a voice that sends to the bridge; `null` when the default voice already does. */\n addVoice: string | null;\n};\n\n/** The socket voice for a bridge that listens on `host` and `port` (`tcp` of the status). */\nexport function voiceSetup({ host, port }: { host: string; port: number }): VoiceSetup {\n // The voice runs on the bridge's machine, so it reaches a wildcard listener over loopback.\n const target = ['0.0.0.0', '::', 'localhost'].includes(host) ? DEFAULT_VOICE_HOST : host;\n const name = `Text To Socket ${target}:${port}`;\n if (target === DEFAULT_VOICE_HOST && port === DEFAULT_TCP_PORT) return { name, addVoice: null };\n const id = `ssc${port}`;\n return {\n name,\n addVoice: `text-to-socket-engine-add-voice ${id} \"${name}\" ${target} ${port} voice=${id}`,\n };\n}\n\nexport type BridgeAddress = {\n /** The bridge's URL as another machine reaches it. */\n url: string;\n /** The URL holds `<vm-ip>`: the page's own address wouldn't work from another machine. */\n placeholder: boolean;\n};\n\nconst isLoopback = (host: string): boolean =>\n ['localhost', '::1', '[::1]'].includes(host) || /^127(\\.\\d+){3}$/.test(host);\n\n/**\n * The address for the test machine: the one the page was opened with, which evidently reaches the\n * bridge. Opened over loopback (or by a name that doesn't belong in a command), the address is left\n * open and only the bridge's HTTP port is filled in.\n */\nexport function bridgeAddress(\n page: { hostname: string; origin: string },\n httpPort: number,\n): BridgeAddress {\n const { hostname, origin } = page;\n const plain =\n /^\\[[0-9a-fA-F:.]+\\]$/.test(hostname) || (hostname !== '*' && HOST_NAME_PATTERN.test(hostname));\n return plain && !isLoopback(hostname) && hostname !== '0.0.0.0'\n ? { url: origin, placeholder: false }\n : { url: `http://<vm-ip>:${httpPort}`, placeholder: true };\n}\n\n/** Whether `http.host` keeps other machines out. */\nexport function listensOnLoopbackOnly(httpHost: string): boolean {\n return isLoopback(httpHost);\n}\n\n/** Opens the bridge's HTTP port in the Windows firewall (administrator PowerShell). */\nexport function firewallCommand(httpPort: number): string {\n return (\n 'New-NetFirewallRule -DisplayName \"screenreader-speech-capture\" `\\n' +\n ` -Direction Inbound -Protocol TCP -LocalPort ${httpPort} -Action Allow -Profile Any`\n );\n}\n\n/** Stores the bridge's address for the client, and checks it. */\nexport function clientCommands(url: string): string {\n return [\n `npx @screenreader-speech-capture/client config set url ${url}`,\n 'npx @screenreader-speech-capture/client status',\n ].join('\\n');\n}\n\n/** The test project's packages; Playwright must match the bridge's version exactly. */\nexport function playwrightInstall(version: string): string {\n return `npm i -D @screenreader-speech-capture/client @playwright/test@${version} @types/node`;\n}\n\n/** The entry of an MCP client's configuration for the bridge's Playwright MCP. */\nexport function mcpClientConfig(url: string): string {\n const server = { url: `${url}${PLAYWRIGHT_MCP_PATH}` };\n return JSON.stringify({ mcpServers: { 'screenreader-vm': server } }, null, 2);\n}\n\n/** Puts text on the viewer's clipboard. */\nexport interface Clipboard {\n /** `false` when the browser didn't take it. */\n copy(text: string): Promise<boolean>;\n}\n","<script lang=\"ts\">\n import { resolve } from '$app/paths';\n import type { ServiceStatusDto } from '@screenreader-speech-capture/shared';\n import CommandBlock from '#lib/components/CommandBlock/CommandBlock.svelte';\n import ExternalLink from '#lib/components/ExternalLink/ExternalLink.svelte';\n import {\n clientCommands,\n firewallCommand,\n mcpClientConfig,\n playwrightInstall,\n type BridgeAddress,\n } from '#lib/core/instructions.js';\n import { docsUrl } from '#lib/core/setup.js';\n\n type Props = {\n address: BridgeAddress;\n /** The page is opened on the bridge's machine: nothing shows yet that others reach it. */\n local: boolean;\n /** `http.host` keeps other machines out. */\n loopbackOnly: boolean;\n httpPort: number;\n /** The services as the status has them; `null` until known. */\n playwright: ServiceStatusDto | null;\n mcp: ServiceStatusDto | null;\n version: string | null;\n onCopy: (text: string) => Promise<boolean>;\n };\n\n let { address, local, loopbackOnly, httpPort, playwright, mcp, version, onCopy }: Props =\n $props();\n\n const docs = (path: string) => docsUrl(version, path);\n</script>\n\n<section class=\"part\" aria-labelledby=\"machine-heading\">\n <h2 id=\"machine-heading\">Test machine</h2>\n\n {#if loopbackOnly}\n <p class=\"warning\">\n The bridge only listens on its own machine, so other machines can't connect. Start it without\n <code>--http-host</code>, or with an address they reach.\n </p>\n {/if}\n\n {#if local}\n <p>\n Windows can block the port without asking. On the bridge's machine, in an\n <strong>administrator</strong> PowerShell (<ExternalLink\n href={docs('usage/vm-setup.md#firewall')}\n >\n firewall\n </ExternalLink>):\n </p>\n <CommandBlock label=\"the firewall command\" text={firewallCommand(httpPort)} {onCopy} />\n {:else}\n <p>This machine already reaches the bridge, so the firewall lets it through.</p>\n {/if}\n\n <p>On the test machine (Node 20 or newer), store the bridge's address and check it:</p>\n <CommandBlock label=\"the client commands\" text={clientCommands(address.url)} {onCopy} />\n {#if address.placeholder}\n <p>\n Replace <code><vm-ip></code> with the VM's address: one from the\n <code>HTTP API</code> row of the bridge's start output, or from <code>ipconfig</code> on the VM.\n </p>\n {/if}\n\n <h3>Playwright tests</h3>\n {#if playwright?.state === 'stopped'}\n <p>The Playwright server is off. <a href={resolve('/settings')}>Turn it on in Settings.</a></p>\n {:else if playwright !== null}\n <p>The test project needs exactly the bridge's Playwright version:</p>\n <CommandBlock\n label=\"the test packages command\"\n text={playwrightInstall(playwright.version)}\n {onCopy}\n />\n {/if}\n <p>\n <ExternalLink href={docs('usage/client.md')}>\n Set up the tests with the test client\n </ExternalLink>\n </p>\n\n <h3>AI agents</h3>\n {#if mcp?.state === 'stopped'}\n <p>Playwright MCP is off. <a href={resolve('/settings')}>Turn it on in Settings.</a></p>\n {:else}\n <p>Point the agent's MCP client at the bridge:</p>\n <CommandBlock label=\"the MCP configuration\" text={mcpClientConfig(address.url)} {onCopy} />\n {/if}\n <p>\n <ExternalLink href={docs('usage/agents.md')}>How agents use the bridge</ExternalLink>\n </p>\n</section>\n\n<style>\n p {\n margin: 0 0 8px;\n color: var(--md-sys-color-on-surface);\n font-size: 14px;\n line-height: 20px;\n overflow-wrap: anywhere;\n }\n\n .warning {\n padding: 12px 16px;\n border-radius: 12px;\n background: var(--app-warning-container);\n color: var(--app-on-warning-container);\n }\n\n h3 {\n margin: 16px 0 4px;\n color: var(--md-sys-color-on-surface);\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n }\n\n code {\n font-family: var(--app-font-mono);\n font-size: 0.95em;\n }\n\n /* The links to the settings; the doc links style themselves. */\n p a {\n color: var(--md-sys-color-primary);\n }\n</style>\n","<script lang=\"ts\">\n import CommandBlock from '#lib/components/CommandBlock/CommandBlock.svelte';\n import ExternalLink from '#lib/components/ExternalLink/ExternalLink.svelte';\n import { DEFAULT_TCP_PORT, INSTALL_VOICE, voiceSetup } from '#lib/core/instructions.js';\n import { docsUrl, SCREEN_READER_ID } from '#lib/core/setup.js';\n\n type Props = {\n /** Where the bridge listens for speech; `null` until known (the defaults are shown). */\n tcp: { host: string; port: number } | null;\n version: string | null;\n onCopy: (text: string) => Promise<boolean>;\n };\n\n let { tcp, version, onCopy }: Props = $props();\n\n const voice = $derived(voiceSetup(tcp ?? { host: '127.0.0.1', port: DEFAULT_TCP_PORT }));\n const docs = (path: string) => docsUrl(version, path);\n</script>\n\n<section class=\"part\" aria-labelledby=\"voice-heading\">\n <h2 id=\"voice-heading\">Socket voice</h2>\n <p>On the bridge's machine, in an <strong>administrator</strong> prompt:</p>\n <CommandBlock label=\"the install commands\" text={INSTALL_VOICE} {onCopy} />\n {#if voice.addVoice !== null}\n <p>\n The default voice doesn't send to where this bridge listens. Add a voice that does, in the\n same prompt:\n </p>\n <CommandBlock label=\"the add-voice command\" text={voice.addVoice} {onCopy} />\n {/if}\n <ul class=\"more\">\n <li>\n <ExternalLink href={docs('usage/troubleshooting.md#speech')}>\n The voice is not listed\n </ExternalLink>\n </li>\n <li>\n <ExternalLink href={docs('usage/vm-setup.md#more-voices--other-ports')}>\n More voices, and removing them\n </ExternalLink>\n </li>\n </ul>\n</section>\n\n<section class=\"part\" aria-labelledby={SCREEN_READER_ID}>\n <!-- Focusable: the check's links jump here. -->\n <h2 id={SCREEN_READER_ID} tabindex=\"-1\">Screen reader</h2>\n <p>Select the voice <strong>{voice.name}</strong>.</p>\n\n <h3>NVDA</h3>\n <ol>\n <li>Open the NVDA menu (NVDA+N) → Preferences → Settings… → Speech.</li>\n <li>Under Synthesizer, choose Change… → Microsoft Speech API version 5 → OK.</li>\n <li>Under Voice, select {voice.name}.</li>\n </ol>\n\n <h3>JAWS</h3>\n <ol>\n <li>Open JAWS → Options → Voices → Voice Adjustment….</li>\n <li>\n Create or select a voice profile and set its Synthesizer to SAPI 5 (the label can differ\n between JAWS versions).\n </li>\n <li>Select {voice.name} as the Voice, apply it to all contexts and save the profile.</li>\n <li>\n In Settings Center (Insert+F2), turn off <em>Detect Language Changes</em> (German:\n <em lang=\"de\">Sprachwechsel erkennen</em>), or web pages are read by another voice.\n </li>\n </ol>\n\n <ul class=\"more\">\n <li>\n <ExternalLink href={docs('usage/vm-setup.md#a-german-voice')}>\n JAWS in German or another language doesn't list the voice\n </ExternalLink>\n </li>\n <li>\n <ExternalLink href={docs('usage/vm-setup.md#prepare-the-vm')}>\n Prepare the VM for CI\n </ExternalLink>\n </li>\n <li>\n <ExternalLink href={docs('usage/vm-setup.md#screen-reader-licensing')}>\n Screen reader licensing\n </ExternalLink>\n </li>\n </ul>\n</section>\n\n<style>\n p,\n ol,\n .more {\n margin: 0 0 8px;\n color: var(--md-sys-color-on-surface);\n font-size: 14px;\n line-height: 20px;\n overflow-wrap: anywhere;\n }\n\n h3 {\n margin: 16px 0 4px;\n color: var(--md-sys-color-on-surface);\n font-size: 16px;\n font-weight: 500;\n line-height: 24px;\n }\n\n ol,\n .more {\n padding-left: 20px;\n }\n\n li + li {\n margin-top: 4px;\n }\n\n .more {\n margin: 16px 0 0;\n }\n</style>\n","<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { page } from '$app/state';\n import TestMachineInstructions from '#lib/components/TestMachineInstructions/TestMachineInstructions.svelte';\n import VoiceInstructions from '#lib/components/VoiceInstructions/VoiceInstructions.svelte';\n import { appStores } from '#lib/composition.js';\n import {\n bridgeAddress,\n DEFAULT_HTTP_PORT,\n listensOnLoopbackOnly,\n } from '#lib/core/instructions.js';\n import type { PageProps } from './$types';\n\n let { data }: PageProps = $props();\n\n const { status: statusStore, clipboard } = appStores();\n\n // On the server the status store is still empty, the layout's load has the status.\n const status = $derived(statusStore.status ?? data.status);\n const httpPort = $derived(data.http?.port ?? DEFAULT_HTTP_PORT);\n const copy = (text: string) => clipboard.copy(text);\n\n // The layout's status is as old as the app's first page; the steps use the current values.\n onMount(() => void statusStore.retry());\n</script>\n\n<svelte:head>\n <title>Setup instructions · Speech Capture</title>\n</svelte:head>\n\n<VoiceInstructions\n tcp={status?.tcp ?? null}\n version={status?.bridge.version ?? null}\n onCopy={copy}\n/>\n\n<TestMachineInstructions\n address={bridgeAddress(page.url, httpPort)}\n local={data.local}\n loopbackOnly={data.http !== null && listensOnLoopbackOnly(data.http.host)}\n {httpPort}\n playwright={status?.playwright ?? null}\n mcp={status?.mcp ?? null}\n version={status?.bridge.version ?? null}\n onCopy={copy}\n/>\n"],"mappings":";;;;;;;;;;;;AAOA,IAAa,sBAAsB;;;CCPnC,WAAA,WAAA,eAAA;;;EAYE,IAAI,EAAE,OAAO,MAAM,WAAe;EAIlC,MAAM,SAAMA,cAEN,EAGgD;EAW1C,WAAA,KAAA,gGAAAC,YAAA,IAAI,EAAA,6CAAAC,KAAA,cAAA,QAAAC,UAEgC,KAAK,GAAA,EAAA,sIAAAF,YAKrC,OAAM,CAAA,EAAA,KAAA;CAVhB,CAAA;;ACrBR,IAAM,qBAAqB;;AAG3B,IAAa,gBAAgB;;AAU7B,SAAgB,WAAW,EAAE,MAAM,QAAoD;CAErF,MAAM,SAAS;EAAC;EAAW;EAAM;CAAW,CAAC,CAAC,SAAS,IAAI,IAAI,qBAAqB;CACpF,MAAM,OAAO,kBAAkB,OAAO,GAAG;CACzC,IAAI,WAAW,sBAAsB,SAAA,MAA2B,OAAO;EAAE;EAAM,UAAU;CAAK;CAC9F,MAAM,KAAK,MAAM;CACjB,OAAO;EACL;EACA,UAAU,mCAAmC,GAAG,IAAI,KAAK,IAAI,OAAO,GAAG,KAAK,SAAS;CACvF;AACF;AASA,IAAM,cAAc,SAClB;CAAC;CAAa;CAAO;AAAO,CAAC,CAAC,SAAS,IAAI,KAAK,kBAAkB,KAAK,IAAI;;;;;;AAO7E,SAAgB,cACd,MACA,UACe;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;GACX,SAAA,OAAM,CAAA,EAAE,OAAO,WAAW;GAC3B,QAAA;;;;GAIC,SAAA,cAAc,KAAK,KAAK,SAAQ,CAAA;GAClC,OAAA,KAAK;GACE,cAAA,KAAK,SAAS,QAAQ,sBAAsB,KAAK,KAAK,IAAI;GACvE,UAAA,SAAQ;GACG,YAAA,OAAM,CAAA,EAAE,cAAc;GAC7B,KAAA,OAAM,CAAA,EAAE,OAAO;GACX,SAAA,OAAM,CAAA,EAAE,OAAO,WAAW;GAC3B,QAAA;;;CApBF,CAAA"}
|
|
@@ -9,7 +9,7 @@ return {
|
|
|
9
9
|
app_path: "ui/_app",
|
|
10
10
|
assets: new Set(["robots.txt"]),
|
|
11
11
|
mime_types: {".txt":"text/plain"},
|
|
12
|
-
client: {start:"_app/immutable/entry/start.DqIv9xYX.js",app:"_app/immutable/entry/app.
|
|
12
|
+
client: {start:"_app/immutable/entry/start.DqIv9xYX.js",app:"_app/immutable/entry/app.DM2PRoLw.js",imports:["_app/immutable/entry/start.DqIv9xYX.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/DUTjbZNf.js","_app/immutable/chunks/DzInmTUe.js","_app/immutable/chunks/Dvxhfd7j.js","_app/immutable/chunks/D0famktY.js","_app/immutable/chunks/0FroJ-XN.js","_app/immutable/entry/app.DM2PRoLw.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
13
13
|
|
|
14
14
|
nodes: [
|
|
15
15
|
__memo(() => import('./nodes/0.js')),
|
|
@@ -9,7 +9,7 @@ return {
|
|
|
9
9
|
app_path: "ui/_app",
|
|
10
10
|
assets: new Set(["robots.txt"]),
|
|
11
11
|
mime_types: {".txt":"text/plain"},
|
|
12
|
-
client: {start:"_app/immutable/entry/start.DqIv9xYX.js",app:"_app/immutable/entry/app.
|
|
12
|
+
client: {start:"_app/immutable/entry/start.DqIv9xYX.js",app:"_app/immutable/entry/app.DM2PRoLw.js",imports:["_app/immutable/entry/start.DqIv9xYX.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/DUTjbZNf.js","_app/immutable/chunks/DzInmTUe.js","_app/immutable/chunks/Dvxhfd7j.js","_app/immutable/chunks/D0famktY.js","_app/immutable/chunks/0FroJ-XN.js","_app/immutable/entry/app.DM2PRoLw.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
13
13
|
|
|
14
14
|
nodes: [
|
|
15
15
|
__memo(() => import('./nodes/0.js')),
|
|
@@ -5,6 +5,6 @@ let component_cache;
|
|
|
5
5
|
export const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;
|
|
6
6
|
export { server };
|
|
7
7
|
export const server_id = "src/routes/+layout.server.ts";
|
|
8
|
-
export const imports = ["_app/immutable/nodes/0.
|
|
8
|
+
export const imports = ["_app/immutable/nodes/0.fKLM0nQo.js","_app/immutable/chunks/0FroJ-XN.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/D0famktY.js","_app/immutable/chunks/DHsTyp2W.js","_app/immutable/chunks/B_ZElYu_.js","_app/immutable/chunks/BfHif6xP.js","_app/immutable/chunks/ux9AxWa3.js","_app/immutable/chunks/Dvxhfd7j.js","_app/immutable/chunks/Roub4aju.js","_app/immutable/chunks/KD5R77Wj.js","_app/immutable/chunks/Bvlvl8SZ.js"];
|
|
9
9
|
export const stylesheets = ["_app/immutable/assets/0.ONZWQgDA.css"];
|
|
10
10
|
export const fonts = [{"file":"_app/immutable/assets/material-symbols-outlined-latin-400-normal.BhEvR8fk.woff2","filename":"node_modules/@fontsource/material-symbols-outlined/files/material-symbols-outlined-latin-400-normal.woff2"},{"file":"_app/immutable/assets/roboto-flex-cyrillic-ext-opsz-normal.nDQikIyu.woff2","filename":"node_modules/@fontsource-variable/roboto-flex/files/roboto-flex-cyrillic-ext-opsz-normal.woff2"},{"file":"_app/immutable/assets/roboto-flex-cyrillic-opsz-normal.SjuC5rw5.woff2","filename":"node_modules/@fontsource-variable/roboto-flex/files/roboto-flex-cyrillic-opsz-normal.woff2"},{"file":"_app/immutable/assets/roboto-flex-greek-opsz-normal.C14fFRny.woff2","filename":"node_modules/@fontsource-variable/roboto-flex/files/roboto-flex-greek-opsz-normal.woff2"},{"file":"_app/immutable/assets/roboto-flex-vietnamese-opsz-normal.C-H_yGOU.woff2","filename":"node_modules/@fontsource-variable/roboto-flex/files/roboto-flex-vietnamese-opsz-normal.woff2"},{"file":"_app/immutable/assets/roboto-flex-latin-ext-opsz-normal.xNclTVCo.woff2","filename":"node_modules/@fontsource-variable/roboto-flex/files/roboto-flex-latin-ext-opsz-normal.woff2"},{"file":"_app/immutable/assets/roboto-flex-latin-opsz-normal.hy8fyBBC.woff2","filename":"node_modules/@fontsource-variable/roboto-flex/files/roboto-flex-latin-opsz-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.BHxv52bw.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-cyrillic-ext-400-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-cyrillic-ext-400-normal.W26xs1TL.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-cyrillic-ext-400-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-cyrillic-400-normal.C-_K-ZCn.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-cyrillic-400-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-cyrillic-400-normal.B3hIXASd.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-cyrillic-400-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-greek-400-normal.CH_u3Aru.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-greek-400-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-greek-400-normal.P8xe1gs1.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-greek-400-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-vietnamese-400-normal.yYTFiTTs.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-vietnamese-400-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-vietnamese-400-normal.CzWHQABp.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-vietnamese-400-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-latin-ext-400-normal.DLAV9S_w.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-latin-ext-400-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-latin-ext-400-normal.BwLXVYNz.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-latin-ext-400-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-latin-400-normal.GekRknry.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-latin-400-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-latin-400-normal.DBZPkcnn.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-latin-400-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.DC57U9n8.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-cyrillic-ext-500-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-cyrillic-ext-500-normal.6xdwlG7p.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-cyrillic-ext-500-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-cyrillic-500-normal.DGZ7-lUP.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-cyrillic-500-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-cyrillic-500-normal.NpUJFYX7.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-cyrillic-500-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-greek-500-normal.DpRFkptA.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-greek-500-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-greek-500-normal.C2M8jX6G.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-greek-500-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-vietnamese-500-normal.Cq-quQMu.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-vietnamese-500-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-vietnamese-500-normal.IxzxMIj7.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-vietnamese-500-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-latin-ext-500-normal.Db3ge6Oe.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-latin-ext-500-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-latin-ext-500-normal.B1IjfbhL.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-latin-ext-500-normal.woff"},{"file":"_app/immutable/assets/roboto-mono-latin-500-normal.pxIOXZmA.woff2","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-latin-500-normal.woff2"},{"file":"_app/immutable/assets/roboto-mono-latin-500-normal.D6j6AMzd.woff","filename":"node_modules/@fontsource/roboto-mono/files/roboto-mono-latin-500-normal.woff"}];
|
|
@@ -5,6 +5,6 @@ let component_cache;
|
|
|
5
5
|
export const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;
|
|
6
6
|
export { server };
|
|
7
7
|
export const server_id = "src/routes/+page.server.ts";
|
|
8
|
-
export const imports = ["_app/immutable/nodes/3.
|
|
8
|
+
export const imports = ["_app/immutable/nodes/3.CywuMQ0y.js","_app/immutable/chunks/0FroJ-XN.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/D0famktY.js","_app/immutable/chunks/Dvxhfd7j.js","_app/immutable/chunks/DHsTyp2W.js","_app/immutable/chunks/B_ZElYu_.js","_app/immutable/chunks/BfHif6xP.js","_app/immutable/chunks/ux9AxWa3.js","_app/immutable/chunks/Cc902J0D.js","_app/immutable/chunks/BrPqgVT6.js","_app/immutable/chunks/Roub4aju.js","_app/immutable/chunks/KD5R77Wj.js","_app/immutable/chunks/C7D7xLuA.js","_app/immutable/chunks/D9JU-e3z.js"];
|
|
9
9
|
export const stylesheets = ["_app/immutable/assets/3.WduKm4aT.css"];
|
|
10
10
|
export const fonts = [];
|
|
@@ -5,6 +5,6 @@ let component_cache;
|
|
|
5
5
|
export const component = async () => component_cache ??= (await import('../entries/pages/settings/_page.svelte.js')).default;
|
|
6
6
|
export { server };
|
|
7
7
|
export const server_id = "src/routes/settings/+page.server.ts";
|
|
8
|
-
export const imports = ["_app/immutable/nodes/4.
|
|
8
|
+
export const imports = ["_app/immutable/nodes/4.BYvsTY13.js","_app/immutable/chunks/0FroJ-XN.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/D0famktY.js","_app/immutable/chunks/ux9AxWa3.js","_app/immutable/chunks/Dvxhfd7j.js","_app/immutable/chunks/DHsTyp2W.js","_app/immutable/chunks/D-2Nx62w.js","_app/immutable/chunks/PzCUpBms.js","_app/immutable/chunks/BrPqgVT6.js","_app/immutable/chunks/Cc902J0D.js","_app/immutable/chunks/D9JU-e3z.js","_app/immutable/chunks/KD5R77Wj.js"];
|
|
9
9
|
export const stylesheets = ["_app/immutable/assets/Pane.Dgdg5KMw.css","_app/immutable/assets/4.DyY1vjRV.css"];
|
|
10
10
|
export const fonts = [];
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
export const index = 5;
|
|
4
4
|
let component_cache;
|
|
5
5
|
export const component = async () => component_cache ??= (await import('../entries/pages/setup/_page.svelte.js')).default;
|
|
6
|
-
export const imports = ["_app/immutable/nodes/5.
|
|
6
|
+
export const imports = ["_app/immutable/nodes/5.xWNFTFjr.js","_app/immutable/chunks/0FroJ-XN.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/D0famktY.js","_app/immutable/chunks/PzCUpBms.js","_app/immutable/chunks/ux9AxWa3.js","_app/immutable/chunks/Dvxhfd7j.js","_app/immutable/chunks/DHsTyp2W.js","_app/immutable/chunks/BrPqgVT6.js","_app/immutable/chunks/Cc902J0D.js","_app/immutable/chunks/BfHif6xP.js","_app/immutable/chunks/CVpgcnu3.js","_app/immutable/chunks/C7D7xLuA.js"];
|
|
7
7
|
export const stylesheets = ["_app/immutable/assets/ExternalLink.CYXazpKA.css","_app/immutable/assets/5.YyxFzHED.css"];
|
|
8
8
|
export const fonts = [];
|
|
@@ -5,6 +5,6 @@ let component_cache;
|
|
|
5
5
|
export const component = async () => component_cache ??= (await import('../entries/pages/setup/instructions/_page.svelte.js')).default;
|
|
6
6
|
export { server };
|
|
7
7
|
export const server_id = "src/routes/setup/instructions/+page.server.ts";
|
|
8
|
-
export const imports = ["_app/immutable/nodes/6.
|
|
8
|
+
export const imports = ["_app/immutable/nodes/6.Dnf8S10l.js","_app/immutable/chunks/0FroJ-XN.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/D0famktY.js","_app/immutable/chunks/B_ZElYu_.js","_app/immutable/chunks/DHsTyp2W.js","_app/immutable/chunks/BrPqgVT6.js","_app/immutable/chunks/ux9AxWa3.js","_app/immutable/chunks/Dvxhfd7j.js","_app/immutable/chunks/BfHif6xP.js","_app/immutable/chunks/CVpgcnu3.js"];
|
|
9
9
|
export const stylesheets = ["_app/immutable/assets/ExternalLink.CYXazpKA.css","_app/immutable/assets/6.C0Nhvs_m.css"];
|
|
10
10
|
export const fonts = [];
|
package/dist/ui/server/server.js
CHANGED
|
@@ -10,7 +10,7 @@ return {
|
|
|
10
10
|
app_path: "ui/_app",
|
|
11
11
|
assets: new Set(["robots.txt"]),
|
|
12
12
|
mime_types: {".txt":"text/plain"},
|
|
13
|
-
client: {start:"_app/immutable/entry/start.DqIv9xYX.js",app:"_app/immutable/entry/app.
|
|
13
|
+
client: {start:"_app/immutable/entry/start.DqIv9xYX.js",app:"_app/immutable/entry/app.DM2PRoLw.js",imports:["_app/immutable/entry/start.DqIv9xYX.js","_app/immutable/entry/payload.DSmR2FwN.js","_app/immutable/chunks/DUTjbZNf.js","_app/immutable/chunks/DzInmTUe.js","_app/immutable/chunks/Dvxhfd7j.js","_app/immutable/chunks/D0famktY.js","_app/immutable/chunks/0FroJ-XN.js","_app/immutable/entry/app.DM2PRoLw.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
|
|
14
14
|
|
|
15
15
|
nodes: [
|
|
16
16
|
__memo(() => import('./nodes/0.js')),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@screenreader-speech-capture/bridge",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Capture what a screen reader says (JAWS / NVDA via a SAPI 5 socket voice) and expose it over HTTP for automated tests.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$ as e,D as t,E as n,G as r,H as i,J as a,L as o,M as s,N as c,P as l,S as u,T as d,V as f,W as p,X as m,Y as h,Z as g,_t as _,b as v,dt as y,j as b,k as x,lt as S,mt as C,n as w,ot as T,pt as E,s as D,st as O,ut as k,vt as A,z as j}from"../chunks/0FroJ-XN.js";import"../chunks/DHsTyp2W.js";import"../chunks/B_ZElYu_.js";import"../chunks/BnU72Mow.js";import{t as M}from"../chunks/4wvZDMeR.js";import{n as N,t as P}from"../chunks/tKonUL5Y.js";import{t as F}from"../chunks/Bvlvl8SZ.js";var I=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%3e%3ctitle%3eSpeech%20Capture%3c/title%3e%3crect%20width='44'%20height='44'%20rx='14'%20fill='%23415f91'/%3e%3cpath%20d='M4%2010v4M8%206v12M12%203v18M16%208v8M20%2011v2'%20transform='translate(10%2010)'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e`,L=new URL(`../assets/material-symbols-outlined-latin-400-normal.BhEvR8fk.woff2`,import.meta.url).href,R=f(`<li><span class="face svelte-19wvxlf" aria-hidden="true"><span></span> <span class="chip-label svelte-19wvxlf"> </span></span> <span class="visually-hidden"> </span></li>`),z=f(`<ul aria-label="Bridge status" class="svelte-19wvxlf"></ul>`),B=f(`<!> <span class="visually-hidden" role="status"> </span>`,1);function V(t,n){C(n,!0);var r=B(),i=h(r),c=t=>{var r=z();x(r,21,()=>n.chips,e=>e.id,(t,n)=>{var r=R();let i;var s=a(r),c=a(s),l=g(c,2),u=m(l,!0);A(s);var f=g(s,2),p=m(f,!0);A(r),T(()=>{i=d(r,1,b(e(n).tone),`svelte-19wvxlf`,i,{down:e(n).down}),v(s,`title`,e(n).text),d(c,1,`dot ${e(n).dot??``}`,`svelte-19wvxlf`),o(u,e(n).text),o(p,e(n).description)}),j(t,r)}),A(r),j(t,r)};s(i,e=>{n.chips.length>0&&e(c)});var l=g(i,2),u=m(l,!0);T(()=>o(u,n.announcement)),j(t,r),E()}var H=f(`<md-icon-button><md-icon>refresh</md-icon></md-icon-button>`,2);function U(e,t){var n=H();u(n,`title`,`Refresh status`),d(n,1,`svelte-5q7qd7`);var i=a(n);let o;A(n),T(()=>o=d(i,1,`svelte-5q7qd7`,null,o,{spin:t.loading})),r(`click`,n,function(...e){t.onRetry?.apply(this,e)}),j(e,n)}p([`click`]);var W=`24px "Material Symbols Outlined"`;async function G(){try{await document.fonts.load(W)}catch{}document.documentElement.setAttribute(`data-icons-ready`,``)}function K(e,t){return t?e===null?[]:[q(`playwright`,`Playwright`,e.playwright),q(`mcp`,`MCP`,e.mcp)].filter(e=>e!==null):[{id:`bridge`,text:`Bridge unreachable`,tone:`error`,dot:`filled`,description:`Bridge unreachable`}]}function q(e,t,n){let r=`${t} ${n.version}`;switch(n.state){case`running`:return{id:e,text:r,tone:`ok`,dot:`filled`,description:`${r}, running`};case`crashed`:case`failed`:return{id:e,text:`${r} · ${n.state}`,tone:`warning`,dot:`filled`,description:`${r}, ${n.state}`};case`starting`:return{id:e,text:r,tone:`neutral`,dot:`hollow`,description:`${r}, starting`,down:!0};case`stopped`:return null}}function J(e,t){return t?e.filter(e=>e.tone===`error`||e.tone===`warning`).map(e=>`${e.description}.`).join(` `):`Bridge unreachable.`}var Y=f(`<!> <!>`,1);function X(t,n){C(n,!0);let r=P().status,i=y(()=>w.data.status),a=y(()=>r.status??e(i)),o=y(()=>K(e(a),r.reachable));c(()=>r.init(e(i)));var l=Y(),u=h(l);{let t=y(()=>J(e(o),r.reachable));V(u,{get chips(){return e(o)},get announcement(){return e(t)}})}var d=g(u,2),f=e=>{U(e,{get loading(){return r.loading},onRetry:()=>void r.retry()})};s(d,e=>{r.reachable||e(f)}),j(t,l),E()}var Z=f(`<header class="svelte-4j9s4f"><div class="logo-slot svelte-4j9s4f"><div class="logo svelte-4j9s4f"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 10v4M8 6v12M12 3v18M16 8v8M20 11v2"></path></svg></div></div> <div class="title svelte-4j9s4f"><span class="name svelte-4j9s4f">Speech Capture</span> <span class="meta svelte-4j9s4f"> </span></div> <!></header>`);function Q(e,t){var n=Z(),r=g(a(n),2),i=g(a(r),2),s=m(i,!0);A(r),X(g(r,2),{}),A(n),T(()=>o(s,t.host)),j(e,n)}var $=f(`<li><a data-sveltekit-reset="false" class="svelte-sxtjmn"><span><md-ripple></md-ripple> <md-icon> </md-icon></span> <span class="label svelte-sxtjmn"> </span></a></li>`,2),ee=f(`<nav aria-label="Pages" class="svelte-sxtjmn"><ul class="svelte-sxtjmn"></ul></nav> <span class="visually-hidden" role="status"> </span>`,1);function te(t,s){let c=i();C(s,!0);let l=k(``),f;O(()=>(s.currentPath,()=>{clearTimeout(f),S(l,``)}));function p(e,t){if(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let n=e.currentTarget;n.href===n.ownerDocument.URL&&(e.preventDefault(),clearTimeout(f),S(l,``),f=setTimeout(()=>S(l,`${t}, current page`),100))}function _(e){e.key===` `&&(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),e.repeat||e.currentTarget.click()))}var b=ee(),w=h(b),D=a(w);x(D,23,()=>s.items,e=>e.href,(t,n,i)=>{let l=y(()=>F(e(n),s.currentPath)),f=y(()=>`${c}-link-${e(i)}`),h=y(()=>`${e(f)}-label`);var b=$(),x=a(b),S=a(x);let C;var w=a(S);T(()=>u(w,`for`,e(f))),u(w,`aria-hidden`,`true`);var E=g(w,2);u(E,`aria-hidden`,`true`);var D=m(E,!0);A(S);var O=g(S,2),k=m(O,!0);A(x),A(b),T(()=>{v(x,`id`,e(f)),v(x,`href`,e(n).href),v(x,`aria-labelledby`,e(h)),v(x,`aria-current`,e(l)?`page`:void 0),C=d(S,1,`indicator svelte-sxtjmn`,null,C,{current:e(l)}),o(D,e(n).icon),v(O,`id`,e(h)),o(k,e(n).label)}),r(`click`,x,t=>p(t,e(n).label)),r(`keydown`,x,_),j(t,b)}),A(D),n(D,()=>M(`a`)),A(w);var N=g(w,2),P=m(N,!0);T(()=>o(P,e(l))),j(t,b),E()}p([`click`,`keydown`]);var ne=f(`<link rel="icon"/> <link rel="preload" as="font" type="font/woff2" crossorigin="anonymous"/> <meta name="color-scheme" content="light dark"/>`,1),re=f(`<div class="app svelte-12qhfyh"><!> <div class="body svelte-12qhfyh"><!> <main class="svelte-12qhfyh"><!></main></div></div>`);function ie(e,n){C(n,!0);let{theme:r}=N(),i=[{href:D(`/`),label:`Monitor`,icon:`monitor`,exact:!0},{href:D(`/settings`),label:`Settings`,icon:`settings`},{href:D(`/setup`),label:`Setup`,icon:`build`}];c(()=>{r.init(),G()});var o=re();t(`12qhfyh`,e=>{var t=ne(),n=h(t),r=g(n,2);_(2),T(()=>{v(n,`href`,I),v(r,`href`,L)}),j(e,t)});var s=a(o);Q(s,{get host(){return w.url.host}});var u=g(s,2),d=a(u);te(d,{get items(){return i},get currentPath(){return w.url.pathname}});var f=g(d,2),p=a(f);l(p,()=>n.children),A(f),A(u),A(o),j(e,o),E()}export{ie as component};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|