@pkcprotocol/pkc-js 0.0.113 → 0.0.115

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 (153) hide show
  1. package/dist/browser/challenges.d.ts +1 -0
  2. package/dist/browser/challenges.js +1 -1
  3. package/dist/browser/challenges.js.map +1 -1
  4. package/dist/browser/clients/base-client-manager.js +25 -2
  5. package/dist/browser/clients/base-client-manager.js.map +1 -1
  6. package/dist/browser/clients/rpc-client/rpc-schema-util.d.ts +2 -2
  7. package/dist/browser/clients/rpc-client/schema.d.ts +7 -7
  8. package/dist/browser/community/schema.d.ts +72 -72
  9. package/dist/browser/constants.d.ts +2 -1
  10. package/dist/browser/constants.js +3 -0
  11. package/dist/browser/constants.js.map +1 -1
  12. package/dist/browser/errors.d.ts +1 -0
  13. package/dist/browser/errors.js +1 -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/index-with-compile-cache.d.ts +4 -4
  18. package/dist/browser/index.d.ts +8 -8
  19. package/dist/browser/page-sorts.d.ts +2 -0
  20. package/dist/browser/page-sorts.js +2 -0
  21. package/dist/browser/page-sorts.js.map +1 -0
  22. package/dist/browser/pages/page-sort-scoring.d.ts +4 -0
  23. package/dist/browser/pages/page-sort-scoring.js +20 -3
  24. package/dist/browser/pages/page-sort-scoring.js.map +1 -1
  25. package/dist/browser/pages/schema.d.ts +17 -17
  26. package/dist/browser/pkc-error.d.ts +1 -1
  27. package/dist/browser/publications/comment/schema.d.ts +18 -18
  28. package/dist/browser/publications/comment-edit/schema.d.ts +5 -5
  29. package/dist/browser/publications/comment-moderation/schema.d.ts +4 -4
  30. package/dist/browser/publications/community-edit/schema.d.ts +4 -4
  31. package/dist/browser/pubsub-messages/schema.d.ts +9 -9
  32. package/dist/browser/rpc/src/index.d.ts +2 -0
  33. package/dist/browser/rpc/src/index.js +22 -0
  34. package/dist/browser/rpc/src/index.js.map +1 -1
  35. package/dist/browser/rpc/src/lib/pkc-js/index.d.ts +4 -4
  36. package/dist/browser/rpc/src/lib/pkc-js/index.js +3 -1
  37. package/dist/browser/rpc/src/lib/pkc-js/index.js.map +1 -1
  38. package/dist/browser/rpc/src/schema.d.ts +30 -30
  39. package/dist/browser/runtime/node/community/db-handler.d.ts +6 -0
  40. package/dist/browser/runtime/node/community/db-handler.js +38 -6
  41. package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
  42. package/dist/browser/runtime/node/community/local-community/challenges.js +0 -2
  43. package/dist/browser/runtime/node/community/local-community/challenges.js.map +1 -1
  44. package/dist/browser/runtime/node/community/local-community/editing.d.ts +2 -1
  45. package/dist/browser/runtime/node/community/local-community/editing.js +10 -7
  46. package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
  47. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +3 -0
  48. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  49. package/dist/browser/runtime/node/community/local-community/lifecycle.js +7 -3
  50. package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
  51. package/dist/browser/runtime/node/community/local-community/publication-store.js +23 -23
  52. package/dist/browser/runtime/node/community/local-community/publication-store.js.map +1 -1
  53. package/dist/browser/runtime/node/community/local-community/registry-sync.d.ts +7 -0
  54. package/dist/browser/runtime/node/community/local-community/registry-sync.js +80 -0
  55. package/dist/browser/runtime/node/community/local-community/registry-sync.js.map +1 -0
  56. package/dist/browser/runtime/node/community/local-community.d.ts +2 -1
  57. package/dist/browser/runtime/node/community/local-community.js +3 -0
  58. package/dist/browser/runtime/node/community/local-community.js.map +1 -1
  59. package/dist/browser/runtime/node/community/page-generator.js +11 -17
  60. package/dist/browser/runtime/node/community/page-generator.js.map +1 -1
  61. package/dist/browser/runtime/node/community/page-sorts/index.d.ts +9 -0
  62. package/dist/browser/runtime/node/community/page-sorts/index.js +64 -6
  63. package/dist/browser/runtime/node/community/page-sorts/index.js.map +1 -1
  64. package/dist/browser/schema/schema-util.d.ts +12 -12
  65. package/dist/browser/schema.d.ts +32 -32
  66. package/dist/browser/test/test-util.d.ts +30 -30
  67. package/dist/browser/validate-package-factories.d.ts +7 -0
  68. package/dist/browser/validate-package-factories.js +37 -0
  69. package/dist/browser/validate-package-factories.js.map +1 -0
  70. package/dist/bundled/bundle-manifest.json +68 -33
  71. package/dist/bundled/challenges.js +2 -1
  72. package/dist/bundled/chunks/{helia-for-pkc-DoOp7t8V.js → helia-for-pkc-BB8P6KYw.js} +33 -33
  73. package/dist/bundled/chunks/{local-community-CaV30etW.js → local-community-XrLSKipf.js} +172 -80
  74. package/dist/bundled/chunks/{local-community-CFX753RE.js → local-community-wAvG_J_u.js} +1 -1
  75. package/dist/bundled/chunks/{node-gyqBss4j.js → node-D5riLTOu.js} +5 -5
  76. package/dist/bundled/chunks/page-sort-scoring-3svUUHW_.js +112 -0
  77. package/dist/bundled/chunks/{rpc-local-community-DWv8wZMB.js → rpc-local-community-D5ZdqFYc.js} +80 -111
  78. package/dist/bundled/chunks/{util-B9JenRyE.js → util-CabVOL7E.js} +2 -1
  79. package/dist/bundled/chunks/{util-CH8WrVZq.js → util-Cnpgfqwn.js} +1 -1
  80. package/dist/bundled/chunks/validate-package-factories-CxIg67oP.js +41 -0
  81. package/dist/bundled/index.js +1 -1
  82. package/dist/bundled/page-sorts.js +2 -0
  83. package/dist/bundled/rpc/src/index.js +17 -4
  84. package/dist/node/challenges.d.ts +1 -0
  85. package/dist/node/challenges.js +1 -1
  86. package/dist/node/challenges.js.map +1 -1
  87. package/dist/node/clients/base-client-manager.js +25 -2
  88. package/dist/node/clients/base-client-manager.js.map +1 -1
  89. package/dist/node/clients/rpc-client/rpc-schema-util.d.ts +2 -2
  90. package/dist/node/clients/rpc-client/schema.d.ts +7 -7
  91. package/dist/node/community/schema.d.ts +72 -72
  92. package/dist/node/constants.d.ts +2 -1
  93. package/dist/node/constants.js +3 -0
  94. package/dist/node/constants.js.map +1 -1
  95. package/dist/node/errors.d.ts +1 -0
  96. package/dist/node/errors.js +1 -0
  97. package/dist/node/errors.js.map +1 -1
  98. package/dist/node/generated-version.d.ts +1 -1
  99. package/dist/node/generated-version.js +1 -1
  100. package/dist/node/index-with-compile-cache.d.ts +4 -4
  101. package/dist/node/index.d.ts +8 -8
  102. package/dist/node/page-sorts.d.ts +2 -0
  103. package/dist/node/page-sorts.js +2 -0
  104. package/dist/node/page-sorts.js.map +1 -0
  105. package/dist/node/pages/page-sort-scoring.d.ts +4 -0
  106. package/dist/node/pages/page-sort-scoring.js +20 -3
  107. package/dist/node/pages/page-sort-scoring.js.map +1 -1
  108. package/dist/node/pages/schema.d.ts +17 -17
  109. package/dist/node/pkc-error.d.ts +1 -1
  110. package/dist/node/publications/comment/schema.d.ts +18 -18
  111. package/dist/node/publications/comment-edit/schema.d.ts +5 -5
  112. package/dist/node/publications/comment-moderation/schema.d.ts +4 -4
  113. package/dist/node/publications/community-edit/schema.d.ts +4 -4
  114. package/dist/node/pubsub-messages/schema.d.ts +9 -9
  115. package/dist/node/rpc/src/index.d.ts +2 -0
  116. package/dist/node/rpc/src/index.js +22 -0
  117. package/dist/node/rpc/src/index.js.map +1 -1
  118. package/dist/node/rpc/src/lib/pkc-js/index.d.ts +4 -4
  119. package/dist/node/rpc/src/lib/pkc-js/index.js +3 -1
  120. package/dist/node/rpc/src/lib/pkc-js/index.js.map +1 -1
  121. package/dist/node/rpc/src/schema.d.ts +30 -30
  122. package/dist/node/runtime/node/community/db-handler.d.ts +6 -0
  123. package/dist/node/runtime/node/community/db-handler.js +38 -6
  124. package/dist/node/runtime/node/community/db-handler.js.map +1 -1
  125. package/dist/node/runtime/node/community/local-community/challenges.js +0 -2
  126. package/dist/node/runtime/node/community/local-community/challenges.js.map +1 -1
  127. package/dist/node/runtime/node/community/local-community/editing.d.ts +2 -1
  128. package/dist/node/runtime/node/community/local-community/editing.js +10 -7
  129. package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
  130. package/dist/node/runtime/node/community/local-community/ipns-publishing.js +3 -0
  131. package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  132. package/dist/node/runtime/node/community/local-community/lifecycle.js +7 -3
  133. package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
  134. package/dist/node/runtime/node/community/local-community/publication-store.js +23 -23
  135. package/dist/node/runtime/node/community/local-community/publication-store.js.map +1 -1
  136. package/dist/node/runtime/node/community/local-community/registry-sync.d.ts +7 -0
  137. package/dist/node/runtime/node/community/local-community/registry-sync.js +80 -0
  138. package/dist/node/runtime/node/community/local-community/registry-sync.js.map +1 -0
  139. package/dist/node/runtime/node/community/local-community.d.ts +2 -1
  140. package/dist/node/runtime/node/community/local-community.js +3 -0
  141. package/dist/node/runtime/node/community/local-community.js.map +1 -1
  142. package/dist/node/runtime/node/community/page-generator.js +11 -17
  143. package/dist/node/runtime/node/community/page-generator.js.map +1 -1
  144. package/dist/node/runtime/node/community/page-sorts/index.d.ts +9 -0
  145. package/dist/node/runtime/node/community/page-sorts/index.js +64 -6
  146. package/dist/node/runtime/node/community/page-sorts/index.js.map +1 -1
  147. package/dist/node/schema/schema-util.d.ts +12 -12
  148. package/dist/node/schema.d.ts +32 -32
  149. package/dist/node/test/test-util.d.ts +30 -30
  150. package/dist/node/validate-package-factories.d.ts +7 -0
  151. package/dist/node/validate-package-factories.js +37 -0
  152. package/dist/node/validate-package-factories.js.map +1 -0
  153. package/package.json +6 -1
@@ -0,0 +1,37 @@
1
+ import { PKCError } from "./pkc-error.js";
2
+ import { ChallengeFileFactorySchema, ChallengeFileSchema, PageSortFileFactorySchema } from "./community/schema.js";
3
+ import { validatePageSortFile } from "./pages/page-sort-scoring.js";
4
+ // For consumers that install challenge and page sort packages (bitsocial-cli's `challenge install` and
5
+ // `page-sort install`, issue #412): check a package's default export before registering it, with the same schemas
6
+ // the community applies when it loads the factory, so an installer can never accept what a community would reject.
7
+ // The factory is called once with only the name; a factory that needs options to construct is invalid anyway, since
8
+ // the RPC server lists every registered factory the same way.
9
+ export function validateChallengeFileFactory(factory, { name }) {
10
+ try {
11
+ ChallengeFileFactorySchema.parse(factory);
12
+ }
13
+ catch (error) {
14
+ throw new PKCError("ERR_FAILED_TO_IMPORT_CHALLENGE_FILE_FACTORY", { name, error });
15
+ }
16
+ try {
17
+ return ChallengeFileSchema.parse(factory({ challengeSettings: { name } }));
18
+ }
19
+ catch (error) {
20
+ throw new PKCError("ERR_CHALLENGE_FILE_INVALID", { name, error });
21
+ }
22
+ }
23
+ export function validatePageSortFileFactory(factory, { name }) {
24
+ try {
25
+ PageSortFileFactorySchema.parse(factory);
26
+ }
27
+ catch (error) {
28
+ throw new PKCError("ERR_FAILED_TO_IMPORT_PAGE_SORT_FILE_FACTORY", { name, error });
29
+ }
30
+ try {
31
+ return validatePageSortFile(factory({ pageSortSettings: { name } }));
32
+ }
33
+ catch (error) {
34
+ throw new PKCError("ERR_PAGE_SORT_FILE_INVALID", { name, error });
35
+ }
36
+ }
37
+ //# sourceMappingURL=validate-package-factories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-package-factories.js","sourceRoot":"","sources":["../../src/validate-package-factories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE,uGAAuG;AACvG,kHAAkH;AAClH,mHAAmH;AACnH,oHAAoH;AACpH,8DAA8D;AAE9D,MAAM,UAAU,4BAA4B,CAAC,OAAgB,EAAE,EAAE,IAAI,EAAoB;IACrF,IAAI,CAAC;QACD,0BAA0B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,QAAQ,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACvF,CAAC;IACD,IAAI,CAAC;QACD,OAAO,mBAAmB,CAAC,KAAK,CAC3B,OAAsE,CAAC,EAAE,iBAAiB,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAC3G,CAAC;IACN,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,QAAQ,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACtE,CAAC;AACL,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,OAAgB,EAAE,EAAE,IAAI,EAAoB;IACpF,IAAI,CAAC;QACD,yBAAyB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,QAAQ,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACvF,CAAC;IACD,IAAI,CAAC;QACD,OAAO,oBAAoB,CAAE,OAAqE,CAAC,EAAE,gBAAgB,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACxI,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,QAAQ,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACtE,CAAC;AACL,CAAC"}
@@ -2,7 +2,9 @@
2
2
  "outputs": {
3
3
  "challenges.js": {
4
4
  "isEntry": true,
5
- "imports": [],
5
+ "imports": [
6
+ "chunks/validate-package-factories-CxIg67oP.js"
7
+ ],
6
8
  "dynamicImports": [],
7
9
  "inputs": [
8
10
  "dist/node/challenges.js"
@@ -14,7 +16,7 @@
14
16
  "node:module"
15
17
  ],
16
18
  "dynamicImports": [
17
- "chunks/node-gyqBss4j.js"
19
+ "chunks/node-D5riLTOu.js"
18
20
  ],
19
21
  "inputs": [
20
22
  "dist/node/runtime/node/compile-cache.js",
@@ -24,18 +26,28 @@
24
26
  "index.js": {
25
27
  "isEntry": true,
26
28
  "imports": [
27
- "chunks/node-gyqBss4j.js"
29
+ "chunks/node-D5riLTOu.js"
28
30
  ],
29
31
  "dynamicImports": [],
30
32
  "inputs": []
31
33
  },
34
+ "page-sorts.js": {
35
+ "isEntry": true,
36
+ "imports": [
37
+ "chunks/validate-package-factories-CxIg67oP.js"
38
+ ],
39
+ "dynamicImports": [],
40
+ "inputs": [
41
+ "dist/node/page-sorts.js"
42
+ ]
43
+ },
32
44
  "rpc/src/index.js": {
33
45
  "isEntry": true,
34
46
  "imports": [
35
- "chunks/rpc-local-community-DWv8wZMB.js",
36
- "chunks/node-gyqBss4j.js",
37
- "chunks/util-B9JenRyE.js",
38
- "chunks/local-community-CaV30etW.js",
47
+ "chunks/rpc-local-community-D5ZdqFYc.js",
48
+ "chunks/node-D5riLTOu.js",
49
+ "chunks/util-CabVOL7E.js",
50
+ "chunks/local-community-XrLSKipf.js",
39
51
  "node:url",
40
52
  "path",
41
53
  "assert",
@@ -65,12 +77,12 @@
65
77
  "\u0000rolldown/runtime.js"
66
78
  ]
67
79
  },
68
- "chunks/helia-for-pkc-DoOp7t8V.js": {
80
+ "chunks/helia-for-pkc-BB8P6KYw.js": {
69
81
  "isEntry": false,
70
82
  "imports": [
71
83
  "chunks/chunk-2rV9d50f.js",
72
- "chunks/util-B9JenRyE.js",
73
- "chunks/util-CH8WrVZq.js",
84
+ "chunks/util-CabVOL7E.js",
85
+ "chunks/util-Cnpgfqwn.js",
74
86
  "chunks/src-DKntVmyX.js",
75
87
  "chunks/src-Cpx2Sts8.js",
76
88
  "node:url",
@@ -189,20 +201,13 @@
189
201
  "dist/node/helia/helia-for-pkc.js"
190
202
  ]
191
203
  },
192
- "chunks/local-community-CFX753RE.js": {
193
- "isEntry": false,
194
- "imports": [
195
- "chunks/local-community-CaV30etW.js"
196
- ],
197
- "dynamicImports": [],
198
- "inputs": []
199
- },
200
- "chunks/local-community-CaV30etW.js": {
204
+ "chunks/local-community-XrLSKipf.js": {
201
205
  "isEntry": false,
202
206
  "imports": [
203
207
  "chunks/chunk-2rV9d50f.js",
204
- "chunks/rpc-local-community-DWv8wZMB.js",
205
- "chunks/util-B9JenRyE.js",
208
+ "chunks/rpc-local-community-D5ZdqFYc.js",
209
+ "chunks/util-CabVOL7E.js",
210
+ "chunks/page-sort-scoring-3svUUHW_.js",
206
211
  "node:crypto",
207
212
  "node:url",
208
213
  "node:path",
@@ -252,6 +257,7 @@
252
257
  "dist/node/runtime/node/community/local-community/publication-validation.js",
253
258
  "dist/node/runtime/node/community/local-community/publication-store.js",
254
259
  "dist/node/runtime/node/community/local-community/pubsub.js",
260
+ "dist/node/runtime/node/community/local-community/registry-sync.js",
255
261
  "dist/node/runtime/node/community/local-community/ipns-publishing.js",
256
262
  "dist/node/runtime/node/community/local-community/reprovide-on-address-change.js",
257
263
  "dist/node/runtime/node/community/local-community/lifecycle.js",
@@ -260,13 +266,21 @@
260
266
  "dist/node/runtime/node/community/local-community.js"
261
267
  ]
262
268
  },
263
- "chunks/node-gyqBss4j.js": {
269
+ "chunks/local-community-wAvG_J_u.js": {
270
+ "isEntry": false,
271
+ "imports": [
272
+ "chunks/local-community-XrLSKipf.js"
273
+ ],
274
+ "dynamicImports": [],
275
+ "inputs": []
276
+ },
277
+ "chunks/node-D5riLTOu.js": {
264
278
  "isEntry": false,
265
279
  "imports": [
266
280
  "chunks/chunk-2rV9d50f.js",
267
- "chunks/rpc-local-community-DWv8wZMB.js",
268
- "chunks/util-B9JenRyE.js",
269
- "chunks/util-CH8WrVZq.js",
281
+ "chunks/rpc-local-community-D5ZdqFYc.js",
282
+ "chunks/util-CabVOL7E.js",
283
+ "chunks/util-Cnpgfqwn.js",
270
284
  "path",
271
285
  "assert",
272
286
  "fs",
@@ -277,8 +291,8 @@
277
291
  "rpc-websockets"
278
292
  ],
279
293
  "dynamicImports": [
280
- "chunks/helia-for-pkc-DoOp7t8V.js",
281
- "chunks/local-community-CaV30etW.js"
294
+ "chunks/helia-for-pkc-BB8P6KYw.js",
295
+ "chunks/local-community-XrLSKipf.js"
282
296
  ],
283
297
  "inputs": [
284
298
  "node_modules/zod/v4/locales/en.js",
@@ -325,11 +339,22 @@
325
339
  "dist/node/index.js"
326
340
  ]
327
341
  },
328
- "chunks/rpc-local-community-DWv8wZMB.js": {
342
+ "chunks/page-sort-scoring-3svUUHW_.js": {
343
+ "isEntry": false,
344
+ "imports": [
345
+ "chunks/util-CabVOL7E.js"
346
+ ],
347
+ "dynamicImports": [],
348
+ "inputs": [
349
+ "dist/node/pages/page-sort-scoring.js"
350
+ ]
351
+ },
352
+ "chunks/rpc-local-community-D5ZdqFYc.js": {
329
353
  "isEntry": false,
330
354
  "imports": [
331
355
  "chunks/chunk-2rV9d50f.js",
332
- "chunks/util-B9JenRyE.js",
356
+ "chunks/util-CabVOL7E.js",
357
+ "chunks/page-sort-scoring-3svUUHW_.js",
333
358
  "chunks/src-CYIMjhjK.js",
334
359
  "node:crypto",
335
360
  "node:url",
@@ -875,7 +900,6 @@
875
900
  "dist/node/runtime/node/community/challenges/pkc-js-challenges/publication-match.js",
876
901
  "dist/node/runtime/node/community/challenges/validate-challenge-result.js",
877
902
  "dist/node/runtime/node/community/challenges/index.js",
878
- "dist/node/pages/page-sort-scoring.js",
879
903
  "dist/node/pages/page-sort-options.js",
880
904
  "dist/node/pages/pkc-js-page-sorts/util.js",
881
905
  "dist/node/pages/pkc-js-page-sorts/hot.js",
@@ -1278,7 +1302,7 @@
1278
1302
  "node_modules/it-parallel-batch/dist/src/index.js"
1279
1303
  ]
1280
1304
  },
1281
- "chunks/util-B9JenRyE.js": {
1305
+ "chunks/util-CabVOL7E.js": {
1282
1306
  "isEntry": false,
1283
1307
  "imports": [
1284
1308
  "chunks/chunk-2rV9d50f.js",
@@ -1372,10 +1396,10 @@
1372
1396
  "dist/node/util.js"
1373
1397
  ]
1374
1398
  },
1375
- "chunks/util-CH8WrVZq.js": {
1399
+ "chunks/util-Cnpgfqwn.js": {
1376
1400
  "isEntry": false,
1377
1401
  "imports": [
1378
- "chunks/util-B9JenRyE.js",
1402
+ "chunks/util-CabVOL7E.js",
1379
1403
  "ipns/selector",
1380
1404
  "ipns/validator",
1381
1405
  "ipns",
@@ -1385,6 +1409,17 @@
1385
1409
  "inputs": [
1386
1410
  "dist/node/helia/util.js"
1387
1411
  ]
1412
+ },
1413
+ "chunks/validate-package-factories-CxIg67oP.js": {
1414
+ "isEntry": false,
1415
+ "imports": [
1416
+ "chunks/util-CabVOL7E.js",
1417
+ "chunks/page-sort-scoring-3svUUHW_.js"
1418
+ ],
1419
+ "dynamicImports": [],
1420
+ "inputs": [
1421
+ "dist/node/validate-package-factories.js"
1422
+ ]
1388
1423
  }
1389
1424
  }
1390
1425
  }
@@ -1 +1,2 @@
1
- export {};
1
+ import { t as validateChallengeFileFactory } from "./chunks/validate-package-factories-CxIg67oP.js";
2
+ export { validateChallengeFileFactory };
@@ -1,12 +1,12 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { Ar as PKCError, Mr as logger_default, S as hideClassPrivateProps, n as binaryKeyToPubsubTopic, w as ipnsNameToIpnsOverPubsubTopic } from "./util-B9JenRyE.js";
3
- import { a as directFetchIpnsRecordFromProviders, c as readFreshCachedIpnsRecordFromPubsubLocalStore, i as connectToPubsubPeers, l as selectBitswapSessionSeedPeers, n as REACHABILITY_DOCS_URL, o as fetchBlockWithStalledSessionFailover, r as cacheIpnsRecordInPubsubLocalStore, s as getHeliaDebugContext, u as summarizeProviderReachability } from "./util-CH8WrVZq.js";
2
+ import { Ar as PKCError, Mr as logger_default, S as hideClassPrivateProps, n as binaryKeyToPubsubTopic, w as ipnsNameToIpnsOverPubsubTopic } from "./util-CabVOL7E.js";
3
+ import { a as directFetchIpnsRecordFromProviders, c as readFreshCachedIpnsRecordFromPubsubLocalStore, i as connectToPubsubPeers, l as selectBitswapSessionSeedPeers, n as REACHABILITY_DOCS_URL, o as fetchBlockWithStalledSessionFailover, r as cacheIpnsRecordInPubsubLocalStore, s as getHeliaDebugContext, u as summarizeProviderReachability } from "./util-Cnpgfqwn.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
7
  import fsp, { rename, writeFile } from "node:fs/promises";
8
- import Path, { basename, dirname, join } from "node:path";
9
- import path from "path";
8
+ import path, { basename, dirname, join } from "node:path";
9
+ import path$1 from "path";
10
10
  import { CID } from "multiformats/cid";
11
11
  import { peerIdFromString } from "@libp2p/peer-id";
12
12
  import * as Digest from "multiformats/hashes/digest";
@@ -151,7 +151,7 @@ var require_path = /* @__PURE__ */ __commonJSMin(((exports) => {
151
151
  Object.defineProperty(exports, "__esModule", { value: true });
152
152
  exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
153
153
  const os$1 = __require("os");
154
- const path$9 = __require("path");
154
+ const path$10 = __require("path");
155
155
  const IS_WINDOWS_PLATFORM = os$1.platform() === "win32";
156
156
  const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
157
157
  /**
@@ -180,7 +180,7 @@ var require_path = /* @__PURE__ */ __commonJSMin(((exports) => {
180
180
  }
181
181
  exports.unixify = unixify;
182
182
  function makeAbsolute(cwd, filepath) {
183
- return path$9.resolve(cwd, filepath);
183
+ return path$10.resolve(cwd, filepath);
184
184
  }
185
185
  exports.makeAbsolute = makeAbsolute;
186
186
  function removeLeadingDotSegment(entry) {
@@ -1432,7 +1432,7 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1432
1432
  //#endregion
1433
1433
  //#region node_modules/picomatch/lib/constants.js
1434
1434
  var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1435
- const path$8 = __require("path");
1435
+ const path$9 = __require("path");
1436
1436
  const WIN_SLASH = "\\\\/";
1437
1437
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1438
1438
  const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
@@ -1557,7 +1557,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1557
1557
  CHAR_UNDERSCORE: 95,
1558
1558
  CHAR_VERTICAL_LINE: 124,
1559
1559
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
1560
- SEP: path$8.sep,
1560
+ SEP: path$9.sep,
1561
1561
  /**
1562
1562
  * Create EXTGLOB_CHARS
1563
1563
  */
@@ -1601,7 +1601,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1601
1601
  //#endregion
1602
1602
  //#region node_modules/picomatch/lib/utils.js
1603
1603
  var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
1604
- const path$7 = __require("path");
1604
+ const path$8 = __require("path");
1605
1605
  const win32 = process.platform === "win32";
1606
1606
  const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
1607
1607
  exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
@@ -1621,7 +1621,7 @@ var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
1621
1621
  };
1622
1622
  exports.isWindows = (options) => {
1623
1623
  if (options && typeof options.windows === "boolean") return options.windows;
1624
- return win32 === true || path$7.sep === "\\";
1624
+ return win32 === true || path$8.sep === "\\";
1625
1625
  };
1626
1626
  exports.escapeLast = (input, char, lastIdx) => {
1627
1627
  const idx = input.lastIndexOf(char, lastIdx);
@@ -2991,7 +2991,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2991
2991
  //#endregion
2992
2992
  //#region node_modules/picomatch/lib/picomatch.js
2993
2993
  var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2994
- const path$6 = __require("path");
2994
+ const path$7 = __require("path");
2995
2995
  const scan = require_scan();
2996
2996
  const parse = require_parse();
2997
2997
  const utils = require_utils$2();
@@ -3130,7 +3130,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3130
3130
  * @api public
3131
3131
  */
3132
3132
  picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
3133
- return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path$6.basename(input));
3133
+ return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path$7.basename(input));
3134
3134
  };
3135
3135
  /**
3136
3136
  * Returns true if **any** of the given glob `patterns` match the specified `string`.
@@ -3685,7 +3685,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3685
3685
  var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
3686
3686
  Object.defineProperty(exports, "__esModule", { value: true });
3687
3687
  exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
3688
- const path$5 = __require("path");
3688
+ const path$6 = __require("path");
3689
3689
  const globParent = require_glob_parent();
3690
3690
  const micromatch = require_micromatch();
3691
3691
  const GLOBSTAR = "**";
@@ -3793,7 +3793,7 @@ var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
3793
3793
  }
3794
3794
  exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
3795
3795
  function isAffectDepthOfReadingPattern(pattern) {
3796
- const basename = path$5.basename(pattern);
3796
+ const basename = path$6.basename(pattern);
3797
3797
  return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
3798
3798
  }
3799
3799
  exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
@@ -3867,7 +3867,7 @@ var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
3867
3867
  }
3868
3868
  exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
3869
3869
  function isAbsolute(pattern) {
3870
- return path$5.isAbsolute(pattern);
3870
+ return path$6.isAbsolute(pattern);
3871
3871
  }
3872
3872
  exports.isAbsolute = isAbsolute;
3873
3873
  }));
@@ -4495,7 +4495,7 @@ var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
4495
4495
  //#region node_modules/@nodelib/fs.scandir/out/settings.js
4496
4496
  var require_settings$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
4497
4497
  Object.defineProperty(exports, "__esModule", { value: true });
4498
- const path$4 = __require("path");
4498
+ const path$5 = __require("path");
4499
4499
  const fsStat = require_out$3();
4500
4500
  const fs = require_fs();
4501
4501
  var Settings = class {
@@ -4503,7 +4503,7 @@ var require_settings$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
4503
4503
  this._options = _options;
4504
4504
  this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
4505
4505
  this.fs = fs.createFileSystemAdapter(this._options.fs);
4506
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
4506
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$5.sep);
4507
4507
  this.stats = this._getValue(this._options.stats, false);
4508
4508
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
4509
4509
  this.fsStatSettings = new fsStat.Settings({
@@ -5097,7 +5097,7 @@ var require_sync$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
5097
5097
  //#region node_modules/@nodelib/fs.walk/out/settings.js
5098
5098
  var require_settings$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
5099
5099
  Object.defineProperty(exports, "__esModule", { value: true });
5100
- const path$3 = __require("path");
5100
+ const path$4 = __require("path");
5101
5101
  const fsScandir = require_out$2();
5102
5102
  var Settings = class {
5103
5103
  constructor(_options = {}) {
@@ -5107,7 +5107,7 @@ var require_settings$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
5107
5107
  this.deepFilter = this._getValue(this._options.deepFilter, null);
5108
5108
  this.entryFilter = this._getValue(this._options.entryFilter, null);
5109
5109
  this.errorFilter = this._getValue(this._options.errorFilter, null);
5110
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$3.sep);
5110
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
5111
5111
  this.fsScandirSettings = new fsScandir.Settings({
5112
5112
  followSymbolicLinks: this._options.followSymbolicLinks,
5113
5113
  fs: this._options.fs,
@@ -5159,7 +5159,7 @@ var require_out$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
5159
5159
  //#region node_modules/fast-glob/out/readers/reader.js
5160
5160
  var require_reader = /* @__PURE__ */ __commonJSMin(((exports) => {
5161
5161
  Object.defineProperty(exports, "__esModule", { value: true });
5162
- const path$2 = __require("path");
5162
+ const path$3 = __require("path");
5163
5163
  const fsStat = require_out$3();
5164
5164
  const utils = require_utils$1();
5165
5165
  var Reader = class {
@@ -5172,7 +5172,7 @@ var require_reader = /* @__PURE__ */ __commonJSMin(((exports) => {
5172
5172
  });
5173
5173
  }
5174
5174
  _getFullEntryPath(filepath) {
5175
- return path$2.resolve(this._settings.cwd, filepath);
5175
+ return path$3.resolve(this._settings.cwd, filepath);
5176
5176
  }
5177
5177
  _makeEntry(stats, pattern) {
5178
5178
  const entry = {
@@ -5507,7 +5507,7 @@ var require_entry = /* @__PURE__ */ __commonJSMin(((exports) => {
5507
5507
  //#region node_modules/fast-glob/out/providers/provider.js
5508
5508
  var require_provider = /* @__PURE__ */ __commonJSMin(((exports) => {
5509
5509
  Object.defineProperty(exports, "__esModule", { value: true });
5510
- const path$1 = __require("path");
5510
+ const path$2 = __require("path");
5511
5511
  const deep_1 = require_deep();
5512
5512
  const entry_1 = require_entry$1();
5513
5513
  const error_1 = require_error();
@@ -5521,7 +5521,7 @@ var require_provider = /* @__PURE__ */ __commonJSMin(((exports) => {
5521
5521
  this.entryTransformer = new entry_2.default(this._settings);
5522
5522
  }
5523
5523
  _getRootDirectory(task) {
5524
- return path$1.resolve(this._settings.cwd, task.base);
5524
+ return path$2.resolve(this._settings.cwd, task.base);
5525
5525
  }
5526
5526
  _getReaderOptions(task) {
5527
5527
  const basePath = task.base === "." ? "" : task.base;
@@ -5852,7 +5852,7 @@ var import_out = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((export
5852
5852
  * Async iterable filename pattern matcher
5853
5853
  */
5854
5854
  async function* glob(dir, pattern, options = {}) {
5855
- const absoluteDir = Path.resolve(dir);
5855
+ const absoluteDir = path.resolve(dir);
5856
5856
  const stats = await fsp.stat(absoluteDir);
5857
5857
  for await (const entry of import_out.default.stream(pattern, {
5858
5858
  ...options,
@@ -6022,7 +6022,7 @@ var NextToLast = class {
6022
6022
  };
6023
6023
  }
6024
6024
  decode(str) {
6025
- let fileName = Path.basename(str);
6025
+ let fileName = path.basename(str);
6026
6026
  if (fileName.endsWith(this.extension)) fileName = fileName.substring(0, fileName.length - this.extension.length);
6027
6027
  return CID.decode(this.base.decoder.decode(fileName));
6028
6028
  }
@@ -6048,7 +6048,7 @@ var NextToLast = class {
6048
6048
  async function writeFile$1(file, contents, options) {
6049
6049
  try {
6050
6050
  options?.signal?.throwIfAborted();
6051
- await raceSignal(fsp.mkdir(Path.dirname(file), { recursive: true }), options?.signal);
6051
+ await raceSignal(fsp.mkdir(path.dirname(file), { recursive: true }), options?.signal);
6052
6052
  const writer = new Writer(file);
6053
6053
  options?.signal?.throwIfAborted();
6054
6054
  await writer.write(contents);
@@ -6073,7 +6073,7 @@ var FsBlockstore = class {
6073
6073
  deleteManyConcurrency;
6074
6074
  shardingStrategy;
6075
6075
  constructor(location, init = {}) {
6076
- this.path = Path.resolve(location);
6076
+ this.path = path.resolve(location);
6077
6077
  this.createIfMissing = init.createIfMissing ?? true;
6078
6078
  this.errorIfExists = init.errorIfExists ?? false;
6079
6079
  this.deleteManyConcurrency = init.deleteManyConcurrency ?? 50;
@@ -6099,7 +6099,7 @@ var FsBlockstore = class {
6099
6099
  async put(key, val, options) {
6100
6100
  const { dir, file } = this.shardingStrategy.encode(key);
6101
6101
  try {
6102
- await writeFile$1(Path.join(this.path, dir, file), val, options);
6102
+ await writeFile$1(path.join(this.path, dir, file), val, options);
6103
6103
  return key;
6104
6104
  } catch (err) {
6105
6105
  throw new PutFailedError(String(err));
@@ -6118,7 +6118,7 @@ var FsBlockstore = class {
6118
6118
  let handle;
6119
6119
  try {
6120
6120
  options?.signal?.throwIfAborted();
6121
- handle = await raceSignal(fsp.open(Path.join(this.path, dir, file)), options?.signal);
6121
+ handle = await raceSignal(fsp.open(path.join(this.path, dir, file)), options?.signal);
6122
6122
  yield* handle.createReadStream();
6123
6123
  } catch (err) {
6124
6124
  if (handle != null) await raceSignal(handle.close(), options?.signal);
@@ -6139,7 +6139,7 @@ var FsBlockstore = class {
6139
6139
  const { dir, file } = this.shardingStrategy.encode(key);
6140
6140
  try {
6141
6141
  options?.signal?.throwIfAborted();
6142
- await raceSignal(fsp.unlink(Path.join(this.path, dir, file)), options?.signal);
6142
+ await raceSignal(fsp.unlink(path.join(this.path, dir, file)), options?.signal);
6143
6143
  } catch (err) {
6144
6144
  if (err.code === "ENOENT") return;
6145
6145
  throw new DeleteFailedError(String(err));
@@ -6157,14 +6157,14 @@ var FsBlockstore = class {
6157
6157
  const { dir, file } = this.shardingStrategy.encode(key);
6158
6158
  try {
6159
6159
  options?.signal?.throwIfAborted();
6160
- await raceSignal(fsp.access(Path.join(this.path, dir, file)), options?.signal);
6160
+ await raceSignal(fsp.access(path.join(this.path, dir, file)), options?.signal);
6161
6161
  } catch (err) {
6162
6162
  return false;
6163
6163
  }
6164
6164
  return true;
6165
6165
  }
6166
6166
  async *getAll(options) {
6167
- const pattern = `**/*${this.shardingStrategy.extension}`.split(Path.sep).join("/");
6167
+ const pattern = `**/*${this.shardingStrategy.extension}`.split(path.sep).join("/");
6168
6168
  const files = glob(this.path, pattern, { absolute: true });
6169
6169
  for await (const file of files) try {
6170
6170
  options?.signal?.throwIfAborted();
@@ -6216,7 +6216,7 @@ async function createBlockstoreForLibp2pJsClient({ dataPath, key }) {
6216
6216
  defaultMaxBytes: DEFAULT_IN_MEMORY_BLOCKSTORE_MAX_BYTES,
6217
6217
  close: async () => {}
6218
6218
  };
6219
- const store = new FsBlockstore(path.join(dataPath, "blockstore", key));
6219
+ const store = new FsBlockstore(path$1.join(dataPath, "blockstore", key));
6220
6220
  await store.open();
6221
6221
  return {
6222
6222
  blockstore: store,