@brett_lamy/ui 5.10.1 → 5.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/components/avatar.d.ts +4 -1
  2. package/dist/components/avatar.d.ts.map +1 -1
  3. package/dist/components/avatar.js +55 -47
  4. package/dist/components/canvas.d.ts +18 -0
  5. package/dist/components/canvas.d.ts.map +1 -1
  6. package/dist/components/canvas.js +79 -11
  7. package/dist/components/command-menu.js +1 -1
  8. package/dist/components/floating-chat.d.ts +1 -1
  9. package/dist/components/floating-sheet.d.ts +1 -1
  10. package/dist/components/hover-card.d.ts +69 -0
  11. package/dist/components/hover-card.d.ts.map +1 -0
  12. package/dist/components/hover-card.js +164 -0
  13. package/dist/components/list.d.ts +3 -0
  14. package/dist/components/list.d.ts.map +1 -1
  15. package/dist/components/list.js +265 -250
  16. package/dist/components/markdown-view.d.ts +3 -1
  17. package/dist/components/markdown-view.d.ts.map +1 -1
  18. package/dist/components/markdown-view.js +12 -11
  19. package/dist/components/open-code.d.ts +31 -0
  20. package/dist/components/open-code.d.ts.map +1 -0
  21. package/dist/components/open-code.js +253 -0
  22. package/dist/components/replay-preview.d.ts +2 -2
  23. package/dist/components/replay-preview.d.ts.map +1 -1
  24. package/dist/components/replay-preview.js +3 -3
  25. package/dist/components/sql-console.js +1 -1
  26. package/dist/components/tree.d.ts +4 -1
  27. package/dist/components/tree.d.ts.map +1 -1
  28. package/dist/components/tree.js +229 -202
  29. package/dist/components/tui-preview.d.ts +3 -0
  30. package/dist/components/tui-preview.d.ts.map +1 -0
  31. package/dist/components/tui-preview.js +3 -0
  32. package/dist/components/workspace.d.ts +11 -0
  33. package/dist/components/workspace.d.ts.map +1 -0
  34. package/dist/components/workspace.js +74 -0
  35. package/dist/index.css +1 -1
  36. package/dist/index.d.ts +17 -4
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +163 -156
  39. package/dist/lib/canvas-math.d.ts +1 -1
  40. package/dist/lib/canvas-math.d.ts.map +1 -1
  41. package/dist/lib/canvas-math.js +1 -1
  42. package/dist/lib/open-code-browser-agent.d.ts +7 -0
  43. package/dist/lib/open-code-browser-agent.d.ts.map +1 -0
  44. package/dist/lib/open-code-browser-agent.js +161 -0
  45. package/dist/lib/open-code-browser.d.ts +17 -0
  46. package/dist/lib/open-code-browser.d.ts.map +1 -0
  47. package/dist/lib/open-code-browser.js +252 -0
  48. package/dist/lib/open-code-host.d.ts +182 -0
  49. package/dist/lib/open-code-host.d.ts.map +1 -0
  50. package/dist/lib/open-code-host.js +118 -0
  51. package/dist/lib/open-code-keychain.d.ts +11 -0
  52. package/dist/lib/open-code-keychain.d.ts.map +1 -0
  53. package/dist/lib/open-code-keychain.js +19 -0
  54. package/dist/lib/open-code-preview.d.ts +16 -0
  55. package/dist/lib/open-code-preview.d.ts.map +1 -0
  56. package/dist/lib/open-code-preview.js +112 -0
  57. package/dist/lib/tailscale-policy.d.ts +9 -0
  58. package/dist/lib/tailscale-policy.d.ts.map +1 -1
  59. package/dist/lib/tailscale-policy.js +25 -19
  60. package/dist/lib/tailscale-router/bridge.d.ts +7 -2
  61. package/dist/lib/tailscale-router/bridge.d.ts.map +1 -1
  62. package/dist/lib/tailscale-router/bridge.js +64 -57
  63. package/dist/lib/theme.d.ts.map +1 -1
  64. package/dist/lib/theme.js +8 -5
  65. package/dist/opencode.d.ts +7 -0
  66. package/dist/opencode.d.ts.map +1 -0
  67. package/dist/opencode.js +6 -0
  68. package/dist/tailscale-sw.js +236 -12
  69. package/package.json +21 -3
@@ -0,0 +1,118 @@
1
+ //#region src/lib/open-code-host.ts
2
+ function e(e, t = {}) {
3
+ let n = e.vfs, r = (t.directory ?? `/workspaces/${e.id}`).replace(/\/+$/, "");
4
+ if (!r.startsWith("/") || r.split("/").some((e) => e === ".." || e === ".")) throw Error("OpenCode needs an absolute workspace directory below /.");
5
+ n.mkdirSync(r, { recursive: !0 });
6
+ let i = (e) => {
7
+ let t = [];
8
+ for (let n of e.split("/")) n === ".." ? t.pop() : n && n !== "." && t.push(n);
9
+ let n = "/" + t.join("/");
10
+ if (n !== r && !n.startsWith(r + "/")) throw Error("OpenCode path is outside its workspace: " + e);
11
+ return n;
12
+ }, a = (e = r) => n.readdirSync(i(e)).flatMap((t) => {
13
+ let r = `${e}/${t}`;
14
+ return n.statSync(r).isDirectory() ? a(r) : [r];
15
+ }), o = (e, t = !1) => {
16
+ let r = i(e);
17
+ if (n.statSync(r).isDirectory()) {
18
+ if (t) for (let e of n.readdirSync(r)) o(`${r}/${e}`, !0);
19
+ n.rmdirSync(r);
20
+ } else n.unlinkSync(r);
21
+ }, s = (e) => `'${e.replaceAll("'", "'\\''")}'`, c = /* @__PURE__ */ new Set(), l = () => {
22
+ for (let e of c) e();
23
+ }, u, d = "", f = () => e.serverBridge.getServerPorts().flatMap((t) => {
24
+ let n = e.serverBridge.getServerMetadata(t);
25
+ return n?.ownerId !== e.id || n.purpose === "auxiliary" ? [] : [{
26
+ port: t,
27
+ url: e.serverBridge.getServerUrl(t) + "/",
28
+ name: n.name
29
+ }];
30
+ }), p = () => {
31
+ u !== void 0 && clearInterval(u), u = void 0, e.serverBridge.off("server-ready", l);
32
+ }, m = !1;
33
+ return {
34
+ id: e.id,
35
+ directory: r,
36
+ workspaceBridge: {
37
+ exists: (e) => n.existsSync(i(e)),
38
+ mkdir: (e) => n.mkdirSync(i(e), { recursive: !0 }),
39
+ readFile: (e) => n.existsSync(i(e)) ? n.readFileSync(i(e), "utf8") : void 0,
40
+ writeFile: (e, t) => n.writeFileSync(i(e), t),
41
+ stat: (e) => n.existsSync(i(e)) ? n.statSync(i(e)) : void 0,
42
+ readdir: (e) => n.readdirSync(i(e)).map((t) => {
43
+ let r = n.statSync(`${e}/${t}`);
44
+ return {
45
+ name: t,
46
+ isDirectory: () => r.isDirectory(),
47
+ isFile: () => r.isFile()
48
+ };
49
+ }),
50
+ listFiles: a,
51
+ remove: (e, t) => o(e, t?.recursive),
52
+ rename: (e, t) => n.renameSync(i(e), i(t))
53
+ },
54
+ processBridge: { async exec(t) {
55
+ if (m) throw Error("OpenCode host has been disposed.");
56
+ if (t.stdin) throw Error("This container adapter does not support piped stdin. Use a shell pipe or supply a custom processBridge.");
57
+ let n = /(?:^|\/)(?:ba|z|da)?sh$/.test(t.command) && t.args[0] === "-c" ? t.args[1] : t.shell ? [t.command, ...t.args.map(s)].join(" ") : [t.command, ...t.args].map(s).join(" "), a = await e.run(n ?? "", {
58
+ cwd: i(t.cwd ?? r),
59
+ env: t.env,
60
+ signal: t.signal
61
+ });
62
+ return {
63
+ stdout: a.stdout,
64
+ stderr: a.stderr,
65
+ code: a.exitCode
66
+ };
67
+ } },
68
+ previews: {
69
+ ready: () => t.serviceWorkerUrl ? e.serverBridge.ensureServiceWorkerReady({
70
+ swUrl: t.serviceWorkerUrl,
71
+ reloadOnFirstControl: !1
72
+ }) : Promise.resolve(),
73
+ async fetch(t, n) {
74
+ if (!f().some((e) => e.port === t)) return new Response("This app port is closed.", { status: 503 });
75
+ let r = new URL(n.url), i = await e.serverBridge.handleRequest(t, n.method, r.pathname + r.search, Object.fromEntries(n.headers), n.method === "GET" || n.method === "HEAD" ? void 0 : await n.arrayBuffer()), a = new Headers(i.headers);
76
+ return a.delete("set-cookie"), new Response(n.method === "HEAD" || [
77
+ 204,
78
+ 205,
79
+ 304
80
+ ].includes(i.statusCode) ? null : new Uint8Array(i.body), {
81
+ status: i.statusCode,
82
+ statusText: i.statusMessage,
83
+ headers: a
84
+ });
85
+ },
86
+ list: f,
87
+ subscribe(t) {
88
+ return c.add(t), c.size === 1 && (d = JSON.stringify(f()), e.serverBridge.on("server-ready", l), u = setInterval(() => {
89
+ let e = JSON.stringify(f());
90
+ e !== d && (d = e, l());
91
+ }, 500)), () => {
92
+ c.delete(t), c.size || p();
93
+ };
94
+ },
95
+ setTarget: (t, n) => e.setHMRTargetForPort?.(t, n)
96
+ },
97
+ dispose() {
98
+ m || (m = !0, p(), c.clear(), t.disposeContainer && e.dispose());
99
+ }
100
+ };
101
+ }
102
+ var t = e, n = "https://blamy.github.io/opencode/runtime.js";
103
+ async function r(e = n) {
104
+ let t = await import(
105
+ /* @vite-ignore */
106
+ e
107
+ );
108
+ if (typeof t.mount != "function") throw Error("The OpenCode runtime must export mount().");
109
+ return t;
110
+ }
111
+ function i(e, t) {
112
+ if (!Number.isInteger(e.port) || e.port < 1 || e.port > 65535) throw Error("Invalid OpenCode preview port.");
113
+ let n = new URL(t), r = new URL(e.url, n);
114
+ if (r.origin !== n.origin || !r.pathname.endsWith(`/__virtual__/${e.port}/`) || r.search || r.hash) throw Error("OpenCode previews must use the host service worker on this origin.");
115
+ return r.href;
116
+ }
117
+ //#endregion
118
+ export { n as DEFAULT_OPENCODE_RUNTIME_URL, t as createAgentWasmOpenCodeHost, e as createAlmostNodeOpenCodeHost, r as loadOpenCodeRuntime, i as openCodePreviewUrl };
@@ -0,0 +1,11 @@
1
+ import { OpenCodeKeychainStore } from './open-code-host';
2
+ import { Vault } from './vault';
3
+ export declare const OPENCODE_CREDENTIAL_SLOT = "opencode-provider-credentials";
4
+ export declare const OPENCODE_CONNECTION_SLOT = "opencode-connection";
5
+ type Keychain = Pick<Vault, 'status' | 'get' | 'put' | 'subscribe'>;
6
+ /** Reuses the Passwords passkey-PRF/AES-GCM vault. Never prompts, enrolls or falls back to plaintext storage. */
7
+ export declare function createVaultOpenCodeCredentialStore(vault: Keychain): OpenCodeKeychainStore;
8
+ /** Saves the runtime's connection choice, Tailscale node keys and exit node in a separate encrypted slot. */
9
+ export declare function createVaultOpenCodeConnectionStore(vault: Keychain): OpenCodeKeychainStore;
10
+ export {};
11
+ //# sourceMappingURL=open-code-keychain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-code-keychain.d.ts","sourceRoot":"","sources":["../../src/lib/open-code-keychain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AACxE,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D,KAAK,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,WAAW,CAAC,CAAC;AAEpE,iHAAiH;AACjH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,QAAQ,GACd,qBAAqB,CAEvB;AAED,6GAA6G;AAC7G,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,QAAQ,GACd,qBAAqB,CAEvB"}
@@ -0,0 +1,19 @@
1
+ //#region src/lib/open-code-keychain.ts
2
+ var e = "opencode-provider-credentials", t = "opencode-connection";
3
+ function n(t) {
4
+ return i(t, e, []);
5
+ }
6
+ function r(e) {
7
+ return i(e, t, null);
8
+ }
9
+ function i(e, t, n) {
10
+ return {
11
+ version: 1,
12
+ unlocked: () => e.status === "unlocked",
13
+ load: async () => await e.get(t) ?? n,
14
+ save: (n) => e.put(t, n),
15
+ subscribe: (t) => e.subscribe(t)
16
+ };
17
+ }
18
+ //#endregion
19
+ export { t as OPENCODE_CONNECTION_SLOT, e as OPENCODE_CREDENTIAL_SLOT, r as createVaultOpenCodeConnectionStore, n as createVaultOpenCodeCredentialStore };
@@ -0,0 +1,16 @@
1
+ import { OpenCodeHostBridge } from './open-code-host';
2
+ import { OpenCodeBrowser } from './open-code-browser';
3
+ export declare const DEFAULT_OPENCODE_PREVIEW_URL = "https://bl-cors-proxy.brett-lamy.workers.dev/opencode-preview/";
4
+ export declare function openCodePreviewFrameUrl(base: string, session: string, port: number, hostUrl: string, path?: string): string;
5
+ /** Connect the unchanged AlmostNode worker protocol directly to this container. No app payload goes to Cloudflare. */
6
+ export declare function connectOpenCodePreview(options: {
7
+ frame: HTMLIFrameElement;
8
+ host: OpenCodeHostBridge;
9
+ session: string;
10
+ port: number;
11
+ url: string;
12
+ onError(message: string): void;
13
+ browser?: OpenCodeBrowser;
14
+ onNavigate?(path: string): void;
15
+ }): () => void;
16
+ //# sourceMappingURL=open-code-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-code-preview.d.ts","sourceRoot":"","sources":["../../src/lib/open-code-preview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,eAAO,MAAM,4BAA4B,mEACyB,CAAC;AAEnE,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,IAAI,SAAM,GACT,MAAM,CAcR;AASD,sHAAsH;AACtH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAC9C,KAAK,EAAE,iBAAiB,CAAC;IACzB,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,UAAU,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,GAAG,MAAM,IAAI,CAyJb"}
@@ -0,0 +1,112 @@
1
+ import { injectOpenCodeBrowserAgent as e } from "./open-code-browser-agent.js";
2
+ //#region src/lib/open-code-preview.ts
3
+ var t = "https://bl-cors-proxy.brett-lamy.workers.dev/opencode-preview/";
4
+ function n(e, t, n, r, i = "/") {
5
+ let a = new URL(e, r);
6
+ if (a.origin === new URL(r).origin) throw Error("OpenCode app previews need a separate origin from the host page.");
7
+ if (!/^https?:$/.test(a.protocol) || !/^[a-f\d-]{36}$/.test(t)) throw Error("Invalid OpenCode preview host.");
8
+ if (a.pathname = a.pathname.replace(/\/?$/, "/") + t + "/host.html", !i.startsWith("/") || i.startsWith("//")) throw Error("Invalid app preview path.");
9
+ return a.search = new URLSearchParams({ port: String(n) }).toString(), a.hash = i === "/" ? "" : new URLSearchParams({ path: i }).toString(), a.href;
10
+ }
11
+ function r(e) {
12
+ let t = "";
13
+ for (let n = 0; n < e.length; n += 8192) t += String.fromCharCode(...e.subarray(n, n + 8192));
14
+ return btoa(t);
15
+ }
16
+ function i(t) {
17
+ let n = new URL(t.url).origin, i = t.browser?.connect({
18
+ ...t,
19
+ navigate: t.onNavigate
20
+ }), a, o = setTimeout(() => t.onError("The AlmostNode preview service worker did not connect. Reload the app preview."), 2e4), s = setInterval(() => a?.port1.postMessage({ type: "keepalive" }), 15e3), c = !1, l = (i) => {
21
+ if (i.source !== t.frame.contentWindow || i.origin !== n || i.data?.session !== t.session) return;
22
+ if (i.data.type === "bl-opencode-preview:error") {
23
+ clearTimeout(o), t.onError(String(i.data.message));
24
+ return;
25
+ }
26
+ if (i.data.type === "bl-opencode-preview:connected") {
27
+ clearTimeout(o);
28
+ return;
29
+ }
30
+ if (i.data.type !== "bl-opencode-preview:ready" || a) return;
31
+ a = new MessageChannel();
32
+ let s = a.port1;
33
+ s.onmessage = async (n) => {
34
+ let i = n.data;
35
+ if (!(c || !i || i.type !== "request" || !["string", "number"].includes(typeof i.id))) try {
36
+ let n = i.data;
37
+ if (n?.port !== t.port || typeof n.url != "string" || !n.url.startsWith("/") || n.url.startsWith("//") || typeof n.method != "string" || !n.headers || typeof n.headers != "object") throw Error("Invalid AlmostNode preview request.");
38
+ if (!t.host.previews?.list().some((e) => e.port === t.port)) throw Error("The app port is closed.");
39
+ let a = new Headers(n.headers);
40
+ a.delete("cookie");
41
+ let o = await t.host.previews.fetch(t.port, new Request("https://preview.internal" + n.url, {
42
+ method: n.method,
43
+ headers: a,
44
+ body: n.method === "GET" || n.method === "HEAD" ? void 0 : n.body
45
+ }));
46
+ if (c) return;
47
+ let l = new Headers(o.headers), u = t.browser && o.body !== null && o.headers.get("content-type")?.includes("text/html") && n.method !== "HEAD", d = u ? new TextEncoder().encode(e(await o.text(), t.session, window.location.origin)) : new Uint8Array(await o.arrayBuffer());
48
+ u && l.delete("content-length");
49
+ let f = {
50
+ statusCode: o.status,
51
+ statusMessage: o.statusText,
52
+ headers: Object.fromEntries(l)
53
+ };
54
+ n.streaming ? (s.postMessage({
55
+ type: "stream-start",
56
+ id: i.id,
57
+ data: f
58
+ }), d.length && s.postMessage({
59
+ type: "stream-chunk",
60
+ id: i.id,
61
+ data: { chunkBase64: r(d) }
62
+ }), s.postMessage({
63
+ type: "stream-end",
64
+ id: i.id
65
+ })) : s.postMessage({
66
+ type: "response",
67
+ id: i.id,
68
+ data: {
69
+ ...f,
70
+ bodyBase64: r(d)
71
+ }
72
+ });
73
+ } catch (e) {
74
+ if (c) return;
75
+ i.data?.streaming ? (s.postMessage({
76
+ type: "stream-start",
77
+ id: i.id,
78
+ data: {
79
+ statusCode: 502,
80
+ statusMessage: "Preview unavailable",
81
+ headers: { "content-type": "text/plain" }
82
+ }
83
+ }), s.postMessage({
84
+ type: "stream-chunk",
85
+ id: i.id,
86
+ data: { chunkBase64: r(new TextEncoder().encode(String(e))) }
87
+ }), s.postMessage({
88
+ type: "stream-end",
89
+ id: i.id
90
+ })) : s.postMessage({
91
+ type: "response",
92
+ id: i.id,
93
+ error: String(e)
94
+ });
95
+ }
96
+ }, s.postMessage({
97
+ type: "server-registered",
98
+ data: {
99
+ port: t.port,
100
+ hostname: "0.0.0.0"
101
+ }
102
+ }), t.frame.contentWindow?.postMessage({
103
+ type: "bl-opencode-preview:connect",
104
+ session: t.session
105
+ }, n, [a.port2]);
106
+ };
107
+ return window.addEventListener("message", l), () => {
108
+ c = !0, clearTimeout(o), clearInterval(s), window.removeEventListener("message", l), a?.port1.close(), i?.();
109
+ };
110
+ }
111
+ //#endregion
112
+ export { t as DEFAULT_OPENCODE_PREVIEW_URL, i as connectOpenCodePreview, n as openCodePreviewFrameUrl };
@@ -25,6 +25,10 @@ export interface TailscalePolicy {
25
25
  maxBodyBytes?: number;
26
26
  /** How long the worker waits for the tailnet client's response headers (ms). Default 60 000. */
27
27
  timeoutMs?: number;
28
+ /** Serve whole sites through the tailnet under this path of the worker's scope, e.g. `__tailnet/`: a frame opened at
29
+ * `<scope>__tailnet/https/example.com/a?b` loads https://example.com/a?b, its scripts run, and every request it makes (its
30
+ * relative URLs included) is routed, whatever the rest of the policy says. Default none. See `tailscaleProxyUrl`. */
31
+ proxyPath?: string;
28
32
  }
29
33
  export interface ResolvedTailscalePolicy {
30
34
  v: 1;
@@ -40,6 +44,7 @@ export interface ResolvedTailscalePolicy {
40
44
  whenUnavailable: TailscaleUnavailable;
41
45
  maxBodyBytes: number;
42
46
  timeoutMs: number;
47
+ proxyPath: string | null;
43
48
  }
44
49
  export type TailscaleMatchReason = 'tailnet-name' | 'tailnet-address' | 'host' | 'cidr' | 'short-name' | 'all' | 'invalid-url' | 'scheme' | 'same-origin' | 'loopback' | 'tailscale' | 'method' | 'excluded' | 'no-match';
45
50
  export interface TailscaleMatch {
@@ -56,6 +61,10 @@ export declare function isTailnetAddress(host: string): boolean;
56
61
  export declare function isTailnetHost(host: string): boolean;
57
62
  /** Fills in the defaults and checks the lists. Throws `TailscalePolicyError` for a host or range that cannot be read. */
58
63
  export declare function resolveTailscalePolicy(policy?: TailscalePolicy): ResolvedTailscalePolicy;
64
+ /** The address a frame opens to load `target` through the tailnet: `<scope><proxyPath><scheme>/<host><path>`. */
65
+ export declare function tailscaleProxyUrl(target: string | URL, scope: string, path?: string): string;
66
+ /** The inverse of `tailscaleProxyUrl`: the site a proxy address loads, or null when `url` is not one. */
67
+ export declare function tailscaleProxyTarget(url: string, scope: string, path?: string): string | null;
59
68
  /**
60
69
  * Would a request for `url` be routed? `origin` is the page's origin (to leave its own requests alone).
61
70
  * Decisions are made in a fixed order, so `reason` says which rule decided: not a URL, scheme, same origin, loopback,
@@ -1 +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,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAyBxI;AA0BD,kJAAkJ;AAClJ,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,uBAAuB,GAAG,MAAM,CAE7E;AAED,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,GAAG,IAAI,CAQlF;AAED,yEAAyE;AACzE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,MAAM,CAW/E"}
@@ -147,15 +147,21 @@ function S(r = {}) {
147
147
  methods: r.methods?.length ? x(r.methods.map((e) => e.toUpperCase())) : null,
148
148
  sameOrigin: r.sameOrigin === !0,
149
149
  whenUnavailable: s,
150
- maxBodyBytes: C(r.maxBodyBytes, t),
151
- timeoutMs: C(r.timeoutMs, n)
150
+ maxBodyBytes: w(r.maxBodyBytes, t),
151
+ timeoutMs: w(r.timeoutMs, n),
152
+ proxyPath: C(r.proxyPath)
152
153
  };
153
154
  }
154
- function C(e, t) {
155
+ function C(t) {
156
+ if (t == null || t === "") return null;
157
+ if (!/^[A-Za-z0-9_-]+\/$/.test(t)) throw new e(`proxyPath must be one path segment ending in "/", like "__tailnet/", not "${t}".`);
158
+ return t;
159
+ }
160
+ function w(e, t) {
155
161
  return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.floor(e) : t;
156
162
  }
157
- var w = (e) => /(^|\.)tailscale\.(com|io)$/.test(e), T = (e, t) => e === "localhost" || e.endsWith(".localhost") || t !== null && (c(t, d) || c(t, f));
158
- function E(e, t, n, r) {
163
+ var T = (e) => /(^|\.)tailscale\.(com|io)$/.test(e), E = (e, t) => e === "localhost" || e.endsWith(".localhost") || t !== null && (c(t, d) || c(t, f));
164
+ function D(e, t, n, r) {
159
165
  let i;
160
166
  try {
161
167
  i = typeof e == "string" ? new URL(e, r) : e;
@@ -175,16 +181,16 @@ function E(e, t, n, r) {
175
181
  reason: "same-origin"
176
182
  };
177
183
  let s = i.hostname.toLowerCase(), d = o(s);
178
- return T(s, d) ? {
184
+ return E(s, d) ? {
179
185
  route: !1,
180
186
  reason: "loopback"
181
- } : w(s) ? {
187
+ } : T(s) ? {
182
188
  route: !1,
183
189
  reason: "tailscale"
184
190
  } : n.methods && !n.methods.includes(t.toUpperCase()) ? {
185
191
  route: !1,
186
192
  reason: "method"
187
- } : D(s, d, n.exclude) ? {
193
+ } : O(s, d, n.exclude) ? {
188
194
  route: !1,
189
195
  reason: "excluded"
190
196
  } : n.intercept === "all" ? {
@@ -196,10 +202,10 @@ function E(e, t, n, r) {
196
202
  } : d && (c(d, l) || c(d, u)) ? {
197
203
  route: !0,
198
204
  reason: "tailnet-address"
199
- } : D(s, d, n.hosts) ? {
205
+ } : O(s, d, n.hosts) ? {
200
206
  route: !0,
201
207
  reason: "host"
202
- } : D(s, d, n.cidrs) ? {
208
+ } : O(s, d, n.cidrs) ? {
203
209
  route: !0,
204
210
  reason: "cidr"
205
211
  } : n.shortNames && d === null && !s.includes(".") && s !== "" ? {
@@ -210,38 +216,38 @@ function E(e, t, n, r) {
210
216
  reason: "no-match"
211
217
  };
212
218
  }
213
- function D(e, t, n) {
219
+ function O(e, t, n) {
214
220
  for (let r of n) if (r.includes("/")) {
215
221
  let e = s(r);
216
222
  if (e && t && c(t, e)) return !0;
217
223
  } else if (_(e, r)) return !0;
218
224
  return !1;
219
225
  }
220
- function O(e) {
226
+ function k(e) {
221
227
  let t = "";
222
228
  for (let n = 0; n < e.length; n += 32768) t += String.fromCharCode(...e.subarray(n, n + 32768));
223
229
  return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
224
230
  }
225
- function k(e) {
231
+ function A(e) {
226
232
  let t = atob(e.replace(/-/g, "+").replace(/_/g, "/"));
227
233
  return Uint8Array.from(t, (e) => e.charCodeAt(0));
228
234
  }
229
- function A(e) {
230
- return O(new TextEncoder().encode(JSON.stringify(e)));
231
- }
232
235
  function j(e) {
236
+ return k(new TextEncoder().encode(JSON.stringify(e)));
237
+ }
238
+ function M(e) {
233
239
  try {
234
- let t = JSON.parse(new TextDecoder().decode(k(e)));
240
+ let t = JSON.parse(new TextDecoder().decode(A(e)));
235
241
  return !t || typeof t != "object" || t.v !== 1 ? null : S(t);
236
242
  } catch {
237
243
  return null;
238
244
  }
239
245
  }
240
- function M(e) {
246
+ function N(e) {
241
247
  let t = [];
242
248
  e.intercept === "all" ? t.push("every cross-origin request") : (t.push("*.ts.net and Tailscale addresses"), e.hosts.length && t.push(e.hosts.join(", ")), e.cidrs.length && t.push(e.cidrs.join(", ")), e.shortNames && t.push("short names"));
243
249
  let n = `Routes ${t.join(", ")}`;
244
250
  return e.exclude.length ? `${n}, except ${e.exclude.join(", ")}.` : `${n}.`;
245
251
  }
246
252
  //#endregion
247
- export { t as DEFAULT_MAX_BODY_BYTES, n as DEFAULT_TIMEOUT_MS, e as TailscalePolicyError, j as decodeTailscalePolicy, M as describeTailscalePolicy, A as encodeTailscalePolicy, p as isTailnetAddress, m as isTailnetHost, E as matchTailscalePolicy, S as resolveTailscalePolicy };
253
+ export { t as DEFAULT_MAX_BODY_BYTES, n as DEFAULT_TIMEOUT_MS, e as TailscalePolicyError, M as decodeTailscalePolicy, N as describeTailscalePolicy, j as encodeTailscalePolicy, p as isTailnetAddress, m as isTailnetHost, D as matchTailscalePolicy, S as resolveTailscalePolicy };
@@ -23,9 +23,14 @@ export interface TailscaleRouterOptions {
23
23
  serviceWorkerUrl?: string;
24
24
  /** Default: the script's directory. A worker only sees pages under its scope. */
25
25
  scope?: string;
26
- /** A last say, in the page, for each matched request: return false to send it to the normal network instead. */
26
+ /** A last say, in the page, for each matched request: return false to send it to the normal network instead. Not asked about
27
+ * requests from a proxied site (`policy.proxyPath`): those have nowhere else to go. */
27
28
  shouldRoute?: (request: TailscaleRoutedRequest) => boolean | Promise<boolean>;
28
- /** Unregister the worker on `dispose()`. Default false: it stays installed, and idle, for the next visit. */
29
+ /** Answer a routed request yourself, before the tailnet is asked: return a response (say, a document you fetched a moment
30
+ * ago and are now opening in a proxy frame), or null to let the tailnet answer. */
31
+ respond?: (request: TailscaleRoutedRequest) => TailscaleResponse | null | Promise<TailscaleResponse | null>;
32
+ /** Unregister the worker on `dispose()`, once no other router on this page is using it (a remount — React's StrictMode, or
33
+ * leaving and coming back — keeps it). Default false: it stays installed, and idle, for the next visit. */
29
34
  unregisterOnDispose?: boolean;
30
35
  /** For tests: a stand-in for `navigator.serviceWorker`, and whether the page is a secure context. */
31
36
  env?: {
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/lib/tailscale-router/bridge.ts"],"names":[],"mappings":"AAUA,OAAO,EAAuE,KAAK,uBAAuB,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACjK,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,gGAAgG;AAChG,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7D,WAAW,IAAI;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7C;AAED,4DAA4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,oBAAoB,CAAC;IAChC,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,gHAAgH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