octocode-cli 1.3.0 → 1.5.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 (106) hide show
  1. package/README.md +129 -28
  2. package/out/chunks/chunk-7476PETK.js +309 -0
  3. package/out/chunks/chunk-CVNNNSMQ.js +26 -0
  4. package/out/chunks/chunk-OQBJTZWK.js +60 -0
  5. package/out/chunks/chunk-UCZCF3BQ.js +9 -0
  6. package/out/chunks/command-help-specs-JZXVSLZ5.js +8 -0
  7. package/out/chunks/commands-XBFPLHSQ.js +8 -0
  8. package/out/chunks/help-P7TCOYAJ.js +10 -0
  9. package/out/chunks/main-help-ULF5PAQY.js +10 -0
  10. package/out/chunks/prompts-5E6VKRX5.js +8 -0
  11. package/out/chunks/spinner-URV2OX6O.js +8 -0
  12. package/out/chunks/tool-command-M6VA7P2F.js +8 -0
  13. package/out/octocode-cli.js +1 -1
  14. package/package.json +5 -3
  15. package/skills/README.md +60 -58
  16. package/skills/agentic-flow-best-practices/SKILL.md +280 -0
  17. package/skills/agentic-flow-best-practices/references/agent-collaboration-patterns.md +75 -0
  18. package/skills/agentic-flow-best-practices/references/pr-review-agent-example.md +47 -0
  19. package/skills/agentic-flow-best-practices/references/resources.md +112 -0
  20. package/skills/octocode-brainstorming/.env.example +11 -0
  21. package/skills/octocode-brainstorming/SKILL.md +262 -0
  22. package/skills/octocode-brainstorming/scripts/tavily-search.mjs +138 -0
  23. package/skills/octocode-chrome-devtools/README.md +541 -0
  24. package/skills/octocode-chrome-devtools/SKILL.md +197 -0
  25. package/skills/octocode-chrome-devtools/agents/openai.yaml +7 -0
  26. package/skills/octocode-chrome-devtools/references/CDP_AGENT_REFERENCE.md +401 -0
  27. package/skills/octocode-chrome-devtools/references/CHROME_FLAGS.md +234 -0
  28. package/skills/octocode-chrome-devtools/references/INTENTS.md +108 -0
  29. package/skills/octocode-chrome-devtools/references/INTENTS_AUTH.md +179 -0
  30. package/skills/octocode-chrome-devtools/references/INTENTS_AUTOMATION.md +214 -0
  31. package/skills/octocode-chrome-devtools/references/INTENTS_DEBUG.md +329 -0
  32. package/skills/octocode-chrome-devtools/references/INTENTS_ENVIRONMENT.md +237 -0
  33. package/skills/octocode-chrome-devtools/references/INTENTS_INSPECT.md +263 -0
  34. package/skills/octocode-chrome-devtools/references/INTENTS_STORAGE_CONSENT.md +214 -0
  35. package/skills/octocode-chrome-devtools/references/RECOVERY.md +39 -0
  36. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS.md +43 -0
  37. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS_ASYNC_WORKERS.md +345 -0
  38. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS_BROWSER.md +403 -0
  39. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS_OBSERVE.md +275 -0
  40. package/skills/octocode-chrome-devtools/references/SCRIPT_PATTERNS_SPECIAL.md +18 -0
  41. package/skills/octocode-chrome-devtools/scripts/cdp-runner.mjs +503 -0
  42. package/skills/octocode-chrome-devtools/scripts/cdp-sandbox.mjs +123 -0
  43. package/skills/octocode-chrome-devtools/scripts/cdp-template.mjs +81 -0
  44. package/skills/octocode-chrome-devtools/scripts/octocode-chrome-devtools.vpn.example.json +8 -0
  45. package/skills/octocode-chrome-devtools/scripts/open-browser.mjs +362 -0
  46. package/skills/octocode-chrome-devtools/scripts/sourcemap-resolver.mjs +193 -0
  47. package/skills/octocode-chrome-devtools/scripts/undercover.mjs +226 -0
  48. package/skills/octocode-design/README.md +2 -2
  49. package/skills/octocode-documentation-writer/README.md +1 -1
  50. package/skills/octocode-engineer/README.md +1 -1
  51. package/skills/octocode-engineer/SKILL.md +137 -306
  52. package/skills/octocode-engineer/references/cli-reference.md +13 -0
  53. package/skills/octocode-engineer/references/output-files.md +3 -3
  54. package/skills/octocode-engineer/scripts/run.js +146 -146
  55. package/skills/octocode-engineer/src/pipeline/main.ts +1 -17
  56. package/skills/octocode-engineer/src/pipeline/progress.ts +4 -0
  57. package/skills/octocode-engineer/src/reporting/summary-md.test.ts +48 -0
  58. package/skills/octocode-engineer/src/reporting/summary-md.ts +43 -2
  59. package/skills/octocode-install/SKILL.md +1 -1
  60. package/skills/octocode-pull-request-reviewer/README.md +5 -5
  61. package/skills/octocode-pull-request-reviewer/SKILL.md +1 -1
  62. package/skills/octocode-research/AGENTS.md +1 -1
  63. package/skills/octocode-research/README.md +2 -2
  64. package/skills/octocode-research/docs/ARCHITECTURE.md +1 -1
  65. package/skills/octocode-research/scripts/server.js +184 -239
  66. package/skills/octocode-research/src/routes/github.ts +4 -21
  67. package/skills/octocode-research/src/routes/local.ts +4 -21
  68. package/skills/octocode-research/src/utils/fileContentTransform.ts +44 -0
  69. package/skills/octocode-search-skill/SKILL.md +337 -0
  70. package/skills/octocode-search-skill/references/agent-skills-guide.md +177 -0
  71. package/skills/octocode-search-skill/references/discovery-surfaces.md +162 -0
  72. package/skills/octocode-search-skill/references/fetch-and-create-locally.md +57 -0
  73. package/skills/octocode-search-skill/references/install-reference.md +130 -0
  74. package/skills/octocode-search-skill/references/references-template.md +27 -0
  75. package/skills/octocode-search-skill/references/references.md +62 -0
  76. package/skills/octocode-slides/README.md +307 -0
  77. package/skills/octocode-slides/SKILL.md +410 -0
  78. package/skills/octocode-slides/references/01-brief.md +156 -0
  79. package/skills/octocode-slides/references/02-research.md +149 -0
  80. package/skills/octocode-slides/references/03-outline.md +172 -0
  81. package/skills/octocode-slides/references/04-design.md +301 -0
  82. package/skills/octocode-slides/references/05-implementation.md +213 -0
  83. package/skills/octocode-slides/references/06-review.md +258 -0
  84. package/skills/octocode-slides/references/animation.md +281 -0
  85. package/skills/octocode-slides/references/design-system.md +316 -0
  86. package/skills/octocode-slides/references/html-templates.md +673 -0
  87. package/skills/octocode-slides/references/image-generation.md +448 -0
  88. package/skills/octocode-slides/references/resources.md +840 -0
  89. package/skills/octocode-slides/references/slide-rules.md +541 -0
  90. package/skills/octocode-slides/references/wireframes.md +727 -0
  91. package/skills/octocode-slides/scripts/animation.js +182 -0
  92. package/skills/octocode-slides/scripts/base.css +353 -0
  93. package/skills/octocode-slides/scripts/base.html +655 -0
  94. package/skills/octocode-slides/scripts/generate_image.py +221 -0
  95. package/skills/octocode-slides/scripts/navbridge.js +79 -0
  96. package/skills/octocode-slides/scripts/presenter.js +316 -0
  97. package/skills/octocode-slides/scripts/slide.html +248 -0
  98. package/skills/octocode-stats/SKILL.md +73 -0
  99. package/skills/octocode-stats/assets/template.html +1332 -0
  100. package/skills/octocode-stats/scripts/build_dashboard.mjs +407 -0
  101. package/out/chunks/chunk-LH4AZJPA.js +0 -389
  102. package/out/chunks/command-help-specs-CQ3RBLP6.js +0 -8
  103. package/out/chunks/commands-M3QTWKWE.js +0 -51
  104. package/out/chunks/help-XPXP46ZT.js +0 -10
  105. package/out/chunks/main-help-HXFAFHPG.js +0 -10
  106. package/out/chunks/tool-command-VHFLPIHY.js +0 -8
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __dirname_fn } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __dirname_fn(__filename);
8
+ import{a as ze,b as Ye,d as Je}from"./chunk-YBBF4DTY.js";var ot=Ye((Zr,st)=>{"use strict";st.exports=Vt;function Ht(e){let t={defaultWidth:0,output:process.stdout,tty:ze("tty")};return e?(Object.keys(t).forEach(function(r){e[r]||(e[r]=t[r])}),e):t}function Vt(e){let t=Ht(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let r=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(r)&&r!==0)return r}return t.defaultWidth}});var Lt=Ye((pn,Et)=>{var or=ze("stream"),Ie=class extends or{#r=null;constructor(t={}){super(t),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}#t(t,r){return this._dest?this._dest[t]:this._src?this._src[t]:r}#e(t,...r){typeof this._dest?.[t]=="function"&&this._dest[t](...r),typeof this._src?.[t]=="function"&&this._src[t](...r)}get isTTY(){return this.#r!==null?this.#r:this.#t("isTTY",!1)}set isTTY(t){this.#r=t}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(t){this._src=t}pipe(t,r){return this._dest=t,super.pipe(t,r)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.slice(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.slice(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)}end(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")}destroy(...t){return this.#e("destroy",...t)}destroySoon(...t){return this.#e("destroySoon",...t)}close(...t){return this.#e("close",...t)}};Et.exports=Ie});var k=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",K=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n",ye=e=>e.name==="space",ie=e=>e.name==="backspace",Y=e=>e.name==="tab",se=e=>"1234567890".includes(e.name),N=e=>e.name==="enter"||e.name==="return";var ue=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},de=class extends Error{name="CancelPromptError";message="Prompt was canceled"},oe=class extends Error{name="ExitPromptError"},fe=class extends Error{name="HookError"},z=class extends Error{name="ValidationError"};import{AsyncResource as Nt}from"node:async_hooks";import{AsyncLocalStorage as kt,AsyncResource as vt}from"node:async_hooks";var Qe=new kt;function At(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Xe(e,t){let r=At(e);return Qe.run(r,()=>{function n(i){r.handleChange=()=>{r.index=0,i()},r.handleChange()}return t(n)})}function J(){let e=Qe.getStore();if(!e)throw new fe("[Inquirer] Hook functions can only be called from within a prompt");return e}function Ee(){return J().rl}function Le(e){let t=(...r)=>{let n=J(),i=!1,l=n.handleChange;n.handleChange=()=>{i=!0};let o=e(...r);return i&&l(),n.handleChange=l,o};return vt.bind(t)}function re(e){let t=J(),{index:r}=t,n={get(){return t.hooks[r]},set(l){t.hooks[r]=l},initialized:r in t.hooks},i=e(n);return t.index++,i}function Ze(){J().handleChange()}var Q={queue(e){let t=J(),{index:r}=t;t.hooksEffect.push(()=>{t.hooksCleanup[r]?.();let n=e(Ee());if(n!=null&&typeof n!="function")throw new z("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[r]=n})},run(){let e=J();Le(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=J();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function L(e){return re(t=>{let r=Nt.bind(function(l){t.get()!==l&&(t.set(l),Ze())});if(t.initialized)return[t.get(),r];let n=typeof e=="function"?e():e;return t.set(n),[n,r]})}function $(e,t){re(r=>{let n=r.get();(!Array.isArray(n)||t.some((l,o)=>!Object.is(l,n[o])))&&Q.queue(e),r.set(t)})}import{styleText as O}from"node:util";import H from"node:process";function $t(){return H.platform!=="win32"?H.env.TERM!=="linux":!!H.env.WT_SESSION||!!H.env.TERMINUS_SUBLIME||H.env.ConEmuTask==="{cmd::Cmder}"||H.env.TERM_PROGRAM==="Terminus-Sublime"||H.env.TERM_PROGRAM==="vscode"||H.env.TERM==="xterm-256color"||H.env.TERM==="alacritty"||H.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var et={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},tt={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Ot={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Mt={...et,...tt},jt={...et,...Ot},Wt=$t(),Kt=Wt?Mt:jt,v=Kt,kr=Object.entries(tt);var rt={prefix:{idle:O("blue","?"),done:O("green",v.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>O("yellow",e))},style:{answer:e=>O("cyan",e),message:e=>O("bold",e),error:e=>O("red",`> ${e}`),defaultAnswer:e=>O("dim",`(${e})`),help:e=>O("dim",e),highlight:e=>O("cyan",e),key:e=>O("cyan",O("bold",`<${e}>`))}};function nt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function it(...e){let t={};for(let r of e)for(let[n,i]of Object.entries(r)){let l=t[n];t[n]=nt(l)&&nt(i)?it(l,i):i}return t}function A(...e){let t=[rt,...e.filter(r=>r!=null)];return it(...t)}function M({status:e="idle",theme:t}){let[r,n]=L(!1),[i,l]=L(0),{prefix:o,spinner:s}=A(t);return $(()=>{if(e==="loading"){let f,b=-1,a=setTimeout(()=>{n(!0),f=setInterval(()=>{b=b+1,l(b%s.frames.length)},s.interval)},300);return()=>{clearTimeout(a),clearInterval(f)}}else n(!1)},[e]),r?s.frames[i]:typeof o=="string"?o:o[e==="loading"?"idle":e]??o.idle}function V(e,t){return re(r=>{let n=r.get();if(!n||n.dependencies.length!==t.length||n.dependencies.some((i,l)=>i!==t[l])){let i=e();return r.set({value:i,dependencies:t}),i}return n.value})}function G(e){return L({current:e})[0]}function j(e){let t=G(e);t.current=e,$(r=>{let n=!1,i=Le((l,o)=>{n||t.current(o,r)});return r.input.on("keypress",i),()=>{n=!0,r.input.removeListener("keypress",i)}},[])}var yt=Je(ot(),1);var lt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let r=0;for(e.lastIndex=0;e.test(t);)r+=1;return t.length-r}})(),at=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ct=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141;var Gt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,qt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ut=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,zt=/\t{1,1000}/y,dt=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),Yt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Jt=new RegExp("\\p{M}+","gu"),Qt={limit:1/0,ellipsis:""},ft=(e,t={},r={})=>{let n=t.limit??1/0,i=t.ellipsis??"",l=t?.ellipsisWidth??(i?ft(i,Qt,r).width:0),o=0,s=r.controlWidth??0,m=r.tabWidth??8,f=r.emojiWidth??2,b=2,a=r.regularWidth??1,c=r.wideWidth??b,w=[[Yt,a],[Gt,o],[qt,s],[zt,m],[dt,f],[ut,c]],x=0,p=0,g=e.length,D=0,h=!1,E=g,T=Math.max(0,n-l),U=0,_=0,I=0,C=0;e:for(;;){if(_>U||p>=g&&p>x){let d=e.slice(U,_)||e.slice(x,p);D=0;for(let S of d.replaceAll(Jt,"")){let u=S.codePointAt(0)||0;if(at(u)?C=b:ct(u)?C=c:C=a,I+C>T&&(E=Math.min(E,Math.max(U,x)+D)),I+C>n){h=!0;break e}D+=S.length,I+=C}U=_=0}if(p>=g)break e;for(let d=0,S=w.length;d<S;d++){let[u,y]=w[d];if(u.lastIndex=p,u.test(e)){if(D=u===ut?lt(e.slice(p,u.lastIndex)):u===dt?1:u.lastIndex-p,C=D*y,I+C>T&&(E=Math.min(E,p+Math.floor((T-I)/y))),I+C>n){h=!0;break e}I+=C,U=x,_=p,p=x=u.lastIndex;continue e}}p+=1}return{width:h?T:I,index:h?E:g,truncated:h,ellipsed:h&&n>=l}},ht=ft;var Xt={limit:1/0,ellipsis:"",ellipsisWidth:0},Zt=(e,t={})=>ht(e,Xt,t).width,q=Zt;var he="\x1B",xt="\x9B",er=39,Re="\x07",wt="[",tr="]",St="m",Be=`${tr}8;;`,pt=new RegExp(`(?:\\${wt}(?<code>\\d+)m|\\${Be}(?<uri>.*)${Re})`,"y"),mt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},gt=e=>`${he}${wt}${e}${St}`,bt=e=>`${he}${Be}${e}${Re}`,Te=(e,t,r)=>{let n=t[Symbol.iterator](),i=!1,l=!1,o=e.at(-1),s=o===void 0?0:q(o),m=n.next(),f=n.next(),b=0;for(;!m.done;){let a=m.value,c=q(a);s+c<=r?e[e.length-1]+=a:(e.push(a),s=0),(a===he||a===xt)&&(i=!0,l=t.startsWith(Be,b+1)),i?l?a===Re&&(i=!1,l=!1):a===St&&(i=!1):(s+=c,s===r&&!f.done&&(e.push(""),s=0)),m=f,f=n.next(),b+=a.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},rr=e=>{let t=e.split(" "),r=t.length;for(;r&&!q(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},nr=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,l,o=e.split(" "),s=[""],m=0;for(let a=0;a<o.length;a++){let c=o[a];if(r.trim!==!1){let x=s.at(-1)??"",p=x.trimStart();x.length!==p.length&&(s[s.length-1]=p,m=q(p))}a!==0&&(m>=t&&(r.wordWrap===!1||r.trim===!1)&&(s.push(""),m=0),(m||r.trim===!1)&&(s[s.length-1]+=" ",m++));let w=q(c);if(r.hard&&w>t){let x=t-m,p=1+Math.floor((w-x-1)/t);Math.floor((w-1)/t)<p&&s.push(""),Te(s,c,t),m=q(s.at(-1)??"");continue}if(m+w>t&&m&&w){if(r.wordWrap===!1&&m<t){Te(s,c,t),m=q(s.at(-1)??"");continue}s.push(""),m=0}if(m+w>t&&r.wordWrap===!1){Te(s,c,t),m=q(s.at(-1)??"");continue}s[s.length-1]+=c,m+=w}r.trim!==!1&&(s=s.map(a=>rr(a)));let f=s.join(`
9
+ `),b=!1;for(let a=0;a<f.length;a++){let c=f[a];if(n+=c,b)b=!1;else if(b=c>="\uD800"&&c<="\uDBFF",b)continue;if(c===he||c===xt){pt.lastIndex=a+1;let x=pt.exec(f)?.groups;if(x?.code!==void 0){let p=Number.parseFloat(x.code);i=p===er?void 0:p}else x?.uri!==void 0&&(l=x.uri.length===0?void 0:x.uri)}if(f[a+1]===`
10
+ `){l&&(n+=bt(""));let w=i?mt(i):void 0;i&&w&&(n+=gt(w))}else c===`
11
+ `&&(i&&mt(i)&&(n+=gt(i)),l&&(n+=bt(l)))}return n},ir=/\r?\n/;function Dt(e,t,r){return String(e).normalize().split(ir).map(n=>nr(n,t,r)).join(`
12
+ `)}function le(e,t){return e.split(`
13
+ `).flatMap(r=>Dt(r,t,{trim:!1,hard:!0}).split(`
14
+ `).map(n=>n.trimEnd())).join(`
15
+ `)}function pe(){return(0,yt.default)({defaultWidth:80,output:Ee().output})}function sr({active:e,renderedItems:t,pageSize:r,loop:n}){let i=G({lastPointer:e,lastActive:void 0}),{lastPointer:l,lastActive:o}=i.current,s=Math.floor(r/2),m=t.reduce((a,c)=>a+c.length,0),f=t.slice(0,e).reduce((a,c)=>a+c.length,0),b=f;if(m>r)if(n)b=l,o!=null&&o<e&&e-o<r&&(b=Math.min(s,Math.abs(e-o)===1?Math.min(l+(t[o]?.length??0),Math.max(f,l)):l+e-o));else{let a=t.slice(e).reduce((c,w)=>c+w.length,0);b=a<r-s?r-a:Math.min(f,s)}return i.current.lastPointer=b,i.current.lastActive=e,b}function X({items:e,active:t,renderItem:r,pageSize:n,loop:i=!0}){let l=pe(),o=D=>(D%e.length+e.length)%e.length,s=e.map((D,h)=>D==null?[]:le(r({item:D,index:h,isActive:h===t}),l).split(`
16
+ `)),m=s.reduce((D,h)=>D+h.length,0),f=D=>s[D]??[],b=sr({active:t,renderedItems:s,pageSize:n,loop:i}),a=f(t).slice(0,n),c=b+a.length<=n?b:n-a.length,w=Array.from({length:n});w.splice(c,a.length,...a);let x=new Set([t]),p=c+a.length,g=o(t+1);for(;p<n&&!x.has(g)&&(i&&m>n?g!==t:g>t);){let h=f(g).slice(0,n-p);w.splice(p,h.length,...h),x.add(g),p+=h.length,g=o(g+1)}for(p=c-1,g=o(t-1);p>=0&&!x.has(g)&&(i&&m>n?g!==t:g<t);){let D=f(g),h=D.slice(Math.max(0,D.length-p-1));w.splice(p-h.length+1,h.length,...h),x.add(g),p-=h.length,g=o(g-1)}return w.filter(D=>typeof D=="string").join(`
17
+ `)}var Ft=Je(Lt(),1);import*as Ut from"node:readline";import{AsyncResource as dr}from"node:async_hooks";var Z=[];Z.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Z.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Z.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var me=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Ue=Symbol.for("signal-exit emitter"),Fe=globalThis,lr=Object.defineProperty.bind(Object),Pe=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Fe[Ue])return Fe[Ue];lr(Fe,Ue,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let i=!1;for(let l of this.listeners[t])i=l(r,n)===!0||i;return t==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},ge=class{},ar=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),_e=class extends ge{onExit(){return()=>{}}load(){}unload(){}},Ce=class extends ge{#r=ke.platform==="win32"?"SIGINT":"SIGHUP";#t=new Pe;#e;#s;#o;#i={};#n=!1;constructor(t){super(),this.#e=t,this.#i={};for(let r of Z)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#t,l=t;if(typeof l.__signal_exit_emitter__=="object"&&typeof l.__signal_exit_emitter__.count=="number"&&(i+=l.__signal_exit_emitter__.count),n.length===i){this.unload();let o=this.#t.emit("exit",null,r),s=r==="SIGHUP"?this.#r:r;o||t.kill(t.pid,s)}};this.#o=t.reallyExit,this.#s=t.emit}onExit(t,r){if(!me(this.#e))return()=>{};this.#n===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#t.on(n,t),()=>{this.#t.removeListener(n,t),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#n){this.#n=!0,this.#t.count+=1;for(let t of Z)try{let r=this.#i[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#a(t,...r),this.#e.reallyExit=t=>this.#l(t)}}unload(){this.#n&&(this.#n=!1,Z.forEach(t=>{let r=this.#i[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#s,this.#e.reallyExit=this.#o,this.#t.count-=1)}#l(t){return me(this.#e)?(this.#e.exitCode=t||0,this.#t.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#a(t,...r){let n=this.#s;if(t==="exit"&&me(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,t,...r);return this.#t.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,t,...r)}},ke=globalThis.process,{onExit:Tt,load:bn,unload:xn}=ar(me(ke)?new Ce(ke):new _e);import{stripVTControlCharacters as cr}from"node:util";var be="\x1B[?25l",Bt="\x1B[?25h",ve=(e=1)=>e>0?`\x1B[${e}A`:"",Ae=(e=1)=>e>0?`\x1B[${e}B`:"",Ne=(e,t)=>typeof t=="number"&&!Number.isNaN(t)?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`,Rt="\x1B[2K",$e=e=>e>0?(Rt+ve(1)).repeat(e-1)+Rt+"\x1B[G":"";var It=e=>e.split(`
18
+ `).length,ur=e=>e.split(`
19
+ `).pop()??"",ae=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(t){this.rl=t,this.cursorPos=t.getCursorPos()}write(t){this.rl.output.unmute(),this.rl.output.write(t),this.rl.output.mute()}render(t,r=""){let n=ur(t),i=cr(n),l=i;this.rl.line.length>0&&(l=l.slice(0,-this.rl.line.length)),this.rl.setPrompt(l),this.cursorPos=this.rl.getCursorPos();let o=pe();t=le(t,o),r=le(r,o),i.length%o===0&&(t+=`
20
+ `);let s=t+(r?`
21
+ `+r:""),f=Math.floor(i.length/o)-this.cursorPos.rows+(r?It(r):0);f>0&&(s+=ve(f)),s+=Ne(this.cursorPos.cols),this.write(Ae(this.extraLinesUnderPrompt)+$e(this.height)+s),this.extraLinesUnderPrompt=f,this.height=It(s)}checkCursorPos(){let t=this.rl.getCursorPos();t.cols!==this.cursorPos.cols&&(this.write(Ne(t.cols)),this.cursorPos=t)}done({clearContent:t}){this.rl.setPrompt("");let r=Ae(this.extraLinesUnderPrompt);r+=t?$e(this.height):`
22
+ `,r+=Bt,this.write(r),this.rl.close()}};var xe=class extends Promise{static withResolver(){let t,r;return{promise:new Promise((i,l)=>{t=i,r=l}),resolve:t,reject:r}}};var fr=globalThis.setImmediate;function hr(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(r,n)=>{let i=n.slice(1);return t=i,i},new Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function W(e){let t=hr();return(n,i={})=>{let{input:l=process.stdin,signal:o}=i,s=new Set,m=new Ft.default;m.pipe(i.output??process.stdout),m.mute();let f=Ut.createInterface({terminal:!0,input:l,output:m}),b=new ae(f),{promise:a,resolve:c,reject:w}=xe.withResolver(),x=()=>w(new de);if(o){let g=()=>w(new ue({cause:o.reason}));if(o.aborted)return g(),Object.assign(a,{cancel:x});o.addEventListener("abort",g),s.add(()=>o.removeEventListener("abort",g))}s.add(Tt((g,D)=>{w(new oe(`User force closed the prompt with ${g} ${D}`))}));let p=()=>w(new oe("User force closed the prompt with SIGINT"));return f.on("SIGINT",p),s.add(()=>f.removeListener("SIGINT",p)),Xe(f,g=>{let D=dr.bind(()=>Q.clearAll());f.on("close",D),s.add(()=>f.removeListener("close",D));let h=()=>{let E=()=>b.checkCursorPos();f.input.on("keypress",E),s.add(()=>f.input.removeListener("keypress",E)),g(()=>{try{let T=e(n,I=>{setImmediate(()=>c(I))});if(T===void 0){let I=t[1]?.getFileName();throw new Error(`Prompt functions must return a string.
23
+ at ${I}`)}let[U,_]=typeof T=="string"?[T]:T;b.render(U,_),Q.run()}catch(T){w(T)}})};return"readableFlowing"in l?fr(h):h(),Object.assign(a.then(E=>(Q.clearAll(),E),E=>{throw Q.clearAll(),E}).finally(()=>{s.forEach(E=>E()),b.done({clearContent:!!i.clearPromptOnDone}),m.end()}).then(()=>a),{cancel:x})})}}import{styleText as pr}from"node:util";var B=class{separator=pr("dim",Array.from({length:15}).join(v.line));type="separator";constructor(t){t&&(this.separator=t)}static isSeparator(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="separator")}};import{styleText as ee}from"node:util";var mr={icon:{checked:ee("green",v.circleFilled),unchecked:v.circle,cursor:v.pointer,disabledChecked:ee("green",v.circleDouble),disabledUnchecked:"-"},style:{disabled:e=>ee("dim",e),renderSelectedChoices:e=>e.map(t=>t.short).join(", "),description:e=>ee("cyan",e),keysHelpTip:e=>e.map(([t,r])=>`${ee("bold",t)} ${ee("dim",r)}`).join(ee("dim"," \u2022 "))},i18n:{disabledError:"This option is disabled and cannot be toggled."},keybindings:[]};function we(e){return!B.isSeparator(e)&&!e.disabled}function Oe(e){return!B.isSeparator(e)}function Pt(e){return!B.isSeparator(e)&&e.checked}function Me(e){return we(e)?{...e,checked:!e.checked}:e}function gr(e){return function(t){return we(t)?{...t,checked:e}:t}}function br(e){return e.map(t=>{if(B.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,checkedName:t,disabled:!1,checked:!1};let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,checkedName:t.checkedName??r,disabled:t.disabled??!1,checked:t.checked??!1};return t.description&&(n.description=t.description),n})}var je=W((e,t)=>{let{pageSize:r=7,loop:n=!0,required:i,validate:l=()=>!0}=e,o={all:"a",invert:"i",...e.shortcuts},s=A(mr,e.theme),{keybindings:m}=s,[f,b]=L("idle"),a=M({status:f,theme:s}),[c,w]=L(br(e.choices)),x=V(()=>{let d=c.findIndex(Oe),S=c.findLastIndex(Oe);if(d===-1)throw new z("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:d,last:S}},[c]),[p,g]=L(x.first),[D,h]=L();j(async d=>{if(N(d)){let S=c.filter(Pt),u=await l([...S]);i&&!S.length?h("At least one choice must be selected"):u===!0?(b("done"),t(S.map(y=>y.value))):h(u||"You must select a valid value")}else if(k(d,m)||K(d,m)){if(D&&h(void 0),n||k(d,m)&&p!==x.first||K(d,m)&&p!==x.last){let S=k(d,m)?-1:1,u=p;do u=(u+S+c.length)%c.length;while(!Oe(c[u]));g(u)}}else if(ye(d)){let S=c[p];S&&!B.isSeparator(S)&&(S.disabled?h(s.i18n.disabledError):(h(void 0),w(c.map((u,y)=>y===p?Me(u):u))))}else if(d.name===o.all){let S=c.some(u=>we(u)&&!u.checked);w(c.map(gr(S)))}else if(d.name===o.invert)w(c.map(Me));else if(se(d)){let S=Number(d.name)-1,u=-1,y=c.findIndex(F=>B.isSeparator(F)?!1:(u++,u===S)),R=c[y];R&&we(R)&&(g(y),w(c.map((F,P)=>P===y?Me(F):F)))}});let E=s.style.message(e.message,f),T,U=X({items:c,active:p,renderItem({item:d,isActive:S}){if(B.isSeparator(d))return` ${d.separator}`;let u=S?s.icon.cursor:" ";if(d.disabled){let P=typeof d.disabled=="string"?d.disabled:"(disabled)",te=d.checked?s.icon.disabledChecked:s.icon.disabledUnchecked;return s.style.disabled(`${u}${te} ${d.name} ${P}`)}S&&(T=d.description);let y=d.checked?s.icon.checked:s.icon.unchecked,R=d.checked?d.checkedName:d.name;return(S?s.style.highlight:P=>P)(`${u}${y} ${R}`)},pageSize:r,loop:n});if(f==="done"){let d=c.filter(Pt),S=s.style.answer(s.style.renderSelectedChoices(d,c));return[a,E,S].filter(Boolean).join(" ")}let _=[["\u2191\u2193","navigate"],["space","select"]];o.all&&_.push([o.all,"all"]),o.invert&&_.push([o.invert,"invert"]),_.push(["\u23CE","submit"]);let I=s.style.keysHelpTip(_);return`${[[a,E].filter(Boolean).join(" "),U," ",T?s.style.description(T):"",D?s.style.error(D):"",I].filter(Boolean).join(`
24
+ `).trimEnd()}${be}`});function _t(e,t){let r=t!==!1;return/^(y|yes)/i.test(e)?r=!0:/^(n|no)/i.test(e)&&(r=!1),r}function Ct(e){return e?"Yes":"No"}var We=W((e,t)=>{let{transformer:r=Ct}=e,[n,i]=L("idle"),[l,o]=L(""),s=A(e.theme),m=M({status:n,theme:s});j((c,w)=>{if(n==="idle")if(N(c)){let x=_t(l,e.default);o(r(x)),i("done"),t(x)}else if(Y(c)){let x=Ct(!_t(l,e.default));w.clearLine(0),w.write(x),o(x)}else o(w.line)});let f=l,b="";n==="done"?f=s.style.answer(l):b=` ${s.style.defaultAnswer(e.default===!1?"y/N":"Y/n")}`;let a=s.style.message(e.message,n);return`${m} ${a}${b} ${f}`});var xr={validationFailureMode:"keep"},Ke=W((e,t)=>{let{prefill:r="tab"}=e,n=A(xr,e.theme),[i,l]=L("idle"),[o,s]=L(String(e.default??"")),[m,f]=L(),[b,a]=L(""),c=M({status:i,theme:n});async function w(h){let{required:E,pattern:T,patternError:U="Invalid input"}=e;return E&&!h?"You must provide a value":T&&!T.test(h)?U:typeof e.validate=="function"?await e.validate(h)||"You must provide a valid value":!0}j(async(h,E)=>{if(i==="idle")if(N(h)){let T=b||o;l("loading");let U=await w(T);U===!0?(a(T),l("done"),t(T)):(n.validationFailureMode==="clear"?a(""):E.write(b),f(U),l("idle"))}else ie(h)&&!b?s(""):Y(h)&&!b?(s(""),E.clearLine(0),E.write(o),a(o)):(a(E.line),f(void 0))}),$(h=>{r==="editable"&&o&&(h.write(o),a(o))},[]);let x=n.style.message(e.message,i),p=b;typeof e.transformer=="function"?p=e.transformer(b,{isFinal:i==="done"}):i==="done"&&(p=n.style.answer(b));let g;o&&i!=="done"&&!b&&(g=n.style.defaultAnswer(o));let D="";return m&&(D=n.style.error(m)),[[c,x,g,p].filter(h=>h!==void 0).join(" "),D]});import{styleText as ne}from"node:util";var wr={icon:{cursor:v.pointer},style:{disabled:e=>ne("dim",`- ${e}`),searchTerm:e=>ne("cyan",e),description:e=>ne("cyan",e),keysHelpTip:e=>e.map(([t,r])=>`${ne("bold",t)} ${ne("dim",r)}`).join(ne("dim"," \u2022 "))}};function Se(e){return!B.isSeparator(e)&&!e.disabled}function Sr(e){return e.map(t=>{if(B.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,disabled:!1};let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};return t.description&&(n.description=t.description),n})}var He=W((e,t)=>{let{pageSize:r=7,validate:n=()=>!0}=e,i=A(wr,e.theme),[l,o]=L("loading"),[s,m]=L(""),[f,b]=L([]),[a,c]=L(),w=G(!1),x=M({status:l,theme:i}),p=V(()=>{let u=f.findIndex(Se),y=f.findLastIndex(Se);return{first:u,last:y}},[f]),[g=p.first,D]=L();$(()=>{let u=new AbortController;return o("loading"),c(void 0),(async()=>{try{let R=await e.source(s||void 0,{signal:u.signal});if(!u.signal.aborted){let F=Sr(R),P;if(!w.current&&"default"in e){let te=F.findIndex(qe=>Se(qe)&&qe.value===e.default);P=te===-1?void 0:te,w.current=!0}D(P),c(void 0),b(F),o("idle")}}catch(R){!u.signal.aborted&&R instanceof Error&&c(R.message)}})(),()=>{u.abort()}},[s]);let h=f[g];j(async(u,y)=>{if(N(u))if(h){o("loading");let R=await n(h.value);o("idle"),R===!0?(o("done"),t(h.value)):h.name===s?c(R||"You must provide a valid value"):(y.write(h.name),m(h.name))}else y.write(s);else if(Y(u)&&h)y.clearLine(0),y.write(h.name),m(h.name);else if(l!=="loading"&&(k(u)||K(u))){if(y.clearLine(0),k(u)&&g!==p.first||K(u)&&g!==p.last){let R=k(u)?-1:1,F=g;do F=(F+R+f.length)%f.length;while(!Se(f[F]));D(F)}}else m(y.line)});let E=i.style.message(e.message,l),T=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]),U=X({items:f,active:g,renderItem({item:u,isActive:y}){if(B.isSeparator(u))return` ${u.separator}`;if(u.disabled){let P=typeof u.disabled=="string"?u.disabled:"(disabled)";return i.style.disabled(`${u.name} ${P}`)}let R=y?i.style.highlight:P=>P,F=y?i.icon.cursor:" ";return R(`${F} ${u.name}`)},pageSize:r,loop:!1}),_;a?_=i.style.error(a):f.length===0&&s!==""&&l==="idle"&&(_=i.style.error("No results found"));let I;if(l==="done"&&h)return[x,E,i.style.answer(h.short)].filter(Boolean).join(" ").trimEnd();I=i.style.searchTerm(s);let C=h?.description,d=[x,E,I].filter(Boolean).join(" ").trimEnd(),S=[_??U," ",C?i.style.description(C):"",T].filter(Boolean).join(`
25
+ `).trimEnd();return[d,S]});import{styleText as ce}from"node:util";var Dr={icon:{cursor:v.pointer},style:{disabled:e=>ce("dim",e),description:e=>ce("cyan",e),keysHelpTip:e=>e.map(([t,r])=>`${ce("bold",t)} ${ce("dim",r)}`).join(ce("dim"," \u2022 "))},i18n:{disabledError:"This option is disabled and cannot be selected."},indexMode:"hidden",keybindings:[]};function Ve(e){return!B.isSeparator(e)&&!e.disabled}function Ge(e){return!B.isSeparator(e)}function yr(e){return e.map(t=>{if(B.isSeparator(t))return t;if(typeof t!="object"||t===null||!("value"in t)){let i=String(t);return{value:t,name:i,short:i,disabled:!1}}let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};return t.description&&(n.description=t.description),n})}var De=W((e,t)=>{let{loop:r=!0,pageSize:n=7}=e,i=A(Dr,e.theme),{keybindings:l}=i,[o,s]=L("idle"),m=M({status:o,theme:i}),f=G(),b=!l.includes("vim"),a=V(()=>yr(e.choices),[e.choices]),c=V(()=>{let d=a.findIndex(Ge),S=a.findLastIndex(Ge);if(d===-1)throw new z("[select prompt] No selectable choices. All choices are disabled.");return{first:d,last:S}},[a]),w=V(()=>"default"in e?a.findIndex(d=>Ve(d)&&d.value===e.default):-1,[e.default,a]),[x,p]=L(w===-1?c.first:w),g=a[x],[D,h]=L();j((d,S)=>{if(clearTimeout(f.current),D&&h(void 0),N(d))g.disabled?h(i.i18n.disabledError):(s("done"),t(g.value));else if(k(d,l)||K(d,l)){if(S.clearLine(0),r||k(d,l)&&x!==c.first||K(d,l)&&x!==c.last){let u=k(d,l)?-1:1,y=x;do y=(y+u+a.length)%a.length;while(!Ge(a[y]));p(y)}}else if(se(d)&&!Number.isNaN(Number(S.line))){let u=Number(S.line)-1,y=-1,R=a.findIndex(P=>B.isSeparator(P)?!1:(y++,y===u)),F=a[R];F!=null&&Ve(F)&&p(R),f.current=setTimeout(()=>{S.clearLine(0)},700)}else if(ie(d))S.clearLine(0);else if(b){let u=S.line.toLowerCase(),y=a.findIndex(R=>B.isSeparator(R)||!Ve(R)?!1:R.name.toLowerCase().startsWith(u));y!==-1&&p(y),f.current=setTimeout(()=>{S.clearLine(0)},700)}}),$(()=>()=>{clearTimeout(f.current)},[]);let E=i.style.message(e.message,o),T=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]),U=0,_=X({items:a,active:x,renderItem({item:d,isActive:S,index:u}){if(B.isSeparator(d))return U++,` ${d.separator}`;let y=S?i.icon.cursor:" ",R=i.indexMode==="number"?`${u+1-U}. `:"";if(d.disabled){let P=typeof d.disabled=="string"?d.disabled:"(disabled)",te=S?i.icon.cursor:"-";return i.style.disabled(`${te} ${R}${d.name} ${P}`)}return(S?i.style.highlight:P=>P)(`${y} ${R}${d.name}`)},pageSize:n,loop:r});if(o==="done")return[m,E,i.style.answer(g.short)].filter(Boolean).join(" ");let{description:I}=g;return`${[[m,E].filter(Boolean).join(" "),_," ",I?i.style.description(I):"",D?i.style.error(D):"",T].filter(Boolean).join(`
26
+ `).trimEnd()}${be}`});var yi=De,Ei=We,Li=Ke,Ti=je,Ri=He,Bi=B;async function Ii(){}function Ui(){return!0}async function Fi(e){return(await De)(e)}export{yi as a,Ei as b,Li as c,Ti as d,Ri as e,Bi as f,Ii as g,Ui as h,Fi as i};