imdone-cli 0.76.0 → 0.77.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 (27) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/.claude/plugins/imdone/README.md +1 -1
  3. package/dist/.claude/plugins/imdone/scripts/ai_adjustment_note_hook.mjs +89 -5
  4. package/dist/.claude/plugins/imdone/scripts/record_ai_adjustment_note.mjs +49 -1
  5. package/dist/.claude/skills/hypothesis-driven-development/SKILL.md +22 -11
  6. package/dist/.claude/skills/hypothesis-driven-development/references/interaction-contract.md +11 -10
  7. package/dist/.claude/skills/hypothesis-driven-development/references/prove-the-outcome.md +5 -5
  8. package/dist/.claude/skills/hypothesis-driven-development/references/session-setup.md +21 -10
  9. package/dist/.claude/skills/hypothesis-driven-development/scripts/evaluate_progress_notes_contract.mjs +6 -3
  10. package/dist/.codex/plugins/imdone/README.md +1 -1
  11. package/dist/.codex/plugins/imdone/scripts/ai_adjustment_note_hook.mjs +89 -5
  12. package/dist/.codex/plugins/imdone/scripts/record_ai_adjustment_note.mjs +49 -1
  13. package/dist/.codex/skills/hypothesis-driven-development/SKILL.md +22 -11
  14. package/dist/.codex/skills/hypothesis-driven-development/references/interaction-contract.md +11 -10
  15. package/dist/.codex/skills/hypothesis-driven-development/references/prove-the-outcome.md +5 -5
  16. package/dist/.codex/skills/hypothesis-driven-development/references/session-setup.md +21 -10
  17. package/dist/.codex/skills/hypothesis-driven-development/scripts/evaluate_progress_notes_contract.mjs +6 -3
  18. package/dist/CHANGELOG.md +4 -0
  19. package/dist/index.cjs +5 -4
  20. package/dist/index.cjs.map +2 -2
  21. package/dist/index.min.cjs +2 -2
  22. package/dist/index.min.cjs.map +2 -2
  23. package/dist/preinstall.cjs +1 -1
  24. package/dist/preinstall.cjs.map +1 -1
  25. package/dist/preinstall.min.cjs +1 -1
  26. package/dist/preinstall.min.cjs.map +1 -1
  27. package/package.json +1 -1
@@ -138,7 +138,7 @@ If you intentionally moved the secret to a different vault, rerun with \`IMDONE_
138
138
  `){return e.split(r).reduce((n,i)=>{let o=t?i.trim():i;return o&&n.push(o),n},[])}function Lc(e,t){return On(e,!0).map(r=>t(r))}function Nc(e){return(0,To.exists)(e,To.FOLDER)}function Ye(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function py(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function vo(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function pt(e){return Array.isArray(e)?e:[e]}function dy(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Mr(e){return pt(e).map(t=>t instanceof String?t:String(t))}function te(e,t=0){if(e==null)return t;let r=parseInt(e,10);return Number.isNaN(r)?t:r}function xn(e,t){let r=[];for(let n=0,i=e.length;n<i;n++)r.push(t,e[n]);return r}function Tn(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function my(e,t){let r={};return t.forEach(n=>{e[n]!==void 0&&(r[n]=e[n])}),r}function hc(e=0){return new Promise(t=>setTimeout(t,e))}function gc(e){if(e!==!1)return e}var $r,er,An,Oo=R({"src/lib/utils/util.ts"(){"use strict";Dc(),$r="\0",er=()=>{},An=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Oe(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function yc(e,t){let r=Ve(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Ao(e){return!!e&&An(e)==="[object Object]"}function hy(e){return typeof e=="function"}var Cn,gy,ae,bo,Co,Dc=R({"src/lib/utils/argument-filters.ts"(){"use strict";Oo(),Cn=e=>Array.isArray(e),gy=e=>typeof e=="number",ae=e=>typeof e=="string"||Ve(e),bo=e=>ae(e)||Array.isArray(e)&&e.every(ae),Co=e=>e==null||"number|boolean|function".includes(typeof e)?!1:typeof e.length=="number"}}),wc,X_=R({"src/lib/utils/exit-codes.ts"(){"use strict";wc=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(wc||{})}}),So,J_=R({"src/lib/utils/git-output-streams.ts"(){"use strict";So=class yy{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new yy(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function Q_(){throw new Error("LineParser:useMatches not implemented")}var V,Ft,Z_=R({"src/lib/utils/line-parser.ts"(){"use strict";V=class{constructor(e,t){this.matches=[],this.useMatches=Q_,this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((i,o)=>this.addMatch(i,o,r(o)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},Ft=class extends V{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function wy(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...by},...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var by,eI=R({"src/lib/utils/simple-git-options.ts"(){"use strict";by={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function $c(e,t=[]){return Ao(e)?Object.keys(e).reduce((r,n)=>{let i=e[n];if(Ve(i))r.push(i);else if(yc(i,["boolean"]))r.push(n+"="+i);else if(Array.isArray(i))for(let o of i)yc(o,["string","number"])||r.push(n+"="+o);else r.push(n);return r},t):t}function Ie(e,t=0,r=!1){let n=[];for(let i=0,o=t<0?e.length:t;i<o;i++)"string|number".includes(typeof e[i])&&n.push(String(e[i]));return $c(Fc(e),n),r||n.push(...tI(e)),n}function tI(e){let t=typeof Zt(e)=="function";return Mr(Oe(Zt(e,t?1:0),Cn,[]))}function Fc(e){let t=hy(Zt(e));return Oe(Zt(e,t?1:0),Ao)}function oe(e,t=!0){let r=ay(Zt(e));return t||cy(r)?r:void 0}var rI=R({"src/lib/utils/task-options.ts"(){"use strict";Dc(),Oo()}});function bc(e,t){return e(t.stdOut,t.stdErr)}function $e(e,t,r,n=!0){return pt(r).forEach(i=>{for(let o=On(i,n),a=0,c=o.length;a<c;a++){let l=(f=0)=>{if(!(a+f>=c))return o[a+f]};t.some(({parse:f})=>f(l,e))}}),e}var nI=R({"src/lib/utils/task-parser.ts"(){"use strict";Oo()}}),Sy={};de(Sy,{ExitCodes:()=>wc,GitOutputStreams:()=>So,LineParser:()=>V,NOOP:()=>er,NULL:()=>$r,RemoteLineParser:()=>Ft,append:()=>Ye,appendTaskOptions:()=>$c,asArray:()=>pt,asCamelCase:()=>dy,asFunction:()=>ay,asNumber:()=>te,asStringArray:()=>Mr,bufferToString:()=>Tn,callTaskParser:()=>bc,createInstanceConfig:()=>wy,delay:()=>hc,filterArray:()=>Cn,filterFunction:()=>hy,filterHasLength:()=>Co,filterNumber:()=>gy,filterPlainObject:()=>Ao,filterPrimitives:()=>yc,filterString:()=>ae,filterStringOrStringArray:()=>bo,filterType:()=>Oe,first:()=>uy,folderExists:()=>Nc,forEachLineWithContent:()=>Lc,getTrailingOptions:()=>Ie,including:()=>py,isUserFunction:()=>cy,last:()=>Zt,objectToString:()=>An,orVoid:()=>gc,parseStringResponse:()=>$e,pick:()=>my,prefixedArray:()=>xn,remove:()=>vo,splitOn:()=>ly,toLinesWithContent:()=>On,trailingFunctionArgument:()=>oe,trailingOptionsArgument:()=>Fc});var q=R({"src/lib/utils/index.ts"(){"use strict";Dc(),X_(),J_(),Z_(),eI(),rI(),nI(),Oo()}}),Ey={};de(Ey,{CheckRepoActions:()=>Sc,checkIsBareRepoTask:()=>Ty,checkIsRepoRootTask:()=>xy,checkIsRepoTask:()=>iI});function iI(e){switch(e){case"bare":return Ty();case"root":return xy()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:_o,parser:Pc}}function xy(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:_o,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Ty(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:_o,parser:Pc}}function oI(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Sc,_o,Pc,vy=R({"src/lib/tasks/check-is-repo.ts"(){"use strict";q(),Sc=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Sc||{}),_o=({exitCode:e},t,r,n)=>{if(e===128&&oI(t))return r(Buffer.from("false"));n(t)},Pc=e=>e.trim()==="true"}});function sI(e,t){let r=new Oy(e),n=e?Cy:Ay;return On(t).forEach(i=>{let o=i.replace(n,"");r.paths.push(o),(_y.test(o)?r.folders:r.files).push(o)}),r}var Oy,Ay,Cy,_y,aI=R({"src/lib/responses/CleanSummary.ts"(){"use strict";q(),Oy=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Ay=/^[a-z]+\s*/i,Cy=/^[a-z]+\s+[a-z]+\s*/i,_y=/\/$/}}),Ec={};de(Ec,{EMPTY_COMMANDS:()=>Io,adhocExecTask:()=>Iy,configurationErrorTask:()=>De,isBufferTask:()=>ky,isEmptyTask:()=>Ly,straightThroughBufferTask:()=>Ry,straightThroughStringTask:()=>Re});function Iy(e){return{commands:Io,format:"empty",parser:e}}function De(e){return{commands:Io,format:"empty",parser(){throw typeof e=="string"?new oy(e):e}}}function Re(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function Ry(e){return{commands:e,format:"buffer",parser(t){return t}}}function ky(e){return e.format==="buffer"}function Ly(e){return e.format==="empty"||!e.commands.length}var Io,ue=R({"src/lib/tasks/task.ts"(){"use strict";sy(),Io=[]}}),Ny={};de(Ny,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Mc,CONFIG_ERROR_MODE_REQUIRED:()=>jc,CONFIG_ERROR_UNKNOWN_OPTION:()=>Uc,CleanOptions:()=>ho,cleanTask:()=>Dy,cleanWithOptionsTask:()=>cI,isCleanOptionsArray:()=>lI});function cI(e,t){let{cleanMode:r,options:n,valid:i}=uI(e);return r?i.options?(n.push(...t),n.some(dI)?De(Mc):Dy(r,n)):De(Uc+JSON.stringify(e)):De(jc)}function Dy(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return sI(e==="n",n)}}}function lI(e){return Array.isArray(e)&&e.every(t=>Bc.has(t))}function uI(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(i=>{fI(i)?(t=i,n.cleanMode=!0):n.options=n.options&&pI(r[r.length]=`-${i}`)}),{cleanMode:t,options:r,valid:n}}function fI(e){return e==="f"||e==="n"}function pI(e){return/^-[a-z]$/i.test(e)&&Bc.has(e.charAt(1))}function dI(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var Mc,jc,Uc,ho,Bc,$y=R({"src/lib/tasks/clean.ts"(){"use strict";aI(),q(),ue(),Mc="Git clean interactive mode is not supported",jc='Git clean mode parameter ("n" or "f") is required',Uc="Git clean unknown option found in: ",ho=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(ho||{}),Bc=new Set(["i",...Mr(Object.values(ho))])}});function mI(e){let t=new Py;for(let r of Fy(e))t.addValue(r.file,String(r.key),r.value);return t}function hI(e,t){let r=null,n=[],i=new Map;for(let o of Fy(e,t))o.key===t&&(n.push(r=o.value),i.has(o.file)||i.set(o.file,[]),i.get(o.file).push(r));return{key:t,paths:Array.from(i.keys()),scopes:i,value:r,values:n}}function gI(e){return e.replace(/^(file):/,"")}function*Fy(e,t=null){let r=e.split("\0");for(let n=0,i=r.length-1;n<i;){let o=gI(r[n++]),a=r[n++],c=t;if(a.includes(`
139
139
  `)){let l=ly(a,`
140
140
  `);c=l[0],a=l[1]}yield{file:o,key:c,value:a}}}var Py,yI=R({"src/lib/responses/ConfigList.ts"(){"use strict";q(),Py=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Zt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);Object.hasOwn(n,t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function lc(e,t){return typeof e=="string"&&Object.hasOwn(xc,e)?e:t}function wI(e,t,r,n){let i=["config",`--${n}`];return r&&i.push("--add"),i.push(e,t),{commands:i,format:"utf-8",parser(o){return o}}}function bI(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return hI(n,e)}}}function SI(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return mI(r)}}}function EI(){return{addConfig(e,t,...r){return this._runTask(wI(e,t,r[0]===!0,lc(r[1],"local")),oe(arguments))},getConfig(e,t){return this._runTask(bI(e,lc(t,void 0)),oe(arguments))},listConfig(...e){return this._runTask(SI(lc(e[0],void 0)),oe(arguments))}}}var xc,My=R({"src/lib/tasks/config.ts"(){"use strict";yI(),q(),xc=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(xc||{})}});function xI(e){return jy.has(e)}var uc,jy,Uy=R({"src/lib/tasks/diff-name-status.ts"(){"use strict";uc=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(uc||{}),jy=new Set(Object.values(uc))}});function TI(...e){return new Gy().param(...e)}function vI(e){let t=new Set,r={};return Lc(e,n=>{let[i,o,a]=n.split($r);t.add(i),(r[i]=r[i]||[]).push({line:te(o),path:i,preview:a})}),{paths:t,results:r}}function OI(){return{grep(e){let t=oe(arguments),r=Ie(arguments);for(let i of By)if(r.includes(i))return this._runTask(De(`git.grep: use of "${i}" is not supported.`),t);typeof e=="string"&&(e=TI().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(i){return vI(i)}},t)}}}var By,En,_g,Gy,qy=R({"src/lib/tasks/grep.ts"(){"use strict";q(),ue(),By=["-h"],En=Symbol("grepQuery"),Gy=class{constructor(){this[_g]=[]}*[(_g=En,Symbol.iterator)](){for(let e of this[En])yield e}and(...e){return e.length&&this[En].push("--and","(",...xn(e,"-e"),")"),this}param(...e){return this[En].push(...xn(e,"-e")),this}}}}),Vy={};de(Vy,{ResetMode:()=>go,getResetMode:()=>CI,resetTask:()=>AI});function AI(e,t){let r=["reset"];return Hy(e)&&r.push(`--${e}`),r.push(...t),Re(r)}function CI(e){if(Hy(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function Hy(e){return typeof e=="string"&&Wy.includes(e)}var go,Wy,Yy=R({"src/lib/tasks/reset.ts"(){"use strict";q(),ue(),go=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(go||{}),Wy=Mr(Object.values(go))}});function _I(){return(0,Eo.default)("simple-git")}function Ig(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...i)=>{e(n,...i),r(n,...i)}:e:(n,...i)=>{e(`%s ${n}`,t,...i),r&&r(n,...i)}}function II(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Gc(e,t,r,n=_I()){let i=e&&`[${e}]`||"",o=[],a=typeof t=="string"?n.extend(t):t,c=II(Oe(t,ae),a,n);return f(r);function l(d,u){return Ye(o,Gc(e,c.replace(/^[^:]+/,d),u,n))}function f(d){let u=d&&`[${d}]`||"",m=a&&Ig(a,u)||er,h=Ig(n,`${i} ${u}`,m);return Object.assign(a?m:h,{label:e,sibling:l,info:h,step:f})}}var zy=R({"src/lib/git-logger.ts"(){"use strict";q(),Eo.default.formatters.L=e=>String(Co(e)?e.length:"-"),Eo.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):An(e)}}),Ky,RI=R({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Pt(),zy(),Ky=class Tc{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=Tc.getName(t.commands[0]),n=Gc(this.logLabel,r);return{task:t,logger:n,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===t.task?(n.info("Failed %o",t),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new xt(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++Tc.counter}`}static{this.counter=0}}}});function Qt(e,t){return{method:uy(e.commands)||"",commands:t}}function kI(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function Rg(e,t,r,n){return i=>{r("%s received %L bytes",t,i),n("%B",i),e.push(i)}}var vc,LI=R({"src/lib/runners/git-executor-chain.ts"(){"use strict";Pt(),ue(),q(),RI(),vc=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Ky}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return await(Ly(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n))}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof xt?Object.assign(t,{task:e}):new xt(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",Qt(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],{...Qt(e,e.commands),env:{...this.env}}),i=await this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),o=await this.handleTaskData(e,n,i,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),ky(e)?bc(e.parser,o):bc(e.parser,o.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,n){let{exitCode:i,rejection:o,stdOut:a,stdErr:c}=r;return new Promise((l,f)=>{n("Preparing to handle process response exitCode=%d stdOut=",i);let{error:d}=this._plugins.exec("task.error",{error:o},{...Qt(e,t),...r});if(d&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,d,u=>{n.info("custom error handler treated as success"),n("custom error returned a %s",An(u)),l(new So(Array.isArray(u)?Buffer.concat(u):u,Buffer.concat(c)))},f);if(d)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,c.length,o),f(d);n.info("retrieving task output complete"),l(new So(Buffer.concat(a),Buffer.concat(c)))})}async gitResponse(e,t,r,n,i){let o=i.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Qt(e,e.commands));return new Promise(c=>{let l=[],f=[];i.info("%s %o",t,r),i("%O",a);let d=this._beforeSpawn(e,r);if(d)return c({stdOut:l,stdErr:f,exitCode:9901,rejection:d});this._plugins.exec("spawn.before",void 0,{...Qt(e,r),kill(m){d=m||d}});let u=(0,Xy.spawn)(t,r,a);u.stdout.on("data",Rg(l,"stdOut",i,o.step("stdOut"))),u.stderr.on("data",Rg(f,"stdErr",i,o.step("stdErr"))),u.on("error",kI(f,i)),n&&(i("Passing child process stdOut/stdErr to custom outputHandler"),n(t,u.stdout,u.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...Qt(e,r),spawned:u,close(m,h){c({stdOut:l,stdErr:f,exitCode:m,rejection:d||h})},kill(m){u.killed||(d=m,u.kill("SIGINT"))}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...Qt(e,t),kill(n){r=n||r}}),r}}}}),Jy={};de(Jy,{GitExecutor:()=>Qy});var Qy,NI=R({"src/lib/runners/git-executor.ts"(){"use strict";LI(),Qy=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new vc(this,this._scheduler,this._plugins)}chain(){return new vc(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function DI(e,t,r=er){let n=o=>{r(null,o)},i=o=>{o?.task===e&&r(o instanceof vn?$I(o):o,void 0)};t.then(n,i)}function $I(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=er};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,i){return i in e||(n[i]={enumerable:!1,configurable:!1,get(){return t(i),e.git[i]}}),n}}var FI=R({"src/lib/task-callback.ts"(){"use strict";Pr(),q()}});function kg(e,t){return Iy(r=>{if(!Nc(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var PI=R({"src/lib/tasks/change-working-directory.ts"(){"use strict";q(),ue()}});function fc(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=vo(t,"-B")),Re(t)}function MI(){return{checkout(){return this._runTask(fc(Ie(arguments,1)),oe(arguments))},checkoutBranch(e,t){return this._runTask(fc(["-b",e,t,...Ie(arguments)]),oe(arguments))},checkoutLocalBranch(e){return this._runTask(fc(["-b",e,...Ie(arguments)]),oe(arguments))}}}var jI=R({"src/lib/tasks/checkout.ts"(){"use strict";q(),ue()}});function UI(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function BI(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return $e(UI(),[Zy],e)}})}}}var Zy,GI=R({"src/lib/tasks/count-objects.ts"(){"use strict";q(),Zy=new V(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=dy(t);Object.hasOwn(e,n)&&(e[n]=te(r))})}});function qI(e){return $e({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},ew,e)}var ew,VI=R({"src/lib/parsers/parse-commit.ts"(){"use strict";q(),ew=[new V(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new V(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new V(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new V(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(r,10)||0;n==="-"?e.summary.deletions=i:n==="+"&&(e.summary.insertions=i)})]}});function HI(e,t,r){return{commands:["-c","core.abbrev=40","commit",...xn(e,"-m"),...t,...r],format:"utf-8",parser:qI}}function WI(){return{commit(t,...r){let n=oe(arguments),i=e(t)||HI(pt(t),pt(Oe(r[0],bo,[])),[...Mr(Oe(r[1],Cn,[])),...Ie(arguments,0,!0)]);return this._runTask(i,n)}};function e(t){return!bo(t)&&De("git.commit: requires the commit message to be supplied as a string/string[]")}}var YI=R({"src/lib/tasks/commit.ts"(){"use strict";VI(),q(),ue()}});function zI(){return{firstCommit(){return this._runTask(Re(["rev-list","--max-parents=0","HEAD"],!0),oe(arguments))}}}var KI=R({"src/lib/tasks/first-commit.ts"(){"use strict";q(),ue()}});function XI(e,t){let r=["hash-object",e];return t&&r.push("-w"),Re(r,!0)}var JI=R({"src/lib/tasks/hash-object.ts"(){"use strict";ue()}});function QI(e,t,r){let n=String(r).trim(),i;if(i=tw.exec(n))return new yo(e,t,!1,i[1]);if(i=rw.exec(n))return new yo(e,t,!0,i[1]);let o="",a=n.split(" ");for(;a.length;)if(a.shift()==="in"){o=a.join(" ");break}return new yo(e,t,/^re/i.test(n),o)}var yo,tw,rw,ZI=R({"src/lib/responses/InitSummary.ts"(){"use strict";yo=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},tw=/^Init.+ repository in (.+)$/,rw=/^Rein.+ in (.+)$/}});function eR(e){return e.includes(qc)}function tR(e=!1,t,r){let n=["init",...r];return e&&!eR(n)&&n.splice(1,0,qc),{commands:n,format:"utf-8",parser(i){return QI(n.includes("--bare"),t,i)}}}var qc,rR=R({"src/lib/tasks/init.ts"(){"use strict";ZI(),qc="--bare"}});function Vc(e){for(let t=0;t<e.length;t++){let r=Hc.exec(e[t]);if(r)return`--${r[1]}`}return""}function nR(e){return Hc.test(e)}var Hc,_n=R({"src/lib/args/log-format.ts"(){"use strict";Hc=/^--(stat|numstat|name-only|name-status)(=|$)/}}),nw,iR=R({"src/lib/responses/DiffSummary.ts"(){"use strict";nw=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function iw(e=""){let t=ow[e];return r=>$e(new nw,t,r,!1)}var pc,Lg,Ng,Dg,ow,sw=R({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";_n(),iR(),Uy(),q(),pc=[new V(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:te(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new V(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:te(r),after:te(n),binary:!0})}),new V(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),i=/(\d+) d/.exec(r);e.changed=te(t),e.insertions=te(n?.[1]),e.deletions=te(i?.[1])})],Lg=[new V(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let i=te(t),o=te(r);e.changed++,e.insertions+=i,e.deletions+=o,e.files.push({file:n,changes:i+o,insertions:i,deletions:o,binary:!1})}),new V(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Ng=[new V(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Dg=[new V(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,i,o])=>{e.changed++,e.files.push({file:o??n,changes:0,insertions:0,deletions:0,binary:!1,status:gc(xI(t)&&t),from:gc(!!o&&n!==o&&n),similarity:te(r)})})],ow={"":pc,"--stat":pc,"--numstat":Lg,"--name-status":Dg,"--name-only":Ng}}});function oR(e,t){return t.reduce((r,n,i)=>(r[n]=e[i]||"",r),Object.create({diff:null}))}function aw(e=zc,t=cw,r=""){let n=iw(r);return function(i){let o=On(i.trim(),!1,Wc).map(function(a){let c=a.split(Yc),l=oR(c[0].split(e),t);return c.length>1&&c[1].trim()&&(l.diff=n(c[1])),l});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}var Wc,Yc,zc,cw,lw=R({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";q(),sw(),_n(),Wc="\xF2\xF2\xF2\xF2\xF2\xF2 ",Yc=" \xF2\xF2",zc=" \xF2 ",cw=["hash","date","message","refs","author_name","author_email"]}}),uw={};de(uw,{diffSummaryTask:()=>sR,validateLogFormatConfig:()=>Ro});function sR(e){let t=Vc(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),Ro(r)||{commands:r,format:"utf-8",parser:iw(t)}}function Ro(e){let t=e.filter(nR);if(t.length>1)return De(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return De(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var Kc=R({"src/lib/tasks/diff.ts"(){"use strict";_n(),sw(),ue()}});function aR(e,t){let r=[],n=[];return Object.keys(e).forEach(i=>{r.push(i),n.push(String(e[i]))}),[r,n.join(t)]}function cR(e){return Object.keys(e).reduce((t,r)=>(r in Oc||(t[r]=e[r]),t),{})}function fw(e={},t=[]){let r=Oe(e.splitter,ae,zc),n=Ao(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[i,o]=aR(n,r),a=[],c=[`--pretty=format:${Wc}${o}${Yc}`,...t],l=e.n||e["max-count"]||e.maxCount;if(l&&c.push(`--max-count=${l}`),e.from||e.to){let f=e.symmetric!==!1?"...":"..";a.push(`${e.from||""}${f}${e.to||""}`)}return ae(e.file)&&c.push("--follow",kr(e.file)),$c(cR(e),c),{fields:i,splitter:r,commands:[...c,...a]}}function lR(e,t,r){let n=aw(e,t,Vc(r));return{commands:["log",...r],format:"utf-8",parser:n}}function uR(){return{log(...r){let n=oe(arguments),i=fw(Fc(arguments),Mr(Oe(arguments[0],Cn,[]))),o=t(...r)||Ro(i.commands)||e(i);return this._runTask(o,n)}};function e(r){return lR(r.splitter,r.fields,r.commands)}function t(r,n){return ae(r)&&ae(n)&&De("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Oc,pw=R({"src/lib/tasks/log.ts"(){"use strict";_n(),lw(),q(),ue(),Kc(),Oc=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(Oc||{})}}),wo,dw,fR=R({"src/lib/responses/MergeSummary.ts"(){"use strict";wo=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},dw=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Ac,mw,pR=R({"src/lib/responses/PullSummary.ts"(){"use strict";Ac=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},mw=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function dc(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function $g(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:te(t&&t[1]||"0"),delta:te(r&&r[1]||"0")}}var hw,dR=R({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";q(),hw=[new Ft(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),i=dc(e.remoteMessages);Object.assign(i,{[n]:te(r)})}),new Ft(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),i=dc(e.remoteMessages);Object.assign(i,{[n]:te(r)})}),new Ft(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let i=dc(e.remoteMessages);i.total=$g(t),i.reused=$g(r),i.packReused=te(n)})]}});function gw(e,t){return $e({remoteMessages:new ww},yw,t)}var yw,ww,bw=R({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";q(),dR(),yw=[new Ft(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...hw,new Ft([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new Ft([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:te(t),summary:r,url:n}})],ww=class{constructor(){this.all=[]}}}});function mR(e,t){let r=$e(new mw,Sw,[e,t]);return r.message&&r}var Fg,Pg,Mg,jg,Sw,Ug,Xc,Ew=R({"src/lib/parsers/parse-pull.ts"(){"use strict";pR(),q(),bw(),Fg=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Pg=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Mg=/^(create|delete) mode \d+ (.+)/,jg=[new V(Fg,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new V(Pg,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new V(Mg,(e,[t,r])=>{Ye(e.files,r),Ye(t==="create"?e.created:e.deleted,r)})],Sw=[new V(/^from\s(.+)$/i,(e,[t])=>{e.remote=t}),new V(/^fatal:\s(.+)$/,(e,[t])=>{e.message=t}),new V(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,i])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=i,e.hash.remote=r})],Ug=(e,t)=>$e(new Ac,jg,[e,t]),Xc=(e,t)=>Object.assign(new Ac,Ug(e,t),gw(e,t))}}),Bg,xw,Gg,hR=R({"src/lib/parsers/parse-merge.ts"(){"use strict";fR(),q(),Ew(),Bg=[new V(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new V(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new wo(t,r))}),new V(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new wo(t,r,{deleteRef:n}))}),new V(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new wo(t,null))}),new V(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],xw=(e,t)=>Object.assign(Gg(e,t),Xc(e,t)),Gg=e=>$e(new dw,Bg,e)}});function qg(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=xw(t,r);if(n.failed)throw new vn(n);return n}}:De("Git.merge requires at least one option")}var gR=R({"src/lib/tasks/merge.ts"(){"use strict";Pr(),hR(),ue()}});function yR(e,t,r){let n=r.includes("deleted"),i=r.includes("tag")||/^refs\/tags/.test(e),o=!r.includes("new");return{deleted:n,tag:i,branch:!i,new:!o,alreadyUpdated:o,local:e,remote:t}}var Vg,Tw,Hg,wR=R({"src/lib/parsers/parse-push.ts"(){"use strict";q(),bw(),Vg=[new V(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new V(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new V(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(yR(t,r,n))}),new V(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:n}}),new V(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,i])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:i}}})],Tw=(e,t)=>{let r=Hg(e,t),n=gw(e,t);return{...r,...n}},Hg=(e,t)=>$e({pushed:[]},Vg,[e,t])}}),vw={};de(vw,{pushTagsTask:()=>bR,pushTask:()=>Jc});function bR(e={},t){return Ye(t,"--tags"),Jc(e,t)}function Jc(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),vo(r,"-v"),Ye(r,"--verbose"),Ye(r,"--porcelain"),{commands:r,format:"utf-8",parser:Tw}}var Ow=R({"src/lib/tasks/push.ts"(){"use strict";wR(),q()}});function SR(){return{showBuffer(){let e=["show",...Ie(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(Ry(e),oe(arguments))},show(){let e=["show",...Ie(arguments,1)];return this._runTask(Re(e),oe(arguments))}}}var ER=R({"src/lib/tasks/show.ts"(){"use strict";q(),ue()}}),Wg,Aw,xR=R({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Wg=/^(.+)\0(.+)$/,Aw=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=Wg.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function Yg(e){let[t,r]=e.split($r);return{from:r||t,to:t}}function Ue(e,t,r){return[`${e}${t}`,r]}function mc(e,...t){return t.map(r=>Ue(e,r,(n,i)=>n.conflicted.push(i)))}function TR(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(i,o,a){let c=`${i}${o}`,l=Cw.get(c);l&&l(e,a),c!=="##"&&c!=="!!"&&e.files.push(new Aw(a,i,o))}}var zg,Cw,_w,vR=R({"src/lib/responses/StatusSummary.ts"(){"use strict";q(),xR(),zg=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Cw=new Map([Ue(" ","A",(e,t)=>e.created.push(t)),Ue(" ","D",(e,t)=>e.deleted.push(t)),Ue(" ","M",(e,t)=>e.modified.push(t)),Ue("A"," ",(e,t)=>{e.created.push(t),e.staged.push(t)}),Ue("A","M",(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Ue("D"," ",(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Ue("M"," ",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Ue("M","M",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Ue("R"," ",(e,t)=>{e.renamed.push(Yg(t))}),Ue("R","M",(e,t)=>{let r=Yg(t);e.renamed.push(r),e.modified.push(r.to)}),Ue("!","!",(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Ue("?","?",(e,t)=>e.not_added.push(t)),...mc("A","A","U"),...mc("D","D","U"),...mc("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,a=/\son\s(\S+?)(?=\.{3}|$)/,c=r.exec(t);e.ahead=c&&+c[1]||0,c=n.exec(t),e.behind=c&&+c[1]||0,c=i.exec(t),e.current=Oe(c?.[1],ae,null),c=o.exec(t),e.tracking=Oe(c?.[1],ae,null),c=a.exec(t),c&&(e.current=Oe(c?.[1],ae,e.current)),e.detached=/\(no branch\)/.test(t)}]]),_w=function(e){let t=e.split($r),r=new zg;for(let n=0,i=t.length;n<i;){let o=t[n++].trim();o&&(o.charAt(0)==="R"&&(o+=$r+(t[n++]||"")),TR(r,o))}return r}}});function OR(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!Iw.includes(r))],parser(r){return _w(r)}}}var Iw,AR=R({"src/lib/tasks/status.ts"(){"use strict";vR(),Iw=["--null","-z"]}});function xo(e=0,t=0,r=0,n="",i=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function CR(){return xo(0,0,0,"",!1)}function _R(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:IR,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(Qc));n(t)}})}}}function IR(e){return e===Qc?CR():$e(xo(0,0,0,e),Rw,e)}var Qc,Rw,RR=R({"src/lib/tasks/version.ts"(){"use strict";q(),Qc="installed=false",Rw=[new V(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,i=""])=>{Object.assign(e,xo(te(t),te(r),te(n),i))}),new V(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,i=""])=>{Object.assign(e,xo(te(t),te(r),n,i))})]}});function Kg(e,t,r,...n){return ae(r)?t(r,Oe(n[0],ae),Ie(arguments)):De(`git.${e}() requires a string 'repoPath'`)}function kR(){return{clone(e,...t){return this._runTask(Kg("clone",Cc,Oe(e,ae),...t),oe(arguments))},mirror(e,...t){return this._runTask(Kg("mirror",kw,Oe(e,ae),...t),oe(arguments))}}}var Cc,kw,LR=R({"src/lib/tasks/clone.ts"(){"use strict";ue(),q(),Cc=(e,t,r)=>{let n=["clone",...r];return ae(e)&&n.push(kr(e)),ae(t)&&n.push(kr(t)),Re(n)},kw=(e,t,r)=>(Ye(r,"--mirror"),Cc(e,t,r))}}),Lw={};de(Lw,{SimpleGitApi:()=>_c});var _c,NR=R({"src/lib/simple-git-api.ts"(){"use strict";FI(),PI(),jI(),GI(),YI(),My(),KI(),qy(),JI(),rR(),pw(),gR(),Ow(),ER(),AR(),ue(),RR(),q(),LR(),_c=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&DI(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(Re(["add",...pt(e)]),oe(arguments))}cwd(e){let t=oe(arguments);return typeof e=="string"?this._runTask(kg(e,this._executor),t):typeof e?.path=="string"?this._runTask(kg(e.path,e.root&&this._executor||void 0),t):this._runTask(De("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(XI(e,t===!0),oe(arguments))}init(e){return this._runTask(tR(e===!0,this._executor.cwd,Ie(arguments)),oe(arguments))}merge(){return this._runTask(qg(Ie(arguments)),oe(arguments))}mergeFromTo(e,t){return ae(e)&&ae(t)?this._runTask(qg([e,t,...Ie(arguments)]),oe(arguments,!1)):this._runTask(De("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=Jc({remote:Oe(arguments[0],ae),branch:Oe(arguments[1],ae)},Ie(arguments));return this._runTask(e,oe(arguments))}stash(){return this._runTask(Re(["stash",...Ie(arguments)]),oe(arguments))}status(){return this._runTask(OR(Ie(arguments)),oe(arguments))}},Object.assign(_c.prototype,MI(),kR(),WI(),EI(),BI(),zI(),OI(),uR(),SR(),_R())}}),Nw={};de(Nw,{Scheduler:()=>$w});var Xg,$w,DR=R({"src/lib/runners/scheduler.ts"(){"use strict";q(),zy(),Xg=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,Dw.createDeferred)();return{promise:t,done:r,id:e}}})(),$w=class{constructor(e=2){this.concurrency=e,this.logger=Gc("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=Ye(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),vo(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=Ye(this.pending,Xg());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),Fw={};de(Fw,{applyPatchTask:()=>$R});function $R(e,t){return Re(["apply",...t,...e])}var FR=R({"src/lib/tasks/apply-patch.ts"(){"use strict";ue()}});function PR(e,t){return{branch:e,hash:t,success:!0}}function MR(e){return{branch:e,hash:null,success:!1}}var Pw,jR=R({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Pw=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Mw(e,t){return t===1&&Ic.test(e)}var Jg,Ic,Qg,ko,UR=R({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";jR(),q(),Jg=/(\S+)\s+\(\S+\s([^)]+)\)/,Ic=/^error[^']+'([^']+)'/m,Qg=[new V(Jg,(e,[t,r])=>{let n=PR(t,r);e.all.push(n),e.branches[t]=n}),new V(Ic,(e,[t])=>{let r=MR(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],ko=(e,t)=>$e(new Pw,Qg,[e,t])}}),jw,BR=R({"src/lib/responses/BranchSummary.ts"(){"use strict";jw=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,i){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:i}}}}});function Zg(e){return e?e.charAt(0):""}function Uw(e,t=!1){return $e(new jw,t?[Gw]:Bw,e)}var Bw,Gw,GR=R({"src/lib/parsers/parse-branch.ts"(){"use strict";BR(),q(),Bw=[new V(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,i])=>{e.push(Zg(t),!0,r,n,i)}),new V(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,n,i])=>{e.push(Zg(t),!1,r,n,i)})],Gw=new V(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),qw={};de(qw,{branchLocalTask:()=>VR,branchTask:()=>qR,containsDeleteBranchCommand:()=>Vw,deleteBranchTask:()=>WR,deleteBranchesTask:()=>HR});function Vw(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function qR(e){let t=Vw(e),r=e.includes("--show-current"),n=["branch",...e];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(i,o){return t?ko(i,o).all[0]:Uw(i,r)}}}function VR(){return{format:"utf-8",commands:["branch","-v"],parser(e){return Uw(e)}}}function HR(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return ko(r,n)},onError({exitCode:r,stdOut:n},i,o,a){if(!Mw(String(i),r))return a(i);o(n)}}}function WR(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,i){return ko(n,i).branches[e]},onError({exitCode:n,stdErr:i,stdOut:o},a,c,l){if(!Mw(String(a),n))return l(a);throw new vn(r.parser(Tn(o),Tn(i)),String(a))}};return r}var YR=R({"src/lib/tasks/branch.ts"(){"use strict";Pr(),UR(),GR(),q()}});function zR(e){let t=e.trim().replace(/^["']|["']$/g,"");return t&&(0,Hw.normalize)(t)}var Ww,KR=R({"src/lib/responses/CheckIgnore.ts"(){"use strict";Ww=e=>e.split(/\n/g).map(zR).filter(Boolean)}}),Yw={};de(Yw,{checkIgnoreTask:()=>XR});function XR(e){return{commands:["check-ignore",...e],format:"utf-8",parser:Ww}}var JR=R({"src/lib/tasks/check-ignore.ts"(){"use strict";KR()}});function QR(e,t){return $e({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},zw,[e,t])}var zw,ZR=R({"src/lib/parsers/parse-fetch.ts"(){"use strict";q(),zw=[new V(/From (.+)$/,(e,[t])=>{e.remote=t}),new V(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new V(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new V(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new V(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,i])=>{e.updated.push({name:n,tracking:i,to:r,from:t})})]}}),Kw={};de(Kw,{fetchTask:()=>tk});function ek(e){return/^--upload-pack(=|$)/.test(e)}function tk(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(ek)?De("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:QR}}var rk=R({"src/lib/tasks/fetch.ts"(){"use strict";ZR(),ue()}});function nk(e){return $e({moves:[]},Xw,e)}var Xw,ik=R({"src/lib/parsers/parse-move.ts"(){"use strict";q(),Xw=[new V(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),Jw={};de(Jw,{moveTask:()=>ok});function ok(e,t){return{commands:["mv","-v",...pt(e),t],format:"utf-8",parser:nk}}var sk=R({"src/lib/tasks/move.ts"(){"use strict";ik(),q()}}),Qw={};de(Qw,{pullTask:()=>ak});function ak(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(i,o){return Xc(i,o)},onError(i,o,a,c){let l=mR(Tn(i.stdOut),Tn(i.stdErr));if(l)return c(new vn(l));c(o)}}}var ck=R({"src/lib/tasks/pull.ts"(){"use strict";Pr(),Ew(),q()}});function lk(e){let t={};return Zw(e,([r])=>t[r]={name:r}),Object.values(t)}function uk(e){let t={};return Zw(e,([r,n,i])=>{Object.hasOwn(t,r)||(t[r]={name:r,refs:{fetch:"",push:""}}),i&&n&&(t[r].refs[i.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function Zw(e,t){Lc(e,r=>t(r.split(/\s+/)))}var fk=R({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";q()}}),eb={};de(eb,{addRemoteTask:()=>pk,getRemotesTask:()=>dk,listRemotesTask:()=>mk,remoteTask:()=>hk,removeRemoteTask:()=>gk});function pk(e,t,r){return Re(["remote","add",...r,e,t])}function dk(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?uk:lk}}function mk(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),Re(t)}function hk(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),Re(t)}function gk(e){return Re(["remote","remove",e])}var yk=R({"src/lib/tasks/remote.ts"(){"use strict";fk(),ue()}}),tb={};de(tb,{stashListTask:()=>wk});function wk(e={},t){let r=fw(e),n=["stash","list",...r.commands,...t],i=aw(r.splitter,r.fields,Vc(n));return Ro(n)||{commands:n,format:"utf-8",parser:i}}var bk=R({"src/lib/tasks/stash-list.ts"(){"use strict";_n(),lw(),Kc(),pw()}}),rb={};de(rb,{addSubModuleTask:()=>Sk,initSubModuleTask:()=>Ek,subModuleTask:()=>Lo,updateSubModuleTask:()=>xk});function Sk(e,t){return Lo(["add",e,t])}function Ek(e){return Lo(["init",...e])}function Lo(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),Re(t)}function xk(e){return Lo(["update",...e])}var Tk=R({"src/lib/tasks/sub-module.ts"(){"use strict";ue()}});function vk(e,t){let r=Number.isNaN(e),n=Number.isNaN(t);return r!==n?r?1:-1:r?nb(e,t):0}function nb(e,t){return e===t?0:e>t?1:-1}function Ok(e){return e.trim()}function mo(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var ey,ib,Ak=R({"src/lib/responses/TagList.ts"(){"use strict";ey=class{constructor(e,t){this.all=e,this.latest=t}},ib=function(e,t=!1){let r=e.split(`
141
- `).map(Ok).filter(Boolean);t||r.sort(function(i,o){let a=i.split("."),c=o.split(".");if(a.length===1||c.length===1)return vk(mo(a[0]),mo(c[0]));for(let l=0,f=Math.max(a.length,c.length);l<f;l++){let d=nb(mo(a[l]),mo(c[l]));if(d)return d}return 0});let n=t?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new ey(r,n)}}}),ob={};de(ob,{addAnnotatedTagTask:()=>Ik,addTagTask:()=>_k,tagListTask:()=>Ck});function Ck(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return ib(r,t)}}}function _k(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function Ik(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var Rk=R({"src/lib/tasks/tag.ts"(){"use strict";Ak()}}),kk=z_({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(NI(),le(Jy)),{SimpleGitApi:n}=(NR(),le(Lw)),{Scheduler:i}=(DR(),le(Nw)),{adhocExecTask:o,configurationErrorTask:a}=(ue(),le(Ec)),{asArray:c,filterArray:l,filterPrimitives:f,filterString:d,filterStringOrStringArray:u,filterType:m,getTrailingOptions:h,trailingFunctionArgument:w,trailingOptionsArgument:I}=(q(),le(Sy)),{applyPatchTask:P}=(FR(),le(Fw)),{branchTask:j,branchLocalTask:W,deleteBranchesTask:Z,deleteBranchTask:K}=(YR(),le(qw)),{checkIgnoreTask:ee}=(JR(),le(Yw)),{checkIsRepoTask:J}=(vy(),le(Ey)),{cleanWithOptionsTask:fe,isCleanOptionsArray:Ae}=($y(),le(Ny)),{diffSummaryTask:ve}=(Kc(),le(uw)),{fetchTask:nt}=(rk(),le(Kw)),{moveTask:Fe}=(sk(),le(Jw)),{pullTask:Br}=(ck(),le(Qw)),{pushTagsTask:jt}=(Ow(),le(vw)),{addRemoteTask:rr,getRemotesTask:Ut,listRemotesTask:pe,remoteTask:nr,removeRemoteTask:U}=(yk(),le(eb)),{getResetMode:Tt,resetTask:Xe}=(Yy(),le(Vy)),{stashListTask:Gr}=(bk(),le(tb)),{addSubModuleTask:mt,initSubModuleTask:qr,subModuleTask:Bt,updateSubModuleTask:vt}=(Tk(),le(rb)),{addAnnotatedTagTask:ir,addTagTask:Ce,tagListTask:it}=(Rk(),le(ob)),{straightThroughBufferTask:Je,straightThroughStringTask:Se}=(ue(),le(Ec));function L(_,M){this._plugins=M,this._executor=new r(_.baseDir,new i(_.maxConcurrentProcesses),M),this._trimmed=_.trimmed}(L.prototype=Object.create(n.prototype)).constructor=L,L.prototype.customBinary=function(_){return this._plugins.reconfigure("binary",_),this},L.prototype.env=function(_,M){return arguments.length===1&&typeof _=="object"?this._executor.env=_:(this._executor.env=this._executor.env||{})[_]=M,this},L.prototype.stashList=function(_){return this._runTask(Gr(I(arguments)||{},l(_)&&_||[]),w(arguments))},L.prototype.mv=function(_,M){return this._runTask(Fe(_,M),w(arguments))},L.prototype.checkoutLatestTag=function(_){var M=this;return this.pull(function(){M.tags(function(Q,ye){M.checkout(ye.latest,_)})})},L.prototype.pull=function(_,M,Q,ye){return this._runTask(Br(m(_,d),m(M,d),h(arguments)),w(arguments))},L.prototype.fetch=function(_,M){return this._runTask(nt(m(_,d),m(M,d),h(arguments)),w(arguments))},L.prototype.silent=function(_){return this._runTask(o(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},L.prototype.tags=function(_,M){return this._runTask(it(h(arguments)),w(arguments))},L.prototype.rebase=function(){return this._runTask(Se(["rebase",...h(arguments)]),w(arguments))},L.prototype.reset=function(_){return this._runTask(Xe(Tt(_),h(arguments)),w(arguments))},L.prototype.revert=function(_){let M=w(arguments);return typeof _!="string"?this._runTask(a("Commit must be a string"),M):this._runTask(Se(["revert",...h(arguments,0,!0),_]),M)},L.prototype.addTag=function(_){let M=typeof _=="string"?Ce(_):a("Git.addTag requires a tag name");return this._runTask(M,w(arguments))},L.prototype.addAnnotatedTag=function(_,M){return this._runTask(ir(_,M),w(arguments))},L.prototype.deleteLocalBranch=function(_,M,Q){return this._runTask(K(_,typeof M=="boolean"?M:!1),w(arguments))},L.prototype.deleteLocalBranches=function(_,M,Q){return this._runTask(Z(_,typeof M=="boolean"?M:!1),w(arguments))},L.prototype.branch=function(_,M){return this._runTask(j(h(arguments)),w(arguments))},L.prototype.branchLocal=function(_){return this._runTask(W(),w(arguments))},L.prototype.raw=function(_){let M=!Array.isArray(_),Q=[].slice.call(M?arguments:_,0);for(let Ee=0;Ee<Q.length&&M;Ee++)if(!f(Q[Ee])){Q.splice(Ee,Q.length-Ee);break}Q.push(...h(arguments,0,!0));var ye=w(arguments);return Q.length?this._runTask(Se(Q,this._trimmed),ye):this._runTask(a("Raw: must supply one or more command to execute"),ye)},L.prototype.submoduleAdd=function(_,M,Q){return this._runTask(mt(_,M),w(arguments))},L.prototype.submoduleUpdate=function(_,M){return this._runTask(vt(h(arguments,!0)),w(arguments))},L.prototype.submoduleInit=function(_,M){return this._runTask(qr(h(arguments,!0)),w(arguments))},L.prototype.subModule=function(_,M){return this._runTask(Bt(h(arguments)),w(arguments))},L.prototype.listRemote=function(){return this._runTask(pe(h(arguments)),w(arguments))},L.prototype.addRemote=function(_,M,Q){return this._runTask(rr(_,M,h(arguments)),w(arguments))},L.prototype.removeRemote=function(_,M){return this._runTask(U(_),w(arguments))},L.prototype.getRemotes=function(_,M){return this._runTask(Ut(_===!0),w(arguments))},L.prototype.remote=function(_,M){return this._runTask(nr(h(arguments)),w(arguments))},L.prototype.tag=function(_,M){let Q=h(arguments);return Q[0]!=="tag"&&Q.unshift("tag"),this._runTask(Se(Q),w(arguments))},L.prototype.updateServerInfo=function(_){return this._runTask(Se(["update-server-info"]),w(arguments))},L.prototype.pushTags=function(_,M){let Q=jt({remote:m(_,d)},h(arguments));return this._runTask(Q,w(arguments))},L.prototype.rm=function(_){return this._runTask(Se(["rm","-f",...c(_)]),w(arguments))},L.prototype.rmKeepLocal=function(_){return this._runTask(Se(["rm","--cached",...c(_)]),w(arguments))},L.prototype.catFile=function(_,M){return this._catFile("utf-8",arguments)},L.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},L.prototype._catFile=function(_,M){var Q=w(M),ye=["cat-file"],Ee=M[0];if(typeof Ee=="string")return this._runTask(a("Git.catFile: options must be supplied as an array of strings"),Q);Array.isArray(Ee)&&ye.push.apply(ye,Ee);let Ot=_==="buffer"?Je(ye):Se(ye);return this._runTask(Ot,Q)},L.prototype.diff=function(_,M){let Q=d(_)?a("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Se(["diff",...h(arguments)]);return this._runTask(Q,w(arguments))},L.prototype.diffSummary=function(){return this._runTask(ve(h(arguments,1)),w(arguments))},L.prototype.applyPatch=function(_){let M=u(_)?P(c(_),h([].slice.call(arguments,1))):a("git.applyPatch requires one or more string patches as the first argument");return this._runTask(M,w(arguments))},L.prototype.revparse=function(){let _=["rev-parse",...h(arguments,!0)];return this._runTask(Se(_,!0),w(arguments))},L.prototype.clean=function(_,M,Q){let ye=Ae(_),Ee=ye&&_.join("")||m(_,d)||"",Ot=h([].slice.call(arguments,ye?1:0));return this._runTask(fe(Ee,Ot),w(arguments))},L.prototype.exec=function(_){let M={commands:[],format:"utf-8",parser(){typeof _=="function"&&_()}};return this._runTask(M)},L.prototype.clearQueue=function(){return this._runTask(o(()=>console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},L.prototype.checkIgnore=function(_,M){return this._runTask(ee(c(m(_,u,[]))),w(arguments))},L.prototype.checkIsRepo=function(_,M){return this._runTask(J(m(_,d)),w(arguments))},t.exports=L}});Pt();var Lk=class extends xt{constructor(e,t){super(void 0,t),this.config=e}};Pt();Pt();var Fr=class extends xt{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Pr();sy();vy();$y();My();Uy();qy();Yy();function Nk(e){return e?[{type:"spawn.before",action(n,i){e.aborted&&i.kill(new Fr(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,i){function o(){i.kill(new Fr(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),i.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function Dk(e={}){return{type:"spawn.args",action(t,{env:r}){for(let n of Cg(t,r))if(e[n.category]!==!0)throw new Fr(void 0,"unsafe",n.message);return t}}}q();function $k(e){let t=xn(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}q();var ty=(0,Dr.deferred)().promise;function Fk({onClose:e=!0,onExit:t=50}={}){function r(){let i=-1,o={close:(0,Dr.deferred)(),closeTimeout:(0,Dr.deferred)(),exit:(0,Dr.deferred)(),exitTimeout:(0,Dr.deferred)()},a=Promise.race([e===!1?ty:o.closeTimeout.promise,t===!1?ty:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(c){i=c,o.close.done()},exit(c){i=c,o.exit.done()},get exitCode(){return i},result:a}}function n(i,o,a){i!==!1&&(i===!0?o.promise:o.promise.then(()=>hc(i))).then(a.done)}return{type:"spawn.after",async action(i,{spawned:o,close:a}){let c=r(),l=!0,f=()=>{l=!1};o.stdout?.on("data",f),o.stderr?.on("data",f),o.on("error",f),o.on("close",d=>c.close(d)),o.on("exit",d=>c.exit(d));try{await c.result,l&&await hc(50),a(c.exitCode)}catch(d){a(c.exitCode,d)}}}}q();var Pk="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",ry="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Mk(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function ny(e,t){if(e.length<1||e.length>2)throw new Fr(void 0,"binary",Pk);if(e.some(Mk))if(t)console.warn(ry);else throw new Fr(void 0,"binary",ry);let[n,i]=e;return{binary:n,prefix:i}}function jk(e,t=["git"],r=!1){let n=ny(pt(t),r);e.on("binary",i=>{n=ny(pt(i),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",i=>n.prefix?[n.prefix,...i]:i)}Pt();function Uk(e){return!!(e.exitCode&&e.stdErr.length)}function Bk(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Gk(e=!1,t=Uk,r=Bk){return(n,i)=>!e&&n||!t(i)?n:r(i)}function iy(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new xt(void 0,n.toString("utf-8"))}:{error:n}}}}q();var qk=class{constructor(){this.plugins=new Set,this.events=new sb.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=Ye(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return pt(e).forEach(r=>r&&this.plugins.add(Ye(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,i=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===e&&(n=o.action(n,i));return n}};q();function Vk(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,a){return r.includes(a.method)?py(o,t):o}},{type:"spawn.after",action(o,a){a.commands.includes(t)&&a.spawned.stderr?.on("data",c=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));l&&e({method:a.method,stage:Hk(l[1]),progress:te(l[2]),processed:te(l[3]),total:te(l[4])})})}}]}function Hk(e){return String(e.toLowerCase().split(" ",1))||"unknown"}q();function Wk(e){let t=my(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function Yk({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,i){let o;function a(){o&&clearTimeout(o),o=setTimeout(l,e)}function c(){i.spawned.stdout?.off("data",a),i.spawned.stderr?.off("data",a),i.spawned.off("exit",c),i.spawned.off("close",c),o&&clearTimeout(o)}function l(){c(),i.kill(new Fr(void 0,"timeout","block timeout reached"))}r&&i.spawned.stdout?.on("data",a),t&&i.spawned.stderr?.on("data",a),i.spawned.on("exit",c),i.spawned.on("close",c),a()}}}function zk(){return{type:"spawn.args",action(e){let t=[],r;function n(i){(r=r||[]).push(...i)}for(let i=0;i<e.length;i++){let o=e[i];if(Ve(o)){n(Lr(o));continue}if(o==="--"){n(e.slice(i+1).flatMap(a=>Ve(a)&&Lr(a)||a));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}q();var Kk=kk();function Xk(e,t){let r=new qk,n=wy(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Nc(n.baseDir))throw new Lk(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add($k(n.config)),r.add(Dk(n.unsafe)),r.add(Fk(n.completion)),n.abort&&r.add(Nk(n.abort)),n.progress&&r.add(Vk(n.progress)),n.timeout&&r.add(Yk(n.timeout)),n.spawnOptions&&r.add(Wk(n.spawnOptions)),r.add(zk()),r.add(iy(Gk(!0))),n.errors&&r.add(iy(n.errors)),jk(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Kk(n,r)}Pr();var ab=Xk;var cb=X(require("path"),1);var{CONFIG_DIR:Jk}=Gt,Qk=cb.default.join(Jk,"tags.yml");var Sl=require("fs/promises"),rE=X(require("path"),1);function tr(e,t){ie.warn(`no feedback impl - ${e} - ${t}`)}var Zc=class{constructor(t,r){this.message=t,r&&this.start(t)}set text(t){return this.message=t,this}start(t){return tr("start",t),this}succeed(t){return tr("succeed",t),this}stop(t){return tr("stop",t),this}info(t){return tr("info",t),this}progress(t,r,n){return tr("progress",`${t}/${r} ${n}`),this.message=n,this}fail(t){return tr("fail",t),this}warn(t){return tr("warn",t),this}},Zk=new Zc("No feedback implementation");var lb={name:"imdone-cli",version:"0.76.0",author:"Jesse Piascik",description:"Turn Jira or GitHub issues into a local Markdown workspace for AI and humans, synced back to your provider.",license:"Proprietary",homepage:"https://imdone.io/docs/imdone-cli",preferGlobal:!0,engines:{node:">=22.0.0"},main:"./dist/index.min.cjs",type:"module",bin:{imdone:"./dist/index.min.cjs","imdone-cli":"./dist/index.min.cjs","imdone-debug":"./dist/index.cjs"},files:["dist","LICENSE","README.md","CHANGELOG.md",".npmignore"],scripts:{prepublishOnly:"node scripts/prepublish-only.mjs",link:"npm link ../../imdone-core ../../imdone-api",clean:"rm -rf dist/","build-bundle":"npm run clean && node esbuild.config.js && cp -R public/ dist/ && cp README.md dist/ && cp CHANGELOG.md dist/ && cp src/adapters/jwt-public.pem dist/",build:"SKIP_BACKLOG_COPY=1 ./build.sh","build:no-test":"SKIP_TESTS=1 SKIP_BACKLOG_COPY=1 ./build.sh","build:with-backlog":"./build.sh","install:global":"npm run build:no-test && npm install -g .","pack:share":"npm run build:no-test && npm pack && node scripts/show-install-command.mjs","pack:share:with-backlog":"SKIP_TESTS=1 ./build.sh && npm pack && node scripts/show-install-command.mjs","package:macos-arm64":"npm run build:no-test && node scripts/package-macos-arm64.mjs","package:macos-arm64:no-build":"node scripts/package-macos-arm64.mjs","deploy:macos-arm64":"node scripts/deploy-macos-arm64-package.mjs","deploy:macos-arm64:dry-run":"node scripts/deploy-macos-arm64-package.mjs --dry-run",coverage:"vitest --run --coverage",test:"vitest --run","test-ci":"vitest --run","version:patch":'npm version patch --no-git-tag-version && git -C .. add cli-package/package.json cli-package/package-lock.json && git -C .. commit -m "Update version"',"version:minor":'npm version minor --no-git-tag-version && git -C .. add cli-package/package.json cli-package/package-lock.json && git -C .. commit -m "Update version"',"version:major":'npm version major --no-git-tag-version && git -C .. add cli-package/package.json cli-package/package-lock.json && git -C .. commit -m "Update version"'},overrides:{"chrono-node":"2.7.8","gray-matter":"2.0.1",monquery:"https://github.com/imdone/node-monquery/archive/refs/tags/0.2.2.tar.gz"},dependencies:{"@inquirer/prompts":"^7.10.1",chalk:"^5.4.1",commander:"^13.1.0",dotenv:"16.4.5",execa:"^9.5.3","find-up-simple":"^1.0.1","imdone-core":"^2.3.2","js-yaml":"^4.1.0",jsonwebtoken:"^9.0.2",markdownlint:"^0.38.0",open:"^9.1.0",ora:"^8.2.0",semver:"^7.7.2","simple-git":"^3.27.0",yaml:"^2.8.1"},devDependencies:{"@vitest/coverage-v8":"^4.1.2",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",glob:"^12.0.0",vitest:"^4.1.2"}};var tE=require("node:module"),c1=X(eE(),1),{name:j6,version:l1,engines:U6,description:B6}=lb,G6=(0,tE.createRequire)(__filename);var{CONFIG_FILE_YML:n9}=Gt;async function nE(e,t=["."]){let r=await m1(e,t),n=r?.files?.filter(i=>i.path!==".imdonepause")||[];return ie.debug("hasLocalChanges: ",{projectPath:e,fileSpec:t,relevantFiles:n,totalFiles:r?.files?.length}),n.length>0}function u1(e){return e==="."||e===""||e.startsWith(":")||/[*?[\\\]]/.test(e)}async function f1(e,t){let r=iE(e);try{return await r.raw(["ls-files","--error-unmatch","--",t]),!0}catch{return!1}}async function p1(e,t=["."]){let r=[];for(let n of t){if(u1(n)){r.push(n);continue}try{await(0,Sl.access)(rE.default.join(e,n),Gt.F_OK),r.push(n);continue}catch{}await f1(e,n)?r.push(n):ie.debug("Skipping missing git pathspec",{projectPath:e,spec:n})}return r}function d1(){return{not_added:[],conflicted:[],created:[],deleted:[],ignored:void 0,modified:[],renamed:[],files:[],staged:[],ahead:0,behind:0,current:null,tracking:null,detached:!1,isClean(){return!0}}}async function m1(e,t=["."]){let r=iE(e),n=await p1(e,t);return n.length===0?(ie.debug("No matching files for git status:",{projectPath:e,fileSpec:t}),d1()):await r.status(n)}function iE(e){return ab({baseDir:e,timeout:{block:3e4,stash:6e4,commit:45e3}})}async function oE(e){try{return await Or("git",["-C",e,"rev-parse"]),!0}catch{return!1}}async function aE(e){try{return e.fullBacklogDir?await Qe(e.fullBacklogDir)?{hasChanges:await nE(e.projectPath,[e.backlogDir]),backlogDir:e.backlogDir}:{hasChanges:!1}:{hasChanges:!1}}catch(t){return process.stderr.write(`Warning: Could not check git status: ${t.message}
141
+ `).map(Ok).filter(Boolean);t||r.sort(function(i,o){let a=i.split("."),c=o.split(".");if(a.length===1||c.length===1)return vk(mo(a[0]),mo(c[0]));for(let l=0,f=Math.max(a.length,c.length);l<f;l++){let d=nb(mo(a[l]),mo(c[l]));if(d)return d}return 0});let n=t?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new ey(r,n)}}}),ob={};de(ob,{addAnnotatedTagTask:()=>Ik,addTagTask:()=>_k,tagListTask:()=>Ck});function Ck(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return ib(r,t)}}}function _k(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function Ik(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var Rk=R({"src/lib/tasks/tag.ts"(){"use strict";Ak()}}),kk=z_({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(NI(),le(Jy)),{SimpleGitApi:n}=(NR(),le(Lw)),{Scheduler:i}=(DR(),le(Nw)),{adhocExecTask:o,configurationErrorTask:a}=(ue(),le(Ec)),{asArray:c,filterArray:l,filterPrimitives:f,filterString:d,filterStringOrStringArray:u,filterType:m,getTrailingOptions:h,trailingFunctionArgument:w,trailingOptionsArgument:I}=(q(),le(Sy)),{applyPatchTask:P}=(FR(),le(Fw)),{branchTask:j,branchLocalTask:W,deleteBranchesTask:Z,deleteBranchTask:K}=(YR(),le(qw)),{checkIgnoreTask:ee}=(JR(),le(Yw)),{checkIsRepoTask:J}=(vy(),le(Ey)),{cleanWithOptionsTask:fe,isCleanOptionsArray:Ae}=($y(),le(Ny)),{diffSummaryTask:ve}=(Kc(),le(uw)),{fetchTask:nt}=(rk(),le(Kw)),{moveTask:Fe}=(sk(),le(Jw)),{pullTask:Br}=(ck(),le(Qw)),{pushTagsTask:jt}=(Ow(),le(vw)),{addRemoteTask:rr,getRemotesTask:Ut,listRemotesTask:pe,remoteTask:nr,removeRemoteTask:U}=(yk(),le(eb)),{getResetMode:Tt,resetTask:Xe}=(Yy(),le(Vy)),{stashListTask:Gr}=(bk(),le(tb)),{addSubModuleTask:mt,initSubModuleTask:qr,subModuleTask:Bt,updateSubModuleTask:vt}=(Tk(),le(rb)),{addAnnotatedTagTask:ir,addTagTask:Ce,tagListTask:it}=(Rk(),le(ob)),{straightThroughBufferTask:Je,straightThroughStringTask:Se}=(ue(),le(Ec));function L(_,M){this._plugins=M,this._executor=new r(_.baseDir,new i(_.maxConcurrentProcesses),M),this._trimmed=_.trimmed}(L.prototype=Object.create(n.prototype)).constructor=L,L.prototype.customBinary=function(_){return this._plugins.reconfigure("binary",_),this},L.prototype.env=function(_,M){return arguments.length===1&&typeof _=="object"?this._executor.env=_:(this._executor.env=this._executor.env||{})[_]=M,this},L.prototype.stashList=function(_){return this._runTask(Gr(I(arguments)||{},l(_)&&_||[]),w(arguments))},L.prototype.mv=function(_,M){return this._runTask(Fe(_,M),w(arguments))},L.prototype.checkoutLatestTag=function(_){var M=this;return this.pull(function(){M.tags(function(Q,ye){M.checkout(ye.latest,_)})})},L.prototype.pull=function(_,M,Q,ye){return this._runTask(Br(m(_,d),m(M,d),h(arguments)),w(arguments))},L.prototype.fetch=function(_,M){return this._runTask(nt(m(_,d),m(M,d),h(arguments)),w(arguments))},L.prototype.silent=function(_){return this._runTask(o(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},L.prototype.tags=function(_,M){return this._runTask(it(h(arguments)),w(arguments))},L.prototype.rebase=function(){return this._runTask(Se(["rebase",...h(arguments)]),w(arguments))},L.prototype.reset=function(_){return this._runTask(Xe(Tt(_),h(arguments)),w(arguments))},L.prototype.revert=function(_){let M=w(arguments);return typeof _!="string"?this._runTask(a("Commit must be a string"),M):this._runTask(Se(["revert",...h(arguments,0,!0),_]),M)},L.prototype.addTag=function(_){let M=typeof _=="string"?Ce(_):a("Git.addTag requires a tag name");return this._runTask(M,w(arguments))},L.prototype.addAnnotatedTag=function(_,M){return this._runTask(ir(_,M),w(arguments))},L.prototype.deleteLocalBranch=function(_,M,Q){return this._runTask(K(_,typeof M=="boolean"?M:!1),w(arguments))},L.prototype.deleteLocalBranches=function(_,M,Q){return this._runTask(Z(_,typeof M=="boolean"?M:!1),w(arguments))},L.prototype.branch=function(_,M){return this._runTask(j(h(arguments)),w(arguments))},L.prototype.branchLocal=function(_){return this._runTask(W(),w(arguments))},L.prototype.raw=function(_){let M=!Array.isArray(_),Q=[].slice.call(M?arguments:_,0);for(let Ee=0;Ee<Q.length&&M;Ee++)if(!f(Q[Ee])){Q.splice(Ee,Q.length-Ee);break}Q.push(...h(arguments,0,!0));var ye=w(arguments);return Q.length?this._runTask(Se(Q,this._trimmed),ye):this._runTask(a("Raw: must supply one or more command to execute"),ye)},L.prototype.submoduleAdd=function(_,M,Q){return this._runTask(mt(_,M),w(arguments))},L.prototype.submoduleUpdate=function(_,M){return this._runTask(vt(h(arguments,!0)),w(arguments))},L.prototype.submoduleInit=function(_,M){return this._runTask(qr(h(arguments,!0)),w(arguments))},L.prototype.subModule=function(_,M){return this._runTask(Bt(h(arguments)),w(arguments))},L.prototype.listRemote=function(){return this._runTask(pe(h(arguments)),w(arguments))},L.prototype.addRemote=function(_,M,Q){return this._runTask(rr(_,M,h(arguments)),w(arguments))},L.prototype.removeRemote=function(_,M){return this._runTask(U(_),w(arguments))},L.prototype.getRemotes=function(_,M){return this._runTask(Ut(_===!0),w(arguments))},L.prototype.remote=function(_,M){return this._runTask(nr(h(arguments)),w(arguments))},L.prototype.tag=function(_,M){let Q=h(arguments);return Q[0]!=="tag"&&Q.unshift("tag"),this._runTask(Se(Q),w(arguments))},L.prototype.updateServerInfo=function(_){return this._runTask(Se(["update-server-info"]),w(arguments))},L.prototype.pushTags=function(_,M){let Q=jt({remote:m(_,d)},h(arguments));return this._runTask(Q,w(arguments))},L.prototype.rm=function(_){return this._runTask(Se(["rm","-f",...c(_)]),w(arguments))},L.prototype.rmKeepLocal=function(_){return this._runTask(Se(["rm","--cached",...c(_)]),w(arguments))},L.prototype.catFile=function(_,M){return this._catFile("utf-8",arguments)},L.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},L.prototype._catFile=function(_,M){var Q=w(M),ye=["cat-file"],Ee=M[0];if(typeof Ee=="string")return this._runTask(a("Git.catFile: options must be supplied as an array of strings"),Q);Array.isArray(Ee)&&ye.push.apply(ye,Ee);let Ot=_==="buffer"?Je(ye):Se(ye);return this._runTask(Ot,Q)},L.prototype.diff=function(_,M){let Q=d(_)?a("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Se(["diff",...h(arguments)]);return this._runTask(Q,w(arguments))},L.prototype.diffSummary=function(){return this._runTask(ve(h(arguments,1)),w(arguments))},L.prototype.applyPatch=function(_){let M=u(_)?P(c(_),h([].slice.call(arguments,1))):a("git.applyPatch requires one or more string patches as the first argument");return this._runTask(M,w(arguments))},L.prototype.revparse=function(){let _=["rev-parse",...h(arguments,!0)];return this._runTask(Se(_,!0),w(arguments))},L.prototype.clean=function(_,M,Q){let ye=Ae(_),Ee=ye&&_.join("")||m(_,d)||"",Ot=h([].slice.call(arguments,ye?1:0));return this._runTask(fe(Ee,Ot),w(arguments))},L.prototype.exec=function(_){let M={commands:[],format:"utf-8",parser(){typeof _=="function"&&_()}};return this._runTask(M)},L.prototype.clearQueue=function(){return this._runTask(o(()=>console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},L.prototype.checkIgnore=function(_,M){return this._runTask(ee(c(m(_,u,[]))),w(arguments))},L.prototype.checkIsRepo=function(_,M){return this._runTask(J(m(_,d)),w(arguments))},t.exports=L}});Pt();var Lk=class extends xt{constructor(e,t){super(void 0,t),this.config=e}};Pt();Pt();var Fr=class extends xt{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Pr();sy();vy();$y();My();Uy();qy();Yy();function Nk(e){return e?[{type:"spawn.before",action(n,i){e.aborted&&i.kill(new Fr(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,i){function o(){i.kill(new Fr(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),i.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function Dk(e={}){return{type:"spawn.args",action(t,{env:r}){for(let n of Cg(t,r))if(e[n.category]!==!0)throw new Fr(void 0,"unsafe",n.message);return t}}}q();function $k(e){let t=xn(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}q();var ty=(0,Dr.deferred)().promise;function Fk({onClose:e=!0,onExit:t=50}={}){function r(){let i=-1,o={close:(0,Dr.deferred)(),closeTimeout:(0,Dr.deferred)(),exit:(0,Dr.deferred)(),exitTimeout:(0,Dr.deferred)()},a=Promise.race([e===!1?ty:o.closeTimeout.promise,t===!1?ty:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(c){i=c,o.close.done()},exit(c){i=c,o.exit.done()},get exitCode(){return i},result:a}}function n(i,o,a){i!==!1&&(i===!0?o.promise:o.promise.then(()=>hc(i))).then(a.done)}return{type:"spawn.after",async action(i,{spawned:o,close:a}){let c=r(),l=!0,f=()=>{l=!1};o.stdout?.on("data",f),o.stderr?.on("data",f),o.on("error",f),o.on("close",d=>c.close(d)),o.on("exit",d=>c.exit(d));try{await c.result,l&&await hc(50),a(c.exitCode)}catch(d){a(c.exitCode,d)}}}}q();var Pk="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",ry="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Mk(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function ny(e,t){if(e.length<1||e.length>2)throw new Fr(void 0,"binary",Pk);if(e.some(Mk))if(t)console.warn(ry);else throw new Fr(void 0,"binary",ry);let[n,i]=e;return{binary:n,prefix:i}}function jk(e,t=["git"],r=!1){let n=ny(pt(t),r);e.on("binary",i=>{n=ny(pt(i),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",i=>n.prefix?[n.prefix,...i]:i)}Pt();function Uk(e){return!!(e.exitCode&&e.stdErr.length)}function Bk(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Gk(e=!1,t=Uk,r=Bk){return(n,i)=>!e&&n||!t(i)?n:r(i)}function iy(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new xt(void 0,n.toString("utf-8"))}:{error:n}}}}q();var qk=class{constructor(){this.plugins=new Set,this.events=new sb.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=Ye(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return pt(e).forEach(r=>r&&this.plugins.add(Ye(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,i=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===e&&(n=o.action(n,i));return n}};q();function Vk(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,a){return r.includes(a.method)?py(o,t):o}},{type:"spawn.after",action(o,a){a.commands.includes(t)&&a.spawned.stderr?.on("data",c=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));l&&e({method:a.method,stage:Hk(l[1]),progress:te(l[2]),processed:te(l[3]),total:te(l[4])})})}}]}function Hk(e){return String(e.toLowerCase().split(" ",1))||"unknown"}q();function Wk(e){let t=my(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function Yk({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,i){let o;function a(){o&&clearTimeout(o),o=setTimeout(l,e)}function c(){i.spawned.stdout?.off("data",a),i.spawned.stderr?.off("data",a),i.spawned.off("exit",c),i.spawned.off("close",c),o&&clearTimeout(o)}function l(){c(),i.kill(new Fr(void 0,"timeout","block timeout reached"))}r&&i.spawned.stdout?.on("data",a),t&&i.spawned.stderr?.on("data",a),i.spawned.on("exit",c),i.spawned.on("close",c),a()}}}function zk(){return{type:"spawn.args",action(e){let t=[],r;function n(i){(r=r||[]).push(...i)}for(let i=0;i<e.length;i++){let o=e[i];if(Ve(o)){n(Lr(o));continue}if(o==="--"){n(e.slice(i+1).flatMap(a=>Ve(a)&&Lr(a)||a));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}q();var Kk=kk();function Xk(e,t){let r=new qk,n=wy(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Nc(n.baseDir))throw new Lk(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add($k(n.config)),r.add(Dk(n.unsafe)),r.add(Fk(n.completion)),n.abort&&r.add(Nk(n.abort)),n.progress&&r.add(Vk(n.progress)),n.timeout&&r.add(Yk(n.timeout)),n.spawnOptions&&r.add(Wk(n.spawnOptions)),r.add(zk()),r.add(iy(Gk(!0))),n.errors&&r.add(iy(n.errors)),jk(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Kk(n,r)}Pr();var ab=Xk;var cb=X(require("path"),1);var{CONFIG_DIR:Jk}=Gt,Qk=cb.default.join(Jk,"tags.yml");var Sl=require("fs/promises"),rE=X(require("path"),1);function tr(e,t){ie.warn(`no feedback impl - ${e} - ${t}`)}var Zc=class{constructor(t,r){this.message=t,r&&this.start(t)}set text(t){return this.message=t,this}start(t){return tr("start",t),this}succeed(t){return tr("succeed",t),this}stop(t){return tr("stop",t),this}info(t){return tr("info",t),this}progress(t,r,n){return tr("progress",`${t}/${r} ${n}`),this.message=n,this}fail(t){return tr("fail",t),this}warn(t){return tr("warn",t),this}},Zk=new Zc("No feedback implementation");var lb={name:"imdone-cli",version:"0.77.0",author:"Jesse Piascik",description:"Turn Jira or GitHub issues into a local Markdown workspace for AI and humans, synced back to your provider.",license:"Proprietary",homepage:"https://imdone.io/docs/imdone-cli",preferGlobal:!0,engines:{node:">=22.0.0"},main:"./dist/index.min.cjs",type:"module",bin:{imdone:"./dist/index.min.cjs","imdone-cli":"./dist/index.min.cjs","imdone-debug":"./dist/index.cjs"},files:["dist","LICENSE","README.md","CHANGELOG.md",".npmignore"],scripts:{prepublishOnly:"node scripts/prepublish-only.mjs",link:"npm link ../../imdone-core ../../imdone-api",clean:"rm -rf dist/","build-bundle":"npm run clean && node esbuild.config.js && cp -R public/ dist/ && cp README.md dist/ && cp CHANGELOG.md dist/ && cp src/adapters/jwt-public.pem dist/",build:"SKIP_BACKLOG_COPY=1 ./build.sh","build:no-test":"SKIP_TESTS=1 SKIP_BACKLOG_COPY=1 ./build.sh","build:with-backlog":"./build.sh","install:global":"npm run build:no-test && npm install -g .","pack:share":"npm run build:no-test && npm pack && node scripts/show-install-command.mjs","pack:share:with-backlog":"SKIP_TESTS=1 ./build.sh && npm pack && node scripts/show-install-command.mjs","package:macos-arm64":"npm run build:no-test && node scripts/package-macos-arm64.mjs","package:macos-arm64:no-build":"node scripts/package-macos-arm64.mjs","deploy:macos-arm64":"node scripts/deploy-macos-arm64-package.mjs","deploy:macos-arm64:dry-run":"node scripts/deploy-macos-arm64-package.mjs --dry-run",coverage:"vitest --run --coverage",test:"vitest --run","test-ci":"vitest --run","version:patch":'npm version patch --no-git-tag-version && git -C .. add cli-package/package.json cli-package/package-lock.json && git -C .. commit -m "Update version"',"version:minor":'npm version minor --no-git-tag-version && git -C .. add cli-package/package.json cli-package/package-lock.json && git -C .. commit -m "Update version"',"version:major":'npm version major --no-git-tag-version && git -C .. add cli-package/package.json cli-package/package-lock.json && git -C .. commit -m "Update version"'},overrides:{"chrono-node":"2.7.8","gray-matter":"2.0.1",monquery:"https://github.com/imdone/node-monquery/archive/refs/tags/0.2.2.tar.gz"},dependencies:{"@inquirer/prompts":"^7.10.1",chalk:"^5.4.1",commander:"^13.1.0",dotenv:"16.4.5",execa:"^9.5.3","find-up-simple":"^1.0.1","imdone-core":"^2.3.2","js-yaml":"^4.1.0",jsonwebtoken:"^9.0.2",markdownlint:"^0.38.0",open:"^9.1.0",ora:"^8.2.0",semver:"^7.7.2","simple-git":"^3.27.0",yaml:"^2.8.1"},devDependencies:{"@vitest/coverage-v8":"^4.1.2",esbuild:"^0.28.1","esbuild-plugin-copy":"^2.1.1",glob:"^12.0.0",vitest:"^4.1.2"}};var tE=require("node:module"),c1=X(eE(),1),{name:j6,version:l1,engines:U6,description:B6}=lb,G6=(0,tE.createRequire)(__filename);var{CONFIG_FILE_YML:n9}=Gt;async function nE(e,t=["."]){let r=await m1(e,t),n=r?.files?.filter(i=>i.path!==".imdonepause")||[];return ie.debug("hasLocalChanges: ",{projectPath:e,fileSpec:t,relevantFiles:n,totalFiles:r?.files?.length}),n.length>0}function u1(e){return e==="."||e===""||e.startsWith(":")||/[*?[\\\]]/.test(e)}async function f1(e,t){let r=iE(e);try{return await r.raw(["ls-files","--error-unmatch","--",t]),!0}catch{return!1}}async function p1(e,t=["."]){let r=[];for(let n of t){if(u1(n)){r.push(n);continue}try{await(0,Sl.access)(rE.default.join(e,n),Gt.F_OK),r.push(n);continue}catch{}await f1(e,n)?r.push(n):ie.debug("Skipping missing git pathspec",{projectPath:e,spec:n})}return r}function d1(){return{not_added:[],conflicted:[],created:[],deleted:[],ignored:void 0,modified:[],renamed:[],files:[],staged:[],ahead:0,behind:0,current:null,tracking:null,detached:!1,isClean(){return!0}}}async function m1(e,t=["."]){let r=iE(e),n=await p1(e,t);return n.length===0?(ie.debug("No matching files for git status:",{projectPath:e,fileSpec:t}),d1()):await r.status(n)}function iE(e){return ab({baseDir:e,timeout:{block:3e4,stash:6e4,commit:45e3}})}async function oE(e){try{return await Or("git",["-C",e,"rev-parse"]),!0}catch{return!1}}async function aE(e){try{return e.fullBacklogDir?await Qe(e.fullBacklogDir)?{hasChanges:await nE(e.projectPath,[e.backlogDir]),backlogDir:e.backlogDir}:{hasChanges:!1}:{hasChanges:!1}}catch(t){return process.stderr.write(`Warning: Could not check git status: ${t.message}
142
142
  `),{hasChanges:!1}}}function h1(){return process.env.npm_config_global==="true"?process.env.INIT_CWD||process.env.HOME||process.cwd():process.env.PWD||process.env.INIT_CWD||process.cwd()}async function cE(){process.stdout.write(`
143
143
  \u{1F50D} Checking for backlog changes...
144
144
  `);try{let e=h1(),t=new ao;if(await t.load(e),!await oE(t.projectPath)){process.stdout.write(`\u2139\uFE0F Not in a git repository, skipping backlog check