@tickernelz/wardmote-adapter-utils 2026.1108.2 → 2026.1111.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 (259) hide show
  1. package/README.md +1 -1
  2. package/dist/acpx-engine/composed-run-characterization.test.js +13 -16
  3. package/dist/acpx-engine/composed-run-characterization.test.js.map +1 -1
  4. package/dist/acpx-engine/ephemeral-session-environment.test.js +6 -6
  5. package/dist/acpx-engine/ephemeral-session-environment.test.js.map +1 -1
  6. package/dist/acpx-engine/execute-identity.test.js +12 -12
  7. package/dist/acpx-engine/execute-identity.test.js.map +1 -1
  8. package/dist/acpx-engine/execute.d.ts +2 -28
  9. package/dist/acpx-engine/execute.d.ts.map +1 -1
  10. package/dist/acpx-engine/execute.js +162 -224
  11. package/dist/acpx-engine/execute.js.map +1 -1
  12. package/dist/acpx-engine/execute.test.js +234 -250
  13. package/dist/acpx-engine/execute.test.js.map +1 -1
  14. package/dist/acpx-engine/filesystem-protocol.test.js +2 -2
  15. package/dist/acpx-engine/filesystem-protocol.test.js.map +1 -1
  16. package/dist/acpx-engine/managed-codex-skills-manifest.d.ts +3 -0
  17. package/dist/acpx-engine/managed-codex-skills-manifest.d.ts.map +1 -0
  18. package/dist/acpx-engine/managed-codex-skills-manifest.js +30 -0
  19. package/dist/acpx-engine/managed-codex-skills-manifest.js.map +1 -0
  20. package/dist/acpx-engine/managed-codex-skills-manifest.test.d.ts +2 -0
  21. package/dist/acpx-engine/managed-codex-skills-manifest.test.d.ts.map +1 -0
  22. package/dist/acpx-engine/managed-codex-skills-manifest.test.js +29 -0
  23. package/dist/acpx-engine/managed-codex-skills-manifest.test.js.map +1 -0
  24. package/dist/acpx-engine/operator-stop.test.js +3 -3
  25. package/dist/acpx-engine/operator-stop.test.js.map +1 -1
  26. package/dist/acpx-engine/remote-spawn-smoke.test.js +5 -5
  27. package/dist/acpx-engine/remote-spawn-smoke.test.js.map +1 -1
  28. package/dist/acpx-engine/run-contracts.d.ts +5 -15
  29. package/dist/acpx-engine/run-contracts.d.ts.map +1 -1
  30. package/dist/acpx-engine/run-contracts.js.map +1 -1
  31. package/dist/acpx-engine/run-fault-matrix.test.js +7 -7
  32. package/dist/acpx-engine/run-fault-matrix.test.js.map +1 -1
  33. package/dist/acpx-engine/run-site-sandbox.d.ts +5 -12
  34. package/dist/acpx-engine/run-site-sandbox.d.ts.map +1 -1
  35. package/dist/acpx-engine/run-site-sandbox.js +4 -16
  36. package/dist/acpx-engine/run-site-sandbox.js.map +1 -1
  37. package/dist/acpx-engine/run-site-sandbox.test.js +13 -16
  38. package/dist/acpx-engine/run-site-sandbox.test.js.map +1 -1
  39. package/dist/acpx-engine/settlement-characterization.test.js +20 -20
  40. package/dist/acpx-engine/settlement-characterization.test.js.map +1 -1
  41. package/dist/acpx-engine/spawn-smoke.test.js +12 -12
  42. package/dist/acpx-engine/spawn-smoke.test.js.map +1 -1
  43. package/dist/acpx-engine/startup-characterization.test.js +27 -31
  44. package/dist/acpx-engine/startup-characterization.test.js.map +1 -1
  45. package/dist/acpx-engine/startup-timing.d.ts +27 -45
  46. package/dist/acpx-engine/startup-timing.d.ts.map +1 -1
  47. package/dist/acpx-engine/startup-timing.js +1 -19
  48. package/dist/acpx-engine/startup-timing.js.map +1 -1
  49. package/dist/acpx-engine/startup-timing.test.js +2 -2
  50. package/dist/acpx-engine/startup-timing.test.js.map +1 -1
  51. package/dist/acpx-engine/terminal-session-failure.js +1 -1
  52. package/dist/acpx-engine/terminal-session-failure.js.map +1 -1
  53. package/dist/acpx-engine/turn-characterization.test.js +3 -3
  54. package/dist/acpx-engine/turn-characterization.test.js.map +1 -1
  55. package/dist/acpx-engine/turn-sequence.js +1 -1
  56. package/dist/acpx-engine/turn-sequence.js.map +1 -1
  57. package/dist/chat-file-delivery.d.ts +2 -2
  58. package/dist/chat-file-delivery.d.ts.map +1 -1
  59. package/dist/chat-file-delivery.js +4 -4
  60. package/dist/chat-file-delivery.js.map +1 -1
  61. package/dist/chat-file-delivery.test.js +9 -9
  62. package/dist/chat-file-delivery.test.js.map +1 -1
  63. package/dist/command-managed-runtime.js +5 -5
  64. package/dist/command-managed-runtime.js.map +1 -1
  65. package/dist/command-managed-runtime.test.js +38 -40
  66. package/dist/command-managed-runtime.test.js.map +1 -1
  67. package/dist/directory-merge-lock.test.js +3 -3
  68. package/dist/directory-merge-lock.test.js.map +1 -1
  69. package/dist/execution-target-sandbox.test.js +361 -369
  70. package/dist/execution-target-sandbox.test.js.map +1 -1
  71. package/dist/execution-target-stdin-race.test.js +80 -90
  72. package/dist/execution-target-stdin-race.test.js.map +1 -1
  73. package/dist/execution-target.d.ts +6 -36
  74. package/dist/execution-target.d.ts.map +1 -1
  75. package/dist/execution-target.js +92 -144
  76. package/dist/execution-target.js.map +1 -1
  77. package/dist/execution-target.test.js +3 -3
  78. package/dist/execution-target.test.js.map +1 -1
  79. package/dist/forbidden-config-env.test.d.ts +2 -0
  80. package/dist/forbidden-config-env.test.d.ts.map +1 -0
  81. package/dist/forbidden-config-env.test.js +35 -0
  82. package/dist/forbidden-config-env.test.js.map +1 -0
  83. package/dist/git-workspace-sync.d.ts +2 -2
  84. package/dist/git-workspace-sync.d.ts.map +1 -1
  85. package/dist/git-workspace-sync.js +8 -8
  86. package/dist/git-workspace-sync.js.map +1 -1
  87. package/dist/git-workspace-sync.test.js +61 -61
  88. package/dist/git-workspace-sync.test.js.map +1 -1
  89. package/dist/github-launcher-environment.test.js +36 -36
  90. package/dist/github-launcher-environment.test.js.map +1 -1
  91. package/dist/github-launcher.js +16 -16
  92. package/dist/github-launcher.js.map +1 -1
  93. package/dist/github-launcher.test.js +5 -5
  94. package/dist/github-launcher.test.js.map +1 -1
  95. package/dist/http2-bridge-server.test.js +1 -1
  96. package/dist/http2-bridge-server.test.js.map +1 -1
  97. package/dist/index.d.ts +5 -5
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/index.js +2 -2
  100. package/dist/index.js.map +1 -1
  101. package/dist/local-process-sandbox.js +7 -7
  102. package/dist/local-process-sandbox.js.map +1 -1
  103. package/dist/local-process-sandbox.test.js +24 -24
  104. package/dist/local-process-sandbox.test.js.map +1 -1
  105. package/dist/mcp-isolation.integration.test.js +4 -4
  106. package/dist/mcp-isolation.integration.test.js.map +1 -1
  107. package/dist/prompt-sections.test.js +11 -11
  108. package/dist/prompt-sections.test.js.map +1 -1
  109. package/dist/provider-models/claude.d.ts +0 -1
  110. package/dist/provider-models/claude.d.ts.map +1 -1
  111. package/dist/provider-models/claude.js +0 -1
  112. package/dist/provider-models/claude.js.map +1 -1
  113. package/dist/provider-models/codex.d.ts.map +1 -1
  114. package/dist/provider-models/codex.js +2 -2
  115. package/dist/provider-models/codex.js.map +1 -1
  116. package/dist/remote-managed-runtime.js +6 -6
  117. package/dist/remote-managed-runtime.js.map +1 -1
  118. package/dist/remote-managed-runtime.test.js +14 -14
  119. package/dist/remote-managed-runtime.test.js.map +1 -1
  120. package/dist/retired-marker-names.d.ts +2 -0
  121. package/dist/retired-marker-names.d.ts.map +1 -0
  122. package/dist/retired-marker-names.js +2 -0
  123. package/dist/retired-marker-names.js.map +1 -0
  124. package/dist/retired-skill-names.d.ts +3 -0
  125. package/dist/retired-skill-names.d.ts.map +1 -0
  126. package/dist/retired-skill-names.js +8 -0
  127. package/dist/retired-skill-names.js.map +1 -0
  128. package/dist/run-oom-score.d.ts +1 -1
  129. package/dist/run-oom-score.d.ts.map +1 -1
  130. package/dist/run-oom-score.js +1 -1
  131. package/dist/run-oom-score.js.map +1 -1
  132. package/dist/runner-connectivity.d.ts +7 -7
  133. package/dist/runner-connectivity.d.ts.map +1 -1
  134. package/dist/runner-connectivity.js +16 -16
  135. package/dist/runner-connectivity.js.map +1 -1
  136. package/dist/runner-connectivity.test.js +21 -21
  137. package/dist/runner-connectivity.test.js.map +1 -1
  138. package/dist/runtime-progress.d.ts.map +1 -1
  139. package/dist/runtime-progress.js +1 -4
  140. package/dist/runtime-progress.js.map +1 -1
  141. package/dist/runtime-progress.test.js +13 -13
  142. package/dist/runtime-progress.test.js.map +1 -1
  143. package/dist/sandbox-callback-bridge.d.ts +1 -16
  144. package/dist/sandbox-callback-bridge.d.ts.map +1 -1
  145. package/dist/sandbox-callback-bridge.js +55 -88
  146. package/dist/sandbox-callback-bridge.js.map +1 -1
  147. package/dist/sandbox-callback-bridge.test.js +94 -115
  148. package/dist/sandbox-callback-bridge.test.js.map +1 -1
  149. package/dist/sandbox-file-sync.test.js +9 -9
  150. package/dist/sandbox-file-sync.test.js.map +1 -1
  151. package/dist/sandbox-install-command.js +4 -4
  152. package/dist/sandbox-install-command.js.map +1 -1
  153. package/dist/sandbox-managed-runtime.d.ts +0 -30
  154. package/dist/sandbox-managed-runtime.d.ts.map +1 -1
  155. package/dist/sandbox-managed-runtime.js +12 -34
  156. package/dist/sandbox-managed-runtime.js.map +1 -1
  157. package/dist/sandbox-managed-runtime.test.js +134 -144
  158. package/dist/sandbox-managed-runtime.test.js.map +1 -1
  159. package/dist/sandbox-run-log-stream.js +5 -5
  160. package/dist/sandbox-run-log-stream.js.map +1 -1
  161. package/dist/server-utils-env.test.js +10 -9
  162. package/dist/server-utils-env.test.js.map +1 -1
  163. package/dist/server-utils.d.ts +121 -147
  164. package/dist/server-utils.d.ts.map +1 -1
  165. package/dist/server-utils.js +319 -346
  166. package/dist/server-utils.js.map +1 -1
  167. package/dist/server-utils.test.js +339 -322
  168. package/dist/server-utils.test.js.map +1 -1
  169. package/dist/skill-library-manifest.d.ts +2 -2
  170. package/dist/skill-library-manifest.d.ts.map +1 -1
  171. package/dist/skill-library-manifest.test.js +4 -4
  172. package/dist/skill-library-manifest.test.js.map +1 -1
  173. package/dist/ssh-fixture.test.js +57 -57
  174. package/dist/ssh-fixture.test.js.map +1 -1
  175. package/dist/ssh.d.ts.map +1 -1
  176. package/dist/ssh.js +18 -40
  177. package/dist/ssh.js.map +1 -1
  178. package/dist/test-fixtures/prompt-context.d.ts +5 -5
  179. package/dist/test-fixtures/prompt-context.js +5 -5
  180. package/dist/test-fixtures/prompt-context.js.map +1 -1
  181. package/dist/test-support/mcp-isolation-harness.js +1 -1
  182. package/dist/test-support/mcp-isolation-harness.js.map +1 -1
  183. package/dist/tool-profile.d.ts +1 -1
  184. package/dist/tool-profile.d.ts.map +1 -1
  185. package/dist/tool-profile.js +1 -1
  186. package/dist/tool-profile.js.map +1 -1
  187. package/dist/types.d.ts +13 -31
  188. package/dist/types.d.ts.map +1 -1
  189. package/dist/{paperclip-mcp-mount.d.ts → wardmote-mcp-mount.d.ts} +10 -10
  190. package/dist/wardmote-mcp-mount.d.ts.map +1 -0
  191. package/dist/{paperclip-mcp-mount.js → wardmote-mcp-mount.js} +17 -17
  192. package/dist/wardmote-mcp-mount.js.map +1 -0
  193. package/dist/wardmote-mcp.d.ts +51 -0
  194. package/dist/wardmote-mcp.d.ts.map +1 -0
  195. package/dist/wardmote-mcp.js +148 -0
  196. package/dist/wardmote-mcp.js.map +1 -0
  197. package/dist/wardmote-mcp.test.d.ts +2 -0
  198. package/dist/wardmote-mcp.test.d.ts.map +1 -0
  199. package/dist/wardmote-mcp.test.js +133 -0
  200. package/dist/wardmote-mcp.test.js.map +1 -0
  201. package/dist/{paperclip-runner-permissions.d.ts → wardmote-runner-permissions.d.ts} +31 -36
  202. package/dist/wardmote-runner-permissions.d.ts.map +1 -0
  203. package/dist/{paperclip-runner-permissions.js → wardmote-runner-permissions.js} +30 -35
  204. package/dist/wardmote-runner-permissions.js.map +1 -0
  205. package/dist/wardmote-runner-permissions.test.d.ts +2 -0
  206. package/dist/wardmote-runner-permissions.test.d.ts.map +1 -0
  207. package/dist/wardmote-runner-permissions.test.js +80 -0
  208. package/dist/wardmote-runner-permissions.test.js.map +1 -0
  209. package/dist/workspace-git-stream.test.js +1 -1
  210. package/dist/workspace-git-stream.test.js.map +1 -1
  211. package/dist/workspace-manifest.js +1 -1
  212. package/dist/workspace-manifest.js.map +1 -1
  213. package/dist/workspace-manifest.test.js +5 -5
  214. package/dist/workspace-manifest.test.js.map +1 -1
  215. package/dist/workspace-restore-diagnostics.js +1 -1
  216. package/dist/workspace-restore-diagnostics.js.map +1 -1
  217. package/dist/workspace-restore-diagnostics.test.js +5 -5
  218. package/dist/workspace-restore-diagnostics.test.js.map +1 -1
  219. package/dist/workspace-restore-merge.js +8 -8
  220. package/dist/workspace-restore-merge.js.map +1 -1
  221. package/dist/workspace-restore-merge.test.js +76 -82
  222. package/dist/workspace-restore-merge.test.js.map +1 -1
  223. package/dist/workspace-restore-result.test.js +2 -2
  224. package/dist/workspace-restore-result.test.js.map +1 -1
  225. package/dist/workspace-restore-teardown.test.js +6 -6
  226. package/dist/workspace-restore-teardown.test.js.map +1 -1
  227. package/node_modules/@clack/core/dist/index.d.mts +5 -3
  228. package/node_modules/@clack/core/dist/index.mjs +70 -67
  229. package/node_modules/@clack/core/package.json +3 -2
  230. package/node_modules/@clack/prompts/dist/index.d.mts +5 -4
  231. package/node_modules/@clack/prompts/dist/index.mjs +212 -187
  232. package/node_modules/@clack/prompts/package.json +3 -3
  233. package/node_modules/sisteransi/dist/index.d.ts +33 -0
  234. package/node_modules/sisteransi/dist/index.js +57 -0
  235. package/node_modules/sisteransi/package.json +18 -7
  236. package/node_modules/sisteransi/readme.md +19 -6
  237. package/package.json +2 -2
  238. package/dist/env-aliases-run.test.d.ts +0 -2
  239. package/dist/env-aliases-run.test.d.ts.map +0 -1
  240. package/dist/env-aliases-run.test.js +0 -49
  241. package/dist/env-aliases-run.test.js.map +0 -1
  242. package/dist/paperclip-mcp-mount.d.ts.map +0 -1
  243. package/dist/paperclip-mcp-mount.js.map +0 -1
  244. package/dist/paperclip-mcp.d.ts +0 -53
  245. package/dist/paperclip-mcp.d.ts.map +0 -1
  246. package/dist/paperclip-mcp.js +0 -149
  247. package/dist/paperclip-mcp.js.map +0 -1
  248. package/dist/paperclip-mcp.test.d.ts +0 -2
  249. package/dist/paperclip-mcp.test.d.ts.map +0 -1
  250. package/dist/paperclip-mcp.test.js +0 -133
  251. package/dist/paperclip-mcp.test.js.map +0 -1
  252. package/dist/paperclip-runner-permissions.d.ts.map +0 -1
  253. package/dist/paperclip-runner-permissions.js.map +0 -1
  254. package/dist/paperclip-runner-permissions.test.d.ts +0 -2
  255. package/dist/paperclip-runner-permissions.test.d.ts.map +0 -1
  256. package/dist/paperclip-runner-permissions.test.js +0 -80
  257. package/dist/paperclip-runner-permissions.test.js.map +0 -1
  258. package/node_modules/sisteransi/src/index.js +0 -58
  259. package/node_modules/sisteransi/src/sisteransi.d.ts +0 -35
@@ -1,4 +1,4 @@
1
- import { getColumns, getRows, AutocompletePrompt, settings, ConfirmPrompt, wrapTextWithPrefix, DatePrompt, runValidation, isCancel, MultiSelectPrompt, GroupMultiSelectPrompt, MultiLinePrompt, PasswordPrompt, block, SelectPrompt, SelectKeyPrompt, TextPrompt } from '@clack/core';
1
+ import { wrapTextWithPrefix, getColumns, getRows, AutocompletePrompt, settings, ConfirmPrompt, DatePrompt, runValidation, isCancel, MultiSelectPrompt, GroupMultiSelectPrompt, MultiLinePrompt, PasswordPrompt, isAccessible, block, SelectPrompt, SelectKeyPrompt, TextPrompt } from '@clack/core';
2
2
  export { CANCEL_SYMBOL, isCancel, settings, updateSettings } from '@clack/core';
3
3
  import { styleText, stripVTControlCharacters } from 'node:util';
4
4
  import process$1 from 'node:process';
@@ -24,8 +24,8 @@ function isUnicodeSupported() {
24
24
  || process$1.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
25
25
  }
26
26
 
27
- const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", isTTY = (o) => o.isTTY === true, unicodeOr = (o, e) => unicode ? o : e, S_STEP_ACTIVE = unicodeOr("\u25C6", "*"), S_STEP_CANCEL = unicodeOr("\u25A0", "x"), S_STEP_ERROR = unicodeOr("\u25B2", "x"), S_STEP_SUBMIT = unicodeOr("\u25C7", "o"), S_BAR_START = unicodeOr("\u250C", "T"), S_BAR = unicodeOr("\u2502", "|"), S_BAR_END = unicodeOr("\u2514", "\u2014"), S_BAR_START_RIGHT = unicodeOr("\u2510", "T"), S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014"), S_RADIO_ACTIVE = unicodeOr("\u25CF", ">"), S_RADIO_INACTIVE = unicodeOr("\u25CB", " "), S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]"), S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]"), S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]"), S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022"), S_BAR_H = unicodeOr("\u2500", "-"), S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+"), S_CONNECT_LEFT = unicodeOr("\u251C", "+"), S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+"), S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+"), S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+"), S_INFO = unicodeOr("\u25CF", "\u2022"), S_SUCCESS = unicodeOr("\u25C6", "*"), S_WARN = unicodeOr("\u25B2", "!"), S_ERROR = unicodeOr("\u25A0", "x"), symbol = (o) => {
28
- switch (o) {
27
+ const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", isTTY = (e) => e.isTTY === true, unicodeOr = (e, o) => unicode ? e : o, S_STEP_ACTIVE = unicodeOr("\u25C6", "*"), S_STEP_CANCEL = unicodeOr("\u25A0", "x"), S_STEP_ERROR = unicodeOr("\u25B2", "x"), S_STEP_SUBMIT = unicodeOr("\u25C7", "o"), S_BAR_START = unicodeOr("\u250C", "T"), S_BAR = unicodeOr("\u2502", "|"), S_BAR_END = unicodeOr("\u2514", "\u2014"), S_BAR_START_RIGHT = unicodeOr("\u2510", "T"), S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014"), S_RADIO_ACTIVE = unicodeOr("\u25CF", ">"), S_RADIO_INACTIVE = unicodeOr("\u25CB", " "), S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]"), S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]"), S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]"), S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022"), S_BAR_H = unicodeOr("\u2500", "-"), S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+"), S_CONNECT_LEFT = unicodeOr("\u251C", "+"), S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+"), S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+"), S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+"), S_INFO = unicodeOr("\u25CF", "\u2022"), S_SUCCESS = unicodeOr("\u25C6", "*"), S_WARN = unicodeOr("\u25B2", "!"), S_ERROR = unicodeOr("\u25A0", "x"), symbol = (e) => {
28
+ switch (e) {
29
29
  case "initial":
30
30
  case "active":
31
31
  return styleText("cyan", S_STEP_ACTIVE);
@@ -38,8 +38,8 @@ const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", is
38
38
  case "validating":
39
39
  return styleText("dim", S_STEP_ACTIVE);
40
40
  }
41
- }, symbolBar = (o) => {
42
- switch (o) {
41
+ }, symbolBar = (e) => {
42
+ switch (e) {
43
43
  case "initial":
44
44
  case "active":
45
45
  return styleText("cyan", S_BAR);
@@ -51,12 +51,13 @@ const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", is
51
51
  return styleText("green", S_BAR);
52
52
  }
53
53
  };
54
- function formatInstructionFooter(o, e) {
55
- const r = [`${e ? `${styleText("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
56
- return e && r.push(styleText("cyan", S_BAR_END)), r;
54
+ function formatInstructionFooter(e, o, r) {
55
+ const s = r ? `${styleText("cyan", S_BAR)} ` : "", n = wrapTextWithPrefix(e, o.join(" \u2022 "), s).split(`
56
+ `);
57
+ return r && n.push(styleText("cyan", S_BAR_END)), n;
57
58
  }
58
59
 
59
- const I = (l, e, w, p, b, C = false) => {
60
+ const E$1 = (l, e, w, p, b, C = false) => {
60
61
  let r = e, O = 0;
61
62
  if (C)
62
63
  for (let i = p - 1; i >= w; i--) {
@@ -86,15 +87,15 @@ const limitOptions = ({
86
87
  0
87
88
  ));
88
89
  let d = a < e.length && f > 0, c = a < e.length && f + a < e.length;
89
- const W = Math.min(
90
+ const I = Math.min(
90
91
  f + a,
91
92
  e.length
92
93
  ), s = [];
93
94
  let g = 0;
94
95
  d && g++, c && g++;
95
- const T = f + (d ? 1 : 0), y = W - (c ? 1 : 0);
96
- for (let t = T; t < y; t++) {
97
- const n = e[t], o = n ? w(n, t === l) : "", h = wrapAnsi(o, i, {
96
+ const T = f + (d ? 1 : 0), W = I - (c ? 1 : 0);
97
+ for (let t = T; t < W; t++) {
98
+ const n = e[t], o = n !== void 0 ? w(n, t === l) : "", h = wrapAnsi(o, i, {
98
99
  hard: true,
99
100
  trim: false
100
101
  }).split(`
@@ -105,7 +106,7 @@ const limitOptions = ({
105
106
  let t = 0, n = 0, o = g;
106
107
  const h = l - T;
107
108
  let u = v;
108
- const L = () => I(s, o, 0, h, u), E = () => I(
109
+ const L = () => E$1(s, o, 0, h, u), y = () => E$1(
109
110
  s,
110
111
  o,
111
112
  h + 1,
@@ -113,7 +114,7 @@ const limitOptions = ({
113
114
  u,
114
115
  true
115
116
  );
116
- d ? ({ lineCount: o, removals: t } = L(), o > u && (c || (u -= 1), { lineCount: o, removals: n } = E())) : (c || (u -= 1), { lineCount: o, removals: n } = E(), o > u && (u -= 1, { lineCount: o, removals: t } = L())), t > 0 && (d = true, s.splice(0, t)), n > 0 && (c = true, s.splice(s.length - n, n));
117
+ d ? ({ lineCount: o, removals: t } = L(), o > u && (c || (u -= 1), { lineCount: o, removals: n } = y())) : (c || (u -= 1), { lineCount: o, removals: n } = y(), o > u && (u -= 1, { lineCount: o, removals: t } = L())), t > 0 && (d = true, s.splice(0, t)), n > 0 && (c = true, s.splice(s.length - n, n));
117
118
  }
118
119
  const x = [];
119
120
  d && x.push(M);
@@ -140,7 +141,7 @@ function j(t, c) {
140
141
  }
141
142
  const autocomplete = (t) => new AutocompletePrompt({
142
143
  options: t.options,
143
- initialValue: t.initialValue ? [t.initialValue] : void 0,
144
+ initialValue: t.initialValue !== void 0 ? [t.initialValue] : void 0,
144
145
  initialUserInput: t.initialUserInput,
145
146
  placeholder: t.placeholder,
146
147
  completeOnTab: t.completeOnTab,
@@ -470,22 +471,22 @@ const MULTISELECT_INSTRUCTIONS = [
470
471
  `${styleText("dim", "Space:")} select`,
471
472
  `${styleText("dim", "Enter:")} confirm`
472
473
  ];
473
- const m = (i, u) => i.split(`
474
+ const m = (n, u) => n.split(`
474
475
  `).map((d) => u(d)).join(`
475
476
  `);
476
- const multiselect = (i) => {
477
+ const multiselect = (n) => {
477
478
  const u = (t, a) => {
478
479
  const r = t.label ?? String(t.value);
479
480
  return a === "disabled" ? `${styleText("gray", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText(["strikethrough", "gray"], o))}${t.hint ? ` ${styleText("dim", `(${t.hint ?? "disabled"})`)}` : ""}` : a === "active" ? `${styleText("cyan", S_CHECKBOX_ACTIVE)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${m(r, (o) => styleText("dim", o))}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "cancelled" ? `${m(r, (o) => styleText(["strikethrough", "dim"], o))}` : a === "active-selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "submitted" ? `${m(r, (o) => styleText("dim", o))}` : `${styleText("dim", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText("dim", o))}`;
480
- }, d = i.required ?? true, x = i.showInstructions ?? true;
481
+ }, d = n.required ?? true, x = n.showInstructions ?? true;
481
482
  return new MultiSelectPrompt({
482
- options: i.options,
483
- signal: i.signal,
484
- input: i.input,
485
- output: i.output,
486
- initialValues: i.initialValues,
483
+ options: n.options,
484
+ signal: n.signal,
485
+ input: n.input,
486
+ output: n.output,
487
+ initialValues: n.initialValues,
487
488
  required: d,
488
- cursorAt: i.cursorAt,
489
+ cursorAt: n.cursorAt,
489
490
  validate(t) {
490
491
  if (d && (t === void 0 || t.length === 0))
491
492
  return `Please select at least one option.
@@ -501,75 +502,75 @@ ${styleText(
501
502
  )}`;
502
503
  },
503
504
  render() {
504
- const t = i.withGuide ?? settings.withGuide, a = wrapTextWithPrefix(
505
- i.output,
506
- i.message,
505
+ const t = n.withGuide ?? settings.withGuide, a = wrapTextWithPrefix(
506
+ n.output,
507
+ n.message,
507
508
  t ? `${symbolBar(this.state)} ` : "",
508
509
  `${symbol(this.state)} `
509
510
  ), r = `${t ? `${styleText("gray", S_BAR)}
510
511
  ` : ""}${a}
511
- `, o = this.value ?? [], g = (n, l) => {
512
- if (n.disabled)
513
- return u(n, "disabled");
514
- const s = o.includes(n.value);
515
- return l && s ? u(n, "active-selected") : s ? u(n, "selected") : u(n, l ? "active" : "inactive");
512
+ `, o = this.value ?? [], g = (i, l) => {
513
+ if (i.disabled)
514
+ return u(i, "disabled");
515
+ const s = o.includes(i.value);
516
+ return l && s ? u(i, "active-selected") : s ? u(i, "selected") : u(i, l ? "active" : "inactive");
516
517
  };
517
518
  switch (this.state) {
518
519
  case "submit": {
519
- const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = wrapTextWithPrefix(
520
- i.output,
521
- n,
520
+ const i = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = wrapTextWithPrefix(
521
+ n.output,
522
+ i,
522
523
  t ? `${styleText("gray", S_BAR)} ` : ""
523
524
  );
524
525
  return `${r}${l}`;
525
526
  }
526
527
  case "cancel": {
527
- const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "cancelled")).join(styleText("dim", ", "));
528
- if (n.trim() === "")
528
+ const i = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "cancelled")).join(styleText("dim", ", "));
529
+ if (i.trim() === "")
529
530
  return `${r}${styleText("gray", S_BAR)}`;
530
531
  const l = wrapTextWithPrefix(
531
- i.output,
532
- n,
532
+ n.output,
533
+ i,
533
534
  t ? `${styleText("gray", S_BAR)} ` : ""
534
535
  );
535
536
  return `${r}${l}${t ? `
536
537
  ${styleText("gray", S_BAR)}` : ""}`;
537
538
  }
538
539
  case "error": {
539
- const n = t ? `${styleText("yellow", S_BAR)} ` : "", l = this.error.split(`
540
+ const i = t ? `${styleText("yellow", S_BAR)} ` : "", l = this.error.split(`
540
541
  `).map(
541
542
  ($, v) => v === 0 ? `${t ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", $)}` : ` ${$}`
542
543
  ).join(`
543
544
  `), s = r.split(`
544
545
  `).length, h = l.split(`
545
546
  `).length + 1;
546
- return `${r}${n}${limitOptions({
547
- output: i.output,
547
+ return `${r}${i}${limitOptions({
548
+ output: n.output,
548
549
  options: this.options,
549
550
  cursor: this.cursor,
550
- maxItems: i.maxItems,
551
- columnPadding: n.length,
551
+ maxItems: n.maxItems,
552
+ columnPadding: i.length,
552
553
  rowPadding: s + h,
553
554
  style: g
554
555
  }).join(`
555
- ${n}`)}
556
+ ${i}`)}
556
557
  ${l}
557
558
  `;
558
559
  }
559
560
  default: {
560
- const n = t ? `${styleText("cyan", S_BAR)} ` : "", l = r.split(`
561
- `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t) : t ? [styleText("cyan", S_BAR_END)] : [], h = s.join(`
561
+ const i = t ? `${styleText("cyan", S_BAR)} ` : "", l = r.split(`
562
+ `).length, s = x ? formatInstructionFooter(n.output, MULTISELECT_INSTRUCTIONS, t) : t ? [styleText("cyan", S_BAR_END)] : [], h = s.join(`
562
563
  `), $ = s.length + 1;
563
- return `${r}${n}${limitOptions({
564
- output: i.output,
564
+ return `${r}${i}${limitOptions({
565
+ output: n.output,
565
566
  options: this.options,
566
567
  cursor: this.cursor,
567
- maxItems: i.maxItems,
568
- columnPadding: n.length,
568
+ maxItems: n.maxItems,
569
+ columnPadding: i.length,
569
570
  rowPadding: l + $,
570
571
  style: g
571
572
  }).join(`
572
- ${n}`)}
573
+ ${i}`)}
573
574
  ${h}
574
575
  `;
575
576
  }
@@ -578,46 +579,46 @@ ${h}
578
579
  }).prompt();
579
580
  };
580
581
 
581
- const groupMultiselect = (o) => {
582
- const { selectableGroups: f = true, groupSpacing: x = 0 } = o, d = (n, l, p = []) => {
583
- const a = n.label ?? String(n.value), t = typeof n.group == "string", s = t && (p[p.indexOf(n) + 1] ?? { group: true }), u = t && s && s.group === true;
584
- let r = "", c = "";
585
- t && (f ? (r = u ? `${S_BAR_END} ` : `${S_BAR} `, c = u ? " " : `${S_BAR} `) : r = " ");
582
+ const groupMultiselect = (r) => {
583
+ const { selectableGroups: f = true, groupSpacing: x = 0 } = r, d = (n, l, p = []) => {
584
+ const a = n.label ?? String(n.value), t = typeof n.group == "string", u = t && (p[p.indexOf(n) + 1] ?? { group: true }), s = t && u && u.group === true;
585
+ let o = "", c = "";
586
+ t && (f ? (o = s ? `${S_BAR_END} ` : `${S_BAR} `, c = s ? " " : `${S_BAR} `) : o = " ");
586
587
  let i = "";
587
588
  if (x > 0 && !t && (i = `
588
589
  `.repeat(x)), l === "active")
589
590
  return wrapTextWithPrefix(
590
- o.output,
591
+ r.output,
591
592
  `${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`,
592
- `${i}${styleText("dim", r)} `,
593
- `${i}${styleText("dim", r)}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
593
+ `${i}${styleText("dim", o)} `,
594
+ `${i}${styleText("dim", o)}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
594
595
  `${i}${styleText("dim", c)} `
595
596
  );
596
597
  if (l === "group-active")
597
598
  return wrapTextWithPrefix(
598
- o.output,
599
+ r.output,
599
600
  a,
600
- `${i}${r} `,
601
- `${i}${r}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
601
+ `${i}${o} `,
602
+ `${i}${o}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
602
603
  `${i}${c} `,
603
604
  (m) => styleText("dim", m)
604
605
  );
605
606
  if (l === "group-active-selected")
606
607
  return wrapTextWithPrefix(
607
- o.output,
608
+ r.output,
608
609
  a,
609
- `${i}${r} `,
610
- `${i}${r}${styleText("green", S_CHECKBOX_SELECTED)} `,
610
+ `${i}${o} `,
611
+ `${i}${o}${styleText("green", S_CHECKBOX_SELECTED)} `,
611
612
  `${i}${c} `,
612
613
  (m) => styleText("dim", m)
613
614
  );
614
615
  if (l === "selected") {
615
616
  const m = t || f ? styleText("green", S_CHECKBOX_SELECTED) : "";
616
617
  return wrapTextWithPrefix(
617
- o.output,
618
+ r.output,
618
619
  `${a}${n.hint ? ` (${n.hint})` : ""}`,
619
- `${i}${styleText("dim", r)} `,
620
- `${i}${styleText("dim", r)}${m} `,
620
+ `${i}${styleText("dim", o)} `,
621
+ `${i}${styleText("dim", o)}${m} `,
621
622
  `${i}${styleText("dim", c)} `,
622
623
  (I) => styleText("dim", I)
623
624
  );
@@ -626,32 +627,32 @@ const groupMultiselect = (o) => {
626
627
  return `${styleText(["strikethrough", "dim"], a)}`;
627
628
  if (l === "active-selected")
628
629
  return wrapTextWithPrefix(
629
- o.output,
630
+ r.output,
630
631
  `${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`,
631
- `${i}${styleText("dim", r)} `,
632
- `${i}${styleText("dim", r)}${styleText("green", S_CHECKBOX_SELECTED)} `,
632
+ `${i}${styleText("dim", o)} `,
633
+ `${i}${styleText("dim", o)}${styleText("green", S_CHECKBOX_SELECTED)} `,
633
634
  `${i}${styleText("dim", c)} `
634
635
  );
635
636
  if (l === "submitted")
636
637
  return `${styleText("dim", a)}`;
637
638
  const h = t || f ? styleText("dim", S_CHECKBOX_INACTIVE) : "";
638
639
  return wrapTextWithPrefix(
639
- o.output,
640
+ r.output,
640
641
  a,
641
- `${i}${styleText("dim", r)} `,
642
- `${i}${styleText("dim", r)}${h} `,
642
+ `${i}${styleText("dim", o)} `,
643
+ `${i}${styleText("dim", o)}${h} `,
643
644
  `${i}${styleText("dim", c)} `,
644
645
  (m) => styleText("dim", m)
645
646
  );
646
- }, y = o.required ?? true, S = o.showInstructions ?? true;
647
+ }, y = r.required ?? true, S = r.showInstructions ?? true;
647
648
  return new GroupMultiSelectPrompt({
648
- options: o.options,
649
- signal: o.signal,
650
- input: o.input,
651
- output: o.output,
652
- initialValues: o.initialValues,
649
+ options: r.options,
650
+ signal: r.signal,
651
+ input: r.input,
652
+ output: r.output,
653
+ initialValues: r.initialValues,
653
654
  required: y,
654
- cursorAt: o.cursorAt,
655
+ cursorAt: r.cursorAt,
655
656
  selectableGroups: f,
656
657
  validate(n) {
657
658
  if (y && (n === void 0 || n.length === 0))
@@ -668,58 +669,58 @@ ${styleText(
668
669
  )}`;
669
670
  },
670
671
  render() {
671
- const n = o.withGuide ?? settings.withGuide, l = `${n ? `${styleText("gray", S_BAR)}
672
- ` : ""}${symbol(this.state)} ${o.message}
673
- `, p = this.value ?? [], a = (t, s) => {
674
- const u = this.options, r = p.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);
675
- return !s && typeof t.group == "string" && this.options[this.cursor]?.value === t.group ? d(t, r ? "group-active-selected" : "group-active", u) : s && r ? d(t, "active-selected", u) : r ? d(t, "selected", u) : d(t, s ? "active" : "inactive", u);
672
+ const n = r.withGuide ?? settings.withGuide, l = `${n ? `${styleText("gray", S_BAR)}
673
+ ` : ""}${symbol(this.state)} ${r.message}
674
+ `, p = this.value ?? [], a = (t, u) => {
675
+ const s = this.options, o = p.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);
676
+ return !u && typeof t.group == "string" && this.options[this.cursor]?.value === t.group ? d(t, o ? "group-active-selected" : "group-active", s) : u && o ? d(t, "active-selected", s) : o ? d(t, "selected", s) : d(t, u ? "active" : "inactive", s);
676
677
  };
677
678
  switch (this.state) {
678
679
  case "submit": {
679
- const t = this.options.filter(({ value: u }) => p.includes(u)).map((u) => d(u, "submitted")), s = t.length === 0 ? "" : ` ${t.join(styleText("dim", ", "))}`;
680
- return `${l}${n ? styleText("gray", S_BAR) : ""}${s}`;
680
+ const t = this.options.filter(({ value: s }) => p.includes(s)).map((s) => d(s, "submitted")), u = t.length === 0 ? "" : ` ${t.join(styleText("dim", ", "))}`;
681
+ return `${l}${n ? styleText("gray", S_BAR) : ""}${u}`;
681
682
  }
682
683
  case "cancel": {
683
- const t = this.options.filter(({ value: s }) => p.includes(s)).map((s) => d(s, "cancelled")).join(styleText("dim", ", "));
684
+ const t = this.options.filter(({ value: u }) => p.includes(u)).map((u) => d(u, "cancelled")).join(styleText("dim", ", "));
684
685
  return `${l}${n ? `${styleText("gray", S_BAR)} ` : ""}${t.trim() ? `${t}${n ? `
685
686
  ${styleText("gray", S_BAR)}` : ""}` : ""}`;
686
687
  }
687
688
  case "error": {
688
- const t = n ? `${styleText("yellow", S_BAR)} ` : "", s = this.error.split(`
689
+ const t = n ? `${styleText("yellow", S_BAR)} ` : "", u = this.error.split(`
689
690
  `).map(
690
691
  (i, h) => h === 0 ? `${n ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", i)}` : ` ${i}`
691
692
  ).join(`
692
- `), u = l.split(`
693
- `).length, r = s.split(`
693
+ `), s = l.split(`
694
+ `).length, o = u.split(`
694
695
  `).length + 1, c = limitOptions({
695
- output: o.output,
696
+ output: r.output,
696
697
  options: this.options,
697
698
  cursor: this.cursor,
698
- maxItems: o.maxItems,
699
+ maxItems: r.maxItems,
699
700
  columnPadding: t.length,
700
- rowPadding: u + r,
701
+ rowPadding: s + o,
701
702
  style: a
702
703
  }).join(`
703
704
  ${t}`);
704
705
  return `${l}${t}${c}
705
- ${s}
706
+ ${u}
706
707
  `;
707
708
  }
708
709
  default: {
709
- const t = n ? `${styleText("cyan", S_BAR)} ` : "", s = l.split(`
710
- `).length, u = S ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], r = u.join(`
711
- `), c = u.length + 1, i = limitOptions({
712
- output: o.output,
710
+ const t = n ? `${styleText("cyan", S_BAR)} ` : "", u = l.split(`
711
+ `).length, s = S ? formatInstructionFooter(r.output, MULTISELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], o = s.join(`
712
+ `), c = s.length + 1, i = limitOptions({
713
+ output: r.output,
713
714
  options: this.options,
714
715
  cursor: this.cursor,
715
- maxItems: o.maxItems,
716
+ maxItems: r.maxItems,
716
717
  columnPadding: t.length,
717
- rowPadding: s + c,
718
+ rowPadding: u + c,
718
719
  style: a
719
720
  }).join(`
720
721
  ${t}`);
721
722
  return `${l}${t}${i}
722
- ${r}
723
+ ${o}
723
724
  `;
724
725
  }
725
726
  }
@@ -844,7 +845,7 @@ ${r}${d}
844
845
  }
845
846
  }).prompt();
846
847
 
847
- const W$1 = (o) => o, C = (o, e, s) => {
848
+ const W = (o) => o, C = (o, e, s) => {
848
849
  const a = {
849
850
  hard: true,
850
851
  trim: false
@@ -853,7 +854,7 @@ const W$1 = (o) => o, C = (o, e, s) => {
853
854
  return wrapAnsi(o, g, a);
854
855
  };
855
856
  const note = (o = "", e = "", s) => {
856
- const a = s?.output ?? process$1.stdout, i = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = ["", ...C(o, getColumns(a) - 6, c).split(`
857
+ const a = s?.output ?? process$1.stdout, i = s?.withGuide ?? settings.withGuide, c = s?.format ?? W, g = ["", ...C(o, getColumns(a) - 6, c).split(`
857
858
  `).map(c), ""], n = l(e), t = Math.max(
858
859
  g.reduce((m, F) => {
859
860
  const O = l(F);
@@ -934,17 +935,18 @@ const path = (e) => {
934
935
  return [];
935
936
  try {
936
937
  let i;
937
- existsSync(t) ? lstatSync(t).isDirectory() && (!e.directory || t.endsWith("/")) ? i = t : i = dirname(t) : i = dirname(t);
938
- const c = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
938
+ const o = t.endsWith("/") || t.endsWith("\\");
939
+ existsSync(t) ? lstatSync(t).isDirectory() && (!e.directory || o) ? i = t : i = dirname(t) : i = dirname(t);
940
+ const m = t.length > 1 && o ? t.slice(0, -1) : t;
939
941
  return readdirSync(i).map((r) => {
940
- const n = join(i, r), m = lstatSync(n);
942
+ const n = join(i, r), l = lstatSync(n);
941
943
  return {
942
944
  name: r,
943
945
  path: n,
944
- isDirectory: m.isDirectory()
946
+ isDirectory: l.isDirectory()
945
947
  };
946
948
  }).filter(
947
- ({ path: r, isDirectory: n }) => r.startsWith(c) && (n || !e.directory)
949
+ ({ path: r, isDirectory: n }) => r.startsWith(m) && (n || !e.directory)
948
950
  ).map((r) => ({
949
951
  value: r.path
950
952
  }));
@@ -955,83 +957,101 @@ const path = (e) => {
955
957
  });
956
958
  };
957
959
 
958
- const W = (l) => styleText("magenta", l);
960
+ const Y = 3e4, Z = (c) => styleText("magenta", c);
959
961
  const spinner = ({
960
- indicator: l = "dots",
961
- onCancel: h,
962
+ indicator: c = "dots",
963
+ onCancel: b,
962
964
  output: n = process.stdout,
963
- cancelMessage: G,
964
- errorMessage: O,
965
- frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
966
- delay: F = unicode ? 80 : 120,
967
- signal: m,
968
- ...I
965
+ cancelMessage: _,
966
+ errorMessage: C,
967
+ frames: M = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
968
+ delay: O = unicode ? 80 : 120,
969
+ signal: g,
970
+ ...E
969
971
  } = {}) => {
970
- const u = isCI();
971
- let M, T, d = false, S = false, s = "", p, w = performance.now();
972
- const x = getColumns(n), k = I?.styleFrame ?? W, g = (e) => {
973
- const r = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
974
- S = e === 1, d && (a(r, e), S && typeof h == "function" && h());
975
- }, f = () => g(2), i = () => g(1), A = () => {
976
- process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i), process.on("SIGTERM", i), process.on("exit", g), m && m.addEventListener("abort", i);
977
- }, H = () => {
978
- process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i), process.removeListener("SIGTERM", i), process.removeListener("exit", g), m && m.removeEventListener("abort", i);
979
- }, y = () => {
980
- if (p === void 0) return;
972
+ const u = isCI(), h = isAccessible(E.accessible);
973
+ let x, I, p = false, l = false, r = "", v, w = performance.now();
974
+ const y = getColumns(n), F = E?.styleFrame ?? Z, S = (e) => {
975
+ const s = e > 1 ? C ?? settings.messages.error : _ ?? settings.messages.cancel;
976
+ l = e === 1, p && (m(s, e), l && typeof b == "function" && b());
977
+ }, $ = () => S(2), a = () => S(1), H = () => {
978
+ process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a), process.on("SIGTERM", a), process.on("exit", S), g && g.addEventListener("abort", a);
979
+ }, B = () => {
980
+ process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a), process.removeListener("SIGTERM", a), process.removeListener("exit", S), g && g.removeEventListener("abort", a);
981
+ }, R = () => {
982
+ if (v === void 0) return;
981
983
  u && n.write(`
982
984
  `);
983
- const r = wrapAnsi(p, x, {
985
+ const s = wrapAnsi(v, y, {
984
986
  hard: true,
985
987
  trim: false
986
988
  }).split(`
987
989
  `);
988
- r.length > 1 && n.write(cursor.up(r.length - 1)), n.write(cursor.to(0)), n.write(erase.down());
989
- }, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
990
- const r = (performance.now() - e) / 1e3, t = Math.floor(r / 60), o = Math.floor(r % 60);
991
- return t > 0 ? `[${t}m ${o}s]` : `[${o}s]`;
992
- }, N = I.withGuide ?? settings.withGuide, P = (e = "") => {
993
- d = true, M = block({ output: n }), s = C(e), w = performance.now(), N && n.write(`${styleText("gray", S_BAR)}
990
+ s.length > 1 && n.write(cursor.up(s.length - 1)), n.write(cursor.to(0)), n.write(erase.down());
991
+ }, L = (e) => e.replace(/\.+$/, ""), T = (e) => {
992
+ const s = (performance.now() - e) / 1e3, i = Math.floor(s / 60), t = Math.floor(s % 60);
993
+ return i > 0 ? `[${i}m ${t}s]` : `[${t}s]`;
994
+ }, N = E.withGuide ?? settings.withGuide, P = (e = "") => {
995
+ if (p = true, l = false, r = L(e), w = performance.now(), H(), h) {
996
+ r !== "" && n.write(`${r}
997
+ `), I = setInterval(() => {
998
+ n.write(r === "" ? `still working
999
+ ` : `still working: ${r}
1000
+ `);
1001
+ }, Y);
1002
+ return;
1003
+ }
1004
+ x = block({ output: n }), N && n.write(`${styleText("gray", S_BAR)}
994
1005
  `);
995
- let r = 0, t = 0;
996
- A(), T = setInterval(() => {
997
- if (u && s === p)
1006
+ let s = 0, i = 0;
1007
+ I = setInterval(() => {
1008
+ if (u && r === v)
998
1009
  return;
999
- y(), p = s;
1000
- const o = k(E[r]);
1001
- let v;
1010
+ R(), v = r;
1011
+ const t = F(M[s]);
1012
+ let o;
1002
1013
  if (u)
1003
- v = `${o} ${s}...`;
1004
- else if (l === "timer")
1005
- v = `${o} ${s} ${_(w)}`;
1014
+ o = `${t} ${r}...`;
1015
+ else if (c === "timer")
1016
+ o = `${t} ${r} ${T(w)}`;
1006
1017
  else {
1007
- const B = ".".repeat(Math.floor(t)).slice(0, 3);
1008
- v = `${o} ${s}${B}`;
1018
+ const j = ".".repeat(Math.floor(i)).slice(0, 3);
1019
+ o = `${t} ${r}${j}`;
1009
1020
  }
1010
- const j = wrapAnsi(v, x, {
1021
+ const D = wrapAnsi(o, y, {
1011
1022
  hard: true,
1012
1023
  trim: false
1013
1024
  });
1014
- n.write(j), r = r + 1 < E.length ? r + 1 : 0, t = t < 4 ? t + 0.125 : 0;
1015
- }, F);
1016
- }, a = (e = "", r = 0, t = false) => {
1017
- if (!d) return;
1018
- d = false, clearInterval(T), y();
1019
- const o = r === 0 ? styleText("green", S_STEP_SUBMIT) : r === 1 ? styleText("red", S_STEP_CANCEL) : styleText("red", S_STEP_ERROR);
1020
- s = e ?? s, t || (l === "timer" ? n.write(`${o} ${s} ${_(w)}
1021
- `) : n.write(`${o} ${s}
1022
- `)), H(), M();
1025
+ n.write(D), s = s + 1 < M.length ? s + 1 : 0, i = i < 4 ? i + 0.125 : 0;
1026
+ }, O);
1027
+ }, m = (e = "", s = 0, i = false) => {
1028
+ if (p) {
1029
+ if (p = false, l = s === 1, clearInterval(I), h || R(), r = e ?? r, !i)
1030
+ if (h) {
1031
+ const t = s === 1 ? _ ?? settings.messages.cancel : s === 2 ? C ?? settings.messages.error : "Done", o = r || t;
1032
+ c === "timer" ? n.write(`${o} ${T(w)}
1033
+ `) : n.write(`${o}
1034
+ `);
1035
+ } else {
1036
+ const t = s === 0 ? styleText("green", S_STEP_SUBMIT) : s === 1 ? styleText("red", S_STEP_CANCEL) : styleText("red", S_STEP_ERROR);
1037
+ c === "timer" ? n.write(`${t} ${r} ${T(w)}
1038
+ `) : n.write(`${t} ${r}
1039
+ `);
1040
+ }
1041
+ B(), x?.();
1042
+ }
1023
1043
  };
1024
1044
  return {
1025
1045
  start: P,
1026
- stop: (e = "") => a(e, 0),
1046
+ stop: (e = "") => m(e, 0),
1027
1047
  message: (e = "") => {
1028
- s = C(e ?? s);
1048
+ r = L(e ?? r);
1029
1049
  },
1030
- cancel: (e = "") => a(e, 1),
1031
- error: (e = "") => a(e, 2),
1032
- clear: () => a("", 0, true),
1050
+ cancel: (e = "") => m(e, 1),
1051
+ error: (e = "") => m(e, 2),
1052
+ clear: () => m("", 0, true),
1033
1053
  get isCancelled() {
1034
- return S;
1054
+ return l;
1035
1055
  }
1036
1056
  };
1037
1057
  };
@@ -1077,7 +1097,9 @@ function progress({
1077
1097
  error: r.error,
1078
1098
  clear: r.clear,
1079
1099
  advance: g,
1080
- isCancelled: r.isCancelled,
1100
+ get isCancelled() {
1101
+ return r.isCancelled;
1102
+ },
1081
1103
  message: (t) => g(0, t)
1082
1104
  };
1083
1105
  }
@@ -1143,7 +1165,7 @@ ${styleText("gray", S_BAR)}` : ""}`;
1143
1165
  }
1144
1166
  default: {
1145
1167
  const r = n ? `${styleText("cyan", S_BAR)} ` : "", a = u.split(`
1146
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], f = p.join(`
1168
+ `).length, p = d ? formatInstructionFooter(t.output, SELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], f = p.join(`
1147
1169
  `), b = p.length + 1;
1148
1170
  return `${u}${r}${limitOptions({
1149
1171
  output: t.output,
@@ -1163,36 +1185,36 @@ ${f}
1163
1185
  }).prompt();
1164
1186
  };
1165
1187
 
1166
- const selectKey = (t) => {
1188
+ const selectKey = (i) => {
1167
1189
  const c = (e, a = "inactive") => {
1168
1190
  if (e === void 0)
1169
1191
  return "";
1170
1192
  const n = e.label ?? String(e.value);
1171
- return a === "selected" ? `${styleText("dim", n)}` : a === "cancelled" ? `${styleText(["strikethrough", "dim"], n)}` : a === "active" ? `${styleText(["bgCyan", "gray"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}` : `${styleText(["gray", "bgWhite", "inverse"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}`;
1193
+ return a === "disabled" ? `${styleText("dim", ` ${e.value} `)} ${styleText("gray", n)}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}` : a === "selected" ? `${styleText("dim", n)}` : a === "cancelled" ? `${styleText(["strikethrough", "dim"], n)}` : a === "active" ? `${styleText(["bgCyan", "gray"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}` : `${styleText(["gray", "bgWhite", "inverse"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}`;
1172
1194
  };
1173
1195
  return new SelectKeyPrompt({
1174
- options: t.options,
1175
- signal: t.signal,
1176
- input: t.input,
1177
- output: t.output,
1178
- initialValue: t.initialValue,
1179
- caseSensitive: t.caseSensitive,
1196
+ options: i.options,
1197
+ signal: i.signal,
1198
+ input: i.input,
1199
+ output: i.output,
1200
+ initialValue: i.initialValue,
1201
+ caseSensitive: i.caseSensitive,
1180
1202
  render() {
1181
- const e = t.withGuide ?? settings.withGuide, a = `${e ? `${styleText("gray", S_BAR)}
1182
- ` : ""}${symbol(this.state)} ${t.message}
1203
+ const e = i.withGuide ?? settings.withGuide, a = `${e ? `${styleText("gray", S_BAR)}
1204
+ ` : ""}${symbol(this.state)} ${i.message}
1183
1205
  `;
1184
1206
  switch (this.state) {
1185
1207
  case "submit": {
1186
- const n = e ? `${styleText("gray", S_BAR)} ` : "", r = this.options.find((u) => u.value === this.value) ?? t.options[0], l = wrapTextWithPrefix(
1187
- t.output,
1208
+ const n = e ? `${styleText("gray", S_BAR)} ` : "", r = this.options.find((l) => l.value === this.value) ?? i.options[0], u = wrapTextWithPrefix(
1209
+ i.output,
1188
1210
  c(r, "selected"),
1189
1211
  n
1190
1212
  );
1191
- return `${a}${l}`;
1213
+ return `${a}${u}`;
1192
1214
  }
1193
1215
  case "cancel": {
1194
1216
  const n = e ? `${styleText("gray", S_BAR)} ` : "", r = wrapTextWithPrefix(
1195
- t.output,
1217
+ i.output,
1196
1218
  c(this.options[0], "cancelled"),
1197
1219
  n
1198
1220
  );
@@ -1200,15 +1222,18 @@ const selectKey = (t) => {
1200
1222
  ${styleText("gray", S_BAR)}` : ""}`;
1201
1223
  }
1202
1224
  default: {
1203
- const n = e ? `${styleText("cyan", S_BAR)} ` : "", r = e ? styleText("cyan", S_BAR_END) : "", l = this.options.map(
1204
- (u, d) => wrapTextWithPrefix(
1205
- t.output,
1206
- c(u, d === this.cursor ? "active" : "inactive"),
1225
+ const n = e ? `${styleText("cyan", S_BAR)} ` : "", r = e ? styleText("cyan", S_BAR_END) : "", u = this.options.map(
1226
+ (l, $) => wrapTextWithPrefix(
1227
+ i.output,
1228
+ c(
1229
+ l,
1230
+ l.disabled ? "disabled" : $ === this.cursor ? "active" : "inactive"
1231
+ ),
1207
1232
  n
1208
1233
  )
1209
1234
  ).join(`
1210
1235
  `);
1211
- return `${a}${l}
1236
+ return `${a}${u}
1212
1237
  ${r}
1213
1238
  `;
1214
1239
  }