swarm-deploy 0.0.0 → 0.1.0

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 (115) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/LICENSE.md +201 -0
  3. package/NOTICE.md +13 -0
  4. package/README.md +652 -0
  5. package/RELEASING.md +71 -0
  6. package/SECURITY.md +41 -0
  7. package/dist/abort.d.ts +16 -0
  8. package/dist/abort.js +52 -0
  9. package/dist/abort.js.map +1 -0
  10. package/dist/allowlist.d.ts +2 -0
  11. package/dist/allowlist.js +21 -0
  12. package/dist/allowlist.js.map +1 -0
  13. package/dist/bin/swarm-deploy.d.ts +2 -0
  14. package/dist/bin/swarm-deploy.js +41 -0
  15. package/dist/bin/swarm-deploy.js.map +1 -0
  16. package/dist/cli.d.ts +25 -0
  17. package/dist/cli.js +694 -0
  18. package/dist/cli.js.map +1 -0
  19. package/dist/client.d.ts +121 -0
  20. package/dist/client.js +285 -0
  21. package/dist/client.js.map +1 -0
  22. package/dist/direct-dht.d.ts +81 -0
  23. package/dist/direct-dht.js +254 -0
  24. package/dist/direct-dht.js.map +1 -0
  25. package/dist/error-code.d.ts +15 -0
  26. package/dist/error-code.js +30 -0
  27. package/dist/error-code.js.map +1 -0
  28. package/dist/errors.d.ts +27 -0
  29. package/dist/errors.js +33 -0
  30. package/dist/errors.js.map +1 -0
  31. package/dist/events-node.d.ts +2 -0
  32. package/dist/events-node.js +7 -0
  33. package/dist/events-node.js.map +1 -0
  34. package/dist/files.d.ts +47 -0
  35. package/dist/files.js +150 -0
  36. package/dist/files.js.map +1 -0
  37. package/dist/fs-node.d.ts +2 -0
  38. package/dist/fs-node.js +7 -0
  39. package/dist/fs-node.js.map +1 -0
  40. package/dist/identity.d.ts +7 -0
  41. package/dist/identity.js +50 -0
  42. package/dist/identity.js.map +1 -0
  43. package/dist/index.d.ts +8 -0
  44. package/dist/index.js +19 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/os-node.d.ts +2 -0
  47. package/dist/os-node.js +7 -0
  48. package/dist/os-node.js.map +1 -0
  49. package/dist/path-node.d.ts +2 -0
  50. package/dist/path-node.js +7 -0
  51. package/dist/path-node.js.map +1 -0
  52. package/dist/process-node.d.ts +2 -0
  53. package/dist/process-node.js +7 -0
  54. package/dist/process-node.js.map +1 -0
  55. package/dist/server.d.ts +153 -0
  56. package/dist/server.js +576 -0
  57. package/dist/server.js.map +1 -0
  58. package/dist/storage/atomic-file.d.ts +15 -0
  59. package/dist/storage/atomic-file.js +172 -0
  60. package/dist/storage/atomic-file.js.map +1 -0
  61. package/dist/storage/commit-journal.d.ts +83 -0
  62. package/dist/storage/commit-journal.js +279 -0
  63. package/dist/storage/commit-journal.js.map +1 -0
  64. package/dist/storage/commit-store.d.ts +246 -0
  65. package/dist/storage/commit-store.js +1339 -0
  66. package/dist/storage/commit-store.js.map +1 -0
  67. package/dist/storage/layout.d.ts +16 -0
  68. package/dist/storage/layout.js +403 -0
  69. package/dist/storage/layout.js.map +1 -0
  70. package/dist/storage/recovery.d.ts +99 -0
  71. package/dist/storage/recovery.js +253 -0
  72. package/dist/storage/recovery.js.map +1 -0
  73. package/dist/storage/retention.d.ts +163 -0
  74. package/dist/storage/retention.js +465 -0
  75. package/dist/storage/retention.js.map +1 -0
  76. package/dist/storage/root-coordinator.d.ts +7 -0
  77. package/dist/storage/root-coordinator.js +27 -0
  78. package/dist/storage/root-coordinator.js.map +1 -0
  79. package/dist/storage/session-store.d.ts +2 -0
  80. package/dist/storage/session-store.js +7 -0
  81. package/dist/storage/session-store.js.map +1 -0
  82. package/dist/storage/tar-session-store.d.ts +116 -0
  83. package/dist/storage/tar-session-store.js +816 -0
  84. package/dist/storage/tar-session-store.js.map +1 -0
  85. package/dist/storage/types.d.ts +62 -0
  86. package/dist/storage/types.js +3 -0
  87. package/dist/storage/types.js.map +1 -0
  88. package/dist/tar-protocol/controls.d.ts +48 -0
  89. package/dist/tar-protocol/controls.js +185 -0
  90. package/dist/tar-protocol/controls.js.map +1 -0
  91. package/dist/tar-protocol/direct-wire.d.ts +43 -0
  92. package/dist/tar-protocol/direct-wire.js +194 -0
  93. package/dist/tar-protocol/direct-wire.js.map +1 -0
  94. package/dist/tar-protocol/extract.d.ts +18 -0
  95. package/dist/tar-protocol/extract.js +124 -0
  96. package/dist/tar-protocol/extract.js.map +1 -0
  97. package/dist/tar-protocol/hash.d.ts +10 -0
  98. package/dist/tar-protocol/hash.js +44 -0
  99. package/dist/tar-protocol/hash.js.map +1 -0
  100. package/dist/tar-protocol/lifecycle.d.ts +13 -0
  101. package/dist/tar-protocol/lifecycle.js +90 -0
  102. package/dist/tar-protocol/lifecycle.js.map +1 -0
  103. package/dist/tar-protocol/manifest.d.ts +46 -0
  104. package/dist/tar-protocol/manifest.js +287 -0
  105. package/dist/tar-protocol/manifest.js.map +1 -0
  106. package/dist/tar-protocol/ustar.d.ts +22 -0
  107. package/dist/tar-protocol/ustar.js +87 -0
  108. package/dist/tar-protocol/ustar.js.map +1 -0
  109. package/dist/types.d.ts +58 -0
  110. package/dist/types.js +3 -0
  111. package/dist/types.js.map +1 -0
  112. package/dist/validation.d.ts +4 -0
  113. package/dist/validation.js +26 -0
  114. package/dist/validation.js.map +1 -0
  115. package/package.json +101 -1
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parseSeed = parseSeed;
7
+ exports.parsePublicKey = parsePublicKey;
8
+ exports.generateSeed = generateSeed;
9
+ exports.keyPairFromSeed = keyPairFromSeed;
10
+ exports.publicKeyFromSeed = publicKeyFromSeed;
11
+ const b4a_1 = __importDefault(require("b4a"));
12
+ const sodium_native_1 = __importDefault(require("sodium-native"));
13
+ const errors_js_1 = require("./errors.js");
14
+ const CANONICAL_HEX64 = /^[0-9a-f]{64}$/;
15
+ function parseCanonicalHex(value, code) {
16
+ if (typeof value !== 'string' || !CANONICAL_HEX64.test(value)) {
17
+ throw new errors_js_1.SwarmDeployError(code, `Expected lowercase 64-character hex string`);
18
+ }
19
+ return b4a_1.default.from(value, 'hex');
20
+ }
21
+ function parseSeed(value) {
22
+ return parseCanonicalHex(value, errors_js_1.ERRORS.INVALID_SEED);
23
+ }
24
+ function parsePublicKey(value) {
25
+ return parseCanonicalHex(value, errors_js_1.ERRORS.INVALID_PUBLIC_KEY);
26
+ }
27
+ function generateSeed() {
28
+ const seed = b4a_1.default.allocUnsafe(32);
29
+ sodium_native_1.default.randombytes_buf(seed);
30
+ return seed;
31
+ }
32
+ function normalizeSeed(seed) {
33
+ if (typeof seed === 'string')
34
+ return parseSeed(seed);
35
+ if (!b4a_1.default.isBuffer(seed) || seed.byteLength !== 32) {
36
+ throw new errors_js_1.SwarmDeployError(errors_js_1.ERRORS.INVALID_SEED, 'Expected 32-byte seed');
37
+ }
38
+ return b4a_1.default.from(seed);
39
+ }
40
+ function keyPairFromSeed(seed) {
41
+ const normalized = normalizeSeed(seed);
42
+ const publicKey = b4a_1.default.alloc(32);
43
+ const secretKey = b4a_1.default.alloc(64);
44
+ sodium_native_1.default.crypto_sign_seed_keypair(publicKey, secretKey, normalized);
45
+ return { publicKey, secretKey };
46
+ }
47
+ function publicKeyFromSeed(seed) {
48
+ return keyPairFromSeed(seed).publicKey;
49
+ }
50
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,8CAAqB;AACrB,kEAAkC;AAClC,2CAAsD;AAKtD,MAAM,eAAe,GAAG,gBAAgB,CAAA;AAExC,SAAS,iBAAiB,CACxB,KAAa,EACb,IAAmE;IAEnE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,4BAAgB,CAAC,IAAI,EAAE,4CAA4C,CAAC,CAAA;IAChF,CAAC;IACD,OAAO,aAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC/B,CAAC;AAED,mBAA0B,KAAa;IACrC,OAAO,iBAAiB,CAAC,KAAK,EAAE,kBAAM,CAAC,YAAY,CAAC,CAAA;AACtD,CAAC;AAED,wBAA+B,KAAa;IAC1C,OAAO,iBAAiB,CAAC,KAAK,EAAE,kBAAM,CAAC,kBAAkB,CAAC,CAAA;AAC5D,CAAC;AAED;IACE,MAAM,IAAI,GAAG,aAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IAChC,uBAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IAC5B,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,aAAa,CAAC,IAAe;IACpC,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAA;IACpD,IAAI,CAAC,aAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,KAAK,EAAE,EAAE,CAAC;QAClD,MAAM,IAAI,4BAAgB,CAAC,kBAAM,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAA;IAC1E,CAAC;IACD,OAAO,aAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC;AAED,yBAAgC,IAAe;IAC7C,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;IACtC,MAAM,SAAS,GAAG,aAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC/B,MAAM,SAAS,GAAG,aAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC/B,uBAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;IACjE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACjC,CAAC;AAED,2BAAkC,IAAe;IAC/C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,SAAS,CAAA;AACxC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { ERRORS, SwarmDeployError, type ErrorCode } from './errors.js';
2
+ export type { Binary, BinaryInput, Digest, FingerprintEvent, KeyPair, Logger, PublicKey, PublicKeyInput, Seed, SeedInput, ServerScheduler } from './types.js';
3
+ export { parseSeed, parsePublicKey, generateSeed, keyPairFromSeed, publicKeyFromSeed } from './identity.js';
4
+ export { parseAllowlist } from './allowlist.js';
5
+ export type { SkippedUploadReason } from './files.js';
6
+ export { Server, type AllowlistKey, type RecoveryEvent, type RetentionEvent, type ServerCloseEvent, type ServerConnectionEvent, type ServerEvent, type ServerEventName, type ServerEventMap, type ServerListeningEvent, type ServerOfferEvent, type ServerOptions, type ServerProgressEvent, type ServerTransferLifecycleEvent } from './server.js';
7
+ export { Client, type BatchUploadFailure, type BatchUploadResult, type ClientEvent, type ClientEventMap, type ClientEventName, type ClientOfferEvent, type ClientOptions, type ClientProgressEvent, type ClientResultEvent, type ClientUploadResult, type SkippedUploadEntry, type UploadResult, type UploadStatus } from './client.js';
8
+ export type { StorageAdapter, StorageFileHandle, StorageMkdirOptions, StorageReadResult, StorageRmOptions, StorageStatFs, StorageStats, StorageWriteResult } from './storage/types.js';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Client = exports.Server = exports.parseAllowlist = exports.publicKeyFromSeed = exports.keyPairFromSeed = exports.generateSeed = exports.parsePublicKey = exports.parseSeed = exports.SwarmDeployError = exports.ERRORS = void 0;
4
+ var errors_js_1 = require("./errors.js");
5
+ Object.defineProperty(exports, "ERRORS", { enumerable: true, get: function () { return errors_js_1.ERRORS; } });
6
+ Object.defineProperty(exports, "SwarmDeployError", { enumerable: true, get: function () { return errors_js_1.SwarmDeployError; } });
7
+ var identity_js_1 = require("./identity.js");
8
+ Object.defineProperty(exports, "parseSeed", { enumerable: true, get: function () { return identity_js_1.parseSeed; } });
9
+ Object.defineProperty(exports, "parsePublicKey", { enumerable: true, get: function () { return identity_js_1.parsePublicKey; } });
10
+ Object.defineProperty(exports, "generateSeed", { enumerable: true, get: function () { return identity_js_1.generateSeed; } });
11
+ Object.defineProperty(exports, "keyPairFromSeed", { enumerable: true, get: function () { return identity_js_1.keyPairFromSeed; } });
12
+ Object.defineProperty(exports, "publicKeyFromSeed", { enumerable: true, get: function () { return identity_js_1.publicKeyFromSeed; } });
13
+ var allowlist_js_1 = require("./allowlist.js");
14
+ Object.defineProperty(exports, "parseAllowlist", { enumerable: true, get: function () { return allowlist_js_1.parseAllowlist; } });
15
+ var server_js_1 = require("./server.js");
16
+ Object.defineProperty(exports, "Server", { enumerable: true, get: function () { return server_js_1.Server; } });
17
+ var client_js_1 = require("./client.js");
18
+ Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_js_1.Client; } });
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAsE;AAA7D,mGAAA,MAAM,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAcjC,6CAMsB;AALpB,wGAAA,SAAS,OAAA;AACT,6GAAA,cAAc,OAAA;AACd,2GAAA,YAAY,OAAA;AACZ,8GAAA,eAAe,OAAA;AACf,gHAAA,iBAAiB,OAAA;AAEnB,+CAA+C;AAAtC,8GAAA,cAAc,OAAA;AAEvB,yCAeoB;AAdlB,mGAAA,MAAM,OAAA;AAeR,yCAeoB;AAdlB,mGAAA,MAAM,OAAA"}
@@ -0,0 +1,2 @@
1
+ import os from 'node:os';
2
+ export = os;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const node_os_1 = __importDefault(require("node:os"));
6
+ module.exports = node_os_1.default;
7
+ //# sourceMappingURL=os-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"os-node.js","sourceRoot":"","sources":["../src/os-node.ts"],"names":[],"mappings":";;;;AAAA,sDAAwB;AAExB,iBAAS,iBAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ import path from 'node:path';
2
+ export = path;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const node_path_1 = __importDefault(require("node:path"));
6
+ module.exports = node_path_1.default;
7
+ //# sourceMappingURL=path-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-node.js","sourceRoot":"","sources":["../src/path-node.ts"],"names":[],"mappings":";;;;AAAA,0DAA4B;AAE5B,iBAAS,mBAAI,CAAA"}
@@ -0,0 +1,2 @@
1
+ import process from 'node:process';
2
+ export = process;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const node_process_1 = __importDefault(require("node:process"));
6
+ module.exports = node_process_1.default;
7
+ //# sourceMappingURL=process-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-node.js","sourceRoot":"","sources":["../src/process-node.ts"],"names":[],"mappings":";;;;AAAA,gEAAkC;AAElC,iBAAS,sBAAO,CAAA"}
@@ -0,0 +1,153 @@
1
+ import events from '#events';
2
+ import { type DirectDhtFactory, type DirectDhtNode } from './direct-dht.js';
3
+ import { type ErrorCode } from './errors.js';
4
+ import type { StorageAdapter } from './storage/types.js';
5
+ import type { AuthenticationEvent, FingerprintEvent, Logger, PublicKey, PublicKeyInput, SeedInput, ServerScheduler, TransferEvent, TransferLifecycleEvent } from './types.js';
6
+ declare const EventEmitter: typeof events;
7
+ declare const DEFAULT_MAX_CONNECTIONS = 64;
8
+ declare const DEFAULT_MAX_ACTIVE_UPLOADS = 8;
9
+ declare const DEFAULT_MIN_FREE_BYTES: number;
10
+ declare const MAX_CONNECTIONS = 1024;
11
+ declare const MAX_ACTIVE_UPLOADS = 1024;
12
+ declare const FINGERPRINT_LENGTH = 12;
13
+ export type ServerLogger = Logger;
14
+ export type AllowlistKey = PublicKeyInput | string;
15
+ export interface ServerOptions {
16
+ seed: SeedInput;
17
+ storageDir: string;
18
+ allowedKeys: Iterable<AllowlistKey>;
19
+ maxFileBytes: number;
20
+ maxStagingBytes: number;
21
+ maxConnections?: number;
22
+ maxActiveUploads?: number;
23
+ idleTimeout?: number;
24
+ cleanupInterval?: number;
25
+ resumeTtl?: number;
26
+ minFreeBytes?: number;
27
+ maxAge?: number;
28
+ maxStorageBytes?: number;
29
+ dht?: DirectDhtNode;
30
+ dhtFactory?: DirectDhtFactory;
31
+ storage?: StorageAdapter;
32
+ scheduler?: ServerScheduler;
33
+ logger?: Logger | null;
34
+ replaceNames?: Iterable<string>;
35
+ }
36
+ export interface ServerConnectionEvent extends FingerprintEvent {
37
+ connections: number;
38
+ }
39
+ export interface ServerListeningEvent {
40
+ fingerprint: string;
41
+ }
42
+ export interface ServerOfferEvent extends TransferEvent, FingerprintEvent {
43
+ status: 'accepted' | 'resumed' | 'reset' | 'rejected' | 'already-committed';
44
+ offset?: number;
45
+ reason?: ErrorCode;
46
+ }
47
+ export interface ServerProgressEvent extends TransferEvent, FingerprintEvent {
48
+ bytesReceived: number;
49
+ totalBytes: number;
50
+ }
51
+ export type ServerTransferLifecycleEvent = TransferLifecycleEvent & FingerprintEvent;
52
+ export interface RecoveryEvent {
53
+ status: 'started' | 'completed' | 'failed' | 'CORRUPT' | 'COMMITTED' | 'ABORTED' | 'RESUMABLE' | 'MISSING' | 'FILE_EXISTS';
54
+ transfer?: string;
55
+ phase?: 'classification' | 'sessions' | 'journal';
56
+ reason?: string;
57
+ journals?: number;
58
+ purgedSessions?: number;
59
+ }
60
+ export interface RetentionEvent {
61
+ trigger: 'startup' | 'scheduled' | 'manual' | 'commit' | 'post-commit';
62
+ status: 'completed' | 'deferred' | 'failed';
63
+ reason?: string;
64
+ expiredSessions?: number;
65
+ scrubbed?: number;
66
+ ageDeleted?: number;
67
+ storageDeleted?: number;
68
+ }
69
+ export interface ServerCloseEvent {
70
+ status: 'closed' | 'failed';
71
+ }
72
+ export interface ServerEventMap {
73
+ authentication: AuthenticationEvent;
74
+ connection: ServerConnectionEvent;
75
+ 'connection-open': ServerConnectionEvent;
76
+ 'connection-close': ServerConnectionEvent;
77
+ offer: ServerOfferEvent;
78
+ progress: ServerProgressEvent;
79
+ verification: ServerTransferLifecycleEvent;
80
+ commit: ServerTransferLifecycleEvent;
81
+ recovery: RecoveryEvent;
82
+ retention: RetentionEvent;
83
+ failure: FingerprintEvent & {
84
+ reason: ErrorCode;
85
+ };
86
+ listening: ServerListeningEvent;
87
+ close: ServerCloseEvent;
88
+ }
89
+ export type ServerEventName = keyof ServerEventMap;
90
+ export type ServerEvent = ServerEventMap[ServerEventName];
91
+ type SafeLogger = Required<Logger>;
92
+ declare function fingerprint(value: Uint8Array): string;
93
+ /** A static-allowlist direct HyperDHT artifact receiver. */
94
+ export interface Server {
95
+ on<EventName extends ServerEventName>(event: EventName, listener: (event: ServerEventMap[EventName]) => void): this;
96
+ on(event: string | symbol, listener: (...args: never[]) => void): this;
97
+ }
98
+ export declare class Server extends EventEmitter {
99
+ readonly publicKey: PublicKey;
100
+ readonly storageDir: string;
101
+ readonly maxFileBytes: number;
102
+ readonly maxStagingBytes: number;
103
+ readonly maxConnections: number;
104
+ readonly maxActiveUploads: number;
105
+ readonly idleTimeout: number;
106
+ readonly cleanupInterval: number;
107
+ readonly resumeTtl: number;
108
+ readonly minFreeBytes: number;
109
+ readonly maxAge: number | undefined;
110
+ readonly maxStorageBytes: number | undefined;
111
+ private readonly allowedKeySnapshot;
112
+ readonly logger: SafeLogger;
113
+ readonly dht: DirectDhtNode | undefined;
114
+ readonly dhtFactory: DirectDhtFactory | undefined;
115
+ readonly storage: StorageAdapter;
116
+ readonly scheduler: ServerScheduler;
117
+ readonly replaceNames: ReadonlySet<string>;
118
+ listening: boolean;
119
+ closed: boolean;
120
+ private readonly keyPair;
121
+ private readonly signal;
122
+ private readonly abort;
123
+ private readonly active;
124
+ private readonly activeUploads;
125
+ private readonly receives;
126
+ private layout;
127
+ private sessions;
128
+ private commits;
129
+ private retention;
130
+ private transport;
131
+ private releaseLock;
132
+ private listenPromise;
133
+ private closePromise;
134
+ constructor(options: ServerOptions);
135
+ private emitSafe;
136
+ private allowed;
137
+ private transfer;
138
+ private receive;
139
+ /**
140
+ * Retires a committed session without letting cleanup undo a durable commit.
141
+ *
142
+ * The artifact is already published at this point, so a failure to unlink the
143
+ * session leaves recoverable residue that `init()` purges on the next start.
144
+ * Propagating it here would abort before the terminal record and tell the
145
+ * client its upload failed after it had in fact succeeded.
146
+ */
147
+ private retireQuietly;
148
+ private start;
149
+ listen(): Promise<this>;
150
+ private dispose;
151
+ close(): Promise<void>;
152
+ }
153
+ export { DEFAULT_MAX_CONNECTIONS, DEFAULT_MAX_ACTIVE_UPLOADS, DEFAULT_MIN_FREE_BYTES, MAX_CONNECTIONS, MAX_ACTIVE_UPLOADS, FINGERPRINT_LENGTH, fingerprint };