@fkn/lib 0.9.54 → 0.9.56

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 (68) hide show
  1. package/{account-generation-CTB1J33G.js → account-generation-D3jlXBbM.js} +1 -1
  2. package/{account-generation-DOuApHq5.cjs → account-generation-DkrSMafa.cjs} +1 -1
  3. package/{account-storage-D1RiskV6.js → account-storage-BBL440_m.js} +2 -2
  4. package/{account-storage-CL0wLuQw.cjs → account-storage-C1VL6fpb.cjs} +1 -1
  5. package/account.cjs +1 -1
  6. package/account.d.ts +1 -1
  7. package/account.js +2 -2
  8. package/{api-C-VvG5P-.d.ts → api-BSpQkgnM.d.ts} +361 -25
  9. package/api-BmaUJUUp.cjs +3 -0
  10. package/{api-BYtMzj8u.js → api-DEfkbHGB.js} +93 -81
  11. package/api.cjs +1 -1
  12. package/api.d.ts +2 -2
  13. package/api.js +1 -1
  14. package/cloud/dns.d.ts +1 -1
  15. package/cloud/fetch.cjs +1 -1
  16. package/cloud/fetch.d.ts +1 -1
  17. package/cloud/fetch.js +1 -1
  18. package/cloud/fs.cjs +1 -1
  19. package/cloud/fs.js +1 -1
  20. package/cloud/net.d.ts +1 -1
  21. package/{cloud-S8hQywqV.d.ts → cloud-BslRIoKs.d.ts} +2 -2
  22. package/{cloud-CI6WMBPa.cjs → cloud-C_EPPfe_.cjs} +1 -1
  23. package/{cloud-8sJ1Sg8n.js → cloud-DTpFBbBH.js} +2 -2
  24. package/cloud.cjs +1 -1
  25. package/cloud.d.ts +3 -3
  26. package/cloud.js +2 -2
  27. package/{contract-CMQOic3K.d.ts → contract-DFycgFJK.d.ts} +131 -8
  28. package/contract.d.ts +2 -2
  29. package/dgram.cjs +1 -1
  30. package/dgram.d.ts +2 -2
  31. package/dgram.js +1 -1
  32. package/dns.cjs +1 -1
  33. package/dns.d.ts +1 -1
  34. package/dns.js +1 -1
  35. package/{extension-BmqjgSIQ.js → extension-C13d41tq.js} +2 -2
  36. package/{extension-BXI3MVXw.cjs → extension-DA_Fx3Lx.cjs} +1 -1
  37. package/extension.cjs +1 -1
  38. package/extension.js +1 -1
  39. package/fs/promises.cjs +1 -1
  40. package/fs/promises.js +1 -1
  41. package/{fs-CPU00CI3.cjs → fs-C7ByWYF9.cjs} +1 -1
  42. package/{fs-ohcMNiu2.js → fs-gryDP9qw.js} +2 -2
  43. package/fs.cjs +1 -1
  44. package/fs.js +2 -2
  45. package/http.d.ts +1 -1
  46. package/index.cjs +1 -1
  47. package/index.d.ts +2 -2
  48. package/index.js +4 -4
  49. package/{net-B8YQuB9E.d.ts → net-eEjhJ0AE.d.ts} +2 -2
  50. package/net.cjs +1 -1
  51. package/net.d.ts +1 -1
  52. package/net.js +1 -1
  53. package/package.json +1 -1
  54. package/packages.cjs +1 -1
  55. package/packages.d.ts +1 -1
  56. package/packages.js +1 -1
  57. package/{proxy-ClDBa5il.d.ts → proxy-8hIHeEHD.d.ts} +2 -2
  58. package/{proxy-CL8j00ao.cjs → proxy-Blzm-Dc1.cjs} +1 -1
  59. package/{proxy-vAsYHMIa.js → proxy-C2HY5Ybc.js} +1 -1
  60. package/react.cjs +1 -1
  61. package/react.js +1 -1
  62. package/rooms.cjs +1 -1
  63. package/rooms.d.ts +43 -9
  64. package/rooms.js +154 -92
  65. package/storage.cjs +1 -1
  66. package/storage.d.ts +1 -1
  67. package/storage.js +3 -3
  68. package/api-Csb5b8dE.cjs +0 -3
@@ -544,24 +544,111 @@ type MountDescriptor = {
544
544
  };
545
545
  type RoomPermission = 'send' | 'receive' | 'remove' | 'block';
546
546
  type RoomPermissions = Readonly<Record<RoomPermission, boolean>>;
547
- /** What a member gets unless an override says otherwise. `maxMessageBytes` is measured on the wire: nonce plus ciphertext, base64url. */
547
+ /**
548
+ * What a member gets unless an override says otherwise. `maxMessageBytes` is measured on the wire: the
549
+ * envelope's text when there is one, plus the nonce and the ciphertext in base64url.
550
+ */
548
551
  type RoomDefaults = Readonly<{
549
552
  send: boolean;
550
553
  receive: boolean;
551
554
  maxMessageBytes: number;
552
555
  }>;
556
+ /** Plain JSON, as an envelope holds it. */
557
+ type RoomJson = null | boolean | number | string | readonly RoomJson[] | {
558
+ readonly [key: string]: RoomJson;
559
+ };
560
+ /**
561
+ * The plain part of a message in a room with a schema: a JSON object whose `type` names one of the room's
562
+ * types, at most 2,048 characters as `JSON.stringify` writes it. It is not sealed: FKN checks it against
563
+ * the room's schema, and FKN and every member who receives the message read it. Put nothing in it that
564
+ * is not theirs to read; what is, goes in the message's text, which is sealed as in any room.
565
+ */
566
+ type RoomEnvelope = {
567
+ readonly type: string;
568
+ readonly [field: string]: RoomJson;
569
+ };
553
570
  /** A participant as this room sees them. The id is fresh in every room. */
554
571
  type RoomMember = {
555
572
  id: string;
556
573
  permissions: RoomPermissions;
557
574
  maxMessageBytes: number;
558
575
  };
576
+ /**
577
+ * `text` is the sealed part, opened. `envelope` is the plain part, null for a message sent without one:
578
+ * in a room with no schema, or before the room had one. A message whose sealed part does not open under
579
+ * its own envelope is never delivered, so FKN cannot change an envelope or move a text under another.
580
+ */
559
581
  type RoomMessage = {
560
582
  seq: number;
561
583
  from: string;
562
584
  at: number;
563
585
  text: string;
586
+ envelope: RoomEnvelope | null;
564
587
  };
588
+ /** One type of message a room takes, and its rules. */
589
+ type RoomType = Readonly<{
590
+ /**
591
+ * The JSON Schema (draft 2020-12) the whole envelope must fit, `type` included: what `z.toJSONSchema`
592
+ * writes for a `z.object` of plain fields. Taken: `type` (a name or a list naming each type once),
593
+ * `properties`, `required` (each name once, and only names its `properties` declare),
594
+ * `additionalProperties`, `minProperties`, `maxProperties`, `items`, `prefixItems`, `minItems`,
595
+ * `maxItems`, `minLength`, `maxLength`, `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`,
596
+ * `multipleOf`, `const` and `enum` (at most 64 values) of strings, numbers, booleans or null, `true`
597
+ * and `false` as subschemas, `$schema` naming draft 2020-12, and the annotations `title`,
598
+ * `description`, `$comment`, `deprecated`, `readOnly`, `writeOnly`, `examples` and `default`; at most
599
+ * 64 subschemas, nested at most 256 levels deep. Refused `invalid` (`rooms: the schema is not one a
600
+ * room can take`): every combinator, so the `anyOf` zod writes for `.nullable()` or `z.union` over a
601
+ * field with a bound or a literal (use `.optional()`, or declare each member as its own type; over bare
602
+ * fields zod writes a type list, which is taken), `z.record`, `.regex()`, `z.email()`, `.meta({ id })`
603
+ * and recursive schemas; and a field named after anything a plain object already has, such as
604
+ * `constructor` or `toString`.
605
+ */
606
+ envelope: Readonly<Record<string, unknown>>;
607
+ /**
608
+ * Who may send it. `members`, the default: anyone the room lets send. `accounts`: only members signed
609
+ * in to an FKN account; a guest is refused `denied` (`rooms: sending this needs an account`), whatever
610
+ * it was granted. `owner`: the owner alone (`denied`, `rooms: only the owner sends this type`), and on
611
+ * a room claimed under an app's scope only through the app that claimed it (`denied`, `rooms: only the
612
+ * app that claimed the room can change it`). The owner passes every rule; a member the room does not
613
+ * let send sends no type at all.
614
+ */
615
+ send?: 'owner' | 'accounts' | 'members';
616
+ /**
617
+ * The most one such message may be on the wire, its envelope and its sealed text together, 1 to
618
+ * 33,554,432, refused `too-large` (`rooms: the message is too large`) past it, the owner's too. The
619
+ * member's own `maxMessageBytes` applies as well.
620
+ */
621
+ maxBytes?: number;
622
+ /**
623
+ * At most this many messages, or bytes on the wire, of this type waiting in the room per account,
624
+ * among those it sent in the last 30 days; each a whole number from 1 to 500,000,000, at least one of
625
+ * the two, and only with `send: 'accounts'`. The owner is not counted, and nothing is counted in a room
626
+ * that keeps no messages. At the limit a send, or an edit that grows a message, is refused `full`
627
+ * (`rooms: you have as many of these here as the room allows`) until one of them is deleted or 30 days
628
+ * pass since it was sent; an edit does not restart the 30 days. A limit set later counts only what is
629
+ * sent after it. To count, the room keeps beside each counted message a code made from the sender's
630
+ * account and the room key, never the account id, until the message is deleted or for 30 days at most.
631
+ */
632
+ perAccount?: Readonly<{
633
+ messages?: number;
634
+ bytes?: number;
635
+ }>;
636
+ }>;
637
+ /**
638
+ * The types a room's messages may have, 1 to 16, each named with 1 to 32 of `a` to `z`, `0` to `9` and
639
+ * `-`, a letter first; at most 16,384 characters as JSON. `version` is the app's own number, a whole
640
+ * number from 1 to 2,147,483,647: `setSchema` replaces the room's schema only with a higher one, so set
641
+ * it on every open and raise it to change the schema. `maxStoredBytes` is the most the room keeps, 1 to
642
+ * 500,000,000, counted as the mailbox counts: past it a send, or an edit that grows a message, is
643
+ * refused `storage` (`rooms: the mailbox is full`), nothing is ever evicted, and the owner's own cap from
644
+ * fkn.app still applies, the smaller winning. A room keeps its schema until the room itself ends, and
645
+ * messages already stored are never checked again.
646
+ */
647
+ type RoomSchema = Readonly<{
648
+ version: number;
649
+ types: Readonly<Record<string, RoomType>>;
650
+ maxStoredBytes?: number;
651
+ }>;
565
652
  /**
566
653
  * What a claimed room's mailbox holds, as the room last said. Null for a room that keeps no messages:
567
654
  * one nobody has claimed, or a claim whose mailbox is off. `cap` is the most it stores: 500 MB, or the
@@ -604,6 +691,11 @@ type RoomEvent =
604
691
  type: 'defaults';
605
692
  defaults: RoomDefaults;
606
693
  } |
694
+ /** the room's schema was replaced by one of a higher `version`, from the next send on */
695
+ {
696
+ type: 'schema';
697
+ schema: RoomSchema;
698
+ } |
607
699
  /**
608
700
  * the room was claimed, released (by its app, or by the account in its fkn.app settings) or
609
701
  * dissolved, or its mailbox was turned off or on; `owner` is the owner's member id, or '' while a
@@ -632,6 +724,14 @@ type RoomOpenOptions = {
632
724
  /** honoured only by the join that brings the room into being */
633
725
  members?: number;
634
726
  defaults?: Partial<RoomDefaults>;
727
+ /**
728
+ * Honoured only by the join that brings the room into being, as `defaults` is: an existing room keeps
729
+ * its own, and `setSchema` changes it. One the room cannot take refuses the open `invalid` (`rooms: the
730
+ * schema is not one a room can take`) and no room is left behind. An fkn.app older than room schemas
731
+ * refuses the open `unavailable` (`rooms: room schemas are not available`), after leaving the room it
732
+ * joined, so a room nobody else is in ends rather than stay without the schema.
733
+ */
734
+ schema?: RoomSchema;
635
735
  /** the room key, 32 bytes base64url, minted when absent. Deriving one from something people already share is how a name becomes a rendezvous. */
636
736
  key?: string;
637
737
  /**
@@ -757,18 +857,41 @@ type RoomHandle = {
757
857
  * handle without it rather than store what the app asked it not to.
758
858
  */
759
859
  mailboxSwitch?: true;
860
+ /**
861
+ * set by a broker that carries room schemas: `schema` on a join, `setSchema`, and an envelope on `send`
862
+ * and `edit`. A broker older than that drops the option and the envelope, so the lib refuses all three
863
+ * on a handle without it rather than send a typed message untyped.
864
+ */
865
+ schemas?: true;
760
866
  defaults: () => Promise<RoomDefaults>;
761
867
  members: () => Promise<RoomMember[]>;
762
- /** sealed before it leaves the browser and refused, never truncated, past this member's `maxMessageBytes` on the wire */
763
- send: (text: string) => Promise<RoomsFail | {
868
+ /** the room's schema as the room last said, null for a room without one */
869
+ schema: () => Promise<RoomSchema | null>;
870
+ /**
871
+ * sealed before it leaves the browser and refused, never truncated, past this member's
872
+ * `maxMessageBytes` on the wire, or the type's `maxBytes`. `envelope` is the envelope's JSON text, as
873
+ * the lib wrote it: sent byte for byte in plain beside the sealed text, which is sealed with it.
874
+ */
875
+ send: (text: string, envelope?: string) => Promise<RoomsFail | {
764
876
  ok: true;
765
877
  }>;
766
878
  /**
767
- * a stored message's text, replaced: the sender's own, or any as the owner. From another app of the
768
- * claim's account on a room claimed under an app's scope, `denied` (`rooms: only the app that claimed
769
- * the room can change it`), the account's own messages included, as `claim` says.
879
+ * a stored message's text, replaced: the sender's own, or any as the owner. Checked as a send is, and
880
+ * `envelope` as on `send`, keeping the message's type. From another app of the claim's account on a
881
+ * room claimed under an app's scope, `denied` (`rooms: only the app that claimed the room can change
882
+ * it`), the account's own messages included, as `claim` says.
883
+ */
884
+ edit: (seq: number, text: string, envelope?: string) => Promise<RoomsFail | {
885
+ ok: true;
886
+ }>;
887
+ /**
888
+ * the room's schema, replaced by one of a higher `version`; the same one answers `{ ok: true }` and
889
+ * changes nothing, and a lower one, or another schema at the same one, is refused `invalid` (`rooms:
890
+ * the room holds a newer schema`). From the owner only (`denied`, `rooms: not the room owner`); from
891
+ * another app of the claim's account on a room claimed under an app's scope, `denied` (`rooms: only the
892
+ * app that claimed the room can change it`), as `claim` says.
770
893
  */
771
- edit: (seq: number, text: string) => Promise<RoomsFail | {
894
+ setSchema: (schema: RoomSchema) => Promise<RoomsFail | {
772
895
  ok: true;
773
896
  }>;
774
897
  /**
@@ -1301,4 +1424,4 @@ type Resolvers = {
1301
1424
  hideInstallPrompt: () => void;
1302
1425
  };
1303
1426
  //#endregion
1304
- export { RoomHandle as $, MiddleGotoOptions as A, SurfaceRect as At, ProxyFetch as B, WINDOW_JAR_MODE_TIMEOUT_MS as Bt, FrameMessageRelay as C, StorageProgress as Ct, IpFamily as D, StoredHandle as Dt, InstalledPackage as E, StorageQuota as Et, PackageResult as F, UdpDatagram as Ft, Radii as G, ProxyFetchInput as H, WriteData as Ht, PackagesErrorCode as I, UdpSocketOptions as It, RoomClaimOptions as J, Resolvers as K, PackagesFail as L, UdpSocketResult as Lt, OverlayRect as M, TcpSocketListenerResult as Mt, OverlayState as N, TcpSocketOptions as Nt, JAR_ANCHOR_MESSAGE as O, StoredObject as Ot, PackageQuery as P, TcpSocketResult as Pt, RoomEvent as Q, PickOptions as R, WINDOW_HANDSHAKE_TIMEOUT_MS as Rt, FrameFetchScope as S, StorageFail as St, InstallOptions as T, StoragePutWire as Tt, Quota as U, JarSeed as Ut, ProxyFetchInit as V, WindowMiddleControl as Vt, ROOM_TEMPORARY_MS as W, JarSeedCookie as Wt, RoomDefaults as X, RoomCreateOptions as Y, RoomEnd as Z, DnsLookup as _, ShellFrameMessage as _t, AccountChange as a, RoomPermission as at, FrameConsentAnswer as b, StorageEntry 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, ShellControl as gt, DisplayCause as h, SetOverlayHost as ht, Account as i, RoomOpenOptions as it, MountDescriptor as j, TcpSocketListenerOptions as jt, MiddleControl as k, StoredPage as kt, AdoptState as l, SHELL_ATTACH_ERROR as lt, ConnectOptions as m, STORAGE_REFUSALS 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, ShellGotoOptions as vt, HiddenSurface as w, StoragePutOptions as wt, FrameConsentRequest as x, StorageErrorCode as xt, FRAME_MESSAGE as y, ShellJarUnreachable as yt, Placement as z, WINDOW_HELLO_TIMEOUT_MS as zt };
1427
+ export { RoomEvent as $, MiddleGotoOptions as A, StorageQuota as At, ProxyFetch as B, UdpSocketOptions as Bt, FrameMessageRelay as C, ShellJarUnreachable as Ct, IpFamily as D, StorageProgress as Dt, InstalledPackage as E, StorageFail as Et, PackageResult as F, TcpSocketListenerOptions as Ft, Radii as G, WindowMiddleControl as Gt, ProxyFetchInput as H, WINDOW_HANDSHAKE_TIMEOUT_MS as Ht, PackagesErrorCode as I, TcpSocketListenerResult as It, RoomClaimOptions as J, JarSeedCookie as Jt, Resolvers as K, WriteData as Kt, PackagesFail as L, TcpSocketOptions as Lt, OverlayRect as M, StoredObject as Mt, OverlayState as N, StoredPage as Nt, JAR_ANCHOR_MESSAGE as O, StoragePutOptions as Ot, PackageQuery as P, SurfaceRect as Pt, RoomEnvelope as Q, PickOptions as R, TcpSocketResult as Rt, FrameFetchScope as S, ShellGotoOptions as St, InstallOptions as T, StorageErrorCode as Tt, Quota as U, WINDOW_HELLO_TIMEOUT_MS as Ut, ProxyFetchInit as V, UdpSocketResult as Vt, ROOM_TEMPORARY_MS as W, WINDOW_JAR_MODE_TIMEOUT_MS as Wt, RoomDefaults as X, RoomCreateOptions as Y, RoomEnd as Z, DnsLookup as _, SHELL_JAR_UNREACHABLE as _t, AccountChange as a, RoomMessage as at, FrameConsentAnswer as b, ShellControl as bt, AdoptRequest as c, RoomPermissions as ct, ConflictRequest as d, RoomsErrorCode as dt, RoomHandle as et, ConflictSide as f, RoomsFail as ft, DisplayLevel as g, SHELL_JAR_MESSAGE as gt, DisplayCause as h, SHELL_FRAME_MESSAGE as ht, Account as i, RoomMember as it, MountDescriptor as j, StoredHandle as jt, MiddleControl as k, StoragePutWire as kt, AdoptState as l, RoomSchema as lt, ConnectOptions as m, SHELL_CONTROL_KEY as mt, ATTACH_WINDOW_KEY as n, RoomJson as nt, AccountPinOptions as o, RoomOpenOptions as ot, ConnectAvailability as p, SHELL_ATTACH_ERROR as pt, RoomBacklog as q, JarSeed as qt, ATTACH_WINDOW_MESSAGE as r, RoomMailbox as rt, AddressLookupResult as s, RoomPermission as st, ATTACH_FRAME_KEY as t, RoomJoinOptions as tt, ConflictChoice as u, RoomType as ut, EncryptionState as v, STORAGE_REFUSALS as vt, HiddenSurface as w, StorageEntry as wt, FrameConsentRequest as x, ShellFrameMessage as xt, FRAME_MESSAGE as y, SetOverlayHost as yt, Placement as z, UdpDatagram as zt };
package/contract.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-BQ5OZQhf.js";
2
- import { $ as RoomHandle, A as MiddleGotoOptions, At as SurfaceRect, B as ProxyFetch, Bt as WINDOW_JAR_MODE_TIMEOUT_MS, C as FrameMessageRelay, Ct as StorageProgress, D as IpFamily, Dt as StoredHandle, E as InstalledPackage, Et as StorageQuota, F as PackageResult, Ft as UdpDatagram, G as Radii, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, L as PackagesFail, Lt as UdpSocketResult, M as OverlayRect, Mt as TcpSocketListenerResult, N as OverlayState, Nt as TcpSocketOptions, O as JAR_ANCHOR_MESSAGE, Ot as StoredObject, P as PackageQuery, Pt as TcpSocketResult, Q as RoomEvent, R as PickOptions, Rt as WINDOW_HANDSHAKE_TIMEOUT_MS, S as FrameFetchScope, St as StorageFail, T as InstallOptions, Tt as StoragePutWire, U as Quota, Ut as JarSeed, V as ProxyFetchInit, Vt as WindowMiddleControl, W as ROOM_TEMPORARY_MS, Wt as JarSeedCookie, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, _ as DnsLookup, _t as ShellFrameMessage, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, bt as StorageEntry, 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 ShellControl, h as DisplayCause, ht as SetOverlayHost, i as Account, it as RoomOpenOptions, j as MountDescriptor, jt as TcpSocketListenerOptions, k as MiddleControl, kt as StoredPage, l as AdoptState, lt as SHELL_ATTACH_ERROR, m as ConnectOptions, mt as STORAGE_REFUSALS, 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 ShellGotoOptions, w as HiddenSurface, wt as StoragePutOptions, x as FrameConsentRequest, xt as StorageErrorCode, y as FRAME_MESSAGE, yt as ShellJarUnreachable, z as Placement, zt as WINDOW_HELLO_TIMEOUT_MS } from "./contract-CMQOic3K.js";
2
+ import { $ as RoomEvent, A as MiddleGotoOptions, At as StorageQuota, B as ProxyFetch, Bt as UdpSocketOptions, C as FrameMessageRelay, Ct as ShellJarUnreachable, D as IpFamily, Dt as StorageProgress, E as InstalledPackage, Et as StorageFail, F as PackageResult, Ft as TcpSocketListenerOptions, G as Radii, Gt as WindowMiddleControl, H as ProxyFetchInput, Ht as WINDOW_HANDSHAKE_TIMEOUT_MS, I as PackagesErrorCode, It as TcpSocketListenerResult, J as RoomClaimOptions, Jt as JarSeedCookie, K as Resolvers, Kt as WriteData, L as PackagesFail, Lt as TcpSocketOptions, M as OverlayRect, Mt as StoredObject, N as OverlayState, Nt as StoredPage, O as JAR_ANCHOR_MESSAGE, Ot as StoragePutOptions, P as PackageQuery, Pt as SurfaceRect, Q as RoomEnvelope, R as PickOptions, Rt as TcpSocketResult, S as FrameFetchScope, St as ShellGotoOptions, T as InstallOptions, Tt as StorageErrorCode, U as Quota, Ut as WINDOW_HELLO_TIMEOUT_MS, V as ProxyFetchInit, Vt as UdpSocketResult, W as ROOM_TEMPORARY_MS, Wt as WINDOW_JAR_MODE_TIMEOUT_MS, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, _ as DnsLookup, _t as SHELL_JAR_UNREACHABLE, a as AccountChange, at as RoomMessage, b as FrameConsentAnswer, bt as ShellControl, c as AdoptRequest, ct as RoomPermissions, d as ConflictRequest, dt as RoomsErrorCode, et as RoomHandle, f as ConflictSide, ft as RoomsFail, g as DisplayLevel, gt as SHELL_JAR_MESSAGE, h as DisplayCause, ht as SHELL_FRAME_MESSAGE, i as Account, it as RoomMember, j as MountDescriptor, jt as StoredHandle, k as MiddleControl, kt as StoragePutWire, l as AdoptState, lt as RoomSchema, m as ConnectOptions, mt as SHELL_CONTROL_KEY, n as ATTACH_WINDOW_KEY, nt as RoomJson, o as AccountPinOptions, ot as RoomOpenOptions, p as ConnectAvailability, pt as SHELL_ATTACH_ERROR, q as RoomBacklog, qt as JarSeed, r as ATTACH_WINDOW_MESSAGE, rt as RoomMailbox, s as AddressLookupResult, st as RoomPermission, t as ATTACH_FRAME_KEY, tt as RoomJoinOptions, u as ConflictChoice, ut as RoomType, v as EncryptionState, vt as STORAGE_REFUSALS, w as HiddenSurface, wt as StorageEntry, x as FrameConsentRequest, xt as ShellFrameMessage, y as FRAME_MESSAGE, yt as SetOverlayHost, z as Placement, zt as UdpDatagram } from "./contract-DFycgFJK.js";
3
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, STORAGE_REFUSALS, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageErrorCode, StorageFail, StorageProgress, StoragePutOptions, StoragePutWire, StorageQuota, StoredHandle, StoredObject, StoredPage, 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 };
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, RoomEnvelope, RoomEvent, RoomHandle, RoomJoinOptions, RoomJson, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomSchema, RoomType, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, STORAGE_REFUSALS, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageErrorCode, StorageFail, StorageProgress, StoragePutOptions, StoragePutWire, StorageQuota, StoredHandle, StoredObject, StoredPage, 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/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-Csb5b8dE.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}});
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-BmaUJUUp.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 { K as Resolvers, Lt as UdpSocketResult } from "./contract-CMQOic3K.js";
1
+ import { K as Resolvers, Vt as UdpSocketResult } from "./contract-DFycgFJK.js";
2
2
  import { x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
3
- import "./api-C-VvG5P-.js";
3
+ import "./api-BSpQkgnM.js";
4
4
  import { Buffer } from "buffer";
5
5
  import { AddressInfo } from "net";
6
6
  import { EventEmitter } from "events";
package/dgram.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { s as t } from "./api-BYtMzj8u.js";
2
+ import { s as t } from "./api-DEfkbHGB.js";
3
3
  import { t as n } from "./busy-DsMWrSzc.js";
4
4
  import { a as r, i, s as a } from "./utils-Cyq8uJiy.js";
5
5
  import { UDP_PORT_ACK_TYPE as o } from "./wire.js";
package/dns.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-Csb5b8dE.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}});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-BmaUJUUp.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
@@ -1,4 +1,4 @@
1
- import { s as AddressLookupResult } from "./contract-CMQOic3K.js";
1
+ import { s as AddressLookupResult } from "./contract-DFycgFJK.js";
2
2
  declare namespace dns_d_exports {
3
3
  export { AddressLookupResult, lookup };
4
4
  }
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-BYtMzj8u.js";
2
+ import { o as t } from "./api-DEfkbHGB.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
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
2
  import { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as u, J as ee, K as te, L as ne, M as re, O as ie, P as ae, Q as d, R as f, S as p, U as m, V as h, W as g, Y as _, Z as v, _ as y, _t 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, gt as A, ht as j, i as M, it as N, lt as P, mt as oe, n as F, nt as I, ot as L, pt as R, q as z, r as B, rt as V, t as H, tt as U, v as W, w as G, x as K, y as q, z as se } from "./lib-BGAmzIcU.js";
3
- import { o as ce, p as le } from "./api-BYtMzj8u.js";
4
- import { t as ue } from "./proxy-vAsYHMIa.js";
3
+ import { o as ce, p as le } from "./api-DEfkbHGB.js";
4
+ import { t as ue } from "./proxy-C2HY5Ybc.js";
5
5
  import { available as de, fetch as J } from "./desktop.js";
6
6
  //#region ../web-extension/lib/utils/background-stopped.js
7
7
  var Y = "BackgroundStoppedError", X = (e) => T(e) && e.name === "BackgroundStoppedError", Z = async (e) => {
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BiQ6cOZ7.cjs"),n=require("./api-Csb5b8dE.cjs"),r=require("./proxy-CL8j00ao.cjs"),i=require("./desktop.cjs");var a=`BackgroundStoppedError`,o=e=>t.d(e)&&e.name===`BackgroundStoppedError`,s=async e=>{if(t.Z(`promptInstall`,e),typeof window>`u`)return!1;if(t.rt())return!0;let r=await n.o,i=null,a=new Promise(e=>{i=()=>{t.rt()&&e(!0)},t.nt.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.nt.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},c=null;t.at(()=>(c||=s().then(()=>void 0).finally(()=>{c=null}),c));var l=()=>typeof document<`u`&&t.rt(),u=async(e,a)=>{if(n.p(e),t.Z(`fetch`,a?.reason),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.W(e,a)}return l()?t.W(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.ct,ExtensionOutdatedError:()=>t.lt,FORGEABLE_HEADERS:()=>t.Q,FrameWindowBlockedError:()=>t.g,FrameWindowRefusedError:()=>t._,LOCATOR_DENIED:()=>t.A,LOCATOR_ERROR:()=>t.F,LOCATOR_INVALID:()=>t.L,LOCATOR_UNSUPPORTED:()=>t.D,MAX_REASON_LENGTH:()=>100,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,TimeoutError:()=>t.E,assertAttachableFrameUrl:()=>t.x,assertFetchableUrl:()=>t.U,assertForgeableHeaders:()=>t.$,assertLockdownApplicable:()=>t.S,assertOneCookieIdentity:()=>t.et,attachFrame:()=>t.a,attachFramePermission:()=>t.v,available:()=>l,box:()=>t.pt,cookies:()=>t.V,createFrame:()=>t.y,createVideoElementHandle:()=>t.mt,events:()=>t.nt,extension:()=>t.nt,fetch:()=>t.W,fetchCredentialedPermission:()=>t.G,fetchLocalPermission:()=>t.K,fetchPermission:()=>t.q,gotoPermission:()=>t.b,handleRevivableModules:()=>t.ft,hasForgedCookie:()=>t.tt,isBackgroundStopped:()=>o,isBlockedFetchUrl:()=>t.J,isBlockedFrameUrl:()=>t.C,isExtensionExposed:()=>t.rt,isLocalNetworkUrl:()=>t.Y,isLocatorDenied:()=>t.I,isLocatorInvalid:()=>t.M,isLocatorUnsupported:()=>t.O,isPermissionDenied:()=>t.n,isTerminalError:()=>t.P,isType:()=>t.ht,modifyRequestHeadersPermission:()=>t.R,permissions:()=>t.r,promptInstall:()=>s,readCookiePermission:()=>t.H,readExtensionHandshake:()=>t.it,removeRequestHeaderRule:()=>t.z,revive:()=>t.gt,setMissingExtensionHandler:()=>t.at,setRequestHeaderRule:()=>t.B,supportsOperation:()=>t.dt,type:()=>t._t,waitForExtensionExposure:()=>t.ot});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}});
1
+ const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BiQ6cOZ7.cjs"),n=require("./api-BmaUJUUp.cjs"),r=require("./proxy-Blzm-Dc1.cjs"),i=require("./desktop.cjs");var a=`BackgroundStoppedError`,o=e=>t.d(e)&&e.name===`BackgroundStoppedError`,s=async e=>{if(t.Z(`promptInstall`,e),typeof window>`u`)return!1;if(t.rt())return!0;let r=await n.o,i=null,a=new Promise(e=>{i=()=>{t.rt()&&e(!0)},t.nt.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.nt.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},c=null;t.at(()=>(c||=s().then(()=>void 0).finally(()=>{c=null}),c));var l=()=>typeof document<`u`&&t.rt(),u=async(e,a)=>{if(n.p(e),t.Z(`fetch`,a?.reason),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.W(e,a)}return l()?t.W(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.ct,ExtensionOutdatedError:()=>t.lt,FORGEABLE_HEADERS:()=>t.Q,FrameWindowBlockedError:()=>t.g,FrameWindowRefusedError:()=>t._,LOCATOR_DENIED:()=>t.A,LOCATOR_ERROR:()=>t.F,LOCATOR_INVALID:()=>t.L,LOCATOR_UNSUPPORTED:()=>t.D,MAX_REASON_LENGTH:()=>100,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,TimeoutError:()=>t.E,assertAttachableFrameUrl:()=>t.x,assertFetchableUrl:()=>t.U,assertForgeableHeaders:()=>t.$,assertLockdownApplicable:()=>t.S,assertOneCookieIdentity:()=>t.et,attachFrame:()=>t.a,attachFramePermission:()=>t.v,available:()=>l,box:()=>t.pt,cookies:()=>t.V,createFrame:()=>t.y,createVideoElementHandle:()=>t.mt,events:()=>t.nt,extension:()=>t.nt,fetch:()=>t.W,fetchCredentialedPermission:()=>t.G,fetchLocalPermission:()=>t.K,fetchPermission:()=>t.q,gotoPermission:()=>t.b,handleRevivableModules:()=>t.ft,hasForgedCookie:()=>t.tt,isBackgroundStopped:()=>o,isBlockedFetchUrl:()=>t.J,isBlockedFrameUrl:()=>t.C,isExtensionExposed:()=>t.rt,isLocalNetworkUrl:()=>t.Y,isLocatorDenied:()=>t.I,isLocatorInvalid:()=>t.M,isLocatorUnsupported:()=>t.O,isPermissionDenied:()=>t.n,isTerminalError:()=>t.P,isType:()=>t.ht,modifyRequestHeadersPermission:()=>t.R,permissions:()=>t.r,promptInstall:()=>s,readCookiePermission:()=>t.H,readExtensionHandshake:()=>t.it,removeRequestHeaderRule:()=>t.z,revive:()=>t.gt,setMissingExtensionHandler:()=>t.at,setRequestHeaderRule:()=>t.B,supportsOperation:()=>t.dt,type:()=>t._t,waitForExtensionExposure:()=>t.ot});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-BiQ6cOZ7.cjs"),t=require("./extension-BXI3MVXw.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.BACKGROUND_STOPPED=t.a,exports.CATEGORIES=e.w,exports.EXTENSION_ABI=e.st,exports.ExtensionOperationUnsupportedError=e.ct,exports.ExtensionOutdatedError=e.lt,exports.FORGEABLE_HEADERS=e.Q,exports.FrameWindowBlockedError=e.g,exports.FrameWindowRefusedError=e._,exports.LOCATOR_DENIED=e.A,exports.LOCATOR_ERROR=e.F,exports.LOCATOR_INVALID=e.L,exports.LOCATOR_UNSUPPORTED=e.D,exports.MAX_REASON_LENGTH=e.X,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.ut,exports.TimeoutError=e.E,exports.assertAttachableFrameUrl=e.x,exports.assertFetchableUrl=e.U,exports.assertForgeableHeaders=e.$,exports.assertLockdownApplicable=e.S,exports.assertOneCookieIdentity=e.et,exports.attachFrame=e.a,exports.attachFramePermission=e.v,exports.available=t.r,exports.box=e.pt,exports.cookies=e.V,exports.createFrame=e.y,exports.createVideoElementHandle=e.mt,exports.events=e.nt,exports.extension=e.nt,exports.fetch=e.W,exports.fetchCredentialedPermission=e.G,exports.fetchLocalPermission=e.K,exports.fetchPermission=e.q,exports.gotoPermission=e.b,exports.handleRevivableModules=e.ft,exports.hasForgedCookie=e.tt,exports.isBackgroundStopped=t.o,exports.isBlockedFetchUrl=e.J,exports.isBlockedFrameUrl=e.C,exports.isExtensionExposed=e.rt,exports.isLocalNetworkUrl=e.Y,exports.isLocatorDenied=e.I,exports.isLocatorInvalid=e.M,exports.isLocatorUnsupported=e.O,exports.isPermissionDenied=e.n,exports.isTerminalError=e.P,exports.isType=e.ht,exports.modifyRequestHeadersPermission=e.R,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.H,exports.readExtensionHandshake=e.it,exports.removeRequestHeaderRule=e.z,exports.revive=e.gt,exports.setMissingExtensionHandler=e.at,exports.setRequestHeaderRule=e.B,exports.supportsOperation=e.dt,exports.type=e._t,exports.waitForExtensionExposure=e.ot;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-BiQ6cOZ7.cjs"),t=require("./extension-DA_Fx3Lx.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.BACKGROUND_STOPPED=t.a,exports.CATEGORIES=e.w,exports.EXTENSION_ABI=e.st,exports.ExtensionOperationUnsupportedError=e.ct,exports.ExtensionOutdatedError=e.lt,exports.FORGEABLE_HEADERS=e.Q,exports.FrameWindowBlockedError=e.g,exports.FrameWindowRefusedError=e._,exports.LOCATOR_DENIED=e.A,exports.LOCATOR_ERROR=e.F,exports.LOCATOR_INVALID=e.L,exports.LOCATOR_UNSUPPORTED=e.D,exports.MAX_REASON_LENGTH=e.X,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.ut,exports.TimeoutError=e.E,exports.assertAttachableFrameUrl=e.x,exports.assertFetchableUrl=e.U,exports.assertForgeableHeaders=e.$,exports.assertLockdownApplicable=e.S,exports.assertOneCookieIdentity=e.et,exports.attachFrame=e.a,exports.attachFramePermission=e.v,exports.available=t.r,exports.box=e.pt,exports.cookies=e.V,exports.createFrame=e.y,exports.createVideoElementHandle=e.mt,exports.events=e.nt,exports.extension=e.nt,exports.fetch=e.W,exports.fetchCredentialedPermission=e.G,exports.fetchLocalPermission=e.K,exports.fetchPermission=e.q,exports.gotoPermission=e.b,exports.handleRevivableModules=e.ft,exports.hasForgedCookie=e.tt,exports.isBackgroundStopped=t.o,exports.isBlockedFetchUrl=e.J,exports.isBlockedFrameUrl=e.C,exports.isExtensionExposed=e.rt,exports.isLocalNetworkUrl=e.Y,exports.isLocatorDenied=e.I,exports.isLocatorInvalid=e.M,exports.isLocatorUnsupported=e.O,exports.isPermissionDenied=e.n,exports.isTerminalError=e.P,exports.isType=e.ht,exports.modifyRequestHeadersPermission=e.R,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.H,exports.readExtensionHandshake=e.it,exports.removeRequestHeaderRule=e.z,exports.revive=e.gt,exports.setMissingExtensionHandler=e.at,exports.setRequestHeaderRule=e.B,exports.supportsOperation=e.dt,exports.type=e._t,exports.waitForExtensionExposure=e.ot;
package/extension.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, O as m, P as h, Q as g, R as _, S as v, U as y, V as b, W as x, X as S, Y as C, _ as w, _t as T, a as E, at as D, b as O, ct as k, dt as ee, et as A, ft as j, g as M, gt as N, ht as P, i as F, it 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 te } from "./lib-BGAmzIcU.js";
2
- import { a as ne, i as re, o as ie, r as ae } from "./extension-BmqjgSIQ.js";
2
+ import { a as ne, i as re, o as ie, r as ae } from "./extension-C13d41tq.js";
3
3
  export { F as ATTACH_FRAME_EVENT_KEY, ne as BACKGROUND_STOPPED, Z as CATEGORIES, K as EXTENSION_ABI, k as ExtensionOperationUnsupportedError, L as ExtensionOutdatedError, g as FORGEABLE_HEADERS, M as FrameWindowBlockedError, w as FrameWindowRefusedError, t as LOCATOR_DENIED, o as LOCATOR_ERROR, f as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, S as MAX_REASON_LENGTH, q as PERMISSION_DENIED, Y as REQUIRED_EXTENSION_ABI, a as TimeoutError, Q as assertAttachableFrameUrl, y as assertFetchableUrl, e as assertForgeableHeaders, v as assertLockdownApplicable, A as assertOneCookieIdentity, E as attachFrame, X as attachFramePermission, ae as available, H as box, b as cookies, $ as createFrame, R as createVideoElementHandle, B as events, B as extension, x as fetch, s as fetchCredentialedPermission, d as fetchLocalPermission, U as fetchPermission, O as gotoPermission, j as handleRevivableModules, J as hasForgedCookie, ie as isBackgroundStopped, u as isBlockedFetchUrl, r as isBlockedFrameUrl, G as isExtensionExposed, C as isLocalNetworkUrl, l as isLocatorDenied, p as isLocatorInvalid, m as isLocatorUnsupported, z as isPermissionDenied, h as isTerminalError, P as isType, _ as modifyRequestHeadersPermission, W as permissions, re as promptInstall, c as readCookiePermission, I as readExtensionHandshake, te as removeRequestHeaderRule, N as revive, D as setMissingExtensionHandler, n as setRequestHeaderRule, ee as supportsOperation, T as type, V as waitForExtensionExposure };
package/fs/promises.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-CPU00CI3.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;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-C7ByWYF9.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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { v as e } from "../fs-ohcMNiu2.js";
1
+ import { v as e } from "../fs-gryDP9qw.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
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-Csb5b8dE.cjs"),n=require("./busy-BXbVH595.cjs"),r=require("./node-fs-vsWuoMGa.cjs"),i=require("./messages.cjs"),a=require("./account-storage-CL0wLuQw.cjs"),o=require("./account.cjs"),s=require("./opfs-CXMESVLc.cjs");var c=e.t({adopt:()=>L,adoptable:()=>z,available:()=>ee,captureAccount:()=>l,list:()=>ye,onConflict:()=>Ce,pending:()=>fe,pendingDeletes:()=>pe,pull:()=>N,readFile:()=>be,readFileSealed:()=>M,remove:()=>Se,replicating:()=>me,writeFile:()=>xe}),l=a.s,u,d=async()=>await(u??=s.t().catch(()=>!1))?!0:(u=void 0,!1),f=()=>a.o().catch(()=>`unknown`),p=async()=>await f()===`connected`,ee=async()=>await d()||await p(),te=`fkn:fs:pending`,ne=`fkn:fs:pending-delete`,re=`fkn:fs:adopt-declined`,m=!0,ie=new Map,ae=null,oe=(e,t)=>{if(e===null)return!1;if(`generation`in e&&`generation`in t)return e.generation===t.generation;let n=e=>`pin`in e?e.pin:a.f(e),r=n(e);return r!==void 0&&r===n(t)},h=(e,t)=>oe(ae,t)?ie.get(e)??null:null,g=e=>e===`write`?te:ne,_=e=>{try{let t=localStorage.getItem(g(e));if(!t)return{};let n=JSON.parse(t);if(Array.isArray(n))return Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,{base:null,pin:null}]));if(!n||typeof n!=`object`)return{};let r={};for(let[e,t]of Object.entries(n))if(t===null||typeof t==`string`)r[e]={base:t,pin:null};else if(typeof t==`object`){let{base:n,pin:i}=t;r[e]={base:typeof n==`string`?n:null,pin:typeof i==`string`&&i?i:null}}return r}catch{return{}}},v=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(g(e),JSON.stringify(t)):localStorage.removeItem(g(e))}catch{}},se=()=>{try{let e=JSON.parse(localStorage.getItem(re)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}},y=new Map,ce=e=>`pin`in e?e.pin:a.f(e)??null,le=(e,t,n,r)=>{let i=_(e),a=i[t],o=ce(r);a&&o!==null&&a.pin===o||(i[t]={base:a?a.base:n,pin:o},v(e,i),o===null&&`generation`in r?y.set(`${e}:${t}`,r):y.delete(`${e}:${t}`))},ue=(e,t)=>{y.delete(`${e}:${t}`);let n=_(e);t in n&&(delete n[t],v(e,n),E()||(O=D))},b=(e,t,n)=>le(`write`,e,t,n),x=e=>ue(`write`,e),de=(e,t)=>le(`delete`,e,h(e,t),t),S=e=>ue(`delete`,e),fe=()=>Object.keys(_(`write`)),pe=()=>Object.keys(_(`delete`)),me=()=>m,C=new Map,he=e=>C.get(e)===a.s().generation,ge=(e,t,n)=>n.pin===null&&!y.has(`${e}:${t}`),w=null,T=!1;n.i(`storage replication`,()=>w!==null||B!==null);var E=()=>[`write`,`delete`].some(e=>Object.entries(_(e)).some(([t,n])=>n.pin===null?!ge(e,t,n):!he(n.pin))),D=6e4,_e=6e5,O=D,k=null,A=()=>{!k&&typeof window<`u`&&E()&&(k=setTimeout(()=>{k=null,j()},O),O=Math.min(O*2,_e))},j=()=>{if(w){T=!0;return}E()&&(w=ke(!1,a.s()).then(e=>{if(!E()){O=D;return}e.failed.length&&A()}).catch(()=>{A()}).finally(()=>{w=null,ve()}))},ve=()=>{T&&(T=!1,j())},ye=async e=>{let t=e?.pin??a.s();U();let n=await f(),r=n===`connected`,[i,o]=await Promise.all([d().then(e=>e?s.n():[]).catch(()=>[]),r?a.p({pin:t}).then(e=>({ok:!0,entries:e}),e=>({ok:!1,entries:[],changed:a.l(e)?e:void 0})):Promise.resolve({ok:n===`disconnected`,entries:[]})]);if(n!==`unknown`&&(m=o.ok),o.ok&&n!==`unknown`&&(ie=new Map(o.entries.map(e=>[e.path,e.updatedAt])),ae=t),o.changed)throw o.changed;let c=new Map,l=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},u=e=>{let t=c.get(e.path);(!t||l(e)>=l(t))&&c.set(e.path,e)};for(let e of i)u(e);for(let e of o.entries)u(e);return o.ok&&r&&(Ie(i,o.entries).catch(()=>{}),E()?j():H({local:i,remote:o.entries,from:t}).catch(()=>{})),[...c.values()]},be=async(e,t)=>{let n=t?.pin??a.s();if(await d())try{return await s.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let r=await a.g(e,{pin:n});return await d()&&s.o(e,r).catch(()=>{}),r},M=async(e,t)=>{let n=t?.pin??a.s();if(await d())try{let t=await s.i(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return a._(e,{pin:n})},xe=async(e,t,n)=>{let r=n?.pin??a.s(),i=n?.contentType,o=i?{contentType:i}:void 0,c=t instanceof Blob?t:new Blob([t],o?{type:o.contentType}:void 0);if(await d()){await s.o(e,c,o),U();let t=h(e,r),n=await f();if(n===`disconnected`)return;if(n===`unknown`||!m){b(e,t,r),A();return}a.b(e,c,{...o,pin:r}).then(()=>x(e)).catch(n=>{b(e,t,r),a.l(n)||A(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let l=await f();if(l===`connected`)return a.b(e,c,{...o,pin:r});throw Error(l===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},Se=async(e,t)=>{let n=t?.pin??a.s();U();let r=[];await d()&&r.push(s.a(e).catch(()=>{}));let i=await f();if(i===`connected`?r.push(a.v(e,{pin:n}).then(()=>S(e)).catch(t=>{de(e,n),a.l(t)||A(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):i===`unknown`&&r.length&&h(e,n)!==null&&(de(e,n),A()),!r.length)throw Error(i===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);x(e),await Promise.all(r)},N=async e=>{let t=a.s(),n=await a.g(e,{pin:t});return await d()&&await s.o(e,n),n},P=null,Ce=e=>(P=e,()=>{P===e&&(P=null)}),we=async e=>{let n=await(await t.o).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return n===`local`?e.readLocal():n===`cloud`?e.readCloud():null},Te=async e=>{if(P)try{return await P(e)}catch{return null}return we(e)},F=class extends Error{},I=e=>e instanceof Error?e.message:String(e),Ee=()=>{let e=new Map,t=t=>{let n=e.get(t);return n||e.set(t,n={writes:new Map,deletes:new Map}),n};for(let[e,n]of Object.entries(_(`write`)))t(n.pin).writes.set(e,n.base);for(let[e,n]of Object.entries(_(`delete`)))t(n.pin).deletes.set(e,n.base);return e},De=async()=>{for(let[e,t]of[...y]){let n=e.startsWith(`write:`)?`write`:`delete`,r=e.slice(n.length+1),i;try{i=await a.m(t)}catch(t){a.l(t)&&y.delete(e);continue}if(y.get(e)!==t)continue;y.delete(e);let o=_(n),s=o[r];s&&s.pin===null&&(o[r]={base:s.base,pin:i},v(n,o))}},Oe=async(e,t,n,r,i,o)=>{let c=new Map(t.map(e=>[e.path,e])),l=e=>{if(a.l(e))throw new F};for(let[t,o]of e.deletes){let e=c.get(t);if(!e){S(t);continue}if(r.some(e=>e.path===t)){S(t);continue}if(e.updatedAt!==o){S(t);continue}try{await a.v(t,n),S(t),i.deleted.push(t)}catch(e){l(e),i.failed.push({path:t,error:I(e)})}}for(let t of r){let r=c.get(t.path),u=e.writes.has(t.path);if(!u){if(!o(t))continue;if(r){i.kept.push(t.path);continue}}let d=e.writes.get(t.path)??null;if(u&&r&&r.updatedAt!==d){let e=null,o=null,c=await Te({path:t.path,local:{size:t.size,updatedAt:t.updatedAt},cloud:{size:r.size,updatedAt:r.updatedAt},readLocal:()=>e??=s.i(t.path),readCloud:()=>o??=a.g(t.path,n)});if(c==null){i.unresolved.push(t.path);continue}try{let r=e!==null&&c===await e,l=o!==null&&c===await o;l||await a.b(t.path,c,t.contentType?{contentType:t.contentType,...n}:n),r||await s.o(t.path,c),x(t.path),i.resolved.push({path:t.path,choice:r?`local`:l?`cloud`:`merged`})}catch(e){if(l(e),e?.code===`FKN_E2E_LOCKED`)throw e;i.failed.push({path:t.path,error:I(e)})}continue}try{let e=await s.i(t.path);await a.b(t.path,e,t.contentType?{contentType:t.contentType,...n}:n),x(t.path),i.uploaded.push(t.path)}catch(e){if(u||b(t.path,r?.updatedAt??null,n.pin),l(e),e?.code===`FKN_E2E_LOCKED`)throw e;i.failed.push({path:t.path,error:I(e)})}}},ke=async(e,t)=>{let n={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},r=await f();if(r===`unknown`)throw Error(`fs: cloud unreachable`);if(r!==`connected`)throw Error(`fs: this needs a signed-in account`);let i=await d(),o=i?await s.n():[];if(i)for(let e of Object.keys(_(`write`)))o.some(t=>t.path===e)||x(e);await De();for(let[e,r]of Ee()){if(e===null||he(e))continue;let i={pin:{pin:e}},s;try{s=await a.p(i)}catch(n){if(a.l(n)){C.set(e,t.generation);continue}if(a.u(n)){Ae(e);continue}throw n}try{await Oe(r,s,i,o,n,()=>!1)}catch(n){if(!(n instanceof F))throw n;C.set(e,t.generation)}}if(e){let e={pin:t},r=await a.p(e),i=_(`write`),s=Ee().get(null)??{writes:new Map,deletes:new Map},c=new Set([...n.uploaded,...n.resolved.map(({path:e})=>e),...n.unresolved,...n.failed.map(({path:e})=>e)]),l=e=>!(e.path in i)&&!c.has(e.path);try{await Oe(s,r,e,o,n,l)}catch(e){throw e instanceof F?new a.t:e}}return n},Ae=e=>{for(let t of[`write`,`delete`]){let n=_(t),r=!1;for(let t of Object.values(n))t.pin===e&&(t.pin=null,r=!0);r&&v(t,n)}},je=async e=>{for(;w;)await w;let t=ke(!0,e);w=t.then(()=>{},()=>{});try{return await t}finally{w=null,ve()}},L=()=>je(a.s()),R=(e,t)=>{let n=new Set(t.map(e=>e.path)),r=_(`write`);return e.filter(e=>{let t=r[e.path];return t?ge(`write`,e.path,t):!n.has(e.path)})},z=async()=>{let e=a.s();if(!await p()||!await d())return{paths:[],bytes:0};let[t,n]=await Promise.all([s.n(),a.p({pin:e})]),r=R(t,n);return{paths:r.map(e=>e.path),bytes:r.reduce((e,t)=>e+t.size,0)}},Me=()=>new Set(Object.keys(se())),Ne=e=>{let t=se();for(let n of e)t[n]=null;try{localStorage.setItem(re,JSON.stringify(t))}catch{}},B=null,V=!1,H=e=>{if(B)return V=!0,B;let n=e?.from??a.s();return B=(async()=>{if(!await p())return;let r=e??(await d()?{local:await s.n(),remote:await a.p({pin:n})}:null);if(!r)return;let i=Me(),o=R(r.local,r.remote).filter(e=>!i.has(e.path));if(!o.length)return;let c=await t.o,l=o.reduce((e,t)=>e+t.size,0);if(!await c.cloud.fs.promptAdopt({files:o.length,bytes:l}).catch(()=>!1)){Ne(o.map(e=>e.path));return}`generation`in n&&await je(n)})().catch(()=>{}).finally(()=>{B=null,V&&(V=!1,H())}),B},Pe=null,Fe=!1,Ie=async(e,n)=>{let r=R(e,n),i=await t.o,a=async()=>{await L().catch(()=>{});let e=await z().catch(()=>({paths:[],bytes:0}));await i.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},a).catch(()=>{})},o={files:r.length,bytes:r.reduce((e,t)=>e+t.size,0)};Pe=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},Fe||(Fe=!0,t.u((e,t)=>{t>1&&Pe?.()})),await i.cloud.fs.setAdoptSource(o,a)},Le=!1,U=()=>{Le||typeof window>`u`||(Le=!0,window.addEventListener(`online`,()=>{j()}),o.onChange(()=>{H().catch(()=>{}),j()}).catch(()=>{}))},Re=e.t({STORAGE_ACCOUNT_CHANGED:()=>i.STORAGE_ACCOUNT_CHANGED,STORAGE_ACCOUNT_PIN_UNSUPPORTED:()=>i.STORAGE_ACCOUNT_PIN_UNSUPPORTED,StorageAccountChangedError:()=>a.t,StorageAccountPinUnsupportedError:()=>a.n,adopt:()=>q,adoptable:()=>J,appendFile:()=>tt,appendFileSync:()=>Ue,available:()=>Be,default:()=>$,exists:()=>ct,existsSync:()=>We,flush:()=>W,isAccountChanged:()=>a.l,lstatSync:()=>Ke,mkdir:()=>it,mkdirSync:()=>Je,mount:()=>ut,onConflict:()=>Q,pending:()=>Y,pendingDeletes:()=>X,promises:()=>lt,pull:()=>G,readFile:()=>$e,readFileSealed:()=>K,readFileSync:()=>Ve,readdir:()=>rt,readdirSync:()=>qe,remount:()=>dt,rename:()=>st,renameSync:()=>Qe,replicating:()=>Z,rm:()=>at,rmSync:()=>Ye,rmdirSync:()=>Xe,stat:()=>nt,statSync:()=>Ge,unlink:()=>ot,unlinkSync:()=>Ze,writeFile:()=>et,writeFileSync:()=>He}),ze=r.t(c,{memfs:!0}),{available:Be,readFileSync:Ve,writeFileSync:He,appendFileSync:Ue,existsSync:We,statSync:Ge,lstatSync:Ke,readdirSync:qe,mkdirSync:Je,rmSync:Ye,rmdirSync:Xe,unlinkSync:Ze,renameSync:Qe,readFile:$e,writeFile:et,appendFile:tt,stat:nt,readdir:rt,mkdir:it,rm:at,unlink:ot,rename:st,exists:ct,promises:lt,mount:ut,flush:W,remount:dt}=ze,G=N,K=M,q=L,J=z,Y=fe,X=pe,Z=me,Q=Ce,$={...ze,pull:G,readFileSealed:K,adopt:q,adoptable:J,pending:Y,pendingDeletes:X,replicating:Z,onConflict:Q};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return G}});
1
+ const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-BmaUJUUp.cjs"),n=require("./busy-BXbVH595.cjs"),r=require("./node-fs-vsWuoMGa.cjs"),i=require("./messages.cjs"),a=require("./account-storage-C1VL6fpb.cjs"),o=require("./account.cjs"),s=require("./opfs-CXMESVLc.cjs");var c=e.t({adopt:()=>L,adoptable:()=>z,available:()=>ee,captureAccount:()=>l,list:()=>ye,onConflict:()=>Ce,pending:()=>fe,pendingDeletes:()=>pe,pull:()=>N,readFile:()=>be,readFileSealed:()=>M,remove:()=>Se,replicating:()=>me,writeFile:()=>xe}),l=a.s,u,d=async()=>await(u??=s.t().catch(()=>!1))?!0:(u=void 0,!1),f=()=>a.o().catch(()=>`unknown`),p=async()=>await f()===`connected`,ee=async()=>await d()||await p(),te=`fkn:fs:pending`,ne=`fkn:fs:pending-delete`,re=`fkn:fs:adopt-declined`,m=!0,ie=new Map,ae=null,oe=(e,t)=>{if(e===null)return!1;if(`generation`in e&&`generation`in t)return e.generation===t.generation;let n=e=>`pin`in e?e.pin:a.f(e),r=n(e);return r!==void 0&&r===n(t)},h=(e,t)=>oe(ae,t)?ie.get(e)??null:null,g=e=>e===`write`?te:ne,_=e=>{try{let t=localStorage.getItem(g(e));if(!t)return{};let n=JSON.parse(t);if(Array.isArray(n))return Object.fromEntries(n.filter(e=>typeof e==`string`).map(e=>[e,{base:null,pin:null}]));if(!n||typeof n!=`object`)return{};let r={};for(let[e,t]of Object.entries(n))if(t===null||typeof t==`string`)r[e]={base:t,pin:null};else if(typeof t==`object`){let{base:n,pin:i}=t;r[e]={base:typeof n==`string`?n:null,pin:typeof i==`string`&&i?i:null}}return r}catch{return{}}},v=(e,t)=>{try{Object.keys(t).length?localStorage.setItem(g(e),JSON.stringify(t)):localStorage.removeItem(g(e))}catch{}},se=()=>{try{let e=JSON.parse(localStorage.getItem(re)??`{}`);return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}catch{return{}}},y=new Map,ce=e=>`pin`in e?e.pin:a.f(e)??null,le=(e,t,n,r)=>{let i=_(e),a=i[t],o=ce(r);a&&o!==null&&a.pin===o||(i[t]={base:a?a.base:n,pin:o},v(e,i),o===null&&`generation`in r?y.set(`${e}:${t}`,r):y.delete(`${e}:${t}`))},ue=(e,t)=>{y.delete(`${e}:${t}`);let n=_(e);t in n&&(delete n[t],v(e,n),E()||(O=D))},b=(e,t,n)=>le(`write`,e,t,n),x=e=>ue(`write`,e),de=(e,t)=>le(`delete`,e,h(e,t),t),S=e=>ue(`delete`,e),fe=()=>Object.keys(_(`write`)),pe=()=>Object.keys(_(`delete`)),me=()=>m,C=new Map,he=e=>C.get(e)===a.s().generation,ge=(e,t,n)=>n.pin===null&&!y.has(`${e}:${t}`),w=null,T=!1;n.i(`storage replication`,()=>w!==null||B!==null);var E=()=>[`write`,`delete`].some(e=>Object.entries(_(e)).some(([t,n])=>n.pin===null?!ge(e,t,n):!he(n.pin))),D=6e4,_e=6e5,O=D,k=null,A=()=>{!k&&typeof window<`u`&&E()&&(k=setTimeout(()=>{k=null,j()},O),O=Math.min(O*2,_e))},j=()=>{if(w){T=!0;return}E()&&(w=ke(!1,a.s()).then(e=>{if(!E()){O=D;return}e.failed.length&&A()}).catch(()=>{A()}).finally(()=>{w=null,ve()}))},ve=()=>{T&&(T=!1,j())},ye=async e=>{let t=e?.pin??a.s();U();let n=await f(),r=n===`connected`,[i,o]=await Promise.all([d().then(e=>e?s.n():[]).catch(()=>[]),r?a.p({pin:t}).then(e=>({ok:!0,entries:e}),e=>({ok:!1,entries:[],changed:a.l(e)?e:void 0})):Promise.resolve({ok:n===`disconnected`,entries:[]})]);if(n!==`unknown`&&(m=o.ok),o.ok&&n!==`unknown`&&(ie=new Map(o.entries.map(e=>[e.path,e.updatedAt])),ae=t),o.changed)throw o.changed;let c=new Map,l=e=>{let t=Date.parse(e.updatedAt??``);return Number.isFinite(t)?t:0},u=e=>{let t=c.get(e.path);(!t||l(e)>=l(t))&&c.set(e.path,e)};for(let e of i)u(e);for(let e of o.entries)u(e);return o.ok&&r&&(Ie(i,o.entries).catch(()=>{}),E()?j():H({local:i,remote:o.entries,from:t}).catch(()=>{})),[...c.values()]},be=async(e,t)=>{let n=t?.pin??a.s();if(await d())try{return await s.i(e)}catch(e){if(e?.name!==`NotFoundError`)throw e}let r=await a.g(e,{pin:n});return await d()&&s.o(e,r).catch(()=>{}),r},M=async(e,t)=>{let n=t?.pin??a.s();if(await d())try{let t=await s.i(e);return{data:new Uint8Array(await t.arrayBuffer()),sealedAt:null}}catch(e){if(e?.name!==`NotFoundError`)throw e}return a._(e,{pin:n})},xe=async(e,t,n)=>{let r=n?.pin??a.s(),i=n?.contentType,o=i?{contentType:i}:void 0,c=t instanceof Blob?t:new Blob([t],o?{type:o.contentType}:void 0);if(await d()){await s.o(e,c,o),U();let t=h(e,r),n=await f();if(n===`disconnected`)return;if(n===`unknown`||!m){b(e,t,r),A();return}a.b(e,c,{...o,pin:r}).then(()=>x(e)).catch(n=>{b(e,t,r),a.l(n)||A(),console.warn(`fs: cloud replicate failed, queued for adopt()`,n)});return}let l=await f();if(l===`connected`)return a.b(e,c,{...o,pin:r});throw Error(l===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`)},Se=async(e,t)=>{let n=t?.pin??a.s();U();let r=[];await d()&&r.push(s.a(e).catch(()=>{}));let i=await f();if(i===`connected`?r.push(a.v(e,{pin:n}).then(()=>S(e)).catch(t=>{de(e,n),a.l(t)||A(),console.warn(`fs: cloud delete failed, queued for retry`,t)})):i===`unknown`&&r.length&&h(e,n)!==null&&(de(e,n),A()),!r.length)throw Error(i===`unknown`?`fs: cloud unreachable`:`fs: no storage backend available`);x(e),await Promise.all(r)},N=async e=>{let t=a.s(),n=await a.g(e,{pin:t});return await d()&&await s.o(e,n),n},P=null,Ce=e=>(P=e,()=>{P===e&&(P=null)}),we=async e=>{let n=await(await t.o).cloud.fs.promptConflict({path:e.path,local:e.local,cloud:e.cloud}).catch(()=>null);return n===`local`?e.readLocal():n===`cloud`?e.readCloud():null},Te=async e=>{if(P)try{return await P(e)}catch{return null}return we(e)},F=class extends Error{},I=e=>e instanceof Error?e.message:String(e),Ee=()=>{let e=new Map,t=t=>{let n=e.get(t);return n||e.set(t,n={writes:new Map,deletes:new Map}),n};for(let[e,n]of Object.entries(_(`write`)))t(n.pin).writes.set(e,n.base);for(let[e,n]of Object.entries(_(`delete`)))t(n.pin).deletes.set(e,n.base);return e},De=async()=>{for(let[e,t]of[...y]){let n=e.startsWith(`write:`)?`write`:`delete`,r=e.slice(n.length+1),i;try{i=await a.m(t)}catch(t){a.l(t)&&y.delete(e);continue}if(y.get(e)!==t)continue;y.delete(e);let o=_(n),s=o[r];s&&s.pin===null&&(o[r]={base:s.base,pin:i},v(n,o))}},Oe=async(e,t,n,r,i,o)=>{let c=new Map(t.map(e=>[e.path,e])),l=e=>{if(a.l(e))throw new F};for(let[t,o]of e.deletes){let e=c.get(t);if(!e){S(t);continue}if(r.some(e=>e.path===t)){S(t);continue}if(e.updatedAt!==o){S(t);continue}try{await a.v(t,n),S(t),i.deleted.push(t)}catch(e){l(e),i.failed.push({path:t,error:I(e)})}}for(let t of r){let r=c.get(t.path),u=e.writes.has(t.path);if(!u){if(!o(t))continue;if(r){i.kept.push(t.path);continue}}let d=e.writes.get(t.path)??null;if(u&&r&&r.updatedAt!==d){let e=null,o=null,c=await Te({path:t.path,local:{size:t.size,updatedAt:t.updatedAt},cloud:{size:r.size,updatedAt:r.updatedAt},readLocal:()=>e??=s.i(t.path),readCloud:()=>o??=a.g(t.path,n)});if(c==null){i.unresolved.push(t.path);continue}try{let r=e!==null&&c===await e,l=o!==null&&c===await o;l||await a.b(t.path,c,t.contentType?{contentType:t.contentType,...n}:n),r||await s.o(t.path,c),x(t.path),i.resolved.push({path:t.path,choice:r?`local`:l?`cloud`:`merged`})}catch(e){if(l(e),e?.code===`FKN_E2E_LOCKED`)throw e;i.failed.push({path:t.path,error:I(e)})}continue}try{let e=await s.i(t.path);await a.b(t.path,e,t.contentType?{contentType:t.contentType,...n}:n),x(t.path),i.uploaded.push(t.path)}catch(e){if(u||b(t.path,r?.updatedAt??null,n.pin),l(e),e?.code===`FKN_E2E_LOCKED`)throw e;i.failed.push({path:t.path,error:I(e)})}}},ke=async(e,t)=>{let n={uploaded:[],kept:[],resolved:[],unresolved:[],deleted:[],failed:[]},r=await f();if(r===`unknown`)throw Error(`fs: cloud unreachable`);if(r!==`connected`)throw Error(`fs: this needs a signed-in account`);let i=await d(),o=i?await s.n():[];if(i)for(let e of Object.keys(_(`write`)))o.some(t=>t.path===e)||x(e);await De();for(let[e,r]of Ee()){if(e===null||he(e))continue;let i={pin:{pin:e}},s;try{s=await a.p(i)}catch(n){if(a.l(n)){C.set(e,t.generation);continue}if(a.u(n)){Ae(e);continue}throw n}try{await Oe(r,s,i,o,n,()=>!1)}catch(n){if(!(n instanceof F))throw n;C.set(e,t.generation)}}if(e){let e={pin:t},r=await a.p(e),i=_(`write`),s=Ee().get(null)??{writes:new Map,deletes:new Map},c=new Set([...n.uploaded,...n.resolved.map(({path:e})=>e),...n.unresolved,...n.failed.map(({path:e})=>e)]),l=e=>!(e.path in i)&&!c.has(e.path);try{await Oe(s,r,e,o,n,l)}catch(e){throw e instanceof F?new a.t:e}}return n},Ae=e=>{for(let t of[`write`,`delete`]){let n=_(t),r=!1;for(let t of Object.values(n))t.pin===e&&(t.pin=null,r=!0);r&&v(t,n)}},je=async e=>{for(;w;)await w;let t=ke(!0,e);w=t.then(()=>{},()=>{});try{return await t}finally{w=null,ve()}},L=()=>je(a.s()),R=(e,t)=>{let n=new Set(t.map(e=>e.path)),r=_(`write`);return e.filter(e=>{let t=r[e.path];return t?ge(`write`,e.path,t):!n.has(e.path)})},z=async()=>{let e=a.s();if(!await p()||!await d())return{paths:[],bytes:0};let[t,n]=await Promise.all([s.n(),a.p({pin:e})]),r=R(t,n);return{paths:r.map(e=>e.path),bytes:r.reduce((e,t)=>e+t.size,0)}},Me=()=>new Set(Object.keys(se())),Ne=e=>{let t=se();for(let n of e)t[n]=null;try{localStorage.setItem(re,JSON.stringify(t))}catch{}},B=null,V=!1,H=e=>{if(B)return V=!0,B;let n=e?.from??a.s();return B=(async()=>{if(!await p())return;let r=e??(await d()?{local:await s.n(),remote:await a.p({pin:n})}:null);if(!r)return;let i=Me(),o=R(r.local,r.remote).filter(e=>!i.has(e.path));if(!o.length)return;let c=await t.o,l=o.reduce((e,t)=>e+t.size,0);if(!await c.cloud.fs.promptAdopt({files:o.length,bytes:l}).catch(()=>!1)){Ne(o.map(e=>e.path));return}`generation`in n&&await je(n)})().catch(()=>{}).finally(()=>{B=null,V&&(V=!1,H())}),B},Pe=null,Fe=!1,Ie=async(e,n)=>{let r=R(e,n),i=await t.o,a=async()=>{await L().catch(()=>{});let e=await z().catch(()=>({paths:[],bytes:0}));await i.cloud.fs.setAdoptSource({files:e.paths.length,bytes:e.bytes},a).catch(()=>{})},o={files:r.length,bytes:r.reduce((e,t)=>e+t.size,0)};Pe=()=>{i.cloud.fs.setAdoptSource(o,a).catch(()=>{})},Fe||(Fe=!0,t.u((e,t)=>{t>1&&Pe?.()})),await i.cloud.fs.setAdoptSource(o,a)},Le=!1,U=()=>{Le||typeof window>`u`||(Le=!0,window.addEventListener(`online`,()=>{j()}),o.onChange(()=>{H().catch(()=>{}),j()}).catch(()=>{}))},Re=e.t({STORAGE_ACCOUNT_CHANGED:()=>i.STORAGE_ACCOUNT_CHANGED,STORAGE_ACCOUNT_PIN_UNSUPPORTED:()=>i.STORAGE_ACCOUNT_PIN_UNSUPPORTED,StorageAccountChangedError:()=>a.t,StorageAccountPinUnsupportedError:()=>a.n,adopt:()=>q,adoptable:()=>J,appendFile:()=>tt,appendFileSync:()=>Ue,available:()=>Be,default:()=>$,exists:()=>ct,existsSync:()=>We,flush:()=>W,isAccountChanged:()=>a.l,lstatSync:()=>Ke,mkdir:()=>it,mkdirSync:()=>Je,mount:()=>ut,onConflict:()=>Q,pending:()=>Y,pendingDeletes:()=>X,promises:()=>lt,pull:()=>G,readFile:()=>$e,readFileSealed:()=>K,readFileSync:()=>Ve,readdir:()=>rt,readdirSync:()=>qe,remount:()=>dt,rename:()=>st,renameSync:()=>Qe,replicating:()=>Z,rm:()=>at,rmSync:()=>Ye,rmdirSync:()=>Xe,stat:()=>nt,statSync:()=>Ge,unlink:()=>ot,unlinkSync:()=>Ze,writeFile:()=>et,writeFileSync:()=>He}),ze=r.t(c,{memfs:!0}),{available:Be,readFileSync:Ve,writeFileSync:He,appendFileSync:Ue,existsSync:We,statSync:Ge,lstatSync:Ke,readdirSync:qe,mkdirSync:Je,rmSync:Ye,rmdirSync:Xe,unlinkSync:Ze,renameSync:Qe,readFile:$e,writeFile:et,appendFile:tt,stat:nt,readdir:rt,mkdir:it,rm:at,unlink:ot,rename:st,exists:ct,promises:lt,mount:ut,flush:W,remount:dt}=ze,G=N,K=M,q=L,J=z,Y=fe,X=pe,Z=me,Q=Ce,$={...ze,pull:G,readFileSealed:K,adopt:q,adoptable:J,pending:Y,pendingDeletes:X,replicating:Z,onConflict:Q};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return et}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return We}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return G}});
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { o as t, u as n } from "./api-BYtMzj8u.js";
2
+ import { o as t, u as n } from "./api-DEfkbHGB.js";
3
3
  import { i as r } from "./busy-DsMWrSzc.js";
4
4
  import { t as i } from "./node-fs-DY2fO5zd.js";
5
5
  import { STORAGE_ACCOUNT_CHANGED as a, STORAGE_ACCOUNT_PIN_UNSUPPORTED as o } from "./messages.js";
6
- import { _ as s, b as c, f as l, g as u, l as d, m as ee, n as te, o as ne, p as f, s as p, t as re, u as ie, v as ae } from "./account-storage-D1RiskV6.js";
6
+ import { _ as s, b as c, f as l, g as u, l as d, m as ee, n as te, o as ne, p as f, s as p, t as re, u as ie, v as ae } from "./account-storage-BBL440_m.js";
7
7
  import { onChange as oe } from "./account.js";
8
8
  import { a as se, i as m, n as h, o as g, t as ce } from "./opfs-D0goLAQW.js";
9
9
  //#region src/fs/hybrid.ts
package/fs.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./messages.cjs"),t=require("./account-storage-CL0wLuQw.cjs"),n=require("./fs-CPU00CI3.cjs");exports.STORAGE_ACCOUNT_CHANGED=e.STORAGE_ACCOUNT_CHANGED,exports.STORAGE_ACCOUNT_PIN_UNSUPPORTED=e.STORAGE_ACCOUNT_PIN_UNSUPPORTED,exports.StorageAccountChangedError=t.t,exports.StorageAccountPinUnsupportedError=t.n,exports.adopt=n.t,exports.adoptable=n.n,exports.appendFile=n.r,exports.appendFileSync=n.i,exports.available=n.a,exports.default=n.l,exports.exists=n.o,exports.existsSync=n.s,exports.flush=n.c,exports.isAccountChanged=t.l,exports.lstatSync=n.d,exports.mkdir=n.f,exports.mkdirSync=n.p,exports.mount=n.m,exports.onConflict=n.h,exports.pending=n.g,exports.pendingDeletes=n._,exports.promises=n.v,exports.pull=n.y,exports.readFile=n.b,exports.readFileSealed=n.x,exports.readFileSync=n.S,exports.readdir=n.C,exports.readdirSync=n.w,exports.remount=n.T,exports.rename=n.E,exports.renameSync=n.D,exports.replicating=n.O,exports.rm=n.k,exports.rmSync=n.A,exports.rmdirSync=n.j,exports.stat=n.M,exports.statSync=n.N,exports.unlink=n.P,exports.unlinkSync=n.F,exports.writeFile=n.I,exports.writeFileSync=n.L;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./messages.cjs"),t=require("./account-storage-C1VL6fpb.cjs"),n=require("./fs-C7ByWYF9.cjs");exports.STORAGE_ACCOUNT_CHANGED=e.STORAGE_ACCOUNT_CHANGED,exports.STORAGE_ACCOUNT_PIN_UNSUPPORTED=e.STORAGE_ACCOUNT_PIN_UNSUPPORTED,exports.StorageAccountChangedError=t.t,exports.StorageAccountPinUnsupportedError=t.n,exports.adopt=n.t,exports.adoptable=n.n,exports.appendFile=n.r,exports.appendFileSync=n.i,exports.available=n.a,exports.default=n.l,exports.exists=n.o,exports.existsSync=n.s,exports.flush=n.c,exports.isAccountChanged=t.l,exports.lstatSync=n.d,exports.mkdir=n.f,exports.mkdirSync=n.p,exports.mount=n.m,exports.onConflict=n.h,exports.pending=n.g,exports.pendingDeletes=n._,exports.promises=n.v,exports.pull=n.y,exports.readFile=n.b,exports.readFileSealed=n.x,exports.readFileSync=n.S,exports.readdir=n.C,exports.readdirSync=n.w,exports.remount=n.T,exports.rename=n.E,exports.renameSync=n.D,exports.replicating=n.O,exports.rm=n.k,exports.rmSync=n.A,exports.rmdirSync=n.j,exports.stat=n.M,exports.statSync=n.N,exports.unlink=n.P,exports.unlinkSync=n.F,exports.writeFile=n.I,exports.writeFileSync=n.L;
package/fs.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { STORAGE_ACCOUNT_CHANGED as e, STORAGE_ACCOUNT_PIN_UNSUPPORTED as t } from "./messages.js";
2
- import { l as n, n as r, t as i } from "./account-storage-D1RiskV6.js";
3
- import { A as a, C as o, D as s, E as c, F as l, I as u, L as d, M as f, N as p, O as m, P as h, S as g, T as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as T, i as E, j as D, k as O, l as k, m as A, n as j, o as M, p as N, r as P, s as F, t as I, v as L, w as R, x as z, y as B } from "./fs-ohcMNiu2.js";
2
+ import { l as n, n as r, t as i } from "./account-storage-BBL440_m.js";
3
+ import { A as a, C as o, D as s, E as c, F as l, I as u, L as d, M as f, N as p, O as m, P as h, S as g, T as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as T, i as E, j as D, k as O, l as k, m as A, n as j, o as M, p as N, r as P, s as F, t as I, v as L, w as R, x as z, y as B } from "./fs-gryDP9qw.js";
4
4
  export { e as STORAGE_ACCOUNT_CHANGED, t as STORAGE_ACCOUNT_PIN_UNSUPPORTED, i as StorageAccountChangedError, r as StorageAccountPinUnsupportedError, I as adopt, j as adoptable, P as appendFile, E as appendFileSync, y as available, k as default, M as exists, F as existsSync, x as flush, n as isAccountChanged, S as lstatSync, C as mkdir, N as mkdirSync, A as mount, T as onConflict, w as pending, v as pendingDeletes, L as promises, B as pull, b as readFile, z as readFileSealed, g as readFileSync, o as readdir, R as readdirSync, _ as remount, c as rename, s as renameSync, m as replicating, O as rm, a as rmSync, D as rmdirSync, f as stat, p as statSync, h as unlink, l as unlinkSync, u as writeFile, d as writeFileSync };
package/http.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as Socket, t as Server$1 } from "./net-B8YQuB9E.js";
1
+ import { n as Socket, t as Server$1 } from "./net-eEjhJ0AE.js";
2
2
  import { Buffer } from "buffer";
3
3
  import { Stream } from "stream";
4
4
  import { IncomingHttpHeaders, OutgoingHttpHeaders, RequestOptions } from "http";
package/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BiQ6cOZ7.cjs"),n=require("./extension-BXI3MVXw.cjs"),r=require("./api-Csb5b8dE.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./cloud-CI6WMBPa.cjs"),o=require("./dns.cjs"),s=require("./net.cjs"),c=require("./dgram.cjs"),l=require("./http.cjs"),u=require("./desktop.cjs"),d=require("./account.cjs"),f=require("./fs-CPU00CI3.cjs"),p=require("./opfs.cjs"),m=require("./packages.cjs"),h=require("./rooms.cjs"),g=require("./storage.cjs"),_=require("./connect-button-BpXDs7tw.cjs");let v=require("osra");var y=1e4,b=150,x=()=>new Promise(e=>{if(t.rt())return e(!0);let n,r=setTimeout(()=>i(t.rt()),y),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.rt()),b)},o=new MutationObserver(()=>{t.rt()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.rt()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),S=(async e=>{let{kind:n,cookies:r}=t.o(e);if(n===`window`){let n=e;return r===`native`?t.a(n):a.i(n)}let i=e;return r===`native`?C(i):a.i(i)}),C=async e=>(a.a(e),await x(),t.a(e)),w=`https://fkn.app`,T=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let n=await r.f;if(!n)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);r.d(),i.r(`relayed worker`,t?.unregisterSignal);let a=n.emit instanceof MessagePort?{}:{originA:t?.originA??w,originB:t?.originB??`*`};(0,v.relay)(n,e,{key:`fkn-api`,...a,unregisterSignal:t?.unregisterSignal})},E=async()=>typeof window>`u`?!1:(await r.o).connect.prompt(location.origin).catch(()=>!1),D=async()=>typeof window>`u`?null:(await r.o).relay.prompt().catch(()=>null),O=new Set,k=e=>(O.add(e),()=>{O.delete(e)}),A=()=>{if(O.size===0)return!1;for(let e of[...O])try{e()}catch{}return!0},j=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},M=e.t({applyUpdate:()=>G,busyReasons:()=>W,onUpdate:()=>z,onUpdateTaken:()=>B,updateReady:()=>N}),N=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),P=new Set,F=!1,I=()=>{F=!0;for(let e of[...P])try{e()}catch{}},L=0,R=()=>{let e=r.c();e&&P.size!==0&&L!==e.epoch&&(L=e.epoch,F=!1,Promise.resolve(e.remote.shell?.onUpdate(I)).catch(()=>{L===e.epoch&&(L=0)}))};typeof window<`u`&&r.u(R);var z=async e=>{if(typeof window>`u`)return()=>{};if(P.add(e),F)try{e()}catch{}return R(),()=>{P.delete(e)}},B=e=>typeof window>`u`?()=>{}:k(e),V=0,H=!1,U=()=>{if(!A()&&!H){H=!0;try{location.reload()}catch{}}};typeof window<`u`&&r.u(()=>{let e=r.c();if(!e||V===e.epoch)return;V=e.epoch;let t=j(e.remote.shell,U);if(!t){V=0;return}t.catch(()=>{V===e.epoch&&(V=0)})});var W=()=>i.n(),G=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.BACKGROUND_STOPPED=n.a,exports.CATEGORIES=t.w,exports.EXTENSION_ABI=t.st,exports.ExtensionOperationUnsupportedError=t.ct,exports.ExtensionOutdatedError=t.lt,exports.FORGEABLE_HEADERS=t.Q,exports.FrameWindowBlockedError=t.g,exports.FrameWindowRefusedError=t._,exports.LOCATOR_DENIED=t.A,exports.LOCATOR_ERROR=t.F,exports.LOCATOR_INVALID=t.L,exports.LOCATOR_UNSUPPORTED=t.D,exports.MAX_REASON_LENGTH=t.X,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.ut,exports.TimeoutError=t.E,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return d.t}}),exports.assertAttachableFrameUrl=t.x,exports.assertFetchableUrl=t.U,exports.assertForgeableHeaders=t.$,exports.assertLockdownApplicable=t.S,exports.assertOneCookieIdentity=t.et,exports.attachFrame=S,exports.attachFramePermission=t.v,exports.box=t.pt,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return a.n}}),exports.connect=E,exports.connectButtonUrl=_.t,exports.cookies=t.V,exports.createFrame=t.y,exports.createVideoElementHandle=t.mt,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return c.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return n.t}}),exports.fetch=n.n,exports.fetchCredentialedPermission=t.G,exports.fetchLocalPermission=t.K,exports.fetchPermission=t.q,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return f.u}}),exports.gotoPermission=t.b,exports.handleRevivableModules=t.ft,exports.hasForgedCookie=t.tt,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return l.t}}),exports.isBackgroundStopped=n.o,exports.isBlockedFetchUrl=t.J,exports.isBlockedFrameUrl=t.C,exports.isExtensionExposed=t.rt,exports.isLocalNetworkUrl=t.Y,exports.isLocatorDenied=t.I,exports.isLocatorInvalid=t.M,exports.isLocatorUnsupported=t.O,exports.isPermissionDenied=t.n,exports.isTerminalError=t.P,exports.isType=t.ht,exports.modifyRequestHeadersPermission=t.R,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return p.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return m.t}}),exports.permissions=t.r,exports.promptInstall=n.i,exports.promptRelay=D,exports.readCookiePermission=t.H,exports.readExtensionHandshake=t.it,exports.relayWorker=T,exports.removeRequestHeaderRule=t.z,exports.revive=t.gt,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return h.t}}),exports.setMissingExtensionHandler=t.at,exports.setRequestHeaderRule=t.B,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"storage",{enumerable:!0,get:function(){return g.t}}),exports.supportsOperation=t.dt,exports.type=t._t,exports.waitForExtensionExposure=t.ot;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BiQ6cOZ7.cjs"),n=require("./extension-DA_Fx3Lx.cjs"),r=require("./api-BmaUJUUp.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./cloud-C_EPPfe_.cjs"),o=require("./dns.cjs"),s=require("./net.cjs"),c=require("./dgram.cjs"),l=require("./http.cjs"),u=require("./desktop.cjs"),d=require("./account.cjs"),f=require("./fs-C7ByWYF9.cjs"),p=require("./opfs.cjs"),m=require("./packages.cjs"),h=require("./rooms.cjs"),g=require("./storage.cjs"),_=require("./connect-button-BpXDs7tw.cjs");let v=require("osra");var y=1e4,b=150,x=()=>new Promise(e=>{if(t.rt())return e(!0);let n,r=setTimeout(()=>i(t.rt()),y),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.rt()),b)},o=new MutationObserver(()=>{t.rt()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.rt()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),S=(async e=>{let{kind:n,cookies:r}=t.o(e);if(n===`window`){let n=e;return r===`native`?t.a(n):a.i(n)}let i=e;return r===`native`?C(i):a.i(i)}),C=async e=>(a.a(e),await x(),t.a(e)),w=`https://fkn.app`,T=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let n=await r.f;if(!n)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);r.d(),i.r(`relayed worker`,t?.unregisterSignal);let a=n.emit instanceof MessagePort?{}:{originA:t?.originA??w,originB:t?.originB??`*`};(0,v.relay)(n,e,{key:`fkn-api`,...a,unregisterSignal:t?.unregisterSignal})},E=async()=>typeof window>`u`?!1:(await r.o).connect.prompt(location.origin).catch(()=>!1),D=async()=>typeof window>`u`?null:(await r.o).relay.prompt().catch(()=>null),O=new Set,k=e=>(O.add(e),()=>{O.delete(e)}),A=()=>{if(O.size===0)return!1;for(let e of[...O])try{e()}catch{}return!0},j=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},M=e.t({applyUpdate:()=>G,busyReasons:()=>W,onUpdate:()=>z,onUpdateTaken:()=>B,updateReady:()=>N}),N=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),P=new Set,F=!1,I=()=>{F=!0;for(let e of[...P])try{e()}catch{}},L=0,R=()=>{let e=r.c();e&&P.size!==0&&L!==e.epoch&&(L=e.epoch,F=!1,Promise.resolve(e.remote.shell?.onUpdate(I)).catch(()=>{L===e.epoch&&(L=0)}))};typeof window<`u`&&r.u(R);var z=async e=>{if(typeof window>`u`)return()=>{};if(P.add(e),F)try{e()}catch{}return R(),()=>{P.delete(e)}},B=e=>typeof window>`u`?()=>{}:k(e),V=0,H=!1,U=()=>{if(!A()&&!H){H=!0;try{location.reload()}catch{}}};typeof window<`u`&&r.u(()=>{let e=r.c();if(!e||V===e.epoch)return;V=e.epoch;let t=j(e.remote.shell,U);if(!t){V=0;return}t.catch(()=>{V===e.epoch&&(V=0)})});var W=()=>i.n(),G=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.BACKGROUND_STOPPED=n.a,exports.CATEGORIES=t.w,exports.EXTENSION_ABI=t.st,exports.ExtensionOperationUnsupportedError=t.ct,exports.ExtensionOutdatedError=t.lt,exports.FORGEABLE_HEADERS=t.Q,exports.FrameWindowBlockedError=t.g,exports.FrameWindowRefusedError=t._,exports.LOCATOR_DENIED=t.A,exports.LOCATOR_ERROR=t.F,exports.LOCATOR_INVALID=t.L,exports.LOCATOR_UNSUPPORTED=t.D,exports.MAX_REASON_LENGTH=t.X,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.ut,exports.TimeoutError=t.E,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return d.t}}),exports.assertAttachableFrameUrl=t.x,exports.assertFetchableUrl=t.U,exports.assertForgeableHeaders=t.$,exports.assertLockdownApplicable=t.S,exports.assertOneCookieIdentity=t.et,exports.attachFrame=S,exports.attachFramePermission=t.v,exports.box=t.pt,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return a.n}}),exports.connect=E,exports.connectButtonUrl=_.t,exports.cookies=t.V,exports.createFrame=t.y,exports.createVideoElementHandle=t.mt,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return c.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return n.t}}),exports.fetch=n.n,exports.fetchCredentialedPermission=t.G,exports.fetchLocalPermission=t.K,exports.fetchPermission=t.q,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return f.u}}),exports.gotoPermission=t.b,exports.handleRevivableModules=t.ft,exports.hasForgedCookie=t.tt,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return l.t}}),exports.isBackgroundStopped=n.o,exports.isBlockedFetchUrl=t.J,exports.isBlockedFrameUrl=t.C,exports.isExtensionExposed=t.rt,exports.isLocalNetworkUrl=t.Y,exports.isLocatorDenied=t.I,exports.isLocatorInvalid=t.M,exports.isLocatorUnsupported=t.O,exports.isPermissionDenied=t.n,exports.isTerminalError=t.P,exports.isType=t.ht,exports.modifyRequestHeadersPermission=t.R,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return p.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return m.t}}),exports.permissions=t.r,exports.promptInstall=n.i,exports.promptRelay=D,exports.readCookiePermission=t.H,exports.readExtensionHandshake=t.it,exports.relayWorker=T,exports.removeRequestHeaderRule=t.z,exports.revive=t.gt,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return h.t}}),exports.setMissingExtensionHandler=t.at,exports.setRequestHeaderRule=t.B,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"storage",{enumerable:!0,get:function(){return g.t}}),exports.supportsOperation=t.dt,exports.type=t._t,exports.waitForExtensionExposure=t.ot;
package/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
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, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, r as AttachFrameFunction, 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-BQ5OZQhf.js";
2
2
  import { $ as isLocatorDenied, A as setRequestHeaderRule, B as fetchLocalPermission, C as assertAttachableFrameUrl, D as RequestHeaderRule, E as HeaderOperation, F as FetchInit, G as assertForgeableHeaders, H as isBlockedFetchUrl, I as ProxyFetchRequest, J as LOCATOR_DENIED, K as assertOneCookieIdentity, L as assertFetchableUrl, M as SiteCookie, N as cookies, O as modifyRequestHeadersPermission, P as readCookiePermission, Q as TimeoutError, S as MAX_REASON_LENGTH, T as isBlockedFrameUrl, U as isLocalNetworkUrl, V as fetchPermission, W as FORGEABLE_HEADERS, X as LOCATOR_INVALID, Y as LOCATOR_ERROR, Z as LOCATOR_UNSUPPORTED, _ as BackgroundStoppedError, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorInvalid, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as CookieDetails, k as removeRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, nt as isTerminalError, o as isExtensionExposed, p as ExtensionOutdatedError, q as hasForgedCookie, s as readExtensionHandshake, t as extension_d_exports, tt as isLocatorUnsupported, u as EXTENSION_ABI, v as isBackgroundStopped, w as assertLockdownApplicable, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchCredentialedPermission } from "./extension-kE9yzbkW.js";
3
3
  import { t as account_d_exports } from "./account.js";
4
- import { n as cloud_d_exports } from "./cloud-S8hQywqV.js";
4
+ import { n as cloud_d_exports } from "./cloud-BslRIoKs.js";
5
5
  import { t as dns_d_exports } from "./dns.js";
6
- import { s as net_d_exports } from "./net-B8YQuB9E.js";
6
+ import { s as net_d_exports } from "./net-eEjhJ0AE.js";
7
7
  import { t as dgram_d_exports } from "./dgram.js";
8
8
  import { t as http_d_exports } from "./http.js";
9
9
  import { t as desktop_d_exports } from "./desktop.js";
package/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
2
  import { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as ee, I as te, J as ne, K as re, L as ie, M as ae, O as oe, P as se, Q as ce, R as le, S as ue, U as de, V as fe, X as l, Y as u, _ as d, _t as f, a as p, at as m, b as h, ct as g, dt as _, et as v, ft as y, g as b, gt as x, ht as S, i as C, it as w, lt as T, mt as E, n as D, o as O, ot as k, pt as A, q as j, r as M, rt as N, st as P, t as F, tt as I, ut as L, v as R, w as z, x as B, y as V, z as pe } from "./lib-BGAmzIcU.js";
3
- import { a as me, i as he, n as ge, o as _e, t as ve } from "./extension-BmqjgSIQ.js";
4
- import { c as H, d as ye, f as be, o as U, u as W } from "./api-BYtMzj8u.js";
3
+ import { a as me, i as he, n as ge, o as _e, t as ve } from "./extension-C13d41tq.js";
4
+ import { c as H, d as ye, f as be, o as U, u as W } from "./api-DEfkbHGB.js";
5
5
  import { n as xe, r as Se } from "./busy-DsMWrSzc.js";
6
- import { a as Ce, i as G, n as we } from "./cloud-8sJ1Sg8n.js";
6
+ import { a as Ce, i as G, n as we } from "./cloud-DTpFBbBH.js";
7
7
  import { t as Te } from "./dns.js";
8
8
  import { t as Ee } from "./net.js";
9
9
  import { t as De } from "./dgram.js";
10
10
  import { t as Oe } from "./http.js";
11
11
  import { t as ke } from "./desktop.js";
12
12
  import { t as Ae } from "./account.js";
13
- import { u as je } from "./fs-ohcMNiu2.js";
13
+ import { u as je } from "./fs-gryDP9qw.js";
14
14
  import { t as Me } from "./opfs.js";
15
15
  import { t as Ne } from "./packages.js";
16
16
  import { t as Pe } from "./rooms.js";
@@ -1,6 +1,6 @@
1
- import { K as Resolvers, Mt as TcpSocketListenerResult, Pt as TcpSocketResult } from "./contract-CMQOic3K.js";
1
+ import { It as TcpSocketListenerResult, K as Resolvers, Rt as TcpSocketResult } from "./contract-DFycgFJK.js";
2
2
  import { o as TcpSocketOption } from "./wire-Fk5pJaoy.js";
3
- import "./api-C-VvG5P-.js";
3
+ import "./api-BSpQkgnM.js";
4
4
  import { AddressInfo, ListenOptions, Server, ServerOpts, Socket, SocketConnectOpts, SocketConstructorOpts } from "net";
5
5
  import { DuplexOptions, Stream } from "stream";
6
6
  import { EventEmitter } from "events";