sliftutils 1.7.32 → 1.7.33

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 (116) hide show
  1. package/builders/extensionBuild.ts +1 -1
  2. package/bundler/bundleEntry.ts +1 -3
  3. package/bundler/bundler.ts +2 -4
  4. package/bundler/sourceMaps.ts +1 -2
  5. package/examplestorage/browser.tsx +1 -2
  6. package/examplestorage/exampleserver.ts +1 -2
  7. package/index.d.ts +105 -100
  8. package/misc/dist/environment.ts.cache +2 -2
  9. package/misc/dist/getSecret.ts.cache +2 -2
  10. package/misc/dist/strings.ts.cache +2 -2
  11. package/misc/dist/zip.ts.cache +2 -2
  12. package/misc/https/dist/certs.ts.cache +2 -2
  13. package/misc/https/dist/dns.ts.cache +7 -16
  14. package/misc/https/dist/persistentLocalStorage.ts.cache +2 -2
  15. package/misc/https/dns.d.ts +1 -4
  16. package/misc/https/dns.ts +5 -14
  17. package/misc/https/hostServer.d.ts +2 -0
  18. package/misc/https/hostServer.ts +6 -7
  19. package/misc/https/httpsCerts.ts +4 -10
  20. package/misc/openrouter.ts +1 -2
  21. package/package.json +1 -1
  22. package/render-utils/FullscreenModal.tsx +1 -4
  23. package/render-utils/GenericFormat.tsx +2 -8
  24. package/render-utils/Input.tsx +5 -13
  25. package/render-utils/InputLabel.tsx +4 -6
  26. package/render-utils/InputPicker.tsx +1 -2
  27. package/render-utils/URLParam.ts +2 -3
  28. package/render-utils/dist/observer.tsx.cache +2 -2
  29. package/render-utils/mobxTyped.ts +2 -3
  30. package/render-utils/niceStringify.ts +2 -4
  31. package/storage/ArchivesDisk.ts +4 -14
  32. package/storage/BulkDatabase2/BulkDatabase2.d.ts +1 -2
  33. package/storage/BulkDatabase2/BulkDatabase2.ts +4 -11
  34. package/storage/BulkDatabase2/BulkDatabaseBase.ts +42 -114
  35. package/storage/BulkDatabase2/BulkDatabaseFormat.ts +31 -91
  36. package/storage/BulkDatabase2/BulkDatabaseMerge.ts +19 -57
  37. package/storage/BulkDatabase2/BulkDatabaseReader.ts +4 -12
  38. package/storage/BulkDatabase2/LoadedIndex.ts +6 -18
  39. package/storage/BulkDatabase2/WriteOverlay.ts +3 -8
  40. package/storage/BulkDatabase2/blockCache.ts +12 -28
  41. package/storage/BulkDatabase2/dist/BulkDatabaseBase.ts.cache +40 -103
  42. package/storage/BulkDatabase2/dist/BulkDatabaseFormat.ts.cache +19 -50
  43. package/storage/BulkDatabase2/dist/BulkDatabaseMerge.ts.cache +18 -50
  44. package/storage/BulkDatabase2/dist/BulkDatabaseReader.ts.cache +7 -15
  45. package/storage/BulkDatabase2/dist/LoadedIndex.ts.cache +9 -21
  46. package/storage/BulkDatabase2/dist/WriteOverlay.ts.cache +6 -11
  47. package/storage/BulkDatabase2/dist/blockCache.ts.cache +15 -31
  48. package/storage/BulkDatabase2/dist/mergeLock.ts.cache +10 -29
  49. package/storage/BulkDatabase2/dist/mergeMarkers.ts.cache +10 -18
  50. package/storage/BulkDatabase2/dist/streamLog.ts.cache +17 -43
  51. package/storage/BulkDatabase2/dist/syncClient.ts.cache +11 -27
  52. package/storage/BulkDatabase2/mergeLock.ts +7 -26
  53. package/storage/BulkDatabase2/mergeMarkers.ts +7 -15
  54. package/storage/BulkDatabase2/streamLog.ts +14 -40
  55. package/storage/BulkDatabase2/syncClient.ts +8 -24
  56. package/storage/FileFolderAPI.tsx +28 -75
  57. package/storage/IArchives.d.ts +3 -3
  58. package/storage/IArchives.ts +21 -50
  59. package/storage/IStorage.ts +2 -4
  60. package/storage/PendingManager.tsx +2 -3
  61. package/storage/TransactionStorage.ts +11 -24
  62. package/storage/backblaze.ts +12 -43
  63. package/storage/dist/ArchivesDisk.ts.cache +7 -17
  64. package/storage/dist/FileFolderAPI.tsx.cache +25 -63
  65. package/storage/dist/IArchives.ts.cache +10 -20
  66. package/storage/dist/IndexedDBFileFolderAPI.ts.cache +2 -2
  67. package/storage/dist/JSONStorage.ts.cache +2 -2
  68. package/storage/dist/PendingManager.tsx.cache +5 -6
  69. package/storage/dist/TransactionStorage.ts.cache +14 -27
  70. package/storage/dist/backblaze.ts.cache +15 -46
  71. package/storage/dist/embeddingFormats.ts.cache +11 -24
  72. package/storage/dist/fileSystemPointer.ts.cache +4 -7
  73. package/storage/dist/remoteFileStorage.ts.cache +17 -36
  74. package/storage/embeddingFormats.ts +11 -27
  75. package/storage/fileSystemPointer.ts +2 -7
  76. package/storage/proxydatabase/dist/ivfEmbeddingDatabase.ts.cache +8 -18
  77. package/storage/proxydatabase/dist/transactionSet.ts.cache +4 -7
  78. package/storage/proxydatabase/inMemoryDatabase.ts +1 -3
  79. package/storage/proxydatabase/ivfEmbeddingDatabase.ts +8 -23
  80. package/storage/proxydatabase/transactionSet.ts +2 -5
  81. package/storage/remoteFileServer.ts +20 -48
  82. package/storage/remoteFileStorage.ts +14 -33
  83. package/storage/remoteStorage/ArchivesRemote.d.ts +1 -4
  84. package/storage/remoteStorage/ArchivesRemote.ts +11 -26
  85. package/storage/remoteStorage/ArchivesUrl.ts +2 -4
  86. package/storage/remoteStorage/accessPage.tsx +1 -5
  87. package/storage/remoteStorage/blobStore.d.ts +5 -13
  88. package/storage/remoteStorage/blobStore.ts +52 -130
  89. package/storage/remoteStorage/createArchives.d.ts +9 -13
  90. package/storage/remoteStorage/createArchives.ts +43 -187
  91. package/storage/remoteStorage/deployTakeover.d.ts +18 -32
  92. package/storage/remoteStorage/deployTakeover.ts +70 -384
  93. package/storage/remoteStorage/dist/ArchivesRemote.ts.cache +12 -24
  94. package/storage/remoteStorage/dist/ArchivesUrl.ts.cache +5 -7
  95. package/storage/remoteStorage/dist/blobStore.ts.cache +47 -117
  96. package/storage/remoteStorage/dist/cliArgs.ts.cache +2 -2
  97. package/storage/remoteStorage/dist/createArchives.ts.cache +48 -189
  98. package/storage/remoteStorage/dist/deployTakeover.ts.cache +81 -387
  99. package/storage/remoteStorage/dist/intermediateSources.ts.cache +119 -0
  100. package/storage/remoteStorage/dist/remoteConfig.ts.cache +36 -24
  101. package/storage/remoteStorage/dist/sourceWrapper.ts.cache +20 -40
  102. package/storage/remoteStorage/dist/storageClientController.ts.cache +4 -6
  103. package/storage/remoteStorage/dist/storageController.ts.cache +11 -73
  104. package/storage/remoteStorage/dist/storageServerState.ts.cache +265 -178
  105. package/storage/remoteStorage/grantAccessCli.ts +1 -3
  106. package/storage/remoteStorage/intermediateSources.d.ts +21 -0
  107. package/storage/remoteStorage/intermediateSources.ts +117 -0
  108. package/storage/remoteStorage/remoteConfig.ts +33 -20
  109. package/storage/remoteStorage/sourceWrapper.d.ts +8 -19
  110. package/storage/remoteStorage/sourceWrapper.ts +19 -41
  111. package/storage/remoteStorage/storageClientController.ts +1 -3
  112. package/storage/remoteStorage/storageController.d.ts +4 -5
  113. package/storage/remoteStorage/storageController.ts +10 -81
  114. package/storage/remoteStorage/storageServer.ts +20 -34
  115. package/storage/remoteStorage/storageServerState.d.ts +28 -5
  116. package/storage/remoteStorage/storageServerState.ts +271 -207
@@ -8,7 +8,7 @@ import { getAllFiles } from "../misc/fs";
8
8
 
9
9
  async function main() {
10
10
  let time = Date.now();
11
- //todonext
11
+ // todonext
12
12
  // We need to build both the extBackground.ts and extContentScript.ts
13
13
  // And copy the manifest.json
14
14
  // AND copy everything in ./assets which has updated
@@ -41,9 +41,7 @@ async function main() {
41
41
  entryPoints: [entryPoint],
42
42
  });
43
43
 
44
- // Two artifacts: `name.js` without the sourcemap (the sourcemap is usually bigger than the code
45
- // itself, so this is what production serves) and `name.debug.js` with the inline sourcemap
46
- // appended (serve it behind something like a ?debug query param).
44
+ // Two artifacts: `name.js` without the sourcemap (the sourcemap is usually bigger than the code itself, so this is what production serves) and `name.debug.js` with the inline sourcemap appended (serve it behind something like a ?debug query param).
47
45
  async function write(finalPath: string, contents: string) {
48
46
  let tempPath = `${finalPath}.tmp`;
49
47
  try {
@@ -9,11 +9,9 @@ export async function bundle(config: {
9
9
  rootPath: string;
10
10
  entryPoints: string[];
11
11
  }): Promise<{
12
- // The runnable bundle, WITHOUT the sourcemap comment (the sourcemap is usually bigger than the
13
- // code itself, so the default artifact ships without it).
12
+ // The runnable bundle, WITHOUT the sourcemap comment (the sourcemap is usually bigger than the code itself, so the default artifact ships without it).
14
13
  bundle: string;
15
- // The trailing inline-sourcemap line comment. Append to `bundle` (with a newline) for the debug
16
- // variant of the bundle.
14
+ // The trailing inline-sourcemap line comment. Append to `bundle` (with a newline) for the debug variant of the bundle.
17
15
  sourceMapComment: string;
18
16
  }> {
19
17
  const { modules, rootPath, entryPoints } = config;
@@ -38,8 +38,7 @@ export function removeSourceMap(content: string): {
38
38
  }
39
39
 
40
40
  let sourceMapJson = Buffer.from(match[1], "base64").toString();
41
- // HACK: If the sourcemap is invalid, try to remove trailing characters. For some reason we sometimes have
42
- // extra characters at the end? Also try to add some characters too?
41
+ // HACK: If the sourcemap is invalid, try to remove trailing characters. For some reason we sometimes have extra characters at the end? Also try to add some characters too?
43
42
  function isJSON(str: string): boolean {
44
43
  try {
45
44
  JSON.parse(str);
@@ -12,8 +12,7 @@ import { redButton, greenButton, errorMessage } from "../render-utils/colors";
12
12
  import { createArchives } from "../storage/remoteStorage/createArchives";
13
13
  import { ArchiveFileInfo } from "../storage/IArchives";
14
14
 
15
- // The bucket's routing URL: server, account ("example"), and bucket ("examplefiles") in one.
16
- // Nothing else is needed - the first call creates the bucket if it doesn't exist yet.
15
+ // The bucket's routing URL: server, account ("example"), and bucket ("examplefiles") in one. Nothing else is needed - the first call creates the bucket if it doesn't exist yet.
17
16
  const STORAGE_URL = "https://storage.vidgridweb.com:4444/file/example/examplefiles/storage/storagerouting.json";
18
17
  const ACCESS_CHECK_INTERVAL = 1000 * 15;
19
18
 
@@ -6,8 +6,7 @@ import { hostServer } from "../misc/https/hostServer";
6
6
  // Import browser code, so it is allowed to be required by the client
7
7
  import "./browser";
8
8
 
9
- // Static example site for the remote storage system (storage/remoteStorage). The browser talks to
10
- // the storage server directly, so this server only serves the page.
9
+ // Static example site for the remote storage system (storage/remoteStorage). The browser talks to the storage server directly, so this server only serves the page.
11
10
 
12
11
  const DOMAIN = "storageexample.vidgridweb.com";
13
12
  const PORT = 4445;
package/index.d.ts CHANGED
@@ -184,10 +184,7 @@ declare module "sliftutils/misc/https/dns" {
184
184
  modified_on: string;
185
185
  comment?: string | undefined;
186
186
  }[]>;
187
- /** Cloudflare's batch endpoint applies deletes, then patches, then posts in a single database
188
- * transaction. We route edits (patches) through here because the standalone PATCH/PUT verbs
189
- * aren't usable in our setup, and because it lets "remove others + assert target" happen
190
- * without a window where the name resolves to nothing. */
187
+ /** Cloudflare's batch endpoint applies deletes, then patches, then posts in a single database transaction. We route edits (patches) through here because the standalone PATCH/PUT verbs aren't usable in our setup, and because it lets "remove others + assert target" happen without a window where the name resolves to nothing. */
191
188
  export declare function batchRecords(zoneId: string, batch: {
192
189
  deletes?: {
193
190
  id: string;
@@ -227,6 +224,8 @@ declare module "sliftutils/misc/https/hostServer" {
227
224
  portFallback?: {
228
225
  /** Delay until the next main-port acquisition attempt (tightened around the predecessor's scheduled death) */
229
226
  getAcquireDelay: () => number;
227
+ /** Called when the main port turned out to be busy, before we act as its successor in any way. Throwing aborts startup - a busy port with no deploy in progress means something else holds it, which is not a state to keep running in. */
228
+ onPortInUse?: () => Promise<void>;
230
229
  /** Reports every port we become reachable on (the alternate at mount, the main port once relayed) */
231
230
  onListening: (port: number, isMainPort: boolean) => void;
232
231
  };
@@ -1075,8 +1074,7 @@ declare module "sliftutils/storage/BulkDatabase2/BulkDatabase2" {
1075
1074
  * "someone else is already merging".
1076
1075
  */
1077
1076
  tryMergeNow(): Promise<MergeAttemptResult>;
1078
- /** Rewrite everything written in [timeLo, timeHi] into fresh key-sorted bulk file(s). Low-level;
1079
- * most callers want compact() or tryMergeNow(). */
1077
+ /** Rewrite everything written in [timeLo, timeHi] into fresh key-sorted bulk file(s). Low-level; most callers want compact() or tryMergeNow(). */
1080
1078
  merge(timeLo: number, timeHi: number): Promise<void>;
1081
1079
  }
1082
1080
  export declare class MobxReactiveDeps implements ReactiveDeps {
@@ -2131,11 +2129,12 @@ declare module "sliftutils/storage/IArchives" {
2131
2129
  validWindow: [number, number];
2132
2130
  /** Sharding: the fraction of the key space this source handles, as [start, end) over [0, 1) (keys are routed by getRoute in remoteConfig.ts). Defaults to FULL_ROUTE (unsharded). At every point in time the sources' routes must fully cover [0, 1), or some keys could never be read. */
2133
2131
  route?: [number, number];
2132
+ /** Set on entries injected into the in-memory config by an overlay (a deploy switchover's alternate-port window). Never written to disk: resolveIntermediateSources strips these and rejoins the windows around them, which is also how a client tells whether an update is a real configuration change or just an overlay. */
2133
+ intermediate?: boolean;
2134
2134
  };
2135
2135
  export type HostedConfig = CommonConfig & {
2136
2136
  type: "remote";
2137
2137
  url: string;
2138
- accountName?: string;
2139
2138
  public?: boolean;
2140
2139
  fast?: boolean;
2141
2140
  writeDelay?: number;
@@ -2207,8 +2206,7 @@ declare module "sliftutils/storage/IArchives" {
2207
2206
  };
2208
2207
  export interface IArchives {
2209
2208
  getDebugName(): string;
2210
- /** Whether writes would be accepted (credentials exist, the account trusts this machine, etc).
2211
- * Checked without writing anything. */
2209
+ /** Whether writes would be accepted (credentials exist, the account trusts this machine, etc). Checked without writing anything. */
2212
2210
  hasWriteAccess(): Promise<boolean>;
2213
2211
  get(fileName: string, config?: {
2214
2212
  range?: {
@@ -2846,7 +2844,6 @@ declare module "sliftutils/storage/remoteStorage/ArchivesRemote" {
2846
2844
  import { IArchives, ArchiveFileInfo, ArchivesConfig, ArchivesSyncStatus } from "../IArchives";
2847
2845
  export type ArchivesRemoteConfig = {
2848
2846
  url: string;
2849
- accountName?: string;
2850
2847
  waitForAccess?: boolean;
2851
2848
  };
2852
2849
  export declare function parseStorageUrl(url: string): {
@@ -2872,9 +2869,7 @@ declare module "sliftutils/storage/remoteStorage/ArchivesRemote" {
2872
2869
  private lastDeniedLog;
2873
2870
  getDebugName(): string;
2874
2871
  isConnected(): boolean;
2875
- ping(): Promise<{
2876
- takeover?: string;
2877
- }>;
2872
+ ping(): Promise<{}>;
2878
2873
  private authenticate;
2879
2874
  private callAuthed;
2880
2875
  waitingForAccess(): Promise<{
@@ -3067,6 +3062,7 @@ declare module "sliftutils/storage/remoteStorage/blobStore" {
3067
3062
  constructor(folder: string, sources: ArchivesSource[], config?: {
3068
3063
  onIndexChanged?: ((key: string) => void) | undefined;
3069
3064
  readerDiskLimit?: number | undefined;
3065
+ onWriteCounted?: ((kind: "original" | "flushed", bytes: number) => void) | undefined;
3070
3066
  } | undefined);
3071
3067
  private stopped;
3072
3068
  private index;
@@ -3091,20 +3087,12 @@ declare module "sliftutils/storage/remoteStorage/blobStore" {
3091
3087
  private countEntry;
3092
3088
  private setIndexEntry;
3093
3089
  private deleteIndexEntry;
3094
- /** Applies a config change to the RUNNING store: windows/routes update in place, new sources
3095
- * are added (their sync starts immediately), and removed sources' slots go dead (their scans
3096
- * stop, their index entries drop). The store survives every routine config evolution - it is
3097
- * never destroyed for a source-list change, only for structural flips it cannot express
3098
- * (rawDisk). Pending fast writes are re-capped to the new flush deadline (flushing
3099
- * immediately when it has already passed). */
3090
+ /** Applies a config change to the RUNNING store: windows/routes update in place, new sources are added (their sync starts immediately), and removed sources' slots go dead (their scans stop, their index entries drop). The store survives every routine config evolution - it is never destroyed for a source-list change, only for structural flips it cannot express (rawDisk). Pending fast writes are re-capped to the new flush deadline (flushing immediately when it has already passed). */
3100
3091
  updateSources(specs: BlobSourceSpec[]): void;
3101
3092
  private removeSource;
3102
- /** Rescans our own disk's metadata into the index - used around valid window handoffs, where
3103
- * another process wrote files to the shared folder that our index hasn't seen. */
3093
+ /** Rescans our own disk's metadata into the index - used around valid window handoffs, where another process wrote files to the shared folder that our index hasn't seen. */
3104
3094
  rescanBase(): Promise<void>;
3105
- /** A boundary scan of the node that owned (part of) our route in the valid window before ours,
3106
- * when that node is different storage (a disk rescan can't see its writes): just its changes
3107
- * since the boundary neighborhood, with matching values pulled onto our own disk. */
3095
+ /** A boundary scan of the node that owned (part of) our route in the valid window before ours, when that node is different storage (a disk rescan can't see its writes): just its changes since the boundary neighborhood, with matching values pulled onto our own disk. */
3108
3096
  boundaryScanRemote(source: IArchives, config: {
3109
3097
  since: number;
3110
3098
  route?: [number, number];
@@ -3123,8 +3111,7 @@ declare module "sliftutils/storage/remoteStorage/blobStore" {
3123
3111
  readerDiskLimit?: number;
3124
3112
  syncing: SyncActivity[];
3125
3113
  };
3126
- /** Walks the whole index for exact totals - more expensive than getSyncProgress, but immune to
3127
- * any drift in the maintained counters (and loads the index first, so it's never cold zeros). */
3114
+ /** Walks the whole index for exact totals - more expensive than getSyncProgress, but immune to any drift in the maintained counters (and loads the index first, so it's never cold zeros). */
3128
3115
  computeIndexTotals(): Promise<{
3129
3116
  fileCount: number;
3130
3117
  byteCount: number;
@@ -3198,6 +3185,8 @@ declare module "sliftutils/storage/remoteStorage/createArchives" {
3198
3185
  /// <reference types="node" />
3199
3186
  import { IArchives, RemoteConfig, RemoteConfigBase, HostedConfig, BackblazeConfig, ArchiveFileInfo, ArchivesConfig, ArchivesSyncStatus } from "../IArchives";
3200
3187
  import { ServerBucketInfo } from "./storageServerState";
3188
+ /** The address, port, account, and bucket name a bucket routing URL addresses. Throws when the URL isn't a hosted bucket routing URL (https://host:port/file/<account>/<bucketName>/storage/storagerouting.json). */
3189
+ export { parseHostedUrl, parseBackblazeUrl, getBucketBaseUrl } from "./remoteConfig";
3201
3190
  export declare function createApiArchives(source: HostedConfig | BackblazeConfig): IArchives;
3202
3191
  export declare class ArchivesChain implements IArchives {
3203
3192
  private configured;
@@ -3267,12 +3256,7 @@ declare module "sliftutils/storage/remoteStorage/createArchives" {
3267
3256
  getChangesAfter(time: number): Promise<ArchiveFileInfo[]>;
3268
3257
  getSyncStatus(): Promise<ArchivesSyncStatus>;
3269
3258
  getConfig(): Promise<ArchivesConfig>;
3270
- /** True only when EVERY write-receiving source would accept our writes (partial write access
3271
- * desynchronizes sources, so it counts as no access). */
3272
3259
  hasWriteAccess(): Promise<boolean>;
3273
- /** Returns the full key written. Plain keys come back unchanged; keys containing VARIABLE_SHARD
3274
- * are automatically materialized (a shard value is picked and embedded, see setVariableShard)
3275
- * and the caller needs the returned key to ever read the value back. */
3276
3260
  set(fileName: string, data: Buffer, config?: {
3277
3261
  lastModified?: number;
3278
3262
  }): Promise<string>;
@@ -3287,58 +3271,43 @@ declare module "sliftutils/storage/remoteStorage/createArchives" {
3287
3271
  dispose(): void;
3288
3272
  }
3289
3273
  export declare function createArchives(config: RemoteConfig | RemoteConfigBase): ArchivesChain;
3290
- /** Every bucket an account has on one storage server - active and inactive - with each bucket's
3291
- * configuration. One authenticated call (the normal trust system applies): no ArchivesChain, no
3292
- * synchronization, and inactive buckets on the server stay inactive. Any URL addressing the
3293
- * server works (a bucket routing URL, or just https://host:port). */
3294
3274
  export declare function listServerBuckets(config: {
3295
3275
  url: string;
3296
3276
  account: string;
3297
3277
  }): Promise<ServerBucketInfo[]>;
3298
- /** Live info for one bucket given its routing URL (getConfig: routing config, index totals, disk
3299
- * limit, in-progress synchronization). One authenticated call to that server - a light, safe
3300
- * alternative to instantiating an ArchivesChain, which would start synchronization machinery. */
3278
+ /** Zeroes the write statistics listServerBuckets reports, for every bucket in the account. */
3279
+ export declare function clearServerWriteStats(config: {
3280
+ url: string;
3281
+ account: string;
3282
+ }): Promise<{
3283
+ clearedBuckets: number;
3284
+ }>;
3301
3285
  export declare function getBucketInfo(config: {
3302
3286
  url: string;
3303
- accountName?: string;
3304
3287
  }): Promise<ArchivesConfig>;
3305
3288
 
3306
3289
  }
3307
3290
 
3308
3291
  declare module "sliftutils/storage/remoteStorage/deployTakeover" {
3309
- import { RemoteConfig } from "../IArchives";
3310
- export type TakeoverEvent = "remapChanged";
3311
- /** Starts the takeover machinery. Port fallback (alternate port + registry + acquisition polling)
3312
- * works regardless; without a deploy timeline folder the switchover-specific parts (the remap,
3313
- * the tighter acquisition pacing) simply stay inert. */
3314
- export declare function initDeployTakeover(config: {
3315
- domain: string;
3316
- mainPort: number;
3317
- storageFolder: string;
3318
- }): Promise<void>;
3319
- /** Called when we had to listen on an alternate port (the main port was still held by our
3320
- * predecessor): registers it so the predecessor can route the middle overlap window to us. */
3321
- export declare function registerAltPort(port: number): Promise<void>;
3322
- export declare function onTakeoverEvent(listener: (event: TakeoverEvent) => void): void;
3323
- /** The interpretation overlay: splits every source pointing at our domain+main port so the middle
3324
- * of the deploy overlap points at the alternate port. Pure, in-memory only - the stored routing
3325
- * config is never modified, and this must never be applied to data that gets persisted. */
3326
- export declare function applyDeployRemap(routing: RemoteConfig): RemoteConfig;
3327
- /** A stamp of the current remap interpretation, advertised in ping responses - so every connected
3328
- * client learns of a takeover within one ping interval, instead of waiting for its config poll
3329
- * or a write rejection. */
3330
- export declare function getTakeoverStamp(): string | undefined;
3331
- /** The middle-window alternate port of an active remap. The OTHER process of the takeover lives on
3332
- * this port on OUR machine (same disk!), so sources pointing at it are self, never sync targets. */
3333
- export declare function getTakeoverAltPort(): number | undefined;
3334
- /** For the dying process of a takeover: our own process's data ends at the write handoff - fast
3335
- * writes must be on disk by then. Undefined for the successor and in normal operation. Both
3336
- * processes share the config identity (all self windows look like "ours" to both), so this is
3337
- * the only way the dying side knows the post-handoff windows belong to the other process. */
3338
- export declare function getOwnWindowEndClip(): number | undefined;
3339
- /** How long to wait between main-port acquisition attempts: tight around the predecessor's
3340
- * scheduled death (when the port actually frees), relaxed otherwise. */
3292
+ type DeployTakeover = {
3293
+ releaseTime: number;
3294
+ overlapTime: number;
3295
+ altPort?: number;
3296
+ };
3297
+ /** Called when the main port is already in use, which on a healthy machine only happens while our predecessor is still running a deploy overlap. Confirms that against the deploy timeline; if no deploy is in progress we are in a bad state (someone else holds our port) and the process must not keep running. */
3298
+ export declare function detectDeployTakeover(): Promise<DeployTakeover>;
3299
+ export declare function setAltPort(port: number): void;
3300
+ /** The window in which writes belong to our alternate port: from the release until our predecessor is killed and we take the main port. */
3301
+ export declare function getTakeoverIntermediate(): {
3302
+ start: number;
3303
+ end: number;
3304
+ altPort: number;
3305
+ } | undefined;
3306
+ /** We never stop listening on the alternate port while its window is still valid, and hold it well past that for clients that have not caught up yet. */
3307
+ export declare function getAltPortListenEnd(): number;
3308
+ /** How long to wait between main-port acquisition attempts: tight around our predecessor's scheduled death (when the port actually frees), relaxed otherwise. */
3341
3309
  export declare function getMainPortAcquireDelay(): number;
3310
+ export {};
3342
3311
 
3343
3312
  }
3344
3313
 
@@ -3347,6 +3316,31 @@ declare module "sliftutils/storage/remoteStorage/grantAccessCli" {
3347
3316
 
3348
3317
  }
3349
3318
 
3319
+ declare module "sliftutils/storage/remoteStorage/intermediateSources" {
3320
+ import { RemoteConfig, HostedConfig, BackblazeConfig } from "../IArchives";
3321
+ export declare const INTERMEDIATE_EXPIRE_GRACE: number;
3322
+ /** Adding or removing intermediates is a real config update, so it takes a real version increment - but a proportional one, so it stays far below whatever the author's next version would be (whether they count 1, 2, 3 or use timestamps), and a million of them still fit under it. */
3323
+ export declare function nextIntermediateVersion(version: number): number;
3324
+ type ObjectSource = HostedConfig | BackblazeConfig;
3325
+ export declare function getIntermediateSources(config: RemoteConfig): ObjectSource[];
3326
+ export declare function hasIntermediateSources(config: RemoteConfig): boolean;
3327
+ /** Removes every intermediate entry and rejoins the windows it split, giving back the underlying configuration. Two configs that resolve equal differ only by intermediates. */
3328
+ export declare function resolveIntermediateSources(config: RemoteConfig): RemoteConfig;
3329
+ /** Splits every source at splitUrl covering [start, end) so that middle window points at intermediateUrl instead, flagged as intermediate. Idempotent: a config that already contains the exact intermediate comes back unchanged. */
3330
+ export declare function injectIntermediateSource(config: RemoteConfig, inject: {
3331
+ splitUrl: string;
3332
+ intermediateUrl: string;
3333
+ start: number;
3334
+ end: number;
3335
+ }): RemoteConfig;
3336
+ /** Intermediates whose window ended more than INTERMEDIATE_EXPIRE_GRACE ago are removed, and the windows they split are rejoined. */
3337
+ export declare function expireIntermediateSources(config: RemoteConfig, now: number): RemoteConfig;
3338
+ /** The url of the entry an intermediate was split out of - the neighbour it touches. */
3339
+ export declare function findSplitUrl(config: RemoteConfig, intermediate: ObjectSource): string | undefined;
3340
+ export {};
3341
+
3342
+ }
3343
+
3350
3344
  declare module "sliftutils/storage/remoteStorage/remoteConfig" {
3351
3345
  /// <reference types="node" />
3352
3346
  /// <reference types="node" />
@@ -3382,7 +3376,7 @@ declare module "sliftutils/storage/remoteStorage/remoteConfig" {
3382
3376
  }
3383
3377
 
3384
3378
  declare module "sliftutils/storage/remoteStorage/sourceWrapper" {
3385
- import { IArchives, HostedConfig, BackblazeConfig } from "../IArchives";
3379
+ import { IArchives, HostedConfig, BackblazeConfig, RemoteConfig } from "../IArchives";
3386
3380
  import { ArchivesUrl } from "./ArchivesUrl";
3387
3381
  export declare const RETRY_START_DELAY: number;
3388
3382
  export declare const RETRY_MAX_DELAY: number;
@@ -3398,41 +3392,30 @@ declare module "sliftutils/storage/remoteStorage/sourceWrapper" {
3398
3392
  private reconnectRunning;
3399
3393
  private accessCache?;
3400
3394
  private constructor();
3401
- /** Config updates routinely just move a source's valid window (the last window extends
3402
- * forever, then gets reduced when a new entry is appended). The wrapper survives that: only
3403
- * the window changes, keeping the connection, pings, and latency history. */
3395
+ /** Config updates routinely just move a source's valid window (the last window extends forever, then gets reduced when a new entry is appended). The wrapper survives that: only the window changes, keeping the connection, pings, and latency history. */
3404
3396
  updateValidWindow(validWindow: [number, number]): void;
3405
3397
  static create(config: HostedConfig | BackblazeConfig, options?: {
3406
3398
  background?: boolean;
3407
3399
  }): Promise<SourceWrapper>;
3408
3400
  getDebugName(): string;
3409
3401
  isConnected(): boolean;
3410
- /** Call after a request failed while isConnected() was false: starts (if not already running)
3411
- * the background reconnect loop. Never blocks - the failed request still throws. */
3402
+ /** Call after a request failed while isConnected() was false: starts (if not already running) the background reconnect loop. Never blocks - the failed request still throws. */
3412
3403
  noteFailure(): void;
3413
3404
  private reconnectLoop;
3414
3405
  private checkAccess;
3415
3406
  read<T>(run: (archives: IArchives) => Promise<T>): Promise<T>;
3407
+ readRoutingConfig(): Promise<RemoteConfig | undefined>;
3416
3408
  hasWriteAccess(): Promise<boolean>;
3417
3409
  private pings;
3418
3410
  private pingTimer;
3419
3411
  private loggedConnected;
3420
- private lastTakeoverStamp;
3421
- /** Fired when the source's advertised takeover stamp changes (a deploy takeover started or
3422
- * ended) - the chain refreshes its config, so connected clients learn within one ping. */
3423
- onServedConfigChanged: (() => void) | undefined;
3424
- /** Starts measuring this source's latency (for variable-shard target preference). Only hosted
3425
- * remotes are pinged; our own local server counts as 0, everything else as Infinity. */
3412
+ /** Starts measuring this source's latency (for variable-shard target preference). Only hosted remotes are pinged; our own local server counts as 0, everything else as Infinity. */
3426
3413
  startPinging(): void;
3427
- /** Seeds the latency estimate before the first ping lands (e.g. from the initial routing
3428
- * fetch), so variable-shard picking has something immediately. Real pings take over from the
3429
- * first measurement on. */
3414
+ /** Seeds the latency estimate before the first ping lands (e.g. from the initial routing fetch), so variable-shard picking has something immediately. Real pings take over from the first measurement on. */
3430
3415
  seedLatency(ms: number): void;
3431
- /** Median of the recent pings. Sources that can't be pinged sort last (Infinity), except our
3432
- * own in-process server, which is the best possible target (0). */
3416
+ /** Median of the recent pings. Sources that can't be pinged sort last (Infinity), except our own in-process server, which is the best possible target (0). */
3433
3417
  getLatency(): number;
3434
- /** Writes always go through the API, so a permission error throws to the caller on every write
3435
- * (and access granted in the meantime is picked up automatically). */
3418
+ /** Writes always go through the API, so a permission error throws to the caller on every write (and access granted in the meantime is picked up automatically). */
3436
3419
  write<T>(run: (archives: IArchives) => Promise<T>): Promise<T>;
3437
3420
  dispose(): void;
3438
3421
  }
@@ -3487,13 +3470,9 @@ declare module "sliftutils/storage/remoteStorage/storageController" {
3487
3470
  grantAccessCommand?: string;
3488
3471
  trustedMachines?: TrustRecord[];
3489
3472
  };
3490
- /** Called by storageServerState the moment any routing config is applied - clients must never
3491
- * have to wait for a poll to learn the topology changed. */
3492
3473
  export declare function broadcastRoutingChanged(): void;
3493
3474
  export declare const RemoteStorageController: import("socket-function/SocketFunctionTypes").SocketRegistered<{
3494
- ping: () => Promise<{
3495
- takeover?: string;
3496
- }>;
3475
+ ping: () => Promise<{}>;
3497
3476
  authenticate: (token: AuthToken) => Promise<{
3498
3477
  machineId: string;
3499
3478
  ip: string;
@@ -3534,6 +3513,9 @@ declare module "sliftutils/storage/remoteStorage/storageController" {
3534
3513
  getChangesAfter: (account: string, bucketName: string, time: number) => Promise<ArchiveFileInfo[]>;
3535
3514
  getArchivesConfig: (account: string, bucketName: string) => Promise<ArchivesConfig>;
3536
3515
  listBuckets: (account: string) => Promise<ServerBucketInfo[]>;
3516
+ clearWriteStats: (account: string) => Promise<{
3517
+ clearedBuckets: number;
3518
+ }>;
3537
3519
  getIndexInfo: (account: string, bucketName: string) => Promise<{
3538
3520
  fileCount: number;
3539
3521
  byteCount: number;
@@ -3595,7 +3577,16 @@ declare module "sliftutils/storage/remoteStorage/storageServerState" {
3595
3577
  export declare function assertWritesAllowed(): void;
3596
3578
  export declare function getTrust(): Promise<IStorage<TrustRecord>>;
3597
3579
  export declare function getRequests(): Promise<IStorage<AccessRequest[]>>;
3598
- /** Makes machineIds the complete trust list for the account: machines not in the list lose access, machines already trusted keep their existing record, and missing ones are added. */
3580
+ export type BucketWriteStats = {
3581
+ /** Every set call the bucket accepted */
3582
+ originalWrites: number;
3583
+ originalBytes: number;
3584
+ /** What actually reached the sources. Fast writes coalesce repeated writes to the same key, so this is lower than the original counts (and is what the disk actually did). */
3585
+ flushedWrites: number;
3586
+ flushedBytes: number;
3587
+ };
3588
+ /** Zeroes the write statistics of every bucket in the account, including counts not yet flushed. */
3589
+ export declare function clearAccountWriteStats(account: string): Promise<number>;
3599
3590
  export declare function setTrustedMachines(config: {
3600
3591
  account: string;
3601
3592
  machineIds: string[];
@@ -3611,6 +3602,7 @@ declare module "sliftutils/storage/remoteStorage/storageServerState" {
3611
3602
  structureKey: string;
3612
3603
  };
3613
3604
  export declare function addExtraListenPort(port: number): void;
3605
+ export declare function removeExtraListenPort(port: number): void;
3614
3606
  export declare function getLoadedBucket(account: string, bucketName: string): Promise<LoadedBucket | undefined>;
3615
3607
  export declare function assertMutable(bucket: LoadedBucket, filePath: string, writeTime: number): Promise<void>;
3616
3608
  export declare function writeBucketFile(account: string, bucketName: string, filePath: string, data: Buffer, config?: {
@@ -3618,16 +3610,29 @@ declare module "sliftutils/storage/remoteStorage/storageServerState" {
3618
3610
  }): Promise<void>;
3619
3611
  export declare function getBucketConfig(bucket: LoadedBucket): ArchivesConfig;
3620
3612
  export declare function rebuildAllLoadedBuckets(): Promise<void>;
3613
+ /** Started by deployTakeover once we are actually a deploy successor listening on an alternate port. Until then there are no switchover windows to write or expire, so nothing polls. */
3614
+ export declare const startIntermediateMaintenance: {
3615
+ (): void;
3616
+ reset(): void;
3617
+ set(newValue: void): void;
3618
+ };
3619
+ export type BucketDiskInfo = {
3620
+ totalBytes: number;
3621
+ freeBytes: number;
3622
+ usedBytes: number;
3623
+ };
3621
3624
  export type ServerBucketInfo = {
3622
3625
  bucketName: string;
3623
3626
  active: boolean;
3627
+ /** Where the bucket's data lives on this server */
3628
+ folder: string;
3629
+ /** The drive that folder is on. Buckets sharing a drive report the same numbers. */
3630
+ disk?: BucketDiskInfo;
3631
+ diskError?: string;
3632
+ writeStats?: BucketWriteStats;
3624
3633
  config?: ArchivesConfig;
3625
3634
  error?: string;
3626
3635
  };
3627
- /** Every bucket the account has on this server, active or not, each with its configuration.
3628
- * Inactive buckets are inspected straight from disk WITHOUT loading them - loading would start
3629
- * their synchronization, and old invalid buckets must stay inert (their parse error is reported
3630
- * instead). */
3631
3636
  export declare function listAccountBuckets(account: string): Promise<ServerBucketInfo[]>;
3632
3637
  export declare function deleteBucketFile(account: string, bucketName: string, filePath: string): Promise<void>;
3633
3638
  export declare function getLocalArchives(account: string, bucketName: string): IArchives;
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ "use strict"; var console = (function shimConsole() { let baseConsole = globalThis.console; if (typeof window !== "undefined") return baseConsole; let name = __filename.replaceAll("\\", "/").split("/").pop(); let dirName = __dirname.replaceAll("\\", "/").split("/").pop(); let context = { __FILE__: __filename, __DIR__: __dirname, __NAME__: name, __DIRNAME__: dirName }; let newConsole = { ...baseConsole }; for (let shim of ["log", "info", "warn", "error"]) { newConsole[shim] = (...args) => { args.push(context); baseConsole[shim](...args); }; } newConsole.__context = context; return newConsole; })(); "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true , configurable: true});
3
3
  //exports.isInBrowser = exports.isInBuild = exports.triggerIsInBuild = exports.isInElectron = exports.isInChromeExtensionContentScript = exports.isInChromeExtensionBackground = exports.isInChromeExtension = void 0;
4
4
  /// <reference types="@types/chrome/index.d.ts" />
@@ -47,4 +47,4 @@ function isInBrowser() {
47
47
  }
48
48
  exports.isInBrowser = isInBrowser;
49
49
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW52aXJvbm1lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJlbnZpcm9ubWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxrREFBa0Q7QUFDbEQsU0FBZ0IsbUJBQW1CO0lBQy9CLE9BQU8sT0FBTyxNQUFNLEtBQUssV0FBVyxJQUFJLE1BQU0sQ0FBQyxPQUFPLElBQUksTUFBTSxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUM7QUFDaEYsQ0FBQztBQUZELGtEQUVDO0FBQ0QsU0FBZ0IsNkJBQTZCO0lBQ3pDLElBQUksQ0FBQyxtQkFBbUIsRUFBRTtRQUFFLE9BQU8sS0FBSyxDQUFDO0lBRXpDLDBFQUEwRTtJQUMxRSxJQUFJLE9BQVEsVUFBa0IsQ0FBQyxhQUFhLEtBQUssVUFBVSxJQUFJLE9BQU8sUUFBUSxLQUFLLFdBQVcsRUFBRSxDQUFDO1FBQzdGLE9BQU8sSUFBSSxDQUFDO0lBQ2hCLENBQUM7SUFFRCwrQkFBK0I7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dW5jdGlvbiBpc0luQ2hyb21lRXh0ZW5zaW9uQ29udGVudFNjcmlwdCgpIHtcbiAgICByZXR1cm4gaXNJbkNocm9tZUV4dGVuc2lvbigpICYmICFpc0luQ2hyb21lRXh0ZW5zaW9uQmFja2dyb3VuZCgpO1xufVxuZXhwb3J0IGZ1bmN0aW9uIGlzSW5FbGVjdHJvbigpIHtcbiAgICByZXR1cm4gdHlwZW9mIHByb2Nlc3MgIT09IFwidW5kZWZpbmVkXCIgJiYgcHJvY2Vzcy52ZXJzaW9ucyAmJiBwcm9jZXNzLnZlcnNpb25zLmVsZWN0cm9uO1xufVxubGV0IGlzSW5CdWlsZEZsYWcgPSBmYWxzZTtcbmV4cG9ydCBmdW5jdGlvbiB0cmlnZ2VySXNJbkJ1aWxkKCkge1xuICAgIGlzSW5CdWlsZEZsYWcgPSB0cnVlO1xufVxuZXhwb3J0IGZ1bmN0aW9uIGlzSW5CdWlsZCgpIHtcbiAgICByZXR1cm4gaXNJbkJ1aWxkRmxhZztcbn1cbmV4cG9ydCBmdW5jdGlvbiBpc0luQnJvd3NlcigpIHtcbiAgICByZXR1cm4gdHlwZW9mIGRvY3VtZW50ICE9PSBcInVuZGVmaW5lZFwiO1xufSJdfQ==
50
- /* _JS_SOURCE_HASH = "c7ee18b0b3ad11aeba561c3dc6daba53159677e35bde1c50775ffdf74982b40f"; */
50
+ /* _JS_SOURCE_HASH = "de8507c9fce2fb9b79361d996ea125431343dc38988e6c870ee82c7049032ba0"; */
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ "use strict"; var console = (function shimConsole() { let baseConsole = globalThis.console; if (typeof window !== "undefined") return baseConsole; let name = __filename.replaceAll("\\", "/").split("/").pop(); let dirName = __dirname.replaceAll("\\", "/").split("/").pop(); let context = { __FILE__: __filename, __DIR__: __dirname, __NAME__: name, __DIRNAME__: dirName }; let newConsole = { ...baseConsole }; for (let shim of ["log", "info", "warn", "error"]) { newConsole[shim] = (...args) => { args.push(context); baseConsole[shim](...args); }; } newConsole.__context = context; return newConsole; })(); "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -136,4 +136,4 @@ function setSecret(key, value) {
136
136
  }
137
137
  exports.setSecret = setSecret;
138
138
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U2VjcmV0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZ2V0U2VjcmV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0EseURBQW9EO0FBQ3BELDZDQUFxQztBQUVyQyxNQUFNLG1CQUFtQixHQUFHLFNBQVMsQ0FBQztBQUV0QyxTQUFTLGFBQWEsQ0FBQyxHQUFXO0lBQzlCLE9BQU8sbUJBQW1CLEdBQUcsR0FBRyxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDL0QsQ0FBQztBQUVELFNBQWdCLFdBQVcsQ0FBQyxHQUFXO0lBQ25DLElBQUksSUFBQSxvQkFBTSxHQUFFLEVBQUUsQ0FBQztRQUNYLE1BQU0sSUFBSSxLQUFLLENBQUMsOENBQThDLENBQUMsQ0FBQztJQUNwRSxDQUFDO0lBQ0QsWUFBWSxDQUFDLFVBQVUsQ0FBQyxhQUFhLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztBQUNoRCxDQUFDO0FBTEQsa0NBS0M7QUFFWSxRQUFBLFNBQVMsR0FBRyxJQUFBLGVBQUssRUFBQyxLQUFLLFVBQVUsU0FBUyxDQUFDLEdBQVc7O0lBQy9ELElBQUksSUFBQSxvQkFBTSxHQUFFLEVBQUUsQ0FBQztRQUNYLE1BQU0sRUFBRSxHQUFHLHdEQUFhLElBQUksR0FBQyxDQUF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9uOiBcImNvbHVtblwiLCBnYXA6IDEwIH0gfSxcbiAgICAgICAgICAgICAgICAgICAgcHJlYWN0LmNyZWF0ZUVsZW1lbnQoXCJkaXZcIiwgeyBzdHlsZTogeyBmb250V2VpZ2h0OiBcImJvbGRcIiB9IH0sIGBFbnRlciBzZWNyZXQgZm9yOiAke2tleX1gKSxcbiAgICAgICAgICAgICAgICAgICAgcHJlYWN0LmNyZWF0ZUVsZW1lbnQoXCJpbnB1dFwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZTogeyBwYWRkaW5nOiAxMCwgZm9udFNpemU6IDE2IH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBvbklucHV0OiAoZTogRXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZS52YWx1ZSA9IChlLnRhcmdldCBhcyBIVE1MSW5wdXRFbGVtZW50KS52YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBvbktleURvd246IChlOiBLZXlib2FyZEV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuY29kZSA9PT0gXCJFbnRlclwiICYmIHN0YXRlLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsU3RvcmFnZS5zZXRJdGVtKHN0b3JhZ2VLZXksIHN0YXRlLnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShzdGF0ZS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgIHByZWFjdC5jcmVhdGVFbGVtZW50KFwiYnV0dG9uXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlOiB7IHBhZGRpbmc6IDEwLCBmb250U2l6ZTogMTYsIGN1cnNvcjogXCJwb2ludGVyXCIgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdGUudmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxTdG9yYWdlLnNldEl0ZW0oc3RvcmFnZUtleSwgc3RhdGUudmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHN0YXRlLnZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LCBcIlNhdmVcIiksXG4gICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICksXG4gICAgICAgIH0pO1xuICAgIH0pO1xufSk7XG5cbmV4cG9ydCBmdW5jdGlvbiBzZXRTZWNyZXQoa2V5OiBzdHJpbmcsIHZhbHVlOiBzdHJpbmcpIHtcbiAgICBpZiAoaXNOb2RlKCkpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwic2V0U2VjcmV0IGlzIG9ubHkgc3VwcG9ydGVkIGluIHRoZSBicm93c2VyLiBXZSBkb24ndCB3YW50IHRvIGJyZWFrIHRoZSB1c2VyJ3MgZmlsZSBzeXN0ZW0gd2l0aCBzZXRTZWNyZXQgaW4gTm9kZUpTLlwiKTtcbiAgICB9XG4gICAgbG9jYWxTdG9yYWdlLnNldEl0ZW0oZ2V0U3RvcmFnZUtleShrZXkpLCB2YWx1ZSk7XG59XG4iXX0=
139
- /* _JS_SOURCE_HASH = "059a468ed50aafff48c682b57181b850933393c80cd3bc460912530e1d2ae39b"; */
139
+ /* _JS_SOURCE_HASH = "43dfc5991cbc841376e1b832e2b30c17341058ed45b2accd36ec4e823580f05b"; */
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ "use strict"; var console = (function shimConsole() { let baseConsole = globalThis.console; if (typeof window !== "undefined") return baseConsole; let name = __filename.replaceAll("\\", "/").split("/").pop(); let dirName = __dirname.replaceAll("\\", "/").split("/").pop(); let context = { __FILE__: __filename, __DIR__: __dirname, __NAME__: name, __DIRNAME__: dirName }; let newConsole = { ...baseConsole }; for (let shim of ["log", "info", "warn", "error"]) { newConsole[shim] = (...args) => { args.push(context); baseConsole[shim](...args); }; } newConsole.__context = context; return newConsole; })(); "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true , configurable: true});
3
3
  //exports.ellipsize = void 0;
4
4
  module.allowclient = true;
@@ -10,4 +10,4 @@ function ellipsize(text, maxLength) {
10
10
  }
11
11
  exports.ellipsize = ellipsize;
12
12
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5ncy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInN0cmluZ3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsTUFBTSxDQUFDLFdBQVcsR0FBRyxJQUFJLENBQUM7QUFFMUIsU0FBZ0IsU0FBUyxDQUFDLElBQVksRUFBRSxTQUFpQjtJQUNyRCxJQUFJLElBQUksQ0FBQyxNQUFNLElBQUksU0FBUyxFQUFFLENBQUM7UUFDM0IsT0FBTyxJQUFJLENBQUM7SUFDaEIsQ0FBQztJQUNELE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUUsU0FBUyxHQUFHLENBQUMsQ0FBQyxHQUFHLEtBQUssQ0FBQztBQUNoRCxDQUFDO0FBTEQsOEJBS0MiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuYWxsb3djbGllbnQgPSB0cnVlO1xuXG5leHBvcnQgZnVuY3Rpb24gZWxsaXBzaXplKHRleHQ6IHN0cmluZywgbWF4TGVuZ3RoOiBudW1iZXIpOiBzdHJpbmcge1xuICAgIGlmICh0ZXh0Lmxlbmd0aCA8PSBtYXhMZW5ndGgpIHtcbiAgICAgICAgcmV0dXJuIHRleHQ7XG4gICAgfVxuICAgIHJldHVybiB0ZXh0LnNsaWNlKDAsIG1heExlbmd0aCAtIDMpICsgXCIuLi5cIjtcbn1cbiJdfQ==
13
- /* _JS_SOURCE_HASH = "939b0010ad0403d8fcaea1dade14b758df80a31a6c0bd92352e5373b6bcdd033"; */
13
+ /* _JS_SOURCE_HASH = "7c28f5b0453f758b90a7c5426740a03efc1d246ca05a758851a7a212768dc4fa"; */
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ "use strict"; var console = (function shimConsole() { let baseConsole = globalThis.console; if (typeof window !== "undefined") return baseConsole; let name = __filename.replaceAll("\\", "/").split("/").pop(); let dirName = __dirname.replaceAll("\\", "/").split("/").pop(); let context = { __FILE__: __filename, __DIR__: __dirname, __NAME__: name, __DIRNAME__: dirName }; let newConsole = { ...baseConsole }; for (let shim of ["log", "info", "warn", "error"]) { newConsole[shim] = (...args) => { args.push(context); baseConsole[shim](...args); }; } newConsole.__context = context; return newConsole; })(); "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true , configurable: true});
3
3
  //exports.Zip = void 0;
4
4
  const compileFlags_1 = require("socket-function/require/compileFlags");
@@ -6,4 +6,4 @@ const Zip_1 = require("socket-function/src/Zip");
6
6
  Object.defineProperty(exports, "Zip", { enumerable: true, get: function () { return Zip_1.Zip; } , configurable: true});
7
7
  (0, compileFlags_1.setFlag)(require, "pako", "allowclient", true);
8
8
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiemlwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiemlwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUtBLHVFQUErRDtBQUUvRCxpREFBOEM7QUFHckMsb0ZBSEEsU0FBRyxPQUdBO0FBRlosSUFBQSxzQkFBTyxFQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsYUFBYSxFQUFFLElBQUksQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgaXNOb2RlIH0gZnJvbSBcInNvY2tldC1mdW5jdGlvbi9zcmMvbWlzY1wiO1xuaW1wb3J0IHsgbWVhc3VyZUZuYyB9IGZyb20gXCJzb2NrZXQtZnVuY3Rpb24vc3JjL3Byb2ZpbGluZy9tZWFzdXJlXCI7XG5pbXBvcnQgemxpYiBmcm9tIFwiemxpYlwiO1xuaW1wb3J0ICogYXMgcGFrbyBmcm9tIFwicGFrb1wiO1xuXG5pbXBvcnQgeyBzZXRGbGFnIH0gZnJvbSBcInNvY2tldC1mdW5jdGlvbi9yZXF1aXJlL2NvbXBpbGVGbGFnc1wiO1xuaW1wb3J0IHsgTWF5YmVQcm9taXNlIH0gZnJvbSBcInNvY2tldC1mdW5jdGlvbi9zcmMvdHlwZXNcIjtcbmltcG9ydCB7IFppcCB9IGZyb20gXCJzb2NrZXQtZnVuY3Rpb24vc3JjL1ppcFwiO1xuc2V0RmxhZyhyZXF1aXJlLCBcInBha29cIiwgXCJhbGxvd2NsaWVudFwiLCB0cnVlKTtcblxuZXhwb3J0IHsgWmlwIH07Il19
9
- /* _JS_SOURCE_HASH = "e6f5e41c7cc18d3b9672f00b99c29319324d9ea5f7c2c16c89b5b3b27906d35f"; */
9
+ /* _JS_SOURCE_HASH = "c12edb7a13e9f5bfb42f2fd9379966199847c174297f9f8cf3a6770cb8309264"; */