@automagik/genie 0.260203.401 → 0.260203.443
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.
- package/dist/claudio.js +1 -1
- package/dist/genie.js +1 -1
- package/dist/term.js +1 -1
- package/install.sh +35 -22
- package/package.json +1 -1
- package/plugins/automagik-genie/agents/fix.md +70 -0
- package/plugins/automagik-genie/agents/git.md +157 -0
- package/plugins/automagik-genie/agents/refactor.md +140 -0
- package/plugins/automagik-genie/agents/tests.md +192 -0
- package/src/lib/version.ts +1 -1
package/dist/claudio.js
CHANGED
|
@@ -27,7 +27,7 @@ Expecting one of '${E.join("', '")}'`);let B=`${D}Help`;return this.on(B,($)=>{l
|
|
|
27
27
|
`)$+=S3(q)}}return $};w3.exports=(D,F,E)=>{return String(D).normalize().replace(/\r\n/g,`
|
|
28
28
|
`).split(`
|
|
29
29
|
`).map((B)=>oF(B,F,E)).join(`
|
|
30
|
-
`)}});var f3=Z((c5,T3)=>{var tF=GD("stream");class P3 extends tF{#E=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#F(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#E!==null)return this.#E;return this.#F("isTTY",!1)}set isTTY(D){this.#E=D}get rows(){return this.#F("rows")}get columns(){return this.#F("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}T3.exports=P3});var c0=zD(p0(),1),{program:h1,createCommand:g1,createArgument:m1,createOption:l1,CommanderError:p1,InvalidArgumentError:c1,InvalidOptionArgumentError:d1,Command:d0,Argument:n1,Option:i1,Help:r1}=c0.default;var n0="0.260203.0401";var D2=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",H2=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var p2=(D)=>D.name==="backspace",jD=(D)=>D.name==="tab";var qD=(D)=>D.name==="enter"||D.name==="return";class c2 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class d2 extends Error{name="CancelPromptError";message="Prompt was canceled"}class u2 extends Error{name="ExitPromptError"}class n2 extends Error{name="HookError"}class i2 extends Error{name="ValidationError"}import{AsyncResource as UF}from"async_hooks";import{AsyncLocalStorage as RF,AsyncResource as zF}from"async_hooks";var i0=new RF;function jF(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function r0(D,F){let E=jF(D);return i0.run(E,()=>{function B($){E.handleChange=()=>{E.index=0,$()},E.handleChange()}return F(B)})}function UD(){let D=i0.getStore();if(!D)throw new n2("[Inquirer] Hook functions can only be called from within a prompt");return D}function r2(){return UD().rl}function a2(D){let F=(...E)=>{let B=UD(),$=!1,q=B.handleChange;B.handleChange=()=>{$=!0};let C=D(...E);if($)q();return B.handleChange=q,C};return zF.bind(F)}function PD(D){let F=UD(),{index:E}=F,B={get(){return F.hooks[E]},set(q){F.hooks[E]=q},initialized:E in F.hooks},$=D(B);return F.index++,$}function a0(){UD().handleChange()}var LD={queue(D){let F=UD(),{index:E}=F;F.hooksEffect.push(()=>{F.hooksCleanup[E]?.();let B=D(r2());if(B!=null&&typeof B!=="function")throw new i2("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[E]=B})},run(){let D=UD();a2(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=UD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function P(D){return PD((F)=>{let E=UF.bind(function(q){if(F.get()!==q)F.set(q),a0()});if(F.initialized)return[F.get(),E];let B=typeof D==="function"?D():D;return F.set(B),[B,E]})}function CD(D,F){PD((E)=>{let B=E.get();if(!Array.isArray(B)||F.some((q,C)=>!Object.is(q,B[C])))LD.queue(D);E.set(F)})}var m=zD(A2(),1);import DD from"process";function NF(){if(DD.platform!=="win32")return DD.env.TERM!=="linux";return Boolean(DD.env.WT_SESSION)||Boolean(DD.env.TERMINUS_SUBLIME)||DD.env.ConEmuTask==="{cmd::Cmder}"||DD.env.TERM_PROGRAM==="Terminus-Sublime"||DD.env.TERM_PROGRAM==="vscode"||DD.env.TERM==="xterm-256color"||DD.env.TERM==="alacritty"||DD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var s0={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"},t0={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"},KF={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"},OF={...s0,...t0},SF={...s0,...KF},wF=NF(),IF=wF?OF:SF,TD=IF,J5=Object.entries(t0);var e0={prefix:{idle:m.default.blue("?"),done:m.default.green(TD.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>m.default.yellow(D))},style:{answer:m.default.cyan,message:m.default.bold,error:(D)=>m.default.red(`> ${D}`),defaultAnswer:(D)=>m.default.dim(`(${D})`),help:m.default.dim,highlight:m.default.cyan,key:(D)=>m.default.cyan(m.default.bold(`<${D}>`))}};function D3(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function F3(...D){let F={};for(let E of D)for(let[B,$]of Object.entries(E)){let q=F[B];F[B]=D3(q)&&D3($)?F3(q,$):$}return F}function n(...D){let F=[e0,...D.filter((E)=>E!=null)];return F3(...F)}function XD({status:D="idle",theme:F}){let[E,B]=P(!1),[$,q]=P(0),{prefix:C,spinner:X}=n(F);if(CD(()=>{if(D==="loading"){let J,_=-1,H=setTimeout(()=>{B(!0),J=setInterval(()=>{_=_+1,q(_%X.frames.length)},X.interval)},300);return()=>{clearTimeout(H),clearInterval(J)}}else B(!1)},[D]),E)return X.frames[$];return typeof C==="string"?C:C[D==="loading"?"idle":D]??C.idle}function o2(D,F){return PD((E)=>{let B=E.get();if(!B||B.dependencies.length!==F.length||B.dependencies.some(($,q)=>$!==F[q])){let $=D();return E.set({value:$,dependencies:F}),$}return B.value})}function M2(D){return P({current:D})[0]}function QD(D){let F=M2(D);F.current=D,CD((E)=>{let B=!1,$=a2((q,C)=>{if(B)return;F.current(C,E)});return E.input.on("keypress",$),()=>{B=!0,E.input.removeListener("keypress",$)}},[])}var b3=zD(B3(),1),k3=zD(I3(),1);function B2(D,F){return D.split(`
|
|
30
|
+
`)}});var f3=Z((c5,T3)=>{var tF=GD("stream");class P3 extends tF{#E=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#F(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#E!==null)return this.#E;return this.#F("isTTY",!1)}set isTTY(D){this.#E=D}get rows(){return this.#F("rows")}get columns(){return this.#F("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}T3.exports=P3});var c0=zD(p0(),1),{program:h1,createCommand:g1,createArgument:m1,createOption:l1,CommanderError:p1,InvalidArgumentError:c1,InvalidOptionArgumentError:d1,Command:d0,Argument:n1,Option:i1,Help:r1}=c0.default;var n0="0.260203.0443";var D2=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",H2=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var p2=(D)=>D.name==="backspace",jD=(D)=>D.name==="tab";var qD=(D)=>D.name==="enter"||D.name==="return";class c2 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class d2 extends Error{name="CancelPromptError";message="Prompt was canceled"}class u2 extends Error{name="ExitPromptError"}class n2 extends Error{name="HookError"}class i2 extends Error{name="ValidationError"}import{AsyncResource as UF}from"async_hooks";import{AsyncLocalStorage as RF,AsyncResource as zF}from"async_hooks";var i0=new RF;function jF(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function r0(D,F){let E=jF(D);return i0.run(E,()=>{function B($){E.handleChange=()=>{E.index=0,$()},E.handleChange()}return F(B)})}function UD(){let D=i0.getStore();if(!D)throw new n2("[Inquirer] Hook functions can only be called from within a prompt");return D}function r2(){return UD().rl}function a2(D){let F=(...E)=>{let B=UD(),$=!1,q=B.handleChange;B.handleChange=()=>{$=!0};let C=D(...E);if($)q();return B.handleChange=q,C};return zF.bind(F)}function PD(D){let F=UD(),{index:E}=F,B={get(){return F.hooks[E]},set(q){F.hooks[E]=q},initialized:E in F.hooks},$=D(B);return F.index++,$}function a0(){UD().handleChange()}var LD={queue(D){let F=UD(),{index:E}=F;F.hooksEffect.push(()=>{F.hooksCleanup[E]?.();let B=D(r2());if(B!=null&&typeof B!=="function")throw new i2("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[E]=B})},run(){let D=UD();a2(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=UD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function P(D){return PD((F)=>{let E=UF.bind(function(q){if(F.get()!==q)F.set(q),a0()});if(F.initialized)return[F.get(),E];let B=typeof D==="function"?D():D;return F.set(B),[B,E]})}function CD(D,F){PD((E)=>{let B=E.get();if(!Array.isArray(B)||F.some((q,C)=>!Object.is(q,B[C])))LD.queue(D);E.set(F)})}var m=zD(A2(),1);import DD from"process";function NF(){if(DD.platform!=="win32")return DD.env.TERM!=="linux";return Boolean(DD.env.WT_SESSION)||Boolean(DD.env.TERMINUS_SUBLIME)||DD.env.ConEmuTask==="{cmd::Cmder}"||DD.env.TERM_PROGRAM==="Terminus-Sublime"||DD.env.TERM_PROGRAM==="vscode"||DD.env.TERM==="xterm-256color"||DD.env.TERM==="alacritty"||DD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var s0={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"},t0={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"},KF={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"},OF={...s0,...t0},SF={...s0,...KF},wF=NF(),IF=wF?OF:SF,TD=IF,J5=Object.entries(t0);var e0={prefix:{idle:m.default.blue("?"),done:m.default.green(TD.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>m.default.yellow(D))},style:{answer:m.default.cyan,message:m.default.bold,error:(D)=>m.default.red(`> ${D}`),defaultAnswer:(D)=>m.default.dim(`(${D})`),help:m.default.dim,highlight:m.default.cyan,key:(D)=>m.default.cyan(m.default.bold(`<${D}>`))}};function D3(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function F3(...D){let F={};for(let E of D)for(let[B,$]of Object.entries(E)){let q=F[B];F[B]=D3(q)&&D3($)?F3(q,$):$}return F}function n(...D){let F=[e0,...D.filter((E)=>E!=null)];return F3(...F)}function XD({status:D="idle",theme:F}){let[E,B]=P(!1),[$,q]=P(0),{prefix:C,spinner:X}=n(F);if(CD(()=>{if(D==="loading"){let J,_=-1,H=setTimeout(()=>{B(!0),J=setInterval(()=>{_=_+1,q(_%X.frames.length)},X.interval)},300);return()=>{clearTimeout(H),clearInterval(J)}}else B(!1)},[D]),E)return X.frames[$];return typeof C==="string"?C:C[D==="loading"?"idle":D]??C.idle}function o2(D,F){return PD((E)=>{let B=E.get();if(!B||B.dependencies.length!==F.length||B.dependencies.some(($,q)=>$!==F[q])){let $=D();return E.set({value:$,dependencies:F}),$}return B.value})}function M2(D){return P({current:D})[0]}function QD(D){let F=M2(D);F.current=D,CD((E)=>{let B=!1,$=a2((q,C)=>{if(B)return;F.current(C,E)});return E.input.on("keypress",$),()=>{B=!0,E.input.removeListener("keypress",$)}},[])}var b3=zD(B3(),1),k3=zD(I3(),1);function B2(D,F){return D.split(`
|
|
31
31
|
`).flatMap((E)=>k3.default(E,F,{trim:!1,hard:!0}).split(`
|
|
32
32
|
`).map((B)=>B.trimEnd())).join(`
|
|
33
33
|
`)}function j2(){return b3.default({defaultWidth:80,output:r2().output})}function sF({active:D,renderedItems:F,pageSize:E,loop:B}){let $=M2({lastPointer:D,lastActive:void 0}),{lastPointer:q,lastActive:C}=$.current,X=Math.floor(E/2),Q=F.reduce((H,j)=>H+j.length,0),J=F.slice(0,D).reduce((H,j)=>H+j.length,0),_=J;if(Q>E)if(B){if(_=q,C!=null&&C<D&&D-C<E)_=Math.min(X,Math.abs(D-C)===1?Math.min(q+(F[C]?.length??0),Math.max(J,q)):q+D-C)}else{let H=F.slice(D).reduce((j,z)=>j+z.length,0);_=H<E-X?E-H:Math.min(J,X)}return $.current.lastPointer=_,$.current.lastActive=D,_}function q0({items:D,active:F,renderItem:E,pageSize:B,loop:$=!0}){let q=j2(),C=(U)=>(U%D.length+D.length)%D.length,X=D.map((U,S)=>{if(U==null)return[];return B2(E({item:U,index:S,isActive:S===F}),q).split(`
|
package/dist/genie.js
CHANGED
|
@@ -27,7 +27,7 @@ Expecting one of '${B.join("', '")}'`);let E=`${D}Help`;return this.on(E,($)=>{l
|
|
|
27
27
|
`)$+=X8(X)}}return $};J8.exports=(D,F,B)=>{return String(D).normalize().replace(/\r\n/g,`
|
|
28
28
|
`).split(`
|
|
29
29
|
`).map((E)=>H1(E,F,B)).join(`
|
|
30
|
-
`)}});var _8=x((F4,q8)=>{var _1=JD("stream");class H8 extends _1{#B=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#F(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#B!==null)return this.#B;return this.#F("isTTY",!1)}set isTTY(D){this.#B=D}get rows(){return this.#F("rows")}get columns(){return this.#F("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}q8.exports=H8});var K3=SD(V3(),1),{program:o7,createCommand:s7,createArgument:t7,createOption:e7,CommanderError:D9,InvalidArgumentError:F9,InvalidOptionArgumentError:B9,Command:L3,Argument:E9,Option:$9,Help:X9}=K3.default;var N3="0.260203.0401";var z2=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",x2=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var z0=(D)=>D.name==="backspace",ID=(D)=>D.name==="tab";var YD=(D)=>D.name==="enter"||D.name==="return";class j0 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class C0 extends Error{name="CancelPromptError";message="Prompt was canceled"}class y2 extends Error{name="ExitPromptError"}class R0 extends Error{name="HookError"}class V0 extends Error{name="ValidationError"}import{AsyncResource as Z6}from"async_hooks";import{AsyncLocalStorage as P6,AsyncResource as k6}from"async_hooks";var O3=new P6;function v6(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function w3(D,F){let B=v6(D);return O3.run(B,()=>{function E($){B.handleChange=()=>{B.index=0,$()},B.handleChange()}return F(E)})}function bD(){let D=O3.getStore();if(!D)throw new R0("[Inquirer] Hook functions can only be called from within a prompt");return D}function K0(){return bD().rl}function L0(D){let F=(...B)=>{let E=bD(),$=!1,X=E.handleChange;E.handleChange=()=>{$=!0};let J=D(...B);if($)X();return E.handleChange=X,J};return k6.bind(F)}function iD(D){let F=bD(),{index:B}=F,E={get(){return F.hooks[B]},set(X){F.hooks[B]=X},initialized:B in F.hooks},$=D(E);return F.index++,$}function u3(){bD().handleChange()}var TD={queue(D){let F=bD(),{index:B}=F;F.hooksEffect.push(()=>{F.hooksCleanup[B]?.();let E=D(K0());if(E!=null&&typeof E!=="function")throw new V0("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[B]=E})},run(){let D=bD();L0(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=bD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function k(D){return iD((F)=>{let B=Z6.bind(function(X){if(F.get()!==X)F.set(X),u3()});if(F.initialized)return[F.get(),B];let E=typeof D==="function"?D():D;return F.set(E),[E,B]})}function WD(D,F){iD((B)=>{let E=B.get();if(!Array.isArray(E)||F.some((X,J)=>!Object.is(X,E[J])))TD.queue(D);B.set(F)})}var l=SD(h2(),1);import BD from"process";function y6(){if(BD.platform!=="win32")return BD.env.TERM!=="linux";return Boolean(BD.env.WT_SESSION)||Boolean(BD.env.TERMINUS_SUBLIME)||BD.env.ConEmuTask==="{cmd::Cmder}"||BD.env.TERM_PROGRAM==="Terminus-Sublime"||BD.env.TERM_PROGRAM==="vscode"||BD.env.TERM==="xterm-256color"||BD.env.TERM==="alacritty"||BD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var I3={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"},b3={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"},h6={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"},g6={...I3,...b3},m6={...I3,...h6},l6=y6(),p6=l6?g6:m6,aD=p6,R9=Object.entries(b3);var T3={prefix:{idle:l.default.blue("?"),done:l.default.green(aD.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>l.default.yellow(D))},style:{answer:l.default.cyan,message:l.default.bold,error:(D)=>l.default.red(`> ${D}`),defaultAnswer:(D)=>l.default.dim(`(${D})`),help:l.default.dim,highlight:l.default.cyan,key:(D)=>l.default.cyan(l.default.bold(`<${D}>`))}};function P3(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function k3(...D){let F={};for(let B of D)for(let[E,$]of Object.entries(B)){let X=F[E];F[E]=P3(X)&&P3($)?k3(X,$):$}return F}function n(...D){let F=[T3,...D.filter((B)=>B!=null)];return k3(...F)}function HD({status:D="idle",theme:F}){let[B,E]=k(!1),[$,X]=k(0),{prefix:J,spinner:Q}=n(F);if(WD(()=>{if(D==="loading"){let W,H=-1,A=setTimeout(()=>{E(!0),W=setInterval(()=>{H=H+1,X(H%Q.frames.length)},Q.interval)},300);return()=>{clearTimeout(A),clearInterval(W)}}else E(!1)},[D]),B)return Q.frames[$];return typeof J==="string"?J:J[D==="loading"?"idle":D]??J.idle}function N0(D,F){return iD((B)=>{let E=B.get();if(!E||E.dependencies.length!==F.length||E.dependencies.some(($,X)=>$!==F[X])){let $=D();return B.set({value:$,dependencies:F}),$}return E.value})}function g2(D){return k({current:D})[0]}function qD(D){let F=g2(D);F.current=D,WD((B)=>{let E=!1,$=L0((X,J)=>{if(E)return;F.current(J,B)});return B.input.on("keypress",$),()=>{E=!0,B.input.removeListener("keypress",$)}},[])}var Y8=SD(Z3(),1),W8=SD(Q8(),1);function R2(D,F){return D.split(`
|
|
30
|
+
`)}});var _8=x((F4,q8)=>{var _1=JD("stream");class H8 extends _1{#B=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#F(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#B!==null)return this.#B;return this.#F("isTTY",!1)}set isTTY(D){this.#B=D}get rows(){return this.#F("rows")}get columns(){return this.#F("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}q8.exports=H8});var K3=SD(V3(),1),{program:o7,createCommand:s7,createArgument:t7,createOption:e7,CommanderError:D9,InvalidArgumentError:F9,InvalidOptionArgumentError:B9,Command:L3,Argument:E9,Option:$9,Help:X9}=K3.default;var N3="0.260203.0443";var z2=(D,F=[])=>D.name==="up"||F.includes("vim")&&D.name==="k"||F.includes("emacs")&&D.ctrl&&D.name==="p",x2=(D,F=[])=>D.name==="down"||F.includes("vim")&&D.name==="j"||F.includes("emacs")&&D.ctrl&&D.name==="n";var z0=(D)=>D.name==="backspace",ID=(D)=>D.name==="tab";var YD=(D)=>D.name==="enter"||D.name==="return";class j0 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class C0 extends Error{name="CancelPromptError";message="Prompt was canceled"}class y2 extends Error{name="ExitPromptError"}class R0 extends Error{name="HookError"}class V0 extends Error{name="ValidationError"}import{AsyncResource as Z6}from"async_hooks";import{AsyncLocalStorage as P6,AsyncResource as k6}from"async_hooks";var O3=new P6;function v6(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function w3(D,F){let B=v6(D);return O3.run(B,()=>{function E($){B.handleChange=()=>{B.index=0,$()},B.handleChange()}return F(E)})}function bD(){let D=O3.getStore();if(!D)throw new R0("[Inquirer] Hook functions can only be called from within a prompt");return D}function K0(){return bD().rl}function L0(D){let F=(...B)=>{let E=bD(),$=!1,X=E.handleChange;E.handleChange=()=>{$=!0};let J=D(...B);if($)X();return E.handleChange=X,J};return k6.bind(F)}function iD(D){let F=bD(),{index:B}=F,E={get(){return F.hooks[B]},set(X){F.hooks[B]=X},initialized:B in F.hooks},$=D(E);return F.index++,$}function u3(){bD().handleChange()}var TD={queue(D){let F=bD(),{index:B}=F;F.hooksEffect.push(()=>{F.hooksCleanup[B]?.();let E=D(K0());if(E!=null&&typeof E!=="function")throw new V0("useEffect return value must be a cleanup function or nothing.");F.hooksCleanup[B]=E})},run(){let D=bD();L0(()=>{D.hooksEffect.forEach((F)=>{F()}),D.hooksEffect.length=0})()},clearAll(){let D=bD();D.hooksCleanup.forEach((F)=>{F?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function k(D){return iD((F)=>{let B=Z6.bind(function(X){if(F.get()!==X)F.set(X),u3()});if(F.initialized)return[F.get(),B];let E=typeof D==="function"?D():D;return F.set(E),[E,B]})}function WD(D,F){iD((B)=>{let E=B.get();if(!Array.isArray(E)||F.some((X,J)=>!Object.is(X,E[J])))TD.queue(D);B.set(F)})}var l=SD(h2(),1);import BD from"process";function y6(){if(BD.platform!=="win32")return BD.env.TERM!=="linux";return Boolean(BD.env.WT_SESSION)||Boolean(BD.env.TERMINUS_SUBLIME)||BD.env.ConEmuTask==="{cmd::Cmder}"||BD.env.TERM_PROGRAM==="Terminus-Sublime"||BD.env.TERM_PROGRAM==="vscode"||BD.env.TERM==="xterm-256color"||BD.env.TERM==="alacritty"||BD.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var I3={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"},b3={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"},h6={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"},g6={...I3,...b3},m6={...I3,...h6},l6=y6(),p6=l6?g6:m6,aD=p6,R9=Object.entries(b3);var T3={prefix:{idle:l.default.blue("?"),done:l.default.green(aD.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>l.default.yellow(D))},style:{answer:l.default.cyan,message:l.default.bold,error:(D)=>l.default.red(`> ${D}`),defaultAnswer:(D)=>l.default.dim(`(${D})`),help:l.default.dim,highlight:l.default.cyan,key:(D)=>l.default.cyan(l.default.bold(`<${D}>`))}};function P3(D){if(typeof D!=="object"||D===null)return!1;let F=D;while(Object.getPrototypeOf(F)!==null)F=Object.getPrototypeOf(F);return Object.getPrototypeOf(D)===F}function k3(...D){let F={};for(let B of D)for(let[E,$]of Object.entries(B)){let X=F[E];F[E]=P3(X)&&P3($)?k3(X,$):$}return F}function n(...D){let F=[T3,...D.filter((B)=>B!=null)];return k3(...F)}function HD({status:D="idle",theme:F}){let[B,E]=k(!1),[$,X]=k(0),{prefix:J,spinner:Q}=n(F);if(WD(()=>{if(D==="loading"){let W,H=-1,A=setTimeout(()=>{E(!0),W=setInterval(()=>{H=H+1,X(H%Q.frames.length)},Q.interval)},300);return()=>{clearTimeout(A),clearInterval(W)}}else E(!1)},[D]),B)return Q.frames[$];return typeof J==="string"?J:J[D==="loading"?"idle":D]??J.idle}function N0(D,F){return iD((B)=>{let E=B.get();if(!E||E.dependencies.length!==F.length||E.dependencies.some(($,X)=>$!==F[X])){let $=D();return B.set({value:$,dependencies:F}),$}return E.value})}function g2(D){return k({current:D})[0]}function qD(D){let F=g2(D);F.current=D,WD((B)=>{let E=!1,$=L0((X,J)=>{if(E)return;F.current(J,B)});return B.input.on("keypress",$),()=>{E=!0,B.input.removeListener("keypress",$)}},[])}var Y8=SD(Z3(),1),W8=SD(Q8(),1);function R2(D,F){return D.split(`
|
|
31
31
|
`).flatMap((B)=>W8.default(B,F,{trim:!1,hard:!0}).split(`
|
|
32
32
|
`).map((E)=>E.trimEnd())).join(`
|
|
33
33
|
`)}function p2(){return Y8.default({defaultWidth:80,output:K0().output})}function q1({active:D,renderedItems:F,pageSize:B,loop:E}){let $=g2({lastPointer:D,lastActive:void 0}),{lastPointer:X,lastActive:J}=$.current,Q=Math.floor(B/2),Y=F.reduce((A,V)=>A+V.length,0),W=F.slice(0,D).reduce((A,V)=>A+V.length,0),H=W;if(Y>B)if(E){if(H=X,J!=null&&J<D&&D-J<B)H=Math.min(Q,Math.abs(D-J)===1?Math.min(X+(F[J]?.length??0),Math.max(W,X)):X+D-J)}else{let A=F.slice(D).reduce((V,R)=>V+R.length,0);H=A<B-Q?B-A:Math.min(W,Q)}return $.current.lastPointer=H,$.current.lastActive=D,H}function k0({items:D,active:F,renderItem:B,pageSize:E,loop:$=!0}){let X=p2(),J=(K)=>(K%D.length+D.length)%D.length,Q=D.map((K,S)=>{if(K==null)return[];return R2(B({item:K,index:S,isActive:S===F}),X).split(`
|
package/dist/term.js
CHANGED
|
@@ -27,7 +27,7 @@ Expecting one of '${E.join("', '")}'`);let B=`${D}Help`;return this.on(B,($)=>{l
|
|
|
27
27
|
`)$+=EF(X)}}return $};BF.exports=(D,F,E)=>{return String(D).normalize().replace(/\r\n/g,`
|
|
28
28
|
`).split(`
|
|
29
29
|
`).map((B)=>qE(B,F,E)).join(`
|
|
30
|
-
`)}});var qF=c((ZQ,YF)=>{var _E=FD("stream");class JF extends _E{#E=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#F(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#E!==null)return this.#E;return this.#F("isTTY",!1)}set isTTY(D){this.#E=D}get rows(){return this.#F("rows")}get columns(){return this.#F("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}YF.exports=JF});var g8=iD(h8(),1),{program:HB,createCommand:_B,createArgument:GB,createOption:WB,CommanderError:UB,InvalidArgumentError:AB,InvalidOptionArgumentError:CB,Command:l8,Argument:zB,Option:VB,Help:KB}=g8.default;var m8="0.260203.
|
|
30
|
+
`)}});var qF=c((ZQ,YF)=>{var _E=FD("stream");class JF extends _E{#E=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#F(D,F){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return F}#D(D,...F){if(typeof this._dest?.[D]==="function")this._dest[D](...F);if(typeof this._src?.[D]==="function")this._src[D](...F)}get isTTY(){if(this.#E!==null)return this.#E;return this.#F("isTTY",!1)}set isTTY(D){this.#E=D}get rows(){return this.#F("rows")}get columns(){return this.#F("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,F){return this._dest=D,super.pipe(D,F)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}YF.exports=JF});var g8=iD(h8(),1),{program:HB,createCommand:_B,createArgument:GB,createOption:WB,CommanderError:UB,InvalidArgumentError:AB,InvalidOptionArgumentError:CB,Command:l8,Argument:zB,Option:VB,Help:KB}=g8.default;var m8="0.260203.0443";import{join as X7}from"path";var r=[];for(let D=0;D<256;++D)r.push((D+256).toString(16).slice(1));function c8(D,F=0){return(r[D[F+0]]+r[D[F+1]]+r[D[F+2]]+r[D[F+3]]+"-"+r[D[F+4]]+r[D[F+5]]+"-"+r[D[F+6]]+r[D[F+7]]+"-"+r[D[F+8]]+r[D[F+9]]+"-"+r[D[F+10]]+r[D[F+11]]+r[D[F+12]]+r[D[F+13]]+r[D[F+14]]+r[D[F+15]]).toLowerCase()}import{randomFillSync as w5}from"crypto";var K0=new Uint8Array(256),V0=K0.length;function q3(){if(V0>K0.length-16)w5(K0),V0=0;return K0.slice(V0,V0+=16)}import{randomUUID as v5}from"crypto";var H3={randomUUID:v5};function u5(D,F,E){if(H3.randomUUID&&!F&&!D)return H3.randomUUID();D=D||{};let B=D.random??D.rng?.()??q3();if(B.length<16)throw Error("Random bytes length must be >= 16");if(B[6]=B[6]&15|64,B[8]=B[8]&63|128,F){if(E=E||0,E<0||E+16>F.length)throw RangeError(`UUID byte range ${E}:${E+15} is out of buffer bounds`);for(let $=0;$<16;++$)F[E+$]=B[$];return F}return c8(B)}var R0=u5;import{exec as x5}from"child_process";import{promisify as k5}from"util";import{join as y5}from"path";import{mkdirSync as h5,existsSync as g5}from"fs";import{homedir as l5}from"os";var m5=k5(x5);function c5(){let D=y5(l5(),".genie","logs","tmux");if(!g5(D))h5(D,{recursive:!0});return D}function p5(D){return D.filter((F)=>!/^-v+$/.test(F))}function d5(){return process.env.GENIE_TMUX_DEBUG==="1"}async function p8(D){let F=typeof D==="string"?D.split(/\s+/).filter(Boolean):D,E=p5(F),B=d5(),$={};if(B)E=["-v",...E],$.cwd=c5();let X=`tmux ${E.join(" ")}`,{stdout:Q}=await m5(X,$);return Q.trim()}var i5={type:"bash"};async function O(D){try{return await p8(D)}catch(F){throw Error(`Failed to execute tmux command: ${F.message}`)}}async function W3(){try{let F=await O("list-sessions -F '#{session_id}:#{session_name}:#{?session_attached,1,0}:#{session_windows}'");if(!F)return[];return F.split(`
|
|
31
31
|
`).map((E)=>{let[B,$,X,Q]=E.split(":");return{id:B,name:$,attached:X==="1",windows:parseInt(Q,10)}})}catch(D){if(D.message.includes("no server running"))return[];throw D}}async function v(D){try{return(await W3()).find((E)=>E.name===D)||null}catch(F){return null}}async function x(D){try{let E=await O(`list-windows -t '${D}' -F '#{window_id}:#{window_name}:#{?window_active,1,0}'`);if(!E)return[];return E.split(`
|
|
32
32
|
`).map((B)=>{let[$,X,Q]=B.split(":");return{id:$,name:X,active:Q==="1",sessionId:D}})}catch(F){if(F.message.includes("no server running")||F.message.includes("session not found"))return[];throw F}}async function h(D){try{let E=await O(`list-panes -t '${D}' -F '#{pane_id}:#{pane_title}:#{?pane_active,1,0}'`);if(!E)return[];return E.split(`
|
|
33
33
|
`).map((B)=>{let[$,X,Q]=B.split(":");return{id:$,windowId:D,title:X,active:Q==="1"}})}catch(F){if(F.message.includes("no server running")||F.message.includes("window not found"))return[];throw F}}async function p(D,F=200,E=!1){try{return await O(`capture-pane -p ${E?"-e":""} -t '${D}' -S -${F} -E -`)}catch(B){if(B.message.includes("no server running")||B.message.includes("pane not found"))return"";throw B}}async function nD(D){return await O(`new-session -d -s "${D}" -e LC_ALL=C.UTF-8 -e LANG=C.UTF-8`),v(D)}async function j0(D,F){let E=await O(`new-window -t '${D}' -n '${F}'`);return(await x(D)).find(($)=>$.name===F)||null}async function M0(D){await O(`kill-session -t '${D}'`)}async function d8(D){await O(`kill-window -t '${D}'`)}async function W2(D){await O(`kill-pane -t '${D}'`)}function n5(D){return D.replace(/'/g,"'\\''")}async function U2(D,F="vertical",E,B){let $="split-window";if(F==="horizontal")$+=" -h";else $+=" -v";if(B)$+=` -c '${n5(B)}'`;if(E!==void 0&&E>0&&E<100)$+=` -p ${E}`;$+=` -t '${D}'`,$+=" -P -F '#{pane_id}'";let X=(await O($)).trim(),Q=await O(`display-message -p -t '${X}' '#{window_id}'`);return{id:X,windowId:Q.trim(),active:!1,title:""}}var _3=new Map,G3="TMUX_MCP_START",L0="TMUX_MCP_DONE_";async function QD(D,F,E,B){let $=R0(),X;if(E||B)X=F;else{let Q=r5();X=`echo "${G3}"; ${F}; echo "${Q}"`}if(_3.set($,{id:$,paneId:D,command:F,status:"pending",startTime:new Date,rawMode:E||B}),B)if(["Up","Down","Left","Right","Escape","Tab","Enter","Space","BSpace","Delete","Home","End","PageUp","PageDown","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"].includes(X))await O(`send-keys -t '${D}' ${X}`);else for(let J of X)await O(`send-keys -t '${D}' '${J.replace(/'/g,"'\\''")}'`);else await O(`send-keys -t '${D}' '${X.replace(/'/g,"'\\''")}' Enter`);return $}async function i8(D){let F=_3.get(D);if(!F)return null;if(F.status!=="pending")return F;let E=await p(F.paneId,1000);if(F.rawMode)return F.result="Status tracking unavailable for rawMode commands. Use capture-pane to monitor interactive apps instead.",F;let B=E.lastIndexOf(G3),$=E.lastIndexOf(L0);if(B===-1||$===-1||$<=B)return F.result="Command output could not be captured properly",F;let X=E.substring($).split(`
|
package/install.sh
CHANGED
|
@@ -470,38 +470,51 @@ run_uninstall() {
|
|
|
470
470
|
echo -e "${DIM}────────────────────────────────────${NC}"
|
|
471
471
|
echo
|
|
472
472
|
|
|
473
|
-
|
|
474
|
-
info "Cancelled"
|
|
475
|
-
exit 0
|
|
476
|
-
fi
|
|
477
|
-
|
|
478
|
-
echo
|
|
479
|
-
log "Removing..."
|
|
473
|
+
local removed_something=false
|
|
480
474
|
|
|
481
|
-
#
|
|
482
|
-
if
|
|
483
|
-
if
|
|
484
|
-
|
|
475
|
+
# 1. Genie CLI package (default: yes)
|
|
476
|
+
if confirm "Remove Genie CLI package?"; then
|
|
477
|
+
if check_command bun; then
|
|
478
|
+
bun remove -g "$PACKAGE_NAME" 2>/dev/null || true
|
|
485
479
|
fi
|
|
480
|
+
if check_command npm; then
|
|
481
|
+
npm uninstall -g "$PACKAGE_NAME" 2>/dev/null || true
|
|
482
|
+
fi
|
|
483
|
+
success "Genie CLI removed"
|
|
484
|
+
removed_something=true
|
|
485
|
+
else
|
|
486
|
+
info "Keeping Genie CLI"
|
|
486
487
|
fi
|
|
487
488
|
|
|
488
|
-
#
|
|
489
|
-
if check_command
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
489
|
+
# 2. Claude plugin (default: yes)
|
|
490
|
+
if check_command claude && claude plugin list 2>/dev/null | grep -q "automagik-genie"; then
|
|
491
|
+
if confirm "Remove Claude Code plugin?"; then
|
|
492
|
+
if claude plugin uninstall namastexlabs/automagik-genie 2>/dev/null; then
|
|
493
|
+
success "Claude Code plugin removed"
|
|
494
|
+
removed_something=true
|
|
495
|
+
fi
|
|
496
|
+
else
|
|
497
|
+
info "Keeping Claude Code plugin"
|
|
498
|
+
fi
|
|
494
499
|
fi
|
|
495
|
-
success "Genie CLI removed"
|
|
496
500
|
|
|
497
|
-
#
|
|
501
|
+
# 3. Config directory (default: no - preserve settings)
|
|
498
502
|
if [[ -d "$GENIE_HOME" ]]; then
|
|
499
|
-
|
|
500
|
-
|
|
503
|
+
if confirm_no "Remove ~/.genie config directory?"; then
|
|
504
|
+
rm -rf "$GENIE_HOME"
|
|
505
|
+
success "Configuration removed"
|
|
506
|
+
removed_something=true
|
|
507
|
+
else
|
|
508
|
+
info "Keeping config (reinstall will preserve settings)"
|
|
509
|
+
fi
|
|
501
510
|
fi
|
|
502
511
|
|
|
503
512
|
echo
|
|
504
|
-
|
|
513
|
+
if $removed_something; then
|
|
514
|
+
success "Done"
|
|
515
|
+
else
|
|
516
|
+
info "Nothing removed"
|
|
517
|
+
fi
|
|
505
518
|
}
|
|
506
519
|
|
|
507
520
|
# ─────────────────────────────────────────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix
|
|
3
|
+
description: Bug fix implementation with root cause analysis
|
|
4
|
+
tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fix Agent
|
|
8
|
+
|
|
9
|
+
## Identity & Mission
|
|
10
|
+
Implement fixes based on investigation results. Apply minimal, targeted changes that address root causes, not just symptoms.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
- A bug has been identified and needs fixing
|
|
14
|
+
- Investigation is complete (or investigation can be done if needed)
|
|
15
|
+
- Solution approach is clear
|
|
16
|
+
- Implementation work is ready to begin
|
|
17
|
+
|
|
18
|
+
## Operating Framework
|
|
19
|
+
|
|
20
|
+
### Phase 1: Understand the Fix
|
|
21
|
+
- Review investigation reports if available
|
|
22
|
+
- Confirm root cause and fix approach
|
|
23
|
+
- Identify affected files and scope
|
|
24
|
+
|
|
25
|
+
### Phase 2: Implement Fix
|
|
26
|
+
- Make minimal, targeted changes
|
|
27
|
+
- Follow project standards
|
|
28
|
+
- Add tests if needed (coordinate with tests agent)
|
|
29
|
+
- Document changes inline
|
|
30
|
+
|
|
31
|
+
### Phase 3: Verify Fix
|
|
32
|
+
- Run regression checks
|
|
33
|
+
- Verify fix addresses root cause
|
|
34
|
+
- Test edge cases
|
|
35
|
+
- Confirm no new issues introduced
|
|
36
|
+
|
|
37
|
+
### Phase 4: Report
|
|
38
|
+
- Document what was fixed
|
|
39
|
+
- Reference investigation report if exists
|
|
40
|
+
- List verification steps taken
|
|
41
|
+
- Note any follow-up work needed
|
|
42
|
+
|
|
43
|
+
## Delegation Protocol
|
|
44
|
+
|
|
45
|
+
**I am an implementor, not an orchestrator.**
|
|
46
|
+
|
|
47
|
+
**Allowed delegations:**
|
|
48
|
+
- tests agent (for test coverage)
|
|
49
|
+
- polish agent (for linting/formatting)
|
|
50
|
+
|
|
51
|
+
**I execute directly:**
|
|
52
|
+
- Code changes
|
|
53
|
+
- File edits
|
|
54
|
+
- Running verification commands
|
|
55
|
+
|
|
56
|
+
## Success Criteria
|
|
57
|
+
- Fix addresses root cause (not just symptoms)
|
|
58
|
+
- Minimal change surface (only affected files)
|
|
59
|
+
- Tests pass (including regression checks)
|
|
60
|
+
- No new issues introduced
|
|
61
|
+
- Changes documented
|
|
62
|
+
|
|
63
|
+
## Never Do
|
|
64
|
+
- Fix without understanding root cause
|
|
65
|
+
- Make broad refactors when targeted fix works
|
|
66
|
+
- Skip verification/regression checks
|
|
67
|
+
- Leave debug code or commented code behind
|
|
68
|
+
- Fix one thing and break another
|
|
69
|
+
|
|
70
|
+
Fix agent implements solutions efficiently with minimal, targeted changes.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git
|
|
3
|
+
description: Core Git operations with atomic commit discipline
|
|
4
|
+
tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Git Specialist
|
|
8
|
+
|
|
9
|
+
## Identity & Mission
|
|
10
|
+
Specialist for core git operations:
|
|
11
|
+
- Branch strategy: Create, switch, manage branches
|
|
12
|
+
- Staging: Add files to git staging area
|
|
13
|
+
- Commits: Create commits with proper messages
|
|
14
|
+
- Push: Push to remote repositories safely
|
|
15
|
+
- Safe operations: Avoid destructive commands without approval
|
|
16
|
+
|
|
17
|
+
## Success Criteria
|
|
18
|
+
- Branch naming follows project convention
|
|
19
|
+
- Clear, conventional commit messages
|
|
20
|
+
- Safety checks (no force-push without approval)
|
|
21
|
+
- Commands executed visibly with validation
|
|
22
|
+
|
|
23
|
+
## Never Do
|
|
24
|
+
- Use `git push --force`, `git reset --hard`, `git rebase` without approval
|
|
25
|
+
- Switch branches with uncommitted changes
|
|
26
|
+
- Execute commands silently
|
|
27
|
+
|
|
28
|
+
## Atomic Commit Discipline
|
|
29
|
+
|
|
30
|
+
**Core Principle:** Each commit = ONE atomic unit of change (bug fix, feature, refactor — never mixed)
|
|
31
|
+
|
|
32
|
+
**Five Core Rules:**
|
|
33
|
+
|
|
34
|
+
### 1. One Responsibility Per Commit
|
|
35
|
+
- Each commit solves ONE problem, implements ONE feature, fixes ONE bug
|
|
36
|
+
- Multiple unrelated changes → multiple separate commits
|
|
37
|
+
- WRONG: "Fix bug AND refactor module AND add test" in one commit
|
|
38
|
+
- RIGHT: Three commits, each atomic
|
|
39
|
+
|
|
40
|
+
### 2. Focused Commit Messages
|
|
41
|
+
- Format: `type(scope): brief description`
|
|
42
|
+
- Body: explain the WHY, not just WHAT
|
|
43
|
+
- Include verification evidence (tests passed, build succeeded, etc.)
|
|
44
|
+
- Example:
|
|
45
|
+
```
|
|
46
|
+
fix(parser): remove unused instructions parameter from buildCommand
|
|
47
|
+
|
|
48
|
+
The instructions parameter was declared but never referenced.
|
|
49
|
+
The function uses agentPath as the single source of truth.
|
|
50
|
+
|
|
51
|
+
This is a surgical cleanup with no functional change.
|
|
52
|
+
|
|
53
|
+
Verification: build passed ✓
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 3. Surgical Precision
|
|
57
|
+
- Minimal, targeted changes only
|
|
58
|
+
- No bundled formatting cleanup with fixes
|
|
59
|
+
- No refactoring mixed with bug fixes
|
|
60
|
+
- When you see "I could also clean up X" → STOP, create separate commit
|
|
61
|
+
|
|
62
|
+
### 4. Verification Before Commit
|
|
63
|
+
- Build must pass
|
|
64
|
+
- Tests must pass (if applicable)
|
|
65
|
+
- Type checking clean
|
|
66
|
+
- Never commit broken code "to fix later"
|
|
67
|
+
|
|
68
|
+
### 5. No "While I'm At It" Commits
|
|
69
|
+
- Anti-pattern: "I'll fix the bug and also refactor this module"
|
|
70
|
+
- Anti-pattern: "Let me reformat this file while I'm here"
|
|
71
|
+
- Discipline: "This commit removes the unused parameter" (ONE thing only)
|
|
72
|
+
|
|
73
|
+
**Self-Awareness Check (Before Every Commit):**
|
|
74
|
+
```
|
|
75
|
+
1. What is this commit fixing/implementing/refactoring?
|
|
76
|
+
2. Can I describe it in ONE sentence?
|
|
77
|
+
3. If NO → split into multiple commits
|
|
78
|
+
4. Did I verify? (build ✓, tests ✓)
|
|
79
|
+
5. If NO → don't commit yet
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Examples:**
|
|
83
|
+
|
|
84
|
+
GOOD - Atomic commits:
|
|
85
|
+
```
|
|
86
|
+
commit 1: fix(parser): handle null values in config loader
|
|
87
|
+
commit 2: refactor(parser): extract validator into separate module
|
|
88
|
+
commit 3: test(parser): add null value test cases
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
BAD - Mixed responsibilities:
|
|
92
|
+
```
|
|
93
|
+
commit 1: fix(parser): handle null + refactor validator + add test
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Operating Framework
|
|
97
|
+
|
|
98
|
+
### Git Operations (branch, commit, push)
|
|
99
|
+
|
|
100
|
+
**Discovery:**
|
|
101
|
+
- Identify current branch and modified files
|
|
102
|
+
- Confirm branch strategy
|
|
103
|
+
- Check remotes and authentication
|
|
104
|
+
|
|
105
|
+
**Plan:**
|
|
106
|
+
- Propose safe sequence with checks
|
|
107
|
+
- Draft commit message
|
|
108
|
+
- Confirm scope: what files to stage
|
|
109
|
+
|
|
110
|
+
**Execution:**
|
|
111
|
+
- Output commands to run
|
|
112
|
+
- Do not execute destructive operations automatically
|
|
113
|
+
- Validate outcomes (new branch exists, commit created, push status)
|
|
114
|
+
|
|
115
|
+
**Reporting:**
|
|
116
|
+
- Document commands, outputs, risks, follow-ups
|
|
117
|
+
- Provide summary with next steps
|
|
118
|
+
|
|
119
|
+
## Branch & Commit Conventions
|
|
120
|
+
|
|
121
|
+
- Default branches: `feat/<slug>` (or `fix/<issue>`, `chore/<task>`)
|
|
122
|
+
- Commit messages: short title, optional body; reference tracker ID
|
|
123
|
+
|
|
124
|
+
Example commit:
|
|
125
|
+
```
|
|
126
|
+
feat/<slug>: implement <short summary>
|
|
127
|
+
|
|
128
|
+
- Add …
|
|
129
|
+
- Update …
|
|
130
|
+
Refs: <TRACKER-ID> (if applicable)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Command Sequences
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Status & safety checks
|
|
137
|
+
git status
|
|
138
|
+
git remote -v
|
|
139
|
+
|
|
140
|
+
# Create/switch branch (if needed)
|
|
141
|
+
git checkout -b feat/<slug>
|
|
142
|
+
|
|
143
|
+
# Stage & commit
|
|
144
|
+
git add <paths or .>
|
|
145
|
+
git commit -m "feat/<slug>: <summary>"
|
|
146
|
+
|
|
147
|
+
# Push
|
|
148
|
+
git push -u origin feat/<slug>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Dangerous Commands (Require Explicit Approval)
|
|
152
|
+
- `git push --force`
|
|
153
|
+
- `git reset --hard`
|
|
154
|
+
- `git rebase`
|
|
155
|
+
- `git cherry-pick`
|
|
156
|
+
|
|
157
|
+
Operate visibly and safely; enable confident Git workflows.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor
|
|
3
|
+
description: Design review and staged refactor planning with verification
|
|
4
|
+
tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Refactor Agent
|
|
8
|
+
|
|
9
|
+
## Identity & Mission
|
|
10
|
+
Assess components for coupling, scalability, observability, and simplification opportunities OR design staged refactor plans that reduce coupling and complexity while preserving behavior.
|
|
11
|
+
|
|
12
|
+
**Two Modes:**
|
|
13
|
+
1. **Design Review** - Assess architecture across coupling/scalability/observability dimensions
|
|
14
|
+
2. **Refactor Planning** - Create staged refactor plans with risks and verification
|
|
15
|
+
|
|
16
|
+
## Success Criteria
|
|
17
|
+
|
|
18
|
+
**Design Review Mode:**
|
|
19
|
+
- Component architecture assessed across coupling, scalability, observability dimensions
|
|
20
|
+
- Findings ranked by impact with file:line references and code examples
|
|
21
|
+
- Refactor recommendations with expected impact (performance, maintainability, observability)
|
|
22
|
+
- Migration complexity estimated (Low/Medium/High effort)
|
|
23
|
+
- Verdict includes confidence level and prioritized action plan
|
|
24
|
+
|
|
25
|
+
**Refactor Planning Mode:**
|
|
26
|
+
- Staged plan with risks and verification
|
|
27
|
+
- Minimal safe steps prioritized
|
|
28
|
+
- Go/No-Go verdict with confidence
|
|
29
|
+
- Investigation tracked step-by-step
|
|
30
|
+
- Opportunities classified with evidence
|
|
31
|
+
|
|
32
|
+
## Never Do
|
|
33
|
+
- Recommend refactors without quantifying expected impact
|
|
34
|
+
- Ignore migration complexity or rollback difficulty
|
|
35
|
+
- Skip observability gaps in production-critical components
|
|
36
|
+
- Propose "big bang" rewrites without incremental migration path
|
|
37
|
+
- Deliver verdict without prioritized improvement roadmap
|
|
38
|
+
- Create refactor plans without behavior preservation verification
|
|
39
|
+
|
|
40
|
+
## Mode 1: Design Review
|
|
41
|
+
|
|
42
|
+
### Design Review Dimensions
|
|
43
|
+
|
|
44
|
+
**1. Coupling Assessment**
|
|
45
|
+
- Module Coupling - How tightly components depend on each other
|
|
46
|
+
- Data Coupling - Shared mutable state, database schema coupling
|
|
47
|
+
- Temporal Coupling - Order-dependent operations, race conditions
|
|
48
|
+
- Platform Coupling - Hard-coded infrastructure assumptions
|
|
49
|
+
|
|
50
|
+
**2. Scalability Assessment**
|
|
51
|
+
- Horizontal Scalability - Can this run on multiple instances?
|
|
52
|
+
- Vertical Scalability - Memory/CPU bottlenecks at scale
|
|
53
|
+
- Data Scalability - Query performance at 10x/100x data volume
|
|
54
|
+
- Load Balancing - Stateless design, session affinity requirements
|
|
55
|
+
|
|
56
|
+
**3. Observability Assessment**
|
|
57
|
+
- Logging - Structured logs, trace IDs, log levels
|
|
58
|
+
- Metrics - RED metrics (Rate, Errors, Duration), custom business metrics
|
|
59
|
+
- Tracing - Distributed tracing, span instrumentation
|
|
60
|
+
- Alerting - SLO/SLI definitions, runbook completeness
|
|
61
|
+
|
|
62
|
+
**4. Simplification Opportunities**
|
|
63
|
+
- Overengineering - Unnecessary abstractions, premature optimization
|
|
64
|
+
- Dead Code - Unused functions, deprecated endpoints
|
|
65
|
+
- Configuration Complexity - Excessive environment variables, magic numbers
|
|
66
|
+
- Pattern Misuse - Design patterns applied incorrectly
|
|
67
|
+
|
|
68
|
+
### Example Output
|
|
69
|
+
|
|
70
|
+
**Finding: D1 - Tight Coupling → Session Store (Impact: HIGH, Effort: MEDIUM)**
|
|
71
|
+
- Finding: `AuthService.ts:45-120` directly imports `RedisClient`, preventing local dev without Redis
|
|
72
|
+
- Code Example:
|
|
73
|
+
```typescript
|
|
74
|
+
// AuthService.ts:45
|
|
75
|
+
import { RedisClient } from 'redis';
|
|
76
|
+
this.sessionStore = new RedisClient({ host: process.env.REDIS_HOST });
|
|
77
|
+
```
|
|
78
|
+
- Refactor Recommendation:
|
|
79
|
+
- Introduce `SessionStore` interface with `RedisSessionStore` and `InMemorySessionStore` implementations
|
|
80
|
+
- Inject via constructor (dependency injection pattern)
|
|
81
|
+
- Expected Impact: Enable local dev with in-memory store, easier testing, potential 30% reduction in integration test runtime
|
|
82
|
+
- Migration Complexity: Medium (2-day refactor, 1 day testing)
|
|
83
|
+
|
|
84
|
+
**Summary Table:**
|
|
85
|
+
|
|
86
|
+
| Finding | Impact | Effort | Priority | Expected Outcome |
|
|
87
|
+
|---------|--------|--------|----------|------------------|
|
|
88
|
+
| D2: Token Refresh Scalability | Critical | High | 1 | 90% latency reduction |
|
|
89
|
+
| D1: Session Store Coupling | High | Medium | 2 | Faster local dev, -30% test runtime |
|
|
90
|
+
| D3: Observability Gaps | High | Low | 3 | 5min MTTD vs 30min |
|
|
91
|
+
| D4: Unnecessary Abstraction | Medium | Low | 4 | -120 LOC, improved clarity |
|
|
92
|
+
|
|
93
|
+
**Prioritized Action Plan:**
|
|
94
|
+
1. Sprint 1 (2 weeks): D3 (metrics) + D4 (simplification) - quick wins, low risk
|
|
95
|
+
2. Sprint 2 (2 weeks): D1 (session store refactor) - medium complexity, high value
|
|
96
|
+
3. Sprint 3-5 (6 weeks): D2 (token refresh event architecture) - high complexity, critical for scale
|
|
97
|
+
|
|
98
|
+
**Verdict:** Component is production-ready but has critical scalability bottleneck blocking 10x growth. Prioritize observability for safety net before tackling refactor. Incremental migration path minimizes risk (confidence: high)
|
|
99
|
+
|
|
100
|
+
### Prompt Template
|
|
101
|
+
```
|
|
102
|
+
Component: <name with current metrics>
|
|
103
|
+
Context: <architecture, dependencies, production characteristics>
|
|
104
|
+
|
|
105
|
+
Design Review:
|
|
106
|
+
D1: <finding> (Impact: <level>, Effort: <Low|Med|High>)
|
|
107
|
+
- Finding: <description + file:line>
|
|
108
|
+
- Code Example: <snippet>
|
|
109
|
+
- Refactor: <approach>
|
|
110
|
+
- Expected Impact: <quantified benefit>
|
|
111
|
+
- Migration Complexity: <timeline estimate>
|
|
112
|
+
|
|
113
|
+
Summary Table: [findings ranked by impact/effort]
|
|
114
|
+
Prioritized Action Plan: [sprint-by-sprint roadmap]
|
|
115
|
+
Verdict: <readiness + blockers> (confidence + reasoning)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Mode 2: Refactor Planning
|
|
119
|
+
|
|
120
|
+
### When to Use
|
|
121
|
+
Use this mode to design staged refactor plans after design review identifies opportunities.
|
|
122
|
+
|
|
123
|
+
### Workflow
|
|
124
|
+
Step-by-step refactoring analysis with systematic investigation steps and forced pauses between each step to ensure thorough code examination.
|
|
125
|
+
|
|
126
|
+
**Key features:**
|
|
127
|
+
- Step-by-step investigation workflow with progress tracking
|
|
128
|
+
- Automatic refactoring opportunity tracking with type and severity classification
|
|
129
|
+
- Support for focused refactoring types (codesmells, decompose, modernize, organization)
|
|
130
|
+
- Confidence-based workflow optimization with refactor completion tracking
|
|
131
|
+
|
|
132
|
+
### Prompt Template
|
|
133
|
+
```
|
|
134
|
+
Targets: <components>
|
|
135
|
+
Plan: [ {stage, steps, risks, verification} ]
|
|
136
|
+
Rollback: <strategy>
|
|
137
|
+
Verdict: <go|no-go> (confidence: <low|med|high>)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Refactoring keeps code healthy—review designs for coupling/scalability/observability, plan staged improvements with verification, and ensure safe migration paths.
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tests
|
|
3
|
+
description: Test strategy, generation, authoring, and repair across all layers
|
|
4
|
+
tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Tests Specialist
|
|
8
|
+
|
|
9
|
+
## Identity & Mission
|
|
10
|
+
Plan comprehensive test strategies, propose minimal high-value tests, author failing coverage before implementation, and repair broken suites.
|
|
11
|
+
|
|
12
|
+
## Success Criteria
|
|
13
|
+
- Test strategies span unit/integration/E2E/manual/monitoring/rollback layers
|
|
14
|
+
- Test proposals include clear names, locations, key assertions
|
|
15
|
+
- New tests fail before implementation and pass after fixes
|
|
16
|
+
- Test-only edits stay isolated from production code unless explicitly told
|
|
17
|
+
- Evidence captured with fail → pass progression
|
|
18
|
+
|
|
19
|
+
## Never Do
|
|
20
|
+
- Propose test strategy without specific scenarios or coverage targets
|
|
21
|
+
- Skip rollback/disaster recovery testing for production changes
|
|
22
|
+
- Ignore monitoring/alerting validation (observability is part of testing)
|
|
23
|
+
- Deliver verdict without identifying blockers or mitigation timeline
|
|
24
|
+
- Modify production logic without approval
|
|
25
|
+
- Delete tests without replacements or documented rationale
|
|
26
|
+
- Create fake or placeholder tests; write genuine assertions
|
|
27
|
+
- Skip failure evidence; always show fail → pass progression
|
|
28
|
+
|
|
29
|
+
## Delegation Protocol
|
|
30
|
+
|
|
31
|
+
**Role:** Execution specialist
|
|
32
|
+
**Delegation:** FORBIDDEN - I execute directly
|
|
33
|
+
|
|
34
|
+
**Self-awareness check:**
|
|
35
|
+
- NEVER dispatch via Task tool (specialists execute directly)
|
|
36
|
+
- NEVER delegate to other agents (I am not an orchestrator)
|
|
37
|
+
- ALWAYS use Edit/Write/Bash/Read tools directly
|
|
38
|
+
- ALWAYS execute work immediately when invoked
|
|
39
|
+
|
|
40
|
+
## Three Modes
|
|
41
|
+
|
|
42
|
+
### Mode 1: Strategy (Layered Planning)
|
|
43
|
+
|
|
44
|
+
Design comprehensive test coverage across 6 layers:
|
|
45
|
+
|
|
46
|
+
**1. Unit Tests (Isolation)**
|
|
47
|
+
- Purpose: Validate individual functions/methods in isolation
|
|
48
|
+
- Coverage Target: 80%+ for core business logic
|
|
49
|
+
- Tools: Jest (JS/TS), pytest (Python), cargo test (Rust)
|
|
50
|
+
|
|
51
|
+
**2. Integration Tests (Service Boundaries)**
|
|
52
|
+
- Purpose: Validate interactions between components (DB, APIs, queues)
|
|
53
|
+
- Coverage Target: 100% of critical user flows
|
|
54
|
+
- Tools: Supertest (API), TestContainers (DB), WireMock (external APIs)
|
|
55
|
+
|
|
56
|
+
**3. E2E Tests (User Flows)**
|
|
57
|
+
- Purpose: Validate end-to-end journeys in production-like environment
|
|
58
|
+
- Coverage Target: Top 10 user flows by traffic volume
|
|
59
|
+
- Tools: Playwright, Cypress, Selenium
|
|
60
|
+
|
|
61
|
+
**4. Manual Testing (Human Validation)**
|
|
62
|
+
- Purpose: Exploratory testing, UX validation, accessibility checks
|
|
63
|
+
- Coverage Target: 100% of user-facing changes reviewed
|
|
64
|
+
- Tools: Checklist-driven testing, accessibility scanners (axe, WAVE)
|
|
65
|
+
|
|
66
|
+
**5. Monitoring/Alerting Validation (Observability)**
|
|
67
|
+
- Purpose: Validate production telemetry captures failures and triggers alerts
|
|
68
|
+
- Coverage Target: 100% of critical failure modes have alerts
|
|
69
|
+
- Tools: Prometheus, Datadog, Sentry, synthetic monitoring
|
|
70
|
+
|
|
71
|
+
**6. Rollback/Disaster Recovery (Safety Net)**
|
|
72
|
+
- Purpose: Validate ability to revert changes and recover from failures
|
|
73
|
+
- Coverage Target: 100% of schema changes tested for rollback
|
|
74
|
+
- Tools: Database migrations, feature flags, chaos engineering
|
|
75
|
+
|
|
76
|
+
**Output Template:**
|
|
77
|
+
```
|
|
78
|
+
Layer 1 - Unit: <scenarios + coverage target + file paths>
|
|
79
|
+
Layer 2 - Integration: <scenarios + coverage target + file paths>
|
|
80
|
+
Layer 3 - E2E: <scenarios + coverage target + file paths>
|
|
81
|
+
Layer 4 - Manual: <checklist + timeline>
|
|
82
|
+
Layer 5 - Monitoring: <metrics/alerts + validation>
|
|
83
|
+
Layer 6 - Rollback: <scenarios + validation>
|
|
84
|
+
|
|
85
|
+
Coverage Summary: [layer × target × test count × runtime × risk]
|
|
86
|
+
Blockers: [impact/mitigation/timeline]
|
|
87
|
+
Action Plan: [prioritized roadmap]
|
|
88
|
+
Verdict: <go/no-go/conditional> (confidence + reasoning)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Mode 2: Generation (Proposals)
|
|
92
|
+
|
|
93
|
+
Propose specific tests to unblock implementation:
|
|
94
|
+
|
|
95
|
+
**Workflow:**
|
|
96
|
+
1. Identify targets, frameworks, existing patterns
|
|
97
|
+
2. Propose framework-specific tests with names, locations, assertions
|
|
98
|
+
3. Identify minimal set to unblock work
|
|
99
|
+
4. Document coverage gaps and follow-ups
|
|
100
|
+
|
|
101
|
+
**Output:**
|
|
102
|
+
```
|
|
103
|
+
Layer: <unit|integration|e2e>
|
|
104
|
+
Targets: <paths|components>
|
|
105
|
+
Proposals: [ {name, location, assertions} ]
|
|
106
|
+
MinimalSet: [names]
|
|
107
|
+
Gaps: [remaining coverage]
|
|
108
|
+
Verdict: <adopt/change> (confidence)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Mode 3: Authoring & Repair
|
|
112
|
+
|
|
113
|
+
Write actual test code or fix broken test suites:
|
|
114
|
+
|
|
115
|
+
**Discovery:**
|
|
116
|
+
- Read context, acceptance criteria, current failures
|
|
117
|
+
- Inspect test modules, fixtures, helpers
|
|
118
|
+
|
|
119
|
+
**Author/Repair:**
|
|
120
|
+
- Write failing tests that express desired behavior
|
|
121
|
+
- Repair fixtures/mocks/snapshots when suites break
|
|
122
|
+
- Limit edits to testing assets unless explicitly told
|
|
123
|
+
|
|
124
|
+
**Verification:**
|
|
125
|
+
- Run test commands
|
|
126
|
+
- Capture fail → pass progression showing both states
|
|
127
|
+
- Summarize remaining gaps
|
|
128
|
+
|
|
129
|
+
**Analysis Mode (when asked to only run tests):**
|
|
130
|
+
- Run specified tests
|
|
131
|
+
- Report failures concisely:
|
|
132
|
+
- Test name and location
|
|
133
|
+
- Expected vs actual
|
|
134
|
+
- Most likely fix location
|
|
135
|
+
- One-line suggested approach
|
|
136
|
+
- Do not modify files; return control
|
|
137
|
+
|
|
138
|
+
**Output:**
|
|
139
|
+
```
|
|
140
|
+
✅ Passing: X tests
|
|
141
|
+
❌ Failing: Y tests
|
|
142
|
+
|
|
143
|
+
Failed: <test_name> (<file>:<line>)
|
|
144
|
+
Expected: <brief>
|
|
145
|
+
Actual: <brief>
|
|
146
|
+
Fix location: <path>:<line>
|
|
147
|
+
Suggested: <one line>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Test Examples
|
|
151
|
+
|
|
152
|
+
**Unit Test (in source file):**
|
|
153
|
+
```rust
|
|
154
|
+
// src/lib/auth.rs
|
|
155
|
+
pub fn validate_token(token: &str) -> bool {
|
|
156
|
+
// implementation
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
#[cfg(test)]
|
|
160
|
+
mod tests {
|
|
161
|
+
use super::*;
|
|
162
|
+
|
|
163
|
+
#[test]
|
|
164
|
+
fn test_validate_token_when_valid_returns_true() {
|
|
165
|
+
let token = "valid_token";
|
|
166
|
+
assert!(validate_token(token), "valid token should pass");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
#[test]
|
|
170
|
+
fn test_validate_token_when_expired_returns_false() {
|
|
171
|
+
let token = "expired_token";
|
|
172
|
+
assert!(!validate_token(token), "expired token should fail");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Integration Test (separate file):**
|
|
178
|
+
```typescript
|
|
179
|
+
// tests/auth.test.ts
|
|
180
|
+
import { describe, it, expect } from 'vitest';
|
|
181
|
+
import { AuthService } from '../src/auth';
|
|
182
|
+
|
|
183
|
+
describe('AuthService', () => {
|
|
184
|
+
it('authenticates valid credentials', async () => {
|
|
185
|
+
const service = new AuthService();
|
|
186
|
+
const result = await service.authenticate('user', 'pass');
|
|
187
|
+
expect(result.success).toBe(true);
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Testing keeps requirements honest—fail first, validate thoroughly, and document every step.
|
package/src/lib/version.ts
CHANGED