trimprompt 1.0.3 → 1.0.4

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 (1020) hide show
  1. package/cli.js +2 -0
  2. package/dashboard.js +1 -0
  3. package/executor.js +1 -0
  4. package/filters/generic.js +1 -0
  5. package/filters/git.js +1 -0
  6. package/filters/index.js +1 -0
  7. package/filters/js.js +1 -0
  8. package/filters/python.js +1 -0
  9. package/mcp.js +1 -0
  10. package/package.json +21 -29
  11. package/redactor.js +1 -0
  12. package/seed.js +1 -0
  13. package/shims.js +1 -0
  14. package/simulate.js +1 -0
  15. package/sync.js +1 -0
  16. package/tracker.js +1 -0
  17. package/.claude/settings.local.json +0 -7
  18. package/aicg-spec/README.md +0 -55
  19. package/aicg-spec/architecture.md +0 -263
  20. package/aicg-spec/dsl-spec.md +0 -109
  21. package/aicg-spec/insights/cargo.md +0 -46
  22. package/aicg-spec/insights/cloud_cli.md +0 -38
  23. package/aicg-spec/insights/docker_k8s.md +0 -45
  24. package/aicg-spec/insights/generic.md +0 -62
  25. package/aicg-spec/insights/git.md +0 -85
  26. package/aicg-spec/insights/js.md +0 -74
  27. package/aicg-spec/insights/python.md +0 -86
  28. package/aicg-spec/integrations/claude.md +0 -57
  29. package/aicg-spec/integrations/copilot.md +0 -69
  30. package/aicg-spec/integrations/cursor.md +0 -59
  31. package/aicg-spec/rules.yaml +0 -555
  32. package/aicg-spec/schema.md +0 -93
  33. package/aicg-spec/ui-spec.md +0 -135
  34. package/client/dist/cli.js +0 -256
  35. package/client/dist/dashboard.js +0 -102
  36. package/client/dist/executor.js +0 -80
  37. package/client/dist/filters/generic.js +0 -58
  38. package/client/dist/filters/git.js +0 -157
  39. package/client/dist/filters/index.js +0 -83
  40. package/client/dist/filters/js.js +0 -78
  41. package/client/dist/filters/python.js +0 -130
  42. package/client/dist/mcp.js +0 -90
  43. package/client/dist/redactor.js +0 -42
  44. package/client/dist/seed.js +0 -11
  45. package/client/dist/shims.js +0 -169
  46. package/client/dist/simulate.js +0 -76
  47. package/client/dist/sync.js +0 -237
  48. package/client/dist/tracker.js +0 -247
  49. package/client/node_modules/.bin/is-docker +0 -16
  50. package/client/node_modules/.bin/is-docker.cmd +0 -17
  51. package/client/node_modules/.bin/is-docker.ps1 +0 -28
  52. package/client/node_modules/.bin/mime +0 -16
  53. package/client/node_modules/.bin/mime.cmd +0 -17
  54. package/client/node_modules/.bin/mime.ps1 +0 -28
  55. package/client/node_modules/.bin/tsc +0 -16
  56. package/client/node_modules/.bin/tsc.cmd +0 -17
  57. package/client/node_modules/.bin/tsc.ps1 +0 -28
  58. package/client/node_modules/.bin/tsserver +0 -16
  59. package/client/node_modules/.bin/tsserver.cmd +0 -17
  60. package/client/node_modules/.bin/tsserver.ps1 +0 -28
  61. package/client/node_modules/.package-lock.json +0 -934
  62. package/client/node_modules/@types/body-parser/LICENSE +0 -21
  63. package/client/node_modules/@types/body-parser/README.md +0 -15
  64. package/client/node_modules/@types/body-parser/index.d.ts +0 -95
  65. package/client/node_modules/@types/body-parser/package.json +0 -64
  66. package/client/node_modules/@types/connect/LICENSE +0 -21
  67. package/client/node_modules/@types/connect/README.md +0 -15
  68. package/client/node_modules/@types/connect/index.d.ts +0 -91
  69. package/client/node_modules/@types/connect/package.json +0 -32
  70. package/client/node_modules/@types/express/LICENSE +0 -21
  71. package/client/node_modules/@types/express/README.md +0 -15
  72. package/client/node_modules/@types/express/index.d.ts +0 -128
  73. package/client/node_modules/@types/express/package.json +0 -46
  74. package/client/node_modules/@types/express-serve-static-core/LICENSE +0 -21
  75. package/client/node_modules/@types/express-serve-static-core/README.md +0 -15
  76. package/client/node_modules/@types/express-serve-static-core/index.d.ts +0 -1281
  77. package/client/node_modules/@types/express-serve-static-core/package.json +0 -51
  78. package/client/node_modules/@types/http-errors/LICENSE +0 -21
  79. package/client/node_modules/@types/http-errors/README.md +0 -15
  80. package/client/node_modules/@types/http-errors/index.d.ts +0 -77
  81. package/client/node_modules/@types/http-errors/package.json +0 -36
  82. package/client/node_modules/@types/mime/LICENSE +0 -21
  83. package/client/node_modules/@types/mime/Mime.d.ts +0 -10
  84. package/client/node_modules/@types/mime/README.md +0 -15
  85. package/client/node_modules/@types/mime/index.d.ts +0 -31
  86. package/client/node_modules/@types/mime/lite.d.ts +0 -7
  87. package/client/node_modules/@types/mime/package.json +0 -30
  88. package/client/node_modules/@types/node/LICENSE +0 -21
  89. package/client/node_modules/@types/node/README.md +0 -15
  90. package/client/node_modules/@types/node/assert/strict.d.ts +0 -8
  91. package/client/node_modules/@types/node/assert.d.ts +0 -1062
  92. package/client/node_modules/@types/node/async_hooks.d.ts +0 -605
  93. package/client/node_modules/@types/node/buffer.buffer.d.ts +0 -471
  94. package/client/node_modules/@types/node/buffer.d.ts +0 -1936
  95. package/client/node_modules/@types/node/child_process.d.ts +0 -1475
  96. package/client/node_modules/@types/node/cluster.d.ts +0 -577
  97. package/client/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  98. package/client/node_modules/@types/node/compatibility/index.d.ts +0 -9
  99. package/client/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
  100. package/client/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  101. package/client/node_modules/@types/node/console.d.ts +0 -452
  102. package/client/node_modules/@types/node/constants.d.ts +0 -21
  103. package/client/node_modules/@types/node/crypto.d.ts +0 -4590
  104. package/client/node_modules/@types/node/dgram.d.ts +0 -597
  105. package/client/node_modules/@types/node/diagnostics_channel.d.ts +0 -578
  106. package/client/node_modules/@types/node/dns/promises.d.ts +0 -479
  107. package/client/node_modules/@types/node/dns.d.ts +0 -871
  108. package/client/node_modules/@types/node/domain.d.ts +0 -170
  109. package/client/node_modules/@types/node/events.d.ts +0 -977
  110. package/client/node_modules/@types/node/fs/promises.d.ts +0 -1270
  111. package/client/node_modules/@types/node/fs.d.ts +0 -4375
  112. package/client/node_modules/@types/node/globals.d.ts +0 -172
  113. package/client/node_modules/@types/node/globals.typedarray.d.ts +0 -38
  114. package/client/node_modules/@types/node/http.d.ts +0 -2049
  115. package/client/node_modules/@types/node/http2.d.ts +0 -2712
  116. package/client/node_modules/@types/node/https.d.ts +0 -578
  117. package/client/node_modules/@types/node/index.d.ts +0 -93
  118. package/client/node_modules/@types/node/inspector.generated.d.ts +0 -3966
  119. package/client/node_modules/@types/node/module.d.ts +0 -539
  120. package/client/node_modules/@types/node/net.d.ts +0 -1031
  121. package/client/node_modules/@types/node/os.d.ts +0 -506
  122. package/client/node_modules/@types/node/package.json +0 -140
  123. package/client/node_modules/@types/node/path.d.ts +0 -200
  124. package/client/node_modules/@types/node/perf_hooks.d.ts +0 -961
  125. package/client/node_modules/@types/node/process.d.ts +0 -1961
  126. package/client/node_modules/@types/node/punycode.d.ts +0 -117
  127. package/client/node_modules/@types/node/querystring.d.ts +0 -152
  128. package/client/node_modules/@types/node/readline/promises.d.ts +0 -162
  129. package/client/node_modules/@types/node/readline.d.ts +0 -589
  130. package/client/node_modules/@types/node/repl.d.ts +0 -430
  131. package/client/node_modules/@types/node/sea.d.ts +0 -153
  132. package/client/node_modules/@types/node/stream/consumers.d.ts +0 -38
  133. package/client/node_modules/@types/node/stream/promises.d.ts +0 -90
  134. package/client/node_modules/@types/node/stream/web.d.ts +0 -533
  135. package/client/node_modules/@types/node/stream.d.ts +0 -1698
  136. package/client/node_modules/@types/node/string_decoder.d.ts +0 -67
  137. package/client/node_modules/@types/node/test.d.ts +0 -1787
  138. package/client/node_modules/@types/node/timers/promises.d.ts +0 -108
  139. package/client/node_modules/@types/node/timers.d.ts +0 -286
  140. package/client/node_modules/@types/node/tls.d.ts +0 -1259
  141. package/client/node_modules/@types/node/trace_events.d.ts +0 -197
  142. package/client/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -468
  143. package/client/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -34
  144. package/client/node_modules/@types/node/ts5.6/index.d.ts +0 -93
  145. package/client/node_modules/@types/node/tty.d.ts +0 -208
  146. package/client/node_modules/@types/node/url.d.ts +0 -964
  147. package/client/node_modules/@types/node/util.d.ts +0 -2331
  148. package/client/node_modules/@types/node/v8.d.ts +0 -809
  149. package/client/node_modules/@types/node/vm.d.ts +0 -1001
  150. package/client/node_modules/@types/node/wasi.d.ts +0 -181
  151. package/client/node_modules/@types/node/web-globals/abortcontroller.d.ts +0 -34
  152. package/client/node_modules/@types/node/web-globals/domexception.d.ts +0 -68
  153. package/client/node_modules/@types/node/web-globals/events.d.ts +0 -97
  154. package/client/node_modules/@types/node/web-globals/fetch.d.ts +0 -55
  155. package/client/node_modules/@types/node/worker_threads.d.ts +0 -715
  156. package/client/node_modules/@types/node/zlib.d.ts +0 -598
  157. package/client/node_modules/@types/qs/LICENSE +0 -21
  158. package/client/node_modules/@types/qs/README.md +0 -15
  159. package/client/node_modules/@types/qs/index.d.ts +0 -83
  160. package/client/node_modules/@types/qs/package.json +0 -66
  161. package/client/node_modules/@types/range-parser/LICENSE +0 -21
  162. package/client/node_modules/@types/range-parser/README.md +0 -53
  163. package/client/node_modules/@types/range-parser/index.d.ts +0 -34
  164. package/client/node_modules/@types/range-parser/package.json +0 -25
  165. package/client/node_modules/@types/send/LICENSE +0 -21
  166. package/client/node_modules/@types/send/README.md +0 -15
  167. package/client/node_modules/@types/send/index.d.ts +0 -187
  168. package/client/node_modules/@types/send/package.json +0 -38
  169. package/client/node_modules/@types/serve-static/LICENSE +0 -21
  170. package/client/node_modules/@types/serve-static/README.md +0 -15
  171. package/client/node_modules/@types/serve-static/index.d.ts +0 -107
  172. package/client/node_modules/@types/serve-static/node_modules/@types/send/LICENSE +0 -21
  173. package/client/node_modules/@types/serve-static/node_modules/@types/send/README.md +0 -15
  174. package/client/node_modules/@types/serve-static/node_modules/@types/send/index.d.ts +0 -225
  175. package/client/node_modules/@types/serve-static/node_modules/@types/send/package.json +0 -39
  176. package/client/node_modules/@types/serve-static/package.json +0 -45
  177. package/client/node_modules/accepts/HISTORY.md +0 -243
  178. package/client/node_modules/accepts/LICENSE +0 -23
  179. package/client/node_modules/accepts/README.md +0 -140
  180. package/client/node_modules/accepts/index.js +0 -238
  181. package/client/node_modules/accepts/package.json +0 -47
  182. package/client/node_modules/array-flatten/LICENSE +0 -21
  183. package/client/node_modules/array-flatten/README.md +0 -43
  184. package/client/node_modules/array-flatten/array-flatten.js +0 -64
  185. package/client/node_modules/array-flatten/package.json +0 -39
  186. package/client/node_modules/body-parser/HISTORY.md +0 -686
  187. package/client/node_modules/body-parser/LICENSE +0 -23
  188. package/client/node_modules/body-parser/README.md +0 -476
  189. package/client/node_modules/body-parser/index.js +0 -156
  190. package/client/node_modules/body-parser/lib/read.js +0 -205
  191. package/client/node_modules/body-parser/lib/types/json.js +0 -243
  192. package/client/node_modules/body-parser/lib/types/raw.js +0 -101
  193. package/client/node_modules/body-parser/lib/types/text.js +0 -121
  194. package/client/node_modules/body-parser/lib/types/urlencoded.js +0 -299
  195. package/client/node_modules/body-parser/package.json +0 -55
  196. package/client/node_modules/bytes/History.md +0 -97
  197. package/client/node_modules/bytes/LICENSE +0 -23
  198. package/client/node_modules/bytes/Readme.md +0 -152
  199. package/client/node_modules/bytes/index.js +0 -170
  200. package/client/node_modules/bytes/package.json +0 -42
  201. package/client/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
  202. package/client/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
  203. package/client/node_modules/call-bind-apply-helpers/.nycrc +0 -9
  204. package/client/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
  205. package/client/node_modules/call-bind-apply-helpers/LICENSE +0 -21
  206. package/client/node_modules/call-bind-apply-helpers/README.md +0 -62
  207. package/client/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
  208. package/client/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
  209. package/client/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
  210. package/client/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
  211. package/client/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
  212. package/client/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
  213. package/client/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
  214. package/client/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
  215. package/client/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
  216. package/client/node_modules/call-bind-apply-helpers/index.js +0 -15
  217. package/client/node_modules/call-bind-apply-helpers/package.json +0 -85
  218. package/client/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
  219. package/client/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
  220. package/client/node_modules/call-bind-apply-helpers/test/index.js +0 -63
  221. package/client/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
  222. package/client/node_modules/call-bound/.eslintrc +0 -13
  223. package/client/node_modules/call-bound/.github/FUNDING.yml +0 -12
  224. package/client/node_modules/call-bound/.nycrc +0 -9
  225. package/client/node_modules/call-bound/CHANGELOG.md +0 -42
  226. package/client/node_modules/call-bound/LICENSE +0 -21
  227. package/client/node_modules/call-bound/README.md +0 -53
  228. package/client/node_modules/call-bound/index.d.ts +0 -94
  229. package/client/node_modules/call-bound/index.js +0 -19
  230. package/client/node_modules/call-bound/package.json +0 -99
  231. package/client/node_modules/call-bound/test/index.js +0 -61
  232. package/client/node_modules/call-bound/tsconfig.json +0 -10
  233. package/client/node_modules/commander/LICENSE +0 -22
  234. package/client/node_modules/commander/Readme.md +0 -1148
  235. package/client/node_modules/commander/esm.mjs +0 -16
  236. package/client/node_modules/commander/index.js +0 -26
  237. package/client/node_modules/commander/lib/argument.js +0 -145
  238. package/client/node_modules/commander/lib/command.js +0 -2179
  239. package/client/node_modules/commander/lib/error.js +0 -43
  240. package/client/node_modules/commander/lib/help.js +0 -462
  241. package/client/node_modules/commander/lib/option.js +0 -329
  242. package/client/node_modules/commander/lib/suggestSimilar.js +0 -100
  243. package/client/node_modules/commander/package-support.json +0 -16
  244. package/client/node_modules/commander/package.json +0 -80
  245. package/client/node_modules/commander/typings/esm.d.mts +0 -3
  246. package/client/node_modules/commander/typings/index.d.ts +0 -884
  247. package/client/node_modules/content-disposition/HISTORY.md +0 -60
  248. package/client/node_modules/content-disposition/LICENSE +0 -22
  249. package/client/node_modules/content-disposition/README.md +0 -142
  250. package/client/node_modules/content-disposition/index.js +0 -458
  251. package/client/node_modules/content-disposition/package.json +0 -44
  252. package/client/node_modules/content-type/HISTORY.md +0 -29
  253. package/client/node_modules/content-type/LICENSE +0 -22
  254. package/client/node_modules/content-type/README.md +0 -94
  255. package/client/node_modules/content-type/index.js +0 -225
  256. package/client/node_modules/content-type/package.json +0 -42
  257. package/client/node_modules/cookie/LICENSE +0 -24
  258. package/client/node_modules/cookie/README.md +0 -317
  259. package/client/node_modules/cookie/SECURITY.md +0 -25
  260. package/client/node_modules/cookie/index.js +0 -335
  261. package/client/node_modules/cookie/package.json +0 -44
  262. package/client/node_modules/cookie-signature/History.md +0 -42
  263. package/client/node_modules/cookie-signature/Readme.md +0 -42
  264. package/client/node_modules/cookie-signature/index.js +0 -51
  265. package/client/node_modules/cookie-signature/package.json +0 -18
  266. package/client/node_modules/debug/.coveralls.yml +0 -1
  267. package/client/node_modules/debug/.eslintrc +0 -11
  268. package/client/node_modules/debug/.travis.yml +0 -14
  269. package/client/node_modules/debug/CHANGELOG.md +0 -362
  270. package/client/node_modules/debug/LICENSE +0 -19
  271. package/client/node_modules/debug/Makefile +0 -50
  272. package/client/node_modules/debug/README.md +0 -312
  273. package/client/node_modules/debug/component.json +0 -19
  274. package/client/node_modules/debug/karma.conf.js +0 -70
  275. package/client/node_modules/debug/node.js +0 -1
  276. package/client/node_modules/debug/package.json +0 -49
  277. package/client/node_modules/debug/src/browser.js +0 -185
  278. package/client/node_modules/debug/src/debug.js +0 -202
  279. package/client/node_modules/debug/src/index.js +0 -10
  280. package/client/node_modules/debug/src/inspector-log.js +0 -15
  281. package/client/node_modules/debug/src/node.js +0 -248
  282. package/client/node_modules/define-lazy-prop/index.d.ts +0 -33
  283. package/client/node_modules/define-lazy-prop/index.js +0 -19
  284. package/client/node_modules/define-lazy-prop/license +0 -9
  285. package/client/node_modules/define-lazy-prop/package.json +0 -48
  286. package/client/node_modules/define-lazy-prop/readme.md +0 -64
  287. package/client/node_modules/depd/History.md +0 -103
  288. package/client/node_modules/depd/LICENSE +0 -22
  289. package/client/node_modules/depd/Readme.md +0 -280
  290. package/client/node_modules/depd/index.js +0 -538
  291. package/client/node_modules/depd/lib/browser/index.js +0 -77
  292. package/client/node_modules/depd/package.json +0 -45
  293. package/client/node_modules/destroy/LICENSE +0 -23
  294. package/client/node_modules/destroy/README.md +0 -63
  295. package/client/node_modules/destroy/index.js +0 -209
  296. package/client/node_modules/destroy/package.json +0 -48
  297. package/client/node_modules/dunder-proto/.eslintrc +0 -5
  298. package/client/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
  299. package/client/node_modules/dunder-proto/.nycrc +0 -13
  300. package/client/node_modules/dunder-proto/CHANGELOG.md +0 -24
  301. package/client/node_modules/dunder-proto/LICENSE +0 -21
  302. package/client/node_modules/dunder-proto/README.md +0 -54
  303. package/client/node_modules/dunder-proto/get.d.ts +0 -5
  304. package/client/node_modules/dunder-proto/get.js +0 -30
  305. package/client/node_modules/dunder-proto/package.json +0 -76
  306. package/client/node_modules/dunder-proto/set.d.ts +0 -5
  307. package/client/node_modules/dunder-proto/set.js +0 -35
  308. package/client/node_modules/dunder-proto/test/get.js +0 -34
  309. package/client/node_modules/dunder-proto/test/index.js +0 -4
  310. package/client/node_modules/dunder-proto/test/set.js +0 -50
  311. package/client/node_modules/dunder-proto/tsconfig.json +0 -9
  312. package/client/node_modules/ee-first/LICENSE +0 -22
  313. package/client/node_modules/ee-first/README.md +0 -80
  314. package/client/node_modules/ee-first/index.js +0 -95
  315. package/client/node_modules/ee-first/package.json +0 -29
  316. package/client/node_modules/encodeurl/LICENSE +0 -22
  317. package/client/node_modules/encodeurl/README.md +0 -109
  318. package/client/node_modules/encodeurl/index.js +0 -60
  319. package/client/node_modules/encodeurl/package.json +0 -40
  320. package/client/node_modules/es-define-property/.eslintrc +0 -13
  321. package/client/node_modules/es-define-property/.github/FUNDING.yml +0 -12
  322. package/client/node_modules/es-define-property/.nycrc +0 -9
  323. package/client/node_modules/es-define-property/CHANGELOG.md +0 -29
  324. package/client/node_modules/es-define-property/LICENSE +0 -21
  325. package/client/node_modules/es-define-property/README.md +0 -49
  326. package/client/node_modules/es-define-property/index.d.ts +0 -3
  327. package/client/node_modules/es-define-property/index.js +0 -14
  328. package/client/node_modules/es-define-property/package.json +0 -81
  329. package/client/node_modules/es-define-property/test/index.js +0 -56
  330. package/client/node_modules/es-define-property/tsconfig.json +0 -10
  331. package/client/node_modules/es-errors/.eslintrc +0 -5
  332. package/client/node_modules/es-errors/.github/FUNDING.yml +0 -12
  333. package/client/node_modules/es-errors/CHANGELOG.md +0 -40
  334. package/client/node_modules/es-errors/LICENSE +0 -21
  335. package/client/node_modules/es-errors/README.md +0 -55
  336. package/client/node_modules/es-errors/eval.d.ts +0 -3
  337. package/client/node_modules/es-errors/eval.js +0 -4
  338. package/client/node_modules/es-errors/index.d.ts +0 -3
  339. package/client/node_modules/es-errors/index.js +0 -4
  340. package/client/node_modules/es-errors/package.json +0 -80
  341. package/client/node_modules/es-errors/range.d.ts +0 -3
  342. package/client/node_modules/es-errors/range.js +0 -4
  343. package/client/node_modules/es-errors/ref.d.ts +0 -3
  344. package/client/node_modules/es-errors/ref.js +0 -4
  345. package/client/node_modules/es-errors/syntax.d.ts +0 -3
  346. package/client/node_modules/es-errors/syntax.js +0 -4
  347. package/client/node_modules/es-errors/test/index.js +0 -19
  348. package/client/node_modules/es-errors/tsconfig.json +0 -49
  349. package/client/node_modules/es-errors/type.d.ts +0 -3
  350. package/client/node_modules/es-errors/type.js +0 -4
  351. package/client/node_modules/es-errors/uri.d.ts +0 -3
  352. package/client/node_modules/es-errors/uri.js +0 -4
  353. package/client/node_modules/es-object-atoms/.eslintrc +0 -16
  354. package/client/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
  355. package/client/node_modules/es-object-atoms/CHANGELOG.md +0 -44
  356. package/client/node_modules/es-object-atoms/LICENSE +0 -21
  357. package/client/node_modules/es-object-atoms/README.md +0 -63
  358. package/client/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
  359. package/client/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
  360. package/client/node_modules/es-object-atoms/ToObject.d.ts +0 -7
  361. package/client/node_modules/es-object-atoms/ToObject.js +0 -10
  362. package/client/node_modules/es-object-atoms/index.d.ts +0 -3
  363. package/client/node_modules/es-object-atoms/index.js +0 -4
  364. package/client/node_modules/es-object-atoms/isObject.d.ts +0 -3
  365. package/client/node_modules/es-object-atoms/isObject.js +0 -6
  366. package/client/node_modules/es-object-atoms/package.json +0 -79
  367. package/client/node_modules/es-object-atoms/test/index.js +0 -38
  368. package/client/node_modules/es-object-atoms/tsconfig.json +0 -7
  369. package/client/node_modules/escape-html/LICENSE +0 -24
  370. package/client/node_modules/escape-html/Readme.md +0 -43
  371. package/client/node_modules/escape-html/index.js +0 -78
  372. package/client/node_modules/escape-html/package.json +0 -24
  373. package/client/node_modules/etag/HISTORY.md +0 -83
  374. package/client/node_modules/etag/LICENSE +0 -22
  375. package/client/node_modules/etag/README.md +0 -159
  376. package/client/node_modules/etag/index.js +0 -131
  377. package/client/node_modules/etag/package.json +0 -47
  378. package/client/node_modules/express/History.md +0 -3676
  379. package/client/node_modules/express/LICENSE +0 -24
  380. package/client/node_modules/express/Readme.md +0 -260
  381. package/client/node_modules/express/index.js +0 -11
  382. package/client/node_modules/express/lib/application.js +0 -661
  383. package/client/node_modules/express/lib/express.js +0 -116
  384. package/client/node_modules/express/lib/middleware/init.js +0 -43
  385. package/client/node_modules/express/lib/middleware/query.js +0 -47
  386. package/client/node_modules/express/lib/request.js +0 -525
  387. package/client/node_modules/express/lib/response.js +0 -1179
  388. package/client/node_modules/express/lib/router/index.js +0 -673
  389. package/client/node_modules/express/lib/router/layer.js +0 -181
  390. package/client/node_modules/express/lib/router/route.js +0 -230
  391. package/client/node_modules/express/lib/utils.js +0 -304
  392. package/client/node_modules/express/lib/view.js +0 -182
  393. package/client/node_modules/express/package.json +0 -102
  394. package/client/node_modules/finalhandler/HISTORY.md +0 -216
  395. package/client/node_modules/finalhandler/LICENSE +0 -22
  396. package/client/node_modules/finalhandler/README.md +0 -147
  397. package/client/node_modules/finalhandler/SECURITY.md +0 -25
  398. package/client/node_modules/finalhandler/index.js +0 -341
  399. package/client/node_modules/finalhandler/package.json +0 -47
  400. package/client/node_modules/forwarded/HISTORY.md +0 -21
  401. package/client/node_modules/forwarded/LICENSE +0 -22
  402. package/client/node_modules/forwarded/README.md +0 -57
  403. package/client/node_modules/forwarded/index.js +0 -90
  404. package/client/node_modules/forwarded/package.json +0 -45
  405. package/client/node_modules/fresh/HISTORY.md +0 -70
  406. package/client/node_modules/fresh/LICENSE +0 -23
  407. package/client/node_modules/fresh/README.md +0 -119
  408. package/client/node_modules/fresh/index.js +0 -137
  409. package/client/node_modules/fresh/package.json +0 -46
  410. package/client/node_modules/function-bind/.eslintrc +0 -21
  411. package/client/node_modules/function-bind/.github/FUNDING.yml +0 -12
  412. package/client/node_modules/function-bind/.github/SECURITY.md +0 -3
  413. package/client/node_modules/function-bind/.nycrc +0 -13
  414. package/client/node_modules/function-bind/CHANGELOG.md +0 -136
  415. package/client/node_modules/function-bind/LICENSE +0 -20
  416. package/client/node_modules/function-bind/README.md +0 -46
  417. package/client/node_modules/function-bind/implementation.js +0 -84
  418. package/client/node_modules/function-bind/index.js +0 -5
  419. package/client/node_modules/function-bind/package.json +0 -87
  420. package/client/node_modules/function-bind/test/.eslintrc +0 -9
  421. package/client/node_modules/function-bind/test/index.js +0 -252
  422. package/client/node_modules/get-intrinsic/.eslintrc +0 -42
  423. package/client/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
  424. package/client/node_modules/get-intrinsic/.nycrc +0 -9
  425. package/client/node_modules/get-intrinsic/CHANGELOG.md +0 -186
  426. package/client/node_modules/get-intrinsic/LICENSE +0 -21
  427. package/client/node_modules/get-intrinsic/README.md +0 -71
  428. package/client/node_modules/get-intrinsic/index.js +0 -378
  429. package/client/node_modules/get-intrinsic/package.json +0 -97
  430. package/client/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
  431. package/client/node_modules/get-proto/.eslintrc +0 -10
  432. package/client/node_modules/get-proto/.github/FUNDING.yml +0 -12
  433. package/client/node_modules/get-proto/.nycrc +0 -9
  434. package/client/node_modules/get-proto/CHANGELOG.md +0 -21
  435. package/client/node_modules/get-proto/LICENSE +0 -21
  436. package/client/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
  437. package/client/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
  438. package/client/node_modules/get-proto/README.md +0 -50
  439. package/client/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
  440. package/client/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
  441. package/client/node_modules/get-proto/index.d.ts +0 -5
  442. package/client/node_modules/get-proto/index.js +0 -27
  443. package/client/node_modules/get-proto/package.json +0 -81
  444. package/client/node_modules/get-proto/test/index.js +0 -68
  445. package/client/node_modules/get-proto/tsconfig.json +0 -9
  446. package/client/node_modules/gopd/.eslintrc +0 -16
  447. package/client/node_modules/gopd/.github/FUNDING.yml +0 -12
  448. package/client/node_modules/gopd/CHANGELOG.md +0 -45
  449. package/client/node_modules/gopd/LICENSE +0 -21
  450. package/client/node_modules/gopd/README.md +0 -40
  451. package/client/node_modules/gopd/gOPD.d.ts +0 -1
  452. package/client/node_modules/gopd/gOPD.js +0 -4
  453. package/client/node_modules/gopd/index.d.ts +0 -5
  454. package/client/node_modules/gopd/index.js +0 -15
  455. package/client/node_modules/gopd/package.json +0 -77
  456. package/client/node_modules/gopd/test/index.js +0 -36
  457. package/client/node_modules/gopd/tsconfig.json +0 -9
  458. package/client/node_modules/has-symbols/.eslintrc +0 -11
  459. package/client/node_modules/has-symbols/.github/FUNDING.yml +0 -12
  460. package/client/node_modules/has-symbols/.nycrc +0 -9
  461. package/client/node_modules/has-symbols/CHANGELOG.md +0 -91
  462. package/client/node_modules/has-symbols/LICENSE +0 -21
  463. package/client/node_modules/has-symbols/README.md +0 -46
  464. package/client/node_modules/has-symbols/index.d.ts +0 -3
  465. package/client/node_modules/has-symbols/index.js +0 -14
  466. package/client/node_modules/has-symbols/package.json +0 -111
  467. package/client/node_modules/has-symbols/shams.d.ts +0 -3
  468. package/client/node_modules/has-symbols/shams.js +0 -45
  469. package/client/node_modules/has-symbols/test/index.js +0 -22
  470. package/client/node_modules/has-symbols/test/shams/core-js.js +0 -29
  471. package/client/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
  472. package/client/node_modules/has-symbols/test/tests.js +0 -58
  473. package/client/node_modules/has-symbols/tsconfig.json +0 -10
  474. package/client/node_modules/hasown/.github/FUNDING.yml +0 -12
  475. package/client/node_modules/hasown/.nycrc +0 -13
  476. package/client/node_modules/hasown/CHANGELOG.md +0 -58
  477. package/client/node_modules/hasown/LICENSE +0 -21
  478. package/client/node_modules/hasown/README.md +0 -40
  479. package/client/node_modules/hasown/eslint.config.mjs +0 -6
  480. package/client/node_modules/hasown/index.d.ts +0 -3
  481. package/client/node_modules/hasown/index.js +0 -8
  482. package/client/node_modules/hasown/package.json +0 -91
  483. package/client/node_modules/hasown/tsconfig.json +0 -6
  484. package/client/node_modules/http-errors/HISTORY.md +0 -186
  485. package/client/node_modules/http-errors/LICENSE +0 -23
  486. package/client/node_modules/http-errors/README.md +0 -169
  487. package/client/node_modules/http-errors/index.js +0 -290
  488. package/client/node_modules/http-errors/package.json +0 -54
  489. package/client/node_modules/iconv-lite/Changelog.md +0 -162
  490. package/client/node_modules/iconv-lite/LICENSE +0 -21
  491. package/client/node_modules/iconv-lite/README.md +0 -156
  492. package/client/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
  493. package/client/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
  494. package/client/node_modules/iconv-lite/encodings/index.js +0 -22
  495. package/client/node_modules/iconv-lite/encodings/internal.js +0 -188
  496. package/client/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
  497. package/client/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
  498. package/client/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
  499. package/client/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
  500. package/client/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
  501. package/client/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
  502. package/client/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
  503. package/client/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
  504. package/client/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
  505. package/client/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
  506. package/client/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
  507. package/client/node_modules/iconv-lite/encodings/utf16.js +0 -177
  508. package/client/node_modules/iconv-lite/encodings/utf7.js +0 -290
  509. package/client/node_modules/iconv-lite/lib/bom-handling.js +0 -52
  510. package/client/node_modules/iconv-lite/lib/extend-node.js +0 -217
  511. package/client/node_modules/iconv-lite/lib/index.d.ts +0 -24
  512. package/client/node_modules/iconv-lite/lib/index.js +0 -153
  513. package/client/node_modules/iconv-lite/lib/streams.js +0 -121
  514. package/client/node_modules/iconv-lite/package.json +0 -46
  515. package/client/node_modules/inherits/LICENSE +0 -16
  516. package/client/node_modules/inherits/README.md +0 -42
  517. package/client/node_modules/inherits/inherits.js +0 -9
  518. package/client/node_modules/inherits/inherits_browser.js +0 -27
  519. package/client/node_modules/inherits/package.json +0 -29
  520. package/client/node_modules/ipaddr.js/LICENSE +0 -19
  521. package/client/node_modules/ipaddr.js/README.md +0 -233
  522. package/client/node_modules/ipaddr.js/ipaddr.min.js +0 -1
  523. package/client/node_modules/ipaddr.js/lib/ipaddr.js +0 -673
  524. package/client/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +0 -68
  525. package/client/node_modules/ipaddr.js/package.json +0 -35
  526. package/client/node_modules/is-docker/cli.js +0 -5
  527. package/client/node_modules/is-docker/index.d.ts +0 -15
  528. package/client/node_modules/is-docker/index.js +0 -29
  529. package/client/node_modules/is-docker/license +0 -9
  530. package/client/node_modules/is-docker/package.json +0 -42
  531. package/client/node_modules/is-docker/readme.md +0 -27
  532. package/client/node_modules/is-wsl/index.d.ts +0 -15
  533. package/client/node_modules/is-wsl/index.js +0 -31
  534. package/client/node_modules/is-wsl/license +0 -9
  535. package/client/node_modules/is-wsl/package.json +0 -45
  536. package/client/node_modules/is-wsl/readme.md +0 -36
  537. package/client/node_modules/math-intrinsics/.eslintrc +0 -16
  538. package/client/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
  539. package/client/node_modules/math-intrinsics/CHANGELOG.md +0 -24
  540. package/client/node_modules/math-intrinsics/LICENSE +0 -21
  541. package/client/node_modules/math-intrinsics/README.md +0 -50
  542. package/client/node_modules/math-intrinsics/abs.d.ts +0 -1
  543. package/client/node_modules/math-intrinsics/abs.js +0 -4
  544. package/client/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
  545. package/client/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
  546. package/client/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
  547. package/client/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
  548. package/client/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
  549. package/client/node_modules/math-intrinsics/constants/maxValue.js +0 -5
  550. package/client/node_modules/math-intrinsics/floor.d.ts +0 -1
  551. package/client/node_modules/math-intrinsics/floor.js +0 -4
  552. package/client/node_modules/math-intrinsics/isFinite.d.ts +0 -3
  553. package/client/node_modules/math-intrinsics/isFinite.js +0 -12
  554. package/client/node_modules/math-intrinsics/isInteger.d.ts +0 -3
  555. package/client/node_modules/math-intrinsics/isInteger.js +0 -16
  556. package/client/node_modules/math-intrinsics/isNaN.d.ts +0 -1
  557. package/client/node_modules/math-intrinsics/isNaN.js +0 -6
  558. package/client/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
  559. package/client/node_modules/math-intrinsics/isNegativeZero.js +0 -6
  560. package/client/node_modules/math-intrinsics/max.d.ts +0 -1
  561. package/client/node_modules/math-intrinsics/max.js +0 -4
  562. package/client/node_modules/math-intrinsics/min.d.ts +0 -1
  563. package/client/node_modules/math-intrinsics/min.js +0 -4
  564. package/client/node_modules/math-intrinsics/mod.d.ts +0 -3
  565. package/client/node_modules/math-intrinsics/mod.js +0 -9
  566. package/client/node_modules/math-intrinsics/package.json +0 -86
  567. package/client/node_modules/math-intrinsics/pow.d.ts +0 -1
  568. package/client/node_modules/math-intrinsics/pow.js +0 -4
  569. package/client/node_modules/math-intrinsics/round.d.ts +0 -1
  570. package/client/node_modules/math-intrinsics/round.js +0 -4
  571. package/client/node_modules/math-intrinsics/sign.d.ts +0 -3
  572. package/client/node_modules/math-intrinsics/sign.js +0 -11
  573. package/client/node_modules/math-intrinsics/test/index.js +0 -192
  574. package/client/node_modules/math-intrinsics/tsconfig.json +0 -3
  575. package/client/node_modules/media-typer/HISTORY.md +0 -22
  576. package/client/node_modules/media-typer/LICENSE +0 -22
  577. package/client/node_modules/media-typer/README.md +0 -81
  578. package/client/node_modules/media-typer/index.js +0 -270
  579. package/client/node_modules/media-typer/package.json +0 -26
  580. package/client/node_modules/merge-descriptors/HISTORY.md +0 -21
  581. package/client/node_modules/merge-descriptors/LICENSE +0 -23
  582. package/client/node_modules/merge-descriptors/README.md +0 -49
  583. package/client/node_modules/merge-descriptors/index.js +0 -60
  584. package/client/node_modules/merge-descriptors/package.json +0 -39
  585. package/client/node_modules/methods/HISTORY.md +0 -29
  586. package/client/node_modules/methods/LICENSE +0 -24
  587. package/client/node_modules/methods/README.md +0 -51
  588. package/client/node_modules/methods/index.js +0 -69
  589. package/client/node_modules/methods/package.json +0 -36
  590. package/client/node_modules/mime/CHANGELOG.md +0 -164
  591. package/client/node_modules/mime/LICENSE +0 -21
  592. package/client/node_modules/mime/README.md +0 -90
  593. package/client/node_modules/mime/cli.js +0 -8
  594. package/client/node_modules/mime/mime.js +0 -108
  595. package/client/node_modules/mime/package.json +0 -44
  596. package/client/node_modules/mime/src/build.js +0 -53
  597. package/client/node_modules/mime/src/test.js +0 -60
  598. package/client/node_modules/mime/types.json +0 -1
  599. package/client/node_modules/mime-db/HISTORY.md +0 -507
  600. package/client/node_modules/mime-db/LICENSE +0 -23
  601. package/client/node_modules/mime-db/README.md +0 -100
  602. package/client/node_modules/mime-db/db.json +0 -8519
  603. package/client/node_modules/mime-db/index.js +0 -12
  604. package/client/node_modules/mime-db/package.json +0 -60
  605. package/client/node_modules/mime-types/HISTORY.md +0 -397
  606. package/client/node_modules/mime-types/LICENSE +0 -23
  607. package/client/node_modules/mime-types/README.md +0 -113
  608. package/client/node_modules/mime-types/index.js +0 -188
  609. package/client/node_modules/mime-types/package.json +0 -44
  610. package/client/node_modules/ms/index.js +0 -152
  611. package/client/node_modules/ms/license.md +0 -21
  612. package/client/node_modules/ms/package.json +0 -37
  613. package/client/node_modules/ms/readme.md +0 -51
  614. package/client/node_modules/negotiator/HISTORY.md +0 -108
  615. package/client/node_modules/negotiator/LICENSE +0 -24
  616. package/client/node_modules/negotiator/README.md +0 -203
  617. package/client/node_modules/negotiator/index.js +0 -82
  618. package/client/node_modules/negotiator/lib/charset.js +0 -169
  619. package/client/node_modules/negotiator/lib/encoding.js +0 -184
  620. package/client/node_modules/negotiator/lib/language.js +0 -179
  621. package/client/node_modules/negotiator/lib/mediaType.js +0 -294
  622. package/client/node_modules/negotiator/package.json +0 -42
  623. package/client/node_modules/object-inspect/.eslintrc +0 -53
  624. package/client/node_modules/object-inspect/.github/FUNDING.yml +0 -12
  625. package/client/node_modules/object-inspect/.nycrc +0 -13
  626. package/client/node_modules/object-inspect/CHANGELOG.md +0 -424
  627. package/client/node_modules/object-inspect/LICENSE +0 -21
  628. package/client/node_modules/object-inspect/example/all.js +0 -23
  629. package/client/node_modules/object-inspect/example/circular.js +0 -6
  630. package/client/node_modules/object-inspect/example/fn.js +0 -5
  631. package/client/node_modules/object-inspect/example/inspect.js +0 -10
  632. package/client/node_modules/object-inspect/index.js +0 -544
  633. package/client/node_modules/object-inspect/package-support.json +0 -20
  634. package/client/node_modules/object-inspect/package.json +0 -105
  635. package/client/node_modules/object-inspect/readme.markdown +0 -84
  636. package/client/node_modules/object-inspect/test/bigint.js +0 -58
  637. package/client/node_modules/object-inspect/test/browser/dom.js +0 -15
  638. package/client/node_modules/object-inspect/test/circular.js +0 -16
  639. package/client/node_modules/object-inspect/test/deep.js +0 -12
  640. package/client/node_modules/object-inspect/test/element.js +0 -53
  641. package/client/node_modules/object-inspect/test/err.js +0 -48
  642. package/client/node_modules/object-inspect/test/fakes.js +0 -29
  643. package/client/node_modules/object-inspect/test/fn.js +0 -76
  644. package/client/node_modules/object-inspect/test/global.js +0 -17
  645. package/client/node_modules/object-inspect/test/has.js +0 -15
  646. package/client/node_modules/object-inspect/test/holes.js +0 -15
  647. package/client/node_modules/object-inspect/test/indent-option.js +0 -271
  648. package/client/node_modules/object-inspect/test/inspect.js +0 -139
  649. package/client/node_modules/object-inspect/test/lowbyte.js +0 -12
  650. package/client/node_modules/object-inspect/test/number.js +0 -58
  651. package/client/node_modules/object-inspect/test/quoteStyle.js +0 -26
  652. package/client/node_modules/object-inspect/test/toStringTag.js +0 -40
  653. package/client/node_modules/object-inspect/test/undef.js +0 -12
  654. package/client/node_modules/object-inspect/test/values.js +0 -261
  655. package/client/node_modules/object-inspect/test-core-js.js +0 -26
  656. package/client/node_modules/object-inspect/util.inspect.js +0 -1
  657. package/client/node_modules/on-finished/HISTORY.md +0 -98
  658. package/client/node_modules/on-finished/LICENSE +0 -23
  659. package/client/node_modules/on-finished/README.md +0 -162
  660. package/client/node_modules/on-finished/index.js +0 -234
  661. package/client/node_modules/on-finished/package.json +0 -39
  662. package/client/node_modules/open/index.d.ts +0 -153
  663. package/client/node_modules/open/index.js +0 -334
  664. package/client/node_modules/open/license +0 -9
  665. package/client/node_modules/open/package.json +0 -61
  666. package/client/node_modules/open/readme.md +0 -171
  667. package/client/node_modules/open/xdg-open +0 -1066
  668. package/client/node_modules/parseurl/HISTORY.md +0 -58
  669. package/client/node_modules/parseurl/LICENSE +0 -24
  670. package/client/node_modules/parseurl/README.md +0 -133
  671. package/client/node_modules/parseurl/index.js +0 -158
  672. package/client/node_modules/parseurl/package.json +0 -40
  673. package/client/node_modules/path-to-regexp/LICENSE +0 -21
  674. package/client/node_modules/path-to-regexp/Readme.md +0 -35
  675. package/client/node_modules/path-to-regexp/index.js +0 -158
  676. package/client/node_modules/path-to-regexp/package.json +0 -30
  677. package/client/node_modules/proxy-addr/HISTORY.md +0 -161
  678. package/client/node_modules/proxy-addr/LICENSE +0 -22
  679. package/client/node_modules/proxy-addr/README.md +0 -139
  680. package/client/node_modules/proxy-addr/index.js +0 -327
  681. package/client/node_modules/proxy-addr/package.json +0 -47
  682. package/client/node_modules/qs/.editorconfig +0 -46
  683. package/client/node_modules/qs/.github/FUNDING.yml +0 -12
  684. package/client/node_modules/qs/.github/SECURITY.md +0 -11
  685. package/client/node_modules/qs/.github/THREAT_MODEL.md +0 -78
  686. package/client/node_modules/qs/.nycrc +0 -13
  687. package/client/node_modules/qs/CHANGELOG.md +0 -822
  688. package/client/node_modules/qs/LICENSE.md +0 -29
  689. package/client/node_modules/qs/README.md +0 -758
  690. package/client/node_modules/qs/dist/qs.js +0 -141
  691. package/client/node_modules/qs/eslint.config.mjs +0 -57
  692. package/client/node_modules/qs/lib/formats.js +0 -23
  693. package/client/node_modules/qs/lib/index.js +0 -11
  694. package/client/node_modules/qs/lib/parse.js +0 -403
  695. package/client/node_modules/qs/lib/stringify.js +0 -363
  696. package/client/node_modules/qs/lib/utils.js +0 -342
  697. package/client/node_modules/qs/package.json +0 -94
  698. package/client/node_modules/qs/test/empty-keys-cases.js +0 -267
  699. package/client/node_modules/qs/test/parse.js +0 -1703
  700. package/client/node_modules/qs/test/stringify.js +0 -1448
  701. package/client/node_modules/qs/test/utils.js +0 -432
  702. package/client/node_modules/range-parser/HISTORY.md +0 -56
  703. package/client/node_modules/range-parser/LICENSE +0 -23
  704. package/client/node_modules/range-parser/README.md +0 -84
  705. package/client/node_modules/range-parser/index.js +0 -162
  706. package/client/node_modules/range-parser/package.json +0 -44
  707. package/client/node_modules/raw-body/LICENSE +0 -22
  708. package/client/node_modules/raw-body/README.md +0 -223
  709. package/client/node_modules/raw-body/index.d.ts +0 -87
  710. package/client/node_modules/raw-body/index.js +0 -336
  711. package/client/node_modules/raw-body/package.json +0 -47
  712. package/client/node_modules/safe-buffer/LICENSE +0 -21
  713. package/client/node_modules/safe-buffer/README.md +0 -584
  714. package/client/node_modules/safe-buffer/index.d.ts +0 -187
  715. package/client/node_modules/safe-buffer/index.js +0 -65
  716. package/client/node_modules/safe-buffer/package.json +0 -51
  717. package/client/node_modules/safer-buffer/LICENSE +0 -21
  718. package/client/node_modules/safer-buffer/Porting-Buffer.md +0 -268
  719. package/client/node_modules/safer-buffer/Readme.md +0 -156
  720. package/client/node_modules/safer-buffer/dangerous.js +0 -58
  721. package/client/node_modules/safer-buffer/package.json +0 -34
  722. package/client/node_modules/safer-buffer/safer.js +0 -77
  723. package/client/node_modules/safer-buffer/tests.js +0 -406
  724. package/client/node_modules/send/HISTORY.md +0 -538
  725. package/client/node_modules/send/LICENSE +0 -23
  726. package/client/node_modules/send/README.md +0 -327
  727. package/client/node_modules/send/SECURITY.md +0 -24
  728. package/client/node_modules/send/index.js +0 -1142
  729. package/client/node_modules/send/node_modules/ms/index.js +0 -162
  730. package/client/node_modules/send/node_modules/ms/license.md +0 -21
  731. package/client/node_modules/send/node_modules/ms/package.json +0 -38
  732. package/client/node_modules/send/node_modules/ms/readme.md +0 -59
  733. package/client/node_modules/send/package.json +0 -62
  734. package/client/node_modules/serve-static/HISTORY.md +0 -493
  735. package/client/node_modules/serve-static/LICENSE +0 -25
  736. package/client/node_modules/serve-static/README.md +0 -257
  737. package/client/node_modules/serve-static/index.js +0 -209
  738. package/client/node_modules/serve-static/package.json +0 -42
  739. package/client/node_modules/setprototypeof/LICENSE +0 -13
  740. package/client/node_modules/setprototypeof/README.md +0 -31
  741. package/client/node_modules/setprototypeof/index.d.ts +0 -2
  742. package/client/node_modules/setprototypeof/index.js +0 -17
  743. package/client/node_modules/setprototypeof/package.json +0 -38
  744. package/client/node_modules/setprototypeof/test/index.js +0 -24
  745. package/client/node_modules/side-channel/.editorconfig +0 -9
  746. package/client/node_modules/side-channel/.eslintrc +0 -12
  747. package/client/node_modules/side-channel/.github/FUNDING.yml +0 -12
  748. package/client/node_modules/side-channel/.nycrc +0 -13
  749. package/client/node_modules/side-channel/CHANGELOG.md +0 -120
  750. package/client/node_modules/side-channel/LICENSE +0 -21
  751. package/client/node_modules/side-channel/README.md +0 -61
  752. package/client/node_modules/side-channel/index.d.ts +0 -14
  753. package/client/node_modules/side-channel/index.js +0 -46
  754. package/client/node_modules/side-channel/package.json +0 -85
  755. package/client/node_modules/side-channel/test/index.js +0 -120
  756. package/client/node_modules/side-channel/tsconfig.json +0 -9
  757. package/client/node_modules/side-channel-list/.editorconfig +0 -9
  758. package/client/node_modules/side-channel-list/.eslintrc +0 -11
  759. package/client/node_modules/side-channel-list/.github/FUNDING.yml +0 -12
  760. package/client/node_modules/side-channel-list/.nycrc +0 -13
  761. package/client/node_modules/side-channel-list/CHANGELOG.md +0 -36
  762. package/client/node_modules/side-channel-list/LICENSE +0 -21
  763. package/client/node_modules/side-channel-list/README.md +0 -62
  764. package/client/node_modules/side-channel-list/index.d.ts +0 -13
  765. package/client/node_modules/side-channel-list/index.js +0 -111
  766. package/client/node_modules/side-channel-list/list.d.ts +0 -14
  767. package/client/node_modules/side-channel-list/package.json +0 -77
  768. package/client/node_modules/side-channel-list/test/index.js +0 -154
  769. package/client/node_modules/side-channel-list/tsconfig.json +0 -9
  770. package/client/node_modules/side-channel-map/.editorconfig +0 -9
  771. package/client/node_modules/side-channel-map/.eslintrc +0 -11
  772. package/client/node_modules/side-channel-map/.github/FUNDING.yml +0 -12
  773. package/client/node_modules/side-channel-map/.nycrc +0 -13
  774. package/client/node_modules/side-channel-map/CHANGELOG.md +0 -22
  775. package/client/node_modules/side-channel-map/LICENSE +0 -21
  776. package/client/node_modules/side-channel-map/README.md +0 -62
  777. package/client/node_modules/side-channel-map/index.d.ts +0 -15
  778. package/client/node_modules/side-channel-map/index.js +0 -68
  779. package/client/node_modules/side-channel-map/package.json +0 -80
  780. package/client/node_modules/side-channel-map/test/index.js +0 -114
  781. package/client/node_modules/side-channel-map/tsconfig.json +0 -9
  782. package/client/node_modules/side-channel-weakmap/.editorconfig +0 -9
  783. package/client/node_modules/side-channel-weakmap/.eslintrc +0 -12
  784. package/client/node_modules/side-channel-weakmap/.github/FUNDING.yml +0 -12
  785. package/client/node_modules/side-channel-weakmap/.nycrc +0 -13
  786. package/client/node_modules/side-channel-weakmap/CHANGELOG.md +0 -28
  787. package/client/node_modules/side-channel-weakmap/LICENSE +0 -21
  788. package/client/node_modules/side-channel-weakmap/README.md +0 -62
  789. package/client/node_modules/side-channel-weakmap/index.d.ts +0 -15
  790. package/client/node_modules/side-channel-weakmap/index.js +0 -84
  791. package/client/node_modules/side-channel-weakmap/package.json +0 -87
  792. package/client/node_modules/side-channel-weakmap/test/index.js +0 -114
  793. package/client/node_modules/side-channel-weakmap/tsconfig.json +0 -9
  794. package/client/node_modules/statuses/HISTORY.md +0 -87
  795. package/client/node_modules/statuses/LICENSE +0 -23
  796. package/client/node_modules/statuses/README.md +0 -139
  797. package/client/node_modules/statuses/codes.json +0 -65
  798. package/client/node_modules/statuses/index.js +0 -146
  799. package/client/node_modules/statuses/package.json +0 -49
  800. package/client/node_modules/toidentifier/HISTORY.md +0 -9
  801. package/client/node_modules/toidentifier/LICENSE +0 -21
  802. package/client/node_modules/toidentifier/README.md +0 -61
  803. package/client/node_modules/toidentifier/index.js +0 -32
  804. package/client/node_modules/toidentifier/package.json +0 -38
  805. package/client/node_modules/type-is/HISTORY.md +0 -259
  806. package/client/node_modules/type-is/LICENSE +0 -23
  807. package/client/node_modules/type-is/README.md +0 -170
  808. package/client/node_modules/type-is/index.js +0 -266
  809. package/client/node_modules/type-is/package.json +0 -45
  810. package/client/node_modules/typescript/LICENSE.txt +0 -55
  811. package/client/node_modules/typescript/README.md +0 -50
  812. package/client/node_modules/typescript/SECURITY.md +0 -41
  813. package/client/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  814. package/client/node_modules/typescript/bin/tsc +0 -2
  815. package/client/node_modules/typescript/bin/tsserver +0 -2
  816. package/client/node_modules/typescript/lib/_tsc.js +0 -133818
  817. package/client/node_modules/typescript/lib/_tsserver.js +0 -659
  818. package/client/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  819. package/client/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  820. package/client/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  821. package/client/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  822. package/client/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  823. package/client/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  824. package/client/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  825. package/client/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  826. package/client/node_modules/typescript/lib/lib.d.ts +0 -22
  827. package/client/node_modules/typescript/lib/lib.decorators.d.ts +0 -384
  828. package/client/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
  829. package/client/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -41
  830. package/client/node_modules/typescript/lib/lib.dom.d.ts +0 -39429
  831. package/client/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -571
  832. package/client/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
  833. package/client/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
  834. package/client/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
  835. package/client/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
  836. package/client/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -605
  837. package/client/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
  838. package/client/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
  839. package/client/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
  840. package/client/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
  841. package/client/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
  842. package/client/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
  843. package/client/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
  844. package/client/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
  845. package/client/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
  846. package/client/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  847. package/client/node_modules/typescript/lib/lib.es2017.d.ts +0 -26
  848. package/client/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
  849. package/client/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
  850. package/client/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
  851. package/client/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
  852. package/client/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
  853. package/client/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
  854. package/client/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
  855. package/client/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
  856. package/client/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -53
  857. package/client/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
  858. package/client/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
  859. package/client/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
  860. package/client/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
  861. package/client/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
  862. package/client/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
  863. package/client/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
  864. package/client/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
  865. package/client/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
  866. package/client/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
  867. package/client/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
  868. package/client/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
  869. package/client/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -765
  870. package/client/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
  871. package/client/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
  872. package/client/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
  873. package/client/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
  874. package/client/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
  875. package/client/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
  876. package/client/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -99
  877. package/client/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -44
  878. package/client/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -41
  879. package/client/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
  880. package/client/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
  881. package/client/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
  882. package/client/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
  883. package/client/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
  884. package/client/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -78
  885. package/client/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
  886. package/client/node_modules/typescript/lib/lib.es2022.d.ts +0 -25
  887. package/client/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -75
  888. package/client/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
  889. package/client/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -145
  890. package/client/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
  891. package/client/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
  892. package/client/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
  893. package/client/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
  894. package/client/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
  895. package/client/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
  896. package/client/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
  897. package/client/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
  898. package/client/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  899. package/client/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  900. package/client/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  901. package/client/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  902. package/client/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -29
  903. package/client/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -35
  904. package/client/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -25
  905. package/client/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -68
  906. package/client/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -29
  907. package/client/node_modules/typescript/lib/lib.es5.d.ts +0 -4601
  908. package/client/node_modules/typescript/lib/lib.es6.d.ts +0 -23
  909. package/client/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
  910. package/client/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -96
  911. package/client/node_modules/typescript/lib/lib.esnext.d.ts +0 -29
  912. package/client/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
  913. package/client/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -193
  914. package/client/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -24
  915. package/client/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -445
  916. package/client/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
  917. package/client/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
  918. package/client/node_modules/typescript/lib/lib.esnext.iterator.d.ts +0 -148
  919. package/client/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
  920. package/client/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -25
  921. package/client/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
  922. package/client/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -41
  923. package/client/node_modules/typescript/lib/lib.webworker.d.ts +0 -13150
  924. package/client/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
  925. package/client/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -340
  926. package/client/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  927. package/client/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  928. package/client/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  929. package/client/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  930. package/client/node_modules/typescript/lib/tsc.js +0 -8
  931. package/client/node_modules/typescript/lib/tsserver.js +0 -8
  932. package/client/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  933. package/client/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  934. package/client/node_modules/typescript/lib/typesMap.json +0 -497
  935. package/client/node_modules/typescript/lib/typescript.d.ts +0 -11437
  936. package/client/node_modules/typescript/lib/typescript.js +0 -200276
  937. package/client/node_modules/typescript/lib/typingsInstaller.js +0 -8
  938. package/client/node_modules/typescript/lib/watchGuard.js +0 -53
  939. package/client/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  940. package/client/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  941. package/client/node_modules/typescript/package.json +0 -120
  942. package/client/node_modules/undici-types/LICENSE +0 -21
  943. package/client/node_modules/undici-types/README.md +0 -6
  944. package/client/node_modules/undici-types/agent.d.ts +0 -31
  945. package/client/node_modules/undici-types/api.d.ts +0 -43
  946. package/client/node_modules/undici-types/balanced-pool.d.ts +0 -29
  947. package/client/node_modules/undici-types/cache.d.ts +0 -36
  948. package/client/node_modules/undici-types/client.d.ts +0 -108
  949. package/client/node_modules/undici-types/connector.d.ts +0 -34
  950. package/client/node_modules/undici-types/content-type.d.ts +0 -21
  951. package/client/node_modules/undici-types/cookies.d.ts +0 -28
  952. package/client/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  953. package/client/node_modules/undici-types/dispatcher.d.ts +0 -256
  954. package/client/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  955. package/client/node_modules/undici-types/errors.d.ts +0 -149
  956. package/client/node_modules/undici-types/eventsource.d.ts +0 -61
  957. package/client/node_modules/undici-types/fetch.d.ts +0 -209
  958. package/client/node_modules/undici-types/file.d.ts +0 -39
  959. package/client/node_modules/undici-types/filereader.d.ts +0 -54
  960. package/client/node_modules/undici-types/formdata.d.ts +0 -108
  961. package/client/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  962. package/client/node_modules/undici-types/global-origin.d.ts +0 -7
  963. package/client/node_modules/undici-types/handlers.d.ts +0 -15
  964. package/client/node_modules/undici-types/header.d.ts +0 -4
  965. package/client/node_modules/undici-types/index.d.ts +0 -71
  966. package/client/node_modules/undici-types/interceptors.d.ts +0 -17
  967. package/client/node_modules/undici-types/mock-agent.d.ts +0 -50
  968. package/client/node_modules/undici-types/mock-client.d.ts +0 -25
  969. package/client/node_modules/undici-types/mock-errors.d.ts +0 -12
  970. package/client/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  971. package/client/node_modules/undici-types/mock-pool.d.ts +0 -25
  972. package/client/node_modules/undici-types/package.json +0 -55
  973. package/client/node_modules/undici-types/patch.d.ts +0 -33
  974. package/client/node_modules/undici-types/pool-stats.d.ts +0 -19
  975. package/client/node_modules/undici-types/pool.d.ts +0 -39
  976. package/client/node_modules/undici-types/proxy-agent.d.ts +0 -28
  977. package/client/node_modules/undici-types/readable.d.ts +0 -65
  978. package/client/node_modules/undici-types/retry-agent.d.ts +0 -8
  979. package/client/node_modules/undici-types/retry-handler.d.ts +0 -116
  980. package/client/node_modules/undici-types/util.d.ts +0 -18
  981. package/client/node_modules/undici-types/webidl.d.ts +0 -228
  982. package/client/node_modules/undici-types/websocket.d.ts +0 -150
  983. package/client/node_modules/unpipe/HISTORY.md +0 -4
  984. package/client/node_modules/unpipe/LICENSE +0 -22
  985. package/client/node_modules/unpipe/README.md +0 -43
  986. package/client/node_modules/unpipe/index.js +0 -69
  987. package/client/node_modules/unpipe/package.json +0 -27
  988. package/client/node_modules/utils-merge/LICENSE +0 -20
  989. package/client/node_modules/utils-merge/README.md +0 -34
  990. package/client/node_modules/utils-merge/index.js +0 -23
  991. package/client/node_modules/utils-merge/package.json +0 -40
  992. package/client/node_modules/vary/HISTORY.md +0 -39
  993. package/client/node_modules/vary/LICENSE +0 -22
  994. package/client/node_modules/vary/README.md +0 -101
  995. package/client/node_modules/vary/index.js +0 -149
  996. package/client/node_modules/vary/package.json +0 -43
  997. package/client/obfuscate.js +0 -132
  998. package/client/package-lock.json +0 -956
  999. package/client/package.json +0 -32
  1000. package/client/src/cli.ts +0 -273
  1001. package/client/src/dashboard.ts +0 -85
  1002. package/client/src/executor.ts +0 -65
  1003. package/client/src/filters/generic.ts +0 -60
  1004. package/client/src/filters/git.ts +0 -150
  1005. package/client/src/filters/index.ts +0 -113
  1006. package/client/src/filters/js.ts +0 -102
  1007. package/client/src/filters/python.ts +0 -152
  1008. package/client/src/index.html +0 -779
  1009. package/client/src/mcp.ts +0 -88
  1010. package/client/src/redactor.ts +0 -54
  1011. package/client/src/seed.ts +0 -35
  1012. package/client/src/shims.ts +0 -142
  1013. package/client/src/simulate.ts +0 -98
  1014. package/client/src/sync.ts +0 -252
  1015. package/client/src/tracker.ts +0 -269
  1016. package/client/tsconfig.json +0 -14
  1017. package/install.bat +0 -48
  1018. package/test_e2e.js +0 -156
  1019. package/tsconfig.json +0 -15
  1020. /package/{client/dist/index.html → index.html} +0 -0
@@ -1,2179 +0,0 @@
1
- const EventEmitter = require('events').EventEmitter;
2
- const childProcess = require('child_process');
3
- const path = require('path');
4
- const fs = require('fs');
5
- const process = require('process');
6
-
7
- const { Argument, humanReadableArgName } = require('./argument.js');
8
- const { CommanderError } = require('./error.js');
9
- const { Help } = require('./help.js');
10
- const { Option, splitOptionFlags, DualOptions } = require('./option.js');
11
- const { suggestSimilar } = require('./suggestSimilar');
12
-
13
- class Command extends EventEmitter {
14
- /**
15
- * Initialize a new `Command`.
16
- *
17
- * @param {string} [name]
18
- */
19
-
20
- constructor(name) {
21
- super();
22
- /** @type {Command[]} */
23
- this.commands = [];
24
- /** @type {Option[]} */
25
- this.options = [];
26
- this.parent = null;
27
- this._allowUnknownOption = false;
28
- this._allowExcessArguments = true;
29
- /** @type {Argument[]} */
30
- this.registeredArguments = [];
31
- this._args = this.registeredArguments; // deprecated old name
32
- /** @type {string[]} */
33
- this.args = []; // cli args with options removed
34
- this.rawArgs = [];
35
- this.processedArgs = []; // like .args but after custom processing and collecting variadic
36
- this._scriptPath = null;
37
- this._name = name || '';
38
- this._optionValues = {};
39
- this._optionValueSources = {}; // default, env, cli etc
40
- this._storeOptionsAsProperties = false;
41
- this._actionHandler = null;
42
- this._executableHandler = false;
43
- this._executableFile = null; // custom name for executable
44
- this._executableDir = null; // custom search directory for subcommands
45
- this._defaultCommandName = null;
46
- this._exitCallback = null;
47
- this._aliases = [];
48
- this._combineFlagAndOptionalValue = true;
49
- this._description = '';
50
- this._summary = '';
51
- this._argsDescription = undefined; // legacy
52
- this._enablePositionalOptions = false;
53
- this._passThroughOptions = false;
54
- this._lifeCycleHooks = {}; // a hash of arrays
55
- /** @type {boolean | string} */
56
- this._showHelpAfterError = false;
57
- this._showSuggestionAfterError = true;
58
-
59
- // see .configureOutput() for docs
60
- this._outputConfiguration = {
61
- writeOut: (str) => process.stdout.write(str),
62
- writeErr: (str) => process.stderr.write(str),
63
- getOutHelpWidth: () => process.stdout.isTTY ? process.stdout.columns : undefined,
64
- getErrHelpWidth: () => process.stderr.isTTY ? process.stderr.columns : undefined,
65
- outputError: (str, write) => write(str)
66
- };
67
-
68
- this._hidden = false;
69
- this._hasHelpOption = true;
70
- this._helpFlags = '-h, --help';
71
- this._helpDescription = 'display help for command';
72
- this._helpShortFlag = '-h';
73
- this._helpLongFlag = '--help';
74
- this._addImplicitHelpCommand = undefined; // Deliberately undefined, not decided whether true or false
75
- this._helpCommandName = 'help';
76
- this._helpCommandnameAndArgs = 'help [command]';
77
- this._helpCommandDescription = 'display help for command';
78
- this._helpConfiguration = {};
79
- }
80
-
81
- /**
82
- * Copy settings that are useful to have in common across root command and subcommands.
83
- *
84
- * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
85
- *
86
- * @param {Command} sourceCommand
87
- * @return {Command} `this` command for chaining
88
- */
89
- copyInheritedSettings(sourceCommand) {
90
- this._outputConfiguration = sourceCommand._outputConfiguration;
91
- this._hasHelpOption = sourceCommand._hasHelpOption;
92
- this._helpFlags = sourceCommand._helpFlags;
93
- this._helpDescription = sourceCommand._helpDescription;
94
- this._helpShortFlag = sourceCommand._helpShortFlag;
95
- this._helpLongFlag = sourceCommand._helpLongFlag;
96
- this._helpCommandName = sourceCommand._helpCommandName;
97
- this._helpCommandnameAndArgs = sourceCommand._helpCommandnameAndArgs;
98
- this._helpCommandDescription = sourceCommand._helpCommandDescription;
99
- this._helpConfiguration = sourceCommand._helpConfiguration;
100
- this._exitCallback = sourceCommand._exitCallback;
101
- this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
102
- this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;
103
- this._allowExcessArguments = sourceCommand._allowExcessArguments;
104
- this._enablePositionalOptions = sourceCommand._enablePositionalOptions;
105
- this._showHelpAfterError = sourceCommand._showHelpAfterError;
106
- this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;
107
-
108
- return this;
109
- }
110
-
111
- /**
112
- * @returns {Command[]}
113
- * @api private
114
- */
115
-
116
- _getCommandAndAncestors() {
117
- const result = [];
118
- for (let command = this; command; command = command.parent) {
119
- result.push(command);
120
- }
121
- return result;
122
- }
123
-
124
- /**
125
- * Define a command.
126
- *
127
- * There are two styles of command: pay attention to where to put the description.
128
- *
129
- * @example
130
- * // Command implemented using action handler (description is supplied separately to `.command`)
131
- * program
132
- * .command('clone <source> [destination]')
133
- * .description('clone a repository into a newly created directory')
134
- * .action((source, destination) => {
135
- * console.log('clone command called');
136
- * });
137
- *
138
- * // Command implemented using separate executable file (description is second parameter to `.command`)
139
- * program
140
- * .command('start <service>', 'start named service')
141
- * .command('stop [service]', 'stop named service, or all if no name supplied');
142
- *
143
- * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
144
- * @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)
145
- * @param {Object} [execOpts] - configuration options (for executable)
146
- * @return {Command} returns new command for action handler, or `this` for executable command
147
- */
148
-
149
- command(nameAndArgs, actionOptsOrExecDesc, execOpts) {
150
- let desc = actionOptsOrExecDesc;
151
- let opts = execOpts;
152
- if (typeof desc === 'object' && desc !== null) {
153
- opts = desc;
154
- desc = null;
155
- }
156
- opts = opts || {};
157
- const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);
158
-
159
- const cmd = this.createCommand(name);
160
- if (desc) {
161
- cmd.description(desc);
162
- cmd._executableHandler = true;
163
- }
164
- if (opts.isDefault) this._defaultCommandName = cmd._name;
165
- cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden
166
- cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor
167
- if (args) cmd.arguments(args);
168
- this.commands.push(cmd);
169
- cmd.parent = this;
170
- cmd.copyInheritedSettings(this);
171
-
172
- if (desc) return this;
173
- return cmd;
174
- }
175
-
176
- /**
177
- * Factory routine to create a new unattached command.
178
- *
179
- * See .command() for creating an attached subcommand, which uses this routine to
180
- * create the command. You can override createCommand to customise subcommands.
181
- *
182
- * @param {string} [name]
183
- * @return {Command} new command
184
- */
185
-
186
- createCommand(name) {
187
- return new Command(name);
188
- }
189
-
190
- /**
191
- * You can customise the help with a subclass of Help by overriding createHelp,
192
- * or by overriding Help properties using configureHelp().
193
- *
194
- * @return {Help}
195
- */
196
-
197
- createHelp() {
198
- return Object.assign(new Help(), this.configureHelp());
199
- }
200
-
201
- /**
202
- * You can customise the help by overriding Help properties using configureHelp(),
203
- * or with a subclass of Help by overriding createHelp().
204
- *
205
- * @param {Object} [configuration] - configuration options
206
- * @return {Command|Object} `this` command for chaining, or stored configuration
207
- */
208
-
209
- configureHelp(configuration) {
210
- if (configuration === undefined) return this._helpConfiguration;
211
-
212
- this._helpConfiguration = configuration;
213
- return this;
214
- }
215
-
216
- /**
217
- * The default output goes to stdout and stderr. You can customise this for special
218
- * applications. You can also customise the display of errors by overriding outputError.
219
- *
220
- * The configuration properties are all functions:
221
- *
222
- * // functions to change where being written, stdout and stderr
223
- * writeOut(str)
224
- * writeErr(str)
225
- * // matching functions to specify width for wrapping help
226
- * getOutHelpWidth()
227
- * getErrHelpWidth()
228
- * // functions based on what is being written out
229
- * outputError(str, write) // used for displaying errors, and not used for displaying help
230
- *
231
- * @param {Object} [configuration] - configuration options
232
- * @return {Command|Object} `this` command for chaining, or stored configuration
233
- */
234
-
235
- configureOutput(configuration) {
236
- if (configuration === undefined) return this._outputConfiguration;
237
-
238
- Object.assign(this._outputConfiguration, configuration);
239
- return this;
240
- }
241
-
242
- /**
243
- * Display the help or a custom message after an error occurs.
244
- *
245
- * @param {boolean|string} [displayHelp]
246
- * @return {Command} `this` command for chaining
247
- */
248
- showHelpAfterError(displayHelp = true) {
249
- if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;
250
- this._showHelpAfterError = displayHelp;
251
- return this;
252
- }
253
-
254
- /**
255
- * Display suggestion of similar commands for unknown commands, or options for unknown options.
256
- *
257
- * @param {boolean} [displaySuggestion]
258
- * @return {Command} `this` command for chaining
259
- */
260
- showSuggestionAfterError(displaySuggestion = true) {
261
- this._showSuggestionAfterError = !!displaySuggestion;
262
- return this;
263
- }
264
-
265
- /**
266
- * Add a prepared subcommand.
267
- *
268
- * See .command() for creating an attached subcommand which inherits settings from its parent.
269
- *
270
- * @param {Command} cmd - new subcommand
271
- * @param {Object} [opts] - configuration options
272
- * @return {Command} `this` command for chaining
273
- */
274
-
275
- addCommand(cmd, opts) {
276
- if (!cmd._name) {
277
- throw new Error(`Command passed to .addCommand() must have a name
278
- - specify the name in Command constructor or using .name()`);
279
- }
280
-
281
- opts = opts || {};
282
- if (opts.isDefault) this._defaultCommandName = cmd._name;
283
- if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation
284
-
285
- this.commands.push(cmd);
286
- cmd.parent = this;
287
- return this;
288
- }
289
-
290
- /**
291
- * Factory routine to create a new unattached argument.
292
- *
293
- * See .argument() for creating an attached argument, which uses this routine to
294
- * create the argument. You can override createArgument to return a custom argument.
295
- *
296
- * @param {string} name
297
- * @param {string} [description]
298
- * @return {Argument} new argument
299
- */
300
-
301
- createArgument(name, description) {
302
- return new Argument(name, description);
303
- }
304
-
305
- /**
306
- * Define argument syntax for command.
307
- *
308
- * The default is that the argument is required, and you can explicitly
309
- * indicate this with <> around the name. Put [] around the name for an optional argument.
310
- *
311
- * @example
312
- * program.argument('<input-file>');
313
- * program.argument('[output-file]');
314
- *
315
- * @param {string} name
316
- * @param {string} [description]
317
- * @param {Function|*} [fn] - custom argument processing function
318
- * @param {*} [defaultValue]
319
- * @return {Command} `this` command for chaining
320
- */
321
- argument(name, description, fn, defaultValue) {
322
- const argument = this.createArgument(name, description);
323
- if (typeof fn === 'function') {
324
- argument.default(defaultValue).argParser(fn);
325
- } else {
326
- argument.default(fn);
327
- }
328
- this.addArgument(argument);
329
- return this;
330
- }
331
-
332
- /**
333
- * Define argument syntax for command, adding multiple at once (without descriptions).
334
- *
335
- * See also .argument().
336
- *
337
- * @example
338
- * program.arguments('<cmd> [env]');
339
- *
340
- * @param {string} names
341
- * @return {Command} `this` command for chaining
342
- */
343
-
344
- arguments(names) {
345
- names.trim().split(/ +/).forEach((detail) => {
346
- this.argument(detail);
347
- });
348
- return this;
349
- }
350
-
351
- /**
352
- * Define argument syntax for command, adding a prepared argument.
353
- *
354
- * @param {Argument} argument
355
- * @return {Command} `this` command for chaining
356
- */
357
- addArgument(argument) {
358
- const previousArgument = this.registeredArguments.slice(-1)[0];
359
- if (previousArgument && previousArgument.variadic) {
360
- throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
361
- }
362
- if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
363
- throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);
364
- }
365
- this.registeredArguments.push(argument);
366
- return this;
367
- }
368
-
369
- /**
370
- * Override default decision whether to add implicit help command.
371
- *
372
- * addHelpCommand() // force on
373
- * addHelpCommand(false); // force off
374
- * addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details
375
- *
376
- * @return {Command} `this` command for chaining
377
- */
378
-
379
- addHelpCommand(enableOrNameAndArgs, description) {
380
- if (enableOrNameAndArgs === false) {
381
- this._addImplicitHelpCommand = false;
382
- } else {
383
- this._addImplicitHelpCommand = true;
384
- if (typeof enableOrNameAndArgs === 'string') {
385
- this._helpCommandName = enableOrNameAndArgs.split(' ')[0];
386
- this._helpCommandnameAndArgs = enableOrNameAndArgs;
387
- }
388
- this._helpCommandDescription = description || this._helpCommandDescription;
389
- }
390
- return this;
391
- }
392
-
393
- /**
394
- * @return {boolean}
395
- * @api private
396
- */
397
-
398
- _hasImplicitHelpCommand() {
399
- if (this._addImplicitHelpCommand === undefined) {
400
- return this.commands.length && !this._actionHandler && !this._findCommand('help');
401
- }
402
- return this._addImplicitHelpCommand;
403
- }
404
-
405
- /**
406
- * Add hook for life cycle event.
407
- *
408
- * @param {string} event
409
- * @param {Function} listener
410
- * @return {Command} `this` command for chaining
411
- */
412
-
413
- hook(event, listener) {
414
- const allowedValues = ['preSubcommand', 'preAction', 'postAction'];
415
- if (!allowedValues.includes(event)) {
416
- throw new Error(`Unexpected value for event passed to hook : '${event}'.
417
- Expecting one of '${allowedValues.join("', '")}'`);
418
- }
419
- if (this._lifeCycleHooks[event]) {
420
- this._lifeCycleHooks[event].push(listener);
421
- } else {
422
- this._lifeCycleHooks[event] = [listener];
423
- }
424
- return this;
425
- }
426
-
427
- /**
428
- * Register callback to use as replacement for calling process.exit.
429
- *
430
- * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing
431
- * @return {Command} `this` command for chaining
432
- */
433
-
434
- exitOverride(fn) {
435
- if (fn) {
436
- this._exitCallback = fn;
437
- } else {
438
- this._exitCallback = (err) => {
439
- if (err.code !== 'commander.executeSubCommandAsync') {
440
- throw err;
441
- } else {
442
- // Async callback from spawn events, not useful to throw.
443
- }
444
- };
445
- }
446
- return this;
447
- }
448
-
449
- /**
450
- * Call process.exit, and _exitCallback if defined.
451
- *
452
- * @param {number} exitCode exit code for using with process.exit
453
- * @param {string} code an id string representing the error
454
- * @param {string} message human-readable description of the error
455
- * @return never
456
- * @api private
457
- */
458
-
459
- _exit(exitCode, code, message) {
460
- if (this._exitCallback) {
461
- this._exitCallback(new CommanderError(exitCode, code, message));
462
- // Expecting this line is not reached.
463
- }
464
- process.exit(exitCode);
465
- }
466
-
467
- /**
468
- * Register callback `fn` for the command.
469
- *
470
- * @example
471
- * program
472
- * .command('serve')
473
- * .description('start service')
474
- * .action(function() {
475
- * // do work here
476
- * });
477
- *
478
- * @param {Function} fn
479
- * @return {Command} `this` command for chaining
480
- */
481
-
482
- action(fn) {
483
- const listener = (args) => {
484
- // The .action callback takes an extra parameter which is the command or options.
485
- const expectedArgsCount = this.registeredArguments.length;
486
- const actionArgs = args.slice(0, expectedArgsCount);
487
- if (this._storeOptionsAsProperties) {
488
- actionArgs[expectedArgsCount] = this; // backwards compatible "options"
489
- } else {
490
- actionArgs[expectedArgsCount] = this.opts();
491
- }
492
- actionArgs.push(this);
493
-
494
- return fn.apply(this, actionArgs);
495
- };
496
- this._actionHandler = listener;
497
- return this;
498
- }
499
-
500
- /**
501
- * Factory routine to create a new unattached option.
502
- *
503
- * See .option() for creating an attached option, which uses this routine to
504
- * create the option. You can override createOption to return a custom option.
505
- *
506
- * @param {string} flags
507
- * @param {string} [description]
508
- * @return {Option} new option
509
- */
510
-
511
- createOption(flags, description) {
512
- return new Option(flags, description);
513
- }
514
-
515
- /**
516
- * Wrap parseArgs to catch 'commander.invalidArgument'.
517
- *
518
- * @param {Option | Argument} target
519
- * @param {string} value
520
- * @param {*} previous
521
- * @param {string} invalidArgumentMessage
522
- * @api private
523
- */
524
-
525
- _callParseArg(target, value, previous, invalidArgumentMessage) {
526
- try {
527
- return target.parseArg(value, previous);
528
- } catch (err) {
529
- if (err.code === 'commander.invalidArgument') {
530
- const message = `${invalidArgumentMessage} ${err.message}`;
531
- this.error(message, { exitCode: err.exitCode, code: err.code });
532
- }
533
- throw err;
534
- }
535
- }
536
-
537
- /**
538
- * Add an option.
539
- *
540
- * @param {Option} option
541
- * @return {Command} `this` command for chaining
542
- */
543
- addOption(option) {
544
- const oname = option.name();
545
- const name = option.attributeName();
546
-
547
- // store default value
548
- if (option.negate) {
549
- // --no-foo is special and defaults foo to true, unless a --foo option is already defined
550
- const positiveLongFlag = option.long.replace(/^--no-/, '--');
551
- if (!this._findOption(positiveLongFlag)) {
552
- this.setOptionValueWithSource(name, option.defaultValue === undefined ? true : option.defaultValue, 'default');
553
- }
554
- } else if (option.defaultValue !== undefined) {
555
- this.setOptionValueWithSource(name, option.defaultValue, 'default');
556
- }
557
-
558
- // register the option
559
- this.options.push(option);
560
-
561
- // handler for cli and env supplied values
562
- const handleOptionValue = (val, invalidValueMessage, valueSource) => {
563
- // val is null for optional option used without an optional-argument.
564
- // val is undefined for boolean and negated option.
565
- if (val == null && option.presetArg !== undefined) {
566
- val = option.presetArg;
567
- }
568
-
569
- // custom processing
570
- const oldValue = this.getOptionValue(name);
571
- if (val !== null && option.parseArg) {
572
- val = this._callParseArg(option, val, oldValue, invalidValueMessage);
573
- } else if (val !== null && option.variadic) {
574
- val = option._concatValue(val, oldValue);
575
- }
576
-
577
- // Fill-in appropriate missing values. Long winded but easy to follow.
578
- if (val == null) {
579
- if (option.negate) {
580
- val = false;
581
- } else if (option.isBoolean() || option.optional) {
582
- val = true;
583
- } else {
584
- val = ''; // not normal, parseArg might have failed or be a mock function for testing
585
- }
586
- }
587
- this.setOptionValueWithSource(name, val, valueSource);
588
- };
589
-
590
- this.on('option:' + oname, (val) => {
591
- const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;
592
- handleOptionValue(val, invalidValueMessage, 'cli');
593
- });
594
-
595
- if (option.envVar) {
596
- this.on('optionEnv:' + oname, (val) => {
597
- const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;
598
- handleOptionValue(val, invalidValueMessage, 'env');
599
- });
600
- }
601
-
602
- return this;
603
- }
604
-
605
- /**
606
- * Internal implementation shared by .option() and .requiredOption()
607
- *
608
- * @api private
609
- */
610
- _optionEx(config, flags, description, fn, defaultValue) {
611
- if (typeof flags === 'object' && flags instanceof Option) {
612
- throw new Error('To add an Option object use addOption() instead of option() or requiredOption()');
613
- }
614
- const option = this.createOption(flags, description);
615
- option.makeOptionMandatory(!!config.mandatory);
616
- if (typeof fn === 'function') {
617
- option.default(defaultValue).argParser(fn);
618
- } else if (fn instanceof RegExp) {
619
- // deprecated
620
- const regex = fn;
621
- fn = (val, def) => {
622
- const m = regex.exec(val);
623
- return m ? m[0] : def;
624
- };
625
- option.default(defaultValue).argParser(fn);
626
- } else {
627
- option.default(fn);
628
- }
629
-
630
- return this.addOption(option);
631
- }
632
-
633
- /**
634
- * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
635
- *
636
- * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
637
- * option-argument is indicated by `<>` and an optional option-argument by `[]`.
638
- *
639
- * See the README for more details, and see also addOption() and requiredOption().
640
- *
641
- * @example
642
- * program
643
- * .option('-p, --pepper', 'add pepper')
644
- * .option('-p, --pizza-type <TYPE>', 'type of pizza') // required option-argument
645
- * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
646
- * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
647
- *
648
- * @param {string} flags
649
- * @param {string} [description]
650
- * @param {Function|*} [parseArg] - custom option processing function or default value
651
- * @param {*} [defaultValue]
652
- * @return {Command} `this` command for chaining
653
- */
654
-
655
- option(flags, description, parseArg, defaultValue) {
656
- return this._optionEx({}, flags, description, parseArg, defaultValue);
657
- }
658
-
659
- /**
660
- * Add a required option which must have a value after parsing. This usually means
661
- * the option must be specified on the command line. (Otherwise the same as .option().)
662
- *
663
- * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
664
- *
665
- * @param {string} flags
666
- * @param {string} [description]
667
- * @param {Function|*} [parseArg] - custom option processing function or default value
668
- * @param {*} [defaultValue]
669
- * @return {Command} `this` command for chaining
670
- */
671
-
672
- requiredOption(flags, description, parseArg, defaultValue) {
673
- return this._optionEx({ mandatory: true }, flags, description, parseArg, defaultValue);
674
- }
675
-
676
- /**
677
- * Alter parsing of short flags with optional values.
678
- *
679
- * @example
680
- * // for `.option('-f,--flag [value]'):
681
- * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour
682
- * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
683
- *
684
- * @param {Boolean} [combine=true] - if `true` or omitted, an optional value can be specified directly after the flag.
685
- */
686
- combineFlagAndOptionalValue(combine = true) {
687
- this._combineFlagAndOptionalValue = !!combine;
688
- return this;
689
- }
690
-
691
- /**
692
- * Allow unknown options on the command line.
693
- *
694
- * @param {Boolean} [allowUnknown=true] - if `true` or omitted, no error will be thrown
695
- * for unknown options.
696
- */
697
- allowUnknownOption(allowUnknown = true) {
698
- this._allowUnknownOption = !!allowUnknown;
699
- return this;
700
- }
701
-
702
- /**
703
- * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
704
- *
705
- * @param {Boolean} [allowExcess=true] - if `true` or omitted, no error will be thrown
706
- * for excess arguments.
707
- */
708
- allowExcessArguments(allowExcess = true) {
709
- this._allowExcessArguments = !!allowExcess;
710
- return this;
711
- }
712
-
713
- /**
714
- * Enable positional options. Positional means global options are specified before subcommands which lets
715
- * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
716
- * The default behaviour is non-positional and global options may appear anywhere on the command line.
717
- *
718
- * @param {Boolean} [positional=true]
719
- */
720
- enablePositionalOptions(positional = true) {
721
- this._enablePositionalOptions = !!positional;
722
- return this;
723
- }
724
-
725
- /**
726
- * Pass through options that come after command-arguments rather than treat them as command-options,
727
- * so actual command-options come before command-arguments. Turning this on for a subcommand requires
728
- * positional options to have been enabled on the program (parent commands).
729
- * The default behaviour is non-positional and options may appear before or after command-arguments.
730
- *
731
- * @param {Boolean} [passThrough=true]
732
- * for unknown options.
733
- */
734
- passThroughOptions(passThrough = true) {
735
- this._passThroughOptions = !!passThrough;
736
- if (!!this.parent && passThrough && !this.parent._enablePositionalOptions) {
737
- throw new Error('passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)');
738
- }
739
- return this;
740
- }
741
-
742
- /**
743
- * Whether to store option values as properties on command object,
744
- * or store separately (specify false). In both cases the option values can be accessed using .opts().
745
- *
746
- * @param {boolean} [storeAsProperties=true]
747
- * @return {Command} `this` command for chaining
748
- */
749
-
750
- storeOptionsAsProperties(storeAsProperties = true) {
751
- if (this.options.length) {
752
- throw new Error('call .storeOptionsAsProperties() before adding options');
753
- }
754
- // if (Object.keys(this._optionValues).length) {
755
- // throw new Error('call .storeOptionsAsProperties() before setting option values');
756
- // }
757
- this._storeOptionsAsProperties = !!storeAsProperties;
758
- return this;
759
- }
760
-
761
- /**
762
- * Retrieve option value.
763
- *
764
- * @param {string} key
765
- * @return {Object} value
766
- */
767
-
768
- getOptionValue(key) {
769
- if (this._storeOptionsAsProperties) {
770
- return this[key];
771
- }
772
- return this._optionValues[key];
773
- }
774
-
775
- /**
776
- * Store option value.
777
- *
778
- * @param {string} key
779
- * @param {Object} value
780
- * @return {Command} `this` command for chaining
781
- */
782
-
783
- setOptionValue(key, value) {
784
- return this.setOptionValueWithSource(key, value, undefined);
785
- }
786
-
787
- /**
788
- * Store option value and where the value came from.
789
- *
790
- * @param {string} key
791
- * @param {Object} value
792
- * @param {string} source - expected values are default/config/env/cli/implied
793
- * @return {Command} `this` command for chaining
794
- */
795
-
796
- setOptionValueWithSource(key, value, source) {
797
- if (this._storeOptionsAsProperties) {
798
- this[key] = value;
799
- } else {
800
- this._optionValues[key] = value;
801
- }
802
- this._optionValueSources[key] = source;
803
- return this;
804
- }
805
-
806
- /**
807
- * Get source of option value.
808
- * Expected values are default | config | env | cli | implied
809
- *
810
- * @param {string} key
811
- * @return {string}
812
- */
813
-
814
- getOptionValueSource(key) {
815
- return this._optionValueSources[key];
816
- }
817
-
818
- /**
819
- * Get source of option value. See also .optsWithGlobals().
820
- * Expected values are default | config | env | cli | implied
821
- *
822
- * @param {string} key
823
- * @return {string}
824
- */
825
-
826
- getOptionValueSourceWithGlobals(key) {
827
- // global overwrites local, like optsWithGlobals
828
- let source;
829
- this._getCommandAndAncestors().forEach((cmd) => {
830
- if (cmd.getOptionValueSource(key) !== undefined) {
831
- source = cmd.getOptionValueSource(key);
832
- }
833
- });
834
- return source;
835
- }
836
-
837
- /**
838
- * Get user arguments from implied or explicit arguments.
839
- * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.
840
- *
841
- * @api private
842
- */
843
-
844
- _prepareUserArgs(argv, parseOptions) {
845
- if (argv !== undefined && !Array.isArray(argv)) {
846
- throw new Error('first parameter to parse must be array or undefined');
847
- }
848
- parseOptions = parseOptions || {};
849
-
850
- // Default to using process.argv
851
- if (argv === undefined) {
852
- argv = process.argv;
853
- // @ts-ignore: unknown property
854
- if (process.versions && process.versions.electron) {
855
- parseOptions.from = 'electron';
856
- }
857
- }
858
- this.rawArgs = argv.slice();
859
-
860
- // make it a little easier for callers by supporting various argv conventions
861
- let userArgs;
862
- switch (parseOptions.from) {
863
- case undefined:
864
- case 'node':
865
- this._scriptPath = argv[1];
866
- userArgs = argv.slice(2);
867
- break;
868
- case 'electron':
869
- // @ts-ignore: unknown property
870
- if (process.defaultApp) {
871
- this._scriptPath = argv[1];
872
- userArgs = argv.slice(2);
873
- } else {
874
- userArgs = argv.slice(1);
875
- }
876
- break;
877
- case 'user':
878
- userArgs = argv.slice(0);
879
- break;
880
- default:
881
- throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
882
- }
883
-
884
- // Find default name for program from arguments.
885
- if (!this._name && this._scriptPath) this.nameFromFilename(this._scriptPath);
886
- this._name = this._name || 'program';
887
-
888
- return userArgs;
889
- }
890
-
891
- /**
892
- * Parse `argv`, setting options and invoking commands when defined.
893
- *
894
- * The default expectation is that the arguments are from node and have the application as argv[0]
895
- * and the script being run in argv[1], with user parameters after that.
896
- *
897
- * @example
898
- * program.parse(process.argv);
899
- * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
900
- * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
901
- *
902
- * @param {string[]} [argv] - optional, defaults to process.argv
903
- * @param {Object} [parseOptions] - optionally specify style of options with from: node/user/electron
904
- * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'
905
- * @return {Command} `this` command for chaining
906
- */
907
-
908
- parse(argv, parseOptions) {
909
- const userArgs = this._prepareUserArgs(argv, parseOptions);
910
- this._parseCommand([], userArgs);
911
-
912
- return this;
913
- }
914
-
915
- /**
916
- * Parse `argv`, setting options and invoking commands when defined.
917
- *
918
- * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
919
- *
920
- * The default expectation is that the arguments are from node and have the application as argv[0]
921
- * and the script being run in argv[1], with user parameters after that.
922
- *
923
- * @example
924
- * await program.parseAsync(process.argv);
925
- * await program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
926
- * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
927
- *
928
- * @param {string[]} [argv]
929
- * @param {Object} [parseOptions]
930
- * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'
931
- * @return {Promise}
932
- */
933
-
934
- async parseAsync(argv, parseOptions) {
935
- const userArgs = this._prepareUserArgs(argv, parseOptions);
936
- await this._parseCommand([], userArgs);
937
-
938
- return this;
939
- }
940
-
941
- /**
942
- * Execute a sub-command executable.
943
- *
944
- * @api private
945
- */
946
-
947
- _executeSubCommand(subcommand, args) {
948
- args = args.slice();
949
- let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.
950
- const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];
951
-
952
- function findFile(baseDir, baseName) {
953
- // Look for specified file
954
- const localBin = path.resolve(baseDir, baseName);
955
- if (fs.existsSync(localBin)) return localBin;
956
-
957
- // Stop looking if candidate already has an expected extension.
958
- if (sourceExt.includes(path.extname(baseName))) return undefined;
959
-
960
- // Try all the extensions.
961
- const foundExt = sourceExt.find(ext => fs.existsSync(`${localBin}${ext}`));
962
- if (foundExt) return `${localBin}${foundExt}`;
963
-
964
- return undefined;
965
- }
966
-
967
- // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.
968
- this._checkForMissingMandatoryOptions();
969
- this._checkForConflictingOptions();
970
-
971
- // executableFile and executableDir might be full path, or just a name
972
- let executableFile = subcommand._executableFile || `${this._name}-${subcommand._name}`;
973
- let executableDir = this._executableDir || '';
974
- if (this._scriptPath) {
975
- let resolvedScriptPath; // resolve possible symlink for installed npm binary
976
- try {
977
- resolvedScriptPath = fs.realpathSync(this._scriptPath);
978
- } catch (err) {
979
- resolvedScriptPath = this._scriptPath;
980
- }
981
- executableDir = path.resolve(path.dirname(resolvedScriptPath), executableDir);
982
- }
983
-
984
- // Look for a local file in preference to a command in PATH.
985
- if (executableDir) {
986
- let localFile = findFile(executableDir, executableFile);
987
-
988
- // Legacy search using prefix of script name instead of command name
989
- if (!localFile && !subcommand._executableFile && this._scriptPath) {
990
- const legacyName = path.basename(this._scriptPath, path.extname(this._scriptPath));
991
- if (legacyName !== this._name) {
992
- localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
993
- }
994
- }
995
- executableFile = localFile || executableFile;
996
- }
997
-
998
- launchWithNode = sourceExt.includes(path.extname(executableFile));
999
-
1000
- let proc;
1001
- if (process.platform !== 'win32') {
1002
- if (launchWithNode) {
1003
- args.unshift(executableFile);
1004
- // add executable arguments to spawn
1005
- args = incrementNodeInspectorPort(process.execArgv).concat(args);
1006
-
1007
- proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });
1008
- } else {
1009
- proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });
1010
- }
1011
- } else {
1012
- args.unshift(executableFile);
1013
- // add executable arguments to spawn
1014
- args = incrementNodeInspectorPort(process.execArgv).concat(args);
1015
- proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });
1016
- }
1017
-
1018
- if (!proc.killed) { // testing mainly to avoid leak warnings during unit tests with mocked spawn
1019
- const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
1020
- signals.forEach((signal) => {
1021
- // @ts-ignore
1022
- process.on(signal, () => {
1023
- if (proc.killed === false && proc.exitCode === null) {
1024
- proc.kill(signal);
1025
- }
1026
- });
1027
- });
1028
- }
1029
-
1030
- // By default terminate process when spawned process terminates.
1031
- // Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running!
1032
- const exitCallback = this._exitCallback;
1033
- if (!exitCallback) {
1034
- proc.on('close', process.exit.bind(process));
1035
- } else {
1036
- proc.on('close', () => {
1037
- exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)'));
1038
- });
1039
- }
1040
- proc.on('error', (err) => {
1041
- // @ts-ignore
1042
- if (err.code === 'ENOENT') {
1043
- const executableDirMessage = executableDir
1044
- ? `searched for local subcommand relative to directory '${executableDir}'`
1045
- : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';
1046
- const executableMissing = `'${executableFile}' does not exist
1047
- - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
1048
- - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
1049
- - ${executableDirMessage}`;
1050
- throw new Error(executableMissing);
1051
- // @ts-ignore
1052
- } else if (err.code === 'EACCES') {
1053
- throw new Error(`'${executableFile}' not executable`);
1054
- }
1055
- if (!exitCallback) {
1056
- process.exit(1);
1057
- } else {
1058
- const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)');
1059
- wrappedError.nestedError = err;
1060
- exitCallback(wrappedError);
1061
- }
1062
- });
1063
-
1064
- // Store the reference to the child process
1065
- this.runningCommand = proc;
1066
- }
1067
-
1068
- /**
1069
- * @api private
1070
- */
1071
-
1072
- _dispatchSubcommand(commandName, operands, unknown) {
1073
- const subCommand = this._findCommand(commandName);
1074
- if (!subCommand) this.help({ error: true });
1075
-
1076
- let promiseChain;
1077
- promiseChain = this._chainOrCallSubCommandHook(promiseChain, subCommand, 'preSubcommand');
1078
- promiseChain = this._chainOrCall(promiseChain, () => {
1079
- if (subCommand._executableHandler) {
1080
- this._executeSubCommand(subCommand, operands.concat(unknown));
1081
- } else {
1082
- return subCommand._parseCommand(operands, unknown);
1083
- }
1084
- });
1085
- return promiseChain;
1086
- }
1087
-
1088
- /**
1089
- * Invoke help directly if possible, or dispatch if necessary.
1090
- * e.g. help foo
1091
- *
1092
- * @api private
1093
- */
1094
-
1095
- _dispatchHelpCommand(subcommandName) {
1096
- if (!subcommandName) {
1097
- this.help();
1098
- }
1099
- const subCommand = this._findCommand(subcommandName);
1100
- if (subCommand && !subCommand._executableHandler) {
1101
- subCommand.help();
1102
- }
1103
-
1104
- // Fallback to parsing the help flag to invoke the help.
1105
- return this._dispatchSubcommand(subcommandName, [], [
1106
- this._helpLongFlag || this._helpShortFlag
1107
- ]);
1108
- }
1109
-
1110
- /**
1111
- * Check this.args against expected this.registeredArguments.
1112
- *
1113
- * @api private
1114
- */
1115
-
1116
- _checkNumberOfArguments() {
1117
- // too few
1118
- this.registeredArguments.forEach((arg, i) => {
1119
- if (arg.required && this.args[i] == null) {
1120
- this.missingArgument(arg.name());
1121
- }
1122
- });
1123
- // too many
1124
- if (this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) {
1125
- return;
1126
- }
1127
- if (this.args.length > this.registeredArguments.length) {
1128
- this._excessArguments(this.args);
1129
- }
1130
- }
1131
-
1132
- /**
1133
- * Process this.args using this.registeredArguments and save as this.processedArgs!
1134
- *
1135
- * @api private
1136
- */
1137
-
1138
- _processArguments() {
1139
- const myParseArg = (argument, value, previous) => {
1140
- // Extra processing for nice error message on parsing failure.
1141
- let parsedValue = value;
1142
- if (value !== null && argument.parseArg) {
1143
- const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;
1144
- parsedValue = this._callParseArg(argument, value, previous, invalidValueMessage);
1145
- }
1146
- return parsedValue;
1147
- };
1148
-
1149
- this._checkNumberOfArguments();
1150
-
1151
- const processedArgs = [];
1152
- this.registeredArguments.forEach((declaredArg, index) => {
1153
- let value = declaredArg.defaultValue;
1154
- if (declaredArg.variadic) {
1155
- // Collect together remaining arguments for passing together as an array.
1156
- if (index < this.args.length) {
1157
- value = this.args.slice(index);
1158
- if (declaredArg.parseArg) {
1159
- value = value.reduce((processed, v) => {
1160
- return myParseArg(declaredArg, v, processed);
1161
- }, declaredArg.defaultValue);
1162
- }
1163
- } else if (value === undefined) {
1164
- value = [];
1165
- }
1166
- } else if (index < this.args.length) {
1167
- value = this.args[index];
1168
- if (declaredArg.parseArg) {
1169
- value = myParseArg(declaredArg, value, declaredArg.defaultValue);
1170
- }
1171
- }
1172
- processedArgs[index] = value;
1173
- });
1174
- this.processedArgs = processedArgs;
1175
- }
1176
-
1177
- /**
1178
- * Once we have a promise we chain, but call synchronously until then.
1179
- *
1180
- * @param {Promise|undefined} promise
1181
- * @param {Function} fn
1182
- * @return {Promise|undefined}
1183
- * @api private
1184
- */
1185
-
1186
- _chainOrCall(promise, fn) {
1187
- // thenable
1188
- if (promise && promise.then && typeof promise.then === 'function') {
1189
- // already have a promise, chain callback
1190
- return promise.then(() => fn());
1191
- }
1192
- // callback might return a promise
1193
- return fn();
1194
- }
1195
-
1196
- /**
1197
- *
1198
- * @param {Promise|undefined} promise
1199
- * @param {string} event
1200
- * @return {Promise|undefined}
1201
- * @api private
1202
- */
1203
-
1204
- _chainOrCallHooks(promise, event) {
1205
- let result = promise;
1206
- const hooks = [];
1207
- this._getCommandAndAncestors()
1208
- .reverse()
1209
- .filter(cmd => cmd._lifeCycleHooks[event] !== undefined)
1210
- .forEach(hookedCommand => {
1211
- hookedCommand._lifeCycleHooks[event].forEach((callback) => {
1212
- hooks.push({ hookedCommand, callback });
1213
- });
1214
- });
1215
- if (event === 'postAction') {
1216
- hooks.reverse();
1217
- }
1218
-
1219
- hooks.forEach((hookDetail) => {
1220
- result = this._chainOrCall(result, () => {
1221
- return hookDetail.callback(hookDetail.hookedCommand, this);
1222
- });
1223
- });
1224
- return result;
1225
- }
1226
-
1227
- /**
1228
- *
1229
- * @param {Promise|undefined} promise
1230
- * @param {Command} subCommand
1231
- * @param {string} event
1232
- * @return {Promise|undefined}
1233
- * @api private
1234
- */
1235
-
1236
- _chainOrCallSubCommandHook(promise, subCommand, event) {
1237
- let result = promise;
1238
- if (this._lifeCycleHooks[event] !== undefined) {
1239
- this._lifeCycleHooks[event].forEach((hook) => {
1240
- result = this._chainOrCall(result, () => {
1241
- return hook(this, subCommand);
1242
- });
1243
- });
1244
- }
1245
- return result;
1246
- }
1247
-
1248
- /**
1249
- * Process arguments in context of this command.
1250
- * Returns action result, in case it is a promise.
1251
- *
1252
- * @api private
1253
- */
1254
-
1255
- _parseCommand(operands, unknown) {
1256
- const parsed = this.parseOptions(unknown);
1257
- this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env
1258
- this._parseOptionsImplied();
1259
- operands = operands.concat(parsed.operands);
1260
- unknown = parsed.unknown;
1261
- this.args = operands.concat(unknown);
1262
-
1263
- if (operands && this._findCommand(operands[0])) {
1264
- return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);
1265
- }
1266
- if (this._hasImplicitHelpCommand() && operands[0] === this._helpCommandName) {
1267
- return this._dispatchHelpCommand(operands[1]);
1268
- }
1269
- if (this._defaultCommandName) {
1270
- outputHelpIfRequested(this, unknown); // Run the help for default command from parent rather than passing to default command
1271
- return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);
1272
- }
1273
- if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
1274
- // probably missing subcommand and no handler, user needs help (and exit)
1275
- this.help({ error: true });
1276
- }
1277
-
1278
- outputHelpIfRequested(this, parsed.unknown);
1279
- this._checkForMissingMandatoryOptions();
1280
- this._checkForConflictingOptions();
1281
-
1282
- // We do not always call this check to avoid masking a "better" error, like unknown command.
1283
- const checkForUnknownOptions = () => {
1284
- if (parsed.unknown.length > 0) {
1285
- this.unknownOption(parsed.unknown[0]);
1286
- }
1287
- };
1288
-
1289
- const commandEvent = `command:${this.name()}`;
1290
- if (this._actionHandler) {
1291
- checkForUnknownOptions();
1292
- this._processArguments();
1293
-
1294
- let promiseChain;
1295
- promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');
1296
- promiseChain = this._chainOrCall(promiseChain, () => this._actionHandler(this.processedArgs));
1297
- if (this.parent) {
1298
- promiseChain = this._chainOrCall(promiseChain, () => {
1299
- this.parent.emit(commandEvent, operands, unknown); // legacy
1300
- });
1301
- }
1302
- promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');
1303
- return promiseChain;
1304
- }
1305
- if (this.parent && this.parent.listenerCount(commandEvent)) {
1306
- checkForUnknownOptions();
1307
- this._processArguments();
1308
- this.parent.emit(commandEvent, operands, unknown); // legacy
1309
- } else if (operands.length) {
1310
- if (this._findCommand('*')) { // legacy default command
1311
- return this._dispatchSubcommand('*', operands, unknown);
1312
- }
1313
- if (this.listenerCount('command:*')) {
1314
- // skip option check, emit event for possible misspelling suggestion
1315
- this.emit('command:*', operands, unknown);
1316
- } else if (this.commands.length) {
1317
- this.unknownCommand();
1318
- } else {
1319
- checkForUnknownOptions();
1320
- this._processArguments();
1321
- }
1322
- } else if (this.commands.length) {
1323
- checkForUnknownOptions();
1324
- // This command has subcommands and nothing hooked up at this level, so display help (and exit).
1325
- this.help({ error: true });
1326
- } else {
1327
- checkForUnknownOptions();
1328
- this._processArguments();
1329
- // fall through for caller to handle after calling .parse()
1330
- }
1331
- }
1332
-
1333
- /**
1334
- * Find matching command.
1335
- *
1336
- * @api private
1337
- */
1338
- _findCommand(name) {
1339
- if (!name) return undefined;
1340
- return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name));
1341
- }
1342
-
1343
- /**
1344
- * Return an option matching `arg` if any.
1345
- *
1346
- * @param {string} arg
1347
- * @return {Option}
1348
- * @api private
1349
- */
1350
-
1351
- _findOption(arg) {
1352
- return this.options.find(option => option.is(arg));
1353
- }
1354
-
1355
- /**
1356
- * Display an error message if a mandatory option does not have a value.
1357
- * Called after checking for help flags in leaf subcommand.
1358
- *
1359
- * @api private
1360
- */
1361
-
1362
- _checkForMissingMandatoryOptions() {
1363
- // Walk up hierarchy so can call in subcommand after checking for displaying help.
1364
- this._getCommandAndAncestors().forEach((cmd) => {
1365
- cmd.options.forEach((anOption) => {
1366
- if (anOption.mandatory && (cmd.getOptionValue(anOption.attributeName()) === undefined)) {
1367
- cmd.missingMandatoryOptionValue(anOption);
1368
- }
1369
- });
1370
- });
1371
- }
1372
-
1373
- /**
1374
- * Display an error message if conflicting options are used together in this.
1375
- *
1376
- * @api private
1377
- */
1378
- _checkForConflictingLocalOptions() {
1379
- const definedNonDefaultOptions = this.options.filter(
1380
- (option) => {
1381
- const optionKey = option.attributeName();
1382
- if (this.getOptionValue(optionKey) === undefined) {
1383
- return false;
1384
- }
1385
- return this.getOptionValueSource(optionKey) !== 'default';
1386
- }
1387
- );
1388
-
1389
- const optionsWithConflicting = definedNonDefaultOptions.filter(
1390
- (option) => option.conflictsWith.length > 0
1391
- );
1392
-
1393
- optionsWithConflicting.forEach((option) => {
1394
- const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>
1395
- option.conflictsWith.includes(defined.attributeName())
1396
- );
1397
- if (conflictingAndDefined) {
1398
- this._conflictingOption(option, conflictingAndDefined);
1399
- }
1400
- });
1401
- }
1402
-
1403
- /**
1404
- * Display an error message if conflicting options are used together.
1405
- * Called after checking for help flags in leaf subcommand.
1406
- *
1407
- * @api private
1408
- */
1409
- _checkForConflictingOptions() {
1410
- // Walk up hierarchy so can call in subcommand after checking for displaying help.
1411
- this._getCommandAndAncestors().forEach((cmd) => {
1412
- cmd._checkForConflictingLocalOptions();
1413
- });
1414
- }
1415
-
1416
- /**
1417
- * Parse options from `argv` removing known options,
1418
- * and return argv split into operands and unknown arguments.
1419
- *
1420
- * Examples:
1421
- *
1422
- * argv => operands, unknown
1423
- * --known kkk op => [op], []
1424
- * op --known kkk => [op], []
1425
- * sub --unknown uuu op => [sub], [--unknown uuu op]
1426
- * sub -- --unknown uuu op => [sub --unknown uuu op], []
1427
- *
1428
- * @param {String[]} argv
1429
- * @return {{operands: String[], unknown: String[]}}
1430
- */
1431
-
1432
- parseOptions(argv) {
1433
- const operands = []; // operands, not options or values
1434
- const unknown = []; // first unknown option and remaining unknown args
1435
- let dest = operands;
1436
- const args = argv.slice();
1437
-
1438
- function maybeOption(arg) {
1439
- return arg.length > 1 && arg[0] === '-';
1440
- }
1441
-
1442
- // parse options
1443
- let activeVariadicOption = null;
1444
- while (args.length) {
1445
- const arg = args.shift();
1446
-
1447
- // literal
1448
- if (arg === '--') {
1449
- if (dest === unknown) dest.push(arg);
1450
- dest.push(...args);
1451
- break;
1452
- }
1453
-
1454
- if (activeVariadicOption && !maybeOption(arg)) {
1455
- this.emit(`option:${activeVariadicOption.name()}`, arg);
1456
- continue;
1457
- }
1458
- activeVariadicOption = null;
1459
-
1460
- if (maybeOption(arg)) {
1461
- const option = this._findOption(arg);
1462
- // recognised option, call listener to assign value with possible custom processing
1463
- if (option) {
1464
- if (option.required) {
1465
- const value = args.shift();
1466
- if (value === undefined) this.optionMissingArgument(option);
1467
- this.emit(`option:${option.name()}`, value);
1468
- } else if (option.optional) {
1469
- let value = null;
1470
- // historical behaviour is optional value is following arg unless an option
1471
- if (args.length > 0 && !maybeOption(args[0])) {
1472
- value = args.shift();
1473
- }
1474
- this.emit(`option:${option.name()}`, value);
1475
- } else { // boolean flag
1476
- this.emit(`option:${option.name()}`);
1477
- }
1478
- activeVariadicOption = option.variadic ? option : null;
1479
- continue;
1480
- }
1481
- }
1482
-
1483
- // Look for combo options following single dash, eat first one if known.
1484
- if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {
1485
- const option = this._findOption(`-${arg[1]}`);
1486
- if (option) {
1487
- if (option.required || (option.optional && this._combineFlagAndOptionalValue)) {
1488
- // option with value following in same argument
1489
- this.emit(`option:${option.name()}`, arg.slice(2));
1490
- } else {
1491
- // boolean option, emit and put back remainder of arg for further processing
1492
- this.emit(`option:${option.name()}`);
1493
- args.unshift(`-${arg.slice(2)}`);
1494
- }
1495
- continue;
1496
- }
1497
- }
1498
-
1499
- // Look for known long flag with value, like --foo=bar
1500
- if (/^--[^=]+=/.test(arg)) {
1501
- const index = arg.indexOf('=');
1502
- const option = this._findOption(arg.slice(0, index));
1503
- if (option && (option.required || option.optional)) {
1504
- this.emit(`option:${option.name()}`, arg.slice(index + 1));
1505
- continue;
1506
- }
1507
- }
1508
-
1509
- // Not a recognised option by this command.
1510
- // Might be a command-argument, or subcommand option, or unknown option, or help command or option.
1511
-
1512
- // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.
1513
- if (maybeOption(arg)) {
1514
- dest = unknown;
1515
- }
1516
-
1517
- // If using positionalOptions, stop processing our options at subcommand.
1518
- if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
1519
- if (this._findCommand(arg)) {
1520
- operands.push(arg);
1521
- if (args.length > 0) unknown.push(...args);
1522
- break;
1523
- } else if (arg === this._helpCommandName && this._hasImplicitHelpCommand()) {
1524
- operands.push(arg);
1525
- if (args.length > 0) operands.push(...args);
1526
- break;
1527
- } else if (this._defaultCommandName) {
1528
- unknown.push(arg);
1529
- if (args.length > 0) unknown.push(...args);
1530
- break;
1531
- }
1532
- }
1533
-
1534
- // If using passThroughOptions, stop processing options at first command-argument.
1535
- if (this._passThroughOptions) {
1536
- dest.push(arg);
1537
- if (args.length > 0) dest.push(...args);
1538
- break;
1539
- }
1540
-
1541
- // add arg
1542
- dest.push(arg);
1543
- }
1544
-
1545
- return { operands, unknown };
1546
- }
1547
-
1548
- /**
1549
- * Return an object containing local option values as key-value pairs.
1550
- *
1551
- * @return {Object}
1552
- */
1553
- opts() {
1554
- if (this._storeOptionsAsProperties) {
1555
- // Preserve original behaviour so backwards compatible when still using properties
1556
- const result = {};
1557
- const len = this.options.length;
1558
-
1559
- for (let i = 0; i < len; i++) {
1560
- const key = this.options[i].attributeName();
1561
- result[key] = key === this._versionOptionName ? this._version : this[key];
1562
- }
1563
- return result;
1564
- }
1565
-
1566
- return this._optionValues;
1567
- }
1568
-
1569
- /**
1570
- * Return an object containing merged local and global option values as key-value pairs.
1571
- *
1572
- * @return {Object}
1573
- */
1574
- optsWithGlobals() {
1575
- // globals overwrite locals
1576
- return this._getCommandAndAncestors().reduce(
1577
- (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),
1578
- {}
1579
- );
1580
- }
1581
-
1582
- /**
1583
- * Display error message and exit (or call exitOverride).
1584
- *
1585
- * @param {string} message
1586
- * @param {Object} [errorOptions]
1587
- * @param {string} [errorOptions.code] - an id string representing the error
1588
- * @param {number} [errorOptions.exitCode] - used with process.exit
1589
- */
1590
- error(message, errorOptions) {
1591
- // output handling
1592
- this._outputConfiguration.outputError(`${message}\n`, this._outputConfiguration.writeErr);
1593
- if (typeof this._showHelpAfterError === 'string') {
1594
- this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`);
1595
- } else if (this._showHelpAfterError) {
1596
- this._outputConfiguration.writeErr('\n');
1597
- this.outputHelp({ error: true });
1598
- }
1599
-
1600
- // exit handling
1601
- const config = errorOptions || {};
1602
- const exitCode = config.exitCode || 1;
1603
- const code = config.code || 'commander.error';
1604
- this._exit(exitCode, code, message);
1605
- }
1606
-
1607
- /**
1608
- * Apply any option related environment variables, if option does
1609
- * not have a value from cli or client code.
1610
- *
1611
- * @api private
1612
- */
1613
- _parseOptionsEnv() {
1614
- this.options.forEach((option) => {
1615
- if (option.envVar && option.envVar in process.env) {
1616
- const optionKey = option.attributeName();
1617
- // Priority check. Do not overwrite cli or options from unknown source (client-code).
1618
- if (this.getOptionValue(optionKey) === undefined || ['default', 'config', 'env'].includes(this.getOptionValueSource(optionKey))) {
1619
- if (option.required || option.optional) { // option can take a value
1620
- // keep very simple, optional always takes value
1621
- this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);
1622
- } else { // boolean
1623
- // keep very simple, only care that envVar defined and not the value
1624
- this.emit(`optionEnv:${option.name()}`);
1625
- }
1626
- }
1627
- }
1628
- });
1629
- }
1630
-
1631
- /**
1632
- * Apply any implied option values, if option is undefined or default value.
1633
- *
1634
- * @api private
1635
- */
1636
- _parseOptionsImplied() {
1637
- const dualHelper = new DualOptions(this.options);
1638
- const hasCustomOptionValue = (optionKey) => {
1639
- return this.getOptionValue(optionKey) !== undefined && !['default', 'implied'].includes(this.getOptionValueSource(optionKey));
1640
- };
1641
- this.options
1642
- .filter(option => (option.implied !== undefined) &&
1643
- hasCustomOptionValue(option.attributeName()) &&
1644
- dualHelper.valueFromOption(this.getOptionValue(option.attributeName()), option))
1645
- .forEach((option) => {
1646
- Object.keys(option.implied)
1647
- .filter(impliedKey => !hasCustomOptionValue(impliedKey))
1648
- .forEach(impliedKey => {
1649
- this.setOptionValueWithSource(impliedKey, option.implied[impliedKey], 'implied');
1650
- });
1651
- });
1652
- }
1653
-
1654
- /**
1655
- * Argument `name` is missing.
1656
- *
1657
- * @param {string} name
1658
- * @api private
1659
- */
1660
-
1661
- missingArgument(name) {
1662
- const message = `error: missing required argument '${name}'`;
1663
- this.error(message, { code: 'commander.missingArgument' });
1664
- }
1665
-
1666
- /**
1667
- * `Option` is missing an argument.
1668
- *
1669
- * @param {Option} option
1670
- * @api private
1671
- */
1672
-
1673
- optionMissingArgument(option) {
1674
- const message = `error: option '${option.flags}' argument missing`;
1675
- this.error(message, { code: 'commander.optionMissingArgument' });
1676
- }
1677
-
1678
- /**
1679
- * `Option` does not have a value, and is a mandatory option.
1680
- *
1681
- * @param {Option} option
1682
- * @api private
1683
- */
1684
-
1685
- missingMandatoryOptionValue(option) {
1686
- const message = `error: required option '${option.flags}' not specified`;
1687
- this.error(message, { code: 'commander.missingMandatoryOptionValue' });
1688
- }
1689
-
1690
- /**
1691
- * `Option` conflicts with another option.
1692
- *
1693
- * @param {Option} option
1694
- * @param {Option} conflictingOption
1695
- * @api private
1696
- */
1697
- _conflictingOption(option, conflictingOption) {
1698
- // The calling code does not know whether a negated option is the source of the
1699
- // value, so do some work to take an educated guess.
1700
- const findBestOptionFromValue = (option) => {
1701
- const optionKey = option.attributeName();
1702
- const optionValue = this.getOptionValue(optionKey);
1703
- const negativeOption = this.options.find(target => target.negate && optionKey === target.attributeName());
1704
- const positiveOption = this.options.find(target => !target.negate && optionKey === target.attributeName());
1705
- if (negativeOption && (
1706
- (negativeOption.presetArg === undefined && optionValue === false) ||
1707
- (negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)
1708
- )) {
1709
- return negativeOption;
1710
- }
1711
- return positiveOption || option;
1712
- };
1713
-
1714
- const getErrorMessage = (option) => {
1715
- const bestOption = findBestOptionFromValue(option);
1716
- const optionKey = bestOption.attributeName();
1717
- const source = this.getOptionValueSource(optionKey);
1718
- if (source === 'env') {
1719
- return `environment variable '${bestOption.envVar}'`;
1720
- }
1721
- return `option '${bestOption.flags}'`;
1722
- };
1723
-
1724
- const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;
1725
- this.error(message, { code: 'commander.conflictingOption' });
1726
- }
1727
-
1728
- /**
1729
- * Unknown option `flag`.
1730
- *
1731
- * @param {string} flag
1732
- * @api private
1733
- */
1734
-
1735
- unknownOption(flag) {
1736
- if (this._allowUnknownOption) return;
1737
- let suggestion = '';
1738
-
1739
- if (flag.startsWith('--') && this._showSuggestionAfterError) {
1740
- // Looping to pick up the global options too
1741
- let candidateFlags = [];
1742
- let command = this;
1743
- do {
1744
- const moreFlags = command.createHelp().visibleOptions(command)
1745
- .filter(option => option.long)
1746
- .map(option => option.long);
1747
- candidateFlags = candidateFlags.concat(moreFlags);
1748
- command = command.parent;
1749
- } while (command && !command._enablePositionalOptions);
1750
- suggestion = suggestSimilar(flag, candidateFlags);
1751
- }
1752
-
1753
- const message = `error: unknown option '${flag}'${suggestion}`;
1754
- this.error(message, { code: 'commander.unknownOption' });
1755
- }
1756
-
1757
- /**
1758
- * Excess arguments, more than expected.
1759
- *
1760
- * @param {string[]} receivedArgs
1761
- * @api private
1762
- */
1763
-
1764
- _excessArguments(receivedArgs) {
1765
- if (this._allowExcessArguments) return;
1766
-
1767
- const expected = this.registeredArguments.length;
1768
- const s = (expected === 1) ? '' : 's';
1769
- const forSubcommand = this.parent ? ` for '${this.name()}'` : '';
1770
- const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
1771
- this.error(message, { code: 'commander.excessArguments' });
1772
- }
1773
-
1774
- /**
1775
- * Unknown command.
1776
- *
1777
- * @api private
1778
- */
1779
-
1780
- unknownCommand() {
1781
- const unknownName = this.args[0];
1782
- let suggestion = '';
1783
-
1784
- if (this._showSuggestionAfterError) {
1785
- const candidateNames = [];
1786
- this.createHelp().visibleCommands(this).forEach((command) => {
1787
- candidateNames.push(command.name());
1788
- // just visible alias
1789
- if (command.alias()) candidateNames.push(command.alias());
1790
- });
1791
- suggestion = suggestSimilar(unknownName, candidateNames);
1792
- }
1793
-
1794
- const message = `error: unknown command '${unknownName}'${suggestion}`;
1795
- this.error(message, { code: 'commander.unknownCommand' });
1796
- }
1797
-
1798
- /**
1799
- * Get or set the program version.
1800
- *
1801
- * This method auto-registers the "-V, --version" option which will print the version number.
1802
- *
1803
- * You can optionally supply the flags and description to override the defaults.
1804
- *
1805
- * @param {string} [str]
1806
- * @param {string} [flags]
1807
- * @param {string} [description]
1808
- * @return {this | string | undefined} `this` command for chaining, or version string if no arguments
1809
- */
1810
-
1811
- version(str, flags, description) {
1812
- if (str === undefined) return this._version;
1813
- this._version = str;
1814
- flags = flags || '-V, --version';
1815
- description = description || 'output the version number';
1816
- const versionOption = this.createOption(flags, description);
1817
- this._versionOptionName = versionOption.attributeName(); // [sic] not defined in constructor, partly legacy, partly only needed at root
1818
- this.options.push(versionOption);
1819
- this.on('option:' + versionOption.name(), () => {
1820
- this._outputConfiguration.writeOut(`${str}\n`);
1821
- this._exit(0, 'commander.version', str);
1822
- });
1823
- return this;
1824
- }
1825
-
1826
- /**
1827
- * Set the description.
1828
- *
1829
- * @param {string} [str]
1830
- * @param {Object} [argsDescription]
1831
- * @return {string|Command}
1832
- */
1833
- description(str, argsDescription) {
1834
- if (str === undefined && argsDescription === undefined) return this._description;
1835
- this._description = str;
1836
- if (argsDescription) {
1837
- this._argsDescription = argsDescription;
1838
- }
1839
- return this;
1840
- }
1841
-
1842
- /**
1843
- * Set the summary. Used when listed as subcommand of parent.
1844
- *
1845
- * @param {string} [str]
1846
- * @return {string|Command}
1847
- */
1848
- summary(str) {
1849
- if (str === undefined) return this._summary;
1850
- this._summary = str;
1851
- return this;
1852
- }
1853
-
1854
- /**
1855
- * Set an alias for the command.
1856
- *
1857
- * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
1858
- *
1859
- * @param {string} [alias]
1860
- * @return {string|Command}
1861
- */
1862
-
1863
- alias(alias) {
1864
- if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility
1865
-
1866
- /** @type {Command} */
1867
- let command = this;
1868
- if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
1869
- // assume adding alias for last added executable subcommand, rather than this
1870
- command = this.commands[this.commands.length - 1];
1871
- }
1872
-
1873
- if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
1874
-
1875
- command._aliases.push(alias);
1876
- return this;
1877
- }
1878
-
1879
- /**
1880
- * Set aliases for the command.
1881
- *
1882
- * Only the first alias is shown in the auto-generated help.
1883
- *
1884
- * @param {string[]} [aliases]
1885
- * @return {string[]|Command}
1886
- */
1887
-
1888
- aliases(aliases) {
1889
- // Getter for the array of aliases is the main reason for having aliases() in addition to alias().
1890
- if (aliases === undefined) return this._aliases;
1891
-
1892
- aliases.forEach((alias) => this.alias(alias));
1893
- return this;
1894
- }
1895
-
1896
- /**
1897
- * Set / get the command usage `str`.
1898
- *
1899
- * @param {string} [str]
1900
- * @return {String|Command}
1901
- */
1902
-
1903
- usage(str) {
1904
- if (str === undefined) {
1905
- if (this._usage) return this._usage;
1906
-
1907
- const args = this.registeredArguments.map((arg) => {
1908
- return humanReadableArgName(arg);
1909
- });
1910
- return [].concat(
1911
- (this.options.length || this._hasHelpOption ? '[options]' : []),
1912
- (this.commands.length ? '[command]' : []),
1913
- (this.registeredArguments.length ? args : [])
1914
- ).join(' ');
1915
- }
1916
-
1917
- this._usage = str;
1918
- return this;
1919
- }
1920
-
1921
- /**
1922
- * Get or set the name of the command.
1923
- *
1924
- * @param {string} [str]
1925
- * @return {string|Command}
1926
- */
1927
-
1928
- name(str) {
1929
- if (str === undefined) return this._name;
1930
- this._name = str;
1931
- return this;
1932
- }
1933
-
1934
- /**
1935
- * Set the name of the command from script filename, such as process.argv[1],
1936
- * or require.main.filename, or __filename.
1937
- *
1938
- * (Used internally and public although not documented in README.)
1939
- *
1940
- * @example
1941
- * program.nameFromFilename(require.main.filename);
1942
- *
1943
- * @param {string} filename
1944
- * @return {Command}
1945
- */
1946
-
1947
- nameFromFilename(filename) {
1948
- this._name = path.basename(filename, path.extname(filename));
1949
-
1950
- return this;
1951
- }
1952
-
1953
- /**
1954
- * Get or set the directory for searching for executable subcommands of this command.
1955
- *
1956
- * @example
1957
- * program.executableDir(__dirname);
1958
- * // or
1959
- * program.executableDir('subcommands');
1960
- *
1961
- * @param {string} [path]
1962
- * @return {string|null|Command}
1963
- */
1964
-
1965
- executableDir(path) {
1966
- if (path === undefined) return this._executableDir;
1967
- this._executableDir = path;
1968
- return this;
1969
- }
1970
-
1971
- /**
1972
- * Return program help documentation.
1973
- *
1974
- * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout
1975
- * @return {string}
1976
- */
1977
-
1978
- helpInformation(contextOptions) {
1979
- const helper = this.createHelp();
1980
- if (helper.helpWidth === undefined) {
1981
- helper.helpWidth = (contextOptions && contextOptions.error) ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();
1982
- }
1983
- return helper.formatHelp(this, helper);
1984
- }
1985
-
1986
- /**
1987
- * @api private
1988
- */
1989
-
1990
- _getHelpContext(contextOptions) {
1991
- contextOptions = contextOptions || {};
1992
- const context = { error: !!contextOptions.error };
1993
- let write;
1994
- if (context.error) {
1995
- write = (arg) => this._outputConfiguration.writeErr(arg);
1996
- } else {
1997
- write = (arg) => this._outputConfiguration.writeOut(arg);
1998
- }
1999
- context.write = contextOptions.write || write;
2000
- context.command = this;
2001
- return context;
2002
- }
2003
-
2004
- /**
2005
- * Output help information for this command.
2006
- *
2007
- * Outputs built-in help, and custom text added using `.addHelpText()`.
2008
- *
2009
- * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout
2010
- */
2011
-
2012
- outputHelp(contextOptions) {
2013
- let deprecatedCallback;
2014
- if (typeof contextOptions === 'function') {
2015
- deprecatedCallback = contextOptions;
2016
- contextOptions = undefined;
2017
- }
2018
- const context = this._getHelpContext(contextOptions);
2019
-
2020
- this._getCommandAndAncestors().reverse().forEach(command => command.emit('beforeAllHelp', context));
2021
- this.emit('beforeHelp', context);
2022
-
2023
- let helpInformation = this.helpInformation(context);
2024
- if (deprecatedCallback) {
2025
- helpInformation = deprecatedCallback(helpInformation);
2026
- if (typeof helpInformation !== 'string' && !Buffer.isBuffer(helpInformation)) {
2027
- throw new Error('outputHelp callback must return a string or a Buffer');
2028
- }
2029
- }
2030
- context.write(helpInformation);
2031
-
2032
- if (this._helpLongFlag) {
2033
- this.emit(this._helpLongFlag); // deprecated
2034
- }
2035
- this.emit('afterHelp', context);
2036
- this._getCommandAndAncestors().forEach(command => command.emit('afterAllHelp', context));
2037
- }
2038
-
2039
- /**
2040
- * You can pass in flags and a description to override the help
2041
- * flags and help description for your command. Pass in false to
2042
- * disable the built-in help option.
2043
- *
2044
- * @param {string | boolean} [flags]
2045
- * @param {string} [description]
2046
- * @return {Command} `this` command for chaining
2047
- */
2048
-
2049
- helpOption(flags, description) {
2050
- if (typeof flags === 'boolean') {
2051
- this._hasHelpOption = flags;
2052
- return this;
2053
- }
2054
- this._helpFlags = flags || this._helpFlags;
2055
- this._helpDescription = description || this._helpDescription;
2056
-
2057
- const helpFlags = splitOptionFlags(this._helpFlags);
2058
- this._helpShortFlag = helpFlags.shortFlag;
2059
- this._helpLongFlag = helpFlags.longFlag;
2060
-
2061
- return this;
2062
- }
2063
-
2064
- /**
2065
- * Output help information and exit.
2066
- *
2067
- * Outputs built-in help, and custom text added using `.addHelpText()`.
2068
- *
2069
- * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout
2070
- */
2071
-
2072
- help(contextOptions) {
2073
- this.outputHelp(contextOptions);
2074
- let exitCode = process.exitCode || 0;
2075
- if (exitCode === 0 && contextOptions && typeof contextOptions !== 'function' && contextOptions.error) {
2076
- exitCode = 1;
2077
- }
2078
- // message: do not have all displayed text available so only passing placeholder.
2079
- this._exit(exitCode, 'commander.help', '(outputHelp)');
2080
- }
2081
-
2082
- /**
2083
- * Add additional text to be displayed with the built-in help.
2084
- *
2085
- * Position is 'before' or 'after' to affect just this command,
2086
- * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
2087
- *
2088
- * @param {string} position - before or after built-in help
2089
- * @param {string | Function} text - string to add, or a function returning a string
2090
- * @return {Command} `this` command for chaining
2091
- */
2092
- addHelpText(position, text) {
2093
- const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];
2094
- if (!allowedValues.includes(position)) {
2095
- throw new Error(`Unexpected value for position to addHelpText.
2096
- Expecting one of '${allowedValues.join("', '")}'`);
2097
- }
2098
- const helpEvent = `${position}Help`;
2099
- this.on(helpEvent, (context) => {
2100
- let helpStr;
2101
- if (typeof text === 'function') {
2102
- helpStr = text({ error: context.error, command: context.command });
2103
- } else {
2104
- helpStr = text;
2105
- }
2106
- // Ignore falsy value when nothing to output.
2107
- if (helpStr) {
2108
- context.write(`${helpStr}\n`);
2109
- }
2110
- });
2111
- return this;
2112
- }
2113
- }
2114
-
2115
- /**
2116
- * Output help information if help flags specified
2117
- *
2118
- * @param {Command} cmd - command to output help for
2119
- * @param {Array} args - array of options to search for help flags
2120
- * @api private
2121
- */
2122
-
2123
- function outputHelpIfRequested(cmd, args) {
2124
- const helpOption = cmd._hasHelpOption && args.find(arg => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag);
2125
- if (helpOption) {
2126
- cmd.outputHelp();
2127
- // (Do not have all displayed text available so only passing placeholder.)
2128
- cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)');
2129
- }
2130
- }
2131
-
2132
- /**
2133
- * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).
2134
- *
2135
- * @param {string[]} args - array of arguments from node.execArgv
2136
- * @returns {string[]}
2137
- * @api private
2138
- */
2139
-
2140
- function incrementNodeInspectorPort(args) {
2141
- // Testing for these options:
2142
- // --inspect[=[host:]port]
2143
- // --inspect-brk[=[host:]port]
2144
- // --inspect-port=[host:]port
2145
- return args.map((arg) => {
2146
- if (!arg.startsWith('--inspect')) {
2147
- return arg;
2148
- }
2149
- let debugOption;
2150
- let debugHost = '127.0.0.1';
2151
- let debugPort = '9229';
2152
- let match;
2153
- if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
2154
- // e.g. --inspect
2155
- debugOption = match[1];
2156
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
2157
- debugOption = match[1];
2158
- if (/^\d+$/.test(match[3])) {
2159
- // e.g. --inspect=1234
2160
- debugPort = match[3];
2161
- } else {
2162
- // e.g. --inspect=localhost
2163
- debugHost = match[3];
2164
- }
2165
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
2166
- // e.g. --inspect=localhost:1234
2167
- debugOption = match[1];
2168
- debugHost = match[3];
2169
- debugPort = match[4];
2170
- }
2171
-
2172
- if (debugOption && debugPort !== '0') {
2173
- return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
2174
- }
2175
- return arg;
2176
- });
2177
- }
2178
-
2179
- exports.Command = Command;