@fkn/lib 0.9.45 → 0.9.47
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/{account-generation-B-6Pn0b5.cjs → account-generation-9VhfEDoW.cjs} +1 -1
- package/{account-generation-XNWOvLea.js → account-generation-hUekEHGW.js} +1 -1
- package/account.cjs +1 -1
- package/account.js +2 -2
- package/{api-Cuf3ynZX.d.ts → api-DIBhBtcU.d.ts} +2 -24
- package/api-DMnVye0K.cjs +3 -0
- package/{api-DIgTslNb.js → api-ySazPAwN.js} +97 -59
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/busy-BXbVH595.cjs +1 -0
- package/{busy-B189uX--.js → busy-DsMWrSzc.js} +6 -3
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +2 -2
- package/cloud/fs.js +2 -2
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +2 -2
- package/cloud-BD7uzz5h.js +548 -0
- package/{cloud-KBzjWzt1.d.ts → cloud-Bdw5nX-B.d.ts} +4 -4
- package/cloud-DL4i8kvf.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +2 -2
- package/{contract-DP_jc5pZ.d.ts → contract-LOcbTDjP.d.ts} +8 -55
- package/contract.cjs +1 -1
- package/contract.d.ts +4 -4
- package/contract.js +3 -9
- package/dgram.cjs +1 -1
- package/dgram.d.ts +3 -3
- package/dgram.js +19 -19
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/extension-BeIkBEi3.js +94 -0
- package/{extension-X8cnvZej.d.ts → extension-Bsvr9OaV.d.ts} +21 -3
- package/extension-eG1RMTDc.cjs +1 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +2 -2
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +1 -1
- package/fs/promises.js +1 -1
- package/fs-BY0Csn2V.js +515 -0
- package/fs-DnF1cQuE.cjs +1 -0
- package/{fs-KA1Mgisv.d.ts → fs-lKZe5xIo.d.ts} +1 -1
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +2 -2
- package/http.d.ts +1 -1
- package/{index-DKr9L2RI.d.ts → index-D9x6A-Gx.d.ts} +1 -1
- package/{index-C8Y-YHrU.d.ts → index-iawzrUiB.d.ts} +92 -33
- package/index.cjs +1 -1
- package/index.d.ts +9 -8
- package/index.js +30 -32
- package/lib-CK2F5cc1.cjs +53 -0
- package/{lib-H5-e2A1h.js → lib-zMHWCUXz.js} +677 -497
- package/{net-eyWUIVn2.d.ts → net-taIhsmvu.d.ts} +5 -5
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +11 -12
- package/{node-fs-CK2wWIYS.js → node-fs-DY2fO5zd.js} +1 -1
- package/{node-fs-nfX7wisL.cjs → node-fs-vsWuoMGa.cjs} +1 -1
- package/opfs.cjs +1 -1
- package/opfs.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +2 -2
- package/{proxy-Dixbk1WL.js → proxy-BXkxwBxK.js} +2 -2
- package/{proxy-CFK-KiwE.cjs → proxy-BfkfFsNI.cjs} +1 -1
- package/{proxy-8Zp-G5da.d.ts → proxy-CSKLtRTm.d.ts} +2 -2
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +13 -21
- package/{storage-BLBsmkmp.d.ts → storage-B_mXNAdB.d.ts} +4 -5
- package/{storage-Dn1gTLSZ.js → storage-C6F9SnDM.js} +2 -2
- package/{storage-D2cUJlVH.cjs → storage-DmRIhg1P.cjs} +1 -1
- package/utils-BpHmMkIR.cjs +1 -0
- package/{utils-C-cAd4r4.js → utils-Cyq8uJiy.js} +7 -9
- package/{wire-BwA4JjZH.d.ts → wire-Fk5pJaoy.d.ts} +8 -1
- package/wire.cjs +1 -1
- package/wire.d.ts +2 -2
- package/wire.js +2 -2
- package/api--LOXTOpv.cjs +0 -3
- package/busy-Dv8wzE5M.cjs +0 -1
- package/cloud-CKCrMMB_.cjs +0 -1
- package/cloud-CVWGyZRT.js +0 -559
- package/extension-Dmnh5pcs.js +0 -94
- package/extension-YBe6Q6r_.cjs +0 -1
- package/fs-CVnmXRf7.js +0 -513
- package/fs-p0bOOj5n.cjs +0 -1
- package/lib-D4uqe_rb.cjs +0 -53
- package/utils-BvgGdrgN.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as StorageState, tt as SelectorPart, u as ClearCookiesWire } from "./index-
|
|
2
|
-
import { o as TcpSocketOption,
|
|
1
|
+
import { D as StorageState, tt as SelectorPart, u as ClearCookiesWire } from "./index-iawzrUiB.js";
|
|
2
|
+
import { o as TcpSocketOption, x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
|
|
3
3
|
//#region ../web-extension/lib/lib/storage-state.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A `storageState` cookie in the cloud jar's own shape (mirage's `Cookie`): `domain` always with
|
|
@@ -118,19 +118,12 @@ type FrameFetchScope = 'frame.fetchRead' | 'frame.fetchWrite';
|
|
|
118
118
|
*
|
|
119
119
|
* A category asks for every capability in it; a `key` asks for one critical permission's own row,
|
|
120
120
|
* and is refused unless the registry has that key at severity 4 (none today). A critical grant
|
|
121
|
-
* covers that key alone, never another key or its category.
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* On an Interaction or Site data entry, `attach` is set when the call stays in the frame's own
|
|
125
|
-
* document (no `frameLocator` or `owner` step), and lets the card offer that page: it reads where
|
|
126
|
-
* that attachment's frame is from its middle page, never from the app, so the app learns no path. A
|
|
127
|
-
* card that predates it ignores it and offers the whole site. Upfront asks, Network and Evaluation
|
|
128
|
-
* never send it.
|
|
121
|
+
* covers that key alone, never another key or its category. `attach` binds an "Allow once" answer
|
|
122
|
+
* to the attachment that asked, so no other attachment can consume it.
|
|
129
123
|
*/
|
|
130
124
|
type FrameConsentRequest = {
|
|
131
125
|
category: 'interaction' | 'storage' | 'network' | 'evaluation';
|
|
132
126
|
hosts: string[];
|
|
133
|
-
attach?: string;
|
|
134
127
|
} | {
|
|
135
128
|
key: string;
|
|
136
129
|
hosts: string[];
|
|
@@ -222,33 +215,6 @@ declare const SHELL_JAR_MESSAGE: {
|
|
|
222
215
|
*/
|
|
223
216
|
declare const SHELL_JAR_UNREACHABLE: readonly ['bad-attach', 'no-storage', 'bad-jar', 'no-parent', 'no-jar-host', 'no-token', 'no-indexeddb', 'failed'];
|
|
224
217
|
type ShellJarUnreachable = (typeof SHELL_JAR_UNREACHABLE)[number];
|
|
225
|
-
/**
|
|
226
|
-
* FKN internal: why `Resolvers.proxyJar.key` answered no key. Only the render proxy's own documents
|
|
227
|
-
* ask, and only these names cross the wire.
|
|
228
|
-
*
|
|
229
|
-
* - `not-proxy`: the caller is not the render proxy's own origin.
|
|
230
|
-
* - `signed-out`: no account backs the app the proxy is attached to.
|
|
231
|
-
* - `not-enrolled`: the account has no key material, so there is nothing to seal under.
|
|
232
|
-
* - `locked`: the account has key material, and this partition holds no key for it.
|
|
233
|
-
* - `unconfirmed`: nothing answered in time, so neither of the two above is known.
|
|
234
|
-
*/
|
|
235
|
-
declare const PROXY_JAR_REFUSALS: readonly ['not-proxy', 'signed-out', 'not-enrolled', 'locked', 'unconfirmed'];
|
|
236
|
-
type ProxyJarRefusal = (typeof PROXY_JAR_REFUSALS)[number];
|
|
237
|
-
/**
|
|
238
|
-
* The key the render proxy seals one jar under. `key` is 32 bytes for AES-GCM and `jar` the name of the
|
|
239
|
-
* record (43 base64url characters); both are derived from the account's key for the top-level site the
|
|
240
|
-
* jar's storage partition belongs to, so a key handed out in one partition opens no other partition's
|
|
241
|
-
* jar. `verified` is false when no api answer vouched for the key's generation: such a key may open a
|
|
242
|
-
* record that exists, and must not create one or move a clear jar into one.
|
|
243
|
-
*/
|
|
244
|
-
type ProxyJarKey = {
|
|
245
|
-
key: Uint8Array;
|
|
246
|
-
jar: string;
|
|
247
|
-
verified: boolean;
|
|
248
|
-
};
|
|
249
|
-
type ProxyJarAnswer = ProxyJarKey | {
|
|
250
|
-
refused: ProxyJarRefusal;
|
|
251
|
-
};
|
|
252
218
|
/**
|
|
253
219
|
* What a window's middle page, the jar anchor its app mounted (`/attach-jar`) and the anchor's jar
|
|
254
220
|
* host say, all with the attach id.
|
|
@@ -344,12 +310,9 @@ type ShellControl = {
|
|
|
344
310
|
*
|
|
345
311
|
* Refuses, before anything is removed: a filter of any other shape (a TypeError
|
|
346
312
|
* `frame.clearCookies: malformed filter`), an empty `scope.hosts`, and a string `domain` whose
|
|
347
|
-
* registered domain is none of the hosts' (each a LocatorDeniedError naming why)
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
* device does not hold yet; unlock it and call it again`, from a shell from 2026-10 on). Rejects
|
|
351
|
-
* with the library's own message when the jar's store did not take the removal. Absent from a shell
|
|
352
|
-
* that predates it.
|
|
313
|
+
* registered domain is none of the hosts' (each a LocatorDeniedError naming why). Rejects with the
|
|
314
|
+
* library's own message when the jar's store did not take the removal. Absent from a shell that
|
|
315
|
+
* predates it.
|
|
353
316
|
*/
|
|
354
317
|
clearCookies?(filter: ClearCookiesWire, scope: {
|
|
355
318
|
hosts: string[];
|
|
@@ -1135,16 +1098,6 @@ type Resolvers = {
|
|
|
1135
1098
|
onUpdateTaken: (callback: () => void) => () => void;
|
|
1136
1099
|
applyUpdate: () => Promise<boolean>;
|
|
1137
1100
|
};
|
|
1138
|
-
/** FKN internal: answers the render proxy's own origin only, every other caller gets `not-proxy`. */
|
|
1139
|
-
proxyJar: {
|
|
1140
|
-
/**
|
|
1141
|
-
* The key of the cookie jar in the caller's storage partition. Refusals cross as data. `prompt`
|
|
1142
|
-
* raises the key card, at most once per broker document, when the answer would be `locked`.
|
|
1143
|
-
*/
|
|
1144
|
-
key: (options?: {
|
|
1145
|
-
prompt?: boolean;
|
|
1146
|
-
}) => Promise<ProxyJarAnswer>;
|
|
1147
|
-
};
|
|
1148
1101
|
proxyFetch: ProxyFetch;
|
|
1149
1102
|
webVpnTcpSocket: (options: TcpSocketOptions) => Promise<TcpSocketResult>;
|
|
1150
1103
|
webVpnTcpSocketListener: (options: TcpSocketListenerOptions) => Promise<TcpSocketListenerResult>;
|
|
@@ -1155,4 +1108,4 @@ type Resolvers = {
|
|
|
1155
1108
|
hideInstallPrompt: () => void;
|
|
1156
1109
|
};
|
|
1157
1110
|
//#endregion
|
|
1158
|
-
export {
|
|
1111
|
+
export { RoomHandle as $, MiddleGotoOptions as A, WINDOW_HELLO_TIMEOUT_MS as At, ProxyFetch as B, FrameMessageRelay as C, TcpSocketListenerResult as Ct, IpFamily as D, UdpSocketOptions as Dt, InstalledPackage as E, UdpDatagram as Et, PackageResult as F, JarSeedCookie as Ft, Radii as G, ProxyFetchInput as H, PackagesErrorCode as I, RoomClaimOptions as J, Resolvers as K, PackagesFail as L, OverlayRect as M, WindowMiddleControl as Mt, OverlayState as N, WriteData as Nt, JAR_ANCHOR_MESSAGE as O, UdpSocketResult as Ot, PackageQuery as P, JarSeed as Pt, RoomEvent as Q, PickOptions as R, FrameFetchScope as S, TcpSocketListenerOptions as St, InstallOptions as T, TcpSocketResult as Tt, Quota as U, ProxyFetchInit as V, ROOM_TEMPORARY_MS as W, RoomDefaults as X, RoomCreateOptions as Y, RoomEnd as Z, DnsLookup as _, ShellGotoOptions as _t, AccountChange as a, RoomPermission as at, FrameConsentAnswer as b, StorageQuota as bt, AdoptRequest as c, RoomsFail as ct, ConflictRequest as d, SHELL_FRAME_MESSAGE as dt, RoomJoinOptions as et, ConflictSide as f, SHELL_JAR_MESSAGE as ft, DisplayLevel as g, ShellFrameMessage as gt, DisplayCause as h, ShellControl as ht, Account as i, RoomOpenOptions as it, MountDescriptor as j, WINDOW_JAR_MODE_TIMEOUT_MS as jt, MiddleControl as k, WINDOW_HANDSHAKE_TIMEOUT_MS as kt, AdoptState as l, SHELL_ATTACH_ERROR as lt, ConnectOptions as m, SetOverlayHost as mt, ATTACH_WINDOW_KEY as n, RoomMember as nt, AccountPinOptions as o, RoomPermissions as ot, ConnectAvailability as p, SHELL_JAR_UNREACHABLE as pt, RoomBacklog as q, ATTACH_WINDOW_MESSAGE as r, RoomMessage as rt, AddressLookupResult as s, RoomsErrorCode as st, ATTACH_FRAME_KEY as t, RoomMailbox as tt, ConflictChoice as u, SHELL_CONTROL_KEY as ut, EncryptionState as v, ShellJarUnreachable as vt, HiddenSurface as w, TcpSocketOptions as wt, FrameConsentRequest as x, SurfaceRect as xt, FRAME_MESSAGE as y, StorageEntry as yt, Placement as z };
|
package/contract.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`fkn-attach-frame`,t=`fkn-attach-window`,n=`sdbx-control`,r=`sdbx-attach-error`,i=`fkn-frame-message`,a=`sdbx-frame-message`,o={hello:`fkn-attach-window`,refused:`fkn-attach-window-refused`,gone:`fkn-attach-window-gone`,detach:`fkn-attach-window-detach`},s={request:`sdbx-jar-request`,port:`sdbx-jar-port`,mode:`sdbx-jar-mode`},c=[`bad-attach`,`no-storage`,`bad-jar`,`no-parent`,`no-jar-host`,`no-token`,`no-indexeddb`,`failed`],l=
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`fkn-attach-frame`,t=`fkn-attach-window`,n=`sdbx-control`,r=`sdbx-attach-error`,i=`fkn-frame-message`,a=`sdbx-frame-message`,o={hello:`fkn-attach-window`,refused:`fkn-attach-window-refused`,gone:`fkn-attach-window-gone`,detach:`fkn-attach-window-detach`},s={request:`sdbx-jar-request`,port:`sdbx-jar-port`,mode:`sdbx-jar-mode`},c=[`bad-attach`,`no-storage`,`bad-jar`,`no-parent`,`no-jar-host`,`no-token`,`no-indexeddb`,`failed`],l={hello:`fkn-jar-hello`,ready:`fkn-jar-ready`,port:`fkn-jar-port`,who:`fkn-jar-who`,host:`fkn-jar-host`},u=2e4,d=3e4,f=6e4,p={default:6048e5,min:6e4,max:31536e6};exports.ATTACH_FRAME_KEY=e,exports.ATTACH_WINDOW_KEY=t,exports.ATTACH_WINDOW_MESSAGE=o,exports.FRAME_MESSAGE=i,exports.JAR_ANCHOR_MESSAGE=l,exports.ROOM_TEMPORARY_MS=p,exports.SHELL_ATTACH_ERROR=r,exports.SHELL_CONTROL_KEY=n,exports.SHELL_FRAME_MESSAGE=a,exports.SHELL_JAR_MESSAGE=s,exports.SHELL_JAR_UNREACHABLE=c,exports.WINDOW_HANDSHAKE_TIMEOUT_MS=f,exports.WINDOW_HELLO_TIMEOUT_MS=u,exports.WINDOW_JAR_MODE_TIMEOUT_MS=d;
|
package/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { o as TcpSocketOption,
|
|
4
|
-
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AccountChange, AccountPinOptions, AddressLookupResult, AdoptRequest, AdoptState, type ClearCookiesWire, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, type CookieMatchWire, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, type JarSeed, type JarSeedCookie, MiddleControl, MiddleGotoOptions, MountDescriptor, OverlayRect, OverlayState,
|
|
1
|
+
import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-iawzrUiB.js";
|
|
2
|
+
import { $ as RoomHandle, A as MiddleGotoOptions, At as WINDOW_HELLO_TIMEOUT_MS, B as ProxyFetch, C as FrameMessageRelay, Ct as TcpSocketListenerResult, D as IpFamily, Dt as UdpSocketOptions, E as InstalledPackage, Et as UdpDatagram, F as PackageResult, Ft as JarSeedCookie, G as Radii, H as ProxyFetchInput, I as PackagesErrorCode, J as RoomClaimOptions, K as Resolvers, L as PackagesFail, M as OverlayRect, Mt as WindowMiddleControl, N as OverlayState, Nt as WriteData, O as JAR_ANCHOR_MESSAGE, Ot as UdpSocketResult, P as PackageQuery, Pt as JarSeed, Q as RoomEvent, R as PickOptions, S as FrameFetchScope, St as TcpSocketListenerOptions, T as InstallOptions, Tt as TcpSocketResult, U as Quota, V as ProxyFetchInit, W as ROOM_TEMPORARY_MS, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, _ as DnsLookup, _t as ShellGotoOptions, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, bt as StorageQuota, c as AdoptRequest, ct as RoomsFail, d as ConflictRequest, dt as SHELL_FRAME_MESSAGE, et as RoomJoinOptions, f as ConflictSide, ft as SHELL_JAR_MESSAGE, g as DisplayLevel, gt as ShellFrameMessage, h as DisplayCause, ht as ShellControl, i as Account, it as RoomOpenOptions, j as MountDescriptor, jt as WINDOW_JAR_MODE_TIMEOUT_MS, k as MiddleControl, kt as WINDOW_HANDSHAKE_TIMEOUT_MS, l as AdoptState, lt as SHELL_ATTACH_ERROR, m as ConnectOptions, mt as SetOverlayHost, n as ATTACH_WINDOW_KEY, nt as RoomMember, o as AccountPinOptions, ot as RoomPermissions, p as ConnectAvailability, pt as SHELL_JAR_UNREACHABLE, q as RoomBacklog, r as ATTACH_WINDOW_MESSAGE, rt as RoomMessage, s as AddressLookupResult, st as RoomsErrorCode, t as ATTACH_FRAME_KEY, tt as RoomMailbox, u as ConflictChoice, ut as SHELL_CONTROL_KEY, v as EncryptionState, vt as ShellJarUnreachable, w as HiddenSurface, wt as TcpSocketOptions, x as FrameConsentRequest, xt as SurfaceRect, y as FRAME_MESSAGE, yt as StorageEntry, z as Placement } from "./contract-LOcbTDjP.js";
|
|
3
|
+
import { o as TcpSocketOption, x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
|
|
4
|
+
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AccountChange, AccountPinOptions, AddressLookupResult, AdoptRequest, AdoptState, type ClearCookiesWire, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, type CookieMatchWire, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, type JarSeed, type JarSeedCookie, MiddleControl, MiddleGotoOptions, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, ROOM_TEMPORARY_MS, Radii, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
|
package/contract.js
CHANGED
|
@@ -17,22 +17,16 @@ var e = "fkn-attach-frame", t = "fkn-attach-window", n = "sdbx-control", r = "sd
|
|
|
17
17
|
"no-token",
|
|
18
18
|
"no-indexeddb",
|
|
19
19
|
"failed"
|
|
20
|
-
], l =
|
|
21
|
-
"not-proxy",
|
|
22
|
-
"signed-out",
|
|
23
|
-
"not-enrolled",
|
|
24
|
-
"locked",
|
|
25
|
-
"unconfirmed"
|
|
26
|
-
], u = {
|
|
20
|
+
], l = {
|
|
27
21
|
hello: "fkn-jar-hello",
|
|
28
22
|
ready: "fkn-jar-ready",
|
|
29
23
|
port: "fkn-jar-port",
|
|
30
24
|
who: "fkn-jar-who",
|
|
31
25
|
host: "fkn-jar-host"
|
|
32
|
-
},
|
|
26
|
+
}, u = 2e4, d = 3e4, f = 6e4, p = {
|
|
33
27
|
default: 6048e5,
|
|
34
28
|
min: 6e4,
|
|
35
29
|
max: 31536e6
|
|
36
30
|
};
|
|
37
31
|
//#endregion
|
|
38
|
-
export { e as ATTACH_FRAME_KEY, t as ATTACH_WINDOW_KEY, o as ATTACH_WINDOW_MESSAGE, i as FRAME_MESSAGE,
|
|
32
|
+
export { e as ATTACH_FRAME_KEY, t as ATTACH_WINDOW_KEY, o as ATTACH_WINDOW_MESSAGE, i as FRAME_MESSAGE, l as JAR_ANCHOR_MESSAGE, p as ROOM_TEMPORARY_MS, r as SHELL_ATTACH_ERROR, n as SHELL_CONTROL_KEY, a as SHELL_FRAME_MESSAGE, s as SHELL_JAR_MESSAGE, c as SHELL_JAR_UNREACHABLE, f as WINDOW_HANDSHAKE_TIMEOUT_MS, u as WINDOW_HELLO_TIMEOUT_MS, d as WINDOW_JAR_MODE_TIMEOUT_MS };
|
package/dgram.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api--LOXTOpv.cjs"),n=require("./busy-Dv8wzE5M.cjs"),r=require("./utils-BvgGdrgN.cjs");require("./wire.cjs");let i=require("buffer"),a=require("events"),o=require("ip-address");var s=e.t({Socket:()=>c,createSocket:()=>m,default:()=>h}),c=class extends a.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:r.n,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,a=0;for(;a+4<=e.byteLength;){let o=t.getUint32(a);a+=4;let s=a+o;if(s>e.byteLength)break;let c=a+4,l=t.getUint8(c);c+=1;let u,d,p;if(l===2){if(!this._remoteAddress){a=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,p=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=f(n)),c+=n.byteLength,p=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,i.Buffer.from(e.slice(c,c+m)),{address:u,family:d,port:p,size:m})}catch(e){n||(n=!0,r=e)}a=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return l;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=o.Address4.isValid(e)?d(e):p(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=r.o(...e),i=this._type===`udp6`?`::`:`0.0.0.0`,a=this.__webvpn_udp_socket_init__(t.s(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:n.address??i,port:n.port,dataPort:!0})));return n.callback&&a.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,i.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(o.Address4.isValid(e)){let n=d(e),r=t&&o.Address4.isValid(t)?d(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(o.Address6.isValid(e)){let t=p(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=r.s(...e),n=u(t.message),i=n;if(t.hasRange){let{offset:e,length:r}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(r)||r<0||r>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=n.subarray(e,e+r)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??a,s=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(s||o.Address4.isValid(r)||o.Address6.isValid(r))){this._portSend(i,s?void 0:r,s?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},l=new Uint8Array([2]),u=e=>{if(typeof e==`string`)return r.l.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(u),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},d=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},f=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},p=e=>{let t=new o.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},m=(e,t)=>{let n=new c(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},h={Socket:c,createSocket:m};exports.Socket=c,exports.createSocket=m,exports.default=h,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-DMnVye0K.cjs"),n=require("./busy-BXbVH595.cjs"),r=require("./utils-BpHmMkIR.cjs"),i=require("./wire.cjs");let a=require("buffer"),o=require("events"),s=require("ip-address");var c=e.t({Socket:()=>l,createSocket:()=>h,default:()=>g}),l=class extends o.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:i.UDP_PORT_ACK_TYPE,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,i=0;for(;i+4<=e.byteLength;){let o=t.getUint32(i);i+=4;let s=i+o;if(s>e.byteLength)break;let c=i+4,l=t.getUint8(c);c+=1;let u,d,f;if(l===2){if(!this._remoteAddress){i=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,f=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=p(n)),c+=n.byteLength,f=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,a.Buffer.from(e.slice(c,c+m)),{address:u,family:d,port:f,size:m})}catch(e){n||(n=!0,r=e)}i=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return u;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=s.Address4.isValid(e)?f(e):m(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(s.Address4.isValid(e)){let n=f(e),r=t&&s.Address4.isValid(t)?f(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(s.Address6.isValid(e)){let t=m(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=r.i(...e),i=this._type===`udp6`?`::`:`0.0.0.0`,a=this.__webvpn_udp_socket_init__(t.s(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:n.address??i,port:n.port,dataPort:!0})));return n.callback&&a.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,a.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(s.Address4.isValid(e)){let n=f(e),r=t&&s.Address4.isValid(t)?f(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(s.Address6.isValid(e)){let t=m(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=r.a(...e),n=d(t.message),i=n;if(t.hasRange){let{offset:e,length:r}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(r)||r<0||r>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=n.subarray(e,e+r)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??a,o=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(o||s.Address4.isValid(r)||s.Address6.isValid(r))){this._portSend(i,o?void 0:r,o?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},u=new Uint8Array([2]),d=e=>{if(typeof e==`string`)return r.s.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(d),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},f=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},p=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},m=e=>{let t=new s.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},h=(e,t)=>{let n=new l(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},g={Socket:l,createSocket:h};exports.Socket=l,exports.createSocket=h,exports.default=g,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
package/dgram.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./api-
|
|
1
|
+
import { K as Resolvers, Ot as UdpSocketResult } from "./contract-LOcbTDjP.js";
|
|
2
|
+
import { x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
|
|
3
|
+
import "./api-DIBhBtcU.js";
|
|
4
4
|
import { Buffer } from "buffer";
|
|
5
5
|
import { AddressInfo } from "net";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/dgram.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { s as t } from "./api-
|
|
3
|
-
import { t as n } from "./busy-
|
|
4
|
-
import {
|
|
5
|
-
import "./wire.js";
|
|
2
|
+
import { s as t } from "./api-ySazPAwN.js";
|
|
3
|
+
import { t as n } from "./busy-DsMWrSzc.js";
|
|
4
|
+
import { a as r, i, s as a } from "./utils-Cyq8uJiy.js";
|
|
5
|
+
import { UDP_PORT_ACK_TYPE as o } from "./wire.js";
|
|
6
6
|
import { Buffer as s } from "buffer";
|
|
7
7
|
import { EventEmitter as c } from "events";
|
|
8
8
|
import { Address4 as l, Address6 as u } from "ip-address";
|
|
@@ -55,7 +55,7 @@ var d = /* @__PURE__ */ e({
|
|
|
55
55
|
if (!this._dataPortAcks || !this._dataPort || (this._dataPortConsumedBytes += e, this._dataPortAckedBytes !== 0 && this._dataPortConsumedBytes - this._dataPortAckedBytes < 524288)) return;
|
|
56
56
|
this._dataPortAckedBytes = this._dataPortConsumedBytes;
|
|
57
57
|
let t = {
|
|
58
|
-
type:
|
|
58
|
+
type: o,
|
|
59
59
|
consumedBytes: this._dataPortConsumedBytes
|
|
60
60
|
};
|
|
61
61
|
this._dataPort.postMessage(t);
|
|
@@ -144,13 +144,13 @@ var d = /* @__PURE__ */ e({
|
|
|
144
144
|
return this._localAddress;
|
|
145
145
|
}
|
|
146
146
|
bind(...e) {
|
|
147
|
-
let n =
|
|
147
|
+
let n = i(...e), r = this._type === "udp6" ? "::" : "0.0.0.0", a = this.__webvpn_udp_socket_init__(t("a udp socket").then((e) => e.cloud.webvpn.udpSocket({
|
|
148
148
|
type: this._type,
|
|
149
149
|
address: n.address ?? r,
|
|
150
150
|
port: n.port,
|
|
151
151
|
dataPort: !0
|
|
152
152
|
})));
|
|
153
|
-
return n.callback &&
|
|
153
|
+
return n.callback && a.then((e) => {
|
|
154
154
|
e && n.callback.call(this);
|
|
155
155
|
}), this;
|
|
156
156
|
}
|
|
@@ -290,27 +290,27 @@ var d = /* @__PURE__ */ e({
|
|
|
290
290
|
}
|
|
291
291
|
send(...e) {
|
|
292
292
|
this._webVPNUdpSocketPromise || this.bind();
|
|
293
|
-
let t =
|
|
293
|
+
let t = r(...e), n = m(t.message), i = n;
|
|
294
294
|
if (t.hasRange) {
|
|
295
|
-
let { offset: e, length:
|
|
295
|
+
let { offset: e, length: r } = t;
|
|
296
296
|
if (!Number.isInteger(e) || e < 0 || e > n.byteLength) throw Object.assign(/* @__PURE__ */ RangeError("\"offset\" is outside of buffer bounds"), { code: "ERR_BUFFER_OUT_OF_BOUNDS" });
|
|
297
|
-
if (!Number.isInteger(
|
|
298
|
-
|
|
297
|
+
if (!Number.isInteger(r) || r < 0 || r > n.byteLength - e) throw Object.assign(/* @__PURE__ */ RangeError("\"length\" is outside of buffer bounds"), { code: "ERR_BUFFER_OUT_OF_BOUNDS" });
|
|
298
|
+
i = n.subarray(e, e + r);
|
|
299
299
|
}
|
|
300
|
-
let
|
|
300
|
+
let a = this._type === "udp6" ? "::1" : "127.0.0.1";
|
|
301
301
|
if (!this._webVPNUdpSocketPromise) throw Error("Socket not bound");
|
|
302
302
|
this._webVPNUdpSocketPromise.then((e) => {
|
|
303
303
|
if (!e) throw Error("Socket not bound");
|
|
304
|
-
let n = t.callback,
|
|
305
|
-
if (this._dataPort && (o || l.isValid(
|
|
306
|
-
this._portSend(
|
|
304
|
+
let n = t.callback, r = t.address ?? a, o = this._remoteAddress !== void 0 && t.address === void 0;
|
|
305
|
+
if (this._dataPort && (o || l.isValid(r) || u.isValid(r))) {
|
|
306
|
+
this._portSend(i, o ? void 0 : r, o ? void 0 : t.port), n?.call(this, null, i.byteLength);
|
|
307
307
|
return;
|
|
308
308
|
}
|
|
309
309
|
e.send({
|
|
310
310
|
port: t.port,
|
|
311
|
-
address:
|
|
312
|
-
message:
|
|
313
|
-
}).then(() => n?.call(this, null,
|
|
311
|
+
address: r,
|
|
312
|
+
message: i.byteOffset === 0 && i.byteLength === i.buffer.byteLength ? i.buffer : i.buffer.slice(i.byteOffset, i.byteOffset + i.byteLength)
|
|
313
|
+
}).then(() => n?.call(this, null, i.byteLength), (e) => n ? n.call(this, e, 0) : this.emit("error", e));
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
setBroadcast(e) {
|
|
@@ -364,7 +364,7 @@ var d = /* @__PURE__ */ e({
|
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
}, p = new Uint8Array([2]), m = (e) => {
|
|
367
|
-
if (typeof e == "string") return
|
|
367
|
+
if (typeof e == "string") return a.encode(e);
|
|
368
368
|
if (e instanceof Uint8Array) return e;
|
|
369
369
|
if (ArrayBuffer.isView(e)) return new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
370
370
|
if (Array.isArray(e)) {
|
package/dns.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-DMnVye0K.cjs");var n=e.t({lookup:()=>r}),r=(e,n)=>t.o.then(t=>t.cloud.dns.lookup(e,n));exports.lookup=r,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/dns.d.ts
CHANGED
package/dns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { o as t } from "./api-
|
|
2
|
+
import { o as t } from "./api-ySazPAwN.js";
|
|
3
3
|
//#region src/dns.ts
|
|
4
4
|
var n = /* @__PURE__ */ e({ lookup: () => r }), r = (e, n) => t.then((t) => t.cloud.dns.lookup(e, n));
|
|
5
5
|
//#endregion
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { $ as t, B as n, C as r, D as i, E as a, F as o, G as ee, H as te, I as ne, J as s, K as c, L as l, N as u, P as d, Q as re, R as ie, S as f, T as p, U as m, V as h, W as g, X as _, Y as v, Z as y, _ as b, a as x, at as S, b as C, ct as w, d as T, dt as E, et as D, ft as O, g as k, i as A, j, k as M, lt as N, mt as P, n as ae, nt as F, ot as I, pt as L, q as R, r as z, rt as B, t as V, tt as H, ut as U, v as W, w as G, x as K, y as q, z as J } from "./lib-zMHWCUXz.js";
|
|
3
|
+
import { o as oe, p as se } from "./api-ySazPAwN.js";
|
|
4
|
+
import { t as ce } from "./proxy-BXkxwBxK.js";
|
|
5
|
+
import { available as le, fetch as ue } from "./desktop.js";
|
|
6
|
+
//#region ../web-extension/lib/utils/background-stopped.js
|
|
7
|
+
var Y = "BackgroundStoppedError", X = (e) => T(e) && e.name === "BackgroundStoppedError", Z = async (e) => {
|
|
8
|
+
if (typeof window > "u") return !1;
|
|
9
|
+
if (D()) return !0;
|
|
10
|
+
let n = await oe, r = null, i = new Promise((e) => {
|
|
11
|
+
r = () => {
|
|
12
|
+
D() && e(!0);
|
|
13
|
+
}, t.addEventListener("statuschange", r);
|
|
14
|
+
}), a = n.installPrompt.show(e).then(() => !1), o = await Promise.race([i, a]);
|
|
15
|
+
return r && t.removeEventListener("statuschange", r), await n.installPrompt.hide().catch(() => {}), o;
|
|
16
|
+
}, Q = null;
|
|
17
|
+
F(() => (Q ||= Z().then(() => void 0).finally(() => {
|
|
18
|
+
Q = null;
|
|
19
|
+
}), Q));
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/auto.ts
|
|
22
|
+
var $ = () => typeof document < "u" && D(), de = async (e, t) => {
|
|
23
|
+
if (se(e), t?.credentials === "include") {
|
|
24
|
+
if (typeof document > "u") throw Error("fetch with credentials needs the FKN extension, which only exists in window realms");
|
|
25
|
+
return m(e, t);
|
|
26
|
+
}
|
|
27
|
+
return $() ? m(e, {
|
|
28
|
+
...t,
|
|
29
|
+
credentials: "omit"
|
|
30
|
+
}) : le() ? ue(e, t) : ce(e, t);
|
|
31
|
+
}, fe = /* @__PURE__ */ e({
|
|
32
|
+
ATTACH_FRAME_EVENT_KEY: () => A,
|
|
33
|
+
BACKGROUND_STOPPED: () => Y,
|
|
34
|
+
CATEGORIES: () => G,
|
|
35
|
+
EXTENSION_ABI: () => 5,
|
|
36
|
+
ExtensionOperationUnsupportedError: () => S,
|
|
37
|
+
ExtensionOutdatedError: () => I,
|
|
38
|
+
FORGEABLE_HEADERS: () => v,
|
|
39
|
+
FrameWindowBlockedError: () => k,
|
|
40
|
+
FrameWindowRefusedError: () => b,
|
|
41
|
+
LOCATOR_DENIED: () => M,
|
|
42
|
+
LOCATOR_ERROR: () => d,
|
|
43
|
+
LOCATOR_INVALID: () => ne,
|
|
44
|
+
LOCATOR_UNSUPPORTED: () => a,
|
|
45
|
+
PERMISSION_DENIED: () => V,
|
|
46
|
+
REQUIRED_EXTENSION_ABI: () => 0,
|
|
47
|
+
TimeoutError: () => p,
|
|
48
|
+
assertAttachableFrameUrl: () => K,
|
|
49
|
+
assertFetchableUrl: () => te,
|
|
50
|
+
assertForgeableHeaders: () => _,
|
|
51
|
+
assertLockdownApplicable: () => f,
|
|
52
|
+
assertOneCookieIdentity: () => y,
|
|
53
|
+
attachFrame: () => x,
|
|
54
|
+
attachFramePermission: () => W,
|
|
55
|
+
available: () => $,
|
|
56
|
+
box: () => U,
|
|
57
|
+
cookies: () => n,
|
|
58
|
+
createFrame: () => q,
|
|
59
|
+
createVideoElementHandle: () => E,
|
|
60
|
+
events: () => t,
|
|
61
|
+
extension: () => t,
|
|
62
|
+
fetch: () => m,
|
|
63
|
+
fetchCredentialedPermission: () => g,
|
|
64
|
+
fetchLocalPermission: () => ee,
|
|
65
|
+
fetchPermission: () => c,
|
|
66
|
+
gotoPermission: () => C,
|
|
67
|
+
handleRevivableModules: () => N,
|
|
68
|
+
hasForgedCookie: () => re,
|
|
69
|
+
isBackgroundStopped: () => X,
|
|
70
|
+
isBlockedFetchUrl: () => R,
|
|
71
|
+
isBlockedFrameUrl: () => r,
|
|
72
|
+
isExtensionExposed: () => D,
|
|
73
|
+
isLocalNetworkUrl: () => s,
|
|
74
|
+
isLocatorDenied: () => o,
|
|
75
|
+
isLocatorInvalid: () => j,
|
|
76
|
+
isLocatorUnsupported: () => i,
|
|
77
|
+
isPermissionDenied: () => ae,
|
|
78
|
+
isTerminalError: () => u,
|
|
79
|
+
isType: () => O,
|
|
80
|
+
modifyRequestHeadersPermission: () => l,
|
|
81
|
+
permissions: () => z,
|
|
82
|
+
promptInstall: () => Z,
|
|
83
|
+
readCookiePermission: () => h,
|
|
84
|
+
readExtensionHandshake: () => H,
|
|
85
|
+
removeRequestHeaderRule: () => ie,
|
|
86
|
+
revive: () => L,
|
|
87
|
+
setMissingExtensionHandler: () => F,
|
|
88
|
+
setRequestHeaderRule: () => J,
|
|
89
|
+
supportsOperation: () => w,
|
|
90
|
+
type: () => P,
|
|
91
|
+
waitForExtensionExposure: () => B
|
|
92
|
+
});
|
|
93
|
+
//#endregion
|
|
94
|
+
export { Y as a, Z as i, de as n, X as o, $ as r, fe as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, n as attachFrame, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-
|
|
1
|
+
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, n as attachFrame, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-iawzrUiB.js";
|
|
2
2
|
//#region ../frame-locator/lib/errors.d.ts
|
|
3
3
|
declare const LOCATOR_ERROR = "LocatorError";
|
|
4
4
|
declare const LOCATOR_UNSUPPORTED = "LocatorUnsupportedError";
|
|
@@ -77,6 +77,14 @@ type FetchInit = RequestInit & {
|
|
|
77
77
|
};
|
|
78
78
|
declare const isBlockedFetchUrl: (raw: string) => boolean;
|
|
79
79
|
declare const assertFetchableUrl: (raw: string) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Fetches through the extension. A credentialed fetch (`credentials: 'include'`) and one to the local
|
|
82
|
+
* network are asked for on the target's host first. A url on the extension's own pages or an FKN
|
|
83
|
+
* platform host is refused with an Error before anything is asked. A redirect onto an FKN platform
|
|
84
|
+
* host is not followed: the hop is blocked before it is sent, on both engines and in every spelling,
|
|
85
|
+
* and should one ever slip the block the final answer is still withheld with an Error. A fetch that
|
|
86
|
+
* follows redirects is refused before it is sent when the extension could not set the block up.
|
|
87
|
+
*/
|
|
80
88
|
declare const fetch$1: (input: RequestInfo | URL, init?: FetchInit) => Promise<Response>;
|
|
81
89
|
//#endregion
|
|
82
90
|
//#region ../web-extension/lib/lib/cookies.d.ts
|
|
@@ -98,6 +106,11 @@ type SiteCookie = {
|
|
|
98
106
|
value: string;
|
|
99
107
|
};
|
|
100
108
|
declare const cookies: {
|
|
109
|
+
/**
|
|
110
|
+
* Reads one named cookie of another site behind a Network ask on its host, `null` when there is
|
|
111
|
+
* none. A url on an FKN platform host (`fkn.app`, `fkn.dev`, `sdbx.app` and their subdomains) is
|
|
112
|
+
* refused with an Error before anything is asked, and again by the extension.
|
|
113
|
+
*/
|
|
101
114
|
get: (details: CookieDetails) => Promise<SiteCookie | null>;
|
|
102
115
|
};
|
|
103
116
|
//#endregion
|
|
@@ -121,7 +134,12 @@ type RequestHeaderRule = {
|
|
|
121
134
|
requestHeaders: HeaderOperation[];
|
|
122
135
|
reason?: string;
|
|
123
136
|
};
|
|
124
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* Tab-scoped: the rule is dropped when the tab goes away. A domain the rule would carry onto an FKN
|
|
139
|
+
* platform host (one of them, one under one, or a parent such as `app`, since a rule also matches every
|
|
140
|
+
* host under each domain) is refused with an Error before anything is asked, and again by the extension.
|
|
141
|
+
* So is a header other than `Origin`, `Referer` and `Cookie` (`FORGEABLE_HEADERS`).
|
|
142
|
+
*/
|
|
125
143
|
declare const setRequestHeaderRule: (rule: RequestHeaderRule) => Promise<{
|
|
126
144
|
ruleId: number;
|
|
127
145
|
}>;
|
|
@@ -173,7 +191,7 @@ declare const isBackgroundStopped: (error: unknown) => boolean;
|
|
|
173
191
|
* way a page could notice: an operation added, removed, renamed, or given different semantics. Not
|
|
174
192
|
* the package or manifest version, which move for reasons unrelated to the protocol.
|
|
175
193
|
*/
|
|
176
|
-
declare const EXTENSION_ABI =
|
|
194
|
+
declare const EXTENSION_ABI = 5;
|
|
177
195
|
/**
|
|
178
196
|
* The oldest extension the page half will talk to. Raise it only when the page half starts depending
|
|
179
197
|
* on something older extensions cannot do, never merely because `EXTENSION_ABI` moved. Deliberately 0:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-CK2F5cc1.cjs"),n=require("./api-DMnVye0K.cjs"),r=require("./proxy-BfkfFsNI.cjs"),i=require("./desktop.cjs");var a=`BackgroundStoppedError`,o=e=>t.d(e)&&e.name===`BackgroundStoppedError`,s=async e=>{if(typeof window>`u`)return!1;if(t.et())return!0;let r=await n.o,i=null,a=new Promise(e=>{i=()=>{t.et()&&e(!0)},t.$.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.$.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},c=null;t.nt(()=>(c||=s().then(()=>void 0).finally(()=>{c=null}),c));var l=()=>typeof document<`u`&&t.et(),u=async(e,a)=>{if(n.p(e),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.U(e,a)}return l()?t.U(e,{...a,credentials:`omit`}):i.available()?i.fetch(e,a):r.t(e,a)},d=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,BACKGROUND_STOPPED:()=>a,CATEGORIES:()=>t.w,EXTENSION_ABI:()=>5,ExtensionOperationUnsupportedError:()=>t.at,ExtensionOutdatedError:()=>t.ot,FORGEABLE_HEADERS:()=>t.Y,FrameWindowBlockedError:()=>t.g,FrameWindowRefusedError:()=>t._,LOCATOR_DENIED:()=>t.k,LOCATOR_ERROR:()=>t.P,LOCATOR_INVALID:()=>t.I,LOCATOR_UNSUPPORTED:()=>t.E,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,TimeoutError:()=>t.T,assertAttachableFrameUrl:()=>t.x,assertFetchableUrl:()=>t.H,assertForgeableHeaders:()=>t.X,assertLockdownApplicable:()=>t.S,assertOneCookieIdentity:()=>t.Z,attachFrame:()=>t.a,attachFramePermission:()=>t.v,available:()=>l,box:()=>t.ut,cookies:()=>t.B,createFrame:()=>t.y,createVideoElementHandle:()=>t.dt,events:()=>t.$,extension:()=>t.$,fetch:()=>t.U,fetchCredentialedPermission:()=>t.W,fetchLocalPermission:()=>t.G,fetchPermission:()=>t.K,gotoPermission:()=>t.b,handleRevivableModules:()=>t.lt,hasForgedCookie:()=>t.Q,isBackgroundStopped:()=>o,isBlockedFetchUrl:()=>t.q,isBlockedFrameUrl:()=>t.C,isExtensionExposed:()=>t.et,isLocalNetworkUrl:()=>t.J,isLocatorDenied:()=>t.F,isLocatorInvalid:()=>t.j,isLocatorUnsupported:()=>t.D,isPermissionDenied:()=>t.n,isTerminalError:()=>t.N,isType:()=>t.ft,modifyRequestHeadersPermission:()=>t.L,permissions:()=>t.r,promptInstall:()=>s,readCookiePermission:()=>t.V,readExtensionHandshake:()=>t.tt,removeRequestHeaderRule:()=>t.R,revive:()=>t.pt,setMissingExtensionHandler:()=>t.nt,setRequestHeaderRule:()=>t.z,supportsOperation:()=>t.ct,type:()=>t.mt,waitForExtensionExposure:()=>t.rt});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-CK2F5cc1.cjs"),t=require("./extension-eG1RMTDc.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.BACKGROUND_STOPPED=t.a,exports.CATEGORIES=e.w,exports.EXTENSION_ABI=e.it,exports.ExtensionOperationUnsupportedError=e.at,exports.ExtensionOutdatedError=e.ot,exports.FORGEABLE_HEADERS=e.Y,exports.FrameWindowBlockedError=e.g,exports.FrameWindowRefusedError=e._,exports.LOCATOR_DENIED=e.k,exports.LOCATOR_ERROR=e.P,exports.LOCATOR_INVALID=e.I,exports.LOCATOR_UNSUPPORTED=e.E,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.st,exports.TimeoutError=e.T,exports.assertAttachableFrameUrl=e.x,exports.assertFetchableUrl=e.H,exports.assertForgeableHeaders=e.X,exports.assertLockdownApplicable=e.S,exports.assertOneCookieIdentity=e.Z,exports.attachFrame=e.a,exports.attachFramePermission=e.v,exports.available=t.r,exports.box=e.ut,exports.cookies=e.B,exports.createFrame=e.y,exports.createVideoElementHandle=e.dt,exports.events=e.$,exports.extension=e.$,exports.fetch=e.U,exports.fetchCredentialedPermission=e.W,exports.fetchLocalPermission=e.G,exports.fetchPermission=e.K,exports.gotoPermission=e.b,exports.handleRevivableModules=e.lt,exports.hasForgedCookie=e.Q,exports.isBackgroundStopped=t.o,exports.isBlockedFetchUrl=e.q,exports.isBlockedFrameUrl=e.C,exports.isExtensionExposed=e.et,exports.isLocalNetworkUrl=e.J,exports.isLocatorDenied=e.F,exports.isLocatorInvalid=e.j,exports.isLocatorUnsupported=e.D,exports.isPermissionDenied=e.n,exports.isTerminalError=e.N,exports.isType=e.ft,exports.modifyRequestHeadersPermission=e.L,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.V,exports.readExtensionHandshake=e.tt,exports.removeRequestHeaderRule=e.R,exports.revive=e.pt,exports.setMissingExtensionHandler=e.nt,exports.setRequestHeaderRule=e.z,exports.supportsOperation=e.ct,exports.type=e.mt,exports.waitForExtensionExposure=e.rt;
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, n as attachFrame, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-
|
|
2
|
-
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, L as fetch, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, a as extension, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, r as isExtensionAvailable, s as readExtensionHandshake, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-
|
|
1
|
+
import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, n as attachFrame, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-iawzrUiB.js";
|
|
2
|
+
import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, L as fetch, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, a as extension, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, r as isExtensionAvailable, s as readExtensionHandshake, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-Bsvr9OaV.js";
|
|
3
3
|
export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, BACKGROUND_STOPPED, type BackgroundStoppedError, BlankPage, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, ClearCookiesOptions, ClearCookiesWire, CookieDetails, CookieMatchWire, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameLocator, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_INVALID, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, StorageState, StorageStateCookie, TimeoutError, VideoElementState, WindowFrame, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBackgroundStopped, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e,
|
|
2
|
-
import { a as te, i as ne, o as re, r as ie } from "./extension-
|
|
3
|
-
export {
|
|
1
|
+
import { $ as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, N as f, P as p, Q as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, at as E, b as D, ct as O, dt as k, et as A, ft as j, g as M, i as N, it as P, j as F, k as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as ee } from "./lib-zMHWCUXz.js";
|
|
2
|
+
import { a as te, i as ne, o as re, r as ie } from "./extension-BeIkBEi3.js";
|
|
3
|
+
export { N as ATTACH_FRAME_EVENT_KEY, te as BACKGROUND_STOPPED, Z as CATEGORIES, P as EXTENSION_ABI, E as ExtensionOperationUnsupportedError, V as ExtensionOutdatedError, S as FORGEABLE_HEADERS, M as FrameWindowBlockedError, w as FrameWindowRefusedError, I as LOCATOR_DENIED, p as LOCATOR_ERROR, c as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, q as PERMISSION_DENIED, K as REQUIRED_EXTENSION_ABI, _ as TimeoutError, Q as assertAttachableFrameUrl, s as assertFetchableUrl, x as assertForgeableHeaders, g as assertLockdownApplicable, C as assertOneCookieIdentity, T as attachFrame, X as attachFramePermission, ie as available, Y as box, t as cookies, $ as createFrame, k as createVideoElementHandle, e as events, e as extension, v as fetch, b as fetchCredentialedPermission, o as fetchLocalPermission, u as fetchPermission, D as gotoPermission, L as handleRevivableModules, m as hasForgedCookie, re as isBackgroundStopped, U as isBlockedFetchUrl, n as isBlockedFrameUrl, A as isExtensionExposed, l as isLocalNetworkUrl, a as isLocatorDenied, F as isLocatorInvalid, r as isLocatorUnsupported, z as isPermissionDenied, f as isTerminalError, j as isType, d as modifyRequestHeadersPermission, W as permissions, ne as promptInstall, y as readCookiePermission, J as readExtensionHandshake, h as removeRequestHeaderRule, H as revive, B as setMissingExtensionHandler, ee as setRequestHeaderRule, O as supportsOperation, R as type, G as waitForExtensionExposure };
|
package/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-DnF1cQuE.cjs");var{readFile:t,writeFile:n,appendFile:r,unlink:i,rename:a,readdir:o,mkdir:s,rm:c,rmdir:l,stat:u,lstat:d,access:f}=e.v,p=e.v;exports.access=f,exports.appendFile=r,exports.default=p,exports.lstat=d,exports.mkdir=s,exports.readFile=t,exports.readdir=o,exports.rename=a,exports.rm=c,exports.rmdir=l,exports.stat=u,exports.unlink=i,exports.writeFile=n;
|
package/fs/promises.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../index-BQgZVQl7.js";
|
|
2
|
-
import { v as promises } from "../index-
|
|
2
|
+
import { v as promises } from "../index-D9x6A-Gx.js";
|
|
3
3
|
//#region src/fs/promises.d.ts
|
|
4
4
|
export declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
|
|
5
5
|
recursive?: boolean;
|
package/fs/promises.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../fs-
|
|
1
|
+
import { v as e } from "../fs-BY0Csn2V.js";
|
|
2
2
|
//#region src/fs/promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
|
|
4
4
|
//#endregion
|