korveniq 1.0.1 → 1.0.2

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 (519) hide show
  1. package/bin/index.js +1 -1
  2. package/lib/build-profile.json +5 -0
  3. package/lib/chat.js +3 -1
  4. package/lib/endpoints.js +8 -5
  5. package/lib/select-menu.js +154 -0
  6. package/lib/tools.js +13 -0
  7. package/lib/utils.js +12 -0
  8. package/node_modules/@socket.io/component-emitter/LICENSE +24 -0
  9. package/node_modules/@socket.io/component-emitter/Readme.md +79 -0
  10. package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +179 -0
  11. package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +176 -0
  12. package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +4 -0
  13. package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +179 -0
  14. package/node_modules/@socket.io/component-emitter/lib/esm/index.js +169 -0
  15. package/node_modules/@socket.io/component-emitter/lib/esm/package.json +4 -0
  16. package/node_modules/@socket.io/component-emitter/package.json +28 -0
  17. package/node_modules/ansi-regex/index.d.ts +37 -0
  18. package/node_modules/ansi-regex/index.js +10 -0
  19. package/node_modules/ansi-regex/license +9 -0
  20. package/node_modules/ansi-regex/package.json +55 -0
  21. package/node_modules/ansi-regex/readme.md +78 -0
  22. package/node_modules/ansi-styles/index.d.ts +345 -0
  23. package/node_modules/ansi-styles/index.js +163 -0
  24. package/node_modules/ansi-styles/license +9 -0
  25. package/node_modules/ansi-styles/package.json +56 -0
  26. package/node_modules/ansi-styles/readme.md +152 -0
  27. package/node_modules/base64-js/LICENSE +21 -0
  28. package/node_modules/base64-js/README.md +34 -0
  29. package/node_modules/base64-js/base64js.min.js +1 -0
  30. package/node_modules/base64-js/index.d.ts +3 -0
  31. package/node_modules/base64-js/index.js +150 -0
  32. package/node_modules/base64-js/package.json +47 -0
  33. package/node_modules/bl/.travis.yml +17 -0
  34. package/node_modules/bl/BufferList.js +396 -0
  35. package/node_modules/bl/LICENSE.md +13 -0
  36. package/node_modules/bl/README.md +247 -0
  37. package/node_modules/bl/bl.js +84 -0
  38. package/node_modules/bl/package.json +37 -0
  39. package/node_modules/bl/test/convert.js +21 -0
  40. package/node_modules/bl/test/indexOf.js +492 -0
  41. package/node_modules/bl/test/isBufferList.js +32 -0
  42. package/node_modules/bl/test/test.js +869 -0
  43. package/node_modules/buffer/AUTHORS.md +70 -0
  44. package/node_modules/buffer/LICENSE +21 -0
  45. package/node_modules/buffer/README.md +410 -0
  46. package/node_modules/buffer/index.d.ts +186 -0
  47. package/node_modules/buffer/index.js +1817 -0
  48. package/node_modules/buffer/package.json +96 -0
  49. package/node_modules/chalk/index.d.ts +415 -0
  50. package/node_modules/chalk/license +9 -0
  51. package/node_modules/chalk/package.json +68 -0
  52. package/node_modules/chalk/readme.md +341 -0
  53. package/node_modules/chalk/source/index.js +229 -0
  54. package/node_modules/chalk/source/templates.js +134 -0
  55. package/node_modules/chalk/source/util.js +39 -0
  56. package/node_modules/cli-cursor/index.d.ts +45 -0
  57. package/node_modules/cli-cursor/index.js +35 -0
  58. package/node_modules/cli-cursor/license +9 -0
  59. package/node_modules/cli-cursor/package.json +46 -0
  60. package/node_modules/cli-cursor/readme.md +55 -0
  61. package/node_modules/cli-spinners/index.d.ts +128 -0
  62. package/node_modules/cli-spinners/index.js +15 -0
  63. package/node_modules/cli-spinners/license +9 -0
  64. package/node_modules/cli-spinners/package.json +50 -0
  65. package/node_modules/cli-spinners/readme.md +54 -0
  66. package/node_modules/cli-spinners/spinners.json +1622 -0
  67. package/node_modules/clone/.npmignore +4 -0
  68. package/node_modules/clone/LICENSE +18 -0
  69. package/node_modules/clone/README.md +126 -0
  70. package/node_modules/clone/clone.iml +10 -0
  71. package/node_modules/clone/clone.js +166 -0
  72. package/node_modules/clone/package.json +51 -0
  73. package/node_modules/color-convert/CHANGELOG.md +54 -0
  74. package/node_modules/color-convert/LICENSE +21 -0
  75. package/node_modules/color-convert/README.md +68 -0
  76. package/node_modules/color-convert/conversions.js +839 -0
  77. package/node_modules/color-convert/index.js +81 -0
  78. package/node_modules/color-convert/package.json +48 -0
  79. package/node_modules/color-convert/route.js +97 -0
  80. package/node_modules/color-name/LICENSE +8 -0
  81. package/node_modules/color-name/README.md +11 -0
  82. package/node_modules/color-name/index.js +152 -0
  83. package/node_modules/color-name/package.json +28 -0
  84. package/node_modules/commander/LICENSE +22 -0
  85. package/node_modules/commander/Readme.md +1157 -0
  86. package/node_modules/commander/esm.mjs +16 -0
  87. package/node_modules/commander/index.js +24 -0
  88. package/node_modules/commander/lib/argument.js +149 -0
  89. package/node_modules/commander/lib/command.js +2509 -0
  90. package/node_modules/commander/lib/error.js +39 -0
  91. package/node_modules/commander/lib/help.js +520 -0
  92. package/node_modules/commander/lib/option.js +330 -0
  93. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  94. package/node_modules/commander/package-support.json +16 -0
  95. package/node_modules/commander/package.json +84 -0
  96. package/node_modules/commander/typings/esm.d.mts +3 -0
  97. package/node_modules/commander/typings/index.d.ts +969 -0
  98. package/node_modules/debug/LICENSE +20 -0
  99. package/node_modules/debug/README.md +481 -0
  100. package/node_modules/debug/package.json +60 -0
  101. package/node_modules/debug/src/browser.js +271 -0
  102. package/node_modules/debug/src/common.js +274 -0
  103. package/node_modules/debug/src/index.js +10 -0
  104. package/node_modules/debug/src/node.js +263 -0
  105. package/node_modules/defaults/LICENSE +22 -0
  106. package/node_modules/defaults/README.md +39 -0
  107. package/node_modules/defaults/index.js +13 -0
  108. package/node_modules/defaults/package.json +33 -0
  109. package/node_modules/defaults/test.js +34 -0
  110. package/node_modules/define-lazy-prop/index.d.ts +33 -0
  111. package/node_modules/define-lazy-prop/index.js +19 -0
  112. package/node_modules/define-lazy-prop/license +9 -0
  113. package/node_modules/define-lazy-prop/package.json +48 -0
  114. package/node_modules/define-lazy-prop/readme.md +64 -0
  115. package/node_modules/engine.io-client/LICENSE +22 -0
  116. package/node_modules/engine.io-client/README.md +331 -0
  117. package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +3 -0
  118. package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +4 -0
  119. package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +1 -0
  120. package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +14 -0
  121. package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +15 -0
  122. package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +38 -0
  123. package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +1 -0
  124. package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +67 -0
  125. package/node_modules/engine.io-client/build/cjs/globals.d.ts +4 -0
  126. package/node_modules/engine.io-client/build/cjs/globals.js +26 -0
  127. package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +20 -0
  128. package/node_modules/engine.io-client/build/cjs/globals.node.js +97 -0
  129. package/node_modules/engine.io-client/build/cjs/index.d.ts +15 -0
  130. package/node_modules/engine.io-client/build/cjs/index.js +29 -0
  131. package/node_modules/engine.io-client/build/cjs/package.json +10 -0
  132. package/node_modules/engine.io-client/build/cjs/socket.d.ts +439 -0
  133. package/node_modules/engine.io-client/build/cjs/socket.js +698 -0
  134. package/node_modules/engine.io-client/build/cjs/transport.d.ts +106 -0
  135. package/node_modules/engine.io-client/build/cjs/transport.js +153 -0
  136. package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +8 -0
  137. package/node_modules/engine.io-client/build/cjs/transports/index.js +11 -0
  138. package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +15 -0
  139. package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +60 -0
  140. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +108 -0
  141. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +285 -0
  142. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +11 -0
  143. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +54 -0
  144. package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +52 -0
  145. package/node_modules/engine.io-client/build/cjs/transports/polling.js +165 -0
  146. package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +36 -0
  147. package/node_modules/engine.io-client/build/cjs/transports/websocket.js +136 -0
  148. package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +14 -0
  149. package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +78 -0
  150. package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +18 -0
  151. package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +94 -0
  152. package/node_modules/engine.io-client/build/cjs/util.d.ts +7 -0
  153. package/node_modules/engine.io-client/build/cjs/util.js +65 -0
  154. package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +3 -0
  155. package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +2 -0
  156. package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +1 -0
  157. package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +11 -0
  158. package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +15 -0
  159. package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +34 -0
  160. package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +1 -0
  161. package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +64 -0
  162. package/node_modules/engine.io-client/build/esm/globals.d.ts +4 -0
  163. package/node_modules/engine.io-client/build/esm/globals.js +22 -0
  164. package/node_modules/engine.io-client/build/esm/globals.node.d.ts +20 -0
  165. package/node_modules/engine.io-client/build/esm/globals.node.js +91 -0
  166. package/node_modules/engine.io-client/build/esm/index.d.ts +15 -0
  167. package/node_modules/engine.io-client/build/esm/index.js +14 -0
  168. package/node_modules/engine.io-client/build/esm/package.json +10 -0
  169. package/node_modules/engine.io-client/build/esm/socket.d.ts +439 -0
  170. package/node_modules/engine.io-client/build/esm/socket.js +662 -0
  171. package/node_modules/engine.io-client/build/esm/transport.d.ts +106 -0
  172. package/node_modules/engine.io-client/build/esm/transport.js +142 -0
  173. package/node_modules/engine.io-client/build/esm/transports/index.d.ts +8 -0
  174. package/node_modules/engine.io-client/build/esm/transports/index.js +8 -0
  175. package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +15 -0
  176. package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +56 -0
  177. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +108 -0
  178. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +271 -0
  179. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +11 -0
  180. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +17 -0
  181. package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +52 -0
  182. package/node_modules/engine.io-client/build/esm/transports/polling.js +145 -0
  183. package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +36 -0
  184. package/node_modules/engine.io-client/build/esm/transports/websocket.js +125 -0
  185. package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +14 -0
  186. package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +41 -0
  187. package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +18 -0
  188. package/node_modules/engine.io-client/build/esm/transports/webtransport.js +80 -0
  189. package/node_modules/engine.io-client/build/esm/util.d.ts +7 -0
  190. package/node_modules/engine.io-client/build/esm/util.js +59 -0
  191. package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +3 -0
  192. package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +2 -0
  193. package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +1 -0
  194. package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +11 -0
  195. package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +15 -0
  196. package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +34 -0
  197. package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +1 -0
  198. package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +64 -0
  199. package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +4 -0
  200. package/node_modules/engine.io-client/build/esm-debug/globals.js +22 -0
  201. package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +20 -0
  202. package/node_modules/engine.io-client/build/esm-debug/globals.node.js +91 -0
  203. package/node_modules/engine.io-client/build/esm-debug/index.d.ts +15 -0
  204. package/node_modules/engine.io-client/build/esm-debug/index.js +14 -0
  205. package/node_modules/engine.io-client/build/esm-debug/package.json +10 -0
  206. package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +439 -0
  207. package/node_modules/engine.io-client/build/esm-debug/socket.js +691 -0
  208. package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +106 -0
  209. package/node_modules/engine.io-client/build/esm-debug/transport.js +145 -0
  210. package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +8 -0
  211. package/node_modules/engine.io-client/build/esm-debug/transports/index.js +8 -0
  212. package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +15 -0
  213. package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +56 -0
  214. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +108 -0
  215. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +276 -0
  216. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +11 -0
  217. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +17 -0
  218. package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +52 -0
  219. package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +158 -0
  220. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +36 -0
  221. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +128 -0
  222. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +14 -0
  223. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +41 -0
  224. package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +18 -0
  225. package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +87 -0
  226. package/node_modules/engine.io-client/build/esm-debug/util.d.ts +7 -0
  227. package/node_modules/engine.io-client/build/esm-debug/util.js +59 -0
  228. package/node_modules/engine.io-client/dist/engine.io.esm.min.js +7 -0
  229. package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +1 -0
  230. package/node_modules/engine.io-client/dist/engine.io.js +2989 -0
  231. package/node_modules/engine.io-client/dist/engine.io.js.map +1 -0
  232. package/node_modules/engine.io-client/dist/engine.io.min.js +7 -0
  233. package/node_modules/engine.io-client/dist/engine.io.min.js.map +1 -0
  234. package/node_modules/engine.io-client/node_modules/debug/LICENSE +20 -0
  235. package/node_modules/engine.io-client/node_modules/debug/README.md +481 -0
  236. package/node_modules/engine.io-client/node_modules/debug/package.json +64 -0
  237. package/node_modules/engine.io-client/node_modules/debug/src/browser.js +272 -0
  238. package/node_modules/engine.io-client/node_modules/debug/src/common.js +292 -0
  239. package/node_modules/engine.io-client/node_modules/debug/src/index.js +10 -0
  240. package/node_modules/engine.io-client/node_modules/debug/src/node.js +263 -0
  241. package/node_modules/engine.io-client/package.json +95 -0
  242. package/node_modules/engine.io-parser/LICENSE +22 -0
  243. package/node_modules/engine.io-parser/Readme.md +158 -0
  244. package/node_modules/engine.io-parser/build/cjs/commons.d.ts +14 -0
  245. package/node_modules/engine.io-parser/build/cjs/commons.js +19 -0
  246. package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +2 -0
  247. package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +48 -0
  248. package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +2 -0
  249. package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +66 -0
  250. package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +2 -0
  251. package/node_modules/engine.io-parser/build/cjs/decodePacket.js +59 -0
  252. package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +4 -0
  253. package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +72 -0
  254. package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +3 -0
  255. package/node_modules/engine.io-parser/build/cjs/encodePacket.js +38 -0
  256. package/node_modules/engine.io-parser/build/cjs/index.d.ts +9 -0
  257. package/node_modules/engine.io-parser/build/cjs/index.js +164 -0
  258. package/node_modules/engine.io-parser/build/cjs/package.json +8 -0
  259. package/node_modules/engine.io-parser/build/esm/commons.d.ts +14 -0
  260. package/node_modules/engine.io-parser/build/esm/commons.js +14 -0
  261. package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +2 -0
  262. package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +43 -0
  263. package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +2 -0
  264. package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +62 -0
  265. package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +2 -0
  266. package/node_modules/engine.io-parser/build/esm/decodePacket.js +55 -0
  267. package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +4 -0
  268. package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +68 -0
  269. package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +3 -0
  270. package/node_modules/engine.io-parser/build/esm/encodePacket.js +33 -0
  271. package/node_modules/engine.io-parser/build/esm/index.d.ts +9 -0
  272. package/node_modules/engine.io-parser/build/esm/index.js +156 -0
  273. package/node_modules/engine.io-parser/build/esm/package.json +8 -0
  274. package/node_modules/engine.io-parser/package.json +46 -0
  275. package/node_modules/has-flag/index.d.ts +39 -0
  276. package/node_modules/has-flag/index.js +8 -0
  277. package/node_modules/has-flag/license +9 -0
  278. package/node_modules/has-flag/package.json +46 -0
  279. package/node_modules/has-flag/readme.md +89 -0
  280. package/node_modules/ieee754/LICENSE +11 -0
  281. package/node_modules/ieee754/README.md +51 -0
  282. package/node_modules/ieee754/index.d.ts +10 -0
  283. package/node_modules/ieee754/index.js +85 -0
  284. package/node_modules/ieee754/package.json +52 -0
  285. package/node_modules/inherits/LICENSE +16 -0
  286. package/node_modules/inherits/README.md +42 -0
  287. package/node_modules/inherits/inherits.js +9 -0
  288. package/node_modules/inherits/inherits_browser.js +27 -0
  289. package/node_modules/inherits/package.json +29 -0
  290. package/node_modules/is-docker/cli.js +5 -0
  291. package/node_modules/is-docker/index.d.ts +15 -0
  292. package/node_modules/is-docker/index.js +29 -0
  293. package/node_modules/is-docker/license +9 -0
  294. package/node_modules/is-docker/package.json +42 -0
  295. package/node_modules/is-docker/readme.md +27 -0
  296. package/node_modules/is-interactive/index.d.ts +31 -0
  297. package/node_modules/is-interactive/index.js +9 -0
  298. package/node_modules/is-interactive/license +9 -0
  299. package/node_modules/is-interactive/package.json +38 -0
  300. package/node_modules/is-interactive/readme.md +51 -0
  301. package/node_modules/is-unicode-supported/index.d.ts +14 -0
  302. package/node_modules/is-unicode-supported/index.js +13 -0
  303. package/node_modules/is-unicode-supported/license +9 -0
  304. package/node_modules/is-unicode-supported/package.json +41 -0
  305. package/node_modules/is-unicode-supported/readme.md +35 -0
  306. package/node_modules/is-wsl/index.d.ts +15 -0
  307. package/node_modules/is-wsl/index.js +31 -0
  308. package/node_modules/is-wsl/license +9 -0
  309. package/node_modules/is-wsl/package.json +45 -0
  310. package/node_modules/is-wsl/readme.md +36 -0
  311. package/node_modules/log-symbols/browser.js +8 -0
  312. package/node_modules/log-symbols/index.d.ts +25 -0
  313. package/node_modules/log-symbols/index.js +19 -0
  314. package/node_modules/log-symbols/license +9 -0
  315. package/node_modules/log-symbols/package.json +52 -0
  316. package/node_modules/log-symbols/readme.md +51 -0
  317. package/node_modules/mimic-fn/index.d.ts +54 -0
  318. package/node_modules/mimic-fn/index.js +13 -0
  319. package/node_modules/mimic-fn/license +9 -0
  320. package/node_modules/mimic-fn/package.json +42 -0
  321. package/node_modules/mimic-fn/readme.md +69 -0
  322. package/node_modules/ms/index.js +162 -0
  323. package/node_modules/ms/license.md +21 -0
  324. package/node_modules/ms/package.json +38 -0
  325. package/node_modules/ms/readme.md +59 -0
  326. package/node_modules/onetime/index.d.ts +64 -0
  327. package/node_modules/onetime/index.js +44 -0
  328. package/node_modules/onetime/license +9 -0
  329. package/node_modules/onetime/package.json +43 -0
  330. package/node_modules/onetime/readme.md +94 -0
  331. package/node_modules/open/index.d.ts +153 -0
  332. package/node_modules/open/index.js +334 -0
  333. package/node_modules/open/license +9 -0
  334. package/node_modules/open/package.json +61 -0
  335. package/node_modules/open/readme.md +171 -0
  336. package/node_modules/open/xdg-open +1066 -0
  337. package/node_modules/ora/index.d.ts +277 -0
  338. package/node_modules/ora/index.js +407 -0
  339. package/node_modules/ora/license +9 -0
  340. package/node_modules/ora/package.json +57 -0
  341. package/node_modules/ora/readme.md +264 -0
  342. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  343. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  344. package/node_modules/readable-stream/LICENSE +47 -0
  345. package/node_modules/readable-stream/README.md +106 -0
  346. package/node_modules/readable-stream/errors-browser.js +127 -0
  347. package/node_modules/readable-stream/errors.js +116 -0
  348. package/node_modules/readable-stream/experimentalWarning.js +17 -0
  349. package/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
  350. package/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
  351. package/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
  352. package/node_modules/readable-stream/lib/_stream_transform.js +190 -0
  353. package/node_modules/readable-stream/lib/_stream_writable.js +641 -0
  354. package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
  355. package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
  356. package/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
  357. package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
  358. package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
  359. package/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
  360. package/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
  361. package/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
  362. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  363. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  364. package/node_modules/readable-stream/package.json +68 -0
  365. package/node_modules/readable-stream/readable-browser.js +9 -0
  366. package/node_modules/readable-stream/readable.js +16 -0
  367. package/node_modules/restore-cursor/index.d.ts +13 -0
  368. package/node_modules/restore-cursor/index.js +9 -0
  369. package/node_modules/restore-cursor/license +9 -0
  370. package/node_modules/restore-cursor/package.json +52 -0
  371. package/node_modules/restore-cursor/readme.md +26 -0
  372. package/node_modules/safe-buffer/LICENSE +21 -0
  373. package/node_modules/safe-buffer/README.md +584 -0
  374. package/node_modules/safe-buffer/index.d.ts +187 -0
  375. package/node_modules/safe-buffer/index.js +65 -0
  376. package/node_modules/safe-buffer/package.json +51 -0
  377. package/node_modules/signal-exit/LICENSE.txt +16 -0
  378. package/node_modules/signal-exit/README.md +39 -0
  379. package/node_modules/signal-exit/index.js +202 -0
  380. package/node_modules/signal-exit/package.json +38 -0
  381. package/node_modules/signal-exit/signals.js +53 -0
  382. package/node_modules/socket.io-client/LICENSE +21 -0
  383. package/node_modules/socket.io-client/README.md +29 -0
  384. package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +2 -0
  385. package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +4 -0
  386. package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +12 -0
  387. package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +69 -0
  388. package/node_modules/socket.io-client/build/cjs/index.d.ts +29 -0
  389. package/node_modules/socket.io-client/build/cjs/index.js +76 -0
  390. package/node_modules/socket.io-client/build/cjs/manager.d.ts +295 -0
  391. package/node_modules/socket.io-client/build/cjs/manager.js +416 -0
  392. package/node_modules/socket.io-client/build/cjs/on.d.ts +2 -0
  393. package/node_modules/socket.io-client/build/cjs/on.js +9 -0
  394. package/node_modules/socket.io-client/build/cjs/socket.d.ts +593 -0
  395. package/node_modules/socket.io-client/build/cjs/socket.js +910 -0
  396. package/node_modules/socket.io-client/build/cjs/url.d.ts +33 -0
  397. package/node_modules/socket.io-client/build/cjs/url.js +69 -0
  398. package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +2 -0
  399. package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +2 -0
  400. package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +12 -0
  401. package/node_modules/socket.io-client/build/esm/contrib/backo2.js +66 -0
  402. package/node_modules/socket.io-client/build/esm/index.d.ts +29 -0
  403. package/node_modules/socket.io-client/build/esm/index.js +58 -0
  404. package/node_modules/socket.io-client/build/esm/manager.d.ts +295 -0
  405. package/node_modules/socket.io-client/build/esm/manager.js +367 -0
  406. package/node_modules/socket.io-client/build/esm/on.d.ts +2 -0
  407. package/node_modules/socket.io-client/build/esm/on.js +6 -0
  408. package/node_modules/socket.io-client/build/esm/package.json +5 -0
  409. package/node_modules/socket.io-client/build/esm/socket.d.ts +593 -0
  410. package/node_modules/socket.io-client/build/esm/socket.js +882 -0
  411. package/node_modules/socket.io-client/build/esm/url.d.ts +33 -0
  412. package/node_modules/socket.io-client/build/esm/url.js +59 -0
  413. package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +2 -0
  414. package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +2 -0
  415. package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +12 -0
  416. package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +66 -0
  417. package/node_modules/socket.io-client/build/esm-debug/index.d.ts +29 -0
  418. package/node_modules/socket.io-client/build/esm-debug/index.js +62 -0
  419. package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +295 -0
  420. package/node_modules/socket.io-client/build/esm-debug/manager.js +386 -0
  421. package/node_modules/socket.io-client/build/esm-debug/on.d.ts +2 -0
  422. package/node_modules/socket.io-client/build/esm-debug/on.js +6 -0
  423. package/node_modules/socket.io-client/build/esm-debug/package.json +5 -0
  424. package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +593 -0
  425. package/node_modules/socket.io-client/build/esm-debug/socket.js +903 -0
  426. package/node_modules/socket.io-client/build/esm-debug/url.d.ts +33 -0
  427. package/node_modules/socket.io-client/build/esm-debug/url.js +63 -0
  428. package/node_modules/socket.io-client/dist/socket.io.esm.min.js +7 -0
  429. package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +1 -0
  430. package/node_modules/socket.io-client/dist/socket.io.js +4908 -0
  431. package/node_modules/socket.io-client/dist/socket.io.js.map +1 -0
  432. package/node_modules/socket.io-client/dist/socket.io.min.js +7 -0
  433. package/node_modules/socket.io-client/dist/socket.io.min.js.map +1 -0
  434. package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +7 -0
  435. package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +1 -0
  436. package/node_modules/socket.io-client/package.json +101 -0
  437. package/node_modules/socket.io-parser/LICENSE +20 -0
  438. package/node_modules/socket.io-parser/Readme.md +81 -0
  439. package/node_modules/socket.io-parser/build/cjs/binary.d.ts +20 -0
  440. package/node_modules/socket.io-parser/build/cjs/binary.js +90 -0
  441. package/node_modules/socket.io-parser/build/cjs/index.d.ts +101 -0
  442. package/node_modules/socket.io-parser/build/cjs/index.js +366 -0
  443. package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +7 -0
  444. package/node_modules/socket.io-parser/build/cjs/is-binary.js +54 -0
  445. package/node_modules/socket.io-parser/build/cjs/package.json +3 -0
  446. package/node_modules/socket.io-parser/build/esm/binary.d.ts +20 -0
  447. package/node_modules/socket.io-parser/build/esm/binary.js +86 -0
  448. package/node_modules/socket.io-parser/build/esm/index.d.ts +101 -0
  449. package/node_modules/socket.io-parser/build/esm/index.js +352 -0
  450. package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +7 -0
  451. package/node_modules/socket.io-parser/build/esm/is-binary.js +50 -0
  452. package/node_modules/socket.io-parser/build/esm/package.json +3 -0
  453. package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +20 -0
  454. package/node_modules/socket.io-parser/build/esm-debug/binary.js +86 -0
  455. package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +101 -0
  456. package/node_modules/socket.io-parser/build/esm-debug/index.js +357 -0
  457. package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +7 -0
  458. package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +50 -0
  459. package/node_modules/socket.io-parser/build/esm-debug/package.json +3 -0
  460. package/node_modules/socket.io-parser/node_modules/debug/LICENSE +20 -0
  461. package/node_modules/socket.io-parser/node_modules/debug/README.md +481 -0
  462. package/node_modules/socket.io-parser/node_modules/debug/package.json +64 -0
  463. package/node_modules/socket.io-parser/node_modules/debug/src/browser.js +272 -0
  464. package/node_modules/socket.io-parser/node_modules/debug/src/common.js +292 -0
  465. package/node_modules/socket.io-parser/node_modules/debug/src/index.js +10 -0
  466. package/node_modules/socket.io-parser/node_modules/debug/src/node.js +263 -0
  467. package/node_modules/socket.io-parser/package.json +44 -0
  468. package/node_modules/string_decoder/LICENSE +48 -0
  469. package/node_modules/string_decoder/README.md +47 -0
  470. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  471. package/node_modules/string_decoder/package.json +34 -0
  472. package/node_modules/strip-ansi/index.d.ts +17 -0
  473. package/node_modules/strip-ansi/index.js +4 -0
  474. package/node_modules/strip-ansi/license +9 -0
  475. package/node_modules/strip-ansi/package.json +54 -0
  476. package/node_modules/strip-ansi/readme.md +46 -0
  477. package/node_modules/supports-color/browser.js +5 -0
  478. package/node_modules/supports-color/index.js +135 -0
  479. package/node_modules/supports-color/license +9 -0
  480. package/node_modules/supports-color/package.json +53 -0
  481. package/node_modules/supports-color/readme.md +76 -0
  482. package/node_modules/util-deprecate/History.md +16 -0
  483. package/node_modules/util-deprecate/LICENSE +24 -0
  484. package/node_modules/util-deprecate/README.md +53 -0
  485. package/node_modules/util-deprecate/browser.js +67 -0
  486. package/node_modules/util-deprecate/node.js +6 -0
  487. package/node_modules/util-deprecate/package.json +27 -0
  488. package/node_modules/wcwidth/.npmignore +1 -0
  489. package/node_modules/wcwidth/LICENSE +30 -0
  490. package/node_modules/wcwidth/Readme.md +33 -0
  491. package/node_modules/wcwidth/combining.js +50 -0
  492. package/node_modules/wcwidth/docs/index.md +65 -0
  493. package/node_modules/wcwidth/index.js +99 -0
  494. package/node_modules/wcwidth/package.json +42 -0
  495. package/node_modules/wcwidth/test/index.js +64 -0
  496. package/node_modules/ws/LICENSE +20 -0
  497. package/node_modules/ws/README.md +548 -0
  498. package/node_modules/ws/browser.js +8 -0
  499. package/node_modules/ws/index.js +22 -0
  500. package/node_modules/ws/lib/buffer-util.js +131 -0
  501. package/node_modules/ws/lib/constants.js +19 -0
  502. package/node_modules/ws/lib/event-target.js +292 -0
  503. package/node_modules/ws/lib/extension.js +203 -0
  504. package/node_modules/ws/lib/limiter.js +55 -0
  505. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  506. package/node_modules/ws/lib/receiver.js +743 -0
  507. package/node_modules/ws/lib/sender.js +607 -0
  508. package/node_modules/ws/lib/stream.js +161 -0
  509. package/node_modules/ws/lib/subprotocol.js +62 -0
  510. package/node_modules/ws/lib/validation.js +152 -0
  511. package/node_modules/ws/lib/websocket-server.js +562 -0
  512. package/node_modules/ws/lib/websocket.js +1407 -0
  513. package/node_modules/ws/package.json +74 -0
  514. package/node_modules/ws/wrapper.mjs +21 -0
  515. package/node_modules/xmlhttprequest-ssl/LICENSE +22 -0
  516. package/node_modules/xmlhttprequest-ssl/README.md +67 -0
  517. package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +689 -0
  518. package/node_modules/xmlhttprequest-ssl/package.json +40 -0
  519. package/package.json +8 -15
package/bin/index.js CHANGED
@@ -221,7 +221,7 @@ Examples:
221
221
  Environment:
222
222
  KORVENIQ_TOKEN use this token instead of the saved login (CI, scripts)
223
223
  KORVENIQ_HOME folder for settings and credentials (default ~/.korveniq)
224
- KORVENIQ_API_URL address of the Korveniq API (required: the CLI has no built-in one)
224
+ KORVENIQ_API_URL address of the Korveniq API (optional: the official one is built in)
225
225
  KORVENIQ_DEBUG=1 same as --debug
226
226
  KORVENIQ_RETRIES=n automatic retries of safe requests, 0-5 (default 2)
227
227
  KORVENIQ_ASCII=1 ASCII symbols instead of Unicode
@@ -0,0 +1,5 @@
1
+ {
2
+ "profile": "beta",
3
+ "version": "1.0.2",
4
+ "builtAt": "2026-11-25T16:01:13.581Z"
5
+ }
package/lib/chat.js CHANGED
@@ -289,7 +289,9 @@ async function showWelcome(session) {
289
289
  /** Ask the user to confirm the working directory. Ctrl+C counts as "no". */
290
290
  async function confirmDirectory() {
291
291
  try {
292
- const ok = await askYesNo(`Working in: ${theme.bold(sanitizeForTerminal(process.cwd(), { singleLine: true }))} ${symbols.dash} Proceed?`);
292
+ // The path gets its own line: a long path never splits the question (or the menu under it) across rows.
293
+ console.log(` Working in: ${theme.bold(sanitizeForTerminal(process.cwd(), { singleLine: true }))}`);
294
+ const ok = await askYesNo('Proceed?');
293
295
  console.log();
294
296
  return ok;
295
297
  } catch (err) {
package/lib/endpoints.js CHANGED
@@ -20,8 +20,8 @@
20
20
  * The Socket.IO server runs on the same origin as baseUrl (no /api/v1 path);
21
21
  * set "socketUrl" in endpoints.json only if it ever moves.
22
22
  *
23
- * There is NO built-in API address: the official hostname is configured, never guessed. Set it with KORVENIQ_API_URL or
24
- * "baseUrl" in ~/.korveniq/endpoints.json; until then every request fails with a clear message before anything is sent.
23
+ * The official production API address is built in (DEFAULT_BASE_URL, authorized by the owner and the one the web app uses), so
24
+ * nobody has to configure anything. KORVENIQ_API_URL or "baseUrl" in ~/.korveniq/endpoints.json still override it (staging, tests).
25
25
  *
26
26
  * Endpoint names the CLI uses: login, me, createChat, listChats, getChat,
27
27
  * deleteChat, renameChat, chatReadiness, chatCapabilities, sendMessage, runStatus, cancelRun.
@@ -32,8 +32,11 @@ const path = require('path');
32
32
  const { CONFIG_DIR } = require('./config');
33
33
  const { CliError } = require('./errors');
34
34
 
35
+ /** The official production API (the address the Korveniq web app itself uses). */
36
+ const DEFAULT_BASE_URL = 'https://u12489-kefu-4808c2f6.singapore-a.gpuhub.com:8443';
37
+
35
38
  const DEFAULTS = {
36
- baseUrl: null, // deliberately empty: see the header comment
39
+ baseUrl: DEFAULT_BASE_URL,
37
40
  endpoints: {
38
41
  login: 'POST /api/v1/auth/login',
39
42
  me: 'GET /api/v1/auth/me',
@@ -124,7 +127,7 @@ function load() {
124
127
  }
125
128
  if (!baseUrl) {
126
129
  throw Object.assign(new CliError('No API address is configured', {
127
- action: 'Set the address of the Korveniq API (the CLI has no built-in one), for example:',
130
+ action: 'Set the address of the Korveniq API for example:',
128
131
  commands: ['KORVENIQ_API_URL=https://<api address> korveniq', 'or put { "baseUrl": "https://<api address>" } in ~/.korveniq/endpoints.json'],
129
132
  }), { configError: true });
130
133
  }
@@ -173,4 +176,4 @@ function socketUrl() {
173
176
  return load().socketUrl;
174
177
  }
175
178
 
176
- module.exports = { get, load, socketUrl };
179
+ module.exports = { get, load, socketUrl, DEFAULT_BASE_URL };
@@ -0,0 +1,154 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * An arrow-key selection menu for confirmation dialogs (Claude Code style).
5
+ *
6
+ * ? Run this command?
7
+ * ❯ 1. Yes
8
+ * 2. No
9
+ *
10
+ * Up/Down (or k/j, Tab) move, Enter confirms, Esc and Ctrl+C cancel (the caller treats a cancel as "no").
11
+ * The letter keys given as `key` on an option, and the digits 1-9, only MOVE the highlight: a stray
12
+ * keystroke never approves anything, Enter always decides. The highlighted option at the start is
13
+ * `initial`; callers start on the safe option for everything that changes something.
14
+ *
15
+ * Each redraw is one write (cursor up + clear + the whole frame), so nothing flickers or repeats.
16
+ * Raw mode and the 'keypress' listeners are restored on every way out. Without a TTY the caller
17
+ * must not use this (see canSelect()).
18
+ */
19
+
20
+ const readline = require('readline');
21
+ const { theme, symbols } = require('./ui');
22
+
23
+ const ESC = '\x1b';
24
+ const POINTER = symbols.bullet === '⏺' ? '❯' : '>';
25
+
26
+ /** True when both ends are a terminal, so arrow keys can work. */
27
+ function canSelect(input = process.stdin, output = process.stdout) {
28
+ return Boolean(input && input.isTTY && output && output.isTTY && typeof input.setRawMode === 'function');
29
+ }
30
+
31
+ /** Everything outside the cursor's own row: how many terminal rows `text` occupies at `columns`. */
32
+ function rowsOf(text, columns) {
33
+ const width = Math.max(1, columns || 80);
34
+ let rows = 0;
35
+ for (const line of text.split('\n')) {
36
+ // Strip colour codes before measuring.
37
+ const plain = line.replace(/\x1b\[[0-9;]*m/g, '');
38
+ rows += Math.max(1, Math.ceil(plain.length / width));
39
+ }
40
+ return rows;
41
+ }
42
+
43
+ /**
44
+ * Show a menu and wait for a choice.
45
+ * @param {object} opts
46
+ * @param {string} opts.question already styled
47
+ * @param {Array<{ label: string, value: any, key?: string, hint?: string, danger?: boolean }>} opts.options
48
+ * @param {number} [opts.initial=0] index highlighted first
49
+ * @param {NodeJS.ReadStream} [opts.input]
50
+ * @param {NodeJS.WriteStream} [opts.output]
51
+ * @returns {Promise<{ cancelled: boolean, value: any, index: number }>}
52
+ */
53
+ function selectMenu({ question, options, initial = 0, input = process.stdin, output = process.stdout }) {
54
+ return new Promise((resolve) => {
55
+ let index = Math.min(Math.max(initial, 0), options.length - 1);
56
+ let drawnRows = 0;
57
+ let settled = false;
58
+
59
+ const frame = () => {
60
+ const lines = [`${question}`];
61
+ options.forEach((o, i) => {
62
+ const on = i === index;
63
+ const tint = o.danger ? theme.warn : theme.aiLabel;
64
+ const pointer = on ? tint(POINTER) : ' ';
65
+ const text = `${i + 1}. ${o.label}`;
66
+ const hint = o.hint ? ` ${theme.dim(o.hint)}` : '';
67
+ lines.push(` ${pointer} ${on ? tint(theme.bold(text)) : text}${hint}`);
68
+ });
69
+ lines.push(theme.dim(' Up/Down to move, Enter to confirm, Esc to cancel'));
70
+ return lines.join('\n');
71
+ };
72
+
73
+ const draw = () => {
74
+ const text = frame();
75
+ // Back to the first row of the previous frame, clear to the end of the screen, write the new frame.
76
+ const up = drawnRows > 0 ? `\r${ESC}[${drawnRows - 1 > 0 ? drawnRows - 1 : 0}A${ESC}[J` : '';
77
+ output.write(`${up || ''}${text}`);
78
+ drawnRows = rowsOf(text, output.columns);
79
+ };
80
+
81
+ readline.emitKeypressEvents(input);
82
+ const wasRaw = input.isRaw;
83
+ input.setRawMode(true);
84
+ input.resume();
85
+ output.write(`${ESC}[?25l`); // hide the cursor while the menu is up
86
+
87
+ const finish = (cancelled) => {
88
+ if (settled) return;
89
+ settled = true;
90
+ input.removeListener('keypress', onKey);
91
+ input.removeListener('end', onEnd);
92
+ input.removeListener('close', onEnd);
93
+ try {
94
+ input.setRawMode(Boolean(wasRaw));
95
+ } catch {
96
+ /* terminal gone */
97
+ }
98
+ if (!wasRaw) input.pause();
99
+ // Leave one line: the question and the chosen answer, instead of the whole menu.
100
+ const up = drawnRows > 0 ? `\r${ESC}[${Math.max(drawnRows - 1, 0)}A${ESC}[J` : '';
101
+ const chosen = options[index];
102
+ const summary = cancelled
103
+ ? `${question} ${theme.dim('(cancelled)')}`
104
+ : `${question} ${(chosen.danger ? theme.warn : theme.bold)(chosen.label)}`;
105
+ output.write(`${up}${summary}\n${ESC}[?25h`);
106
+ resolve({ cancelled, value: cancelled ? undefined : chosen.value, index });
107
+ };
108
+
109
+ const move = (delta) => {
110
+ index = (index + delta + options.length) % options.length;
111
+ draw();
112
+ };
113
+
114
+ function onKey(str, key = {}) {
115
+ if (settled) return;
116
+ if (key.ctrl && key.name === 'c') return finish(true);
117
+ if (key.ctrl && key.name === 'd') return finish(true);
118
+ switch (key.name) {
119
+ case 'escape':
120
+ return finish(true);
121
+ case 'return':
122
+ case 'enter':
123
+ return finish(false);
124
+ case 'up':
125
+ return move(-1);
126
+ case 'down':
127
+ return move(1);
128
+ case 'tab':
129
+ return move(key.shift ? -1 : 1);
130
+ default:
131
+ }
132
+ const ch = String(str || '').toLowerCase();
133
+ if (ch === 'k') return move(-1);
134
+ if (ch === 'j') return move(1);
135
+ let target = -1;
136
+ if (/^[1-9]$/.test(ch)) target = Number(ch) - 1;
137
+ else if (ch) target = options.findIndex((o) => o.key && o.key.toLowerCase() === ch);
138
+ if (target >= 0 && target < options.length && target !== index) {
139
+ index = target;
140
+ draw();
141
+ }
142
+ }
143
+ function onEnd() {
144
+ finish(true); // input ended: never approve
145
+ }
146
+
147
+ input.on('keypress', onKey);
148
+ input.once('end', onEnd);
149
+ input.once('close', onEnd);
150
+ draw();
151
+ });
152
+ }
153
+
154
+ module.exports = { selectMenu, canSelect, rowsOf };
package/lib/tools.js CHANGED
@@ -90,6 +90,7 @@ const path = require('path');
90
90
  const { spawn, spawnSync } = require('child_process');
91
91
  const ui = require('./ui');
92
92
  const { theme, ask, onInterrupt, sanitizeForTerminal, hasHiddenChars, countHiddenChars } = require('./utils');
93
+ const selectMenu = require('./select-menu');
93
94
  const { CancelledError } = require('./errors');
94
95
  const { CONFIG_DIR } = require('./config');
95
96
  const sandbox = require('./sandbox');
@@ -1208,6 +1209,18 @@ class ToolRunner {
1208
1209
  const mgr = require('./notifications').manager();
1209
1210
  mgr.transition('awaiting_approval');
1210
1211
  try {
1212
+ if (this.prompt === ask && selectMenu.canSelect()) {
1213
+ // A real terminal: arrow keys + Enter. "No" is always highlighted first; Esc / Ctrl+C means no.
1214
+ const options = [{ label: 'Yes', value: 'yes', key: 'y' }];
1215
+ if (allowAlways) options.push({ label: `Yes, ${alwaysHint}`, value: 'always', key: 'a' });
1216
+ options.push({ label: 'No', value: 'no', key: 'n' });
1217
+ const safe = options.length - 1;
1218
+ // The unsandboxed choice goes below "No": from the highlighted default, Up reaches the safe yeses, and only a deliberate Down reaches it.
1219
+ if (allowUnrestricted) options.push({ label: 'Yes, without the sandbox', value: 'unrestricted', key: 'u', danger: true });
1220
+ const r = await selectMenu.selectMenu({ question: ` ${theme.warn('?')} ${theme.bold(question)}`, options, initial: safe });
1221
+ if (r.cancelled) return 'no';
1222
+ return r.value;
1223
+ }
1211
1224
  const answer = String(await this.prompt(approvalText(question, { allowAlways, alwaysHint, allowUnrestricted }))).toLowerCase();
1212
1225
  if (answer === 'y' || answer === 'yes') return 'yes';
1213
1226
  if (allowUnrestricted && (answer === 'u' || answer === 'unrestricted')) return 'unrestricted';
package/lib/utils.js CHANGED
@@ -112,6 +112,18 @@ function askHidden(question) {
112
112
  * @returns {Promise<boolean>}
113
113
  */
114
114
  async function askYesNo(question, { default: dflt = true } = {}) {
115
+ const menu = require('./select-menu');
116
+ if (menu.canSelect()) {
117
+ // Arrow keys + Enter. The highlight starts on the default; Esc / Ctrl+C is "no" (or a cancel, like Ctrl+C at the typed prompt).
118
+ const r = await menu.selectMenu({
119
+ question: ` ${theme.warn('?')} ${theme.bold(question)}`,
120
+ options: [{ label: 'Yes', value: true, key: 'y' }, { label: 'No', value: false, key: 'n' }],
121
+ initial: dflt ? 0 : 1,
122
+ });
123
+ require('./notifications').manager().noteUserActivity();
124
+ if (r.cancelled) throw new CancelledError();
125
+ return r.value;
126
+ }
115
127
  const hint = dflt ? '[Y/n]' : '[y/N]';
116
128
  for (;;) {
117
129
  const answer = (await ask(`${question} ${theme.dim(hint)} `)).toLowerCase();
@@ -0,0 +1,24 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2014 Component contributors <dev@component.io>
4
+
5
+ Permission is hereby granted, free of charge, to any person
6
+ obtaining a copy of this software and associated documentation
7
+ files (the "Software"), to deal in the Software without
8
+ restriction, including without limitation the rights to use,
9
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the
11
+ Software is furnished to do so, subject to the following
12
+ conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,79 @@
1
+ # `@socket.io/component-emitter`
2
+
3
+ Event emitter component.
4
+
5
+ This project is a fork of the [`component-emitter`](https://github.com/sindresorhus/component-emitter) project, with [Socket.IO](https://socket.io/)-specific TypeScript typings.
6
+
7
+ ## Installation
8
+
9
+ ```
10
+ $ npm i @socket.io/component-emitter
11
+ ```
12
+
13
+ ## API
14
+
15
+ ### Emitter(obj)
16
+
17
+ The `Emitter` may also be used as a mixin. For example
18
+ a "plain" object may become an emitter, or you may
19
+ extend an existing prototype.
20
+
21
+ As an `Emitter` instance:
22
+
23
+ ```js
24
+ import { Emitter } from '@socket.io/component-emitter';
25
+
26
+ var emitter = new Emitter;
27
+ emitter.emit('something');
28
+ ```
29
+
30
+ As a mixin:
31
+
32
+ ```js
33
+ import { Emitter } from '@socket.io/component-emitter';
34
+
35
+ var user = { name: 'tobi' };
36
+ Emitter(user);
37
+
38
+ user.emit('im a user');
39
+ ```
40
+
41
+ As a prototype mixin:
42
+
43
+ ```js
44
+ import { Emitter } from '@socket.io/component-emitter';
45
+
46
+ Emitter(User.prototype);
47
+ ```
48
+
49
+ ### Emitter#on(event, fn)
50
+
51
+ Register an `event` handler `fn`.
52
+
53
+ ### Emitter#once(event, fn)
54
+
55
+ Register a single-shot `event` handler `fn`,
56
+ removed immediately after it is invoked the
57
+ first time.
58
+
59
+ ### Emitter#off(event, fn)
60
+
61
+ * Pass `event` and `fn` to remove a listener.
62
+ * Pass `event` to remove all listeners on that event.
63
+ * Pass nothing to remove all listeners on all events.
64
+
65
+ ### Emitter#emit(event, ...)
66
+
67
+ Emit an `event` with variable option args.
68
+
69
+ ### Emitter#listeners(event)
70
+
71
+ Return an array of callbacks, or an empty array.
72
+
73
+ ### Emitter#hasListeners(event)
74
+
75
+ Check if this emitter has `event` handlers.
76
+
77
+ ## License
78
+
79
+ MIT
@@ -0,0 +1,179 @@
1
+ /**
2
+ * An events map is an interface that maps event names to their value, which
3
+ * represents the type of the `on` listener.
4
+ */
5
+ export interface EventsMap {
6
+ [event: string]: any;
7
+ }
8
+
9
+ /**
10
+ * The default events map, used if no EventsMap is given. Using this EventsMap
11
+ * is equivalent to accepting all event names, and any data.
12
+ */
13
+ export interface DefaultEventsMap {
14
+ [event: string]: (...args: any[]) => void;
15
+ }
16
+
17
+ /**
18
+ * Returns a union type containing all the keys of an event map.
19
+ */
20
+ export type EventNames<Map extends EventsMap> = keyof Map & (string | symbol);
21
+
22
+ /** The tuple type representing the parameters of an event listener */
23
+ export type EventParams<
24
+ Map extends EventsMap,
25
+ Ev extends EventNames<Map>
26
+ > = Parameters<Map[Ev]>;
27
+
28
+ /**
29
+ * The event names that are either in ReservedEvents or in UserEvents
30
+ */
31
+ export type ReservedOrUserEventNames<
32
+ ReservedEventsMap extends EventsMap,
33
+ UserEvents extends EventsMap
34
+ > = EventNames<ReservedEventsMap> | EventNames<UserEvents>;
35
+
36
+ /**
37
+ * Type of a listener of a user event or a reserved event. If `Ev` is in
38
+ * `ReservedEvents`, the reserved event listener is returned.
39
+ */
40
+ export type ReservedOrUserListener<
41
+ ReservedEvents extends EventsMap,
42
+ UserEvents extends EventsMap,
43
+ Ev extends ReservedOrUserEventNames<ReservedEvents, UserEvents>
44
+ > = FallbackToUntypedListener<
45
+ Ev extends EventNames<ReservedEvents>
46
+ ? ReservedEvents[Ev]
47
+ : Ev extends EventNames<UserEvents>
48
+ ? UserEvents[Ev]
49
+ : never
50
+ >;
51
+
52
+ /**
53
+ * Returns an untyped listener type if `T` is `never`; otherwise, returns `T`.
54
+ *
55
+ * This is a hack to mitigate https://github.com/socketio/socket.io/issues/3833.
56
+ * Needed because of https://github.com/microsoft/TypeScript/issues/41778
57
+ */
58
+ type FallbackToUntypedListener<T> = [T] extends [never]
59
+ ? (...args: any[]) => void | Promise<void>
60
+ : T;
61
+
62
+ /**
63
+ * Strictly typed version of an `EventEmitter`. A `TypedEventEmitter` takes type
64
+ * parameters for mappings of event names to event data types, and strictly
65
+ * types method calls to the `EventEmitter` according to these event maps.
66
+ *
67
+ * @typeParam ListenEvents - `EventsMap` of user-defined events that can be
68
+ * listened to with `on` or `once`
69
+ * @typeParam EmitEvents - `EventsMap` of user-defined events that can be
70
+ * emitted with `emit`
71
+ * @typeParam ReservedEvents - `EventsMap` of reserved events, that can be
72
+ * emitted by socket.io with `emitReserved`, and can be listened to with
73
+ * `listen`.
74
+ */
75
+ export class Emitter<
76
+ ListenEvents extends EventsMap,
77
+ EmitEvents extends EventsMap,
78
+ ReservedEvents extends EventsMap = {}
79
+ > {
80
+ /**
81
+ * Adds the `listener` function as an event listener for `ev`.
82
+ *
83
+ * @param ev Name of the event
84
+ * @param listener Callback function
85
+ */
86
+ on<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
87
+ ev: Ev,
88
+ listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
89
+ ): this;
90
+
91
+ /**
92
+ * Adds a one-time `listener` function as an event listener for `ev`.
93
+ *
94
+ * @param ev Name of the event
95
+ * @param listener Callback function
96
+ */
97
+ once<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
98
+ ev: Ev,
99
+ listener: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
100
+ ): this;
101
+
102
+ /**
103
+ * Removes the `listener` function as an event listener for `ev`.
104
+ *
105
+ * @param ev Name of the event
106
+ * @param listener Callback function
107
+ */
108
+ off<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
109
+ ev?: Ev,
110
+ listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
111
+ ): this;
112
+
113
+ /**
114
+ * Emits an event.
115
+ *
116
+ * @param ev Name of the event
117
+ * @param args Values to send to listeners of this event
118
+ */
119
+ emit<Ev extends EventNames<EmitEvents>>(
120
+ ev: Ev,
121
+ ...args: EventParams<EmitEvents, Ev>
122
+ ): this;
123
+
124
+ /**
125
+ * Emits a reserved event.
126
+ *
127
+ * This method is `protected`, so that only a class extending
128
+ * `StrictEventEmitter` can emit its own reserved events.
129
+ *
130
+ * @param ev Reserved event name
131
+ * @param args Arguments to emit along with the event
132
+ */
133
+ protected emitReserved<Ev extends EventNames<ReservedEvents>>(
134
+ ev: Ev,
135
+ ...args: EventParams<ReservedEvents, Ev>
136
+ ): this;
137
+
138
+ /**
139
+ * Returns the listeners listening to an event.
140
+ *
141
+ * @param event Event name
142
+ * @returns Array of listeners subscribed to `event`
143
+ */
144
+ listeners<Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>>(
145
+ event: Ev
146
+ ): ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>[];
147
+
148
+ /**
149
+ * Returns true if there is a listener for this event.
150
+ *
151
+ * @param event Event name
152
+ * @returns boolean
153
+ */
154
+ hasListeners<
155
+ Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
156
+ >(event: Ev): boolean;
157
+
158
+ /**
159
+ * Removes the `listener` function as an event listener for `ev`.
160
+ *
161
+ * @param ev Name of the event
162
+ * @param listener Callback function
163
+ */
164
+ removeListener<
165
+ Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
166
+ >(
167
+ ev?: Ev,
168
+ listener?: ReservedOrUserListener<ReservedEvents, ListenEvents, Ev>
169
+ ): this;
170
+
171
+ /**
172
+ * Removes all `listener` function as an event listener for `ev`.
173
+ *
174
+ * @param ev Name of the event
175
+ */
176
+ removeAllListeners<
177
+ Ev extends ReservedOrUserEventNames<ReservedEvents, ListenEvents>
178
+ >(ev?: Ev): this;
179
+ }