@powerhousedao/reactor-attachments 6.2.2-dev.7 → 6.2.2-dev.71

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.
@@ -74,6 +74,17 @@ declare class SizeMismatch extends Error {
74
74
  * state is learned from a remote transport that did not supply the full
75
75
  * Attachment-Pending header (transport-pending / degraded wire case).
76
76
  */
77
+ type AttachmentTransferStage = "download-target" | "switchboard-get" | "presigned-get" | "presigned-put";
78
+ /**
79
+ * Thrown when a remote transfer step fails. Identifies the stage only; it
80
+ * intentionally carries no URL, signature query, bucket key, or bearer
81
+ * material so it is always safe to log or surface.
82
+ */
83
+ declare class AttachmentTransferError extends Error {
84
+ readonly stage: AttachmentTransferStage;
85
+ readonly status: number | undefined;
86
+ constructor(stage: AttachmentTransferStage, status?: number);
87
+ }
77
88
  declare class AttachmentPending extends Error {
78
89
  readonly hash: AttachmentHash;
79
90
  readonly expiresAtUtc: string;
@@ -90,6 +101,11 @@ declare class AttachmentPending extends Error {
90
101
  }
91
102
  //#endregion
92
103
  //#region src/types.d.ts
104
+ type AttachmentBackendKind = "filesystem" | "s3";
105
+ type AttachmentBackendHealth = {
106
+ kind: AttachmentBackendKind;
107
+ ready: boolean;
108
+ };
93
109
  /**
94
110
  * Status of attachment data in the local store.
95
111
  * 'pending' is a virtual status synthesized at query time from live,
@@ -193,6 +209,72 @@ type AttachmentUploadResult = {
193
209
  ref: AttachmentRef;
194
210
  header: AttachmentHeader;
195
211
  };
212
+ /**
213
+ * Options for one byte transfer through an upload handle.
214
+ *
215
+ * `onProgress` is best-effort: a transport that cannot observe its own
216
+ * upload bytes (notably `fetch`, which exposes no upload-side progress)
217
+ * simply never calls it. Absence is the signal — there is no capability
218
+ * negotiation.
219
+ */
220
+ type AttachmentSendOptions = {
221
+ onProgress?: (loaded: number, total?: number) => void;
222
+ signal?: AbortSignal;
223
+ };
224
+ /**
225
+ * Options form of IAttachmentService.get. `documentId` anchors the download
226
+ * authorization for remote readers; it never becomes part of the ref or any
227
+ * global configuration.
228
+ */
229
+ type AttachmentDownloadOptions = {
230
+ documentId?: string;
231
+ signal?: AbortSignal;
232
+ };
233
+ /**
234
+ * Options for minting a raw download target without transferring bytes
235
+ * (previews, share links). `documentId` is required: targets are always
236
+ * document-authorized. `expiresIn` (seconds) requests a caller-chosen
237
+ * target lifetime; the server clamps it to its configured maximum.
238
+ */
239
+ type AttachmentDownloadTargetOptions = {
240
+ documentId: string;
241
+ expiresIn?: number;
242
+ signal?: AbortSignal;
243
+ };
244
+ /** Exact HTTP headers that must be sent with an attachment transfer target. */
245
+ type AttachmentTargetHeaders = Readonly<Record<string, string>>;
246
+ type SwitchboardAttachmentUploadTarget = {
247
+ kind: "switchboard";
248
+ method: "PUT";
249
+ url: string;
250
+ headers: AttachmentTargetHeaders;
251
+ expiresAtUtc?: string;
252
+ };
253
+ type PresignedPutAttachmentUploadTarget = {
254
+ kind: "presigned-put";
255
+ method: "PUT";
256
+ url: string;
257
+ headers: AttachmentTargetHeaders;
258
+ expiresAtUtc: string;
259
+ };
260
+ /** Provider-neutral target returned to a client that needs to upload bytes. */
261
+ type AttachmentUploadTarget = SwitchboardAttachmentUploadTarget | PresignedPutAttachmentUploadTarget;
262
+ type SwitchboardAttachmentDownloadTarget = {
263
+ kind: "switchboard";
264
+ method: "GET";
265
+ url: string;
266
+ headers: AttachmentTargetHeaders;
267
+ expiresAtUtc?: string;
268
+ };
269
+ type PresignedGetAttachmentDownloadTarget = {
270
+ kind: "presigned-get";
271
+ method: "GET";
272
+ url: string;
273
+ headers: AttachmentTargetHeaders;
274
+ expiresAtUtc: string;
275
+ };
276
+ /** Provider-neutral target returned to a client that needs to download bytes. */
277
+ type AttachmentDownloadTarget = SwitchboardAttachmentDownloadTarget | PresignedGetAttachmentDownloadTarget;
196
278
  /**
197
279
  * Response when retrieving attachment data from the local store.
198
280
  */
@@ -251,6 +333,12 @@ type Reservation = {
251
333
  expiresAtUtc: string;
252
334
  clientHash: string | null;
253
335
  sizeBytes: number | null;
336
+ /**
337
+ * Additive wire contract. Older Switchboards omit this field; current
338
+ * upload handles therefore continue to support their established send()
339
+ * behavior while target-aware clients are introduced incrementally.
340
+ */
341
+ uploadTarget?: AttachmentUploadTarget;
254
342
  };
255
343
  //#endregion
256
344
  //#region src/interfaces.d.ts
@@ -299,8 +387,23 @@ interface IAttachmentService {
299
387
  * expiresAtUtc. A wait inside get() would hold request handlers
300
388
  * open across multi-second windows and hide retry policy where
301
389
  * callers cannot tune it.
390
+ *
391
+ * The options form carries the document id that authorizes a remote
392
+ * download; local/direct readers ignore it. The bare-signal form remains
393
+ * supported for source compatibility.
394
+ */
395
+ get(ref: AttachmentRef, options?: AbortSignal | AttachmentDownloadOptions): Promise<AttachmentResponse>;
396
+ /**
397
+ * Obtain the raw, document-authorized download target for a ref without
398
+ * transferring any bytes. Used to mint direct URLs (previews, share
399
+ * links): a presigned target URL is a self-contained public capability
400
+ * until its expiry. `expiresIn` (seconds) requests a caller-chosen
401
+ * lifetime; the server clamps it to its configured maximum.
402
+ *
403
+ * @throws when the underlying store cannot produce download targets
404
+ * (local/direct stores serve bytes, not URLs).
302
405
  */
303
- get(ref: AttachmentRef, signal?: AbortSignal): Promise<AttachmentResponse>;
406
+ getDownloadTarget(ref: AttachmentRef, options: AttachmentDownloadTargetOptions): Promise<AttachmentDownloadTarget>;
304
407
  }
305
408
  /**
306
409
  * Upload handle returned by reserve(). Encapsulates all transport-specific
@@ -323,6 +426,8 @@ interface IAttachmentUpload {
323
426
  * Clients use this to bound retry windows and populate the pending-upload queue.
324
427
  */
325
428
  readonly expiresAtUtc: string;
429
+ /** Direct transfer target returned by target-capable server backends. */
430
+ readonly uploadTarget?: AttachmentUploadTarget;
326
431
  /**
327
432
  * Stream attachment data through this handle.
328
433
  *
@@ -345,8 +450,19 @@ interface IAttachmentUpload {
345
450
  * so the client can retry with the correct bytes.
346
451
  *
347
452
  * @returns The content hash, ref, and header for the uploaded attachment.
453
+ *
454
+ * `options.onProgress` reports bytes handed to the transport, when the
455
+ * transport can observe them at all -- some cannot, so it may never fire,
456
+ * and an implementation is free to ignore it.
457
+ *
458
+ * `options.signal` aborts the transfer in flight, and any implementation
459
+ * that moves bytes must honour it: reject with an `AbortError` and commit
460
+ * nothing. `useAttachmentUpload().cancel()` promises exactly that, so an
461
+ * implementation that quietly ran to completion would report a cancelled
462
+ * upload as done. A handle that transfers nothing itself (the S3 handle,
463
+ * which requires its presigned target) has nothing to abort.
348
464
  */
349
- send(data: ReadableStream<Uint8Array>): Promise<AttachmentUploadResult>;
465
+ send(data: ReadableStream<Uint8Array>, options?: AttachmentSendOptions): Promise<AttachmentUploadResult>;
350
466
  }
351
467
  /**
352
468
  * Read-only subset of IAttachmentStore.
@@ -383,8 +499,17 @@ interface IAttachmentReader {
383
499
  * @throws AttachmentPending if the hash is reserved by an in-flight
384
500
  * upload; bytes are not yet available. There is no store-level
385
501
  * wait -- polling is the caller's responsibility.
502
+ *
503
+ * `documentId` is the authorization anchor for remote readers that must
504
+ * negotiate a download target; local/direct readers ignore it.
505
+ */
506
+ get(hash: AttachmentHash, signal?: AbortSignal, documentId?: string): Promise<AttachmentResponse>;
507
+ /**
508
+ * Optional capability: readers that negotiate download targets with a
509
+ * remote control plane can expose the raw target so callers may mint
510
+ * direct URLs (previews, share links). Local/direct readers omit it.
386
511
  */
387
- get(hash: AttachmentHash, signal?: AbortSignal): Promise<AttachmentResponse>;
512
+ getDownloadTarget?(hash: AttachmentHash, options: AttachmentDownloadTargetOptions): Promise<AttachmentDownloadTarget>;
388
513
  }
389
514
  /**
390
515
  * Reactor-facing interface for managing local attachment data.
@@ -506,16 +631,39 @@ interface IReservationStore {
506
631
  interface IAttachmentUploadFactory {
507
632
  createUpload(reservation: Reservation): IAttachmentUpload;
508
633
  }
634
+ /**
635
+ * Server-side storage capability boundary. Authorization happens before these
636
+ * methods are called; actor, policy, and document concepts intentionally do
637
+ * not cross into the byte-storage backend.
638
+ */
639
+ interface IAttachmentBackend {
640
+ readonly kind: AttachmentBackendKind;
641
+ prepareUploadTarget(reservation: Reservation): Promise<AttachmentUploadTarget>;
642
+ /**
643
+ * `ttlSeconds` overrides the backend's configured download TTL for this
644
+ * one target (used for caller-chosen share-link lifetimes). Callers are
645
+ * responsible for bounding it; backends may still reject absurd values.
646
+ */
647
+ prepareDownloadTarget(hash: AttachmentHash, ttlSeconds?: number): Promise<AttachmentDownloadTarget>;
648
+ exists(hash: AttachmentHash): Promise<boolean>;
649
+ health(): Promise<AttachmentBackendHealth>;
650
+ }
651
+ //#endregion
652
+ //#region src/targets.d.ts
653
+ declare function parseAttachmentUploadTarget(value: unknown): AttachmentUploadTarget;
654
+ declare function parseAttachmentDownloadTarget(value: unknown): AttachmentDownloadTarget;
509
655
  //#endregion
510
656
  //#region src/attachment-service.d.ts
511
657
  declare class AttachmentService implements IAttachmentService {
512
658
  private readonly store;
513
659
  private readonly reservations;
514
660
  private readonly uploadFactory;
515
- constructor(store: IAttachmentReader, reservations: IReservationStore, uploadFactory: IAttachmentUploadFactory);
661
+ private readonly backend?;
662
+ constructor(store: IAttachmentReader, reservations: IReservationStore, uploadFactory: IAttachmentUploadFactory, backend?: IAttachmentBackend | undefined);
516
663
  reserve(options: ReserveAttachmentOptions): Promise<IAttachmentUpload>;
517
664
  stat(ref: AttachmentRef): Promise<AttachmentHeader>;
518
- get(ref: AttachmentRef, signal?: AbortSignal): Promise<AttachmentResponse>;
665
+ get(ref: AttachmentRef, options?: AbortSignal | AttachmentDownloadOptions): Promise<AttachmentResponse>;
666
+ getDownloadTarget(ref: AttachmentRef, options: AttachmentDownloadTargetOptions): Promise<AttachmentDownloadTarget>;
519
667
  private reserveHashFirst;
520
668
  }
521
669
  //#endregion
@@ -545,11 +693,86 @@ declare class SwitchboardAttachmentTransport implements IAttachmentTransport {
545
693
  private parseMetadataHeaders;
546
694
  }
547
695
  //#endregion
696
+ //#region src/switchboard/upload-transport.d.ts
697
+ /**
698
+ * The seam every attachment upload PUT goes through.
699
+ *
700
+ * It exists because `fetch` cannot report upload-side progress: there is no
701
+ * event between "request issued" and "response received". Naming the transport
702
+ * lets an implementation that *can* count bytes (see
703
+ * `createXhrUploadTransport`) be substituted without the upload code knowing
704
+ * which one it holds — and it is also the right seam for a future multipart
705
+ * upload, which needs one request per part.
706
+ */
707
+ /**
708
+ * Headers are forwarded VERBATIM. A presigned target's headers are part of a
709
+ * signature: normalizing their casing, or adding so much as one header,
710
+ * invalidates it.
711
+ */
712
+ type AttachmentUploadRequest = {
713
+ url: string;
714
+ method: "PUT";
715
+ headers: Record<string, string>;
716
+ body: Blob; /** Called with cumulative bytes handed to the socket, when observable. */
717
+ onProgress?: (loaded: number, total: number) => void;
718
+ signal?: AbortSignal;
719
+ };
720
+ /**
721
+ * The only response surface the upload code reads. A real `Response`
722
+ * satisfies this structurally, which is what lets the fetch transport be an
723
+ * identity pass-through rather than an adapter.
724
+ */
725
+ type AttachmentUploadResponse = {
726
+ readonly status: number;
727
+ readonly statusText: string;
728
+ readonly ok: boolean;
729
+ json(): Promise<unknown>;
730
+ };
731
+ type AttachmentUploadTransport = (request: AttachmentUploadRequest) => Promise<AttachmentUploadResponse>;
732
+ /**
733
+ * The default transport. Ignores `onProgress` — fetch has no upload-side
734
+ * progress event, and silence is how a transport reports that bytes are
735
+ * unobservable.
736
+ */
737
+ declare function createFetchUploadTransport(fetchFn: typeof fetch): AttachmentUploadTransport;
738
+ //#endregion
739
+ //#region src/switchboard/xhr-upload-transport.d.ts
740
+ type XhrUploadTransportOptions = {
741
+ /**
742
+ * Used where `XMLHttpRequest` does not exist (Node). Defaults to the global
743
+ * fetch, resolved at call time.
744
+ */
745
+ fetchFn?: typeof fetch;
746
+ };
747
+ /**
748
+ * Upload transport backed by `XMLHttpRequest`, the only browser API that
749
+ * reports upload-side byte progress (`xhr.upload.onprogress`). Everything else
750
+ * about the request is identical to the fetch path.
751
+ *
752
+ * Capability detection happens **inside** the returned function, never at
753
+ * module load: this module is reachable from the client entry, which is
754
+ * executed in Node by the entrypoint tests, and Node has no
755
+ * `XMLHttpRequest`. Detecting per call also means a test can install a fake on
756
+ * `globalThis` without any module-registry reset.
757
+ */
758
+ declare function createXhrUploadTransport(options?: XhrUploadTransportOptions): AttachmentUploadTransport;
759
+ //#endregion
548
760
  //#region src/switchboard/remote-reservation-store.d.ts
549
761
  type SwitchboardClientConfig = {
550
762
  remoteUrl: string;
551
763
  jwtHandler?: JwtHandler;
552
764
  fetchFn?: typeof fetch;
765
+ /**
766
+ * Transport for upload PUTs only, so a browser host can opt into
767
+ * XMLHttpRequest and get real upload progress.
768
+ *
769
+ * An explicit `fetchFn` always wins over this. The precedence is
770
+ * one-directional on purpose: under this rule, adding `uploadTransport` to a
771
+ * config that already pins `fetchFn` is a provable no-op, whereas the
772
+ * reverse rule would let `{ ...config, uploadTransport }` silently route the
773
+ * largest request in the system around a test's mock and onto the network.
774
+ */
775
+ uploadTransport?: AttachmentUploadTransport;
553
776
  };
554
777
  declare class RemoteReservationStore implements IReservationStore {
555
778
  private readonly remoteUrl;
@@ -567,11 +790,21 @@ declare class RemoteAttachmentUpload implements IAttachmentUpload {
567
790
  readonly reservationId: string;
568
791
  readonly ref: AttachmentRef | null;
569
792
  readonly expiresAtUtc: string;
793
+ readonly uploadTarget?: AttachmentUploadTarget;
794
+ private readonly reservation;
570
795
  private readonly remoteUrl;
571
796
  private readonly jwtHandler?;
572
- private readonly fetchFn;
797
+ private readonly uploadTransport;
573
798
  constructor(reservation: Reservation, config: SwitchboardClientConfig);
574
- send(data: ReadableStream<Uint8Array>): Promise<AttachmentUploadResult>;
799
+ send(data: ReadableStream<Uint8Array>, options?: AttachmentSendOptions): Promise<AttachmentUploadResult>;
800
+ /**
801
+ * Direct provider upload: PUT the bytes to the presigned URL with exactly
802
+ * the returned headers — never the Switchboard JWT — and treat any 2xx as
803
+ * final success with no follow-up control request. The result is
804
+ * synthesized from the hash-first reservation, which is the only path that
805
+ * can produce a presigned target.
806
+ */
807
+ private sendPresigned;
575
808
  }
576
809
  //#endregion
577
810
  //#region src/switchboard/remote-attachment-upload-factory.d.ts
@@ -595,7 +828,21 @@ declare class RemoteAttachmentStore implements IAttachmentReader {
595
828
  * AttachmentPending throw is the degraded-wire case.
596
829
  */
597
830
  stat(hash: AttachmentHash): Promise<AttachmentHeader>;
598
- get(hash: AttachmentHash, signal?: AbortSignal): Promise<AttachmentResponse>;
831
+ get(hash: AttachmentHash, signal?: AbortSignal, documentId?: string): Promise<AttachmentResponse>;
832
+ /**
833
+ * Asks Switchboard for an authorized download target. The request carries
834
+ * the JWT; the response is runtime-validated before any byte transfer.
835
+ * Public so callers can mint direct URLs (previews, share links) without
836
+ * transferring bytes; `expiresIn` requests a caller-chosen lifetime.
837
+ */
838
+ getDownloadTarget(hash: AttachmentHash, options: AttachmentDownloadTargetOptions): Promise<AttachmentDownloadTarget>;
839
+ /**
840
+ * Executes a presigned GET with exactly the returned headers and no JWT.
841
+ * A provider 404 means the object is missing despite available metadata
842
+ * (the accepted abandoned-upload trade-off) and surfaces as the same typed
843
+ * not-found error callers already handle.
844
+ */
845
+ private fetchPresigned;
599
846
  private fetchAttachment;
600
847
  }
601
848
  //#endregion
@@ -613,5 +860,5 @@ declare class NullAttachmentTransport implements IAttachmentTransport {
613
860
  push(): Promise<void>;
614
861
  }
615
862
  //#endregion
616
- export { ReserveAttachmentOptions as A, SizeMismatch as B, AttachmentMetadata as C, AttachmentUploadResult as D, AttachmentTransportConfig as E, AttachmentNotFound as F, AttachmentPending as I, HashMismatch as L, TransportResponse as M, UploadFirstReserveAttachmentOptions as N, HashFirstReserveAttachmentOptions as O, AttachmentAlreadyExists as P, InvalidAttachmentRef as R, AttachmentHeader as S, AttachmentStatus as T, UploadTooLarge as V, IAttachmentTransport as _, RemoteAttachmentUpload as a, IAttachmentUploadFactory as b, SwitchboardAttachmentTransport as c, createRef as d, parseRef as f, IAttachmentStore as g, IAttachmentService as h, RemoteAttachmentUploadFactory as i, TransportFetchResult as j, Reservation as k, SwitchboardTransportConfig as l, IAttachmentReader as m, createRemoteAttachmentService as n, RemoteReservationStore as o, AttachmentService as p, RemoteAttachmentStore as r, SwitchboardClientConfig as s, NullAttachmentTransport as t, ParsedRef as u, IAttachmentTransportFactory as v, AttachmentResponse as w, IReservationStore as x, IAttachmentUpload as y, ReservationNotFound as z };
617
- //# sourceMappingURL=null-attachment-transport-BBhQIk5A.d.ts.map
863
+ export { AttachmentPending as $, IReservationStore as A, AttachmentStatus as B, IAttachmentReader as C, IAttachmentTransportFactory as D, IAttachmentTransport as E, AttachmentDownloadTargetOptions as F, HashFirstReserveAttachmentOptions as G, AttachmentTransportConfig as H, AttachmentHeader as I, TransportFetchResult as J, Reservation as K, AttachmentMetadata as L, AttachmentBackendKind as M, AttachmentDownloadOptions as N, IAttachmentUpload as O, AttachmentDownloadTarget as P, AttachmentNotFound as Q, AttachmentResponse as R, IAttachmentBackend as S, IAttachmentStore as T, AttachmentUploadResult as U, AttachmentTargetHeaders as V, AttachmentUploadTarget as W, UploadFirstReserveAttachmentOptions as X, TransportResponse as Y, AttachmentAlreadyExists as Z, createRef as _, RemoteAttachmentUpload as a, SizeMismatch as at, parseAttachmentDownloadTarget as b, XhrUploadTransportOptions as c, AttachmentUploadResponse as d, AttachmentTransferError as et, AttachmentUploadTransport as f, ParsedRef as g, SwitchboardTransportConfig as h, RemoteAttachmentUploadFactory as i, ReservationNotFound as it, AttachmentBackendHealth as j, IAttachmentUploadFactory as k, createXhrUploadTransport as l, SwitchboardAttachmentTransport as m, createRemoteAttachmentService as n, HashMismatch as nt, RemoteReservationStore as o, UploadTooLarge as ot, createFetchUploadTransport as p, ReserveAttachmentOptions as q, RemoteAttachmentStore as r, InvalidAttachmentRef as rt, SwitchboardClientConfig as s, NullAttachmentTransport as t, AttachmentTransferStage as tt, AttachmentUploadRequest as u, parseRef as v, IAttachmentService as w, parseAttachmentUploadTarget as x, AttachmentService as y, AttachmentSendOptions as z };
864
+ //# sourceMappingURL=null-attachment-transport-CMrO_ZKA.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"null-attachment-transport-CMrO_ZKA.d.ts","names":[],"sources":["../src/errors.ts","../src/types.ts","../src/interfaces.ts","../src/targets.ts","../src/attachment-service.ts","../src/ref.ts","../src/switchboard/switchboard-attachment-transport.ts","../src/switchboard/upload-transport.ts","../src/switchboard/xhr-upload-transport.ts","../src/switchboard/remote-reservation-store.ts","../src/switchboard/remote-attachment-upload.ts","../src/switchboard/remote-attachment-upload-factory.ts","../src/switchboard/remote-attachment-store.ts","../src/switchboard/create-remote-attachment-service.ts","../src/null-attachment-transport.ts"],"mappings":";;;;;AAKA;cAAa,kBAAA,SAA2B,KAAA;cAC1B,UAAA;AAAA;;;;cASD,mBAAA,SAA4B,KAAA;cAC3B,aAAA;AAAA;;;;cASD,oBAAA,SAA6B,KAAA;cAC5B,GAAA;AAAA;;;AADd;;cAWa,cAAA,SAAuB,KAAA;EAAA,SACzB,QAAA;cACG,QAAA;AAAA;;;;AAFd;;cAca,uBAAA,SAAgC,KAAA;EAAA,SAClC,IAAA,EAAM,cAAA;EAAA,SACN,GAAA,EAAK,aAAA;cACF,IAAA,EAAM,cAAA,EAAgB,GAAA,EAAK,aAAA;AAAA;;;;AAHzC;;cAgBa,YAAA,SAAqB,KAAA;EAAA,SACvB,OAAA,EAAS,cAAA;EAAA,SACT,MAAA,EAAQ,cAAA;cACL,OAAA,EAAS,cAAA,EAAgB,MAAA,EAAQ,cAAA;AAAA;;;;;;;;;;;;cAmBlC,YAAA,SAAqB,KAAA;EAAA,SACvB,QAAA;EAAA,SACA,MAAA;cACG,QAAA,UAAkB,MAAA;AAAA;;;;;;;;;;;;KAmBpB,uBAAA;;;;;;cAWC,uBAAA,SAAgC,KAAA;EAAA,SAClC,KAAA,EAAO,uBAAA;EAAA,SACP,MAAA;cAEG,KAAA,EAAO,uBAAA,EAAyB,MAAA;AAAA;AAAA,cAYjC,iBAAA,SAA0B,KAAA;EAAA,SAC5B,IAAA,EAAM,cAAA;EAAA,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