@ghostlytools/cli 1.11.3 → 1.12.0

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 (218) hide show
  1. package/README.md +52 -30
  2. package/SKILL.md +4 -2
  3. package/dist/assets/{api-DBlaoz8i.js → api-DLzCtePC.js} +533 -195
  4. package/dist/assets/api-DLzCtePC.js.map +1 -0
  5. package/dist/assets/{api-DgU4MZPD.js → api-DYMKyb1k.js} +2 -2
  6. package/dist/assets/{apiKit-DesObIDf.js → apiKit-CVaEzKWQ.js} +104 -21
  7. package/dist/assets/apiKit-CVaEzKWQ.js.map +1 -0
  8. package/dist/assets/appFetch-D56GsYuq.js +602 -0
  9. package/dist/assets/appFetch-D56GsYuq.js.map +1 -0
  10. package/dist/assets/apps-BPFW19Wc.js +1 -0
  11. package/dist/assets/{apps-DkMjDHML.js → apps-XnZ8VEuj.js} +66 -38
  12. package/dist/assets/apps-XnZ8VEuj.js.map +1 -0
  13. package/dist/assets/{argon2id-088uQfnH.js → argon2id-B9wFdSj6.js} +2 -3
  14. package/dist/assets/{argon2id-088uQfnH.js.map → argon2id-B9wFdSj6.js.map} +1 -1
  15. package/dist/assets/{arkade-CarKONmH.js → arkade-DryM-q5n.js} +6 -7
  16. package/dist/assets/arkade-DryM-q5n.js.map +1 -0
  17. package/dist/assets/backup-COX6j1_W.js +1 -0
  18. package/dist/assets/{backup-C0OJCJlM.js → backup-DpyvT9Z6.js} +108 -50
  19. package/dist/assets/backup-DpyvT9Z6.js.map +1 -0
  20. package/dist/assets/bark_ffi_wasm_bg-CcafsJla.js +5 -0
  21. package/dist/assets/{bark_ffi_wasm_bg-EY2uc0Bx.js.map → bark_ffi_wasm_bg-CcafsJla.js.map} +1 -1
  22. package/dist/assets/{bark_ffi_wasm_bg-Bxru_BVW.wasm → bark_ffi_wasm_bg-VNmaJsc9.wasm} +0 -0
  23. package/dist/assets/{bitcoind-CdSmvy2y.js → bitcoind-DTsrd7TF.js} +4 -5
  24. package/dist/assets/{bitcoind-CdSmvy2y.js.map → bitcoind-DTsrd7TF.js.map} +1 -1
  25. package/dist/assets/bitcoindevkit_bg-BWQHx7vd.js +5 -0
  26. package/dist/assets/{bitcoindevkit_bg-B-iLWrmX.js.map → bitcoindevkit_bg-BWQHx7vd.js.map} +1 -1
  27. package/dist/assets/bitcoindevkit_bg-DXil67yS.wasm +0 -0
  28. package/dist/assets/{blobFiles-BmsrvZc3.js → blobFiles-DDs34n0r.js} +4 -5
  29. package/dist/assets/{blobFiles-BmsrvZc3.js.map → blobFiles-DDs34n0r.js.map} +1 -1
  30. package/dist/assets/breez_sdk_spark_wasm_bg.wasm +0 -0
  31. package/dist/assets/buttons-Bq7pTXqF.js +1 -0
  32. package/dist/assets/{buttons-fZTEa_2i.js → buttons-BvWqHJeh.js} +46 -23
  33. package/dist/assets/buttons-BvWqHJeh.js.map +1 -0
  34. package/dist/assets/bytes-C1DNGY18.js +132 -0
  35. package/dist/assets/bytes-C1DNGY18.js.map +1 -0
  36. package/dist/assets/{childEnv-K_IzUqQx.js → childEnv-C-99hdbL.js} +2 -3
  37. package/dist/assets/{childEnv-K_IzUqQx.js.map → childEnv-C-99hdbL.js.map} +1 -1
  38. package/dist/assets/{client-Ibk3-e60.js → client-kGZ3ZdUW.js} +30 -13
  39. package/dist/assets/client-kGZ3ZdUW.js.map +1 -0
  40. package/dist/assets/{codec-DMpQqVSt.js → codec-B2rH1mfx.js} +2 -4
  41. package/dist/assets/{codec-DMpQqVSt.js.map → codec-B2rH1mfx.js.map} +1 -1
  42. package/dist/assets/domainProofs-BDNP1dIy.js +280 -0
  43. package/dist/assets/domainProofs-BDNP1dIy.js.map +1 -0
  44. package/dist/assets/{endpoint-DarqblYE.js → endpoint-B0vE5ojY.js} +421 -420
  45. package/dist/assets/endpoint-B0vE5ojY.js.map +1 -0
  46. package/dist/assets/engineErrors--9hfgKlK.js +150 -0
  47. package/dist/assets/engineErrors--9hfgKlK.js.map +1 -0
  48. package/dist/assets/{envelope-CvQVCGdf.js → envelope-Bi2kMqbp.js} +3 -4
  49. package/dist/assets/{envelope-CvQVCGdf.js.map → envelope-Bi2kMqbp.js.map} +1 -1
  50. package/dist/assets/{errors-Dt-ZnyOX.js → errors-DDLFO4Gf.js} +31 -5
  51. package/dist/assets/errors-DDLFO4Gf.js.map +1 -0
  52. package/dist/assets/{fedimintSdk-zV_5Qdqz.js → fedimintSdk-D-6H9Pe7.js} +4 -5
  53. package/dist/assets/{fedimintSdk-zV_5Qdqz.js.map → fedimintSdk-D-6H9Pe7.js.map} +1 -1
  54. package/dist/assets/fedimint_client_wasm_bg-Cr5xGD-w.js +5 -0
  55. package/dist/assets/{fedimint_client_wasm_bg-BtHHlFpp.js.map → fedimint_client_wasm_bg-Cr5xGD-w.js.map} +1 -1
  56. package/dist/assets/fileBytes-CCKbwqG_.js +1 -0
  57. package/dist/assets/{fileBytes-BLPZq9YU.js → fileBytes-CfvUXdSy.js} +5 -7
  58. package/dist/assets/fileBytes-CfvUXdSy.js.map +1 -0
  59. package/dist/assets/{fileBytes-B0z9A6Le.js → fileBytes-tj6-VZcB.js} +3 -4
  60. package/dist/assets/{fileBytes-B0z9A6Le.js.map → fileBytes-tj6-VZcB.js.map} +1 -1
  61. package/dist/assets/fileBytesIdb-B0zzJ6p7.js +1 -0
  62. package/dist/assets/{fileBytesIdb-Bmlrl9EO.js → fileBytesIdb-BJirUAjI.js} +4 -5
  63. package/dist/assets/{fileBytesIdb-Bmlrl9EO.js.map → fileBytesIdb-BJirUAjI.js.map} +1 -1
  64. package/dist/assets/{fileBytesOpfs-DBS0kbPT.js → fileBytesOpfs-DRUYLER4.js} +4 -5
  65. package/dist/assets/{fileBytesOpfs-DBS0kbPT.js.map → fileBytesOpfs-DRUYLER4.js.map} +1 -1
  66. package/dist/assets/{fixedHosts-6gKn8dp2.js → fixedHosts-CPSsGOI2.js} +4 -5
  67. package/dist/assets/{fixedHosts-6gKn8dp2.js.map → fixedHosts-CPSsGOI2.js.map} +1 -1
  68. package/dist/assets/{ghostly_iroh_web-BzAXJUYH.js → ghostly_iroh_web-DIj5xGmR.js} +2 -3
  69. package/dist/assets/{ghostly_iroh_web-BzAXJUYH.js.map → ghostly_iroh_web-DIj5xGmR.js.map} +1 -1
  70. package/dist/assets/{src-DjVj2ynY.js → groupMeta-DTQAJG50.js} +4879 -23799
  71. package/dist/assets/groupMeta-DTQAJG50.js.map +1 -0
  72. package/dist/assets/{host-CYlIiY3r.js → host-z0FAHP9Z.js} +750 -245
  73. package/dist/assets/host-z0FAHP9Z.js.map +1 -0
  74. package/dist/assets/{hyperdhtRelay-CdsLcAhY.js → hyperdhtRelay-CvsAfQRQ.js} +5 -6
  75. package/dist/assets/hyperdhtRelay-CvsAfQRQ.js.map +1 -0
  76. package/dist/assets/hyperdhtRelay-bjNGacf5.js +32 -0
  77. package/dist/assets/hyperdhtRelay-bjNGacf5.js.map +1 -0
  78. package/dist/assets/{idb-CEuoNsTv.js → idb-ewvbqyDI.js} +2 -3
  79. package/dist/assets/{idb-CEuoNsTv.js.map → idb-ewvbqyDI.js.map} +1 -1
  80. package/dist/assets/identityProofs-Cksc_K7_.js +940 -0
  81. package/dist/assets/identityProofs-Cksc_K7_.js.map +1 -0
  82. package/dist/assets/{irohWeb-D2IuloLL.js → irohWeb-CLBx5MIv.js} +3061 -86
  83. package/dist/assets/irohWeb-CLBx5MIv.js.map +1 -0
  84. package/dist/assets/joinTrace-CBr1jbch.js +1 -0
  85. package/dist/assets/{joinTrace-CjRDFy85.js → joinTrace-xKBe73j9.js} +2 -3
  86. package/dist/assets/{joinTrace-CjRDFy85.js.map → joinTrace-xKBe73j9.js.map} +1 -1
  87. package/dist/assets/{legacy_ciphers-JJOu0JXL.js → legacy_ciphers-BnYATjxo.js} +2 -3
  88. package/dist/assets/{legacy_ciphers-JJOu0JXL.js.map → legacy_ciphers-BnYATjxo.js.map} +1 -1
  89. package/dist/assets/linkPreview-DdMf-YAc.js +252 -0
  90. package/dist/assets/linkPreview-DdMf-YAc.js.map +1 -0
  91. package/dist/assets/{main-C0PfjKTe.js → main-CVqkvuIo.js} +536 -173
  92. package/dist/assets/main-CVqkvuIo.js.map +1 -0
  93. package/dist/assets/{mainline-Cu61qcPS.js → mainline-CVrd0C1n.js} +72 -18
  94. package/dist/assets/mainline-CVrd0C1n.js.map +1 -0
  95. package/dist/assets/mints-BcBODVVW.js +1 -0
  96. package/dist/assets/{mints-j5XAOk4f.js → mints-CMDLbMeH.js} +8 -6
  97. package/dist/assets/mints-CMDLbMeH.js.map +1 -0
  98. package/dist/assets/{nacl-fast-CDhNCYHs.js → nacl-fast-B1ThWvuM.js} +2 -3
  99. package/dist/assets/{nacl-fast-CDhNCYHs.js.map → nacl-fast-B1ThWvuM.js.map} +1 -1
  100. package/dist/assets/{networkReason-Dt7Yx_n4.js → networkReason-Be-hMghr.js} +10 -14
  101. package/dist/assets/{networkReason-Dt7Yx_n4.js.map → networkReason-Be-hMghr.js.map} +1 -1
  102. package/dist/assets/{noble_curves-DDWn5AH0.js → noble_curves-DqpNlhAU.js} +3 -4
  103. package/dist/assets/{noble_curves-DDWn5AH0.js.map → noble_curves-DqpNlhAU.js.map} +1 -1
  104. package/dist/assets/{noble_hashes-B7AZyFyS.js → noble_hashes-LFe1N2xt.js} +3 -4
  105. package/dist/assets/{noble_hashes-B7AZyFyS.js.map → noble_hashes-LFe1N2xt.js.map} +1 -1
  106. package/dist/assets/{nwc-CtZypDcv.js → nwc-DKE2FXr6.js} +5 -6
  107. package/dist/assets/{nwc-CtZypDcv.js.map → nwc-DKE2FXr6.js.map} +1 -1
  108. package/dist/assets/nwcProvider-pL2XqSbW.js +208 -0
  109. package/dist/assets/nwcProvider-pL2XqSbW.js.map +1 -0
  110. package/dist/assets/{openpgp-BBFr-zHQ.js → openpgp-LkR_Zof0.js} +14 -15
  111. package/dist/assets/{openpgp-BBFr-zHQ.js.map → openpgp-LkR_Zof0.js.map} +1 -1
  112. package/dist/assets/ownDid-DY3rYqDI.js +862 -0
  113. package/dist/assets/ownDid-DY3rYqDI.js.map +1 -0
  114. package/dist/assets/{ownStatus-D4HC6tNR.js → ownStatus-DMEhrpkd.js} +81 -19
  115. package/dist/assets/ownStatus-DMEhrpkd.js.map +1 -0
  116. package/dist/assets/pairedTransports-BKmvlKz1.js +581 -0
  117. package/dist/assets/pairedTransports-BKmvlKz1.js.map +1 -0
  118. package/dist/assets/paymentIntent-DySU3Ajm.js +349 -0
  119. package/dist/assets/paymentIntent-DySU3Ajm.js.map +1 -0
  120. package/dist/assets/pkarr-BQo4PcCg.js +367 -0
  121. package/dist/assets/pkarr-BQo4PcCg.js.map +1 -0
  122. package/dist/assets/{profiles-Ccdq6Xf6.js → profiles-BFSGqDFC.js} +30 -16
  123. package/dist/assets/profiles-BFSGqDFC.js.map +1 -0
  124. package/dist/assets/registry-B15Yg_1C.js +1 -0
  125. package/dist/assets/{registry-LvxsLJ5S.js → registry-rXgaZeNn.js} +1273 -58
  126. package/dist/assets/registry-rXgaZeNn.js.map +1 -0
  127. package/dist/assets/relay-Cjfmdec0.js +2219 -0
  128. package/dist/assets/relay-Cjfmdec0.js.map +1 -0
  129. package/dist/assets/resolve-CIc3KZMV.js +970 -0
  130. package/dist/assets/resolve-CIc3KZMV.js.map +1 -0
  131. package/dist/assets/{restoredRows-C3LcxmOw.js → restoredRows-D_WSHE7H.js} +3 -4
  132. package/dist/assets/{restoredRows-C3LcxmOw.js.map → restoredRows-D_WSHE7H.js.map} +1 -1
  133. package/dist/assets/{secretGuard-B7Hj0Kvz.js → secretGuard-B4-LlMjv.js} +75 -16
  134. package/dist/assets/{secretGuard-B7Hj0Kvz.js.map → secretGuard-B4-LlMjv.js.map} +1 -1
  135. package/dist/assets/secretGuard-BmmnEbYf.js +1 -0
  136. package/dist/assets/{server-Q3VcNqGt.js → server-CQR7NLCz.js} +10200 -625
  137. package/dist/assets/server-CQR7NLCz.js.map +1 -0
  138. package/dist/assets/{sha512-BYId-G-T.js → sha512-DST9fbWH.js} +2 -3
  139. package/dist/assets/{sha512-BYId-G-T.js.map → sha512-DST9fbWH.js.map} +1 -1
  140. package/dist/assets/sshForges-BnvwmNj-.js +539 -0
  141. package/dist/assets/sshForges-BnvwmNj-.js.map +1 -0
  142. package/dist/assets/{storage-Bya5b2Xt.js → storage-BpjdxvO2.js} +243 -34
  143. package/dist/assets/storage-BpjdxvO2.js.map +1 -0
  144. package/dist/assets/text-li76pThX.js +106 -0
  145. package/dist/assets/text-li76pThX.js.map +1 -0
  146. package/dist/assets/{translate-iQZq4TnY.js → translate-BcbSWkuq.js} +21 -26
  147. package/dist/assets/{translate-iQZq4TnY.js.map → translate-BcbSWkuq.js.map} +1 -1
  148. package/dist/assets/{tree-store-N362nuzZ.js → tree-store-CAchkO_l.js} +22 -6
  149. package/dist/assets/tree-store-CAchkO_l.js.map +1 -0
  150. package/dist/assets/{types-Clyb52K2.js → types-CdWwgvyt.js} +2 -3
  151. package/dist/assets/{types-Clyb52K2.js.map → types-CdWwgvyt.js.map} +1 -1
  152. package/dist/assets/{unbzip2-stream-B1C-JX9L.js → unbzip2-stream-BtkYGpC5.js} +2 -3
  153. package/dist/assets/{unbzip2-stream-B1C-JX9L.js.map → unbzip2-stream-BtkYGpC5.js.map} +1 -1
  154. package/dist/assets/{usdt-DnyTGdTX.js → usdt-CBJ4Q5Ji.js} +7 -7
  155. package/dist/assets/usdt-CBJ4Q5Ji.js.map +1 -0
  156. package/dist/assets/{waitNotice-Cn0WJ-He.js → waitNotice-BGM0QOS2.js} +27 -4
  157. package/dist/assets/waitNotice-BGM0QOS2.js.map +1 -0
  158. package/dist/assets/{web-DwgdhfcY.js → web-68CYFCl9.js} +314 -91
  159. package/dist/assets/web-68CYFCl9.js.map +1 -0
  160. package/dist/ghostly.mjs +3 -5
  161. package/dist/ghostly.mjs.map +1 -1
  162. package/npm-shrinkwrap.json +225 -200
  163. package/package.json +16 -16
  164. package/dist/assets/api-DBlaoz8i.js.map +0 -1
  165. package/dist/assets/apiKit-DesObIDf.js.map +0 -1
  166. package/dist/assets/appFetch-C8yZIq1e.js +0 -194
  167. package/dist/assets/appFetch-C8yZIq1e.js.map +0 -1
  168. package/dist/assets/apps-DkMjDHML.js.map +0 -1
  169. package/dist/assets/apps-rzxsjfBV.js +0 -2
  170. package/dist/assets/arkade-CarKONmH.js.map +0 -1
  171. package/dist/assets/backup-C0OJCJlM.js.map +0 -1
  172. package/dist/assets/backup-CgWU7x0T.js +0 -2
  173. package/dist/assets/bark_ffi_wasm_bg-EY2uc0Bx.js +0 -6
  174. package/dist/assets/bitcoindProvider-BvoRh0D5.js +0 -97
  175. package/dist/assets/bitcoindProvider-BvoRh0D5.js.map +0 -1
  176. package/dist/assets/bitcoindevkit_bg-B-iLWrmX.js +0 -6
  177. package/dist/assets/bitcoindevkit_bg-CRkZTSbO.wasm +0 -0
  178. package/dist/assets/buttons-Cco0Agfa.js +0 -2
  179. package/dist/assets/buttons-fZTEa_2i.js.map +0 -1
  180. package/dist/assets/client-Ibk3-e60.js.map +0 -1
  181. package/dist/assets/endpoint-DarqblYE.js.map +0 -1
  182. package/dist/assets/errors-Dt-ZnyOX.js.map +0 -1
  183. package/dist/assets/fedimint_client_wasm_bg-BtHHlFpp.js +0 -6
  184. package/dist/assets/fileBytes-BLPZq9YU.js.map +0 -1
  185. package/dist/assets/fileBytes-BtIyoDF2.js +0 -2
  186. package/dist/assets/fileBytesIdb-D8mAK4pF.js +0 -2
  187. package/dist/assets/host-CYlIiY3r.js.map +0 -1
  188. package/dist/assets/hyperdhtRelay-1wzya_0L.js +0 -25
  189. package/dist/assets/hyperdhtRelay-1wzya_0L.js.map +0 -1
  190. package/dist/assets/hyperdhtRelay-CdsLcAhY.js.map +0 -1
  191. package/dist/assets/irohWeb-D2IuloLL.js.map +0 -1
  192. package/dist/assets/joinTrace-D-fnt2p3.js +0 -2
  193. package/dist/assets/jsonOut-POtMBS_V.js +0 -16
  194. package/dist/assets/jsonOut-POtMBS_V.js.map +0 -1
  195. package/dist/assets/main-C0PfjKTe.js.map +0 -1
  196. package/dist/assets/mainline-Cu61qcPS.js.map +0 -1
  197. package/dist/assets/mints-BaOmx517.js +0 -2
  198. package/dist/assets/mints-j5XAOk4f.js.map +0 -1
  199. package/dist/assets/nwcProvider-DYHkd0iu.js +0 -88
  200. package/dist/assets/nwcProvider-DYHkd0iu.js.map +0 -1
  201. package/dist/assets/ownDid-CJ0ta8CL.js +0 -282
  202. package/dist/assets/ownDid-CJ0ta8CL.js.map +0 -1
  203. package/dist/assets/ownStatus-D4HC6tNR.js.map +0 -1
  204. package/dist/assets/profiles-Ccdq6Xf6.js.map +0 -1
  205. package/dist/assets/registry-CE0PpQAE.js +0 -2
  206. package/dist/assets/registry-LvxsLJ5S.js.map +0 -1
  207. package/dist/assets/resolve-6kVu2DE5.js +0 -400
  208. package/dist/assets/resolve-6kVu2DE5.js.map +0 -1
  209. package/dist/assets/secretGuard-DUr6bgKc.js +0 -2
  210. package/dist/assets/server-Q3VcNqGt.js.map +0 -1
  211. package/dist/assets/src-DjVj2ynY.js.map +0 -1
  212. package/dist/assets/sshForges-DeZ9cN9Q.js +0 -261
  213. package/dist/assets/sshForges-DeZ9cN9Q.js.map +0 -1
  214. package/dist/assets/storage-Bya5b2Xt.js.map +0 -1
  215. package/dist/assets/tree-store-N362nuzZ.js.map +0 -1
  216. package/dist/assets/usdt-DnyTGdTX.js.map +0 -1
  217. package/dist/assets/waitNotice-Cn0WJ-He.js.map +0 -1
  218. package/dist/assets/web-DwgdhfcY.js.map +0 -1
@@ -0,0 +1,602 @@
1
+ import { l as toBase64Url, u as toZ32 } from "./bytes-C1DNGY18.js";
2
+ import { x as sign } from "./pkarr-BQo4PcCg.js";
3
+ import { Ba as readAppSignature, Da as APP_PREFIXES, Fa as isAppLine, Ga as verifyAppSignature, Ha as signAppObject, Ia as isAppRef, Na as isAppHash, Pa as isAppKey, Ra as readAppRevocationShape, Sa as isAppUrl, Wa as verifyAppRevocation, Xa as canonicalJsonBytes, Za as readCanonicalJson, ja as appRefPublisher, xa as findAppForbiddenKey } from "./groupMeta-DTQAJG50.js";
4
+ import { ed25519 } from "@noble/curves/ed25519.js";
5
+ import { sha256 } from "@noble/hashes/sha2.js";
6
+ // ../core/src/signer.ts
7
+ /** A seed held by the app, as every key of a profile is today. */
8
+ function seedSigner(seed) {
9
+ if (seed.length !== 32) throw new Error("Seed must be exactly 32 bytes");
10
+ return {
11
+ publicKey: ed25519.getPublicKey(seed),
12
+ sign: async (bytes) => sign(bytes, seed)
13
+ };
14
+ }
15
+ /**
16
+ * A WebCrypto Ed25519 private key, non-extractable or not, with its raw public key. The app never sees the private
17
+ * bytes: `crypto.subtle` signs.
18
+ */
19
+ function webCryptoSigner(privateKey, publicKey) {
20
+ if (publicKey.length !== 32) throw new Error("An Ed25519 public key is 32 bytes");
21
+ return {
22
+ publicKey,
23
+ sign: async (bytes) => new Uint8Array(await crypto.subtle.sign({ name: "Ed25519" }, privateKey, new Uint8Array(bytes)))
24
+ };
25
+ }
26
+ // ../core/src/appStore.ts
27
+ var APP_STORE_LIMITS = {
28
+ /** The index's bytes, uncompressed. */
29
+ indexBytes: 16777216,
30
+ /** How far ahead `expires` may be. */
31
+ expiresAheadS: 7776e3,
32
+ name: 40,
33
+ description: 2e3,
34
+ title: 40,
35
+ tagline: 80,
36
+ /** `category`, `developer`, `submitter`. */
37
+ label: 40,
38
+ reason: 200,
39
+ urls: 4,
40
+ apps: 4096,
41
+ removed: 4096,
42
+ revoked: 4096
43
+ };
44
+ var APP_STORE_KINDS = ["curated", "indexed"];
45
+ var isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
46
+ var isText = (v, max) => typeof v === "string" && [...v].length <= max && !/[^\P{Cc}\n]/u.test(v);
47
+ var isCount = (v, min) => typeof v === "number" && Number.isSafeInteger(v) && v >= min;
48
+ var fine = { ok: true };
49
+ function keysOf(value, required, optional, options = {}) {
50
+ const forbidden = findAppForbiddenKey(value);
51
+ if (forbidden !== void 0) return {
52
+ ok: false,
53
+ reason: "unknown-key",
54
+ detail: forbidden
55
+ };
56
+ for (const k of Object.keys(value)) if (options.strict && !required.includes(k) && !optional.includes(k)) return {
57
+ ok: false,
58
+ reason: "unknown-key",
59
+ detail: k
60
+ };
61
+ for (const k of required) if (!(k in value)) return {
62
+ ok: false,
63
+ reason: "missing-key",
64
+ detail: k
65
+ };
66
+ return fine;
67
+ }
68
+ var LISTING_REQUIRED = [
69
+ "ref",
70
+ "sequence",
71
+ "digest",
72
+ "urls",
73
+ "title",
74
+ "tagline"
75
+ ];
76
+ var LISTING_OPTIONAL = [
77
+ "category",
78
+ "developer",
79
+ "submitter",
80
+ "repo",
81
+ "support"
82
+ ];
83
+ /** Checks one entry of `apps`, which is also the whole of a `listing.json`. An unknown key is ignored unless `strict`. */
84
+ function checkAppListing(value, options = {}) {
85
+ if (!isObject(value)) return {
86
+ ok: false,
87
+ reason: "bad-field",
88
+ detail: "A listing is not an object"
89
+ };
90
+ const keys = keysOf(value, LISTING_REQUIRED, LISTING_OPTIONAL, options);
91
+ if (!keys.ok) return keys;
92
+ const bad = (field) => ({
93
+ ok: false,
94
+ reason: "bad-field",
95
+ detail: `apps: ${field}`
96
+ });
97
+ if (!isAppRef(value.ref)) return bad("ref");
98
+ if (!isCount(value.sequence, 1)) return bad("sequence");
99
+ if (!isAppHash(value.digest)) return bad("digest");
100
+ const urls = value.urls;
101
+ if (!Array.isArray(urls) || urls.length < 1 || urls.length > APP_STORE_LIMITS.urls || !urls.every(isAppUrl)) return bad("urls");
102
+ if (!isAppLine(value.title, APP_STORE_LIMITS.title, 1)) return bad("title");
103
+ if (!isAppLine(value.tagline, APP_STORE_LIMITS.tagline, 1)) return bad("tagline");
104
+ for (const k of [
105
+ "category",
106
+ "developer",
107
+ "submitter"
108
+ ]) if (value[k] !== void 0 && !isAppLine(value[k], APP_STORE_LIMITS.label, 1)) return bad(k);
109
+ for (const k of ["repo", "support"]) if (value[k] !== void 0 && !isAppUrl(value[k])) return bad(k);
110
+ return fine;
111
+ }
112
+ /**
113
+ * The first object key `text` writes twice in one object, as JSON.parse reads it (`"title"` is `title`), or null.
114
+ * `text` is JSON that JSON.parse already took: one pass, each string read to its closing quote.
115
+ */
116
+ function repeatedJsonKey(text) {
117
+ /** Each open object's keys so far; null for an array. */
118
+ const open = [];
119
+ let keyNext = false;
120
+ for (let i = 0; i < text.length; i++) {
121
+ const c = text[i];
122
+ if (c === "\"") {
123
+ let end = i + 1;
124
+ while (text[end] !== "\"") end += text[end] === "\\" ? 2 : 1;
125
+ const keys = open[open.length - 1];
126
+ if (keys && keyNext) {
127
+ const key = JSON.parse(text.slice(i, end + 1));
128
+ if (keys.has(key)) return key;
129
+ keys.add(key);
130
+ keyNext = false;
131
+ }
132
+ i = end;
133
+ } else if (c === "{") {
134
+ open.push(/* @__PURE__ */ new Set());
135
+ keyNext = true;
136
+ } else if (c === "[") open.push(null);
137
+ else if (c === "}" || c === "]") open.pop();
138
+ else if (c === ",") keyNext = open[open.length - 1] !== null;
139
+ }
140
+ return null;
141
+ }
142
+ function checkRemoval(value, options) {
143
+ if (!isObject(value)) return {
144
+ ok: false,
145
+ reason: "bad-field",
146
+ detail: "A removal is not an object"
147
+ };
148
+ const keys = keysOf(value, [
149
+ "ref",
150
+ "digest",
151
+ "reason",
152
+ "at"
153
+ ], [], options);
154
+ if (!keys.ok) return keys;
155
+ if (!isAppRef(value.ref) || !isAppHash(value.digest) || !isAppLine(value.reason, APP_STORE_LIMITS.reason, 1) || !isCount(value.at, 0)) return {
156
+ ok: false,
157
+ reason: "bad-field",
158
+ detail: "removed: not {ref, digest, reason, at}"
159
+ };
160
+ return fine;
161
+ }
162
+ var STORE_REQUIRED = [
163
+ "ghostlyStore",
164
+ "key",
165
+ "name",
166
+ "kind",
167
+ "sequence",
168
+ "expires",
169
+ "apps",
170
+ "removed",
171
+ "revoked"
172
+ ];
173
+ /** Runs a check written in steps to its end, in one go. */
174
+ function inOneRun(steps) {
175
+ for (;;) {
176
+ const step = steps.next();
177
+ if (step.done) return step.value;
178
+ }
179
+ }
180
+ /**
181
+ * Checks an index's fields and bounds, and every revocation it carries (one that does not verify refuses the index:
182
+ * the store copied it, so a broken one is the store's fault). The signature and `expires` are `readAppStore`'s. An
183
+ * unknown key of the index, a listing or a removal is ignored unless `strict`; a revocation is its publisher's signed
184
+ * statement and keeps its exact keys. With `checked`, a revocation it holds is not checked again.
185
+ */
186
+ function checkAppStoreIndex(value, options = {}, checked) {
187
+ const fields = inOneRun(checkAppStoreFieldsSteps(value, options));
188
+ return fields.ok ? inOneRun(checkAppStoreRevocationsSteps(value, checked)) : fields;
189
+ }
190
+ /**
191
+ * The first half of `checkAppStoreIndex`: the fields and bounds, and the shape of every revocation, with no signature
192
+ * checked. A step after each listing, removal and revocation (see `readAppStoreSteps`).
193
+ */
194
+ function* checkAppStoreFieldsSteps(value, options = {}) {
195
+ if (!isObject(value)) return {
196
+ ok: false,
197
+ reason: "bad-field",
198
+ detail: "The index is not an object"
199
+ };
200
+ if (value.ghostlyStore !== void 0 && value.ghostlyStore !== 1) return {
201
+ ok: false,
202
+ reason: "unsupported-format",
203
+ detail: "ghostlyStore is not 1"
204
+ };
205
+ const keys = keysOf(value, STORE_REQUIRED, ["description"], options);
206
+ if (!keys.ok) return keys;
207
+ const bad = (field) => ({
208
+ ok: false,
209
+ reason: "bad-field",
210
+ detail: field
211
+ });
212
+ if (!isAppKey(value.key)) return bad("key");
213
+ if (!isAppLine(value.name, APP_STORE_LIMITS.name, 1)) return bad("name");
214
+ if (value.description !== void 0 && !isText(value.description, APP_STORE_LIMITS.description)) return bad("description");
215
+ if (!APP_STORE_KINDS.includes(value.kind)) return bad("kind");
216
+ if (!isCount(value.sequence, 1)) return bad("sequence");
217
+ if (!isCount(value.expires, 0)) return bad("expires");
218
+ const { apps, removed, revoked } = value;
219
+ if (!Array.isArray(apps) || apps.length > APP_STORE_LIMITS.apps) return bad("apps");
220
+ const refs = /* @__PURE__ */ new Set();
221
+ for (const listing of apps) {
222
+ const checked = checkAppListing(listing, options);
223
+ if (!checked.ok) return checked;
224
+ const ref = listing.ref;
225
+ if (refs.has(ref)) return {
226
+ ok: false,
227
+ reason: "duplicate-app",
228
+ detail: ref
229
+ };
230
+ refs.add(ref);
231
+ yield;
232
+ }
233
+ if (!Array.isArray(removed) || removed.length > APP_STORE_LIMITS.removed) return bad("removed");
234
+ for (const entry of removed) {
235
+ const checked = checkRemoval(entry, options);
236
+ if (!checked.ok) return checked;
237
+ yield;
238
+ }
239
+ if (!Array.isArray(revoked) || revoked.length > APP_STORE_LIMITS.revoked) return bad("revoked");
240
+ for (const entry of revoked) {
241
+ const read = readAppRevocationShape(entry);
242
+ if (!read.ok) return {
243
+ ok: false,
244
+ reason: "bad-revocation",
245
+ detail: read.detail ?? read.reason
246
+ };
247
+ yield;
248
+ }
249
+ return fine;
250
+ }
251
+ /** The second half: the signature of each revocation of an index whose fields hold, one step each. */
252
+ function* checkAppStoreRevocationsSteps(index, checked) {
253
+ for (const revocation of index.revoked) {
254
+ const verified = verifyAppRevocation(revocation, checked);
255
+ if (!verified.ok) return {
256
+ ok: false,
257
+ reason: "bad-revocation",
258
+ detail: verified.reason
259
+ };
260
+ yield;
261
+ }
262
+ return fine;
263
+ }
264
+ /**
265
+ * Reads `ghostly-store.json` with its `ghostly-store.sig`, in this order: size, JSON, canonical bytes, fields and the
266
+ * shape of each revocation, the signature statement, the key the reader holds for this store (when it holds one), the
267
+ * signature, the signature of each revocation, then `expires` against `now` (seconds): more than 90 days ahead is
268
+ * refused, past is `expired`. The index's own signature comes before its revocations': an index nobody signed costs
269
+ * its reader one signature check, whatever it carries. A key it does not know is ignored (a later store's optional
270
+ * field) and stays in the bytes the signature covers. With `checked`, a revocation it holds is not checked again.
271
+ */
272
+ function readAppStore(indexBytes, sigBytes, now, heldKey, checked) {
273
+ return inOneRun(readAppStoreSteps(indexBytes, sigBytes, now, heldKey, checked));
274
+ }
275
+ /**
276
+ * `readAppStore` in steps, for a reader that shares its thread (a page): it stops after each listing, removal and
277
+ * revocation, and after each revocation's signature check, so the caller can let the thread go between two `next()`
278
+ * and an index of 4096 revocations never holds it for seconds. With `checked`, a revocation it holds is not checked again.
279
+ */
280
+ function* readAppStoreSteps(indexBytes, sigBytes, now, heldKey, checked) {
281
+ if (indexBytes.length > APP_STORE_LIMITS.indexBytes) return {
282
+ ok: false,
283
+ reason: "too-large"
284
+ };
285
+ const read = readCanonicalJson(indexBytes);
286
+ if (!read.ok) return read;
287
+ yield;
288
+ const fields = yield* checkAppStoreFieldsSteps(read.value);
289
+ if (!fields.ok) return fields;
290
+ const index = read.value;
291
+ const statement = readAppSignature(sigBytes);
292
+ if (!statement.ok) return statement;
293
+ if (heldKey !== void 0 && index.key !== heldKey) return {
294
+ ok: false,
295
+ reason: "store-key",
296
+ detail: "Another key than the store's"
297
+ };
298
+ const signed = verifyAppSignature(APP_PREFIXES.store, indexBytes, statement.signature, index.key);
299
+ if (!signed.ok) return signed;
300
+ yield;
301
+ const revocations = yield* checkAppStoreRevocationsSteps(index, checked);
302
+ if (!revocations.ok) return revocations;
303
+ if (index.expires > now + APP_STORE_LIMITS.expiresAheadS) return {
304
+ ok: false,
305
+ reason: "expires-too-far"
306
+ };
307
+ return {
308
+ ok: true,
309
+ store: {
310
+ index,
311
+ digest: toBase64Url(sha256(indexBytes)),
312
+ expired: index.expires < now
313
+ }
314
+ };
315
+ }
316
+ /**
317
+ * Signs an index with the store key: its canonical bytes and the `ghostly-store.sig` bytes. Throws on a bad index, and
318
+ * on a key this format does not define: a writer is strict, so a misspelt key is never signed. With `revocations`, a
319
+ * revocation it holds is not checked again.
320
+ */
321
+ async function signAppStore(index, signer, revocations) {
322
+ if (index.key !== toZ32(signer.publicKey)) throw new Error("A store index is signed by its own key");
323
+ const checked = checkAppStoreIndex(JSON.parse(JSON.stringify(index)), { strict: true }, revocations);
324
+ if (!checked.ok) throw new Error(`Not a valid store index (${checked.reason}${checked.detail ? `: ${checked.detail}` : ""})`);
325
+ const { bytes, signature } = await signAppObject(APP_PREFIXES.store, index, signer);
326
+ return {
327
+ indexBytes: bytes,
328
+ sigBytes: canonicalJsonBytes(signature),
329
+ signature
330
+ };
331
+ }
332
+ // ../core/src/appUpdates.ts
333
+ function appUpdateDecision(installed, candidate) {
334
+ if (installed.ref !== candidate.ref) return "other-app";
335
+ if (candidate.sequence > installed.sequence) return "update";
336
+ if (candidate.sequence < installed.sequence) return "rollback";
337
+ return candidate.digest === installed.digest ? "same" : "equivocation";
338
+ }
339
+ /** The permissions an update adds: when there is any, the update waits for the person, who sees only these. */
340
+ function addedAppPermissions(granted, requested) {
341
+ return requested.filter((p) => !granted.includes(p));
342
+ }
343
+ function planAppUpdate(installed, candidate) {
344
+ const decision = appUpdateDecision(installed, candidate);
345
+ if (decision !== "update") return {
346
+ action: "refuse",
347
+ decision
348
+ };
349
+ const added = addedAppPermissions(installed.permissions, candidate.permissions);
350
+ return added.length ? {
351
+ action: "ask",
352
+ added
353
+ } : { action: "install" };
354
+ }
355
+ /**
356
+ * The revocation that stops a version, or null: one signed by the app's own publisher (a reader verified it) that names
357
+ * its digest, or reaches its `sequence` with `upTo`.
358
+ */
359
+ function appRevocationFor(version, revocations) {
360
+ const publisher = appRefPublisher(version.ref);
361
+ for (const r of revocations) {
362
+ const s = r.statement;
363
+ if (s.app !== version.ref || r.signature.key !== publisher) continue;
364
+ if ("digests" in s ? s.digests.includes(version.digest) : version.sequence <= s.upTo) return r;
365
+ }
366
+ return null;
367
+ }
368
+ function checkAppBeforeRun(version, stores, revocations = []) {
369
+ for (const list of [revocations, ...stores.map((s) => s.revoked)]) {
370
+ const revocation = appRevocationFor(version, indexed(list, (r) => r.statement.app).get(version.ref) ?? []);
371
+ if (revocation) return {
372
+ status: "revoked",
373
+ revocation
374
+ };
375
+ }
376
+ const by = stores.flatMap((s) => (indexed(s.removed, (r) => `${r.ref} ${r.digest}`).get(`${version.ref} ${version.digest}`) ?? []).map((r) => ({
377
+ store: s.key,
378
+ name: s.name,
379
+ reason: r.reason,
380
+ at: r.at
381
+ })));
382
+ return by.length ? {
383
+ status: "removed",
384
+ by
385
+ } : { status: "ok" };
386
+ }
387
+ var indexes = /* @__PURE__ */ new WeakMap();
388
+ function indexed(list, key) {
389
+ const held = indexes.get(list);
390
+ if (held && held.length === list.length) return held.byKey;
391
+ const byKey = /* @__PURE__ */ new Map();
392
+ for (const entry of list) {
393
+ const k = key(entry);
394
+ const same = byKey.get(k);
395
+ if (same) same.push(entry);
396
+ else byKey.set(k, [entry]);
397
+ }
398
+ indexes.set(list, {
399
+ length: list.length,
400
+ byKey
401
+ });
402
+ return byKey;
403
+ }
404
+ function appStoreDecision(held, read) {
405
+ if (!held) return "new";
406
+ if (held.key !== read.key) return "other-key";
407
+ if (read.sequence > held.sequence) return "update";
408
+ if (read.sequence < held.sequence) return "rollback";
409
+ return read.digest === held.digest ? "same" : "equivocation";
410
+ }
411
+ // ../browser/src/engine/appFetch.ts
412
+ /** The hosts phase 1 reads from. A jsDelivr URL must also name a 40-character commit (`isAppUrl`). */
413
+ var APP_FETCH_HOSTS = ["raw.githubusercontent.com", "cdn.jsdelivr.net"];
414
+ var APP_FETCH_LIMITS = {
415
+ /**
416
+ * A store index as read (WISP 1200 § Stores, Privacy): 4 MiB in phase 1, under the format's 16 MiB. Counted on the body
417
+ * as it arrives, after the browser undid any compression, since a page never sees the compressed size.
418
+ */
419
+ storeIndexBytes: 4194304,
420
+ /** A store's signature statement, `ghostly-store.sig` (canonical, at most 1 KiB). */
421
+ sigBytes: 1024,
422
+ /** `ghostly-revoke.json`: at most 4096 signed revocations. */
423
+ revocationsBytes: 16777216,
424
+ /** How long the host has to answer (the response's headers). */
425
+ timeoutMs: 3e4,
426
+ /** How long the body may go without a byte: a read still arriving is never cut by the clock alone. */
427
+ idleMs: 3e4,
428
+ /** A whole read at most: the 16 MiB cap at about 224 kbit/s. */
429
+ totalMs: 6e5
430
+ };
431
+ /** A URL this client may read an app, a store or a revocation list from. */
432
+ function isAppFetchUrl(value) {
433
+ if (!isAppUrl(value)) return false;
434
+ const url = new URL(value);
435
+ return url.port === "" && APP_FETCH_HOSTS.includes(url.hostname.toLowerCase());
436
+ }
437
+ var AppFetchError = class extends Error {
438
+ code;
439
+ status;
440
+ constructor(code, message, status) {
441
+ super(`${code}: ${message}`);
442
+ this.code = code;
443
+ this.status = status;
444
+ this.name = "AppFetchError";
445
+ }
446
+ };
447
+ function boundedAppFetch(options = {}) {
448
+ return async (url, { maxBytes, peek = false, revalidate = false, signal: stopped }) => {
449
+ if (!isAppFetchUrl(url)) throw new AppFetchError("host", "Apps are read only from raw.githubusercontent.com, or from cdn.jsdelivr.net at a commit, over HTTPS");
450
+ if (options.online && !options.online()) throw new AppFetchError("offline", "Offline");
451
+ if (stopped?.aborted) throw new AppFetchError("network", "The read was stopped");
452
+ const fetcher = options.fetcher ?? globalThis.fetch.bind(globalThis);
453
+ const controller = new AbortController();
454
+ const cut = () => {
455
+ controller.abort(new DOMException("The read took too long", "TimeoutError"));
456
+ };
457
+ const stop = () => {
458
+ controller.abort(new DOMException("The read was stopped", "AbortError"));
459
+ };
460
+ stopped?.addEventListener("abort", stop);
461
+ const total = setTimeout(cut, options.totalMs ?? APP_FETCH_LIMITS.totalMs);
462
+ let idle = setTimeout(cut, options.timeoutMs ?? APP_FETCH_LIMITS.timeoutMs);
463
+ const heard = () => {
464
+ clearTimeout(idle);
465
+ idle = setTimeout(cut, options.idleMs ?? APP_FETCH_LIMITS.idleMs);
466
+ };
467
+ const failure = (error) => stopped?.aborted ? new AppFetchError("network", "The read was stopped") : controller.signal.aborted ? new AppFetchError("slow", "That took too long on this connection") : new AppFetchError("network", error instanceof Error ? error.message : String(error));
468
+ const { signal } = controller;
469
+ let response;
470
+ try {
471
+ response = await fetcher(url, {
472
+ signal,
473
+ credentials: "omit",
474
+ referrerPolicy: "no-referrer",
475
+ cache: revalidate && !peek ? "no-cache" : "no-store",
476
+ redirect: "error",
477
+ ...peek && { headers: { range: `bytes=0-${maxBytes - 1}` } }
478
+ });
479
+ } catch (error) {
480
+ clearTimeout(total);
481
+ clearTimeout(idle);
482
+ stopped?.removeEventListener("abort", stop);
483
+ throw failure(error);
484
+ }
485
+ heard();
486
+ const parts = [];
487
+ let length = 0;
488
+ try {
489
+ if (response.url && response.url !== url && !isAppFetchUrl(response.url)) throw new AppFetchError("host", "The host sent the request elsewhere");
490
+ if (!response.ok) {
491
+ await response.body?.cancel().catch(() => {});
492
+ throw new AppFetchError("status", `The host answered ${response.status}`, response.status);
493
+ }
494
+ if (!peek && Number(response.headers.get("content-length")) > maxBytes) {
495
+ await response.body?.cancel().catch(() => {});
496
+ throw new AppFetchError("too-large", "Too large");
497
+ }
498
+ const reader = response.body?.getReader();
499
+ if (reader) {
500
+ const letGo = () => {
501
+ reader.cancel().catch(() => {});
502
+ };
503
+ signal.addEventListener("abort", letGo);
504
+ try {
505
+ for (;;) {
506
+ const { done, value } = await reader.read();
507
+ if (signal.aborted) throw failure(signal.reason);
508
+ if (done) break;
509
+ heard();
510
+ if (length + value.length > maxBytes) {
511
+ if (!peek) throw new AppFetchError("too-large", "Too large");
512
+ parts.push(value.subarray(0, maxBytes - length));
513
+ length = maxBytes;
514
+ break;
515
+ }
516
+ parts.push(value);
517
+ length += value.length;
518
+ }
519
+ } catch (error) {
520
+ if (error instanceof AppFetchError) throw error;
521
+ throw failure(error);
522
+ } finally {
523
+ signal.removeEventListener("abort", letGo);
524
+ await reader.cancel().catch(() => {});
525
+ }
526
+ }
527
+ } finally {
528
+ clearTimeout(total);
529
+ clearTimeout(idle);
530
+ stopped?.removeEventListener("abort", stop);
531
+ }
532
+ const bytes = new Uint8Array(length);
533
+ let at = 0;
534
+ for (const part of parts) {
535
+ bytes.set(part, at);
536
+ at += part.length;
537
+ }
538
+ return bytes;
539
+ };
540
+ }
541
+ var NAME = /^[A-Za-z0-9_.-]+$/;
542
+ /**
543
+ * The URL a pasted address reads `file` from (WISP 1200 § Paste a URL), or null when it is not one this client reads:
544
+ * - `https://github.com/<owner>/<repo>`, or `/tree/<ref>`: `raw.githubusercontent.com/<owner>/<repo>/<ref or HEAD>/<file>`,
545
+ * with no request to `github.com` or `api.github.com`;
546
+ * - a file as GitHub shows it, `https://github.com/<owner>/<repo>/blob/<ref>/<path>` (or `/raw/`), naming a `.ghostlyapp`
547
+ * or `.json` file: `raw.githubusercontent.com/<owner>/<repo>/<ref>/<path>`, again with no request to `github.com`;
548
+ * - a URL of the list that names a file (`….ghostlyapp`, `….json`): itself;
549
+ * - a URL of the list that names a folder: `<file>` in it.
550
+ */
551
+ function appPasteUrl(input, file) {
552
+ let url;
553
+ try {
554
+ url = new URL(input.trim());
555
+ } catch {
556
+ return null;
557
+ }
558
+ if (url.protocol !== "https:" || url.username || url.password || url.port) return null;
559
+ const host = url.hostname.toLowerCase();
560
+ if (host === "github.com" || host === "www.github.com") {
561
+ const parts = url.pathname.split("/").filter(Boolean);
562
+ if (parts.length < 2) return null;
563
+ const owner = parts[0], repo = parts[1].replace(/\.git$/, "");
564
+ if (!NAME.test(owner) || !NAME.test(repo)) return null;
565
+ let ref = "HEAD";
566
+ if (parts.length > 2) {
567
+ const rest = parts.slice(3);
568
+ if (!rest.length || !rest.every((p) => NAME.test(p) && p !== "." && p !== "..")) return null;
569
+ if (parts[2] === "blob" || parts[2] === "raw") {
570
+ if (rest.length < 2 || !/\.(ghostlyapp|json)$/.test(rest[rest.length - 1])) return null;
571
+ const raw = `https://raw.githubusercontent.com/${owner}/${repo}/${rest.join("/")}`;
572
+ return isAppFetchUrl(raw) ? raw : null;
573
+ }
574
+ if (parts[2] !== "tree") return null;
575
+ ref = rest.join("/");
576
+ }
577
+ const raw = `https://raw.githubusercontent.com/${owner}/${repo}/${ref}/${file}`;
578
+ return isAppFetchUrl(raw) ? raw : null;
579
+ }
580
+ const last = url.pathname.split("/").pop() ?? "";
581
+ const named = /\.(ghostlyapp|json)$/.test(last) ? url.href : new URL(`${url.pathname.replace(/\/?$/, "/")}${file}`, url).href;
582
+ return isAppFetchUrl(named) ? named : null;
583
+ }
584
+ /** A page of github.com (any scheme): a link `appPasteUrl` could not read is still GitHub, and is answered as such. */
585
+ function isGitHubPage(input) {
586
+ try {
587
+ const host = new URL(input.trim()).hostname.toLowerCase();
588
+ return host === "github.com" || host === "www.github.com";
589
+ } catch {
590
+ return false;
591
+ }
592
+ }
593
+ /** A file beside another (`ghostly-store.sig` beside the index, `ghostly-revoke.json` beside a bundle). */
594
+ function besideUrl(url, name) {
595
+ const target = new URL(url);
596
+ target.search = "";
597
+ target.hash = "";
598
+ return new URL(name, target).href;
599
+ }
600
+ export { webCryptoSigner as S, readAppStore as _, besideUrl as a, signAppStore as b, isGitHubPage as c, appStoreDecision as d, appUpdateDecision as f, checkAppStoreIndex as g, APP_STORE_LIMITS as h, appPasteUrl as i, addedAppPermissions as l, planAppUpdate as m, APP_FETCH_LIMITS as n, boundedAppFetch as o, checkAppBeforeRun as p, AppFetchError as r, isAppFetchUrl as s, APP_FETCH_HOSTS as t, appRevocationFor as u, readAppStoreSteps as v, seedSigner as x, repeatedJsonKey as y };
601
+
602
+ //# sourceMappingURL=appFetch-D56GsYuq.js.map