imdone-cli 0.74.0 → 0.74.1

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.
@@ -165,7 +165,7 @@ If you intentionally moved the secret to a different vault, rerun with \`IMDONE_
165
165
  `){return e.split(r).reduce((n,i)=>{let o=t?i.trim():i;return o&&n.push(o),n},[])}function ml(e,t){return In(e,!0).map(r=>t(r))}function hl(e){return(0,Mo.exists)(e,Mo.FOLDER)}function ke(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function xx(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function Po(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function Je(e){return Array.isArray(e)?e:[e]}function bx(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Mr(e){return Je(e).map(t=>t instanceof String?t:String(t))}function F(e,t=0){if(e==null)return t;let r=parseInt(e,10);return Number.isNaN(r)?t:r}function Cn(e,t){let r=[];for(let n=0,i=e.length;n<i;n++)r.push(t,e[n]);return r}function _n(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Ex(e,t){let r={};return t.forEach(n=>{e[n]!==void 0&&(r[n]=e[n])}),r}function Jc(e=0){return new Promise(t=>setTimeout(t,e))}function Qc(e){if(e!==!1)return e}var Nr,Yt,Rn,Uo=x({"src/lib/utils/util.ts"(){"use strict";gl(),Nr="\0",Yt=()=>{},Rn=Object.prototype.toString.call.bind(Object.prototype.toString)}});function ne(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function Zc(e,t){let r=Oe(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function jo(e){return!!e&&Rn(e)==="[object Object]"}function Sx(e){return typeof e=="function"}var kn,vx,U,Fo,Bo,gl=x({"src/lib/utils/argument-filters.ts"(){"use strict";Uo(),kn=e=>Array.isArray(e),vx=e=>typeof e=="number",U=e=>typeof e=="string"||Oe(e),Fo=e=>U(e)||Array.isArray(e)&&e.every(U),Bo=e=>e==null||"number|boolean|function".includes(typeof e)?!1:typeof e.length=="number"}}),el,n$=x({"src/lib/utils/exit-codes.ts"(){"use strict";el=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(el||{})}}),No,i$=x({"src/lib/utils/git-output-streams.ts"(){"use strict";No=class Ax{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new Ax(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function o$(){throw new Error("LineParser:useMatches not implemented")}var I,Et,s$=x({"src/lib/utils/line-parser.ts"(){"use strict";I=class{constructor(e,t){this.matches=[],this.useMatches=o$,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))}},Et=class extends I{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 Tx(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...Cx},...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Cx,a$=x({"src/lib/utils/simple-git-options.ts"(){"use strict";Cx={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function yl(e,t=[]){return jo(e)?Object.keys(e).reduce((r,n)=>{let i=e[n];if(Oe(i))r.push(i);else if(Zc(i,["boolean"]))r.push(n+"="+i);else if(Array.isArray(i))for(let o of i)Zc(o,["string","number"])||r.push(n+"="+o);else r.push(n);return r},t):t}function se(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 yl(wl(e),n),r||n.push(...c$(e)),n}function c$(e){let t=typeof Ht(e)=="function";return Mr(ne(Ht(e,t?1:0),kn,[]))}function wl(e){let t=Sx(Ht(e));return ne(Ht(e,t?1:0),jo)}function M(e,t=!0){let r=mx(Ht(e));return t||hx(r)?r:void 0}var l$=x({"src/lib/utils/task-options.ts"(){"use strict";gl(),Uo()}});function tl(e,t){return e(t.stdOut,t.stdErr)}function ge(e,t,r,n=!0){return Je(r).forEach(i=>{for(let o=In(i,n),s=0,a=o.length;s<a;s++){let c=(l=0)=>{if(!(s+l>=a))return o[s+l]};t.some(({parse:l})=>l(c,e))}}),e}var u$=x({"src/lib/utils/task-parser.ts"(){"use strict";Uo()}}),_x={};Y(_x,{ExitCodes:()=>el,GitOutputStreams:()=>No,LineParser:()=>I,NOOP:()=>Yt,NULL:()=>Nr,RemoteLineParser:()=>Et,append:()=>ke,appendTaskOptions:()=>yl,asArray:()=>Je,asCamelCase:()=>bx,asFunction:()=>mx,asNumber:()=>F,asStringArray:()=>Mr,bufferToString:()=>_n,callTaskParser:()=>tl,createInstanceConfig:()=>Tx,delay:()=>Jc,filterArray:()=>kn,filterFunction:()=>Sx,filterHasLength:()=>Bo,filterNumber:()=>vx,filterPlainObject:()=>jo,filterPrimitives:()=>Zc,filterString:()=>U,filterStringOrStringArray:()=>Fo,filterType:()=>ne,first:()=>yx,folderExists:()=>hl,forEachLineWithContent:()=>ml,getTrailingOptions:()=>se,including:()=>xx,isUserFunction:()=>hx,last:()=>Ht,objectToString:()=>Rn,orVoid:()=>Qc,parseStringResponse:()=>ge,pick:()=>Ex,prefixedArray:()=>Cn,remove:()=>Po,splitOn:()=>gx,toLinesWithContent:()=>In,trailingFunctionArgument:()=>M,trailingOptionsArgument:()=>wl});var O=x({"src/lib/utils/index.ts"(){"use strict";gl(),n$(),i$(),s$(),a$(),l$(),u$(),Uo()}}),Ox={};Y(Ox,{CheckRepoActions:()=>rl,checkIsBareRepoTask:()=>Rx,checkIsRepoRootTask:()=>Ix,checkIsRepoTask:()=>f$});function f$(e){switch(e){case"bare":return Rx();case"root":return Ix()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Go,parser:xl}}function Ix(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Go,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Rx(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Go,parser:xl}}function p$(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var rl,Go,xl,kx=x({"src/lib/tasks/check-is-repo.ts"(){"use strict";O(),rl=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(rl||{}),Go=({exitCode:e},t,r,n)=>{if(e===128&&p$(t))return r(Buffer.from("false"));n(t)},xl=e=>e.trim()==="true"}});function d$(e,t){let r=new Lx(e),n=e?Nx:Fx;return In(t).forEach(i=>{let o=i.replace(n,"");r.paths.push(o),(Dx.test(o)?r.folders:r.files).push(o)}),r}var Lx,Fx,Nx,Dx,m$=x({"src/lib/responses/CleanSummary.ts"(){"use strict";O(),Lx=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Fx=/^[a-z]+\s*/i,Nx=/^[a-z]+\s+[a-z]+\s*/i,Dx=/\/$/}}),nl={};Y(nl,{EMPTY_COMMANDS:()=>qo,adhocExecTask:()=>$x,configurationErrorTask:()=>he,isBufferTask:()=>Px,isEmptyTask:()=>Ux,straightThroughBufferTask:()=>Mx,straightThroughStringTask:()=>ae});function $x(e){return{commands:qo,format:"empty",parser:e}}function he(e){return{commands:qo,format:"empty",parser(){throw typeof e=="string"?new px(e):e}}}function ae(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function Mx(e){return{commands:e,format:"buffer",parser(t){return t}}}function Px(e){return e.format==="buffer"}function Ux(e){return e.format==="empty"||!e.commands.length}var qo,G=x({"src/lib/tasks/task.ts"(){"use strict";dx(),qo=[]}}),jx={};Y(jx,{CONFIG_ERROR_INTERACTIVE_MODE:()=>bl,CONFIG_ERROR_MODE_REQUIRED:()=>El,CONFIG_ERROR_UNKNOWN_OPTION:()=>Sl,CleanOptions:()=>Io,cleanTask:()=>Bx,cleanWithOptionsTask:()=>h$,isCleanOptionsArray:()=>g$});function h$(e,t){let{cleanMode:r,options:n,valid:i}=y$(e);return r?i.options?(n.push(...t),n.some(b$)?he(bl):Bx(r,n)):he(Sl+JSON.stringify(e)):he(El)}function Bx(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return d$(e==="n",n)}}}function g$(e){return Array.isArray(e)&&e.every(t=>vl.has(t))}function y$(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(i=>{w$(i)?(t=i,n.cleanMode=!0):n.options=n.options&&x$(r[r.length]=`-${i}`)}),{cleanMode:t,options:r,valid:n}}function w$(e){return e==="f"||e==="n"}function x$(e){return/^-[a-z]$/i.test(e)&&vl.has(e.charAt(1))}function b$(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var bl,El,Sl,Io,vl,Gx=x({"src/lib/tasks/clean.ts"(){"use strict";m$(),O(),G(),bl="Git clean interactive mode is not supported",El='Git clean mode parameter ("n" or "f") is required',Sl="Git clean unknown option found in: ",Io=(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))(Io||{}),vl=new Set(["i",...Mr(Object.values(Io))])}});function E$(e){let t=new Hx;for(let r of qx(e))t.addValue(r.file,String(r.key),r.value);return t}function S$(e,t){let r=null,n=[],i=new Map;for(let o of qx(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 v$(e){return e.replace(/^(file):/,"")}function*qx(e,t=null){let r=e.split("\0");for(let n=0,i=r.length-1;n<i;){let o=v$(r[n++]),s=r[n++],a=t;if(s.includes(`
166
166
  `)){let c=gx(s,`
167
167
  `);a=c[0],s=c[1]}yield{file:o,key:a,value:s}}}var Hx,A$=x({"src/lib/responses/ConfigList.ts"(){"use strict";O(),Hx=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=Ht(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 Yc(e,t){return typeof e=="string"&&Object.hasOwn(il,e)?e:t}function T$(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 C$(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 S$(n,e)}}}function _$(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return E$(r)}}}function O$(){return{addConfig(e,t,...r){return this._runTask(T$(e,t,r[0]===!0,Yc(r[1],"local")),M(arguments))},getConfig(e,t){return this._runTask(C$(e,Yc(t,void 0)),M(arguments))},listConfig(...e){return this._runTask(_$(Yc(e[0],void 0)),M(arguments))}}}var il,Yx=x({"src/lib/tasks/config.ts"(){"use strict";A$(),O(),il=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(il||{})}});function I$(e){return Vx.has(e)}var Vc,Vx,Wx=x({"src/lib/tasks/diff-name-status.ts"(){"use strict";Vc=(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))(Vc||{}),Vx=new Set(Object.values(Vc))}});function R$(...e){return new Kx().param(...e)}function k$(e){let t=new Set,r={};return ml(e,n=>{let[i,o,s]=n.split(Nr);t.add(i),(r[i]=r[i]||[]).push({line:F(o),path:i,preview:s})}),{paths:t,results:r}}function L$(){return{grep(e){let t=M(arguments),r=se(arguments);for(let i of zx)if(r.includes(i))return this._runTask(he(`git.grep: use of "${i}" is not supported.`),t);typeof e=="string"&&(e=R$().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(i){return k$(i)}},t)}}}var zx,Tn,Dw,Kx,Xx=x({"src/lib/tasks/grep.ts"(){"use strict";O(),G(),zx=["-h"],Tn=Symbol("grepQuery"),Kx=class{constructor(){this[Dw]=[]}*[(Dw=Tn,Symbol.iterator)](){for(let e of this[Tn])yield e}and(...e){return e.length&&this[Tn].push("--and","(",...Cn(e,"-e"),")"),this}param(...e){return this[Tn].push(...Cn(e,"-e")),this}}}}),Jx={};Y(Jx,{ResetMode:()=>Ro,getResetMode:()=>N$,resetTask:()=>F$});function F$(e,t){let r=["reset"];return Qx(e)&&r.push(`--${e}`),r.push(...t),ae(r)}function N$(e){if(Qx(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function Qx(e){return typeof e=="string"&&Zx.includes(e)}var Ro,Zx,eb=x({"src/lib/tasks/reset.ts"(){"use strict";O(),G(),Ro=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(Ro||{}),Zx=Mr(Object.values(Ro))}});function D$(){return(0,Do.default)("simple-git")}function $w(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 $$(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 Al(e,t,r,n=D$()){let i=e&&`[${e}]`||"",o=[],s=typeof t=="string"?n.extend(t):t,a=$$(ne(t,U),s,n);return l(r);function c(u,f){return ke(o,Al(e,a.replace(/^[^:]+/,u),f,n))}function l(u){let f=u&&`[${u}]`||"",d=s&&$w(s,f)||Yt,p=$w(n,`${i} ${f}`,d);return Object.assign(s?d:p,{label:e,sibling:c,info:p,step:l})}}var tb=x({"src/lib/git-logger.ts"(){"use strict";O(),Do.default.formatters.L=e=>String(Bo(e)?e.length:"-"),Do.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):Rn(e)}}),rb,M$=x({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";St(),tb(),rb=class ol{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=ol.getName(t.commands[0]),n=Al(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 st(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++ol.counter}`}static{this.counter=0}}}});function qt(e,t){return{method:yx(e.commands)||"",commands:t}}function P$(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function Mw(e,t,r,n){return i=>{r("%s received %L bytes",t,i),n("%B",i),e.push(i)}}var sl,U$=x({"src/lib/runners/git-executor-chain.ts"(){"use strict";St(),G(),O(),M$(),sl=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new rb}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(Ux(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 st?Object.assign(t,{task:e}):new st(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),Px(e)?tl(e.parser,o):tl(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:s,stdErr:a}=r;return new Promise((c,l)=>{n("Preparing to handle process response exitCode=%d stdOut=",i);let{error:u}=this._plugins.exec("task.error",{error:o},{...qt(e,t),...r});if(u&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,u,f=>{n.info("custom error handler treated as success"),n("custom error returned a %s",Rn(f)),c(new No(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(a)))},l);if(u)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,a.length,o),l(u);n.info("retrieving task output complete"),c(new No(Buffer.concat(s),Buffer.concat(a)))})}async gitResponse(e,t,r,n,i){let o=i.sibling("output"),s=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},qt(e,e.commands));return new Promise(a=>{let c=[],l=[];i.info("%s %o",t,r),i("%O",s);let u=this._beforeSpawn(e,r);if(u)return a({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...qt(e,r),kill(d){u=d||u}});let f=(0,nb.spawn)(t,r,s);f.stdout.on("data",Mw(c,"stdOut",i,o.step("stdOut"))),f.stderr.on("data",Mw(l,"stdErr",i,o.step("stdErr"))),f.on("error",P$(l,i)),n&&(i("Passing child process stdOut/stdErr to custom outputHandler"),n(t,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...qt(e,r),spawned:f,close(d,p){a({stdOut:c,stdErr:l,exitCode:d,rejection:u||p})},kill(d){f.killed||(u=d,f.kill("SIGINT"))}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...qt(e,t),kill(n){r=n||r}}),r}}}}),ib={};Y(ib,{GitExecutor:()=>ob});var ob,j$=x({"src/lib/runners/git-executor.ts"(){"use strict";U$(),ob=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new sl(this,this._scheduler,this._plugins)}chain(){return new sl(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function B$(e,t,r=Yt){let n=o=>{r(null,o)},i=o=>{o?.task===e&&r(o instanceof On?G$(o):o,void 0)};t.then(n,i)}function G$(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=Yt};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 q$=x({"src/lib/task-callback.ts"(){"use strict";$r(),O()}});function Pw(e,t){return $x(r=>{if(!hl(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var H$=x({"src/lib/tasks/change-working-directory.ts"(){"use strict";O(),G()}});function Wc(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=Po(t,"-B")),ae(t)}function Y$(){return{checkout(){return this._runTask(Wc(se(arguments,1)),M(arguments))},checkoutBranch(e,t){return this._runTask(Wc(["-b",e,t,...se(arguments)]),M(arguments))},checkoutLocalBranch(e){return this._runTask(Wc(["-b",e,...se(arguments)]),M(arguments))}}}var V$=x({"src/lib/tasks/checkout.ts"(){"use strict";O(),G()}});function W$(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function z$(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return ge(W$(),[sb],e)}})}}}var sb,K$=x({"src/lib/tasks/count-objects.ts"(){"use strict";O(),sb=new I(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=bx(t);Object.hasOwn(e,n)&&(e[n]=F(r))})}});function X$(e){return ge({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},ab,e)}var ab,J$=x({"src/lib/parsers/parse-commit.ts"(){"use strict";O(),ab=[new I(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new I(/\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 I(/(\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 I(/^(\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 Q$(e,t,r){return{commands:["-c","core.abbrev=40","commit",...Cn(e,"-m"),...t,...r],format:"utf-8",parser:X$}}function Z$(){return{commit(t,...r){let n=M(arguments),i=e(t)||Q$(Je(t),Je(ne(r[0],Fo,[])),[...Mr(ne(r[1],kn,[])),...se(arguments,0,!0)]);return this._runTask(i,n)}};function e(t){return!Fo(t)&&he("git.commit: requires the commit message to be supplied as a string/string[]")}}var eM=x({"src/lib/tasks/commit.ts"(){"use strict";J$(),O(),G()}});function tM(){return{firstCommit(){return this._runTask(ae(["rev-list","--max-parents=0","HEAD"],!0),M(arguments))}}}var rM=x({"src/lib/tasks/first-commit.ts"(){"use strict";O(),G()}});function nM(e,t){let r=["hash-object",e];return t&&r.push("-w"),ae(r,!0)}var iM=x({"src/lib/tasks/hash-object.ts"(){"use strict";G()}});function oM(e,t,r){let n=String(r).trim(),i;if(i=cb.exec(n))return new ko(e,t,!1,i[1]);if(i=lb.exec(n))return new ko(e,t,!0,i[1]);let o="",s=n.split(" ");for(;s.length;)if(s.shift()==="in"){o=s.join(" ");break}return new ko(e,t,/^re/i.test(n),o)}var ko,cb,lb,sM=x({"src/lib/responses/InitSummary.ts"(){"use strict";ko=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},cb=/^Init.+ repository in (.+)$/,lb=/^Rein.+ in (.+)$/}});function aM(e){return e.includes(Tl)}function cM(e=!1,t,r){let n=["init",...r];return e&&!aM(n)&&n.splice(1,0,Tl),{commands:n,format:"utf-8",parser(i){return oM(n.includes("--bare"),t,i)}}}var Tl,lM=x({"src/lib/tasks/init.ts"(){"use strict";sM(),Tl="--bare"}});function Cl(e){for(let t=0;t<e.length;t++){let r=_l.exec(e[t]);if(r)return`--${r[1]}`}return""}function uM(e){return _l.test(e)}var _l,Ln=x({"src/lib/args/log-format.ts"(){"use strict";_l=/^--(stat|numstat|name-only|name-status)(=|$)/}}),ub,fM=x({"src/lib/responses/DiffSummary.ts"(){"use strict";ub=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function fb(e=""){let t=pb[e];return r=>ge(new ub,t,r,!1)}var zc,Uw,jw,Bw,pb,db=x({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Ln(),fM(),Wx(),O(),zc=[new I(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:F(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new I(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:F(r),after:F(n),binary:!0})}),new I(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),i=/(\d+) d/.exec(r);e.changed=F(t),e.insertions=F(n?.[1]),e.deletions=F(i?.[1])})],Uw=[new I(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let i=F(t),o=F(r);e.changed++,e.insertions+=i,e.deletions+=o,e.files.push({file:n,changes:i+o,insertions:i,deletions:o,binary:!1})}),new I(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],jw=[new I(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Bw=[new I(/([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:Qc(I$(t)&&t),from:Qc(!!o&&n!==o&&n),similarity:F(r)})})],pb={"":zc,"--stat":zc,"--numstat":Uw,"--name-status":Bw,"--name-only":jw}}});function pM(e,t){return t.reduce((r,n,i)=>(r[n]=e[i]||"",r),Object.create({diff:null}))}function mb(e=Rl,t=hb,r=""){let n=fb(r);return function(i){let o=In(i.trim(),!1,Ol).map(function(s){let a=s.split(Il),c=pM(a[0].split(e),t);return a.length>1&&a[1].trim()&&(c.diff=n(a[1])),c});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}var Ol,Il,Rl,hb,gb=x({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";O(),db(),Ln(),Ol="\xF2\xF2\xF2\xF2\xF2\xF2 ",Il=" \xF2\xF2",Rl=" \xF2 ",hb=["hash","date","message","refs","author_name","author_email"]}}),yb={};Y(yb,{diffSummaryTask:()=>dM,validateLogFormatConfig:()=>Ho});function dM(e){let t=Cl(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),Ho(r)||{commands:r,format:"utf-8",parser:fb(t)}}function Ho(e){let t=e.filter(uM);if(t.length>1)return he(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return he(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var kl=x({"src/lib/tasks/diff.ts"(){"use strict";Ln(),db(),G()}});function mM(e,t){let r=[],n=[];return Object.keys(e).forEach(i=>{r.push(i),n.push(String(e[i]))}),[r,n.join(t)]}function hM(e){return Object.keys(e).reduce((t,r)=>(r in al||(t[r]=e[r]),t),{})}function wb(e={},t=[]){let r=ne(e.splitter,U,Rl),n=jo(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]=mM(n,r),s=[],a=[`--pretty=format:${Ol}${o}${Il}`,...t],c=e.n||e["max-count"]||e.maxCount;if(c&&a.push(`--max-count=${c}`),e.from||e.to){let l=e.symmetric!==!1?"...":"..";s.push(`${e.from||""}${l}${e.to||""}`)}return U(e.file)&&a.push("--follow",Rr(e.file)),yl(hM(e),a),{fields:i,splitter:r,commands:[...a,...s]}}function gM(e,t,r){let n=mb(e,t,Cl(r));return{commands:["log",...r],format:"utf-8",parser:n}}function yM(){return{log(...r){let n=M(arguments),i=wb(wl(arguments),Mr(ne(arguments[0],kn,[]))),o=t(...r)||Ho(i.commands)||e(i);return this._runTask(o,n)}};function e(r){return gM(r.splitter,r.fields,r.commands)}function t(r,n){return U(r)&&U(n)&&he("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var al,xb=x({"src/lib/tasks/log.ts"(){"use strict";Ln(),gb(),O(),G(),kl(),al=(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))(al||{})}}),Lo,bb,wM=x({"src/lib/responses/MergeSummary.ts"(){"use strict";Lo=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},bb=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"}}}}),cl,Eb,xM=x({"src/lib/responses/PullSummary.ts"(){"use strict";cl=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Eb=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Kc(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 Gw(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:F(t&&t[1]||"0"),delta:F(r&&r[1]||"0")}}var Sb,bM=x({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";O(),Sb=[new Et(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),i=Kc(e.remoteMessages);Object.assign(i,{[n]:F(r)})}),new Et(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),i=Kc(e.remoteMessages);Object.assign(i,{[n]:F(r)})}),new Et(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let i=Kc(e.remoteMessages);i.total=Gw(t),i.reused=Gw(r),i.packReused=F(n)})]}});function vb(e,t){return ge({remoteMessages:new Tb},Ab,t)}var Ab,Tb,Cb=x({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";O(),bM(),Ab=[new Et(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Sb,new Et([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new Et([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:F(t),summary:r,url:n}})],Tb=class{constructor(){this.all=[]}}}});function EM(e,t){let r=ge(new Eb,_b,[e,t]);return r.message&&r}var qw,Hw,Yw,Vw,_b,Ww,Ll,Ob=x({"src/lib/parsers/parse-pull.ts"(){"use strict";xM(),O(),Cb(),qw=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Hw=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Yw=/^(create|delete) mode \d+ (.+)/,Vw=[new I(qw,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new I(Hw,(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 I(Yw,(e,[t,r])=>{ke(e.files,r),ke(t==="create"?e.created:e.deleted,r)})],_b=[new I(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new I(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new I(/([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})],Ww=(e,t)=>ge(new cl,Vw,[e,t]),Ll=(e,t)=>Object.assign(new cl,Ww(e,t),vb(e,t))}}),zw,Ib,Kw,SM=x({"src/lib/parsers/parse-merge.ts"(){"use strict";wM(),O(),Ob(),zw=[new I(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new I(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new Lo(t,r))}),new I(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new Lo(t,r,{deleteRef:n}))}),new I(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Lo(t,null))}),new I(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Ib=(e,t)=>Object.assign(Kw(e,t),Ll(e,t)),Kw=e=>ge(new bb,zw,e)}});function Xw(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Ib(t,r);if(n.failed)throw new On(n);return n}}:he("Git.merge requires at least one option")}var vM=x({"src/lib/tasks/merge.ts"(){"use strict";$r(),SM(),G()}});function AM(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 Jw,Rb,Qw,TM=x({"src/lib/parsers/parse-push.ts"(){"use strict";O(),Cb(),Jw=[new I(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new I(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new I(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(AM(t,r,n))}),new I(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:n}}),new I(/^([^:]+):(\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}}})],Rb=(e,t)=>{let r=Qw(e,t),n=vb(e,t);return{...r,...n}},Qw=(e,t)=>ge({pushed:[]},Jw,[e,t])}}),kb={};Y(kb,{pushTagsTask:()=>CM,pushTask:()=>Fl});function CM(e={},t){return ke(t,"--tags"),Fl(e,t)}function Fl(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),Po(r,"-v"),ke(r,"--verbose"),ke(r,"--porcelain"),{commands:r,format:"utf-8",parser:Rb}}var Lb=x({"src/lib/tasks/push.ts"(){"use strict";TM(),O()}});function _M(){return{showBuffer(){let e=["show",...se(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(Mx(e),M(arguments))},show(){let e=["show",...se(arguments,1)];return this._runTask(ae(e),M(arguments))}}}var OM=x({"src/lib/tasks/show.ts"(){"use strict";O(),G()}}),Zw,Fb,IM=x({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Zw=/^(.+)\0(.+)$/,Fb=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=Zw.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function ex(e){let[t,r]=e.split(Nr);return{from:r||t,to:t}}function Se(e,t,r){return[`${e}${t}`,r]}function Xc(e,...t){return t.map(r=>Se(e,r,(n,i)=>n.conflicted.push(i)))}function RM(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,s){let a=`${i}${o}`,c=Nb.get(a);c&&c(e,s),a!=="##"&&a!=="!!"&&e.files.push(new Fb(s,i,o))}}var tx,Nb,Db,kM=x({"src/lib/responses/StatusSummary.ts"(){"use strict";O(),IM(),tx=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}},Nb=new Map([Se(" ","A",(e,t)=>e.created.push(t)),Se(" ","D",(e,t)=>e.deleted.push(t)),Se(" ","M",(e,t)=>e.modified.push(t)),Se("A"," ",(e,t)=>{e.created.push(t),e.staged.push(t)}),Se("A","M",(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Se("D"," ",(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Se("M"," ",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Se("M","M",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Se("R"," ",(e,t)=>{e.renamed.push(ex(t))}),Se("R","M",(e,t)=>{let r=ex(t);e.renamed.push(r),e.modified.push(r.to)}),Se("!","!",(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Se("?","?",(e,t)=>e.not_added.push(t)),...Xc("A","A","U"),...Xc("D","D","U"),...Xc("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,s=/\son\s(\S+?)(?=\.{3}|$)/,a=r.exec(t);e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=i.exec(t),e.current=ne(a?.[1],U,null),a=o.exec(t),e.tracking=ne(a?.[1],U,null),a=s.exec(t),a&&(e.current=ne(a?.[1],U,e.current)),e.detached=/\(no branch\)/.test(t)}]]),Db=function(e){let t=e.split(Nr),r=new tx;for(let n=0,i=t.length;n<i;){let o=t[n++].trim();o&&(o.charAt(0)==="R"&&(o+=Nr+(t[n++]||"")),RM(r,o))}return r}}});function LM(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!$b.includes(r))],parser(r){return Db(r)}}}var $b,FM=x({"src/lib/tasks/status.ts"(){"use strict";kM(),$b=["--null","-z"]}});function $o(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 NM(){return $o(0,0,0,"",!1)}function DM(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:$M,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(Nl));n(t)}})}}}function $M(e){return e===Nl?NM():ge($o(0,0,0,e),Mb,e)}var Nl,Mb,MM=x({"src/lib/tasks/version.ts"(){"use strict";O(),Nl="installed=false",Mb=[new I(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,i=""])=>{Object.assign(e,$o(F(t),F(r),F(n),i))}),new I(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,i=""])=>{Object.assign(e,$o(F(t),F(r),n,i))})]}});function rx(e,t,r,...n){return U(r)?t(r,ne(n[0],U),se(arguments)):he(`git.${e}() requires a string 'repoPath'`)}function PM(){return{clone(e,...t){return this._runTask(rx("clone",ll,ne(e,U),...t),M(arguments))},mirror(e,...t){return this._runTask(rx("mirror",Pb,ne(e,U),...t),M(arguments))}}}var ll,Pb,UM=x({"src/lib/tasks/clone.ts"(){"use strict";G(),O(),ll=(e,t,r)=>{let n=["clone",...r];return U(e)&&n.push(Rr(e)),U(t)&&n.push(Rr(t)),ae(n)},Pb=(e,t,r)=>(ke(r,"--mirror"),ll(e,t,r))}}),Ub={};Y(Ub,{SimpleGitApi:()=>ul});var ul,jM=x({"src/lib/simple-git-api.ts"(){"use strict";q$(),H$(),V$(),K$(),eM(),Yx(),rM(),Xx(),iM(),lM(),xb(),vM(),Lb(),OM(),FM(),G(),MM(),O(),UM(),ul=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&B$(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(ae(["add",...Je(e)]),M(arguments))}cwd(e){let t=M(arguments);return typeof e=="string"?this._runTask(Pw(e,this._executor),t):typeof e?.path=="string"?this._runTask(Pw(e.path,e.root&&this._executor||void 0),t):this._runTask(he("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(nM(e,t===!0),M(arguments))}init(e){return this._runTask(cM(e===!0,this._executor.cwd,se(arguments)),M(arguments))}merge(){return this._runTask(Xw(se(arguments)),M(arguments))}mergeFromTo(e,t){return U(e)&&U(t)?this._runTask(Xw([e,t,...se(arguments)]),M(arguments,!1)):this._runTask(he("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=Fl({remote:ne(arguments[0],U),branch:ne(arguments[1],U)},se(arguments));return this._runTask(e,M(arguments))}stash(){return this._runTask(ae(["stash",...se(arguments)]),M(arguments))}status(){return this._runTask(LM(se(arguments)),M(arguments))}},Object.assign(ul.prototype,Y$(),PM(),Z$(),O$(),z$(),tM(),L$(),yM(),_M(),DM())}}),jb={};Y(jb,{Scheduler:()=>Gb});var nx,Gb,BM=x({"src/lib/runners/scheduler.ts"(){"use strict";O(),tb(),nx=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,Bb.createDeferred)();return{promise:t,done:r,id:e}}})(),Gb=class{constructor(e=2){this.concurrency=e,this.logger=Al("","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=ke(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Po(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=ke(this.pending,nx());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),qb={};Y(qb,{applyPatchTask:()=>GM});function GM(e,t){return ae(["apply",...t,...e])}var qM=x({"src/lib/tasks/apply-patch.ts"(){"use strict";G()}});function HM(e,t){return{branch:e,hash:t,success:!0}}function YM(e){return{branch:e,hash:null,success:!1}}var Hb,VM=x({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Hb=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Yb(e,t){return t===1&&fl.test(e)}var ix,fl,ox,Yo,WM=x({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";VM(),O(),ix=/(\S+)\s+\(\S+\s([^)]+)\)/,fl=/^error[^']+'([^']+)'/m,ox=[new I(ix,(e,[t,r])=>{let n=HM(t,r);e.all.push(n),e.branches[t]=n}),new I(fl,(e,[t])=>{let r=YM(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Yo=(e,t)=>ge(new Hb,ox,[e,t])}}),Vb,zM=x({"src/lib/responses/BranchSummary.ts"(){"use strict";Vb=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 sx(e){return e?e.charAt(0):""}function Wb(e,t=!1){return ge(new Vb,t?[Kb]:zb,e)}var zb,Kb,KM=x({"src/lib/parsers/parse-branch.ts"(){"use strict";zM(),O(),zb=[new I(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,i])=>{e.push(sx(t),!0,r,n,i)}),new I(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,n,i])=>{e.push(sx(t),!1,r,n,i)})],Kb=new I(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),Xb={};Y(Xb,{branchLocalTask:()=>JM,branchTask:()=>XM,containsDeleteBranchCommand:()=>Jb,deleteBranchTask:()=>ZM,deleteBranchesTask:()=>QM});function Jb(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function XM(e){let t=Jb(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?Yo(i,o).all[0]:Wb(i,r)}}}function JM(){return{format:"utf-8",commands:["branch","-v"],parser(e){return Wb(e)}}}function QM(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return Yo(r,n)},onError({exitCode:r,stdOut:n},i,o,s){if(!Yb(String(i),r))return s(i);o(n)}}}function ZM(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,i){return Yo(n,i).branches[e]},onError({exitCode:n,stdErr:i,stdOut:o},s,a,c){if(!Yb(String(s),n))return c(s);throw new On(r.parser(_n(o),_n(i)),String(s))}};return r}var eP=x({"src/lib/tasks/branch.ts"(){"use strict";$r(),WM(),KM(),O()}});function tP(e){let t=e.trim().replace(/^["']|["']$/g,"");return t&&(0,Qb.normalize)(t)}var Zb,rP=x({"src/lib/responses/CheckIgnore.ts"(){"use strict";Zb=e=>e.split(/\n/g).map(tP).filter(Boolean)}}),eE={};Y(eE,{checkIgnoreTask:()=>nP});function nP(e){return{commands:["check-ignore",...e],format:"utf-8",parser:Zb}}var iP=x({"src/lib/tasks/check-ignore.ts"(){"use strict";rP()}});function oP(e,t){return ge({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},tE,[e,t])}var tE,sP=x({"src/lib/parsers/parse-fetch.ts"(){"use strict";O(),tE=[new I(/From (.+)$/,(e,[t])=>{e.remote=t}),new I(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new I(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new I(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new I(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,i])=>{e.updated.push({name:n,tracking:i,to:r,from:t})})]}}),rE={};Y(rE,{fetchTask:()=>cP});function aP(e){return/^--upload-pack(=|$)/.test(e)}function cP(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(aP)?he("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:oP}}var lP=x({"src/lib/tasks/fetch.ts"(){"use strict";sP(),G()}});function uP(e){return ge({moves:[]},nE,e)}var nE,fP=x({"src/lib/parsers/parse-move.ts"(){"use strict";O(),nE=[new I(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),iE={};Y(iE,{moveTask:()=>pP});function pP(e,t){return{commands:["mv","-v",...Je(e),t],format:"utf-8",parser:uP}}var dP=x({"src/lib/tasks/move.ts"(){"use strict";fP(),O()}}),oE={};Y(oE,{pullTask:()=>mP});function mP(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 Ll(i,o)},onError(i,o,s,a){let c=EM(_n(i.stdOut),_n(i.stdErr));if(c)return a(new On(c));a(o)}}}var hP=x({"src/lib/tasks/pull.ts"(){"use strict";$r(),Ob(),O()}});function gP(e){let t={};return sE(e,([r])=>t[r]={name:r}),Object.values(t)}function yP(e){let t={};return sE(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 sE(e,t){ml(e,r=>t(r.split(/\s+/)))}var wP=x({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";O()}}),aE={};Y(aE,{addRemoteTask:()=>xP,getRemotesTask:()=>bP,listRemotesTask:()=>EP,remoteTask:()=>SP,removeRemoteTask:()=>vP});function xP(e,t,r){return ae(["remote","add",...r,e,t])}function bP(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?yP:gP}}function EP(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),ae(t)}function SP(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),ae(t)}function vP(e){return ae(["remote","remove",e])}var AP=x({"src/lib/tasks/remote.ts"(){"use strict";wP(),G()}}),cE={};Y(cE,{stashListTask:()=>TP});function TP(e={},t){let r=wb(e),n=["stash","list",...r.commands,...t],i=mb(r.splitter,r.fields,Cl(n));return Ho(n)||{commands:n,format:"utf-8",parser:i}}var CP=x({"src/lib/tasks/stash-list.ts"(){"use strict";Ln(),gb(),kl(),xb()}}),lE={};Y(lE,{addSubModuleTask:()=>_P,initSubModuleTask:()=>OP,subModuleTask:()=>Vo,updateSubModuleTask:()=>IP});function _P(e,t){return Vo(["add",e,t])}function OP(e){return Vo(["init",...e])}function Vo(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),ae(t)}function IP(e){return Vo(["update",...e])}var RP=x({"src/lib/tasks/sub-module.ts"(){"use strict";G()}});function kP(e,t){let r=Number.isNaN(e),n=Number.isNaN(t);return r!==n?r?1:-1:r?uE(e,t):0}function uE(e,t){return e===t?0:e>t?1:-1}function LP(e){return e.trim()}function Oo(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var ax,fE,FP=x({"src/lib/responses/TagList.ts"(){"use strict";ax=class{constructor(e,t){this.all=e,this.latest=t}},fE=function(e,t=!1){let r=e.split(`
168
- `).map(LP).filter(Boolean);t||r.sort(function(i,o){let s=i.split("."),a=o.split(".");if(s.length===1||a.length===1)return kP(Oo(s[0]),Oo(a[0]));for(let c=0,l=Math.max(s.length,a.length);c<l;c++){let u=uE(Oo(s[c]),Oo(a[c]));if(u)return u}return 0});let n=t?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new ax(r,n)}}}),pE={};Y(pE,{addAnnotatedTagTask:()=>$P,addTagTask:()=>DP,tagListTask:()=>NP});function NP(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return fE(r,t)}}}function DP(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function $P(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var MP=x({"src/lib/tasks/tag.ts"(){"use strict";FP()}}),PP=t$({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(j$(),B(ib)),{SimpleGitApi:n}=(jM(),B(Ub)),{Scheduler:i}=(BM(),B(jb)),{adhocExecTask:o,configurationErrorTask:s}=(G(),B(nl)),{asArray:a,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:f,filterType:d,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:y}=(O(),B(_x)),{applyPatchTask:h}=(qM(),B(qb)),{branchTask:T,branchLocalTask:S,deleteBranchesTask:V,deleteBranchTask:W}=(eP(),B(Xb)),{checkIgnoreTask:ve}=(iP(),B(eE)),{checkIsRepoTask:ue}=(kx(),B(Ox)),{cleanWithOptionsTask:Ne,isCleanOptionsArray:De}=(Gx(),B(jx)),{diffSummaryTask:Ae}=(kl(),B(yb)),{fetchTask:jr}=(lP(),B(rE)),{moveTask:vt}=(dP(),B(iE)),{pullTask:mv}=(hP(),B(oE)),{pushTagsTask:hv}=(Lb(),B(kb)),{addRemoteTask:gv,getRemotesTask:yv,listRemotesTask:wv,remoteTask:xv,removeRemoteTask:bv}=(AP(),B(aE)),{getResetMode:Ev,resetTask:Sv}=(eb(),B(Jx)),{stashListTask:vv}=(CP(),B(cE)),{addSubModuleTask:Av,initSubModuleTask:Tv,subModuleTask:Cv,updateSubModuleTask:_v}=(RP(),B(lE)),{addAnnotatedTagTask:Ov,addTagTask:Iv,tagListTask:Rv}=(MP(),B(pE)),{straightThroughBufferTask:kv,straightThroughStringTask:Be}=(G(),B(nl));function _(w,A){this._plugins=A,this._executor=new r(w.baseDir,new i(w.maxConcurrentProcesses),A),this._trimmed=w.trimmed}(_.prototype=Object.create(n.prototype)).constructor=_,_.prototype.customBinary=function(w){return this._plugins.reconfigure("binary",w),this},_.prototype.env=function(w,A){return arguments.length===1&&typeof w=="object"?this._executor.env=w:(this._executor.env=this._executor.env||{})[w]=A,this},_.prototype.stashList=function(w){return this._runTask(vv(y(arguments)||{},c(w)&&w||[]),m(arguments))},_.prototype.mv=function(w,A){return this._runTask(vt(w,A),m(arguments))},_.prototype.checkoutLatestTag=function(w){var A=this;return this.pull(function(){A.tags(function(N,we){A.checkout(we.latest,w)})})},_.prototype.pull=function(w,A,N,we){return this._runTask(mv(d(w,u),d(A,u),p(arguments)),m(arguments))},_.prototype.fetch=function(w,A){return this._runTask(jr(d(w,u),d(A,u),p(arguments)),m(arguments))},_.prototype.silent=function(w){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.")))},_.prototype.tags=function(w,A){return this._runTask(Rv(p(arguments)),m(arguments))},_.prototype.rebase=function(){return this._runTask(Be(["rebase",...p(arguments)]),m(arguments))},_.prototype.reset=function(w){return this._runTask(Sv(Ev(w),p(arguments)),m(arguments))},_.prototype.revert=function(w){let A=m(arguments);return typeof w!="string"?this._runTask(s("Commit must be a string"),A):this._runTask(Be(["revert",...p(arguments,0,!0),w]),A)},_.prototype.addTag=function(w){let A=typeof w=="string"?Iv(w):s("Git.addTag requires a tag name");return this._runTask(A,m(arguments))},_.prototype.addAnnotatedTag=function(w,A){return this._runTask(Ov(w,A),m(arguments))},_.prototype.deleteLocalBranch=function(w,A,N){return this._runTask(W(w,typeof A=="boolean"?A:!1),m(arguments))},_.prototype.deleteLocalBranches=function(w,A,N){return this._runTask(V(w,typeof A=="boolean"?A:!1),m(arguments))},_.prototype.branch=function(w,A){return this._runTask(T(p(arguments)),m(arguments))},_.prototype.branchLocal=function(w){return this._runTask(S(),m(arguments))},_.prototype.raw=function(w){let A=!Array.isArray(w),N=[].slice.call(A?arguments:w,0);for(let $e=0;$e<N.length&&A;$e++)if(!l(N[$e])){N.splice($e,N.length-$e);break}N.push(...p(arguments,0,!0));var we=m(arguments);return N.length?this._runTask(Be(N,this._trimmed),we):this._runTask(s("Raw: must supply one or more command to execute"),we)},_.prototype.submoduleAdd=function(w,A,N){return this._runTask(Av(w,A),m(arguments))},_.prototype.submoduleUpdate=function(w,A){return this._runTask(_v(p(arguments,!0)),m(arguments))},_.prototype.submoduleInit=function(w,A){return this._runTask(Tv(p(arguments,!0)),m(arguments))},_.prototype.subModule=function(w,A){return this._runTask(Cv(p(arguments)),m(arguments))},_.prototype.listRemote=function(){return this._runTask(wv(p(arguments)),m(arguments))},_.prototype.addRemote=function(w,A,N){return this._runTask(gv(w,A,p(arguments)),m(arguments))},_.prototype.removeRemote=function(w,A){return this._runTask(bv(w),m(arguments))},_.prototype.getRemotes=function(w,A){return this._runTask(yv(w===!0),m(arguments))},_.prototype.remote=function(w,A){return this._runTask(xv(p(arguments)),m(arguments))},_.prototype.tag=function(w,A){let N=p(arguments);return N[0]!=="tag"&&N.unshift("tag"),this._runTask(Be(N),m(arguments))},_.prototype.updateServerInfo=function(w){return this._runTask(Be(["update-server-info"]),m(arguments))},_.prototype.pushTags=function(w,A){let N=hv({remote:d(w,u)},p(arguments));return this._runTask(N,m(arguments))},_.prototype.rm=function(w){return this._runTask(Be(["rm","-f",...a(w)]),m(arguments))},_.prototype.rmKeepLocal=function(w){return this._runTask(Be(["rm","--cached",...a(w)]),m(arguments))},_.prototype.catFile=function(w,A){return this._catFile("utf-8",arguments)},_.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},_.prototype._catFile=function(w,A){var N=m(A),we=["cat-file"],$e=A[0];if(typeof $e=="string")return this._runTask(s("Git.catFile: options must be supplied as an array of strings"),N);Array.isArray($e)&&we.push.apply(we,$e);let os=w==="buffer"?kv(we):Be(we);return this._runTask(os,N)},_.prototype.diff=function(w,A){let N=u(w)?s("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Be(["diff",...p(arguments)]);return this._runTask(N,m(arguments))},_.prototype.diffSummary=function(){return this._runTask(Ae(p(arguments,1)),m(arguments))},_.prototype.applyPatch=function(w){let A=f(w)?h(a(w),p([].slice.call(arguments,1))):s("git.applyPatch requires one or more string patches as the first argument");return this._runTask(A,m(arguments))},_.prototype.revparse=function(){let w=["rev-parse",...p(arguments,!0)];return this._runTask(Be(w,!0),m(arguments))},_.prototype.clean=function(w,A,N){let we=De(w),$e=we&&w.join("")||d(w,u)||"",os=p([].slice.call(arguments,we?1:0));return this._runTask(Ne($e,os),m(arguments))},_.prototype.exec=function(w){let A={commands:[],format:"utf-8",parser(){typeof w=="function"&&w()}};return this._runTask(A)},_.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.")))},_.prototype.checkIgnore=function(w,A){return this._runTask(ve(a(d(w,f,[]))),m(arguments))},_.prototype.checkIsRepo=function(w,A){return this._runTask(ue(d(w,u)),m(arguments))},t.exports=_}});St();var UP=class extends st{constructor(e,t){super(void 0,t),this.config=e}};St();St();var Dr=class extends st{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};$r();dx();kx();Gx();Yx();Wx();Xx();eb();function jP(e){return e?[{type:"spawn.before",action(n,i){e.aborted&&i.kill(new Dr(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,i){function o(){i.kill(new Dr(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),i.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function BP(e={}){return{type:"spawn.args",action(t,{env:r}){for(let n of Nw(t,r))if(e[n.category]!==!0)throw new Dr(void 0,"unsafe",n.message);return t}}}O();function GP(e){let t=Cn(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var cx=(0,Fr.deferred)().promise;function qP({onClose:e=!0,onExit:t=50}={}){function r(){let i=-1,o={close:(0,Fr.deferred)(),closeTimeout:(0,Fr.deferred)(),exit:(0,Fr.deferred)(),exitTimeout:(0,Fr.deferred)()},s=Promise.race([e===!1?cx:o.closeTimeout.promise,t===!1?cx:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(a){i=a,o.close.done()},exit(a){i=a,o.exit.done()},get exitCode(){return i},result:s}}function n(i,o,s){i!==!1&&(i===!0?o.promise:o.promise.then(()=>Jc(i))).then(s.done)}return{type:"spawn.after",async action(i,{spawned:o,close:s}){let a=r(),c=!0,l=()=>void(c=!1);o.stdout?.on("data",l),o.stderr?.on("data",l),o.on("error",l),o.on("close",u=>a.close(u)),o.on("exit",u=>a.exit(u));try{await a.result,c&&await Jc(50),s(a.exitCode)}catch(u){s(a.exitCode,u)}}}}O();var HP="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",lx="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function YP(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function ux(e,t){if(e.length<1||e.length>2)throw new Dr(void 0,"binary",HP);if(e.some(YP))if(t)console.warn(lx);else throw new Dr(void 0,"binary",lx);let[n,i]=e;return{binary:n,prefix:i}}function VP(e,t=["git"],r=!1){let n=ux(Je(t),r);e.on("binary",i=>{n=ux(Je(i),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",i=>n.prefix?[n.prefix,...i]:i)}St();function WP(e){return!!(e.exitCode&&e.stdErr.length)}function zP(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function KP(e=!1,t=WP,r=zP){return(n,i)=>!e&&n||!t(i)?n:r(i)}function fx(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 st(void 0,n.toString("utf-8"))}:{error:n}}}}O();var XP=class{constructor(){this.plugins=new Set,this.events=new dE.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=ke(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return Je(e).forEach(r=>r&&this.plugins.add(ke(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}};O();function JP(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,s){return r.includes(s.method)?xx(o,t):o}},{type:"spawn.after",action(o,s){s.commands.includes(t)&&s.spawned.stderr?.on("data",a=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));c&&e({method:s.method,stage:QP(c[1]),progress:F(c[2]),processed:F(c[3]),total:F(c[4])})})}}]}function QP(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function ZP(e){let t=Ex(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function eU({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,i){let o;function s(){o&&clearTimeout(o),o=setTimeout(c,e)}function a(){i.spawned.stdout?.off("data",s),i.spawned.stderr?.off("data",s),i.spawned.off("exit",a),i.spawned.off("close",a),o&&clearTimeout(o)}function c(){a(),i.kill(new Dr(void 0,"timeout","block timeout reached"))}r&&i.spawned.stdout?.on("data",s),t&&i.spawned.stderr?.on("data",s),i.spawned.on("exit",a),i.spawned.on("close",a),s()}}}function tU(){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(Oe(o)){n(kr(o));continue}if(o==="--"){n(e.slice(i+1).flatMap(s=>Oe(s)&&kr(s)||s));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}O();var rU=PP();function nU(e,t){let r=new XP,n=Tx(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!hl(n.baseDir))throw new UP(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(GP(n.config)),r.add(BP(n.unsafe)),r.add(qP(n.completion)),n.abort&&r.add(jP(n.abort)),n.progress&&r.add(JP(n.progress)),n.timeout&&r.add(eU(n.timeout)),n.spawnOptions&&r.add(ZP(n.spawnOptions)),r.add(tU()),r.add(fx(KP(!0))),n.errors&&r.add(fx(n.errors)),VP(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new rU(n,r)}$r();var mE=nU;var hE=L(require("path"),1);var{CONFIG_DIR:iU}=At,oU=hE.default.join(iU,"tags.yml");var eu=require("fs/promises"),av=L(require("path"),1);function Vt(e,t){$.warn(`no feedback impl - ${e} - ${t}`)}var Dl=class{constructor(t,r){this.message=t,r&&this.start(t)}set text(t){return this.message=t,this}start(t){return Vt("start",t),this}succeed(t){return Vt("succeed",t),this}stop(t){return Vt("stop",t),this}info(t){return Vt("info",t),this}progress(t,r,n){return Vt("progress",`${t}/${r} ${n}`),this.message=n,this}fail(t){return Vt("fail",t),this}warn(t){return Vt("warn",t),this}},sU=new Dl("No feedback implementation");var gE={name:"imdone-cli",version:"0.74.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",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",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"},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.0","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.25.2","esbuild-plugin-copy":"^2.1.1",glob:"^12.0.0",vitest:"^4.1.2"}};var sv=require("node:module"),n2=L(ov(),1),{name:X4,version:i2,engines:J4,description:Q4}=gE,Z4=(0,sv.createRequire)(__filename);var{CONFIG_FILE_YML:dK}=At;async function cv(e,t=["."]){let r=await l2(e,t),n=r?.files?.filter(i=>i.path!==".imdonepause")||[];return $.debug("hasLocalChanges: ",{projectPath:e,fileSpec:t,relevantFiles:n,totalFiles:r?.files?.length}),n.length>0}function o2(e){return e==="."||e===""||e.startsWith(":")||/[*?[\\\]]/.test(e)}async function s2(e,t){let r=lv(e);try{return await r.raw(["ls-files","--error-unmatch","--",t]),!0}catch{return!1}}async function a2(e,t=["."]){let r=[];for(let n of t){if(o2(n)){r.push(n);continue}try{await(0,eu.access)(av.default.join(e,n),At.F_OK),r.push(n);continue}catch{}await s2(e,n)?r.push(n):$.debug("Skipping missing git pathspec",{projectPath:e,spec:n})}return r}function c2(){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 l2(e,t=["."]){let r=lv(e),n=await a2(e,t);return n.length===0?($.debug("No matching files for git status:",{projectPath:e,fileSpec:t}),c2()):await r.status(n)}function lv(e){return mE({baseDir:e,timeout:{block:3e4,stash:6e4,commit:45e3}})}async function uv(e){try{return await br("git",["-C",e,"rev-parse"]),!0}catch{return!1}}async function pv(e){try{return e.fullBacklogDir?await Ge(e.fullBacklogDir)?{hasChanges:await cv(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}
168
+ `).map(LP).filter(Boolean);t||r.sort(function(i,o){let s=i.split("."),a=o.split(".");if(s.length===1||a.length===1)return kP(Oo(s[0]),Oo(a[0]));for(let c=0,l=Math.max(s.length,a.length);c<l;c++){let u=uE(Oo(s[c]),Oo(a[c]));if(u)return u}return 0});let n=t?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new ax(r,n)}}}),pE={};Y(pE,{addAnnotatedTagTask:()=>$P,addTagTask:()=>DP,tagListTask:()=>NP});function NP(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return fE(r,t)}}}function DP(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function $P(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var MP=x({"src/lib/tasks/tag.ts"(){"use strict";FP()}}),PP=t$({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(j$(),B(ib)),{SimpleGitApi:n}=(jM(),B(Ub)),{Scheduler:i}=(BM(),B(jb)),{adhocExecTask:o,configurationErrorTask:s}=(G(),B(nl)),{asArray:a,filterArray:c,filterPrimitives:l,filterString:u,filterStringOrStringArray:f,filterType:d,getTrailingOptions:p,trailingFunctionArgument:m,trailingOptionsArgument:y}=(O(),B(_x)),{applyPatchTask:h}=(qM(),B(qb)),{branchTask:T,branchLocalTask:S,deleteBranchesTask:V,deleteBranchTask:W}=(eP(),B(Xb)),{checkIgnoreTask:ve}=(iP(),B(eE)),{checkIsRepoTask:ue}=(kx(),B(Ox)),{cleanWithOptionsTask:Ne,isCleanOptionsArray:De}=(Gx(),B(jx)),{diffSummaryTask:Ae}=(kl(),B(yb)),{fetchTask:jr}=(lP(),B(rE)),{moveTask:vt}=(dP(),B(iE)),{pullTask:mv}=(hP(),B(oE)),{pushTagsTask:hv}=(Lb(),B(kb)),{addRemoteTask:gv,getRemotesTask:yv,listRemotesTask:wv,remoteTask:xv,removeRemoteTask:bv}=(AP(),B(aE)),{getResetMode:Ev,resetTask:Sv}=(eb(),B(Jx)),{stashListTask:vv}=(CP(),B(cE)),{addSubModuleTask:Av,initSubModuleTask:Tv,subModuleTask:Cv,updateSubModuleTask:_v}=(RP(),B(lE)),{addAnnotatedTagTask:Ov,addTagTask:Iv,tagListTask:Rv}=(MP(),B(pE)),{straightThroughBufferTask:kv,straightThroughStringTask:Be}=(G(),B(nl));function _(w,A){this._plugins=A,this._executor=new r(w.baseDir,new i(w.maxConcurrentProcesses),A),this._trimmed=w.trimmed}(_.prototype=Object.create(n.prototype)).constructor=_,_.prototype.customBinary=function(w){return this._plugins.reconfigure("binary",w),this},_.prototype.env=function(w,A){return arguments.length===1&&typeof w=="object"?this._executor.env=w:(this._executor.env=this._executor.env||{})[w]=A,this},_.prototype.stashList=function(w){return this._runTask(vv(y(arguments)||{},c(w)&&w||[]),m(arguments))},_.prototype.mv=function(w,A){return this._runTask(vt(w,A),m(arguments))},_.prototype.checkoutLatestTag=function(w){var A=this;return this.pull(function(){A.tags(function(N,we){A.checkout(we.latest,w)})})},_.prototype.pull=function(w,A,N,we){return this._runTask(mv(d(w,u),d(A,u),p(arguments)),m(arguments))},_.prototype.fetch=function(w,A){return this._runTask(jr(d(w,u),d(A,u),p(arguments)),m(arguments))},_.prototype.silent=function(w){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.")))},_.prototype.tags=function(w,A){return this._runTask(Rv(p(arguments)),m(arguments))},_.prototype.rebase=function(){return this._runTask(Be(["rebase",...p(arguments)]),m(arguments))},_.prototype.reset=function(w){return this._runTask(Sv(Ev(w),p(arguments)),m(arguments))},_.prototype.revert=function(w){let A=m(arguments);return typeof w!="string"?this._runTask(s("Commit must be a string"),A):this._runTask(Be(["revert",...p(arguments,0,!0),w]),A)},_.prototype.addTag=function(w){let A=typeof w=="string"?Iv(w):s("Git.addTag requires a tag name");return this._runTask(A,m(arguments))},_.prototype.addAnnotatedTag=function(w,A){return this._runTask(Ov(w,A),m(arguments))},_.prototype.deleteLocalBranch=function(w,A,N){return this._runTask(W(w,typeof A=="boolean"?A:!1),m(arguments))},_.prototype.deleteLocalBranches=function(w,A,N){return this._runTask(V(w,typeof A=="boolean"?A:!1),m(arguments))},_.prototype.branch=function(w,A){return this._runTask(T(p(arguments)),m(arguments))},_.prototype.branchLocal=function(w){return this._runTask(S(),m(arguments))},_.prototype.raw=function(w){let A=!Array.isArray(w),N=[].slice.call(A?arguments:w,0);for(let $e=0;$e<N.length&&A;$e++)if(!l(N[$e])){N.splice($e,N.length-$e);break}N.push(...p(arguments,0,!0));var we=m(arguments);return N.length?this._runTask(Be(N,this._trimmed),we):this._runTask(s("Raw: must supply one or more command to execute"),we)},_.prototype.submoduleAdd=function(w,A,N){return this._runTask(Av(w,A),m(arguments))},_.prototype.submoduleUpdate=function(w,A){return this._runTask(_v(p(arguments,!0)),m(arguments))},_.prototype.submoduleInit=function(w,A){return this._runTask(Tv(p(arguments,!0)),m(arguments))},_.prototype.subModule=function(w,A){return this._runTask(Cv(p(arguments)),m(arguments))},_.prototype.listRemote=function(){return this._runTask(wv(p(arguments)),m(arguments))},_.prototype.addRemote=function(w,A,N){return this._runTask(gv(w,A,p(arguments)),m(arguments))},_.prototype.removeRemote=function(w,A){return this._runTask(bv(w),m(arguments))},_.prototype.getRemotes=function(w,A){return this._runTask(yv(w===!0),m(arguments))},_.prototype.remote=function(w,A){return this._runTask(xv(p(arguments)),m(arguments))},_.prototype.tag=function(w,A){let N=p(arguments);return N[0]!=="tag"&&N.unshift("tag"),this._runTask(Be(N),m(arguments))},_.prototype.updateServerInfo=function(w){return this._runTask(Be(["update-server-info"]),m(arguments))},_.prototype.pushTags=function(w,A){let N=hv({remote:d(w,u)},p(arguments));return this._runTask(N,m(arguments))},_.prototype.rm=function(w){return this._runTask(Be(["rm","-f",...a(w)]),m(arguments))},_.prototype.rmKeepLocal=function(w){return this._runTask(Be(["rm","--cached",...a(w)]),m(arguments))},_.prototype.catFile=function(w,A){return this._catFile("utf-8",arguments)},_.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},_.prototype._catFile=function(w,A){var N=m(A),we=["cat-file"],$e=A[0];if(typeof $e=="string")return this._runTask(s("Git.catFile: options must be supplied as an array of strings"),N);Array.isArray($e)&&we.push.apply(we,$e);let os=w==="buffer"?kv(we):Be(we);return this._runTask(os,N)},_.prototype.diff=function(w,A){let N=u(w)?s("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Be(["diff",...p(arguments)]);return this._runTask(N,m(arguments))},_.prototype.diffSummary=function(){return this._runTask(Ae(p(arguments,1)),m(arguments))},_.prototype.applyPatch=function(w){let A=f(w)?h(a(w),p([].slice.call(arguments,1))):s("git.applyPatch requires one or more string patches as the first argument");return this._runTask(A,m(arguments))},_.prototype.revparse=function(){let w=["rev-parse",...p(arguments,!0)];return this._runTask(Be(w,!0),m(arguments))},_.prototype.clean=function(w,A,N){let we=De(w),$e=we&&w.join("")||d(w,u)||"",os=p([].slice.call(arguments,we?1:0));return this._runTask(Ne($e,os),m(arguments))},_.prototype.exec=function(w){let A={commands:[],format:"utf-8",parser(){typeof w=="function"&&w()}};return this._runTask(A)},_.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.")))},_.prototype.checkIgnore=function(w,A){return this._runTask(ve(a(d(w,f,[]))),m(arguments))},_.prototype.checkIsRepo=function(w,A){return this._runTask(ue(d(w,u)),m(arguments))},t.exports=_}});St();var UP=class extends st{constructor(e,t){super(void 0,t),this.config=e}};St();St();var Dr=class extends st{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};$r();dx();kx();Gx();Yx();Wx();Xx();eb();function jP(e){return e?[{type:"spawn.before",action(n,i){e.aborted&&i.kill(new Dr(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,i){function o(){i.kill(new Dr(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),i.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function BP(e={}){return{type:"spawn.args",action(t,{env:r}){for(let n of Nw(t,r))if(e[n.category]!==!0)throw new Dr(void 0,"unsafe",n.message);return t}}}O();function GP(e){let t=Cn(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var cx=(0,Fr.deferred)().promise;function qP({onClose:e=!0,onExit:t=50}={}){function r(){let i=-1,o={close:(0,Fr.deferred)(),closeTimeout:(0,Fr.deferred)(),exit:(0,Fr.deferred)(),exitTimeout:(0,Fr.deferred)()},s=Promise.race([e===!1?cx:o.closeTimeout.promise,t===!1?cx:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(a){i=a,o.close.done()},exit(a){i=a,o.exit.done()},get exitCode(){return i},result:s}}function n(i,o,s){i!==!1&&(i===!0?o.promise:o.promise.then(()=>Jc(i))).then(s.done)}return{type:"spawn.after",async action(i,{spawned:o,close:s}){let a=r(),c=!0,l=()=>void(c=!1);o.stdout?.on("data",l),o.stderr?.on("data",l),o.on("error",l),o.on("close",u=>a.close(u)),o.on("exit",u=>a.exit(u));try{await a.result,c&&await Jc(50),s(a.exitCode)}catch(u){s(a.exitCode,u)}}}}O();var HP="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",lx="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function YP(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function ux(e,t){if(e.length<1||e.length>2)throw new Dr(void 0,"binary",HP);if(e.some(YP))if(t)console.warn(lx);else throw new Dr(void 0,"binary",lx);let[n,i]=e;return{binary:n,prefix:i}}function VP(e,t=["git"],r=!1){let n=ux(Je(t),r);e.on("binary",i=>{n=ux(Je(i),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",i=>n.prefix?[n.prefix,...i]:i)}St();function WP(e){return!!(e.exitCode&&e.stdErr.length)}function zP(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function KP(e=!1,t=WP,r=zP){return(n,i)=>!e&&n||!t(i)?n:r(i)}function fx(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 st(void 0,n.toString("utf-8"))}:{error:n}}}}O();var XP=class{constructor(){this.plugins=new Set,this.events=new dE.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=ke(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return Je(e).forEach(r=>r&&this.plugins.add(ke(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}};O();function JP(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,s){return r.includes(s.method)?xx(o,t):o}},{type:"spawn.after",action(o,s){s.commands.includes(t)&&s.spawned.stderr?.on("data",a=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));c&&e({method:s.method,stage:QP(c[1]),progress:F(c[2]),processed:F(c[3]),total:F(c[4])})})}}]}function QP(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function ZP(e){let t=Ex(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function eU({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,i){let o;function s(){o&&clearTimeout(o),o=setTimeout(c,e)}function a(){i.spawned.stdout?.off("data",s),i.spawned.stderr?.off("data",s),i.spawned.off("exit",a),i.spawned.off("close",a),o&&clearTimeout(o)}function c(){a(),i.kill(new Dr(void 0,"timeout","block timeout reached"))}r&&i.spawned.stdout?.on("data",s),t&&i.spawned.stderr?.on("data",s),i.spawned.on("exit",a),i.spawned.on("close",a),s()}}}function tU(){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(Oe(o)){n(kr(o));continue}if(o==="--"){n(e.slice(i+1).flatMap(s=>Oe(s)&&kr(s)||s));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}O();var rU=PP();function nU(e,t){let r=new XP,n=Tx(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!hl(n.baseDir))throw new UP(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(GP(n.config)),r.add(BP(n.unsafe)),r.add(qP(n.completion)),n.abort&&r.add(jP(n.abort)),n.progress&&r.add(JP(n.progress)),n.timeout&&r.add(eU(n.timeout)),n.spawnOptions&&r.add(ZP(n.spawnOptions)),r.add(tU()),r.add(fx(KP(!0))),n.errors&&r.add(fx(n.errors)),VP(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new rU(n,r)}$r();var mE=nU;var hE=L(require("path"),1);var{CONFIG_DIR:iU}=At,oU=hE.default.join(iU,"tags.yml");var eu=require("fs/promises"),av=L(require("path"),1);function Vt(e,t){$.warn(`no feedback impl - ${e} - ${t}`)}var Dl=class{constructor(t,r){this.message=t,r&&this.start(t)}set text(t){return this.message=t,this}start(t){return Vt("start",t),this}succeed(t){return Vt("succeed",t),this}stop(t){return Vt("stop",t),this}info(t){return Vt("info",t),this}progress(t,r,n){return Vt("progress",`${t}/${r} ${n}`),this.message=n,this}fail(t){return Vt("fail",t),this}warn(t){return Vt("warn",t),this}},sU=new Dl("No feedback implementation");var gE={name:"imdone-cli",version:"0.74.1",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",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",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"},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.0","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.25.2","esbuild-plugin-copy":"^2.1.1",glob:"^12.0.0",vitest:"^4.1.2"}};var sv=require("node:module"),n2=L(ov(),1),{name:X4,version:i2,engines:J4,description:Q4}=gE,Z4=(0,sv.createRequire)(__filename);var{CONFIG_FILE_YML:dK}=At;async function cv(e,t=["."]){let r=await l2(e,t),n=r?.files?.filter(i=>i.path!==".imdonepause")||[];return $.debug("hasLocalChanges: ",{projectPath:e,fileSpec:t,relevantFiles:n,totalFiles:r?.files?.length}),n.length>0}function o2(e){return e==="."||e===""||e.startsWith(":")||/[*?[\\\]]/.test(e)}async function s2(e,t){let r=lv(e);try{return await r.raw(["ls-files","--error-unmatch","--",t]),!0}catch{return!1}}async function a2(e,t=["."]){let r=[];for(let n of t){if(o2(n)){r.push(n);continue}try{await(0,eu.access)(av.default.join(e,n),At.F_OK),r.push(n);continue}catch{}await s2(e,n)?r.push(n):$.debug("Skipping missing git pathspec",{projectPath:e,spec:n})}return r}function c2(){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 l2(e,t=["."]){let r=lv(e),n=await a2(e,t);return n.length===0?($.debug("No matching files for git status:",{projectPath:e,fileSpec:t}),c2()):await r.status(n)}function lv(e){return mE({baseDir:e,timeout:{block:3e4,stash:6e4,commit:45e3}})}async function uv(e){try{return await br("git",["-C",e,"rev-parse"]),!0}catch{return!1}}async function pv(e){try{return e.fullBacklogDir?await Ge(e.fullBacklogDir)?{hasChanges:await cv(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}
169
169
  `),{hasChanges:!1}}}function u2(){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 dv(){process.stdout.write(`
170
170
  \u{1F50D} Checking for backlog changes...
171
171
  `);try{let e=u2(),t=new So;if(await t.load(e),!await uv(t.projectPath)){process.stdout.write(`\u2139\uFE0F Not in a git repository, skipping backlog check