@fkn/lib 0.9.37 → 0.9.38

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.
@@ -1,5 +1,5 @@
1
1
  import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
2
- import { $ as RoomOpenOptions, A as OverlayState, C as InstallOptions, F as PickOptions, H as Resolvers, I as Placement, N as PackagesErrorCode, Ot as WriteData, R as ProxyFetchInit, St as UdpSocketOptions, T as IpFamily, X as RoomMailbox, Y as RoomJoinOptions, _t as TcpSocketListenerOptions, c as ConflictChoice, d as ConnectAvailability, et as RoomPermission, f as ConnectOptions, j as PackageQuery, l as ConflictRequest, nt as RoomsErrorCode, o as AdoptRequest, q as RoomEvent, s as AdoptState, v as FrameConsentAnswer, xt as UdpDatagram, y as FrameConsentRequest, yt as TcpSocketOptions, z as ProxyFetchInput } from "./contract-_nWuFitS.js";
2
+ import { A as OverlayState, C as InstallOptions, Ct as UdpSocketOptions, F as PickOptions, H as Resolvers, I as Placement, J as RoomEvent, N as PackagesErrorCode, R as ProxyFetchInit, St as UdpDatagram, T as IpFamily, W as RoomClaimOptions, X as RoomJoinOptions, Z as RoomMailbox, bt as TcpSocketOptions, c as ConflictChoice, d as ConnectAvailability, et as RoomOpenOptions, f as ConnectOptions, j as PackageQuery, kt as WriteData, l as ConflictRequest, o as AdoptRequest, rt as RoomsErrorCode, s as AdoptState, tt as RoomPermission, v as FrameConsentAnswer, vt as TcpSocketListenerOptions, y as FrameConsentRequest, z as ProxyFetchInput } from "./contract-InuLU8bI.js";
3
3
  import { Remote } from "osra";
4
4
  //#region src/api-epochs.d.ts
5
5
  type EpochListener<T> = (remote: T, epoch: number) => void;
@@ -380,7 +380,7 @@ declare const onApiEpoch: (listener: EpochListener<{
380
380
  } | {
381
381
  ok: true;
382
382
  }>;
383
- claim: () => Promise<{
383
+ claim: (options?: RoomClaimOptions | undefined) => Promise<{
384
384
  error: RoomsErrorCode;
385
385
  message: string;
386
386
  } | {
@@ -510,7 +510,7 @@ declare const onApiEpoch: (listener: EpochListener<{
510
510
  } | {
511
511
  ok: true;
512
512
  }>;
513
- claim: () => Promise<{
513
+ claim: (options?: RoomClaimOptions | undefined) => Promise<{
514
514
  error: RoomsErrorCode;
515
515
  message: string;
516
516
  } | {
@@ -640,7 +640,7 @@ declare const onApiEpoch: (listener: EpochListener<{
640
640
  } | {
641
641
  ok: true;
642
642
  }>;
643
- claim: () => Promise<{
643
+ claim: (options?: RoomClaimOptions | undefined) => Promise<{
644
644
  error: RoomsErrorCode;
645
645
  message: string;
646
646
  } | {
@@ -1093,7 +1093,7 @@ declare const currentApiEpoch: () => {
1093
1093
  } | {
1094
1094
  ok: true;
1095
1095
  }>;
1096
- claim: () => Promise<{
1096
+ claim: (options?: RoomClaimOptions | undefined) => Promise<{
1097
1097
  error: RoomsErrorCode;
1098
1098
  message: string;
1099
1099
  } | {
@@ -1223,7 +1223,7 @@ declare const currentApiEpoch: () => {
1223
1223
  } | {
1224
1224
  ok: true;
1225
1225
  }>;
1226
- claim: () => Promise<{
1226
+ claim: (options?: RoomClaimOptions | undefined) => Promise<{
1227
1227
  error: RoomsErrorCode;
1228
1228
  message: string;
1229
1229
  } | {
@@ -1353,7 +1353,7 @@ declare const currentApiEpoch: () => {
1353
1353
  } | {
1354
1354
  ok: true;
1355
1355
  }>;
1356
- claim: () => Promise<{
1356
+ claim: (options?: RoomClaimOptions | undefined) => Promise<{
1357
1357
  error: RoomsErrorCode;
1358
1358
  message: string;
1359
1359
  } | {
package/api.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { H as Resolvers } from "./contract-_nWuFitS.js";
2
- import { a as apiPromise, c as hasTransport, i as apiLastCall, l as onApiEpoch, n as BrokerUnreachableError, o as apiWithin, r as apiInFlight, s as currentApiEpoch, t as API_DEADLINE_MS } from "./api-CZI08srV.js";
1
+ import { H as Resolvers } from "./contract-InuLU8bI.js";
2
+ import { a as apiPromise, c as hasTransport, i as apiLastCall, l as onApiEpoch, n as BrokerUnreachableError, o as apiWithin, r as apiInFlight, s as currentApiEpoch, t as API_DEADLINE_MS } from "./api-DF4nHz2Q.js";
3
3
  export { API_DEADLINE_MS, BrokerUnreachableError, type Resolvers, apiInFlight, apiLastCall, apiPromise, apiWithin, currentApiEpoch, hasTransport, onApiEpoch };
package/cloud/dns.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { a as AddressLookupResult } from "../contract-_nWuFitS.js";
1
+ import { a as AddressLookupResult } from "../contract-InuLU8bI.js";
2
2
  import { lookup } from "../dns.js";
3
3
  export { type AddressLookupResult, lookup };
package/cloud/fetch.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as cloudFetch } from "../proxy-CrTXoFQK.js";
1
+ import { t as cloudFetch } from "../proxy-BkaVTZAf.js";
2
2
  export { cloudFetch as fetch };
package/cloud/net.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-eCY_QD4P.js";
1
+ import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-DnXxFGm8.js";
2
2
  export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
@@ -1,8 +1,8 @@
1
- import { r as AttachFrameFunction } from "./index-BUviSXsX.js";
2
- import { t as cloudFetch } from "./proxy-CrTXoFQK.js";
1
+ import { r as AttachFrameFunction } from "./index-DiOxvYoa.js";
2
+ import { t as cloudFetch } from "./proxy-BkaVTZAf.js";
3
3
  import { t as dns_d_exports } from "./dns.js";
4
4
  import { n as fs_d_exports } from "./fs--NhtUyYa.js";
5
- import { s as net_d_exports } from "./net-eCY_QD4P.js";
5
+ import { s as net_d_exports } from "./net-DnXxFGm8.js";
6
6
  import { t as dgram_d_exports } from "./dgram.js";
7
7
  import { t as http_d_exports } from "./http.js";
8
8
  //#region src/cloud/frame.d.ts
package/cloud.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { t as cloudFetch } from "./proxy-CrTXoFQK.js";
2
- import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-DCZv4XAf.js";
1
+ import { t as cloudFetch } from "./proxy-BkaVTZAf.js";
2
+ import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-Bfc6rkF2.js";
3
3
  import { t as dns_d_exports } from "./dns.js";
4
4
  import { n as fs_d_exports } from "./fs--NhtUyYa.js";
5
- import { s as net_d_exports } from "./net-eCY_QD4P.js";
5
+ import { s as net_d_exports } from "./net-DnXxFGm8.js";
6
6
  import { t as dgram_d_exports } from "./dgram.js";
7
7
  import { t as http_d_exports } from "./http.js";
8
8
  export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
@@ -1,4 +1,4 @@
1
- import { K as SelectorPart, v as GotoOptions } from "./index-BUviSXsX.js";
1
+ import { K as SelectorPart, v as GotoOptions } from "./index-DiOxvYoa.js";
2
2
  import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
3
3
  //#region src/contract.d.ts
4
4
  /** The signed-in account, or null when nobody is. */
@@ -406,7 +406,10 @@ type RoomMessage = {
406
406
  at: number;
407
407
  text: string;
408
408
  };
409
- /** What a claimed room's mailbox holds, as the room last said. Null for a room nobody has claimed. */
409
+ /**
410
+ * What a claimed room's mailbox holds, as the room last said. Null for a room nobody has claimed.
411
+ * `cap` is the most it stores: 500 MB, or the size limit the account set in its fkn.app settings.
412
+ */
410
413
  type RoomMailbox = {
411
414
  messages: number;
412
415
  bytes: number;
@@ -422,7 +425,9 @@ type RoomEvent =
422
425
  } | {
423
426
  type: 'edited';
424
427
  message: RoomMessage;
425
- } | {
428
+ } |
429
+ /** stored messages dropped: by a member, or all of them when the account clears the room in its fkn.app settings */
430
+ {
426
431
  type: 'deleted';
427
432
  from: number;
428
433
  to: number;
@@ -442,7 +447,10 @@ type RoomEvent =
442
447
  type: 'defaults';
443
448
  defaults: RoomDefaults;
444
449
  } |
445
- /** the room was claimed, released or dissolved; `owner` is the owner's member id, or '' while a claimed room's owner has never joined */
450
+ /**
451
+ * the room was claimed, released (by its app, or by the account in its fkn.app settings) or
452
+ * dissolved; `owner` is the owner's member id, or '' while a claimed room's owner has never joined
453
+ */
446
454
  {
447
455
  type: 'claim';
448
456
  claimed: boolean;
@@ -471,6 +479,18 @@ type RoomCreateOptions = RoomOpenOptions;
471
479
  type RoomJoinOptions = {
472
480
  signal?: AbortSignal;
473
481
  };
482
+ /** What a claim carries besides the name. */
483
+ type RoomClaimOptions = {
484
+ /**
485
+ * What the room is for, in the app's own words. The account reads it beside the room in its fkn.app
486
+ * settings, where it can clear or unclaim the room, so say what would be lost. One line of plain text:
487
+ * trimmed, then 1 to 200 characters as `String.length` counts them, with no control character, line or
488
+ * paragraph separator, or bidi control; anything else is refused `invalid`, never cut short. Not sealed:
489
+ * stored with the claim and shown to the account only. Claiming again with one replaces it, from the app
490
+ * that claimed the room only (the same app once it is verified); claiming without one keeps it.
491
+ */
492
+ description?: string;
493
+ };
474
494
  /** What a backlog page answered: the highest seq it sent, and whether another page follows. */
475
495
  type RoomBacklog = {
476
496
  last: number;
@@ -533,8 +553,11 @@ type RoomHandle = {
533
553
  unblock: (id: string) => Promise<RoomsFail | {
534
554
  ok: true;
535
555
  }>;
536
- /** keeps the name and a mailbox for the signed-in premium account; the only thing in rooms that premium buys */
537
- claim: () => Promise<RoomsFail | {
556
+ /**
557
+ * keeps the name and a mailbox for the signed-in premium account; the only thing in rooms that premium
558
+ * buys. `description` says what the room is for, shown to the account in its fkn.app settings.
559
+ */
560
+ claim: (options?: RoomClaimOptions) => Promise<RoomsFail | {
538
561
  ok: true;
539
562
  }>;
540
563
  release: () => Promise<RoomsFail | {
@@ -799,4 +822,4 @@ type Resolvers = {
799
822
  hideInstallPrompt: () => void;
800
823
  };
801
824
  //#endregion
802
- export { RoomOpenOptions as $, OverlayState as A, Quota as B, InstallOptions as C, UdpSocketResult as Ct, MiddleControl as D, WindowMiddleControl as Dt, JAR_ANCHOR_MESSAGE as E, WINDOW_JAR_MODE_TIMEOUT_MS as Et, PickOptions as F, RoomDefaults as G, Resolvers as H, Placement as I, RoomHandle as J, RoomEnd as K, ProxyFetch as L, PackageResult as M, PackagesErrorCode as N, MountDescriptor as O, WriteData as Ot, PackagesFail as P, RoomMessage as Q, ProxyFetchInit as R, HiddenSurface as S, UdpSocketOptions as St, IpFamily as T, WINDOW_HELLO_TIMEOUT_MS as Tt, RoomBacklog as U, Radii as V, RoomCreateOptions as W, RoomMailbox as X, RoomJoinOptions as Y, RoomMember as Z, FRAME_MESSAGE as _, TcpSocketListenerOptions as _t, AddressLookupResult as a, SHELL_CONTROL_KEY as at, FrameFetchScope as b, TcpSocketResult as bt, ConflictChoice as c, SHELL_JAR_UNREACHABLE as ct, ConnectAvailability as d, ShellFrameMessage as dt, RoomPermission as et, ConnectOptions as f, ShellGotoOptions as ft, EncryptionState as g, SurfaceRect as gt, DnsLookup as h, StorageQuota as ht, Account as i, SHELL_ATTACH_ERROR as it, PackageQuery as j, OverlayRect as k, ConflictRequest as l, SetOverlayHost as lt, DisplayLevel as m, StorageEntry as mt, ATTACH_WINDOW_KEY as n, RoomsErrorCode as nt, AdoptRequest as o, SHELL_FRAME_MESSAGE as ot, DisplayCause as p, ShellJarUnreachable as pt, RoomEvent as q, ATTACH_WINDOW_MESSAGE as r, RoomsFail as rt, AdoptState as s, SHELL_JAR_MESSAGE as st, ATTACH_FRAME_KEY as t, RoomPermissions as tt, ConflictSide as u, ShellControl as ut, FrameConsentAnswer as v, TcpSocketListenerResult as vt, InstalledPackage as w, WINDOW_HANDSHAKE_TIMEOUT_MS as wt, FrameMessageRelay as x, UdpDatagram as xt, FrameConsentRequest as y, TcpSocketOptions as yt, ProxyFetchInput as z };
825
+ export { RoomMessage as $, OverlayState as A, Quota as B, InstallOptions as C, UdpSocketOptions as Ct, MiddleControl as D, WINDOW_JAR_MODE_TIMEOUT_MS as Dt, JAR_ANCHOR_MESSAGE as E, WINDOW_HELLO_TIMEOUT_MS as Et, PickOptions as F, RoomCreateOptions as G, Resolvers as H, Placement as I, RoomEvent as J, RoomDefaults as K, ProxyFetch as L, PackageResult as M, PackagesErrorCode as N, MountDescriptor as O, WindowMiddleControl as Ot, PackagesFail as P, RoomMember as Q, ProxyFetchInit as R, HiddenSurface as S, UdpDatagram as St, IpFamily as T, WINDOW_HANDSHAKE_TIMEOUT_MS as Tt, RoomBacklog as U, Radii as V, RoomClaimOptions as W, RoomJoinOptions as X, RoomHandle as Y, RoomMailbox as Z, FRAME_MESSAGE as _, SurfaceRect as _t, AddressLookupResult as a, SHELL_ATTACH_ERROR as at, FrameFetchScope as b, TcpSocketOptions as bt, ConflictChoice as c, SHELL_JAR_MESSAGE as ct, ConnectAvailability as d, ShellControl as dt, RoomOpenOptions as et, ConnectOptions as f, ShellFrameMessage as ft, EncryptionState as g, StorageQuota as gt, DnsLookup as h, StorageEntry as ht, Account as i, RoomsFail as it, PackageQuery as j, OverlayRect as k, WriteData as kt, ConflictRequest as l, SHELL_JAR_UNREACHABLE as lt, DisplayLevel as m, ShellJarUnreachable as mt, ATTACH_WINDOW_KEY as n, RoomPermissions as nt, AdoptRequest as o, SHELL_CONTROL_KEY as ot, DisplayCause as p, ShellGotoOptions as pt, RoomEnd as q, ATTACH_WINDOW_MESSAGE as r, RoomsErrorCode as rt, AdoptState as s, SHELL_FRAME_MESSAGE as st, ATTACH_FRAME_KEY as t, RoomPermission as tt, ConflictSide as u, SetOverlayHost as ut, FrameConsentAnswer as v, TcpSocketListenerOptions as vt, InstalledPackage as w, UdpSocketResult as wt, FrameMessageRelay as x, TcpSocketResult as xt, FrameConsentRequest as y, TcpSocketListenerResult as yt, ProxyFetchInput as z };
package/contract.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
2
- import { $ as RoomOpenOptions, A as OverlayState, B as Quota, C as InstallOptions, Ct as UdpSocketResult, D as MiddleControl, Dt as WindowMiddleControl, E as JAR_ANCHOR_MESSAGE, Et as WINDOW_JAR_MODE_TIMEOUT_MS, F as PickOptions, G as RoomDefaults, H as Resolvers, I as Placement, J as RoomHandle, K as RoomEnd, L as ProxyFetch, M as PackageResult, N as PackagesErrorCode, O as MountDescriptor, Ot as WriteData, P as PackagesFail, Q as RoomMessage, R as ProxyFetchInit, S as HiddenSurface, St as UdpSocketOptions, T as IpFamily, Tt as WINDOW_HELLO_TIMEOUT_MS, U as RoomBacklog, V as Radii, W as RoomCreateOptions, X as RoomMailbox, Y as RoomJoinOptions, Z as RoomMember, _ as FRAME_MESSAGE, _t as TcpSocketListenerOptions, a as AddressLookupResult, at as SHELL_CONTROL_KEY, b as FrameFetchScope, bt as TcpSocketResult, c as ConflictChoice, ct as SHELL_JAR_UNREACHABLE, d as ConnectAvailability, dt as ShellFrameMessage, et as RoomPermission, f as ConnectOptions, ft as ShellGotoOptions, g as EncryptionState, gt as SurfaceRect, h as DnsLookup, ht as StorageQuota, i as Account, it as SHELL_ATTACH_ERROR, j as PackageQuery, k as OverlayRect, l as ConflictRequest, lt as SetOverlayHost, m as DisplayLevel, mt as StorageEntry, n as ATTACH_WINDOW_KEY, nt as RoomsErrorCode, o as AdoptRequest, ot as SHELL_FRAME_MESSAGE, p as DisplayCause, pt as ShellJarUnreachable, q as RoomEvent, r as ATTACH_WINDOW_MESSAGE, rt as RoomsFail, s as AdoptState, st as SHELL_JAR_MESSAGE, t as ATTACH_FRAME_KEY, tt as RoomPermissions, u as ConflictSide, ut as ShellControl, v as FrameConsentAnswer, vt as TcpSocketListenerResult, w as InstalledPackage, wt as WINDOW_HANDSHAKE_TIMEOUT_MS, x as FrameMessageRelay, xt as UdpDatagram, y as FrameConsentRequest, yt as TcpSocketOptions, z as ProxyFetchInput } from "./contract-_nWuFitS.js";
3
- export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, MiddleControl, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, Radii, Resolvers, RoomBacklog, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
2
+ import { $ as RoomMessage, A as OverlayState, B as Quota, C as InstallOptions, Ct as UdpSocketOptions, D as MiddleControl, Dt as WINDOW_JAR_MODE_TIMEOUT_MS, E as JAR_ANCHOR_MESSAGE, Et as WINDOW_HELLO_TIMEOUT_MS, F as PickOptions, G as RoomCreateOptions, H as Resolvers, I as Placement, J as RoomEvent, K as RoomDefaults, L as ProxyFetch, M as PackageResult, N as PackagesErrorCode, O as MountDescriptor, Ot as WindowMiddleControl, P as PackagesFail, Q as RoomMember, R as ProxyFetchInit, S as HiddenSurface, St as UdpDatagram, T as IpFamily, Tt as WINDOW_HANDSHAKE_TIMEOUT_MS, U as RoomBacklog, V as Radii, W as RoomClaimOptions, X as RoomJoinOptions, Y as RoomHandle, Z as RoomMailbox, _ as FRAME_MESSAGE, _t as SurfaceRect, a as AddressLookupResult, at as SHELL_ATTACH_ERROR, b as FrameFetchScope, bt as TcpSocketOptions, c as ConflictChoice, ct as SHELL_JAR_MESSAGE, d as ConnectAvailability, dt as ShellControl, et as RoomOpenOptions, f as ConnectOptions, ft as ShellFrameMessage, g as EncryptionState, gt as StorageQuota, h as DnsLookup, ht as StorageEntry, i as Account, it as RoomsFail, j as PackageQuery, k as OverlayRect, kt as WriteData, l as ConflictRequest, lt as SHELL_JAR_UNREACHABLE, m as DisplayLevel, mt as ShellJarUnreachable, n as ATTACH_WINDOW_KEY, nt as RoomPermissions, o as AdoptRequest, ot as SHELL_CONTROL_KEY, p as DisplayCause, pt as ShellGotoOptions, q as RoomEnd, r as ATTACH_WINDOW_MESSAGE, rt as RoomsErrorCode, s as AdoptState, st as SHELL_FRAME_MESSAGE, t as ATTACH_FRAME_KEY, tt as RoomPermission, u as ConflictSide, ut as SetOverlayHost, v as FrameConsentAnswer, vt as TcpSocketListenerOptions, w as InstalledPackage, wt as UdpSocketResult, x as FrameMessageRelay, xt as TcpSocketResult, y as FrameConsentRequest, yt as TcpSocketListenerResult, z as ProxyFetchInput } from "./contract-InuLU8bI.js";
3
+ export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, MiddleControl, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, Radii, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
package/dgram.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { v as UdpSocketOption } from "./wire-Gbo-D74t.js";
2
- import { Ct as UdpSocketResult, H as Resolvers } from "./contract-_nWuFitS.js";
3
- import "./api-CZI08srV.js";
2
+ import { H as Resolvers, wt as UdpSocketResult } from "./contract-InuLU8bI.js";
3
+ import "./api-DF4nHz2Q.js";
4
4
  import { Buffer } from "buffer";
5
5
  import { AddressInfo } from "net";
6
6
  import { EventEmitter } from "events";
package/dns.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as AddressLookupResult } from "./contract-_nWuFitS.js";
1
+ import { a as AddressLookupResult } from "./contract-InuLU8bI.js";
2
2
  declare namespace dns_d_exports {
3
3
  export { AddressLookupResult, lookup };
4
4
  }
@@ -1,4 +1,4 @@
1
- import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, n as attachFrame, o as Frame, p as FramePostMessageOptions, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-BUviSXsX.js";
1
+ import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, n as attachFrame, o as Frame, p as FramePostMessageOptions, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-DiOxvYoa.js";
2
2
  //#region ../frame-locator/lib/errors.d.ts
3
3
  declare const LOCATOR_ERROR = "LocatorError";
4
4
  declare const LOCATOR_UNSUPPORTED = "LocatorUnsupportedError";
package/extension.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, n as attachFrame, o as Frame, p as FramePostMessageOptions, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-BUviSXsX.js";
2
- import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, P as fetch, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-CqOhrS15.js";
1
+ import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, n as attachFrame, o as Frame, p as FramePostMessageOptions, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-DiOxvYoa.js";
2
+ import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, P as fetch, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, a as extension, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, r as isExtensionAvailable, s as readExtensionHandshake, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-Bm5x5R4R.js";
3
3
  export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, AttachWindowOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, WindowFrame, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, supportsOperation, type, waitForExtensionExposure };
package/http.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as Socket, t as Server$1 } from "./net-eCY_QD4P.js";
1
+ import { n as Socket, t as Server$1 } from "./net-DnXxFGm8.js";
2
2
  import { Buffer } from "buffer";
3
3
  import { Stream } from "stream";
4
4
  import { IncomingHttpHeaders, OutgoingHttpHeaders, RequestOptions } from "http";
@@ -904,6 +904,24 @@ declare const gotoPermission: {
904
904
  readonly description: 'Lets the app navigate to another site without leaving its window.';
905
905
  };
906
906
  type GotoOptions = {
907
+ /**
908
+ * When `goto` resolves: `'load'`, the default, once the document it brings fired load;
909
+ * `'documentstart'` once that document has started, possibly before the page's own scripts ran.
910
+ * Either way a call made after it runs on the document the goto brought, never on the one it
911
+ * replaced. On the cloud backend a `'documentstart'` goto resolves before its document commits: an
912
+ * `evaluate` or `postMessage` made after it waits for that document, and a locator call retries
913
+ * until it comes, each within its own timeout. If that document has not come by the goto's deadline,
914
+ * `evaluate` and `postMessage` reject, and a locator call runs on whatever document the frame holds,
915
+ * since the goto itself already resolved; on the extension the goto rejects instead.
916
+ *
917
+ * A goto that changes only the fragment of the url the page is at keeps its document. On the cloud
918
+ * backend one awaited to `'load'` resolves once the page reports the new fragment, and a call made
919
+ * after one awaited to `'documentstart'` waits only until then. Two pages are the exception there,
920
+ * where such a goto brings a new document like any other: one reached through a redirect, and one
921
+ * that followed a link onto another origin. On the extension (measured on Chromium) one awaited to
922
+ * `'load'` resolves, since the frame fires load for it, and one awaited to `'documentstart'` runs
923
+ * out at its timeout, since no new document starts.
924
+ */
907
925
  waitUntil?: 'documentstart' | 'load';
908
926
  domains?: string[];
909
927
  };
@@ -992,6 +1010,12 @@ type Frame = Omit<FrameLocator<LocatorModules>, 'evaluate'> & {
992
1010
  * Needs the Evaluation grant on both backends; an app without it is refused by name. It runs on the
993
1011
  * attached frame only: a chain into a nested frame (`frameLocator(...).evaluate`) is refused.
994
1012
  *
1013
+ * Called after `goto` resolved, whichever `waitUntil`, it runs once on the document that goto
1014
+ * brought, never on the one it replaced. On the cloud backend the call waits for that document when
1015
+ * it has not committed yet, and the wait counts toward the 30 seconds; if it has not come by the
1016
+ * goto's own deadline (the goto failed, or loaded something that is not a page), or the app started
1017
+ * another goto first, the call rejects with a `LocatorError` saying the code was not run.
1018
+ *
995
1019
  * On the extension it also needs an extension new enough to run code (ABI 3, older ones are refused
996
1020
  * with `ExtensionOperationUnsupportedError`), and it runs where the page's content security policy
997
1021
  * allows it: a frame whose host the app declared has its CSP replaced, so code runs; an undeclared
@@ -1014,7 +1038,8 @@ type Frame = Omit<FrameLocator<LocatorModules>, 'evaluate'> & {
1014
1038
  *
1015
1039
  * It resolves once the message was handed to the browser for the document the frame holds, in the
1016
1040
  * order the calls were made. That says nothing about whether the page listened, and a message
1017
- * dropped for its origin resolves the same way.
1041
+ * dropped for its origin resolves the same way. Sent after `goto` resolved, it goes to the document
1042
+ * that goto brought, as `evaluate` runs there.
1018
1043
  *
1019
1044
  * Refused, and never sent again. On the cloud backend a refusal that depends on the grant or on the
1020
1045
  * frame's document comes after `transfer` was detached, and loses what it moved with the message;
@@ -1030,8 +1055,9 @@ type Frame = Omit<FrameLocator<LocatorModules>, 'evaluate'> & {
1030
1055
  * own traffic and a port handed over is a live channel into the page.
1031
1056
  * - cloud, `LocatorUnsupportedError`: an FKN page or render proxy that predates messaging.
1032
1057
  * - cloud, `LocatorError`: the document changed during the call, so the message may or may not have
1033
- * reached it and is not sent to the next one; or the app's own `goto` is still in flight, so await
1034
- * it first.
1058
+ * reached it and is not sent to the next one; or the document of the goto before it had not come
1059
+ * by that goto's deadline (the goto failed, or loaded something that is not a page) or before the
1060
+ * app started another goto, so nothing was sent.
1035
1061
  * - extension, `LocatorUnsupportedError`: `'*'`, which needs an extension release that reports the
1036
1062
  * frame's origin. Pass the origin.
1037
1063
  * - the terminal detach error once the attachment ended.
package/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { t as account_d_exports } from "./account.js";
2
- import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, o as Frame, p as FramePostMessageOptions, r as AttachFrameFunction, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-BUviSXsX.js";
3
- import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-CqOhrS15.js";
4
- import { n as cloud_d_exports } from "./cloud-DCZv4XAf.js";
2
+ import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, o as Frame, p as FramePostMessageOptions, r as AttachFrameFunction, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-DiOxvYoa.js";
3
+ import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-Bm5x5R4R.js";
4
+ import { n as cloud_d_exports } from "./cloud-Bfc6rkF2.js";
5
5
  import { t as dns_d_exports } from "./dns.js";
6
6
  import { u as index_d_exports } from "./index-kuPqkS_-.js";
7
- import { s as net_d_exports } from "./net-eCY_QD4P.js";
7
+ import { s as net_d_exports } from "./net-DnXxFGm8.js";
8
8
  import { t as dgram_d_exports } from "./dgram.js";
9
9
  import { t as http_d_exports } from "./http.js";
10
10
  import { t as desktop_d_exports } from "./desktop.js";
@@ -1,6 +1,6 @@
1
1
  import { o as TcpSocketOption } from "./wire-Gbo-D74t.js";
2
- import { H as Resolvers, bt as TcpSocketResult, vt as TcpSocketListenerResult } from "./contract-_nWuFitS.js";
3
- import "./api-CZI08srV.js";
2
+ import { H as Resolvers, xt as TcpSocketResult, yt as TcpSocketListenerResult } from "./contract-InuLU8bI.js";
3
+ import "./api-DF4nHz2Q.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";
package/net.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-eCY_QD4P.js";
1
+ import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "./net-DnXxFGm8.js";
2
2
  export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkn/lib",
3
- "version": "0.9.37",
3
+ "version": "0.9.38",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
package/packages.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as InstallOptions, F as PickOptions, I as Placement, M as PackageResult, N as PackagesErrorCode, V as Radii, f as ConnectOptions, gt as SurfaceRect, j as PackageQuery, w as InstalledPackage } from "./contract-_nWuFitS.js";
1
+ import { C as InstallOptions, F as PickOptions, I as Placement, M as PackageResult, N as PackagesErrorCode, V as Radii, _t as SurfaceRect, f as ConnectOptions, j as PackageQuery, w as InstalledPackage } from "./contract-InuLU8bI.js";
2
2
  import { Remote } from "osra";
3
3
  declare namespace packages_d_exports {
4
4
  export { AppConnectOptions, Connect, ConnectOptions, ConnectPayload, IncomingConnection, IncomingConnectionInfo, InstallOptions, InstalledPackage, MountOptions, MountedPackage, PackageConnection, PackageQuery, PackageResult, PackageView, PackagesError, PackagesErrorCode, PickOptions, Placement, Radii, RawPackageConnection, ShowOptions, SurfaceRect, attach, connect, hide, install, isVisible, list, mount, onConnect, onVisibilityChange, pick, search, show, uninstall };
@@ -1,5 +1,5 @@
1
- import { H as Resolvers } from "./contract-_nWuFitS.js";
2
- import "./api-CZI08srV.js";
1
+ import { H as Resolvers } from "./contract-InuLU8bI.js";
2
+ import "./api-DF4nHz2Q.js";
3
3
  //#region src/proxy.d.ts
4
4
  type ProxyFetch = Resolvers['cloud']['fetch'];
5
5
  type FetchParameters = Parameters<ProxyFetch>;
package/rooms.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-Djf-XdZ4.cjs"),n=require("./busy-Dv8wzE5M.cjs");var r=e.t({available:()=>f,create:()=>m,join:()=>h,open:()=>p}),i={wrongKey:`rooms: wrong room key`,inviteNoKey:`rooms: the invite carries no key`,badName:`rooms: the name is not one a room can have`,badKeyOption:`rooms: the key is not 32 bytes base64url`,noSuchMember:`rooms: no such member`,noSuchMessage:`rooms: no such message`,roomFull:`rooms: the room is full`,tooManyConnections:`rooms: too many connections`,tooManyBlocks:`rooms: too many blocks`,tooManyClaims:`rooms: too many claims`,mailboxFull:`rooms: the mailbox is full`,outOfStorage:`rooms: the owner is out of storage`,outOfQuota:`rooms: out of daily bandwidth`,blocked:`rooms: you are blocked from this room`,cannotSend:`rooms: you cannot send here`,permissionDenied:`rooms: permission denied`,notOwner:`rooms: not the room owner`,ownerNotRemovable:`rooms: the owner cannot be removed`,ownerKeepsEvery:`rooms: the owner keeps every permission`,removeYourself:`rooms: you cannot remove yourself`,needsAccount:`rooms: claiming needs an account`,needsPremium:`rooms: claiming needs premium`,nameClaimed:`rooms: the name is claimed`,notClaimed:`rooms: the room is not claimed`,noMailbox:`rooms: the room keeps no messages`,badLimit:`rooms: the limit is out of range`,tooFast:`rooms: sending too fast`,tooLarge:`rooms: the message is too large`,unavailable:`rooms: rooms are unavailable`,notEnabled:`rooms: rooms are not available`,alreadyJoined:`rooms: already joined`,notJoined:`rooms: not joined`,malformed:`rooms: malformed frame`,ended:`rooms: the room has ended`},a=(e,t)=>Object.assign(Error(t),{code:e}),o=e=>e instanceof Error&&typeof e.code==`string`,s={send:!0,receive:!0,maxMessageBytes:262144},c=async()=>{if(!t.c)return;let e=(await t.o(`a room`).catch(()=>void 0))?.rooms;return typeof e?.open==`function`?e:void 0},l=()=>{throw a(`unavailable`,i.unavailable)},u=e=>e===`blocked`?`blocked`:e===`not-found`?`ended`:`unavailable`,d=async e=>{let r=e.invite,c=e,l=0,d=e.self,f=e.owner,p=e.claimed,m=e.mailbox,h=await e.defaults().catch(()=>s),g=!1,_=new Set,v=new Set,y=n.t(`room`),b=()=>{},x=()=>{},S=new Promise(e=>{x=e}),C=e=>{let t=[...v];v.clear();for(let n of t)try{n(e)}catch{}},w=e=>{g||(g=!0,b(),_.clear(),y(),C(a(`closed`,i.ended)),x({reason:e}))},T=e=>{if(!g){e.type===`defaults`&&(h=e.defaults),e.type===`permissions`&&e.id===d.id&&(d={id:d.id,permissions:e.permissions,maxMessageBytes:e.maxMessageBytes}),e.type===`claim`&&(p=e.claimed,f=e.owner,p||(m=null));for(let t of[..._])try{t(e)}catch{}}},E=(e,t)=>{Promise.resolve(e.on(T)).catch(()=>{}),Promise.resolve(e.closed).then(e=>{t===l&&w(e.reason)},()=>{})},D=async(e,t)=>{if(typeof e?.join!=`function`)return w(`unavailable`);let n=await e.join(r).catch(()=>void 0);if(g||t!==l)return;if(!n)return w(`unavailable`);if(`error`in n)return w(u(n.error));if(n.self.id!==d.id)return Promise.resolve(n.leave()).catch(()=>{}),w(`unavailable`);c=n,d=n.self,f=n.owner,p=n.claimed,m=n.mailbox,E(n,t);let i=await n.defaults().catch(()=>void 0);i&&!g&&t===l&&(h=i)};b=t.l((e,t)=>{let n=l;l=t,!(g||n===0||n===t)&&(C(a(`unavailable`,i.unavailable)),D(e.rooms,t))}),E(e,l);let O=async e=>{if(g)throw a(`closed`,i.ended);let t=()=>{},n=new Promise((e,n)=>{t=n});v.add(t);try{return await Promise.race([Promise.resolve(e(c)),n])}catch(e){throw o(e)?e:a(`unavailable`,i.unavailable)}finally{v.delete(t)}},k=async e=>{let t=await O(e);if(`error`in t)throw a(t.error,t.message)},A=async e=>{let t=await O(e);if(typeof t==`object`&&t&&`error`in t)throw a(t.error,t.message);return t};return{id:e.id,name:e.name,key:e.key,invite:r,get self(){return d},get owner(){return f},get claimed(){return p},get mailbox(){return m},defaults:()=>h,members:()=>O(e=>e.members()),send:e=>k(t=>t.send(e)),edit:(e,t)=>k(n=>n.edit(e,t)),delete:(e,t)=>k(n=>n.delete(e,t)),backlog:(e,t)=>A(n=>n.backlog(e,t)),setDefault:(e,t)=>k(n=>n.setDefault(e,t)),limit:(e,t)=>k(n=>n.limit(e,t)),grant:(e,t)=>k(n=>n.grant(e,t)),revoke:(e,t)=>k(n=>n.revoke(e,t)),remove:e=>k(t=>t.remove(e)),block:e=>k(t=>t.block(e)),unblock:e=>k(t=>t.unblock(e)),claim:()=>k(e=>e.claim()),release:()=>k(e=>e.release()),usage:async()=>{let e=await A(e=>e.usage());return m=e,e},on:async e=>g?()=>{}:(_.add(e),()=>{_.delete(e)}),leave:async()=>{await Promise.resolve(c.leave()).catch(()=>{}),w(`left`)},closed:S}},f=async()=>{let e=await c();return e?e.available().catch(()=>!1):!1},p=async(e,t)=>{if(typeof e!=`string`||e.length===0||e.length>72)throw a(`invalid`,i.badName);let n=await c();if(!n)throw a(`unavailable`,i.unavailable);let r=await n.open(e,t).catch(l);if(`error`in r)throw a(r.error,r.message);return d(r)},m=async e=>{let t=await c();if(!t)throw a(`unavailable`,i.unavailable);let n=await t.create(e).catch(l);if(`error`in n)throw a(n.error,n.message);return d(n)},h=async(e,t)=>{let n=typeof e==`string`?e.indexOf(`.`):-1;if(n<=0||n===e.length-1)throw a(`invalid`,i.inviteNoKey);let r=await c();if(!r)throw a(`unavailable`,i.unavailable);let o=await r.join(e,t).catch(l);if(`error`in o)throw a(o.error,o.message);return d(o)};exports.available=f,exports.create=m,exports.join=h,exports.open=p,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-Djf-XdZ4.cjs"),n=require("./busy-Dv8wzE5M.cjs");var r=e.t({available:()=>f,create:()=>m,join:()=>h,open:()=>p}),i={wrongKey:`rooms: wrong room key`,inviteNoKey:`rooms: the invite carries no key`,badName:`rooms: the name is not one a room can have`,badKeyOption:`rooms: the key is not 32 bytes base64url`,noSuchMember:`rooms: no such member`,noSuchMessage:`rooms: no such message`,roomFull:`rooms: the room is full`,tooManyConnections:`rooms: too many connections`,tooManyBlocks:`rooms: too many blocks`,tooManyClaims:`rooms: too many claims`,mailboxFull:`rooms: the mailbox is full`,outOfStorage:`rooms: the owner is out of storage`,outOfQuota:`rooms: out of daily bandwidth`,blocked:`rooms: you are blocked from this room`,cannotSend:`rooms: you cannot send here`,permissionDenied:`rooms: permission denied`,notOwner:`rooms: not the room owner`,ownerNotRemovable:`rooms: the owner cannot be removed`,ownerKeepsEvery:`rooms: the owner keeps every permission`,removeYourself:`rooms: you cannot remove yourself`,needsAccount:`rooms: claiming needs an account`,needsPremium:`rooms: claiming needs premium`,nameClaimed:`rooms: the name is claimed`,notClaimed:`rooms: the room is not claimed`,noMailbox:`rooms: the room keeps no messages`,badLimit:`rooms: the limit is out of range`,badDescription:`rooms: the description is not one a claim can carry`,notClaimer:`rooms: only the app that claimed the room can describe it`,notReleaser:`rooms: only the app that claimed the room can release it`,tooFast:`rooms: sending too fast`,tooLarge:`rooms: the message is too large`,unavailable:`rooms: rooms are unavailable`,notEnabled:`rooms: rooms are not available`,alreadyJoined:`rooms: already joined`,notJoined:`rooms: not joined`,malformed:`rooms: malformed frame`,ended:`rooms: the room has ended`},a=(e,t)=>Object.assign(Error(t),{code:e}),o=e=>e instanceof Error&&typeof e.code==`string`,s={send:!0,receive:!0,maxMessageBytes:262144},c=async()=>{if(!t.c)return;let e=(await t.o(`a room`).catch(()=>void 0))?.rooms;return typeof e?.open==`function`?e:void 0},l=()=>{throw a(`unavailable`,i.unavailable)},u=e=>e===`blocked`?`blocked`:e===`not-found`?`ended`:`unavailable`,d=async e=>{let r=e.invite,c=e,l=0,d=e.self,f=e.owner,p=e.claimed,m=e.mailbox,h=await e.defaults().catch(()=>s),g=!1,_=new Set,v=new Set,y=n.t(`room`),b=()=>{},x=()=>{},S=new Promise(e=>{x=e}),C=e=>{let t=[...v];v.clear();for(let n of t)try{n(e)}catch{}},w=e=>{g||(g=!0,b(),_.clear(),y(),C(a(`closed`,i.ended)),x({reason:e}))},T=e=>{if(!g){e.type===`defaults`&&(h=e.defaults),e.type===`permissions`&&e.id===d.id&&(d={id:d.id,permissions:e.permissions,maxMessageBytes:e.maxMessageBytes}),e.type===`claim`&&(p=e.claimed,f=e.owner,p||(m=null));for(let t of[..._])try{t(e)}catch{}}},E=(e,t)=>{Promise.resolve(e.on(T)).catch(()=>{}),Promise.resolve(e.closed).then(e=>{t===l&&w(e.reason)},()=>{})},D=async(e,t)=>{if(typeof e?.join!=`function`)return w(`unavailable`);let n=await e.join(r).catch(()=>void 0);if(g||t!==l)return;if(!n)return w(`unavailable`);if(`error`in n)return w(u(n.error));if(n.self.id!==d.id)return Promise.resolve(n.leave()).catch(()=>{}),w(`unavailable`);c=n,d=n.self,f=n.owner,p=n.claimed,m=n.mailbox,E(n,t);let i=await n.defaults().catch(()=>void 0);i&&!g&&t===l&&(h=i)};b=t.l((e,t)=>{let n=l;l=t,!(g||n===0||n===t)&&(C(a(`unavailable`,i.unavailable)),D(e.rooms,t))}),E(e,l);let O=async e=>{if(g)throw a(`closed`,i.ended);let t=()=>{},n=new Promise((e,n)=>{t=n});v.add(t);try{return await Promise.race([Promise.resolve(e(c)),n])}catch(e){throw o(e)?e:a(`unavailable`,i.unavailable)}finally{v.delete(t)}},k=async e=>{let t=await O(e);if(`error`in t)throw a(t.error,t.message)},A=async e=>{let t=await O(e);if(typeof t==`object`&&t&&`error`in t)throw a(t.error,t.message);return t};return{id:e.id,name:e.name,key:e.key,invite:r,get self(){return d},get owner(){return f},get claimed(){return p},get mailbox(){return m},defaults:()=>h,members:()=>O(e=>e.members()),send:e=>k(t=>t.send(e)),edit:(e,t)=>k(n=>n.edit(e,t)),delete:(e,t)=>k(n=>n.delete(e,t)),backlog:(e,t)=>A(n=>n.backlog(e,t)),setDefault:(e,t)=>k(n=>n.setDefault(e,t)),limit:(e,t)=>k(n=>n.limit(e,t)),grant:(e,t)=>k(n=>n.grant(e,t)),revoke:(e,t)=>k(n=>n.revoke(e,t)),remove:e=>k(t=>t.remove(e)),block:e=>k(t=>t.block(e)),unblock:e=>k(t=>t.unblock(e)),claim:async e=>{let t=e?.description;if(t===void 0)return k(e=>e.claim());if(typeof t!=`string`)throw a(`invalid`,i.badDescription);return k(e=>e.claim({description:t}))},release:()=>k(e=>e.release()),usage:async()=>{let e=await A(e=>e.usage());return m=e,e},on:async e=>g?()=>{}:(_.add(e),()=>{_.delete(e)}),leave:async()=>{await Promise.resolve(c.leave()).catch(()=>{}),w(`left`)},closed:S}},f=async()=>{let e=await c();return e?e.available().catch(()=>!1):!1},p=async(e,t)=>{if(typeof e!=`string`||e.length===0||e.length>72)throw a(`invalid`,i.badName);let n=await c();if(!n)throw a(`unavailable`,i.unavailable);let r=await n.open(e,t).catch(l);if(`error`in r)throw a(r.error,r.message);return d(r)},m=async e=>{let t=await c();if(!t)throw a(`unavailable`,i.unavailable);let n=await t.create(e).catch(l);if(`error`in n)throw a(n.error,n.message);return d(n)},h=async(e,t)=>{let n=typeof e==`string`?e.indexOf(`.`):-1;if(n<=0||n===e.length-1)throw a(`invalid`,i.inviteNoKey);let r=await c();if(!r)throw a(`unavailable`,i.unavailable);let o=await r.join(e,t).catch(l);if(`error`in o)throw a(o.error,o.message);return d(o)};exports.available=f,exports.create=m,exports.join=h,exports.open=p,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
package/rooms.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as RoomOpenOptions, G as RoomDefaults, K as RoomEnd, Q as RoomMessage, U as RoomBacklog, W as RoomCreateOptions, X as RoomMailbox, Y as RoomJoinOptions, Z as RoomMember, et as RoomPermission, nt as RoomsErrorCode, q as RoomEvent, tt as RoomPermissions } from "./contract-_nWuFitS.js";
1
+ import { $ as RoomMessage, G as RoomCreateOptions, J as RoomEvent, K as RoomDefaults, Q as RoomMember, U as RoomBacklog, W as RoomClaimOptions, X as RoomJoinOptions, Z as RoomMailbox, et as RoomOpenOptions, nt as RoomPermissions, q as RoomEnd, rt as RoomsErrorCode, tt as RoomPermission } from "./contract-InuLU8bI.js";
2
2
  declare namespace rooms_d_exports {
3
- export { RoomCreateOptions as CreateOptions, RoomJoinOptions as JoinOptions, RoomOpenOptions as OpenOptions, Room, RoomBacklog, RoomDefaults, RoomEnd, RoomEvent, RoomMailbox, RoomMember, RoomMessage, RoomPermission, RoomPermissions, RoomsError, RoomsErrorCode, available, create, join, open };
3
+ export { RoomClaimOptions as ClaimOptions, RoomCreateOptions as CreateOptions, RoomJoinOptions as JoinOptions, RoomOpenOptions as OpenOptions, Room, RoomBacklog, RoomDefaults, RoomEnd, RoomEvent, RoomMailbox, RoomMember, RoomMessage, RoomPermission, RoomPermissions, RoomsError, RoomsErrorCode, available, create, join, open };
4
4
  }
5
5
  /** Thrown by every member of this namespace. Match on `code`, never on the message. */
6
6
  export type RoomsError = Error & {
@@ -24,7 +24,11 @@ export type Room = {
24
24
  readonly owner: string;
25
25
  /** whether a premium account keeps this name and its messages */
26
26
  readonly claimed: boolean;
27
- /** what the mailbox holds, as the room last said. Null for a room nobody has claimed. */
27
+ /**
28
+ * what the mailbox holds, as the room last said. Null for a room nobody has claimed. The account can
29
+ * clear the room, unclaim it or set a lower `cap` from its fkn.app settings, which the app hears as a
30
+ * `deleted` or a `claim` event; `usage()` reads the figures again.
31
+ */
28
32
  readonly mailbox: RoomMailbox | null;
29
33
  defaults: () => RoomDefaults;
30
34
  members: () => Promise<RoomMember[]>;
@@ -37,15 +41,29 @@ export type Room = {
37
41
  /** replays stored messages above `after` as `message` events marked `replayed`, one page at a time */
38
42
  backlog: (after: number, limit?: number) => Promise<RoomBacklog>;
39
43
  setDefault: (permission: 'send' | 'receive', value: boolean) => Promise<void>;
40
- /** the message size cap: the room default when no member is named, that member's override otherwise, cleared by null */
41
- limit: (maxMessageBytes: number | null, id?: string) => Promise<void>;
44
+ /**
45
+ * the message size cap, from 1 to 33,554,432. With no id it sets the room default, which is always
46
+ * a number. With an id it sets that member's override, and null clears the override.
47
+ */
48
+ limit: {
49
+ (maxMessageBytes: number, id?: string): Promise<void>;
50
+ (maxMessageBytes: number | null, id: string): Promise<void>;
51
+ };
42
52
  grant: (id: string, permission: RoomPermission) => Promise<void>;
43
53
  revoke: (id: string, permission: RoomPermission) => Promise<void>;
44
54
  remove: (id: string) => Promise<void>;
45
55
  block: (id: string) => Promise<void>;
46
56
  unblock: (id: string) => Promise<void>;
47
- /** keeps the name and a mailbox for the signed-in premium account. The only thing in rooms that premium buys. */
48
- claim: () => Promise<void>;
57
+ /**
58
+ * keeps the name and a mailbox for the signed-in premium account. The only thing in rooms that premium
59
+ * buys. `description` says what the room is for, shown to the account in its fkn.app settings; claiming
60
+ * with an unchanged one on every open is free.
61
+ */
62
+ claim: (options?: RoomClaimOptions) => Promise<void>;
63
+ /**
64
+ * gives the claim back: the mailbox is deleted and whoever is present stays in an ordinary room. The app
65
+ * that claimed the room only; the account can also unclaim it from its fkn.app settings.
66
+ */
49
67
  release: () => Promise<void>;
50
68
  usage: () => Promise<RoomMailbox | null>;
51
69
  /** Await the returned unsubscribe in cleanup, the `account.onChange` shape. */
@@ -67,4 +85,4 @@ export declare const create: (options?: RoomCreateOptions) => Promise<Room>;
67
85
  /** `invite` is `room.invite`: a key and a room id joined by a dot. */
68
86
  export declare const join: (invite: string, options?: RoomJoinOptions) => Promise<Room>;
69
87
  //#endregion
70
- export { type RoomCreateOptions as CreateOptions, type RoomJoinOptions as JoinOptions, type RoomOpenOptions as OpenOptions, type RoomBacklog, type RoomDefaults, type RoomEnd, type RoomEvent, type RoomMailbox, type RoomMember, type RoomMessage, type RoomPermission, type RoomPermissions, type RoomsErrorCode, rooms_d_exports as t };
88
+ export { type RoomClaimOptions as ClaimOptions, type RoomCreateOptions as CreateOptions, type RoomJoinOptions as JoinOptions, type RoomOpenOptions as OpenOptions, type RoomBacklog, type RoomDefaults, type RoomEnd, type RoomEvent, type RoomMailbox, type RoomMember, type RoomMessage, type RoomPermission, type RoomPermissions, type RoomsErrorCode, rooms_d_exports as t };
package/rooms.js CHANGED
@@ -34,6 +34,9 @@ var a = /* @__PURE__ */ e({
34
34
  notClaimed: "rooms: the room is not claimed",
35
35
  noMailbox: "rooms: the room keeps no messages",
36
36
  badLimit: "rooms: the limit is out of range",
37
+ badDescription: "rooms: the description is not one a claim can carry",
38
+ notClaimer: "rooms: only the app that claimed the room can describe it",
39
+ notReleaser: "rooms: only the app that claimed the room can release it",
37
40
  tooFast: "rooms: sending too fast",
38
41
  tooLarge: "rooms: the message is too large",
39
42
  unavailable: "rooms: rooms are unavailable",
@@ -144,7 +147,12 @@ var a = /* @__PURE__ */ e({
144
147
  remove: (e) => k((t) => t.remove(e)),
145
148
  block: (e) => k((t) => t.block(e)),
146
149
  unblock: (e) => k((t) => t.unblock(e)),
147
- claim: () => k((e) => e.claim()),
150
+ claim: async (e) => {
151
+ let t = e?.description;
152
+ if (t === void 0) return k((e) => e.claim());
153
+ if (typeof t != "string") throw s("invalid", o.badDescription);
154
+ return k((e) => e.claim({ description: t }));
155
+ },
148
156
  release: () => k((e) => e.release()),
149
157
  usage: async () => {
150
158
  let e = await A((e) => e.usage());