@pkcprotocol/pkc-js 0.0.103 → 0.0.105

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 (155) hide show
  1. package/dist/browser/clients/base-client-manager.d.ts +1 -0
  2. package/dist/browser/clients/base-client-manager.js +85 -15
  3. package/dist/browser/clients/base-client-manager.js.map +1 -1
  4. package/dist/browser/community/community-client-manager.d.ts +3 -0
  5. package/dist/browser/community/community-client-manager.js +87 -14
  6. package/dist/browser/community/community-client-manager.js.map +1 -1
  7. package/dist/browser/community/remote-community.js +3 -0
  8. package/dist/browser/community/remote-community.js.map +1 -1
  9. package/dist/browser/community/schema.d.ts +4 -0
  10. package/dist/browser/community/schema.js +7 -1
  11. package/dist/browser/community/schema.js.map +1 -1
  12. package/dist/browser/constants.d.ts +3 -0
  13. package/dist/browser/constants.js +35 -0
  14. package/dist/browser/constants.js.map +1 -1
  15. package/dist/browser/errors.d.ts +5 -1
  16. package/dist/browser/errors.js +7 -1
  17. package/dist/browser/errors.js.map +1 -1
  18. package/dist/browser/generated-version.d.ts +1 -1
  19. package/dist/browser/generated-version.js +1 -1
  20. package/dist/browser/index-with-compile-cache.d.ts +2 -0
  21. package/dist/browser/index.d.ts +2 -0
  22. package/dist/browser/pkc/pkc.d.ts +4 -0
  23. package/dist/browser/pkc/pkc.js +30 -1
  24. package/dist/browser/pkc/pkc.js.map +1 -1
  25. package/dist/browser/pkc-error.d.ts +1 -1
  26. package/dist/browser/publications/comment/comment-client-manager.js +11 -0
  27. package/dist/browser/publications/comment/comment-client-manager.js.map +1 -1
  28. package/dist/browser/publications/comment/comment.js +8 -6
  29. package/dist/browser/publications/comment/comment.js.map +1 -1
  30. package/dist/browser/publications/comment/crosspost-runtime.js +3 -2
  31. package/dist/browser/publications/comment/crosspost-runtime.js.map +1 -1
  32. package/dist/browser/rpc/src/index.js +6 -0
  33. package/dist/browser/rpc/src/index.js.map +1 -1
  34. package/dist/browser/rpc/src/lib/pkc-js/index.d.ts +1 -0
  35. package/dist/browser/rpc/src/schema.d.ts +6 -0
  36. package/dist/browser/runtime/node/community/challenges/exclude/exclude.d.ts +11 -1
  37. package/dist/browser/runtime/node/community/challenges/exclude/exclude.js +32 -21
  38. package/dist/browser/runtime/node/community/challenges/exclude/exclude.js.map +1 -1
  39. package/dist/browser/runtime/node/community/challenges/index.d.ts +10 -3
  40. package/dist/browser/runtime/node/community/challenges/index.js +82 -16
  41. package/dist/browser/runtime/node/community/challenges/index.js.map +1 -1
  42. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/blacklist.js +7 -4
  43. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/blacklist.js.map +1 -1
  44. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/whitelist.js +13 -5
  45. package/dist/browser/runtime/node/community/challenges/pkc-js-challenges/whitelist.js.map +1 -1
  46. package/dist/browser/runtime/node/community/local-community/author-identity.d.ts +37 -2
  47. package/dist/browser/runtime/node/community/local-community/author-identity.js +73 -13
  48. package/dist/browser/runtime/node/community/local-community/author-identity.js.map +1 -1
  49. package/dist/browser/runtime/node/community/local-community/challenges.d.ts +16 -2
  50. package/dist/browser/runtime/node/community/local-community/challenges.js +40 -9
  51. package/dist/browser/runtime/node/community/local-community/challenges.js.map +1 -1
  52. package/dist/browser/runtime/node/community/local-community/editing.js +7 -2
  53. package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
  54. package/dist/browser/runtime/node/community/local-community/publication-store.d.ts +13 -2
  55. package/dist/browser/runtime/node/community/local-community/publication-store.js +29 -7
  56. package/dist/browser/runtime/node/community/local-community/publication-store.js.map +1 -1
  57. package/dist/browser/runtime/node/community/local-community/publication-validation.d.ts +13 -3
  58. package/dist/browser/runtime/node/community/local-community/publication-validation.js +60 -27
  59. package/dist/browser/runtime/node/community/local-community/publication-validation.js.map +1 -1
  60. package/dist/browser/runtime/node/community/local-community.d.ts +2 -2
  61. package/dist/browser/runtime/node/community/local-community.js +6 -4
  62. package/dist/browser/runtime/node/community/local-community.js.map +1 -1
  63. package/dist/browser/runtime/node/util.js +18 -8
  64. package/dist/browser/runtime/node/util.js.map +1 -1
  65. package/dist/browser/schema.d.ts +8 -0
  66. package/dist/browser/test/test-util.d.ts +6 -0
  67. package/dist/browser/test/test-util.js +32 -1
  68. package/dist/browser/test/test-util.js.map +1 -1
  69. package/dist/browser/types.d.ts +1 -0
  70. package/dist/browser/util.d.ts +2 -0
  71. package/dist/browser/util.js +24 -0
  72. package/dist/browser/util.js.map +1 -1
  73. package/dist/bundled/bundle-manifest.json +32 -32
  74. package/dist/bundled/chunks/{helia-for-pkc-BqRIFXGX.js → helia-for-pkc-DanrSDp0.js} +2 -2
  75. package/dist/bundled/chunks/{local-community-mF7g4deD.js → local-community-Bsj3T9vI.js} +1 -1
  76. package/dist/bundled/chunks/{local-community-D0dqj6lQ.js → local-community-h9j5crnN.js} +159 -60
  77. package/dist/bundled/chunks/{node--l7gxhms.js → node-Czo2D65i.js} +19 -8
  78. package/dist/bundled/chunks/{rpc-local-community-C3o1AzHp.js → rpc-local-community-CP0JZU-Q.js} +291 -113
  79. package/dist/bundled/chunks/{schema-MeRr3oiN.js → schema-bdQ9ufF9.js} +26 -4
  80. package/dist/bundled/chunks/{util-CjRKlVEE.js → util-CEpMupHn.js} +1 -1
  81. package/dist/bundled/index.js +1 -1
  82. package/dist/bundled/rpc/src/index.js +9 -4
  83. package/dist/node/clients/base-client-manager.d.ts +1 -0
  84. package/dist/node/clients/base-client-manager.js +85 -15
  85. package/dist/node/clients/base-client-manager.js.map +1 -1
  86. package/dist/node/community/community-client-manager.d.ts +3 -0
  87. package/dist/node/community/community-client-manager.js +87 -14
  88. package/dist/node/community/community-client-manager.js.map +1 -1
  89. package/dist/node/community/remote-community.js +3 -0
  90. package/dist/node/community/remote-community.js.map +1 -1
  91. package/dist/node/community/schema.d.ts +4 -0
  92. package/dist/node/community/schema.js +7 -1
  93. package/dist/node/community/schema.js.map +1 -1
  94. package/dist/node/constants.d.ts +3 -0
  95. package/dist/node/constants.js +35 -0
  96. package/dist/node/constants.js.map +1 -1
  97. package/dist/node/errors.d.ts +5 -1
  98. package/dist/node/errors.js +7 -1
  99. package/dist/node/errors.js.map +1 -1
  100. package/dist/node/generated-version.d.ts +1 -1
  101. package/dist/node/generated-version.js +1 -1
  102. package/dist/node/index-with-compile-cache.d.ts +2 -0
  103. package/dist/node/index.d.ts +2 -0
  104. package/dist/node/pkc/pkc.d.ts +4 -0
  105. package/dist/node/pkc/pkc.js +30 -1
  106. package/dist/node/pkc/pkc.js.map +1 -1
  107. package/dist/node/pkc-error.d.ts +1 -1
  108. package/dist/node/publications/comment/comment-client-manager.js +11 -0
  109. package/dist/node/publications/comment/comment-client-manager.js.map +1 -1
  110. package/dist/node/publications/comment/comment.js +8 -6
  111. package/dist/node/publications/comment/comment.js.map +1 -1
  112. package/dist/node/publications/comment/crosspost-runtime.js +3 -2
  113. package/dist/node/publications/comment/crosspost-runtime.js.map +1 -1
  114. package/dist/node/rpc/src/index.js +6 -0
  115. package/dist/node/rpc/src/index.js.map +1 -1
  116. package/dist/node/rpc/src/lib/pkc-js/index.d.ts +1 -0
  117. package/dist/node/rpc/src/schema.d.ts +6 -0
  118. package/dist/node/runtime/node/community/challenges/exclude/exclude.d.ts +11 -1
  119. package/dist/node/runtime/node/community/challenges/exclude/exclude.js +32 -21
  120. package/dist/node/runtime/node/community/challenges/exclude/exclude.js.map +1 -1
  121. package/dist/node/runtime/node/community/challenges/index.d.ts +10 -3
  122. package/dist/node/runtime/node/community/challenges/index.js +82 -16
  123. package/dist/node/runtime/node/community/challenges/index.js.map +1 -1
  124. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/blacklist.js +7 -4
  125. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/blacklist.js.map +1 -1
  126. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/whitelist.js +13 -5
  127. package/dist/node/runtime/node/community/challenges/pkc-js-challenges/whitelist.js.map +1 -1
  128. package/dist/node/runtime/node/community/local-community/author-identity.d.ts +37 -2
  129. package/dist/node/runtime/node/community/local-community/author-identity.js +73 -13
  130. package/dist/node/runtime/node/community/local-community/author-identity.js.map +1 -1
  131. package/dist/node/runtime/node/community/local-community/challenges.d.ts +16 -2
  132. package/dist/node/runtime/node/community/local-community/challenges.js +40 -9
  133. package/dist/node/runtime/node/community/local-community/challenges.js.map +1 -1
  134. package/dist/node/runtime/node/community/local-community/editing.js +7 -2
  135. package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
  136. package/dist/node/runtime/node/community/local-community/publication-store.d.ts +13 -2
  137. package/dist/node/runtime/node/community/local-community/publication-store.js +29 -7
  138. package/dist/node/runtime/node/community/local-community/publication-store.js.map +1 -1
  139. package/dist/node/runtime/node/community/local-community/publication-validation.d.ts +13 -3
  140. package/dist/node/runtime/node/community/local-community/publication-validation.js +60 -27
  141. package/dist/node/runtime/node/community/local-community/publication-validation.js.map +1 -1
  142. package/dist/node/runtime/node/community/local-community.d.ts +2 -2
  143. package/dist/node/runtime/node/community/local-community.js +6 -4
  144. package/dist/node/runtime/node/community/local-community.js.map +1 -1
  145. package/dist/node/runtime/node/util.js +18 -8
  146. package/dist/node/runtime/node/util.js.map +1 -1
  147. package/dist/node/schema.d.ts +8 -0
  148. package/dist/node/test/test-util.d.ts +6 -0
  149. package/dist/node/test/test-util.js +32 -1
  150. package/dist/node/test/test-util.js.map +1 -1
  151. package/dist/node/types.d.ts +1 -0
  152. package/dist/node/util.d.ts +2 -0
  153. package/dist/node/util.js +24 -0
  154. package/dist/node/util.js.map +1 -1
  155. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $ as isRequestPubsubPublicationOfReply, $n as CommunityAuthorChallengeReservedFieldNames, $t as ChallengeFileFactorySchema, A as doesDomainAddressHaveCapitalLetter, An as CommentUpdateReservedFields, Ar as boolean, B as ipnsNameToIpnsOverPubsubTopic, Cn as CommentIpfsSchema, Cr as messages, D as createAbortError, Dn as CommentUpdateChallengeReservedFieldNames, Dt as listStartedCommunities, En as CommentSignedPropertyNames, Er as require_ms$1, Et as findUpdatingCommunity, Fn as CreateCommentOptionsWithRefinementSchema, Fr as record, Ft as trackUpdatingCommunity, G as isIpnsPath, Gn as CreateCommentEditOptionsWithRefinementSchema, Gt as CommunityEditPubsubMessagePublicationSchema, H as isIpfsCid, Ht as CommunityEditPublicationChallengeRequestToEncryptSchema, In as GetPageParamSchema, Ir as string, It as untrackStartedCommunity, Jt as CommentModerationPubsubMessagePublicationSchema, Kn as AuthorAddressSchema, Kt as CreateCommunityEditPublicationOptionsWithRefinementSchema, L as getPostUpdateTimestampRange, Ln as ModQueuePageIpfsSchema, Lt as untrackUpdatingComment, M as fetchAndValidateIpnsRecordFromGateway, Mn as CommentUpdateSignedPropertyNames, Mr as literal, Nr as number, Nt as trackStartedCommunity, O as deepMergeRuntimeFields, Or as _enum, Pr as object, Q as isRequestPubsubPublicationOfPost, Qn as CommunityAddressSchema, Qt as CreateCommentModerationOptionsWithRefinementSchema, R as hideClassPrivateProps, Rn as PageIpfsSchema, Rt as untrackUpdatingCommunity, S as calculateIpfsCidV0, Sn as CommentIpfsReservedFields, Sr as PKCError, Tn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Tr as require_supports_color, Tt as findUpdatingComment, U as isIpfsPath, Un as CommentEditSignedPropertyNames, V as isAbortError, Vn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Vt as pTimeout, W as isIpns, Wt as CommunityEditPublicationSignedPropertyNames, Xn as CidPathSchema, Xt as CommentModerationSignedPropertyNames, Yn as ChallengeAnswersSchema, Zn as CidStringSchema, Zt as CommentModerationsTableRowSchema, _ as PKCUserOptionBaseSchema, _n as VotePubsubMessagePublicationSchema, _r as FailedToFetchCommentIpfsFromGatewaysError, _t as sleepUntilTimeoutOrAbort, an as CommunityIpfsReservedFields, ar as t$13, b as areEquivalentCommunityAddresses, br as FailedToFetchGenericIpfsFromGatewaysError, bt as timestamp, c as ChallengeVerificationMessageSignedPropertyNames, cn as CreateNewLocalCommunityUserOptionsSchema, cr as t$11, dn as ExportCommunityModLogsOptionsSchema, dr as n$8, dt as resolveWhenPredicateIsTrue, en as ChallengeFileSchema, er as CreateSignerSchema, et as pubsubTopicToDhtKey, f as DecryptedChallengeSchema, fr as r$7, g as PKCParsedOptionsSchema, gn as VoteChallengeRequestToEncryptSchema, gr as require_retry$1, gt as shortifyCid, h as NameResolverSerializedSchema, hn as CreateVoteUserOptionsWithRefinementSchema, hr as e$4, ht as shortifyAddress, i as ChallengeMessageSignedPropertyNames, in as CommunityExportRecordsSchema, j as extractNetworkErrorDetails, jn as CommentUpdateSchema, jr as custom, jt as refreshTrackedCommunityAliases, k as derivePublicationFromChallengeRequest, kn as CommentUpdateForChallengeVerificationSignedPropertyNames, kr as array, kt as listUpdatingCommunities, l as DecryptedChallengeAnswerSchema, ln as CreateRemoteCommunityFunctionArgumentSchema, lr as r$8, m as NameResolveCacheOptionsSchema, mn as isStringDomain, mr as t$9, n as ChallengeAnswerMessageSignedPropertyNames, nn as CommunityChallengeSettingSchema, nt as raceAgainstAbort, o as ChallengeRequestMessageSignedPropertyNames, on as CommunityIpfsSchema, or as e$6, p as DecryptedChallengeVerificationSchema, pn as RpcRemoteCommunityUpdateEventResultSchema, pr as t$10, qn as AuthorCommentIpfsReservedFields, qt as CommentModerationChallengeRequestToEncryptSchema, rn as CommunityEditOptionsSchema, rr as n$9, sn as CommunitySignedPropertyNames, sr as e$5, st as removeNullUndefinedEmptyObjectsValuesRecursively, tr as n$10, un as CreateRpcCommunityFunctionArgumentSchema, ur as t$12, v as PKCUserOptionsSchema, vr as FailedToFetchCommentUpdateFromGatewaysError, wr as logger_default, wt as findStartedCommunity, xn as CommentChallengeRequestToEncryptSchema, xr as FailedToFetchPageIpfsFromGatewaysError, xt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, yn as VoteSignedPropertyNames, yr as FailedToFetchCommunityFromGatewaysError, yt as throwIfAbortSignalAborted, z as interruptibleSleep, zn as CommentEditChallengeRequestToEncryptSchema, zt as require_sha256$1 } from "./schema-MeRr3oiN.js";
2
+ import { $ as isRequestPubsubPublicationOfPost, $n as CommunityAddressSchema, $t as CreateCommentModerationOptionsWithRefinementSchema, A as doesDomainAddressHaveCapitalLetter, An as CommentUpdateForChallengeVerificationSignedPropertyNames, Ar as array, At as listUpdatingCommunities, B as interruptibleSleep, Bn as CommentEditChallengeRequestToEncryptSchema, Bt as require_sha256$1, Cn as CommentIpfsReservedFields, Cr as PKCError, D as createAbortError, Dn as CommentSignedPropertyNames, Dr as require_ms$1, Dt as findUpdatingCommunity, En as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Er as require_supports_color, Et as findUpdatingComment, Fr as object, G as isIpns, Gt as CommunityEditPublicationSignedPropertyNames, H as isAbortError, Hn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Ht as pTimeout, In as CreateCommentOptionsWithRefinementSchema, Ir as record, It as trackUpdatingCommunity, Jn as AuthorCommentIpfsReservedFields, Jt as CommentModerationChallengeRequestToEncryptSchema, K as isIpnsPath, Kn as CreateCommentEditOptionsWithRefinementSchema, Kt as CommunityEditPubsubMessagePublicationSchema, L as getPostUpdateTimestampRange, Ln as GetPageParamSchema, Lr as string, Lt as untrackStartedCommunity, M as fetchAndValidateIpnsRecordFromGateway, Mn as CommentUpdateSchema, Mr as custom, Mt as refreshTrackedCommunityAliases, Nn as CommentUpdateSignedPropertyNames, Nr as literal, O as deepMergeRuntimeFields, On as CommentUpdateChallengeReservedFieldNames, Ot as listStartedCommunities, Pr as number, Pt as trackStartedCommunity, Qn as CidStringSchema, Qt as CommentModerationsTableRowSchema, R as hasTransientNetworkErrorCode, Rn as ModQueuePageIpfsSchema, Rt as untrackUpdatingComment, S as calculateIpfsCidV0, Sn as CommentChallengeRequestToEncryptSchema, Sr as FailedToFetchPageIpfsFromGatewaysError, St as waitForUpdateInCommunityInstanceWithErrorAndTimeout, Tr as logger_default, Tt as findStartedCommunity, U as isIpfsCid, Ut as CommunityEditPublicationChallengeRequestToEncryptSchema, V as ipnsNameToIpnsOverPubsubTopic, W as isIpfsPath, Wn as CommentEditSignedPropertyNames, Xn as ChallengeAnswersSchema, Yt as CommentModerationPubsubMessagePublicationSchema, Zn as CidPathSchema, Zt as CommentModerationSignedPropertyNames, _ as PKCUserOptionBaseSchema, _n as VoteChallengeRequestToEncryptSchema, _r as require_retry$1, _t as shortifyCid, an as CommunityExportRecordsSchema, b as areEquivalentCommunityAddresses, bn as VoteSignedPropertyNames, br as FailedToFetchCommunityFromGatewaysError, bt as throwIfAbortSignalAborted, c as ChallengeVerificationMessageSignedPropertyNames, cn as CommunitySignedPropertyNames, cr as e$5, ct as removeNullUndefinedEmptyObjectsValuesRecursively, dn as CreateRpcCommunityFunctionArgumentSchema, dr as t$12, en as ChallengeFileFactorySchema, er as CommunityAuthorChallengeReservedFieldNames, et as isRequestPubsubPublicationOfReply, f as DecryptedChallengeSchema, fn as ExportCommunityModLogsOptionsSchema, fr as n$8, ft as resolveWhenPredicateIsTrue, g as PKCParsedOptionsSchema, gn as CreateVoteUserOptionsWithRefinementSchema, gr as e$4, gt as shortifyAddress, h as NameResolverSerializedSchema, hn as isStringDomain, hr as t$9, i as ChallengeMessageSignedPropertyNames, in as CommunityEditOptionsSchema, ir as n$9, j as extractNetworkErrorDetails, jn as CommentUpdateReservedFields, jr as boolean, k as derivePublicationFromChallengeRequest, kr as _enum, l as DecryptedChallengeAnswerSchema, ln as CreateNewLocalCommunityUserOptionsSchema, lr as t$11, m as NameResolveCacheOptionsSchema, mn as RpcRemoteCommunityUpdateEventResultSchema, mr as t$10, n as ChallengeAnswerMessageSignedPropertyNames, nr as n$10, o as ChallengeRequestMessageSignedPropertyNames, on as CommunityIpfsReservedFields, or as t$13, p as DecryptedChallengeVerificationSchema, pr as r$7, qn as AuthorAddressSchema, qt as CreateCommunityEditPublicationOptionsWithRefinementSchema, rn as CommunityChallengeSettingSchema, rt as raceAgainstAbort, sn as CommunityIpfsSchema, sr as e$6, tn as ChallengeFileSchema, tr as CreateSignerSchema, tt as pubsubTopicToDhtKey, un as CreateRemoteCommunityFunctionArgumentSchema, ur as r$8, v as PKCUserOptionsSchema, vn as VotePubsubMessagePublicationSchema, vr as FailedToFetchCommentIpfsFromGatewaysError, vt as sleepUntilTimeoutOrAbort, wn as CommentIpfsSchema, wr as messages, xr as FailedToFetchGenericIpfsFromGatewaysError, xt as timestamp, yr as FailedToFetchCommentUpdateFromGatewaysError, z as hideClassPrivateProps, zn as PageIpfsSchema, zt as untrackUpdatingCommunity } from "./schema-bdQ9ufF9.js";
3
3
  import { t as all } from "./src-CYIMjhjK.js";
4
4
  import { createHash } from "node:crypto";
5
5
  import { pathToFileURL } from "node:url";
@@ -91428,6 +91428,9 @@ var STORAGE_KEYS;
91428
91428
  STORAGE_KEYS[STORAGE_KEYS["ANCHOR_IPNS_RECORD"] = 5] = "ANCHOR_IPNS_RECORD";
91429
91429
  STORAGE_KEYS[STORAGE_KEYS["HIGHEST_ACCEPTED_ANCHOR_SEQUENCE"] = 6] = "HIGHEST_ACCEPTED_ANCHOR_SEQUENCE";
91430
91430
  })(STORAGE_KEYS || (STORAGE_KEYS = {}));
91431
+ const NAME_RESOLVED_FALSE_TTL_MS = 6e4;
91432
+ const NAME_RESOLVED_TRUE_TTL_MS = 36e5;
91433
+ const NAME_RESOLVE_FAILED_RETRY_FLOOR_MS = 1e4;
91431
91434
  //#endregion
91432
91435
  //#region node_modules/safe-stable-stringify/index.js
91433
91436
  var require_safe_stable_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -99621,21 +99624,24 @@ var BaseClientsManager = class BaseClientsManager {
99621
99624
  });
99622
99625
  } catch (error) {
99623
99626
  if (isAbortError(error)) throw error;
99624
- const p2pValidationNote = !(error instanceof PKCError) ? "Resolution failed inside the IPNS resolver (kubo/helia). Over P2P the resolver performs per-record signature validation, so a forged/tampered/unverifiable record appears here as a resolution failure, not an explicit forgery error (cf. the gateway path's ERR_GATEWAY_IPNS_RECORD_CHAIN_INVALID). See docs/protocol/delegated-ipns.md." : void 0;
99627
+ const isOpaqueResolverError = !(error instanceof PKCError);
99628
+ const p2pValidationNote = isOpaqueResolverError ? "Resolution failed inside the IPNS resolver (kubo/helia). Over P2P the resolver performs per-record signature validation, so a forged/tampered/unverifiable record appears here as a resolution failure, not an explicit forgery error (cf. the gateway path's ERR_GATEWAY_IPNS_RECORD_CHAIN_INVALID). See docs/protocol/delegated-ipns.md." : void 0;
99625
99629
  error.details = {
99626
99630
  ...error.details,
99627
99631
  ipnsName,
99628
99632
  ipnsResolveOpts,
99629
99633
  ...p2pValidationNote ? { note: p2pValidationNote } : {}
99630
99634
  };
99631
- if (error instanceof Error && "cause" in error && error.cause?.code === "ETIMEDOUT") {
99632
- log.error(`Failed to resolve IPNS ${ipnsName}: ${error.message} (ETIMEDOUT)`);
99635
+ const networkErrorDetails = isOpaqueResolverError ? extractNetworkErrorDetails(error) : void 0;
99636
+ if (error instanceof Error && networkErrorDetails && hasTransientNetworkErrorCode(networkErrorDetails)) {
99637
+ log.error(`Failed to resolve IPNS ${ipnsName}: ${error.message} (${error.name})`, networkErrorDetails);
99633
99638
  throw new PKCError("ERR_FAILED_TO_RESOLVE_IPNS_VIA_IPFS_P2P", {
99634
99639
  ipnsName,
99635
99640
  ipnsResolveOpts,
99636
99641
  error,
99637
99642
  errorMessage: error.message,
99638
99643
  errorName: error.name,
99644
+ networkErrorDetails,
99639
99645
  note: p2pValidationNote
99640
99646
  });
99641
99647
  }
@@ -99753,6 +99759,8 @@ var BaseClientsManager = class BaseClientsManager {
99753
99759
  const persistentCache = this._getNameResolutionCache();
99754
99760
  let value;
99755
99761
  let anyResolverCanHandle = false;
99762
+ let anyResolverAnswered = false;
99763
+ const resolverErrors = {};
99756
99764
  for (const nameResolver of nameResolvers) {
99757
99765
  if (!nameResolver.canResolve({ name })) continue;
99758
99766
  anyResolverCanHandle = true;
@@ -99764,6 +99772,7 @@ var BaseClientsManager = class BaseClientsManager {
99764
99772
  });
99765
99773
  if (cached) {
99766
99774
  value = cached.publicKey;
99775
+ anyResolverAnswered = true;
99767
99776
  break;
99768
99777
  }
99769
99778
  this.preResolveNameResolver({
@@ -99790,8 +99799,13 @@ var BaseClientsManager = class BaseClientsManager {
99790
99799
  if (abortSignal?.aborted) throwIfAbortSignalAborted(abortSignal);
99791
99800
  if (isAbortError(error)) throw error;
99792
99801
  log.trace(`Resolver ${nameResolver.key} failed for ${name}`, error);
99802
+ resolverErrors[nameResolver.key] = {
99803
+ provider: nameResolver.provider,
99804
+ error
99805
+ };
99793
99806
  continue;
99794
99807
  }
99808
+ anyResolverAnswered = true;
99795
99809
  this.postResolveNameResolverSuccess({
99796
99810
  address: name,
99797
99811
  resolveType,
@@ -99816,8 +99830,17 @@ var BaseClientsManager = class BaseClientsManager {
99816
99830
  }
99817
99831
  }
99818
99832
  if (!anyResolverCanHandle) throw new PKCError("ERR_NO_RESOLVER_FOR_NAME", { address: name });
99833
+ if (!value && !anyResolverAnswered) throw new PKCError("ERR_ALL_NAME_RESOLVERS_FAILED", {
99834
+ address: name,
99835
+ resolverErrors
99836
+ });
99819
99837
  return value || null;
99820
99838
  }
99839
+ canResolveName(name) {
99840
+ const nameResolvers = this._pkc.nameResolvers;
99841
+ if (!nameResolvers || nameResolvers.length === 0) return false;
99842
+ return nameResolvers.some((nameResolver) => nameResolver.canResolve({ name }));
99843
+ }
99821
99844
  async resolveCommunityNameIfNeeded({ communityName, abortSignal, cache }) {
99822
99845
  assert(typeof communityName === "string", "communityName needs to be a string to be resolved");
99823
99846
  if (!isStringDomain(communityName)) return communityName;
@@ -99850,14 +99873,20 @@ var BaseClientsManager = class BaseClientsManager {
99850
99873
  resolveAuthorNamesInBackground({ authors, onResolved, abortSignal }) {
99851
99874
  const log = logger_default("pkc-js:base-client-manager:resolveAuthorNamesInBackground");
99852
99875
  const verificationCache = this._pkc._memCaches.nameResolvedCache;
99876
+ const inFlight = this._pkc._authorNameResolvesInFlight;
99877
+ const failedRecently = this._pkc._memCaches.nameResolveFailedCache;
99853
99878
  const seen = /* @__PURE__ */ new Set();
99854
99879
  const toResolve = [];
99855
99880
  for (const { authorName, signaturePublicKey } of authors) {
99856
99881
  if (!isStringDomain(authorName)) continue;
99882
+ if (!this.canResolveName(authorName)) continue;
99857
99883
  const cacheKey = (0, import_sha256.sha256)(authorName + signaturePublicKey);
99858
99884
  if (seen.has(cacheKey)) continue;
99859
99885
  seen.add(cacheKey);
99860
99886
  if (typeof verificationCache.get(cacheKey) === "boolean") continue;
99887
+ if (inFlight.has(cacheKey)) continue;
99888
+ if (failedRecently.get(cacheKey)) continue;
99889
+ inFlight.add(cacheKey);
99861
99890
  toResolve.push({
99862
99891
  authorName,
99863
99892
  signaturePublicKey,
@@ -99865,27 +99894,34 @@ var BaseClientsManager = class BaseClientsManager {
99865
99894
  });
99866
99895
  }
99867
99896
  if (toResolve.length === 0) return;
99897
+ const setVerdict = (cacheKey, verdict) => verdict ? verificationCache.set(cacheKey, true, { ttl: this._pkc._nameResolvedTrueTtlMs }) : verificationCache.set(cacheKey, false, { ttl: this._pkc._nameResolvedFalseTtlMs });
99868
99898
  const limit = pLimit(MAX_CONCURRENT_AUTHOR_NAME_RESOLUTIONS);
99869
99899
  const resolveOne = async (entry) => {
99870
- if (abortSignal?.aborted) return false;
99871
99900
  try {
99901
+ if (abortSignal?.aborted) return false;
99872
99902
  const { resolvedAuthorName: resolved } = await this.resolveAuthorNameIfNeeded({
99873
99903
  authorName: entry.authorName,
99874
99904
  abortSignal,
99875
99905
  cache: { maxAge: 3600 }
99876
99906
  });
99877
- if (typeof resolved !== "string") return false;
99907
+ if (typeof resolved !== "string") {
99908
+ setVerdict(entry.cacheKey, false);
99909
+ return true;
99910
+ }
99878
99911
  const signerAddress = await getPKCAddressFromPublicKey(entry.signaturePublicKey);
99879
- verificationCache.set(entry.cacheKey, resolved === signerAddress);
99912
+ setVerdict(entry.cacheKey, resolved === signerAddress);
99880
99913
  return true;
99881
99914
  } catch (e) {
99882
99915
  if (isAbortError(e)) return false;
99883
- if (e instanceof PKCError && e.code === "ERR_NO_RESOLVER_FOR_NAME") {
99884
- verificationCache.set(entry.cacheKey, false);
99916
+ if (e instanceof PKCError && e.code === "ERR_RESOLVED_TEXT_RECORD_TO_NON_IPNS") {
99917
+ setVerdict(entry.cacheKey, false);
99885
99918
  return true;
99886
99919
  }
99887
99920
  log.error("Failed to resolve author name in background", entry.authorName, e);
99921
+ failedRecently.set(entry.cacheKey, true, { ttl: this._pkc._nameResolveFailedRetryFloorMs });
99888
99922
  return false;
99923
+ } finally {
99924
+ inFlight.delete(entry.cacheKey);
99889
99925
  }
99890
99926
  };
99891
99927
  Promise.allSettled(toResolve.map((entry) => limit(() => resolveOne(entry)))).then((results) => {
@@ -100619,7 +100655,6 @@ function collectCrosspostAuthorsToResolve({ crosspost, maxLevels = CROSSPOST_LEV
100619
100655
  const authors = [];
100620
100656
  const chain = _chainOf(crosspost).slice(0, maxLevels);
100621
100657
  for (const level of chain) {
100622
- if (typeof level.comment.author?.nameResolved === "boolean") continue;
100623
100658
  const authorName = getAuthorNameFromWire(level.comment.author);
100624
100659
  if (!authorName) continue;
100625
100660
  authors.push({
@@ -101998,6 +102033,7 @@ var CommentClientsManager = class extends PublicationClientsManager {
101998
102033
  return;
101999
102034
  }
102000
102035
  this._resetFreshHandlerAbortController();
102036
+ if (!this._pkc._pkcRpcClient) this._comment._resolveAuthorNamesInBackground();
102001
102037
  const postInUpdatingCommunity = this._findCommentInPagesOfUpdatingCommentsOrCommunity({ community });
102002
102038
  if (postInUpdatingCommunity && postInUpdatingCommunity.commentUpdate.updatedAt > (this._comment.raw?.commentUpdate?.updatedAt || 0)) {
102003
102039
  const log = logger_default("pkc-js:comment:update:handleUpdateEventFromCommunity:find-comment-update-in-updating-community-or-comments-pages");
@@ -102181,6 +102217,7 @@ var CommentClientsManager = class extends PublicationClientsManager {
102181
102217
  const log = logger_default("pkc-js:comment:update:handleUpdateEventFromPost");
102182
102218
  log("Received update event from post", postInstance.cid, "for reply", this._comment.cid, "with depth", this._comment.depth);
102183
102219
  this._resetFreshHandlerAbortController();
102220
+ if (!this._pkc._pkcRpcClient) this._comment._resolveAuthorNamesInBackground();
102184
102221
  if (Object.keys(postInstance.replies.pageCids).length === 0 && Object.keys(postInstance.replies.pages).length === 0) {
102185
102222
  log("Post", postInstance.cid, "has no replies, therefore reply", this._comment.cid, "will wait until another update event by post");
102186
102223
  this._comment._setUpdatingStateWithEmissionIfNewState("waiting-retry");
@@ -102458,24 +102495,27 @@ async function tryToDeleteCommunitiesThatFailedToBeDeletedBefore(pkc, log) {
102458
102495
  }
102459
102496
  }
102460
102497
  function listCommunitiesSync(pkc) {
102461
- logger_default("pkc-js:listCommunitiesSync");
102498
+ const log = logger_default("pkc-js:listCommunitiesSync");
102462
102499
  if (typeof pkc.dataPath !== "string") throw Error("pkc.dataPath needs to be defined to listCommunities");
102463
102500
  const communitiesPath = path.join(pkc.dataPath, "communities");
102464
102501
  const files = readdirSync(communitiesPath, {
102465
102502
  recursive: false,
102466
- withFileTypes: false
102467
- }).map((file) => file.toString()).filter((file) => !file.includes(".lock") && !file.endsWith("-journal") && !file.endsWith("-shm") && !file.endsWith("-wal"));
102503
+ withFileTypes: true
102504
+ }).filter((dirent) => dirent.isFile()).map((dirent) => dirent.name).filter((file) => !file.includes(".lock") && !file.endsWith("-journal") && !file.endsWith("-shm") && !file.endsWith("-wal"));
102468
102505
  const communityFilesWeDontNeedToCheck = pkc.communities ? files.filter((address) => pkc.communities.includes(address)) : [];
102469
102506
  const sqliteFiles = files.filter((address) => !communityFilesWeDontNeedToCheck.includes(address)).filter((address) => {
102507
+ const filePath = path.join(communitiesPath, address);
102470
102508
  try {
102471
- const filePath = path.join(communitiesPath, address);
102472
- if (!existsSync(filePath)) return false;
102473
102509
  const fd = openSync(filePath, "r");
102474
102510
  const buffer = Buffer.alloc(16);
102475
- readSync(fd, buffer, 0, 16, 0);
102476
- closeSync(fd);
102511
+ try {
102512
+ readSync(fd, buffer, 0, 16, 0);
102513
+ } finally {
102514
+ closeSync(fd);
102515
+ }
102477
102516
  return buffer.toString().startsWith("SQLite format 3");
102478
102517
  } catch (e) {
102518
+ if (!(e instanceof Error && "code" in e && e.code === "ENOENT")) log.error(`Failed to check whether ${filePath} is a SQLite file, skipping it`, e);
102479
102519
  return false;
102480
102520
  }
102481
102521
  });
@@ -125434,6 +125474,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
125434
125474
  this._pendingIpnsArrivalHopTargets = /* @__PURE__ */ new Set();
125435
125475
  this._nextResolveRevalidatesNetwork = false;
125436
125476
  this._lastForcedIpnsNetworkRevalidationAtMs = 0;
125477
+ this._nameResolveInFlight = false;
125437
125478
  this._community = community;
125438
125479
  this._initPKCRpcClients();
125439
125480
  hideClassPrivateProps(this);
@@ -125492,6 +125533,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
125492
125533
  }
125493
125534
  postResolveNameResolverSuccess(opts) {
125494
125535
  super.postResolveNameResolverSuccess(opts);
125536
+ if (opts.resolveType !== "community") return;
125495
125537
  if (!opts.resolvedValue && this._community.state === "updating") throw new PKCError("ERR_DOMAIN_TXT_RECORD_NOT_FOUND", { name: opts.address });
125496
125538
  }
125497
125539
  _getCommunityAddressFromInstance() {
@@ -125578,9 +125620,13 @@ var CommunityClientsManager = class extends PKCClientsManager {
125578
125620
  const publicKeyBeforeApply = this._community.publicKey;
125579
125621
  this._community.initCommunityIpfsPropsNoMerge(communityLoadingRes.community);
125580
125622
  this._community.updateCid = communityLoadingRes.cid;
125581
- if (publicKeyBeforeApply && this._community.publicKey !== publicKeyBeforeApply) this._community.nameResolved = void 0;
125582
- if (!isStringDomain(this._community.address) && this._community.name && this._community.publicKey && typeof this._community.nameResolved !== "boolean") this._resolveNameInBackground(this._community.name);
125583
- else if (isStringDomain(this._community.address) && this._community.publicKey && typeof this._community.nameResolved !== "boolean") this._resolveNameInBackground(this._community.address);
125623
+ if (publicKeyBeforeApply && this._community.publicKey !== publicKeyBeforeApply) {
125624
+ this._community.nameResolved = void 0;
125625
+ this._nameResolvedFalseAtMs = void 0;
125626
+ this._nameResolveFailedAtMs = void 0;
125627
+ }
125628
+ if (!isStringDomain(this._community.address) && this._community.name && this._community.publicKey && this._community.nameResolved !== true) this._resolveNameInBackground(this._community.name);
125629
+ else if (isStringDomain(this._community.address) && this._community.publicKey && this._community.nameResolved !== true) this._resolveNameInBackground(this._community.address);
125584
125630
  log(`Remote Community`, this._community.address, `received a new update. Will emit an update event with updatedAt`, this._community.updatedAt, "that's", timestamp() - this._community.updatedAt, "seconds old");
125585
125631
  this._community._changeStateEmitEventEmitStateChangeEvent({
125586
125632
  event: {
@@ -125778,11 +125824,18 @@ var CommunityClientsManager = class extends PKCClientsManager {
125778
125824
  }
125779
125825
  _resolveNameInBackground(name) {
125780
125826
  const log = logger_default("pkc-js:community-client-manager:_resolveNameInBackground");
125827
+ if (this._nameResolveInFlight) return;
125828
+ if (!this.canResolveName(name)) return;
125829
+ if (typeof this._nameResolveFailedAtMs === "number" && Date.now() - this._nameResolveFailedAtMs < this._pkc._nameResolveFailedRetryFloorMs) return;
125830
+ if (this._community.nameResolved === false && typeof this._nameResolvedFalseAtMs === "number" && Date.now() - this._nameResolvedFalseAtMs < this._pkc._nameResolvedFalseTtlMs) return;
125781
125831
  const setNameResolvedAndEmitUpdate = (newNameResolved) => {
125832
+ this._nameResolvedFalseAtMs = newNameResolved === false ? Date.now() : void 0;
125833
+ this._nameResolveFailedAtMs = void 0;
125782
125834
  if (this._community.nameResolved === newNameResolved) return;
125783
125835
  this._community.nameResolved = newNameResolved;
125784
125836
  if (typeof this._community.updatedAt === "number") this._community.emit("update", this._community);
125785
125837
  };
125838
+ this._nameResolveInFlight = true;
125786
125839
  this._resolveCommunityNameWithoutUpdatingState({
125787
125840
  communityName: name,
125788
125841
  abortSignal: this._community._getStopAbortSignal(),
@@ -125801,8 +125854,14 @@ var CommunityClientsManager = class extends PKCClientsManager {
125801
125854
  } else if (resolved) setNameResolvedAndEmitUpdate(true);
125802
125855
  if (!resolved && this._community.name) setNameResolvedAndEmitUpdate(false);
125803
125856
  }).catch((e) => {
125804
- if (e instanceof PKCError && (e.code === "ERR_NO_RESOLVER_FOR_NAME" || e.code === "ERR_DOMAIN_TXT_RECORD_NOT_FOUND")) setNameResolvedAndEmitUpdate(false);
125805
- else log.trace("Background name resolution failed for", name, e);
125857
+ if (e instanceof PKCError && (e.code === "ERR_DOMAIN_TXT_RECORD_NOT_FOUND" || e.code === "ERR_RESOLVED_TEXT_RECORD_TO_NON_IPNS")) setNameResolvedAndEmitUpdate(false);
125858
+ else if (isAbortError(e)) return;
125859
+ else {
125860
+ log.trace("Background name resolution failed for", name, e);
125861
+ this._nameResolveFailedAtMs = Date.now();
125862
+ }
125863
+ }).finally(() => {
125864
+ this._nameResolveInFlight = false;
125806
125865
  });
125807
125866
  }
125808
125867
  _resolvePageAuthorNamesInBackground() {
@@ -125814,7 +125873,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
125814
125873
  if (!page) continue;
125815
125874
  for (const comment of page.comments) {
125816
125875
  const domain = getAuthorNameFromRuntime(comment.author);
125817
- if (domain && typeof comment.author.nameResolved !== "boolean") authors.push({
125876
+ if (domain) authors.push({
125818
125877
  authorName: domain,
125819
125878
  signaturePublicKey: comment.signature.publicKey
125820
125879
  });
@@ -125847,7 +125906,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
125847
125906
  abortSignal: this._community._getStopAbortSignal(),
125848
125907
  cache: { maxAge: 3600 }
125849
125908
  });
125850
- if (!isDomain && this._community.name && this._community.publicKey && typeof this._community.nameResolved !== "boolean") this._resolveNameInBackground(this._community.name);
125909
+ if (!isDomain && this._community.name && this._community.publicKey && this._community.nameResolved !== true) this._resolveNameInBackground(this._community.name);
125851
125910
  if (!ipnsName) throw Error("Failed to resolve community address to an IPNS name");
125852
125911
  if (this._community.ipnsName !== ipnsName) {
125853
125912
  this._community.ipnsName = ipnsName;
@@ -128508,70 +128567,22 @@ const addToRateLimiter = (communityChallenges, request, challengeSuccess) => {
128508
128567
  for (const rateLimiter of Object.values(rateLimiters)) rateLimiter.tryRemoveTokens(1);
128509
128568
  };
128510
128569
  //#endregion
128511
- //#region dist/node/runtime/node/community/local-community/author-identity.js
128512
- function createAuthorIdentityMatcher({ community, publication }) {
128513
- const log = logger_default("pkc-js:local-community:author-identity");
128514
- const signerAddress = getPKCAddressFromPublicKeySync(publication.signature.publicKey);
128515
- const wireName = getAuthorNameFromWire(publication.author);
128516
- let nameResolvesToSignerPromise;
128517
- const nameResolvesToSigner = () => {
128518
- if (!wireName || !isStringDomain(wireName)) return Promise.resolve(false);
128519
- if (!nameResolvesToSignerPromise) nameResolvesToSignerPromise = (async () => {
128520
- try {
128521
- const { resolvedAuthorName } = await community._clientsManager.resolveAuthorNameIfNeeded({
128522
- authorName: wireName,
128523
- abortSignal: AbortSignal.timeout(community._pkc._timeouts["resolve-author-name"]),
128524
- cache: { maxAge: 0 }
128525
- });
128526
- return resolvedAuthorName === signerAddress;
128527
- } catch (e) {
128528
- log("Failed to resolve author name while matching identity, treating as no match", wireName, e);
128529
- return false;
128530
- }
128531
- })();
128532
- return nameResolvesToSignerPromise;
128533
- };
128534
- const matchesIdentity = async (identity) => {
128535
- if (!isStringDomain(identity)) return identity === signerAddress;
128536
- if (identity !== wireName) return false;
128537
- return nameResolvesToSigner();
128538
- };
128539
- const matchesAnyIdentity = async (identities) => {
128540
- let nameListed = false;
128541
- for (const identity of identities) {
128542
- if (identity === signerAddress) return true;
128543
- if (wireName && identity === wireName) nameListed = true;
128544
- }
128545
- return nameListed ? nameResolvesToSigner() : false;
128546
- };
128547
- return {
128548
- signerAddress,
128549
- wireName,
128550
- matchesIdentity,
128551
- matchesAnyIdentity
128552
- };
128553
- }
128554
- //#endregion
128555
128570
  //#region dist/node/runtime/node/community/challenges/exclude/exclude.js
128556
- const testRole = async (excludeRole, getIdentityMatcher, communityRoles) => {
128557
- if (!communityRoles) return false;
128571
+ const testRole = async ({ excludeRole, identityMatcher, communityRoles }) => {
128572
+ if (!communityRoles) return { matched: false };
128558
128573
  const roleKeys = Object.keys(communityRoles).filter((roleKey) => excludeRole.includes(communityRoles[roleKey].role));
128559
- if (roleKeys.length === 0) return false;
128560
- return getIdentityMatcher().matchesAnyIdentity(roleKeys);
128574
+ if (roleKeys.length === 0) return { matched: false };
128575
+ return identityMatcher.matchesAnyIdentity(roleKeys);
128561
128576
  };
128562
- const shouldExcludePublication = async (communityChallenge, request, community) => {
128577
+ const shouldExcludePublication = async ({ communityChallenge, request, community, identityMatcher }) => {
128563
128578
  if (!communityChallenge) throw Error(`shouldExcludePublication invalid communityChallenge argument '${communityChallenge}'`);
128564
128579
  const publication = derivePublicationFromChallengeRequest(request);
128565
128580
  if (!publication?.author) throw Error(`shouldExcludePublication invalid publication argument '${publication}'`);
128566
128581
  const author = publication.author;
128567
- if (!communityChallenge.exclude) return false;
128582
+ if (!communityChallenge.exclude) return { shouldExclude: false };
128568
128583
  if (!Array.isArray(communityChallenge.exclude)) throw Error(`shouldExcludePublication invalid communityChallenge argument '${communityChallenge}' communityChallenge.exclude not an array`);
128569
128584
  let authorPublicationCounts;
128570
- let identityMatcher;
128571
- const getIdentityMatcher = () => identityMatcher ??= createAuthorIdentityMatcher({
128572
- community,
128573
- publication
128574
- });
128585
+ let nameFailure;
128575
128586
  for (const exclude of communityChallenge.exclude) {
128576
128587
  if (typeof exclude.postScore !== "number" && typeof exclude.replyScore !== "number" && typeof exclude.postCount !== "number" && typeof exclude.replyCount !== "number" && typeof exclude.firstCommentTimestamp !== "number" && !exclude.publicKeys?.length && !exclude.names?.length && exclude.publicationType === void 0 && exclude.rateLimit === void 0 && !exclude.roles?.length) continue;
128577
128588
  let shouldExclude = true;
@@ -128580,17 +128591,36 @@ const shouldExcludePublication = async (communityChallenge, request, community)
128580
128591
  if (!testFirstCommentTimestamp(exclude.firstCommentTimestamp, author.community?.firstCommentTimestamp)) shouldExclude = false;
128581
128592
  if (!testPublicationType(exclude.publicationType, request)) shouldExclude = false;
128582
128593
  if (!testRateLimit(exclude, request)) shouldExclude = false;
128583
- if (exclude.publicKeys && !exclude.publicKeys.includes(getIdentityMatcher().signerAddress)) shouldExclude = false;
128584
- if (exclude.names && !await getIdentityMatcher().matchesAnyIdentity(exclude.names)) shouldExclude = false;
128585
- if (Array.isArray(exclude.roles) && !await testRole(exclude.roles, getIdentityMatcher, community?.roles)) shouldExclude = false;
128594
+ if (exclude.publicKeys && !exclude.publicKeys.includes(identityMatcher.signerAddress)) shouldExclude = false;
128586
128595
  if (typeof exclude.postCount === "number" || typeof exclude.replyCount === "number") {
128587
- if (!authorPublicationCounts && community?._dbHandler) authorPublicationCounts = community._dbHandler.queryAuthorPublicationCounts(getIdentityMatcher().signerAddress);
128596
+ if (!authorPublicationCounts && community?._dbHandler) authorPublicationCounts = community._dbHandler.queryAuthorPublicationCounts(identityMatcher.signerAddress);
128588
128597
  if (!testScore(exclude.postCount, authorPublicationCounts?.postCount)) shouldExclude = false;
128589
128598
  if (!testScore(exclude.replyCount, authorPublicationCounts?.replyCount)) shouldExclude = false;
128590
128599
  }
128591
- if (shouldExclude) return true;
128600
+ if (shouldExclude && exclude.names) {
128601
+ const namesMatch = await identityMatcher.matchesAnyIdentity(exclude.names);
128602
+ if (!namesMatch.matched) {
128603
+ shouldExclude = false;
128604
+ nameFailure ??= namesMatch.nameFailure;
128605
+ }
128606
+ }
128607
+ if (shouldExclude && Array.isArray(exclude.roles)) {
128608
+ const roleMatch = await testRole({
128609
+ excludeRole: exclude.roles,
128610
+ identityMatcher,
128611
+ communityRoles: community?.roles
128612
+ });
128613
+ if (!roleMatch.matched) {
128614
+ shouldExclude = false;
128615
+ nameFailure ??= roleMatch.nameFailure;
128616
+ }
128617
+ }
128618
+ if (shouldExclude) return { shouldExclude: true };
128592
128619
  }
128593
- return false;
128620
+ return {
128621
+ shouldExclude: false,
128622
+ nameFailure
128623
+ };
128594
128624
  };
128595
128625
  const shouldExcludeChallengeSuccess = (communityChallenge, communityChallengeIndex, challengeResults) => {
128596
128626
  if (!communityChallenge) throw Error(`shouldExcludeChallengeSuccess invalid communityChallenge argument '${communityChallenge}'`);
@@ -128723,6 +128753,98 @@ const shouldExcludeChallengeCommentCids = async (communityChallenge, challengeRe
128723
128753
  return false;
128724
128754
  };
128725
128755
  //#endregion
128756
+ //#region dist/node/runtime/node/community/local-community/author-identity.js
128757
+ const NO_MATCH = { matched: false };
128758
+ const MATCH = { matched: true };
128759
+ /**
128760
+ * The message a publisher is owed when their author name could not be verified: one remedy per outcome, and
128761
+ * one table for both places that classify a resolve, the identity matcher here and `checkAuthorIdentity`, so
128762
+ * the two can never disagree about the same failure. `error: null` is the resolvers answering "no record";
128763
+ * anything else is whatever the resolve threw. Issue #353.
128764
+ */
128765
+ function authorNameResolveFailureReason({ error }) {
128766
+ if (error === null) return messages.ERR_AUTHOR_NAME_HAS_NO_RECORD;
128767
+ const code = error instanceof PKCError ? error.code : void 0;
128768
+ if (code === "ERR_NO_RESOLVER_FOR_NAME") return messages.ERR_COMMUNITY_HAS_NO_RESOLVER_FOR_AUTHOR_NAME_TLD;
128769
+ if (code === "ERR_RESOLVED_TEXT_RECORD_TO_NON_IPNS") return messages.ERR_AUTHOR_NAME_RECORD_IS_NOT_A_VALID_KEY;
128770
+ return messages.ERR_COMMUNITY_FAILED_TO_RESOLVE_AUTHOR_NAME;
128771
+ }
128772
+ /**
128773
+ * The matcher for an author nothing can refer to: no signature to derive an identity from, so every configured
128774
+ * identity string is a non-match, and a non-match with no `nameFailure` because no name was ever consulted.
128775
+ * Answering "no match" beats throwing from deep inside validation or the challenge runner.
128776
+ */
128777
+ const NO_OP_AUTHOR_IDENTITY_MATCHER = {
128778
+ signerAddress: "",
128779
+ wireName: void 0,
128780
+ matchesIdentity: async () => NO_MATCH,
128781
+ matchesAnyIdentity: async () => NO_MATCH
128782
+ };
128783
+ function authorIdentityMatcherForRequest({ community, request }) {
128784
+ const publication = derivePublicationFromChallengeRequest(request);
128785
+ if (typeof publication?.signature?.publicKey !== "string") return NO_OP_AUTHOR_IDENTITY_MATCHER;
128786
+ return createAuthorIdentityMatcher({
128787
+ community,
128788
+ publication
128789
+ });
128790
+ }
128791
+ function createAuthorIdentityMatcher({ community, publication }) {
128792
+ const log = logger_default("pkc-js:local-community:author-identity");
128793
+ const signerAddress = getPKCAddressFromPublicKeySync(publication.signature.publicKey);
128794
+ const wireName = getAuthorNameFromWire(publication.author);
128795
+ let nameOutcomePromise;
128796
+ const nameResolvesToSigner = () => {
128797
+ if (!wireName || !isStringDomain(wireName)) return Promise.resolve(NO_MATCH);
128798
+ if (!nameOutcomePromise) nameOutcomePromise = (async () => {
128799
+ try {
128800
+ const { resolvedAuthorName } = await community._clientsManager.resolveAuthorNameIfNeeded({
128801
+ authorName: wireName,
128802
+ abortSignal: AbortSignal.timeout(community._pkc._timeouts["resolve-author-name"]),
128803
+ cache: { maxAge: 0 }
128804
+ });
128805
+ if (resolvedAuthorName === signerAddress) return MATCH;
128806
+ if (resolvedAuthorName === null) {
128807
+ log("Author name has no record while matching identity", wireName);
128808
+ return {
128809
+ matched: false,
128810
+ nameFailure: { reason: authorNameResolveFailureReason({ error: null }) }
128811
+ };
128812
+ }
128813
+ return NO_MATCH;
128814
+ } catch (e) {
128815
+ log("Failed to resolve author name while matching identity", wireName, e instanceof PKCError ? e.code : void 0, e);
128816
+ return {
128817
+ matched: false,
128818
+ nameFailure: {
128819
+ reason: authorNameResolveFailureReason({ error: e }),
128820
+ error: e
128821
+ }
128822
+ };
128823
+ }
128824
+ })();
128825
+ return nameOutcomePromise;
128826
+ };
128827
+ const matchesIdentity = async (identity) => {
128828
+ if (!isStringDomain(identity)) return identity === signerAddress ? MATCH : NO_MATCH;
128829
+ if (identity !== wireName) return NO_MATCH;
128830
+ return nameResolvesToSigner();
128831
+ };
128832
+ const matchesAnyIdentity = async (identities) => {
128833
+ let nameListed = false;
128834
+ for (const identity of identities) {
128835
+ if (identity === signerAddress) return MATCH;
128836
+ if (wireName && identity === wireName) nameListed = true;
128837
+ }
128838
+ return nameListed ? nameResolvesToSigner() : NO_MATCH;
128839
+ };
128840
+ return {
128841
+ signerAddress,
128842
+ wireName,
128843
+ matchesIdentity,
128844
+ matchesAnyIdentity
128845
+ };
128846
+ }
128847
+ //#endregion
128726
128848
  //#region dist/node/runtime/node/community/challenges/pkc-js-challenges/text-math.js
128727
128849
  const optionInputs$5 = [{
128728
128850
  option: "difficulty",
@@ -128897,16 +129019,16 @@ var UrlsAddressesSet$1 = class {
128897
129019
  }
128898
129020
  };
128899
129021
  const urlsAddressesSet$1 = new UrlsAddressesSet$1();
128900
- const getChallenge$3 = async ({ challengeSettings, challengeRequestMessage, community }) => {
129022
+ const getChallenge$3 = async ({ challengeSettings, challengeRequestMessage, community, authorIdentityMatcher }) => {
128901
129023
  const error = challengeSettings?.options?.error;
128902
129024
  const addresses = challengeSettings?.options?.addresses?.split(",").map((u) => u.trim()).filter(Boolean);
128903
129025
  const addressesSet = new Set(addresses);
128904
129026
  const publication = derivePublicationFromChallengeRequest(challengeRequestMessage);
128905
- const identityMatcher = createAuthorIdentityMatcher({
129027
+ const identityMatcher = authorIdentityMatcher ?? createAuthorIdentityMatcher({
128906
129028
  community,
128907
129029
  publication
128908
129030
  });
128909
- if (await identityMatcher.matchesAnyIdentity(addressesSet) || await identityMatcher.matchesAnyIdentity(await urlsAddressesSet$1.getAddresses(getCommunityAddressFromRecord(publication), challengeSettings?.options?.urls))) return {
129031
+ if ((await identityMatcher.matchesAnyIdentity(addressesSet)).matched || (await identityMatcher.matchesAnyIdentity(await urlsAddressesSet$1.getAddresses(getCommunityAddressFromRecord(publication), challengeSettings?.options?.urls))).matched) return {
128910
129032
  success: false,
128911
129033
  error: error || `You're blacklisted.`
128912
129034
  };
@@ -128988,19 +129110,29 @@ var UrlsAddressesSet = class {
128988
129110
  }
128989
129111
  };
128990
129112
  const urlsAddressesSet = new UrlsAddressesSet();
128991
- const getChallenge$2 = async ({ challengeSettings, challengeRequestMessage, community }) => {
129113
+ const getChallenge$2 = async ({ challengeSettings, challengeRequestMessage, community, authorIdentityMatcher }) => {
128992
129114
  const error = challengeSettings?.options?.error;
128993
129115
  const addresses = challengeSettings?.options?.addresses?.split(",").map((u) => u.trim()).filter(Boolean);
128994
129116
  const addressesSet = new Set(addresses);
128995
129117
  const publication = derivePublicationFromChallengeRequest(challengeRequestMessage);
128996
- const identityMatcher = createAuthorIdentityMatcher({
129118
+ const identityMatcher = authorIdentityMatcher ?? createAuthorIdentityMatcher({
128997
129119
  community,
128998
129120
  publication
128999
129121
  });
129000
- if (!(await identityMatcher.matchesAnyIdentity(addressesSet) || await identityMatcher.matchesAnyIdentity(await urlsAddressesSet.getAddresses(getCommunityAddressFromRecord(publication), challengeSettings?.options?.urls)))) return {
129001
- success: false,
129002
- error: error || `You're not whitelisted.`
129003
- };
129122
+ const directMatch = await identityMatcher.matchesAnyIdentity(addressesSet);
129123
+ const urlMatch = directMatch.matched ? directMatch : await identityMatcher.matchesAnyIdentity(await urlsAddressesSet.getAddresses(getCommunityAddressFromRecord(publication), challengeSettings?.options?.urls));
129124
+ if (!urlMatch.matched) {
129125
+ const nameFailure = directMatch.nameFailure ?? urlMatch.nameFailure;
129126
+ if (nameFailure) return {
129127
+ success: false,
129128
+ error: nameFailure.reason,
129129
+ reason: nameFailure.reason
129130
+ };
129131
+ return {
129132
+ success: false,
129133
+ error: error || `You're not whitelisted.`
129134
+ };
129135
+ }
129004
129136
  return { success: true };
129005
129137
  };
129006
129138
  function ChallengeFileFactory$2({ challengeSettings }) {
@@ -129321,14 +129453,15 @@ const loadChallengeFile = async ({ communityChallengeSettings, challengeIndex, c
129321
129453
  });
129322
129454
  return { challengeFile };
129323
129455
  };
129324
- const callGetChallenge = async ({ challengeFile, communityChallengeSettings, challengeRequestMessage, challengeIndex, community }) => {
129456
+ const callGetChallenge = async ({ challengeFile, communityChallengeSettings, challengeRequestMessage, challengeIndex, community, authorIdentityMatcher }) => {
129325
129457
  let challengeOrChallengeResult;
129326
129458
  try {
129327
129459
  challengeOrChallengeResult = await challengeFile.getChallenge({
129328
129460
  challengeSettings: communityChallengeSettings,
129329
129461
  challengeRequestMessage,
129330
129462
  challengeIndex,
129331
- community
129463
+ community,
129464
+ authorIdentityMatcher
129332
129465
  });
129333
129466
  validateChallengeOrChallengeResult({
129334
129467
  challengeOrChallengeResult,
@@ -129411,7 +129544,11 @@ const canFailedChallengeStillBeExcluded = (i, communityChallenges, decided, resu
129411
129544
  }
129412
129545
  return false;
129413
129546
  };
129414
- const getPendingChallengesOrChallengeVerification = async ({ challengeRequestMessage, community }) => {
129547
+ const getPendingChallengesOrChallengeVerification = async ({ challengeRequestMessage, community, authorIdentityMatcher }) => {
129548
+ const identityMatcher = authorIdentityMatcher ?? authorIdentityMatcherForRequest({
129549
+ community,
129550
+ request: challengeRequestMessage
129551
+ });
129415
129552
  if (!Array.isArray(community.settings?.challenges)) return {
129416
129553
  challengeSuccess: true,
129417
129554
  pendingApprovalSuccess: false
@@ -129428,12 +129565,23 @@ const getPendingChallengesOrChallengeVerification = async ({ challengeRequestMes
129428
129565
  challengeIndex: i,
129429
129566
  community
129430
129567
  })).challengeFile));
129568
+ const identityNameFailureByIndex = new Array(challengeCount);
129431
129569
  await Promise.all(communityChallenges.map(async (communityChallenge, i) => {
129432
- if (await shouldExcludePublication(communityChallenge, challengeRequestMessage, community)) {
129570
+ const excludeResult = await shouldExcludePublication({
129571
+ communityChallenge,
129572
+ request: challengeRequestMessage,
129573
+ community,
129574
+ identityMatcher
129575
+ });
129576
+ if (excludeResult.shouldExclude) {
129433
129577
  decided[i] = true;
129434
129578
  return;
129435
129579
  }
129436
- if (await shouldExcludeChallengeCommentCids(communityChallenge, challengeRequestMessage, community._pkc)) decided[i] = true;
129580
+ if (await shouldExcludeChallengeCommentCids(communityChallenge, challengeRequestMessage, community._pkc)) {
129581
+ decided[i] = true;
129582
+ return;
129583
+ }
129584
+ identityNameFailureByIndex[i] = excludeResult.nameFailure;
129437
129585
  }));
129438
129586
  const deferred = new Array(challengeCount).fill(false);
129439
129587
  let shortCircuitToFailure = false;
@@ -129466,7 +129614,8 @@ const getPendingChallengesOrChallengeVerification = async ({ challengeRequestMes
129466
129614
  communityChallengeSettings: community.settings.challenges[i],
129467
129615
  challengeRequestMessage,
129468
129616
  challengeIndex: i,
129469
- community
129617
+ community,
129618
+ authorIdentityMatcher: identityMatcher
129470
129619
  })).challengeOrChallengeResult;
129471
129620
  decided[i] = true;
129472
129621
  }
@@ -129492,7 +129641,8 @@ const getPendingChallengesOrChallengeVerification = async ({ challengeRequestMes
129492
129641
  communityChallengeSettings: community.settings.challenges[firstUndecided],
129493
129642
  challengeRequestMessage,
129494
129643
  challengeIndex: firstUndecided,
129495
- community
129644
+ community,
129645
+ authorIdentityMatcher: identityMatcher
129496
129646
  })).challengeOrChallengeResult;
129497
129647
  decided[firstUndecided] = true;
129498
129648
  }
@@ -129553,18 +129703,24 @@ const getPendingChallengesOrChallengeVerification = async ({ challengeRequestMes
129553
129703
  if (challengeSuccess === false) return {
129554
129704
  challengeSuccess,
129555
129705
  challengeErrors,
129556
- aggregatedReason: agg.aggregatedReason
129706
+ aggregatedReason: agg.aggregatedReason,
129707
+ identityNameFailureByIndex
129557
129708
  };
129558
129709
  return {
129559
129710
  pendingChallenges,
129560
129711
  pendingApprovalSuccess,
129561
129712
  deferredChallenges: deferredChallenges.length > 0 ? deferredChallenges : void 0,
129562
129713
  partialResults: results,
129563
- communityChallenges
129714
+ communityChallenges,
129715
+ identityNameFailureByIndex
129564
129716
  };
129565
129717
  };
129566
- const getChallengeVerificationFromChallengeAnswers = async ({ pendingChallenges, challengeAnswers, community, challengeRequestMessage, deferredChallenges, partialResults, communityChallenges }) => {
129718
+ const getChallengeVerificationFromChallengeAnswers = async ({ pendingChallenges, challengeAnswers, community, challengeRequestMessage, deferredChallenges, partialResults, communityChallenges, authorIdentityMatcher }) => {
129567
129719
  if (!Array.isArray(community.settings?.challenges)) throw Error("community.settings?.challenges is not defined");
129720
+ const identityMatcher = authorIdentityMatcher ?? (challengeRequestMessage ? authorIdentityMatcherForRequest({
129721
+ community,
129722
+ request: challengeRequestMessage
129723
+ }) : NO_OP_AUTHOR_IDENTITY_MATCHER);
129568
129724
  const challengeCount = community.settings.challenges.length;
129569
129725
  const verifyChallengePromises = [];
129570
129726
  for (const i in pendingChallenges) verifyChallengePromises.push(Promise.resolve(pendingChallenges[i].verify(challengeAnswers[i])));
@@ -129613,7 +129769,8 @@ const getChallengeVerificationFromChallengeAnswers = async ({ pendingChallenges,
129613
129769
  communityChallengeSettings: community.settings.challenges[i],
129614
129770
  challengeRequestMessage,
129615
129771
  challengeIndex: i,
129616
- community
129772
+ community,
129773
+ authorIdentityMatcher: identityMatcher
129617
129774
  })).challengeOrChallengeResult;
129618
129775
  decided[i] = true;
129619
129776
  }
@@ -129640,7 +129797,8 @@ const getChallengeVerificationFromChallengeAnswers = async ({ pendingChallenges,
129640
129797
  communityChallengeSettings: community.settings.challenges[firstUndecided],
129641
129798
  challengeRequestMessage,
129642
129799
  challengeIndex: firstUndecided,
129643
- community
129800
+ community,
129801
+ authorIdentityMatcher: identityMatcher
129644
129802
  })).challengeOrChallengeResult;
129645
129803
  decided[firstUndecided] = true;
129646
129804
  }
@@ -129683,19 +129841,29 @@ const getChallengeVerificationFromChallengeAnswers = async ({ pendingChallenges,
129683
129841
  ...successAgg
129684
129842
  };
129685
129843
  };
129686
- const getChallengeVerification = async ({ challengeRequestMessage, community, getChallengeAnswers }) => {
129844
+ const getChallengeVerification = async ({ challengeRequestMessage, community, getChallengeAnswers, authorIdentityMatcher }) => {
129687
129845
  if (!challengeRequestMessage) throw Error(`getChallengeVerification invalid challengeRequestMessage argument '${challengeRequestMessage}'`);
129688
129846
  if (typeof community?._pkc?.getComment !== "function") throw Error(`getChallengeVerification invalid community argument '${community}' invalid community.pkc instance`);
129689
129847
  if (typeof getChallengeAnswers !== "function") throw Error(`getChallengeVerification invalid getChallengeAnswers argument '${getChallengeAnswers}' not a function`);
129690
129848
  if (!Array.isArray(community.settings?.challenges)) throw Error("community.settings?.challenges is not defined");
129691
129849
  const res = await getPendingChallengesOrChallengeVerification({
129692
129850
  challengeRequestMessage,
129693
- community
129851
+ community,
129852
+ authorIdentityMatcher: authorIdentityMatcher ?? authorIdentityMatcherForRequest({
129853
+ community,
129854
+ request: challengeRequestMessage
129855
+ })
129694
129856
  });
129695
129857
  let pendingApprovalSuccess = "pendingApprovalSuccess" in res ? res.pendingApprovalSuccess : false;
129858
+ const identityNameFailureByIndex = "identityNameFailureByIndex" in res ? res.identityNameFailureByIndex : void 0;
129696
129859
  let challengeVerification;
129860
+ let postAnswerAuthorIdentityMatcher;
129697
129861
  if ("pendingChallenges" in res) {
129698
129862
  const challengeAnswers = await getChallengeAnswers(res.pendingChallenges.map((challenge) => n$9(challenge, ["index", "verify"])));
129863
+ postAnswerAuthorIdentityMatcher = authorIdentityMatcherForRequest({
129864
+ community,
129865
+ request: challengeRequestMessage
129866
+ });
129699
129867
  const verificationFromPending = await getChallengeVerificationFromChallengeAnswers({
129700
129868
  pendingChallenges: res.pendingChallenges,
129701
129869
  challengeAnswers,
@@ -129703,7 +129871,8 @@ const getChallengeVerification = async ({ challengeRequestMessage, community, ge
129703
129871
  challengeRequestMessage,
129704
129872
  deferredChallenges: res.deferredChallenges,
129705
129873
  partialResults: res.partialResults,
129706
- communityChallenges: res.communityChallenges
129874
+ communityChallenges: res.communityChallenges,
129875
+ authorIdentityMatcher: postAnswerAuthorIdentityMatcher
129707
129876
  });
129708
129877
  if ("pendingApprovalSuccess" in verificationFromPending) {
129709
129878
  pendingApprovalSuccess = pendingApprovalSuccess || verificationFromPending.pendingApprovalSuccess;
@@ -129719,12 +129888,21 @@ const getChallengeVerification = async ({ challengeRequestMessage, community, ge
129719
129888
  if ("aggregatedCommentUpdate" in res && res.aggregatedCommentUpdate) challengeVerification.aggregatedCommentUpdate = res.aggregatedCommentUpdate;
129720
129889
  if ("aggregatedReason" in res && res.aggregatedReason) challengeVerification.aggregatedReason = res.aggregatedReason;
129721
129890
  }
129891
+ const failedChallengeIndexes = Object.keys(challengeVerification.challengeErrors ?? {});
129892
+ const decisiveNameFailure = failedChallengeIndexes.length > 0 && identityNameFailureByIndex ? failedChallengeIndexes.every((index) => identityNameFailureByIndex[Number(index)]) ? identityNameFailureByIndex[Number(failedChallengeIndexes[0])] : void 0 : void 0;
129893
+ if (challengeVerification.challengeSuccess === false && decisiveNameFailure) challengeVerification.aggregatedReason = decisiveNameFailure.reason;
129722
129894
  addToRateLimiter(community.settings?.challenges, challengeRequestMessage, challengeVerification.challengeSuccess);
129723
- if (Boolean(challengeRequestMessage.comment) && challengeVerification.challengeSuccess === true && pendingApprovalSuccess) return {
129895
+ const shouldSendToPendingApproval = Boolean(challengeRequestMessage.comment) && challengeVerification.challengeSuccess === true && pendingApprovalSuccess;
129896
+ const postAnswerMatcherField = postAnswerAuthorIdentityMatcher ? { postAnswerAuthorIdentityMatcher } : {};
129897
+ if (shouldSendToPendingApproval) return {
129898
+ ...challengeVerification,
129899
+ pendingApproval: true,
129900
+ ...postAnswerMatcherField
129901
+ };
129902
+ return {
129724
129903
  ...challengeVerification,
129725
- pendingApproval: true
129904
+ ...postAnswerMatcherField
129726
129905
  };
129727
- return challengeVerification;
129728
129906
  };
129729
129907
  const derivePublicOptions = (communityChallengeSettings) => {
129730
129908
  const { publicOptions, options } = communityChallengeSettings;
@@ -130389,4 +130567,4 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
130389
130567
  }
130390
130568
  };
130391
130569
  //#endregion
130392
- export { parseRawPages as $, RpcSuccessResultSchema as $n, getPKCAddressFromPublicKeySync as $t, deriveCommentIpfsFromCommentTableRow as A, parseRpcCommentUpdateEventWithPKCErrorIfItFails as An, verifyCommentEdit as At, resolveDbPostsCidRefs as B, RpcCommunityPageParamSchema as Bn, getAuthorNameFromRuntime as Bt, encryptEd25519AesGcmPublicKeyBuffer as C, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as Cn, signCommunity as Ct, calculateInlineRepliesBudget as D, parseJsonWithPKCErrorIfFails as Dn, verifyChallengeMessage as Dt, calculateExpectedSignatureSize as E, parseDecryptedChallengeWithPKCErrorIfItFails as En, verifyChallengeAnswer as Et, getThumbnailPropsOfLink as F, RpcAuthorNameParamSchema as Fn, verifyCommunity as Ft, POST_REPLIES_SORT_TYPES as G, RpcExportCommunityResultSchema as Gn, getCommunityNameFromWire$1 as Gt, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as H, RpcExportCommunityModLogsParamSchema as Hn, normalizeCreatePublicationAuthor as Ht, importSignerIntoKuboNode as I, RpcCancelExportParamSchema as In, verifyCommunityEdit as It, buildPageRuntimeFields as J, RpcPublishAnchorRecordParamSchema as Jn, decode as Jt, REPLY_REPLIES_SORT_TYPES as K, RpcFetchCidParamSchema as Kn, getCommunityPublicKeyFromWire as Kt, listCommunitiesSync as L, RpcCidParamSchema as Ln, verifyVote as Lt, deriveDbReplies as M, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Mn, verifyCommentModeration as Mt, getDefaultCommunityDbConfig as N, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Nn, verifyCommentPubsubMessage as Nt, createKuboRpcClient as O, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as On, verifyChallengeRequest as Ot, getDefaultDataPath as P, RpcAnchorPublishPreparationResultSchema as Pn, verifyCommentUpdate as Pt, iterateOverPageCidsToFindAllCids as Q, RpcSubscriptionIdResultSchema as Qn, getPKCAddressFromPublicKey as Qt, monitorCommunitiesDirectory as R, RpcCommentRepliesPageParamSchema as Rn, buildRuntimeAuthor as Rt, encryptEd25519AesGcm as S, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as Sn, signCommentUpdateForChallengeVerification as St, backupCommunityDb as T, parseDecryptedChallengeVerification as Tn, signVote as Tt, CommentClientsManager as U, RpcExportCommunityModLogsResultSchema as Un, buildRuntimeCommunityFields as Ut, setNativeFunctions as V, RpcEditCommunityParamSchema as Vn, getAuthorNameFromWire as Vt, POSTS_SORT_TYPES as W, RpcExportCommunityParamSchema as Wn, getCommunityAddressFromRecord as Wt, extractCommunityRuntimeFieldsFromParsedPages as X, RpcPublishedAnchorRecordResultSchema as Xn, getBufferedPKCAddressFromPublicKey as Xt, buildPagesRuntimeFields as Y, RpcPublishChallengeAnswersParamSchema as Yn, encode as Yt, findCommentInPageInstanceRecursively as Z, RpcResolveAuthorNameResultSchema as Zn, getIpfsKeyFromPrivateKey as Zt, SignerWithPublicKeyAddress as _, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as _n, signChallengeVerification as _t, loadChallengeFileFromCommunityChallengeSettings as a, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as an, r as ar, stripNameResolvedFromCrosspost as at, decryptEd25519AesGcm as b, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as bn, signCommentModeration as bt, TrackedInstanceRegistry as c, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as cn, n$6 as cr, InflightFetchManager as ct, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as d, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as dn, stringify as dr, PKCTypedEmitter as dt, getPublicKeyFromPrivateKey as en, RpcUnsubscribeParamSchema as er, RepliesPages as et, KeyvBetterSqlite3 as f, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as fn, STORAGE_KEYS as fr, require_lib$1 as ft, decodeRpcChallengeVerificationPubsubMsg as g, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as gn, signChallengeRequest as gt, decodeRpcChallengeRequestPubsubMsg as h, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as hn, require_undici as hr, signChallengeMessage as ht, getCommunityChallengeFromCommunityChallengeSettings as i, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as in, t$4 as ir, extractCrosspostRuntimeFields as it, deriveDbPosts as j, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as jn, verifyCommentIpfs as jt, deleteOldCommunityInWindows as k, parseRpcCommentEventWithPKCErrorIfItFails as kn, verifyChallengeVerification as kt, LRUCache as l, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as ln, t$7 as lr, pRetry as lt, decodeRpcChallengePubsubMsg as m, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as mn, nativeFunctions$1 as mr, signChallengeAnswer as mt, RpcRemoteCommunity as n, parseCidStringSchemaWithPKCErrorIfItFails as nn, effectiveMaxCrosspostDepth as nr, cloneCrosspostForRuntime as nt, pkcJsChallenges as o, parseCommentIpfsSchemaWithPKCErrorIfItFails as on, t$5 as or, PublicationClientsManager as ot, decodeRpcChallengeAnswerPubsubMsg as p, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as pn, require_lodash_merge as pr, cleanUpBeforePublishing as pt, TIMEFRAMES_TO_SECONDS as q, RpcFetchCidResultSchema as qn, normalizeCommunityInputFromCommunity as qt, getChallengeVerification as r, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as rn, t$2 as rr, collectCrosspostAuthorsToResolve as rt, createAuthorIdentityMatcher as s, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as sn, n$5 as sr, PKCClientsManager as st, RpcLocalCommunity as t, createSchemaRowParser as tn, crosspostChainDepthUpTo as tr, applyNameResolvedCacheToCrosspost as tt, RemoteCommunity as u, parseCommunityAddressWithPKCErrorIfItFails as un, t$8 as ur, pLimit as ut, createSigner as v, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as vn, signComment as vt, BackupAbortError as w, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as wn, signCommunityEdit as wt, decryptEd25519AesGcmPublicKeyBuffer as x, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as xn, signCommentUpdate as xt, createAnchorIpnsRecord as y, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as yn, signCommentEdit as yt, moveCommunityDbToDeletedDirectory as z, RpcCommunityIdentifierParamSchema as zn, cleanWireAuthor as zt };
130570
+ export { findCommentInPageInstanceRecursively as $, RpcResolveAuthorNameResultSchema as $n, getIpfsKeyFromPrivateKey as $t, createKuboRpcClient as A, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as An, verifyChallengeRequest as At, monitorCommunitiesDirectory as B, RpcCommentRepliesPageParamSchema as Bn, buildRuntimeAuthor as Bt, decryptEd25519AesGcmPublicKeyBuffer as C, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as Cn, signCommentUpdate as Ct, backupCommunityDb as D, parseDecryptedChallengeVerification as Dn, signVote as Dt, BackupAbortError as E, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as En, signCommunityEdit as Et, getDefaultCommunityDbConfig as F, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Fn, verifyCommentPubsubMessage as Ft, CommentClientsManager as G, RpcExportCommunityModLogsResultSchema as Gn, buildRuntimeCommunityFields as Gt, resolveDbPostsCidRefs as H, RpcCommunityPageParamSchema as Hn, getAuthorNameFromRuntime as Ht, getDefaultDataPath as I, RpcAnchorPublishPreparationResultSchema as In, verifyCommentUpdate as It, REPLY_REPLIES_SORT_TYPES as J, RpcFetchCidParamSchema as Jn, getCommunityPublicKeyFromWire as Jt, POSTS_SORT_TYPES as K, RpcExportCommunityParamSchema as Kn, getCommunityAddressFromRecord as Kt, getThumbnailPropsOfLink as L, RpcAuthorNameParamSchema as Ln, verifyCommunity as Lt, deriveCommentIpfsFromCommentTableRow as M, parseRpcCommentUpdateEventWithPKCErrorIfItFails as Mn, verifyCommentEdit as Mt, deriveDbPosts as N, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as Nn, verifyCommentIpfs as Nt, calculateExpectedSignatureSize as O, parseDecryptedChallengeWithPKCErrorIfItFails as On, verifyChallengeAnswer as Ot, deriveDbReplies as P, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Pn, verifyCommentModeration as Pt, extractCommunityRuntimeFieldsFromParsedPages as Q, RpcPublishedAnchorRecordResultSchema as Qn, getBufferedPKCAddressFromPublicKey as Qt, importSignerIntoKuboNode as R, RpcCancelExportParamSchema as Rn, verifyCommunityEdit as Rt, decryptEd25519AesGcm as S, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as Sn, signCommentModeration as St, encryptEd25519AesGcmPublicKeyBuffer as T, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as Tn, signCommunity as Tt, setNativeFunctions as U, RpcEditCommunityParamSchema as Un, getAuthorNameFromWire as Ut, moveCommunityDbToDeletedDirectory as V, RpcCommunityIdentifierParamSchema as Vn, cleanWireAuthor as Vt, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as W, RpcExportCommunityModLogsParamSchema as Wn, normalizeCreatePublicationAuthor as Wt, buildPageRuntimeFields as X, RpcPublishAnchorRecordParamSchema as Xn, decode as Xt, TIMEFRAMES_TO_SECONDS as Y, RpcFetchCidResultSchema as Yn, normalizeCommunityInputFromCommunity as Yt, buildPagesRuntimeFields as Z, RpcPublishChallengeAnswersParamSchema as Zn, encode as Zt, decodeRpcChallengeRequestPubsubMsg as _, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as _n, STORAGE_KEYS as _r, signChallengeMessage as _t, loadChallengeFileFromCommunityChallengeSettings as a, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as an, t$2 as ar, collectCrosspostAuthorsToResolve as at, createSigner as b, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as bn, require_undici as br, signComment as bt, authorNameResolveFailureReason as c, parseCommentIpfsSchemaWithPKCErrorIfItFails as cn, t$5 as cr, PublicationClientsManager as ct, LRUCache as d, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as dn, t$7 as dr, pRetry as dt, getPKCAddressFromPublicKey as en, RpcSubscriptionIdResultSchema as er, iterateOverPageCidsToFindAllCids as et, RemoteCommunity as f, parseCommunityAddressWithPKCErrorIfItFails as fn, t$8 as fr, pLimit as ft, decodeRpcChallengePubsubMsg as g, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as gn, NAME_RESOLVE_FAILED_RETRY_FLOOR_MS as gr, signChallengeAnswer as gt, decodeRpcChallengeAnswerPubsubMsg as h, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as hn, NAME_RESOLVED_TRUE_TTL_MS as hr, cleanUpBeforePublishing as ht, getCommunityChallengeFromCommunityChallengeSettings as i, parseCidStringSchemaWithPKCErrorIfItFails as in, effectiveMaxCrosspostDepth as ir, cloneCrosspostForRuntime as it, deleteOldCommunityInWindows as j, parseRpcCommentEventWithPKCErrorIfItFails as jn, verifyChallengeVerification as jt, calculateInlineRepliesBudget as k, parseJsonWithPKCErrorIfFails as kn, verifyChallengeMessage as kt, createAuthorIdentityMatcher as l, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as ln, n$5 as lr, PKCClientsManager as lt, KeyvBetterSqlite3 as m, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as mn, NAME_RESOLVED_FALSE_TTL_MS as mr, require_lib$1 as mt, RpcRemoteCommunity as n, getPublicKeyFromPrivateKey as nn, RpcUnsubscribeParamSchema as nr, RepliesPages as nt, pkcJsChallenges as o, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as on, t$4 as or, extractCrosspostRuntimeFields as ot, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as p, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as pn, stringify as pr, PKCTypedEmitter as pt, POST_REPLIES_SORT_TYPES as q, RpcExportCommunityResultSchema as qn, getCommunityNameFromWire$1 as qt, getChallengeVerification as r, createSchemaRowParser as rn, crosspostChainDepthUpTo as rr, applyNameResolvedCacheToCrosspost as rt, authorIdentityMatcherForRequest as s, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as sn, r as sr, stripNameResolvedFromCrosspost as st, RpcLocalCommunity as t, getPKCAddressFromPublicKeySync as tn, RpcSuccessResultSchema as tr, parseRawPages as tt, TrackedInstanceRegistry as u, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as un, n$6 as ur, InflightFetchManager as ut, decodeRpcChallengeVerificationPubsubMsg as v, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as vn, require_lodash_merge as vr, signChallengeRequest as vt, encryptEd25519AesGcm as w, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as wn, signCommentUpdateForChallengeVerification as wt, createAnchorIpnsRecord as x, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as xn, signCommentEdit as xt, SignerWithPublicKeyAddress as y, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as yn, nativeFunctions$1 as yr, signChallengeVerification as yt, listCommunitiesSync as z, RpcCidParamSchema as zn, verifyVote as zt };