ccjk 14.2.2 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (528) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +58 -341
  3. package/dist/cli.js +59 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/detect.js +15 -0
  6. package/dist/commands/detect.js.map +1 -0
  7. package/dist/commands/doctor.js +68 -0
  8. package/dist/commands/doctor.js.map +1 -0
  9. package/dist/commands/git-install.js +50 -0
  10. package/dist/commands/git-install.js.map +1 -0
  11. package/dist/commands/init.js +102 -0
  12. package/dist/commands/init.js.map +1 -0
  13. package/dist/commands/mcp.js +66 -0
  14. package/dist/commands/mcp.js.map +1 -0
  15. package/dist/commands/menu.js +33 -0
  16. package/dist/commands/menu.js.map +1 -0
  17. package/dist/core/detect.js +24 -0
  18. package/dist/core/detect.js.map +1 -0
  19. package/dist/core/lint.js +49 -0
  20. package/dist/core/lint.js.map +1 -0
  21. package/dist/core/mcp.js +41 -0
  22. package/dist/core/mcp.js.map +1 -0
  23. package/dist/core/paths.js +9 -0
  24. package/dist/core/paths.js.map +1 -0
  25. package/dist/core/providers.js +53 -0
  26. package/dist/core/providers.js.map +1 -0
  27. package/dist/core/settings.js +31 -0
  28. package/dist/core/settings.js.map +1 -0
  29. package/dist/core/slash-templates.js +56 -0
  30. package/dist/core/slash-templates.js.map +1 -0
  31. package/dist/core/tools.js +27 -0
  32. package/dist/core/tools.js.map +1 -0
  33. package/package.json +43 -164
  34. package/README.HONEST.md +0 -176
  35. package/README.en.md +0 -67
  36. package/README.ja.md +0 -67
  37. package/README.ko.md +0 -67
  38. package/README.zh-CN.md +0 -86
  39. package/bin/ccjk.mjs +0 -5
  40. package/bin/ccjk.ts +0 -222
  41. package/dist/chunks/agent-teams.mjs +0 -145
  42. package/dist/chunks/agent.mjs +0 -1439
  43. package/dist/chunks/agents.mjs +0 -3783
  44. package/dist/chunks/api-cli.mjs +0 -135
  45. package/dist/chunks/api-config-selector.mjs +0 -159
  46. package/dist/chunks/api-providers.mjs +0 -144
  47. package/dist/chunks/api.mjs +0 -115
  48. package/dist/chunks/auto-bootstrap.mjs +0 -358
  49. package/dist/chunks/auto-fixer.mjs +0 -95
  50. package/dist/chunks/auto-updater.mjs +0 -507
  51. package/dist/chunks/banner.mjs +0 -173
  52. package/dist/chunks/bash.mjs +0 -187
  53. package/dist/chunks/boost.mjs +0 -474
  54. package/dist/chunks/brain-config.mjs +0 -75
  55. package/dist/chunks/brain-status.mjs +0 -89
  56. package/dist/chunks/ccjk-agents.mjs +0 -416
  57. package/dist/chunks/ccjk-all.mjs +0 -1046
  58. package/dist/chunks/ccjk-config.mjs +0 -445
  59. package/dist/chunks/ccjk-hooks.mjs +0 -1074
  60. package/dist/chunks/ccjk-mcp.mjs +0 -763
  61. package/dist/chunks/ccjk-setup.mjs +0 -765
  62. package/dist/chunks/ccjk-skills.mjs +0 -518
  63. package/dist/chunks/ccr.mjs +0 -109
  64. package/dist/chunks/ccu.mjs +0 -40
  65. package/dist/chunks/check-updates.mjs +0 -117
  66. package/dist/chunks/claude-code-incremental-manager.mjs +0 -761
  67. package/dist/chunks/claude-config.mjs +0 -606
  68. package/dist/chunks/claude-config2.mjs +0 -62
  69. package/dist/chunks/claude-wrapper.mjs +0 -85
  70. package/dist/chunks/clavue-config.mjs +0 -1454
  71. package/dist/chunks/cleanup-migration.mjs +0 -20
  72. package/dist/chunks/cli-hook.mjs +0 -4096
  73. package/dist/chunks/cloud-sync.mjs +0 -29
  74. package/dist/chunks/code-type-resolver.mjs +0 -880
  75. package/dist/chunks/codex-config-switch.mjs +0 -452
  76. package/dist/chunks/codex-provider-manager.mjs +0 -238
  77. package/dist/chunks/codex-uninstaller.mjs +0 -404
  78. package/dist/chunks/codex.mjs +0 -2141
  79. package/dist/chunks/commands.mjs +0 -108
  80. package/dist/chunks/commands2.mjs +0 -421
  81. package/dist/chunks/commit.mjs +0 -140
  82. package/dist/chunks/completion.mjs +0 -517
  83. package/dist/chunks/config-consolidator.mjs +0 -172
  84. package/dist/chunks/config-switch.mjs +0 -334
  85. package/dist/chunks/config.mjs +0 -558
  86. package/dist/chunks/config2.mjs +0 -484
  87. package/dist/chunks/config3.mjs +0 -486
  88. package/dist/chunks/constants.mjs +0 -323
  89. package/dist/chunks/context-opt.mjs +0 -444
  90. package/dist/chunks/context.mjs +0 -974
  91. package/dist/chunks/dashboard.mjs +0 -481
  92. package/dist/chunks/doctor.mjs +0 -1301
  93. package/dist/chunks/eval.mjs +0 -502
  94. package/dist/chunks/evolution.mjs +0 -322
  95. package/dist/chunks/features.mjs +0 -715
  96. package/dist/chunks/fish.mjs +0 -181
  97. package/dist/chunks/fs-operations.mjs +0 -180
  98. package/dist/chunks/health-alerts.mjs +0 -830
  99. package/dist/chunks/help.mjs +0 -341
  100. package/dist/chunks/hook-installer.mjs +0 -48
  101. package/dist/chunks/impact.mjs +0 -651
  102. package/dist/chunks/index.mjs +0 -23
  103. package/dist/chunks/index10.mjs +0 -19
  104. package/dist/chunks/index11.mjs +0 -1171
  105. package/dist/chunks/index12.mjs +0 -218
  106. package/dist/chunks/index13.mjs +0 -679
  107. package/dist/chunks/index14.mjs +0 -1009
  108. package/dist/chunks/index15.mjs +0 -194
  109. package/dist/chunks/index2.mjs +0 -7637
  110. package/dist/chunks/index3.mjs +0 -171
  111. package/dist/chunks/index4.mjs +0 -26
  112. package/dist/chunks/index5.mjs +0 -19
  113. package/dist/chunks/index6.mjs +0 -19092
  114. package/dist/chunks/index7.mjs +0 -616
  115. package/dist/chunks/index8.mjs +0 -1602
  116. package/dist/chunks/index9.mjs +0 -5384
  117. package/dist/chunks/init.mjs +0 -1911
  118. package/dist/chunks/installer.mjs +0 -757
  119. package/dist/chunks/installer2.mjs +0 -103
  120. package/dist/chunks/interview.mjs +0 -2927
  121. package/dist/chunks/json-config.mjs +0 -60
  122. package/dist/chunks/linux.mjs +0 -3863
  123. package/dist/chunks/macos.mjs +0 -69
  124. package/dist/chunks/main.mjs +0 -635
  125. package/dist/chunks/manager.mjs +0 -1048
  126. package/dist/chunks/marketplace.mjs +0 -265
  127. package/dist/chunks/mcp-cli.mjs +0 -205
  128. package/dist/chunks/mcp-performance.mjs +0 -187
  129. package/dist/chunks/mcp.mjs +0 -667
  130. package/dist/chunks/memory-check.mjs +0 -2973
  131. package/dist/chunks/memory-paths.mjs +0 -259
  132. package/dist/chunks/memory-sync.mjs +0 -209
  133. package/dist/chunks/memory.mjs +0 -354
  134. package/dist/chunks/metrics-display.mjs +0 -153
  135. package/dist/chunks/monitor.mjs +0 -1856
  136. package/dist/chunks/notification.mjs +0 -1864
  137. package/dist/chunks/onboarding.mjs +0 -386
  138. package/dist/chunks/package.mjs +0 -3
  139. package/dist/chunks/paradigm.mjs +0 -74
  140. package/dist/chunks/permission-manager.mjs +0 -250
  141. package/dist/chunks/permissions.mjs +0 -265
  142. package/dist/chunks/persistence-manager.mjs +0 -801
  143. package/dist/chunks/persistence.mjs +0 -707
  144. package/dist/chunks/platform.mjs +0 -395
  145. package/dist/chunks/plugin.mjs +0 -1936
  146. package/dist/chunks/powershell.mjs +0 -213
  147. package/dist/chunks/prompts.mjs +0 -244
  148. package/dist/chunks/providers.mjs +0 -263
  149. package/dist/chunks/quick-actions.mjs +0 -335
  150. package/dist/chunks/quick-provider.mjs +0 -755
  151. package/dist/chunks/quick-setup.mjs +0 -421
  152. package/dist/chunks/remote.mjs +0 -497
  153. package/dist/chunks/research.mjs +0 -1904
  154. package/dist/chunks/rollback.mjs +0 -38
  155. package/dist/chunks/session-manager.mjs +0 -1371
  156. package/dist/chunks/session.mjs +0 -878
  157. package/dist/chunks/sessions.mjs +0 -106
  158. package/dist/chunks/silent-updater.mjs +0 -396
  159. package/dist/chunks/simple-config.mjs +0 -122
  160. package/dist/chunks/skill.mjs +0 -117
  161. package/dist/chunks/skill2.mjs +0 -9052
  162. package/dist/chunks/skills-sync.mjs +0 -1343
  163. package/dist/chunks/skills.mjs +0 -577
  164. package/dist/chunks/slash-commands.mjs +0 -208
  165. package/dist/chunks/smart-guide.mjs +0 -247
  166. package/dist/chunks/snapshot.mjs +0 -58
  167. package/dist/chunks/startup.mjs +0 -487
  168. package/dist/chunks/stats.mjs +0 -191
  169. package/dist/chunks/status.mjs +0 -471
  170. package/dist/chunks/team.mjs +0 -63
  171. package/dist/chunks/thinking.mjs +0 -626
  172. package/dist/chunks/trace.mjs +0 -57
  173. package/dist/chunks/uninstall.mjs +0 -852
  174. package/dist/chunks/update.mjs +0 -174
  175. package/dist/chunks/upgrade-manager.mjs +0 -204
  176. package/dist/chunks/upgrade.mjs +0 -133
  177. package/dist/chunks/version-checker.mjs +0 -891
  178. package/dist/chunks/vim.mjs +0 -903
  179. package/dist/chunks/windows.mjs +0 -14
  180. package/dist/chunks/workflows.mjs +0 -633
  181. package/dist/chunks/wsl.mjs +0 -129
  182. package/dist/chunks/zero-config.mjs +0 -871
  183. package/dist/chunks/zsh.mjs +0 -182
  184. package/dist/cli.d.mts +0 -1
  185. package/dist/cli.d.ts +0 -1
  186. package/dist/cli.mjs +0 -2684
  187. package/dist/i18n/locales/en/agent-teams.json +0 -18
  188. package/dist/i18n/locales/en/agentBrowser.json +0 -80
  189. package/dist/i18n/locales/en/agents.json +0 -135
  190. package/dist/i18n/locales/en/api.json +0 -63
  191. package/dist/i18n/locales/en/ccjk-agents.json +0 -33
  192. package/dist/i18n/locales/en/ccjk-all.json +0 -23
  193. package/dist/i18n/locales/en/ccjk-skills.json +0 -22
  194. package/dist/i18n/locales/en/ccjk.json +0 -276
  195. package/dist/i18n/locales/en/ccr.json +0 -65
  196. package/dist/i18n/locales/en/claude-md.json +0 -73
  197. package/dist/i18n/locales/en/cli.json +0 -148
  198. package/dist/i18n/locales/en/cloud-setup.json +0 -31
  199. package/dist/i18n/locales/en/cloud-sync.json +0 -147
  200. package/dist/i18n/locales/en/cloud.json +0 -40
  201. package/dist/i18n/locales/en/cloudPlugins.json +0 -118
  202. package/dist/i18n/locales/en/codex.json +0 -184
  203. package/dist/i18n/locales/en/cometix.json +0 -29
  204. package/dist/i18n/locales/en/common.json +0 -68
  205. package/dist/i18n/locales/en/config.json +0 -108
  206. package/dist/i18n/locales/en/configuration.json +0 -236
  207. package/dist/i18n/locales/en/context.json +0 -85
  208. package/dist/i18n/locales/en/dashboard.json +0 -78
  209. package/dist/i18n/locales/en/errors.json +0 -26
  210. package/dist/i18n/locales/en/evolution.json +0 -54
  211. package/dist/i18n/locales/en/hooks.json +0 -74
  212. package/dist/i18n/locales/en/hooksSync.json +0 -133
  213. package/dist/i18n/locales/en/installation.json +0 -83
  214. package/dist/i18n/locales/en/interview.json +0 -104
  215. package/dist/i18n/locales/en/language.json +0 -19
  216. package/dist/i18n/locales/en/lsp.json +0 -78
  217. package/dist/i18n/locales/en/marketplace.json +0 -116
  218. package/dist/i18n/locales/en/mcp.json +0 -180
  219. package/dist/i18n/locales/en/memory.json +0 -23
  220. package/dist/i18n/locales/en/menu.json +0 -299
  221. package/dist/i18n/locales/en/multi-config.json +0 -79
  222. package/dist/i18n/locales/en/notification.json +0 -307
  223. package/dist/i18n/locales/en/permissions.json +0 -95
  224. package/dist/i18n/locales/en/persistence.json +0 -127
  225. package/dist/i18n/locales/en/plugins.json +0 -146
  226. package/dist/i18n/locales/en/quick-actions.json +0 -78
  227. package/dist/i18n/locales/en/registry.json +0 -54
  228. package/dist/i18n/locales/en/remote.json +0 -93
  229. package/dist/i18n/locales/en/sandbox.json +0 -44
  230. package/dist/i18n/locales/en/setup.json +0 -44
  231. package/dist/i18n/locales/en/shencha.json +0 -14
  232. package/dist/i18n/locales/en/skills.json +0 -100
  233. package/dist/i18n/locales/en/skillsSync.json +0 -74
  234. package/dist/i18n/locales/en/smartGuide.json +0 -49
  235. package/dist/i18n/locales/en/stats.json +0 -20
  236. package/dist/i18n/locales/en/subagent.json +0 -69
  237. package/dist/i18n/locales/en/superpowers.json +0 -117
  238. package/dist/i18n/locales/en/team.json +0 -7
  239. package/dist/i18n/locales/en/thinking.json +0 -65
  240. package/dist/i18n/locales/en/tools.json +0 -42
  241. package/dist/i18n/locales/en/uninstall.json +0 -56
  242. package/dist/i18n/locales/en/updater.json +0 -29
  243. package/dist/i18n/locales/en/vim.json +0 -169
  244. package/dist/i18n/locales/en/workflow.json +0 -55
  245. package/dist/i18n/locales/en/workspace.json +0 -108
  246. package/dist/i18n/locales/zh-CN/agent-teams.json +0 -18
  247. package/dist/i18n/locales/zh-CN/agentBrowser.json +0 -80
  248. package/dist/i18n/locales/zh-CN/agents.json +0 -135
  249. package/dist/i18n/locales/zh-CN/api.json +0 -63
  250. package/dist/i18n/locales/zh-CN/ccjk-agents.json +0 -33
  251. package/dist/i18n/locales/zh-CN/ccjk-all.json +0 -23
  252. package/dist/i18n/locales/zh-CN/ccjk-skills.json +0 -22
  253. package/dist/i18n/locales/zh-CN/ccjk.json +0 -276
  254. package/dist/i18n/locales/zh-CN/ccr.json +0 -65
  255. package/dist/i18n/locales/zh-CN/claude-md.json +0 -73
  256. package/dist/i18n/locales/zh-CN/cli.json +0 -148
  257. package/dist/i18n/locales/zh-CN/cloud-setup.json +0 -31
  258. package/dist/i18n/locales/zh-CN/cloud-sync.json +0 -147
  259. package/dist/i18n/locales/zh-CN/cloud.json +0 -40
  260. package/dist/i18n/locales/zh-CN/cloudPlugins.json +0 -118
  261. package/dist/i18n/locales/zh-CN/codex.json +0 -184
  262. package/dist/i18n/locales/zh-CN/cometix.json +0 -29
  263. package/dist/i18n/locales/zh-CN/common.json +0 -68
  264. package/dist/i18n/locales/zh-CN/config.json +0 -108
  265. package/dist/i18n/locales/zh-CN/configuration.json +0 -234
  266. package/dist/i18n/locales/zh-CN/context.json +0 -85
  267. package/dist/i18n/locales/zh-CN/dashboard.json +0 -78
  268. package/dist/i18n/locales/zh-CN/errors.json +0 -26
  269. package/dist/i18n/locales/zh-CN/evolution.json +0 -54
  270. package/dist/i18n/locales/zh-CN/hooks.json +0 -74
  271. package/dist/i18n/locales/zh-CN/hooksSync.json +0 -133
  272. package/dist/i18n/locales/zh-CN/installation.json +0 -83
  273. package/dist/i18n/locales/zh-CN/interview.json +0 -104
  274. package/dist/i18n/locales/zh-CN/language.json +0 -19
  275. package/dist/i18n/locales/zh-CN/lsp.json +0 -78
  276. package/dist/i18n/locales/zh-CN/marketplace.json +0 -116
  277. package/dist/i18n/locales/zh-CN/mcp.json +0 -180
  278. package/dist/i18n/locales/zh-CN/memory.json +0 -23
  279. package/dist/i18n/locales/zh-CN/menu.json +0 -299
  280. package/dist/i18n/locales/zh-CN/multi-config.json +0 -79
  281. package/dist/i18n/locales/zh-CN/notification.json +0 -307
  282. package/dist/i18n/locales/zh-CN/permissions.json +0 -95
  283. package/dist/i18n/locales/zh-CN/persistence.json +0 -127
  284. package/dist/i18n/locales/zh-CN/plugins.json +0 -146
  285. package/dist/i18n/locales/zh-CN/quick-actions.json +0 -78
  286. package/dist/i18n/locales/zh-CN/registry.json +0 -54
  287. package/dist/i18n/locales/zh-CN/remote.json +0 -93
  288. package/dist/i18n/locales/zh-CN/sandbox.json +0 -44
  289. package/dist/i18n/locales/zh-CN/setup.json +0 -44
  290. package/dist/i18n/locales/zh-CN/shencha.json +0 -14
  291. package/dist/i18n/locales/zh-CN/skills.json +0 -100
  292. package/dist/i18n/locales/zh-CN/skillsSync.json +0 -74
  293. package/dist/i18n/locales/zh-CN/smartGuide.json +0 -49
  294. package/dist/i18n/locales/zh-CN/stats.json +0 -20
  295. package/dist/i18n/locales/zh-CN/subagent.json +0 -69
  296. package/dist/i18n/locales/zh-CN/superpowers.json +0 -117
  297. package/dist/i18n/locales/zh-CN/team.json +0 -7
  298. package/dist/i18n/locales/zh-CN/thinking.json +0 -65
  299. package/dist/i18n/locales/zh-CN/tools.json +0 -42
  300. package/dist/i18n/locales/zh-CN/uninstall.json +0 -56
  301. package/dist/i18n/locales/zh-CN/updater.json +0 -29
  302. package/dist/i18n/locales/zh-CN/vim.json +0 -169
  303. package/dist/i18n/locales/zh-CN/workflow.json +0 -55
  304. package/dist/i18n/locales/zh-CN/workspace.json +0 -108
  305. package/dist/index.d.mts +0 -5658
  306. package/dist/index.d.ts +0 -5658
  307. package/dist/index.mjs +0 -3732
  308. package/dist/shared/ccjk.5bEolFrk.mjs +0 -254
  309. package/dist/shared/ccjk.8oaxX4iR.mjs +0 -90
  310. package/dist/shared/ccjk.B2U7DsPy.mjs +0 -31
  311. package/dist/shared/ccjk.B2f-cwUP.mjs +0 -468
  312. package/dist/shared/ccjk.BAGoDD49.mjs +0 -36
  313. package/dist/shared/ccjk.BBtCGd_g.mjs +0 -899
  314. package/dist/shared/ccjk.BFQ7yr5S.mjs +0 -16
  315. package/dist/shared/ccjk.BLsIiTqO.mjs +0 -449
  316. package/dist/shared/ccjk.BXv8aYs1.mjs +0 -170
  317. package/dist/shared/ccjk.BnsY5WxD.mjs +0 -171
  318. package/dist/shared/ccjk.BoApaI4j.mjs +0 -28
  319. package/dist/shared/ccjk.Bq8TqZG_.mjs +0 -189
  320. package/dist/shared/ccjk.BtrioX1Z.mjs +0 -25
  321. package/dist/shared/ccjk.Bx_rmYfN.mjs +0 -69
  322. package/dist/shared/ccjk.BzPbSEP2.mjs +0 -115
  323. package/dist/shared/ccjk.C0WLUnFV.mjs +0 -293
  324. package/dist/shared/ccjk.C1hANZTu.mjs +0 -19
  325. package/dist/shared/ccjk.C2jHOZVP.mjs +0 -52
  326. package/dist/shared/ccjk.CNhnT6uQ.mjs +0 -636
  327. package/dist/shared/ccjk.COweQ1RR.mjs +0 -5
  328. package/dist/shared/ccjk.CfKKcvWy.mjs +0 -126
  329. package/dist/shared/ccjk.Cjgrln_h.mjs +0 -297
  330. package/dist/shared/ccjk.CoCHVXl3.mjs +0 -3951
  331. package/dist/shared/ccjk.CwGZSTAK.mjs +0 -319
  332. package/dist/shared/ccjk.CxpGa6MC.mjs +0 -2724
  333. package/dist/shared/ccjk.D-magaEx.mjs +0 -763
  334. package/dist/shared/ccjk.D0g2ABGg.mjs +0 -171
  335. package/dist/shared/ccjk.D6ycHbak.mjs +0 -270
  336. package/dist/shared/ccjk.D75wivnp.mjs +0 -142
  337. package/dist/shared/ccjk.DDL-4C-k.mjs +0 -100
  338. package/dist/shared/ccjk.DFRPtmK_.mjs +0 -75
  339. package/dist/shared/ccjk.DMV3x5Sd.mjs +0 -299
  340. package/dist/shared/ccjk.DZ2LLOa-.mjs +0 -2195
  341. package/dist/shared/ccjk.DbigonEQ.mjs +0 -698
  342. package/dist/shared/ccjk.DcMvE7lf.mjs +0 -618
  343. package/dist/shared/ccjk.DeWpAShp.mjs +0 -1828
  344. package/dist/shared/ccjk.DhJ1kyDR.mjs +0 -30
  345. package/dist/shared/ccjk.DlTXS9rP.mjs +0 -224
  346. package/dist/shared/ccjk.DopKzo3z.mjs +0 -305
  347. package/dist/shared/ccjk.DsZsc4LR.mjs +0 -1280
  348. package/dist/shared/ccjk.DuzJZlgj.mjs +0 -418
  349. package/dist/shared/ccjk.Dxgd2vjc.mjs +0 -444
  350. package/dist/shared/ccjk.J8YiPsOw.mjs +0 -259
  351. package/dist/shared/ccjk.KfSWcGlE.mjs +0 -38
  352. package/dist/shared/ccjk.L7yC58_i.mjs +0 -225
  353. package/dist/shared/ccjk.MwtjAULc.mjs +0 -1447
  354. package/dist/shared/ccjk.OJKHVSOb.mjs +0 -2005
  355. package/dist/shared/ccjk.OTnevPNE.mjs +0 -225
  356. package/dist/shared/ccjk.RyizuzOI.mjs +0 -21
  357. package/dist/shared/ccjk.T_cX87dY.mjs +0 -15
  358. package/dist/shared/ccjk.bQ7Dh1g4.mjs +0 -249
  359. package/dist/shared/ccjk.gDEDGD_t.mjs +0 -38
  360. package/dist/shared/ccjk.hoqrwWdN.mjs +0 -333
  361. package/dist/shared/ccjk.i_vn-9C3.mjs +0 -317
  362. package/dist/shared/ccjk.lG3ccFjm.mjs +0 -885
  363. package/dist/shared/ccjk.wLJHO0Af.mjs +0 -244
  364. package/dist/shared/ccjk.y-a_1vK4.mjs +0 -5127
  365. package/dist/templates/agents/README.md +0 -78
  366. package/dist/templates/agents/fullstack-developer.json +0 -70
  367. package/dist/templates/agents/go-expert.json +0 -69
  368. package/dist/templates/agents/index.json +0 -64
  369. package/dist/templates/agents/python-expert.json +0 -69
  370. package/dist/templates/agents/react-specialist.json +0 -69
  371. package/dist/templates/agents/testing-automation-expert.json +0 -70
  372. package/dist/templates/agents/typescript-architect.json +0 -69
  373. package/dist/templates/claude-code/common/settings.json +0 -109
  374. package/dist/templates/common/error-prevention.md +0 -267
  375. package/dist/templates/common/karpathy-baseline.md +0 -83
  376. package/dist/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  377. package/dist/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
  378. package/dist/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  379. package/dist/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  380. package/dist/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  381. package/dist/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  382. package/dist/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  383. package/dist/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  384. package/dist/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  385. package/dist/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  386. package/dist/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  387. package/dist/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  388. package/dist/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  389. package/dist/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  390. package/dist/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  391. package/dist/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  392. package/dist/templates/common/workflow/essential/en/feat.md +0 -92
  393. package/dist/templates/common/workflow/essential/en/goal.md +0 -147
  394. package/dist/templates/common/workflow/essential/en/init-project.md +0 -53
  395. package/dist/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  396. package/dist/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  397. package/dist/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  398. package/dist/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  399. package/dist/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  400. package/dist/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  401. package/dist/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  402. package/dist/templates/common/workflow/git/en/git-commit.md +0 -205
  403. package/dist/templates/common/workflow/git/en/git-rollback.md +0 -90
  404. package/dist/templates/common/workflow/git/en/git-worktree.md +0 -276
  405. package/dist/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  406. package/dist/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  407. package/dist/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  408. package/dist/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  409. package/dist/templates/common/workflow/interview/en/interview.md +0 -67
  410. package/dist/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  411. package/dist/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  412. package/dist/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  413. package/dist/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  414. package/dist/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  415. package/dist/templates/common/workflow/sixStep/en/workflow.md +0 -83
  416. package/dist/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  417. package/dist/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  418. package/dist/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  419. package/dist/templates/hooks/README.md +0 -212
  420. package/dist/templates/hooks/git-workflow-hooks.md +0 -551
  421. package/dist/templates/hooks/post-test/coverage.json +0 -21
  422. package/dist/templates/hooks/post-test/summary.json +0 -21
  423. package/dist/templates/hooks/post-test-coverage.md +0 -434
  424. package/dist/templates/hooks/pre-commit/eslint.json +0 -22
  425. package/dist/templates/hooks/pre-commit/prettier.json +0 -22
  426. package/dist/templates/hooks/pre-commit-black.md +0 -274
  427. package/dist/templates/hooks/pre-commit-eslint.md +0 -153
  428. package/dist/templates/hooks/pre-commit-gofmt.md +0 -284
  429. package/dist/templates/hooks/pre-commit-prettier.md +0 -212
  430. package/dist/templates/hooks/pre-commit-type-check.md +0 -377
  431. package/dist/templates/skills/ccjk-init.md +0 -154
  432. package/dist/templates/skills/ccjk-mcp-setup.md +0 -205
  433. package/dist/templates/skills/ccjk-troubleshoot.md +0 -228
  434. package/dist/templates/skills/django-patterns.md +0 -1016
  435. package/dist/templates/skills/git-workflow.md +0 -748
  436. package/dist/templates/skills/go-idioms.md +0 -963
  437. package/dist/templates/skills/index.json +0 -132
  438. package/dist/templates/skills/nextjs-optimization.md +0 -694
  439. package/dist/templates/skills/python-pep8.md +0 -852
  440. package/dist/templates/skills/react-patterns.md +0 -686
  441. package/dist/templates/skills/rust-patterns.md +0 -1057
  442. package/dist/templates/skills/security-best-practices.md +0 -1413
  443. package/dist/templates/skills/testing-best-practices.md +0 -1315
  444. package/dist/templates/skills/ts-best-practices.md +0 -354
  445. package/templates/agents/README.md +0 -78
  446. package/templates/agents/fullstack-developer.json +0 -70
  447. package/templates/agents/go-expert.json +0 -69
  448. package/templates/agents/index.json +0 -64
  449. package/templates/agents/python-expert.json +0 -69
  450. package/templates/agents/react-specialist.json +0 -69
  451. package/templates/agents/testing-automation-expert.json +0 -70
  452. package/templates/agents/typescript-architect.json +0 -69
  453. package/templates/claude-code/common/settings.json +0 -109
  454. package/templates/common/error-prevention.md +0 -267
  455. package/templates/common/karpathy-baseline.md +0 -83
  456. package/templates/common/output-styles/zh-CN/carmack-mode.md +0 -381
  457. package/templates/common/output-styles/zh-CN/codex-rigor-mode.md +0 -114
  458. package/templates/common/output-styles/zh-CN/dhh-mode.md +0 -265
  459. package/templates/common/output-styles/zh-CN/evan-you-mode.md +0 -539
  460. package/templates/common/output-styles/zh-CN/jobs-mode.md +0 -369
  461. package/templates/common/output-styles/zh-CN/linus-mode.md +0 -135
  462. package/templates/common/output-styles/zh-CN/uncle-bob-mode.md +0 -221
  463. package/templates/common/workflow/continuousDelivery/en/continuous-delivery.md +0 -628
  464. package/templates/common/workflow/continuousDelivery/zh-CN/continuous-delivery.md +0 -628
  465. package/templates/common/workflow/essential/en/agents/ccjk-config-agent.md +0 -187
  466. package/templates/common/workflow/essential/en/agents/ccjk-mcp-agent.md +0 -191
  467. package/templates/common/workflow/essential/en/agents/ccjk-skill-agent.md +0 -249
  468. package/templates/common/workflow/essential/en/agents/ccjk-workflow-agent.md +0 -277
  469. package/templates/common/workflow/essential/en/agents/get-current-datetime.md +0 -29
  470. package/templates/common/workflow/essential/en/agents/init-architect.md +0 -115
  471. package/templates/common/workflow/essential/en/agents/ui-ux-designer.md +0 -91
  472. package/templates/common/workflow/essential/en/feat.md +0 -92
  473. package/templates/common/workflow/essential/en/goal.md +0 -147
  474. package/templates/common/workflow/essential/en/init-project.md +0 -53
  475. package/templates/common/workflow/essential/zh-CN/agents/get-current-datetime.md +0 -29
  476. package/templates/common/workflow/essential/zh-CN/agents/init-architect.md +0 -115
  477. package/templates/common/workflow/essential/zh-CN/agents/ui-ux-designer.md +0 -91
  478. package/templates/common/workflow/essential/zh-CN/feat.md +0 -315
  479. package/templates/common/workflow/essential/zh-CN/goal.md +0 -146
  480. package/templates/common/workflow/essential/zh-CN/init-project.md +0 -53
  481. package/templates/common/workflow/git/en/git-cleanBranches.md +0 -102
  482. package/templates/common/workflow/git/en/git-commit.md +0 -205
  483. package/templates/common/workflow/git/en/git-rollback.md +0 -90
  484. package/templates/common/workflow/git/en/git-worktree.md +0 -276
  485. package/templates/common/workflow/git/zh-CN/git-cleanBranches.md +0 -102
  486. package/templates/common/workflow/git/zh-CN/git-commit.md +0 -205
  487. package/templates/common/workflow/git/zh-CN/git-rollback.md +0 -90
  488. package/templates/common/workflow/git/zh-CN/git-worktree.md +0 -276
  489. package/templates/common/workflow/interview/en/interview.md +0 -67
  490. package/templates/common/workflow/interview/zh-CN/interview.md +0 -67
  491. package/templates/common/workflow/linearMethod/en/linear-method.md +0 -651
  492. package/templates/common/workflow/linearMethod/zh-CN/linear-method.md +0 -752
  493. package/templates/common/workflow/refactoringMaster/en/refactoring-master.md +0 -516
  494. package/templates/common/workflow/refactoringMaster/zh-CN/refactoring-master.md +0 -812
  495. package/templates/common/workflow/sixStep/en/workflow.md +0 -83
  496. package/templates/common/workflow/sixStep/zh-CN/workflow.md +0 -359
  497. package/templates/common/workflow/specFirstTDD/en/spec-first-tdd.md +0 -364
  498. package/templates/common/workflow/specFirstTDD/zh-CN/spec-first-tdd.md +0 -366
  499. package/templates/hooks/README.md +0 -212
  500. package/templates/hooks/git-workflow-hooks.md +0 -551
  501. package/templates/hooks/post-test/coverage.json +0 -21
  502. package/templates/hooks/post-test/summary.json +0 -21
  503. package/templates/hooks/post-test-coverage.md +0 -434
  504. package/templates/hooks/pre-commit/eslint.json +0 -22
  505. package/templates/hooks/pre-commit/prettier.json +0 -22
  506. package/templates/hooks/pre-commit-black.md +0 -274
  507. package/templates/hooks/pre-commit-eslint.md +0 -153
  508. package/templates/hooks/pre-commit-gofmt.md +0 -284
  509. package/templates/hooks/pre-commit-prettier.md +0 -212
  510. package/templates/hooks/pre-commit-type-check.md +0 -377
  511. package/templates/skills/basic.hbs +0 -72
  512. package/templates/skills/ccjk-init.md +0 -154
  513. package/templates/skills/ccjk-mcp-setup.md +0 -205
  514. package/templates/skills/ccjk-troubleshoot.md +0 -228
  515. package/templates/skills/code-refactor.hbs +0 -133
  516. package/templates/skills/code-review.hbs +0 -141
  517. package/templates/skills/django-patterns.md +0 -1016
  518. package/templates/skills/git-workflow.md +0 -748
  519. package/templates/skills/go-idioms.md +0 -963
  520. package/templates/skills/index.json +0 -132
  521. package/templates/skills/nextjs-optimization.md +0 -694
  522. package/templates/skills/python-pep8.md +0 -852
  523. package/templates/skills/react-patterns.md +0 -686
  524. package/templates/skills/rust-patterns.md +0 -1057
  525. package/templates/skills/security-best-practices.md +0 -1413
  526. package/templates/skills/testing-best-practices.md +0 -1315
  527. package/templates/skills/ts-best-practices.md +0 -354
  528. package/templates/skills/type-fix.hbs +0 -132
@@ -1,2195 +0,0 @@
1
- import { g as getDefaultExportFromCjs } from './ccjk.BAGoDD49.mjs';
2
- import require$$0 from 'node:async_hooks';
3
- import { r as requireCliSpinners } from './ccjk.DeWpAShp.mjs';
4
- import { r as requireCliWidth, a as requireWrapAnsi, b as requireStripAnsi } from '../chunks/index6.mjs';
5
- import readline__default from 'node:readline';
6
- import require$$0$1 from 'stream';
7
- import process__default from 'node:process';
8
-
9
- var dist = {};
10
-
11
- var cjs$2 = {};
12
-
13
- var key = {};
14
-
15
- var hasRequiredKey;
16
-
17
- function requireKey () {
18
- if (hasRequiredKey) return key;
19
- hasRequiredKey = 1;
20
- Object.defineProperty(key, "__esModule", { value: true });
21
- key.isEnterKey = key.isNumberKey = key.isBackspaceKey = key.isSpaceKey = key.isDownKey = key.isUpKey = void 0;
22
- const isUpKey = (key) =>
23
- // The up key
24
- key.name === 'up' ||
25
- // Vim keybinding
26
- key.name === 'k' ||
27
- // Emacs keybinding
28
- (key.ctrl && key.name === 'p');
29
- key.isUpKey = isUpKey;
30
- const isDownKey = (key) =>
31
- // The down key
32
- key.name === 'down' ||
33
- // Vim keybinding
34
- key.name === 'j' ||
35
- // Emacs keybinding
36
- (key.ctrl && key.name === 'n');
37
- key.isDownKey = isDownKey;
38
- const isSpaceKey = (key) => key.name === 'space';
39
- key.isSpaceKey = isSpaceKey;
40
- const isBackspaceKey = (key) => key.name === 'backspace';
41
- key.isBackspaceKey = isBackspaceKey;
42
- const isNumberKey = (key) => '123456789'.includes(key.name);
43
- key.isNumberKey = isNumberKey;
44
- const isEnterKey = (key) => key.name === 'enter' || key.name === 'return';
45
- key.isEnterKey = isEnterKey;
46
- return key;
47
- }
48
-
49
- var errors = {};
50
-
51
- var hasRequiredErrors;
52
-
53
- function requireErrors () {
54
- if (hasRequiredErrors) return errors;
55
- hasRequiredErrors = 1;
56
- Object.defineProperty(errors, "__esModule", { value: true });
57
- errors.ValidationError = errors.HookError = errors.ExitPromptError = errors.CancelPromptError = void 0;
58
- class CancelPromptError extends Error {
59
- constructor() {
60
- super(...arguments);
61
- Object.defineProperty(this, "message", {
62
- enumerable: true,
63
- configurable: true,
64
- writable: true,
65
- value: 'Prompt was canceled'
66
- });
67
- }
68
- }
69
- errors.CancelPromptError = CancelPromptError;
70
- class ExitPromptError extends Error {
71
- }
72
- errors.ExitPromptError = ExitPromptError;
73
- class HookError extends Error {
74
- }
75
- errors.HookError = HookError;
76
- class ValidationError extends Error {
77
- }
78
- errors.ValidationError = ValidationError;
79
- return errors;
80
- }
81
-
82
- var usePrefix = {};
83
-
84
- var useState = {};
85
-
86
- var hookEngine = {};
87
-
88
- var hasRequiredHookEngine;
89
-
90
- function requireHookEngine () {
91
- if (hasRequiredHookEngine) return hookEngine;
92
- hasRequiredHookEngine = 1;
93
- /* eslint @typescript-eslint/no-explicit-any: ["off"] */
94
- Object.defineProperty(hookEngine, "__esModule", { value: true });
95
- hookEngine.effectScheduler = void 0;
96
- hookEngine.withHooks = withHooks;
97
- hookEngine.readline = readline;
98
- hookEngine.withUpdates = withUpdates;
99
- hookEngine.withPointer = withPointer;
100
- hookEngine.handleChange = handleChange;
101
- const node_async_hooks_1 = require$$0;
102
- const errors_mjs_1 = /*@__PURE__*/ requireErrors();
103
- const hookStorage = new node_async_hooks_1.AsyncLocalStorage();
104
- function createStore(rl) {
105
- const store = {
106
- rl,
107
- hooks: [],
108
- hooksCleanup: [],
109
- hooksEffect: [],
110
- index: 0,
111
- handleChange() { },
112
- };
113
- return store;
114
- }
115
- // Run callback in with the hook engine setup.
116
- function withHooks(rl, cb) {
117
- const store = createStore(rl);
118
- return hookStorage.run(store, () => {
119
- cb(store);
120
- });
121
- }
122
- // Safe getStore utility that'll return the store or throw if undefined.
123
- function getStore() {
124
- const store = hookStorage.getStore();
125
- if (!store) {
126
- throw new errors_mjs_1.HookError('[Inquirer] Hook functions can only be called from within a prompt');
127
- }
128
- return store;
129
- }
130
- function readline() {
131
- return getStore().rl;
132
- }
133
- // Merge state updates happening within the callback function to avoid multiple renders.
134
- function withUpdates(fn) {
135
- const wrapped = (...args) => {
136
- const store = getStore();
137
- let shouldUpdate = false;
138
- const oldHandleChange = store.handleChange;
139
- store.handleChange = () => {
140
- shouldUpdate = true;
141
- };
142
- const returnValue = fn(...args);
143
- if (shouldUpdate) {
144
- oldHandleChange();
145
- }
146
- store.handleChange = oldHandleChange;
147
- return returnValue;
148
- };
149
- return node_async_hooks_1.AsyncResource.bind(wrapped);
150
- }
151
- function withPointer(cb) {
152
- const store = getStore();
153
- const { index } = store;
154
- const pointer = {
155
- get() {
156
- return store.hooks[index];
157
- },
158
- set(value) {
159
- store.hooks[index] = value;
160
- },
161
- initialized: index in store.hooks,
162
- };
163
- const returnValue = cb(pointer);
164
- store.index++;
165
- return returnValue;
166
- }
167
- function handleChange() {
168
- getStore().handleChange();
169
- }
170
- hookEngine.effectScheduler = {
171
- queue(cb) {
172
- const store = getStore();
173
- const { index } = store;
174
- store.hooksEffect.push(() => {
175
- var _a, _b;
176
- (_b = (_a = store.hooksCleanup)[index]) === null || _b === void 0 ? void 0 : _b.call(_a);
177
- const cleanFn = cb(readline());
178
- if (cleanFn != null && typeof cleanFn !== 'function') {
179
- throw new errors_mjs_1.ValidationError('useEffect return value must be a cleanup function or nothing.');
180
- }
181
- store.hooksCleanup[index] = cleanFn;
182
- });
183
- },
184
- run() {
185
- const store = getStore();
186
- withUpdates(() => {
187
- store.hooksEffect.forEach((effect) => {
188
- effect();
189
- });
190
- // Warning: Clean the hooks before exiting the `withUpdates` block.
191
- // Failure to do so means an updates would hit the same effects again.
192
- store.hooksEffect.length = 0;
193
- })();
194
- },
195
- };
196
- return hookEngine;
197
- }
198
-
199
- var hasRequiredUseState;
200
-
201
- function requireUseState () {
202
- if (hasRequiredUseState) return useState;
203
- hasRequiredUseState = 1;
204
- Object.defineProperty(useState, "__esModule", { value: true });
205
- useState.useState = useState$1;
206
- const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
207
- function useState$1(defaultValue) {
208
- return (0, hook_engine_mjs_1.withPointer)((pointer) => {
209
- const setFn = (newValue) => {
210
- // Noop if the value is still the same.
211
- if (pointer.get() !== newValue) {
212
- pointer.set(newValue);
213
- // Trigger re-render
214
- (0, hook_engine_mjs_1.handleChange)();
215
- }
216
- };
217
- if (pointer.initialized) {
218
- return [pointer.get(), setFn];
219
- }
220
- const value = typeof defaultValue === 'function' ? defaultValue() : defaultValue;
221
- pointer.set(value);
222
- return [value, setFn];
223
- });
224
- }
225
- return useState;
226
- }
227
-
228
- var useEffect = {};
229
-
230
- var hasRequiredUseEffect;
231
-
232
- function requireUseEffect () {
233
- if (hasRequiredUseEffect) return useEffect;
234
- hasRequiredUseEffect = 1;
235
- Object.defineProperty(useEffect, "__esModule", { value: true });
236
- useEffect.useEffect = useEffect$1;
237
- const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
238
- function useEffect$1(cb, depArray) {
239
- (0, hook_engine_mjs_1.withPointer)((pointer) => {
240
- const oldDeps = pointer.get();
241
- const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
242
- if (hasChanged) {
243
- hook_engine_mjs_1.effectScheduler.queue(cb);
244
- }
245
- pointer.set(depArray);
246
- });
247
- }
248
- return useEffect;
249
- }
250
-
251
- var makeTheme = {};
252
-
253
- var theme = {};
254
-
255
- var picocolors = {exports: {}};
256
-
257
- var hasRequiredPicocolors;
258
-
259
- function requirePicocolors () {
260
- if (hasRequiredPicocolors) return picocolors.exports;
261
- hasRequiredPicocolors = 1;
262
- let p = process || {}, argv = p.argv || [], env = p.env || {};
263
- let isColorSupported =
264
- !(!!env.NO_COLOR || argv.includes("--no-color")) &&
265
- (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI);
266
-
267
- let formatter = (open, close, replace = open) =>
268
- input => {
269
- let string = "" + input, index = string.indexOf(close, open.length);
270
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
271
- };
272
-
273
- let replaceClose = (string, close, replace, index) => {
274
- let result = "", cursor = 0;
275
- do {
276
- result += string.substring(cursor, index) + replace;
277
- cursor = index + close.length;
278
- index = string.indexOf(close, cursor);
279
- } while (~index)
280
- return result + string.substring(cursor)
281
- };
282
-
283
- let createColors = (enabled = isColorSupported) => {
284
- let f = enabled ? formatter : () => String;
285
- return {
286
- isColorSupported: enabled,
287
- reset: f("\x1b[0m", "\x1b[0m"),
288
- bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
289
- dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
290
- italic: f("\x1b[3m", "\x1b[23m"),
291
- underline: f("\x1b[4m", "\x1b[24m"),
292
- inverse: f("\x1b[7m", "\x1b[27m"),
293
- hidden: f("\x1b[8m", "\x1b[28m"),
294
- strikethrough: f("\x1b[9m", "\x1b[29m"),
295
-
296
- black: f("\x1b[30m", "\x1b[39m"),
297
- red: f("\x1b[31m", "\x1b[39m"),
298
- green: f("\x1b[32m", "\x1b[39m"),
299
- yellow: f("\x1b[33m", "\x1b[39m"),
300
- blue: f("\x1b[34m", "\x1b[39m"),
301
- magenta: f("\x1b[35m", "\x1b[39m"),
302
- cyan: f("\x1b[36m", "\x1b[39m"),
303
- white: f("\x1b[37m", "\x1b[39m"),
304
- gray: f("\x1b[90m", "\x1b[39m"),
305
-
306
- bgBlack: f("\x1b[40m", "\x1b[49m"),
307
- bgRed: f("\x1b[41m", "\x1b[49m"),
308
- bgGreen: f("\x1b[42m", "\x1b[49m"),
309
- bgYellow: f("\x1b[43m", "\x1b[49m"),
310
- bgBlue: f("\x1b[44m", "\x1b[49m"),
311
- bgMagenta: f("\x1b[45m", "\x1b[49m"),
312
- bgCyan: f("\x1b[46m", "\x1b[49m"),
313
- bgWhite: f("\x1b[47m", "\x1b[49m"),
314
-
315
- blackBright: f("\x1b[90m", "\x1b[39m"),
316
- redBright: f("\x1b[91m", "\x1b[39m"),
317
- greenBright: f("\x1b[92m", "\x1b[39m"),
318
- yellowBright: f("\x1b[93m", "\x1b[39m"),
319
- blueBright: f("\x1b[94m", "\x1b[39m"),
320
- magentaBright: f("\x1b[95m", "\x1b[39m"),
321
- cyanBright: f("\x1b[96m", "\x1b[39m"),
322
- whiteBright: f("\x1b[97m", "\x1b[39m"),
323
-
324
- bgBlackBright: f("\x1b[100m", "\x1b[49m"),
325
- bgRedBright: f("\x1b[101m", "\x1b[49m"),
326
- bgGreenBright: f("\x1b[102m", "\x1b[49m"),
327
- bgYellowBright: f("\x1b[103m", "\x1b[49m"),
328
- bgBlueBright: f("\x1b[104m", "\x1b[49m"),
329
- bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
330
- bgCyanBright: f("\x1b[106m", "\x1b[49m"),
331
- bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
332
- }
333
- };
334
-
335
- picocolors.exports = createColors();
336
- picocolors.exports.createColors = createColors;
337
- return picocolors.exports;
338
- }
339
-
340
- var hasRequiredTheme;
341
-
342
- function requireTheme () {
343
- if (hasRequiredTheme) return theme;
344
- hasRequiredTheme = 1;
345
- var __importDefault = (theme && theme.__importDefault) || function (mod) {
346
- return (mod && mod.__esModule) ? mod : { "default": mod };
347
- };
348
- Object.defineProperty(theme, "__esModule", { value: true });
349
- theme.defaultTheme = void 0;
350
- const picocolors_1 = __importDefault(/*@__PURE__*/ requirePicocolors());
351
- const cli_spinners_1 = __importDefault(requireCliSpinners());
352
- theme.defaultTheme = {
353
- prefix: picocolors_1.default.green('?'),
354
- spinner: {
355
- interval: cli_spinners_1.default.dots.interval,
356
- frames: cli_spinners_1.default.dots.frames.map((frame) => picocolors_1.default.yellow(frame)),
357
- },
358
- style: {
359
- answer: picocolors_1.default.cyan,
360
- message: picocolors_1.default.bold,
361
- error: (text) => picocolors_1.default.red(`> ${text}`),
362
- defaultAnswer: (text) => picocolors_1.default.dim(`(${text})`),
363
- help: picocolors_1.default.dim,
364
- highlight: picocolors_1.default.cyan,
365
- key: (text) => picocolors_1.default.cyan(picocolors_1.default.bold(`<${text}>`)),
366
- },
367
- };
368
- return theme;
369
- }
370
-
371
- var hasRequiredMakeTheme;
372
-
373
- function requireMakeTheme () {
374
- if (hasRequiredMakeTheme) return makeTheme;
375
- hasRequiredMakeTheme = 1;
376
- Object.defineProperty(makeTheme, "__esModule", { value: true });
377
- makeTheme.makeTheme = makeTheme$1;
378
- const theme_mjs_1 = /*@__PURE__*/ requireTheme();
379
- function isPlainObject(value) {
380
- if (typeof value !== 'object' || value === null)
381
- return false;
382
- let proto = value;
383
- while (Object.getPrototypeOf(proto) !== null) {
384
- proto = Object.getPrototypeOf(proto);
385
- }
386
- return Object.getPrototypeOf(value) === proto;
387
- }
388
- function deepMerge(...objects) {
389
- const output = {};
390
- for (const obj of objects) {
391
- for (const [key, value] of Object.entries(obj)) {
392
- const prevValue = output[key];
393
- output[key] =
394
- isPlainObject(prevValue) && isPlainObject(value)
395
- ? deepMerge(prevValue, value)
396
- : value;
397
- }
398
- }
399
- return output;
400
- }
401
- function makeTheme$1(...themes) {
402
- const themesToMerge = [
403
- theme_mjs_1.defaultTheme,
404
- ...themes.filter((theme) => theme != null),
405
- ];
406
- return deepMerge(...themesToMerge);
407
- }
408
- return makeTheme;
409
- }
410
-
411
- var hasRequiredUsePrefix;
412
-
413
- function requireUsePrefix () {
414
- if (hasRequiredUsePrefix) return usePrefix;
415
- hasRequiredUsePrefix = 1;
416
- Object.defineProperty(usePrefix, "__esModule", { value: true });
417
- usePrefix.usePrefix = usePrefix$1;
418
- const node_async_hooks_1 = require$$0;
419
- const use_state_mjs_1 = /*@__PURE__*/ requireUseState();
420
- const use_effect_mjs_1 = /*@__PURE__*/ requireUseEffect();
421
- const make_theme_mjs_1 = /*@__PURE__*/ requireMakeTheme();
422
- function usePrefix$1({ isLoading = false, theme, }) {
423
- const [showLoader, setShowLoader] = (0, use_state_mjs_1.useState)(false);
424
- const [tick, setTick] = (0, use_state_mjs_1.useState)(0);
425
- const { prefix, spinner } = (0, make_theme_mjs_1.makeTheme)(theme);
426
- (0, use_effect_mjs_1.useEffect)(() => {
427
- if (isLoading) {
428
- let tickInterval;
429
- let inc = -1;
430
- // Delay displaying spinner by 300ms, to avoid flickering
431
- const delayTimeout = setTimeout(node_async_hooks_1.AsyncResource.bind(() => {
432
- setShowLoader(true);
433
- tickInterval = setInterval(node_async_hooks_1.AsyncResource.bind(() => {
434
- inc = inc + 1;
435
- setTick(inc % spinner.frames.length);
436
- }), spinner.interval);
437
- }), 300);
438
- return () => {
439
- clearTimeout(delayTimeout);
440
- clearInterval(tickInterval);
441
- };
442
- }
443
- else {
444
- setShowLoader(false);
445
- }
446
- }, [isLoading]);
447
- if (showLoader) {
448
- return spinner.frames[tick];
449
- }
450
- return prefix;
451
- }
452
- return usePrefix;
453
- }
454
-
455
- var useMemo = {};
456
-
457
- var hasRequiredUseMemo;
458
-
459
- function requireUseMemo () {
460
- if (hasRequiredUseMemo) return useMemo;
461
- hasRequiredUseMemo = 1;
462
- Object.defineProperty(useMemo, "__esModule", { value: true });
463
- useMemo.useMemo = useMemo$1;
464
- const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
465
- function useMemo$1(fn, dependencies) {
466
- return (0, hook_engine_mjs_1.withPointer)((pointer) => {
467
- const prev = pointer.get();
468
- if (!prev ||
469
- prev.dependencies.length !== dependencies.length ||
470
- prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
471
- const value = fn();
472
- pointer.set({ value, dependencies });
473
- return value;
474
- }
475
- return prev.value;
476
- });
477
- }
478
- return useMemo;
479
- }
480
-
481
- var useRef = {};
482
-
483
- var hasRequiredUseRef;
484
-
485
- function requireUseRef () {
486
- if (hasRequiredUseRef) return useRef;
487
- hasRequiredUseRef = 1;
488
- Object.defineProperty(useRef, "__esModule", { value: true });
489
- useRef.useRef = useRef$1;
490
- const use_state_mjs_1 = /*@__PURE__*/ requireUseState();
491
- function useRef$1(val) {
492
- return (0, use_state_mjs_1.useState)({ current: val })[0];
493
- }
494
- return useRef;
495
- }
496
-
497
- var useKeypress = {};
498
-
499
- var hasRequiredUseKeypress;
500
-
501
- function requireUseKeypress () {
502
- if (hasRequiredUseKeypress) return useKeypress;
503
- hasRequiredUseKeypress = 1;
504
- Object.defineProperty(useKeypress, "__esModule", { value: true });
505
- useKeypress.useKeypress = useKeypress$1;
506
- const use_ref_mjs_1 = /*@__PURE__*/ requireUseRef();
507
- const use_effect_mjs_1 = /*@__PURE__*/ requireUseEffect();
508
- const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
509
- function useKeypress$1(userHandler) {
510
- const signal = (0, use_ref_mjs_1.useRef)(userHandler);
511
- signal.current = userHandler;
512
- (0, use_effect_mjs_1.useEffect)((rl) => {
513
- const handler = (0, hook_engine_mjs_1.withUpdates)((_input, event) => {
514
- signal.current(event, rl);
515
- });
516
- rl.input.on('keypress', handler);
517
- return () => {
518
- rl.input.removeListener('keypress', handler);
519
- };
520
- }, []);
521
- }
522
- return useKeypress;
523
- }
524
-
525
- var usePagination = {};
526
-
527
- var utils$1 = {};
528
-
529
- var hasRequiredUtils$1;
530
-
531
- function requireUtils$1 () {
532
- if (hasRequiredUtils$1) return utils$1;
533
- hasRequiredUtils$1 = 1;
534
- var __importDefault = (utils$1 && utils$1.__importDefault) || function (mod) {
535
- return (mod && mod.__esModule) ? mod : { "default": mod };
536
- };
537
- Object.defineProperty(utils$1, "__esModule", { value: true });
538
- utils$1.breakLines = breakLines;
539
- utils$1.readlineWidth = readlineWidth;
540
- const cli_width_1 = __importDefault(requireCliWidth());
541
- const wrap_ansi_1 = __importDefault(requireWrapAnsi());
542
- const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
543
- /**
544
- * Force line returns at specific width. This function is ANSI code friendly and it'll
545
- * ignore invisible codes during width calculation.
546
- * @param {string} content
547
- * @param {number} width
548
- * @return {string}
549
- */
550
- function breakLines(content, width) {
551
- return content
552
- .split('\n')
553
- .flatMap((line) => (0, wrap_ansi_1.default)(line, width, { trim: false, hard: true })
554
- .split('\n')
555
- .map((str) => str.trimEnd()))
556
- .join('\n');
557
- }
558
- /**
559
- * Returns the width of the active readline, or 80 as default value.
560
- * @returns {number}
561
- */
562
- function readlineWidth() {
563
- return (0, cli_width_1.default)({ defaultWidth: 80, output: (0, hook_engine_mjs_1.readline)().output });
564
- }
565
- return utils$1;
566
- }
567
-
568
- var lines = {};
569
-
570
- var hasRequiredLines;
571
-
572
- function requireLines () {
573
- if (hasRequiredLines) return lines;
574
- hasRequiredLines = 1;
575
- Object.defineProperty(lines, "__esModule", { value: true });
576
- lines.lines = lines$1;
577
- const utils_mjs_1 = /*@__PURE__*/ requireUtils$1();
578
- function split(content, width) {
579
- return (0, utils_mjs_1.breakLines)(content, width).split('\n');
580
- }
581
- /**
582
- * Rotates an array of items by an integer number of positions.
583
- * @param {number} count The number of positions to rotate by
584
- * @param {T[]} items The items to rotate
585
- */
586
- function rotate(count, items) {
587
- const max = items.length;
588
- const offset = ((count % max) + max) % max;
589
- return [...items.slice(offset), ...items.slice(0, offset)];
590
- }
591
- /**
592
- * Renders a page of items as lines that fit within the given width ensuring
593
- * that the number of lines is not greater than the page size, and the active
594
- * item renders at the provided position, while prioritizing that as many lines
595
- * of the active item get rendered as possible.
596
- */
597
- function lines$1({ items, width, renderItem, active, position: requested, pageSize, }) {
598
- const layouts = items.map((item, index) => ({
599
- item,
600
- index,
601
- isActive: index === active,
602
- }));
603
- const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
604
- const renderItemAt = (index) => split(renderItem(layoutsInPage[index]), width);
605
- // Create a blank array of lines for the page
606
- const pageBuffer = Array.from({ length: pageSize });
607
- // Render the active item to decide the position
608
- const activeItem = renderItemAt(requested).slice(0, pageSize);
609
- const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
610
- // Add the lines of the active item into the page
611
- pageBuffer.splice(position, activeItem.length, ...activeItem);
612
- // Fill the page under the active item
613
- let bufferPointer = position + activeItem.length;
614
- let layoutPointer = requested + 1;
615
- while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
616
- for (const line of renderItemAt(layoutPointer)) {
617
- pageBuffer[bufferPointer++] = line;
618
- if (bufferPointer >= pageSize)
619
- break;
620
- }
621
- layoutPointer++;
622
- }
623
- // Fill the page over the active item
624
- bufferPointer = position - 1;
625
- layoutPointer = requested - 1;
626
- while (bufferPointer >= 0 && layoutPointer >= 0) {
627
- for (const line of renderItemAt(layoutPointer).reverse()) {
628
- pageBuffer[bufferPointer--] = line;
629
- if (bufferPointer < 0)
630
- break;
631
- }
632
- layoutPointer--;
633
- }
634
- return pageBuffer.filter((line) => typeof line === 'string');
635
- }
636
- return lines;
637
- }
638
-
639
- var position = {};
640
-
641
- var hasRequiredPosition;
642
-
643
- function requirePosition () {
644
- if (hasRequiredPosition) return position;
645
- hasRequiredPosition = 1;
646
- Object.defineProperty(position, "__esModule", { value: true });
647
- position.finite = finite;
648
- position.infinite = infinite;
649
- /**
650
- * Creates the next position for the active item considering a finite list of
651
- * items to be rendered on a page.
652
- */
653
- function finite({ active, pageSize, total, }) {
654
- const middle = Math.floor(pageSize / 2);
655
- if (total <= pageSize || active < middle)
656
- return active;
657
- if (active >= total - middle)
658
- return active + pageSize - total;
659
- return middle;
660
- }
661
- /**
662
- * Creates the next position for the active item considering an infinitely
663
- * looping list of items to be rendered on the page.
664
- */
665
- function infinite({ active, lastActive, total, pageSize, pointer, }) {
666
- if (total <= pageSize)
667
- return active;
668
- // Move the position only when the user moves down, and when the
669
- // navigation fits within a single page
670
- if (lastActive < active && active - lastActive < pageSize) {
671
- // Limit it to the middle of the list
672
- return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
673
- }
674
- return pointer;
675
- }
676
- return position;
677
- }
678
-
679
- var hasRequiredUsePagination;
680
-
681
- function requireUsePagination () {
682
- if (hasRequiredUsePagination) return usePagination;
683
- hasRequiredUsePagination = 1;
684
- Object.defineProperty(usePagination, "__esModule", { value: true });
685
- usePagination.usePagination = usePagination$1;
686
- const use_ref_mjs_1 = /*@__PURE__*/ requireUseRef();
687
- const utils_mjs_1 = /*@__PURE__*/ requireUtils$1();
688
- const lines_mjs_1 = /*@__PURE__*/ requireLines();
689
- const position_mjs_1 = /*@__PURE__*/ requirePosition();
690
- function usePagination$1({ items, active, renderItem, pageSize, loop = true, }) {
691
- const state = (0, use_ref_mjs_1.useRef)({ position: 0, lastActive: 0 });
692
- const position = loop
693
- ? (0, position_mjs_1.infinite)({
694
- active,
695
- lastActive: state.current.lastActive,
696
- total: items.length,
697
- pageSize,
698
- pointer: state.current.position,
699
- })
700
- : (0, position_mjs_1.finite)({
701
- active,
702
- total: items.length,
703
- pageSize,
704
- });
705
- state.current.position = position;
706
- state.current.lastActive = active;
707
- return (0, lines_mjs_1.lines)({
708
- items,
709
- width: (0, utils_mjs_1.readlineWidth)(),
710
- renderItem,
711
- active,
712
- position,
713
- pageSize,
714
- }).join('\n');
715
- }
716
- return usePagination;
717
- }
718
-
719
- var createPrompt = {};
720
-
721
- var cjs$1 = {};
722
-
723
- var inquirer = {};
724
-
725
- var hasRequiredInquirer;
726
-
727
- function requireInquirer () {
728
- if (hasRequiredInquirer) return inquirer;
729
- hasRequiredInquirer = 1;
730
- Object.defineProperty(inquirer, "__esModule", { value: true });
731
- inquirer.CancelablePromise = void 0;
732
- class CancelablePromise extends Promise {
733
- constructor() {
734
- super(...arguments);
735
- Object.defineProperty(this, "cancel", {
736
- enumerable: true,
737
- configurable: true,
738
- writable: true,
739
- value: () => { }
740
- });
741
- }
742
- static withResolver() {
743
- let resolve;
744
- let reject;
745
- const promise = new CancelablePromise((res, rej) => {
746
- resolve = res;
747
- reject = rej;
748
- });
749
- return { promise, resolve: resolve, reject: reject };
750
- }
751
- }
752
- inquirer.CancelablePromise = CancelablePromise;
753
- return inquirer;
754
- }
755
-
756
- var utils = {};
757
-
758
- var hasRequiredUtils;
759
-
760
- function requireUtils () {
761
- if (hasRequiredUtils) return utils;
762
- hasRequiredUtils = 1;
763
- /* eslint-disable @typescript-eslint/no-explicit-any */
764
- Object.defineProperty(utils, "__esModule", { value: true });
765
- return utils;
766
- }
767
-
768
- var hasRequiredCjs$2;
769
-
770
- function requireCjs$2 () {
771
- if (hasRequiredCjs$2) return cjs$1;
772
- hasRequiredCjs$2 = 1;
773
- (function (exports) {
774
- var __createBinding = (cjs$1 && cjs$1.__createBinding) || (Object.create ? (function(o, m, k, k2) {
775
- if (k2 === undefined) k2 = k;
776
- var desc = Object.getOwnPropertyDescriptor(m, k);
777
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
778
- desc = { enumerable: true, get: function() { return m[k]; } };
779
- }
780
- Object.defineProperty(o, k2, desc);
781
- }) : (function(o, m, k, k2) {
782
- if (k2 === undefined) k2 = k;
783
- o[k2] = m[k];
784
- }));
785
- var __exportStar = (cjs$1 && cjs$1.__exportStar) || function(m, exports) {
786
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
787
- };
788
- Object.defineProperty(exports, "__esModule", { value: true });
789
- __exportStar(/*@__PURE__*/ requireInquirer(), exports);
790
- __exportStar(/*@__PURE__*/ requireUtils(), exports);
791
- } (cjs$1));
792
- return cjs$1;
793
- }
794
-
795
- var lib;
796
- var hasRequiredLib;
797
-
798
- function requireLib () {
799
- if (hasRequiredLib) return lib;
800
- hasRequiredLib = 1;
801
- const Stream = require$$0$1;
802
-
803
- class MuteStream extends Stream {
804
- #isTTY = null
805
-
806
- constructor (opts = {}) {
807
- super(opts);
808
- this.writable = this.readable = true;
809
- this.muted = false;
810
- this.on('pipe', this._onpipe);
811
- this.replace = opts.replace;
812
-
813
- // For readline-type situations
814
- // This much at the start of a line being redrawn after a ctrl char
815
- // is seen (such as backspace) won't be redrawn as the replacement
816
- this._prompt = opts.prompt || null;
817
- this._hadControl = false;
818
- }
819
-
820
- #destSrc (key, def) {
821
- if (this._dest) {
822
- return this._dest[key]
823
- }
824
- if (this._src) {
825
- return this._src[key]
826
- }
827
- return def
828
- }
829
-
830
- #proxy (method, ...args) {
831
- if (typeof this._dest?.[method] === 'function') {
832
- this._dest[method](...args);
833
- }
834
- if (typeof this._src?.[method] === 'function') {
835
- this._src[method](...args);
836
- }
837
- }
838
-
839
- get isTTY () {
840
- if (this.#isTTY !== null) {
841
- return this.#isTTY
842
- }
843
- return this.#destSrc('isTTY', false)
844
- }
845
-
846
- // basically just get replace the getter/setter with a regular value
847
- set isTTY (val) {
848
- this.#isTTY = val;
849
- }
850
-
851
- get rows () {
852
- return this.#destSrc('rows')
853
- }
854
-
855
- get columns () {
856
- return this.#destSrc('columns')
857
- }
858
-
859
- mute () {
860
- this.muted = true;
861
- }
862
-
863
- unmute () {
864
- this.muted = false;
865
- }
866
-
867
- _onpipe (src) {
868
- this._src = src;
869
- }
870
-
871
- pipe (dest, options) {
872
- this._dest = dest;
873
- return super.pipe(dest, options)
874
- }
875
-
876
- pause () {
877
- if (this._src) {
878
- return this._src.pause()
879
- }
880
- }
881
-
882
- resume () {
883
- if (this._src) {
884
- return this._src.resume()
885
- }
886
- }
887
-
888
- write (c) {
889
- if (this.muted) {
890
- if (!this.replace) {
891
- return true
892
- }
893
- // eslint-disable-next-line no-control-regex
894
- if (c.match(/^\u001b/)) {
895
- if (c.indexOf(this._prompt) === 0) {
896
- c = c.slice(this._prompt.length);
897
- c = c.replace(/./g, this.replace);
898
- c = this._prompt + c;
899
- }
900
- this._hadControl = true;
901
- return this.emit('data', c)
902
- } else {
903
- if (this._prompt && this._hadControl &&
904
- c.indexOf(this._prompt) === 0) {
905
- this._hadControl = false;
906
- this.emit('data', this._prompt);
907
- c = c.slice(this._prompt.length);
908
- }
909
- c = c.toString().replace(/./g, this.replace);
910
- }
911
- }
912
- this.emit('data', c);
913
- }
914
-
915
- end (c) {
916
- if (this.muted) {
917
- if (c && this.replace) {
918
- c = c.toString().replace(/./g, this.replace);
919
- } else {
920
- c = null;
921
- }
922
- }
923
- if (c) {
924
- this.emit('data', c);
925
- }
926
- this.emit('end');
927
- }
928
-
929
- destroy (...args) {
930
- return this.#proxy('destroy', ...args)
931
- }
932
-
933
- destroySoon (...args) {
934
- return this.#proxy('destroySoon', ...args)
935
- }
936
-
937
- close (...args) {
938
- return this.#proxy('close', ...args)
939
- }
940
- }
941
-
942
- lib = MuteStream;
943
- return lib;
944
- }
945
-
946
- var cjs = {};
947
-
948
- var signals = {};
949
-
950
- var hasRequiredSignals;
951
-
952
- function requireSignals () {
953
- if (hasRequiredSignals) return signals;
954
- hasRequiredSignals = 1;
955
- (function (exports) {
956
- Object.defineProperty(exports, "__esModule", { value: true });
957
- exports.signals = void 0;
958
- /**
959
- * This is not the set of all possible signals.
960
- *
961
- * It IS, however, the set of all signals that trigger
962
- * an exit on either Linux or BSD systems. Linux is a
963
- * superset of the signal names supported on BSD, and
964
- * the unknown signals just fail to register, so we can
965
- * catch that easily enough.
966
- *
967
- * Windows signals are a different set, since there are
968
- * signals that terminate Windows processes, but don't
969
- * terminate (or don't even exist) on Posix systems.
970
- *
971
- * Don't bother with SIGKILL. It's uncatchable, which
972
- * means that we can't fire any callbacks anyway.
973
- *
974
- * If a user does happen to register a handler on a non-
975
- * fatal signal like SIGWINCH or something, and then
976
- * exit, it'll end up firing `process.emit('exit')`, so
977
- * the handler will be fired anyway.
978
- *
979
- * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
980
- * artificially, inherently leave the process in a
981
- * state from which it is not safe to try and enter JS
982
- * listeners.
983
- */
984
- exports.signals = [];
985
- exports.signals.push('SIGHUP', 'SIGINT', 'SIGTERM');
986
- if (process.platform !== 'win32') {
987
- exports.signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'
988
- // should detect profiler and enable/disable accordingly.
989
- // see #21
990
- // 'SIGPROF'
991
- );
992
- }
993
- if (process.platform === 'linux') {
994
- exports.signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');
995
- }
996
-
997
- } (signals));
998
- return signals;
999
- }
1000
-
1001
- var hasRequiredCjs$1;
1002
-
1003
- function requireCjs$1 () {
1004
- if (hasRequiredCjs$1) return cjs;
1005
- hasRequiredCjs$1 = 1;
1006
- (function (exports) {
1007
- var _a;
1008
- Object.defineProperty(exports, "__esModule", { value: true });
1009
- exports.unload = exports.load = exports.onExit = exports.signals = void 0;
1010
- // Note: since nyc uses this module to output coverage, any lines
1011
- // that are in the direct sync flow of nyc's outputCoverage are
1012
- // ignored, since we can never get coverage for them.
1013
- // grab a reference to node's real process object right away
1014
- const signals_js_1 = requireSignals();
1015
- Object.defineProperty(exports, "signals", { enumerable: true, get: function () { return signals_js_1.signals; } });
1016
- const processOk = (process) => !!process &&
1017
- typeof process === 'object' &&
1018
- typeof process.removeListener === 'function' &&
1019
- typeof process.emit === 'function' &&
1020
- typeof process.reallyExit === 'function' &&
1021
- typeof process.listeners === 'function' &&
1022
- typeof process.kill === 'function' &&
1023
- typeof process.pid === 'number' &&
1024
- typeof process.on === 'function';
1025
- const kExitEmitter = Symbol.for('signal-exit emitter');
1026
- const global = globalThis;
1027
- const ObjectDefineProperty = Object.defineProperty.bind(Object);
1028
- // teeny special purpose ee
1029
- class Emitter {
1030
- emitted = {
1031
- afterExit: false,
1032
- exit: false,
1033
- };
1034
- listeners = {
1035
- afterExit: [],
1036
- exit: [],
1037
- };
1038
- count = 0;
1039
- id = Math.random();
1040
- constructor() {
1041
- if (global[kExitEmitter]) {
1042
- return global[kExitEmitter];
1043
- }
1044
- ObjectDefineProperty(global, kExitEmitter, {
1045
- value: this,
1046
- writable: false,
1047
- enumerable: false,
1048
- configurable: false,
1049
- });
1050
- }
1051
- on(ev, fn) {
1052
- this.listeners[ev].push(fn);
1053
- }
1054
- removeListener(ev, fn) {
1055
- const list = this.listeners[ev];
1056
- const i = list.indexOf(fn);
1057
- /* c8 ignore start */
1058
- if (i === -1) {
1059
- return;
1060
- }
1061
- /* c8 ignore stop */
1062
- if (i === 0 && list.length === 1) {
1063
- list.length = 0;
1064
- }
1065
- else {
1066
- list.splice(i, 1);
1067
- }
1068
- }
1069
- emit(ev, code, signal) {
1070
- if (this.emitted[ev]) {
1071
- return false;
1072
- }
1073
- this.emitted[ev] = true;
1074
- let ret = false;
1075
- for (const fn of this.listeners[ev]) {
1076
- ret = fn(code, signal) === true || ret;
1077
- }
1078
- if (ev === 'exit') {
1079
- ret = this.emit('afterExit', code, signal) || ret;
1080
- }
1081
- return ret;
1082
- }
1083
- }
1084
- class SignalExitBase {
1085
- }
1086
- const signalExitWrap = (handler) => {
1087
- return {
1088
- onExit(cb, opts) {
1089
- return handler.onExit(cb, opts);
1090
- },
1091
- load() {
1092
- return handler.load();
1093
- },
1094
- unload() {
1095
- return handler.unload();
1096
- },
1097
- };
1098
- };
1099
- class SignalExitFallback extends SignalExitBase {
1100
- onExit() {
1101
- return () => { };
1102
- }
1103
- load() { }
1104
- unload() { }
1105
- }
1106
- class SignalExit extends SignalExitBase {
1107
- // "SIGHUP" throws an `ENOSYS` error on Windows,
1108
- // so use a supported signal instead
1109
- /* c8 ignore start */
1110
- #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';
1111
- /* c8 ignore stop */
1112
- #emitter = new Emitter();
1113
- #process;
1114
- #originalProcessEmit;
1115
- #originalProcessReallyExit;
1116
- #sigListeners = {};
1117
- #loaded = false;
1118
- constructor(process) {
1119
- super();
1120
- this.#process = process;
1121
- // { <signal>: <listener fn>, ... }
1122
- this.#sigListeners = {};
1123
- for (const sig of signals_js_1.signals) {
1124
- this.#sigListeners[sig] = () => {
1125
- // If there are no other listeners, an exit is coming!
1126
- // Simplest way: remove us and then re-send the signal.
1127
- // We know that this will kill the process, so we can
1128
- // safely emit now.
1129
- const listeners = this.#process.listeners(sig);
1130
- let { count } = this.#emitter;
1131
- // This is a workaround for the fact that signal-exit v3 and signal
1132
- // exit v4 are not aware of each other, and each will attempt to let
1133
- // the other handle it, so neither of them do. To correct this, we
1134
- // detect if we're the only handler *except* for previous versions
1135
- // of signal-exit, and increment by the count of listeners it has
1136
- // created.
1137
- /* c8 ignore start */
1138
- const p = process;
1139
- if (typeof p.__signal_exit_emitter__ === 'object' &&
1140
- typeof p.__signal_exit_emitter__.count === 'number') {
1141
- count += p.__signal_exit_emitter__.count;
1142
- }
1143
- /* c8 ignore stop */
1144
- if (listeners.length === count) {
1145
- this.unload();
1146
- const ret = this.#emitter.emit('exit', null, sig);
1147
- /* c8 ignore start */
1148
- const s = sig === 'SIGHUP' ? this.#hupSig : sig;
1149
- if (!ret)
1150
- process.kill(process.pid, s);
1151
- /* c8 ignore stop */
1152
- }
1153
- };
1154
- }
1155
- this.#originalProcessReallyExit = process.reallyExit;
1156
- this.#originalProcessEmit = process.emit;
1157
- }
1158
- onExit(cb, opts) {
1159
- /* c8 ignore start */
1160
- if (!processOk(this.#process)) {
1161
- return () => { };
1162
- }
1163
- /* c8 ignore stop */
1164
- if (this.#loaded === false) {
1165
- this.load();
1166
- }
1167
- const ev = opts?.alwaysLast ? 'afterExit' : 'exit';
1168
- this.#emitter.on(ev, cb);
1169
- return () => {
1170
- this.#emitter.removeListener(ev, cb);
1171
- if (this.#emitter.listeners['exit'].length === 0 &&
1172
- this.#emitter.listeners['afterExit'].length === 0) {
1173
- this.unload();
1174
- }
1175
- };
1176
- }
1177
- load() {
1178
- if (this.#loaded) {
1179
- return;
1180
- }
1181
- this.#loaded = true;
1182
- // This is the number of onSignalExit's that are in play.
1183
- // It's important so that we can count the correct number of
1184
- // listeners on signals, and don't wait for the other one to
1185
- // handle it instead of us.
1186
- this.#emitter.count += 1;
1187
- for (const sig of signals_js_1.signals) {
1188
- try {
1189
- const fn = this.#sigListeners[sig];
1190
- if (fn)
1191
- this.#process.on(sig, fn);
1192
- }
1193
- catch (_) { }
1194
- }
1195
- this.#process.emit = (ev, ...a) => {
1196
- return this.#processEmit(ev, ...a);
1197
- };
1198
- this.#process.reallyExit = (code) => {
1199
- return this.#processReallyExit(code);
1200
- };
1201
- }
1202
- unload() {
1203
- if (!this.#loaded) {
1204
- return;
1205
- }
1206
- this.#loaded = false;
1207
- signals_js_1.signals.forEach(sig => {
1208
- const listener = this.#sigListeners[sig];
1209
- /* c8 ignore start */
1210
- if (!listener) {
1211
- throw new Error('Listener not defined for signal: ' + sig);
1212
- }
1213
- /* c8 ignore stop */
1214
- try {
1215
- this.#process.removeListener(sig, listener);
1216
- /* c8 ignore start */
1217
- }
1218
- catch (_) { }
1219
- /* c8 ignore stop */
1220
- });
1221
- this.#process.emit = this.#originalProcessEmit;
1222
- this.#process.reallyExit = this.#originalProcessReallyExit;
1223
- this.#emitter.count -= 1;
1224
- }
1225
- #processReallyExit(code) {
1226
- /* c8 ignore start */
1227
- if (!processOk(this.#process)) {
1228
- return 0;
1229
- }
1230
- this.#process.exitCode = code || 0;
1231
- /* c8 ignore stop */
1232
- this.#emitter.emit('exit', this.#process.exitCode, null);
1233
- return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1234
- }
1235
- #processEmit(ev, ...args) {
1236
- const og = this.#originalProcessEmit;
1237
- if (ev === 'exit' && processOk(this.#process)) {
1238
- if (typeof args[0] === 'number') {
1239
- this.#process.exitCode = args[0];
1240
- /* c8 ignore start */
1241
- }
1242
- /* c8 ignore start */
1243
- const ret = og.call(this.#process, ev, ...args);
1244
- /* c8 ignore start */
1245
- this.#emitter.emit('exit', this.#process.exitCode, null);
1246
- /* c8 ignore stop */
1247
- return ret;
1248
- }
1249
- else {
1250
- return og.call(this.#process, ev, ...args);
1251
- }
1252
- }
1253
- }
1254
- const process = globalThis.process;
1255
- // wrap so that we call the method on the actual handler, without
1256
- // exporting it directly.
1257
- _a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()),
1258
- /**
1259
- * Called when the process is exiting, whether via signal, explicit
1260
- * exit, or running out of stuff to do.
1261
- *
1262
- * If the global process object is not suitable for instrumentation,
1263
- * then this will be a no-op.
1264
- *
1265
- * Returns a function that may be used to unload signal-exit.
1266
- */
1267
- exports.onExit = _a.onExit,
1268
- /**
1269
- * Load the listeners. Likely you never need to call this, unless
1270
- * doing a rather deep integration with signal-exit functionality.
1271
- * Mostly exposed for the benefit of testing.
1272
- *
1273
- * @internal
1274
- */
1275
- exports.load = _a.load,
1276
- /**
1277
- * Unload the listeners. Likely you never need to call this, unless
1278
- * doing a rather deep integration with signal-exit functionality.
1279
- * Mostly exposed for the benefit of testing.
1280
- *
1281
- * @internal
1282
- */
1283
- exports.unload = _a.unload;
1284
-
1285
- } (cjs));
1286
- return cjs;
1287
- }
1288
-
1289
- var screenManager = {};
1290
-
1291
- var ansiEscapes = {exports: {}};
1292
-
1293
- var hasRequiredAnsiEscapes;
1294
-
1295
- function requireAnsiEscapes () {
1296
- if (hasRequiredAnsiEscapes) return ansiEscapes.exports;
1297
- hasRequiredAnsiEscapes = 1;
1298
- (function (module) {
1299
- const ansiEscapes = module.exports;
1300
- // TODO: remove this in the next major version
1301
- module.exports.default = ansiEscapes;
1302
-
1303
- const ESC = '\u001B[';
1304
- const OSC = '\u001B]';
1305
- const BEL = '\u0007';
1306
- const SEP = ';';
1307
- const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
1308
-
1309
- ansiEscapes.cursorTo = (x, y) => {
1310
- if (typeof x !== 'number') {
1311
- throw new TypeError('The `x` argument is required');
1312
- }
1313
-
1314
- if (typeof y !== 'number') {
1315
- return ESC + (x + 1) + 'G';
1316
- }
1317
-
1318
- return ESC + (y + 1) + ';' + (x + 1) + 'H';
1319
- };
1320
-
1321
- ansiEscapes.cursorMove = (x, y) => {
1322
- if (typeof x !== 'number') {
1323
- throw new TypeError('The `x` argument is required');
1324
- }
1325
-
1326
- let ret = '';
1327
-
1328
- if (x < 0) {
1329
- ret += ESC + (-x) + 'D';
1330
- } else if (x > 0) {
1331
- ret += ESC + x + 'C';
1332
- }
1333
-
1334
- if (y < 0) {
1335
- ret += ESC + (-y) + 'A';
1336
- } else if (y > 0) {
1337
- ret += ESC + y + 'B';
1338
- }
1339
-
1340
- return ret;
1341
- };
1342
-
1343
- ansiEscapes.cursorUp = (count = 1) => ESC + count + 'A';
1344
- ansiEscapes.cursorDown = (count = 1) => ESC + count + 'B';
1345
- ansiEscapes.cursorForward = (count = 1) => ESC + count + 'C';
1346
- ansiEscapes.cursorBackward = (count = 1) => ESC + count + 'D';
1347
-
1348
- ansiEscapes.cursorLeft = ESC + 'G';
1349
- ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : ESC + 's';
1350
- ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : ESC + 'u';
1351
- ansiEscapes.cursorGetPosition = ESC + '6n';
1352
- ansiEscapes.cursorNextLine = ESC + 'E';
1353
- ansiEscapes.cursorPrevLine = ESC + 'F';
1354
- ansiEscapes.cursorHide = ESC + '?25l';
1355
- ansiEscapes.cursorShow = ESC + '?25h';
1356
-
1357
- ansiEscapes.eraseLines = count => {
1358
- let clear = '';
1359
-
1360
- for (let i = 0; i < count; i++) {
1361
- clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : '');
1362
- }
1363
-
1364
- if (count) {
1365
- clear += ansiEscapes.cursorLeft;
1366
- }
1367
-
1368
- return clear;
1369
- };
1370
-
1371
- ansiEscapes.eraseEndLine = ESC + 'K';
1372
- ansiEscapes.eraseStartLine = ESC + '1K';
1373
- ansiEscapes.eraseLine = ESC + '2K';
1374
- ansiEscapes.eraseDown = ESC + 'J';
1375
- ansiEscapes.eraseUp = ESC + '1J';
1376
- ansiEscapes.eraseScreen = ESC + '2J';
1377
- ansiEscapes.scrollUp = ESC + 'S';
1378
- ansiEscapes.scrollDown = ESC + 'T';
1379
-
1380
- ansiEscapes.clearScreen = '\u001Bc';
1381
-
1382
- ansiEscapes.clearTerminal = process.platform === 'win32' ?
1383
- `${ansiEscapes.eraseScreen}${ESC}0f` :
1384
- // 1. Erases the screen (Only done in case `2` is not supported)
1385
- // 2. Erases the whole screen including scrollback buffer
1386
- // 3. Moves cursor to the top-left position
1387
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
1388
- `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
1389
-
1390
- ansiEscapes.beep = BEL;
1391
-
1392
- ansiEscapes.link = (text, url) => {
1393
- return [
1394
- OSC,
1395
- '8',
1396
- SEP,
1397
- SEP,
1398
- url,
1399
- BEL,
1400
- text,
1401
- OSC,
1402
- '8',
1403
- SEP,
1404
- SEP,
1405
- BEL
1406
- ].join('');
1407
- };
1408
-
1409
- ansiEscapes.image = (buffer, options = {}) => {
1410
- let ret = `${OSC}1337;File=inline=1`;
1411
-
1412
- if (options.width) {
1413
- ret += `;width=${options.width}`;
1414
- }
1415
-
1416
- if (options.height) {
1417
- ret += `;height=${options.height}`;
1418
- }
1419
-
1420
- if (options.preserveAspectRatio === false) {
1421
- ret += ';preserveAspectRatio=0';
1422
- }
1423
-
1424
- return ret + ':' + buffer.toString('base64') + BEL;
1425
- };
1426
-
1427
- ansiEscapes.iTerm = {
1428
- setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
1429
-
1430
- annotation: (message, options = {}) => {
1431
- let ret = `${OSC}1337;`;
1432
-
1433
- const hasX = typeof options.x !== 'undefined';
1434
- const hasY = typeof options.y !== 'undefined';
1435
- if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== 'undefined')) {
1436
- throw new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');
1437
- }
1438
-
1439
- message = message.replace(/\|/g, '');
1440
-
1441
- ret += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';
1442
-
1443
- if (options.length > 0) {
1444
- ret +=
1445
- (hasX ?
1446
- [message, options.length, options.x, options.y] :
1447
- [options.length, message]).join('|');
1448
- } else {
1449
- ret += message;
1450
- }
1451
-
1452
- return ret + BEL;
1453
- }
1454
- };
1455
- } (ansiEscapes));
1456
- return ansiEscapes.exports;
1457
- }
1458
-
1459
- var hasRequiredScreenManager;
1460
-
1461
- function requireScreenManager () {
1462
- if (hasRequiredScreenManager) return screenManager;
1463
- hasRequiredScreenManager = 1;
1464
- var __importDefault = (screenManager && screenManager.__importDefault) || function (mod) {
1465
- return (mod && mod.__esModule) ? mod : { "default": mod };
1466
- };
1467
- Object.defineProperty(screenManager, "__esModule", { value: true });
1468
- const strip_ansi_1 = __importDefault(requireStripAnsi());
1469
- const ansi_escapes_1 = __importDefault(requireAnsiEscapes());
1470
- const utils_mjs_1 = /*@__PURE__*/ requireUtils$1();
1471
- const height = (content) => content.split('\n').length;
1472
- const lastLine = (content) => { var _a; return (_a = content.split('\n').pop()) !== null && _a !== void 0 ? _a : ''; };
1473
- class ScreenManager {
1474
- constructor(rl) {
1475
- Object.defineProperty(this, "rl", {
1476
- enumerable: true,
1477
- configurable: true,
1478
- writable: true,
1479
- value: rl
1480
- });
1481
- // These variables are keeping information to allow correct prompt re-rendering
1482
- Object.defineProperty(this, "height", {
1483
- enumerable: true,
1484
- configurable: true,
1485
- writable: true,
1486
- value: 0
1487
- });
1488
- Object.defineProperty(this, "extraLinesUnderPrompt", {
1489
- enumerable: true,
1490
- configurable: true,
1491
- writable: true,
1492
- value: 0
1493
- });
1494
- Object.defineProperty(this, "cursorPos", {
1495
- enumerable: true,
1496
- configurable: true,
1497
- writable: true,
1498
- value: void 0
1499
- });
1500
- this.rl = rl;
1501
- this.cursorPos = rl.getCursorPos();
1502
- }
1503
- render(content, bottomContent = '') {
1504
- /**
1505
- * Write message to screen and setPrompt to control backspace
1506
- */
1507
- const promptLine = lastLine(content);
1508
- const rawPromptLine = (0, strip_ansi_1.default)(promptLine);
1509
- // Remove the rl.line from our prompt. We can't rely on the content of
1510
- // rl.line (mainly because of the password prompt), so just rely on it's
1511
- // length.
1512
- let prompt = rawPromptLine;
1513
- if (this.rl.line.length > 0) {
1514
- prompt = prompt.slice(0, -this.rl.line.length);
1515
- }
1516
- this.rl.setPrompt(prompt);
1517
- // SetPrompt will change cursor position, now we can get correct value
1518
- this.cursorPos = this.rl.getCursorPos();
1519
- const width = (0, utils_mjs_1.readlineWidth)();
1520
- content = (0, utils_mjs_1.breakLines)(content, width);
1521
- bottomContent = (0, utils_mjs_1.breakLines)(bottomContent, width);
1522
- // Manually insert an extra line if we're at the end of the line.
1523
- // This prevent the cursor from appearing at the beginning of the
1524
- // current line.
1525
- if (rawPromptLine.length % width === 0) {
1526
- content += '\n';
1527
- }
1528
- let output = content + (bottomContent ? '\n' + bottomContent : '');
1529
- /**
1530
- * Re-adjust the cursor at the correct position.
1531
- */
1532
- // We need to consider parts of the prompt under the cursor as part of the bottom
1533
- // content in order to correctly cleanup and re-render.
1534
- const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
1535
- const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
1536
- // Return cursor to the input position (on top of the bottomContent)
1537
- if (bottomContentHeight > 0)
1538
- output += ansi_escapes_1.default.cursorUp(bottomContentHeight);
1539
- // Return cursor to the initial left offset.
1540
- output += ansi_escapes_1.default.cursorTo(this.cursorPos.cols);
1541
- this.clean();
1542
- this.rl.output.unmute();
1543
- /**
1544
- * Set up state for next re-rendering
1545
- */
1546
- this.extraLinesUnderPrompt = bottomContentHeight;
1547
- this.height = height(output);
1548
- this.rl.output.write(output);
1549
- this.rl.output.mute();
1550
- }
1551
- checkCursorPos() {
1552
- const cursorPos = this.rl.getCursorPos();
1553
- if (cursorPos.cols !== this.cursorPos.cols) {
1554
- this.rl.output.unmute();
1555
- this.rl.output.write(ansi_escapes_1.default.cursorTo(cursorPos.cols));
1556
- this.rl.output.mute();
1557
- this.cursorPos = cursorPos;
1558
- }
1559
- }
1560
- clean() {
1561
- this.rl.output.unmute();
1562
- this.rl.output.write([
1563
- this.extraLinesUnderPrompt > 0
1564
- ? ansi_escapes_1.default.cursorDown(this.extraLinesUnderPrompt)
1565
- : '',
1566
- ansi_escapes_1.default.eraseLines(this.height),
1567
- ].join(''));
1568
- this.extraLinesUnderPrompt = 0;
1569
- this.rl.output.mute();
1570
- }
1571
- clearContent() {
1572
- this.rl.output.unmute();
1573
- // Reset the cursor at the end of the previously displayed content
1574
- this.rl.output.write([
1575
- this.extraLinesUnderPrompt > 0
1576
- ? ansi_escapes_1.default.cursorDown(this.extraLinesUnderPrompt)
1577
- : '',
1578
- '\n',
1579
- ].join(''));
1580
- this.rl.output.mute();
1581
- }
1582
- done() {
1583
- this.rl.setPrompt('');
1584
- this.rl.output.unmute();
1585
- this.rl.output.write(ansi_escapes_1.default.cursorShow);
1586
- this.rl.output.end();
1587
- this.rl.close();
1588
- }
1589
- }
1590
- screenManager.default = ScreenManager;
1591
- return screenManager;
1592
- }
1593
-
1594
- var hasRequiredCreatePrompt;
1595
-
1596
- function requireCreatePrompt () {
1597
- if (hasRequiredCreatePrompt) return createPrompt;
1598
- hasRequiredCreatePrompt = 1;
1599
- var __createBinding = (createPrompt && createPrompt.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1600
- if (k2 === undefined) k2 = k;
1601
- var desc = Object.getOwnPropertyDescriptor(m, k);
1602
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1603
- desc = { enumerable: true, get: function() { return m[k]; } };
1604
- }
1605
- Object.defineProperty(o, k2, desc);
1606
- }) : (function(o, m, k, k2) {
1607
- if (k2 === undefined) k2 = k;
1608
- o[k2] = m[k];
1609
- }));
1610
- var __setModuleDefault = (createPrompt && createPrompt.__setModuleDefault) || (Object.create ? (function(o, v) {
1611
- Object.defineProperty(o, "default", { enumerable: true, value: v });
1612
- }) : function(o, v) {
1613
- o["default"] = v;
1614
- });
1615
- var __importStar = (createPrompt && createPrompt.__importStar) || function (mod) {
1616
- if (mod && mod.__esModule) return mod;
1617
- var result = {};
1618
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1619
- __setModuleDefault(result, mod);
1620
- return result;
1621
- };
1622
- var __importDefault = (createPrompt && createPrompt.__importDefault) || function (mod) {
1623
- return (mod && mod.__esModule) ? mod : { "default": mod };
1624
- };
1625
- Object.defineProperty(createPrompt, "__esModule", { value: true });
1626
- createPrompt.createPrompt = createPrompt$1;
1627
- const readline = __importStar(readline__default);
1628
- const type_1 = /*@__PURE__*/ requireCjs$2();
1629
- const mute_stream_1 = __importDefault(requireLib());
1630
- const signal_exit_1 = requireCjs$1();
1631
- const screen_manager_mjs_1 = __importDefault(/*@__PURE__*/ requireScreenManager());
1632
- const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
1633
- const errors_mjs_1 = /*@__PURE__*/ requireErrors();
1634
- function createPrompt$1(view) {
1635
- const prompt = (config, context) => {
1636
- var _a, _b;
1637
- // Default `input` to stdin
1638
- const input = (_a = context === null || context === void 0 ? void 0 : context.input) !== null && _a !== void 0 ? _a : process.stdin;
1639
- // Add mute capabilities to the output
1640
- const output = new mute_stream_1.default();
1641
- output.pipe((_b = context === null || context === void 0 ? void 0 : context.output) !== null && _b !== void 0 ? _b : process.stdout);
1642
- const rl = readline.createInterface({
1643
- terminal: true,
1644
- input,
1645
- output,
1646
- });
1647
- const screen = new screen_manager_mjs_1.default(rl);
1648
- let cancel = () => { };
1649
- const answer = new type_1.CancelablePromise((resolve, reject) => {
1650
- (0, hook_engine_mjs_1.withHooks)(rl, (store) => {
1651
- function checkCursorPos() {
1652
- screen.checkCursorPos();
1653
- }
1654
- const removeExitListener = (0, signal_exit_1.onExit)((code, signal) => {
1655
- onExit();
1656
- reject(new errors_mjs_1.ExitPromptError(`User force closed the prompt with ${code} ${signal}`));
1657
- });
1658
- function onExit() {
1659
- try {
1660
- store.hooksCleanup.forEach((cleanFn) => {
1661
- cleanFn === null || cleanFn === void 0 ? void 0 : cleanFn();
1662
- });
1663
- }
1664
- catch (error) {
1665
- reject(error);
1666
- }
1667
- if (context === null || context === void 0 ? void 0 : context.clearPromptOnDone) {
1668
- screen.clean();
1669
- }
1670
- else {
1671
- screen.clearContent();
1672
- }
1673
- screen.done();
1674
- removeExitListener();
1675
- store.rl.input.removeListener('keypress', checkCursorPos);
1676
- }
1677
- cancel = () => {
1678
- onExit();
1679
- reject(new errors_mjs_1.CancelPromptError());
1680
- };
1681
- function done(value) {
1682
- // Delay execution to let time to the hookCleanup functions to registers.
1683
- setImmediate(() => {
1684
- onExit();
1685
- // Finally we resolve our promise
1686
- resolve(value);
1687
- });
1688
- }
1689
- function workLoop() {
1690
- store.index = 0;
1691
- try {
1692
- const nextView = view(config, done);
1693
- const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView;
1694
- screen.render(content, bottomContent);
1695
- hook_engine_mjs_1.effectScheduler.run();
1696
- }
1697
- catch (error) {
1698
- onExit();
1699
- reject(error);
1700
- }
1701
- }
1702
- store.handleChange = () => workLoop();
1703
- workLoop();
1704
- // Re-renders only happen when the state change; but the readline cursor could change position
1705
- // and that also requires a re-render (and a manual one because we mute the streams).
1706
- // We set the listener after the initial workLoop to avoid a double render if render triggered
1707
- // by a state change sets the cursor to the right position.
1708
- store.rl.input.on('keypress', checkCursorPos);
1709
- });
1710
- });
1711
- answer.cancel = cancel;
1712
- return answer;
1713
- };
1714
- return prompt;
1715
- }
1716
- return createPrompt;
1717
- }
1718
-
1719
- var Separator = {};
1720
-
1721
- var commonjs = {};
1722
-
1723
- var hasRequiredCommonjs;
1724
-
1725
- function requireCommonjs () {
1726
- if (hasRequiredCommonjs) return commonjs;
1727
- hasRequiredCommonjs = 1;
1728
- (function (exports) {
1729
- var __importDefault = (commonjs && commonjs.__importDefault) || function (mod) {
1730
- return (mod && mod.__esModule) ? mod : { "default": mod };
1731
- };
1732
- Object.defineProperty(exports, "__esModule", { value: true });
1733
- exports.replaceSymbols = exports.fallbackSymbols = exports.mainSymbols = void 0;
1734
- // process.env dot-notation access prints:
1735
- // Property 'TERM' comes from an index signature, so it must be accessed with ['TERM'].ts(4111)
1736
- /* eslint dot-notation: ["off"] */
1737
- const node_process_1 = __importDefault(process__default);
1738
- // Ported from is-unicode-supported
1739
- function isUnicodeSupported() {
1740
- if (node_process_1.default.platform !== 'win32') {
1741
- return node_process_1.default.env['TERM'] !== 'linux'; // Linux console (kernel)
1742
- }
1743
- return (Boolean(node_process_1.default.env['WT_SESSION']) || // Windows Terminal
1744
- Boolean(node_process_1.default.env['TERMINUS_SUBLIME']) || // Terminus (<0.2.27)
1745
- node_process_1.default.env['ConEmuTask'] === '{cmd::Cmder}' || // ConEmu and cmder
1746
- node_process_1.default.env['TERM_PROGRAM'] === 'Terminus-Sublime' ||
1747
- node_process_1.default.env['TERM_PROGRAM'] === 'vscode' ||
1748
- node_process_1.default.env['TERM'] === 'xterm-256color' ||
1749
- node_process_1.default.env['TERM'] === 'alacritty' ||
1750
- node_process_1.default.env['TERMINAL_EMULATOR'] === 'JetBrains-JediTerm');
1751
- }
1752
- // Ported from figures
1753
- const common = {
1754
- circleQuestionMark: '(?)',
1755
- questionMarkPrefix: '(?)',
1756
- square: '█',
1757
- squareDarkShade: '▓',
1758
- squareMediumShade: '▒',
1759
- squareLightShade: '░',
1760
- squareTop: '▀',
1761
- squareBottom: '▄',
1762
- squareLeft: '▌',
1763
- squareRight: '▐',
1764
- squareCenter: '■',
1765
- bullet: '●',
1766
- dot: '․',
1767
- ellipsis: '…',
1768
- pointerSmall: '›',
1769
- triangleUp: '▲',
1770
- triangleUpSmall: '▴',
1771
- triangleDown: '▼',
1772
- triangleDownSmall: '▾',
1773
- triangleLeftSmall: '◂',
1774
- triangleRightSmall: '▸',
1775
- home: '⌂',
1776
- heart: '♥',
1777
- musicNote: '♪',
1778
- musicNoteBeamed: '♫',
1779
- arrowUp: '↑',
1780
- arrowDown: '↓',
1781
- arrowLeft: '←',
1782
- arrowRight: '→',
1783
- arrowLeftRight: '↔',
1784
- arrowUpDown: '↕',
1785
- almostEqual: '≈',
1786
- notEqual: '≠',
1787
- lessOrEqual: '≤',
1788
- greaterOrEqual: '≥',
1789
- identical: '≡',
1790
- infinity: '∞',
1791
- subscriptZero: '₀',
1792
- subscriptOne: '₁',
1793
- subscriptTwo: '₂',
1794
- subscriptThree: '₃',
1795
- subscriptFour: '₄',
1796
- subscriptFive: '₅',
1797
- subscriptSix: '₆',
1798
- subscriptSeven: '₇',
1799
- subscriptEight: '₈',
1800
- subscriptNine: '₉',
1801
- oneHalf: '½',
1802
- oneThird: '⅓',
1803
- oneQuarter: '¼',
1804
- oneFifth: '⅕',
1805
- oneSixth: '⅙',
1806
- oneEighth: '⅛',
1807
- twoThirds: '⅔',
1808
- twoFifths: '⅖',
1809
- threeQuarters: '¾',
1810
- threeFifths: '⅗',
1811
- threeEighths: '⅜',
1812
- fourFifths: '⅘',
1813
- fiveSixths: '⅚',
1814
- fiveEighths: '⅝',
1815
- sevenEighths: '⅞',
1816
- line: '─',
1817
- lineBold: '━',
1818
- lineDouble: '═',
1819
- lineDashed0: '┄',
1820
- lineDashed1: '┅',
1821
- lineDashed2: '┈',
1822
- lineDashed3: '┉',
1823
- lineDashed4: '╌',
1824
- lineDashed5: '╍',
1825
- lineDashed6: '╴',
1826
- lineDashed7: '╶',
1827
- lineDashed8: '╸',
1828
- lineDashed9: '╺',
1829
- lineDashed10: '╼',
1830
- lineDashed11: '╾',
1831
- lineDashed12: '−',
1832
- lineDashed13: '–',
1833
- lineDashed14: '‐',
1834
- lineDashed15: '⁃',
1835
- lineVertical: '│',
1836
- lineVerticalBold: '┃',
1837
- lineVerticalDouble: '║',
1838
- lineVerticalDashed0: '┆',
1839
- lineVerticalDashed1: '┇',
1840
- lineVerticalDashed2: '┊',
1841
- lineVerticalDashed3: '┋',
1842
- lineVerticalDashed4: '╎',
1843
- lineVerticalDashed5: '╏',
1844
- lineVerticalDashed6: '╵',
1845
- lineVerticalDashed7: '╷',
1846
- lineVerticalDashed8: '╹',
1847
- lineVerticalDashed9: '╻',
1848
- lineVerticalDashed10: '╽',
1849
- lineVerticalDashed11: '╿',
1850
- lineDownLeft: '┐',
1851
- lineDownLeftArc: '╮',
1852
- lineDownBoldLeftBold: '┓',
1853
- lineDownBoldLeft: '┒',
1854
- lineDownLeftBold: '┑',
1855
- lineDownDoubleLeftDouble: '╗',
1856
- lineDownDoubleLeft: '╖',
1857
- lineDownLeftDouble: '╕',
1858
- lineDownRight: '┌',
1859
- lineDownRightArc: '╭',
1860
- lineDownBoldRightBold: '┏',
1861
- lineDownBoldRight: '┎',
1862
- lineDownRightBold: '┍',
1863
- lineDownDoubleRightDouble: '╔',
1864
- lineDownDoubleRight: '╓',
1865
- lineDownRightDouble: '╒',
1866
- lineUpLeft: '┘',
1867
- lineUpLeftArc: '╯',
1868
- lineUpBoldLeftBold: '┛',
1869
- lineUpBoldLeft: '┚',
1870
- lineUpLeftBold: '┙',
1871
- lineUpDoubleLeftDouble: '╝',
1872
- lineUpDoubleLeft: '╜',
1873
- lineUpLeftDouble: '╛',
1874
- lineUpRight: '└',
1875
- lineUpRightArc: '╰',
1876
- lineUpBoldRightBold: '┗',
1877
- lineUpBoldRight: '┖',
1878
- lineUpRightBold: '┕',
1879
- lineUpDoubleRightDouble: '╚',
1880
- lineUpDoubleRight: '╙',
1881
- lineUpRightDouble: '╘',
1882
- lineUpDownLeft: '┤',
1883
- lineUpBoldDownBoldLeftBold: '┫',
1884
- lineUpBoldDownBoldLeft: '┨',
1885
- lineUpDownLeftBold: '┥',
1886
- lineUpBoldDownLeftBold: '┩',
1887
- lineUpDownBoldLeftBold: '┪',
1888
- lineUpDownBoldLeft: '┧',
1889
- lineUpBoldDownLeft: '┦',
1890
- lineUpDoubleDownDoubleLeftDouble: '╣',
1891
- lineUpDoubleDownDoubleLeft: '╢',
1892
- lineUpDownLeftDouble: '╡',
1893
- lineUpDownRight: '├',
1894
- lineUpBoldDownBoldRightBold: '┣',
1895
- lineUpBoldDownBoldRight: '┠',
1896
- lineUpDownRightBold: '┝',
1897
- lineUpBoldDownRightBold: '┡',
1898
- lineUpDownBoldRightBold: '┢',
1899
- lineUpDownBoldRight: '┟',
1900
- lineUpBoldDownRight: '┞',
1901
- lineUpDoubleDownDoubleRightDouble: '╠',
1902
- lineUpDoubleDownDoubleRight: '╟',
1903
- lineUpDownRightDouble: '╞',
1904
- lineDownLeftRight: '┬',
1905
- lineDownBoldLeftBoldRightBold: '┳',
1906
- lineDownLeftBoldRightBold: '┯',
1907
- lineDownBoldLeftRight: '┰',
1908
- lineDownBoldLeftBoldRight: '┱',
1909
- lineDownBoldLeftRightBold: '┲',
1910
- lineDownLeftRightBold: '┮',
1911
- lineDownLeftBoldRight: '┭',
1912
- lineDownDoubleLeftDoubleRightDouble: '╦',
1913
- lineDownDoubleLeftRight: '╥',
1914
- lineDownLeftDoubleRightDouble: '╤',
1915
- lineUpLeftRight: '┴',
1916
- lineUpBoldLeftBoldRightBold: '┻',
1917
- lineUpLeftBoldRightBold: '┷',
1918
- lineUpBoldLeftRight: '┸',
1919
- lineUpBoldLeftBoldRight: '┹',
1920
- lineUpBoldLeftRightBold: '┺',
1921
- lineUpLeftRightBold: '┶',
1922
- lineUpLeftBoldRight: '┵',
1923
- lineUpDoubleLeftDoubleRightDouble: '╩',
1924
- lineUpDoubleLeftRight: '╨',
1925
- lineUpLeftDoubleRightDouble: '╧',
1926
- lineUpDownLeftRight: '┼',
1927
- lineUpBoldDownBoldLeftBoldRightBold: '╋',
1928
- lineUpDownBoldLeftBoldRightBold: '╈',
1929
- lineUpBoldDownLeftBoldRightBold: '╇',
1930
- lineUpBoldDownBoldLeftRightBold: '╊',
1931
- lineUpBoldDownBoldLeftBoldRight: '╉',
1932
- lineUpBoldDownLeftRight: '╀',
1933
- lineUpDownBoldLeftRight: '╁',
1934
- lineUpDownLeftBoldRight: '┽',
1935
- lineUpDownLeftRightBold: '┾',
1936
- lineUpBoldDownBoldLeftRight: '╂',
1937
- lineUpDownLeftBoldRightBold: '┿',
1938
- lineUpBoldDownLeftBoldRight: '╃',
1939
- lineUpBoldDownLeftRightBold: '╄',
1940
- lineUpDownBoldLeftBoldRight: '╅',
1941
- lineUpDownBoldLeftRightBold: '╆',
1942
- lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',
1943
- lineUpDoubleDownDoubleLeftRight: '╫',
1944
- lineUpDownLeftDoubleRightDouble: '╪',
1945
- lineCross: '╳',
1946
- lineBackslash: '╲',
1947
- lineSlash: '╱',
1948
- };
1949
- const specialMainSymbols = {
1950
- tick: '✔',
1951
- info: 'ℹ',
1952
- warning: '⚠',
1953
- cross: '✘',
1954
- squareSmall: '◻',
1955
- squareSmallFilled: '◼',
1956
- circle: '◯',
1957
- circleFilled: '◉',
1958
- circleDotted: '◌',
1959
- circleDouble: '◎',
1960
- circleCircle: 'ⓞ',
1961
- circleCross: 'ⓧ',
1962
- circlePipe: 'Ⓘ',
1963
- radioOn: '◉',
1964
- radioOff: '◯',
1965
- checkboxOn: '☒',
1966
- checkboxOff: '☐',
1967
- checkboxCircleOn: 'ⓧ',
1968
- checkboxCircleOff: 'Ⓘ',
1969
- pointer: '❯',
1970
- triangleUpOutline: '△',
1971
- triangleLeft: '◀',
1972
- triangleRight: '▶',
1973
- lozenge: '◆',
1974
- lozengeOutline: '◇',
1975
- hamburger: '☰',
1976
- smiley: '㋡',
1977
- mustache: '෴',
1978
- star: '★',
1979
- play: '▶',
1980
- nodejs: '⬢',
1981
- oneSeventh: '⅐',
1982
- oneNinth: '⅑',
1983
- oneTenth: '⅒',
1984
- };
1985
- const specialFallbackSymbols = {
1986
- tick: '√',
1987
- info: 'i',
1988
- warning: '‼',
1989
- cross: '×',
1990
- squareSmall: '□',
1991
- squareSmallFilled: '■',
1992
- circle: '( )',
1993
- circleFilled: '(*)',
1994
- circleDotted: '( )',
1995
- circleDouble: '( )',
1996
- circleCircle: '(○)',
1997
- circleCross: '(×)',
1998
- circlePipe: '(│)',
1999
- radioOn: '(*)',
2000
- radioOff: '( )',
2001
- checkboxOn: '[×]',
2002
- checkboxOff: '[ ]',
2003
- checkboxCircleOn: '(×)',
2004
- checkboxCircleOff: '( )',
2005
- pointer: '>',
2006
- triangleUpOutline: '∆',
2007
- triangleLeft: '◄',
2008
- triangleRight: '►',
2009
- lozenge: '♦',
2010
- lozengeOutline: '◊',
2011
- hamburger: '≡',
2012
- smiley: '☺',
2013
- mustache: '┌─┐',
2014
- star: '✶',
2015
- play: '►',
2016
- nodejs: '♦',
2017
- oneSeventh: '1/7',
2018
- oneNinth: '1/9',
2019
- oneTenth: '1/10',
2020
- };
2021
- exports.mainSymbols = { ...common, ...specialMainSymbols };
2022
- exports.fallbackSymbols = {
2023
- ...common,
2024
- ...specialFallbackSymbols,
2025
- };
2026
- const shouldUseMain = isUnicodeSupported();
2027
- const figures = shouldUseMain ? exports.mainSymbols : exports.fallbackSymbols;
2028
- exports.default = figures;
2029
- const replacements = Object.entries(specialMainSymbols);
2030
- // On terminals which do not support Unicode symbols, substitute them to other symbols
2031
- const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => {
2032
- if (useFallback) {
2033
- for (const [key, mainSymbol] of replacements) {
2034
- const fallbackSymbol = exports.fallbackSymbols[key];
2035
- if (!fallbackSymbol) {
2036
- throw new Error(`Unable to find fallback for ${key}`);
2037
- }
2038
- string = string.replaceAll(mainSymbol, fallbackSymbol);
2039
- }
2040
- }
2041
- return string;
2042
- };
2043
- exports.replaceSymbols = replaceSymbols;
2044
- } (commonjs));
2045
- return commonjs;
2046
- }
2047
-
2048
- var hasRequiredSeparator;
2049
-
2050
- function requireSeparator () {
2051
- if (hasRequiredSeparator) return Separator;
2052
- hasRequiredSeparator = 1;
2053
- var __importDefault = (Separator && Separator.__importDefault) || function (mod) {
2054
- return (mod && mod.__esModule) ? mod : { "default": mod };
2055
- };
2056
- Object.defineProperty(Separator, "__esModule", { value: true });
2057
- Separator.Separator = void 0;
2058
- const picocolors_1 = __importDefault(/*@__PURE__*/ requirePicocolors());
2059
- const figures_1 = __importDefault(/*@__PURE__*/ requireCommonjs());
2060
- /**
2061
- * Separator object
2062
- * Used to space/separate choices group
2063
- */
2064
- let Separator$1 = class Separator {
2065
- constructor(separator) {
2066
- Object.defineProperty(this, "separator", {
2067
- enumerable: true,
2068
- configurable: true,
2069
- writable: true,
2070
- value: picocolors_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line))
2071
- });
2072
- Object.defineProperty(this, "type", {
2073
- enumerable: true,
2074
- configurable: true,
2075
- writable: true,
2076
- value: 'separator'
2077
- });
2078
- if (separator) {
2079
- this.separator = separator;
2080
- }
2081
- }
2082
- static isSeparator(choice) {
2083
- return Boolean(choice && choice.type === 'separator');
2084
- }
2085
- };
2086
- Separator.Separator = Separator$1;
2087
- return Separator;
2088
- }
2089
-
2090
- var hasRequiredCjs;
2091
-
2092
- function requireCjs () {
2093
- if (hasRequiredCjs) return cjs$2;
2094
- hasRequiredCjs = 1;
2095
- (function (exports) {
2096
- var __createBinding = (cjs$2 && cjs$2.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2097
- if (k2 === undefined) k2 = k;
2098
- var desc = Object.getOwnPropertyDescriptor(m, k);
2099
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2100
- desc = { enumerable: true, get: function() { return m[k]; } };
2101
- }
2102
- Object.defineProperty(o, k2, desc);
2103
- }) : (function(o, m, k, k2) {
2104
- if (k2 === undefined) k2 = k;
2105
- o[k2] = m[k];
2106
- }));
2107
- var __exportStar = (cjs$2 && cjs$2.__exportStar) || function(m, exports) {
2108
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2109
- };
2110
- Object.defineProperty(exports, "__esModule", { value: true });
2111
- exports.Separator = exports.createPrompt = exports.usePagination = exports.makeTheme = exports.useKeypress = exports.useRef = exports.useMemo = exports.useEffect = exports.useState = exports.usePrefix = void 0;
2112
- __exportStar(/*@__PURE__*/ requireKey(), exports);
2113
- __exportStar(/*@__PURE__*/ requireErrors(), exports);
2114
- var use_prefix_mjs_1 = /*@__PURE__*/ requireUsePrefix();
2115
- Object.defineProperty(exports, "usePrefix", { enumerable: true, get: function () { return use_prefix_mjs_1.usePrefix; } });
2116
- var use_state_mjs_1 = /*@__PURE__*/ requireUseState();
2117
- Object.defineProperty(exports, "useState", { enumerable: true, get: function () { return use_state_mjs_1.useState; } });
2118
- var use_effect_mjs_1 = /*@__PURE__*/ requireUseEffect();
2119
- Object.defineProperty(exports, "useEffect", { enumerable: true, get: function () { return use_effect_mjs_1.useEffect; } });
2120
- var use_memo_mjs_1 = /*@__PURE__*/ requireUseMemo();
2121
- Object.defineProperty(exports, "useMemo", { enumerable: true, get: function () { return use_memo_mjs_1.useMemo; } });
2122
- var use_ref_mjs_1 = /*@__PURE__*/ requireUseRef();
2123
- Object.defineProperty(exports, "useRef", { enumerable: true, get: function () { return use_ref_mjs_1.useRef; } });
2124
- var use_keypress_mjs_1 = /*@__PURE__*/ requireUseKeypress();
2125
- Object.defineProperty(exports, "useKeypress", { enumerable: true, get: function () { return use_keypress_mjs_1.useKeypress; } });
2126
- var make_theme_mjs_1 = /*@__PURE__*/ requireMakeTheme();
2127
- Object.defineProperty(exports, "makeTheme", { enumerable: true, get: function () { return make_theme_mjs_1.makeTheme; } });
2128
- var use_pagination_mjs_1 = /*@__PURE__*/ requireUsePagination();
2129
- Object.defineProperty(exports, "usePagination", { enumerable: true, get: function () { return use_pagination_mjs_1.usePagination; } });
2130
- var create_prompt_mjs_1 = /*@__PURE__*/ requireCreatePrompt();
2131
- Object.defineProperty(exports, "createPrompt", { enumerable: true, get: function () { return create_prompt_mjs_1.createPrompt; } });
2132
- var Separator_mjs_1 = /*@__PURE__*/ requireSeparator();
2133
- Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return Separator_mjs_1.Separator; } });
2134
- } (cjs$2));
2135
- return cjs$2;
2136
- }
2137
-
2138
- var hasRequiredDist;
2139
-
2140
- function requireDist () {
2141
- if (hasRequiredDist) return dist;
2142
- hasRequiredDist = 1;
2143
- var __importDefault = (dist && dist.__importDefault) || function (mod) {
2144
- return (mod && mod.__esModule) ? mod : { "default": mod };
2145
- };
2146
- Object.defineProperty(dist, "__esModule", { value: true });
2147
- const core_1 = /*@__PURE__*/ requireCjs();
2148
- const core_2 = /*@__PURE__*/ requireCjs();
2149
- const ansi_escapes_1 = __importDefault(requireAnsiEscapes());
2150
- function isLeftKey(key) {
2151
- return key.name === "left";
2152
- }
2153
- function isRightKey(key) {
2154
- return key.name === "right";
2155
- }
2156
- dist.default = (0, core_2.createPrompt)((config, done) => {
2157
- var _a;
2158
- const theme = (0, core_2.makeTheme)({ active: "yes", inactive: "no" }, config.theme);
2159
- const prefix = (0, core_2.usePrefix)({ theme });
2160
- const [value, setValue] = (0, core_1.useState)((_a = config.default) !== null && _a !== void 0 ? _a : false);
2161
- const [isDone, setIsDone] = (0, core_1.useState)(false);
2162
- (0, core_1.useKeypress)((key) => {
2163
- if ((0, core_1.isEnterKey)(key)) {
2164
- setIsDone(true);
2165
- done(value);
2166
- }
2167
- else if (isLeftKey(key) || isRightKey(key) || (0, core_1.isUpKey)(key) || (0, core_1.isDownKey)(key)) {
2168
- setValue(!value);
2169
- }
2170
- });
2171
- const message = theme.style.message(config.message);
2172
- if (isDone) {
2173
- return `${prefix} ${message} ${theme.style.answer(value ? theme.active : theme.inactive)}`;
2174
- }
2175
- const activeMessage = value ? theme.style.highlight(theme.active) : theme.active;
2176
- const inactiveMessage = value ? theme.inactive : theme.style.highlight(theme.inactive);
2177
- return `${prefix} ${message} ${inactiveMessage} / ${activeMessage}${ansi_escapes_1.default.cursorHide}`;
2178
- });
2179
- return dist;
2180
- }
2181
-
2182
- var distExports = requireDist();
2183
- const toggleModule = /*@__PURE__*/getDefaultExportFromCjs(distExports);
2184
-
2185
- const togglePrompt = toggleModule?.default?.default || toggleModule?.default || toggleModule;
2186
- async function promptBoolean(options) {
2187
- const { message, defaultValue = false, theme } = options;
2188
- return await togglePrompt({
2189
- message,
2190
- default: defaultValue,
2191
- ...theme ? { theme } : {}
2192
- });
2193
- }
2194
-
2195
- export { promptBoolean as p };