@aperture-browser/session-client 0.0.0-stage → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-CSF1mk8K.js","names":["encode","make","UrlPath.segments","named","make","Socket.open","Sound.make","Socket.encode","Clipboard.write","Http.upload","UrlPath.segments","Clipboard.textForm","Input.wire","Clipboard.read","Clipboard.writeByHand","Http.uploads","Http.removeUpload","Http.listRecordings","Http.getRecording","Http.startRecording","Http.stopRecording","Http.editRecording","Http.retargetRecording","Http.annotateRecording","Http.exportStorageState","Http.importStorageState","Http.getPace","Http.setPace","Http.listScreenshots","Http.takeScreenshot"],"sources":["../../shared/src/url-path.ts","../src/address.ts","../src/clipboard.ts","../src/codecs.ts","../src/errors.ts","../src/http.ts","../src/gen/aperture/live/v1/live_pb.ts","../src/keys.ts","../src/input.ts","../src/model.ts","../src/socket.ts","../src/sound.ts","../src/surface.ts","../src/session.ts"],"sourcesContent":["/**\n * Request paths and urls built from values that may hold what a url treats specially\n * (`/`, `?`, `#`, `%`, spaces): a file's name, a session's id, a ticket. Every\n * interpolation is encoded unless it says otherwise, so a value cannot leave its segment\n * because one call site forgot to encode it.\n *\n * Effect has no such builder: `HttpApiClient` encodes `:param` paths only for endpoints\n * declared through `HttpApi`, and `Url.setPathname` leaves `/`, `?`, and `#` as they are.\n */\n\nclass Raw {\n readonly text: string;\n\n constructor(text: string) {\n this.text = text;\n }\n}\n\nclass Segments {\n readonly path: string;\n\n constructor(path: string) {\n this.path = path;\n }\n}\n\nexport type Part = string | number | Raw | Segments;\n\n/** Inserted as it is: a base url, a host, or a path this module already built. */\nexport const raw = (text: string): Raw => new Raw(text);\n\n/**\n * A value that is itself several segments, `downloads/report.pdf`: each `/`-separated\n * segment is encoded and the slashes stay.\n */\nexport const segments = (path: string): Segments => new Segments(path);\n\nconst encode = (part: Part): string => {\n if (part instanceof Raw) {\n return part.text;\n }\n if (part instanceof Segments) {\n return part.path.split(\"/\").map(encodeURIComponent).join(\"/\");\n }\n return encodeURIComponent(part);\n};\n\n/** `` make`/sessions/${id}/files/${name}` ``: every interpolation encoded as one segment. */\nexport const make = (literals: TemplateStringsArray, ...parts: ReadonlyArray<Part>): string => {\n let url = literals[0] ?? \"\";\n parts.forEach((part, index) => {\n url += encode(part) + (literals[index + 1] ?? \"\");\n });\n return url;\n};\n","import * as UrlPath from \"@aperture-browser/shared/url-path\";\nexport interface Address {\n /** The session's base, e.g. `http://host:7900/` or `http://host:7900/sessions/<id>`. */\n readonly url: string;\n readonly token?: string | undefined;\n /** The operator's display name. */\n readonly name?: string | undefined;\n}\n\nconst based = (address: Address, path: string) => {\n const origin: string | undefined = globalThis.location?.href;\n const base = new URL(address.url, origin);\n base.pathname = `${base.pathname.replace(/\\/+$/u, \"\")}${path}`;\n return base;\n};\n\n/** A route below the session's base, for a request that carries the token in a header. */\nexport const route = (address: Address, path: string) => based(address, path).toString();\n\n/**\n * A route below the session's base that carries the token itself, for what cannot send a\n * header: a link, a picture, the session socket.\n */\nexport const authenticated = (address: Address, path: string) => {\n const url = based(address, path);\n if (address.token !== undefined) {\n url.searchParams.set(\"token\", address.token);\n }\n return url;\n};\n\nexport const socketUrl = (address: Address) => {\n const url = authenticated(address, \"/ws\");\n if (address.name !== undefined && address.name !== \"\") {\n url.searchParams.set(\"name\", address.name);\n }\n url.protocol = url.protocol === \"https:\" ? \"wss:\" : \"ws:\";\n return url.toString();\n};\n\nexport const fileUrl = (address: Address, path: string) =>\n authenticated(\n address,\n UrlPath.make`/files/${UrlPath.segments(path.replace(/^\\/+/u, \"\"))}`,\n ).toString();\n\nexport const screenshotUrl = (address: Address, tab: number, width?: number) => {\n const url = authenticated(address, UrlPath.make`/targets/${tab}/screenshot.png`);\n if (width !== undefined) {\n url.searchParams.set(\"width\", String(Math.round(width)));\n }\n return url.toString();\n};\n\n/** The tab as it looks now, small: for a list of the tabs. */\nexport const previewUrl = (address: Address, tab: number) =>\n authenticated(address, UrlPath.make`/targets/${tab}/preview.png`).toString();\n\n/**\n * The icon of the tab's page, fetched by the session. `site` is what the page is of: the\n * icon is kept by its address here, and another site's is another address.\n */\nexport const faviconUrl = (address: Address, tab: number, site: string) => {\n const url = authenticated(address, UrlPath.make`/targets/${tab}/favicon`);\n url.searchParams.set(\"of\", site);\n return url.toString();\n};\n\nexport const headers = (address: Address): Record<string, string> =>\n address.token === undefined ? {} : { Authorization: `Bearer ${address.token}` };\n","import type { ClipboardForm } from \"./model.ts\";\n\n/** The forms of text a clipboard carries. */\nconst TEXTS = [\"text/plain\", \"text/html\"] as const;\n\n/** What of the session's clipboard a clipboard here takes. */\nconst TAKEN = /^(?:text\\/(?:plain|html)|image\\/.+)$/u;\n\nexport const form = async (type: string, blob: Blob): Promise<ClipboardForm> => ({\n type,\n data: new Uint8Array(await blob.arrayBuffer()),\n});\n\nexport const textForm = (type: string, text: string): ClipboardForm => ({\n type,\n data: new TextEncoder().encode(text),\n});\n\nconst blobOf = (one: ClipboardForm) => new Blob([new Uint8Array(one.data)], { type: one.type });\n\n/** A picture drawn again as a PNG: what it looks like, and nothing else it carried. */\nconst drawn = async (picture: Blob) => {\n const draw = (source: CanvasImageSource, width: number, height: number) => {\n const canvas = new OffscreenCanvas(width, height);\n canvas.getContext(\"2d\")?.drawImage(source, 0, 0, width, height);\n return canvas.convertToBlob({ type: \"image/png\" });\n };\n try {\n const bitmap = await createImageBitmap(picture);\n try {\n return await draw(bitmap, bitmap.width, bitmap.height);\n } finally {\n bitmap.close();\n }\n } catch {\n // A drawing is decoded by an image element alone, which runs none of its script.\n const url = URL.createObjectURL(picture);\n try {\n const image = new Image();\n image.src = url;\n await image.decode();\n return await draw(image, image.naturalWidth || 300, image.naturalHeight || 150);\n } finally {\n URL.revokeObjectURL(url);\n }\n }\n};\n\n/** A picture as the PNG clipboards carry. */\nexport const png = (picture: Blob) =>\n picture.type === \"image/png\" ? Promise.resolve(picture) : drawn(picture);\n\nconst blobs = async (forms: readonly ClipboardForm[]) => {\n const taken = forms.filter((one) => TAKEN.test(one.type));\n const had = await Promise.all(\n taken.map(async (one): Promise<[string, Blob]> => {\n const blob = blobOf(one);\n return one.type.startsWith(\"image/\") ? [\"image/png\", await png(blob)] : [one.type, blob];\n }),\n );\n return Object.fromEntries(had);\n};\n\n/**\n * Puts what the session copied on the clipboard here, which a browser lets a page do at\n * any time or only in a click. Tells whether it did.\n */\nexport const write = async (forms: readonly ClipboardForm[]) => {\n if (typeof ClipboardItem === \"undefined\" || navigator.clipboard?.write === undefined) {\n return false;\n }\n try {\n const had = await blobs(forms);\n if (Object.keys(had).length === 0) {\n return false;\n }\n await navigator.clipboard.write([new ClipboardItem(had)]);\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Copies the old way, which is deprecated and the one way where the clipboard is not a\n * page's to write: the browser is told to copy, and is handed the texts as it does.\n */\nconst copyOldWay = (texts: ReadonlyMap<string, string>) => {\n // What is copied without being handed is what is selected, where a browser copies\n // nothing otherwise.\n const from = document.createElement(\"textarea\");\n from.value = texts.get(\"text/plain\") ?? \"\";\n document.body.append(from);\n from.focus();\n from.select();\n let handed = false;\n // Before anything of the page hears of it, whatever has the keyboard by now.\n const hand = (event: ClipboardEvent) => {\n for (const [type, text] of texts) {\n event.clipboardData?.setData(type, text);\n }\n event.preventDefault();\n event.stopImmediatePropagation();\n handed = true;\n };\n window.addEventListener(\"copy\", hand, { capture: true });\n const copied = document.execCommand(\"copy\");\n window.removeEventListener(\"copy\", hand, { capture: true });\n from.remove();\n return copied && (handed || from.value !== \"\");\n};\n\n/**\n * Copies in a click what `write` could not: text is copied the old way, and a picture\n * opens to be copied by hand.\n *\n * What the session copied is what a page there made of it, and nothing of it is opened\n * as it came: a document made of it here would be this page's own, and run as whoever\n * watches. Text stays text, and a picture opens as the PNG it is drawn to.\n */\nexport const writeByHand = async (forms: readonly ClipboardForm[]) => {\n if (await write(forms)) {\n return true;\n }\n const texts = new Map(\n forms\n .filter((one) => TEXTS.some((type) => type === one.type))\n .map((one) => [one.type, new TextDecoder().decode(one.data)]),\n );\n const marked = texts.get(\"text/html\");\n if (marked !== undefined && !texts.has(\"text/plain\")) {\n // Parsed to be read, in a document that runs and loads nothing.\n const read = new DOMParser().parseFromString(marked, \"text/html\");\n for (const unread of read.querySelectorAll(\"script, style, template\")) {\n unread.remove();\n }\n texts.set(\"text/plain\", read.body.textContent ?? \"\");\n }\n if (texts.size > 0) {\n return copyOldWay(texts);\n }\n const picture = forms.find((one) => one.type.startsWith(\"image/\"));\n if (picture === undefined) {\n return false;\n }\n try {\n window.open(URL.createObjectURL(await drawn(blobOf(picture))));\n return true;\n } catch {\n return false;\n }\n};\n\n/** What the clipboard here has, where the browser lets a page read it. */\nexport const read = async (): Promise<ClipboardForm[]> => {\n const items = await navigator.clipboard.read();\n const forms: ClipboardForm[] = [];\n for (const type of [...TEXTS, \"image/png\"]) {\n const item = items.find((one) => one.types.includes(type));\n if (item !== undefined) {\n forms.push(await form(type, await item.getType(type)));\n }\n }\n return forms;\n};\n\n/** The text a paste or a drag carries, in each form it has it. */\nexport const texts = (carried: DataTransfer): ClipboardForm[] =>\n TEXTS.map((type) => [type, carried.getData(type)] as const)\n .filter(([, text]) => text !== \"\")\n .map(([type, text]) => textForm(type, text));\n","import type { PictureWay, VideoFormat } from \"./model.ts\";\n\n/**\n * What a decoder is asked for, by the form of the frames. Without a description the\n * frames are read as Annex B, which they are.\n */\nexport const CODECS: Readonly<Record<VideoFormat, string>> = {\n h264: \"avc1.42e01f\",\n \"full-chroma\": \"avc1.f4001f\",\n h265: \"hev1.1.6.L153.B0\",\n vp9: \"vp09.00.51.08\",\n \"vp9-full-chroma\": \"vp09.01.51.08.03\",\n av1: \"av01.0.13M.08\",\n};\n\ntype Carries = (codec: RTCRtpCodec) => boolean;\n\n/** What a WebRTC connection calls the formats it carries; it carries no H.264 4:4:4. */\nconst RTC_CODECS: Readonly<Partial<Record<VideoFormat, Carries>>> = {\n h264: (codec) => codec.mimeType === \"video/H264\",\n h265: (codec) => codec.mimeType === \"video/H265\",\n vp9: (codec) =>\n codec.mimeType === \"video/VP9\" && /profile-id=0/u.test(codec.sdpFmtpLine ?? \"profile-id=0\"),\n \"vp9-full-chroma\": (codec) =>\n codec.mimeType === \"video/VP9\" && /profile-id=1/u.test(codec.sdpFmtpLine ?? \"\"),\n av1: (codec) => codec.mimeType === \"video/AV1\",\n};\n\nconst ALL = Object.keys(CODECS) as VideoFormat[];\n\n/** The ways this environment can take a picture, best first. */\nexport const waysHere = (): PictureWay[] => {\n const ways: PictureWay[] = [];\n if (typeof RTCPeerConnection !== \"undefined\") {\n ways.push(\"video\");\n }\n if (typeof VideoDecoder !== \"undefined\") {\n ways.push(\"frames\");\n }\n ways.push(\"tiles\");\n return ways;\n};\n\nconst decodes = async (format: VideoFormat) => {\n try {\n const { supported } = await VideoDecoder.isConfigSupported({ codec: CODECS[format] });\n return supported === true;\n } catch {\n return false;\n }\n};\n\n/** The formats this browser takes the way the picture comes. */\nexport const decodable = async (way: PictureWay): Promise<VideoFormat[]> => {\n if (way === \"video\") {\n const codecs = RTCRtpReceiver.getCapabilities(\"video\")?.codecs ?? [];\n return ALL.filter((format) => {\n const carries = RTC_CODECS[format];\n return carries !== undefined && codecs.some(carries);\n });\n }\n if (way === \"frames\") {\n const supported = await Promise.all(ALL.map(decodes));\n return ALL.filter((_, at) => supported[at]);\n }\n return [];\n};\n","import * as Schema from \"effect/Schema\";\n\n/** A request to the session that could not be made, or that the session refused. */\nexport class SessionError extends Schema.TaggedError<SessionError>()(\"SessionError\", {\n message: Schema.String,\n /** The HTTP status the session answered with, when it answered. */\n status: Schema.optional(Schema.Number),\n cause: Schema.optional(Schema.Defect()),\n}) {}\n","import * as UrlPath from \"@aperture-browser/shared/url-path\";\nimport * as Effect from \"effect/Effect\";\nimport { type Address, headers, route } from \"./address.ts\";\nimport { SessionError } from \"./errors.ts\";\nimport type { Pace, Target } from \"./model.ts\";\n\n/** A file put into the session for its browser to take. */\nexport interface Uploaded {\n readonly name: string;\n readonly size: number;\n /** Where the file is, for the browser as for the session's tools. */\n readonly path: string;\n}\n\n/** A download as the session's `downloads` route tells it. */\nexport interface DownloadedFile {\n readonly id: string;\n readonly name: string;\n readonly url: string;\n readonly received: number;\n /** None while the page does not say. */\n readonly total: number | null;\n readonly state: \"running\" | \"done\" | \"failed\";\n}\n\nexport interface ViewportSize {\n readonly width: number;\n readonly height: number;\n /** The target keeps its scale when left out. */\n readonly scale?: number | undefined;\n}\n\n/** The size of a burst around a tool call, see `RecordingOptions.capture`. */\nexport interface RecordingBurst {\n readonly lead_ms: number;\n readonly tail_ms: number;\n /** The tail goes on until the picture has stood still for this long. */\n readonly settle_ms: number;\n readonly max_tail_ms: number;\n}\n\n/**\n * How an edit of a recording is made: said as the recording stops, and again for every edit\n * that is made of it after.\n */\nexport interface RecordingOptions {\n /** `bursts` keeps only the stretches around what the automation did. */\n readonly capture: \"continuous\" | \"bursts\";\n /** Shortens the stretches in which nothing happens. Not with `bursts`. */\n readonly idle: \"cut\" | \"speed\" | null;\n /** Marks clicks with a ripple. */\n readonly ripple: boolean;\n readonly burst: RecordingBurst;\n /** The share of the picture that must change for something to have happened: 0 to 1. */\n readonly motion_threshold: number;\n /** The edited video's frames a second: 1 to 60, which is the most the raw video has. */\n readonly fps: number;\n}\n\n/** What is said of an edit; what is left out is as the session has it by default. */\nexport interface EditRecording extends Partial<Omit<RecordingOptions, \"burst\">> {\n readonly burst?: Partial<RecordingBurst>;\n}\n\nexport interface StartRecording {\n /** The tab to record; the newest one when left out. */\n readonly tab?: number;\n /** Go on with whichever tab the session's automation acts on. */\n readonly follow?: boolean;\n}\n\nexport interface RecordingEdit {\n readonly state: \"editing\" | \"finished\" | \"failed\";\n /** What it is made with: what the recording was stopped or last edited again with. */\n readonly options: RecordingOptions;\n /** When it was made, which tells one edit of a recording from the one before. */\n readonly made_at_ms: number | null;\n /** The edited video's file, relative to the session's files, once it is made. */\n readonly file: string | null;\n /** What happened, where in the raw video and where in the edited one. */\n readonly timeline: string | null;\n readonly failure: string | null;\n}\n\nexport interface Recording {\n readonly id: string;\n /** The tab it is of. */\n readonly tab: number;\n /** The target it is of, which is no target of a later run of the session. */\n readonly target: string;\n /** The page's title and address as the recording began. */\n readonly title: string;\n readonly url: string;\n /** The raw video's file, relative to the session's files. */\n readonly file: string;\n /** The journal's file, relative to the session's files. */\n readonly journal: string;\n /** A small picture of the target as the recording began, relative to the session's files. */\n readonly preview: string | null;\n readonly journal_dropped: number;\n readonly state: \"recording\" | \"finished\" | \"failed\";\n readonly started_at_ms: number;\n /** Set once the recording ended. */\n readonly duration_ms: number | null;\n readonly bytes: number | null;\n readonly failure: string | null;\n /** It goes on with whichever tab the session's automation acts on. */\n readonly follow: boolean;\n /** The edit, once the recording stopped; none where the session cannot make one. */\n readonly edit: RecordingEdit | null;\n}\n\n/** A picture of a target, kept in the session's files. */\nexport interface Screenshot {\n readonly id: string;\n /** The page's title and address as it was taken. */\n readonly title: string;\n readonly url: string;\n /** The picture's size in pixels. */\n readonly width: number;\n readonly height: number;\n /** The picture's file, relative to the session's files. */\n readonly file: string;\n /** The same picture, small. */\n readonly preview: string;\n readonly bytes: number;\n readonly taken_at_ms: number;\n}\n\nexport interface UploadProgress {\n readonly loaded: number;\n readonly total: number;\n}\n\ninterface Request {\n readonly method?: string;\n readonly json?: unknown;\n}\n\nconst failed = (cause: unknown) =>\n new SessionError({\n message: cause instanceof Error ? cause.message : \"the session could not be reached\",\n cause,\n });\n\nconst refused = (status: number, text: string) =>\n new SessionError({ message: text === \"\" ? `the session answered ${status}` : text, status });\n\nconst request = Effect.fnUntraced(function* (address: Address, path: string, asked: Request = {}) {\n const response = yield* Effect.tryPromise({\n try: (signal) =>\n fetch(route(address, path), {\n method: asked.method ?? \"GET\",\n headers: {\n ...headers(address),\n ...(asked.json === undefined ? {} : { \"Content-Type\": \"application/json\" }),\n },\n body: asked.json === undefined ? null : JSON.stringify(asked.json),\n signal,\n }),\n catch: failed,\n });\n if (!response.ok) {\n const text = yield* Effect.tryPromise({ try: () => response.text(), catch: failed });\n return yield* refused(response.status, text);\n }\n return response;\n});\n\n// The session's own answers are trusted to have the shape its routes give them.\nconst json = <A>(address: Address, path: string, asked?: Request) =>\n request(address, path, asked).pipe(\n Effect.flatMap((response) =>\n Effect.tryPromise({ try: () => response.json() as Promise<A>, catch: failed }),\n ),\n );\n\nconst named = (name: string) => UrlPath.make`/uploads/${name}`;\n\n// `fetch` does not tell how much of a body it has sent.\nconst uploadTold = (address: Address, file: File, onProgress: (progress: UploadProgress) => void) =>\n Effect.callback<Uploaded, SessionError>((resume) => {\n const sending = new XMLHttpRequest();\n sending.open(\"PUT\", route(address, named(file.name)));\n for (const [name, value] of Object.entries(headers(address))) {\n sending.setRequestHeader(name, value);\n }\n sending.upload.addEventListener(\"progress\", (event) => {\n onProgress({ loaded: event.loaded, total: event.lengthComputable ? event.total : file.size });\n });\n sending.addEventListener(\"error\", () => {\n resume(Effect.fail(new SessionError({ message: \"the session could not be reached\" })));\n });\n sending.addEventListener(\"load\", () => {\n if (sending.status < 200 || sending.status >= 300) {\n resume(Effect.fail(refused(sending.status, sending.responseText)));\n return;\n }\n resume(\n Effect.try({ try: () => JSON.parse(sending.responseText) as Uploaded, catch: failed }),\n );\n });\n sending.send(file);\n return Effect.sync(() => sending.abort());\n });\n\n/** Every target of the session, oldest first. */\nexport const targets = Effect.fn(\"SessionHttp.targets\")((address: Address) =>\n json<Target[]>(address, \"/targets\"),\n);\n\n/** Gives a target its own viewport, as near to the one asked for as it can be given. */\nexport const setViewport = Effect.fn(\"SessionHttp.setViewport\")(\n (address: Address, tab: number, viewport: ViewportSize) =>\n request(address, UrlPath.make`/targets/${tab}/viewport`, {\n method: \"PUT\",\n json: viewport,\n }).pipe(Effect.asVoid),\n);\n\nexport const downloads = Effect.fn(\"SessionHttp.downloads\")((address: Address) =>\n json<DownloadedFile[]>(address, \"/downloads\"),\n);\n\nexport const uploads = Effect.fn(\"SessionHttp.uploads\")((address: Address) =>\n json<Uploaded[]>(address, \"/uploads\"),\n);\n\n/**\n * Puts a file into the session's uploads under its own name, in place of one there was.\n * Files get to the session's browser this way: they are put there, and the browser is\n * told where they are.\n */\nexport const upload = Effect.fn(\"SessionHttp.upload\")(function* (\n address: Address,\n file: File,\n onProgress?: (progress: UploadProgress) => void,\n) {\n if (onProgress !== undefined && typeof XMLHttpRequest !== \"undefined\") {\n return yield* uploadTold(address, file, onProgress);\n }\n const response = yield* Effect.tryPromise({\n try: (signal) =>\n fetch(route(address, named(file.name)), {\n method: \"PUT\",\n headers: headers(address),\n body: file,\n signal,\n }),\n catch: failed,\n });\n const text = yield* Effect.tryPromise({ try: () => response.text(), catch: failed });\n if (!response.ok) {\n return yield* refused(response.status, text);\n }\n const uploaded = yield* Effect.try({ try: () => JSON.parse(text) as Uploaded, catch: failed });\n onProgress?.({ loaded: uploaded.size, total: uploaded.size });\n return uploaded;\n});\n\nexport const removeUpload = Effect.fn(\"SessionHttp.removeUpload\")(\n (address: Address, name: string) =>\n request(address, named(name), { method: \"DELETE\" }).pipe(Effect.asVoid),\n);\n\nexport const listRecordings = Effect.fn(\"SessionHttp.listRecordings\")((address: Address) =>\n json<Recording[]>(address, \"/recordings\"),\n);\n\nexport const getRecording = Effect.fn(\"SessionHttp.getRecording\")((address: Address, id: string) =>\n json<Recording>(address, UrlPath.make`/recordings/${id}`),\n);\n\nexport const startRecording = Effect.fn(\"SessionHttp.startRecording\")(\n (address: Address, options: StartRecording = {}) =>\n json<Recording>(address, \"/recordings\", { method: \"POST\", json: options }),\n);\n\n/** Stops a recording. Its edit is made after, with `options`. */\nexport const stopRecording = Effect.fn(\"SessionHttp.stopRecording\")(\n (address: Address, id: string, options: EditRecording = {}) =>\n json<Recording>(address, UrlPath.make`/recordings/${id}/stop`, {\n method: \"POST\",\n json: options,\n }),\n);\n\n/**\n * Makes the edit of a stopped recording again, of the same raw video and with `options`. It\n * takes the place of the edit there is once it is made. Refused while an edit of the\n * recording is being made, and for a recording whose raw video is gone.\n */\nexport const editRecording = Effect.fn(\"SessionHttp.editRecording\")(\n (address: Address, id: string, options: EditRecording = {}) =>\n json<Recording>(address, UrlPath.make`/recordings/${id}/edit`, {\n method: \"POST\",\n json: options,\n }),\n);\n\nexport const getPace = Effect.fn(\"SessionHttp.getPace\")((address: Address) =>\n json<{ readonly pace: Pace }>(address, \"/pace\").pipe(Effect.map((told) => told.pace)),\n);\n\n/** Sets the session's pace, for every recording and whoever watches. */\nexport const setPace = Effect.fn(\"SessionHttp.setPace\")((address: Address, pace: Pace) =>\n json<{ readonly pace: Pace }>(address, \"/pace\", { method: \"PUT\", json: { pace } }).pipe(\n Effect.map((told) => told.pace),\n ),\n);\n\n/** Has a running recording go on with another tab, in the same video. */\nexport const retargetRecording = Effect.fn(\"SessionHttp.retargetRecording\")(\n (address: Address, id: string, tab: number) =>\n json<Recording>(address, UrlPath.make`/recordings/${id}/retarget`, {\n method: \"POST\",\n json: { tab },\n }),\n);\n\n/** What a running recording's edit is told to show. */\nexport type RecordingAnnotation =\n | { readonly kind: \"caption\"; readonly text: string; readonly duration_ms?: number }\n | {\n readonly kind: \"focus\";\n readonly zoom: number;\n readonly rect?: {\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n };\n readonly selector?: string;\n readonly pointer?: boolean;\n /** Zooms out after this long; until `reset_focus` when left out. */\n readonly duration_ms?: number;\n }\n | { readonly kind: \"reset_focus\" }\n | {\n readonly kind: \"attention\";\n readonly x?: number;\n readonly y?: number;\n readonly selector?: string;\n readonly radius?: number;\n readonly loops?: number;\n readonly duration_ms?: number;\n };\n\n/** Adds an annotation to a running recording: the one named, or the only one that runs. */\nexport const annotateRecording = Effect.fn(\"SessionHttp.annotateRecording\")((\n address: Address,\n annotation: RecordingAnnotation,\n id?: string,\n) => {\n const { kind, ...given } = annotation;\n return request(address, UrlPath.make`/recordings/annotations/${kind}`, {\n method: \"POST\",\n json: id === undefined ? given : { ...given, id },\n }).pipe(Effect.asVoid);\n});\n\n/** A cookie of the session's browser. */\nexport interface StateCookie {\n readonly name: string;\n readonly value: string;\n readonly domain: string;\n /** It goes to this host alone, not to the hosts below it. */\n readonly hostOnly?: boolean;\n readonly path: string;\n /** Seconds since the epoch; a cookie without it ends with the browser. */\n readonly expires?: number;\n readonly httpOnly?: boolean;\n readonly secure?: boolean;\n readonly sameSite?: string;\n readonly partitionKey?: unknown;\n}\n\n/**\n * What the session's browser keeps for the sites it visits: cookies, local storage and,\n * where they were asked for, the origins' IndexedDB databases.\n */\nexport interface StorageState {\n readonly cookies?: readonly StateCookie[];\n readonly origins?: readonly {\n readonly origin: string;\n readonly localStorage?: readonly { readonly name: string; readonly value: string }[];\n /** The origin's databases, as the session wrote them down. */\n readonly indexedDB?: readonly unknown[];\n }[];\n}\n\n/** Which of it an export gives. */\nexport interface StorageStateAsked {\n /** The origins of the pages the tabs show, or the origins named. */\n readonly origins?: \"open-tabs\" | readonly string[];\n /** The cookies the browser would send to those origins, or all it has. */\n readonly cookies?: \"matching\" | \"all\";\n /** The origins' IndexedDB databases as well, where many sites keep who is signed in. */\n readonly indexed_db?: boolean;\n}\n\n/** Takes cookies and the storage of origins out of the session's browser. */\nexport const exportStorageState = Effect.fn(\"SessionHttp.exportStorageState\")(\n (address: Address, asked: StorageStateAsked = {}) =>\n json<StorageState>(address, \"/storage-state\", { method: \"POST\", json: asked }),\n);\n\n/**\n * Puts cookies and the storage of origins into the session's browser: the cookies beside\n * those there are, each origin's local storage in place of what the origin had, and each\n * of its databases in place of the origin's one of that name.\n */\nexport const importStorageState = Effect.fn(\"SessionHttp.importStorageState\")(\n (address: Address, state: StorageState) =>\n request(address, \"/storage-state\", { method: \"PUT\", json: state }).pipe(Effect.asVoid),\n);\n\nexport const listScreenshots = Effect.fn(\"SessionHttp.listScreenshots\")((address: Address) =>\n json<Screenshot[]>(address, \"/screenshots\"),\n);\n\n/** Takes a screenshot of a tab, the newest one when none is named, and keeps it. */\nexport const takeScreenshot = Effect.fn(\"SessionHttp.takeScreenshot\")(\n (address: Address, tab?: number) =>\n json<Screenshot>(address, \"/screenshots\", { method: \"POST\", json: { tab } }),\n);\n","// @generated by protoc-gen-es v2.17.0 with parameter \"target=ts,import_extension=ts\"\n// @generated from file aperture/live/v1/live.proto (package aperture.live.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file aperture/live/v1/live.proto.\n */\nexport const file_aperture_live_v1_live: GenFile = /*@__PURE__*/\n fileDesc(\"ChthcGVydHVyZS9saXZlL3YxL2xpdmUucHJvdG8SEGFwZXJ0dXJlLmxpdmUudjEi3QgKDUNsaWVudE1lc3NhZ2USKgoGc2VsZWN0GAEgASgLMhguYXBlcnR1cmUubGl2ZS52MS5TZWxlY3RIABI5Cg5wb2ludGVyX21vdGlvbhgCIAEoCzIfLmFwZXJ0dXJlLmxpdmUudjEuUG9pbnRlck1vdGlvbkgAEjkKDnBvaW50ZXJfYnV0dG9uGAMgASgLMh8uYXBlcnR1cmUubGl2ZS52MS5Qb2ludGVyQnV0dG9uSAASOQoOcG9pbnRlcl9zY3JvbGwYBCABKAsyHy5hcGVydHVyZS5saXZlLnYxLlBvaW50ZXJTY3JvbGxIABI3Cg1wb2ludGVyX2xlYXZlGAUgASgLMh4uYXBlcnR1cmUubGl2ZS52MS5Qb2ludGVyTGVhdmVIABIkCgNrZXkYBiABKAsyFS5hcGVydHVyZS5saXZlLnYxLktleUgAEiYKBHRleHQYByABKAsyFi5hcGVydHVyZS5saXZlLnYxLlRleHRIABIuCgh2aWV3cG9ydBgIIAEoCzIaLmFwZXJ0dXJlLmxpdmUudjEuVmlld3BvcnRIABIoCgVoZWxsbxgJIAEoCzIXLmFwZXJ0dXJlLmxpdmUudjEuSGVsbG9IABIvCglydGNfb2ZmZX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U1BFQ0lGSUVEEAASDQoJUk9MRV9WSUVXEAESEAoMUk9MRV9DT05UUk9MEAISDgoKUk9MRV9BRE1JThADKosBCgtMZWFzZUFjdGlvbhIcChhMRUFTRV9BQ1RJT05fVU5TUEVDSUZJRUQQABIVChFMRUFTRV9BQ1RJT05fVEFLRRABEhgKFExFQVNFX0FDVElPTl9SRUxFQVNFEAISFgoSTEVBU0VfQUNUSU9OX0FMTE9XEAMSFQoRTEVBU0VfQUNUSU9OX0tFRVAQBCpTCgVBbG9uZxIVChFBTE9OR19VTlNQRUNJRklFRBAAEg4KCkFMT05HX0JBQ0sQARIRCg1BTE9OR19GT1JXQVJEEAISEAoMQUxPTkdfUkVMT0FEEAMqkwEKBUFza2VkEhUKEUFTS0VEX1VOU1BFQ0lGSUVEEAASDAoIQVNLRURfR08QARIPCgtBU0tFRF9DTE9TRRACEhYKEkFTS0VEX0NPUFlfUElDVFVSRRADEhYKEkFTS0VEX0ZJTEVTX0NIT1NFThAEEhAKDEFTS0VEX0ZPTExPVxAFEhIKDkFTS0VEX1NFVF9NT0RFEAYqZgoIUGFnZU1vZGUSGQoVUEFHRV9NT0RFX1VOU1BFQ0lGSUVEEAASEgoOUEFHRV9NT0RFX0FVVE8QARIVChFQQUdFX01PREVfREVTS1RPUBACEhQKEFBBR0VfTU9ERV9NT0JJTEUQA2IGcHJvdG8z\");\n\n/**\n * @generated from message aperture.live.v1.ClientMessage\n */\nexport type ClientMessage = Message<\"aperture.live.v1.ClientMessage\"> & {\n /**\n * @generated from oneof aperture.live.v1.ClientMessage.message\n */\n message: {\n /**\n * The tab the client's video shows and its input goes to. Until the first one, the\n * session picks the newest.\n *\n * @generated from field: aperture.live.v1.Select select = 1;\n */\n value: Select;\n case: \"select\";\n } | {\n /**\n * @generated from field: aperture.live.v1.PointerMotion pointer_motion = 2;\n */\n value: PointerMotion;\n case: \"pointerMotion\";\n } | {\n /**\n * @generated from field: aperture.live.v1.PointerButton pointer_button = 3;\n */\n value: PointerButton;\n case: \"pointerButton\";\n } | {\n /**\n * @generated from field: aperture.live.v1.PointerScroll pointer_scroll = 4;\n */\n value: PointerScroll;\n case: \"pointerScroll\";\n } | {\n /**\n * @generated from field: aperture.live.v1.PointerLeave pointer_leave = 5;\n */\n value: PointerLeave;\n case: \"pointerLeave\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Key key = 6;\n */\n value: Key;\n case: \"key\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Text text = 7;\n */\n value: Text;\n case: \"text\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Viewport viewport = 8;\n */\n value: Viewport;\n case: \"viewport\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Hello hello = 9;\n */\n value: Hello;\n case: \"hello\";\n } | {\n /**\n * @generated from field: aperture.live.v1.RtcOffer rtc_offer = 10;\n */\n value: RtcOffer;\n case: \"rtcOffer\";\n } | {\n /**\n * @generated from field: aperture.live.v1.VideoShown video_shown = 11;\n */\n value: VideoShown;\n case: \"videoShown\";\n } | {\n /**\n * Puts content on the session's clipboard, for a paste there to take: a client that\n * pastes sends what it has, then the keys that paste.\n *\n * @generated from field: aperture.live.v1.Clipboard clipboard = 12;\n */\n value: Clipboard;\n case: \"clipboard\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Drop drop = 13;\n */\n value: Drop;\n case: \"drop\";\n } | {\n /**\n * @generated from field: aperture.live.v1.FilesChosen files_chosen = 14;\n */\n value: FilesChosen;\n case: \"filesChosen\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Lease lease = 15;\n */\n value: Lease;\n case: \"lease\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Go go = 16;\n */\n value: Go;\n case: \"go\";\n } | {\n /**\n * @generated from field: aperture.live.v1.CopyPicture copy_picture = 17;\n */\n value: CopyPicture;\n case: \"copyPicture\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Close close = 18;\n */\n value: Close;\n case: \"close\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Follow follow = 19;\n */\n value: Follow;\n case: \"follow\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Draw draw = 20;\n */\n value: Draw;\n case: \"draw\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Pointing pointing = 21;\n */\n value: Pointing;\n case: \"pointing\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Device device = 22;\n */\n value: Device;\n case: \"device\";\n } | {\n /**\n * @generated from field: aperture.live.v1.SetMode set_mode = 23;\n */\n value: SetMode;\n case: \"setMode\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message aperture.live.v1.ClientMessage.\n * Use `create(ClientMessageSchema)` to create a new message.\n */\nexport const ClientMessageSchema: GenMessage<ClientMessage> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 0);\n\n/**\n * @generated from message aperture.live.v1.ServerMessage\n */\nexport type ServerMessage = Message<\"aperture.live.v1.ServerMessage\"> & {\n /**\n * @generated from oneof aperture.live.v1.ServerMessage.message\n */\n message: {\n /**\n * @generated from field: aperture.live.v1.Targets targets = 1;\n */\n value: Targets;\n case: \"targets\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Selected selected = 2;\n */\n value: Selected;\n case: \"selected\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Cursor cursor = 3;\n */\n value: Cursor;\n case: \"cursor\";\n } | {\n /**\n * @generated from field: aperture.live.v1.RtcAnswer rtc_answer = 4;\n */\n value: RtcAnswer;\n case: \"rtcAnswer\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Tile tile = 5;\n */\n value: Tile;\n case: \"tile\";\n } | {\n /**\n * @generated from field: aperture.live.v1.RtcRefused rtc_refused = 6;\n */\n value: RtcRefused;\n case: \"rtcRefused\";\n } | {\n /**\n * @generated from field: aperture.live.v1.VideoFrame video_frame = 7;\n */\n value: VideoFrame;\n case: \"videoFrame\";\n } | {\n /**\n * @generated from field: aperture.live.v1.VideoStatus video_status = 8;\n */\n value: VideoStatus;\n case: \"videoStatus\";\n } | {\n /**\n * Something was copied in the session.\n *\n * @generated from field: aperture.live.v1.Clipboard clipboard = 9;\n */\n value: Clipboard;\n case: \"clipboard\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Downloads downloads = 10;\n */\n value: Downloads;\n case: \"downloads\";\n } | {\n /**\n * @generated from field: aperture.live.v1.FileRequests file_requests = 11;\n */\n value: FileRequests;\n case: \"fileRequests\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Presence presence = 12;\n */\n value: Presence;\n case: \"presence\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Menu menu = 13;\n */\n value: Menu;\n case: \"menu\";\n } | {\n /**\n * @generated from field: aperture.live.v1.AudioFrame audio = 14;\n */\n value: AudioFrame;\n case: \"audio\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Features features = 15;\n */\n value: Features;\n case: \"features\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Failed failed = 16;\n */\n value: Failed;\n case: \"failed\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Pointer pointer = 17;\n */\n value: Pointer;\n case: \"pointer\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Stroke stroke = 18;\n */\n value: Stroke;\n case: \"stroke\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Paced paced = 19;\n */\n value: Paced;\n case: \"paced\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Restoring restoring = 20;\n */\n value: Restoring;\n case: \"restoring\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message aperture.live.v1.ServerMessage.\n * Use `create(ServerMessageSchema)` to create a new message.\n */\nexport const ServerMessageSchema: GenMessage<ServerMessage> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 1);\n\n/**\n * Whether the session is being given what its browser starts with: the storage state it\n * was created with, or one that is put into it. Told once the client said `hello`, and\n * again whenever it changes. While it is underway the session takes no input and changes\n * no tabs for anyone: its pages are not yet what they are to be.\n *\n * @generated from message aperture.live.v1.Restoring\n */\nexport type Restoring = Message<\"aperture.live.v1.Restoring\"> & {\n /**\n * @generated from field: bool underway = 1;\n */\n underway: boolean;\n\n /**\n * What is put in, which is none of each until the state has come.\n *\n * @generated from field: uint32 tabs = 2;\n */\n tabs: number;\n\n /**\n * @generated from field: uint32 cookies = 3;\n */\n cookies: number;\n\n /**\n * @generated from field: uint32 origins = 4;\n */\n origins: number;\n\n /**\n * Why the state the session was to start with was not taken: the session is not what\n * was asked for, and ends.\n *\n * @generated from field: optional string failure = 5;\n */\n failure?: string | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Restoring.\n * Use `create(RestoringSchema)` to create a new message.\n */\nexport const RestoringSchema: GenMessage<Restoring> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 2);\n\n/**\n * How the session's automation moves the pointer in a tab that is being recorded. It is\n * the session's, the same for every recording and whoever watches: told once the client\n * said `hello`, and again whenever it is set, which the session's `/pace` route and its\n * `pace` tool do. A tab nothing records gets the automation's input at once.\n *\n * @generated from message aperture.live.v1.Paced\n */\nexport type Paced = Message<\"aperture.live.v1.Paced\"> & {\n /**\n * @generated from field: aperture.live.v1.Pace pace = 1;\n */\n pace: Pace;\n};\n\n/**\n * Describes the message aperture.live.v1.Paced.\n * Use `create(PacedSchema)` to create a new message.\n */\nexport const PacedSchema: GenMessage<Paced> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 3);\n\n/**\n * What the client may do in the session, area by area: what whoever let it in gave it, of\n * what the session offers at all. Sent first after `hello`. What is not granted is refused:\n * a client need not show it. Watching takes no grant.\n *\n * @generated from message aperture.live.v1.Features\n */\nexport type Features = Message<\"aperture.live.v1.Features\"> & {\n /**\n * Write: the pointer, the keyboard and what is dropped go into the tab the client holds.\n *\n * @generated from field: aperture.live.v1.Grant input = 9;\n */\n input?: Grant | undefined;\n\n /**\n * Write: `go`, `close` and `viewport` are taken.\n *\n * @generated from field: aperture.live.v1.Grant tabs = 10;\n */\n tabs?: Grant | undefined;\n\n /**\n * Write: a tab is taken from whoever holds it, without asking.\n *\n * @generated from field: aperture.live.v1.Grant lease = 11;\n */\n lease?: Grant | undefined;\n\n /**\n * Read: targets tell which of them sound, and `audio` comes where asked for.\n *\n * @generated from field: aperture.live.v1.Grant sound = 1;\n */\n sound?: Grant | undefined;\n\n /**\n * Read: files that were put into the session are listed. Write: files are taken (see\n * `uploads` beside the session socket), and pages that ask for files are answered.\n *\n * @generated from field: aperture.live.v1.Grant uploads = 2;\n */\n uploads?: Grant | undefined;\n\n /**\n * Read: what the session's browser downloaded is told in `downloads`, and fetched.\n *\n * @generated from field: aperture.live.v1.Grant downloads = 3;\n */\n downloads?: Grant | undefined;\n\n /**\n * Read: recordings and screenshots are listed and fetched. Write: they are made.\n *\n * @generated from field: aperture.live.v1.Grant recordings = 4;\n */\n recordings?: Grant | undefined;\n\n /**\n * Read: what is copied in the session is told in `clipboard`, and `copy_picture` is\n * taken. Write: a client's `clipboard` is taken.\n *\n * @generated from field: aperture.live.v1.Grant clipboard = 5;\n */\n clipboard?: Grant | undefined;\n\n /**\n * Write: the session's automation, at `mcp` beside the session socket.\n *\n * @generated from field: aperture.live.v1.Grant mcp = 6;\n */\n mcp?: Grant | undefined;\n\n /**\n * Write: its browser's DevTools endpoint, at `cdp`.\n *\n * @generated from field: aperture.live.v1.Grant cdp = 7;\n */\n cdp?: Grant | undefined;\n\n /**\n * Write: a tunnel, at `tunnel`.\n *\n * @generated from field: aperture.live.v1.Grant tunnel = 8;\n */\n tunnel?: Grant | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Features.\n * Use `create(FeaturesSchema)` to create a new message.\n */\nexport const FeaturesSchema: GenMessage<Features> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 4);\n\n/**\n * @generated from message aperture.live.v1.Grant\n */\nexport type Grant = Message<\"aperture.live.v1.Grant\"> & {\n /**\n * @generated from field: bool read = 1;\n */\n read: boolean;\n\n /**\n * @generated from field: bool write = 2;\n */\n write: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.Grant.\n * Use `create(GrantSchema)` to create a new message.\n */\nexport const GrantSchema: GenMessage<Grant> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 5);\n\n/**\n * The client's first message. The session answers with what it offers, its targets, the\n * target the client watches, and the cursor.\n *\n * @generated from message aperture.live.v1.Hello\n */\nexport type Hello = Message<\"aperture.live.v1.Hello\"> & {\n /**\n * @generated from field: aperture.live.v1.Pixels pixels = 1;\n */\n pixels: Pixels;\n\n /**\n * The forms of video the client would have, the one it would rather have first. The\n * session sends the first one it makes: as frames whichever that is, over WebRTC the\n * first one the connection also takes. `VIDEO_FORMAT_H264` when left out, and when none\n * of them can be had.\n *\n * @generated from field: repeated aperture.live.v1.VideoFormat formats = 2;\n */\n formats: VideoFormat[];\n\n /**\n * The quality of the video, whatever the link carries; the session picks when left out.\n *\n * @generated from field: aperture.live.v1.VideoQuality quality = 3;\n */\n quality: VideoQuality;\n\n /**\n * Frames a second at most, 1 to 60; as many as the quality has when left out.\n *\n * @generated from field: optional uint32 fps = 4;\n */\n fps?: number | undefined;\n\n /**\n * The client takes the session's sound on the session socket, as `audio`. A client\n * with a WebRTC connection takes it there instead, on an audio track it offers.\n *\n * @generated from field: bool audio = 5;\n */\n audio: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.Hello.\n * Use `create(HelloSchema)` to create a new message.\n */\nexport const HelloSchema: GenMessage<Hello> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 6);\n\n/**\n * The video the client gets from now on, over WebRTC or as frames. Sent when it starts\n * and whenever it changes.\n *\n * @generated from message aperture.live.v1.VideoStatus\n */\nexport type VideoStatus = Message<\"aperture.live.v1.VideoStatus\"> & {\n /**\n * @generated from field: aperture.live.v1.VideoFormat format = 1;\n */\n format: VideoFormat;\n\n /**\n * @generated from field: aperture.live.v1.VideoQuality quality = 2;\n */\n quality: VideoQuality;\n\n /**\n * Frames a second at most.\n *\n * @generated from field: uint32 fps = 3;\n */\n fps: number;\n};\n\n/**\n * Describes the message aperture.live.v1.VideoStatus.\n * Use `create(VideoStatusSchema)` to create a new message.\n */\nexport const VideoStatusSchema: GenMessage<VideoStatus> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 7);\n\n/**\n * The session's sound: what its browser plays, all its pages together, as Opus packets of\n * 20 ms, 48 kHz, stereo. Packets a client is too slow for are left out.\n *\n * @generated from message aperture.live.v1.AudioFrame\n */\nexport type AudioFrame = Message<\"aperture.live.v1.AudioFrame\"> & {\n /**\n * Where in the sound the packet starts.\n *\n * @generated from field: uint64 time_us = 1;\n */\n timeUs: bigint;\n\n /**\n * @generated from field: bytes data = 2;\n */\n data: Uint8Array;\n};\n\n/**\n * Describes the message aperture.live.v1.AudioFrame.\n * Use `create(AudioFrameSchema)` to create a new message.\n */\nexport const AudioFrameSchema: GenMessage<AudioFrame> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 8);\n\n/**\n * The client showed the video frame stamped `time_us`, or let it go undecoded. A client\n * that takes frames sends this for each: frames it does not report as shown count as\n * waiting in front of its link, and with too much waiting the session holds frames back.\n *\n * @generated from message aperture.live.v1.VideoShown\n */\nexport type VideoShown = Message<\"aperture.live.v1.VideoShown\"> & {\n /**\n * @generated from field: uint64 time_us = 1;\n */\n timeUs: bigint;\n};\n\n/**\n * Describes the message aperture.live.v1.VideoShown.\n * Use `create(VideoShownSchema)` to create a new message.\n */\nexport const VideoShownSchema: GenMessage<VideoShown> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 9);\n\n/**\n * A WebRTC offer, as SDP, with a video track for the session to send on.\n *\n * @generated from message aperture.live.v1.RtcOffer\n */\nexport type RtcOffer = Message<\"aperture.live.v1.RtcOffer\"> & {\n /**\n * @generated from field: string sdp = 1;\n */\n sdp: string;\n};\n\n/**\n * Describes the message aperture.live.v1.RtcOffer.\n * Use `create(RtcOfferSchema)` to create a new message.\n */\nexport const RtcOfferSchema: GenMessage<RtcOffer> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 10);\n\n/**\n * @generated from message aperture.live.v1.RtcAnswer\n */\nexport type RtcAnswer = Message<\"aperture.live.v1.RtcAnswer\"> & {\n /**\n * @generated from field: string sdp = 1;\n */\n sdp: string;\n};\n\n/**\n * Describes the message aperture.live.v1.RtcAnswer.\n * Use `create(RtcAnswerSchema)` to create a new message.\n */\nexport const RtcAnswerSchema: GenMessage<RtcAnswer> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 11);\n\n/**\n * The session could not make the WebRTC connection the client offered. The session socket\n * goes on; the client may take its pixels another way.\n *\n * @generated from message aperture.live.v1.RtcRefused\n */\nexport type RtcRefused = Message<\"aperture.live.v1.RtcRefused\"> & {\n /**\n * @generated from field: string reason = 1;\n */\n reason: string;\n};\n\n/**\n * Describes the message aperture.live.v1.RtcRefused.\n * Use `create(RtcRefusedSchema)` to create a new message.\n */\nexport const RtcRefusedSchema: GenMessage<RtcRefused> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 12);\n\n/**\n * A frame of the watched target's video, as its format has frames: an access unit in\n * Annex B form of H.264 and H.265, a frame of VP9, a temporal unit of AV1. The first\n * one a client gets of a target is a keyframe, and so is the first one after frames were\n * held back and the first one of another quality.\n *\n * @generated from message aperture.live.v1.VideoFrame\n */\nexport type VideoFrame = Message<\"aperture.live.v1.VideoFrame\"> & {\n /**\n * The tab it is a frame of.\n *\n * @generated from field: uint32 tab = 1;\n */\n tab: number;\n\n /**\n * @generated from field: bool keyframe = 2;\n */\n keyframe: boolean;\n\n /**\n * When the frame was drawn, in microseconds on the session's clock.\n *\n * @generated from field: uint64 time_us = 3;\n */\n timeUs: bigint;\n\n /**\n * @generated from field: bytes data = 4;\n */\n data: Uint8Array;\n\n /**\n * @generated from field: aperture.live.v1.VideoFormat format = 5;\n */\n format: VideoFormat;\n\n /**\n * The picture's size in pixels.\n *\n * @generated from field: uint32 width = 6;\n */\n width: number;\n\n /**\n * @generated from field: uint32 height = 7;\n */\n height: number;\n};\n\n/**\n * Describes the message aperture.live.v1.VideoFrame.\n * Use `create(VideoFrameSchema)` to create a new message.\n */\nexport const VideoFrameSchema: GenMessage<VideoFrame> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 13);\n\n/**\n * A part of the watched target's picture that changed, as a PNG image; the whole picture\n * when the client starts watching the target and when its size changes. Tiles of one\n * change follow each other.\n *\n * @generated from message aperture.live.v1.Tile\n */\nexport type Tile = Message<\"aperture.live.v1.Tile\"> & {\n /**\n * The tab it is a part of the picture of.\n *\n * @generated from field: uint32 tab = 1;\n */\n tab: number;\n\n /**\n * @generated from field: uint32 x = 2;\n */\n x: number;\n\n /**\n * @generated from field: uint32 y = 3;\n */\n y: number;\n\n /**\n * The whole picture's size in pixels.\n *\n * @generated from field: uint32 width = 4;\n */\n width: number;\n\n /**\n * @generated from field: uint32 height = 5;\n */\n height: number;\n\n /**\n * @generated from field: bytes png = 6;\n */\n png: Uint8Array;\n};\n\n/**\n * Describes the message aperture.live.v1.Tile.\n * Use `create(TileSchema)` to create a new message.\n */\nexport const TileSchema: GenMessage<Tile> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 14);\n\n/**\n * @generated from message aperture.live.v1.Select\n */\nexport type Select = Message<\"aperture.live.v1.Select\"> & {\n /**\n * @generated from field: uint32 tab = 1;\n */\n tab: number;\n};\n\n/**\n * Describes the message aperture.live.v1.Select.\n * Use `create(SelectSchema)` to create a new message.\n */\nexport const SelectSchema: GenMessage<Select> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 15);\n\n/**\n * Positions are in the selected target's logical pixels, from its top-left corner.\n *\n * @generated from message aperture.live.v1.PointerMotion\n */\nexport type PointerMotion = Message<\"aperture.live.v1.PointerMotion\"> & {\n /**\n * @generated from field: double x = 1;\n */\n x: number;\n\n /**\n * @generated from field: double y = 2;\n */\n y: number;\n};\n\n/**\n * Describes the message aperture.live.v1.PointerMotion.\n * Use `create(PointerMotionSchema)` to create a new message.\n */\nexport const PointerMotionSchema: GenMessage<PointerMotion> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 16);\n\n/**\n * @generated from message aperture.live.v1.PointerButton\n */\nexport type PointerButton = Message<\"aperture.live.v1.PointerButton\"> & {\n /**\n * @generated from field: double x = 1;\n */\n x: number;\n\n /**\n * @generated from field: double y = 2;\n */\n y: number;\n\n /**\n * @generated from field: aperture.live.v1.MouseButton button = 3;\n */\n button: MouseButton;\n\n /**\n * @generated from field: bool pressed = 4;\n */\n pressed: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.PointerButton.\n * Use `create(PointerButtonSchema)` to create a new message.\n */\nexport const PointerButtonSchema: GenMessage<PointerButton> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 17);\n\n/**\n * @generated from message aperture.live.v1.PointerScroll\n */\nexport type PointerScroll = Message<\"aperture.live.v1.PointerScroll\"> & {\n /**\n * @generated from field: double x = 1;\n */\n x: number;\n\n /**\n * @generated from field: double y = 2;\n */\n y: number;\n\n /**\n * Wheel notches, positive right and down.\n *\n * @generated from field: double dx = 3;\n */\n dx: number;\n\n /**\n * @generated from field: double dy = 4;\n */\n dy: number;\n};\n\n/**\n * Describes the message aperture.live.v1.PointerScroll.\n * Use `create(PointerScrollSchema)` to create a new message.\n */\nexport const PointerScrollSchema: GenMessage<PointerScroll> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 18);\n\n/**\n * @generated from message aperture.live.v1.PointerLeave\n */\nexport type PointerLeave = Message<\"aperture.live.v1.PointerLeave\"> & {\n};\n\n/**\n * Describes the message aperture.live.v1.PointerLeave.\n * Use `create(PointerLeaveSchema)` to create a new message.\n */\nexport const PointerLeaveSchema: GenMessage<PointerLeave> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 19);\n\n/**\n * @generated from message aperture.live.v1.Key\n */\nexport type Key = Message<\"aperture.live.v1.Key\"> & {\n /**\n * The physical key, as its Linux evdev code.\n *\n * @generated from field: uint32 code = 1;\n */\n code: number;\n\n /**\n * @generated from field: bool pressed = 2;\n */\n pressed: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.Key.\n * Use `create(KeySchema)` to create a new message.\n */\nexport const KeySchema: GenMessage<Key> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 20);\n\n/**\n * Text as it is, whatever keyboard it takes to write: what a phone's keyboard or an input\n * method entered, or a key of a layout the session's keyboard does not have. A field that\n * takes text gets it whole; elsewhere it is typed key by key, without the characters the\n * session's keyboard has no key for. A line break is the Enter key and a tab the Tab key.\n *\n * @generated from message aperture.live.v1.Text\n */\nexport type Text = Message<\"aperture.live.v1.Text\"> & {\n /**\n * @generated from field: string text = 1;\n */\n text: string;\n\n /**\n * The text is still being composed, as with an input method: the field shows it as\n * such, in place of what was being composed before. Text that is not composing ends the\n * composing and stays; empty, it only ends it.\n *\n * @generated from field: bool composing = 2;\n */\n composing: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.Text.\n * Use `create(TextSchema)` to create a new message.\n */\nexport const TextSchema: GenMessage<Text> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 21);\n\n/**\n * What the session's browser downloaded since the session started, oldest first; the\n * last hundred of them. Sent in answer to `hello` and whenever it changes. A file is\n * fetched from the session's files, as `files/downloads/{name}` beside the session socket.\n *\n * @generated from message aperture.live.v1.Downloads\n */\nexport type Downloads = Message<\"aperture.live.v1.Downloads\"> & {\n /**\n * @generated from field: repeated aperture.live.v1.Download downloads = 1;\n */\n downloads: Download[];\n};\n\n/**\n * Describes the message aperture.live.v1.Downloads.\n * Use `create(DownloadsSchema)` to create a new message.\n */\nexport const DownloadsSchema: GenMessage<Downloads> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 22);\n\n/**\n * @generated from message aperture.live.v1.Download\n */\nexport type Download = Message<\"aperture.live.v1.Download\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The file's name: the one the page suggested until the browser has saved it, which may\n * be under another.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * @generated from field: string url = 3;\n */\n url: string;\n\n /**\n * @generated from field: uint64 received_bytes = 4;\n */\n receivedBytes: bigint;\n\n /**\n * Left out while the page does not say.\n *\n * @generated from field: optional uint64 total_bytes = 5;\n */\n totalBytes?: bigint | undefined;\n\n /**\n * @generated from field: aperture.live.v1.DownloadState state = 6;\n */\n state: DownloadState;\n};\n\n/**\n * Describes the message aperture.live.v1.Download.\n * Use `create(DownloadSchema)` to create a new message.\n */\nexport const DownloadSchema: GenMessage<Download> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 23);\n\n/**\n * Who is in the session and who drives which tab. Sent in answer to `hello` and whenever\n * it changes.\n *\n * Input is a tab's. Who gives a tab input holds it, and others' input to it is left out\n * until the holder gave it none for five seconds. A person's input takes a tab from the\n * session's automation at once. A client that may only watch gives\n * none at all. The session has one keyboard and one pointer: those who hold different\n * tabs take turns at them, key by key.\n *\n * @generated from message aperture.live.v1.Presence\n */\nexport type Presence = Message<\"aperture.live.v1.Presence\"> & {\n /**\n * The member this client is.\n *\n * @generated from field: uint64 you = 1;\n */\n you: bigint;\n\n /**\n * @generated from field: repeated aperture.live.v1.Member members = 2;\n */\n members: Member[];\n\n /**\n * @generated from field: repeated aperture.live.v1.HeldTab held = 3;\n */\n held: HeldTab[];\n};\n\n/**\n * Describes the message aperture.live.v1.Presence.\n * Use `create(PresenceSchema)` to create a new message.\n */\nexport const PresenceSchema: GenMessage<Presence> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 24);\n\n/**\n * @generated from message aperture.live.v1.Member\n */\nexport type Member = Message<\"aperture.live.v1.Member\"> & {\n /**\n * @generated from field: uint64 id = 1;\n */\n id: bigint;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * @generated from field: aperture.live.v1.Role role = 3;\n */\n role: Role;\n\n /**\n * The tab the member watches.\n *\n * @generated from field: optional uint32 tab = 4;\n */\n tab?: number | undefined;\n\n /**\n * The session's automation rather than a person.\n *\n * @generated from field: bool agent = 5;\n */\n agent: boolean;\n\n /**\n * The member this one follows: it watches the tab that member watches.\n *\n * @generated from field: optional uint64 follows = 6;\n */\n follows?: bigint | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Member.\n * Use `create(MemberSchema)` to create a new message.\n */\nexport const MemberSchema: GenMessage<Member> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 25);\n\n/**\n * Follows a member: the client watches the tab the member watches, also when the member\n * goes to another, until the client selects a tab itself or the member leaves. Without\n * `member`, follows nobody. A member is not followed around a circle of followers.\n *\n * @generated from message aperture.live.v1.Follow\n */\nexport type Follow = Message<\"aperture.live.v1.Follow\"> & {\n /**\n * @generated from field: optional uint64 member = 1;\n */\n member?: bigint | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Follow.\n * Use `create(FollowSchema)` to create a new message.\n */\nexport const FollowSchema: GenMessage<Follow> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 26);\n\n/**\n * Where another member's pointer is on the tab the client watches, in the tab's logical\n * pixels. It gives no input by being there: this is for seeing where someone points.\n * Whoever watches the tab is told, a few dozen times a second at most, and nobody is told\n * again what they missed.\n *\n * @generated from message aperture.live.v1.Pointer\n */\nexport type Pointer = Message<\"aperture.live.v1.Pointer\"> & {\n /**\n * @generated from field: uint64 member = 1;\n */\n member: bigint;\n\n /**\n * None once the pointer left the tab's picture.\n *\n * @generated from field: optional aperture.live.v1.Point at = 2;\n */\n at?: Point | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Pointer.\n * Use `create(PointerSchema)` to create a new message.\n */\nexport const PointerSchema: GenMessage<Pointer> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 27);\n\n/**\n * @generated from message aperture.live.v1.Point\n */\nexport type Point = Message<\"aperture.live.v1.Point\"> & {\n /**\n * @generated from field: double x = 1;\n */\n x: number;\n\n /**\n * @generated from field: double y = 2;\n */\n y: number;\n};\n\n/**\n * Describes the message aperture.live.v1.Point.\n * Use `create(PointSchema)` to create a new message.\n */\nexport const PointSchema: GenMessage<Point> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 28);\n\n/**\n * Where the client's pointer is over the tab it watches while what it does there is no\n * input, as while it draws: the others see it as they see a pointer that gives input.\n *\n * @generated from message aperture.live.v1.Pointing\n */\nexport type Pointing = Message<\"aperture.live.v1.Pointing\"> & {\n /**\n * None once the pointer left the tab's picture.\n *\n * @generated from field: optional aperture.live.v1.Point at = 1;\n */\n at?: Point | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Pointing.\n * Use `create(PointingSchema)` to create a new message.\n */\nexport const PointingSchema: GenMessage<Pointing> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 29);\n\n/**\n * A point of a stroke the client draws over the tab it watches, in the tab's logical\n * pixels. A stroke is a mark for the others to see: it is no input, it is part of nothing\n * the session keeps, and those who watch the tab let it fade once it ended. Anyone in the\n * session draws, also who may only watch.\n *\n * @generated from message aperture.live.v1.Draw\n */\nexport type Draw = Message<\"aperture.live.v1.Draw\"> & {\n /**\n * Which of the client's strokes the point is of.\n *\n * @generated from field: uint32 stroke = 1;\n */\n stroke: number;\n\n /**\n * @generated from field: aperture.live.v1.StrokePhase phase = 2;\n */\n phase: StrokePhase;\n\n /**\n * @generated from field: double x = 3;\n */\n x: number;\n\n /**\n * @generated from field: double y = 4;\n */\n y: number;\n};\n\n/**\n * Describes the message aperture.live.v1.Draw.\n * Use `create(DrawSchema)` to create a new message.\n */\nexport const DrawSchema: GenMessage<Draw> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 30);\n\n/**\n * A point of a stroke another member draws over the tab the client watches.\n *\n * @generated from message aperture.live.v1.Stroke\n */\nexport type Stroke = Message<\"aperture.live.v1.Stroke\"> & {\n /**\n * @generated from field: uint64 member = 1;\n */\n member: bigint;\n\n /**\n * @generated from field: uint32 stroke = 2;\n */\n stroke: number;\n\n /**\n * @generated from field: aperture.live.v1.StrokePhase phase = 3;\n */\n phase: StrokePhase;\n\n /**\n * @generated from field: double x = 4;\n */\n x: number;\n\n /**\n * @generated from field: double y = 5;\n */\n y: number;\n};\n\n/**\n * Describes the message aperture.live.v1.Stroke.\n * Use `create(StrokeSchema)` to create a new message.\n */\nexport const StrokeSchema: GenMessage<Stroke> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 31);\n\n/**\n * @generated from message aperture.live.v1.HeldTab\n */\nexport type HeldTab = Message<\"aperture.live.v1.HeldTab\"> & {\n /**\n * @generated from field: uint32 tab = 1;\n */\n tab: number;\n\n /**\n * The member who holds it.\n *\n * @generated from field: uint64 holder = 2;\n */\n holder: bigint;\n\n /**\n * The member who asks the holder for it.\n *\n * @generated from field: optional uint64 asked_by = 3;\n */\n askedBy?: bigint | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.HeldTab.\n * Use `create(HeldTabSchema)` to create a new message.\n */\nexport const HeldTabSchema: GenMessage<HeldTab> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 32);\n\n/**\n * About the tab the client watches.\n *\n * @generated from message aperture.live.v1.Lease\n */\nexport type Lease = Message<\"aperture.live.v1.Lease\"> & {\n /**\n * @generated from field: aperture.live.v1.LeaseAction action = 1;\n */\n action: LeaseAction;\n};\n\n/**\n * Describes the message aperture.live.v1.Lease.\n * Use `create(LeaseSchema)` to create a new message.\n */\nexport const LeaseSchema: GenMessage<Lease> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 33);\n\n/**\n * The watched target's page was asked for its menu, as by a right click, and showed none\n * of its own: the browser shows none either. What the menu would be of is told, for the\n * client to show one. Sent to the client that drives the target's tab.\n *\n * @generated from message aperture.live.v1.Menu\n */\nexport type Menu = Message<\"aperture.live.v1.Menu\"> & {\n /**\n * The link under the pointer.\n *\n * @generated from field: optional string link = 1;\n */\n link?: string | undefined;\n\n /**\n * The picture under the pointer.\n *\n * @generated from field: optional string image = 2;\n */\n image?: string | undefined;\n\n /**\n * The text that is selected.\n *\n * @generated from field: optional string text = 3;\n */\n text?: string | undefined;\n\n /**\n * There is a field to write into under the pointer.\n *\n * @generated from field: bool editable = 4;\n */\n editable: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.Menu.\n * Use `create(MenuSchema)` to create a new message.\n */\nexport const MenuSchema: GenMessage<Menu> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 34);\n\n/**\n * Takes the watched target's page elsewhere.\n *\n * @generated from message aperture.live.v1.Go\n */\nexport type Go = Message<\"aperture.live.v1.Go\"> & {\n /**\n * @generated from oneof aperture.live.v1.Go.to\n */\n to: {\n /**\n * A page on the web; or nothing, with `new_tab`, for an empty new tab.\n *\n * @generated from field: string url = 1;\n */\n value: string;\n case: \"url\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Along along = 2;\n */\n value: Along;\n case: \"along\";\n } | { case: undefined; value?: undefined };\n\n /**\n * The page opens in a new tab rather than in the target's.\n *\n * @generated from field: bool new_tab = 3;\n */\n newTab: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.Go.\n * Use `create(GoSchema)` to create a new message.\n */\nexport const GoSchema: GenMessage<Go> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 35);\n\n/**\n * Closes a target's tab, for a client that may give it input: one nobody else holds.\n *\n * @generated from message aperture.live.v1.Close\n */\nexport type Close = Message<\"aperture.live.v1.Close\"> & {\n /**\n * @generated from field: uint32 tab = 1;\n */\n tab: number;\n};\n\n/**\n * Describes the message aperture.live.v1.Close.\n * Use `create(CloseSchema)` to create a new message.\n */\nexport const CloseSchema: GenMessage<Close> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 36);\n\n/**\n * Something a client asked for was not done. What is done is not answered: it shows in\n * what the session tells anyway.\n *\n * @generated from message aperture.live.v1.Failed\n */\nexport type Failed = Message<\"aperture.live.v1.Failed\"> & {\n /**\n * @generated from field: aperture.live.v1.Asked asked = 1;\n */\n asked: Asked;\n\n /**\n * Why, for a person to read.\n *\n * @generated from field: string reason = 2;\n */\n reason: string;\n};\n\n/**\n * Describes the message aperture.live.v1.Failed.\n * Use `create(FailedSchema)` to create a new message.\n */\nexport const FailedSchema: GenMessage<Failed> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 37);\n\n/**\n * What the client is used from. A client says so after `hello`, and again when it changes.\n *\n * @generated from message aperture.live.v1.Device\n */\nexport type Device = Message<\"aperture.live.v1.Device\"> & {\n /**\n * A phone: a finger points at it, and its screen is narrow. A tab whose mode is\n * `PAGE_MODE_AUTO` shows its pages as on a phone while a client that is one holds it.\n *\n * @generated from field: bool phone = 1;\n */\n phone: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.Device.\n * Use `create(DeviceSchema)` to create a new message.\n */\nexport const DeviceSchema: GenMessage<Device> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 38);\n\n/**\n * Sets the mode of the tab the client watches, for a client that holds it. Where that\n * changes how the tab's pages are shown, the page is loaded again, as it is then.\n *\n * @generated from message aperture.live.v1.SetMode\n */\nexport type SetMode = Message<\"aperture.live.v1.SetMode\"> & {\n /**\n * @generated from field: aperture.live.v1.PageMode mode = 1;\n */\n mode: PageMode;\n};\n\n/**\n * Describes the message aperture.live.v1.SetMode.\n * Use `create(SetModeSchema)` to create a new message.\n */\nexport const SetModeSchema: GenMessage<SetMode> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 39);\n\n/**\n * Asks for a picture the watched target's page shows. The session answers with\n * `clipboard`, the picture in the form the page has it, such as `image/jpeg`.\n *\n * @generated from message aperture.live.v1.CopyPicture\n */\nexport type CopyPicture = Message<\"aperture.live.v1.CopyPicture\"> & {\n /**\n * @generated from field: string url = 1;\n */\n url: string;\n};\n\n/**\n * Describes the message aperture.live.v1.CopyPicture.\n * Use `create(CopyPictureSchema)` to create a new message.\n */\nexport const CopyPictureSchema: GenMessage<CopyPicture> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 40);\n\n/**\n * The pages that ask for files and have no answer yet, as a page does when a file input\n * is clicked: the browser shows no dialog of its own. Sent in answer to `hello` and\n * whenever it changes. A request ends with its answer or with its page.\n *\n * @generated from message aperture.live.v1.FileRequests\n */\nexport type FileRequests = Message<\"aperture.live.v1.FileRequests\"> & {\n /**\n * @generated from field: repeated aperture.live.v1.FileRequest requests = 1;\n */\n requests: FileRequest[];\n};\n\n/**\n * Describes the message aperture.live.v1.FileRequests.\n * Use `create(FileRequestsSchema)` to create a new message.\n */\nexport const FileRequestsSchema: GenMessage<FileRequests> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 41);\n\n/**\n * @generated from message aperture.live.v1.FileRequest\n */\nexport type FileRequest = Message<\"aperture.live.v1.FileRequest\"> & {\n /**\n * @generated from field: uint64 id = 1;\n */\n id: bigint;\n\n /**\n * The tab whose page asks.\n *\n * @generated from field: uint32 tab = 2;\n */\n tab: number;\n\n /**\n * The page takes more than one file.\n *\n * @generated from field: bool multiple = 3;\n */\n multiple: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.FileRequest.\n * Use `create(FileRequestSchema)` to create a new message.\n */\nexport const FileRequestSchema: GenMessage<FileRequest> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 42);\n\n/**\n * Answers a page's request for files with files a client put into the session first (see\n * `uploads` beside the session socket), by their names there. With none the page is left\n * without, as when a dialog is dismissed.\n *\n * @generated from message aperture.live.v1.FilesChosen\n */\nexport type FilesChosen = Message<\"aperture.live.v1.FilesChosen\"> & {\n /**\n * @generated from field: uint64 id = 1;\n */\n id: bigint;\n\n /**\n * @generated from field: repeated string files = 2;\n */\n files: string[];\n};\n\n/**\n * Describes the message aperture.live.v1.FilesChosen.\n * Use `create(FilesChosenSchema)` to create a new message.\n */\nexport const FilesChosenSchema: GenMessage<FilesChosen> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 43);\n\n/**\n * Drops content onto the watched target at a position, as one who dragged it there would:\n * text, a picture, or files, which a client puts into the session first (see `uploads`\n * beside the session socket) and names here.\n *\n * @generated from message aperture.live.v1.Drop\n */\nexport type Drop = Message<\"aperture.live.v1.Drop\"> & {\n /**\n * In the target's logical pixels.\n *\n * @generated from field: double x = 1;\n */\n x: number;\n\n /**\n * @generated from field: double y = 2;\n */\n y: number;\n\n /**\n * @generated from field: aperture.live.v1.Clipboard content = 3;\n */\n content?: Clipboard | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Drop.\n * Use `create(DropSchema)` to create a new message.\n */\nexport const DropSchema: GenMessage<Drop> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 44);\n\n/**\n * Content that is copied or dragged: the same content in each form it is had in, at most\n * 8 MiB of them together.\n *\n * @generated from message aperture.live.v1.Clipboard\n */\nexport type Clipboard = Message<\"aperture.live.v1.Clipboard\"> & {\n /**\n * @generated from field: repeated aperture.live.v1.Clipboard.Form forms = 1;\n */\n forms: Clipboard_Form[];\n};\n\n/**\n * Describes the message aperture.live.v1.Clipboard.\n * Use `create(ClipboardSchema)` to create a new message.\n */\nexport const ClipboardSchema: GenMessage<Clipboard> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 45);\n\n/**\n * @generated from message aperture.live.v1.Clipboard.Form\n */\nexport type Clipboard_Form = Message<\"aperture.live.v1.Clipboard.Form\"> & {\n /**\n * The form's MIME type. `text/plain` is text, as UTF-8; `text/html` is marked-up text;\n * `image/png` is a picture; `text/uri-list` is files of the session, as the lines of\n * their `file://` URIs, which a session takes of its own files only. Other forms are\n * left out.\n *\n * @generated from field: string type = 1;\n */\n type: string;\n\n /**\n * @generated from field: bytes data = 2;\n */\n data: Uint8Array;\n};\n\n/**\n * Describes the message aperture.live.v1.Clipboard.Form.\n * Use `create(Clipboard_FormSchema)` to create a new message.\n */\nexport const Clipboard_FormSchema: GenMessage<Clipboard_Form> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 45, 0);\n\n/**\n * The viewport of the target the client watches: the size its page gets, in logical (CSS)\n * pixels, and how many pixels the page draws to each of them (its `devicePixelRatio`).\n * It is the target's: every client that watches it sees it. A target starts with the\n * session's. The session gives the nearest it can: a side of 64 to 4096, a scale of 0.5\n * to 4, and no more than 4096 pixels a side; `targets` tells what it gave. A page shown\n * as on a desktop is no narrower than the browser makes a window, 500; one shown as on a\n * phone is.\n *\n * @generated from message aperture.live.v1.Viewport\n */\nexport type Viewport = Message<\"aperture.live.v1.Viewport\"> & {\n /**\n * @generated from field: uint32 width = 1;\n */\n width: number;\n\n /**\n * @generated from field: uint32 height = 2;\n */\n height: number;\n\n /**\n * The target keeps its scale when left out.\n *\n * @generated from field: optional double scale = 3;\n */\n scale?: number | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Viewport.\n * Use `create(ViewportSchema)` to create a new message.\n */\nexport const ViewportSchema: GenMessage<Viewport> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 46);\n\n/**\n * A browser target: a page of the session's browser, shown in a window of its own. It is\n * named by its tab's number, here and wherever else a client or the session names one.\n *\n * @generated from message aperture.live.v1.Target\n */\nexport type Target = Message<\"aperture.live.v1.Target\"> & {\n /**\n * The page's DevTools target id, for whoever speaks DevTools to the browser. It lasts\n * as long as the page does in one run of the session.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string title = 2;\n */\n title: string;\n\n /**\n * @generated from field: string url = 3;\n */\n url: string;\n\n /**\n * In logical pixels, which pointer positions are in.\n *\n * @generated from field: uint32 width = 4;\n */\n width: number;\n\n /**\n * @generated from field: uint32 height = 5;\n */\n height: number;\n\n /**\n * Pixels to a logical pixel: the target's picture is `width` x `height` times this.\n *\n * @generated from field: double scale = 6;\n */\n scale: number;\n\n /**\n * The tab's number, which no other tab of the session gets. It stays the tab's when\n * the session is suspended and resumed, which the target's id does not.\n *\n * @generated from field: uint32 tab = 7;\n */\n tab: number;\n\n /**\n * The tab plays sound now. Never where the session's sound is off.\n *\n * @generated from field: bool sounds = 8;\n */\n sounds: boolean;\n\n /**\n * The page's history has somewhere to go back to, and forward.\n *\n * @generated from field: bool goes_back = 9;\n */\n goesBack: boolean;\n\n /**\n * @generated from field: bool goes_forward = 10;\n */\n goesForward: boolean;\n\n /**\n * How the tab's pages are shown, as it was set.\n *\n * @generated from field: aperture.live.v1.PageMode mode = 11;\n */\n mode: PageMode;\n\n /**\n * The tab's pages are shown as on a phone now: what `mode` comes to.\n *\n * @generated from field: bool mobile = 12;\n */\n mobile: boolean;\n};\n\n/**\n * Describes the message aperture.live.v1.Target.\n * Use `create(TargetSchema)` to create a new message.\n */\nexport const TargetSchema: GenMessage<Target> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 47);\n\n/**\n * Every target of the session, oldest first. Sent after `hello` and whenever a target\n * opens, closes or changes.\n *\n * @generated from message aperture.live.v1.Targets\n */\nexport type Targets = Message<\"aperture.live.v1.Targets\"> & {\n /**\n * @generated from field: repeated aperture.live.v1.Target targets = 1;\n */\n targets: Target[];\n};\n\n/**\n * Describes the message aperture.live.v1.Targets.\n * Use `create(TargetsSchema)` to create a new message.\n */\nexport const TargetsSchema: GenMessage<Targets> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 48);\n\n/**\n * The tab the client's video shows from now on; none when the session has no target.\n *\n * @generated from message aperture.live.v1.Selected\n */\nexport type Selected = Message<\"aperture.live.v1.Selected\"> & {\n /**\n * @generated from field: optional uint32 tab = 1;\n */\n tab?: number | undefined;\n};\n\n/**\n * Describes the message aperture.live.v1.Selected.\n * Use `create(SelectedSchema)` to create a new message.\n */\nexport const SelectedSchema: GenMessage<Selected> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 49);\n\n/**\n * @generated from message aperture.live.v1.Cursor\n */\nexport type Cursor = Message<\"aperture.live.v1.Cursor\"> & {\n /**\n * @generated from oneof aperture.live.v1.Cursor.cursor\n */\n cursor: {\n /**\n * A CSS cursor name.\n *\n * @generated from field: string named = 1;\n */\n value: string;\n case: \"named\";\n } | {\n /**\n * @generated from field: aperture.live.v1.Cursor.Hidden hidden = 2;\n */\n value: Cursor_Hidden;\n case: \"hidden\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message aperture.live.v1.Cursor.\n * Use `create(CursorSchema)` to create a new message.\n */\nexport const CursorSchema: GenMessage<Cursor> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 50);\n\n/**\n * @generated from message aperture.live.v1.Cursor.Hidden\n */\nexport type Cursor_Hidden = Message<\"aperture.live.v1.Cursor.Hidden\"> & {\n};\n\n/**\n * Describes the message aperture.live.v1.Cursor.Hidden.\n * Use `create(Cursor_HiddenSchema)` to create a new message.\n */\nexport const Cursor_HiddenSchema: GenMessage<Cursor_Hidden> = /*@__PURE__*/\n messageDesc(file_aperture_live_v1_live, 50, 0);\n\n/**\n * @generated from enum aperture.live.v1.Pace\n */\nexport enum Pace {\n /**\n * @generated from enum value: PACE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * The pointer jumps to each action.\n *\n * @generated from enum value: PACE_INSTANT = 1;\n */\n INSTANT = 1,\n\n /**\n * The pointer travels there, quickly but so that the eye can follow, and text is typed\n * out.\n *\n * @generated from enum value: PACE_FAST = 2;\n */\n FAST = 2,\n\n /**\n * Unhurried travel, for demos.\n *\n * @generated from enum value: PACE_SLOW = 3;\n */\n SLOW = 3,\n}\n\n/**\n * Describes the enum aperture.live.v1.Pace.\n */\nexport const PaceSchema: GenEnum<Pace> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 0);\n\n/**\n * The form a target's video takes.\n *\n * @generated from enum aperture.live.v1.VideoFormat\n */\nexport enum VideoFormat {\n /**\n * @generated from enum value: VIDEO_FORMAT_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * H.264 constrained baseline, 4:2:0. Everything decodes it; colored text loses detail.\n *\n * @generated from enum value: VIDEO_FORMAT_H264 = 1;\n */\n H264 = 1,\n\n /**\n * H.264 High 4:4:4, in BT.709: color as sharp as light. For frames on the session\n * socket, where the client's decoder takes it; WebRTC does not carry it.\n *\n * @generated from enum value: VIDEO_FORMAT_FULL_CHROMA = 2;\n */\n FULL_CHROMA = 2,\n\n /**\n * H.265 Main, 4:2:0: fewer bits than H.264 for the same picture.\n *\n * @generated from enum value: VIDEO_FORMAT_H265 = 3;\n */\n H265 = 3,\n\n /**\n * VP9 profile 0, 4:2:0.\n *\n * @generated from enum value: VIDEO_FORMAT_VP9 = 4;\n */\n VP9 = 4,\n\n /**\n * VP9 profile 1, 4:4:4: color as sharp as light, also over WebRTC.\n *\n * @generated from enum value: VIDEO_FORMAT_VP9_FULL_CHROMA = 5;\n */\n VP9_FULL_CHROMA = 5,\n\n /**\n * AV1 main, 4:2:0.\n *\n * @generated from enum value: VIDEO_FORMAT_AV1 = 6;\n */\n AV1 = 6,\n}\n\n/**\n * Describes the enum aperture.live.v1.VideoFormat.\n */\nexport const VideoFormatSchema: GenEnum<VideoFormat> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 1);\n\n/**\n * How much a target's video costs the client's link. The session picks it, by what the\n * link carries, and changes it as that changes: over WebRTC by the connection's own\n * estimate, on the session socket by how late the client shows frames (`video_shown`).\n *\n * @generated from enum aperture.live.v1.VideoQuality\n */\nexport enum VideoQuality {\n /**\n * @generated from enum value: VIDEO_QUALITY_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Up to 0.7 Mbit/s, 15 frames a second. Bitrates are for a picture of 1280x720 pixels;\n * larger ones get more.\n *\n * @generated from enum value: VIDEO_QUALITY_LOW = 1;\n */\n LOW = 1,\n\n /**\n * Up to 2.5 Mbit/s, 30 frames a second.\n *\n * @generated from enum value: VIDEO_QUALITY_MEDIUM = 2;\n */\n MEDIUM = 2,\n\n /**\n * A constant quality whatever it takes, 60 frames a second.\n *\n * @generated from enum value: VIDEO_QUALITY_FULL = 3;\n */\n FULL = 3,\n}\n\n/**\n * Describes the enum aperture.live.v1.VideoQuality.\n */\nexport const VideoQualitySchema: GenEnum<VideoQuality> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 2);\n\n/**\n * How the pixels of the watched target reach a client.\n *\n * @generated from enum aperture.live.v1.Pixels\n */\nexport enum Pixels {\n /**\n * None: the client only controls, or has yet to say.\n *\n * @generated from enum value: PIXELS_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Video over WebRTC, once the client has offered a connection.\n *\n * @generated from enum value: PIXELS_VIDEO = 1;\n */\n VIDEO = 1,\n\n /**\n * Tiles on the session socket.\n *\n * @generated from enum value: PIXELS_TILES = 2;\n */\n TILES = 2,\n\n /**\n * Video frames on the session socket.\n *\n * @generated from enum value: PIXELS_FRAMES = 3;\n */\n FRAMES = 3,\n}\n\n/**\n * Describes the enum aperture.live.v1.Pixels.\n */\nexport const PixelsSchema: GenEnum<Pixels> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 3);\n\n/**\n * @generated from enum aperture.live.v1.MouseButton\n */\nexport enum MouseButton {\n /**\n * @generated from enum value: MOUSE_BUTTON_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: MOUSE_BUTTON_LEFT = 1;\n */\n LEFT = 1,\n\n /**\n * @generated from enum value: MOUSE_BUTTON_RIGHT = 2;\n */\n RIGHT = 2,\n\n /**\n * @generated from enum value: MOUSE_BUTTON_MIDDLE = 3;\n */\n MIDDLE = 3,\n\n /**\n * @generated from enum value: MOUSE_BUTTON_BACK = 4;\n */\n BACK = 4,\n\n /**\n * @generated from enum value: MOUSE_BUTTON_FORWARD = 5;\n */\n FORWARD = 5,\n}\n\n/**\n * Describes the enum aperture.live.v1.MouseButton.\n */\nexport const MouseButtonSchema: GenEnum<MouseButton> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 4);\n\n/**\n * @generated from enum aperture.live.v1.DownloadState\n */\nexport enum DownloadState {\n /**\n * @generated from enum value: DOWNLOAD_STATE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: DOWNLOAD_STATE_RUNNING = 1;\n */\n RUNNING = 1,\n\n /**\n * @generated from enum value: DOWNLOAD_STATE_DONE = 2;\n */\n DONE = 2,\n\n /**\n * @generated from enum value: DOWNLOAD_STATE_FAILED = 3;\n */\n FAILED = 3,\n}\n\n/**\n * Describes the enum aperture.live.v1.DownloadState.\n */\nexport const DownloadStateSchema: GenEnum<DownloadState> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 5);\n\n/**\n * @generated from enum aperture.live.v1.StrokePhase\n */\nexport enum StrokePhase {\n /**\n * @generated from enum value: STROKE_PHASE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: STROKE_PHASE_START = 1;\n */\n START = 1,\n\n /**\n * @generated from enum value: STROKE_PHASE_MOVE = 2;\n */\n MOVE = 2,\n\n /**\n * @generated from enum value: STROKE_PHASE_END = 3;\n */\n END = 3,\n}\n\n/**\n * Describes the enum aperture.live.v1.StrokePhase.\n */\nexport const StrokePhaseSchema: GenEnum<StrokePhase> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 6);\n\n/**\n * @generated from enum aperture.live.v1.Role\n */\nexport enum Role {\n /**\n * @generated from enum value: ROLE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Watches.\n *\n * @generated from enum value: ROLE_VIEW = 1;\n */\n VIEW = 1,\n\n /**\n * Gives input.\n *\n * @generated from enum value: ROLE_CONTROL = 2;\n */\n CONTROL = 2,\n\n /**\n * Takes a tab from whoever holds it.\n *\n * @generated from enum value: ROLE_ADMIN = 3;\n */\n ADMIN = 3,\n}\n\n/**\n * Describes the enum aperture.live.v1.Role.\n */\nexport const RoleSchema: GenEnum<Role> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 7);\n\n/**\n * @generated from enum aperture.live.v1.LeaseAction\n */\nexport enum LeaseAction {\n /**\n * @generated from enum value: LEASE_ACTION_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Asks for the tab. One nobody holds is the client's at once, and so is any an admin\n * asks for. Another holder is asked, and the tab is the client's when the holder allows\n * it or does not answer for ten seconds.\n *\n * @generated from enum value: LEASE_ACTION_TAKE = 1;\n */\n TAKE = 1,\n\n /**\n * Lets go of the tab the client holds.\n *\n * @generated from enum value: LEASE_ACTION_RELEASE = 2;\n */\n RELEASE = 2,\n\n /**\n * Answers the member who asks for the tab the client holds.\n *\n * @generated from enum value: LEASE_ACTION_ALLOW = 3;\n */\n ALLOW = 3,\n\n /**\n * @generated from enum value: LEASE_ACTION_KEEP = 4;\n */\n KEEP = 4,\n}\n\n/**\n * Describes the enum aperture.live.v1.LeaseAction.\n */\nexport const LeaseActionSchema: GenEnum<LeaseAction> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 8);\n\n/**\n * Where along a page's history.\n *\n * @generated from enum aperture.live.v1.Along\n */\nexport enum Along {\n /**\n * @generated from enum value: ALONG_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: ALONG_BACK = 1;\n */\n BACK = 1,\n\n /**\n * @generated from enum value: ALONG_FORWARD = 2;\n */\n FORWARD = 2,\n\n /**\n * @generated from enum value: ALONG_RELOAD = 3;\n */\n RELOAD = 3,\n}\n\n/**\n * Describes the enum aperture.live.v1.Along.\n */\nexport const AlongSchema: GenEnum<Along> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 9);\n\n/**\n * @generated from enum aperture.live.v1.Asked\n */\nexport enum Asked {\n /**\n * @generated from enum value: ASKED_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: ASKED_GO = 1;\n */\n GO = 1,\n\n /**\n * @generated from enum value: ASKED_CLOSE = 2;\n */\n CLOSE = 2,\n\n /**\n * @generated from enum value: ASKED_COPY_PICTURE = 3;\n */\n COPY_PICTURE = 3,\n\n /**\n * @generated from enum value: ASKED_FILES_CHOSEN = 4;\n */\n FILES_CHOSEN = 4,\n\n /**\n * @generated from enum value: ASKED_FOLLOW = 5;\n */\n FOLLOW = 5,\n\n /**\n * @generated from enum value: ASKED_SET_MODE = 6;\n */\n SET_MODE = 6,\n}\n\n/**\n * Describes the enum aperture.live.v1.Asked.\n */\nexport const AskedSchema: GenEnum<Asked> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 10);\n\n/**\n * How a tab's pages are shown.\n *\n * @generated from enum aperture.live.v1.PageMode\n */\nexport enum PageMode {\n /**\n * @generated from enum value: PAGE_MODE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * As on what its holder uses: as on a phone once a client that is a phone holds the\n * tab, and as on a desktop once one that is none does. Watching changes nothing, and\n * neither does the session's automation, which has no device: the tab stays as it was.\n * A page that is there when this changes is left as it loaded; the pages that load\n * after are asked for as the tab is by then.\n *\n * @generated from enum value: PAGE_MODE_AUTO = 1;\n */\n AUTO = 1,\n\n /**\n * @generated from enum value: PAGE_MODE_DESKTOP = 2;\n */\n DESKTOP = 2,\n\n /**\n * As on a phone: a phone's user agent and client hints, touch in place of a mouse, and\n * a viewport pages lay themselves out for as for a phone's.\n *\n * @generated from enum value: PAGE_MODE_MOBILE = 3;\n */\n MOBILE = 3,\n}\n\n/**\n * Describes the enum aperture.live.v1.PageMode.\n */\nexport const PageModeSchema: GenEnum<PageMode> = /*@__PURE__*/\n enumDesc(file_aperture_live_v1_live, 11);\n\n","/** `KeyboardEvent.code` to Linux evdev key codes. */\nexport const KEYS: Readonly<Record<string, number>> = {\n Escape: 1,\n Digit1: 2,\n Digit2: 3,\n Digit3: 4,\n Digit4: 5,\n Digit5: 6,\n Digit6: 7,\n Digit7: 8,\n Digit8: 9,\n Digit9: 10,\n Digit0: 11,\n Minus: 12,\n Equal: 13,\n Backspace: 14,\n Tab: 15,\n KeyQ: 16,\n KeyW: 17,\n KeyE: 18,\n KeyR: 19,\n KeyT: 20,\n KeyY: 21,\n KeyU: 22,\n KeyI: 23,\n KeyO: 24,\n KeyP: 25,\n BracketLeft: 26,\n BracketRight: 27,\n Enter: 28,\n ControlLeft: 29,\n KeyA: 30,\n KeyS: 31,\n KeyD: 32,\n KeyF: 33,\n KeyG: 34,\n KeyH: 35,\n KeyJ: 36,\n KeyK: 37,\n KeyL: 38,\n Semicolon: 39,\n Quote: 40,\n Backquote: 41,\n ShiftLeft: 42,\n Backslash: 43,\n KeyZ: 44,\n KeyX: 45,\n KeyC: 46,\n KeyV: 47,\n KeyB: 48,\n KeyN: 49,\n KeyM: 50,\n Comma: 51,\n Period: 52,\n Slash: 53,\n ShiftRight: 54,\n NumpadMultiply: 55,\n AltLeft: 56,\n Space: 57,\n CapsLock: 58,\n F1: 59,\n F2: 60,\n F3: 61,\n F4: 62,\n F5: 63,\n F6: 64,\n F7: 65,\n F8: 66,\n F9: 67,\n F10: 68,\n NumLock: 69,\n ScrollLock: 70,\n Numpad7: 71,\n Numpad8: 72,\n Numpad9: 73,\n NumpadSubtract: 74,\n Numpad4: 75,\n Numpad5: 76,\n Numpad6: 77,\n NumpadAdd: 78,\n Numpad1: 79,\n Numpad2: 80,\n Numpad3: 81,\n Numpad0: 82,\n NumpadDecimal: 83,\n IntlBackslash: 86,\n F11: 87,\n F12: 88,\n NumpadEnter: 96,\n ControlRight: 97,\n NumpadDivide: 98,\n AltRight: 100,\n Home: 102,\n ArrowUp: 103,\n PageUp: 104,\n ArrowLeft: 105,\n ArrowRight: 106,\n End: 107,\n ArrowDown: 108,\n PageDown: 109,\n Insert: 110,\n Delete: 111,\n MetaLeft: 125,\n MetaRight: 126,\n ContextMenu: 127,\n};\n\nexport const KEY = {\n enter: 28,\n backspace: 14,\n delete: 111,\n a: 30,\n c: 46,\n v: 47,\n} as const;\n\nexport const CONTROLS = [29, 97] as const;\n\nexport const METAS = [125, 126] as const;\n\nconst DIGITS = \"1!2@3#4$5%6^7&8*9(0)\";\n\nconst LETTERS = \"abcdefghijklmnopqrstuvwxyz\";\n\nconst layout = () => {\n const written: Record<string, string> = {\n Space: \" \",\n Minus: \"-_\",\n Equal: \"=+\",\n BracketLeft: \"[{\",\n BracketRight: \"]}\",\n Backslash: \"\\\\|\",\n Semicolon: \";:\",\n Quote: \"'\\\"\",\n Backquote: \"`~\",\n Comma: \",<\",\n Period: \".>\",\n Slash: \"/?\",\n };\n for (let at = 0; at < DIGITS.length; at += 2) {\n written[`Digit${DIGITS[at]}`] = DIGITS.slice(at, at + 2);\n }\n for (const letter of LETTERS) {\n written[`Key${letter.toUpperCase()}`] = letter + letter.toUpperCase();\n }\n return written;\n};\n\n/**\n * What the keys of a US keyboard write, plain and with Shift, by `KeyboardEvent.code`.\n * The session's keyboard is a US one.\n */\nexport const US: Readonly<Record<string, string>> = layout();\n\n/**\n * The keys that are down in the session, as this client pressed them. A key that was not\n * pressed here is not released there.\n */\nexport interface Keyboard {\n readonly press: (code: number, pressed: boolean) => void;\n readonly tap: (code: number) => void;\n /** A key with Control, as the shortcuts of the session's browser are. */\n readonly chord: (code: number) => void;\n /** Control and V, whatever modifiers are held here. */\n readonly paste: () => void;\n readonly releaseAll: () => void;\n}\n\nexport const makeKeyboard = (send: (code: number, pressed: boolean) => void): Keyboard => {\n const held = new Set<number>();\n\n const press = (code: number, pressed: boolean) => {\n if (pressed) {\n held.add(code);\n } else if (!held.delete(code)) {\n return;\n }\n send(code, pressed);\n };\n\n const tap = (code: number) => {\n press(code, true);\n press(code, false);\n };\n\n return {\n press,\n tap,\n chord: (code) => {\n press(CONTROLS[0], true);\n tap(code);\n press(CONTROLS[0], false);\n },\n paste: () => {\n // Command and V pastes on a Mac, and Meta held with Control and V does not there.\n for (const code of METAS) {\n press(code, false);\n }\n const controlled = CONTROLS.some((code) => held.has(code));\n if (!controlled) {\n press(CONTROLS[0], true);\n }\n tap(KEY.v);\n if (!controlled) {\n press(CONTROLS[0], false);\n }\n },\n releaseAll: () => {\n for (const code of held) {\n press(code, false);\n }\n },\n };\n};\n","import * as Effect from \"effect/Effect\";\nimport { form, png, texts } from \"./clipboard.ts\";\nimport { MouseButton } from \"./gen/aperture/live/v1/live_pb.ts\";\nimport { KEY, KEYS, type Keyboard, US } from \"./keys.ts\";\nimport type { ClipboardForm, PictureWay } from \"./model.ts\";\nimport type { Outgoing } from \"./socket.ts\";\n\n/** The elements a session is shown in and takes input from. */\nexport interface Surfaces {\n /** Shows the picture while it comes as video. */\n readonly video: HTMLVideoElement;\n /** Shows the picture while it comes as frames or as tiles. */\n readonly canvas: HTMLCanvasElement;\n /** Takes the keyboard without showing: what is typed into it goes to the session. */\n readonly keys: HTMLTextAreaElement;\n /** What the picture is laid out in, whose size a fitted viewport follows. */\n readonly stage: HTMLElement;\n}\n\ninterface Size {\n readonly width: number;\n readonly height: number;\n}\n\ninterface Point {\n readonly x: number;\n readonly y: number;\n}\n\n/** What the wiring needs of the session it wires. */\nexport interface Wiring {\n readonly send: (message: Outgoing) => void;\n readonly keyboard: Keyboard;\n readonly way: () => PictureWay;\n /** The size of the watched target in logical pixels, which positions are in. */\n readonly watched: () => Size | undefined;\n /** Puts files into the session and gives the form that names them there. */\n readonly listed: (files: readonly File[]) => Promise<ClipboardForm>;\n /** The right button went down at a place, where a menu the session reports is shown. */\n readonly menuAt: (at: Point) => void;\n readonly dismissMenu: () => void;\n /** A finger moved the page by this much, in the target's pixels, or flung it on. */\n readonly dragged: (by: Point) => void;\n /** The stage has another size. */\n readonly resized: () => void;\n readonly failed: (what: string, cause: unknown) => void;\n}\n\n/** `MouseEvent.button` to the protocol's buttons. */\nconst BUTTONS = [\n MouseButton.LEFT,\n MouseButton.MIDDLE,\n MouseButton.RIGHT,\n MouseButton.BACK,\n MouseButton.FORWARD,\n];\n\n/** How long the stage has to keep a size before the viewport follows it. */\nconst RESIZE_SETTLES_MS = 200;\n\n/** Pixels and lines of a wheel to a notch of it. */\nconst NOTCH = { pixels: 100, lines: 3 };\n\n/** How far a finger may stray, in pixels here, and still be a tap and not a drag. */\nconst TAP_SLOP = 10;\n/** How long a finger rests in place before it is a press of the right button. */\nconst LONG_PRESS_MS = 500;\n/** What a page that was flung keeps of its speed after each millisecond, and where it stops. */\nconst FLING = { keeps: 0.996, least: 0.05, stops: 0.01 };\n\n/**\n * The part of an element's box its picture covers. An element whose box has not the\n * picture's proportions shows it whole and centred when it is told to contain it, as a\n * `video` is unless told otherwise.\n */\nconst covered = (view: HTMLElement, picture: Size) => {\n const box = view.getBoundingClientRect();\n const fit = getComputedStyle(view).objectFit;\n const contains = fit === \"contain\" || fit === \"scale-down\";\n if (!contains || picture.width === 0 || picture.height === 0) {\n return box;\n }\n const most = fit === \"scale-down\" ? 1 : Number.POSITIVE_INFINITY;\n const scale = Math.min(box.width / picture.width, box.height / picture.height, most);\n const width = picture.width * scale;\n const height = picture.height * scale;\n return {\n left: box.left + (box.width - width) / 2,\n top: box.top + (box.height - height) / 2,\n width,\n height,\n };\n};\n\n/**\n * Wires the pointer, the wheel, the keyboard, input methods, the clipboard and dragging\n * of the surfaces to a session. Closing the scope unwires them and releases the keys\n * that are held.\n */\nexport const wire = Effect.fn(\"Input.wire\")(function* (surfaces: Surfaces, wiring: Wiring) {\n const { video, canvas, keys, stage } = surfaces;\n const { send, keyboard } = wiring;\n const wired = yield* Effect.acquireRelease(\n Effect.sync(() => new AbortController()),\n (controller) =>\n Effect.sync(() => {\n controller.abort();\n keyboard.releaseAll();\n }),\n );\n const { signal } = wired;\n\n // Positions are in the target's own pixels, whatever size the picture is shown at.\n const position = (event: { readonly clientX: number; readonly clientY: number }) => {\n const shows = wiring.way() === \"video\";\n const picture = shows\n ? { width: video.videoWidth, height: video.videoHeight }\n : { width: canvas.width, height: canvas.height };\n const box = covered(shows ? video : canvas, picture);\n // The picture may have more pixels than the target has logical ones.\n const { width, height } = wiring.watched() ?? picture;\n if (box.width === 0 || box.height === 0) {\n return undefined;\n }\n const at: Point = {\n x: (event.clientX - box.left) * (width / box.width),\n y: (event.clientY - box.top) * (height / box.height),\n };\n return at;\n };\n\n const focus = () => keys.focus({ preventScroll: true });\n\n const button = (surface: HTMLElement, pressed: boolean) => (event: PointerEvent) => {\n focus();\n if (pressed) {\n wiring.dismissMenu();\n surface.setPointerCapture(event.pointerId);\n }\n if (event.button === 2) {\n wiring.menuAt({ x: event.clientX, y: event.clientY });\n }\n const at = position(event);\n const pressedButton = BUTTONS[event.button];\n if (at !== undefined && pressedButton !== undefined) {\n send({ case: \"pointerButton\", value: { ...at, button: pressedButton, pressed } });\n }\n event.preventDefault();\n };\n\n /**\n * A finger is no mouse: it has no buttons and nothing to turn. One that is put down and\n * lifted in place is a click of the left button; one that rests is a click of the right;\n * one that moves turns the wheel, so that the page scrolls under it as a page under a\n * finger does, and goes on for a while when it is flung. More fingers move the page as\n * one does: nothing is pressed while they are down.\n */\n const touches = (surface: HTMLElement) => {\n const fingers = new Map<number, { clientX: number; clientY: number }>();\n let gesture:\n | {\n kind: \"tap\" | \"scroll\" | \"held\";\n /** Where it began, here and in the page: the page scrolls what is there. */\n readonly began: { readonly clientX: number; readonly clientY: number };\n readonly at: Point;\n /** The middle of the fingers when they were last looked at. */\n middle: Point | undefined;\n moved: number;\n speed: Point;\n }\n | undefined;\n let resting: ReturnType<typeof setTimeout> | undefined;\n let flung: number | undefined;\n\n const still = () => {\n clearTimeout(resting);\n if (flung !== undefined) {\n cancelAnimationFrame(flung);\n flung = undefined;\n }\n };\n signal.addEventListener(\"abort\", still);\n\n /** The middle of the fingers, in the target's pixels. */\n const middle = () => {\n let clientX = 0;\n let clientY = 0;\n for (const finger of fingers.values()) {\n clientX += finger.clientX / fingers.size;\n clientY += finger.clientY / fingers.size;\n }\n return position({ clientX, clientY });\n };\n\n const click = (at: Point, pressedButton: MouseButton) => {\n send({ case: \"pointerMotion\", value: at });\n send({ case: \"pointerButton\", value: { ...at, button: pressedButton, pressed: true } });\n send({ case: \"pointerButton\", value: { ...at, button: pressedButton, pressed: false } });\n };\n\n const scroll = (at: Point, by: Point) => {\n send({\n case: \"pointerScroll\",\n value: { ...at, dx: by.x / NOTCH.pixels, dy: by.y / NOTCH.pixels },\n });\n wiring.dragged(by);\n };\n\n const fling = (at: Point, speed: Point) => {\n let before = performance.now();\n let going = speed;\n const step = (now: number) => {\n const elapsed = Math.min(now - before, 50);\n before = now;\n const kept = FLING.keeps ** elapsed;\n going = { x: going.x * kept, y: going.y * kept };\n if (Math.hypot(going.x, going.y) < FLING.stops) {\n flung = undefined;\n return;\n }\n scroll(at, { x: going.x * elapsed, y: going.y * elapsed });\n flung = requestAnimationFrame(step);\n };\n flung = requestAnimationFrame(step);\n };\n\n const down = (event: PointerEvent) => {\n event.preventDefault();\n still();\n wiring.dismissMenu();\n surface.setPointerCapture(event.pointerId);\n fingers.set(event.pointerId, event);\n const at = position(event);\n if (fingers.size > 1 || at === undefined) {\n if (gesture !== undefined) {\n gesture.kind = gesture.kind === \"held\" ? \"held\" : \"scroll\";\n gesture.middle = undefined;\n }\n return;\n }\n const began = { clientX: event.clientX, clientY: event.clientY };\n gesture = { kind: \"tap\", began, at, middle: at, moved: 0, speed: { x: 0, y: 0 } };\n // The page shows what is under the finger as under a pointer.\n send({ case: \"pointerMotion\", value: at });\n resting = setTimeout(() => {\n if (gesture?.kind === \"tap\") {\n gesture.kind = \"held\";\n wiring.menuAt({ x: began.clientX, y: began.clientY });\n click(at, MouseButton.RIGHT);\n }\n }, LONG_PRESS_MS);\n };\n\n const move = (event: PointerEvent) => {\n if (gesture === undefined || !fingers.has(event.pointerId)) {\n return;\n }\n fingers.set(event.pointerId, event);\n if (gesture.kind === \"tap\") {\n const strayed = Math.hypot(\n event.clientX - gesture.began.clientX,\n event.clientY - gesture.began.clientY,\n );\n if (strayed <= TAP_SLOP) {\n return;\n }\n clearTimeout(resting);\n gesture.kind = \"scroll\";\n gesture.middle = undefined;\n }\n if (gesture.kind !== \"scroll\") {\n return;\n }\n const now = middle();\n const before = gesture.middle;\n gesture.middle = now;\n if (now === undefined || before === undefined) {\n gesture.moved = event.timeStamp;\n return;\n }\n // The page goes with the finger: what the wheel turns by is the other way.\n const by = { x: before.x - now.x, y: before.y - now.y };\n scroll(gesture.at, by);\n const elapsed = Math.max(event.timeStamp - gesture.moved, 1);\n gesture.moved = event.timeStamp;\n // Evened out over the last moves: the last one alone is no measure of a fling.\n gesture.speed = {\n x: gesture.speed.x * 0.6 + (by.x / elapsed) * 0.4,\n y: gesture.speed.y * 0.6 + (by.y / elapsed) * 0.4,\n };\n };\n\n const up = (lifted: boolean) => (event: PointerEvent) => {\n if (!fingers.delete(event.pointerId) || gesture === undefined) {\n return;\n }\n event.preventDefault();\n if (fingers.size > 0) {\n gesture.middle = undefined;\n return;\n }\n clearTimeout(resting);\n const ended = gesture;\n gesture = undefined;\n if (!lifted) {\n return;\n }\n if (ended.kind === \"tap\") {\n click(ended.at, MouseButton.LEFT);\n } else if (\n ended.kind === \"scroll\" &&\n event.timeStamp - ended.moved < 100 &&\n Math.hypot(ended.speed.x, ended.speed.y) > FLING.least\n ) {\n fling(ended.at, ended.speed);\n }\n };\n\n return { down, move, up: up(true), cancel: up(false) };\n };\n\n const dropped = async (at: Point, files: readonly File[], carried: readonly ClipboardForm[]) => {\n const forms = files.length > 0 ? [await wiring.listed(files)] : carried;\n if (forms.length > 0) {\n send({ case: \"drop\", value: { ...at, content: { forms: [...forms] } } });\n }\n };\n\n const pictures: HTMLElement[] = [video, canvas];\n for (const surface of pictures) {\n const finger = touches(surface);\n const byFinger = (event: PointerEvent) => event.pointerType === \"touch\";\n const pressed = button(surface, true);\n const released = button(surface, false);\n surface.addEventListener(\n \"pointermove\",\n (event) => {\n if (byFinger(event)) {\n finger.move(event);\n return;\n }\n const at = position(event);\n if (at !== undefined) {\n send({ case: \"pointerMotion\", value: at });\n }\n },\n { signal },\n );\n surface.addEventListener(\"pointerleave\", () => send({ case: \"pointerLeave\", value: {} }), {\n signal,\n });\n surface.addEventListener(\n \"pointerdown\",\n (event) => (byFinger(event) ? finger.down(event) : pressed(event)),\n { signal },\n );\n surface.addEventListener(\n \"pointerup\",\n (event) => (byFinger(event) ? finger.up(event) : released(event)),\n { signal },\n );\n surface.addEventListener(\n \"pointercancel\",\n (event) => (byFinger(event) ? finger.cancel(event) : undefined),\n { signal },\n );\n surface.addEventListener(\"contextmenu\", (event) => event.preventDefault(), { signal });\n surface.addEventListener(\n \"wheel\",\n (event) => {\n const at = position(event);\n const notch = event.deltaMode === WheelEvent.DOM_DELTA_PIXEL ? NOTCH.pixels : NOTCH.lines;\n if (at !== undefined) {\n const scrolled = { ...at, dx: event.deltaX / notch, dy: event.deltaY / notch };\n send({ case: \"pointerScroll\", value: scrolled });\n }\n event.preventDefault();\n },\n { passive: false, signal },\n );\n // What is dropped on the picture is dropped on the page, there.\n surface.addEventListener(\n \"dragover\",\n (event) => {\n event.preventDefault();\n if (event.dataTransfer !== null) {\n event.dataTransfer.dropEffect = \"copy\";\n }\n },\n { signal },\n );\n surface.addEventListener(\n \"drop\",\n (event) => {\n event.preventDefault();\n const at = position(event);\n // What a drag carries is there to read only while its event is handled.\n const carried = event.dataTransfer;\n if (at === undefined || carried === null) {\n return;\n }\n dropped(at, [...carried.files], texts(carried)).catch((cause: unknown) =>\n wiring.failed(\"a drop\", cause),\n );\n },\n { signal },\n );\n }\n\n // The keyboard. A key goes as the physical key it is where the session's keyboard, a US\n // one, writes the same with it, so that it is held and released as here; a key that\n // writes something else here goes as the text it writes, and so does all that a phone's\n // keyboard or an input method enters.\n const text = (written: string, composing = false) =>\n send({ case: \"text\", value: { text: written, composing } });\n\n // A phone's keyboard deletes only what there is to delete.\n const rest = () => {\n keys.value = \" \";\n };\n rest();\n\n keys.addEventListener(\n \"keydown\",\n (event) => {\n if (event.key === \"Escape\") {\n wiring.dismissMenu();\n }\n // Composing, or a key of a phone's keyboard, which tells no key but 229: the text\n // comes of it.\n if (event.isComposing || event.keyCode === 229) {\n return;\n }\n const code = KEYS[event.code];\n if (code === undefined) {\n return;\n }\n const shortcut = event.ctrlKey || event.metaKey;\n // Pasting comes with what there is to paste.\n if (shortcut && event.code === \"KeyV\") {\n return;\n }\n const written = Array.from(event.key).length === 1 && !shortcut ? event.key : undefined;\n const same = US[event.code]?.[event.shiftKey ? 1 : 0] === written;\n if (written === undefined || same) {\n keyboard.press(code, true);\n } else {\n text(written);\n }\n event.preventDefault();\n },\n { signal },\n );\n keys.addEventListener(\n \"keyup\",\n (event) => {\n const code = KEYS[event.code];\n if (code !== undefined) {\n keyboard.press(code, false);\n }\n event.preventDefault();\n },\n { signal },\n );\n keys.addEventListener(\"blur\", () => keyboard.releaseAll(), { signal });\n keys.addEventListener(\"compositionupdate\", (event) => text(event.data, true), { signal });\n keys.addEventListener(\n \"compositionend\",\n (event) => {\n text(event.data);\n rest();\n },\n { signal },\n );\n keys.addEventListener(\n \"beforeinput\",\n (event) => {\n if (event.isComposing || /Composition/u.test(event.inputType)) {\n return;\n }\n event.preventDefault();\n if (/^insert(?:Text|ReplacementText)$/u.test(event.inputType) && event.data) {\n text(event.data);\n }\n if (/^insert(?:LineBreak|Paragraph)$/u.test(event.inputType)) {\n keyboard.tap(KEY.enter);\n }\n if (event.inputType === \"deleteContentBackward\") {\n keyboard.tap(KEY.backspace);\n }\n if (event.inputType === \"deleteContentForward\") {\n keyboard.tap(KEY.delete);\n }\n },\n { signal },\n );\n keys.addEventListener(\"input\", rest, { signal });\n\n // The session gets what is pasted here, then the keys that paste there.\n const pasted = async (carried: readonly ClipboardForm[], files: readonly File[]) => {\n const forms = [...carried];\n const [only] = files;\n // One picture is pasted as a picture, which more pages take than take a file.\n const picture = files.length === 1 && only?.type.startsWith(\"image/\") ? only : undefined;\n if (picture !== undefined) {\n forms.push(await form(\"image/png\", await png(picture)));\n } else if (files.length > 0) {\n forms.push(await wiring.listed(files));\n }\n if (forms.length === 0) {\n return;\n }\n send({ case: \"clipboard\", value: { forms } });\n keyboard.paste();\n };\n keys.addEventListener(\n \"paste\",\n (event) => {\n event.preventDefault();\n const carried = event.clipboardData;\n if (carried === null) {\n return;\n }\n pasted(texts(carried), [...carried.files]).catch((cause: unknown) =>\n wiring.failed(\"a paste\", cause),\n );\n },\n { signal },\n );\n\n if (typeof ResizeObserver !== \"undefined\") {\n let settling: ReturnType<typeof setTimeout> | undefined;\n const sizes = new ResizeObserver(() => {\n clearTimeout(settling);\n settling = setTimeout(wiring.resized, RESIZE_SETTLES_MS);\n });\n sizes.observe(stage);\n signal.addEventListener(\"abort\", () => {\n clearTimeout(settling);\n sizes.disconnect();\n });\n }\n});\n","import * as pb from \"./gen/aperture/live/v1/live_pb.ts\";\n\n/** How the picture of the watched target reaches the client. */\nexport type PictureWay = \"video\" | \"frames\" | \"tiles\";\n\n/** The form a target's video takes; see `VideoFormat` in the protocol. */\nexport type VideoFormat = \"h264\" | \"full-chroma\" | \"h265\" | \"vp9\" | \"vp9-full-chroma\" | \"av1\";\n\n/** How much the video costs the link; see `VideoQuality` in the protocol. */\nexport type VideoQuality = \"low\" | \"medium\" | \"full\";\n\nexport type Role = \"view\" | \"control\" | \"admin\";\n\nexport type DownloadState = \"running\" | \"done\" | \"failed\";\n\nexport type Along = \"back\" | \"forward\" | \"reload\";\n\nexport type LeaseAction = \"take\" | \"release\" | \"allow\" | \"keep\";\n\n/**\n * How a tab's pages are shown: as on a desktop, as on a phone, or as on what its holder\n * uses, which is a phone's once someone holds the tab from one.\n */\nexport type PageMode = \"auto\" | \"desktop\" | \"mobile\";\n\n/** A page of the session's browser. */\nexport interface Target {\n /** Lasts as long as the page does in one run of the session. */\n readonly id: string;\n /** The tab's number, which stays the tab's when the session is suspended and resumed. */\n readonly tab: number;\n readonly title: string;\n readonly url: string;\n /** In logical pixels, which pointer positions are in. */\n readonly width: number;\n readonly height: number;\n /** Pixels to a logical pixel. */\n readonly scale: number;\n /** How the tab's pages are shown, as it was set. */\n readonly mode: PageMode;\n /** The tab's pages are shown as on a phone now: what the mode comes to. */\n readonly mobile: boolean;\n /** The tab plays sound now. */\n readonly sounds: boolean;\n /** The page's history has somewhere to go back to, and forward. */\n readonly goesBack: boolean;\n readonly goesForward: boolean;\n}\n\n/** What this client may do in one area of the session. */\nexport interface Grant {\n readonly read: boolean;\n readonly write: boolean;\n}\n\n/**\n * What this client may do in the session, area by area: what whoever let it in gave it, of\n * what the session offers at all. Watching takes no grant.\n */\nexport interface Features {\n /** Write: giving the watched tab input. */\n readonly input: Grant;\n /** Write: opening, closing and navigating tabs, and giving them another size. */\n readonly tabs: Grant;\n /** Write: taking a tab from whoever holds it, without asking. */\n readonly lease: Grant;\n /** Read: hearing tabs. */\n readonly sound: Grant;\n /** Read: what is copied in the session. Write: pasting into it. */\n readonly clipboard: Grant;\n /** Read: the files put into the session. Write: putting them, and answering pages. */\n readonly uploads: Grant;\n /** Read: what the session's browser downloaded. */\n readonly downloads: Grant;\n /** Read: recordings and screenshots. Write: making them. */\n readonly recordings: Grant;\n /** Write: the automation endpoint. */\n readonly mcp: Grant;\n /** Write: the DevTools endpoint. */\n readonly cdp: Grant;\n /** Write: attaching a tunnel. */\n readonly tunnel: Grant;\n}\n\nconst NOTHING: Grant = { read: false, write: false };\n\n/** What a client may do before the session has told: nothing. */\nexport const NO_FEATURES: Features = {\n input: NOTHING,\n tabs: NOTHING,\n lease: NOTHING,\n sound: NOTHING,\n clipboard: NOTHING,\n uploads: NOTHING,\n downloads: NOTHING,\n recordings: NOTHING,\n mcp: NOTHING,\n cdp: NOTHING,\n tunnel: NOTHING,\n};\n\nconst grantOf = (grant: pb.Grant | undefined): Grant =>\n grant === undefined ? NOTHING : { read: grant.read, write: grant.write };\n\nexport const featuresOf = (features: pb.Features): Features => ({\n input: grantOf(features.input),\n tabs: grantOf(features.tabs),\n lease: grantOf(features.lease),\n sound: grantOf(features.sound),\n clipboard: grantOf(features.clipboard),\n uploads: grantOf(features.uploads),\n downloads: grantOf(features.downloads),\n recordings: grantOf(features.recordings),\n mcp: grantOf(features.mcp),\n cdp: grantOf(features.cdp),\n tunnel: grantOf(features.tunnel),\n});\n\n/** How the session's automation moves the pointer in a tab that is being recorded. */\nexport type Pace = \"instant\" | \"fast\" | \"slow\";\n\n/**\n * A storage state being put into the session's browser: so many tabs, cookies and origins,\n * which is none of each until the state has come. While it is underway the session takes\n * no input and changes no tabs. With `failure`, the state the session was to start with\n * was not taken, and the session ends.\n */\nexport interface Restoring {\n readonly tabs: number;\n readonly cookies: number;\n readonly origins: number;\n readonly failure: string | undefined;\n}\n\nexport const restoringOf = (told: pb.Restoring): Restoring | undefined =>\n told.underway || told.failure !== undefined\n ? { tabs: told.tabs, cookies: told.cookies, origins: told.origins, failure: told.failure }\n : undefined;\n\nexport const paceOf = (pace: pb.Pace): Pace => {\n switch (pace) {\n case pb.Pace.INSTANT: {\n return \"instant\";\n }\n case pb.Pace.SLOW: {\n return \"slow\";\n }\n default: {\n return \"fast\";\n }\n }\n};\n\nexport interface Member {\n readonly id: number;\n readonly name: string;\n readonly role: Role | undefined;\n /** The tab the member watches. */\n readonly tab: number | undefined;\n /** The session's automation rather than a person. */\n readonly agent: boolean;\n /** The member this one follows: it watches the tab that member watches. */\n readonly follows: number | undefined;\n}\n\n/** Where another member's pointer is on the watched tab, in the tab's logical pixels. */\nexport interface PointerMark {\n readonly member: number;\n /** None once the pointer left the tab's picture. */\n readonly at: { readonly x: number; readonly y: number } | undefined;\n}\n\nexport type StrokePhase = \"start\" | \"move\" | \"end\";\n\n/** A point of a stroke another member draws over the watched tab. */\nexport interface StrokePoint {\n readonly member: number;\n /** Which of the member's strokes the point is of. */\n readonly stroke: number;\n readonly phase: StrokePhase;\n readonly x: number;\n readonly y: number;\n}\n\nexport interface HeldTab {\n readonly tab: number;\n /** The member who holds it. */\n readonly holder: number;\n /** The member who asks the holder for it. */\n readonly askedBy: number | undefined;\n}\n\n/** Who is in the session and who drives which tab. */\nexport interface Presence {\n /** The member this client is. */\n readonly you: number;\n readonly members: readonly Member[];\n readonly held: readonly HeldTab[];\n}\n\nexport interface Download {\n readonly id: string;\n /** The file's name below `downloads/` of the session's files. */\n readonly name: string;\n readonly url: string;\n readonly receivedBytes: number;\n /** Left out while the page does not say. */\n readonly totalBytes: number | undefined;\n readonly state: DownloadState | undefined;\n}\n\n/** A page that asks for files and has no answer yet. */\nexport interface FileRequest {\n readonly id: number;\n /** The tab whose page asks. */\n readonly tab: number;\n readonly multiple: boolean;\n}\n\n/** What a right click in the session was on, when the page showed no menu of its own. */\nexport interface Menu {\n readonly link: string | undefined;\n readonly image: string | undefined;\n /** The text that is selected. */\n readonly text: string | undefined;\n /** There is a field to write into under the pointer. */\n readonly editable: boolean;\n}\n\n/** One form of content that is copied or dragged, by its MIME type. */\nexport interface ClipboardForm {\n readonly type: string;\n readonly data: Uint8Array;\n}\n\n/** Something was copied in the session. */\nexport interface ClipboardEvent {\n readonly forms: readonly ClipboardForm[];\n /** Whether this browser's clipboard took it; where it did not, a click has to. */\n readonly written: boolean;\n}\n\n/** Something this client asked for over the session socket was not done. */\nexport interface Failure {\n readonly asked: \"go\" | \"close\" | \"copyPicture\" | \"chooseFiles\" | \"follow\" | \"setMode\" | undefined;\n /** Why, as the session says it. */\n readonly reason: string;\n}\n\nexport interface VideoStatus {\n readonly format: VideoFormat | undefined;\n readonly quality: VideoQuality | undefined;\n /** Frames a second at most. */\n readonly fps: number;\n}\n\nexport interface PictureSettings {\n readonly format?: VideoFormat;\n readonly quality?: VideoQuality;\n readonly fps?: number;\n}\n\nexport interface Picture {\n readonly way: PictureWay;\n /** What this browser can do, best first. */\n readonly ways: readonly PictureWay[];\n /** What the session says it sends. */\n readonly status: VideoStatus | undefined;\n /** What this browser can decode the current way. */\n readonly formats: readonly VideoFormat[];\n readonly settings: PictureSettings;\n /** The state of the WebRTC connection while the picture comes as video. */\n readonly rtc: RTCPeerConnectionState | undefined;\n}\n\nexport interface Connection {\n readonly state: \"connecting\" | \"open\" | \"closed\";\n readonly reason?: string;\n}\n\nexport interface Snapshot {\n readonly connection: Connection;\n readonly targets: readonly Target[];\n /** The tab that is watched, by its number. */\n readonly selected: number | undefined;\n readonly presence: Presence | undefined;\n readonly downloads: readonly Download[];\n readonly fileRequests: readonly FileRequest[];\n /** A CSS cursor value. */\n readonly cursor: string;\n readonly picture: Picture;\n /** Nothing is granted until the session has told. */\n readonly features: Features;\n /** How the session's automation moves the pointer in a tab that is being recorded. */\n readonly pace: Pace;\n /**\n * The session is being given what its browser starts with, or was not: nothing where\n * it is what it was asked to be.\n */\n readonly restoring: Restoring | undefined;\n /** The numbers of the tabs that are muted here; the others are heard while watched. */\n readonly muted: readonly number[];\n /** The session's right-click report, at the client coordinates of the click. */\n readonly menu: (Menu & { readonly x: number; readonly y: number }) | undefined;\n /** The watched target's viewport follows the attached stage's size. */\n readonly fit: boolean;\n /**\n * This client is used from a phone: a finger points at it and its window is narrow. A\n * tab whose mode is `auto` is shown as on a phone once this client holds it.\n */\n readonly phone: boolean;\n}\n\nexport const FORMATS = {\n h264: pb.VideoFormat.H264,\n \"full-chroma\": pb.VideoFormat.FULL_CHROMA,\n h265: pb.VideoFormat.H265,\n vp9: pb.VideoFormat.VP9,\n \"vp9-full-chroma\": pb.VideoFormat.VP9_FULL_CHROMA,\n av1: pb.VideoFormat.AV1,\n} as const satisfies Record<VideoFormat, pb.VideoFormat>;\n\nexport const QUALITIES = {\n low: pb.VideoQuality.LOW,\n medium: pb.VideoQuality.MEDIUM,\n full: pb.VideoQuality.FULL,\n} as const satisfies Record<VideoQuality, pb.VideoQuality>;\n\nexport const PIXELS = {\n video: pb.Pixels.VIDEO,\n frames: pb.Pixels.FRAMES,\n tiles: pb.Pixels.TILES,\n} as const satisfies Record<PictureWay, pb.Pixels>;\n\nexport const ALONGS = {\n back: pb.Along.BACK,\n forward: pb.Along.FORWARD,\n reload: pb.Along.RELOAD,\n} as const satisfies Record<Along, pb.Along>;\n\nexport const LEASE_ACTIONS = {\n take: pb.LeaseAction.TAKE,\n release: pb.LeaseAction.RELEASE,\n allow: pb.LeaseAction.ALLOW,\n keep: pb.LeaseAction.KEEP,\n} as const satisfies Record<LeaseAction, pb.LeaseAction>;\n\nexport const PAGE_MODES = {\n auto: pb.PageMode.AUTO,\n desktop: pb.PageMode.DESKTOP,\n mobile: pb.PageMode.MOBILE,\n} as const satisfies Record<PageMode, pb.PageMode>;\n\nconst ROLES: Partial<Record<pb.Role, Role>> = {\n [pb.Role.VIEW]: \"view\",\n [pb.Role.CONTROL]: \"control\",\n [pb.Role.ADMIN]: \"admin\",\n};\n\nconst ASKED: Partial<Record<pb.Asked, NonNullable<Failure[\"asked\"]>>> = {\n [pb.Asked.GO]: \"go\",\n [pb.Asked.CLOSE]: \"close\",\n [pb.Asked.COPY_PICTURE]: \"copyPicture\",\n [pb.Asked.FILES_CHOSEN]: \"chooseFiles\",\n [pb.Asked.FOLLOW]: \"follow\",\n [pb.Asked.SET_MODE]: \"setMode\",\n};\n\nconst STROKE_PHASES: Partial<Record<pb.StrokePhase, StrokePhase>> = {\n [pb.StrokePhase.START]: \"start\",\n [pb.StrokePhase.MOVE]: \"move\",\n [pb.StrokePhase.END]: \"end\",\n};\n\nexport const STROKE_PHASE: Record<StrokePhase, pb.StrokePhase> = {\n start: pb.StrokePhase.START,\n move: pb.StrokePhase.MOVE,\n end: pb.StrokePhase.END,\n};\n\nexport const pointerOf = (pointer: pb.Pointer): PointerMark => ({\n member: Number(pointer.member),\n at: pointer.at === undefined ? undefined : { x: pointer.at.x, y: pointer.at.y },\n});\n\n/** None for a point of a phase this client does not know. */\nexport const strokeOf = (stroke: pb.Stroke): StrokePoint | undefined => {\n const phase = STROKE_PHASES[stroke.phase];\n return phase === undefined\n ? undefined\n : { member: Number(stroke.member), stroke: stroke.stroke, phase, x: stroke.x, y: stroke.y };\n};\n\nexport const failureOf = (failed: pb.Failed): Failure => ({\n asked: ASKED[failed.asked],\n reason: failed.reason,\n});\n\nconst DOWNLOAD_STATES: Partial<Record<pb.DownloadState, DownloadState>> = {\n [pb.DownloadState.RUNNING]: \"running\",\n [pb.DownloadState.DONE]: \"done\",\n [pb.DownloadState.FAILED]: \"failed\",\n};\n\nconst named = <Name extends string>(names: Record<Name, number>, value: number) => {\n const found = Object.entries<number>(names).find(([, one]) => one === value);\n return found?.[0] as Name | undefined;\n};\n\nexport const formatOf = (format: pb.VideoFormat) => named(FORMATS, format);\n\nexport const qualityOf = (quality: pb.VideoQuality) => named(QUALITIES, quality);\n\n// Ids are counters the session starts at one, far below where a double stops being exact.\nconst count = (id: bigint | undefined) => (id === undefined ? undefined : Number(id));\n\nexport const targetOf = (target: pb.Target): Target => ({\n id: target.id,\n tab: target.tab,\n title: target.title,\n url: target.url,\n width: target.width,\n height: target.height,\n scale: target.scale,\n mode: named(PAGE_MODES, target.mode) ?? \"auto\",\n mobile: target.mobile,\n sounds: target.sounds,\n goesBack: target.goesBack,\n goesForward: target.goesForward,\n});\n\nexport const presenceOf = (presence: pb.Presence): Presence => ({\n you: Number(presence.you),\n members: presence.members.map((member) => ({\n id: Number(member.id),\n name: member.name,\n role: ROLES[member.role],\n tab: member.tab,\n agent: member.agent,\n follows: count(member.follows),\n })),\n held: presence.held.map((held) => ({\n tab: held.tab,\n holder: Number(held.holder),\n askedBy: count(held.askedBy),\n })),\n});\n\nexport const downloadOf = (download: pb.Download): Download => ({\n id: download.id,\n name: download.name,\n url: download.url,\n receivedBytes: Number(download.receivedBytes),\n totalBytes: count(download.totalBytes),\n state: DOWNLOAD_STATES[download.state],\n});\n\nexport const fileRequestOf = (request: pb.FileRequest): FileRequest => ({\n id: Number(request.id),\n tab: request.tab,\n multiple: request.multiple,\n});\n\nexport const menuOf = (menu: pb.Menu): Menu => ({\n link: menu.link,\n image: menu.image,\n text: menu.text,\n editable: menu.editable,\n});\n\nexport const statusOf = (status: pb.VideoStatus): VideoStatus => ({\n format: formatOf(status.format),\n quality: qualityOf(status.quality),\n fps: status.fps,\n});\n","import {\n create,\n fromBinary,\n fromJsonString,\n type MessageInitShape,\n toBinary,\n} from \"@bufbuild/protobuf\";\nimport * as Effect from \"effect/Effect\";\nimport {\n ClientMessageSchema,\n type ServerMessage,\n ServerMessageSchema,\n} from \"./gen/aperture/live/v1/live_pb.ts\";\n\n/** A message to the session: one case of `ClientMessage`. */\nexport type Outgoing = Exclude<\n NonNullable<MessageInitShape<typeof ClientMessageSchema>[\"message\"]>,\n { case: undefined }\n>;\n\n/** A message from the session: one case of `ServerMessage`. */\nexport type Incoming = Exclude<ServerMessage[\"message\"], { case: undefined }>;\n\nexport const encode = (message: Outgoing) =>\n toBinary(ClientMessageSchema, create(ClientMessageSchema, { message }));\n\nexport interface Handlers {\n readonly opened: () => void;\n readonly message: (message: Incoming) => void;\n /** The socket closed without this client closing it. */\n readonly closed: (reason: string | undefined) => void;\n}\n\nexport interface Socket {\n readonly isOpen: () => boolean;\n /** Sends the message as protobuf, which the session then answers in; false when not open. */\n readonly send: (message: Outgoing) => boolean;\n}\n\nconst decode = (data: unknown) => {\n if (typeof data === \"string\") {\n return fromJsonString(ServerMessageSchema, data, { ignoreUnknownFields: true });\n }\n if (data instanceof ArrayBuffer) {\n return fromBinary(ServerMessageSchema, new Uint8Array(data));\n }\n return undefined;\n};\n\n/** Opens the session socket. Closing the scope closes it, and `closed` is not told then. */\nexport const open = Effect.fn(\"Socket.open\")(function* (url: string, handlers: Handlers) {\n const listening = new AbortController();\n const socket = yield* Effect.acquireRelease(\n Effect.sync(() => {\n const opened = new WebSocket(url);\n opened.binaryType = \"arraybuffer\";\n return opened;\n }),\n (opened) =>\n Effect.sync(() => {\n listening.abort();\n opened.close();\n }),\n );\n const { signal } = listening;\n\n socket.addEventListener(\"open\", () => handlers.opened(), { signal });\n socket.addEventListener(\n \"message\",\n (event) => {\n let decoded: ServerMessage | undefined;\n try {\n decoded = decode(event.data);\n } catch {\n // A message this client cannot read is one of a later protocol: the rest still is.\n return;\n }\n const message = decoded?.message;\n if (message !== undefined && message.case !== undefined) {\n handlers.message(message);\n }\n },\n { signal },\n );\n socket.addEventListener(\n \"close\",\n (event) => handlers.closed(event.reason === \"\" ? undefined : event.reason),\n { signal },\n );\n\n return {\n isOpen: () => socket.readyState === WebSocket.OPEN,\n send: (message) => {\n if (socket.readyState !== WebSocket.OPEN) {\n return false;\n }\n socket.send(encode(message));\n return true;\n },\n } satisfies Socket;\n});\n","import * as Effect from \"effect/Effect\";\n\n/** How far ahead of now sound starts that came too late for its turn, in seconds. */\nconst AHEAD = 0.06;\n/** Sound that would wait longer than this is left out: it stays with the picture. */\nconst WAIT_MOST = 0.4;\n\nexport interface Sound {\n /**\n * Turns the sound on or off. A browser plays none before a click or a key: sound that is\n * turned on earlier starts with the first of those.\n */\n readonly turn: (on: boolean) => void;\n /** The sound as a track of a WebRTC connection, or none when that connection ended. */\n readonly track: (track: MediaStreamTrack | undefined) => void;\n /** An Opus packet of the sound that comes on the session socket. */\n readonly hear: (timeUs: bigint, data: Uint8Array) => void;\n}\n\n/**\n * The session's sound. With a WebRTC connection it comes on a track of that; otherwise as\n * packets on the session socket, which are decoded and played one after the other.\n */\nexport const make = Effect.fn(\"Sound.make\")(function* () {\n const speaker = typeof Audio === \"undefined\" ? undefined : new Audio();\n if (speaker !== undefined) {\n speaker.autoplay = true;\n speaker.muted = true;\n }\n let on = false;\n let context: AudioContext | undefined;\n let decoder: AudioDecoder | undefined;\n let playAt = 0;\n\n const play = (ears: AudioContext, audio: AudioData) => {\n const buffer = ears.createBuffer(\n audio.numberOfChannels,\n audio.numberOfFrames,\n audio.sampleRate,\n );\n for (let channel = 0; channel < audio.numberOfChannels; channel++) {\n audio.copyTo(buffer.getChannelData(channel), { planeIndex: channel, format: \"f32-planar\" });\n }\n audio.close();\n const now = ears.currentTime;\n if (playAt < now) {\n playAt = now + AHEAD;\n }\n if (playAt > now + WAIT_MOST) {\n return;\n }\n const source = ears.createBufferSource();\n source.buffer = buffer;\n source.connect(ears.destination);\n source.start(playAt);\n playAt += buffer.duration;\n };\n\n const listen = () => {\n if (typeof AudioContext === \"undefined\" || typeof AudioDecoder === \"undefined\") {\n return undefined;\n }\n context ??= new AudioContext({ sampleRate: 48_000, latencyHint: \"interactive\" });\n const ears = context;\n if (decoder?.state !== \"configured\") {\n decoder = new AudioDecoder({\n output: (audio) => play(ears, audio),\n // A packet that does not decode is a gap in the sound; the next one is heard.\n error: () => {},\n });\n decoder.configure({ codec: \"opus\", sampleRate: 48_000, numberOfChannels: 2 });\n }\n return decoder;\n };\n\n const start = () => {\n if (!on) {\n return;\n }\n // Refused where there is nothing to play yet, and before a click.\n void speaker?.play().catch(() => {});\n void context?.resume().catch(() => {});\n };\n const gestures = new AbortController();\n if (typeof document !== \"undefined\") {\n for (const gesture of [\"pointerdown\", \"keydown\"]) {\n document.addEventListener(gesture, start, { capture: true, signal: gestures.signal });\n }\n }\n\n yield* Effect.addFinalizer(() =>\n Effect.sync(() => {\n on = false;\n gestures.abort();\n if (decoder !== undefined && decoder.state !== \"closed\") {\n decoder.close();\n }\n // Closing is refused only for a context that is closed already.\n void context?.close().catch(() => {});\n if (speaker !== undefined) {\n speaker.pause();\n speaker.srcObject = null;\n }\n }),\n );\n\n return {\n turn: (wanted) => {\n on = wanted;\n if (speaker !== undefined) {\n speaker.muted = !wanted;\n }\n start();\n },\n track: (track) => {\n if (speaker !== undefined) {\n // The sound plays apart from the picture, which would wait for it otherwise.\n speaker.srcObject = track === undefined ? null : new MediaStream([track]);\n }\n },\n hear: (timeUs, data) => {\n if (!on) {\n return;\n }\n const heard = listen();\n if (heard === undefined) {\n return;\n }\n try {\n heard.decode(new EncodedAudioChunk({ type: \"key\", timestamp: Number(timeUs), data }));\n } catch {\n // The decoder closed on a packet before this one; the next packet makes another.\n }\n },\n } satisfies Sound;\n});\n","type Canvas = HTMLCanvasElement | OffscreenCanvas;\n\ntype Drawable = Exclude<CanvasImageSource, SVGImageElement>;\n\nconst context = (canvas: Canvas) =>\n canvas instanceof HTMLCanvasElement ? canvas.getContext(\"2d\") : canvas.getContext(\"2d\");\n\n/**\n * Where frames and tiles are drawn: the canvas that is attached, and while none is, a\n * canvas of its own, so that a canvas attached later starts with the picture as it is.\n * Tiles only tell what changed.\n */\nexport interface Surface {\n readonly size: () => { width: number; height: number };\n readonly draw: (image: Drawable, x: number, y: number, width: number, height: number) => void;\n readonly attach: (canvas: HTMLCanvasElement) => void;\n readonly detach: () => void;\n}\n\nexport const makeSurface = (): Surface => {\n let canvas: Canvas | undefined;\n let attached = false;\n\n return {\n size: () => ({ width: canvas?.width ?? 0, height: canvas?.height ?? 0 }),\n draw: (image, x, y, width, height) => {\n if (canvas === undefined && typeof OffscreenCanvas !== \"undefined\") {\n canvas = new OffscreenCanvas(width, height);\n }\n const onto = canvas;\n if (onto === undefined) {\n return;\n }\n // Sizing a canvas clears it, also to the size it has.\n if (onto.width !== width || onto.height !== height) {\n onto.width = width;\n onto.height = height;\n }\n context(onto)?.drawImage(image, x, y);\n },\n attach: (element) => {\n const kept = canvas;\n // A canvas without pixels cannot be drawn from.\n if (kept !== undefined && kept !== element && kept.width > 0 && kept.height > 0) {\n element.width = kept.width;\n element.height = kept.height;\n context(element)?.drawImage(kept, 0, 0);\n }\n canvas = element;\n attached = true;\n },\n detach: () => {\n if (!attached) {\n return;\n }\n const shown = canvas;\n canvas = undefined;\n attached = false;\n const kept = typeof OffscreenCanvas !== \"undefined\";\n if (shown === undefined || !kept || shown.width === 0 || shown.height === 0) {\n return;\n }\n canvas = new OffscreenCanvas(shown.width, shown.height);\n context(canvas)?.drawImage(shown, 0, 0);\n },\n };\n};\n","import * as UrlPath from \"@aperture-browser/shared/url-path\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Equal from \"effect/Equal\";\nimport * as Exit from \"effect/Exit\";\nimport * as FiberSet from \"effect/FiberSet\";\nimport * as Layer from \"effect/Layer\";\nimport * as Queue from \"effect/Queue\";\nimport * as Result from \"effect/Result\";\nimport * as Scope from \"effect/Scope\";\nimport * as Stream from \"effect/Stream\";\nimport {\n type Address,\n faviconUrl,\n fileUrl,\n previewUrl,\n screenshotUrl,\n socketUrl,\n} from \"./address.ts\";\nimport * as Clipboard from \"./clipboard.ts\";\nimport { CODECS, decodable, waysHere } from \"./codecs.ts\";\nimport type { SessionError } from \"./errors.ts\";\nimport type { Tile, VideoFrame } from \"./gen/aperture/live/v1/live_pb.ts\";\nimport * as Http from \"./http.ts\";\nimport * as Input from \"./input.ts\";\nimport { KEY, makeKeyboard } from \"./keys.ts\";\nimport {\n ALONGS,\n type Along,\n type ClipboardEvent,\n type ClipboardForm,\n downloadOf,\n type Failure,\n failureOf,\n fileRequestOf,\n formatOf,\n FORMATS,\n LEASE_ACTIONS,\n type LeaseAction,\n PAGE_MODES,\n type PageMode,\n menuOf,\n type Picture,\n type PictureSettings,\n type PointerMark,\n pointerOf,\n STROKE_PHASE,\n type StrokePhase,\n type StrokePoint,\n strokeOf,\n type Target,\n type PictureWay,\n PIXELS,\n featuresOf,\n type Pace,\n paceOf,\n restoringOf,\n NO_FEATURES,\n presenceOf,\n QUALITIES,\n type Snapshot,\n statusOf,\n targetOf,\n type VideoFormat,\n} from \"./model.ts\";\nimport * as Socket from \"./socket.ts\";\nimport * as Sound from \"./sound.ts\";\nimport { makeSurface } from \"./surface.ts\";\n\nexport interface ConnectOptions extends Address {\n /** The way the picture is to come at first; the best this browser can do when left out. */\n readonly pixels?: PictureWay | undefined;\n}\n\n/** Where the watched target's page is taken. */\nexport type Destination = { readonly url: string } | { readonly along: Along };\n\nexport interface GoOptions {\n /** The page opens in a new tab rather than in the target's. */\n readonly newTab?: boolean | undefined;\n}\n\n/**\n * A change of how the picture comes. A key that is left out keeps what it has; one that\n * is there and undefined leaves the choice to the session again.\n */\nexport interface PictureChange extends PictureSettings {\n readonly way?: PictureWay;\n}\n\n/** The snapshot as a store, as `useSyncExternalStore` takes one. */\nexport interface SnapshotStore {\n /** Referentially stable until something changes. */\n readonly get: () => Snapshot;\n readonly subscribe: (listener: () => void) => () => void;\n}\n\nexport interface FitOptions {\n /**\n * Fit only once the tab is this member's to size: it holds the tab, or nobody holds it\n * and nobody else watches it. Without it the fitting is the member's own doing and takes\n * the tab as any input does.\n */\n readonly whenFree?: boolean;\n}\n\nexport interface SessionService {\n readonly store: SnapshotStore;\n readonly snapshot: Effect.Effect<Snapshot>;\n /** The snapshot as it is, then every snapshot after it. */\n readonly changes: Stream.Stream<Snapshot>;\n /** What is copied in the session, after this browser's clipboard was offered it. */\n readonly clipboard: Stream.Stream<ClipboardEvent>;\n readonly onClipboard: (listener: (event: ClipboardEvent) => void) => () => void;\n /** What this client asked for and the session did not do. */\n readonly failures: Stream.Stream<Failure>;\n readonly onFailure: (listener: (failure: Failure) => void) => () => void;\n /**\n * A finger moved the watched tab's page, by this much of the target's pixels each time:\n * down the page where `y` is more than nothing. It tells what the finger did, whether\n * or not the page had anywhere to go.\n */\n readonly onDragged: (\n listener: (by: { readonly x: number; readonly y: number }) => void,\n ) => () => void;\n /** Where the other members' pointers are on the watched tab, as they move. */\n readonly onPointer: (listener: (pointer: PointerMark) => void) => () => void;\n /** The strokes the other members draw over the watched tab, point by point. */\n readonly onStroke: (listener: (point: StrokePoint) => void) => () => void;\n /**\n * Follows a member to whichever tab it watches, until this client selects a tab itself;\n * nobody when left out.\n */\n readonly follow: (member?: number) => Effect.Effect<void>;\n /**\n * Shows the others a point of a stroke over the watched tab, in the tab's logical\n * pixels. The client numbers its strokes.\n */\n readonly draw: (\n stroke: number,\n phase: StrokePhase,\n at: { readonly x: number; readonly y: number },\n ) => Effect.Effect<void>;\n /**\n * Shows the others where this client's pointer is over the watched tab while it gives\n * the tab no input, as while it draws; nowhere when left out.\n */\n readonly point: (at?: { readonly x: number; readonly y: number }) => Effect.Effect<void>;\n\n readonly select: (tab: number) => Effect.Effect<void>;\n readonly go: (to: Destination, options?: GoOptions) => Effect.Effect<void>;\n readonly newTab: Effect.Effect<void>;\n readonly closeTab: (tab: number) => Effect.Effect<void>;\n /**\n * `fit` has the watched target's viewport follow the attached stage's size. With\n * `whenFree` the fitting waits its turn, see [`FitOptions`].\n */\n readonly setViewport: (\n viewport: Http.ViewportSize | \"fit\",\n options?: FitOptions,\n ) => Effect.Effect<void>;\n /** Gives the watched target another scale and leaves its size, fitted or not, as it is. */\n readonly setScale: (scale: number) => Effect.Effect<void>;\n /** Sets how the watched tab's pages are shown, for a member that holds the tab. */\n readonly setMode: (mode: PageMode) => Effect.Effect<void>;\n readonly setPicture: (change: PictureChange) => Effect.Effect<void>;\n /**\n * Mutes a tab for this client, or lets it be heard again. A tab is heard while it is\n * watched, once the browser lets a page play sound: after the first click or key.\n */\n readonly setMuted: (tab: number, muted: boolean) => Effect.Effect<void>;\n readonly lease: (action: LeaseAction) => Effect.Effect<void>;\n /**\n * Shows the picture in the surfaces and takes their input, until the scope closes. One\n * set of surfaces at a time.\n */\n readonly attach: (surfaces: Input.Surfaces) => Effect.Effect<void, never, Scope.Scope>;\n /** Gives the keyboard to the session, as a click on the picture does. */\n readonly focus: Effect.Effect<void>;\n readonly dismissMenu: Effect.Effect<void>;\n /** Asks for a picture the watched page shows; it comes as what the session copied. */\n readonly copyPicture: (url: string) => Effect.Effect<void>;\n /** Puts content on the session's clipboard, for a paste there to take. */\n readonly writeClipboard: (forms: readonly ClipboardForm[]) => Effect.Effect<void>;\n /**\n * Pastes into the session: the forms given, or what this browser's clipboard has where\n * a page may read it. False when there was nothing to paste.\n */\n readonly paste: (forms?: readonly ClipboardForm[]) => Effect.Effect<boolean>;\n /** Copies what is selected in the session; it comes as what the session copied. */\n readonly copySelection: Effect.Effect<void>;\n readonly selectAll: Effect.Effect<void>;\n /**\n * Puts content on this browser's clipboard from a click, for what the session copied\n * and the clipboard did not take by itself: text is copied, a picture opens to be\n * copied by hand.\n */\n readonly copyHere: (forms: readonly ClipboardForm[]) => Effect.Effect<boolean>;\n\n readonly upload: (\n file: File,\n onProgress?: (progress: Http.UploadProgress) => void,\n ) => Effect.Effect<Http.Uploaded, SessionError>;\n readonly uploads: Effect.Effect<Http.Uploaded[], SessionError>;\n readonly removeUpload: (name: string) => Effect.Effect<void, SessionError>;\n /** Answers a page's request for files with uploads, by name; with none it is dismissed. */\n readonly chooseFiles: (request: number, names: readonly string[]) => Effect.Effect<void>;\n /** An authenticated URL of one of the session's files, such as `downloads/<name>`. */\n readonly fileUrl: (path: string) => string;\n /** The target as it looks now; `width` asks for a smaller picture, that many pixels wide. */\n readonly screenshotUrl: (tab: number, width?: number) => string;\n /** The target as it looked a moment ago, small: for a list of the tabs. */\n readonly previewUrl: (tab: number) => string;\n /**\n * The icon of the target's page, which the session fetches as its browser does anything\n * else of the page: the page's site is told nothing of who watches. None for a page\n * that is not of the web.\n */\n readonly faviconUrl: (target: Target) => string | undefined;\n readonly recordings: {\n readonly list: Effect.Effect<Http.Recording[], SessionError>;\n readonly get: (id: string) => Effect.Effect<Http.Recording, SessionError>;\n readonly start: (options?: Http.StartRecording) => Effect.Effect<Http.Recording, SessionError>;\n /** Stops a recording; its edit is made with `options`. */\n readonly stop: (\n id: string,\n options?: Http.EditRecording,\n ) => Effect.Effect<Http.Recording, SessionError>;\n /** Makes the edit of a stopped recording again, with other options. */\n readonly edit: (\n id: string,\n options?: Http.EditRecording,\n ) => Effect.Effect<Http.Recording, SessionError>;\n /** Has a running recording go on with another tab. */\n readonly retarget: (id: string, tab: number) => Effect.Effect<Http.Recording, SessionError>;\n /** Adds an annotation to the recording named, or to the only one that runs. */\n readonly annotate: (\n annotation: Http.RecordingAnnotation,\n id?: string,\n ) => Effect.Effect<void, SessionError>;\n };\n /** The cookies and local storage of the session's browser, for whoever runs the session. */\n readonly storageState: {\n readonly export: (\n asked?: Http.StorageStateAsked,\n ) => Effect.Effect<Http.StorageState, SessionError>;\n readonly import: (state: Http.StorageState) => Effect.Effect<void, SessionError>;\n };\n /**\n * How the session's automation moves the pointer in what is recorded. The snapshot's\n * `pace` tells it as it is set, by anyone.\n */\n readonly pace: {\n readonly get: Effect.Effect<Pace, SessionError>;\n readonly set: (pace: Pace) => Effect.Effect<Pace, SessionError>;\n };\n readonly screenshots: {\n readonly list: Effect.Effect<Http.Screenshot[], SessionError>;\n /** Takes one of a target, the newest when none is named, and keeps it in the files. */\n readonly take: (tab?: number) => Effect.Effect<Http.Screenshot, SessionError>;\n };\n}\n\n/** A WebRTC connection that says nothing for this long is taken not to connect. */\nconst RTC_CONNECTS_WITHIN = \"8 seconds\";\n\n/**\n * What frames are asked for when the choice is left to this client: sharp color where\n * frames are decoded here. Over WebRTC the session picks what every browser takes.\n */\nconst BEST_FRAMES: readonly VideoFormat[] = [\"full-chroma\", \"h264\"];\n\n/** How long sound that was sent before a tab was to be heard keeps arriving. */\nconst SOUND_SETTLES_MS = 300;\n\nconst pixels = (side: number) => Math.max(0, Math.round(side));\n\n/** The widest the shorter side of a phone's window is, in CSS pixels. */\nconst PHONE_WITHIN = 600;\n/**\n * The most pixels a page shown as on a phone draws to one of its own, unless it is given\n * another scale: a phone's screen has three and more, and a picture of that many is three\n * times the video of one of two, which reads as well on a screen that small.\n */\nconst SHARPEST = 2;\n\n/**\n * Whether this is a phone: a finger is what points, and the window is narrow. A tablet\n * and a laptop with a touch screen are none.\n */\nconst onPhone = () =>\n typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(\"(pointer: coarse)\").matches &&\n Math.min(window.innerWidth, window.innerHeight) <= PHONE_WITHIN;\n\n/**\n * Connects to a session. Closing the scope unwires what is attached, ends the picture's\n * WebRTC connection and decoder, then the sound, then the session socket.\n */\nexport const make = Effect.fn(\"Session.make\")(function* (options: ConnectOptions) {\n const address: Address = { url: options.url, token: options.token, name: options.name };\n const ways = waysHere();\n\n let way = ways[Math.max(0, ways.indexOf(options.pixels ?? \"video\"))] ?? \"tiles\";\n let settings: PictureSettings = {};\n let closed = false;\n let sounds = false;\n let fitting = false;\n let attached: Input.Surfaces | undefined;\n let menuAt = { x: 0, y: 0 };\n\n let snapshot: Snapshot = {\n connection: { state: \"connecting\" },\n targets: [],\n selected: undefined,\n presence: undefined,\n downloads: [],\n fileRequests: [],\n cursor: \"default\",\n picture: { way, ways, status: undefined, formats: [], settings, rtc: undefined },\n features: NO_FEATURES,\n pace: \"fast\",\n restoring: undefined,\n muted: [],\n menu: undefined,\n fit: false,\n phone: onPhone(),\n };\n const listeners = new Set<() => void>();\n const clipboardListeners = new Set<(event: ClipboardEvent) => void>();\n\n // What the session tells again as it was leaves the snapshot the one it is.\n const update = (change: Partial<Snapshot>) => {\n const changed = Object.entries(change).filter(\n ([key, value]) => !Equal.equals(snapshot[key as keyof Snapshot], value),\n );\n if (changed.length === 0) {\n return;\n }\n snapshot = { ...snapshot, ...Object.fromEntries(changed) };\n for (const listener of listeners) {\n listener();\n }\n };\n const updatePicture = (change: Partial<Picture>) => {\n update({ picture: { ...snapshot.picture, ...change } });\n };\n const listening =\n <A>(listeners: Set<(value: A) => void>) =>\n (listener: (value: A) => void) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n };\n const subscribe = listening(listeners);\n const onClipboard = listening(clipboardListeners);\n const draggedListeners = new Set<(by: { readonly x: number; readonly y: number }) => void>();\n const onDragged = listening(draggedListeners);\n const failureListeners = new Set<(failure: Failure) => void>();\n const onFailure = listening(failureListeners);\n const pointerListeners = new Set<(pointer: PointerMark) => void>();\n const strokeListeners = new Set<(point: StrokePoint) => void>();\n const watched = () => snapshot.targets.find((target) => target.tab === snapshot.selected);\n\n const socket = yield* Socket.open(socketUrl(address), {\n opened: () => {\n update({ connection: { state: \"open\" } });\n socket.send({ case: \"device\", value: { phone: snapshot.phone } });\n runFork(start());\n },\n message: (message) => receive(message),\n closed: (reason) => {\n update({\n connection: reason === undefined ? { state: \"closed\" } : { state: \"closed\", reason },\n });\n // A picture that comes on a connection of its own would go on without the session.\n runFork(stop());\n },\n });\n const sound = yield* Sound.make();\n const surface = makeSurface();\n const scope = yield* Effect.scope;\n // Whatever brings the picture now lives below this, and ends before the sound does.\n const pictureScope = yield* Scope.fork(scope);\n const runFork = yield* FiberSet.makeRuntime<never, void, never>();\n\n interface Peer {\n readonly connection: RTCPeerConnection;\n /** Carries pointer motion apart from everything else. */\n readonly pointer: RTCDataChannel;\n }\n let peer: Peer | undefined;\n let stream: MediaStream | undefined;\n let decoder: VideoDecoder | undefined;\n let decodes: VideoFormat | undefined;\n let wayScope: Scope.Closeable | undefined;\n // Counts the times the picture was started, for what was awaited to tell it is stale.\n let turns = 0;\n\n const send = (message: Socket.Outgoing) => {\n const pointer = peer?.pointer;\n if (message.case === \"pointerMotion\" && pointer?.readyState === \"open\") {\n pointer.send(new Uint8Array(Socket.encode(message)));\n return;\n }\n socket.send(message);\n };\n\n const keyboard = makeKeyboard((code, pressed) => send({ case: \"key\", value: { code, pressed } }));\n\n /** Says how the picture is to come: again whenever something changes that. */\n const hello = Effect.fn(\"Session.hello\")(function* () {\n const asked = way;\n const decoded = yield* Effect.tryPromise(() => decodable(asked)).pipe(\n Effect.orElseSucceed((): VideoFormat[] => []),\n );\n if (closed || asked !== way) {\n return;\n }\n if (settings.format !== undefined && !decoded.includes(settings.format)) {\n const { format: _, ...kept } = settings;\n settings = kept;\n }\n updatePicture({ formats: decoded, settings });\n const best = asked === \"frames\" ? BEST_FRAMES.filter((format) => decoded.includes(format)) : [];\n const wanted = settings.format === undefined ? best : [settings.format];\n send({\n case: \"hello\",\n value: {\n pixels: PIXELS[asked],\n formats: wanted.map((format) => FORMATS[format]),\n quality: settings.quality === undefined ? undefined : QUALITIES[settings.quality],\n fps: settings.fps,\n // With a WebRTC connection the sound comes on a track of that.\n audio: sounds && asked !== \"video\",\n },\n });\n });\n\n const closeDecoder = () => {\n if (decoder !== undefined && decoder.state !== \"closed\") {\n decoder.close();\n }\n decoder = undefined;\n decodes = undefined;\n };\n\n /** What fails falls to the next way: video over WebRTC, the same video as frames, tiles. */\n const fall = (reason: string) => {\n const failed = way;\n const next = ways[ways.indexOf(failed) + 1];\n if (closed || next === undefined || !socket.isOpen()) {\n return;\n }\n way = next;\n runFork(Effect.logWarning(`${failed}: ${reason}`).pipe(Effect.andThen(start())));\n };\n\n const watchVideo = Effect.fn(\"Session.watchVideo\")(function* (\n turn: number,\n within: Scope.Closeable,\n ) {\n const connection = yield* Effect.acquireRelease(\n Effect.sync(() => new RTCPeerConnection()),\n (made) =>\n Effect.sync(() => {\n made.close();\n if (peer?.connection === made) {\n peer = undefined;\n }\n stream = undefined;\n sound.track(undefined);\n if (attached !== undefined) {\n attached.video.srcObject = null;\n }\n }),\n ).pipe(Scope.provide(within));\n connection.addTransceiver(\"video\", { direction: \"recvonly\" });\n connection.addTransceiver(\"audio\", { direction: \"recvonly\" });\n // A move that is lost is not worth waiting for: the next one says where the pointer is.\n const pointer = connection.createDataChannel(\"pointer\", { ordered: true, maxRetransmits: 0 });\n peer = { connection, pointer };\n\n connection.addEventListener(\"track\", (event) => {\n if (event.track.kind === \"audio\") {\n sound.track(event.track);\n return;\n }\n // Frames are shown as they come: one that waits to be smoothed is one seen late.\n const receiver: RTCRtpReceiver & { playoutDelayHint?: number } = event.receiver;\n receiver.jitterBufferTarget = 0;\n receiver.playoutDelayHint = 0;\n stream = new MediaStream([event.track]);\n if (attached !== undefined) {\n attached.video.srcObject = stream;\n }\n });\n connection.addEventListener(\"connectionstatechange\", () => {\n if (peer?.connection !== connection) {\n return;\n }\n updatePicture({ rtc: connection.connectionState });\n if (connection.connectionState === \"failed\") {\n fall(\"WebRTC failed\");\n }\n });\n\n const offer = yield* Effect.tryPromise(async () => {\n await connection.setLocalDescription(await connection.createOffer());\n return connection.localDescription?.sdp;\n }).pipe(Effect.result);\n if (closed || turn !== turns) {\n return;\n }\n if (Result.isFailure(offer) || offer.success === undefined) {\n const cause = Result.isFailure(offer) ? offer.failure.cause : undefined;\n fall(cause instanceof Error ? cause.message : \"WebRTC made no offer\");\n return;\n }\n send({ case: \"rtcOffer\", value: { sdp: offer.success } });\n\n // A network that drops its packets says nothing.\n const waiting = runFork(\n Effect.sleep(RTC_CONNECTS_WITHIN).pipe(\n Effect.andThen(\n Effect.sync(() => {\n if (turn === turns && connection.connectionState !== \"connected\") {\n fall(\"WebRTC did not connect\");\n }\n }),\n ),\n ),\n );\n yield* Scope.addFinalizer(\n within,\n Effect.sync(() => waiting.interruptUnsafe()),\n );\n });\n\n /** Ends however the picture comes. */\n const stop = Effect.fn(\"Session.stop\")(function* () {\n turns += 1;\n const before = wayScope;\n wayScope = undefined;\n if (before !== undefined) {\n yield* Scope.close(before, Exit.void);\n }\n });\n\n /** Starts the picture the way it is to come, in place of however it came before. */\n const start: () => Effect.Effect<void> = Effect.fn(\"Session.start\")(function* () {\n yield* stop();\n const turn = turns;\n if (closed) {\n return;\n }\n const within = yield* Scope.fork(pictureScope);\n wayScope = within;\n updatePicture({ way, status: undefined, rtc: undefined });\n yield* Scope.addFinalizer(within, Effect.sync(closeDecoder));\n yield* hello();\n if (closed || turn !== turns || way !== \"video\") {\n return;\n }\n yield* watchVideo(turn, within);\n });\n\n const answer = (sdp: string) => {\n const connection = peer?.connection;\n if (connection === undefined) {\n return;\n }\n connection.setRemoteDescription({ type: \"answer\", sdp }).catch((cause: unknown) => {\n if (peer?.connection === connection) {\n fall(cause instanceof Error ? cause.message : \"WebRTC took no answer\");\n }\n });\n };\n\n const shown = (timeUs: bigint) => send({ case: \"videoShown\", value: { timeUs } });\n\n const decodeFrame = (frame: VideoFrame) => {\n const format = formatOf(frame.format);\n const takes = frame.tab === snapshot.selected && way === \"frames\";\n // A frame let go is told too: the session counts on hearing of every frame.\n if (!takes || format === undefined || typeof VideoDecoder === \"undefined\") {\n shown(frame.timeUs);\n return;\n }\n if (decoder?.state !== \"configured\" || decodes !== format) {\n if (!frame.keyframe) {\n shown(frame.timeUs);\n return;\n }\n closeDecoder();\n const made = new VideoDecoder({\n output: (picture) => {\n surface.draw(picture, 0, 0, picture.displayWidth, picture.displayHeight);\n shown(BigInt(picture.timestamp));\n picture.close();\n },\n error: (error) => {\n if (decoder === made) {\n fall(error.message);\n }\n },\n });\n made.configure({ codec: CODECS[format], optimizeForLatency: true });\n decoder = made;\n decodes = format;\n }\n try {\n decoder.decode(\n new EncodedVideoChunk({\n type: frame.keyframe ? \"key\" : \"delta\",\n timestamp: Number(frame.timeUs),\n data: frame.data,\n }),\n );\n } catch (cause) {\n shown(frame.timeUs);\n fall(cause instanceof Error ? cause.message : \"a frame was not decoded\");\n }\n };\n\n // Tiles are drawn in the order they came: each is a part of the picture before it.\n const tiles = yield* Queue.unbounded<Tile>();\n const drawTile = Effect.fnUntraced(function* (tile: Tile) {\n const image = yield* Effect.tryPromise(() =>\n createImageBitmap(new Blob([new Uint8Array(tile.png)], { type: \"image/png\" })),\n ).pipe(\n Effect.catch((cause) =>\n // The part of the picture stays as it was until a tile covers it again.\n Effect.sync(() => console.warn(\"A tile of the session's picture was not decoded\", cause)),\n ),\n );\n if (image === undefined) {\n return;\n }\n if (tile.tab === snapshot.selected && way === \"tiles\") {\n surface.draw(image, tile.x, tile.y, tile.width, tile.height);\n }\n image.close();\n });\n runFork(Effect.forever(Queue.take(tiles).pipe(Effect.flatMap(drawTile))));\n\n /** What the session copied goes to the clipboard here, where the browser lets it. */\n const copied = (forms: readonly ClipboardForm[]) => {\n if (forms.length === 0) {\n return;\n }\n runFork(\n Effect.promise(() => Clipboard.write(forms)).pipe(\n Effect.andThen((written) =>\n Effect.sync(() => {\n for (const listener of clipboardListeners) {\n listener({ forms, written });\n }\n }),\n ),\n ),\n );\n };\n\n const receive = (message: Socket.Incoming) => {\n take(message);\n follow();\n tune();\n };\n\n let unmuting: ReturnType<typeof setTimeout> | undefined;\n\n /** Hears the watched tab unless it is muted here, and stops hearing as that changes. */\n const tune = () => {\n const target = watched();\n const on =\n snapshot.features.sound.read && target !== undefined && !snapshot.muted.includes(target.tab);\n if (on === sounds) {\n return;\n }\n sounds = on;\n clearTimeout(unmuting);\n if (on) {\n // What is on its way is still the sound of the tab watched before, or of this one\n // from before it was to be heard: it is let pass, unheard.\n unmuting = setTimeout(() => sound.turn(sounds), SOUND_SETTLES_MS);\n } else {\n sound.turn(false);\n }\n if (way !== \"video\" && socket.isOpen()) {\n runFork(hello());\n }\n };\n\n const take = (message: Socket.Incoming) => {\n switch (message.case) {\n case \"rtcAnswer\": {\n answer(message.value.sdp);\n break;\n }\n case \"rtcRefused\": {\n fall(message.value.reason);\n break;\n }\n case \"videoStatus\": {\n updatePicture({ status: statusOf(message.value) });\n break;\n }\n case \"failed\": {\n const failure = failureOf(message.value);\n for (const listener of failureListeners) {\n listener(failure);\n }\n break;\n }\n case \"pointer\": {\n const pointer = pointerOf(message.value);\n for (const listener of pointerListeners) {\n listener(pointer);\n }\n break;\n }\n case \"stroke\": {\n const point = strokeOf(message.value);\n if (point !== undefined) {\n for (const listener of strokeListeners) {\n listener(point);\n }\n }\n break;\n }\n case \"features\": {\n update({ features: featuresOf(message.value) });\n break;\n }\n case \"paced\": {\n update({ pace: paceOf(message.value.pace) });\n break;\n }\n case \"restoring\": {\n update({ restoring: restoringOf(message.value) });\n break;\n }\n case \"presence\": {\n update({ presence: presenceOf(message.value) });\n break;\n }\n case \"menu\": {\n update({ menu: { ...menuOf(message.value), ...menuAt } });\n break;\n }\n case \"clipboard\": {\n copied(message.value.forms.map(({ type, data }) => ({ type, data })));\n break;\n }\n case \"downloads\": {\n update({ downloads: message.value.downloads.map(downloadOf) });\n break;\n }\n case \"fileRequests\": {\n update({ fileRequests: message.value.requests.map(fileRequestOf) });\n break;\n }\n case \"tile\": {\n if (typeof createImageBitmap !== \"undefined\") {\n Queue.offerUnsafe(tiles, message.value);\n }\n break;\n }\n case \"audio\": {\n if (way !== \"video\") {\n sound.hear(message.value.timeUs, message.value.data);\n }\n break;\n }\n case \"videoFrame\": {\n decodeFrame(message.value);\n break;\n }\n case \"targets\": {\n update({ targets: message.value.targets.map(targetOf) });\n break;\n }\n case \"selected\": {\n update({ selected: message.value.tab });\n break;\n }\n case \"cursor\": {\n const { cursor } = message.value;\n const named = cursor.case === \"named\" && cursor.value !== \"\" ? cursor.value : \"default\";\n update({ cursor: cursor.case === \"hidden\" ? \"none\" : named });\n break;\n }\n }\n };\n\n /**\n * Whether the watched tab is this member's to size without being asked to: it holds the\n * tab, or nobody holds it and nobody else watches it. A tab has one size for everyone, so\n * a window that merely opens or changes its size does not take the tab from those at work\n * in it.\n */\n const free = () => {\n const target = watched();\n if (target === undefined) {\n return false;\n }\n const presence = snapshot.presence;\n if (presence === undefined) {\n return true;\n }\n const held = presence.held.find((one) => one.tab === target.tab);\n if (held !== undefined) {\n return held.holder === presence.you;\n }\n return !presence.members.some((one) => one.id !== presence.you && one.tab === target.tab);\n };\n\n /**\n * The target that was last fitted because it was this member's to size, and whether it\n * was shown as on a phone then: it is fitted another way once that changes.\n */\n let followed: string | undefined;\n\n /** Fits the watched target once it becomes this member's to size, and each one that does. */\n const follow = () => {\n const target = watched();\n const mine =\n fitting && target !== undefined && free() ? `${target.tab} ${target.mobile}` : undefined;\n if (mine === followed) {\n return;\n }\n followed = mine;\n if (mine !== undefined) {\n fit(false);\n }\n };\n\n /**\n * Gives the watched target the size of the stage, while the viewport is to fit it.\n * `unasked` is for what no one chose just now, such as the window changing its size.\n */\n const fit = (unasked: boolean) => {\n const target = watched();\n if (!fitting || attached === undefined || target === undefined) {\n return;\n }\n if (unasked && !free()) {\n return;\n }\n const { clientWidth, clientHeight } = attached.stage;\n if (clientWidth <= 0 || clientHeight <= 0) {\n return;\n }\n if (target.mobile) {\n // A phone's page has the size of a phone: of this one, where this is one, each of\n // its pixels as many of the screen's as the screen has, up to what is worth sending.\n if (snapshot.phone) {\n const scale = Math.min(Math.max(window.devicePixelRatio, 1), SHARPEST);\n send({ case: \"viewport\", value: { width: clientWidth, height: clientHeight, scale } });\n } else if (target.mode === \"auto\") {\n // A tab that goes by its holder is a desktop's once this member holds it, and is\n // fitted then. One that was set to be a phone's keeps the size it has.\n send({ case: \"lease\", value: { action: LEASE_ACTIONS.take } });\n }\n return;\n }\n // A stage narrower than a browser's window gets has a page of its shape, shown\n // smaller: one of the stage's height would leave bands above and below it.\n const widened = Math.max(1, NARROWEST / clientWidth);\n send({\n case: \"viewport\",\n value: {\n width: Math.round(clientWidth * widened),\n height: Math.round(clientHeight * widened),\n },\n });\n };\n\n const listed = async (files: readonly File[]) => {\n const put = await Promise.all(\n files.map((file) => Effect.runPromise(Http.upload(address, file))),\n );\n const uris = put.map((file) => {\n return `${UrlPath.make`file://${UrlPath.segments(file.path)}`}\\r\\n`;\n });\n return Clipboard.textForm(\"text/uri-list\", uris.join(\"\"));\n };\n\n const wiring: Input.Wiring = {\n send,\n keyboard,\n way: () => way,\n watched,\n listed,\n menuAt: (at) => {\n menuAt = at;\n },\n dismissMenu: () => update({ menu: undefined }),\n dragged: (by) => {\n for (const listener of draggedListeners) {\n listener(by);\n }\n },\n resized: () => fit(true),\n failed: (what, cause) => {\n runFork(Effect.logWarning(`${what} did not reach the session`, cause));\n },\n };\n\n const attach = Effect.fn(\"Session.attach\")(function* (surfaces: Input.Surfaces) {\n yield* Effect.acquireRelease(\n Effect.sync(() => {\n attached = surfaces;\n surface.attach(surfaces.canvas);\n // The sound plays apart from the picture, and a video with sound waits for a click.\n surfaces.video.muted = true;\n surfaces.video.autoplay = true;\n surfaces.video.playsInline = true;\n surfaces.video.srcObject = stream ?? null;\n }),\n () =>\n Effect.sync(() => {\n surfaces.video.srcObject = null;\n if (attached === surfaces) {\n attached = undefined;\n surface.detach();\n }\n }),\n );\n yield* Input.wire(surfaces, wiring);\n });\n\n const paste = Effect.fn(\"Session.paste\")(function* (given?: readonly ClipboardForm[]) {\n const forms =\n given ??\n (yield* Effect.tryPromise(() => Clipboard.read()).pipe(\n Effect.orElseSucceed((): ClipboardForm[] => []),\n ));\n if (forms.length === 0) {\n return false;\n }\n send({ case: \"clipboard\", value: { forms: [...forms] } });\n keyboard.chord(KEY.v);\n return true;\n });\n\n const setPicture = (change: PictureChange) => {\n const { way: asked, ...changed } = change;\n settings = { ...settings, ...changed };\n updatePicture({ settings });\n if (!socket.isOpen()) {\n // The picture starts with these once the socket opens.\n if (asked !== undefined && ways.includes(asked)) {\n way = asked;\n updatePicture({ way });\n }\n return;\n }\n if (asked !== undefined && asked !== way && ways.includes(asked)) {\n way = asked;\n runFork(start());\n return;\n }\n runFork(hello());\n };\n\n // What this client is used from changes as its window does: a phone turned on its side\n // is still one, a window made narrow under a mouse is none.\n if (typeof window !== \"undefined\" && typeof window.matchMedia === \"function\") {\n const coarse = window.matchMedia(\"(pointer: coarse)\");\n const looked = () => {\n const phone = onPhone();\n if (phone === snapshot.phone) {\n return;\n }\n update({ phone });\n socket.send({ case: \"device\", value: { phone } });\n followed = undefined;\n follow();\n };\n yield* Effect.acquireRelease(\n Effect.sync(() => {\n window.addEventListener(\"resize\", looked);\n coarse.addEventListener(\"change\", looked);\n }),\n () =>\n Effect.sync(() => {\n window.removeEventListener(\"resize\", looked);\n coarse.removeEventListener(\"change\", looked);\n }),\n );\n }\n\n // Registered last, so that it runs first: nothing that ends after it starts anything.\n yield* Effect.addFinalizer(() =>\n Effect.sync(() => {\n closed = true;\n clearTimeout(unmuting);\n // A socket that closed by itself has said why.\n if (snapshot.connection.state !== \"closed\") {\n update({ connection: { state: \"closed\" } });\n }\n update({ menu: undefined });\n }),\n );\n\n return {\n store: { get: () => snapshot, subscribe },\n snapshot: Effect.sync(() => snapshot),\n changes: Stream.callback<Snapshot>((queue) =>\n Effect.acquireRelease(\n Effect.sync(() => {\n Queue.offerUnsafe(queue, snapshot);\n return subscribe(() => Queue.offerUnsafe(queue, snapshot));\n }),\n (unsubscribe) => Effect.sync(unsubscribe),\n ),\n ),\n clipboard: Stream.callback<ClipboardEvent>((queue) =>\n Effect.acquireRelease(\n Effect.sync(() => onClipboard((event) => Queue.offerUnsafe(queue, event))),\n (unsubscribe) => Effect.sync(unsubscribe),\n ),\n ),\n onClipboard,\n failures: Stream.callback<Failure>((queue) =>\n Effect.acquireRelease(\n Effect.sync(() => onFailure((failure) => Queue.offerUnsafe(queue, failure))),\n (unsubscribe) => Effect.sync(unsubscribe),\n ),\n ),\n onFailure,\n onDragged,\n onPointer: listening(pointerListeners),\n onStroke: listening(strokeListeners),\n follow: (member) =>\n Effect.sync(() =>\n send({\n case: \"follow\",\n value: member === undefined ? {} : { member: BigInt(member) },\n }),\n ),\n draw: (stroke, phase, at) =>\n Effect.sync(() =>\n send({ case: \"draw\", value: { stroke, phase: STROKE_PHASE[phase], x: at.x, y: at.y } }),\n ),\n point: (at) =>\n Effect.sync(() => send({ case: \"pointing\", value: at === undefined ? {} : { at } })),\n\n select: (tab) => Effect.sync(() => send({ case: \"select\", value: { tab } })),\n go: (to, { newTab = false } = {}) =>\n Effect.sync(() => {\n const destination =\n \"url\" in to\n ? { case: \"url\" as const, value: to.url }\n : { case: \"along\" as const, value: ALONGS[to.along] };\n send({ case: \"go\", value: { to: destination, newTab } });\n }),\n newTab: Effect.sync(() =>\n send({ case: \"go\", value: { to: { case: \"url\", value: \"\" }, newTab: true } }),\n ),\n closeTab: (tab) => Effect.sync(() => send({ case: \"close\", value: { tab } })),\n setViewport: (viewport, options) =>\n Effect.sync(() => {\n fitting = viewport === \"fit\";\n update({ fit: fitting });\n if (viewport === \"fit\") {\n followed = undefined;\n if (options?.whenFree === true) {\n follow();\n } else {\n fit(false);\n }\n return;\n }\n const { width, height, scale } = viewport;\n send({ case: \"viewport\", value: { width: pixels(width), height: pixels(height), scale } });\n }),\n setScale: (scale) =>\n Effect.sync(() => {\n const target = watched();\n if (target !== undefined) {\n const { width, height } = target;\n send({ case: \"viewport\", value: { width, height, scale } });\n }\n }),\n setMode: (mode) =>\n Effect.sync(() => send({ case: \"setMode\", value: { mode: PAGE_MODES[mode] } })),\n setPicture: (change) => Effect.sync(() => setPicture(change)),\n setMuted: (tab, muted) =>\n Effect.sync(() => {\n const others = snapshot.muted.filter((one) => one !== tab);\n update({ muted: muted ? [...others, tab] : others });\n tune();\n }),\n lease: (action) =>\n Effect.sync(() => send({ case: \"lease\", value: { action: LEASE_ACTIONS[action] } })),\n attach,\n focus: Effect.sync(() => attached?.keys.focus({ preventScroll: true })),\n dismissMenu: Effect.sync(() => update({ menu: undefined })),\n copyPicture: (url) => Effect.sync(() => send({ case: \"copyPicture\", value: { url } })),\n writeClipboard: (forms) =>\n Effect.sync(() => send({ case: \"clipboard\", value: { forms: [...forms] } })),\n paste,\n copySelection: Effect.sync(() => keyboard.chord(KEY.c)),\n selectAll: Effect.sync(() => keyboard.chord(KEY.a)),\n copyHere: (forms) => Effect.promise(() => Clipboard.writeByHand(forms)),\n\n upload: (file, onProgress) => Http.upload(address, file, onProgress),\n uploads: Http.uploads(address),\n removeUpload: (name) => Http.removeUpload(address, name),\n chooseFiles: (request, names) =>\n Effect.sync(() =>\n send({ case: \"filesChosen\", value: { id: BigInt(request), files: [...names] } }),\n ),\n fileUrl: (path) => fileUrl(address, path),\n screenshotUrl: (tab, width) => screenshotUrl(address, tab, width),\n previewUrl: (tab) => previewUrl(address, tab),\n faviconUrl: (target) => {\n const site = /^https?:\\/\\/[^/?#]+/u.exec(target.url)?.[0];\n return site === undefined ? undefined : faviconUrl(address, target.tab, site);\n },\n recordings: {\n list: Http.listRecordings(address),\n get: (id) => Http.getRecording(address, id),\n start: (started) => Http.startRecording(address, started),\n stop: (id, options) => Http.stopRecording(address, id, options),\n edit: (id, options) => Http.editRecording(address, id, options),\n retarget: (id, tab) => Http.retargetRecording(address, id, tab),\n annotate: (annotation, id) => Http.annotateRecording(address, annotation, id),\n },\n storageState: {\n export: (asked) => Http.exportStorageState(address, asked),\n import: (state) => Http.importStorageState(address, state),\n },\n pace: {\n get: Http.getPace(address),\n set: (pace) => Http.setPace(address, pace),\n },\n screenshots: {\n list: Http.listScreenshots(address),\n take: (tab) => Http.takeScreenshot(address, tab),\n },\n } satisfies SessionService;\n});\n\n/** One session's client, for programs that pass it along as a service. */\nexport class Session extends Context.Service<Session, SessionService>()(\n \"@aperture-browser/session-client/Session\",\n) {}\n\n/** Connects to a session for as long as the layer lives. */\nexport const layer = (options: ConnectOptions) => Layer.effect(Session, make(options));\n/** The narrowest the session's browser makes a window: asked for less, it stays this wide. */\nconst NARROWEST = 500;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,MAAN,MAAU;CACR;CAEA,YAAY,MAAc;EACxB,KAAK,OAAO;CACd;AACF;AAEA,IAAM,WAAN,MAAe;CACb;CAEA,YAAY,MAAc;EACxB,K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