@pkcprotocol/pkc-js 0.0.113 → 0.0.114

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 (29) hide show
  1. package/dist/browser/generated-version.d.ts +1 -1
  2. package/dist/browser/generated-version.js +1 -1
  3. package/dist/browser/pages/page-sort-scoring.d.ts +4 -0
  4. package/dist/browser/pages/page-sort-scoring.js +20 -3
  5. package/dist/browser/pages/page-sort-scoring.js.map +1 -1
  6. package/dist/browser/runtime/node/community/db-handler.js +6 -6
  7. package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
  8. package/dist/browser/runtime/node/community/page-generator.js +11 -17
  9. package/dist/browser/runtime/node/community/page-generator.js.map +1 -1
  10. package/dist/bundled/bundle-manifest.json +37 -37
  11. package/dist/bundled/chunks/{helia-for-pkc-DoOp7t8V.js → helia-for-pkc-hSpmyI9D.js} +33 -33
  12. package/dist/bundled/chunks/{local-community-CFX753RE.js → local-community-Dc_fNPrx.js} +1 -1
  13. package/dist/bundled/chunks/{local-community-CaV30etW.js → local-community-EeQMdfYM.js} +39 -47
  14. package/dist/bundled/chunks/{node-gyqBss4j.js → node-apYZl3B3.js} +5 -5
  15. package/dist/bundled/chunks/{rpc-local-community-DWv8wZMB.js → rpc-local-community-C_0FRCqg.js} +15 -2
  16. package/dist/bundled/chunks/{util-CH8WrVZq.js → util-B2SuJZg-.js} +1 -1
  17. package/dist/bundled/chunks/{util-B9JenRyE.js → util-DFGl6QDd.js} +1 -1
  18. package/dist/bundled/index.js +1 -1
  19. package/dist/bundled/rpc/src/index.js +4 -4
  20. package/dist/node/generated-version.d.ts +1 -1
  21. package/dist/node/generated-version.js +1 -1
  22. package/dist/node/pages/page-sort-scoring.d.ts +4 -0
  23. package/dist/node/pages/page-sort-scoring.js +20 -3
  24. package/dist/node/pages/page-sort-scoring.js.map +1 -1
  25. package/dist/node/runtime/node/community/db-handler.js +6 -6
  26. package/dist/node/runtime/node/community/db-handler.js.map +1 -1
  27. package/dist/node/runtime/node/community/page-generator.js +11 -17
  28. package/dist/node/runtime/node/community/page-generator.js.map +1 -1
  29. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $t as CommentModerationPubsubMessagePublicationSchema, A as isLinkOfAnimatedImage, An as CommentIpfsSchema, Ar as PKCError, At as ChallengeMessageSchema, Bn as CommentUpdateTableRowSchema, Dn as VoteTablesRowSchema, Dt as pTimeout, F as isLinkValid, Gr as ZodError, Jn as CommentEditPubsubMessagePublicationSchema, Jt as CommunityEditPublicationPubsubReservedFields, K as removeNullUndefinedValues, Kt as version_default, Lt as DecryptedChallengeRequestPublicationSchema, M as isLinkOfImage, Mr as logger_default, Mt as ChallengeRequestMessageSchema, N as isLinkOfMedia, Ot as ChallengeAnswerMessageSchema, P as isLinkOfVideo, Pt as ChallengeVerificationMessageSchema, Q as retryKuboIpfsAddAndProvide, Qn as CommentEditsTableRowSchema, R as pubsubTopicToDhtKey, Rn as CommentUpdateSchema, Rt as DecryptedChallengeRequestSchema, S as hideClassPrivateProps, Sr as t$2, St as untrackStartedCommunity, Tn as VotePubsubReservedFields, Tt as require_sha256, U as removeBlocksFromKuboNode, Vn as CommentsTableRowSchema, W as removeMfsFilesSafely, X as retryKuboBlockPutPinAndProvidePubsubTopic, Xn as CommentEditReservedFields, Yn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, _ as getEquivalentCommunityAddresses, _r as r$1, a as calculateUnixFsDagSizeCidV0, c as contentContainsMarkdownVideos, ct as writeKuboFilesWithTimeout, d as derivePublicationFromChallengeRequest, dn as CommunityIpfsSchema, dr as n$2, en as CommentModerationReservedFields, f as doesDomainAddressHaveCapitalLetter, fn as CommunitySignedPropertyNames, fr as t$5, ft as findUpdatingCommunity, g as genToArray, h as findMalformedUnicodeString, hr as e, i as calculateStringSizeSameAsIpfsAddCidV0, it as timestamp, j as isLinkOfAudio, jn as CommentPubsubMessageReservedFields, jr as messages, lr as n$3, lt as findCommunityInRegistry, mr as e$1, nn as CommentModerationsTableRowSchema, nr as AuthorReservedFields, nt as statMfsPathSafely, o as contentContainsMarkdownAudio, ot as withSortedKeys, pr as t$6, r as calculateIpfsCidV0, s as contentContainsMarkdownImages, st as withSortedKeysDeep, t as areEquivalentCommunityAddresses, tt as sleepUntilTimeoutOrAbort, ur as t$7, ut as findStartedCommunity, v as getErrorCodeFromMessage, vr as t$3, vt as syncCommunityRegistryEntry, w as ipnsNameToIpnsOverPubsubTopic, wn as VotePubsubMessagePublicationSchema, wr as require_retry, wt as untrackUpdatingCommunity, xn as isStringDomain, xr as t$4, xt as trackUpdatingCommunity, y as getIpnsRecordInLocalKuboNode, yt as trackStartedCommunity } from "./util-B9JenRyE.js";
3
- import { $ as coerceSchemaRowJson, $n as getPKCAddressFromPublicKeySync, An as verifyCommentModeration, Cr as t$8, D as TIMEFRAMES_TO_SECONDS, Dr as t$9, En as verifyChallengeRequest, Fn as verifyVote, Gn as getCommunityNameFromWire, Hn as effectiveMaxCrosspostDepth, In as buildRuntimeAuthor, Jn as decode, K as pLimit, Kn as getCommunityPublicKeyFromWire, Ln as cleanWireAuthor, Mn as verifyCommentUpdate, Nn as verifyCommunity, Nr as STORAGE_KEYS, On as verifyCommentEdit, Or as stringify, Ot as parseJsonWithPKCErrorIfFails, P as iterateOverPageCidsToFindAllCids, Pn as verifyCommunityEdit, Pr as require_lodash_merge, Q as coerceSchemaRowBoolean, Qn as getPKCAddressFromPublicKey, S as LRUCache, Sr as r$2, T as KeyvBetterSqlite3, Tr as n$4, Tt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Vn as crosspostChainDepthUpTo, Yn as encode, Zn as getIpfsKeyFromPrivateKey, _ as pkcJsChallenges, _n as signCommentEdit, _r as resolveDbPostsCidRefs, a as loadPageSortsForStartedCommunity, b as createAuthorIdentityMatcher, bn as signCommentUpdateForChallengeVerification, br as t$10, c as applyPageSortExclusions, cr as deriveDbPosts, d as partitionPageCommentsForSort, dn as cleanUpBeforePublishing, er as getPublicKeyFromPrivateKey, et as collectSchemaRowCoercions, f as scorePageCommentsWithFile, fr as getThumbnailPropsOfLink, g as loadChallengeFileFromCommunityChallengeSettings, gn as signComment, gr as moveCommunityDbToDeletedDirectory, h as getCommunityChallengeFromCommunityChallengeSettings, hn as signChallengeVerification, ht as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, i as generatePagesReportingFailedSorts, ir as calculateInlineRepliesBudget, jn as verifyCommentPubsubMessage, kn as verifyCommentIpfs, l as createDescendantsLookup, ln as encryptEd25519AesGcmPublicKeyBuffer, lr as deriveDbReplies, m as getChallengeVerification, nr as backupCommunityDb, o as resolvePageSortsOrThrow, or as deleteOldCommunityInWindows, p as stripRepliesFromPageComment, pn as signChallengeMessage, pr as importSignerIntoKuboNode, pt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, r as derivePublicPageSorts, rn as SignerWithPublicKeyAddress, rr as calculateExpectedSignatureSize, sn as decryptEd25519AesGcmPublicKeyBuffer, sr as deriveCommentIpfsFromCommentTableRow, t as RpcLocalCommunity, tr as BackupAbortError, tt as createSchemaRowParser, u as orderPageCommentsByScore, un as _validateSignatureOfPKCRecord, ur as getDefaultCommunityDbConfig, v as authorIdentityMatcherForRequest, w as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, wn as verifyChallengeAnswer, wr as n$5, x as TrackedInstanceRegistry, xn as signCommunity, xr as t$11, y as authorNameResolveFailureReason, yn as signCommentUpdate, zn as getAuthorNameFromWire } from "./rpc-local-community-DWv8wZMB.js";
2
+ import { $t as CommentModerationPubsubMessagePublicationSchema, A as isLinkOfAnimatedImage, An as CommentIpfsSchema, Ar as PKCError, At as ChallengeMessageSchema, Bn as CommentUpdateTableRowSchema, Dn as VoteTablesRowSchema, Dt as pTimeout, F as isLinkValid, Gr as ZodError, Jn as CommentEditPubsubMessagePublicationSchema, Jt as CommunityEditPublicationPubsubReservedFields, K as removeNullUndefinedValues, Kt as version_default, Lt as DecryptedChallengeRequestPublicationSchema, M as isLinkOfImage, Mr as logger_default, Mt as ChallengeRequestMessageSchema, N as isLinkOfMedia, Ot as ChallengeAnswerMessageSchema, P as isLinkOfVideo, Pt as ChallengeVerificationMessageSchema, Q as retryKuboIpfsAddAndProvide, Qn as CommentEditsTableRowSchema, R as pubsubTopicToDhtKey, Rn as CommentUpdateSchema, Rt as DecryptedChallengeRequestSchema, S as hideClassPrivateProps, Sr as t$2, St as untrackStartedCommunity, Tn as VotePubsubReservedFields, Tt as require_sha256, U as removeBlocksFromKuboNode, Vn as CommentsTableRowSchema, W as removeMfsFilesSafely, X as retryKuboBlockPutPinAndProvidePubsubTopic, Xn as CommentEditReservedFields, Yn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, _ as getEquivalentCommunityAddresses, _r as r$1, a as calculateUnixFsDagSizeCidV0, c as contentContainsMarkdownVideos, ct as writeKuboFilesWithTimeout, d as derivePublicationFromChallengeRequest, dn as CommunityIpfsSchema, dr as n$2, en as CommentModerationReservedFields, f as doesDomainAddressHaveCapitalLetter, fn as CommunitySignedPropertyNames, fr as t$5, ft as findUpdatingCommunity, g as genToArray, h as findMalformedUnicodeString, hr as e, i as calculateStringSizeSameAsIpfsAddCidV0, it as timestamp, j as isLinkOfAudio, jn as CommentPubsubMessageReservedFields, jr as messages, lr as n$3, lt as findCommunityInRegistry, mr as e$1, nn as CommentModerationsTableRowSchema, nr as AuthorReservedFields, nt as statMfsPathSafely, o as contentContainsMarkdownAudio, ot as withSortedKeys, pr as t$6, r as calculateIpfsCidV0, s as contentContainsMarkdownImages, st as withSortedKeysDeep, t as areEquivalentCommunityAddresses, tt as sleepUntilTimeoutOrAbort, ur as t$7, ut as findStartedCommunity, v as getErrorCodeFromMessage, vr as t$3, vt as syncCommunityRegistryEntry, w as ipnsNameToIpnsOverPubsubTopic, wn as VotePubsubMessagePublicationSchema, wr as require_retry, wt as untrackUpdatingCommunity, xn as isStringDomain, xr as t$4, xt as trackUpdatingCommunity, y as getIpnsRecordInLocalKuboNode, yt as trackStartedCommunity } from "./util-DFGl6QDd.js";
3
+ import { $ as coerceSchemaRowJson, $n as getPKCAddressFromPublicKeySync, An as verifyCommentModeration, Cr as t$8, D as TIMEFRAMES_TO_SECONDS, Dr as t$9, En as verifyChallengeRequest, Fn as verifyVote, Gn as getCommunityNameFromWire, Hn as effectiveMaxCrosspostDepth, In as buildRuntimeAuthor, Jn as decode, K as pLimit, Kn as getCommunityPublicKeyFromWire, Ln as cleanWireAuthor, Mn as verifyCommentUpdate, Nn as verifyCommunity, Nr as STORAGE_KEYS, On as verifyCommentEdit, Or as stringify, Ot as parseJsonWithPKCErrorIfFails, P as iterateOverPageCidsToFindAllCids, Pn as verifyCommunityEdit, Pr as require_lodash_merge, Q as coerceSchemaRowBoolean, Qn as getPKCAddressFromPublicKey, S as LRUCache, Sr as r$2, T as KeyvBetterSqlite3, Tr as n$4, Tt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Vn as crosspostChainDepthUpTo, Yn as encode, Zn as getIpfsKeyFromPrivateKey, _ as pkcJsChallenges, _n as signCommentEdit, _r as resolveDbPostsCidRefs, a as loadPageSortsForStartedCommunity, b as createAuthorIdentityMatcher, bn as signCommentUpdateForChallengeVerification, br as t$10, c as createDescendantsLookup, cr as deriveDbPosts, d as partitionPageCommentsForSort, dn as cleanUpBeforePublishing, er as getPublicKeyFromPrivateKey, et as collectSchemaRowCoercions, f as scorePageCommentsWithFile, fr as getThumbnailPropsOfLink, g as loadChallengeFileFromCommunityChallengeSettings, gn as signComment, gr as moveCommunityDbToDeletedDirectory, h as getCommunityChallengeFromCommunityChallengeSettings, hn as signChallengeVerification, ht as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, i as generatePagesReportingFailedSorts, ir as calculateInlineRepliesBudget, jn as verifyCommentPubsubMessage, kn as verifyCommentIpfs, l as filterRepliesForPageSort, ln as encryptEd25519AesGcmPublicKeyBuffer, lr as deriveDbReplies, m as getChallengeVerification, nr as backupCommunityDb, o as resolvePageSortsOrThrow, or as deleteOldCommunityInWindows, p as stripRepliesFromPageComment, pn as signChallengeMessage, pr as importSignerIntoKuboNode, pt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, r as derivePublicPageSorts, rn as SignerWithPublicKeyAddress, rr as calculateExpectedSignatureSize, sn as decryptEd25519AesGcmPublicKeyBuffer, sr as deriveCommentIpfsFromCommentTableRow, t as RpcLocalCommunity, tr as BackupAbortError, tt as createSchemaRowParser, u as orderPageCommentsByScore, un as _validateSignatureOfPKCRecord, ur as getDefaultCommunityDbConfig, v as authorIdentityMatcherForRequest, w as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, wn as verifyChallengeAnswer, wr as n$5, x as TrackedInstanceRegistry, xn as signCommunity, xr as t$11, y as authorNameResolveFailureReason, yn as signCommentUpdate, zn as getAuthorNameFromWire } from "./rpc-local-community-C_0FRCqg.js";
4
4
  import { randomFillSync, randomUUID } from "node:crypto";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
6
- import Path from "node:path";
6
+ import path from "node:path";
7
7
  import os from "os";
8
8
  import { existsSync, promises } from "node:fs";
9
- import path from "path";
9
+ import path$1 from "path";
10
10
  import assert from "assert";
11
11
  import { Buffer as Buffer$1 } from "buffer";
12
12
  import fs from "fs";
@@ -1690,15 +1690,15 @@ async function throwIfChallengeSettingsAreInvalid({ challengeSettings, pkc, comm
1690
1690
  const processStartedCommunities = new TrackedInstanceRegistry();
1691
1691
  function normalizeRegistryDataPath(dataPath) {
1692
1692
  if (dataPath === void 0) return void 0;
1693
- const resolved = path.resolve(dataPath);
1693
+ const resolved = path$1.resolve(dataPath);
1694
1694
  let existing = resolved;
1695
1695
  let tail = "";
1696
1696
  while (true) try {
1697
- return path.join(fs.realpathSync.native(existing), tail);
1697
+ return path$1.join(fs.realpathSync.native(existing), tail);
1698
1698
  } catch {
1699
- const parent = path.dirname(existing);
1699
+ const parent = path$1.dirname(existing);
1700
1700
  if (parent === existing) return resolved;
1701
- tail = path.join(path.basename(existing), tail);
1701
+ tail = path$1.join(path$1.basename(existing), tail);
1702
1702
  existing = parent;
1703
1703
  }
1704
1704
  }
@@ -2027,20 +2027,13 @@ var PageGenerator = class {
2027
2027
  });
2028
2028
  }
2029
2029
  _createRepliesLoader(load) {
2030
- let all;
2031
- const filtered = /* @__PURE__ */ new Map();
2032
- return (sort) => {
2033
- all ??= load();
2034
- const key = JSON.stringify(sort.exclusions);
2035
- if (!filtered.has(key)) filtered.set(key, applyPageSortExclusions({
2036
- comments: all,
2037
- exclusions: sort.exclusions,
2038
- communityAddress: this._community.address
2039
- }));
2040
- return filtered.get(key);
2041
- };
2030
+ let replies;
2031
+ return () => replies ??= filterRepliesForPageSort({
2032
+ replies: load(),
2033
+ communityAddress: this._community.address
2034
+ });
2042
2035
  }
2043
- _createStreamingRepliesProvider(sort) {
2036
+ _createStreamingRepliesProvider() {
2044
2037
  const db = this._community._dbHandler;
2045
2038
  const communityAddress = this._community.address;
2046
2039
  return (ordered) => {
@@ -2054,9 +2047,8 @@ var PageGenerator = class {
2054
2047
  if (index < batchStart || index >= batchEnd || !descendantsOf) {
2055
2048
  batchStart = index;
2056
2049
  batchEnd = Math.min(index + SERIALIZE_BATCH, ordered.length);
2057
- descendantsOf = createDescendantsLookup(applyPageSortExclusions({
2058
- comments: db.queryAllRepliesForPageSort({ postCids: ordered.slice(batchStart, batchEnd).map((entry) => entry.commentUpdate.cid) }),
2059
- exclusions: sort.exclusions,
2050
+ descendantsOf = createDescendantsLookup(filterRepliesForPageSort({
2051
+ replies: db.queryAllRepliesForPageSort({ postCids: ordered.slice(batchStart, batchEnd).map((entry) => entry.commentUpdate.cid) }),
2060
2052
  communityAddress
2061
2053
  }));
2062
2054
  }
@@ -2235,7 +2227,7 @@ var PageGenerator = class {
2235
2227
  scope: "posts",
2236
2228
  sorts,
2237
2229
  loadComments,
2238
- streamReplies: (sort) => this._createStreamingRepliesProvider(sort),
2230
+ streamReplies: () => this._createStreamingRepliesProvider(),
2239
2231
  source: this._dbPageEntrySource(),
2240
2232
  entryCache: this._postEntryCache,
2241
2233
  preloadedPageSizeBytes,
@@ -3063,9 +3055,9 @@ var DbHandler = class {
3063
3055
  if (needToMigrate) {
3064
3056
  if (dbExistsAlready && currentDbVersion > 0) {
3065
3057
  this.destoryConnection();
3066
- backupDbPath = path.join(path.dirname(dbPath), ".backup_before_migration", `${path.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
3067
- log(`Copying db ${path.basename(dbPath)} to ${backupDbPath} before migration`);
3068
- if (!fs.existsSync(path.dirname(backupDbPath))) await fs.promises.mkdir(path.dirname(backupDbPath), { recursive: true });
3058
+ backupDbPath = path$1.join(path$1.dirname(dbPath), ".backup_before_migration", `${path$1.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
3059
+ log(`Copying db ${path$1.basename(dbPath)} to ${backupDbPath} before migration`);
3060
+ if (!fs.existsSync(path$1.dirname(backupDbPath))) await fs.promises.mkdir(path$1.dirname(backupDbPath), { recursive: true });
3069
3061
  const sourceDb = new Database(dbPath, { fileMustExist: true });
3070
3062
  await sourceDb.backup(backupDbPath);
3071
3063
  sourceDb.close();
@@ -5176,10 +5168,10 @@ var DbHandler = class {
5176
5168
  if (this._db || this._keyv) await this.destoryConnection();
5177
5169
  this._transactionDepth = 0;
5178
5170
  const dataPath = this._community._pkc.dataPath;
5179
- const oldPathString = path.join(dataPath, "communities", oldDbName);
5180
- const newPathString = path.join(dataPath, "communities", newDbName);
5181
- await fs.promises.mkdir(path.dirname(oldPathString), { recursive: true });
5182
- await fs.promises.mkdir(path.dirname(newPathString), { recursive: true });
5171
+ const oldPathString = path$1.join(dataPath, "communities", oldDbName);
5172
+ const newPathString = path$1.join(dataPath, "communities", newDbName);
5173
+ await fs.promises.mkdir(path$1.dirname(oldPathString), { recursive: true });
5174
+ await fs.promises.mkdir(path$1.dirname(newPathString), { recursive: true });
5183
5175
  try {
5184
5176
  if (!fs.existsSync(oldPathString)) log(`Old DB file ${oldPathString} does not exist. Cannot backup/rename.`);
5185
5177
  else {
@@ -5201,8 +5193,8 @@ var DbHandler = class {
5201
5193
  }
5202
5194
  async lockCommunityStart(communityAddress = this._community.address) {
5203
5195
  const log = logger_default("pkc-js:local-community:db-handler:lock:start");
5204
- const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5205
- const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
5196
+ const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5197
+ const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
5206
5198
  try {
5207
5199
  await import_src.default.lock(communityDbPath, {
5208
5200
  lockfilePath,
@@ -5223,8 +5215,8 @@ var DbHandler = class {
5223
5215
  async unlockCommunityStart(communityAddress = this._community.address) {
5224
5216
  const log = logger_default("pkc-js:local-community:db-handler:unlock:start");
5225
5217
  log.trace(`Attempting to unlock the start of community (${communityAddress})`);
5226
- const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5227
- const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
5218
+ const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5219
+ const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
5228
5220
  if (!fs.existsSync(lockfilePath) || !fs.existsSync(communityDbPath)) return;
5229
5221
  try {
5230
5222
  await import_src.default.unlock(communityDbPath, { lockfilePath });
@@ -5235,8 +5227,8 @@ var DbHandler = class {
5235
5227
  }
5236
5228
  }
5237
5229
  async isCommunityStartLocked(communityAddress = this._community.address) {
5238
- const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5239
- const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
5230
+ const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
5231
+ const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
5240
5232
  return await import_src.default.check(communityDbPath, {
5241
5233
  lockfilePath,
5242
5234
  realpath: false,
@@ -5245,8 +5237,8 @@ var DbHandler = class {
5245
5237
  }
5246
5238
  async lockCommunityState() {
5247
5239
  const log = logger_default("pkc-js:local-community:db-handler:lock:lockCommunityState");
5248
- const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
5249
- const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
5240
+ const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
5241
+ const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
5250
5242
  try {
5251
5243
  await import_src.default.lock(communityDbPath, {
5252
5244
  lockfilePath,
@@ -5263,8 +5255,8 @@ var DbHandler = class {
5263
5255
  }
5264
5256
  async unlockCommunityState() {
5265
5257
  const log = logger_default("pkc-js:local-community:db-handler:lock:unlockCommunityState");
5266
- const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
5267
- const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
5258
+ const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
5259
+ const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
5268
5260
  if (!fs.existsSync(lockfilePath)) return;
5269
5261
  try {
5270
5262
  await import_src.default.unlock(communityDbPath, { lockfilePath });
@@ -5274,7 +5266,7 @@ var DbHandler = class {
5274
5266
  }
5275
5267
  }
5276
5268
  communityDbExists() {
5277
- const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
5269
+ const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
5278
5270
  return fs.existsSync(communityDbPath);
5279
5271
  }
5280
5272
  markCommentsAsPublishedToPostUpdates(commentCids) {
@@ -8216,11 +8208,11 @@ async function edit(community, newCommunityOptions) {
8216
8208
  const EXPORTS_KEY = STORAGE_KEYS[STORAGE_KEYS.EXPORTS];
8217
8209
  function defaultExportPathFor(community, exportId) {
8218
8210
  if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
8219
- return Path.join(community._pkc.dataPath, "exports", `${exportId}.sqlite`);
8211
+ return path.join(community._pkc.dataPath, "exports", `${exportId}.sqlite`);
8220
8212
  }
8221
8213
  function sourceDbPathFor(community) {
8222
8214
  if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
8223
- return Path.join(community._pkc.dataPath, "communities", community.address);
8215
+ return path.join(community._pkc.dataPath, "communities", community.address);
8224
8216
  }
8225
8217
  async function persistExports(community) {
8226
8218
  if (!community._dbHandler) return;
@@ -8296,9 +8288,9 @@ async function runExportTask(community, exportId, opts) {
8296
8288
  async function exportCommunityEmbedded(community, options = {}) {
8297
8289
  if (options.signal?.aborted) throw options.signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
8298
8290
  const exportId = v4();
8299
- const destPath = options.exportPath ? Path.resolve(options.exportPath) : defaultExportPathFor(community, exportId);
8291
+ const destPath = options.exportPath ? path.resolve(options.exportPath) : defaultExportPathFor(community, exportId);
8300
8292
  const includePrivateKey = options.includePrivateKey === true;
8301
- if (Path.resolve(destPath) === Path.resolve(sourceDbPathFor(community))) throw new PKCError("ERR_EXPORT_PATH_TARGETS_LIVE_DB", {
8293
+ if (path.resolve(destPath) === path.resolve(sourceDbPathFor(community))) throw new PKCError("ERR_EXPORT_PATH_TARGETS_LIVE_DB", {
8302
8294
  communityAddress: community.address,
8303
8295
  exportPath: destPath
8304
8296
  });
@@ -1,7 +1,7 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $ as shortifyAddress, An as CommentIpfsSchema, Ar as PKCError, At as ChallengeMessageSchema, Ct as untrackUpdatingComment, Dt as pTimeout, E as isIpfsCid, Er as FailedToFetchCommentUpdateFromGatewaysError, Et as TimeoutError, Fn as CommentUpdateForChallengeVerificationSchema, Fr as setErrorMap, H as rejectWhenCommunityStopsOrAborts, J as replaceXWithY, Jr as stringifyPrimitive, Kr as joinValues, Kt as version_default, Mr as logger_default, Mt as ChallengeRequestMessageSchema, O as isIpns, Ot as ChallengeAnswerMessageSchema, Pt as ChallengeVerificationMessageSchema, Rn as CommentUpdateSchema, S as hideClassPrivateProps, T as isAbortError, Tr as FailedToFetchCommentIpfsFromGatewaysError, Tt as require_sha256, V as rejectWhenAbortSignalFires, Y as resolveWhenPredicateIsTrue, Z as retryKuboIpfsAdd, _r as r, at as waitForUpdateInCommunityInstanceWithErrorAndTimeout, b as getPostUpdateTimestampRange, bt as trackUpdatingComment, dn as CommunityIpfsSchema, dr as n$1, dt as findUpdatingComment, et as shortifyCid, f as doesDomainAddressHaveCapitalLetter, ft as findUpdatingCommunity, gt as refreshTrackedCommentAliases, hr as e$1, ht as listUpdatingCommunities, it as timestamp, jr as messages, l as createAbortError, lr as n$2, mr as e, mt as listUpdatingComments, on as CommunityAnchorSchema, pr as t$1, pt as listStartedCommunities, q as removeUndefinedValuesRecursively, qr as parsedType, rt as throwIfAbortSignalAborted, t as areEquivalentCommunityAddresses, tt as sleepUntilTimeoutOrAbort, u as deepMergeRuntimeFields, ut as findStartedCommunity, w as ipnsNameToIpnsOverPubsubTopic, wr as require_retry, wt as untrackUpdatingCommunity, xn as isStringDomain, yn as PubsubTopicSchema } from "./util-B9JenRyE.js";
3
- import { $n as getPKCAddressFromPublicKeySync, $t as RpcSubscriptionIdResultSchema, A as extractCommunityRuntimeFieldsFromParsedPages, An as verifyCommentModeration, Ar as NAME_RESOLVED_FALSE_TTL_MS, At as parseRpcCommentEventWithPKCErrorIfItFails, B as stripNameResolvedFromCrosspost, Bn as normalizeCreatePublicationAuthor, Bt as RpcCommunityIdentifierParamSchema, C as RemoteCommunity, Cn as signVote, Cr as t$3, Ct as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, Dn as verifyChallengeVerification, Dr as t$4, Dt as parseDecryptedChallengeWithPKCErrorIfItFails, E as RepliesPages, Er as t$2, Et as parseDecryptedChallengeVerification, F as parseRawPages, Fn as verifyVote, Fr as nativeFunctions$2, Ft as RpcAnchorPublishPreparationResultSchema, Gn as getCommunityNameFromWire, Gt as RpcExportCommunityParamSchema, H as GenericStateClient, Ht as RpcEditCommunityParamSchema, I as applyNameResolvedCacheToCrosspost, In as buildRuntimeAuthor, Ir as require_undici, It as RpcAuthorNameParamSchema, J as decodeRpcChallengeAnswerPubsubMsg, Jn as decode, Jt as RpcFetchCidResultSchema, Kn as getCommunityPublicKeyFromWire, Kt as RpcExportCommunityResultSchema, L as cloneCrosspostForRuntime, Ln as cleanWireAuthor, Lt as RpcCancelExportParamSchema, M as findCommentInPageInstanceRecursively, Mn as verifyCommentUpdate, Mr as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, Mt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, N as findCommentInParsedPages, On as verifyCommentEdit, Ot as parseJsonWithPKCErrorIfFails, Pn as verifyCommunityEdit, Pt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Qt as RpcResolveAuthorNameResultSchema, R as collectCrosspostAuthorsToResolve, Rn as getAuthorNameFromRuntime, Rt as RpcCidParamSchema, S as LRUCache, Sn as signCommunityEdit, St as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, T as KeyvBetterSqlite3, Tn as verifyChallengeMessage, Tt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, U as InflightFetchManager, Un as buildRuntimeCommunityFields, Ut as RpcExportCommunityModLogsParamSchema, V as PKCClientsManager, Vt as RpcCommunityPageParamSchema, W as InflightResourceTypes, Wn as getCommunityAddressFromRecord, Wt as RpcExportCommunityModLogsResultSchema, X as decodeRpcChallengeRequestPubsubMsg, Xn as getBufferedPKCAddressFromPublicKey, Xt as RpcPublishChallengeAnswersParamSchema, Y as decodeRpcChallengePubsubMsg, Yt as RpcPublishAnchorRecordParamSchema, Z as decodeRpcChallengeVerificationPubsubMsg, Zt as RpcPublishedAnchorRecordResultSchema, _ as pkcJsChallenges, _n as signCommentEdit, _t as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, an as createAnchorIpnsRecord$1, ar as createKuboRpcClient, at as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, br as t$5, cn as encryptEd25519AesGcm, ct as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, dn as cleanUpBeforePublishing, dr as getDefaultDataPath, dt as parseCommunityAddressWithPKCErrorIfItFails, en as RpcSuccessResultSchema, fn as signChallengeAnswer, gn as signComment, gt as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, hr as monitorCommunitiesDirectory, in as createSigner, j as findCommentInPageInstance, jn as verifyCommentPubsubMessage, jr as NAME_RESOLVED_TRUE_TTL_MS, jt as parseRpcCommentUpdateEventWithPKCErrorIfItFails, kn as verifyCommentIpfs, kr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, kt as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, lt as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, mn as signChallengeRequest, mr as listCommunitiesSync, mt as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, nn as require_lib$1, nt as parseCidStringSchemaWithPKCErrorIfItFails, on as decryptEd25519AesGcm, ot as parseCommentIpfsSchemaWithPKCErrorIfItFails, q as PKCTypedEmitter, qn as normalizeCommunityInputFromCommunity, qt as RpcFetchCidParamSchema, s as pkcJsPageSorts, t as RpcLocalCommunity, tn as RpcUnsubscribeParamSchema, ut as parseCommentUpdateSchemaWithPKCErrorIfItFails, vn as signCommentModeration, vr as setNativeFunctions$1, vt as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, wr as n$3, wt as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, x as TrackedInstanceRegistry, yr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, yt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, zt as RpcCommentRepliesPageParamSchema } from "./rpc-local-community-DWv8wZMB.js";
4
- import { s as getHeliaDebugContext } from "./util-CH8WrVZq.js";
2
+ import { $ as shortifyAddress, An as CommentIpfsSchema, Ar as PKCError, At as ChallengeMessageSchema, Ct as untrackUpdatingComment, Dt as pTimeout, E as isIpfsCid, Er as FailedToFetchCommentUpdateFromGatewaysError, Et as TimeoutError, Fn as CommentUpdateForChallengeVerificationSchema, Fr as setErrorMap, H as rejectWhenCommunityStopsOrAborts, J as replaceXWithY, Jr as stringifyPrimitive, Kr as joinValues, Kt as version_default, Mr as logger_default, Mt as ChallengeRequestMessageSchema, O as isIpns, Ot as ChallengeAnswerMessageSchema, Pt as ChallengeVerificationMessageSchema, Rn as CommentUpdateSchema, S as hideClassPrivateProps, T as isAbortError, Tr as FailedToFetchCommentIpfsFromGatewaysError, Tt as require_sha256, V as rejectWhenAbortSignalFires, Y as resolveWhenPredicateIsTrue, Z as retryKuboIpfsAdd, _r as r, at as waitForUpdateInCommunityInstanceWithErrorAndTimeout, b as getPostUpdateTimestampRange, bt as trackUpdatingComment, dn as CommunityIpfsSchema, dr as n$1, dt as findUpdatingComment, et as shortifyCid, f as doesDomainAddressHaveCapitalLetter, ft as findUpdatingCommunity, gt as refreshTrackedCommentAliases, hr as e$1, ht as listUpdatingCommunities, it as timestamp, jr as messages, l as createAbortError, lr as n$2, mr as e, mt as listUpdatingComments, on as CommunityAnchorSchema, pr as t$1, pt as listStartedCommunities, q as removeUndefinedValuesRecursively, qr as parsedType, rt as throwIfAbortSignalAborted, t as areEquivalentCommunityAddresses, tt as sleepUntilTimeoutOrAbort, u as deepMergeRuntimeFields, ut as findStartedCommunity, w as ipnsNameToIpnsOverPubsubTopic, wr as require_retry, wt as untrackUpdatingCommunity, xn as isStringDomain, yn as PubsubTopicSchema } from "./util-DFGl6QDd.js";
3
+ import { $n as getPKCAddressFromPublicKeySync, $t as RpcSubscriptionIdResultSchema, A as extractCommunityRuntimeFieldsFromParsedPages, An as verifyCommentModeration, Ar as NAME_RESOLVED_FALSE_TTL_MS, At as parseRpcCommentEventWithPKCErrorIfItFails, B as stripNameResolvedFromCrosspost, Bn as normalizeCreatePublicationAuthor, Bt as RpcCommunityIdentifierParamSchema, C as RemoteCommunity, Cn as signVote, Cr as t$3, Ct as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, Dn as verifyChallengeVerification, Dr as t$4, Dt as parseDecryptedChallengeWithPKCErrorIfItFails, E as RepliesPages, Er as t$2, Et as parseDecryptedChallengeVerification, F as parseRawPages, Fn as verifyVote, Fr as nativeFunctions$2, Ft as RpcAnchorPublishPreparationResultSchema, Gn as getCommunityNameFromWire, Gt as RpcExportCommunityParamSchema, H as GenericStateClient, Ht as RpcEditCommunityParamSchema, I as applyNameResolvedCacheToCrosspost, In as buildRuntimeAuthor, Ir as require_undici, It as RpcAuthorNameParamSchema, J as decodeRpcChallengeAnswerPubsubMsg, Jn as decode, Jt as RpcFetchCidResultSchema, Kn as getCommunityPublicKeyFromWire, Kt as RpcExportCommunityResultSchema, L as cloneCrosspostForRuntime, Ln as cleanWireAuthor, Lt as RpcCancelExportParamSchema, M as findCommentInPageInstanceRecursively, Mn as verifyCommentUpdate, Mr as NAME_RESOLVE_FAILED_RETRY_FLOOR_MS, Mt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, N as findCommentInParsedPages, On as verifyCommentEdit, Ot as parseJsonWithPKCErrorIfFails, Pn as verifyCommunityEdit, Pt as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Qt as RpcResolveAuthorNameResultSchema, R as collectCrosspostAuthorsToResolve, Rn as getAuthorNameFromRuntime, Rt as RpcCidParamSchema, S as LRUCache, Sn as signCommunityEdit, St as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, T as KeyvBetterSqlite3, Tn as verifyChallengeMessage, Tt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, U as InflightFetchManager, Un as buildRuntimeCommunityFields, Ut as RpcExportCommunityModLogsParamSchema, V as PKCClientsManager, Vt as RpcCommunityPageParamSchema, W as InflightResourceTypes, Wn as getCommunityAddressFromRecord, Wt as RpcExportCommunityModLogsResultSchema, X as decodeRpcChallengeRequestPubsubMsg, Xn as getBufferedPKCAddressFromPublicKey, Xt as RpcPublishChallengeAnswersParamSchema, Y as decodeRpcChallengePubsubMsg, Yt as RpcPublishAnchorRecordParamSchema, Z as decodeRpcChallengeVerificationPubsubMsg, Zt as RpcPublishedAnchorRecordResultSchema, _ as pkcJsChallenges, _n as signCommentEdit, _t as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, an as createAnchorIpnsRecord$1, ar as createKuboRpcClient, at as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, br as t$5, cn as encryptEd25519AesGcm, ct as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, dn as cleanUpBeforePublishing, dr as getDefaultDataPath, dt as parseCommunityAddressWithPKCErrorIfItFails, en as RpcSuccessResultSchema, fn as signChallengeAnswer, gn as signComment, gt as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, hr as monitorCommunitiesDirectory, in as createSigner, j as findCommentInPageInstance, jn as verifyCommentPubsubMessage, jr as NAME_RESOLVED_TRUE_TTL_MS, jt as parseRpcCommentUpdateEventWithPKCErrorIfItFails, kn as verifyCommentIpfs, kr as MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE, kt as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, lt as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, mn as signChallengeRequest, mr as listCommunitiesSync, mt as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, n as RpcRemoteCommunity, nn as require_lib$1, nt as parseCidStringSchemaWithPKCErrorIfItFails, on as decryptEd25519AesGcm, ot as parseCommentIpfsSchemaWithPKCErrorIfItFails, q as PKCTypedEmitter, qn as normalizeCommunityInputFromCommunity, qt as RpcFetchCidParamSchema, s as pkcJsPageSorts, t as RpcLocalCommunity, tn as RpcUnsubscribeParamSchema, ut as parseCommentUpdateSchemaWithPKCErrorIfItFails, vn as signCommentModeration, vr as setNativeFunctions$1, vt as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, wr as n$3, wt as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, x as TrackedInstanceRegistry, yr as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, yt as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, zt as RpcCommentRepliesPageParamSchema } from "./rpc-local-community-C_0FRCqg.js";
4
+ import { s as getHeliaDebugContext } from "./util-B2SuJZg-.js";
5
5
  import path from "path";
6
6
  import assert from "assert";
7
7
  import fs from "fs";
@@ -8254,7 +8254,7 @@ var PKC$1 = class extends PKCTypedEmitter {
8254
8254
  this.clients.libp2pJsClients = {};
8255
8255
  if (!this.libp2pJsClientsOptions) return;
8256
8256
  if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
8257
- const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-DoOp7t8V.js");
8257
+ const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-hSpmyI9D.js");
8258
8258
  for (const clientOptions of this.libp2pJsClientsOptions) {
8259
8259
  const heliaNode = await createLibp2pJsClientOrUseExistingOne({
8260
8260
  ...clientOptions,
@@ -8533,7 +8533,7 @@ var PKC$1 = class extends PKCTypedEmitter {
8533
8533
  const log = logger_default("pkc-js:pkc:createLocalCommunity");
8534
8534
  log.trace("Received community options to create a local community instance:", options);
8535
8535
  if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
8536
- const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-CFX753RE.js");
8536
+ const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-Dc_fNPrx.js");
8537
8537
  const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
8538
8538
  const community = new LocalCommunity(this);
8539
8539
  if (isLocalCommunity) {
@@ -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 shortifyAddress, $n as CreateCommentEditOptionsWithRefinementSchema, $t as CommentModerationPubsubMessagePublicationSchema, An as CommentIpfsSchema, Ar as PKCError, B as raceAgainstAbort, Br as literal, Bt as DecryptedChallengeVerificationSchema, C as interruptibleSleep, Cn as VoteChallengeRequestToEncryptSchema, Cr as e$4, D as isIpfsPath, Dr as FailedToFetchCommunityFromGatewaysError, Dt as pTimeout, E as isIpfsCid, En as VoteSignedPropertyNames, Er as FailedToFetchCommentUpdateFromGatewaysError, Ft as ChallengeVerificationMessageSignedPropertyNames, G as removeNullUndefinedEmptyObjectsValuesRecursively, Gn as PageIpfsSchema, Gt as PKCUserOptionsSchema, Hn as CreateCommentOptionsWithRefinementSchema, Hr as object, Ht as NameResolverSerializedSchema, I as isRequestPubsubPublicationOfPost, In as CommentUpdateForChallengeVerificationSignedPropertyNames, Ir as _enum, It as DecryptedChallengeAnswerSchema, Kn as isReservedObjectKey, L as isRequestPubsubPublicationOfReply, Ln as CommentUpdateReservedFields, Lr as array, Mn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Mr as logger_default, Nn as CommentSignedPropertyNames, Nr as require_supports_color, Nt as ChallengeRequestMessageSignedPropertyNames, O as isIpns, On as CommentChallengeRequestToEncryptSchema, Or as FailedToFetchGenericIpfsFromGatewaysError, Pn as CommentUpdateChallengeReservedFieldNames, Pr as require_ms$1, Qt as CommentModerationChallengeRequestToEncryptSchema, R as pubsubTopicToDhtKey, Rn as CommentUpdateSchema, Rr as boolean, S as hideClassPrivateProps, Sn as CreateVoteUserOptionsWithRefinementSchema, Sr as t$9, St as untrackStartedCommunity, T as isAbortError, Tr as FailedToFetchCommentIpfsFromGatewaysError, Tt as require_sha256$1, Un as GetPageParamSchema, Ur as record, Ut as PKCParsedOptionsSchema, Vr as number, Vt as NameResolveCacheOptionsSchema, Wn as ModQueuePageIpfsSchema, Wr as string, Wt as PKCUserOptionBaseSchema, Xt as CommunityEditPubsubMessagePublicationSchema, Yn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Yt as CommunityEditPublicationSignedPropertyNames, Zn as CommentEditSignedPropertyNames, Zt as CreateCommunityEditPublicationOptionsWithRefinementSchema, _ as getEquivalentCommunityAddresses, _n as PageSortFileFactorySchema, _r as r$8, _t as refreshTrackedCommunityAliases, an as ChallengeFileSchema, ar as CidStringSchema, bn as RpcRemoteCommunityUpdateEventResultSchema, br as r$7, cn as CommunityEditOptionsSchema, cr as CreateSignerSchema, d as derivePublicationFromChallengeRequest, dn as CommunityIpfsSchema, dr as n$10, er as AuthorAddressSchema, et as shortifyCid, f as doesDomainAddressHaveCapitalLetter, fn as CommunitySignedPropertyNames, ft as findUpdatingCommunity, gn as ExportCommunityModLogsOptionsSchema, gr as t$11, hn as CreateRpcCommunityFunctionArgumentSchema, hr as e$5, in as ChallengeFileFactorySchema, ir as CidPathSchema, it as timestamp, jr as messages, jt as ChallengeMessageSignedPropertyNames, k as isIpnsPath, kn as CommentIpfsReservedFields, kr as FailedToFetchPageIpfsFromGatewaysError, kt as ChallengeAnswerMessageSignedPropertyNames, l as createAbortError, ln as CommunityExportRecordsSchema, lr as n$9, m as fetchAndValidateIpnsRecordFromGateway, mn as CreateRemoteCommunityFunctionArgumentSchema, mr as e$6, nn as CommentModerationsTableRowSchema, or as CommunityAddressSchema, p as extractNetworkErrorDetails, pn as CreateNewLocalCommunityUserOptionsSchema, pr as t$13, qn as CommentEditChallengeRequestToEncryptSchema, qt as CommunityEditPublicationChallengeRequestToEncryptSchema, r as calculateIpfsCidV0, rn as CreateCommentModerationOptionsWithRefinementSchema, rr as ChallengeAnswersSchema, rt as throwIfAbortSignalAborted, sn as CommunityChallengeSettingSchema, sr as CommunityAuthorChallengeReservedFieldNames, t as areEquivalentCommunityAddresses, tn as CommentModerationSignedPropertyNames, tr as AuthorCommentIpfsReservedFields, tt as sleepUntilTimeoutOrAbort, u as deepMergeRuntimeFields, un as CommunityIpfsReservedFields, ut as findStartedCommunity, vn as PageSortFileSchema, vr as t$12, w as ipnsNameToIpnsOverPubsubTopic, wn as VotePubsubMessagePublicationSchema, wr as require_retry$1, wt as untrackUpdatingCommunity, x as hasTransientNetworkErrorCode, xn as isStringDomain, xr as t$10, xt as trackUpdatingCommunity, yr as n$8, yt as trackStartedCommunity, zn as CommentUpdateSignedPropertyNames, zr as custom, zt as DecryptedChallengeSchema } from "./util-B9JenRyE.js";
2
+ import { $ as shortifyAddress, $n as CreateCommentEditOptionsWithRefinementSchema, $t as CommentModerationPubsubMessagePublicationSchema, An as CommentIpfsSchema, Ar as PKCError, B as raceAgainstAbort, Br as literal, Bt as DecryptedChallengeVerificationSchema, C as interruptibleSleep, Cn as VoteChallengeRequestToEncryptSchema, Cr as e$4, D as isIpfsPath, Dr as FailedToFetchCommunityFromGatewaysError, Dt as pTimeout, E as isIpfsCid, En as VoteSignedPropertyNames, Er as FailedToFetchCommentUpdateFromGatewaysError, Ft as ChallengeVerificationMessageSignedPropertyNames, G as removeNullUndefinedEmptyObjectsValuesRecursively, Gn as PageIpfsSchema, Gt as PKCUserOptionsSchema, Hn as CreateCommentOptionsWithRefinementSchema, Hr as object, Ht as NameResolverSerializedSchema, I as isRequestPubsubPublicationOfPost, In as CommentUpdateForChallengeVerificationSignedPropertyNames, Ir as _enum, It as DecryptedChallengeAnswerSchema, Kn as isReservedObjectKey, L as isRequestPubsubPublicationOfReply, Ln as CommentUpdateReservedFields, Lr as array, Mn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Mr as logger_default, Nn as CommentSignedPropertyNames, Nr as require_supports_color, Nt as ChallengeRequestMessageSignedPropertyNames, O as isIpns, On as CommentChallengeRequestToEncryptSchema, Or as FailedToFetchGenericIpfsFromGatewaysError, Pn as CommentUpdateChallengeReservedFieldNames, Pr as require_ms$1, Qt as CommentModerationChallengeRequestToEncryptSchema, R as pubsubTopicToDhtKey, Rn as CommentUpdateSchema, Rr as boolean, S as hideClassPrivateProps, Sn as CreateVoteUserOptionsWithRefinementSchema, Sr as t$9, St as untrackStartedCommunity, T as isAbortError, Tr as FailedToFetchCommentIpfsFromGatewaysError, Tt as require_sha256$1, Un as GetPageParamSchema, Ur as record, Ut as PKCParsedOptionsSchema, Vr as number, Vt as NameResolveCacheOptionsSchema, Wn as ModQueuePageIpfsSchema, Wr as string, Wt as PKCUserOptionBaseSchema, Xt as CommunityEditPubsubMessagePublicationSchema, Yn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Yt as CommunityEditPublicationSignedPropertyNames, Zn as CommentEditSignedPropertyNames, Zt as CreateCommunityEditPublicationOptionsWithRefinementSchema, _ as getEquivalentCommunityAddresses, _n as PageSortFileFactorySchema, _r as r$8, _t as refreshTrackedCommunityAliases, an as ChallengeFileSchema, ar as CidStringSchema, bn as RpcRemoteCommunityUpdateEventResultSchema, br as r$7, cn as CommunityEditOptionsSchema, cr as CreateSignerSchema, d as derivePublicationFromChallengeRequest, dn as CommunityIpfsSchema, dr as n$10, er as AuthorAddressSchema, et as shortifyCid, f as doesDomainAddressHaveCapitalLetter, fn as CommunitySignedPropertyNames, ft as findUpdatingCommunity, gn as ExportCommunityModLogsOptionsSchema, gr as t$11, hn as CreateRpcCommunityFunctionArgumentSchema, hr as e$5, in as ChallengeFileFactorySchema, ir as CidPathSchema, it as timestamp, jr as messages, jt as ChallengeMessageSignedPropertyNames, k as isIpnsPath, kn as CommentIpfsReservedFields, kr as FailedToFetchPageIpfsFromGatewaysError, kt as ChallengeAnswerMessageSignedPropertyNames, l as createAbortError, ln as CommunityExportRecordsSchema, lr as n$9, m as fetchAndValidateIpnsRecordFromGateway, mn as CreateRemoteCommunityFunctionArgumentSchema, mr as e$6, nn as CommentModerationsTableRowSchema, or as CommunityAddressSchema, p as extractNetworkErrorDetails, pn as CreateNewLocalCommunityUserOptionsSchema, pr as t$13, qn as CommentEditChallengeRequestToEncryptSchema, qt as CommunityEditPublicationChallengeRequestToEncryptSchema, r as calculateIpfsCidV0, rn as CreateCommentModerationOptionsWithRefinementSchema, rr as ChallengeAnswersSchema, rt as throwIfAbortSignalAborted, sn as CommunityChallengeSettingSchema, sr as CommunityAuthorChallengeReservedFieldNames, t as areEquivalentCommunityAddresses, tn as CommentModerationSignedPropertyNames, tr as AuthorCommentIpfsReservedFields, tt as sleepUntilTimeoutOrAbort, u as deepMergeRuntimeFields, un as CommunityIpfsReservedFields, ut as findStartedCommunity, vn as PageSortFileSchema, vr as t$12, w as ipnsNameToIpnsOverPubsubTopic, wn as VotePubsubMessagePublicationSchema, wr as require_retry$1, wt as untrackUpdatingCommunity, x as hasTransientNetworkErrorCode, xn as isStringDomain, xr as t$10, xt as trackUpdatingCommunity, yr as n$8, yt as trackStartedCommunity, zn as CommentUpdateSignedPropertyNames, zr as custom, zt as DecryptedChallengeSchema } from "./util-DFGl6QDd.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";
@@ -128863,6 +128863,19 @@ function applyPageSortExclusions({ comments, exclusions, communityAddress }) {
128863
128863
  return true;
128864
128864
  });
128865
128865
  }
128866
+ function filterRepliesForPageSort({ replies, communityAddress }) {
128867
+ return applyPageSortExclusions({
128868
+ comments: replies,
128869
+ exclusions: {
128870
+ excludeRemovedComments: false,
128871
+ excludeDeletedComments: false,
128872
+ excludeCommentWithApprovedFalse: false,
128873
+ excludeCommentPendingApproval: false,
128874
+ excludeCommentsWithDifferentCommunityAddress: true
128875
+ },
128876
+ communityAddress
128877
+ });
128878
+ }
128866
128879
  function partitionPageCommentsForSort({ comments, reserved, baseTimestamp }) {
128867
128880
  const pinned = reserved.pinnedFirst ? comments.filter((entry) => entry.commentUpdate.pinned === true) : [];
128868
128881
  let unpinned = reserved.pinnedFirst ? comments.filter((entry) => entry.commentUpdate.pinned !== true) : comments;
@@ -130079,4 +130092,4 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
130079
130092
  }
130080
130093
  };
130081
130094
  //#endregion
130082
- export { coerceSchemaRowJson as $, getPKCAddressFromPublicKeySync as $n, RpcSubscriptionIdResultSchema as $t, extractCommunityRuntimeFieldsFromParsedPages as A, verifyCommentModeration as An, NAME_RESOLVED_FALSE_TTL_MS as Ar, parseRpcCommentEventWithPKCErrorIfItFails as At, stripNameResolvedFromCrosspost as B, normalizeCreatePublicationAuthor as Bn, RpcCommunityIdentifierParamSchema as Bt, RemoteCommunity as C, signVote as Cn, t$5 as Cr, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as Ct, TIMEFRAMES_TO_SECONDS as D, verifyChallengeVerification as Dn, t$8 as Dr, parseDecryptedChallengeWithPKCErrorIfItFails as Dt, RepliesPages as E, verifyChallengeRequest as En, t$7 as Er, parseDecryptedChallengeVerification as Et, parseRawPages as F, verifyVote as Fn, nativeFunctions$1 as Fr, RpcAnchorPublishPreparationResultSchema as Ft, pRetry as G, getCommunityNameFromWire$1 as Gn, RpcExportCommunityParamSchema as Gt, GenericStateClient as H, effectiveMaxCrosspostDepth as Hn, RpcEditCommunityParamSchema as Ht, applyNameResolvedCacheToCrosspost as I, buildRuntimeAuthor as In, require_undici as Ir, RpcAuthorNameParamSchema as It, decodeRpcChallengeAnswerPubsubMsg as J, decode as Jn, RpcFetchCidResultSchema as Jt, pLimit as K, getCommunityPublicKeyFromWire as Kn, RpcExportCommunityResultSchema as Kt, cloneCrosspostForRuntime as L, cleanWireAuthor as Ln, RpcCancelExportParamSchema as Lt, findCommentInPageInstanceRecursively as M, verifyCommentUpdate as Mn, NAME_RESOLVE_FAILED_RETRY_FLOOR_MS as Mr, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as Mt, findCommentInParsedPages as N, verifyCommunity as Nn, STORAGE_KEYS as Nr, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Nt, buildPageRuntimeFields as O, verifyCommentEdit as On, stringify as Or, parseJsonWithPKCErrorIfFails as Ot, iterateOverPageCidsToFindAllCids as P, verifyCommunityEdit as Pn, require_lodash_merge as Pr, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Pt, coerceSchemaRowBoolean as Q, getPKCAddressFromPublicKey as Qn, RpcResolveAuthorNameResultSchema as Qt, collectCrosspostAuthorsToResolve as R, getAuthorNameFromRuntime as Rn, RpcCidParamSchema as Rt, LRUCache as S, signCommunityEdit as Sn, r as Sr, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as St, KeyvBetterSqlite3 as T, verifyChallengeMessage as Tn, n$6 as Tr, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as Tt, InflightFetchManager as U, buildRuntimeCommunityFields as Un, RpcExportCommunityModLogsParamSchema as Ut, PKCClientsManager as V, crosspostChainDepthUpTo as Vn, RpcCommunityPageParamSchema as Vt, InflightResourceTypes as W, getCommunityAddressFromRecord as Wn, RpcExportCommunityModLogsResultSchema as Wt, decodeRpcChallengeRequestPubsubMsg as X, getBufferedPKCAddressFromPublicKey as Xn, RpcPublishChallengeAnswersParamSchema as Xt, decodeRpcChallengePubsubMsg as Y, encode as Yn, RpcPublishAnchorRecordParamSchema as Yt, decodeRpcChallengeVerificationPubsubMsg as Z, getIpfsKeyFromPrivateKey as Zn, RpcPublishedAnchorRecordResultSchema as Zt, pkcJsChallenges as _, signCommentEdit as _n, resolveDbPostsCidRefs as _r, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as _t, loadPageSortsForStartedCommunity as a, createAnchorIpnsRecord as an, createKuboRpcClient as ar, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as at, createAuthorIdentityMatcher as b, signCommentUpdateForChallengeVerification as bn, t$2 as br, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as bt, applyPageSortExclusions as c, encryptEd25519AesGcm as cn, deriveDbPosts as cr, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as ct, partitionPageCommentsForSort as d, cleanUpBeforePublishing as dn, getDefaultDataPath as dr, parseCommunityAddressWithPKCErrorIfItFails as dt, RpcSuccessResultSchema as en, getPublicKeyFromPrivateKey as er, collectSchemaRowCoercions as et, scorePageCommentsWithFile as f, signChallengeAnswer as fn, getThumbnailPropsOfLink as fr, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as ft, loadChallengeFileFromCommunityChallengeSettings as g, signComment as gn, moveCommunityDbToDeletedDirectory as gr, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as gt, getCommunityChallengeFromCommunityChallengeSettings as h, signChallengeVerification as hn, monitorCommunitiesDirectory as hr, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as ht, generatePagesReportingFailedSorts as i, createSigner as in, calculateInlineRepliesBudget as ir, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as it, findCommentInPageInstance as j, verifyCommentPubsubMessage as jn, NAME_RESOLVED_TRUE_TTL_MS as jr, parseRpcCommentUpdateEventWithPKCErrorIfItFails as jt, buildPagesRuntimeFields as k, verifyCommentIpfs as kn, MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE as kr, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as kt, createDescendantsLookup as l, encryptEd25519AesGcmPublicKeyBuffer as ln, deriveDbReplies as lr, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as lt, getChallengeVerification as m, signChallengeRequest as mn, listCommunitiesSync as mr, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as mt, RpcRemoteCommunity as n, require_lib as nn, backupCommunityDb as nr, parseCidStringSchemaWithPKCErrorIfItFails as nt, resolvePageSortsOrThrow as o, decryptEd25519AesGcm as on, deleteOldCommunityInWindows as or, parseCommentIpfsSchemaWithPKCErrorIfItFails as ot, stripRepliesFromPageComment as p, signChallengeMessage as pn, importSignerIntoKuboNode as pr, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as pt, PKCTypedEmitter as q, normalizeCommunityInputFromCommunity as qn, RpcFetchCidParamSchema as qt, derivePublicPageSorts as r, SignerWithPublicKeyAddress as rn, calculateExpectedSignatureSize as rr, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as rt, pkcJsPageSorts as s, decryptEd25519AesGcmPublicKeyBuffer as sn, deriveCommentIpfsFromCommentTableRow as sr, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as st, RpcLocalCommunity as t, RpcUnsubscribeParamSchema as tn, BackupAbortError as tr, createSchemaRowParser as tt, orderPageCommentsByScore as u, _validateSignatureOfPKCRecord as un, getDefaultCommunityDbConfig as ur, parseCommentUpdateSchemaWithPKCErrorIfItFails as ut, authorIdentityMatcherForRequest as v, signCommentModeration as vn, setNativeFunctions as vr, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as vt, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as w, verifyChallengeAnswer as wn, n$5 as wr, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as wt, TrackedInstanceRegistry as x, signCommunity as xn, t$4 as xr, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as xt, authorNameResolveFailureReason as y, signCommentUpdate as yn, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as yr, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as yt, extractCrosspostRuntimeFields as z, getAuthorNameFromWire as zn, RpcCommentRepliesPageParamSchema as zt };
130095
+ export { coerceSchemaRowJson as $, getPKCAddressFromPublicKeySync as $n, RpcSubscriptionIdResultSchema as $t, extractCommunityRuntimeFieldsFromParsedPages as A, verifyCommentModeration as An, NAME_RESOLVED_FALSE_TTL_MS as Ar, parseRpcCommentEventWithPKCErrorIfItFails as At, stripNameResolvedFromCrosspost as B, normalizeCreatePublicationAuthor as Bn, RpcCommunityIdentifierParamSchema as Bt, RemoteCommunity as C, signVote as Cn, t$5 as Cr, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as Ct, TIMEFRAMES_TO_SECONDS as D, verifyChallengeVerification as Dn, t$8 as Dr, parseDecryptedChallengeWithPKCErrorIfItFails as Dt, RepliesPages as E, verifyChallengeRequest as En, t$7 as Er, parseDecryptedChallengeVerification as Et, parseRawPages as F, verifyVote as Fn, nativeFunctions$1 as Fr, RpcAnchorPublishPreparationResultSchema as Ft, pRetry as G, getCommunityNameFromWire$1 as Gn, RpcExportCommunityParamSchema as Gt, GenericStateClient as H, effectiveMaxCrosspostDepth as Hn, RpcEditCommunityParamSchema as Ht, applyNameResolvedCacheToCrosspost as I, buildRuntimeAuthor as In, require_undici as Ir, RpcAuthorNameParamSchema as It, decodeRpcChallengeAnswerPubsubMsg as J, decode as Jn, RpcFetchCidResultSchema as Jt, pLimit as K, getCommunityPublicKeyFromWire as Kn, RpcExportCommunityResultSchema as Kt, cloneCrosspostForRuntime as L, cleanWireAuthor as Ln, RpcCancelExportParamSchema as Lt, findCommentInPageInstanceRecursively as M, verifyCommentUpdate as Mn, NAME_RESOLVE_FAILED_RETRY_FLOOR_MS as Mr, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as Mt, findCommentInParsedPages as N, verifyCommunity as Nn, STORAGE_KEYS as Nr, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Nt, buildPageRuntimeFields as O, verifyCommentEdit as On, stringify as Or, parseJsonWithPKCErrorIfFails as Ot, iterateOverPageCidsToFindAllCids as P, verifyCommunityEdit as Pn, require_lodash_merge as Pr, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Pt, coerceSchemaRowBoolean as Q, getPKCAddressFromPublicKey as Qn, RpcResolveAuthorNameResultSchema as Qt, collectCrosspostAuthorsToResolve as R, getAuthorNameFromRuntime as Rn, RpcCidParamSchema as Rt, LRUCache as S, signCommunityEdit as Sn, r as Sr, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as St, KeyvBetterSqlite3 as T, verifyChallengeMessage as Tn, n$6 as Tr, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as Tt, InflightFetchManager as U, buildRuntimeCommunityFields as Un, RpcExportCommunityModLogsParamSchema as Ut, PKCClientsManager as V, crosspostChainDepthUpTo as Vn, RpcCommunityPageParamSchema as Vt, InflightResourceTypes as W, getCommunityAddressFromRecord as Wn, RpcExportCommunityModLogsResultSchema as Wt, decodeRpcChallengeRequestPubsubMsg as X, getBufferedPKCAddressFromPublicKey as Xn, RpcPublishChallengeAnswersParamSchema as Xt, decodeRpcChallengePubsubMsg as Y, encode as Yn, RpcPublishAnchorRecordParamSchema as Yt, decodeRpcChallengeVerificationPubsubMsg as Z, getIpfsKeyFromPrivateKey as Zn, RpcPublishedAnchorRecordResultSchema as Zt, pkcJsChallenges as _, signCommentEdit as _n, resolveDbPostsCidRefs as _r, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as _t, loadPageSortsForStartedCommunity as a, createAnchorIpnsRecord as an, createKuboRpcClient as ar, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as at, createAuthorIdentityMatcher as b, signCommentUpdateForChallengeVerification as bn, t$2 as br, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as bt, createDescendantsLookup as c, encryptEd25519AesGcm as cn, deriveDbPosts as cr, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as ct, partitionPageCommentsForSort as d, cleanUpBeforePublishing as dn, getDefaultDataPath as dr, parseCommunityAddressWithPKCErrorIfItFails as dt, RpcSuccessResultSchema as en, getPublicKeyFromPrivateKey as er, collectSchemaRowCoercions as et, scorePageCommentsWithFile as f, signChallengeAnswer as fn, getThumbnailPropsOfLink as fr, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as ft, loadChallengeFileFromCommunityChallengeSettings as g, signComment as gn, moveCommunityDbToDeletedDirectory as gr, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as gt, getCommunityChallengeFromCommunityChallengeSettings as h, signChallengeVerification as hn, monitorCommunitiesDirectory as hr, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as ht, generatePagesReportingFailedSorts as i, createSigner as in, calculateInlineRepliesBudget as ir, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as it, findCommentInPageInstance as j, verifyCommentPubsubMessage as jn, NAME_RESOLVED_TRUE_TTL_MS as jr, parseRpcCommentUpdateEventWithPKCErrorIfItFails as jt, buildPagesRuntimeFields as k, verifyCommentIpfs as kn, MAX_FILE_SIZE_BYTES_FOR_COMMENT_UPDATE as kr, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as kt, filterRepliesForPageSort as l, encryptEd25519AesGcmPublicKeyBuffer as ln, deriveDbReplies as lr, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as lt, getChallengeVerification as m, signChallengeRequest as mn, listCommunitiesSync as mr, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as mt, RpcRemoteCommunity as n, require_lib as nn, backupCommunityDb as nr, parseCidStringSchemaWithPKCErrorIfItFails as nt, resolvePageSortsOrThrow as o, decryptEd25519AesGcm as on, deleteOldCommunityInWindows as or, parseCommentIpfsSchemaWithPKCErrorIfItFails as ot, stripRepliesFromPageComment as p, signChallengeMessage as pn, importSignerIntoKuboNode as pr, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as pt, PKCTypedEmitter as q, normalizeCommunityInputFromCommunity as qn, RpcFetchCidParamSchema as qt, derivePublicPageSorts as r, SignerWithPublicKeyAddress as rn, calculateExpectedSignatureSize as rr, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as rt, pkcJsPageSorts as s, decryptEd25519AesGcmPublicKeyBuffer as sn, deriveCommentIpfsFromCommentTableRow as sr, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as st, RpcLocalCommunity as t, RpcUnsubscribeParamSchema as tn, BackupAbortError as tr, createSchemaRowParser as tt, orderPageCommentsByScore as u, _validateSignatureOfPKCRecord as un, getDefaultCommunityDbConfig as ur, parseCommentUpdateSchemaWithPKCErrorIfItFails as ut, authorIdentityMatcherForRequest as v, signCommentModeration as vn, setNativeFunctions as vr, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as vt, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as w, verifyChallengeAnswer as wn, n$5 as wr, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as wt, TrackedInstanceRegistry as x, signCommunity as xn, t$4 as xr, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as xt, authorNameResolveFailureReason as y, signCommentUpdate as yn, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as yr, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as yt, extractCrosspostRuntimeFields as z, getAuthorNameFromWire as zn, RpcCommentRepliesPageParamSchema as zt };
@@ -1,4 +1,4 @@
1
- import { Ar as PKCError, z as pubsubTopicToDhtKeyCid } from "./util-B9JenRyE.js";
1
+ import { Ar as PKCError, z as pubsubTopicToDhtKeyCid } from "./util-DFGl6QDd.js";
2
2
  import { ipnsSelector } from "ipns/selector";
3
3
  import { ipnsValidator } from "ipns/validator";
4
4
  import { unmarshalIPNSRecord } from "ipns";
@@ -14796,7 +14796,7 @@ const CommunityEditPublicationPubsubReservedFields = r$2([
14796
14796
  ], t$3(CommunityEditPubsubMessagePublicationSchema.shape));
14797
14797
  //#endregion
14798
14798
  //#region dist/node/generated-version.js
14799
- const version = "0.0.113";
14799
+ const version = "0.0.114";
14800
14800
  //#endregion
14801
14801
  //#region dist/node/version.js
14802
14802
  const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
@@ -1,2 +1,2 @@
1
- import { a as getShortCid, c as setNativeFunctions, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as pageSorts, t as PKC } from "./chunks/node-gyqBss4j.js";
1
+ import { a as getShortCid, c as setNativeFunctions, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as pageSorts, t as PKC } from "./chunks/node-apYZl3B3.js";
2
2
  export { challenges, createAnchorIpnsRecord, PKC as default, getShortAddress, getShortCid, nativeFunctions, pageSorts, setNativeFunctions };
@@ -1,7 +1,7 @@
1
- import { Ar as PKCError, Dt as pTimeout, J as replaceXWithY, Mr as logger_default, S as hideClassPrivateProps, dr as n, pr as t, ut as findStartedCommunity } from "../../chunks/util-B9JenRyE.js";
2
- import { _ as parseRpcExportCommunityParam, b as parseRpcUnsubscribeParam, d as parseRpcCidParam, f as parseRpcCommentRepliesPageParam, g as parseRpcExportCommunityModLogsParam, h as parseRpcEditCommunityParam, l as parseRpcAuthorNameParam, m as parseRpcCommunityPageParam, p as parseRpcCommunityIdentifierParam, t as PKC, u as parseRpcCancelExportParam, v as parseRpcPublishAnchorRecordParam, y as parseRpcPublishChallengeAnswersParam } from "../../chunks/node-gyqBss4j.js";
3
- import { G as pRetry, K as pLimit, Mt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Nt as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, O as buildPageRuntimeFields, Or as stringify, Tt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, bt as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails, ft as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, it as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, k as buildPagesRuntimeFields, nn as require_lib, pt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, rt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, st as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, xr as t$1, xt as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, z as extractCrosspostRuntimeFields } from "../../chunks/rpc-local-community-DWv8wZMB.js";
4
- import { t as LocalCommunity } from "../../chunks/local-community-CaV30etW.js";
1
+ import { Ar as PKCError, Dt as pTimeout, J as replaceXWithY, Mr as logger_default, S as hideClassPrivateProps, dr as n, pr as t, ut as findStartedCommunity } from "../../chunks/util-DFGl6QDd.js";
2
+ import { _ as parseRpcExportCommunityParam, b as parseRpcUnsubscribeParam, d as parseRpcCidParam, f as parseRpcCommentRepliesPageParam, g as parseRpcExportCommunityModLogsParam, h as parseRpcEditCommunityParam, l as parseRpcAuthorNameParam, m as parseRpcCommunityPageParam, p as parseRpcCommunityIdentifierParam, t as PKC, u as parseRpcCancelExportParam, v as parseRpcPublishAnchorRecordParam, y as parseRpcPublishChallengeAnswersParam } from "../../chunks/node-apYZl3B3.js";
3
+ import { G as pRetry, K as pLimit, Mt as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Nt as parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, O as buildPageRuntimeFields, Or as stringify, Tt as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, bt as parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails, ft as parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, it as parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, k as buildPagesRuntimeFields, nn as require_lib, pt as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, rt as parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, st as parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails, xr as t$1, xt as parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails, z as extractCrosspostRuntimeFields } from "../../chunks/rpc-local-community-C_0FRCqg.js";
4
+ import { t as LocalCommunity } from "../../chunks/local-community-EeQMdfYM.js";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import path from "path";
7
7
  import assert from "assert";
@@ -1 +1 @@
1
- export declare const version = "0.0.113";
1
+ export declare const version = "0.0.114";
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by config/generate-version.js — do not edit
2
- export const version = "0.0.113";
2
+ export const version = "0.0.114";
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -8,6 +8,10 @@ export declare function applyPageSortExclusions<T extends PageSortReplyEntry>({
8
8
  exclusions: Record<PageSortExclusionOptionName, boolean>;
9
9
  communityAddress?: string;
10
10
  }): T[];
11
+ export declare function filterRepliesForPageSort<T extends PageSortReplyEntry>({ replies, communityAddress }: {
12
+ replies: T[];
13
+ communityAddress: string;
14
+ }): T[];
11
15
  export declare function partitionPageCommentsForSort({ comments, reserved, baseTimestamp }: {
12
16
  comments: PageComment[];
13
17
  reserved: Pick<ParsedReservedPageSortOptions, "pinnedFirst" | "maxAgeSeconds">;
@@ -13,8 +13,7 @@ export function validatePageSortFile(rawFile) {
13
13
  ...(raw.validatePageSortSettings ? { validatePageSortSettings: raw.validatePageSortSettings } : {})
14
14
  };
15
15
  }
16
- // The reserved exclusions applied to page entries in JS (the `replies` a requireReplies file receives). Mirrors the SQL clauses in DbHandler
17
- // (exclusionClauses): a comment is removed when commentUpdate.removed is true, deleted when its author's edit says so,
16
+ // The reserved exclusions applied to page entries in JS. Mirrors the SQL clauses in DbHandler (exclusionClauses): a comment is removed when commentUpdate.removed is true, deleted when its author's edit says so,
18
17
  // disapproved when commentUpdate.approved is false, pending when commentUpdate.pendingApproval is true.
19
18
  export function applyPageSortExclusions({ comments, exclusions, communityAddress }) {
20
19
  const equivalentAddresses = communityAddress ? new Set(getEquivalentCommunityAddresses(communityAddress)) : undefined;
@@ -36,6 +35,24 @@ export function applyPageSortExclusions({ comments, exclusions, communityAddress
36
35
  return true;
37
36
  });
38
37
  }
38
+ // The `replies` a requireReplies file receives: every reply in the scope except ones from another community address
39
+ // (issue #407). The sort's exclude* options are not applied, they reach the file in `options`: a removed or deleted
40
+ // reply is a tombstone whose present replies still count (docs/protocol/comment-lifecycle.md, "Which replies count"),
41
+ // so dropping it would cut its subtree, and the file decides what counts. Replies with no CommentUpdate never get
42
+ // here (the DB query joins on commentUpdates). Reply pages keep tombstones too, so a client walking them gets this set.
43
+ export function filterRepliesForPageSort({ replies, communityAddress }) {
44
+ return applyPageSortExclusions({
45
+ comments: replies,
46
+ exclusions: {
47
+ excludeRemovedComments: false,
48
+ excludeDeletedComments: false,
49
+ excludeCommentWithApprovedFalse: false,
50
+ excludeCommentPendingApproval: false,
51
+ excludeCommentsWithDifferentCommunityAddress: true
52
+ },
53
+ communityAddress
54
+ });
55
+ }
39
56
  // Pinned placement and the maxAge window, the two reserved options that shape every sort's set and order. Pinned
40
57
  // comments sort first and bypass the window when pinnedFirst is on (the default), so a sticky never ages out of a
41
58
  // windowed index; with pinnedFirst off they are ordinary comments. Shared with the community's page generator.
@@ -77,7 +94,7 @@ export function stripRepliesFromPageComment(entry) {
77
94
  // The `replies` a file with requireReplies gets per scored comment: its descendants, out of one flat list of every
78
95
  // descendant of the page's comments (the community loads the scope's descendants once; a client passes what it
79
96
  // walked). Indexed by parentCid, so a reply on a reply page gets its own subtree and a post gets everything under it;
80
- // a node whose parent was excluded is unreachable, the same cut the community's exclusions make.
97
+ // a node whose parent is not in the list is unreachable (only a foreign reply's subtree, see filterRepliesForPageSort).
81
98
  export function createDescendantsLookup(replies) {
82
99
  const childrenByParent = new Map();
83
100
  for (const entry of replies) {
@@ -1 +1 @@
1
- {"version":3,"file":"page-sort-scoring.js","sourceRoot":"","sources":["../../../src/pages/page-sort-scoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAW7D,iHAAiH;AACjH,mHAAmH;AACnH,i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C,aAAa,EAAE,qBAAqB,EAQvC;IACG,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,qBAAqB,IAAI,uBAAuB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxH,OAAO,CAAC,KAAK,EAAE,EAAE;QACb,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,KAAK,CAAC;YACd,OAAO;YACP,aAAa;YACb,OAAO;YACP,aAAa;YACb,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1E,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
@@ -3162,13 +3162,13 @@ export class DbHandler {
3162
3162
  activeScore: Math.max(post.comment.timestamp, post.commentUpdate.lastReplyTimestamp ?? 0)
3163
3163
  }));
3164
3164
  }
3165
- // Every reply (depth > 0) in the community, or under one post, with no exclusions applied: the one reply set a
3166
- // generation loads for its requireReplies sorts, each of which then filters it with its own exclusion options
3167
- // through applyPageSortExclusions (the same filter a client applies) and slices each comment's subtree from it
3168
- // (createDescendantsLookup). Lean on purpose (PageSortReplyEntry): a fixed column list mapped by hand, no
3165
+ // Every reply (depth > 0) with a CommentUpdate in the community, or under one post, with no exclusions applied:
3166
+ // the one reply set a generation loads for its requireReplies sorts. Only foreign replies are then dropped
3167
+ // (filterRepliesForPageSort); removed, deleted, pending and disapproved replies all reach the file, which applies
3168
+ // the sort's exclusions itself (issue #407). Each comment's subtree is sliced from it (createDescendantsLookup). Lean on purpose (PageSortReplyEntry): a fixed column list mapped by hand, no
3169
3169
  // signature, no nested pages, no schema row parser, since a board can hold a million replies and this runs per
3170
- // generation. A pending-approval reply is marked on its CommentUpdate the way the mod queue marks one, so the
3171
- // filter can see it; the list never reaches a page.
3170
+ // generation. A pending-approval reply is marked on its CommentUpdate the way the mod queue marks one, so a file
3171
+ // can see it; the list never reaches a page.
3172
3172
  queryAllRepliesForPageSort(opts = {}) {
3173
3173
  // A list of posts streams in batches under the SQLite variable cap: what a post sort with requireReplies
3174
3174
  // scores over, one batch of posts' subtrees at a time (issue #351)