@fedify/fedify 2.4.0-dev.1655 → 2.4.0-pr.934.40

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 (71) hide show
  1. package/README.md +3 -0
  2. package/dist/{builder-8MpCLAhD.mjs → builder-BBPwtB2v.mjs} +2 -2
  3. package/dist/compat/mod.d.cts +1 -1
  4. package/dist/compat/mod.d.ts +1 -1
  5. package/dist/compat/transformers.test.mjs +1 -1
  6. package/dist/{context-lxX6I7as.d.cts → context-C05Rgxmu.d.cts} +1 -1
  7. package/dist/{context-Zii1f5xS.d.ts → context-Cjnr0ig1.d.ts} +1 -1
  8. package/dist/{deno-DIcd3H5U.mjs → deno-D3c0o_N0.mjs} +1 -1
  9. package/dist/{docloader-BS9NsNYt.mjs → docloader-BCecHIxU.mjs} +2 -2
  10. package/dist/federation/builder.test.mjs +1 -1
  11. package/dist/federation/handler.test.mjs +3 -5
  12. package/dist/federation/idempotency.test.mjs +2 -2
  13. package/dist/federation/metrics.test.mjs +1 -1
  14. package/dist/federation/middleware.test.mjs +7 -7
  15. package/dist/federation/mod.cjs +288 -9
  16. package/dist/federation/mod.d.cts +3 -3
  17. package/dist/federation/mod.d.ts +3 -3
  18. package/dist/federation/mod.js +279 -1
  19. package/dist/federation/mq.test.mjs +20 -1
  20. package/dist/federation/send.test.mjs +3 -3
  21. package/dist/federation/tasks/enqueue.test.mjs +39 -2
  22. package/dist/federation/tasks/tasks.test.mjs +3 -3
  23. package/dist/federation/temporal.test.mjs +1 -1
  24. package/dist/federation/webfinger.test.mjs +1 -1
  25. package/dist/{http-CuQZAaUT.js → http-Ctb_KhZ8.js} +1 -1
  26. package/dist/{http-v2n_JnYK.mjs → http-Dm0JAUa_.mjs} +3 -3
  27. package/dist/{http-C6PWxqco.cjs → http-jr0TkgZe.cjs} +1 -1
  28. package/dist/{key-C2NKn9Cq.mjs → key-C_gNKtxm.mjs} +2 -2
  29. package/dist/{kv-cache-BlhrYDM4.mjs → kv-cache-B7H7lZ84.mjs} +1 -1
  30. package/dist/{kv-cache-CZH7haL0.js → kv-cache-BxUZRBC2.js} +1 -1
  31. package/dist/{kv-cache-B7ZZFrUW.cjs → kv-cache-D-hbjJAD.cjs} +1 -1
  32. package/dist/{ld-g2gwPTnA.mjs → ld-DAPAVL_7.mjs} +3 -3
  33. package/dist/{metrics-DTsGrbUw.mjs → metrics-BMaatuZi.mjs} +1 -1
  34. package/dist/{metrics-CoUJLQhZ.d.cts → metrics-DN13mCAw.d.cts} +19 -1
  35. package/dist/{metrics-Dc4jR-IC.d.ts → metrics-v_e0n5GQ.d.ts} +19 -1
  36. package/dist/{middleware-FI7YX3gk.cjs → middleware-BW7WQltk.cjs} +40 -325
  37. package/dist/{middleware-CzUjNpkv.js → middleware-CfZR_riY.js} +6 -278
  38. package/dist/{middleware-BWlRM5qQ.mjs → middleware-DfPBAh9L.mjs} +1 -1
  39. package/dist/{middleware-C_MX_2Mg.mjs → middleware-O2LHXFEk.mjs} +14 -15
  40. package/dist/{mod-BtEaIEcD.d.cts → mod-BrpVsSfY.d.cts} +1 -1
  41. package/dist/{mod-DLc2Ot6f.d.ts → mod-BsCE5Ihq.d.ts} +1 -1
  42. package/dist/{mod-UMmveiO0.d.ts → mod-CNef4in0.d.ts} +1 -1
  43. package/dist/{mod-gOlPDuT8.d.cts → mod-DdONo-ep.d.cts} +1 -1
  44. package/dist/mod.cjs +6 -6
  45. package/dist/mod.d.cts +4 -4
  46. package/dist/mod.d.ts +4 -4
  47. package/dist/mod.js +5 -5
  48. package/dist/{mq-llHKivST.mjs → mq-Bo7Etgh6.mjs} +6 -0
  49. package/dist/nodeinfo/handler.test.mjs +1 -1
  50. package/dist/{owner-Dzl5ytTO.mjs → owner-Dcx-czqn.mjs} +2 -2
  51. package/dist/{proof-C3fIAqh0.mjs → proof-BkAxvrjt.mjs} +3 -3
  52. package/dist/{proof-p5BKVu79.js → proof-D-H_PnJW.js} +1 -1
  53. package/dist/{proof-h42TdzKb.cjs → proof-NY0D8Oux.cjs} +1 -1
  54. package/dist/{send-1BSFDQnC.mjs → send-D_j7E-oC.mjs} +3 -3
  55. package/dist/sig/http.test.mjs +2 -2
  56. package/dist/sig/key.test.mjs +1 -1
  57. package/dist/sig/ld.test.mjs +2 -2
  58. package/dist/sig/mod.cjs +2 -2
  59. package/dist/sig/mod.js +2 -2
  60. package/dist/sig/owner.test.mjs +1 -1
  61. package/dist/sig/proof.test.mjs +1 -1
  62. package/dist/{temporal-DBKWwg91.mjs → temporal-yE5EcfNX.mjs} +1 -1
  63. package/dist/testing/mod.d.mts +14 -1
  64. package/dist/utils/docloader.test.mjs +2 -2
  65. package/dist/utils/kv-cache.test.mjs +1 -1
  66. package/dist/utils/mod.cjs +1 -1
  67. package/dist/utils/mod.d.cts +1 -1
  68. package/dist/utils/mod.d.ts +1 -1
  69. package/dist/utils/mod.js +1 -1
  70. package/package.json +7 -7
  71. package/skills/fedify/SKILL.md +462 -0
@@ -2,10 +2,10 @@ import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
3
  import { t as __exportAll } from "./chunk-D5IdezsZ.js";
4
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-CuQZAaUT.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-p5BKVu79.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-Ctb_KhZ8.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-D-H_PnJW.js";
7
7
  import { n as getNodeInfo, t as nodeInfoToJson } from "./types-DC1pNgJA.js";
8
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CZH7haL0.js";
8
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BxUZRBC2.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";
@@ -3900,278 +3900,6 @@ const classReviver = (filter, init, set) => (seen, revive, node) => {
3900
3900
  })();
3901
3901
  };
3902
3902
  //#endregion
3903
- //#region src/federation/mq.ts
3904
- /**
3905
- * A message queue that processes messages in the same process.
3906
- * Do not use this in production as it does neither persist messages nor
3907
- * distribute them across multiple processes.
3908
- *
3909
- * @since 0.5.0
3910
- */
3911
- var InProcessMessageQueue = class {
3912
- #messages;
3913
- #monitors;
3914
- #pollIntervalMs;
3915
- #delayedMessages;
3916
- /**
3917
- * Tracks which ordering keys are currently being processed to ensure
3918
- * sequential processing for messages with the same key.
3919
- */
3920
- #processingKeys;
3921
- /**
3922
- * In-process message queue does not provide native retry mechanisms.
3923
- * @since 1.7.0
3924
- */
3925
- nativeRetrial = false;
3926
- /**
3927
- * In-process message queue does not deduplicate messages natively.
3928
- * @since 2.4.0
3929
- */
3930
- nativeDeduplication = false;
3931
- /**
3932
- * Constructs a new {@link InProcessMessageQueue} with the given options.
3933
- * @param options Additional options for the in-process message queue.
3934
- */
3935
- constructor(options = {}) {
3936
- this.#messages = [];
3937
- this.#monitors = {};
3938
- this.#pollIntervalMs = Temporal.Duration.from(options.pollInterval ?? { seconds: 5 }).total("millisecond");
3939
- this.#delayedMessages = 0;
3940
- this.#processingKeys = /* @__PURE__ */ new Set();
3941
- }
3942
- enqueue(message, options) {
3943
- const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
3944
- if (delay > 0) {
3945
- this.#delayedMessages++;
3946
- setTimeout(() => {
3947
- this.#delayedMessages--;
3948
- this.#enqueueReady(message, options);
3949
- }, delay);
3950
- return Promise.resolve();
3951
- }
3952
- this.#enqueueReady(message, options);
3953
- return Promise.resolve();
3954
- }
3955
- #enqueueReady(message, options) {
3956
- const orderingKey = options?.orderingKey ?? null;
3957
- this.#messages.push({
3958
- message,
3959
- orderingKey
3960
- });
3961
- this.#notifyMonitors();
3962
- }
3963
- #notifyMonitors() {
3964
- for (const monitorId in this.#monitors) this.#monitors[monitorId]();
3965
- }
3966
- enqueueMany(messages, options) {
3967
- if (messages.length === 0) return Promise.resolve();
3968
- const delay = options?.delay == null ? 0 : Math.max(options.delay.total("millisecond"), 0);
3969
- if (delay > 0) {
3970
- const delayedCount = messages.length;
3971
- const deferredMessages = [...messages];
3972
- this.#delayedMessages += delayedCount;
3973
- setTimeout(() => {
3974
- this.#delayedMessages -= delayedCount;
3975
- this.#enqueueManyReady(deferredMessages, options);
3976
- }, delay);
3977
- return Promise.resolve();
3978
- }
3979
- this.#enqueueManyReady(messages, options);
3980
- return Promise.resolve();
3981
- }
3982
- #enqueueManyReady(messages, options) {
3983
- const orderingKey = options?.orderingKey ?? null;
3984
- for (const message of messages) this.#messages.push({
3985
- message,
3986
- orderingKey
3987
- });
3988
- this.#notifyMonitors();
3989
- }
3990
- async listen(handler, options = {}) {
3991
- const signal = options.signal;
3992
- while (signal == null || !signal.aborted) {
3993
- const idx = this.#messages.findIndex((m) => m.orderingKey == null || !this.#processingKeys.has(m.orderingKey));
3994
- if (idx >= 0) {
3995
- const { message, orderingKey } = this.#messages.splice(idx, 1)[0];
3996
- if (orderingKey != null) this.#processingKeys.add(orderingKey);
3997
- try {
3998
- await handler(message);
3999
- } finally {
4000
- if (orderingKey != null) this.#processingKeys.delete(orderingKey);
4001
- }
4002
- } else if (this.#messages.length === 0) await this.#wait(this.#pollIntervalMs, signal);
4003
- else await this.#wait(10, signal);
4004
- }
4005
- }
4006
- getDepth() {
4007
- const ready = this.#messages.length;
4008
- const delayed = this.#delayedMessages;
4009
- return Promise.resolve({
4010
- queued: ready + delayed,
4011
- ready,
4012
- delayed
4013
- });
4014
- }
4015
- #wait(ms, signal) {
4016
- let timer = null;
4017
- return Promise.any([new Promise((resolve) => {
4018
- signal?.addEventListener("abort", () => {
4019
- if (timer != null) clearTimeout(timer);
4020
- resolve();
4021
- }, { once: true });
4022
- const monitorId = crypto.randomUUID();
4023
- this.#monitors[monitorId] = () => {
4024
- delete this.#monitors[monitorId];
4025
- if (timer != null) clearTimeout(timer);
4026
- resolve();
4027
- };
4028
- }), new Promise((resolve) => timer = setTimeout(resolve, ms))]);
4029
- }
4030
- };
4031
- /**
4032
- * A message queue that processes messages in parallel. It takes another
4033
- * {@link MessageQueue}, and processes messages in parallel up to a certain
4034
- * number of workers.
4035
- *
4036
- * Actually, it's rather a decorator than a queue itself.
4037
- *
4038
- * Note that the workers do not run in truly parallel, in the sense that they
4039
- * are not running in separate threads or processes. They are running in the
4040
- * same process, but are scheduled to run in parallel. Hence, this is useful
4041
- * for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's
4042
- * workloads.
4043
- *
4044
- * When using `ParallelMessageQueue`, the ordering guarantee is preserved
4045
- * *only if* the underlying queue implementation delivers messages in a wrapper
4046
- * format that includes the `__fedify_ordering_key__` property. Currently,
4047
- * only `DenoKvMessageQueue` and `WorkersMessageQueue` use this format.
4048
- * For other queue implementations (e.g., `InProcessMessageQueue`,
4049
- * `RedisMessageQueue`, `PostgresMessageQueue`, `SqliteMessageQueue`,
4050
- * `AmqpMessageQueue`), the ordering key cannot be detected by
4051
- * `ParallelMessageQueue`, so ordering guarantees are handled by those
4052
- * implementations directly rather than at the `ParallelMessageQueue` level.
4053
- *
4054
- * Messages with the same ordering key will never be processed concurrently
4055
- * by different workers, ensuring sequential processing within each key.
4056
- * Messages with different ordering keys (or no ordering key) can still be
4057
- * processed in parallel.
4058
- *
4059
- * @since 1.0.0
4060
- */
4061
- var ParallelMessageQueue = class ParallelMessageQueue {
4062
- queue;
4063
- workers;
4064
- /**
4065
- * Inherits the native retry capability from the wrapped queue.
4066
- * @since 1.7.0
4067
- */
4068
- nativeRetrial;
4069
- /**
4070
- * Inherits the native deduplication capability from the wrapped queue.
4071
- * @since 2.4.0
4072
- */
4073
- nativeDeduplication;
4074
- getDepth;
4075
- /**
4076
- * Tracks which ordering keys are currently being processed to ensure
4077
- * sequential processing for messages with the same key.
4078
- */
4079
- #processingKeys = /* @__PURE__ */ new Set();
4080
- /**
4081
- * Pending messages waiting for their ordering key to become available.
4082
- */
4083
- #pendingMessages = [];
4084
- /**
4085
- * Constructs a new {@link ParallelMessageQueue} with the given queue and
4086
- * number of workers.
4087
- * @param queue The message queue to use under the hood. Note that
4088
- * {@link ParallelMessageQueue} cannot be nested.
4089
- * @param workers The number of workers to process messages in parallel.
4090
- * @throws {TypeError} If the given queue is an instance of
4091
- * {@link ParallelMessageQueue}.
4092
- */
4093
- constructor(queue, workers) {
4094
- if (queue instanceof ParallelMessageQueue) throw new TypeError("Cannot nest ParallelMessageQueue.");
4095
- this.queue = queue;
4096
- this.workers = workers;
4097
- this.nativeRetrial = queue.nativeRetrial;
4098
- this.nativeDeduplication = queue.nativeDeduplication;
4099
- if (queue.getDepth != null) this.getDepth = () => queue.getDepth();
4100
- }
4101
- enqueue(message, options) {
4102
- return this.queue.enqueue(message, options);
4103
- }
4104
- async enqueueMany(messages, options) {
4105
- if (this.queue.enqueueMany == null) {
4106
- if (messages.length === 1) {
4107
- await this.queue.enqueue(messages[0], options);
4108
- return;
4109
- }
4110
- if (options?.deduplicationKey != null) throw new TypeError("Cannot enqueue a batch with a deduplicationKey: the wrapped queue does not implement enqueueMany, so ParallelMessageQueue would have to fan out to individual enqueue() calls that cannot share one deduplicationKey atomically. Wrap a queue that implements enqueueMany instead.");
4111
- const errors = (await Promise.allSettled(messages.map((message) => this.queue.enqueue(message, options)))).filter((r) => r.status === "rejected").map((r) => r.reason);
4112
- if (errors.length > 1) throw new AggregateError(errors, "Failed to enqueue messages.");
4113
- else if (errors.length === 1) throw errors[0];
4114
- return;
4115
- }
4116
- await this.queue.enqueueMany(messages, options);
4117
- }
4118
- /**
4119
- * Extracts ordering key from a message if present.
4120
- *
4121
- * This method only works for queue implementations that deliver messages
4122
- * in the wrapper format with `__fedify_ordering_key__` property. Currently,
4123
- * only `DenoKvMessageQueue` and `WorkersMessageQueue` use this format.
4124
- *
4125
- * For other queue implementations (`InProcessMessageQueue`,
4126
- * `RedisMessageQueue`, `PostgresMessageQueue`, `SqliteMessageQueue`,
4127
- * `AmqpMessageQueue`), messages are delivered as raw payloads without the
4128
- * wrapper, so the ordering key cannot be detected here. Those
4129
- * implementations handle ordering guarantees internally.
4130
- */
4131
- #extractOrderingKey(message) {
4132
- if (message != null && typeof message === "object") {
4133
- if ("__fedify_ordering_key__" in message) return message.__fedify_ordering_key__;
4134
- }
4135
- }
4136
- listen(handler, options = {}) {
4137
- const workers = /* @__PURE__ */ new Map();
4138
- return this.queue.listen(async (message) => {
4139
- while (workers.size >= this.workers) {
4140
- const consumedId = await Promise.any(workers.values());
4141
- workers.delete(consumedId);
4142
- }
4143
- const workerId = crypto.randomUUID();
4144
- const orderingKey = this.#extractOrderingKey(message);
4145
- if (orderingKey != null && this.#processingKeys.has(orderingKey)) await new Promise((resolve) => {
4146
- this.#pendingMessages.push({
4147
- message,
4148
- orderingKey,
4149
- resolve
4150
- });
4151
- });
4152
- if (orderingKey != null) this.#processingKeys.add(orderingKey);
4153
- const promise = this.#work(workerId, handler, message, orderingKey);
4154
- workers.set(workerId, promise);
4155
- }, options);
4156
- }
4157
- async #work(workerId, handler, message, orderingKey) {
4158
- await this.#sleep(0);
4159
- try {
4160
- await handler(message);
4161
- } finally {
4162
- if (orderingKey != null) {
4163
- this.#processingKeys.delete(orderingKey);
4164
- const pendingIdx = this.#pendingMessages.findIndex((p) => p.orderingKey === orderingKey);
4165
- if (pendingIdx >= 0) this.#pendingMessages.splice(pendingIdx, 1)[0].resolve();
4166
- }
4167
- }
4168
- return workerId;
4169
- }
4170
- #sleep(ms) {
4171
- return new Promise((resolve) => setTimeout(resolve, ms));
4172
- }
4173
- };
4174
- //#endregion
4175
3903
  //#region src/federation/tasks/enqueue.ts
4176
3904
  /**
4177
3905
  * The enqueue pipeline for custom background tasks. `ContextImpl.enqueueTask`
@@ -4238,8 +3966,8 @@ function planDeduplication(ctx, queue, taskName, options, itemCount) {
4238
3966
  const key = options.deduplicationKey;
4239
3967
  const native = queue.nativeDeduplication === true;
4240
3968
  const canCas = ctx.federation.kv.cas != null;
4241
- const canBatchAtomically = queue.enqueueMany != null && !(queue instanceof ParallelMessageQueue && queue.queue.enqueueMany == null);
4242
- if (itemCount > 1 && !canBatchAtomically && (native || canCas)) throw new TypeError(`Task ${JSON.stringify(taskName)} was enqueued as a batch with a deduplicationKey, but its message queue does not implement enqueueMany; a multi-item batch cannot be deduplicated atomically without it. Implement enqueueMany on the queue, or enqueue the tasks individually with enqueueTask().`);
3969
+ const canBatchAtomically = queue.enqueueMany != null && queue.atomicEnqueueMany !== false;
3970
+ if (itemCount > 1 && !canBatchAtomically && (native || canCas)) throw new TypeError(`Task ${JSON.stringify(taskName)} was enqueued as a batch with a deduplicationKey, but its message queue does not provide an atomic enqueueMany implementation; a multi-item batch cannot be deduplicated atomically without it. Use a queue with atomic batch enqueueing, or enqueue the tasks individually with enqueueTask().`);
4243
3971
  if (native) return {
4244
3972
  kind: "native",
4245
3973
  key
@@ -7404,4 +7132,4 @@ function getRequestId(request) {
7404
7132
  return `req_${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}`;
7405
7133
  }
7406
7134
  //#endregion
7407
- export { ParallelMessageQueue as a, respondWithObject as c, digest as d, CircuitBreaker as f, createFederationBuilder as h, InProcessMessageQueue as i, respondWithObjectIfAcceptable as l, parseCircuitBreakerKvState as m, middleware_exports as n, createExponentialBackoffPolicy as o, normalizeCircuitBreakerOptions as p, handleWebFinger as r, SendActivityError as s, createFederation as t, buildCollectionSynchronizationHeader as u };
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 };
@@ -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-C_MX_2Mg.mjs";
4
+ import { n as FederationImpl } from "./middleware-O2LHXFEk.mjs";
5
5
  export { FederationImpl };
@@ -1,29 +1,28 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-DIcd3H5U.mjs";
5
- import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-DTsGrbUw.mjs";
4
+ import { n as version, t as name } from "./deno-D3c0o_N0.mjs";
5
+ import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-BMaatuZi.mjs";
6
6
  import { t as formatAcceptSignature } from "./accept-8PiolDP7.mjs";
7
- import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-C2NKn9Cq.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-v2n_JnYK.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-BS9NsNYt.mjs";
10
- import { n as kvCache } from "./kv-cache-BlhrYDM4.mjs";
11
- import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-g2gwPTnA.mjs";
12
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-Dzl5ytTO.mjs";
7
+ import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-C_gNKtxm.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-Dm0JAUa_.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-BCecHIxU.mjs";
10
+ import { n as kvCache } from "./kv-cache-B7H7lZ84.mjs";
11
+ import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-DAPAVL_7.mjs";
12
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-Dcx-czqn.mjs";
13
13
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-URuqsICz.mjs";
14
- import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-C3fIAqh0.mjs";
14
+ import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-BkAxvrjt.mjs";
15
15
  import { t as getNodeInfo } from "./client-CjF5IYQS.mjs";
16
16
  import { t as nodeInfoToJson } from "./types-CrtdVuDP.mjs";
17
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-1BSFDQnC.mjs";
18
- import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-8MpCLAhD.mjs";
17
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-D_j7E-oC.mjs";
18
+ import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-BBPwtB2v.mjs";
19
19
  import { t as CircuitBreaker } from "./circuit-breaker-CBGyz5F7.mjs";
20
20
  import { t as buildCollectionSynchronizationHeader } from "./collection-BIhlldqK.mjs";
21
21
  import { t as KvKeyCache } from "./keycache-_DHqz5z_.mjs";
22
22
  import { t as acceptsJsonLd } from "./negotiation-RuwrPFqi.mjs";
23
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-DBKWwg91.mjs";
23
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-yE5EcfNX.mjs";
24
24
  import { t as createExponentialBackoffPolicy } from "./retry-DgFqeS5k.mjs";
25
25
  import { t as TaskCodec } from "./codec-BBga-FWI.mjs";
26
- import { n as ParallelMessageQueue } from "./mq-llHKivST.mjs";
27
26
  import { getLogger, withContext } from "@logtape/logtape";
28
27
  import { RouterError } from "@fedify/uri-template";
29
28
  import { Activity, Collection, CollectionPage, CryptographicKey, Link, Multikey, Object as Object$1, OrderedCollection, OrderedCollectionPage, Tombstone, getTypeId, lookupObject, traverseCollection } from "@fedify/vocab";
@@ -2348,8 +2347,8 @@ function planDeduplication(ctx, queue, taskName, options, itemCount) {
2348
2347
  const key = options.deduplicationKey;
2349
2348
  const native = queue.nativeDeduplication === true;
2350
2349
  const canCas = ctx.federation.kv.cas != null;
2351
- const canBatchAtomically = queue.enqueueMany != null && !(queue instanceof ParallelMessageQueue && queue.queue.enqueueMany == null);
2352
- if (itemCount > 1 && !canBatchAtomically && (native || canCas)) throw new TypeError(`Task ${JSON.stringify(taskName)} was enqueued as a batch with a deduplicationKey, but its message queue does not implement enqueueMany; a multi-item batch cannot be deduplicated atomically without it. Implement enqueueMany on the queue, or enqueue the tasks individually with enqueueTask().`);
2350
+ const canBatchAtomically = queue.enqueueMany != null && queue.atomicEnqueueMany !== false;
2351
+ if (itemCount > 1 && !canBatchAtomically && (native || canCas)) throw new TypeError(`Task ${JSON.stringify(taskName)} was enqueued as a batch with a deduplicationKey, but its message queue does not provide an atomic enqueueMany implementation; a multi-item batch cannot be deduplicated atomically without it. Use a queue with atomic batch enqueueing, or enqueue the tasks individually with enqueueTask().`);
2353
2352
  if (native) return {
2354
2353
  kind: "native",
2355
2354
  key
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { n as HttpMessageSignaturesSpecDeterminer } from "./http-VyDTd4G3.cjs";
3
3
  import { n as KvStore, t as KvKey } from "./kv-gJ8LYbxX.cjs";
4
- import { t as DocumentFetchKind } from "./metrics-CoUJLQhZ.cjs";
4
+ import { t as DocumentFetchKind } from "./metrics-DN13mCAw.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 { Mt as WebFingerLinksDispatcher, ct as ActorAliasMapper, l as RequestContext, lt as ActorDispatcher, ut as ActorHandleMapper } from "./context-Zii1f5xS.js";
2
+ import { Mt as WebFingerLinksDispatcher, ct as ActorAliasMapper, l as RequestContext, lt as ActorDispatcher, ut as ActorHandleMapper } from "./context-Cjnr0ig1.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
2
  import { n as HttpMessageSignaturesSpecDeterminer } from "./http-lf8Hsd91.js";
3
3
  import { n as KvStore, t as KvKey } from "./kv-D6hNiMTK.js";
4
- import { t as DocumentFetchKind } from "./metrics-Dc4jR-IC.js";
4
+ import { t as DocumentFetchKind } from "./metrics-v_e0n5GQ.js";
5
5
  import { MeterProvider, TracerProvider } from "@opentelemetry/api";
6
6
  import { DocumentLoader, DocumentLoaderFactoryOptions } from "@fedify/vocab-runtime";
7
7
 
@@ -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-lxX6I7as.cjs";
2
+ import { Mt as WebFingerLinksDispatcher, ct as ActorAliasMapper, l as RequestContext, lt as ActorDispatcher, ut as ActorHandleMapper } from "./context-C05Rgxmu.cjs";
3
3
  import { MeterProvider, Span, Tracer } from "@opentelemetry/api";
4
4
  import { RouterError, RouterOptions, RouterRouteResult } from "@fedify/uri-template";
5
5
 
package/dist/mod.cjs CHANGED
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("./chunk-Czpeue4M.cjs");
4
4
  const require_transformers = require("./transformers-DGwl-hD1.cjs");
5
5
  require("./compat/mod.cjs");
6
- const require_http = require("./http-C6PWxqco.cjs");
7
- const require_middleware = require("./middleware-FI7YX3gk.cjs");
8
- const require_proof = require("./proof-h42TdzKb.cjs");
6
+ const require_http = require("./http-jr0TkgZe.cjs");
7
+ const require_middleware = require("./middleware-BW7WQltk.cjs");
8
+ const require_proof = require("./proof-NY0D8Oux.cjs");
9
9
  const require_types = require("./types-CPym83zc.cjs");
10
- const require_kv_cache = require("./kv-cache-B7ZZFrUW.cjs");
10
+ const require_kv_cache = require("./kv-cache-D-hbjJAD.cjs");
11
11
  const require_federation_mod = require("./federation/mod.cjs");
12
12
  require("./nodeinfo/mod.cjs");
13
13
  require("./runtime/mod.cjs");
@@ -15,9 +15,9 @@ require("./sig/mod.cjs");
15
15
  require("./utils/mod.cjs");
16
16
  //#endregion
17
17
  exports.CircuitBreaker = require_middleware.CircuitBreaker;
18
- exports.InProcessMessageQueue = require_middleware.InProcessMessageQueue;
18
+ exports.InProcessMessageQueue = require_federation_mod.InProcessMessageQueue;
19
19
  exports.MemoryKvStore = require_federation_mod.MemoryKvStore;
20
- exports.ParallelMessageQueue = require_middleware.ParallelMessageQueue;
20
+ exports.ParallelMessageQueue = require_federation_mod.ParallelMessageQueue;
21
21
  exports.Router = require_federation_mod.Router;
22
22
  exports.RouterError = require_federation_mod.RouterError;
23
23
  exports.SendActivityError = require_middleware.SendActivityError;
package/dist/mod.d.cts CHANGED
@@ -2,13 +2,13 @@
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CAM_bQXx.cjs";
3
3
  import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-VyDTd4G3.cjs";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-DEvZuyOE.cjs";
5
- import { $ as CircuitBreakerCreateOptions, A as OutboxListenerSetters, At as UnverifiedActivityHandler, B as TaskEnqueueOptions, C as FederationStartQueueOptions, Ct as ObjectAuthorizePredicate, D as InboxListenerSetters, Dt as OutboxListenerErrorHandler, E as InboxChallengePolicy, Et as OutboxListener, F as createFederation, Ft as PageItems, G as RetryPolicy, H as TaskRegistry, I as Message, It as buildCollectionSynchronizationHeader, J as respondWithObject, K as createExponentialBackoffPolicy, L as createFederationBuilder, Lt as digest, M as FederationKvPrefixes, Mt as WebFingerLinksDispatcher, N as FederationOrigin, Nt as SendActivityError, O as MediaUploaderSetters, Ot as OutboxPermanentFailureHandler, P as FederationQueueOptions, Pt as SenderKeyPair, Q as CircuitBreakerBeforeSendDecision, R as TaskDefinition, Rt as ActivityTransformer, S as FederationOptions, St as NodeInfoDispatcher, T as IdempotencyStrategy, Tt as OutboxErrorHandler, U as CreateExponentialBackoffPolicyOptions, V as TaskHandler, W as RetryContext, X as CircuitBreaker, Y as respondWithObjectIfAcceptable, Z as CircuitBreakerActivityDrop, _ as Federatable, _t as CustomCollectionCursor, a as GetSignedKeyOptions, at as NormalizedCircuitBreakerOptions, b as FederationBuilder, bt as InboxListener, c as ParseUriResult, ct as ActorAliasMapper, d as SendActivityOptions, dt as ActorKeyPairsDispatcher, et as CircuitBreakerFailurePolicy, f as SendActivityOptionsForCollection, ft as AuthorizePredicate, g as CustomCollectionCallbackSetters, gt as CustomCollectionCounter, h as ConstructorWithTypeId, ht as CollectionDispatcher, i as GetActorOptions, it as CircuitBreakerStateChange, j as Rfc6570Expression, jt as UnverifiedActivityReason, k as ObjectCallbackSetters, kt as SharedInboxKeyDispatcher, l as RequestContext, lt as ActorDispatcher, m as CollectionCallbackSetters, mt as CollectionCursor, n as Context, nt as CircuitBreakerOptions, o as InboxContext, ot as normalizeCircuitBreakerOptions, p as ActorCallbackSetters, pt as CollectionCounter, q as RespondWithObjectOptions, r as ForwardActivityOptions, rt as CircuitBreakerState, s as OutboxContext, st as parseCircuitBreakerKvState, t as ActorKeyPair, tt as CircuitBreakerKvState, u as RouteActivityOptions, ut as ActorHandleMapper, v as Federation, vt as CustomCollectionDispatcher, w as IdempotencyKeyCallback, wt as ObjectDispatcher, x as FederationFetchOptions, xt as MediaUploaderCallback, y as FederationBenchmarkOptions, yt as InboxErrorHandler, z as TaskDefinitionOptions } from "./context-lxX6I7as.cjs";
5
+ import { $ as CircuitBreakerCreateOptions, A as OutboxListenerSetters, At as UnverifiedActivityHandler, B as TaskEnqueueOptions, C as FederationStartQueueOptions, Ct as ObjectAuthorizePredicate, D as InboxListenerSetters, Dt as OutboxListenerErrorHandler, E as InboxChallengePolicy, Et as OutboxListener, F as createFederation, Ft as PageItems, G as RetryPolicy, H as TaskRegistry, I as Message, It as buildCollectionSynchronizationHeader, J as respondWithObject, K as createExponentialBackoffPolicy, L as createFederationBuilder, Lt as digest, M as FederationKvPrefixes, Mt as WebFingerLinksDispatcher, N as FederationOrigin, Nt as SendActivityError, O as MediaUploaderSetters, Ot as OutboxPermanentFailureHandler, P as FederationQueueOptions, Pt as SenderKeyPair, Q as CircuitBreakerBeforeSendDecision, R as TaskDefinition, Rt as ActivityTransformer, S as FederationOptions, St as NodeInfoDispatcher, T as IdempotencyStrategy, Tt as OutboxErrorHandler, U as CreateExponentialBackoffPolicyOptions, V as TaskHandler, W as RetryContext, X as CircuitBreaker, Y as respondWithObjectIfAcceptable, Z as CircuitBreakerActivityDrop, _ as Federatable, _t as CustomCollectionCursor, a as GetSignedKeyOptions, at as NormalizedCircuitBreakerOptions, b as FederationBuilder, bt as InboxListener, c as ParseUriResult, ct as ActorAliasMapper, d as SendActivityOptions, dt as ActorKeyPairsDispatcher, et as CircuitBreakerFailurePolicy, f as SendActivityOptionsForCollection, ft as AuthorizePredicate, g as CustomCollectionCallbackSetters, gt as CustomCollectionCounter, h as ConstructorWithTypeId, ht as CollectionDispatcher, i as GetActorOptions, it as CircuitBreakerStateChange, j as Rfc6570Expression, jt as UnverifiedActivityReason, k as ObjectCallbackSetters, kt as SharedInboxKeyDispatcher, l as RequestContext, lt as ActorDispatcher, m as CollectionCallbackSetters, mt as CollectionCursor, n as Context, nt as CircuitBreakerOptions, o as InboxContext, ot as normalizeCircuitBreakerOptions, p as ActorCallbackSetters, pt as CollectionCounter, q as RespondWithObjectOptions, r as ForwardActivityOptions, rt as CircuitBreakerState, s as OutboxContext, st as parseCircuitBreakerKvState, t as ActorKeyPair, tt as CircuitBreakerKvState, u as RouteActivityOptions, ut as ActorHandleMapper, v as Federation, vt as CustomCollectionDispatcher, w as IdempotencyKeyCallback, wt as ObjectDispatcher, x as FederationFetchOptions, xt as MediaUploaderCallback, y as FederationBenchmarkOptions, yt as InboxErrorHandler, z as TaskDefinitionOptions } from "./context-C05Rgxmu.cjs";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-gJ8LYbxX.cjs";
7
- import { a as MessageQueueDepth, c as ParallelMessageQueue, i as MessageQueue, n as InProcessMessageQueue, o as MessageQueueEnqueueOptions, r as InProcessMessageQueueOptions, s as MessageQueueListenOptions } from "./metrics-CoUJLQhZ.cjs";
7
+ import { a as MessageQueueDepth, c as ParallelMessageQueue, i as MessageQueue, n as InProcessMessageQueue, o as MessageQueueEnqueueOptions, r as InProcessMessageQueueOptions, s as MessageQueueListenOptions } from "./metrics-DN13mCAw.cjs";
8
8
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.cjs";
9
- import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-gOlPDuT8.cjs";
9
+ import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-DdONo-ep.cjs";
10
10
  import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-B0hW12_O.cjs";
11
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-BtEaIEcD.cjs";
11
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-BrpVsSfY.cjs";
12
12
  export * from "@fedify/vocab-runtime";
13
13
 
14
14
  //#region src/mod.d.ts
package/dist/mod.d.ts CHANGED
@@ -2,13 +2,13 @@
2
2
  import { a as InboundService, c as OutboundService, d as Software, f as Usage, i as parseNodeInfo, l as Protocol, n as ParseNodeInfoOptions, o as JsonValue, p as nodeInfoToJson, r as getNodeInfo, s as NodeInfo, t as GetNodeInfoOptions, u as Services } from "./client-CSddvgWN.js";
3
3
  import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "./http-lf8Hsd91.js";
4
4
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "./owner-CnngXDNJ.js";
5
- import { $ as CircuitBreakerCreateOptions, A as OutboxListenerSetters, At as UnverifiedActivityHandler, B as TaskEnqueueOptions, C as FederationStartQueueOptions, Ct as ObjectAuthorizePredicate, D as InboxListenerSetters, Dt as OutboxListenerErrorHandler, E as InboxChallengePolicy, Et as OutboxListener, F as createFederation, Ft as PageItems, G as RetryPolicy, H as TaskRegistry, I as Message, It as buildCollectionSynchronizationHeader, J as respondWithObject, K as createExponentialBackoffPolicy, L as createFederationBuilder, Lt as digest, M as FederationKvPrefixes, Mt as WebFingerLinksDispatcher, N as FederationOrigin, Nt as SendActivityError, O as MediaUploaderSetters, Ot as OutboxPermanentFailureHandler, P as FederationQueueOptions, Pt as SenderKeyPair, Q as CircuitBreakerBeforeSendDecision, R as TaskDefinition, Rt as ActivityTransformer, S as FederationOptions, St as NodeInfoDispatcher, T as IdempotencyStrategy, Tt as OutboxErrorHandler, U as CreateExponentialBackoffPolicyOptions, V as TaskHandler, W as RetryContext, X as CircuitBreaker, Y as respondWithObjectIfAcceptable, Z as CircuitBreakerActivityDrop, _ as Federatable, _t as CustomCollectionCursor, a as GetSignedKeyOptions, at as NormalizedCircuitBreakerOptions, b as FederationBuilder, bt as InboxListener, c as ParseUriResult, ct as ActorAliasMapper, d as SendActivityOptions, dt as ActorKeyPairsDispatcher, et as CircuitBreakerFailurePolicy, f as SendActivityOptionsForCollection, ft as AuthorizePredicate, g as CustomCollectionCallbackSetters, gt as CustomCollectionCounter, h as ConstructorWithTypeId, ht as CollectionDispatcher, i as GetActorOptions, it as CircuitBreakerStateChange, j as Rfc6570Expression, jt as UnverifiedActivityReason, k as ObjectCallbackSetters, kt as SharedInboxKeyDispatcher, l as RequestContext, lt as ActorDispatcher, m as CollectionCallbackSetters, mt as CollectionCursor, n as Context, nt as CircuitBreakerOptions, o as InboxContext, ot as normalizeCircuitBreakerOptions, p as ActorCallbackSetters, pt as CollectionCounter, q as RespondWithObjectOptions, r as ForwardActivityOptions, rt as CircuitBreakerState, s as OutboxContext, st as parseCircuitBreakerKvState, t as ActorKeyPair, tt as CircuitBreakerKvState, u as RouteActivityOptions, ut as ActorHandleMapper, v as Federation, vt as CustomCollectionDispatcher, w as IdempotencyKeyCallback, wt as ObjectDispatcher, x as FederationFetchOptions, xt as MediaUploaderCallback, y as FederationBenchmarkOptions, yt as InboxErrorHandler, z as TaskDefinitionOptions } from "./context-Zii1f5xS.js";
5
+ import { $ as CircuitBreakerCreateOptions, A as OutboxListenerSetters, At as UnverifiedActivityHandler, B as TaskEnqueueOptions, C as FederationStartQueueOptions, Ct as ObjectAuthorizePredicate, D as InboxListenerSetters, Dt as OutboxListenerErrorHandler, E as InboxChallengePolicy, Et as OutboxListener, F as createFederation, Ft as PageItems, G as RetryPolicy, H as TaskRegistry, I as Message, It as buildCollectionSynchronizationHeader, J as respondWithObject, K as createExponentialBackoffPolicy, L as createFederationBuilder, Lt as digest, M as FederationKvPrefixes, Mt as WebFingerLinksDispatcher, N as FederationOrigin, Nt as SendActivityError, O as MediaUploaderSetters, Ot as OutboxPermanentFailureHandler, P as FederationQueueOptions, Pt as SenderKeyPair, Q as CircuitBreakerBeforeSendDecision, R as TaskDefinition, Rt as ActivityTransformer, S as FederationOptions, St as NodeInfoDispatcher, T as IdempotencyStrategy, Tt as OutboxErrorHandler, U as CreateExponentialBackoffPolicyOptions, V as TaskHandler, W as RetryContext, X as CircuitBreaker, Y as respondWithObjectIfAcceptable, Z as CircuitBreakerActivityDrop, _ as Federatable, _t as CustomCollectionCursor, a as GetSignedKeyOptions, at as NormalizedCircuitBreakerOptions, b as FederationBuilder, bt as InboxListener, c as ParseUriResult, ct as ActorAliasMapper, d as SendActivityOptions, dt as ActorKeyPairsDispatcher, et as CircuitBreakerFailurePolicy, f as SendActivityOptionsForCollection, ft as AuthorizePredicate, g as CustomCollectionCallbackSetters, gt as CustomCollectionCounter, h as ConstructorWithTypeId, ht as CollectionDispatcher, i as GetActorOptions, it as CircuitBreakerStateChange, j as Rfc6570Expression, jt as UnverifiedActivityReason, k as ObjectCallbackSetters, kt as SharedInboxKeyDispatcher, l as RequestContext, lt as ActorDispatcher, m as CollectionCallbackSetters, mt as CollectionCursor, n as Context, nt as CircuitBreakerOptions, o as InboxContext, ot as normalizeCircuitBreakerOptions, p as ActorCallbackSetters, pt as CollectionCounter, q as RespondWithObjectOptions, r as ForwardActivityOptions, rt as CircuitBreakerState, s as OutboxContext, st as parseCircuitBreakerKvState, t as ActorKeyPair, tt as CircuitBreakerKvState, u as RouteActivityOptions, ut as ActorHandleMapper, v as Federation, vt as CustomCollectionDispatcher, w as IdempotencyKeyCallback, wt as ObjectDispatcher, x as FederationFetchOptions, xt as MediaUploaderCallback, y as FederationBenchmarkOptions, yt as InboxErrorHandler, z as TaskDefinitionOptions } from "./context-Cjnr0ig1.js";
6
6
  import { a as MemoryKvStore, i as KvStoreSetOptions, n as KvStore, r as KvStoreListEntry, t as KvKey } from "./kv-D6hNiMTK.js";
7
- import { a as MessageQueueDepth, c as ParallelMessageQueue, i as MessageQueue, n as InProcessMessageQueue, o as MessageQueueEnqueueOptions, r as InProcessMessageQueueOptions, s as MessageQueueListenOptions } from "./metrics-Dc4jR-IC.js";
7
+ import { a as MessageQueueDepth, c as ParallelMessageQueue, i as MessageQueue, n as InProcessMessageQueue, o as MessageQueueEnqueueOptions, r as InProcessMessageQueueOptions, s as MessageQueueListenOptions } from "./metrics-v_e0n5GQ.js";
8
8
  import { actorDehydrator, autoIdAssigner, getDefaultActivityTransformers } from "./compat/mod.js";
9
- import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-DLc2Ot6f.js";
9
+ import { a as RouterOptions, i as RouterError, n as handleWebFinger, o as RouterRouteResult, r as Router, t as WebFingerHandlerParameters } from "./mod-BsCE5Ihq.js";
10
10
  import { _ as hasSignatureLike, a as createProof, b as verifySignature, c as verifyObject, d as SignJsonLdOptions, f as VerifyJsonLdOptions, g as detachSignature, h as createSignature, i as VerifyProofOptions, l as verifyProof, m as attachSignature, n as SignObjectOptions, o as hasProofLike, p as VerifySignatureOptions, r as VerifyObjectOptions, s as signObject, t as CreateProofOptions, u as CreateSignatureOptions, v as signJsonLd, y as verifyJsonLd } from "./mod-COIAjwRS.js";
11
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-UMmveiO0.js";
11
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./mod-CNef4in0.js";
12
12
  export * from "@fedify/vocab-runtime";
13
13
 
14
14
  //#region src/mod.d.ts
package/dist/mod.js CHANGED
@@ -3,12 +3,12 @@ import { URLPattern } from "urlpattern-polyfill";
3
3
  import "./chunk-D5IdezsZ.js";
4
4
  import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-DXze6FUB.js";
5
5
  import "./compat/mod.js";
6
- import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "./http-CuQZAaUT.js";
7
- import { a as ParallelMessageQueue, c as respondWithObject, d as digest, f as CircuitBreaker, h as createFederationBuilder, i as InProcessMessageQueue, l as respondWithObjectIfAcceptable, m as parseCircuitBreakerKvState, o as createExponentialBackoffPolicy, p as normalizeCircuitBreakerOptions, r as handleWebFinger, s as SendActivityError, t as createFederation, u as buildCollectionSynchronizationHeader } from "./middleware-CzUjNpkv.js";
8
- import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-p5BKVu79.js";
6
+ import { A as formatAcceptSignature, M as parseAcceptSignature, N as validateAcceptSignature, a as verifyRequestDetailed, c as fetchKeyDetailed, i as verifyRequest, j as fulfillAcceptSignature, l as generateCryptoKeyPair, o as exportJwk, r as signRequest, s as fetchKey, u as importJwk } from "./http-Ctb_KhZ8.js";
7
+ import { a as SendActivityError, c as buildCollectionSynchronizationHeader, d as normalizeCircuitBreakerOptions, f as parseCircuitBreakerKvState, i as createExponentialBackoffPolicy, l as digest, o as respondWithObject, p as createFederationBuilder, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as CircuitBreaker } from "./middleware-CfZR_riY.js";
8
+ import { C as verifySignature, S as verifyJsonLd, _ as hasSignatureLike, a as verifyProof, b as signJsonLd, c as getKeyOwner, d as attachSignature, i as verifyObject, m as detachSignature, n as hasProofLike, p as createSignature, r as signObject, s as doesActorOwnKey, t as createProof } from "./proof-D-H_PnJW.js";
9
9
  import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-DC1pNgJA.js";
10
- import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-CZH7haL0.js";
11
- import { MemoryKvStore, Router, RouterError } from "./federation/mod.js";
10
+ import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BxUZRBC2.js";
11
+ import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError } from "./federation/mod.js";
12
12
  import "./nodeinfo/mod.js";
13
13
  import "./runtime/mod.js";
14
14
  import "./sig/mod.js";
@@ -172,6 +172,11 @@ var ParallelMessageQueue = class ParallelMessageQueue {
172
172
  * @since 2.4.0
173
173
  */
174
174
  nativeDeduplication;
175
+ /**
176
+ * Inherits the atomic batch capability from the wrapped queue.
177
+ * @since 2.4.0
178
+ */
179
+ atomicEnqueueMany;
175
180
  getDepth;
176
181
  /**
177
182
  * Tracks which ordering keys are currently being processed to ensure
@@ -197,6 +202,7 @@ var ParallelMessageQueue = class ParallelMessageQueue {
197
202
  this.workers = workers;
198
203
  this.nativeRetrial = queue.nativeRetrial;
199
204
  this.nativeDeduplication = queue.nativeDeduplication;
205
+ this.atomicEnqueueMany = queue.enqueueMany == null ? false : queue.atomicEnqueueMany;
200
206
  if (queue.getDepth != null) this.getDepth = () => queue.getDepth();
201
207
  }
202
208
  enqueue(message, options) {
@@ -5,7 +5,7 @@ import { r as createRequestContext } from "../context-BJXxPElm.mjs";
5
5
  import { t as MemoryKvStore } from "../kv-CXBAok3k.mjs";
6
6
  import { t as assertEquals } from "../assert_equals-BV7oLMxm.mjs";
7
7
  import "../std__assert-B2NnY9bq.mjs";
8
- import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-C_MX_2Mg.mjs";
8
+ import { _ as handleNodeInfo, o as createFederation, v as handleNodeInfoJrd } from "../middleware-O2LHXFEk.mjs";
9
9
  import { test } from "@fedify/fixture";
10
10
  //#region src/nodeinfo/handler.test.ts
11
11
  test("handleNodeInfo()", async () => {
@@ -1,8 +1,8 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-DIcd3H5U.mjs";
5
- import "./key-C2NKn9Cq.mjs";
4
+ import { n as version, t as name } from "./deno-D3c0o_N0.mjs";
5
+ import "./key-C_gNKtxm.mjs";
6
6
  import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
7
7
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
8
8
  import { getDocumentLoader } from "@fedify/vocab-runtime";
@@ -1,9 +1,9 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-DIcd3H5U.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DTsGrbUw.mjs";
6
- import { n as fetchKey, o as validateCryptoKey } from "./key-C2NKn9Cq.mjs";
4
+ import { n as version, t as name } from "./deno-D3c0o_N0.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-BMaatuZi.mjs";
6
+ import { n as fetchKey, o as validateCryptoKey } from "./key-C_gNKtxm.mjs";
7
7
  import { n as preloadedOnlyDocumentLoader } from "./public-audience-Cr5MsnMq.mjs";
8
8
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-URuqsICz.mjs";
9
9
  import { getLogger } from "@logtape/logtape";
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { F as version, P as name, _ as measureSignatureKeyFetch, d as validateCryptoKey, f as getDurationMs, p as getFederationMetrics, s as fetchKey } from "./http-CuQZAaUT.js";
3
+ import { F as version, P as name, _ as measureSignatureKeyFetch, d as validateCryptoKey, f as getDurationMs, p as getFederationMetrics, s as fetchKey } from "./http-Ctb_KhZ8.js";
4
4
  import { getLogger } from "@logtape/logtape";
5
5
  import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, PUBLIC_COLLECTION, getTypeId, isActor } from "@fedify/vocab";
6
6
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
@@ -1,6 +1,6 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  const require_chunk = require("./chunk-Czpeue4M.cjs");
3
- const require_http = require("./http-C6PWxqco.cjs");
3
+ const require_http = require("./http-jr0TkgZe.cjs");
4
4
  const require_temporal_polyfill = require("./temporal-polyfill-BCdTHexd.cjs");
5
5
  let _logtape_logtape = require("@logtape/logtape");
6
6
  let _fedify_vocab = require("@fedify/vocab");
@@ -1,9 +1,9 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-DIcd3H5U.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-DTsGrbUw.mjs";
6
- import { n as doubleKnock } from "./http-v2n_JnYK.mjs";
4
+ import { n as version, t as name } from "./deno-D3c0o_N0.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-BMaatuZi.mjs";
6
+ import { n as doubleKnock } from "./http-Dm0JAUa_.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { FetchError } from "@fedify/vocab-runtime";