pear-electron 1.0.18 → 1.0.20

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 (371) hide show
  1. package/boot.bundle +2195 -998
  2. package/package.json +5 -19
  3. package/node_modules/b4a/LICENSE +0 -201
  4. package/node_modules/b4a/README.md +0 -145
  5. package/node_modules/b4a/browser.js +0 -576
  6. package/node_modules/b4a/index.js +0 -189
  7. package/node_modules/b4a/lib/ascii.js +0 -31
  8. package/node_modules/b4a/lib/base64.js +0 -65
  9. package/node_modules/b4a/lib/hex.js +0 -51
  10. package/node_modules/b4a/lib/utf16le.js +0 -40
  11. package/node_modules/b4a/lib/utf8.js +0 -145
  12. package/node_modules/b4a/package.json +0 -32
  13. package/node_modules/bare-ansi-escapes/LICENSE +0 -201
  14. package/node_modules/bare-ansi-escapes/README.md +0 -21
  15. package/node_modules/bare-ansi-escapes/index.js +0 -90
  16. package/node_modules/bare-ansi-escapes/key-decoder.js +0 -302
  17. package/node_modules/bare-ansi-escapes/package.json +0 -30
  18. package/node_modules/bare-env/LICENSE +0 -201
  19. package/node_modules/bare-env/README.md +0 -19
  20. package/node_modules/bare-env/index.js +0 -50
  21. package/node_modules/bare-env/package.json +0 -29
  22. package/node_modules/bare-events/LICENSE +0 -201
  23. package/node_modules/bare-events/README.md +0 -25
  24. package/node_modules/bare-events/index.d.ts +0 -91
  25. package/node_modules/bare-events/index.js +0 -336
  26. package/node_modules/bare-events/lib/errors.js +0 -32
  27. package/node_modules/bare-events/package.json +0 -39
  28. package/node_modules/bare-fs/CMakeLists.txt +0 -13
  29. package/node_modules/bare-fs/LICENSE +0 -201
  30. package/node_modules/bare-fs/README.md +0 -97
  31. package/node_modules/bare-fs/binding.c +0 -2698
  32. package/node_modules/bare-fs/binding.js +0 -1
  33. package/node_modules/bare-fs/index.js +0 -2734
  34. package/node_modules/bare-fs/package.json +0 -42
  35. package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
  36. package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
  37. package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
  38. package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
  39. package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
  40. package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
  41. package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
  42. package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
  43. package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
  44. package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
  45. package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
  46. package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
  47. package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
  48. package/node_modules/bare-fs/promises.js +0 -1
  49. package/node_modules/bare-hrtime/CMakeLists.txt +0 -13
  50. package/node_modules/bare-hrtime/LICENSE +0 -201
  51. package/node_modules/bare-hrtime/README.md +0 -20
  52. package/node_modules/bare-hrtime/binding.c +0 -66
  53. package/node_modules/bare-hrtime/binding.js +0 -1
  54. package/node_modules/bare-hrtime/index.js +0 -15
  55. package/node_modules/bare-hrtime/package.json +0 -32
  56. package/node_modules/bare-hrtime/prebuilds/android-arm/bare-hrtime.bare +0 -0
  57. package/node_modules/bare-hrtime/prebuilds/android-arm64/bare-hrtime.bare +0 -0
  58. package/node_modules/bare-hrtime/prebuilds/android-ia32/bare-hrtime.bare +0 -0
  59. package/node_modules/bare-hrtime/prebuilds/android-x64/bare-hrtime.bare +0 -0
  60. package/node_modules/bare-hrtime/prebuilds/darwin-arm64/bare-hrtime.bare +0 -0
  61. package/node_modules/bare-hrtime/prebuilds/darwin-x64/bare-hrtime.bare +0 -0
  62. package/node_modules/bare-hrtime/prebuilds/ios-arm64/bare-hrtime.bare +0 -0
  63. package/node_modules/bare-hrtime/prebuilds/ios-arm64-simulator/bare-hrtime.bare +0 -0
  64. package/node_modules/bare-hrtime/prebuilds/ios-x64-simulator/bare-hrtime.bare +0 -0
  65. package/node_modules/bare-hrtime/prebuilds/linux-arm64/bare-hrtime.bare +0 -0
  66. package/node_modules/bare-hrtime/prebuilds/linux-x64/bare-hrtime.bare +0 -0
  67. package/node_modules/bare-hrtime/prebuilds/win32-arm64/bare-hrtime.bare +0 -0
  68. package/node_modules/bare-hrtime/prebuilds/win32-x64/bare-hrtime.bare +0 -0
  69. package/node_modules/bare-os/CMakeLists.txt +0 -13
  70. package/node_modules/bare-os/LICENSE +0 -201
  71. package/node_modules/bare-os/README.md +0 -11
  72. package/node_modules/bare-os/binding.c +0 -1025
  73. package/node_modules/bare-os/binding.js +0 -1
  74. package/node_modules/bare-os/index.d.ts +0 -93
  75. package/node_modules/bare-os/index.js +0 -85
  76. package/node_modules/bare-os/lib/constants.js +0 -6
  77. package/node_modules/bare-os/lib/errors.js +0 -22
  78. package/node_modules/bare-os/package.json +0 -46
  79. package/node_modules/bare-os/prebuilds/android-arm/bare-os.bare +0 -0
  80. package/node_modules/bare-os/prebuilds/android-arm64/bare-os.bare +0 -0
  81. package/node_modules/bare-os/prebuilds/android-ia32/bare-os.bare +0 -0
  82. package/node_modules/bare-os/prebuilds/android-x64/bare-os.bare +0 -0
  83. package/node_modules/bare-os/prebuilds/darwin-arm64/bare-os.bare +0 -0
  84. package/node_modules/bare-os/prebuilds/darwin-x64/bare-os.bare +0 -0
  85. package/node_modules/bare-os/prebuilds/ios-arm64/bare-os.bare +0 -0
  86. package/node_modules/bare-os/prebuilds/ios-arm64-simulator/bare-os.bare +0 -0
  87. package/node_modules/bare-os/prebuilds/ios-x64-simulator/bare-os.bare +0 -0
  88. package/node_modules/bare-os/prebuilds/linux-arm64/bare-os.bare +0 -0
  89. package/node_modules/bare-os/prebuilds/linux-x64/bare-os.bare +0 -0
  90. package/node_modules/bare-os/prebuilds/win32-arm64/bare-os.bare +0 -0
  91. package/node_modules/bare-os/prebuilds/win32-x64/bare-os.bare +0 -0
  92. package/node_modules/bare-path/LICENSE +0 -201
  93. package/node_modules/bare-path/NOTICE +0 -28
  94. package/node_modules/bare-path/README.md +0 -19
  95. package/node_modules/bare-path/index.js +0 -11
  96. package/node_modules/bare-path/lib/constants.js +0 -11
  97. package/node_modules/bare-path/lib/posix.js +0 -242
  98. package/node_modules/bare-path/lib/shared.js +0 -67
  99. package/node_modules/bare-path/lib/win32.js +0 -513
  100. package/node_modules/bare-path/package.json +0 -36
  101. package/node_modules/bare-pipe/CMakeLists.txt +0 -13
  102. package/node_modules/bare-pipe/LICENSE +0 -201
  103. package/node_modules/bare-pipe/README.md +0 -21
  104. package/node_modules/bare-pipe/binding.c +0 -798
  105. package/node_modules/bare-pipe/binding.js +0 -1
  106. package/node_modules/bare-pipe/index.js +0 -511
  107. package/node_modules/bare-pipe/lib/constants.js +0 -12
  108. package/node_modules/bare-pipe/lib/errors.js +0 -26
  109. package/node_modules/bare-pipe/package.json +0 -43
  110. package/node_modules/bare-pipe/prebuilds/android-arm/bare-pipe.bare +0 -0
  111. package/node_modules/bare-pipe/prebuilds/android-arm64/bare-pipe.bare +0 -0
  112. package/node_modules/bare-pipe/prebuilds/android-ia32/bare-pipe.bare +0 -0
  113. package/node_modules/bare-pipe/prebuilds/android-x64/bare-pipe.bare +0 -0
  114. package/node_modules/bare-pipe/prebuilds/darwin-arm64/bare-pipe.bare +0 -0
  115. package/node_modules/bare-pipe/prebuilds/darwin-x64/bare-pipe.bare +0 -0
  116. package/node_modules/bare-pipe/prebuilds/ios-arm64/bare-pipe.bare +0 -0
  117. package/node_modules/bare-pipe/prebuilds/ios-arm64-simulator/bare-pipe.bare +0 -0
  118. package/node_modules/bare-pipe/prebuilds/ios-x64-simulator/bare-pipe.bare +0 -0
  119. package/node_modules/bare-pipe/prebuilds/linux-arm64/bare-pipe.bare +0 -0
  120. package/node_modules/bare-pipe/prebuilds/linux-x64/bare-pipe.bare +0 -0
  121. package/node_modules/bare-pipe/prebuilds/win32-arm64/bare-pipe.bare +0 -0
  122. package/node_modules/bare-pipe/prebuilds/win32-x64/bare-pipe.bare +0 -0
  123. package/node_modules/bare-readline/LICENSE +0 -201
  124. package/node_modules/bare-readline/README.md +0 -29
  125. package/node_modules/bare-readline/index.js +0 -219
  126. package/node_modules/bare-readline/package.json +0 -30
  127. package/node_modules/bare-signals/CMakeLists.txt +0 -13
  128. package/node_modules/bare-signals/LICENSE +0 -201
  129. package/node_modules/bare-signals/README.md +0 -23
  130. package/node_modules/bare-signals/binding.c +0 -261
  131. package/node_modules/bare-signals/binding.js +0 -1
  132. package/node_modules/bare-signals/index.js +0 -81
  133. package/node_modules/bare-signals/lib/emitter.js +0 -59
  134. package/node_modules/bare-signals/lib/errors.js +0 -18
  135. package/node_modules/bare-signals/package.json +0 -42
  136. package/node_modules/bare-signals/prebuilds/android-arm/bare-signals.bare +0 -0
  137. package/node_modules/bare-signals/prebuilds/android-arm64/bare-signals.bare +0 -0
  138. package/node_modules/bare-signals/prebuilds/android-ia32/bare-signals.bare +0 -0
  139. package/node_modules/bare-signals/prebuilds/android-x64/bare-signals.bare +0 -0
  140. package/node_modules/bare-signals/prebuilds/darwin-arm64/bare-signals.bare +0 -0
  141. package/node_modules/bare-signals/prebuilds/darwin-x64/bare-signals.bare +0 -0
  142. package/node_modules/bare-signals/prebuilds/ios-arm64/bare-signals.bare +0 -0
  143. package/node_modules/bare-signals/prebuilds/ios-arm64-simulator/bare-signals.bare +0 -0
  144. package/node_modules/bare-signals/prebuilds/ios-x64-simulator/bare-signals.bare +0 -0
  145. package/node_modules/bare-signals/prebuilds/linux-arm64/bare-signals.bare +0 -0
  146. package/node_modules/bare-signals/prebuilds/linux-x64/bare-signals.bare +0 -0
  147. package/node_modules/bare-signals/prebuilds/win32-arm64/bare-signals.bare +0 -0
  148. package/node_modules/bare-signals/prebuilds/win32-x64/bare-signals.bare +0 -0
  149. package/node_modules/bare-stream/LICENSE +0 -201
  150. package/node_modules/bare-stream/README.md +0 -15
  151. package/node_modules/bare-stream/global.js +0 -8
  152. package/node_modules/bare-stream/index.d.ts +0 -237
  153. package/node_modules/bare-stream/index.js +0 -355
  154. package/node_modules/bare-stream/package.json +0 -57
  155. package/node_modules/bare-stream/promises.js +0 -3
  156. package/node_modules/bare-stream/web.js +0 -207
  157. package/node_modules/bare-subprocess/CMakeLists.txt +0 -13
  158. package/node_modules/bare-subprocess/LICENSE +0 -201
  159. package/node_modules/bare-subprocess/README.md +0 -23
  160. package/node_modules/bare-subprocess/binding.c +0 -683
  161. package/node_modules/bare-subprocess/binding.js +0 -1
  162. package/node_modules/bare-subprocess/index.js +0 -256
  163. package/node_modules/bare-subprocess/lib/constants.js +0 -3
  164. package/node_modules/bare-subprocess/lib/errors.js +0 -18
  165. package/node_modules/bare-subprocess/package.json +0 -44
  166. package/node_modules/bare-subprocess/prebuilds/android-arm/bare-subprocess.bare +0 -0
  167. package/node_modules/bare-subprocess/prebuilds/android-arm64/bare-subprocess.bare +0 -0
  168. package/node_modules/bare-subprocess/prebuilds/android-ia32/bare-subprocess.bare +0 -0
  169. package/node_modules/bare-subprocess/prebuilds/android-x64/bare-subprocess.bare +0 -0
  170. package/node_modules/bare-subprocess/prebuilds/darwin-arm64/bare-subprocess.bare +0 -0
  171. package/node_modules/bare-subprocess/prebuilds/darwin-x64/bare-subprocess.bare +0 -0
  172. package/node_modules/bare-subprocess/prebuilds/ios-arm64/bare-subprocess.bare +0 -0
  173. package/node_modules/bare-subprocess/prebuilds/ios-arm64-simulator/bare-subprocess.bare +0 -0
  174. package/node_modules/bare-subprocess/prebuilds/ios-x64-simulator/bare-subprocess.bare +0 -0
  175. package/node_modules/bare-subprocess/prebuilds/linux-arm64/bare-subprocess.bare +0 -0
  176. package/node_modules/bare-subprocess/prebuilds/linux-x64/bare-subprocess.bare +0 -0
  177. package/node_modules/bare-subprocess/prebuilds/win32-arm64/bare-subprocess.bare +0 -0
  178. package/node_modules/bare-subprocess/prebuilds/win32-x64/bare-subprocess.bare +0 -0
  179. package/node_modules/bare-tty/CMakeLists.txt +0 -13
  180. package/node_modules/bare-tty/LICENSE +0 -201
  181. package/node_modules/bare-tty/README.md +0 -21
  182. package/node_modules/bare-tty/binding.c +0 -492
  183. package/node_modules/bare-tty/binding.js +0 -1
  184. package/node_modules/bare-tty/index.js +0 -226
  185. package/node_modules/bare-tty/lib/constants.js +0 -21
  186. package/node_modules/bare-tty/package.json +0 -42
  187. package/node_modules/bare-tty/prebuilds/android-arm/bare-tty.bare +0 -0
  188. package/node_modules/bare-tty/prebuilds/android-arm64/bare-tty.bare +0 -0
  189. package/node_modules/bare-tty/prebuilds/android-ia32/bare-tty.bare +0 -0
  190. package/node_modules/bare-tty/prebuilds/android-x64/bare-tty.bare +0 -0
  191. package/node_modules/bare-tty/prebuilds/darwin-arm64/bare-tty.bare +0 -0
  192. package/node_modules/bare-tty/prebuilds/darwin-x64/bare-tty.bare +0 -0
  193. package/node_modules/bare-tty/prebuilds/ios-arm64/bare-tty.bare +0 -0
  194. package/node_modules/bare-tty/prebuilds/ios-arm64-simulator/bare-tty.bare +0 -0
  195. package/node_modules/bare-tty/prebuilds/ios-x64-simulator/bare-tty.bare +0 -0
  196. package/node_modules/bare-tty/prebuilds/linux-arm64/bare-tty.bare +0 -0
  197. package/node_modules/bare-tty/prebuilds/linux-x64/bare-tty.bare +0 -0
  198. package/node_modules/bare-tty/prebuilds/win32-arm64/bare-tty.bare +0 -0
  199. package/node_modules/bare-tty/prebuilds/win32-x64/bare-tty.bare +0 -0
  200. package/node_modules/child_process/LICENSE +0 -201
  201. package/node_modules/child_process/README.md +0 -11
  202. package/node_modules/child_process/index.js +0 -1
  203. package/node_modules/child_process/package.json +0 -24
  204. package/node_modules/fast-fifo/LICENSE +0 -21
  205. package/node_modules/fast-fifo/README.md +0 -78
  206. package/node_modules/fast-fifo/fixed-size.js +0 -39
  207. package/node_modules/fast-fifo/index.js +0 -48
  208. package/node_modules/fast-fifo/package.json +0 -28
  209. package/node_modules/fs/LICENSE +0 -201
  210. package/node_modules/fs/README.md +0 -11
  211. package/node_modules/fs/index.js +0 -1
  212. package/node_modules/fs/package.json +0 -26
  213. package/node_modules/fs/promises.js +0 -1
  214. package/node_modules/hypercore-id-encoding/LICENSE +0 -201
  215. package/node_modules/hypercore-id-encoding/README.md +0 -55
  216. package/node_modules/hypercore-id-encoding/index.js +0 -44
  217. package/node_modules/hypercore-id-encoding/package.json +0 -33
  218. package/node_modules/node-gyp-build/LICENSE +0 -21
  219. package/node_modules/node-gyp-build/README.md +0 -58
  220. package/node_modules/node-gyp-build/SECURITY.md +0 -5
  221. package/node_modules/node-gyp-build/bin.js +0 -84
  222. package/node_modules/node-gyp-build/build-test.js +0 -19
  223. package/node_modules/node-gyp-build/index.js +0 -6
  224. package/node_modules/node-gyp-build/node-gyp-build.js +0 -207
  225. package/node_modules/node-gyp-build/optional.js +0 -7
  226. package/node_modules/node-gyp-build/package.json +0 -43
  227. package/node_modules/paparam/LICENSE +0 -201
  228. package/node_modules/paparam/README.md +0 -290
  229. package/node_modules/paparam/index.js +0 -786
  230. package/node_modules/paparam/package.json +0 -31
  231. package/node_modules/path/LICENSE +0 -201
  232. package/node_modules/path/README.md +0 -11
  233. package/node_modules/path/index.js +0 -1
  234. package/node_modules/path/package.json +0 -28
  235. package/node_modules/path/posix.js +0 -1
  236. package/node_modules/path/win32.js +0 -1
  237. package/node_modules/pear-api/LICENSE +0 -202
  238. package/node_modules/pear-api/README.md +0 -126
  239. package/node_modules/pear-api/cmd/index.js +0 -4
  240. package/node_modules/pear-api/cmd/pear.js +0 -20
  241. package/node_modules/pear-api/cmd/run.js +0 -30
  242. package/node_modules/pear-api/constants.js +0 -85
  243. package/node_modules/pear-api/crasher.js +0 -71
  244. package/node_modules/pear-api/errors.js +0 -111
  245. package/node_modules/pear-api/gunk.js +0 -80
  246. package/node_modules/pear-api/index.js +0 -170
  247. package/node_modules/pear-api/logger.js +0 -145
  248. package/node_modules/pear-api/node_modules/bare-tty/CMakeLists.txt +0 -13
  249. package/node_modules/pear-api/node_modules/bare-tty/LICENSE +0 -201
  250. package/node_modules/pear-api/node_modules/bare-tty/README.md +0 -21
  251. package/node_modules/pear-api/node_modules/bare-tty/binding.c +0 -525
  252. package/node_modules/pear-api/node_modules/bare-tty/binding.js +0 -1
  253. package/node_modules/pear-api/node_modules/bare-tty/index.js +0 -216
  254. package/node_modules/pear-api/node_modules/bare-tty/lib/constants.js +0 -21
  255. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/CMakeLists.txt +0 -13
  256. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/LICENSE +0 -201
  257. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/README.md +0 -21
  258. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/binding.c +0 -292
  259. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/binding.js +0 -1
  260. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/index.js +0 -70
  261. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/lib/emitter.js +0 -58
  262. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/lib/errors.js +0 -18
  263. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/package.json +0 -46
  264. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/android-arm/bare-signals.bare +0 -0
  265. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/android-arm64/bare-signals.bare +0 -0
  266. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/android-ia32/bare-signals.bare +0 -0
  267. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/android-x64/bare-signals.bare +0 -0
  268. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/darwin-arm64/bare-signals.bare +0 -0
  269. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/darwin-x64/bare-signals.bare +0 -0
  270. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/ios-arm64/bare-signals.bare +0 -0
  271. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/ios-arm64-simulator/bare-signals.bare +0 -0
  272. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/ios-x64-simulator/bare-signals.bare +0 -0
  273. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/linux-arm64/bare-signals.bare +0 -0
  274. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/linux-x64/bare-signals.bare +0 -0
  275. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/win32-arm64/bare-signals.bare +0 -0
  276. package/node_modules/pear-api/node_modules/bare-tty/node_modules/bare-signals/prebuilds/win32-x64/bare-signals.bare +0 -0
  277. package/node_modules/pear-api/node_modules/bare-tty/package.json +0 -46
  278. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/android-arm/bare-tty.bare +0 -0
  279. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/android-arm64/bare-tty.bare +0 -0
  280. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/android-ia32/bare-tty.bare +0 -0
  281. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/android-x64/bare-tty.bare +0 -0
  282. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/darwin-arm64/bare-tty.bare +0 -0
  283. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/darwin-x64/bare-tty.bare +0 -0
  284. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/ios-arm64/bare-tty.bare +0 -0
  285. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/ios-arm64-simulator/bare-tty.bare +0 -0
  286. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/ios-x64-simulator/bare-tty.bare +0 -0
  287. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/linux-arm64/bare-tty.bare +0 -0
  288. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/linux-x64/bare-tty.bare +0 -0
  289. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/win32-arm64/bare-tty.bare +0 -0
  290. package/node_modules/pear-api/node_modules/bare-tty/prebuilds/win32-x64/bare-tty.bare +0 -0
  291. package/node_modules/pear-api/package.json +0 -59
  292. package/node_modules/pear-api/parse-link.js +0 -6
  293. package/node_modules/pear-api/state.js +0 -153
  294. package/node_modules/pear-api/teardown.js +0 -86
  295. package/node_modules/pear-api/terminal.js +0 -373
  296. package/node_modules/pear-api/transform.js +0 -72
  297. package/node_modules/pear-api/tryboot.js +0 -29
  298. package/node_modules/pear-api/worker.js +0 -77
  299. package/node_modules/pear-link/LICENSE +0 -202
  300. package/node_modules/pear-link/README.md +0 -3
  301. package/node_modules/pear-link/index.js +0 -108
  302. package/node_modules/pear-link/package.json +0 -38
  303. package/node_modules/safety-catch/LICENSE +0 -21
  304. package/node_modules/safety-catch/README.md +0 -29
  305. package/node_modules/safety-catch/example.js +0 -7
  306. package/node_modules/safety-catch/index.js +0 -23
  307. package/node_modules/safety-catch/package.json +0 -18
  308. package/node_modules/sodium-native/CMakeLists.txt +0 -241
  309. package/node_modules/sodium-native/LICENSE +0 -21
  310. package/node_modules/sodium-native/README.md +0 -51
  311. package/node_modules/sodium-native/binding.c +0 -3470
  312. package/node_modules/sodium-native/extensions/pbkdf2/pbkdf2.c +0 -90
  313. package/node_modules/sodium-native/extensions/pbkdf2/pbkdf2.h +0 -54
  314. package/node_modules/sodium-native/extensions/tweak/tweak.c +0 -206
  315. package/node_modules/sodium-native/extensions/tweak/tweak.h +0 -54
  316. package/node_modules/sodium-native/index.js +0 -1
  317. package/node_modules/sodium-native/macros.h +0 -319
  318. package/node_modules/sodium-native/package.json +0 -47
  319. package/node_modules/sodium-native/prebuilds/android-arm/sodium-native.bare +0 -0
  320. package/node_modules/sodium-native/prebuilds/android-arm/sodium-native.node +0 -0
  321. package/node_modules/sodium-native/prebuilds/android-arm64/sodium-native.bare +0 -0
  322. package/node_modules/sodium-native/prebuilds/android-arm64/sodium-native.node +0 -0
  323. package/node_modules/sodium-native/prebuilds/android-ia32/sodium-native.bare +0 -0
  324. package/node_modules/sodium-native/prebuilds/android-ia32/sodium-native.node +0 -0
  325. package/node_modules/sodium-native/prebuilds/android-x64/sodium-native.bare +0 -0
  326. package/node_modules/sodium-native/prebuilds/android-x64/sodium-native.node +0 -0
  327. package/node_modules/sodium-native/prebuilds/darwin-arm64/sodium-native.bare +0 -0
  328. package/node_modules/sodium-native/prebuilds/darwin-arm64/sodium-native.node +0 -0
  329. package/node_modules/sodium-native/prebuilds/darwin-x64/sodium-native.bare +0 -0
  330. package/node_modules/sodium-native/prebuilds/darwin-x64/sodium-native.node +0 -0
  331. package/node_modules/sodium-native/prebuilds/ios-arm64/sodium-native.bare +0 -0
  332. package/node_modules/sodium-native/prebuilds/ios-arm64-simulator/sodium-native.bare +0 -0
  333. package/node_modules/sodium-native/prebuilds/ios-x64-simulator/sodium-native.bare +0 -0
  334. package/node_modules/sodium-native/prebuilds/linux-arm64/sodium-native.bare +0 -0
  335. package/node_modules/sodium-native/prebuilds/linux-arm64/sodium-native.node +0 -0
  336. package/node_modules/sodium-native/prebuilds/linux-x64/sodium-native.bare +0 -0
  337. package/node_modules/sodium-native/prebuilds/linux-x64/sodium-native.node +0 -0
  338. package/node_modules/sodium-native/prebuilds/win32-arm64/sodium-native.bare +0 -0
  339. package/node_modules/sodium-native/prebuilds/win32-arm64/sodium-native.node +0 -0
  340. package/node_modules/sodium-native/prebuilds/win32-x64/sodium-native.bare +0 -0
  341. package/node_modules/sodium-native/prebuilds/win32-x64/sodium-native.node +0 -0
  342. package/node_modules/streamx/LICENSE +0 -21
  343. package/node_modules/streamx/README.md +0 -489
  344. package/node_modules/streamx/index.js +0 -1181
  345. package/node_modules/streamx/package.json +0 -41
  346. package/node_modules/text-decoder/LICENSE +0 -201
  347. package/node_modules/text-decoder/README.md +0 -36
  348. package/node_modules/text-decoder/index.js +0 -64
  349. package/node_modules/text-decoder/lib/browser-decoder.js +0 -17
  350. package/node_modules/text-decoder/lib/pass-through-decoder.js +0 -19
  351. package/node_modules/text-decoder/lib/utf8-decoder.js +0 -104
  352. package/node_modules/text-decoder/package.json +0 -38
  353. package/node_modules/tiny-byte-size/LICENSE +0 -21
  354. package/node_modules/tiny-byte-size/README.md +0 -24
  355. package/node_modules/tiny-byte-size/index.js +0 -21
  356. package/node_modules/tiny-byte-size/package.json +0 -27
  357. package/node_modules/url-file-url/LICENSE +0 -201
  358. package/node_modules/url-file-url/README.md +0 -22
  359. package/node_modules/url-file-url/index.js +0 -66
  360. package/node_modules/url-file-url/package.json +0 -35
  361. package/node_modules/which-runtime/LICENSE +0 -201
  362. package/node_modules/which-runtime/README.md +0 -29
  363. package/node_modules/which-runtime/index.js +0 -22
  364. package/node_modules/which-runtime/package.json +0 -26
  365. package/node_modules/z32/.github/workflows/test-node.yml +0 -23
  366. package/node_modules/z32/LICENSE +0 -21
  367. package/node_modules/z32/README.md +0 -35
  368. package/node_modules/z32/benchmark.js +0 -133
  369. package/node_modules/z32/index.js +0 -126
  370. package/node_modules/z32/package.json +0 -31
  371. package/node_modules/z32/test.js +0 -49
package/boot.bundle CHANGED
@@ -1,5 +1,5 @@
1
- 44604
2
- {"version":0,"id":null,"main":"/boot.js","imports":{},"resolutions":{"/boot.js":{"#package":"/package.json","./electron-main.js":"/electron-main.js","./preload.js":"/preload.js","bare:package":"/package.json","pear-api/constants":"/node_modules/pear-api/constants.js","which-runtime":"/node_modules/which-runtime/index.js"},"/electron-main.js":{"#package":"/package.json","./gui":"/gui/index.js","bare:package":"/package.json","paparam":"/node_modules/paparam/index.js","pear-api/cmd/run":"/node_modules/pear-api/cmd/run.js","pear-api/constants":"/node_modules/pear-api/constants.js","pear-api/crasher":"/node_modules/pear-api/crasher.js","pear-api/state":"/node_modules/pear-api/state.js","pear-api/tryboot":"/node_modules/pear-api/tryboot.js","which-runtime":"/node_modules/which-runtime/index.js"},"/gui/decal.js":{"#package":"/package.json","bare:package":"/package.json"},"/gui/gui.js":{"#package":"/package.json","./decal":"/gui/decal.js","./icons/tray":"/gui/icons/tray.js","bare:package":"/package.json","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","path":"/node_modules/path/index.js","pear-api/constants":"/node_modules/pear-api/constants.js","pear-api/worker":"/node_modules/pear-api/worker.js","pear-ipc":"/node_modules/pear-ipc/index.js","ready-resource":"/node_modules/ready-resource/index.js","unix-path-resolve":"/node_modules/unix-path-resolve/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/gui/icons/tray.js":{"#package":"/package.json","bare:package":"/package.json"},"/gui/index.js":{"#package":"/package.json","./gui":"/gui/gui.js","./preload":"/gui/preload.js","bare:package":"/package.json"},"/gui/preload.js":{"#package":"/package.json","bare:package":"/package.json","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","iambus":"/node_modules/iambus/index.js","pear-api/constants":"/node_modules/pear-api/constants.js","pear-api/worker":"/node_modules/pear-api/worker.js","streamx":"/node_modules/streamx/index.js"},"/node_modules/b4a/index.js":{"#package":"/node_modules/b4a/package.json","bare:package":"/node_modules/b4a/package.json"},"/node_modules/bare-env/index.js":{"#package":"/node_modules/bare-env/package.json","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-env/package.json"},"/node_modules/bare-events/index.js":{"#package":"/node_modules/bare-events/package.json","./lib/errors":"/node_modules/bare-events/lib/errors.js","bare:package":"/node_modules/bare-events/package.json"},"/node_modules/bare-events/lib/errors.js":{"#package":"/node_modules/bare-events/package.json","bare:package":"/node_modules/bare-events/package.json"},"/node_modules/bare-fs/":{"bare:addon":"/../prebuilds/darwin-arm64/a5ac624bf012486ee2e442a9fbc4b1cf41f0e15a6e3a0e30ecfff6265861a688.bare"},"/node_modules/bare-fs/binding.js":{"#package":"/node_modules/bare-fs/package.json",".":{"addon":"/../prebuilds/darwin-arm64/a5ac624bf012486ee2e442a9fbc4b1cf41f0e15a6e3a0e30ecfff6265861a688.bare"},"bare:package":"/node_modules/bare-fs/package.json"},"/node_modules/bare-fs/index.js":{"#package":"/node_modules/bare-fs/package.json","./binding":"/node_modules/bare-fs/binding.js","bare-events":"/node_modules/bare-events/index.js","bare-path":"/node_modules/bare-path/index.js","bare-stream":"/node_modules/bare-stream/index.js","bare:package":"/node_modules/bare-fs/package.json"},"/node_modules/bare-os/":{"bare:addon":"/../prebuilds/darwin-arm64/e2ab0cd75e61952b2b5e3651cf68d51f02352c99b8bef4ad459dfec376bee17d.bare"},"/node_modules/bare-os/binding.js":{"#package":"/node_modules/bare-os/package.json",".":{"addon":"/../prebuilds/darwin-arm64/e2ab0cd75e61952b2b5e3651cf68d51f02352c99b8bef4ad459dfec376bee17d.bare"},"bare:package":"/node_modules/bare-os/package.json"},"/node_modules/bare-os/index.js":{"#package":"/node_modules/bare-os/package.json","./binding":"/node_modules/bare-os/binding.js","./lib/constants":"/node_modules/bare-os/lib/constants.js","./lib/errors":"/node_modules/bare-os/lib/errors.js","bare:package":"/node_modules/bare-os/package.json"},"/node_modules/bare-os/lib/constants.js":{"#package":"/node_modules/bare-os/package.json","../binding":"/node_modules/bare-os/binding.js","bare:package":"/node_modules/bare-os/package.json"},"/node_modules/bare-os/lib/errors.js":{"#package":"/node_modules/bare-os/package.json","bare:package":"/node_modules/bare-os/package.json"},"/node_modules/bare-path/index.js":{"#package":"/node_modules/bare-path/package.json","./lib/posix":"/node_modules/bare-path/lib/posix.js","./lib/win32":"/node_modules/bare-path/lib/win32.js","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-path/lib/constants.js":{"#package":"/node_modules/bare-path/package.json","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-path/lib/posix.js":{"#package":"/node_modules/bare-path/package.json","./constants":"/node_modules/bare-path/lib/constants.js","./shared":"/node_modules/bare-path/lib/shared.js","./win32":"/node_modules/bare-path/lib/win32.js","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-path/lib/shared.js":{"#package":"/node_modules/bare-path/package.json","./constants":"/node_modules/bare-path/lib/constants.js","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-path/lib/win32.js":{"#package":"/node_modules/bare-path/package.json","./constants":"/node_modules/bare-path/lib/constants.js","./posix":"/node_modules/bare-path/lib/posix.js","./shared":"/node_modules/bare-path/lib/shared.js","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-pipe/":{"bare:addon":"/../prebuilds/darwin-arm64/4f3bee5e1f1b27319413fc3b328cd68a6694823608eed58e0f45b52927234530.bare"},"/node_modules/bare-pipe/binding.js":{"#package":"/node_modules/bare-pipe/package.json",".":{"addon":"/../prebuilds/darwin-arm64/4f3bee5e1f1b27319413fc3b328cd68a6694823608eed58e0f45b52927234530.bare"},"bare:package":"/node_modules/bare-pipe/package.json"},"/node_modules/bare-pipe/index.js":{"#package":"/node_modules/bare-pipe/package.json","./binding":"/node_modules/bare-pipe/binding.js","./lib/constants":"/node_modules/bare-pipe/lib/constants.js","./lib/errors":"/node_modules/bare-pipe/lib/errors.js","bare-events":"/node_modules/bare-events/index.js","bare-stream":"/node_modules/bare-stream/index.js","bare:package":"/node_modules/bare-pipe/package.json"},"/node_modules/bare-pipe/lib/constants.js":{"#package":"/node_modules/bare-pipe/package.json","bare:package":"/node_modules/bare-pipe/package.json"},"/node_modules/bare-pipe/lib/errors.js":{"#package":"/node_modules/bare-pipe/package.json","bare:package":"/node_modules/bare-pipe/package.json"},"/node_modules/bare-signals/":{"bare:addon":"/../prebuilds/darwin-arm64/87676633cb5aa00eebe6dc64c6d37894e17c6b395642d0b85984df8ee14d9de5.bare"},"/node_modules/bare-signals/binding.js":{"#package":"/node_modules/bare-signals/package.json",".":{"addon":"/../prebuilds/darwin-arm64/87676633cb5aa00eebe6dc64c6d37894e17c6b395642d0b85984df8ee14d9de5.bare"},"bare:package":"/node_modules/bare-signals/package.json"},"/node_modules/bare-signals/index.js":{"#package":"/node_modules/bare-signals/package.json","./binding":"/node_modules/bare-signals/binding.js","./lib/emitter":"/node_modules/bare-signals/lib/emitter.js","./lib/errors":"/node_modules/bare-signals/lib/errors.js","bare-events":"/node_modules/bare-events/index.js","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-signals/package.json"},"/node_modules/bare-signals/lib/emitter.js":{"#package":"/node_modules/bare-signals/package.json","..":"/node_modules/bare-signals/index.js","bare-events":"/node_modules/bare-events/index.js","bare:package":"/node_modules/bare-signals/package.json"},"/node_modules/bare-signals/lib/errors.js":{"#package":"/node_modules/bare-signals/package.json","bare:package":"/node_modules/bare-signals/package.json"},"/node_modules/bare-stream/index.js":{"#package":"/node_modules/bare-stream/package.json","bare:package":"/node_modules/bare-stream/package.json","streamx":"/node_modules/streamx/index.js"},"/node_modules/bare-subprocess/":{"bare:addon":"/../prebuilds/darwin-arm64/c71ab61f4118274f7c7fe3489836eb616ddc7d899bf00f92d088ce3bee60ab05.bare"},"/node_modules/bare-subprocess/binding.js":{"#package":"/node_modules/bare-subprocess/package.json",".":{"addon":"/../prebuilds/darwin-arm64/c71ab61f4118274f7c7fe3489836eb616ddc7d899bf00f92d088ce3bee60ab05.bare"},"bare:package":"/node_modules/bare-subprocess/package.json"},"/node_modules/bare-subprocess/index.js":{"#package":"/node_modules/bare-subprocess/package.json","./binding":"/node_modules/bare-subprocess/binding.js","./lib/constants":"/node_modules/bare-subprocess/lib/constants.js","./lib/errors":"/node_modules/bare-subprocess/lib/errors.js","bare-env":"/node_modules/bare-env/index.js","bare-events":"/node_modules/bare-events/index.js","bare-os":"/node_modules/bare-os/index.js","bare-pipe":"/node_modules/bare-pipe/index.js","bare:package":"/node_modules/bare-subprocess/package.json"},"/node_modules/bare-subprocess/lib/constants.js":{"#package":"/node_modules/bare-subprocess/package.json","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-subprocess/package.json"},"/node_modules/bare-subprocess/lib/errors.js":{"#package":"/node_modules/bare-subprocess/package.json","bare:package":"/node_modules/bare-subprocess/package.json"},"/node_modules/child_process/index.js":{"#package":"/node_modules/child_process/package.json","bare-subprocess":"/node_modules/bare-subprocess/index.js","bare:package":"/node_modules/child_process/package.json"},"/node_modules/compact-encoding/endian.js":{"#package":"/node_modules/compact-encoding/package.json","bare:package":"/node_modules/compact-encoding/package.json"},"/node_modules/compact-encoding/index.js":{"#package":"/node_modules/compact-encoding/package.json","./endian":"/node_modules/compact-encoding/endian.js","./lexint":"/node_modules/compact-encoding/lexint.js","./raw":"/node_modules/compact-encoding/raw.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/compact-encoding/package.json"},"/node_modules/compact-encoding/lexint.js":{"#package":"/node_modules/compact-encoding/package.json","bare:package":"/node_modules/compact-encoding/package.json"},"/node_modules/compact-encoding/raw.js":{"#package":"/node_modules/compact-encoding/package.json","./endian":"/node_modules/compact-encoding/endian.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/compact-encoding/package.json"},"/node_modules/crc-native/":{"bare:addon":"/../prebuilds/darwin-arm64/bc135bd4f568a9f30fea2a5268dc3431e77955fc9d0d29944cc49f430b14d672.node"},"/node_modules/crc-native/binding.js":{"#package":"/node_modules/crc-native/package.json","/node_modules/crc-native":{"addon":"/../prebuilds/darwin-arm64/bc135bd4f568a9f30fea2a5268dc3431e77955fc9d0d29944cc49f430b14d672.node"},"bare:package":"/node_modules/crc-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/crc-native/index.js":{"#package":"/node_modules/crc-native/package.json","./binding":"/node_modules/crc-native/binding.js","bare:package":"/node_modules/crc-native/package.json"},"/node_modules/crc-universal/fallback.js":{"#package":"/node_modules/crc-universal/package.json","./lookup":"/node_modules/crc-universal/lookup.js","bare:package":"/node_modules/crc-universal/package.json"},"/node_modules/crc-universal/index.js":{"#package":"/node_modules/crc-universal/package.json","./fallback":"/node_modules/crc-universal/fallback.js","bare:package":"/node_modules/crc-universal/package.json","crc-native":"/node_modules/crc-native/index.js"},"/node_modules/crc-universal/lookup.js":{"#package":"/node_modules/crc-universal/package.json","bare:package":"/node_modules/crc-universal/package.json"},"/node_modules/fast-fifo/fixed-size.js":{"#package":"/node_modules/fast-fifo/package.json","bare:package":"/node_modules/fast-fifo/package.json"},"/node_modules/fast-fifo/index.js":{"#package":"/node_modules/fast-fifo/package.json","./fixed-size":"/node_modules/fast-fifo/fixed-size.js","bare:package":"/node_modules/fast-fifo/package.json"},"/node_modules/framed-stream/index.js":{"#package":"/node_modules/framed-stream/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/framed-stream/package.json","streamx":"/node_modules/streamx/index.js"},"/node_modules/fs-native-extensions/":{"bare:addon":"/../prebuilds/darwin-arm64/5c28de4fba954fd34ec2fe9c4bd46f8093a0312fa4856b4bb1d69dacff5206c6.node"},"/node_modules/fs-native-extensions/binding.js":{"#package":"/node_modules/fs-native-extensions/package.json","/node_modules/fs-native-extensions":{"addon":"/../prebuilds/darwin-arm64/5c28de4fba954fd34ec2fe9c4bd46f8093a0312fa4856b4bb1d69dacff5206c6.node"},"bare:package":"/node_modules/fs-native-extensions/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/fs-native-extensions/index.js":{"#package":"/node_modules/fs-native-extensions/package.json","./binding":"/node_modules/fs-native-extensions/binding.js","bare:package":"/node_modules/fs-native-extensions/package.json","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/fs/index.js":{"#package":"/node_modules/fs/package.json","bare-fs":"/node_modules/bare-fs/index.js","bare:package":"/node_modules/fs/package.json"},"/node_modules/hypercore-crypto/index.js":{"#package":"/node_modules/hypercore-crypto/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/hypercore-crypto/package.json","compact-encoding":"/node_modules/compact-encoding/index.js","sodium-universal":"/node_modules/sodium-universal/index.js"},"/node_modules/hypercore-id-encoding/index.js":{"#package":"/node_modules/hypercore-id-encoding/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/hypercore-id-encoding/package.json","z32":"/node_modules/z32/index.js"},"/node_modules/iambus/index.js":{"#package":"/node_modules/iambus/package.json","bare:package":"/node_modules/iambus/package.json","nanoassert":"/node_modules/nanoassert/index.js","streamx":"/node_modules/streamx/index.js"},"/node_modules/nanoassert/index.js":{"#package":"/node_modules/nanoassert/package.json","bare:package":"/node_modules/nanoassert/package.json"},"/node_modules/node-gyp-build/index.js":{"#package":"/node_modules/node-gyp-build/package.json","./node-gyp-build.js":"/node_modules/node-gyp-build/node-gyp-build.js","bare:package":"/node_modules/node-gyp-build/package.json"},"/node_modules/node-gyp-build/node-gyp-build.js":{"#package":"/node_modules/node-gyp-build/package.json","bare:package":"/node_modules/node-gyp-build/package.json"},"/node_modules/paparam/index.js":{"#package":"/node_modules/paparam/package.json","bare:package":"/node_modules/paparam/package.json"},"/node_modules/path/index.js":{"#package":"/node_modules/path/package.json","bare-path":"/node_modules/bare-path/index.js","bare:package":"/node_modules/path/package.json"},"/node_modules/pear-api/cmd/index.js":{"#package":"/node_modules/pear-api/package.json","./pear":"/node_modules/pear-api/cmd/pear.js","bare:package":"/node_modules/pear-api/package.json","paparam":"/node_modules/paparam/index.js"},"/node_modules/pear-api/cmd/pear.js":{"#package":"/node_modules/pear-api/package.json","bare:package":"/node_modules/pear-api/package.json","paparam":"/node_modules/paparam/index.js"},"/node_modules/pear-api/cmd/run.js":{"#package":"/node_modules/pear-api/package.json","bare:package":"/node_modules/pear-api/package.json","paparam":"/node_modules/paparam/index.js"},"/node_modules/pear-api/constants.js":{"#package":"/node_modules/pear-api/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/pear-api/package.json","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","sodium-native":"/node_modules/sodium-native/index.js","url-file-url":"/node_modules/url-file-url/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-api/crasher.js":{"#package":"/node_modules/pear-api/package.json","./constants":"/node_modules/pear-api/constants.js","bare-fs":"/node_modules/bare-fs/index.js","bare-os":"/node_modules/bare-os/index.js","bare-path":"/node_modules/bare-path/index.js","bare:package":"/node_modules/pear-api/package.json","fs":"/node_modules/fs/index.js","path":"/node_modules/path/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-api/errors.js":{"#package":"/node_modules/pear-api/package.json","bare:package":"/node_modules/pear-api/package.json"},"/node_modules/pear-api/gunk.js":{"#package":"/node_modules/pear-api/package.json","bare:package":"/node_modules/pear-api/package.json","crc-universal":"/node_modules/crc-universal/index.js","fs-native-extensions":"/node_modules/fs-native-extensions/index.js","quickbit-universal":"/node_modules/quickbit-universal/index.js","script-linker/defaults":"/node_modules/script-linker/defaults.js","sodium-native":"/node_modules/sodium-native/index.js","udx-native":"/node_modules/udx-native/lib/udx.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-api/index.js":{"#package":"/node_modules/pear-api/package.json","./constants":"/node_modules/pear-api/constants.js","./teardown":"/node_modules/pear-api/teardown.js","./worker":"/node_modules/pear-api/worker.js","bare:package":"/node_modules/pear-api/package.json"},"/node_modules/pear-api/parse-link.js":{"#package":"/node_modules/pear-api/package.json","./constants":"/node_modules/pear-api/constants.js","./errors":"/node_modules/pear-api/errors.js","bare:package":"/node_modules/pear-api/package.json","pear-link":"/node_modules/pear-link/index.js"},"/node_modules/pear-api/state.js":{"#package":"/node_modules/pear-api/package.json","./errors":"/node_modules/pear-api/errors.js","./parse-link":"/node_modules/pear-api/parse-link.js","bare-env":"/node_modules/bare-env/index.js","bare-fs":"/node_modules/bare-fs/index.js","bare-os":"/node_modules/bare-os/index.js","bare-path":"/node_modules/bare-path/index.js","bare:package":"/node_modules/pear-api/package.json","fs":"/node_modules/fs/index.js","hypercore-crypto":"/node_modules/hypercore-crypto/index.js","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","path":"/node_modules/path/index.js","pear-api/constants":"/node_modules/pear-api/constants.js","url-file-url":"/node_modules/url-file-url/index.js","which-runtime":"/node_modules/which-runtime/index.js","z32":"/node_modules/z32/index.js"},"/node_modules/pear-api/teardown.js":{"#package":"/node_modules/pear-api/package.json","bare-signals":"/node_modules/bare-signals/index.js","bare:package":"/node_modules/pear-api/package.json","safety-catch":"/node_modules/safety-catch/index.js"},"/node_modules/pear-api/tryboot.js":{"#package":"/node_modules/pear-api/package.json","./cmd":"/node_modules/pear-api/cmd/index.js","./constants":"/node_modules/pear-api/constants.js","bare:package":"/node_modules/pear-api/package.json","child_process":"/node_modules/child_process/index.js"},"/node_modules/pear-api/worker.js":{"#package":"/node_modules/pear-api/package.json","./cmd/run":"/node_modules/pear-api/cmd/run.js","./constants":"/node_modules/pear-api/constants.js","./teardown":"/node_modules/pear-api/teardown.js","bare-pipe":"/node_modules/bare-pipe/index.js","bare:package":"/node_modules/pear-api/package.json","child_process":"/node_modules/child_process/index.js","fs":"/node_modules/fs/index.js","paparam":"/node_modules/paparam/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-ipc/api.js":{"#package":"/node_modules/pear-ipc/package.json","bare:package":"/node_modules/pear-ipc/package.json","fs":"/node_modules/bare-fs/index.js","fs-native-extensions":"/node_modules/fs-native-extensions/index.js"},"/node_modules/pear-ipc/client.js":{"#package":"/node_modules/pear-ipc/package.json","./api":"/node_modules/pear-ipc/api.js","./constants":"/node_modules/pear-ipc/constants.js","./methods":"/node_modules/pear-ipc/methods.js","bare:package":"/node_modules/pear-ipc/package.json","framed-stream":"/node_modules/framed-stream/index.js","net":"/node_modules/bare-pipe/index.js","path":"/node_modules/bare-path/index.js","ready-resource":"/node_modules/ready-resource/index.js","tiny-buffer-rpc":"/node_modules/tiny-buffer-rpc/index.js","tiny-buffer-rpc/any":"/node_modules/tiny-buffer-rpc/any.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-ipc/constants.js":{"#package":"/node_modules/pear-ipc/package.json","bare:package":"/node_modules/pear-ipc/package.json","os":"/node_modules/bare-os/index.js","path":"/node_modules/bare-path/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-ipc/index.js":{"#package":"/node_modules/pear-ipc/package.json","./client":"/node_modules/pear-ipc/client.js","./server":"/node_modules/pear-ipc/server.js","bare:package":"/node_modules/pear-ipc/package.json"},"/node_modules/pear-ipc/methods.js":{"#package":"/node_modules/pear-ipc/package.json","bare:package":"/node_modules/pear-ipc/package.json"},"/node_modules/pear-ipc/server.js":{"#package":"/node_modules/pear-ipc/package.json","./api":"/node_modules/pear-ipc/api.js","./constants":"/node_modules/pear-ipc/constants.js","./methods":"/node_modules/pear-ipc/methods.js","bare:package":"/node_modules/pear-ipc/package.json","framed-stream":"/node_modules/framed-stream/index.js","fs":"/node_modules/bare-fs/index.js","net":"/node_modules/bare-pipe/index.js","path":"/node_modules/bare-path/index.js","ready-resource":"/node_modules/ready-resource/index.js","streamx":"/node_modules/streamx/index.js","tiny-buffer-rpc":"/node_modules/tiny-buffer-rpc/index.js","tiny-buffer-rpc/any":"/node_modules/tiny-buffer-rpc/any.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-link/index.js":{"#package":"/node_modules/pear-link/package.json","bare:package":"/node_modules/pear-link/package.json","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","path":"/node_modules/bare-path/index.js"},"/node_modules/quickbit-native/":{"bare:addon":"/../prebuilds/darwin-arm64/1b2dea778d4373c9f7ffd17509eec9dd70bf77c0dda602e373809f1b730fa4f8.node"},"/node_modules/quickbit-native/binding.js":{"#package":"/node_modules/quickbit-native/package.json","/node_modules/quickbit-native":{"addon":"/../prebuilds/darwin-arm64/1b2dea778d4373c9f7ffd17509eec9dd70bf77c0dda602e373809f1b730fa4f8.node"},"bare:package":"/node_modules/quickbit-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/quickbit-native/index.js":{"#package":"/node_modules/quickbit-native/package.json","./binding":"/node_modules/quickbit-native/binding.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/quickbit-native/package.json"},"/node_modules/quickbit-universal/fallback.js":{"#package":"/node_modules/quickbit-universal/package.json","bare:package":"/node_modules/quickbit-universal/package.json","simdle-universal":"/node_modules/simdle-universal/index.js"},"/node_modules/quickbit-universal/index.js":{"#package":"/node_modules/quickbit-universal/package.json","./fallback":"/node_modules/quickbit-universal/fallback.js","bare:package":"/node_modules/quickbit-universal/package.json","quickbit-native":"/node_modules/quickbit-native/index.js"},"/node_modules/ready-resource/index.js":{"#package":"/node_modules/ready-resource/package.json","bare:package":"/node_modules/ready-resource/package.json","events":"/node_modules/bare-events/index.js"},"/node_modules/safety-catch/index.js":{"#package":"/node_modules/safety-catch/package.json","bare:package":"/node_modules/safety-catch/package.json"},"/node_modules/script-linker/defaults.js":{"#package":"/node_modules/script-linker/package.json","./lib/compile":"/node_modules/script-linker/lib/compile.js","bare:package":"/node_modules/script-linker/package.json"},"/node_modules/script-linker/lib/compile.js":{"#package":"/node_modules/script-linker/package.json","bare:package":"/node_modules/script-linker/package.json"},"/node_modules/script-linker/runtime.js":{"#package":"/node_modules/script-linker/package.json","./defaults":"/node_modules/script-linker/defaults.js","bare:package":"/node_modules/script-linker/package.json","unix-path-resolve":"/node_modules/unix-path-resolve/index.js"},"/node_modules/simdle-native/":{"bare:addon":"/../prebuilds/darwin-arm64/6ad2240f689676549489f843afe5714ed3f582002918048495589cc06752e14b.node"},"/node_modules/simdle-native/binding.js":{"#package":"/node_modules/simdle-native/package.json","/node_modules/simdle-native":{"addon":"/../prebuilds/darwin-arm64/6ad2240f689676549489f843afe5714ed3f582002918048495589cc06752e14b.node"},"bare:package":"/node_modules/simdle-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/simdle-native/index.js":{"#package":"/node_modules/simdle-native/package.json","./binding":"/node_modules/simdle-native/binding.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/simdle-native/package.json"},"/node_modules/simdle-universal/fallback.js":{"#package":"/node_modules/simdle-universal/package.json","./scalar":"/node_modules/simdle-universal/scalar.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/simdle-universal/package.json"},"/node_modules/simdle-universal/index.js":{"#package":"/node_modules/simdle-universal/package.json","./fallback":"/node_modules/simdle-universal/fallback.js","bare:package":"/node_modules/simdle-universal/package.json","simdle-native":"/node_modules/simdle-native/index.js"},"/node_modules/simdle-universal/scalar.js":{"#package":"/node_modules/simdle-universal/package.json","bare:package":"/node_modules/simdle-universal/package.json"},"/node_modules/sodium-native/":{"bare:addon":"/../prebuilds/darwin-arm64/3fb29667ec6f34245227e44c6dc9182f319561cf15553414975ba80c7f942203.node"},"/node_modules/sodium-native/index.js":{"#package":"/node_modules/sodium-native/package.json","/node_modules/sodium-native":{"addon":"/../prebuilds/darwin-arm64/3fb29667ec6f34245227e44c6dc9182f319561cf15553414975ba80c7f942203.node"},"bare:package":"/node_modules/sodium-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/sodium-universal/index.js":{"#package":"/node_modules/sodium-universal/package.json","bare:package":"/node_modules/sodium-universal/package.json","sodium-native":"/node_modules/sodium-native/index.js"},"/node_modules/streamx/index.js":{"#package":"/node_modules/streamx/package.json","bare:package":"/node_modules/streamx/package.json","events":"/node_modules/bare-events/index.js","fast-fifo":"/node_modules/fast-fifo/index.js","text-decoder":"/node_modules/text-decoder/index.js"},"/node_modules/text-decoder/index.js":{"#package":"/node_modules/text-decoder/package.json","./lib/pass-through-decoder":"/node_modules/text-decoder/lib/pass-through-decoder.js","./lib/utf8-decoder":"/node_modules/text-decoder/lib/utf8-decoder.js","bare:package":"/node_modules/text-decoder/package.json"},"/node_modules/text-decoder/lib/pass-through-decoder.js":{"#package":"/node_modules/text-decoder/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/text-decoder/package.json"},"/node_modules/text-decoder/lib/utf8-decoder.js":{"#package":"/node_modules/text-decoder/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/text-decoder/package.json"},"/node_modules/tiny-buffer-rpc/any.js":{"#package":"/node_modules/tiny-buffer-rpc/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/tiny-buffer-rpc/package.json","compact-encoding":"/node_modules/compact-encoding/index.js"},"/node_modules/tiny-buffer-rpc/index.js":{"#package":"/node_modules/tiny-buffer-rpc/package.json","./messages.js":"/node_modules/tiny-buffer-rpc/messages.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/tiny-buffer-rpc/package.json","compact-encoding":"/node_modules/compact-encoding/index.js","safety-catch":"/node_modules/safety-catch/index.js","streamx":"/node_modules/streamx/index.js"},"/node_modules/tiny-buffer-rpc/messages.js":{"#package":"/node_modules/tiny-buffer-rpc/package.json","bare:package":"/node_modules/tiny-buffer-rpc/package.json","compact-encoding":"/node_modules/compact-encoding/index.js"},"/node_modules/udx-native/":{"bare:addon":"/../prebuilds/darwin-arm64/1238d9532907d86983a11321f9b849f4611779bb10c4010afbb97d785bf4d7b6.node"},"/node_modules/udx-native/binding.js":{"#package":"/node_modules/udx-native/package.json","/node_modules/udx-native":{"addon":"/../prebuilds/darwin-arm64/1238d9532907d86983a11321f9b849f4611779bb10c4010afbb97d785bf4d7b6.node"},"bare:package":"/node_modules/udx-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/udx-native/lib/ip.js":{"#package":"/node_modules/udx-native/package.json","bare:package":"/node_modules/udx-native/package.json"},"/node_modules/udx-native/lib/network-interfaces.js":{"#package":"/node_modules/udx-native/package.json","../binding":"/node_modules/udx-native/binding.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/udx-native/package.json","events":"/node_modules/bare-events/index.js"},"/node_modules/udx-native/lib/socket.js":{"#package":"/node_modules/udx-native/package.json","../binding":"/node_modules/udx-native/binding.js","./ip":"/node_modules/udx-native/lib/ip.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/udx-native/package.json","events":"/node_modules/bare-events/index.js"},"/node_modules/udx-native/lib/stream.js":{"#package":"/node_modules/udx-native/package.json","../binding":"/node_modules/udx-native/binding.js","./ip":"/node_modules/udx-native/lib/ip.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/udx-native/package.json","streamx":"/node_modules/streamx/index.js"},"/node_modules/udx-native/lib/udx.js":{"#package":"/node_modules/udx-native/package.json","../binding":"/node_modules/udx-native/binding.js","./ip":"/node_modules/udx-native/lib/ip.js","./network-interfaces":"/node_modules/udx-native/lib/network-interfaces.js","./socket":"/node_modules/udx-native/lib/socket.js","./stream":"/node_modules/udx-native/lib/stream.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/udx-native/package.json"},"/node_modules/unix-path-resolve/index.js":{"#package":"/node_modules/unix-path-resolve/package.json","bare:package":"/node_modules/unix-path-resolve/package.json"},"/node_modules/url-file-url/index.js":{"#package":"/node_modules/url-file-url/package.json","bare:package":"/node_modules/url-file-url/package.json","path":"/node_modules/bare-path/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/which-runtime/index.js":{"#package":"/node_modules/which-runtime/package.json","bare:package":"/node_modules/which-runtime/package.json"},"/node_modules/z32/index.js":{"#package":"/node_modules/z32/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/z32/package.json"},"/preload.js":{"#package":"/package.json","./gui":"/gui/index.js","bare:package":"/package.json","pear-api":"/node_modules/pear-api/index.js","pear-api/gunk":"/node_modules/pear-api/gunk.js","script-linker/runtime":"/node_modules/script-linker/runtime.js","which-runtime":"/node_modules/which-runtime/index.js"}},"addons":[],"assets":[],"files":{"/boot.js":{"offset":0,"length":919,"mode":420},"/electron-main.js":{"offset":919,"length":3533,"mode":420},"/gui/decal.js":{"offset":4452,"length":681445,"mode":420},"/gui/gui.js":{"offset":685897,"length":62937,"mode":420},"/gui/icons/tray.js":{"offset":748834,"length":642,"mode":420},"/gui/index.js":{"offset":749476,"length":100,"mode":420},"/gui/preload.js":{"offset":749576,"length":16682,"mode":420},"/node_modules/b4a/index.js":{"offset":766258,"length":4092,"mode":420},"/node_modules/b4a/package.json":{"offset":770350,"length":701,"mode":420},"/node_modules/bare-env/index.js":{"offset":771051,"length":1023,"mode":420},"/node_modules/bare-env/package.json":{"offset":772074,"length":649,"mode":420},"/node_modules/bare-events/index.js":{"offset":772723,"length":6999,"mode":420},"/node_modules/bare-events/lib/errors.js":{"offset":779722,"length":711,"mode":420},"/node_modules/bare-events/package.json":{"offset":780433,"length":944,"mode":420},"/node_modules/bare-fs/binding.js":{"offset":781377,"length":33,"mode":420},"/node_modules/bare-fs/index.js":{"offset":781410,"length":59807,"mode":420},"/node_modules/bare-fs/package.json":{"offset":841217,"length":926,"mode":420},"/node_modules/bare-os/binding.js":{"offset":842143,"length":33,"mode":420},"/node_modules/bare-os/index.js":{"offset":842176,"length":2141,"mode":420},"/node_modules/bare-os/lib/constants.js":{"offset":844317,"length":113,"mode":420},"/node_modules/bare-os/lib/errors.js":{"offset":844430,"length":479,"mode":420},"/node_modules/bare-os/package.json":{"offset":844909,"length":1022,"mode":420},"/node_modules/bare-path/index.js":{"offset":845931,"length":306,"mode":420},"/node_modules/bare-path/lib/constants.js":{"offset":846237,"length":247,"mode":420},"/node_modules/bare-path/lib/posix.js":{"offset":846484,"length":5991,"mode":420},"/node_modules/bare-path/lib/shared.js":{"offset":852475,"length":1888,"mode":420},"/node_modules/bare-path/lib/win32.js":{"offset":854363,"length":13427,"mode":420},"/node_modules/bare-path/package.json":{"offset":867790,"length":796,"mode":420},"/node_modules/bare-pipe/binding.js":{"offset":868586,"length":33,"mode":420},"/node_modules/bare-pipe/index.js":{"offset":868619,"length":10947,"mode":420},"/node_modules/bare-pipe/lib/constants.js":{"offset":879566,"length":188,"mode":420},"/node_modules/bare-pipe/lib/errors.js":{"offset":879754,"length":668,"mode":420},"/node_modules/bare-pipe/package.json":{"offset":880422,"length":962,"mode":420},"/node_modules/bare-signals/binding.js":{"offset":881384,"length":33,"mode":420},"/node_modules/bare-signals/index.js":{"offset":881417,"length":1540,"mode":420},"/node_modules/bare-signals/lib/emitter.js":{"offset":882957,"length":1236,"mode":420},"/node_modules/bare-signals/lib/errors.js":{"offset":884193,"length":396,"mode":420},"/node_modules/bare-signals/package.json":{"offset":884589,"length":945,"mode":420},"/node_modules/bare-stream/index.js":{"offset":885534,"length":7649,"mode":420},"/node_modules/bare-stream/package.json":{"offset":893183,"length":1237,"mode":420},"/node_modules/bare-subprocess/binding.js":{"offset":894420,"length":33,"mode":420},"/node_modules/bare-subprocess/index.js":{"offset":894453,"length":5301,"mode":420},"/node_modules/bare-subprocess/lib/constants.js":{"offset":899754,"length":69,"mode":420},"/node_modules/bare-subprocess/lib/errors.js":{"offset":899823,"length":416,"mode":420},"/node_modules/bare-subprocess/package.json":{"offset":900239,"length":1015,"mode":420},"/node_modules/child_process/index.js":{"offset":901254,"length":44,"mode":420},"/node_modules/child_process/package.json":{"offset":901298,"length":582,"mode":420},"/node_modules/compact-encoding/endian.js":{"offset":901880,"length":103,"mode":420},"/node_modules/compact-encoding/index.js":{"offset":901983,"length":19073,"mode":420},"/node_modules/compact-encoding/lexint.js":{"offset":921056,"length":2824,"mode":420},"/node_modules/compact-encoding/package.json":{"offset":923880,"length":713,"mode":420},"/node_modules/compact-encoding/raw.js":{"offset":924593,"length":4118,"mode":420},"/node_modules/crc-native/binding.js":{"offset":928711,"length":54,"mode":420},"/node_modules/crc-native/index.js":{"offset":928765,"length":120,"mode":420},"/node_modules/crc-native/package.json":{"offset":928885,"length":973,"mode":420},"/node_modules/crc-universal/fallback.js":{"offset":929858,"length":2020,"mode":420},"/node_modules/crc-universal/index.js":{"offset":931878,"length":257,"mode":420},"/node_modules/crc-universal/lookup.js":{"offset":932135,"length":439,"mode":420},"/node_modules/crc-universal/package.json":{"offset":932574,"length":816,"mode":420},"/node_modules/fast-fifo/fixed-size.js":{"offset":933390,"length":875,"mode":420},"/node_modules/fast-fifo/index.js":{"offset":934265,"length":972,"mode":420},"/node_modules/fast-fifo/package.json":{"offset":935237,"length":682,"mode":420},"/node_modules/framed-stream/index.js":{"offset":935919,"length":3358,"mode":420},"/node_modules/framed-stream/package.json":{"offset":939277,"length":720,"mode":420},"/node_modules/fs-native-extensions/binding.js":{"offset":939997,"length":54,"mode":420},"/node_modules/fs-native-extensions/index.js":{"offset":940051,"length":4270,"mode":420},"/node_modules/fs-native-extensions/package.json":{"offset":944321,"length":1569,"mode":420},"/node_modules/fs/index.js":{"offset":945890,"length":36,"mode":420},"/node_modules/fs/package.json":{"offset":945926,"length":606,"mode":420},"/node_modules/hypercore-crypto/index.js":{"offset":946532,"length":4820,"mode":420},"/node_modules/hypercore-crypto/package.json":{"offset":951352,"length":771,"mode":420},"/node_modules/hypercore-id-encoding/index.js":{"offset":952123,"length":923,"mode":420},"/node_modules/hypercore-id-encoding/package.json":{"offset":953046,"length":799,"mode":420},"/node_modules/iambus/index.js":{"offset":953845,"length":1607,"mode":420},"/node_modules/iambus/package.json":{"offset":955452,"length":769,"mode":420},"/node_modules/nanoassert/index.js":{"offset":956221,"length":438,"mode":420},"/node_modules/nanoassert/package.json":{"offset":956659,"length":647,"mode":420},"/node_modules/node-gyp-build/index.js":{"offset":957306,"length":390,"mode":420},"/node_modules/node-gyp-build/node-gyp-build.js":{"offset":957696,"length":6078,"mode":420},"/node_modules/node-gyp-build/package.json":{"offset":963774,"length":1004,"mode":420},"/node_modules/paparam/index.js":{"offset":964778,"length":19293,"mode":420},"/node_modules/paparam/package.json":{"offset":984071,"length":637,"mode":420},"/node_modules/path/index.js":{"offset":984708,"length":38,"mode":420},"/node_modules/path/package.json":{"offset":984746,"length":648,"mode":420},"/node_modules/pear-api/cmd/index.js":{"offset":985394,"length":204,"mode":420},"/node_modules/pear-api/cmd/pear.js":{"offset":985598,"length":858,"mode":420},"/node_modules/pear-api/cmd/run.js":{"offset":986456,"length":1516,"mode":420},"/node_modules/pear-api/constants.js":{"offset":987972,"length":2979,"mode":420},"/node_modules/pear-api/crasher.js":{"offset":990951,"length":2583,"mode":420},"/node_modules/pear-api/errors.js":{"offset":993534,"length":3613,"mode":420},"/node_modules/pear-api/gunk.js":{"offset":997147,"length":2542,"mode":420},"/node_modules/pear-api/index.js":{"offset":999689,"length":4733,"mode":420},"/node_modules/pear-api/package.json":{"offset":1004422,"length":1293,"mode":420},"/node_modules/pear-api/parse-link.js":{"offset":1005715,"length":224,"mode":420},"/node_modules/pear-api/state.js":{"offset":1005939,"length":6909,"mode":420},"/node_modules/pear-api/teardown.js":{"offset":1012848,"length":1716,"mode":420},"/node_modules/pear-api/tryboot.js":{"offset":1014564,"length":1053,"mode":420},"/node_modules/pear-api/worker.js":{"offset":1015617,"length":2376,"mode":420},"/node_modules/pear-ipc/api.js":{"offset":1017993,"length":1060,"mode":420},"/node_modules/pear-ipc/client.js":{"offset":1019053,"length":5036,"mode":420},"/node_modules/pear-ipc/constants.js":{"offset":1024089,"length":721,"mode":420},"/node_modules/pear-ipc/index.js":{"offset":1024810,"length":164,"mode":420},"/node_modules/pear-ipc/methods.js":{"offset":1024974,"length":1583,"mode":420},"/node_modules/pear-ipc/package.json":{"offset":1026557,"length":1300,"mode":420},"/node_modules/pear-ipc/server.js":{"offset":1027857,"length":7491,"mode":420},"/node_modules/pear-link/index.js":{"offset":1035348,"length":3161,"mode":420},"/node_modules/pear-link/package.json":{"offset":1038509,"length":847,"mode":420},"/node_modules/quickbit-native/binding.js":{"offset":1039356,"length":54,"mode":420},"/node_modules/quickbit-native/index.js":{"offset":1039410,"length":4123,"mode":420},"/node_modules/quickbit-native/package.json":{"offset":1043533,"length":1019,"mode":420},"/node_modules/quickbit-universal/fallback.js":{"offset":1044552,"length":10204,"mode":420},"/node_modules/quickbit-universal/index.js":{"offset":1054756,"length":442,"mode":420},"/node_modules/quickbit-universal/package.json":{"offset":1055198,"length":908,"mode":420},"/node_modules/ready-resource/index.js":{"offset":1056106,"length":1091,"mode":420},"/node_modules/ready-resource/package.json":{"offset":1057197,"length":769,"mode":420},"/node_modules/safety-catch/index.js":{"offset":1057966,"length":506,"mode":420},"/node_modules/safety-catch/package.json":{"offset":1058472,"length":547,"mode":420},"/node_modules/script-linker/defaults.js":{"offset":1059019,"length":1251,"mode":420},"/node_modules/script-linker/lib/compile.js":{"offset":1060270,"length":136,"mode":420},"/node_modules/script-linker/package.json":{"offset":1060406,"length":919,"mode":420},"/node_modules/script-linker/runtime.js":{"offset":1061325,"length":6173,"mode":420},"/node_modules/simdle-native/binding.js":{"offset":1067498,"length":54,"mode":420},"/node_modules/simdle-native/index.js":{"offset":1067552,"length":3203,"mode":420},"/node_modules/simdle-native/package.json":{"offset":1070755,"length":1009,"mode":420},"/node_modules/simdle-universal/fallback.js":{"offset":1071764,"length":5137,"mode":420},"/node_modules/simdle-universal/index.js":{"offset":1076901,"length":103,"mode":420},"/node_modules/simdle-universal/package.json":{"offset":1077004,"length":879,"mode":420},"/node_modules/simdle-universal/scalar.js":{"offset":1077883,"length":469,"mode":420},"/node_modules/sodium-native/index.js":{"offset":1078352,"length":54,"mode":420},"/node_modules/sodium-native/package.json":{"offset":1078406,"length":1094,"mode":420},"/node_modules/sodium-universal/index.js":{"offset":1079500,"length":42,"mode":420},"/node_modules/sodium-universal/package.json":{"offset":1079542,"length":1064,"mode":420},"/node_modules/streamx/index.js":{"offset":1080606,"length":33174,"mode":420},"/node_modules/streamx/package.json":{"offset":1113780,"length":912,"mode":420},"/node_modules/text-decoder/index.js":{"offset":1114692,"length":1378,"mode":420},"/node_modules/text-decoder/lib/pass-through-decoder.js":{"offset":1116070,"length":273,"mode":420},"/node_modules/text-decoder/lib/utf8-decoder.js":{"offset":1116343,"length":2529,"mode":420},"/node_modules/text-decoder/package.json":{"offset":1118872,"length":987,"mode":420},"/node_modules/tiny-buffer-rpc/any.js":{"offset":1119859,"length":2475,"mode":420},"/node_modules/tiny-buffer-rpc/index.js":{"offset":1122334,"length":11707,"mode":420},"/node_modules/tiny-buffer-rpc/messages.js":{"offset":1134041,"length":2105,"mode":420},"/node_modules/tiny-buffer-rpc/package.json":{"offset":1136146,"length":713,"mode":420},"/node_modules/udx-native/binding.js":{"offset":1136859,"length":54,"mode":420},"/node_modules/udx-native/lib/ip.js":{"offset":1136913,"length":2179,"mode":420},"/node_modules/udx-native/lib/network-interfaces.js":{"offset":1139092,"length":1335,"mode":420},"/node_modules/udx-native/lib/socket.js":{"offset":1140427,"length":7445,"mode":420},"/node_modules/udx-native/lib/stream.js":{"offset":1147872,"length":12546,"mode":420},"/node_modules/udx-native/lib/udx.js":{"offset":1160418,"length":2842,"mode":420},"/node_modules/udx-native/package.json":{"offset":1163260,"length":1469,"mode":420},"/node_modules/unix-path-resolve/index.js":{"offset":1164729,"length":1356,"mode":420},"/node_modules/unix-path-resolve/package.json":{"offset":1166085,"length":651,"mode":420},"/node_modules/url-file-url/index.js":{"offset":1166736,"length":1702,"mode":420},"/node_modules/url-file-url/package.json":{"offset":1168438,"length":755,"mode":420},"/node_modules/which-runtime/index.js":{"offset":1169193,"length":1222,"mode":420},"/node_modules/which-runtime/package.json":{"offset":1170415,"length":602,"mode":420},"/node_modules/z32/index.js":{"offset":1171017,"length":2654,"mode":420},"/node_modules/z32/package.json":{"offset":1173671,"length":701,"mode":420},"/package.json":{"offset":1174372,"length":2149,"mode":420},"/preload.js":{"offset":1176521,"length":13850,"mode":420}}}
1
+ 49126
2
+ {"version":0,"id":null,"main":"/boot.js","imports":{},"resolutions":{"/boot.js":{"#package":"/package.json","./electron-main.js":"/electron-main.js","./preload.js":"/preload.js","bare:package":"/package.json","pear-api/constants":"/node_modules/pear-api/constants.js","which-runtime":"/node_modules/which-runtime/index.js"},"/electron-main.js":{"#package":"/package.json","./gui":"/gui/index.js","bare:package":"/package.json","paparam":"/node_modules/paparam/index.js","pear-api/cmd/run":"/node_modules/pear-api/cmd/run.js","pear-api/constants":"/node_modules/pear-api/constants.js","pear-api/crasher":"/node_modules/pear-api/crasher.js","pear-api/state":"/node_modules/pear-api/state.js","pear-api/tryboot":"/node_modules/pear-api/tryboot.js","which-runtime":"/node_modules/which-runtime/index.js"},"/gui/decal.js":{"#package":"/package.json","bare:package":"/package.json"},"/gui/gui.js":{"#package":"/package.json","./decal":"/gui/decal.js","./icons/tray":"/gui/icons/tray.js","bare:package":"/package.json","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","path":"/node_modules/path/index.js","pear-api/constants":"/node_modules/pear-api/constants.js","pear-api/worker":"/node_modules/pear-api/worker.js","pear-ipc":"/node_modules/pear-ipc/index.js","ready-resource":"/node_modules/ready-resource/index.js","unix-path-resolve":"/node_modules/unix-path-resolve/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/gui/icons/tray.js":{"#package":"/package.json","bare:package":"/package.json"},"/gui/index.js":{"#package":"/package.json","./gui":"/gui/gui.js","./preload":"/gui/preload.js","bare:package":"/package.json"},"/gui/preload.js":{"#package":"/package.json","bare:package":"/package.json","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","iambus":"/node_modules/iambus/index.js","pear-api/constants":"/node_modules/pear-api/constants.js","pear-api/worker":"/node_modules/pear-api/worker.js","streamx":"/node_modules/streamx/index.js"},"/node_modules/b4a/index.js":{"#package":"/node_modules/b4a/package.json","bare:package":"/node_modules/b4a/package.json"},"/node_modules/bare-env/index.js":{"#package":"/node_modules/bare-env/package.json","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-env/package.json"},"/node_modules/bare-events/index.js":{"#package":"/node_modules/bare-events/package.json","./lib/errors":"/node_modules/bare-events/lib/errors.js","bare:package":"/node_modules/bare-events/package.json"},"/node_modules/bare-events/lib/errors.js":{"#package":"/node_modules/bare-events/package.json","bare:package":"/node_modules/bare-events/package.json"},"/node_modules/bare-fs/":{"bare:addon":"/../prebuilds/darwin-arm64/a5ac624bf012486ee2e442a9fbc4b1cf41f0e15a6e3a0e30ecfff6265861a688.bare"},"/node_modules/bare-fs/binding.js":{"#package":"/node_modules/bare-fs/package.json",".":{"addon":"/../prebuilds/darwin-arm64/a5ac624bf012486ee2e442a9fbc4b1cf41f0e15a6e3a0e30ecfff6265861a688.bare"},"bare:package":"/node_modules/bare-fs/package.json"},"/node_modules/bare-fs/index.js":{"#package":"/node_modules/bare-fs/package.json","./binding":"/node_modules/bare-fs/binding.js","bare-events":"/node_modules/bare-events/index.js","bare-path":"/node_modules/bare-path/index.js","bare-stream":"/node_modules/bare-stream/index.js","bare:package":"/node_modules/bare-fs/package.json"},"/node_modules/bare-os/":{"bare:addon":"/../prebuilds/darwin-arm64/e2ab0cd75e61952b2b5e3651cf68d51f02352c99b8bef4ad459dfec376bee17d.bare"},"/node_modules/bare-os/binding.js":{"#package":"/node_modules/bare-os/package.json",".":{"addon":"/../prebuilds/darwin-arm64/e2ab0cd75e61952b2b5e3651cf68d51f02352c99b8bef4ad459dfec376bee17d.bare"},"bare:package":"/node_modules/bare-os/package.json"},"/node_modules/bare-os/index.js":{"#package":"/node_modules/bare-os/package.json","./binding":"/node_modules/bare-os/binding.js","./lib/constants":"/node_modules/bare-os/lib/constants.js","./lib/errors":"/node_modules/bare-os/lib/errors.js","bare:package":"/node_modules/bare-os/package.json"},"/node_modules/bare-os/lib/constants.js":{"#package":"/node_modules/bare-os/package.json","../binding":"/node_modules/bare-os/binding.js","bare:package":"/node_modules/bare-os/package.json"},"/node_modules/bare-os/lib/errors.js":{"#package":"/node_modules/bare-os/package.json","bare:package":"/node_modules/bare-os/package.json"},"/node_modules/bare-path/index.js":{"#package":"/node_modules/bare-path/package.json","./lib/posix":"/node_modules/bare-path/lib/posix.js","./lib/win32":"/node_modules/bare-path/lib/win32.js","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-path/lib/constants.js":{"#package":"/node_modules/bare-path/package.json","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-path/lib/posix.js":{"#package":"/node_modules/bare-path/package.json","./constants":"/node_modules/bare-path/lib/constants.js","./shared":"/node_modules/bare-path/lib/shared.js","./win32":"/node_modules/bare-path/lib/win32.js","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-path/lib/shared.js":{"#package":"/node_modules/bare-path/package.json","./constants":"/node_modules/bare-path/lib/constants.js","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-path/lib/win32.js":{"#package":"/node_modules/bare-path/package.json","./constants":"/node_modules/bare-path/lib/constants.js","./posix":"/node_modules/bare-path/lib/posix.js","./shared":"/node_modules/bare-path/lib/shared.js","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-path/package.json"},"/node_modules/bare-pipe/":{"bare:addon":"/../prebuilds/darwin-arm64/8de92677dbda01df58f19a2050673007cf60ffec87856219f88e0306b65e82b1.bare"},"/node_modules/bare-pipe/binding.js":{"#package":"/node_modules/bare-pipe/package.json",".":{"addon":"/../prebuilds/darwin-arm64/8de92677dbda01df58f19a2050673007cf60ffec87856219f88e0306b65e82b1.bare"},"bare:package":"/node_modules/bare-pipe/package.json"},"/node_modules/bare-pipe/index.js":{"#package":"/node_modules/bare-pipe/package.json","./binding":"/node_modules/bare-pipe/binding.js","./lib/constants":"/node_modules/bare-pipe/lib/constants.js","./lib/errors":"/node_modules/bare-pipe/lib/errors.js","bare-events":"/node_modules/bare-events/index.js","bare-stream":"/node_modules/bare-stream/index.js","bare:package":"/node_modules/bare-pipe/package.json"},"/node_modules/bare-pipe/lib/constants.js":{"#package":"/node_modules/bare-pipe/package.json","bare:package":"/node_modules/bare-pipe/package.json"},"/node_modules/bare-pipe/lib/errors.js":{"#package":"/node_modules/bare-pipe/package.json","bare:package":"/node_modules/bare-pipe/package.json"},"/node_modules/bare-stream/index.js":{"#package":"/node_modules/bare-stream/package.json","bare:package":"/node_modules/bare-stream/package.json","streamx":"/node_modules/streamx/index.js"},"/node_modules/bare-subprocess/":{"bare:addon":"/../prebuilds/darwin-arm64/f0372873e53307b59bbd08632b6a483fe3ff38c2fb34dc6adbe9c8dc49bf92db.bare"},"/node_modules/bare-subprocess/binding.js":{"#package":"/node_modules/bare-subprocess/package.json",".":{"addon":"/../prebuilds/darwin-arm64/f0372873e53307b59bbd08632b6a483fe3ff38c2fb34dc6adbe9c8dc49bf92db.bare"},"bare:package":"/node_modules/bare-subprocess/package.json"},"/node_modules/bare-subprocess/index.js":{"#package":"/node_modules/bare-subprocess/package.json","./binding":"/node_modules/bare-subprocess/binding.js","./lib/constants":"/node_modules/bare-subprocess/lib/constants.js","./lib/errors":"/node_modules/bare-subprocess/lib/errors.js","bare-env":"/node_modules/bare-env/index.js","bare-events":"/node_modules/bare-events/index.js","bare-os":"/node_modules/bare-os/index.js","bare-pipe":"/node_modules/bare-pipe/index.js","bare:package":"/node_modules/bare-subprocess/package.json"},"/node_modules/bare-subprocess/lib/constants.js":{"#package":"/node_modules/bare-subprocess/package.json","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/bare-subprocess/package.json"},"/node_modules/bare-subprocess/lib/errors.js":{"#package":"/node_modules/bare-subprocess/package.json","bare:package":"/node_modules/bare-subprocess/package.json"},"/node_modules/child_process/index.js":{"#package":"/node_modules/child_process/package.json","bare-subprocess":"/node_modules/bare-subprocess/index.js","bare:package":"/node_modules/child_process/package.json"},"/node_modules/compact-encoding/endian.js":{"#package":"/node_modules/compact-encoding/package.json","bare:package":"/node_modules/compact-encoding/package.json"},"/node_modules/compact-encoding/index.js":{"#package":"/node_modules/compact-encoding/package.json","./endian":"/node_modules/compact-encoding/endian.js","./lexint":"/node_modules/compact-encoding/lexint.js","./raw":"/node_modules/compact-encoding/raw.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/compact-encoding/package.json"},"/node_modules/compact-encoding/lexint.js":{"#package":"/node_modules/compact-encoding/package.json","bare:package":"/node_modules/compact-encoding/package.json"},"/node_modules/compact-encoding/raw.js":{"#package":"/node_modules/compact-encoding/package.json","./endian":"/node_modules/compact-encoding/endian.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/compact-encoding/package.json"},"/node_modules/crc-native/":{"bare:addon":"/../prebuilds/darwin-arm64/bc135bd4f568a9f30fea2a5268dc3431e77955fc9d0d29944cc49f430b14d672.node"},"/node_modules/crc-native/binding.js":{"#package":"/node_modules/crc-native/package.json","/node_modules/crc-native":{"addon":"/../prebuilds/darwin-arm64/bc135bd4f568a9f30fea2a5268dc3431e77955fc9d0d29944cc49f430b14d672.node"},"bare:package":"/node_modules/crc-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/crc-native/index.js":{"#package":"/node_modules/crc-native/package.json","./binding":"/node_modules/crc-native/binding.js","bare:package":"/node_modules/crc-native/package.json"},"/node_modules/crc-universal/fallback.js":{"#package":"/node_modules/crc-universal/package.json","./lookup":"/node_modules/crc-universal/lookup.js","bare:package":"/node_modules/crc-universal/package.json"},"/node_modules/crc-universal/index.js":{"#package":"/node_modules/crc-universal/package.json","./fallback":"/node_modules/crc-universal/fallback.js","bare:package":"/node_modules/crc-universal/package.json","crc-native":"/node_modules/crc-native/index.js"},"/node_modules/crc-universal/lookup.js":{"#package":"/node_modules/crc-universal/package.json","bare:package":"/node_modules/crc-universal/package.json"},"/node_modules/fast-fifo/fixed-size.js":{"#package":"/node_modules/fast-fifo/package.json","bare:package":"/node_modules/fast-fifo/package.json"},"/node_modules/fast-fifo/index.js":{"#package":"/node_modules/fast-fifo/package.json","./fixed-size":"/node_modules/fast-fifo/fixed-size.js","bare:package":"/node_modules/fast-fifo/package.json"},"/node_modules/framed-stream/index.js":{"#package":"/node_modules/framed-stream/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/framed-stream/package.json","streamx":"/node_modules/streamx/index.js"},"/node_modules/fs-native-extensions/":{"bare:addon":"/../prebuilds/darwin-arm64/5c28de4fba954fd34ec2fe9c4bd46f8093a0312fa4856b4bb1d69dacff5206c6.node"},"/node_modules/fs-native-extensions/binding.js":{"#package":"/node_modules/fs-native-extensions/package.json","/node_modules/fs-native-extensions":{"addon":"/../prebuilds/darwin-arm64/5c28de4fba954fd34ec2fe9c4bd46f8093a0312fa4856b4bb1d69dacff5206c6.node"},"bare:package":"/node_modules/fs-native-extensions/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/fs-native-extensions/index.js":{"#package":"/node_modules/fs-native-extensions/package.json","./binding":"/node_modules/fs-native-extensions/binding.js","bare:package":"/node_modules/fs-native-extensions/package.json","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/fs/index.js":{"#package":"/node_modules/fs/package.json","bare-fs":"/node_modules/bare-fs/index.js","bare:package":"/node_modules/fs/package.json"},"/node_modules/hypercore-crypto/index.js":{"#package":"/node_modules/hypercore-crypto/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/hypercore-crypto/package.json","compact-encoding":"/node_modules/compact-encoding/index.js","sodium-universal":"/node_modules/sodium-universal/index.js"},"/node_modules/hypercore-id-encoding/index.js":{"#package":"/node_modules/hypercore-id-encoding/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/hypercore-id-encoding/package.json","z32":"/node_modules/z32/index.js"},"/node_modules/iambus/index.js":{"#package":"/node_modules/iambus/package.json","bare:package":"/node_modules/iambus/package.json","nanoassert":"/node_modules/nanoassert/index.js","streamx":"/node_modules/streamx/index.js"},"/node_modules/nanoassert/index.js":{"#package":"/node_modules/nanoassert/package.json","bare:package":"/node_modules/nanoassert/package.json"},"/node_modules/node-gyp-build/index.js":{"#package":"/node_modules/node-gyp-build/package.json","./node-gyp-build.js":"/node_modules/node-gyp-build/node-gyp-build.js","bare:package":"/node_modules/node-gyp-build/package.json"},"/node_modules/node-gyp-build/node-gyp-build.js":{"#package":"/node_modules/node-gyp-build/package.json","bare:package":"/node_modules/node-gyp-build/package.json"},"/node_modules/paparam/index.js":{"#package":"/node_modules/paparam/package.json","bare:package":"/node_modules/paparam/package.json"},"/node_modules/path/index.js":{"#package":"/node_modules/path/package.json","bare-path":"/node_modules/bare-path/index.js","bare:package":"/node_modules/path/package.json"},"/node_modules/pear-api/cmd/index.js":{"#package":"/node_modules/pear-api/package.json","./pear":"/node_modules/pear-api/cmd/pear.js","bare:package":"/node_modules/pear-api/package.json","paparam":"/node_modules/paparam/index.js"},"/node_modules/pear-api/cmd/pear.js":{"#package":"/node_modules/pear-api/package.json","bare:package":"/node_modules/pear-api/package.json","paparam":"/node_modules/paparam/index.js"},"/node_modules/pear-api/cmd/run.js":{"#package":"/node_modules/pear-api/package.json","bare:package":"/node_modules/pear-api/package.json","paparam":"/node_modules/paparam/index.js"},"/node_modules/pear-api/constants.js":{"#package":"/node_modules/pear-api/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/pear-api/package.json","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","sodium-native":"/node_modules/sodium-native/index.js","url-file-url":"/node_modules/url-file-url/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-api/crasher.js":{"#package":"/node_modules/pear-api/package.json","./constants":"/node_modules/pear-api/constants.js","bare-fs":"/node_modules/bare-fs/index.js","bare-os":"/node_modules/bare-os/index.js","bare-path":"/node_modules/bare-path/index.js","bare:package":"/node_modules/pear-api/package.json","fs":"/node_modules/fs/index.js","path":"/node_modules/path/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-api/errors.js":{"#package":"/node_modules/pear-api/package.json","bare:package":"/node_modules/pear-api/package.json"},"/node_modules/pear-api/gunk.js":{"#package":"/node_modules/pear-api/package.json","bare:package":"/node_modules/pear-api/package.json","crc-universal":"/node_modules/crc-universal/index.js","fs-native-extensions":"/node_modules/fs-native-extensions/index.js","quickbit-universal":"/node_modules/quickbit-universal/index.js","script-linker/defaults":"/node_modules/script-linker/defaults.js","sodium-native":"/node_modules/sodium-native/index.js","udx-native":"/node_modules/udx-native/lib/udx.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-api/index.js":{"#package":"/node_modules/pear-api/package.json","./constants":"/node_modules/pear-api/constants.js","./teardown":"/node_modules/pear-api/teardown.js","./worker":"/node_modules/pear-api/worker.js","bare:package":"/node_modules/pear-api/package.json"},"/node_modules/pear-api/node_modules/bare-pipe/":{"bare:addon":"/../prebuilds/darwin-arm64/4f3bee5e1f1b27319413fc3b328cd68a6694823608eed58e0f45b52927234530.bare"},"/node_modules/pear-api/node_modules/bare-pipe/binding.js":{"#package":"/node_modules/pear-api/node_modules/bare-pipe/package.json",".":{"addon":"/../prebuilds/darwin-arm64/4f3bee5e1f1b27319413fc3b328cd68a6694823608eed58e0f45b52927234530.bare"},"bare:package":"/node_modules/pear-api/node_modules/bare-pipe/package.json"},"/node_modules/pear-api/node_modules/bare-pipe/index.js":{"#package":"/node_modules/pear-api/node_modules/bare-pipe/package.json","./binding":"/node_modules/pear-api/node_modules/bare-pipe/binding.js","./lib/constants":"/node_modules/pear-api/node_modules/bare-pipe/lib/constants.js","./lib/errors":"/node_modules/pear-api/node_modules/bare-pipe/lib/errors.js","bare-events":"/node_modules/bare-events/index.js","bare-stream":"/node_modules/bare-stream/index.js","bare:package":"/node_modules/pear-api/node_modules/bare-pipe/package.json"},"/node_modules/pear-api/node_modules/bare-pipe/lib/constants.js":{"#package":"/node_modules/pear-api/node_modules/bare-pipe/package.json","bare:package":"/node_modules/pear-api/node_modules/bare-pipe/package.json"},"/node_modules/pear-api/node_modules/bare-pipe/lib/errors.js":{"#package":"/node_modules/pear-api/node_modules/bare-pipe/package.json","bare:package":"/node_modules/pear-api/node_modules/bare-pipe/package.json"},"/node_modules/pear-api/node_modules/bare-signals/":{"bare:addon":"/../prebuilds/darwin-arm64/87676633cb5aa00eebe6dc64c6d37894e17c6b395642d0b85984df8ee14d9de5.bare"},"/node_modules/pear-api/node_modules/bare-signals/binding.js":{"#package":"/node_modules/pear-api/node_modules/bare-signals/package.json",".":{"addon":"/../prebuilds/darwin-arm64/87676633cb5aa00eebe6dc64c6d37894e17c6b395642d0b85984df8ee14d9de5.bare"},"bare:package":"/node_modules/pear-api/node_modules/bare-signals/package.json"},"/node_modules/pear-api/node_modules/bare-signals/index.js":{"#package":"/node_modules/pear-api/node_modules/bare-signals/package.json","./binding":"/node_modules/pear-api/node_modules/bare-signals/binding.js","./lib/emitter":"/node_modules/pear-api/node_modules/bare-signals/lib/emitter.js","./lib/errors":"/node_modules/pear-api/node_modules/bare-signals/lib/errors.js","bare-events":"/node_modules/bare-events/index.js","bare-os":"/node_modules/bare-os/index.js","bare:package":"/node_modules/pear-api/node_modules/bare-signals/package.json"},"/node_modules/pear-api/node_modules/bare-signals/lib/emitter.js":{"#package":"/node_modules/pear-api/node_modules/bare-signals/package.json","..":"/node_modules/pear-api/node_modules/bare-signals/index.js","bare-events":"/node_modules/bare-events/index.js","bare:package":"/node_modules/pear-api/node_modules/bare-signals/package.json"},"/node_modules/pear-api/node_modules/bare-signals/lib/errors.js":{"#package":"/node_modules/pear-api/node_modules/bare-signals/package.json","bare:package":"/node_modules/pear-api/node_modules/bare-signals/package.json"},"/node_modules/pear-api/parse-link.js":{"#package":"/node_modules/pear-api/package.json","./constants":"/node_modules/pear-api/constants.js","./errors":"/node_modules/pear-api/errors.js","bare:package":"/node_modules/pear-api/package.json","pear-link":"/node_modules/pear-link/index.js"},"/node_modules/pear-api/state.js":{"#package":"/node_modules/pear-api/package.json","./errors":"/node_modules/pear-api/errors.js","./parse-link":"/node_modules/pear-api/parse-link.js","bare-env":"/node_modules/bare-env/index.js","bare-fs":"/node_modules/bare-fs/index.js","bare-os":"/node_modules/bare-os/index.js","bare-path":"/node_modules/bare-path/index.js","bare:package":"/node_modules/pear-api/package.json","fs":"/node_modules/fs/index.js","hypercore-crypto":"/node_modules/hypercore-crypto/index.js","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","path":"/node_modules/path/index.js","pear-api/constants":"/node_modules/pear-api/constants.js","url-file-url":"/node_modules/url-file-url/index.js","which-runtime":"/node_modules/which-runtime/index.js","z32":"/node_modules/z32/index.js"},"/node_modules/pear-api/teardown.js":{"#package":"/node_modules/pear-api/package.json","bare-signals":"/node_modules/pear-api/node_modules/bare-signals/index.js","bare:package":"/node_modules/pear-api/package.json","safety-catch":"/node_modules/safety-catch/index.js"},"/node_modules/pear-api/tryboot.js":{"#package":"/node_modules/pear-api/package.json","./cmd":"/node_modules/pear-api/cmd/index.js","./constants":"/node_modules/pear-api/constants.js","bare:package":"/node_modules/pear-api/package.json","child_process":"/node_modules/child_process/index.js"},"/node_modules/pear-api/worker.js":{"#package":"/node_modules/pear-api/package.json","./cmd/run":"/node_modules/pear-api/cmd/run.js","./constants":"/node_modules/pear-api/constants.js","./teardown":"/node_modules/pear-api/teardown.js","bare-pipe":"/node_modules/pear-api/node_modules/bare-pipe/index.js","bare:package":"/node_modules/pear-api/package.json","child_process":"/node_modules/child_process/index.js","fs":"/node_modules/fs/index.js","paparam":"/node_modules/paparam/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-ipc/api.js":{"#package":"/node_modules/pear-ipc/package.json","bare:package":"/node_modules/pear-ipc/package.json","fs":"/node_modules/bare-fs/index.js","fs-native-extensions":"/node_modules/fs-native-extensions/index.js"},"/node_modules/pear-ipc/client.js":{"#package":"/node_modules/pear-ipc/package.json","./api":"/node_modules/pear-ipc/api.js","./constants":"/node_modules/pear-ipc/constants.js","./methods":"/node_modules/pear-ipc/methods.js","bare:package":"/node_modules/pear-ipc/package.json","framed-stream":"/node_modules/framed-stream/index.js","net":"/node_modules/pear-ipc/node_modules/bare-pipe/index.js","path":"/node_modules/bare-path/index.js","ready-resource":"/node_modules/ready-resource/index.js","tiny-buffer-rpc":"/node_modules/tiny-buffer-rpc/index.js","tiny-buffer-rpc/any":"/node_modules/tiny-buffer-rpc/any.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-ipc/constants.js":{"#package":"/node_modules/pear-ipc/package.json","bare:package":"/node_modules/pear-ipc/package.json","os":"/node_modules/bare-os/index.js","path":"/node_modules/bare-path/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-ipc/index.js":{"#package":"/node_modules/pear-ipc/package.json","./client":"/node_modules/pear-ipc/client.js","./server":"/node_modules/pear-ipc/server.js","bare:package":"/node_modules/pear-ipc/package.json"},"/node_modules/pear-ipc/methods.js":{"#package":"/node_modules/pear-ipc/package.json","bare:package":"/node_modules/pear-ipc/package.json"},"/node_modules/pear-ipc/node_modules/bare-pipe/":{"bare:addon":"/../prebuilds/darwin-arm64/4f3bee5e1f1b27319413fc3b328cd68a6694823608eed58e0f45b52927234530.bare"},"/node_modules/pear-ipc/node_modules/bare-pipe/binding.js":{"#package":"/node_modules/pear-ipc/node_modules/bare-pipe/package.json",".":{"addon":"/../prebuilds/darwin-arm64/4f3bee5e1f1b27319413fc3b328cd68a6694823608eed58e0f45b52927234530.bare"},"bare:package":"/node_modules/pear-ipc/node_modules/bare-pipe/package.json"},"/node_modules/pear-ipc/node_modules/bare-pipe/index.js":{"#package":"/node_modules/pear-ipc/node_modules/bare-pipe/package.json","./binding":"/node_modules/pear-ipc/node_modules/bare-pipe/binding.js","./lib/constants":"/node_modules/pear-ipc/node_modules/bare-pipe/lib/constants.js","./lib/errors":"/node_modules/pear-ipc/node_modules/bare-pipe/lib/errors.js","bare-events":"/node_modules/bare-events/index.js","bare-stream":"/node_modules/bare-stream/index.js","bare:package":"/node_modules/pear-ipc/node_modules/bare-pipe/package.json"},"/node_modules/pear-ipc/node_modules/bare-pipe/lib/constants.js":{"#package":"/node_modules/pear-ipc/node_modules/bare-pipe/package.json","bare:package":"/node_modules/pear-ipc/node_modules/bare-pipe/package.json"},"/node_modules/pear-ipc/node_modules/bare-pipe/lib/errors.js":{"#package":"/node_modules/pear-ipc/node_modules/bare-pipe/package.json","bare:package":"/node_modules/pear-ipc/node_modules/bare-pipe/package.json"},"/node_modules/pear-ipc/server.js":{"#package":"/node_modules/pear-ipc/package.json","./api":"/node_modules/pear-ipc/api.js","./constants":"/node_modules/pear-ipc/constants.js","./methods":"/node_modules/pear-ipc/methods.js","bare:package":"/node_modules/pear-ipc/package.json","framed-stream":"/node_modules/framed-stream/index.js","fs":"/node_modules/bare-fs/index.js","net":"/node_modules/pear-ipc/node_modules/bare-pipe/index.js","path":"/node_modules/bare-path/index.js","ready-resource":"/node_modules/ready-resource/index.js","streamx":"/node_modules/streamx/index.js","tiny-buffer-rpc":"/node_modules/tiny-buffer-rpc/index.js","tiny-buffer-rpc/any":"/node_modules/tiny-buffer-rpc/any.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/pear-link/index.js":{"#package":"/node_modules/pear-link/package.json","bare:package":"/node_modules/pear-link/package.json","hypercore-id-encoding":"/node_modules/hypercore-id-encoding/index.js","path":"/node_modules/bare-path/index.js"},"/node_modules/quickbit-native/":{"bare:addon":"/../prebuilds/darwin-arm64/1b2dea778d4373c9f7ffd17509eec9dd70bf77c0dda602e373809f1b730fa4f8.node"},"/node_modules/quickbit-native/binding.js":{"#package":"/node_modules/quickbit-native/package.json","/node_modules/quickbit-native":{"addon":"/../prebuilds/darwin-arm64/1b2dea778d4373c9f7ffd17509eec9dd70bf77c0dda602e373809f1b730fa4f8.node"},"bare:package":"/node_modules/quickbit-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/quickbit-native/index.js":{"#package":"/node_modules/quickbit-native/package.json","./binding":"/node_modules/quickbit-native/binding.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/quickbit-native/package.json"},"/node_modules/quickbit-universal/fallback.js":{"#package":"/node_modules/quickbit-universal/package.json","bare:package":"/node_modules/quickbit-universal/package.json","simdle-universal":"/node_modules/simdle-universal/index.js"},"/node_modules/quickbit-universal/index.js":{"#package":"/node_modules/quickbit-universal/package.json","./fallback":"/node_modules/quickbit-universal/fallback.js","bare:package":"/node_modules/quickbit-universal/package.json","quickbit-native":"/node_modules/quickbit-native/index.js"},"/node_modules/ready-resource/index.js":{"#package":"/node_modules/ready-resource/package.json","bare:package":"/node_modules/ready-resource/package.json","events":"/node_modules/bare-events/index.js"},"/node_modules/safety-catch/index.js":{"#package":"/node_modules/safety-catch/package.json","bare:package":"/node_modules/safety-catch/package.json"},"/node_modules/script-linker/defaults.js":{"#package":"/node_modules/script-linker/package.json","./lib/compile":"/node_modules/script-linker/lib/compile.js","bare:package":"/node_modules/script-linker/package.json"},"/node_modules/script-linker/lib/compile.js":{"#package":"/node_modules/script-linker/package.json","bare:package":"/node_modules/script-linker/package.json"},"/node_modules/script-linker/runtime.js":{"#package":"/node_modules/script-linker/package.json","./defaults":"/node_modules/script-linker/defaults.js","bare:package":"/node_modules/script-linker/package.json","unix-path-resolve":"/node_modules/unix-path-resolve/index.js"},"/node_modules/simdle-native/":{"bare:addon":"/../prebuilds/darwin-arm64/6ad2240f689676549489f843afe5714ed3f582002918048495589cc06752e14b.node"},"/node_modules/simdle-native/binding.js":{"#package":"/node_modules/simdle-native/package.json","/node_modules/simdle-native":{"addon":"/../prebuilds/darwin-arm64/6ad2240f689676549489f843afe5714ed3f582002918048495589cc06752e14b.node"},"bare:package":"/node_modules/simdle-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/simdle-native/index.js":{"#package":"/node_modules/simdle-native/package.json","./binding":"/node_modules/simdle-native/binding.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/simdle-native/package.json"},"/node_modules/simdle-universal/fallback.js":{"#package":"/node_modules/simdle-universal/package.json","./scalar":"/node_modules/simdle-universal/scalar.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/simdle-universal/package.json"},"/node_modules/simdle-universal/index.js":{"#package":"/node_modules/simdle-universal/package.json","./fallback":"/node_modules/simdle-universal/fallback.js","bare:package":"/node_modules/simdle-universal/package.json","simdle-native":"/node_modules/simdle-native/index.js"},"/node_modules/simdle-universal/scalar.js":{"#package":"/node_modules/simdle-universal/package.json","bare:package":"/node_modules/simdle-universal/package.json"},"/node_modules/sodium-native/":{"bare:addon":"/../prebuilds/darwin-arm64/3fb29667ec6f34245227e44c6dc9182f319561cf15553414975ba80c7f942203.node"},"/node_modules/sodium-native/index.js":{"#package":"/node_modules/sodium-native/package.json","/node_modules/sodium-native":{"addon":"/../prebuilds/darwin-arm64/3fb29667ec6f34245227e44c6dc9182f319561cf15553414975ba80c7f942203.node"},"bare:package":"/node_modules/sodium-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/sodium-universal/index.js":{"#package":"/node_modules/sodium-universal/package.json","bare:package":"/node_modules/sodium-universal/package.json","sodium-native":"/node_modules/sodium-native/index.js"},"/node_modules/streamx/index.js":{"#package":"/node_modules/streamx/package.json","bare:package":"/node_modules/streamx/package.json","events":"/node_modules/bare-events/index.js","fast-fifo":"/node_modules/fast-fifo/index.js","text-decoder":"/node_modules/text-decoder/index.js"},"/node_modules/text-decoder/index.js":{"#package":"/node_modules/text-decoder/package.json","./lib/pass-through-decoder":"/node_modules/text-decoder/lib/pass-through-decoder.js","./lib/utf8-decoder":"/node_modules/text-decoder/lib/utf8-decoder.js","bare:package":"/node_modules/text-decoder/package.json"},"/node_modules/text-decoder/lib/pass-through-decoder.js":{"#package":"/node_modules/text-decoder/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/text-decoder/package.json"},"/node_modules/text-decoder/lib/utf8-decoder.js":{"#package":"/node_modules/text-decoder/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/text-decoder/package.json"},"/node_modules/tiny-buffer-rpc/any.js":{"#package":"/node_modules/tiny-buffer-rpc/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/tiny-buffer-rpc/package.json","compact-encoding":"/node_modules/compact-encoding/index.js"},"/node_modules/tiny-buffer-rpc/index.js":{"#package":"/node_modules/tiny-buffer-rpc/package.json","./messages.js":"/node_modules/tiny-buffer-rpc/messages.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/tiny-buffer-rpc/package.json","compact-encoding":"/node_modules/compact-encoding/index.js","safety-catch":"/node_modules/safety-catch/index.js","streamx":"/node_modules/streamx/index.js"},"/node_modules/tiny-buffer-rpc/messages.js":{"#package":"/node_modules/tiny-buffer-rpc/package.json","bare:package":"/node_modules/tiny-buffer-rpc/package.json","compact-encoding":"/node_modules/compact-encoding/index.js"},"/node_modules/udx-native/":{"bare:addon":"/../prebuilds/darwin-arm64/1238d9532907d86983a11321f9b849f4611779bb10c4010afbb97d785bf4d7b6.node"},"/node_modules/udx-native/binding.js":{"#package":"/node_modules/udx-native/package.json","/node_modules/udx-native":{"addon":"/../prebuilds/darwin-arm64/1238d9532907d86983a11321f9b849f4611779bb10c4010afbb97d785bf4d7b6.node"},"bare:package":"/node_modules/udx-native/package.json","node-gyp-build":"/node_modules/node-gyp-build/index.js"},"/node_modules/udx-native/lib/ip.js":{"#package":"/node_modules/udx-native/package.json","bare:package":"/node_modules/udx-native/package.json"},"/node_modules/udx-native/lib/network-interfaces.js":{"#package":"/node_modules/udx-native/package.json","../binding":"/node_modules/udx-native/binding.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/udx-native/package.json","events":"/node_modules/bare-events/index.js"},"/node_modules/udx-native/lib/socket.js":{"#package":"/node_modules/udx-native/package.json","../binding":"/node_modules/udx-native/binding.js","./ip":"/node_modules/udx-native/lib/ip.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/udx-native/package.json","events":"/node_modules/bare-events/index.js"},"/node_modules/udx-native/lib/stream.js":{"#package":"/node_modules/udx-native/package.json","../binding":"/node_modules/udx-native/binding.js","./ip":"/node_modules/udx-native/lib/ip.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/udx-native/package.json","streamx":"/node_modules/streamx/index.js"},"/node_modules/udx-native/lib/udx.js":{"#package":"/node_modules/udx-native/package.json","../binding":"/node_modules/udx-native/binding.js","./ip":"/node_modules/udx-native/lib/ip.js","./network-interfaces":"/node_modules/udx-native/lib/network-interfaces.js","./socket":"/node_modules/udx-native/lib/socket.js","./stream":"/node_modules/udx-native/lib/stream.js","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/udx-native/package.json"},"/node_modules/unix-path-resolve/index.js":{"#package":"/node_modules/unix-path-resolve/package.json","bare:package":"/node_modules/unix-path-resolve/package.json"},"/node_modules/url-file-url/index.js":{"#package":"/node_modules/url-file-url/package.json","bare:package":"/node_modules/url-file-url/package.json","path":"/node_modules/bare-path/index.js","which-runtime":"/node_modules/which-runtime/index.js"},"/node_modules/which-runtime/index.js":{"#package":"/node_modules/which-runtime/package.json","bare:package":"/node_modules/which-runtime/package.json"},"/node_modules/z32/index.js":{"#package":"/node_modules/z32/package.json","b4a":"/node_modules/b4a/index.js","bare:package":"/node_modules/z32/package.json"},"/preload.js":{"#package":"/package.json","./gui":"/gui/index.js","bare:package":"/package.json","pear-api":"/node_modules/pear-api/index.js","pear-api/gunk":"/node_modules/pear-api/gunk.js","script-linker/runtime":"/node_modules/script-linker/runtime.js","which-runtime":"/node_modules/which-runtime/index.js"}},"addons":[],"assets":[],"files":{"/boot.js":{"offset":0,"length":919,"mode":420},"/electron-main.js":{"offset":919,"length":3533,"mode":420},"/gui/decal.js":{"offset":4452,"length":681445,"mode":420},"/gui/gui.js":{"offset":685897,"length":62937,"mode":420},"/gui/icons/tray.js":{"offset":748834,"length":642,"mode":420},"/gui/index.js":{"offset":749476,"length":100,"mode":420},"/gui/preload.js":{"offset":749576,"length":16682,"mode":420},"/node_modules/b4a/index.js":{"offset":766258,"length":4092,"mode":420},"/node_modules/b4a/package.json":{"offset":770350,"length":701,"mode":420},"/node_modules/bare-env/index.js":{"offset":771051,"length":1023,"mode":420},"/node_modules/bare-env/package.json":{"offset":772074,"length":649,"mode":420},"/node_modules/bare-events/index.js":{"offset":772723,"length":6999,"mode":420},"/node_modules/bare-events/lib/errors.js":{"offset":779722,"length":711,"mode":420},"/node_modules/bare-events/package.json":{"offset":780433,"length":944,"mode":420},"/node_modules/bare-fs/binding.js":{"offset":781377,"length":33,"mode":420},"/node_modules/bare-fs/index.js":{"offset":781410,"length":59807,"mode":420},"/node_modules/bare-fs/package.json":{"offset":841217,"length":926,"mode":420},"/node_modules/bare-os/binding.js":{"offset":842143,"length":33,"mode":420},"/node_modules/bare-os/index.js":{"offset":842176,"length":2141,"mode":420},"/node_modules/bare-os/lib/constants.js":{"offset":844317,"length":113,"mode":420},"/node_modules/bare-os/lib/errors.js":{"offset":844430,"length":479,"mode":420},"/node_modules/bare-os/package.json":{"offset":844909,"length":1022,"mode":420},"/node_modules/bare-path/index.js":{"offset":845931,"length":306,"mode":420},"/node_modules/bare-path/lib/constants.js":{"offset":846237,"length":247,"mode":420},"/node_modules/bare-path/lib/posix.js":{"offset":846484,"length":5991,"mode":420},"/node_modules/bare-path/lib/shared.js":{"offset":852475,"length":1888,"mode":420},"/node_modules/bare-path/lib/win32.js":{"offset":854363,"length":13427,"mode":420},"/node_modules/bare-path/package.json":{"offset":867790,"length":796,"mode":420},"/node_modules/bare-pipe/binding.js":{"offset":868586,"length":33,"mode":420},"/node_modules/bare-pipe/index.js":{"offset":868619,"length":10652,"mode":420},"/node_modules/bare-pipe/lib/constants.js":{"offset":879271,"length":188,"mode":420},"/node_modules/bare-pipe/lib/errors.js":{"offset":879459,"length":711,"mode":420},"/node_modules/bare-pipe/package.json":{"offset":880170,"length":1129,"mode":420},"/node_modules/bare-stream/index.js":{"offset":881299,"length":7649,"mode":420},"/node_modules/bare-stream/package.json":{"offset":888948,"length":1237,"mode":420},"/node_modules/bare-subprocess/binding.js":{"offset":890185,"length":33,"mode":420},"/node_modules/bare-subprocess/index.js":{"offset":890218,"length":5146,"mode":420},"/node_modules/bare-subprocess/lib/constants.js":{"offset":895364,"length":69,"mode":420},"/node_modules/bare-subprocess/lib/errors.js":{"offset":895433,"length":437,"mode":420},"/node_modules/bare-subprocess/package.json":{"offset":895870,"length":1108,"mode":420},"/node_modules/child_process/index.js":{"offset":896978,"length":44,"mode":420},"/node_modules/child_process/package.json":{"offset":897022,"length":582,"mode":420},"/node_modules/compact-encoding/endian.js":{"offset":897604,"length":103,"mode":420},"/node_modules/compact-encoding/index.js":{"offset":897707,"length":19073,"mode":420},"/node_modules/compact-encoding/lexint.js":{"offset":916780,"length":2824,"mode":420},"/node_modules/compact-encoding/package.json":{"offset":919604,"length":713,"mode":420},"/node_modules/compact-encoding/raw.js":{"offset":920317,"length":4118,"mode":420},"/node_modules/crc-native/binding.js":{"offset":924435,"length":54,"mode":420},"/node_modules/crc-native/index.js":{"offset":924489,"length":120,"mode":420},"/node_modules/crc-native/package.json":{"offset":924609,"length":973,"mode":420},"/node_modules/crc-universal/fallback.js":{"offset":925582,"length":2020,"mode":420},"/node_modules/crc-universal/index.js":{"offset":927602,"length":257,"mode":420},"/node_modules/crc-universal/lookup.js":{"offset":927859,"length":439,"mode":420},"/node_modules/crc-universal/package.json":{"offset":928298,"length":816,"mode":420},"/node_modules/fast-fifo/fixed-size.js":{"offset":929114,"length":875,"mode":420},"/node_modules/fast-fifo/index.js":{"offset":929989,"length":972,"mode":420},"/node_modules/fast-fifo/package.json":{"offset":930961,"length":682,"mode":420},"/node_modules/framed-stream/index.js":{"offset":931643,"length":3358,"mode":420},"/node_modules/framed-stream/package.json":{"offset":935001,"length":720,"mode":420},"/node_modules/fs-native-extensions/binding.js":{"offset":935721,"length":54,"mode":420},"/node_modules/fs-native-extensions/index.js":{"offset":935775,"length":4270,"mode":420},"/node_modules/fs-native-extensions/package.json":{"offset":940045,"length":1569,"mode":420},"/node_modules/fs/index.js":{"offset":941614,"length":36,"mode":420},"/node_modules/fs/package.json":{"offset":941650,"length":606,"mode":420},"/node_modules/hypercore-crypto/index.js":{"offset":942256,"length":4820,"mode":420},"/node_modules/hypercore-crypto/package.json":{"offset":947076,"length":771,"mode":420},"/node_modules/hypercore-id-encoding/index.js":{"offset":947847,"length":923,"mode":420},"/node_modules/hypercore-id-encoding/package.json":{"offset":948770,"length":799,"mode":420},"/node_modules/iambus/index.js":{"offset":949569,"length":1607,"mode":420},"/node_modules/iambus/package.json":{"offset":951176,"length":769,"mode":420},"/node_modules/nanoassert/index.js":{"offset":951945,"length":438,"mode":420},"/node_modules/nanoassert/package.json":{"offset":952383,"length":647,"mode":420},"/node_modules/node-gyp-build/index.js":{"offset":953030,"length":390,"mode":420},"/node_modules/node-gyp-build/node-gyp-build.js":{"offset":953420,"length":6078,"mode":420},"/node_modules/node-gyp-build/package.json":{"offset":959498,"length":1004,"mode":420},"/node_modules/paparam/index.js":{"offset":960502,"length":19293,"mode":420},"/node_modules/paparam/package.json":{"offset":979795,"length":637,"mode":420},"/node_modules/path/index.js":{"offset":980432,"length":38,"mode":420},"/node_modules/path/package.json":{"offset":980470,"length":648,"mode":420},"/node_modules/pear-api/cmd/index.js":{"offset":981118,"length":204,"mode":420},"/node_modules/pear-api/cmd/pear.js":{"offset":981322,"length":858,"mode":420},"/node_modules/pear-api/cmd/run.js":{"offset":982180,"length":1516,"mode":420},"/node_modules/pear-api/constants.js":{"offset":983696,"length":2979,"mode":420},"/node_modules/pear-api/crasher.js":{"offset":986675,"length":2583,"mode":420},"/node_modules/pear-api/errors.js":{"offset":989258,"length":3613,"mode":420},"/node_modules/pear-api/gunk.js":{"offset":992871,"length":2542,"mode":420},"/node_modules/pear-api/index.js":{"offset":995413,"length":4733,"mode":420},"/node_modules/pear-api/node_modules/bare-pipe/binding.js":{"offset":1000146,"length":33,"mode":420},"/node_modules/pear-api/node_modules/bare-pipe/index.js":{"offset":1000179,"length":10947,"mode":420},"/node_modules/pear-api/node_modules/bare-pipe/lib/constants.js":{"offset":1011126,"length":188,"mode":420},"/node_modules/pear-api/node_modules/bare-pipe/lib/errors.js":{"offset":1011314,"length":668,"mode":420},"/node_modules/pear-api/node_modules/bare-pipe/package.json":{"offset":1011982,"length":962,"mode":420},"/node_modules/pear-api/node_modules/bare-signals/binding.js":{"offset":1012944,"length":33,"mode":420},"/node_modules/pear-api/node_modules/bare-signals/index.js":{"offset":1012977,"length":1540,"mode":420},"/node_modules/pear-api/node_modules/bare-signals/lib/emitter.js":{"offset":1014517,"length":1236,"mode":420},"/node_modules/pear-api/node_modules/bare-signals/lib/errors.js":{"offset":1015753,"length":396,"mode":420},"/node_modules/pear-api/node_modules/bare-signals/package.json":{"offset":1016149,"length":945,"mode":420},"/node_modules/pear-api/package.json":{"offset":1017094,"length":1293,"mode":420},"/node_modules/pear-api/parse-link.js":{"offset":1018387,"length":224,"mode":420},"/node_modules/pear-api/state.js":{"offset":1018611,"length":6909,"mode":420},"/node_modules/pear-api/teardown.js":{"offset":1025520,"length":1716,"mode":420},"/node_modules/pear-api/tryboot.js":{"offset":1027236,"length":1053,"mode":420},"/node_modules/pear-api/worker.js":{"offset":1028289,"length":2376,"mode":420},"/node_modules/pear-ipc/api.js":{"offset":1030665,"length":1060,"mode":420},"/node_modules/pear-ipc/client.js":{"offset":1031725,"length":5036,"mode":420},"/node_modules/pear-ipc/constants.js":{"offset":1036761,"length":721,"mode":420},"/node_modules/pear-ipc/index.js":{"offset":1037482,"length":164,"mode":420},"/node_modules/pear-ipc/methods.js":{"offset":1037646,"length":1583,"mode":420},"/node_modules/pear-ipc/node_modules/bare-pipe/binding.js":{"offset":1039229,"length":33,"mode":420},"/node_modules/pear-ipc/node_modules/bare-pipe/index.js":{"offset":1039262,"length":10947,"mode":420},"/node_modules/pear-ipc/node_modules/bare-pipe/lib/constants.js":{"offset":1050209,"length":188,"mode":420},"/node_modules/pear-ipc/node_modules/bare-pipe/lib/errors.js":{"offset":1050397,"length":668,"mode":420},"/node_modules/pear-ipc/node_modules/bare-pipe/package.json":{"offset":1051065,"length":962,"mode":420},"/node_modules/pear-ipc/package.json":{"offset":1052027,"length":1300,"mode":420},"/node_modules/pear-ipc/server.js":{"offset":1053327,"length":7491,"mode":420},"/node_modules/pear-link/index.js":{"offset":1060818,"length":3161,"mode":420},"/node_modules/pear-link/package.json":{"offset":1063979,"length":847,"mode":420},"/node_modules/quickbit-native/binding.js":{"offset":1064826,"length":54,"mode":420},"/node_modules/quickbit-native/index.js":{"offset":1064880,"length":4123,"mode":420},"/node_modules/quickbit-native/package.json":{"offset":1069003,"length":1019,"mode":420},"/node_modules/quickbit-universal/fallback.js":{"offset":1070022,"length":10204,"mode":420},"/node_modules/quickbit-universal/index.js":{"offset":1080226,"length":442,"mode":420},"/node_modules/quickbit-universal/package.json":{"offset":1080668,"length":908,"mode":420},"/node_modules/ready-resource/index.js":{"offset":1081576,"length":1091,"mode":420},"/node_modules/ready-resource/package.json":{"offset":1082667,"length":769,"mode":420},"/node_modules/safety-catch/index.js":{"offset":1083436,"length":506,"mode":420},"/node_modules/safety-catch/package.json":{"offset":1083942,"length":547,"mode":420},"/node_modules/script-linker/defaults.js":{"offset":1084489,"length":1251,"mode":420},"/node_modules/script-linker/lib/compile.js":{"offset":1085740,"length":136,"mode":420},"/node_modules/script-linker/package.json":{"offset":1085876,"length":919,"mode":420},"/node_modules/script-linker/runtime.js":{"offset":1086795,"length":6173,"mode":420},"/node_modules/simdle-native/binding.js":{"offset":1092968,"length":54,"mode":420},"/node_modules/simdle-native/index.js":{"offset":1093022,"length":3203,"mode":420},"/node_modules/simdle-native/package.json":{"offset":1096225,"length":1009,"mode":420},"/node_modules/simdle-universal/fallback.js":{"offset":1097234,"length":5137,"mode":420},"/node_modules/simdle-universal/index.js":{"offset":1102371,"length":103,"mode":420},"/node_modules/simdle-universal/package.json":{"offset":1102474,"length":879,"mode":420},"/node_modules/simdle-universal/scalar.js":{"offset":1103353,"length":469,"mode":420},"/node_modules/sodium-native/index.js":{"offset":1103822,"length":54,"mode":420},"/node_modules/sodium-native/package.json":{"offset":1103876,"length":1094,"mode":420},"/node_modules/sodium-universal/index.js":{"offset":1104970,"length":42,"mode":420},"/node_modules/sodium-universal/package.json":{"offset":1105012,"length":1064,"mode":420},"/node_modules/streamx/index.js":{"offset":1106076,"length":33174,"mode":420},"/node_modules/streamx/package.json":{"offset":1139250,"length":912,"mode":420},"/node_modules/text-decoder/index.js":{"offset":1140162,"length":1378,"mode":420},"/node_modules/text-decoder/lib/pass-through-decoder.js":{"offset":1141540,"length":273,"mode":420},"/node_modules/text-decoder/lib/utf8-decoder.js":{"offset":1141813,"length":2529,"mode":420},"/node_modules/text-decoder/package.json":{"offset":1144342,"length":987,"mode":420},"/node_modules/tiny-buffer-rpc/any.js":{"offset":1145329,"length":2475,"mode":420},"/node_modules/tiny-buffer-rpc/index.js":{"offset":1147804,"length":11707,"mode":420},"/node_modules/tiny-buffer-rpc/messages.js":{"offset":1159511,"length":2105,"mode":420},"/node_modules/tiny-buffer-rpc/package.json":{"offset":1161616,"length":713,"mode":420},"/node_modules/udx-native/binding.js":{"offset":1162329,"length":54,"mode":420},"/node_modules/udx-native/lib/ip.js":{"offset":1162383,"length":2179,"mode":420},"/node_modules/udx-native/lib/network-interfaces.js":{"offset":1164562,"length":1335,"mode":420},"/node_modules/udx-native/lib/socket.js":{"offset":1165897,"length":7445,"mode":420},"/node_modules/udx-native/lib/stream.js":{"offset":1173342,"length":12546,"mode":420},"/node_modules/udx-native/lib/udx.js":{"offset":1185888,"length":2842,"mode":420},"/node_modules/udx-native/package.json":{"offset":1188730,"length":1469,"mode":420},"/node_modules/unix-path-resolve/index.js":{"offset":1190199,"length":1356,"mode":420},"/node_modules/unix-path-resolve/package.json":{"offset":1191555,"length":651,"mode":420},"/node_modules/url-file-url/index.js":{"offset":1192206,"length":1702,"mode":420},"/node_modules/url-file-url/package.json":{"offset":1193908,"length":755,"mode":420},"/node_modules/which-runtime/index.js":{"offset":1194663,"length":1222,"mode":420},"/node_modules/which-runtime/package.json":{"offset":1195885,"length":602,"mode":420},"/node_modules/z32/index.js":{"offset":1196487,"length":2654,"mode":420},"/node_modules/z32/package.json":{"offset":1199141,"length":701,"mode":420},"/package.json":{"offset":1199842,"length":1909,"mode":420},"/preload.js":{"offset":1201751,"length":13850,"mode":420}}}
3
3
  /** @typedef {import('pear-interface')} */
4
4
  'use strict'
5
5
  const { isElectron, isElectronRenderer, isElectronWorker, isWindows } = require('which-runtime')
@@ -7049,8 +7049,8 @@ const errors = require('./lib/errors')
7049
7049
 
7050
7050
  const defaultReadBufferSize = 65536
7051
7051
 
7052
- const Pipe = module.exports = exports = class Pipe extends Duplex {
7053
- constructor (path, opts = {}) {
7052
+ module.exports = exports = class Pipe extends Duplex {
7053
+ constructor(path, opts = {}) {
7054
7054
  super({ eagerOpen: true })
7055
7055
 
7056
7056
  if (typeof path === 'object' && path !== null) {
@@ -7058,10 +7058,8 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7058
7058
  path = null
7059
7059
  }
7060
7060
 
7061
- const {
7062
- readBufferSize = defaultReadBufferSize,
7063
- allowHalfOpen = true
7064
- } = opts
7061
+ const { readBufferSize = defaultReadBufferSize, allowHalfOpen = true } =
7062
+ opts
7065
7063
 
7066
7064
  this._state = 0
7067
7065
 
@@ -7077,7 +7075,9 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7077
7075
 
7078
7076
  this._buffer = Buffer.alloc(readBufferSize)
7079
7077
 
7080
- this._handle = binding.init(this._buffer, this,
7078
+ this._handle = binding.init(
7079
+ this._buffer,
7080
+ this,
7081
7081
  noop,
7082
7082
  this._onconnect,
7083
7083
  this._onwrite,
@@ -7091,20 +7091,21 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7091
7091
  } else if (typeof path === 'string') {
7092
7092
  this.connect(path)
7093
7093
  }
7094
-
7095
- Pipe._pipes.add(this)
7096
7094
  }
7097
7095
 
7098
- get connecting () {
7096
+ get connecting() {
7099
7097
  return (this._state & constants.state.CONNECTING) !== 0
7100
7098
  }
7101
7099
 
7102
- get pending () {
7100
+ get pending() {
7103
7101
  return (this._state & constants.state.CONNECTED) === 0
7104
7102
  }
7105
7103
 
7106
- get readyState () {
7107
- if (this._state & constants.state.READABLE && this._state & constants.state.WRITABLE) {
7104
+ get readyState() {
7105
+ if (
7106
+ this._state & constants.state.READABLE &&
7107
+ this._state & constants.state.WRITABLE
7108
+ ) {
7108
7109
  return 'open'
7109
7110
  }
7110
7111
 
@@ -7119,7 +7120,7 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7119
7120
  return 'opening'
7120
7121
  }
7121
7122
 
7122
- open (fd, opts = {}, onconnect) {
7123
+ open(fd, opts = {}, onconnect) {
7123
7124
  if (typeof opts === 'function') {
7124
7125
  onconnect = opts
7125
7126
  opts = {}
@@ -7161,8 +7162,11 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7161
7162
  return this
7162
7163
  }
7163
7164
 
7164
- connect (path, opts = {}, onconnect) {
7165
- if (this._state & constants.state.CONNECTING || this._state & constants.state.CONNECTED) {
7165
+ connect(path, opts = {}, onconnect) {
7166
+ if (
7167
+ this._state & constants.state.CONNECTING ||
7168
+ this._state & constants.state.CONNECTED
7169
+ ) {
7166
7170
  throw errors.PIPE_ALREADY_CONNECTED('Pipe is already connected')
7167
7171
  }
7168
7172
 
@@ -7194,33 +7198,39 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7194
7198
  return this
7195
7199
  }
7196
7200
 
7197
- ref () {
7201
+ ref() {
7198
7202
  binding.ref(this._handle)
7199
7203
  }
7200
7204
 
7201
- unref () {
7205
+ unref() {
7202
7206
  binding.unref(this._handle)
7203
7207
  }
7204
7208
 
7205
- _open (cb) {
7209
+ _open(cb) {
7206
7210
  if (this._state & constants.state.CONNECTED) return cb(null)
7207
7211
  this._pendingOpen = cb
7208
7212
  }
7209
7213
 
7210
- _read () {
7214
+ _read() {
7211
7215
  if ((this._state & constants.state.READING) === 0) {
7212
7216
  this._state |= constants.state.READING
7213
7217
  binding.resume(this._handle)
7214
7218
  }
7215
7219
  }
7216
7220
 
7217
- _writev (batch, cb) {
7221
+ _writev(batch, cb) {
7218
7222
  this._pendingWrite = [cb, batch]
7219
- binding.writev(this._handle, batch.map(({ chunk }) => chunk))
7223
+ binding.writev(
7224
+ this._handle,
7225
+ batch.map(({ chunk }) => chunk)
7226
+ )
7220
7227
  }
7221
7228
 
7222
- _final (cb) {
7223
- if (this._state & constants.state.READABLE && this._state & constants.state.WRITABLE) {
7229
+ _final(cb) {
7230
+ if (
7231
+ this._state & constants.state.READABLE &&
7232
+ this._state & constants.state.WRITABLE
7233
+ ) {
7224
7234
  this._pendingFinal = cb
7225
7235
  binding.end(this._handle)
7226
7236
  } else {
@@ -7228,64 +7238,65 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7228
7238
  }
7229
7239
  }
7230
7240
 
7231
- _predestroy () {
7241
+ _predestroy() {
7232
7242
  if (this._state & constants.state.CLOSING) return
7233
7243
  this._state |= constants.state.CLOSING
7234
7244
  binding.close(this._handle)
7235
- Pipe._pipes.delete(this)
7236
7245
  }
7237
7246
 
7238
- _destroy (err, cb) {
7247
+ _destroy(err, cb) {
7239
7248
  if (this._state & constants.state.CLOSING) return cb(err)
7240
7249
  this._state |= constants.state.CLOSING
7241
7250
  this._pendingDestroy = cb
7242
7251
  binding.close(this._handle)
7243
- Pipe._pipes.delete(this)
7244
7252
  }
7245
7253
 
7246
- _continueOpen (err) {
7254
+ _continueOpen(err) {
7247
7255
  if (this._pendingOpen === null) return
7248
7256
  const cb = this._pendingOpen
7249
7257
  this._pendingOpen = null
7250
7258
  cb(err)
7251
7259
  }
7252
7260
 
7253
- _continueWrite (err) {
7261
+ _continueWrite(err) {
7254
7262
  if (this._pendingWrite === null) return
7255
7263
  const cb = this._pendingWrite[0]
7256
7264
  this._pendingWrite = null
7257
7265
  cb(err)
7258
7266
  }
7259
7267
 
7260
- _continueFinal (err) {
7268
+ _continueFinal(err) {
7261
7269
  if (this._pendingFinal === null) return
7262
7270
  const cb = this._pendingFinal
7263
7271
  this._pendingFinal = null
7264
7272
  cb(err)
7265
7273
  }
7266
7274
 
7267
- _continueDestroy () {
7275
+ _continueDestroy() {
7268
7276
  if (this._pendingDestroy === null) return
7269
7277
  const cb = this._pendingDestroy
7270
7278
  this._pendingDestroy = null
7271
7279
  cb(null)
7272
7280
  }
7273
7281
 
7274
- _onconnect (err) {
7282
+ _onconnect(err) {
7275
7283
  if (err) {
7276
7284
  if (this._pendingOpen) this._continueOpen(err)
7277
7285
  else this.destroy(err)
7278
7286
  return
7279
7287
  }
7280
7288
 
7281
- this._state |= constants.state.CONNECTED | constants.state.READABLE | constants.state.WRITABLE
7289
+ this._state |=
7290
+ constants.state.CONNECTED |
7291
+ constants.state.READABLE |
7292
+ constants.state.WRITABLE
7282
7293
  this._state &= ~constants.state.CONNECTING
7283
7294
  this._continueOpen()
7284
7295
 
7285
7296
  this.emit('connect')
7286
7297
  }
7287
7298
 
7288
- _onread (err, read) {
7299
+ _onread(err, read) {
7289
7300
  if (err) {
7290
7301
  this.destroy(err)
7291
7302
  return
@@ -7306,20 +7317,20 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7306
7317
  }
7307
7318
  }
7308
7319
 
7309
- _onwrite (err) {
7320
+ _onwrite(err) {
7310
7321
  this._continueWrite(err)
7311
7322
  }
7312
7323
 
7313
- _onfinal (err) {
7324
+ _onfinal(err) {
7314
7325
  this._continueFinal(err)
7315
7326
  }
7316
7327
 
7317
- _onclose () {
7328
+ _onclose() {
7318
7329
  this._handle = null
7319
7330
  this._continueDestroy()
7320
7331
  }
7321
7332
 
7322
- _onspawn (readable, writable) {
7333
+ _onspawn(readable, writable) {
7323
7334
  this._state |= constants.state.CONNECTED
7324
7335
 
7325
7336
  if (readable) {
@@ -7336,18 +7347,16 @@ const Pipe = module.exports = exports = class Pipe extends Duplex {
7336
7347
 
7337
7348
  this._continueOpen()
7338
7349
  }
7339
-
7340
- static _pipes = new Set()
7341
7350
  }
7342
7351
 
7343
7352
  exports.Pipe = exports
7344
7353
 
7345
- exports.pipe = function pipe () {
7354
+ exports.pipe = function pipe() {
7346
7355
  return binding.pipe()
7347
7356
  }
7348
7357
 
7349
- const Server = exports.Server = class PipeServer extends EventEmitter {
7350
- constructor (opts = {}, onconnection) {
7358
+ exports.Server = class PipeServer extends EventEmitter {
7359
+ constructor(opts = {}, onconnection) {
7351
7360
  if (typeof opts === 'function') {
7352
7361
  onconnection = opts
7353
7362
  opts = {}
@@ -7355,10 +7364,8 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7355
7364
 
7356
7365
  super()
7357
7366
 
7358
- const {
7359
- readBufferSize = defaultReadBufferSize,
7360
- allowHalfOpen = true
7361
- } = opts
7367
+ const { readBufferSize = defaultReadBufferSize, allowHalfOpen = true } =
7368
+ opts
7362
7369
 
7363
7370
  this._state = 0
7364
7371
 
@@ -7372,15 +7379,13 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7372
7379
  this._handle = null
7373
7380
 
7374
7381
  if (onconnection) this.on('connection', onconnection)
7375
-
7376
- PipeServer._servers.add(this)
7377
7382
  }
7378
7383
 
7379
- get listening () {
7384
+ get listening() {
7380
7385
  return (this._state & constants.state.BOUND) !== 0
7381
7386
  }
7382
7387
 
7383
- address () {
7388
+ address() {
7384
7389
  if ((this._state & constants.state.BOUND) === 0) {
7385
7390
  return null
7386
7391
  }
@@ -7388,8 +7393,11 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7388
7393
  return this._path
7389
7394
  }
7390
7395
 
7391
- listen (path, backlog = 511, opts = {}, onlistening) {
7392
- if (this._state & constants.state.BINDING || this._state & constants.state.BOUND) {
7396
+ listen(path, backlog = 511, opts = {}, onlistening) {
7397
+ if (
7398
+ this._state & constants.state.BINDING ||
7399
+ this._state & constants.state.BOUND
7400
+ ) {
7393
7401
  throw errors.SERVER_ALREADY_LISTENING('Server is already listening')
7394
7402
  }
7395
7403
 
@@ -7413,7 +7421,9 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7413
7421
  backlog = opts.backlog || 511
7414
7422
  }
7415
7423
 
7416
- this._handle = binding.init(empty, this,
7424
+ this._handle = binding.init(
7425
+ empty,
7426
+ this,
7417
7427
  this._onconnection,
7418
7428
  noop,
7419
7429
  noop,
@@ -7443,32 +7453,31 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7443
7453
  return this
7444
7454
  }
7445
7455
 
7446
- close (onclose) {
7456
+ close(onclose) {
7447
7457
  if (onclose) this.once('close', onclose)
7448
7458
  if (this._state & constants.state.CLOSING) return
7449
7459
  this._state |= constants.state.CLOSING
7450
7460
  this._closeMaybe()
7451
7461
  }
7452
7462
 
7453
- ref () {
7463
+ ref() {
7454
7464
  this._state &= ~constants.state.UNREFED
7455
7465
  if (this._handle !== null) binding.ref(this._handle)
7456
7466
  }
7457
7467
 
7458
- unref () {
7468
+ unref() {
7459
7469
  this._state |= constants.state.UNREFED
7460
7470
  if (this._handle !== null) binding.unref(this._handle)
7461
7471
  }
7462
7472
 
7463
- _closeMaybe () {
7464
- if ((this._state & constants.state.CLOSING) && this._connections.size === 0) {
7473
+ _closeMaybe() {
7474
+ if (this._state & constants.state.CLOSING && this._connections.size === 0) {
7465
7475
  if (this._handle !== null) binding.close(this._handle)
7466
7476
  else queueMicrotask(() => this.emit('close'))
7467
- PipeServer._servers.delete(this)
7468
7477
  }
7469
7478
  }
7470
7479
 
7471
- _onconnection (err) {
7480
+ _onconnection(err) {
7472
7481
  if (err) {
7473
7482
  this.emit('error', err)
7474
7483
  return
@@ -7476,7 +7485,7 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7476
7485
 
7477
7486
  if (this._state & constants.state.CLOSING) return
7478
7487
 
7479
- const pipe = new Pipe({
7488
+ const pipe = new exports.Pipe({
7480
7489
  readBufferSize: this._readBufferSize,
7481
7490
  allowHalfOpen: this._allowHalfOpen
7482
7491
  })
@@ -7485,7 +7494,10 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7485
7494
  binding.accept(this._handle, pipe._handle)
7486
7495
 
7487
7496
  pipe._path = this._path
7488
- pipe._state |= constants.state.CONNECTED | constants.state.READABLE | constants.state.WRITABLE
7497
+ pipe._state |=
7498
+ constants.state.CONNECTED |
7499
+ constants.state.READABLE |
7500
+ constants.state.WRITABLE
7489
7501
 
7490
7502
  this._connections.add(pipe)
7491
7503
 
@@ -7502,7 +7514,7 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7502
7514
  }
7503
7515
  }
7504
7516
 
7505
- _onclose () {
7517
+ _onclose() {
7506
7518
  const err = this._error
7507
7519
 
7508
7520
  this._state &= ~constants.state.BINDING
@@ -7512,14 +7524,12 @@ const Server = exports.Server = class PipeServer extends EventEmitter {
7512
7524
  if (err) this.emit('error', err)
7513
7525
  else this.emit('close')
7514
7526
  }
7515
-
7516
- static _servers = new Set()
7517
7527
  }
7518
7528
 
7519
7529
  exports.constants = constants
7520
7530
  exports.errors = errors
7521
7531
 
7522
- exports.createConnection = function createConnection (path, opts, onconnect) {
7532
+ exports.createConnection = function createConnection(path, opts, onconnect) {
7523
7533
  if (typeof opts === 'function') {
7524
7534
  onconnect = opts
7525
7535
  opts = {}
@@ -7530,27 +7540,16 @@ exports.createConnection = function createConnection (path, opts, onconnect) {
7530
7540
  path = opts.path
7531
7541
  }
7532
7542
 
7533
- return new Pipe(opts).connect(path, opts, onconnect)
7543
+ return new exports.Pipe(opts).connect(path, opts, onconnect)
7534
7544
  }
7535
7545
 
7536
- exports.createServer = function createServer (opts, onconnection) {
7537
- return new Server(opts, onconnection)
7546
+ exports.createServer = function createServer(opts, onconnection) {
7547
+ return new exports.Server(opts, onconnection)
7538
7548
  }
7539
7549
 
7540
- Bare
7541
- .on('exit', () => {
7542
- for (const pipe of Pipe._pipes) {
7543
- pipe.destroy()
7544
- }
7545
-
7546
- for (const server of Server._servers) {
7547
- server.close()
7548
- }
7549
- })
7550
-
7551
7550
  const empty = Buffer.alloc(0)
7552
7551
 
7553
- function noop () {}
7552
+ function noop() {}
7554
7553
  module.exports = {
7555
7554
  state: {
7556
7555
  CONNECTING: 0x1,
@@ -7564,7 +7563,7 @@ module.exports = {
7564
7563
  }
7565
7564
  }
7566
7565
  module.exports = class PipeError extends Error {
7567
- constructor (msg, code, fn = PipeError) {
7566
+ constructor(msg, code, fn = PipeError) {
7568
7567
  super(`${code}: ${msg}`)
7569
7568
  this.code = code
7570
7569
 
@@ -7573,34 +7572,46 @@ module.exports = class PipeError extends Error {
7573
7572
  }
7574
7573
  }
7575
7574
 
7576
- get name () {
7575
+ get name() {
7577
7576
  return 'PipeError'
7578
7577
  }
7579
7578
 
7580
- static PIPE_ALREADY_CONNECTED (msg) {
7581
- return new PipeError(msg, 'PIPE_ALREADY_CONNECTED', PipeError.PIPE_ALREADY_CONNECTED)
7579
+ static PIPE_ALREADY_CONNECTED(msg) {
7580
+ return new PipeError(
7581
+ msg,
7582
+ 'PIPE_ALREADY_CONNECTED',
7583
+ PipeError.PIPE_ALREADY_CONNECTED
7584
+ )
7582
7585
  }
7583
7586
 
7584
- static SERVER_ALREADY_LISTENING (msg) {
7585
- return new PipeError(msg, 'SERVER_ALREADY_LISTENING', PipeError.SERVER_ALREADY_LISTENING)
7587
+ static SERVER_ALREADY_LISTENING(msg) {
7588
+ return new PipeError(
7589
+ msg,
7590
+ 'SERVER_ALREADY_LISTENING',
7591
+ PipeError.SERVER_ALREADY_LISTENING
7592
+ )
7586
7593
  }
7587
7594
 
7588
- static SERVER_IS_CLOSED (msg) {
7595
+ static SERVER_IS_CLOSED(msg) {
7589
7596
  return new PipeError(msg, 'SERVER_IS_CLOSED', PipeError.SERVER_IS_CLOSED)
7590
7597
  }
7591
7598
  }
7592
7599
  {
7593
7600
  "name": "bare-pipe",
7594
- "version": "3.3.8",
7601
+ "version": "4.0.3",
7595
7602
  "description": "Native I/O pipes for JavaScript",
7596
7603
  "exports": {
7597
- ".": "./index.js",
7604
+ ".": {
7605
+ "types": "./index.d.ts",
7606
+ "default": "./index.js"
7607
+ },
7598
7608
  "./package": "./package.json",
7599
7609
  "./constants": "./lib/constants.js",
7600
7610
  "./errors": "./lib/errors.js"
7601
7611
  },
7602
7612
  "files": [
7603
7613
  "index.js",
7614
+ "index.d.ts",
7604
7615
  "binding.c",
7605
7616
  "binding.js",
7606
7617
  "CMakeLists.txt",
@@ -7609,7 +7620,7 @@ module.exports = class PipeError extends Error {
7609
7620
  ],
7610
7621
  "addon": true,
7611
7622
  "scripts": {
7612
- "test": "standard && bare test.js"
7623
+ "test": "prettier . --check && bare test.js"
7613
7624
  },
7614
7625
  "repository": {
7615
7626
  "type": "git",
@@ -7621,6 +7632,9 @@ module.exports = class PipeError extends Error {
7621
7632
  "url": "https://github.com/holepunchto/bare-pipe/issues"
7622
7633
  },
7623
7634
  "homepage": "https://github.com/holepunchto/bare-pipe#readme",
7635
+ "engines": {
7636
+ "bare": ">=1.7.0"
7637
+ },
7624
7638
  "dependencies": {
7625
7639
  "bare-events": "^2.0.0",
7626
7640
  "bare-stream": "^2.0.0"
@@ -7629,302 +7643,102 @@ module.exports = class PipeError extends Error {
7629
7643
  "bare-path": "^3.0.0",
7630
7644
  "brittle": "^3.2.1",
7631
7645
  "cmake-bare": "^1.1.6",
7632
- "standard": "^17.0.0"
7646
+ "prettier": "^3.4.1",
7647
+ "prettier-config-standard": "^7.0.0"
7633
7648
  }
7634
7649
  }
7635
- module.exports = require.addon()
7636
- /* global Bare */
7637
- const EventEmitter = require('bare-events')
7638
- const os = require('bare-os')
7639
- const binding = require('./binding')
7640
- const errors = require('./lib/errors')
7650
+ const stream = require('streamx')
7641
7651
 
7642
- const Signal = module.exports = exports = class Signal extends EventEmitter {
7643
- constructor (signum) {
7644
- super()
7652
+ const defaultEncoding = 'utf8'
7645
7653
 
7646
- if (typeof signum === 'string') {
7647
- if (signum in signals === false) {
7648
- throw errors.UNKNOWN_SIGNAL('Unknown signal: ' + signum)
7649
- }
7654
+ module.exports = exports = stream.Stream
7650
7655
 
7651
- signum = signals[signum]
7652
- }
7656
+ exports.pipeline = stream.pipeline
7653
7657
 
7654
- this._signum = signum
7655
- this._handle = binding.init(this, this._onsignal, this._onclose)
7656
- this._closing = null
7658
+ exports.isStream = stream.isStream
7659
+ exports.isEnded = stream.isEnded
7660
+ exports.isFinished = stream.isFinished
7661
+ exports.isDisturbed = stream.isDisturbed
7657
7662
 
7658
- Signal._signals.add(this)
7659
- }
7663
+ exports.getStreamError = stream.getStreamError
7660
7664
 
7661
- _onsignal () {
7662
- this.emit('signal', this._signum)
7663
- }
7665
+ exports.Stream = exports
7664
7666
 
7665
- _onclose () {
7666
- this._handle = null
7667
+ exports.Readable = class Readable extends stream.Readable {
7668
+ constructor(opts = {}) {
7669
+ super({
7670
+ ...opts,
7671
+ byteLength: null,
7672
+ byteLengthReadable: null,
7673
+ map: null,
7674
+ mapReadable: null
7675
+ })
7667
7676
 
7668
- this.emit('close')
7669
- }
7677
+ if (this._construct) this._open = this._construct
7670
7678
 
7671
- start () {
7672
- binding.start(this._handle, this._signum)
7673
- }
7679
+ if (this._read !== stream.Readable.prototype._read) {
7680
+ this._read = read.bind(this, this._read)
7681
+ }
7674
7682
 
7675
- stop () {
7676
- if (this._closing) return
7677
- binding.stop(this._handle)
7683
+ if (this._destroy !== stream.Stream.prototype._destroy) {
7684
+ this._destroy = destroy.bind(this, this._destroy)
7685
+ }
7678
7686
  }
7679
7687
 
7680
- ref () {
7681
- binding.ref(this._handle)
7682
- }
7688
+ push(chunk, encoding) {
7689
+ if (typeof chunk === 'string') {
7690
+ chunk = Buffer.from(chunk, encoding || defaultEncoding)
7691
+ }
7683
7692
 
7684
- unref () {
7685
- binding.unref(this._handle)
7693
+ return super.push(chunk)
7686
7694
  }
7687
7695
 
7688
- close () {
7689
- if (this._closing) return this._closing
7690
- this._closing = EventEmitter.once(this, 'close')
7696
+ unshift(chunk, encoding) {
7697
+ if (typeof chunk === 'string') {
7698
+ chunk = Buffer.from(chunk, encoding || defaultEncoding)
7699
+ }
7691
7700
 
7692
- binding.close(this._handle)
7701
+ super.unshift(chunk)
7702
+ }
7703
+ }
7693
7704
 
7694
- Signal._signals.delete(this)
7705
+ exports.Writable = class Writable extends stream.Writable {
7706
+ constructor(opts = {}) {
7707
+ super({
7708
+ ...opts,
7709
+ byteLength: null,
7710
+ byteLengthWritable,
7711
+ map: null,
7712
+ mapWritable: null
7713
+ })
7695
7714
 
7696
- return this._closing
7697
- }
7715
+ if (this._construct) this._open = this._construct
7698
7716
 
7699
- static _signals = new Set()
7717
+ if (this._write !== stream.Writable.prototype._write) {
7718
+ this._write = write.bind(this, this._write)
7719
+ }
7700
7720
 
7701
- static send (signum, pid = os.pid()) {
7702
- os.kill(pid, signum)
7721
+ if (this._destroy !== stream.Stream.prototype._destroy) {
7722
+ this._destroy = destroy.bind(this, this._destroy)
7723
+ }
7703
7724
  }
7704
- }
7705
7725
 
7706
- exports.Emitter = require('./lib/emitter')
7707
-
7708
- const signals = exports.constants = os.constants.signals
7709
- exports.errors = errors
7726
+ write(chunk, encoding, cb) {
7727
+ if (typeof encoding === 'function') {
7728
+ cb = encoding
7729
+ encoding = null
7730
+ }
7710
7731
 
7711
- Bare
7712
- .on('exit', () => {
7713
- for (const signal of Signal._signals) {
7714
- signal.close()
7732
+ if (typeof chunk === 'string') {
7733
+ encoding = encoding || defaultEncoding
7734
+ chunk = Buffer.from(chunk, encoding)
7735
+ } else {
7736
+ encoding = 'buffer'
7715
7737
  }
7716
- })
7717
- const EventEmitter = require('bare-events')
7718
- const Signal = require('..')
7719
7738
 
7720
- module.exports = class SignalEmitter extends EventEmitter {
7721
- constructor () {
7722
- super()
7739
+ const result = super.write({ chunk, encoding })
7723
7740
 
7724
- this._signals = new Map()
7725
- this._unrefed = false
7726
-
7727
- this
7728
- .on('newListener', this._onnewlistener)
7729
- .on('removeListener', this._onremovelistener)
7730
- }
7731
-
7732
- ref () {
7733
- this._unrefed = false
7734
- for (const signal of this._signals.values()) signal.ref()
7735
- }
7736
-
7737
- unref () {
7738
- this._unrefed = true
7739
- for (const signal of this._signals.values()) signal.unref()
7740
- }
7741
-
7742
- _onnewlistener (name) {
7743
- if (name === 'newListener' || name === 'removeListener') return
7744
-
7745
- if (this.listenerCount(name) === 0) {
7746
- const signal = new Signal(name)
7747
-
7748
- signal
7749
- .on('signal', this._onsignal.bind(this, name))
7750
- .start()
7751
-
7752
- if (this._unrefed) signal.unref()
7753
-
7754
- this._signals.set(name, signal)
7755
- }
7756
- }
7757
-
7758
- _onremovelistener (name) {
7759
- if (name === 'newListener' || name === 'removeListener') return
7760
-
7761
- if (this.listenerCount(name) === 0) {
7762
- const signal = this._signals.get(name)
7763
-
7764
- if (this._unrefed) signal.ref()
7765
-
7766
- signal.close()
7767
-
7768
- this._signals.delete(name)
7769
- }
7770
- }
7771
-
7772
- _onsignal (name) {
7773
- this.emit(name)
7774
- }
7775
- }
7776
- module.exports = class SignalError extends Error {
7777
- constructor (msg, code, fn = SignalError) {
7778
- super(`${code}: ${msg}`)
7779
- this.code = code
7780
-
7781
- if (Error.captureStackTrace) {
7782
- Error.captureStackTrace(this, fn)
7783
- }
7784
- }
7785
-
7786
- get name () {
7787
- return 'SignalError'
7788
- }
7789
-
7790
- static UNKNOWN_SIGNAL (msg) {
7791
- return new SignalError(msg, 'UNKNOWN_SIGNAL', SignalError.UNKNOWN_SIGNAL)
7792
- }
7793
- }
7794
- {
7795
- "name": "bare-signals",
7796
- "version": "3.0.2",
7797
- "description": "Native signal handling for JavaScript",
7798
- "exports": {
7799
- ".": "./index.js",
7800
- "./package": "./package.json",
7801
- "./errors": "./lib/errors.js",
7802
- "./emitter": "./lib/emitter.js"
7803
- },
7804
- "files": [
7805
- "index.js",
7806
- "binding.c",
7807
- "binding.js",
7808
- "CMakeLists.txt",
7809
- "lib",
7810
- "prebuilds"
7811
- ],
7812
- "addon": true,
7813
- "scripts": {
7814
- "test": "standard && bare test.js"
7815
- },
7816
- "repository": {
7817
- "type": "git",
7818
- "url": "git+https://github.com/holepunchto/bare-signals.git"
7819
- },
7820
- "author": "Holepunch",
7821
- "license": "Apache-2.0",
7822
- "bugs": {
7823
- "url": "https://github.com/holepunchto/bare-signals/issues"
7824
- },
7825
- "homepage": "https://github.com/holepunchto/bare-signals#readme",
7826
- "dependencies": {
7827
- "bare-events": "^2.0.0",
7828
- "bare-os": "^3.0.1"
7829
- },
7830
- "devDependencies": {
7831
- "brittle": "^3.2.1",
7832
- "cmake-bare": "^1.1.6",
7833
- "standard": "^17.0.0"
7834
- }
7835
- }
7836
- const stream = require('streamx')
7837
-
7838
- const defaultEncoding = 'utf8'
7839
-
7840
- module.exports = exports = stream.Stream
7841
-
7842
- exports.pipeline = stream.pipeline
7843
-
7844
- exports.isStream = stream.isStream
7845
- exports.isEnded = stream.isEnded
7846
- exports.isFinished = stream.isFinished
7847
- exports.isDisturbed = stream.isDisturbed
7848
-
7849
- exports.getStreamError = stream.getStreamError
7850
-
7851
- exports.Stream = exports
7852
-
7853
- exports.Readable = class Readable extends stream.Readable {
7854
- constructor(opts = {}) {
7855
- super({
7856
- ...opts,
7857
- byteLength: null,
7858
- byteLengthReadable: null,
7859
- map: null,
7860
- mapReadable: null
7861
- })
7862
-
7863
- if (this._construct) this._open = this._construct
7864
-
7865
- if (this._read !== stream.Readable.prototype._read) {
7866
- this._read = read.bind(this, this._read)
7867
- }
7868
-
7869
- if (this._destroy !== stream.Stream.prototype._destroy) {
7870
- this._destroy = destroy.bind(this, this._destroy)
7871
- }
7872
- }
7873
-
7874
- push(chunk, encoding) {
7875
- if (typeof chunk === 'string') {
7876
- chunk = Buffer.from(chunk, encoding || defaultEncoding)
7877
- }
7878
-
7879
- return super.push(chunk)
7880
- }
7881
-
7882
- unshift(chunk, encoding) {
7883
- if (typeof chunk === 'string') {
7884
- chunk = Buffer.from(chunk, encoding || defaultEncoding)
7885
- }
7886
-
7887
- super.unshift(chunk)
7888
- }
7889
- }
7890
-
7891
- exports.Writable = class Writable extends stream.Writable {
7892
- constructor(opts = {}) {
7893
- super({
7894
- ...opts,
7895
- byteLength: null,
7896
- byteLengthWritable,
7897
- map: null,
7898
- mapWritable: null
7899
- })
7900
-
7901
- if (this._construct) this._open = this._construct
7902
-
7903
- if (this._write !== stream.Writable.prototype._write) {
7904
- this._write = write.bind(this, this._write)
7905
- }
7906
-
7907
- if (this._destroy !== stream.Stream.prototype._destroy) {
7908
- this._destroy = destroy.bind(this, this._destroy)
7909
- }
7910
- }
7911
-
7912
- write(chunk, encoding, cb) {
7913
- if (typeof encoding === 'function') {
7914
- cb = encoding
7915
- encoding = null
7916
- }
7917
-
7918
- if (typeof chunk === 'string') {
7919
- encoding = encoding || defaultEncoding
7920
- chunk = Buffer.from(chunk, encoding)
7921
- } else {
7922
- encoding = 'buffer'
7923
- }
7924
-
7925
- const result = super.write({ chunk, encoding })
7926
-
7927
- if (cb) stream.Writable.drained(this).then(() => cb(null), cb)
7741
+ if (cb) stream.Writable.drained(this).then(() => cb(null), cb)
7928
7742
 
7929
7743
  return result
7930
7744
  }
@@ -8255,8 +8069,8 @@ const binding = require('./binding')
8255
8069
  const constants = require('./lib/constants')
8256
8070
  const errors = require('./lib/errors')
8257
8071
 
8258
- const Subprocess = exports.Subprocess = class Subprocess extends EventEmitter {
8259
- constructor () {
8072
+ exports.Subprocess = class Subprocess extends EventEmitter {
8073
+ constructor() {
8260
8074
  super()
8261
8075
 
8262
8076
  this.spawnfile = null
@@ -8270,28 +8084,26 @@ const Subprocess = exports.Subprocess = class Subprocess extends EventEmitter {
8270
8084
  this._handle = binding.init(this, this._onexit)
8271
8085
  }
8272
8086
 
8273
- _onexit (code, signal) {
8087
+ _onexit(code, signal) {
8274
8088
  this.exitCode = code
8275
8089
  this.signalCode = signal
8276
8090
 
8277
- Subprocess._processes.delete(this)
8278
-
8279
8091
  this.emit('exit', code, signal)
8280
8092
  }
8281
8093
 
8282
- get stdin () {
8094
+ get stdin() {
8283
8095
  return this.stdio[0] || null
8284
8096
  }
8285
8097
 
8286
- get stdout () {
8098
+ get stdout() {
8287
8099
  return this.stdio[1] || null
8288
8100
  }
8289
8101
 
8290
- get stderr () {
8102
+ get stderr() {
8291
8103
  return this.stdio[2] || null
8292
8104
  }
8293
8105
 
8294
- ref () {
8106
+ ref() {
8295
8107
  for (const pipe of this.stdio) {
8296
8108
  if (pipe) pipe.ref()
8297
8109
  }
@@ -8299,7 +8111,7 @@ const Subprocess = exports.Subprocess = class Subprocess extends EventEmitter {
8299
8111
  binding.ref(this._handle)
8300
8112
  }
8301
8113
 
8302
- unref () {
8114
+ unref() {
8303
8115
  for (const pipe of this.stdio) {
8304
8116
  if (pipe) pipe.unref()
8305
8117
  }
@@ -8307,7 +8119,7 @@ const Subprocess = exports.Subprocess = class Subprocess extends EventEmitter {
8307
8119
  binding.unref(this._handle)
8308
8120
  }
8309
8121
 
8310
- kill (signum = constants.SIGTERM) {
8122
+ kill(signum = constants.SIGTERM) {
8311
8123
  if (typeof signum === 'string') {
8312
8124
  if (signum in constants === false) {
8313
8125
  throw errors.UNKNOWN_SIGNAL('Unknown signal: ' + signum)
@@ -8320,14 +8132,12 @@ const Subprocess = exports.Subprocess = class Subprocess extends EventEmitter {
8320
8132
 
8321
8133
  this.killed = true
8322
8134
  }
8323
-
8324
- static _processes = new Set()
8325
8135
  }
8326
8136
 
8327
8137
  exports.constants = constants
8328
8138
  exports.errors = errors
8329
8139
 
8330
- exports.spawn = function spawn (file, args, opts) {
8140
+ exports.spawn = function spawn(file, args, opts) {
8331
8141
  if (Array.isArray(args)) {
8332
8142
  args = [...args]
8333
8143
  } else if (args === null) {
@@ -8351,7 +8161,8 @@ exports.spawn = function spawn (file, args, opts) {
8351
8161
 
8352
8162
  const pairs = []
8353
8163
 
8354
- for (const [key, value] of Object.entries(opts.env || env)) pairs.push(`${key}=${value}`)
8164
+ for (const [key, value] of Object.entries(opts.env || env))
8165
+ pairs.push(`${key}=${value}`)
8355
8166
 
8356
8167
  if (Array.isArray(stdio)) {
8357
8168
  stdio = [...stdio]
@@ -8361,7 +8172,7 @@ exports.spawn = function spawn (file, args, opts) {
8361
8172
  stdio = []
8362
8173
  }
8363
8174
 
8364
- const subprocess = new Subprocess()
8175
+ const subprocess = new exports.Subprocess()
8365
8176
 
8366
8177
  subprocess.spawnfile = file
8367
8178
  subprocess.spawnargs = args
@@ -8380,7 +8191,10 @@ exports.spawn = function spawn (file, args, opts) {
8380
8191
 
8381
8192
  pipe._onspawn(true /* Readable */, true /* Writable */)
8382
8193
 
8383
- let flags = binding.UV_CREATE_PIPE | binding.UV_READABLE_PIPE | binding.UV_WRITABLE_PIPE
8194
+ let flags =
8195
+ binding.UV_CREATE_PIPE |
8196
+ binding.UV_READABLE_PIPE |
8197
+ binding.UV_WRITABLE_PIPE
8384
8198
 
8385
8199
  if (fd === 'overlapped') flags |= binding.UV_NONBLOCK_PIPE
8386
8200
 
@@ -8392,7 +8206,8 @@ exports.spawn = function spawn (file, args, opts) {
8392
8206
  }
8393
8207
  }
8394
8208
 
8395
- subprocess.pid = binding.spawn(subprocess._handle,
8209
+ subprocess.pid = binding.spawn(
8210
+ subprocess._handle,
8396
8211
  file,
8397
8212
  args,
8398
8213
  cwd,
@@ -8403,12 +8218,10 @@ exports.spawn = function spawn (file, args, opts) {
8403
8218
  gid
8404
8219
  )
8405
8220
 
8406
- Subprocess._processes.add(subprocess)
8407
-
8408
8221
  return subprocess
8409
8222
  }
8410
8223
 
8411
- exports.spawnSync = function spawn (file, args, opts) {
8224
+ exports.spawnSync = function spawn(file, args, opts) {
8412
8225
  if (Array.isArray(args)) {
8413
8226
  args = [...args]
8414
8227
  } else if (args === null) {
@@ -8432,7 +8245,8 @@ exports.spawnSync = function spawn (file, args, opts) {
8432
8245
 
8433
8246
  const pairs = []
8434
8247
 
8435
- for (const [key, value] of Object.entries(opts.env || env)) pairs.push(`${key}=${value}`)
8248
+ for (const [key, value] of Object.entries(opts.env || env))
8249
+ pairs.push(`${key}=${value}`)
8436
8250
 
8437
8251
  if (Array.isArray(stdio)) {
8438
8252
  stdio = [...stdio]
@@ -8442,10 +8256,13 @@ exports.spawnSync = function spawn (file, args, opts) {
8442
8256
  stdio = []
8443
8257
  }
8444
8258
 
8445
- const subprocess = new Subprocess()
8259
+ const subprocess = new exports.Subprocess()
8446
8260
 
8447
8261
  if (input) {
8448
- stdio[0] = { flags: binding.UV_CREATE_PIPE | binding.UV_READABLE_PIPE, buffer: input }
8262
+ stdio[0] = {
8263
+ flags: binding.UV_CREATE_PIPE | binding.UV_READABLE_PIPE,
8264
+ buffer: input
8265
+ }
8449
8266
 
8450
8267
  subprocess.stdio[0] = null
8451
8268
  }
@@ -8462,7 +8279,11 @@ exports.spawnSync = function spawn (file, args, opts) {
8462
8279
  } else if (fd === 'pipe') {
8463
8280
  const buffer = Buffer.alloc(maxBuffer)
8464
8281
 
8465
- stdio[i] = { flags: binding.UV_CREATE_PIPE | binding.UV_WRITABLE_PIPE, buffer, written: 0 }
8282
+ stdio[i] = {
8283
+ flags: binding.UV_CREATE_PIPE | binding.UV_WRITABLE_PIPE,
8284
+ buffer,
8285
+ written: 0
8286
+ }
8466
8287
 
8467
8288
  if (i > 0) subprocess.stdio[i] = buffer
8468
8289
  } else if (typeof fd === 'number') {
@@ -8470,7 +8291,8 @@ exports.spawnSync = function spawn (file, args, opts) {
8470
8291
  }
8471
8292
  }
8472
8293
 
8473
- subprocess.pid = binding.spawnSync(subprocess._handle,
8294
+ subprocess.pid = binding.spawnSync(
8295
+ subprocess._handle,
8474
8296
  file,
8475
8297
  args,
8476
8298
  cwd,
@@ -8496,17 +8318,11 @@ exports.spawnSync = function spawn (file, args, opts) {
8496
8318
  stderr: subprocess.stderr
8497
8319
  }
8498
8320
  }
8499
-
8500
- Bare.on('exit', () => {
8501
- for (const process of Subprocess._processes) {
8502
- binding.close(process._handle)
8503
- }
8504
- })
8505
8321
  const os = require('bare-os')
8506
8322
 
8507
8323
  module.exports = os.constants.signals
8508
8324
  module.exports = class SubprocessError extends Error {
8509
- constructor (msg, code, fn = SubprocessError) {
8325
+ constructor(msg, code, fn = SubprocessError) {
8510
8326
  super(`${code}: ${msg}`)
8511
8327
  this.code = code
8512
8328
 
@@ -8515,17 +8331,21 @@ module.exports = class SubprocessError extends Error {
8515
8331
  }
8516
8332
  }
8517
8333
 
8518
- get name () {
8334
+ get name() {
8519
8335
  return 'SubprocessError'
8520
8336
  }
8521
8337
 
8522
- static UNKNOWN_SIGNAL (msg) {
8523
- return new SubprocessError(msg, 'UNKNOWN_SIGNAL', SubprocessError.UNKNOWN_SIGNAL)
8338
+ static UNKNOWN_SIGNAL(msg) {
8339
+ return new SubprocessError(
8340
+ msg,
8341
+ 'UNKNOWN_SIGNAL',
8342
+ SubprocessError.UNKNOWN_SIGNAL
8343
+ )
8524
8344
  }
8525
8345
  }
8526
8346
  {
8527
8347
  "name": "bare-subprocess",
8528
- "version": "4.0.3",
8348
+ "version": "5.0.2",
8529
8349
  "description": "Native process spawning for JavaScript",
8530
8350
  "exports": {
8531
8351
  ".": "./index.js",
@@ -8543,7 +8363,7 @@ module.exports = class SubprocessError extends Error {
8543
8363
  ],
8544
8364
  "addon": true,
8545
8365
  "scripts": {
8546
- "test": "standard && bare test.js"
8366
+ "test": "prettier . --check && bare test.js"
8547
8367
  },
8548
8368
  "repository": {
8549
8369
  "type": "git",
@@ -8555,16 +8375,20 @@ module.exports = class SubprocessError extends Error {
8555
8375
  "url": "https://github.com/holepunchto/bare-subprocess/issues"
8556
8376
  },
8557
8377
  "homepage": "https://github.com/holepunchto/bare-subprocess#readme",
8378
+ "engines": {
8379
+ "bare": ">=1.7.0"
8380
+ },
8558
8381
  "dependencies": {
8559
8382
  "bare-env": "^3.0.0",
8560
8383
  "bare-events": "^2.0.0",
8561
8384
  "bare-os": "^3.0.1",
8562
- "bare-pipe": "^3.3.0"
8385
+ "bare-pipe": "^4.0.0"
8563
8386
  },
8564
8387
  "devDependencies": {
8565
8388
  "brittle": "^3.2.1",
8566
8389
  "cmake-bare": "^1.1.7",
8567
- "standard": "^17.0.0"
8390
+ "prettier": "^3.4.1",
8391
+ "prettier-config-standard": "^7.0.0"
8568
8392
  }
8569
8393
  }
8570
8394
  module.exports = require('bare-subprocess')
@@ -12540,32 +12364,826 @@ class API {
12540
12364
  function noop () {}
12541
12365
 
12542
12366
  module.exports = API
12543
- {
12544
- "name": "pear-api",
12545
- "version": "1.3.14",
12546
- "description": "Pear API Base & Integration Module",
12547
- "main": "index.js",
12548
- "scripts": {
12549
- "test": "echo \"Error: no test specified\" && exit 1"
12550
- },
12551
- "files": [
12552
- "cmd/",
12553
- "constants.js",
12554
- "crasher.js",
12555
- "errors.js",
12556
- "gunk.js",
12557
- "index.js",
12558
- "logger.js",
12559
- "parse-link.js",
12560
- "shell.js",
12561
- "state.js",
12562
- "teardown.js",
12563
- "terminal.js",
12564
- "transform.js",
12565
- "tryboot.js",
12566
- "worker.js"
12567
- ],
12568
- "keywords": [
12367
+ module.exports = require.addon()
12368
+ /* global Bare */
12369
+ const EventEmitter = require('bare-events')
12370
+ const { Duplex } = require('bare-stream')
12371
+ const binding = require('./binding')
12372
+ const constants = require('./lib/constants')
12373
+ const errors = require('./lib/errors')
12374
+
12375
+ const defaultReadBufferSize = 65536
12376
+
12377
+ const Pipe = module.exports = exports = class Pipe extends Duplex {
12378
+ constructor (path, opts = {}) {
12379
+ super({ eagerOpen: true })
12380
+
12381
+ if (typeof path === 'object' && path !== null) {
12382
+ opts = path
12383
+ path = null
12384
+ }
12385
+
12386
+ const {
12387
+ readBufferSize = defaultReadBufferSize,
12388
+ allowHalfOpen = true
12389
+ } = opts
12390
+
12391
+ this._state = 0
12392
+
12393
+ this._allowHalfOpen = allowHalfOpen
12394
+
12395
+ this._fd = -1
12396
+ this._path = null
12397
+
12398
+ this._pendingOpen = null
12399
+ this._pendingWrite = null
12400
+ this._pendingFinal = null
12401
+ this._pendingDestroy = null
12402
+
12403
+ this._buffer = Buffer.alloc(readBufferSize)
12404
+
12405
+ this._handle = binding.init(this._buffer, this,
12406
+ noop,
12407
+ this._onconnect,
12408
+ this._onwrite,
12409
+ this._onfinal,
12410
+ this._onread,
12411
+ this._onclose
12412
+ )
12413
+
12414
+ if (typeof path === 'number') {
12415
+ this.open(path)
12416
+ } else if (typeof path === 'string') {
12417
+ this.connect(path)
12418
+ }
12419
+
12420
+ Pipe._pipes.add(this)
12421
+ }
12422
+
12423
+ get connecting () {
12424
+ return (this._state & constants.state.CONNECTING) !== 0
12425
+ }
12426
+
12427
+ get pending () {
12428
+ return (this._state & constants.state.CONNECTED) === 0
12429
+ }
12430
+
12431
+ get readyState () {
12432
+ if (this._state & constants.state.READABLE && this._state & constants.state.WRITABLE) {
12433
+ return 'open'
12434
+ }
12435
+
12436
+ if (this._state & constants.state.READABLE) {
12437
+ return 'readOnly'
12438
+ }
12439
+
12440
+ if (this._state & constants.state.WRITABLE) {
12441
+ return 'writeOnly'
12442
+ }
12443
+
12444
+ return 'opening'
12445
+ }
12446
+
12447
+ open (fd, opts = {}, onconnect) {
12448
+ if (typeof opts === 'function') {
12449
+ onconnect = opts
12450
+ opts = {}
12451
+ }
12452
+
12453
+ if (typeof fd === 'object' && fd !== null) {
12454
+ opts = fd || {}
12455
+ fd = opts.fd
12456
+ }
12457
+
12458
+ try {
12459
+ const status = binding.open(this._handle, fd)
12460
+
12461
+ this._state |= constants.state.CONNECTED
12462
+ this._fd = fd
12463
+
12464
+ if (status & binding.READABLE) {
12465
+ this._state |= constants.state.READABLE
12466
+ } else {
12467
+ this.push(null)
12468
+ }
12469
+
12470
+ if (status & binding.WRITABLE) {
12471
+ this._state |= constants.state.WRITABLE
12472
+ } else {
12473
+ this.end()
12474
+ }
12475
+
12476
+ if (onconnect) this.once('connect', onconnect)
12477
+
12478
+ queueMicrotask(() => this.emit('connect'))
12479
+ } catch (err) {
12480
+ queueMicrotask(() => {
12481
+ if (this._pendingOpen) this._pendingOpen(err)
12482
+ else this.destroy(err)
12483
+ })
12484
+ }
12485
+
12486
+ return this
12487
+ }
12488
+
12489
+ connect (path, opts = {}, onconnect) {
12490
+ if (this._state & constants.state.CONNECTING || this._state & constants.state.CONNECTED) {
12491
+ throw errors.PIPE_ALREADY_CONNECTED('Pipe is already connected')
12492
+ }
12493
+
12494
+ this._state |= constants.state.CONNECTING
12495
+
12496
+ if (typeof opts === 'function') {
12497
+ onconnect = opts
12498
+ opts = {}
12499
+ }
12500
+
12501
+ if (typeof path === 'object' && path !== null) {
12502
+ opts = path || {}
12503
+ path = opts.path
12504
+ }
12505
+
12506
+ try {
12507
+ binding.connect(this._handle, path)
12508
+
12509
+ this._path = path
12510
+
12511
+ if (onconnect) this.once('connect', onconnect)
12512
+ } catch (err) {
12513
+ queueMicrotask(() => {
12514
+ if (this._pendingOpen) this._pendingOpen(err)
12515
+ else this.destroy(err)
12516
+ })
12517
+ }
12518
+
12519
+ return this
12520
+ }
12521
+
12522
+ ref () {
12523
+ binding.ref(this._handle)
12524
+ }
12525
+
12526
+ unref () {
12527
+ binding.unref(this._handle)
12528
+ }
12529
+
12530
+ _open (cb) {
12531
+ if (this._state & constants.state.CONNECTED) return cb(null)
12532
+ this._pendingOpen = cb
12533
+ }
12534
+
12535
+ _read () {
12536
+ if ((this._state & constants.state.READING) === 0) {
12537
+ this._state |= constants.state.READING
12538
+ binding.resume(this._handle)
12539
+ }
12540
+ }
12541
+
12542
+ _writev (batch, cb) {
12543
+ this._pendingWrite = [cb, batch]
12544
+ binding.writev(this._handle, batch.map(({ chunk }) => chunk))
12545
+ }
12546
+
12547
+ _final (cb) {
12548
+ if (this._state & constants.state.READABLE && this._state & constants.state.WRITABLE) {
12549
+ this._pendingFinal = cb
12550
+ binding.end(this._handle)
12551
+ } else {
12552
+ cb(null)
12553
+ }
12554
+ }
12555
+
12556
+ _predestroy () {
12557
+ if (this._state & constants.state.CLOSING) return
12558
+ this._state |= constants.state.CLOSING
12559
+ binding.close(this._handle)
12560
+ Pipe._pipes.delete(this)
12561
+ }
12562
+
12563
+ _destroy (err, cb) {
12564
+ if (this._state & constants.state.CLOSING) return cb(err)
12565
+ this._state |= constants.state.CLOSING
12566
+ this._pendingDestroy = cb
12567
+ binding.close(this._handle)
12568
+ Pipe._pipes.delete(this)
12569
+ }
12570
+
12571
+ _continueOpen (err) {
12572
+ if (this._pendingOpen === null) return
12573
+ const cb = this._pendingOpen
12574
+ this._pendingOpen = null
12575
+ cb(err)
12576
+ }
12577
+
12578
+ _continueWrite (err) {
12579
+ if (this._pendingWrite === null) return
12580
+ const cb = this._pendingWrite[0]
12581
+ this._pendingWrite = null
12582
+ cb(err)
12583
+ }
12584
+
12585
+ _continueFinal (err) {
12586
+ if (this._pendingFinal === null) return
12587
+ const cb = this._pendingFinal
12588
+ this._pendingFinal = null
12589
+ cb(err)
12590
+ }
12591
+
12592
+ _continueDestroy () {
12593
+ if (this._pendingDestroy === null) return
12594
+ const cb = this._pendingDestroy
12595
+ this._pendingDestroy = null
12596
+ cb(null)
12597
+ }
12598
+
12599
+ _onconnect (err) {
12600
+ if (err) {
12601
+ if (this._pendingOpen) this._continueOpen(err)
12602
+ else this.destroy(err)
12603
+ return
12604
+ }
12605
+
12606
+ this._state |= constants.state.CONNECTED | constants.state.READABLE | constants.state.WRITABLE
12607
+ this._state &= ~constants.state.CONNECTING
12608
+ this._continueOpen()
12609
+
12610
+ this.emit('connect')
12611
+ }
12612
+
12613
+ _onread (err, read) {
12614
+ if (err) {
12615
+ this.destroy(err)
12616
+ return
12617
+ }
12618
+
12619
+ if (read === 0) {
12620
+ this.push(null)
12621
+ if (this._allowHalfOpen === false) this.end()
12622
+ return
12623
+ }
12624
+
12625
+ const copy = Buffer.allocUnsafe(read)
12626
+ copy.set(this._buffer.subarray(0, read))
12627
+
12628
+ if (this.push(copy) === false && this.destroying === false) {
12629
+ this._state &= ~constants.state.READING
12630
+ binding.pause(this._handle)
12631
+ }
12632
+ }
12633
+
12634
+ _onwrite (err) {
12635
+ this._continueWrite(err)
12636
+ }
12637
+
12638
+ _onfinal (err) {
12639
+ this._continueFinal(err)
12640
+ }
12641
+
12642
+ _onclose () {
12643
+ this._handle = null
12644
+ this._continueDestroy()
12645
+ }
12646
+
12647
+ _onspawn (readable, writable) {
12648
+ this._state |= constants.state.CONNECTED
12649
+
12650
+ if (readable) {
12651
+ this._state |= constants.state.READABLE
12652
+ } else {
12653
+ this.push(null)
12654
+ }
12655
+
12656
+ if (writable) {
12657
+ this._state |= constants.state.WRITABLE
12658
+ } else {
12659
+ this.end()
12660
+ }
12661
+
12662
+ this._continueOpen()
12663
+ }
12664
+
12665
+ static _pipes = new Set()
12666
+ }
12667
+
12668
+ exports.Pipe = exports
12669
+
12670
+ exports.pipe = function pipe () {
12671
+ return binding.pipe()
12672
+ }
12673
+
12674
+ const Server = exports.Server = class PipeServer extends EventEmitter {
12675
+ constructor (opts = {}, onconnection) {
12676
+ if (typeof opts === 'function') {
12677
+ onconnection = opts
12678
+ opts = {}
12679
+ }
12680
+
12681
+ super()
12682
+
12683
+ const {
12684
+ readBufferSize = defaultReadBufferSize,
12685
+ allowHalfOpen = true
12686
+ } = opts
12687
+
12688
+ this._state = 0
12689
+
12690
+ this._readBufferSize = readBufferSize
12691
+ this._allowHalfOpen = allowHalfOpen
12692
+
12693
+ this._path = null
12694
+ this._connections = new Set()
12695
+
12696
+ this._error = null
12697
+ this._handle = null
12698
+
12699
+ if (onconnection) this.on('connection', onconnection)
12700
+
12701
+ PipeServer._servers.add(this)
12702
+ }
12703
+
12704
+ get listening () {
12705
+ return (this._state & constants.state.BOUND) !== 0
12706
+ }
12707
+
12708
+ address () {
12709
+ if ((this._state & constants.state.BOUND) === 0) {
12710
+ return null
12711
+ }
12712
+
12713
+ return this._path
12714
+ }
12715
+
12716
+ listen (path, backlog = 511, opts = {}, onlistening) {
12717
+ if (this._state & constants.state.BINDING || this._state & constants.state.BOUND) {
12718
+ throw errors.SERVER_ALREADY_LISTENING('Server is already listening')
12719
+ }
12720
+
12721
+ if (this._state & constants.state.CLOSING) {
12722
+ throw errors.SERVER_IS_CLOSED('Server is closed')
12723
+ }
12724
+
12725
+ this._state |= constants.state.BINDING
12726
+
12727
+ if (typeof backlog === 'function') {
12728
+ onlistening = backlog
12729
+ backlog = 511
12730
+ } else if (typeof opts === 'function') {
12731
+ onlistening = opts
12732
+ opts = {}
12733
+ }
12734
+
12735
+ if (typeof path === 'object' && path !== null) {
12736
+ opts = path || {}
12737
+ path = opts.path
12738
+ backlog = opts.backlog || 511
12739
+ }
12740
+
12741
+ this._handle = binding.init(empty, this,
12742
+ this._onconnection,
12743
+ noop,
12744
+ noop,
12745
+ noop,
12746
+ noop,
12747
+ this._onclose
12748
+ )
12749
+
12750
+ if (this._state & constants.state.UNREFED) binding.unref(this._handle)
12751
+
12752
+ try {
12753
+ binding.bind(this._handle, path, backlog)
12754
+
12755
+ this._path = path
12756
+ this._state |= constants.state.BOUND
12757
+ this._state &= ~constants.state.BINDING
12758
+
12759
+ if (onlistening) this.once('listening', onlistening)
12760
+
12761
+ queueMicrotask(() => this.emit('listening'))
12762
+ } catch (err) {
12763
+ this._error = err
12764
+
12765
+ binding.close(this._handle)
12766
+ }
12767
+
12768
+ return this
12769
+ }
12770
+
12771
+ close (onclose) {
12772
+ if (onclose) this.once('close', onclose)
12773
+ if (this._state & constants.state.CLOSING) return
12774
+ this._state |= constants.state.CLOSING
12775
+ this._closeMaybe()
12776
+ }
12777
+
12778
+ ref () {
12779
+ this._state &= ~constants.state.UNREFED
12780
+ if (this._handle !== null) binding.ref(this._handle)
12781
+ }
12782
+
12783
+ unref () {
12784
+ this._state |= constants.state.UNREFED
12785
+ if (this._handle !== null) binding.unref(this._handle)
12786
+ }
12787
+
12788
+ _closeMaybe () {
12789
+ if ((this._state & constants.state.CLOSING) && this._connections.size === 0) {
12790
+ if (this._handle !== null) binding.close(this._handle)
12791
+ else queueMicrotask(() => this.emit('close'))
12792
+ PipeServer._servers.delete(this)
12793
+ }
12794
+ }
12795
+
12796
+ _onconnection (err) {
12797
+ if (err) {
12798
+ this.emit('error', err)
12799
+ return
12800
+ }
12801
+
12802
+ if (this._state & constants.state.CLOSING) return
12803
+
12804
+ const pipe = new Pipe({
12805
+ readBufferSize: this._readBufferSize,
12806
+ allowHalfOpen: this._allowHalfOpen
12807
+ })
12808
+
12809
+ try {
12810
+ binding.accept(this._handle, pipe._handle)
12811
+
12812
+ pipe._path = this._path
12813
+ pipe._state |= constants.state.CONNECTED | constants.state.READABLE | constants.state.WRITABLE
12814
+
12815
+ this._connections.add(pipe)
12816
+
12817
+ pipe.on('close', () => {
12818
+ this._connections.delete(pipe)
12819
+ this._closeMaybe()
12820
+ })
12821
+
12822
+ this.emit('connection', pipe)
12823
+ } catch (err) {
12824
+ pipe.destroy()
12825
+
12826
+ throw err
12827
+ }
12828
+ }
12829
+
12830
+ _onclose () {
12831
+ const err = this._error
12832
+
12833
+ this._state &= ~constants.state.BINDING
12834
+ this._error = null
12835
+ this._handle = null
12836
+
12837
+ if (err) this.emit('error', err)
12838
+ else this.emit('close')
12839
+ }
12840
+
12841
+ static _servers = new Set()
12842
+ }
12843
+
12844
+ exports.constants = constants
12845
+ exports.errors = errors
12846
+
12847
+ exports.createConnection = function createConnection (path, opts, onconnect) {
12848
+ if (typeof opts === 'function') {
12849
+ onconnect = opts
12850
+ opts = {}
12851
+ }
12852
+
12853
+ if (typeof path === 'object' && path !== null) {
12854
+ opts = path || {}
12855
+ path = opts.path
12856
+ }
12857
+
12858
+ return new Pipe(opts).connect(path, opts, onconnect)
12859
+ }
12860
+
12861
+ exports.createServer = function createServer (opts, onconnection) {
12862
+ return new Server(opts, onconnection)
12863
+ }
12864
+
12865
+ Bare
12866
+ .on('exit', () => {
12867
+ for (const pipe of Pipe._pipes) {
12868
+ pipe.destroy()
12869
+ }
12870
+
12871
+ for (const server of Server._servers) {
12872
+ server.close()
12873
+ }
12874
+ })
12875
+
12876
+ const empty = Buffer.alloc(0)
12877
+
12878
+ function noop () {}
12879
+ module.exports = {
12880
+ state: {
12881
+ CONNECTING: 0x1,
12882
+ CONNECTED: 0x2,
12883
+ BINDING: 0x4,
12884
+ BOUND: 0x8,
12885
+ READING: 0x10,
12886
+ CLOSING: 0x20,
12887
+ READABLE: 0x40,
12888
+ WRITABLE: 0x80
12889
+ }
12890
+ }
12891
+ module.exports = class PipeError extends Error {
12892
+ constructor (msg, code, fn = PipeError) {
12893
+ super(`${code}: ${msg}`)
12894
+ this.code = code
12895
+
12896
+ if (Error.captureStackTrace) {
12897
+ Error.captureStackTrace(this, fn)
12898
+ }
12899
+ }
12900
+
12901
+ get name () {
12902
+ return 'PipeError'
12903
+ }
12904
+
12905
+ static PIPE_ALREADY_CONNECTED (msg) {
12906
+ return new PipeError(msg, 'PIPE_ALREADY_CONNECTED', PipeError.PIPE_ALREADY_CONNECTED)
12907
+ }
12908
+
12909
+ static SERVER_ALREADY_LISTENING (msg) {
12910
+ return new PipeError(msg, 'SERVER_ALREADY_LISTENING', PipeError.SERVER_ALREADY_LISTENING)
12911
+ }
12912
+
12913
+ static SERVER_IS_CLOSED (msg) {
12914
+ return new PipeError(msg, 'SERVER_IS_CLOSED', PipeError.SERVER_IS_CLOSED)
12915
+ }
12916
+ }
12917
+ {
12918
+ "name": "bare-pipe",
12919
+ "version": "3.3.8",
12920
+ "description": "Native I/O pipes for JavaScript",
12921
+ "exports": {
12922
+ ".": "./index.js",
12923
+ "./package": "./package.json",
12924
+ "./constants": "./lib/constants.js",
12925
+ "./errors": "./lib/errors.js"
12926
+ },
12927
+ "files": [
12928
+ "index.js",
12929
+ "binding.c",
12930
+ "binding.js",
12931
+ "CMakeLists.txt",
12932
+ "lib",
12933
+ "prebuilds"
12934
+ ],
12935
+ "addon": true,
12936
+ "scripts": {
12937
+ "test": "standard && bare test.js"
12938
+ },
12939
+ "repository": {
12940
+ "type": "git",
12941
+ "url": "git+https://github.com/holepunchto/bare-pipe.git"
12942
+ },
12943
+ "author": "Holepunch",
12944
+ "license": "Apache-2.0",
12945
+ "bugs": {
12946
+ "url": "https://github.com/holepunchto/bare-pipe/issues"
12947
+ },
12948
+ "homepage": "https://github.com/holepunchto/bare-pipe#readme",
12949
+ "dependencies": {
12950
+ "bare-events": "^2.0.0",
12951
+ "bare-stream": "^2.0.0"
12952
+ },
12953
+ "devDependencies": {
12954
+ "bare-path": "^3.0.0",
12955
+ "brittle": "^3.2.1",
12956
+ "cmake-bare": "^1.1.6",
12957
+ "standard": "^17.0.0"
12958
+ }
12959
+ }
12960
+ module.exports = require.addon()
12961
+ /* global Bare */
12962
+ const EventEmitter = require('bare-events')
12963
+ const os = require('bare-os')
12964
+ const binding = require('./binding')
12965
+ const errors = require('./lib/errors')
12966
+
12967
+ const Signal = module.exports = exports = class Signal extends EventEmitter {
12968
+ constructor (signum) {
12969
+ super()
12970
+
12971
+ if (typeof signum === 'string') {
12972
+ if (signum in signals === false) {
12973
+ throw errors.UNKNOWN_SIGNAL('Unknown signal: ' + signum)
12974
+ }
12975
+
12976
+ signum = signals[signum]
12977
+ }
12978
+
12979
+ this._signum = signum
12980
+ this._handle = binding.init(this, this._onsignal, this._onclose)
12981
+ this._closing = null
12982
+
12983
+ Signal._signals.add(this)
12984
+ }
12985
+
12986
+ _onsignal () {
12987
+ this.emit('signal', this._signum)
12988
+ }
12989
+
12990
+ _onclose () {
12991
+ this._handle = null
12992
+
12993
+ this.emit('close')
12994
+ }
12995
+
12996
+ start () {
12997
+ binding.start(this._handle, this._signum)
12998
+ }
12999
+
13000
+ stop () {
13001
+ if (this._closing) return
13002
+ binding.stop(this._handle)
13003
+ }
13004
+
13005
+ ref () {
13006
+ binding.ref(this._handle)
13007
+ }
13008
+
13009
+ unref () {
13010
+ binding.unref(this._handle)
13011
+ }
13012
+
13013
+ close () {
13014
+ if (this._closing) return this._closing
13015
+ this._closing = EventEmitter.once(this, 'close')
13016
+
13017
+ binding.close(this._handle)
13018
+
13019
+ Signal._signals.delete(this)
13020
+
13021
+ return this._closing
13022
+ }
13023
+
13024
+ static _signals = new Set()
13025
+
13026
+ static send (signum, pid = os.pid()) {
13027
+ os.kill(pid, signum)
13028
+ }
13029
+ }
13030
+
13031
+ exports.Emitter = require('./lib/emitter')
13032
+
13033
+ const signals = exports.constants = os.constants.signals
13034
+ exports.errors = errors
13035
+
13036
+ Bare
13037
+ .on('exit', () => {
13038
+ for (const signal of Signal._signals) {
13039
+ signal.close()
13040
+ }
13041
+ })
13042
+ const EventEmitter = require('bare-events')
13043
+ const Signal = require('..')
13044
+
13045
+ module.exports = class SignalEmitter extends EventEmitter {
13046
+ constructor () {
13047
+ super()
13048
+
13049
+ this._signals = new Map()
13050
+ this._unrefed = false
13051
+
13052
+ this
13053
+ .on('newListener', this._onnewlistener)
13054
+ .on('removeListener', this._onremovelistener)
13055
+ }
13056
+
13057
+ ref () {
13058
+ this._unrefed = false
13059
+ for (const signal of this._signals.values()) signal.ref()
13060
+ }
13061
+
13062
+ unref () {
13063
+ this._unrefed = true
13064
+ for (const signal of this._signals.values()) signal.unref()
13065
+ }
13066
+
13067
+ _onnewlistener (name) {
13068
+ if (name === 'newListener' || name === 'removeListener') return
13069
+
13070
+ if (this.listenerCount(name) === 0) {
13071
+ const signal = new Signal(name)
13072
+
13073
+ signal
13074
+ .on('signal', this._onsignal.bind(this, name))
13075
+ .start()
13076
+
13077
+ if (this._unrefed) signal.unref()
13078
+
13079
+ this._signals.set(name, signal)
13080
+ }
13081
+ }
13082
+
13083
+ _onremovelistener (name) {
13084
+ if (name === 'newListener' || name === 'removeListener') return
13085
+
13086
+ if (this.listenerCount(name) === 0) {
13087
+ const signal = this._signals.get(name)
13088
+
13089
+ if (this._unrefed) signal.ref()
13090
+
13091
+ signal.close()
13092
+
13093
+ this._signals.delete(name)
13094
+ }
13095
+ }
13096
+
13097
+ _onsignal (name) {
13098
+ this.emit(name)
13099
+ }
13100
+ }
13101
+ module.exports = class SignalError extends Error {
13102
+ constructor (msg, code, fn = SignalError) {
13103
+ super(`${code}: ${msg}`)
13104
+ this.code = code
13105
+
13106
+ if (Error.captureStackTrace) {
13107
+ Error.captureStackTrace(this, fn)
13108
+ }
13109
+ }
13110
+
13111
+ get name () {
13112
+ return 'SignalError'
13113
+ }
13114
+
13115
+ static UNKNOWN_SIGNAL (msg) {
13116
+ return new SignalError(msg, 'UNKNOWN_SIGNAL', SignalError.UNKNOWN_SIGNAL)
13117
+ }
13118
+ }
13119
+ {
13120
+ "name": "bare-signals",
13121
+ "version": "3.0.2",
13122
+ "description": "Native signal handling for JavaScript",
13123
+ "exports": {
13124
+ ".": "./index.js",
13125
+ "./package": "./package.json",
13126
+ "./errors": "./lib/errors.js",
13127
+ "./emitter": "./lib/emitter.js"
13128
+ },
13129
+ "files": [
13130
+ "index.js",
13131
+ "binding.c",
13132
+ "binding.js",
13133
+ "CMakeLists.txt",
13134
+ "lib",
13135
+ "prebuilds"
13136
+ ],
13137
+ "addon": true,
13138
+ "scripts": {
13139
+ "test": "standard && bare test.js"
13140
+ },
13141
+ "repository": {
13142
+ "type": "git",
13143
+ "url": "git+https://github.com/holepunchto/bare-signals.git"
13144
+ },
13145
+ "author": "Holepunch",
13146
+ "license": "Apache-2.0",
13147
+ "bugs": {
13148
+ "url": "https://github.com/holepunchto/bare-signals/issues"
13149
+ },
13150
+ "homepage": "https://github.com/holepunchto/bare-signals#readme",
13151
+ "dependencies": {
13152
+ "bare-events": "^2.0.0",
13153
+ "bare-os": "^3.0.1"
13154
+ },
13155
+ "devDependencies": {
13156
+ "brittle": "^3.2.1",
13157
+ "cmake-bare": "^1.1.6",
13158
+ "standard": "^17.0.0"
13159
+ }
13160
+ }
13161
+ {
13162
+ "name": "pear-api",
13163
+ "version": "1.3.15",
13164
+ "description": "Pear API Base & Integration Module",
13165
+ "main": "index.js",
13166
+ "scripts": {
13167
+ "test": "echo \"Error: no test specified\" && exit 1"
13168
+ },
13169
+ "files": [
13170
+ "cmd/",
13171
+ "constants.js",
13172
+ "crasher.js",
13173
+ "errors.js",
13174
+ "gunk.js",
13175
+ "index.js",
13176
+ "logger.js",
13177
+ "parse-link.js",
13178
+ "shell.js",
13179
+ "state.js",
13180
+ "teardown.js",
13181
+ "terminal.js",
13182
+ "transform.js",
13183
+ "tryboot.js",
13184
+ "worker.js"
13185
+ ],
13186
+ "keywords": [
12569
13187
  "pear",
12570
13188
  "pear runtime",
12571
13189
  "peer-to-peer",
@@ -12600,673 +13218,1266 @@ module.exports = API
12600
13218
  }
12601
13219
  }
12602
13220
  'use strict'
12603
- const constants = require('./constants')
12604
- const { ERR_INVALID_LINK } = require('./errors')
12605
- const pearLink = require('pear-link')
12606
- const parse = pearLink(constants.ALIASES, ERR_INVALID_LINK)
12607
- module.exports = parse
13221
+ const constants = require('./constants')
13222
+ const { ERR_INVALID_LINK } = require('./errors')
13223
+ const pearLink = require('pear-link')
13224
+ const parse = pearLink(constants.ALIASES, ERR_INVALID_LINK)
13225
+ module.exports = parse
13226
+ 'use strict'
13227
+ const { isBare, isWindows } = require('which-runtime')
13228
+ const os = isBare ? require('bare-os') : require('os')
13229
+ const fs = isBare ? require('bare-fs') : require('fs')
13230
+ const path = isBare ? require('bare-path') : require('path')
13231
+ const { pathToFileURL } = require('url-file-url')
13232
+ const hypercoreid = require('hypercore-id-encoding')
13233
+ const z32 = require('z32')
13234
+ const crypto = require('hypercore-crypto')
13235
+ const { PLATFORM_DIR, SWAP, RUNTIME } = require('pear-api/constants')
13236
+ const CWD = isBare ? os.cwd() : process.cwd()
13237
+ const ENV = isBare ? require('bare-env') : process.env
13238
+ const parseLink = require('./parse-link')
13239
+ const { ERR_INVALID_APP_NAME, ERR_INVALID_APP_STORAGE } = require('./errors')
13240
+ const readPkg = (pkgPath) => {
13241
+ let pkg = null
13242
+ try { pkg = fs.readFileSync(path.resolve(pkgPath)) } catch { /* ignore */ }
13243
+ if (pkg) pkg = JSON.parse(pkg) // important to know if this throws, so no try/catch
13244
+ return pkg
13245
+ }
13246
+
13247
+ module.exports = class State {
13248
+ env = null
13249
+ channel = null
13250
+ args = null
13251
+ checkpoint = null
13252
+ #onupdate = null
13253
+ runtime = RUNTIME
13254
+ reloadingSince = 0
13255
+ type = null
13256
+ error = null
13257
+ entrypoints = null
13258
+ applink = null
13259
+ dht = null
13260
+ ui = null
13261
+ static injestPackage (state, pkg, overrides = {}) {
13262
+ state.manifest = pkg
13263
+ state.main = pkg?.main || 'index.html'
13264
+ state.options = pkg?.pear || null
13265
+ state.name = pkg?.pear?.name || pkg?.name || null
13266
+ state.links = pkg?.pear?.links || null
13267
+ state.gui = pkg?.pear?.gui || null
13268
+ if (overrides.links) {
13269
+ const links = overrides.links.split(',').reduce((links, kv) => {
13270
+ const [key, value] = kv.split('=')
13271
+ links[key] = value
13272
+ return links
13273
+ }, {})
13274
+ state.links = { ...(state.links || {}), ...links }
13275
+ }
13276
+ state.dependencies = [
13277
+ ...(pkg?.dependencies ? Object.keys(pkg.dependencies) : []),
13278
+ ...(pkg?.devDependencies ? Object.keys(pkg.devDependencies) : []),
13279
+ ...(pkg?.peerDependencies ? Object.keys(pkg.peerDependencies) : []),
13280
+ ...(pkg?.optionalDependencies ? Object.keys(pkg.optionalDependencies) : []),
13281
+ ...(pkg?.bundleDependencies || []),
13282
+ ...(pkg?.bundledDependencies || [])
13283
+ ]
13284
+ state.entrypoints = new Set(pkg?.pear?.stage?.entrypoints || [])
13285
+ }
13286
+
13287
+ static storageFromLink (link) {
13288
+ const parsedLink = typeof link === 'string' ? parseLink(link) : link
13289
+ const appStorage = path.join(PLATFORM_DIR, 'app-storage')
13290
+ return parsedLink.protocol !== 'pear:'
13291
+ ? path.join(appStorage, 'by-random', crypto.randomBytes(16).toString('hex'))
13292
+ : path.join(appStorage, 'by-dkey', crypto.discoveryKey(hypercoreid.decode(parsedLink.drive.key)).toString('hex'))
13293
+ }
13294
+
13295
+ static configFrom (state) {
13296
+ const { id, startId, key, links, alias, env, gui, options, checkpoint, checkout, flags, dev, tier, stage, storage, name, main, dependencies, args, channel, release, applink, fragment, link, linkData, entrypoint, dir, dht } = state
13297
+ const pearDir = PLATFORM_DIR
13298
+ const swapDir = SWAP
13299
+ return { id, startId, key, links, alias, env, gui, options, checkpoint, checkout, flags, dev, tier, stage, storage, name, main, dependencies, args, channel, release, applink, fragment, link, linkData, entrypoint, dir, dht, pearDir, swapDir }
13300
+ }
13301
+
13302
+ static isKeetInvite (segment) {
13303
+ if (!segment || segment.length < 100) return false
13304
+ try { z32.decode(segment) } catch { return false }
13305
+ return true
13306
+ }
13307
+
13308
+ static isEntrypoint (pathname) {
13309
+ if (pathname === null || pathname === '/') return false
13310
+ // NOTE: return true once keet invite code detection is no longer needed, assess for removal October 2024
13311
+ const segment = pathname = pathname?.startsWith('/') ? pathname.slice(1) : pathname
13312
+ return this.isKeetInvite(segment) === false
13313
+ }
13314
+
13315
+ update (state) {
13316
+ Object.assign(this, state)
13317
+ this.#onupdate()
13318
+ }
13319
+
13320
+ constructor (params = {}) {
13321
+ const { dht, link, id = null, args = null, env = ENV, cwd = CWD, dir = cwd, cmdArgs, onupdate = () => {}, flags, run, storage = null } = params
13322
+ const {
13323
+ startId, appling, channel, devtools, checkout, links,
13324
+ dev = false, stage, updates, updatesDiff, followSymlinks,
13325
+ unsafeClearAppStorage, chromeWebrtcInternals
13326
+ } = flags
13327
+ const { drive: { alias = null, key = null }, pathname: route, protocol, hash } = link ? parseLink(link) : { drive: {} }
13328
+ const pathname = protocol === 'file:' ? (isWindows ? route.slice(1).slice(dir.length) : route.slice(dir.length)) : route
13329
+ const segment = pathname?.startsWith('/') ? pathname.slice(1) : pathname
13330
+ const fragment = hash ? hash.slice(1) : (this.constructor.isKeetInvite(segment) ? segment : null)
13331
+ const entrypoint = this.constructor.isEntrypoint(pathname) ? pathname : null
13332
+ const pkgPath = path.join(dir, 'package.json')
13333
+ const pkg = key === null ? readPkg(pkgPath) : null
13334
+ const store = flags.tmpStore ? path.join(os.tmpdir(), crypto.randomBytes(16).toString('hex')) : flags.store
13335
+ this.#onupdate = onupdate
13336
+ this.startId = startId || null
13337
+ this.dht = dht
13338
+ this.store = store
13339
+ this.args = args
13340
+ this.appling = appling
13341
+ this.channel = channel || null
13342
+ this.checkout = checkout
13343
+ this.dir = dir
13344
+ this.cwd = cwd
13345
+ this.run = run ?? flags.run
13346
+ this.storage = storage
13347
+ this.flags = flags
13348
+ this.dev = dev
13349
+ this.devtools = this.dev || devtools
13350
+ this.updatesDiff = this.dev || updatesDiff
13351
+ this.updates = updates
13352
+ this.stage = stage
13353
+ this.fragment = fragment
13354
+ this.entrypoint = entrypoint
13355
+ this.linkData = segment
13356
+ this.link = link ? (link.startsWith(protocol) ? link : pathToFileURL(link).toString()) : null
13357
+ this.key = key
13358
+ this.applink = key ? this.link.slice(0, -(~~(pathname?.length) + ~~(hash?.length))) : null
13359
+ this.alias = alias
13360
+ this.manifest = pkg
13361
+ this.cmdArgs = cmdArgs
13362
+ this.pkgPath = pkgPath
13363
+ this.id = id
13364
+ this.followSymlinks = followSymlinks
13365
+ this.rti = flags.rti ? JSON.parse(flags.rti) : null // important to know if this throws, so no try/catch
13366
+ this.clearAppStorage = unsafeClearAppStorage
13367
+ this.chromeWebrtcInternals = chromeWebrtcInternals
13368
+ this.env = { ...env }
13369
+ if (this.stage || (this.run && this.dev === false)) {
13370
+ this.env.NODE_ENV = this.env.NODE_ENV || 'production'
13371
+ }
13372
+ this.constructor.injestPackage(this, pkg, { links })
13373
+ const invalidStorage = this.key === null && this.storage !== null && this.storage.startsWith(this.dir) && this.storage.includes('/pear/pear/') === false
13374
+ if (invalidStorage) throw ERR_INVALID_APP_STORAGE('Application Storage may not be inside the project directory. --store "' + this.storage + '" is invalid')
13375
+ const invalidName = /^[@/a-z0-9-_]+$/.test(this.name) === false
13376
+ if (invalidName) throw ERR_INVALID_APP_NAME('The package.json name / pear.name field must be lowercase and one word, and may contain letters, numbers, hyphens (-), underscores (_), forward slashes (/) and asperands (@).')
13377
+ }
13378
+ }
13379
+ /* global Bare */
13380
+ const Signal = require('bare-signals')
13381
+ const safetyCatch = require('safety-catch')
13382
+
13383
+ const handlers = []
13384
+
13385
+ let exiting = false
13386
+
13387
+ const sigint = new Signal('SIGINT')
13388
+ const sigterm = new Signal('SIGTERM')
13389
+
13390
+ sigint
13391
+ .on('signal', (signum) => {
13392
+ sigint.stop()
13393
+ sigint.unref()
13394
+ Bare.exitCode = 130
13395
+ onexit(() => { Signal.send(signum, Bare.pid) })
13396
+ })
13397
+
13398
+ sigterm
13399
+ .on('signal', (signum) => {
13400
+ sigterm.stop()
13401
+ sigterm.unref()
13402
+ Bare.exitCode = 143
13403
+ onexit(() => { Signal.send(signum, Bare.pid) })
13404
+ })
13405
+
13406
+ function onexit (ondone) {
13407
+ if (exiting) return
13408
+ exiting = true
13409
+
13410
+ Bare.removeListener('beforeExit', onexit)
13411
+
13412
+ const order = []
13413
+
13414
+ for (const h of handlers.sort((a, b) => b.position - a.position)) {
13415
+ if (!order.length || order[order.length - 1][0].position !== h.position) order.push([])
13416
+ order[order.length - 1].push(h)
13417
+ }
13418
+
13419
+ const loopdown = loop()
13420
+
13421
+ if (ondone) loopdown.finally(ondone)
13422
+
13423
+ function loop () {
13424
+ if (!order.length) return
13425
+ return Promise.allSettled(order.pop().map(run)).then(loop, loop)
13426
+ }
13427
+ }
13428
+
13429
+ async function run (h) {
13430
+ try {
13431
+ await h.fn()
13432
+ } catch (e) {
13433
+ safetyCatch(e)
13434
+ }
13435
+ }
13436
+
13437
+ function setup () {
13438
+ Bare.prependListener('beforeExit', onexit)
13439
+ sigint.start()
13440
+ sigterm.start()
13441
+
13442
+ sigint.unref()
13443
+ sigterm.unref()
13444
+ }
13445
+
13446
+ function cleanup () {
13447
+ Bare.removeListener('beforeExit', onexit)
13448
+ sigint.close()
13449
+ sigterm.close()
13450
+ }
13451
+
13452
+ function teardown (fn, position = 0) {
13453
+ if (handlers.length === 0) setup()
13454
+ const handler = { position, fn }
13455
+ handlers.push(handler)
13456
+
13457
+ return function unregister () {
13458
+ const i = handlers.indexOf(handler)
13459
+ if (i > -1) handlers.splice(i, 1)
13460
+ if (!handlers.length) cleanup()
13461
+ }
13462
+ }
13463
+
13464
+ module.exports = teardown
13465
+ 'use strict'
13466
+ const { spawn } = require('child_process')
13467
+ const { RUNTIME, PLATFORM_DIR } = require('./constants')
13468
+ const pear = require('./cmd')
13469
+
13470
+ module.exports = function tryboot () {
13471
+ const { argv } = global.Bare || global.process
13472
+ const { flags = {} } = pear(argv.slice(1)) ?? {}
13473
+ const args = ['--sidecar']
13474
+ const dhtBootstrap = argv.includes('--dht-bootstrap') ? argv[argv.indexOf('--dht-bootstrap') + 1] : null
13475
+ if (dhtBootstrap) {
13476
+ args.push('--dht-bootstrap')
13477
+ args.push(dhtBootstrap)
13478
+ }
13479
+ let detached = true
13480
+ if (flags.log) {
13481
+ args.push('--log')
13482
+ detached = false
13483
+ } else {
13484
+ const { length } = args
13485
+ if (flags.logLevel) args.push('--log-level', flags.logLevel)
13486
+ if (flags.logFields) args.push('--log-fields', flags.logFields)
13487
+ if (flags.logLabels) args.push('--log-labels', flags.logLabels)
13488
+ if (args.length > length) detached = false
13489
+ }
13490
+ if (flags.logStacks) args.push('--log-stacks')
13491
+ const sc = spawn(RUNTIME, args, { detached, stdio: detached ? 'ignore' : 'inherit', cwd: PLATFORM_DIR })
13492
+ sc.unref()
13493
+ }
13494
+ 'use strict'
13495
+ const fs = require('fs')
13496
+ const { spawn } = require('child_process')
13497
+ const { isWindows, isBare } = require('which-runtime')
13498
+ const { command } = require('paparam')
13499
+ const Pipe = isBare
13500
+ ? require('bare-pipe')
13501
+ : class Pipe extends require('net').Socket { constructor (fd) { super({ fd }) } }
13502
+ const teardown = isBare ? require('./teardown') : (fn) => fn()
13503
+ const { RUNTIME } = require('./constants')
13504
+ const rundef = require('./cmd/run')
13505
+ const noop = Function.prototype
13506
+
13507
+ class Worker {
13508
+ #pipe = null
13509
+ #ref = null
13510
+ #unref = null
13511
+ static RUNTIME = RUNTIME
13512
+ constructor ({ ref = noop, unref = noop } = {}) {
13513
+ this.#ref = ref
13514
+ this.#unref = unref
13515
+ }
13516
+
13517
+ #args (link) {
13518
+ const parser = command('pear', command('run', ...rundef))
13519
+ const argv = ['run', '--trusted', ...global.Bare.argv.slice(2)]
13520
+ const cmd = parser.parse(argv, { sync: true })
13521
+ const args = argv.map((arg) => arg === cmd.args.link ? link : arg)
13522
+ if (cmd.indices.rest > 0) args.splice(cmd.indices.rest)
13523
+ let linksIndex = cmd.indices.flags.links
13524
+ const linksElements = linksIndex > 0 ? (cmd.flags.links === args[linksIndex]) ? 2 : 1 : 0
13525
+ if (cmd.indices.flags.startId > 0) {
13526
+ args.splice(cmd.indices.flags.startId, 1)
13527
+ if (linksIndex > cmd.indices.flags.startId) linksIndex -= linksElements
13528
+ }
13529
+ if (linksIndex > 0) args.splice(linksIndex, linksElements)
13530
+ return args
13531
+ }
13532
+
13533
+ run (link, args = []) {
13534
+ args = [...this.#args(link), ...args]
13535
+ const sp = spawn(this.constructor.RUNTIME, args, {
13536
+ stdio: ['inherit', 'inherit', 'inherit', 'overlapped'],
13537
+ windowsHide: true
13538
+ })
13539
+ this.#ref()
13540
+ sp.once('exit', (exitCode) => {
13541
+ if (exitCode !== 0) pipe.emit('crash', { exitCode })
13542
+ this.#unref()
13543
+ })
13544
+ const pipe = sp.stdio[3]
13545
+ pipe.on('end', () => pipe.end())
13546
+ return pipe
13547
+ }
13548
+
13549
+ pipe () {
13550
+ if (this.#pipe) return this.#pipe
13551
+ const fd = 3
13552
+ try {
13553
+ const isWorker = isWindows ? fs.fstatSync(fd).isFIFO() : fs.fstatSync(fd).isSocket()
13554
+ if (isWorker === false) return null
13555
+ } catch {
13556
+ return null
13557
+ }
13558
+ const pipe = new Pipe(fd)
13559
+ pipe.on('end', () => {
13560
+ teardown(() => pipe.end(), Number.MAX_SAFE_INTEGER)
13561
+ })
13562
+ this.#pipe = pipe
13563
+ pipe.once('close', () => {
13564
+ teardown(() => global.Bare.exit(), Number.MAX_SAFE_INTEGER)
13565
+ })
13566
+ return pipe
13567
+ }
13568
+ }
13569
+
13570
+ module.exports = Worker
13571
+ 'use strict'
13572
+ const fs = require('fs')
13573
+ const fsext = require('fs-native-extensions')
13574
+
13575
+ class Internal {
13576
+ _pinging = true
13577
+ _ping (method) { return () => this._pinging && method.request({ beat: 'ping' }) }
13578
+ }
13579
+
13580
+ class API extends Internal {
13581
+ #ipc = null
13582
+
13583
+ constructor (ipc) {
13584
+ super()
13585
+ this.#ipc = ipc
13586
+ }
13587
+
13588
+ wakeup (method) {
13589
+ return (link, storage, appdev) => method.request({ args: [link, storage, appdev] })
13590
+ }
13591
+
13592
+ shutdown (method) {
13593
+ return async () => {
13594
+ if (this.#ipc.closed || this.#ipc.closing) return
13595
+ this._pinging = false
13596
+ method.send()
13597
+ const fd = await new Promise((resolve, reject) => fs.open(this.#ipc._lock, 'r+', (err, fd) => {
13598
+ if (err) {
13599
+ reject(err)
13600
+ return
13601
+ }
13602
+ resolve(fd)
13603
+ }))
13604
+ await fsext.waitForLock(fd)
13605
+ fsext.unlock(fd)
13606
+ await new Promise((resolve, reject) => fs.close(fd, (err) => {
13607
+ if (err) {
13608
+ reject(err)
13609
+ return
13610
+ }
13611
+ resolve()
13612
+ }))
13613
+ await this.#ipc.close()
13614
+ }
13615
+ }
13616
+ }
13617
+
13618
+ module.exports = API
13619
+ 'use strict'
13620
+ const { isBare } = require('which-runtime')
13621
+ const Pipe = require('net') // import mapped to bare-pipe, less resolves
13622
+ const path = require('path')
13623
+ const RPC = require('tiny-buffer-rpc')
13624
+ const any = require('tiny-buffer-rpc/any')
13625
+ const ReadyResource = require('ready-resource')
13626
+ const FramedStream = require('framed-stream')
13627
+
13628
+ const API = require('./api')
13629
+ const methods = require('./methods')
13630
+ const constants = require('./constants')
13631
+
13632
+ class PearIPCClient extends ReadyResource {
13633
+ #connect = null
13634
+ constructor (opts = {}) {
13635
+ super()
13636
+ this._opts = opts
13637
+ this._socketPath = opts.socketPath
13638
+ this._methods = opts.methods ? [...methods, ...opts.methods] : methods
13639
+ this._lock = opts.lock || path.join(constants.PEAR_DIR, 'corestores', 'platform', 'primary-key')
13640
+ const api = new API(this)
13641
+ if (opts.api) Object.assign(api, opts.api)
13642
+ this._api = api
13643
+ this._connectTimeout = opts.connectTimeout || constants.CONNECT_TIMEOUT
13644
+ this.#connect = opts.connect || null
13645
+ this._rpc = null
13646
+ this._internalHandlers = null
13647
+
13648
+ this._rawStream = opts.stream || null
13649
+ this._stream = null
13650
+
13651
+ this.userData = opts.userData || null
13652
+
13653
+ this._onclose = this.close.bind(this)
13654
+ }
13655
+
13656
+ ref () {
13657
+ this._heartbeat?.ref()
13658
+ this._timeout?.ref()
13659
+ if (this._rawStream?.ref) this._rawStream.ref()
13660
+ }
13661
+
13662
+ unref () {
13663
+ this._heartbeat?.unref()
13664
+ this._timeout?.unref()
13665
+ if (this._rawStream?.unref) this._rawStream.unref()
13666
+ }
13667
+
13668
+ async _open () {
13669
+ if (this._rawStream === null) {
13670
+ await this._connect()
13671
+ }
13672
+ }
13673
+
13674
+ _setup () {
13675
+ this._stream = new FramedStream(this._rawStream)
13676
+
13677
+ this._rpc = new RPC((data) => { this._stream.write(data) })
13678
+ this._stream.on('data', (data) => { this._rpc.recv(data) })
13679
+ this._stream.on('end', () => { this._stream.end() })
13680
+ this._stream.on('error', this._onclose)
13681
+ this._stream.on('close', this._onclose)
13682
+
13683
+ this._register()
13684
+
13685
+ this._heartbeat = setInterval(() => {
13686
+ this._beat()
13687
+ }, constants.HEARTBEAT_INTERVAL)
13688
+ this._beat()
13689
+ }
13690
+
13691
+ async _beat () {
13692
+ try { await this._ping() } catch { /* ignore */ }
13693
+ }
13694
+
13695
+ _createSendMethod (method) {
13696
+ return (params = {}) => method.send(params)
13697
+ }
13698
+
13699
+ _createRequestMethod (method) {
13700
+ return (params = {}) => method.request(params)
13701
+ }
13702
+
13703
+ _createStreamMethod (method) {
13704
+ return (params = {}) => {
13705
+ const stream = method.createRequestStream()
13706
+ stream.on('end', () => { stream.end() })
13707
+ stream.write(params)
13708
+ return stream
13709
+ }
13710
+ }
13711
+
13712
+ _createMethod (definition) {
13713
+ if (definition.send) {
13714
+ return this._createSendMethod
13715
+ }
13716
+
13717
+ if (!definition.stream) {
13718
+ return this._createRequestMethod
13719
+ }
13720
+
13721
+ return this._createStreamMethod
13722
+ }
13723
+
13724
+ _register () {
13725
+ for (const { id, ...def } of this._methods) {
13726
+ if (constants.ILLEGAL_METHODS.has(def.name)) throw new Error('Illegal Method: ' + def.name)
13727
+ const api = this._api[def.name]?.bind(this._api) || this._createMethod(def)
13728
+
13729
+ this[def.name] = api(this._rpc.register(+id, {
13730
+ request: any,
13731
+ response: any
13732
+ }), this)
13733
+ }
13734
+ }
13735
+
13736
+ _pipe () {
13737
+ if (isBare) return new Pipe(this._socketPath)
13738
+ const sock = new Pipe.Socket()
13739
+ sock.setNoDelay(true)
13740
+ sock.connect(this._socketPath)
13741
+ return sock
13742
+ }
13743
+
13744
+ async _connect () {
13745
+ let trycount = 0
13746
+ let timedout = false
13747
+ let next = null
13748
+
13749
+ this._timeout = setTimeout(() => {
13750
+ timedout = true
13751
+ this.close()
13752
+ }, this._connectTimeout)
13753
+
13754
+ const onerror = () => {
13755
+ this._rawStream.removeListener('error', onerror)
13756
+ this._rawStream.removeListener('connect', onconnect)
13757
+ next(false)
13758
+ }
13759
+
13760
+ const onconnect = () => {
13761
+ this._rawStream.removeListener('error', onerror)
13762
+ this._rawStream.removeListener('connect', onconnect)
13763
+ clearTimeout(this._timeout)
13764
+ next(true)
13765
+ }
13766
+
13767
+ while (!this.closing) {
13768
+ const promise = new Promise((resolve) => { next = resolve })
13769
+ this._rawStream = this._pipe(this._socketPath)
13770
+ this._rawStream.on('connect', onconnect)
13771
+ this._rawStream.on('error', onerror)
13772
+
13773
+ if (await promise) break
13774
+ if (timedout) throw new Error('Could not connect in time')
13775
+ if (trycount++ === 0 && typeof this.#connect === 'function') this.#connect()
13776
+
13777
+ await new Promise((resolve) => setTimeout(resolve, trycount < 2 ? 5 : trycount < 10 ? 10 : 100))
13778
+ }
13779
+
13780
+ clearTimeout(this._timeout)
13781
+
13782
+ this._setup()
13783
+
13784
+ if (this.closing) {
13785
+ if (this._rawStream) this._rawStream.destroy()
13786
+ }
13787
+ }
13788
+
13789
+ _waitForClose () {
13790
+ return new Promise((resolve) => {
13791
+ if (this._stream.destroyed) {
13792
+ resolve()
13793
+ } else {
13794
+ this._stream.once('close', resolve)
13795
+ this._stream.end()
13796
+ }
13797
+ })
13798
+ }
13799
+
13800
+ async _close () { // never throws, must never throw
13801
+ clearInterval(this._heartbeat)
13802
+ clearTimeout(this._timeout)
13803
+
13804
+ if (this._stream) {
13805
+ await this._waitForClose()
13806
+ this._rawStream = null
13807
+ this._stream = null
13808
+ }
13809
+ this._rpc.destroy()
13810
+ }
13811
+ }
13812
+
13813
+ module.exports = PearIPCClient
13814
+ const { isWindows, isMac } = require('which-runtime')
13815
+ const path = require('path')
13816
+ const os = require('os')
13817
+
13818
+ const PEAR_DIR = global.Pear?.config.pearDir || (isMac
13819
+ ? path.join(os.homedir(), 'Library', 'Application Support', 'pear')
13820
+ : isWindows
13821
+ ? path.join(os.homedir(), 'AppData', 'Roaming', 'pear')
13822
+ : path.join(os.homedir(), '.config', 'pear'))
13823
+
13824
+ const CONNECT_TIMEOUT = 20_000
13825
+ const HEARTBEAT_INTERVAL = 1500
13826
+ const HEARBEAT_CLOCK = 5
13827
+ const ILLEGAL_METHODS = new Set(['id', 'userData', 'clients', 'hasClients', 'client', 'ref', 'unref', 'ready', 'opening', 'opened', 'close', 'closing', 'closed'])
13828
+
13829
+ module.exports = {
13830
+ PEAR_DIR,
13831
+ CONNECT_TIMEOUT,
13832
+ HEARTBEAT_INTERVAL,
13833
+ HEARBEAT_CLOCK,
13834
+ ILLEGAL_METHODS
13835
+ }
13836
+ 'use strict'
13837
+ const PearIPCServer = require('./server')
13838
+ const PearIPCClient = require('./client')
13839
+
13840
+ module.exports = { Server: PearIPCServer, Client: PearIPCClient }
12608
13841
  'use strict'
12609
- const { isBare, isWindows } = require('which-runtime')
12610
- const os = isBare ? require('bare-os') : require('os')
12611
- const fs = isBare ? require('bare-fs') : require('fs')
12612
- const path = isBare ? require('bare-path') : require('path')
12613
- const { pathToFileURL } = require('url-file-url')
12614
- const hypercoreid = require('hypercore-id-encoding')
12615
- const z32 = require('z32')
12616
- const crypto = require('hypercore-crypto')
12617
- const { PLATFORM_DIR, SWAP, RUNTIME } = require('pear-api/constants')
12618
- const CWD = isBare ? os.cwd() : process.cwd()
12619
- const ENV = isBare ? require('bare-env') : process.env
12620
- const parseLink = require('./parse-link')
12621
- const { ERR_INVALID_APP_NAME, ERR_INVALID_APP_STORAGE } = require('./errors')
12622
- const readPkg = (pkgPath) => {
12623
- let pkg = null
12624
- try { pkg = fs.readFileSync(path.resolve(pkgPath)) } catch { /* ignore */ }
12625
- if (pkg) pkg = JSON.parse(pkg) // important to know if this throws, so no try/catch
12626
- return pkg
12627
- }
13842
+ const methods = [
13843
+ { id: 0, name: 'info', stream: true },
13844
+ { id: 1, name: 'dump', stream: true },
13845
+ { id: 2, name: 'seed', stream: true },
13846
+ { id: 3, name: 'stage', stream: true },
13847
+ { id: 4, name: 'release', stream: true },
13848
+ { id: 5, name: 'messages', stream: true },
13849
+ { id: 6, name: 'message' },
13850
+ { id: 7, name: 'config' },
13851
+ { id: 8, name: 'checkpoint' },
13852
+ { id: 9, name: 'versions' },
13853
+ { id: 10, name: 'address' },
13854
+ { id: 11, name: 'detached' },
13855
+ { id: 12, name: 'permit' },
13856
+ { id: 13, name: 'identify' },
13857
+ { id: 14, name: 'wakeup' },
13858
+ { id: 15, name: 'warming', stream: true },
13859
+ { id: 16, name: 'warmup' },
13860
+ { id: 17, name: 'start' },
13861
+ { id: 18, name: 'restart' },
13862
+ { id: 19, name: 'unloading' },
13863
+ { id: 20, name: 'closeClients' },
13864
+ { id: 21, name: 'createReport' },
13865
+ { id: 22, name: 'reports', stream: true },
13866
+ { id: 23, name: 'shutdown', send: true },
13867
+ { id: 24, name: 'shift', stream: true },
13868
+ { id: 25, name: 'build', stream: true },
13869
+ { id: 26, name: 'gc', stream: true },
13870
+ { id: 27, name: 'clearIdentity' },
13871
+ { id: 28, name: 'shareIdentity' },
13872
+ { id: 29, name: 'requestIdentity' },
13873
+ { id: 30, name: 'trustIdentity' },
13874
+ { id: 31, name: 'encryptionKey', stream: true },
13875
+ { id: 32, name: 'trusted' },
13876
+ { id: 33, name: 'touch', stream: true },
13877
+ { id: 34, name: '_ping' },
13878
+ { id: 35, name: 'reset', stream: true },
13879
+ { id: 36, name: 'data', stream: true },
13880
+ { id: 37, name: 'get' },
13881
+ { id: 38, name: 'entry' },
13882
+ { id: 39, name: 'exists' },
13883
+ { id: 40, name: 'compare' },
13884
+ { id: 41, name: 'reported' }
13885
+ ]
12628
13886
 
12629
- module.exports = class State {
12630
- env = null
12631
- channel = null
12632
- args = null
12633
- checkpoint = null
12634
- #onupdate = null
12635
- runtime = RUNTIME
12636
- reloadingSince = 0
12637
- type = null
12638
- error = null
12639
- entrypoints = null
12640
- applink = null
12641
- dht = null
12642
- ui = null
12643
- static injestPackage (state, pkg, overrides = {}) {
12644
- state.manifest = pkg
12645
- state.main = pkg?.main || 'index.html'
12646
- state.options = pkg?.pear || null
12647
- state.name = pkg?.pear?.name || pkg?.name || null
12648
- state.links = pkg?.pear?.links || null
12649
- state.gui = pkg?.pear?.gui || null
12650
- if (overrides.links) {
12651
- const links = overrides.links.split(',').reduce((links, kv) => {
12652
- const [key, value] = kv.split('=')
12653
- links[key] = value
12654
- return links
12655
- }, {})
12656
- state.links = { ...(state.links || {}), ...links }
13887
+ module.exports = methods
13888
+ module.exports = require.addon()
13889
+ /* global Bare */
13890
+ const EventEmitter = require('bare-events')
13891
+ const { Duplex } = require('bare-stream')
13892
+ const binding = require('./binding')
13893
+ const constants = require('./lib/constants')
13894
+ const errors = require('./lib/errors')
13895
+
13896
+ const defaultReadBufferSize = 65536
13897
+
13898
+ const Pipe = module.exports = exports = class Pipe extends Duplex {
13899
+ constructor (path, opts = {}) {
13900
+ super({ eagerOpen: true })
13901
+
13902
+ if (typeof path === 'object' && path !== null) {
13903
+ opts = path
13904
+ path = null
12657
13905
  }
12658
- state.dependencies = [
12659
- ...(pkg?.dependencies ? Object.keys(pkg.dependencies) : []),
12660
- ...(pkg?.devDependencies ? Object.keys(pkg.devDependencies) : []),
12661
- ...(pkg?.peerDependencies ? Object.keys(pkg.peerDependencies) : []),
12662
- ...(pkg?.optionalDependencies ? Object.keys(pkg.optionalDependencies) : []),
12663
- ...(pkg?.bundleDependencies || []),
12664
- ...(pkg?.bundledDependencies || [])
12665
- ]
12666
- state.entrypoints = new Set(pkg?.pear?.stage?.entrypoints || [])
12667
- }
12668
13906
 
12669
- static storageFromLink (link) {
12670
- const parsedLink = typeof link === 'string' ? parseLink(link) : link
12671
- const appStorage = path.join(PLATFORM_DIR, 'app-storage')
12672
- return parsedLink.protocol !== 'pear:'
12673
- ? path.join(appStorage, 'by-random', crypto.randomBytes(16).toString('hex'))
12674
- : path.join(appStorage, 'by-dkey', crypto.discoveryKey(hypercoreid.decode(parsedLink.drive.key)).toString('hex'))
12675
- }
13907
+ const {
13908
+ readBufferSize = defaultReadBufferSize,
13909
+ allowHalfOpen = true
13910
+ } = opts
12676
13911
 
12677
- static configFrom (state) {
12678
- const { id, startId, key, links, alias, env, gui, options, checkpoint, checkout, flags, dev, tier, stage, storage, name, main, dependencies, args, channel, release, applink, fragment, link, linkData, entrypoint, dir, dht } = state
12679
- const pearDir = PLATFORM_DIR
12680
- const swapDir = SWAP
12681
- return { id, startId, key, links, alias, env, gui, options, checkpoint, checkout, flags, dev, tier, stage, storage, name, main, dependencies, args, channel, release, applink, fragment, link, linkData, entrypoint, dir, dht, pearDir, swapDir }
13912
+ this._state = 0
13913
+
13914
+ this._allowHalfOpen = allowHalfOpen
13915
+
13916
+ this._fd = -1
13917
+ this._path = null
13918
+
13919
+ this._pendingOpen = null
13920
+ this._pendingWrite = null
13921
+ this._pendingFinal = null
13922
+ this._pendingDestroy = null
13923
+
13924
+ this._buffer = Buffer.alloc(readBufferSize)
13925
+
13926
+ this._handle = binding.init(this._buffer, this,
13927
+ noop,
13928
+ this._onconnect,
13929
+ this._onwrite,
13930
+ this._onfinal,
13931
+ this._onread,
13932
+ this._onclose
13933
+ )
13934
+
13935
+ if (typeof path === 'number') {
13936
+ this.open(path)
13937
+ } else if (typeof path === 'string') {
13938
+ this.connect(path)
13939
+ }
13940
+
13941
+ Pipe._pipes.add(this)
12682
13942
  }
12683
13943
 
12684
- static isKeetInvite (segment) {
12685
- if (!segment || segment.length < 100) return false
12686
- try { z32.decode(segment) } catch { return false }
12687
- return true
13944
+ get connecting () {
13945
+ return (this._state & constants.state.CONNECTING) !== 0
12688
13946
  }
12689
13947
 
12690
- static isEntrypoint (pathname) {
12691
- if (pathname === null || pathname === '/') return false
12692
- // NOTE: return true once keet invite code detection is no longer needed, assess for removal October 2024
12693
- const segment = pathname = pathname?.startsWith('/') ? pathname.slice(1) : pathname
12694
- return this.isKeetInvite(segment) === false
13948
+ get pending () {
13949
+ return (this._state & constants.state.CONNECTED) === 0
12695
13950
  }
12696
13951
 
12697
- update (state) {
12698
- Object.assign(this, state)
12699
- this.#onupdate()
13952
+ get readyState () {
13953
+ if (this._state & constants.state.READABLE && this._state & constants.state.WRITABLE) {
13954
+ return 'open'
13955
+ }
13956
+
13957
+ if (this._state & constants.state.READABLE) {
13958
+ return 'readOnly'
13959
+ }
13960
+
13961
+ if (this._state & constants.state.WRITABLE) {
13962
+ return 'writeOnly'
13963
+ }
13964
+
13965
+ return 'opening'
12700
13966
  }
12701
13967
 
12702
- constructor (params = {}) {
12703
- const { dht, link, id = null, args = null, env = ENV, cwd = CWD, dir = cwd, cmdArgs, onupdate = () => {}, flags, run, storage = null } = params
12704
- const {
12705
- startId, appling, channel, devtools, checkout, links,
12706
- dev = false, stage, updates, updatesDiff, followSymlinks,
12707
- unsafeClearAppStorage, chromeWebrtcInternals
12708
- } = flags
12709
- const { drive: { alias = null, key = null }, pathname: route, protocol, hash } = link ? parseLink(link) : { drive: {} }
12710
- const pathname = protocol === 'file:' ? (isWindows ? route.slice(1).slice(dir.length) : route.slice(dir.length)) : route
12711
- const segment = pathname?.startsWith('/') ? pathname.slice(1) : pathname
12712
- const fragment = hash ? hash.slice(1) : (this.constructor.isKeetInvite(segment) ? segment : null)
12713
- const entrypoint = this.constructor.isEntrypoint(pathname) ? pathname : null
12714
- const pkgPath = path.join(dir, 'package.json')
12715
- const pkg = key === null ? readPkg(pkgPath) : null
12716
- const store = flags.tmpStore ? path.join(os.tmpdir(), crypto.randomBytes(16).toString('hex')) : flags.store
12717
- this.#onupdate = onupdate
12718
- this.startId = startId || null
12719
- this.dht = dht
12720
- this.store = store
12721
- this.args = args
12722
- this.appling = appling
12723
- this.channel = channel || null
12724
- this.checkout = checkout
12725
- this.dir = dir
12726
- this.cwd = cwd
12727
- this.run = run ?? flags.run
12728
- this.storage = storage
12729
- this.flags = flags
12730
- this.dev = dev
12731
- this.devtools = this.dev || devtools
12732
- this.updatesDiff = this.dev || updatesDiff
12733
- this.updates = updates
12734
- this.stage = stage
12735
- this.fragment = fragment
12736
- this.entrypoint = entrypoint
12737
- this.linkData = segment
12738
- this.link = link ? (link.startsWith(protocol) ? link : pathToFileURL(link).toString()) : null
12739
- this.key = key
12740
- this.applink = key ? this.link.slice(0, -(~~(pathname?.length) + ~~(hash?.length))) : null
12741
- this.alias = alias
12742
- this.manifest = pkg
12743
- this.cmdArgs = cmdArgs
12744
- this.pkgPath = pkgPath
12745
- this.id = id
12746
- this.followSymlinks = followSymlinks
12747
- this.rti = flags.rti ? JSON.parse(flags.rti) : null // important to know if this throws, so no try/catch
12748
- this.clearAppStorage = unsafeClearAppStorage
12749
- this.chromeWebrtcInternals = chromeWebrtcInternals
12750
- this.env = { ...env }
12751
- if (this.stage || (this.run && this.dev === false)) {
12752
- this.env.NODE_ENV = this.env.NODE_ENV || 'production'
13968
+ open (fd, opts = {}, onconnect) {
13969
+ if (typeof opts === 'function') {
13970
+ onconnect = opts
13971
+ opts = {}
12753
13972
  }
12754
- this.constructor.injestPackage(this, pkg, { links })
12755
- const invalidStorage = this.key === null && this.storage !== null && this.storage.startsWith(this.dir) && this.storage.includes('/pear/pear/') === false
12756
- if (invalidStorage) throw ERR_INVALID_APP_STORAGE('Application Storage may not be inside the project directory. --store "' + this.storage + '" is invalid')
12757
- const invalidName = /^[@/a-z0-9-_]+$/.test(this.name) === false
12758
- if (invalidName) throw ERR_INVALID_APP_NAME('The package.json name / pear.name field must be lowercase and one word, and may contain letters, numbers, hyphens (-), underscores (_), forward slashes (/) and asperands (@).')
13973
+
13974
+ if (typeof fd === 'object' && fd !== null) {
13975
+ opts = fd || {}
13976
+ fd = opts.fd
13977
+ }
13978
+
13979
+ try {
13980
+ const status = binding.open(this._handle, fd)
13981
+
13982
+ this._state |= constants.state.CONNECTED
13983
+ this._fd = fd
13984
+
13985
+ if (status & binding.READABLE) {
13986
+ this._state |= constants.state.READABLE
13987
+ } else {
13988
+ this.push(null)
13989
+ }
13990
+
13991
+ if (status & binding.WRITABLE) {
13992
+ this._state |= constants.state.WRITABLE
13993
+ } else {
13994
+ this.end()
13995
+ }
13996
+
13997
+ if (onconnect) this.once('connect', onconnect)
13998
+
13999
+ queueMicrotask(() => this.emit('connect'))
14000
+ } catch (err) {
14001
+ queueMicrotask(() => {
14002
+ if (this._pendingOpen) this._pendingOpen(err)
14003
+ else this.destroy(err)
14004
+ })
14005
+ }
14006
+
14007
+ return this
12759
14008
  }
12760
- }
12761
- /* global Bare */
12762
- const Signal = require('bare-signals')
12763
- const safetyCatch = require('safety-catch')
12764
14009
 
12765
- const handlers = []
14010
+ connect (path, opts = {}, onconnect) {
14011
+ if (this._state & constants.state.CONNECTING || this._state & constants.state.CONNECTED) {
14012
+ throw errors.PIPE_ALREADY_CONNECTED('Pipe is already connected')
14013
+ }
14014
+
14015
+ this._state |= constants.state.CONNECTING
14016
+
14017
+ if (typeof opts === 'function') {
14018
+ onconnect = opts
14019
+ opts = {}
14020
+ }
12766
14021
 
12767
- let exiting = false
14022
+ if (typeof path === 'object' && path !== null) {
14023
+ opts = path || {}
14024
+ path = opts.path
14025
+ }
12768
14026
 
12769
- const sigint = new Signal('SIGINT')
12770
- const sigterm = new Signal('SIGTERM')
14027
+ try {
14028
+ binding.connect(this._handle, path)
12771
14029
 
12772
- sigint
12773
- .on('signal', (signum) => {
12774
- sigint.stop()
12775
- sigint.unref()
12776
- Bare.exitCode = 130
12777
- onexit(() => { Signal.send(signum, Bare.pid) })
12778
- })
14030
+ this._path = path
12779
14031
 
12780
- sigterm
12781
- .on('signal', (signum) => {
12782
- sigterm.stop()
12783
- sigterm.unref()
12784
- Bare.exitCode = 143
12785
- onexit(() => { Signal.send(signum, Bare.pid) })
12786
- })
14032
+ if (onconnect) this.once('connect', onconnect)
14033
+ } catch (err) {
14034
+ queueMicrotask(() => {
14035
+ if (this._pendingOpen) this._pendingOpen(err)
14036
+ else this.destroy(err)
14037
+ })
14038
+ }
12787
14039
 
12788
- function onexit (ondone) {
12789
- if (exiting) return
12790
- exiting = true
14040
+ return this
14041
+ }
12791
14042
 
12792
- Bare.removeListener('beforeExit', onexit)
14043
+ ref () {
14044
+ binding.ref(this._handle)
14045
+ }
12793
14046
 
12794
- const order = []
14047
+ unref () {
14048
+ binding.unref(this._handle)
14049
+ }
12795
14050
 
12796
- for (const h of handlers.sort((a, b) => b.position - a.position)) {
12797
- if (!order.length || order[order.length - 1][0].position !== h.position) order.push([])
12798
- order[order.length - 1].push(h)
14051
+ _open (cb) {
14052
+ if (this._state & constants.state.CONNECTED) return cb(null)
14053
+ this._pendingOpen = cb
12799
14054
  }
12800
14055
 
12801
- const loopdown = loop()
14056
+ _read () {
14057
+ if ((this._state & constants.state.READING) === 0) {
14058
+ this._state |= constants.state.READING
14059
+ binding.resume(this._handle)
14060
+ }
14061
+ }
12802
14062
 
12803
- if (ondone) loopdown.finally(ondone)
14063
+ _writev (batch, cb) {
14064
+ this._pendingWrite = [cb, batch]
14065
+ binding.writev(this._handle, batch.map(({ chunk }) => chunk))
14066
+ }
12804
14067
 
12805
- function loop () {
12806
- if (!order.length) return
12807
- return Promise.allSettled(order.pop().map(run)).then(loop, loop)
14068
+ _final (cb) {
14069
+ if (this._state & constants.state.READABLE && this._state & constants.state.WRITABLE) {
14070
+ this._pendingFinal = cb
14071
+ binding.end(this._handle)
14072
+ } else {
14073
+ cb(null)
14074
+ }
12808
14075
  }
12809
- }
12810
14076
 
12811
- async function run (h) {
12812
- try {
12813
- await h.fn()
12814
- } catch (e) {
12815
- safetyCatch(e)
14077
+ _predestroy () {
14078
+ if (this._state & constants.state.CLOSING) return
14079
+ this._state |= constants.state.CLOSING
14080
+ binding.close(this._handle)
14081
+ Pipe._pipes.delete(this)
12816
14082
  }
12817
- }
12818
14083
 
12819
- function setup () {
12820
- Bare.prependListener('beforeExit', onexit)
12821
- sigint.start()
12822
- sigterm.start()
14084
+ _destroy (err, cb) {
14085
+ if (this._state & constants.state.CLOSING) return cb(err)
14086
+ this._state |= constants.state.CLOSING
14087
+ this._pendingDestroy = cb
14088
+ binding.close(this._handle)
14089
+ Pipe._pipes.delete(this)
14090
+ }
12823
14091
 
12824
- sigint.unref()
12825
- sigterm.unref()
12826
- }
14092
+ _continueOpen (err) {
14093
+ if (this._pendingOpen === null) return
14094
+ const cb = this._pendingOpen
14095
+ this._pendingOpen = null
14096
+ cb(err)
14097
+ }
12827
14098
 
12828
- function cleanup () {
12829
- Bare.removeListener('beforeExit', onexit)
12830
- sigint.close()
12831
- sigterm.close()
12832
- }
14099
+ _continueWrite (err) {
14100
+ if (this._pendingWrite === null) return
14101
+ const cb = this._pendingWrite[0]
14102
+ this._pendingWrite = null
14103
+ cb(err)
14104
+ }
12833
14105
 
12834
- function teardown (fn, position = 0) {
12835
- if (handlers.length === 0) setup()
12836
- const handler = { position, fn }
12837
- handlers.push(handler)
14106
+ _continueFinal (err) {
14107
+ if (this._pendingFinal === null) return
14108
+ const cb = this._pendingFinal
14109
+ this._pendingFinal = null
14110
+ cb(err)
14111
+ }
12838
14112
 
12839
- return function unregister () {
12840
- const i = handlers.indexOf(handler)
12841
- if (i > -1) handlers.splice(i, 1)
12842
- if (!handlers.length) cleanup()
14113
+ _continueDestroy () {
14114
+ if (this._pendingDestroy === null) return
14115
+ const cb = this._pendingDestroy
14116
+ this._pendingDestroy = null
14117
+ cb(null)
12843
14118
  }
12844
- }
12845
14119
 
12846
- module.exports = teardown
12847
- 'use strict'
12848
- const { spawn } = require('child_process')
12849
- const { RUNTIME, PLATFORM_DIR } = require('./constants')
12850
- const pear = require('./cmd')
14120
+ _onconnect (err) {
14121
+ if (err) {
14122
+ if (this._pendingOpen) this._continueOpen(err)
14123
+ else this.destroy(err)
14124
+ return
14125
+ }
12851
14126
 
12852
- module.exports = function tryboot () {
12853
- const { argv } = global.Bare || global.process
12854
- const { flags = {} } = pear(argv.slice(1)) ?? {}
12855
- const args = ['--sidecar']
12856
- const dhtBootstrap = argv.includes('--dht-bootstrap') ? argv[argv.indexOf('--dht-bootstrap') + 1] : null
12857
- if (dhtBootstrap) {
12858
- args.push('--dht-bootstrap')
12859
- args.push(dhtBootstrap)
14127
+ this._state |= constants.state.CONNECTED | constants.state.READABLE | constants.state.WRITABLE
14128
+ this._state &= ~constants.state.CONNECTING
14129
+ this._continueOpen()
14130
+
14131
+ this.emit('connect')
12860
14132
  }
12861
- let detached = true
12862
- if (flags.log) {
12863
- args.push('--log')
12864
- detached = false
12865
- } else {
12866
- const { length } = args
12867
- if (flags.logLevel) args.push('--log-level', flags.logLevel)
12868
- if (flags.logFields) args.push('--log-fields', flags.logFields)
12869
- if (flags.logLabels) args.push('--log-labels', flags.logLabels)
12870
- if (args.length > length) detached = false
14133
+
14134
+ _onread (err, read) {
14135
+ if (err) {
14136
+ this.destroy(err)
14137
+ return
14138
+ }
14139
+
14140
+ if (read === 0) {
14141
+ this.push(null)
14142
+ if (this._allowHalfOpen === false) this.end()
14143
+ return
14144
+ }
14145
+
14146
+ const copy = Buffer.allocUnsafe(read)
14147
+ copy.set(this._buffer.subarray(0, read))
14148
+
14149
+ if (this.push(copy) === false && this.destroying === false) {
14150
+ this._state &= ~constants.state.READING
14151
+ binding.pause(this._handle)
14152
+ }
12871
14153
  }
12872
- if (flags.logStacks) args.push('--log-stacks')
12873
- const sc = spawn(RUNTIME, args, { detached, stdio: detached ? 'ignore' : 'inherit', cwd: PLATFORM_DIR })
12874
- sc.unref()
12875
- }
12876
- 'use strict'
12877
- const fs = require('fs')
12878
- const { spawn } = require('child_process')
12879
- const { isWindows, isBare } = require('which-runtime')
12880
- const { command } = require('paparam')
12881
- const Pipe = isBare
12882
- ? require('bare-pipe')
12883
- : class Pipe extends require('net').Socket { constructor (fd) { super({ fd }) } }
12884
- const teardown = isBare ? require('./teardown') : (fn) => fn()
12885
- const { RUNTIME } = require('./constants')
12886
- const rundef = require('./cmd/run')
12887
- const noop = Function.prototype
12888
14154
 
12889
- class Worker {
12890
- #pipe = null
12891
- #ref = null
12892
- #unref = null
12893
- static RUNTIME = RUNTIME
12894
- constructor ({ ref = noop, unref = noop } = {}) {
12895
- this.#ref = ref
12896
- this.#unref = unref
14155
+ _onwrite (err) {
14156
+ this._continueWrite(err)
12897
14157
  }
12898
14158
 
12899
- #args (link) {
12900
- const parser = command('pear', command('run', ...rundef))
12901
- const argv = ['run', '--trusted', ...global.Bare.argv.slice(2)]
12902
- const cmd = parser.parse(argv, { sync: true })
12903
- const args = argv.map((arg) => arg === cmd.args.link ? link : arg)
12904
- if (cmd.indices.rest > 0) args.splice(cmd.indices.rest)
12905
- let linksIndex = cmd.indices.flags.links
12906
- const linksElements = linksIndex > 0 ? (cmd.flags.links === args[linksIndex]) ? 2 : 1 : 0
12907
- if (cmd.indices.flags.startId > 0) {
12908
- args.splice(cmd.indices.flags.startId, 1)
12909
- if (linksIndex > cmd.indices.flags.startId) linksIndex -= linksElements
12910
- }
12911
- if (linksIndex > 0) args.splice(linksIndex, linksElements)
12912
- return args
14159
+ _onfinal (err) {
14160
+ this._continueFinal(err)
12913
14161
  }
12914
14162
 
12915
- run (link, args = []) {
12916
- args = [...this.#args(link), ...args]
12917
- const sp = spawn(this.constructor.RUNTIME, args, {
12918
- stdio: ['inherit', 'inherit', 'inherit', 'overlapped'],
12919
- windowsHide: true
12920
- })
12921
- this.#ref()
12922
- sp.once('exit', (exitCode) => {
12923
- if (exitCode !== 0) pipe.emit('crash', { exitCode })
12924
- this.#unref()
12925
- })
12926
- const pipe = sp.stdio[3]
12927
- pipe.on('end', () => pipe.end())
12928
- return pipe
14163
+ _onclose () {
14164
+ this._handle = null
14165
+ this._continueDestroy()
12929
14166
  }
12930
14167
 
12931
- pipe () {
12932
- if (this.#pipe) return this.#pipe
12933
- const fd = 3
12934
- try {
12935
- const isWorker = isWindows ? fs.fstatSync(fd).isFIFO() : fs.fstatSync(fd).isSocket()
12936
- if (isWorker === false) return null
12937
- } catch {
12938
- return null
14168
+ _onspawn (readable, writable) {
14169
+ this._state |= constants.state.CONNECTED
14170
+
14171
+ if (readable) {
14172
+ this._state |= constants.state.READABLE
14173
+ } else {
14174
+ this.push(null)
14175
+ }
14176
+
14177
+ if (writable) {
14178
+ this._state |= constants.state.WRITABLE
14179
+ } else {
14180
+ this.end()
12939
14181
  }
12940
- const pipe = new Pipe(fd)
12941
- pipe.on('end', () => {
12942
- teardown(() => pipe.end(), Number.MAX_SAFE_INTEGER)
12943
- })
12944
- this.#pipe = pipe
12945
- pipe.once('close', () => {
12946
- teardown(() => global.Bare.exit(), Number.MAX_SAFE_INTEGER)
12947
- })
12948
- return pipe
14182
+
14183
+ this._continueOpen()
12949
14184
  }
14185
+
14186
+ static _pipes = new Set()
12950
14187
  }
12951
14188
 
12952
- module.exports = Worker
12953
- 'use strict'
12954
- const fs = require('fs')
12955
- const fsext = require('fs-native-extensions')
14189
+ exports.Pipe = exports
12956
14190
 
12957
- class Internal {
12958
- _pinging = true
12959
- _ping (method) { return () => this._pinging && method.request({ beat: 'ping' }) }
14191
+ exports.pipe = function pipe () {
14192
+ return binding.pipe()
12960
14193
  }
12961
14194
 
12962
- class API extends Internal {
12963
- #ipc = null
14195
+ const Server = exports.Server = class PipeServer extends EventEmitter {
14196
+ constructor (opts = {}, onconnection) {
14197
+ if (typeof opts === 'function') {
14198
+ onconnection = opts
14199
+ opts = {}
14200
+ }
12964
14201
 
12965
- constructor (ipc) {
12966
14202
  super()
12967
- this.#ipc = ipc
14203
+
14204
+ const {
14205
+ readBufferSize = defaultReadBufferSize,
14206
+ allowHalfOpen = true
14207
+ } = opts
14208
+
14209
+ this._state = 0
14210
+
14211
+ this._readBufferSize = readBufferSize
14212
+ this._allowHalfOpen = allowHalfOpen
14213
+
14214
+ this._path = null
14215
+ this._connections = new Set()
14216
+
14217
+ this._error = null
14218
+ this._handle = null
14219
+
14220
+ if (onconnection) this.on('connection', onconnection)
14221
+
14222
+ PipeServer._servers.add(this)
12968
14223
  }
12969
14224
 
12970
- wakeup (method) {
12971
- return (link, storage, appdev) => method.request({ args: [link, storage, appdev] })
14225
+ get listening () {
14226
+ return (this._state & constants.state.BOUND) !== 0
12972
14227
  }
12973
14228
 
12974
- shutdown (method) {
12975
- return async () => {
12976
- if (this.#ipc.closed || this.#ipc.closing) return
12977
- this._pinging = false
12978
- method.send()
12979
- const fd = await new Promise((resolve, reject) => fs.open(this.#ipc._lock, 'r+', (err, fd) => {
12980
- if (err) {
12981
- reject(err)
12982
- return
12983
- }
12984
- resolve(fd)
12985
- }))
12986
- await fsext.waitForLock(fd)
12987
- fsext.unlock(fd)
12988
- await new Promise((resolve, reject) => fs.close(fd, (err) => {
12989
- if (err) {
12990
- reject(err)
12991
- return
12992
- }
12993
- resolve()
12994
- }))
12995
- await this.#ipc.close()
14229
+ address () {
14230
+ if ((this._state & constants.state.BOUND) === 0) {
14231
+ return null
12996
14232
  }
14233
+
14234
+ return this._path
12997
14235
  }
12998
- }
12999
14236
 
13000
- module.exports = API
13001
- 'use strict'
13002
- const { isBare } = require('which-runtime')
13003
- const Pipe = require('net') // import mapped to bare-pipe, less resolves
13004
- const path = require('path')
13005
- const RPC = require('tiny-buffer-rpc')
13006
- const any = require('tiny-buffer-rpc/any')
13007
- const ReadyResource = require('ready-resource')
13008
- const FramedStream = require('framed-stream')
14237
+ listen (path, backlog = 511, opts = {}, onlistening) {
14238
+ if (this._state & constants.state.BINDING || this._state & constants.state.BOUND) {
14239
+ throw errors.SERVER_ALREADY_LISTENING('Server is already listening')
14240
+ }
13009
14241
 
13010
- const API = require('./api')
13011
- const methods = require('./methods')
13012
- const constants = require('./constants')
14242
+ if (this._state & constants.state.CLOSING) {
14243
+ throw errors.SERVER_IS_CLOSED('Server is closed')
14244
+ }
13013
14245
 
13014
- class PearIPCClient extends ReadyResource {
13015
- #connect = null
13016
- constructor (opts = {}) {
13017
- super()
13018
- this._opts = opts
13019
- this._socketPath = opts.socketPath
13020
- this._methods = opts.methods ? [...methods, ...opts.methods] : methods
13021
- this._lock = opts.lock || path.join(constants.PEAR_DIR, 'corestores', 'platform', 'primary-key')
13022
- const api = new API(this)
13023
- if (opts.api) Object.assign(api, opts.api)
13024
- this._api = api
13025
- this._connectTimeout = opts.connectTimeout || constants.CONNECT_TIMEOUT
13026
- this.#connect = opts.connect || null
13027
- this._rpc = null
13028
- this._internalHandlers = null
14246
+ this._state |= constants.state.BINDING
13029
14247
 
13030
- this._rawStream = opts.stream || null
13031
- this._stream = null
14248
+ if (typeof backlog === 'function') {
14249
+ onlistening = backlog
14250
+ backlog = 511
14251
+ } else if (typeof opts === 'function') {
14252
+ onlistening = opts
14253
+ opts = {}
14254
+ }
13032
14255
 
13033
- this.userData = opts.userData || null
14256
+ if (typeof path === 'object' && path !== null) {
14257
+ opts = path || {}
14258
+ path = opts.path
14259
+ backlog = opts.backlog || 511
14260
+ }
13034
14261
 
13035
- this._onclose = this.close.bind(this)
14262
+ this._handle = binding.init(empty, this,
14263
+ this._onconnection,
14264
+ noop,
14265
+ noop,
14266
+ noop,
14267
+ noop,
14268
+ this._onclose
14269
+ )
14270
+
14271
+ if (this._state & constants.state.UNREFED) binding.unref(this._handle)
14272
+
14273
+ try {
14274
+ binding.bind(this._handle, path, backlog)
14275
+
14276
+ this._path = path
14277
+ this._state |= constants.state.BOUND
14278
+ this._state &= ~constants.state.BINDING
14279
+
14280
+ if (onlistening) this.once('listening', onlistening)
14281
+
14282
+ queueMicrotask(() => this.emit('listening'))
14283
+ } catch (err) {
14284
+ this._error = err
14285
+
14286
+ binding.close(this._handle)
14287
+ }
14288
+
14289
+ return this
14290
+ }
14291
+
14292
+ close (onclose) {
14293
+ if (onclose) this.once('close', onclose)
14294
+ if (this._state & constants.state.CLOSING) return
14295
+ this._state |= constants.state.CLOSING
14296
+ this._closeMaybe()
13036
14297
  }
13037
14298
 
13038
14299
  ref () {
13039
- this._heartbeat?.ref()
13040
- this._timeout?.ref()
13041
- if (this._rawStream?.ref) this._rawStream.ref()
14300
+ this._state &= ~constants.state.UNREFED
14301
+ if (this._handle !== null) binding.ref(this._handle)
13042
14302
  }
13043
14303
 
13044
14304
  unref () {
13045
- this._heartbeat?.unref()
13046
- this._timeout?.unref()
13047
- if (this._rawStream?.unref) this._rawStream.unref()
14305
+ this._state |= constants.state.UNREFED
14306
+ if (this._handle !== null) binding.unref(this._handle)
13048
14307
  }
13049
14308
 
13050
- async _open () {
13051
- if (this._rawStream === null) {
13052
- await this._connect()
14309
+ _closeMaybe () {
14310
+ if ((this._state & constants.state.CLOSING) && this._connections.size === 0) {
14311
+ if (this._handle !== null) binding.close(this._handle)
14312
+ else queueMicrotask(() => this.emit('close'))
14313
+ PipeServer._servers.delete(this)
13053
14314
  }
13054
14315
  }
13055
14316
 
13056
- _setup () {
13057
- this._stream = new FramedStream(this._rawStream)
14317
+ _onconnection (err) {
14318
+ if (err) {
14319
+ this.emit('error', err)
14320
+ return
14321
+ }
13058
14322
 
13059
- this._rpc = new RPC((data) => { this._stream.write(data) })
13060
- this._stream.on('data', (data) => { this._rpc.recv(data) })
13061
- this._stream.on('end', () => { this._stream.end() })
13062
- this._stream.on('error', this._onclose)
13063
- this._stream.on('close', this._onclose)
14323
+ if (this._state & constants.state.CLOSING) return
13064
14324
 
13065
- this._register()
14325
+ const pipe = new Pipe({
14326
+ readBufferSize: this._readBufferSize,
14327
+ allowHalfOpen: this._allowHalfOpen
14328
+ })
13066
14329
 
13067
- this._heartbeat = setInterval(() => {
13068
- this._beat()
13069
- }, constants.HEARTBEAT_INTERVAL)
13070
- this._beat()
13071
- }
14330
+ try {
14331
+ binding.accept(this._handle, pipe._handle)
13072
14332
 
13073
- async _beat () {
13074
- try { await this._ping() } catch { /* ignore */ }
13075
- }
14333
+ pipe._path = this._path
14334
+ pipe._state |= constants.state.CONNECTED | constants.state.READABLE | constants.state.WRITABLE
13076
14335
 
13077
- _createSendMethod (method) {
13078
- return (params = {}) => method.send(params)
13079
- }
14336
+ this._connections.add(pipe)
13080
14337
 
13081
- _createRequestMethod (method) {
13082
- return (params = {}) => method.request(params)
13083
- }
14338
+ pipe.on('close', () => {
14339
+ this._connections.delete(pipe)
14340
+ this._closeMaybe()
14341
+ })
13084
14342
 
13085
- _createStreamMethod (method) {
13086
- return (params = {}) => {
13087
- const stream = method.createRequestStream()
13088
- stream.on('end', () => { stream.end() })
13089
- stream.write(params)
13090
- return stream
14343
+ this.emit('connection', pipe)
14344
+ } catch (err) {
14345
+ pipe.destroy()
14346
+
14347
+ throw err
13091
14348
  }
13092
14349
  }
13093
14350
 
13094
- _createMethod (definition) {
13095
- if (definition.send) {
13096
- return this._createSendMethod
13097
- }
14351
+ _onclose () {
14352
+ const err = this._error
13098
14353
 
13099
- if (!definition.stream) {
13100
- return this._createRequestMethod
13101
- }
14354
+ this._state &= ~constants.state.BINDING
14355
+ this._error = null
14356
+ this._handle = null
13102
14357
 
13103
- return this._createStreamMethod
14358
+ if (err) this.emit('error', err)
14359
+ else this.emit('close')
13104
14360
  }
13105
14361
 
13106
- _register () {
13107
- for (const { id, ...def } of this._methods) {
13108
- if (constants.ILLEGAL_METHODS.has(def.name)) throw new Error('Illegal Method: ' + def.name)
13109
- const api = this._api[def.name]?.bind(this._api) || this._createMethod(def)
14362
+ static _servers = new Set()
14363
+ }
13110
14364
 
13111
- this[def.name] = api(this._rpc.register(+id, {
13112
- request: any,
13113
- response: any
13114
- }), this)
13115
- }
14365
+ exports.constants = constants
14366
+ exports.errors = errors
14367
+
14368
+ exports.createConnection = function createConnection (path, opts, onconnect) {
14369
+ if (typeof opts === 'function') {
14370
+ onconnect = opts
14371
+ opts = {}
13116
14372
  }
13117
14373
 
13118
- _pipe () {
13119
- if (isBare) return new Pipe(this._socketPath)
13120
- const sock = new Pipe.Socket()
13121
- sock.setNoDelay(true)
13122
- sock.connect(this._socketPath)
13123
- return sock
14374
+ if (typeof path === 'object' && path !== null) {
14375
+ opts = path || {}
14376
+ path = opts.path
13124
14377
  }
13125
14378
 
13126
- async _connect () {
13127
- let trycount = 0
13128
- let timedout = false
13129
- let next = null
14379
+ return new Pipe(opts).connect(path, opts, onconnect)
14380
+ }
13130
14381
 
13131
- this._timeout = setTimeout(() => {
13132
- timedout = true
13133
- this.close()
13134
- }, this._connectTimeout)
14382
+ exports.createServer = function createServer (opts, onconnection) {
14383
+ return new Server(opts, onconnection)
14384
+ }
13135
14385
 
13136
- const onerror = () => {
13137
- this._rawStream.removeListener('error', onerror)
13138
- this._rawStream.removeListener('connect', onconnect)
13139
- next(false)
14386
+ Bare
14387
+ .on('exit', () => {
14388
+ for (const pipe of Pipe._pipes) {
14389
+ pipe.destroy()
13140
14390
  }
13141
14391
 
13142
- const onconnect = () => {
13143
- this._rawStream.removeListener('error', onerror)
13144
- this._rawStream.removeListener('connect', onconnect)
13145
- clearTimeout(this._timeout)
13146
- next(true)
14392
+ for (const server of Server._servers) {
14393
+ server.close()
13147
14394
  }
14395
+ })
13148
14396
 
13149
- while (!this.closing) {
13150
- const promise = new Promise((resolve) => { next = resolve })
13151
- this._rawStream = this._pipe(this._socketPath)
13152
- this._rawStream.on('connect', onconnect)
13153
- this._rawStream.on('error', onerror)
14397
+ const empty = Buffer.alloc(0)
13154
14398
 
13155
- if (await promise) break
13156
- if (timedout) throw new Error('Could not connect in time')
13157
- if (trycount++ === 0 && typeof this.#connect === 'function') this.#connect()
14399
+ function noop () {}
14400
+ module.exports = {
14401
+ state: {
14402
+ CONNECTING: 0x1,
14403
+ CONNECTED: 0x2,
14404
+ BINDING: 0x4,
14405
+ BOUND: 0x8,
14406
+ READING: 0x10,
14407
+ CLOSING: 0x20,
14408
+ READABLE: 0x40,
14409
+ WRITABLE: 0x80
14410
+ }
14411
+ }
14412
+ module.exports = class PipeError extends Error {
14413
+ constructor (msg, code, fn = PipeError) {
14414
+ super(`${code}: ${msg}`)
14415
+ this.code = code
13158
14416
 
13159
- await new Promise((resolve) => setTimeout(resolve, trycount < 2 ? 5 : trycount < 10 ? 10 : 100))
14417
+ if (Error.captureStackTrace) {
14418
+ Error.captureStackTrace(this, fn)
13160
14419
  }
14420
+ }
13161
14421
 
13162
- clearTimeout(this._timeout)
13163
-
13164
- this._setup()
13165
-
13166
- if (this.closing) {
13167
- if (this._rawStream) this._rawStream.destroy()
13168
- }
14422
+ get name () {
14423
+ return 'PipeError'
13169
14424
  }
13170
14425
 
13171
- _waitForClose () {
13172
- return new Promise((resolve) => {
13173
- if (this._stream.destroyed) {
13174
- resolve()
13175
- } else {
13176
- this._stream.once('close', resolve)
13177
- this._stream.end()
13178
- }
13179
- })
14426
+ static PIPE_ALREADY_CONNECTED (msg) {
14427
+ return new PipeError(msg, 'PIPE_ALREADY_CONNECTED', PipeError.PIPE_ALREADY_CONNECTED)
13180
14428
  }
13181
14429
 
13182
- async _close () { // never throws, must never throw
13183
- clearInterval(this._heartbeat)
13184
- clearTimeout(this._timeout)
14430
+ static SERVER_ALREADY_LISTENING (msg) {
14431
+ return new PipeError(msg, 'SERVER_ALREADY_LISTENING', PipeError.SERVER_ALREADY_LISTENING)
14432
+ }
13185
14433
 
13186
- if (this._stream) {
13187
- await this._waitForClose()
13188
- this._rawStream = null
13189
- this._stream = null
13190
- }
13191
- this._rpc.destroy()
14434
+ static SERVER_IS_CLOSED (msg) {
14435
+ return new PipeError(msg, 'SERVER_IS_CLOSED', PipeError.SERVER_IS_CLOSED)
13192
14436
  }
13193
14437
  }
13194
-
13195
- module.exports = PearIPCClient
13196
- const { isWindows, isMac } = require('which-runtime')
13197
- const path = require('path')
13198
- const os = require('os')
13199
-
13200
- const PEAR_DIR = global.Pear?.config.pearDir || (isMac
13201
- ? path.join(os.homedir(), 'Library', 'Application Support', 'pear')
13202
- : isWindows
13203
- ? path.join(os.homedir(), 'AppData', 'Roaming', 'pear')
13204
- : path.join(os.homedir(), '.config', 'pear'))
13205
-
13206
- const CONNECT_TIMEOUT = 20_000
13207
- const HEARTBEAT_INTERVAL = 1500
13208
- const HEARBEAT_CLOCK = 5
13209
- const ILLEGAL_METHODS = new Set(['id', 'userData', 'clients', 'hasClients', 'client', 'ref', 'unref', 'ready', 'opening', 'opened', 'close', 'closing', 'closed'])
13210
-
13211
- module.exports = {
13212
- PEAR_DIR,
13213
- CONNECT_TIMEOUT,
13214
- HEARTBEAT_INTERVAL,
13215
- HEARBEAT_CLOCK,
13216
- ILLEGAL_METHODS
14438
+ {
14439
+ "name": "bare-pipe",
14440
+ "version": "3.3.8",
14441
+ "description": "Native I/O pipes for JavaScript",
14442
+ "exports": {
14443
+ ".": "./index.js",
14444
+ "./package": "./package.json",
14445
+ "./constants": "./lib/constants.js",
14446
+ "./errors": "./lib/errors.js"
14447
+ },
14448
+ "files": [
14449
+ "index.js",
14450
+ "binding.c",
14451
+ "binding.js",
14452
+ "CMakeLists.txt",
14453
+ "lib",
14454
+ "prebuilds"
14455
+ ],
14456
+ "addon": true,
14457
+ "scripts": {
14458
+ "test": "standard && bare test.js"
14459
+ },
14460
+ "repository": {
14461
+ "type": "git",
14462
+ "url": "git+https://github.com/holepunchto/bare-pipe.git"
14463
+ },
14464
+ "author": "Holepunch",
14465
+ "license": "Apache-2.0",
14466
+ "bugs": {
14467
+ "url": "https://github.com/holepunchto/bare-pipe/issues"
14468
+ },
14469
+ "homepage": "https://github.com/holepunchto/bare-pipe#readme",
14470
+ "dependencies": {
14471
+ "bare-events": "^2.0.0",
14472
+ "bare-stream": "^2.0.0"
14473
+ },
14474
+ "devDependencies": {
14475
+ "bare-path": "^3.0.0",
14476
+ "brittle": "^3.2.1",
14477
+ "cmake-bare": "^1.1.6",
14478
+ "standard": "^17.0.0"
14479
+ }
13217
14480
  }
13218
- 'use strict'
13219
- const PearIPCServer = require('./server')
13220
- const PearIPCClient = require('./client')
13221
-
13222
- module.exports = { Server: PearIPCServer, Client: PearIPCClient }
13223
- 'use strict'
13224
- const methods = [
13225
- { id: 0, name: 'info', stream: true },
13226
- { id: 1, name: 'dump', stream: true },
13227
- { id: 2, name: 'seed', stream: true },
13228
- { id: 3, name: 'stage', stream: true },
13229
- { id: 4, name: 'release', stream: true },
13230
- { id: 5, name: 'messages', stream: true },
13231
- { id: 6, name: 'message' },
13232
- { id: 7, name: 'config' },
13233
- { id: 8, name: 'checkpoint' },
13234
- { id: 9, name: 'versions' },
13235
- { id: 10, name: 'address' },
13236
- { id: 11, name: 'detached' },
13237
- { id: 12, name: 'permit' },
13238
- { id: 13, name: 'identify' },
13239
- { id: 14, name: 'wakeup' },
13240
- { id: 15, name: 'warming', stream: true },
13241
- { id: 16, name: 'warmup' },
13242
- { id: 17, name: 'start' },
13243
- { id: 18, name: 'restart' },
13244
- { id: 19, name: 'unloading' },
13245
- { id: 20, name: 'closeClients' },
13246
- { id: 21, name: 'createReport' },
13247
- { id: 22, name: 'reports', stream: true },
13248
- { id: 23, name: 'shutdown', send: true },
13249
- { id: 24, name: 'shift', stream: true },
13250
- { id: 25, name: 'build', stream: true },
13251
- { id: 26, name: 'gc', stream: true },
13252
- { id: 27, name: 'clearIdentity' },
13253
- { id: 28, name: 'shareIdentity' },
13254
- { id: 29, name: 'requestIdentity' },
13255
- { id: 30, name: 'trustIdentity' },
13256
- { id: 31, name: 'encryptionKey', stream: true },
13257
- { id: 32, name: 'trusted' },
13258
- { id: 33, name: 'touch', stream: true },
13259
- { id: 34, name: '_ping' },
13260
- { id: 35, name: 'reset', stream: true },
13261
- { id: 36, name: 'data', stream: true },
13262
- { id: 37, name: 'get' },
13263
- { id: 38, name: 'entry' },
13264
- { id: 39, name: 'exists' },
13265
- { id: 40, name: 'compare' },
13266
- { id: 41, name: 'reported' }
13267
- ]
13268
-
13269
- module.exports = methods
13270
14481
  {
13271
14482
  "name": "pear-ipc",
13272
14483
  "version": "3.2.0",
@@ -19126,7 +20337,7 @@ function quintet (s, i) {
19126
20337
  }
19127
20338
  {
19128
20339
  "name": "pear-electron",
19129
- "version": "1.0.18",
20340
+ "version": "1.0.20",
19130
20341
  "description": "Pear User-Interface Library for Electron",
19131
20342
  "main": "index.js",
19132
20343
  "bin": "bin.js",
@@ -19170,10 +20381,11 @@ function quintet (s, i) {
19170
20381
  "dependencies": {
19171
20382
  "bare-env": "^3.0.0",
19172
20383
  "bare-fs": "^4.0.1",
19173
- "bare-os": "^3.3.0",
20384
+ "bare-os": "^3.4.0",
19174
20385
  "bare-path": "^3.0.0",
19175
- "bare-subprocess": "^4.0.3",
19176
- "bare-tty": "^4.0.2",
20386
+ "bare-pipe": "^4.0.3",
20387
+ "bare-subprocess": "^5.0.2",
20388
+ "bare-tty": "^5.0.1",
19177
20389
  "corestore": "^6.18.4",
19178
20390
  "hypercore-id-encoding": "^1.3.0",
19179
20391
  "hyperdrive": "^11.13.3",
@@ -19194,21 +20406,6 @@ function quintet (s, i) {
19194
20406
  "url-file-url": "^1.0.4",
19195
20407
  "which-runtime": "^1.2.1"
19196
20408
  },
19197
- "bundleDependencies": [
19198
- "hypercore-id-encoding",
19199
- "bare-path",
19200
- "bare-fs",
19201
- "bare-os",
19202
- "bare-tty",
19203
- "bare-path",
19204
- "bare-pipe",
19205
- "bare-subprocess",
19206
- "bare-env",
19207
- "paparam",
19208
- "which-runtime",
19209
- "url-file-url",
19210
- "pear-api"
19211
- ],
19212
20409
  "devDependencies": {
19213
20410
  "@fontsource/open-sans": "^5.1.0",
19214
20411
  "graceful-goodbye": "^1.3.2",