@shing.wong/sure-wasm-helper 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -2
- package/bin/sure-pack.mjs +8 -0
- package/dist/bench-cold.d.ts +29 -0
- package/dist/bench-cold.js +155 -0
- package/dist/loopback-host.d.ts +59 -0
- package/dist/loopback-host.js +320 -0
- package/dist/packager.d.ts +66 -0
- package/dist/packager.js +453 -0
- package/dist/updater.d.ts +109 -0
- package/dist/updater.js +389 -0
- package/dist/wasi-socket.d.ts +77 -0
- package/dist/wasi-socket.js +218 -0
- package/dist/wasm-loader.d.ts +76 -0
- package/dist/wasm-loader.js +271 -0
- package/package.json +78 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shing Wong / Project Sure
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,135 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sure-wasm-helper
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Generic, MIT-licensed runtime plumbing for applications that put their logic in
|
|
4
|
+
a WebAssembly reactor and their UI in a browser. The package contains **no
|
|
5
|
+
domain logic** — no protocols, accounts, message formats or product-specific
|
|
6
|
+
manners. It knows about bytes, ports, effects, browsers, single-file binaries
|
|
7
|
+
and self-updates.
|
|
8
|
+
|
|
9
|
+
## What is in the box
|
|
10
|
+
|
|
11
|
+
| Export | Purpose |
|
|
12
|
+
|--------|---------|
|
|
13
|
+
| `@shing.wong/sure-wasm-helper/wasm-loader` | `mountWasmCore()` — generic effect/feed reactor over ABI v1 (`sure_*`), plus a `CoreAbiAdapter` extension point for domain ABIs |
|
|
14
|
+
| `@shing.wong/sure-wasm-helper/loopback-host` | Static UI server with COOP/COEP + loopback WebSocket relay on a second port |
|
|
15
|
+
| `@shing.wong/sure-wasm-helper/wasi-socket` | Shell-out adapter for a WASI 0.2 `wasi-socket-server` component |
|
|
16
|
+
| `@shing.wong/sure-wasm-helper/updater` | Manifest check, verified download, executable swap and apply-update CLI |
|
|
17
|
+
| `@shing.wong/sure-wasm-helper/packager` | Build a Node SEA single-file binary with UI/core assets extracted to a cache |
|
|
18
|
+
| `@shing.wong/sure-wasm-helper/bench-cold` | Measure packaged-binary cold start against a budget |
|
|
19
|
+
|
|
20
|
+
Runtime dependency: `ws` only. Node `>=22`.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @shing.wong/sure-wasm-helper
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Minimal reactor
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { mountWasmCore } from "@shing.wong/sure-wasm-helper/wasm-loader";
|
|
32
|
+
|
|
33
|
+
const core = await mountWasmCore({
|
|
34
|
+
wasmBytes: await readFile("core.wasm"),
|
|
35
|
+
onEffect: async (effect) => {
|
|
36
|
+
if (effect.kind === "echo") return { synthetic: true, received: effect.data };
|
|
37
|
+
return { error: `unknown effect ${effect.kind}` };
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
await core.drive(); // drain effects, feed results, repeat
|
|
42
|
+
core.feed("external.event", { hello: "world" });
|
|
43
|
+
await core.drive(); // drive again after external input
|
|
44
|
+
core.close();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
A domain that already exports its own ABI can pass a `CoreAbiAdapter`
|
|
48
|
+
(`version`, `init`, `drain`, `feed`, optional `until`) instead of renaming its
|
|
49
|
+
exports; the handle still exposes the raw `instance`. See `docs/abi.md`.
|
|
50
|
+
|
|
51
|
+
## Loopback host
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { createLoopbackHost } from "@shing.wong/sure-wasm-helper/loopback-host";
|
|
55
|
+
|
|
56
|
+
const host = await createLoopbackHost({
|
|
57
|
+
appName: "example",
|
|
58
|
+
uiDir: "dist/ui",
|
|
59
|
+
port: 0,
|
|
60
|
+
relayPort: 0,
|
|
61
|
+
noOpen: true,
|
|
62
|
+
onHttp: async (req, res) => {
|
|
63
|
+
if (new URL(req.url ?? "/", "http://x").pathname !== "/__health") return false;
|
|
64
|
+
res.writeHead(200, { "content-type": "application/json" });
|
|
65
|
+
res.end(JSON.stringify({ ok: true }));
|
|
66
|
+
return true;
|
|
67
|
+
},
|
|
68
|
+
onWsMessage: ({ data, isBinary, send }) => {
|
|
69
|
+
send(isBinary ? data : { echo: data });
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
console.log(host.uiUrl, host.relayUrl);
|
|
74
|
+
await host.close();
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The UI server sends `cross-origin-opener-policy: same-origin` and
|
|
78
|
+
`cross-origin-embedder-policy: require-corp`, which is what cross-origin
|
|
79
|
+
isolated browser features (OPFS sync handles, `SharedArrayBuffer`) require.
|
|
80
|
+
|
|
81
|
+
## Packaging
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx sure-pack \
|
|
85
|
+
--app example \
|
|
86
|
+
--entry src/main.ts \
|
|
87
|
+
--ui-dir dist/ui \
|
|
88
|
+
--core core.wasm \
|
|
89
|
+
--out dist/example \
|
|
90
|
+
--no-args-args "serve --ui --ui-dir {uiDir}"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The produced binary is a Node SEA image. On first run it extracts `ui/*` and
|
|
94
|
+
`core/core.wasm` to a content-addressed cache (`~/.cache/<app>/ui-<hash>`,
|
|
95
|
+
`%LOCALAPPDATA%` on Windows, `XDG_CACHE_HOME` respected) and exposes
|
|
96
|
+
`SURE_APP_UI_DIR`, `SURE_APP_CORE_WASM` and `SURE_APP_BUILD` to the entry. The
|
|
97
|
+
names are configurable (`--env-ui`, `--env-core`, `--env-build`,
|
|
98
|
+
`--env-launch`); the launch-args variable defaults to `SURE_APP_LAUNCH_ARGS`.
|
|
99
|
+
|
|
100
|
+
## Self-update
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import { createSelfUpdater, runApplyUpdateCli } from "@shing.wong/sure-wasm-helper/updater";
|
|
104
|
+
|
|
105
|
+
const updater = createSelfUpdater({
|
|
106
|
+
appName: "example",
|
|
107
|
+
manifestUrl: "https://example.invalid/latest.json",
|
|
108
|
+
currentVersion: "0.1.0",
|
|
109
|
+
currentBuild: process.env.SURE_APP_BUILD ?? "",
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const update = await updater.check();
|
|
113
|
+
if (update.updateAvailable) await updater.download();
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`apply()` refuses to replace `node` itself when the process runs from a source
|
|
117
|
+
checkout. The swap is performed by the downloaded binary running
|
|
118
|
+
`apply-update <pid> <target> --relaunch ...`; see `docs/design.md` (ADR-004).
|
|
119
|
+
|
|
120
|
+
## Development
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npm install
|
|
124
|
+
npm run build:fixtures # regenerate fixtures/synthetic-core.wasm with wabt
|
|
125
|
+
npm run verify # build + node --test + verify:docs
|
|
126
|
+
git config core.hooksPath githooks
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The `githooks/pre-commit` hook runs the docs currency check and a fast test
|
|
130
|
+
subset. Documentation, ABI and error codes are part of the public contract:
|
|
131
|
+
read `AGENTS.md` before changing them.
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface ColdStartOptions {
|
|
2
|
+
binary: string;
|
|
3
|
+
args?: string[];
|
|
4
|
+
runs?: number;
|
|
5
|
+
budgetMs?: number;
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
httpPath?: string;
|
|
8
|
+
minBodyBytes?: number;
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
cwd?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ColdStartRun {
|
|
13
|
+
ms: number;
|
|
14
|
+
url: string;
|
|
15
|
+
bodyBytes: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ColdStartMeasurement {
|
|
18
|
+
runs: ColdStartRun[];
|
|
19
|
+
median: number;
|
|
20
|
+
budgetMs: number;
|
|
21
|
+
pass: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Measure all runs without asserting the budget. */
|
|
24
|
+
export declare function measureColdStart(options: ColdStartOptions): Promise<ColdStartMeasurement>;
|
|
25
|
+
/**
|
|
26
|
+
* Measure and print a table, then throw `E_COLD_START_BUDGET` when the median
|
|
27
|
+
* exceeds the budget. The budget is never adjusted silently.
|
|
28
|
+
*/
|
|
29
|
+
export declare function assertColdStart(options?: ColdStartOptions): Promise<ColdStartMeasurement>;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Cold-start bench: spawn a packaged binary, find its bound UI port from its
|
|
3
|
+
// output, and measure spawn -> first HTTP 200 with a non-trivial body.
|
|
4
|
+
import { spawn } from "node:child_process";
|
|
5
|
+
import { once } from "node:events";
|
|
6
|
+
import { performance } from "node:perf_hooks";
|
|
7
|
+
import { HelperError } from "./wasm-loader.js";
|
|
8
|
+
function sleep(ms) {
|
|
9
|
+
return new Promise((done) => setTimeout(done, ms));
|
|
10
|
+
}
|
|
11
|
+
function parsePort(output, args) {
|
|
12
|
+
const url = /https?:\/\/(?:127\.0\.0\.1|localhost|\[::1\]):(\d+)/i.exec(output);
|
|
13
|
+
if (url)
|
|
14
|
+
return Number(url[1]);
|
|
15
|
+
const labeled = /UI\s+on[^\n\r]*:(\d+)/i.exec(output);
|
|
16
|
+
if (labeled)
|
|
17
|
+
return Number(labeled[1]);
|
|
18
|
+
// A fixed port is a valid fallback; `--port 0` must be discovered in output.
|
|
19
|
+
const at = args.indexOf("--port");
|
|
20
|
+
if (at !== -1) {
|
|
21
|
+
const value = Number(args[at + 1]);
|
|
22
|
+
if (Number.isInteger(value) && value > 0)
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
async function stop(child) {
|
|
28
|
+
if (child.exitCode !== null || child.signalCode !== null)
|
|
29
|
+
return;
|
|
30
|
+
try {
|
|
31
|
+
child.kill("SIGTERM");
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const exited = once(child, "exit").then(() => true);
|
|
37
|
+
const forced = sleep(2000).then(() => false);
|
|
38
|
+
if (!(await Promise.race([exited, forced]))) {
|
|
39
|
+
try {
|
|
40
|
+
child.kill("SIGKILL");
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Already gone.
|
|
44
|
+
}
|
|
45
|
+
await Promise.race([once(child, "exit"), sleep(1000)]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function oneRun(options) {
|
|
49
|
+
const started = performance.now();
|
|
50
|
+
const child = spawn(options.binary, options.args, {
|
|
51
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
52
|
+
env: { ...process.env, ...(options.env ?? {}) },
|
|
53
|
+
cwd: options.cwd,
|
|
54
|
+
});
|
|
55
|
+
let output = "";
|
|
56
|
+
let port = null;
|
|
57
|
+
const watch = (chunk) => {
|
|
58
|
+
output += String(chunk);
|
|
59
|
+
if (port === null)
|
|
60
|
+
port = parsePort(output, options.args);
|
|
61
|
+
};
|
|
62
|
+
child.stdout?.setEncoding("utf8");
|
|
63
|
+
child.stderr?.setEncoding("utf8");
|
|
64
|
+
child.stdout?.on("data", watch);
|
|
65
|
+
child.stderr?.on("data", watch);
|
|
66
|
+
let exited = false;
|
|
67
|
+
child.once("exit", () => {
|
|
68
|
+
exited = true;
|
|
69
|
+
});
|
|
70
|
+
child.once("error", () => {
|
|
71
|
+
exited = true;
|
|
72
|
+
});
|
|
73
|
+
try {
|
|
74
|
+
const deadline = started + options.timeoutMs;
|
|
75
|
+
while (true) {
|
|
76
|
+
if (port !== null) {
|
|
77
|
+
const url = `http://127.0.0.1:${port}/`;
|
|
78
|
+
const target = new URL(options.httpPath, url).toString();
|
|
79
|
+
try {
|
|
80
|
+
const response = await fetch(target, { signal: AbortSignal.timeout(1000) });
|
|
81
|
+
if (response.ok) {
|
|
82
|
+
const body = Buffer.from(await response.arrayBuffer());
|
|
83
|
+
if (body.length > options.minBodyBytes) {
|
|
84
|
+
const ms = performance.now() - started;
|
|
85
|
+
return { ms, url, bodyBytes: body.length };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// Not listening yet, or the request raced startup; keep polling.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (performance.now() > deadline) {
|
|
94
|
+
throw new HelperError("E_COLD_START_TIMEOUT", `no HTTP 200 with more than ${options.minBodyBytes} bytes within ${options.timeoutMs}ms. Output:\n${output}`);
|
|
95
|
+
}
|
|
96
|
+
if (exited && port === null) {
|
|
97
|
+
throw new HelperError("E_COLD_START_PARSE", `binary exited before publishing a UI URL/port. Output:\n${output}`);
|
|
98
|
+
}
|
|
99
|
+
await sleep(10);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
await stop(child);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/** Measure all runs without asserting the budget. */
|
|
107
|
+
export async function measureColdStart(options) {
|
|
108
|
+
const resolved = {
|
|
109
|
+
binary: options.binary,
|
|
110
|
+
args: options.args ?? ["--no-open", "--port", "0"],
|
|
111
|
+
runs: options.runs ?? 5,
|
|
112
|
+
budgetMs: options.budgetMs ?? 350,
|
|
113
|
+
timeoutMs: options.timeoutMs ?? 15000,
|
|
114
|
+
httpPath: options.httpPath ?? "/",
|
|
115
|
+
minBodyBytes: options.minBodyBytes ?? 1024,
|
|
116
|
+
env: options.env,
|
|
117
|
+
cwd: options.cwd,
|
|
118
|
+
};
|
|
119
|
+
if (!Number.isInteger(resolved.runs) || resolved.runs < 1) {
|
|
120
|
+
throw new TypeError("runs must be a positive integer");
|
|
121
|
+
}
|
|
122
|
+
const results = [];
|
|
123
|
+
for (let index = 0; index < resolved.runs; index += 1) {
|
|
124
|
+
results.push(await oneRun(resolved));
|
|
125
|
+
}
|
|
126
|
+
const sorted = results.map((run) => run.ms).sort((left, right) => left - right);
|
|
127
|
+
const middle = Math.floor(sorted.length / 2);
|
|
128
|
+
const median = sorted.length % 2 === 1 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2;
|
|
129
|
+
return {
|
|
130
|
+
runs: results,
|
|
131
|
+
median,
|
|
132
|
+
budgetMs: resolved.budgetMs,
|
|
133
|
+
pass: median <= resolved.budgetMs,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Measure and print a table, then throw `E_COLD_START_BUDGET` when the median
|
|
138
|
+
* exceeds the budget. The budget is never adjusted silently.
|
|
139
|
+
*/
|
|
140
|
+
export async function assertColdStart(options = { binary: "" }) {
|
|
141
|
+
if (!options.binary)
|
|
142
|
+
throw new TypeError("assertColdStart needs a binary path");
|
|
143
|
+
const result = await measureColdStart(options);
|
|
144
|
+
console.log("cold start");
|
|
145
|
+
console.log(" run | ms");
|
|
146
|
+
console.log(" ----+--------");
|
|
147
|
+
for (let index = 0; index < result.runs.length; index += 1) {
|
|
148
|
+
console.log(` ${String(index + 1).padStart(3)} | ${result.runs[index].ms.toFixed(1)}`);
|
|
149
|
+
}
|
|
150
|
+
console.log(` median ${result.median.toFixed(1)} ms · budget ${result.budgetMs} ms · ${result.pass ? "PASS" : "FAIL"}`);
|
|
151
|
+
if (!result.pass) {
|
|
152
|
+
throw new HelperError("E_COLD_START_BUDGET", `median cold start ${result.median.toFixed(1)}ms exceeds budget ${result.budgetMs}ms`);
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
|
+
export interface LoopbackHostOptions {
|
|
3
|
+
/** Used in logs and in the browser-open failure message. */
|
|
4
|
+
appName: string;
|
|
5
|
+
/** Directory served as the UI. Missing is a warning, not a failure. */
|
|
6
|
+
uiDir: string;
|
|
7
|
+
/** UI port when `port` is not supplied. */
|
|
8
|
+
defaultUiPort?: number;
|
|
9
|
+
/** Relay port when `relayPort` is not supplied. */
|
|
10
|
+
defaultRelayPort?: number;
|
|
11
|
+
/** Bind address. Defaults to loopback; overriding it exposes the host. */
|
|
12
|
+
host?: string;
|
|
13
|
+
port?: number;
|
|
14
|
+
relayPort?: number;
|
|
15
|
+
noOpen?: boolean;
|
|
16
|
+
/** Return true when the request is fully handled. */
|
|
17
|
+
onHttp?: (req: IncomingMessage, res: ServerResponse) => boolean | void | Promise<boolean | void>;
|
|
18
|
+
/** Accept with `{ context }`, or reject with `{ reject: true, ... }` or false. */
|
|
19
|
+
onWsUpgrade?: (req: IncomingMessage) => {
|
|
20
|
+
context?: unknown;
|
|
21
|
+
} | {
|
|
22
|
+
reject: true;
|
|
23
|
+
status?: number;
|
|
24
|
+
reason?: string;
|
|
25
|
+
} | boolean | void | Promise<unknown>;
|
|
26
|
+
onWsMessage?: (info: WsMessageInfo) => void | Promise<void>;
|
|
27
|
+
maxFrameBytes?: number;
|
|
28
|
+
openBrowser?: boolean;
|
|
29
|
+
log?: (message: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface WsMessageInfo {
|
|
32
|
+
/** Parsed JSON for text frames (string when not JSON); Buffer for binary. */
|
|
33
|
+
data: unknown;
|
|
34
|
+
isBinary: boolean;
|
|
35
|
+
/** Whatever onWsUpgrade returned in `{ context }`. */
|
|
36
|
+
context: unknown;
|
|
37
|
+
req: IncomingMessage;
|
|
38
|
+
/** Buffer/Uint8Array/ArrayBuffer -> binary frame; string -> text; else JSON. */
|
|
39
|
+
send: (payload: unknown) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface LoopbackHostHandle {
|
|
42
|
+
uiPort: number;
|
|
43
|
+
relayPort: number;
|
|
44
|
+
uiUrl: string;
|
|
45
|
+
relayUrl: string;
|
|
46
|
+
close(): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Start the UI and relay servers. Resolves only after both are listening.
|
|
50
|
+
*
|
|
51
|
+
* Binding is loopback by default. If `host` is overridden to a non-loopback
|
|
52
|
+
* address, the caller must add authentication and firewall policy; this helper
|
|
53
|
+
* has none.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createLoopbackHost(options: LoopbackHostOptions): Promise<LoopbackHostHandle>;
|
|
56
|
+
/** Exported for tests and for callers that want the same media-type table. */
|
|
57
|
+
export declare const LOOPBACK_MEDIA_TYPES: Record<string, string>;
|
|
58
|
+
/** Exported for tests: the directory a resolved UI path must stay under. */
|
|
59
|
+
export declare function resolveUiFile(uiDir: string, pathname: string): string | null;
|