@pkcprotocol/pkc-js 0.0.78 → 0.0.80

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 (72) hide show
  1. package/README.md +1 -1
  2. package/dist/browser/community/community-client-manager.d.ts +2 -0
  3. package/dist/browser/community/community-client-manager.js +164 -9
  4. package/dist/browser/community/community-client-manager.js.map +1 -1
  5. package/dist/browser/community/remote-community.d.ts +2 -1
  6. package/dist/browser/community/remote-community.js +30 -7
  7. package/dist/browser/community/remote-community.js.map +1 -1
  8. package/dist/browser/community/rpc-local-community.js.map +1 -1
  9. package/dist/browser/community/schema.d.ts +31 -4
  10. package/dist/browser/community/schema.js +16 -10
  11. package/dist/browser/community/schema.js.map +1 -1
  12. package/dist/browser/errors.d.ts +3 -0
  13. package/dist/browser/errors.js +3 -0
  14. package/dist/browser/errors.js.map +1 -1
  15. package/dist/browser/generated-version.d.ts +1 -1
  16. package/dist/browser/generated-version.js +1 -1
  17. package/dist/browser/helia/util.js +16 -8
  18. package/dist/browser/helia/util.js.map +1 -1
  19. package/dist/browser/pkc-error.d.ts +1 -1
  20. package/dist/browser/runtime/node/community/local-community/cleanup.d.ts +4 -0
  21. package/dist/browser/runtime/node/community/local-community/cleanup.js +50 -37
  22. package/dist/browser/runtime/node/community/local-community/cleanup.js.map +1 -1
  23. package/dist/browser/runtime/node/community/local-community/publication-validation.js +7 -1
  24. package/dist/browser/runtime/node/community/local-community/publication-validation.js.map +1 -1
  25. package/dist/browser/schema/schema-util.d.ts +15 -0
  26. package/dist/browser/signer/signatures.d.ts +1 -0
  27. package/dist/browser/signer/signatures.js +25 -2
  28. package/dist/browser/signer/signatures.js.map +1 -1
  29. package/dist/browser/test/test-util.d.ts +7 -0
  30. package/dist/browser/test/test-util.js +6 -0
  31. package/dist/browser/test/test-util.js.map +1 -1
  32. package/dist/bundled/bundle-manifest.json +31 -31
  33. package/dist/bundled/chunks/{helia-for-pkc-DPyYKV_m.js → helia-for-pkc-BsYWQ7qS.js} +31 -31
  34. package/dist/bundled/chunks/{local-community-KNlSpG2e.js → local-community-CHzhypCp.js} +48 -27
  35. package/dist/bundled/chunks/{local-community-DS4PU-HF.js → local-community-EqWKTLxr.js} +1 -1
  36. package/dist/bundled/chunks/{node-CcPI4aNc.js → node-4qAZNuJG.js} +5 -5
  37. package/dist/bundled/chunks/{rpc-local-community-DHhucg8-.js → rpc-local-community-Cog5rZLG.js} +107 -18
  38. package/dist/bundled/chunks/{schema-CH2yoI0b.js → schema-Iavj-cRD.js} +6 -2
  39. package/dist/bundled/chunks/{util-CiBeiLBn.js → util-CfSUfLkV.js} +3 -2
  40. package/dist/bundled/index.js +1 -1
  41. package/dist/bundled/rpc/src/index.js +4 -4
  42. package/dist/node/community/community-client-manager.d.ts +2 -0
  43. package/dist/node/community/community-client-manager.js +164 -9
  44. package/dist/node/community/community-client-manager.js.map +1 -1
  45. package/dist/node/community/remote-community.d.ts +2 -1
  46. package/dist/node/community/remote-community.js +30 -7
  47. package/dist/node/community/remote-community.js.map +1 -1
  48. package/dist/node/community/rpc-local-community.js.map +1 -1
  49. package/dist/node/community/schema.d.ts +31 -4
  50. package/dist/node/community/schema.js +16 -10
  51. package/dist/node/community/schema.js.map +1 -1
  52. package/dist/node/errors.d.ts +3 -0
  53. package/dist/node/errors.js +3 -0
  54. package/dist/node/errors.js.map +1 -1
  55. package/dist/node/generated-version.d.ts +1 -1
  56. package/dist/node/generated-version.js +1 -1
  57. package/dist/node/helia/util.js +16 -8
  58. package/dist/node/helia/util.js.map +1 -1
  59. package/dist/node/pkc-error.d.ts +1 -1
  60. package/dist/node/runtime/node/community/local-community/cleanup.d.ts +4 -0
  61. package/dist/node/runtime/node/community/local-community/cleanup.js +50 -37
  62. package/dist/node/runtime/node/community/local-community/cleanup.js.map +1 -1
  63. package/dist/node/runtime/node/community/local-community/publication-validation.js +7 -1
  64. package/dist/node/runtime/node/community/local-community/publication-validation.js.map +1 -1
  65. package/dist/node/schema/schema-util.d.ts +15 -0
  66. package/dist/node/signer/signatures.d.ts +1 -0
  67. package/dist/node/signer/signatures.js +25 -2
  68. package/dist/node/signer/signatures.js.map +1 -1
  69. package/dist/node/test/test-util.d.ts +7 -0
  70. package/dist/node/test/test-util.js +6 -0
  71. package/dist/node/test/test-util.js.map +1 -1
  72. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { L as hideClassPrivateProps, R as ipnsNameToIpnsOverPubsubTopic, br as logger_default, vr as PKCError } from "./schema-CH2yoI0b.js";
3
- import { a as fetchBlockWithStalledSessionFailover, i as directFetchIpnsRecordFromProviders, n as cacheIpnsRecordInPubsubLocalStore, o as getHeliaDebugContext, r as connectToPubsubPeers, s as selectBitswapSessionSeedPeers } from "./util-CiBeiLBn.js";
2
+ import { L as hideClassPrivateProps, R as ipnsNameToIpnsOverPubsubTopic, br as logger_default, vr as PKCError } from "./schema-Iavj-cRD.js";
3
+ import { a as fetchBlockWithStalledSessionFailover, i as directFetchIpnsRecordFromProviders, n as cacheIpnsRecordInPubsubLocalStore, o as getHeliaDebugContext, r as connectToPubsubPeers, s as selectBitswapSessionSeedPeers } from "./util-CfSUfLkV.js";
4
4
  import { t as map } from "./src-Cpx2Sts8.js";
5
5
  import { t as parallelBatch } from "./src-DKntVmyX.js";
6
6
  import { fileURLToPath } from "node:url";
7
- import fsp, { rename, writeFile } from "node:fs/promises";
7
+ import fs, { rename, writeFile } from "node:fs/promises";
8
8
  import path, { basename, dirname, join } from "node:path";
9
9
  import path$1 from "path";
10
10
  import { CID } from "multiformats/cid";
@@ -4150,12 +4150,12 @@ var require_sync$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
4150
4150
  var require_fs$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
4151
4151
  Object.defineProperty(exports, "__esModule", { value: true });
4152
4152
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
4153
- const fs$2 = __require("fs");
4153
+ const fs$3 = __require("fs");
4154
4154
  exports.FILE_SYSTEM_ADAPTER = {
4155
- lstat: fs$2.lstat,
4156
- stat: fs$2.stat,
4157
- lstatSync: fs$2.lstatSync,
4158
- statSync: fs$2.statSync
4155
+ lstat: fs$3.lstat,
4156
+ stat: fs$3.stat,
4157
+ lstatSync: fs$3.lstatSync,
4158
+ statSync: fs$3.statSync
4159
4159
  };
4160
4160
  function createFileSystemAdapter(fsMethods) {
4161
4161
  if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
@@ -4473,14 +4473,14 @@ var require_sync$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
4473
4473
  var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
4474
4474
  Object.defineProperty(exports, "__esModule", { value: true });
4475
4475
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
4476
- const fs$1 = __require("fs");
4476
+ const fs$2 = __require("fs");
4477
4477
  exports.FILE_SYSTEM_ADAPTER = {
4478
- lstat: fs$1.lstat,
4479
- stat: fs$1.stat,
4480
- lstatSync: fs$1.lstatSync,
4481
- statSync: fs$1.statSync,
4482
- readdir: fs$1.readdir,
4483
- readdirSync: fs$1.readdirSync
4478
+ lstat: fs$2.lstat,
4479
+ stat: fs$2.stat,
4480
+ lstatSync: fs$2.lstatSync,
4481
+ statSync: fs$2.statSync,
4482
+ readdir: fs$2.readdir,
4483
+ readdirSync: fs$2.readdirSync
4484
4484
  };
4485
4485
  function createFileSystemAdapter(fsMethods) {
4486
4486
  if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
@@ -5674,7 +5674,7 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports) => {
5674
5674
  var require_settings = /* @__PURE__ */ __commonJSMin(((exports) => {
5675
5675
  Object.defineProperty(exports, "__esModule", { value: true });
5676
5676
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
5677
- const fs = __require("fs");
5677
+ const fs$1 = __require("fs");
5678
5678
  const os = __require("os");
5679
5679
  /**
5680
5680
  * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
@@ -5682,12 +5682,12 @@ var require_settings = /* @__PURE__ */ __commonJSMin(((exports) => {
5682
5682
  */
5683
5683
  const CPU_COUNT = Math.max(os.cpus().length, 1);
5684
5684
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
5685
- lstat: fs.lstat,
5686
- lstatSync: fs.lstatSync,
5687
- stat: fs.stat,
5688
- statSync: fs.statSync,
5689
- readdir: fs.readdir,
5690
- readdirSync: fs.readdirSync
5685
+ lstat: fs$1.lstat,
5686
+ lstatSync: fs$1.lstatSync,
5687
+ stat: fs$1.stat,
5688
+ statSync: fs$1.statSync,
5689
+ readdir: fs$1.readdir,
5690
+ readdirSync: fs$1.readdirSync
5691
5691
  };
5692
5692
  var Settings = class {
5693
5693
  constructor(_options = {}) {
@@ -5850,7 +5850,7 @@ var import_out = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((export
5850
5850
  */
5851
5851
  async function* glob(dir, pattern, options = {}) {
5852
5852
  const absoluteDir = path.resolve(dir);
5853
- const stats = await fsp.stat(absoluteDir);
5853
+ const stats = await fs.stat(absoluteDir);
5854
5854
  for await (const entry of import_out.default.stream(pattern, {
5855
5855
  ...options,
5856
5856
  cwd: stats.isDirectory() ? dir : process.cwd()
@@ -6050,14 +6050,14 @@ var NextToLast = class {
6050
6050
  async function writeFile$1(file, contents, options) {
6051
6051
  try {
6052
6052
  options?.signal?.throwIfAborted();
6053
- await raceSignal(fsp.mkdir(path.dirname(file), { recursive: true }), options?.signal);
6053
+ await raceSignal(fs.mkdir(path.dirname(file), { recursive: true }), options?.signal);
6054
6054
  const writer = new Writer(file);
6055
6055
  options?.signal?.throwIfAborted();
6056
6056
  await writer.write(contents);
6057
6057
  } catch (err) {
6058
6058
  if (err.syscall === "rename" && ["ENOENT", "EPERM"].includes(err.code)) {
6059
6059
  options?.signal?.throwIfAborted();
6060
- await raceSignal(fsp.access(file, fsp.constants.F_OK | fsp.constants.W_OK), options?.signal);
6060
+ await raceSignal(fs.access(file, fs.constants.F_OK | fs.constants.W_OK), options?.signal);
6061
6061
  return;
6062
6062
  }
6063
6063
  throw err;
@@ -6085,11 +6085,11 @@ var FsBlockstore = class {
6085
6085
  }
6086
6086
  async open() {
6087
6087
  try {
6088
- await fsp.access(this.path, fsp.constants.F_OK | fsp.constants.W_OK);
6088
+ await fs.access(this.path, fs.constants.F_OK | fs.constants.W_OK);
6089
6089
  if (this.errorIfExists) throw new OpenFailedError(`Blockstore directory: ${this.path} already exists`);
6090
6090
  } catch (err) {
6091
6091
  if (err.code === "ENOENT") if (this.createIfMissing) {
6092
- await fsp.mkdir(this.path, { recursive: true });
6092
+ await fs.mkdir(this.path, { recursive: true });
6093
6093
  return;
6094
6094
  } else throw new OpenFailedError(`Blockstore directory: ${this.path} does not exist`);
6095
6095
  throw err;
@@ -6120,7 +6120,7 @@ var FsBlockstore = class {
6120
6120
  let handle;
6121
6121
  try {
6122
6122
  options?.signal?.throwIfAborted();
6123
- handle = await raceSignal(fsp.open(path.join(this.path, dir, file)), options?.signal);
6123
+ handle = await raceSignal(fs.open(path.join(this.path, dir, file)), options?.signal);
6124
6124
  yield* handle.createReadStream();
6125
6125
  } catch (err) {
6126
6126
  if (handle != null) await raceSignal(handle.close(), options?.signal);
@@ -6141,7 +6141,7 @@ var FsBlockstore = class {
6141
6141
  const { dir, file } = this.shardingStrategy.encode(key);
6142
6142
  try {
6143
6143
  options?.signal?.throwIfAborted();
6144
- await raceSignal(fsp.unlink(path.join(this.path, dir, file)), options?.signal);
6144
+ await raceSignal(fs.unlink(path.join(this.path, dir, file)), options?.signal);
6145
6145
  } catch (err) {
6146
6146
  if (err.code === "ENOENT") return;
6147
6147
  throw new DeleteFailedError(String(err));
@@ -6159,7 +6159,7 @@ var FsBlockstore = class {
6159
6159
  const { dir, file } = this.shardingStrategy.encode(key);
6160
6160
  try {
6161
6161
  options?.signal?.throwIfAborted();
6162
- await raceSignal(fsp.access(path.join(this.path, dir, file)), options?.signal);
6162
+ await raceSignal(fs.access(path.join(this.path, dir, file)), options?.signal);
6163
6163
  } catch (err) {
6164
6164
  return false;
6165
6165
  }
@@ -6175,7 +6175,7 @@ var FsBlockstore = class {
6175
6175
  bytes: (async function* () {
6176
6176
  let handle;
6177
6177
  try {
6178
- handle = await raceSignal(fsp.open(file), options?.signal);
6178
+ handle = await raceSignal(fs.open(file), options?.signal);
6179
6179
  yield* handle.createReadStream();
6180
6180
  } finally {
6181
6181
  if (handle != null) await raceSignal(handle.close(), options?.signal);
@@ -1,6 +1,6 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $ as pubsubTopicToDhtKey, $n as n$3, An as CommentsTableRowSchema, At as trackStartedCommunity, Bn as CommentEditsTableRowSchema, Bt as CommunityEditPublicationPubsubReservedFields, C as contentContainsMarkdownAudio, Ct as findUpdatingCommunity, Dn as CommentUpdateSchema, F as getIpnsRecordInLocalKuboNode, Ft as untrackUpdatingCommunity, G as isLinkOfAudio, Gt as CommentModerationPubsubMessagePublicationSchema, In as CommentEditPubsubMessagePublicationSchema, It as require_sha256, J as isLinkOfVideo, Jt as CommentModerationsTableRowSchema, K as isLinkOfImage, Kt as CommentModerationReservedFields, L as hideClassPrivateProps, Ln as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, M as genToArray, Mt as trackUpdatingCommunity, N as getEquivalentCommunityAddresses, Nr as ZodError, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, P as getErrorCodeFromMessage, Q as isStringDomain, Qn as t$8, R as ipnsNameToIpnsOverPubsubTopic, Rn as CommentEditReservedFields, S as calculateStringSizeSameAsIpfsAddCidV0, T as contentContainsMarkdownVideos, W as isLinkOfAnimatedImage, Wn as AuthorReservedFields, Y as isLinkValid, Zn as n$4, _t as timestamp, a as ChallengeRequestMessageSchema, ar as r$1, at as removeNullUndefinedValues, b as areEquivalentCommunityAddresses, bn as CommentPubsubMessageReservedFields, br as logger_default, bt as findCommunityInRegistry, d as DecryptedChallengeRequestSchema, dt as retryKuboIpfsAddAndProvide, er as t$7, fr as require_retry, gn as VoteTablesRowSchema, ht as statMfsPathSafely, in as CommunitySignedPropertyNames, k as doesDomainAddressHaveCapitalLetter, kn as CommentUpdateTableRowSchema, kt as syncCommunityRegistryEntry, lr as t$5, lt as retryKuboBlockPutPinAndProvidePubsubTopic, mn as VotePubsubReservedFields, mt as sleepUntilTimeoutOrAbort, nr as e, nt as removeBlocksFromKuboNode, or as t$4, pn as VotePubsubMessagePublicationSchema, q as isLinkOfMedia, r as ChallengeMessageSchema, rn as CommunityIpfsSchema, rr as e$1, rt as removeMfsFilesSafely, s as ChallengeVerificationMessageSchema, t as ChallengeAnswerMessageSchema, tr as t$6, u as DecryptedChallengeRequestPublicationSchema, ur as t$3, vr as PKCError, w as contentContainsMarkdownImages, x as calculateIpfsCidV0, xt as findStartedCommunity, y as version_default, yn as CommentIpfsSchema, yr as messages, yt as writeKuboFilesWithTimeout } from "./schema-CH2yoI0b.js";
3
- import { $n as t$11, A as deriveCommentIpfsFromCommentTableRow, At as verifyCommunity, B as resolveDbPostsCidRefs, Bt as getCommunityNameFromWire, C as encryptEd25519AesGcmPublicKeyBuffer, Ct as verifyChallengeRequest, D as calculateInlineRepliesBudget, Dt as verifyCommentModeration, E as calculateExpectedSignatureSize, Et as verifyCommentIpfs, F as getThumbnailPropsOfLink, G as POST_REPLIES_SORT_TYPES, I as importSignerIntoKuboNode, It as getAuthorNameFromWire, Jt as getPKCAddressFromPublicKeySync, K as REPLY_REPLIES_SORT_TYPES, Kt as getIpfsKeyFromPrivateKey, M as deriveDbReplies, Mt as verifyVote, N as getDefaultCommunityDbConfig, Nt as buildRuntimeAuthor, Ot as verifyCommentPubsubMessage, Pt as cleanWireAuthor, Q as iterateOverPageCidsToFindAllCids, Qn as r$2, Sn as parseJsonWithPKCErrorIfFails, T as backupCommunityDb, Tt as verifyCommentEdit, Ut as decode, Vt as getCommunityPublicKeyFromWire, W as POSTS_SORT_TYPES, Wt as encode, Xn as t$9, Xt as createSchemaRowParser, Yt as getPublicKeyFromPrivateKey, Zn as t$12, _ as SignerWithPublicKeyAddress, _t as signCommentUpdateForChallengeVerification, a as pkcJsChallenges, ar as STORAGE_KEYS, at as pLimit, ct as cleanUpBeforePublishing, d as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, er as n$6, f as KeyvBetterSqlite3, ft as signChallengeVerification, gt as signCommentUpdate, i as getCommunityChallengeFromCommunityChallengeSettings, ir as stringify, j as deriveDbPosts, jt as verifyCommunityEdit, k as deleteOldCommunityInWindows, kt as verifyCommentUpdate, l as normalizeSelfAddrsForProvider, ln as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, mt as signCommentEdit, o as TrackedInstanceRegistry, or as require_lodash_merge, pt as signComment, q as TIMEFRAMES_TO_SECONDS, qt as getPKCAddressFromPublicKey, r as getChallengeVerification, rr as t$10, s as LRUCache, sn as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, t as RpcLocalCommunity, tr as n$5, ut as signChallengeMessage, vt as signCommunity, w as BackupAbortError, x as decryptEd25519AesGcmPublicKeyBuffer, xt as verifyChallengeAnswer, yn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, z as moveCommunityDbToDeletedDirectory } from "./rpc-local-community-DHhucg8-.js";
2
+ import { $ as pubsubTopicToDhtKey, $n as n$3, An as CommentsTableRowSchema, At as trackStartedCommunity, Bn as CommentEditsTableRowSchema, Bt as CommunityEditPublicationPubsubReservedFields, C as contentContainsMarkdownAudio, Ct as findUpdatingCommunity, Dn as CommentUpdateSchema, F as getIpnsRecordInLocalKuboNode, Ft as untrackUpdatingCommunity, G as isLinkOfAudio, Gt as CommentModerationPubsubMessagePublicationSchema, In as CommentEditPubsubMessagePublicationSchema, It as require_sha256, J as isLinkOfVideo, Jt as CommentModerationsTableRowSchema, K as isLinkOfImage, Kt as CommentModerationReservedFields, L as hideClassPrivateProps, Ln as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, M as genToArray, Mt as trackUpdatingCommunity, N as getEquivalentCommunityAddresses, Nr as ZodError, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, P as getErrorCodeFromMessage, Q as isStringDomain, Qn as t$8, R as ipnsNameToIpnsOverPubsubTopic, Rn as CommentEditReservedFields, S as calculateStringSizeSameAsIpfsAddCidV0, T as contentContainsMarkdownVideos, W as isLinkOfAnimatedImage, Wn as AuthorReservedFields, Y as isLinkValid, Zn as n$4, _t as timestamp, a as ChallengeRequestMessageSchema, ar as r$1, at as removeNullUndefinedValues, b as areEquivalentCommunityAddresses, bn as CommentPubsubMessageReservedFields, br as logger_default, bt as findCommunityInRegistry, d as DecryptedChallengeRequestSchema, dt as retryKuboIpfsAddAndProvide, er as t$7, fr as require_retry, gn as VoteTablesRowSchema, ht as statMfsPathSafely, in as CommunitySignedPropertyNames, k as doesDomainAddressHaveCapitalLetter, kn as CommentUpdateTableRowSchema, kt as syncCommunityRegistryEntry, lr as t$5, lt as retryKuboBlockPutPinAndProvidePubsubTopic, mn as VotePubsubReservedFields, mt as sleepUntilTimeoutOrAbort, nr as e, nt as removeBlocksFromKuboNode, or as t$4, pn as VotePubsubMessagePublicationSchema, q as isLinkOfMedia, r as ChallengeMessageSchema, rn as CommunityIpfsSchema, rr as e$1, rt as removeMfsFilesSafely, s as ChallengeVerificationMessageSchema, t as ChallengeAnswerMessageSchema, tr as t$6, u as DecryptedChallengeRequestPublicationSchema, ur as t$3, vr as PKCError, w as contentContainsMarkdownImages, x as calculateIpfsCidV0, xt as findStartedCommunity, y as version_default, yn as CommentIpfsSchema, yr as messages, yt as writeKuboFilesWithTimeout } from "./schema-Iavj-cRD.js";
3
+ import { $n as t$11, A as deriveCommentIpfsFromCommentTableRow, At as verifyCommunity, B as resolveDbPostsCidRefs, Bt as getCommunityNameFromWire, C as encryptEd25519AesGcmPublicKeyBuffer, Ct as verifyChallengeRequest, D as calculateInlineRepliesBudget, Dt as verifyCommentModeration, E as calculateExpectedSignatureSize, Et as verifyCommentIpfs, F as getThumbnailPropsOfLink, G as POST_REPLIES_SORT_TYPES, I as importSignerIntoKuboNode, It as getAuthorNameFromWire, Jt as getPKCAddressFromPublicKeySync, K as REPLY_REPLIES_SORT_TYPES, Kt as getIpfsKeyFromPrivateKey, M as deriveDbReplies, Mt as verifyVote, N as getDefaultCommunityDbConfig, Nt as buildRuntimeAuthor, Ot as verifyCommentPubsubMessage, Pt as cleanWireAuthor, Q as iterateOverPageCidsToFindAllCids, Qn as r$2, Sn as parseJsonWithPKCErrorIfFails, T as backupCommunityDb, Tt as verifyCommentEdit, Ut as decode, Vt as getCommunityPublicKeyFromWire, W as POSTS_SORT_TYPES, Wt as encode, Xn as t$9, Xt as createSchemaRowParser, Yt as getPublicKeyFromPrivateKey, Zn as t$12, _ as SignerWithPublicKeyAddress, _t as signCommentUpdateForChallengeVerification, a as pkcJsChallenges, ar as STORAGE_KEYS, at as pLimit, ct as cleanUpBeforePublishing, d as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, er as n$6, f as KeyvBetterSqlite3, ft as signChallengeVerification, gt as signCommentUpdate, i as getCommunityChallengeFromCommunityChallengeSettings, ir as stringify, j as deriveDbPosts, jt as verifyCommunityEdit, k as deleteOldCommunityInWindows, kt as verifyCommentUpdate, l as normalizeSelfAddrsForProvider, ln as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, mt as signCommentEdit, o as TrackedInstanceRegistry, or as require_lodash_merge, pt as signComment, q as TIMEFRAMES_TO_SECONDS, qt as getPKCAddressFromPublicKey, r as getChallengeVerification, rr as t$10, s as LRUCache, sn as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, t as RpcLocalCommunity, tr as n$5, ut as signChallengeMessage, vt as signCommunity, w as BackupAbortError, x as decryptEd25519AesGcmPublicKeyBuffer, xt as verifyChallengeAnswer, yn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, z as moveCommunityDbToDeletedDirectory } from "./rpc-local-community-Cog5rZLG.js";
4
4
  import { randomFillSync, randomUUID } from "node:crypto";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
6
6
  import path from "node:path";
@@ -468,7 +468,6 @@ async function repinCommentUpdateIfNeeded(community) {
468
468
  log(`CommentUpdate directory`, community.address, "will republish all comment updates");
469
469
  community._dbHandler.forceUpdateOnAllComments();
470
470
  }
471
- const GC_HIGH_WATERMARK = .9;
472
471
  const MIN_MS_BETWEEN_GC = 3600 * 1e3;
473
472
  const lastGcFinishedAtByKuboUrl = /* @__PURE__ */ new Map();
474
473
  const inFlightGcByKuboUrl = /* @__PURE__ */ new Map();
@@ -487,28 +486,45 @@ async function cleanUpIpfsRepoIfDue(community, force = false) {
487
486
  inFlightGcByKuboUrl.set(kuboUrl, gcRun);
488
487
  return gcRun;
489
488
  }
489
+ async function _readRepoSizeSafely({ kuboRpc, kuboUrl, log }) {
490
+ try {
491
+ return (await kuboRpc._client.repo.stat({ searchParams: new URLSearchParams({ "size-only": "true" }) })).repoSize;
492
+ } catch (e) {
493
+ log.trace("Failed to read repo size from the kubo node", kuboUrl, e);
494
+ return;
495
+ }
496
+ }
497
+ function _formatBytes(bytes) {
498
+ const asNumber = Number(bytes);
499
+ const units = [
500
+ "B",
501
+ "KB",
502
+ "MB",
503
+ "GB",
504
+ "TB"
505
+ ];
506
+ const magnitude = Math.abs(asNumber);
507
+ const unitIndex = magnitude < 1 ? 0 : Math.min(Math.floor(Math.log(magnitude) / Math.log(1024)), units.length - 1);
508
+ const scaled = asNumber / 1024 ** unitIndex;
509
+ return unitIndex === 0 ? `${asNumber}B` : `${scaled.toFixed(2)}${units[unitIndex]}`;
510
+ }
511
+ function _describeReclaimedSpace({ before, after }) {
512
+ if (typeof before !== "bigint" || typeof after !== "bigint") return "reclaimed an unknown amount, repo.stat was unavailable";
513
+ const sizes = `(${_formatBytes(before)} -> ${_formatBytes(after)})`;
514
+ if (after > before) return `reclaimed no space, the repo grew ${_formatBytes(after - before)} during the sweep ${sizes}`;
515
+ return `reclaimed ${_formatBytes(before - after)} ${sizes}`;
516
+ }
490
517
  async function _runRepoGcIfDue({ community, kuboUrl, force, log }) {
491
518
  const kuboRpc = community._clientsManager.getDefaultKuboRpcClient();
492
- let repoSizeBefore;
493
519
  if (!force) {
494
520
  const lastGcFinishedAt = lastGcFinishedAtByKuboUrl.get(kuboUrl);
495
521
  if (typeof lastGcFinishedAt === "number" && Date.now() - lastGcFinishedAt < MIN_MS_BETWEEN_GC) return;
496
- let repoStat;
497
- try {
498
- repoStat = await kuboRpc._client.repo.stat({ searchParams: new URLSearchParams({ "size-only": "true" }) });
499
- } catch (e) {
500
- log.error("Skipping repo.gc: failed to read repo.stat from the kubo node", kuboUrl, e);
501
- return;
502
- }
503
- repoSizeBefore = repoStat.repoSize;
504
- if (repoStat.storageMax > 0n) {
505
- const gcThreshold = repoStat.storageMax * BigInt(Math.round(GC_HIGH_WATERMARK * 100)) / 100n;
506
- if (repoStat.repoSize < gcThreshold) {
507
- log.trace("Skipping repo.gc on", kuboUrl, "- repo size", repoStat.repoSize, "is below the", `${GC_HIGH_WATERMARK * 100}%`, "watermark", gcThreshold, "of StorageMax", repoStat.storageMax);
508
- return;
509
- }
510
- }
511
522
  }
523
+ const repoSizeBefore = await _readRepoSizeSafely({
524
+ kuboRpc,
525
+ kuboUrl,
526
+ log
527
+ });
512
528
  let gcCids = 0;
513
529
  try {
514
530
  for await (const res of kuboRpc._client.repo.gc({ quiet: true })) if (res.cid) gcCids++;
@@ -519,13 +535,15 @@ async function _runRepoGcIfDue({ community, kuboUrl, force, log }) {
519
535
  } finally {
520
536
  lastGcFinishedAtByKuboUrl.set(kuboUrl, Date.now());
521
537
  }
522
- let repoSizeAfter;
523
- try {
524
- repoSizeAfter = (await kuboRpc._client.repo.stat({ searchParams: new URLSearchParams({ "size-only": "true" }) })).repoSize;
525
- } catch (e) {
526
- log.trace("repo.gc finished but the follow-up repo.stat failed", e);
527
- }
528
- log("GC cleaned", gcCids, "cids out of the IPFS node", kuboUrl, "- repo size", repoSizeBefore ?? "unknown", "->", repoSizeAfter ?? "unknown");
538
+ const repoSizeAfter = await _readRepoSizeSafely({
539
+ kuboRpc,
540
+ kuboUrl,
541
+ log
542
+ });
543
+ log("GC cleaned", gcCids, "cids out of the IPFS node", kuboUrl, "and", _describeReclaimedSpace({
544
+ before: repoSizeBefore,
545
+ after: repoSizeAfter
546
+ }));
529
547
  }
530
548
  async function addAllCidsUnderPurgedCommentToBeRemoved(community, purgedCommentAndCommentUpdate) {
531
549
  community._cidsToUnPin.add(purgedCommentAndCommentUpdate.commentTableRow.cid);
@@ -1177,7 +1195,10 @@ async function checkWireFormatAndCommunityAuthor(community, publication, authorC
1177
1195
  if ("subplebbitAddress" in publication) return messages.ERR_PUBLICATION_USES_DEPRECATED_SUBPLEBBIT_ADDRESS;
1178
1196
  if ("communityAddress" in publication) return messages.ERR_PUBLICATION_USES_DEPRECATED_COMMUNITY_ADDRESS;
1179
1197
  const pubCommunityPublicKey = getCommunityPublicKeyFromWire(publication);
1180
- if (!pubCommunityPublicKey || pubCommunityPublicKey !== communityIdentityPublicKey(community)) return messages.ERR_PUBLICATION_INVALID_COMMUNITY_PUBLIC_KEY;
1198
+ if (!pubCommunityPublicKey || pubCommunityPublicKey !== communityIdentityPublicKey(community)) {
1199
+ if (community.anchor && pubCommunityPublicKey === community.signer.address) return messages.ERR_PUBLICATION_SIGNED_TO_MINTER_INSTEAD_OF_ANCHOR;
1200
+ return messages.ERR_PUBLICATION_INVALID_COMMUNITY_PUBLIC_KEY;
1201
+ }
1181
1202
  const pubCommunityName = getCommunityNameFromWire(publication);
1182
1203
  if (pubCommunityName && pubCommunityName !== community.address) return messages.ERR_PUBLICATION_INVALID_COMMUNITY_NAME;
1183
1204
  if (publication.timestamp <= timestamp() - 300 || publication.timestamp >= timestamp() + 300) return messages.ERR_PUBLICATION_TIMESTAMP_IS_NOT_IN_PROPER_RANGE;
@@ -1,2 +1,2 @@
1
- import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-KNlSpG2e.js";
1
+ import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-CHzhypCp.js";
2
2
  export { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb };
@@ -1,7 +1,7 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $n as n$1, B as isIpfsCid, Cr as setErrorMap, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dn as CommentUpdateSchema, Dt as refreshTrackedCommentAliases, E as createAbortError, Et as listUpdatingCommunities, Fr as parsedType, H as isIpns, Ir as stringifyPrimitive, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Pr as joinValues, Pt as untrackUpdatingComment, Q as isStringDomain, Qt as CommunityAnchorSchema, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, St as findUpdatingComment, Tt as listUpdatingComments, Zn as n$2, _t as timestamp, a as ChallengeRequestMessageSchema, ar as r, b as areEquivalentCommunityAddresses, br as logger_default, ct as resolveWhenPredicateIsTrue, fr as require_retry, ft as shortifyAddress, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, ln as PubsubTopicSchema, mt as sleepUntilTimeoutOrAbort, nr as e, ot as removeUndefinedValuesRecursively, pr as FailedToFetchCommentIpfsFromGatewaysError, pt as shortifyCid, r as ChallengeMessageSchema, rn as CommunityIpfsSchema, rr as e$1, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as t$1, ut as retryKuboIpfsAdd, vr as PKCError, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wn as CommentUpdateForChallengeVerificationSchema, wt as listStartedCommunities, xr as require_supports_color, xt as findStartedCommunity, y as version_default, yn as CommentIpfsSchema, yr as messages, z as isAbortError } from "./schema-CH2yoI0b.js";
3
- import { $ as parseRawPages, $n as t$3, An as RpcAuthorNameParamSchema, Bn as RpcExportCommunityResultSchema, Bt as getCommunityNameFromWire, Cn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Dt as verifyCommentModeration, En as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Et as verifyCommentIpfs, Fn as RpcCommunityPageParamSchema, Ft as getAuthorNameFromRuntime, Gn as RpcPublishedAnchorRecordResultSchema, Gt as getBufferedPKCAddressFromPublicKey, H as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Hn as RpcFetchCidResultSchema, Ht as normalizeCommunityInputFromCommunity, In as RpcEditCommunityParamSchema, Jn as RpcSuccessResultSchema, Jt as getPKCAddressFromPublicKeySync, Kn as RpcResolveAuthorNameResultSchema, L as listCommunitiesSync, Ln as RpcExportCommunityModLogsParamSchema, Lt as normalizeCreatePublicationAuthor, Mn as RpcCidParamSchema, Mt as verifyVote, Nn as RpcCommentRepliesPageParamSchema, Nt as buildRuntimeAuthor, O as createKuboRpcClient, On as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Ot as verifyCommentPubsubMessage, P as getDefaultDataPath, Pn as RpcCommunityIdentifierParamSchema, Pt as cleanWireAuthor, R as monitorCommunitiesDirectory, Rn as RpcExportCommunityModLogsResultSchema, Rt as buildRuntimeCommunityFields, S as encryptEd25519AesGcm, Sn as parseJsonWithPKCErrorIfFails, St as verifyChallengeMessage, Tn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, Tt as verifyCommentEdit, U as CommentClientsManager, Un as RpcPublishAnchorRecordParamSchema, Ut as decode, V as setNativeFunctions$1, Vn as RpcFetchCidParamSchema, Vt as getCommunityPublicKeyFromWire, Wn as RpcPublishChallengeAnswersParamSchema, X as extractCommunityRuntimeFieldsFromParsedPages, Xn as t$4, Yn as RpcUnsubscribeParamSchema, Z as findCommentInPageInstanceRecursively, Zt as parseCidStringSchemaWithPKCErrorIfItFails, _n as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, an as parseCommunityAddressWithPKCErrorIfItFails, b as decryptEd25519AesGcm, bn as parseDecryptedChallengeVerification, bt as signVote, c as AddressesRewriterProxyServer, cn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, cr as require_undici, ct as cleanUpBeforePublishing, dn as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, dt as signChallengeRequest, en as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, er as n$3, et as RepliesPages, f as KeyvBetterSqlite3, fn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, ht as signCommentModeration, in as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, jn as RpcCancelExportParamSchema, jt as verifyCommunityEdit, kn as RpcAnchorPublishPreparationResultSchema, kt as verifyCommentUpdate, lt as signChallengeAnswer, m as decodeRpcChallengePubsubMsg, mt as signCommentEdit, n as RpcRemoteCommunity, nr as t$2, nt as PKCClientsManager, o as TrackedInstanceRegistry, ot as PKCTypedEmitter, p as decodeRpcChallengeAnswerPubsubMsg, pn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, pt as signComment, qn as RpcSubscriptionIdResultSchema, rn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, rr as t$5, rt as InflightFetchManager, s as LRUCache, sr as nativeFunctions$2, st as require_lib$1, t as RpcLocalCommunity, tn as parseCommentIpfsSchemaWithPKCErrorIfItFails, tt as PublicationClientsManager, u as RemoteCommunity, un as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, v as createSigner, vn as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, wn as parseRpcCommentEventWithPKCErrorIfItFails, wt as verifyChallengeVerification, xn as parseDecryptedChallengeWithPKCErrorIfItFails, y as createAnchorIpnsRecord$1, yn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, yt as signCommunityEdit, zn as RpcExportCommunityParamSchema, zt as getCommunityAddressFromRecord } from "./rpc-local-community-DHhucg8-.js";
4
- import { o as getHeliaDebugContext } from "./util-CiBeiLBn.js";
2
+ import { $n as n$1, B as isIpfsCid, Cr as setErrorMap, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dn as CommentUpdateSchema, Dt as refreshTrackedCommentAliases, E as createAbortError, Et as listUpdatingCommunities, Fr as parsedType, H as isIpns, Ir as stringifyPrimitive, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Pr as joinValues, Pt as untrackUpdatingComment, Q as isStringDomain, Qt as CommunityAnchorSchema, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, St as findUpdatingComment, Tt as listUpdatingComments, Zn as n$2, _t as timestamp, a as ChallengeRequestMessageSchema, ar as r, b as areEquivalentCommunityAddresses, br as logger_default, ct as resolveWhenPredicateIsTrue, fr as require_retry, ft as shortifyAddress, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, ln as PubsubTopicSchema, mt as sleepUntilTimeoutOrAbort, nr as e, ot as removeUndefinedValuesRecursively, pr as FailedToFetchCommentIpfsFromGatewaysError, pt as shortifyCid, r as ChallengeMessageSchema, rn as CommunityIpfsSchema, rr as e$1, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as t$1, ut as retryKuboIpfsAdd, vr as PKCError, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wn as CommentUpdateForChallengeVerificationSchema, wt as listStartedCommunities, xr as require_supports_color, xt as findStartedCommunity, y as version_default, yn as CommentIpfsSchema, yr as messages, z as isAbortError } from "./schema-Iavj-cRD.js";
3
+ import { $ as parseRawPages, $n as t$3, An as RpcAuthorNameParamSchema, Bn as RpcExportCommunityResultSchema, Bt as getCommunityNameFromWire, Cn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Dt as verifyCommentModeration, En as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Et as verifyCommentIpfs, Fn as RpcCommunityPageParamSchema, Ft as getAuthorNameFromRuntime, Gn as RpcPublishedAnchorRecordResultSchema, Gt as getBufferedPKCAddressFromPublicKey, H as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Hn as RpcFetchCidResultSchema, Ht as normalizeCommunityInputFromCommunity, In as RpcEditCommunityParamSchema, Jn as RpcSuccessResultSchema, Jt as getPKCAddressFromPublicKeySync, Kn as RpcResolveAuthorNameResultSchema, L as listCommunitiesSync, Ln as RpcExportCommunityModLogsParamSchema, Lt as normalizeCreatePublicationAuthor, Mn as RpcCidParamSchema, Mt as verifyVote, Nn as RpcCommentRepliesPageParamSchema, Nt as buildRuntimeAuthor, O as createKuboRpcClient, On as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Ot as verifyCommentPubsubMessage, P as getDefaultDataPath, Pn as RpcCommunityIdentifierParamSchema, Pt as cleanWireAuthor, R as monitorCommunitiesDirectory, Rn as RpcExportCommunityModLogsResultSchema, Rt as buildRuntimeCommunityFields, S as encryptEd25519AesGcm, Sn as parseJsonWithPKCErrorIfFails, St as verifyChallengeMessage, Tn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, Tt as verifyCommentEdit, U as CommentClientsManager, Un as RpcPublishAnchorRecordParamSchema, Ut as decode, V as setNativeFunctions$1, Vn as RpcFetchCidParamSchema, Vt as getCommunityPublicKeyFromWire, Wn as RpcPublishChallengeAnswersParamSchema, X as extractCommunityRuntimeFieldsFromParsedPages, Xn as t$4, Yn as RpcUnsubscribeParamSchema, Z as findCommentInPageInstanceRecursively, Zt as parseCidStringSchemaWithPKCErrorIfItFails, _n as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, an as parseCommunityAddressWithPKCErrorIfItFails, b as decryptEd25519AesGcm, bn as parseDecryptedChallengeVerification, bt as signVote, c as AddressesRewriterProxyServer, cn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, cr as require_undici, ct as cleanUpBeforePublishing, dn as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, dt as signChallengeRequest, en as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, er as n$3, et as RepliesPages, f as KeyvBetterSqlite3, fn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, ht as signCommentModeration, in as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, jn as RpcCancelExportParamSchema, jt as verifyCommunityEdit, kn as RpcAnchorPublishPreparationResultSchema, kt as verifyCommentUpdate, lt as signChallengeAnswer, m as decodeRpcChallengePubsubMsg, mt as signCommentEdit, n as RpcRemoteCommunity, nr as t$2, nt as PKCClientsManager, o as TrackedInstanceRegistry, ot as PKCTypedEmitter, p as decodeRpcChallengeAnswerPubsubMsg, pn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, pt as signComment, qn as RpcSubscriptionIdResultSchema, rn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, rr as t$5, rt as InflightFetchManager, s as LRUCache, sr as nativeFunctions$2, st as require_lib$1, t as RpcLocalCommunity, tn as parseCommentIpfsSchemaWithPKCErrorIfItFails, tt as PublicationClientsManager, u as RemoteCommunity, un as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, v as createSigner, vn as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, wn as parseRpcCommentEventWithPKCErrorIfItFails, wt as verifyChallengeVerification, xn as parseDecryptedChallengeWithPKCErrorIfItFails, y as createAnchorIpnsRecord$1, yn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, yt as signCommunityEdit, zn as RpcExportCommunityParamSchema, zt as getCommunityAddressFromRecord } from "./rpc-local-community-Cog5rZLG.js";
4
+ import { o as getHeliaDebugContext } from "./util-CfSUfLkV.js";
5
5
  import path from "path";
6
6
  import assert from "assert";
7
7
  import fs from "fs";
@@ -8917,7 +8917,7 @@ var PKC$1 = class extends PKCTypedEmitter {
8917
8917
  this.clients.libp2pJsClients = {};
8918
8918
  if (!this.libp2pJsClientsOptions) return;
8919
8919
  if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
8920
- const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-DPyYKV_m.js");
8920
+ const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-BsYWQ7qS.js");
8921
8921
  for (const clientOptions of this.libp2pJsClientsOptions) {
8922
8922
  const heliaNode = await createLibp2pJsClientOrUseExistingOne({
8923
8923
  ...clientOptions,
@@ -9166,7 +9166,7 @@ var PKC$1 = class extends PKCTypedEmitter {
9166
9166
  const log = logger_default("pkc-js:pkc:createLocalCommunity");
9167
9167
  log.trace("Received community options to create a local community instance:", options);
9168
9168
  if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
9169
- const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-DS4PU-HF.js");
9169
+ const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-EqWKTLxr.js");
9170
9170
  const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
9171
9171
  const community = new LocalCommunity(this);
9172
9172
  if (isLocalCommunity) {