@fedify/fedify 2.4.0-dev.1666 → 2.4.0-dev.1727

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 (150) hide show
  1. package/README.md +1 -1
  2. package/dist/{assert-CJ1KXcvv.mjs → assert-CebeUf0C.mjs} +1 -1
  3. package/dist/assert_exists-DtzkXC47.mjs +28 -0
  4. package/dist/assert_false-3pLLLsO4.mjs +23 -0
  5. package/dist/assert_greater_or_equal-BApOTh1h.mjs +30 -0
  6. package/dist/{assert_instance_of-Q9KTBnrf.mjs → assert_instance_of-g3WcyYNR.mjs} +1 -1
  7. package/dist/{assert_not_equals-EPJPoxuf.mjs → assert_not_equals-BN7yDMWe.mjs} +1 -1
  8. package/dist/assert_rejects-wFbSPn1O.mjs +39 -0
  9. package/dist/{assert_strict_equals-Ec20AUwa.mjs → assert_strict_equals-Bpjl4Psw.mjs} +1 -1
  10. package/dist/{assert_throws-NiFfqbnH.mjs → assert_throws-BJ5wuvR2.mjs} +1 -1
  11. package/dist/{builder-BGpBs-US.mjs → builder-f5-YwHfj.mjs} +5 -3
  12. package/dist/{circuit-breaker-CBGyz5F7.mjs → circuit-breaker-BT7CiPbz.mjs} +191 -9
  13. package/dist/circuit-breaker-test-utils-BYIHoliq.mjs +14 -0
  14. package/dist/{client-CjF5IYQS.mjs → client-CtxvmazV.mjs} +63 -5
  15. package/dist/{collection-BIhlldqK.mjs → collection-CnnP1UAv.mjs} +1 -1
  16. package/dist/compat/mod.cjs +1 -1
  17. package/dist/compat/mod.d.cts +1 -1
  18. package/dist/compat/mod.d.ts +1 -1
  19. package/dist/compat/mod.js +1 -1
  20. package/dist/compat/outgoing-jsonld.test.mjs +3 -3
  21. package/dist/compat/public-audience.test.mjs +3 -3
  22. package/dist/compat/transformers.test.mjs +5 -5
  23. package/dist/{context-C05Rgxmu.d.cts → context-B-dsBjZ9.d.cts} +281 -7
  24. package/dist/{context-Cjnr0ig1.d.ts → context-DrLXudbA.d.ts} +281 -7
  25. package/dist/{deno-CaQlEENR.mjs → deno-Deyoxesx.mjs} +1 -1
  26. package/dist/{docloader-CTm2Lcpn.mjs → docloader-B3kuDBg9.mjs} +2 -2
  27. package/dist/{esm-yYQfPhIY.mjs → esm-BHXXx4Wx.mjs} +13 -6
  28. package/dist/federation/builder.test.mjs +18 -5
  29. package/dist/federation/circuit-breaker.test.mjs +626 -7
  30. package/dist/federation/collection.test.mjs +3 -3
  31. package/dist/federation/handler.test.mjs +14 -13
  32. package/dist/federation/idempotency.test.mjs +6 -6
  33. package/dist/federation/inbox.test.mjs +3 -3
  34. package/dist/federation/keycache.test.mjs +5 -5
  35. package/dist/federation/kv.test.mjs +3 -3
  36. package/dist/federation/metrics.test.mjs +4 -4
  37. package/dist/federation/middleware.test.mjs +37 -28
  38. package/dist/federation/mod.cjs +18 -540
  39. package/dist/federation/mod.d.cts +3 -4
  40. package/dist/federation/mod.d.ts +3 -4
  41. package/dist/federation/mod.js +1 -1
  42. package/dist/federation/mq.test.mjs +32 -5
  43. package/dist/federation/negotiation.test.mjs +4 -4
  44. package/dist/federation/retry.test.mjs +3 -3
  45. package/dist/federation/router.test.mjs +7 -7
  46. package/dist/federation/send.test.mjs +28 -26
  47. package/dist/federation/tasks/codec.test.mjs +4 -4
  48. package/dist/federation/tasks/enqueue.test.mjs +4 -4
  49. package/dist/federation/tasks/tasks.test.mjs +6 -6
  50. package/dist/federation/temporal.test.mjs +4 -4
  51. package/dist/federation/webfinger.test.mjs +74 -12
  52. package/dist/{middleware-Dnzqy4sk.cjs → federation-BzRjeOky.cjs} +855 -114
  53. package/dist/{temporal-polyfill-BCdTHexd.cjs → http-AyKngJ_h.cjs} +2801 -104
  54. package/dist/{http-BX5xiNUh.js → http-Bw6s_dOB.js} +3 -3
  55. package/dist/{http-BaSuRiWJ.mjs → http-TjhZfiSN.mjs} +5 -5
  56. package/dist/{key-BvJYxJoY.mjs → key-b4kf4yZT.mjs} +2 -2
  57. package/dist/{kv-cache-BPapnm-V.cjs → kv-cache-BTVaZrf-.cjs} +2 -4
  58. package/dist/{kv-cache-C04NtL2n.js → kv-cache-CQsh-KUw.js} +1 -1
  59. package/dist/{kv-cache-B9fTkVpc.mjs → kv-cache-CpILvhUV.mjs} +1 -1
  60. package/dist/{ld-DU12IAt8.mjs → ld-CKujkAfG.mjs} +5 -5
  61. package/dist/{metrics-BYUxSscw.mjs → metrics-AlCGTDrr.mjs} +2 -2
  62. package/dist/metrics-DVKYY6K1.d.cts +36 -0
  63. package/dist/metrics-DoRtI0qU.d.ts +36 -0
  64. package/dist/{middleware-BEd40QBF.mjs → middleware-C9Y5lLZN.mjs} +60 -43
  65. package/dist/{middleware-_VQWtF1B.js → middleware-CZcuedl-.js} +241 -40
  66. package/dist/{middleware-C4oS_tdq.mjs → middleware-LPbZz6-1.mjs} +1 -1
  67. package/dist/{mod-BrpVsSfY.d.cts → mod-CLHkCwLm.d.cts} +3 -3
  68. package/dist/{mod-B0hW12_O.d.cts → mod-CuDDaIIt.d.cts} +1 -1
  69. package/dist/{mod-COIAjwRS.d.ts → mod-D-IhOEOP.d.ts} +1 -1
  70. package/dist/{mod-DdONo-ep.d.cts → mod-D-abvu2C.d.cts} +1 -1
  71. package/dist/{mod-BsCE5Ihq.d.ts → mod-D6O8C7eN.d.ts} +1 -1
  72. package/dist/{mod-CNef4in0.d.ts → mod-DypxPS9H.d.ts} +3 -3
  73. package/dist/mod.cjs +24 -25
  74. package/dist/mod.d.cts +8 -9
  75. package/dist/mod.d.ts +8 -9
  76. package/dist/mod.js +7 -7
  77. package/dist/nodeinfo/client.test.mjs +64 -4
  78. package/dist/nodeinfo/handler.test.mjs +5 -5
  79. package/dist/nodeinfo/mod.cjs +1 -1
  80. package/dist/nodeinfo/mod.d.cts +1 -1
  81. package/dist/nodeinfo/mod.d.ts +1 -1
  82. package/dist/nodeinfo/mod.js +1 -1
  83. package/dist/nodeinfo/types.test.mjs +4 -4
  84. package/dist/otel/exporter.test.mjs +3 -3
  85. package/dist/otel/mod.cjs +0 -1
  86. package/dist/otel/mod.d.cts +1 -1
  87. package/dist/otel/mod.d.ts +1 -1
  88. package/dist/{outgoing-jsonld-URuqsICz.mjs → outgoing-jsonld-BQSHRLhg.mjs} +2 -2
  89. package/dist/{owner-DFF9ltAs.mjs → owner-D1O8v8FB.mjs} +2 -2
  90. package/dist/{proof-rOoEb_P4.js → proof-BTBolSnd.js} +6 -6
  91. package/dist/{proof-DcbeTQMG.cjs → proof-DcSm-2eG.cjs} +10 -11
  92. package/dist/{proof-DEV-fO9I.mjs → proof-DeMR7Akd.mjs} +6 -6
  93. package/dist/{public-audience-Cr5MsnMq.mjs → public-audience--9hx7IGx.mjs} +1 -1
  94. package/dist/runtime/mod.cjs +1 -1
  95. package/dist/runtime/mod.js +1 -1
  96. package/dist/{send-BVkabUz0.mjs → send-DG7JG280.mjs} +3 -3
  97. package/dist/sig/accept.test.mjs +1 -1
  98. package/dist/sig/http.test.mjs +37 -11
  99. package/dist/sig/key.test.mjs +6 -6
  100. package/dist/sig/ld.test.mjs +9 -7
  101. package/dist/sig/mod.cjs +2 -2
  102. package/dist/sig/mod.d.cts +3 -3
  103. package/dist/sig/mod.d.ts +3 -3
  104. package/dist/sig/mod.js +2 -2
  105. package/dist/sig/owner.test.mjs +6 -6
  106. package/dist/sig/proof.test.mjs +10 -8
  107. package/dist/std__assert-CxFT0MNt.mjs +8 -0
  108. package/dist/{temporal-X0BllGgC.mjs → temporal-DA3jx8x1.mjs} +3 -3
  109. package/dist/testing/mod.d.mts +10 -0
  110. package/dist/testing/mod.mjs +2 -2
  111. package/dist/{testing-CO7ftO8A.mjs → testing-BX0Nicyq.mjs} +2 -2
  112. package/dist/{transformers-DGwl-hD1.cjs → transformers-BalCrSsr.cjs} +0 -1
  113. package/dist/{types-DC1pNgJA.js → types-Dtyf8lVj.js} +63 -5
  114. package/dist/{types-CPym83zc.cjs → types-RXm5YxpC.cjs} +62 -5
  115. package/dist/utils/docloader.test.mjs +7 -7
  116. package/dist/utils/kv-cache.test.mjs +1 -1
  117. package/dist/utils/mod.cjs +1 -1
  118. package/dist/utils/mod.d.cts +1 -1
  119. package/dist/utils/mod.d.ts +1 -1
  120. package/dist/utils/mod.js +1 -1
  121. package/package.json +7 -7
  122. package/skills/fedify/SKILL.md +462 -0
  123. package/dist/assert_rejects-EgstcQy5.mjs +0 -82
  124. package/dist/http-BIJdA1mF.cjs +0 -2694
  125. package/dist/metrics-DN13mCAw.d.cts +0 -294
  126. package/dist/metrics-v_e0n5GQ.d.ts +0 -294
  127. package/dist/std__assert-B2NnY9bq.mjs +0 -79
  128. /package/dist/{accept-8PiolDP7.mjs → accept-CPVqki78.mjs} +0 -0
  129. /package/dist/{activity-listener-BtTSxZWA.mjs → activity-listener-C-BSbKI7.mjs} +0 -0
  130. /package/dist/{assert_equals-BV7oLMxm.mjs → assert_equals-CBlRfA-_.mjs} +0 -0
  131. /package/dist/{client-CAM_bQXx.d.cts → client-D-XP_Ccb.d.cts} +0 -0
  132. /package/dist/{client-CSddvgWN.d.ts → client-D-XP_Ccb.d.ts} +0 -0
  133. /package/dist/{codec-BBga-FWI.mjs → codec-peqOdBaE.mjs} +0 -0
  134. /package/dist/{context-BJXxPElm.mjs → context-Dt36KFEJ.mjs} +0 -0
  135. /package/dist/{http-VyDTd4G3.d.cts → http-6TI0tI03.d.cts} +0 -0
  136. /package/dist/{http-lf8Hsd91.d.ts → http-CdrSn2ip.d.ts} +0 -0
  137. /package/dist/{keycache-_DHqz5z_.mjs → keycache-0Jk78XmB.mjs} +0 -0
  138. /package/dist/{keys-Dbyd7bhl.mjs → keys-DIJNHW-Y.mjs} +0 -0
  139. /package/dist/{kv-D6hNiMTK.d.ts → kv-BhNbN8Ed.d.cts} +0 -0
  140. /package/dist/{kv-gJ8LYbxX.d.cts → kv-BhNbN8Ed.d.ts} +0 -0
  141. /package/dist/{kv-CXBAok3k.mjs → kv-DCHkaJ9-.mjs} +0 -0
  142. /package/dist/{mq-Bo7Etgh6.mjs → mq-Dm1Wmtm-.mjs} +0 -0
  143. /package/dist/{negotiation-RuwrPFqi.mjs → negotiation-CCocWT_N.mjs} +0 -0
  144. /package/dist/{owner-CnngXDNJ.d.ts → owner-DGSfntI-.d.ts} +0 -0
  145. /package/dist/{owner-DEvZuyOE.d.cts → owner-r_waTiQj.d.cts} +0 -0
  146. /package/dist/{retry-DgFqeS5k.mjs → retry-zX5xw5e0.mjs} +0 -0
  147. /package/dist/{chunk-D5IdezsZ.js → rolldown-runtime-BC-Eo5Mj.js} +0 -0
  148. /package/dist/{chunk-Czpeue4M.cjs → rolldown-runtime-Dmm3t92W.cjs} +0 -0
  149. /package/dist/{transformers-DXze6FUB.js → transformers-DAtXl_Kc.js} +0 -0
  150. /package/dist/{types-CrtdVuDP.mjs → types-DE_LV1JB.mjs} +0 -0
@@ -1,11 +1,11 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { t as __exportAll } from "./chunk-D5IdezsZ.js";
4
- import { r as getDefaultActivityTransformers } from "./transformers-DXze6FUB.js";
5
- import { A as formatAcceptSignature, D as recordOutboxEnqueue, E as recordOutboxActivity, F as version, O as recordWebFingerHandle, P as name, S as recordCollectionTotalItems, T as recordInboxActivity, a as verifyRequestDetailed, b as recordCollectionPageItems, d as validateCryptoKey, f as getDurationMs, g as isAbortError, h as instrumentDocumentLoader, i as verifyRequest, k as registerQueueDepthGauge, m as getRemoteHost, n as parseRfc9421SignatureInput, o as exportJwk, p as getFederationMetrics, t as doubleKnock, u as importJwk, v as recordCircuitBreakerStateChange, w as recordFanoutRecipients, x as recordCollectionRequest, y as recordCollectionDispatchDuration } from "./http-BX5xiNUh.js";
6
- import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-rOoEb_P4.js";
7
- import { n as getNodeInfo, t as nodeInfoToJson } from "./types-DC1pNgJA.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-C04NtL2n.js";
3
+ import { t as __exportAll } from "./rolldown-runtime-BC-Eo5Mj.js";
4
+ import { r as getDefaultActivityTransformers } from "./transformers-DAtXl_Kc.js";
5
+ import { A as formatAcceptSignature, D as recordOutboxEnqueue, E as recordOutboxActivity, F as version, O as recordWebFingerHandle, P as name, S as recordCollectionTotalItems, T as recordInboxActivity, a as verifyRequestDetailed, b as recordCollectionPageItems, d as validateCryptoKey, f as getDurationMs, g as isAbortError, h as instrumentDocumentLoader, i as verifyRequest, k as registerQueueDepthGauge, m as getRemoteHost, n as parseRfc9421SignatureInput, o as exportJwk, p as getFederationMetrics, t as doubleKnock, u as importJwk, v as recordCircuitBreakerStateChange, w as recordFanoutRecipients, x as recordCollectionRequest, y as recordCollectionDispatchDuration } from "./http-Bw6s_dOB.js";
6
+ import { _ as hasSignatureLike, b as signJsonLd, c as getKeyOwner, f as compactJsonLd, g as hasSignature, h as getNormalizationContextLoader, i as verifyObject, l as InvalidContextReferenceError, m as detachSignature, n as hasProofLike, o as normalizeOutgoingActivityJsonLd, r as signObject, s as doesActorOwnKey, u as assertSafeJsonLd, v as isClearlyMalformedContextReference, w as wrapContextLoaderForJsonLd, x as verifyCompactJsonLd, y as isInvalidUrlTypeError } from "./proof-BTBolSnd.js";
7
+ import { n as getNodeInfo, t as nodeInfoToJson } from "./types-Dtyf8lVj.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CQsh-KUw.js";
9
9
  import { getLogger, withContext } from "@logtape/logtape";
10
10
  import { Router, RouterError, assertPath } from "@fedify/uri-template";
11
11
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
@@ -143,6 +143,8 @@ var FederationBuilderImpl = class {
143
143
  f.webFingerLinksDispatcher = this.webFingerLinksDispatcher;
144
144
  f.objectCallbacks = { ...this.objectCallbacks };
145
145
  f.objectTypeIds = { ...this.objectTypeIds };
146
+ f.collectionCallbacks = { ...this.collectionCallbacks };
147
+ f.collectionTypeIds = { ...this.collectionTypeIds };
146
148
  f.inboxPath = this.inboxPath;
147
149
  f.outboxPath = this.outboxPath;
148
150
  f.inboxCallbacks = this.inboxCallbacks == null ? void 0 : { ...this.inboxCallbacks };
@@ -722,7 +724,13 @@ function createFederationBuilder() {
722
724
  }
723
725
  //#endregion
724
726
  //#region src/federation/circuit-breaker.ts
725
- const MAX_CUSTOM_FAILURE_HISTORY = 100;
727
+ const LEGACY_SWEEP_MARKER = ["__fedify_meta", "circuit_breaker_state_ttl_sweep_v1"];
728
+ const LEGACY_SWEEP_DELETING_MARKER = { __fedifyDeletingCircuitBreakerLegacyState: true };
729
+ const CIRCUIT_BREAKER_STATE_VERSION = 1;
730
+ const LEGACY_SWEEP_LOCK_TTL = Temporal.Duration.from({ minutes: 5 });
731
+ const LEGACY_SWEEP_RETRY_WINDOW = Temporal.Duration.from({ hours: 168 });
732
+ const LEGACY_SWEEP_WAIT_INTERVAL = 10;
733
+ const LEGACY_SWEEP_CAS_ATTEMPTS = 3;
726
734
  /**
727
735
  * Tracks reachability state for remote outbox delivery hosts.
728
736
  * @since 2.3.0
@@ -732,6 +740,8 @@ var CircuitBreaker = class {
732
740
  #prefix;
733
741
  #options;
734
742
  #now;
743
+ #legacySweep;
744
+ #legacySweepDone;
735
745
  #stateChangeObserver;
736
746
  constructor(options) {
737
747
  this.#kv = options.kv;
@@ -748,6 +758,7 @@ var CircuitBreaker = class {
748
758
  return now.until(this.#capHeldRetryAt(now, heldSince, now.add(delay)));
749
759
  }
750
760
  async beforeSend(remoteHost, message) {
761
+ this.#sweepLegacyStates();
751
762
  const heldSince = parseHeldSince(message.circuitHeldSince);
752
763
  const now = this.#now();
753
764
  if (heldSince != null && Temporal.Instant.compare(heldSince.add(this.#options.heldActivityTtl), now) <= 0) return {
@@ -829,6 +840,7 @@ var CircuitBreaker = class {
829
840
  throw new Error(`Failed to update circuit breaker state for ${remoteHost}`);
830
841
  }
831
842
  async recordSuccess(remoteHost) {
843
+ this.#sweepLegacyStates();
832
844
  for (let attempt = 0; attempt < 10; attempt++) {
833
845
  const oldState = await this.#get(remoteHost);
834
846
  if (oldState == null) return void 0;
@@ -849,6 +861,7 @@ var CircuitBreaker = class {
849
861
  return await this.recordSuccess(remoteHost);
850
862
  }
851
863
  async recordFailure(remoteHost) {
864
+ this.#sweepLegacyStates();
852
865
  const now = this.#now();
853
866
  for (let attempt = 0; attempt < 10; attempt++) {
854
867
  const oldState = await this.#get(remoteHost);
@@ -896,26 +909,122 @@ var CircuitBreaker = class {
896
909
  }
897
910
  }
898
911
  async getState(remoteHost) {
899
- return await this.#get(remoteHost);
912
+ this.#sweepLegacyStates();
913
+ return stripStoredCircuitBreakerState(await this.#get(remoteHost));
914
+ }
915
+ /**
916
+ * The currently running background legacy sweep, if any.
917
+ * @internal
918
+ */
919
+ get pendingSweep() {
920
+ return this.#legacySweep;
900
921
  }
901
922
  #key(remoteHost) {
902
923
  return [...this.#prefix, remoteHost];
903
924
  }
925
+ #legacySweepMarkerKey() {
926
+ return [...this.#prefix, ...LEGACY_SWEEP_MARKER];
927
+ }
928
+ #sweepLegacyStates() {
929
+ if (this.#kv.cas == null) return;
930
+ if (this.#options.stateTtl == null) return;
931
+ if (this.#legacySweep != null) return;
932
+ if (this.#isLegacySweepDone()) return;
933
+ this.#legacySweep = this.#sweepLegacyStatesImpl().catch((error) => {
934
+ getLogger([
935
+ "fedify",
936
+ "federation",
937
+ "circuit"
938
+ ]).warn("Failed to sweep legacy circuit breaker state:\n{error}", { error });
939
+ }).finally(() => {
940
+ this.#legacySweep = void 0;
941
+ });
942
+ }
943
+ async #sweepLegacyStatesImpl() {
944
+ const markerKey = this.#legacySweepMarkerKey();
945
+ const marker = await this.#acquireLegacySweep(markerKey);
946
+ if (marker === "done") return;
947
+ try {
948
+ for await (const { key, value } of this.#kv.list(this.#prefix)) {
949
+ if (key.length !== this.#prefix.length + 1) continue;
950
+ await this.#migrateLegacyState(key, value);
951
+ }
952
+ } catch (error) {
953
+ await this.#deleteIfUnchanged(markerKey, marker);
954
+ throw error;
955
+ }
956
+ const finishedMarker = this.#finishLegacySweepMarker(marker);
957
+ if (await this.#kv.cas(markerKey, marker, finishedMarker)) this.#rememberLegacySweepMarker(finishedMarker);
958
+ }
959
+ #finishLegacySweepMarker(marker) {
960
+ const retryUntil = getLegacySweepRetryUntil(marker);
961
+ if (retryUntil != null && Temporal.Instant.compare(this.#now(), Temporal.Instant.from(retryUntil)) < 0) return {
962
+ state: "done",
963
+ retryUntil
964
+ };
965
+ return { state: "final" };
966
+ }
967
+ async #migrateLegacyState(key, value) {
968
+ if (isCurrentCircuitBreakerState(value)) return;
969
+ const state = parseCircuitBreakerKvState(value);
970
+ if (state != null) {
971
+ await this.#kv.cas(key, value, markCircuitBreakerState(state), this.#setOptions());
972
+ return;
973
+ }
974
+ await this.#deleteIfUnchanged(key, value);
975
+ }
976
+ async #deleteIfUnchanged(key, value) {
977
+ if (await this.#kv.cas(key, value, LEGACY_SWEEP_DELETING_MARKER, { ttl: LEGACY_SWEEP_LOCK_TTL })) await this.#kv.delete(key);
978
+ }
979
+ async #acquireLegacySweep(markerKey) {
980
+ for (let attempt = 0; attempt < LEGACY_SWEEP_CAS_ATTEMPTS; attempt++) {
981
+ const marker = await this.#kv.get(markerKey);
982
+ const now = this.#now();
983
+ if (isLegacySweepActive(marker, now)) {
984
+ this.#rememberLegacySweepMarker(marker);
985
+ return "done";
986
+ }
987
+ const retryUntil = isLegacySweepRetryDue(marker, now) ? marker.retryUntil : getLegacySweepRetryUntil(marker) ?? now.add(LEGACY_SWEEP_RETRY_WINDOW).toString();
988
+ const sweeping = {
989
+ state: "sweeping",
990
+ started: now.toString(),
991
+ retryUntil
992
+ };
993
+ if (await this.#kv.cas(markerKey, marker ?? void 0, sweeping, { ttl: LEGACY_SWEEP_LOCK_TTL })) return sweeping;
994
+ await delay(LEGACY_SWEEP_WAIT_INTERVAL);
995
+ }
996
+ return "done";
997
+ }
998
+ #isLegacySweepDone() {
999
+ if (this.#legacySweepDone === "final") return true;
1000
+ if (this.#legacySweepDone == null) return false;
1001
+ if (Temporal.Instant.compare(this.#now(), this.#legacySweepDone) < 0) return true;
1002
+ this.#legacySweepDone = void 0;
1003
+ return false;
1004
+ }
1005
+ #rememberLegacySweepMarker(marker) {
1006
+ const doneUntil = getLegacySweepDoneUntil(marker, this.#now());
1007
+ if (doneUntil != null) this.#legacySweepDone = doneUntil;
1008
+ }
904
1009
  #capHeldRetryAt(now, heldSince, retryAt) {
905
1010
  const expiresAt = (heldSince ?? now).add(this.#options.heldActivityTtl);
906
1011
  return Temporal.Instant.compare(expiresAt, retryAt) < 0 ? expiresAt : retryAt;
907
1012
  }
908
1013
  async #get(remoteHost) {
909
- return parseCircuitBreakerKvState(await this.#kv.get(this.#key(remoteHost)));
1014
+ return parseStoredCircuitBreakerKvState(await this.#kv.get(this.#key(remoteHost)));
910
1015
  }
911
1016
  async #replace(remoteHost, oldState, newState) {
912
1017
  const key = this.#key(remoteHost);
1018
+ const storedState = newState == null ? void 0 : markCircuitBreakerState(newState);
913
1019
  if (this.#kv.cas == null) {
914
- if (newState == null) await this.#kv.delete(key);
915
- else await this.#kv.set(key, newState);
1020
+ if (storedState == null) await this.#kv.delete(key);
1021
+ else await this.#kv.set(key, storedState, this.#setOptions());
916
1022
  return true;
917
1023
  }
918
- return await this.#kv.cas(key, oldState, newState);
1024
+ return await this.#kv.cas(key, oldState, storedState, storedState == null ? void 0 : this.#setOptions());
1025
+ }
1026
+ #setOptions() {
1027
+ return this.#options.stateTtl == null ? void 0 : { ttl: this.#options.stateTtl };
919
1028
  }
920
1029
  async #notifyStateChange(remoteHost, previousState, newState) {
921
1030
  try {
@@ -955,18 +1064,25 @@ var CircuitBreaker = class {
955
1064
  * @param options The public circuit breaker options supplied to Fedify.
956
1065
  * @returns The normalized failure predicate, failure pruning function,
957
1066
  * duration values, and optional callbacks with defaults applied.
958
- * @throws {RangeError} If any configured duration is not positive.
1067
+ * @throws {RangeError} If any configured duration is not positive, or if
1068
+ * `stateTtl` is shorter than `recoveryDelay`.
959
1069
  * @throws {TypeError} If `failureThreshold` is not a positive integer.
960
1070
  */
961
1071
  function normalizeCircuitBreakerOptions(options) {
962
1072
  const recoveryDelay = toInstantDuration(options.recoveryDelay ?? { minutes: 30 });
963
1073
  const heldActivityTtl = toInstantDuration(options.heldActivityTtl ?? { hours: 168 });
964
1074
  const releaseInterval = toInstantDuration(options.releaseInterval ?? { seconds: 1 });
1075
+ const configuredStateTtl = options.stateTtl == null ? void 0 : toInstantDuration(options.stateTtl);
965
1076
  assertPositiveDuration(recoveryDelay, "recoveryDelay");
966
1077
  assertPositiveDuration(heldActivityTtl, "heldActivityTtl");
967
1078
  assertPositiveDuration(releaseInterval, "releaseInterval");
1079
+ if (configuredStateTtl != null) {
1080
+ assertPositiveDuration(configuredStateTtl, "stateTtl");
1081
+ if (Temporal.Duration.compare(configuredStateTtl, recoveryDelay) < 0) throw new RangeError("stateTtl must be at least recoveryDelay.");
1082
+ }
968
1083
  let failure;
969
1084
  let pruneFailures;
1085
+ let stateTtl;
970
1086
  if (options.failure == null) {
971
1087
  const failureThreshold = options.failureThreshold ?? 5;
972
1088
  if (!Number.isInteger(failureThreshold) || failureThreshold <= 0) throw new TypeError("failureThreshold must be a positive integer.");
@@ -982,9 +1098,11 @@ function normalizeCircuitBreakerOptions(options) {
982
1098
  const last = timestamps[timestamps.length - 1];
983
1099
  return Temporal.Duration.compare(first.until(last), failureWindow) <= 0;
984
1100
  };
1101
+ stateTtl = configuredStateTtl ?? maxDuration(recoveryDelay.add(failureWindow), recoveryDelay.add(heldActivityTtl));
985
1102
  } else {
986
1103
  failure = options.failure;
987
- pruneFailures = (timestamps) => timestamps.slice(-MAX_CUSTOM_FAILURE_HISTORY);
1104
+ pruneFailures = (timestamps) => timestamps.slice(-100);
1105
+ stateTtl = configuredStateTtl;
988
1106
  }
989
1107
  return {
990
1108
  failure,
@@ -992,10 +1110,72 @@ function normalizeCircuitBreakerOptions(options) {
992
1110
  recoveryDelay,
993
1111
  heldActivityTtl,
994
1112
  releaseInterval,
1113
+ stateTtl,
995
1114
  onStateChange: options.onStateChange,
996
1115
  onActivityDrop: options.onActivityDrop
997
1116
  };
998
1117
  }
1118
+ function maxDuration(duration, ...durations) {
1119
+ return durations.reduce((max, candidate) => Temporal.Duration.compare(candidate, max) > 0 ? candidate : max, duration);
1120
+ }
1121
+ function isLegacySweepDone(value, now) {
1122
+ return getLegacySweepDoneUntil(value, now) != null;
1123
+ }
1124
+ function getLegacySweepDoneUntil(value, now) {
1125
+ if (typeof value !== "object" || value == null || !("state" in value)) return;
1126
+ if (value.state === "final") return "final";
1127
+ if (value.state === "done" && "retryUntil" in value && typeof value.retryUntil === "string") try {
1128
+ const retryUntil = Temporal.Instant.from(value.retryUntil);
1129
+ return Temporal.Instant.compare(now, retryUntil) < 0 ? retryUntil : void 0;
1130
+ } catch {
1131
+ return;
1132
+ }
1133
+ }
1134
+ function isLegacySweepRetryDue(value, now) {
1135
+ if (typeof value !== "object" || value == null || !("state" in value) || value.state !== "done" || !("retryUntil" in value) || typeof value.retryUntil !== "string") return false;
1136
+ try {
1137
+ return Temporal.Instant.compare(now, Temporal.Instant.from(value.retryUntil)) >= 0;
1138
+ } catch {
1139
+ return false;
1140
+ }
1141
+ }
1142
+ function isLegacySweepActive(value, now) {
1143
+ return isLegacySweepDone(value, now) || isLegacySweepInProgress(value, now);
1144
+ }
1145
+ function isLegacySweepInProgress(value, now) {
1146
+ if (typeof value !== "object" || value == null || !("state" in value) || value.state !== "sweeping" || !("started" in value) || typeof value.started !== "string") return false;
1147
+ try {
1148
+ return Temporal.Instant.compare(now, Temporal.Instant.from(value.started).add(LEGACY_SWEEP_LOCK_TTL)) < 0;
1149
+ } catch {
1150
+ return false;
1151
+ }
1152
+ }
1153
+ function getLegacySweepRetryUntil(value) {
1154
+ if (typeof value !== "object" || value == null || !("retryUntil" in value) || typeof value.retryUntil !== "string") return;
1155
+ try {
1156
+ Temporal.Instant.from(value.retryUntil);
1157
+ return value.retryUntil;
1158
+ } catch {
1159
+ return;
1160
+ }
1161
+ }
1162
+ function isCurrentCircuitBreakerState(value) {
1163
+ return typeof value === "object" && value != null && "__fedifyCircuitBreakerStateVersion" in value && value.__fedifyCircuitBreakerStateVersion === CIRCUIT_BREAKER_STATE_VERSION;
1164
+ }
1165
+ function markCircuitBreakerState(state) {
1166
+ return {
1167
+ ...state,
1168
+ __fedifyCircuitBreakerStateVersion: CIRCUIT_BREAKER_STATE_VERSION
1169
+ };
1170
+ }
1171
+ function stripStoredCircuitBreakerState(state) {
1172
+ if (state == null) return void 0;
1173
+ const { __fedifyCircuitBreakerStateVersion: _, ...publicState } = state;
1174
+ return publicState;
1175
+ }
1176
+ function delay(milliseconds) {
1177
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
1178
+ }
999
1179
  function toInstantDuration(duration) {
1000
1180
  const parsed = Temporal.Duration.from(duration);
1001
1181
  return Temporal.Duration.from({ milliseconds: Math.trunc(parsed.total({
@@ -1030,6 +1210,9 @@ function parseHeldSince(value) {
1030
1210
  * valid instant strings, or `undefined` when the stored value is malformed.
1031
1211
  */
1032
1212
  function parseCircuitBreakerKvState(value) {
1213
+ return stripStoredCircuitBreakerState(parseStoredCircuitBreakerKvState(value));
1214
+ }
1215
+ function parseStoredCircuitBreakerKvState(value) {
1033
1216
  const isInstantString = (v) => {
1034
1217
  if (typeof v !== "string") return false;
1035
1218
  try {
@@ -1049,7 +1232,8 @@ function parseCircuitBreakerKvState(value) {
1049
1232
  state: record.state,
1050
1233
  failures: record.failures,
1051
1234
  ...record.opened == null ? {} : { opened: record.opened },
1052
- ...record.halfOpened == null ? {} : { halfOpened: record.halfOpened }
1235
+ ...record.halfOpened == null ? {} : { halfOpened: record.halfOpened },
1236
+ ...record.__fedifyCircuitBreakerStateVersion === CIRCUIT_BREAKER_STATE_VERSION ? { __fedifyCircuitBreakerStateVersion: CIRCUIT_BREAKER_STATE_VERSION } : {}
1053
1237
  };
1054
1238
  }
1055
1239
  //#endregion
@@ -1064,7 +1248,7 @@ function parseCircuitBreakerKvState(value) {
1064
1248
  async function digest(uris) {
1065
1249
  const processed = /* @__PURE__ */ new Set();
1066
1250
  const encoder = new TextEncoder();
1067
- const result = new Uint8Array(32);
1251
+ const result = /* @__PURE__ */ new Uint8Array(32);
1068
1252
  for (const uri of uris) {
1069
1253
  const u = uri instanceof URL ? uri.href : uri;
1070
1254
  if (processed.has(u)) continue;
@@ -1459,7 +1643,7 @@ function isMalformedDurationLiteral(value) {
1459
1643
  return true;
1460
1644
  }
1461
1645
  }
1462
- const TEMPORAL_DATE_TIME_IRIS = new Set([
1646
+ const TEMPORAL_DATE_TIME_IRIS = /* @__PURE__ */ new Set([
1463
1647
  "https://www.w3.org/ns/activitystreams#deleted",
1464
1648
  "https://www.w3.org/ns/activitystreams#endTime",
1465
1649
  "https://www.w3.org/ns/activitystreams#published",
@@ -1468,7 +1652,7 @@ const TEMPORAL_DATE_TIME_IRIS = new Set([
1468
1652
  "http://purl.org/dc/terms/created",
1469
1653
  "https://w3id.org/security#created"
1470
1654
  ]);
1471
- const TEMPORAL_DURATION_IRIS = new Set(["https://www.w3.org/ns/activitystreams#duration"]);
1655
+ const TEMPORAL_DURATION_IRIS = /* @__PURE__ */ new Set(["https://www.w3.org/ns/activitystreams#duration"]);
1472
1656
  const QUESTION_CLOSED_IRI = "https://www.w3.org/ns/activitystreams#closed";
1473
1657
  const XSD_DATE_TIME_IRI = "http://www.w3.org/2001/XMLSchema#dateTime";
1474
1658
  function hasMalformedExpandedDateTimeLiteral(value) {
@@ -1612,7 +1796,7 @@ async function handleObject(request, { values, context, objectDispatcher, author
1612
1796
  Vary: "Accept"
1613
1797
  } });
1614
1798
  }
1615
- const BUILT_IN_COLLECTION_METRIC_KINDS = new Set([
1799
+ const BUILT_IN_COLLECTION_METRIC_KINDS = /* @__PURE__ */ new Set([
1616
1800
  "inbox",
1617
1801
  "outbox",
1618
1802
  "following",
@@ -3223,7 +3407,7 @@ async function respondWithObjectIfAcceptable(object, request, options) {
3223
3407
  return response;
3224
3408
  }
3225
3409
  function generateNonce() {
3226
- const bytes = new Uint8Array(16);
3410
+ const bytes = /* @__PURE__ */ new Uint8Array(16);
3227
3411
  crypto.getRandomValues(bytes);
3228
3412
  return btoa(String.fromCharCode(...bytes)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
3229
3413
  }
@@ -4099,6 +4283,24 @@ const logger = getLogger([
4099
4283
  "webfinger",
4100
4284
  "server"
4101
4285
  ]);
4286
+ function getWebFingerSubjectAndAliases({ resourceUrl, actorUri, preferredUsername, acctUsername, host, contextHost }) {
4287
+ const aliases = [];
4288
+ let subject = resourceUrl.href;
4289
+ if (resourceUrl.protocol != "acct:" && preferredUsername != null) {
4290
+ aliases.push(`acct:${preferredUsername}@${host ?? contextHost}`);
4291
+ if (host != null && host !== contextHost) aliases.push(`acct:${preferredUsername}@${contextHost}`);
4292
+ }
4293
+ if (resourceUrl.href !== actorUri.href) aliases.push(actorUri.href);
4294
+ if (resourceUrl.protocol === "acct:" && host != null && host !== contextHost && !resourceUrl.href.endsWith(`@${host}`)) {
4295
+ subject = `acct:${preferredUsername ?? acctUsername}@${host}`;
4296
+ aliases.push(resourceUrl.href);
4297
+ if (preferredUsername != null && preferredUsername !== "" && preferredUsername !== acctUsername) aliases.push(`acct:${preferredUsername}@${contextHost}`);
4298
+ }
4299
+ return {
4300
+ subject,
4301
+ aliases
4302
+ };
4303
+ }
4102
4304
  /**
4103
4305
  * Handles a WebFinger request. You would not typically call this function
4104
4306
  * directly, but instead use {@link Federation.fetch} method.
@@ -4147,7 +4349,7 @@ async function handleWebFinger(request, options) {
4147
4349
  });
4148
4350
  }
4149
4351
  }
4150
- const WEBFINGER_HANDLE_SCHEME_WHITELIST = new Set([
4352
+ const WEBFINGER_HANDLE_SCHEME_WHITELIST = /* @__PURE__ */ new Set([
4151
4353
  "acct",
4152
4354
  "http",
4153
4355
  "https",
@@ -4203,6 +4405,7 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
4203
4405
  return identifier;
4204
4406
  }
4205
4407
  let identifier = null;
4408
+ let acctUsername = null;
4206
4409
  const uriParsed = context.parseUri(resourceUrl);
4207
4410
  if (uriParsed?.type != "actor") {
4208
4411
  const match = /^acct:([^@]+)@([^@]+)$/.exec(resource);
@@ -4216,8 +4419,9 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
4216
4419
  const normalizedHost = portMatch == null ? domainToASCII(match[2].toLowerCase()) : domainToASCII(match[2].substring(0, portMatch.index).toLowerCase()) + portMatch[0];
4217
4420
  if (normalizedHost != context.url.host && normalizedHost != host) return await onNotFound(request);
4218
4421
  else {
4219
- identifier = await mapUsernameToIdentifier(match[1]);
4220
- resourceUrl = new URL(`acct:${match[1]}@${normalizedHost}`);
4422
+ acctUsername = match[1];
4423
+ identifier = await mapUsernameToIdentifier(acctUsername);
4424
+ resourceUrl = new URL(`acct:${acctUsername}@${normalizedHost}`);
4221
4425
  }
4222
4426
  }
4223
4427
  } else identifier = uriParsed.identifier;
@@ -4231,9 +4435,10 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
4231
4435
  status: 410,
4232
4436
  headers: { "Access-Control-Allow-Origin": "*" }
4233
4437
  });
4438
+ const actorUri = context.getActorUri(identifier);
4234
4439
  const links = [{
4235
4440
  rel: "self",
4236
- href: context.getActorUri(identifier).href,
4441
+ href: actorUri.href,
4237
4442
  type: "application/activity+json"
4238
4443
  }];
4239
4444
  for (const url of actor.urls) if (url instanceof Link && url.href != null) links.push({
@@ -4257,23 +4462,19 @@ async function handleWebFingerInternal(request, { context, host, actorDispatcher
4257
4462
  const customLinks = await webFingerLinksDispatcher(context, resourceUrl);
4258
4463
  if (customLinks != null) for (const link of customLinks) links.push(link);
4259
4464
  }
4260
- const aliases = [];
4261
- const preferredUsername = actor.preferredUsername;
4262
- if (resourceUrl.protocol != "acct:" && preferredUsername != null) {
4263
- aliases.push(`acct:${preferredUsername}@${host ?? context.url.host}`);
4264
- if (host != null && host !== context.url.host) aliases.push(`acct:${preferredUsername}@${context.url.host}`);
4265
- }
4266
- if (resourceUrl.href !== context.getActorUri(identifier).href) aliases.push(context.getActorUri(identifier).href);
4267
- if (resourceUrl.protocol === "acct:" && host != null && host !== context.url.host && !resourceUrl.href.endsWith(`@${host}`)) {
4268
- const username = resourceUrl.href.replace(/^acct:/, "").replace(/@.*$/, "");
4269
- aliases.push(`acct:${username}@${host}`);
4270
- }
4271
- const jrd = {
4272
- subject: resourceUrl.href,
4465
+ const { subject, aliases } = getWebFingerSubjectAndAliases({
4466
+ resourceUrl,
4467
+ actorUri,
4468
+ preferredUsername: actor.preferredUsername,
4469
+ acctUsername,
4470
+ host,
4471
+ contextHost: context.url.host
4472
+ });
4473
+ return new Response(JSON.stringify({
4474
+ subject,
4273
4475
  aliases,
4274
4476
  links
4275
- };
4276
- return new Response(JSON.stringify(jrd), { headers: {
4477
+ }), { headers: {
4277
4478
  "Content-Type": "application/jrd+json",
4278
4479
  "Access-Control-Allow-Origin": "*"
4279
4480
  } });
@@ -7132,4 +7333,4 @@ function getRequestId(request) {
7132
7333
  return `req_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
7133
7334
  }
7134
7335
  //#endregion
7135
- export { SendActivityError as a, buildCollectionSynchronizationHeader as c, normalizeCircuitBreakerOptions as d, parseCircuitBreakerKvState as f, createExponentialBackoffPolicy as i, digest as l, middleware_exports as n, respondWithObject as o, createFederationBuilder as p, handleWebFinger as r, respondWithObjectIfAcceptable as s, createFederation as t, CircuitBreaker as u };
7336
+ export { respondWithObject as a, digest as c, parseCircuitBreakerKvState as d, createFederationBuilder as f, SendActivityError as i, CircuitBreaker as l, handleWebFinger as n, respondWithObjectIfAcceptable as o, createExponentialBackoffPolicy as r, buildCollectionSynchronizationHeader as s, createFederation as t, normalizeCircuitBreakerOptions as u };
@@ -1,5 +1,5 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as FederationImpl } from "./middleware-BEd40QBF.mjs";
4
+ import { n as FederationImpl } from "./middleware-C9Y5lLZN.mjs";
5
5
  export { FederationImpl };
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as HttpMessageSignaturesSpecDeterminer } from "./http-VyDTd4G3.cjs";
3
- import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
4
- import { t as DocumentFetchKind } from "./metrics-DN13mCAw.cjs";
2
+ import { n as HttpMessageSignaturesSpecDeterminer } from "./http-6TI0tI03.cjs";
3
+ import { n as KvStore, t as KvKey } from "./kv-BhNbN8Ed.cjs";
4
+ import { t as DocumentFetchKind } from "./metrics-DVKYY6K1.cjs";
5
5
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
6
6
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
7
7
 
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { S as KeyCache } from "./http-VyDTd4G3.cjs";
2
+ import { S as KeyCache } from "./http-6TI0tI03.cjs";
3
3
  import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
4
4
  import { DocumentLoader } from "@fedify/vocab-runtime";
5
5
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { S as KeyCache } from "./http-lf8Hsd91.js";
2
+ import { S as KeyCache } from "./http-CdrSn2ip.js";
3
3
  import { CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1 } from "@fedify/vocab";
4
4
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
5
5
  import { DocumentLoader } from "@fedify/vocab-runtime";
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Mt as WebFingerLinksDispatcher, ct as ActorAliasMapper, l as RequestContext, lt as ActorDispatcher, ut as ActorHandleMapper } from "./context-C05Rgxmu.cjs";
2
+ import { _t as ActorHandleMapper, gt as ActorDispatcher, ht as ActorAliasMapper, l as RequestContext, zt as WebFingerLinksDispatcher } from "./context-B-dsBjZ9.cjs";
3
3
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
4
4
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
5
5
 
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Mt as WebFingerLinksDispatcher, ct as ActorAliasMapper, l as RequestContext, lt as ActorDispatcher, ut as ActorHandleMapper } from "./context-Cjnr0ig1.js";
2
+ import { _t as ActorHandleMapper, gt as ActorDispatcher, ht as ActorAliasMapper, l as RequestContext, zt as WebFingerLinksDispatcher } from "./context-DrLXudbA.js";
3
3
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
4
4
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
5
5
 
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { n as HttpMessageSignaturesSpecDeterminer } from "./http-lf8Hsd91.js";
3
- import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
4
- import { t as DocumentFetchKind } from "./metrics-v_e0n5GQ.js";
2
+ import { n as HttpMessageSignaturesSpecDeterminer } from "./http-CdrSn2ip.js";
3
+ import { n as KvStore, t as KvKey } from "./kv-BhNbN8Ed.js";
4
+ import { t as DocumentFetchKind } from "./metrics-DoRtI0qU.js";
5
5
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
6
6
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
7
7
 
package/dist/mod.cjs CHANGED
@@ -1,37 +1,36 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("./chunk-Czpeue4M.cjs");
4
- const require_transformers = require("./transformers-DGwl-hD1.cjs");
3
+ require("./rolldown-runtime-Dmm3t92W.cjs");
4
+ const require_transformers = require("./transformers-BalCrSsr.cjs");
5
5
  require("./compat/mod.cjs");
6
- const require_http = require("./http-BIJdA1mF.cjs");
7
- const require_middleware = require("./middleware-Dnzqy4sk.cjs");
8
- const require_proof = require("./proof-DcbeTQMG.cjs");
9
- const require_types = require("./types-CPym83zc.cjs");
10
- const require_kv_cache = require("./kv-cache-BPapnm-V.cjs");
11
- const require_federation_mod = require("./federation/mod.cjs");
6
+ const require_http = require("./http-AyKngJ_h.cjs");
7
+ const require_federation = require("./federation-BzRjeOky.cjs");
8
+ const require_proof = require("./proof-DcSm-2eG.cjs");
9
+ const require_types = require("./types-RXm5YxpC.cjs");
10
+ const require_kv_cache = require("./kv-cache-BTVaZrf-.cjs");
12
11
  require("./nodeinfo/mod.cjs");
13
12
  require("./runtime/mod.cjs");
14
13
  require("./sig/mod.cjs");
15
14
  require("./utils/mod.cjs");
16
15
  //#endregion
17
- exports.CircuitBreaker = require_middleware.CircuitBreaker;
18
- exports.InProcessMessageQueue = require_federation_mod.InProcessMessageQueue;
19
- exports.MemoryKvStore = require_federation_mod.MemoryKvStore;
20
- exports.ParallelMessageQueue = require_federation_mod.ParallelMessageQueue;
21
- exports.Router = require_federation_mod.Router;
22
- exports.RouterError = require_federation_mod.RouterError;
23
- exports.SendActivityError = require_middleware.SendActivityError;
16
+ exports.CircuitBreaker = require_federation.CircuitBreaker;
17
+ exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
18
+ exports.MemoryKvStore = require_federation.MemoryKvStore;
19
+ exports.ParallelMessageQueue = require_federation.ParallelMessageQueue;
20
+ exports.Router = require_federation.Router;
21
+ exports.RouterError = require_federation.RouterError;
22
+ exports.SendActivityError = require_federation.SendActivityError;
24
23
  exports.actorDehydrator = require_transformers.actorDehydrator;
25
24
  exports.attachSignature = require_proof.attachSignature;
26
25
  exports.autoIdAssigner = require_transformers.autoIdAssigner;
27
- exports.buildCollectionSynchronizationHeader = require_middleware.buildCollectionSynchronizationHeader;
28
- exports.createExponentialBackoffPolicy = require_middleware.createExponentialBackoffPolicy;
29
- exports.createFederation = require_middleware.createFederation;
30
- exports.createFederationBuilder = require_middleware.createFederationBuilder;
26
+ exports.buildCollectionSynchronizationHeader = require_federation.buildCollectionSynchronizationHeader;
27
+ exports.createExponentialBackoffPolicy = require_federation.createExponentialBackoffPolicy;
28
+ exports.createFederation = require_federation.createFederation;
29
+ exports.createFederationBuilder = require_federation.createFederationBuilder;
31
30
  exports.createProof = require_proof.createProof;
32
31
  exports.createSignature = require_proof.createSignature;
33
32
  exports.detachSignature = require_proof.detachSignature;
34
- exports.digest = require_middleware.digest;
33
+ exports.digest = require_federation.digest;
35
34
  exports.doesActorOwnKey = require_proof.doesActorOwnKey;
36
35
  exports.exportJwk = require_http.exportJwk;
37
36
  exports.fetchKey = require_http.fetchKey;
@@ -43,18 +42,18 @@ exports.getAuthenticatedDocumentLoader = require_kv_cache.getAuthenticatedDocume
43
42
  exports.getDefaultActivityTransformers = require_transformers.getDefaultActivityTransformers;
44
43
  exports.getKeyOwner = require_proof.getKeyOwner;
45
44
  exports.getNodeInfo = require_types.getNodeInfo;
46
- exports.handleWebFinger = require_middleware.handleWebFinger;
45
+ exports.handleWebFinger = require_federation.handleWebFinger;
47
46
  exports.hasProofLike = require_proof.hasProofLike;
48
47
  exports.hasSignatureLike = require_proof.hasSignatureLike;
49
48
  exports.importJwk = require_http.importJwk;
50
49
  exports.kvCache = require_kv_cache.kvCache;
51
50
  exports.nodeInfoToJson = require_types.nodeInfoToJson;
52
- exports.normalizeCircuitBreakerOptions = require_middleware.normalizeCircuitBreakerOptions;
51
+ exports.normalizeCircuitBreakerOptions = require_federation.normalizeCircuitBreakerOptions;
53
52
  exports.parseAcceptSignature = require_http.parseAcceptSignature;
54
- exports.parseCircuitBreakerKvState = require_middleware.parseCircuitBreakerKvState;
53
+ exports.parseCircuitBreakerKvState = require_federation.parseCircuitBreakerKvState;
55
54
  exports.parseNodeInfo = require_types.parseNodeInfo;
56
- exports.respondWithObject = require_middleware.respondWithObject;
57
- exports.respondWithObjectIfAcceptable = require_middleware.respondWithObjectIfAcceptable;
55
+ exports.respondWithObject = require_federation.respondWithObject;
56
+ exports.respondWithObjectIfAcceptable = require_federation.respondWithObjectIfAcceptable;
58
57
  exports.signJsonLd = require_proof.signJsonLd;
59
58
  exports.signObject = require_proof.signObject;
60
59
  exports.signRequest = require_http.signRequest;