@fkn/lib 0.9.26 → 0.9.28

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 (47) hide show
  1. package/{api-CesI0aMl.d.ts → api-CKoF03Me.d.ts} +327 -1
  2. package/api.d.ts +2 -2
  3. package/cloud/dns.d.ts +1 -1
  4. package/cloud/fetch.d.ts +1 -1
  5. package/cloud/fs/promises.d.ts +1 -1
  6. package/cloud/fs.cjs +1 -1
  7. package/cloud/fs.d.ts +3 -2
  8. package/cloud/fs.js +20 -19
  9. package/cloud/net.d.ts +1 -1
  10. package/{cloud-B7pI3pp1.d.ts → cloud-BX_24NAz.d.ts} +4 -4
  11. package/cloud.d.ts +4 -4
  12. package/{contract-D6ksmIm6.d.ts → contract-BzdjfQge.d.ts} +118 -1
  13. package/contract.d.ts +2 -2
  14. package/dgram.d.ts +2 -2
  15. package/dns.d.ts +1 -1
  16. package/{extension-CJUeVRXf.d.ts → extension-DwQOshkM.d.ts} +1 -1
  17. package/extension.d.ts +2 -2
  18. package/fs/promises.cjs +1 -1
  19. package/fs/promises.d.ts +1 -1
  20. package/fs/promises.js +1 -1
  21. package/fs-CBVaShOR.d.ts +27 -0
  22. package/fs-Cvx2NT6o.js +360 -0
  23. package/fs-J5h3i5eg.cjs +1 -0
  24. package/fs.cjs +1 -1
  25. package/fs.d.ts +3 -2
  26. package/fs.js +2 -2
  27. package/http.d.ts +1 -1
  28. package/{index-CGJTVju4.d.ts → index-Cg6y_FTi.d.ts} +22 -6
  29. package/{index-BhO-wymH.d.ts → index-DH3_12nU.d.ts} +36 -36
  30. package/index.cjs +1 -1
  31. package/index.d.ts +7 -6
  32. package/index.js +48 -47
  33. package/{net-DAOcF3Eb.d.ts → net-Cy6QOTK3.d.ts} +2 -2
  34. package/net.d.ts +1 -1
  35. package/package.json +6 -1
  36. package/packages.d.ts +1 -1
  37. package/{proxy-BubvP9sg.d.ts → proxy-DahCiavd.d.ts} +2 -2
  38. package/rooms.cjs +1 -0
  39. package/rooms.d.ts +46 -0
  40. package/rooms.js +142 -0
  41. package/{storage-BjGr_vC4.js → storage-BL8vxHlW.js} +23 -7
  42. package/storage-Dr5F1jil.cjs +1 -0
  43. package/storage-WZEvw3KN.d.ts +69 -0
  44. package/fs-DYP7utdw.cjs +0 -1
  45. package/fs-DlGE0ZNu.d.ts +0 -73
  46. package/fs-d2ANVBkm.js +0 -347
  47. package/storage-DLB4ciMf.cjs +0 -1
@@ -1,5 +1,5 @@
1
1
  import { o as TcpSocketOption, v as UdpSocketOption } from "./wire-Gbo-D74t.js";
2
- import { A as ProxyFetchInit, C as PackageQuery, D as PickOptions, K as WriteData, O as Placement, P as Resolvers, S as OverlayState, T as PackagesErrorCode, U as UdpDatagram, V as TcpSocketOptions, W as UdpSocketOptions, _ as InstallOptions, a as ConflictChoice, c as ConnectAvailability, i as AdoptState, j as ProxyFetchInput, l as ConnectOptions, m as FrameConsentRequest, o as ConflictRequest, r as AdoptRequest, y as IpFamily, z as TcpSocketListenerOptions } from "./contract-D6ksmIm6.js";
2
+ import { $ as TcpSocketOptions, A as ProxyFetchInit, B as RoomJoinOptions, C as PackageQuery, D as PickOptions, F as RoomCreateOptions, G as RoomsErrorCode, O as Placement, P as Resolvers, R as RoomEvent, S as OverlayState, T as PackagesErrorCode, U as RoomPermission, Z as TcpSocketListenerOptions, _ as InstallOptions, a as ConflictChoice, c as ConnectAvailability, i as AdoptState, it as WriteData, j as ProxyFetchInput, l as ConnectOptions, m as FrameConsentRequest, nt as UdpSocketOptions, o as ConflictRequest, r as AdoptRequest, tt as UdpDatagram, y as IpFamily } from "./contract-BzdjfQge.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;
@@ -84,6 +84,10 @@ declare const onApiEpoch: (listener: EpochListener<{
84
84
  maxObjects: number;
85
85
  }>;
86
86
  readFile: (path: string) => Promise<Uint8Array<ArrayBufferLike>>;
87
+ readFileSealed: (path: string) => Promise<{
88
+ bytes: Uint8Array;
89
+ sealedAt: number | null;
90
+ }>;
87
91
  writeFile: (path: string, data: WriteData, contentType: string | null) => Promise<void>;
88
92
  remove: (path: string) => Promise<void>;
89
93
  encryption: () => Promise<{
@@ -271,6 +275,165 @@ declare const onApiEpoch: (listener: EpochListener<{
271
275
  ok: true;
272
276
  }>;
273
277
  };
278
+ rooms: {
279
+ available: () => Promise<boolean>;
280
+ create: (options?: RoomCreateOptions | undefined) => Promise<{
281
+ id: string;
282
+ key: string;
283
+ invite: string;
284
+ self: {
285
+ id: string;
286
+ permissions: {
287
+ readonly block: boolean;
288
+ readonly receive: boolean;
289
+ readonly remove: boolean;
290
+ readonly send: boolean;
291
+ };
292
+ };
293
+ owner: string;
294
+ defaults: () => Promise<{
295
+ readonly send: boolean;
296
+ readonly receive: boolean;
297
+ }>;
298
+ members: () => Promise<{
299
+ id: string;
300
+ permissions: {
301
+ readonly block: boolean;
302
+ readonly receive: boolean;
303
+ readonly remove: boolean;
304
+ readonly send: boolean;
305
+ };
306
+ }[]>;
307
+ send: (text: string) => Promise<{
308
+ error: RoomsErrorCode;
309
+ message: string;
310
+ } | {
311
+ ok: true;
312
+ }>;
313
+ setDefault: (permission: "receive" | "send", value: boolean) => Promise<{
314
+ error: RoomsErrorCode;
315
+ message: string;
316
+ } | {
317
+ ok: true;
318
+ }>;
319
+ grant: (id: string, permission: RoomPermission) => Promise<{
320
+ error: RoomsErrorCode;
321
+ message: string;
322
+ } | {
323
+ ok: true;
324
+ }>;
325
+ revoke: (id: string, permission: RoomPermission) => Promise<{
326
+ error: RoomsErrorCode;
327
+ message: string;
328
+ } | {
329
+ ok: true;
330
+ }>;
331
+ remove: (id: string) => Promise<{
332
+ error: RoomsErrorCode;
333
+ message: string;
334
+ } | {
335
+ ok: true;
336
+ }>;
337
+ block: (id: string) => Promise<{
338
+ error: RoomsErrorCode;
339
+ message: string;
340
+ } | {
341
+ ok: true;
342
+ }>;
343
+ unblock: (id: string) => Promise<{
344
+ error: RoomsErrorCode;
345
+ message: string;
346
+ } | {
347
+ ok: true;
348
+ }>;
349
+ on: (listener: (event: RoomEvent) => void) => Promise<() => Promise<void>>;
350
+ leave: () => Promise<void>;
351
+ closed: Promise<{
352
+ reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
353
+ }>;
354
+ } | {
355
+ error: RoomsErrorCode;
356
+ message: string;
357
+ }>;
358
+ join: (invite: string, options?: RoomJoinOptions | undefined) => Promise<{
359
+ id: string;
360
+ key: string;
361
+ invite: string;
362
+ self: {
363
+ id: string;
364
+ permissions: {
365
+ readonly block: boolean;
366
+ readonly receive: boolean;
367
+ readonly remove: boolean;
368
+ readonly send: boolean;
369
+ };
370
+ };
371
+ owner: string;
372
+ defaults: () => Promise<{
373
+ readonly send: boolean;
374
+ readonly receive: boolean;
375
+ }>;
376
+ members: () => Promise<{
377
+ id: string;
378
+ permissions: {
379
+ readonly block: boolean;
380
+ readonly receive: boolean;
381
+ readonly remove: boolean;
382
+ readonly send: boolean;
383
+ };
384
+ }[]>;
385
+ send: (text: string) => Promise<{
386
+ error: RoomsErrorCode;
387
+ message: string;
388
+ } | {
389
+ ok: true;
390
+ }>;
391
+ setDefault: (permission: "receive" | "send", value: boolean) => Promise<{
392
+ error: RoomsErrorCode;
393
+ message: string;
394
+ } | {
395
+ ok: true;
396
+ }>;
397
+ grant: (id: string, permission: RoomPermission) => Promise<{
398
+ error: RoomsErrorCode;
399
+ message: string;
400
+ } | {
401
+ ok: true;
402
+ }>;
403
+ revoke: (id: string, permission: RoomPermission) => Promise<{
404
+ error: RoomsErrorCode;
405
+ message: string;
406
+ } | {
407
+ ok: true;
408
+ }>;
409
+ remove: (id: string) => Promise<{
410
+ error: RoomsErrorCode;
411
+ message: string;
412
+ } | {
413
+ ok: true;
414
+ }>;
415
+ block: (id: string) => Promise<{
416
+ error: RoomsErrorCode;
417
+ message: string;
418
+ } | {
419
+ ok: true;
420
+ }>;
421
+ unblock: (id: string) => Promise<{
422
+ error: RoomsErrorCode;
423
+ message: string;
424
+ } | {
425
+ ok: true;
426
+ }>;
427
+ on: (listener: (event: RoomEvent) => void) => Promise<() => Promise<void>>;
428
+ leave: () => Promise<void>;
429
+ closed: Promise<{
430
+ reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
431
+ }>;
432
+ } | {
433
+ error: RoomsErrorCode;
434
+ message: string;
435
+ }>;
436
+ };
274
437
  account: {
275
438
  info: () => Promise<{
276
439
  name: string;
@@ -397,6 +560,10 @@ declare const currentApiEpoch: () => {
397
560
  maxObjects: number;
398
561
  }>;
399
562
  readFile: (path: string) => Promise<Uint8Array<ArrayBufferLike>>;
563
+ readFileSealed: (path: string) => Promise<{
564
+ bytes: Uint8Array;
565
+ sealedAt: number | null;
566
+ }>;
400
567
  writeFile: (path: string, data: WriteData, contentType: string | null) => Promise<void>;
401
568
  remove: (path: string) => Promise<void>;
402
569
  encryption: () => Promise<{
@@ -584,6 +751,165 @@ declare const currentApiEpoch: () => {
584
751
  ok: true;
585
752
  }>;
586
753
  };
754
+ rooms: {
755
+ available: () => Promise<boolean>;
756
+ create: (options?: RoomCreateOptions | undefined) => Promise<{
757
+ id: string;
758
+ key: string;
759
+ invite: string;
760
+ self: {
761
+ id: string;
762
+ permissions: {
763
+ readonly block: boolean;
764
+ readonly receive: boolean;
765
+ readonly remove: boolean;
766
+ readonly send: boolean;
767
+ };
768
+ };
769
+ owner: string;
770
+ defaults: () => Promise<{
771
+ readonly send: boolean;
772
+ readonly receive: boolean;
773
+ }>;
774
+ members: () => Promise<{
775
+ id: string;
776
+ permissions: {
777
+ readonly block: boolean;
778
+ readonly receive: boolean;
779
+ readonly remove: boolean;
780
+ readonly send: boolean;
781
+ };
782
+ }[]>;
783
+ send: (text: string) => Promise<{
784
+ error: RoomsErrorCode;
785
+ message: string;
786
+ } | {
787
+ ok: true;
788
+ }>;
789
+ setDefault: (permission: "receive" | "send", value: boolean) => Promise<{
790
+ error: RoomsErrorCode;
791
+ message: string;
792
+ } | {
793
+ ok: true;
794
+ }>;
795
+ grant: (id: string, permission: RoomPermission) => Promise<{
796
+ error: RoomsErrorCode;
797
+ message: string;
798
+ } | {
799
+ ok: true;
800
+ }>;
801
+ revoke: (id: string, permission: RoomPermission) => Promise<{
802
+ error: RoomsErrorCode;
803
+ message: string;
804
+ } | {
805
+ ok: true;
806
+ }>;
807
+ remove: (id: string) => Promise<{
808
+ error: RoomsErrorCode;
809
+ message: string;
810
+ } | {
811
+ ok: true;
812
+ }>;
813
+ block: (id: string) => Promise<{
814
+ error: RoomsErrorCode;
815
+ message: string;
816
+ } | {
817
+ ok: true;
818
+ }>;
819
+ unblock: (id: string) => Promise<{
820
+ error: RoomsErrorCode;
821
+ message: string;
822
+ } | {
823
+ ok: true;
824
+ }>;
825
+ on: (listener: (event: RoomEvent) => void) => Promise<() => Promise<void>>;
826
+ leave: () => Promise<void>;
827
+ closed: Promise<{
828
+ reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
829
+ }>;
830
+ } | {
831
+ error: RoomsErrorCode;
832
+ message: string;
833
+ }>;
834
+ join: (invite: string, options?: RoomJoinOptions | undefined) => Promise<{
835
+ id: string;
836
+ key: string;
837
+ invite: string;
838
+ self: {
839
+ id: string;
840
+ permissions: {
841
+ readonly block: boolean;
842
+ readonly receive: boolean;
843
+ readonly remove: boolean;
844
+ readonly send: boolean;
845
+ };
846
+ };
847
+ owner: string;
848
+ defaults: () => Promise<{
849
+ readonly send: boolean;
850
+ readonly receive: boolean;
851
+ }>;
852
+ members: () => Promise<{
853
+ id: string;
854
+ permissions: {
855
+ readonly block: boolean;
856
+ readonly receive: boolean;
857
+ readonly remove: boolean;
858
+ readonly send: boolean;
859
+ };
860
+ }[]>;
861
+ send: (text: string) => Promise<{
862
+ error: RoomsErrorCode;
863
+ message: string;
864
+ } | {
865
+ ok: true;
866
+ }>;
867
+ setDefault: (permission: "receive" | "send", value: boolean) => Promise<{
868
+ error: RoomsErrorCode;
869
+ message: string;
870
+ } | {
871
+ ok: true;
872
+ }>;
873
+ grant: (id: string, permission: RoomPermission) => Promise<{
874
+ error: RoomsErrorCode;
875
+ message: string;
876
+ } | {
877
+ ok: true;
878
+ }>;
879
+ revoke: (id: string, permission: RoomPermission) => Promise<{
880
+ error: RoomsErrorCode;
881
+ message: string;
882
+ } | {
883
+ ok: true;
884
+ }>;
885
+ remove: (id: string) => Promise<{
886
+ error: RoomsErrorCode;
887
+ message: string;
888
+ } | {
889
+ ok: true;
890
+ }>;
891
+ block: (id: string) => Promise<{
892
+ error: RoomsErrorCode;
893
+ message: string;
894
+ } | {
895
+ ok: true;
896
+ }>;
897
+ unblock: (id: string) => Promise<{
898
+ error: RoomsErrorCode;
899
+ message: string;
900
+ } | {
901
+ ok: true;
902
+ }>;
903
+ on: (listener: (event: RoomEvent) => void) => Promise<() => Promise<void>>;
904
+ leave: () => Promise<void>;
905
+ closed: Promise<{
906
+ reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
907
+ }>;
908
+ } | {
909
+ error: RoomsErrorCode;
910
+ message: string;
911
+ }>;
912
+ };
587
913
  account: {
588
914
  info: () => Promise<{
589
915
  name: string;
package/api.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { P as Resolvers } from "./contract-D6ksmIm6.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-CesI0aMl.js";
1
+ import { P as Resolvers } from "./contract-BzdjfQge.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-CKoF03Me.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 { n as AddressLookupResult } from "../contract-D6ksmIm6.js";
1
+ import { n as AddressLookupResult } from "../contract-BzdjfQge.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-BubvP9sg.js";
1
+ import { t as cloudFetch } from "../proxy-DahCiavd.js";
2
2
  export { cloudFetch as fetch };
@@ -1,5 +1,5 @@
1
1
  import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../../index-BQgZVQl7.js";
2
- import "../../fs-DlGE0ZNu.js";
2
+ import "../../fs-CBVaShOR.js";
3
3
  //#region src/cloud/fs-promises.d.ts
4
4
  declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (_path?: import("node:fs").PathLike, _options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
5
5
  recursive?: boolean;
package/cloud/fs.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-DZPGCYWg.cjs"),n=require("../messages.cjs"),r=require("../storage-DLB4ciMf.cjs");var i=e.t({STORAGE_NOT_FOUND:()=>n.STORAGE_NOT_FOUND,StorageLockedError:()=>r.t,StorageNotFoundError:()=>r.n,available:()=>a,encryption:()=>r.i,isNotFound:()=>r.a,mkdir:()=>d,promises:()=>m,quota:()=>r.s,readFile:()=>o,readdir:()=>u,rename:()=>l,rm:()=>f,stat:()=>p,unlink:()=>c,unlock:()=>r.d,writeFile:()=>s}),{available:a,readFile:o,writeFile:s,unlink:c,rename:l,readdir:u,mkdir:d,rm:f,stat:p,promises:m}=t.t(r.u,{memfs:!1});exports.STORAGE_NOT_FOUND=n.STORAGE_NOT_FOUND,exports.StorageLockedError=r.t,exports.StorageNotFoundError=r.n,exports.available=a,exports.encryption=r.i,exports.isNotFound=r.a,exports.mkdir=d,exports.promises=m,exports.quota=r.s,exports.readFile=o,exports.readdir=u,exports.rename=l,exports.rm=f,exports.stat=p,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}}),exports.unlink=c,exports.unlock=r.d,exports.writeFile=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-DZPGCYWg.cjs"),n=require("../messages.cjs"),r=require("../storage-Dr5F1jil.cjs");var i=e.t({STORAGE_NOT_FOUND:()=>n.STORAGE_NOT_FOUND,StorageLockedError:()=>r.t,StorageNotFoundError:()=>r.n,available:()=>a,encryption:()=>r.i,isNotFound:()=>r.a,mkdir:()=>d,promises:()=>m,quota:()=>r.s,readFile:()=>o,readFileSealed:()=>r.l,readdir:()=>u,rename:()=>l,rm:()=>f,stat:()=>p,unlink:()=>c,unlock:()=>r.f,writeFile:()=>s}),{available:a,readFile:o,writeFile:s,unlink:c,rename:l,readdir:u,mkdir:d,rm:f,stat:p,promises:m}=t.t(r.d,{memfs:!1});exports.STORAGE_NOT_FOUND=n.STORAGE_NOT_FOUND,exports.StorageLockedError=r.t,exports.StorageNotFoundError=r.n,exports.available=a,exports.encryption=r.i,exports.isNotFound=r.a,exports.mkdir=d,exports.promises=m,exports.quota=r.s,exports.readFile=o,exports.readFileSealed=r.l,exports.readdir=u,exports.rename=l,exports.rm=f,exports.stat=p,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}}),exports.unlink=c,exports.unlock=r.f,exports.writeFile=s;
package/cloud/fs.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { i as Stats } from "../index-BQgZVQl7.js";
2
- import { _ as encryption, a as readFile, b as unlock, c as rm, d as writeFile, f as EncryptionStatus, g as StorageQuota, h as StorageNotFoundError, i as promises, l as stat, m as StorageLockedError, o as readdir, p as FileEntry, r as mkdir, s as rename, t as available, u as unlink, v as isNotFound, y as quota } from "../fs-DlGE0ZNu.js";
2
+ import { a as StorageNotFoundError, c as isNotFound, d as unlock, i as StorageLockedError, l as quota, n as FileEntry, o as StorageQuota, r as SealedRead, s as encryption, t as EncryptionStatus, u as readFileSealed } from "../storage-WZEvw3KN.js";
3
3
  import { i as STORAGE_NOT_FOUND } from "../messages-DvpKMTsY.js";
4
- export { type EncryptionStatus, type FileEntry, STORAGE_NOT_FOUND, type Stats, StorageLockedError, StorageNotFoundError, type StorageQuota, available, encryption, isNotFound, mkdir, promises, quota, readFile, readdir, rename, rm, stat, unlink, unlock, writeFile };
4
+ import { a as readFile, c as rm, d as writeFile, i as promises, l as stat, o as readdir, r as mkdir, s as rename, t as available, u as unlink } from "../fs-CBVaShOR.js";
5
+ export { type EncryptionStatus, type FileEntry, STORAGE_NOT_FOUND, type SealedRead, type Stats, StorageLockedError, StorageNotFoundError, type StorageQuota, available, encryption, isNotFound, mkdir, promises, quota, readFile, readFileSealed, readdir, rename, rm, stat, unlink, unlock, writeFile };
package/cloud/fs.js CHANGED
@@ -1,26 +1,27 @@
1
1
  import { t as e } from "../rolldown-runtime-Dy4uBu1J.js";
2
2
  import { t } from "../node-fs-C9ECR_9H.js";
3
3
  import { STORAGE_NOT_FOUND as n } from "../messages.js";
4
- import { a as r, d as i, i as a, n as o, s, t as c, u as l } from "../storage-BjGr_vC4.js";
4
+ import { a as r, d as i, f as a, i as o, l as s, n as c, s as l, t as u } from "../storage-BL8vxHlW.js";
5
5
  //#region src/cloud/fs.ts
6
- var u = /* @__PURE__ */ e({
6
+ var d = /* @__PURE__ */ e({
7
7
  STORAGE_NOT_FOUND: () => n,
8
- StorageLockedError: () => c,
9
- StorageNotFoundError: () => o,
10
- available: () => d,
11
- encryption: () => a,
8
+ StorageLockedError: () => u,
9
+ StorageNotFoundError: () => c,
10
+ available: () => f,
11
+ encryption: () => o,
12
12
  isNotFound: () => r,
13
- mkdir: () => _,
14
- promises: () => b,
15
- quota: () => s,
16
- readFile: () => f,
17
- readdir: () => g,
18
- rename: () => h,
19
- rm: () => v,
20
- stat: () => y,
21
- unlink: () => m,
22
- unlock: () => i,
23
- writeFile: () => p
24
- }), { available: d, readFile: f, writeFile: p, unlink: m, rename: h, readdir: g, mkdir: _, rm: v, stat: y, promises: b } = t(l, { memfs: !1 });
13
+ mkdir: () => v,
14
+ promises: () => x,
15
+ quota: () => l,
16
+ readFile: () => p,
17
+ readFileSealed: () => s,
18
+ readdir: () => _,
19
+ rename: () => g,
20
+ rm: () => y,
21
+ stat: () => b,
22
+ unlink: () => h,
23
+ unlock: () => a,
24
+ writeFile: () => m
25
+ }), { available: f, readFile: p, writeFile: m, unlink: h, rename: g, readdir: _, mkdir: v, rm: y, stat: b, promises: x } = t(i, { memfs: !1 });
25
26
  //#endregion
26
- export { n as STORAGE_NOT_FOUND, c as StorageLockedError, o as StorageNotFoundError, d as available, a as encryption, r as isNotFound, _ as mkdir, b as promises, s as quota, f as readFile, g as readdir, h as rename, v as rm, y as stat, u as t, m as unlink, i as unlock, p as writeFile };
27
+ export { n as STORAGE_NOT_FOUND, u as StorageLockedError, c as StorageNotFoundError, f as available, o as encryption, r as isNotFound, v as mkdir, x as promises, l as quota, p as readFile, s as readFileSealed, _ as readdir, g as rename, y as rm, b as stat, d as t, h as unlink, a as unlock, m as writeFile };
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-DAOcF3Eb.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-Cy6QOTK3.js";
2
2
  export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
@@ -1,8 +1,8 @@
1
- import { t as cloudFetch } from "./proxy-BubvP9sg.js";
2
- import { i as Frame, r as AttachFrameOptions } from "./index-BhO-wymH.js";
1
+ import { t as cloudFetch } from "./proxy-DahCiavd.js";
2
+ import { i as Frame, r as AttachFrameOptions } from "./index-DH3_12nU.js";
3
3
  import { t as dns_d_exports } from "./dns.js";
4
- import { n as fs_d_exports } from "./fs-DlGE0ZNu.js";
5
- import { s as net_d_exports } from "./net-DAOcF3Eb.js";
4
+ import { n as fs_d_exports } from "./fs-CBVaShOR.js";
5
+ import { s as net_d_exports } from "./net-Cy6QOTK3.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-BubvP9sg.js";
2
- import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-B7pI3pp1.js";
1
+ import { t as cloudFetch } from "./proxy-DahCiavd.js";
2
+ import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-BX_24NAz.js";
3
3
  import { t as dns_d_exports } from "./dns.js";
4
- import { n as fs_d_exports } from "./fs-DlGE0ZNu.js";
5
- import { s as net_d_exports } from "./net-DAOcF3Eb.js";
4
+ import { n as fs_d_exports } from "./fs-CBVaShOR.js";
5
+ import { s as net_d_exports } from "./net-Cy6QOTK3.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 };
@@ -179,6 +179,106 @@ type MountDescriptor = {
179
179
  /** the connecting app, as the BROKER knows it */
180
180
  from: string;
181
181
  };
182
+ type RoomPermission = 'send' | 'receive' | 'remove' | 'block';
183
+ type RoomPermissions = Readonly<Record<RoomPermission, boolean>>;
184
+ type RoomDefaults = Readonly<{
185
+ send: boolean;
186
+ receive: boolean;
187
+ }>;
188
+ /** A participant as this room sees them. The id is fresh in every room. */
189
+ type RoomMember = {
190
+ id: string;
191
+ permissions: RoomPermissions;
192
+ };
193
+ type RoomMessage = {
194
+ seq: number;
195
+ from: string;
196
+ at: number;
197
+ text: string;
198
+ };
199
+ type RoomEvent = {
200
+ type: 'message';
201
+ message: RoomMessage;
202
+ } | {
203
+ type: 'joined';
204
+ member: RoomMember;
205
+ } | {
206
+ type: 'left';
207
+ id: string;
208
+ reason: 'left' | 'removed' | 'blocked';
209
+ } | {
210
+ type: 'permissions';
211
+ id: string;
212
+ permissions: RoomPermissions;
213
+ } | {
214
+ type: 'defaults';
215
+ defaults: RoomDefaults;
216
+ };
217
+ type RoomsErrorCode = 'invalid' | 'not-found' | 'bad-key' | 'full' | 'blocked' | 'denied' | 'rate-limited' | 'too-large' | 'unavailable' | 'closed';
218
+ /** A refusal, as data. `packages` crosses the hop the same way, and for the same reason. */
219
+ type RoomsFail = {
220
+ error: RoomsErrorCode;
221
+ message: string;
222
+ };
223
+ /** Why the room ended for this app. It ends once. */
224
+ type RoomEnd = {
225
+ reason: 'left' | 'removed' | 'blocked' | 'ended' | 'unavailable';
226
+ };
227
+ type RoomCreateOptions = {
228
+ /** aborting it leaves the room; it never bounds the wait for the broker */
229
+ signal?: AbortSignal;
230
+ members?: number;
231
+ defaults?: Partial<RoomDefaults>;
232
+ };
233
+ type RoomJoinOptions = {
234
+ signal?: AbortSignal;
235
+ };
236
+ /**
237
+ * A joined room, held by the broker: it owns the socket, the room key and the derived message key,
238
+ * and hands the app plaintext and member ids only.
239
+ *
240
+ * Every member that can be refused answers with a `RoomsFail` rather than throwing, so a refusal
241
+ * survives the osra hop as data. `leave` and `on` cannot be refused.
242
+ */
243
+ type RoomHandle = {
244
+ /** the room's uuid */
245
+ id: string;
246
+ /** the room key, base64url. The api never sees it. Anyone holding it and the id can join. */
247
+ key: string;
248
+ /** `id` and `key` as one string, the thing to put in a link */
249
+ invite: string;
250
+ self: RoomMember;
251
+ owner: string;
252
+ defaults: () => Promise<RoomDefaults>;
253
+ members: () => Promise<RoomMember[]>;
254
+ /** at most 4,096 bytes of UTF-8, sealed before it leaves the browser; never truncated */
255
+ send: (text: string) => Promise<RoomsFail | {
256
+ ok: true;
257
+ }>;
258
+ setDefault: (permission: 'send' | 'receive', value: boolean) => Promise<RoomsFail | {
259
+ ok: true;
260
+ }>;
261
+ grant: (id: string, permission: RoomPermission) => Promise<RoomsFail | {
262
+ ok: true;
263
+ }>;
264
+ revoke: (id: string, permission: RoomPermission) => Promise<RoomsFail | {
265
+ ok: true;
266
+ }>;
267
+ remove: (id: string) => Promise<RoomsFail | {
268
+ ok: true;
269
+ }>;
270
+ block: (id: string) => Promise<RoomsFail | {
271
+ ok: true;
272
+ }>;
273
+ unblock: (id: string) => Promise<RoomsFail | {
274
+ ok: true;
275
+ }>;
276
+ /** the `account.onChange` shape: one broker-side registration, unsubscribed by the returned function */
277
+ on: (listener: (event: RoomEvent) => void) => (() => void);
278
+ leave: () => Promise<void>;
279
+ /** settles once, when the room ends for this app. Never rejects. */
280
+ closed: Promise<RoomEnd>;
281
+ };
182
282
  type IpFamily = 'IPv4' | 'IPv6';
183
283
  /** Viewport rect plus optional corner radii, as the overlay host reports them. */
184
284
  type OverlayRect = {
@@ -306,6 +406,18 @@ type Resolvers = {
306
406
  list: () => Promise<StorageEntry[]>;
307
407
  quota: () => Promise<StorageQuota>;
308
408
  readFile: (path: string) => Promise<Uint8Array>;
409
+ /**
410
+ * The same read as `readFile`, plus the seal time the envelope authenticates, in milliseconds,
411
+ * or null for an envelope that carries no such field.
412
+ *
413
+ * Authenticated means the server can neither forge nor alter it, because it is covered by the
414
+ * envelope's AAD; it is still the WRITER's own claim about when it sealed, so on its own it
415
+ * does not prove that this copy is the newest one.
416
+ */
417
+ readFileSealed: (path: string) => Promise<{
418
+ bytes: Uint8Array;
419
+ sealedAt: number | null;
420
+ }>;
309
421
  writeFile: (path: string, data: WriteData, contentType: string | null) => Promise<void>;
310
422
  remove: (path: string) => Promise<void>;
311
423
  encryption: () => Promise<EncryptionState>;
@@ -369,6 +481,11 @@ type Resolvers = {
369
481
  ok: true;
370
482
  }>;
371
483
  };
484
+ rooms: {
485
+ available: () => Promise<boolean>;
486
+ create: (options?: RoomCreateOptions) => Promise<RoomsFail | RoomHandle>;
487
+ join: (invite: string, options?: RoomJoinOptions) => Promise<RoomsFail | RoomHandle>;
488
+ };
372
489
  account: {
373
490
  info: () => Promise<Account | null>;
374
491
  login: (consumerOrigin: string) => Promise<boolean>;
@@ -391,4 +508,4 @@ type Resolvers = {
391
508
  hideInstallPrompt: () => void;
392
509
  };
393
510
  //#endregion
394
- export { ProxyFetchInit as A, TcpSocketListenerResult as B, PackageQuery as C, PickOptions as D, PackagesFail as E, SetOverlayHost as F, UdpSocketResult as G, TcpSocketResult as H, StorageEntry as I, WriteData as K, StorageQuota as L, Quota as M, Radii as N, Placement as O, Resolvers as P, SurfaceRect as R, OverlayState as S, PackagesErrorCode as T, UdpDatagram as U, TcpSocketOptions as V, UdpSocketOptions as W, InstallOptions as _, ConflictChoice as a, MountDescriptor as b, ConnectAvailability as c, DisplayLevel as d, DnsLookup as f, HiddenSurface as g, FrameFetchScope as h, AdoptState as i, ProxyFetchInput as j, ProxyFetch as k, ConnectOptions as l, FrameConsentRequest as m, AddressLookupResult as n, ConflictRequest as o, EncryptionState as p, AdoptRequest as r, ConflictSide as s, Account as t, DisplayCause as u, InstalledPackage as v, PackageResult as w, OverlayRect as x, IpFamily as y, TcpSocketListenerOptions as z };
511
+ export { TcpSocketOptions as $, ProxyFetchInit as A, RoomJoinOptions as B, PackageQuery as C, PickOptions as D, PackagesFail as E, RoomCreateOptions as F, RoomsErrorCode as G, RoomMessage as H, RoomDefaults as I, StorageEntry as J, RoomsFail as K, RoomEnd as L, Quota as M, Radii as N, Placement as O, Resolvers as P, TcpSocketListenerResult as Q, RoomEvent as R, OverlayState as S, PackagesErrorCode as T, RoomPermission as U, RoomMember as V, RoomPermissions as W, SurfaceRect as X, StorageQuota as Y, TcpSocketListenerOptions as Z, InstallOptions as _, ConflictChoice as a, MountDescriptor as b, ConnectAvailability as c, DisplayLevel as d, TcpSocketResult as et, DnsLookup as f, HiddenSurface as g, FrameFetchScope as h, AdoptState as i, WriteData as it, ProxyFetchInput as j, ProxyFetch as k, ConnectOptions as l, FrameConsentRequest as m, AddressLookupResult as n, UdpSocketOptions as nt, ConflictRequest as o, EncryptionState as p, SetOverlayHost as q, AdoptRequest as r, UdpSocketResult as rt, ConflictSide as s, Account as t, UdpDatagram as tt, DisplayCause as u, InstalledPackage as v, PackageResult as w, OverlayRect as x, IpFamily as y, RoomHandle 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 { A as ProxyFetchInit, B as TcpSocketListenerResult, C as PackageQuery, D as PickOptions, E as PackagesFail, F as SetOverlayHost, G as UdpSocketResult, H as TcpSocketResult, I as StorageEntry, K as WriteData, L as StorageQuota, M as Quota, N as Radii, O as Placement, P as Resolvers, R as SurfaceRect, S as OverlayState, T as PackagesErrorCode, U as UdpDatagram, V as TcpSocketOptions, W as UdpSocketOptions, _ as InstallOptions, a as ConflictChoice, b as MountDescriptor, c as ConnectAvailability, d as DisplayLevel, f as DnsLookup, g as HiddenSurface, h as FrameFetchScope, i as AdoptState, j as ProxyFetchInput, k as ProxyFetch, l as ConnectOptions, m as FrameConsentRequest, n as AddressLookupResult, o as ConflictRequest, p as EncryptionState, r as AdoptRequest, s as ConflictSide, t as Account, u as DisplayCause, v as InstalledPackage, w as PackageResult, x as OverlayRect, y as IpFamily, z as TcpSocketListenerOptions } from "./contract-D6ksmIm6.js";
3
- export { Account, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FrameConsentRequest, FrameFetchScope, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, Radii, Resolvers, SetOverlayHost, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WriteData };
2
+ import { $ as TcpSocketOptions, A as ProxyFetchInit, B as RoomJoinOptions, C as PackageQuery, D as PickOptions, E as PackagesFail, F as RoomCreateOptions, G as RoomsErrorCode, H as RoomMessage, I as RoomDefaults, J as StorageEntry, K as RoomsFail, L as RoomEnd, M as Quota, N as Radii, O as Placement, P as Resolvers, Q as TcpSocketListenerResult, R as RoomEvent, S as OverlayState, T as PackagesErrorCode, U as RoomPermission, V as RoomMember, W as RoomPermissions, X as SurfaceRect, Y as StorageQuota, Z as TcpSocketListenerOptions, _ as InstallOptions, a as ConflictChoice, b as MountDescriptor, c as ConnectAvailability, d as DisplayLevel, et as TcpSocketResult, f as DnsLookup, g as HiddenSurface, h as FrameFetchScope, i as AdoptState, it as WriteData, j as ProxyFetchInput, k as ProxyFetch, l as ConnectOptions, m as FrameConsentRequest, n as AddressLookupResult, nt as UdpSocketOptions, o as ConflictRequest, p as EncryptionState, q as SetOverlayHost, r as AdoptRequest, rt as UdpSocketResult, s as ConflictSide, t as Account, tt as UdpDatagram, u as DisplayCause, v as InstalledPackage, w as PackageResult, x as OverlayRect, y as IpFamily, z as RoomHandle } from "./contract-BzdjfQge.js";
3
+ export { Account, AddressLookupResult, AdoptRequest, AdoptState, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FrameConsentRequest, FrameFetchScope, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, Radii, Resolvers, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMember, RoomMessage, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SetOverlayHost, StorageEntry, StorageQuota, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WriteData };
package/dgram.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { v as UdpSocketOption } from "./wire-Gbo-D74t.js";
2
- import { G as UdpSocketResult, P as Resolvers } from "./contract-D6ksmIm6.js";
3
- import "./api-CesI0aMl.js";
2
+ import { P as Resolvers, rt as UdpSocketResult } from "./contract-BzdjfQge.js";
3
+ import "./api-CKoF03Me.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 { n as AddressLookupResult } from "./contract-D6ksmIm6.js";
1
+ import { n as AddressLookupResult } from "./contract-BzdjfQge.js";
2
2
  declare namespace dns_d_exports {
3
3
  export { AddressLookupResult, lookup };
4
4
  }